From 1ddc2c338b601d33e0fd10806406442a409ed62b Mon Sep 17 00:00:00 2001 From: IanHollow <72767437+IanHollow@users.noreply.github.com> Date: Wed, 14 Oct 2026 13:12:53 -0700 Subject: [PATCH 001/817] Fit contributor columns inside the About window Assisted-by: OpenAI Codex (GPT-6) Signed-off-by: IanHollow <72767437+IanHollow@users.noreply.github.com> --- crates/ui-egui/src/credits.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/credits.rs b/crates/ui-egui/src/credits.rs index 3fc8b7a2b..3c8dfca71 100644 --- a/crates/ui-egui/src/credits.rs +++ b/crates/ui-egui/src/credits.rs @@ -245,7 +245,7 @@ const TABLE_ROW_H: f32 = 22.0; /// Room for the sort arrow in every header, so the columns don't move when the sort does. const SORT_ARROW_W: f32 = 12.0; /// Padding inside each cell, on each side. -const CELL_PAD: f32 = 6.0; +const CELL_PAD: f32 = 5.0; const NAME_MIN_W: f32 = 110.0; /// About ▸ Contributors: a name toggle, a sort, and the list as a grab bag or a table. From 7a8e5373b19b021c7c2a76fc4ad4f6e499a8eeb4 Mon Sep 17 00:00:00 2001 From: Skyfuller1303 Date: Thu, 15 Oct 2026 00:02:41 +0200 Subject: [PATCH 002/817] M7: keep Windows windowed UI and canvas text sharp --- ROADMAP.md | 3 +- apps/figcraft/src/graphics.rs | 28 +++- apps/figcraft/src/graphics_tests.rs | 67 ++++++++- crates/ui-egui/src/canvas.rs | 140 +++++++++++++++++- docs/hardware-parity.md | 18 ++- docs/images/shot-windowed-canvas-after-en.png | Bin 0 -> 261324 bytes .../images/shot-windowed-canvas-before-en.png | Bin 0 -> 305165 bytes docs/ui-parity.md | 4 +- 8 files changed, 250 insertions(+), 10 deletions(-) create mode 100644 docs/images/shot-windowed-canvas-after-en.png create mode 100644 docs/images/shot-windowed-canvas-before-en.png diff --git a/ROADMAP.md b/ROADMAP.md index 46c0fd29b..18a7f59e5 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-14 · **Change:** minor (recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-14 · **Change:** minor (DirectComposition presentation for sharp Windows windowed UI; canvas texture placement aligned to device pixels to avoid interpolation blur; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -312,6 +312,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-14 | minor | Windows UI sharpness: use DirectComposition for Direct3D 12 presentation, preserving explicit overrides. Native-density canvas images align to device pixels at fractional zoom, pan and display scaling. Readiness scores unchanged. | | 2026-10-14 | minor | Home screen recent files as cards (M7): each card shows the picture its file carries on its first page's colour, the file's icon, name and "Edited ... ago"; sort by name, creation or last change either way; a table view; a click selects, a double-click or Enter opens, arrow keys move; Open, Show in folder and Remove from recents on right-click. Numbers unchanged. | | 2026-10-14 | minor | Lost images reported on loading (#207): a `.figcraft` file whose image member is damaged, too large or missing no longer loads in silence; each lost image (up to 20, then a count) is listed in `repairs` on `file.open` with its hash and the reason, and the app shows it as a toast. Saving still writes the file without the lost images. Numbers unchanged | | 2026-10-14 | minor | SVG import budgets (#190): gzipped SVG is unpacked by FigCraft within 64 MiB before parsing (it was unpacked without a limit), so the nesting check sees the real document; SVG documents embedded in `` data URIs share one 32 MiB budget and at most 4 levels, and one past a budget is left out. Linked files stay unread. Numbers unchanged | diff --git a/apps/figcraft/src/graphics.rs b/apps/figcraft/src/graphics.rs index ee7b74fad..e456b2de7 100644 --- a/apps/figcraft/src/graphics.rs +++ b/apps/figcraft/src/graphics.rs @@ -5,12 +5,14 @@ //! an access violation inside the vendor's driver, which no guard of ours can catch (seen on a laptop //! with two AMD GPUs whose drivers were years apart). Direct3D 12 is part of Windows, so on Windows //! wgpu is offered Direct3D 12, and OpenGL for hardware without a Direct3D 12 driver. +//! Windows Direct3D 12 uses DirectComposition by default so window resizing keeps the UI sharp. +//! `WGPU_DX12_PRESENTATION_SYSTEM` can select `Visual` or roll back to `Hwnd`. //! //! `WGPU_BACKEND` (`dx12`, `vulkan`, `gl`, `metal`) still names the backend on every system, and //! systems other than Windows keep eframe's defaults. use eframe::egui_wgpu::{WgpuConfiguration, WgpuSetup}; -use eframe::wgpu::Backends; +use eframe::wgpu::{Backends, Dx12SwapchainKind}; /// Direct3D 12, then OpenGL: wgpu ranks a hardware GPU on either ahead of Direct3D's software one. const WINDOWS: Backends = Backends::DX12.union(Backends::GL); @@ -25,10 +27,32 @@ pub fn backends(requested: Option, windows: bool, defaults: Backends) } } +/// The DX12 presentation system: explicit setting wins, else Windows uses DirectComposition. +pub(super) fn presentation_system(requested: Option, windows: bool, defaults: Dx12SwapchainKind) -> Dx12SwapchainKind { + match requested { + Some(requested) => requested, + None if windows => Dx12SwapchainKind::DxgiFromVisual, + None => defaults, + } +} + /// Offer wgpu [`backends`] instead of eframe's defaults. pub fn configure(options: &mut WgpuConfiguration) { + configure_for_platform(options, Backends::from_env(), Dx12SwapchainKind::from_env(), cfg!(windows)); +} + +pub(super) fn configure_for_platform( + options: &mut WgpuConfiguration, + requested_backends: Option, + requested_presentation: Option, + windows: bool, +) { if let WgpuSetup::CreateNew(create) = &mut options.wgpu_setup { let offered = &mut create.instance_descriptor.backends; - *offered = backends(Backends::from_env(), cfg!(windows), *offered); + *offered = backends(requested_backends, windows, *offered); + if windows { + let presentation = &mut create.instance_descriptor.backend_options.dx12.presentation_system; + *presentation = presentation_system(requested_presentation, windows, *presentation); + } } } diff --git a/apps/figcraft/src/graphics_tests.rs b/apps/figcraft/src/graphics_tests.rs index e103d32fa..14d0bd409 100644 --- a/apps/figcraft/src/graphics_tests.rs +++ b/apps/figcraft/src/graphics_tests.rs @@ -1,9 +1,10 @@ //! The backends offered to wgpu: no Vulkan on Windows unless it is asked for (a faulting Vulkan //! driver crashed the app as its window opened), and nothing changed anywhere else. -use eframe::wgpu::Backends; +use eframe::egui_wgpu::{WgpuConfiguration, WgpuSetup}; +use eframe::wgpu::{Backends, Dx12SwapchainKind}; -use crate::graphics::backends; +use crate::graphics::{backends, configure_for_platform, presentation_system}; /// What eframe offers when `WGPU_BACKEND` isn't set. const DEFAULTS: Backends = Backends::PRIMARY.union(Backends::GL); @@ -30,3 +31,65 @@ fn other_systems_keep_eframes_defaults() { assert_eq!(backends(None, false, DEFAULTS), DEFAULTS); assert_eq!(backends(None, false, Backends::METAL), Backends::METAL); } + +#[test] +fn windows_defaults_to_direct_composition_visual() { + assert_eq!(presentation_system(None, true, Dx12SwapchainKind::DxgiFromHwnd), Dx12SwapchainKind::DxgiFromVisual); +} + +#[test] +fn valid_presentation_override_wins_on_all_platforms() { + for requested in [Dx12SwapchainKind::DxgiFromHwnd, Dx12SwapchainKind::DxgiFromVisual] { + for windows in [true, false] { + assert_eq!(presentation_system(Some(requested), windows, Dx12SwapchainKind::DxgiFromVisual), requested); + } + } +} + +#[test] +fn other_platforms_keep_existing_presentation_system() { + assert_eq!(presentation_system(None, false, Dx12SwapchainKind::DxgiFromHwnd), Dx12SwapchainKind::DxgiFromHwnd); +} + +#[test] +fn create_new_configuration_uses_windows_default_and_explicit_override() { + let mut options = WgpuConfiguration::default(); + set_presentation_system(&mut options, Dx12SwapchainKind::DxgiFromHwnd); + configure_for_platform(&mut options, None, None, true); + assert_eq!(configured_presentation_system(&options), Some(Dx12SwapchainKind::DxgiFromVisual)); + + for requested in [Dx12SwapchainKind::DxgiFromHwnd, Dx12SwapchainKind::DxgiFromVisual] { + let mut options = WgpuConfiguration::default(); + set_presentation_system(&mut options, Dx12SwapchainKind::DxgiFromHwnd); + configure_for_platform(&mut options, None, Some(requested), true); + assert_eq!(configured_presentation_system(&options), Some(requested)); + } +} + +#[test] +fn non_windows_configuration_keeps_existing_presentation_system() { + let mut options = WgpuConfiguration::default(); + set_presentation_system(&mut options, Dx12SwapchainKind::DxgiFromHwnd); + let backends_before = configured_backends(&options); + configure_for_platform(&mut options, None, Some(Dx12SwapchainKind::DxgiFromVisual), false); + assert_eq!(configured_presentation_system(&options), Some(Dx12SwapchainKind::DxgiFromHwnd)); + assert_eq!(configured_backends(&options), backends_before); +} + +fn set_presentation_system(options: &mut WgpuConfiguration, presentation: Dx12SwapchainKind) { + if let WgpuSetup::CreateNew(create) = &mut options.wgpu_setup { + create.instance_descriptor.backend_options.dx12.presentation_system = presentation; + } +} + +fn configured_presentation_system(options: &WgpuConfiguration) -> Option { + if let WgpuSetup::CreateNew(create) = &options.wgpu_setup { + Some(create.instance_descriptor.backend_options.dx12.presentation_system) + } else { + None + } +} + +fn configured_backends(options: &WgpuConfiguration) -> Option { + if let WgpuSetup::CreateNew(create) = &options.wgpu_setup { Some(create.instance_descriptor.backends) } else { None } +} diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index eb23c8de0..ba24e258d 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -204,9 +204,9 @@ pub fn show(app: &mut FigApp, ui: &mut Ui, worker: &mut Worker) { // Re-project the last render onto the current view. let tl = app.to_screen(v.origin.0, v.origin.1); let zoom = app.session.ds().map(|d| d.view.zoom).unwrap_or(1.0); - let w = (f64::from(v.width) / v.scale * zoom) as f32; - let h = (f64::from(v.height) / v.scale * zoom) as f32; - painter.image(tex.id(), Rect::from_min_size(tl, vec2(w, h)), Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE); + let pixel_preview = app.session.ds().ok().and_then(|ds| ds.view.pixel_preview_scale()) == Some(v.scale); + let image_rect = presented_image_rect(tl, v, zoom, ppp, pixel_preview); + painter.image(tex.id(), image_rect, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE); } app.session.tool.labels = overlays(app, &painter, &t); // The zoom tool's area. @@ -238,6 +238,22 @@ pub fn show(app: &mut FigApp, ui: &mut Ui, worker: &mut Worker) { } } +/// The image's screen rect; align native-density renders to device pixels to avoid linear filtering +/// blending neighbouring texels. Stale and pixel-preview renders retain their original projection. +fn presented_image_rect(tl: Pos2, view: &figcraft_render::View, zoom: f64, ppp: f32, pixel_preview: bool) -> Rect { + let w = (f64::from(view.width) / view.scale * zoom) as f32; + let h = (f64::from(view.height) / view.scale * zoom) as f32; + let native_density = !pixel_preview + && ppp.is_finite() + && ppp > 0.0 + && zoom.is_finite() + && view.scale.is_finite() + && view.scale > 0.0 + && (view.scale - zoom * f64::from(ppp)).abs() <= view.scale.abs().max(1.0) * 1e-9; + let min = if native_density { pos2((tl.x * ppp).round() / ppp, (tl.y * ppp).round() / ppp) } else { tl }; + Rect::from_min_size(min, vec2(w, h)) +} + /// What the canvas says to screen readers: the selected layer ("Rectangle 1, Rectangle, 120 by 80, /// selected"), how many are selected, or the page with nothing selected. pub fn describe(s: &figcraft_engine::Session) -> String { @@ -1342,3 +1358,121 @@ pub fn fmt(v: f64) -> String { let r = (v * 100.0).round() / 100.0; if (r - r.round()).abs() < 1e-9 { format!("{}", r.round() as i64) } else { format!("{r}") } } + +#[cfg(test)] +mod canvas_image_rect_tests { + use super::presented_image_rect; + use egui::{Pos2, RawInput, Rect, pos2, vec2}; + use figcraft_render::View; + + fn resized_frame(ui: &mut crate::layers_drag_tests::Ui, worker: &mut crate::render_worker::Worker, size: [f32; 2], ppp: f32) -> egui::FullOutput { + let ctx = ui.ctx.clone(); + let time = ctx.input(|i| i.time) + 1.0 / 60.0; + let mut input = + RawInput { screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(size[0], size[1]))), time: Some(time), ..Default::default() }; + input.viewports.entry(egui::ViewportId::ROOT).or_default().native_pixels_per_point = Some(ppp); + let mut output = ctx.run_ui(input, |egui_ui| super::show(&mut ui.app, egui_ui, worker)); + output.textures_delta.clear(); + output + } + + #[test] + fn native_density_image_edges_align_to_device_pixels_without_changing_extent() { + for ppp in [1.0_f32, 1.25, 1.5, 2.0] { + for zoom in [0.37_f64, 0.67, 1.0, 1.3, 2.0] { + let scale = zoom * f64::from(ppp); + let view = View { origin: (-31.25, 18.75), scale, width: 375, height: 240 }; + for (cx, cy, canvas_x, canvas_y) in [(-200.5, 74.25, 100.25, 50.5), (10.0, -20.5, 3.25, 9.75), (913.75, 481.125, 212.5, 77.125)] { + let tl = pos2(canvas_x + ((view.origin.0 - cx) * zoom) as f32, canvas_y + ((view.origin.1 - cy) * zoom) as f32); + let rect = presented_image_rect(tl, &view, zoom, ppp, false); + assert!((rect.min.x - tl.x).abs() * ppp <= 0.5001, "x snap bound: ppp={ppp}, zoom={zoom}, tl={tl:?}, rect={rect:?}"); + assert!((rect.min.y - tl.y).abs() * ppp <= 0.5001, "y snap bound: ppp={ppp}, zoom={zoom}, tl={tl:?}, rect={rect:?}"); + assert!(((rect.min.x * ppp).round() - rect.min.x * ppp).abs() < 1e-4, "x edge: ppp={ppp}, zoom={zoom}, tl={tl:?}, rect={rect:?}"); + assert!(((rect.min.y * ppp).round() - rect.min.y * ppp).abs() < 1e-4, "y edge: ppp={ppp}, zoom={zoom}, tl={tl:?}, rect={rect:?}"); + assert!((rect.width() * ppp - view.width as f32).abs() < 1e-3, "width: ppp={ppp}, zoom={zoom}, rect={rect:?}"); + assert!((rect.height() * ppp - view.height as f32).abs() < 1e-3, "height: ppp={ppp}, zoom={zoom}, rect={rect:?}"); + } + } + } + } + + #[test] + fn stale_pixel_preview_and_invalid_density_keep_original_projection() { + let tl = Pos2::new(149.5, 91.25); + let view = View { origin: (0.0, 0.0), scale: 1.95, width: 300, height: 180 }; + let original = egui::Rect::from_min_size(tl, egui::vec2(200.0, 120.0)); + + let stale = presented_image_rect(tl, &view, 1.2, 1.5, false); + assert_eq!(stale, egui::Rect::from_min_size(tl, egui::vec2(300.0 / 1.95 * 1.2, 180.0 / 1.95 * 1.2))); + let pixel_preview = presented_image_rect(tl, &view, 1.3, 1.5, true); + assert_eq!(pixel_preview, original); + for ppp in [0.0, -1.0, f32::NAN, f32::INFINITY] { + assert_eq!(presented_image_rect(tl, &view, 1.3, ppp, false), original); + } + assert_eq!(tl, pos2(149.5, 91.25)); + } + + #[test] + fn canvas_mesh_stays_sharp_through_window_resizes() { + use std::time::{Duration, Instant}; + + use crate::live_tests::flat; + use figcraft_engine::Session; + + for ppp in [1.0_f32, 1.25, 1.5] { + let mut ui = crate::layers_drag_tests::Ui::new(Session::new()); + let mut worker = ui.app.worker.take().expect("worker from headless UI"); + let (zoom, center) = { + let ds = ui.app.session.ds_mut().expect("document state"); + ds.view.zoom = 1.3; + ds.view.cx = 123.5; + ds.view.cy = -87.25; + (ds.view.zoom, (ds.view.cx, ds.view.cy)) + }; + for size in [[1440.0, 900.0], [1000.0, 700.0], [800.0, 500.0], [1440.0, 900.0]] { + let start = Instant::now(); + let mut output; + loop { + output = resized_frame(&mut ui, &mut worker, size, ppp); + let has_current_texture = ui.app.canvas.tex_view.as_ref().is_some_and(|v| { + (v.scale - zoom * f64::from(ppp)).abs() < 1e-9 + && v.width == (ui.app.canvas.rect.width() * ppp).ceil() as u32 + 1 + && v.height == (ui.app.canvas.rect.height() * ppp).ceil() as u32 + 1 + && !worker.in_flight() + }); + if has_current_texture { + break; + } + assert!(start.elapsed() < Duration::from_secs(10), "render did not finish for size={size:?}, ppp={ppp}"); + std::thread::sleep(Duration::from_millis(2)); + } + + let (ds_zoom, ds_center) = { + let ds = ui.app.session.ds().expect("document state"); + (ds.view.zoom, (ds.view.cx, ds.view.cy)) + }; + assert_eq!(ds_zoom, zoom, "resize preserves zoom"); + assert_eq!(ds_center, center, "resize preserves page centre"); + + let tex = ui.app.canvas.texture.as_ref().expect("canvas texture"); + let mesh = flat(&output.shapes) + .into_iter() + .find_map(|shape| match shape { + egui::Shape::Mesh(mesh) if mesh.texture_id == tex.id() => Some(mesh), + _ => None, + }) + .expect("canvas image mesh"); + let min_x = mesh.vertices.iter().map(|v| v.pos.x).fold(f32::INFINITY, f32::min); + let min_y = mesh.vertices.iter().map(|v| v.pos.y).fold(f32::INFINITY, f32::min); + let max_x = mesh.vertices.iter().map(|v| v.pos.x).fold(f32::NEG_INFINITY, f32::max); + let max_y = mesh.vertices.iter().map(|v| v.pos.y).fold(f32::NEG_INFINITY, f32::max); + let view = ui.app.canvas.tex_view.as_ref().expect("canvas render view"); + assert!((min_x * ppp - (min_x * ppp).round()).abs() < 1e-4, "mesh left edge: {min_x}, ppp={ppp}"); + assert!((min_y * ppp - (min_y * ppp).round()).abs() < 1e-4, "mesh top edge: {min_y}, ppp={ppp}"); + assert!(((max_x - min_x) * ppp - view.width as f32).abs() < 1e-3, "mesh width matches texture"); + assert!(((max_y - min_y) * ppp - view.height as f32).abs() < 1e-3, "mesh height matches texture"); + } + assert!(!worker.in_flight(), "last resize render finished"); + } + } +} diff --git a/docs/hardware-parity.md b/docs/hardware-parity.md index 8995db252..a19211eae 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-10-11 · **Change:** minor (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) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-14 · **Change:** minor (DirectComposition presentation for Windows Direct3D 12; 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) · **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 @@ -46,10 +46,26 @@ Nothing has been timed against Figma on the same document (needs `.fig` import). | Web | primary (figma.com) | `figcraft-web` (WASM, WebGPU/WebGL2), web zip | no accessibility tree; file access through the browser | | iOS / Android | apps: view, comment, mirror prototypes | none (the web build is not touch-first) | 20–40 h for a viewer | +## Windows: presentation and text sharpness + +The desktop app offers Direct3D 12 and OpenGL on Windows. Direct3D 12 uses DirectComposition presentation (`DxgiFromVisual`) by default: a Windows 11 comparison found the entire interface sharp in smaller and snapped windows with this path, while the previous HWND presentation softened menus, the layers panel and canvas text. Backend selection and non-Windows presentation are unchanged. + +`WGPU_DX12_PRESENTATION_SYSTEM` still overrides presentation. To compare the previous HWND path, or use RenderDoc (which wgpu does not support with Visual presentation), start the executable from a temporary PowerShell session: + +```powershell +$env:WGPU_DX12_PRESENTATION_SYSTEM = 'Hwnd' +.\figcraft.exe +``` + +`Visual` explicitly selects DirectComposition; `WGPU_BACKEND=gl` selects OpenGL as another diagnostic comparison. Environment overrides belong to that shell and its child processes; closing the shell discards them. These comparisons do not change Windows display or driver settings. + +Canvas-only interpolation blur is addressed separately: native-density canvas textures start on device-pixel boundaries. The presentation change concerns the entire interface and does not change document geometry, text shaping or exported images. + ## Revision history | Date | Change | Summary | |---|---|---| +| 2026-10-14 | minor | Use DirectComposition for Windows Direct3D 12 presentation after a same-binary HWND/Visual/OpenGL comparison; preserve explicit presentation and backend overrides. Document the HWND override for diagnostics and RenderDoc. | | 2026-10-11 | minor | Windows QA pass (gap 8): everyday workflows on Windows 11 through the desktop app and MCP; fixed: unsaved changes lost when the app was killed or crashed (recovery copies every few seconds, reopened at the next start), Ctrl+arrows/Backspace/Delete acting on the whole line in text (now by word; Ctrl+Home/End to the text's ends), scrubbed fields snapping back on release, typing on a field Tab reached, Escape not closing dialogs, skewed or vanishing linear gradients, hints cut off at the panel edge, the window-close question in English in the Spanish interface. Percentages and hours unchanged | | 2026-10-11 | minor | Display P3 honest minimum (gap 18): the colour picker of a Display P3 file warns when a colour is outside sRGB (Outside sRGB, with what the canvas and exports do), and View ▸ Soft-proof sRGB (`view.proofSrgb`) stripes the canvas pixels sRGB can't show. Why the canvas still shows sRGB: wgpu 30 can present Display P3 or extended-range sRGB surfaces (Metal, DX12, Vulkan, WebGPU canvases), but eframe/egui-wgpu 0.36 configure an 8-bit sRGB surface with no option for the format or colour space, and egui's renderer writes sRGB-encoded UI colours; showing P3 needs those two upstream (or a patched egui-wgpu). Hardware 13–27 h → 12–26 h; gap 18 6–12 h → 5–11 h; percentages, feature breadth (~79%) and ready for real work (~47%) unchanged at this rounding; full parity ~363–697 h → ~362–696 h | | 2026-10-11 | minor | Several windows (gap 18): File ▸ New window, a tab's Open in new window or a tab dragged off the tab strip opens files in another window with its own tabs, panels and canvas, sharing the files, preferences, libraries and clipboard; each window draws only when it needs to (idle: ~0% CPU), closing one closes its files after asking about unsaved changes (the main window too, which takes over another window instead of quitting; the last window quits), and the control channel and MCP open, list, focus and capture windows (`window.new`, `window.list`, `window.focus`, `window` on any request); the screen-reader tree covers the main window only (eframe 0.36), so with a screen reader running files stay tabs; one window in the browser. Hardware 55% → 60%, 13–27 h → 10–21 h; gap 18 6–12 h → 4–8 h (P3 on screen left); feature breadth (~79%) and ready for real work (~47%) unchanged at this rounding; full parity ~363–697 h → ~360–691 h | diff --git a/docs/images/shot-windowed-canvas-after-en.png b/docs/images/shot-windowed-canvas-after-en.png new file mode 100644 index 0000000000000000000000000000000000000000..4805d0e7513f89d2a4966234aa0c74f4ef9315e2 GIT binary patch literal 261324 zcmd443s_X;_CG#|ig!{=%L{lxDLqPQiX||5(#T9XWkz{{%#sQfm6QR78PgQel+=tA zWjgsaN)F;BMPy(=RJe84R=Bs`C1|K?g{~$9UIy!p6>Kk(d7e4Yw_bDsdeVu(Tqwj(rkn)&6#BRCmeJ1x> zYyR+)kN@3+jHF{b*Ta8aqkDYWW54%cinX%$V{V8(K<=~dan}qV+8poyXKvcM)y;g~ ze^vX-<0bn4^ww3m(b<~l`XFs%kR{;jJ0q9X&U?%=kRQtzTlKIQ^6~4K58N%e?w5;I zt;L2lVa7Gm^Rdz{%$$F@H{362S)}7Sx84Y@-Z*f1 znYuPYZj6Z3_m{70?R>vHvq)M{RMjamwJ2%~{JSiz zabDWl?)CHFzZREaCa(s)JEK=Ng{mfMjWTV1OP0DtkN+sOw8ClU+ah^YtcH7aYD%4u8Xmz=;-IV7-m7TRs%eChgySKdSp?76;t|cq;2TOG> z^5<2C$*R1$jNZ-gZNARpW7WrNY+P243{{<#-C_L|>9)2drbwXKt0ez`*C@9(cvw`92&1x1euwww*VERS99 zuX;-4DbsX+Ppvyz(psvzZ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- zUqd04SMd2PbG22(RY{VvQ0qHr(s5;+T%UqYtLvME_Yc-!a)Z&c4y!|IO*i}d6AF5* z&Y6Fw^DF&H!6yV;pC*yltoK!qX5DdEM0Bo9$TqFeen4wRc|`hobu99EeSJGJ0YPb_ z-#(9f>FlC+1>6_T211zXr>EX_%uwE48qtcONxdXsTetN+(sEbjj6nxqeGZy&w1*k(uoR@PtR93;%U;J+>*M+R|;XZ(fBNIB{Lf7w;rz`FgZ zp1h8ypZ42}ikEt_Loorn0v+$T?Uy+EaaZM%1e_cI@|J4t7bv$ZL@pQs! zs?y@F9^Kwttp_h3f@(1e*}3&>x72f~`>{3QCVz|X@7xO!hWNWb?lm8}>GbH%Ce-S9 z>fW#fgzETEEa?g^D?J+m$-gR-{t^wO;nDBptpMGiJrr*9b^Zx;V+h*bb literal 0 HcmV?d00001 diff --git a/docs/images/shot-windowed-canvas-before-en.png b/docs/images/shot-windowed-canvas-before-en.png new file mode 100644 index 0000000000000000000000000000000000000000..7b67291ceea04b10b88e72090c8c1050ac7b5f7e GIT binary patch literal 305165 zcmd443s_X;_CG#|ig!{=%L{lxDLqPQiX||5(#T9XWkz{{%#sQfm6QR78PgQel+=tA zW%}kZN)F;BMPy(=RJ0{e#Sa=;-JLt8dH=T=>Wz-KVT*_jUHYjJ^wgK+0qO5WD5J_nF*l zt@*=GKK^$PGLnw%To3w~n7L6(58?~GhlJMS^iKz=M=Y}LbJ$j7f^K5)0>x?e6< zwH6!Jgc;XJ&ΝFmwLp-f+L9WsN%Tp}Qr&MDM4%GFWRYUJ!N9SS8;R+pv7k|PsnVU1wDbM)%pz$)QB|kN)S{>{@b9v; z#(8OHyVuWy|5{vznY^rF)ql)|F zM4n#UJYaU~xsY+HTCdwNTLa$LR+q-gQ`4Fcrd0$m4FTp%Rm)^+g_m_*L`+dcwYnlP z`(C0X%^2n7_OYMBkk&X$-7rg86rI)IwP8=1d5@)4&G<4!mo?$d+4&O#edY18hW(Mt z)Rv$0-iI-a{ zBQ2H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`q)f^ba)?NP(4ojO>fNN3pV^Y=({%vba$@ztLJ(GmQY)QCD*y- zUqd04SMd2PbG22(RY{VvQ0qHr(s5;+T%UqYtLvME_Yc-!a)Z&c4y!|IO*i}d6AF5* z&Y6Fw^DF&H!6yV;pC*yltoK!qX5DdEM0Bo9$TqFeen4wRc|`hobu99EeSJGJ0YPb_ z-#(9f>FlC+1>6_T211zXr>EX_%uwE48qtcONxdXsTetN+(sEbjj6nxqeGZy&w1*k(uoR@PtR93;%U;J+>*M+R|;XZ(fBNIB{Lf7w;rz`FgZ zp1h8ypZ42}ikEt_Loorn0v+$T?Uy+EaaZM%1e_cI@|J4t7bv$ZL@pQs! zs?y@F9^Kwttp_h3f@(1e*}3&>x72f~`>{3QCVz|X@7xO!hWNWb?lm8}>GbH%Ce-S9 z>fW#fgzETEEa?g^D?J+m$-gR-{t^wO;nDBptpMGiJrr*9b^Zx;V+h*bb diff --git a/docs/images/shot-windowed-canvas-before-en.png b/docs/images/shot-windowed-canvas-before-en.png index 7b67291ceea04b10b88e72090c8c1050ac7b5f7e..f1fd64f5f4bd9ebd4d6b1f8d238c491fc77d0fcc 100644 GIT binary patch literal 186314 zcmaI8cRbeZ|2}?M5wiCtNfMHk>`g}Y%u0xoz4yo_ib^t*y@~8q$j+{;?7jE;J}=$( z`*Z*P`FZrHTrSt^e4XcW9>?)~g+5T0y@E}JjX)r-$jeEoArKfT2n3oO7Am|_hcTgm zKtUknrNlK{6IVW9x{^xopIbbCz9`J-Mb3jUusv*=(*QDd=4=yb#2;ft35=bdyZegzZUiLzenHQu`mx= zSg;HvkXFTFOnt!ms=dXuSdRJ6_F)?zR?^GK@XP+u1SZq@OE{Kkih^N0Bc3;_CWeKK z&=H9eEUz>*HSboFAT}s0?sH>5&PkZbNTRUoo-y{Enq(oIM!s3fJoEEDZ$R9|!7Qsw&tqLuAt+*Fa5 z0>m@>DI;Y(Uov1Z2?|oV%#DqW)z;Lov9UP{e$dM0rHbt4xEmG~)!p6g?0lorzq-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^=>8t0^!f5SZl6VG3u9Q@m0YfMZGI^FmZL{eOrh~)2dFvwVaX_qNh7+bSW#$n!(Vd`&1q(7CzR!

plain

"), None); + assert_eq!(figma_clipboard_buffer("(figma)not base64!(/figma)"), None); + assert_eq!(figma_clipboard_buffer(&format!("(figma){}(/figma)", B64.encode(b"hello"))), None); + assert_eq!(figma_clipboard_buffer("(figma)ZmlnLQ"), None); +} + +#[test] +fn layers_paste_into_the_page_and_undo() { + let mut s = Session::new(); + let page = s.page().unwrap(); + let r = s.execute("edit.pasteFromFigma", &json!({"html": clipboard_html(&copied_file())})).unwrap(); + let ids: Vec = r["ids"].as_array().unwrap().iter().map(|v| params::id_of(v).unwrap()).collect(); + assert_eq!(names(&s, &ids), ["Card", "Dot"]); + assert_eq!(s.selection(), ids); + let doc = s.doc().unwrap(); + assert!(ids.iter().all(|i| doc.node(*i).unwrap().parent == Some(page))); + let card = doc.node(ids[0]).unwrap(); + assert_eq!(names(&s, &card.children), ["Badge"]); + assert_eq!((card.width, card.height), (200.0, 100.0)); + assert!(s.undo().unwrap()); + assert!(ids.iter().all(|i| !s.doc().unwrap().contains(*i))); +} + +#[test] +fn a_second_paste_repeats_the_figma_layers() { + let mut s = Session::new(); + s.execute("edit.pasteFromFigma", &json!({"data": B64.encode(copied_file())})).unwrap(); + let r = s.execute("edit.paste", &json!({})).unwrap(); + let ids: Vec = r["ids"].as_array().unwrap().iter().map(|v| params::id_of(v).unwrap()).collect(); + assert_eq!(names(&s, &ids), ["Card", "Dot"]); +} + +#[test] +fn pastes_into_the_selected_frame() { + let mut s = Session::new(); + let host = id(&s.execute("frame.create", &json!({"x": 1000, "y": 0, "width": 800, "height": 600})).unwrap()); + s.execute("select.set", &json!({"ids": [host]})).unwrap(); + let r = s.execute("edit.pasteFromFigma", &json!({"html": clipboard_html(&copied_file())})).unwrap(); + let first = params::id_of(&r["ids"][0]).unwrap(); + assert_eq!(s.doc().unwrap().node(first).unwrap().parent, Some(host)); +} + +#[test] +fn other_content_is_refused_without_changes() { + let mut s = Session::new(); + let before = s.doc().unwrap().nodes().count(); + assert!(s.execute("edit.pasteFromFigma", &json!({})).is_err()); + assert!(s.execute("edit.pasteFromFigma", &json!({"html": "hi"})).is_err()); + assert!(s.execute("edit.pasteFromFigma", &json!({"data": B64.encode(b"PK not a zip")})).is_err()); + assert!(s.execute("edit.pasteFromFigma", &json!({"data": B64.encode(b"fig-kiwi\x00\x00\x00\x00junk")})).is_err()); + assert_eq!(s.doc().unwrap().nodes().count(), before); + assert!(s.clipboard.nodes.is_empty()); +} diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 34653bd5f..908c952a7 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1528,6 +1528,8 @@ mod fig_export_tests; #[cfg(test)] mod fig_import_tests; #[cfg(test)] +mod figma_paste_tests; +#[cfg(test)] mod frame_guides_tests; #[cfg(test)] mod frame_label_tests; diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index cd1e34827..e4749235f 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -899,6 +899,7 @@ status = "draft — needs native review" "Paste a team library link (a view link)" = "Link einer Teambibliothek einfügen (ein Ansichtslink)" "Paste here" = "Hier einfügen" "Paste to replace" = "Zum Ersetzen einfügen" +"Pasted from Figma; {n} kinds of content were left out" = { one = "Aus Figma eingefügt; {n} Art von Inhalt wurde ausgelassen", other = "Aus Figma eingefügt; {n} Arten von Inhalt wurden ausgelassen" } "Pattern" = "Muster" "Pattern alignment" = "Musterausrichtung" "Pattern scale" = "Musterskalierung" @@ -1654,6 +1655,7 @@ status = "draft — needs native review" "edit.duplicate" = "Duplizieren" "edit.findReplace" = "Suchen und ersetzen" "edit.paste" = "Einfügen" +"edit.pasteFromFigma" = "Aus Figma einfügen" "edit.pasteOver" = "Über Auswahl einfügen" "edit.pasteProperties" = "Eigenschaften einfügen" "edit.pasteReplace" = "Zum Ersetzen einfügen" diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 3c127fc65..f0865ea4c 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -943,6 +943,7 @@ name = "English" "Paste a team library link (a view link)" = "Paste a team library link (a view link)" "Paste here" = "Paste here" "Paste to replace" = "Paste to replace" +"Pasted from Figma; {n} kinds of content were left out" = { one = "Pasted from Figma; {n} kind of content was left out", other = "Pasted from Figma; {n} kinds of content were left out" } "Pattern" = "Pattern" "Pattern alignment" = "Pattern alignment" "Pattern scale" = "Pattern scale" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 901283f11..3a07c3ab7 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -944,6 +944,7 @@ status = "draft — needs native review" "Paste a team library link (a view link)" = "Pega el enlace de una biblioteca de equipo (de lectura)" "Paste here" = "Pegar aquí" "Paste to replace" = "Pegar para reemplazar" +"Pasted from Figma; {n} kinds of content were left out" = { one = "Pegado desde Figma; se omitió {n} tipo de contenido", other = "Pegado desde Figma; se omitieron {n} tipos de contenido" } "Pattern" = "Patrón" "Pattern alignment" = "Alineación del patrón" "Pattern scale" = "Escala del patrón" @@ -1731,6 +1732,7 @@ status = "draft — needs native review" "edit.duplicate" = "Duplicar" "edit.findReplace" = "Buscar y reemplazar" "edit.paste" = "Pegar" +"edit.pasteFromFigma" = "Pegar desde Figma" "edit.pasteOver" = "Pegar sobre la selección" "edit.pasteProperties" = "Pegar propiedades" "edit.pasteReplace" = "Pegar para reemplazar" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 7fafd3c91..2f5ae5b9f 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -893,6 +893,7 @@ status = "draft — needs native review" "Paste a team library link (a view link)" = "Collez le lien d’une bibliothèque d’équipe (un lien de consultation)" "Paste here" = "Coller ici" "Paste to replace" = "Coller pour remplacer" +"Pasted from Figma; {n} kinds of content were left out" = { one = "Collé depuis Figma ; {n} type de contenu a été omis", other = "Collé depuis Figma ; {n} types de contenu ont été omis" } "Pattern" = "Motif" "Pattern alignment" = "Alignement du motif" "Pattern scale" = "Échelle du motif" @@ -1645,6 +1646,7 @@ status = "draft — needs native review" "edit.duplicate" = "Dupliquer" "edit.findReplace" = "Rechercher et remplacer" "edit.paste" = "Coller" +"edit.pasteFromFigma" = "Coller depuis Figma" "edit.pasteOver" = "Coller par-dessus la sélection" "edit.pasteProperties" = "Coller les propriétés" "edit.pasteReplace" = "Coller pour remplacer" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index 4d4d6d340..493bf9995 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -939,6 +939,7 @@ status = "draft — needs native review" "Paste a team library link (a view link)" = "チームライブラリのリンク(閲覧リンク)を貼り付け" "Paste here" = "ここに貼り付け" "Paste to replace" = "貼り付けて置換" +"Pasted from Figma; {n} kinds of content were left out" = { other = "Figma から貼り付け済み。{n} 種類のコンテンツは含まれていない" } "Pattern" = "パターン" "Pattern alignment" = "パターンの配置" "Pattern scale" = "パターンの拡大縮小" @@ -1723,6 +1724,7 @@ status = "draft — needs native review" "edit.duplicate" = "複製" "edit.findReplace" = "検索と置換" "edit.paste" = "貼り付け" +"edit.pasteFromFigma" = "Figma から貼り付け" "edit.pasteOver" = "選択範囲の上に貼り付け" "edit.pasteProperties" = "プロパティを貼り付け" "edit.pasteReplace" = "貼り付けて置換" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index ec732905c..253cc54ed 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -893,6 +893,7 @@ status = "draft — needs native review" "Paste a team library link (a view link)" = "팀 라이브러리 링크(보기 링크) 붙여 넣기" "Paste here" = "여기에 붙여 넣기" "Paste to replace" = "붙여 넣어 바꾸기" +"Pasted from Figma; {n} kinds of content were left out" = { other = "Figma에서 붙여 넣음. 콘텐츠 {n}종은 제외됨" } "Pattern" = "패턴" "Pattern alignment" = "패턴 정렬" "Pattern scale" = "패턴 배율" @@ -1645,6 +1646,7 @@ status = "draft — needs native review" "edit.duplicate" = "복제" "edit.findReplace" = "찾기 및 바꾸기" "edit.paste" = "붙여 넣기" +"edit.pasteFromFigma" = "Figma에서 붙여 넣기" "edit.pasteOver" = "선택 항목 위에 붙여 넣기" "edit.pasteProperties" = "속성 붙여 넣기" "edit.pasteReplace" = "붙여 넣어 바꾸기" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index c2189de81..12e7c0b27 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -892,6 +892,7 @@ status = "draft — needs native review" "Paste a team library link (a view link)" = "Cole o link de uma biblioteca de equipe (um link de visualização)" "Paste here" = "Colar aqui" "Paste to replace" = "Colar para substituir" +"Pasted from Figma; {n} kinds of content were left out" = { one = "Colado do Figma; {n} tipo de conteúdo ficou de fora", other = "Colado do Figma; {n} tipos de conteúdo ficaram de fora" } "Pattern" = "Padrão" "Pattern alignment" = "Alinhamento do padrão" "Pattern scale" = "Escala do padrão" @@ -1644,6 +1645,7 @@ status = "draft — needs native review" "edit.duplicate" = "Duplicar" "edit.findReplace" = "Localizar e substituir" "edit.paste" = "Colar" +"edit.pasteFromFigma" = "Colar do Figma" "edit.pasteOver" = "Colar sobre a seleção" "edit.pasteProperties" = "Colar propriedades" "edit.pasteReplace" = "Colar para substituir" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index af4cf6534..91c251eca 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -894,6 +894,7 @@ status = "draft — needs native review" "Paste a team library link (a view link)" = "粘贴团队库链接(查看链接)" "Paste here" = "粘贴到此处" "Paste to replace" = "粘贴以替换" +"Pasted from Figma; {n} kinds of content were left out" = { other = "已从 Figma 粘贴;有 {n} 类内容未包含" } "Pattern" = "图案" "Pattern alignment" = "图案对齐" "Pattern scale" = "图案缩放" @@ -1646,6 +1647,7 @@ status = "draft — needs native review" "edit.duplicate" = "创建副本" "edit.findReplace" = "查找和替换" "edit.paste" = "粘贴" +"edit.pasteFromFigma" = "从 Figma 粘贴" "edit.pasteOver" = "粘贴到所选项上方" "edit.pasteProperties" = "粘贴属性" "edit.pasteReplace" = "粘贴以替换" diff --git a/crates/ui-egui/src/figma_paste_tests.rs b/crates/ui-egui/src/figma_paste_tests.rs new file mode 100644 index 000000000..6147ba5e4 --- /dev/null +++ b/crates/ui-egui/src/figma_paste_tests.rs @@ -0,0 +1,48 @@ +use figcraft_engine::Session; +use serde_json::json; + +use crate::{FigApp, Services}; + +struct Clip { + html: String, + text: Option, +} + +impl Services for Clip { + fn clipboard_get_html(&mut self) -> Option { + Some(self.html.clone()) + } + fn clipboard_get_text(&mut self) -> Option { + self.text.clone() + } +} + +fn figma_html() -> String { + let mut s = Session::new(); + s.execute("node.create", &json!({"type": "rectangle", "x": 0, "y": 0, "width": 40, "height": 20, "name": "From Figma"})).unwrap(); + let r = s.execute("file.export", &json!({"format": "fig"})).unwrap(); + format!(r#""#, r["data"].as_str().unwrap()) +} + +fn selected_names(app: &FigApp) -> Vec { + let doc = app.session.doc().unwrap(); + app.session.selection().iter().map(|i| doc.node(*i).unwrap().name.clone()).collect() +} + +#[test] +fn paste_takes_layers_copied_in_figma() { + let html = figma_html(); + let mut app = FigApp::new(Session::new(), Box::new(Clip { html, text: Some(String::new()) })); + crate::menus::paste(&mut app, None); + assert_eq!(selected_names(&app), ["From Figma"]); +} + +#[test] +fn html_from_other_apps_pastes_as_before() { + let clip = Clip { html: "Hello".into(), text: Some("Hello".into()) }; + let mut app = FigApp::new(Session::new(), Box::new(clip)); + crate::menus::paste(&mut app, None); + let doc = app.session.doc().unwrap(); + let id = app.session.selection()[0]; + assert_eq!(doc.node(id).unwrap().kind.text().unwrap().characters, "Hello"); +} diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 20a8a77c1..04fe38611 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -94,6 +94,8 @@ mod export_preview_tests; #[cfg(test)] mod field_tests; #[cfg(test)] +mod figma_paste_tests; +#[cfg(test)] mod frame_label_tests; #[cfg(test)] mod gap_handle_tests; @@ -226,6 +228,9 @@ pub trait Services { fn clipboard_get_text(&mut self) -> Option { None } + fn clipboard_get_html(&mut self) -> Option { + None + } fn clipboard_set_png(&mut self, _w: u32, _h: u32, _rgba: &[u8]) {} /// An image on the system clipboard as (width, height, straight RGBA). fn clipboard_get_image(&mut self) -> Option<(u32, u32, Vec)> { diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index b9d3299a6..60adf0279 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -7,7 +7,7 @@ use serde_json::json; use crate::FigApp; use crate::a11y; -use crate::i18n::{self, tr, tr_noop, trf}; +use crate::i18n::{self, tr, tr_noop, trf, trn}; use crate::icons::{self, Icon}; use crate::theme::{ACCENT, Tokens, regular}; use crate::toolbar::pretty_shortcut; @@ -30,10 +30,19 @@ pub const UI_COMMANDS: &[&str] = &[ ]; /// Run a menu item: some open dialogs or use platform services, the rest go to the engine. -/// Paste: the system clipboard wins when it holds something newer than our own copy (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). +/// Paste: the system clipboard wins when it holds something newer than our own copy (layers copied +/// in Figma, 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). pub fn paste(app: &mut FigApp, event_text: Option<&str>) { + if let Some(html) = app.services.clipboard_get_html().filter(|h| h.contains("(figma)")) { + if let Some(r) = app.run("edit.pasteFromFigma", json!({"html": html})) { + let left_out = r["warnings"].as_array().map_or(0, Vec::len); + if left_out > 0 { + app.toast(trn("Pasted from Figma; {n} kinds of content were left out", left_out, &[])); + } + } + return; + } let sys_text = app.services.clipboard_get_text().or_else(|| event_text.map(str::to_string)).filter(|t| !t.is_empty()); let ours = sys_text.is_some() && sys_text == app.ui.last_copy; let (cx, cy) = app.session.ds().map(|d| (d.view.cx, d.view.cy)).unwrap_or((0.0, 0.0)); diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index d8e517119..63f281f64 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-14 · **Change:** minor (SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-14 · **Change:** minor (paste from Figma (desktop); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) Every format Figma reads or writes, with FigCraft's support. Sources: `Info.plist` of `/Applications/Figma.app` (document types only; nothing inside the bundle's code was read), Figma's @@ -36,7 +36,7 @@ and prototype interactions are still unchecked there. | BMP | — | yes | | — | | MP4, MOV, WebM (video fills, paid plans) | yes | **no** | shortcut: decoding H.264/HEVC/VP9 needs non-Rust libraries (FFmpeg or each platform's media framework); presenter playback would reuse the animated GIF clock | 4–8 | | Images over 4096 px | downscaled to 4096 | kept | | — | -| Pasted content from other apps | images, SVG, text, Figma clipboard | images, SVG, text (newest clipboard content wins) | no Figma clipboard (it carries Figma's own binary) | with `.fig` | +| Pasted content from other apps | images, SVG, text, Figma clipboard | images, SVG, text, **layers copied in Figma** (desktop; best effort) (newest clipboard content wins) | layers copied in Figma arrive as a `.fig` canvas in the clipboard's HTML; `edit.pasteFromFigma` reads it with the `.fig` import and pastes it as Paste does (into the selected frame, in place or in the view's centre), with `warnings`. Image fills come without their pixels (the clipboard doesn't carry them). Not in the browser (its paste event carries plain text only). Tested on copies written by our own `.fig` export, not yet on real Figma copies | with `.fig` | ## Export @@ -162,6 +162,7 @@ each. | Date | Change | Summary | |---|---|---| +| 2026-10-14 | minor | Paste from Figma (desktop): layers copied in Figma paste as layers. Paste reads the clipboard's HTML; its `.fig` canvas goes through the `.fig` import and lands as Paste places our own layers (`edit.pasteFromFigma`, with `warnings`). Tested on copies written by our own `.fig` export only. Numbers unchanged | | 2026-10-14 | minor | SVG/PDF depth overflow (#208) is checked before bounds and drawing; public checked APIs return the offending root/layer, commands and CLI report it, and no incomplete export replaces an existing file. Tested at depths 255/256/257, with inner roots, hidden branches, masks, raster fallbacks and multiple roots/pages. Numbers unchanged. | | 2026-10-13 | minor | `.fig` export (gap 1): instances write what they change from their main as an override addressed by the main's id (their size, name and paints were lost elsewhere without it), what follows for their layers as derived data, and a scale factor when scaled as a whole; layers of a nested instance swapped for another component keep their overrides; variable collections, modes, variables and their bindings, the modes frames and pages set, shared styles with their links and variable-width strokes are written, and the import reads all of it back (style definitions and unused styles, variable order and scopes, bindings on paint lists, gradient stops, effects and layout grids, page modes, text field bindings, which a `.fig` import used to drop, and width profiles). Opened `.fig` and file JSON documents link nested instances of variants (and any nested instance under a name of its own) to their main's layers; they stayed unlinked, so a second export lost what they changed. Checked by opening written files in other software: resized and scaled instances keep their size and lay their layers out for it, variables with their modes and colour bindings resolve there (a frame set to another mode shows that mode's colours, also inside instances), colour, text, effect and grid styles are listed, and variable-width strokes that are the same on both sides of the path draw with their width; number, string and boolean bindings and bindings on effects, layout guides and gradient stops come across as the values they give but did not show as bound there (their entries now also name the layer field they set, not yet checked there), and strokes wider on one side of the path are written as filled outlines, no longer editable strokes there (the stroke itself is kept as plugin data and our own import puts it back; not yet checked there). Numbers unchanged | | 2026-10-12 | minor | `.fig` export made to open elsewhere (gap 1): the document and its pages say they are visible and opaque (left out, nothing was drawn), the schema in the file uses the format's own names, kinds, field ids and enum values, rectangles are rounded rectangles with four radii, frames and shapes carry their fill outline and plain strokes their stroke outline, text carries its layout settings, font styles use their standard names, line heights that are a share of the font size are raw multipliers, masks keep their type (read back too); the import reads per-side stroke weights whose zero sides are left out. Written files were checked by opening them in other software: layers, fills, gradients, strokes, shadows, vectors, components and text draw as in FigCraft; effects such as glass and noise, images and prototype interactions are still unchecked there, and variables are not written. Numbers unchanged | From 657a8f4df62a35e647198ac43b8dcca820fcba19 Mon Sep 17 00:00:00 2001 From: Skyfuller1303 Date: Fri, 16 Oct 2026 09:16:10 +0200 Subject: [PATCH 052/817] M1: translate the vector style import notes --- crates/ui-egui/locales/de.toml | 3 +++ crates/ui-egui/locales/en.toml | 3 +++ crates/ui-egui/locales/es.toml | 3 +++ crates/ui-egui/src/import_report.rs | 3 +++ crates/ui-egui/src/import_report_tests.rs | 13 +++++++++++++ 5 files changed, 25 insertions(+) diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index c7bd13f7d..520d4ba6c 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -1499,7 +1499,10 @@ status = "draft — needs native review" "set-variable actions with values that don't fit the variable were skipped" = "Aktionen „Variable festlegen“ mit Werten, die nicht zur Variable passen, wurden übersprungen" "set-variable actions without a value were skipped" = "Aktionen „Variable festlegen“ ohne Wert wurden übersprungen" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "Aktionen „Variablenmodus festlegen“ für Sammlungen oder Modi, die nicht im Variablen-JSON sind, wurden übersprungen" +"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "einige Vektorpunkte verweisen auf Punkteinstellungen, die in der Datei fehlen; sie verwenden die Konturecken der Ebene und einfache Ecken" +"some vector segments refer to style settings missing from the file; they use the layer's stroke" = "einige Vektorsegmente verweisen auf Stileinstellungen, die in der Datei fehlen; sie verwenden die Kontur der Ebene" "stars and polygons without point counts or geometry use the default point count" = "Sterne und Polygone ohne Punktanzahl oder Geometrie verwenden die Standard-Punktanzahl" +"style settings of some vector segments aren't supported; those segments use the layer's stroke" = "Stileinstellungen einiger Vektorsegmente werden nicht unterstützt; diese Segmente verwenden die Kontur der Ebene" "text style overrides refer to missing table entries" = "Textstil-Überschreibungen verweisen auf fehlende Tabelleneinträge" "the file has no pages" = "die Datei hat keine Seiten" "the plugin" = "das Plugin" diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index c3e75570f..8f1f09a25 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -1571,7 +1571,10 @@ name = "English" "set-variable actions with values that don't fit the variable 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 actions without a value were skipped" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" +"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "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" = "some vector segments refer to style settings missing from the file; they use the layer's stroke" "stars and polygons without point counts or geometry use the default point count" = "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" = "style settings of some vector segments aren't supported; those segments use the layer's stroke" "text style overrides refer to missing table entries" = "text style overrides refer to missing table entries" "the file has no pages" = "the file has no pages" "the plugin" = "the plugin" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 49dd765fe..8552b6170 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -1572,7 +1572,10 @@ status = "draft — needs native review" "set-variable actions with values that don't fit the variable were skipped" = "se omitieron las acciones «Establecer variable» con valores que no encajan con la variable" "set-variable actions without a value were skipped" = "se omitieron las acciones «Establecer variable» sin valor" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "se omitieron las acciones «Establecer modo de variable» sobre colecciones o modos que no están en el JSON de variables" +"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "algunos puntos vectoriales hacen referencia a ajustes de punto que faltan en el archivo; usan las uniones de la capa y esquinas simples" +"some vector segments refer to style settings missing from the file; they use the layer's stroke" = "algunos segmentos vectoriales hacen referencia a ajustes de estilo que faltan en el archivo; usan el trazo de la capa" "stars and polygons without point counts or geometry use the default point count" = "las estrellas y los polígonos sin número de puntos ni geometría usan el número de puntos predeterminado" +"style settings of some vector segments aren't supported; those segments use the layer's stroke" = "los ajustes de estilo de algunos segmentos vectoriales no son compatibles; esos segmentos usan el trazo de la capa" "text style overrides refer to missing table entries" = "las anulaciones de estilo de texto hacen referencia a entradas de tabla que faltan" "the file has no pages" = "el archivo no tiene páginas" "the plugin" = "el plugin" diff --git a/crates/ui-egui/src/import_report.rs b/crates/ui-egui/src/import_report.rs index b756e8711..0540a2fcf 100644 --- a/crates/ui-egui/src/import_report.rs +++ b/crates/ui-egui/src/import_report.rs @@ -53,7 +53,10 @@ const IMPORT_NOTES: &[&str] = &[ tr_noop("set-variable actions with values that don't fit the variable were skipped"), tr_noop("set-variable actions without a value were skipped"), tr_noop("set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped"), + tr_noop("some vector points refer to point settings missing from the file; they use the layer's joins and plain corners"), + tr_noop("some vector segments refer to style settings missing from the file; they use the layer's stroke"), tr_noop("stars and polygons without point counts or geometry use the default point count"), + tr_noop("style settings of some vector segments aren't supported; those segments use the layer's stroke"), tr_noop("text style overrides refer to missing table entries"), tr_noop("the file has no pages"), tr_noop("the variables JSON has no `variableCollections` (expected the local variables response) and was ignored"), diff --git a/crates/ui-egui/src/import_report_tests.rs b/crates/ui-egui/src/import_report_tests.rs index cc493e4b8..37b516429 100644 --- a/crates/ui-egui/src/import_report_tests.rs +++ b/crates/ui-egui/src/import_report_tests.rs @@ -59,6 +59,19 @@ fn note_text_keeps_the_repeat_suffix_and_unknown_notes() { assert_eq!(note_text("weird (×12) tail"), "weird (×12) tail"); } +#[test] +fn vector_style_notes_are_known_import_notes() { + for note in [ + "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", + "style settings of some vector segments aren't supported; those segments use the layer's stroke", + ] { + let shown = note_text(note); + assert!(shown.chars().next().is_some_and(char::is_uppercase), "{shown}"); + assert_eq!(shown[shown.chars().next().unwrap().len_utf8()..], note[note.chars().next().unwrap().len_utf8()..]); + } +} + #[test] fn opening_a_rest_json_file_reports_what_was_skipped() { let path = std::env::temp_dir().join(format!("figcraft-import-report-{}.json", std::process::id())); From a4156d291066fe1f6e4a1ffd83dd92ae02f0e714 Mon Sep 17 00:00:00 2001 From: Skyfuller1303 Date: Fri, 16 Oct 2026 08:11:20 +0200 Subject: [PATCH 053/817] M3: re-read a library file whose stamp is as recent as the read A library file is cached by its length and modification time. File systems keep the time in coarse ticks, so a same-length rewrite right after a read can keep the stamp, and library.updates then reports no change. A stamp now proves the file unchanged only once its modification time lies at least two seconds before the read; otherwise the file is read again. --- crates/engine/src/library.rs | 33 +++++++++++++++++++++++++++--- crates/engine/src/library_tests.rs | 18 ++++++++++++++++ 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/library.rs b/crates/engine/src/library.rs index 73c599a45..8d3b90fdc 100644 --- a/crates/engine/src/library.rs +++ b/crates/engine/src/library.rs @@ -449,9 +449,25 @@ struct Stamp { #[derive(Clone, Debug)] struct Entry { stamp: Option, + /// When the file was read: a stamp only proves the file unchanged once its modification time + /// is safely older than that, since file systems keep the time in coarse ticks. + read_at: Option, result: std::result::Result, String>, } +/// How far a file's modification time must lie before its read for the stamp to be trusted. +const RACY_STAMP: std::time::Duration = std::time::Duration::from_secs(2); + +impl Entry { + fn still_valid(&self, now: &Stamp) -> bool { + let settled = match (now.modified, self.read_at) { + (Some(modified), Some(read_at)) => modified.checked_add(RACY_STAMP).is_some_and(|t| t < read_at), + _ => false, + }; + settled && self.stamp.as_ref() == Some(now) + } +} + /// Library files read by a session, by path (re-read when they change on disk). #[derive(Clone, Debug, Default)] pub struct Cache { @@ -481,10 +497,11 @@ impl Cache { return Err(EngineError::Other(format!("{path} is too large to use as a library (the limit is {} MB)", max_bytes / 1024 / 1024))); } if let (Some(e), Ok(st)) = (self.entries.get(path), &stamp) - && e.stamp.as_ref() == Some(st) + && e.still_valid(st) { return e.result.clone().map_err(EngineError::Other); } + let read_at = now(); let result = match &stamp { Ok(_) => read_file(path).map(Arc::new), Err(e) => Err(e.clone()), @@ -492,7 +509,7 @@ impl Cache { if self.entries.len() >= MAX_CACHED && !self.entries.contains_key(path) { self.entries.clear(); } - self.entries.insert(path.to_string(), Entry { stamp: stamp.ok(), result: result.clone() }); + self.entries.insert(path.to_string(), Entry { stamp: stamp.ok(), read_at, result: result.clone() }); result.map_err(EngineError::Other) } @@ -506,10 +523,20 @@ impl Cache { if self.entries.len() >= MAX_CACHED && !self.entries.contains_key(path) { self.entries.clear(); } - self.entries.insert(path.to_string(), Entry { stamp: None, result }); + self.entries.insert(path.to_string(), Entry { stamp: None, read_at: None, result }); } } +#[cfg(not(target_arch = "wasm32"))] +fn now() -> Option { + Some(std::time::SystemTime::now()) +} + +#[cfg(target_arch = "wasm32")] +fn now() -> Option { + None +} + #[cfg(not(target_arch = "wasm32"))] fn stat(path: &str) -> std::result::Result { let m = std::fs::metadata(path).map_err(|e| format!("{path}: {e}"))?; diff --git a/crates/engine/src/library_tests.rs b/crates/engine/src/library_tests.rs index 23d5af090..77880ecd0 100644 --- a/crates/engine/src/library_tests.rs +++ b/crates/engine/src/library_tests.rs @@ -399,3 +399,21 @@ fn library_survives_saving_with_versions() { healthy(&user); let _ = std::fs::remove_dir_all(&d); } + +#[test] +fn a_file_stamp_from_the_moment_it_was_read_does_not_prove_it_unchanged() { + use std::time::{Duration, SystemTime}; + let read_at = SystemTime::now(); + let entry = |modified: SystemTime| Entry { + stamp: Some(Stamp { len: 10, modified: Some(modified) }), + read_at: Some(read_at), + result: Err("unused".into()), + }; + // Written in the same coarse tick as the read: a same-length rewrite would keep this stamp. + let fresh = entry(read_at); + assert!(!fresh.still_valid(&Stamp { len: 10, modified: Some(read_at) })); + // Written well before the read: an unchanged stamp means an unchanged file. + let old = read_at - Duration::from_secs(10); + assert!(entry(old).still_valid(&Stamp { len: 10, modified: Some(old) })); + assert!(!entry(old).still_valid(&Stamp { len: 11, modified: Some(old) })); +} From 771f7e869f669f478e0b9277a2123307269272fc Mon Sep 17 00:00:00 2001 From: Skyfuller1303 Date: Fri, 16 Oct 2026 09:15:25 +0200 Subject: [PATCH 054/817] M1: reword the unresolved point style import note --- crates/format/src/fig/map.rs | 2 +- crates/format/src/fig/tail_tests.rs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 914843d38..0760e8893 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -942,7 +942,7 @@ impl<'a> Mapper<'a> { self.warn("filled areas of a vector with their own fill use the layer's fill"); } if unresolved_style { - self.warn("vector points with unresolved style IDs lost their point styles"); + self.warn("some vector points refer to point settings missing from the file; they use the layer's joins and plain corners"); } if unknown_join { self.warn("vector points with unknown stroke joins use the layer join"); diff --git a/crates/format/src/fig/tail_tests.rs b/crates/format/src/fig/tail_tests.rs index cd27300da..51871ccd9 100644 --- a/crates/format/src/fig/tail_tests.rs +++ b/crates/format/src/fig/tail_tests.rs @@ -301,7 +301,12 @@ fn vectors_import_as_editable_networks() { let fallback = network_of(&doc, "Join Fallbacks"); assert!(fallback.vertices.iter().all(|v| v.join.is_none())); assert_eq!(named(&doc, "Join Fallbacks").stroke.join, StrokeJoin::Miter); - assert!(warnings.iter().any(|w| w.contains("unresolved style IDs lost their point styles")), "{warnings:?}"); + assert!( + warnings + .iter() + .any(|w| w.contains("vector points refer to point settings missing from the file; they use the layer's joins and plain corners")), + "{warnings:?}" + ); assert!(warnings.iter().any(|w| w.contains("unknown stroke joins use the layer join")), "{warnings:?}"); assert!(warnings.iter().any(|w| w.contains("dashed or variable-width strokes render with the layer join")), "{warnings:?}"); } From d8e64a73bf0686277c0a06c2fdec2bb51261d064 Mon Sep 17 00:00:00 2001 From: Skyfuller1303 Date: Fri, 16 Oct 2026 09:15:25 +0200 Subject: [PATCH 055/817] M1: reword the vector segment style import notes --- crates/format/src/fig/map.rs | 4 ++-- crates/format/src/fig/tail_tests.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 1dc8e1382..712a90fd5 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -1302,10 +1302,10 @@ impl<'a> Mapper<'a> { } } if has_uninterpreted { - self.warn("metadata for styled vector network segments was not interpreted"); + self.warn("style settings of some vector segments aren't supported; those segments use the layer's stroke"); } if has_missing { - self.warn("vector network segments reference missing style entries"); + self.warn("some vector segments refer to style settings missing from the file; they use the layer's stroke"); } // An open path shows its fill, which regions can't hold: the outline keeps the look. let fills_shown = diff --git a/crates/format/src/fig/tail_tests.rs b/crates/format/src/fig/tail_tests.rs index 657ff6ff6..bc4f31cc4 100644 --- a/crates/format/src/fig/tail_tests.rs +++ b/crates/format/src/fig/tail_tests.rs @@ -280,9 +280,9 @@ fn per_segment_stroke_styles_are_reported() { }; assert_eq!(network::decode_styled(&square_blob()).unwrap().1, 0); let plain = import(&tail_canvas(), "Tail").unwrap().1; - assert!(!plain.iter().any(|w| w.contains("vector network segments")), "{plain:?}"); - let uninterpreted = |w: &String| w.contains("metadata for styled vector network segments was not interpreted"); - let missing = |w: &String| w.contains("vector network segments reference missing style entries"); + assert!(!plain.iter().any(|w| w.contains("vector segments")), "{plain:?}"); + let uninterpreted = |w: &String| w.contains("style settings of some vector segments aren't supported; those segments use the layer's stroke"); + let missing = |w: &String| w.contains("some vector segments refer to style settings missing from the file; they use the layer's stroke"); // Style 1 has a row in the layer's override table; its contents are not applied. let known = styled_import(1); assert_eq!(known.iter().filter(|w| uninterpreted(w)).count(), 1, "{known:?}"); From 41d465a678411260bb1c414e078d774a3b3b4d3b Mon Sep 17 00:00:00 2001 From: Skyfuller1303 Date: Fri, 16 Oct 2026 09:15:25 +0200 Subject: [PATCH 056/817] M1: reword the vector segment style import notes --- crates/format/src/fig/map.rs | 4 ++-- crates/format/src/fig/tail_tests.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 05fa85668..36f45f318 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -1211,10 +1211,10 @@ impl<'a> Mapper<'a> { } } if has_uninterpreted { - self.warn("metadata for styled vector network segments was not interpreted"); + self.warn("style settings of some vector segments aren't supported; those segments use the layer's stroke"); } if has_missing { - self.warn("vector network segments reference missing style entries"); + self.warn("some vector segments refer to style settings missing from the file; they use the layer's stroke"); } // An open path shows its fill, which regions can't hold: the outline keeps the look. let fills_shown = diff --git a/crates/format/src/fig/tail_tests.rs b/crates/format/src/fig/tail_tests.rs index 657ff6ff6..bc4f31cc4 100644 --- a/crates/format/src/fig/tail_tests.rs +++ b/crates/format/src/fig/tail_tests.rs @@ -280,9 +280,9 @@ fn per_segment_stroke_styles_are_reported() { }; assert_eq!(network::decode_styled(&square_blob()).unwrap().1, 0); let plain = import(&tail_canvas(), "Tail").unwrap().1; - assert!(!plain.iter().any(|w| w.contains("vector network segments")), "{plain:?}"); - let uninterpreted = |w: &String| w.contains("metadata for styled vector network segments was not interpreted"); - let missing = |w: &String| w.contains("vector network segments reference missing style entries"); + assert!(!plain.iter().any(|w| w.contains("vector segments")), "{plain:?}"); + let uninterpreted = |w: &String| w.contains("style settings of some vector segments aren't supported; those segments use the layer's stroke"); + let missing = |w: &String| w.contains("some vector segments refer to style settings missing from the file; they use the layer's stroke"); // Style 1 has a row in the layer's override table; its contents are not applied. let known = styled_import(1); assert_eq!(known.iter().filter(|w| uninterpreted(w)).count(), 1, "{known:?}"); From 12d43b1f997554df0a5681d354bfb7d7e19db933 Mon Sep 17 00:00:00 2001 From: Andrii Volkov <60794004+volkovskey@users.noreply.github.com> Date: Fri, 16 Oct 2026 10:46:08 +0300 Subject: [PATCH 057/817] fix(format): open large .fig files A real 705 MB .fig file (401 644 nodes, 894 004 layers once instances are expanded) didn't open: "message: too many values". Lifting that cap alone made it import only its first 200 000 layers, and lifting that one took 41 GB of memory. The global caps stay as they are. The .fig import gets budgets from the size of its compressed canvas instead (counted up to the file's own size), not from the message it unpacks to, since chunks inflate up to 512 MB: - the kiwi value budget is one value per 2 bytes of the canvas, at least the old 20 million (kiwi is only read for .fig files); - the layer cap is one layer per 32 bytes of the canvas, at least the REST import's 200 000 and at most 2 000 000. A small or crafted file can't expand its instances into millions of layers, however far it unpacks; the REST JSON import keeps 200 000. Memory: - The mapper no longer passes the document through `json!`, which serialises its arguments: the whole tree was deep-copied twice. - Vector networks are built once per distinct network and handed to the REST importer beside the JSON (`vectorNetworkRef`), not written into it as JSON objects for every instance that shows them. - Decoded kiwi objects are trimmed, and each import stage's input is dropped as soon as the next stage is built. On that file: peak footprint 41 GB -> 11.3 GB, 67 s -> 25 s. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YQxjkNSUJhTkTfY74aNeki --- crates/format/src/fig/kiwi.rs | 24 +++++- crates/format/src/fig/map.rs | 127 +++++++++++++++++++--------- crates/format/src/fig/mod.rs | 30 +++++-- crates/format/src/fig/tail_tests.rs | 4 +- crates/format/src/fig/tests.rs | 61 ++++++++++++- crates/format/src/rest/mod.rs | 54 ++++++++++-- crates/format/src/rest/tests.rs | 15 ++++ 7 files changed, 251 insertions(+), 64 deletions(-) diff --git a/crates/format/src/fig/kiwi.rs b/crates/format/src/fig/kiwi.rs index 528dbbf06..46a9daacd 100644 --- a/crates/format/src/fig/kiwi.rs +++ b/crates/format/src/fig/kiwi.rs @@ -10,8 +10,12 @@ use std::fmt; /// Deepest struct/message nesting decoded. const MAX_DEPTH: usize = 64; -/// Most values decoded from one message (every scalar, array element and field counts). -const MAX_VALUES: usize = 20_000_000; +/// Most values decoded from one message (every scalar, array element and field counts): at least +/// [`MIN_VALUES`], and one per [`PACKED_BYTES_PER_VALUE`] bytes of the file's compressed canvas, +/// so a large real file decodes while a small one can't expand into a huge tree, however far its +/// chunks inflate. +const MIN_VALUES: usize = 20_000_000; +const PACKED_BYTES_PER_VALUE: usize = 2; /// Most definitions in a schema, and fields in one definition. const MAX_DEFS: usize = 10_000; const MAX_FIELDS: usize = 10_000; @@ -284,13 +288,23 @@ impl Schema { self.defs.iter().position(|d| d.name == name) } - /// Decode a message of definition `root`. + /// Decode a message of definition `root`, within [`MIN_VALUES`] values. pub fn decode_message<'s>(&'s self, root: usize, data: &[u8]) -> Result, KiwiError> { - let mut d = Decoder { schema: self, r: Reader { data, pos: 0 }, budget: MAX_VALUES }; + self.decode_message_within(root, data, MIN_VALUES) + } + + /// [`Self::decode_message`] within `budget` values (see [`value_budget`]). + pub fn decode_message_within<'s>(&'s self, root: usize, data: &[u8], budget: usize) -> Result, KiwiError> { + let mut d = Decoder { schema: self, r: Reader { data, pos: 0 }, budget }; d.def(root, 0) } } +/// Most values decoded from a file whose compressed canvas is `packed` bytes. +pub(crate) fn value_budget(packed: usize) -> usize { + MIN_VALUES.max(packed / PACKED_BYTES_PER_VALUE) +} + struct Decoder<'s, 'b> { schema: &'s Schema, r: Reader<'b>, @@ -327,6 +341,8 @@ impl<'s> Decoder<'s, '_> { loop { let id = self.r.var_uint()?; if id == 0 { + // Grown by doubling: trimmed, a large file's tree takes a good part less. + out.shrink_to_fit(); return Ok(Kv::Object(out)); } let f = d.fields.iter().find(|f| f.value == id).ok_or_else(|| KiwiError(format!("message: {} has no field {id}", d.name)))?; diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 66a00129f..28fd90f53 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -6,9 +6,10 @@ //! are expanded here from the main component (overrides and derived layout matched by id path, //! component property values applied) so the import looks as saved. -use std::collections::BTreeMap; +use std::collections::{BTreeMap, HashMap}; use std::rc::Rc; +use figcraft_doc::VectorNetwork; use figcraft_doc::geom::{Affine, Point}; use figcraft_doc::proto::{MAX_ACTION_DEPTH, MAX_EXPR_DEPTH}; use serde_json::{Map, Value, json}; @@ -18,8 +19,7 @@ use super::network; type Obj = Map; -/// Most layers produced (instance expansion included) and deepest nesting followed. -const MAX_NODES: usize = crate::rest::MAX_NODES; +/// Deepest nesting followed. const MAX_DEPTH: usize = 256; /// Most path commands read from one geometry blob. const MAX_COMMANDS: usize = 200_000; @@ -28,11 +28,15 @@ const NO_STYLE: &str = "4294967295:4294967295"; /// Longest asset `key` or `version` kept for resolving references given as assets. const MAX_ASSET_PART: usize = 256; -/// The REST API file JSON for message `msg`, with the warnings about what was skipped. -pub(super) fn to_rest(msg: &Kv, name: &str) -> (Value, Vec) { - let mut m = Mapper::new(msg); +/// The REST API file JSON for message `msg`, with the warnings about what was skipped and the +/// vector networks its layers name by `vectorNetworkRef` (for [`crate::rest::import_with_networks`]). +pub(super) fn to_rest(msg: &Kv, name: &str, max_nodes: usize) -> (Value, Vec, Vec>) { + let mut m = Mapper::new(msg, max_nodes); let doc = m.document(); - let mut out = json!({"name": name, "document": doc}); + // Large values are moved in, never passed through `json!`, which serialises its arguments: + // a deep copy of the whole tree, briefly holding it twice. + let mut out = json!({"name": name}); + out["document"] = doc; if !m.styles.is_empty() { out["styles"] = Value::Object(std::mem::take(&mut m.styles)); } @@ -49,7 +53,7 @@ pub(super) fn to_rest(msg: &Kv, name: &str) -> (Value, Vec) { if !styles.is_empty() { out["styleDefinitions"] = Value::Array(styles); } - (out, m.warnings) + (out, m.warnings, m.networks) } /// REST importer warnings reworded for a `.fig` import (`None`: drop it). @@ -261,10 +265,18 @@ struct Mapper<'a> { sets: Obj, warnings: Vec, count: usize, + /// Most layers produced, instance expansion included (see [`super::layer_budget`]). + max_nodes: usize, + /// Vector networks, each built once: the layers that show one (every instance of a main + /// 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 what a network is made from: its blob, its scale and its style table. + network_ids: HashMap<(usize, u64, u64, usize), usize>, } impl<'a> Mapper<'a> { - fn new(msg: &'a Kv<'a>) -> Self { + fn new(msg: &'a Kv<'a>, max_nodes: usize) -> Self { let mut nodes = BTreeMap::new(); let mut kids: BTreeMap> = BTreeMap::new(); let mut prop_defs = BTreeMap::new(); @@ -302,7 +314,21 @@ impl<'a> Mapper<'a> { let version = n.get("version").and_then(Kv::str).filter(|v| !v.is_empty() && v.len() <= MAX_ASSET_PART).unwrap_or(""); assets.entry(key.to_string()).or_default().entry(version.to_string()).or_insert(id); } - Self { nodes, kids, blobs, prop_defs, assets, styles: Obj::new(), components: Obj::new(), sets: Obj::new(), warnings: Vec::new(), count: 0 } + Self { + nodes, + kids, + blobs, + prop_defs, + assets, + styles: Obj::new(), + components: Obj::new(), + sets: Obj::new(), + warnings: Vec::new(), + count: 0, + max_nodes, + networks: Vec::new(), + network_ids: HashMap::new(), + } } /// The id of the resource a `VariableSetID` (or `VariableID`, `StyleId`) names: its `guid`, @@ -360,7 +386,9 @@ impl<'a> Mapper<'a> { if out.is_empty() { self.warn("the file has no pages"); } - json!({"id": doc_id.unwrap_or_else(|| "0:0".into()), "type": "DOCUMENT", "children": out}) + let mut doc = json!({"id": doc_id.unwrap_or_else(|| "0:0".into()), "type": "DOCUMENT"}); + doc["children"] = Value::Array(out); + doc } fn page(&mut self, id: &str, n: &'a Kv<'a>) -> Value { @@ -409,8 +437,9 @@ impl<'a> Mapper<'a> { self.warn(format!("layers nested deeper than {MAX_DEPTH} levels were skipped")); return None; } - if self.count >= MAX_NODES { - self.warn(format!("the file has more than {MAX_NODES} layers; the rest were skipped")); + if self.count >= self.max_nodes { + let max = self.max_nodes; + self.warn(format!("the file has more than {max} layers; the rest were skipped")); return None; } let base = *self.nodes.get(id)?; @@ -521,7 +550,7 @@ impl<'a> Mapper<'a> { fn shape_with_text(&mut self, o: &mut Obj, v: &View<'a>, own: &str, rest_id: &str) -> Option { let shape = v.str("shapeWithTextType").unwrap_or("SQUARE"); let outlined = !v.list("fillGeometry").is_empty() || !v.list("strokeGeometry").is_empty(); - if own != "SHAPE_WITH_TEXT" || matches!(shape, "SQUARE" | "ROUNDED_RECTANGLE") || !outlined || self.count >= MAX_NODES { + if own != "SHAPE_WITH_TEXT" || matches!(shape, "SQUARE" | "ROUNDED_RECTANGLE") || !outlined || self.count >= self.max_nodes { return None; } let mut s = Obj::new(); @@ -553,7 +582,7 @@ impl<'a> Mapper<'a> { /// layer filling it, inset a little; centred unless it's a note. fn inner_text(&mut self, o: &Obj, v: &View<'a>, rest_id: &str, note: bool) -> Option { let chars = own_text(v)?; - if self.count >= MAX_NODES { + if self.count >= self.max_nodes { return None; } self.count += 1; @@ -587,7 +616,7 @@ impl<'a> Mapper<'a> { if own_text(v).is_some() { self.warn("connector labels were skipped"); } - if ["vectorNetwork", "fillGeometry", "strokeGeometry"].iter().any(|k| o.contains_key(*k)) { + if ["vectorNetwork", "vectorNetworkRef", "fillGeometry", "strokeGeometry"].iter().any(|k| o.contains_key(*k)) { return; } let parent = v.get("parentIndex").and_then(|p| p.get("guid")).and_then(guid); @@ -879,7 +908,8 @@ impl<'a> Mapper<'a> { /// False when there's none or it's damaged (the outlines stand in). fn network(&mut self, o: &mut Obj, v: &View<'a>) -> bool { let Some(vd) = v.get("vectorData") else { return false }; - let Some(blob) = num(vd, "vectorNetworkBlob").and_then(|i| self.blobs.get(i as usize)).copied() else { return false }; + let Some(blob_id) = num(vd, "vectorNetworkBlob").map(|i| i as usize) else { return false }; + let Some(blob) = self.blobs.get(blob_id).copied() else { return false }; let Some(net) = network::decode(blob) else { self.warn("damaged vector networks import as outlines"); return false; @@ -899,28 +929,6 @@ 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")); - let vertices: Vec = net - .vertices - .iter() - .map(|p| { - let mut out = json!({"x": p.x * sx, "y": p.y * sy}); - let st = style(p.style); - if let Some(r) = st.and_then(|s| num(s, "cornerRadius")).filter(|r| *r > 0.0) { - out["radius"] = json!(r); - } - match st.and_then(|s| s.get("handleMirroring")).and_then(Kv::str) { - Some("ANGLE") => out["mirror"] = json!("angle"), - Some("ANGLE_AND_LENGTH") => out["mirror"] = json!("angleAndLength"), - Some("NONE") => out["mirror"] = json!("none"), - _ => {} - } - out - }) - .collect(); - let segments: Vec = - net.segments.iter().map(|s| json!({"a": s.a, "b": s.b, "ta": [s.ta.0 * sx, s.ta.1 * sy], "tb": [s.tb.0 * sx, s.tb.1 * sy]})).collect(); - let regions: Vec = - net.regions.iter().map(|r| json!({"loops": r.loops, "winding": if r.non_zero { "nonZero" } else { "evenOdd" }})).collect(); if net.regions.iter().any(|r| style(r.style).is_some_and(|s| s.get("fillPaints").is_some())) { self.warn("filled areas of a vector with their own fill use the layer's fill"); } @@ -946,7 +954,46 @@ impl<'a> Mapper<'a> { o.insert("strokeCapStart".into(), json!(cap_name(first.unwrap_or(node)))); o.insert("strokeCapEnd".into(), json!(cap_name(last.unwrap_or(node)))); } - o.insert("vectorNetwork".into(), json!({"vertices": vertices, "segments": segments, "regions": regions})); + // Every instance of a main shows the same network: it is written once and shared. + let key = (blob_id, sx.to_bits(), sy.to_bits(), std::ptr::from_ref(vd) as usize); + let id = match self.network_ids.get(&key) { + Some(id) => *id, + None => { + let vertices: Vec = net + .vertices + .iter() + .map(|p| { + let mut out = json!({"x": p.x * sx, "y": p.y * sy}); + let st = style(p.style); + if let Some(r) = st.and_then(|s| num(s, "cornerRadius")).filter(|r| *r > 0.0) { + out["radius"] = json!(r); + } + match st.and_then(|s| s.get("handleMirroring")).and_then(Kv::str) { + Some("ANGLE") => out["mirror"] = json!("angle"), + Some("ANGLE_AND_LENGTH") => out["mirror"] = json!("angleAndLength"), + Some("NONE") => out["mirror"] = json!("none"), + _ => {} + } + out + }) + .collect(); + let segments: Vec = net + .segments + .iter() + .map(|s| json!({"a": s.a, "b": s.b, "ta": [s.ta.0 * sx, s.ta.1 * sy], "tb": [s.tb.0 * sx, s.tb.1 * sy]})) + .collect(); + let regions: Vec = + net.regions.iter().map(|r| json!({"loops": r.loops, "winding": if r.non_zero { "nonZero" } else { "evenOdd" }})).collect(); + let mut entry = json!({}); + entry["vertices"] = Value::Array(vertices); + entry["segments"] = Value::Array(segments); + entry["regions"] = Value::Array(regions); + self.networks.push(crate::rest::network(&entry)); + self.network_ids.insert(key, self.networks.len() - 1); + self.networks.len() - 1 + } + }; + o.insert("vectorNetworkRef".into(), json!(id)); true } diff --git a/crates/format/src/fig/mod.rs b/crates/format/src/fig/mod.rs index ec2a0e23a..0f6a38ff2 100644 --- a/crates/format/src/fig/mod.rs +++ b/crates/format/src/fig/mod.rs @@ -39,6 +39,18 @@ const MAX_CHUNK: u64 = 512 * 1024 * 1024; const MAX_IMAGE: u64 = 256 * 1024 * 1024; /// Most chunks read from `canvas.fig`. const MAX_CHUNKS: usize = 16; +/// Most layers imported from a `.fig` file: one per [`PACKED_BYTES_PER_LAYER`] bytes of its +/// compressed canvas, at least the REST import's cap and at most [`MAX_FIG_NODES`]. Instances +/// expand into a layer per layer of their component, and chunks inflate up to [`MAX_CHUNK`], so the +/// budget follows what the file takes, not what it unpacks to: a small file can't claim a large +/// count, however it's built; a large one gets room. +const PACKED_BYTES_PER_LAYER: usize = 32; +const MAX_FIG_NODES: usize = 2_000_000; + +/// Most layers imported from a `.fig` file whose compressed canvas is `packed` bytes. +pub(crate) fn layer_budget(packed: usize) -> usize { + (packed / PACKED_BYTES_PER_LAYER).clamp(crate::rest::MAX_NODES, MAX_FIG_NODES) +} /// Whether `bytes` look like a `.fig` file: a zip holding `canvas.fig`, or a bare canvas. pub fn is_fig(bytes: &[u8]) -> bool { @@ -57,14 +69,22 @@ pub fn try_import(bytes: &[u8], name: &str) -> Option Result<(Document, Vec), FormatError> { - let archive = Archive::open(bytes)?; - let (schema, message) = decode_canvas(&archive.canvas)?; + let mut archive = Archive::open(bytes)?; + // The budgets follow the compressed canvas, which the file itself bounds (its zip member may + // inflate too). + let packed = archive.canvas.len().min(bytes.len()); + // Each stage's input is dropped as soon as the next one is built: in a large file every one + // of them takes gigabytes, and holding them all at once runs out of memory. + let (schema, message) = decode_canvas(&std::mem::take(&mut archive.canvas))?; let root = schema.find("Message").ok_or_else(|| corrupt("the schema has no Message definition"))?; - let msg = schema.decode_message(root, &message).map_err(|e| corrupt(e.to_string()))?; + let msg = schema.decode_message_within(root, &message, kiwi::value_budget(packed)).map_err(|e| corrupt(e.to_string()))?; + let max_nodes = layer_budget(packed); + drop(message); let file_name = archive.file_name.as_deref().filter(|n| !n.trim().is_empty()).unwrap_or(name); - let (json, mut warnings) = map::to_rest(&msg, file_name); + let (json, mut warnings, networks) = map::to_rest(&msg, file_name, max_nodes); + drop(msg); let images = |r: &str| archive.image(r); - let (doc, more) = crate::rest::import(&json, &images)?; + let (doc, more) = crate::rest::import_with_networks(&json, &images, networks, max_nodes)?; warnings.extend(more.into_iter().filter_map(map::adapt_warning)); Ok((doc, warnings)) } diff --git a/crates/format/src/fig/tail_tests.rs b/crates/format/src/fig/tail_tests.rs index fc0c58154..9b834805e 100644 --- a/crates/format/src/fig/tail_tests.rs +++ b/crates/format/src/fig/tail_tests.rs @@ -392,8 +392,8 @@ fn mangled_tail_files_never_panic() { m[i] = r.next() as u8; } if let Ok(kv) = sc.decode_message(root, &m) { - let (json, _) = map::to_rest(&kv, "x"); - let _ = crate::rest::import(&json, &crate::rest::no_images); + let (json, _, networks) = map::to_rest(&kv, "x", crate::rest::MAX_NODES); + let _ = crate::rest::import_with_networks(&json, &crate::rest::no_images, networks, crate::rest::MAX_NODES); } } } diff --git a/crates/format/src/fig/tests.rs b/crates/format/src/fig/tests.rs index 19c4fc157..574f860c2 100644 --- a/crates/format/src/fig/tests.rs +++ b/crates/format/src/fig/tests.rs @@ -588,7 +588,7 @@ fn mangled_kiwi_never_panics() { } for cut in (0..msg.len()).step_by(3) { if let Ok(kv) = sc.decode_message(root, &msg[..cut]) { - let _ = map::to_rest(&kv, "x"); + let _ = map::to_rest(&kv, "x", crate::rest::MAX_NODES); } } for _ in 0..2000 { @@ -598,8 +598,8 @@ fn mangled_kiwi_never_panics() { m[i] = r.next() as u8; } if let Ok(kv) = sc.decode_message(root, &m) { - let (json, _) = map::to_rest(&kv, "x"); - let _ = crate::rest::import(&json, &crate::rest::no_images); + let (json, _, networks) = map::to_rest(&kv, "x", crate::rest::MAX_NODES); + let _ = crate::rest::import_with_networks(&json, &crate::rest::no_images, networks, crate::rest::MAX_NODES); } let mut sbytes = schema_bytes.clone(); let i = (r.next() as usize) % sbytes.len(); @@ -621,6 +621,59 @@ fn mangled_kiwi_never_panics() { } } +#[test] +fn large_files_get_a_larger_value_budget() { + // Small files keep the fixed floor: a few bytes can't expand into a huge tree. + assert_eq!(kiwi::value_budget(0), 20_000_000); + assert_eq!(kiwi::value_budget(1 << 20), 20_000_000); + // A real 400 000-layer file: an 83.5 MB canvas whose message unpacks to 334 MB and holds + // 30.5 million values was refused as "too many values". + assert!(kiwi::value_budget(83_491_232) > 30_514_899); + // Still bounded by the largest canvas read. + assert!(kiwi::value_budget(MAX_CANVAS as usize) <= 128 << 20); +} + +#[test] +fn the_layer_cap_follows_the_file_size() { + // A small (or broken) file keeps the REST import's cap: instances expand into a layer per + // layer of their component, and a few bytes mustn't claim millions of layers. + assert_eq!(layer_budget(0), crate::rest::MAX_NODES); + assert_eq!(layer_budget(1 << 20), crate::rest::MAX_NODES); + // A real 894 004-layer file (an 83.5 MB canvas) stopped at 200 000 and came in with 27 of + // its 30 pages empty. + assert!(layer_budget(83_491_232) > 894_004); + // No file gets more than the ceiling. + assert_eq!(layer_budget(MAX_CANVAS as usize), MAX_FIG_NODES); +} + +#[test] +fn a_small_file_that_unpacks_large_gets_no_larger_budgets() { + // 40 MB of zeros in a blob pack into a few KB. Keyed to the unpacked message, they lifted the + // layer cap above the 231 231 layers its instances expand into; keyed to the file, the cap + // stays at the REST import's. + let mut nodes = vec![node(0, None, "DOCUMENT", "D", vec![]), node(1, Some((0, "!")), "CANVAS", "P", vec![])]; + nodes.push(node(5, Some((1, "!")), "SYMBOL", "Main", vec![("size", xy(10.0, 10.0))])); + nodes.extend((10..1010).map(|i| node(i, Some((5, "!")), "RECTANGLE", "R", vec![("size", xy(1.0, 1.0))]))); + nodes.extend((2000..2230).map(|i| node(i, Some((1, "!")), "INSTANCE", "I", vec![("symbolData", o(vec![("symbolID", g(5))]))]))); + let blob = o(vec![("bytes", Kv::Bytes(vec![0; 40 << 20]))]); + let file = canvas(&schema(), &o(vec![("nodeChanges", arr(nodes)), ("blobs", arr(vec![blob]))])); + assert!(file.len() < 1 << 20, "{} bytes", file.len()); + let (doc, warnings) = import(&file, "x").unwrap(); + assert!(warnings.iter().any(|w| w.contains("more than 200000 layers")), "{warnings:?}"); + assert!(doc.node_count() <= crate::rest::MAX_NODES + 10); +} + +#[test] +fn the_mapper_stops_at_the_layer_cap_it_is_given() { + let mut nodes = vec![node(0, None, "DOCUMENT", "D", vec![]), node(1, Some((0, "!")), "CANVAS", "P", vec![])]; + nodes.extend((2..12).map(|i| node(i, Some((1, "!")), "RECTANGLE", "R", vec![("size", xy(1.0, 1.0))]))); + let msg = o(vec![("nodeChanges", arr(nodes))]); + let (_, warnings, _) = map::to_rest(&msg, "x", 5); + assert!(warnings.iter().any(|w| w.contains("more than 5 layers")), "{warnings:?}"); + let (_, warnings, _) = map::to_rest(&msg, "x", crate::rest::MAX_NODES); + assert!(!warnings.iter().any(|w| w.contains("more than")), "{warnings:?}"); +} + #[test] fn hostile_input_is_refused() { // A message that contains itself, nested past the depth cap. @@ -916,7 +969,7 @@ fn dump_samples() { std::fs::write(format!("{out}/{stem}.schema.txt"), txt).unwrap(); let msg = schema.decode_message(schema.find("Message").unwrap(), &message).unwrap(); std::fs::write(format!("{out}/{stem}.json"), serde_json::to_string_pretty(&debug_json(&msg)).unwrap()).unwrap(); - let (rest, _) = map::to_rest(&msg, &stem); + let (rest, ..) = map::to_rest(&msg, &stem, super::layer_budget(message.len())); std::fs::write(format!("{out}/{stem}.rest.json"), serde_json::to_string_pretty(&rest).unwrap()).unwrap(); } } diff --git a/crates/format/src/rest/mod.rs b/crates/format/src/rest/mod.rs index 798b2645a..1bd029c6a 100644 --- a/crates/format/src/rest/mod.rs +++ b/crates/format/src/rest/mod.rs @@ -49,7 +49,7 @@ use crate::FormatError; use props::{MAX_COORD, MAX_SIZE, clip_str, flag, list, num, text}; pub use variables::export as export_variables; -/// Most layers imported from one file. +/// Most layers imported from one file. The `.fig` import sets its own, from the file's size. pub const MAX_NODES: usize = 200_000; /// Deepest layer nesting followed. const MAX_DEPTH: usize = 256; @@ -138,6 +138,28 @@ pub fn import(v: &Value, images: ImageResolver) -> Result<(Document, Vec /// in the file JSON (a `meta` with `variableCollections`, or `variableCollections` and /// `variables` at the top level) are read too; the first definition of an id wins. pub fn import_with(v: &Value, variables: Option<&Value>, images: ImageResolver) -> Result<(Document, Vec), FormatError> { + import_parts(v, variables, images, Vec::new(), MAX_NODES) +} + +/// [`import`] for the `.fig` import's JSON, whose vectors name their networks by +/// `vectorNetworkRef`, an index in `networks` (built once each, and far smaller than as JSON). +/// `max_nodes`: the layer cap, set by the `.fig` import in place of [`MAX_NODES`]. +pub(crate) fn import_with_networks( + v: &Value, + images: ImageResolver, + networks: Vec>, + max_nodes: usize, +) -> Result<(Document, Vec), FormatError> { + import_parts(v, None, images, networks, max_nodes) +} + +fn import_parts( + v: &Value, + variables: Option<&Value>, + images: ImageResolver, + networks: Vec>, + max_nodes: usize, +) -> Result<(Document, Vec), FormatError> { let entries: Vec<&Value> = if is_document(v) { vec![v] } else { nodes_entries(v).collect() }; if entries.is_empty() { return Err(FormatError::Corrupt("not a REST API file JSON (no `document`)".into())); @@ -157,6 +179,8 @@ pub fn import_with(v: &Value, variables: Option<&Value>, images: ImageResolver) cx.warn("the variables JSON has no `variableCollections` (expected the local variables response) and was ignored"); } cx.style_definitions(v); + cx.networks = networks; + cx.max_nodes = max_nodes; for e in entries { let Some(root) = e.get("document") else { continue }; match text(root, "type") { @@ -309,6 +333,10 @@ pub(crate) struct Ctx<'a> { /// Imported variables by id, and the mode ids of imported collections (default first). var_kinds: BTreeMap, var_modes: BTreeMap>, + /// Vector networks built by the `.fig` import, named by layers' `vectorNetworkRef`. + networks: Vec>, + /// Most layers imported: [`MAX_NODES`], or the `.fig` import's own cap. + max_nodes: usize, } impl<'a> Ctx<'a> { @@ -332,6 +360,8 @@ impl<'a> Ctx<'a> { overlay_meta: BTreeMap::new(), var_kinds: BTreeMap::new(), var_modes: BTreeMap::new(), + networks: Vec::new(), + max_nodes: MAX_NODES, } } @@ -387,8 +417,9 @@ impl<'a> Ctx<'a> { self.warn(format!("layers nested deeper than {MAX_DEPTH} levels were skipped")); return; } - if self.count >= MAX_NODES { - self.warn(format!("the file has more than {MAX_NODES} layers; the rest were skipped")); + if self.count >= self.max_nodes { + let max = self.max_nodes; + self.warn(format!("the file has more than {max} layers; the rest were skipped")); return; } let Some(ty) = text(j, "type") else { @@ -586,12 +617,17 @@ impl<'a> Ctx<'a> { } } - /// A vector's network: the editable one when the JSON carries it (`vectorNetwork`, our - /// extension, written by the `.fig` import), else from its geometry. A stroke-only vector - /// uses the stroke outline, painted with the stroke paints (exact look, editable as a shape). + /// A vector's network: the editable one when the JSON carries it (`vectorNetwork`, or + /// `vectorNetworkRef` naming one built by the `.fig` import: our extensions), else from its + /// geometry. A stroke-only vector uses the stroke outline, + /// painted with the stroke paints (exact look, editable as a shape). fn vector(&mut self, n: &mut Node, j: &Value) { - if let Some(net) = j.get("vectorNetwork") { - match network(net) { + let net = match j.get("vectorNetworkRef") { + Some(r) => Some(r.as_u64().and_then(|i| self.networks.get(usize::try_from(i).ok()?).cloned().flatten())), + None => j.get("vectorNetwork").map(network), + }; + if let Some(net) = net { + match net { Some(network) => { n.kind = NodeKind::Vector { network }; return; @@ -1110,7 +1146,7 @@ fn local(parent: Affine, world: Affine) -> Affine { /// Finite path data within the coordinate cap. /// A vector network in our own JSON shape, when it's within bounds and refers only to what it has. -fn network(v: &Value) -> Option { +pub(crate) fn network(v: &Value) -> Option { use serde::Deserialize; let mut net = VectorNetwork::deserialize(v).ok()?; let entries: usize = net.regions.iter().flat_map(|r| &r.loops).map(Vec::len).sum(); diff --git a/crates/format/src/rest/tests.rs b/crates/format/src/rest/tests.rs index d7117fd00..58dfc5ef0 100644 --- a/crates/format/src/rest/tests.rs +++ b/crates/format/src/rest/tests.rs @@ -707,3 +707,18 @@ fn layer_count_is_capped() { assert_eq!(doc.node_count(), MAX_NODES + 1); assert!(warnings.iter().any(|w| w.contains("more than")), "{warnings:?}"); } + +#[test] +fn the_fig_import_sets_its_own_layer_cap() { + // The `.fig` import passes a cap from the file's size: above `MAX_NODES` every layer comes in. + let kids: Vec = (0..MAX_NODES + 5).map(|i| json!({"id": i.to_string(), "type": "RECTANGLE", "name": "R"})).collect(); + let json = file(json!([page("Page", Value::Array(kids))])); + let (doc, warnings) = import_with_networks(&json, &no_images, Vec::new(), MAX_NODES + 10).unwrap(); + assert_eq!(doc.node_count(), MAX_NODES + 6); + assert!(!warnings.iter().any(|w| w.contains("more than")), "{warnings:?}"); + // Below it, the import stops at the cap it was given. + let few: Vec = (0..10).map(|i| json!({"id": i.to_string(), "type": "RECTANGLE", "name": "R"})).collect(); + let (doc, warnings) = import_with_networks(&file(json!([page("Page", Value::Array(few))])), &no_images, Vec::new(), 4).unwrap(); + assert_eq!(doc.node_count(), 5); + assert!(warnings.iter().any(|w| w.contains("more than 4 layers")), "{warnings:?}"); +} From 0efddc3894be71e31a3d10bc0ece63cdff3df550 Mon Sep 17 00:00:00 2001 From: Andrii Volkov <60794004+volkovskey@users.noreply.github.com> Date: Fri, 16 Oct 2026 10:46:08 +0300 Subject: [PATCH 058/817] fix(format): reopen large documents once saved `document.json` was read under the 512 MB cap for any archive member, so a large imported document saved but didn't open again: 900 000 layers save as a 1.48 GB document.json, packed into 244 MB. It may now unpack to 16 times its packed size (counted up to the archive's own size), within 512 MB and 4 GB; images and other members keep 512 MB. A small archive still can't unpack into gigabytes. That saved file reopens in 13 s with a 5.9 GB peak. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YQxjkNSUJhTkTfY74aNeki --- crates/format/src/large_tests.rs | 15 +++++++++++++++ crates/format/src/lib.rs | 14 +++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/crates/format/src/large_tests.rs b/crates/format/src/large_tests.rs index 3ff352aca..2dc9eb4c1 100644 --- a/crates/format/src/large_tests.rs +++ b/crates/format/src/large_tests.rs @@ -202,3 +202,18 @@ fn the_header_is_read_on_its_own() { let (_, _, index) = parse_json(&d.replacen("\"imageIndex\":[]", "\"imageIndex\":[{\"hash\":\"ab\"},{\"nope\":1}]", 1)).unwrap(); assert_eq!(index, Some(["ab".to_string()].into_iter().collect())); } + +#[test] +fn document_json_may_unpack_in_proportion_to_its_packed_size() { + const MB: u64 = 1024 * 1024; + // A small archive keeps the member cap: it can't unpack into gigabytes. + assert_eq!(document_limit(0, 0), MAX_MEMBER); + assert_eq!(document_limit(MB, 2 * MB), MAX_MEMBER); + // A real 900 000-layer document saved by us packs 1 477 139 810 bytes into 244 362 923, and + // didn't open again under the 512 MB cap. + assert!(document_limit(244_362_923, 260 * MB) > 1_477_139_810); + // The packed size an archive claims counts only up to the archive's own size. + assert_eq!(document_limit(u64::MAX, MB), MAX_MEMBER); + // Never more than the ceiling. + assert_eq!(document_limit(u64::MAX, u64::MAX), MAX_DOCUMENT); +} diff --git a/crates/format/src/lib.rs b/crates/format/src/lib.rs index f88416e27..dd96b9323 100644 --- a/crates/format/src/lib.rs +++ b/crates/format/src/lib.rs @@ -39,6 +39,11 @@ pub const FORMAT: &str = "figcraft"; pub const VERSION: u32 = 1; /// Largest archive member we read (guards against zip bombs). const MAX_MEMBER: u64 = 512 * 1024 * 1024; +/// `document.json` may unpack to [`DOCUMENT_RATIO`] times what it takes in the archive, within +/// [`MAX_MEMBER`] and [`MAX_DOCUMENT`]: a large document saved by us (a 900 000-layer file packs +/// 1.48 GB into 244 MB) opens again, while a small archive still can't unpack into gigabytes. +const DOCUMENT_RATIO: u64 = 16; +const MAX_DOCUMENT: u64 = 4 * 1024 * 1024 * 1024; /// Most versions a file keeps: saving more is refused, extra entries in a file are skipped. pub const MAX_VERSIONS: usize = 100; /// Longest version name and description kept (chars). @@ -455,6 +460,11 @@ pub(crate) fn read_member(z: &mut zip::ZipArchive, name: &str Ok(data) } +/// Largest `document.json` read from an archive of `len` bytes in which it takes `packed`. +pub(crate) fn document_limit(packed: u64, len: u64) -> u64 { + packed.min(len).saturating_mul(DOCUMENT_RATIO).clamp(MAX_MEMBER, MAX_DOCUMENT) +} + /// How many images, and how many bytes of them together, one file may give. #[derive(Clone, Copy, Debug)] pub(crate) struct ImageBudget { @@ -476,7 +486,9 @@ pub(crate) fn load_within(bytes: &[u8], budget: ImageBudget) -> Result Date: Fri, 16 Oct 2026 10:58:06 +0300 Subject: [PATCH 059/817] Read the portal's colour scheme as the D-Bus variant it is ReadOne replies with a variant body (signature v); deserializing it straight to u32 (signature u) is a signature mismatch that zvariant rejects, so the initial colour scheme never arrived and system mode kept its light fallback. Take the Value and read the uint32 out of it. --- apps/figcraft/src/services.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/figcraft/src/services.rs b/apps/figcraft/src/services.rs index 60ae25596..fa95e123d 100644 --- a/apps/figcraft/src/services.rs +++ b/apps/figcraft/src/services.rs @@ -174,9 +174,13 @@ fn watch_system_dark(dark: Arc) { return; }; let read = || -> zbus::Result { - conn.call_method(Some(PORTAL), "/org/freedesktop/portal/desktop", Some(SETTINGS), "ReadOne", &(APPEARANCE, "color-scheme"))? - .body() - .deserialize() + let reply = conn.call_method(Some(PORTAL), "/org/freedesktop/portal/desktop", Some(SETTINGS), "ReadOne", &(APPEARANCE, "color-scheme"))?; + let body = reply.body(); + let value = body.deserialize::()?; + match value { + zbus::zvariant::Value::U32(v) => Ok(v), + _ => Ok(0), + } }; match read() { Ok(v) => store(v), From e8b181de392180ecb27381396a9aa85af4e9b794 Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Fri, 16 Oct 2026 10:23:57 +0200 Subject: [PATCH 060/817] M4: Flatten keeps open paths Flatten (Cmd+E, Alt+Shift+F) and Join selection (Cmd+J) built the result from each layer's fill outline, so open paths, which have none, were dropped: two pen paths flattened to "nothing to flatten", and next to a closed shape they vanished. Vectors now bring their own network (open paths, unfilled loops and each region's winding stay), mapped into the parent's space; other layers still flatten to their outline. Closes #377 --- ROADMAP.md | 4 +- crates/engine/src/cmd/structure.rs | 53 +++++++++++++-------- crates/engine/src/shapes_behaviour_tests.rs | 24 ++++++++++ docs/roadmap.md | 3 +- 4 files changed, 62 insertions(+), 22 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index c3c12085e..5eb2ba188 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (Flatten keeps open paths (#377); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -131,6 +131,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). ## Progress log +- **2026-10-16** · Flatten keeps open paths (M4, #377): Flatten (Cmd+E, Alt+Shift+F) and Join selection (Cmd+J) built the result from each layer's fill outline, so open paths, which have none, were dropped: two pen paths flattened to "nothing to flatten", and next to a closed shape they vanished. Vectors now bring their own network (open paths, unfilled loops and each region's winding stay), mapped into the parent's space; other layers still flatten to their outline. Regression test in the shapes behaviour tests. Numbers unchanged. - **2026-10-14** · Corner handles win over the corner-radius handles (M1, #292): a press on the inner half of a corner handle's square picked the radius handle 10 px in, so the drag neither resized nor (dragging outward) rounded anything. Inside the drawn square the corner now resizes both sides (in ratio with Shift or the link); further in the radius handle still answers. Regression test in the transform behaviour suite. Numbers unchanged. - **2026-10-14** · Home screen recent files as cards (M7): each card shows the picture its file carries on its first page's colour, the file's icon, name and "Edited ... ago"; sort by name, creation or last change either way; a table view; a click selects, a double-click or Enter opens, arrow keys move; Open, Show in folder and Remove from recents on right-click. Numbers unchanged. - **2026-10-13** · Vector edit mode regions (M4): with the Move tool, the filled area under the pointer is hatched with "/" lines in the selection colour, clipped by the area's own fill rule so holes stay clear; the hatch goes near points (3.5 px) and segments (2 px), and its spacing follows octave folding (8 px at every power-of-two zoom), fixed to the shape. A click selects the area with its points (they move with it but keep the unselected look), Shift adds or removes one, a press on a selected area drags the whole selection as one undo step, and a click on an empty spot clears the areas and stays in edit mode. `vector.edit.select {regions}` and `vector.edit.state` (`regions`, `regionVertices`, `regionHover`); `vector_regions_tests` and `regions_tests`. Numbers unchanged. @@ -313,6 +314,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-16 | minor | Flatten keeps open paths (M4, #377): Flatten (Cmd+E, Alt+Shift+F) and Join selection (Cmd+J) built the result from each layer's fill outline, so open paths, which have none, were dropped: two pen paths flattened to "nothing to flatten", and next to a closed shape they vanished. Vectors now bring their own network (open paths, unfilled loops and each region's winding stay), mapped into the parent's space; other layers still flatten to their outline. Regression test in the shapes behaviour tests. Numbers unchanged | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | | 2026-10-15 | minor | Drop files anywhere to open them (M7): dragging files over the window shows a "Drop to open" (home) or "Drop to import" (canvas) overlay. On the home screen each supported file opens as a document of its own and other files are turned away with a toast; on the canvas the files import at the drop point. Both wait behind a small card that is on screen before a large file blocks the window. A canvas import stays with the document and page that received the drop even if the tab or page changes meanwhile, and is cancelled with a message if that document or page is gone. Numbers unchanged. | | 2026-10-15 | minor | M7: system font discovery skips entries observed as non-regular files before opening them, avoiding the reproduced named-pipe stall. Regular-file symlinks remain supported; directory depth, font limits and priorities are unchanged. Numbers unchanged. | diff --git a/crates/engine/src/cmd/structure.rs b/crates/engine/src/cmd/structure.rs index bed70d3df..3fb1dc2b2 100644 --- a/crates/engine/src/cmd/structure.rs +++ b/crates/engine/src/cmd/structure.rs @@ -309,33 +309,46 @@ fn flatten(s: &mut Session, p: &Value) -> Result { let parent = doc.get(top)?.parent.ok_or_else(|| bad("vector.flatten", "can't flatten a page"))?; let index = doc.index_in_parent(top).map(|i| i + 1); let pw = doc.world_transform(parent); - let mut path = BezPath::new(); - let mut even = false; + let mut net = VectorNetwork::default(); for i in &ids { let Some(n) = doc.node(*i) else { continue }; - // Booleans flatten to their result; strokes don't get outlined. - let Some((mut op, rule)) = (match &n.kind { - NodeKind::Group | NodeKind::Frame | NodeKind::Component { .. } | NodeKind::Instance { .. } => figcraft_render::subtree_outline(doc, n, 0), - _ => figcraft_render::node_outline(doc, n), - }) else { - continue; + // Vectors keep their own network (open paths and unfilled loops have no fill outline); + // booleans flatten to their result; strokes don't get outlined. + let mut part = match &n.kind { + NodeKind::Vector { network } => network.clone(), + _ => { + let Some((op, rule)) = (match &n.kind { + NodeKind::Group | NodeKind::Frame | NodeKind::Component { .. } | NodeKind::Instance { .. } => { + figcraft_render::subtree_outline(doc, n, 0) + } + _ => figcraft_render::node_outline(doc, n), + }) else { + continue; + }; + let mut part = VectorNetwork::from_path(&op); + if rule == figcraft_render::FillRule::EvenOdd { + for r in &mut part.regions { + r.winding = WindingRule::EvenOdd; + } + } + part + } }; - even |= rule == figcraft_render::FillRule::EvenOdd; // Into the common parent's space. - let w = doc.world_transform(*i); - op.apply_affine(pw.inverse() * w); - path.extend(op.elements().iter().copied()); + let all: Vec = (0..part.vertices.len()).collect(); + crate::vectoredit::ops::transform_vertices(&mut part, &all, pw.inverse() * doc.world_transform(*i)); + let (nv, ns) = (net.vertices.len(), net.segments.len()); + net.vertices.extend(part.vertices); + net.segments.extend(part.segments.into_iter().map(|s| Segment { a: s.a + nv, b: s.b + nv, ..s })); + net.regions.extend( + part.regions.into_iter().map(|r| Region { loops: r.loops.into_iter().map(|l| l.into_iter().map(|s| s + ns).collect()).collect(), ..r }), + ); } - if path.elements().is_empty() { + let Some(bb) = net.bounds() else { return Err(EngineError::Disabled("vector.flatten".into(), "nothing to flatten".into())); - } + }; let first = ids.first().and_then(|i| doc.node(*i)).cloned(); - let bb = path.bounding_box(); - path.apply_affine(Affine::translate((-bb.x0, -bb.y0))); - let mut net = VectorNetwork::from_path(&path); - for r in &mut net.regions { - r.winding = if even { WindingRule::EvenOdd } else { WindingRule::NonZero }; - } + net.translate(-bb.x0, -bb.y0); let vid = doc.alloc_id(); let name = first.as_ref().map(|f| f.name.clone()).unwrap_or_else(|| "Vector".into()); let mut v = Node::new(vid, NodeKind::Vector { network: net }, name, bb.width(), bb.height()); diff --git a/crates/engine/src/shapes_behaviour_tests.rs b/crates/engine/src/shapes_behaviour_tests.rs index 154c5ae19..62069da32 100644 --- a/crates/engine/src/shapes_behaviour_tests.rs +++ b/crates/engine/src/shapes_behaviour_tests.rs @@ -396,6 +396,30 @@ fn boolean_results_and_the_look_they_take() { assert!(path.area().abs() < 1e-6, "no overlap, nothing to show"); } +#[test] +fn flatten_keeps_open_paths() { + // #377: open paths have no fill outline, so two pen paths flattened to "nothing to flatten" + // and next to a closed shape they disappeared. + let mut s = Session::new(); + let a = create(&mut s, "vector.create", json!({"points": [[0, 0], [100, 50], [200, 0]]})); + let b = create(&mut s, "vector.create", json!({"points": [[0, 100], [100, 150], [200, 100]]})); + let tri = create(&mut s, "vector.create", json!({"points": [[300, 0], [400, 0], [400, 100]], "closed": true})); + let v = create(&mut s, "vector.flatten", json!({"ids": [a, b, tri]})); + let NodeKind::Vector { network } = node(&s, v).kind else { panic!("flatten makes one vector") }; + assert_eq!((network.vertices.len(), network.segments.len()), (9, 7), "both open paths and the triangle"); + assert_eq!(network.regions.len(), 1, "only the triangle is filled"); + let bb = s.doc().unwrap().world_bounds(v).unwrap(); + assert_eq!((bb.x0, bb.y0, bb.x1, bb.y1), (0.0, 0.0, 400.0, 150.0), "nothing moves"); + + // Joining two open paths goes the same way. + let mut s = Session::new(); + let a = create(&mut s, "vector.create", json!({"points": [[0, 0], [100, 0]]})); + let b = create(&mut s, "vector.create", json!({"points": [[0, 50], [100, 50]]})); + let v = create(&mut s, "vector.join", json!({"ids": [a, b]})); + let NodeKind::Vector { network } = node(&s, v).kind else { panic!("join makes one vector") }; + assert_eq!(network.segments.len(), 2); +} + #[test] fn flatten_and_outline_stroke() { // Flatten: one vector layer from the selection, in one step; Alt+Shift+F does it. diff --git a/docs/roadmap.md b/docs/roadmap.md index 9e9eaec9f..8acce139a 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # FigCraft roadmap: milestones and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (community fixes from #478 up and a control-channel fix (#589); recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading, SVG import budgets, Leptos code, full screen, server snapshots, owner-only preferences, ruzstd 0.9.1, layer cycle repair, batch rollback, Direct3D 12 on Windows, plugin metering; vector edit mode regions: hover hatch, selection and drag; repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` import, best effort; 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 ~79%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (Flatten keeps open paths (#377); community fixes from #478 up and a control-channel fix (#589); recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading, SVG import budgets, Leptos code, full screen, server snapshots, owner-only preferences, ruzstd 0.9.1, layer cycle repair, batch rollback, Direct3D 12 on Windows, plugin metering; vector edit mode regions: hover hatch, selection and drag; repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` import, best effort; 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 ~79%) · **Target:** Figma Design (desktop app 126.10.7) Forward-looking plan. Where FigCraft stands today: [`ROADMAP.md`](../ROADMAP.md) and [`target-app-parity.md`](target-app-parity.md); the full ranked list: [`gaps.md`](gaps.md). Hours @@ -73,6 +73,7 @@ blockers. | Date | Change | Summary | |---|---|---| +| 2026-10-16 | minor | Flatten keeps open paths (M4, #377): Flatten (Cmd+E, Alt+Shift+F) and Join selection (Cmd+J) built the result from each layer's fill outline, so open paths, which have none, were dropped: two pen paths flattened to "nothing to flatten", and next to a closed shape they vanished. Vectors now bring their own network (open paths, unfilled loops and each region's winding stay), mapped into the parent's space; other layers still flatten to their outline. Regression test in the shapes behaviour tests. Numbers unchanged | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | | 2026-10-14 | minor | M7: the Small caps button in Type settings showed a box where the UI font has no small-capital `ɢ` (builds without Inter use egui's fonts); its sample is now a capital and a smaller capital, drawn from ordinary letters every UI font has. Numbers unchanged | | 2026-10-14 | minor | M7: Home screen recent files as cards: each card shows the picture its file carries on its first page's colour, the file's icon, name and "Edited ... ago"; sort by name, creation or last change either way; a table view; a click selects, a double-click or Enter opens, arrow keys move; Open, Show in folder and Remove from recents on right-click. Numbers unchanged. | From afdb21bad6e7cfb16fa25e666d43ce65a1c75651 Mon Sep 17 00:00:00 2001 From: Andrii Volkov <60794004+volkovskey@users.noreply.github.com> Date: Fri, 16 Oct 2026 11:24:39 +0300 Subject: [PATCH 061/817] fix(ui): drag the line between pages and layers to size the pages list The pages list took a fixed 40% of the left panel (#272). The line under it now drags to make the list taller or shorter: at least three rows, and always leaving the layers their header and three rows. A double-click puts back the default. The main window keeps the height in the preferences, as it does the panel widths, saved once the drag is over. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YQxjkNSUJhTkTfY74aNeki --- crates/engine/src/lib.rs | 4 ++ crates/ui-egui/src/layers.rs | 51 +++++++++++++- crates/ui-egui/src/layers_behaviour_tests.rs | 71 ++++++++++++++++++++ crates/ui-egui/src/lib.rs | 6 +- crates/ui-egui/src/windows.rs | 4 +- 5 files changed, 132 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 34653bd5f..dcf7e2f27 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -606,6 +606,9 @@ pub struct Prefs { /// The widths of the main window's left and right panels (the interface keeps them within its /// limits; other windows have their own while they are open). pub panel_widths: (f32, f32), + /// The height asked for the main window's pages list, dragged at its lower edge (`None`: a + /// share of the panel; the interface keeps it within its limits). + pub pages_height: Option, /// The interface language: a language code ("en", "es", "pt-BR") or "system" (the OS or browser /// language). Languages without a catalog show English. pub language: String, @@ -666,6 +669,7 @@ impl Default for Prefs { show_dimensions: true, theme: "system".into(), panel_widths: (240.0, 240.0), + pages_height: None, language: "system".into(), user_name: cmd::comment::DEFAULT_AUTHOR.into(), reduce_motion: false, diff --git a/crates/ui-egui/src/layers.rs b/crates/ui-egui/src/layers.rs index 8b6147628..a6bbe5f52 100644 --- a/crates/ui-egui/src/layers.rs +++ b/crates/ui-egui/src/layers.rs @@ -217,7 +217,7 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { // Pages are dragged up and down the list to reorder them. let mut reorder = crate::list_drag::ListDrag::in_order(ui, "pages"); // A long list scrolls in its own area, so the layers keep their room below it. - let max_h = (ui.available_height() * 0.4).max(3.0 * ROW); + let max_h = pages_list_height(app.ui.pages_height, ui.available_height()); let mut moved = egui::ScrollArea::vertical().id_salt("pages_list").max_height(max_h).show(ui, |ui| { for (k, (id, name, divider)) in pages.iter().cloned().enumerate() { let (r, resp) = ui.allocate_exact_size(vec2(w, 32.0), Sense::click_and_drag()); @@ -306,7 +306,54 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { { app.run("page.select", json!({"id": p})); } - crate::widgets::separator(ui); + pages_edge(app, ui, moved.inner_rect.height()); +} + +/// The pages list's height in a panel with `avail` below the Pages header: the height asked for +/// (by default 40% of it), at least three rows, and leaving the layers their header and three rows. +pub(crate) fn pages_list_height(asked: Option, avail: f32) -> f32 { + let least = 3.0 * ROW; + let most = (avail - 40.0 - 3.0 * ROW).max(least); + asked.filter(|h| h.is_finite()).unwrap_or(avail * 0.4).clamp(least, most) +} + +/// The line between the pages and the layers: dragging it sizes the pages list (`shown`: its +/// height now), a double-click puts back the default. The main window keeps it in the preferences. +fn pages_edge(app: &mut FigApp, ui: &mut Ui, shown: f32) { + let t = Tokens::get(ui.ctx()); + let w = ui.available_width(); + let (line, _) = ui.allocate_exact_size(vec2(w, 1.0), Sense::hover()); + let grab = ui.style().interaction.resize_grab_radius_side; + let id = Id::new("pages_edge"); + let resp = ui.interact(line.expand2(vec2(0.0, grab)), id, Sense::click_and_drag()); + let active = resp.hovered() || resp.dragged(); + if active { + ui.ctx().set_cursor_icon(egui::CursorIcon::ResizeVertical); + } + let (width, colour) = if active { (2.0, t.accent) } else { (1.0, t.border) }; + ui.painter().line_segment([line.left_center(), line.right_center()], Stroke::new(width, colour)); + let asked = if resp.double_clicked() { + Some(None) + } else if resp.dragged() { + // The edge stays under the pointer where it was grabbed. + if resp.drag_started() { + ui.data_mut(|d| d.insert_temp(id, shown)); + } + let from: f32 = ui.data(|d| d.get_temp(id)).unwrap_or(shown); + let moved = ui.input(|i| Some(i.pointer.latest_pos()?.y - i.pointer.press_origin()?.y)).unwrap_or(0.0); + Some(Some(from + moved)) + } else { + None + }; + if let Some(h) = asked + && h != app.ui.pages_height + { + app.ui.pages_height = h; + if app.windows.current == 0 { + app.session.prefs.pages_height = h; + app.panels_unsaved = true; + } + } } /// A page rename just asked for by a double click: its field takes the focus when drawn (temp data). diff --git a/crates/ui-egui/src/layers_behaviour_tests.rs b/crates/ui-egui/src/layers_behaviour_tests.rs index 43a8b76ea..14d625a71 100644 --- a/crates/ui-egui/src/layers_behaviour_tests.rs +++ b/crates/ui-egui/src/layers_behaviour_tests.rs @@ -331,3 +331,74 @@ fn double_clicking_a_page_renames_it_with_the_focus_in_the_screen_reader_tree() assert_eq!(u.app.ui.rename_page.as_ref().map(|r| r.0), Some(p1)); assert!(u.app.ui.last_error.is_none(), "{:?}", u.app.ui.last_error); } + +/// The y of the line between the pages and the layers, above the layers' row at `layer` (found by +/// the resize cursor it shows when hovered). +fn pages_edge_at(u: &mut Ui, layer: f32) -> f32 { + let hits: Vec = ((layer - 120.0) as i32..layer as i32) + .map(|y| y as f32) + .filter(|y| u.frame_output(vec![Event::PointerMoved(Pos2::new(150.0, *y))]).platform_output.cursor_icon == egui::CursorIcon::ResizeVertical) + .collect(); + assert!(!hits.is_empty(), "no edge above {layer}"); + (hits[0] + hits[hits.len() - 1]) / 2.0 +} + +#[test] +fn the_line_between_pages_and_layers_drags_to_size_the_pages_list() { + let mut s = Session::new(); + let rect = id(s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap()); + for _ in 0..59 { + s.execute("page.add", &json!({})).unwrap(); + } + let first = s.doc().unwrap().pages[0]; + s.execute("page.select", &json!({"id": first})).unwrap(); + s.execute("select.none", &json!({})).unwrap(); + let mut u = Ui::new(s); + let before = u.row_at(rect).y; + let edge = pages_edge_at(&mut u, before); + // A drag down by 150 px makes the pages list taller and moves the layers down with it. + let at = |dy: f32| Pos2::new(150.0, edge + dy); + let button = |p, pressed| Event::PointerButton { pos: p, button: egui::PointerButton::Primary, pressed, modifiers: Modifiers::NONE }; + u.frame(vec![Event::PointerMoved(at(0.0))]); + u.frame(vec![button(at(0.0), true)]); + for k in 1..=15 { + u.frame(vec![Event::PointerMoved(at(10.0 * k as f32))]); + } + u.frame(vec![button(at(150.0), false)]); + for _ in 0..30 { + u.frame(vec![]); + } + let after = u.row_at(rect).y; + assert!((after - before - 150.0).abs() < 3.0, "the layers moved from {before} to {after}"); + // The height is kept for the next start. + let kept = u.app.session.prefs.pages_height.expect("kept in the preferences"); + let mut next = Session::new(); + next.prefs = u.app.session.prefs.clone(); + assert_eq!(crate::FigApp::new(next, Box::new(crate::NoServices)).ui.pages_height, Some(kept)); + // A double-click puts back the default. + let edge = pages_edge_at(&mut u, after); + let p = Pos2::new(150.0, edge); + u.frame(vec![Event::PointerMoved(p)]); + for _ in 0..2 { + u.frame(vec![button(p, true)]); + u.frame(vec![button(p, false)]); + } + for _ in 0..30 { + u.frame(vec![]); + } + assert_eq!(u.app.session.prefs.pages_height, None); + assert!((u.row_at(rect).y - before).abs() < 3.0); +} + +#[test] +fn the_pages_list_keeps_three_rows_and_leaves_the_layers_room() { + use crate::layers::{ROW, pages_list_height}; + // The default: 40% of the panel. + assert_eq!(pages_list_height(None, 800.0), 320.0); + // Dragged short or tall, it stays within three rows and the room the layers need. + assert_eq!(pages_list_height(Some(0.0), 800.0), 3.0 * ROW); + assert_eq!(pages_list_height(Some(5000.0), 800.0), 800.0 - 40.0 - 3.0 * ROW); + assert_eq!(pages_list_height(Some(f32::NAN), 800.0), 320.0); + // A panel too short for both keeps the three rows. + assert_eq!(pages_list_height(Some(500.0), 100.0), 3.0 * ROW); +} diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 20a8a77c1..21f30f624 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -398,6 +398,8 @@ pub struct UiState { pub last_right_tab: RightTab, pub left_tab: LeftTab, pub pages_open: bool, + /// The height asked for the pages list (`None`: a share of the panel). + pub pages_height: Option, pub expanded: BTreeSet, /// The layer being renamed in the layers panel. pub rename: Option, @@ -528,6 +530,7 @@ impl Default for UiState { last_right_tab: RightTab::Design, left_tab: LeftTab::File, pages_open: true, + pages_height: None, expanded: BTreeSet::new(), rename: None, rename_page: None, @@ -646,8 +649,9 @@ impl FigApp { pub fn new(session: Session, services: Box) -> Self { // The main window's panels open as wide as they were left. let (left_width, right_width) = session.prefs.panel_widths; + let pages_height = session.prefs.pages_height; Self { - ui: UiState { left_width, right_width, ..UiState::default() }, + ui: UiState { left_width, right_width, pages_height, ..UiState::default() }, session, canvas: canvas::CanvasState::default(), services, diff --git a/crates/ui-egui/src/windows.rs b/crates/ui-egui/src/windows.rs index 510c24f69..b6a21cda9 100644 --- a/crates/ui-egui/src/windows.rs +++ b/crates/ui-egui/src/windows.rs @@ -208,13 +208,15 @@ pub fn open(app: &mut FigApp, ctx: &Context, index: Option, path: Option< docs: vec![uid], active: Some(uid), pane: Pane { - // A new window opens like the one it comes from: the same tabs and panel widths. + // A new window opens like the one it comes from: the same tabs, panel widths and pages + // list height. ui: UiState { title_bar: app.ui.title_bar, right_tab: app.ui.right_tab, left_tab: app.ui.left_tab, left_width: app.ui.left_width, right_width: app.ui.right_width, + pages_height: app.ui.pages_height, ..UiState::default() }, ..Pane::default() From a911ab9614c3bc01c19ad86035bd8872a7ffc9cf Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Fri, 16 Oct 2026 08:29:55 +0000 Subject: [PATCH 062/817] Reject negative or fractional index in fill.set and stroke.set Found while testing crates/engine/src/cmd/edit.rs:1180 Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/engine/src/cmd/edit.rs | 2 +- crates/engine/src/lib.rs | 2 ++ crates/engine/src/paint_index_tests.rs | 39 ++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 crates/engine/src/paint_index_tests.rs diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index 2c767b933..35930cb7c 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -1177,7 +1177,7 @@ fn paint_list(s: &mut Session, p: &Value, fills: bool, add: bool) -> Result Result { let cmd = if fills { "fill.set" } else { "stroke.set" }; let ids = req_targets(cmd, s, p)?; - let idx = num(p, "index").map(|x| x.max(0.0) as usize); + let idx = if get(p, "index").is_none() { None } else { Some(req_index(cmd, p, "index")?) }; let new_paint = match get(p, "paint") { Some(v) => Some(paint_of(v).ok_or_else(|| bad(cmd, "invalid paint"))?), None => None, diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 34653bd5f..a84ca21ba 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1594,6 +1594,8 @@ mod page_copy_navigation_tests; #[cfg(test)] mod page_target_tests; #[cfg(test)] +mod paint_index_tests; +#[cfg(test)] mod paint_reorder_tests; #[cfg(test)] mod paint_tests; diff --git a/crates/engine/src/paint_index_tests.rs b/crates/engine/src/paint_index_tests.rs new file mode 100644 index 000000000..eddea306d --- /dev/null +++ b/crates/engine/src/paint_index_tests.rs @@ -0,0 +1,39 @@ +//! `fill.set` / `stroke.set` reject a negative, fractional or non-finite `index` instead of +//! clamping or truncating it onto another paint (like `fill.remove` / `stroke.remove`). + +use figcraft_doc::NodeId; +use serde_json::{Value, json}; + +use crate::Session; + +fn ex(s: &mut Session, cmd: &str, p: Value) -> Value { + s.execute(cmd, &p).unwrap_or_else(|e| panic!("{cmd} {p}: {e}")) +} + +fn paints(s: &Session, id: NodeId) -> String { + let n = s.doc().unwrap().node(id).unwrap(); + format!("{:?} {:?}", n.fills, n.strokes) +} + +#[test] +fn paint_set_rejects_bad_index_and_leaves_the_paints_alone() { + let mut s = Session::new(); + let r = NodeId(ex(&mut s, "shape.rectangle", json!({"x": 0, "y": 0, "width": 10, "height": 10}))["id"].as_u64().unwrap()); + for add in ["fill.add", "stroke.add"] { + for c in ["#0000FF", "#FFFF00"] { + ex(&mut s, add, json!({"ids": [r], "color": c})); + } + } + let before = paints(&s, r); + for cmd in ["fill.set", "stroke.set"] { + for bad in [json!(-1), json!(0.5), json!(1.9), json!("-1"), json!("1.5"), json!("NaN"), json!("inf"), json!("abc")] { + let res = s.execute(cmd, &json!({"ids": [r], "index": bad, "color": "#FF0000"})); + assert!(res.is_err(), "{cmd} index {bad} was accepted: {res:?}"); + assert_eq!(paints(&s, r), before, "{cmd} index {bad} changed the document"); + } + ex(&mut s, cmd, json!({"ids": [r], "index": 1, "color": "#FF0000"})); + assert_ne!(paints(&s, r), before, "{cmd} with a valid index still edits"); + ex(&mut s, "edit.undo", json!({})); + assert_eq!(paints(&s, r), before); + } +} From 11455e0fe9f7f74a1411065ccab815293de149c0 Mon Sep 17 00:00:00 2001 From: loyet Date: Fri, 16 Oct 2026 10:44:29 +0200 Subject: [PATCH 063/817] M1: .fig import reads images carried in the message (image.dataBlob) Copies written by plugins and tools carry their image bytes in the message: a paint's image.dataBlob indexes the message's blobs. A bare canvas (what the clipboard holds, see #647) has no images/, so these fills came in as grey placeholders. The importer now falls back to the embedded bytes, keyed by image hash, after the archive's images/. Blobs over the image size cap and indexes past the blobs are skipped and stay placeholders. Tests: a bare canvas carrying its image in a blob, and a dataBlob past the blobs. --- crates/format/src/fig/mod.rs | 43 ++++++++++++++++++++++++++--- crates/format/src/fig/tests.rs | 49 +++++++++++++++++++++++++++++++++- docs/file-format-parity.md | 5 ++-- 3 files changed, 91 insertions(+), 6 deletions(-) diff --git a/crates/format/src/fig/mod.rs b/crates/format/src/fig/mod.rs index ec2a0e23a..091492da3 100644 --- a/crates/format/src/fig/mod.rs +++ b/crates/format/src/fig/mod.rs @@ -6,7 +6,8 @@ //! zstd: a binary schema in the kiwi format ([`kiwi`]), then a message encoded with it. Every file //! carries its own schema, so the message is decoded generically and read by field name: a list //! of node changes (each with its id, parent id and position among its siblings) that make up the -//! layer tree, plus blobs (vector outlines and editable vector networks, [`network`]). [`map`] +//! layer tree, plus blobs (vector outlines and editable vector networks, [`network`], and the bytes +//! of images that travel inside the message, [`embedded_images`]). [`map`] //! turns that into the REST API file JSON shape and the REST importer builds the document, so both //! imports share one mapping. Layer kinds the editor doesn't have (sticky notes, connectors, //! tables, …) come in as the closest frames, text and vectors. Anything not understood is skipped @@ -23,6 +24,7 @@ mod network; #[cfg(test)] mod tests; +use std::collections::BTreeMap; use std::io::Read; use figcraft_doc::Document; @@ -30,7 +32,7 @@ use figcraft_doc::Document; pub use export::export; use crate::FormatError; -use kiwi::Schema; +use kiwi::{Kv, Schema}; /// Largest `canvas.fig` member read, and largest decompressed chunk. const MAX_CANVAS: u64 = 256 * 1024 * 1024; @@ -63,7 +65,8 @@ pub fn import(bytes: &[u8], name: &str) -> Result<(Document, Vec), Forma let msg = schema.decode_message(root, &message).map_err(|e| corrupt(e.to_string()))?; let file_name = archive.file_name.as_deref().filter(|n| !n.trim().is_empty()).unwrap_or(name); let (json, mut warnings) = map::to_rest(&msg, file_name); - let images = |r: &str| archive.image(r); + let embedded = embedded_images(&msg); + let images = |r: &str| archive.image(r).or_else(|| embedded.get(r).cloned()); let (doc, more) = crate::rest::import(&json, &images)?; warnings.extend(more.into_iter().filter_map(map::adapt_warning)); Ok((doc, warnings)) @@ -94,6 +97,40 @@ fn corrupt(msg: impl Into) -> FormatError { FormatError::Corrupt(format!(".fig file: {}", msg.into())) } +/// Image bytes that travel inside the message, by image hash (lowercase hex): a paint's +/// `image.dataBlob` indexes the message's `blobs`. Copies written by plugins and other tools embed +/// their images this way, and a bare canvas (what the clipboard carries) has no `images/`. The +/// walk is iterative (no recursion on nested data) and skips blobs larger than [`MAX_IMAGE`]. +fn embedded_images(msg: &Kv) -> BTreeMap> { + let blobs = msg.get("blobs").map(Kv::list).unwrap_or_default(); + let mut found = BTreeMap::new(); + let mut pending = vec![msg]; + while let Some(value) = pending.pop() { + match value { + Kv::Object(fields) => { + if let Some((hash, bytes)) = value.get("image").and_then(|image| embedded_image(image, blobs)) { + found.entry(hash).or_insert_with(|| bytes.to_vec()); + } + pending.extend(fields.iter().filter(|(name, _)| *name != "blobs").map(|(_, field)| field)); + } + Kv::Array(items) => pending.extend(items), + _ => {} + } + } + found +} + +/// The hash and bytes of an `Image` value whose `dataBlob` points at a usable blob. +fn embedded_image<'k>(image: &Kv, blobs: &'k [Kv]) -> Option<(String, &'k [u8])> { + let hash = image.get("hash").and_then(Kv::bytes).filter(|h| !h.is_empty() && h.len() <= 64)?; + let Some(Kv::Uint(index)) = image.get("dataBlob") else { return None }; + let bytes = blobs.get(usize::try_from(*index).ok()?)?.get("bytes").and_then(Kv::bytes)?; + if bytes.is_empty() || bytes.len() as u64 > MAX_IMAGE { + return None; + } + Some((hash.iter().map(|b| format!("{b:02x}")).collect(), bytes)) +} + /// The parts of a `.fig` archive the import reads. struct Archive<'b> { canvas: Vec, diff --git a/crates/format/src/fig/tests.rs b/crates/format/src/fig/tests.rs index 19c4fc157..c8749513f 100644 --- a/crates/format/src/fig/tests.rs +++ b/crates/format/src/fig/tests.rs @@ -38,7 +38,7 @@ struct Color float r, float g, float b, float a struct Vector float x, float y struct Matrix float m00, float m01, float m02, float m10, float m11, float m12 struct ColorStop Color color, float position -message Image byte[] hash, string name +message Image byte[] hash, string name, uint dataBlob message AssetRef string key, string version message VariableID GUID guid, AssetRef assetRef message PropRefValue GUID defId @@ -539,6 +539,53 @@ fn bare_canvas_and_zlib_chunks_open() { assert!(import(&out, "Z").is_ok()); } +/// The fixture message with the photo's image bytes in its own blobs, as copies written by plugins +/// and tools carry them: the PNG goes at the end of `blobs` and `image.dataBlob` points `shift` +/// places past it (0 is the PNG itself). +fn message_with_image_in_blobs(shift: u64) -> Kv<'static> { + fn point_images_at(value: &mut Kv<'static>, blob: u64) { + match value { + Kv::Object(fields) => { + for (name, field) in fields.iter_mut() { + match field { + Kv::Object(image) if *name == "image" => image.push(("dataBlob", u(blob))), + _ => point_images_at(field, blob), + } + } + } + Kv::Array(items) => items.iter_mut().for_each(|item| point_images_at(item, blob)), + _ => {} + } + } + let mut msg = message(); + let index = { + let Kv::Object(fields) = &mut msg else { panic!("the message is an object") }; + let Some((_, Kv::Array(blobs))) = fields.iter_mut().find(|(name, _)| *name == "blobs") else { panic!("no blobs") }; + blobs.push(o(vec![("bytes", Kv::Bytes(png()))])); + blobs.len() as u64 - 1 + }; + point_images_at(&mut msg, index + shift); + msg +} + +#[test] +fn a_bare_canvas_reads_images_carried_in_its_blobs() { + // The clipboard holds a bare canvas (no `images/`); the image comes from `image.dataBlob`. + let c = canvas(&schema(), &message_with_image_in_blobs(0)); + let (doc, warnings) = import(&c, "Pasted").unwrap(); + let photo = named(&doc, "Photo"); + let figcraft_doc::color::PaintKind::Image(img) = &photo.fills[0].kind else { panic!("not an image fill") }; + assert_eq!(doc.images.get(&img.image).map(|i| (i.width, i.height)), Some((2, 1))); + assert!(!warnings.iter().any(|w| w.contains("isn't in the file")), "{warnings:?}"); +} + +#[test] +fn a_data_blob_past_the_blobs_stays_a_placeholder() { + let c = canvas(&schema(), &message_with_image_in_blobs(5)); + let (_, warnings) = import(&c, "Pasted").unwrap(); + assert!(warnings.iter().any(|w| w.contains("isn't in the file")), "{warnings:?}"); +} + #[test] fn other_files_are_not_fig() { assert!(try_import(b"{\"document\": {}}", "x").is_none()); diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index d8e517119..c9e5da2f4 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-14 · **Change:** minor (SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (`.fig` import: images carried in the message (`image.dataBlob`); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) Every format Figma reads or writes, with FigCraft's support. Sources: `Info.plist` of `/Applications/Figma.app` (document types only; nothing inside the bundle's code was read), Figma's @@ -17,7 +17,7 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| -| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Not read: connector labels, table cells beyond their own layers, filled areas with their own fills, per-point stroke joins, variables bound to fields the editor can't bind, fixed or content-sized grid tracks, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs`, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | +| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills (from the archive, or carried in the message itself as `image.dataBlob`, the way copies written by plugins and tools carry them) come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Not read: connector labels, table cells beyond their own layers, filled areas with their own fills, per-point stroke joins, variables bound to fields the editor can't bind, fixed or content-sized grid tracks, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs`, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | | REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout, constraints, grids, components, sets, instances with overrides, component properties, styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | @@ -162,6 +162,7 @@ each. | Date | Change | Summary | |---|---|---| +| 2026-10-16 | minor | `.fig` import: image fills whose bytes travel in the message itself (`image.dataBlob`, an index into the message's blobs) come across. Copies written by plugins and tools carry their images this way, and a bare canvas, the shape the clipboard holds, has no `images/`: they were grey placeholders. Blobs over the image size cap and indexes past the blobs are skipped (placeholder, as before). Checked on a bare canvas generated in code and on copies written by an HTML-to-Figma browser extension. Numbers unchanged | | 2026-10-14 | minor | SVG/PDF depth overflow (#208) is checked before bounds and drawing; public checked APIs return the offending root/layer, commands and CLI report it, and no incomplete export replaces an existing file. Tested at depths 255/256/257, with inner roots, hidden branches, masks, raster fallbacks and multiple roots/pages. Numbers unchanged. | | 2026-10-13 | minor | `.fig` export (gap 1): instances write what they change from their main as an override addressed by the main's id (their size, name and paints were lost elsewhere without it), what follows for their layers as derived data, and a scale factor when scaled as a whole; layers of a nested instance swapped for another component keep their overrides; variable collections, modes, variables and their bindings, the modes frames and pages set, shared styles with their links and variable-width strokes are written, and the import reads all of it back (style definitions and unused styles, variable order and scopes, bindings on paint lists, gradient stops, effects and layout grids, page modes, text field bindings, which a `.fig` import used to drop, and width profiles). Opened `.fig` and file JSON documents link nested instances of variants (and any nested instance under a name of its own) to their main's layers; they stayed unlinked, so a second export lost what they changed. Checked by opening written files in other software: resized and scaled instances keep their size and lay their layers out for it, variables with their modes and colour bindings resolve there (a frame set to another mode shows that mode's colours, also inside instances), colour, text, effect and grid styles are listed, and variable-width strokes that are the same on both sides of the path draw with their width; number, string and boolean bindings and bindings on effects, layout guides and gradient stops come across as the values they give but did not show as bound there (their entries now also name the layer field they set, not yet checked there), and strokes wider on one side of the path are written as filled outlines, no longer editable strokes there (the stroke itself is kept as plugin data and our own import puts it back; not yet checked there). Numbers unchanged | | 2026-10-12 | minor | `.fig` export made to open elsewhere (gap 1): the document and its pages say they are visible and opaque (left out, nothing was drawn), the schema in the file uses the format's own names, kinds, field ids and enum values, rectangles are rounded rectangles with four radii, frames and shapes carry their fill outline and plain strokes their stroke outline, text carries its layout settings, font styles use their standard names, line heights that are a share of the font size are raw multipliers, masks keep their type (read back too); the import reads per-side stroke weights whose zero sides are left out. Written files were checked by opening them in other software: layers, fills, gradients, strokes, shadows, vectors, components and text draw as in FigCraft; effects such as glass and noise, images and prototype interactions are still unchecked there, and variables are not written. Numbers unchanged | From b962603707a78e61cd457b15c93c53effe81909b Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Fri, 16 Oct 2026 10:46:36 +0200 Subject: [PATCH 064/817] M4: points dropped on a point merge In vector edit mode a point dragged onto another point of its path snapped there but stayed a separate point, so a path couldn't be closed or joined by dragging. A single dragged point dropped within the point hit radius (6 px) of another point now merges into it, in the same undo step as the move, and that point stays selected. Closes #401 --- ROADMAP.md | 4 ++- crates/engine/src/vectoredit/pointer.rs | 37 ++++++++++++++++++++++++- crates/engine/src/vectoredit/tests.rs | 22 +++++++++++++++ docs/roadmap.md | 3 +- 4 files changed, 63 insertions(+), 3 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index c3c12085e..129c44bb1 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (points dropped on a point merge (#401); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -131,6 +131,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). ## Progress log +- **2026-10-16** · Points dropped on a point merge (M4, #401): in vector edit mode a point dragged onto another point of its path snapped there but stayed a separate point, so the path couldn't be closed or joined by dragging. Dropped within the point hit radius (6 px) of another point, a single dragged point now merges into it in the same undo step as the move, and that point stays selected; an open path's end dropped on its start closes it. Join (Cmd+J) still merges selected points that overlap. Regression test in the vector edit tests. Numbers unchanged. - **2026-10-14** · Corner handles win over the corner-radius handles (M1, #292): a press on the inner half of a corner handle's square picked the radius handle 10 px in, so the drag neither resized nor (dragging outward) rounded anything. Inside the drawn square the corner now resizes both sides (in ratio with Shift or the link); further in the radius handle still answers. Regression test in the transform behaviour suite. Numbers unchanged. - **2026-10-14** · Home screen recent files as cards (M7): each card shows the picture its file carries on its first page's colour, the file's icon, name and "Edited ... ago"; sort by name, creation or last change either way; a table view; a click selects, a double-click or Enter opens, arrow keys move; Open, Show in folder and Remove from recents on right-click. Numbers unchanged. - **2026-10-13** · Vector edit mode regions (M4): with the Move tool, the filled area under the pointer is hatched with "/" lines in the selection colour, clipped by the area's own fill rule so holes stay clear; the hatch goes near points (3.5 px) and segments (2 px), and its spacing follows octave folding (8 px at every power-of-two zoom), fixed to the shape. A click selects the area with its points (they move with it but keep the unselected look), Shift adds or removes one, a press on a selected area drags the whole selection as one undo step, and a click on an empty spot clears the areas and stays in edit mode. `vector.edit.select {regions}` and `vector.edit.state` (`regions`, `regionVertices`, `regionHover`); `vector_regions_tests` and `regions_tests`. Numbers unchanged. @@ -313,6 +314,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-16 | minor | Points dropped on a point merge (M4, #401): in vector edit mode a point dragged onto another point of its path snapped there but stayed a separate point, so the path couldn't be closed or joined by dragging. Dropped within the point hit radius (6 px) of another point, a single dragged point now merges into it in the same undo step as the move, and that point stays selected; an open path's end dropped on its start closes it. Join (Cmd+J) still merges selected points that overlap. Regression test in the vector edit tests. Numbers unchanged | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | | 2026-10-15 | minor | Drop files anywhere to open them (M7): dragging files over the window shows a "Drop to open" (home) or "Drop to import" (canvas) overlay. On the home screen each supported file opens as a document of its own and other files are turned away with a toast; on the canvas the files import at the drop point. Both wait behind a small card that is on screen before a large file blocks the window. A canvas import stays with the document and page that received the drop even if the tab or page changes meanwhile, and is cancelled with a message if that document or page is gone. Numbers unchanged. | | 2026-10-15 | minor | M7: system font discovery skips entries observed as non-regular files before opening them, avoiding the reproduced named-pipe stall. Regular-file symlinks remain supported; directory depth, font limits and priorities are unchanged. Numbers unchanged. | diff --git a/crates/engine/src/vectoredit/pointer.rs b/crates/engine/src/vectoredit/pointer.rs index 388fe245e..a42b06038 100644 --- a/crates/engine/src/vectoredit/pointer.rs +++ b/crates/engine/src/vectoredit/pointer.rs @@ -996,8 +996,13 @@ impl Session { self.tool.overlay.guides.clear(); let Gesture::Vector(g) = g else { return Ok(()) }; match g { - VGesture::Points { moved, split, click_clears, .. } => { + VGesture::Points { verts, others, moved, split, click_clears, .. } => { if moved || split.is_some() { + if let ([v], None) = (verts.as_slice(), split) + && others.iter().all(|(_, o)| o.is_empty()) + { + self.merge_dropped_point(ve.id, *v, 6.0 / ev.zoom.max(1e-6))?; + } self.commit_interaction()?; } else { self.cancel_interaction()?; @@ -1057,4 +1062,34 @@ impl Session { } Ok(()) } + + /// Point `v` of vector `id`, dragged and dropped within `tol` (page units) of another of its + /// points, merges into that point (in the same undo step as the move), which stays selected. + fn merge_dropped_point(&mut self, id: NodeId, v: usize, tol: f64) -> Result<()> { + let moved = self.ds()?.doc.get(id)?.clone(); + let w = self.ds()?.doc.world_transform(id); + let NodeKind::Vector { network: net } = &moved.kind else { return Ok(()) }; + let Some(p) = net.vertices.get(v).map(|x| w * x.point()) else { return Ok(()) }; + let Some(keep) = net + .vertices + .iter() + .enumerate() + .filter(|(i, _)| *i != v) + .map(|(i, x)| (i, (w * x.point() - p).hypot())) + .filter(|(_, d)| *d <= tol) + .min_by(|a, b| a.1.total_cmp(&b.1)) + .map(|(i, _)| i) + else { + return Ok(()); + }; + // The preview starts again from the document before the drag: bring the moved layer. + self.preview(|doc, _| { + *doc.get_mut(id)? = moved; + edit(doc, id, |net| ops::merge_vertices(net, keep, v)) + })?; + set_state(self, |e| { + e.vertices = vec![if keep > v { keep - 1 } else { keep }]; + e.segments.clear(); + }) + } } diff --git a/crates/engine/src/vectoredit/tests.rs b/crates/engine/src/vectoredit/tests.rs index ae7ac27ec..63469d673 100644 --- a/crates/engine/src/vectoredit/tests.rs +++ b/crates/engine/src/vectoredit/tests.rs @@ -280,6 +280,28 @@ fn mirroring_position_and_join_commands() { assert!(s.execute("vector.join", &json!({"ids": [id]})).is_ok()); } +#[test] +fn a_point_dropped_on_another_merges_into_it() { + // #401: an open path's end dragged onto its start closes the path at that point. + let mut s = Session::new(); + let r = ex(&mut s, "vector.create", json!({"points": [[0, 0], [100, 0], [100, 100], [0, 100]]})); + let id = crate::params::id_of(&r["id"]).unwrap(); + ex(&mut s, "vector.edit.begin", json!({"id": id})); + drag(&mut s, (0.0, 100.0), (2.0, 3.0)); + let n = net(&s, id); + assert_eq!(n.vertices.len(), 3, "the dropped point merged"); + assert!((0..3).all(|v| n.incident(v).len() == 2), "a closed path: {n:?}"); + assert_eq!(ve(&s).vertices, vec![vertex_at(&n, 0.0, 0.0)], "the point it merged into stays selected"); + s.undo().unwrap(); + let n = net(&s, id); + assert_eq!(n.vertices.len(), 4, "one undo step takes back the move and the merge"); + vertex_at(&n, 0.0, 100.0); + // A drop away from every point only moves it. + ex(&mut s, "vector.edit.select", json!({"vertices": []})); + drag(&mut s, (0.0, 100.0), (0.0, 50.0)); + assert_eq!(net(&s, id).vertices.len(), 4); +} + #[test] fn undo_back_past_the_conversion_leaves_edit_mode() { let mut s = Session::new(); diff --git a/docs/roadmap.md b/docs/roadmap.md index 9e9eaec9f..680c5b68d 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # FigCraft roadmap: milestones and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (community fixes from #478 up and a control-channel fix (#589); recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading, SVG import budgets, Leptos code, full screen, server snapshots, owner-only preferences, ruzstd 0.9.1, layer cycle repair, batch rollback, Direct3D 12 on Windows, plugin metering; vector edit mode regions: hover hatch, selection and drag; repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` import, best effort; 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 ~79%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (points dropped on a point merge (#401); community fixes from #478 up and a control-channel fix (#589); recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading, SVG import budgets, Leptos code, full screen, server snapshots, owner-only preferences, ruzstd 0.9.1, layer cycle repair, batch rollback, Direct3D 12 on Windows, plugin metering; vector edit mode regions: hover hatch, selection and drag; repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` import, best effort; 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 ~79%) · **Target:** Figma Design (desktop app 126.10.7) Forward-looking plan. Where FigCraft stands today: [`ROADMAP.md`](../ROADMAP.md) and [`target-app-parity.md`](target-app-parity.md); the full ranked list: [`gaps.md`](gaps.md). Hours @@ -73,6 +73,7 @@ blockers. | Date | Change | Summary | |---|---|---| +| 2026-10-16 | minor | Points dropped on a point merge (M4, #401): in vector edit mode a point dragged onto another point of its path snapped there but stayed a separate point, so the path couldn't be closed or joined by dragging. Dropped within the point hit radius (6 px) of another point, a single dragged point now merges into it in the same undo step as the move, and that point stays selected; an open path's end dropped on its start closes it. Join (Cmd+J) still merges selected points that overlap. Regression test in the vector edit tests. Numbers unchanged | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | | 2026-10-14 | minor | M7: the Small caps button in Type settings showed a box where the UI font has no small-capital `ɢ` (builds without Inter use egui's fonts); its sample is now a capital and a smaller capital, drawn from ordinary letters every UI font has. Numbers unchanged | | 2026-10-14 | minor | M7: Home screen recent files as cards: each card shows the picture its file carries on its first page's colour, the file's icon, name and "Edited ... ago"; sort by name, creation or last change either way; a table view; a click selects, a double-click or Enter opens, arrow keys move; Open, Show in folder and Remove from recents on right-click. Numbers unchanged. | From 66dd31ad9fb5b600959b32aa364e05552a4307ca Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Fri, 16 Oct 2026 11:07:33 +0200 Subject: [PATCH 065/817] M7: find fonts activated through Adobe Fonts on macOS Fonts activated through Adobe Fonts rendered in the fallback font without a warning: Creative Cloud keeps them in its own folder as hidden files named by number, which the font scan never read. The macOS scan now includes ~/Library/Application Support/Adobe/CoreSync/plugins/livetype, and files without an extension are indexed when they start with a font signature. Fonts are read in place. Closes #298 --- ROADMAP.md | 4 +++- crates/text/src/fontdb.rs | 16 ++++++++++++++-- crates/text/src/fontdb_tests.rs | 29 +++++++++++++++++++++++++++++ docs/cli.md | 4 ++++ docs/roadmap.md | 3 ++- 5 files changed, 52 insertions(+), 4 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index c3c12085e..d6159904e 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (Adobe Fonts found on macOS (#298); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -131,6 +131,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). ## Progress log +- **2026-10-16** · Adobe Fonts found on macOS (M7, #298): fonts activated through Adobe Fonts rendered in the fallback font without a warning, because Creative Cloud keeps them in its own folder as hidden files named by number, which the font scan never read. The macOS scan now includes `~/Library/Application Support/Adobe/CoreSync/plugins/livetype`, and files without an extension are indexed when they start with a font signature. Fonts are read in place. Regression test in the font database tests; docs/cli.md lists the folder. Numbers unchanged. - **2026-10-14** · Corner handles win over the corner-radius handles (M1, #292): a press on the inner half of a corner handle's square picked the radius handle 10 px in, so the drag neither resized nor (dragging outward) rounded anything. Inside the drawn square the corner now resizes both sides (in ratio with Shift or the link); further in the radius handle still answers. Regression test in the transform behaviour suite. Numbers unchanged. - **2026-10-14** · Home screen recent files as cards (M7): each card shows the picture its file carries on its first page's colour, the file's icon, name and "Edited ... ago"; sort by name, creation or last change either way; a table view; a click selects, a double-click or Enter opens, arrow keys move; Open, Show in folder and Remove from recents on right-click. Numbers unchanged. - **2026-10-13** · Vector edit mode regions (M4): with the Move tool, the filled area under the pointer is hatched with "/" lines in the selection colour, clipped by the area's own fill rule so holes stay clear; the hatch goes near points (3.5 px) and segments (2 px), and its spacing follows octave folding (8 px at every power-of-two zoom), fixed to the shape. A click selects the area with its points (they move with it but keep the unselected look), Shift adds or removes one, a press on a selected area drags the whole selection as one undo step, and a click on an empty spot clears the areas and stays in edit mode. `vector.edit.select {regions}` and `vector.edit.state` (`regions`, `regionVertices`, `regionHover`); `vector_regions_tests` and `regions_tests`. Numbers unchanged. @@ -313,6 +314,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-16 | minor | Adobe Fonts found on macOS (M7, #298): fonts activated through Adobe Fonts rendered in the fallback font without a warning, because Creative Cloud keeps them in its own folder as hidden files named by number, which the font scan never read. The macOS scan now includes `~/Library/Application Support/Adobe/CoreSync/plugins/livetype`, and files without an extension are indexed when they start with a font signature. Fonts are read in place. Regression test in the font database tests; docs/cli.md lists the folder. Numbers unchanged | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | | 2026-10-15 | minor | Drop files anywhere to open them (M7): dragging files over the window shows a "Drop to open" (home) or "Drop to import" (canvas) overlay. On the home screen each supported file opens as a document of its own and other files are turned away with a toast; on the canvas the files import at the drop point. Both wait behind a small card that is on screen before a large file blocks the window. A canvas import stays with the document and page that received the drop even if the tab or page changes meanwhile, and is cancelled with a message if that document or page is gone. Numbers unchanged. | | 2026-10-15 | minor | M7: system font discovery skips entries observed as non-regular files before opening them, avoiding the reproduced named-pipe stall. Regular-file symlinks remain supported; directory depth, font limits and priorities are unchanged. Numbers unchanged. | diff --git a/crates/text/src/fontdb.rs b/crates/text/src/fontdb.rs index d5ff41907..34d4775ea 100644 --- a/crates/text/src/fontdb.rs +++ b/crates/text/src/fontdb.rs @@ -694,7 +694,11 @@ fn system_font_dirs() -> Vec { v.push("/System/Library/Fonts".into()); v.push("/Library/Fonts".into()); if let Some(h) = std::env::var_os("HOME") { - v.push(std::path::PathBuf::from(h).join("Library/Fonts")); + let h = std::path::PathBuf::from(h); + v.push(h.join("Library/Fonts")); + // Adobe Fonts activates its fonts from here (hidden files named by number), without + // installing them into a font folder. + v.push(h.join("Library/Application Support/Adobe/CoreSync/plugins/livetype")); } } #[cfg(target_os = "windows")] @@ -753,7 +757,7 @@ fn scan_dir(dir: &std::path::Path, depth: usize, out: &mut BTreeMap bool { + use std::io::Read; + let mut magic = [0u8; 4]; + std::fs::File::open(path).and_then(|mut f| f.read_exact(&mut magic)).is_ok() && matches!(&magic, &[0, 1, 0, 0] | b"OTTO" | b"true" | b"ttcf") +} + /// The parts of a font file the scan reads: headers, table directories and `name` tables, at their /// offsets in a zeroed buffer of the file's length (reading whole files was most of the scan). fn index_bytes(path: &std::path::Path, len: usize) -> Option> { diff --git a/crates/text/src/fontdb_tests.rs b/crates/text/src/fontdb_tests.rs index ea762be6f..636309d30 100644 --- a/crates/text/src/fontdb_tests.rs +++ b/crates/text/src/fontdb_tests.rs @@ -179,3 +179,32 @@ fn user_font_dirs_preserve_non_utf8_paths() { assert_eq!(dirs[0].as_os_str().as_bytes(), b"/home/\xff/.fonts"); assert_eq!(dirs[1].as_os_str().as_bytes(), b"/data/\xfe/fonts"); } + +#[test] +fn the_scan_reads_font_files_without_an_extension() { + // #298: Adobe Fonts keeps the fonts it activates in hidden files named by number. Any installed + // font stands in for one (none on CI); a file that isn't a font is left alone. + let Some(font) = system_font_dirs().into_iter().find_map(|d| { + std::fs::read_dir(d) + .ok()? + .flatten() + .map(|e| e.path()) + .find(|p| p.extension().is_some_and(|x| x.eq_ignore_ascii_case("ttf") || x.eq_ignore_ascii_case("otf"))) + }) else { + eprintln!("skipping: no installed font to stand in for an activated one"); + return; + }; + let dir = std::env::temp_dir().join(format!("figcraft-font-bare-{}", std::process::id())); + std::fs::create_dir_all(dir.join(".r")).unwrap(); + std::fs::copy(&font, dir.join(".r/.12345")).unwrap(); + std::fs::write(dir.join(".r/entitlements"), b"").unwrap(); + let mut found = BTreeMap::new(); + scan_dir(&dir, 0, &mut found); + let _ = std::fs::remove_dir_all(&dir); + let families: Vec<&String> = found.values().map(|(f, _)| f).collect(); + assert_eq!(found.values().map(|(_, v)| v.len()).sum::(), faces_in(&std::fs::read(&font).unwrap()).len(), "{families:?}"); + assert!(!families.is_empty(), "{} is read as a font", font.display()); + assert!(found.values().flat_map(|(_, v)| v).all(|p| p.path.ends_with(".r/.12345"))); + #[cfg(target_os = "macos")] + assert!(system_font_dirs().iter().any(|d| d.ends_with("Adobe/CoreSync/plugins/livetype")), "Adobe Fonts' folder is scanned"); +} diff --git a/docs/cli.md b/docs/cli.md index 9f5df40ef..ccd2bb772 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -19,6 +19,10 @@ On Linux and other Unix systems except macOS, user fonts are read from `$XDG_DATA_HOME/fonts`, or `$HOME/.local/share/fonts` when `XDG_DATA_HOME` is unset, empty or relative. The legacy `$HOME/.fonts` directory is also scanned. +On macOS, fonts activated through Adobe Fonts are read where Creative Cloud keeps them +(`~/Library/Application Support/Adobe/CoreSync/plugins/livetype`), so they're available while +they're active there. Files without an extension are read when they start like a font file. + The collaboration server is a binary of its own, `figcraft-server` (`cargo build --release -p figcraft-server`): it keeps files with share links and serves their live sessions, and its `key`, `files`, `links`, `reports`, `block-ip` and `check` subcommands manage them (a server can diff --git a/docs/roadmap.md b/docs/roadmap.md index 9e9eaec9f..de8c7ff1f 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # FigCraft roadmap: milestones and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (community fixes from #478 up and a control-channel fix (#589); recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading, SVG import budgets, Leptos code, full screen, server snapshots, owner-only preferences, ruzstd 0.9.1, layer cycle repair, batch rollback, Direct3D 12 on Windows, plugin metering; vector edit mode regions: hover hatch, selection and drag; repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` import, best effort; 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 ~79%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (Adobe Fonts found on macOS (#298); community fixes from #478 up and a control-channel fix (#589); recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading, SVG import budgets, Leptos code, full screen, server snapshots, owner-only preferences, ruzstd 0.9.1, layer cycle repair, batch rollback, Direct3D 12 on Windows, plugin metering; vector edit mode regions: hover hatch, selection and drag; repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` import, best effort; 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 ~79%) · **Target:** Figma Design (desktop app 126.10.7) Forward-looking plan. Where FigCraft stands today: [`ROADMAP.md`](../ROADMAP.md) and [`target-app-parity.md`](target-app-parity.md); the full ranked list: [`gaps.md`](gaps.md). Hours @@ -73,6 +73,7 @@ blockers. | Date | Change | Summary | |---|---|---| +| 2026-10-16 | minor | Adobe Fonts found on macOS (M7, #298): fonts activated through Adobe Fonts rendered in the fallback font without a warning, because Creative Cloud keeps them in its own folder as hidden files named by number, which the font scan never read. The macOS scan now includes `~/Library/Application Support/Adobe/CoreSync/plugins/livetype`, and files without an extension are indexed when they start with a font signature. Fonts are read in place. Regression test in the font database tests; docs/cli.md lists the folder. Numbers unchanged | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | | 2026-10-14 | minor | M7: the Small caps button in Type settings showed a box where the UI font has no small-capital `ɢ` (builds without Inter use egui's fonts); its sample is now a capital and a smaller capital, drawn from ordinary letters every UI font has. Numbers unchanged | | 2026-10-14 | minor | M7: Home screen recent files as cards: each card shows the picture its file carries on its first page's colour, the file's icon, name and "Edited ... ago"; sort by name, creation or last change either way; a table view; a click selects, a double-click or Enter opens, arrow keys move; Open, Show in folder and Remove from recents on right-click. Numbers unchanged. | From 6d3e7aad20d91f63aab90fa9b94ae0332da5f730 Mon Sep 17 00:00:00 2001 From: Yarila Date: Fri, 16 Oct 2026 00:03:58 +0500 Subject: [PATCH 066/817] M7: isolate presenter tab and device controls --- ATTRIBUTION.md | 2 + ROADMAP.md | 3 +- crates/doc/src/proto.rs | 93 +++++++++++- crates/ui-egui/locales/en.toml | 6 +- crates/ui-egui/locales/es.toml | 4 + crates/ui-egui/src/comments_tests.rs | 2 +- crates/ui-egui/src/lib.rs | 14 +- crates/ui-egui/src/present.rs | 146 ++++++++++++++++++- crates/ui-egui/src/present_view_tests.rs | 32 +++- crates/ui-egui/src/proto_responsive_tests.rs | 4 +- crates/ui-egui/src/tabs.rs | 65 ++++++++- docs/gaps.md | 6 +- docs/images/shot-8-presenter-tab.png | Bin 0 -> 75341 bytes docs/images/shot-9-device-picker.png | Bin 0 -> 106019 bytes 14 files changed, 352 insertions(+), 25 deletions(-) create mode 100644 docs/images/shot-8-presenter-tab.png create mode 100644 docs/images/shot-9-device-picker.png diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md index 1f72aeb7c..cf2e7e632 100644 --- a/ATTRIBUTION.md +++ b/ATTRIBUTION.md @@ -14,6 +14,8 @@ MIT OR Apache-2.0. No third-party icon sets are used. | `assets/app-icon/` (all files: `figcraft.svg`, `figcraft-small.svg`, `figcraft-*.png`, `figcraft.ico`, `hicolor/`) | The project owner (engraving-style drawing, vectorised) | Original work, see [`assets/app-icon/README.md`](assets/app-icon/README.md); derived files rendered by `cargo xtask icon` | MIT OR Apache-2.0, [`assets/app-icon/LICENSE.txt`](assets/app-icon/LICENSE.txt) | FigCraft app icon (chameleon) | | `docs/brand/artcraft-logo.svg`, `docs/brand/artcraft-logo.png`, `docs/brand/artcraft-logo-white.svg`, `docs/brand/artcraft-logo-white.png`, `docs/brand/artcraft-mark.svg`, `docs/brand/artcraft-mark.png`, `docs/brand/artcraft-mark-black.svg`, `docs/brand/artcraft-mark-black.png` | ArtCraft Team | storytold/craftrules `assets/brand/` | ArtCraft brand terms (`docs/brand/LICENSE-brand.txt`), not open source | Trademarks; unmodified use within FigCraft only | | `docs/images/` (all screenshots and exports: `shot-*.png`, `art-*.png`) | FigCraft contributors | Screenshots of FigCraft showing synthetic demo documents made in FigCraft, and PNG exports of those documents by FigCraft's renderer | MIT OR Apache-2.0 | No third-party artwork | +| `docs/images/shot-8-presenter-tab.png` | @YarilaFox | Original screenshot of FigCraft presenting a synthetic document made in FigCraft | MIT OR Apache-2.0 | Presenter tab and top bar; no third-party artwork | +| `docs/images/shot-9-device-picker.png` | @YarilaFox | Original screenshot of FigCraft presenting a synthetic document made in FigCraft | MIT OR Apache-2.0 | Device and scale controls; no third-party artwork | | `examples/*.figcraft` | FigCraft contributors | Synthetic demo documents built through FigCraft's command API; invented copy, shapes and vectors drawn from scratch, no images or embedded fonts | MIT OR Apache-2.0 | Text uses Inter (OFL, from craft-fonts or the system); no third-party artwork | ## Fonts (build input, not in this repository) diff --git a/ROADMAP.md b/ROADMAP.md index c3c12085e..254395172 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (presenter tab, device picker and thumbnail; bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -313,6 +313,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-15 | minor | Presenter has a separate tab, keeps its current screen when returning to design, and adds a frame thumbnail, device picker and scale controls. Numbers unchanged. | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | | 2026-10-15 | minor | Drop files anywhere to open them (M7): dragging files over the window shows a "Drop to open" (home) or "Drop to import" (canvas) overlay. On the home screen each supported file opens as a document of its own and other files are turned away with a toast; on the canvas the files import at the drop point. Both wait behind a small card that is on screen before a large file blocks the window. A canvas import stays with the document and page that received the drop even if the tab or page changes meanwhile, and is cancelled with a message if that document or page is gone. Numbers unchanged. | | 2026-10-15 | minor | M7: system font discovery skips entries observed as non-regular files before opening them, avoiding the reproduced named-pipe stall. Regular-file symlinks remain supported; directory depth, font limits and priorities are unchanged. Numbers unchanged. | diff --git a/crates/doc/src/proto.rs b/crates/doc/src/proto.rs index 91d2e8eb8..a844774c5 100644 --- a/crates/doc/src/proto.rs +++ b/crates/doc/src/proto.rs @@ -860,7 +860,35 @@ pub struct Device { impl PrototypeSettings { /// The devices to pick from ("None" presents the frame at its own size). - pub const DEVICES: [Device; 6] = [ + pub const DEVICES: [Device; 19] = [ + Device { + name: "iPhone 17", + width: 402.0, + height: 874.0, + rotates: true, + colors: &[c("Black", 0x38, 0x39, 0x3D), c("White", 0xE9, 0xE9, 0xE5)], + }, + Device { + name: "iPhone 17 Pro", + width: 402.0, + height: 874.0, + rotates: true, + colors: &[c("Black", 0x38, 0x39, 0x3D), c("Silver", 0xD7, 0xD7, 0xD5)], + }, + Device { + name: "iPhone 17 Pro Max", + width: 440.0, + height: 956.0, + rotates: true, + colors: &[c("Black", 0x38, 0x39, 0x3D), c("Silver", 0xD7, 0xD7, 0xD5)], + }, + Device { + name: "iPhone Air", + width: 420.0, + height: 912.0, + rotates: true, + colors: &[c("Black", 0x38, 0x39, 0x3D), c("Silver", 0xD7, 0xD7, 0xD5)], + }, Device { name: "iPhone 16", width: 393.0, @@ -874,6 +902,13 @@ impl PrototypeSettings { c("Blue", 0x72, 0x84, 0xD4), ], }, + Device { + name: "iPhone 16 Pro", + width: 402.0, + height: 874.0, + rotates: true, + colors: &[c("Black", 0x3B, 0x3A, 0x38), c("White", 0xEC, 0xEB, 0xE6)], + }, Device { name: "iPhone 16 Pro Max", width: 440.0, @@ -881,6 +916,55 @@ impl PrototypeSettings { rotates: true, colors: &[c("Black", 0x3B, 0x3A, 0x38), c("White", 0xEC, 0xEB, 0xE6), c("Natural", 0xBF, 0xB9, 0xAF), c("Sand", 0xC6, 0xAC, 0x8F)], }, + Device { + name: "iPhone 16 Plus", + width: 430.0, + height: 932.0, + rotates: true, + colors: &[c("Black", 0x3A, 0x3B, 0x3F), c("White", 0xEE, 0xED, 0xE8)], + }, + Device { + name: "iPhone 15 Pro", + width: 393.0, + height: 852.0, + rotates: true, + colors: &[c("Black", 0x3B, 0x3A, 0x38), c("Silver", 0xD7, 0xD7, 0xD5)], + }, + Device { + name: "iPhone 15 Pro Max", + width: 430.0, + height: 932.0, + rotates: true, + colors: &[c("Black", 0x3B, 0x3A, 0x38), c("Silver", 0xD7, 0xD7, 0xD5)], + }, + Device { + name: "iPhone 15 Plus", + width: 430.0, + height: 932.0, + rotates: true, + colors: &[c("Black", 0x3A, 0x3B, 0x3F), c("White", 0xEE, 0xED, 0xE8)], + }, + Device { + name: "iPhone 14 Pro", + width: 393.0, + height: 852.0, + rotates: true, + colors: &[c("Black", 0x3B, 0x3A, 0x38), c("Silver", 0xD7, 0xD7, 0xD5)], + }, + Device { + name: "iPhone 14 Pro Max", + width: 430.0, + height: 932.0, + rotates: true, + colors: &[c("Black", 0x3B, 0x3A, 0x38), c("Silver", 0xD7, 0xD7, 0xD5)], + }, + Device { + name: "iPhone 14", + width: 390.0, + height: 844.0, + rotates: true, + colors: &[c("Black", 0x3A, 0x3B, 0x3F), c("White", 0xEE, 0xED, 0xE8)], + }, Device { name: "Android Compact", width: 412.0, @@ -888,6 +972,13 @@ impl PrototypeSettings { rotates: true, colors: &[c("Black", 0x2E, 0x2F, 0x33), c("Silver", 0xD6, 0xD8, 0xDB), c("Green", 0xA6, 0xC0, 0xA3)], }, + Device { + name: "Android Medium", + width: 700.0, + height: 840.0, + rotates: true, + colors: &[c("Black", 0x2E, 0x2F, 0x33), c("Silver", 0xD6, 0xD8, 0xDB)], + }, Device { name: "iPad mini", width: 744.0, diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 3c127fc65..961b3c707 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -337,6 +337,7 @@ name = "English" "Current version" = "Current version" "Cursor chat" = "Cursor chat" "Custom" = "Custom" +"Custom size" = "Custom size" "Cut" = "Cut" "Dark" = "Dark" "Darken" = "Darken" @@ -801,6 +802,7 @@ name = "English" "New design file" = "New design file" "Newest first" = "Newest first" "Next or previous control in the focused region" = "Next or previous control in the focused region" +"Next frame" = "Next frame" "Next ready for dev" = "Next ready for dev" "Next size option" = "Next size option" "No assets: no export settings, icons or images. Add export settings in the Design tab." = "No assets: no export settings, icons or images. Add export settings in the Design tab." @@ -815,6 +817,7 @@ name = "English" "No components yet. Select layers and press {keys}." = "No components yet. Select layers and press {keys}." "No conflicts." = "No conflicts." "No contributor data was built into this copy." = "No contributor data was built into this copy." +"No device" = "No device" "No fonts match" = "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 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 layer changes to show." @@ -996,6 +999,7 @@ name = "English" "Preview" = "Preview" "Preview this flow" = "Preview this flow" "Preview this frame" = "Preview this frame" +"Previous frame" = "Previous frame" "Previous ready for dev" = "Previous ready for dev" "Progressive" = "Progressive" "Properties" = "Properties" @@ -1603,4 +1607,4 @@ name = "English" "⌘ arrows" = "⌘ arrows" "⌘ click" = "⌘ click" "⌘ scroll" = "⌘ scroll" -"⌥ drag" = "⌥ drag" \ No newline at end of file +"⌥ drag" = "⌥ drag" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 901283f11..557add9b8 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -338,6 +338,7 @@ status = "draft — needs native review" "Current version" = "Versión actual" "Cursor chat" = "Chat del cursor" "Custom" = "Personalizado" +"Custom size" = "Tamaño personalizado" "Cut" = "Cortar" "Dark" = "Oscuro" "Darken" = "Oscurecer" @@ -802,6 +803,7 @@ status = "draft — needs native review" "New design file" = "Nuevo archivo de diseño" "Newest first" = "Más recientes primero" "Next or previous control in the focused region" = "Control siguiente o anterior de la región enfocada" +"Next frame" = "Marco siguiente" "Next ready for dev" = "Siguiente listo para desarrollo" "Next size option" = "Siguiente opción de tamaño" "No assets: no export settings, icons or images. Add export settings in the Design tab." = "No hay recursos: ni ajustes de exportación, ni iconos, ni imágenes. Añade ajustes de exportación en la pestaña Diseño." @@ -816,6 +818,7 @@ status = "draft — needs native review" "No components yet. Select layers and press {keys}." = "Aún no hay componentes. Selecciona capas y pulsa {keys}." "No conflicts." = "Sin conflictos." "No contributor data was built into this copy." = "Esta copia no incluye datos de colaboradores." +"No device" = "Sin dispositivo" "No fonts match" = "Ninguna fuente coincide" "No join code here (the server is older than join codes, or this address can't be put in one): share the link instead." = "Aquí no hay código para unirse (el servidor es anterior a los códigos, o esta dirección no cabe en uno): comparte el enlace." "No layer changes to show." = "No hay cambios de capas que mostrar." @@ -997,6 +1000,7 @@ status = "draft — needs native review" "Preview" = "Vista previa" "Preview this flow" = "Vista previa de este flujo" "Preview this frame" = "Vista previa de este marco" +"Previous frame" = "Marco anterior" "Previous ready for dev" = "Anterior listo para desarrollo" "Progressive" = "Progresivo" "Properties" = "Propiedades" diff --git a/crates/ui-egui/src/comments_tests.rs b/crates/ui-egui/src/comments_tests.rs index bf30d5e55..696ff3228 100644 --- a/crates/ui-egui/src/comments_tests.rs +++ b/crates/ui-egui/src/comments_tests.rs @@ -213,7 +213,7 @@ fn the_presenter_shows_the_frames_comments() { key(&mut u, Key::C, Modifiers::SHIFT); assert_eq!(u.app.inspect()["presenter"]["comments"], true); // The frame is presented at 100% (Fit never scales up), centred under the bar. - let screen = egui::Rect::from_min_size(pos2(0.0, 40.0), vec2(1440.0, 860.0)); + let screen = egui::Rect::from_min_size(pos2(0.0, 80.0), vec2(1440.0, 820.0)); let frame_min = screen.center() - vec2(200.0, 150.0); let pin = frame_min + vec2(100.0, 100.0) + vec2(14.0, -14.0); click(&mut u, pin); diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 20a8a77c1..91f7a56be 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -426,6 +426,10 @@ pub struct UiState { /// A message at the bottom of the window and how long it has been showing. pub toast: Option<(String, ToastClock)>, pub present: Option, + /// A presentation kept alive while its design tab or Home is in front. + pub paused_present: Option, + /// The file that owns the presentation tab. + pub present_uid: Option, /// The full-window presenter's options (how it sizes the prototype), kept between /// presentations. pub present_view: present::PresentView, @@ -547,6 +551,8 @@ impl Default for UiState { icon_gallery: false, toast: None, present: None, + paused_present: None, + present_uid: None, present_view: present::PresentView::default(), preview: None, picker: None, @@ -837,6 +843,9 @@ impl FigApp { let mut p = present::Presenter::new(start); p.view = self.ui.present_view; self.ui.present = Some(p); + self.ui.paused_present = None; + self.ui.present_uid = self.session.docs.get(self.session.active).map(|d| d.uid); + self.ui.home = false; } } "present.options" => { @@ -1301,6 +1310,7 @@ impl FigApp { // The Inspect tab measures on hover without Alt. self.session.tool.redlines = self.ui.right_tab == RightTab::Inspect; self.end_pen_outside_design(); + tabs::tab_bar(self, ui); if self.ui.present.is_some() { present::show(self, ui); // What went wrong while presenting (a widget's plugin failing) shows over it. @@ -1308,7 +1318,6 @@ impl FigApp { return; } if !self.has_files() || self.ui.home { - tabs::tab_bar(self, ui); home::show(self, ui); dialogs::keys(self, &ctx); dialogs::show(self, &ctx); @@ -1317,7 +1326,6 @@ impl FigApp { return; } let hidden = self.session.ds().map(|d| d.view.ui_hidden).unwrap_or(false); - tabs::tab_bar(self, ui); if !hidden { egui::Panel::left("left_rail") .exact_size(56.0) @@ -1480,7 +1488,7 @@ impl FigApp { "focus": {"region": self.ui.nav.region.id(), "keyboard": self.ui.nav.keyboard}, "reduceMotion": self.reduce_motion(), "presenting": self.ui.present.is_some(), - "presenter": self.ui.present.as_ref().map(present::Presenter::inspect), + "presenter": self.ui.present.as_ref().or(self.ui.paused_present.as_ref()).map(present::Presenter::inspect), "presentOptions": {"scale": self.ui.present_view.scale.id(), "deviceFrame": self.ui.present_view.device_frame, "comments": self.ui.present_view.comments, "hotspotHints": self.ui.present_view.hotspot_hints, "inspect": self.ui.present_view.inspect}, "preview": self.ui.preview.as_ref().map(|p| p.player.inspect()), "mainMenu": self.ui.main_menu, diff --git a/crates/ui-egui/src/present.rs b/crates/ui-egui/src/present.rs index b5f177af0..bb6115884 100644 --- a/crates/ui-egui/src/present.rs +++ b/crates/ui-egui/src/present.rs @@ -270,6 +270,8 @@ pub struct Presenter { anim_tex: Option, temp: Option, textures: HashMap, + /// Small current-screen preview in the full-window bar, cached until its content changes. + bar_thumb: Option<(NodeId, usize, egui::TextureHandle)>, arrived: f64, delays_fired: HashSet<(NodeId, usize)>, /// Mouse triggers waiting out their delay. @@ -348,6 +350,7 @@ impl Presenter { anim_tex: None, temp: None, textures: HashMap::new(), + bar_thumb: None, arrived: -1.0, delays_fired: HashSet::new(), waiting: Vec::new(), @@ -1651,6 +1654,7 @@ pub fn show(app: &mut FigApp, ui: &mut Ui) { egui::CentralPanel::default().frame(egui::Frame::NONE).show(ui, |ui| { action = player(&mut pres, ui, ui.max_rect(), now, Chrome { keys: !typing, ..FULL }).or(action); }); + let picked_device = navigation_bar(&mut pres, &ctx, now); // Keys the prototype left alone: C shows the comments, F fills the screen. if !typing { if ctx.input_mut(|i| i.consume_key(egui::Modifiers::NONE, egui::Key::C)) { @@ -1679,12 +1683,123 @@ pub fn show(app: &mut FigApp, ui: &mut Ui) { if let Some(BarAction::Responsive(on)) = action { app.run("proto.settings", json!({"responsive": on})); } + if let Some(device) = picked_device { + app.run("proto.settings", json!({"device": device})); + } if action == Some(BarAction::Close) || ctx.input(|i| i.key_pressed(egui::Key::Escape)) { + app.ui.present_uid = None; return; } app.ui.present = Some(pres); } +/// Controls that stay in reach while viewing a prototype, including screen stepping, device and +/// scale. The selected device is returned to the caller so it can go through the normal document +/// command (and undo/save) rather than changing only the player's copy. +fn navigation_bar(p: &mut Presenter, ctx: &egui::Context, now: f64) -> Option { + let t = Tokens::get(ctx); + let doc = p.doc.as_ref()?; + let frames = doc.top_frames(doc.page_of(p.current).unwrap_or(p.current)); + let index = frames.iter().position(|id| *id == p.current); + let settings = page_settings(doc, p.current); + let mut navigate = None; + let mut device_choice = None; + egui::Area::new(Id::new("present_navigation")).anchor(Align2::CENTER_BOTTOM, vec2(0.0, -18.0)).order(egui::Order::Foreground).show(ctx, |ui| { + egui::Frame::NONE + .fill(t.panel) + .stroke(Stroke::new(1.0, t.border)) + .corner_radius(CornerRadius::same(9)) + .inner_margin(egui::Margin::symmetric(8, 5)) + .show(ui, |ui| { + ui.horizontal(|ui| { + let prev = index.and_then(|i| i.checked_sub(1)).and_then(|i| frames.get(i)).copied(); + let next = index.and_then(|i| frames.get(i + 1)).copied(); + let previous = + ui.add_enabled(prev.is_some(), egui::Button::new("").min_size(vec2(26.0, 24.0))).on_hover_text(tr("Previous frame")); + icons::paint( + ui.painter(), + Rect::from_center_size(previous.rect.center(), vec2(21.0, 21.0)), + Icon::ChevronLeft, + if prev.is_some() { t.icon } else { t.icon_secondary }, + ); + if previous.clicked() { + navigate = prev; + } + ui.label(egui::RichText::new(format!("{} / {}", index.map_or(0, |i| i + 1), frames.len())).color(t.text)); + let following = ui.add_enabled(next.is_some(), egui::Button::new("").min_size(vec2(26.0, 24.0))).on_hover_text(tr("Next frame")); + icons::paint( + ui.painter(), + Rect::from_center_size(following.rect.center(), vec2(21.0, 21.0)), + Icon::ChevronRight, + if next.is_some() { t.icon } else { t.icon_secondary }, + ); + if following.clicked() { + navigate = next; + } + ui.separator(); + let model = if settings.device.is_empty() || settings.device == "None" { tr("No device") } else { &settings.device }; + let device_menu = ui.menu_button(format!("{model} "), |ui| { + navigation_menu(ui, |ui| { + egui::ScrollArea::vertical().max_height(410.0).show(ui, |ui| { + if ui.selectable_label(settings.device.is_empty() || settings.device == "None", tr("No device")).clicked() { + device_choice = Some("None".to_owned()); + ui.close(); + } + ui.separator(); + for device in PrototypeSettings::DEVICES { + let label = format!("{} {}×{}", device.name, device.width as u32, device.height as u32); + if ui.selectable_label(settings.device == device.name, label).clicked() { + device_choice = Some(device.name.to_owned()); + ui.close(); + } + } + ui.separator(); + if ui.selectable_label(settings.device == PrototypeSettings::CUSTOM_DEVICE, tr("Custom size")).clicked() { + device_choice = Some(PrototypeSettings::CUSTOM_DEVICE.to_owned()); + ui.close(); + } + }); + }); + }); + paint_menu_chevron(ui.painter(), device_menu.response.rect, t.icon_secondary); + let scale_menu = ui.menu_button(format!("{} ", tr(p.view.scale.label(settings.device().is_some()))), |ui| { + navigation_menu(ui, |ui| { + for scale in PresentScale::options(settings.device().is_some()) { + let label = egui::RichText::new(tr(scale.label(settings.device().is_some()))).color(t.menu_text); + if ui.selectable_label(p.view.scale == *scale, label).clicked() { + p.set_scale(*scale); + ui.close(); + } + } + }); + }); + paint_menu_chevron(ui.painter(), scale_menu.response.rect, t.icon_secondary); + }); + }); + }); + if let Some(id) = navigate { + p.go(id, Transition::Instant, 0.0, Easing::Linear, now, true, false); + } + device_choice +} + +fn paint_menu_chevron(painter: &egui::Painter, button: Rect, color: Color32) { + let icon = Rect::from_center_size(pos2(button.right() - 11.0, button.center().y), vec2(17.0, 17.0)); + icons::paint(painter, icon, Icon::Chevron, color); +} + +fn navigation_menu(ui: &mut Ui, add: impl FnOnce(&mut Ui)) { + let t = Tokens::get(ui.ctx()); + ui.visuals_mut().override_text_color = Some(t.menu_text); + egui::Frame::NONE.fill(t.menu).stroke(Stroke::new(1.0, t.border)).corner_radius(CornerRadius::same(7)).inner_margin(egui::Margin::same(6)).show( + ui, + |ui| { + ui.set_min_width(212.0); + add(ui); + }, + ); +} + /// How often the player polls the controllers while its prototype has gamepad triggers (seconds). const PAD_POLL_SECS: f64 = 1.0 / 30.0; @@ -2045,16 +2160,17 @@ fn inspect_hover(p: &mut Presenter, painter: &egui::Painter, ctx: &egui::Context /// the right (text on the dark full-window bar, icons in the pane, which follows the theme). fn top_bar(p: &mut Presenter, ui: &mut Ui, bar: Rect, now: f64, chrome: Chrome) -> Option { let t = Tokens::get(ui.ctx()); - let (fill, text, dim, hover) = if chrome.pane { - (t.panel, t.text, t.text_secondary, t.hover) - } else { - (Color32::from_rgb(0x2C, 0x2C, 0x2C), Color32::WHITE, Color32::from_gray(140), Color32::from_white_alpha(28)) - }; + let (fill, text, dim, hover) = (t.panel, t.text, t.text_secondary, t.hover); let r = chrome.round; ui.painter().rect_filled(bar, CornerRadius { nw: r, ne: r, sw: 0, se: 0 }, fill); if chrome.pane { ui.painter().line_segment([bar.left_bottom(), bar.right_bottom()], Stroke::new(1.0, t.border)); } + let source_key = p.source.as_ref().map_or(0, |s| Arc::as_ptr(s) as usize); + if !chrome.pane && p.bar_thumb.as_ref().is_none_or(|(id, source, _)| *id != p.current || *source != source_key) { + p.bar_thumb = + p.source.as_ref().and_then(|d| crate::assets_panel::thumbnail(ui.ctx(), d, p.current, 38.0)).map(|tex| (p.current, source_key, tex)); + } let doc = p.doc.as_ref()?; let name = doc.node(p.current).map(|n| n.name.clone()).unwrap_or_default(); let flows = match doc.page_of(p.start).and_then(|pg| doc.node(pg)).map(|n| &n.kind) { @@ -2117,19 +2233,33 @@ fn top_bar(p: &mut Presenter, ui: &mut Ui, bar: Rect, now: f64, chrome: Chrome) // Left: the flow picker and the frame's name, clipped before the buttons. let left = ui.painter().with_clip_rect(Rect::from_min_max(bar.min, pos2(x, bar.max.y))); let mut lx = bar.min.x + if chrome.pane { 8.0 } else { 12.0 }; + if !chrome.pane { + let thumb = Rect::from_center_size(pos2(lx + 15.0, bar.center().y), vec2(28.0, 28.0)); + left.rect_filled(thumb, CornerRadius::same(4), t.field); + if let Some((_, _, tex)) = &p.bar_thumb { + let size = tex.size_vec2(); + if size.x > 0.0 && size.y > 0.0 { + let scaled = size * (26.0 / size.x.max(size.y)); + let dst = Rect::from_center_size(thumb.center(), scaled); + left.image(tex.id(), dst, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE); + } + } + lx += 38.0; + } // The flow playing: its name on the picker, its description on hover; the menu lists each // flow with its description. let playing = flows.iter().find(|f| f.start == p.start); if !flows.is_empty() { - let label = format!("{} ▾", playing.map_or(tr("Flows"), |f| f.name.as_str())); + let label = playing.map_or(tr("Flows"), |f| f.name.as_str()).to_owned(); let tip = playing.map(|f| f.description.trim()).filter(|d| !d.is_empty()).unwrap_or(tr("Flows")).to_string(); let galley = left.layout_no_wrap(label, semibold(11.5), text); - let fr = Rect::from_min_size(pos2(lx, bar.center().y - 12.0), vec2(galley.size().x + 16.0, 24.0)); + let fr = Rect::from_min_size(pos2(lx, bar.center().y - 12.0), vec2(galley.size().x + 30.0, 24.0)); let resp = ui.interact(fr.intersect(left.clip_rect()), ui.id().with("pflows"), Sense::click()).tip(tip); if resp.hovered() { left.rect_filled(fr, CornerRadius::same(5), hover); } left.galley(pos2(fr.min.x + 8.0, fr.center().y - galley.size().y / 2.0), galley, text); + paint_menu_chevron(&left, fr, t.icon_secondary); crate::right::menu_popup(&resp).width(240.0).show(|ui| { let t = Tokens::get(ui.ctx()); for f in &flows { @@ -2149,7 +2279,7 @@ fn top_bar(p: &mut Presenter, ui: &mut Ui, bar: Rect, now: f64, chrome: Chrome) left.text(pos2(lx, bar.center().y), Align2::LEFT_CENTER, "/", regular(11.5), dim); lx += 14.0; } - left.text(pos2(lx, bar.center().y), Align2::LEFT_CENTER, name, regular(11.5), if chrome.pane { text } else { Color32::from_gray(220) }); + left.text(pos2(lx, bar.center().y), Align2::LEFT_CENTER, name, regular(11.5), text); action } diff --git a/crates/ui-egui/src/present_view_tests.rs b/crates/ui-egui/src/present_view_tests.rs index 3571b2add..8fdd5eb05 100644 --- a/crates/ui-egui/src/present_view_tests.rs +++ b/crates/ui-egui/src/present_view_tests.rs @@ -95,6 +95,28 @@ fn scale_options_match_the_command_and_cycle() { assert!(!PresentScale::options(true).contains(&PresentScale::FitWidth)); } +#[test] +fn presentation_tab_keeps_the_current_screen_when_returning_to_the_editor() { + let (mut u, a, b, _) = setup(); + u.run("proto.present", json!({"start": a})); + u.key(pos2(720.0, 470.0), Key::ArrowRight); + assert_eq!(presenter(&u)["current"], json!(b)); + + let design_tab = pos2(100.0, 20.0); + u.button(design_tab, true); + u.button(design_tab, false); + assert!(u.app.ui.present.is_none()); + assert_eq!(u.app.ui.paused_present.as_ref().map(|p| p.current), Some(b)); + + let name_len = u.app.session.doc().unwrap().name.chars().count() as f32; + let design_w = (12.0 * 0.6 * name_len + 64.0).clamp(120.0, 220.0); + let preview_tab = pos2(8.0 + 44.0 + design_w + 40.0, 20.0); + u.button(preview_tab, true); + u.button(preview_tab, false); + assert!(u.app.ui.paused_present.is_none()); + assert_eq!(presenter(&u)["current"], json!(b)); +} + /// No device: a big screen (2000×3000) and a small one, presenting the big one. fn big() -> (Ui, NodeId) { let mut s = Session::new(); @@ -117,10 +139,10 @@ fn num(v: &Value) -> f64 { fn presenter_scales_by_its_options_and_pans_what_overflows() { let (mut u, big) = big(); let at = pos2(720.0, 470.0); - // Fit: scaled down to the 1376×796 inside the padding; nothing pans. + // Fit: the tab strip leaves 1376×756 inside the presenter's padding; nothing pans. let p = presenter(&u); assert_eq!(p["scale"], "fit"); - assert!((num(&p["zoom"]) - 796.0 / 3000.0).abs() < 1e-3, "{p}"); + assert!((num(&p["zoom"]) - 756.0 / 3000.0).abs() < 1e-3, "{p}"); assert_eq!(p["panRange"], json!([0.0, 0.0])); // Z: fit width (the whole 1440 width; the rest of the height pans). u.key(at, Key::Z); @@ -128,14 +150,14 @@ fn presenter_scales_by_its_options_and_pans_what_overflows() { assert_eq!(p["scale"], "fitWidth"); assert!((num(&p["zoom"]) - 0.72).abs() < 1e-3, "{p}"); assert_eq!(p["panRange"][0], 0.0); - assert!((num(&p["panRange"][1]) - (2160.0 - 860.0)).abs() < 1.0, "{p}"); + assert!((num(&p["panRange"][1]) - (2160.0 - 820.0)).abs() < 1.0, "{p}"); // Z: fill (here the width decides too), then 100%: both ways overflow, centred across at the top. u.key(at, Key::Z); assert_eq!(presenter(&u)["scale"], "fill"); u.key(at, Key::Z); let p = presenter(&u); assert_eq!((p["scale"].as_str(), num(&p["zoom"])), (Some("actual"), 1.0)); - assert_eq!(p["panRange"], json!([624.0, 2204.0])); + assert_eq!(p["panRange"], json!([624.0, 2244.0])); assert_eq!(p["pan"], json!([312.0, 0.0])); // The wheel pans down; a drag pans with the pointer. let wheel = move || { @@ -192,7 +214,7 @@ fn devices_turn_and_their_frame_can_hide() { let with_body = num(&presenter(&u)["zoom"]); u.run("proto.presentOptions", json!({"deviceFrame": false})); let bare = num(&presenter(&u)["zoom"]); - assert!(bare > with_body && (bare - 796.0 / 852.0).abs() < 1e-3, "{with_body} {bare}"); + assert!(bare > with_body && (bare - 756.0 / 852.0).abs() < 1e-3, "{with_body} {bare}"); // A device offers no fit width: Z goes fit → fill → 100%. u.key(pos2(720.0, 470.0), Key::Z); assert_eq!(presenter(&u)["scale"], "fill"); diff --git a/crates/ui-egui/src/proto_responsive_tests.rs b/crates/ui-egui/src/proto_responsive_tests.rs index fc9ccda21..f0ead8e98 100644 --- a/crates/ui-egui/src/proto_responsive_tests.rs +++ b/crates/ui-egui/src/proto_responsive_tests.rs @@ -69,8 +69,8 @@ fn without_a_device_a_responsive_frame_fills_the_window_at_100_percent() { let mut u = Ui::new(s); u.run("proto.present", json!({"start": w})); let p = presenter(&u); - // The window is 1440×900; the bar takes 40. - assert_eq!(size(&p["frameSize"]), (1440.0, 860.0), "{p}"); + // The window is 1440×900; the title and tab bars take 80. + assert_eq!(size(&p["frameSize"]), (1440.0, 820.0), "{p}"); assert_eq!(p["zoom"], json!(1.0)); assert_eq!(size(&p["panRange"]), (0.0, 0.0)); // Z has nothing to cycle: the size options don't apply. diff --git a/crates/ui-egui/src/tabs.rs b/crates/ui-egui/src/tabs.rs index 27ff085c8..534881fc3 100644 --- a/crates/ui-egui/src/tabs.rs +++ b/crates/ui-egui/src/tabs.rs @@ -33,7 +33,7 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { // Home. let hr = Rect::from_min_size(pos2(x, rect.min.y), vec2(44.0, HEIGHT)); let hresp = ui.interact(hr, ui.id().with("home"), Sense::click()).tip(tr("Home")); - let home_active = app.ui.home || !app.has_files(); + let home_active = (app.ui.home || !app.has_files()) && app.ui.present.is_none(); crate::a11y::tab(&hresp, tr("Home"), home_active); if home_active { ui.painter().rect_filled(hr, CornerRadius::ZERO, t.tab_active); @@ -42,6 +42,9 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { } icons::paint(ui.painter(), Rect::from_center_size(hr.center(), vec2(16.0, 16.0)), Icon::Home, t.icon); if hresp.clicked() { + if let Some(p) = app.ui.present.take() { + app.ui.paused_present = Some(p); + } app.ui.home = true; } x += 44.0; @@ -52,7 +55,7 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { let mut detach = None; let several = !ui.ctx().embed_viewports(); for (i, d) in app.session.docs.iter().enumerate().filter(|(_, d)| app.shows(d.uid)) { - let active = i == app.session.active && !app.ui.home; + let active = i == app.session.active && !app.ui.home && app.ui.present.is_none(); let name = d.doc.name.clone(); // In a live session: a mark after the name says whether others get in. let live = live_mark(app, d.uid); @@ -132,6 +135,41 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { x += w; ui.painter().line_segment([pos2(x, rect.min.y + 10.0), pos2(x, rect.max.y - 10.0)], Stroke::new(1.0, t.border)); } + // Presentations live in their own tab. Switching back to the design keeps the player + // state (current screen, navigation history and scroll position) for the return trip. + if app.ui.present.is_some() || app.ui.paused_present.is_some() { + let w = 128.0; + let r = Rect::from_min_size(pos2(x, rect.min.y), vec2(w, HEIGHT)); + let resp = ui.interact(r, ui.id().with("presentation_tab"), Sense::click()).tip(tr("Present")); + let active = app.ui.present.is_some(); + crate::a11y::tab(&resp, tr("Present"), active); + if active { + ui.painter().rect_filled(r, CornerRadius::ZERO, t.tab_active); + } else if resp.hovered() { + ui.painter().rect_filled(r, CornerRadius::ZERO, t.hover); + } + icons::paint(ui.painter(), Rect::from_center_size(pos2(x + 19.0, r.center().y), vec2(14.0, 14.0)), Icon::Play, t.icon); + ui.painter().text(pos2(x + 34.0, r.center().y), Align2::LEFT_CENTER, tr("Present"), regular(12.0), t.text); + let cr = Rect::from_center_size(pos2(r.max.x - 16.0, r.center().y), vec2(18.0, 18.0)); + if resp.hovered() || active { + let close_resp = ui.interact(cr, ui.id().with("presentation_close"), Sense::click()).tip(tr("Close preview")); + if close_resp.hovered() { + ui.painter().rect_filled(cr, CornerRadius::same(4), t.pressed); + } + icons::paint(ui.painter(), cr.shrink(4.0), Icon::Close, t.icon_secondary); + if close_resp.clicked() { + app.ui.present = None; + app.ui.paused_present = None; + app.ui.present_uid = None; + } else if resp.clicked() && !active { + resume_presentation(app); + } + } else if resp.clicked() && !active { + resume_presentation(app); + } + x += w; + ui.painter().line_segment([pos2(x, rect.min.y + 10.0), pos2(x, rect.max.y - 10.0)], Stroke::new(1.0, t.border)); + } // New tab. let nr = Rect::from_center_size(pos2(x + 20.0, rect.center().y), vec2(28.0, 28.0)); let nresp = ui.interact(nr, ui.id().with("newtab"), Sense::click()).tip(crate::shortcuts::tip(tr("New design file"), "file.new")); @@ -140,6 +178,9 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { } icons::paint(ui.painter(), nr.shrink(7.0), Icon::Plus, t.icon); if nresp.clicked() { + if let Some(p) = app.ui.present.take() { + app.ui.paused_present = Some(p); + } app.run("file.new", json!({})); app.ui.home = false; } @@ -155,6 +196,9 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { app.run(cmd, json!({})); } if let Some(i) = switch { + if let Some(p) = app.ui.present.take() { + app.ui.paused_present = Some(p); + } app.run("doc.switch", json!({"index": i})); app.ui.home = false; } @@ -180,12 +224,29 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { } else { app.run("file.close", json!({"index": i})); } + if app.ui.present_uid.is_some_and(|uid| !app.session.docs.iter().any(|d| d.uid == uid)) { + app.ui.present = None; + app.ui.paused_present = None; + app.ui.present_uid = None; + } } let _ = Color32::TRANSPARENT; let _ = Align2::LEFT_TOP; }); } +fn resume_presentation(app: &mut FigApp) { + let Some(uid) = app.ui.present_uid else { return }; + let Some(index) = app.session.docs.iter().position(|d| d.uid == uid) else { + app.ui.paused_present = None; + app.ui.present_uid = None; + return; + }; + app.run("doc.switch", json!({"index": index})); + app.ui.home = false; + app.ui.present = app.ui.paused_present.take(); +} + /// What the tab of document `uid` says about its live session: others get in (`true`: a session /// this app hosts or joined, a file shared online), only you do (`false`: a file of yours on a /// server, not shared now), or it has none. diff --git a/docs/gaps.md b/docs/gaps.md index e8b111a8d..95962a5c3 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Where FigCraft falls short of Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-15 · **Change:** minor (bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-15 · **Change:** minor (presenter navigation and device controls; bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) Every known shortfall against Figma, one entry each, ranked by how much it stops a Figma user from doing real work in FigCraft. Agents: pick work from the top unless the owner says otherwise. The @@ -138,6 +138,9 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe cursor for every tool and modifier, panel widths, dark pages (`field_tests`, `cursor_tests`, `cursors_tests`, `outline_options_tests`, `hide_publishing_tests`, `panel_width_tests`, `theme_pages_tests`). +- **Landed (2026-10-15):** presentation keeps its own tab beside the design, preserves the + current screen when switching back to edit, shows a small current-screen preview and offers + screen, device and scale controls (`present_view_tests`). - **Evidence:** ROADMAP item 7 ("Left: tool by tool, panel by panel against the incumbent"). - **Impact:** Figma users notice the feel within minutes; it decides whether they stay. - **Estimate:** 40–60 h. Detail in [`ui-parity.md`](ui-parity.md). @@ -400,6 +403,7 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe | Date | Change | Summary | |---|---|---| +| 2026-10-15 | minor | Gap 4: presenter tab, thumbnail, device picker and scale controls. Estimates and ranking unchanged. | | 2026-10-15 | minor | Gap 7: bounded canvas overscan for smoother panning. Estimates and ranking unchanged. | | 2026-10-14 | minor | Russian catalog (M9), reviewed and approved by VanTan: all 2,165 current entries, Русский in Preferences and regional ru tags. Russian integer plurals use one/few/many; contributor display name VanTan added. Existing estimates unchanged. | | 2026-10-13 | minor | Gap 1: the experimental `.fig` export writes instance sizes (resized, filling an auto layout, scaled), variables with modes and bindings, shared styles and variable-width strokes, and the import reads them back. Checked by opening written files in other software: resized and scaled instances keep their size and lay their layers out for it, variables with their modes and colour bindings resolve there (a frame set to another mode shows that mode's colours, also inside instances), colour, text, effect and grid styles are listed, and variable-width strokes that are the same on both sides of the path draw with their width; number, string and boolean bindings and bindings on effects, layout guides and gradient stops come across as the values they give but did not show as bound there (their entries now also name the layer field they set, not yet checked there), and strokes wider on one side of the path are written as filled outlines, no longer editable strokes there (the stroke itself is kept as plugin data and our own import puts it back; not yet checked there). Hours and the ranking unchanged | diff --git a/docs/images/shot-8-presenter-tab.png b/docs/images/shot-8-presenter-tab.png new file mode 100644 index 0000000000000000000000000000000000000000..d5cee8e179bebf78e69afdb7311d460c4a5a072c GIT binary patch literal 75341 zcmeFa2~<>9);3&@s6=syL1PrBNGHaWN)!jA9HYiWI!POnsFXt@NgPm#VdgqU4JsOA z(4df^({{8KZCeoqN)$ySSTRP?fE1IUqCin1RZ!IZ_uh9pm%-%yzVH9m`>pk^)hjJf zb?>?7?EUO#KYO2ZH~)3!)Q%mV?V!Q9`7Mp6&9@p&tM%>L!f$-v`1)5(i$PCM zpFH7j!7U!1Y4z>E_rAVh=7Y+&Ud-ITa>l~LOLI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N3>9ipCdQ8voQwL&Mr14Lezq5#De5%$aorXH4I4Yq&Y3VYHJ7H<mp=7Ffc5-ZU_R=*#`Jyb0z0Q}+e1^Erp zg=6+i2VZM6nhC~j3ij3nC$1(ipzL7Exr26sFh7Y*+LJcx)-pGE{lQ?8Y$XITuLH4; zYaeUa6S(K}4I=u&e<^5R?(&E&cJw2PpUpTAuClwCkjaWRw>uEHAXV3g0ps z*MZ;{r-#f)?U`)r-f8=mIJ1tKxg9gztk5HrJ8O?fze#YhnOJrU}V;3HADu z@c`P}2ZE-gTun9@ssZwAly&6(3CO=f((8CB8nmA>pJJBoLQA}x25wxEX71=?H6qB z3jrx$H)c^~i3j_(G&`^dV#L=doFtfK_7H-^%2vTwX^83P5tTL&8{LuSoa5aflCO;U zIxe?gcWs!LVJdyk0ev0WB;pv7Ok==(w;oF;NVLHPvhnfXwwHNtmEABI02H4f@fRSD zCcsih65B>OT(C+{gRM1f`|%+HOG+InWe)p1+wFOD-F4qxws`-HVs*>YuodYj(lFFe zV|HfJet>&0!kyGu5P3Q3s7`j4Z6NUvL>qf3o)9mQHLw#?tjUA$Px8Iw)}v`8Jl9iQ z1H|jysm1NmSVVj*DW2u1JOz+BY>lnJ(Qc^i5B9G6fWBw6_mHRB<_V=R$p#-aCW8j~ zotF0z-SkRk6@-`WSSRSmTJLc;`KG1?jDWx=gtb*rKIuadJEDqp5Zk@DGfq{eHA50wO7lZI=NFPKI9N=Mm?fMl)?vX*@Z~t zvb9&rpZ+zTODQ>3CigFhx1UKT{{Kn)FpIF$!ksTR4KZEcT4)J?|GhA0-m^JRFWvnA E02Al^oB#j- literal 0 HcmV?d00001 diff --git a/docs/images/shot-9-device-picker.png b/docs/images/shot-9-device-picker.png new file mode 100644 index 0000000000000000000000000000000000000000..2f4805154b9cef0c9e122acc1c8c7ed484c1d72e GIT binary patch literal 106019 zcmeFa3s{Wl8$UkDImtOhIYbUih(c+cb68q-+t#T;s}_-j&b>KSLe5DvyDWCKq-~R^ zMoOVFY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jXz{Q z{o{t=B<&k}&3_^Igcdy(C;KlPQX$!_SrZ( zBYxbVimLP`*B{ki2eWE@XwrK6T z+Y8gk7h~Ck7mN1***3me#g}N+{C{noPe>b45XLPCR!hynLlluvYVqdLYrsFCv?vrL zCmSJ9C|D3m&>mu-Dky?bEkp{&Lm`CCbOEy9th-0t~be+*@|x!t_mBJYiE3<6Z|({~+dMJQy%z$ZOh@D|^DX?5SYJL^ z047Z`*+v=uq_qOg1)`0Sx0JOXuyMA_J9Wxhjyp}=CYXn{8PkBxl#g1;%3$hcmnX^b ztfUhK&SfyT)jdi@}RppI|=E; zT!_&bK&o}_AKK0u4R@pQlKPhtWRSlIS8dSM{N4`G@O{gmI-m(~cLIeXEj{IENKP8# ze_*=ByDlj>3(vQ^8ED>Td?dgU`m@jK5*$o5=8u~NfjNSiDYWWg<*uc+w1tYxLLM@{ ze9BXJl3;rf91S{nUoc2di7G3L(oa>|J#oJn)gYydIOowQ<)MK ILUZqjTh)0r*Z=?k literal 0 HcmV?d00001 From 2cac36a4e22ca0b177c9852875a6f959f8966be7 Mon Sep 17 00:00:00 2001 From: Ahmed5Emad Date: Fri, 16 Oct 2026 12:31:50 +0300 Subject: [PATCH 067/817] Live font preview on hover in font picker (#653) Hovering a family in the Typography font dropdown previews it on the canvas via text.preview; closing without picking restores the original, clicking applies it as one undo step. --- crates/engine/src/cmd/text.rs | 2 +- crates/engine/src/lib.rs | 4 ++-- crates/engine/src/text_style_picker_tests.rs | 25 ++++++++++++++++++++ crates/engine/src/textpreview.rs | 4 ++-- crates/ui-egui/src/lib.rs | 2 +- crates/ui-egui/src/style_picker.rs | 2 +- crates/ui-egui/src/typography.rs | 22 ++++++++++++----- 7 files changed, 48 insertions(+), 13 deletions(-) diff --git a/crates/engine/src/cmd/text.rs b/crates/engine/src/cmd/text.rs index 14ea17621..3b861895a 100644 --- a/crates/engine/src/cmd/text.rs +++ b/crates/engine/src/cmd/text.rs @@ -332,7 +332,7 @@ pub fn specs() -> Vec { spec!( "text.preview", "Preview text change", - "{command: style.apply|library.applyStyle|text.setVariations|text.style, params} shows what the command would do on the canvas without an undo step (a hovered text style or named instance, a dragged axis slider), in place of an earlier preview; text.endPreview or any other command ends it, so running the command for real commits it as one undo step", + "{command: style.apply|library.applyStyle|text.setVariations|text.style, params} shows what the command would do on the canvas without an undo step (a hovered font family or style, text style or named instance, a dragged axis slider), in place of an earlier preview; text.endPreview or any other command ends it, so running the command for real commits it as one undo step", false, |s, p| { let c = req_string("text.preview", p, "command")?; diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 3bc49a906..8c6ca635d 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -316,8 +316,8 @@ pub struct DocState { versions_changed: bool, /// A version shown in place of the document (read-only). pub preview: Option, - /// The document under a live text preview (a hovered text style or font instance, a dragged - /// axis slider): `doc` shows the preview until [`textpreview::end`] puts this back. + /// The document under a live text preview (a hovered font family or style, text style or + /// font instance, a dragged axis slider): `doc` shows the preview until [`textpreview::end`] puts this back. pub text_preview: Option>, /// The document as of the last version saved or restored (none yet): autosaves, restores and /// merges only add a checkpoint for changes since. diff --git a/crates/engine/src/text_style_picker_tests.rs b/crates/engine/src/text_style_picker_tests.rs index 37c7dc5c2..6ee8cc2c3 100644 --- a/crates/engine/src/text_style_picker_tests.rs +++ b/crates/engine/src/text_style_picker_tests.rs @@ -212,6 +212,31 @@ fn previews_while_editing_keep_the_edit() { assert!(links(&s, t).iter().all(Option::is_none)); } +#[test] +fn previews_show_a_hovered_font_family() { + let mut s = new_session(); + let t = text(&mut s, "Preview me"); + s.ds_mut().unwrap().mark_saved(); + let before = s.doc().unwrap().clone(); + let undo = s.ds().unwrap().history.undo.len(); + // Hovering a font family shows it on the canvas: no undo step, not dirty. + s.execute("text.preview", &json!({"command": "text.style", "params": {"ids": [t], "fontFamily": "Arial"}})).unwrap(); + assert_eq!(data(&s, t).style_at(0).font_family, "Arial"); + assert_eq!(s.ds().unwrap().history.undo.len(), undo); + assert!(!s.ds().unwrap().is_dirty()); + // Moving to another family replaces the preview, from the document itself. + s.execute("text.preview", &json!({"command": "text.style", "params": {"ids": [t], "fontFamily": "Georgia"}})).unwrap(); + assert_eq!(data(&s, t).style_at(0).font_family, "Georgia"); + // Closing without picking puts the document back as it was. + assert_eq!(s.execute("text.endPreview", &json!({})).unwrap()["ended"], json!(true)); + assert_eq!(*s.doc().unwrap(), before); + // Clicking commits it as one undo step. + s.execute("text.style", &json!({"ids": [t], "fontFamily": "Georgia"})).unwrap(); + assert_eq!(data(&s, t).style_at(0).font_family, "Georgia"); + assert_eq!(s.ds().unwrap().history.undo.len(), undo + 1); + assert!(s.ds().unwrap().text_preview.is_none()); +} + #[test] fn previews_refuse_what_they_cant_show() { let mut s = new_session(); diff --git a/crates/engine/src/textpreview.rs b/crates/engine/src/textpreview.rs index 507eccc3d..da101d5ea 100644 --- a/crates/engine/src/textpreview.rs +++ b/crates/engine/src/textpreview.rs @@ -1,6 +1,6 @@ //! Live text previews: what a text command would do, shown on the canvas without an undo step — -//! while the pointer is over a text style in the style browser or a font's named instance, or -//! while a variable font axis slider is dragged. The document under the preview is kept and comes +//! while the pointer is over a font family or style, a text style in the style browser or a +//! font's named instance, or while a variable font axis slider is dragged. The document under the preview is kept and comes //! back when the preview ends ([`end`], `text.endPreview`). Every other command ends it first, so //! committing (running the command for real) applies to the document itself as one undo step, and //! Escape just ends the preview. diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 613f18f98..d98b91560 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -583,7 +583,7 @@ impl FigApp { } /// Show what `command params` would do on the canvas as a live preview (`text.preview`) while - /// a text style, a named instance or an axis slider is hovered or dragged. Call it every frame + /// a font family, font style, text style, named instance or axis slider is hovered or dragged. Call it every frame /// the preview should stay: it ends on the first frame nothing asks for it. pub fn preview_text(&mut self, ctx: &egui::Context, command: &str, params: Value) { self.ui.text_preview_wanted = true; diff --git a/crates/ui-egui/src/style_picker.rs b/crates/ui-egui/src/style_picker.rs index 3a4e7b11d..1eec3e389 100644 --- a/crates/ui-egui/src/style_picker.rs +++ b/crates/ui-egui/src/style_picker.rs @@ -746,7 +746,7 @@ fn text_properties(ui: &mut Ui, id: &str, def: &TextStyle, out: &mut Frame) { (family_resp, style_resp) }); crate::right::menu_popup(&family_resp).width(260.0).close_behavior(egui::PopupCloseBehavior::CloseOnClickOutside).show(|ui| { - if let Some(f) = crate::typography::font_picker(ui, Some(&def.font_family), family_resp.clicked()) { + if let Some(f) = crate::typography::font_picker(ui, Some(&def.font_family), family_resp.clicked()).0 { set(out, &|d| { d.font_family = f.clone(); let styles = figcraft_text::family_styles(&f); diff --git a/crates/ui-egui/src/typography.rs b/crates/ui-egui/src/typography.rs index 873ac0f0b..de304d6aa 100644 --- a/crates/ui-egui/src/typography.rs +++ b/crates/ui-egui/src/typography.rs @@ -181,7 +181,12 @@ fn font_rows(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], styles: &[TextStyle] let w = ui.available_width(); let resp = widgets::dropdown(ui, family.as_deref().unwrap_or(tr(MIXED)), w, None); menu_popup(&resp).width(w.max(240.0)).close_behavior(egui::PopupCloseBehavior::CloseOnClickOutside).show(|ui| { - if let Some(f) = font_picker(ui, family.as_deref(), resp.clicked()) { + let (picked, hovered) = font_picker(ui, family.as_deref(), resp.clicked()); + if let Some(h) = hovered { + // The canvas shows the hovered family; closing without picking ends the preview. + app.preview_text(ui.ctx(), "text.style", text_style_params(ids, range, json!({"fontFamily": h}))); + } + if let Some(f) = picked { remember_family(ui.ctx(), &f); apply_style(app, "fontFamily", json!(f)); ui.close(); @@ -1049,8 +1054,9 @@ enum PickRow { Family(String), } -/// The searchable family list. Returns the family picked. -pub(crate) fn font_picker(ui: &mut Ui, current: Option<&str>, just_opened: bool) -> Option { +/// The searchable family list. Returns the family picked and the family hovered (the caller +/// previews the hovered one on the canvas: closing without picking restores the original). +pub(crate) fn font_picker(ui: &mut Ui, current: Option<&str>, just_opened: bool) -> (Option, Option) { let t = Tokens::get(ui.ctx()); let q_id = Id::new("font_query"); let mut q: String = ui.data(|d| d.get_temp(q_id)).unwrap_or_default(); @@ -1066,7 +1072,7 @@ pub(crate) fn font_picker(ui: &mut Ui, current: Option<&str>, just_opened: bool) let all = figcraft_text::family_names(); let matches: Vec = all.iter().filter(|f| ql.is_empty() || f.to_lowercase().contains(&ql)).cloned().collect(); if search.lost_focus() && ui.input(|i| i.key_pressed(egui::Key::Enter)) { - return matches.into_iter().next(); + return (matches.into_iter().next(), None); } let mut rows: Vec = Vec::new(); if ql.is_empty() { @@ -1079,11 +1085,12 @@ pub(crate) fn font_picker(ui: &mut Ui, current: Option<&str>, just_opened: bool) } if matches.is_empty() { widgets::label(ui, tr("No fonts match"), t.text_tertiary); - return None; + return (None, None); } rows.extend(matches.into_iter().map(PickRow::Family)); let mut budget = 4; let mut picked = None; + let mut hovered_family = None; egui::ScrollArea::vertical().max_height(380.0).auto_shrink([false, true]).show_rows(ui, ROW, rows.len(), |ui, range| { for r in rows.get(range).unwrap_or(&[]) { let w = ui.available_width(); @@ -1125,11 +1132,14 @@ pub(crate) fn font_picker(ui: &mut Ui, current: Option<&str>, just_opened: bool) if resp.clicked() { picked = Some(f.clone()); } + if resp.hovered() { + hovered_family = Some(f.clone()); + } } } } }); - picked + (picked, hovered_family) } #[cfg(test)] From 4484c2d1b023e7b058231dda20a157badd19f42b Mon Sep 17 00:00:00 2001 From: Andrii Volkov <60794004+volkovskey@users.noreply.github.com> Date: Fri, 16 Oct 2026 12:24:37 +0300 Subject: [PATCH 068/817] perf(render): work out paint bounds once per render Culling a layer asked for its paint bounds, which walk its whole subtree, and then did the same for each child: every layer's subtree was walked again at each level above it, and once more in each parallel band. The bounds worked out during a render are now kept for it (layers with children only; bounds the 64-level cap cut short are not kept, and kept ones are read only where their levels still fit under the cap, so culling is exactly as before). Every render also looked through every layer of the document for the largest background blur, to size the overlap of its bands: 900 000 layers on one large file, on the main thread before the bands start. The document now works it out when first asked after a change, like whether it has masks. A 1440x900 render on a 900 000-layer file, page of 118 358 layers: at 100% 13.0 -> 0.6 ms, at 25% 16.5 -> 3.4 ms, fitted to the page 56 -> 31 ms; page of 246 204 layers: 12.6 -> 2.5 ms, 12.1 -> 2.0 ms, 69 -> 62 ms. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YQxjkNSUJhTkTfY74aNeki --- crates/doc/src/lib.rs | 13 ++++-- crates/render/src/bounds_memo_tests.rs | 58 +++++++++++++++++++++++ crates/render/src/draw.rs | 65 ++++++++++++++++++++------ crates/render/src/lib.rs | 8 +++- crates/render/src/lod_tests.rs | 2 + crates/render/src/pattern.rs | 4 +- 6 files changed, 132 insertions(+), 18 deletions(-) create mode 100644 crates/render/src/bounds_memo_tests.rs diff --git a/crates/doc/src/lib.rs b/crates/doc/src/lib.rs index 71c6da393..a757a6af2 100644 --- a/crates/doc/src/lib.rs +++ b/crates/doc/src/lib.rs @@ -77,17 +77,19 @@ pub enum DocError { pub type DocResult = Result; -/// The set of touched node ids, and whether any layer is a mask (worked out when first asked -/// after a change: hit testing skips its mask checks without one). Never part of equality or +/// The set of touched node ids, whether any layer is a mask (hit testing skips its mask checks +/// without one) and the largest background blur radius (renders keep that much overlap between +/// their bands), both worked out when first asked after a change. Never part of equality or /// serialisation. #[derive(Clone, Debug, Default)] -pub struct Dirty(pub std::collections::BTreeSet, std::sync::OnceLock); +pub struct Dirty(pub std::collections::BTreeSet, std::sync::OnceLock, std::sync::OnceLock); impl Dirty { /// Record node `id` as touched (edited, added or removed). fn touch(&mut self, id: NodeId) { self.0.insert(id); self.1 = std::sync::OnceLock::new(); + self.2 = std::sync::OnceLock::new(); } } @@ -254,6 +256,11 @@ impl Document { *self.dirty.1.get_or_init(|| self.nodes.values().any(|n| n.is_mask)) } + /// The largest background blur or glass radius of any layer's effects (0 without any). + pub fn max_backdrop_radius(&self) -> f64 { + *self.dirty.2.get_or_init(|| self.nodes.values().flat_map(|n| n.effects.iter()).map(Effect::backdrop_radius).fold(0.0, f64::max)) + } + /// Node ids touched so far (without clearing). pub fn dirty(&self) -> &std::collections::BTreeSet { &self.dirty.0 diff --git a/crates/render/src/bounds_memo_tests.rs b/crates/render/src/bounds_memo_tests.rs new file mode 100644 index 000000000..d8539807e --- /dev/null +++ b/crates/render/src/bounds_memo_tests.rs @@ -0,0 +1,58 @@ +//! Paint bounds worked out once per render: the bounds kept for a layer are the ones worked out +//! without keeping any, and the largest background blur follows the document's edits. + +use super::*; +use figcraft_doc::{Effect, EffectKind}; + +#[test] +fn kept_paint_bounds_are_the_bounds_worked_out_afresh() { + // Unclipped frames nested past the 64-level walk, a rectangle at the bottom: bounds asked for + // deep first and then from the top, and the other way round, are those worked out alone. + let mut d = Document::new("deep"); + let p = d.first_page().unwrap(); + let mut chain = Vec::new(); + let mut parent = p; + for k in 0..80 { + let f = d.create(parent, NodeKind::Frame, &format!("F{k}"), 1.0, 1.0, 10.0, 10.0).unwrap(); + d.node_mut(f).unwrap().clip = false; + chain.push(f); + parent = f; + } + d.create(parent, NodeKind::Rectangle, "R", 500.0, 0.0, 10.0, 10.0).unwrap(); + for order in [chain.iter().rev().copied().collect::>(), chain.clone()] { + let memo = draw::Bounds::default(); + for id in &order { + let n = d.node(*id).unwrap(); + for depth in [0, 20] { + let kept = draw::bounds_within(&d, n, depth, None, Some(&memo)).0; + assert_eq!(kept, draw::local_paint_bounds(&d, n, depth, None), "{} at depth {depth}", n.name); + } + } + } +} + +#[test] +fn the_largest_background_blur_follows_edits() { + let mut d = Document::new("blur"); + let p = d.first_page().unwrap(); + let r = d.create(p, NodeKind::Rectangle, "R", 0.0, 0.0, 10.0, 10.0).unwrap(); + assert_eq!(max_backdrop_blur(&d), 0.0); + let mut blur = Effect::background_blur(); + if let EffectKind::BackgroundBlur(b) = &mut blur.kind { + b.radius = 12.0; + } + d.node_mut(r).unwrap().effects.push(blur); + assert_eq!(max_backdrop_blur(&d), 12.0); + // A copy of the document keeps it, and an edit of the copy changes only the copy's. + let mut copy = d.clone(); + if let Some(EffectKind::BackgroundBlur(b)) = copy.node_mut(r).unwrap().effects.first_mut().map(|e| &mut e.kind) { + b.radius = 30.0; + } + assert_eq!(max_backdrop_blur(©), 30.0); + assert_eq!(max_backdrop_blur(&d), 12.0); + copy.node_mut(r).unwrap().effects.clear(); + assert_eq!(max_backdrop_blur(©), 0.0); + // A deleted layer's blur no longer counts. + d.remove(r).unwrap(); + assert_eq!(max_backdrop_blur(&d), 0.0); +} diff --git a/crates/render/src/draw.rs b/crates/render/src/draw.rs index 7bfafd33b..0d53f3902 100644 --- a/crates/render/src/draw.rs +++ b/crates/render/src/draw.rs @@ -33,8 +33,22 @@ pub struct Ctx<'a> { pub under: Option<&'a Under<'a>>, /// Seconds into animated GIFs (0: their first frame; only the presenter plays them). pub time: f64, + /// Paint bounds already worked out in this render. + pub bounds: &'a Bounds, } +/// The local paint bounds worked out during one render, by node and greeking scale. Culling asks +/// for a node's bounds and then for each of its children's, so without them every layer's subtree +/// was walked again at each level above it. +#[derive(Default)] +pub struct Bounds(std::cell::RefCell>); + +/// A layer, and the scale its text is greeked at (none: drawn in full). +type BoundsKey = (NodeId, Option); + +/// Deepest nesting the paint bounds walk follows. +const MAX_BOUNDS_DEPTH: usize = 64; + pub fn ts_transform(a: Affine) -> Transform { let c = a.as_coeffs(); Transform::from_row(c[0] as f32, c[1] as f32, c[2] as f32, c[3] as f32, c[4] as f32, c[5] as f32) @@ -279,32 +293,57 @@ fn text_box_bounds(n: &Node) -> Rect { /// Local bounds a node paints into (its box grown by stroke/effect reach, plus unclipped children). /// Text that overflows its box counts where its glyphs are, so it isn't culled while visible; /// text greeked at `greek_scale` (see [`lod::greeked`]) paints only inside [`text_box_bounds`]. -fn local_paint_bounds(doc: &Document, n: &Node, depth: usize, greek_scale: Option) -> Rect { +pub(crate) fn local_paint_bounds(doc: &Document, n: &Node, depth: usize, greek_scale: Option) -> Rect { + bounds_within(doc, n, depth, greek_scale, None).0 +} + +/// [`local_paint_bounds`], kept in and read from `memo` when there is one. Also returns how many +/// levels the walk went down, or `None` when the nesting cap cut it short: such bounds depend on +/// the depth they were asked at and aren't kept, and kept bounds are read only where their levels +/// still fit under the cap. +pub(crate) fn bounds_within(doc: &Document, n: &Node, depth: usize, greek_scale: Option, memo: Option<&Bounds>) -> (Rect, Option) { + // A layer without children is quicker to work out again than to look up. + let memo = memo.filter(|_| !n.children.is_empty()); + let key = (n.id, greek_scale.map(f64::to_bits)); + if let Some((r, levels)) = memo.and_then(|m| m.0.borrow().get(&key).copied()) + && depth + levels <= MAX_BOUNDS_DEPTH + { + return (r, Some(levels)); + } let reach = n.paint_reach(); let mut r = n.local_rect().inflate(reach, reach); + let mut levels = Some(0); let clips = n.clip && n.kind.is_frame_like(); - if (!clips || n.kind.bounds_follow_children()) && depth < 64 && !n.hides_contents() { - for c in n.children.iter().filter_map(|c| doc.node(*c)) { - if !c.visible { - continue; + if (!clips || n.kind.bounds_follow_children()) && !n.hides_contents() { + if depth < MAX_BOUNDS_DEPTH { + let mut below = Some(0); + for c in n.children.iter().filter_map(|c| doc.node(*c)) { + if !c.visible { + continue; + } + let (cb, c_levels) = bounds_within(doc, c, depth + 1, greek_scale, memo); + below = below.zip(c_levels).map(|(b, l)| b.max(l)); + r = r.union(figcraft_geom::transform_rect_bbox(c.transform, cb)); } - let cb = local_paint_bounds(doc, c, depth + 1, greek_scale); - r = r.union(figcraft_geom::transform_rect_bbox(c.transform, cb)); + levels = below.map(|b| b + 1); + } else if !n.children.is_empty() { + levels = None; } } // Text can overflow its box. if let NodeKind::Text(_) = n.kind { r = r.union(text_box_bounds(n).inflate(reach, reach)); - if greek_scale.is_some_and(|s| lod::greeked(n, s)) { - return r; - } - if let Some((l, dy)) = figcraft_text::layout_node(n) + if !greek_scale.is_some_and(|s| lod::greeked(n, s)) + && let Some((l, dy)) = figcraft_text::layout_node(n) && let Some(ink) = l.ink_bounds() { r = r.union(ink + figcraft_geom::kurbo::Vec2::new(0.0, dy)); } } - r + if let (Some(m), Some(l)) = (memo, levels) { + m.0.borrow_mut().insert(key, (r, l)); + } + (r, levels) } /// How far (document units) effects that read outside a node's paint bounds reach: blurs, glass, @@ -385,7 +424,7 @@ pub fn draw_node(ctx: &Ctx, pix: &mut Pixmap, id: NodeId, parent_xf: Affine, dep } let xf = parent_xf * n.transform; let (pw, ph) = (pix.width(), pix.height()); - let local = local_paint_bounds(ctx.doc, n, 0, ctx.lod.then_some(ctx.scale)); + let local = bounds_within(ctx.doc, n, 0, ctx.lod.then_some(ctx.scale), Some(ctx.bounds)).0; let dev = device_rect(xf, local); // Effects that read outside (blur) need a margin when culling. Absurd effects (a spread or // blur of millions of pixels) keep a sane layer: what lies further off reads as empty. diff --git a/crates/render/src/lib.rs b/crates/render/src/lib.rs index 9969a597d..2a9110766 100644 --- a/crates/render/src/lib.rs +++ b/crates/render/src/lib.rs @@ -90,7 +90,7 @@ fn new_pixmap(w: u32, h: u32) -> Option { /// The largest backdrop radius (background blur, glass: see [`figcraft_doc::Effect::backdrop_radius`]) /// in the document (0 without any). pub(crate) fn max_backdrop_blur(doc: &Document) -> f64 { - doc.nodes().flat_map(|n| n.effects.iter()).map(figcraft_doc::Effect::backdrop_radius).fold(0.0, f64::max) + doc.max_backdrop_radius() } /// How far (device pixels) a background blur of `radius` reads its backdrop at `scale`. @@ -170,6 +170,7 @@ pub fn render_view_single(doc: &Document, page: NodeId, view: &View, opts: &Opti pix.fill(paint::ts_color(bg)); } let lod = opts.lod && !opts.outline_mode && view.scale <= lod::MAX_SCALE; + let bounds = draw::Bounds::default(); let ctx = draw::Ctx { doc, scale: view.scale, @@ -180,6 +181,7 @@ pub fn render_view_single(doc: &Document, page: NodeId, view: &View, opts: &Opti lod, under: None, time: 0.0, + bounds: &bounds, }; let xf = view.transform(); let Some(p) = doc.node(page) else { return Some(pix) }; @@ -201,6 +203,7 @@ pub fn render_nodes_into(doc: &Document, ids: &[NodeId], view: &View, pix: &mut /// [`render_nodes_into`] `time` seconds into animated GIFs. fn nodes_into(doc: &Document, ids: &[NodeId], view: &View, pix: &mut Pixmap, time: f64) { + let bounds = draw::Bounds::default(); let ctx = draw::Ctx { doc, scale: view.scale, @@ -211,6 +214,7 @@ fn nodes_into(doc: &Document, ids: &[NodeId], view: &View, pix: &mut Pixmap, tim lod: false, under: None, time, + bounds: &bounds, }; for id in ids { draw::draw_node(&ctx, pix, *id, view.transform() * parent_transform(doc, *id), 0); @@ -434,6 +438,8 @@ mod band_tests; #[cfg(test)] mod boolean_cache_tests; #[cfg(test)] +mod bounds_memo_tests; +#[cfg(test)] mod effect_order_tests; #[cfg(test)] mod effects_behaviour_tests; diff --git a/crates/render/src/lod_tests.rs b/crates/render/src/lod_tests.rs index de8b52b40..a573ee7cc 100644 --- a/crates/render/src/lod_tests.rs +++ b/crates/render/src/lod_tests.rs @@ -154,6 +154,7 @@ fn exports_never_use_lod() { crate::render_nodes_into(&d, &[card], &v, &mut exact); assert_eq!(png.data(), exact.data()); let mut preview = Pixmap::new(v.width, v.height).unwrap(); + let bounds = crate::draw::Bounds::default(); let ctx = crate::draw::Ctx { doc: &d, scale, @@ -164,6 +165,7 @@ fn exports_never_use_lod() { lod: true, under: None, time: 0.0, + bounds: &bounds, }; let parent = d.world_transform(p); crate::draw::draw_node(&ctx, &mut preview, card, v.transform() * parent, 0); diff --git a/crates/render/src/pattern.rs b/crates/render/src/pattern.rs index bfcf8e328..2489766cd 100644 --- a/crates/render/src/pattern.rs +++ b/crates/render/src/pattern.rs @@ -9,7 +9,7 @@ use figcraft_doc::{Document, NodeId}; use figcraft_geom::Affine; use tiny_skia::{FilterQuality, Pixmap, SpreadMode, Transform}; -use crate::draw::{Ctx, draw_node}; +use crate::draw::{Bounds, Ctx, draw_node}; use crate::paint::Prepared; /// The largest side of a cell's pixmap; a cell showing larger is drawn coarser. @@ -46,6 +46,7 @@ pub fn cell_pixmap(doc: &Document, pt: &PatternPaint, w: f64, h: f64, scale: f64 let (pw, ph) = ((cell.size.0 * k).ceil().clamp(1.0, MAX_CELL_PX), (cell.size.1 * k).ceil().clamp(1.0, MAX_CELL_PX)); let (kx, ky) = (pw / cell.size.0, ph / cell.size.1); let mut pix = Pixmap::new(pw as u32, ph as u32)?; + let bounds = Bounds::default(); let ctx = Ctx { doc, scale: kx.max(ky) * cell.scale, @@ -56,6 +57,7 @@ pub fn cell_pixmap(doc: &Document, pt: &PatternPaint, w: f64, h: f64, scale: f64 lod: false, under: None, time, + bounds: &bounds, }; let unrotated = src.transform.inverse(); nested(|| { From be3912f9868726e195c1fe9e3478405065e30386 Mon Sep 17 00:00:00 2001 From: Yarila Date: Fri, 16 Oct 2026 15:05:13 +0500 Subject: [PATCH 069/817] M7: Reflow presenter device screens and simplify tablet and desktop previews --- ROADMAP.md | 3 +- crates/ui-egui/src/present.rs | 96 +++++++++++++++++++++++++++++++++-- docs/gaps.md | 7 ++- 3 files changed, 101 insertions(+), 5 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 254395172..b54a43ec4 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (presenter tab, device picker and thumbnail; bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (responsive presenter device sizing, bare tablet and computer screens; presenter tab, device picker and thumbnail; bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -313,6 +313,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-16 | minor | Choosing a device in the presenter now enables responsive layout at that device's screen size, clears offsets from the previous screen, and lets No device restore the design's frame size. Tablet and computer presets show a bare screen at their resolution; phones keep their device body. The saved frame geometry is unchanged. Numbers unchanged. | | 2026-10-15 | minor | Presenter has a separate tab, keeps its current screen when returning to design, and adds a frame thumbnail, device picker and scale controls. Numbers unchanged. | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | | 2026-10-15 | minor | Drop files anywhere to open them (M7): dragging files over the window shows a "Drop to open" (home) or "Drop to import" (canvas) overlay. On the home screen each supported file opens as a document of its own and other files are turned away with a toast; on the canvas the files import at the drop point. Both wait behind a small card that is on screen before a large file blocks the window. A canvas import stays with the document and page that received the drop even if the tab or page changes meanwhile, and is cancelled with a message if that document or page is gone. Numbers unchanged. | diff --git a/crates/ui-egui/src/present.rs b/crates/ui-egui/src/present.rs index bb6115884..9fc85337c 100644 --- a/crates/ui-egui/src/present.rs +++ b/crates/ui-egui/src/present.rs @@ -393,6 +393,18 @@ impl Presenter { self.stop_scrolling(); } + /// A new device changes the viewport and may relayout every frame. Start at its top instead + /// of carrying scroll offsets or a drag from the old screen into the new one. + fn reset_for_device(&mut self) { + self.pan = None; + self.scroll.clear(); + self.scroll_anim = None; + self.press = None; + self.dragged = false; + self.stop_scrolling(); + self.rev += 1; + } + /// The current offset of `t` (a frame's scroll, else the view's pan). fn offset(&self, t: Scroller) -> (f64, f64) { match t { @@ -1523,6 +1535,11 @@ fn body_outset(device: &str, size: Vec2, landscape: bool) -> (f32, f32, f32) { } } +/// Tablet and computer presets size the screen without drawing a hardware shell around it. +fn has_device_body(device: Device) -> bool { + !device.name.starts_with("iPad") && !matches!(device.name, "MacBook Air" | "Desktop") +} + /// Place the presented frame in `area`: on its device's screen (the whole device sized by the /// view's scale option), else the frame itself. Fit and 100% keep the chrome's padding from the /// edges; Fit never goes above 100%. What doesn't fit the window pans (`Presenter::pan`). The @@ -1538,7 +1555,7 @@ fn layout(p: &mut Presenter, area: Rect, chrome: Chrome) -> Option { let fb = disp.world_bounds(p.current)?; let view = if chrome.pane { PresentView::default() } else { p.view }; // Custom sizes are just a screen: no body. - let body = device.filter(|d| view.device_frame && !d.colors.is_empty()); + let body = device.filter(|d| view.device_frame && has_device_body(*d) && !d.colors.is_empty()); let pad = if !fills && matches!(view.scale, PresentScale::Fit | PresentScale::Actual) { chrome.pad } else { 0.0 }; let avail = area.shrink(pad); let (sw, sh) = device.map_or((fb.width(), fb.height()), |d| (d.width, d.height)); @@ -1684,7 +1701,7 @@ pub fn show(app: &mut FigApp, ui: &mut Ui) { app.run("proto.settings", json!({"responsive": on})); } if let Some(device) = picked_device { - app.run("proto.settings", json!({"device": device})); + choose_device(app, &mut pres, &device); } if action == Some(BarAction::Close) || ctx.input(|i| i.key_pressed(egui::Key::Escape)) { app.ui.present_uid = None; @@ -1693,6 +1710,15 @@ pub fn show(app: &mut FigApp, ui: &mut Ui) { app.ui.present = Some(pres); } +/// Device choices in the presenter use the screen's real dimensions and reflow a copy of the +/// design through constraints and auto layout. "No device" returns to the original frame size. +fn choose_device(app: &mut FigApp, p: &mut Presenter, device: &str) { + let responsive = device != "None"; + if app.run("proto.settings", json!({"device": device, "responsive": responsive})).is_some() { + p.reset_for_device(); + } +} + /// Controls that stay in reach while viewing a prototype, including screen stepping, device and /// scale. The selected device is returned to the caller so it can go through the normal document /// command (and undo/save) rather than changing only the player's copy. @@ -2320,7 +2346,7 @@ fn options_menu(p: &mut Presenter, ui: &mut Ui, device: Option, responsi } ui.separator(); } - if device.is_some_and(|d| !d.colors.is_empty()) && menu_check(ui, p.view.device_frame, tr("Show device frame"), "") { + if device.is_some_and(|d| has_device_body(d) && !d.colors.is_empty()) && menu_check(ui, p.view.device_frame, tr("Show device frame"), "") { p.view.device_frame = !p.view.device_frame; ui.close(); } @@ -2815,6 +2841,70 @@ mod tests { use super::*; use figcraft_doc::NodeKind; + use crate::present_tests::{Ui, id}; + + #[test] + fn device_picker_reflows_without_resizing_the_saved_frame_and_can_revert() { + let mut session = figcraft_engine::Session::new(); + let frame = id(&session.execute("node.create", &json!({"type": "frame", "width": 894, "height": 844})).unwrap()); + let right = id(&session + .execute("node.create", &json!({"type": "rectangle", "parent": frame, "x": 804, "y": 20, "width": 80, "height": 40})) + .unwrap()); + session.execute("node.set", &json!({"id": right, "props": {"constraints": {"horizontal": "right", "vertical": "top"}}})).unwrap(); + let mut ui = Ui::new(session); + ui.run("proto.present", json!({"start": frame})); + + let mut presenter = ui.app.ui.present.take().unwrap(); + presenter.pan = Some((100.0, 200.0)); + presenter.scroll.insert(frame, (75.0, 50.0)); + choose_device(&mut ui.app, &mut presenter, "iPhone 17"); + assert!(presenter.pan.is_none() && presenter.scroll.is_empty()); + ui.app.ui.present = Some(presenter); + ui.frame(vec![]); + + let shown = &ui.app.ui.present.as_ref().unwrap().doc.as_ref().unwrap(); + assert_eq!((shown.node(frame).unwrap().width, shown.node(frame).unwrap().height), (402.0, 874.0)); + assert_eq!(shown.world_bounds(right).unwrap().x0, 312.0, "right constraint follows the phone edge"); + assert_eq!(ui.app.inspect()["presenter"]["viewport"], json!([402.0, 874.0])); + assert_eq!(ui.app.inspect()["presenter"]["scrollRange"], json!([0.0, 0.0])); + assert_eq!(ui.app.session.doc().unwrap().node(frame).unwrap().width, 894.0, "the saved design keeps its geometry"); + + let mut presenter = ui.app.ui.present.take().unwrap(); + choose_device(&mut ui.app, &mut presenter, "None"); + ui.app.ui.present = Some(presenter); + ui.frame(vec![]); + assert_eq!(ui.app.inspect()["presenter"]["frameSize"], json!([894.0, 844.0])); + assert_eq!(ui.app.inspect()["presenter"]["responsive"], Value::Null); + } + + #[test] + fn tablet_and_computer_presets_show_only_their_screen_at_the_real_resolution() { + let mut session = figcraft_engine::Session::new(); + let frame = id(&session.execute("node.create", &json!({"type": "frame", "width": 894, "height": 844})).unwrap()); + let mut ui = Ui::new(session); + ui.run("proto.present", json!({"start": frame})); + let area = Rect::from_min_max(pos2(0.0, 40.0), pos2(1440.0, 860.0)); + + for (name, width, height, body) in [ + ("iPad mini", 744.0, 1133.0, false), + ("MacBook Air", 1280.0, 832.0, false), + ("Desktop", 1440.0, 1024.0, false), + ("iPhone 17", 402.0, 874.0, true), + ] { + let mut presenter = ui.app.ui.present.take().unwrap(); + choose_device(&mut ui.app, &mut presenter, name); + ui.app.ui.present = Some(presenter); + ui.frame(vec![]); + + let presenter = ui.app.ui.present.as_mut().unwrap(); + let laid = layout(presenter, area, FULL).unwrap(); + assert_eq!(laid.color.is_some(), body, "{name}: body visibility"); + assert!((f64::from(laid.screen.width()) / laid.scale - width).abs() < 0.1, "{name}: width"); + assert!((f64::from(laid.screen.height()) / laid.scale - height).abs() < 0.1, "{name}: height"); + assert_eq!(ui.app.session.doc().unwrap().node(frame).unwrap().width, 894.0); + } + } + fn doc_with_two_frames() -> (Document, NodeId, NodeId) { let mut d = Document::new("t"); let page = d.add_page("Page 1"); diff --git a/docs/gaps.md b/docs/gaps.md index 95962a5c3..1e2cd1140 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Where FigCraft falls short of Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-15 · **Change:** minor (presenter navigation and device controls; bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (responsive presenter device sizing and bare tablet and computer screens; presenter navigation and device controls; bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) Every known shortfall against Figma, one entry each, ranked by how much it stops a Figma user from doing real work in FigCraft. Agents: pick work from the top unless the owner says otherwise. The @@ -141,6 +141,10 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe - **Landed (2026-10-15):** presentation keeps its own tab beside the design, preserves the current screen when switching back to edit, shows a small current-screen preview and offers screen, device and scale controls (`present_view_tests`). +- **Landed (2026-10-16):** choosing a presenter device reflows a copy of the frame to its screen + size using constraints and auto layout, clears the previous screen's scroll and pan, and keeps + the file's frame geometry unchanged; No device restores the original size. Tablet and computer + presets show the screen at their resolution without a drawn hardware body. - **Evidence:** ROADMAP item 7 ("Left: tool by tool, panel by panel against the incumbent"). - **Impact:** Figma users notice the feel within minutes; it decides whether they stay. - **Estimate:** 40–60 h. Detail in [`ui-parity.md`](ui-parity.md). @@ -403,6 +407,7 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe | Date | Change | Summary | |---|---|---| +| 2026-10-16 | minor | Gap 4: presenter device selection now uses responsive layout at the selected screen size and resets stale offsets; tablets and computers show bare screens, and the original frame is preserved. Estimates and ranking unchanged. | | 2026-10-15 | minor | Gap 4: presenter tab, thumbnail, device picker and scale controls. Estimates and ranking unchanged. | | 2026-10-15 | minor | Gap 7: bounded canvas overscan for smoother panning. Estimates and ranking unchanged. | | 2026-10-14 | minor | Russian catalog (M9), reviewed and approved by VanTan: all 2,165 current entries, Русский in Preferences and regional ru tags. Russian integer plurals use one/few/many; contributor display name VanTan added. Existing estimates unchanged. | From 52eb736241b7b1d33c4c24b2dc2e93cf54928230 Mon Sep 17 00:00:00 2001 From: Andrii Volkov <60794004+volkovskey@users.noreply.github.com> Date: Fri, 16 Oct 2026 13:20:53 +0300 Subject: [PATCH 070/817] perf(render): look each layer up once per render Node lookups in the document's B-tree were still a third of a render on a 900 000-layer file: a small subtree was walked for its bounds, again to see whether it could be splatted, and again to splat it, and each child of a drawn layer was looked up by paint_runs, by the mask check and by draw_node. - The render's table also keeps the layers it looked up, keyed with a multiply hash instead of SipHash (ids are counters), and so do the bounds it keeps. - draw_children looks each child up once, works out the paint runs from those (Document::paint_runs_of) and draws the child it has. - Whether a layer can be splatted is kept like its bounds: layers with children only, answers the nesting cap decided aren't kept, and kept answers are read only where their levels fit under the cap. Ctx gets a second lifetime, for the document the kept layers come from. Single-threaded cycles per 1440x900 render fitted to the page: 0.39 -> 0.34 G on a page of 246 204 layers, 0.26 -> 0.22 G on one of 118 358. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YQxjkNSUJhTkTfY74aNeki --- crates/doc/src/lib.rs | 12 +++- crates/render/src/bounds_memo_tests.rs | 34 +++++++++ crates/render/src/draw.rs | 95 +++++++++++++++++++++----- crates/render/src/lod.rs | 39 +++++++++-- 4 files changed, 155 insertions(+), 25 deletions(-) diff --git a/crates/doc/src/lib.rs b/crates/doc/src/lib.rs index a757a6af2..07700e8ce 100644 --- a/crates/doc/src/lib.rs +++ b/crates/doc/src/lib.rs @@ -1124,8 +1124,14 @@ impl Document { /// mask with the layers above it up to the next mask, or a single layer. An auto layout frame /// whose first child paints on top paints the runs in reverse (see [`Node::paint_order`]). pub fn paint_runs(&self, n: &Node) -> Vec> { - let kids = &n.children; - let node = |i: usize| kids.get(i).and_then(|k| self.node(*k)); + let kids: Vec> = n.children.iter().map(|k| self.node(*k)).collect(); + Self::paint_runs_of(&kids, n.layout.as_ref().is_some_and(|l| l.reverse_z)) + } + + /// [`Self::paint_runs`] of children already looked up (`None`: not in the document), last run + /// first when `reverse_z`. + pub fn paint_runs_of(kids: &[Option<&Node>], reverse_z: bool) -> Vec> { + let node = |i: usize| kids.get(i).copied().flatten(); let mut runs = Vec::new(); let mut i = 0; while i < kids.len() { @@ -1138,7 +1144,7 @@ impl Document { runs.push(i..j); i = j; } - if n.layout.as_ref().is_some_and(|l| l.reverse_z) { + if reverse_z { runs.reverse(); } runs diff --git a/crates/render/src/bounds_memo_tests.rs b/crates/render/src/bounds_memo_tests.rs index d8539807e..4d0b305b4 100644 --- a/crates/render/src/bounds_memo_tests.rs +++ b/crates/render/src/bounds_memo_tests.rs @@ -56,3 +56,37 @@ fn the_largest_background_blur_follows_edits() { d.remove(r).unwrap(); assert_eq!(max_backdrop_blur(&d), 0.0); } + +#[test] +fn kept_splat_answers_are_the_answers_worked_out_afresh() { + use figcraft_color::{ImageScaleMode, Paint}; + // Groups nested past the 64-level walk, with an image-filled rectangle at the bottom of one + // branch and a plain one at the bottom of the other: answers asked for deep-first and + // top-first, at depths 0 and 20, are those worked out alone. + let mut d = Document::new("deep"); + let p = d.first_page().unwrap(); + let mut chain = Vec::new(); + for image in [false, true] { + let mut parent = p; + for k in 0..80 { + let g = d.create(parent, NodeKind::Frame, &format!("{image} {k}"), 0.0, 0.0, 10.0, 10.0).unwrap(); + d.node_mut(g).unwrap().clip = false; + chain.push(g); + parent = g; + } + let r = d.create(parent, NodeKind::Rectangle, "R", 0.0, 0.0, 10.0, 10.0).unwrap(); + if image { + d.node_mut(r).unwrap().fills = vec![Paint::image("missing", ImageScaleMode::Fill)]; + } + } + for order in [chain.iter().rev().copied().collect::>(), chain.clone()] { + let memo = draw::Bounds::default(); + for id in &order { + let n = d.node(*id).unwrap(); + for depth in [0, 20] { + let kept = lod::splattable_within(&d, n, depth, Some(&memo)).0; + assert_eq!(kept, lod::splattable(&d, n, depth), "{} at depth {depth}", n.name); + } + } + } +} diff --git a/crates/render/src/draw.rs b/crates/render/src/draw.rs index 0d53f3902..b1a81a56e 100644 --- a/crates/render/src/draw.rs +++ b/crates/render/src/draw.rs @@ -16,8 +16,9 @@ use crate::{blur, grain, lod, shadow}; /// Shared state for one render. #[derive(Clone, Copy)] -pub struct Ctx<'a> { - pub doc: &'a Document, +/// `'d`: the document's (layers looked up for the render are kept that long), `'a`: the rest. +pub struct Ctx<'a, 'd> { + pub doc: &'d Document, /// Device pixels per document unit (for effect radii). pub scale: f64, pub outline_mode: bool, @@ -34,14 +35,59 @@ pub struct Ctx<'a> { /// Seconds into animated GIFs (0: their first frame; only the presenter plays them). pub time: f64, /// Paint bounds already worked out in this render. - pub bounds: &'a Bounds, + pub bounds: &'a Bounds<'d>, } -/// The local paint bounds worked out during one render, by node and greeking scale. Culling asks -/// for a node's bounds and then for each of its children's, so without them every layer's subtree -/// was walked again at each level above it. +/// What one render works out about layers with children, which a walk down their subtree finds: +/// their local paint bounds by greeking scale, and whether they can be splatted (see +/// [`lod::splattable`]). Culling asks for a node's and then for each of its children's, so without +/// them every layer's subtree was walked again at each level above it. Each answer keeps how many +/// levels its walk went down. +/// It also keeps the layers it looked up: the walks for culling, splatting and drawing go down the +/// same layers, and in a large document a lookup is a good part of a layer's cost. #[derive(Default)] -pub struct Bounds(std::cell::RefCell>); +pub struct Bounds<'a> { + paint: std::cell::RefCell>, + pub(crate) splat: std::cell::RefCell>, + nodes: std::cell::RefCell>>, +} + +impl<'a> Bounds<'a> { + /// Node `id` of `doc`, looked up once for the render. + pub(crate) fn node(&self, doc: &'a Document, id: NodeId) -> Option<&'a Node> { + if let Some(n) = self.nodes.borrow().get(&id) { + return *n; + } + let n = doc.node(id); + self.nodes.borrow_mut().insert(id, n); + n + } +} + +/// A hash map keyed by node ids, which need no SipHash: they are counters (or a peer's range of +/// them), and SipHash took a good part of a render. +type IdMap = HashMap>; + +/// Mixes each word in with a multiply (Fibonacci hashing), so ids that differ in low bits spread. +#[derive(Default)] +pub(crate) struct IdHash(u64); + +impl Hasher for IdHash { + fn finish(&self) -> u64 { + self.0 + } + fn write(&mut self, bytes: &[u8]) { + for b in bytes { + self.write_u64(u64::from(*b)); + } + } + fn write_u64(&mut self, v: u64) { + self.0 = (self.0.rotate_left(5) ^ v).wrapping_mul(0x9E37_79B9_7F4A_7C15); + } + fn write_usize(&mut self, v: usize) { + self.write_u64(v as u64); + } +} /// A layer, and the scale its text is greeked at (none: drawn in full). type BoundsKey = (NodeId, Option); @@ -301,11 +347,17 @@ pub(crate) fn local_paint_bounds(doc: &Document, n: &Node, depth: usize, greek_s /// levels the walk went down, or `None` when the nesting cap cut it short: such bounds depend on /// the depth they were asked at and aren't kept, and kept bounds are read only where their levels /// still fit under the cap. -pub(crate) fn bounds_within(doc: &Document, n: &Node, depth: usize, greek_scale: Option, memo: Option<&Bounds>) -> (Rect, Option) { +pub(crate) fn bounds_within<'a>( + doc: &'a Document, + n: &Node, + depth: usize, + greek_scale: Option, + memo: Option<&Bounds<'a>>, +) -> (Rect, Option) { // A layer without children is quicker to work out again than to look up. let memo = memo.filter(|_| !n.children.is_empty()); let key = (n.id, greek_scale.map(f64::to_bits)); - if let Some((r, levels)) = memo.and_then(|m| m.0.borrow().get(&key).copied()) + if let Some((r, levels)) = memo.and_then(|m| m.paint.borrow().get(&key).copied()) && depth + levels <= MAX_BOUNDS_DEPTH { return (r, Some(levels)); @@ -317,7 +369,7 @@ pub(crate) fn bounds_within(doc: &Document, n: &Node, depth: usize, greek_scale: if (!clips || n.kind.bounds_follow_children()) && !n.hides_contents() { if depth < MAX_BOUNDS_DEPTH { let mut below = Some(0); - for c in n.children.iter().filter_map(|c| doc.node(*c)) { + for c in n.children.iter().filter_map(|c| memo.map_or_else(|| doc.node(*c), |m| m.node(doc, *c))) { if !c.visible { continue; } @@ -341,7 +393,7 @@ pub(crate) fn bounds_within(doc: &Document, n: &Node, depth: usize, greek_scale: } } if let (Some(m), Some(l)) = (memo, levels) { - m.0.borrow_mut().insert(key, (r, l)); + m.paint.borrow_mut().insert(key, (r, l)); } (r, levels) } @@ -406,10 +458,17 @@ const MAX_EFFECT_MARGIN_PX: f64 = 2048.0; /// Draw node `id` onto `pix`, where `parent_xf` maps the parent's space to `pix` pixels. pub fn draw_node(ctx: &Ctx, pix: &mut Pixmap, id: NodeId, parent_xf: Affine, depth: usize) { + if let Some(n) = ctx.doc.node(id) { + draw_layer(ctx, pix, n, parent_xf, depth); + } +} + +/// [`draw_node`] for a node already looked up. +fn draw_layer(ctx: &Ctx, pix: &mut Pixmap, n: &Node, parent_xf: Affine, depth: usize) { + let id = n.id; if depth > crate::MAX_EXPORT_DEPTH || ctx.skip.contains(&id) { return; } - let Some(n) = ctx.doc.node(id) else { return }; let outline = ctx.outline_mode || ctx.outlined.contains(&id); if n.is_mask || n.opacity <= 0.0 && n.visible { return; @@ -437,7 +496,7 @@ pub fn draw_node(ctx: &Ctx, pix: &mut Pixmap, id: NodeId, parent_xf: Affine, dep draw_outline(&Ctx { outline_mode: true, ..*ctx }, pix, n, xf, depth); return; } - if ctx.lod && dev.width().max(dev.height()) < lod::TINY_PX && lod::splattable(ctx.doc, n, 0) { + if ctx.lod && dev.width().max(dev.height()) < lod::TINY_PX && lod::splattable_within(ctx.doc, n, 0, Some(ctx.bounds)).0 { lod::splat_subtree(ctx, pix, n, xf, None, 1.0, depth); return; } @@ -711,13 +770,15 @@ fn draw_content(ctx: &Ctx, pix: &mut Pixmap, n: &Node, xf: Affine, depth: usize, fn draw_children(ctx: &Ctx, pix: &mut Pixmap, n: &Node, xf: Affine, depth: usize) { let kids = &n.children; - for run in ctx.doc.paint_runs(n) { - let Some(&c) = kids.get(run.start) else { continue }; - if ctx.doc.node(c).is_some_and(|cn| cn.is_mask && cn.visible) { + // Each child looked up once: in a large document a lookup is a good part of a layer's cost. + let nodes: Vec> = kids.iter().map(|c| ctx.bounds.node(ctx.doc, *c)).collect(); + for run in Document::paint_runs_of(&nodes, n.layout.as_ref().is_some_and(|l| l.reverse_z)) { + let (Some(&c), Some(Some(cn))) = (kids.get(run.start), nodes.get(run.start)) else { continue }; + if cn.is_mask && cn.visible { // Everything above the mask (until the next mask) is clipped by its alpha. draw_masked(ctx, pix, c, kids.get(run.start + 1..run.end).unwrap_or(&[]), xf, depth); } else { - draw_node(ctx, pix, c, xf, depth + 1); + draw_layer(ctx, pix, cn, xf, depth + 1); } } } diff --git a/crates/render/src/lod.rs b/crates/render/src/lod.rs index 6d7425857..a5b3ddc14 100644 --- a/crates/render/src/lod.rs +++ b/crates/render/src/lod.rs @@ -60,18 +60,47 @@ fn text_paints<'a>(n: &'a Node, t: &'a TextData) -> impl Iterator bool { + splattable_within(doc, n, depth, None).0 +} + +/// [`splattable`], kept in and read from `memo` when there is one (layers with children only). +/// Also returns how many levels the walk went down, or `None` when the nesting cap decided it: such +/// answers depend on the depth they were asked at and aren't kept, and kept answers are read only +/// where their levels still fit under the cap. +pub(crate) fn splattable_within<'a>(doc: &'a Document, n: &Node, depth: usize, memo: Option<&crate::draw::Bounds<'a>>) -> (bool, Option) { if depth > MAX_DEPTH { - return false; + return (false, None); + } + let memo = memo.filter(|_| !n.children.is_empty()); + if let Some((ok, levels)) = memo.and_then(|m| m.splat.borrow().get(&n.id).copied()) + && depth + levels <= MAX_DEPTH + { + return (ok, Some(levels)); } let image = |p: &Paint| p.visible && matches!(p.kind, PaintKind::Image(_) | PaintKind::Pattern(_)); let own = match &n.kind { NodeKind::Text(t) => text_paints(n, t).any(image), _ => n.fills.iter().any(image), }; - if own || n.strokes.iter().any(image) { - return false; + let (mut ok, mut below) = (!(own || n.strokes.iter().any(image)), Some(0)); + if ok { + for c in n.children.iter().filter_map(|c| memo.map_or_else(|| doc.node(*c), |m| m.node(doc, *c))).filter(|c| c.visible) { + if c.is_mask { + ok = false; + break; + } + let (c_ok, c_levels) = splattable_within(doc, c, depth + 1, memo); + below = below.zip(c_levels).map(|(b, l)| b.max(l + 1)); + if !c_ok { + ok = false; + break; + } + } } - n.children.iter().filter_map(|c| doc.node(*c)).filter(|c| c.visible).all(|c| !c.is_mask && splattable(doc, c, depth + 1)) + if let (Some(m), Some(l)) = (memo, below) { + m.splat.borrow_mut().insert(n.id, (ok, l)); + } + (ok, below) } /// A paint's average colour as straight RGBA (alpha times the paint's opacity); `None` for @@ -199,7 +228,7 @@ pub fn splat_subtree(ctx: &Ctx, pix: &mut Pixmap, n: &Node, xf: Affine, clip: Op } else { clip }; - for c in n.paint_order().filter_map(|c| ctx.doc.node(c)) { + for c in n.paint_order().filter_map(|c| ctx.bounds.node(ctx.doc, c)) { splat_subtree(ctx, pix, c, xf * c.transform, clip, alpha, depth + 1); } } From 7d7a7247644ee34247a263cf5b906e195ec137ab Mon Sep 17 00:00:00 2001 From: Marco Arnulfo Date: Fri, 16 Oct 2026 13:11:13 +0200 Subject: [PATCH 071/817] Text: selection highlights after a line break start at the line's start, and the empty last line shows (fixes #665) --- crates/text/src/layout.rs | 23 +++++++++++++++++--- crates/text/src/tests.rs | 44 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 3 deletions(-) diff --git a/crates/text/src/layout.rs b/crates/text/src/layout.rs index 37092da86..b2cc9ce1d 100644 --- a/crates/text/src/layout.rs +++ b/crates/text/src/layout.rs @@ -1190,6 +1190,12 @@ impl TextLayout { Some(next.unwrap_or(if right != line.rtl { index + 1 } else { index.saturating_sub(1) })) } + /// Left edge of a left-to-right line's first char (its end when it has none). + fn line_start_x(&self, line: &Line) -> f64 { + let gl = self.glyphs.get(line.glyph_start..line.glyph_end).unwrap_or(&[]); + gl.iter().find(|g| g.char_end > g.char_start).map_or_else(|| self.line_end_x(line), |g| g.x) + } + /// Where a line's text ends: its right edge, or its left edge for a right-to-left paragraph. fn line_end_x(&self, line: &Line) -> f64 { let glyphs = self.glyphs.get(line.glyph_start..line.glyph_end).unwrap_or(&[]).iter().filter(|g| g.char_end > g.char_start); @@ -1250,7 +1256,16 @@ impl TextLayout { let (a, b) = (start.min(end), start.max(end)); let mut out = Vec::new(); for (li, line) in self.lines.iter().enumerate() { - if b <= line.char_start || a > line.char_end || (a == line.char_end && li + 1 < self.lines.len()) { + let last = li + 1 == self.lines.len(); + // The empty line after a trailing break has no chars, but a selection reaching the + // end of the text covers it: it shows a paragraph-break mark at the line's start. + let trailing_empty = last && a < b && b >= line.char_start && line.char_start == line.char_end; + if (b <= line.char_start && !trailing_empty) || a > line.char_end || (a == line.char_end && !last) { + continue; + } + if trailing_empty { + let x = self.line_end_x(line); + out.push(Rect::new(x, line.top, x + 4.0, line.top + line.height)); continue; } let gl = self.glyphs.get(line.glyph_start..line.glyph_end).unwrap_or(&[]); @@ -1258,10 +1273,12 @@ impl TextLayout { out.extend(Self::mixed_selection(gl, a, b, line)); continue; } - let (x0, _) = self.caret(a.max(line.char_start)); + // From the line's own start: `caret(char_start)` after a hard break is the end of the + // line above. + let x0 = if a <= line.char_start { self.line_start_x(line) } else { self.caret(a).0 }; let x1 = if b >= line.char_end { // The last line has no paragraph break to show, so it ends at its glyphs. - self.line_end_x(line) + if line.para_end && li + 1 < self.lines.len() && b > line.char_end.saturating_sub(1) { 4.0 } else { 0.0 } + self.line_end_x(line) + if line.para_end && !last && b > line.char_end.saturating_sub(1) { 4.0 } else { 0.0 } } else { self.caret(b).0 }; diff --git a/crates/text/src/tests.rs b/crates/text/src/tests.rs index e34f0110f..f5eaab6bf 100644 --- a/crates/text/src/tests.rs +++ b/crates/text/src/tests.rs @@ -437,3 +437,47 @@ fn selection_through_text_end_stays_inside_auto_width_box() { let first = r.first().map_or(f64::NAN, |r| r.x1); assert!(first > l.caret(5).0 + 1.0, "{first}"); } + +/// The selection rect drawn on line `li` of `l`, if any. +fn rect_on(l: &TextLayout, rects: &[figcraft_geom::Rect], li: usize) -> Option { + let top = l.lines.get(li)?.top; + rects.iter().find(|r| (r.y0 - top).abs() < 1e-6).copied() +} + +#[test] +fn select_all_highlights_an_empty_last_line() { + if !have_fonts() { + return; + } + // "Hello\n": the trailing break leaves an empty second line (#665). + let l = layout(&TextData::new("Hello\n"), None, None); + assert_eq!(l.lines.len(), 2); + let Some(r) = rect_on(&l, &l.selection_rects(0, 6), 1) else { panic!("no highlight on the empty last line") }; + // A paragraph-break mark at the line's start, not at the end of "Hello" above. + assert!(r.x0.abs() < 1e-6 && (r.width() - 4.0).abs() < 1e-6, "{r:?}"); + assert!(rect_on(&l, &l.selection_rects(5, 6), 1).is_some()); + // Selecting part of the first line, or a caret, leaves the empty line alone. + assert!(l.selection_rects(0, 1).iter().all(|r| r.y0 < l.lines[1].top - 1e-6), "{:?}", l.selection_rects(0, 1)); + assert!(l.selection_rects(6, 6).is_empty()); + // A right-to-left paragraph marks its empty last line too. + let rtl = layout(&TextData::new("\u{5E9}\u{5DC}\u{5D5}\u{5DD}\n"), None, None); + let Some(r) = rect_on(&rtl, &rtl.selection_rects(0, 5), 1) else { panic!("no highlight on the empty right-to-left line") }; + assert!(r.x0.abs() < 1e-6 && (r.width() - 4.0).abs() < 1e-6, "{r:?}"); +} + +#[test] +fn selection_after_a_line_break_starts_at_the_line_start() { + if !have_fonts() { + return; + } + // Not at the end of the line above, where `caret` puts the index after the break. + let l = layout(&TextData::new("Hello\nworld"), None, None); + let Some(r) = rect_on(&l, &l.selection_rects(0, 11), 1) else { panic!("no highlight on the second line") }; + assert!(r.x0.abs() < 1e-6 && r.x1 > l.caret(10).0, "{r:?}"); + // An empty line in the middle shows its break mark at its start. + let m = layout(&TextData::new("Hello\n\nworld"), None, None); + let Some(r) = rect_on(&m, &m.selection_rects(0, 12), 1) else { panic!("no highlight on the empty line") }; + assert!(r.x0.abs() < 1e-6 && (r.width() - 4.0).abs() < 1e-6, "{r:?}"); + // A break followed by text still doesn't highlight the next line's start. + assert!(rect_on(&l, &l.selection_rects(0, 6), 1).is_none()); +} From c5a8420089de30cc222786efae09db9423e44967 Mon Sep 17 00:00:00 2001 From: Hamza Date: Fri, 16 Oct 2026 16:27:05 +0500 Subject: [PATCH 072/817] Make the control server's connection-limit test pass on macOS `cargo xtask ci` was red on a clean main on macOS: the test's last shutdown runs after the server has answered an invalid request and closed the connection, and `shutdown(2)` on a socket whose peer has already closed is ENOTCONN on macOS and the BSDs where Linux returns success. The test is right about what it checks; it checked a return value that is not portable. Closing the client is what the worker thread waits for, and dropping the socket does that whether or not shutdown reported anything. The file's other six shutdowns run while the peer is still open, which is well defined on both platforms, so they stay checked. With no CI running the tests on pull requests, the local gate is the only signal a contributor gets, and it could not be green on macOS. --- apps/figcraft/src/control_server_tests.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/figcraft/src/control_server_tests.rs b/apps/figcraft/src/control_server_tests.rs index d243fb916..008170fbb 100644 --- a/apps/figcraft/src/control_server_tests.rs +++ b/apps/figcraft/src/control_server_tests.rs @@ -160,7 +160,11 @@ fn connection_limit_rejects_excess_clients_and_reuses_finished_slots() { assert_eq!(workers.len(), 1); client.write_all(b"invalid\n").unwrap(); assert_eq!(reply(&mut BufReader::new(client.try_clone().unwrap()))["ok"], false); - client.shutdown(Shutdown::Both).unwrap(); + // The server closes this connection after answering an invalid request, and shutting down + // a socket whose peer has already closed is ENOTCONN on macOS and the BSDs where Linux + // returns Ok. Closing the client is what the worker is waiting for, so the result is moot: + // the other shutdowns in this file run while the peer is still open and stay checked. + let _ = client.shutdown(Shutdown::Both); workers.pop().unwrap().join().unwrap(); } From 805a121e1537a34ffb4705da387132ff1b255250 Mon Sep 17 00:00:00 2001 From: Hamza Date: Fri, 16 Oct 2026 16:30:58 +0500 Subject: [PATCH 073/817] Hold the duplicate step for a dragged and a nudged copy (#567) Duplicate repeats the last duplicate's offset, but of the ways to move the copy before the second Cmd+D only `node.set` and Alt-drag were covered. Dragging it with the mouse is how almost everyone does it, and is what #567 describes; an arrow-key nudge is how a small offset is usually made exact. Both work, because the step is measured from where the copy ended up rather than recorded from the gesture, but nothing held them there. The drag test also asserts the drag moved the copy rather than making another one, left it selected, and left the original in place: the ways the feature could break without the step arithmetic breaking. Both fail if the step lookup in `edit.duplicate` is stubbed out. --- crates/engine/src/duplicate_spacing_tests.rs | 46 ++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/crates/engine/src/duplicate_spacing_tests.rs b/crates/engine/src/duplicate_spacing_tests.rs index b65fbb641..4c62179a7 100644 --- a/crates/engine/src/duplicate_spacing_tests.rs +++ b/crates/engine/src/duplicate_spacing_tests.rs @@ -157,3 +157,49 @@ fn an_alt_drag_into_auto_layout_sets_no_step() { cmd_d(&mut s); assert_eq!(s.doc().unwrap().node(f).unwrap().children.len(), n + 1, "Duplicate still adds one to the flow"); } + +/// Drag `from` by `by` with no modifier: moving the selection, not copying it. +fn drag_move(s: &mut Session, from: (f64, f64), by: (f64, f64)) { + let ev = |kind, (x, y): (f64, f64)| PointerEvent::at(kind, x, y, 1.0); + s.pointer(&ev(PointerKind::Down, from)).unwrap(); + for k in 1..=4 { + let t = f64::from(k) / 4.0; + s.pointer(&ev(PointerKind::Move, (from.0 + by.0 * t, from.1 + by.1 * t))).unwrap(); + } + s.pointer(&ev(PointerKind::Up, (from.0 + by.0, from.1 + by.1))).unwrap(); +} + +/// The reported path (#567): Cmd+D, drag the copy with the mouse, Cmd+D again. The other tests +/// here set the copy's position with `node.set` or Alt-drag it; dragging is how it is usually done, +/// and the step is measured from where the copy ended up, whichever way it got there. +#[test] +fn duplicate_repeats_the_step_set_by_dragging_the_copy() { + let mut s = Session::new(); + let a = rect(&mut s, 0.0, 0.0); + ex(&mut s, "select.set", json!({"ids": [a]})); + let c1 = cmd_d(&mut s); + assert_eq!(at(&s, c1), (0.0, 0.0), "the first copy lands in place"); + + drag_move(&mut s, (50.0, 50.0), (150.0, 20.0)); + assert_eq!(at(&s, c1), (150.0, 20.0), "the drag moved the copy, it did not make another one"); + assert_eq!(s.selection(), vec![c1], "and left it selected"); + assert_eq!(at(&s, a), (0.0, 0.0), "the original stays"); + + let c2 = cmd_d(&mut s); + assert_eq!(at(&s, c2), (300.0, 40.0), "the next one as far again"); + let c3 = cmd_d(&mut s); + assert_eq!(at(&s, c3), (450.0, 60.0), "and again"); +} + +/// And a step set with the arrow keys, which is how a small offset is usually made exact. +#[test] +fn duplicate_repeats_a_nudged_step() { + let mut s = Session::new(); + let a = rect(&mut s, 0.0, 0.0); + ex(&mut s, "select.set", json!({"ids": [a]})); + let c1 = cmd_d(&mut s); + ex(&mut s, "transform.nudge", json!({"dx": 40, "dy": 0})); + assert_eq!(at(&s, c1), (40.0, 0.0)); + let c2 = cmd_d(&mut s); + assert_eq!(at(&s, c2), (80.0, 0.0), "the nudge is the step"); +} From 0f4c79b629b23d6a2bc792387c83d40d1dc639a4 Mon Sep 17 00:00:00 2001 From: phonedu <135960865+phonedu@users.noreply.github.com> Date: Fri, 16 Oct 2026 19:33:59 +0800 Subject: [PATCH 074/817] M0.9: a script runs as one undo step and resolves `$step`, like command.batch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `figcraft-cli run` ran each step of a script on its own, so a script's `{"$step": n}` reached `parent` unresolved and the layer landed on the page while every step reported success — the same commands through `command.batch` (the MCP `batch` tool, the control channel, plugins) put it inside the frame. One `edit.undo` took back one step of a script rather than the script, and a failing step left the earlier ones applied. `Session::batch_step` is now the one path both take — one step of a batch, its `$step` references resolved against the results before it — and `run_script` wraps its steps in `Session::grouped`: the whole script is one undo step, and a step that fails takes the script back. The result lines come out once the script is through, so none of them reports work a later failure took back; a failure prints one line with `rolledBack: true` and exits 1. `docs/cli.md` documents the reference and the output. --- apps/figcraft-cli/src/files.rs | 92 ++++++++++++++++++++++++++++++---- crates/engine/src/lib.rs | 13 ++++- docs/cli.md | 24 ++++++++- 3 files changed, 116 insertions(+), 13 deletions(-) diff --git a/apps/figcraft-cli/src/files.rs b/apps/figcraft-cli/src/files.rs index 4fb485e10..46c8dd221 100644 --- a/apps/figcraft-cli/src/files.rs +++ b/apps/figcraft-cli/src/files.rs @@ -333,17 +333,31 @@ pub fn run_script(script: &str, input: Option<&str>, out: Option<&str>) -> CliRe } None => Session::new(), }; - for (i, (cmd, params)) in steps.iter().enumerate() { - let r = s.execute(cmd, params); - s.ui_requests.clear(); - match r { - Ok(v) => println!("{}", json!({"step": i, "command": cmd, "ok": true, "result": v})), - Err(e) => { - println!("{}", json!({"step": i, "command": cmd, "ok": false, "error": e.to_string()})); - eprintln!("error: step {i} ({cmd}) failed: {e}"); - return Ok(ExitCode::from(1)); - } + // One undo step and all-or-nothing, the way the same commands behave through `command.batch` + // (MCP, the control channel, plugins): `{"$step": n}` resolves against the steps before it, and + // a step that fails takes the whole script back instead of leaving the earlier steps applied. + // The result lines are held back until the script is through, so none of them reports work that + // was rolled back. + let mut results: Vec = Vec::with_capacity(steps.len()); + let mut failed_at = 0; + let outcome = s.grouped(&format!("run {script}"), |s| { + for (i, (cmd, params)) in steps.iter().enumerate() { + failed_at = i; + let v = s.batch_step(&results, i, cmd, params)?; + s.ui_requests.clear(); + results.push(v); } + Ok(()) + }); + if let Err(e) = outcome { + let (i, (cmd, _)) = (failed_at, &steps[failed_at]); + println!("{}", json!({"step": i, "command": cmd, "ok": false, "error": e.to_string(), "rolledBack": true})); + eprintln!("error: step {i} ({cmd}) failed: {e}"); + eprintln!("the script's document changes were rolled back"); + return Ok(ExitCode::from(1)); + } + for (i, ((cmd, _), v)) in steps.iter().zip(&results).enumerate() { + println!("{}", json!({"step": i, "command": cmd, "ok": true, "result": v})); } if let Some(out) = out { let ds = s.ds().map_err(|e| CliError::Failed(e.to_string()))?; @@ -422,4 +436,62 @@ mod tests { assert_eq!(std::fs::read_dir(&dir).unwrap().count(), 2); std::fs::remove_dir_all(dir).unwrap(); } + + fn temp_dir(tag: &str) -> std::path::PathBuf { + let stamp = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_nanos(); + let dir = std::env::temp_dir().join(format!("figcraft-cli-{tag}-{}-{stamp}", std::process::id())); + std::fs::create_dir(&dir).unwrap(); + dir + } + + /// A script resolves `{"$step": n}` like the same commands through `command.batch`. Each step + /// used to run on its own, so the reference reached `parent` unresolved, `node.create` read it + /// as "no parent" and the layer landed on the page — with every step reporting success. + #[test] + fn a_script_puts_a_layer_in_a_layer_an_earlier_step_made() { + let dir = temp_dir("run-step"); + let script = dir.join("script.json"); + std::fs::write( + &script, + r#"[ + {"command": "node.create", "params": {"type": "frame", "name": "Card", "x": 0, "y": 0, "width": 200, "height": 100}}, + {"command": "node.create", "params": {"type": "rectangle", "name": "child", "parent": {"$step": 0}, "x": 10, "y": 10, "width": 20, "height": 20}} + ]"#, + ) + .unwrap(); + let out = dir.join("out.figcraft"); + run_script(script.to_str().unwrap(), None, Some(out.to_str().unwrap())).unwrap(); + + let mut s = Session::empty(); + s.execute("file.open", &json!({"path": out.to_str().unwrap()})).unwrap(); + let doc = s.doc().unwrap(); + let page = s.page().unwrap(); + let top = doc.node(page).unwrap().children.clone(); + assert_eq!(top.len(), 1, "only the frame is top level, not the rectangle too"); + assert_eq!(doc.node(top[0]).unwrap().name, "Card"); + let inner = doc.node(top[0]).unwrap().children.clone(); + assert_eq!(inner.len(), 1, "the rectangle went inside the frame"); + assert_eq!(doc.node(inner[0]).unwrap().name, "child"); + std::fs::remove_dir_all(dir).unwrap(); + } + + /// A step that fails takes the whole script back: nothing is written, and the failure says so. + #[test] + fn a_failed_step_leaves_no_output() { + let dir = temp_dir("run-rollback"); + let script = dir.join("script.json"); + std::fs::write( + &script, + r#"[ + {"command": "node.create", "params": {"type": "frame", "name": "Card", "x": 0, "y": 0, "width": 200, "height": 100}}, + {"command": "node.set", "params": {"ids": [99999], "props": {"name": "nope"}}} + ]"#, + ) + .unwrap(); + let out = dir.join("out.figcraft"); + // The failure is the script's, not the call's: the CLI reports it and exits non-zero. + run_script(script.to_str().unwrap(), None, Some(out.to_str().unwrap())).unwrap(); + assert!(!out.exists(), "a script that failed writes nothing"); + std::fs::remove_dir_all(dir).unwrap(); + } } diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 34653bd5f..27212f96b 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1135,13 +1135,22 @@ impl Session { self.grouped(label, |s| { let mut results: Vec = Vec::with_capacity(cmds.len()); for (step, (id, p)) in cmds.iter().enumerate() { - let p = if id == "command.batch" { p.clone() } else { resolve_step_refs(p, &results, step, 0)? }; - results.push(s.execute(id, &p)?); + let v = s.batch_step(&results, step, id, p)?; + results.push(v); } Ok(results) }) } + /// One step of a batch: `{"$step": n}` in `params` resolves against `results` (the results of + /// the steps before it), then the command runs. [`Session::batch`] runs a list of these as one + /// undo step; a caller with its own list — the CLI's script runner — uses this so its steps + /// resolve `$step` the same way, inside its own [`Session::grouped`]. + pub fn batch_step(&mut self, results: &[Value], step: usize, cmd: &str, params: &Value) -> Result { + let p = if cmd == "command.batch" { params.clone() } else { resolve_step_refs(params, results, step, 0)? }; + self.execute(cmd, &p) + } + /// Run `f` as one undo step called `label`: the commands it executes push no steps of their /// own, and when it fails the documents stay at their group-start state. pub fn grouped(&mut self, label: &str, f: impl FnOnce(&mut Self) -> Result) -> Result { diff --git a/docs/cli.md b/docs/cli.md index 9f5df40ef..be54add27 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -103,7 +103,29 @@ Runs commands in a headless session (a new document, or `--in`), printing one JS {"command":"frame.create","ok":true,"result":{"id":2},"step":0} ``` -A failing step prints `"ok": false` with the error and exits with code 1 (nothing is saved). +The whole script is **one undo step**, and it is **all-or-nothing**, exactly like running the same +commands through `command.batch` (the MCP tool `batch`, the control channel, plugins): `{"$step": n}` +in a step's params is the `id` in an earlier step's result, so a step can target a layer an earlier +step of the same script created: + +```json +[ + {"command": "node.create", "params": {"type": "frame", "name": "Card", "width": 200, "height": 100}}, + {"command": "node.create", "params": {"type": "text", "parent": {"$step": 0}, "text": "Hi"}} +] +``` + +The result lines are printed once the script is through, so none of them reports work a later step +took back. + +A failing step prints one line with `"ok": false`, the error and `"rolledBack": true`, writes +nothing (`--out` is not saved, and the session's documents go back to how the script found them), +and exits with code 1: + +```text +{"step":1,"command":"node.set","ok":false,"error":"no such node 99999","rolledBack":true} +``` + `--out` saves the result by extension like `convert`. Script formats: a JSON array of `{"command": id, "params": {...}}`, an object From 9daf39e24ce55e369bdb3e1949927f72c18afd91 Mon Sep 17 00:00:00 2001 From: phonedu <135960865+phonedu@users.noreply.github.com> Date: Fri, 16 Oct 2026 19:53:43 +0800 Subject: [PATCH 075/817] M1: a param that names a layer says so when it isn't one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `node.create` read its `parent` as `id(p, "parent").unwrap_or(page)`, so a `parent` that isn't a layer id — a `{"$step": n}` nothing had resolved, a name, a negative number — quietly meant "no parent" and the layer landed on the page, with the call reporting success. The same shape sat on `image.place` and `instance.create`, on `index` (a string index appended where it was asked to insert), and on the `ids` of every command that targets layers (an entry that wasn't an id was dropped and the rest ran). A number that names nothing was reported; anything that isn't a number at all was not. `params::opt_id` and `params::opt_index` now say what the commands mean: missing and `null` are "none", and anything else has to be a layer id (or a whole, non-negative number) and is named when it isn't. `req_targets` refuses an `ids` entry that isn't an id, before falling back to the selection. A number that names no layer still reports `no such node`, and a boolean is still a number to `f64_of`, as it is for `x`, `width` and the rest. This turns a silently wrong result into an error on purpose, so a caller that passed something that isn't an id and relied on the fallback now hears about it. --- crates/engine/src/cmd/component.rs | 2 +- crates/engine/src/cmd/create.rs | 6 +- .../engine/src/id_params_behaviour_tests.rs | 151 ++++++++++++++++++ crates/engine/src/lib.rs | 2 + crates/engine/src/params.rs | 38 ++++- 5 files changed, 194 insertions(+), 5 deletions(-) create mode 100644 crates/engine/src/id_params_behaviour_tests.rs diff --git a/crates/engine/src/cmd/component.rs b/crates/engine/src/cmd/component.rs index 0fb648167..e35c3f5b2 100644 --- a/crates/engine/src/cmd/component.rs +++ b/crates/engine/src/cmd/component.rs @@ -68,7 +68,7 @@ pub fn specs() -> Vec { let cmd = "instance.create"; let c = req_id(cmd, p, "component")?; let page = s.page()?; - let parent = id(p, "parent").unwrap_or(page); + let parent = crate::params::opt_id(cmd, p, "parent")?.unwrap_or(page); let doc = s.doc_mut()?; let c = main_of(doc, c).ok_or_else(|| bad(cmd, "`component` must be a component or component set"))?; let (x, y) = match (num(p, "x"), num(p, "y")) { diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index 2150701a9..9b471290e 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -167,7 +167,7 @@ pub fn create(s: &mut Session, p: &Value) -> Result { let t = string(p, "type").ok_or_else(|| bad(cmd, "`type` is required"))?; let (mut kind, base) = kind_for(&t).ok_or_else(|| bad(cmd, format!("unknown type `{t}`")))?; let page = s.page()?; - let parent = id(p, "parent").unwrap_or(page); + let parent = crate::params::opt_id(cmd, p, "parent")?.unwrap_or(page); let doc = s.doc()?; let pn = doc.get(parent)?; if !pn.kind.is_container() { @@ -255,7 +255,7 @@ pub fn create(s: &mut Session, p: &Value) -> Result { node.width = tw; node.height = th; } - let index = num(p, "index").map(|i| i.max(0.0) as usize); + let index = crate::params::opt_index(cmd, p, "index")?; doc.insert(node, parent, index)?; if let Some(Value::Object(props)) = get(p, "props") { super::props::apply(cmd, doc, nid, props)?; @@ -340,7 +340,7 @@ pub fn place_image(s: &mut Session, p: &Value) -> Result { _ => ImageScaleMode::Fill, }; let page = s.page()?; - let parent = id(p, "parent").unwrap_or(page); + let parent = crate::params::opt_id(cmd, p, "parent")?.unwrap_or(page); let ds = s.ds_mut()?; let doc = ds.doc_mut(); let (hash, iw, ih) = figcraft_format::add_image(doc, bytes).map_err(|e| bad(cmd, e.to_string()))?; diff --git a/crates/engine/src/id_params_behaviour_tests.rs b/crates/engine/src/id_params_behaviour_tests.rs new file mode 100644 index 000000000..ae77c8a13 --- /dev/null +++ b/crates/engine/src/id_params_behaviour_tests.rs @@ -0,0 +1,151 @@ +//! Layer ids in params: naming something that isn't a layer is a mistake, and says so, rather than +//! quietly meaning "none". +//! +//! `node.create`'s `parent` was `id(p, "parent").unwrap_or(page)`, so any value that isn't an id — +//! a `{"$step": n}` nothing had resolved, a name, a negative number — became "no parent" and the +//! layer landed on the page while the call reported success. The same shape sat on `image.place` +//! and `instance.create`'s parents, on `index`, and on the `ids` of every command that targets +//! layers (an entry that wasn't an id was dropped and the rest ran). + +use crate::params::id_of; +use crate::{EngineError, Session}; +use figcraft_doc::*; +use serde_json::{Value, json}; + +/// The page's children, by name (bottom first). +fn top(s: &Session) -> Vec { + let doc = s.doc().unwrap(); + let page = s.page().unwrap(); + doc.node(page).unwrap().children.iter().filter_map(|c| doc.node(*c).map(|n| n.name.clone())).collect() +} + +/// The message of a failure, or `None` when the call went through. +fn failed(r: std::result::Result) -> Option { + match r { + Ok(_) => None, + Err(e) => Some(e.to_string()), + } +} + +fn rect(parent: Value) -> Value { + json!({"type": "rectangle", "name": "child", "parent": parent, "x": 0, "y": 0, "width": 10, "height": 10}) +} + +fn card(s: &mut Session) -> NodeId { + let v = s.execute("node.create", &json!({"type": "frame", "name": "Card", "x": 0, "y": 0, "width": 100, "height": 100})).unwrap(); + id_of(&v["id"]).unwrap() +} + +#[test] +fn a_parent_that_is_not_an_id_is_refused_rather_than_becoming_the_page() { + let mut s = Session::new(); + let card = card(&mut s); + for parent in [json!({"$step": 0}), json!("Card"), json!(-1), json!(true)] { + let msg = failed(s.execute("node.create", &rect(parent.clone()))).unwrap_or_else(|| panic!("{parent} must be refused")); + assert!(msg.contains("`parent` must be a node id"), "{parent}: {msg}"); + } + assert_eq!(top(&s), ["Card"], "nothing landed on the page"); + let doc = s.doc().unwrap(); + assert!(doc.node(card).unwrap().children.is_empty(), "nor inside the frame"); +} + +#[test] +fn leaving_the_parent_out_or_null_still_means_the_page() { + let mut s = Session::new(); + let card = card(&mut s); + for parent in [None, Some(json!(null))] { + let mut p = rect(json!(0)); + match parent { + None => _ = p.as_object_mut().unwrap().remove("parent"), + Some(v) => p["parent"] = v, + } + s.execute("node.create", &p).unwrap(); + } + assert_eq!(top(&s), ["Card", "child", "child"]); + let doc = s.doc().unwrap(); + assert!(doc.node(card).unwrap().children.is_empty()); +} + +#[test] +fn a_parent_id_that_names_nothing_is_still_reported() { + let mut s = Session::new(); + card(&mut s); + let msg = failed(s.execute("node.create", &rect(json!(99999)))).unwrap_or_else(|| panic!("a missing layer must fail")); + assert!(msg.contains("no such node 99999"), "{msg}"); +} + +#[test] +fn an_index_that_is_not_a_whole_non_negative_number_is_refused() { + let mut s = Session::new(); + let card = card(&mut s); + // (A boolean is a number to `f64_of` — `true` reads as 1 — as for `x`, `width` and every + // other number, so it is deliberately not in this list.) + for index in [json!("last"), json!(1.5), json!(-1), json!(-0.5), json!(1e12)] { + let mut p = rect(json!(card)); + p["index"] = index.clone(); + let msg = failed(s.execute("node.create", &p)).unwrap_or_else(|| panic!("index {index} must be refused")); + assert!(msg.contains("`index`"), "{index}: {msg}"); + } + let doc = s.doc().unwrap(); + assert!(doc.node(card).unwrap().children.is_empty(), "nothing was inserted"); +} + +#[test] +fn a_whole_index_still_inserts_where_it_says() { + let mut s = Session::new(); + let card = card(&mut s); + for name in ["a", "b"] { + s.execute("node.create", &json!({"type": "rectangle", "name": name, "parent": card, "x": 0, "y": 0, "width": 10, "height": 10})).unwrap(); + } + s.execute("node.create", &json!({"type": "rectangle", "name": "mid", "parent": card, "index": 1, "x": 0, "y": 0, "width": 10, "height": 10})) + .unwrap(); + let doc = s.doc().unwrap(); + let names: Vec<&str> = doc.node(card).unwrap().children.iter().filter_map(|c| doc.node(*c).map(|n| n.name.as_str())).collect(); + assert_eq!(names, ["a", "mid", "b"]); +} + +#[test] +fn ids_entries_that_are_not_ids_are_refused_instead_of_being_dropped() { + let mut s = Session::new(); + let card = card(&mut s); + // The junk used to be dropped and the rest applied, so `["nope", card]` renamed the frame. + for ids in [json!(["nope"]), json!(["nope", card]), json!([{"$step": 0}, card]), json!([null])] { + let msg = + failed(s.execute("node.set", &json!({"ids": ids, "props": {"name": "renamed"}}))).unwrap_or_else(|| panic!("{ids} must be refused")); + assert!(msg.contains("`ids`"), "{ids}: {msg}"); + } + let doc = s.doc().unwrap(); + assert_eq!(doc.node(card).unwrap().name, "Card", "nothing was renamed"); +} + +#[test] +fn an_ids_that_is_not_an_array_is_refused_but_null_means_the_selection() { + let mut s = Session::new(); + let card = card(&mut s); + let msg = + failed(s.execute("node.set", &json!({"ids": "nope", "props": {"name": "renamed"}}))).unwrap_or_else(|| panic!("a non-array ids must fail")); + assert!(msg.contains("`ids` must be an array"), "{msg}"); + // An explicit null says the same as leaving it out: the selection. + s.execute("select.set", &json!({"ids": [card]})).unwrap(); + s.execute("node.set", &json!({"ids": null, "props": {"name": "Selected"}})).unwrap(); + assert_eq!(s.doc().unwrap().node(card).unwrap().name, "Selected"); +} + +#[test] +fn a_single_id_that_is_not_an_id_is_refused() { + let mut s = Session::new(); + card(&mut s); + let msg = + failed(s.execute("node.set", &json!({"id": {"$step": 0}, "props": {"name": "renamed"}}))).unwrap_or_else(|| panic!("a bad id must fail")); + assert!(msg.contains("`id` must be a node id"), "{msg}"); +} + +#[test] +fn an_image_and_an_instance_parent_are_checked_the_same_way() { + let mut s = Session::new(); + card(&mut s); + let img = failed(s.execute("image.place", &json!({"data": "aGk=", "parent": {"$step": 0}}))); + assert!(img.unwrap_or_default().contains("`parent` must be a node id"), "image.place"); + let inst = failed(s.execute("instance.create", &json!({"component": 99999, "parent": {"$step": 0}}))); + assert!(inst.is_some(), "instance.create refuses both a bad component and a bad parent"); +} diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 34653bd5f..fac5f477b 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1548,6 +1548,8 @@ mod history_behaviour_tests; #[cfg(test)] mod html_codegen_tests; #[cfg(test)] +mod id_params_behaviour_tests; +#[cfg(test)] mod import_export_tests; #[cfg(test)] mod inspect_behaviour_tests; diff --git a/crates/engine/src/params.rs b/crates/engine/src/params.rs index bbaa42a45..67a5b80a8 100644 --- a/crates/engine/src/params.rs +++ b/crates/engine/src/params.rs @@ -88,6 +88,25 @@ pub fn req_id(cmd: &str, p: &Value, key: &str) -> Result { id(p, key).ok_or_else(|| bad(cmd, format!("`{key}` must be a node id"))) } +/// `key` when it is there: a layer id, or an error naming it. Missing and `null` mean "none", so a +/// command can tell "no parent given" (use the page) from "a parent was given that isn't an id" — +/// which is a mistake, not the default. Without this, `{"$step": 0}` reaching a param that isn't +/// resolved yet silently becomes "no parent" and the layer lands on the page. +pub fn opt_id(cmd: &str, p: &Value, key: &str) -> Result> { + match get(p, key) { + None | Some(Value::Null) => Ok(None), + Some(v) => id_of(v).map(Some).ok_or_else(|| bad(cmd, format!("`{key}` must be a node id (got {v})"))), + } +} + +/// `key` when it is there: a whole, non-negative number, or an error. Missing means "none". +pub fn opt_index(cmd: &str, p: &Value, key: &str) -> Result> { + match get(p, key) { + None | Some(Value::Null) => Ok(None), + Some(_) => req_index(cmd, p, key).map(Some), + } +} + /// `ids` (array), `id` (single), or the current selection. pub fn targets(s: &Session, p: &Value) -> Vec { if let Some(Value::Array(a)) = get(p, "ids") { @@ -99,8 +118,25 @@ pub fn targets(s: &Session, p: &Value) -> Vec { s.selection() } -/// Like [`targets`] but an empty result is an error. +/// Like [`targets`] but an unparseable `ids` entry, an unparseable `id`, or an empty result is an +/// error: naming something that isn't a layer is a mistake, not an empty selection. An explicit +/// `null` says the same as leaving the key out. pub fn req_targets(cmd: &str, s: &Session, p: &Value) -> Result> { + match get(p, "ids") { + Some(Value::Array(a)) => { + if let Some(v) = a.iter().find(|v| id_of(v).is_none()) { + return Err(bad(cmd, format!("`ids`: every entry must be a node id (got {v})"))); + } + } + Some(Value::Null) | None => { + if let Some(v) = get(p, "id").filter(|v| !v.is_null()) + && id_of(v).is_none() + { + return Err(bad(cmd, format!("`id` must be a node id (got {v})"))); + } + } + Some(v) => return Err(bad(cmd, format!("`ids` must be an array (got {v})"))), + } let t = targets(s, p); if t.is_empty() { return Err(EngineError::Disabled(cmd.to_string(), "nothing is selected (pass `ids`)".into())); From ac1a192a3aa6c4acdd3108956d2e7c4b1dc6076c Mon Sep 17 00:00:00 2001 From: Yarila Date: Fri, 16 Oct 2026 17:25:13 +0500 Subject: [PATCH 076/817] M7: keep mobile presenter fixed and confirm window close --- ROADMAP.md | 1 + crates/ui-egui/src/lib.rs | 5 ++ crates/ui-egui/src/present.rs | 90 ++++++++++++++++++++++++---- crates/ui-egui/src/tabs.rs | 10 +++- crates/ui-egui/src/titlebar_tests.rs | 19 +++++- crates/ui-egui/src/windows.rs | 9 ++- crates/ui-egui/src/windows_tests.rs | 19 ++++++ docs/gaps.md | 6 +- 8 files changed, 142 insertions(+), 17 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index b54a43ec4..ce132520a 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -313,6 +313,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-16 | minor | The full presenter now scrolls content beyond a responsive phone or tablet screen in both directions. A drag that starts inside the screen continues when the pointer leaves it; the device body stays fixed. Computer presets keep their ordinary scrolling rules. The unsaved-changes dialog appears over presentation when closing a window. The saved design is unchanged. Numbers unchanged. | | 2026-10-16 | minor | Choosing a device in the presenter now enables responsive layout at that device's screen size, clears offsets from the previous screen, and lets No device restore the design's frame size. Tablet and computer presets show a bare screen at their resolution; phones keep their device body. The saved frame geometry is unchanged. Numbers unchanged. | | 2026-10-15 | minor | Presenter has a separate tab, keeps its current screen when returning to design, and adds a frame thumbnail, device picker and scale controls. Numbers unchanged. | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 91f7a56be..97b2be71e 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1312,9 +1312,14 @@ impl FigApp { self.end_pen_outside_design(); tabs::tab_bar(self, ui); if self.ui.present.is_some() { + // A close request can arrive while the presenter fills the window. Let its unsaved + // changes dialog take Escape and draw above the player just as it does in the editor. + dialogs::keys(self, &ctx); present::show(self, ui); + dialogs::show(self, &ctx); // What went wrong while presenting (a widget's plugin failing) shows over it. self.toast_ui(&ctx); + windows::requests(self, &ctx); return; } if !self.has_files() || self.ui.home { diff --git a/crates/ui-egui/src/present.rs b/crates/ui-egui/src/present.rs index 9fc85337c..5a9d4bf37 100644 --- a/crates/ui-egui/src/present.rs +++ b/crates/ui-egui/src/present.rs @@ -541,7 +541,13 @@ impl Presenter { /// device's screen, other frames within themselves. fn range(&self, doc: &Document, frame: NodeId) -> (f64, f64) { let vp = if frame == self.current { viewport(doc, frame) } else { None }; - scroll_range_in(doc, frame, vp) + // In a responsive preview, make content outside the device reachable even if the source + // frame has no overflow mode. Its settings and geometry stay untouched in the file. + let mobile = frame == self.current && page_settings(doc, frame).device().is_some_and(|d| d.rotates); + let overflow = doc + .node(frame) + .map_or(Overflow::None, |n| if mobile && self.fit.is_some() && n.overflow == Overflow::None { Overflow::Both } else { n.overflow }); + scroll_range_with_overflow(doc, frame, vp, overflow) } /// What "Scroll to" `dest` moves: every scrolling frame around it, innermost first, brings the @@ -1171,8 +1177,13 @@ pub fn scroll_range(doc: &Document, frame: NodeId) -> (f64, f64) { /// frame taller than the screen scrolls through its whole height. Without a viewport the frame /// shows at its own size and what overflows it scrolls. Only the axes its overflow allows scroll. pub fn scroll_range_in(doc: &Document, frame: NodeId, viewport: Option<(f64, f64)>) -> (f64, f64) { + let overflow = doc.node(frame).map_or(Overflow::None, |n| n.overflow); + scroll_range_with_overflow(doc, frame, viewport, overflow) +} + +fn scroll_range_with_overflow(doc: &Document, frame: NodeId, viewport: Option<(f64, f64)>, overflow: Overflow) -> (f64, f64) { let Some(n) = doc.node(frame) else { return (0.0, 0.0) }; - if n.overflow == Overflow::None { + if overflow == Overflow::None { return (0.0, 0.0); } let (mut x1, mut y1) = (0.0f64, 0.0f64); @@ -1197,8 +1208,8 @@ pub fn scroll_range_in(doc: &Document, frame: NodeId, viewport: Option<(f64, f64 } None => (n.width, n.height), }; - let rx = if matches!(n.overflow, Overflow::Horizontal | Overflow::Both) { (x1 - vw).max(0.0) } else { 0.0 }; - let ry = if matches!(n.overflow, Overflow::Vertical | Overflow::Both) { (y1 - vh).max(0.0) } else { 0.0 }; + let rx = if matches!(overflow, Overflow::Horizontal | Overflow::Both) { (x1 - vw).max(0.0) } else { 0.0 }; + let ry = if matches!(overflow, Overflow::Vertical | Overflow::Both) { (y1 - vh).max(0.0) } else { 0.0 }; (if rx.is_finite() { rx } else { 0.0 }, if ry.is_finite() { ry } else { 0.0 }) } @@ -2367,7 +2378,7 @@ fn scrollers_at(p: &Presenter, base: &Document, disp: &Document, root: NodeId, p let mut out: Vec = disp .subtree(root) .into_iter() - .filter(|f| disp.node(*f).is_some_and(|n| n.visible && n.overflow != Overflow::None)) + .filter(|f| disp.node(*f).is_some_and(|n| n.visible)) .filter(|f| disp.world_bounds(*f).is_some_and(|b| place.rect(b).contains(q))) .filter(|f| p.range(base, *f) != (0.0, 0.0)) .collect(); @@ -2574,14 +2585,21 @@ fn input(p: &mut Presenter, ctx: &egui::Context, l: &Layout, over_area: bool, ke } return; } - // Otherwise the drag scrolls the innermost frame under it that scrolls, else pans a view - // bigger than the window. + // A drag begun inside a mobile screen moves its content, even if the pointer leaves the + // screen. The device body stays in place even when the drag begins outside its screen. + // Panning the whole view remains available only without a mobile device. if let Some(base) = p.doc.clone() { - let target = scrollers_at(p, &base, doc, root, &place, start) - .first() + let horizontal = d.x.abs() >= d.y.abs(); + let scrolls = scrollers_at(p, &base, doc, root, &place, start); + let on_axis = |range: (f64, f64)| if horizontal { range.0 > 0.0 } else { range.1 > 0.0 }; + let mobile = page_settings(&base, root).device().is_some_and(|device| device.rotates); + let target = scrolls + .iter() .copied() + .find(|f| on_axis(p.range(&base, *f))) + .or_else(|| scrolls.first().copied()) .map(Scroller::Frame) - .or((p.pan_range != (0.0, 0.0)).then_some(Scroller::View)); + .or((!mobile && p.pan_range != (0.0, 0.0)).then_some(Scroller::View)); if let Some(t) = target { p.fling = None; p.drag_scroll = Some((t, clamp_scroll(p.offset(t), p.limits(&base, t)))); @@ -2869,6 +2887,14 @@ mod tests { assert_eq!(ui.app.inspect()["presenter"]["scrollRange"], json!([0.0, 0.0])); assert_eq!(ui.app.session.doc().unwrap().node(frame).unwrap().width, 894.0, "the saved design keeps its geometry"); + let area = Rect::from_min_max(pos2(0.0, 40.0), pos2(1440.0, 900.0)); + let screen_before = layout(ui.app.ui.present.as_mut().unwrap(), area, FULL).unwrap().screen; + ui.button(pos2(720.0, 440.0), true); + ui.frame(vec![egui::Event::PointerMoved(pos2(300.0, 300.0))]); + ui.button(pos2(300.0, 300.0), false); + assert_eq!(ui.app.inspect()["presenter"]["scroll"], json!([0.0, 0.0]), "fitted content does not move"); + assert_eq!(layout(ui.app.ui.present.as_mut().unwrap(), area, FULL).unwrap().screen, screen_before); + let mut presenter = ui.app.ui.present.take().unwrap(); choose_device(&mut ui.app, &mut presenter, "None"); ui.app.ui.present = Some(presenter); @@ -2905,6 +2931,50 @@ mod tests { } } + #[test] + fn responsive_device_scrolls_content_in_both_directions_without_changing_saved_overflow() { + let mut session = figcraft_engine::Session::new(); + let frame = id(&session.execute("node.create", &json!({"type": "frame", "width": 894, "height": 844})).unwrap()); + session.execute("node.create", &json!({"type": "rectangle", "parent": frame, "x": 650, "y": 1050, "width": 80, "height": 80})).unwrap(); + let mut ui = Ui::new(session); + ui.run("proto.present", json!({"start": frame})); + let mut presenter = ui.app.ui.present.take().unwrap(); + choose_device(&mut ui.app, &mut presenter, "iPhone 17"); + ui.app.ui.present = Some(presenter); + ui.frame(vec![]); + + let range = &ui.app.inspect()["presenter"]["scrollRange"]; + assert!(range[0].as_f64().unwrap() > 0.0 && range[1].as_f64().unwrap() > 0.0, "{range}"); + let start = pos2(720.0, 440.0); + ui.button(start, true); + ui.frame(vec![egui::Event::PointerMoved(start - vec2(100.0, 120.0))]); + ui.button(start - vec2(100.0, 120.0), false); + let scroll = &ui.app.inspect()["presenter"]["scroll"]; + assert!(scroll[0].as_f64().unwrap() > 0.0 && scroll[1].as_f64().unwrap() > 0.0, "{scroll}"); + assert_eq!(ui.app.session.doc().unwrap().node(frame).unwrap().overflow, Overflow::None); + assert_eq!(ui.app.session.doc().unwrap().node(frame).unwrap().width, 894.0); + + // Like the phone preview, the content keeps following a drag after the pointer leaves + // the screen, while the device itself stays fixed on the stage. + ui.frames(60, Vec::new); + let area = Rect::from_min_max(pos2(0.0, 40.0), pos2(1440.0, 900.0)); + let screen_before = layout(ui.app.ui.present.as_mut().unwrap(), area, FULL).unwrap().screen; + ui.button(start, true); + ui.frame(vec![egui::Event::PointerMoved(pos2(300.0, 300.0))]); + let during = ui.app.inspect()["presenter"].clone(); + assert!(during["scroll"][0].as_f64().unwrap() > 0.0, "{during}"); + let screen_after = layout(ui.app.ui.present.as_mut().unwrap(), area, FULL).unwrap().screen; + assert_eq!(screen_after, screen_before); + ui.button(pos2(300.0, 300.0), false); + + let mut presenter = ui.app.ui.present.take().unwrap(); + choose_device(&mut ui.app, &mut presenter, "Desktop"); + ui.app.ui.present = Some(presenter); + ui.frame(vec![]); + let desktop = ui.app.inspect()["presenter"].clone(); + assert_eq!(desktop["scrollRange"], json!([0.0, 0.0])); + } + fn doc_with_two_frames() -> (Document, NodeId, NodeId) { let mut d = Document::new("t"); let page = d.add_page("Page 1"); diff --git a/crates/ui-egui/src/tabs.rs b/crates/ui-egui/src/tabs.rs index 534881fc3..381b09dd1 100644 --- a/crates/ui-egui/src/tabs.rs +++ b/crates/ui-egui/src/tabs.rs @@ -28,7 +28,7 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { ui.ctx().send_viewport_cmd(egui::ViewportCommand::Maximized(!max)); } } - let buttons_w = if app.ui.title_bar == TitleBar::Custom { window_buttons(ui, rect) } else { 0.0 }; + let buttons_w = if app.ui.title_bar == TitleBar::Custom { window_buttons(app, ui, rect) } else { 0.0 }; let mut x = rect.min.x + if app.ui.title_bar == TitleBar::Inset { 76.0 } else { 8.0 }; // Home. let hr = Rect::from_min_size(pos2(x, rect.min.y), vec2(44.0, HEIGHT)); @@ -256,7 +256,7 @@ pub fn live_mark(app: &FigApp, uid: u64) -> Option { } /// Minimise, maximise/restore and close at the right end of the title bar; returns their width. -fn window_buttons(ui: &mut Ui, bar: Rect) -> f32 { +fn window_buttons(app: &mut FigApp, ui: &mut Ui, bar: Rect) -> f32 { const W: f32 = 46.0; let t = Tokens::get(ui.ctx()); let max = ui.input(|i| i.viewport().maximized.unwrap_or(false)); @@ -284,7 +284,11 @@ fn window_buttons(ui: &mut Ui, bar: Rect) -> f32 { } icons::paint(ui.painter(), Rect::from_center_size(r.center(), vec2(14.0, 14.0)), icon, col); if resp.clicked() { - ui.ctx().send_viewport_cmd(cmd); + if close { + crate::windows::request_close(app, ui.ctx()); + } else { + ui.ctx().send_viewport_cmd(cmd); + } } } W * 3.0 diff --git a/crates/ui-egui/src/titlebar_tests.rs b/crates/ui-egui/src/titlebar_tests.rs index 796cb6700..e9224404d 100644 --- a/crates/ui-egui/src/titlebar_tests.rs +++ b/crates/ui-egui/src/titlebar_tests.rs @@ -4,6 +4,7 @@ use egui::{Event, PointerButton, Pos2, RawInput, Rect, ResizeDirection, ViewportCommand, ViewportId, pos2, vec2}; use figcraft_engine::Session; +use serde_json::json; use crate::{FigApp, NoServices, TitleBar}; @@ -76,7 +77,23 @@ fn window_buttons_minimise_maximise_and_close() { let mut u = Ui::new(TitleBar::Custom); assert!(u.click(window_button(0)).contains(&ViewportCommand::Minimized(true))); assert!(u.click(window_button(1)).contains(&ViewportCommand::Maximized(true))); - assert!(u.click(window_button(2)).contains(&ViewportCommand::Close)); + u.click(window_button(2)); + assert!(u.frame(vec![]).contains(&ViewportCommand::Close)); +} + +#[test] +fn titlebar_close_asks_over_the_presenter_when_a_file_is_unsaved() { + let mut u = Ui::new(TitleBar::Custom); + let frame = u.app.session.execute("node.create", &json!({"type": "frame", "width": 402, "height": 874})).unwrap()["id"].clone(); + u.app.session.execute("proto.present", &json!({"start": frame})).unwrap(); + u.app.handle_ui_requests(); + u.frame(vec![]); + assert!(u.app.ui.present.is_some()); + + let commands = u.click(window_button(2)); + assert!(!commands.contains(&ViewportCommand::Close)); + assert!(u.app.ui.confirm_close); + assert!(u.ctx.memory(|memory| memory.area_rect(egui::Id::new(Some(crate::i18n::tr("Unsaved changes")))).is_some())); } #[test] diff --git a/crates/ui-egui/src/windows.rs b/crates/ui-egui/src/windows.rs index 510c24f69..30b71f34f 100644 --- a/crates/ui-egui/src/windows.rs +++ b/crates/ui-egui/src/windows.rs @@ -300,7 +300,12 @@ pub fn on_close_request(app: &mut FigApp, ctx: &Context) { if app.windows.current == 0 && (unsaved || !app.windows.list.is_empty()) { ctx.send_viewport_cmd(ViewportCommand::CancelClose); } - if unsaved { + request_close(app, ctx); +} + +/// The custom title bar's Close button uses the same unsaved-file check as a system close event. +pub(crate) fn request_close(app: &mut FigApp, ctx: &Context) { + if !app.unsaved().is_empty() { app.ui.confirm_close = true; ctx.request_repaint(); } else { @@ -325,7 +330,7 @@ pub(crate) fn confirm_close(app: &mut FigApp, ctx: &Context) { } let t = crate::theme::Tokens::get(ctx); let (mut open, mut discard, mut cancel) = (true, false, false); - crate::dialogs::window(tr("Unsaved changes"), ctx).open(&mut open).show(ctx, |ui| { + crate::dialogs::window(tr("Unsaved changes"), ctx).order(egui::Order::Foreground).open(&mut open).show(ctx, |ui| { ui.set_width(340.0); crate::widgets::label(ui, &trf("Unsaved changes in {names}. Close the window and lose them?", &[("names", &names.join(", "))]), t.text); ui.add_space(12.0); diff --git a/crates/ui-egui/src/windows_tests.rs b/crates/ui-egui/src/windows_tests.rs index 1a6e91bbc..06e0a6a13 100644 --- a/crates/ui-egui/src/windows_tests.rs +++ b/crates/ui-egui/src/windows_tests.rs @@ -45,6 +45,25 @@ fn names(app: &FigApp) -> Vec { app.session.docs.iter().map(|d| d.doc.name.clone()).collect() } +#[test] +fn closing_a_window_in_the_presenter_shows_the_unsaved_changes_dialog() { + let mut session = Session::new(); + let frame_id = session.execute("node.create", &json!({"type": "frame", "width": 402, "height": 874})).unwrap()["id"].clone(); + let ctx = egui::Context::default(); + let mut app = FigApp::new(session, Box::new(NoServices)); + frame(&ctx, &mut app, false); + app.session.execute("proto.present", &json!({"start": frame_id})).unwrap(); + app.handle_ui_requests(); + frame(&ctx, &mut app, false); + assert!(app.ui.present.is_some()); + + frame(&ctx, &mut app, true); + assert!(app.ui.confirm_close); + assert!(ctx.memory(|memory| memory.area_rect(egui::Id::new(Some(crate::i18n::tr("Unsaved changes")))).is_some()), "dialog must be on screen"); + frame(&ctx, &mut app, false); + assert!(app.ui.present.is_some(), "asking to close does not dismiss the preview"); +} + #[test] fn windows_hold_tabs_and_close_with_their_files() { let mut s = Session::empty(); diff --git a/docs/gaps.md b/docs/gaps.md index 1e2cd1140..94c387e53 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -144,7 +144,11 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe - **Landed (2026-10-16):** choosing a presenter device reflows a copy of the frame to its screen size using constraints and auto layout, clears the previous screen's scroll and pan, and keeps the file's frame geometry unchanged; No device restores the original size. Tablet and computer - presets show the screen at their resolution without a drawn hardware body. + presets show the screen at their resolution without a drawn hardware body. In the full presenter, + dragging inside a phone or tablet scrolls content in either direction when it exceeds the screen, + even when the pointer moves outside the device. The device remains fixed; computer presets keep + their ordinary scrolling rules. These gestures do not alter the file. Closing a window from + presentation shows the unsaved-changes dialog over the presenter. - **Evidence:** ROADMAP item 7 ("Left: tool by tool, panel by panel against the incumbent"). - **Impact:** Figma users notice the feel within minutes; it decides whether they stay. - **Estimate:** 40–60 h. Detail in [`ui-parity.md`](ui-parity.md). From 3065cd6da9e4bdd65d438b95b609690ff275f3b7 Mon Sep 17 00:00:00 2001 From: Marco Arnulfo Date: Fri, 16 Oct 2026 14:49:23 +0200 Subject: [PATCH 077/817] M3: drag variant properties to reorder them in the Properties section --- crates/ui-egui/src/component_panel.rs | 17 ++- .../src/component_props_reorder_tests.rs | 125 ++++++++++++++++++ crates/ui-egui/src/lib.rs | 2 + docs/components-parity.md | 5 +- 4 files changed, 143 insertions(+), 6 deletions(-) create mode 100644 crates/ui-egui/src/component_props_reorder_tests.rs diff --git a/crates/ui-egui/src/component_panel.rs b/crates/ui-egui/src/component_panel.rs index 646d6ecdb..719c25887 100644 --- a/crates/ui-egui/src/component_panel.rs +++ b/crates/ui-egui/src/component_panel.rs @@ -20,7 +20,8 @@ use serde_json::{Value, json}; use crate::FigApp; use crate::i18n::{tr, tr_noop, trn}; use crate::icons::{self, Icon}; -use crate::right::{menu_item, menu_popup, row}; +use crate::list_drag::ListDrag; +use crate::right::{menu_item, menu_popup, row, row_rect}; use crate::theme::{COMPONENT, Tokens, semibold}; use crate::widgets; @@ -241,9 +242,11 @@ fn properties_ui(app: &mut FigApp, ui: &mut Ui, doc: &Document, owner: NodeId) { } else { Default::default() }; - // Variant properties: name, values (the matrix), add value, delete. - for (k, vals) in &variants { - row(ui, 32.0, |ui| { + // Variant properties: name, values (the matrix), add value, delete. Dragged by their left + // margin to reorder them (only among themselves: the shared ones keep the engine's order). + let mut drag = ListDrag::in_order(ui, ("variant_props", owner)); + for (i, (k, vals)) in variants.iter().enumerate() { + let header = row_rect(ui, 32.0, |ui| { let (ir, _) = ui.allocate_exact_size(vec2(14.0, 14.0), Sense::hover()); icons::paint(ui.painter(), ir, Icon::ComponentSet, COMPONENT); if let Some(nn) = widgets::text_field(ui, Id::new(("vprop_name", owner, k.as_str())), k, 110.0, tr("Name")) { @@ -284,6 +287,12 @@ fn properties_ui(app: &mut FigApp, ui: &mut Ui, doc: &Document, owner: NodeId) { }); vi += 3; } + drag.row(ui, i, header, header.with_max_y(ui.cursor().min.y.max(header.max.y)), || k.clone()); + } + if let Some((from, to)) = drag.finish(ui) + && let Some((k, _)) = variants.get(from) + { + app.run("component.editProperty", json!({"id": owner, "name": k, "index": to})); } // Shared properties. for (k, d) in &defs { diff --git a/crates/ui-egui/src/component_props_reorder_tests.rs b/crates/ui-egui/src/component_props_reorder_tests.rs new file mode 100644 index 000000000..729185ce7 --- /dev/null +++ b/crates/ui-egui/src/component_props_reorder_tests.rs @@ -0,0 +1,125 @@ +//! Dragging variant properties in a component set's Properties section, driven through egui +//! headless: a property dragged by its left margin moves in one undo step (its values go with it, +//! instances follow), its fields don't start a drag, and Escape cancels. + +use egui::{Event, Pos2, vec2}; +use figcraft_doc::NodeId; +use figcraft_engine::Session; +use serde_json::json; + +use crate::layers_drag_tests::Ui; +use crate::list_drag::grip_id; + +fn id(v: serde_json::Value) -> NodeId { + NodeId(v["id"].as_u64().unwrap()) +} + +/// A selected set whose variants list Size then State (two values each), a shared boolean "Icon", +/// and an instance of the set. Returns (ui, set, instance). +fn setup() -> (Ui, NodeId, NodeId) { + let mut s = Session::new(); + let mut variants = 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()); + 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(); + 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) +} + +/// Property names of `id` (a set or an instance), in the order they're listed. +fn names(u: &mut Ui, id: NodeId) -> Vec { + let props = u.app.session.execute("component.properties", &json!({"id": id})).unwrap(); + props["properties"].as_array().unwrap().iter().map(|p| p["name"].as_str().unwrap().to_string()).collect() +} + +fn undo_len(u: &Ui) -> usize { + u.app.session.ds().unwrap().history.undo.len() +} + +/// The middle of the grip of variant property `index` (as laid out last frame). +fn grip(u: &Ui, set: NodeId, index: usize) -> Option { + u.ctx.read_response(grip_id(("variant_props", set), index)).map(|r| r.rect.center()) +} + +/// Press at `from`, move to `to` in small steps, and leave the button down. +fn drag(u: &mut Ui, from: Pos2, to: Pos2) { + u.button(from, true); + for k in 1..=10 { + u.frame(vec![Event::PointerMoved(from + (to - from) * (k as f32 / 10.0))]); + } +} + +#[test] +fn dragging_a_variant_property_reorders_it_in_one_step() { + let (mut u, set, inst) = setup(); + assert_eq!(names(&mut u, set), ["Size", "State", "Icon"]); + let (size, state) = (grip(&u, set, 0).expect("variant properties have a grip"), grip(&u, set, 1).unwrap()); + assert!(size.y < state.y, "listed in order"); + let undo = undo_len(&u); + // State above Size. + let to = size - vec2(0.0, 12.0); + drag(&mut u, state, to); + assert_eq!(names(&mut u, set), ["Size", "State", "Icon"], "nothing moves before the drop"); + u.button(to, false); + assert_eq!(names(&mut u, set), ["State", "Size", "Icon"]); + assert_eq!(names(&mut u, inst), ["State", "Size", "Icon"], "the instance lists the new order"); + let doc = u.app.session.doc().unwrap(); + let first = doc.node(set).unwrap().children[0]; + assert!(doc.node(first).unwrap().name.starts_with("State="), "{}", doc.node(first).unwrap().name); + assert_eq!(undo_len(&u), undo + 1); + assert!(u.app.ui.last_error.is_none(), "{:?}", u.app.ui.last_error); + // Dropped where it is: nothing changes. + u.frame(vec![]); + u.frame(vec![]); + let g = grip(&u, set, 0).unwrap(); + drag(&mut u, g, g + vec2(0.0, 6.0)); + u.button(g + vec2(0.0, 6.0), false); + assert_eq!(undo_len(&u), undo + 1); + assert!(u.app.session.undo().unwrap()); + assert_eq!(names(&mut u, set), ["Size", "State", "Icon"]); +} + +#[test] +fn a_property_dropped_under_the_last_ones_values_lands_last() { + let (mut u, set, _) = setup(); + let size = grip(&u, set, 0).unwrap(); + // State's header is 32 high and its value row 30 under it: 58 down is on the value row, below + // the header's half-row slack, so only an area that takes in the values counts it. + let state = u.ctx.read_response(grip_id(("variant_props", set), 1)).unwrap().rect; + let to = Pos2::new(size.x, state.min.y + 58.0); + drag(&mut u, size, to); + u.button(to, false); + assert_eq!(names(&mut u, set), ["State", "Size", "Icon"]); +} + +#[test] +fn pressing_the_name_field_does_not_start_a_drag() { + // A guard: on main there's no grip at all; it fails if the whole row becomes a drag handle. + let (mut u, set, _) = setup(); + let (size, state) = (grip(&u, set, 0).unwrap(), grip(&u, set, 1).unwrap()); + let undo = undo_len(&u); + let field = size + vec2(60.0, 0.0); + drag(&mut u, field, Pos2::new(field.x, state.y + 40.0)); + u.button(Pos2::new(field.x, state.y + 40.0), false); + assert_eq!(names(&mut u, set), ["Size", "State", "Icon"]); + assert_eq!(undo_len(&u), undo); +} + +#[test] +fn escape_cancels_a_property_drag_and_keeps_the_selection() { + // A guard: the cancel comes from the shared list drag. + let (mut u, set, _) = setup(); + let (size, state) = (grip(&u, set, 0).unwrap(), grip(&u, set, 1).unwrap()); + let undo = undo_len(&u); + let to = size - vec2(0.0, 12.0); + drag(&mut u, state, to); + u.frame(vec![Event::Key { key: egui::Key::Escape, physical_key: None, pressed: true, repeat: false, modifiers: Default::default() }]); + u.button(to, false); + assert_eq!(names(&mut u, set), ["Size", "State", "Icon"]); + assert_eq!(undo_len(&u), undo); + assert_eq!(u.app.session.ds().unwrap().selection, [set], "the Escape only cancels the drag"); +} diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 20a8a77c1..77ce70935 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -84,6 +84,8 @@ mod colorpicker_selection_tests; #[cfg(test)] mod comments_tests; #[cfg(test)] +mod component_props_reorder_tests; +#[cfg(test)] mod cursors_tests; #[cfg(test)] mod dev_mode_tests; diff --git a/docs/components-parity.md b/docs/components-parity.md index 659676fd4..8ad788bf1 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-10-14 · **Change:** minor (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-10-16 · **Change:** minor (variant properties reorder by dragging in the Properties section; 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 @@ -19,7 +19,7 @@ accounts). | Component sets / variants, add variant, switch | done | | | 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 | reordering through `component.editProperty {index}`; no drag in the panel yet | +| Variant property order (names rewritten), duplicate combinations reported | done | drag a variant property by its left margin in the Properties section (or `component.editProperty {index}`); variant properties reorder among themselves; boolean, text, instance swap and slot properties keep a fixed (alphabetical) order | | Properties: boolean, text, instance swap (preferred values), variant | done | | | Slots (preferred components, fill menu, kept across updates) | done | Figma 2025 feature | | Exposed nested instances | done | hidden ones hide their properties | @@ -76,6 +76,7 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`. | Date | Change | Summary | |---|---|---| +| 2026-10-16 | minor | Variant properties reorder by dragging their left margin in a component or set's Properties section (insertion line, Escape cancels, one undo step; instances follow) | | 2026-10-14 | minor | Variables export in the browser: Export… ▸ Variables JSON / CSS custom properties did nothing in the web build, which has no save dialogs; it now hands the file over as a download (`Services::downloads` / `download`, `variables_export_ui_tests`). Import in the browser still needs a file picker, as do the other exports there. Numbers unchanged. | | 2026-10-13 | minor | Component playground (M3): with an instance, a component or a component set selected, the Inspect tab shows a Playground: a preview of the component and a control for each variant, boolean and text property. What is tried there changes the preview and the code in the Code section, never the file (no undo step, the canvas instance stays as it is); Reset goes back to the component's or the instance's own values. `component.playground {id?, properties?, language?, path?}` gives the same to scripts: the properties with their values, the code, and a PNG on request (`playground_tests`). Left: instance-swap and slot properties in the playground (the command takes an instance swap; the panel has no control for it), a code connect template's snippet with the tried values. Numbers unchanged. | | 2026-10-13 | minor | Variables inside styles (M3): a shared style can bind variables to fields of its value (`style.bind {style, field, variable?}`: a paint style's colours and gradient stops, an effect style's colour, radius, spread and offsets, a grid style's size, count, gutter and offset, a text style's font size, line height, letter spacing, family and style). Every layer using the style shows those fields resolved in its own modes and stays linked when a variable or a mode changes; the style keeps them resolved in the default modes. A style made from a layer keeps that layer's bindings; a new value drops bindings to what is gone. The style editor binds from its property rows (paint colour, shadow colour, blur radius, grid size) and detaches from the variable's chip; the style picker marks styles that use variables. `.fig` export and import carry the bindings on the style, REST layers hand theirs to the style they use. Left: binding text style fields and the other effect and grid fields from the editor (commands only), library variables in the picker, a style's library copy. Numbers unchanged. | From 0e25cf4c2651db9395024cff75b7e1c5958bc7b8 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Fri, 16 Oct 2026 13:47:07 +0000 Subject: [PATCH 078/817] Refuse pages in edit.copy and edit.cut Found while testing crates/engine/src/cmd/edit.rs:499 (copy_to_clipboard, called from copy at :536 and cut at :542) Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/engine/src/cmd/edit.rs | 11 +++++++++-- crates/engine/src/tests.rs | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index 2c767b933..ab503a022 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -499,7 +499,12 @@ fn bump_name(n: &str) -> String { pub fn copy_to_clipboard(s: &mut Session, ids: &[NodeId]) -> Result<()> { let ds = s.ds()?; let doc = &ds.doc; - let ids = z_sorted(doc, &roots(doc, ids)); + // Pages are not layers: they can't be pasted anywhere. + let layers: Vec = ids.iter().copied().filter(|i| !doc.node(*i).is_some_and(Node::is_page)).collect(); + if layers.is_empty() && !ids.is_empty() { + return Err(EngineError::Disabled("edit.copy".into(), "pages can't be copied; use page.duplicate".into())); + } + let ids = z_sorted(doc, &roots(doc, &layers)); let mut nodes = Vec::new(); let mut images = BTreeMap::new(); for i in &ids { @@ -542,7 +547,9 @@ fn copy(s: &mut Session, p: &Value) -> Result { fn cut(s: &mut Session, p: &Value) -> Result { let ids = req_targets("edit.cut", s, p)?; copy_to_clipboard(s, &ids)?; - delete(s, &json!({"ids": ids})) + let doc = s.doc()?; + let layers: Vec = ids.into_iter().filter(|i| !doc.node(*i).is_some_and(Node::is_page)).collect(); + delete(s, &json!({"ids": layers})) } /// Paste the clipboard under `parent` with the copied top-left moved to `at` (page coords). diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index dbf432d41..6010559e7 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -621,3 +621,20 @@ fn find_replace_changing_only_the_case_replaces_every_occurrence() { assert_eq!(s.doc().unwrap().node(t).unwrap().kind.text().unwrap().characters, "FigCraft and FigCraft, FigCraft"); assert_eq!(s.doc().unwrap().node(f).unwrap().name, "FigCraft / FigCraft"); } + +#[test] +fn copy_and_cut_ignore_pages_so_paste_keeps_the_document_valid() { + for cmd in ["edit.copy", "edit.cut"] { + let mut s = sess(); + let page = s.page().unwrap(); + s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap(); + let r = s.execute(cmd, &json!({"ids": [page.0]})); + if let Ok(v) = &r { + assert!(v.get("deleted").is_none_or(|d| d == &json!([])), "{cmd} reported the page as deleted: {v}"); + } + let _ = s.execute("edit.paste", &json!({})); + let doc = s.doc().unwrap(); + assert!(doc.validate().is_empty(), "{cmd}: {:?}", doc.validate()); + assert!(doc.node(page).is_some(), "{cmd} removed the page"); + } +} From 554821afef53d20d7894eeddd9b48f7a265a9eb0 Mon Sep 17 00:00:00 2001 From: Barzabel Date: Fri, 16 Oct 2026 17:31:11 +0300 Subject: [PATCH 079/817] M9: a damaged generation field no longer drops a log's flushed edits (#408) A log whose generation isn't its snapshot's was skipped as a leftover of a compaction cut short, but neither generation is under a checksum: one flipped bit made the server serve the older document, report nothing and overwrite the log. Replay such a log over the snapshot instead: replay skips what the snapshot already holds, so a genuine leftover changes nothing, while edits the snapshot lacks are recovered and the damage is reported. --- apps/figcraft-server/src/disk.rs | 6 +- apps/figcraft-server/src/store.rs | 30 +++- apps/figcraft-server/tests/header_recovery.rs | 139 ++++++++++++++++++ docs/server.md | 5 +- 4 files changed, 173 insertions(+), 7 deletions(-) create mode 100644 apps/figcraft-server/tests/header_recovery.rs diff --git a/apps/figcraft-server/src/disk.rs b/apps/figcraft-server/src/disk.rs index f58f25b21..af6e0f990 100644 --- a/apps/figcraft-server/src/disk.rs +++ b/apps/figcraft-server/src/disk.rs @@ -8,8 +8,10 @@ //! length (u32 LE), CRC-32 (u32 LE), one [`Journal`] entry in the wire encoding. //! //! Compaction writes the next generation's snapshot, then an empty log of that generation. A log -//! whose generation isn't the snapshot's is from before a compaction that was cut short: what it -//! holds is in the snapshot already. A log ends at its first damaged record (a write cut short). +//! whose generation isn't the snapshot's is usually from before a compaction that was cut short +//! (what it holds is in the snapshot already), but no checksum covers either generation, so the +//! store replays such a log anyway and reports any change the snapshot lacked. A log ends at its +//! first damaged record (a write cut short). use std::fs::{self, File}; use std::io::{self, Read, Write}; diff --git a/apps/figcraft-server/src/store.rs b/apps/figcraft-server/src/store.rs index 538adefff..ea9bc626c 100644 --- a/apps/figcraft-server/src/store.rs +++ b/apps/figcraft-server/src/store.rs @@ -440,7 +440,7 @@ impl Store { && let Ok(log) = disk::read_log(&bytes) && log.generation != generation { - log::info!("file at {}: its log predates the last compaction; it is ignored", path.display()); + log::info!("file at {}: its log isn't of its snapshot's generation; it is replayed over it when the file opens", path.display()); } let bytes = [SNAPSHOT, LOG].iter().filter_map(|n| fs::metadata(path.join(n)).ok()).map(|m| m.len()).sum(); Ok(Entry { meta, links, log: None, bytes, forced: 0 }) @@ -1126,8 +1126,32 @@ impl Store { fresh_log = true; } } - // From before a compaction that was cut short: the snapshot has it all. - Ok(_) => {} + // From before a compaction that was cut short, the snapshot has it all; or a generation + // field damaged, which no checksum covers. Replaying tells them apart without trusting + // it: entries the snapshot holds are skipped, so only edits it lacks change anything. + Ok(log) => { + let before = server.seq(); + let mut stopped = None; + for entry in log.entries { + if let Err(e) = server.replay(entry) { + stopped = Some(e); + break; + } + } + let (snap, found, recovered) = (generation, log.generation, server.seq().saturating_sub(before)); + if recovered > 0 { + issues.push(format!( + "file {file}: its log's generation ({found}) doesn't match its snapshot's ({snap}), but it held \ + {recovered} changes the snapshot didn't; they were recovered" + )); + } + if let Some(e) = stopped { + issues.push(format!( + "file {file}: its log's generation ({found}) doesn't match its snapshot's ({snap}) and it stops \ + making sense after {recovered} newer changes ({e}); the rest was dropped" + )); + } + } Err(why) => issues.push(format!("file {file}: {why}; starting a new log")), } for i in issues { diff --git a/apps/figcraft-server/tests/header_recovery.rs b/apps/figcraft-server/tests/header_recovery.rs new file mode 100644 index 000000000..d728908d1 --- /dev/null +++ b/apps/figcraft-server/tests/header_recovery.rs @@ -0,0 +1,139 @@ +//! A generation field damaged after an abrupt stop must not make the server drop a log that still +//! holds confirmed edits (#408): the log is replayed over the snapshot, which only the changes the +//! snapshot lacks survive, and the damage is reported. A genuine leftover of a compaction cut short +//! still restores silently. +#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)] + +use figcraft_collab::message::{Access, ClientMsg}; +use figcraft_collab::{Client, Outgoing, Replica, Server}; +use figcraft_collab_net::hub::Backend; +use figcraft_doc::Document; +use figcraft_server::config::Config; +use figcraft_server::disk::{self, LOG, SNAPSHOT}; +use figcraft_server::store::{FILES, Store}; +use std::fs; +use std::path::{Path, PathBuf}; + +struct Fixture(PathBuf); + +impl Fixture { + fn new() -> Self { + let path = std::env::temp_dir().join(format!("figcraft-header-recovery-{}", figcraft_collab_net::token::file_id().unwrap())); + fs::create_dir(&path).unwrap(); + Self(path) + } +} + +impl Drop for Fixture { + fn drop(&mut self) { + let _ = fs::remove_dir_all(&self.0); + } +} + +fn page_name(server: &Server) -> String { + let doc = server.document(); + doc.node(doc.first_page().unwrap()).unwrap().name.clone() +} + +/// A published file whose first page was renamed "Kept", flushed to its log (not compacted), then +/// the store dropped without stopping (an abrupt stop). Returns the file id and the final state. +fn renamed_and_stopped(data: &Path) -> (String, Server) { + let mut store = Store::open(data, Config::default().store()).unwrap(); + let snapshot = Replica::new(Document::new("Fixture")).snapshot().unwrap(); + let (info, _, _) = store.publish("Fixture", &snapshot).unwrap(); + let id = info.id; + let mut server = store.open(&id).unwrap(); + let ClientMsg::Hello(hello) = Client::hello("f", "", "Editor", "#FF8800") else { panic!("not a hello") }; + let (_, messages) = server.join_as(hello, Access::Edit).unwrap(); + let Some(Outgoing::To(_, welcome)) = messages.into_iter().next() else { panic!("no welcome") }; + let mut client = Client::join(welcome).unwrap(); + store.changed(&id, &mut server); + let mut edited = client.document().clone(); + let page = edited.first_page().unwrap(); + edited.node_mut(page).unwrap().name = "Kept".into(); + let change = client.edit(&edited).unwrap().unwrap(); + assert!(!server.receive(client.id(), change).is_empty()); + store.changed(&id, &mut server); + assert!(store.flush().is_empty(), "the edit must reach disk"); + assert_eq!(page_name(&server), "Kept"); + let dir = data.join(FILES).join(&id); + assert!(!disk::read_log(&fs::read(dir.join(LOG)).unwrap()).unwrap().entries.is_empty()); + assert_eq!(disk::decode_snapshot(&fs::read(dir.join(SNAPSHOT)).unwrap()).unwrap().1.seq, 0, "the rename is only in the log"); + drop(store); + (id, server) +} + +/// Reopen the data directory: the file's first page name and the problems reported. +fn reopen(data: &Path, id: &str) -> (String, Vec) { + let mut store = Store::open(data, Config::default().store()).unwrap(); + let server = store.open(id).unwrap(); + (page_name(&server), store.problems().to_vec()) +} + +fn flip(path: &Path, at: usize) { + let mut bytes = fs::read(path).unwrap(); + bytes[at] ^= 1; + fs::write(path, bytes).unwrap(); +} + +/// The generation field's first byte in both headers (after the magic and the format byte). +const GENERATION_AT: usize = 5; + +#[test] +fn an_intact_log_restores_its_edits_without_a_report() { + let fixture = Fixture::new(); + let (id, _) = renamed_and_stopped(&fixture.0); + let (name, problems) = reopen(&fixture.0, &id); + assert_eq!(name, "Kept"); + assert!(problems.is_empty(), "{problems:?}"); +} + +#[test] +fn a_damaged_log_generation_keeps_the_edits_and_is_reported() { + let fixture = Fixture::new(); + let (id, _) = renamed_and_stopped(&fixture.0); + let log = fixture.0.join(FILES).join(&id).join(LOG); + flip(&log, GENERATION_AT); + // The records themselves still read: only the header's generation changed. + let read = disk::read_log(&fs::read(&log).unwrap()).unwrap(); + assert!(read.damaged.is_none() && !read.entries.is_empty()); + let (name, problems) = reopen(&fixture.0, &id); + assert_eq!(name, "Kept", "the flushed rename must survive"); + assert!(problems.iter().any(|p| p.contains(&id) && p.contains("generation")), "{problems:?}"); + // And it stays: the recovered edit is now in the file's snapshot. + assert_eq!(reopen(&fixture.0, &id).0, "Kept"); +} + +#[test] +fn a_damaged_snapshot_generation_keeps_the_edits_and_is_reported() { + let fixture = Fixture::new(); + let (id, _) = renamed_and_stopped(&fixture.0); + let snapshot = fixture.0.join(FILES).join(&id).join(SNAPSHOT); + flip(&snapshot, GENERATION_AT); + assert!(disk::check_snapshot(&fs::read(&snapshot).unwrap()).is_ok(), "the generation is outside the checksum"); + let (name, problems) = reopen(&fixture.0, &id); + assert_eq!(name, "Kept", "the flushed rename must survive"); + assert!(problems.iter().any(|p| p.contains(&id) && p.contains("generation")), "{problems:?}"); + assert_eq!(reopen(&fixture.0, &id).0, "Kept"); +} + +#[test] +fn a_damaged_log_format_is_still_reported() { + let fixture = Fixture::new(); + let (id, _) = renamed_and_stopped(&fixture.0); + flip(&fixture.0.join(FILES).join(&id).join(LOG), 4); + let (_, problems) = reopen(&fixture.0, &id); + assert!(problems.iter().any(|p| p.contains(&id) && p.contains("format")), "{problems:?}"); +} + +#[test] +fn a_log_left_by_a_compaction_cut_short_restores_without_a_report() { + let fixture = Fixture::new(); + let (id, server) = renamed_and_stopped(&fixture.0); + // The next snapshot was written (it holds the rename); the old log wasn't replaced yet. + let bytes = disk::encode_snapshot(2, &server.state().unwrap()).unwrap(); + fs::write(fixture.0.join(FILES).join(&id).join(SNAPSHOT), bytes).unwrap(); + let (name, problems) = reopen(&fixture.0, &id); + assert_eq!(name, "Kept"); + assert!(problems.is_empty(), "a leftover log is expected, not damage: {problems:?}"); +} diff --git a/docs/server.md b/docs/server.md index f2e4820ca..021d0e3fe 100644 --- a/docs/server.md +++ b/docs/server.md @@ -337,8 +337,9 @@ the address it came from and when it was last opened (for expiry). before the server tells anyone about the change. - **Compaction** writes the file's state as the next snapshot and starts an empty log, after `compact_after` entries or `compact_mb` of log, when the last person leaves, and when the server - stops. A log left over from a compaction cut short is recognised and ignored (the snapshot holds - it all). + stops. A log left over from a compaction cut short is replayed over the snapshot, which already + holds it all, so nothing changes. If a damaged generation field made a current log look like such + a leftover, its edits the snapshot lacks are recovered the same way and the damage is reported. - **Damage is skipped and reported, never deleted.** At startup a folder whose description, links or snapshot can't be read is left out and logged; a log that ends in a cut-short or damaged record loses only that end (logged when the file opens). Leftover temporary files are removed. From 8303cfa56f19fd11c13bb4f6933edd5717c7de03 Mon Sep 17 00:00:00 2001 From: RealtaNua Date: Fri, 16 Oct 2026 22:52:41 +0700 Subject: [PATCH 080/817] fix(engine): Shift-drag on a selected layer moves the selection (#498) Shift on a selected layer took it out of the selection on press, so the drag that followed had nothing to move, and with several layers selected the grabbed one stayed behind. It now leaves the selection on release, and only when the press didn't become a drag. Where no move can start (a version being viewed), it still leaves on press. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../engine/src/selection_behaviour_tests.rs | 89 +++++++++++++++++++ crates/engine/src/tools.rs | 38 +++++--- docs/ui-parity.md | 2 +- 3 files changed, 115 insertions(+), 14 deletions(-) diff --git a/crates/engine/src/selection_behaviour_tests.rs b/crates/engine/src/selection_behaviour_tests.rs index b65b79363..bc961a4a3 100644 --- a/crates/engine/src/selection_behaviour_tests.rs +++ b/crates/engine/src/selection_behaviour_tests.rs @@ -275,3 +275,92 @@ fn locked_layers_selected_in_the_layers_panel_stay_put() { ex(&mut s, "object.toggleLock", json!({"ids": [k.g], "locked": true})); assert_eq!(handle_at(s.doc().unwrap(), &[k.a], Point::new(60.0, 60.0), 1.0), None); } + +#[test] +fn shift_drag_moves_the_selection() { + let mut s = Session::new(); + let k = scene(&mut s); + let at = |s: &Session, i: NodeId| s.doc().unwrap().world_bounds(i).unwrap().origin(); + let home = (Point::new(500.0, 0.0), Point::new(600.0, 0.0)); + // (selection before, Shift-drag to (from r at 520,20), selection after, where r and empty end up, derivation) + let rows: Vec<(Vec, (f64, f64), Vec, (Point, Point), &str)> = vec![ + ( + vec![k.r], + (560.0, 22.0), + vec![k.r], + (Point::new(540.0, 0.0), Point::new(600.0, 0.0)), + "Shift-drag on the selected layer moves it along one axis and keeps it selected", + ), + ( + vec![k.r, k.empty], + (560.0, 22.0), + vec![k.r, k.empty], + (Point::new(540.0, 0.0), Point::new(640.0, 0.0)), + "Shift-drag on one of several selected layers moves them all", + ), + ( + vec![k.empty], + (560.0, 22.0), + vec![k.r, k.empty], + (Point::new(540.0, 0.0), Point::new(640.0, 0.0)), + "Shift-drag on an unselected layer adds it and moves the selection", + ), + (vec![k.r, k.empty], (521.0, 21.0), vec![k.empty], home, "a Shift-press that wobbles under the drag threshold is a click: the layer leaves"), + ]; + for (before, to, after, end, why) in rows { + ex(&mut s, "select.set", json!({"ids": before})); + drag(&mut s, (520.0, 20.0), to, SHIFT); + assert_eq!(sorted(s.selection()), sorted(after), "{why}"); + assert_eq!((at(&s, k.r), at(&s, k.empty)), end, "{why}"); + if end != home { + assert!(s.undo().unwrap(), "{why}: one undo step"); + assert_eq!((at(&s, k.r), at(&s, k.empty)), home, "{why}: undone"); + } + } + // Shift let go before the button: still a Shift-click. + ex(&mut s, "select.set", json!({"ids": [k.r, k.empty]})); + s.pointer(&ev(PointerKind::Down, 520.0, 20.0, SHIFT)).unwrap(); + s.pointer(&ev(PointerKind::Up, 520.0, 20.0, NONE)).unwrap(); + assert_eq!(s.selection(), vec![k.empty], "Shift let go before the button still takes the layer out"); +} + +#[test] +fn alt_shift_drag_on_a_selected_layer_duplicates_it() { + let mut s = Session::new(); + let k = scene(&mut s); + let layers = |s: &Session| s.doc().unwrap().node(s.page().unwrap()).unwrap().children.len(); + let n = layers(&s); + let alt_shift = |kind, x, y| { + let mut e = ev(kind, x, y, SHIFT); + e.alt = true; + e + }; + ex(&mut s, "select.set", json!({"ids": [k.r]})); + s.pointer(&alt_shift(PointerKind::Down, 520.0, 20.0)).unwrap(); + s.pointer(&alt_shift(PointerKind::Up, 520.0, 20.0)).unwrap(); + assert_eq!(s.selection(), Vec::::new(), "an Alt+Shift-click is a Shift-click: the layer leaves the selection"); + assert_eq!(layers(&s), n, "and nothing is copied"); + ex(&mut s, "select.set", json!({"ids": [k.r]})); + s.pointer(&alt_shift(PointerKind::Down, 520.0, 20.0)).unwrap(); + s.pointer(&alt_shift(PointerKind::Move, 560.0, 22.0)).unwrap(); + s.pointer(&alt_shift(PointerKind::Up, 560.0, 22.0)).unwrap(); + let sel = s.selection(); + assert_eq!(layers(&s), n + 1, "an Alt+Shift-drag copies the layer"); + assert!(sel.len() == 1 && sel[0] != k.r, "the copy is selected"); + let doc = s.doc().unwrap(); + assert_eq!(doc.world_bounds(sel[0]).unwrap().origin(), Point::new(540.0, 0.0), "the copy moves along one axis"); + assert_eq!(doc.world_bounds(k.r).unwrap().origin(), Point::new(500.0, 0.0), "the original stays"); +} + +#[test] +fn shift_click_takes_a_layer_out_where_nothing_can_move() { + let mut s = Session::new(); + let k = scene(&mut s); + // A version being viewed is read-only: the press can't start a move. + let v = ex(&mut s, "file.saveVersion", json!({"name": "v"})); + ex(&mut s, "version.preview", json!({"id": v["id"]})); + ex(&mut s, "select.set", json!({"ids": [k.r, k.empty]})); + assert!(s.pointer(&ev(PointerKind::Down, 520.0, 20.0, SHIFT)).is_err(), "a version being viewed can't be edited"); + s.pointer(&ev(PointerKind::Up, 520.0, 20.0, SHIFT)).unwrap(); + assert_eq!(s.selection(), vec![k.empty], "Shift-click still takes the layer out"); +} diff --git a/crates/engine/src/tools.rs b/crates/engine/src/tools.rs index 3d3b9acb8..d074052fc 100644 --- a/crates/engine/src/tools.rs +++ b/crates/engine/src/tools.rs @@ -344,6 +344,9 @@ pub(crate) enum Gesture { targets: Targets, duplicate: bool, moved: bool, + /// A Shift-press on this selected layer: it leaves the selection on release, unless the + /// press became a drag. + deselect: Option, }, Resize { start: Point, @@ -1194,15 +1197,15 @@ impl Session { Some(target) => { // Clicking inside the current selection's box keeps it (drag them all). let in_sel_box = sel.len() > 1 && doc.bounds_of(&sel).is_some_and(|b| b.contains(ev.p())) && !ev.shift; + // Shift on a selected layer takes it out on release if the press doesn't become a + // drag; a drag moves the selection with it. Where no drag can start, it goes now. + let deselect = (ev.shift && sel.contains(&target)).then_some(target); + let without_target = || sel.iter().copied().filter(|x| *x != target).collect::>(); let new_sel = if in_sel_box && (sel.contains(&target) || sel.iter().any(|s| doc.is_ancestor(*s, target))) { sel.clone() - } else if ev.shift { + } else if ev.shift && deselect.is_none() { let mut s2 = sel.clone(); - if let Some(pos) = s2.iter().position(|x| *x == target) { - s2.remove(pos); - } else { - s2.push(target); - } + s2.push(target); s2 } else if sel.contains(&target) { sel.clone() @@ -1210,12 +1213,12 @@ impl Session { vec![target] }; self.set_selection(new_sel.clone()); - if new_sel.is_empty() || doc.node(target).is_some_and(|n| n.locked) { - return Ok(()); - } // Locked layers selected in the layers panel stay put. let ids: Vec = roots(&doc, &new_sel).into_iter().filter(|i| !locked_in(&doc, *i)).collect(); - if ids.is_empty() { + if new_sel.is_empty() || doc.node(target).is_some_and(|n| n.locked) || ids.is_empty() { + if deselect.is_some() { + self.set_selection(without_target()); + } return Ok(()); } let mut targets = Targets::gather(&doc, page, &ids); @@ -1225,8 +1228,13 @@ impl Session { { targets.add_box(b); } - self.begin_interaction(if ev.alt { "Duplicate" } else { "Move" })?; - self.tool.gesture = Gesture::Move { start: ev.p(), ids, targets, duplicate: ev.alt, moved: false }; + if let Err(e) = self.begin_interaction(if ev.alt { "Duplicate" } else { "Move" }) { + if deselect.is_some() { + self.set_selection(without_target()); + } + return Err(e); + } + self.tool.gesture = Gesture::Move { start: ev.p(), ids, targets, duplicate: ev.alt, moved: false, deselect }; self.tool.overlay.cursor = if ev.alt { Cursor::Copy } else { Cursor::Default }; } None => { @@ -1735,7 +1743,7 @@ impl Session { self.tool.overlay.drop_cell = None; let drop_target = self.tool.overlay.drop_target.take(); match g { - Gesture::Move { ids, moved, duplicate, start, .. } => { + Gesture::Move { ids, moved, duplicate, start, deselect, .. } => { if moved { // A free move lands in the frame under the pointer (or the page) where it was // dropped; layers in an auto layout frame already sit in their slot. @@ -1777,6 +1785,10 @@ impl Session { } } else { self.cancel_interaction()?; + if let Some(d) = deselect { + let sel = self.selection().into_iter().filter(|x| *x != d).collect(); + self.set_selection(sel); + } if !(ev.shift || ev.cmd || duplicate) { self.widget_click(start, ev.tol() * 2.0)?; } diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 62001715e..a8dfab696 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -48,7 +48,7 @@ interaction feel not yet compared. | Item | Status | Notes | |---|---|---| -| Click, Shift-click, marquee, Shift-marquee toggle | done | 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`) | +| Click, Shift-click, marquee, Shift-marquee toggle | done | a marquee selects what it touches; from a top-level frame's background, the layers inside it; locked and hidden layers are skipped; Shift-click takes a selected layer out on release, so a Shift-drag on it moves the selection along one axis instead (`selection_behaviour_tests`) | | Deep select (Cmd/Ctrl-click, Cmd/Ctrl-marquee) | done | | | Select layer menu (every layer under the click) | done | | | Enter / Shift+Enter (children / parent), Tab / Shift+Tab (siblings) | done | Tab renames the next layer while renaming | From d1d8c3f652cea20bee02bdbc3ded9a2f5362ba08 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 16 Oct 2026 12:08:58 -0400 Subject: [PATCH 081/817] ci: standardize FreeBSD workflow on shared FreeBSD 15.1 action (#640) * ci: standardize FreeBSD workflow on shared FreeBSD 15.1 action * ui: widen About window so contributor table fits with Inter font --- .github/workflows/freebsd.yml | 1 - crates/ui-egui/src/dialogs.rs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index ca0cd49f6..b01af0524 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -31,6 +31,5 @@ jobs: # Intentionally tracked at @main (not SHA-pinned) so org-wide CI improvements, security fixes, and build optimizations propagate without PR churn across all craftapp repos. uses: storytold/craft-common-actions/.github/workflows/freebsd.yml@main with: - freebsd-release: "14.3" run-package-check: true craft-fonts-ref: 43913056ce82a3fdad0ef69f6b88d1dc922a8104 diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 236f8e0d0..6e0ee3a63 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -84,7 +84,7 @@ impl AboutTab { } /// The About window's width, the same on every tab (the Contributors table needs the room). -pub const ABOUT_WIDTH: f32 = 640.0; +pub const ABOUT_WIDTH: f32 = 660.0; /// The About window's tab row, drawn like the Design / Prototype tabs of the right panel. /// A row of tabs (the About window's, the shortcuts panel's): the current one highlighted. From 40955aae7c97d48667c2a114bf31a260a257025c Mon Sep 17 00:00:00 2001 From: RealtaNua Date: Fri, 16 Oct 2026 23:09:59 +0700 Subject: [PATCH 082/817] fix(ui): Cmd/Ctrl+V pastes an image copied in another app (#663) egui-winit swallows the Cmd/Ctrl+V press and sends a paste event only when the clipboard holds text, so with an image on the clipboard only the key's release arrives and the image fallback, which waited for the press, never ran. Paste from a V release whose press never came and brought no paste event; the press and paste event are tracked from the raw events at the start of each frame. On Wayland arboard read the X11 clipboard, which the compositor does not fill for a native Wayland window, so every system paste found it empty. Enable arboard's wayland-data-control: it uses the Wayland clipboard when WAYLAND_DISPLAY is set and falls back to X11 otherwise. Right-click > Paste here now follows the same newest-wins rule, so a newer image beats copied layers there too, and lands at the point. Co-Authored-By: Claude Opus 5.5 (1M context) --- Cargo.lock | 66 +++++++ apps/figcraft/Cargo.toml | 2 +- crates/ui-egui/src/lib.rs | 11 +- crates/ui-egui/src/menus.rs | 23 +-- crates/ui-egui/src/paste_image_tests.rs | 234 ++++++++++++++++++++++++ crates/ui-egui/src/shortcuts.rs | 44 ++++- 6 files changed, 360 insertions(+), 20 deletions(-) create mode 100644 crates/ui-egui/src/paste_image_tests.rs diff --git a/Cargo.lock b/Cargo.lock index aead39d1f..bc60687eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -259,6 +259,7 @@ dependencies = [ "parking_lot", "percent-encoding", "windows-sys 0.60.2", + "wl-clipboard-rs", "x11rb", ] @@ -1734,6 +1735,12 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aedcfb3409746eddb02b9e19ebda1c3394f759a152e48ee875a0844d1b955484" +[[package]] +name = "fixedbitset" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" + [[package]] name = "flate2" version = "1.1.10" @@ -2820,6 +2827,15 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" +[[package]] +name = "nom" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" +dependencies = [ + "memchr", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -3204,6 +3220,16 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "os_pipe" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "parking" version = "2.2.1" @@ -3264,6 +3290,17 @@ version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" +[[package]] +name = "petgraph" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" +dependencies = [ + "fixedbitset", + "hashbrown 0.15.5", + "indexmap", +] + [[package]] name = "phf" version = "0.13.1" @@ -4574,6 +4611,17 @@ dependencies = [ "once_cell", ] +[[package]] +name = "tree_magic_mini" +version = "3.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8765b90061cba6c22b5831f675da109ae5561588290f9fa2317adab2714d5a6" +dependencies = [ + "memchr", + "nom", + "petgraph", +] + [[package]] name = "ttf-parser" version = "0.25.1" @@ -5726,6 +5774,24 @@ version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" +[[package]] +name = "wl-clipboard-rs" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d7888ccd4896447b2d14d3a9350a85df2aeb6f181e2e7a31349d104ac46cac1" +dependencies = [ + "libc", + "log", + "os_pipe", + "rustix 1.1.5", + "thiserror 2.0.21", + "tree_magic_mini", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-wlr", +] + [[package]] name = "write-fonts" version = "0.48.1" diff --git a/apps/figcraft/Cargo.toml b/apps/figcraft/Cargo.toml index bafb6da14..fcc5d03a7 100644 --- a/apps/figcraft/Cargo.toml +++ b/apps/figcraft/Cargo.toml @@ -21,7 +21,7 @@ eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit", " serde_json = { workspace = true } log = { workspace = true } rfd = { workspace = true } -arboard = { workspace = true, features = ["image-data"] } +arboard = { workspace = true, features = ["image-data", "wayland-data-control"] } webbrowser = { workspace = true } image = { workspace = true } env_logger = { version = "0.11", default-features = false, features = ["auto-color", "humantime"] } diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 20a8a77c1..bbc61149f 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -142,6 +142,8 @@ mod panel_reorder_tests; #[cfg(test)] mod panel_width_tests; #[cfg(test)] +mod paste_image_tests; +#[cfg(test)] mod pen_mode_tests; #[cfg(test)] mod perf_tests; @@ -494,6 +496,10 @@ pub struct UiState { /// What FigCraft last put on the system clipboard: when the clipboard still holds it, a paste /// uses our copied layers; anything else there (an image, SVG, text) came from another app. pub last_copy: Option, + /// Since the last V key release: whether its press arrived, and whether a paste event did + /// (`shortcuts::swallowed_paste`). + pub v_pressed: bool, + pub paste_event: bool, /// When (UI clock, seconds) open documents next get an autosave checkpoint. pub next_autosave: f64, /// With auto-save on: when (UI clock, seconds) files with unsaved changes are next saved, and @@ -587,6 +593,8 @@ impl Default for UiState { dev: dev_mode::DevUi::default(), last_copy: None, + v_pressed: false, + paste_event: false, next_autosave: 0.0, auto_save_at: None, auto_saving: Vec::new(), @@ -1283,6 +1291,7 @@ impl FigApp { // even if it lets go during the frame (Enter commits it), or as it began (egui drops the // focus on Escape before the frame, which cancels the field's edit and nothing else). let typing = std::mem::take(&mut self.field_focus) || a11y::field_focused(&ctx); + let paste_release = shortcuts::swallowed_paste(self, &ctx); // A dialog that closed acts first, in the window it was opened from. self.poll_dialog(&ctx); // Control requests run first so their results reflect this frame. @@ -1398,7 +1407,7 @@ impl FigApp { branch_ui::keys(self, &ctx); live::dialog_keys(self, &ctx); dialogs::keys(self, &ctx); - shortcuts::handle(self, &ctx, typing); + shortcuts::handle(self, &ctx, typing, paste_release); menus::popups(self, &ctx); variable_ui::picker(self, &ctx); style_picker::show(self, &ctx); diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index b9d3299a6..fcbc1dad4 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -32,17 +32,18 @@ pub const UI_COMMANDS: &[&str] = &[ /// Run a menu item: some open dialogs or use platform services, the rest go to the engine. /// Paste: the system clipboard wins when it holds something newer than our own copy (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). -pub fn paste(app: &mut FigApp, event_text: Option<&str>) { +/// 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. +pub fn paste(app: &mut FigApp, event_text: Option<&str>, at: Option<(f64, f64)>) { let sys_text = app.services.clipboard_get_text().or_else(|| event_text.map(str::to_string)).filter(|t| !t.is_empty()); let ours = sys_text.is_some() && sys_text == app.ui.last_copy; - let (cx, cy) = app.session.ds().map(|d| (d.view.cx, d.view.cy)).unwrap_or((0.0, 0.0)); + let (cx, cy) = at.or_else(|| app.session.ds().ok().map(|d| (d.view.cx, d.view.cy))).unwrap_or((0.0, 0.0)); if !ours { if let Some((png, w, h)) = clipboard_png(app) { use base64::Engine as _; let b64 = base64::engine::general_purpose::STANDARD.encode(png); - // Centred in the view. - let (x, y) = ((cx - f64::from(w) / 2.0).round(), (cy - f64::from(h) / 2.0).round()); + // Centred in the view; Paste here puts its top-left at the point, as it does layers. + let (x, y) = if at.is_some() { (cx, cy) } else { ((cx - f64::from(w) / 2.0).round(), (cy - f64::from(h) / 2.0).round()) }; app.run("file.import", json!({"data": b64, "name": "Pasted image.png", "x": x, "y": y})); return; } @@ -54,14 +55,14 @@ pub fn paste(app: &mut FigApp, event_text: Option<&str>) { } else if figcraft_engine::looks_like_svg(&text) { use base64::Engine as _; let b64 = base64::engine::general_purpose::STANDARD.encode(text.as_bytes()); - app.run("file.import", json!({"data": b64, "name": "Pasted SVG.svg", "x": cx, "y": cy, "center": true})); + app.run("file.import", json!({"data": b64, "name": "Pasted SVG.svg", "x": cx, "y": cy, "center": at.is_none()})); } else { app.run("text.create", json!({"text": text, "x": cx, "y": cy})); } return; } } - app.run("edit.paste", json!({})); + app.run("edit.paste", at.map_or(json!({}), |(x, y)| json!({"x": x, "y": y}))); } /// The system clipboard's image as PNG bytes, with its size. @@ -143,7 +144,7 @@ pub fn invoke(app: &mut FigApp, id: &str) { app.services.clipboard_set_text(&text); app.ui.last_copy = Some(text); } - "edit.paste" => paste(app, None), + "edit.paste" => paste(app, None, None), "file.close" if app.session.ds().is_ok_and(|d| d.is_dirty() && d.branch_of.is_none()) => { let save = pretty_shortcut(crate::shortcuts::shortcut("file.save").unwrap_or("")); app.toast(trf( @@ -532,11 +533,7 @@ pub fn popups(app: &mut FigApp, ctx: &egui::Context) { if item(ui, label, sc, available(id), false, &t) { if *id == "edit.paste" { let p = app.to_page(pos); - if app.session.clipboard.nodes.is_empty() { - invoke(app, id); - } else { - app.run("edit.paste", json!({"x": p.x, "y": p.y})); - } + paste(app, None, Some((p.x, p.y))); } else { invoke(app, id); } diff --git a/crates/ui-egui/src/paste_image_tests.rs b/crates/ui-egui/src/paste_image_tests.rs new file mode 100644 index 000000000..6e202df5d --- /dev/null +++ b/crates/ui-egui/src/paste_image_tests.rs @@ -0,0 +1,234 @@ +//! Pasting an image copied in another app (#663). On the desktop, egui-winit swallows Cmd/Ctrl+V's +//! press and sends a paste event only when the clipboard holds text: an image leaves just the +//! key's release. The browser sends the press and a paste event (`web_clipboard_tests`). + +use std::cell::RefCell; +use std::rc::Rc; + +use egui::{Event, Key, Modifiers, PointerButton, Pos2, RawInput, Rect, Shape, vec2}; +use figcraft_engine::Session; +use serde_json::json; + +use crate::{FigApp, Services}; + +#[derive(Default)] +struct Clip { + text: Option, + image: Option<(u32, u32, Vec)>, +} + +/// The desktop clipboard. +struct Desktop(Rc>); + +impl Services for Desktop { + fn clipboard_set_text(&mut self, s: &str) { + *self.0.borrow_mut() = Clip { text: Some(s.into()), image: None }; + } + fn clipboard_get_text(&mut self) -> Option { + self.0.borrow().text.clone() + } + fn clipboard_get_image(&mut self) -> Option<(u32, u32, Vec)> { + self.0.borrow().image.clone() + } +} + +struct Win { + ctx: egui::Context, + app: FigApp, + time: f64, + clip: Rc>, + shapes: Vec, +} + +impl Win { + fn new() -> Self { + let mut s = Session::new(); + s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 100, "height": 50})).unwrap(); + let ctx = egui::Context::default(); + let clip = Rc::new(RefCell::new(Clip::default())); + let app = FigApp::new(s, Box::new(Desktop(clip.clone()))); + let mut w = Self { ctx, app, time: 0.0, clip, shapes: Vec::new() }; + for _ in 0..3 { + w.frame(vec![]); + } + w + } + + fn frame(&mut self, events: Vec) { + self.frame_with(events, false); + } + + /// `take_v`: something ahead of the app (a prototype's key trigger) consumes a V press. + fn frame_with(&mut self, events: Vec, take_v: bool) { + self.time += 1.0 / 60.0; + let input = + RawInput { screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(1440.0, 900.0))), time: Some(self.time), events, ..Default::default() }; + let app = &mut self.app; + let mut out = self.ctx.run_ui(input, |ui| { + if take_v { + ui.ctx().input_mut(|i| i.consume_key(Modifiers::NONE, Key::V)); + } + app.ui(ui); + }); + out.textures_delta.clear(); + self.shapes = out.shapes.into_iter().map(|s| s.shape).collect(); + } + + fn copy_image_elsewhere(&mut self) { + *self.clip.borrow_mut() = Clip { text: None, image: Some((2, 2, vec![255; 16])) }; + } + + /// Cmd/Ctrl+V as egui-winit delivers it: the press brings a paste event when the clipboard + /// holds text and nothing otherwise; the release comes as a key event. + fn cmd_v(&mut self, m: Modifiers) { + let text = self.clip.borrow().text.clone().filter(|t| !t.is_empty()); + self.frame(text.map(Event::Paste).into_iter().collect()); + self.frame(vec![key(Key::V, false, m)]); + self.frame(vec![]); + } + + fn named(&self, name: &str) -> usize { + self.app.session.doc().unwrap().nodes().filter(|n| n.name == name).count() + } + + fn texts(&self) -> usize { + self.app.session.doc().unwrap().nodes().filter(|n| matches!(n.kind, figcraft_doc::NodeKind::Text(_))).count() + } + + fn rects(&self) -> usize { + self.named("Rectangle") + } +} + +const CMD: Modifiers = Modifiers::COMMAND.plus(Modifiers::CTRL); + +fn key(key: Key, pressed: bool, modifiers: Modifiers) -> Event { + Event::Key { key, physical_key: Some(key), pressed, repeat: false, modifiers } +} + +#[test] +fn cmd_v_pastes_an_image_copied_elsewhere() { + let mut w = Win::new(); + w.copy_image_elsewhere(); + w.cmd_v(CMD); + assert_eq!(w.named("Pasted image"), 1, "the image was pasted from the key's release"); + w.cmd_v(CMD); + assert_eq!(w.named("Pasted image"), 2, "and again"); +} + +#[test] +fn cmd_released_before_v_still_pastes_the_image() { + let mut w = Win::new(); + w.copy_image_elsewhere(); + w.cmd_v(Modifiers::NONE); + assert_eq!(w.named("Pasted image"), 1); +} + +#[test] +fn text_pastes_once_from_its_paste_event() { + let mut w = Win::new(); + *w.clip.borrow_mut() = Clip { text: Some("hello from another app".into()), image: None }; + w.cmd_v(CMD); + assert_eq!(w.texts(), 1, "the paste event pasted the text, the release nothing more"); + assert_eq!(w.rects(), 1); +} + +#[test] +fn text_pastes_once_when_another_key_is_let_go_first() { + let mut w = Win::new(); + *w.clip.borrow_mut() = Clip { text: Some("hello".into()), image: None }; + // Cmd+A then Cmd+V typed fast: A comes up after V went down. + w.frame(vec![key(Key::A, true, CMD)]); + w.frame(vec![Event::Paste("hello".into())]); + w.frame(vec![key(Key::A, false, CMD)]); + w.frame(vec![key(Key::V, false, CMD)]); + w.frame(vec![]); + assert_eq!(w.texts(), 1); + assert_eq!(w.rects(), 1); +} + +#[test] +fn a_v_press_consumed_elsewhere_does_not_paste_on_release() { + let mut w = Win::new(); + w.copy_image_elsewhere(); + w.frame_with(vec![key(Key::V, true, Modifiers::NONE)], true); + w.frame(vec![key(Key::V, false, Modifiers::NONE)]); + w.frame(vec![]); + assert_eq!(w.named("Pasted image"), 0); +} + +#[test] +fn the_browser_sequence_pastes_once() { + let mut w = Win::new(); + w.copy_image_elsewhere(); + w.frame(vec![key(Key::V, true, CMD)]); + w.frame(vec![key(Key::V, false, CMD)]); + w.frame(vec![]); + assert_eq!(w.named("Pasted image"), 1); +} + +#[test] +fn v_alone_and_other_paste_commands_paste_nothing() { + let mut w = Win::new(); + w.copy_image_elsewhere(); + w.frame(vec![key(Key::V, true, Modifiers::NONE)]); + w.frame(vec![key(Key::V, false, Modifiers::NONE)]); + w.cmd_v(CMD.plus(Modifiers::SHIFT)); + w.cmd_v(CMD.plus(Modifiers::ALT)); + assert_eq!(w.named("Pasted image"), 0); +} + +#[test] +fn a_paste_event_from_another_key_does_not_block_the_next_cmd_v() { + let mut w = Win::new(); + *w.clip.borrow_mut() = Clip { text: Some("text".into()), image: None }; + // Shift+Insert on Windows. + w.frame(vec![Event::Paste("text".into())]); + w.frame(vec![key(Key::Insert, false, Modifiers::SHIFT)]); + w.copy_image_elsewhere(); + w.cmd_v(CMD); + assert_eq!(w.named("Pasted image"), 1); +} + +#[test] +fn a_v_press_lost_to_another_window_does_not_block_the_next_cmd_v() { + let mut w = Win::new(); + w.copy_image_elsewhere(); + w.frame(vec![key(Key::V, true, Modifiers::NONE), Event::WindowFocused(false)]); + w.frame(vec![Event::WindowFocused(true)]); + w.cmd_v(CMD); + assert_eq!(w.named("Pasted image"), 1); +} + +#[test] +fn paste_here_prefers_a_newer_image_over_copied_layers() { + let mut w = Win::new(); + w.app.session.execute("select.all", &json!({})).unwrap(); + crate::menus::invoke(&mut w.app, "edit.copy"); + assert!(!w.app.session.clipboard.nodes.is_empty(), "layers copied"); + w.app.session.execute("select.none", &json!({})).unwrap(); + w.copy_image_elsewhere(); + let at = Pos2::new(900.0, 600.0); + for pressed in [true, false] { + w.frame(vec![ + Event::PointerMoved(at), + Event::PointerButton { pos: at, button: PointerButton::Secondary, pressed, modifiers: Modifiers::NONE }, + ]); + } + w.frame(vec![]); + let item = crate::live_tests::text_center(&w.shapes, "Paste here"); + for pressed in [true, false] { + w.frame(vec![ + Event::PointerMoved(item), + Event::PointerButton { pos: item, button: PointerButton::Primary, pressed, modifiers: Modifiers::NONE }, + ]); + } + w.frame(vec![]); + assert_eq!(w.named("Pasted image"), 1, "the newer image was pasted"); + assert_eq!(w.rects(), 1, "not the copied rectangle"); + let p = w.app.to_page(at); + let doc = w.app.session.doc().unwrap(); + let img = doc.nodes().find(|n| n.name == "Pasted image").unwrap(); + let b = doc.world_bounds(img.id).unwrap(); + assert!((b.x0 - p.x).abs() < 0.01 && (b.y0 - p.y).abs() < 0.01, "top-left where the menu opened: {b:?} vs {p:?}"); +} diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index d5bfb1568..1ac2824f4 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -94,7 +94,8 @@ fn cached_tip(label: &'static str, key: Option<&'static str>) -> &'static str { /// Run the shortcuts this frame's keys press. `typing`: a field had the keyboard when the frame /// began. -pub fn handle(app: &mut FigApp, ctx: &Context, typing: bool) { +/// `paste_release`: this frame released a Cmd/Ctrl+V the shell swallowed ([`swallowed_paste`]). +pub fn handle(app: &mut FigApp, ctx: &Context, typing: bool, paste_release: bool) { note_platform(ctx); // Text fields in panels own the keyboard (also the key that ends their editing). if typing || crate::a11y::field_focused(ctx) || app.ui.palette.is_some() { @@ -109,18 +110,19 @@ pub fn handle(app: &mut FigApp, ctx: &Context, typing: bool) { text_keys(app, ctx, &events); return; } - // An image-only clipboard brings no paste event, just the key: paste from the key then. + // An image-only clipboard brings no paste event: paste from the key then. The browser sends + // the press; the desktop shell swallows it and sends only the release. let paste_event = events.iter().any(|e| matches!(e, Event::Paste(_))); let paste_key = events.iter().any(|e| matches!(e, Event::Key { key: Key::V, pressed: true, repeat: false, modifiers, .. } if modifiers.command && !modifiers.shift && !modifiers.alt)); - if paste_key && !paste_event { - crate::menus::paste(app, None); + if (paste_key && !paste_event) || paste_release { + crate::menus::paste(app, None, None); } let now = ctx.input(|i| i.time); for ev in &events { match ev { Event::Copy => crate::menus::invoke(app, "edit.copy"), Event::Cut => crate::menus::invoke(app, "edit.cut"), - Event::Paste(text) => crate::menus::paste(app, Some(text)), + Event::Paste(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) => { @@ -131,6 +133,38 @@ pub fn handle(app: &mut FigApp, ctx: &Context, typing: bool) { } } +/// Whether this frame releases a Cmd/Ctrl+V whose press never arrived and that brought no paste +/// event: egui-winit swallows the press and sends a paste event only when the clipboard holds +/// text, so an image on the clipboard leaves just this release. Call at the start of every frame: +/// it reads the raw events, which keys consumed by panels or the presenter still carry. +pub fn swallowed_paste(app: &mut FigApp, ctx: &Context) -> bool { + let ui = &mut app.ui; + let mut paste = false; + ctx.input(|i| { + for ev in &i.raw.events { + match ev { + Event::Paste(_) => ui.paste_event = true, + Event::Key { key: Key::V, pressed: true, .. } => ui.v_pressed = true, + Event::Key { key: Key::V, pressed: false, modifiers, .. } => { + // Shift or Alt with it is another command (paste over, paste properties). + paste = !ui.v_pressed && !ui.paste_event && !modifiers.shift && !modifiers.alt; + ui.v_pressed = false; + ui.paste_event = false; + } + // The other keys that paste (Shift+Insert, a Paste key) end their paste event. + Event::Key { key: Key::Insert | Key::Paste, pressed: false, .. } => ui.paste_event = false, + // Keys let go in another window never come back as releases. + Event::WindowFocused(false) => { + ui.v_pressed = false; + ui.paste_event = false; + } + _ => {} + } + } + }); + paste +} + /// Run the command a shortcut is bound to, with the keyboard's own twists (Escape steps out /// before it deselects, Delete ends a pen path, Enter edits the selected text or vector). pub fn run_binding(app: &mut FigApp, id: &str) { From 569a3b3669c409a0e90dcad6b2424e1134b35a6c Mon Sep 17 00:00:00 2001 From: RealtaNua Date: Fri, 16 Oct 2026 23:11:00 +0700 Subject: [PATCH 083/817] fix(engine): a Shift-click on a selected widget doesn't also click it (#498) With Shift let go before the button, the release took the layer out of the selection and also ran the widget's click. The take-out now skips the widget click, as a Shift-click always has. Co-Authored-By: Claude Opus 5.5 (1M context) --- crates/engine/src/tools.rs | 2 +- crates/engine/src/widgets_tests.rs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/tools.rs b/crates/engine/src/tools.rs index d074052fc..dbda1894b 100644 --- a/crates/engine/src/tools.rs +++ b/crates/engine/src/tools.rs @@ -1789,7 +1789,7 @@ impl Session { let sel = self.selection().into_iter().filter(|x| *x != d).collect(); self.set_selection(sel); } - if !(ev.shift || ev.cmd || duplicate) { + if deselect.is_none() && !(ev.shift || ev.cmd || duplicate) { self.widget_click(start, ev.tol() * 2.0)?; } } diff --git a/crates/engine/src/widgets_tests.rs b/crates/engine/src/widgets_tests.rs index 7079905ff..f228d35cc 100644 --- a/crates/engine/src/widgets_tests.rs +++ b/crates/engine/src/widgets_tests.rs @@ -248,6 +248,19 @@ fn clicking_a_widget_on_the_canvas_calls_its_plugin_back() { assert!(after.x - before.x > 30.0 && state(&mut s, w) == json!({"n": 2}), "{before:?} → {after:?}"); } +#[test] +fn a_shift_click_on_a_selected_widget_only_deselects_it() { + let mut s = session(); + let (w, _) = insert(&mut s); + let target = s.doc().unwrap().world_bounds(node(&s, w).children[1]).unwrap().center(); + let mut down = PointerEvent::at(PointerKind::Down, target.x, target.y, 1.0); + down.shift = true; + // Shift let go before the button: still a Shift-click, not a click on the widget. + s.pointer(&down).unwrap(); + s.pointer(&PointerEvent::at(PointerKind::Up, target.x, target.y, 1.0)).unwrap(); + assert_eq!((s.selection(), state(&mut s, w)), (vec![], json!({"n": 1}))); +} + #[test] fn bad_widgets_and_clicks_are_refused_and_roll_back() { let mut s = session(); From 60fa813eb25a0ad4f8de6dfadbfbb61a1e3f30b0 Mon Sep 17 00:00:00 2001 From: RealtaNua Date: Sat, 17 Oct 2026 00:27:34 +0700 Subject: [PATCH 084/817] fix(format): numbered lists from .fig files keep their start number (#686) Figma stores where a numbered list starts counting on each text line (listStartOffset; a list shown as "2." has offset 1). The import dropped it, so every list counted from 1. A paragraph's list settings now carry a start number (written only when set, so older files open and save unchanged). Numbering counts on from it where a list starts; items that go on counting ignore it. The .fig import reads it, the .fig export writes it on a list's first line, and plain paragraphs drop it. Toggling a list off ignores differing starts. Co-Authored-By: Claude Opus 5.5 (1M context) --- crates/doc/src/text.rs | 46 ++++++++++-- crates/engine/src/text_tail_tests.rs | 21 +++++- crates/format/src/fig/export.rs | 4 +- crates/format/src/fig/export_tests.rs | 2 +- crates/format/src/fig/map.rs | 12 ++- crates/format/src/fig/tests.rs | 3 + crates/format/src/fig/text_list_tests.rs | 94 ++++++++++++++++++++++++ crates/format/src/rest/text.rs | 5 +- crates/text/src/layout.rs | 7 +- crates/text/src/tail_tests.rs | 27 ++++++- docs/file-format-parity.md | 8 +- 11 files changed, 204 insertions(+), 25 deletions(-) create mode 100644 crates/format/src/fig/text_list_tests.rs diff --git a/crates/doc/src/text.rs b/crates/doc/src/text.rs index b294151bb..161b207de 100644 --- a/crates/doc/src/text.rs +++ b/crates/doc/src/text.rs @@ -215,6 +215,10 @@ pub struct ParaList { pub list: ListStyle, /// Nesting level (0 = outermost; plain paragraphs are always 0). pub indent: u8, + /// A numbered list that starts counting at this paragraph counts from `start + 1` (items + /// that go on counting ignore it; plain paragraphs are always 0). + #[serde(skip_serializing_if = "crate::node::is_default")] + pub start: u32, } /// Character style. In runs, every field is an override; `None` means "inherit the base". @@ -637,13 +641,13 @@ impl TextData { /// Paragraph `p`'s list settings. pub fn para_list(&self, p: usize) -> ParaList { - self.paragraphs.get(p).copied().unwrap_or(ParaList { list: self.list, indent: 0 }) + self.paragraphs.get(p).copied().unwrap_or(ParaList { list: self.list, ..ParaList::default() }) } /// Spell out every paragraph's list settings in `paragraphs` (and drop extra entries). fn fill_paragraphs(&mut self) { let n = self.paragraph_count(); - let fill = ParaList { list: self.list, indent: 0 }; + let fill = ParaList { list: self.list, ..ParaList::default() }; self.paragraphs.resize(n, fill); } @@ -657,17 +661,20 @@ impl TextData { } /// Apply `f` to the list settings of the paragraphs chars `start..end` touch (plain - /// paragraphs stay at level 0, levels stop at [`MAX_LIST_INDENT`]); one style for all with - /// no nesting folds back into `list`. + /// paragraphs stay at level 0 with no start, levels stop at [`MAX_LIST_INDENT`]); one style + /// for all with no nesting or start folds back into `list`. pub fn set_para_lists(&mut self, start: usize, end: usize, f: impl Fn(&mut ParaList)) { let (a, b) = self.para_span(start, end); self.fill_paragraphs(); for pl in self.paragraphs.get_mut(a..=b).unwrap_or(&mut []) { f(pl); - pl.indent = if pl.list == ListStyle::None { 0 } else { pl.indent.min(MAX_LIST_INDENT) }; + if pl.list == ListStyle::None { + *pl = ParaList::default(); + } + pl.indent = pl.indent.min(MAX_LIST_INDENT); } if let Some(first) = self.paragraphs.first().copied() - && first.indent == 0 + && first == (ParaList { list: first.list, ..ParaList::default() }) && self.paragraphs.iter().all(|p| *p == first) { self.list = first.list; @@ -675,11 +682,12 @@ impl TextData { } } - /// The list settings shared by the paragraphs chars `start..end` touch, or None when they differ. + /// The list style and level shared by the paragraphs chars `start..end` touch (the first + /// one's settings), or None when they differ. Start numbers don't count. pub fn common_para_list(&self, start: usize, end: usize) -> Option { let (a, b) = self.para_span(start, end); let first = self.para_list(a); - (a..=b).all(|p| self.para_list(p) == first).then_some(first) + (a..=b).all(|p| self.para_list(p).list == first.list && self.para_list(p).indent == first.indent).then_some(first) } /// Link chars `start..end` (all of them when the range is empty or the whole text) to text @@ -782,4 +790,26 @@ mod case_tests { assert_eq!(st.variations.keys().collect::>(), ["wdth"]); assert!(valid_axis_tag("wght") && !valid_axis_tag("weight")); } + + #[test] + fn list_starts_load_from_old_files_and_follow_edits() { + use ListStyle::{None as P, Numbered as N}; + // Files written before start numbers load with none, and write the same bytes. + let old = r#"{"list":"numbered","indent":1}"#; + let pl: ParaList = serde_json::from_str(old).unwrap(); + assert_eq!(pl, ParaList { list: N, indent: 1, start: 0 }); + assert_eq!(serde_json::to_string(&pl).unwrap(), old); + // One numbered paragraph with a start keeps it (it doesn't fold into `list`). + let mut t = TextData { characters: "Next".into(), ..Default::default() }; + t.set_para_lists(0, 0, |p| *p = ParaList { list: N, indent: 0, start: 1 }); + assert_eq!(t.para_list(0), ParaList { list: N, indent: 0, start: 1 }); + // Enter copies it to the new item; different starts don't make the list mixed. + t.replace_range(4, 4, "\nMore"); + assert_eq!(t.para_list(1).start, 1); + t.set_para_lists(5, 5, |p| p.start = 0); + assert!(t.common_para_list(0, t.char_count()).is_some_and(|p| p.list == N)); + // A plain paragraph has none. + t.set_para_lists(0, 0, |p| p.list = P); + assert_eq!(t.para_list(0), ParaList::default()); + } } diff --git a/crates/engine/src/text_tail_tests.rs b/crates/engine/src/text_tail_tests.rs index b951bfc75..687c67b86 100644 --- a/crates/engine/src/text_tail_tests.rs +++ b/crates/engine/src/text_tail_tests.rs @@ -57,6 +57,21 @@ fn list_buttons_act_on_the_selected_paragraphs() { assert_eq!(data(&s, t).list, P, "toggled off"); } +#[test] +fn a_list_with_a_start_number_toggles_off() { + // An imported list that starts at 2 has the start on its first item only; it is still one + // numbered list, so the button turns it back to plain (#686). + let mut s = Session::new(); + let t = text(&mut s, "two\nthree\nfour"); + if let figcraft_doc::NodeKind::Text(td) = &mut s.doc_mut().unwrap().get_mut(t).unwrap().kind { + td.paragraphs = + vec![ParaList { list: N, indent: 0, start: 1 }, ParaList { list: N, indent: 0, start: 0 }, ParaList { list: N, indent: 0, start: 0 }]; + } + s.execute("text.numberList", &json!({"ids": [t]})).unwrap(); + assert_eq!(lists(&s, t), [(P, 0); 3]); + assert_eq!(data(&s, t).para_list(0).start, 0, "a plain paragraph has no start"); +} + #[test] fn typed_list_starts() { // Typing "- " or "* " at the start of a paragraph starts a bulleted list, "1. " a numbered one @@ -117,7 +132,7 @@ fn list_keys_at_list_items() { for (chars, before, caret, k, shift, after, want, why) in cases { let mut s = Session::new(); let t = text(&mut s, chars); - let ps: Vec = before.iter().map(|(list, indent)| ParaList { list: *list, indent: *indent }).collect(); + let ps: Vec = before.iter().map(|(list, indent)| ParaList { list: *list, indent: *indent, start: 0 }).collect(); if let figcraft_doc::NodeKind::Text(td) = &mut s.doc_mut().unwrap().get_mut(t).unwrap().kind { td.paragraphs = ps; } @@ -141,7 +156,7 @@ fn paragraph_lists_follow_edits() { // A paragraph's list stays with it as text is typed, pasted and deleted: new paragraphs copy // the one they split from; joined paragraphs keep the first one's. let mut t = TextData::new("ab\ncd\nef"); - t.paragraphs = vec![ParaList { list: B, indent: 1 }, ParaList::default(), ParaList { list: N, indent: 0 }]; + t.paragraphs = vec![ParaList { list: B, indent: 1, start: 0 }, ParaList::default(), ParaList { list: N, indent: 0, start: 0 }]; let get = |t: &TextData| (0..t.paragraph_count()).map(|p| (t.para_list(p).list, t.para_list(p).indent)).collect::>(); t.replace_range(1, 1, "x\ny"); assert_eq!(get(&t), [(B, 1), (B, 1), (P, 0), (N, 0)], "a pasted newline: a new item like it"); @@ -156,7 +171,7 @@ fn paragraph_lists_follow_edits() { (seed >> 33) as usize % n.max(1) }; let mut t = TextData::new("a\nb\nc\nd"); - t.paragraphs = vec![ParaList { list: B, indent: 2 }; 4]; + t.paragraphs = vec![ParaList { list: B, indent: 2, start: 0 }; 4]; for _ in 0..500 { let n = t.char_count(); let (a, b) = (rnd(n + 2), rnd(n + 2)); diff --git a/crates/format/src/fig/export.rs b/crates/format/src/fig/export.rs index bfd0b6155..cb2b8bff2 100644 --- a/crates/format/src/fig/export.rs +++ b/crates/format/src/fig/export.rs @@ -1574,12 +1574,14 @@ impl<'d> Exporter<'d> { }; let listed = *l != ListStyle::None; let first = listed && (i == 0 || lists.get(i - 1) != Some(l)); + // Where a numbered list starts counting, less one. + let start = if first && *l == ListStyle::Numbered { td.para_list(i).start } else { 0 }; o(vec![ ("lineType", e(ty)), ("styleId", int(0)), ("indentationLevel", int(i64::from(listed))), ("sourceDirectionality", e("AUTO")), - ("listStartOffset", int(0)), + ("listStartOffset", int(i64::from(start))), ("isFirstLineOfList", b(first)), ]) }; diff --git a/crates/format/src/fig/export_tests.rs b/crates/format/src/fig/export_tests.rs index 67215b0c7..53cfaf917 100644 --- a/crates/format/src/fig/export_tests.rs +++ b/crates/format/src/fig/export_tests.rs @@ -680,7 +680,7 @@ fn normalize(n: &mut Node, ix: &dyn Fn(NodeId) -> NodeId) { for r in &mut td.runs { px(&mut r.style); } - td.paragraphs = (0..td.paragraph_count()).map(|p| ParaList { list: td.para_list(p).list, indent: 0 }).collect(); + td.paragraphs = (0..td.paragraph_count()).map(|p| ParaList { indent: 0, ..td.para_list(p) }).collect(); td.list = ListStyle::None; } NodeKind::Vector { network } => { diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 66a00129f..cbde49d88 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -827,10 +827,8 @@ impl<'a> Mapper<'a> { o.insert("characterStyleOverrides".into(), json!(ids)); o.insert("styleOverrideTable".into(), Value::Object(table)); } - let lines: Vec<&str> = td - .get("lines") - .map(Kv::list) - .unwrap_or_default() + let raw = td.get("lines").map(Kv::list).unwrap_or_default(); + let lines: Vec<&str> = raw .iter() .map(|l| match l.get("lineType").and_then(Kv::str) { Some("ORDERED_LIST") => "ORDERED", @@ -841,6 +839,12 @@ impl<'a> Mapper<'a> { if lines.iter().any(|l| *l != "NONE") { o.insert("lineTypes".into(), json!(lines)); } + // Where a numbered list starts counting, less one (not a REST field). + let starts: Vec = + raw.iter().map(|l| num(l, "listStartOffset").filter(|n| n.is_finite()).map_or(0, |n| n.clamp(0.0, f64::from(u32::MAX)) as u32)).collect(); + if starts.iter().any(|n| *n > 0) { + o.insert("listStartOffsets".into(), json!(starts)); + } } /// `fillGeometry` / `strokeGeometry` as SVG path data, and star/polygon parameters. diff --git a/crates/format/src/fig/tests.rs b/crates/format/src/fig/tests.rs index 19c4fc157..1173dacd2 100644 --- a/crates/format/src/fig/tests.rs +++ b/crates/format/src/fig/tests.rs @@ -873,6 +873,9 @@ fn nested_instances_resized_again_drop_the_layout_derived_for_their_old_size() { #[path = "tail_tests.rs"] mod tail; +#[path = "text_list_tests.rs"] +mod text_list; + /// `.fig` files in the folder `FIGCRAFT_FIG_SAMPLES` names (none when it's unset). pub(super) fn samples() -> Vec { let Some(dir) = std::env::var_os("FIGCRAFT_FIG_SAMPLES") else { return Vec::new() }; diff --git a/crates/format/src/fig/text_list_tests.rs b/crates/format/src/fig/text_list_tests.rs new file mode 100644 index 000000000..8d314ccdb --- /dev/null +++ b/crates/format/src/fig/text_list_tests.rs @@ -0,0 +1,94 @@ +//! Numbered lists that start past 1 (#686): each text line says where its list starts counting, +//! less one (`listStartOffset`). Fixtures built in code with the parent module's helpers. + +use figcraft_doc::{ListStyle, NodeKind, ParaList}; + +use super::*; + +const LIST_SCHEMA: &str = " +enum NodeType NONE DOCUMENT CANVAS TEXT +enum LineType PLAIN ORDERED_LIST UNORDERED_LIST +struct GUID uint sessionID, uint localID +struct Vector float x, float y +struct Matrix float m00, float m01, float m02, float m10, float m11, float m12 +message ParentIndex GUID guid, string position +message TextLineData LineType lineType, int indentationLevel, int listStartOffset, bool isFirstLineOfList +message TextData string characters, TextLineData[] lines +message NodeChange GUID guid, ParentIndex parentIndex, NodeType type, string name, Vector size, Matrix transform, float fontSize, TextData textData +message Message NodeChange[] nodeChanges +"; + +/// A list line: type, start offset, first of its list. +fn line(ty: &'static str, offset: i64, first: bool) -> Kv<'static> { + let level = i64::from(ty != "PLAIN"); + o(vec![("lineType", e(ty)), ("indentationLevel", Kv::Int(level)), ("listStartOffset", Kv::Int(offset)), ("isFirstLineOfList", Kv::Bool(first))]) +} + +fn text_node(id: u64, name: &str, chars: &str, lines: Vec>) -> Kv<'static> { + let pos = ["!", "\"", "#", "$", "%", "&"][id as usize % 6]; + node( + id, + Some((1, pos)), + "TEXT", + name, + vec![ + ("size", xy(200.0, 60.0)), + ("transform", at(0.0, 0.0)), + ("fontSize", f(16.0)), + ("textData", o(vec![("characters", s(chars)), ("lines", arr(lines))])), + ], + ) +} + +fn starts(doc: &figcraft_doc::Document, name: &str) -> Vec<(ListStyle, u32)> { + let NodeKind::Text(t) = &named(doc, name).kind else { panic!("{name} is no text") }; + (0..t.paragraph_count()).map(|p| t.para_list(p)).map(|p: ParaList| (p.list, p.start)).collect() +} + +#[test] +fn numbered_lists_keep_their_start() { + use ListStyle::{Bulleted as B, None as P, Numbered as N}; + let nodes = vec![ + node(0, None, "DOCUMENT", "Document", vec![]), + node(1, Some((0, "!")), "CANVAS", "Page", vec![]), + text_node(2, "From 1", "Start here", vec![line("ORDERED_LIST", 0, true)]), + text_node(3, "From 2", "Next try this", vec![line("ORDERED_LIST", 1, true)]), + text_node(4, "First only", "a\nb\nc", vec![line("ORDERED_LIST", 3, true), line("ORDERED_LIST", 0, false), line("ORDERED_LIST", 0, false)]), + text_node(5, "Every line", "a\nb\nc", vec![line("ORDERED_LIST", 3, true), line("ORDERED_LIST", 3, false), line("ORDERED_LIST", 3, false)]), + text_node(6, "Mixed", "x\na\nb", vec![line("PLAIN", 0, false), line("ORDERED_LIST", 4, true), line("UNORDERED_LIST", 2, true)]), + text_node(7, "Junk", "a", vec![line("ORDERED_LIST", -5, true)]), + ]; + let sc = Schema::parse(LIST_SCHEMA).unwrap(); + let (doc, warnings) = import(&canvas(&sc, &o(vec![("nodeChanges", arr(nodes))])), "x").unwrap(); + assert!(warnings.is_empty(), "{warnings:?}"); + assert_eq!(starts(&doc, "From 1"), [(N, 0)]); + assert_eq!(starts(&doc, "From 2"), [(N, 1)], "shows 2."); + assert_eq!(starts(&doc, "First only"), [(N, 3), (N, 0), (N, 0)]); + assert_eq!(starts(&doc, "Every line"), [(N, 3), (N, 3), (N, 3)]); + assert_eq!(starts(&doc, "Mixed"), [(P, 0), (N, 4), (B, 2)]); + assert_eq!(starts(&doc, "Junk"), [(N, 0)], "a negative offset counts from 1"); +} + +#[test] +fn the_export_writes_where_a_list_starts() { + let mut doc = figcraft_doc::Document::new("Lists"); + let page = doc.first_page().unwrap(); + let mut td = figcraft_doc::TextData::new("two\nthree\nplain\nsix"); + td.paragraphs = vec![ + ParaList { list: ListStyle::Numbered, indent: 0, start: 1 }, + ParaList { list: ListStyle::Numbered, indent: 0, start: 1 }, + ParaList::default(), + ParaList { list: ListStyle::Numbered, indent: 0, start: 5 }, + ]; + doc.create(page, NodeKind::Text(td), "List", 0.0, 0.0, 200.0, 80.0).unwrap(); + let (bytes, _) = super::super::export(&doc, None).unwrap(); + let a = Archive::open(&bytes).unwrap(); + let (schema, message) = decode_canvas(&a.canvas).unwrap(); + let msg = schema.decode_message(schema.find("Message").unwrap(), &message).unwrap(); + let text = msg.get("nodeChanges").unwrap().list().iter().find(|n| n.get("name").and_then(Kv::str) == Some("List")).unwrap(); + let lines = text.get("textData").and_then(|d| d.get("lines")).map(Kv::list).unwrap(); + let offsets: Vec = lines.iter().map(|l| l.get("listStartOffset").and_then(Kv::f64).unwrap()).collect(); + assert_eq!(offsets, [1.0, 0.0, 0.0, 5.0], "on the first line of each list only"); + let (back, _) = import(&bytes, "x").unwrap(); + assert_eq!(starts(&back, "List"), [(ListStyle::Numbered, 1), (ListStyle::Numbered, 0), (ListStyle::None, 0), (ListStyle::Numbered, 5)]); +} diff --git a/crates/format/src/rest/text.rs b/crates/format/src/rest/text.rs index c5381bb2e..ea66e3906 100644 --- a/crates/format/src/rest/text.rs +++ b/crates/format/src/rest/text.rs @@ -210,10 +210,12 @@ fn runs(cx: &mut Ctx, v: &Value, td: &TextData) -> Vec { out } -/// Each paragraph's list type and nesting level from `lineTypes` and `lineIndentations`. +/// Each paragraph's list type, nesting level and start number from `lineTypes`, +/// `lineIndentations` and (from `.fig` files) `listStartOffsets`. fn lists(v: &Value, td: &mut TextData) { let types = list(v, "lineTypes"); let indents = list(v, "lineIndentations"); + let starts = list(v, "listStartOffsets"); td.paragraphs = types .iter() .enumerate() @@ -224,6 +226,7 @@ fn lists(v: &Value, td: &mut TextData) { _ => ListStyle::None, }, indent: indents.get(i).and_then(Value::as_f64).filter(|d| d.is_finite()).map_or(0, |d| d.clamp(0.0, 255.0) as u8), + start: starts.get(i).and_then(Value::as_f64).filter(|n| n.is_finite()).map_or(0, |n| n.clamp(0.0, f64::from(u32::MAX)) as u32), }) .collect(); // Clamp the levels and fold one style for all back into the layer's list style. diff --git a/crates/text/src/layout.rs b/crates/text/src/layout.rs index 37092da86..5ba5dd48a 100644 --- a/crates/text/src/layout.rs +++ b/crates/text/src/layout.rs @@ -827,8 +827,8 @@ pub fn layout(text: &TextData, box_width: Option, box_height: Option) } /// The markers of a text's paragraphs ("" for plain ones). Numbers count the items of one list at -/// one level, restarting after a plain paragraph, a shallower item or the other kind of list; -/// levels go 1. a. i. and • ◦ ▪, then round again. +/// one level, restarting after a plain paragraph, a shallower item or the other kind of list, +/// from the first item's start number; levels go 1. a. i. and • ◦ ▪, then round again. pub(crate) fn list_markers(lists: &[ParaList]) -> Vec { const BULLETS: [&str; 3] = ["\u{2022}", "\u{25E6}", "\u{25AA}"]; let mut count = [(ListStyle::None, 0usize); figcraft_doc::MAX_LIST_INDENT as usize + 1]; @@ -844,7 +844,8 @@ pub(crate) fn list_markers(lists: &[ParaList]) -> Vec { *c = (ListStyle::None, 0); } let Some(c) = count.get_mut(d) else { return String::new() }; - *c = if c.0 == pl.list { (pl.list, c.1 + 1) } else { (pl.list, 1) }; + let first = usize::try_from(pl.start).unwrap_or(usize::MAX).saturating_add(1); + *c = if c.0 == pl.list { (pl.list, c.1.saturating_add(1)) } else { (pl.list, first) }; match (pl.list, d % 3) { (ListStyle::Numbered, 1) => format!("{}.", alpha(c.1)), (ListStyle::Numbered, 2) => format!("{}.", roman(c.1)), diff --git a/crates/text/src/tail_tests.rs b/crates/text/src/tail_tests.rs index 890b254de..b1854dfd4 100644 --- a/crates/text/src/tail_tests.rs +++ b/crates/text/src/tail_tests.rs @@ -43,7 +43,32 @@ fn starts(l: &TextLayout) -> Vec<(f64, Option)> { } fn pl(list: ListStyle, indent: u8) -> ParaList { - ParaList { list, indent } + ParaList { list, indent, start: 0 } +} + +fn from(list: ListStyle, indent: u8, start: u32) -> ParaList { + ParaList { list, indent, start } +} + +#[test] +fn numbered_lists_count_from_their_start() { + use ListStyle::{Bulleted as B, None as P, Numbered as N}; + let cases: Vec<(Vec, Vec<&str>, &str)> = vec![ + (vec![from(N, 0, 1)], vec!["2."], "a one-item list started at 2 (#686)"), + (vec![from(N, 0, 3), pl(N, 0), pl(N, 0)], vec!["4.", "5.", "6."], "the items after the first count on from it"), + (vec![from(N, 0, 3), from(N, 0, 3), from(N, 0, 3)], vec!["4.", "5.", "6."], "items that go on counting ignore their own start"), + (vec![from(N, 0, 1), pl(P, 0), from(N, 0, 1)], vec!["2.", "", "2."], "a list after a plain paragraph starts from its own start"), + (vec![pl(N, 0), from(N, 1, 1), pl(N, 1)], vec!["1.", "b.", "c."], "a nested level starts from its first item's start"), + (vec![from(B, 0, 4), pl(B, 0)], vec!["\u{2022}", "\u{2022}"], "bullets have no number"), + (vec![from(N, 0, 4_000), pl(N, 2)], vec!["4001.", "i."], "big starts"), + ]; + for (lists, want, why) in cases { + assert_eq!(list_markers(&lists), want, "{why}"); + } + // The largest start never overflows, on 32-bit targets too. + let max = list_markers(&[from(N, 0, u32::MAX), pl(N, 0), pl(N, 0)]); + assert_eq!(max.len(), 3); + assert!(max.iter().all(|m| m.starts_with("429496729")), "{max:?}"); } #[test] diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index d8e517119..1b8cdcc44 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-14 · **Change:** minor (SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (`.fig` numbered list start numbers (#686); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) Every format Figma reads or writes, with FigCraft's support. Sources: `Info.plist` of `/Applications/Figma.app` (document types only; nothing inside the bundle's code was read), Figma's @@ -17,7 +17,7 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| -| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Not read: connector labels, table cells beyond their own layers, filled areas with their own fills, per-point stroke joins, variables bound to fields the editor can't bind, fixed or content-sized grid tracks, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs`, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | +| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs and list types (numbered lists keep the number they start at), vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Not read: connector labels, table cells beyond their own layers, filled areas with their own fills, per-point stroke joins, variables bound to fields the editor can't bind, fixed or content-sized grid tracks, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs`, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | | REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout, constraints, grids, components, sets, instances with overrides, component properties, styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | @@ -88,7 +88,8 @@ each. layers sit in it (fill, absolute, min/max sizes); layout grids; export settings; text style (font, with styles under their standard names such as "Semi Bold"; size; line height, a share of the font size as a raw multiplier; letter spacing, case, decoration, links), alignment, auto resize, - truncation, paragraph spacing and indent, list types and styled runs with their fills (indexed + truncation, paragraph spacing and indent, list types (with the number a numbered list starts + at; not yet checked in other software) and styled runs with their fills (indexed by UTF-16 unit); components (description, boolean, text and instance swap properties and the layers bound to them), component sets, instances (their main, property values, what the instance itself changes from its main, such as its size, name and paints, as an override addressed by the @@ -162,6 +163,7 @@ each. | Date | Change | Summary | |---|---|---| +| 2026-10-16 | minor | `.fig` numbered lists keep the number they start at (#686): a list Figma shows as starting at 2 imported as 1. The import reads each line's start offset, a text keeps it per paragraph (older files open unchanged), numbering counts on from it, and the export writes it on a list's first line. Nested list levels from `.fig` files are still read as the first level. Numbers unchanged | | 2026-10-14 | minor | SVG/PDF depth overflow (#208) is checked before bounds and drawing; public checked APIs return the offending root/layer, commands and CLI report it, and no incomplete export replaces an existing file. Tested at depths 255/256/257, with inner roots, hidden branches, masks, raster fallbacks and multiple roots/pages. Numbers unchanged. | | 2026-10-13 | minor | `.fig` export (gap 1): instances write what they change from their main as an override addressed by the main's id (their size, name and paints were lost elsewhere without it), what follows for their layers as derived data, and a scale factor when scaled as a whole; layers of a nested instance swapped for another component keep their overrides; variable collections, modes, variables and their bindings, the modes frames and pages set, shared styles with their links and variable-width strokes are written, and the import reads all of it back (style definitions and unused styles, variable order and scopes, bindings on paint lists, gradient stops, effects and layout grids, page modes, text field bindings, which a `.fig` import used to drop, and width profiles). Opened `.fig` and file JSON documents link nested instances of variants (and any nested instance under a name of its own) to their main's layers; they stayed unlinked, so a second export lost what they changed. Checked by opening written files in other software: resized and scaled instances keep their size and lay their layers out for it, variables with their modes and colour bindings resolve there (a frame set to another mode shows that mode's colours, also inside instances), colour, text, effect and grid styles are listed, and variable-width strokes that are the same on both sides of the path draw with their width; number, string and boolean bindings and bindings on effects, layout guides and gradient stops come across as the values they give but did not show as bound there (their entries now also name the layer field they set, not yet checked there), and strokes wider on one side of the path are written as filled outlines, no longer editable strokes there (the stroke itself is kept as plugin data and our own import puts it back; not yet checked there). Numbers unchanged | | 2026-10-12 | minor | `.fig` export made to open elsewhere (gap 1): the document and its pages say they are visible and opaque (left out, nothing was drawn), the schema in the file uses the format's own names, kinds, field ids and enum values, rectangles are rounded rectangles with four radii, frames and shapes carry their fill outline and plain strokes their stroke outline, text carries its layout settings, font styles use their standard names, line heights that are a share of the font size are raw multipliers, masks keep their type (read back too); the import reads per-side stroke weights whose zero sides are left out. Written files were checked by opening them in other software: layers, fills, gradients, strokes, shadows, vectors, components and text draw as in FigCraft; effects such as glass and noise, images and prototype interactions are still unchecked there, and variables are not written. Numbers unchanged | From 4adbd6cee98b80c877ad31de57d3bf54ef13741c Mon Sep 17 00:00:00 2001 From: RealtaNua Date: Sat, 17 Oct 2026 00:35:46 +0700 Subject: [PATCH 085/817] fix(ui): a V held while the window was away doesn't paste on release (#663) winit sends no press for a key held across a focus change (X11's synthetic presses are dropped by egui-winit), so letting go of V after coming back looked like a swallowed Cmd+V. After a focus gain, a V release only pastes with Cmd still held. Co-Authored-By: Claude Opus 5.5 (1M context) --- crates/ui-egui/src/lib.rs | 3 +++ crates/ui-egui/src/paste_image_tests.rs | 24 ++++++++++++++++++++++++ crates/ui-egui/src/shortcuts.rs | 8 ++++++-- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index bbc61149f..9fbd17cc4 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -500,6 +500,8 @@ pub struct UiState { /// (`shortcuts::swallowed_paste`). pub v_pressed: bool, pub paste_event: bool, + /// The window got the focus back since the last V release. + pub refocused: bool, /// When (UI clock, seconds) open documents next get an autosave checkpoint. pub next_autosave: f64, /// With auto-save on: when (UI clock, seconds) files with unsaved changes are next saved, and @@ -595,6 +597,7 @@ impl Default for UiState { last_copy: None, v_pressed: false, paste_event: false, + refocused: false, next_autosave: 0.0, auto_save_at: None, auto_saving: Vec::new(), diff --git a/crates/ui-egui/src/paste_image_tests.rs b/crates/ui-egui/src/paste_image_tests.rs index 6e202df5d..fa797fb92 100644 --- a/crates/ui-egui/src/paste_image_tests.rs +++ b/crates/ui-egui/src/paste_image_tests.rs @@ -200,6 +200,30 @@ fn a_v_press_lost_to_another_window_does_not_block_the_next_cmd_v() { assert_eq!(w.named("Pasted image"), 1); } +#[test] +fn v_held_while_the_window_was_away_pastes_nothing_on_release() { + let mut w = Win::new(); + w.copy_image_elsewhere(); + // Pressed in another window: only the focus and the release arrive here. + w.frame(vec![Event::WindowFocused(true)]); + w.frame(vec![key(Key::V, false, Modifiers::NONE)]); + w.frame(vec![]); + assert_eq!(w.named("Pasted image"), 0); + w.cmd_v(CMD); + assert_eq!(w.named("Pasted image"), 1, "the next Cmd+V still pastes"); +} + +#[test] +fn cmd_v_in_a_panel_field_does_not_paste_on_the_canvas() { + let mut w = Win::new(); + w.copy_image_elsewhere(); + w.frame(vec![]); + w.app.field_focus = true; + w.frame(vec![key(Key::V, false, CMD)]); + w.frame(vec![]); + assert_eq!(w.named("Pasted image"), 0); +} + #[test] fn paste_here_prefers_a_newer_image_over_copied_layers() { let mut w = Win::new(); diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index 1ac2824f4..f28a24335 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -146,10 +146,13 @@ pub fn swallowed_paste(app: &mut FigApp, ctx: &Context) -> bool { Event::Paste(_) => ui.paste_event = true, Event::Key { key: Key::V, pressed: true, .. } => ui.v_pressed = true, Event::Key { key: Key::V, pressed: false, modifiers, .. } => { - // Shift or Alt with it is another command (paste over, paste properties). - paste = !ui.v_pressed && !ui.paste_event && !modifiers.shift && !modifiers.alt; + // Shift or Alt with it is another command (paste over, paste properties). A V + // held while the window was away comes back as a release alone: without Cmd + // held, that's no paste. + paste = !ui.v_pressed && !ui.paste_event && !modifiers.shift && !modifiers.alt && (modifiers.command || !ui.refocused); ui.v_pressed = false; ui.paste_event = false; + ui.refocused = false; } // The other keys that paste (Shift+Insert, a Paste key) end their paste event. Event::Key { key: Key::Insert | Key::Paste, pressed: false, .. } => ui.paste_event = false, @@ -158,6 +161,7 @@ pub fn swallowed_paste(app: &mut FigApp, ctx: &Context) -> bool { ui.v_pressed = false; ui.paste_event = false; } + Event::WindowFocused(true) => ui.refocused = true, _ => {} } } From 9aeb9fb75207e615e34a2dffcca778a77088280c Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Fri, 16 Oct 2026 19:58:00 +0200 Subject: [PATCH 086/817] Cap stroke width in the outliner so huge weights don't panic Found while testing crates/engine/src/cmd/props.rs:361 (strokeWeight is only clamped with .max(0.0)); the panic is raised when the renderer draws the stroke (render crate / tiny-skia stroker) Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/engine/src/huge_stroke_tests.rs | 28 ++++++++++++++++++++++++++ crates/engine/src/lib.rs | 2 ++ crates/pathops/src/lib.rs | 18 ++++++++++++++--- 3 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 crates/engine/src/huge_stroke_tests.rs diff --git a/crates/engine/src/huge_stroke_tests.rs b/crates/engine/src/huge_stroke_tests.rs new file mode 100644 index 000000000..7efabb484 --- /dev/null +++ b/crates/engine/src/huge_stroke_tests.rs @@ -0,0 +1,28 @@ +//! An absurd stroke weight must not take the renderer down with it: saving (thumbnail) and exporting still work. + +use serde_json::{Value, json}; + +use crate::Session; +use crate::params::id_of; +use figcraft_doc::NodeId; + +fn id(v: Value) -> NodeId { + id_of(&v["id"]).unwrap() +} + +#[test] +fn huge_stroke_weight_with_round_caps_still_saves_and_exports() { + for weight in [1e6, 1e7, 1e10, 1e30] { + let mut s = Session::new(); + let f = id(s.execute("frame.create", &json!({"x": 0, "y": 0, "width": 100, "height": 100})).unwrap()); + let v = id(s.execute("vector.create", &json!({"parent": f, "path": "M0 0.8333 L7.5 6.25 L15 0.8333"})).unwrap()); + s.execute("node.set", &json!({"id": v, "props": {"stroke": "#ff0000", "strokeWeight": weight, "strokeCap": "round", "strokeJoin": "round"}})) + .unwrap(); + let path = std::env::temp_dir().join(format!("figcraft-huge-stroke-{}-{weight}.figcraft", std::process::id())); + let saved = s.execute("file.saveAs", &json!({"path": path.to_string_lossy()})); + let _ = std::fs::remove_file(&path); + assert!(saved.is_ok(), "saveAs at weight {weight}: {:?}", saved.err()); + let exported = s.execute("file.export", &json!({"ids": [f], "format": "png"})); + assert!(exported.is_ok(), "export at weight {weight}: {:?}", exported.err()); + } +} diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 34653bd5f..a68a78d9a 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1548,6 +1548,8 @@ mod history_behaviour_tests; #[cfg(test)] mod html_codegen_tests; #[cfg(test)] +mod huge_stroke_tests; +#[cfg(test)] mod import_export_tests; #[cfg(test)] mod inspect_behaviour_tests; diff --git a/crates/pathops/src/lib.rs b/crates/pathops/src/lib.rs index 553fce04f..d4071ca14 100644 --- a/crates/pathops/src/lib.rs +++ b/crates/pathops/src/lib.rs @@ -258,11 +258,16 @@ pub(crate) fn kjoin(j: StrokeJoin) -> Join { } } -/// Plain centred stroke of `path` at `width`. +/// The widest stroke outlined: past this the rasteriser's fixed-point maths overflows and panics, +/// and nothing visible changes (a stroke this wide covers any canvas already). +pub const MAX_STROKE_WIDTH: f64 = 1e6; + +/// Plain centred stroke of `path` at `width` (capped at [`MAX_STROKE_WIDTH`]). pub fn stroke_center(path: &BezPath, width: f64, props: &StrokeProps) -> BezPath { if !(width.is_finite() && width > 0.0 && finite(path)) { return BezPath::new(); } + let width = width.min(MAX_STROKE_WIDTH); let mut style = kurbo::Stroke::new(width) .with_join(kjoin(props.join)) .with_miter_limit(props.miter_limit.clamp(1.0, 100.0)) @@ -284,10 +289,17 @@ pub fn stroke_outline(path: &BezPath, props: &StrokeProps, closed_shape: bool) - /// [`stroke_outline`] of a shape whose stroke follows vector network `net` (`path` is its stroke /// path): points with a cap or join of their own draw them there. pub fn stroke_outline_of(path: &BezPath, props: &StrokeProps, closed_shape: bool, net: Option<&VectorNetwork>) -> BezPath { - let w = props.weight; - if !(w.is_finite() && w > 0.0) { + if !(props.weight.is_finite() && props.weight > 0.0) { return BezPath::new(); } + let capped; + let props = if props.weight > MAX_STROKE_WIDTH { + capped = StrokeProps { weight: MAX_STROKE_WIDTH, ..props.clone() }; + &capped + } else { + props + }; + let w = props.weight; let styled = net.and_then(|n| points::Styled::new(n, props)); // Centred at `width` (twice the weight for Inside/Outside, which clip half of it away). let centred = |width: f64| match (&styled, &props.brush, props.profile()) { From d27f45e06320e642e55324eb9bd01bb352153525 Mon Sep 17 00:00:00 2001 From: RealtaNua Date: Sat, 17 Oct 2026 00:58:20 +0700 Subject: [PATCH 087/817] fix(format): write a list's start on every line; report it in get_node (#686) The .fig export now writes a numbered list's start on each of its lines, so a reader that takes it per line or per list counts the same. Bullets no longer keep a start. The field is named start_offset (it holds the offset: 1 shows "2."). get_node reports listStartOffsets. The parity doc lists what's still not read from .fig lists. Co-Authored-By: Claude Opus 5.5 (1M context) --- crates/doc/src/text.rs | 30 ++++++++++++++---------- crates/engine/src/inspect.rs | 5 +++- crates/engine/src/text_tail_tests.rs | 15 +++++++----- crates/format/src/fig/export.rs | 21 +++++++++++++---- crates/format/src/fig/text_list_tests.rs | 21 ++++++++--------- crates/format/src/rest/text.rs | 2 +- crates/text/src/layout.rs | 2 +- crates/text/src/tail_tests.rs | 6 ++--- docs/file-format-parity.md | 6 ++--- docs/mcp.md | 3 ++- 10 files changed, 68 insertions(+), 43 deletions(-) diff --git a/crates/doc/src/text.rs b/crates/doc/src/text.rs index 161b207de..097dd189b 100644 --- a/crates/doc/src/text.rs +++ b/crates/doc/src/text.rs @@ -215,10 +215,10 @@ pub struct ParaList { pub list: ListStyle, /// Nesting level (0 = outermost; plain paragraphs are always 0). pub indent: u8, - /// A numbered list that starts counting at this paragraph counts from `start + 1` (items - /// that go on counting ignore it; plain paragraphs are always 0). + /// A numbered list that starts counting at this paragraph counts from `start_offset + 1` + /// (items that go on counting ignore it; other paragraphs are always 0). #[serde(skip_serializing_if = "crate::node::is_default")] - pub start: u32, + pub start_offset: u32, } /// Character style. In runs, every field is an override; `None` means "inherit the base". @@ -661,15 +661,18 @@ impl TextData { } /// Apply `f` to the list settings of the paragraphs chars `start..end` touch (plain - /// paragraphs stay at level 0 with no start, levels stop at [`MAX_LIST_INDENT`]); one style - /// for all with no nesting or start folds back into `list`. + /// paragraphs stay at level 0, only numbered ones keep a start, levels stop at + /// [`MAX_LIST_INDENT`]); one style for all with no nesting or start folds back into `list`. pub fn set_para_lists(&mut self, start: usize, end: usize, f: impl Fn(&mut ParaList)) { let (a, b) = self.para_span(start, end); self.fill_paragraphs(); for pl in self.paragraphs.get_mut(a..=b).unwrap_or(&mut []) { f(pl); if pl.list == ListStyle::None { - *pl = ParaList::default(); + pl.indent = 0; + } + if pl.list != ListStyle::Numbered { + pl.start_offset = 0; } pl.indent = pl.indent.min(MAX_LIST_INDENT); } @@ -793,21 +796,24 @@ mod case_tests { #[test] fn list_starts_load_from_old_files_and_follow_edits() { - use ListStyle::{None as P, Numbered as N}; + use ListStyle::{Bulleted as B, None as P, Numbered as N}; // Files written before start numbers load with none, and write the same bytes. let old = r#"{"list":"numbered","indent":1}"#; let pl: ParaList = serde_json::from_str(old).unwrap(); - assert_eq!(pl, ParaList { list: N, indent: 1, start: 0 }); + assert_eq!(pl, ParaList { list: N, indent: 1, start_offset: 0 }); assert_eq!(serde_json::to_string(&pl).unwrap(), old); // One numbered paragraph with a start keeps it (it doesn't fold into `list`). let mut t = TextData { characters: "Next".into(), ..Default::default() }; - t.set_para_lists(0, 0, |p| *p = ParaList { list: N, indent: 0, start: 1 }); - assert_eq!(t.para_list(0), ParaList { list: N, indent: 0, start: 1 }); + t.set_para_lists(0, 0, |p| *p = ParaList { list: N, indent: 0, start_offset: 1 }); + assert_eq!(t.para_list(0), ParaList { list: N, indent: 0, start_offset: 1 }); // Enter copies it to the new item; different starts don't make the list mixed. t.replace_range(4, 4, "\nMore"); - assert_eq!(t.para_list(1).start, 1); - t.set_para_lists(5, 5, |p| p.start = 0); + assert_eq!(t.para_list(1).start_offset, 1); + t.set_para_lists(5, 5, |p| p.start_offset = 0); assert!(t.common_para_list(0, t.char_count()).is_some_and(|p| p.list == N)); + // Bullets have no number, so no start. + t.set_para_lists(0, 0, |p| *p = ParaList { list: B, indent: 1, start_offset: 4 }); + assert_eq!(t.para_list(0), ParaList { list: B, indent: 1, start_offset: 0 }); // A plain paragraph has none. t.set_para_lists(0, 0, |p| p.list = P); assert_eq!(t.para_list(0), ParaList::default()); diff --git a/crates/engine/src/inspect.rs b/crates/engine/src/inspect.rs index 1f461c60a..88bc015ad 100644 --- a/crates/engine/src/inspect.rs +++ b/crates/engine/src/inspect.rs @@ -191,7 +191,7 @@ pub fn node_json(doc: &Document, id: NodeId, depth: usize) -> Value { o.insert("textDecorationSkipInk".into(), json!(l.skip_ink)); o.insert("textDecorationColor".into(), l.color.map_or(json!("auto"), |c| json!(format!("#{}", c.to_hex())))); } - // Lists: one style for the layer, or each paragraph's type and nesting level. + // Lists: one style for the layer, or each paragraph's type, nesting level and start. if t.paragraphs.is_empty() { if t.list != figcraft_doc::ListStyle::None { o.insert("listStyle".into(), json!(t.list)); @@ -199,6 +199,9 @@ pub fn node_json(doc: &Document, id: NodeId, depth: usize) -> Value { } else { o.insert("lineTypes".into(), t.paragraphs.iter().map(|p| json!(p.list)).collect()); o.insert("lineIndentations".into(), t.paragraphs.iter().map(|p| json!(p.indent)).collect()); + if t.paragraphs.iter().any(|p| p.start_offset > 0) { + o.insert("listStartOffsets".into(), t.paragraphs.iter().map(|p| json!(p.start_offset)).collect()); + } } if t.list_spacing != 0.0 { o.insert("listSpacing".into(), json!(t.list_spacing)); diff --git a/crates/engine/src/text_tail_tests.rs b/crates/engine/src/text_tail_tests.rs index 687c67b86..81d05ed23 100644 --- a/crates/engine/src/text_tail_tests.rs +++ b/crates/engine/src/text_tail_tests.rs @@ -64,12 +64,15 @@ fn a_list_with_a_start_number_toggles_off() { let mut s = Session::new(); let t = text(&mut s, "two\nthree\nfour"); if let figcraft_doc::NodeKind::Text(td) = &mut s.doc_mut().unwrap().get_mut(t).unwrap().kind { - td.paragraphs = - vec![ParaList { list: N, indent: 0, start: 1 }, ParaList { list: N, indent: 0, start: 0 }, ParaList { list: N, indent: 0, start: 0 }]; + let n = |start_offset| ParaList { list: N, indent: 0, start_offset }; + td.paragraphs = vec![n(1), n(0), n(0)]; } + let j = crate::inspect::node_json(s.doc().unwrap(), t, 0); + assert_eq!(j["listStartOffsets"], json!([1, 0, 0]), "inspect reports the start"); s.execute("text.numberList", &json!({"ids": [t]})).unwrap(); assert_eq!(lists(&s, t), [(P, 0); 3]); - assert_eq!(data(&s, t).para_list(0).start, 0, "a plain paragraph has no start"); + assert_eq!(data(&s, t).para_list(0).start_offset, 0, "a plain paragraph has no start"); + assert!(crate::inspect::node_json(s.doc().unwrap(), t, 0).get("listStartOffsets").is_none()); } #[test] @@ -132,7 +135,7 @@ fn list_keys_at_list_items() { for (chars, before, caret, k, shift, after, want, why) in cases { let mut s = Session::new(); let t = text(&mut s, chars); - let ps: Vec = before.iter().map(|(list, indent)| ParaList { list: *list, indent: *indent, start: 0 }).collect(); + let ps: Vec = before.iter().map(|(list, indent)| ParaList { list: *list, indent: *indent, start_offset: 0 }).collect(); if let figcraft_doc::NodeKind::Text(td) = &mut s.doc_mut().unwrap().get_mut(t).unwrap().kind { td.paragraphs = ps; } @@ -156,7 +159,7 @@ fn paragraph_lists_follow_edits() { // A paragraph's list stays with it as text is typed, pasted and deleted: new paragraphs copy // the one they split from; joined paragraphs keep the first one's. let mut t = TextData::new("ab\ncd\nef"); - t.paragraphs = vec![ParaList { list: B, indent: 1, start: 0 }, ParaList::default(), ParaList { list: N, indent: 0, start: 0 }]; + t.paragraphs = vec![ParaList { list: B, indent: 1, start_offset: 0 }, ParaList::default(), ParaList { list: N, indent: 0, start_offset: 0 }]; let get = |t: &TextData| (0..t.paragraph_count()).map(|p| (t.para_list(p).list, t.para_list(p).indent)).collect::>(); t.replace_range(1, 1, "x\ny"); assert_eq!(get(&t), [(B, 1), (B, 1), (P, 0), (N, 0)], "a pasted newline: a new item like it"); @@ -171,7 +174,7 @@ fn paragraph_lists_follow_edits() { (seed >> 33) as usize % n.max(1) }; let mut t = TextData::new("a\nb\nc\nd"); - t.paragraphs = vec![ParaList { list: B, indent: 2, start: 0 }; 4]; + t.paragraphs = vec![ParaList { list: B, indent: 2, start_offset: 0 }; 4]; for _ in 0..500 { let n = t.char_count(); let (a, b) = (rnd(n + 2), rnd(n + 2)); diff --git a/crates/format/src/fig/export.rs b/crates/format/src/fig/export.rs index cb2b8bff2..dc56ff79d 100644 --- a/crates/format/src/fig/export.rs +++ b/crates/format/src/fig/export.rs @@ -1565,6 +1565,20 @@ impl<'d> Exporter<'d> { data.extend([("characterStyleIDs", arr(ids)), ("styleOverrideTable", arr(entries))]); } let lists: Vec = (0..td.paragraph_count()).map(|p| td.para_list(p).list).collect(); + let first = |i: usize, l: &ListStyle| *l != ListStyle::None && (i == 0 || lists.get(i - 1) != Some(l)); + // Where each line's numbered list starts counting, less one: its first item's start, on + // every line of the list. + let mut run = 0; + let starts: Vec = lists + .iter() + .enumerate() + .map(|(i, l)| { + if first(i, l) { + run = td.para_list(i).start_offset; + } + if *l == ListStyle::Numbered { run } else { 0 } + }) + .collect(); // One entry per paragraph, each with every field a reader expects. let line = |(i, l): (usize, &ListStyle)| { let ty = match l { @@ -1573,16 +1587,15 @@ impl<'d> Exporter<'d> { ListStyle::Bulleted => "UNORDERED_LIST", }; let listed = *l != ListStyle::None; - let first = listed && (i == 0 || lists.get(i - 1) != Some(l)); - // Where a numbered list starts counting, less one. - let start = if first && *l == ListStyle::Numbered { td.para_list(i).start } else { 0 }; + let begins = first(i, l); + let start = starts.get(i).copied().unwrap_or(0); o(vec![ ("lineType", e(ty)), ("styleId", int(0)), ("indentationLevel", int(i64::from(listed))), ("sourceDirectionality", e("AUTO")), ("listStartOffset", int(i64::from(start))), - ("isFirstLineOfList", b(first)), + ("isFirstLineOfList", b(begins)), ]) }; data.push(("lines", arr(lists.iter().enumerate().map(line).collect()))); diff --git a/crates/format/src/fig/text_list_tests.rs b/crates/format/src/fig/text_list_tests.rs index 8d314ccdb..eca7b0dc5 100644 --- a/crates/format/src/fig/text_list_tests.rs +++ b/crates/format/src/fig/text_list_tests.rs @@ -42,7 +42,7 @@ fn text_node(id: u64, name: &str, chars: &str, lines: Vec>) -> Kv<'s fn starts(doc: &figcraft_doc::Document, name: &str) -> Vec<(ListStyle, u32)> { let NodeKind::Text(t) = &named(doc, name).kind else { panic!("{name} is no text") }; - (0..t.paragraph_count()).map(|p| t.para_list(p)).map(|p: ParaList| (p.list, p.start)).collect() + (0..t.paragraph_count()).map(|p| t.para_list(p)).map(|p: ParaList| (p.list, p.start_offset)).collect() } #[test] @@ -65,7 +65,7 @@ fn numbered_lists_keep_their_start() { assert_eq!(starts(&doc, "From 2"), [(N, 1)], "shows 2."); assert_eq!(starts(&doc, "First only"), [(N, 3), (N, 0), (N, 0)]); assert_eq!(starts(&doc, "Every line"), [(N, 3), (N, 3), (N, 3)]); - assert_eq!(starts(&doc, "Mixed"), [(P, 0), (N, 4), (B, 2)]); + assert_eq!(starts(&doc, "Mixed"), [(P, 0), (N, 4), (B, 0)], "bullets have no number, so no start"); assert_eq!(starts(&doc, "Junk"), [(N, 0)], "a negative offset counts from 1"); } @@ -73,13 +73,10 @@ fn numbered_lists_keep_their_start() { fn the_export_writes_where_a_list_starts() { let mut doc = figcraft_doc::Document::new("Lists"); let page = doc.first_page().unwrap(); - let mut td = figcraft_doc::TextData::new("two\nthree\nplain\nsix"); - td.paragraphs = vec![ - ParaList { list: ListStyle::Numbered, indent: 0, start: 1 }, - ParaList { list: ListStyle::Numbered, indent: 0, start: 1 }, - ParaList::default(), - ParaList { list: ListStyle::Numbered, indent: 0, start: 5 }, - ]; + use ListStyle::{Bulleted as B, None as P, Numbered as N}; + let mut td = figcraft_doc::TextData::new("two\nthree\nplain\nsix\ndot"); + let pl = |list, start_offset| ParaList { list, indent: 0, start_offset }; + td.paragraphs = vec![pl(N, 1), pl(N, 0), pl(P, 0), pl(N, 5), pl(B, 4)]; doc.create(page, NodeKind::Text(td), "List", 0.0, 0.0, 200.0, 80.0).unwrap(); let (bytes, _) = super::super::export(&doc, None).unwrap(); let a = Archive::open(&bytes).unwrap(); @@ -88,7 +85,9 @@ fn the_export_writes_where_a_list_starts() { let text = msg.get("nodeChanges").unwrap().list().iter().find(|n| n.get("name").and_then(Kv::str) == Some("List")).unwrap(); let lines = text.get("textData").and_then(|d| d.get("lines")).map(Kv::list).unwrap(); let offsets: Vec = lines.iter().map(|l| l.get("listStartOffset").and_then(Kv::f64).unwrap()).collect(); - assert_eq!(offsets, [1.0, 0.0, 0.0, 5.0], "on the first line of each list only"); + // Every line of a numbered list carries its first item's start (a reader that takes it per + // line or per list counts the same); bullets and plain lines carry none. + assert_eq!(offsets, [1.0, 1.0, 0.0, 5.0, 0.0]); let (back, _) = import(&bytes, "x").unwrap(); - assert_eq!(starts(&back, "List"), [(ListStyle::Numbered, 1), (ListStyle::Numbered, 0), (ListStyle::None, 0), (ListStyle::Numbered, 5)]); + assert_eq!(starts(&back, "List"), [(N, 1), (N, 1), (P, 0), (N, 5), (B, 0)]); } diff --git a/crates/format/src/rest/text.rs b/crates/format/src/rest/text.rs index ea66e3906..c8fd92ba6 100644 --- a/crates/format/src/rest/text.rs +++ b/crates/format/src/rest/text.rs @@ -226,7 +226,7 @@ fn lists(v: &Value, td: &mut TextData) { _ => ListStyle::None, }, indent: indents.get(i).and_then(Value::as_f64).filter(|d| d.is_finite()).map_or(0, |d| d.clamp(0.0, 255.0) as u8), - start: starts.get(i).and_then(Value::as_f64).filter(|n| n.is_finite()).map_or(0, |n| n.clamp(0.0, f64::from(u32::MAX)) as u32), + start_offset: starts.get(i).and_then(Value::as_f64).filter(|n| n.is_finite()).map_or(0, |n| n.clamp(0.0, f64::from(u32::MAX)) as u32), }) .collect(); // Clamp the levels and fold one style for all back into the layer's list style. diff --git a/crates/text/src/layout.rs b/crates/text/src/layout.rs index 5ba5dd48a..e6c893b73 100644 --- a/crates/text/src/layout.rs +++ b/crates/text/src/layout.rs @@ -844,7 +844,7 @@ pub(crate) fn list_markers(lists: &[ParaList]) -> Vec { *c = (ListStyle::None, 0); } let Some(c) = count.get_mut(d) else { return String::new() }; - let first = usize::try_from(pl.start).unwrap_or(usize::MAX).saturating_add(1); + let first = usize::try_from(pl.start_offset).unwrap_or(usize::MAX).saturating_add(1); *c = if c.0 == pl.list { (pl.list, c.1.saturating_add(1)) } else { (pl.list, first) }; match (pl.list, d % 3) { (ListStyle::Numbered, 1) => format!("{}.", alpha(c.1)), diff --git a/crates/text/src/tail_tests.rs b/crates/text/src/tail_tests.rs index b1854dfd4..2d0ad22b7 100644 --- a/crates/text/src/tail_tests.rs +++ b/crates/text/src/tail_tests.rs @@ -43,11 +43,11 @@ fn starts(l: &TextLayout) -> Vec<(f64, Option)> { } fn pl(list: ListStyle, indent: u8) -> ParaList { - ParaList { list, indent, start: 0 } + ParaList { list, indent, start_offset: 0 } } -fn from(list: ListStyle, indent: u8, start: u32) -> ParaList { - ParaList { list, indent, start } +fn from(list: ListStyle, indent: u8, start_offset: u32) -> ParaList { + ParaList { list, indent, start_offset } } #[test] diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 1b8cdcc44..6f0cce807 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -17,7 +17,7 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| -| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs and list types (numbered lists keep the number they start at), vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Not read: connector labels, table cells beyond their own layers, filled areas with their own fills, per-point stroke joins, variables bound to fields the editor can't bind, fixed or content-sized grid tracks, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs`, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | +| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs and list types (numbered lists keep the number they start at), vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Not read: nested list levels and where a new list begins right after another numbered one (`isFirstLineOfList`), connector labels, table cells beyond their own layers, filled areas with their own fills, per-point stroke joins, variables bound to fields the editor can't bind, fixed or content-sized grid tracks, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs`, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | | REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout, constraints, grids, components, sets, instances with overrides, component properties, styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | @@ -89,7 +89,7 @@ each. (font, with styles under their standard names such as "Semi Bold"; size; line height, a share of the font size as a raw multiplier; letter spacing, case, decoration, links), alignment, auto resize, truncation, paragraph spacing and indent, list types (with the number a numbered list starts - at; not yet checked in other software) and styled runs with their fills (indexed + at, on every line of the list; not yet checked in other software) and styled runs with their fills (indexed by UTF-16 unit); components (description, boolean, text and instance swap properties and the layers bound to them), component sets, instances (their main, property values, what the instance itself changes from its main, such as its size, name and paints, as an override addressed by the @@ -163,7 +163,7 @@ each. | Date | Change | Summary | |---|---|---| -| 2026-10-16 | minor | `.fig` numbered lists keep the number they start at (#686): a list Figma shows as starting at 2 imported as 1. The import reads each line's start offset, a text keeps it per paragraph (older files open unchanged), numbering counts on from it, and the export writes it on a list's first line. Nested list levels from `.fig` files are still read as the first level. Numbers unchanged | +| 2026-10-16 | minor | `.fig` numbered lists keep the number they start at (#686): a list Figma shows as starting at 2 imported as 1. The import reads each line's start offset, a numbered paragraph keeps it (older files open unchanged), numbering counts on from it, `get_node` reports it (`listStartOffsets`), and the export writes it on every line of the list. Nested list levels and a new list right after another numbered one are still not read from `.fig` files. Numbers unchanged | | 2026-10-14 | minor | SVG/PDF depth overflow (#208) is checked before bounds and drawing; public checked APIs return the offending root/layer, commands and CLI report it, and no incomplete export replaces an existing file. Tested at depths 255/256/257, with inner roots, hidden branches, masks, raster fallbacks and multiple roots/pages. Numbers unchanged. | | 2026-10-13 | minor | `.fig` export (gap 1): instances write what they change from their main as an override addressed by the main's id (their size, name and paints were lost elsewhere without it), what follows for their layers as derived data, and a scale factor when scaled as a whole; layers of a nested instance swapped for another component keep their overrides; variable collections, modes, variables and their bindings, the modes frames and pages set, shared styles with their links and variable-width strokes are written, and the import reads all of it back (style definitions and unused styles, variable order and scopes, bindings on paint lists, gradient stops, effects and layout grids, page modes, text field bindings, which a `.fig` import used to drop, and width profiles). Opened `.fig` and file JSON documents link nested instances of variants (and any nested instance under a name of its own) to their main's layers; they stayed unlinked, so a second export lost what they changed. Checked by opening written files in other software: resized and scaled instances keep their size and lay their layers out for it, variables with their modes and colour bindings resolve there (a frame set to another mode shows that mode's colours, also inside instances), colour, text, effect and grid styles are listed, and variable-width strokes that are the same on both sides of the path draw with their width; number, string and boolean bindings and bindings on effects, layout guides and gradient stops come across as the values they give but did not show as bound there (their entries now also name the layer field they set, not yet checked there), and strokes wider on one side of the path are written as filled outlines, no longer editable strokes there (the stroke itself is kept as plugin data and our own import puts it back; not yet checked there). Numbers unchanged | | 2026-10-12 | minor | `.fig` export made to open elsewhere (gap 1): the document and its pages say they are visible and opaque (left out, nothing was drawn), the schema in the file uses the format's own names, kinds, field ids and enum values, rectangles are rounded rectangles with four radii, frames and shapes carry their fill outline and plain strokes their stroke outline, text carries its layout settings, font styles use their standard names, line heights that are a share of the font size are raw multipliers, masks keep their type (read back too); the import reads per-side stroke weights whose zero sides are left out. Written files were checked by opening them in other software: layers, fills, gradients, strokes, shadows, vectors, components and text draw as in FigCraft; effects such as glass and noise, images and prototype interactions are still unchecked there, and variables are not written. Numbers unchanged | diff --git a/docs/mcp.md b/docs/mcp.md index 4efee72ac..331dc67de 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -177,7 +177,8 @@ Or in a project's `.mcp.json`: - **Lists** are per paragraph: `listStyle` (`none`, `bulleted`, `numbered`) and `indentation` (the nesting level, 0–8) apply to the paragraphs chars `start`..`end` touch (all of them without a range); `get_node` reports one `listStyle` for the layer, or `lineTypes` and `lineIndentations` - per paragraph. `text.bulletList`, `text.numberList` and `text.listStyle` act on the selected + per paragraph, plus `listStartOffsets` when a numbered list starts past 1 (from a `.fig` file; + 1 shows "2."). `text.bulletList`, `text.numberList` and `text.listStyle` act on the selected paragraphs while text is edited. Layer props: `listSpacing` (px between list items, in place of `paragraphSpacing`), `hangingList` (markers outside the box) and `hangingPunctuation`. While editing, `key` Tab / Shift+Tab nest an item or move it out, Enter on an empty item and Backspace From ed74fc67d07c4ef27e872edac92a601d28d26ae7 Mon Sep 17 00:00:00 2001 From: Dubblbindong <48181403+Dubblbindong@users.noreply.github.com> Date: Fri, 16 Oct 2026 20:12:54 +0200 Subject: [PATCH 088/817] feat(plugin): add saveFile permission with host-owned save dialog Plugins can hand the host a file name, MIME type and bytes through the new `save_file` import (plugin API 4, `permissions.saveFile`). The host asks the user where to save (browser download on the web), so the plugin never sees a path. Includes the SDK wrapper and the `export-names` example plugin. Co-Authored-By: Claude Sonnet 5.5 Assisted-by: Claude (Anthropic) --- README.md | 2 +- apps/figcraft-server/src/directory.rs | 1 + crates/collab/src/message.rs | 2 + crates/engine/src/cmd/file.rs | 5 +- crates/engine/src/plugin_directory.rs | 2 +- crates/engine/src/plugins.rs | 75 ++++++++- crates/engine/src/plugins_tests.rs | 126 ++++++++++++++++ crates/plugin/src/lib.rs | 2 + crates/plugin/src/manifest.rs | 11 +- crates/plugin/src/sandbox.rs | 26 +++- crates/plugin/src/save_file_tests.rs | 142 ++++++++++++++++++ crates/plugin/src/tests.rs | 2 +- crates/plugin/src/widget_tests.rs | 2 +- crates/ui-egui/locales/de.toml | 4 + crates/ui-egui/locales/en.toml | 4 + crates/ui-egui/locales/es.toml | 4 + crates/ui-egui/src/lib.rs | 3 + crates/ui-egui/src/plugin_save_ui_tests.rs | 71 +++++++++ crates/ui-egui/src/plugins_ui.rs | 36 +++++ docs/plugins.md | 23 ++- plugins/Cargo.lock | 7 + plugins/examples/export-names/Cargo.toml | 15 ++ .../export-names/figcraft-plugin.json | 22 +++ plugins/examples/export-names/src/lib.rs | 55 +++++++ plugins/sdk/src/lib.rs | 16 ++ xtask/src/main.rs | 2 +- 26 files changed, 638 insertions(+), 22 deletions(-) create mode 100644 crates/plugin/src/save_file_tests.rs create mode 100644 crates/ui-egui/src/plugin_save_ui_tests.rs create mode 100644 plugins/examples/export-names/Cargo.toml create mode 100644 plugins/examples/export-names/figcraft-plugin.json create mode 100644 plugins/examples/export-names/src/lib.rs diff --git a/README.md b/README.md index 0910bf9e7..c232df088 100644 --- a/README.md +++ b/README.md @@ -228,7 +228,7 @@ The desktop app also offers a loopback-only control channel (`figcraft --control - **Runs in the browser:** the whole engine and UI compile to WebAssembly. - **Accessible:** screen readers get names, roles, values and states for the tools, layer rows, fields, dropdowns, tabs and menus (AccessKit on desktop), F6 moves the keyboard between the toolbar, layers, canvas and properties (Tab within them, Escape back to the canvas), the system's reduce-motion setting is honoured, and panel text meets WCAG AA contrast in both themes. - **Languages:** English, Russian and Turkish (reviewed by native speakers), and Spanish, French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Czech and Indonesian drafts, picked in Preferences or taken from the system or browser and switched live; adding a language is one catalog file ([`docs/translating.md`](docs/translating.md)). -- **Plugins:** sandboxed WebAssembly plugins (a metered, pure-Rust interpreter with a memory cap and no file or network access, in the browser too) that act through the same commands, each run one undo step, within the permissions their manifest asks for. A Rust SDK and two example plugins are in [`plugins/`](plugins); see [`docs/plugins.md`](docs/plugins.md). +- **Plugins:** sandboxed WebAssembly plugins (a metered, pure-Rust interpreter with a memory cap and no file or network access, in the browser too) that act through the same commands, each run one undo step, within the permissions their manifest asks for. A Rust SDK and four example plugins are in [`plugins/`](plugins); see [`docs/plugins.md`](docs/plugins.md). - **Live sessions (preview):** share the open file from the app (Share ▸ Start sharing: online through a server, or on your local network), give the others the short join code it shows (or the invite link), and edit it together: everyone's changes sync live, with cursors, selections, avatars and follow, and undo takes back only your own changes. Others join from the desktop app (invite links open it) or from the browser build. See [`docs/collab-protocol.md`](docs/collab-protocol.md). - **A server of your own (preview):** `figcraft-server` keeps a team's files, publishes them from the app (File ▸ Publish to server…, or Share ▸ Online with your server in Preferences) and hands out share links and join codes that let people edit or only view; files survive restarts and apps reconnect where they were. No accounts yet: links are the access. Releases ship it for Linux, and the desktop app joins over `wss://`; [hosting it on a rented Linux server](docs/server.md#deploy-on-a-linux-server) takes a systemd unit and Caddy or nginx (or Docker). See [`docs/server.md`](docs/server.md). - **Never crashes:** no `unwrap`, `expect` or `panic` in shipped code, enforced by clippy; commands run behind a guard so a bug fails one action, not your session. diff --git a/apps/figcraft-server/src/directory.rs b/apps/figcraft-server/src/directory.rs index 0443c0f49..cdf183649 100644 --- a/apps/figcraft-server/src/directory.rs +++ b/apps/figcraft-server/src/directory.rs @@ -245,6 +245,7 @@ impl Directory { }, commands: m.permissions.commands.clone(), widget: m.widget, + save_file: m.permissions.save_file, bytes: bytes.len() as u64, sha256: sha.clone(), published: now(), diff --git a/crates/collab/src/message.rs b/crates/collab/src/message.rs index d035042b2..734e4076a 100644 --- a/crates/collab/src/message.rs +++ b/crates/collab/src/message.rs @@ -537,6 +537,8 @@ pub struct PluginEntry { pub commands: Vec, /// It draws a widget. pub widget: bool, + /// It may offer files to save (`permissions.saveFile`). + pub save_file: bool, /// The bundle's size in bytes and its SHA-256 (hex). pub bytes: u64, pub sha256: String, diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index 5e27c5726..97be8439b 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -1103,9 +1103,12 @@ fn export_path(name: &str) -> String { if parts.is_empty() { "Untitled".into() } else { parts.join("/") } } +/// Characters no file name may contain (path separators and ones file systems reject). +pub(crate) const FORBIDDEN_FILE_NAME_CHARS: &str = "/\\:*?\"<>|"; + /// `name` without path separators and characters file systems reject. fn safe_file_name(name: &str) -> String { - name.chars().take(200).map(|c| if c.is_control() || "/\\:*?\"<>|".contains(c) { '_' } else { c }).collect() + name.chars().take(200).map(|c| if c.is_control() || FORBIDDEN_FILE_NAME_CHARS.contains(c) { '_' } else { c }).collect() } /// Layers on `page` that have export settings (document order). diff --git a/crates/engine/src/plugin_directory.rs b/crates/engine/src/plugin_directory.rs index c3bf7dc44..5ddc2a81e 100644 --- a/crates/engine/src/plugin_directory.rs +++ b/crates/engine/src/plugin_directory.rs @@ -281,7 +281,7 @@ pub fn specs() -> Vec { spec!( "plugin.directory.list", "Browse plugin directory", - "{server? (ws://host:port/; default: the one browsed last), query?} → {server, plugins: [{id, name, version, description, author, api, access, commands, widget, bytes, sha256, published, versions, installed, update}]}", + "{server? (ws://host:port/; default: the one browsed last), query?} → {server, plugins: [{id, name, version, description, author, api, access, commands, widget, save_file, bytes, sha256, published, versions, installed, update}]}", false, list ), diff --git a/crates/engine/src/plugins.rs b/crates/engine/src/plugins.rs index f1c4075e3..1fab5145a 100644 --- a/crates/engine/src/plugins.rs +++ b/crates/engine/src/plugins.rs @@ -153,6 +153,39 @@ fn writes_widget_data(params: &Value, depth: usize) -> bool { struct EngineHost<'s> { s: &'s mut Session, manifest: &'s Manifest, + /// Files offered for saving in this call. + saves: u32, +} + +/// Longest file name a plugin may suggest, in characters. +const MAX_SAVE_NAME: usize = 128; +/// Longest MIME type a plugin may name, in bytes. +const MAX_SAVE_MIME: usize = 100; +/// Largest file a plugin may offer for saving, in bytes (the sandbox's message limit). +const MAX_SAVE_BYTES: usize = 16 * 1024 * 1024; +/// Files a plugin may offer per call. +const MAX_SAVES: u32 = 1; + +/// A file name a plugin suggested, cleaned up: a bare name without folders, drive letters, `..` or +/// characters no file system takes. `None` when nothing usable is left. +pub(crate) fn sanitize_save_name(name: &str) -> Option { + let name = name.trim(); + let bad = name.is_empty() + || name.chars().count() > MAX_SAVE_NAME + || name == "." + || name.contains("..") + || name.chars().any(|c| c.is_control() || crate::cmd::file::FORBIDDEN_FILE_NAME_CHARS.contains(c)); + if bad { None } else { Some(name.to_string()) } +} + +/// `mime` when it looks like `type/subtype` in ASCII, else the generic binary type. +fn sanitize_mime(mime: &str) -> String { + let mime = mime.trim(); + let token = |t: &str| !t.is_empty() && t.chars().all(|c| c.is_ascii_alphanumeric() || matches!(c, '.' | '+' | '-' | '_')); + match mime.split_once('/') { + Some((a, b)) if mime.len() <= MAX_SAVE_MIME && token(a) && token(b) => mime.to_ascii_lowercase(), + _ => "application/octet-stream".into(), + } } impl figcraft_plugin::Host for EngineHost<'_> { @@ -226,6 +259,27 @@ impl figcraft_plugin::Host for EngineHost<'_> { } Ok(()) } + + fn save_file(&mut self, name: &str, mime: &str, data: &[u8]) -> std::result::Result<(), String> { + if !self.manifest.permissions.save_file { + return Err(format!("{} didn't ask permission to save files (`permissions.saveFile`)", self.manifest.name)); + } + let name = sanitize_save_name(name).ok_or_else(|| { + format!("not a usable file name: use a plain name of 1–{MAX_SAVE_NAME} characters without folders or `/ \\ : .. < > \" | ? *`") + })?; + if data.len() > MAX_SAVE_BYTES { + return Err(format!("a file to save is limited to {} MB", MAX_SAVE_BYTES / (1024 * 1024))); + } + if self.saves >= MAX_SAVES { + return Err("a plugin can offer one file per run".into()); + } + self.saves += 1; + use base64::Engine as _; + let data = base64::engine::general_purpose::STANDARD.encode(data); + // The app asks the user where it goes; programmatic callers drop the request. + self.s.request_ui("dialog.pluginSave", json!({"plugin": self.manifest.id, "name": name, "mime": sanitize_mime(mime), "data": data})); + Ok(()) + } } /// The installed plugin `id`. @@ -424,14 +478,21 @@ pub(crate) fn call_plugin( input: &str, ) -> std::result::Result { let mut usable = false; - s.grouped(label, |s| { - let mut host = EngineHost { s, manifest: m }; - instance.call(input, &mut host).map_err(|e| { - usable = matches!(e, PluginError::Failed(_)); - plugin_error(&m.name, e) + let ui_before = s.ui_requests.len(); + let r = s + .grouped(label, |s| { + let mut host = EngineHost { s, manifest: m, saves: 0 }; + instance.call(input, &mut host).map_err(|e| { + usable = matches!(e, PluginError::Failed(_)); + plugin_error(&m.name, e) + }) }) - }) - .map_err(|e| (e, usable)) + .map_err(|e| (e, usable)); + // A failed run opens no dialog (a file it offered to save is dropped with it). + if r.is_err() { + s.ui_requests.truncate(ui_before); + } + r } /// What `plugin.run` and `plugin.event` return. diff --git a/crates/engine/src/plugins_tests.rs b/crates/engine/src/plugins_tests.rs index 102d675a3..ebabc09ef 100644 --- a/crates/engine/src/plugins_tests.rs +++ b/crates/engine/src/plugins_tests.rs @@ -397,3 +397,129 @@ fn a_full_undo_history_keeps_its_steps_and_tampered_manifests_are_refused() { s.prefs.plugins[0].manifest.main = "../../elsewhere.wasm".into(); assert!(matches!(s.execute("plugin.run", &json!({"id": "org.test.many"})), Err(EngineError::BadParams { .. }))); } + +/// A module that offers `files` (name, mime, data) with `save_file` in order, outputs the last +/// refusal and returns `exit`. +fn saver(files: &[(&str, &str, &[u8])], exit: i32) -> Vec { + let hex = |b: &[u8]| b.iter().map(|b| format!("\\{b:02x}")).collect::(); + let mut data = String::new(); + let mut body = String::new(); + let mut at = 0usize; + for (name, mime, bytes) in files { + let (n, m) = (at, at + name.len()); + let d = m + mime.len(); + data += &format!( + "(data (i32.const {n}) \"{}\") (data (i32.const {m}) \"{}\") (data (i32.const {d}) \"{}\")\n", + hex(name.as_bytes()), + hex(mime.as_bytes()), + hex(bytes) + ); + body += &format!( + "(local.set $st (call $save_file (i32.const {n}) (i32.const {}) (i32.const {m}) (i32.const {}) (i32.const {d}) (i32.const {}))) + (if (local.get $st) (then (call $set_output (i32.const 30000) (call $reply_read (i32.const 30000) (i32.const 500)))))\n", + name.len(), + mime.len(), + bytes.len() + ); + at = d + bytes.len(); + } + let wat = format!( + r#"(module + (import "figcraft" "save_file" (func $save_file (param i32 i32 i32 i32 i32 i32) (result i32))) + (import "figcraft" "reply_read" (func $reply_read (param i32 i32) (result i32))) + (import "figcraft" "set_output" (func $set_output (param i32 i32))) + (memory (export "memory") 1) + {data} + (func (export "figcraft_run") (param $n i32) (result i32) (local $st i32) + {body} + (i32.const {exit})))"# + ); + wat::parse_str(&wat).unwrap_or_else(|e| panic!("{e}\n{wat}")) +} + +fn save_manifest(id: &str, save_file: bool) -> Value { + json!({"id": id, "name": "Saver", "version": "1.0.0", "main": "plugin.wasm", "api": 4, "permissions": {"access": "read", "saveFile": save_file}}) +} + +fn saves(s: &Session) -> Vec<&crate::UiRequest> { + s.ui_requests.iter().filter(|r| r.kind == "dialog.pluginSave").collect() +} + +#[test] +fn a_plugin_without_the_permission_cannot_save() { + let mut s = Session::new(); + install(&mut s, save_manifest("org.test.nosave", false), &saver(&[("a.txt", "text/plain", b"hi")], 0)); + let out = ex(&mut s, "plugin.run", json!({"id": "org.test.nosave"})); + assert!(out["output"].as_str().unwrap_or_default().contains("permission"), "{out}"); + assert!(saves(&s).is_empty(), "no dialog without the permission"); +} + +#[test] +fn a_plugin_with_the_permission_requests_one_save_dialog_with_its_bytes() { + let mut s = Session::new(); + install(&mut s, save_manifest("org.test.save", true), &saver(&[("out.jsx", "TEXT/Javascript", b"\x00hi\xff")], 0)); + ex(&mut s, "plugin.run", json!({"id": "org.test.save"})); + let reqs = saves(&s); + let [r] = reqs.as_slice() else { panic!("one request, got {}", reqs.len()) }; + assert_eq!(r.data["plugin"], "org.test.save"); + assert_eq!(r.data["name"], "out.jsx"); + assert_eq!(r.data["mime"], "text/javascript"); + assert_eq!(r.data["data"], b64(b"\x00hi\xff")); + // Nothing in the request is a path. + assert!(r.data.get("path").is_none()); +} + +#[test] +fn a_second_file_in_one_run_and_bad_names_are_refused() { + let mut s = Session::new(); + install(&mut s, save_manifest("org.test.two", true), &saver(&[("a.txt", "text/plain", b"1"), ("b.txt", "text/plain", b"2")], 0)); + let out = ex(&mut s, "plugin.run", json!({"id": "org.test.two"})); + assert_eq!(saves(&s).len(), 1, "only the first file"); + assert!(out["output"].as_str().unwrap_or_default().contains("one file"), "{out}"); + s.ui_requests.clear(); + install(&mut s, save_manifest("org.test.bad", true), &saver(&[("../etc/passwd", "text/plain", b"1")], 0)); + let out = ex(&mut s, "plugin.run", json!({"id": "org.test.bad"})); + assert!(saves(&s).is_empty()); + assert!(out["output"].as_str().unwrap_or_default().contains("file name"), "{out}"); +} + +#[test] +fn an_odd_mime_type_becomes_generic_binary() { + let mut s = Session::new(); + install(&mut s, save_manifest("org.test.mime", true), &saver(&[("a.bin", "not a type", b"1")], 0)); + ex(&mut s, "plugin.run", json!({"id": "org.test.mime"})); + assert_eq!(saves(&s)[0].data["mime"], "application/octet-stream"); +} + +#[test] +fn a_run_that_fails_afterwards_leaves_no_dialog_behind() { + let mut s = Session::new(); + install(&mut s, save_manifest("org.test.late", true), &saver(&[("a.txt", "text/plain", b"1")], 1)); + run_err(&mut s, "org.test.late"); + assert!(saves(&s).is_empty(), "a failed run opens no dialog"); +} + +#[test] +fn file_commands_stay_closed_to_plugins() { + let mut s = Session::new(); + let calls = [("file.saveAs", json!({"path": "/tmp/x.figcraft"}))]; + install(&mut s, manifest("org.test.files", "read", &[]), &script(&calls, OnRefusal::Report, "")); + let out = ex(&mut s, "plugin.run", json!({"id": "org.test.files"})); + assert!(out["output"].as_str().unwrap_or_default().contains("isn't available to plugins"), "{out}"); +} + +#[test] +fn save_names_are_plain_file_names() { + use crate::plugins::sanitize_save_name as clean; + let long = "a".repeat(129); + let max = "a".repeat(128); + // 128 two-byte characters are within the limit even though they take 256 bytes. + let wide = "é".repeat(128); + for bad in ["", " ", ".", "..", "../x", "a/b", "a\\b", "C:x", "a..b", "a\nb", "a\u{0}b", "a\u{7f}b", "a*b", long.as_str()] { + assert_eq!(clean(bad), None, "{bad:?}"); + } + assert_eq!(clean(" out.jsx ").as_deref(), Some("out.jsx")); + assert_eq!(clean(&max).as_deref(), Some(max.as_str())); + assert_eq!(clean(&wide).as_deref(), Some(wide.as_str())); + assert_eq!(clean("Entwurf – Büro.jsx").as_deref(), Some("Entwurf – Büro.jsx")); +} diff --git a/crates/plugin/src/lib.rs b/crates/plugin/src/lib.rs index 582b0e643..80a262953 100644 --- a/crates/plugin/src/lib.rs +++ b/crates/plugin/src/lib.rs @@ -16,6 +16,8 @@ pub use widget::{WidgetKind, WidgetNode, WidgetRender}; #[cfg(test)] mod bundle_tests; #[cfg(test)] +mod save_file_tests; +#[cfg(test)] mod tests; #[cfg(test)] mod v2_tests; diff --git a/crates/plugin/src/manifest.rs b/crates/plugin/src/manifest.rs index 48e44e880..6af92a95f 100644 --- a/crates/plugin/src/manifest.rs +++ b/crates/plugin/src/manifest.rs @@ -8,7 +8,7 @@ use serde_json::{Map, Value}; /// The manifest's file name. pub const MANIFEST_FILE: &str = "figcraft-plugin.json"; /// The plugin API version this build implements (`api` in the manifest). -pub const API_VERSION: u32 = 3; +pub const API_VERSION: u32 = 4; /// Largest manifest read. pub const MAX_MANIFEST_BYTES: usize = 256 * 1024; @@ -43,7 +43,7 @@ pub struct Manifest { /// The WebAssembly module, relative to the manifest (`plugin.wasm`). pub main: String, /// The plugin API version the plugin was written for (1 when not given; panels and settings - /// need 2, widgets 3). + /// need 2, widgets 3, `saveFile` 4). #[serde(default = "api_version")] pub api: u32, #[serde(default)] @@ -71,6 +71,10 @@ pub struct Permissions { /// command its access allows. #[serde(default, skip_serializing_if = "Vec::is_empty")] pub commands: Vec, + /// API 4: the plugin may hand the host a file to save. The host asks the user where; the plugin + /// never sees a path. + #[serde(default, rename = "saveFile", skip_serializing_if = "std::ops::Not::not")] + pub save_file: bool, } impl Permissions { @@ -314,6 +318,9 @@ impl Manifest { if self.widget && self.api < 3 { return Err("a widget needs plugin API 3 (`\"api\": 3`)".into()); } + if self.permissions.save_file && self.api < 4 { + return Err("saveFile needs plugin API 4 (`\"api\": 4`)".into()); + } if self.commands.is_empty() && !self.widget { self.commands.push(PluginCommand { id: "run".into(), label: "Run".into(), params: Vec::new() }); } diff --git a/crates/plugin/src/sandbox.rs b/crates/plugin/src/sandbox.rs index 22eb0af04..59d661187 100644 --- a/crates/plugin/src/sandbox.rs +++ b/crates/plugin/src/sandbox.rs @@ -2,7 +2,8 @@ //! memory cap, and sees the outside world only through the host functions below. There is no WASI: //! no file system, network, clock or randomness. //! -//! # ABI (version 3; version 1 is the first seven imports, version 2 adds panels and settings) +//! # ABI (version 4; version 1 is the first seven imports, version 2 adds panels and settings, +//! version 3 widgets, version 4 `save_file`) //! //! The module exports its `memory` and `figcraft_run(input_len: i32) -> i32`. Host functions are //! imported from the module `figcraft`; strings are UTF-8 `(ptr, len)` pairs in the plugin's memory. @@ -22,6 +23,7 @@ //! | `setting_set` | `(key_ptr, key_len, value_ptr, value_len) -> i32` | Stores JSON under the key. 1: refused, the reply says why. | //! | `setting_delete` | `(key_ptr, key_len)` | Forgets a setting. | //! | `widget_render` | `(ptr, len) -> i32` | Draws the widget being called back: a [`WidgetRender`] as JSON. 1: invalid, the reply says why. | +//! | `save_file` | `(name_ptr, name_len, mime_ptr, mime_len, data_ptr, data_len) -> i32` | Offers a file to save (needs `permissions.saveFile`). The host asks the user where it goes; the plugin never gets a path. 0: accepted, 1: refused, the reply says why. | //! //! When `figcraft_run` starts, the reply holds the input JSON (`input_len` bytes): //! `{"api", "command", "params", "selection"}`, plus `event` and `values` when a panel calls the @@ -58,6 +60,7 @@ const IMPORTS: &[(&str, usize, usize)] = &[ ("setting_set", 4, 1), ("setting_delete", 2, 0), ("widget_render", 2, 1), + ("save_file", 6, 1), ]; /// What a run may use. @@ -136,6 +139,11 @@ pub trait Host { fn set_setting(&mut self, _key: &str, _value: Option<&str>) -> Result<(), String> { Err("settings aren't available here".into()) } + /// Offer the file `name` (MIME type `mime`) for saving, or say why not. The host picks the + /// destination; the plugin never learns it. + fn save_file(&mut self, _name: &str, _mime: &str, _data: &[u8]) -> Result<(), String> { + Err("saving files isn't available here".into()) + } } /// What a run asked of the panel. @@ -172,6 +180,7 @@ enum Request { SettingGet(String), SettingSet(String, String), SettingDelete(String), + SaveFile(String, String, Vec), } struct State { @@ -237,6 +246,13 @@ impl State { let _ = host.set_setting(&key, None); None } + Request::SaveFile(name, mime, data) => Some(match host.save_file(&name, &mime, &data) { + Ok(()) => 0, + Err(m) => { + self.set_reply(m.into_bytes()); + 1 + } + }), } } } @@ -575,5 +591,13 @@ fn linker(engine: &Engine) -> Result, PluginError> { Err(ask(&mut c, Request::SettingDelete(key))) }) .map_err(err)?; + l.func_wrap(IMPORT_MODULE, "save_file", |mut c: Ctx<'_>, np: i32, nl: i32, mp: i32, ml: i32, dp: i32, dl: i32| -> Result { + charge(&mut c)?; + let name = read_str(&mut c, np, nl)?; + let mime = read_str(&mut c, mp, ml)?; + let data = read_bytes(&mut c, dp, dl)?; + Err(ask(&mut c, Request::SaveFile(name, mime, data))) + }) + .map_err(err)?; Ok(l) } diff --git a/crates/plugin/src/save_file_tests.rs b/crates/plugin/src/save_file_tests.rs new file mode 100644 index 000000000..34241bb73 --- /dev/null +++ b/crates/plugin/src/save_file_tests.rs @@ -0,0 +1,142 @@ +//! `save_file` (API 4): the manifest permission, the host call with its bytes, and the limits. + +use serde_json::json; + +use crate::{Host, Instance, Limits, Manifest, PluginError}; + +/// A host that records the files offered to it (and refuses names starting with `no`). +#[derive(Default)] +struct Saves(Vec<(String, String, Vec)>); + +impl Host for Saves { + fn call(&mut self, _command: &str, _params: &str) -> Result { + Ok("{}".into()) + } + fn selection(&mut self) -> String { + "[]".into() + } + fn notify(&mut self, _message: &str) {} + fn save_file(&mut self, name: &str, mime: &str, data: &[u8]) -> Result<(), String> { + if name.starts_with("no") { + return Err("nope".into()); + } + self.0.push((name.into(), mime.into(), data.to_vec())); + Ok(()) + } +} + +/// A host that keeps the default `save_file`. +struct Plain; + +impl Host for Plain { + fn call(&mut self, _command: &str, _params: &str) -> Result { + Ok("{}".into()) + } + fn selection(&mut self) -> String { + "[]".into() + } + fn notify(&mut self, _message: &str) {} +} + +/// Memory: name at 0, MIME at 100, data at 200. `call` is the arguments of `save_file`; its status +/// is the run's status, and its reply is the output. +fn module(name: &str, mime: &str, data: &[u8], call: &str) -> Vec { + let bytes = |b: &[u8]| b.iter().map(|b| format!("\\{b:02x}")).collect::(); + let wat = format!( + r#"(module + (import "figcraft" "save_file" (func $save_file (param i32 i32 i32 i32 i32 i32) (result i32))) + (import "figcraft" "reply_read" (func $reply_read (param i32 i32) (result i32))) + (import "figcraft" "set_output" (func $set_output (param i32 i32))) + (memory (export "memory") 1) + (data (i32.const 0) "{}") (data (i32.const 100) "{}") (data (i32.const 200) "{}") + (func (export "figcraft_run") (param $n i32) (result i32) (local $st i32) + (local.set $st {call}) + (call $set_output (i32.const 1000) (call $reply_read (i32.const 1000) (i32.const 100))) + (local.get $st)))"#, + bytes(name.as_bytes()), + bytes(mime.as_bytes()), + bytes(data) + ); + wat::parse_str(&wat).unwrap_or_else(|e| panic!("{e}\n{wat}")) +} + +fn call(name: &str, mime: &str, data: &[u8]) -> String { + format!( + "(call $save_file (i32.const 0) (i32.const {}) (i32.const 100) (i32.const {}) (i32.const 200) (i32.const {}))", + name.len(), + mime.len(), + data.len() + ) +} + +fn manifest(api: u32, save_file: bool) -> String { + json!({"id": "org.test.save", "name": "Save", "main": "p.wasm", "api": api, "permissions": {"saveFile": save_file}}).to_string() +} + +#[test] +fn the_host_gets_the_name_the_type_and_the_exact_bytes() { + let data = [0u8, 1, 2, 255, 0x80, b'x']; + let wasm = module("out.jsx", "text/plain", &data, &call("out.jsx", "text/plain", &data)); + let mut host = Saves::default(); + Instance::new(&wasm, &Limits::default()).unwrap().call("{}", &mut host).unwrap(); + assert_eq!(host.0, vec![("out.jsx".to_string(), "text/plain".to_string(), data.to_vec())]); +} + +#[test] +fn a_refusal_returns_status_one_with_the_reason() { + let wasm = module("no.txt", "text/plain", b"x", &call("no.txt", "text/plain", b"x")); + // The module returns the status as its own, so the run fails with the reason as its message. + let err = Instance::new(&wasm, &Limits::default()).unwrap().call("{}", &mut Saves::default()).unwrap_err(); + assert_eq!(err, PluginError::Failed("nope".into())); +} + +#[test] +fn a_host_without_saving_refuses_by_default() { + let wasm = module("a.txt", "text/plain", b"x", &call("a.txt", "text/plain", b"x")); + let err = Instance::new(&wasm, &Limits::default()).unwrap().call("{}", &mut Plain).unwrap_err(); + assert_eq!(err, PluginError::Failed("saving files isn't available here".into())); +} + +#[test] +fn too_much_data_is_a_limit_error_and_bad_utf8_a_trap() { + let limits = Limits { max_message: 4, ..Limits::default() }; + let wasm = module("a.txt", "text/plain", b"12345", &call("a.txt", "text/plain", b"12345")); + let mut host = Saves::default(); + let err = Instance::new(&wasm, &limits).unwrap().call("{}", &mut host).unwrap_err(); + assert!(matches!(err, PluginError::Limit(_)), "{err:?}"); + assert!(host.0.is_empty()); + + // The name points at a lone 0xff byte: not UTF-8. + let wasm = module( + "a", + "text/plain", + &[0xff], + "(call $save_file (i32.const 200) (i32.const 1) (i32.const 100) (i32.const 1) (i32.const 200) (i32.const 1))", + ); + let err = Instance::new(&wasm, &Limits::default()).unwrap().call("{}", &mut host).unwrap_err(); + assert!(matches!(err, PluginError::Trap(_)), "{err:?}"); + assert!(host.0.is_empty()); +} + +#[test] +fn a_wrong_signature_is_rejected() { + let wat = r#"(module (import "figcraft" "save_file" (func (param i32 i32) (result i32))) + (memory (export "memory") 1) (func (export "figcraft_run") (param i32) (result i32) (i32.const 0)))"#; + let wasm = wat::parse_str(wat).unwrap(); + assert!(matches!(crate::check_module(&wasm, &Limits::default()), Err(PluginError::InvalidModule(m)) if m.contains("wrong signature"))); +} + +#[test] +fn the_permission_needs_api_four_and_survives_a_round_trip() { + let err = Manifest::parse(&manifest(3, true)).unwrap_err(); + assert!(err.contains("saveFile needs plugin API 4"), "{err}"); + let m = Manifest::parse(&manifest(4, true)).unwrap(); + assert!(m.permissions.save_file); + let again = Manifest::parse(&serde_json::to_string(&m).unwrap()).unwrap(); + assert_eq!(m, again); + assert!(serde_json::to_string(&m).unwrap().contains("\"saveFile\":true")); + // Older manifests stay valid and don't grow the key. + let old = Manifest::parse(&manifest(3, false)).unwrap(); + assert!(!old.permissions.save_file); + assert!(!serde_json::to_string(&old).unwrap().contains("saveFile")); +} diff --git a/crates/plugin/src/tests.rs b/crates/plugin/src/tests.rs index 5d094ab4c..27d7ac23e 100644 --- a/crates/plugin/src/tests.rs +++ b/crates/plugin/src/tests.rs @@ -441,7 +441,7 @@ fn bad_manifests_are_refused() { json!({"main": "C:\\plugin.wasm"}), json!({"main": "plugin.js"}), json!({"main": "a//b.wasm"}), - json!({"api": 4}), + json!({"api": 5}), json!({"api": 0}), json!({"permissions": {"access": "root"}}), json!({"permissions": {"commands": ["*.x"]}}), diff --git a/crates/plugin/src/widget_tests.rs b/crates/plugin/src/widget_tests.rs index 0d4ec2dfa..354188665 100644 --- a/crates/plugin/src/widget_tests.rs +++ b/crates/plugin/src/widget_tests.rs @@ -110,7 +110,7 @@ fn widgets_need_api_3() { assert!(m(2).unwrap_err().contains("API 3")); let ok = m(3).unwrap(); assert!(ok.widget && ok.commands.is_empty(), "a widget-only plugin has no menu command"); - assert!(Manifest::from_value(&json!({"id": "w", "name": "W", "main": "w.wasm", "api": 4})).is_err()); + assert!(Manifest::from_value(&json!({"id": "w", "name": "W", "main": "w.wasm", "api": 5})).is_err()); let v2 = Manifest::from_value(&json!({"id": "p", "name": "P", "main": "p.wasm", "api": 2})).unwrap(); assert!(!v2.widget && v2.commands.len() == 1, "v2 manifests are unchanged"); } diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index cd1e34827..6d8c9128c 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -305,6 +305,7 @@ status = "draft — needs native review" "Couldn't download the variables" = "Die Variablen konnten nicht heruntergeladen werden" "Couldn't reach {server}: showing what this computer remembers." = "{server} war nicht erreichbar: Es wird angezeigt, was dieser Computer gespeichert hat." "Couldn't save automatically: {error}" = "Automatisches Speichern fehlgeschlagen: {error}" +"Couldn't save the file" = "Die Datei konnte nicht gespeichert werden" "Count" = "Anzahl" "Create" = "Erstellen" "Create a variable collection first" = "Erstellen Sie zuerst eine Variablensammlung" @@ -1082,6 +1083,7 @@ status = "draft — needs native review" "Save" = "Speichern" "Save as" = "Speichern unter" "Save as preset…" = "Als Vorgabe speichern…" +"Save file" = "Datei speichern" "Save files automatically" = "Dateien automatisch speichern" "Save version {key}" = "Version speichern {key}" "Saved" = "Gespeichert" @@ -1435,6 +1437,7 @@ status = "draft — needs native review" "call any command its access allows" = "jeden Befehl aufrufen, den sein Zugriff erlaubt" "call only: {commands}" = "nur aufrufen: {commands}" "can edit the document" = "kann das Dokument bearbeiten" +"can save files" = "kann Dateien speichern" "crop marks" = "Schnittmarken" "development: {path}" = "Entwicklung: {path}" "e.g. count + 1" = "z. B. count + 1" @@ -1452,6 +1455,7 @@ status = "draft — needs native review" "read and edit the document" = "das Dokument lesen und bearbeiten" "read the document" = "das Dokument lesen" "reads the document" = "liest das Dokument" +"save files you choose" = "Dateien an einem von Ihnen gewählten Ort speichern" "the plugin" = "das Plugin" "this session only" = "nur diese Sitzung" "{instances} in {files}" = "{instances} in {files}" diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 3c127fc65..91bf2ae13 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -314,6 +314,7 @@ name = "English" "Couldn't download the variables" = "Couldn't download the variables" "Couldn't reach {server}: showing what this computer remembers." = "Couldn't reach {server}: showing what this computer remembers." "Couldn't save automatically: {error}" = "Couldn't save automatically: {error}" +"Couldn't save the file" = "Couldn't save the file" "Count" = "Count" "Create" = "Create" "Create a variable collection first" = "Create a variable collection first" @@ -1124,6 +1125,7 @@ name = "English" "Rulers" = "Rulers" "Run" = "Run" "Run {label}" = "Run {label}" +"Save file" = "Save file" "Save files automatically" = "Save files automatically" "Search templates" = "Search templates" "See all templates" = "See all templates" @@ -1506,6 +1508,7 @@ name = "English" "call any command its access allows" = "call any command its access allows" "call only: {commands}" = "call only: {commands}" "can edit the document" = "can edit the document" +"can save files" = "can save files" "crop marks" = "crop marks" "development: {path}" = "development: {path}" "e.g. count + 1" = "e.g. count + 1" @@ -1524,6 +1527,7 @@ name = "English" "read and edit the document" = "read and edit the document" "read the document" = "read the document" "reads the document" = "reads the document" +"save files you choose" = "save files you choose" "the plugin" = "the plugin" "this session only" = "this session only" "yesterday" = "yesterday" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 901283f11..f551146cb 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -315,6 +315,7 @@ status = "draft — needs native review" "Corner smoothing" = "Suavizado de esquinas" "Couldn't reach {server}: showing what this computer remembers." = "No se pudo contactar con {server}: se muestra lo que este ordenador recuerda." "Couldn't save automatically: {error}" = "No se pudo guardar automáticamente: {error}" +"Couldn't save the file" = "No se pudo guardar el archivo" "Count" = "Número" "Create" = "Crear" "Create a variable collection first" = "Crea primero una colección de variables" @@ -1125,6 +1126,7 @@ status = "draft — needs native review" "Rulers" = "Reglas" "Run" = "Ejecutar" "Run {label}" = "Ejecutar {label}" +"Save file" = "Guardar archivo" "Save files automatically" = "Guardar archivos automáticamente" "Search templates" = "Buscar plantillas" "See all templates" = "Ver todas las plantillas" @@ -1507,6 +1509,7 @@ status = "draft — needs native review" "call any command its access allows" = "llamar a cualquier comando que su acceso permita" "call only: {commands}" = "llamar solo a: {commands}" "can edit the document" = "puede editar el documento" +"can save files" = "puede guardar archivos" "crop marks" = "marcas de corte" "development: {path}" = "desarrollo: {path}" "e.g. count + 1" = "p. ej. count + 1" @@ -1525,6 +1528,7 @@ status = "draft — needs native review" "read and edit the document" = "leer y editar el documento" "read the document" = "leer el documento" "reads the document" = "lee el documento" +"save files you choose" = "guardar archivos donde tú elijas" "the plugin" = "el plugin" "this session only" = "solo esta sesión" "yesterday" = "ayer" diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 20a8a77c1..3ee02891f 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -148,6 +148,8 @@ mod perf_tests; #[cfg(test)] mod plugin_panel_tests; #[cfg(test)] +mod plugin_save_ui_tests; +#[cfg(test)] mod plugins_browse_tests; #[cfg(test)] mod popup_width_tests; @@ -891,6 +893,7 @@ impl FigApp { } "dialog.unsaved" => self.toast(i18n::tr("This file has unsaved changes")), "dialog.plugins" => self.ui.plugins_window = true, + "dialog.pluginSave" => plugins_ui::save_file(self, &r.data), "dialog.cursorChat" => live::open_chat(self), "window.new" | "window.focus" | "window.fullscreen" => self.window_requests.push(r), _ => {} diff --git a/crates/ui-egui/src/plugin_save_ui_tests.rs b/crates/ui-egui/src/plugin_save_ui_tests.rs new file mode 100644 index 000000000..6302e2d2c --- /dev/null +++ b/crates/ui-egui/src/plugin_save_ui_tests.rs @@ -0,0 +1,71 @@ +//! A plugin's `dialog.pluginSave` request: the browser downloads the file, a platform with save +//! dialogs asks the user (and writes nothing when they cancel). + +use std::sync::{Arc, Mutex}; + +use base64::Engine as _; +use figcraft_engine::Session; +use serde_json::json; + +use crate::{FigApp, NoServices, Services}; + +type Downloads = Arc)>>>; + +/// Services that save by downloads and keep them (`deliver` false: the browser refused). +struct Browser { + got: Downloads, + deliver: bool, +} + +impl Services for Browser { + fn downloads(&self) -> bool { + true + } + fn download(&mut self, name: &str, bytes: &[u8]) -> bool { + self.got.lock().unwrap().push((name.to_string(), bytes.to_vec())); + self.deliver + } +} + +fn request(app: &mut FigApp, name: &str, data: &str) { + app.session.request_ui("dialog.pluginSave", json!({"plugin": "org.test.save", "name": name, "mime": "text/plain", "data": data})); + app.handle_ui_requests(); +} + +fn toast(app: &FigApp) -> String { + app.ui.toast.as_ref().map(|t| t.0.clone()).unwrap_or_default() +} + +fn b64(bytes: &[u8]) -> String { + base64::engine::general_purpose::STANDARD.encode(bytes) +} + +#[test] +fn the_browser_downloads_the_file_with_its_exact_bytes() { + let got = Downloads::default(); + let mut app = FigApp::new(Session::new(), Box::new(Browser { got: got.clone(), deliver: true })); + request(&mut app, "out.jsx", &b64(b"\x00hello\xff")); + let got = got.lock().unwrap(); + assert_eq!(got.as_slice(), [("out.jsx".to_string(), b"\x00hello\xff".to_vec())]); + assert!(toast(&app).contains("out.jsx"), "{}", toast(&app)); +} + +#[test] +fn a_refused_download_and_broken_data_say_so() { + let got = Downloads::default(); + let mut app = FigApp::new(Session::new(), Box::new(Browser { got: got.clone(), deliver: false })); + request(&mut app, "out.jsx", &b64(b"x")); + assert_eq!(toast(&app), "Couldn't save the file"); + app.ui.toast = None; + request(&mut app, "out.jsx", "***not base64***"); + assert_eq!(toast(&app), "Couldn't save the file"); + assert_eq!(got.lock().unwrap().len(), 1, "broken data is never handed over"); +} + +#[test] +fn a_cancelled_save_dialog_writes_nothing() { + // `NoServices` has no downloads and answers the save dialog with "cancelled". + let mut app = FigApp::new(Session::new(), Box::new(NoServices)); + request(&mut app, "out.jsx", &b64(b"x")); + assert!(app.ui.toast.is_none()); +} diff --git a/crates/ui-egui/src/plugins_ui.rs b/crates/ui-egui/src/plugins_ui.rs index 481b446c3..ed00604dd 100644 --- a/crates/ui-egui/src/plugins_ui.rs +++ b/crates/ui-egui/src/plugins_ui.rs @@ -110,6 +110,36 @@ pub fn start(app: &mut FigApp, id: &str, command: &str) { } } +/// A plugin offered a file to save (`dialog.pluginSave`: `name`, `data` as base64): the user picks +/// where it goes in FigCraft's own save dialog, or the browser downloads it. The plugin never learns +/// the path. +pub(crate) fn save_file(app: &mut FigApp, data: &Value) { + use base64::Engine as _; + let name = data["name"].as_str().unwrap_or_default().to_string(); + let Ok(bytes) = base64::engine::general_purpose::STANDARD.decode(data["data"].as_str().unwrap_or_default()) else { + app.toast(tr("Couldn't save the file")); + return; + }; + if app.services.downloads() { + if app.services.download(&name, &bytes) { + app.toast(trf("Saved {name}", &[("name", &name)])); + } else { + app.toast(tr("Couldn't save the file")); + } + return; + } + let ext = std::path::Path::new(&name).extension().and_then(|e| e.to_str()).unwrap_or_default().to_string(); + let exts: Vec<&str> = if ext.is_empty() { Vec::new() } else { vec![ext.as_str()] }; + let shown = name.clone(); + app.pick_save(tr("Save file"), &name, &exts, move |app, path| { + let file = path.file_name().map(|f| f.to_string_lossy().to_string()).unwrap_or(shown); + match std::fs::write(&path, &bytes) { + Ok(()) => app.toast(trf("Saved {name}", &[("name", &file)])), + Err(_) => app.toast(tr("Couldn't save the file")), + } + }); +} + /// Run `plugin.run` or `plugin.event`; a text output is shown as a toast unless the plugin showed /// a message. fn run(app: &mut FigApp, cmd: &str, params: Value) { @@ -447,6 +477,9 @@ fn confirm_window(app: &mut FigApp, ctx: &Context, t: &Tokens) { if e.widget { asks.push(tr("put a widget on the canvas").to_string()); } + if e.save_file { + asks.push(tr("save files you choose").to_string()); + } for a in asks { ui.add(egui::Label::new(RichText::new(format!("• {a}")).font(regular(11.0)).color(t.text)).wrap()); } @@ -501,6 +534,9 @@ fn summary(p: &InstalledPlugin) -> String { parts.push(m.version.clone()); } parts.push(access.to_string()); + if m.permissions.save_file { + parts.push(tr("can save files").to_string()); + } parts.push(match (&p.source, &p.path) { (Some(server), _) => trf("from {server}", &[("server", server)]), (None, Some(path)) => trf("development: {path}", &[("path", path)]), diff --git a/docs/plugins.md b/docs/plugins.md index 6f23e6ecb..f51829309 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -135,7 +135,7 @@ plugins: import them in the script. | `widget.insert` | `{plugin, x?, y?, fuel?}` | Puts widget plugin `plugin`'s widget on the current page, its top-left at `x`, `y` (default: centred in the view), and selects it; the plugin draws it. One undo step. Returns `{id, plugin, state, targets, output, logs, calls, fuel}`: `targets` are the names of its clickable parts. | | `widget.click` | `{id, target, fuel?}` | Clicks part `target` of widget `id` (or of the widget a layer `id` is in), as a click on the canvas would: the plugin is called back and redraws it. One undo step; returns like `widget.insert`. | | `widget.list` | `{}` | `{widgets: [{id, plugin, name, page, state, targets}]}`: every widget in the file. | -| `plugin.directory.list` | `{server?, query?}` | The plugin directory at `server` (`ws://host:port/`; default: the one browsed last): `{server, plugins: [{id, name, version, description, author, api, access, commands, widget, bytes, sha256, published, versions, installed, update}]}`, the latest version of each plugin whose id, name, description or author contains `query`. `installed` is the installed version (or null), `update` whether the listed one is newer. | +| `plugin.directory.list` | `{server?, query?}` | The plugin directory at `server` (`ws://host:port/`; default: the one browsed last): `{server, plugins: [{id, name, version, description, author, api, access, commands, widget, save_file, bytes, sha256, published, versions, installed, update}]}`, the latest version of each plugin whose id, name, description or author contains `query`. `installed` is the installed version (or null), `update` whether the listed one is newer. | | `plugin.directory.install` | `{id, version?, confirm, server?, sha256?}` | Downloads version `version` (default: the latest) and installs it, or updates the installed one. `confirm` must be `true` (installing runs the plugin's code: show its permissions first); without it nothing is downloaded. The download must match the SHA-256 the directory lists (and `sha256`, the one shown, when given). Returns `{installed, name, version, permissions, sha256, path, source, replaced}`. | | `plugin.directory.publish` | `{path \| plugin, server}` | Publishes a plugin folder (or its `figcraft-plugin.json`), or an installed plugin, as a new version. `server` carries the server's key: `ws://host:port/?key=…`. Returns `{published, server}`. | | `plugin.directory.unpublish` | `{id, version?, server}` | Removes one version (default: every version) from the directory; needs the key. Returns `{id, removed}`. | @@ -224,7 +224,8 @@ plugin directory requests (`plugin.directory.*` says so). Import plugins with `p | `version`, `description` | Optional text. A plugin published to a [directory](#plugin-directories) needs a `version` of one to four numbers (`1.2.0`), each version newer than the last. | | `author` | Optional: who made it, as you type it (64 characters at most); plugin directories show it. | | `main` | Required. The module, a `.wasm` path relative to the manifest, inside its folder. | -| `api` | The plugin API version the plugin was written for: `1` (the default), `2` (panels and settings) or `3` (widgets). A manifest asking for a newer one than FigCraft runs is refused, so a plugin that needs panels or widgets fails clearly on an older FigCraft. | +| `api` | The plugin API version the plugin was written for: `1` (the default), `2` (panels and settings), `3` (widgets) or `4` (saving files). A manifest asking for a newer one than FigCraft runs is refused, so a plugin that needs panels, widgets or `saveFile` fails clearly on an older FigCraft. | +| `permissions.saveFile` | API 4: `true` lets the plugin offer a file to save (an exporter's output). FigCraft asks the user where it goes with its own Save dialog (a download in the browser); the plugin never gets a path. The install confirmation lists it. | | `widget` | API 3: `true` when the plugin draws a widget (it's listed in Plugins ▸ Widgets). | | `permissions.access` | `read` (the default): commands that leave the document as it is; such plugins also run from Dev Mode's Inspect tab. `write`: edits too. | | `permissions.commands` | Optional allowlist: exact command ids or prefixes ending in `*` (`node.*`). Empty: any command the access allows. | @@ -236,6 +237,9 @@ plugin directory requests (`plugin.directory.*` says so). Import plugins with `p Whatever its manifest says, FigCraft refuses these calls (the plugin gets the refusal as an error it can handle): +- read or write files: a plugin never gets a path or the disk. With `permissions.saveFile` it can + only hand FigCraft a file (one per run, 16 MB at most, a plain file name) for the user to save + through FigCraft's own dialog; the user can cancel it; - files and the app: `file.*`, `app.*`, `pref.*`, `help.*`, `library.add`, `libraries.*`, `image.place` with a `path` (pass the image as base64 `data` instead), `view.theme*`; - other documents and the version history: `doc.*` and `version.*` (except `doc.list` and @@ -262,9 +266,10 @@ allocation or copy. This also applies when the configured per-call overhead is z read is charged for the bytes actually returned, not the requested buffer size. `calls` counts every ABI import, including calls which only query the reply length. -## ABI (version 3) +## ABI (version 4) -Version 2 adds panels and settings to version 1, and version 3 adds widgets; a version 1 or 2 +Version 2 adds panels and settings to version 1, version 3 adds widgets and version 4 adds +`save_file`; a version 1, 2 or 3 module runs unchanged and gets the input it always got. Strings are UTF-8 `(ptr, len)` pairs in the plugin's linear memory; all values are `i32`. @@ -311,6 +316,7 @@ included, is refused when the plugin is imported): | `setting_get` | `(key_ptr, key_len) -> status` | API 2. `0`: the reply holds the setting's JSON. `1`: there is none. | | `setting_set` | `(key_ptr, key_len, value_ptr, value_len) -> status` | API 2. Stores JSON under the key, for this plugin only, kept with the preferences. `1`: refused (not JSON, a bad key, over 64 KB), the reply says why. | | `setting_delete` | `(key_ptr, key_len)` | API 2. Forgets a setting. | +| `save_file` | `(name_ptr, name_len, mime_ptr, mime_len, data_ptr, data_len) -> status` | API 4, needs `permissions.saveFile`. Offers a file to save; FigCraft asks the user where it goes once the run succeeds. `1`: refused (no permission, a bad file name, over 16 MB, a second file in one run), the reply says why. | | `widget_render` | `(ptr, len) -> status` | API 3. Draws the widget being inserted or clicked (the widget description below, as JSON). `1`: the description is invalid, the reply says why. A widget call that doesn't draw keeps the widget as it was (inserting one must draw it). | A pointer or length outside the plugin's memory traps, which fails the run. Host functions can only @@ -369,7 +375,7 @@ image sizes) and refuses it if anything is off. `plugins/` in the repository is a workspace of its own: `plugins/sdk` (the crate `figcraft-plugin-sdk`, `no_std` with `alloc`) wraps the ABI with serde_json, and -`plugins/examples` has three plugins: +`plugins/examples` has four plugins: - **Tidy names** (`tidy-names`): cleans up the selected layers' names (extra spaces, the "copy" left by duplicating) and optionally their letter case, inside the selection too. Two commands: one @@ -382,6 +388,9 @@ image sizes) and refuses it if anything is off. hex colours in the parameters form. - **Counter** (`counter`, API 3): a widget, a count between − and + buttons; each click changes the count kept in the widget's state. It only reads the document. +- **Export names** (`export-names`, API 4): saves the names of the selected layers (optionally the + layers inside them too) as `layer-names.txt`. It reads the document and offers the file with + `save_file`; FigCraft asks where it goes. `cargo xtask plugins` (part of `cargo xtask wasm` and `cargo xtask ci`; it needs the `wasm32-unknown-unknown` target: `rustup target add wasm32-unknown-unknown`) checks, tests and @@ -438,7 +447,9 @@ panel calls back: `control`, `value` and every field's `values`); returning `Err rolls it back. With `"api": 2` in the manifest: `show_ui(&json!({...}))` and `close_ui()` for the panel, `setting(key)`, `set_setting(key, &value)` and `delete_setting(key)` for settings. With `"api": 3` and `"widget": true`: `input.widget` (`id`, `state`, `target`) when the widget is -inserted or clicked, and `render_widget(&json!({"state": ..., "root": ...}))` to draw it. Outside +inserted or clicked, and `render_widget(&json!({"state": ..., "root": ...}))` to draw it. With +`"api": 4` and `"permissions": {"saveFile": true}`: `save_file(name, mime, &bytes)` offers a file; +FigCraft asks the user where it goes and the plugin never learns a path. Outside WebAssembly every host call fails, so the plugin's own logic can be unit-tested with `cargo test`. Any language that compiles to WebAssembly works the same way: export `memory` and `figcraft_run`, diff --git a/plugins/Cargo.lock b/plugins/Cargo.lock index 7738ceb5e..87244377e 100644 --- a/plugins/Cargo.lock +++ b/plugins/Cargo.lock @@ -9,6 +9,13 @@ dependencies = [ "figcraft-plugin-sdk", ] +[[package]] +name = "export-names" +version = "0.1.0" +dependencies = [ + "figcraft-plugin-sdk", +] + [[package]] name = "figcraft-plugin-sdk" version = "0.1.0" diff --git a/plugins/examples/export-names/Cargo.toml b/plugins/examples/export-names/Cargo.toml new file mode 100644 index 000000000..35b7eb810 --- /dev/null +++ b/plugins/examples/export-names/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "export-names" +version.workspace = true +edition.workspace = true +license.workspace = true +publish = false + +[lib] +crate-type = ["cdylib"] + +[lints] +workspace = true + +[dependencies] +figcraft-plugin-sdk = { workspace = true } diff --git a/plugins/examples/export-names/figcraft-plugin.json b/plugins/examples/export-names/figcraft-plugin.json new file mode 100644 index 000000000..ab8f943f6 --- /dev/null +++ b/plugins/examples/export-names/figcraft-plugin.json @@ -0,0 +1,22 @@ +{ + "id": "org.figcraft.examples.export-names", + "name": "Export names", + "version": "1.0.0", + "description": "Saves the names of the selected layers as a text file, one per line.", + "main": "export_names.wasm", + "api": 4, + "permissions": { + "access": "read", + "commands": ["node.get"], + "saveFile": true + }, + "commands": [ + { + "id": "export", + "label": "Export names…", + "params": [ + { "name": "children", "label": "Include layers inside", "type": "boolean", "default": true } + ] + } + ] +} diff --git a/plugins/examples/export-names/src/lib.rs b/plugins/examples/export-names/src/lib.rs new file mode 100644 index 000000000..4525a39cf --- /dev/null +++ b/plugins/examples/export-names/src/lib.rs @@ -0,0 +1,55 @@ +//! Export names: saves the names of the selected layers (optionally the layers inside them too) as +//! the text file `layer-names.txt`, through the host's own Save dialog (`save_file`). + +use figcraft_plugin_sdk::{Input, Result, Value, call, entry, json, notify, save_file}; + +/// Layers looked at in one run, at most. +const MAX_LAYERS: usize = 10_000; + +/// The names as the file's text: one per line, a line break at the end, line breaks inside a name +/// turned into spaces. +fn names_text(names: &[String]) -> String { + let mut text = String::new(); + for name in names { + text.extend(name.chars().map(|c| if c == '\n' || c == '\r' { ' ' } else { c })); + text.push('\n'); + } + text +} + +fn run(input: Input) -> Result { + if input.selection.is_empty() { + return Err("Select the layers to export first".into()); + } + let inside = input.bool("children").unwrap_or(true); + // Depth first, in layer order: the stack takes the children reversed. + let mut stack: Vec = input.selection.iter().rev().copied().collect(); + let mut names = Vec::new(); + while let Some(id) = stack.pop() { + if names.len() >= MAX_LAYERS { + break; + } + let node = call("node.get", &json!({"id": id}))?; + names.push(node["name"].as_str().unwrap_or_default().to_string()); + if inside && let Some(children) = node["children"].as_array() { + stack.extend(children.iter().rev().filter_map(|c| c["id"].as_u64())); + } + } + save_file("layer-names.txt", "text/plain", names_text(&names).as_bytes())?; + notify(&format!("Exporting {} names", names.len())); + Ok(json!({"names": names.len()})) +} + +entry!(run); + +#[cfg(test)] +mod tests { + use super::names_text; + + #[test] + fn names_become_lines() { + let names = ["Card".to_string(), "Title\nline".to_string(), String::new()]; + assert_eq!(names_text(&names), "Card\nTitle line\n\n"); + assert_eq!(names_text(&[]), ""); + } +} diff --git a/plugins/sdk/src/lib.rs b/plugins/sdk/src/lib.rs index 967af7888..65f70f8d1 100644 --- a/plugins/sdk/src/lib.rs +++ b/plugins/sdk/src/lib.rs @@ -187,6 +187,14 @@ pub fn delete_setting(key: &str) { host::setting_delete(key.as_bytes()); } +/// Offer a file to save: a suggested file `name`, its MIME type and the bytes. FigCraft asks the +/// user where it goes (a download in the browser) once the run succeeds; the plugin never learns +/// a path. Needs `"api": 4` and `permissions.saveFile` in the manifest. A refusal (no permission, +/// a bad name, too much data, a second file in one run) is an error. +pub fn save_file(name: &str, mime: &str, data: &[u8]) -> Result<()> { + if host::save_file(name.as_bytes(), mime.as_bytes(), data) == 0 { Ok(()) } else { Err(String::from_utf8_lossy(&host::reply()).into_owned()) } +} + /// The body of `figcraft_run` (use [`entry!`]): read the input, run `f`, hand back its output. pub fn run_plugin(input_len: i32, f: fn(Input) -> Result) -> i32 { let input = host::reply(); @@ -238,6 +246,7 @@ mod host { pub fn setting_set(key: *const u8, key_len: usize, value: *const u8, value_len: usize) -> i32; pub fn setting_delete(key: *const u8, key_len: usize); pub fn widget_render(ptr: *const u8, len: usize) -> i32; + pub fn save_file(name: *const u8, name_len: usize, mime: *const u8, mime_len: usize, data: *const u8, data_len: usize) -> i32; } } @@ -283,6 +292,9 @@ mod host { pub fn widget_render(s: &[u8]) -> i32 { unsafe { sys::widget_render(s.as_ptr(), s.len()) } } + pub fn save_file(name: &[u8], mime: &[u8], data: &[u8]) -> i32 { + unsafe { sys::save_file(name.as_ptr(), name.len(), mime.as_ptr(), mime.len(), data.as_ptr(), data.len()) } + } } /// Outside WebAssembly (a plugin's own unit tests) every host call fails. @@ -316,6 +328,9 @@ mod host { pub fn widget_render(_s: &[u8]) -> i32 { 1 } + pub fn save_file(_name: &[u8], _mime: &[u8], _data: &[u8]) -> i32 { + 1 + } } #[cfg(test)] @@ -339,6 +354,7 @@ mod tests { assert_eq!((e.control.as_str(), &e.value, &e.values), ("go", &Value::Null, &json!({"n": 2}))); assert!(show_ui(&json!({})).is_err() && setting("k").is_none() && set_setting("k", &json!(1)).is_err()); assert!(render_widget(&json!({})).is_err() && i.widget.is_none()); + assert!(save_file("a.txt", "text/plain", b"x").is_err()); let w = Input::parse(r#"{"command":"widget","widget":{"id":9,"state":{"n":1},"event":{"target":"inc"}}}"#) .unwrap_or_default() .widget diff --git a/xtask/src/main.rs b/xtask/src/main.rs index e3f00e8bc..bd863dbeb 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -81,7 +81,7 @@ fn wasm() -> bool { /// The example plugins in `plugins/examples` (each folder's name is its package; its module is /// `.wasm`). -const EXAMPLE_PLUGINS: &[&str] = &["tidy-names", "swatch-grid", "counter"]; +const EXAMPLE_PLUGINS: &[&str] = &["tidy-names", "swatch-grid", "counter", "export-names"]; /// The plugin workspace: fmt, clippy and build for wasm32, host tests, then each example's manifest /// and module side by side in `/plugins/dist//`. From 8c90ef962adb902a72c8127c9b0f63bd2df315bd Mon Sep 17 00:00:00 2001 From: Yarila Date: Fri, 16 Oct 2026 23:36:23 +0500 Subject: [PATCH 089/817] M7: open inputs for parameterized menu actions --- ROADMAP.md | 3 +- crates/ui-egui/locales/en.toml | 3 +- crates/ui-egui/locales/es.toml | 1 + crates/ui-egui/locales/ru.toml | 1 + crates/ui-egui/src/dialogs.rs | 92 ++++++++++++++++++++++++-- crates/ui-egui/src/lib.rs | 5 ++ crates/ui-egui/src/menu_input_tests.rs | 74 +++++++++++++++++++++ crates/ui-egui/src/menus.rs | 29 ++++++++ docs/gaps.md | 6 +- 9 files changed, 205 insertions(+), 9 deletions(-) create mode 100644 crates/ui-egui/src/menu_input_tests.rs diff --git a/ROADMAP.md b/ROADMAP.md index c3c12085e..c79f0ea75 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (menu and Actions parameter dialogs; bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -313,6 +313,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-16 | minor | Affected menu and Actions commands that need values now open the relevant input or panel instead of showing a parameter error; Preferences offers language in a dropdown. Headline numbers unchanged. | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | | 2026-10-15 | minor | Drop files anywhere to open them (M7): dragging files over the window shows a "Drop to open" (home) or "Drop to import" (canvas) overlay. On the home screen each supported file opens as a document of its own and other files are turned away with a toast; on the canvas the files import at the drop point. Both wait behind a small card that is on screen before a large file blocks the window. A canvas import stays with the document and page that received the drop even if the tab or page changes meanwhile, and is cancelled with a message if that document or page is gone. Numbers unchanged. | | 2026-10-15 | minor | M7: system font discovery skips entries observed as non-regular files before opening them, avoiding the reproduced named-pipe stall. Regular-file symlinks remain supported; directory depth, font limits and priorities are unchanged. Numbers unchanged. | diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 3c127fc65..5d978897d 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -829,6 +829,7 @@ name = "English" "No model credits were built into this copy." = "No model credits were built into this copy." "No number variables fit here." = "No number variables fit here." "No number variables yet. Create them in Local variables." = "No number variables yet. Create them in Local variables." +"No other pages" = "No other pages" "No paints" = "No paints" "No plugins on {server}." = "No plugins on {server}." "No plugins yet. Import a development plugin from its figcraft-plugin.json." = "No plugins yet. Import a development plugin from its figcraft-plugin.json." @@ -1603,4 +1604,4 @@ name = "English" "⌘ arrows" = "⌘ arrows" "⌘ click" = "⌘ click" "⌘ scroll" = "⌘ scroll" -"⌥ drag" = "⌥ drag" \ No newline at end of file +"⌥ drag" = "⌥ drag" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 901283f11..c0329964d 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -830,6 +830,7 @@ status = "draft — needs native review" "No model credits were built into this copy." = "Esta copia no incluye créditos de modelos." "No number variables fit here." = "Ninguna variable numérica encaja aquí." "No number variables yet. Create them in Local variables." = "Aún no hay variables numéricas. Créalas en Variables locales." +"No other pages" = "No hay otras páginas" "No paints" = "Sin pinturas" "No plugins on {server}." = "No hay plugins en {server}." "No plugins yet. Import a development plugin from its figcraft-plugin.json." = "Aún no hay plugins. Importa un plugin de desarrollo desde su figcraft-plugin.json." diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 3ab407572..4228f8bcd 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -819,6 +819,7 @@ name = "Русский" "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." diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 6e0ee3a63..31eb1adb3 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -71,6 +71,15 @@ pub enum AboutTab { Models, } +/// Values collected by a menu or Actions command before dispatching it to the engine. +#[derive(Clone, Debug, PartialEq)] +pub enum MenuInput { + RenameFile(String), + Link(String), + Offset(f64), + MoveToPage, +} + impl AboutTab { pub const ALL: [AboutTab; 3] = [AboutTab::About, AboutTab::Contributors, AboutTab::Models]; @@ -137,6 +146,7 @@ fn about_body(ui: &mut egui::Ui, t: &Tokens) { pub fn keys(app: &mut FigApp, ctx: &Context) { let u = &mut app.ui; let open = u.color_profile.is_some() + || u.menu_input.is_some() || u.find.is_some() || u.batch_rename.is_some() || u.confirm_close @@ -147,7 +157,7 @@ pub fn keys(app: &mut FigApp, ctx: &Context) { if !open || !ctx.input_mut(|i| i.consume_key(egui::Modifiers::NONE, egui::Key::Escape)) { return; } - if u.color_profile.take().is_some() || u.find.take().is_some() || u.batch_rename.take().is_some() { + if u.menu_input.take().is_some() || u.color_profile.take().is_some() || u.find.take().is_some() || u.batch_rename.take().is_some() { return; } for flag in [&mut u.confirm_close, &mut u.export_preview, &mut u.shortcuts_panel, &mut u.preferences, &mut u.about] { @@ -265,12 +275,17 @@ pub fn show(app: &mut FigApp, ctx: &Context) { ui.label(tr("Language")); // Each language by its own name; System follows the OS (the browser on the web). let langs = i18n::languages().iter().filter(|l| crate::cjk::can_show(l.code)).map(|l| (l.code, l.name)); - for (code, name) in [("system", tr("System"))].into_iter().chain(langs) { - if ui.selectable_label(app.session.prefs.language.eq_ignore_ascii_case(code), name).clicked() { - app.run("pref.language", json!({"language": code})); - ui.ctx().request_repaint(); + let choices: Vec<_> = [("system", tr("System"))].into_iter().chain(langs).collect(); + let selected = + choices.iter().find(|(code, _)| app.session.prefs.language.eq_ignore_ascii_case(code)).map_or(tr("System"), |(_, name)| *name); + egui::ComboBox::from_id_salt("pref_language").selected_text(selected).width(220.0).show_ui(ui, |ui| { + for (code, name) in choices { + if ui.selectable_label(app.session.prefs.language.eq_ignore_ascii_case(code), name).clicked() { + app.run("pref.language", json!({"language": code})); + ui.ctx().request_repaint(); + } } - } + }); }); if let Some(lang) = i18n::current().filter(|l| l.draft) { let note = trf("{language}: draft translation, waiting for a native speaker's review.", &[("language", &lang.name)]); @@ -321,6 +336,7 @@ pub fn show(app: &mut FigApp, ctx: &Context) { app.ui.find = if open { Some((find, replace)) } else { None }; } batch_rename_dialog(app, ctx); + menu_input_dialog(app, ctx); crate::variables_panel::show(app, ctx); crate::dev_compare::show(app, ctx); crate::branch_ui::show(app, ctx); @@ -335,6 +351,70 @@ pub fn show(app: &mut FigApp, ctx: &Context) { crate::windows::confirm_close(app, ctx); } +/// Menus and Actions cannot pass a value themselves. Gather it here, then run the regular +/// command so the same validation and undo behaviour apply as for programmatic callers. +fn menu_input_dialog(app: &mut FigApp, ctx: &Context) { + let Some(mut input) = app.ui.menu_input.take() else { return }; + let title = match &input { + MenuInput::RenameFile(_) => i18n::command("file.rename", "Rename file"), + MenuInput::Link(_) => i18n::command("text.link", "Create link"), + MenuInput::Offset(_) => i18n::command("vector.offset", "Offset path"), + MenuInput::MoveToPage => i18n::command("object.moveToPage", "Move to page"), + }; + let mut open = true; + let mut action: Option<(&str, serde_json::Value)> = None; + window(&title, ctx).open(&mut open).show(ctx, |ui| { + ui.set_width(320.0); + match &mut input { + MenuInput::RenameFile(name) => { + let field = ui.add(egui::TextEdit::singleline(name).desired_width(300.0)); + if (ui.button(tr("Rename")).clicked() || field.lost_focus() && ui.input(|i| i.key_pressed(egui::Key::Enter))) + && !name.trim().is_empty() + { + action = Some(("file.rename", json!({"name": name.trim()}))); + } + } + MenuInput::Link(url) => { + let field = ui.add(egui::TextEdit::singleline(url).hint_text("https://").desired_width(300.0)); + if (ui.button(tr("Done")).clicked() || field.lost_focus() && ui.input(|i| i.key_pressed(egui::Key::Enter))) && !url.trim().is_empty() + { + action = Some(("text.link", json!({"url": url.trim()}))); + } + } + MenuInput::Offset(offset) => { + ui.add(egui::DragValue::new(offset).speed(1.0).range(-100_000.0..=100_000.0)); + if ui.button(tr("Offset")).clicked() { + action = Some(("vector.offset", json!({"offset": offset}))); + } + } + MenuInput::MoveToPage => { + let mut choices = 0; + if let Ok(ds) = app.session.ds() { + for &page in &ds.doc.pages { + if page == ds.page || ds.doc.is_divider(page) { + continue; + } + if let Some(node) = ds.doc.node(page) + && ui.button(&node.name).clicked() + { + action = Some(("object.moveToPage", json!({"page": page}))); + } + choices += 1; + } + } + if choices == 0 { + ui.label(tr("No other pages")); + } + } + } + }); + if let Some((id, params)) = action { + app.run(id, params); + } else if open { + app.ui.menu_input = Some(input); + } +} + /// The Rename layers dialog's fields. #[derive(Clone, Debug, Default, PartialEq)] pub struct BatchRenameUi { diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 20a8a77c1..c46713918 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -132,6 +132,8 @@ mod live_tests; #[cfg(test)] mod live_text_tests; #[cfg(test)] +mod menu_input_tests; +#[cfg(test)] mod online_tests; #[cfg(test)] mod open_issues_tests; @@ -410,6 +412,8 @@ pub struct UiState { /// The tab the About window shows. pub about_tab: dialogs::AboutTab, pub preferences: bool, + /// A menu command that needs a value before the engine can run it. + pub menu_input: Option, pub shortcuts_panel: bool, /// The Keyboard shortcuts panel's tab and search text. pub shortcuts_tab: figcraft_engine::keymap::Group, @@ -537,6 +541,7 @@ impl Default for UiState { about: false, about_tab: dialogs::AboutTab::About, preferences: false, + menu_input: None, shortcuts_panel: false, shortcuts_tab: figcraft_engine::keymap::Group::Essential, shortcuts_query: String::new(), diff --git a/crates/ui-egui/src/menu_input_tests.rs b/crates/ui-egui/src/menu_input_tests.rs new file mode 100644 index 000000000..0de3757fb --- /dev/null +++ b/crates/ui-egui/src/menu_input_tests.rs @@ -0,0 +1,74 @@ +//! Menu and Actions entries that need an input must collect it in the UI, not send `{}` to the +//! engine (which would show a parameter error or silently use a default). + +use figcraft_engine::Session; +use serde_json::json; + +use crate::dialogs::MenuInput; +use crate::layers_drag_tests::Ui; +use crate::menus; + +#[test] +fn preference_actions_open_preferences_without_changing_values() { + let mut ui = Ui::new(Session::new()); + ui.app.session.prefs.language = "en".into(); + ui.app.session.prefs.publish_server = "wss://example.test/".into(); + let before = ui.app.session.prefs.clone(); + for id in ["pref.language", "pref.userName", "pref.publishServer", "pref.nudge"] { + ui.app.ui.preferences = false; + menus::invoke(&mut ui.app, id); + assert!(ui.app.ui.preferences, "{id} did not open Preferences"); + assert!(ui.app.ui.last_error.is_none(), "{id} showed an error"); + assert_eq!(ui.app.session.prefs.language, before.language); + assert_eq!(ui.app.session.prefs.publish_server, before.publish_server); + assert_eq!(ui.app.session.prefs.nudge_small, before.nudge_small); + assert_eq!(ui.app.session.prefs.nudge_big, before.nudge_big); + } + // Programmatic callers still need the actual argument. + assert!(ui.app.session.execute("pref.language", &json!({})).is_err()); +} + +#[test] +fn menu_entries_collect_required_arguments_before_running() { + let mut ui = Ui::new(Session::new()); + let name = ui.app.session.doc().unwrap().name.clone(); + for (id, expected) in [ + ("file.rename", MenuInput::RenameFile(name)), + ("text.link", MenuInput::Link(String::new())), + ("vector.offset", MenuInput::Offset(0.0)), + ("object.moveToPage", MenuInput::MoveToPage), + ] { + ui.app.ui.menu_input = None; + menus::invoke(&mut ui.app, id); + assert_eq!(ui.app.ui.menu_input, Some(expected), "{id}"); + assert!(ui.app.ui.last_error.is_none(), "{id} showed an error"); + } + ui.frame(vec![]); + assert!(ui.app.ui.last_error.is_none()); +} + +#[test] +fn palette_entries_with_existing_pickers_show_them() { + let mut ui = Ui::new(Session::new()); + menus::invoke(&mut ui.app, "tool.set"); + assert_eq!(ui.app.ui.tool_flyout, Some("move")); + ui.app.ui.left_collapsed = true; + menus::invoke(&mut ui.app, "page.select"); + assert!(!ui.app.ui.left_collapsed); + assert!(ui.app.ui.pages_open); + menus::invoke(&mut ui.app, "file.openRecent"); + assert!(ui.app.ui.home); + assert_eq!(ui.app.ui.home_view.section, crate::home::Section::Recents); + assert!(ui.app.ui.last_error.is_none()); +} + +#[test] +fn batch_rename_opens_its_existing_dialog() { + let mut session = Session::new(); + let id = session.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 20, "height": 20})).unwrap()["id"].clone(); + session.execute("select.set", &json!({"ids": [id]})).unwrap(); + let mut ui = Ui::new(session); + menus::invoke(&mut ui.app, "object.batchRename"); + assert_eq!(ui.app.ui.batch_rename.as_ref().map(|d| d.ids.len()), Some(1)); + assert!(ui.app.ui.last_error.is_none()); +} diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index b9d3299a6..ccdffa7f2 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -81,6 +81,10 @@ pub fn invoke(app: &mut FigApp, id: &str) { "file.placeImage" => app.import_dialog(true), "file.save" => app.save(), "file.saveAs" => app.save_as_dialog(), + "file.openRecent" => { + app.ui.home = true; + app.ui.home_view.section = crate::home::Section::Recents; + } "file.saveVersion" => crate::versions::start_save(app), "branch.create" => crate::versions::start_branch(app), "file.export" | "file.exportSvg" => app.ui.export_preview = true, @@ -128,6 +132,31 @@ pub fn invoke(app: &mut FigApp, id: &str) { app.services.clipboard_set_text(&format!("figcraft://node/{}", ids.first().map(|i| i.0).unwrap_or(0))); } "edit.findReplace" => app.ui.find = Some((String::new(), String::new())), + // The Actions palette invokes commands without parameters. These values are edited in + // Preferences; sending an empty object would either fail or silently reset a preference. + "pref.language" | "pref.userName" | "pref.publishServer" | "pref.nudge" => { + app.run("app.preferences", json!({})); + } + "file.rename" => { + if let Ok(doc) = app.session.doc() { + app.ui.menu_input = Some(crate::dialogs::MenuInput::RenameFile(doc.name.clone())); + } + } + "text.link" => app.ui.menu_input = Some(crate::dialogs::MenuInput::Link(String::new())), + "vector.offset" => app.ui.menu_input = Some(crate::dialogs::MenuInput::Offset(0.0)), + "object.moveToPage" => app.ui.menu_input = Some(crate::dialogs::MenuInput::MoveToPage), + "object.batchRename" => { + let ids = app.session.selection(); + if !ids.is_empty() { + crate::dialogs::open_batch_rename(app, &ids); + } + } + "tool.set" => app.ui.tool_flyout = Some("move"), + "page.select" => { + app.ui.left_tab = crate::LeftTab::File; + app.ui.left_collapsed = false; + app.ui.pages_open = true; + } // From a menu the link is pasted into the Join dialog (`collab.join {link}` joins directly). "collab.join" => crate::live::open_join(app, ""), // So is the server address for publishing (it carries the server key). diff --git a/docs/gaps.md b/docs/gaps.md index e8b111a8d..c8ed80b5b 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Where FigCraft falls short of Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-15 · **Change:** minor (bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (menu and Actions parameter dialogs; bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) Every known shortfall against Figma, one entry each, ranked by how much it stops a Figma user from doing real work in FigCraft. Agents: pick work from the top unless the owner says otherwise. The @@ -138,6 +138,9 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe cursor for every tool and modifier, panel widths, dark pages (`field_tests`, `cursor_tests`, `cursors_tests`, `outline_options_tests`, `hide_publishing_tests`, `panel_width_tests`, `theme_pages_tests`). +- **Landed (2026-10-16):** affected menu and Actions entries that need values now open their existing + controls or collect the values before dispatch. The language choice in Preferences uses a + dropdown that fits in the dialog (`menu_input_tests.rs`). - **Evidence:** ROADMAP item 7 ("Left: tool by tool, panel by panel against the incumbent"). - **Impact:** Figma users notice the feel within minutes; it decides whether they stay. - **Estimate:** 40–60 h. Detail in [`ui-parity.md`](ui-parity.md). @@ -400,6 +403,7 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe | Date | Change | Summary | |---|---|---| +| 2026-10-16 | minor | Gap 4: affected menu and Actions entries with required values open an input or the relevant panel before running the command; the language selector fits inside Preferences. Estimates and ranking unchanged. | | 2026-10-15 | minor | Gap 7: bounded canvas overscan for smoother panning. Estimates and ranking unchanged. | | 2026-10-14 | minor | Russian catalog (M9), reviewed and approved by VanTan: all 2,165 current entries, Русский in Preferences and regional ru tags. Russian integer plurals use one/few/many; contributor display name VanTan added. Existing estimates unchanged. | | 2026-10-13 | minor | Gap 1: the experimental `.fig` export writes instance sizes (resized, filling an auto layout, scaled), variables with modes and bindings, shared styles and variable-width strokes, and the import reads them back. Checked by opening written files in other software: resized and scaled instances keep their size and lay their layers out for it, variables with their modes and colour bindings resolve there (a frame set to another mode shows that mode's colours, also inside instances), colour, text, effect and grid styles are listed, and variable-width strokes that are the same on both sides of the path draw with their width; number, string and boolean bindings and bindings on effects, layout guides and gradient stops come across as the values they give but did not show as bound there (their entries now also name the layer field they set, not yet checked there), and strokes wider on one side of the path are written as filled outlines, no longer editable strokes there (the stroke itself is kept as plugin data and our own import puts it back; not yet checked there). Hours and the ranking unchanged | From dc97118c6f0c8e3be88087d6e9a910d069be042e Mon Sep 17 00:00:00 2001 From: Ahmed5Emad Date: Fri, 16 Oct 2026 22:58:36 +0300 Subject: [PATCH 090/817] Actions palette rework: Figma-shaped panel over the toolbar Tabs (All, Assets, Plugins & widgets), Recents kept in the preferences (newest first, capped at 5), commands grouped by top-level menu, this file's components (placed at the view centre) and styles (applied to the selection), installed plugins and widgets with letter tiles. Rows carry right-side shortcut/kind hints; Enter runs the first visible row. The panel floats 8 px above the toolbar pill with its exact width and centre (toolbar::main_width, canvas-centred), at a fixed size so tab switches never resize it. Tabs keep their frames when idle so the active pill never moves its neighbours. Engine: Prefs.recent_actions (persisted, skipped when empty). UI: invoke/menu/plugin picks record recents; gone entries drop out. Locales: new keys in en + es, retired the old search hint everywhere. Docs: ui-parity row describes the new surface (palette_tests). --- .gitignore | 2 + crates/engine/src/lib.rs | 9 + crates/ui-egui/locales/cs.toml | 1 - crates/ui-egui/locales/de.toml | 1 - crates/ui-egui/locales/en.toml | 5 +- crates/ui-egui/locales/es.toml | 5 +- crates/ui-egui/locales/fr.toml | 1 - crates/ui-egui/locales/id.toml | 1 - crates/ui-egui/locales/ja.toml | 1 - crates/ui-egui/locales/ko.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/tr.toml | 1 - crates/ui-egui/locales/zh-Hans.toml | 1 - crates/ui-egui/src/control.rs | 1 + crates/ui-egui/src/lib.rs | 10 +- crates/ui-egui/src/menus.rs | 405 +++++++++++++++++++++++++--- crates/ui-egui/src/palette_tests.rs | 60 +++++ crates/ui-egui/src/plugins_ui.rs | 2 + crates/ui-egui/src/toolbar.rs | 15 +- docs/ui-parity.md | 2 +- 22 files changed, 467 insertions(+), 60 deletions(-) create mode 100644 crates/ui-egui/src/palette_tests.rs diff --git a/.gitignore b/.gitignore index 928d6b498..3709c74a6 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ plans/ /log/ .DS_Store *.profraw + +plugins/target/ diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 34653bd5f..09b341209 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -652,8 +652,16 @@ pub struct Prefs { pub home_sort: String, /// Which way: `"desc"` (newest first, Z to A) or `"asc"`. pub home_order: String, + /// Recently run actions (the Actions palette's Recents), newest first, at most + /// [`MAX_RECENT_ACTIONS`]. Entries are `command:`, `plugin:/` or + /// `widget:`. + #[serde(skip_serializing_if = "Vec::is_empty")] + pub recent_actions: Vec, } +/// Recently run actions kept for the Actions palette (newest first). +pub const MAX_RECENT_ACTIONS: usize = 5; + impl Default for Prefs { fn default() -> Self { Self { @@ -681,6 +689,7 @@ impl Default for Prefs { home_views: BTreeMap::new(), home_sort: "modified".into(), home_order: "desc".into(), + recent_actions: Vec::new(), } } } diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml index 268ff5275..e86da423c 100644 --- a/crates/ui-egui/locales/cs.toml +++ b/crates/ui-egui/locales/cs.toml @@ -1133,7 +1133,6 @@ status = "draft — needs native review" "Scroll with parent" = "Posouvat s nadřazeným prvkem" "Search plugins" = "Hledat pluginy" "Search" = "Hledat" -"Search actions, layers and tools" = "Hledat akce, vrstvy a nástroje" "Search assets" = "Hledat zdroje" "Search comments" = "Hledat komentáře" "Search fonts" = "Hledat písma" diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index cd1e34827..862527e42 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -1096,7 +1096,6 @@ status = "draft — needs native review" "Scroll to layer" = "Zur Ebene scrollen" "Scroll with parent" = "Mit übergeordnetem Element scrollen" "Search" = "Suchen" -"Search actions, layers and tools" = "Aktionen, Ebenen und Werkzeuge suchen" "Search assets" = "Assets suchen" "Search comments" = "Kommentare suchen" "Search fonts" = "Schriften suchen" diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 3c127fc65..703f018cc 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -965,8 +965,10 @@ name = "English" "Place a shape or frame (its tool chosen)" = "Place a shape or frame (its tool chosen)" "Place automatically" = "Place automatically" "Place image" = "Place image" +"Plugin" = "Plugin" "Plugins run in FigCraft's sandbox, without files, network or clock. Install only plugins you trust." = "Plugins run in FigCraft's sandbox, without files, network or clock. Install only plugins you trust." "Plugins" = "Plugins" +"Plugins & widgets" = "Plugins & widgets" "Plus darker" = "Plus darker" "Plus lighter" = "Plus lighter" "Point" = "Point" @@ -1148,7 +1150,7 @@ name = "English" "Scroll with parent" = "Scroll with parent" "Search plugins" = "Search plugins" "Search" = "Search" -"Search actions, layers and tools" = "Search actions, layers and tools" +"Search actions, assets and plugins" = "Search actions, assets and plugins" "Search assets" = "Search assets" "Search comments" = "Search comments" "Search fonts" = "Search fonts" @@ -1468,6 +1470,7 @@ name = "English" "White" = "White" "Who runs it, its terms and how long it keeps files" = "Who runs it, its terms and how long it keeps files" "Why it changed" = "Why it changed" +"Widget" = "Widget" "Widgets" = "Widgets" "Width" = "Width" "Width point" = "Width point" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 901283f11..554d99838 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -966,8 +966,10 @@ status = "draft — needs native review" "Place a shape or frame (its tool chosen)" = "Colocar forma o marco (herramienta elegida)" "Place automatically" = "Colocar automáticamente" "Place image" = "Colocar imagen" +"Plugin" = "Plugin" "Plugins run in FigCraft's sandbox, without files, network or clock. Install only plugins you trust." = "Los plugins se ejecutan en el entorno aislado de FigCraft, sin archivos, red ni reloj. Instala solo plugins de confianza." "Plugins" = "Plugins" +"Plugins & widgets" = "Plugins & widgets" "Plus darker" = "Más oscuro" "Plus lighter" = "Más claro" "Point" = "Punto" @@ -1149,8 +1151,8 @@ status = "draft — needs native review" "Scroll with parent" = "Desplazar con el padre" "Search plugins" = "Buscar plugins" "Search" = "Buscar" -"Search actions, layers and tools" = "Buscar acciones, capas y herramientas" "Search assets" = "Buscar recursos" +"Search actions, assets and plugins" = "Buscar acciones, recursos y plugins" "Search comments" = "Buscar comentarios" "Search fonts" = "Buscar fuentes" "Search layers" = "Buscar capas" @@ -1469,6 +1471,7 @@ status = "draft — needs native review" "White" = "Blanco" "Who runs it, its terms and how long it keeps files" = "Quién lo gestiona, sus condiciones y cuánto tiempo conserva los archivos" "Why it changed" = "Por qué cambió" +"Widget" = "Widget" "Widgets" = "Widgets" "Width" = "Ancho" "Width point" = "Punto de ancho" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 7fafd3c91..2c1fbc45a 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -1090,7 +1090,6 @@ status = "draft — needs native review" "Scroll to layer" = "Défiler jusqu’au calque" "Scroll with parent" = "Défiler avec le parent" "Search" = "Rechercher" -"Search actions, layers and tools" = "Rechercher des actions, des calques et des outils" "Search assets" = "Rechercher des ressources" "Search comments" = "Rechercher des commentaires" "Search fonts" = "Rechercher des polices" diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml index 5de7634d4..53825747a 100644 --- a/crates/ui-egui/locales/id.toml +++ b/crates/ui-egui/locales/id.toml @@ -1137,7 +1137,6 @@ status = "draft — needs native review" "Scroll with parent" = "Gulir bersama induk" "Search plugins" = "Cari plugin" "Search" = "Cari" -"Search actions, layers and tools" = "Cari tindakan, layer, dan alat" "Search assets" = "Cari aset" "Search comments" = "Cari komentar" "Search fonts" = "Cari font" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index 4d4d6d340..670f84fcb 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -1140,7 +1140,6 @@ status = "draft — needs native review" "Scroll to layer" = "レイヤーまでスクロール" "Scroll with parent" = "親と一緒にスクロール" "Search" = "検索" -"Search actions, layers and tools" = "アクション、レイヤー、ツールを検索" "Search assets" = "アセットを検索" "Search comments" = "コメントを検索" "Search fonts" = "フォントを検索" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index ec732905c..1f7bed0c6 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -1090,7 +1090,6 @@ status = "draft — needs native review" "Scroll to layer" = "레이어로 스크롤" "Scroll with parent" = "부모와 함께 스크롤" "Search" = "검색" -"Search actions, layers and tools" = "액션, 레이어, 도구 검색" "Search assets" = "에셋 검색" "Search comments" = "댓글 검색" "Search fonts" = "글꼴 검색" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index c2189de81..2fb61d124 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -1089,7 +1089,6 @@ status = "draft — needs native review" "Scroll to layer" = "Rolar até a camada" "Scroll with parent" = "Rolar com o pai" "Search" = "Pesquisar" -"Search actions, layers and tools" = "Pesquisar ações, camadas e ferramentas" "Search assets" = "Pesquisar recursos" "Search comments" = "Pesquisar comentários" "Search fonts" = "Pesquisar fontes" diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 3ab407572..78a8afd62 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -1134,7 +1134,6 @@ name = "Русский" "Scroll with parent" = "Прокручивать с родителем" "Search plugins" = "Поиск плагинов" "Search" = "Поиск" -"Search actions, layers and tools" = "Поиск действий, слоёв и инструментов" "Search assets" = "Поиск ресурсов" "Search comments" = "Поиск комментариев" "Search fonts" = "Поиск шрифтов" diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index f7b2999d6..a54c02e7c 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -1135,7 +1135,6 @@ name = "Svenska" "Scroll with parent" = "Rulla med överordnat element" "Search plugins" = "Sök plugin-program" "Search" = "Sök" -"Search actions, layers and tools" = "Sök åtgärder, lager och verktyg" "Search assets" = "Sök tillgångar" "Search comments" = "Sök i kommentarer" "Search fonts" = "Sök typsnitt" diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml index a2be6b99c..436032877 100644 --- a/crates/ui-egui/locales/tr.toml +++ b/crates/ui-egui/locales/tr.toml @@ -1137,7 +1137,6 @@ name = "Türkçe" "Scroll with parent" = "Üst öğeyle birlikte kaydır" "Search plugins" = "Eklentilerde ara" "Search" = "Ara" -"Search actions, layers and tools" = "Eylem, katman ve araç ara" "Search assets" = "Varlıklarda ara" "Search comments" = "Yorumlarda ara" "Search fonts" = "Yazı tiplerinde ara" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index af4cf6534..a42360e42 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -1091,7 +1091,6 @@ status = "draft — needs native review" "Scroll to layer" = "滚动到图层" "Scroll with parent" = "随父级滚动" "Search" = "搜索" -"Search actions, layers and tools" = "搜索操作、图层和工具" "Search assets" = "搜索资源" "Search comments" = "搜索评论" "Search fonts" = "搜索字体" diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rs index 7a196cf27..9dd8e2f4b 100644 --- a/crates/ui-egui/src/control.rs +++ b/crates/ui-egui/src/control.rs @@ -415,6 +415,7 @@ pub fn handle(app: &mut FigApp, ctx: &Context, method: &str, p: &Value) -> Resul } if let Some(h) = p.get("palette").and_then(Value::as_bool) { app.ui.palette = if h { Some(String::new()) } else { None }; + app.ui.palette_tab = crate::menus::PaletteTab::All; } // true / false, or a top-level menu to open it at ("Plugins"). match p.get("mainMenu") { diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 20a8a77c1..468303165 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -136,6 +136,8 @@ mod online_tests; #[cfg(test)] mod open_issues_tests; #[cfg(test)] +mod palette_tests; +#[cfg(test)] mod panel_remove_tests; #[cfg(test)] mod panel_reorder_tests; @@ -404,6 +406,8 @@ pub struct UiState { pub rename_page: Option<(NodeId, String)>, pub main_menu: bool, pub palette: Option, + /// The Actions palette's tab. + pub palette_tab: menus::PaletteTab, /// The Variables editor, when open. pub variables: Option, pub about: bool, @@ -533,6 +537,7 @@ impl Default for UiState { rename_page: None, main_menu: false, palette: None, + palette_tab: menus::PaletteTab::All, variables: None, about: false, about_tab: dialogs::AboutTab::About, @@ -788,7 +793,10 @@ impl FigApp { } "dialog.preferences" => self.ui.preferences = true, "panel.shortcuts" => self.ui.shortcuts_panel = !self.ui.shortcuts_panel, - "palette.actions" => self.ui.palette = Some(String::new()), + "palette.actions" => { + self.ui.palette = Some(String::new()); + self.ui.palette_tab = menus::PaletteTab::All; + } "panel.design" => self.ui.right_tab = RightTab::Design, "panel.prototype" => self.ui.right_tab = RightTab::Prototype, "panel.designPrototype" => { diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index b9d3299a6..0e0793139 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -7,9 +7,9 @@ use serde_json::json; use crate::FigApp; use crate::a11y; -use crate::i18n::{self, tr, tr_noop, trf}; use crate::icons::{self, Icon}; -use crate::theme::{ACCENT, Tokens, regular}; +use crate::i18n::{self, tr, tr_noop, trf}; +use crate::theme::{Tokens, regular}; use crate::toolbar::pretty_shortcut; /// Commands the UI layer implements itself (dialogs and platform actions). @@ -73,7 +73,28 @@ fn clipboard_png(app: &mut FigApp) -> Option<(Vec, u32, u32)> { Some((out.into_inner(), w, h)) } +/// The Actions palette's tab. +#[derive(Clone, Copy, PartialEq, Eq, Default)] +pub enum PaletteTab { + #[default] + All, + Assets, + Plugins, +} + +/// Remember a ran action for the palette's Recents (newest first, capped). +pub fn record_recent(app: &mut FigApp, key: &str) { + let r = &mut app.session.prefs.recent_actions; + if r.first().is_some_and(|f| f == key) { + return; + } + r.retain(|k| k != key); + r.insert(0, key.to_string()); + r.truncate(figcraft_engine::MAX_RECENT_ACTIONS); +} + pub fn invoke(app: &mut FigApp, id: &str) { + record_recent(app, &format!("command:{id}")); match id { "file.open" => app.open_dialog(), "plugin.import" => crate::plugins_ui::import_dialog(app), @@ -612,14 +633,25 @@ fn select_layer_menu(app: &mut FigApp, ui: &mut Ui, pos: egui::Pos2, t: &Tokens) } } -/// The Actions palette: fuzzy search over every command. +/// The Actions palette's content height (the frame adds its own 8 px margins). +const PALETTE_H: f32 = 450.0; + +/// The Actions palette: search over commands, assets and plugins, in Figma's shape (tabs, +/// recents, grouped sections). Rows run on click; Enter runs the first visible row. fn palette(app: &mut FigApp, ctx: &egui::Context) { let Some(mut q) = app.ui.palette.clone() else { return }; let t = Tokens::get(ctx); - let screen = ctx.content_rect(); + // Same centre and width as the toolbar pill (it centres on the canvas, not the window), + // floating 8 px above it. Fixed size: switching tabs never resizes the panel. + let bar_w = crate::toolbar::main_width(); + let canvas = app.canvas.rect; + let area = Rect::from_min_size( + pos2(canvas.center().x - bar_w / 2.0, canvas.max.y - 68.0 - (PALETTE_H + 16.0)), + vec2(bar_w, PALETTE_H + 16.0), + ); let mut run: Option = None; let mut close = false; - egui::Area::new(Id::new("palette")).fixed_pos(pos2(screen.center().x - 260.0, screen.min.y + 120.0)).order(egui::Order::Foreground).show( + egui::Area::new(Id::new("palette")).fixed_pos(area.min).order(egui::Order::Foreground).show( ctx, |ui| { egui::Frame::NONE @@ -629,64 +661,353 @@ fn palette(app: &mut FigApp, ctx: &egui::Context) { .shadow(egui::Shadow { offset: [0, 8], blur: 32, spread: 0, color: t.shadow }) .inner_margin(egui::Margin::same(8)) .show(ui, |ui| { - ui.set_width(520.0); + // Same outer width as the toolbar pill, and a fixed height: switching tabs + // never resizes the panel. + let inner = crate::toolbar::main_width() - 16.0; + ui.set_width(inner); + ui.set_height(PALETTE_H); let r = ui.add( egui::TextEdit::singleline(&mut q) - .hint_text(tr("Search actions, layers and tools")) - .desired_width(500.0) + .hint_text(tr("Search actions, assets and plugins")) + .desired_width(inner - 16.0) .font(regular(14.0)) .frame(egui::Frame::NONE.inner_margin(egui::Margin::same(8))), ); r.request_focus(); crate::widgets::select_all_on_focus(ui, &r, &q); ui.add_space(4.0); - let ql = q.to_lowercase(); - // Labels match in the UI language and in English. - let matches = - |label: &str, english: &str, id: &str| ql.is_empty() || [label, english, id].iter().any(|s| s.to_lowercase().contains(&ql)); - let mut hits: Vec<(&str, std::borrow::Cow, &str)> = Vec::new(); - let menu_items = MENU.iter().filter(|m| UI_COMMANDS.contains(&m.id)).map(|m| (m.id, m.label)); - for (id, english) in figcraft_engine::all_commands().iter().map(|c| (c.id, c.label)).chain(menu_items) { - let label = i18n::command(id, english); - if matches(&label, english, id) { - hits.push((id, label, crate::shortcuts::shortcut(id).unwrap_or(""))); - } - } - hits.sort_by_key(|h| (!h.1.to_lowercase().starts_with(&ql), h.1.len())); - hits.dedup_by(|a, b| a.0 == b.0); - let enter = ui.input(|i| i.key_pressed(egui::Key::Enter)); - egui::ScrollArea::vertical().max_height(360.0).show(ui, |ui| { - for (i, (id, label, sc)) in hits.iter().take(60).enumerate() { - let w = ui.available_width(); - let (r, resp) = ui.allocate_exact_size(vec2(w, 30.0), Sense::click()); - if resp.hovered() || i == 0 { - ui.painter().rect_filled(r, CornerRadius::same(5), if resp.hovered() { ACCENT } else { t.hover }); - } - let col = if resp.hovered() { Color32::WHITE } else { t.text }; - ui.painter().text(pos2(r.min.x + 10.0, r.center().y), Align2::LEFT_CENTER, label.as_ref(), regular(12.0), col); - ui.painter().text( - pos2(r.max.x - 10.0, r.center().y), - Align2::RIGHT_CENTER, - pretty_shortcut(sc), - regular(11.0), - if resp.hovered() { Color32::WHITE } else { t.text_secondary }, + // Tabs: All, Assets, Plugins & widgets. + let tabs = [(PaletteTab::All, tr("All")), (PaletteTab::Assets, tr("Assets")), (PaletteTab::Plugins, tr("Plugins & widgets"))]; + ui.horizontal(|ui| { + ui.spacing_mut().item_spacing = vec2(4.0, 0.0); + for (tab, label) in tabs { + let active = app.ui.palette_tab == tab; + // The frame stays on for every tab (transparent when idle) so the + // active pill never moves its neighbours. + let resp = ui.add( + egui::Button::new(egui::RichText::new(label).size(12.0).color(if active { t.text } else { t.text_secondary })) + .frame(true) + .fill(if active { t.hover } else { Color32::TRANSPARENT }) + .corner_radius(CornerRadius::same(6)), ); - if resp.clicked() || (enter && i == 0) { - run = Some(id.to_string()); + if resp.clicked() { + app.ui.palette_tab = tab; } } }); + ui.add_space(4.0); + let enter = ui.input(|i| i.key_pressed(egui::Key::Enter)); + let mut first: Option = None; + egui::ScrollArea::vertical().max_height(360.0).show(ui, |ui| { + let tab = app.ui.palette_tab; + if tab == PaletteTab::All { + let recents: Vec = app + .session + .prefs + .recent_actions + .clone() + .iter() + .filter_map(|key| recent_row(app, key, &q)) + .collect(); + if !recents.is_empty() { + section(ui, &t, tr("Recents"), |ui| { + for row in &recents { + first.get_or_insert_with(|| row.key.clone()); + if draw_row(ui, &t, row) { + run = Some(row.key.clone()); + } + } + }); + } + } + if tab != PaletteTab::Plugins { + for (group, rows) in command_sections(&q) { + if tab == PaletteTab::Assets { + continue; + } + section(ui, &t, &group, |ui| { + for row in rows { + first.get_or_insert_with(|| row.key.clone()); + if draw_row(ui, &t, &row) { + run = Some(row.key); + } + } + }); + } + } + if tab != PaletteTab::Assets { + let plugins = plugin_rows(app, &q); + let widgets = widget_rows(app, &q); + if !plugins.is_empty() { + section(ui, &t, tr("Plugins"), |ui| { + for row in plugins { + first.get_or_insert_with(|| row.key.clone()); + if draw_row(ui, &t, &row) { + run = Some(row.key); + } + } + }); + } + if !widgets.is_empty() { + section(ui, &t, tr("Widgets"), |ui| { + for row in widgets { + first.get_or_insert_with(|| row.key.clone()); + if draw_row(ui, &t, &row) { + run = Some(row.key); + } + } + }); + } + } + if tab == PaletteTab::Assets { + for (group, rows) in asset_sections(app, &q) { + section(ui, &t, &group, |ui| { + for row in rows { + first.get_or_insert_with(|| row.key.clone()); + if draw_row(ui, &t, &row) { + run = Some(row.key); + } + } + }); + } + } + }); + if enter { + if let Some(key) = first { + run = Some(key); + } + } }); }, ); if ctx.input(|i| i.key_pressed(egui::Key::Escape)) { close = true; } - if let Some(id) = run { + if let Some(key) = run { app.ui.palette = None; - invoke(app, &id); + run_action(app, &key); return; } app.ui.palette = if close { None } else { Some(q) }; let _ = StrokeKind::Inside; } + +/// Run a palette row: `command:`, `plugin:/`, `widget:`, +/// `component:` or `style:`. +fn run_action(app: &mut FigApp, key: &str) { + if let Some(id) = key.strip_prefix("command:") { + invoke(app, id); + } else if let Some(rest) = key.strip_prefix("plugin:") { + if let Some((plugin, command)) = rest.split_once('/') { + record_recent(app, key); + crate::plugins_ui::start(app, plugin, command); + } + } else if let Some(plugin) = key.strip_prefix("widget:") { + record_recent(app, key); + app.run("widget.insert", json!({ "plugin": plugin })); + } else if let Some(node) = key.strip_prefix("component:") { + if let Ok(n) = node.parse::() { + let (cx, cy) = app.session.ds().map(|d| (d.view.cx, d.view.cy)).unwrap_or((0.0, 0.0)); + app.run("instance.place", json!({ "component": n, "x": cx, "y": cy })); + } + } else if let Some(style) = key.strip_prefix("style:") { + if app.session.selection().is_empty() { + app.toast(tr("Select layers to apply the style to")); + } else { + app.run("style.apply", json!({ "style": style })); + } + } +} + +/// One pickable palette row. +pub(crate) struct ActionRow { + pub(crate) key: String, + pub(crate) label: String, + hint: String, + /// A letter tile instead of an icon (plugins carry no artwork). + tile: Option, +} + +/// A section header with its rows. +fn section(ui: &mut Ui, t: &Tokens, name: &str, rows: impl FnOnce(&mut Ui)) { + ui.add_space(6.0); + ui.painter().text(pos2(ui.min_rect().min.x + 10.0, ui.cursor().min.y + 7.0), Align2::LEFT_TOP, name, regular(11.0), t.text_secondary); + ui.add_space(18.0); + rows(ui); +} + +/// Draw one row (a letter tile for plugins, else just the label) with its right-side hint. +/// True when clicked. +fn draw_row(ui: &mut Ui, t: &Tokens, row: &ActionRow) -> bool { + let w = ui.available_width(); + let (r, resp) = ui.allocate_exact_size(vec2(w, 34.0), Sense::click()); + if resp.hovered() { + ui.painter().rect_filled(r, CornerRadius::same(6), t.hover); + } + let mut label_x = r.min.x + 10.0; + if let Some(letter) = row.tile { + let tile = Rect::from_center_size(pos2(r.min.x + 20.0, r.center().y), vec2(18.0, 18.0)); + ui.painter().rect_filled(tile, CornerRadius::same(5), t.hover); + ui.painter().text(tile.center(), Align2::CENTER_CENTER, letter.to_string(), regular(11.0), t.text); + label_x = r.min.x + 38.0; + } + ui.painter().text(pos2(label_x, r.center().y), Align2::LEFT_CENTER, &row.label, regular(13.0), t.text); + ui.painter().text(pos2(r.max.x - 10.0, r.center().y), Align2::RIGHT_CENTER, &row.hint, regular(11.0), t.text_secondary); + resp.clicked() +} + +/// Whether `label` (or `extra`) matches the query, in any case. +fn matches(q: &str, label: &str, extra: &str) -> bool { + q.is_empty() || label.to_lowercase().contains(q) || extra.to_lowercase().contains(q) +} + +/// Commands grouped by top-level menu, in catalog order, filtered by the query. +pub(crate) fn command_sections(q: &str) -> Vec<(String, Vec)> { + let ql = q.to_lowercase(); + let mut groups: Vec<(String, Vec)> = Vec::new(); + let mut seen: std::collections::HashSet<&str> = std::collections::HashSet::new(); + for m in figcraft_engine::catalog::MENU.iter() { + if m.label == figcraft_engine::catalog::SEP || m.menu.starts_with("Plugins") || !available(m.id) || !seen.insert(m.id) { + continue; + } + let english = m.label; + let label = i18n::menu_item(m.id, english).into_owned(); + if !matches(&ql, &label, &format!("{english} {}", m.id)) { + continue; + } + let group = m.menu.split('/').next().unwrap_or(&m.menu); + let group = tr(group).to_string(); + let row = ActionRow { + key: format!("command:{}", m.id), + label, + hint: crate::shortcuts::shortcut(m.id).map(pretty_shortcut).unwrap_or_default(), + tile: None, + }; + match groups.iter_mut().find(|(g, _)| *g == group) { + Some((_, rows)) => rows.push(row), + None => groups.push((group, vec![row])), + } + } + groups +} + +/// Installed plugins' commands, filtered by the query. +fn plugin_rows(app: &FigApp, q: &str) -> Vec { + let ql = q.to_lowercase(); + let mut rows = Vec::new(); + for p in &app.session.prefs.plugins { + let m = &p.manifest; + for c in &m.commands { + let label = if m.commands.len() == 1 { m.name.clone() } else { format!("{} — {}", m.name, c.label) }; + if !matches(&ql, &label, &m.id) { + continue; + } + rows.push(ActionRow { + key: format!("plugin:{}/{}", m.id, c.id), + label, + hint: if c.params.is_empty() { tr("Plugin").to_string() } else { c.label.clone() }, + tile: m.name.chars().next(), + }); + } + } + rows +} + +/// Installed widgets, filtered by the query. +fn widget_rows(app: &FigApp, q: &str) -> Vec { + let ql = q.to_lowercase(); + app.session + .prefs + .plugins + .iter() + .filter(|p| p.manifest.widget) + .filter(|p| matches(&ql, &p.manifest.name, &p.manifest.id)) + .map(|p| ActionRow { + key: format!("widget:{}", p.manifest.id), + label: p.manifest.name.clone(), + hint: tr("Widget").to_string(), + tile: p.manifest.name.chars().next(), + }) + .collect() +} + +/// This file's components and styles, filtered by the query. +fn asset_sections(app: &FigApp, q: &str) -> Vec<(String, Vec)> { + let ql = q.to_lowercase(); + let Ok(doc) = app.session.doc() else { return Vec::new() }; + let components: Vec = figcraft_engine::library::local_components(doc) + .iter() + .filter_map(|id| doc.node(*id)) + .filter(|n| matches(&ql, &n.name, "")) + .map(|n| ActionRow { + key: format!("component:{}", n.id.0), + label: n.name.clone(), + hint: tr("Component").to_string(), + tile: None, + }) + .collect(); + let styles: Vec = figcraft_engine::library::local_styles(doc) + .filter(|s| matches(&ql, &s.name, "")) + .map(|s| ActionRow { + key: format!("style:{}", s.id), + label: s.name.clone(), + hint: tr("Style").to_string(), + tile: None, + }) + .collect(); + let mut out = Vec::new(); + if !components.is_empty() { + out.push((tr("Components").to_string(), components)); + } + if !styles.is_empty() { + out.push((tr("Styles").to_string(), styles)); + } + out +} + +/// A recent action back as a row (gone commands, plugins or assets drop out). +pub(crate) fn recent_row(app: &FigApp, key: &str, q: &str) -> Option { + let ql = q.to_lowercase(); + if let Some(id) = key.strip_prefix("command:") { + let spec = figcraft_engine::find_command(id); + let menu_label = figcraft_engine::catalog::MENU.iter().find(|m| m.id == id); + let english = menu_label.map(|m| m.label).or_else(|| spec.map(|s| s.label)).unwrap_or(id); + if !available(id) || !matches(&ql, english, id) { + return None; + } + return Some(ActionRow { + key: key.to_string(), + label: i18n::command(id, english).into_owned(), + hint: crate::shortcuts::shortcut(id).map(pretty_shortcut).unwrap_or_default(), + tile: None, + }); + } + if let Some(rest) = key.strip_prefix("plugin:") { + let (pid, cid) = rest.split_once('/')?; + let p = app.session.prefs.plugins.iter().find(|p| p.manifest.id == pid)?; + let c = p.manifest.commands.iter().find(|c| c.id == cid)?; + let label = if p.manifest.commands.len() == 1 { p.manifest.name.clone() } else { format!("{} — {}", p.manifest.name, c.label) }; + if !matches(&ql, &label, pid) { + return None; + } + return Some(ActionRow { + key: key.to_string(), + label, + hint: tr("Plugin").to_string(), + tile: p.manifest.name.chars().next(), + }); + } + if let Some(pid) = key.strip_prefix("widget:") { + let p = app.session.prefs.plugins.iter().find(|p| p.manifest.id == pid && p.manifest.widget)?; + if !matches(&ql, &p.manifest.name, pid) { + return None; + } + return Some(ActionRow { + key: key.to_string(), + label: p.manifest.name.clone(), + hint: tr("Widget").to_string(), + tile: p.manifest.name.chars().next(), + }); + } + None +} diff --git a/crates/ui-egui/src/palette_tests.rs b/crates/ui-egui/src/palette_tests.rs new file mode 100644 index 000000000..e496cb77b --- /dev/null +++ b/crates/ui-egui/src/palette_tests.rs @@ -0,0 +1,60 @@ +//! The Actions palette, driven headless: invoking records recents (newest first, capped), +//! sections group commands by menu, the query filters, and gone entries drop out of Recents. + +use figcraft_engine::Session; + +use crate::layers_drag_tests::Ui; + +#[test] +fn invoke_records_recents_newest_first_and_capped() { + let mut u = Ui::new(Session::new()); + for id in [ + "view.zoomIn", + "view.zoomOut", + "edit.copyAsText", + "style.list", + "edit.findReplace", + "edit.copyAsCss", + "view.zoomIn", + ] { + crate::menus::invoke(&mut u.app, id); + } + let r = &u.app.session.prefs.recent_actions; + assert_eq!(r.len(), figcraft_engine::MAX_RECENT_ACTIONS, "recents are capped: {r:?}"); + assert_eq!(r[0], "command:view.zoomIn", "a re-run moves to the front: {r:?}"); + assert_eq!(r.iter().filter(|k| k.as_str() == "command:view.zoomIn").count(), 1, "no duplicates: {r:?}"); + assert!(!r.contains(&"command:view.zoomOut".to_string()), "the oldest drops out: {r:?}"); +} + +#[test] +fn sections_group_by_menu_in_catalog_order() { + let groups = crate::menus::command_sections(""); + assert!(!groups.is_empty(), "the catalog has commands"); + assert_eq!(groups[0].0, "File", "catalog order starts at File"); + for (group, rows) in &groups { + assert!(!rows.is_empty(), "{group} has no rows"); + for row in rows { + assert!(row.key.starts_with("command:"), "unexpected key {}", row.key); + } + } + let names: Vec<&str> = groups.iter().map(|(g, _)| g.as_str()).collect(); + assert!(names.contains(&"File") && names.contains(&"Edit"), "menus group: {names:?}"); + assert!(!names.iter().any(|g| g.starts_with("Plugins")), "plugins have their own tab"); +} + +#[test] +fn query_filters_to_matches() { + let groups = crate::menus::command_sections("save"); + let labels: Vec<&str> = groups.iter().flat_map(|(_, rows)| rows.iter().map(|r| r.label.as_str())).collect(); + assert!(!labels.is_empty(), "something matches 'save'"); + assert!(labels.iter().all(|l| l.to_lowercase().contains("save")), "only matches: {labels:?}"); + assert!(crate::menus::command_sections("zzz-no-such-action").iter().all(|(_, r)| r.is_empty())); +} + +#[test] +fn gone_entries_drop_out_of_recents() { + let u = Ui::new(Session::new()); + assert!(crate::menus::recent_row(&u.app, "command:nope.nope", "").is_none(), "gone commands drop out"); + assert!(crate::menus::recent_row(&u.app, "plugin:nope.nope/nope", "").is_none(), "gone plugins drop out"); + assert!(crate::menus::recent_row(&u.app, "widget:nope", "").is_none(), "gone widgets drop out"); +} diff --git a/crates/ui-egui/src/plugins_ui.rs b/crates/ui-egui/src/plugins_ui.rs index 481b446c3..99df5d6f4 100644 --- a/crates/ui-egui/src/plugins_ui.rs +++ b/crates/ui-egui/src/plugins_ui.rs @@ -171,10 +171,12 @@ pub fn menu(app: &mut FigApp, ui: &mut Ui, t: &Tokens) -> bool { .flatten(); crate::menus::separator(ui); if let Some(plugin) = widget { + crate::menus::record_recent(app, &format!("widget:{plugin}")); app.run("widget.insert", json!({"plugin": plugin})); return true; } let Some((id, command)) = chosen else { return false }; + crate::menus::record_recent(app, &format!("plugin:{id}/{command}")); start(app, &id, &command); true } diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index a921cc293..0aef7555c 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -72,9 +72,18 @@ pub fn show(app: &mut FigApp, ui: &mut Ui) { builder_toolbar(app, ui); return; } - let cell = 32.0; - let gap = 4.0; - let width = GROUPS.len() as f32 * (cell + 4.0) + 4.0 * 10.0 + 2.0 * (cell + 4.0) + 16.0 + 4.0 * 34.0 + 24.0; + main_toolbar(app, ui, canvas, &t); +} + +/// The main toolbar pill's width: the Actions palette matches it so the two read as one bar. +pub(crate) fn main_width() -> f32 { + let (cell, gap) = (32.0, 4.0); + GROUPS.len() as f32 * (cell + gap) + gap * 10.0 + 2.0 * (cell + gap) + 16.0 + 4.0 * 34.0 + 24.0 +} + +fn main_toolbar(app: &mut FigApp, ui: &mut Ui, canvas: Rect, t: &Tokens) { + let (cell, gap) = (32.0, 4.0); + let width = main_width(); let rect = pill(ui, &mut app.ui.nav, canvas, width, &t); let current = app.session.tool.tool; let mut x = rect.min.x + 8.0; diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 62001715e..4a7bf45be 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -19,7 +19,7 @@ interaction feel not yet compared. | Light and dark themes | done | colours from `theme::Tokens`; a file or a page made while the dark theme shows gets a `#1E1E1E` page (`#F5F5F5` in the light theme), its own from then on: changing the theme repaints no page and opened files keep theirs; the file the app opens with takes the theme once it is known; the CLI, MCP and exports have no theme and keep `#F5F5F5`; text drawn with the Text tool is white on a dark page and black on a light one (so is text a command makes in the app without naming a fill; headless sessions keep black) (`theme_pages_tests`, `dark_page_text_tests`) | | Minimize UI (Cmd+\\) | done | | | Resizable panels | done | each panel's edge drags its width (left 200–480, right 240–480, 240 by default; a double-click on the edge or View ▸ Panels ▸ Reset panel widths puts the default back); the widths are each window's own, the main window's are kept in the preferences when a drag ends and come back at the next start, a new window opens with those of the window it comes from; Minimize UI hides the panels and brings them back as they were; the view keeps its centre and zoom while a panel is resized; in a window too small for them the panels give way so the canvas keeps 160 px (the left one first), down to the smallest window (800×500) (`panel_width_tests`). Not compared with Figma's widths; no snap points | -| Actions palette (Cmd+K, Cmd+/) | done | commands; no assets search parity | +| Actions palette (Cmd+K, Cmd+/) | done | tabs (All, Assets, Plugins & widgets), Recents kept in the preferences, commands grouped by menu, this file's components (placed at the view centre) and styles (applied to the selection), installed plugins and widgets with letter tiles; rows carry icons and shortcut hints (`palette_tests`) | | Context menus | done | canvas and layers; Shift+F10 opens them from the keyboard (at the focused layer row or below the canvas selection) and the menu takes the keyboard; the Menu key isn't delivered by the windowing layer (egui 0.36 has no key for it) | | 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 | From 9397d2ca0300bb1672eecc658d32f78ff2d8aafd Mon Sep 17 00:00:00 2001 From: timrrrr <54307723+timrrrr@users.noreply.github.com> Date: Fri, 16 Oct 2026 23:16:26 +0300 Subject: [PATCH 091/817] M1: crop image fills during Command/Ctrl resize (#702) --- ROADMAP.md | 4 +- contributors/people.toml | 3 + crates/engine/src/tools.rs | 33 ++++ .../engine/src/transform_behaviour_tests.rs | 181 ++++++++++++++++++ docs/ui-parity.md | 4 +- 5 files changed, 223 insertions(+), 2 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index c3c12085e..82d48ca25 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (Command/Ctrl image crop; bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -131,6 +131,8 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). ## Progress log +- **2026-10-16** · Command/Ctrl-resize with the Move tool crops image fills on a single non-text layer outside auto layout, keeping their scale and position and the original image bytes. Fill/Fit/Crop, rotated layers and image fills, undo and native save/reopen are covered by regression tests. Text, auto-layout contexts, Tile and the Scale tool keep their existing behaviour. Estimates unchanged. + - **2026-10-14** · Corner handles win over the corner-radius handles (M1, #292): a press on the inner half of a corner handle's square picked the radius handle 10 px in, so the drag neither resized nor (dragging outward) rounded anything. Inside the drawn square the corner now resizes both sides (in ratio with Shift or the link); further in the radius handle still answers. Regression test in the transform behaviour suite. Numbers unchanged. - **2026-10-14** · Home screen recent files as cards (M7): each card shows the picture its file carries on its first page's colour, the file's icon, name and "Edited ... ago"; sort by name, creation or last change either way; a table view; a click selects, a double-click or Enter opens, arrow keys move; Open, Show in folder and Remove from recents on right-click. Numbers unchanged. - **2026-10-13** · Vector edit mode regions (M4): with the Move tool, the filled area under the pointer is hatched with "/" lines in the selection colour, clipped by the area's own fill rule so holes stay clear; the hatch goes near points (3.5 px) and segments (2 px), and its spacing follows octave folding (8 px at every power-of-two zoom), fixed to the shape. A click selects the area with its points (they move with it but keep the unselected look), Shift adds or removes one, a press on a selected area drags the whole selection as one undo step, and a click on an empty spot clears the areas and stays in edit mode. `vector.edit.select {regions}` and `vector.edit.state` (`regions`, `regionVertices`, `regionHover`); `vector_regions_tests` and `regions_tests`. Numbers unchanged. diff --git a/contributors/people.toml b/contributors/people.toml index bc8cf71bb..1d6cd8b76 100644 --- a/contributors/people.toml +++ b/contributors/people.toml @@ -44,3 +44,6 @@ sync_github_name = true [people.volkovskey] real_name = "Andrii Volkov" + +[people.timrrrr] +display_name = "Timur" diff --git a/crates/engine/src/tools.rs b/crates/engine/src/tools.rs index 3d3b9acb8..fea703b93 100644 --- a/crates/engine/src/tools.rs +++ b/crates/engine/src/tools.rs @@ -4,6 +4,7 @@ use std::collections::BTreeMap; +use figcraft_color::{ImageScaleMode, PaintKind}; use figcraft_doc::geometry::select_target; use figcraft_doc::*; use figcraft_geom::{Affine, Point, Rect, Vec2}; @@ -1558,6 +1559,38 @@ impl Session { if flip_y { t *= Affine::new([1.0, 0.0, 0.0, -1.0, 0.0, nh]); } + // Text reflow and auto layout can recompute this box after the preview. + let crop_images = ev.cmd + && !matches!(doc.get(*id)?.kind, NodeKind::Text(_)) + && !std::iter::once(*id).chain(doc.ancestors(*id)).any(|a| doc.node(a).is_some_and(|n| n.layout.is_some())); + if crop_images { + // Crop the layer's image fills without moving their pixels on the page. + // Work from the interaction snapshot, just like the geometry on every move. + let n = doc.get(*id)?; + let (w, h) = (n.width.max(1e-6), n.height.max(1e-6)); + let to_old = + Affine::scale_non_uniform(1.0 / w, 1.0 / h) * world.inverse() * t * Affine::scale_non_uniform(nw.max(0.01), nh.max(0.01)); + let mut fills = n.fills.clone(); + for paint in &mut fills { + let PaintKind::Image(img) = &mut paint.kind else { continue }; + // A repeating image cannot be represented by a single Crop placement. + if img.scale_mode == ImageScaleMode::Tile { + continue; + } + let Some(data) = doc.images.get(&img.image) else { continue }; + let (iw, ih) = (f64::from(data.width), f64::from(data.height)); + let crop = if img.scale_mode == ImageScaleMode::Crop { + img.effective_crop(iw, ih, w, h) + } else { + let (rw, rh) = img.rotated_size(iw.max(1.0), ih.max(1.0)); + let s = if img.scale_mode == ImageScaleMode::Fit { (w / rw).min(h / rh) } else { (w / rw).max(h / rh) }; + [w / (rw * s), 0.0, 0.0, h / (rh * s), (rw * s - w) / (2.0 * rw * s), (rh * s - h) / (2.0 * rh * s)] + }; + img.crop = Some((Affine::new(crop) * to_old).as_coeffs()); + img.scale_mode = ImageScaleMode::Crop; + } + doc.get_mut(*id)?.fills = fills; + } doc.set_world_transform(*id, t)?; if kept.is_empty() { crate::cmd::props::resize_node(doc, *id, nw.max(0.01), nh.max(0.01))?; diff --git a/crates/engine/src/transform_behaviour_tests.rs b/crates/engine/src/transform_behaviour_tests.rs index 47270a42d..250b7da1f 100644 --- a/crates/engine/src/transform_behaviour_tests.rs +++ b/crates/engine/src/transform_behaviour_tests.rs @@ -98,6 +98,187 @@ const ALT: Mods = Mods { shift: false, alt: true, cmd: false }; const BOTH: Mods = Mods { shift: true, alt: true, cmd: false }; const CMD: Mods = Mods { shift: false, alt: false, cmd: true }; +/// An asymmetric synthetic image: every column is different, so recentering is visible. +fn image_layer(s: &mut Session) -> NodeId { + use base64::Engine as _; + let image = image::RgbaImage::from_fn(200, 100, |x, y| image::Rgba([x as u8, y as u8, 120, 255])); + let mut bytes = std::io::Cursor::new(Vec::new()); + image.write_to(&mut bytes, image::ImageFormat::Png).unwrap(); + id(&ex( + s, + "file.import", + json!({"data": base64::engine::general_purpose::STANDARD.encode(bytes.into_inner()), "name": "crop.png", "x": 0, "y": 0}), + )) +} + +#[test] +fn command_resize_crops_image_pixels_and_round_trips() { + let mut s = session(); + let layer = image_layer(&mut s); + let original = s.doc().unwrap().clone(); + let before = figcraft_render::render_node(&original, layer, 1.0).unwrap(); + let steps = undo_steps(&s); + // Public crop documentation: Command (macOS) / Ctrl (elsewhere) quickly crops an image. + // Moving the right edge must keep the left half's pixels, not recenter or scale them. + s.pointer(&ev(PointerKind::Down, Point::new(200.0, 50.0), CMD)).unwrap(); + for x in [150.0, 100.0] { + s.pointer(&ev(PointerKind::Move, Point::new(x, 50.0), CMD)).unwrap(); + } + s.pointer(&ev(PointerKind::Up, Point::new(100.0, 50.0), CMD)).unwrap(); + assert_eq!(size(&s, layer), (100.0, 100.0)); + let after = figcraft_render::render_node(s.doc().unwrap(), layer, 1.0).unwrap(); + for y in 0..100usize { + assert_eq!(&after.data()[y * 400..(y + 1) * 400], &before.data()[y * 800..y * 800 + 400], "row {y}: the image stays put"); + } + assert_eq!(s.doc().unwrap().images, original.images, "cropping keeps the source bytes"); + assert_eq!(undo_steps(&s), steps + 1); + let cropped = s.doc().unwrap().clone(); + ex(&mut s, "edit.undo", json!({})); + assert_eq!(s.doc().unwrap(), &original); + ex(&mut s, "edit.redo", json!({})); + assert_eq!(s.doc().unwrap(), &cropped); + let path = std::env::temp_dir().join(format!("figcraft-command-crop-{}.figcraft", std::process::id())); + ex(&mut s, "file.saveAs", json!({"path": path})); + let mut reopened = session(); + ex(&mut reopened, "file.open", json!({"path": path})); + assert_eq!(reopened.doc().unwrap().node(layer), cropped.node(layer)); + assert_eq!(reopened.doc().unwrap().images, cropped.images); + assert_eq!(figcraft_render::render_node(reopened.doc().unwrap(), layer, 1.0).unwrap().data(), after.data()); + std::fs::remove_file(path).unwrap(); +} + +#[test] +fn command_crop_keeps_image_placement_in_the_layers_axes() { + use figcraft_doc::color::{ImageScaleMode, PaintKind}; + use figcraft_geom::Affine; + // Each row exercises a distinct placement: Fill, Fit, and an existing affine Crop. + // Geometry follows the existing resize rules; image pixels stay fixed in page space. + let rows = [ + ("fill", None, 0.0, Point::new(0.0, 50.0), Point::new(40.0, 50.0), CMD, (40.0, 0.0, 160.0, 150.0)), + ("fit", None, 30.0, Point::new(100.0, 0.0), Point::new(100.0, 20.0), CMD, (0.0, 20.0, 200.0, 130.0)), + ("fill", None, 0.0, Point::new(0.0, 50.0), Point::new(240.0, 50.0), CMD, (240.0, 0.0, 40.0, 150.0)), + ( + "crop", + Some([0.8, 0.1, -0.2, 0.9, 0.1, 0.05]), + 30.0, + Point::new(200.0, 150.0), + Point::new(150.0, 112.5), + Mods { alt: true, ..CMD }, + (50.0, 37.5, 100.0, 75.0), + ), + ]; + for (mode, crop, angle, from, to, mods, (x, y, w, h)) in rows { + let mut s = session(); + let layer = image_layer(&mut s); + let mut fills = s.doc().unwrap().node(layer).unwrap().fills.clone(); + let PaintKind::Image(img) = &mut fills[0].kind else { panic!("image fill") }; + img.scale_mode = match mode { + "fit" => ImageScaleMode::Fit, + "crop" => ImageScaleMode::Crop, + _ => ImageScaleMode::Fill, + }; + img.crop = crop; + set(&mut s, &[layer], json!({"height": 150, "rotation": angle, "fills": fills})); + let doc = s.doc().unwrap(); + let world = doc.world_transform(layer); + let n = doc.node(layer).unwrap(); + let old_crop = crop.unwrap_or(if mode == "fit" { [1.0, 0.0, 0.0, 1.5, 0.0, -0.25] } else { [2.0 / 3.0, 0.0, 0.0, 1.0, 1.0 / 6.0, 0.0] }); + let old_mapping = Affine::new(old_crop) * Affine::scale_non_uniform(1.0 / n.width, 1.0 / n.height) * world.inverse(); + drag(&mut s, world * from, world * to, mods); + let doc = s.doc().unwrap(); + let n = doc.node(layer).unwrap(); + assert!(near(n.width, w) && near(n.height, h), "{mode}: crop box size"); + assert!((doc.world_transform(layer) * Point::ZERO - world * Point::new(x, y)).hypot() < 1e-6, "{mode}: crop box anchor"); + let PaintKind::Image(img) = &n.fills[0].kind else { panic!("image fill") }; + assert_eq!(img.scale_mode, ImageScaleMode::Crop, "{mode}"); + let mapping = + Affine::new(img.crop.unwrap()) * Affine::scale_non_uniform(1.0 / n.width, 1.0 / n.height) * doc.world_transform(layer).inverse(); + for p in [Point::ZERO, Point::new(80.0, 60.0), Point::new(170.0, 90.0)] { + assert!((mapping * p - old_mapping * p).hypot() < 1e-6, "{mode}: same page point samples the same source pixel"); + } + } +} + +#[test] +fn ordinary_resize_and_scale_keep_image_fill_settings() { + for (tool, cmd, ctrl) in [("move", false, false), ("move", false, true), ("scale", true, false)] { + let mut s = session(); + let layer = image_layer(&mut s); + let fills = s.doc().unwrap().node(layer).unwrap().fills.clone(); + ex(&mut s, "tool.set", json!({"tool": tool})); + let to = Point::new(100.0, 50.0); + for (kind, p) in [(PointerKind::Down, Point::new(200.0, 100.0)), (PointerKind::Move, to), (PointerKind::Up, to)] { + let mut event = ev(kind, p, Mods { cmd, ..NONE }); + event.ctrl = ctrl; + s.pointer(&event).unwrap(); + } + assert_eq!(s.doc().unwrap().node(layer).unwrap().fills, fills, "{tool}, cmd={cmd}, ctrl={ctrl}"); + assert_eq!(size(&s, layer), (100.0, 50.0)); + } +} + +#[test] +fn command_crop_preserves_each_image_fill_and_leaves_tiles() { + use figcraft_doc::color::{Color, ImageScaleMode, Paint, PaintKind}; + let mut s = session(); + let layer = image_layer(&mut s); + let image = s.doc().unwrap().node(layer).unwrap().fills[0].clone(); + let mut rotated = image.clone(); + rotated.opacity = 0.4; + let PaintKind::Image(img) = &mut rotated.kind else { panic!("image fill") }; + img.rotation = 1; + let mut tile = image.clone(); + let PaintKind::Image(img) = &mut tile.kind else { panic!("image fill") }; + img.scale_mode = ImageScaleMode::Tile; + let mut expected = vec![Paint::solid(Color::from_rgba8(20, 40, 60, 255)), rotated, image, tile]; + set(&mut s, &[layer], json!({"fills": expected})); + drag(&mut s, Point::new(200.0, 50.0), Point::new(100.0, 50.0), CMD); + for (i, crop) in [(1, [0.5, 0.0, 0.0, 0.25, 0.0, 0.375]), (2, [0.5, 0.0, 0.0, 1.0, 0.0, 0.0])] { + let PaintKind::Image(img) = &mut expected[i].kind else { panic!("image fill") }; + img.scale_mode = ImageScaleMode::Crop; + img.crop = Some(crop); + } + assert_eq!(s.doc().unwrap().node(layer).unwrap().fills, expected); +} + +#[test] +fn command_resize_leaves_fills_when_text_or_auto_layout_recomputes_the_box() { + for case in ["text", "child", "frame"] { + let mut s = session(); + let image = image_layer(&mut s); + let fills = s.doc().unwrap().node(image).unwrap().fills.clone(); + let layer = match case { + "text" => id(&ex( + &mut s, + "text.create", + json!({"text": "hello world hello world hello world", "props": { + "width": 200, "height": 100, "fontSize": 24, "textAutoResize": "none", "fills": fills + }}), + )), + _ => { + let frame = id(&ex(&mut s, "frame.create", json!({"x": 0, "y": 0, "width": 200, "height": 100}))); + set(&mut s, &[frame], json!({"layout": "horizontal", "padding": 20})); + if case == "child" { + ex(&mut s, "node.reparent", json!({"ids": [image], "parent": frame})); + set(&mut s, &[image], json!({"minWidth": 150})); + image + } else { + set(&mut s, &[frame], json!({"fills": fills})); + frame + } + } + }; + ex(&mut s, "select.set", json!({"ids": [layer]})); + let doc = s.doc().unwrap(); + let world = doc.world_transform(layer); + let n = doc.node(layer).unwrap(); + let from = world * Point::new(n.width, n.height / 2.0); + let to = world * Point::new(10.0, n.height / 2.0); + drag(&mut s, from, to, CMD); + assert_eq!(s.doc().unwrap().node(layer).unwrap().fills, fills, "{case}: keep the existing resize behaviour"); + } +} + #[test] fn handle_drags_resize_by_the_documented_rules() { // A 100×50 box; (handle, pointer in the box's axes, modifiers, new box x0 y0 x1 y1, derivation). diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 62001715e..faeb7430e 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-10-15 · **Change:** minor (fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (Command/Ctrl image crop; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **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: @@ -88,6 +88,7 @@ interaction feel not yet compared. | Text on a path (Figma Draw) | done | put on from the Design panel or `text.onPath`, not by clicking a path with the Text tool; the path is edited by resizing only | | Stretch and scatter brushes (Figma Draw) | done | eight presets drawn in code; the Pencil's brush is set by `tool.pencilBrush`, not from the toolbar | | Image crop handles | done | | +| Command/Ctrl-resize to crop image fills | partial | The Move tool crops Fill/Fit/Crop image fills on a single non-text layer outside auto layout, keeping image scale and position. Text, auto-layout contexts and Tile retain their existing resize behaviour (`transform_behaviour_tests`) | ## Canvas @@ -166,6 +167,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| +| 2026-10-16 | minor | Command/Ctrl-resize crops image fills without moving or scaling their source pixels; one undo step, saved with the document. Single non-text layers outside auto layout; Tile excluded. Estimates unchanged. | | 2026-10-15 | minor | Hex fields take CSS colour names (`red` → `FF0000`): fills, strokes, effects, grids, variables, backgrounds and the colour picker | | 2026-10-15 | minor | Typography: drag the line-height, letter-spacing and paragraph-spacing icons to scrub their values; shared numeric-field rates, resize cursor and one Undo step per gesture (#373). | | 2026-10-15 | minor | A click or Tab into a one-line field selects all of its text (hex, inline, name, search and dialog fields); the first click into a fill's hex takes the keyboard | From b0f56ed1698b94d31ec6e6b9f2dcf0a1b21a40a5 Mon Sep 17 00:00:00 2001 From: sushi-killer <46325863+sushi-killer@users.noreply.github.com> Date: Fri, 16 Oct 2026 23:19:32 +0300 Subject: [PATCH 092/817] fix(server): let message limits follow max_file_mb so files above 64 MiB publish and open --- apps/figcraft-server/src/config.rs | 26 ++++++++++++++---------- apps/figcraft-server/src/public_tests.rs | 18 +++++++++++++++- crates/collab-net/src/limits.rs | 6 ++++-- docs/server.md | 4 ++-- 4 files changed, 38 insertions(+), 16 deletions(-) diff --git a/apps/figcraft-server/src/config.rs b/apps/figcraft-server/src/config.rs index bd587b767..3e951e875 100644 --- a/apps/figcraft-server/src/config.rs +++ b/apps/figcraft-server/src/config.rs @@ -253,8 +253,9 @@ impl Config { } } - /// Largest message a client may send when open to the public: a whole file (or plugin bundle) - /// and a margin, not the core's 64 MiB. + /// Largest message a client may send: a whole file (or plugin bundle) and a margin. Open to the + /// public this is also the cap (strangers' files stay small); a private server never goes below + /// the core's 64 MiB, and a `max_file_mb` above it raises the cap with it. fn open_message(&self) -> usize { usize::try_from(self.file_mb().max(self.max_plugin_mb).saturating_add(1).saturating_mul(1 << 20)).unwrap_or(usize::MAX) } @@ -265,9 +266,9 @@ impl Config { fn core(&self) -> figcraft_collab::Limits { let base = figcraft_collab::Limits { max_peers: self.max_people, ..figcraft_collab::Limits::default() }; if !self.open_publish { - return base; + return figcraft_collab::Limits { max_message_bytes: base.max_message_bytes.max(self.open_message()), ..base }; } - let max = self.open_message().min(base.max_message_bytes); + let max = self.open_message(); let file = usize::try_from(self.file_mb().saturating_mul(1 << 20)).unwrap_or(usize::MAX); figcraft_collab::Limits { max_message_bytes: max, max_log_bytes: (file / 4).max(256 << 10), ..base } } @@ -279,21 +280,24 @@ impl Config { pub fn net(&self) -> NetLimits { let base = NetLimits { max_connections: self.max_connections, trusted_proxy: self.proxy().ok().flatten(), ..NetLimits::default() }; if !self.open_publish { - return base; + let max = base.max_client_message.max(self.open_message()); + return NetLimits { max_client_message: max, max_queued_bytes: base.max_queued_bytes.max(max.saturating_add(1 << 20)), ..base }; } - let max = self.open_message().min(base.max_client_message); + let max = self.open_message(); // Shared budgets: one block of addresses (an IPv4 address, an IPv6 /48) gets at most an - // eighth of each, and its biggest consumers are dropped first. - let (queued, reading) = (256usize << 20, 192usize << 20); + // eighth of each, and its biggest consumers are dropped first. Each still fits one whole + // message, or a file as large as `max_file_mb` could never arrive. + let one = max.saturating_add(1 << 20); + let (queued, reading) = ((256usize << 20).max(one.saturating_mul(8)), (192usize << 20).max(one.saturating_mul(8))); NetLimits { max_per_address: self.max_connections_per_ip, max_client_message: max, - max_queued_bytes: max.saturating_add(1 << 20), + max_queued_bytes: one, max_queued_block: queued / 8, max_queued_total: queued, - max_reading_block: max.saturating_add(1 << 20).min(reading / 8), + max_reading_block: one.min(reading / 8), max_reading_total: reading, - max_in_flight: 128 << 20, + max_in_flight: (128usize << 20).max(one), reserve_for_sessions: self.max_connections / 8, request_idle: std::time::Duration::from_secs(20), ..base diff --git a/apps/figcraft-server/src/public_tests.rs b/apps/figcraft-server/src/public_tests.rs index fea2667e9..d93dbe3ed 100644 --- a/apps/figcraft-server/src/public_tests.rs +++ b/apps/figcraft-server/src/public_tests.rs @@ -413,7 +413,7 @@ fn open_mode_has_safe_defaults_and_warns_the_operator() { assert_eq!(open.net().request_idle, Duration::from_secs(20), "idle one-shot requests go quickly"); assert_eq!(open.net().reserve_for_sessions, 512 / 8); assert_eq!(open.net().max_client_message, 17 << 20); - assert_eq!(private.net().max_client_message, NetLimits::default().max_client_message, "unchanged when private"); + assert_eq!(private.net().max_client_message, 65 << 20, "private: a 64 MiB file and a margin"); let w = open.warnings().join("\n"); assert!(w.contains("operator_contact is empty") && w.contains("trusted_proxy"), "{w}"); let set = Config { operator_contact: "abuse@example.com".into(), trusted_proxy: Some("127.0.0.1".into()), max_file_mb: Some(8), ..open }; @@ -493,3 +493,19 @@ fn open_connections_never_reach_what_needs_the_key() { assert!(!format!("{info:?}").contains(&k)); server.stop(); } + +#[test] +fn files_above_64_mib_fit_every_limit() { + // `max_file_mb` may go up to 4096: every cap a whole file's message meets on its way in must + // follow it, or the upload is dropped by the transport before the server can say why. + for open_publish in [false, true] { + let cfg = Config { open_publish, max_file_mb: Some(256), public_url: Some("wss://figcraft.example.com/".into()), ..Config::default() }; + let (net, core, file) = (cfg.net(), cfg.store().core, 256usize << 20); + assert!(net.max_client_message > file, "open={open_publish}: {}", net.max_client_message); + assert!(net.max_queued_bytes > file && net.max_reading_block > file && net.max_in_flight > file, "open={open_publish}: {net:?}"); + assert!(net.max_reading_total >= net.max_reading_block && net.max_queued_total >= net.max_queued_block); + assert!(core.max_message_bytes > file, "open={open_publish}: {}", core.max_message_bytes); + } + // A client takes the largest file any server can keep. + assert!(NetLimits::default().max_server_message > 4096 << 20); +} diff --git a/crates/collab-net/src/limits.rs b/crates/collab-net/src/limits.rs index c31118767..42756b1eb 100644 --- a/crates/collab-net/src/limits.rs +++ b/crates/collab-net/src/limits.rs @@ -12,7 +12,9 @@ pub struct NetLimits { /// before: its hello. pub max_client_message: usize, pub max_hello: usize, - /// Largest message a client accepts from the host (a welcome carries the whole document). + /// Largest message a client accepts from the host (a welcome carries the whole document): the + /// largest file a `figcraft-server` can be set to keep (`max_file_mb`, at most 4096) and a margin, + /// so a client can open every file a server takes. pub max_server_message: usize, /// Messages a client may send per second on average, and in a burst; beyond that it is /// disconnected. @@ -61,7 +63,7 @@ impl Default for NetLimits { max_connections: 64, max_client_message: figcraft_collab::Limits::default().max_message_bytes, max_hello: 64 << 10, - max_server_message: figcraft_collab::Limits::default().max_message_bytes, + max_server_message: 4097 << 20, rate: 100.0, burst: 400.0, hello_timeout: Duration::from_secs(10), diff --git a/docs/server.md b/docs/server.md index f2e4820ca..55d784f43 100644 --- a/docs/server.md +++ b/docs/server.md @@ -282,7 +282,7 @@ are errors): | `data` | `figcraft-data` | The data directory | | `public_url` | (the listen address) | How links name the server, when people reach it another way (a reverse proxy: `wss://figcraft.example.com/`) | | `max_files` | 1000 | Most files kept | -| `max_file_mb` | 64 (16 when open) | Largest file (its snapshot), in MiB; a welcome carries the whole file, and messages are at most 64 MiB | +| `max_file_mb` | 64 (16 when open) | Largest file (its snapshot), in MiB; a welcome carries the whole file, so messages may be as large as a file and 1 MiB (at least 64 MiB on a private server) | | `max_links` | 100 | Most share links per file | | `max_connections` | 512 | Most open connections | | `max_people` | 256 | Most people in one file at once | @@ -489,7 +489,7 @@ are larger. | Resource | Limit | |---|---| -| Message size | A file's size and 1 MiB (`max_file_mb`, 16 by default when open, or `max_plugin_mb` if larger): checked as the message is read, before anything is decoded; 64 KiB on a connection that only browses plugins (a client sending more is disconnected with the limit as the reason; the app keeps its own copy). The core's 64 MiB otherwise | +| Message size | A file's size and 1 MiB (`max_file_mb`, 16 by default when open, or `max_plugin_mb` if larger): checked as the message is read, before anything is decoded; 64 KiB on a connection that only browses plugins (a client sending more is disconnected with the limit as the reason; the app keeps its own copy). On a private server, the larger of that and the core's 64 MiB | | A file as it grows | Every batch is checked first (*always*): past `max_file_mb`, past its publisher's `max_mb_per_ip` or past `max_total_mb`, it is refused with the reason and the app rolls it back. A long log is compacted to make room at most once a minute per file (a compaction rewrites the whole file). A file's snapshot also holds the recent batches kept for reconnecting clients, at most a quarter of `max_file_mb` | | Recent batches in memory | A quarter of `max_file_mb` (256 KiB at least) per open file; older ones are dropped (a client that missed them catches up with the whole file) | | Bytes queued for slow clients | The largest message and 1 MiB per connection, 32 MiB per block of addresses, 256 MiB for everyone. A message sent to many people counts once for everyone and once per block (twenty colleagues behind one office address cost their block one copy of a broadcast), and welcomes (bounded by the file's size) don't count against blocks, so a whole office can join a file at once. A client that doesn't read its answers is dropped; when everyone's budget runs out, the connection holding the most is dropped | From 3b5c5d563b18c2d329ed2f4e92b8c3de87071d72 Mon Sep 17 00:00:00 2001 From: Ahmed5Emad Date: Fri, 16 Oct 2026 23:27:45 +0300 Subject: [PATCH 093/817] Palette follows the bar: toggle, dismiss, no invented icons The Actions button toggles (re-click and Cmd+K close), reads on in accent blue with a white icon while open, and a press anywhere outside closes the panel in one click. The opening press is spared once (the spare expires on press-free frames); presses on the button itself never dismiss, so the release toggles cleanly shut instead of reopening. Rows drop the per-family icons (labels + right-side hints only); plugins and widgets keep their letter tiles. The panel anchors to the canvas centre at the toolbar pill's exact width (toolbar::main_width), at a fixed size, with inset hover pills and larger section titles. Tests: one-click dismiss pinned (palette_tests). --- crates/ui-egui/src/control.rs | 1 + crates/ui-egui/src/lib.rs | 15 ++++++-- crates/ui-egui/src/menus.rs | 22 +++++++++--- crates/ui-egui/src/palette_tests.rs | 53 ++++++++++++++++++++++++++++- crates/ui-egui/src/toolbar.rs | 20 +++++++++-- 5 files changed, 101 insertions(+), 10 deletions(-) diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rs index 9dd8e2f4b..6e55c8a4a 100644 --- a/crates/ui-egui/src/control.rs +++ b/crates/ui-egui/src/control.rs @@ -416,6 +416,7 @@ pub fn handle(app: &mut FigApp, ctx: &Context, method: &str, p: &Value) -> Resul if let Some(h) = p.get("palette").and_then(Value::as_bool) { app.ui.palette = if h { Some(String::new()) } else { None }; app.ui.palette_tab = crate::menus::PaletteTab::All; + app.ui.palette_armed = true; } // true / false, or a top-level menu to open it at ("Plugins"). match p.get("mainMenu") { diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 468303165..34f6ac0d2 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -408,6 +408,10 @@ pub struct UiState { pub palette: Option, /// The Actions palette's tab. pub palette_tab: menus::PaletteTab, + /// The palette ignores one outside click after opening (the click that opened it). + pub palette_armed: bool, + /// This frame's Actions toolbar button rect: presses on it toggle, never dismiss. + pub actions_rect: Option, /// The Variables editor, when open. pub variables: Option, pub about: bool, @@ -538,6 +542,8 @@ impl Default for UiState { main_menu: false, palette: None, palette_tab: menus::PaletteTab::All, + palette_armed: false, + actions_rect: None, variables: None, about: false, about_tab: dialogs::AboutTab::About, @@ -794,8 +800,13 @@ impl FigApp { "dialog.preferences" => self.ui.preferences = true, "panel.shortcuts" => self.ui.shortcuts_panel = !self.ui.shortcuts_panel, "palette.actions" => { - self.ui.palette = Some(String::new()); - self.ui.palette_tab = menus::PaletteTab::All; + if self.ui.palette.is_some() { + self.ui.palette = None; + } else { + self.ui.palette = Some(String::new()); + self.ui.palette_tab = menus::PaletteTab::All; + self.ui.palette_armed = true; + } } "panel.design" => self.ui.right_tab = RightTab::Design, "panel.prototype" => self.ui.right_tab = RightTab::Prototype, diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 0e0793139..a95fe2fda 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -651,6 +651,18 @@ fn palette(app: &mut FigApp, ctx: &egui::Context) { ); let mut run: Option = None; let mut close = false; + // A press anywhere outside closes the panel. The opening press is spared once, and the + // spare expires the first frame without a press (so the next outside press always closes). + let pressed = ctx.input(|i| i.pointer.any_pressed()); + if pressed && !std::mem::replace(&mut app.ui.palette_armed, false) { + let on_toggle = app.ui.actions_rect.is_some_and(|b| ctx.input(|i| i.pointer.hover_pos().is_some_and(|p| b.contains(p)))); + let outside = !on_toggle && ctx.input(|i| i.pointer.hover_pos().map(|p| !area.contains(p)).unwrap_or(false)); + if outside { + close = true; + } + } else if !pressed { + app.ui.palette_armed = false; + } egui::Area::new(Id::new("palette")).fixed_pos(area.min).order(egui::Order::Foreground).show( ctx, |ui| { @@ -830,9 +842,9 @@ pub(crate) struct ActionRow { /// A section header with its rows. fn section(ui: &mut Ui, t: &Tokens, name: &str, rows: impl FnOnce(&mut Ui)) { - ui.add_space(6.0); - ui.painter().text(pos2(ui.min_rect().min.x + 10.0, ui.cursor().min.y + 7.0), Align2::LEFT_TOP, name, regular(11.0), t.text_secondary); - ui.add_space(18.0); + ui.add_space(10.0); + ui.painter().text(pos2(ui.min_rect().min.x + 10.0, ui.cursor().min.y + 8.0), Align2::LEFT_TOP, name, regular(12.5), t.text_secondary); + ui.add_space(22.0); rows(ui); } @@ -841,8 +853,10 @@ fn section(ui: &mut Ui, t: &Tokens, name: &str, rows: impl FnOnce(&mut Ui)) { fn draw_row(ui: &mut Ui, t: &Tokens, row: &ActionRow) -> bool { let w = ui.available_width(); let (r, resp) = ui.allocate_exact_size(vec2(w, 34.0), Sense::click()); + // The hover pill stays inside the row: it never touches the panel's edges. + let pill = r.shrink2(vec2(4.0, 1.0)); if resp.hovered() { - ui.painter().rect_filled(r, CornerRadius::same(6), t.hover); + ui.painter().rect_filled(pill, CornerRadius::same(6), t.hover); } let mut label_x = r.min.x + 10.0; if let Some(letter) = row.tile { diff --git a/crates/ui-egui/src/palette_tests.rs b/crates/ui-egui/src/palette_tests.rs index e496cb77b..06e9fdf5c 100644 --- a/crates/ui-egui/src/palette_tests.rs +++ b/crates/ui-egui/src/palette_tests.rs @@ -1,7 +1,10 @@ //! The Actions palette, driven headless: invoking records recents (newest first, capped), -//! sections group commands by menu, the query filters, and gone entries drop out of Recents. +//! sections group commands by menu, the query filters, gone entries drop out of Recents, a used +//! plugin resolves back to a row, and a press outside the panel closes it. +use egui::Pos2; use figcraft_engine::Session; +use serde_json::json; use crate::layers_drag_tests::Ui; @@ -58,3 +61,51 @@ fn gone_entries_drop_out_of_recents() { assert!(crate::menus::recent_row(&u.app, "plugin:nope.nope/nope", "").is_none(), "gone plugins drop out"); assert!(crate::menus::recent_row(&u.app, "widget:nope", "").is_none(), "gone widgets drop out"); } + +/// A used plugin (API 4, several commands) resolves back to a Recents row. +#[test] +fn used_plugin_resolves_to_a_recent_row() { + let mut u = Ui::new(Session::new()); + let plugin: figcraft_engine::plugins::InstalledPlugin = serde_json::from_value(json!({ + "manifest": { + "id": "dev.local.solar-icons", + "name": "Solar icons", + "main": "solar_icons.wasm", + "api": 4, + "commands": [ + {"id": "panel", "label": "Panel"}, + {"id": "grid", "label": "Grid"}, + ], + }, + })) + .unwrap(); + u.app.session.prefs.plugins.push(plugin); + crate::menus::record_recent(&mut u.app, "plugin:dev.local.solar-icons/panel"); + let row = crate::menus::recent_row(&u.app, "plugin:dev.local.solar-icons/panel", "") + .expect("a used plugin stays in Recents"); + assert_eq!(row.label, "Solar icons — Panel"); + assert!(crate::menus::recent_row(&u.app, "plugin:dev.local.solar-icons/panel", "zzz").is_none(), "the query filters recents"); +} + +/// A press outside the panel closes it; the opening press is spared once. +#[test] +fn outside_press_closes_the_panel() { + let mut u = Ui::new(Session::new()); + u.app.ui.palette = Some(String::new()); + u.app.ui.palette_armed = true; + // The opening press: spared, and disarmed. + u.button(Pos2::new(720.0, 20.0), true); + u.button(Pos2::new(720.0, 20.0), false); + assert!(u.app.ui.palette.is_some(), "the opening press is spared"); + // The next press outside: closed. + u.button(Pos2::new(720.0, 20.0), true); + u.button(Pos2::new(720.0, 20.0), false); + assert!(u.app.ui.palette.is_none(), "an outside press closes the panel"); + // One click is enough: the spare expires on frames without a press. + u.app.ui.palette = Some(String::new()); + u.app.ui.palette_armed = true; + u.frame(vec![]); + u.button(Pos2::new(720.0, 20.0), true); + u.button(Pos2::new(720.0, 20.0), false); + assert!(u.app.ui.palette.is_none(), "a single outside press closes the panel"); +} diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index 0aef7555c..962b74972 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -57,6 +57,7 @@ fn remembered(ui: &Ui, key: &str, default: ToolId) -> ToolId { pub fn show(app: &mut FigApp, ui: &mut Ui) { let t = Tokens::get(ui.ctx()); let canvas = app.canvas.rect; + app.ui.actions_rect = None; // A file you can't edit now (view only, or on its way to a server): moving around only. if let Some(why) = app.session.active_read_only() { view_only_toolbar(app, ui, why); @@ -138,13 +139,26 @@ fn main_toolbar(app: &mut FigApp, ui: &mut Ui, canvas: Rect, t: &Tokens) { ] { let r = Rect::from_center_size(pos2(x + cell / 2.0, cy), vec2(cell, cell)); let resp = ui.interact(r, ui.id().with(id), Sense::click()).tip(tip); - if resp.hovered() { + if id == "actions" { + app.ui.actions_rect = Some(r); + } + // The Actions button reads on while its panel is open; clicking it again closes it. + let actions_open = id == "actions" && app.ui.palette.is_some(); + if actions_open { + ui.painter().rect_filled(r, CornerRadius::same(5), ACCENT); + } else if resp.hovered() { ui.painter().rect_filled(r, CornerRadius::same(5), t.hover); } - icons::paint(ui.painter(), r.shrink(7.0), icon, t.icon); + icons::paint(ui.painter(), r.shrink(7.0), icon, if actions_open { Color32::WHITE } else { t.icon }); if resp.clicked() { if id == "actions" { - app.ui.palette = Some(String::new()); + if app.ui.palette.is_some() { + app.ui.palette = None; + } else { + app.ui.palette = Some(String::new()); + app.ui.palette_tab = crate::menus::PaletteTab::All; + app.ui.palette_armed = true; + } } else { app.ui.left_tab = crate::LeftTab::Assets; app.ui.left_collapsed = false; From 1b4db719576965d13e8ec39e319ef2e4ae67dc85 Mon Sep 17 00:00:00 2001 From: sushi-killer <46325863+sushi-killer@users.noreply.github.com> Date: Sat, 17 Oct 2026 00:37:55 +0300 Subject: [PATCH 094/817] fix(collab-net): keep the client's message cap in range on 32-bit targets --- apps/figcraft-server/src/public_tests.rs | 6 ++++-- crates/collab-net/src/limits.rs | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/figcraft-server/src/public_tests.rs b/apps/figcraft-server/src/public_tests.rs index d93dbe3ed..6403212c4 100644 --- a/apps/figcraft-server/src/public_tests.rs +++ b/apps/figcraft-server/src/public_tests.rs @@ -506,6 +506,8 @@ fn files_above_64_mib_fit_every_limit() { assert!(net.max_reading_total >= net.max_reading_block && net.max_queued_total >= net.max_queued_block); assert!(core.max_message_bytes > file, "open={open_publish}: {}", core.max_message_bytes); } - // A client takes the largest file any server can keep. - assert!(NetLimits::default().max_server_message > 4096 << 20); + // A client takes the largest file any server can keep, or as much as a 32-bit target can address + // (computed in u64: `4097 << 20` in a 32-bit usize wraps to 1 MiB). + let client = NetLimits::default().max_server_message as u64; + assert!(client > 4096 << 20 || client == u64::from(u32::MAX), "{client}"); } diff --git a/crates/collab-net/src/limits.rs b/crates/collab-net/src/limits.rs index 42756b1eb..021677703 100644 --- a/crates/collab-net/src/limits.rs +++ b/crates/collab-net/src/limits.rs @@ -14,7 +14,8 @@ pub struct NetLimits { pub max_hello: usize, /// Largest message a client accepts from the host (a welcome carries the whole document): the /// largest file a `figcraft-server` can be set to keep (`max_file_mb`, at most 4096) and a margin, - /// so a client can open every file a server takes. + /// so a client can open every file a server takes; on a 32-bit target (the browser) as much as + /// `usize` holds. pub max_server_message: usize, /// Messages a client may send per second on average, and in a burst; beyond that it is /// disconnected. @@ -63,7 +64,7 @@ impl Default for NetLimits { max_connections: 64, max_client_message: figcraft_collab::Limits::default().max_message_bytes, max_hello: 64 << 10, - max_server_message: 4097 << 20, + max_server_message: usize::try_from(4097u64 << 20).unwrap_or(usize::MAX), rate: 100.0, burst: 400.0, hello_timeout: Duration::from_secs(10), From 9e2596e97524951b6c93e038d5a03c252322fed2 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Fri, 16 Oct 2026 22:09:53 +0000 Subject: [PATCH 095/817] Skip layers with children in vector.offset Found while testing crates/engine/src/cmd/structure.rs:575 Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/engine/src/cmd/structure.rs | 4 ++++ crates/engine/src/tests.rs | 38 ++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/crates/engine/src/cmd/structure.rs b/crates/engine/src/cmd/structure.rs index bed70d3df..6829595c2 100644 --- a/crates/engine/src/cmd/structure.rs +++ b/crates/engine/src/cmd/structure.rs @@ -556,6 +556,10 @@ fn offset_path(s: &mut Session, p: &Value) -> Result { for i in req_targets("vector.offset", s, p)? { let doc = s.doc_mut()?; let n = doc.get(i)?.clone(); + // A vector can't hold children: leave containers (frames, groups, instances) alone. + if !n.children.is_empty() { + continue; + } let Some((path, _)) = figcraft_render::node_outline(doc, &n) else { continue }; let props = StrokeProps { weight: d.abs() * 2.0, join: StrokeJoin::Round, align: StrokeAlign::Center, ..Default::default() }; let ring = figcraft_pathops::stroke_center(&path, d.abs() * 2.0, &props); diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index dbf432d41..746f417ed 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -621,3 +621,41 @@ fn find_replace_changing_only_the_case_replaces_every_occurrence() { assert_eq!(s.doc().unwrap().node(t).unwrap().kind.text().unwrap().characters, "FigCraft and FigCraft, FigCraft"); assert_eq!(s.doc().unwrap().node(f).unwrap().name, "FigCraft / FigCraft"); } + +/// No node that holds children may be a non-container. +fn assert_children_only_in_containers(s: &Session, ids: &[NodeId]) { + let doc = s.doc().unwrap(); + for &i in ids { + let n = doc.node(i).unwrap(); + assert!(n.kind.is_container() || n.kind.is_frame_like() || n.children.is_empty(), "a non-container layer now holds children"); + } +} + +#[test] +fn offset_path_leaves_containers_with_children_alone() { + let mut s = sess(); + let f = id(&s.execute("frame.create", &json!({"x": 0, "y": 0, "width": 100, "height": 100})).unwrap()); + let inner = id(&s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 10, "height": 10, "parent": f})).unwrap()); + let a = id(&s.execute("shape.rectangle", &json!({"x": 200, "y": 0, "width": 10, "height": 10})).unwrap()); + let b = id(&s.execute("shape.rectangle", &json!({"x": 220, "y": 0, "width": 10, "height": 10})).unwrap()); + let g = id(&s.execute("object.group", &json!({"ids": [a, b]})).unwrap()); + for target in [f, g] { + s.execute("vector.offset", &json!({"ids": [target], "offset": 5})).unwrap(); + assert_children_only_in_containers(&s, &[f, g, inner, a, b]); + } + let doc = s.doc().unwrap(); + assert!(doc.node(f).unwrap().kind.is_container()); + assert_eq!(doc.node(f).unwrap().children, vec![inner]); + assert!(doc.node(g).unwrap().kind.is_container()); + assert_eq!(doc.node(g).unwrap().children.len(), 2); +} + +#[test] +fn offset_path_still_converts_a_plain_rectangle() { + let mut s = sess(); + let r = id(&s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap()); + s.execute("vector.offset", &json!({"ids": [r], "offset": 5})).unwrap(); + let n = s.doc().unwrap().node(r).unwrap().clone(); + assert!(matches!(n.kind, NodeKind::Vector { .. })); + assert!(n.width > 10.0); +} From 8a77ef6759158f97d1768a367726f50541adccf9 Mon Sep 17 00:00:00 2001 From: timrrrr <54307723+timrrrr@users.noreply.github.com> Date: Sat, 17 Oct 2026 01:18:07 +0300 Subject: [PATCH 096/817] M1: preserve image fills with variable-bound resize dimensions --- ROADMAP.md | 3 +- crates/engine/src/tools.rs | 7 ++-- .../engine/src/transform_behaviour_tests.rs | 39 +++++++++++++++++++ docs/ui-parity.md | 5 ++- 4 files changed, 48 insertions(+), 6 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 82d48ca25..f9754a2d6 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (Command/Ctrl image crop; bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (variable-bound sizes retain existing resize behaviour during Command/Ctrl image crop; Command/Ctrl image crop; bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -131,6 +131,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). ## Progress log +- **2026-10-17** · Command/Ctrl image crop excludes variable-bound width/height (including `w`/`h` aliases), preserving the existing resize behaviour when normalization restores the bound size. Other bindings still allow crop; pixel and binding regressions cover both dimensions and ordinary resize. Estimates unchanged. - **2026-10-16** · Command/Ctrl-resize with the Move tool crops image fills on a single non-text layer outside auto layout, keeping their scale and position and the original image bytes. Fill/Fit/Crop, rotated layers and image fills, undo and native save/reopen are covered by regression tests. Text, auto-layout contexts, Tile and the Scale tool keep their existing behaviour. Estimates unchanged. - **2026-10-14** · Corner handles win over the corner-radius handles (M1, #292): a press on the inner half of a corner handle's square picked the radius handle 10 px in, so the drag neither resized nor (dragging outward) rounded anything. Inside the drawn square the corner now resizes both sides (in ratio with Shift or the link); further in the radius handle still answers. Regression test in the transform behaviour suite. Numbers unchanged. diff --git a/crates/engine/src/tools.rs b/crates/engine/src/tools.rs index fea703b93..fe5025816 100644 --- a/crates/engine/src/tools.rs +++ b/crates/engine/src/tools.rs @@ -1559,14 +1559,15 @@ impl Session { if flip_y { t *= Affine::new([1.0, 0.0, 0.0, -1.0, 0.0, nh]); } - // Text reflow and auto layout can recompute this box after the preview. + // Text reflow, size bindings and auto layout can recompute this box after the preview. + let n = doc.get(*id)?; let crop_images = ev.cmd - && !matches!(doc.get(*id)?.kind, NodeKind::Text(_)) + && !matches!(n.kind, NodeKind::Text(_)) + && !n.bound.keys().any(|field| matches!(field.as_str(), "width" | "height" | "w" | "h")) && !std::iter::once(*id).chain(doc.ancestors(*id)).any(|a| doc.node(a).is_some_and(|n| n.layout.is_some())); if crop_images { // Crop the layer's image fills without moving their pixels on the page. // Work from the interaction snapshot, just like the geometry on every move. - let n = doc.get(*id)?; let (w, h) = (n.width.max(1e-6), n.height.max(1e-6)); let to_old = Affine::scale_non_uniform(1.0 / w, 1.0 / h) * world.inverse() * t * Affine::scale_non_uniform(nw.max(0.01), nh.max(0.01)); diff --git a/crates/engine/src/transform_behaviour_tests.rs b/crates/engine/src/transform_behaviour_tests.rs index 250b7da1f..146bdfd66 100644 --- a/crates/engine/src/transform_behaviour_tests.rs +++ b/crates/engine/src/transform_behaviour_tests.rs @@ -279,6 +279,45 @@ fn command_resize_leaves_fills_when_text_or_auto_layout_recomputes_the_box() { } } +#[test] +fn image_crop_respects_variable_bound_dimensions() { + for (field, value, from, to) in [ + ("width", 200, Point::new(200.0, 50.0), Point::new(100.0, 50.0)), + ("height", 100, Point::new(100.0, 100.0), Point::new(100.0, 50.0)), + ("w", 200, Point::new(200.0, 50.0), Point::new(100.0, 50.0)), + ("h", 100, Point::new(100.0, 100.0), Point::new(100.0, 50.0)), + ("opacity", 100, Point::new(200.0, 50.0), Point::new(100.0, 50.0)), + ] { + for mods in [CMD, NONE] { + let mut s = session(); + let layer = image_layer(&mut s); + ex(&mut s, "variable.createCollection", json!({"name": "Tokens"})); + ex(&mut s, "variable.create", json!({"collection": "Tokens", "name": "bound", "type": "number", "value": value})); + ex(&mut s, "variable.bind", json!({"ids": [layer], "field": field, "variable": "bound"})); + let before = s.doc().unwrap().clone(); + let pixels = figcraft_render::render_node(&before, layer, 1.0).unwrap(); + drag(&mut s, from, to, mods); + let doc = s.doc().unwrap(); + let n = doc.node(layer).unwrap(); + assert_eq!(n.bound, before.node(layer).unwrap().bound, "{field}: keep the binding"); + assert_eq!(doc.variables, before.variables, "{field}: do not edit the variable"); + let after = figcraft_render::render_node(doc, layer, 1.0).unwrap(); + if field != "opacity" { + assert_eq!((n.width, n.height), (200.0, 100.0), "{field}: the binding restores the size"); + assert!(after.data() == pixels.data(), "{field}, cmd={}: restored bounds must not stretch a partial crop", mods.cmd); + } else if mods.cmd { + assert_eq!((n.width, n.height), (100.0, 100.0)); + for y in 0..100usize { + assert_eq!(&after.data()[y * 400..(y + 1) * 400], &pixels.data()[y * 800..y * 800 + 400], "opacity binding still allows crop"); + } + } + if field != "opacity" || !mods.cmd { + assert_eq!(n.fills, before.node(layer).unwrap().fills, "{field}: keep the existing resize behaviour"); + } + } + } +} + #[test] fn handle_drags_resize_by_the_documented_rules() { // A 100×50 box; (handle, pointer in the box's axes, modifiers, new box x0 y0 x1 y1, derivation). diff --git a/docs/ui-parity.md b/docs/ui-parity.md index faeb7430e..4eff3aac6 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-10-16 · **Change:** minor (Command/Ctrl image crop; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (variable-bound sizes retain existing resize behaviour during Command/Ctrl image crop; Command/Ctrl image crop; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **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: @@ -88,7 +88,7 @@ interaction feel not yet compared. | Text on a path (Figma Draw) | done | put on from the Design panel or `text.onPath`, not by clicking a path with the Text tool; the path is edited by resizing only | | Stretch and scatter brushes (Figma Draw) | done | eight presets drawn in code; the Pencil's brush is set by `tool.pencilBrush`, not from the toolbar | | Image crop handles | done | | -| Command/Ctrl-resize to crop image fills | partial | The Move tool crops Fill/Fit/Crop image fills on a single non-text layer outside auto layout, keeping image scale and position. Text, auto-layout contexts and Tile retain their existing resize behaviour (`transform_behaviour_tests`) | +| Command/Ctrl-resize to crop image fills | partial | The Move tool crops Fill/Fit/Crop image fills on a single non-text layer outside auto layout, keeping image scale and position. Text, variable-bound width/height, auto-layout contexts and Tile retain their existing resize behaviour (`transform_behaviour_tests`) | ## Canvas @@ -167,6 +167,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Command/Ctrl image crop leaves fills unchanged when width or height has a variable binding (including `w`/`h` aliases); normalization may restore those dimensions after preview. Other bindings still allow crop. Regression covers pixels, binding preservation and ordinary resize. Estimates unchanged. | | 2026-10-16 | minor | Command/Ctrl-resize crops image fills without moving or scaling their source pixels; one undo step, saved with the document. Single non-text layers outside auto layout; Tile excluded. Estimates unchanged. | | 2026-10-15 | minor | Hex fields take CSS colour names (`red` → `FF0000`): fills, strokes, effects, grids, variables, backgrounds and the colour picker | | 2026-10-15 | minor | Typography: drag the line-height, letter-spacing and paragraph-spacing icons to scrub their values; shared numeric-field rates, resize cursor and one Undo step per gesture (#373). | From a9bcc48df7bc96f8428c312b77aff9c53740e36b Mon Sep 17 00:00:00 2001 From: sushi-killer <46325863+sushi-killer@users.noreply.github.com> Date: Sat, 17 Oct 2026 01:45:08 +0300 Subject: [PATCH 097/817] feat(web): join a live session from ?join= in the page URL --- apps/figcraft-web/src/main.rs | 9 ++++++++- apps/figcraft-web/src/query.rs | 10 ++++++++++ apps/figcraft-web/src/query_tests.rs | 21 +++++++++++++++++++++ apps/figcraft-web/src/web.rs | 8 +++++++- 4 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 apps/figcraft-web/src/query.rs create mode 100644 apps/figcraft-web/src/query_tests.rs diff --git a/apps/figcraft-web/src/main.rs b/apps/figcraft-web/src/main.rs index 587fd60b8..35aebb02e 100644 --- a/apps/figcraft-web/src/main.rs +++ b/apps/figcraft-web/src/main.rs @@ -13,8 +13,15 @@ //! (browsers block `ws://` from secure pages); serve it over `http://` on a trusted network to //! join from other machines. //! -//! URL query flag: `?webgl` forces the WebGL2 backend instead of WebGPU. +//! URL query: `?webgl` forces the WebGL2 backend instead of WebGPU; `?join=` joins that live session once the page has loaded, so a bookmark opens a shared file. +//! `join` takes the rest of the query: put it last. The link carries the session's secret, so the +//! URL (and the browser history) is as private as the link itself. +#[cfg(any(target_arch = "wasm32", test))] +mod query; +#[cfg(test)] +mod query_tests; #[cfg(target_arch = "wasm32")] mod web; diff --git a/apps/figcraft-web/src/query.rs b/apps/figcraft-web/src/query.rs new file mode 100644 index 000000000..be68f598b --- /dev/null +++ b/apps/figcraft-web/src/query.rs @@ -0,0 +1,10 @@ +//! The page's URL query: which flags it sets and the invite link it names. + +/// The invite link in `?join=` (`search` is `location.search`, with or without its `?`), still +/// escaped. `join` takes the rest of the query, so a pasted `figcraft://join?host=…&file=…&token=…` +/// keeps its own `&`s; put it last. +pub fn join_link(search: &str) -> Option<&str> { + let query = search.strip_prefix('?').unwrap_or(search); + let start = if query.starts_with("join=") { 0 } else { query.find("&join=")? + 1 }; + query.get(start + "join=".len()..).filter(|link| !link.is_empty()) +} diff --git a/apps/figcraft-web/src/query_tests.rs b/apps/figcraft-web/src/query_tests.rs new file mode 100644 index 000000000..9582682f2 --- /dev/null +++ b/apps/figcraft-web/src/query_tests.rs @@ -0,0 +1,21 @@ +//! `?join=` in the page's URL. + +use crate::query::join_link; + +#[test] +fn join_takes_the_rest_of_the_query() { + let link = "figcraft://join?host=192.168.1.20:47900&file=abc&token=AbCdEfGhIjKlMnOpQrStUv"; + assert_eq!(join_link(&format!("?join={link}")), Some(link), "a pasted link keeps its own &s"); + assert_eq!(join_link(&format!("?webgl&join={link}")), Some(link), "after other flags"); + assert_eq!(join_link("?join=figcraft%3A%2F%2Fjoin%3Fhost%3Dh"), Some("figcraft%3A%2F%2Fjoin%3Fhost%3Dh"), "escaped, decoded later"); + assert_eq!(join_link("join=K7M-2QX-9TD"), Some("K7M-2QX-9TD"), "a join code, no leading ?"); +} + +#[test] +fn no_join_without_the_parameter() { + assert_eq!(join_link(""), None); + assert_eq!(join_link("?webgl"), None); + assert_eq!(join_link("?join="), None); + assert_eq!(join_link("?rejoin=x"), None, "only the whole parameter name"); + assert_eq!(join_link("?xjoin=x&a=1"), None); +} diff --git a/apps/figcraft-web/src/web.rs b/apps/figcraft-web/src/web.rs index 8cadb0138..d3c164411 100644 --- a/apps/figcraft-web/src/web.rs +++ b/apps/figcraft-web/src/web.rs @@ -40,7 +40,13 @@ pub fn start() { // on the socket wakes the page for a frame. let ctx = cc.egui_ctx.clone(); session.live.install(Box::new(figcraft_collab_net::NetLink::new(std::sync::Arc::new(move || ctx.request_repaint())))); - let fig = FigApp::new(session, Box::new(WebServices { reduce_motion, ctx: cc.egui_ctx.clone() })); + let mut fig = FigApp::new(session, Box::new(WebServices { reduce_motion, ctx: cc.egui_ctx.clone() })); + // `?join=`: join that session, as opening an invite link does on the desktop. + let search = query(); + if let Some(link) = crate::query::join_link(&search) { + let link = js_sys::decode_uri_component(link).ok().and_then(|s| s.as_string()).unwrap_or_else(|| link.to_string()); + figcraft_ui_egui::live::open_invite(&mut fig, &link); + } Ok(Box::new(WebShell { fig })) }), ) From e409f9efc0c5ef98b430e4e66263021478bac046 Mon Sep 17 00:00:00 2001 From: timrrrr <54307723+timrrrr@users.noreply.github.com> Date: Sat, 17 Oct 2026 01:48:50 +0300 Subject: [PATCH 098/817] M1: retain GitHub username for contributor credit --- contributors/people.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/contributors/people.toml b/contributors/people.toml index 1d6cd8b76..bc8cf71bb 100644 --- a/contributors/people.toml +++ b/contributors/people.toml @@ -44,6 +44,3 @@ sync_github_name = true [people.volkovskey] real_name = "Andrii Volkov" - -[people.timrrrr] -display_name = "Timur" From ce472a251cf8e739ce2756594600fb8ca030e30f Mon Sep 17 00:00:00 2001 From: Ismael Trejo Date: Fri, 16 Oct 2026 16:40:27 -0700 Subject: [PATCH 099/817] fix(doc): thin strokes take a double-click a few pixels away (#646) A 1 px Line or stroke-only path only counted as hit within 2 screen pixels, so a double-click slightly off it cleared the selection and never entered vector edit mode, and Cmd/Ctrl could not bend it. Strokes with nothing filled now reach 5 screen pixels; filled shapes keep the plain tolerance. --- crates/doc/src/geometry.rs | 10 ++++- crates/engine/src/vector_behaviour_tests.rs | 44 +++++++++++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/crates/doc/src/geometry.rs b/crates/doc/src/geometry.rs index 06596ddcd..2a7b42a64 100644 --- a/crates/doc/src/geometry.rs +++ b/crates/doc/src/geometry.rs @@ -51,6 +51,10 @@ pub fn is_closed(n: &Node) -> bool { } } +/// How much further than `tol` a stroke with nothing filled reaches: a thin line or stroke-only path +/// is hard to land on with the plain tolerance, so it gets a wider band (5 screen px for the usual 2 px tolerance). +const STROKE_REACH: f64 = 2.5; + /// Whether `pt` hits `n` itself; in `outline` mode (nothing filled on the canvas) a shape only where /// its outline is. fn hits_node_itself(doc: &Document, id: NodeId, n: &Node, pt: Point, tol: f64, outline: bool) -> bool { @@ -62,7 +66,7 @@ fn hits_node_itself(doc: &Document, id: NodeId, n: &Node, pt: Point, tol: f64, o NodeKind::Group | NodeKind::BooleanOp { .. } | NodeKind::Page { .. } => false, NodeKind::Text(_) | NodeKind::Slice => n.local_rect().inflate(tol_l, tol_l).contains(lp), NodeKind::Line => { - let half = (n.stroke.weight / 2.0).max(tol_l); + let half = (n.stroke.weight / 2.0).max(tol_l * STROKE_REACH); lp.x >= -half && lp.x <= n.width + half && lp.y.abs() <= half } NodeKind::Frame | NodeKind::Component { .. } | NodeKind::ComponentSet { .. } | NodeKind::Instance { .. } | NodeKind::Section { .. } => { @@ -78,7 +82,9 @@ fn hits_path(n: &Node, path: &BezPath, lp: Point, tol: f64, inside: bool) -> boo if inside && (n.fills.iter().any(|f| f.visible) || !n.has_visible_stroke()) { return true; } - let reach = (n.stroke.max_weight() / 2.0).max(tol); + // Only a stroke with nothing filled gets the wider band: a filled shape's edge keeps the plain one. + let stroke_only = n.has_visible_stroke() && !n.fills.iter().any(|f| f.visible); + let reach = (n.stroke.max_weight() / 2.0).max(if stroke_only { tol * STROKE_REACH } else { tol }); if !path.bounding_box().inflate(reach, reach).contains(lp) { return false; } diff --git a/crates/engine/src/vector_behaviour_tests.rs b/crates/engine/src/vector_behaviour_tests.rs index 0c472eccd..8899dc4e0 100644 --- a/crates/engine/src/vector_behaviour_tests.rs +++ b/crates/engine/src/vector_behaviour_tests.rs @@ -133,6 +133,50 @@ fn entering_and_leaving_vector_edit_mode() { assert!(matches!(s.doc().unwrap().node(id).unwrap().kind, NodeKind::Rectangle), "converting is one undo step"); } +#[test] +fn thin_strokes_are_easy_to_enter_and_bend() { + use crate::tools::ToolId; + // A diagonal line from (100, 100) to (200, 50); `off` steps away from its middle, square to it. + let at = |off: f64| (150.0 + off * 50.0 / 125f64.sqrt() / 10.0, 75.0 + off * 100.0 / 125f64.sqrt() / 10.0); + // (layer, screen px off the stroke, in edit mode after a double-click, derivation) + let rows: Vec<(&str, f64, bool, &str)> = vec![ + ("line", 0.0, true, "double-clicking a selected line edits it as a vector"), + ("line", 4.0, true, "a 1 px line reaches a few pixels, so a double-click near it still lands (#646)"), + ("line", 8.0, false, "a double-click well away from it does not"), + ("path", 4.0, true, "a stroke-only path reaches as far as a line does"), + ("path", 8.0, false, "and no further"), + ]; + for (layer, off, after, why) in rows { + let mut s = Session::new(); + let id = if layer == "line" { + s.set_tool(ToolId::Line); + drag(&mut s, (100.0, 100.0), (200.0, 50.0), NONE); + *s.selection().first().unwrap() + } else { + let id = id_of(&ex(&mut s, "vector.create", json!({"points": [[100, 100], [200, 50]], "closed": false}))["id"]).unwrap(); + // Styled like a pen stroke: 1 px, no fill. + ex(&mut s, "node.set", json!({"ids": [id], "props": {"fills": [], "strokes": ["#000000"], "strokeWeight": 1}})); + s.set_selection(vec![id]); + id + }; + assert!(!s.doc().unwrap().node(id).unwrap().fills.iter().any(|f| f.visible), "{why}: the {layer} only has a stroke"); + let p = at(off); + click(&mut s, p, NONE); + s.pointer(&ev(PointerKind::Down, p, NONE)).unwrap(); + s.pointer(&ev(PointerKind::DoubleClick, p, NONE)).unwrap(); + s.pointer(&ev(PointerKind::Up, p, NONE)).unwrap(); + assert_eq!(editing(&s).is_some(), after, "{why}"); + if after { + // Cmd/Ctrl then bends it through the pointer. + drag(&mut s, at(0.0), (170.0, 115.0), Mods { cmd: true, ..NONE }); + let w = s.doc().unwrap().world_transform(id); + let n = net(&s, id); + assert!(!n.segments[0].is_straight(), "{why}: Cmd/Ctrl bends it"); + assert!((w * n.cubic(0).unwrap().eval(0.5) - Point::new(170.0, 115.0)).hypot() < 1.0, "{why}: through the pointer"); + } + } +} + #[test] fn the_pen_follows_the_documented_rules() { let mut s = Session::new(); From 9f52819fe9877421876fe42e401ceed7c3c97fc6 Mon Sep 17 00:00:00 2001 From: RealtaNua Date: Sat, 17 Oct 2026 08:35:03 +0700 Subject: [PATCH 100/817] fix(ui): Shift+Cmd/Ctrl+V pastes over the selection and Alt+Cmd/Ctrl+V pastes properties (#716) egui-winit swallows every Cmd/Ctrl+V press, Shift or Alt held or not, and sends a paste event only for text. Shift+Cmd+V and Alt+Cmd+V became a plain paste (text) or did nothing (image). The keymap now decides what a swallowed chord means, from the modifiers tracked in the raw events: its paste event or its release runs paste over or paste properties instead. In the browser the key press runs the command, and the paste event no longer pastes its text as well. Co-Authored-By: Claude Opus 5.5 (1M context) --- crates/ui-egui/src/lib.rs | 7 +- crates/ui-egui/src/paste_image_tests.rs | 152 ++++++++++++++++++++++ crates/ui-egui/src/shortcuts.rs | 73 ++++++++--- crates/ui-egui/src/web_clipboard_tests.rs | 66 ++++++++++ 4 files changed, 279 insertions(+), 19 deletions(-) diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 9fbd17cc4..a64ef6a81 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -502,6 +502,8 @@ pub struct UiState { pub paste_event: bool, /// The window got the focus back since the last V release. pub refocused: bool, + /// The modifiers held, as of the last raw event that told: a paste event doesn't carry them. + pub held: egui::Modifiers, /// When (UI clock, seconds) open documents next get an autosave checkpoint. pub next_autosave: f64, /// With auto-save on: when (UI clock, seconds) files with unsaved changes are next saved, and @@ -598,6 +600,7 @@ impl Default for UiState { v_pressed: false, paste_event: false, refocused: false, + held: egui::Modifiers::NONE, next_autosave: 0.0, auto_save_at: None, auto_saving: Vec::new(), @@ -1294,7 +1297,7 @@ impl FigApp { // even if it lets go during the frame (Enter commits it), or as it began (egui drops the // focus on Escape before the frame, which cancels the field's edit and nothing else). let typing = std::mem::take(&mut self.field_focus) || a11y::field_focused(&ctx); - let paste_release = shortcuts::swallowed_paste(self, &ctx); + let swallowed = shortcuts::swallowed_paste(self, &ctx); // A dialog that closed acts first, in the window it was opened from. self.poll_dialog(&ctx); // Control requests run first so their results reflect this frame. @@ -1410,7 +1413,7 @@ impl FigApp { branch_ui::keys(self, &ctx); live::dialog_keys(self, &ctx); dialogs::keys(self, &ctx); - shortcuts::handle(self, &ctx, typing, paste_release); + shortcuts::handle(self, &ctx, typing, swallowed); menus::popups(self, &ctx); variable_ui::picker(self, &ctx); style_picker::show(self, &ctx); diff --git a/crates/ui-egui/src/paste_image_tests.rs b/crates/ui-egui/src/paste_image_tests.rs index fa797fb92..23cec8ea3 100644 --- a/crates/ui-egui/src/paste_image_tests.rs +++ b/crates/ui-egui/src/paste_image_tests.rs @@ -6,11 +6,25 @@ use std::cell::RefCell; use std::rc::Rc; use egui::{Event, Key, Modifiers, PointerButton, Pos2, RawInput, Rect, Shape, vec2}; +use figcraft_doc::NodeId; use figcraft_engine::Session; use serde_json::json; use crate::{FigApp, Services}; +/// What the system clipboard holds when a paste chord is pressed (#716). +#[derive(Clone, Copy, Debug)] +enum Held { + /// FigCraft's own copy (its SVG text). + Ours, + /// Text copied in another app. + Text, + /// An image copied in another app. + Image, +} + +const HELD: [Held; 3] = [Held::Ours, Held::Text, Held::Image]; + #[derive(Default)] struct Clip { text: Option, @@ -87,6 +101,55 @@ impl Win { self.frame(vec![]); } + /// A Cmd/Ctrl+V chord with its modifiers, as egui-winit delivers it: they go down first, the V + /// press brings a paste event only for text, its release comes as a key event, then they're + /// let go. + fn chord(&mut self, m: Modifiers) { + let text = self.clip.borrow().text.clone().filter(|t| !t.is_empty()); + self.frame(vec![Event::ModifiersChanged(m)]); + self.frame(text.map(Event::Paste).into_iter().collect()); + self.frame(vec![key(Key::V, false, m)]); + self.frame(vec![Event::ModifiersChanged(Modifiers::NONE)]); + } + + /// A red rectangle A copied in FigCraft, and a grey rectangle B selected; then `held` on the + /// system clipboard. Returns (A, B). + fn copy_a_select_b(&mut self, held: Held) -> (NodeId, NodeId) { + let s = &mut self.app.session; + let a = s.doc().unwrap().nodes().find(|n| n.name == "Rectangle").unwrap().id; + s.execute("fill.set", &json!({"ids": [a.0], "color": "#e53935"})).unwrap(); + let b = s.execute("shape.rectangle", &json!({"x": 400, "y": 250, "width": 100, "height": 50})).unwrap(); + let b = NodeId(b["id"].as_u64().unwrap()); + s.execute("select.set", &json!({"ids": [a.0]})).unwrap(); + crate::menus::invoke(&mut self.app, "edit.copy"); + self.app.session.execute("edit.copyProperties", &json!({})).unwrap(); + self.app.session.execute("select.set", &json!({"ids": [b.0]})).unwrap(); + match held { + Held::Ours => {} + Held::Text => self.clip.borrow_mut().text = Some("hello from another app".into()), + Held::Image => self.copy_image_elsewhere(), + } + (a, b) + } + + fn fill(&self, id: NodeId) -> String { + let n = figcraft_engine::inspect::node_json(self.app.session.doc().unwrap(), id, 0); + n["fills"][0]["color"].as_str().unwrap_or_default().to_string() + } + + /// Top-lefts of the rectangles other than `b`. + fn rects_besides(&self, b: NodeId) -> Vec<(i64, i64)> { + let doc = self.app.session.doc().unwrap(); + let mut at: Vec<_> = doc + .nodes() + .filter(|n| n.name == "Rectangle" && n.id != b) + .filter_map(|n| doc.world_bounds(n.id)) + .map(|r| (r.x0.round() as i64, r.y0.round() as i64)) + .collect(); + at.sort(); + at + } + fn named(&self, name: &str) -> usize { self.app.session.doc().unwrap().nodes().filter(|n| n.name == name).count() } @@ -256,3 +319,92 @@ fn paste_here_prefers_a_newer_image_over_copied_layers() { let b = doc.world_bounds(img.id).unwrap(); assert!((b.x0 - p.x).abs() < 0.01 && (b.y0 - p.y).abs() < 0.01, "top-left where the menu opened: {b:?} vs {p:?}"); } + +#[test] +fn shift_cmd_v_pastes_over_the_selection_whatever_the_clipboard_holds() { + for held in HELD { + let mut w = Win::new(); + let (_, b) = w.copy_a_select_b(held); + w.chord(CMD.plus(Modifiers::SHIFT)); + assert_eq!(w.rects_besides(b), [(10, 10), (400, 250)], "{held:?}: A's copy at B's top-left, nothing else"); + assert_eq!(w.texts(), 0, "{held:?}: no text pasted"); + assert_eq!(w.named("Pasted image"), 0, "{held:?}: no image pasted"); + } +} + +#[test] +fn alt_cmd_v_pastes_properties_whatever_the_clipboard_holds() { + for held in HELD { + let mut w = Win::new(); + let (_, b) = w.copy_a_select_b(held); + w.chord(CMD.plus(Modifiers::ALT)); + assert_eq!(w.fill(b), "#E53935", "{held:?}: B took A's fill"); + assert_eq!(w.rects_besides(b), [(10, 10)], "{held:?}: no layer pasted"); + assert_eq!(w.texts(), 0, "{held:?}: no text pasted"); + assert_eq!(w.named("Pasted image"), 0, "{held:?}: no image pasted"); + } +} + +#[test] +fn a_chord_let_go_within_one_frame_still_reads_its_modifiers() { + let mut w = Win::new(); + let (_, b) = w.copy_a_select_b(Held::Text); + let m = CMD.plus(Modifiers::SHIFT); + w.frame(vec![ + Event::ModifiersChanged(m), + Event::Paste("hello from another app".into()), + key(Key::V, false, m), + Event::ModifiersChanged(Modifiers::NONE), + ]); + w.frame(vec![]); + assert_eq!(w.rects_besides(b), [(10, 10), (400, 250)]); + assert_eq!(w.texts(), 0); +} + +#[test] +fn cmd_let_go_before_v_still_pastes_over() { + let mut w = Win::new(); + let (_, b) = w.copy_a_select_b(Held::Image); + w.frame(vec![Event::ModifiersChanged(CMD.plus(Modifiers::SHIFT))]); + w.frame(vec![Event::ModifiersChanged(Modifiers::SHIFT)]); + w.frame(vec![key(Key::V, false, Modifiers::SHIFT)]); + w.frame(vec![Event::ModifiersChanged(Modifiers::NONE)]); + assert_eq!(w.rects_besides(b), [(10, 10), (400, 250)], "pasted over, not flipped or a plain paste"); + assert_eq!(w.named("Pasted image"), 0); +} + +#[test] +fn a_held_chord_pastes_over_once() { + let mut w = Win::new(); + let (_, b) = w.copy_a_select_b(Held::Text); + let m = CMD.plus(Modifiers::SHIFT); + w.frame(vec![Event::ModifiersChanged(m)]); + // Auto-repeat: egui-winit sends a paste event for every repeated press. + for _ in 0..3 { + w.frame(vec![Event::Paste("hello from another app".into())]); + } + w.frame(vec![key(Key::V, false, m)]); + w.frame(vec![Event::ModifiersChanged(Modifiers::NONE)]); + assert_eq!(w.rects_besides(b), [(10, 10), (400, 250)]); + assert_eq!(w.texts(), 0); +} + +#[test] +fn shift_insert_still_pastes_text() { + let mut w = Win::new(); + let (_, b) = w.copy_a_select_b(Held::Text); + w.frame(vec![Event::ModifiersChanged(Modifiers::SHIFT), Event::Paste("hello from another app".into())]); + w.frame(vec![key(Key::Insert, false, Modifiers::SHIFT), Event::ModifiersChanged(Modifiers::NONE)]); + assert_eq!(w.texts(), 1); + assert_eq!(w.rects_besides(b), [(10, 10)]); +} + +#[test] +fn cmd_v_after_a_paste_chord_is_a_plain_paste_again() { + let mut w = Win::new(); + let (_, b) = w.copy_a_select_b(Held::Text); + w.chord(CMD.plus(Modifiers::SHIFT)); + w.chord(CMD); + assert_eq!(w.texts(), 1, "the text was pasted by the plain Cmd+V"); + assert_eq!(w.rects_besides(b), [(10, 10), (400, 250)], "Shift+Cmd+V pasted over once"); +} diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index f28a24335..57295c229 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -94,8 +94,8 @@ fn cached_tip(label: &'static str, key: Option<&'static str>) -> &'static str { /// Run the shortcuts this frame's keys press. `typing`: a field had the keyboard when the frame /// began. -/// `paste_release`: this frame released a Cmd/Ctrl+V the shell swallowed ([`swallowed_paste`]). -pub fn handle(app: &mut FigApp, ctx: &Context, typing: bool, paste_release: bool) { +/// `swallowed`: what this frame's Cmd/Ctrl+V chords the shell swallowed ask for ([`swallowed_paste`]). +pub fn handle(app: &mut FigApp, ctx: &Context, typing: bool, swallowed: Swallowed) { note_platform(ctx); // Text fields in panels own the keyboard (also the key that ends their editing). if typing || crate::a11y::field_focused(ctx) || app.ui.palette.is_some() { @@ -113,16 +113,18 @@ pub fn handle(app: &mut FigApp, ctx: &Context, typing: bool, paste_release: bool // An image-only clipboard brings no paste event: paste from the key then. The browser sends // the press; the desktop shell swallows it and sends only the release. let paste_event = events.iter().any(|e| matches!(e, Event::Paste(_))); - let paste_key = events.iter().any(|e| matches!(e, Event::Key { key: Key::V, pressed: true, repeat: false, modifiers, .. } if modifiers.command && !modifiers.shift && !modifiers.alt)); - if (paste_key && !paste_event) || paste_release { - crate::menus::paste(app, None, None); + let paste_key = events.iter().any(|e| matches!(e, Event::Key { key: Key::V, pressed: true, repeat: false, modifiers, .. } if modifiers.command && v_binding(*modifiers) == Some("edit.paste"))); + match swallowed.run.or((paste_key && !paste_event).then_some("edit.paste")) { + Some("edit.paste") => crate::menus::paste(app, None, None), + Some(id) => run_binding(app, id), + None => {} } let now = ctx.input(|i| i.time); for ev in &events { match ev { Event::Copy => crate::menus::invoke(app, "edit.copy"), Event::Cut => crate::menus::invoke(app, "edit.cut"), - Event::Paste(text) => crate::menus::paste(app, Some(text), None), + Event::Paste(text) if !swallowed.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) => { @@ -133,23 +135,59 @@ pub fn handle(app: &mut FigApp, ctx: &Context, typing: bool, paste_release: bool } } -/// Whether this frame releases a Cmd/Ctrl+V whose press never arrived and that brought no paste -/// event: egui-winit swallows the press and sends a paste event only when the clipboard holds -/// text, so an image on the clipboard leaves just this release. Call at the start of every frame: -/// it reads the raw events, which keys consumed by panels or the presenter still carry. -pub fn swallowed_paste(app: &mut FigApp, ctx: &Context) -> bool { +/// The command Cmd/Ctrl+V runs with `m` held too: `edit.paste`, `edit.pasteOver` (Shift), +/// `edit.pasteProperties` (Alt), or `None` for a chord nothing is bound to. The keymap decides, +/// whether the key press arrived (browser) or only a paste event and the release (desktop). +fn v_binding(m: Modifiers) -> Option<&'static str> { + lookup(keymap::Context::Canvas, Key::V, Some(Key::V), Modifiers { command: true, ..m }).map(|b| b.id) +} + +/// What this frame's Cmd/Ctrl+V chords ask for when the desktop shell swallowed their press +/// ([`swallowed_paste`]). +#[derive(Clone, Copy, Default)] +pub struct Swallowed { + /// The command to run ([`v_binding`]). + pub run: Option<&'static str>, + /// This frame's paste event belongs to another command or an unbound chord: its text isn't + /// pasted. + pub drop_text: bool, +} + +/// egui-winit swallows every Cmd/Ctrl+V press, Shift or Alt held or not, and sends a paste event +/// only when the clipboard holds text. So a chord brings a paste event (text) or just its release +/// (an image, or nothing). The browser sends the press as well, which runs the command itself. +/// Call at the start of every frame: it reads the raw events, which keys consumed by panels or the +/// presenter still carry. +pub fn swallowed_paste(app: &mut FigApp, ctx: &Context) -> Swallowed { let ui = &mut app.ui; - let mut paste = false; + let mut out = Swallowed::default(); ctx.input(|i| { for ev in &i.raw.events { + if let Event::Key { modifiers, .. } = ev { + ui.held = *modifiers; + } match ev { + Event::ModifiersChanged(m) => ui.held = *m, + // Without Cmd/Ctrl held it's another paste key (Shift+Insert, a Paste key). + Event::Paste(_) if ui.held.command => { + let id = v_binding(ui.held); + if id != Some("edit.paste") { + out.drop_text = true; + // Held down, the chord repeats its paste event: run once, as keys do. + if !ui.v_pressed && !ui.paste_event { + out.run = out.run.or(id); + } + } + ui.paste_event = true; + } Event::Paste(_) => ui.paste_event = true, Event::Key { key: Key::V, pressed: true, .. } => ui.v_pressed = true, Event::Key { key: Key::V, pressed: false, modifiers, .. } => { - // Shift or Alt with it is another command (paste over, paste properties). A V - // held while the window was away comes back as a release alone: without Cmd - // held, that's no paste. - paste = !ui.v_pressed && !ui.paste_event && !modifiers.shift && !modifiers.alt && (modifiers.command || !ui.refocused); + // Cmd was down when V went down, maybe let go first. A V held while the window + // was away comes back as a release alone: without Cmd held, that's no paste. + if !ui.v_pressed && !ui.paste_event && (modifiers.command || !ui.refocused) { + out.run = out.run.or(v_binding(*modifiers)); + } ui.v_pressed = false; ui.paste_event = false; ui.refocused = false; @@ -160,13 +198,14 @@ pub fn swallowed_paste(app: &mut FigApp, ctx: &Context) -> bool { Event::WindowFocused(false) => { ui.v_pressed = false; ui.paste_event = false; + ui.held = Modifiers::NONE; } Event::WindowFocused(true) => ui.refocused = true, _ => {} } } }); - paste + out } /// Run the command a shortcut is bound to, with the keyboard's own twists (Escape steps out diff --git a/crates/ui-egui/src/web_clipboard_tests.rs b/crates/ui-egui/src/web_clipboard_tests.rs index a77871204..26389ff48 100644 --- a/crates/ui-egui/src/web_clipboard_tests.rs +++ b/crates/ui-egui/src/web_clipboard_tests.rs @@ -86,6 +86,26 @@ impl Page { self.frame(vec![Self::key(Key::V, false)]); } + /// Cmd+V with `m` added, as the browser delivers it: the key press, then the paste event. + fn chord(&mut self, m: Modifiers) { + let m = m | Modifiers::MAC_CMD | Modifiers::COMMAND; + let v = |pressed| Event::Key { key: Key::V, physical_key: Some(Key::V), pressed, repeat: false, modifiers: m }; + let text = self.clipboard.clone(); + self.frame(vec![Event::ModifiersChanged(m), v(true), Event::Paste(text)]); + self.frame(vec![v(false)]); + self.frame(vec![Event::ModifiersChanged(Modifiers::NONE)]); + } + + /// Copy the selected rectangle A (made red) and its properties, then select a new rectangle B. + fn copy_a_select_b(&mut self) -> figcraft_doc::NodeId { + self.app.session.execute("fill.set", &json!({"color": "#e53935"})).unwrap(); + self.copy(); + self.app.session.execute("edit.copyProperties", &json!({})).unwrap(); + let b = self.app.session.execute("shape.rectangle", &json!({"x": 400, "y": 250, "width": 100, "height": 50})).unwrap(); + self.app.session.execute("select.set", &json!({"ids": [b["id"]]})).unwrap(); + figcraft_doc::NodeId(b["id"].as_u64().unwrap()) + } + fn count(&self, kind: fn(&NodeKind) -> bool) -> usize { self.app.session.doc().unwrap().nodes().filter(|n| kind(&n.kind)).count() } @@ -121,6 +141,52 @@ fn text_copied_elsewhere_after_our_copy_still_pastes_as_text() { assert_eq!(p.count(text), 1, "newer text from elsewhere becomes a text layer"); } +#[test] +fn shift_cmd_v_pastes_over_once_and_no_text() { + for foreign in [false, true] { + let mut p = Page::new(); + let b = p.copy_a_select_b(); + if foreign { + p.clipboard = "hello from another app".into(); + } + p.chord(Modifiers::SHIFT); + assert_eq!(p.count(rect), 3, "foreign text {foreign}: one copy pasted over B"); + assert_eq!(p.count(text), 0, "foreign text {foreign}: the paste event pasted nothing"); + let doc = p.app.session.doc().unwrap(); + let over = doc.nodes().filter(|n| n.id != b).filter_map(|n| doc.world_bounds(n.id)).any(|r| r.x0 == 400.0 && r.y0 == 250.0); + assert!(over, "foreign text {foreign}: the copy sits at B's top-left"); + } +} + +#[test] +fn alt_cmd_v_pastes_properties_once_and_no_text() { + for foreign in [false, true] { + let mut p = Page::new(); + let b = p.copy_a_select_b(); + if foreign { + p.clipboard = "hello from another app".into(); + } + p.chord(Modifiers::ALT); + assert_eq!(p.count(rect), 2, "foreign text {foreign}: no layer pasted"); + assert_eq!(p.count(text), 0, "foreign text {foreign}: the paste event pasted nothing"); + let fill = figcraft_engine::inspect::node_json(p.app.session.doc().unwrap(), b, 0)["fills"][0]["color"].clone(); + assert_eq!(fill, "#E53935", "foreign text {foreign}: B took A's fill"); + } +} + +#[test] +fn a_chord_tapped_within_one_frame_runs_once() { + let mut p = Page::new(); + p.copy_a_select_b(); + let m = Modifiers::SHIFT | Modifiers::MAC_CMD | Modifiers::COMMAND; + let v = |pressed| Event::Key { key: Key::V, physical_key: Some(Key::V), pressed, repeat: false, modifiers: m }; + let clip = p.clipboard.clone(); + p.frame(vec![Event::ModifiersChanged(m), v(true), Event::Paste(clip), v(false), Event::ModifiersChanged(Modifiers::NONE)]); + p.frame(vec![]); + assert_eq!(p.count(rect), 3, "one copy pasted over B"); + assert_eq!(p.count(text), 0); +} + #[test] fn copy_as_png_puts_an_image_on_the_clipboard() { let mut p = Page::new(); From 18a7a063fe29627f7d02cbf8aab6ba36fc63f45a Mon Sep 17 00:00:00 2001 From: RealtaNua Date: Sat, 17 Oct 2026 09:00:56 +0700 Subject: [PATCH 101/817] fix(ui): paste chords read modifiers from modifier changes only (#716) Every shell reports a modifier change before the key it goes with, so key events needn't update the held modifiers too. The old test that pressed Shift+Cmd+V and Alt+Cmd+V expecting "nothing" now covers plain V only: those chords run their commands, covered by their own tests. Co-Authored-By: Claude Opus 5.5 (1M context) --- crates/ui-egui/src/lib.rs | 3 ++- crates/ui-egui/src/paste_image_tests.rs | 4 +--- crates/ui-egui/src/shortcuts.rs | 3 --- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index a64ef6a81..e32e8e6e2 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -502,7 +502,8 @@ pub struct UiState { pub paste_event: bool, /// The window got the focus back since the last V release. pub refocused: bool, - /// The modifiers held, as of the last raw event that told: a paste event doesn't carry them. + /// The modifiers held, as of the last modifier change in the raw events: a paste event doesn't + /// carry them. pub held: egui::Modifiers, /// When (UI clock, seconds) open documents next get an autosave checkpoint. pub next_autosave: f64, diff --git a/crates/ui-egui/src/paste_image_tests.rs b/crates/ui-egui/src/paste_image_tests.rs index 23cec8ea3..48bd142e0 100644 --- a/crates/ui-egui/src/paste_image_tests.rs +++ b/crates/ui-egui/src/paste_image_tests.rs @@ -231,13 +231,11 @@ fn the_browser_sequence_pastes_once() { } #[test] -fn v_alone_and_other_paste_commands_paste_nothing() { +fn v_alone_pastes_nothing() { let mut w = Win::new(); w.copy_image_elsewhere(); w.frame(vec![key(Key::V, true, Modifiers::NONE)]); w.frame(vec![key(Key::V, false, Modifiers::NONE)]); - w.cmd_v(CMD.plus(Modifiers::SHIFT)); - w.cmd_v(CMD.plus(Modifiers::ALT)); assert_eq!(w.named("Pasted image"), 0); } diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index 57295c229..0a291a7c3 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -163,9 +163,6 @@ pub fn swallowed_paste(app: &mut FigApp, ctx: &Context) -> Swallowed { let mut out = Swallowed::default(); ctx.input(|i| { for ev in &i.raw.events { - if let Event::Key { modifiers, .. } = ev { - ui.held = *modifiers; - } match ev { Event::ModifiersChanged(m) => ui.held = *m, // Without Cmd/Ctrl held it's another paste key (Shift+Insert, a Paste key). From df674d0d53749572250809226ac607cd523e4034 Mon Sep 17 00:00:00 2001 From: justinjohn0306 Date: Sat, 17 Oct 2026 08:17:28 +0530 Subject: [PATCH 102/817] #710: Resources and Shift+I open the Assets panel from a collapsed sidebar or the version history Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/lib.rs | 8 +++- crates/ui-egui/src/resources_tests.rs | 67 +++++++++++++++++++++++++++ crates/ui-egui/src/toolbar.rs | 3 +- 3 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 crates/ui-egui/src/resources_tests.rs diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 20a8a77c1..f2f74c1a7 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -162,6 +162,8 @@ mod proto_reorder_tests; #[cfg(test)] mod proto_responsive_tests; #[cfg(test)] +mod resources_tests; +#[cfg(test)] mod select_all_tests; #[cfg(test)] mod shortcut_keys_tests; @@ -810,7 +812,11 @@ impl FigApp { } "focus.region" => self.ui.nav.step(r.data.get("step").and_then(Value::as_i64).unwrap_or(1).clamp(-4, 4) as i32), "panel.layers" => self.ui.left_tab = LeftTab::File, - "panel.assets" => self.ui.left_tab = LeftTab::Assets, + "panel.assets" => { + self.ui.left_tab = LeftTab::Assets; + self.ui.left_collapsed = false; + self.ui.versions = Default::default(); + } "panel.versionHistory" => versions::open(self), "view.devCompare" => { self.ui.dev.compare = r.data.get("id").and_then(figcraft_engine::params::id_of).map(dev_compare::CompareView::new); diff --git a/crates/ui-egui/src/resources_tests.rs b/crates/ui-egui/src/resources_tests.rs new file mode 100644 index 000000000..428690985 --- /dev/null +++ b/crates/ui-egui/src/resources_tests.rs @@ -0,0 +1,67 @@ +//! The toolbar's Resources button and Shift+I open the Assets panel (#710), from a collapsed +//! sidebar and from the version history too. + +use egui::accesskit::Role; +use egui::{Event, Key, Modifiers, Pos2, pos2}; +use figcraft_engine::Session; + +use crate::LeftTab; +use crate::layers_drag_tests::Ui; + +fn click(u: &mut Ui, p: Pos2) { + u.button(p, true); + u.button(p, false); + u.frame(vec![]); +} + +fn shift_i(u: &mut Ui) { + let modifiers = Modifiers::SHIFT; + u.frame(vec![ + Event::Key { key: Key::I, physical_key: None, pressed: true, repeat: false, modifiers }, + Event::Key { key: Key::I, physical_key: None, pressed: false, repeat: false, modifiers }, + ]); + u.frame(vec![]); +} + +/// The middle of the toolbar's Resources button, found in the AccessKit tree. +fn resources_button(u: &mut Ui) -> Pos2 { + u.ctx.enable_accesskit(); + u.frame(vec![]); + let out = u.frame_output(vec![]); + let nodes = out.platform_output.accesskit_update.expect("an AccessKit update").nodes; + let n = nodes.iter().map(|(_, n)| n).find(|n| n.role() == Role::Button && n.label() == Some("Resources")).expect("Resources"); + let b = n.bounds().expect("bounds"); + pos2(((b.x0 + b.x1) / 2.0) as f32, ((b.y0 + b.y1) / 2.0) as f32) +} + +fn assets_shown(u: &Ui) -> bool { + u.app.ui.left_tab == LeftTab::Assets && !u.app.ui.left_collapsed && !u.app.ui.versions.open +} + +/// The three states the sidebar can be in when Resources is asked for. +fn starts() -> Vec<(&'static str, Ui)> { + let shown = Ui::new(Session::new()); + let mut collapsed = Ui::new(Session::new()); + collapsed.app.ui.left_collapsed = true; + let mut versions = Ui::new(Session::new()); + crate::versions::open(&mut versions.app); + vec![("layers", shown), ("collapsed", collapsed), ("version history", versions)] +} + +#[test] +fn the_resources_button_opens_the_assets_panel() { + for (name, mut u) in starts() { + let at = resources_button(&mut u); + click(&mut u, at); + assert!(assets_shown(&u), "{name}: the Assets panel is open"); + } +} + +#[test] +fn shift_i_opens_the_assets_panel() { + for (name, mut u) in starts() { + u.frame(vec![]); + shift_i(&mut u); + assert!(assets_shown(&u), "{name}: the Assets panel is open"); + } +} diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index a921cc293..c2f947f84 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -137,8 +137,7 @@ pub fn show(app: &mut FigApp, ui: &mut Ui) { if id == "actions" { app.ui.palette = Some(String::new()); } else { - app.ui.left_tab = crate::LeftTab::Assets; - app.ui.left_collapsed = false; + app.run("view.assets", json!({})); } } x += cell + 4.0; From 40c744da1092fce41803da7f7ef884cac8d68aab Mon Sep 17 00:00:00 2001 From: BFlat Date: Sat, 17 Oct 2026 13:03:49 +0700 Subject: [PATCH 103/817] M1: convert frames to sections and sections to frames (#719) (#721) Frames on the page or in a section convert to sections (object.convertToSection) and sections back to frames (object.convertToFrame), in place, one undo step each, from the canvas context menu; nested frames, instances, main components and sections holding sections are refused. --- ROADMAP.md | 4 +- crates/engine/src/cmd/structure.rs | 62 ++++++++++++++++++-- crates/engine/src/convert_container_tests.rs | 52 +++++++++++++++- crates/ui-egui/locales/en.toml | 2 + crates/ui-egui/locales/es.toml | 3 + crates/ui-egui/src/menus.rs | 21 +++++++ docs/mcp.md | 2 + docs/target-app-parity.md | 3 +- 8 files changed, 140 insertions(+), 9 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index c3c12085e..bbde8bc5b 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -131,6 +131,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). ## Progress log +- **2026-10-17** · Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. - **2026-10-14** · Corner handles win over the corner-radius handles (M1, #292): a press on the inner half of a corner handle's square picked the radius handle 10 px in, so the drag neither resized nor (dragging outward) rounded anything. Inside the drawn square the corner now resizes both sides (in ratio with Shift or the link); further in the radius handle still answers. Regression test in the transform behaviour suite. Numbers unchanged. - **2026-10-14** · Home screen recent files as cards (M7): each card shows the picture its file carries on its first page's colour, the file's icon, name and "Edited ... ago"; sort by name, creation or last change either way; a table view; a click selects, a double-click or Enter opens, arrow keys move; Open, Show in folder and Remove from recents on right-click. Numbers unchanged. - **2026-10-13** · Vector edit mode regions (M4): with the Move tool, the filled area under the pointer is hatched with "/" lines in the selection colour, clipped by the area's own fill rule so holes stay clear; the hatch goes near points (3.5 px) and segments (2 px), and its spacing follows octave folding (8 px at every power-of-two zoom), fixed to the shape. A click selects the area with its points (they move with it but keep the unselected look), Shift adds or removes one, a press on a selected area drags the whole selection as one undo step, and a click on an empty spot clears the areas and stays in edit mode. `vector.edit.select {regions}` and `vector.edit.state` (`regions`, `regionVertices`, `regionHover`); `vector_regions_tests` and `regions_tests`. Numbers unchanged. @@ -313,6 +314,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | | 2026-10-15 | minor | Drop files anywhere to open them (M7): dragging files over the window shows a "Drop to open" (home) or "Drop to import" (canvas) overlay. On the home screen each supported file opens as a document of its own and other files are turned away with a toast; on the canvas the files import at the drop point. Both wait behind a small card that is on screen before a large file blocks the window. A canvas import stays with the document and page that received the drop even if the tab or page changes meanwhile, and is cancelled with a message if that document or page is gone. Numbers unchanged. | | 2026-10-15 | minor | M7: system font discovery skips entries observed as non-regular files before opening them, avoiding the reproduced named-pipe stall. Regular-file symlinks remain supported; directory depth, font limits and priorities are unchanged. Numbers unchanged. | diff --git a/crates/engine/src/cmd/structure.rs b/crates/engine/src/cmd/structure.rs index bed70d3df..5643c058f 100644 --- a/crates/engine/src/cmd/structure.rs +++ b/crates/engine/src/cmd/structure.rs @@ -26,10 +26,17 @@ pub fn specs() -> Vec { spec!( "object.convertToFrame", "Convert to frame", - "{ids?} (groups become frames of the same box in place, their layers staying where they are: no fill, not clipping. Frames are left alone; instances, main components and layers inside instances are refused)", + "{ids?} (groups become frames of the same box in place, their layers staying where they are: no fill, not clipping; sections become frames that keep their fill and don't clip. Frames are left alone; instances, main components, layers inside instances and sections holding sections are refused)", true, |s, p| convert(s, p, "object.convertToFrame", true) ), + spec!( + "object.convertToSection", + "Convert to section", + "{ids?} (frames on the page or in a section become sections in place, keeping their fill and layers; what only a frame has goes: auto layout, clipping, layout grids, guides and scrolling. Sections are left alone; nested frames, instances and main components are refused)", + true, + convert_to_section + ), spec!( "object.wrapInSection", "Wrap in new section", @@ -199,6 +206,13 @@ fn convert(s: &mut Session, p: &Value, cmd: &'static str, to_frame: bool) -> Res let n = doc.get(i)?; let refuse = |why: &str| Err(bad(cmd, format!("\"{}\" {why}", n.name))); match (&n.kind, to_frame) { + // A frame can't hold sections. + (NodeKind::Section { .. }, true) + if n.children.iter().any(|c| doc.node(*c).is_some_and(|c| matches!(c.kind, NodeKind::Section { .. }))) => + { + return refuse("holds sections, which can't go inside a frame: convert those first"); + } + (NodeKind::Section { .. }, true) => todo.push(i), (NodeKind::Instance { .. }, _) => return refuse("is an instance: its layers come from its main component (detach it first)"), (NodeKind::Component { .. }, _) => return refuse("is a main component, which stays a frame"), (NodeKind::Frame | NodeKind::Group, _) if crate::components::owning_instance(doc, i).is_some() => { @@ -212,12 +226,15 @@ fn convert(s: &mut Session, p: &Value, cmd: &'static str, to_frame: bool) -> Res } for i in &todo { if to_frame { - // The group's box as it is; nothing painted or clipped, so the look stays. + // The box as it is and nothing clipped, so the look stays: a group has nothing painted, a + // section keeps its fill. let n = doc.get_mut(*i)?; + if matches!(n.kind, NodeKind::Group) { + n.fills.clear(); + n.strokes.clear(); + } n.kind = NodeKind::Frame; n.clip = false; - n.fills.clear(); - n.strokes.clear(); continue; } let n = doc.get_mut(*i)?; @@ -242,6 +259,43 @@ fn convert(s: &mut Session, p: &Value, cmd: &'static str, to_frame: bool) -> Res Ok(json!({"ids": todo})) } +/// Frames on the page or in a section become sections in place (sections only sit there). +fn convert_to_section(s: &mut Session, p: &Value) -> Result { + let cmd = "object.convertToSection"; + let ids = req_targets(cmd, s, p)?; + let doc = s.doc_mut()?; + let mut todo = Vec::new(); + for i in ids { + let n = doc.get(i)?; + let refuse = |why: &str| Err(bad(cmd, format!("\"{}\" {why}", n.name))); + let on_board = n.parent.and_then(|p| doc.node(p)).is_some_and(|p| p.is_page() || matches!(p.kind, NodeKind::Section { .. })); + match &n.kind { + NodeKind::Section { .. } => {} + NodeKind::Instance { .. } => return refuse("is an instance: its layers come from its main component (detach it first)"), + NodeKind::Component { .. } | NodeKind::ComponentSet { .. } => return refuse("is a main component, which stays a frame"), + NodeKind::Frame if !on_board => return refuse("is inside a frame or group: only frames on the page or in a section become sections"), + NodeKind::Frame => todo.push(i), + _ => return refuse("is not a frame"), + } + } + for i in &todo { + let n = doc.get_mut(*i)?; + n.kind = NodeKind::Section { contents_hidden: false }; + (n.layout, n.clip, n.overflow) = (None, false, proto::Overflow::None); + n.grids.clear(); + n.guides.clear(); + n.styles.grid = None; + n.bound.retain(|k, _| !k.starts_with("padding") && !matches!(k.as_str(), "gap" | "counterAxisSpacing")); + let kids = n.children.clone(); + for k in kids { + // Out of the flow there is nothing to fill or to be absolute against. + doc.get_mut(k)?.child_layout.absolute = false; + } + figcraft_layout::coherent_sizing(doc, *i); + } + Ok(json!({"ids": todo})) +} + fn ungroup(s: &mut Session, p: &Value) -> Result { let ids = req_targets("object.ungroup", s, p)?; let doc = s.doc_mut()?; diff --git a/crates/engine/src/convert_container_tests.rs b/crates/engine/src/convert_container_tests.rs index 7c25a6205..620388d27 100644 --- a/crates/engine/src/convert_container_tests.rs +++ b/crates/engine/src/convert_container_tests.rs @@ -1,5 +1,5 @@ -//! Frames and groups converted into each other in place: the layers stay where they are on the -//! page, what only a frame has goes with it, what can't convert is refused, one undo step. +//! Frames, groups and sections converted into each other in place: the layers stay where they are on +//! the page, what only a frame has goes with it, what can't convert is refused, one undo step. use serde_json::{Value, json}; @@ -136,7 +136,7 @@ fn what_cannot_convert_is_refused_and_nothing_changes() { #[test] fn junk_parameters_are_refused_not_fatal() { let junk = [json!(null), json!(true), json!(-1), json!(1e308), json!("x"), json!([[1]]), json!({"a": 1}), json!([0, 999_999, "7"])]; - for cmd in ["object.convertToGroup", "object.convertToFrame"] { + for cmd in ["object.convertToGroup", "object.convertToFrame", "object.convertToSection"] { for j in &junk { let mut s = Session::new(); let f = id(ex(&mut s, "frame.create", json!({"x": 0, "y": 0, "width": 50, "height": 50}))); @@ -148,3 +148,49 @@ fn junk_parameters_are_refused_not_fatal() { } } } + +#[test] +fn a_frame_on_the_page_becomes_a_section_and_back() { + let mut s = Session::new(); + let f = id(ex(&mut s, "frame.create", json!({"x": 100, "y": 50, "width": 300, "height": 200, "name": "Flow", "props": {"fill": "#FFEEDD"}}))); + let (a, b) = (rect(&mut s, f, 20.0, 30.0), rect(&mut s, f, 400.0, 90.0)); + ex(&mut s, "layout.add", json!({"ids": [f], "direction": "horizontal"})); + ex(&mut s, "node.set", json!({"id": f, "props": {"width": 300, "height": 200}})); + let before = [page_box(&s, a), page_box(&s, b), page_box(&s, f)]; + assert_eq!(ex(&mut s, "object.convertToSection", json!({"ids": [f]}))["ids"], json!([f])); + let n = s.doc().unwrap().node(f).unwrap().clone(); + assert!(matches!(n.kind, NodeKind::Section { contents_hidden: false })); + assert_eq!((n.name.as_str(), n.children.clone(), n.fills.len()), ("Flow", vec![a, b], 1), "same name, layers and fill"); + assert!(n.layout.is_none() && !n.clip, "no auto layout or clipping on a section"); + assert_eq!([page_box(&s, a), page_box(&s, b), page_box(&s, f)], before, "nothing moves"); + // And back: a frame that keeps the fill and doesn't clip, so the look stays. + assert_eq!(ex(&mut s, "object.convertToFrame", json!({"ids": [f]}))["ids"], json!([f])); + let n = s.doc().unwrap().node(f).unwrap().clone(); + assert!(matches!(n.kind, NodeKind::Frame) && n.fills.len() == 1 && !n.clip); + assert_eq!([page_box(&s, a), page_box(&s, b), page_box(&s, f)], before); + // Each conversion is one undo step. + ex(&mut s, "edit.undo", json!({})); + assert!(matches!(kind(&s, f), NodeKind::Section { .. })); + ex(&mut s, "edit.undo", json!({})); + assert!(matches!(kind(&s, f), NodeKind::Frame)); + assert!(s.doc().unwrap().node(f).unwrap().layout.is_some(), "the frame's auto layout is back"); +} + +#[test] +fn only_frames_on_the_page_or_in_a_section_become_sections() { + let mut s = Session::new(); + let outer = id(ex(&mut s, "frame.create", json!({"x": 0, "y": 0, "width": 300, "height": 300}))); + let inner = id(ex(&mut s, "frame.create", json!({"parent": outer, "x": 10, "y": 10, "width": 100, "height": 100}))); + let err = s.execute("object.convertToSection", &json!({"ids": [inner]})).unwrap_err().to_string(); + assert!(err.contains("inside a frame"), "{err}"); + let r = rect(&mut s, outer, 150.0, 150.0); + assert!(s.execute("object.convertToSection", &json!({"ids": [r]})).is_err(), "a rectangle isn't a frame"); + // A frame inside a section converts; a section holding a section can't become a frame. + let sec = id(ex(&mut s, "node.create", json!({"type": "section", "x": 500, "y": 0, "width": 400, "height": 400}))); + let in_sec = id(ex(&mut s, "frame.create", json!({"parent": sec, "x": 20, "y": 20, "width": 100, "height": 100}))); + ex(&mut s, "object.convertToSection", json!({"ids": [in_sec]})); + assert!(matches!(kind(&s, in_sec), NodeKind::Section { .. })); + let err = s.execute("object.convertToFrame", &json!({"ids": [sec]})).unwrap_err().to_string(); + assert!(err.contains("holds sections"), "{err}"); + assert!(matches!(kind(&s, sec), NodeKind::Section { .. }), "nothing changed"); +} diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 3c127fc65..c9b6df629 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -201,6 +201,8 @@ name = "English" "Code or invite link" = "Code or invite link" "Color profile: {name}" = "Color profile: {name}" "Colour and text styles, Light and Dark variables, buttons, inputs and cards" = "Colour and text styles, Light and Dark variables, buttons, inputs and cards" +"Convert to frame" = "Convert to frame" +"Convert to section" = "Convert to section" "CSS custom properties…" = "CSS custom properties…" "Can edit" = "Can edit" "Can't read this library: {e}" = "Can't read this library: {e}" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 901283f11..ff3e5a791 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -302,6 +302,8 @@ status = "draft — needs native review" "Copied as SVG" = "Copiado como SVG" "Copied as text" = "Copiado como texto" "Copied {value}" = "Copiado: {value}" +"Convert to frame" = "Convertir en marco" +"Convert to section" = "Convertir en sección" "Copy" = "Copiar" "Copy as" = "Copiar como" "Copy as CSS" = "Copiar como CSS" @@ -1839,6 +1841,7 @@ status = "draft — needs native review" "object.batchRename" = "Cambiar nombre en lote" "object.convertToFrame" = "Convertir en marco" "object.convertToGroup" = "Convertir en grupo" +"object.convertToSection" = "Convertir en sección" "object.flipH" = "Voltear horizontalmente" "object.flipV" = "Voltear verticalmente" "object.frameSelection" = "Enmarcar selección" diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index b9d3299a6..498dc8de9 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -467,6 +467,22 @@ pub fn popups(app: &mut FigApp, ctx: &egui::Context) { .collect(); (!secs.is_empty()).then(|| if secs.iter().all(|h| *h) { tr("Show section contents") } else { tr("Hide section contents") }) }); + // Frames on the page (or in a section) convert to sections, and sections to frames. + let convert = app.session.doc().ok().and_then(|doc| { + let nodes: Vec<_> = ids.iter().filter_map(|i| doc.node(*i)).collect(); + let on_board = |n: &figcraft_doc::Node| { + n.parent.and_then(|p| doc.node(p)).is_some_and(|p| p.is_page() || matches!(p.kind, figcraft_doc::NodeKind::Section { .. })) + }; + if nodes.is_empty() { + None + } else if nodes.iter().all(|n| matches!(n.kind, figcraft_doc::NodeKind::Section { .. })) { + Some((tr("Convert to frame"), "object.convertToFrame")) + } else if nodes.iter().all(|n| matches!(n.kind, figcraft_doc::NodeKind::Frame) && on_board(n)) { + Some((tr("Convert to section"), "object.convertToSection")) + } else { + None + } + }); let mut entries: Vec<(&str, &str)> = if has_sel { vec![ (tr("Copy"), "edit.copy"), @@ -519,6 +535,11 @@ pub fn popups(app: &mut FigApp, ctx: &egui::Context) { { entries.insert(at + 1, (label, "section.toggleContents")); } + if let Some(entry) = convert + && let Some(at) = entries.iter().position(|e| e.1 == "object.wrapInSection") + { + entries.insert(at + 1, entry); + } // A right-clicked ruler guide (selected, with no layers) can be removed. if !has_sel && app.session.ds().is_ok_and(|d| d.selected_guide().is_some()) { entries.splice(0..0, [(tr("Remove guide"), "guide.remove"), ("-", "")]); diff --git a/docs/mcp.md b/docs/mcp.md index 4efee72ac..64228ea77 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -114,6 +114,8 @@ Or in a project's `.mcp.json`: columns (vertical layouts wrap top to bottom into new columns). - `object.convertToGroup` / `object.convertToFrame` turn a frame into a group or back in place (layers stay put; a group has no auto layout, fill, stroke, corner radius, clipping or grids). + - `object.convertToSection` turns a frame on the page or in a section into a section in place, and + `object.convertToFrame` turns a section back into a frame (keeping its fill, not clipping). - `contentAlign` (wrapping layouts): `auto` (default) packs the lines `crossGap` apart at the start, centre or end `crossAlign` names (lines of nothing but fill children stretch instead); `spaceBetween` puts the free space between the lines (one line, or no free space: like `auto`). diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index e15ddaed6..7c89f2390 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # FigCraft parity with Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-14 · **Change:** minor (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) · **Target:** Figma Design (desktop app 126.10.7, macOS) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (frames and sections convert into each other (#719); 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) · **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 @@ -628,6 +628,7 @@ Carried over from the ROADMAP's "Shipped so far" (2026-10-10). The test count th | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. | | 2026-10-14 | minor | Russian catalog (M9), reviewed and approved by VanTan: all 2,165 current entries, Русский in Preferences and regional ru tags. Russian integer plurals use one/few/many; contributor display name VanTan added. Existing estimates unchanged. | | 2026-10-13 | minor | Vector edit mode regions: the filled area under the pointer is hatched (clear of points and segments, holes left out, spacing by octave folding fitted to measurements at several zoom levels, fixed to the shape); click, Shift-click and drag select and move areas with their points (drawn unselected); a click on an empty spot clears them and stays in edit mode (see [ui-parity](ui-parity.md)) | | 2026-10-13 | minor | Plugin log limits (#191): cap each UTF-8 line at 8 KiB, total log bytes at 1 MiB and lines at 1,000 per run/callback before copying guest memory or forwarding to the host. Over-budget runs fail and roll back document edits; callbacks get fresh budgets. Added sandbox boundary/forwarding tests and an engine rollback regression. Percentages and hours unchanged. | From fa4821bcea03a2a0eae40609c9ffcbda3383f132 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 13:27:11 +0700 Subject: [PATCH 104/817] #627: settle bound paints once per open, not also in the native loader DocState::new already settles every opened document (native files, branches and live joins included); the .fig/REST path keeps its settlement in link_instances for file.import into an open document. --- crates/engine/src/cmd/file.rs | 1 - crates/engine/src/variable_tests.rs | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index f9175b9c9..28124b7cd 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -520,7 +520,6 @@ fn load_with( if loaded.doc.name.is_empty() { loaded.doc.name = file_stem(name_hint); } - super::styles::apply_paint_bindings_on_load(&mut loaded.doc); Ok((loaded, false)) } } diff --git a/crates/engine/src/variable_tests.rs b/crates/engine/src/variable_tests.rs index f5808b2c4..dcdd04e32 100644 --- a/crates/engine/src/variable_tests.rs +++ b/crates/engine/src/variable_tests.rs @@ -53,7 +53,10 @@ fn initial_color_bindings_settle_in_constructor_and_loaders() { let native = figcraft_format::save_bytes(&stale, None).unwrap(); let (loaded, _) = crate::cmd::file::load_bytes(&native, "bindings.figcraft").unwrap(); - let loaded_id = assert_dark_bound_color(&loaded, name_transform); + // A native file settles when it opens as a document, not in the loader. + let opened = Session::with_document(loaded); + let loaded = opened.doc().unwrap(); + let loaded_id = assert_dark_bound_color(loaded, name_transform); assert_eq!(loaded_id, id); assert_eq!(loaded.node(id).unwrap().source, stale.first_page()); assert!(loaded.node(id).unwrap().overrides.contains("sentinel")); From 6e15e30790acc1b8d062b31fb4ce9168eba09207 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 13:27:12 +0700 Subject: [PATCH 105/817] #627: remove the dead network::decode shim --- crates/format/src/fig/network.rs | 9 ++------- crates/format/src/fig/tail_tests.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/crates/format/src/fig/network.rs b/crates/format/src/fig/network.rs index d251dff15..92ad48989 100644 --- a/crates/format/src/fig/network.rs +++ b/crates/format/src/fig/network.rs @@ -64,14 +64,9 @@ impl Reader<'_> { } } -/// The network in blob `b`; `None` when it's truncated, out of range or not finite. -#[allow(dead_code, reason = "for readers that don't need the count of styled segments")] -pub(super) fn decode(b: &[u8]) -> Option { - decode_styled(b).map(|(net, _)| net) -} - /// The network in blob `b` and how many of its segments have a style id of their own (per-segment -/// stroke overrides, which the document model can't hold); `None` as for `decode`. +/// stroke overrides, which the document model can't hold); `None` when it's truncated, out of +/// range or not finite. pub(super) fn decode_styled(b: &[u8]) -> Option<(Network, usize)> { let mut r = Reader { b, pos: 0 }; let (nv, ns, nr) = (r.u32()? as usize, r.u32()? as usize, r.u32()? as usize); diff --git a/crates/format/src/fig/tail_tests.rs b/crates/format/src/fig/tail_tests.rs index 5d34f23b6..196180445 100644 --- a/crates/format/src/fig/tail_tests.rs +++ b/crates/format/src/fig/tail_tests.rs @@ -355,9 +355,9 @@ fn unreadable_conditions_skip_the_conditional() { #[test] fn damaged_network_blobs_never_panic() { let good = square_blob(); - assert!(network::decode(&good).is_some()); + assert!(network::decode_styled(&good).is_some()); for cut in 0..good.len() { - assert!(network::decode(&good[..cut]).is_none(), "{cut}"); + assert!(network::decode_styled(&good[..cut]).is_none(), "{cut}"); } let mut r = Lcg(5); for _ in 0..5000 { @@ -366,7 +366,7 @@ fn damaged_network_blobs_never_panic() { let i = (r.next() as usize) % m.len(); m[i] ^= 1 << (r.next() % 8); } - if let Some(net) = network::decode(&m) { + if let Some((net, _)) = network::decode_styled(&m) { assert!(net.segments.iter().all(|s| s.a < net.vertices.len() && s.b < net.vertices.len())); assert!(net.regions.iter().flat_map(|r| &r.loops).flatten().all(|i| *i < net.segments.len())); assert!(net.vertices.iter().all(|v| v.x.is_finite() && v.y.is_finite())); @@ -375,13 +375,13 @@ fn damaged_network_blobs_never_panic() { // Counts larger than the blob, and indices out of range. let mut huge = vec![0xff; 12]; huge.extend_from_slice(&[0; 64]); - assert!(network::decode(&huge).is_none()); + assert!(network::decode_styled(&huge).is_none()); let mut bad = arrow_blob(); bad[12 + 24 + 4..12 + 24 + 8].copy_from_slice(&7u32.to_le_bytes()); - assert!(network::decode(&bad).is_none()); + assert!(network::decode_styled(&bad).is_none()); for _ in 0..2000 { let junk: Vec = (0..(r.next() % 120)).map(|_| r.next() as u8).collect(); - let _ = network::decode(&junk); + let _ = network::decode_styled(&junk); } } From b4d58a362e3350fd7416d8dc528d70dc6e372007 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 13:27:13 +0700 Subject: [PATCH 106/817] #627: leave the progress docs to the maintainer --- 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 e56eda19d..d8e517119 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -17,7 +17,7 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| -| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Not read: connector labels, table cells beyond their own layers, filled areas with their own fills, per-point stroke joins, per-segment stroke styles, variables bound to fields the editor can't bind, fixed or content-sized grid tracks, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs`, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | +| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Not read: connector labels, table cells beyond their own layers, filled areas with their own fills, per-point stroke joins, variables bound to fields the editor can't bind, fixed or content-sized grid tracks, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs`, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | | REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout, constraints, grids, components, sets, instances with overrides, component properties, styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | From 51e02a6b1a31b75e7b686a410b2f40e41d3f6fed Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 13:27:28 +0700 Subject: [PATCH 107/817] #695: leave progress docs to the maintainer's docs PR --- docs/file-format-parity.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 6f0cce807..d8e517119 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (`.fig` numbered list start numbers (#686); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-14 · **Change:** minor (SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) Every format Figma reads or writes, with FigCraft's support. Sources: `Info.plist` of `/Applications/Figma.app` (document types only; nothing inside the bundle's code was read), Figma's @@ -17,7 +17,7 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| -| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs and list types (numbered lists keep the number they start at), vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Not read: nested list levels and where a new list begins right after another numbered one (`isFirstLineOfList`), connector labels, table cells beyond their own layers, filled areas with their own fills, per-point stroke joins, variables bound to fields the editor can't bind, fixed or content-sized grid tracks, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs`, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | +| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Not read: connector labels, table cells beyond their own layers, filled areas with their own fills, per-point stroke joins, variables bound to fields the editor can't bind, fixed or content-sized grid tracks, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs`, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | | REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout, constraints, grids, components, sets, instances with overrides, component properties, styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | @@ -88,8 +88,7 @@ each. layers sit in it (fill, absolute, min/max sizes); layout grids; export settings; text style (font, with styles under their standard names such as "Semi Bold"; size; line height, a share of the font size as a raw multiplier; letter spacing, case, decoration, links), alignment, auto resize, - truncation, paragraph spacing and indent, list types (with the number a numbered list starts - at, on every line of the list; not yet checked in other software) and styled runs with their fills (indexed + truncation, paragraph spacing and indent, list types and styled runs with their fills (indexed by UTF-16 unit); components (description, boolean, text and instance swap properties and the layers bound to them), component sets, instances (their main, property values, what the instance itself changes from its main, such as its size, name and paints, as an override addressed by the @@ -163,7 +162,6 @@ each. | Date | Change | Summary | |---|---|---| -| 2026-10-16 | minor | `.fig` numbered lists keep the number they start at (#686): a list Figma shows as starting at 2 imported as 1. The import reads each line's start offset, a numbered paragraph keeps it (older files open unchanged), numbering counts on from it, `get_node` reports it (`listStartOffsets`), and the export writes it on every line of the list. Nested list levels and a new list right after another numbered one are still not read from `.fig` files. Numbers unchanged | | 2026-10-14 | minor | SVG/PDF depth overflow (#208) is checked before bounds and drawing; public checked APIs return the offending root/layer, commands and CLI report it, and no incomplete export replaces an existing file. Tested at depths 255/256/257, with inner roots, hidden branches, masks, raster fallbacks and multiple roots/pages. Numbers unchanged. | | 2026-10-13 | minor | `.fig` export (gap 1): instances write what they change from their main as an override addressed by the main's id (their size, name and paints were lost elsewhere without it), what follows for their layers as derived data, and a scale factor when scaled as a whole; layers of a nested instance swapped for another component keep their overrides; variable collections, modes, variables and their bindings, the modes frames and pages set, shared styles with their links and variable-width strokes are written, and the import reads all of it back (style definitions and unused styles, variable order and scopes, bindings on paint lists, gradient stops, effects and layout grids, page modes, text field bindings, which a `.fig` import used to drop, and width profiles). Opened `.fig` and file JSON documents link nested instances of variants (and any nested instance under a name of its own) to their main's layers; they stayed unlinked, so a second export lost what they changed. Checked by opening written files in other software: resized and scaled instances keep their size and lay their layers out for it, variables with their modes and colour bindings resolve there (a frame set to another mode shows that mode's colours, also inside instances), colour, text, effect and grid styles are listed, and variable-width strokes that are the same on both sides of the path draw with their width; number, string and boolean bindings and bindings on effects, layout guides and gradient stops come across as the values they give but did not show as bound there (their entries now also name the layer field they set, not yet checked there), and strokes wider on one side of the path are written as filled outlines, no longer editable strokes there (the stroke itself is kept as plugin data and our own import puts it back; not yet checked there). Numbers unchanged | | 2026-10-12 | minor | `.fig` export made to open elsewhere (gap 1): the document and its pages say they are visible and opaque (left out, nothing was drawn), the schema in the file uses the format's own names, kinds, field ids and enum values, rectangles are rounded rectangles with four radii, frames and shapes carry their fill outline and plain strokes their stroke outline, text carries its layout settings, font styles use their standard names, line heights that are a share of the font size are raw multipliers, masks keep their type (read back too); the import reads per-side stroke weights whose zero sides are left out. Written files were checked by opening them in other software: layers, fills, gradients, strokes, shadows, vectors, components and text draw as in FigCraft; effects such as glass and noise, images and prototype interactions are still unchecked there, and variables are not written. Numbers unchanged | From 7dcd7fd05bfa820bf6adb0fe4e607f1e9ee5c89f Mon Sep 17 00:00:00 2001 From: Andrii Volkov <60794004+volkovskey@users.noreply.github.com> Date: Sat, 17 Oct 2026 09:27:42 +0300 Subject: [PATCH 108/817] fix(format): one kiwi value per compressed canvas byte One value per two bytes of the compressed canvas was too tight for a public design system: a 39.5 MB canvas holding 29.7 million values got a budget of 19.7 million (reported in #701). Real files hold 0.37 to 0.75 values per compressed byte; the budget is now one per byte, at least the old 20 million and at most 128 million. A small file still gets main's 20 million, however far it unpacks. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YQxjkNSUJhTkTfY74aNeki --- crates/format/src/fig/kiwi.rs | 10 +++++----- crates/format/src/fig/tests.rs | 7 +++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/crates/format/src/fig/kiwi.rs b/crates/format/src/fig/kiwi.rs index 46a9daacd..6496062b4 100644 --- a/crates/format/src/fig/kiwi.rs +++ b/crates/format/src/fig/kiwi.rs @@ -11,11 +11,11 @@ use std::fmt; /// Deepest struct/message nesting decoded. const MAX_DEPTH: usize = 64; /// Most values decoded from one message (every scalar, array element and field counts): at least -/// [`MIN_VALUES`], and one per [`PACKED_BYTES_PER_VALUE`] bytes of the file's compressed canvas, -/// so a large real file decodes while a small one can't expand into a huge tree, however far its -/// chunks inflate. +/// [`MIN_VALUES`], and one per byte of the file's compressed canvas up to [`MAX_VALUES`], so a large +/// real file decodes while a small one can't expand into a huge tree, however far its chunks +/// inflate. Real files hold 0.37 to 0.75 values per compressed byte. const MIN_VALUES: usize = 20_000_000; -const PACKED_BYTES_PER_VALUE: usize = 2; +const MAX_VALUES: usize = 128 << 20; /// Most definitions in a schema, and fields in one definition. const MAX_DEFS: usize = 10_000; const MAX_FIELDS: usize = 10_000; @@ -302,7 +302,7 @@ impl Schema { /// Most values decoded from a file whose compressed canvas is `packed` bytes. pub(crate) fn value_budget(packed: usize) -> usize { - MIN_VALUES.max(packed / PACKED_BYTES_PER_VALUE) + packed.clamp(MIN_VALUES, MAX_VALUES) } struct Decoder<'s, 'b> { diff --git a/crates/format/src/fig/tests.rs b/crates/format/src/fig/tests.rs index 574f860c2..c2fae2490 100644 --- a/crates/format/src/fig/tests.rs +++ b/crates/format/src/fig/tests.rs @@ -629,8 +629,11 @@ fn large_files_get_a_larger_value_budget() { // A real 400 000-layer file: an 83.5 MB canvas whose message unpacks to 334 MB and holds // 30.5 million values was refused as "too many values". assert!(kiwi::value_budget(83_491_232) > 30_514_899); - // Still bounded by the largest canvas read. - assert!(kiwi::value_budget(MAX_CANVAS as usize) <= 128 << 20); + // A public design system packs more densely: a 39.5 MB canvas holding 29.7 million values, + // which one value per two compressed bytes refused. + assert!(kiwi::value_budget(39_500_000) > 29_703_730); + // Never more than the ceiling, however large the canvas. + assert_eq!(kiwi::value_budget(MAX_CANVAS as usize), 128 << 20); } #[test] From 69806c9edd85d8fac2a76eda32c75bc6ede262d6 Mon Sep 17 00:00:00 2001 From: BFlat Date: Sat, 17 Oct 2026 13:35:00 +0700 Subject: [PATCH 109/817] Plugins: refuse file and network access through path params and collab (#723) Plugins can no longer reach the disk or network through path parameters (variable.export/codeConnect.export/component.playground writes, codeConnect.import/variable.import reads) or through collab.* and window.*; found and fixed by @lucasmartins-ai, split out of #696. --- crates/engine/src/plugins.rs | 15 +++++++++++++++ crates/engine/src/plugins_tests.rs | 7 +++++++ docs/plugins.md | 6 +++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/plugins.rs b/crates/engine/src/plugins.rs index f1c4075e3..ce5aa0c6e 100644 --- a/crates/engine/src/plugins.rs +++ b/crates/engine/src/plugins.rs @@ -111,6 +111,10 @@ const DENIED: &[&str] = &[ "edit.redo", "edit.repeat", "command.batch", + // Network sessions, online files and their recovery copies on disk. + "collab.", + // Opens files in new windows. + "window.", "view.theme", ]; /// Read-only exceptions to [`DENIED`]. @@ -128,6 +132,17 @@ fn refusal(m: &Manifest, command: &str, params: &Value) -> Option { if command == "image.place" && get(params, "path").is_some() { return Some("plugins can't read files: pass the image as `data`".into()); } + // `path` here is a file on disk (elsewhere it is a vector path or an action's place). + if matches!(command, "variable.export" | "codeConnect.export" | "component.playground") && get(params, "path").is_some() { + return Some("plugins can't write files: leave out `path` to get the result back".into()); + } + if command == "codeConnect.import" && get(params, "path").is_some() { + return Some("plugins can't read files: pass the connections as `json`".into()); + } + // Variables JSON may be given as a path: only objects and JSON text for plugins. + if command == "variable.import" && get(params, "variables").and_then(Value::as_str).is_some_and(|t| !t.trim_start().starts_with('{')) { + return Some("plugins can't read files: pass the variables JSON itself".into()); + } if !m.permissions.allows(command) { return Some(format!("`{command}` isn't in the commands {} asked permission for", m.name)); } diff --git a/crates/engine/src/plugins_tests.rs b/crates/engine/src/plugins_tests.rs index 102d675a3..657b6825f 100644 --- a/crates/engine/src/plugins_tests.rs +++ b/crates/engine/src/plugins_tests.rs @@ -169,6 +169,13 @@ fn files_dialogs_history_and_plugins_are_off_limits() { ("plugin.remove", json!({"id": "org.test.deny"})), ("edit.undo", json!({})), ("command.batch", json!({"commands": [{"command": "file.saveAs", "params": {"path": target}}]})), + ("variable.export", json!({"format": "css", "path": target})), + ("codeConnect.export", json!({"path": target})), + ("codeConnect.import", json!({"path": "/etc/passwd"})), + ("component.playground", json!({"id": a, "path": target})), + ("variable.import", json!({"variables": "/etc/passwd"})), + ("collab.recoverFile", json!({"path": "copy.figcraft", "file": "x", "session": 1, "client": 1, "seq": 0})), + ("window.new", json!({"path": "C:/Windows/win.ini"})), ("doc.switch", json!({"index": 0})), ("pref.keepTool", json!({})), // Without a name it would open inline renaming in the layers panel: a UI request. diff --git a/docs/plugins.md b/docs/plugins.md index 6f23e6ecb..5867bd25c 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -237,7 +237,11 @@ Whatever its manifest says, FigCraft refuses these calls (the plugin gets the re it can handle): - files and the app: `file.*`, `app.*`, `pref.*`, `help.*`, `library.add`, `libraries.*`, - `image.place` with a `path` (pass the image as base64 `data` instead), `view.theme*`; + `image.place` with a `path` (pass the image as base64 `data` instead), `variable.export`, + `codeConnect.export` and `component.playground` with a `path` (leave it out to get the result + back), `codeConnect.import` with a `path` and `variable.import` with a file path instead of JSON, + `window.*` (new windows open files), `view.theme*`; +- live sessions and online files: `collab.*`; - other documents and the version history: `doc.*` and `version.*` (except `doc.list` and `version.list`); - the undo history and nesting: `edit.undo`, `edit.redo`, `edit.repeat`, `command.batch` (a run is From 0ef8966844fd5b174b23f0e66de6b4af13cd799f Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 13:40:30 +0700 Subject: [PATCH 110/817] #639: drop the ignored test that needs a fixture outside the repo --- .../format/src/fig/connector_label_tests.rs | 68 +------------------ 1 file changed, 1 insertion(+), 67 deletions(-) diff --git a/crates/format/src/fig/connector_label_tests.rs b/crates/format/src/fig/connector_label_tests.rs index 56cea3685..2aa6d8937 100644 --- a/crates/format/src/fig/connector_label_tests.rs +++ b/crates/format/src/fig/connector_label_tests.rs @@ -1,4 +1,4 @@ -use super::{Archive, decode_canvas, kiwi::Kv, map}; +use super::{kiwi::Kv, map}; fn obj(fields: Vec<(&'static str, Kv<'static>)>) -> Kv<'static> { Kv::Object(fields) @@ -202,10 +202,6 @@ fn synthetic_connector_authored_hidden_background_is_retained() { assert_eq!(background["fills"].as_array().unwrap().len(), 1); } -fn connector<'a>(layers: &'a [serde_json::Value], name: &str) -> &'a serde_json::Value { - layers.iter().find(|layer| layer.get("name").and_then(serde_json::Value::as_str) == Some(name)).expect("connector in fixture") -} - fn field_mut<'a, 's>(value: &'a mut Kv<'s>, key: &str) -> Option<&'a mut Kv<'s>> { let Kv::Object(fields) = value else { return None }; fields.iter_mut().find(|(name, _)| *name == key).map(|(_, value)| value) @@ -244,65 +240,3 @@ fn set_override_field(message: &mut Kv<'_>, field: &str, local_id: u64, key: &'s fields.push((key, value)); } } - -#[test] -#[ignore = "set FIGCRAFT_CONNECTOR_LABEL_FIXTURE to the retained synthetic source-initial.zip"] -fn synthetic_export_keeps_saved_vector_gap_and_composed_label_position() { - let path = std::env::var_os("FIGCRAFT_CONNECTOR_LABEL_FIXTURE").expect("fixture path is required when running this test"); - let bytes = std::fs::read(path).expect("read synthetic connector export"); - let archive = Archive::open(&bytes).expect("open synthetic connector export"); - let (schema, raw_message) = decode_canvas(&archive.canvas).expect("decode synthetic canvas"); - let root = schema.find("Message").expect("Message definition"); - let message = schema.decode_message(root, &raw_message).expect("decode synthetic message"); - let (rest, warnings) = map::to_rest(&message, "connector labels"); - let layers = rest.pointer("/document/children/0/children").and_then(serde_json::Value::as_array).expect("page layers"); - - let plain = connector(layers, "Connector line"); - assert_eq!(plain["type"], "VECTOR", "an unlabelled connector stays one vector"); - assert_eq!(plain["strokeCapStart"], "ROUND"); - assert_eq!(plain["strokeCapEnd"], "LINE_ARROW"); - assert!(plain.get("children").is_none()); - - let alpha = connector(layers, "STRAIGHT alpha"); - let alpha_children = alpha["children"].as_array().expect("snapshot children"); - let alpha_vector = alpha_children.iter().find(|child| child["type"] == "VECTOR").expect("saved connector vector"); - let segments = alpha_vector.pointer("/vectorNetwork/segments").and_then(serde_json::Value::as_array).expect("editable vector network"); - assert_eq!(segments.len(), 4, "network preserves the label gap as two disconnected runs"); - assert_eq!(alpha_children.iter().filter(|child| child["type"] == "TEXT").count(), 1); - let alpha_text = alpha_children.iter().find(|child| child["type"] == "TEXT").expect("label text"); - assert_eq!(alpha_text["characters"], "STRAIGHT alpha"); - assert_eq!(alpha_text["relativeTransform"], serde_json::json!([[1.0, 0.0, 201.5], [0.0, 1.0, 44.0]])); - assert!(warnings.iter().all(|warning| !warning.contains("connector labels were skipped"))); - - let mut malformed = message.clone(); - let alpha_node = connector_mut(&mut malformed, 127).expect("alpha node in decoded message"); - let derived = field_mut(alpha_node, "derivedImmutableFrameData").expect("derived frame data"); - let overrides = field_mut(derived, "overrides").expect("derived overrides"); - let Kv::Array(overrides) = overrides else { panic!("derived overrides array") }; - let text = overrides - .iter_mut() - .find(|row| { - row.get("guidPath") - .and_then(|path| path.get("guids")) - .and_then(|ids| ids.list().first()) - .and_then(|id| id.get("localID")) - .and_then(Kv::f64) - == Some(1.0) - }) - .expect("text template record"); - let transform = field_mut(text, "transform").expect("text transform"); - *transform = Kv::Object(vec![ - ("m00", Kv::Float(1.0)), - ("m01", Kv::Float(0.0)), - ("m02", Kv::Float(f32::NAN)), - ("m10", Kv::Float(0.0)), - ("m11", Kv::Float(1.0)), - ("m12", Kv::Float(0.0)), - ]); - let (malformed_rest, malformed_warnings) = map::to_rest(&malformed, "connector labels"); - let malformed_layers = malformed_rest.pointer("/document/children/0/children").and_then(serde_json::Value::as_array).expect("page layers"); - let malformed_alpha = connector(malformed_layers, "STRAIGHT alpha"); - assert_eq!(malformed_alpha["children"].as_array().map(Vec::len), Some(1)); - assert_eq!(malformed_alpha["children"][0]["type"], "VECTOR"); - assert!(malformed_warnings.iter().any(|warning| warning == "connector label was skipped: text transform is invalid")); -} From 9b4e45aa0bc8327673c4fc6e97915fca6b8cca68 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 13:40:55 +0700 Subject: [PATCH 111/817] #711: move the vector.offset tests into their own module --- crates/engine/src/lib.rs | 2 + crates/engine/src/tests.rs | 38 ------------------ crates/engine/src/vector_offset_tests.rs | 49 ++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 38 deletions(-) create mode 100644 crates/engine/src/vector_offset_tests.rs diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 34653bd5f..8609fb211 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1710,6 +1710,8 @@ mod vector_behaviour_tests; #[cfg(test)] mod vector_multi_behaviour_tests; #[cfg(test)] +mod vector_offset_tests; +#[cfg(test)] mod version_preview_tests; #[cfg(test)] mod version_tests; diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index 746f417ed..dbf432d41 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -621,41 +621,3 @@ fn find_replace_changing_only_the_case_replaces_every_occurrence() { assert_eq!(s.doc().unwrap().node(t).unwrap().kind.text().unwrap().characters, "FigCraft and FigCraft, FigCraft"); assert_eq!(s.doc().unwrap().node(f).unwrap().name, "FigCraft / FigCraft"); } - -/// No node that holds children may be a non-container. -fn assert_children_only_in_containers(s: &Session, ids: &[NodeId]) { - let doc = s.doc().unwrap(); - for &i in ids { - let n = doc.node(i).unwrap(); - assert!(n.kind.is_container() || n.kind.is_frame_like() || n.children.is_empty(), "a non-container layer now holds children"); - } -} - -#[test] -fn offset_path_leaves_containers_with_children_alone() { - let mut s = sess(); - let f = id(&s.execute("frame.create", &json!({"x": 0, "y": 0, "width": 100, "height": 100})).unwrap()); - let inner = id(&s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 10, "height": 10, "parent": f})).unwrap()); - let a = id(&s.execute("shape.rectangle", &json!({"x": 200, "y": 0, "width": 10, "height": 10})).unwrap()); - let b = id(&s.execute("shape.rectangle", &json!({"x": 220, "y": 0, "width": 10, "height": 10})).unwrap()); - let g = id(&s.execute("object.group", &json!({"ids": [a, b]})).unwrap()); - for target in [f, g] { - s.execute("vector.offset", &json!({"ids": [target], "offset": 5})).unwrap(); - assert_children_only_in_containers(&s, &[f, g, inner, a, b]); - } - let doc = s.doc().unwrap(); - assert!(doc.node(f).unwrap().kind.is_container()); - assert_eq!(doc.node(f).unwrap().children, vec![inner]); - assert!(doc.node(g).unwrap().kind.is_container()); - assert_eq!(doc.node(g).unwrap().children.len(), 2); -} - -#[test] -fn offset_path_still_converts_a_plain_rectangle() { - let mut s = sess(); - let r = id(&s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap()); - s.execute("vector.offset", &json!({"ids": [r], "offset": 5})).unwrap(); - let n = s.doc().unwrap().node(r).unwrap().clone(); - assert!(matches!(n.kind, NodeKind::Vector { .. })); - assert!(n.width > 10.0); -} diff --git a/crates/engine/src/vector_offset_tests.rs b/crates/engine/src/vector_offset_tests.rs new file mode 100644 index 000000000..e47158f29 --- /dev/null +++ b/crates/engine/src/vector_offset_tests.rs @@ -0,0 +1,49 @@ +//! `vector.offset` on layers with children: containers are left alone. + +use serde_json::{Value, json}; + +use crate::Session; +use crate::params::id_of; +use figcraft_doc::{NodeId, NodeKind}; + +fn id(v: &Value) -> NodeId { + id_of(&v["id"]).unwrap() +} + +/// No node that holds children may be a non-container. +fn assert_children_only_in_containers(s: &Session, ids: &[NodeId]) { + let doc = s.doc().unwrap(); + for &i in ids { + let n = doc.node(i).unwrap(); + assert!(n.kind.is_container() || n.kind.is_frame_like() || n.children.is_empty(), "a non-container layer now holds children"); + } +} + +#[test] +fn offset_path_leaves_containers_with_children_alone() { + let mut s = Session::new(); + let f = id(&s.execute("frame.create", &json!({"x": 0, "y": 0, "width": 100, "height": 100})).unwrap()); + let inner = id(&s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 10, "height": 10, "parent": f})).unwrap()); + let a = id(&s.execute("shape.rectangle", &json!({"x": 200, "y": 0, "width": 10, "height": 10})).unwrap()); + let b = id(&s.execute("shape.rectangle", &json!({"x": 220, "y": 0, "width": 10, "height": 10})).unwrap()); + let g = id(&s.execute("object.group", &json!({"ids": [a, b]})).unwrap()); + for target in [f, g] { + s.execute("vector.offset", &json!({"ids": [target], "offset": 5})).unwrap(); + assert_children_only_in_containers(&s, &[f, g, inner, a, b]); + } + let doc = s.doc().unwrap(); + assert!(doc.node(f).unwrap().kind.is_container()); + assert_eq!(doc.node(f).unwrap().children, vec![inner]); + assert!(doc.node(g).unwrap().kind.is_container()); + assert_eq!(doc.node(g).unwrap().children.len(), 2); +} + +#[test] +fn offset_path_still_converts_a_plain_rectangle() { + let mut s = Session::new(); + let r = id(&s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap()); + s.execute("vector.offset", &json!({"ids": [r], "offset": 5})).unwrap(); + let n = s.doc().unwrap().node(r).unwrap().clone(); + assert!(matches!(n.kind, NodeKind::Vector { .. })); + assert!(n.width > 10.0); +} From ee3e3f0bd423c3fc713f8e2a4672124313332931 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 13:44:34 +0700 Subject: [PATCH 112/817] #637: skip ink only counts under an underline The public docs don't give a default for skip ink; they say the value is unset when the text isn't underlined, and the exporter always wrote it on. So the export keeps writing on for text without an underline and the real value under one (that's what the canvas draws), and the import leaves a value on text without an underline out of the decoration look, so plain text keeps the default look and round-trips unchanged. The native default stays off, so existing documents draw as before. --- crates/format/src/fig/export.rs | 7 ++- crates/format/src/fig/interop_tests.rs | 3 +- crates/format/src/fig/text_skip_ink_tests.rs | 45 +++++++++++++++++--- crates/format/src/rest/text.rs | 7 +++ 4 files changed, 53 insertions(+), 9 deletions(-) diff --git a/crates/format/src/fig/export.rs b/crates/format/src/fig/export.rs index dd3f2e886..475f8ceb3 100644 --- a/crates/format/src/fig/export.rs +++ b/crates/format/src/fig/export.rs @@ -2392,13 +2392,14 @@ fn key_codes(key: &str) -> Option<(Vec, bool)> { Some((codes, false)) } -/// The text style fields of a layer or of an override table entry. +/// Whether the decoration look has more than skip ink, which the file can't hold. fn unsupported_decoration_look(st: &TextStyle) -> bool { let mut look = st.look(); look.skip_ink = false; look != Default::default() } +/// The text style fields of a layer or of an override table entry. fn style_fields(st: &TextStyle, f: &mut Fields) { let line_height = match st.line_height { // Percent units count from the font's own line height (100 % is "auto"); a share of the @@ -2430,7 +2431,9 @@ fn style_fields(st: &TextStyle, f: &mut Fields) { ("letterSpacing", letter_spacing), ("textCase", e(case)), ("textDecoration", e(decoration)), - ("textDecorationSkipInk", b(st.look().skip_ink)), + // Skip ink only shows on an underline; other text gets the files' default (on), the value + // the import leaves out again. + ("textDecorationSkipInk", b(st.look().skip_ink || st.decoration != TextDecoration::Underline)), ]); if let Some(url) = &st.link { f.push(("hyperlink", o(vec![("url", s(url))]))); diff --git a/crates/format/src/fig/interop_tests.rs b/crates/format/src/fig/interop_tests.rs index 56391975d..b51760c55 100644 --- a/crates/format/src/fig/interop_tests.rs +++ b/crates/format/src/fig/interop_tests.rs @@ -187,8 +187,7 @@ fn text_carries_its_layout_settings_and_a_line_per_paragraph() { with_changes(&sample(), |of, _| { let t = of("TEXT"); assert!(!flag(&t, "autoRename")); - assert!(flag(&t, "fontVariantCommonLigatures") && flag(&t, "fontVariantContextualLigatures")); - assert!(!flag(&t, "textDecorationSkipInk"), "default native text exports its actual false value"); + assert!(flag(&t, "fontVariantCommonLigatures") && flag(&t, "fontVariantContextualLigatures") && flag(&t, "textDecorationSkipInk")); assert_eq!(name(&t, "fontVersion"), ""); assert_eq!((num(&t, "textUserLayoutVersion"), num(&t, "textExplicitLayoutVersion"), num(&t, "textBidiVersion")), (5.0, 1.0, 1.0)); assert_eq!(num(&t, "textTracking"), 0.0); diff --git a/crates/format/src/fig/text_skip_ink_tests.rs b/crates/format/src/fig/text_skip_ink_tests.rs index 8d1cd295c..2a1ff61d7 100644 --- a/crates/format/src/fig/text_skip_ink_tests.rs +++ b/crates/format/src/fig/text_skip_ink_tests.rs @@ -1,8 +1,9 @@ -//! `.fig` text skip-ink values map, inherit and round-trip as native decoration look state. +//! `.fig` text skip-ink values map, inherit and round-trip as native decoration look state. Skip +//! ink only shows on an underline, so the fixtures are underlined. use super::kiwi::Kv; use super::{export, import}; -use figcraft_doc::{Document, NodeKind, StyleKind, StyleRun, TextData, TextStyle}; +use figcraft_doc::{Document, NodeKind, StyleKind, StyleRun, TextData, TextDecoration, TextStyle}; use serde_json::Value; fn object(fields: Vec<(&'static str, Kv<'static>)>) -> Kv<'static> { @@ -30,6 +31,7 @@ fn raw(base: Option>, runs: Vec>, chars: &str, ids: Vec< let mut layer = vec![ ("fontName", font()), ("fontSize", Kv::Float(20.0)), + ("textDecoration", Kv::Enum("UNDERLINE")), ( "textData", object(vec![ @@ -44,7 +46,8 @@ fn raw(base: Option>, runs: Vec>, chars: &str, ids: Vec< } let mut nodes = vec![node(1, "DOCUMENT", "Document", None, vec![]), node(2, "CANVAS", "Page", Some(1), vec![])]; if let Some(shared) = shared { - let mut fields = vec![("styleType", Kv::Enum("TEXT")), ("fontName", font()), ("fontSize", Kv::Float(20.0))]; + let mut fields = + vec![("styleType", Kv::Enum("TEXT")), ("fontName", font()), ("fontSize", Kv::Float(20.0)), ("textDecoration", Kv::Enum("UNDERLINE"))]; if let Some(value) = shared { fields.push(("textDecorationSkipInk", value)); } @@ -125,6 +128,7 @@ fn instance_path_override_preserves_explicit_false_over_true_main() { vec![ ("fontName", font()), ("fontSize", Kv::Float(20.0)), + ("textDecoration", Kv::Enum("UNDERLINE")), ("textDecorationSkipInk", Kv::Bool(true)), ("textData", object(vec![("characters", Kv::Str("A".into()))])), ], @@ -172,6 +176,7 @@ fn instance_path_override_preserves_explicit_false_over_true_main() { fn export_writes_one_actual_node_value_and_complete_run_values_without_skip_only_warning() { let mut doc = Document::new("Skip ink export"); let mut text = TextData::new("abcd"); + text.style.decoration = TextDecoration::Underline; text.style.set_look(|look| look.skip_ink = false); let mut skipped = text.style.clone(); skipped.set_look(|look| look.skip_ink = true); @@ -209,9 +214,9 @@ fn export_writes_one_actual_node_value_and_complete_run_values_without_skip_only let (_, warnings) = export(&variable_doc, None).unwrap(); assert!(warnings.iter().any(|w| w.contains("variable font settings")), "variation warning missing: {warnings:?}"); - let mut shared = TextStyle::default(); + let mut shared = TextStyle { decoration: TextDecoration::Underline, ..TextStyle::default() }; shared.set_look(|look| look.skip_ink = true); - let mut local = TextStyle::default(); + let mut local = TextStyle { decoration: TextDecoration::Underline, ..TextStyle::default() }; local.set_look(|look| look.skip_ink = false); let mut linked_doc = Document::new("Shared skip ink"); linked_doc.styles.push(figcraft_doc::Style { @@ -235,3 +240,33 @@ fn export_writes_one_actual_node_value_and_complete_run_values_without_skip_only let StyleKind::Text { style } = &linked.kind else { panic!("shared style link must remain text") }; assert!(style.look().skip_ink, "local false must not alter the shared definition"); } + +#[test] +fn skip_ink_without_an_underline_stays_out_of_the_look_and_exports_the_default() { + // Plain text with the files' default value imports with the default look... + let mut value = raw(Some(Kv::Bool(true)), vec![], "ab", vec![0, 0], None); + value["document"]["children"][0]["children"][0]["style"].as_object_mut().unwrap().remove("textDecoration"); + let doc = imported(&value); + assert_eq!(label(&doc).style.decoration, TextDecoration::None); + assert!(label(&doc).style.decoration_look.is_none()); + + // ...an underlined run of it keeps the layer's value... + let mut value = + raw(Some(Kv::Bool(true)), vec![object(vec![("styleID", Kv::Uint(1)), ("textDecoration", Kv::Enum("UNDERLINE"))])], "ab", vec![1, 0], None); + value["document"]["children"][0]["children"][0]["style"].as_object_mut().unwrap().remove("textDecoration"); + let doc = imported(&value); + assert_eq!((0..2).map(|i| skip_at(label(&doc), i)).collect::>(), vec![true, false]); + + // ...and default native text writes the default, which reads back as the default look. + let mut doc = Document::new("Plain"); + doc.create(doc.first_page().unwrap(), NodeKind::Text(TextData::new("x")), "Label", 0.0, 0.0, 100.0, 30.0).unwrap(); + let (bytes, _) = export(&doc, None).unwrap(); + let archive = super::Archive::open(&bytes).unwrap(); + let (schema, body) = super::decode_canvas(&archive.canvas).unwrap(); + let message = schema.decode_message(schema.find("Message").unwrap(), &body).unwrap(); + let value = super::debug_json(&message); + let layer = value["nodeChanges"].as_array().unwrap().iter().find(|n| n["name"] == "Label").unwrap(); + assert_eq!(layer["textDecorationSkipInk"], true); + let (back, _) = import(&bytes, "Plain").unwrap(); + assert!(label(&back).style.decoration_look.is_none()); +} diff --git a/crates/format/src/rest/text.rs b/crates/format/src/rest/text.rs index 3875204f3..f607c2920 100644 --- a/crates/format/src/rest/text.rs +++ b/crates/format/src/rest/text.rs @@ -27,6 +27,13 @@ pub(super) fn text_data(cx: &mut Ctx, v: &Value) -> TextData { let mut td = TextData { characters, style: base, ..TextData::default() }; paragraph(style_json, &mut td); td.runs = runs(cx, v, &td); + // Skip ink only shows on an underline. A file can carry it on any text, so elsewhere it stays out + // of the look (runs have inherited the base value by now). + for st in std::iter::once(&mut td.style).chain(td.runs.iter_mut().map(|r| &mut r.style)) { + if st.decoration != TextDecoration::Underline && st.look().skip_ink { + st.set_look(|l| l.skip_ink = false); + } + } td.normalize(); lists(v, &mut td); td From 6023d3547a2a8b056e2f3c0c68cefc45607cbdc9 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 13:45:15 +0700 Subject: [PATCH 113/817] #617: leave progress docs to the maintainer's docs PR --- 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 dcd756915..d8e517119 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -17,7 +17,7 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| -| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, per-point stroke joins (strokes that are dashed or variable-width still draw with the layer's join, with a warning), end caps; outlines when the network is missing or damaged), auto layout (grid included), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Not read: connector labels, table cells beyond their own layers, filled areas with their own fills, variables bound to fields the editor can't bind, fixed or content-sized grid tracks, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs`, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | +| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Not read: connector labels, table cells beyond their own layers, filled areas with their own fills, per-point stroke joins, variables bound to fields the editor can't bind, fixed or content-sized grid tracks, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs`, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | | REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout, constraints, grids, components, sets, instances with overrides, component properties, styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | From 7fe0770b9d74a072bdccae449edc347819617231 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 13:45:16 +0700 Subject: [PATCH 114/817] #617: point joins equal to the layer's no longer count as point styles (SVG keeps a plain stroke) --- crates/doc/src/vector.rs | 6 +++--- crates/pathops/src/points.rs | 3 +-- crates/render/src/draw.rs | 2 +- crates/svg/src/lib.rs | 2 +- crates/svg/src/tests.rs | 25 +++++++++++++++++++++++++ 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/crates/doc/src/vector.rs b/crates/doc/src/vector.rs index fd0a0f7ed..1165bd600 100644 --- a/crates/doc/src/vector.rs +++ b/crates/doc/src/vector.rs @@ -468,9 +468,9 @@ impl VectorNetwork { start_dir(&self.outward(seg, at_a)?) } - /// Whether any point has a stroke cap or join of its own. - pub fn has_point_styles(&self) -> bool { - self.vertices.iter().any(|v| v.cap.is_some() || v.join.is_some()) + /// Whether any point has a stroke cap of its own or a join other than the layer's `layer_join`. + pub fn has_point_styles(&self, layer_join: StrokeJoin) -> bool { + self.vertices.iter().any(|v| v.cap.is_some() || v.join.is_some_and(|j| j != layer_join)) } /// The fill path: every region's loops. diff --git a/crates/pathops/src/points.rs b/crates/pathops/src/points.rs index 9c161b7c1..05f58216d 100644 --- a/crates/pathops/src/points.rs +++ b/crates/pathops/src/points.rs @@ -20,8 +20,7 @@ impl Styled { /// shortcut: dashed, variable-width and brush strokes keep the layer's caps and joins at every point; stroke them run by run too if asked for. /// Joins equal to the layer do not require styled runs; stored overrides remain unchanged. pub(crate) fn new(net: &VectorNetwork, props: &StrokeProps) -> Option { - let styled = net.vertices.iter().any(|v| v.cap.is_some() || v.join.is_some_and(|join| join != props.join)); - if !styled || !props.dashes.is_empty() || props.profile().is_some() || props.brush.is_some() { + if !net.has_point_styles(props.join) || !props.dashes.is_empty() || props.profile().is_some() || props.brush.is_some() { return None; } let mut net = net.rounded().unwrap_or_else(|| net.clone()); diff --git a/crates/render/src/draw.rs b/crates/render/src/draw.rs index 7bfafd33b..021af92df 100644 --- a/crates/render/src/draw.rs +++ b/crates/render/src/draw.rs @@ -155,7 +155,7 @@ pub fn stroke_area(n: &Node, path: &BezPath, closed: bool) -> Arc { props.dashes.len().hash(&mut h); // Points' own caps and joins (vector networks). let net = match &n.kind { - NodeKind::Vector { network } if network.has_point_styles() => Some(network), + NodeKind::Vector { network } if network.has_point_styles(props.join) => Some(network), _ => None, }; for v in net.map(|n| n.vertices.as_slice()).unwrap_or_default() { diff --git a/crates/svg/src/lib.rs b/crates/svg/src/lib.rs index a68130175..1433b9428 100644 --- a/crates/svg/src/lib.rs +++ b/crates/svg/src/lib.rs @@ -638,7 +638,7 @@ impl W<'_> { || k.brush.is_some() || k.cap_start.is_arrow() || k.cap_end.is_arrow() - || matches!(&n.kind, NodeKind::Vector { network } if network.has_point_styles()) + || matches!(&n.kind, NodeKind::Vector { network } if network.has_point_styles(k.join)) || !(w.is_finite() && w > 0.0) { return None; diff --git a/crates/svg/src/tests.rs b/crates/svg/src/tests.rs index b15cd999d..5a333d078 100644 --- a/crates/svg/src/tests.rs +++ b/crates/svg/src/tests.rs @@ -115,3 +115,28 @@ fn text_run_fill_survives_live_text_export() { assert!(svg.contains("#000000"), "{svg}"); assert!(svg.contains("fill=\"#00FF00\"") && svg.contains(">b") && svg.contains(">a"), "{svg}"); } + +#[test] +fn point_joins_equal_to_the_layer_join_keep_a_plain_stroke() { + use figcraft_doc::{StrokeJoin, VectorNetwork}; + use figcraft_geom::kurbo::Point; + let svg_with = |join: StrokeJoin| { + let mut network = VectorNetwork::from_points(&[Point::new(0.0, 0.0), Point::new(50.0, 50.0), Point::new(100.0, 0.0)], false); + for v in &mut network.vertices { + v.join = Some(StrokeJoin::Miter); + } + if let Some(v) = network.vertices.get_mut(1) { + v.join = Some(join); + } + let mut d = Document::new("t"); + let p = d.first_page().unwrap(); + let v = d.create(p, NodeKind::Vector { network }, "V", 0.0, 0.0, 100.0, 50.0).unwrap(); + let n = d.get_mut(v).unwrap(); + n.strokes = vec![Paint::solid(Color::from_hex("000000").unwrap())]; + n.stroke.weight = 2.0; + n.stroke.join = StrokeJoin::Miter; + export_svg(&d, &[v], &SvgOptions::default()).unwrap() + }; + assert!(svg_with(StrokeJoin::Miter).contains("stroke-width=\"2\""), "equal joins stay a stroke"); + assert!(!svg_with(StrokeJoin::Round).contains("stroke-width="), "a differing join is drawn as an outline"); +} From d9e79d604b8d34fbea7eff367e90afdc67868c51 Mon Sep 17 00:00:00 2001 From: Skyfuller1303 Date: Fri, 16 Oct 2026 02:34:42 +0200 Subject: [PATCH 115/817] M1: distinguish unresolved vector segment style metadata in .fig import The vector network decoder now keeps each segment's style id. Import reports a segment style that names a row of the layer's style table as metadata that was not interpreted, and one that names no row as a reference to a missing style entry, each at most once per file. The earlier note claimed that stroke styles were left out, which overstated what is known about the metadata. Segment geometry, paint and width are unchanged, and the style ids are not kept in the native vector model. --- crates/format/src/fig/export.rs | 8 +++- crates/format/src/fig/map.rs | 25 ++++++++--- crates/format/src/fig/network.rs | 11 ++--- crates/format/src/fig/tail_tests.rs | 64 ++++++++++++++++++++++------- 4 files changed, 83 insertions(+), 25 deletions(-) diff --git a/crates/format/src/fig/export.rs b/crates/format/src/fig/export.rs index bfd0b6155..7443c8deb 100644 --- a/crates/format/src/fig/export.rs +++ b/crates/format/src/fig/export.rs @@ -1669,7 +1669,13 @@ impl<'d> Exporter<'d> { let segments = net .segments .iter() - .map(|sg| network::Segment { a: sg.a, ta: (finite(sg.ta.0), finite(sg.ta.1)), b: sg.b, tb: (finite(sg.tb.0), finite(sg.tb.1)) }) + .map(|sg| network::Segment { + style: 0, + a: sg.a, + ta: (finite(sg.ta.0), finite(sg.ta.1)), + b: sg.b, + tb: (finite(sg.tb.0), finite(sg.tb.1)), + }) .collect(); let regions = net .regions diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 0fe446629..36f45f318 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -1192,12 +1192,29 @@ impl<'a> Mapper<'a> { fn network(&mut self, o: &mut Obj, v: &View<'a>) -> bool { let Some(vd) = v.get("vectorData") else { return false }; let Some(blob) = num(vd, "vectorNetworkBlob").and_then(|i| self.blobs.get(i as usize)).copied() else { return false }; - let Some((net, styled_segments)) = network::decode_styled(blob) else { + let Some((net, _)) = network::decode_styled(blob) else { self.warn("damaged vector networks import as outlines"); return false; }; - if styled_segments > 0 { - self.warn("stroke styles of single vector network segments were left out"); + let styles: BTreeMap = + vd.get("styleOverrideTable").map(Kv::list).unwrap_or_default().iter().filter_map(|s| Some((num(s, "styleID")? as u64, s))).collect(); + let mut has_uninterpreted = false; + let mut has_missing = false; + for segment in &net.segments { + if segment.style == 0 { + continue; + } + if styles.contains_key(&u64::from(segment.style)) { + has_uninterpreted = true; + } else { + has_missing = true; + } + } + if has_uninterpreted { + self.warn("style settings of some vector segments aren't supported; those segments use the layer's stroke"); + } + if has_missing { + self.warn("some vector segments refer to style settings missing from the file; they use the layer's stroke"); } // An open path shows its fill, which regions can't hold: the outline keeps the look. let fills_shown = @@ -1205,8 +1222,6 @@ impl<'a> Mapper<'a> { if net.segments.is_empty() || (net.regions.is_empty() && fills_shown && o.contains_key("fillGeometry")) { return false; } - let styles: BTreeMap = - vd.get("styleOverrideTable").map(Kv::list).unwrap_or_default().iter().filter_map(|s| Some((num(s, "styleID")? as u64, s))).collect(); let style = |id: u32| styles.get(&u64::from(id)).copied().filter(|_| id != 0); let scale = |k: &str| { let size = v.size().map(|s| if k == "x" { s.0 } else { s.1 }); diff --git a/crates/format/src/fig/network.rs b/crates/format/src/fig/network.rs index d251dff15..4e8c3ad75 100644 --- a/crates/format/src/fig/network.rs +++ b/crates/format/src/fig/network.rs @@ -17,6 +17,7 @@ pub(super) struct Vertex { } pub(super) struct Segment { + pub style: u32, pub a: usize, pub ta: (f64, f64), pub b: usize, @@ -70,8 +71,7 @@ pub(super) fn decode(b: &[u8]) -> Option { decode_styled(b).map(|(net, _)| net) } -/// The network in blob `b` and how many of its segments have a style id of their own (per-segment -/// stroke overrides, which the document model can't hold); `None` as for `decode`. +/// The network in blob `b` and how many of its segments have a nonzero style id; `None` as for `decode`. pub(super) fn decode_styled(b: &[u8]) -> Option<(Network, usize)> { let mut r = Reader { b, pos: 0 }; let (nv, ns, nr) = (r.u32()? as usize, r.u32()? as usize, r.u32()? as usize); @@ -84,10 +84,11 @@ pub(super) fn decode_styled(b: &[u8]) -> Option<(Network, usize)> { } let mut styled = 0usize; for _ in 0..ns { - if r.u32()? != 0 { + let style = r.u32()?; + if style != 0 { styled += 1; } - net.segments.push(Segment { a: r.index(nv)?, ta: (r.f32()?, r.f32()?), b: r.index(nv)?, tb: (r.f32()?, r.f32()?) }); + net.segments.push(Segment { style, a: r.index(nv)?, ta: (r.f32()?, r.f32()?), b: r.index(nv)?, tb: (r.f32()?, r.f32()?) }); } let mut entries = 0usize; for _ in 0..nr { @@ -120,7 +121,7 @@ pub(super) fn encode(net: &Network) -> Vec { fl(v.y, &mut out); } for s in &net.segments { - u(0, &mut out); + u(s.style, &mut out); u(s.a as u32, &mut out); fl(s.ta.0, &mut out); fl(s.ta.1, &mut out); diff --git a/crates/format/src/fig/tail_tests.rs b/crates/format/src/fig/tail_tests.rs index 5d34f23b6..bc4f31cc4 100644 --- a/crates/format/src/fig/tail_tests.rs +++ b/crates/format/src/fig/tail_tests.rs @@ -9,7 +9,7 @@ use super::super::network::{self, Network, Region, Segment, Vertex}; use super::*; fn seg(a: usize, b: usize, ta: (f64, f64), tb: (f64, f64)) -> Segment { - Segment { a, ta, b, tb } + Segment { style: 0, a, ta, b, tb } } fn vtx(style: u32, x: f64, y: f64) -> Vertex { @@ -264,21 +264,33 @@ fn vectors_import_as_editable_networks() { #[test] fn per_segment_stroke_styles_are_reported() { - let mut blob = square_blob(); - // The first segment's style id follows the counts and the vertices (12 bytes each). - blob[12 + 4 * 12..12 + 4 * 12 + 4].copy_from_slice(&7u32.to_le_bytes()); - let (net, styled) = network::decode_styled(&blob).unwrap(); - assert_eq!((net.segments.len(), styled), (4, 1)); + let styled_import = |segment_style: u32| { + let mut blob = square_blob(); + // The first segment's style id follows the counts and the vertices (12 bytes each). + blob[12 + 4 * 12..12 + 4 * 12 + 4].copy_from_slice(&segment_style.to_le_bytes()); + let (net, styled) = network::decode_styled(&blob).unwrap(); + assert_eq!((net.segments.len(), net.segments[0].style, styled), (4, segment_style, 1)); + let mut message = tail_message(); + let Kv::Object(fields) = &mut message else { panic!() }; + let Kv::Array(blobs) = &mut fields.iter_mut().find(|(key, _)| *key == "blobs").unwrap().1 else { panic!() }; + blobs[1] = o(vec![("bytes", Kv::Bytes(blob))]); + let (doc, warnings) = import(&canvas(&schema(), &message), "Tail").unwrap(); + assert_eq!(network_of(&doc, "Wave").segments.len(), 4); + warnings + }; assert_eq!(network::decode_styled(&square_blob()).unwrap().1, 0); let plain = import(&tail_canvas(), "Tail").unwrap().1; - assert!(!plain.iter().any(|w| w.contains("stroke styles of single")), "{plain:?}"); - let mut message = tail_message(); - let Kv::Object(fields) = &mut message else { panic!() }; - let Kv::Array(blobs) = &mut fields.iter_mut().find(|(key, _)| *key == "blobs").unwrap().1 else { panic!() }; - blobs[1] = o(vec![("bytes", Kv::Bytes(blob))]); - let (doc, warnings) = import(&canvas(&schema(), &message), "Tail").unwrap(); - assert!(warnings.iter().any(|w| w.contains("stroke styles of single vector network segments were left out")), "{warnings:?}"); - assert_eq!(network_of(&doc, "Wave").segments.len(), 4); + assert!(!plain.iter().any(|w| w.contains("vector segments")), "{plain:?}"); + let uninterpreted = |w: &String| w.contains("style settings of some vector segments aren't supported; those segments use the layer's stroke"); + let missing = |w: &String| w.contains("some vector segments refer to style settings missing from the file; they use the layer's stroke"); + // Style 1 has a row in the layer's override table; its contents are not applied. + let known = styled_import(1); + assert_eq!(known.iter().filter(|w| uninterpreted(w)).count(), 1, "{known:?}"); + assert!(!known.iter().any(missing), "{known:?}"); + // Style 7 names no row at all. + let unknown = styled_import(7); + assert_eq!(unknown.iter().filter(|w| missing(w)).count(), 1, "{unknown:?}"); + assert!(!unknown.iter().any(uninterpreted), "{unknown:?}"); } #[test] @@ -385,6 +397,30 @@ fn damaged_network_blobs_never_panic() { } } +#[test] +fn segment_styles_round_trip_without_changing_geometry() { + let original = Network { + vertices: vec![vtx(0, 2.0, 3.0), vtx(0, 10.0, 20.0), vtx(0, 40.0, 50.0), vtx(0, 60.0, 70.0)], + segments: vec![ + seg(0, 1, (1.0, 2.0), (3.0, 4.0)), + Segment { style: 17, a: 1, ta: (5.0, 6.0), b: 2, tb: (7.0, 8.0) }, + Segment { style: 27, a: 2, ta: (9.0, 10.0), b: 3, tb: (11.0, 12.0) }, + ], + regions: vec![], + }; + let bytes = network::encode(&original); + let (decoded, styled) = network::decode_styled(&bytes).unwrap(); + assert_eq!(styled, 2); + assert_eq!(decoded.segments.len(), 3); + for (got, want) in decoded.segments.iter().zip(&original.segments) { + assert_eq!(got.style, want.style); + assert_eq!((got.a, got.ta, got.b, got.tb), (want.a, want.ta, want.b, want.tb)); + } + for cut in 0..bytes.len() { + assert!(network::decode_styled(&bytes[..cut]).is_none(), "truncated at {cut}"); + } +} + #[test] fn mangled_tail_files_never_panic() { let c = tail_canvas(); From 22bdad22fe84f793a3b7b0b9491d31b61cebadfd Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 13:46:21 +0700 Subject: [PATCH 116/817] #656: leave progress docs to the maintainer's docs PR --- docs/file-format-parity.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index c9e5da2f4..d8e517119 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (`.fig` import: images carried in the message (`image.dataBlob`); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-14 · **Change:** minor (SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) Every format Figma reads or writes, with FigCraft's support. Sources: `Info.plist` of `/Applications/Figma.app` (document types only; nothing inside the bundle's code was read), Figma's @@ -17,7 +17,7 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| -| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills (from the archive, or carried in the message itself as `image.dataBlob`, the way copies written by plugins and tools carry them) come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Not read: connector labels, table cells beyond their own layers, filled areas with their own fills, per-point stroke joins, variables bound to fields the editor can't bind, fixed or content-sized grid tracks, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs`, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | +| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Not read: connector labels, table cells beyond their own layers, filled areas with their own fills, per-point stroke joins, variables bound to fields the editor can't bind, fixed or content-sized grid tracks, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs`, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | | REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout, constraints, grids, components, sets, instances with overrides, component properties, styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | @@ -162,7 +162,6 @@ each. | Date | Change | Summary | |---|---|---| -| 2026-10-16 | minor | `.fig` import: image fills whose bytes travel in the message itself (`image.dataBlob`, an index into the message's blobs) come across. Copies written by plugins and tools carry their images this way, and a bare canvas, the shape the clipboard holds, has no `images/`: they were grey placeholders. Blobs over the image size cap and indexes past the blobs are skipped (placeholder, as before). Checked on a bare canvas generated in code and on copies written by an HTML-to-Figma browser extension. Numbers unchanged | | 2026-10-14 | minor | SVG/PDF depth overflow (#208) is checked before bounds and drawing; public checked APIs return the offending root/layer, commands and CLI report it, and no incomplete export replaces an existing file. Tested at depths 255/256/257, with inner roots, hidden branches, masks, raster fallbacks and multiple roots/pages. Numbers unchanged. | | 2026-10-13 | minor | `.fig` export (gap 1): instances write what they change from their main as an override addressed by the main's id (their size, name and paints were lost elsewhere without it), what follows for their layers as derived data, and a scale factor when scaled as a whole; layers of a nested instance swapped for another component keep their overrides; variable collections, modes, variables and their bindings, the modes frames and pages set, shared styles with their links and variable-width strokes are written, and the import reads all of it back (style definitions and unused styles, variable order and scopes, bindings on paint lists, gradient stops, effects and layout grids, page modes, text field bindings, which a `.fig` import used to drop, and width profiles). Opened `.fig` and file JSON documents link nested instances of variants (and any nested instance under a name of its own) to their main's layers; they stayed unlinked, so a second export lost what they changed. Checked by opening written files in other software: resized and scaled instances keep their size and lay their layers out for it, variables with their modes and colour bindings resolve there (a frame set to another mode shows that mode's colours, also inside instances), colour, text, effect and grid styles are listed, and variable-width strokes that are the same on both sides of the path draw with their width; number, string and boolean bindings and bindings on effects, layout guides and gradient stops come across as the values they give but did not show as bound there (their entries now also name the layer field they set, not yet checked there), and strokes wider on one side of the path are written as filled outlines, no longer editable strokes there (the stroke itself is kept as plugin data and our own import puts it back; not yet checked there). Numbers unchanged | | 2026-10-12 | minor | `.fig` export made to open elsewhere (gap 1): the document and its pages say they are visible and opaque (left out, nothing was drawn), the schema in the file uses the format's own names, kinds, field ids and enum values, rectangles are rounded rectangles with four radii, frames and shapes carry their fill outline and plain strokes their stroke outline, text carries its layout settings, font styles use their standard names, line heights that are a share of the font size are raw multipliers, masks keep their type (read back too); the import reads per-side stroke weights whose zero sides are left out. Written files were checked by opening them in other software: layers, fills, gradients, strokes, shadows, vectors, components and text draw as in FigCraft; effects such as glass and noise, images and prototype interactions are still unchecked there, and variables are not written. Numbers unchanged | From 99dc199bb89d2c0f7dfb6f508169e3cf78280073 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 13:46:22 +0700 Subject: [PATCH 117/817] #656: borrow embedded image bytes and copy only the ones a paint uses --- crates/format/src/fig/mod.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/format/src/fig/mod.rs b/crates/format/src/fig/mod.rs index 091492da3..90cdd05dc 100644 --- a/crates/format/src/fig/mod.rs +++ b/crates/format/src/fig/mod.rs @@ -66,7 +66,7 @@ pub fn import(bytes: &[u8], name: &str) -> Result<(Document, Vec), Forma let file_name = archive.file_name.as_deref().filter(|n| !n.trim().is_empty()).unwrap_or(name); let (json, mut warnings) = map::to_rest(&msg, file_name); let embedded = embedded_images(&msg); - let images = |r: &str| archive.image(r).or_else(|| embedded.get(r).cloned()); + let images = |r: &str| archive.image(r).or_else(|| embedded.get(r).map(|b| b.to_vec())); let (doc, more) = crate::rest::import(&json, &images)?; warnings.extend(more.into_iter().filter_map(map::adapt_warning)); Ok((doc, warnings)) @@ -100,8 +100,9 @@ fn corrupt(msg: impl Into) -> FormatError { /// Image bytes that travel inside the message, by image hash (lowercase hex): a paint's /// `image.dataBlob` indexes the message's `blobs`. Copies written by plugins and other tools embed /// their images this way, and a bare canvas (what the clipboard carries) has no `images/`. The -/// walk is iterative (no recursion on nested data) and skips blobs larger than [`MAX_IMAGE`]. -fn embedded_images(msg: &Kv) -> BTreeMap> { +/// walk is iterative (no recursion on nested data) and skips blobs larger than [`MAX_IMAGE`]. The +/// bytes stay borrowed from the message; only images a paint asks for are copied. +fn embedded_images<'m>(msg: &'m Kv) -> BTreeMap { let blobs = msg.get("blobs").map(Kv::list).unwrap_or_default(); let mut found = BTreeMap::new(); let mut pending = vec![msg]; @@ -109,7 +110,7 @@ fn embedded_images(msg: &Kv) -> BTreeMap> { match value { Kv::Object(fields) => { if let Some((hash, bytes)) = value.get("image").and_then(|image| embedded_image(image, blobs)) { - found.entry(hash).or_insert_with(|| bytes.to_vec()); + found.entry(hash).or_insert(bytes); } pending.extend(fields.iter().filter(|(name, _)| *name != "blobs").map(|(_, field)| field)); } From 5fba7e5dba98a275e858713289ed4f9fd3363672 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 13:48:56 +0700 Subject: [PATCH 118/817] #524: one kiwi value per compressed canvas byte (up to 128M), lower value and document.json ceilings on 32-bit targets --- crates/format/src/fig/kiwi.rs | 14 +++++++++----- crates/format/src/fig/tests.rs | 2 ++ crates/format/src/large_tests.rs | 4 +++- crates/format/src/lib.rs | 4 ++++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/crates/format/src/fig/kiwi.rs b/crates/format/src/fig/kiwi.rs index 46a9daacd..5c735b280 100644 --- a/crates/format/src/fig/kiwi.rs +++ b/crates/format/src/fig/kiwi.rs @@ -11,11 +11,15 @@ use std::fmt; /// Deepest struct/message nesting decoded. const MAX_DEPTH: usize = 64; /// Most values decoded from one message (every scalar, array element and field counts): at least -/// [`MIN_VALUES`], and one per [`PACKED_BYTES_PER_VALUE`] bytes of the file's compressed canvas, -/// so a large real file decodes while a small one can't expand into a huge tree, however far its -/// chunks inflate. +/// [`MIN_VALUES`], and one per byte of the file's compressed canvas up to [`MAX_VALUES`], so a +/// large real file decodes while a small one can't expand into a huge tree, however far its +/// chunks inflate. 32-bit targets (wasm32) have a 4 GB address space in all, so their ceiling is +/// lower: past it the file is refused cleanly instead of running out of memory. const MIN_VALUES: usize = 20_000_000; -const PACKED_BYTES_PER_VALUE: usize = 2; +#[cfg(not(target_pointer_width = "32"))] +const MAX_VALUES: usize = 128 << 20; +#[cfg(target_pointer_width = "32")] +const MAX_VALUES: usize = 32 << 20; /// Most definitions in a schema, and fields in one definition. const MAX_DEFS: usize = 10_000; const MAX_FIELDS: usize = 10_000; @@ -302,7 +306,7 @@ impl Schema { /// Most values decoded from a file whose compressed canvas is `packed` bytes. pub(crate) fn value_budget(packed: usize) -> usize { - MIN_VALUES.max(packed / PACKED_BYTES_PER_VALUE) + packed.clamp(MIN_VALUES, MAX_VALUES) } struct Decoder<'s, 'b> { diff --git a/crates/format/src/fig/tests.rs b/crates/format/src/fig/tests.rs index 574f860c2..ad9c85d05 100644 --- a/crates/format/src/fig/tests.rs +++ b/crates/format/src/fig/tests.rs @@ -629,6 +629,8 @@ fn large_files_get_a_larger_value_budget() { // A real 400 000-layer file: an 83.5 MB canvas whose message unpacks to 334 MB and holds // 30.5 million values was refused as "too many values". assert!(kiwi::value_budget(83_491_232) > 30_514_899); + // A real 194 MB design-system file (UX4G): a 39.5 MB canvas holding 29.7 million values. + assert!(kiwi::value_budget(39_528_420) > 29_703_730); // Still bounded by the largest canvas read. assert!(kiwi::value_budget(MAX_CANVAS as usize) <= 128 << 20); } diff --git a/crates/format/src/large_tests.rs b/crates/format/src/large_tests.rs index 2dc9eb4c1..889074f18 100644 --- a/crates/format/src/large_tests.rs +++ b/crates/format/src/large_tests.rs @@ -211,7 +211,9 @@ fn document_json_may_unpack_in_proportion_to_its_packed_size() { assert_eq!(document_limit(MB, 2 * MB), MAX_MEMBER); // A real 900 000-layer document saved by us packs 1 477 139 810 bytes into 244 362 923, and // didn't open again under the 512 MB cap. - assert!(document_limit(244_362_923, 260 * MB) > 1_477_139_810); + if cfg!(not(target_pointer_width = "32")) { + assert!(document_limit(244_362_923, 260 * MB) > 1_477_139_810); + } // The packed size an archive claims counts only up to the archive's own size. assert_eq!(document_limit(u64::MAX, MB), MAX_MEMBER); // Never more than the ceiling. diff --git a/crates/format/src/lib.rs b/crates/format/src/lib.rs index dd96b9323..9f7e51bc4 100644 --- a/crates/format/src/lib.rs +++ b/crates/format/src/lib.rs @@ -42,8 +42,12 @@ const MAX_MEMBER: u64 = 512 * 1024 * 1024; /// `document.json` may unpack to [`DOCUMENT_RATIO`] times what it takes in the archive, within /// [`MAX_MEMBER`] and [`MAX_DOCUMENT`]: a large document saved by us (a 900 000-layer file packs /// 1.48 GB into 244 MB) opens again, while a small archive still can't unpack into gigabytes. +/// 32-bit targets (wasm32) have a 4 GB address space in all, so their ceiling is lower. const DOCUMENT_RATIO: u64 = 16; +#[cfg(not(target_pointer_width = "32"))] const MAX_DOCUMENT: u64 = 4 * 1024 * 1024 * 1024; +#[cfg(target_pointer_width = "32")] +const MAX_DOCUMENT: u64 = 1024 * 1024 * 1024; /// Most versions a file keeps: saving more is refused, extra entries in a file are skipped. pub const MAX_VERSIONS: usize = 100; /// Longest version name and description kept (chars). From c605bd5781157431b756768e58add61a200d9fb6 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 13:49:46 +0700 Subject: [PATCH 119/817] #631: drop the styled-segment count nobody reads --- crates/format/src/fig/map.rs | 2 +- crates/format/src/fig/network.rs | 12 +++--------- crates/format/src/fig/tail_tests.rs | 23 +++++++++++------------ 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 36f45f318..94678e25e 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -1192,7 +1192,7 @@ impl<'a> Mapper<'a> { fn network(&mut self, o: &mut Obj, v: &View<'a>) -> bool { let Some(vd) = v.get("vectorData") else { return false }; let Some(blob) = num(vd, "vectorNetworkBlob").and_then(|i| self.blobs.get(i as usize)).copied() else { return false }; - let Some((net, _)) = network::decode_styled(blob) else { + let Some(net) = network::decode(blob) else { self.warn("damaged vector networks import as outlines"); return false; }; diff --git a/crates/format/src/fig/network.rs b/crates/format/src/fig/network.rs index 3adb0abf3..ccb5c2913 100644 --- a/crates/format/src/fig/network.rs +++ b/crates/format/src/fig/network.rs @@ -65,10 +65,8 @@ impl Reader<'_> { } } -/// The network in blob `b` and how many of its segments have a style id of their own (per-segment -/// stroke overrides, which the document model can't hold); `None` when it's truncated, out of -/// range or not finite. -pub(super) fn decode_styled(b: &[u8]) -> Option<(Network, usize)> { +/// The network in blob `b`; `None` when it's truncated, out of range or not finite. +pub(super) fn decode(b: &[u8]) -> Option { let mut r = Reader { b, pos: 0 }; let (nv, ns, nr) = (r.u32()? as usize, r.u32()? as usize, r.u32()? as usize); if nv > MAX_ITEMS || ns > MAX_ITEMS || nr > MAX_ITEMS || nv * 12 + ns * 28 + nr * 8 > b.len().saturating_sub(12) { @@ -78,12 +76,8 @@ pub(super) fn decode_styled(b: &[u8]) -> Option<(Network, usize)> { for _ in 0..nv { net.vertices.push(Vertex { style: r.u32()?, x: r.f32()?, y: r.f32()? }); } - let mut styled = 0usize; for _ in 0..ns { let style = r.u32()?; - if style != 0 { - styled += 1; - } net.segments.push(Segment { style, a: r.index(nv)?, ta: (r.f32()?, r.f32()?), b: r.index(nv)?, tb: (r.f32()?, r.f32()?) }); } let mut entries = 0usize; @@ -100,7 +94,7 @@ pub(super) fn decode_styled(b: &[u8]) -> Option<(Network, usize)> { } net.regions.push(Region { style: sw >> 1, non_zero: sw & 1 == 1, loops }); } - Some((net, styled)) + Some(net) } /// The blob of `net` (the export writes it; so do test fixtures). Callers pass finite values. diff --git a/crates/format/src/fig/tail_tests.rs b/crates/format/src/fig/tail_tests.rs index 363d2bdf7..a15334a56 100644 --- a/crates/format/src/fig/tail_tests.rs +++ b/crates/format/src/fig/tail_tests.rs @@ -268,8 +268,8 @@ fn per_segment_stroke_styles_are_reported() { let mut blob = square_blob(); // The first segment's style id follows the counts and the vertices (12 bytes each). blob[12 + 4 * 12..12 + 4 * 12 + 4].copy_from_slice(&segment_style.to_le_bytes()); - let (net, styled) = network::decode_styled(&blob).unwrap(); - assert_eq!((net.segments.len(), net.segments[0].style, styled), (4, segment_style, 1)); + let net = network::decode(&blob).unwrap(); + assert_eq!((net.segments.len(), net.segments[0].style), (4, segment_style)); let mut message = tail_message(); let Kv::Object(fields) = &mut message else { panic!() }; let Kv::Array(blobs) = &mut fields.iter_mut().find(|(key, _)| *key == "blobs").unwrap().1 else { panic!() }; @@ -278,7 +278,7 @@ fn per_segment_stroke_styles_are_reported() { assert_eq!(network_of(&doc, "Wave").segments.len(), 4); warnings }; - assert_eq!(network::decode_styled(&square_blob()).unwrap().1, 0); + assert!(network::decode(&square_blob()).unwrap().segments.iter().all(|s| s.style == 0)); let plain = import(&tail_canvas(), "Tail").unwrap().1; assert!(!plain.iter().any(|w| w.contains("vector segments")), "{plain:?}"); let uninterpreted = |w: &String| w.contains("style settings of some vector segments aren't supported; those segments use the layer's stroke"); @@ -367,9 +367,9 @@ fn unreadable_conditions_skip_the_conditional() { #[test] fn damaged_network_blobs_never_panic() { let good = square_blob(); - assert!(network::decode_styled(&good).is_some()); + assert!(network::decode(&good).is_some()); for cut in 0..good.len() { - assert!(network::decode_styled(&good[..cut]).is_none(), "{cut}"); + assert!(network::decode(&good[..cut]).is_none(), "{cut}"); } let mut r = Lcg(5); for _ in 0..5000 { @@ -378,7 +378,7 @@ fn damaged_network_blobs_never_panic() { let i = (r.next() as usize) % m.len(); m[i] ^= 1 << (r.next() % 8); } - if let Some((net, _)) = network::decode_styled(&m) { + if let Some(net) = network::decode(&m) { assert!(net.segments.iter().all(|s| s.a < net.vertices.len() && s.b < net.vertices.len())); assert!(net.regions.iter().flat_map(|r| &r.loops).flatten().all(|i| *i < net.segments.len())); assert!(net.vertices.iter().all(|v| v.x.is_finite() && v.y.is_finite())); @@ -387,13 +387,13 @@ fn damaged_network_blobs_never_panic() { // Counts larger than the blob, and indices out of range. let mut huge = vec![0xff; 12]; huge.extend_from_slice(&[0; 64]); - assert!(network::decode_styled(&huge).is_none()); + assert!(network::decode(&huge).is_none()); let mut bad = arrow_blob(); bad[12 + 24 + 4..12 + 24 + 8].copy_from_slice(&7u32.to_le_bytes()); - assert!(network::decode_styled(&bad).is_none()); + assert!(network::decode(&bad).is_none()); for _ in 0..2000 { let junk: Vec = (0..(r.next() % 120)).map(|_| r.next() as u8).collect(); - let _ = network::decode_styled(&junk); + let _ = network::decode(&junk); } } @@ -409,15 +409,14 @@ fn segment_styles_round_trip_without_changing_geometry() { regions: vec![], }; let bytes = network::encode(&original); - let (decoded, styled) = network::decode_styled(&bytes).unwrap(); - assert_eq!(styled, 2); + let decoded = network::decode(&bytes).unwrap(); assert_eq!(decoded.segments.len(), 3); for (got, want) in decoded.segments.iter().zip(&original.segments) { assert_eq!(got.style, want.style); assert_eq!((got.a, got.ta, got.b, got.tb), (want.a, want.ta, want.b, want.tb)); } for cut in 0..bytes.len() { - assert!(network::decode_styled(&bytes[..cut]).is_none(), "truncated at {cut}"); + assert!(network::decode(&bytes[..cut]).is_none(), "truncated at {cut}"); } } From 6233b90ba7684fc58af66804176c3e54dfa954fe Mon Sep 17 00:00:00 2001 From: Skyfuller1303 Date: Fri, 16 Oct 2026 02:36:24 +0200 Subject: [PATCH 120/817] M1: import editable text on a path from .fig files Supported TEXT_PATH layers import as editable native text on their vector path, including mixed text styles, a start inside a later segment and reversed text direction. The importer converts the segment parameter stored in the file to the native distance along the complete path. The mapping accepts a connected, unbranched path with one recognized start-segment marker and the default placement above the path. Damaged or unsupported path data keeps the text readable off its path and adds an import note. Other vertical placements, multiline text and ambiguous or disconnected networks are not converted. Underline and strikethrough remain a native path-rendering limitation and are reported. Public REST TEXT_PATH layers and the experimental .fig writer are unchanged. --- crates/format/src/fig/map.rs | 95 ++++++- crates/format/src/fig/mod.rs | 3 + crates/format/src/fig/text_path.rs | 315 +++++++++++++++++++++++ crates/format/src/fig/text_path_tests.rs | 211 +++++++++++++++ crates/format/src/rest/text.rs | 12 +- docs/gaps.md | 4 + 6 files changed, 637 insertions(+), 3 deletions(-) create mode 100644 crates/format/src/fig/text_path.rs create mode 100644 crates/format/src/fig/text_path_tests.rs diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 94678e25e..9a2b696d9 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -759,7 +759,7 @@ impl<'a> Mapper<'a> { "VARIABLE" | "VARIABLE_SET" => return None, t => stand.map_or(t, |s| s.0), }; - if let Some((_, what)) = stand { + if let Some((_, what)) = stand.filter(|_| own != "TEXT_PATH") { self.warn(format!("{} layers import as {what}", own.to_ascii_lowercase().replace('_', " "))); } self.count += 1; @@ -774,7 +774,12 @@ impl<'a> Mapper<'a> { copy_str(&mut o, &view, "name", "name"); self.common(&mut o, &view, ty, space, parent); match ty { - "TEXT" => self.text(&mut o, &view), + "TEXT" => { + self.text(&mut o, &view); + if own == "TEXT_PATH" { + self.text_path(&mut o, &view); + } + } "VECTOR" | "STAR" | "REGULAR_POLYGON" => self.geometry(&mut o, &view), "ELLIPSE" => { if let Some(a) = view.get("arcData") { @@ -1155,6 +1160,92 @@ impl<'a> Mapper<'a> { } } + /// Carry supported text-path data through the private .fig REST ingress only. + fn text_path(&mut self, o: &mut Obj, v: &View<'a>) { + let fail = |this: &mut Self, reason: &str| { + this.warn(format!("text path {reason}; text imports off its path")); + }; + let Some(start) = v.get("textPathStart") else { + fail(self, "has no start data"); + return; + }; + let (Some(t), Some(forward)) = (num(start, "tValue"), start.get("forward").and_then(Kv::bool)) else { + fail(self, "has invalid start data"); + return; + }; + let Some(vd) = v.get("vectorData") else { + fail(self, "has no vector data"); + return; + }; + let Some(blob) = num(vd, "vectorNetworkBlob") + .filter(|i| i.is_finite() && *i >= 0.0 && i.fract() == 0.0) + .and_then(|i| usize::try_from(i as u64).ok()) + .and_then(|i| self.blobs.get(i)) + .copied() + else { + fail(self, "has no vector network"); + return; + }; + let Some((net, _)) = network::decode_styled(blob) else { + fail(self, "has damaged vector data"); + return; + }; + let Some(norm) = vd.get("normalizedSize") else { + fail(self, "has invalid normalized size"); + return; + }; + let Some(size) = v.get("size") else { + fail(self, "has invalid dimensions"); + return; + }; + let (Some(nx), Some(ny), Some(w), Some(h)) = (num(norm, "x"), num(norm, "y"), num(size, "x"), num(size, "y")) else { + fail(self, "has invalid dimensions"); + return; + }; + let axis_scale = |size: f64, normalized: f64, values: &[f64]| -> Option { + if !size.is_finite() || size < 0.0 || !normalized.is_finite() || normalized < 0.0 { + return None; + } + if normalized > 1e-9 { + if size <= 0.0 { + return None; + } + return Some(size / normalized); + } + (size == 0.0 && values.iter().all(|v| *v == 0.0)).then_some(1.0) + }; + let xs: Vec = net.vertices.iter().map(|p| p.x).chain(net.segments.iter().flat_map(|s| [s.ta.0, s.tb.0])).collect(); + let ys: Vec = net.vertices.iter().map(|p| p.y).chain(net.segments.iter().flat_map(|s| [s.ta.1, s.tb.1])).collect(); + let sx = axis_scale(w, nx, &xs); + let sy = axis_scale(h, ny, &ys); + let (Some(sx), Some(sy)) = (sx, sy) else { + fail(self, "has invalid path scale"); + return; + }; + if v.str("textAlignVertical").is_some_and(|x| x != "TOP") { + fail(self, "uses unsupported vertical placement"); + return; + } + if v.get("textData").and_then(|td| td.get("characters")).and_then(Kv::str).is_some_and(|s| s.chars().any(|c| matches!(c, '\n' | '\r'))) { + fail(self, "contains multiple lines"); + return; + } + let path = match super::text_path::from_network(&net, sx, sy, t, forward) { + Ok(path) => path, + Err(reason) => { + fail(self, reason); + return; + } + }; + let has_decoration = |style: &Value| style.get("textDecoration").and_then(Value::as_str).is_some_and(|x| x != "NONE"); + let decorated = o.get("style").is_some_and(has_decoration) + || o.get("styleOverrideTable").and_then(Value::as_object).into_iter().flat_map(|styles| styles.values()).any(has_decoration); + if decorated { + self.warn("text path underline or strikethrough decoration is not rendered"); + } + o.insert("_figTextPath".into(), json!({"d": path.d, "start": path.start, "flip": path.flip})); + } + /// `fillGeometry` / `strokeGeometry` as SVG path data, and star/polygon parameters. fn geometry(&mut self, o: &mut Obj, v: &View<'a>) { for key in ["fillGeometry", "strokeGeometry"] { diff --git a/crates/format/src/fig/mod.rs b/crates/format/src/fig/mod.rs index 81457f8dd..2ad6e276e 100644 --- a/crates/format/src/fig/mod.rs +++ b/crates/format/src/fig/mod.rs @@ -24,6 +24,9 @@ mod network; mod source_identity_tests; #[cfg(test)] mod tests; +mod text_path; +#[cfg(test)] +mod text_path_tests; #[cfg(test)] mod text_style_tests; diff --git a/crates/format/src/fig/text_path.rs b/crates/format/src/fig/text_path.rs new file mode 100644 index 000000000..8a93f7e49 --- /dev/null +++ b/crates/format/src/fig/text_path.rs @@ -0,0 +1,315 @@ +//! Convert the simple vector network used by text-on-path layers in `.fig` files into a native text path. + +use figcraft_doc::{ + TextPath, + geom::{ + BezPath, + kurbo::{CubicBez, Line, ParamCurve, ParamCurveArclen, Point}, + }, +}; + +use super::network::{Network, Segment}; + +const START_SEGMENT_STYLE: u32 = 0x01ff_ffff; + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +struct Use { + segment: usize, + forward: bool, +} + +/// Build a native path from a validated connected chain or cycle. The marked source segment is +/// oriented a→b; `t` is local to that line/cubic. Coordinates are scaled into layer space. +pub(super) fn from_network(net: &Network, sx: f64, sy: f64, t: f64, forward: bool) -> Result { + if !t.is_finite() || !(0.0..=1.0).contains(&t) { + return Err("invalid start parameter"); + } + if !sx.is_finite() || !sy.is_finite() || sx <= 0.0 || sy <= 0.0 { + return Err("invalid path scale"); + } + let markers: Vec = net.segments.iter().enumerate().filter_map(|(i, s)| (s.style == START_SEGMENT_STYLE).then_some(i)).collect(); + let [marked] = markers.as_slice() else { + return Err("missing or ambiguous start segment marker"); + }; + + let (uses, closed) = ordered_chain(net, *marked)?; + let mut d = BezPath::new(); + let mut total = 0.0; + let mut prefix = 0.0; + let mut start_segment_length = 0.0; + for use_ in &uses { + let (p0, p1, p2, p3) = cubic(net, *use_, sx, sy)?; + if d.elements().is_empty() { + d.move_to((p0.0, p0.1)); + } + let line = p1 == p0 && p2 == p3; + let (length, partial) = if line { + d.line_to((p3.0, p3.1)); + let line = Line::new(Point::new(p0.0, p0.1), Point::new(p3.0, p3.1)); + (line.arclen(1e-9), line.arclen(1e-9) * t) + } else { + d.curve_to((p1.0, p1.1), (p2.0, p2.1), (p3.0, p3.1)); + let curve = CubicBez::new((p0.0, p0.1), (p1.0, p1.1), (p2.0, p2.1), (p3.0, p3.1)); + let partial = if t <= 0.0 { 0.0 } else { curve.subsegment(0.0..t).arclen(1e-9) }; + (curve.arclen(1e-9), partial) + }; + if !length.is_finite() || length <= 1e-10 { + return Err("zero-length path segment"); + } + if use_.segment == *marked { + start_segment_length = partial; + if !start_segment_length.is_finite() { + return Err("invalid path length"); + } + prefix = total; + } + total += length; + } + if closed { + d.close_path(); + } + if !total.is_finite() || total <= 1e-10 { + return Err("zero-length path"); + } + let mut start = ((prefix + start_segment_length) / total).clamp(0.0, 1.0); + let flip = !forward; + if flip { + start = 1.0 - start; + } + let path = TextPath { d: d.to_svg(), start, flip }; + let lines = figcraft_doc::geom::measure::polylines(&path.path()).ok_or("cannot be measured by text renderer")?; + if lines.first().is_none_or(|line| line.length() <= 1e-9) { + return Err("cannot be measured by text renderer"); + } + Ok(path) +} + +/// Return every segment in chain order. Open chains are oriented so the marked segment runs a→b; +/// cycles start at the marked segment's a vertex and traverse it first. +fn ordered_chain(net: &Network, marked: usize) -> Result<(Vec, bool), &'static str> { + let marker = net.segments.get(marked).ok_or("invalid start segment index")?; + let mut adjacency = vec![Vec::::new(); net.vertices.len()]; + for (i, s) in net.segments.iter().enumerate() { + if s.a >= adjacency.len() || s.b >= adjacency.len() { + return Err("invalid path vertex index"); + } + if s.a == s.b { + return Err("path contains a segment that starts and ends at the same vertex"); + } + adjacency[s.a].push(i); + adjacency[s.b].push(i); + } + let mut endpoints = Vec::new(); + for edges in &adjacency { + if edges.len() > 2 { + return Err("branched path network"); + } + if edges.len() == 1 { + endpoints.push(edges[0]); + } + } + if !endpoints.is_empty() && endpoints.len() != 2 { + return Err("disconnected or malformed path network"); + } + let cycle = endpoints.is_empty(); + let mut used = vec![false; net.segments.len()]; + let mut out = Vec::with_capacity(net.segments.len()); + if cycle { + out.push(Use { segment: marked, forward: true }); + used[marked] = true; + let mut at = marker.b; + let mut visited = vec![false; net.vertices.len()]; + visited[marker.a] = true; + visited[marker.b] = true; + while at != marker.a { + let next = adjacency[at].iter().copied().find(|i| !used[*i]).ok_or("disconnected path cycle")?; + used[next] = true; + let s = &net.segments[next]; + let is_forward = s.a == at; + at = if is_forward { s.b } else { s.a }; + if at != marker.a && std::mem::replace(&mut visited[at], true) { + return Err("path cycle is not simple"); + } + out.push(Use { segment: next, forward: is_forward }); + if out.len() > net.segments.len() { + return Err("invalid path cycle"); + } + } + } else { + let endpoint = adjacency.iter().position(|e| e.len() == 1).ok_or("missing path endpoint")?; + let mut at = endpoint; + while let Some(next) = adjacency[at].iter().copied().find(|i| !used[*i]) { + used[next] = true; + let s = &net.segments[next]; + let is_forward = s.a == at; + at = if is_forward { s.b } else { s.a }; + out.push(Use { segment: next, forward: is_forward }); + } + let Some(marker_use) = out.iter().find(|u| u.segment == marked) else { return Err("disconnected start segment") }; + if !marker_use.forward { + out.reverse(); + for u in &mut out { + u.forward = !u.forward; + } + } + } + if !used.iter().all(|x| *x) { + return Err("disconnected path network"); + } + Ok((out, cycle)) +} + +type P = (f64, f64); + +fn cubic(net: &Network, use_: Use, sx: f64, sy: f64) -> Result<(P, P, P, P), &'static str> { + let s: &Segment = net.segments.get(use_.segment).ok_or("invalid path segment index")?; + let a = net.vertices.get(s.a).ok_or("invalid path vertex index")?; + let b = net.vertices.get(s.b).ok_or("invalid path vertex index")?; + let p0 = (a.x * sx, a.y * sy); + let p3 = (b.x * sx, b.y * sy); + let ta = (s.ta.0 * sx, s.ta.1 * sy); + let tb = (s.tb.0 * sx, s.tb.1 * sy); + if [p0.0, p0.1, p3.0, p3.1, ta.0, ta.1, tb.0, tb.1].iter().any(|x| !x.is_finite()) { + return Err("invalid path coordinates"); + } + let (p0, p1, p2, p3) = + if ta == (0.0, 0.0) && tb == (0.0, 0.0) { (p0, p0, p3, p3) } else { (p0, (p0.0 + ta.0, p0.1 + ta.1), (p3.0 + tb.0, p3.1 + tb.1), p3) }; + if use_.forward { Ok((p0, p1, p2, p3)) } else { Ok((p3, p2, p1, p0)) } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::fig::network::{Segment, Vertex}; + use figcraft_doc::geom::kurbo::PathEl; + + fn vertex(x: f64, y: f64) -> Vertex { + Vertex { style: 0, x, y } + } + + fn segment(style: u32, a: usize, b: usize, ta: (f64, f64), tb: (f64, f64)) -> Segment { + Segment { style, a, ta, b, tb } + } + + fn curved() -> Network { + Network { + vertices: vec![vertex(0.0, 82.5), vertex(300.0, 82.5), vertex(600.0, 82.5)], + segments: vec![segment(START_SEGMENT_STYLE, 0, 1, (70.0, -110.0), (-70.0, -110.0)), segment(0, 1, 2, (70.0, 110.0), (-70.0, 110.0))], + ..Network::default() + } + } + + #[test] + fn local_cubic_parameter_converts_to_path_distance() { + let path = from_network(&curved(), 1.0, 1.0, 0.0086954795, true).unwrap(); + assert!((path.start - 0.004744078).abs() < 0.00001); + // Cubic t is not its fraction of total path length. + assert!((path.start - 0.0086954795).abs() > 0.003); + let elements = path.path().elements().to_vec(); + assert!(matches!(elements.first(), Some(PathEl::MoveTo(p)) if p.x == 0.0 && p.y == 82.5)); + assert!(matches!(elements.get(1), Some(PathEl::CurveTo(..)))); + } + + #[test] + fn second_segment_marker_and_t_are_respected() { + let mut net = curved(); + net.segments[0].style = 0; + net.segments[1].style = START_SEGMENT_STYLE; + let path = from_network(&net, 1.0, 1.0, 0.49800667, true).unwrap(); + assert!((path.start - 0.7490379757).abs() < 0.00002); + } + + #[test] + fn reverse_direction_inverts_normalized_start() { + let net = Network { + vertices: vec![vertex(0.0, 0.0), vertex(600.0, 0.0)], + segments: vec![segment(START_SEGMENT_STYLE, 0, 1, (0.0, 0.0), (0.0, 0.0))], + ..Network::default() + }; + let path = from_network(&net, 1.0, 1.0, 0.83986014, false).unwrap(); + assert!(path.flip); + assert!((path.start - 0.16013986).abs() < 1e-8); + assert!(matches!(path.path().elements().get(1), Some(PathEl::LineTo(p)) if p.x == 600.0 && p.y == 0.0)); + } + + #[test] + fn rejects_missing_duplicate_and_zero_length_segments() { + let mut net = curved(); + net.segments[0].style = 0; + assert_eq!(from_network(&net, 1.0, 1.0, 0.5, true), Err("missing or ambiguous start segment marker")); + net.segments[1].style = START_SEGMENT_STYLE; + net.segments[0].style = START_SEGMENT_STYLE; + assert_eq!(from_network(&net, 1.0, 1.0, 0.5, true), Err("missing or ambiguous start segment marker")); + let zero = Network { + vertices: vec![vertex(0.0, 0.0), vertex(0.0, 0.0)], + segments: vec![segment(START_SEGMENT_STYLE, 0, 1, (0.0, 0.0), (0.0, 0.0))], + ..Network::default() + }; + assert_eq!(from_network(&zero, 1.0, 1.0, 0.5, true), Err("zero-length path segment")); + } + + #[test] + fn rejects_branching_and_disconnected_segments() { + let branch = Network { + vertices: vec![vertex(0.0, 0.0), vertex(1.0, 0.0), vertex(2.0, 0.0), vertex(1.0, 1.0)], + segments: vec![ + segment(START_SEGMENT_STYLE, 0, 1, (0.0, 0.0), (0.0, 0.0)), + segment(0, 1, 2, (0.0, 0.0), (0.0, 0.0)), + segment(0, 1, 3, (0.0, 0.0), (0.0, 0.0)), + ], + ..Network::default() + }; + assert_eq!(from_network(&branch, 1.0, 1.0, 0.5, true), Err("branched path network")); + let disconnected = Network { + vertices: vec![vertex(0.0, 0.0), vertex(1.0, 0.0), vertex(2.0, 0.0), vertex(3.0, 0.0)], + segments: vec![segment(START_SEGMENT_STYLE, 0, 1, (0.0, 0.0), (0.0, 0.0)), segment(0, 2, 3, (0.0, 0.0), (0.0, 0.0))], + ..Network::default() + }; + assert_eq!(from_network(&disconnected, 1.0, 1.0, 0.5, true), Err("disconnected or malformed path network")); + } + + #[test] + fn scales_geometry_and_accepts_closed_cycles() { + let cycle = Network { + vertices: vec![vertex(0.0, 0.0), vertex(100.0, 0.0), vertex(100.0, 100.0)], + segments: vec![ + segment(START_SEGMENT_STYLE, 0, 1, (0.0, 0.0), (0.0, 0.0)), + segment(0, 1, 2, (0.0, 0.0), (0.0, 0.0)), + segment(0, 2, 0, (0.0, 0.0), (0.0, 0.0)), + ], + ..Network::default() + }; + let path = from_network(&cycle, 2.0, 3.0, 0.5, true).unwrap(); + let elements = path.path().elements().to_vec(); + assert!(matches!(elements.first(), Some(PathEl::MoveTo(p)) if p.x == 0.0 && p.y == 0.0)); + assert!(matches!(elements.get(1), Some(PathEl::LineTo(p)) if p.x == 200.0 && p.y == 0.0)); + let total = 200.0 + 300.0 + 130_000.0_f64.sqrt(); + assert!((path.start - 100.0 / total).abs() < 1e-8); + assert!(matches!(elements.last(), Some(PathEl::ClosePath))); + } + + #[test] + fn rejects_paths_the_native_renderer_cannot_measure() { + let count = 40_000usize; + let many_lines = Network { + vertices: (0..=count).map(|i| vertex(i as f64, 0.0)).collect(), + segments: (0..count).map(|i| segment(if i == 0 { START_SEGMENT_STYLE } else { 0 }, i, i + 1, (0.0, 0.0), (0.0, 0.0))).collect(), + ..Network::default() + }; + assert_eq!(from_network(&many_lines, 1.0, 1.0, 0.5, true), Err("cannot be measured by text renderer")); + + let huge = Network { + vertices: vec![vertex(0.0, 0.0), vertex(1e9, 0.0)], + segments: vec![segment(START_SEGMENT_STYLE, 0, 1, (0.0, 0.0), (0.0, 0.0))], + ..Network::default() + }; + assert_eq!(from_network(&huge, 1.0, 1.0, 0.5, true), Err("cannot be measured by text renderer")); + + let tiny = Network { + vertices: vec![vertex(0.0, 0.0), vertex(5e-10, 0.0)], + segments: vec![segment(START_SEGMENT_STYLE, 0, 1, (0.0, 0.0), (0.0, 0.0))], + ..Network::default() + }; + assert_eq!(from_network(&tiny, 1.0, 1.0, 0.5, true), Err("cannot be measured by text renderer")); + } +} diff --git a/crates/format/src/fig/text_path_tests.rs b/crates/format/src/fig/text_path_tests.rs new file mode 100644 index 000000000..66148930c --- /dev/null +++ b/crates/format/src/fig/text_path_tests.rs @@ -0,0 +1,211 @@ +//! Mapper → private REST ingress tests for source text-path fields. + +use super::kiwi::Kv; + +const SCHEMA: &str = " +enum NodeType DOCUMENT CANVAS TEXT TEXT_PATH +enum StyleType NONE TEXT +enum TextDecoration NONE UNDERLINE STRIKETHROUGH +struct GUID uint sessionID, uint localID +struct StyleId GUID guid +struct ParentIndex GUID guid, string position +struct Vector float x, float y +struct Matrix float m00, float m01, float m02, float m10, float m11, float m12 +struct FontName string family, string style +message TextOverride uint styleID, FontName fontName, float fontSize +message TextData string characters, uint[] characterStyleIDs, TextOverride[] styleOverrideTable +message TextPathStart float tValue, bool forward +message VectorData uint vectorNetworkBlob, Vector normalizedSize +message Blob byte[] bytes +message NodeChange GUID guid, ParentIndex parentIndex, NodeType type, string name, Vector size, Matrix transform, TextData textData, float fontSize, FontName fontName, TextPathStart textPathStart, VectorData vectorData, StyleType styleType, StyleId styleIdForText, TextDecoration textDecoration +message Message NodeChange[] nodeChanges, Blob[] blobs +"; +use figcraft_doc::{NodeKind, TextPath}; + +fn o(fields: Vec<(&'static str, Kv<'static>)>) -> Kv<'static> { + Kv::Object(fields) +} + +fn a(values: Vec>) -> Kv<'static> { + Kv::Array(values) +} + +fn f(value: f32) -> Kv<'static> { + Kv::Float(value) +} + +fn u(value: u64) -> Kv<'static> { + Kv::Uint(value) +} + +fn s(value: &'static str) -> Kv<'static> { + Kv::Str(value.into()) +} + +fn point(x: f32, y: f32) -> Kv<'static> { + o(vec![("x", f(x)), ("y", f(y))]) +} + +fn guid(id: u64) -> Kv<'static> { + o(vec![("sessionID", u(1)), ("localID", u(id))]) +} + +fn node(id: u64, parent: Option, ty: &'static str, fields: Vec<(&'static str, Kv<'static>)>) -> Kv<'static> { + let mut node = vec![("guid", guid(id)), ("type", s(ty))]; + if let Some(parent) = parent { + node.push(("parentIndex", o(vec![("guid", guid(parent)), ("position", s("!"))]))); + } + node.extend(fields); + o(node) +} + +fn blob() -> Vec { + let mut bytes = Vec::new(); + let u32le = |out: &mut Vec, n: u32| out.extend_from_slice(&n.to_le_bytes()); + let f32le = |out: &mut Vec, n: f32| out.extend_from_slice(&n.to_le_bytes()); + u32le(&mut bytes, 2); // vertices + u32le(&mut bytes, 1); // segments + u32le(&mut bytes, 0); // regions + for (x, y) in [(0.0, 0.0), (100.0, 0.0)] { + u32le(&mut bytes, 0); + f32le(&mut bytes, x); + f32le(&mut bytes, y); + } + u32le(&mut bytes, 0x01ff_ffff); // source start-segment marker + u32le(&mut bytes, 0); + f32le(&mut bytes, 0.0); + f32le(&mut bytes, 0.0); + u32le(&mut bytes, 1); + f32le(&mut bytes, 0.0); + f32le(&mut bytes, 0.0); + bytes +} + +fn canvas() -> Vec { + let schema = super::kiwi::Schema::parse(SCHEMA).unwrap(); + let message = message(true); + let message = super::kiwi::encode::message(&schema, schema.find("Message").unwrap(), &message).unwrap(); + let mut out = b"fig-kiwi\0\0\0\0".to_vec(); + for raw in [super::kiwi::encode::schema(&schema), message] { + let mut encoder = flate2::write::DeflateEncoder::new(Vec::new(), flate2::Compression::default()); + std::io::Write::write_all(&mut encoder, &raw).unwrap(); + let compressed = encoder.finish().unwrap(); + out.extend_from_slice(&(compressed.len() as u32).to_le_bytes()); + out.extend_from_slice(&compressed); + } + out +} + +fn message(with_path: bool) -> Kv<'static> { + let mut nodes = vec![node(0, None, "DOCUMENT", vec![]), node(1, Some(0), "CANVAS", vec![])]; + let mut blobs = Vec::new(); + if with_path { + blobs.push(o(vec![("bytes", Kv::Bytes(blob()))])); + let text = o(vec![ + ("characters", s("alpha")), + ("characterStyleIDs", a(vec![u(0), u(0), u(0), u(2), u(2)])), + ( + "styleOverrideTable", + a(vec![o(vec![("styleID", u(2)), ("fontName", o(vec![("family", s("Inter")), ("style", s("Medium"))])), ("fontSize", f(30.0))])]), + ), + ]); + nodes.push(node( + 2, + Some(1), + "TEXT_PATH", + vec![ + ("name", s("alpha path")), + ("size", point(100.0, 0.0)), + ("transform", o(vec![("m00", f(1.0)), ("m01", f(0.0)), ("m02", f(0.0)), ("m10", f(0.0)), ("m11", f(1.0)), ("m12", f(0.0))])), + ("textData", text), + ("fontSize", f(24.0)), + ("fontName", o(vec![("family", s("Inter")), ("style", s("Regular"))])), + ("textPathStart", o(vec![("tValue", f(0.5)), ("forward", Kv::Bool(true))])), + ("vectorData", o(vec![("vectorNetworkBlob", u(0)), ("normalizedSize", point(100.0, 0.0))])), + ], + )); + } else { + nodes.push(node(2, Some(1), "TEXT_PATH", vec![("name", s("broken path")), ("textData", o(vec![("characters", s("fallback"))]))])); + } + o(vec![("nodeChanges", a(nodes)), ("blobs", a(blobs))]) +} + +fn linked_underline_message() -> Kv<'static> { + let Kv::Object(mut root) = message(true) else { panic!("expected message object") }; + let (_, Kv::Array(nodes)) = root.iter_mut().find(|(key, _)| *key == "nodeChanges").unwrap() else { panic!("expected node changes array") }; + let text = nodes.iter_mut().find(|n| n.get("name").and_then(Kv::str) == Some("alpha path")).unwrap(); + let Kv::Object(fields) = text else { panic!("expected text node object") }; + fields.push(("styleIdForText", o(vec![("guid", guid(3))]))); + nodes.push(node( + 3, + Some(1), + "TEXT", + vec![ + ("name", s("Shared style")), + ("styleType", s("TEXT")), + ("fontName", o(vec![("family", s("Inter")), ("style", s("Regular"))])), + ("fontSize", f(24.0)), + ("textDecoration", s("UNDERLINE")), + ], + )); + Kv::Object(root) +} + +#[test] +fn mapped_text_path_reaches_native_model_with_runs_and_no_standin_warning() { + let message = message(true); + let (json, warnings) = super::map::to_rest(&message, "Text path"); + assert!(!warnings.iter().any(|w| w.contains("text off its path")), "{warnings:?}"); + let (doc, warnings) = crate::rest::import_fig(&json, &|_| None).unwrap(); + assert!(!warnings.iter().any(|w| w.contains("text off its path")), "{warnings:?}"); + let node = doc.nodes().find(|n| n.name == "alpha path").unwrap(); + let NodeKind::Text(text) = &node.kind else { panic!("expected text") }; + let path = text.path.as_deref().unwrap(); + assert_eq!(path, &TextPath { d: "M0,0 L100,0".into(), start: 0.5, flip: false }); + assert_eq!(text.characters, "alpha"); + assert_eq!(text.runs.len(), 1); + assert_eq!(text.runs[0].start, 3); + assert_eq!(text.runs[0].end, 5); +} + +#[test] +fn public_rest_import_ignores_private_fig_text_path_field() { + let message = message(true); + let (json, _) = super::map::to_rest(&message, "Text path"); + // The mapper's private field is accepted only by import_fig, never by public REST import. + let path = json["document"]["children"][0]["children"][0]["_figTextPath"].clone(); + assert!(path.is_object()); + let (doc, _) = crate::rest::import(&json, &|_| None).unwrap(); + let node = doc.nodes().find(|n| n.name == "alpha path").unwrap(); + let NodeKind::Text(text) = &node.kind else { panic!("expected text") }; + assert!(text.path.is_none()); +} + +#[test] +fn serialized_kiwi_canvas_import_decodes_start_and_builds_native_path() { + let (doc, warnings) = super::import(&canvas(), "Serialized text path").unwrap(); + let node = doc.nodes().find(|n| n.name == "alpha path").unwrap(); + let NodeKind::Text(text) = &node.kind else { panic!("expected text") }; + let path = text.path.as_deref().unwrap(); + assert_eq!(path, &TextPath { d: "M0,0 L100,0".into(), start: 0.5, flip: false }); + assert_eq!(text.characters, "alpha"); + assert!(!warnings.iter().any(|w| w.contains("text off its path")), "{warnings:?}"); +} + +#[test] +fn malformed_text_path_falls_back_with_specific_warning() { + let message = message(false); + let (json, warnings) = super::map::to_rest(&message, "Text path"); + assert!(warnings.iter().any(|w| w.contains("text path has no start data") && w.contains("text imports off its path")), "{warnings:?}"); + let (doc, _) = crate::rest::import_fig(&json, &|_| None).unwrap(); + let node = doc.nodes().find(|n| n.name == "broken path").unwrap(); + assert!(matches!(&node.kind, NodeKind::Text(text) if text.path.is_none())); +} + +#[test] +fn linked_text_style_decoration_warns_from_effective_mapped_style() { + let message = linked_underline_message(); + let (json, warnings) = super::map::to_rest(&message, "Text path"); + assert_eq!(json["document"]["children"][0]["children"][0]["style"]["textDecoration"], "UNDERLINE"); + assert!(warnings.iter().any(|w| w == "text path underline or strikethrough decoration is not rendered"), "{warnings:?}"); +} diff --git a/crates/format/src/rest/text.rs b/crates/format/src/rest/text.rs index 3875204f3..9b8e9be40 100644 --- a/crates/format/src/rest/text.rs +++ b/crates/format/src/rest/text.rs @@ -5,7 +5,7 @@ use std::collections::BTreeMap; use figcraft_doc::{ DecorationLength, DecorationStyle, LetterSpacing, LineHeight, ListStyle, ParaList, StyleRun, TextAlignH, TextAlignV, TextAutoResize, TextCase, - TextData, TextDecoration, TextStyle, + TextData, TextDecoration, TextPath, TextStyle, }; use serde_json::Value; @@ -29,6 +29,16 @@ pub(super) fn text_data(cx: &mut Ctx, v: &Value) -> TextData { td.runs = runs(cx, v, &td); td.normalize(); lists(v, &mut td); + if cx.fig_sources.is_some() + && let Some(path) = v.get("_figTextPath") + { + match (path.get("d").and_then(Value::as_str), path.get("start").and_then(Value::as_f64), path.get("flip").and_then(Value::as_bool)) { + (Some(d), Some(start), Some(flip)) if !d.is_empty() && start.is_finite() && (0.0..=1.0).contains(&start) => { + td.path = Some(Box::new(TextPath { d: d.to_owned(), start, flip })); + } + _ => cx.warn("invalid internal .fig text path data was ignored"), + } + } td } diff --git a/docs/gaps.md b/docs/gaps.md index e8b111a8d..a5cd6a3bc 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -41,6 +41,10 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe ## Entries ### 1. `.fig` files: the import's tail +- **Text paths (2026-10-15):** local `.fig` import maps supported connected `TEXT_PATH` networks + to existing editable native text paths, preserving the start segment, direction and styled + runs. Other vertical placements, multiline/ambiguous networks, path decorations, public REST + text paths and `.fig` text-path export remain limited. - **Landed (2026-10-11):** `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors, auto layout (grid included), constraints, components, sets, instances (expanded from their main with overrides, derived layout and property values), styles, variables with modes and bindings, prototyping and image fills from the archive come across; anything else is a warning (`crates/format/src/fig`). Then (2026-10-11): vectors open as editable vector networks (per-point corner radius, handle mirroring, end caps; outlines when the network blob is missing or damaged), sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers import as the closest frames, text layers and vectors with a warning, and set-variable, set-variable-mode and conditional prototype actions come across. `file.open`, `file.import`, drag and drop, the CLI and MCP's `open_file` read `.fig`; the file is never saved over. From a96222012b437ae7f47403dcd3fd514d50eb73e1 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 13:51:00 +0700 Subject: [PATCH 121/817] #619: leave progress docs to the maintainer's docs PR --- docs/file-format-parity.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index c25e33ea0..d8e517119 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -60,13 +60,6 @@ export limit, not a native document nesting limit. ### Export to `.fig` (experimental) -File ▸ Save as offers `.figcraft` and `.fig` as separate file types in the system dialog. A `.fig` -destination writes the same experimental export copy of the document that is shown (`file.save` and -`file.saveAs` with a path ending in `.fig` do the same) and reports what was left out. The file's own -path, its unsaved changes, versions, branches and undo history are not touched, and a shown earlier -version stays shown. Other apps may not open every exported `.fig` file. A plain Save never writes over -a file whose saved path ends in `.fig`; it asks for a destination instead. - `file.export {format: "fig"}` (or a `path` ending in `.fig`), File ▸ Export… ▸ .fig (experimental), `figcraft-cli export -o .fig` (and `convert`) and MCP's `export {format: "fig"}` write the whole document. The writer (`crates/format/src/fig/export.rs`) works from the same public format From 6baeb53b200ba6c6ec8f5ca39bee4799e0346904 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 13:51:01 +0700 Subject: [PATCH 122/817] #619: the Save as messages in every catalog --- crates/ui-egui/locales/cs.toml | 2 ++ crates/ui-egui/locales/es.toml | 2 +- crates/ui-egui/locales/fr.toml | 2 ++ crates/ui-egui/locales/id.toml | 2 ++ crates/ui-egui/locales/ja.toml | 2 ++ crates/ui-egui/locales/ko.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/tr.toml | 2 ++ crates/ui-egui/locales/zh-Hans.toml | 2 ++ 11 files changed, 21 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml index 268ff5275..e8fc03301 100644 --- a/crates/ui-egui/locales/cs.toml +++ b/crates/ui-egui/locales/cs.toml @@ -13,6 +13,7 @@ status = "draft — needs native review" "1…9, 0" = "1…9, 0" "@{login}: {prs} PRs, {commits} commits, +{added} / −{deleted} lines (Δ {delta}), +{bin_added} / −{bin_deleted} binary assets, {first} – {last}" = "@{login}: PR: {prs}, commity: {commits}, +{added} / −{deleted} řádků (Δ {delta}), +{bin_added} / −{bin_deleted} binárních souborů, {first} – {last}" "A collection of this file with these modes and variables: override their values per mode and add variables of its own" = "Kolekce tohoto souboru s těmito režimy a proměnnými: přepište jejich hodnoty pro jednotlivé režimy a přidejte vlastní proměnné" +"A .figcraft file with this name already exists. Choose its full name to confirm replacement." = "Soubor .figcraft s tímto názvem už existuje. Nahrazení potvrdíte výběrem jeho úplného názvu." "A layer on its own aligns to its frame: select more layers, or one in a frame" = "Samostatná vrstva se zarovná ke svému rámci: vyberte více vrstev nebo jednu v rámci" "A responsive product page: hero, features, figures, a quote and a footer" = "Responzivní produktová stránka: úvodní blok, funkce, čísla, citace a zápatí" "A spring plays until it settles: its mass, stiffness and damping set how long" = "Pružina se pohybuje až do ustálení: délku určuje její hmotnost, tuhost a tlumení" @@ -1393,6 +1394,7 @@ status = "draft — needs native review" "Use as mask" = "Použít jako masku" "Use auto layout" = "Použít automatické rozvržení" "Use number keys for opacity" = "Nastavovat krytí číselnými klávesami" +"Use the .figcraft or .fig extension." = "Použijte příponu .figcraft nebo .fig." "Use the layer's fill" = "Použít výplň vrstvy" "Used in {files} · {instances}" = "Použití – {files} · {instances}" "Username" = "Uživatelské jméno" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 0f2e33911..47000119a 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -9,7 +9,6 @@ status = "draft — needs native review" [ui] "Couldn't download the variables" = "No se pudieron descargar las variables" -"A .figcraft file with this name already exists. Choose its full name to confirm replacement." = "Ya existe un archivo .figcraft con este nombre. Elige su nombre completo para confirmar que deseas reemplazarlo." "% of all commits" = "% del total de commits" "(no longer published)" = "(ya no publicado)" @@ -19,6 +18,7 @@ status = "draft — needs native review" "1…9, 0" = "1…9, 0" "@{login}: {prs} PRs, {commits} commits, +{added} / −{deleted} lines (Δ {delta}), +{bin_added} / −{bin_deleted} binary assets, {first} – {last}" = "@{login}: {prs} PR, {commits} commits, +{added} / −{deleted} líneas (Δ {delta}), +{bin_added} / −{bin_deleted} recursos binarios, {first} – {last}" "A collection of this file with these modes and variables: override their values per mode and add variables of its own" = "Una colección de este archivo con estos modos y variables: modifica sus valores por modo y añade variables propias" +"A .figcraft file with this name already exists. Choose its full name to confirm replacement." = "Ya existe un archivo .figcraft con este nombre. Elige su nombre completo para confirmar que deseas reemplazarlo." "A layer on its own aligns to its frame: select more layers, or one in a frame" = "Una capa sola se alinea con su marco: selecciona más capas o una dentro de un marco" "A responsive product page: hero, features, figures, a quote and a footer" = "Una página de producto adaptable: cabecera, funciones, cifras, una cita y un pie" "A spring plays until it settles: its mass, stiffness and damping set how long" = "Un muelle se reproduce hasta que se asienta: su masa, rigidez y amortiguación fijan cuánto dura" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 7fafd3c91..3f2e12bed 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -17,6 +17,7 @@ status = "draft — needs native review" "1…9, 0" = "1…9, 0" "@{login}: {prs} PRs, {commits} commits, +{added} / −{deleted} lines (Δ {delta}), +{bin_added} / −{bin_deleted} binary assets, {first} – {last}" = "@{login} : {prs} PR, {commits} commits, +{added} / −{deleted} lignes (Δ {delta}), +{bin_added} / −{bin_deleted} ressources binaires, {first} – {last}" "A collection of this file with these modes and variables: override their values per mode and add variables of its own" = "Une collection de ce fichier avec ces modes et ces variables : remplacez leurs valeurs par mode et ajoutez vos propres variables" +"A .figcraft file with this name already exists. Choose its full name to confirm replacement." = "Un fichier .figcraft portant ce nom existe déjà. Choisissez son nom complet pour confirmer le remplacement." "A layer on its own aligns to its frame: select more layers, or one in a frame" = "Un calque seul s’aligne sur son cadre : sélectionnez d’autres calques, ou un calque dans un cadre" "A spring plays until it settles: its mass, stiffness and damping set how long" = "Un ressort joue jusqu’à ce qu’il se stabilise : sa masse, sa rigidité et son amortissement en fixent la durée" "About" = "À propos" @@ -1338,6 +1339,7 @@ status = "draft — needs native review" "Use as mask" = "Utiliser comme masque" "Use auto layout" = "Utiliser la mise en page auto" "Use number keys for opacity" = "Utiliser les touches numériques pour l’opacité" +"Use the .figcraft or .fig extension." = "Utilisez l’extension .figcraft ou .fig." "Use the layer's fill" = "Utiliser le remplissage du calque" "Used in {files} · {instances}" = "Utilisé dans {files} · {instances}" "Username" = "Nom d’utilisateur" diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml index 5de7634d4..c56d9fc79 100644 --- a/crates/ui-egui/locales/id.toml +++ b/crates/ui-egui/locales/id.toml @@ -17,6 +17,7 @@ status = "draft — needs native review" "1…9, 0" = "1…9, 0" "@{login}: {prs} PRs, {commits} commits, +{added} / −{deleted} lines (Δ {delta}), +{bin_added} / −{bin_deleted} binary assets, {first} – {last}" = "@{login}: {prs} PR, {commits} commit, +{added} / −{deleted} baris (Δ {delta}), +{bin_added} / −{bin_deleted} aset biner, {first} – {last}" "A collection of this file with these modes and variables: override their values per mode and add variables of its own" = "Koleksi file ini dengan mode dan variabel tersebut: timpa nilainya per mode dan tambahkan variabel sendiri" +"A .figcraft file with this name already exists. Choose its full name to confirm replacement." = "File .figcraft dengan nama ini sudah ada. Pilih nama lengkapnya untuk mengonfirmasi penggantian." "A layer on its own aligns to its frame: select more layers, or one in a frame" = "Satu layer saja diratakan ke frame-nya: pilih lebih banyak layer, atau satu layer di dalam frame" "A responsive product page: hero, features, figures, a quote and a footer" = "Halaman produk responsif: hero, fitur, angka, kutipan, dan footer" "A spring plays until it settles: its mass, stiffness and damping set how long" = "Spring berjalan hingga stabil: massa, kekakuan, dan redamannya menentukan durasinya" @@ -1397,6 +1398,7 @@ status = "draft — needs native review" "Use as mask" = "Gunakan sebagai mask" "Use auto layout" = "Gunakan auto layout" "Use number keys for opacity" = "Gunakan tombol angka untuk opasitas" +"Use the .figcraft or .fig extension." = "Gunakan ekstensi .figcraft atau .fig." "Use the layer's fill" = "Gunakan fill layer" "Used in {files} · {instances}" = "Digunakan di {files} · {instances}" "Username" = "Nama pengguna" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index 4d4d6d340..c04e07ca5 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -19,6 +19,7 @@ status = "draft — needs native review" "1…9, 0" = "1…9, 0" "@{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 ファイルは既に存在します。置き換えるには、拡張子まで含む名前を選択。" "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" = "スプリングは静止するまで再生。長さは質量・剛性・減衰で決まる" @@ -1406,6 +1407,7 @@ status = "draft — needs native review" "Use as mask" = "マスクとして使用" "Use auto layout" = "オートレイアウトを使用" "Use number keys for opacity" = "数字キーで不透明度を変更" +"Use the .figcraft or .fig extension." = "拡張子は .figcraft または .fig を使用。" "Use the layer's fill" = "レイヤーの塗りを使用" "Used in {files} · {instances}" = "{files}で使用 · {instances}" "Username" = "ユーザー名" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index ec732905c..c57e4279b 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -18,6 +18,7 @@ status = "draft — needs native review" "1…9, 0" = "1…9, 0" "@{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 파일이 이미 있습니다. 바꾸려면 확장자까지 포함한 전체 이름을 선택하세요." "A layer on its own aligns to its frame: select more layers, or one in a frame" = "레이어 하나는 프레임에 맞춰 정렬됩니다: 레이어를 더 선택하거나 프레임 안의 레이어를 선택하세요" "A spring plays until it settles: its mass, stiffness and damping set how long" = "스프링은 멈출 때까지 재생됨. 길이는 질량, 강성, 감쇠로 결정됨" "About" = "정보" @@ -1338,6 +1339,7 @@ status = "draft — needs native review" "Use as mask" = "마스크로 사용" "Use auto layout" = "자동 레이아웃 사용" "Use number keys for opacity" = "숫자 키로 불투명도 변경" +"Use the .figcraft or .fig extension." = ".figcraft 또는 .fig 확장자를 사용하세요." "Use the layer's fill" = "레이어의 채우기 사용" "Used in {files} · {instances}" = "{files}에서 사용 · {instances}" "Username" = "사용자 이름" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index c2189de81..0bd03b843 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -16,6 +16,7 @@ status = "draft — needs native review" "1…9, 0" = "1…9, 0" "@{login}: {prs} PRs, {commits} commits, +{added} / −{deleted} lines (Δ {delta}), +{bin_added} / −{bin_deleted} binary assets, {first} – {last}" = "@{login}: {prs} PRs, {commits} commits, +{added} / −{deleted} linhas (Δ {delta}), +{bin_added} / −{bin_deleted} arquivos binários, {first} – {last}" "A collection of this file with these modes and variables: override their values per mode and add variables of its own" = "Uma coleção deste arquivo com estes modos e variáveis: substitua os valores por modo e adicione variáveis próprias" +"A .figcraft file with this name already exists. Choose its full name to confirm replacement." = "Já existe um arquivo .figcraft com este nome. Escolha o nome completo dele para confirmar a substituição." "A layer on its own aligns to its frame: select more layers, or one in a frame" = "Uma camada sozinha se alinha ao seu quadro: selecione mais camadas ou uma dentro de um quadro" "A spring plays until it settles: its mass, stiffness and damping set how long" = "Uma mola se move até se estabilizar: sua massa, rigidez e amortecimento definem a duração" "About" = "Sobre" @@ -1337,6 +1338,7 @@ status = "draft — needs native review" "Use as mask" = "Usar como máscara" "Use auto layout" = "Usar layout automático" "Use number keys for opacity" = "Usar teclas numéricas para a opacidade" +"Use the .figcraft or .fig extension." = "Use a extensão .figcraft ou .fig." "Use the layer's fill" = "Usar o preenchimento da camada" "Used in {files} · {instances}" = "Usado em {files} · {instances}" "Username" = "Nome de usuário" diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 3ab407572..2725a7ab2 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -15,6 +15,7 @@ name = "Русский" "1…9, 0" = "1…9, 0" "@{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 с таким именем уже существует. Чтобы подтвердить замену, выберите его полное имя." "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 title, an agenda, a big figure, a chart and a closing slide" = "Заголовок, повестка, крупный показатель, диаграмма и заключительный слайд" @@ -1394,6 +1395,7 @@ name = "Русский" "Use as mask" = "Использовать как маску" "Use auto layout" = "Использовать автолейаут" "Use number keys for opacity" = "Задавать непрозрачность цифровыми клавишами" +"Use the .figcraft or .fig extension." = "Используйте расширение .figcraft или .fig." "Use the layer's fill" = "Использовать заливку слоя" "Used in {files} · {instances}" = "Используется в {files} · {instances}" "Username" = "Имя пользователя" diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index f7b2999d6..b2d7b7a5b 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -16,6 +16,7 @@ name = "Svenska" "1…9, 0" = "1…9, 0" "@{login}: {prs} PRs, {commits} commits, +{added} / −{deleted} lines (Δ {delta}), +{bin_added} / −{bin_deleted} binary assets, {first} – {last}" = "@{login}: {prs} PR:er, {commits} commits, +{added} / −{deleted} rader (Δ {delta}), +{bin_added} / −{bin_deleted} binära tillgångar, {first} – {last}" "A collection of this file with these modes and variables: override their values per mode and add variables of its own" = "En samling i den här filen med dessa lägen och variabler: åsidosätt deras värden per läge och lägg till egna variabler" +"A .figcraft file with this name already exists. Choose its full name to confirm replacement." = "Det finns redan en .figcraft-fil med det här namnet. Välj dess fullständiga namn för att bekräfta att den ersätts." "A responsive product page: hero, features, figures, a quote and a footer" = "En responsiv produktsida: toppsektion, funktioner, figurer, ett citat och en sidfot" "A spring plays until it settles: its mass, stiffness and damping set how long" = "En fjäder spelas tills den stannar: dess massa, styvhet och dämpning avgör hur länge" "A title, an agenda, a big figure, a chart and a closing slide" = "En titel, en agenda, en stor figur, ett diagram och en avslutande bild" @@ -1395,6 +1396,7 @@ name = "Svenska" "Use as mask" = "Använd som mask" "Use auto layout" = "Använd automatisk layout" "Use number keys for opacity" = "Använd siffertangenterna för opacitet" +"Use the .figcraft or .fig extension." = "Använd filändelsen .figcraft eller .fig." "Use the layer's fill" = "Använd lagrets fyllning" "Used in {files} · {instances}" = "Används i {files} · {instances}" "Username" = "Användarnamn" diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml index a2be6b99c..b6021987d 100644 --- a/crates/ui-egui/locales/tr.toml +++ b/crates/ui-egui/locales/tr.toml @@ -18,6 +18,7 @@ name = "Türkçe" "1…9, 0" = "1…9, 0" "@{login}: {prs} PRs, {commits} commits, +{added} / −{deleted} lines (Δ {delta}), +{bin_added} / −{bin_deleted} binary assets, {first} – {last}" = "@{login}: {prs} PR, {commits} commit, +{added} / −{deleted} satır (Δ {delta}), +{bin_added} / −{bin_deleted} ikili varlık, {first} – {last}" "A collection of this file with these modes and variables: override their values per mode and add variables of its own" = "Bu dosyanın bu modları ve değişkenleri içeren bir koleksiyonu: değerlerini mod başına geçersiz kılın ve kendi değişkenlerinizi ekleyin" +"A .figcraft file with this name already exists. Choose its full name to confirm replacement." = "Bu adda bir .figcraft dosyası zaten var. Değiştirmeyi onaylamak için tam adını seçin." "A responsive product page: hero, features, figures, a quote and a footer" = "Duyarlı bir ürün sayfası: giriş bölümü, özellikler, rakamlar, bir alıntı ve bir alt bilgi" "A spring plays until it settles: its mass, stiffness and damping set how long" = "Yay, durulana kadar oynar: kütlesi, sertliği ve sönümü ne kadar süreceğini belirler" "A title, an agenda, a big figure, a chart and a closing slide" = "Bir başlık, bir gündem, büyük bir rakam, bir grafik ve bir kapanış slaydı" @@ -1397,6 +1398,7 @@ name = "Türkçe" "Use as mask" = "Maske olarak kullan" "Use auto layout" = "Otomatik yerleşim kullan" "Use number keys for opacity" = "Opaklık için rakam tuşlarını kullan" +"Use the .figcraft or .fig extension." = ".figcraft veya .fig uzantısını kullanın." "Use the layer's fill" = "Katmanın dolgusunu kullan" "Used in {files} · {instances}" = "Kullanıldığı yer: {files} · {instances}" "Username" = "Kullanıcı adı" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index af4cf6534..3bf2ee9be 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -19,6 +19,7 @@ status = "draft — needs native review" "1…9, 0" = "1…9, 0" "@{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 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 文件。请选择其完整名称以确认替换。" "A layer on its own aligns to its frame: select more layers, or one in a frame" = "单个图层与其所在画框对齐:请再选择其他图层,或选择画框内的图层" "A spring plays until it settles: its mass, stiffness and damping set how long" = "弹簧动画播放至静止,时长由质量、刚度和阻尼决定" "About" = "关于" @@ -1339,6 +1340,7 @@ status = "draft — needs native review" "Use as mask" = "用作蒙版" "Use auto layout" = "使用自动布局" "Use number keys for opacity" = "用数字键设置不透明度" +"Use the .figcraft or .fig extension." = "请使用 .figcraft 或 .fig 扩展名。" "Use the layer's fill" = "使用图层的填充" "Used in {files} · {instances}" = "用于 {files} · {instances}" "Username" = "用户名" From 3fadbf4ba9613f1fcc9f11c770f927c5088524f4 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 13:54:25 +0700 Subject: [PATCH 123/817] #632: read the network with the decoder #631 left --- crates/format/src/fig/map.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 9a2b696d9..9e388cc4a 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -1186,7 +1186,7 @@ impl<'a> Mapper<'a> { fail(self, "has no vector network"); return; }; - let Some((net, _)) = network::decode_styled(blob) else { + let Some(net) = network::decode(blob) else { fail(self, "has damaged vector data"); return; }; From ca94b5fe6f144b31092731d056fb4046c450476c Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 13:54:27 +0700 Subject: [PATCH 124/817] #632: leave the progress docs to the maintainer --- docs/gaps.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/gaps.md b/docs/gaps.md index a5cd6a3bc..e8b111a8d 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -41,10 +41,6 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe ## Entries ### 1. `.fig` files: the import's tail -- **Text paths (2026-10-15):** local `.fig` import maps supported connected `TEXT_PATH` networks - to existing editable native text paths, preserving the start segment, direction and styled - runs. Other vertical placements, multiline/ambiguous networks, path decorations, public REST - text paths and `.fig` text-path export remain limited. - **Landed (2026-10-11):** `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors, auto layout (grid included), constraints, components, sets, instances (expanded from their main with overrides, derived layout and property values), styles, variables with modes and bindings, prototyping and image fills from the archive come across; anything else is a warning (`crates/format/src/fig`). Then (2026-10-11): vectors open as editable vector networks (per-point corner radius, handle mirroring, end caps; outlines when the network blob is missing or damaged), sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers import as the closest frames, text layers and vectors with a warning, and set-variable, set-variable-mode and conditional prototype actions come across. `file.open`, `file.import`, drag and drop, the CLI and MCP's `open_file` read `.fig`; the file is never saved over. From d84aa7f1e1f14a41fc2d0591064a8a220616d245 Mon Sep 17 00:00:00 2001 From: Skyfuller1303 Date: Fri, 16 Oct 2026 02:38:33 +0200 Subject: [PATCH 125/817] M1: import image adjustments from .fig files Image paints that carry a current filter container now import their exposure, contrast, vibrance (as saturation), temperature, tint, highlights and shadows as native image filters. Neutral values leave the paint untouched. The older color-adjust container alone, both containers together, filters that have no native equivalent (brightness, detail, vignette and unknown fields) and malformed or non-finite values are skipped and reported as import notes. A positive tint in .fig data moves toward magenta, so it is flipped once at the .fig boundary; public REST image filters keep their sign and are not reported as approximated. Imported filters use the approximate native renderer, which the import says once. --- crates/format/src/fig/image_filter_tests.rs | 83 +++++++++++++++++++ crates/format/src/fig/map.rs | 74 +++++++++++++++-- .../format/src/fig/map_image_filter_tests.rs | 27 ++++++ crates/format/src/fig/tests.rs | 3 + crates/format/src/rest/props.rs | 23 ++++- crates/format/src/rest/tests.rs | 18 ++++ 6 files changed, 219 insertions(+), 9 deletions(-) create mode 100644 crates/format/src/fig/image_filter_tests.rs create mode 100644 crates/format/src/fig/map_image_filter_tests.rs diff --git a/crates/format/src/fig/image_filter_tests.rs b/crates/format/src/fig/image_filter_tests.rs new file mode 100644 index 000000000..b8d646948 --- /dev/null +++ b/crates/format/src/fig/image_filter_tests.rs @@ -0,0 +1,83 @@ +//! Image paint filters read from `.fig` files, on fixtures built in code with the parent module's +//! helpers. + +use super::*; + +/// The shared schema plus the image filter containers only these tests use. +fn image_filter_schema() -> Schema { + let text = SCHEMA + .replace( + "message Paint ", + "message FilterColorAdjust float tint, float shadows, float highlights, float detail, float exposure, float vignette, float temperature, float vibrance\n\ + message PaintFilterMessage float tint, float shadows, float highlights, float detail, float exposure, float vignette, float temperature, float vibrance, float contrast, float brightness, float mystery\n\ + message Paint ", + ) + .replace("ImageScaleMode imageScaleMode\n", "ImageScaleMode imageScaleMode, PaintFilterMessage paintFilter, FilterColorAdjust filterColorAdjust\n"); + Schema::parse(&text).unwrap() +} + +#[test] +fn image_filters_import_from_current_container_and_skip_ambiguous_data() { + let filter = |fields: Vec<(&'static str, Kv<'static>)>| o(fields); + let image_paint = |id: u64, name: &'static str, mut extra: Vec<(&'static str, Kv<'static>)>| { + let mut paint = vec![("type", e("IMAGE")), ("image", o(vec![("hash", Kv::Bytes(HASH.to_vec()))]))]; + paint.append(&mut extra); + node(id, Some((1, "!")), "RECTANGLE", name, vec![("size", xy(2.0, 1.0)), ("fillPaints", arr(vec![o(paint)]))]) + }; + let nodes = vec![ + node(0, None, "DOCUMENT", "Document", vec![]), + node(1, Some((0, "!")), "CANVAS", "Page", vec![]), + image_paint( + 2, + "Current", + vec![( + "paintFilter", + filter(vec![ + ("exposure", f(0.25)), + ("contrast", f(0.3)), + ("vibrance", f(-0.4)), + ("temperature", f(0.5)), + ("tint", f(1.0)), + ("highlights", f(-0.6)), + ("shadows", f(0.7)), + ]), + )], + ), + image_paint(3, "Negative tint", vec![("paintFilter", filter(vec![("tint", f(-1.0)), ("contrast", f(-0.3))]))]), + image_paint(4, "Neutral", vec![]), + image_paint(5, "Explicit neutral", vec![("paintFilter", filter(vec![("exposure", f(0.0)), ("vibrance", f(0.0))]))]), + image_paint(6, "Legacy", vec![("filterColorAdjust", filter(vec![("exposure", f(0.8))]))]), + image_paint(7, "Both", vec![("filterColorAdjust", filter(vec![("exposure", f(0.8))])), ("paintFilter", filter(vec![("contrast", f(0.2))]))]), + image_paint( + 8, + "Unsupported", + vec![("paintFilter", filter(vec![("brightness", f(0.4)), ("detail", f(-0.2)), ("vignette", f(0.3)), ("mystery", f(0.1))]))], + ), + ]; + let bytes = zip_file(&canvas(&image_filter_schema(), &o(vec![("nodeChanges", arr(nodes))]))); + let (doc, warnings) = import(&bytes, "ImageFilters.fig").unwrap(); + let get = |name: &str| { + let node = doc.nodes().find(|node| node.name == name).unwrap(); + let figcraft_doc::color::PaintKind::Image(image) = &node.fills[0].kind else { panic!("{name} is not an image fill") }; + image + }; + let current = get("Current"); + assert!((current.filters.exposure - 0.25).abs() < 1e-6); + assert!((current.filters.contrast - 0.3).abs() < 1e-6, "observed raw contrast remains 0.3"); + assert!((current.filters.saturation + 0.4).abs() < 1e-6, "vibrance maps to saturation"); + assert!((current.filters.temperature - 0.5).abs() < 1e-6); + assert!((current.filters.tint + 1.0).abs() < 1e-6, "positive Figma tint converts once at the REST boundary"); + assert!((current.filters.highlights + 0.6).abs() < 1e-6); + assert!((current.filters.shadows - 0.7).abs() < 1e-6); + assert!((get("Negative tint").filters.tint - 1.0).abs() < 1e-6); + assert!((get("Negative tint").filters.contrast + 0.3).abs() < 1e-6); + assert_eq!(get("Neutral").filters, Default::default()); + assert_eq!(get("Explicit neutral").filters, Default::default()); + assert_eq!(doc.images.get(¤t.image).map(|image| image.bytes.as_slice()), Some(png().as_slice())); + assert!(warnings.iter().any(|w| w.contains("legacy image filter container is unsupported")), "{warnings:?}"); + assert!(warnings.iter().any(|w| w.contains("both filter containers are present")), "{warnings:?}"); + for field in ["brightness", "detail", "vignette", "mystery"] { + assert!(warnings.iter().any(|w| w.contains(field)), "missing {field} warning: {warnings:?}"); + } + assert_eq!(warnings.iter().filter(|w| w.contains("approximate renderer")).count(), 1, "deduplicated approximation warning: {warnings:?}"); +} diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 0fe446629..62d10d711 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -55,6 +55,10 @@ pub(super) fn to_rest(msg: &Kv, name: &str) -> (Value, Vec) { (out, m.warnings) } +#[cfg(test)] +#[path = "map_image_filter_tests.rs"] +mod image_filter_tests; + /// REST importer warnings reworded for a `.fig` import (`None`: drop it). pub(super) fn adapt_warning(w: String) -> Option { if w.contains("geometry=paths") { @@ -73,6 +77,16 @@ fn num(n: &Kv, k: &str) -> Option { n.get(k).and_then(Kv::f64) } +fn filter_number(value: &Kv) -> Option { + let number = match value { + Kv::Float(value) => f64::from(*value), + Kv::Int(value) => *value as f64, + Kv::Uint(value) => *value as f64, + _ => return None, + }; + number.is_finite().then_some(number) +} + fn guid(v: &Kv) -> Option { Some(format!("{}:{}", num(v, "sessionID")? as u64, num(v, "localID")? as u64)) } @@ -964,11 +978,11 @@ impl<'a> Mapper<'a> { let fill_style = self.style(v, "styleIdForFill", "inheritFillStyleID", "fill", &mut styles); let fills = own("fillPaints") .unwrap_or_else(|| fill_style.map_or_else(|| v.list("fillPaints"), |s| s.get("fillPaints").map(Kv::list).unwrap_or_default())); - o.insert("fills".into(), Value::Array(fills.iter().filter_map(paint).collect())); + o.insert("fills".into(), Value::Array(fills.iter().filter_map(|p| paint(p, &mut |w| self.warn(w))).collect())); let stroke_style = self.style(v, "styleIdForStrokeFill", "inheritFillStyleIDForStroke", "stroke", &mut styles); let strokes = own("strokePaints") .unwrap_or_else(|| stroke_style.map_or_else(|| v.list("strokePaints"), |s| s.get("fillPaints").map(Kv::list).unwrap_or_default())); - o.insert("strokes".into(), Value::Array(strokes.iter().filter_map(paint).collect())); + o.insert("strokes".into(), Value::Array(strokes.iter().filter_map(|p| paint(p, &mut |w| self.warn(w))).collect())); let effect_style = self.style(v, "styleIdForEffect", "inheritEffectStyleID", "effect", &mut styles); let effects = effect_style.map_or_else(|| v.list("effects"), |s| s.get("effects").map(Kv::list).unwrap_or_default()); if !effects.is_empty() { @@ -1138,7 +1152,7 @@ impl<'a> Mapper<'a> { } o.insert("style".into(), Value::Object(style)); let Some(td) = td else { return }; - char_styles(o, td, size); + char_styles(o, td, size, &mut |w| self.warn(w)); let lines: Vec<&str> = td .get("lines") .map(Kv::list) @@ -1333,7 +1347,7 @@ impl<'a> Mapper<'a> { o.remove("styleOverrideTable"); if let Some(tv) = val.get("textValue") { let size = o.get("style").and_then(|s| s.get("fontSize")).and_then(Value::as_f64); - char_styles(o, tv, size); + char_styles(o, tv, size, &mut |w| self.warn(w)); } } } @@ -1920,7 +1934,7 @@ fn paint_bound(p: &Kv) -> bool { alias(p.get("colorVar")).is_some() || p.get("stopsVar").map(Kv::list).unwrap_or_default().iter().any(|s| alias(s.get("colorVar")).is_some()) } -fn paint(p: &Kv) -> Option { +fn paint(p: &Kv, warn: &mut dyn FnMut(String)) -> Option { let ty = p.get("type").and_then(Kv::str)?; let mut o = Obj::new(); o.insert("type".into(), json!(ty)); @@ -1989,6 +2003,52 @@ fn paint(p: &Kv) -> Option { if let Some(r) = num(p, "rotation") { o.insert("rotation".into(), json!(r)); } + match (p.get("filterColorAdjust"), p.get("paintFilter")) { + (Some(_), Some(_)) => { + warn("image filters are ambiguous because both filter containers are present; filter conversion was skipped".into()) + } + (Some(_), None) => warn("legacy image filter container is unsupported; filter conversion was skipped".into()), + (None, Some(filters)) => { + let mut mapped = Obj::new(); + let fields = [ + ("exposure", "exposure"), + ("contrast", "contrast"), + ("vibrance", "saturation"), + ("temperature", "temperature"), + ("tint", "tint"), + ("highlights", "highlights"), + ("shadows", "shadows"), + ]; + if let Kv::Object(values) = filters { + for (source, target) in fields { + if let Some(value) = filters.get(source) { + match filter_number(value) { + Some(value) => { + mapped.insert(target.into(), json!(value)); + } + None => warn(format!("malformed image filter `{source}` was skipped")), + } + } + } + for (name, value) in values { + if fields.iter().any(|(known, _)| *known == *name) { + continue; + } + match filter_number(value) { + Some(0.0) => {} + Some(_) => warn(format!("nonzero unsupported image filter `{}` was skipped", crate::rest::props::clip_str(name))), + None => warn(format!("malformed unsupported image filter `{}` was skipped", crate::rest::props::clip_str(name))), + } + } + } else { + warn("malformed image paintFilter container was skipped".into()); + } + if !mapped.is_empty() { + o.insert("filters".into(), Value::Object(mapped)); + } + } + (None, None) => {} + } } _ => {} } @@ -2046,7 +2106,7 @@ fn variable_value(d: &Kv) -> Option { /// Per-character styles of text data `td` (`characterStyleIDs` + `styleOverrideTable`) as REST /// `characterStyleOverrides` + `styleOverrideTable`; `size`: the base font size. -fn char_styles(o: &mut Obj, td: &Kv, size: Option) { +fn char_styles(o: &mut Obj, td: &Kv, size: Option, warn: &mut dyn FnMut(String)) { let ids: Vec = td.get("characterStyleIDs").map(Kv::list).unwrap_or_default().iter().filter_map(Kv::f64).map(|i| i as u64).collect(); if ids.iter().all(|i| *i == 0) { return; @@ -2056,7 +2116,7 @@ fn char_styles(o: &mut Obj, td: &Kv, size: Option) { let Some(sid) = num(e, "styleID") else { continue }; let mut s = text_style(&View::of(e), size); if let Some(fills) = e.get("fillPaints") { - s.insert("fills".into(), Value::Array(fills.list().iter().filter_map(paint).collect())); + s.insert("fills".into(), Value::Array(fills.list().iter().filter_map(|p| paint(p, warn)).collect())); } table.insert((sid as u64).to_string(), Value::Object(s)); } diff --git a/crates/format/src/fig/map_image_filter_tests.rs b/crates/format/src/fig/map_image_filter_tests.rs new file mode 100644 index 000000000..a8db39a77 --- /dev/null +++ b/crates/format/src/fig/map_image_filter_tests.rs @@ -0,0 +1,27 @@ +//! Malformed image paint filters are skipped with a warning. + +use super::*; + +#[test] +fn malformed_non_finite_filter_is_skipped_with_warning() { + let paint = Kv::Object(vec![("type", Kv::Enum("IMAGE")), ("paintFilter", Kv::Object(vec![("exposure", Kv::Float(f32::NAN))]))]); + let mut warnings = Vec::new(); + let value = super::paint(&paint, &mut |warning| warnings.push(warning)).unwrap(); + assert!(value.get("filters").is_none(), "{value}"); + assert!(warnings.iter().any(|warning| warning.contains("malformed image filter `exposure`")), "{warnings:?}"); +} + +#[test] +fn boolean_filter_values_are_malformed_even_when_false() { + for (field, value, expected_warning) in [ + ("exposure", Kv::Bool(true), "malformed image filter `exposure`"), + ("exposure", Kv::Bool(false), "malformed image filter `exposure`"), + ("mystery", Kv::Bool(false), "malformed unsupported image filter `mystery`"), + ] { + let paint = Kv::Object(vec![("type", Kv::Enum("IMAGE")), ("paintFilter", Kv::Object(vec![(field, value)]))]); + let mut warnings = Vec::new(); + let value = super::paint(&paint, &mut |warning| warnings.push(warning)).unwrap(); + assert!(value.get("filters").is_none(), "{value}"); + assert!(warnings.iter().any(|warning| warning.contains(expected_warning)), "{warnings:?}"); + } +} diff --git a/crates/format/src/fig/tests.rs b/crates/format/src/fig/tests.rs index 19c4fc157..e98a1f340 100644 --- a/crates/format/src/fig/tests.rs +++ b/crates/format/src/fig/tests.rs @@ -873,6 +873,9 @@ fn nested_instances_resized_again_drop_the_layout_derived_for_their_old_size() { #[path = "tail_tests.rs"] mod tail; +#[path = "image_filter_tests.rs"] +mod image_filters; + /// `.fig` files in the folder `FIGCRAFT_FIG_SAMPLES` names (none when it's unset). pub(super) fn samples() -> Vec { let Some(dir) = std::env::var_os("FIGCRAFT_FIG_SAMPLES") else { return Vec::new() }; diff --git a/crates/format/src/rest/props.rs b/crates/format/src/rest/props.rs index 67ec8063b..ac4d35196 100644 --- a/crates/format/src/rest/props.rs +++ b/crates/format/src/rest/props.rs @@ -178,6 +178,24 @@ fn image(cx: &mut Ctx, p: &Value) -> ImagePaint { .filter(|c| c[0].abs() > 1e-9 && c[3].abs() > 1e-9); let f = p.get("filters"); let filter = |k: &str| f.and_then(|f| num(f, k)).unwrap_or(0.0).clamp(-1.0, 1.0) as f32; + let filter_fields = ["exposure", "contrast", "saturation", "temperature", "tint", "highlights", "shadows"]; + let mut has_filters = false; + if let Some(filters) = f.and_then(Value::as_object) { + for (key, value) in filters { + match value.as_f64().filter(|value| value.is_finite()) { + Some(value) if filter_fields.contains(&key.as_str()) => has_filters |= value != 0.0, + Some(0.0) => {} + Some(_) => cx.warn(format!("nonzero unsupported image filter `{}` was skipped", clip_str(key))), + None => cx.warn(format!("malformed image filter `{}` was skipped", clip_str(key))), + } + } + } else if f.is_some_and(|filters| !filters.is_null()) { + cx.warn("malformed image filters container was skipped"); + } + let fig = cx.fig_sources.is_some(); + if has_filters && fig { + cx.warn("image filters use FigCraft's approximate renderer"); + } ImagePaint { image: cx.image_key(text(p, "imageRef").unwrap_or("")), scale_mode, @@ -189,7 +207,8 @@ fn image(cx: &mut Ctx, p: &Value) -> ImagePaint { contrast: filter("contrast"), saturation: filter("saturation"), temperature: filter("temperature"), - tint: filter("tint"), + // A positive tint in .fig sources moves toward magenta; native positive tint adds green. + tint: if fig { -filter("tint") } else { filter("tint") }, highlights: filter("highlights"), shadows: filter("shadows"), }, @@ -550,6 +569,6 @@ pub(super) fn export_settings(v: &Value) -> Vec { } /// At most 200 chars of `s` (names and labels from the file stay readable in warnings). -pub(super) fn clip_str(s: &str) -> &str { +pub(crate) fn clip_str(s: &str) -> &str { s.char_indices().nth(200).and_then(|(i, _)| s.get(..i)).unwrap_or(s) } diff --git a/crates/format/src/rest/tests.rs b/crates/format/src/rest/tests.rs index d7117fd00..282476efe 100644 --- a/crates/format/src/rest/tests.rs +++ b/crates/format/src/rest/tests.rs @@ -186,6 +186,24 @@ fn paints_gradients_and_image_placeholders() { assert!(warnings.iter().any(|w| w.starts_with("1 image without image data shows")), "{warnings:?}"); } +#[test] +fn public_rest_image_filter_tint_keeps_its_sign() { + let rect = |name: &str, tint: f64| { + json!({ + "id": name, "name": name, "type": "RECTANGLE", "relativeTransform": at(0.0, 0.0), "size": {"x": 10, "y": 10}, + "fills": [{"type": "IMAGE", "imageRef": "tint", "filters": {"tint": tint}}] + }) + }; + let (doc, warnings) = one(json!([rect("Magenta", 0.75), rect("Green", -0.5)])); + let image = |name: &str| { + let PaintKind::Image(image) = &named(&doc, name).fills[0].kind else { panic!("{name} is not an image fill") }; + image + }; + assert!(close(f64::from(image("Magenta").filters.tint), 0.75)); + assert!(close(f64::from(image("Green").filters.tint), -0.5)); + assert!(!warnings.iter().any(|w| w.contains("approximate renderer")), "{warnings:?}"); +} + #[test] fn image_bytes_come_from_the_resolver() { let png = { From 2ac4ce3a730f02fef392c0f6fcb28ada4dfcb10e Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 13:58:41 +0700 Subject: [PATCH 126/817] #635: rebase onto #628: the filter tests add their paint fields themselves The test schema extended the image scale-mode field that only #634 adds; it now adds the filter containers to the paint message itself, so it works with and without #634. --- crates/format/src/fig/image_filter_tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/format/src/fig/image_filter_tests.rs b/crates/format/src/fig/image_filter_tests.rs index b8d646948..3216b2b31 100644 --- a/crates/format/src/fig/image_filter_tests.rs +++ b/crates/format/src/fig/image_filter_tests.rs @@ -12,7 +12,7 @@ fn image_filter_schema() -> Schema { message PaintFilterMessage float tint, float shadows, float highlights, float detail, float exposure, float vignette, float temperature, float vibrance, float contrast, float brightness, float mystery\n\ message Paint ", ) - .replace("ImageScaleMode imageScaleMode\n", "ImageScaleMode imageScaleMode, PaintFilterMessage paintFilter, FilterColorAdjust filterColorAdjust\n"); + .replace("message Paint PaintType type,", "message Paint PaintFilterMessage paintFilter, FilterColorAdjust filterColorAdjust, PaintType type,"); Schema::parse(&text).unwrap() } From baa58b21faa220a9920586bff2106e84286025f0 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 13:59:03 +0700 Subject: [PATCH 127/817] #620: file.open with base64 data returns the summary too --- crates/engine/src/cmd/file.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index ab459e136..af2ac56d5 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -698,9 +698,10 @@ fn open_data(s: &mut Session, data: &str, p: &Value, variables: Option<&Value>) let bytes = base64::engine::general_purpose::STANDARD.decode(data.trim()).map_err(|e| bad("file.open", e.to_string()))?; let (loaded, rest) = load_with(&bytes, &name, variables, &figcraft_format::rest::no_images)?; let warnings = rest || ext(&name) == "svg"; + let summary = import_summary(&loaded.doc); s.docs.push(DocState::new(loaded.doc, None).with_versions(loaded.versions).with_branches(loaded.branches)); s.active = s.docs.len() - 1; - let mut out = json!({"index": s.active}); + let mut out = json!({"index": s.active, "summary": summary}); out[if warnings { "warnings" } else { "repairs" }] = json!(loaded.issues); Ok(out) } From 48d74df226894457390f4968ab76fec276526846 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 14:03:57 +0700 Subject: [PATCH 128/817] #635: one tint sign for REST file JSON and .fig Both carry the same image filter value, which the public docs describe as green when lower and magenta when higher; a positive native tint adds green. Both readers flip it now (the .fig path did, the REST path didn't). The .fig test message no longer names the product. --- crates/format/src/fig/image_filter_tests.rs | 2 +- crates/format/src/rest/props.rs | 5 +++-- crates/format/src/rest/tests.rs | 7 ++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/crates/format/src/fig/image_filter_tests.rs b/crates/format/src/fig/image_filter_tests.rs index 3216b2b31..83792123d 100644 --- a/crates/format/src/fig/image_filter_tests.rs +++ b/crates/format/src/fig/image_filter_tests.rs @@ -66,7 +66,7 @@ fn image_filters_import_from_current_container_and_skip_ambiguous_data() { assert!((current.filters.contrast - 0.3).abs() < 1e-6, "observed raw contrast remains 0.3"); assert!((current.filters.saturation + 0.4).abs() < 1e-6, "vibrance maps to saturation"); assert!((current.filters.temperature - 0.5).abs() < 1e-6); - assert!((current.filters.tint + 1.0).abs() < 1e-6, "positive Figma tint converts once at the REST boundary"); + assert!((current.filters.tint + 1.0).abs() < 1e-6, "a positive (magenta) tint in the file is a negative native tint"); assert!((current.filters.highlights + 0.6).abs() < 1e-6); assert!((current.filters.shadows - 0.7).abs() < 1e-6); assert!((get("Negative tint").filters.tint - 1.0).abs() < 1e-6); diff --git a/crates/format/src/rest/props.rs b/crates/format/src/rest/props.rs index ac4d35196..0ee2d687b 100644 --- a/crates/format/src/rest/props.rs +++ b/crates/format/src/rest/props.rs @@ -207,8 +207,9 @@ fn image(cx: &mut Ctx, p: &Value) -> ImagePaint { contrast: filter("contrast"), saturation: filter("saturation"), temperature: filter("temperature"), - // A positive tint in .fig sources moves toward magenta; native positive tint adds green. - tint: if fig { -filter("tint") } else { filter("tint") }, + // The files' tint runs from green (negative) to magenta (positive), in REST file JSON and + // .fig alike; a positive native tint adds green. + tint: -filter("tint"), highlights: filter("highlights"), shadows: filter("shadows"), }, diff --git a/crates/format/src/rest/tests.rs b/crates/format/src/rest/tests.rs index 282476efe..97e5d8288 100644 --- a/crates/format/src/rest/tests.rs +++ b/crates/format/src/rest/tests.rs @@ -187,7 +187,7 @@ fn paints_gradients_and_image_placeholders() { } #[test] -fn public_rest_image_filter_tint_keeps_its_sign() { +fn image_filter_tint_turns_magenta_positive_into_native_green_positive() { let rect = |name: &str, tint: f64| { json!({ "id": name, "name": name, "type": "RECTANGLE", "relativeTransform": at(0.0, 0.0), "size": {"x": 10, "y": 10}, @@ -199,8 +199,9 @@ fn public_rest_image_filter_tint_keeps_its_sign() { let PaintKind::Image(image) = &named(&doc, name).fills[0].kind else { panic!("{name} is not an image fill") }; image }; - assert!(close(f64::from(image("Magenta").filters.tint), 0.75)); - assert!(close(f64::from(image("Green").filters.tint), -0.5)); + // The same sign as a `.fig` import (`fig::tests::image_filters`). + assert!(close(f64::from(image("Magenta").filters.tint), -0.75)); + assert!(close(f64::from(image("Green").filters.tint), 0.5)); assert!(!warnings.iter().any(|w| w.contains("approximate renderer")), "{warnings:?}"); } From 9e28e119548745adf9dbf09e96588ce79a9d83d9 Mon Sep 17 00:00:00 2001 From: BFlat Date: Sat, 17 Oct 2026 14:03:59 +0700 Subject: [PATCH 129/817] M3: number variables in the text content picker (#629) (#725) The Typography section's variable picker also lists number variables for a text layer's content (shown as the number), as the engine already accepted; other text fields keep their own types (#629). --- ROADMAP.md | 4 +++- crates/ui-egui/src/variable_ui.rs | 28 +++++++++++++++++++++++++++- docs/target-app-parity.md | 3 ++- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index bbde8bc5b..006b81b9a 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -131,6 +131,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). ## Progress log +- **2026-10-17** · Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. - **2026-10-17** · Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. - **2026-10-14** · Corner handles win over the corner-radius handles (M1, #292): a press on the inner half of a corner handle's square picked the radius handle 10 px in, so the drag neither resized nor (dragging outward) rounded anything. Inside the drawn square the corner now resizes both sides (in ratio with Shift or the link); further in the radius handle still answers. Regression test in the transform behaviour suite. Numbers unchanged. - **2026-10-14** · Home screen recent files as cards (M7): each card shows the picture its file carries on its first page's colour, the file's icon, name and "Edited ... ago"; sort by name, creation or last change either way; a table view; a click selects, a double-click or Enter opens, arrow keys move; Open, Show in folder and Remove from recents on right-click. Numbers unchanged. @@ -314,6 +315,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | | 2026-10-17 | minor | Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | | 2026-10-15 | minor | Drop files anywhere to open them (M7): dragging files over the window shows a "Drop to open" (home) or "Drop to import" (canvas) overlay. On the home screen each supported file opens as a document of its own and other files are turned away with a toast; on the canvas the files import at the drop point. Both wait behind a small card that is on screen before a large file blocks the window. A canvas import stays with the document and page that received the drop even if the tab or page changes meanwhile, and is cancelled with a message if that document or page is gone. Numbers unchanged. | diff --git a/crates/ui-egui/src/variable_ui.rs b/crates/ui-egui/src/variable_ui.rs index 04507c0c4..e6cc6860e 100644 --- a/crates/ui-egui/src/variable_ui.rs +++ b/crates/ui-egui/src/variable_ui.rs @@ -361,6 +361,12 @@ pub fn bound_row(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], field: &str, kin }); } +/// Whether a variable of type `have` belongs in a picker for `want` on `field`: its own type, and +/// numbers for text content too (shown as text). +fn kind_fits(want: Option, field: Option<&str>, have: VariableType) -> bool { + want.is_none_or(|k| have == k || (field == Some("characters") && have == VariableType::Number)) +} + /// The picker popover (call once per frame). pub fn picker(app: &mut FigApp, ctx: &egui::Context) { let Some(p) = ctx.data(|d| d.get_temp::(picker_id())) else { return }; @@ -379,8 +385,12 @@ pub fn picker(app: &mut FigApp, ctx: &egui::Context) { }; // Prototypes and styles use this file's variables. let local_only = matches!(p.target, Target::Proto(_) | Target::Style { .. }); + let field = match &p.target { + Target::Bind { field, .. } => Some(field.as_str()), + _ => None, + }; let keep = |lib: Option<&PublishedLibrary>, v: &Variable| { - p.kind.is_none_or(|k| v.kind == k) + kind_fits(p.kind, field, v.kind) && !(local_only && lib.is_some()) && (q.is_empty() || v.name.to_lowercase().contains(&q)) && scope.is_none_or(|s| v.in_scope(s)) @@ -476,3 +486,19 @@ pub fn picker(app: &mut FigApp, ctx: &egui::Context) { fn groups_any_kind(doc: &Document, libs: &[Arc], kind: Option) -> bool { !groups(doc, libs, |_, v| kind.is_none_or(|k| v.kind == k)).is_empty() } + +#[cfg(test)] +mod kind_tests { + use super::*; + + #[test] + fn text_content_offers_numbers_too() { + use VariableType::*; + assert!(kind_fits(Some(String), Some("characters"), Number), "a number shows as text"); + assert!(kind_fits(Some(String), Some("characters"), String)); + assert!(!kind_fits(Some(String), Some("characters"), Color)); + assert!(!kind_fits(Some(String), Some("fontFamily"), Number), "only text content"); + assert!(!kind_fits(Some(Number), Some("width"), String)); + assert!(kind_fits(None, None, Boolean)); + } +} diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 7c89f2390..c3842d4f0 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # FigCraft parity with Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (frames and sections convert into each other (#719); 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) · **Target:** Figma Design (desktop app 126.10.7, macOS) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (number variables in the text content picker (#629); frames and sections convert into each other (#719); 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) · **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 @@ -628,6 +628,7 @@ Carried over from the ROADMAP's "Shipped so far" (2026-10-10). The test count th | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | | 2026-10-17 | minor | Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. | | 2026-10-14 | minor | Russian catalog (M9), reviewed and approved by VanTan: all 2,165 current entries, Русский in Preferences and regional ru tags. Russian integer plurals use one/few/many; contributor display name VanTan added. Existing estimates unchanged. | | 2026-10-13 | minor | Vector edit mode regions: the filled area under the pointer is hatched (clear of points and segments, holes left out, spacing by octave folding fitted to measurements at several zoom levels, fixed to the shape); click, Shift-click and drag select and move areas with their points (drawn unselected); a click on an empty spot clears them and stays in edit mode (see [ui-parity](ui-parity.md)) | From 1e85d549523a7908d173c61d18524c9a9a15451f Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 14:04:00 +0700 Subject: [PATCH 130/817] #635: cap the .fig import warnings like the REST ones Image filter warnings name fields of the file, so a crafted schema could add any number of distinct warnings (each checked against all earlier ones). The mapper keeps at most as many as the REST importer does. --- crates/format/src/fig/image_filter_tests.rs | 21 +++++++++++++++++++++ crates/format/src/fig/map.rs | 3 ++- crates/format/src/rest/mod.rs | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/crates/format/src/fig/image_filter_tests.rs b/crates/format/src/fig/image_filter_tests.rs index 83792123d..3fa50a200 100644 --- a/crates/format/src/fig/image_filter_tests.rs +++ b/crates/format/src/fig/image_filter_tests.rs @@ -81,3 +81,24 @@ fn image_filters_import_from_current_container_and_skip_ambiguous_data() { } assert_eq!(warnings.iter().filter(|w| w.contains("approximate renderer")).count(), 1, "deduplicated approximation warning: {warnings:?}"); } + +#[test] +fn warnings_naming_unknown_filter_fields_are_capped() { + // A schema can name any number of fields; each nonzero unknown one is a warning of its own. + let names: Vec<&'static str> = (0..300).map(|i| &*Box::leak(format!("unknown{i}").into_boxed_str())).collect(); + let fields: Vec = names.iter().map(|n| format!("float {n}")).collect(); + let text = SCHEMA + .replace("message Paint ", &format!("message ManyFilters {}\nmessage Paint ", fields.join(", "))) + .replace("message Paint PaintType type,", "message Paint ManyFilters paintFilter, PaintType type,"); + let filters = o(names.iter().map(|n| (*n, f(0.5))).collect()); + let paint = o(vec![("type", e("IMAGE")), ("image", o(vec![("hash", Kv::Bytes(HASH.to_vec()))])), ("paintFilter", filters)]); + let nodes = vec![ + node(0, None, "DOCUMENT", "Document", vec![]), + node(1, Some((0, "!")), "CANVAS", "Page", vec![]), + node(2, Some((1, "!")), "RECTANGLE", "Photo", vec![("size", xy(2.0, 1.0)), ("fillPaints", arr(vec![paint]))]), + ]; + let bytes = zip_file(&canvas(&Schema::parse(&text).unwrap(), &o(vec![("nodeChanges", arr(nodes))]))); + let (_, warnings) = import(&bytes, "ManyFilters.fig").unwrap(); + let named = warnings.iter().filter(|w| w.contains("unsupported image filter")).count(); + assert!((100..=crate::rest::MAX_WARNINGS).contains(&named), "{named} of {} warnings", warnings.len()); +} diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 62d10d711..9dc238dc8 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -431,7 +431,8 @@ impl<'a> Mapper<'a> { fn warn(&mut self, w: impl Into) { let w = w.into(); - if !self.warnings.contains(&w) { + // Capped like the REST importer's list: some warnings name fields of the file (image filters). + if self.warnings.len() < crate::rest::MAX_WARNINGS && !self.warnings.contains(&w) { self.warnings.push(w); } } diff --git a/crates/format/src/rest/mod.rs b/crates/format/src/rest/mod.rs index 282c6a754..d42b04f3f 100644 --- a/crates/format/src/rest/mod.rs +++ b/crates/format/src/rest/mod.rs @@ -66,7 +66,7 @@ const MAX_PATH_BYTES: usize = 4 << 20; /// Most path elements in one vector. const MAX_PATH_ELEMENTS: usize = 200_000; /// Most distinct warnings reported. -const MAX_WARNINGS: usize = 200; +pub(crate) const MAX_WARNINGS: usize = 200; /// Most shared style definitions read. const MAX_STYLES: usize = 10_000; /// Image key used for image fills without an `imageRef`. From d0539b83e9893329995c922926ff94fe5514e741 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 14:06:43 +0700 Subject: [PATCH 131/817] #631: follow the decoder rename in #639's connector check #639 lands first and reads networks with decode_styled; once #631 drops the count it calls network::decode. Needed whenever #631 is rebased onto a main that has #639. --- crates/format/src/fig/map.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 3ccf3a97c..7a3dab5c1 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -1074,8 +1074,8 @@ impl<'a> Mapper<'a> { .get("vectorData") .and_then(|data| num(data, "vectorNetworkBlob")) .and_then(|index| self.blobs.get(index as usize)) - .and_then(|blob| network::decode_styled(blob)) - .is_some_and(|(network, _)| !network.segments.is_empty()); + .and_then(|blob| network::decode(blob)) + .is_some_and(|network| !network.segments.is_empty()); (geometry || network) && connector_record(v, "nodeGenerationData", 0).is_some() } From f757044d8cf91e63277481018d381716f7a76b80 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 14:08:05 +0700 Subject: [PATCH 132/817] fix/all: rustfmt the merged module list --- crates/format/src/fig/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/format/src/fig/mod.rs b/crates/format/src/fig/mod.rs index ca01611f6..0d341307e 100644 --- a/crates/format/src/fig/mod.rs +++ b/crates/format/src/fig/mod.rs @@ -28,12 +28,12 @@ mod slot_tests; mod source_identity_tests; #[cfg(test)] mod tests; +#[cfg(test)] +mod text_paragraph_tests; mod text_path; #[cfg(test)] mod text_path_tests; #[cfg(test)] -mod text_paragraph_tests; -#[cfg(test)] mod text_skip_ink_tests; #[cfg(test)] mod text_style_tests; From d40728d0b8ca7aadaddd1b25735c1e0536de8d12 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 14:21:29 +0700 Subject: [PATCH 133/817] #620: import notes come from the importers' own warn() texts, translated once when the report opens --- crates/ui-egui/src/i18n.rs | 11 ++- crates/ui-egui/src/i18n_tests.rs | 37 +++++++-- crates/ui-egui/src/import_report.rs | 94 +++-------------------- crates/ui-egui/src/import_report_tests.rs | 4 +- crates/ui-egui/src/menus.rs | 8 +- 5 files changed, 57 insertions(+), 97 deletions(-) diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs index d30130fbd..22ea1a728 100644 --- a/crates/ui-egui/src/i18n.rs +++ b/crates/ui-egui/src/i18n.rs @@ -108,9 +108,14 @@ fn lookup(lang: usize, key: &str) -> Option<&'static Text> { /// The UI string for `key` (its English text) in the current language. One English text that needs /// two translations gets a context after `|` ("Fill|sizing"); the English catalog maps it back. pub fn tr(key: &str) -> &str { - match lookup(CURRENT.load(Ordering::Relaxed), key) { - Some(Text::Plain(s) | Text::Plural { other: s, .. }) => s, - None => key, + try_tr(key).unwrap_or(key) +} + +/// [`tr`] for text that comes from data and may have no catalog entry (an importer's notes, say): +/// `None` when the catalog doesn't have it. +pub fn try_tr(key: &str) -> Option<&str> { + match lookup(CURRENT.load(Ordering::Relaxed), key)? { + Text::Plain(s) | Text::Plural { other: s, .. } => Some(s), } } diff --git a/crates/ui-egui/src/i18n_tests.rs b/crates/ui-egui/src/i18n_tests.rs index 07f320374..16a06a90b 100644 --- a/crates/ui-egui/src/i18n_tests.rs +++ b/crates/ui-egui/src/i18n_tests.rs @@ -160,15 +160,38 @@ fn used_keys() -> BTreeSet { if !name.ends_with(".rs") || name.ends_with("_tests.rs") || name == "i18n.rs" { continue; } - keys.extend(literals(&std::fs::read_to_string(&path).unwrap())); + keys.extend(literals(&std::fs::read_to_string(&path).unwrap(), LOOKUPS)); } keys } -/// The first-argument string literals of the lookup functions in `src`. -fn literals(src: &str) -> Vec { +/// The importers' fixed notes: the string literals passed to `warn` in the `.fig` and REST import +/// sources. The import report shows a note translated when the catalog has it, so an entry for one +/// counts as used, and an entry for a note the importers no longer give shows up as unused. +fn importer_notes() -> BTreeSet { + let src = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../format/src"); + let mut keys = BTreeSet::new(); + for dir in ["fig", "rest"] { + for entry in std::fs::read_dir(src.join(dir)).unwrap().flatten() { + let path = entry.path(); + let name = path.file_name().unwrap().to_string_lossy().into_owned(); + // export.rs warns about what a `.fig` export leaves out, not about an import. + if !name.ends_with(".rs") || name.contains("tests") || name == "export.rs" { + continue; + } + keys.extend(literals(&std::fs::read_to_string(&path).unwrap(), &["warn("])); + } + } + keys +} + +/// The lookup functions whose first argument is a catalog key. +const LOOKUPS: &[&str] = &["tr(", "trf(", "trn(", "tr_noop("]; + +/// The first-argument string literals of the functions `fns` (each with its `(`) in `src`. +fn literals(src: &str, fns: &[&str]) -> Vec { let mut out = Vec::new(); - for f in ["tr(", "trf(", "trn(", "tr_noop("] { + for f in fns { let mut from = 0; while let Some(i) = src.get(from..).and_then(|s| s.find(f)) { let at = from + i; @@ -229,7 +252,8 @@ fn every_key_in_the_code_is_in_the_english_catalog_and_no_other() { let used: BTreeSet = used_keys().into_iter().chain(dynamic_keys()).collect(); let en: BTreeSet = english().ui.iter().map(|(k, _)| k.to_string()).collect(); let missing: Vec<_> = used.difference(&en).collect(); - let unused: Vec<_> = en.difference(&used).collect(); + let notes = importer_notes(); + let unused: Vec<_> = en.difference(&used).filter(|k| !notes.contains(*k)).collect(); assert!( missing.is_empty(), "keys missing from locales/en.toml:\n{}", @@ -416,7 +440,8 @@ fn the_key_scanner_reads_rust_literals() { let src = r#"x(tr("A \"b\"")); trf( "C {n}", &[]); attr("no"); tr_noop("D\ E"); tr(label);"#; - assert_eq!(literals(src), vec!["A \"b\"", "C {n}", "DE"]); + assert_eq!(literals(src, LOOKUPS), vec!["A \"b\"", "C {n}", "DE"]); + assert_eq!(literals(r#"self.warn("a note"); s.warn(format!("{n}")); forewarn("no")"#, &["warn("]), vec!["a note"]); } #[test] diff --git a/crates/ui-egui/src/import_report.rs b/crates/ui-egui/src/import_report.rs index 0540a2fcf..5b5247273 100644 --- a/crates/ui-egui/src/import_report.rs +++ b/crates/ui-egui/src/import_report.rs @@ -5,85 +5,13 @@ use egui::RichText; use serde_json::{Value, json}; use crate::FigApp; -use crate::i18n::{tr, tr_noop, trn}; +use crate::i18n::{tr, trn, try_tr}; use crate::theme::{Tokens, regular}; /// A report stays small even when a damaged input produces many or very long notes. pub const MAX_NOTES: usize = 500; pub const MAX_NOTE_CHARS: usize = 2_000; -/// The fixed notes of the `.fig` and REST importers, translated in the report. `.fig` imports name -/// "the file" where REST imports name the JSON they read. Other notes (SVG's, say) are shown as they are. -const IMPORT_NOTES: &[&str] = &[ - tr_noop("conditional prototype actions nested too deeply were skipped"), - tr_noop("conditional prototype actions with conditions that can't be evaluated were skipped"), - tr_noop("connector labels were skipped"), - tr_noop("connectors whose ends can't be placed are empty"), - tr_noop("damaged vector geometry was skipped"), - tr_noop("damaged vector networks import as outlines"), - tr_noop("document children other than pages were skipped"), - tr_noop("elbowed and curved connectors without a saved path import as straight lines"), - tr_noop("entries without a node type were skipped"), - tr_noop("filled areas of a vector with their own fill use the layer's fill"), - tr_noop("gamepad triggers without exactly one known controller button were skipped"), - tr_noop("grid tracks of fixed or content size import as equal tracks"), - tr_noop("instance swap properties whose default component isn't in the file were skipped"), - tr_noop("instances inside their own main component were imported as frames"), - tr_noop("instances of components that aren't in the file show no layers"), - tr_noop("instances of components that aren't in the file were imported as frames"), - tr_noop("instances that would nest a component inside itself were imported as frames"), - tr_noop("instances without a main component were imported as empty frames"), - tr_noop("invalid or oversized vector networks import as outlines"), - tr_noop("invalid or oversized vector path data was skipped"), - tr_noop("key triggers without a supported key were skipped"), - tr_noop("key up triggers import as key presses"), - tr_noop("layers without a position were placed at their parent's origin"), - tr_noop("layers without a type were skipped"), - tr_noop("points with their own stroke join use the layer's"), - tr_noop("prototype actions of unknown types were skipped"), - tr_noop("prototype actions without a destination in the file were skipped"), - tr_noop("prototype expressions on variables that aren't in the variables JSON were skipped"), - tr_noop("prototype expressions with unsupported functions were skipped"), - tr_noop("prototype interactions without supported actions were skipped"), - tr_noop("prototype navigations of unknown types were skipped"), - tr_noop("prototype transitions of unknown types play instantly"), - tr_noop("prototype triggers of unknown types were skipped"), - tr_noop("set-variable actions on variables that aren't in the variables JSON were skipped"), - tr_noop("set-variable actions with values that can't be evaluated were skipped"), - tr_noop("set-variable actions with values that don't fit the variable were skipped"), - tr_noop("set-variable actions without a value were skipped"), - tr_noop("set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped"), - tr_noop("some vector points refer to point settings missing from the file; they use the layer's joins and plain corners"), - tr_noop("some vector segments refer to style settings missing from the file; they use the layer's stroke"), - tr_noop("stars and polygons without point counts or geometry use the default point count"), - tr_noop("style settings of some vector segments aren't supported; those segments use the layer's stroke"), - tr_noop("text style overrides refer to missing table entries"), - tr_noop("the file has no pages"), - tr_noop("the variables JSON has no `variableCollections` (expected the local variables response) and was ignored"), - tr_noop("unknown component property types were skipped"), - tr_noop("variable aliases to variables that aren't in the variables JSON (or of another type) were skipped"), - tr_noop("variable bindings to properties the layer doesn't have were skipped"), - tr_noop("variable bindings to variables that aren't in the variables JSON (library variables) were skipped"), - tr_noop( - "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)", - ), - tr_noop("variable bindings whose variable type doesn't fit the property were skipped"), - tr_noop("variable collections without modes were skipped"), - tr_noop("variable mode lookups in prototype expressions that aren't a variable and one of its modes were skipped"), - tr_noop("variable modes of collections that aren't in the file were skipped"), - tr_noop("variable modes of collections that aren't in the variables JSON were skipped"), - tr_noop("variable values that don't match their type (or composed colours) were skipped"), - tr_noop("variables of unknown types were skipped"), - tr_noop("variables whose collection isn't in the variables JSON were skipped"), - tr_noop("variables without readable values were skipped"), - tr_noop("vectors without geometry are empty"), - tr_noop("vectors without geometry are empty (export the file JSON with geometry=paths)"), - tr_noop("very long text was cut to 1,048,576 characters"), - tr_noop("very long vector paths were skipped"), - tr_noop("video actions are not supported and were skipped"), - tr_noop("video triggers are not supported and were skipped"), -]; - #[derive(Clone, Debug)] pub struct Report { pub name: String, @@ -97,6 +25,8 @@ pub struct Report { /// The document the report belongs to: it goes when that document closes. pub uid: u64, pub notes: Vec, + /// `notes` as the window shows them, in the UI language (worked out once, not every frame). + pub shown: Vec, pub note_count: usize, } @@ -136,6 +66,7 @@ impl Report { placed: command == "file.import" && !appended, uid: 0, notes: Vec::new(), + shown: Vec::new(), note_count: 0, }; for note in warnings.iter().filter_map(Value::as_str) { @@ -151,6 +82,7 @@ impl Report { if note.chars().nth(MAX_NOTE_CHARS).is_some() { text.push('…'); } + self.shown.push(note_text(&text)); self.notes.push(text); } } @@ -161,15 +93,13 @@ impl Report { } } -/// `note` in the UI language when it is a known import note; a repeat count (` (×N)`) is kept. The -/// stored notes are lower-case fragments; a known note is shown as a sentence, so its first letter -/// is capitalised here (unknown notes are left as they are). +/// `note` in the UI language when the catalog has it (the importers' fixed notes: `.fig` imports +/// name "the file" where REST imports name the JSON they read); a repeat count (` (×N)`) is kept. +/// The stored notes are lower-case fragments; a known note is shown as a sentence, so its first +/// letter is capitalised here. Other notes (SVG's, say) are shown as they are. pub(crate) fn note_text(note: &str) -> String { let translated = |base: &str| { - if !IMPORT_NOTES.contains(&base) { - return base.to_owned(); - } - let text = tr(base); + let Some(text) = try_tr(base) else { return base.to_owned() }; let mut chars = text.chars(); chars.next().map_or_else(String::new, |first| first.to_uppercase().chain(chars).collect()) }; @@ -230,8 +160,8 @@ pub fn show(app: &mut FigApp, ctx: &egui::Context) { ); ui.add_space(4.0); egui::ScrollArea::vertical().id_salt("import_report_notes").max_height(260.0).show(ui, |ui| { - for note in &report.notes { - ui.label(note_text(note)); + for note in &report.shown { + ui.label(note); ui.add_space(4.0); } }); diff --git a/crates/ui-egui/src/import_report_tests.rs b/crates/ui-egui/src/import_report_tests.rs index 37b516429..bc5fc8bba 100644 --- a/crates/ui-egui/src/import_report_tests.rs +++ b/crates/ui-egui/src/import_report_tests.rs @@ -63,8 +63,8 @@ fn note_text_keeps_the_repeat_suffix_and_unknown_notes() { fn vector_style_notes_are_known_import_notes() { for note in [ "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", - "style settings of some vector segments aren't supported; those segments use the layer's stroke", + "vector points with unknown stroke joins use the layer join", + "point stroke joins were preserved; dashed or variable-width strokes render with the layer join", ] { let shown = note_text(note); assert!(shown.chars().next().is_some_and(char::is_uppercase), "{shown}"); diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index dd7ec5098..31b534294 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -239,20 +239,20 @@ fn recent_menu(app: &mut FigApp, ui: &mut Ui, prefix: &str, key: &str, label: &s let name = path.file_name().map_or_else(|| p.clone(), |f| f.to_string_lossy().into_owned()); let exists = path.exists(); if item(ui, &name, "", exists, false, t) && exists { - picked = Some(("file.openRecent", json!({"path": p}))); + picked = Some(json!({"path": p})); } } if !recents.is_empty() { separator(ui); } if item(ui, tr("Clear recent"), "", !recents.is_empty(), false, t) && !recents.is_empty() { - picked = Some(("file.openRecent", json!({"clear": true}))); + picked = Some(json!({"clear": true})); } picked }); - let Some((command, params)) = picked else { return false }; + let Some(params) = picked else { return false }; // Through the user path, so an import report shows; `file.openRecent` also drops a file that is gone. - if app.run_user(command, params).is_some_and(|r| r.get("index").is_some()) { + if app.run_user("file.openRecent", params).is_some_and(|r| r.get("index").is_some()) { app.ui.home = false; } true From 01c3f0bca6b78f86c8b27474b8bf852e108a4c5b Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 14:21:29 +0700 Subject: [PATCH 134/817] #620: the import report and its notes in every catalog; #617's notes added, stale and unshipped ones dropped --- crates/ui-egui/locales/cs.toml | 74 +++++++++++++++++++++++++++++ crates/ui-egui/locales/de.toml | 7 ++- crates/ui-egui/locales/en.toml | 5 +- crates/ui-egui/locales/es-419.toml | 3 ++ crates/ui-egui/locales/es.toml | 5 +- crates/ui-egui/locales/fr.toml | 74 +++++++++++++++++++++++++++++ crates/ui-egui/locales/id.toml | 74 +++++++++++++++++++++++++++++ crates/ui-egui/locales/ja.toml | 74 +++++++++++++++++++++++++++++ crates/ui-egui/locales/ko.toml | 74 +++++++++++++++++++++++++++++ crates/ui-egui/locales/pt-BR.toml | 74 +++++++++++++++++++++++++++++ crates/ui-egui/locales/ru.toml | 74 +++++++++++++++++++++++++++++ crates/ui-egui/locales/sv.toml | 74 +++++++++++++++++++++++++++++ crates/ui-egui/locales/tr.toml | 74 +++++++++++++++++++++++++++++ crates/ui-egui/locales/zh-Hans.toml | 74 +++++++++++++++++++++++++++++ 14 files changed, 750 insertions(+), 10 deletions(-) diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml index 268ff5275..a13d12db5 100644 --- a/crates/ui-egui/locales/cs.toml +++ b/crates/ui-egui/locales/cs.toml @@ -266,6 +266,7 @@ status = "draft — needs native review" "Commits" = "Commity" "Company" = "Společnost" "Compare changes" = "Porovnat změny" +"Compatibility notes" = "Poznámky ke kompatibilitě" "Completed" = "Dokončeno" "Component" = "Komponenta" "Component name" = "Název komponenty" @@ -472,6 +473,7 @@ status = "draft — needs native review" "False" = "Nepravda" "Feb" = "února" "Fetching from the server…" = "Stahování ze serveru…" +"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 zatím nepodporuje všechny funkce těchto souborů. Poznámky uvádějí, co bylo v importované kopii vynecháno nebo změněno; původní soubor zůstává beze změny." "File" = "Soubor" "File name" = "Název souboru" "File not found" = "Soubor nenalezen" @@ -595,11 +597,14 @@ status = "draft — needs native review" "If {condition}" = "Pokud {condition}" "Ignore auto layout (absolute position)" = "Ignorovat automatické rozvržení (absolutní poloha)" "Image" = "Obrázek" +"Images" = "Obrázky" "Import" = "Import" "Import path" = "Cesta importu" "Import plugin from manifest" = "Importovat plugin z manifestu" "Import plugin from manifest…" = "Importovat plugin z manifestu…" +"Import report" = "Zpráva o importu" "Import variables" = "Importovat proměnné" +"Imported document" = "Importovaný dokument" "Imported {name}" = "Importováno: {name}" "Imported {n} new variables, updated {updated}" = { one = "Importována {n} nová proměnná, aktualizováno: {updated}", few = "Importovány {n} nové proměnné, aktualizováno: {updated}", other = "Importováno {n} nových proměnných, aktualizováno: {updated}" } "Import…" = "Importovat…" @@ -801,6 +806,7 @@ status = "draft — needs native review" "No colour variables fit here." = "Žádné vhodné barevné proměnné." "No colour variables yet. Create them in Local variables." = "Zatím žádné barevné proměnné. Vytvořte je v Místních proměnných." "No comments yet" = "Zatím žádné komentáře" +"No compatibility warnings reported" = "Nebyla hlášena žádná upozornění na kompatibilitu" "No components yet. Select layers and press {keys}." = "Zatím žádné komponenty. Vyberte vrstvy a stiskněte {keys}." "No conflicts." = "Žádné konflikty." "No contributor data was built into this copy." = "Toto sestavení neobsahuje údaje o přispěvatelích." @@ -892,6 +898,7 @@ status = "draft — needs native review" "Open overlay" = "Otevřít překryv" "Open prototype preview" = "Otevřít náhled prototypu" "Open variables ({count})" = "Otevřít proměnné ({count})" +"Opened as a new document" = "Otevřeno jako nový dokument" "Opened “{name}” in a new tab" = "Soubor „{name}“ otevřen v nové kartě" "Open|comments" = "Otevřené" "Options" = "Možnosti" @@ -916,6 +923,8 @@ status = "draft — needs native review" "Padding" = "Vnitřní odsazení" "Page" = "Stránka" "Pages" = "Stránky" +"Pages added to the document" = "Stránky přidány do dokumentu" +"Placed on the current page" = "Umístěno na aktuální stránku" "Pages: {pages}" = "Stránky: {pages}" "Paint bucket" = "Plechovka barvy" "Pan the canvas" = "Posunout plátno" @@ -1485,26 +1494,90 @@ status = "draft — needs native review" "call any command its access allows" = "volat libovolný příkaz povolený jeho oprávněními" "call only: {commands}" = "volat pouze: {commands}" "can edit the document" = "může upravovat dokument" +"conditional prototype actions nested too deeply were skipped" = "podmíněné akce prototypu vnořené příliš hluboko byly přeskočeny" +"conditional prototype actions with conditions that can't be evaluated were skipped" = "podmíněné akce prototypu s podmínkami, které nelze vyhodnotit, byly přeskočeny" +"connector labels were skipped" = "popisky spojnic byly přeskočeny" +"connectors whose ends can't be placed are empty" = "spojnice, jejichž konce nelze umístit, jsou prázdné" "crop marks" = "ořezové značky" +"damaged vector geometry was skipped" = "poškozená vektorová geometrie byla přeskočena" +"damaged vector networks import as outlines" = "poškozené vektorové sítě se importují jako obrysy" "development: {path}" = "vývoj: {path}" +"document children other than pages were skipped" = "potomci dokumentu, kteří nejsou stránkami, byli přeskočeni" "e.g. count + 1" = "např. count + 1" "e.g. count >= 3 and not done" = "např. count >= 3 and not done" +"elbowed and curved connectors without a saved path import as straight lines" = "lomené a zakřivené spojnice bez uložené cesty se importují jako přímky" +"entries without a node type were skipped" = "položky bez typu uzlu byly přeskočeny" "figcraft:// links from a browser, chat or email open this app and join the session." = "Odkazy figcraft:// z prohlížeče, chatu nebo e-mailu otevřou tuto aplikaci a připojí k relaci." +"filled areas of a vector with their own fill use the layer's fill" = "vyplněné oblasti vektoru s vlastní výplní používají výplň vrstvy" "from {server}" = "ze serveru {server}" +"gamepad triggers without exactly one known controller button were skipped" = "spouštěče herního ovladače bez právě jednoho známého tlačítka ovladače byly přeskočeny" +"grid tracks of fixed or content size import as equal tracks" = "stopy mřížky s pevnou velikostí nebo velikostí podle obsahu se importují jako stejné stopy" "hidden" = "skryté" "iOS" = "iOS" +"instance swap properties whose default component isn't in the file were skipped" = "vlastnosti výměny instance, jejichž výchozí komponenta není v souboru, byly přeskočeny" +"instances inside their own main component were imported as frames" = "instance uvnitř vlastní hlavní komponenty byly importovány jako rámce" +"instances of components that aren't in the file show no layers" = "instance komponent, které nejsou v souboru, nezobrazují žádné vrstvy" +"instances of components that aren't in the file were imported as frames" = "instance komponent, které nejsou v souboru, byly importovány jako rámce" +"instances that would nest a component inside itself were imported as frames" = "instance, které by vnořily komponentu samu do sebe, byly importovány jako rámce" +"instances without a main component were imported as empty frames" = "instance bez hlavní komponenty byly importovány jako prázdné rámce" +"invalid or oversized vector networks import as outlines" = "neplatné nebo příliš velké vektorové sítě se importují jako obrysy" +"invalid or oversized vector path data was skipped" = "neplatná nebo příliš velká data vektorových cest byla přeskočena" "just now" = "právě teď" +"key triggers without a supported key were skipped" = "spouštěče kláves bez podporované klávesy byly přeskočeny" +"key up triggers import as key presses" = "spouštěče uvolnění klávesy se importují jako stisky klávesy" +"layers without a position were placed at their parent's origin" = "vrstvy bez pozice byly umístěny do počátku nadřazeného prvku" +"layers without a type were skipped" = "vrstvy bez typu byly přeskočeny" "locked" = "zamknuté" "no bleed" = "bez spadávky" "nobody else here yet" = "zatím tu není nikdo další" "now" = "nyní" "or" = "nebo" +"point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "spojení tahu v bodech byla zachována; přerušované tahy a tahy s proměnnou šířkou se kreslí se spojením vrstvy" +"prototype actions of unknown types were skipped" = "akce prototypu neznámých typů byly přeskočeny" +"prototype actions without a destination in the file were skipped" = "akce prototypu bez cíle v souboru byly přeskočeny" +"prototype expressions on variables that aren't in the variables JSON were skipped" = "výrazy prototypu s proměnnými, které nejsou v JSON proměnných, byly přeskočeny" +"prototype expressions with unsupported functions were skipped" = "výrazy prototypu s nepodporovanými funkcemi byly přeskočeny" +"prototype interactions without supported actions were skipped" = "interakce prototypu bez podporovaných akcí byly přeskočeny" +"prototype navigations of unknown types were skipped" = "navigace prototypu neznámých typů byly přeskočeny" +"prototype transitions of unknown types play instantly" = "přechody prototypu neznámých typů proběhnou okamžitě" +"prototype triggers of unknown types were skipped" = "spouštěče prototypu neznámých typů byly přeskočeny" "put a widget on the canvas" = "umístit widget na plátno" "read and edit the document" = "číst a upravovat dokument" "read the document" = "číst dokument" "reads the document" = "čte dokument" +"set-variable actions on variables that aren't in the variables JSON were skipped" = "akce nastavení proměnné u proměnných, které nejsou v JSON proměnných, byly přeskočeny" +"set-variable actions with values that can't be evaluated were skipped" = "akce nastavení proměnné s hodnotami, které nelze vyhodnotit, byly přeskočeny" +"set-variable actions with values that don't fit the variable were skipped" = "akce nastavení proměnné s hodnotami, které neodpovídají proměnné, byly přeskočeny" +"set-variable actions without a value were skipped" = "akce nastavení proměnné bez hodnoty byly přeskočeny" +"set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "akce nastavení režimu proměnných u kolekcí nebo režimů, které nejsou v JSON proměnných, byly přeskočeny" +"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "některé vektorové body odkazují na nastavení bodů, která v souboru chybí; používají spojení vrstvy a nezaoblené rohy" +"stars and polygons without point counts or geometry use the default point count" = "hvězdy a mnohoúhelníky bez počtu bodů nebo geometrie používají výchozí počet bodů" +"text style overrides refer to missing table entries" = "přepsání textových stylů odkazují na chybějící položky tabulky" +"the file has no pages" = "soubor nemá žádné stránky" "the plugin" = "plugin" +"the variables JSON has no `variableCollections` (expected the local variables response) and was ignored" = "JSON proměnných nemá `variableCollections` (očekávala se odpověď s místními proměnnými) a byl ignorován" "this session only" = "pouze v této relaci" +"unknown component property types were skipped" = "neznámé typy vlastností komponent byly přeskočeny" +"variable aliases to variables that aren't in the variables JSON (or of another type) were skipped" = "aliasy na proměnné, které nejsou v JSON proměnných (nebo jsou jiného typu), byly přeskočeny" +"variable bindings to properties the layer doesn't have were skipped" = "vazby proměnných na vlastnosti, které vrstva nemá, byly přeskočeny" +"variable bindings to variables that aren't in the variables JSON (library variables) were skipped" = "vazby na proměnné, které nejsou v JSON proměnných (proměnné knihovny), byly přeskočeny" +"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)" = "vazby proměnných byly přeskočeny: JSON souboru nemá definice proměnných (předejte JSON místních proměnných jako `variables` nebo vložte jeho `meta` vedle JSON souboru)" +"variable bindings whose variable type doesn't fit the property were skipped" = "vazby proměnných, jejichž typ neodpovídá vlastnosti, byly přeskočeny" +"variable collections without modes were skipped" = "kolekce proměnných bez režimů byly přeskočeny" +"variable mode lookups in prototype expressions that aren't a variable and one of its modes were skipped" = "vyhledání režimu proměnné ve výrazech prototypu, které nejsou proměnnou a jedním z jejích režimů, byla přeskočena" +"variable modes of collections that aren't in the file were skipped" = "režimy proměnných kolekcí, které nejsou v souboru, byly přeskočeny" +"variable modes of collections that aren't in the variables JSON were skipped" = "režimy proměnných kolekcí, které nejsou v JSON proměnných, byly přeskočeny" +"variable values that don't match their type (or composed colours) were skipped" = "hodnoty proměnných, které neodpovídají svému typu (nebo složené barvy), byly přeskočeny" +"variables of unknown types were skipped" = "proměnné neznámých typů byly přeskočeny" +"variables whose collection isn't in the variables JSON were skipped" = "proměnné, jejichž kolekce není v JSON proměnných, byly přeskočeny" +"variables without readable values were skipped" = "proměnné bez čitelných hodnot byly přeskočeny" +"vector points with unknown stroke joins use the layer join" = "vektorové body s neznámým spojením tahu používají spojení vrstvy" +"vectors without geometry are empty" = "vektory bez geometrie jsou prázdné" +"vectors without geometry are empty (export the file JSON with geometry=paths)" = "vektory bez geometrie jsou prázdné (exportujte JSON souboru s geometry=paths)" +"very long text was cut to 1,048,576 characters" = "velmi dlouhý text byl zkrácen na 1 048 576 znaků" +"very long vector paths were skipped" = "velmi dlouhé vektorové cesty byly přeskočeny" +"video actions are not supported and were skipped" = "akce videa nejsou podporovány a byly přeskočeny" +"video triggers are not supported and were skipped" = "spouštěče videa nejsou podporovány a byly přeskočeny" "yesterday" = "včera" "{instances} in {files}" = "{instances} · {files}" "{language}: draft translation, waiting for a native speaker's review." = "{language}: návrh překladu, čeká na kontrolu rodilým mluvčím." @@ -1549,6 +1622,7 @@ status = "draft — needs native review" "{n} matches" = { one = "{n} shoda", few = "{n} shody", other = "{n} shod" } "{n} minutes ago" = { one = "Před {n} minutou", few = "Před {n} minutami", other = "Před {n} minutami" } "{n} months ago" = { one = "Před {n} měsícem", few = "Před {n} měsíci", other = "Před {n} měsíci" } +"{n} more notes omitted from this report" = { one = "{n} další poznámka v této zprávě vynechána", few = "{n} další poznámky v této zprávě vynechány", other = "{n} dalších poznámek v této zprávě vynecháno" } "{n} of {total}" = "{n} z {total}" "{n} people joined" = { one = "Připojila se {n} osoba", few = "Připojily se {n} osoby", other = "Připojilo se {n} osob" } "{n} preferred components" = { one = "{n} preferovaná komponenta", few = "{n} preferované komponenty", other = "{n} preferovaných komponent" } diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index 520d4ba6c..4a28a7fcb 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -1481,7 +1481,7 @@ status = "draft — needs native review" "nobody else here yet" = "noch niemand sonst hier" "now" = "jetzt" "or" = "oder" -"points with their own stroke join use the layer's" = "Punkte mit eigener Konturecke verwenden die der Ebene" +"point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "die Konturecken der Punkte wurden übernommen; gestrichelte Konturen und Konturen mit variabler Breite werden mit der Ecke der Ebene gezeichnet" "prototype actions of unknown types were skipped" = "Prototyp-Aktionen unbekannter Art wurden übersprungen" "prototype actions without a destination in the file were skipped" = "Prototyp-Aktionen ohne Ziel in der Datei wurden übersprungen" "prototype expressions on variables that aren't in the variables JSON were skipped" = "Prototyp-Ausdrücke mit Variablen, die nicht im Variablen-JSON sind, wurden übersprungen" @@ -1499,10 +1499,8 @@ status = "draft — needs native review" "set-variable actions with values that don't fit the variable were skipped" = "Aktionen „Variable festlegen“ mit Werten, die nicht zur Variable passen, wurden übersprungen" "set-variable actions without a value were skipped" = "Aktionen „Variable festlegen“ ohne Wert wurden übersprungen" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "Aktionen „Variablenmodus festlegen“ für Sammlungen oder Modi, die nicht im Variablen-JSON sind, wurden übersprungen" -"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "einige Vektorpunkte verweisen auf Punkteinstellungen, die in der Datei fehlen; sie verwenden die Konturecken der Ebene und einfache Ecken" -"some vector segments refer to style settings missing from the file; they use the layer's stroke" = "einige Vektorsegmente verweisen auf Stileinstellungen, die in der Datei fehlen; sie verwenden die Kontur der Ebene" +"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "einige Vektorpunkte verweisen auf Punkteinstellungen, die in der Datei fehlen; sie übernehmen die Ecken der Ebenenkontur und bleiben ungerundet" "stars and polygons without point counts or geometry use the default point count" = "Sterne und Polygone ohne Punktanzahl oder Geometrie verwenden die Standard-Punktanzahl" -"style settings of some vector segments aren't supported; those segments use the layer's stroke" = "Stileinstellungen einiger Vektorsegmente werden nicht unterstützt; diese Segmente verwenden die Kontur der Ebene" "text style overrides refer to missing table entries" = "Textstil-Überschreibungen verweisen auf fehlende Tabelleneinträge" "the file has no pages" = "die Datei hat keine Seiten" "the plugin" = "das Plugin" @@ -1522,6 +1520,7 @@ status = "draft — needs native review" "variables of unknown types were skipped" = "Variablen unbekannter Typen wurden übersprungen" "variables whose collection isn't in the variables JSON were skipped" = "Variablen, deren Sammlung nicht im Variablen-JSON ist, wurden übersprungen" "variables without readable values were skipped" = "Variablen ohne lesbare Werte wurden übersprungen" +"vector points with unknown stroke joins use the layer join" = "Vektorpunkte mit unbekannten Konturecken verwenden die Ecke der Ebene" "vectors without geometry are empty" = "Vektoren ohne Geometrie sind leer" "vectors without geometry are empty (export the file JSON with geometry=paths)" = "Vektoren ohne Geometrie sind leer (exportieren Sie das Datei-JSON mit geometry=paths)" "very long text was cut to 1,048,576 characters" = "sehr langer Text wurde auf 1.048.576 Zeichen gekürzt" diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 50045c1e1..de22405d7 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -1555,7 +1555,7 @@ name = "English" "nobody else here yet" = "nobody else here yet" "now" = "now" "or" = "or" -"points with their own stroke join use the layer's" = "points with their own stroke join use the layer's" +"point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "point stroke joins were preserved; dashed or variable-width strokes render with the layer join" "prototype actions of unknown types were skipped" = "prototype actions of unknown types were skipped" "prototype actions without a destination in the file 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" = "prototype expressions on variables that aren't in the variables JSON were skipped" @@ -1574,9 +1574,7 @@ name = "English" "set-variable actions without a value 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" = "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" "some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "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" = "some vector segments refer to style settings missing from the file; they use the layer's stroke" "stars and polygons without point counts or geometry use the default point count" = "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" = "style settings of some vector segments aren't supported; those segments use the layer's stroke" "text style overrides refer to missing table entries" = "text style overrides refer to missing table entries" "the file has no pages" = "the file has no pages" "the plugin" = "the plugin" @@ -1596,6 +1594,7 @@ name = "English" "variables of unknown types were skipped" = "variables of unknown types were skipped" "variables whose collection isn't in the variables JSON were skipped" = "variables whose collection isn't in the variables JSON were skipped" "variables without readable values were skipped" = "variables without readable values were skipped" +"vector points with unknown stroke joins use the layer join" = "vector points with unknown stroke joins use the layer join" "vectors without geometry are empty" = "vectors without geometry are empty" "vectors without geometry are empty (export the file JSON with geometry=paths)" = "vectors without geometry are empty (export the file JSON with geometry=paths)" "very long text was cut to 1,048,576 characters" = "very long text was cut to 1,048,576 characters" diff --git a/crates/ui-egui/locales/es-419.toml b/crates/ui-egui/locales/es-419.toml index 6b42ac209..74ce97a82 100644 --- a/crates/ui-egui/locales/es-419.toml +++ b/crates/ui-egui/locales/es-419.toml @@ -66,6 +66,7 @@ status = "draft — needs native review" "No components yet. Select layers and press {keys}." = "Aún no hay componentes. Selecciona capas y presiona {keys}." "No libraries yet. Add a .figcraft file that was published as a library, or paste a team library's link." = "Aún no hay bibliotecas. Agrega un archivo .figcraft publicado como biblioteca o pega el enlace de una biblioteca de equipo." "PDF print settings" = "Configuración de impresión PDF" +"Pages added to the document" = "Páginas agregadas al documento" "Press a key…" = "Presiona una tecla…" "Prototype settings" = "Configuración del prototipo" "Remove export setting" = "Quitar configuración de exportación" @@ -80,6 +81,8 @@ status = "draft — needs native review" "Type settings" = "Configuración de texto" "With the layers' export settings" = "Con la configuración de exportación de las capas" "You'll get the shared file as a new tab and edit it together." = "Recibirás el archivo compartido en una pestaña nueva y lo editarán en conjunto." +"gamepad triggers without exactly one known controller button were skipped" = "se omitieron los desencadenantes de control sin exactamente un botón de control conocido" +"key up triggers import as key presses" = "los desencadenantes al soltar una tecla se importan como presiones de tecla" "{name} is forgotten on this computer; the file stays on {server}" = "{name} se olvidó en esta computadora; el archivo se queda en {server}" "{n} added" = { one = "{n} agregada", other = "{n} agregadas" } diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 8abaa332f..3f08968bc 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -1556,7 +1556,7 @@ status = "draft — needs native review" "nobody else here yet" = "aún no hay nadie más" "now" = "ahora" "or" = "o" -"points with their own stroke join use the layer's" = "los puntos con su propia unión de trazo usan la de la capa" +"point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "se conservaron las uniones de trazo de los puntos; los trazos discontinuos o de ancho variable se dibujan con la unión de la capa" "prototype actions of unknown types were skipped" = "se omitieron las acciones de prototipo de tipos desconocidos" "prototype actions without a destination in the file were skipped" = "se omitieron las acciones de prototipo sin destino en el archivo" "prototype expressions on variables that aren't in the variables JSON were skipped" = "se omitieron las expresiones de prototipo con variables que no están en el JSON de variables" @@ -1575,9 +1575,7 @@ status = "draft — needs native review" "set-variable actions without a value were skipped" = "se omitieron las acciones «Establecer variable» sin valor" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "se omitieron las acciones «Establecer modo de variable» sobre colecciones o modos que no están en el JSON de variables" "some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "algunos puntos vectoriales hacen referencia a ajustes de punto que faltan en el archivo; usan las uniones de la capa y esquinas simples" -"some vector segments refer to style settings missing from the file; they use the layer's stroke" = "algunos segmentos vectoriales hacen referencia a ajustes de estilo que faltan en el archivo; usan el trazo de la capa" "stars and polygons without point counts or geometry use the default point count" = "las estrellas y los polígonos sin número de puntos ni geometría usan el número de puntos predeterminado" -"style settings of some vector segments aren't supported; those segments use the layer's stroke" = "los ajustes de estilo de algunos segmentos vectoriales no son compatibles; esos segmentos usan el trazo de la capa" "text style overrides refer to missing table entries" = "las anulaciones de estilo de texto hacen referencia a entradas de tabla que faltan" "the file has no pages" = "el archivo no tiene páginas" "the plugin" = "el plugin" @@ -1597,6 +1595,7 @@ status = "draft — needs native review" "variables of unknown types were skipped" = "se omitieron las variables de tipos desconocidos" "variables whose collection isn't in the variables JSON were skipped" = "se omitieron las variables cuya colección no está en el JSON de variables" "variables without readable values were skipped" = "se omitieron las variables sin valores legibles" +"vector points with unknown stroke joins use the layer join" = "los puntos vectoriales con uniones de trazo desconocidas usan la unión de la capa" "vectors without geometry are empty" = "los vectores sin geometría están vacíos" "vectors without geometry are empty (export the file JSON with geometry=paths)" = "los vectores sin geometría están vacíos (exporta el JSON del archivo con geometry=paths)" "very long text was cut to 1,048,576 characters" = "el texto muy largo se recortó a 1.048.576 caracteres" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 7fafd3c91..e19617110 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -260,6 +260,7 @@ status = "draft — needs native review" "Commits" = "Commits" "Company" = "Entreprise" "Compare changes" = "Comparer les modifications" +"Compatibility notes" = "Notes de compatibilité" "Completed" = "Terminé" "Component" = "Composant" "Component name" = "Nom du composant" @@ -460,6 +461,7 @@ status = "draft — needs native review" "False" = "Faux" "Fetching from the server…" = "Récupération depuis le serveur…" "FigCraft couldn't open its window: {error}" = "FigCraft n’a pas pu ouvrir sa fenêtre : {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 ne prend pas encore en charge toutes les fonctionnalités de ces fichiers. Les notes indiquent ce qui a été omis ou modifié dans la copie importée ; le fichier d’origine reste inchangé." "File" = "Fichier" "File name" = "Nom du fichier" "File published" = "Fichier publié" @@ -576,11 +578,14 @@ status = "draft — needs native review" "If {condition}" = "Si {condition}" "Ignore auto layout (absolute position)" = "Ignorer la mise en page auto (position absolue)" "Image" = "Image" +"Images" = "Images" "Import" = "Importer" "Import path" = "Chemin d’importation" "Import plugin from manifest" = "Importer un plugin depuis un manifeste" "Import plugin from manifest…" = "Importer un plugin depuis un manifeste…" +"Import report" = "Rapport d’importation" "Import variables" = "Importer des variables" +"Imported document" = "Document importé" "Imported {name}" = "{name} importé" "Imported {n} new variables, updated {updated}" = { one = "{n} nouvelle variable importée, {updated} mises à jour", other = "{n} nouvelles variables importées, {updated} mises à jour" } "Import…" = "Importer…" @@ -770,6 +775,7 @@ status = "draft — needs native review" "No colour variables fit here." = "Aucune variable de couleur ne convient ici." "No colour variables yet. Create them in Local variables." = "Aucune variable de couleur pour l’instant. Créez-en dans Variables locales." "No comments yet" = "Aucun commentaire pour l’instant" +"No compatibility warnings reported" = "Aucun avertissement de compatibilité signalé" "No components yet. Select layers and press {keys}." = "Aucun composant pour l’instant. Sélectionnez des calques et appuyez sur {keys}." "No conflicts." = "Aucun conflit." "No contributor data was built into this copy." = "Cette copie ne contient aucune donnée de contributeurs." @@ -856,6 +862,7 @@ status = "draft — needs native review" "Open overlay" = "Ouvrir une superposition" "Open prototype preview" = "Ouvrir l’aperçu du prototype" "Open variables ({count})" = "Ouvrir les variables ({count})" +"Opened as a new document" = "Ouvert comme nouveau document" "Opened “{name}” in a new tab" = "« {name} » ouvert dans un nouvel onglet" "Open|comments" = "Ouverts" "Options" = "Options" @@ -879,6 +886,8 @@ status = "draft — needs native review" "Padding" = "Marge intérieure" "Page" = "Page" "Pages" = "Pages" +"Pages added to the document" = "Pages ajoutées au document" +"Placed on the current page" = "Placé sur la page actuelle" "Pages: {pages}" = "Pages : {pages}" "Paint bucket" = "Pot de peinture" "Pan the canvas" = "Faire défiler le canevas" @@ -1426,25 +1435,89 @@ status = "draft — needs native review" "call any command its access allows" = "appeler toute commande que son accès autorise" "call only: {commands}" = "appeler seulement : {commands}" "can edit the document" = "peut modifier le document" +"conditional prototype actions nested too deeply were skipped" = "les actions de prototype conditionnelles trop profondément imbriquées ont été ignorées" +"conditional prototype actions with conditions that can't be evaluated were skipped" = "les actions de prototype conditionnelles dont les conditions ne peuvent pas être évaluées ont été ignorées" +"connector labels were skipped" = "les libellés des connecteurs ont été ignorés" +"connectors whose ends can't be placed are empty" = "les connecteurs dont les extrémités ne peuvent pas être placées sont vides" "crop marks" = "traits de coupe" +"damaged vector geometry was skipped" = "la géométrie vectorielle endommagée a été ignorée" +"damaged vector networks import as outlines" = "les réseaux vectoriels endommagés sont importés comme tracés" "development: {path}" = "développement : {path}" +"document children other than pages were skipped" = "les enfants du document autres que des pages ont été ignorés" "e.g. count + 1" = "p. ex. count + 1" "e.g. count >= 3 and not done" = "p. ex. count >= 3 and not done" +"elbowed and curved connectors without a saved path import as straight lines" = "les connecteurs coudés et courbes sans tracé enregistré sont importés comme des lignes droites" +"entries without a node type were skipped" = "les entrées sans type de nœud ont été ignorées" "figcraft:// links from a browser, chat or email open this app and join the session." = "Les liens figcraft:// d’un navigateur, d’une messagerie ou d’un e-mail ouvrent cette application et rejoignent la session." +"filled areas of a vector with their own fill use the layer's fill" = "les zones remplies d’un vecteur avec leur propre remplissage utilisent le remplissage du calque" "from {server}" = "depuis {server}" +"gamepad triggers without exactly one known controller button were skipped" = "les déclencheurs de manette sans exactement un bouton de manette connu ont été ignorés" +"grid tracks of fixed or content size import as equal tracks" = "les pistes de grille de taille fixe ou ajustée au contenu sont importées comme des pistes égales" "hidden" = "masqué" "iOS" = "iOS" +"instance swap properties whose default component isn't in the file were skipped" = "les propriétés de permutation d’instance dont le composant par défaut n’est pas dans le fichier ont été ignorées" +"instances inside their own main component were imported as frames" = "les instances placées dans leur propre composant principal ont été importées comme cadres" +"instances of components that aren't in the file show no layers" = "les instances de composants absents du fichier n’affichent aucun calque" +"instances of components that aren't in the file were imported as frames" = "les instances de composants absents du fichier ont été importées comme cadres" +"instances that would nest a component inside itself were imported as frames" = "les instances qui imbriqueraient un composant dans lui-même ont été importées comme cadres" +"instances without a main component were imported as empty frames" = "les instances sans composant principal ont été importées comme cadres vides" +"invalid or oversized vector networks import as outlines" = "les réseaux vectoriels non valides ou trop grands sont importés comme tracés" +"invalid or oversized vector path data was skipped" = "les données de tracé vectoriel non valides ou trop grandes ont été ignorées" +"key triggers without a supported key were skipped" = "les déclencheurs de touche sans touche prise en charge ont été ignorés" +"key up triggers import as key presses" = "les déclencheurs au relâchement d’une touche sont importés comme des appuis sur la touche" +"layers without a position were placed at their parent's origin" = "les calques sans position ont été placés à l’origine de leur parent" +"layers without a type were skipped" = "les calques sans type ont été ignorés" "locked" = "verrouillé" "no bleed" = "sans fond perdu" "nobody else here yet" = "personne d’autre pour l’instant" "now" = "maintenant" "or" = "ou" +"point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "les jointures des points ont été conservées ; les contours en pointillés ou à largeur variable sont dessinés avec la jointure du calque" +"prototype actions of unknown types were skipped" = "les actions de prototype de types inconnus ont été ignorées" +"prototype actions without a destination in the file were skipped" = "les actions de prototype sans destination dans le fichier ont été ignorées" +"prototype expressions on variables that aren't in the variables JSON were skipped" = "les expressions de prototype portant sur des variables absentes du JSON des variables ont été ignorées" +"prototype expressions with unsupported functions were skipped" = "les expressions de prototype utilisant des fonctions non prises en charge ont été ignorées" +"prototype interactions without supported actions were skipped" = "les interactions de prototype sans action prise en charge ont été ignorées" +"prototype navigations of unknown types were skipped" = "les navigations de prototype de types inconnus ont été ignorées" +"prototype transitions of unknown types play instantly" = "les transitions de prototype de types inconnus sont instantanées" +"prototype triggers of unknown types were skipped" = "les déclencheurs de prototype de types inconnus ont été ignorés" "put a widget on the canvas" = "placer un widget sur le canevas" "read and edit the document" = "lire et modifier le document" "read the document" = "lire le document" "reads the document" = "lit le document" +"set-variable actions on variables that aren't in the variables JSON were skipped" = "les actions de définition de variable portant sur des variables absentes du JSON des variables ont été ignorées" +"set-variable actions with values that can't be evaluated were skipped" = "les actions de définition de variable dont les valeurs ne peuvent pas être évaluées ont été ignorées" +"set-variable actions with values that don't fit the variable were skipped" = "les actions de définition de variable dont les valeurs ne correspondent pas à la variable ont été ignorées" +"set-variable actions without a value were skipped" = "les actions de définition de variable sans valeur ont été ignorées" +"set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "les actions de définition du mode de variable portant sur des collections ou des modes absents du JSON des variables ont été ignorées" +"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "certains points vectoriels renvoient à des réglages de point absents du fichier ; ils utilisent les jointures du calque et des angles simples" +"stars and polygons without point counts or geometry use the default point count" = "les étoiles et polygones sans nombre de pointes ni géométrie utilisent le nombre de pointes par défaut" +"text style overrides refer to missing table entries" = "les remplacements de style de texte renvoient à des entrées de table manquantes" +"the file has no pages" = "le fichier n’a aucune page" "the plugin" = "le plugin" +"the variables JSON has no `variableCollections` (expected the local variables response) and was ignored" = "le JSON des variables n’a pas de `variableCollections` (la réponse des variables locales était attendue) et a été ignoré" "this session only" = "cette session uniquement" +"unknown component property types were skipped" = "les types de propriété de composant inconnus ont été ignorés" +"variable aliases to variables that aren't in the variables JSON (or of another type) were skipped" = "les alias vers des variables absentes du JSON des variables (ou d’un autre type) ont été ignorés" +"variable bindings to properties the layer doesn't have were skipped" = "les liaisons de variables à des propriétés que le calque n’a pas ont été ignorées" +"variable bindings to variables that aren't in the variables JSON (library variables) were skipped" = "les liaisons à des variables absentes du JSON des variables (variables de bibliothèque) ont été ignorées" +"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)" = "les liaisons de variables ont été ignorées : le JSON du fichier n’a aucune définition de variable (transmettez le JSON des variables locales comme `variables`, ou intégrez son `meta` à côté du JSON du fichier)" +"variable bindings whose variable type doesn't fit the property were skipped" = "les liaisons de variables dont le type de variable ne convient pas à la propriété ont été ignorées" +"variable collections without modes were skipped" = "les collections de variables sans mode ont été ignorées" +"variable mode lookups in prototype expressions that aren't a variable and one of its modes were skipped" = "les recherches de mode de variable dans les expressions de prototype qui ne sont pas une variable et l’un de ses modes ont été ignorées" +"variable modes of collections that aren't in the file were skipped" = "les modes de variables de collections absentes du fichier ont été ignorés" +"variable modes of collections that aren't in the variables JSON were skipped" = "les modes de variables de collections absentes du JSON des variables ont été ignorés" +"variable values that don't match their type (or composed colours) were skipped" = "les valeurs de variables qui ne correspondent pas à leur type (ou les couleurs composées) ont été ignorées" +"variables of unknown types were skipped" = "les variables de types inconnus ont été ignorées" +"variables whose collection isn't in the variables JSON were skipped" = "les variables dont la collection est absente du JSON des variables ont été ignorées" +"variables without readable values were skipped" = "les variables sans valeurs lisibles ont été ignorées" +"vector points with unknown stroke joins use the layer join" = "les points vectoriels aux jointures inconnues utilisent la jointure du calque" +"vectors without geometry are empty" = "les vecteurs sans géométrie sont vides" +"vectors without geometry are empty (export the file JSON with geometry=paths)" = "les vecteurs sans géométrie sont vides (exportez le JSON du fichier avec geometry=paths)" +"very long text was cut to 1,048,576 characters" = "le texte très long a été coupé à 1 048 576 caractères" +"very long vector paths were skipped" = "les tracés vectoriels très longs ont été ignorés" +"video actions are not supported and were skipped" = "les actions vidéo ne sont pas prises en charge et ont été ignorées" +"video triggers are not supported and were skipped" = "les déclencheurs vidéo ne sont pas pris en charge et ont été ignorés" "{instances} in {files}" = "{instances} dans {files}" "{language}: draft translation, waiting for a native speaker's review." = "{language} : traduction provisoire, en attente de relecture par un locuteur natif." "{length} bleed" = "fond perdu de {length}" @@ -1487,6 +1560,7 @@ status = "draft — needs native review" "{n} matches" = { one = "{n} résultat", other = "{n} résultats" } "{n} minutes ago" = { one = "il y a {n} minute", other = "il y a {n} minutes" } "{n} months ago" = { one = "il y a {n} mois", other = "il y a {n} mois" } +"{n} more notes omitted from this report" = { one = "{n} autre note omise de ce rapport", other = "{n} autres notes omises de ce rapport" } "{n} of {total}" = "{n} sur {total}" "{n} people joined" = { one = "{n} personne a rejoint la session", other = "{n} personnes ont rejoint la session" } "{n} preferred components" = { one = "{n} composant préféré", other = "{n} composants préférés" } diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml index 5de7634d4..894755792 100644 --- a/crates/ui-egui/locales/id.toml +++ b/crates/ui-egui/locales/id.toml @@ -270,6 +270,7 @@ status = "draft — needs native review" "Commits" = "Commit" "Company" = "Perusahaan" "Compare changes" = "Bandingkan perubahan" +"Compatibility notes" = "Catatan kompatibilitas" "Completed" = "Selesai" "Component" = "Component" "Component name" = "Nama component" @@ -476,6 +477,7 @@ status = "draft — needs native review" "False" = "Salah" "Feb" = "Feb" "Fetching from the server…" = "Mengambil dari server…" +"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 belum mendukung semua fitur file ini. Catatan berisi apa yang dihilangkan atau diubah pada salinan yang diimpor; file aslinya tidak berubah." "File" = "File" "File name" = "Nama file" "File not found" = "File tidak ditemukan" @@ -599,11 +601,14 @@ status = "draft — needs native review" "If {condition}" = "Jika {condition}" "Ignore auto layout (absolute position)" = "Abaikan auto layout (posisi absolut)" "Image" = "Gambar" +"Images" = "Gambar" "Import" = "Impor" "Import path" = "Jalur impor" "Import plugin from manifest" = "Impor plugin dari manifest" "Import plugin from manifest…" = "Impor plugin dari manifest…" +"Import report" = "Laporan impor" "Import variables" = "Impor variabel" +"Imported document" = "Dokumen yang diimpor" "Imported {name}" = "{name} diimpor" "Imported {n} new variables, updated {updated}" = { other = "{n} variabel baru diimpor, {updated} diperbarui" } "Import…" = "Impor…" @@ -805,6 +810,7 @@ status = "draft — needs native review" "No colour variables fit here." = "Tidak ada variabel warna yang cocok di sini." "No colour variables yet. Create them in Local variables." = "Belum ada variabel warna. Buat di Variabel lokal." "No comments yet" = "Belum ada komentar" +"No compatibility warnings reported" = "Tidak ada peringatan kompatibilitas" "No components yet. Select layers and press {keys}." = "Belum ada component. Pilih layer lalu tekan {keys}." "No conflicts." = "Tidak ada konflik." "No contributor data was built into this copy." = "Tidak ada data kontributor yang disertakan dalam salinan ini." @@ -896,6 +902,7 @@ status = "draft — needs native review" "Open overlay" = "Buka overlay" "Open prototype preview" = "Buka pratinjau prototype" "Open variables ({count})" = "Buka variabel ({count})" +"Opened as a new document" = "Dibuka sebagai dokumen baru" "Opened “{name}” in a new tab" = "“{name}” dibuka di tab baru" "Open|comments" = "Terbuka" "Options" = "Opsi" @@ -920,6 +927,8 @@ status = "draft — needs native review" "Padding" = "Padding" "Page" = "Halaman" "Pages" = "Halaman" +"Pages added to the document" = "Halaman ditambahkan ke dokumen" +"Placed on the current page" = "Ditempatkan di halaman saat ini" "Pages: {pages}" = "Halaman: {pages}" "Paint bucket" = "Ember cat" "Pan the canvas" = "Geser kanvas" @@ -1489,26 +1498,90 @@ status = "draft — needs native review" "call any command its access allows" = "memanggil perintah apa pun yang diizinkan aksesnya" "call only: {commands}" = "hanya memanggil: {commands}" "can edit the document" = "dapat mengedit dokumen" +"conditional prototype actions nested too deeply were skipped" = "tindakan prototype kondisional yang bersarang terlalu dalam dilewati" +"conditional prototype actions with conditions that can't be evaluated were skipped" = "tindakan prototype kondisional dengan kondisi yang tidak dapat dievaluasi dilewati" +"connector labels were skipped" = "label konektor dilewati" +"connectors whose ends can't be placed are empty" = "konektor yang ujungnya tidak dapat ditempatkan kosong" "crop marks" = "tanda potong" +"damaged vector geometry was skipped" = "geometri vector yang rusak dilewati" +"damaged vector networks import as outlines" = "jaringan vector yang rusak diimpor sebagai outline" "development: {path}" = "pengembangan: {path}" +"document children other than pages were skipped" = "anak dokumen selain halaman dilewati" "e.g. count + 1" = "mis. count + 1" "e.g. count >= 3 and not done" = "mis. count >= 3 and not done" +"elbowed and curved connectors without a saved path import as straight lines" = "konektor siku dan lengkung tanpa jalur tersimpan diimpor sebagai garis lurus" +"entries without a node type were skipped" = "entri tanpa tipe node dilewati" "figcraft:// links from a browser, chat or email open this app and join the session." = "Link figcraft:// dari browser, chat, atau email membuka aplikasi ini dan bergabung ke sesi." +"filled areas of a vector with their own fill use the layer's fill" = "area terisi pada vector dengan isian sendiri memakai isian layer" "from {server}" = "dari {server}" +"gamepad triggers without exactly one known controller button were skipped" = "pemicu gamepad yang tidak memiliki tepat satu tombol kontroler yang dikenal dilewati" +"grid tracks of fixed or content size import as equal tracks" = "track grid berukuran tetap atau mengikuti konten diimpor sebagai track yang sama besar" "hidden" = "tersembunyi" "iOS" = "iOS" +"instance swap properties whose default component isn't in the file were skipped" = "properti tukar instance yang component bawaannya tidak ada di file dilewati" +"instances inside their own main component were imported as frames" = "instance di dalam main component-nya sendiri diimpor sebagai frame" +"instances of components that aren't in the file show no layers" = "instance dari component yang tidak ada di file tidak menampilkan layer" +"instances of components that aren't in the file were imported as frames" = "instance dari component yang tidak ada di file diimpor sebagai frame" +"instances that would nest a component inside itself were imported as frames" = "instance yang akan menyarangkan component di dalam dirinya sendiri diimpor sebagai frame" +"instances without a main component were imported as empty frames" = "instance tanpa main component diimpor sebagai frame kosong" +"invalid or oversized vector networks import as outlines" = "jaringan vector yang tidak valid atau terlalu besar diimpor sebagai outline" +"invalid or oversized vector path data was skipped" = "data jalur vector yang tidak valid atau terlalu besar dilewati" "just now" = "baru saja" +"key triggers without a supported key were skipped" = "pemicu tombol tanpa tombol yang didukung dilewati" +"key up triggers import as key presses" = "pemicu saat tombol dilepas diimpor sebagai penekanan tombol" +"layers without a position were placed at their parent's origin" = "layer tanpa posisi ditempatkan di titik asal induknya" +"layers without a type were skipped" = "layer tanpa tipe dilewati" "locked" = "terkunci" "no bleed" = "tanpa bleed" "nobody else here yet" = "belum ada orang lain di sini" "now" = "sekarang" "or" = "atau" +"point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "sambungan stroke per titik dipertahankan; stroke putus-putus atau berlebar variabel digambar dengan sambungan layer" +"prototype actions of unknown types were skipped" = "tindakan prototype dengan tipe yang tidak dikenal dilewati" +"prototype actions without a destination in the file were skipped" = "tindakan prototype tanpa tujuan di file dilewati" +"prototype expressions on variables that aren't in the variables JSON were skipped" = "ekspresi prototype pada variabel yang tidak ada di JSON variabel dilewati" +"prototype expressions with unsupported functions were skipped" = "ekspresi prototype dengan fungsi yang tidak didukung dilewati" +"prototype interactions without supported actions were skipped" = "interaksi prototype tanpa tindakan yang didukung dilewati" +"prototype navigations of unknown types were skipped" = "navigasi prototype dengan tipe yang tidak dikenal dilewati" +"prototype transitions of unknown types play instantly" = "transisi prototype dengan tipe yang tidak dikenal berjalan instan" +"prototype triggers of unknown types were skipped" = "pemicu prototype dengan tipe yang tidak dikenal dilewati" "put a widget on the canvas" = "menaruh widget di kanvas" "read and edit the document" = "membaca dan mengedit dokumen" "read the document" = "membaca dokumen" "reads the document" = "membaca dokumen" +"set-variable actions on variables that aren't in the variables JSON were skipped" = "tindakan atur variabel pada variabel yang tidak ada di JSON variabel dilewati" +"set-variable actions with values that can't be evaluated were skipped" = "tindakan atur variabel dengan nilai yang tidak dapat dievaluasi dilewati" +"set-variable actions with values that don't fit the variable were skipped" = "tindakan atur variabel dengan nilai yang tidak cocok dengan variabelnya dilewati" +"set-variable actions without a value were skipped" = "tindakan atur variabel tanpa nilai dilewati" +"set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "tindakan atur mode variabel pada koleksi atau mode yang tidak ada di JSON variabel dilewati" +"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "beberapa titik vector merujuk ke pengaturan titik yang tidak ada di file; titik tersebut memakai sambungan layer dan sudut biasa" +"stars and polygons without point counts or geometry use the default point count" = "bintang dan poligon tanpa jumlah titik atau geometri memakai jumlah titik bawaan" +"text style overrides refer to missing table entries" = "penimpaan gaya teks merujuk ke entri tabel yang tidak ada" +"the file has no pages" = "file tidak memiliki halaman" "the plugin" = "plugin" +"the variables JSON has no `variableCollections` (expected the local variables response) and was ignored" = "JSON variabel tidak memiliki `variableCollections` (yang diharapkan adalah respons variabel lokal) dan diabaikan" "this session only" = "hanya sesi ini" +"unknown component property types were skipped" = "tipe properti component yang tidak dikenal dilewati" +"variable aliases to variables that aren't in the variables JSON (or of another type) were skipped" = "alias ke variabel yang tidak ada di JSON variabel (atau bertipe lain) dilewati" +"variable bindings to properties the layer doesn't have were skipped" = "binding variabel ke properti yang tidak dimiliki layer dilewati" +"variable bindings to variables that aren't in the variables JSON (library variables) were skipped" = "binding ke variabel yang tidak ada di JSON variabel (variabel pustaka) dilewati" +"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)" = "binding variabel dilewati: JSON file tidak memiliki definisi variabel (berikan JSON variabel lokal sebagai `variables`, atau sematkan `meta`-nya di samping JSON file)" +"variable bindings whose variable type doesn't fit the property were skipped" = "binding variabel yang tipe variabelnya tidak cocok dengan properti dilewati" +"variable collections without modes were skipped" = "koleksi variabel tanpa mode dilewati" +"variable mode lookups in prototype expressions that aren't a variable and one of its modes were skipped" = "pencarian mode variabel dalam ekspresi prototype yang bukan berupa variabel dan salah satu modenya dilewati" +"variable modes of collections that aren't in the file were skipped" = "mode variabel dari koleksi yang tidak ada di file dilewati" +"variable modes of collections that aren't in the variables JSON were skipped" = "mode variabel dari koleksi yang tidak ada di JSON variabel dilewati" +"variable values that don't match their type (or composed colours) were skipped" = "nilai variabel yang tidak sesuai dengan tipenya (atau warna gabungan) dilewati" +"variables of unknown types were skipped" = "variabel dengan tipe yang tidak dikenal dilewati" +"variables whose collection isn't in the variables JSON were skipped" = "variabel yang koleksinya tidak ada di JSON variabel dilewati" +"variables without readable values were skipped" = "variabel tanpa nilai yang dapat dibaca dilewati" +"vector points with unknown stroke joins use the layer join" = "titik vector dengan sambungan stroke yang tidak dikenal memakai sambungan layer" +"vectors without geometry are empty" = "vector tanpa geometri kosong" +"vectors without geometry are empty (export the file JSON with geometry=paths)" = "vector tanpa geometri kosong (ekspor JSON file dengan geometry=paths)" +"very long text was cut to 1,048,576 characters" = "teks yang sangat panjang dipotong menjadi 1.048.576 karakter" +"very long vector paths were skipped" = "jalur vector yang sangat panjang dilewati" +"video actions are not supported and were skipped" = "tindakan video tidak didukung dan dilewati" +"video triggers are not supported and were skipped" = "pemicu video tidak didukung dan dilewati" "yesterday" = "kemarin" "{instances} in {files}" = "{instances} di {files}" "{language}: draft translation, waiting for a native speaker's review." = "{language}: terjemahan draf, menunggu tinjauan penutur asli." @@ -1553,6 +1626,7 @@ status = "draft — needs native review" "{n} matches" = { other = "{n} kecocokan" } "{n} minutes ago" = { other = "{n} menit lalu" } "{n} months ago" = { other = "{n} bulan lalu" } +"{n} more notes omitted from this report" = { other = "{n} catatan lainnya tidak dicantumkan dalam laporan ini" } "{n} of {total}" = "{n} dari {total}" "{n} people joined" = { other = "{n} orang bergabung" } "{n} preferred components" = { other = "{n} component pilihan" } diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index 4d4d6d340..c337eb386 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -272,6 +272,7 @@ status = "draft — needs native review" "Commits" = "コミット" "Company" = "会社" "Compare changes" = "変更を比較" +"Compatibility notes" = "互換性に関する注記" "Completed" = "完了" "Component" = "コンポーネント" "Component name" = "コンポーネント名" @@ -480,6 +481,7 @@ status = "draft — needs native review" "Feb" = "2月" "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 はこれらのファイルの機能をまだすべてサポートしていない。注記には、インポートしたコピーで省略または変更された内容を示す。元のファイルは変更されない。" "File" = "ファイル" "File name" = "ファイル名" "File not found" = "ファイルが見つからない" @@ -604,11 +606,14 @@ status = "draft — needs native review" "If {condition}" = "条件:{condition}" "Ignore auto layout (absolute position)" = "オートレイアウトを無視(絶対位置)" "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}" = { other = "新しい変数を {n} 個インポートし、{updated} 個を更新" } "Import…" = "インポート…" @@ -810,6 +815,7 @@ status = "draft — needs native review" "No colour variables fit here." = "ここに使えるカラー変数はない。" "No colour variables yet. Create them in Local variables." = "カラー変数はまだない。ローカル変数で作成。" "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." = "このコピーには貢献者データが含まれていない。" @@ -901,6 +907,7 @@ status = "draft — needs native review" "Open overlay" = "オーバーレイを開く" "Open prototype preview" = "プロトタイプのプレビューを開く" "Open variables ({count})" = "変数を開く({count})" +"Opened as a new document" = "新しいドキュメントとして開いた" "Opened “{name}” in a new tab" = "「{name}」を新しいタブで開いた" "Open|comments" = "未解決" "Options" = "オプション" @@ -925,6 +932,8 @@ status = "draft — needs native review" "Padding" = "パディング" "Page" = "ページ" "Pages" = "ページ" +"Pages added to the document" = "ページをドキュメントに追加した" +"Placed on the current page" = "現在のページに配置した" "Pages: {pages}" = "ページ:{pages}" "Paint bucket" = "塗りつぶし" "Pan the canvas" = "キャンバスをパン" @@ -1499,26 +1508,90 @@ status = "draft — needs native review" "call any command its access allows" = "アクセス権で許可された任意のコマンドの呼び出し" "call only: {commands}" = "次のコマンドのみの呼び出し:{commands}" "can edit the document" = "ドキュメントを編集できる" +"conditional prototype actions nested too deeply were skipped" = "入れ子が深すぎる条件付きプロトタイプアクションをスキップ" +"conditional prototype actions with conditions that can't be evaluated were skipped" = "評価できない条件を持つ条件付きプロトタイプアクションをスキップ" +"connector labels were skipped" = "コネクタのラベルをスキップ" +"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" = "ページ以外のドキュメントの子をスキップ" "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 import as straight lines" = "保存されたパスのない折れ線・曲線コネクタは直線としてインポート" +"entries without a node type were skipped" = "ノードタイプのない項目をスキップ" "figcraft:// links from a browser, chat or email open this app and join the session." = "ブラウザー、チャット、メールからの figcraft:// リンクでこのアプリが開き、セッションに参加する。" +"filled areas of a vector with their own fill use the layer's fill" = "独自の塗りを持つベクターの塗りつぶし領域にはレイヤーの塗りを使用" "from {server}" = "{server} から" +"gamepad triggers without exactly one known controller button were skipped" = "既知のコントローラーボタンがちょうど 1 つではないゲームパッドトリガーをスキップ" +"grid tracks of fixed or content size import as equal tracks" = "固定サイズまたはコンテンツサイズのグリッドトラックは均等なトラックとしてインポート" "hidden" = "非表示" "iOS" = "iOS" +"instance swap properties whose default component isn't in the file 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 without a main component were imported as empty frames" = "メインコンポーネントのないインスタンスは空のフレームとしてインポート" +"invalid or oversized vector networks import as outlines" = "無効または大きすぎるベクターネットワークはアウトラインとしてインポート" +"invalid or oversized vector path data was 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" = "タイプのないレイヤーをスキップ" "locked" = "ロック中" "no bleed" = "裁ち落としなし" "nobody else here yet" = "まだ他に誰もいない" "now" = "たった今" "or" = "または" +"point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "ポイントごとの角の形状は保持した。破線や可変幅の線はレイヤーの角の形状で描画" +"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" = "変数 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" = "変数 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" = "変数 JSON にないコレクションまたはモードに対する変数モード設定アクションをスキップ" +"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "一部のベクターポイントがファイルにないポイント設定を参照している。それらのポイントはレイヤーの角の形状と丸めのない角を使用" +"stars and polygons without point counts or geometry use the default point count" = "ポイント数もジオメトリもない星と多角形はデフォルトのポイント数を使用" +"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" = "変数 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" = "変数 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" = "変数 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 に変数の定義がない(ローカル変数 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" = "変数とそのモードの 1 つになっていない、プロトタイプの式内の変数モード参照をスキップ" +"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" = "型に合わない変数値(または合成カラー)をスキップ" +"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" = "不明な角の形状を持つベクターポイントはレイヤーの角の形状を使用" +"vectors without geometry are empty" = "ジオメトリのないベクターは空" +"vectors without geometry are empty (export the file JSON with geometry=paths)" = "ジオメトリのないベクターは空(geometry=paths を指定してファイル JSON を書き出す)" +"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" = "昨日" "{instances} in {files}" = "{files}内の{instances}" "{language}: draft translation, waiting for a native speaker's review." = "{language}:下書きの翻訳。ネイティブスピーカーによるレビュー待ち。" @@ -1563,6 +1636,7 @@ status = "draft — needs native review" "{n} matches" = { other = "{n} 件一致" } "{n} minutes ago" = { other = "{n} 分前" } "{n} months ago" = { other = "{n} か月前" } +"{n} more notes omitted from this report" = { other = "このレポートで省略した注記がさらに {n} 件" } "{n} of {total}" = "{n} / {total}" "{n} people joined" = { other = "{n} 人が参加済み" } "{n} preferred components" = { other = "優先コンポーネント {n} 個" } diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index ec732905c..58192efb9 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -261,6 +261,7 @@ status = "draft — needs native review" "Commits" = "커밋" "Company" = "회사" "Compare changes" = "변경 사항 비교" +"Compatibility notes" = "호환성 참고 사항" "Completed" = "완료됨" "Component" = "컴포넌트" "Component name" = "컴포넌트 이름" @@ -460,6 +461,7 @@ status = "draft — needs native review" "False" = "거짓" "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는 아직 이 파일의 모든 기능을 지원하지 않습니다. 참고 사항에는 가져온 사본에서 빠지거나 바뀐 내용이 나와 있으며, 원본 파일은 바뀌지 않습니다." "File" = "파일" "File name" = "파일 이름" "File published" = "파일 게시됨" @@ -576,11 +578,14 @@ status = "draft — needs native review" "If {condition}" = "조건: {condition}" "Ignore auto layout (absolute position)" = "자동 레이아웃 무시(절대 위치)" "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}" = { other = "새 변수 {n}개를 가져오고 {updated}개를 업데이트함" } "Import…" = "가져오기…" @@ -770,6 +775,7 @@ status = "draft — needs native review" "No colour variables fit here." = "여기에 맞는 색상 변수가 없음." "No colour variables yet. Create them in Local variables." = "아직 색상 변수가 없음. 로컬 변수에서 만드세요." "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." = "이 사본에는 기여자 데이터가 포함되지 않음." @@ -856,6 +862,7 @@ status = "draft — needs native review" "Open overlay" = "오버레이 열기" "Open prototype preview" = "프로토타입 미리 보기 열기" "Open variables ({count})" = "변수 열기({count})" +"Opened as a new document" = "새 문서로 열림" "Opened “{name}” in a new tab" = "\"{name}\"을(를) 새 탭에서 열었음" "Open|comments" = "미해결" "Options" = "옵션" @@ -879,6 +886,8 @@ status = "draft — needs native review" "Padding" = "패딩" "Page" = "페이지" "Pages" = "페이지" +"Pages added to the document" = "문서에 페이지 추가됨" +"Placed on the current page" = "현재 페이지에 배치됨" "Pages: {pages}" = "페이지: {pages}" "Paint bucket" = "페인트 통" "Pan the canvas" = "캔버스 이동" @@ -1426,25 +1435,89 @@ status = "draft — needs native review" "call any command its access allows" = "접근 권한이 허용하는 모든 명령 호출" "call only: {commands}" = "다음 명령만 호출: {commands}" "can edit the document" = "문서를 편집할 수 있음" +"conditional prototype actions nested too deeply were skipped" = "너무 깊게 중첩된 조건부 프로토타입 액션을 건너뜀" +"conditional prototype actions with conditions that can't be evaluated were skipped" = "평가할 수 없는 조건이 있는 조건부 프로토타입 액션을 건너뜀" +"connector labels were skipped" = "커넥터 레이블을 건너뜀" +"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" = "페이지가 아닌 문서 하위 항목을 건너뜀" "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 import as straight lines" = "저장된 경로가 없는 꺾인 커넥터와 곡선 커넥터는 직선으로 가져옴" +"entries without a node type were skipped" = "노드 유형이 없는 항목을 건너뜀" "figcraft:// links from a browser, chat or email open this app and join the session." = "브라우저, 채팅, 이메일의 figcraft:// 링크로 이 앱을 열고 세션에 참여함." +"filled areas of a vector with their own fill use the layer's fill" = "자체 채우기가 있는 벡터의 채워진 영역은 레이어의 채우기를 사용함" "from {server}" = "{server}에서" +"gamepad triggers without exactly one known controller button were skipped" = "알려진 컨트롤러 버튼이 정확히 하나가 아닌 게임패드 트리거를 건너뜀" +"grid tracks of fixed or content size import as equal tracks" = "고정 크기 또는 콘텐츠 크기의 그리드 트랙은 균등한 트랙으로 가져옴" "hidden" = "숨김" "iOS" = "iOS" +"instance swap properties whose default component isn't in the file 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 without a main component were imported as empty frames" = "메인 컴포넌트가 없는 인스턴스는 빈 프레임으로 가져옴" +"invalid or oversized vector networks import as outlines" = "잘못되었거나 너무 큰 벡터 네트워크는 윤곽선으로 가져옴" +"invalid or oversized vector path data was skipped" = "잘못되었거나 너무 큰 벡터 경로 데이터를 건너뜀" +"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" = "유형이 없는 레이어를 건너뜀" "locked" = "잠김" "no bleed" = "도련 없음" "nobody else here yet" = "아직 다른 사람이 없음" "now" = "방금" "or" = "또는" +"point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "점별 선 연결을 유지함. 파선이나 가변 너비 선은 레이어의 선 연결로 그려짐" +"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" = "변수 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" = "변수 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" = "변수 JSON에 없는 컬렉션이나 모드에 대한 변수 모드 설정 액션을 건너뜀" +"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "일부 벡터 점이 파일에 없는 점 설정을 참조함. 해당 점은 레이어의 선 연결과 둥글리지 않은 모서리를 사용함" +"stars and polygons without point counts or geometry use the default point count" = "점 개수나 지오메트리가 없는 별과 다각형은 기본 점 개수를 사용함" +"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" = "변수 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" = "변수 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" = "변수 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에 변수 정의가 없음(로컬 변수 JSON을 `variables`로 전달하거나 파일 JSON 옆에 해당 `meta`를 포함하세요)" +"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" = "변수 JSON에 없는 컬렉션의 변수 모드를 건너뜀" +"variable values that don't match their type (or composed colours) were skipped" = "유형과 맞지 않는 변수 값(또는 합성 색상)을 건너뜀" +"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" = "알 수 없는 선 연결이 있는 벡터 점은 레이어의 선 연결을 사용함" +"vectors without geometry are empty" = "지오메트리가 없는 벡터는 비어 있음" +"vectors without geometry are empty (export the file JSON with geometry=paths)" = "지오메트리가 없는 벡터는 비어 있음(geometry=paths로 파일 JSON을 내보내세요)" +"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" = "비디오 트리거는 지원되지 않아 건너뜀" "{instances} in {files}" = "{files}의 {instances}" "{language}: draft translation, waiting for a native speaker's review." = "{language}: 초안 번역, 원어민 검토 대기 중." "{length} bleed" = "도련 {length}" @@ -1487,6 +1560,7 @@ status = "draft — needs native review" "{n} matches" = { other = "{n}개 일치" } "{n} minutes ago" = { other = "{n}분 전" } "{n} months ago" = { other = "{n}개월 전" } +"{n} more notes omitted from this report" = { other = "참고 사항 {n}개가 이 보고서에서 더 생략됨" } "{n} of {total}" = "{n} / {total}" "{n} people joined" = { other = "{n}명 참여함" } "{n} preferred components" = { other = "선호 컴포넌트 {n}개" } diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index c2189de81..a6f53dc8c 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -259,6 +259,7 @@ status = "draft — needs native review" "Commits" = "Commits" "Company" = "Empresa" "Compare changes" = "Comparar alterações" +"Compatibility notes" = "Notas de compatibilidade" "Completed" = "Concluído" "Component" = "Componente" "Component name" = "Nome do componente" @@ -459,6 +460,7 @@ status = "draft — needs native review" "False" = "Falso" "Fetching from the server…" = "Buscando no servidor…" "FigCraft couldn't open its window: {error}" = "O FigCraft não conseguiu abrir a janela: {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." = "O FigCraft ainda não oferece suporte a todos os recursos desses arquivos. As notas listam o que foi omitido ou alterado na cópia importada; o arquivo original não é alterado." "File" = "Arquivo" "File name" = "Nome do arquivo" "File published" = "Arquivo publicado" @@ -575,11 +577,14 @@ status = "draft — needs native review" "If {condition}" = "Se {condition}" "Ignore auto layout (absolute position)" = "Ignorar layout automático (posição absoluta)" "Image" = "Imagem" +"Images" = "Imagens" "Import" = "Importar" "Import path" = "Caminho de importação" "Import plugin from manifest" = "Importar plugin a partir do manifesto" "Import plugin from manifest…" = "Importar plugin a partir do manifesto…" +"Import report" = "Relatório de importação" "Import variables" = "Importar variáveis" +"Imported document" = "Documento importado" "Imported {name}" = "{name} importado" "Imported {n} new variables, updated {updated}" = { one = "{n} variável nova importada, {updated} atualizadas", other = "{n} variáveis novas importadas, {updated} atualizadas" } "Import…" = "Importar…" @@ -769,6 +774,7 @@ status = "draft — needs native review" "No colour variables fit here." = "Nenhuma variável de cor se encaixa aqui." "No colour variables yet. Create them in Local variables." = "Ainda não há variáveis de cor. Crie-as em Variáveis locais." "No comments yet" = "Ainda não há comentários" +"No compatibility warnings reported" = "Nenhum aviso de compatibilidade relatado" "No components yet. Select layers and press {keys}." = "Ainda não há componentes. Selecione camadas e pressione {keys}." "No conflicts." = "Nenhum conflito." "No contributor data was built into this copy." = "Esta cópia não inclui dados de colaboradores." @@ -855,6 +861,7 @@ status = "draft — needs native review" "Open overlay" = "Abrir sobreposição" "Open prototype preview" = "Abrir visualização do protótipo" "Open variables ({count})" = "Abrir variáveis ({count})" +"Opened as a new document" = "Aberto como novo documento" "Opened “{name}” in a new tab" = "“{name}” aberto em uma nova aba" "Open|comments" = "Abertos" "Options" = "Opções" @@ -878,6 +885,8 @@ status = "draft — needs native review" "Padding" = "Espaçamento interno" "Page" = "Página" "Pages" = "Páginas" +"Pages added to the document" = "Páginas adicionadas ao documento" +"Placed on the current page" = "Colocado na página atual" "Pages: {pages}" = "Páginas: {pages}" "Paint bucket" = "Balde de tinta" "Pan the canvas" = "Mover a tela" @@ -1425,25 +1434,89 @@ status = "draft — needs native review" "call any command its access allows" = "chamar qualquer comando que seu acesso permita" "call only: {commands}" = "chamar apenas: {commands}" "can edit the document" = "pode editar o documento" +"conditional prototype actions nested too deeply were skipped" = "ações condicionais de protótipo aninhadas profundamente demais foram ignoradas" +"conditional prototype actions with conditions that can't be evaluated were skipped" = "ações condicionais de protótipo com condições que não podem ser avaliadas foram ignoradas" +"connector labels were skipped" = "rótulos de conectores foram ignorados" +"connectors whose ends can't be placed are empty" = "conectores cujas pontas não podem ser posicionadas ficam vazios" "crop marks" = "marcas de corte" +"damaged vector geometry was skipped" = "geometria vetorial danificada foi ignorada" +"damaged vector networks import as outlines" = "redes vetoriais danificadas são importadas como contornos" "development: {path}" = "desenvolvimento: {path}" +"document children other than pages were skipped" = "filhos do documento que não são páginas foram ignorados" "e.g. count + 1" = "por ex. count + 1" "e.g. count >= 3 and not done" = "por ex. count >= 3 and not done" +"elbowed and curved connectors without a saved path import as straight lines" = "conectores angulares e curvos sem um caminho salvo são importados como linhas retas" +"entries without a node type were skipped" = "entradas sem tipo de nó foram ignoradas" "figcraft:// links from a browser, chat or email open this app and join the session." = "Links figcraft:// de um navegador, chat ou e-mail abrem este app e entram na sessão." +"filled areas of a vector with their own fill use the layer's fill" = "áreas preenchidas de um vetor com preenchimento próprio usam o preenchimento da camada" "from {server}" = "de {server}" +"gamepad triggers without exactly one known controller button were skipped" = "gatilhos de gamepad sem exatamente um botão de controle conhecido foram ignorados" +"grid tracks of fixed or content size import as equal tracks" = "trilhas de grade de tamanho fixo ou pelo conteúdo são importadas como trilhas iguais" "hidden" = "oculta" "iOS" = "iOS" +"instance swap properties whose default component isn't in the file were skipped" = "propriedades de troca de instância cujo componente padrão não está no arquivo foram ignoradas" +"instances inside their own main component were imported as frames" = "instâncias dentro do próprio componente principal foram importadas como quadros" +"instances of components that aren't in the file show no layers" = "instâncias de componentes que não estão no arquivo não mostram camadas" +"instances of components that aren't in the file were imported as frames" = "instâncias de componentes que não estão no arquivo foram importadas como quadros" +"instances that would nest a component inside itself were imported as frames" = "instâncias que aninhariam um componente dentro dele mesmo foram importadas como quadros" +"instances without a main component were imported as empty frames" = "instâncias sem componente principal foram importadas como quadros vazios" +"invalid or oversized vector networks import as outlines" = "redes vetoriais inválidas ou grandes demais são importadas como contornos" +"invalid or oversized vector path data was skipped" = "dados de caminho vetorial inválidos ou grandes demais foram ignorados" +"key triggers without a supported key were skipped" = "gatilhos de tecla sem uma tecla compatível foram ignorados" +"key up triggers import as key presses" = "gatilhos ao soltar uma tecla são importados como pressionamentos de tecla" +"layers without a position were placed at their parent's origin" = "camadas sem posição foram colocadas na origem do elemento pai" +"layers without a type were skipped" = "camadas sem tipo foram ignoradas" "locked" = "bloqueada" "no bleed" = "sem sangria" "nobody else here yet" = "ainda não há mais ninguém" "now" = "agora" "or" = "ou" +"point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "as junções de traço por ponto foram mantidas; traços tracejados ou de largura variável são desenhados com a junção da camada" +"prototype actions of unknown types were skipped" = "ações de protótipo de tipos desconhecidos foram ignoradas" +"prototype actions without a destination in the file were skipped" = "ações de protótipo sem destino no arquivo foram ignoradas" +"prototype expressions on variables that aren't in the variables JSON were skipped" = "expressões de protótipo com variáveis que não estão no JSON de variáveis foram ignoradas" +"prototype expressions with unsupported functions were skipped" = "expressões de protótipo com funções sem suporte foram ignoradas" +"prototype interactions without supported actions were skipped" = "interações de protótipo sem ações compatíveis foram ignoradas" +"prototype navigations of unknown types were skipped" = "navegações de protótipo de tipos desconhecidos foram ignoradas" +"prototype transitions of unknown types play instantly" = "transições de protótipo de tipos desconhecidos são instantâneas" +"prototype triggers of unknown types were skipped" = "gatilhos de protótipo de tipos desconhecidos foram ignorados" "put a widget on the canvas" = "colocar um widget na tela" "read and edit the document" = "ler e editar o documento" "read the document" = "ler o documento" "reads the document" = "lê o documento" +"set-variable actions on variables that aren't in the variables JSON were skipped" = "ações de definir variável em variáveis que não estão no JSON de variáveis foram ignoradas" +"set-variable actions with values that can't be evaluated were skipped" = "ações de definir variável com valores que não podem ser avaliados foram ignoradas" +"set-variable actions with values that don't fit the variable were skipped" = "ações de definir variável com valores que não cabem na variável foram ignoradas" +"set-variable actions without a value were skipped" = "ações de definir variável sem valor foram ignoradas" +"set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "ações de definir modo de variável em coleções ou modos que não estão no JSON de variáveis foram ignoradas" +"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "alguns pontos vetoriais se referem a configurações de ponto ausentes no arquivo; eles usam as junções da camada e cantos simples" +"stars and polygons without point counts or geometry use the default point count" = "estrelas e polígonos sem número de pontas nem geometria usam o número de pontas padrão" +"text style overrides refer to missing table entries" = "substituições de estilo de texto se referem a entradas de tabela ausentes" +"the file has no pages" = "o arquivo não tem páginas" "the plugin" = "o plugin" +"the variables JSON has no `variableCollections` (expected the local variables response) and was ignored" = "o JSON de variáveis não tem `variableCollections` (era esperada a resposta de variáveis locais) e foi ignorado" "this session only" = "somente nesta sessão" +"unknown component property types were skipped" = "tipos desconhecidos de propriedade de componente foram ignorados" +"variable aliases to variables that aren't in the variables JSON (or of another type) were skipped" = "aliases para variáveis que não estão no JSON de variáveis (ou de outro tipo) foram ignorados" +"variable bindings to properties the layer doesn't have were skipped" = "vínculos de variáveis a propriedades que a camada não tem foram ignorados" +"variable bindings to variables that aren't in the variables JSON (library variables) were skipped" = "vínculos a variáveis que não estão no JSON de variáveis (variáveis de biblioteca) foram ignorados" +"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)" = "vínculos de variáveis foram ignorados: o JSON do arquivo não tem definições de variáveis (passe o JSON de variáveis locais como `variables` ou incorpore o `meta` dele ao lado do JSON do arquivo)" +"variable bindings whose variable type doesn't fit the property were skipped" = "vínculos de variáveis cujo tipo de variável não combina com a propriedade foram ignorados" +"variable collections without modes were skipped" = "coleções de variáveis sem modos foram ignoradas" +"variable mode lookups in prototype expressions that aren't a variable and one of its modes were skipped" = "consultas de modo de variável em expressões de protótipo que não são uma variável e um de seus modos foram ignoradas" +"variable modes of collections that aren't in the file were skipped" = "modos de variáveis de coleções que não estão no arquivo foram ignorados" +"variable modes of collections that aren't in the variables JSON were skipped" = "modos de variáveis de coleções que não estão no JSON de variáveis foram ignorados" +"variable values that don't match their type (or composed colours) were skipped" = "valores de variáveis que não correspondem ao seu tipo (ou cores compostas) foram ignorados" +"variables of unknown types were skipped" = "variáveis de tipos desconhecidos foram ignoradas" +"variables whose collection isn't in the variables JSON were skipped" = "variáveis cuja coleção não está no JSON de variáveis foram ignoradas" +"variables without readable values were skipped" = "variáveis sem valores legíveis foram ignoradas" +"vector points with unknown stroke joins use the layer join" = "pontos vetoriais com junções de traço desconhecidas usam a junção da camada" +"vectors without geometry are empty" = "vetores sem geometria ficam vazios" +"vectors without geometry are empty (export the file JSON with geometry=paths)" = "vetores sem geometria ficam vazios (exporte o JSON do arquivo com geometry=paths)" +"very long text was cut to 1,048,576 characters" = "textos muito longos foram cortados em 1.048.576 caracteres" +"very long vector paths were skipped" = "caminhos vetoriais muito longos foram ignorados" +"video actions are not supported and were skipped" = "ações de vídeo não têm suporte e foram ignoradas" +"video triggers are not supported and were skipped" = "gatilhos de vídeo não têm suporte e foram ignorados" "{instances} in {files}" = "{instances} em {files}" "{language}: draft translation, waiting for a native speaker's review." = "{language}: tradução em rascunho, aguardando revisão de um falante nativo." "{length} bleed" = "sangria de {length}" @@ -1486,6 +1559,7 @@ status = "draft — needs native review" "{n} matches" = { one = "{n} resultado", other = "{n} resultados" } "{n} minutes ago" = { one = "há {n} minuto", other = "há {n} minutos" } "{n} months ago" = { one = "há {n} mês", other = "há {n} meses" } +"{n} more notes omitted from this report" = { one = "{n} nota a mais omitida deste relatório", other = "{n} notas a mais omitidas deste relatório" } "{n} of {total}" = "{n} de {total}" "{n} people joined" = { one = "{n} pessoa entrou", other = "{n} pessoas entraram" } "{n} preferred components" = { one = "{n} componente preferido", other = "{n} componentes preferidos" } diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 3ab407572..fb090d361 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -267,6 +267,7 @@ name = "Русский" "Commits" = "Коммиты" "Company" = "Компания" "Compare changes" = "Сравнить изменения" +"Compatibility notes" = "Замечания о совместимости" "Completed" = "Завершено" "Component" = "Компонент" "Component name" = "Имя компонента" @@ -473,6 +474,7 @@ name = "Русский" "False" = "Ложь" "Feb" = "февр." "Fetching from the server…" = "Загрузка с сервера…" +"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 пока поддерживает не все возможности этих файлов. В замечаниях перечислено, что было пропущено или изменено в импортированной копии; исходный файл не меняется." "File" = "Файл" "File name" = "Имя файла" "File not found" = "Файл не найден" @@ -596,11 +598,14 @@ name = "Русский" "If {condition}" = "Если {condition}" "Ignore auto layout (absolute position)" = "Игнорировать автолейаут (абсолютная позиция)" "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}", few = "Импортированы {n} новые переменные, обновлено: {updated}", many = "Импортировано {n} новых переменных, обновлено: {updated}", other = "Импортировано {n} новой переменной, обновлено: {updated}" } "Import…" = "Импорт…" @@ -802,6 +807,7 @@ name = "Русский" "No colour variables fit here." = "Нет подходящих цветовых переменных." "No colour variables yet. Create them in Local variables." = "Цветовых переменных пока нет. Создайте их в разделе «Локальные переменные»." "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." = "В этой сборке нет данных об участниках." @@ -893,6 +899,7 @@ name = "Русский" "Open overlay" = "Открыть оверлей" "Open prototype preview" = "Открыть предпросмотр прототипа" "Open variables ({count})" = "Открыть переменные ({count})" +"Opened as a new document" = "Открыт как новый документ" "Opened “{name}” in a new tab" = "«{name}» открыт в новой вкладке" "Open|comments" = "Открытые" "Options" = "Параметры" @@ -917,6 +924,8 @@ name = "Русский" "Padding" = "Внутренние отступы" "Page" = "Страница" "Pages" = "Страницы" +"Pages added to the document" = "Страницы добавлены в документ" +"Placed on the current page" = "Размещено на текущей странице" "Pages: {pages}" = "Страницы: {pages}" "Paint bucket" = "Заливка области" "Pan the canvas" = "Перемещение по холсту" @@ -1486,26 +1495,90 @@ name = "Русский" "call any command its access allows" = "вызывать любые команды в рамках разрешений" "call only: {commands}" = "вызывать только: {commands}" "can edit the document" = "может редактировать документ" +"conditional prototype actions nested too deeply were skipped" = "условные действия прототипа со слишком глубокой вложенностью пропущены" +"conditional prototype actions with conditions that can't be evaluated were skipped" = "условные действия прототипа с условиями, которые нельзя вычислить, пропущены" +"connector labels were skipped" = "подписи соединительных линий пропущены" +"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" = "дочерние элементы документа, не являющиеся страницами, пропущены" "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 import as straight lines" = "ломаные и изогнутые соединительные линии без сохранённого пути импортируются как прямые" +"entries without a node type were skipped" = "записи без типа узла пропущены" "figcraft:// links from a browser, chat or email open this app and join the session." = "Ссылки figcraft:// из браузера, чата или почты открывают это приложение и подключают к сессии." +"filled areas of a vector with their own fill use the layer's fill" = "залитые области вектора с собственной заливкой используют заливку слоя" "from {server}" = "с {server}" +"gamepad triggers without exactly one known controller button were skipped" = "триггеры геймпада без ровно одной известной кнопки контроллера пропущены" +"grid tracks of fixed or content size import as equal tracks" = "дорожки сетки фиксированного размера или по содержимому импортируются как равные дорожки" "hidden" = "скрыто" "iOS" = "iOS" +"instance swap properties whose default component isn't in the file 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 without a main component were imported as empty frames" = "экземпляры без основного компонента импортированы как пустые фреймы" +"invalid or oversized vector networks import as outlines" = "недопустимые или слишком большие векторные сети импортируются как контуры" +"invalid or oversized vector path data was 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" = "слои без типа пропущены" "locked" = "заблокировано" "no bleed" = "без вылета" "nobody else here yet" = "здесь пока больше никого нет" "now" = "сейчас" "or" = "или" +"point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "соединения обводки в точках сохранены; пунктирные обводки и обводки переменной ширины рисуются с соединением слоя" +"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" = "выражения прототипа с переменными, которых нет в 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" = "действия «Задать переменную» для переменных, которых нет в 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" = "действия смены режима переменных для коллекций или режимов, которых нет в JSON переменных, пропущены" +"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "некоторые векторные точки ссылаются на настройки точек, которых нет в файле; они используют соединения слоя и обычные углы" +"stars and polygons without point counts or geometry use the default point count" = "звёзды и многоугольники без числа вершин или геометрии используют число вершин по умолчанию" +"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" = "в 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" = "псевдонимы переменных, которых нет в 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" = "привязки к переменным, которых нет в 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 файла нет определений переменных (передайте 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" = "режимы переменных коллекций, которых нет в JSON переменных, пропущены" +"variable values that don't match their type (or composed colours) were skipped" = "значения переменных, не соответствующие своему типу (или составные цвета), пропущены" +"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" = "векторные точки с неизвестными соединениями обводки используют соединение слоя" +"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" = "вчера" "{instances} in {files}" = "{instances} в {files}" "{language}: draft translation, waiting for a native speaker's review." = "{language}: черновой перевод, ожидает проверки носителем языка." @@ -1550,6 +1623,7 @@ name = "Русский" "{n} matches" = { one = "{n} совпадение", few = "{n} совпадения", many = "{n} совпадений", other = "{n} совпадения" } "{n} minutes ago" = { one = "{n} минуту назад", few = "{n} минуты назад", many = "{n} минут назад", other = "{n} минуты назад" } "{n} months ago" = { one = "{n} месяц назад", few = "{n} месяца назад", many = "{n} месяцев назад", other = "{n} месяца назад" } +"{n} more notes omitted from this report" = { one = "Ещё {n} замечание не включено в этот отчёт", few = "Ещё {n} замечания не включены в этот отчёт", many = "Ещё {n} замечаний не включено в этот отчёт", other = "Ещё {n} замечания не включено в этот отчёт" } "{n} of {total}" = "{n} из {total}" "{n} people joined" = { one = "Подключился {n} участник", few = "Подключились {n} участника", many = "Подключились {n} участников", other = "Подключилось {n} участника" } "{n} preferred components" = { one = "{n} предпочтительный компонент", few = "{n} предпочтительных компонента", many = "{n} предпочтительных компонентов", other = "{n} предпочтительного компонента" } diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index f7b2999d6..070b68d74 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -268,6 +268,7 @@ name = "Svenska" "Commits" = "Commits" "Company" = "Företag" "Compare changes" = "Jämför ändringar" +"Compatibility notes" = "Kompatibilitetsanteckningar" "Completed" = "Slutförd" "Component" = "Komponent" "Component name" = "Komponentnamn" @@ -474,6 +475,7 @@ name = "Svenska" "False" = "Falskt" "Feb" = "feb" "Fetching from the server…" = "Hämtar från servern…" +"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 stöder ännu inte alla funktioner i de här filerna. Anteckningarna visar vad som utelämnades eller ändrades i den importerade kopian; originalfilen är oförändrad." "File" = "Fil" "File name" = "Filnamn" "File not found" = "Filen hittades inte" @@ -597,11 +599,14 @@ name = "Svenska" "If {condition}" = "Om {condition}" "Ignore auto layout (absolute position)" = "Ignorera automatisk layout (absolut position)" "Image" = "Bild" +"Images" = "Bilder" "Import" = "Importera" "Import path" = "Importsökväg" "Import plugin from manifest" = "Importera plugin från manifest" "Import plugin from manifest…" = "Importera plugin från manifest…" +"Import report" = "Importrapport" "Import variables" = "Importera variabler" +"Imported document" = "Importerat dokument" "Imported {name}" = "Importerade {name}" "Imported {n} new variables, updated {updated}" = { one = "Importerade {n} ny variabel, uppdaterade {updated}", other = "Importerade {n} nya variabler, uppdaterade {updated}" } "Import…" = "Importera…" @@ -803,6 +808,7 @@ name = "Svenska" "No colour variables fit here." = "Inga färgvariabler passar här." "No colour variables yet. Create them in Local variables." = "Inga färgvariabler än. Skapa dem i Lokala variabler." "No comments yet" = "Inga kommentarer än" +"No compatibility warnings reported" = "Inga kompatibilitetsvarningar rapporterades" "No components yet. Select layers and press {keys}." = "Inga komponenter än. Markera lager och tryck på {keys}." "No conflicts." = "Inga konflikter." "No contributor data was built into this copy." = "Inga uppgifter om bidragsgivare finns inbyggda i den här kopian." @@ -894,6 +900,7 @@ name = "Svenska" "Open overlay" = "Öppna överlägg" "Open prototype preview" = "Öppna prototypförhandsgranskning" "Open variables ({count})" = "Öppna variabler ({count})" +"Opened as a new document" = "Öppnat som ett nytt dokument" "Opened “{name}” in a new tab" = "Öppnade ”{name}” i en ny flik" "Open|comments" = "Öppna" "Options" = "Alternativ" @@ -918,6 +925,8 @@ name = "Svenska" "Padding" = "Utfyllnad" "Page" = "Sida" "Pages" = "Sidor" +"Pages added to the document" = "Sidor tillagda i dokumentet" +"Placed on the current page" = "Placerat på den aktuella sidan" "Pages: {pages}" = "Sidor: {pages}" "Paint bucket" = "Färghink" "Pan the canvas" = "Panorera arbetsytan" @@ -1487,26 +1496,90 @@ name = "Svenska" "call any command its access allows" = "anropa alla kommandon som dess åtkomst tillåter" "call only: {commands}" = "anropa endast: {commands}" "can edit the document" = "kan redigera dokumentet" +"conditional prototype actions nested too deeply were skipped" = "villkorliga prototypåtgärder som var nästlade för djupt hoppades över" +"conditional prototype actions with conditions that can't be evaluated were skipped" = "villkorliga prototypåtgärder med villkor som inte kan utvärderas hoppades över" +"connector labels were skipped" = "etiketter på kopplingslinjer hoppades över" +"connectors whose ends can't be placed are empty" = "kopplingslinjer vars ändar inte kan placeras är tomma" "crop marks" = "skärmärken" +"damaged vector geometry was skipped" = "skadad vektorgeometri hoppades över" +"damaged vector networks import as outlines" = "skadade vektornätverk importeras som former" "development: {path}" = "utveckling: {path}" +"document children other than pages were skipped" = "underordnade objekt i dokumentet som inte är sidor hoppades över" "e.g. count + 1" = "t.ex. count + 1" "e.g. count >= 3 and not done" = "t.ex. count >= 3 and not done" +"elbowed and curved connectors without a saved path import as straight lines" = "vinklade och böjda kopplingslinjer utan sparad bana importeras som raka linjer" +"entries without a node type were skipped" = "poster utan nodtyp hoppades över" "figcraft:// links from a browser, chat or email open this app and join the session." = "figcraft://-länkar från en webbläsare, chatt eller e-post öppnar den här appen och ansluter till sessionen." +"filled areas of a vector with their own fill use the layer's fill" = "fyllda områden i en vektor med egen fyllning använder lagrets fyllning" "from {server}" = "från {server}" +"gamepad triggers without exactly one known controller button were skipped" = "spelkontrollsutlösare utan exakt en känd kontrollknapp hoppades över" +"grid tracks of fixed or content size import as equal tracks" = "rutnätsspår med fast storlek eller innehållsstorlek importeras som lika stora spår" "hidden" = "dold" "iOS" = "iOS" +"instance swap properties whose default component isn't in the file were skipped" = "egenskaper för instansbyte vars standardkomponent inte finns i filen hoppades över" +"instances inside their own main component were imported as frames" = "instanser inuti sin egen huvudkomponent importerades som ramar" +"instances of components that aren't in the file show no layers" = "instanser av komponenter som inte finns i filen visar inga lager" +"instances of components that aren't in the file were imported as frames" = "instanser av komponenter som inte finns i filen importerades som ramar" +"instances that would nest a component inside itself were imported as frames" = "instanser som skulle nästla en komponent i sig själv importerades som ramar" +"instances without a main component were imported as empty frames" = "instanser utan huvudkomponent importerades som tomma ramar" +"invalid or oversized vector networks import as outlines" = "ogiltiga eller för stora vektornätverk importeras som former" +"invalid or oversized vector path data was skipped" = "ogiltiga eller för stora vektorbanedata hoppades över" "just now" = "nyss" +"key triggers without a supported key were skipped" = "tangentutlösare utan en tangent som stöds hoppades över" +"key up triggers import as key presses" = "utlösare för släppt tangent importeras som tangenttryckningar" +"layers without a position were placed at their parent's origin" = "lager utan position placerades i det överordnade objektets origo" +"layers without a type were skipped" = "lager utan typ hoppades över" "locked" = "låst" "no bleed" = "inget utfall" "nobody else here yet" = "ingen annan här än" "now" = "nu" "or" = "eller" +"point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "punkternas hörntyper behölls; streckade konturer och konturer med variabel bredd ritas med lagrets hörntyp" +"prototype actions of unknown types were skipped" = "prototypåtgärder av okända typer hoppades över" +"prototype actions without a destination in the file were skipped" = "prototypåtgärder utan mål i filen hoppades över" +"prototype expressions on variables that aren't in the variables JSON were skipped" = "prototyputtryck med variabler som inte finns i variabel-JSON:en hoppades över" +"prototype expressions with unsupported functions were skipped" = "prototyputtryck med funktioner som inte stöds hoppades över" +"prototype interactions without supported actions were skipped" = "prototypinteraktioner utan åtgärder som stöds hoppades över" +"prototype navigations of unknown types were skipped" = "prototypnavigeringar av okända typer hoppades över" +"prototype transitions of unknown types play instantly" = "prototypövergångar av okända typer spelas upp direkt" +"prototype triggers of unknown types were skipped" = "prototyputlösare av okända typer hoppades över" "put a widget on the canvas" = "placera en widget på arbetsytan" "read and edit the document" = "läsa och redigera dokumentet" "read the document" = "läsa dokumentet" "reads the document" = "läser dokumentet" +"set-variable actions on variables that aren't in the variables JSON were skipped" = "åtgärder för att ange variabel på variabler som inte finns i variabel-JSON:en hoppades över" +"set-variable actions with values that can't be evaluated were skipped" = "åtgärder för att ange variabel med värden som inte kan utvärderas hoppades över" +"set-variable actions with values that don't fit the variable were skipped" = "åtgärder för att ange variabel med värden som inte passar variabeln hoppades över" +"set-variable actions without a value were skipped" = "åtgärder för att ange variabel utan värde hoppades över" +"set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "åtgärder för att ange variabelläge på samlingar eller lägen som inte finns i variabel-JSON:en hoppades över" +"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "vissa vektorpunkter hänvisar till punktinställningar som saknas i filen; de använder lagrets hörntyper och vanliga hörn" +"stars and polygons without point counts or geometry use the default point count" = "stjärnor och polygoner utan antal punkter eller geometri använder standardantalet punkter" +"text style overrides refer to missing table entries" = "åsidosättningar av textstilar hänvisar till tabellposter som saknas" +"the file has no pages" = "filen har inga sidor" "the plugin" = "pluginet" +"the variables JSON has no `variableCollections` (expected the local variables response) and was ignored" = "variabel-JSON:en har inga `variableCollections` (svaret med lokala variabler väntades) och ignorerades" "this session only" = "endast den här sessionen" +"unknown component property types were skipped" = "okända typer av komponentegenskaper hoppades över" +"variable aliases to variables that aren't in the variables JSON (or of another type) were skipped" = "alias till variabler som inte finns i variabel-JSON:en (eller är av en annan typ) hoppades över" +"variable bindings to properties the layer doesn't have were skipped" = "variabelbindningar till egenskaper som lagret inte har hoppades över" +"variable bindings to variables that aren't in the variables JSON (library variables) were skipped" = "bindningar till variabler som inte finns i variabel-JSON:en (biblioteksvariabler) hoppades över" +"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)" = "variabelbindningar hoppades över: fil-JSON:en har inga variabeldefinitioner (skicka den lokala variabel-JSON:en som `variables`, eller bädda in dess `meta` bredvid fil-JSON:en)" +"variable bindings whose variable type doesn't fit the property were skipped" = "variabelbindningar vars variabeltyp inte passar egenskapen hoppades över" +"variable collections without modes were skipped" = "variabelsamlingar utan lägen hoppades över" +"variable mode lookups in prototype expressions that aren't a variable and one of its modes were skipped" = "uppslag av variabellägen i prototyputtryck som inte är en variabel och ett av dess lägen hoppades över" +"variable modes of collections that aren't in the file were skipped" = "variabellägen för samlingar som inte finns i filen hoppades över" +"variable modes of collections that aren't in the variables JSON were skipped" = "variabellägen för samlingar som inte finns i variabel-JSON:en hoppades över" +"variable values that don't match their type (or composed colours) were skipped" = "variabelvärden som inte matchar sin typ (eller sammansatta färger) hoppades över" +"variables of unknown types were skipped" = "variabler av okända typer hoppades över" +"variables whose collection isn't in the variables JSON were skipped" = "variabler vars samling inte finns i variabel-JSON:en hoppades över" +"variables without readable values were skipped" = "variabler utan läsbara värden hoppades över" +"vector points with unknown stroke joins use the layer join" = "vektorpunkter med okända hörntyper använder lagrets hörntyp" +"vectors without geometry are empty" = "vektorer utan geometri är tomma" +"vectors without geometry are empty (export the file JSON with geometry=paths)" = "vektorer utan geometri är tomma (exportera fil-JSON:en med geometry=paths)" +"very long text was cut to 1,048,576 characters" = "mycket lång text kortades till 1 048 576 tecken" +"very long vector paths were skipped" = "mycket långa vektorbanor hoppades över" +"video actions are not supported and were skipped" = "videoåtgärder stöds inte och hoppades över" +"video triggers are not supported and were skipped" = "videoutlösare stöds inte och hoppades över" "yesterday" = "i går" "{instances} in {files}" = "{instances} i {files}" "{language}: draft translation, waiting for a native speaker's review." = "{language}: utkast till översättning, väntar på granskning av en modersmålstalare." @@ -1551,6 +1624,7 @@ name = "Svenska" "{n} matches" = { one = "{n} träff", other = "{n} träffar" } "{n} minutes ago" = { one = "för {n} minut sedan", other = "för {n} minuter sedan" } "{n} months ago" = { one = "för {n} månad sedan", other = "för {n} månader sedan" } +"{n} more notes omitted from this report" = { one = "{n} anteckning till utelämnades i den här rapporten", other = "{n} anteckningar till utelämnades i den här rapporten" } "{n} of {total}" = "{n} av {total}" "{n} people joined" = { one = "{n} person anslöt", other = "{n} personer anslöt" } "{n} preferred components" = { one = "{n} föredragen komponent", other = "{n} föredragna komponenter" } diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml index a2be6b99c..9a40771e2 100644 --- a/crates/ui-egui/locales/tr.toml +++ b/crates/ui-egui/locales/tr.toml @@ -270,6 +270,7 @@ name = "Türkçe" "Commits" = "Commit'ler" "Company" = "Şirket" "Compare changes" = "Değişiklikleri karşılaştır" +"Compatibility notes" = "Uyumluluk notları" "Completed" = "Tamamlandı" "Component" = "Bileşen" "Component name" = "Bileşen adı" @@ -476,6 +477,7 @@ name = "Türkçe" "False" = "Yanlış" "Feb" = "Şub" "Fetching from the server…" = "Sunucudan getiriliyor…" +"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 bu dosyaların tüm özelliklerini henüz desteklemiyor. Notlar, içe aktarılan kopyada nelerin dışarıda bırakıldığını veya değiştirildiğini listeler; özgün dosya değişmez." "File" = "Dosya" "File name" = "Dosya adı" "File not found" = "Dosya bulunamadı" @@ -599,11 +601,14 @@ name = "Türkçe" "If {condition}" = "Eğer {condition}" "Ignore auto layout (absolute position)" = "Otomatik yerleşimi yok say (mutlak konum)" "Image" = "Görüntü" +"Images" = "Görüntüler" "Import" = "İçe aktar" "Import path" = "İçe aktarma yolu" "Import plugin from manifest" = "Eklentiyi manifestten içe aktar" "Import plugin from manifest…" = "Eklentiyi manifestten içe aktar…" +"Import report" = "İçe aktarma raporu" "Import variables" = "Değişkenleri içe aktar" +"Imported document" = "İçe aktarılan belge" "Imported {name}" = "İçe aktarıldı: {name}" "Imported {n} new variables, updated {updated}" = { other = "{n} yeni değişken içe aktarıldı, {updated} güncellendi" } "Import…" = "İçe aktar…" @@ -805,6 +810,7 @@ name = "Türkçe" "No colour variables fit here." = "Buraya uyan renk değişkeni yok." "No colour variables yet. Create them in Local variables." = "Henüz renk değişkeni yok. Onları Yerel değişkenler'de oluşturun." "No comments yet" = "Henüz yorum yok" +"No compatibility warnings reported" = "Uyumluluk uyarısı bildirilmedi" "No components yet. Select layers and press {keys}." = "Henüz bileşen yok. Katmanları seçip {keys} tuşlarına basın." "No conflicts." = "Çakışma yok." "No contributor data was built into this copy." = "Bu kopyaya katkıda bulunan verisi eklenmemiş." @@ -896,6 +902,7 @@ name = "Türkçe" "Open overlay" = "Bindirmeyi aç" "Open prototype preview" = "Prototip önizlemesini aç" "Open variables ({count})" = "Açık değişkenler ({count})" +"Opened as a new document" = "Yeni belge olarak açıldı" "Opened “{name}” in a new tab" = "“{name}” yeni sekmede açıldı" "Open|comments" = "Açık" "Options" = "Seçenekler" @@ -920,6 +927,8 @@ name = "Türkçe" "Padding" = "İç boşluk" "Page" = "Sayfa" "Pages" = "Sayfalar" +"Pages added to the document" = "Sayfalar belgeye eklendi" +"Placed on the current page" = "Geçerli sayfaya yerleştirildi" "Pages: {pages}" = "Sayfalar: {pages}" "Paint bucket" = "Boya kovası" "Pan the canvas" = "Tuvali kaydır" @@ -1489,26 +1498,90 @@ name = "Türkçe" "call any command its access allows" = "erişiminin izin verdiği her komutu çağırmak" "call only: {commands}" = "yalnızca şunları çağırmak: {commands}" "can edit the document" = "belgeyi düzenleyebilir" +"conditional prototype actions nested too deeply were skipped" = "çok derin iç içe geçmiş koşullu prototip eylemleri atlandı" +"conditional prototype actions with conditions that can't be evaluated were skipped" = "değerlendirilemeyen koşullara sahip koşullu prototip eylemleri atlandı" +"connector labels were skipped" = "bağlayıcı etiketleri atlandı" +"connectors whose ends can't be placed are empty" = "uçları yerleştirilemeyen bağlayıcılar boş" "crop marks" = "kesim işaretleri" +"damaged vector geometry was skipped" = "hasarlı vektör geometrisi atlandı" +"damaged vector networks import as outlines" = "hasarlı vektör ağları ana hat olarak içe aktarılır" "development: {path}" = "geliştirme: {path}" +"document children other than pages were skipped" = "belgenin sayfa olmayan alt öğeleri atlandı" "e.g. count + 1" = "ör. count + 1" "e.g. count >= 3 and not done" = "ör. count >= 3 and not done" +"elbowed and curved connectors without a saved path import as straight lines" = "kaydedilmiş yolu olmayan dirsekli ve eğri bağlayıcılar düz çizgi olarak içe aktarılır" +"entries without a node type were skipped" = "düğüm türü olmayan girdiler atlandı" "figcraft:// links from a browser, chat or email open this app and join the session." = "Bir tarayıcıdan, sohbetten veya e-postadan gelen figcraft:// bağlantıları bu uygulamayı açar ve oturuma katılır." +"filled areas of a vector with their own fill use the layer's fill" = "kendi dolgusu olan vektör dolgu alanları katmanın dolgusunu kullanır" "from {server}" = "kaynak: {server}" +"gamepad triggers without exactly one known controller button were skipped" = "tam olarak bir bilinen kumanda düğmesi olmayan oyun kumandası tetikleyicileri atlandı" +"grid tracks of fixed or content size import as equal tracks" = "sabit veya içerik boyutlu ızgara izleri eşit izler olarak içe aktarılır" "hidden" = "gizli" "iOS" = "iOS" +"instance swap properties whose default component isn't in the file were skipped" = "varsayılan bileşeni dosyada olmayan örnek değiştirme özellikleri atlandı" +"instances inside their own main component were imported as frames" = "kendi ana bileşeninin içindeki örnekler çerçeve olarak içe aktarıldı" +"instances of components that aren't in the file show no layers" = "dosyada olmayan bileşenlerin örnekleri katman göstermez" +"instances of components that aren't in the file were imported as frames" = "dosyada olmayan bileşenlerin örnekleri çerçeve olarak içe aktarıldı" +"instances that would nest a component inside itself were imported as frames" = "bir bileşeni kendi içine yerleştirecek örnekler çerçeve olarak içe aktarıldı" +"instances without a main component were imported as empty frames" = "ana bileşeni olmayan örnekler boş çerçeve olarak içe aktarıldı" +"invalid or oversized vector networks import as outlines" = "geçersiz veya çok büyük vektör ağları ana hat olarak içe aktarılır" +"invalid or oversized vector path data was skipped" = "geçersiz veya çok büyük vektör yolu verileri atlandı" "just now" = "az önce" +"key triggers without a supported key were skipped" = "desteklenen bir tuşu olmayan tuş tetikleyicileri atlandı" +"key up triggers import as key presses" = "tuş bırakma tetikleyicileri tuşa basma olarak içe aktarılır" +"layers without a position were placed at their parent's origin" = "konumu olmayan katmanlar üst öğelerinin başlangıç noktasına yerleştirildi" +"layers without a type were skipped" = "türü olmayan katmanlar atlandı" "locked" = "kilitli" "no bleed" = "taşma payı yok" "nobody else here yet" = "burada henüz başka kimse yok" "now" = "şimdi" "or" = "veya" +"point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "nokta başına kontur birleşimleri korundu; kesikli veya değişken genişlikli konturlar katmanın birleşimiyle çizilir" +"prototype actions of unknown types were skipped" = "bilinmeyen türdeki prototip eylemleri atlandı" +"prototype actions without a destination in the file were skipped" = "dosyada hedefi olmayan prototip eylemleri atlandı" +"prototype expressions on variables that aren't in the variables JSON were skipped" = "değişken JSON'unda olmayan değişkenler üzerindeki prototip ifadeleri atlandı" +"prototype expressions with unsupported functions were skipped" = "desteklenmeyen işlevler içeren prototip ifadeleri atlandı" +"prototype interactions without supported actions were skipped" = "desteklenen eylemi olmayan prototip etkileşimleri atlandı" +"prototype navigations of unknown types were skipped" = "bilinmeyen türdeki prototip gezinmeleri atlandı" +"prototype transitions of unknown types play instantly" = "bilinmeyen türdeki prototip geçişleri anında oynatılır" +"prototype triggers of unknown types were skipped" = "bilinmeyen türdeki prototip tetikleyicileri atlandı" "put a widget on the canvas" = "tuvale bir widget koymak" "read and edit the document" = "belgeyi okumak ve düzenlemek" "read the document" = "belgeyi okumak" "reads the document" = "belgeyi okur" +"set-variable actions on variables that aren't in the variables JSON were skipped" = "değişken JSON'unda olmayan değişkenler üzerindeki değişken ayarlama eylemleri atlandı" +"set-variable actions with values that can't be evaluated were skipped" = "değerlendirilemeyen değerlere sahip değişken ayarlama eylemleri atlandı" +"set-variable actions with values that don't fit the variable were skipped" = "değişkene uymayan değerlere sahip değişken ayarlama eylemleri atlandı" +"set-variable actions without a value were skipped" = "değeri olmayan değişken ayarlama eylemleri atlandı" +"set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "değişken JSON'unda olmayan koleksiyonlar veya modlar üzerindeki değişken modu ayarlama eylemleri atlandı" +"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "bazı vektör noktaları dosyada eksik olan nokta ayarlarına başvuruyor; bu noktalar katmanın birleşimlerini ve düz köşeleri kullanır" +"stars and polygons without point counts or geometry use the default point count" = "nokta sayısı veya geometrisi olmayan yıldızlar ve çokgenler varsayılan nokta sayısını kullanır" +"text style overrides refer to missing table entries" = "metin stili geçersiz kılmaları eksik tablo girdilerine başvuruyor" +"the file has no pages" = "dosyada sayfa yok" "the plugin" = "eklenti" +"the variables JSON has no `variableCollections` (expected the local variables response) and was ignored" = "değişken JSON'unda `variableCollections` yok (yerel değişkenler yanıtı bekleniyordu) ve yok sayıldı" "this session only" = "yalnızca bu oturum" +"unknown component property types were skipped" = "bilinmeyen bileşen özelliği türleri atlandı" +"variable aliases to variables that aren't in the variables JSON (or of another type) were skipped" = "değişken JSON'unda olmayan (veya başka türdeki) değişkenlere yönelik takma adlar atlandı" +"variable bindings to properties the layer doesn't have were skipped" = "katmanda olmayan özelliklere yönelik değişken bağlamaları atlandı" +"variable bindings to variables that aren't in the variables JSON (library variables) were skipped" = "değişken JSON'unda olmayan değişkenlere (kitaplık değişkenleri) yönelik bağlamalar atlandı" +"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)" = "değişken bağlamaları atlandı: dosya JSON'unda değişken tanımı yok (yerel değişken JSON'unu `variables` olarak verin veya `meta` alanını dosya JSON'unun yanına gömün)" +"variable bindings whose variable type doesn't fit the property were skipped" = "değişken türü özelliğe uymayan değişken bağlamaları atlandı" +"variable collections without modes were skipped" = "modu olmayan değişken koleksiyonları atlandı" +"variable mode lookups in prototype expressions that aren't a variable and one of its modes were skipped" = "prototip ifadelerinde bir değişken ve onun modlarından biri olmayan değişken modu aramaları atlandı" +"variable modes of collections that aren't in the file were skipped" = "dosyada olmayan koleksiyonların değişken modları atlandı" +"variable modes of collections that aren't in the variables JSON were skipped" = "değişken JSON'unda olmayan koleksiyonların değişken modları atlandı" +"variable values that don't match their type (or composed colours) were skipped" = "türüyle eşleşmeyen değişken değerleri (veya birleşik renkler) atlandı" +"variables of unknown types were skipped" = "bilinmeyen türdeki değişkenler atlandı" +"variables whose collection isn't in the variables JSON were skipped" = "koleksiyonu değişken JSON'unda olmayan değişkenler atlandı" +"variables without readable values were skipped" = "okunabilir değeri olmayan değişkenler atlandı" +"vector points with unknown stroke joins use the layer join" = "bilinmeyen kontur birleşimleri olan vektör noktaları katmanın birleşimini kullanır" +"vectors without geometry are empty" = "geometrisi olmayan vektörler boş" +"vectors without geometry are empty (export the file JSON with geometry=paths)" = "geometrisi olmayan vektörler boş (dosya JSON'unu geometry=paths ile dışa aktarın)" +"very long text was cut to 1,048,576 characters" = "çok uzun metin 1.048.576 karaktere kısaltıldı" +"very long vector paths were skipped" = "çok uzun vektör yolları atlandı" +"video actions are not supported and were skipped" = "video eylemleri desteklenmiyor ve atlandı" +"video triggers are not supported and were skipped" = "video tetikleyicileri desteklenmiyor ve atlandı" "yesterday" = "dün" "{instances} in {files}" = "{instances}, {files} içinde" "{language}: draft translation, waiting for a native speaker's review." = "{language}: taslak çeviri, ana dili konuşan birinin incelemesini bekliyor." @@ -1553,6 +1626,7 @@ name = "Türkçe" "{n} matches" = { other = "{n} eşleşme" } "{n} minutes ago" = { other = "{n} dakika önce" } "{n} months ago" = { other = "{n} ay önce" } +"{n} more notes omitted from this report" = { other = "{n} not daha bu rapora alınmadı" } "{n} of {total}" = "{n} / {total}" "{n} people joined" = { other = "{n} kişi katıldı" } "{n} preferred components" = { other = "{n} tercih edilen bileşen" } diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index af4cf6534..4e7403291 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -262,6 +262,7 @@ status = "draft — needs native review" "Commits" = "提交" "Company" = "公司" "Compare changes" = "比较更改" +"Compatibility notes" = "兼容性说明" "Completed" = "已完成" "Component" = "组件" "Component name" = "组件名称" @@ -461,6 +462,7 @@ status = "draft — needs native review" "False" = "假" "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 尚不支持这些文件的全部功能。说明中列出了导入副本中省略或更改的内容;原始文件保持不变。" "File" = "文件" "File name" = "文件名" "File published" = "文件已发布" @@ -577,11 +579,14 @@ status = "draft — needs native review" "If {condition}" = "如果 {condition}" "Ignore auto layout (absolute position)" = "忽略自动布局(绝对定位)" "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}" = { other = "已导入 {n} 个新变量,更新 {updated} 个" } "Import…" = "导入…" @@ -771,6 +776,7 @@ status = "draft — needs native review" "No colour variables fit here." = "没有适用于此处的颜色变量。" "No colour variables yet. Create them in Local variables." = "还没有颜色变量。请在“本地变量”中创建。" "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." = "此副本未内置贡献者数据。" @@ -857,6 +863,7 @@ status = "draft — needs native review" "Open overlay" = "打开浮层" "Open prototype preview" = "打开原型预览" "Open variables ({count})" = "打开变量({count})" +"Opened as a new document" = "已作为新文档打开" "Opened “{name}” in a new tab" = "已在新标签页中打开“{name}”" "Open|comments" = "未解决" "Options" = "选项" @@ -880,6 +887,8 @@ status = "draft — needs native review" "Padding" = "内边距" "Page" = "页面" "Pages" = "页面" +"Pages added to the document" = "页面已添加到文档" +"Placed on the current page" = "已放置在当前页面" "Pages: {pages}" = "页面:{pages}" "Paint bucket" = "油漆桶" "Pan the canvas" = "平移画布" @@ -1427,25 +1436,89 @@ status = "draft — needs native review" "call any command its access allows" = "调用其访问权限允许的任何命令" "call only: {commands}" = "仅调用:{commands}" "can edit the document" = "可编辑文档" +"conditional prototype actions nested too deeply were skipped" = "已跳过嵌套过深的条件原型操作" +"conditional prototype actions with conditions that can't be evaluated were skipped" = "已跳过条件无法求值的条件原型操作" +"connector labels were skipped" = "已跳过连接线标签" +"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" = "已跳过非页面的文档子项" "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 import as straight lines" = "没有已保存路径的折线和曲线连接线导入为直线" +"entries without a node type were skipped" = "已跳过没有节点类型的条目" "figcraft:// links from a browser, chat or email open this app and join the session." = "来自浏览器、聊天或邮件的 figcraft:// 链接会打开此应用并加入会话。" +"filled areas of a vector with their own fill use the layer's fill" = "具有自身填充的矢量填充区域使用图层的填充" "from {server}" = "来自 {server}" +"gamepad triggers without exactly one known controller button were skipped" = "已跳过没有恰好一个已知手柄按钮的游戏手柄触发器" +"grid tracks of fixed or content size import as equal tracks" = "固定尺寸或按内容尺寸的网格轨道导入为等分轨道" "hidden" = "已隐藏" "iOS" = "iOS" +"instance swap properties whose default component isn't in the file 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 without a main component were imported as empty frames" = "没有主组件的实例已导入为空画框" +"invalid or oversized vector networks import as outlines" = "无效或过大的矢量网络导入为轮廓" +"invalid or oversized vector path data was skipped" = "已跳过无效或过大的矢量路径数据" +"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" = "已跳过没有类型的图层" "locked" = "已锁定" "no bleed" = "无出血" "nobody else here yet" = "这里还没有其他人" "now" = "刚刚" "or" = "或" +"point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "已保留各点的描边转角;虚线描边或可变宽度描边以图层的转角绘制" +"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" = "已跳过使用变量 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" = "已跳过针对变量 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" = "已跳过针对变量 JSON 中没有的集合或模式的设置变量模式操作" +"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "部分矢量点引用了文件中缺失的点设置;这些点使用图层的转角和普通角" +"stars and polygons without point counts or geometry use the default point count" = "没有点数或几何的星形和多边形使用默认点数" +"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" = "变量 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" = "已跳过指向变量 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" = "已跳过绑定到变量 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 中没有变量定义(将本地变量 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" = "已跳过变量 JSON 中没有的集合的变量模式" +"variable values that don't match their type (or composed colours) were skipped" = "已跳过与其类型不符的变量值(或组合颜色)" +"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" = "转角未知的矢量点使用图层的转角" +"vectors without geometry are empty" = "没有几何的矢量为空" +"vectors without geometry are empty (export the file JSON with geometry=paths)" = "没有几何的矢量为空(使用 geometry=paths 导出文件 JSON)" +"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" = "不支持视频触发器,已跳过" "{instances} in {files}" = "{files} 中的 {instances}" "{language}: draft translation, waiting for a native speaker's review." = "{language}:翻译草稿,等待母语者审校。" "{length} bleed" = "出血 {length}" @@ -1488,6 +1561,7 @@ status = "draft — needs native review" "{n} matches" = { other = "{n} 个匹配项" } "{n} minutes ago" = { other = "{n} 分钟前" } "{n} months ago" = { other = "{n} 个月前" } +"{n} more notes omitted from this report" = { other = "另有 {n} 条说明未列入此报告" } "{n} of {total}" = "第 {n} 个,共 {total} 个" "{n} people joined" = { other = "{n} 人已加入" } "{n} preferred components" = { other = "{n} 个首选组件" } From 4a572572dbb79bf66cfae89cdc96463cd503cafb Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 14:25:56 +0700 Subject: [PATCH 135/817] #635: no negative zero from the flipped tint --- crates/format/src/rest/props.rs | 4 ++-- crates/format/src/rest/tests.rs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/format/src/rest/props.rs b/crates/format/src/rest/props.rs index 0ee2d687b..5fe20c71c 100644 --- a/crates/format/src/rest/props.rs +++ b/crates/format/src/rest/props.rs @@ -208,8 +208,8 @@ fn image(cx: &mut Ctx, p: &Value) -> ImagePaint { saturation: filter("saturation"), temperature: filter("temperature"), // The files' tint runs from green (negative) to magenta (positive), in REST file JSON and - // .fig alike; a positive native tint adds green. - tint: -filter("tint"), + // .fig alike; a positive native tint adds green. (`0 - x`: no negative zero.) + tint: 0.0 - filter("tint"), highlights: filter("highlights"), shadows: filter("shadows"), }, diff --git a/crates/format/src/rest/tests.rs b/crates/format/src/rest/tests.rs index 97e5d8288..281d08960 100644 --- a/crates/format/src/rest/tests.rs +++ b/crates/format/src/rest/tests.rs @@ -194,7 +194,7 @@ fn image_filter_tint_turns_magenta_positive_into_native_green_positive() { "fills": [{"type": "IMAGE", "imageRef": "tint", "filters": {"tint": tint}}] }) }; - let (doc, warnings) = one(json!([rect("Magenta", 0.75), rect("Green", -0.5)])); + let (doc, warnings) = one(json!([rect("Magenta", 0.75), rect("Green", -0.5), rect("Neutral", 0.0)])); let image = |name: &str| { let PaintKind::Image(image) = &named(&doc, name).fills[0].kind else { panic!("{name} is not an image fill") }; image @@ -202,6 +202,7 @@ fn image_filter_tint_turns_magenta_positive_into_native_green_positive() { // The same sign as a `.fig` import (`fig::tests::image_filters`). assert!(close(f64::from(image("Magenta").filters.tint), -0.75)); assert!(close(f64::from(image("Green").filters.tint), 0.5)); + assert!(image("Neutral").filters.tint.is_sign_positive(), "no negative zero"); assert!(!warnings.iter().any(|w| w.contains("approximate renderer")), "{warnings:?}"); } From 02c4d7d8259c44ba536a347502e023cc7cae7a8c Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 14:27:08 +0700 Subject: [PATCH 136/817] #620: test the summary and report of a file opened from data --- crates/ui-egui/src/import_report_tests.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/crates/ui-egui/src/import_report_tests.rs b/crates/ui-egui/src/import_report_tests.rs index bc5fc8bba..8742ccd33 100644 --- a/crates/ui-egui/src/import_report_tests.rs +++ b/crates/ui-egui/src/import_report_tests.rs @@ -185,3 +185,19 @@ fn a_dropped_file_shows_its_report_once_it_opens() { let report = u.app.ui.import_report.as_ref().expect("the dropped file's report"); assert_eq!(report.uid, u.app.session.ds().unwrap().uid); } + +#[test] +fn a_file_opened_from_base64_data_has_a_summary_too() { + use base64::Engine as _; + let file = json!({"document": {"id": "0:0", "name": "From data", "type": "DOCUMENT", "children": [ + {"id": "0:1", "name": "Page 1", "type": "CANVAS", "children": [{"id": "1:1", "name": "No type"}]}]}}); + let data = base64::engine::general_purpose::STANDARD.encode(file.to_string()); + let mut app = FigApp::new(Session::new(), Box::new(NoServices)); + let opened = app.run_user("file.open", json!({"data": data, "name": "Dropped.json"})).unwrap(); + assert_eq!(opened["summary"]["pages"], 1); + let report = app.ui.import_report.as_ref().expect("a report for the REST import"); + assert_eq!(report.pages, Some(1)); + assert!(report.notes.iter().any(|n| n == "layers without a type were skipped"), "{:?}", report.notes); + // Shown as a sentence, worked out once when the report opens. + assert!(report.shown.iter().any(|n| n == "Layers without a type were skipped"), "{:?}", report.shown); +} From 946006f1007c8a17118e50dd496017920a30ad4f Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 14:34:56 +0700 Subject: [PATCH 137/817] #647: leave progress docs to the maintainer's docs PR --- docs/file-format-parity.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 63f281f64..d8e517119 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-14 · **Change:** minor (paste from Figma (desktop); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-14 · **Change:** minor (SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) Every format Figma reads or writes, with FigCraft's support. Sources: `Info.plist` of `/Applications/Figma.app` (document types only; nothing inside the bundle's code was read), Figma's @@ -36,7 +36,7 @@ and prototype interactions are still unchecked there. | BMP | — | yes | | — | | MP4, MOV, WebM (video fills, paid plans) | yes | **no** | shortcut: decoding H.264/HEVC/VP9 needs non-Rust libraries (FFmpeg or each platform's media framework); presenter playback would reuse the animated GIF clock | 4–8 | | Images over 4096 px | downscaled to 4096 | kept | | — | -| Pasted content from other apps | images, SVG, text, Figma clipboard | images, SVG, text, **layers copied in Figma** (desktop; best effort) (newest clipboard content wins) | layers copied in Figma arrive as a `.fig` canvas in the clipboard's HTML; `edit.pasteFromFigma` reads it with the `.fig` import and pastes it as Paste does (into the selected frame, in place or in the view's centre), with `warnings`. Image fills come without their pixels (the clipboard doesn't carry them). Not in the browser (its paste event carries plain text only). Tested on copies written by our own `.fig` export, not yet on real Figma copies | with `.fig` | +| Pasted content from other apps | images, SVG, text, Figma clipboard | images, SVG, text (newest clipboard content wins) | no Figma clipboard (it carries Figma's own binary) | with `.fig` | ## Export @@ -162,7 +162,6 @@ each. | Date | Change | Summary | |---|---|---| -| 2026-10-14 | minor | Paste from Figma (desktop): layers copied in Figma paste as layers. Paste reads the clipboard's HTML; its `.fig` canvas goes through the `.fig` import and lands as Paste places our own layers (`edit.pasteFromFigma`, with `warnings`). Tested on copies written by our own `.fig` export only. Numbers unchanged | | 2026-10-14 | minor | SVG/PDF depth overflow (#208) is checked before bounds and drawing; public checked APIs return the offending root/layer, commands and CLI report it, and no incomplete export replaces an existing file. Tested at depths 255/256/257, with inner roots, hidden branches, masks, raster fallbacks and multiple roots/pages. Numbers unchanged. | | 2026-10-13 | minor | `.fig` export (gap 1): instances write what they change from their main as an override addressed by the main's id (their size, name and paints were lost elsewhere without it), what follows for their layers as derived data, and a scale factor when scaled as a whole; layers of a nested instance swapped for another component keep their overrides; variable collections, modes, variables and their bindings, the modes frames and pages set, shared styles with their links and variable-width strokes are written, and the import reads all of it back (style definitions and unused styles, variable order and scopes, bindings on paint lists, gradient stops, effects and layout grids, page modes, text field bindings, which a `.fig` import used to drop, and width profiles). Opened `.fig` and file JSON documents link nested instances of variants (and any nested instance under a name of its own) to their main's layers; they stayed unlinked, so a second export lost what they changed. Checked by opening written files in other software: resized and scaled instances keep their size and lay their layers out for it, variables with their modes and colour bindings resolve there (a frame set to another mode shows that mode's colours, also inside instances), colour, text, effect and grid styles are listed, and variable-width strokes that are the same on both sides of the path draw with their width; number, string and boolean bindings and bindings on effects, layout guides and gradient stops come across as the values they give but did not show as bound there (their entries now also name the layer field they set, not yet checked there), and strokes wider on one side of the path are written as filled outlines, no longer editable strokes there (the stroke itself is kept as plugin data and our own import puts it back; not yet checked there). Numbers unchanged | | 2026-10-12 | minor | `.fig` export made to open elsewhere (gap 1): the document and its pages say they are visible and opaque (left out, nothing was drawn), the schema in the file uses the format's own names, kinds, field ids and enum values, rectangles are rounded rectangles with four radii, frames and shapes carry their fill outline and plain strokes their stroke outline, text carries its layout settings, font styles use their standard names, line heights that are a share of the font size are raw multipliers, masks keep their type (read back too); the import reads per-side stroke weights whose zero sides are left out. Written files were checked by opening them in other software: layers, fills, gradients, strokes, shadows, vectors, components and text draw as in FigCraft; effects such as glass and noise, images and prototype interactions are still unchecked there, and variables are not written. Numbers unchanged | From 3353d2d5d3c399ec4c586f35ea5ccb0edef8a10a Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 14:34:57 +0700 Subject: [PATCH 138/817] #647: edit.pasteDesignLayers, named neutrally; design data capped at 256 MB before decoding, data accepts wrapped or unpadded base64 --- crates/engine/src/cmd/edit.rs | 51 ++++++++++-------- ...a_paste_tests.rs => design_paste_tests.rs} | 52 ++++++++++++------- crates/engine/src/lib.rs | 4 +- ...a_paste_tests.rs => design_paste_tests.rs} | 0 4 files changed, 65 insertions(+), 42 deletions(-) rename crates/engine/src/{figma_paste_tests.rs => design_paste_tests.rs} (53%) rename crates/ui-egui/src/{figma_paste_tests.rs => design_paste_tests.rs} (100%) diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index 27d9652ef..21f095696 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -26,11 +26,11 @@ pub fn specs() -> Vec { spec!("edit.cut", "Cut", "{ids?}", true, cut), spec!("edit.paste", "Paste", "{parent?, x?, y? (page coordinates of the pasted top-left)}", true, paste), spec!( - "edit.pasteFromFigma", - "Paste from Figma", - "{html (the clipboard's HTML) | data (base64 of the copied buffer), parent?, x?, y?} layers copied in Figma, read like a .fig file (best effort, with `warnings`), pasted as edit.paste pastes", + "edit.pasteDesignLayers", + "Paste design layers", + "{html (the clipboard's HTML) | data (base64 of the clipboard's design data, at most 256 MB), parent?, x?, y?} layers copied from another design app (a .fig canvas in the clipboard's HTML), read like a .fig file (best effort, with `warnings`), pasted as edit.paste pastes", true, - paste_from_figma + paste_design_layers ), spec!("edit.pasteOver", "Paste over selection", "{}", true, paste_over), spec!("edit.pasteReplace", "Paste to replace", "{ids?}", true, paste_replace), @@ -544,35 +544,42 @@ fn copied(doc: &Document, ids: &[NodeId]) -> Copied { (nodes, images, bounds) } -const MAX_FIGMA_CLIP: usize = 512 * 1024 * 1024; +/// The markers around the copied layers in the clipboard's HTML, spelt as that format spells them. +pub const CLIP_OPEN: &str = "(figma)"; +pub const CLIP_CLOSE: &str = "(/figma)"; +/// Largest design data read from the clipboard: the `.fig` import's own canvas cap (256 MB). Its +/// base64 is checked first, so neither the text nor the decoded bytes can pass it. +const MAX_CLIP_DATA: usize = 256 * 1024 * 1024; +const MAX_CLIP_BASE64: usize = MAX_CLIP_DATA.div_ceil(3) * 4; -/// Figma puts the copied layers in the HTML as `(figma)(/figma)`. This gives those bytes. -pub fn figma_clipboard_buffer(html: &str) -> Option> { +/// Base64 `text` (whitespace ignored, padding optional) when it fits [`MAX_CLIP_DATA`]. +fn clip_base64(text: &str) -> Option> { use base64::Engine as _; - const OPEN: &str = "(figma)"; - let start = html.find(OPEN)? + OPEN.len(); - let len = html.get(start..)?.find("(/figma)")?; - let text = html.get(start..start + len)?; - if text.len() > MAX_FIGMA_CLIP { + if text.bytes().filter(|b| !b.is_ascii_whitespace()).count() > MAX_CLIP_BASE64 { return None; } let b64: String = text.chars().filter(|c| !c.is_ascii_whitespace()).collect(); - let bytes = - base64::engine::general_purpose::STANDARD.decode(&b64).or_else(|_| base64::engine::general_purpose::STANDARD_NO_PAD.decode(&b64)).ok()?; + base64::engine::general_purpose::STANDARD.decode(&b64).or_else(|_| base64::engine::general_purpose::STANDARD_NO_PAD.decode(&b64)).ok() +} + +/// Layers copied from another design app travel in the clipboard's HTML as a `.fig` canvas in +/// base64 between [`CLIP_OPEN`] and [`CLIP_CLOSE`]. This gives those bytes, or `None` when the HTML +/// holds no readable design data (it may just mention the marker). +pub fn design_clipboard_buffer(html: &str) -> Option> { + let start = html.find(CLIP_OPEN)? + CLIP_OPEN.len(); + let len = html.get(start..)?.find(CLIP_CLOSE)?; + let bytes = clip_base64(html.get(start..start + len)?)?; figcraft_format::fig::is_fig(&bytes).then_some(bytes) } -fn paste_from_figma(s: &mut Session, p: &Value) -> Result { - const CMD: &str = "edit.pasteFromFigma"; +fn paste_design_layers(s: &mut Session, p: &Value) -> Result { + const CMD: &str = "edit.pasteDesignLayers"; let bytes = match (string(p, "html"), string(p, "data")) { - (Some(html), _) => figma_clipboard_buffer(&html).ok_or_else(|| bad(CMD, "the HTML holds no layers copied in Figma"))?, - (None, Some(d)) => { - use base64::Engine as _; - base64::engine::general_purpose::STANDARD.decode(d.trim()).map_err(|e| bad(CMD, e.to_string()))? - } + (Some(html), _) => design_clipboard_buffer(&html).ok_or_else(|| bad(CMD, "the HTML holds no copied design layers"))?, + (None, Some(d)) => clip_base64(&d).ok_or_else(|| bad(CMD, "`data` is not base64 of at most 256 MB"))?, (None, None) => return Err(bad(CMD, "pass `html` or `data`")), }; - let other = super::file::load_fig(&bytes, "Pasted from Figma").ok_or_else(|| bad(CMD, "the data is not layers copied in Figma"))??; + let other = super::file::load_fig(&bytes, "Pasted layers").ok_or_else(|| bad(CMD, "the data is not copied design layers"))??; let doc = std::sync::Arc::new(other.doc); let tops: Vec = doc.pages.iter().filter_map(|pg| doc.node(*pg)).flat_map(|pg| pg.children.iter().copied()).collect(); if tops.is_empty() { diff --git a/crates/engine/src/figma_paste_tests.rs b/crates/engine/src/design_paste_tests.rs similarity index 53% rename from crates/engine/src/figma_paste_tests.rs rename to crates/engine/src/design_paste_tests.rs index 7468f3ac1..89de80efc 100644 --- a/crates/engine/src/figma_paste_tests.rs +++ b/crates/engine/src/design_paste_tests.rs @@ -1,8 +1,11 @@ +//! Paste of layers copied from another design app: the clipboard's design data (a `.fig` canvas in +//! its HTML) read through the `.fig` import and pasted as Paste pastes our own layers. + use base64::Engine as _; use serde_json::json; use super::*; -use crate::cmd::edit::figma_clipboard_buffer; +use crate::cmd::edit::{CLIP_CLOSE, CLIP_OPEN, design_clipboard_buffer}; const B64: base64::engine::GeneralPurpose = base64::engine::general_purpose::STANDARD; @@ -20,12 +23,9 @@ fn copied_file() -> Vec { } fn clipboard_html(buffer: &[u8]) -> String { - let meta = B64.encode(br#"{"dataType":"scene"}"#); let mut wrapped = B64.encode(buffer); wrapped.insert(8, '\n'); - format!( - r#""# - ) + format!(r#""#) } fn names(s: &Session, ids: &[NodeId]) -> Vec { @@ -36,18 +36,31 @@ fn names(s: &Session, ids: &[NodeId]) -> Vec { #[test] fn buffer_is_found_in_the_html() { let file = copied_file(); - assert_eq!(figma_clipboard_buffer(&clipboard_html(&file)), Some(file)); - assert_eq!(figma_clipboard_buffer("

plain

"), None); - assert_eq!(figma_clipboard_buffer("(figma)not base64!(/figma)"), None); - assert_eq!(figma_clipboard_buffer(&format!("(figma){}(/figma)", B64.encode(b"hello"))), None); - assert_eq!(figma_clipboard_buffer("(figma)ZmlnLQ"), None); + assert_eq!(design_clipboard_buffer(&clipboard_html(&file)), Some(file)); + assert_eq!(design_clipboard_buffer("

plain

"), None); + assert_eq!(design_clipboard_buffer(&format!("{CLIP_OPEN}not base64!{CLIP_CLOSE}")), None); + assert_eq!(design_clipboard_buffer(&format!("{CLIP_OPEN}{}{CLIP_CLOSE}", B64.encode(b"hello"))), None); + assert_eq!(design_clipboard_buffer(&format!("{CLIP_OPEN}ZmlnLQ")), None); + // Web text that only mentions the markers holds no design data. + assert_eq!(design_clipboard_buffer(&format!("

see {CLIP_OPEN} and {CLIP_CLOSE} in the docs

")), None); +} + +#[test] +fn oversized_design_data_is_refused_before_decoding() { + // Just past the cap (256 MB of data, as base64), made of valid base64 characters. + let big = "A".repeat((256 * 1024 * 1024usize).div_ceil(3) * 4 + 4); + assert_eq!(design_clipboard_buffer(&format!("{CLIP_OPEN}{big}{CLIP_CLOSE}")), None); + let mut s = Session::new(); + let e = s.execute("edit.pasteDesignLayers", &json!({ "data": big })).unwrap_err(); + assert!(e.to_string().contains("256 MB"), "{e}"); + assert!(s.clipboard.nodes.is_empty()); } #[test] fn layers_paste_into_the_page_and_undo() { let mut s = Session::new(); let page = s.page().unwrap(); - let r = s.execute("edit.pasteFromFigma", &json!({"html": clipboard_html(&copied_file())})).unwrap(); + let r = s.execute("edit.pasteDesignLayers", &json!({"html": clipboard_html(&copied_file())})).unwrap(); let ids: Vec = r["ids"].as_array().unwrap().iter().map(|v| params::id_of(v).unwrap()).collect(); assert_eq!(names(&s, &ids), ["Card", "Dot"]); assert_eq!(s.selection(), ids); @@ -61,9 +74,12 @@ fn layers_paste_into_the_page_and_undo() { } #[test] -fn a_second_paste_repeats_the_figma_layers() { +fn a_second_paste_repeats_the_copied_layers() { let mut s = Session::new(); - s.execute("edit.pasteFromFigma", &json!({"data": B64.encode(copied_file())})).unwrap(); + // `data` may be wrapped and unpadded, like the HTML's base64. + let mut data = B64.encode(copied_file()).trim_end_matches('=').to_string(); + data.insert(8, '\n'); + s.execute("edit.pasteDesignLayers", &json!({ "data": data })).unwrap(); let r = s.execute("edit.paste", &json!({})).unwrap(); let ids: Vec = r["ids"].as_array().unwrap().iter().map(|v| params::id_of(v).unwrap()).collect(); assert_eq!(names(&s, &ids), ["Card", "Dot"]); @@ -74,7 +90,7 @@ fn pastes_into_the_selected_frame() { let mut s = Session::new(); let host = id(&s.execute("frame.create", &json!({"x": 1000, "y": 0, "width": 800, "height": 600})).unwrap()); s.execute("select.set", &json!({"ids": [host]})).unwrap(); - let r = s.execute("edit.pasteFromFigma", &json!({"html": clipboard_html(&copied_file())})).unwrap(); + let r = s.execute("edit.pasteDesignLayers", &json!({"html": clipboard_html(&copied_file())})).unwrap(); let first = params::id_of(&r["ids"][0]).unwrap(); assert_eq!(s.doc().unwrap().node(first).unwrap().parent, Some(host)); } @@ -83,10 +99,10 @@ fn pastes_into_the_selected_frame() { fn other_content_is_refused_without_changes() { let mut s = Session::new(); let before = s.doc().unwrap().nodes().count(); - assert!(s.execute("edit.pasteFromFigma", &json!({})).is_err()); - assert!(s.execute("edit.pasteFromFigma", &json!({"html": "hi"})).is_err()); - assert!(s.execute("edit.pasteFromFigma", &json!({"data": B64.encode(b"PK not a zip")})).is_err()); - assert!(s.execute("edit.pasteFromFigma", &json!({"data": B64.encode(b"fig-kiwi\x00\x00\x00\x00junk")})).is_err()); + assert!(s.execute("edit.pasteDesignLayers", &json!({})).is_err()); + assert!(s.execute("edit.pasteDesignLayers", &json!({"html": "hi"})).is_err()); + assert!(s.execute("edit.pasteDesignLayers", &json!({"data": B64.encode(b"PK not a zip")})).is_err()); + assert!(s.execute("edit.pasteDesignLayers", &json!({"data": B64.encode(b"fig-kiwi\x00\x00\x00\x00junk")})).is_err()); assert_eq!(s.doc().unwrap().nodes().count(), before); assert!(s.clipboard.nodes.is_empty()); } diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 908c952a7..b124c1e22 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1500,6 +1500,8 @@ mod cursor_tests; #[cfg(test)] mod dark_page_text_tests; #[cfg(test)] +mod design_paste_tests; +#[cfg(test)] mod dev_resources_tests; #[cfg(test)] mod devcompare_tests; @@ -1528,8 +1530,6 @@ mod fig_export_tests; #[cfg(test)] mod fig_import_tests; #[cfg(test)] -mod figma_paste_tests; -#[cfg(test)] mod frame_guides_tests; #[cfg(test)] mod frame_label_tests; diff --git a/crates/ui-egui/src/figma_paste_tests.rs b/crates/ui-egui/src/design_paste_tests.rs similarity index 100% rename from crates/ui-egui/src/figma_paste_tests.rs rename to crates/ui-egui/src/design_paste_tests.rs From d07b55104d54a8c487aa6e17c0557dbeaecb7469 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 14:34:58 +0700 Subject: [PATCH 139/817] #647: paste takes the design path only when the HTML holds readable design data; neutral wording in every catalog --- crates/ui-egui/locales/cs.toml | 2 ++ crates/ui-egui/locales/de.toml | 4 +-- crates/ui-egui/locales/en.toml | 2 +- crates/ui-egui/locales/es.toml | 4 +-- crates/ui-egui/locales/fr.toml | 4 +-- crates/ui-egui/locales/id.toml | 2 ++ crates/ui-egui/locales/ja.toml | 4 +-- crates/ui-egui/locales/ko.toml | 4 +-- crates/ui-egui/locales/pt-BR.toml | 4 +-- crates/ui-egui/locales/ru.toml | 2 ++ crates/ui-egui/locales/sv.toml | 2 ++ crates/ui-egui/locales/tr.toml | 2 ++ crates/ui-egui/locales/zh-Hans.toml | 4 +-- crates/ui-egui/src/design_paste_tests.rs | 34 +++++++++++++++++------- crates/ui-egui/src/lib.rs | 4 +-- crates/ui-egui/src/menus.rs | 12 +++++---- 16 files changed, 59 insertions(+), 31 deletions(-) diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml index 268ff5275..2504193a5 100644 --- a/crates/ui-egui/locales/cs.toml +++ b/crates/ui-egui/locales/cs.toml @@ -930,6 +930,7 @@ status = "draft — needs native review" "Paste a team library link (a view link)" = "Vložte odkaz na týmovou knihovnu (odkaz pro prohlížení)" "Paste here" = "Vložit sem" "Paste to replace" = "Vložit a nahradit" +"Pasted design layers; {n} kinds of content were left out" = { one = "Vloženy vrstvy návrhu; vynechán {n} druh obsahu", few = "Vloženy vrstvy návrhu; vynechány {n} druhy obsahu", other = "Vloženy vrstvy návrhu; vynecháno {n} druhů obsahu" } "Pattern" = "Vzor" "Pattern alignment" = "Zarovnání vzoru" "Pattern scale" = "Měřítko vzoru" @@ -1708,6 +1709,7 @@ status = "draft — needs native review" "edit.duplicate" = "Duplikovat" "edit.findReplace" = "Najít a nahradit" "edit.paste" = "Vložit" +"edit.pasteDesignLayers" = "Vložit vrstvy návrhu" "edit.pasteOver" = "Vložit přes výběr" "edit.pasteProperties" = "Vložit vlastnosti" "edit.pasteReplace" = "Vložit a nahradit" diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index e4749235f..3240a6426 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -899,7 +899,7 @@ status = "draft — needs native review" "Paste a team library link (a view link)" = "Link einer Teambibliothek einfügen (ein Ansichtslink)" "Paste here" = "Hier einfügen" "Paste to replace" = "Zum Ersetzen einfügen" -"Pasted from Figma; {n} kinds of content were left out" = { one = "Aus Figma eingefügt; {n} Art von Inhalt wurde ausgelassen", other = "Aus Figma eingefügt; {n} Arten von Inhalt wurden ausgelassen" } +"Pasted design layers; {n} kinds of content were left out" = { one = "Designebenen eingefügt; {n} Art von Inhalt wurde ausgelassen", other = "Designebenen eingefügt; {n} Arten von Inhalt wurden ausgelassen" } "Pattern" = "Muster" "Pattern alignment" = "Musterausrichtung" "Pattern scale" = "Musterskalierung" @@ -1655,7 +1655,7 @@ status = "draft — needs native review" "edit.duplicate" = "Duplizieren" "edit.findReplace" = "Suchen und ersetzen" "edit.paste" = "Einfügen" -"edit.pasteFromFigma" = "Aus Figma einfügen" +"edit.pasteDesignLayers" = "Designebenen einfügen" "edit.pasteOver" = "Über Auswahl einfügen" "edit.pasteProperties" = "Eigenschaften einfügen" "edit.pasteReplace" = "Zum Ersetzen einfügen" diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index def0b8275..627d01558 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -945,7 +945,7 @@ name = "English" "Paste a team library link (a view link)" = "Paste a team library link (a view link)" "Paste here" = "Paste here" "Paste to replace" = "Paste to replace" -"Pasted from Figma; {n} kinds of content were left out" = { one = "Pasted from Figma; {n} kind of content was left out", other = "Pasted from Figma; {n} kinds of content were left out" } +"Pasted design layers; {n} kinds of content were left out" = { one = "Pasted design layers; {n} kind of content was left out", other = "Pasted design layers; {n} kinds of content were left out" } "Pattern" = "Pattern" "Pattern alignment" = "Pattern alignment" "Pattern scale" = "Pattern scale" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 38c868b63..a6bbb17a6 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -946,7 +946,7 @@ status = "draft — needs native review" "Paste a team library link (a view link)" = "Pega el enlace de una biblioteca de equipo (de lectura)" "Paste here" = "Pegar aquí" "Paste to replace" = "Pegar para reemplazar" -"Pasted from Figma; {n} kinds of content were left out" = { one = "Pegado desde Figma; se omitió {n} tipo de contenido", other = "Pegado desde Figma; se omitieron {n} tipos de contenido" } +"Pasted design layers; {n} kinds of content were left out" = { one = "Capas de diseño pegadas; se omitió {n} tipo de contenido", other = "Capas de diseño pegadas; se omitieron {n} tipos de contenido" } "Pattern" = "Patrón" "Pattern alignment" = "Alineación del patrón" "Pattern scale" = "Escala del patrón" @@ -1734,7 +1734,7 @@ status = "draft — needs native review" "edit.duplicate" = "Duplicar" "edit.findReplace" = "Buscar y reemplazar" "edit.paste" = "Pegar" -"edit.pasteFromFigma" = "Pegar desde Figma" +"edit.pasteDesignLayers" = "Pegar capas de diseño" "edit.pasteOver" = "Pegar sobre la selección" "edit.pasteProperties" = "Pegar propiedades" "edit.pasteReplace" = "Pegar para reemplazar" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 2f5ae5b9f..8074a0060 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -893,7 +893,7 @@ status = "draft — needs native review" "Paste a team library link (a view link)" = "Collez le lien d’une bibliothèque d’équipe (un lien de consultation)" "Paste here" = "Coller ici" "Paste to replace" = "Coller pour remplacer" -"Pasted from Figma; {n} kinds of content were left out" = { one = "Collé depuis Figma ; {n} type de contenu a été omis", other = "Collé depuis Figma ; {n} types de contenu ont été omis" } +"Pasted design layers; {n} kinds of content were left out" = { one = "Calques de design collés ; {n} type de contenu a été omis", other = "Calques de design collés ; {n} types de contenu ont été omis" } "Pattern" = "Motif" "Pattern alignment" = "Alignement du motif" "Pattern scale" = "Échelle du motif" @@ -1646,7 +1646,7 @@ status = "draft — needs native review" "edit.duplicate" = "Dupliquer" "edit.findReplace" = "Rechercher et remplacer" "edit.paste" = "Coller" -"edit.pasteFromFigma" = "Coller depuis Figma" +"edit.pasteDesignLayers" = "Coller des calques de design" "edit.pasteOver" = "Coller par-dessus la sélection" "edit.pasteProperties" = "Coller les propriétés" "edit.pasteReplace" = "Coller pour remplacer" diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml index 5de7634d4..c39cd73fb 100644 --- a/crates/ui-egui/locales/id.toml +++ b/crates/ui-egui/locales/id.toml @@ -934,6 +934,7 @@ status = "draft — needs native review" "Paste a team library link (a view link)" = "Tempel link pustaka tim (link akses lihat)" "Paste here" = "Tempel di sini" "Paste to replace" = "Tempel dan ganti" +"Pasted design layers; {n} kinds of content were left out" = { other = "Layer desain ditempel; {n} jenis konten tidak disertakan" } "Pattern" = "Pola" "Pattern alignment" = "Perataan pola" "Pattern scale" = "Skala pola" @@ -1712,6 +1713,7 @@ status = "draft — needs native review" "edit.duplicate" = "Duplikat" "edit.findReplace" = "Cari dan ganti" "edit.paste" = "Tempel" +"edit.pasteDesignLayers" = "Tempel layer desain" "edit.pasteOver" = "Tempel di atas pilihan" "edit.pasteProperties" = "Tempel properti" "edit.pasteReplace" = "Tempel dan ganti" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index 493bf9995..bb6938de2 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -939,7 +939,7 @@ status = "draft — needs native review" "Paste a team library link (a view link)" = "チームライブラリのリンク(閲覧リンク)を貼り付け" "Paste here" = "ここに貼り付け" "Paste to replace" = "貼り付けて置換" -"Pasted from Figma; {n} kinds of content were left out" = { other = "Figma から貼り付け済み。{n} 種類のコンテンツは含まれていない" } +"Pasted design layers; {n} kinds of content were left out" = { other = "デザインレイヤーを貼り付け済み。{n} 種類のコンテンツは含まれていない" } "Pattern" = "パターン" "Pattern alignment" = "パターンの配置" "Pattern scale" = "パターンの拡大縮小" @@ -1724,7 +1724,7 @@ status = "draft — needs native review" "edit.duplicate" = "複製" "edit.findReplace" = "検索と置換" "edit.paste" = "貼り付け" -"edit.pasteFromFigma" = "Figma から貼り付け" +"edit.pasteDesignLayers" = "デザインレイヤーを貼り付け" "edit.pasteOver" = "選択範囲の上に貼り付け" "edit.pasteProperties" = "プロパティを貼り付け" "edit.pasteReplace" = "貼り付けて置換" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index 253cc54ed..65e9296c1 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -893,7 +893,7 @@ status = "draft — needs native review" "Paste a team library link (a view link)" = "팀 라이브러리 링크(보기 링크) 붙여 넣기" "Paste here" = "여기에 붙여 넣기" "Paste to replace" = "붙여 넣어 바꾸기" -"Pasted from Figma; {n} kinds of content were left out" = { other = "Figma에서 붙여 넣음. 콘텐츠 {n}종은 제외됨" } +"Pasted design layers; {n} kinds of content were left out" = { other = "디자인 레이어를 붙여 넣음. 콘텐츠 {n}종은 제외됨" } "Pattern" = "패턴" "Pattern alignment" = "패턴 정렬" "Pattern scale" = "패턴 배율" @@ -1646,7 +1646,7 @@ status = "draft — needs native review" "edit.duplicate" = "복제" "edit.findReplace" = "찾기 및 바꾸기" "edit.paste" = "붙여 넣기" -"edit.pasteFromFigma" = "Figma에서 붙여 넣기" +"edit.pasteDesignLayers" = "디자인 레이어 붙여 넣기" "edit.pasteOver" = "선택 항목 위에 붙여 넣기" "edit.pasteProperties" = "속성 붙여 넣기" "edit.pasteReplace" = "붙여 넣어 바꾸기" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index 12e7c0b27..b6d21e02f 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -892,7 +892,7 @@ status = "draft — needs native review" "Paste a team library link (a view link)" = "Cole o link de uma biblioteca de equipe (um link de visualização)" "Paste here" = "Colar aqui" "Paste to replace" = "Colar para substituir" -"Pasted from Figma; {n} kinds of content were left out" = { one = "Colado do Figma; {n} tipo de conteúdo ficou de fora", other = "Colado do Figma; {n} tipos de conteúdo ficaram de fora" } +"Pasted design layers; {n} kinds of content were left out" = { one = "Camadas de design coladas; {n} tipo de conteúdo ficou de fora", other = "Camadas de design coladas; {n} tipos de conteúdo ficaram de fora" } "Pattern" = "Padrão" "Pattern alignment" = "Alinhamento do padrão" "Pattern scale" = "Escala do padrão" @@ -1645,7 +1645,7 @@ status = "draft — needs native review" "edit.duplicate" = "Duplicar" "edit.findReplace" = "Localizar e substituir" "edit.paste" = "Colar" -"edit.pasteFromFigma" = "Colar do Figma" +"edit.pasteDesignLayers" = "Colar camadas de design" "edit.pasteOver" = "Colar sobre a seleção" "edit.pasteProperties" = "Colar propriedades" "edit.pasteReplace" = "Colar para substituir" diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 3ab407572..7a64557ec 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -931,6 +931,7 @@ name = "Русский" "Paste a team library link (a view link)" = "Вставьте ссылку на командную библиотеку (для просмотра)" "Paste here" = "Вставить здесь" "Paste to replace" = "Вставить с заменой" +"Pasted design layers; {n} kinds of content were left out" = { one = "Слои дизайна вставлены; пропущен {n} тип содержимого", few = "Слои дизайна вставлены; пропущены {n} типа содержимого", many = "Слои дизайна вставлены; пропущено {n} типов содержимого", other = "Слои дизайна вставлены; пропущено {n} типа содержимого" } "Pattern" = "Паттерн" "Pattern alignment" = "Выравнивание паттерна" "Pattern scale" = "Масштаб паттерна" @@ -1709,6 +1710,7 @@ name = "Русский" "edit.duplicate" = "Дублировать" "edit.findReplace" = "Найти и заменить" "edit.paste" = "Вставить" +"edit.pasteDesignLayers" = "Вставить слои дизайна" "edit.pasteOver" = "Вставить поверх выделения" "edit.pasteProperties" = "Вставить свойства" "edit.pasteReplace" = "Вставить с заменой" diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index f7b2999d6..c3b7f746b 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -932,6 +932,7 @@ name = "Svenska" "Paste a team library link (a view link)" = "Klistra in en länk till ett teambibliotek (en visningslänk)" "Paste here" = "Klistra in här" "Paste to replace" = "Klistra in och ersätt" +"Pasted design layers; {n} kinds of content were left out" = { one = "Designlager inklistrade; {n} typ av innehåll utelämnades", other = "Designlager inklistrade; {n} typer av innehåll utelämnades" } "Pattern" = "Mönster" "Pattern alignment" = "Mönsterjustering" "Pattern scale" = "Mönsterskala" @@ -1591,6 +1592,7 @@ name = "Svenska" "edit.duplicate" = "Duplicera" "edit.findReplace" = "Sök och ersätt" "edit.paste" = "Klistra in" +"edit.pasteDesignLayers" = "Klistra in designlager" "edit.pasteOver" = "Klistra in över" "edit.pasteProperties" = "Klistra in egenskaper" "edit.pasteReplace" = "Klistra in och ersätt" diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml index a2be6b99c..531b65262 100644 --- a/crates/ui-egui/locales/tr.toml +++ b/crates/ui-egui/locales/tr.toml @@ -934,6 +934,7 @@ name = "Türkçe" "Paste a team library link (a view link)" = "Bir ekip kitaplığı bağlantısı yapıştırın (görüntüleme bağlantısı)" "Paste here" = "Buraya yapıştır" "Paste to replace" = "Değiştirmek için yapıştır" +"Pasted design layers; {n} kinds of content were left out" = { other = "Tasarım katmanları yapıştırıldı; {n} tür içerik dışarıda bırakıldı" } "Pattern" = "Desen" "Pattern alignment" = "Desen hizalaması" "Pattern scale" = "Desen ölçeği" @@ -1712,6 +1713,7 @@ name = "Türkçe" "edit.duplicate" = "Çoğalt" "edit.findReplace" = "Bul ve değiştir" "edit.paste" = "Yapıştır" +"edit.pasteDesignLayers" = "Tasarım katmanlarını yapıştır" "edit.pasteOver" = "Seçimin üzerine yapıştır" "edit.pasteProperties" = "Özellikleri yapıştır" "edit.pasteReplace" = "Değiştirmek için yapıştır" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index 91c251eca..153865bd7 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -894,7 +894,7 @@ status = "draft — needs native review" "Paste a team library link (a view link)" = "粘贴团队库链接(查看链接)" "Paste here" = "粘贴到此处" "Paste to replace" = "粘贴以替换" -"Pasted from Figma; {n} kinds of content were left out" = { other = "已从 Figma 粘贴;有 {n} 类内容未包含" } +"Pasted design layers; {n} kinds of content were left out" = { other = "已粘贴设计图层;有 {n} 类内容未包含" } "Pattern" = "图案" "Pattern alignment" = "图案对齐" "Pattern scale" = "图案缩放" @@ -1647,7 +1647,7 @@ status = "draft — needs native review" "edit.duplicate" = "创建副本" "edit.findReplace" = "查找和替换" "edit.paste" = "粘贴" -"edit.pasteFromFigma" = "从 Figma 粘贴" +"edit.pasteDesignLayers" = "粘贴设计图层" "edit.pasteOver" = "粘贴到所选项上方" "edit.pasteProperties" = "粘贴属性" "edit.pasteReplace" = "粘贴以替换" diff --git a/crates/ui-egui/src/design_paste_tests.rs b/crates/ui-egui/src/design_paste_tests.rs index 6147ba5e4..ad33e0059 100644 --- a/crates/ui-egui/src/design_paste_tests.rs +++ b/crates/ui-egui/src/design_paste_tests.rs @@ -1,4 +1,5 @@ use figcraft_engine::Session; +use figcraft_engine::cmd::edit::{CLIP_CLOSE, CLIP_OPEN}; use serde_json::json; use crate::{FigApp, Services}; @@ -17,11 +18,12 @@ impl Services for Clip { } } -fn figma_html() -> String { +/// The HTML another design app puts on the clipboard for copied layers (a `.fig` canvas inside). +fn copied_html() -> String { let mut s = Session::new(); - s.execute("node.create", &json!({"type": "rectangle", "x": 0, "y": 0, "width": 40, "height": 20, "name": "From Figma"})).unwrap(); + s.execute("node.create", &json!({"type": "rectangle", "x": 0, "y": 0, "width": 40, "height": 20, "name": "Copied layer"})).unwrap(); let r = s.execute("file.export", &json!({"format": "fig"})).unwrap(); - format!(r#""#, r["data"].as_str().unwrap()) + format!(r#""#, r["data"].as_str().unwrap()) } fn selected_names(app: &FigApp) -> Vec { @@ -29,12 +31,18 @@ fn selected_names(app: &FigApp) -> Vec { app.session.selection().iter().map(|i| doc.node(*i).unwrap().name.clone()).collect() } +fn pasted_text(app: &FigApp) -> String { + let doc = app.session.doc().unwrap(); + let id = app.session.selection()[0]; + doc.node(id).unwrap().kind.text().unwrap().characters.clone() +} + #[test] -fn paste_takes_layers_copied_in_figma() { - let html = figma_html(); +fn paste_takes_layers_copied_in_another_design_app() { + let html = copied_html(); let mut app = FigApp::new(Session::new(), Box::new(Clip { html, text: Some(String::new()) })); crate::menus::paste(&mut app, None); - assert_eq!(selected_names(&app), ["From Figma"]); + assert_eq!(selected_names(&app), ["Copied layer"]); } #[test] @@ -42,7 +50,15 @@ fn html_from_other_apps_pastes_as_before() { let clip = Clip { html: "Hello".into(), text: Some("Hello".into()) }; let mut app = FigApp::new(Session::new(), Box::new(clip)); crate::menus::paste(&mut app, None); - let doc = app.session.doc().unwrap(); - let id = app.session.selection()[0]; - assert_eq!(doc.node(id).unwrap().kind.text().unwrap().characters, "Hello"); + assert_eq!(pasted_text(&app), "Hello"); +} + +#[test] +fn html_that_only_mentions_the_marker_pastes_its_text() { + let text = format!("Markers {CLIP_OPEN} and {CLIP_CLOSE} explained"); + let clip = Clip { html: format!("

{text}

"), text: Some(text.clone()) }; + let mut app = FigApp::new(Session::new(), Box::new(clip)); + crate::menus::paste(&mut app, None); + assert_eq!(pasted_text(&app), text); + assert!(app.ui.last_error.is_none(), "{:?}", app.ui.last_error); } diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 04fe38611..e325f4df6 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -86,6 +86,8 @@ mod comments_tests; #[cfg(test)] mod cursors_tests; #[cfg(test)] +mod design_paste_tests; +#[cfg(test)] mod dev_mode_tests; #[cfg(test)] mod duplicate_paint_tests; @@ -94,8 +96,6 @@ mod export_preview_tests; #[cfg(test)] mod field_tests; #[cfg(test)] -mod figma_paste_tests; -#[cfg(test)] mod frame_label_tests; #[cfg(test)] mod gap_handle_tests; diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 36dfd2379..8bd98cc5d 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -31,14 +31,16 @@ pub const UI_COMMANDS: &[&str] = &[ /// Run a menu item: some open dialogs or use platform services, the rest go to the engine. /// Paste: the system clipboard wins when it holds something newer than our own copy (layers copied -/// in Figma, 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). +/// 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). pub fn paste(app: &mut FigApp, event_text: Option<&str>) { - if let Some(html) = app.services.clipboard_get_html().filter(|h| h.contains("(figma)")) { - if let Some(r) = app.run("edit.pasteFromFigma", json!({"html": html})) { + // Only HTML that holds readable design data takes this path; other HTML pastes as before. + if let Some(html) = app.services.clipboard_get_html().filter(|h| figcraft_engine::cmd::edit::design_clipboard_buffer(h).is_some()) { + if let Some(r) = app.run("edit.pasteDesignLayers", json!({"html": html})) { let left_out = r["warnings"].as_array().map_or(0, Vec::len); if left_out > 0 { - app.toast(trn("Pasted from Figma; {n} kinds of content were left out", left_out, &[])); + app.toast(trn("Pasted design layers; {n} kinds of content were left out", left_out, &[])); } } return; From 25e9be3936f15dd67ae034e4debbbd3832817416 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 14:49:48 +0700 Subject: [PATCH 140/817] #693: clipboard reads on Linux and the BSDs give up after 2 s A Wayland clipboard read waits on the app that copied with no timeout of its own. The read now runs on a helper thread with its own clipboard handle, so a stuck app can't hang the window. --- apps/figcraft/src/services.rs | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/apps/figcraft/src/services.rs b/apps/figcraft/src/services.rs index bd8a42043..56b14d961 100644 --- a/apps/figcraft/src/services.rs +++ b/apps/figcraft/src/services.rs @@ -223,6 +223,28 @@ fn picked(pick: impl Future> + 'static) -> Dial Box::pin(async move { pick.await.map(|f| f.path().to_path_buf()) }) } +/// How long a clipboard read may wait on the app that copied (Linux and the BSDs). +#[cfg(all(unix, not(target_os = "macos")))] +const CLIPBOARD_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(2); + +/// Read the clipboard. On Linux and the BSDs the read runs on a helper thread with its own handle +/// and gives up after [`CLIPBOARD_TIMEOUT`]: a Wayland read waits on the app that copied with no +/// timeout of its own, so an app that hangs must not hang the window too. +#[cfg(all(unix, not(target_os = "macos")))] +fn read_clipboard(_: &mut arboard::Clipboard, read: fn(&mut arboard::Clipboard) -> Option) -> Option { + let (tx, rx) = std::sync::mpsc::channel(); + std::thread::spawn(move || { + let _ = tx.send(arboard::Clipboard::new().ok().and_then(|mut c| read(&mut c))); + }); + rx.recv_timeout(CLIPBOARD_TIMEOUT).ok().flatten() +} + +/// Read the clipboard (the system's own reads don't wait on the app that copied). +#[cfg(not(all(unix, not(target_os = "macos"))))] +fn read_clipboard(c: &mut arboard::Clipboard, read: fn(&mut arboard::Clipboard) -> Option) -> Option { + read(c) +} + impl Services for Desktop { fn pick_open(&mut self, title: &str, exts: &[&str]) -> DialogFuture { picked(dialog(title).add_filter("Supported files", exts).pick_file()) @@ -239,7 +261,7 @@ impl Services for Desktop { } } fn clipboard_get_text(&mut self) -> Option { - self.clipboard.as_mut()?.get_text().ok() + read_clipboard(self.clipboard.as_mut()?, |c| c.get_text().ok()) } fn clipboard_set_png(&mut self, w: u32, h: u32, rgba: &[u8]) { if let Some(c) = self.clipboard.as_mut() { @@ -247,7 +269,7 @@ impl Services for Desktop { } } fn clipboard_get_image(&mut self) -> Option<(u32, u32, Vec)> { - let img = self.clipboard.as_mut()?.get_image().ok()?; + let img = read_clipboard(self.clipboard.as_mut()?, |c| c.get_image().ok())?; let (w, h) = (u32::try_from(img.width).ok()?, u32::try_from(img.height).ok()?); // Refuse absurd sizes (and mismatched buffers) rather than allocate. if w == 0 || h == 0 || u64::from(w) * u64::from(h) > 100_000_000 || img.bytes.len() != (w as usize) * (h as usize) * 4 { From ef684c5df4bbde407400194260aa537c2636cbc5 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 14:58:06 +0700 Subject: [PATCH 141/817] #691: leave the parity docs to the maintainers' docs PR --- 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 a8dfab696..62001715e 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -48,7 +48,7 @@ interaction feel not yet compared. | Item | Status | Notes | |---|---|---| -| Click, Shift-click, marquee, Shift-marquee toggle | done | a marquee selects what it touches; from a top-level frame's background, the layers inside it; locked and hidden layers are skipped; Shift-click takes a selected layer out on release, so a Shift-drag on it moves the selection along one axis instead (`selection_behaviour_tests`) | +| Click, Shift-click, marquee, Shift-marquee toggle | done | 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 | | | Enter / Shift+Enter (children / parent), Tab / Shift+Tab (siblings) | done | Tab renames the next layer while renaming | From 22a821c7420b8a7ba3bf937adea829b778150756 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 15:03:02 +0700 Subject: [PATCH 142/817] #657: leave the roadmap to the maintainers' docs PR --- docs/roadmap.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/roadmap.md b/docs/roadmap.md index 680c5b68d..9e9eaec9f 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # FigCraft roadmap: milestones and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (points dropped on a point merge (#401); community fixes from #478 up and a control-channel fix (#589); recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading, SVG import budgets, Leptos code, full screen, server snapshots, owner-only preferences, ruzstd 0.9.1, layer cycle repair, batch rollback, Direct3D 12 on Windows, plugin metering; vector edit mode regions: hover hatch, selection and drag; repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` import, best effort; 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 ~79%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (community fixes from #478 up and a control-channel fix (#589); recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading, SVG import budgets, Leptos code, full screen, server snapshots, owner-only preferences, ruzstd 0.9.1, layer cycle repair, batch rollback, Direct3D 12 on Windows, plugin metering; vector edit mode regions: hover hatch, selection and drag; repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` import, best effort; 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 ~79%) · **Target:** Figma Design (desktop app 126.10.7) Forward-looking plan. Where FigCraft stands today: [`ROADMAP.md`](../ROADMAP.md) and [`target-app-parity.md`](target-app-parity.md); the full ranked list: [`gaps.md`](gaps.md). Hours @@ -73,7 +73,6 @@ blockers. | Date | Change | Summary | |---|---|---| -| 2026-10-16 | minor | Points dropped on a point merge (M4, #401): in vector edit mode a point dragged onto another point of its path snapped there but stayed a separate point, so the path couldn't be closed or joined by dragging. Dropped within the point hit radius (6 px) of another point, a single dragged point now merges into it in the same undo step as the move, and that point stays selected; an open path's end dropped on its start closes it. Join (Cmd+J) still merges selected points that overlap. Regression test in the vector edit tests. Numbers unchanged | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | | 2026-10-14 | minor | M7: the Small caps button in Type settings showed a box where the UI font has no small-capital `ɢ` (builds without Inter use egui's fonts); its sample is now a capital and a smaller capital, drawn from ordinary letters every UI font has. Numbers unchanged | | 2026-10-14 | minor | M7: Home screen recent files as cards: each card shows the picture its file carries on its first page's colour, the file's icon, name and "Edited ... ago"; sort by name, creation or last change either way; a table view; a click selects, a double-click or Enter opens, arrow keys move; Open, Show in folder and Remove from recents on right-click. Numbers unchanged. | From 58de7d4daba16ab95393bb0732b6ba4afffbed94 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 15:06:37 +0700 Subject: [PATCH 143/817] #657: a drop that would leave no segment only moves the point Dropping one end of a 2-point line on the other left a 1-point vector. --- crates/engine/src/vectoredit/pointer.rs | 8 +++++++- crates/engine/src/vectoredit/tests.rs | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/vectoredit/pointer.rs b/crates/engine/src/vectoredit/pointer.rs index a42b06038..6667a2096 100644 --- a/crates/engine/src/vectoredit/pointer.rs +++ b/crates/engine/src/vectoredit/pointer.rs @@ -1082,10 +1082,16 @@ impl Session { else { return Ok(()); }; + let mut merged = net.clone(); + ops::merge_vertices(&mut merged, keep, v); + // A merge that would leave no segment (a 2-point line's ends dropped together) only moves. + if merged.segments.is_empty() { + return Ok(()); + } // The preview starts again from the document before the drag: bring the moved layer. self.preview(|doc, _| { *doc.get_mut(id)? = moved; - edit(doc, id, |net| ops::merge_vertices(net, keep, v)) + edit(doc, id, |net| *net = merged) })?; set_state(self, |e| { e.vertices = vec![if keep > v { keep - 1 } else { keep }]; diff --git a/crates/engine/src/vectoredit/tests.rs b/crates/engine/src/vectoredit/tests.rs index 63469d673..0eba28e3d 100644 --- a/crates/engine/src/vectoredit/tests.rs +++ b/crates/engine/src/vectoredit/tests.rs @@ -300,6 +300,14 @@ fn a_point_dropped_on_another_merges_into_it() { ex(&mut s, "vector.edit.select", json!({"vertices": []})); drag(&mut s, (0.0, 100.0), (0.0, 50.0)); assert_eq!(net(&s, id).vertices.len(), 4); + // A 2-point line's end dropped on its other end only moves: no segment would be left. + let mut s = Session::new(); + let r = ex(&mut s, "vector.create", json!({"points": [[0, 0], [100, 0]]})); + let id = crate::params::id_of(&r["id"]).unwrap(); + ex(&mut s, "vector.edit.begin", json!({"id": id})); + drag(&mut s, (100.0, 0.0), (2.0, 0.0)); + let n = net(&s, id); + assert_eq!((n.vertices.len(), n.segments.len()), (2, 1), "still a line: {n:?}"); } #[test] From bbfc408ab8ceb4553fe1cfd9b0ee8c9f5b935b4d Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 15:06:47 +0700 Subject: [PATCH 144/817] #654: leave the roadmap to the maintainers' docs PR --- docs/roadmap.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/roadmap.md b/docs/roadmap.md index 8acce139a..9e9eaec9f 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # FigCraft roadmap: milestones and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (Flatten keeps open paths (#377); community fixes from #478 up and a control-channel fix (#589); recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading, SVG import budgets, Leptos code, full screen, server snapshots, owner-only preferences, ruzstd 0.9.1, layer cycle repair, batch rollback, Direct3D 12 on Windows, plugin metering; vector edit mode regions: hover hatch, selection and drag; repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` import, best effort; 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 ~79%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (community fixes from #478 up and a control-channel fix (#589); recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading, SVG import budgets, Leptos code, full screen, server snapshots, owner-only preferences, ruzstd 0.9.1, layer cycle repair, batch rollback, Direct3D 12 on Windows, plugin metering; vector edit mode regions: hover hatch, selection and drag; repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` import, best effort; 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 ~79%) · **Target:** Figma Design (desktop app 126.10.7) Forward-looking plan. Where FigCraft stands today: [`ROADMAP.md`](../ROADMAP.md) and [`target-app-parity.md`](target-app-parity.md); the full ranked list: [`gaps.md`](gaps.md). Hours @@ -73,7 +73,6 @@ blockers. | Date | Change | Summary | |---|---|---| -| 2026-10-16 | minor | Flatten keeps open paths (M4, #377): Flatten (Cmd+E, Alt+Shift+F) and Join selection (Cmd+J) built the result from each layer's fill outline, so open paths, which have none, were dropped: two pen paths flattened to "nothing to flatten", and next to a closed shape they vanished. Vectors now bring their own network (open paths, unfilled loops and each region's winding stay), mapped into the parent's space; other layers still flatten to their outline. Regression test in the shapes behaviour tests. Numbers unchanged | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | | 2026-10-14 | minor | M7: the Small caps button in Type settings showed a box where the UI font has no small-capital `ɢ` (builds without Inter use egui's fonts); its sample is now a capital and a smaller capital, drawn from ordinary letters every UI font has. Numbers unchanged | | 2026-10-14 | minor | M7: Home screen recent files as cards: each card shows the picture its file carries on its first page's colour, the file's icon, name and "Edited ... ago"; sort by name, creation or last change either way; a table view; a click selects, a double-click or Enter opens, arrow keys move; Open, Show in folder and Remove from recents on right-click. Numbers unchanged. | From 426217327b1a569837cb771a1fa86db91d7d5a6b Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 15:11:23 +0700 Subject: [PATCH 145/817] #647: text copied in another app after a design paste pastes as text again --- crates/ui-egui/src/design_paste_tests.rs | 23 +++++++++++++++++++++++ crates/ui-egui/src/menus.rs | 2 ++ 2 files changed, 25 insertions(+) diff --git a/crates/ui-egui/src/design_paste_tests.rs b/crates/ui-egui/src/design_paste_tests.rs index ad33e0059..3174275a5 100644 --- a/crates/ui-egui/src/design_paste_tests.rs +++ b/crates/ui-egui/src/design_paste_tests.rs @@ -62,3 +62,26 @@ fn html_that_only_mentions_the_marker_pastes_its_text() { assert_eq!(pasted_text(&app), text); assert!(app.ui.last_error.is_none(), "{:?}", app.ui.last_error); } + +/// A clipboard whose contents the test replaces between pastes. +struct SharedClip(std::rc::Rc>); + +impl Services for SharedClip { + fn clipboard_get_html(&mut self) -> Option { + Some(self.0.borrow().html.clone()) + } + fn clipboard_get_text(&mut self) -> Option { + self.0.borrow().text.clone() + } +} + +#[test] +fn text_copied_after_a_design_paste_pastes_as_text() { + let clip = std::rc::Rc::new(std::cell::RefCell::new(Clip { html: copied_html(), text: None })); + let mut app = FigApp::new(Session::new(), Box::new(SharedClip(clip.clone()))); + crate::menus::paste(&mut app, None); + assert_eq!(selected_names(&app), ["Copied layer"]); + *clip.borrow_mut() = Clip { html: String::new(), text: Some("Fresh text".into()) }; + crate::menus::paste(&mut app, None); + assert_eq!(pasted_text(&app), "Fresh text"); +} diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 8bd98cc5d..8e86953c2 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -38,6 +38,8 @@ pub fn paste(app: &mut FigApp, event_text: Option<&str>) { // Only HTML that holds readable design data takes this path; other HTML pastes as before. if let Some(html) = app.services.clipboard_get_html().filter(|h| figcraft_engine::cmd::edit::design_clipboard_buffer(h).is_some()) { if let Some(r) = app.run("edit.pasteDesignLayers", json!({"html": html})) { + // The pasted layers are now our copy: text another app puts on the clipboard later is newer. + app.ui.last_copy = Some(app.services.clipboard_get_text().unwrap_or_default()); let left_out = r["warnings"].as_array().map_or(0, Vec::len); if left_out > 0 { app.toast(trn("Pasted design layers; {n} kinds of content were left out", left_out, &[])); From 45b154e40b2217af232fe7ce1c5c573a52077784 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 15:20:08 +0700 Subject: [PATCH 146/817] #707: drop the unrelated .gitignore line and the parity doc edit --- .gitignore | 2 -- docs/ui-parity.md | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 3709c74a6..928d6b498 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,3 @@ plans/ /log/ .DS_Store *.profraw - -plugins/target/ diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 4a7bf45be..62001715e 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -19,7 +19,7 @@ interaction feel not yet compared. | Light and dark themes | done | colours from `theme::Tokens`; a file or a page made while the dark theme shows gets a `#1E1E1E` page (`#F5F5F5` in the light theme), its own from then on: changing the theme repaints no page and opened files keep theirs; the file the app opens with takes the theme once it is known; the CLI, MCP and exports have no theme and keep `#F5F5F5`; text drawn with the Text tool is white on a dark page and black on a light one (so is text a command makes in the app without naming a fill; headless sessions keep black) (`theme_pages_tests`, `dark_page_text_tests`) | | Minimize UI (Cmd+\\) | done | | | Resizable panels | done | each panel's edge drags its width (left 200–480, right 240–480, 240 by default; a double-click on the edge or View ▸ Panels ▸ Reset panel widths puts the default back); the widths are each window's own, the main window's are kept in the preferences when a drag ends and come back at the next start, a new window opens with those of the window it comes from; Minimize UI hides the panels and brings them back as they were; the view keeps its centre and zoom while a panel is resized; in a window too small for them the panels give way so the canvas keeps 160 px (the left one first), down to the smallest window (800×500) (`panel_width_tests`). Not compared with Figma's widths; no snap points | -| Actions palette (Cmd+K, Cmd+/) | done | tabs (All, Assets, Plugins & widgets), Recents kept in the preferences, commands grouped by menu, this file's components (placed at the view centre) and styles (applied to the selection), installed plugins and widgets with letter tiles; rows carry icons and shortcut hints (`palette_tests`) | +| Actions palette (Cmd+K, Cmd+/) | done | commands; no assets search parity | | Context menus | done | canvas and layers; Shift+F10 opens them from the keyboard (at the focused layer row or below the canvas selection) and the menu takes the keyboard; the Menu key isn't delivered by the windowing layer (egui 0.36 has no key for it) | | 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 | From 3a8e6e2860c082ec32df56718caa9af73ffc75ba Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 15:20:08 +0700 Subject: [PATCH 147/817] #707: search every command, ranked; a highlight for Enter; recents from the palette only - A search covers every command again (the engine's and the UI's own), grouped by menu where one lists it and under Other otherwise, best matches first (prefix, then shortest), at most 60. Without a query the menus' items show as before. - Up and Down move a visible highlight (the pointer moves it too); Enter runs the highlighted row, not an invisible first one. - Only runs from the palette are kept as Recents; menus, shortcuts and context menus no longer write the preferences. Recents match the translated label. - The Plugins menu's items (run last, manage, import) show with the plugins. - The search keeps its hint, so every catalog keeps its translation. - The panel sits above the toolbar pill's own rect (toolbar::pill_rect); one set_palette/toggle_palette opens it from every entry point. - Clippy: needless borrows in the toolbar. --- crates/ui-egui/locales/cs.toml | 1 + crates/ui-egui/locales/de.toml | 1 + crates/ui-egui/locales/en.toml | 3 +- crates/ui-egui/locales/es.toml | 5 +- crates/ui-egui/locales/fr.toml | 1 + crates/ui-egui/locales/id.toml | 1 + crates/ui-egui/locales/ja.toml | 1 + crates/ui-egui/locales/ko.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/tr.toml | 1 + crates/ui-egui/locales/zh-Hans.toml | 1 + crates/ui-egui/src/control.rs | 4 +- crates/ui-egui/src/lib.rs | 13 +- crates/ui-egui/src/menus.rs | 376 ++++++++++++++-------------- crates/ui-egui/src/palette_tests.rs | 86 +++++-- crates/ui-egui/src/plugins_ui.rs | 2 - crates/ui-egui/src/toolbar.rs | 21 +- 19 files changed, 291 insertions(+), 230 deletions(-) diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml index e86da423c..268ff5275 100644 --- a/crates/ui-egui/locales/cs.toml +++ b/crates/ui-egui/locales/cs.toml @@ -1133,6 +1133,7 @@ status = "draft — needs native review" "Scroll with parent" = "Posouvat s nadřazeným prvkem" "Search plugins" = "Hledat pluginy" "Search" = "Hledat" +"Search actions, layers and tools" = "Hledat akce, vrstvy a nástroje" "Search assets" = "Hledat zdroje" "Search comments" = "Hledat komentáře" "Search fonts" = "Hledat písma" diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index 862527e42..cd1e34827 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -1096,6 +1096,7 @@ status = "draft — needs native review" "Scroll to layer" = "Zur Ebene scrollen" "Scroll with parent" = "Mit übergeordnetem Element scrollen" "Search" = "Suchen" +"Search actions, layers and tools" = "Aktionen, Ebenen und Werkzeuge suchen" "Search assets" = "Assets suchen" "Search comments" = "Kommentare suchen" "Search fonts" = "Schriften suchen" diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 8894ece13..514b69755 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -913,6 +913,7 @@ name = "English" "Orange" = "Orange" "Order" = "Order" "Other apps may not open every .fig file exported here." = "Other apps may not open every .fig file exported here." +"Other" = "Other" "Others lose access and keep their copy; the file stays on the server for you" = "Others lose access and keep their copy; the file stays on the server for you" "Others type this under Share ▸ Join with a code" = "Others type this under Share ▸ Join with a code" "Outline stroke" = "Outline stroke" @@ -1152,7 +1153,7 @@ name = "English" "Scroll with parent" = "Scroll with parent" "Search plugins" = "Search plugins" "Search" = "Search" -"Search actions, assets and plugins" = "Search actions, assets and plugins" +"Search actions, layers and tools" = "Search actions, layers and tools" "Search assets" = "Search assets" "Search comments" = "Search comments" "Search fonts" = "Search fonts" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index d5e353cfc..55e228dd7 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -914,6 +914,7 @@ status = "draft — needs native review" "Orange" = "Naranja" "Order" = "Orden" "Other apps may not open every .fig file exported here." = "Puede que otras aplicaciones no abran todos los archivos .fig exportados aquí." +"Other" = "Otros" "Others lose access and keep their copy; the file stays on the server for you" = "Los demás pierden el acceso y conservan su copia; el archivo se queda en el servidor para ti" "Others type this under Share ▸ Join with a code" = "Los demás lo escriben en Compartir ▸ Unirse con un código" "Outline stroke" = "Contornear trazo" @@ -971,7 +972,7 @@ status = "draft — needs native review" "Plugin" = "Plugin" "Plugins run in FigCraft's sandbox, without files, network or clock. Install only plugins you trust." = "Los plugins se ejecutan en el entorno aislado de FigCraft, sin archivos, red ni reloj. Instala solo plugins de confianza." "Plugins" = "Plugins" -"Plugins & widgets" = "Plugins & widgets" +"Plugins & widgets" = "Plugins y widgets" "Plus darker" = "Más oscuro" "Plus lighter" = "Más claro" "Point" = "Punto" @@ -1153,8 +1154,8 @@ status = "draft — needs native review" "Scroll with parent" = "Desplazar con el padre" "Search plugins" = "Buscar plugins" "Search" = "Buscar" +"Search actions, layers and tools" = "Buscar acciones, capas y herramientas" "Search assets" = "Buscar recursos" -"Search actions, assets and plugins" = "Buscar acciones, recursos y plugins" "Search comments" = "Buscar comentarios" "Search fonts" = "Buscar fuentes" "Search layers" = "Buscar capas" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 2c1fbc45a..7fafd3c91 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -1090,6 +1090,7 @@ status = "draft — needs native review" "Scroll to layer" = "Défiler jusqu’au calque" "Scroll with parent" = "Défiler avec le parent" "Search" = "Rechercher" +"Search actions, layers and tools" = "Rechercher des actions, des calques et des outils" "Search assets" = "Rechercher des ressources" "Search comments" = "Rechercher des commentaires" "Search fonts" = "Rechercher des polices" diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml index 53825747a..5de7634d4 100644 --- a/crates/ui-egui/locales/id.toml +++ b/crates/ui-egui/locales/id.toml @@ -1137,6 +1137,7 @@ status = "draft — needs native review" "Scroll with parent" = "Gulir bersama induk" "Search plugins" = "Cari plugin" "Search" = "Cari" +"Search actions, layers and tools" = "Cari tindakan, layer, dan alat" "Search assets" = "Cari aset" "Search comments" = "Cari komentar" "Search fonts" = "Cari font" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index 670f84fcb..4d4d6d340 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -1140,6 +1140,7 @@ status = "draft — needs native review" "Scroll to layer" = "レイヤーまでスクロール" "Scroll with parent" = "親と一緒にスクロール" "Search" = "検索" +"Search actions, layers and tools" = "アクション、レイヤー、ツールを検索" "Search assets" = "アセットを検索" "Search comments" = "コメントを検索" "Search fonts" = "フォントを検索" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index 1f7bed0c6..ec732905c 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -1090,6 +1090,7 @@ status = "draft — needs native review" "Scroll to layer" = "레이어로 스크롤" "Scroll with parent" = "부모와 함께 스크롤" "Search" = "검색" +"Search actions, layers and tools" = "액션, 레이어, 도구 검색" "Search assets" = "에셋 검색" "Search comments" = "댓글 검색" "Search fonts" = "글꼴 검색" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index 2fb61d124..c2189de81 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -1089,6 +1089,7 @@ status = "draft — needs native review" "Scroll to layer" = "Rolar até a camada" "Scroll with parent" = "Rolar com o pai" "Search" = "Pesquisar" +"Search actions, layers and tools" = "Pesquisar ações, camadas e ferramentas" "Search assets" = "Pesquisar recursos" "Search comments" = "Pesquisar comentários" "Search fonts" = "Pesquisar fontes" diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 78a8afd62..3ab407572 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -1134,6 +1134,7 @@ name = "Русский" "Scroll with parent" = "Прокручивать с родителем" "Search plugins" = "Поиск плагинов" "Search" = "Поиск" +"Search actions, layers and tools" = "Поиск действий, слоёв и инструментов" "Search assets" = "Поиск ресурсов" "Search comments" = "Поиск комментариев" "Search fonts" = "Поиск шрифтов" diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index a54c02e7c..f7b2999d6 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -1135,6 +1135,7 @@ name = "Svenska" "Scroll with parent" = "Rulla med överordnat element" "Search plugins" = "Sök plugin-program" "Search" = "Sök" +"Search actions, layers and tools" = "Sök åtgärder, lager och verktyg" "Search assets" = "Sök tillgångar" "Search comments" = "Sök i kommentarer" "Search fonts" = "Sök typsnitt" diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml index 436032877..a2be6b99c 100644 --- a/crates/ui-egui/locales/tr.toml +++ b/crates/ui-egui/locales/tr.toml @@ -1137,6 +1137,7 @@ name = "Türkçe" "Scroll with parent" = "Üst öğeyle birlikte kaydır" "Search plugins" = "Eklentilerde ara" "Search" = "Ara" +"Search actions, layers and tools" = "Eylem, katman ve araç ara" "Search assets" = "Varlıklarda ara" "Search comments" = "Yorumlarda ara" "Search fonts" = "Yazı tiplerinde ara" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index a42360e42..af4cf6534 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -1091,6 +1091,7 @@ status = "draft — needs native review" "Scroll to layer" = "滚动到图层" "Scroll with parent" = "随父级滚动" "Search" = "搜索" +"Search actions, layers and tools" = "搜索操作、图层和工具" "Search assets" = "搜索资源" "Search comments" = "搜索评论" "Search fonts" = "搜索字体" diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rs index 6e55c8a4a..9a97081f4 100644 --- a/crates/ui-egui/src/control.rs +++ b/crates/ui-egui/src/control.rs @@ -414,9 +414,7 @@ pub fn handle(app: &mut FigApp, ctx: &Context, method: &str, p: &Value) -> Resul crate::home_recents::Sort { descending: order == "desc", ..sort }.store(&mut app.session.prefs); } if let Some(h) = p.get("palette").and_then(Value::as_bool) { - app.ui.palette = if h { Some(String::new()) } else { None }; - app.ui.palette_tab = crate::menus::PaletteTab::All; - app.ui.palette_armed = true; + crate::menus::set_palette(&mut app.ui, h); } // true / false, or a top-level menu to open it at ("Plugins"). match p.get("mainMenu") { diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 34f6ac0d2..4a047c891 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -408,6 +408,8 @@ pub struct UiState { pub palette: Option, /// The Actions palette's tab. pub palette_tab: menus::PaletteTab, + /// The palette row Up and Down are on (Enter runs it). + pub palette_hi: usize, /// The palette ignores one outside click after opening (the click that opened it). pub palette_armed: bool, /// This frame's Actions toolbar button rect: presses on it toggle, never dismiss. @@ -542,6 +544,7 @@ impl Default for UiState { main_menu: false, palette: None, palette_tab: menus::PaletteTab::All, + palette_hi: 0, palette_armed: false, actions_rect: None, variables: None, @@ -799,15 +802,7 @@ impl FigApp { } "dialog.preferences" => self.ui.preferences = true, "panel.shortcuts" => self.ui.shortcuts_panel = !self.ui.shortcuts_panel, - "palette.actions" => { - if self.ui.palette.is_some() { - self.ui.palette = None; - } else { - self.ui.palette = Some(String::new()); - self.ui.palette_tab = menus::PaletteTab::All; - self.ui.palette_armed = true; - } - } + "palette.actions" => menus::toggle_palette(&mut self.ui), "panel.design" => self.ui.right_tab = RightTab::Design, "panel.prototype" => self.ui.right_tab = RightTab::Prototype, "panel.designPrototype" => { diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 73bee5bcc..e54f00908 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -7,8 +7,8 @@ use serde_json::json; use crate::FigApp; use crate::a11y; -use crate::icons::{self, Icon}; use crate::i18n::{self, tr, tr_noop, trf}; +use crate::icons::{self, Icon}; use crate::theme::{Tokens, regular}; use crate::toolbar::pretty_shortcut; @@ -82,7 +82,7 @@ pub enum PaletteTab { Plugins, } -/// Remember a ran action for the palette's Recents (newest first, capped). +/// Remember an action run from the palette for its Recents (newest first, capped). pub fn record_recent(app: &mut FigApp, key: &str) { let r = &mut app.session.prefs.recent_actions; if r.first().is_some_and(|f| f == key) { @@ -94,7 +94,6 @@ pub fn record_recent(app: &mut FigApp, key: &str) { } pub fn invoke(app: &mut FigApp, id: &str) { - record_recent(app, &format!("command:{id}")); match id { "file.open" => app.open_dialog(), "plugin.import" => crate::plugins_ui::import_dialog(app), @@ -434,7 +433,7 @@ pub fn popups(app: &mut FigApp, ctx: &egui::Context) { t.menu_dim, ); if resp.clicked() { - app.ui.palette = Some(String::new()); + set_palette(&mut app.ui, true); close = true; } ui.add_space(6.0); @@ -657,19 +656,31 @@ fn select_layer_menu(app: &mut FigApp, ui: &mut Ui, pos: egui::Pos2, t: &Tokens) /// The Actions palette's content height (the frame adds its own 8 px margins). const PALETTE_H: f32 = 450.0; -/// The Actions palette: search over commands, assets and plugins, in Figma's shape (tabs, -/// recents, grouped sections). Rows run on click; Enter runs the first visible row. +/// Open the Actions palette afresh (empty search, All tab, first row highlighted), or close it. +pub fn set_palette(ui: &mut crate::UiState, open: bool) { + ui.palette = open.then(String::new); + ui.palette_tab = PaletteTab::All; + ui.palette_hi = 0; + ui.palette_armed = open; +} + +/// Open the Actions palette afresh, or close it when it's open (⌘K, the toolbar's Actions button). +pub fn toggle_palette(ui: &mut crate::UiState) { + let open = ui.palette.is_none(); + set_palette(ui, open); +} + +/// The Actions palette: search over commands, assets and plugins, with tabs, recents and grouped +/// sections, floating above the toolbar. Rows run on click; Up and Down move the highlight and +/// Enter runs the highlighted row. fn palette(app: &mut FigApp, ctx: &egui::Context) { let Some(mut q) = app.ui.palette.clone() else { return }; let t = Tokens::get(ctx); // Same centre and width as the toolbar pill (it centres on the canvas, not the window), // floating 8 px above it. Fixed size: switching tabs never resizes the panel. let bar_w = crate::toolbar::main_width(); - let canvas = app.canvas.rect; - let area = Rect::from_min_size( - pos2(canvas.center().x - bar_w / 2.0, canvas.max.y - 68.0 - (PALETTE_H + 16.0)), - vec2(bar_w, PALETTE_H + 16.0), - ); + let bar = crate::toolbar::pill_rect(app.canvas.rect, bar_w); + let area = Rect::from_min_max(pos2(bar.min.x, bar.min.y - 8.0 - (PALETTE_H + 16.0)), pos2(bar.max.x, bar.min.y - 8.0)); let mut run: Option = None; let mut close = false; // A press anywhere outside closes the panel. The opening press is spared once, and the @@ -684,135 +695,93 @@ fn palette(app: &mut FigApp, ctx: &egui::Context) { } else if !pressed { app.ui.palette_armed = false; } - egui::Area::new(Id::new("palette")).fixed_pos(area.min).order(egui::Order::Foreground).show( - ctx, - |ui| { - egui::Frame::NONE - .fill(t.panel) - .corner_radius(CornerRadius::same(13)) - .stroke(Stroke::new(1.0, t.border)) - .shadow(egui::Shadow { offset: [0, 8], blur: 32, spread: 0, color: t.shadow }) - .inner_margin(egui::Margin::same(8)) - .show(ui, |ui| { - // Same outer width as the toolbar pill, and a fixed height: switching tabs - // never resizes the panel. - let inner = crate::toolbar::main_width() - 16.0; - ui.set_width(inner); - ui.set_height(PALETTE_H); - let r = ui.add( - egui::TextEdit::singleline(&mut q) - .hint_text(tr("Search actions, assets and plugins")) - .desired_width(inner - 16.0) - .font(regular(14.0)) - .frame(egui::Frame::NONE.inner_margin(egui::Margin::same(8))), - ); - r.request_focus(); - crate::widgets::select_all_on_focus(ui, &r, &q); - ui.add_space(4.0); - // Tabs: All, Assets, Plugins & widgets. - let tabs = [(PaletteTab::All, tr("All")), (PaletteTab::Assets, tr("Assets")), (PaletteTab::Plugins, tr("Plugins & widgets"))]; - ui.horizontal(|ui| { - ui.spacing_mut().item_spacing = vec2(4.0, 0.0); - for (tab, label) in tabs { - let active = app.ui.palette_tab == tab; - // The frame stays on for every tab (transparent when idle) so the - // active pill never moves its neighbours. - let resp = ui.add( - egui::Button::new(egui::RichText::new(label).size(12.0).color(if active { t.text } else { t.text_secondary })) - .frame(true) - .fill(if active { t.hover } else { Color32::TRANSPARENT }) - .corner_radius(CornerRadius::same(6)), - ); - if resp.clicked() { - app.ui.palette_tab = tab; - } - } - }); - ui.add_space(4.0); - let enter = ui.input(|i| i.key_pressed(egui::Key::Enter)); - let mut first: Option = None; - egui::ScrollArea::vertical().max_height(360.0).show(ui, |ui| { - let tab = app.ui.palette_tab; - if tab == PaletteTab::All { - let recents: Vec = app - .session - .prefs - .recent_actions - .clone() - .iter() - .filter_map(|key| recent_row(app, key, &q)) - .collect(); - if !recents.is_empty() { - section(ui, &t, tr("Recents"), |ui| { - for row in &recents { - first.get_or_insert_with(|| row.key.clone()); - if draw_row(ui, &t, row) { - run = Some(row.key.clone()); - } - } - }); - } - } - if tab != PaletteTab::Plugins { - for (group, rows) in command_sections(&q) { - if tab == PaletteTab::Assets { - continue; - } - section(ui, &t, &group, |ui| { - for row in rows { - first.get_or_insert_with(|| row.key.clone()); - if draw_row(ui, &t, &row) { - run = Some(row.key); - } - } - }); - } - } - if tab != PaletteTab::Assets { - let plugins = plugin_rows(app, &q); - let widgets = widget_rows(app, &q); - if !plugins.is_empty() { - section(ui, &t, tr("Plugins"), |ui| { - for row in plugins { - first.get_or_insert_with(|| row.key.clone()); - if draw_row(ui, &t, &row) { - run = Some(row.key); - } - } - }); - } - if !widgets.is_empty() { - section(ui, &t, tr("Widgets"), |ui| { - for row in widgets { - first.get_or_insert_with(|| row.key.clone()); - if draw_row(ui, &t, &row) { - run = Some(row.key); - } - } - }); - } - } - if tab == PaletteTab::Assets { - for (group, rows) in asset_sections(app, &q) { - section(ui, &t, &group, |ui| { - for row in rows { - first.get_or_insert_with(|| row.key.clone()); - if draw_row(ui, &t, &row) { - run = Some(row.key); - } - } - }); - } - } - }); - if enter { - if let Some(key) = first { - run = Some(key); + // Taken before the search field sees them (it would move its cursor). + let step = ctx.input_mut(|i| { + i.count_and_consume_key(egui::Modifiers::NONE, egui::Key::ArrowDown) as i64 + - i.count_and_consume_key(egui::Modifiers::NONE, egui::Key::ArrowUp) as i64 + }); + egui::Area::new(Id::new("palette")).fixed_pos(area.min).order(egui::Order::Foreground).show(ctx, |ui| { + egui::Frame::NONE + .fill(t.panel) + .corner_radius(CornerRadius::same(13)) + .stroke(Stroke::new(1.0, t.border)) + .shadow(egui::Shadow { offset: [0, 8], blur: 32, spread: 0, color: t.shadow }) + .inner_margin(egui::Margin::same(8)) + .show(ui, |ui| { + // Same outer width as the toolbar pill, and a fixed height: switching tabs + // never resizes the panel. + let inner = bar_w - 16.0; + ui.set_width(inner); + ui.set_height(PALETTE_H); + let r = ui.add( + egui::TextEdit::singleline(&mut q) + .hint_text(tr("Search actions, layers and tools")) + .desired_width(inner - 16.0) + .font(regular(14.0)) + .frame(egui::Frame::NONE.inner_margin(egui::Margin::same(8))), + ); + r.request_focus(); + crate::widgets::select_all_on_focus(ui, &r, &q); + // A new search starts again at the first row. + if r.changed() { + app.ui.palette_hi = 0; + } + ui.add_space(4.0); + // Tabs: All, Assets, Plugins & widgets. + let tabs = [(PaletteTab::All, tr("All")), (PaletteTab::Assets, tr("Assets")), (PaletteTab::Plugins, tr("Plugins & widgets"))]; + ui.horizontal(|ui| { + ui.spacing_mut().item_spacing = vec2(4.0, 0.0); + for (tab, label) in tabs { + let active = app.ui.palette_tab == tab; + // The frame stays on for every tab (transparent when idle) so the + // active pill never moves its neighbours. + let resp = ui.add( + egui::Button::new(egui::RichText::new(label).size(12.0).color(if active { t.text } else { t.text_secondary })) + .frame(true) + .fill(if active { t.hover } else { Color32::TRANSPARENT }) + .corner_radius(CornerRadius::same(6)), + ); + if resp.clicked() { + app.ui.palette_tab = tab; + app.ui.palette_hi = 0; } } }); - }, - ); + ui.add_space(4.0); + let sections = palette_sections(app, &q, app.ui.palette_tab); + let count = sections.iter().map(|(_, rows)| rows.len()).sum::(); + // At either end it stays where it was. + let hi = (app.ui.palette_hi as i64 + step).clamp(0, count.saturating_sub(1) as i64) as usize; + app.ui.palette_hi = hi; + // The pointer moving over a row moves the highlight there. + let pointer_moved = ui.input(|i| i.pointer.delta() != egui::Vec2::ZERO); + egui::ScrollArea::vertical().max_height(360.0).show(ui, |ui| { + let mut i = 0; + for (name, rows) in §ions { + section(ui, &t, name, |ui| { + for row in rows { + let resp = draw_row(ui, &t, row, i == hi); + if resp.clicked() { + run = Some(row.key.clone()); + } + if pointer_moved && resp.hovered() && i != hi { + app.ui.palette_hi = i; + // Drawn there on the next frame, even if the pointer stops now. + ui.ctx().request_repaint(); + } + if step != 0 && i == hi { + resp.scroll_to_me(None); + } + i += 1; + } + }); + } + }); + if run.is_none() && ui.input(|i| i.key_pressed(egui::Key::Enter)) { + run = sections.iter().flat_map(|(_, rows)| rows).nth(hi).map(|row| row.key.clone()); + } + }); + }); if ctx.input(|i| i.key_pressed(egui::Key::Escape)) { close = true; } @@ -825,10 +794,32 @@ fn palette(app: &mut FigApp, ctx: &egui::Context) { let _ = StrokeKind::Inside; } +/// The rows a palette tab shows for the query, by section: All has Recents, the commands by menu, +/// then plugins and widgets; Assets this file's components and styles; Plugins & widgets those. +pub(crate) fn palette_sections(app: &FigApp, q: &str, tab: PaletteTab) -> Vec<(String, Vec)> { + let mut out = match tab { + PaletteTab::All => { + let recents = app.session.prefs.recent_actions.iter().filter_map(|key| recent_row(app, key, q)).collect(); + let mut out = vec![(tr("Recents").to_string(), recents)]; + out.extend(command_sections(q)); + out + } + PaletteTab::Assets => asset_sections(app, q), + PaletteTab::Plugins => Vec::new(), + }; + if tab != PaletteTab::Assets { + out.push((tr("Plugins").to_string(), plugin_rows(app, q))); + out.push((tr("Widgets").to_string(), widget_rows(app, q))); + } + out.retain(|(_, rows)| !rows.is_empty()); + out +} + /// Run a palette row: `command:`, `plugin:/`, `widget:`, /// `component:` or `style:`. -fn run_action(app: &mut FigApp, key: &str) { +pub(crate) fn run_action(app: &mut FigApp, key: &str) { if let Some(id) = key.strip_prefix("command:") { + record_recent(app, key); invoke(app, id); } else if let Some(rest) = key.strip_prefix("plugin:") { if let Some((plugin, command)) = rest.split_once('/') { @@ -869,14 +860,14 @@ fn section(ui: &mut Ui, t: &Tokens, name: &str, rows: impl FnOnce(&mut Ui)) { rows(ui); } -/// Draw one row (a letter tile for plugins, else just the label) with its right-side hint. -/// True when clicked. -fn draw_row(ui: &mut Ui, t: &Tokens, row: &ActionRow) -> bool { +/// Draw one row (a letter tile for plugins, else just the label) with its right-side hint, +/// `highlighted` when Enter runs it. +fn draw_row(ui: &mut Ui, t: &Tokens, row: &ActionRow, highlighted: bool) -> egui::Response { let w = ui.available_width(); let (r, resp) = ui.allocate_exact_size(vec2(w, 34.0), Sense::click()); - // The hover pill stays inside the row: it never touches the panel's edges. + // The highlight pill stays inside the row: it never touches the panel's edges. let pill = r.shrink2(vec2(4.0, 1.0)); - if resp.hovered() { + if highlighted { ui.painter().rect_filled(pill, CornerRadius::same(6), t.hover); } let mut label_x = r.min.x + 10.0; @@ -888,7 +879,7 @@ fn draw_row(ui: &mut Ui, t: &Tokens, row: &ActionRow) -> bool { } ui.painter().text(pos2(label_x, r.center().y), Align2::LEFT_CENTER, &row.label, regular(13.0), t.text); ui.painter().text(pos2(r.max.x - 10.0, r.center().y), Align2::RIGHT_CENTER, &row.hint, regular(11.0), t.text_secondary); - resp.clicked() + resp } /// Whether `label` (or `extra`) matches the query, in any case. @@ -896,28 +887,55 @@ fn matches(q: &str, label: &str, extra: &str) -> bool { q.is_empty() || label.to_lowercase().contains(q) || extra.to_lowercase().contains(q) } -/// Commands grouped by top-level menu, in catalog order, filtered by the query. +/// A command's row: its label, and its shortcut as the hint. +fn command_row(id: &str, label: String) -> ActionRow { + ActionRow { key: format!("command:{id}"), label, hint: crate::shortcuts::shortcut(id).map(pretty_shortcut).unwrap_or_default(), tile: None } +} + +/// Most rows a search shows (the best matches). +const MAX_HITS: usize = 60; + +/// Commands grouped by top-level menu, filtered by the query. Without one, the menus' items in +/// catalog order; a search covers every command (the engine's and the UI's own, "Other" for those +/// no menu lists), best matches first (labels starting with the query, then the shortest), each +/// group placed by its best row. Labels match in the UI language and in English. The Plugins +/// menu's items come with the plugins ([`plugin_rows`]). pub(crate) fn command_sections(q: &str) -> Vec<(String, Vec)> { - let ql = q.to_lowercase(); - let mut groups: Vec<(String, Vec)> = Vec::new(); - let mut seen: std::collections::HashSet<&str> = std::collections::HashSet::new(); - for m in figcraft_engine::catalog::MENU.iter() { - if m.label == figcraft_engine::catalog::SEP || m.menu.starts_with("Plugins") || !available(m.id) || !seen.insert(m.id) { + let ql = q.trim().to_lowercase(); + let mut menu_of = std::collections::HashMap::new(); + for m in MENU.iter().filter(|m| m.label != SEP) { + menu_of.entry(m.id).or_insert(m); + } + let menu_items = MENU.iter().filter(|m| m.label != SEP).map(|m| (m.id, m.label)); + let engine = figcraft_engine::all_commands().iter().map(|c| (c.id, c.label)); + let candidates: Box> = if ql.is_empty() { Box::new(menu_items) } else { Box::new(menu_items.chain(engine)) }; + let mut seen = std::collections::HashSet::new(); + // By top-level menu; `None`: no menu lists it. + let mut hits: Vec<(Option<&str>, ActionRow)> = Vec::new(); + for (id, english) in candidates { + if !available(id) || !seen.insert(id) { continue; } - let english = m.label; - let label = i18n::menu_item(m.id, english).into_owned(); - if !matches(&ql, &label, &format!("{english} {}", m.id)) { + let menu = menu_of.get(id); + let group = menu.map(|m| m.menu.split('/').next().unwrap_or(m.menu)); + if group == Some("Plugins") { continue; } - let group = m.menu.split('/').next().unwrap_or(&m.menu); - let group = tr(group).to_string(); - let row = ActionRow { - key: format!("command:{}", m.id), - label, - hint: crate::shortcuts::shortcut(m.id).map(pretty_shortcut).unwrap_or_default(), - tile: None, + let label = match menu { + Some(m) => i18n::menu_item(id, m.label), + None => i18n::command(id, english), }; + if matches(&ql, &label, &format!("{english} {id}")) { + hits.push((group, command_row(id, label.into_owned()))); + } + } + if !ql.is_empty() { + hits.sort_by_cached_key(|(_, row)| (!row.label.to_lowercase().starts_with(&ql), row.label.chars().count())); + hits.truncate(MAX_HITS); + } + let mut groups: Vec<(String, Vec)> = Vec::new(); + for (group, row) in hits { + let group = group.map_or_else(|| tr("Other"), tr).to_string(); match groups.iter_mut().find(|(g, _)| *g == group) { Some((_, rows)) => rows.push(row), None => groups.push((group, vec![row])), @@ -945,6 +963,13 @@ fn plugin_rows(app: &FigApp, q: &str) -> Vec { }); } } + // The Plugins menu's own items (run last, manage, import). + for m in MENU.iter().filter(|m| m.label != SEP && m.menu.split('/').next() == Some("Plugins") && available(m.id)) { + let label = i18n::menu_item(m.id, m.label); + if matches(&ql, &label, &format!("{} {}", m.label, m.id)) { + rows.push(command_row(m.id, label.into_owned())); + } + } rows } @@ -974,21 +999,11 @@ fn asset_sections(app: &FigApp, q: &str) -> Vec<(String, Vec)> { .iter() .filter_map(|id| doc.node(*id)) .filter(|n| matches(&ql, &n.name, "")) - .map(|n| ActionRow { - key: format!("component:{}", n.id.0), - label: n.name.clone(), - hint: tr("Component").to_string(), - tile: None, - }) + .map(|n| ActionRow { key: format!("component:{}", n.id.0), label: n.name.clone(), hint: tr("Component").to_string(), tile: None }) .collect(); let styles: Vec = figcraft_engine::library::local_styles(doc) .filter(|s| matches(&ql, &s.name, "")) - .map(|s| ActionRow { - key: format!("style:{}", s.id), - label: s.name.clone(), - hint: tr("Style").to_string(), - tile: None, - }) + .map(|s| ActionRow { key: format!("style:{}", s.id), label: s.name.clone(), hint: tr("Style").to_string(), tile: None }) .collect(); let mut out = Vec::new(); if !components.is_empty() { @@ -1007,15 +1022,11 @@ pub(crate) fn recent_row(app: &FigApp, key: &str, q: &str) -> Option let spec = figcraft_engine::find_command(id); let menu_label = figcraft_engine::catalog::MENU.iter().find(|m| m.id == id); let english = menu_label.map(|m| m.label).or_else(|| spec.map(|s| s.label)).unwrap_or(id); - if !available(id) || !matches(&ql, english, id) { + let label = i18n::command(id, english); + if !available(id) || !matches(&ql, &label, &format!("{english} {id}")) { return None; } - return Some(ActionRow { - key: key.to_string(), - label: i18n::command(id, english).into_owned(), - hint: crate::shortcuts::shortcut(id).map(pretty_shortcut).unwrap_or_default(), - tile: None, - }); + return Some(command_row(id, label.into_owned())); } if let Some(rest) = key.strip_prefix("plugin:") { let (pid, cid) = rest.split_once('/')?; @@ -1025,12 +1036,7 @@ pub(crate) fn recent_row(app: &FigApp, key: &str, q: &str) -> Option if !matches(&ql, &label, pid) { return None; } - return Some(ActionRow { - key: key.to_string(), - label, - hint: tr("Plugin").to_string(), - tile: p.manifest.name.chars().next(), - }); + return Some(ActionRow { key: key.to_string(), label, hint: tr("Plugin").to_string(), tile: p.manifest.name.chars().next() }); } if let Some(pid) = key.strip_prefix("widget:") { let p = app.session.prefs.plugins.iter().find(|p| p.manifest.id == pid && p.manifest.widget)?; diff --git a/crates/ui-egui/src/palette_tests.rs b/crates/ui-egui/src/palette_tests.rs index 06e9fdf5c..cfe9c1cd2 100644 --- a/crates/ui-egui/src/palette_tests.rs +++ b/crates/ui-egui/src/palette_tests.rs @@ -1,26 +1,22 @@ -//! The Actions palette, driven headless: invoking records recents (newest first, capped), -//! sections group commands by menu, the query filters, gone entries drop out of Recents, a used -//! plugin resolves back to a row, and a press outside the panel closes it. +//! The Actions palette, driven headless: runs from it record recents (newest first, capped), +//! sections group commands by menu, a search covers every command with the best matches first, +//! Up/Down move the highlight and Enter runs it, gone entries drop out of Recents, a used plugin +//! resolves back to a row, and a press outside the panel closes it. -use egui::Pos2; +use egui::{Event, Key, Modifiers, Pos2}; use figcraft_engine::Session; use serde_json::json; use crate::layers_drag_tests::Ui; #[test] -fn invoke_records_recents_newest_first_and_capped() { +fn palette_runs_record_recents_newest_first_and_capped() { let mut u = Ui::new(Session::new()); - for id in [ - "view.zoomIn", - "view.zoomOut", - "edit.copyAsText", - "style.list", - "edit.findReplace", - "edit.copyAsCss", - "view.zoomIn", - ] { - crate::menus::invoke(&mut u.app, id); + // Menus, shortcuts and context menus don't touch the palette's Recents. + crate::menus::invoke(&mut u.app, "view.zoomIn"); + assert!(u.app.session.prefs.recent_actions.is_empty(), "only the palette records recents"); + for id in ["view.zoomIn", "view.zoomOut", "edit.copyAsText", "style.list", "edit.findReplace", "edit.copyAsCss", "view.zoomIn"] { + crate::menus::run_action(&mut u.app, &format!("command:{id}")); } let r = &u.app.session.prefs.recent_actions; assert_eq!(r.len(), figcraft_engine::MAX_RECENT_ACTIONS, "recents are capped: {r:?}"); @@ -81,8 +77,7 @@ fn used_plugin_resolves_to_a_recent_row() { .unwrap(); u.app.session.prefs.plugins.push(plugin); crate::menus::record_recent(&mut u.app, "plugin:dev.local.solar-icons/panel"); - let row = crate::menus::recent_row(&u.app, "plugin:dev.local.solar-icons/panel", "") - .expect("a used plugin stays in Recents"); + let row = crate::menus::recent_row(&u.app, "plugin:dev.local.solar-icons/panel", "").expect("a used plugin stays in Recents"); assert_eq!(row.label, "Solar icons — Panel"); assert!(crate::menus::recent_row(&u.app, "plugin:dev.local.solar-icons/panel", "zzz").is_none(), "the query filters recents"); } @@ -109,3 +104,60 @@ fn outside_press_closes_the_panel() { u.button(Pos2::new(720.0, 20.0), false); assert!(u.app.ui.palette.is_none(), "a single outside press closes the panel"); } + +fn rows(groups: &[(String, Vec)]) -> Vec<&crate::menus::ActionRow> { + groups.iter().flat_map(|(_, rows)| rows).collect() +} + +/// A search reaches commands no menu lists (in an "Other" group), not just menu items. +#[test] +fn search_covers_every_command() { + let menu = figcraft_engine::catalog::MENU; + let spec = figcraft_engine::all_commands().iter().find(|c| !menu.iter().any(|m| m.id == c.id)).expect("a command no menu lists"); + let groups = crate::menus::command_sections(spec.id); + let key = format!("command:{}", spec.id); + let group = groups.iter().find(|(_, rows)| rows.iter().any(|r| r.key == key)).map(|(g, _)| g.as_str()); + assert_eq!(group, Some("Other"), "{} is found: {:?}", spec.id, groups.iter().map(|(g, _)| g).collect::>()); + // Without a query the palette lists the menus' items only. + assert!(rows(&crate::menus::command_sections("")).iter().all(|r| r.key != key)); +} + +/// Labels starting with the query come first, the shortest first; the rest are capped. +#[test] +fn search_ranks_prefix_matches_first() { + let groups = crate::menus::command_sections("zoom"); + let hits = rows(&groups); + let first = hits.first().expect("something matches 'zoom'"); + assert!(first.label.to_lowercase().starts_with("zoom"), "a prefix match leads: {}", first.label); + let shortest = hits.iter().filter(|r| r.label.to_lowercase().starts_with("zoom")).map(|r| r.label.chars().count()).min(); + assert_eq!(Some(first.label.chars().count()), shortest, "the shortest prefix match leads"); + assert!(rows(&crate::menus::command_sections("e")).len() <= 60, "a broad search is capped"); +} + +fn key(u: &mut Ui, k: Key) { + u.frame(vec![ + Event::Key { key: k, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::NONE }, + Event::Key { key: k, physical_key: None, pressed: false, repeat: false, modifiers: Modifiers::NONE }, + ]); +} + +/// Up and Down move the highlight (it stops at the ends); Enter runs the highlighted row. +#[test] +fn arrows_move_the_highlight_and_enter_runs_it() { + let mut u = Ui::new(Session::new()); + crate::menus::set_palette(&mut u.app.ui, true); + u.frame(vec![]); + u.frame(vec![Event::Text("zoom".into())]); + assert_eq!(u.app.ui.palette.as_deref(), Some("zoom")); + assert_eq!(u.app.ui.palette_hi, 0, "a search starts at the first row"); + key(&mut u, Key::ArrowUp); + assert_eq!(u.app.ui.palette_hi, 0, "it stops at the top"); + key(&mut u, Key::ArrowDown); + key(&mut u, Key::ArrowDown); + key(&mut u, Key::ArrowUp); + assert_eq!(u.app.ui.palette_hi, 1); + let want = rows(&crate::menus::palette_sections(&u.app, "zoom", crate::menus::PaletteTab::All)).get(1).map(|r| r.key.clone()).expect("two rows"); + key(&mut u, Key::Enter); + assert!(u.app.ui.palette.is_none(), "Enter runs a row and closes the palette"); + assert_eq!(u.app.session.prefs.recent_actions.first(), Some(&want), "the highlighted row ran"); +} diff --git a/crates/ui-egui/src/plugins_ui.rs b/crates/ui-egui/src/plugins_ui.rs index 99df5d6f4..481b446c3 100644 --- a/crates/ui-egui/src/plugins_ui.rs +++ b/crates/ui-egui/src/plugins_ui.rs @@ -171,12 +171,10 @@ pub fn menu(app: &mut FigApp, ui: &mut Ui, t: &Tokens) -> bool { .flatten(); crate::menus::separator(ui); if let Some(plugin) = widget { - crate::menus::record_recent(app, &format!("widget:{plugin}")); app.run("widget.insert", json!({"plugin": plugin})); return true; } let Some((id, command)) = chosen else { return false }; - crate::menus::record_recent(app, &format!("plugin:{id}/{command}")); start(app, &id, &command); true } diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index 962b74972..8839b3a9a 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -85,7 +85,7 @@ pub(crate) fn main_width() -> f32 { fn main_toolbar(app: &mut FigApp, ui: &mut Ui, canvas: Rect, t: &Tokens) { let (cell, gap) = (32.0, 4.0); let width = main_width(); - let rect = pill(ui, &mut app.ui.nav, canvas, width, &t); + let rect = pill(ui, &mut app.ui.nav, canvas, width, t); let current = app.session.tool.tool; let mut x = rect.min.x + 8.0; let cy = rect.center().y; @@ -94,7 +94,7 @@ fn main_toolbar(app: &mut FigApp, ui: &mut Ui, canvas: Rect, t: &Tokens) { let shown = if in_group { current } else { remembered(ui, g.key, g.tools.first().map(|x| x.0).unwrap_or(ToolId::Move)) }; let icon = g.tools.iter().find(|(tid, _)| *tid == shown).map(|(_, i)| *i).unwrap_or(Icon::Move); let r = Rect::from_center_size(pos2(x + cell / 2.0, cy), vec2(cell, cell)); - let resp = tool_cell(ui, &t, r, ("tool", g.key), icon, in_group, &format!("{} {}", tr(shown.label()), pretty_shortcut(shown.shortcut()))); + let resp = tool_cell(ui, t, r, ("tool", g.key), icon, in_group, &format!("{} {}", tr(shown.label()), pretty_shortcut(shown.shortcut()))); if in_group { a11y::prefer(&mut app.ui.nav, Region::Toolbar, resp.id); } @@ -152,13 +152,7 @@ fn main_toolbar(app: &mut FigApp, ui: &mut Ui, canvas: Rect, t: &Tokens) { icons::paint(ui.painter(), r.shrink(7.0), icon, if actions_open { Color32::WHITE } else { t.icon }); if resp.clicked() { if id == "actions" { - if app.ui.palette.is_some() { - app.ui.palette = None; - } else { - app.ui.palette = Some(String::new()); - app.ui.palette_tab = crate::menus::PaletteTab::All; - app.ui.palette_armed = true; - } + crate::menus::toggle_palette(&mut app.ui); } else { app.ui.left_tab = crate::LeftTab::Assets; app.ui.left_collapsed = false; @@ -166,7 +160,7 @@ fn main_toolbar(app: &mut FigApp, ui: &mut Ui, canvas: Rect, t: &Tokens) { } x += cell + 4.0; } - divider(ui, &t, x, cy); + divider(ui, t, x, cy); x += 8.0; // Mode switcher: Draw · Design · Prototype · Inspect (code). let modes = [(Icon::Pencil, tr("Draw")), (Icon::Frame, tr("Design")), (Icon::Prototype, tr("Prototype")), (Icon::Code, tr("Inspect"))]; @@ -348,10 +342,15 @@ fn builder_toolbar(app: &mut FigApp, ui: &mut Ui) { } } +/// Where a toolbar pill `width` wide sits: centred 12 px above the canvas's bottom edge. +pub(crate) fn pill_rect(canvas: Rect, width: f32) -> Rect { + Rect::from_center_size(pos2(canvas.center().x, canvas.max.y - 12.0 - 24.0), vec2(width, 48.0)) +} + /// The floating pill (shadow, panel, border) `width` wide at the bottom centre of the canvas: the /// toolbar region keyboard navigation moves through. fn pill(ui: &Ui, nav: &mut Nav, canvas: Rect, width: f32, t: &Tokens) -> Rect { - let rect = Rect::from_center_size(pos2(canvas.center().x, canvas.max.y - 12.0 - 24.0), vec2(width, 48.0)); + let rect = pill_rect(canvas, width); // The pill takes the press and the drag over it: its buttons sense clicks only, and egui gives // a drag the canvas under them would sense to the canvas, so the pen placed an anchor there. // Not focusable: the keyboard walks the buttons, not the pill. From 330f80fcf5422d08e3fda41a30bec971d811c623 Mon Sep 17 00:00:00 2001 From: Andrii Volkov <60794004+volkovskey@users.noreply.github.com> Date: Fri, 16 Oct 2026 10:46:08 +0300 Subject: [PATCH 148/817] fix(format): open large .fig files A real 705 MB .fig file (401 644 nodes, 894 004 layers once instances are expanded) didn't open: "message: too many values". Lifting that cap alone made it import only its first 200 000 layers, and lifting that one took 41 GB of memory. The global caps stay as they are. The .fig import gets budgets from the size of its compressed canvas instead (counted up to the file's own size), not from the message it unpacks to, since chunks inflate up to 512 MB: - the kiwi value budget is one value per 2 bytes of the canvas, at least the old 20 million (kiwi is only read for .fig files); - the layer cap is one layer per 32 bytes of the canvas, at least the REST import's 200 000 and at most 2 000 000. A small or crafted file can't expand its instances into millions of layers, however far it unpacks; the REST JSON import keeps 200 000. Memory: - The mapper no longer passes the document through `json!`, which serialises its arguments: the whole tree was deep-copied twice. - Vector networks are built once per distinct network and handed to the REST importer beside the JSON (`vectorNetworkRef`), not written into it as JSON objects for every instance that shows them. - Decoded kiwi objects are trimmed, and each import stage's input is dropped as soon as the next stage is built. On that file: peak footprint 41 GB -> 11.3 GB, 67 s -> 25 s. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YQxjkNSUJhTkTfY74aNeki --- crates/format/src/fig/kiwi.rs | 24 ++- crates/format/src/fig/map.rs | 165 ++++++++++++------ .../map_connector_snapshot_budget_tests.rs | 8 +- crates/format/src/fig/mod.rs | 30 +++- crates/format/src/fig/tail_tests.rs | 4 +- crates/format/src/fig/tests.rs | 61 ++++++- crates/format/src/rest/mod.rs | 66 +++++-- crates/format/src/rest/tests.rs | 15 ++ 8 files changed, 287 insertions(+), 86 deletions(-) diff --git a/crates/format/src/fig/kiwi.rs b/crates/format/src/fig/kiwi.rs index 528dbbf06..46a9daacd 100644 --- a/crates/format/src/fig/kiwi.rs +++ b/crates/format/src/fig/kiwi.rs @@ -10,8 +10,12 @@ use std::fmt; /// Deepest struct/message nesting decoded. const MAX_DEPTH: usize = 64; -/// Most values decoded from one message (every scalar, array element and field counts). -const MAX_VALUES: usize = 20_000_000; +/// Most values decoded from one message (every scalar, array element and field counts): at least +/// [`MIN_VALUES`], and one per [`PACKED_BYTES_PER_VALUE`] bytes of the file's compressed canvas, +/// so a large real file decodes while a small one can't expand into a huge tree, however far its +/// chunks inflate. +const MIN_VALUES: usize = 20_000_000; +const PACKED_BYTES_PER_VALUE: usize = 2; /// Most definitions in a schema, and fields in one definition. const MAX_DEFS: usize = 10_000; const MAX_FIELDS: usize = 10_000; @@ -284,13 +288,23 @@ impl Schema { self.defs.iter().position(|d| d.name == name) } - /// Decode a message of definition `root`. + /// Decode a message of definition `root`, within [`MIN_VALUES`] values. pub fn decode_message<'s>(&'s self, root: usize, data: &[u8]) -> Result, KiwiError> { - let mut d = Decoder { schema: self, r: Reader { data, pos: 0 }, budget: MAX_VALUES }; + self.decode_message_within(root, data, MIN_VALUES) + } + + /// [`Self::decode_message`] within `budget` values (see [`value_budget`]). + pub fn decode_message_within<'s>(&'s self, root: usize, data: &[u8], budget: usize) -> Result, KiwiError> { + let mut d = Decoder { schema: self, r: Reader { data, pos: 0 }, budget }; d.def(root, 0) } } +/// Most values decoded from a file whose compressed canvas is `packed` bytes. +pub(crate) fn value_budget(packed: usize) -> usize { + MIN_VALUES.max(packed / PACKED_BYTES_PER_VALUE) +} + struct Decoder<'s, 'b> { schema: &'s Schema, r: Reader<'b>, @@ -327,6 +341,8 @@ impl<'s> Decoder<'s, '_> { loop { let id = self.r.var_uint()?; if id == 0 { + // Grown by doubling: trimmed, a large file's tree takes a good part less. + out.shrink_to_fit(); return Ok(Kv::Object(out)); } let f = d.fields.iter().find(|f| f.value == id).ok_or_else(|| KiwiError(format!("message: {} has no field {id}", d.name)))?; diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 7a3dab5c1..a8af2ab98 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -6,9 +6,10 @@ //! are expanded here from the main component (overrides and derived layout matched by id path, //! component property values applied) so the import looks as saved. -use std::collections::{BTreeMap, BTreeSet}; +use std::collections::{BTreeMap, BTreeSet, HashMap}; use std::rc::Rc; +use figcraft_doc::VectorNetwork; use figcraft_doc::geom::{Affine, Point}; use figcraft_doc::proto::{MAX_ACTION_DEPTH, MAX_EXPR_DEPTH}; use serde_json::{Map, Value, json}; @@ -18,8 +19,7 @@ use super::network; type Obj = Map; -/// Most layers produced (instance expansion included) and deepest nesting followed. -const MAX_NODES: usize = crate::rest::MAX_NODES; +/// Deepest nesting followed. const MAX_DEPTH: usize = 256; /// Most path commands read from one geometry blob. const MAX_COMMANDS: usize = 200_000; @@ -30,11 +30,41 @@ const NO_STYLE: &str = "4294967295:4294967295"; /// Longest asset `key` or `version` kept for resolving references given as assets. const MAX_ASSET_PART: usize = 256; -/// The REST API file JSON for message `msg`, with the warnings about what was skipped. +/// The REST API file JSON for message `msg`, with the warnings about what was skipped and the +/// vector networks its layers name by `vectorNetworkRef` (for [`crate::rest::import_fig_parts`]). +/// [`to_rest_parts`] within the REST import's layer cap, with each vector's network written back +/// into its JSON as `vectorNetwork`: what the tests read. +#[cfg(test)] pub(super) fn to_rest(msg: &Kv, name: &str) -> (Value, Vec) { - let mut m = Mapper::new(msg); + fn inline(v: &mut Value, networks: &[Option]) { + match v { + Value::Object(o) => { + let net = o.remove("vectorNetworkRef").and_then(|r| networks.get(usize::try_from(r.as_u64()?).ok()?).cloned().flatten()); + if let Some(net) = net.and_then(|n| serde_json::to_value(n).ok()) { + o.insert("vectorNetwork".into(), net); + } + o.values_mut().for_each(|c| inline(c, networks)); + } + Value::Array(a) => a.iter_mut().for_each(|c| inline(c, networks)), + _ => {} + } + } + let (mut json, warnings, networks) = to_rest_parts(msg, name, MAX_NODES); + inline(&mut json, &networks); + (json, warnings) +} + +/// The REST import's layer cap, for the tests. +#[cfg(test)] +pub(super) const MAX_NODES: usize = crate::rest::MAX_NODES; + +pub(super) fn to_rest_parts(msg: &Kv, name: &str, max_nodes: usize) -> (Value, Vec, Vec>) { + let mut m = Mapper::new(msg, max_nodes); let doc = m.document(); - let mut out = json!({"name": name, "document": doc}); + // Large values are moved in, never passed through `json!`, which serialises its arguments: + // a deep copy of the whole tree, briefly holding it twice. + let mut out = json!({"name": name}); + out["document"] = doc; if !m.library_contexts.is_empty() { out[crate::rest::FIG_LIBRARY_CONTEXTS_FIELD] = Value::Array(std::mem::take(&mut m.library_contexts)); } @@ -54,7 +84,7 @@ pub(super) fn to_rest(msg: &Kv, name: &str) -> (Value, Vec) { if !styles.is_empty() { out["styleDefinitions"] = Value::Array(styles); } - (out, m.warnings) + (out, m.warnings, m.networks) } #[cfg(test)] @@ -374,20 +404,27 @@ struct Mapper<'a> { sets: Obj, /// Layers and keys of each main, built when an instance of it first needs them. override_scopes: BTreeMap>, - /// Entries held by `override_scopes` (bounded by [`MAX_NODES`] together). + /// Entries held by `override_scopes` (bounded by `max_nodes` together). override_scope_entries: usize, /// Component-bearing branches of the file's internal canvases (cached library definitions). library_contexts: Vec, /// Layers visited while scanning internal canvases, across all of them. library_scan_count: usize, - /// Most layers produced or scanned; the one place the cap comes from. + /// Most layers produced (instance expansion included) or scanned; the one place the cap comes + /// from (see [`super::layer_budget`]). max_nodes: usize, warnings: Vec, count: usize, + /// Vector networks, each built once: the layers that show one (every instance of a main + /// 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 what a network is made from: its blob, its scale and its style table. + network_ids: HashMap<(usize, u64, u64, usize), usize>, } impl<'a> Mapper<'a> { - fn new(msg: &'a Kv<'a>) -> Self { + fn new(msg: &'a Kv<'a>, max_nodes: usize) -> Self { let mut nodes = BTreeMap::new(); let mut kids: BTreeMap> = BTreeMap::new(); let mut prop_defs = BTreeMap::new(); @@ -447,9 +484,11 @@ impl<'a> Mapper<'a> { override_scope_entries: 0, library_contexts: Vec::new(), library_scan_count: 0, - max_nodes: MAX_NODES, + max_nodes, warnings: Vec::new(), count: 0, + networks: Vec::new(), + network_ids: HashMap::new(), } } @@ -498,7 +537,7 @@ impl<'a> Mapper<'a> { let mut pending: Vec<(String, usize)> = self.children(main).into_iter().map(|id| (id, 1)).collect(); let mut complete = true; while let Some((id, depth)) = pending.pop() { - if depth > MAX_DEPTH || visited.len() >= MAX_NODES { + if depth > MAX_DEPTH || visited.len() >= self.max_nodes { complete = false; break; } @@ -523,7 +562,7 @@ impl<'a> Mapper<'a> { } let scope = Rc::new(OverrideScope { current, aliases }); let cost = scope.current.len() + scope.aliases.len(); - if cost <= MAX_NODES.saturating_sub(self.override_scope_entries) { + if cost <= self.max_nodes.saturating_sub(self.override_scope_entries) { self.override_scope_entries += cost; self.override_scopes.insert(main.to_string(), Rc::clone(&scope)); } @@ -563,7 +602,9 @@ impl<'a> Mapper<'a> { if out.is_empty() { self.warn("the file has no pages"); } - json!({"id": doc_id.unwrap_or_else(|| "0:0".into()), "type": "DOCUMENT", "children": out}) + let mut doc = json!({"id": doc_id.unwrap_or_else(|| "0:0".into()), "type": "DOCUMENT"}); + doc["children"] = Value::Array(out); + doc } /// The ids of the components the visible pages use, directly or through the components they @@ -777,8 +818,9 @@ impl<'a> Mapper<'a> { self.warn(format!("layers nested deeper than {MAX_DEPTH} levels were skipped")); return None; } - if self.count >= MAX_NODES { - self.warn(format!("the file has more than {MAX_NODES} layers; the rest were skipped")); + if self.count >= self.max_nodes { + let max = self.max_nodes; + self.warn(format!("the file has more than {max} layers; the rest were skipped")); return None; } let base = *self.nodes.get(id)?; @@ -813,7 +855,7 @@ impl<'a> Mapper<'a> { let connector_snapshot = own == "CONNECTOR" && self.connector_snapshot_supported(&view); // Only a connector with a saved label needs the frame wrapper; an unlabelled one stays a single vector. let connector_terminal = - connector_snapshot && (!connector_has_saved_label(&view) || depth >= MAX_DEPTH || self.count.saturating_add(1) >= MAX_NODES); + connector_snapshot && (!connector_has_saved_label(&view) || depth >= MAX_DEPTH || self.count.saturating_add(1) >= self.max_nodes); // A supported connector snapshot has its own note below instead of the generic stand-in one. let stand = stand_in(own).filter(|_| !connector_snapshot); let ty = match own { @@ -947,7 +989,7 @@ impl<'a> Mapper<'a> { fn shape_with_text(&mut self, o: &mut Obj, v: &View<'a>, own: &str, rest_id: &str) -> Option { let shape = v.str("shapeWithTextType").unwrap_or("SQUARE"); let outlined = !v.list("fillGeometry").is_empty() || !v.list("strokeGeometry").is_empty(); - if own != "SHAPE_WITH_TEXT" || matches!(shape, "SQUARE" | "ROUNDED_RECTANGLE") || !outlined || self.count >= MAX_NODES { + if own != "SHAPE_WITH_TEXT" || matches!(shape, "SQUARE" | "ROUNDED_RECTANGLE") || !outlined || self.count >= self.max_nodes { return None; } let mut s = Obj::new(); @@ -979,7 +1021,7 @@ impl<'a> Mapper<'a> { /// layer filling it, inset a little; centred unless it's a note. fn inner_text(&mut self, o: &Obj, v: &View<'a>, rest_id: &str, note: bool) -> Option { let chars = own_text(v)?; - if self.count >= MAX_NODES { + if self.count >= self.max_nodes { return None; } self.count += 1; @@ -1013,7 +1055,7 @@ impl<'a> Mapper<'a> { if connector_has_saved_label(v) { self.warn("connector labels were skipped"); } - if ["vectorNetwork", "fillGeometry", "strokeGeometry"].iter().any(|k| o.contains_key(*k)) { + if ["vectorNetwork", "vectorNetworkRef", "fillGeometry", "strokeGeometry"].iter().any(|k| o.contains_key(*k)) { return; } let parent = v.get("parentIndex").and_then(|p| p.get("guid")).and_then(guid); @@ -1114,7 +1156,7 @@ impl<'a> Mapper<'a> { out.insert("opacity".into(), json!(root_opacity * line_opacity)); } if connector_has_saved_label(v) { - let reason = if self.count >= MAX_NODES { "node budget" } else { "depth limit" }; + let reason = if self.count >= self.max_nodes { "node budget" } else { "depth limit" }; self.warn(format!("connector label was skipped: {reason} prevents nested snapshot children")); } } @@ -1144,8 +1186,9 @@ impl<'a> Mapper<'a> { /// Snapshot the straight, manual connector contract carried by its generated children. fn connector_snapshot_children(&mut self, v: &View<'a>, rest_id: &str) -> Vec { - if self.count >= MAX_NODES { - self.warn(format!("the file has more than {MAX_NODES} layers; connector snapshot children were skipped")); + if self.count >= self.max_nodes { + let max = self.max_nodes; + self.warn(format!("the file has more than {max} layers; connector snapshot children were skipped")); return Vec::new(); } let Some(vector) = self.connector_snapshot_vector(v, rest_id, Affine::IDENTITY, true) else { @@ -1207,8 +1250,9 @@ impl<'a> Mapper<'a> { }; let background_view = View::of(background).with([background_style]); if !background_view.list("fillPaints").is_empty() { - if self.count >= MAX_NODES { - self.warn(format!("the file has more than {MAX_NODES} layers; connector label background was skipped")); + if self.count >= self.max_nodes { + let max = self.max_nodes; + self.warn(format!("the file has more than {max} layers; connector label background was skipped")); } else { let mut rect = Obj::new(); rect.insert("id".into(), json!(format!("{rest_id};label-background"))); @@ -1235,8 +1279,9 @@ impl<'a> Mapper<'a> { transform: Affine, view: &View<'a>, ) { - if self.count >= MAX_NODES { - self.warn(format!("the file has more than {MAX_NODES} layers; connector label was skipped")); + if self.count >= self.max_nodes { + let max = self.max_nodes; + self.warn(format!("the file has more than {max} layers; connector label was skipped")); return; } let mut text = Obj::new(); @@ -1648,7 +1693,8 @@ impl<'a> Mapper<'a> { /// False when there's none or it's damaged (the outlines stand in). fn network(&mut self, o: &mut Obj, v: &View<'a>) -> bool { let Some(vd) = v.get("vectorData") else { return false }; - let Some(blob) = num(vd, "vectorNetworkBlob").and_then(|i| self.blobs.get(i as usize)).copied() else { return false }; + let Some(blob_id) = num(vd, "vectorNetworkBlob").map(|i| i as usize) else { return false }; + let Some(blob) = self.blobs.get(blob_id).copied() else { return false }; let Some(net) = network::decode(blob) else { self.warn("damaged vector networks import as outlines"); return false; @@ -1686,28 +1732,6 @@ 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")); - let vertices: Vec = net - .vertices - .iter() - .map(|p| { - let mut out = json!({"x": p.x * sx, "y": p.y * sy}); - let st = style(p.style); - if let Some(r) = st.and_then(|s| num(s, "cornerRadius")).filter(|r| *r > 0.0) { - out["radius"] = json!(r); - } - match st.and_then(|s| s.get("handleMirroring")).and_then(Kv::str) { - Some("ANGLE") => out["mirror"] = json!("angle"), - Some("ANGLE_AND_LENGTH") => out["mirror"] = json!("angleAndLength"), - Some("NONE") => out["mirror"] = json!("none"), - _ => {} - } - out - }) - .collect(); - let segments: Vec = - net.segments.iter().map(|s| json!({"a": s.a, "b": s.b, "ta": [s.ta.0 * sx, s.ta.1 * sy], "tb": [s.tb.0 * sx, s.tb.1 * sy]})).collect(); - let regions: Vec = - net.regions.iter().map(|r| json!({"loops": r.loops, "winding": if r.non_zero { "nonZero" } else { "evenOdd" }})).collect(); if net.regions.iter().any(|r| style(r.style).is_some_and(|s| s.get("fillPaints").is_some())) { self.warn("filled areas of a vector with their own fill use the layer's fill"); } @@ -1733,7 +1757,46 @@ impl<'a> Mapper<'a> { o.insert("strokeCapStart".into(), json!(cap_name(first.unwrap_or(node)))); o.insert("strokeCapEnd".into(), json!(cap_name(last.unwrap_or(node)))); } - o.insert("vectorNetwork".into(), json!({"vertices": vertices, "segments": segments, "regions": regions})); + // Every instance of a main shows the same network: it is written once and shared. + let key = (blob_id, sx.to_bits(), sy.to_bits(), std::ptr::from_ref(vd) as usize); + let id = match self.network_ids.get(&key) { + Some(id) => *id, + None => { + let vertices: Vec = net + .vertices + .iter() + .map(|p| { + let mut out = json!({"x": p.x * sx, "y": p.y * sy}); + let st = style(p.style); + if let Some(r) = st.and_then(|s| num(s, "cornerRadius")).filter(|r| *r > 0.0) { + out["radius"] = json!(r); + } + match st.and_then(|s| s.get("handleMirroring")).and_then(Kv::str) { + Some("ANGLE") => out["mirror"] = json!("angle"), + Some("ANGLE_AND_LENGTH") => out["mirror"] = json!("angleAndLength"), + Some("NONE") => out["mirror"] = json!("none"), + _ => {} + } + out + }) + .collect(); + let segments: Vec = net + .segments + .iter() + .map(|s| json!({"a": s.a, "b": s.b, "ta": [s.ta.0 * sx, s.ta.1 * sy], "tb": [s.tb.0 * sx, s.tb.1 * sy]})) + .collect(); + let regions: Vec = + net.regions.iter().map(|r| json!({"loops": r.loops, "winding": if r.non_zero { "nonZero" } else { "evenOdd" }})).collect(); + let mut entry = json!({}); + entry["vertices"] = Value::Array(vertices); + entry["segments"] = Value::Array(segments); + entry["regions"] = Value::Array(regions); + self.networks.push(crate::rest::network(&entry)); + self.network_ids.insert(key, self.networks.len() - 1); + self.networks.len() - 1 + } + }; + o.insert("vectorNetworkRef".into(), json!(id)); true } diff --git a/crates/format/src/fig/map_connector_snapshot_budget_tests.rs b/crates/format/src/fig/map_connector_snapshot_budget_tests.rs index a14e671cd..4d8ae9be6 100644 --- a/crates/format/src/fig/map_connector_snapshot_budget_tests.rs +++ b/crates/format/src/fig/map_connector_snapshot_budget_tests.rs @@ -106,7 +106,7 @@ fn connector_snapshot_respects_last_and_zero_child_slots() { let message = message(); let node = message.get("nodeChanges").unwrap().list().first().unwrap(); let view = View::of(node); - let mut mapper = Mapper::new(&message); + let mut mapper = Mapper::new(&message, MAX_NODES); mapper.count = MAX_NODES - 1; let children = mapper.connector_snapshot_children(&view, "1:123"); assert_eq!(children.len(), 1, "the final available slot preserves the saved vector"); @@ -116,7 +116,7 @@ fn connector_snapshot_respects_last_and_zero_child_slots() { assert_eq!(mapper.count, MAX_NODES); assert!(mapper.warnings.iter().any(|warning| warning == &format!("the file has more than {MAX_NODES} layers; connector label was skipped"))); - let mut mapper = Mapper::new(&message); + let mut mapper = Mapper::new(&message, MAX_NODES); mapper.count = MAX_NODES; let children = mapper.connector_snapshot_children(&view, "1:123"); assert!(children.is_empty()); @@ -127,14 +127,14 @@ fn connector_snapshot_respects_last_and_zero_child_slots() { #[test] fn connector_snapshot_flattens_vector_at_depth_and_node_limits() { let message = message(); - let mut mapper = Mapper::new(&message); + let mut mapper = Mapper::new(&message, MAX_NODES); let depth_limited = mapper.layer("1:123", None, Affine::IDENTITY, None, None, MAX_DEPTH).expect("terminal connector"); assert_eq!(depth_limited["type"], "VECTOR"); assert!(!depth_limited["fillGeometry"].as_array().unwrap().is_empty()); assert!(depth_limited.get("children").is_none()); assert!(mapper.warnings.iter().any(|warning| warning == "connector label was skipped: depth limit prevents nested snapshot children")); - let mut mapper = Mapper::new(&message); + let mut mapper = Mapper::new(&message, MAX_NODES); mapper.count = MAX_NODES - 1; let budget_limited = mapper.layer("1:123", None, Affine::IDENTITY, None, None, 0).expect("last allowed connector"); assert_eq!(budget_limited["type"], "VECTOR"); diff --git a/crates/format/src/fig/mod.rs b/crates/format/src/fig/mod.rs index 0d341307e..08a3409e7 100644 --- a/crates/format/src/fig/mod.rs +++ b/crates/format/src/fig/mod.rs @@ -54,6 +54,18 @@ const MAX_CHUNK: u64 = 512 * 1024 * 1024; const MAX_IMAGE: u64 = 256 * 1024 * 1024; /// Most chunks read from `canvas.fig`. const MAX_CHUNKS: usize = 16; +/// Most layers imported from a `.fig` file: one per [`PACKED_BYTES_PER_LAYER`] bytes of its +/// compressed canvas, at least the REST import's cap and at most [`MAX_FIG_NODES`]. Instances +/// expand into a layer per layer of their component, and chunks inflate up to [`MAX_CHUNK`], so the +/// budget follows what the file takes, not what it unpacks to: a small file can't claim a large +/// count, however it's built; a large one gets room. +const PACKED_BYTES_PER_LAYER: usize = 32; +const MAX_FIG_NODES: usize = 2_000_000; + +/// Most layers imported from a `.fig` file whose compressed canvas is `packed` bytes. +pub(crate) fn layer_budget(packed: usize) -> usize { + (packed / PACKED_BYTES_PER_LAYER).clamp(crate::rest::MAX_NODES, MAX_FIG_NODES) +} /// Whether `bytes` look like a `.fig` file: a zip holding `canvas.fig`, or a bare canvas. pub fn is_fig(bytes: &[u8]) -> bool { @@ -72,14 +84,22 @@ pub fn try_import(bytes: &[u8], name: &str) -> Option Result<(Document, Vec), FormatError> { - let archive = Archive::open(bytes)?; - let (schema, message) = decode_canvas(&archive.canvas)?; + let mut archive = Archive::open(bytes)?; + // The budgets follow the compressed canvas, which the file itself bounds (its zip member may + // inflate too). + let packed = archive.canvas.len().min(bytes.len()); + // Each stage's input is dropped as soon as the next one is built: in a large file every one + // of them takes gigabytes, and holding them all at once runs out of memory. + let (schema, message) = decode_canvas(&std::mem::take(&mut archive.canvas))?; let root = schema.find("Message").ok_or_else(|| corrupt("the schema has no Message definition"))?; - let msg = schema.decode_message(root, &message).map_err(|e| corrupt(e.to_string()))?; + let msg = schema.decode_message_within(root, &message, kiwi::value_budget(packed)).map_err(|e| corrupt(e.to_string()))?; + let max_nodes = layer_budget(packed); + drop(message); let file_name = archive.file_name.as_deref().filter(|n| !n.trim().is_empty()).unwrap_or(name); - let (json, mut warnings) = map::to_rest(&msg, file_name); + let (json, mut warnings, networks) = map::to_rest_parts(&msg, file_name, max_nodes); + drop(msg); let images = |r: &str| archive.image(r); - let (doc, more) = crate::rest::import_fig(&json, &images)?; + let (doc, more) = crate::rest::import_fig_parts(&json, &images, networks, max_nodes)?; warnings.extend(more.into_iter().filter_map(map::adapt_warning)); Ok((doc, warnings)) } diff --git a/crates/format/src/fig/tail_tests.rs b/crates/format/src/fig/tail_tests.rs index a15334a56..43e997a5c 100644 --- a/crates/format/src/fig/tail_tests.rs +++ b/crates/format/src/fig/tail_tests.rs @@ -446,8 +446,8 @@ fn mangled_tail_files_never_panic() { m[i] = r.next() as u8; } if let Ok(kv) = sc.decode_message(root, &m) { - let (json, _) = map::to_rest(&kv, "x"); - let _ = crate::rest::import(&json, &crate::rest::no_images); + let (json, _, networks) = map::to_rest_parts(&kv, "x", crate::rest::MAX_NODES); + let _ = crate::rest::import_fig_parts(&json, &crate::rest::no_images, networks, crate::rest::MAX_NODES); } } } diff --git a/crates/format/src/fig/tests.rs b/crates/format/src/fig/tests.rs index 24baef301..5f20f5ac4 100644 --- a/crates/format/src/fig/tests.rs +++ b/crates/format/src/fig/tests.rs @@ -757,7 +757,7 @@ fn mangled_kiwi_never_panics() { } for cut in (0..msg.len()).step_by(3) { if let Ok(kv) = sc.decode_message(root, &msg[..cut]) { - let _ = map::to_rest(&kv, "x"); + let _ = map::to_rest_parts(&kv, "x", crate::rest::MAX_NODES); } } for _ in 0..2000 { @@ -767,8 +767,8 @@ fn mangled_kiwi_never_panics() { m[i] = r.next() as u8; } if let Ok(kv) = sc.decode_message(root, &m) { - let (json, _) = map::to_rest(&kv, "x"); - let _ = crate::rest::import(&json, &crate::rest::no_images); + let (json, _, networks) = map::to_rest_parts(&kv, "x", crate::rest::MAX_NODES); + let _ = crate::rest::import_fig_parts(&json, &crate::rest::no_images, networks, crate::rest::MAX_NODES); } let mut sbytes = schema_bytes.clone(); let i = (r.next() as usize) % sbytes.len(); @@ -790,6 +790,59 @@ fn mangled_kiwi_never_panics() { } } +#[test] +fn large_files_get_a_larger_value_budget() { + // Small files keep the fixed floor: a few bytes can't expand into a huge tree. + assert_eq!(kiwi::value_budget(0), 20_000_000); + assert_eq!(kiwi::value_budget(1 << 20), 20_000_000); + // A real 400 000-layer file: an 83.5 MB canvas whose message unpacks to 334 MB and holds + // 30.5 million values was refused as "too many values". + assert!(kiwi::value_budget(83_491_232) > 30_514_899); + // Still bounded by the largest canvas read. + assert!(kiwi::value_budget(MAX_CANVAS as usize) <= 128 << 20); +} + +#[test] +fn the_layer_cap_follows_the_file_size() { + // A small (or broken) file keeps the REST import's cap: instances expand into a layer per + // layer of their component, and a few bytes mustn't claim millions of layers. + assert_eq!(layer_budget(0), crate::rest::MAX_NODES); + assert_eq!(layer_budget(1 << 20), crate::rest::MAX_NODES); + // A real 894 004-layer file (an 83.5 MB canvas) stopped at 200 000 and came in with 27 of + // its 30 pages empty. + assert!(layer_budget(83_491_232) > 894_004); + // No file gets more than the ceiling. + assert_eq!(layer_budget(MAX_CANVAS as usize), MAX_FIG_NODES); +} + +#[test] +fn a_small_file_that_unpacks_large_gets_no_larger_budgets() { + // 40 MB of zeros in a blob pack into a few KB. Keyed to the unpacked message, they lifted the + // layer cap above the 231 231 layers its instances expand into; keyed to the file, the cap + // stays at the REST import's. + let mut nodes = vec![node(0, None, "DOCUMENT", "D", vec![]), node(1, Some((0, "!")), "CANVAS", "P", vec![])]; + nodes.push(node(5, Some((1, "!")), "SYMBOL", "Main", vec![("size", xy(10.0, 10.0))])); + nodes.extend((10..1010).map(|i| node(i, Some((5, "!")), "RECTANGLE", "R", vec![("size", xy(1.0, 1.0))]))); + nodes.extend((2000..2230).map(|i| node(i, Some((1, "!")), "INSTANCE", "I", vec![("symbolData", o(vec![("symbolID", g(5))]))]))); + let blob = o(vec![("bytes", Kv::Bytes(vec![0; 40 << 20]))]); + let file = canvas(&schema(), &o(vec![("nodeChanges", arr(nodes)), ("blobs", arr(vec![blob]))])); + assert!(file.len() < 1 << 20, "{} bytes", file.len()); + let (doc, warnings) = import(&file, "x").unwrap(); + assert!(warnings.iter().any(|w| w.contains("more than 200000 layers")), "{warnings:?}"); + assert!(doc.node_count() <= crate::rest::MAX_NODES + 10); +} + +#[test] +fn the_mapper_stops_at_the_layer_cap_it_is_given() { + let mut nodes = vec![node(0, None, "DOCUMENT", "D", vec![]), node(1, Some((0, "!")), "CANVAS", "P", vec![])]; + nodes.extend((2..12).map(|i| node(i, Some((1, "!")), "RECTANGLE", "R", vec![("size", xy(1.0, 1.0))]))); + let msg = o(vec![("nodeChanges", arr(nodes))]); + let (_, warnings, _) = map::to_rest_parts(&msg, "x", 5); + assert!(warnings.iter().any(|w| w.contains("more than 5 layers")), "{warnings:?}"); + let (_, warnings, _) = map::to_rest_parts(&msg, "x", crate::rest::MAX_NODES); + assert!(!warnings.iter().any(|w| w.contains("more than")), "{warnings:?}"); +} + #[test] fn hostile_input_is_refused() { // A message that contains itself, nested past the depth cap. @@ -1088,7 +1141,7 @@ fn dump_samples() { std::fs::write(format!("{out}/{stem}.schema.txt"), txt).unwrap(); let msg = schema.decode_message(schema.find("Message").unwrap(), &message).unwrap(); std::fs::write(format!("{out}/{stem}.json"), serde_json::to_string_pretty(&debug_json(&msg)).unwrap()).unwrap(); - let (rest, _) = map::to_rest(&msg, &stem); + let (rest, ..) = map::to_rest_parts(&msg, &stem, super::layer_budget(message.len())); std::fs::write(format!("{out}/{stem}.rest.json"), serde_json::to_string_pretty(&rest).unwrap()).unwrap(); } } diff --git a/crates/format/src/rest/mod.rs b/crates/format/src/rest/mod.rs index e460c8b88..0fa53a7c7 100644 --- a/crates/format/src/rest/mod.rs +++ b/crates/format/src/rest/mod.rs @@ -53,7 +53,7 @@ use crate::FormatError; use props::{MAX_COORD, MAX_SIZE, clip_str, flag, list, num, text}; pub use variables::export as export_variables; -/// Most layers imported from one file. +/// Most layers imported from one file. The `.fig` import sets its own, from the file's size. pub const MAX_NODES: usize = 200_000; /// Deepest layer nesting followed. const MAX_DEPTH: usize = 256; @@ -146,22 +146,43 @@ pub fn import(v: &Value, images: ImageResolver) -> Result<(Document, Vec /// in the file JSON (a `meta` with `variableCollections`, or `variableCollections` and /// `variables` at the top level) are read too; the first definition of an id wins. pub fn import_with(v: &Value, variables: Option<&Value>, images: ImageResolver) -> Result<(Document, Vec), FormatError> { - import_impl(v, variables, images, false) + import_impl(v, variables, images, false, Vec::new(), MAX_NODES) } -/// Internal .fig JSON path: GUID provenance is not part of the public REST import contract. +/// Internal .fig JSON path: GUID provenance is not part of the public REST import contract. Its +/// vectors name their networks by `vectorNetworkRef`, an index in `networks` (built once each, and +/// far smaller than as JSON); `max_nodes` is the layer cap the `.fig` import sets in place of +/// [`MAX_NODES`]. +pub(crate) fn import_fig_parts( + v: &Value, + images: ImageResolver, + networks: Vec>, + max_nodes: usize, +) -> Result<(Document, Vec), FormatError> { + import_impl(v, None, images, true, networks, max_nodes) +} + +/// [`import_fig_parts`] of JSON that carries its vectors' networks, within [`MAX_NODES`]. +#[cfg(test)] pub(crate) fn import_fig(v: &Value, images: ImageResolver) -> Result<(Document, Vec), FormatError> { - import_impl(v, None, images, true) + import_fig_parts(v, images, Vec::new(), MAX_NODES) } -fn import_impl(v: &Value, variables: Option<&Value>, images: ImageResolver, fig_sources: bool) -> Result<(Document, Vec), FormatError> { +fn import_impl( + v: &Value, + variables: Option<&Value>, + images: ImageResolver, + fig_sources: bool, + networks: Vec>, + max_nodes: usize, +) -> Result<(Document, Vec), FormatError> { let entries: Vec<&Value> = if is_document(v) { vec![v] } else { nodes_entries(v).collect() }; if entries.is_empty() { return Err(FormatError::Corrupt("not a REST API file JSON (no `document`)".into())); } let name = text(v, "name").filter(|n| !n.trim().is_empty()).map_or("Imported file", clip_str); let mut cx = Ctx::new(Document::new(name), images); - cx.fig_sources = fig_sources.then(|| fig_sources::Sources::new(MAX_NODES)); + cx.fig_sources = fig_sources.then(|| fig_sources::Sources::new(max_nodes)); let blank = cx.doc.first_page(); let mut loose: Option = None; for e in &entries { @@ -175,6 +196,8 @@ fn import_impl(v: &Value, variables: Option<&Value>, images: ImageResolver, fig_ cx.warn("the variables JSON has no `variableCollections` (expected the local variables response) and was ignored"); } cx.style_definitions(v); + cx.networks = networks; + cx.max_nodes = max_nodes; for e in entries { let Some(root) = e.get("document") else { continue }; match text(root, "type") { @@ -356,6 +379,10 @@ pub(crate) struct Ctx<'a> { /// Imported variables by id, and the mode ids of imported collections (default first). var_kinds: BTreeMap, var_modes: BTreeMap>, + /// Vector networks built by the `.fig` import, named by layers' `vectorNetworkRef`. + networks: Vec>, + /// Most layers imported: [`MAX_NODES`], or the `.fig` import's own cap. + max_nodes: usize, } impl<'a> Ctx<'a> { @@ -380,6 +407,8 @@ impl<'a> Ctx<'a> { overlay_meta: BTreeMap::new(), var_kinds: BTreeMap::new(), var_modes: BTreeMap::new(), + networks: Vec::new(), + max_nodes: MAX_NODES, } } @@ -435,8 +464,9 @@ impl<'a> Ctx<'a> { self.warn(format!("layers nested deeper than {MAX_DEPTH} levels were skipped")); return; } - if self.count >= MAX_NODES { - self.warn(format!("the file has more than {MAX_NODES} layers; the rest were skipped")); + if self.count >= self.max_nodes { + let max = self.max_nodes; + self.warn(format!("the file has more than {max} layers; the rest were skipped")); return; } let Some(ty) = text(j, "type") else { @@ -642,14 +672,18 @@ impl<'a> Ctx<'a> { } } - /// A vector's network: the editable one when the JSON carries it (`vectorNetwork`, our - /// extension, written by the `.fig` import), else from its geometry. A stroke-only vector - /// uses the stroke outline, painted with the stroke paints (exact look, editable as a shape): - /// returns whether it does, and the caller moves the paints with [`outline_stroke`] once the - /// styles and variables of the stroke are read. + /// A vector's network: the editable one when the JSON carries it (`vectorNetwork`, or + /// `vectorNetworkRef` naming one built by the `.fig` import: our extensions), else from its + /// geometry. A stroke-only vector uses the stroke outline, painted with the stroke paints + /// (exact look, editable as a shape): returns whether it does, and the caller moves the paints + /// with [`outline_stroke`] once the styles and variables of the stroke are read. fn vector(&mut self, n: &mut Node, j: &Value) -> bool { - if let Some(net) = j.get("vectorNetwork") { - match network(net) { + let net = match j.get("vectorNetworkRef") { + Some(r) => Some(r.as_u64().and_then(|i| self.networks.get(usize::try_from(i).ok()?).cloned().flatten())), + None => j.get("vectorNetwork").map(network), + }; + if let Some(net) = net { + match net { Some(network) => { n.kind = NodeKind::Vector { network }; return false; @@ -1173,7 +1207,7 @@ fn local(parent: Affine, world: Affine) -> Affine { /// Finite path data within the coordinate cap. /// A vector network in our own JSON shape, when it's within bounds and refers only to what it has. -fn network(v: &Value) -> Option { +pub(crate) fn network(v: &Value) -> Option { use serde::Deserialize; let mut net = VectorNetwork::deserialize(v).ok()?; let entries: usize = net.regions.iter().flat_map(|r| &r.loops).map(Vec::len).sum(); diff --git a/crates/format/src/rest/tests.rs b/crates/format/src/rest/tests.rs index 7db22db10..cdf27905b 100644 --- a/crates/format/src/rest/tests.rs +++ b/crates/format/src/rest/tests.rs @@ -729,3 +729,18 @@ fn layer_count_is_capped() { assert_eq!(doc.node_count(), MAX_NODES + 1); assert!(warnings.iter().any(|w| w.contains("more than")), "{warnings:?}"); } + +#[test] +fn the_fig_import_sets_its_own_layer_cap() { + // The `.fig` import passes a cap from the file's size: above `MAX_NODES` every layer comes in. + let kids: Vec = (0..MAX_NODES + 5).map(|i| json!({"id": i.to_string(), "type": "RECTANGLE", "name": "R"})).collect(); + let json = file(json!([page("Page", Value::Array(kids))])); + let (doc, warnings) = import_fig_parts(&json, &no_images, Vec::new(), MAX_NODES + 10).unwrap(); + assert_eq!(doc.node_count(), MAX_NODES + 6); + assert!(!warnings.iter().any(|w| w.contains("more than")), "{warnings:?}"); + // Below it, the import stops at the cap it was given. + let few: Vec = (0..10).map(|i| json!({"id": i.to_string(), "type": "RECTANGLE", "name": "R"})).collect(); + let (doc, warnings) = import_fig_parts(&file(json!([page("Page", Value::Array(few))])), &no_images, Vec::new(), 4).unwrap(); + assert_eq!(doc.node_count(), 5); + assert!(warnings.iter().any(|w| w.contains("more than 4 layers")), "{warnings:?}"); +} From 62ade9b9ad86f0014627f569b95995162907f66f Mon Sep 17 00:00:00 2001 From: Andrii Volkov <60794004+volkovskey@users.noreply.github.com> Date: Fri, 16 Oct 2026 10:46:08 +0300 Subject: [PATCH 149/817] fix(format): reopen large documents once saved `document.json` was read under the 512 MB cap for any archive member, so a large imported document saved but didn't open again: 900 000 layers save as a 1.48 GB document.json, packed into 244 MB. It may now unpack to 16 times its packed size (counted up to the archive's own size), within 512 MB and 4 GB; images and other members keep 512 MB. A small archive still can't unpack into gigabytes. That saved file reopens in 13 s with a 5.9 GB peak. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YQxjkNSUJhTkTfY74aNeki --- crates/format/src/large_tests.rs | 15 +++++++++++++++ crates/format/src/lib.rs | 14 +++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/crates/format/src/large_tests.rs b/crates/format/src/large_tests.rs index 3ff352aca..2dc9eb4c1 100644 --- a/crates/format/src/large_tests.rs +++ b/crates/format/src/large_tests.rs @@ -202,3 +202,18 @@ fn the_header_is_read_on_its_own() { let (_, _, index) = parse_json(&d.replacen("\"imageIndex\":[]", "\"imageIndex\":[{\"hash\":\"ab\"},{\"nope\":1}]", 1)).unwrap(); assert_eq!(index, Some(["ab".to_string()].into_iter().collect())); } + +#[test] +fn document_json_may_unpack_in_proportion_to_its_packed_size() { + const MB: u64 = 1024 * 1024; + // A small archive keeps the member cap: it can't unpack into gigabytes. + assert_eq!(document_limit(0, 0), MAX_MEMBER); + assert_eq!(document_limit(MB, 2 * MB), MAX_MEMBER); + // A real 900 000-layer document saved by us packs 1 477 139 810 bytes into 244 362 923, and + // didn't open again under the 512 MB cap. + assert!(document_limit(244_362_923, 260 * MB) > 1_477_139_810); + // The packed size an archive claims counts only up to the archive's own size. + assert_eq!(document_limit(u64::MAX, MB), MAX_MEMBER); + // Never more than the ceiling. + assert_eq!(document_limit(u64::MAX, u64::MAX), MAX_DOCUMENT); +} diff --git a/crates/format/src/lib.rs b/crates/format/src/lib.rs index f88416e27..dd96b9323 100644 --- a/crates/format/src/lib.rs +++ b/crates/format/src/lib.rs @@ -39,6 +39,11 @@ pub const FORMAT: &str = "figcraft"; pub const VERSION: u32 = 1; /// Largest archive member we read (guards against zip bombs). const MAX_MEMBER: u64 = 512 * 1024 * 1024; +/// `document.json` may unpack to [`DOCUMENT_RATIO`] times what it takes in the archive, within +/// [`MAX_MEMBER`] and [`MAX_DOCUMENT`]: a large document saved by us (a 900 000-layer file packs +/// 1.48 GB into 244 MB) opens again, while a small archive still can't unpack into gigabytes. +const DOCUMENT_RATIO: u64 = 16; +const MAX_DOCUMENT: u64 = 4 * 1024 * 1024 * 1024; /// Most versions a file keeps: saving more is refused, extra entries in a file are skipped. pub const MAX_VERSIONS: usize = 100; /// Longest version name and description kept (chars). @@ -455,6 +460,11 @@ pub(crate) fn read_member(z: &mut zip::ZipArchive, name: &str Ok(data) } +/// Largest `document.json` read from an archive of `len` bytes in which it takes `packed`. +pub(crate) fn document_limit(packed: u64, len: u64) -> u64 { + packed.min(len).saturating_mul(DOCUMENT_RATIO).clamp(MAX_MEMBER, MAX_DOCUMENT) +} + /// How many images, and how many bytes of them together, one file may give. #[derive(Clone, Copy, Debug)] pub(crate) struct ImageBudget { @@ -476,7 +486,9 @@ pub(crate) fn load_within(bytes: &[u8], budget: ImageBudget) -> Result Date: Sat, 17 Oct 2026 09:27:42 +0300 Subject: [PATCH 150/817] fix(format): one kiwi value per compressed canvas byte One value per two bytes of the compressed canvas was too tight for a public design system: a 39.5 MB canvas holding 29.7 million values got a budget of 19.7 million (reported in #701). Real files hold 0.37 to 0.75 values per compressed byte; the budget is now one per byte, at least the old 20 million and at most 128 million. A small file still gets main's 20 million, however far it unpacks. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YQxjkNSUJhTkTfY74aNeki --- crates/format/src/fig/kiwi.rs | 10 +++++----- crates/format/src/fig/tests.rs | 7 +++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/crates/format/src/fig/kiwi.rs b/crates/format/src/fig/kiwi.rs index 46a9daacd..6496062b4 100644 --- a/crates/format/src/fig/kiwi.rs +++ b/crates/format/src/fig/kiwi.rs @@ -11,11 +11,11 @@ use std::fmt; /// Deepest struct/message nesting decoded. const MAX_DEPTH: usize = 64; /// Most values decoded from one message (every scalar, array element and field counts): at least -/// [`MIN_VALUES`], and one per [`PACKED_BYTES_PER_VALUE`] bytes of the file's compressed canvas, -/// so a large real file decodes while a small one can't expand into a huge tree, however far its -/// chunks inflate. +/// [`MIN_VALUES`], and one per byte of the file's compressed canvas up to [`MAX_VALUES`], so a large +/// real file decodes while a small one can't expand into a huge tree, however far its chunks +/// inflate. Real files hold 0.37 to 0.75 values per compressed byte. const MIN_VALUES: usize = 20_000_000; -const PACKED_BYTES_PER_VALUE: usize = 2; +const MAX_VALUES: usize = 128 << 20; /// Most definitions in a schema, and fields in one definition. const MAX_DEFS: usize = 10_000; const MAX_FIELDS: usize = 10_000; @@ -302,7 +302,7 @@ impl Schema { /// Most values decoded from a file whose compressed canvas is `packed` bytes. pub(crate) fn value_budget(packed: usize) -> usize { - MIN_VALUES.max(packed / PACKED_BYTES_PER_VALUE) + packed.clamp(MIN_VALUES, MAX_VALUES) } struct Decoder<'s, 'b> { diff --git a/crates/format/src/fig/tests.rs b/crates/format/src/fig/tests.rs index 5f20f5ac4..852700bfa 100644 --- a/crates/format/src/fig/tests.rs +++ b/crates/format/src/fig/tests.rs @@ -798,8 +798,11 @@ fn large_files_get_a_larger_value_budget() { // A real 400 000-layer file: an 83.5 MB canvas whose message unpacks to 334 MB and holds // 30.5 million values was refused as "too many values". assert!(kiwi::value_budget(83_491_232) > 30_514_899); - // Still bounded by the largest canvas read. - assert!(kiwi::value_budget(MAX_CANVAS as usize) <= 128 << 20); + // A public design system packs more densely: a 39.5 MB canvas holding 29.7 million values, + // which one value per two compressed bytes refused. + assert!(kiwi::value_budget(39_500_000) > 29_703_730); + // Never more than the ceiling, however large the canvas. + assert_eq!(kiwi::value_budget(MAX_CANVAS as usize), 128 << 20); } #[test] From 32266dcd93aae516fa04381913a0e69e79bf8f7a Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 15:49:01 +0700 Subject: [PATCH 151/817] #624: open the picker only for a shared paint list (mixed-selection guard) --- crates/ui-egui/src/panel_remove_tests.rs | 54 +++++++++++++----------- crates/ui-egui/src/right.rs | 12 +++--- 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/crates/ui-egui/src/panel_remove_tests.rs b/crates/ui-egui/src/panel_remove_tests.rs index ee289bb80..3805dca38 100644 --- a/crates/ui-egui/src/panel_remove_tests.rs +++ b/crates/ui-egui/src/panel_remove_tests.rs @@ -1,5 +1,6 @@ -//! Removing fill, effect and layout grid rows in the Design panel, driven through egui headless: an -//! open colour picker and open settings stay with their items, and go when their item goes. +//! Adding and removing fill, effect and layout grid rows in the Design panel, driven through egui headless: +//! adding a paint opens its colour picker; an open colour picker and open settings stay with their items, +//! and go when their item goes. use egui::{Event, Id, Pos2}; use figcraft_doc::NodeId; @@ -124,6 +125,14 @@ fn removing_effects_and_grids_keeps_open_settings_with_their_rows() { assert!(flag(&u, "grid_open", 0) && !flag(&u, "grid_open", 1)); } +/// The centre of the button labelled `label` (found in the AccessKit tree). +fn button(u: &mut Ui, label: &str) -> Pos2 { + let out = u.frame_output(vec![]); + let b = out.platform_output.accesskit_update.unwrap().nodes.into_iter().find(|(_, n)| n.label() == Some(label)).and_then(|(_, n)| n.bounds()); + let b = b.unwrap_or_else(|| panic!("no {label:?} button")); + Pos2::new(((b.x0 + b.x1) / 2.0) as f32, ((b.y0 + b.y1) / 2.0) as f32) +} + #[test] fn adding_a_fill_or_stroke_opens_the_color_picker() { let mut s = Session::new(); @@ -133,31 +142,28 @@ fn adding_a_fill_or_stroke_opens_the_color_picker() { u.ctx.enable_accesskit(); assert_eq!(u.app.ui.picker, None); - let out = u.frame_output(vec![]); - let add_fill = out - .platform_output - .accesskit_update - .unwrap() - .nodes - .into_iter() - .find(|(_, n)| n.label() == Some("Add fill")) - .and_then(|(_, n)| n.bounds()) - .map(|b| Pos2::new(((b.x0 + b.x1) / 2.0) as f32, ((b.y0 + b.y1) / 2.0) as f32)) - .expect("Add fill button"); + let add_fill = button(&mut u, "Add fill"); click(&mut u, add_fill); assert_eq!(u.app.ui.picker, Some(PickerTarget::Paint { fills: true, index: 1, ids: vec![r] })); - let out = u.frame_output(vec![]); - let add_stroke = out - .platform_output - .accesskit_update - .unwrap() - .nodes - .into_iter() - .find(|(_, n)| n.label() == Some("Add stroke")) - .and_then(|(_, n)| n.bounds()) - .map(|b| Pos2::new(((b.x0 + b.x1) / 2.0) as f32, ((b.y0 + b.y1) / 2.0) as f32)) - .expect("Add stroke button"); + let add_stroke = button(&mut u, "Add stroke"); click(&mut u, add_stroke); assert_eq!(u.app.ui.picker, Some(PickerTarget::Paint { fills: false, index: 0, ids: vec![r] })); } + +#[test] +fn adding_a_fill_to_mixed_fills_opens_no_picker() { + let mut s = Session::new(); + let a = id(s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 50, "height": 50})).unwrap()); + let b = id(s.execute("shape.rectangle", &json!({"x": 60, "y": 0, "width": 50, "height": 50})).unwrap()); + s.execute("fill.add", &json!({"ids": [b]})).unwrap(); + s.execute("select.set", &json!({"ids": [a, b]})).unwrap(); + let mut u = Ui::new(s); + u.ctx.enable_accesskit(); + + let add_fill = button(&mut u, "Add fill"); + click(&mut u, add_fill); + let doc = u.app.session.doc().unwrap(); + assert_eq!((doc.node(a).unwrap().fills.len(), doc.node(b).unwrap().fills.len()), (2, 3)); + assert_eq!(u.app.ui.picker, None); +} diff --git a/crates/ui-egui/src/right.rs b/crates/ui-egui/src/right.rs index 5899a949d..fcb137242 100644 --- a/crates/ui-egui/src/right.rs +++ b/crates/ui-egui/src/right.rs @@ -1101,13 +1101,11 @@ fn paints(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId], fills: empty, ) { if i == 1 { - if app.run(if fills { "fill.add" } else { "stroke.add" }, json!({"ids": ids})).is_some() { - if let Ok(doc) = app.session.doc() { - let count = ids.first().and_then(|id| doc.node(*id)).map_or(0, |n| if fills { n.fills.len() } else { n.strokes.len() }); - if count > 0 { - app.ui.picker = Some(crate::colorpicker::PickerTarget::Paint { fills, index: count - 1, ids: ids.clone() }); - } - } + // The new paint goes on top; open its picker. A mixed selection has no one index to edit. + if app.run(if fills { "fill.add" } else { "stroke.add" }, json!({"ids": ids})).is_some() + && let Some(l) = &list + { + app.ui.picker = Some(crate::colorpicker::PickerTarget::Paint { fills, index: l.len(), ids: ids.clone() }); } } else { style_picker::open(app, ui, &ids, slot); From b04403885716478797827b1c8a465de263b63e71 Mon Sep 17 00:00:00 2001 From: Jorrevdb <80039681+Jorrevdb@users.noreply.github.com> Date: Sat, 17 Oct 2026 10:49:01 +0200 Subject: [PATCH 152/817] UI: submenu hover fixes (stale state, safe triangle, hover delay) --- crates/ui-egui/src/a11y.rs | 3 +- crates/ui-egui/src/lib.rs | 2 + crates/ui-egui/src/menu_aim_tests.rs | 281 +++++++++++++++++++ crates/ui-egui/src/menus.rs | 392 ++++++++++++++++++++++----- crates/ui-egui/src/plugins_ui.rs | 4 +- 5 files changed, 617 insertions(+), 65 deletions(-) create mode 100644 crates/ui-egui/src/menu_aim_tests.rs diff --git a/crates/ui-egui/src/a11y.rs b/crates/ui-egui/src/a11y.rs index 824defd41..5fc098a47 100644 --- a/crates/ui-egui/src/a11y.rs +++ b/crates/ui-egui/src/a11y.rs @@ -942,10 +942,11 @@ pub fn menu_item(resp: &Response, label: &str, trail: &str, checked: Option Self { + let app = FigApp::new(Session::new(), Box::new(NoServices)); + let mut u = Self { ctx: egui::Context::default(), app, time: 0.0 }; + for _ in 0..3 { + u.frame(vec![]); + } + u + } + + fn frame(&mut self, events: Vec) { + self.time += 1.0 / 60.0; + let input = RawInput { screen_rect: Some(Rect::from_min_size(Pos2::ZERO, SIZE)), time: Some(self.time), events, ..Default::default() }; + let app = &mut self.app; + let mut out = self.ctx.run_ui(input, |ui| app.ui(ui)); + out.textures_delta.clear(); + } + + fn hover(&mut self, p: Pos2) { + self.frame(vec![Event::PointerMoved(p)]); + } + + /// Hover `p` and stay there until a submenu could open. + fn settle(&mut self, p: Pos2) { + self.hover(p); + self.wait(HOVER_DELAY + 0.05); + } + + /// Frames without input for `secs`. + fn wait(&mut self, secs: f64) { + let until = self.time + secs; + while self.time < until { + self.frame(vec![]); + } + } + + fn open_main_menu(&mut self) { + self.app.ui.main_menu = true; + // Somewhere off the menu: nothing hovered. + self.hover(pos2(900.0, 700.0)); + self.frame(vec![]); + } + + fn shown(&self, area: Id) -> bool { + self.ctx.memory(|m| m.areas().visible_layer_ids().contains(&LayerId::new(Order::Foreground, area))) + } + + fn rect(&self, area: Id) -> Rect { + self.ctx.memory(|m| m.area_rect(area)).expect("area drawn") + } + + /// The main menu's row for top-level menu `i` (File 0, Edit 1, View 2, …). + fn top_row(&self, i: usize) -> Rect { + let m = self.rect(main_menu_id()); + // Frame margin, the Actions row and the space under it. + let y = m.min.y + 8.0 + 30.0 + 6.0 + ROW * i as f32; + Rect::from_min_max(pos2(m.min.x + 8.0, y), pos2(m.max.x - 8.0, y + ROW)) + } + + /// Which top-level menus' panels show. + fn tops_shown(&self) -> Vec<&'static str> { + TOPS.iter().copied().filter(|t| self.shown(top(t))).collect() + } +} + +const TOPS: [&str; 6] = ["File", "Edit", "View", "Object", "Text", "Arrange"]; + +fn top(name: &str) -> Id { + Id::new(("menu", name)) +} + +/// The submenus of top-level menu `menu` (their keys), from the menu catalog. +fn submenu_keys(menu: &str) -> Vec { + let mut keys: Vec = figcraft_engine::catalog::MENU + .iter() + .filter_map(|m| m.menu.strip_prefix(menu).and_then(|r| r.strip_prefix('/')).map(|r| format!("{menu}/{}", r.split('/').next().unwrap_or(r)))) + .collect(); + keys.extend(figcraft_engine::catalog::MENU.iter().filter(|m| m.menu == menu && m.id == "file.openRecent").map(|m| format!("{menu}/{}", m.label))); + keys.dedup(); + keys +} + +#[test] +fn the_triangle_takes_the_pointer_from_the_row_toward_the_panel() { + let panel = Rect::from_min_max(pos2(300.0, 50.0), pos2(500.0, 650.0)); + let from = pos2(250.0, 100.0); + assert!(in_triangle(pos2(1.0, 1.0), pos2(0.0, 0.0), pos2(4.0, 0.0), pos2(0.0, 4.0))); + assert!(!in_triangle(pos2(3.0, 3.0), pos2(0.0, 0.0), pos2(4.0, 0.0), pos2(0.0, 4.0))); + // Diagonally down toward the panel: heading for it. + assert!(heading_for(from, pos2(260.0, 130.0), panel)); + // Straight down, straight up, back left, or far below the panel's reach: not. + assert!(!heading_for(from, pos2(250.0, 130.0), panel)); + assert!(!heading_for(from, pos2(250.0, 80.0), panel)); + assert!(!heading_for(from, pos2(240.0, 105.0), panel)); + assert!(!heading_for(from, pos2(260.0, 400.0), Rect::from_min_max(pos2(300.0, 50.0), pos2(500.0, 120.0)))); + // A panel on the left works the same way, mirrored. + let left = Rect::from_min_max(pos2(0.0, 50.0), pos2(200.0, 650.0)); + assert!(heading_for(from, pos2(240.0, 130.0), left)); + assert!(!heading_for(from, pos2(260.0, 130.0), left)); + // Junk positions never count. + assert!(!heading_for(pos2(f32::NAN, 0.0), from, panel)); +} + +#[test] +fn a_reopened_main_menu_shows_no_stale_submenu() { + let mut u = Ui::new(); + u.open_main_menu(); + assert!(u.tops_shown().is_empty(), "nothing open before hovering"); + u.settle(u.top_row(0).center()); + assert_eq!(u.tops_shown(), ["File"]); + // Escape closes it; it reopens without File open. + u.frame(vec![Event::Key { key: egui::Key::Escape, physical_key: None, pressed: true, repeat: false, modifiers: Default::default() }]); + u.frame(vec![]); + assert!(!u.app.ui.main_menu); + u.open_main_menu(); + assert!(u.tops_shown().is_empty(), "reopened with {:?} open", u.tops_shown()); + // Closed from outside (the menu button toggling it) it forgets too. + u.settle(u.top_row(1).center()); + assert_eq!(u.tops_shown(), ["Edit"]); + u.app.ui.main_menu = false; + u.frame(vec![]); + u.open_main_menu(); + assert!(u.tops_shown().is_empty(), "reopened with {:?} open", u.tops_shown()); +} + +#[test] +fn a_submenu_one_level_down_reopens_closed() { + let mut u = Ui::new(); + u.open_main_menu(); + u.settle(u.top_row(0).center()); + let keys = submenu_keys("File"); + assert!(!keys.is_empty(), "File has submenus"); + let sub_shown = |u: &Ui| keys.iter().find(|k| u.shown(Id::new(("submenu", k.as_str())))).cloned(); + // Down the middle of File's panel until one of its submenus opens. + let panel = u.rect(top("File")); + let mut y = panel.min.y + 10.0; + while sub_shown(&u).is_none() && y < panel.max.y { + u.settle(pos2(panel.center().x, y)); + y += 7.0; + } + let Some(open) = sub_shown(&u) else { panic!("no File submenu opened (looked for {keys:?})") }; + // Over to Edit and back to File: File shows, without its submenu. + u.hover(u.top_row(1).center()); + u.wait(AIM_REST + 0.1); + assert_eq!(u.tops_shown(), ["Edit"]); + u.hover(u.top_row(0).center()); + u.wait(AIM_REST + 0.1); + assert_eq!(u.tops_shown(), ["File"]); + assert_eq!(sub_shown(&u), None, "{open} came back open"); +} + +#[test] +fn crossing_rows_toward_the_open_submenu_keeps_it_open() { + let mut u = Ui::new(); + u.open_main_menu(); + let file = u.top_row(0); + let start = pos2(file.max.x - 30.0, file.center().y); + u.settle(start); + assert_eq!(u.tops_shown(), ["File"]); + // Diagonally across Edit and View into File's panel, a few rows down. + let panel = u.rect(top("File")); + let end = pos2(panel.min.x + 20.0, u.top_row(3).center().y); + for k in 1..=8 { + let p = start + (end - start) * (k as f32 / 8.0); + u.hover(p); + assert_eq!(u.tops_shown(), ["File"], "at {p:?}"); + } + assert!(panel.contains(end)); + u.wait(AIM_REST + 0.2); + assert_eq!(u.tops_shown(), ["File"]); +} + +#[test] +fn resting_on_a_crossed_row_hands_over_to_it() { + let mut u = Ui::new(); + u.open_main_menu(); + let file = u.top_row(0); + let start = pos2(file.max.x - 30.0, file.center().y); + u.settle(start); + // Toward the panel, stopping on View. + let view = u.top_row(2); + let stop = pos2(view.max.x - 4.0, view.center().y); + for k in 1..=4 { + u.hover(start + (stop - start) * (k as f32 / 4.0)); + } + assert_eq!(u.tops_shown(), ["File"], "still on the way"); + u.wait(AIM_REST + 0.1); + assert_eq!(u.tops_shown(), ["View"]); +} + +#[test] +fn moving_straight_down_switches_after_a_short_hover() { + let mut u = Ui::new(); + u.open_main_menu(); + let file = u.top_row(0); + u.settle(file.center()); + assert_eq!(u.tops_shown(), ["File"]); + // Down to Edit in small steps: no progress toward File's panel, so no triangle. + let edit = u.top_row(1).center(); + let mut p = file.center(); + while p.y < edit.y { + p.y = (p.y + 4.0).min(edit.y); + u.hover(p); + } + assert!(u.tops_shown().is_empty(), "File closes at once, Edit waits: {:?}", u.tops_shown()); + u.wait(HOVER_DELAY + 0.05); + assert_eq!(u.tops_shown(), ["Edit"]); +} + +#[test] +fn the_first_submenu_opens_after_a_short_hover() { + let mut u = Ui::new(); + u.open_main_menu(); + u.hover(u.top_row(0).center()); + u.frame(vec![]); + assert!(u.tops_shown().is_empty(), "opened at once"); + u.wait(HOVER_DELAY + 0.05); + assert_eq!(u.tops_shown(), ["File"]); +} + +#[test] +fn sweeping_across_rows_opens_only_where_the_pointer_stops() { + let mut u = Ui::new(); + u.open_main_menu(); + u.settle(u.top_row(0).center()); + // Quickly down the left of the rows, a row a frame, to Arrange. + for i in 1..=5 { + let r = u.top_row(i); + u.hover(pos2(r.min.x + 20.0, r.center().y)); + // (A panel drawn above the row the pointer is on goes the next frame.) + u.frame(vec![]); + assert!(u.tops_shown().is_empty(), "{:?} open on row {i}", u.tops_shown()); + } + u.wait(HOVER_DELAY + 0.05); + assert_eq!(u.tops_shown(), ["Arrange"]); +} + +#[test] +fn hovering_a_plain_row_closes_the_open_submenu_at_once() { + let mut u = Ui::new(); + u.open_main_menu(); + u.settle(u.top_row(0).center()); + assert_eq!(u.tops_shown(), ["File"]); + // Up onto the Actions row. + let m = u.rect(main_menu_id()); + u.hover(pos2(u.top_row(0).center().x, m.min.y + 8.0 + 15.0)); + assert!(u.tops_shown().is_empty(), "{:?} still open", u.tops_shown()); +} + +#[test] +fn leaving_the_menu_keeps_the_last_submenu() { + let mut u = Ui::new(); + u.open_main_menu(); + u.settle(u.top_row(1).center()); + // Off the menus onto the canvas. + u.hover(pos2(900.0, 700.0)); + u.wait(AIM_REST + 0.1); + assert_eq!(u.tops_shown(), ["Edit"]); +} diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index b9d3299a6..aa59d4b97 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -215,7 +215,7 @@ fn menu_level(app: &mut FigApp, ui: &mut Ui, prefix: &str) -> bool { subs.push(sub.clone()); last_sep = false; let full = format!("{prefix}/{sub}"); - if submenu(ui, prefix, &full, tr(&sub), &t, |ui| menu_level(app, ui, &full).then_some(())).is_some() { + if submenu(ui, &full, tr(&sub), &t, |ui| menu_level(app, ui, &full).then_some(())).is_some() { return true; } } @@ -231,7 +231,7 @@ fn menu_level(app: &mut FigApp, ui: &mut Ui, prefix: &str) -> bool { /// File ▸ Open recent: the recent files (greyed when the file is gone) and Clear recent. `key` is /// the menu's English label, `label` the one shown. Returns whether an item ran. fn recent_menu(app: &mut FigApp, ui: &mut Ui, prefix: &str, key: &str, label: &str, t: &Tokens) -> bool { - let picked = submenu(ui, prefix, &format!("{prefix}/{key}"), label, t, |ui| { + let picked = submenu(ui, &format!("{prefix}/{key}"), label, t, |ui| { let recents = &app.session.prefs.recent_files; let mut picked = None; for (i, p) in recents.iter().enumerate() { @@ -257,20 +257,285 @@ fn recent_menu(app: &mut FigApp, ui: &mut Ui, prefix: &str, key: &str, label: &s true } -/// A submenu row `label` in the menu at `prefix`; while it's open (hovered last), `add` draws its -/// items beside it. `key` is unique among the menu's submenus. Returns what `add` returned. -pub(crate) fn submenu(ui: &mut Ui, prefix: &str, key: &str, label: &str, t: &Tokens, add: impl FnOnce(&mut Ui) -> Option) -> Option { - let resp = submenu_item(ui, label, t); - let slot = Id::new(("submenu_open", prefix)); - if resp.hovered() || resp.has_focus() { - ui.data_mut(|d| d.insert_temp(slot, key.to_string())); +/// A submenu row `label` in the menu being drawn; while it's open, `add` draws its items beside +/// it. `key` names the submenu (its menu path, unique in its menu tree). Returns what `add` +/// returned. +pub(crate) fn submenu(ui: &mut Ui, key: &str, label: &str, t: &Tokens, add: impl FnOnce(&mut Ui) -> Option) -> Option { + submenu_at(ui, Id::new(("submenu", key)), key, label, 4.0, false, t, add) +} + +// --------------------------------------------------------------------------------------------- +// Which submenu is open: hover intent with a safe triangle. +// +// Every menu tree (the main menu, the context menu) keeps, per level, which of its submenus is +// open. Hovering another row closes the open submenu at once; resting on a submenu row for +// `HOVER_DELAY` opens it (sweeping across rows doesn't flash every submenu on the way). Except while the +// pointer is on its way from the open submenu's row to the submenu: while each move lands inside +// the triangle between where it was and the submenu's near edge (it keeps getting nearer), rows +// it crosses don't take over and the submenu's row stays highlighted. Resting (`AIM_REST`) or +// turning away ends that, and the row under the pointer takes over. Leaving the menus keeps the +// last submenu open. +// Closing a menu tree forgets all of it, so it reopens with no submenu open. + +/// How long the pointer stays on a submenu row before its submenu opens. +pub(crate) const HOVER_DELAY: f64 = 0.15; +/// How long the pointer may rest inside the safe triangle before the row under it takes over. +pub(crate) const AIM_REST: f64 = 0.3; +/// A pointer that moved less than this is resting. +const AIM_STILL: f32 = 1.0; +/// The triangle reaches this far above and below the submenu. +const AIM_EDGE_SLOP: f32 = 8.0; + +/// The hover state of one menu level. +#[derive(Clone, Default, Debug)] +struct Level { + /// The open submenu's key. + open: Option, + /// The open submenu's row and where its panel was drawn (last frame). + row: Option, + panel: Option, + /// The pointer's last position counted as heading for the panel, and when it got there. + apex: Option, + moved_at: f64, + /// This pass's verdict: the pointer is aiming at the panel. + pass: Option, + aiming: bool, + /// The row the pointer is on, waiting to take over (a submenu's key, or `None`: a plain row), + /// and since when; whether a row asked this pass (unasked, it lapses). + pending: Option<(Option, f64)>, + asked: bool, + /// When the pointer came to rest in the triangle, if that's what ended aiming this pass. + rested_at: Option, +} + +/// One menu tree's levels, by menu path ("" for the top). +#[derive(Clone, Default, Debug)] +struct Tree { + levels: std::collections::HashMap, +} + +/// The menu level a menu frame's ui draws: its tree's root and its path. +#[derive(Clone, Debug)] +struct At { + root: Id, + path: String, +} + +fn at_key(ui: &Ui) -> Id { + ui.id().with("menu_level") +} + +fn level_at(ui: &Ui) -> At { + ui.data(|d| d.get_temp::(at_key(ui))).unwrap_or(At { root: Id::new("menus"), path: String::new() }) +} + +fn with_level(ctx: &egui::Context, at: &At, f: impl FnOnce(&mut Level) -> R) -> R { + ctx.data_mut(|d| f(d.get_temp_mut_or_default::(at.root).levels.entry(at.path.clone()).or_default())) +} + +/// Forget everything a menu tree remembers (it closed or opened anew). +pub(crate) fn forget_tree(ctx: &egui::Context, root: Id) { + ctx.data_mut(|d| d.remove::(root)); +} + +/// Open (`Some(key)`) or close (`None`) a submenu of `root`'s level `path`; the levels below the +/// one it replaces are forgotten (they reopen closed). +fn set_open(ctx: &egui::Context, root: Id, path: &str, key: Option<&str>) { + ctx.data_mut(|d| { + let tree = d.get_temp_mut_or_default::(root); + let level = tree.levels.entry(path.to_string()).or_default(); + if level.open.as_deref() == key { + return; + } + let old = std::mem::replace(&mut level.open, key.map(str::to_string)); + level.row = None; + level.panel = None; + level.apex = None; + level.pending = None; + if let Some(old) = old { + let below = format!("{old}/"); + tree.levels.retain(|p, _| *p != old && !p.starts_with(&below)); + } + }); +} + +/// Whether `p` is in the triangle `a`, `b`, `c` (either winding, edges included). +pub(crate) fn in_triangle(p: egui::Pos2, a: egui::Pos2, b: egui::Pos2, c: egui::Pos2) -> bool { + let side = |u: egui::Pos2, v: egui::Pos2| (v.x - u.x) * (p.y - u.y) - (v.y - u.y) * (p.x - u.x); + let (d1, d2, d3) = (side(a, b), side(b, c), side(c, a)); + let neg = d1 < 0.0 || d2 < 0.0 || d3 < 0.0; + let pos = d1 > 0.0 || d2 > 0.0 || d3 > 0.0; + !(neg && pos) +} + +/// Whether a pointer that moved from `from` to `p` is heading for `panel`: `p` is inside the +/// triangle from `from` to the panel's near edge, so it got nearer the panel without leaving the +/// rows' way to it. Straight up or down (or away) isn't. +pub(crate) fn heading_for(from: egui::Pos2, p: egui::Pos2, panel: Rect) -> bool { + if ![from.x, from.y, p.x, p.y].iter().all(|v| v.is_finite()) { + return false; } - let open: Option = ui.data(|d| d.get_temp(slot)); - if open.as_deref() != Some(key) { + let edge = if panel.min.x >= from.x { + panel.min.x + } else if panel.max.x <= from.x { + panel.max.x + } else { + return false; + }; + in_triangle(p, from, pos2(edge, panel.min.y - AIM_EDGE_SLOP), pos2(edge, panel.max.y + AIM_EDGE_SLOP)) +} + +/// Whether the pointer is on its way to this level's open submenu (rows it crosses don't take +/// over). Worked out once per pass per level. +fn aiming(ui: &Ui) -> bool { + let at = level_at(ui); + let ctx = ui.ctx(); + let pass = ctx.cumulative_pass_nr(); + let (p, now) = ctx.input(|i| (i.pointer.hover_pos(), i.time)); + let (aiming, wait) = with_level(ctx, &at, |l| { + if l.pass == Some(pass) { + return (l.aiming, None); + } + l.pass = Some(pass); + l.aiming = false; + l.rested_at = None; + if !l.asked { + l.pending = None; + } + l.asked = false; + let (Some(p), Some(_), Some(panel)) = (p, l.open.as_ref(), l.panel) else { + l.apex = None; + return (false, None); + }; + if panel.contains(p) { + l.apex = None; + return (false, None); + } + // On the row (its bottom edge is the next row's). + if l.row.is_some_and(|r| (r.min.x..r.max.x).contains(&p.x) && (r.min.y..r.max.y).contains(&p.y)) { + l.apex = Some(p); + l.moved_at = now; + return (false, None); + } + let Some(from) = l.apex else { return (false, None) }; + if (p - from).length() <= AIM_STILL { + // Resting: the submenu holds a moment longer. + if !(0.0..AIM_REST).contains(&(now - l.moved_at)) { + l.apex = None; + // It has rested long enough: the row under it needn't wait again. + l.rested_at = Some(l.moved_at); + return (false, None); + } + } else if heading_for(from, p, panel) { + l.apex = Some(p); + l.moved_at = now; + } else { + l.apex = None; + return (false, None); + } + l.aiming = true; + (true, Some(AIM_REST - (now - l.moved_at))) + }); + // Wake up when the rest runs out, so the row under a still pointer takes over. + if let Some(w) = wait.filter(|w| w.is_finite() && *w > 0.0) { + ctx.request_repaint_after(std::time::Duration::from_secs_f64(w)); + } + aiming +} + +/// The pointer is on a row of level `at` (`target`: the row's submenu, or `None` for a plain +/// row): another open submenu closes at once, and `target` opens once the pointer has stayed +/// there `HOVER_DELAY`. +fn hover_request(ctx: &egui::Context, at: &At, target: Option<&str>) { + let now = ctx.input(|i| i.time); + if with_level(ctx, at, |l| l.open.is_some() && l.open.as_deref() != target) { + set_open(ctx, at.root, &at.path, None); + } + let left = with_level(ctx, at, |l| { + l.asked = true; + if l.open.as_deref() == target { + l.pending = None; + return None; + } + let since = match &l.pending { + Some((t, since)) if t.as_deref() == target => *since, + _ => { + let since = l.rested_at.unwrap_or(now); + l.pending = Some((target.map(str::to_string), since)); + since + } + }; + Some(HOVER_DELAY - (now - since)) + }); + match left { + Some(left) if left <= 0.0 => set_open(ctx, at.root, &at.path, target), + // Wake up when it's due, so a still pointer gets there. + Some(left) => ctx.request_repaint_after(std::time::Duration::from_secs_f64(left.min(HOVER_DELAY))), + None => {} + } +} + +/// Whether the pointer is on a row of level `at` other than the open submenu's (it shows as +/// hovered instead). +fn pending_elsewhere(ctx: &egui::Context, at: &At) -> bool { + with_level(ctx, at, |l| l.pending.as_ref().is_some_and(|(t, _)| *t != l.open)) +} + +/// A plain row of the level being drawn: hovering it (not while aiming at a submenu) closes the +/// level's open submenu. Returns whether it shows as hovered. +fn plain_row_hover(ui: &Ui, resp: &egui::Response) -> bool { + let hovered = resp.hovered() && !aiming(ui); + if hovered { + hover_request(ui.ctx(), &level_at(ui), None); + } + hovered || resp.has_focus() +} + +/// A submenu row whose panel (area `area`, `gap` right of the row) shows while it's open. +#[allow(clippy::too_many_arguments)] +fn submenu_at( + ui: &mut Ui, + area: Id, + key: &str, + label: &str, + gap: f32, + constrain: bool, + t: &Tokens, + add: impl FnOnce(&mut Ui) -> Option, +) -> Option { + let at = level_at(ui); + let aim = aiming(ui); + let w = ui.available_width(); + let (r, resp) = ui.allocate_exact_size(vec2(w, 28.0), Sense::click()); + // The keyboard and clicks open it at once; hovering after a moment. + if resp.has_focus() || resp.clicked() { + set_open(ui.ctx(), at.root, &at.path, Some(key)); + } else if resp.hovered() && !aim { + hover_request(ui.ctx(), &at, Some(key)); + } + let open = with_level(ui.ctx(), &at, |l| { + let open = l.open.as_deref() == Some(key); + if open { + l.row = Some(r); + } + open + }); + a11y::submenu(&resp, label, open); + a11y::own_focus(&resp); + // The open submenu's row stays highlighted while the pointer is in the submenu (not while it + // rests on another row of this menu). + let keep = open && !pending_elsewhere(ui.ctx(), &at); + paint_submenu_row(ui, r, label, keep || (resp.hovered() && !aim) || resp.has_focus(), t); + if !open { return None; } - let pos = pos2(resp.rect.max.x + 4.0, resp.rect.min.y - 8.0); - egui::Area::new(Id::new(("submenu", key))).fixed_pos(pos).order(egui::Order::Foreground).show(ui.ctx(), |ui| menu_frame(ui, t, add)).inner + let pos = pos2(r.max.x + gap, r.min.y - 8.0); + let child = At { root: at.root, path: key.to_string() }; + let shown = + egui::Area::new(area).fixed_pos(pos).order(egui::Order::Foreground).constrain(constrain).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)); + shown.inner } /// A thin line between groups of menu items. @@ -281,7 +546,8 @@ pub(crate) fn separator(ui: &mut Ui) { ui.add_space(4.0); } -fn menu_frame(ui: &mut Ui, t: &Tokens, add: impl FnOnce(&mut Ui) -> R) -> R { +/// A menu panel drawing menu level `at`. +fn menu_frame(ui: &mut Ui, t: &Tokens, at: At, add: impl FnOnce(&mut Ui) -> R) -> R { egui::Frame::NONE .fill(t.menu) .corner_radius(CornerRadius::same(13)) @@ -292,6 +558,8 @@ fn menu_frame(ui: &mut Ui, t: &Tokens, add: impl FnOnce(&mut Ui) -> R) -> R { let w = ui.data(|d| d.get_temp::(width_key(ui))).unwrap_or(0.0).max(MENU_W); 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) }) .inner @@ -328,7 +596,7 @@ fn indented_item(ui: &mut Ui, label: &str, shortcut: &str, enabled: bool, checke } // The keyboard's item is highlighted like the hovered one. a11y::own_focus(&resp); - let hov = (resp.hovered() || resp.has_focus()) && enabled; + let hov = plain_row_hover(ui, &resp) && enabled; if hov { ui.painter().rect_filled(r, CornerRadius::same(5), t.menu_hover); } @@ -348,24 +616,24 @@ fn indented_item(ui: &mut Ui, label: &str, shortcut: &str, enabled: bool, checke resp.clicked() } -fn submenu_item(ui: &mut Ui, label: &str, t: &Tokens) -> egui::Response { - let w = ui.available_width(); - let (r, resp) = ui.allocate_exact_size(vec2(w, 28.0), Sense::click()); - a11y::submenu(&resp, label); - a11y::own_focus(&resp); - if resp.hovered() || resp.has_focus() { +fn paint_submenu_row(ui: &mut Ui, r: Rect, label: &str, highlight: bool, t: &Tokens) { + if highlight { ui.painter().rect_filled(r, CornerRadius::same(5), t.menu_hover); } let galley = ui.painter().layout_no_wrap(label.to_string(), regular(12.0), t.menu_text); need_width(ui, 28.0 + galley.size().x + 28.0); ui.painter().galley(pos2(r.min.x + 28.0, r.center().y - galley.size().y / 2.0), galley, t.menu_text); icons::paint(ui.painter(), Rect::from_center_size(pos2(r.max.x - 12.0, r.center().y), vec2(12.0, 12.0)), Icon::ChevronRight, t.menu_text); - resp } /// Open the main menu at top-level menu `top` (control channel). pub fn open_main_menu(ctx: &egui::Context, top: &str) { - ctx.data_mut(|d| d.insert_temp(Id::new("main_open"), top.to_string())); + set_open(ctx, main_menu_id(), "", Some(top)); +} + +/// The context menu's area (and menu tree). +fn ctx_menu_id() -> Id { + Id::new("ctx_menu") } /// The main menu's area. @@ -394,13 +662,29 @@ const TOP_MENUS: &[&str] = &[ pub fn popups(app: &mut FigApp, ctx: &egui::Context) { let t = Tokens::get(ctx); + // A closed menu forgets its open submenus (and a context menu opened somewhere else starts + // afresh), so neither reopens with a stale submenu showing. + if !app.ui.main_menu { + forget_tree(ctx, main_menu_id()); + } + let ctx_at = app.ui.context_menu.as_ref().map(|(p, _)| *p); + let ctx_seen = Id::new("ctx_menu_at"); + if ctx.data(|d| d.get_temp::>(ctx_seen)) != Some(ctx_at) { + ctx.data_mut(|d| d.insert_temp(ctx_seen, ctx_at)); + forget_tree(ctx, ctx_menu_id()); + } + // Select layer opened or closed from the control channel. + if let Some(open) = ctx.data_mut(|d| d.remove_temp::(select_layer_ask_id())) { + set_open(ctx, ctx_menu_id(), "", open.then_some(SELECT_LAYER)); + } // 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, |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); @@ -418,20 +702,8 @@ pub fn popups(app: &mut FigApp, ctx: &egui::Context) { } ui.add_space(6.0); for top in TOP_MENUS { - let resp = submenu_item(ui, tr(top), &t); - if resp.hovered() || resp.has_focus() { - ui.data_mut(|d| d.insert_temp(Id::new("main_open"), top.to_string())); - } - let open: Option = ui.data(|d| d.get_temp(Id::new("main_open"))); - if open.as_deref() == Some(*top) { - let pos = pos2(resp.rect.max.x + 12.0, resp.rect.min.y - 8.0); - egui::Area::new(Id::new(("menu", *top))).fixed_pos(pos).order(egui::Order::Foreground).show(ui.ctx(), |ui| { - menu_frame(ui, &t, |ui| { - if menu_level(app, ui, top) { - close = true; - } - }); - }); + if submenu_at(ui, Id::new(("menu", *top)), top, tr(top), 12.0, false, &t, |ui| menu_level(app, ui, top).then_some(())).is_some() { + close = true; } } }); @@ -439,6 +711,7 @@ pub fn popups(app: &mut FigApp, ctx: &egui::Context) { 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; + forget_tree(ctx, main_menu_id()); } } // Context menu (from the keyboard: at the focused layer row or the canvas selection, taking the @@ -451,8 +724,8 @@ pub fn popups(app: &mut FigApp, ctx: &egui::Context) { a11y::popup(&mut app.ui.nav, f, Id::new("ctx_menu")); } let mut close = false; - let area = egui::Area::new(Id::new("ctx_menu")).fixed_pos(pos).order(egui::Order::Foreground).constrain(true).show(ctx, |ui| { - menu_frame(ui, &t, |ui| { + let area = egui::Area::new(ctx_menu_id()).fixed_pos(pos).order(egui::Order::Foreground).constrain(true).show(ctx, |ui| { + menu_frame(ui, &t, At { root: ctx_menu_id(), path: String::new() }, |ui| { if select_layer_menu(app, ui, pos, &t) { close = true; } @@ -548,20 +821,23 @@ pub fn popups(app: &mut FigApp, ctx: &egui::Context) { let clicked_outside = ctx.input(|i| i.pointer.any_pressed()) && !area.response.hovered() && !over_menu(ctx); if close || clicked_outside || ctx.input(|i| i.key_pressed(egui::Key::Escape)) { app.ui.context_menu = None; - ctx.data_mut(|d| d.remove::(select_layer_id())); + forget_tree(ctx, ctx_menu_id()); } } crate::colorpicker::show(app, ctx); palette(app, ctx); } -fn select_layer_id() -> Id { - Id::new("ctx_select_layer_open") +/// The context menu's Select layer submenu (its key in the context menu's tree). +const SELECT_LAYER: &str = "Select layer"; + +fn select_layer_ask_id() -> Id { + Id::new("ctx_select_layer_ask") } -/// Open (or close) the context menu's Select layer submenu. +/// Open (or close) the context menu's Select layer submenu (applied when the menu next draws). pub fn open_select_layer(ctx: &egui::Context, open: bool) { - ctx.data_mut(|d| d.insert_temp(select_layer_id(), open)); + ctx.data_mut(|d| d.insert_temp(select_layer_ask_id(), open)); } /// The context menu's "Select layer" submenu (right-click on the canvas): every layer under the @@ -585,23 +861,15 @@ fn select_layer_menu(app: &mut FigApp, ui: &mut Ui, pos: egui::Pos2, t: &Tokens) return false; } let sel = ds.selection.clone(); - let resp = submenu_item(ui, tr("Select layer"), t); - if resp.hovered() { - ui.data_mut(|d| d.insert_temp(select_layer_id(), true)); - } - let mut picked = None; - if ui.data(|d| d.get_temp::(select_layer_id())).unwrap_or(false) { - let at = pos2(resp.rect.max.x + 4.0, resp.rect.min.y - 8.0); - egui::Area::new(Id::new("ctx_select_layer")).fixed_pos(at).order(egui::Order::Foreground).constrain(true).show(ui.ctx(), |ui| { - menu_frame(ui, t, |ui| { - for (id, depth, name) in &layers { - if indented_item(ui, name, "", true, sel.contains(id), 12.0 * (*depth).min(8) as f32, t) { - picked = Some(*id); - } - } - }); - }); - } + let picked = submenu_at(ui, Id::new("ctx_select_layer"), SELECT_LAYER, tr("Select layer"), 4.0, true, t, |ui| { + let mut picked = None; + for (id, depth, name) in &layers { + if indented_item(ui, name, "", true, sel.contains(id), 12.0 * (*depth).min(8) as f32, t) { + picked = Some(*id); + } + } + picked + }); separator(ui); match picked { Some(id) => { diff --git a/crates/ui-egui/src/plugins_ui.rs b/crates/ui-egui/src/plugins_ui.rs index 481b446c3..745cde881 100644 --- a/crates/ui-egui/src/plugins_ui.rs +++ b/crates/ui-egui/src/plugins_ui.rs @@ -151,7 +151,7 @@ pub fn menu(app: &mut FigApp, ui: &mut Ui, t: &Tokens) -> bool { } } commands => { - let picked = crate::menus::submenu(ui, "Plugins", &format!("Plugins/plugin:{}", m.id), &m.name, t, |ui| { + let picked = crate::menus::submenu(ui, &format!("Plugins/plugin:{}", m.id), &m.name, t, |ui| { commands.iter().find(|c| crate::menus::item(ui, &c.label, "", true, false, t)).map(|c| c.id.clone()) }); if let Some(c) = picked { @@ -164,7 +164,7 @@ pub fn menu(app: &mut FigApp, ui: &mut Ui, t: &Tokens) -> bool { app.session.prefs.plugins.iter().filter(|p| p.manifest.widget).map(|p| (p.manifest.id.as_str(), p.manifest.name.as_str())).collect(); let widget = (!widgets.is_empty()) .then(|| { - crate::menus::submenu(ui, "Plugins", "Plugins/widgets", tr("Widgets"), t, |ui| { + crate::menus::submenu(ui, "Plugins/widgets", tr("Widgets"), t, |ui| { widgets.iter().find(|(_, name)| crate::menus::item(ui, name, "", true, false, t)).map(|(id, _)| id.to_string()) }) }) From 01ce23ca765fabba5ec22bd83de5684614e259d3 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 15:58:23 +0700 Subject: [PATCH 153/817] #680: page refusal names the calling command (edit.copy / edit.cut) --- crates/engine/src/cmd/edit.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index ab503a022..226109344 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -496,13 +496,13 @@ fn bump_name(n: &str) -> String { } /// The copied form of the selection. -pub fn copy_to_clipboard(s: &mut Session, ids: &[NodeId]) -> Result<()> { +pub fn copy_to_clipboard(s: &mut Session, cmd: &str, ids: &[NodeId]) -> Result<()> { let ds = s.ds()?; let doc = &ds.doc; // Pages are not layers: they can't be pasted anywhere. let layers: Vec = ids.iter().copied().filter(|i| !doc.node(*i).is_some_and(Node::is_page)).collect(); if layers.is_empty() && !ids.is_empty() { - return Err(EngineError::Disabled("edit.copy".into(), "pages can't be copied; use page.duplicate".into())); + return Err(EngineError::Disabled(cmd.into(), "pages can't be copied; use page.duplicate".into())); } let ids = z_sorted(doc, &roots(doc, &layers)); let mut nodes = Vec::new(); @@ -540,13 +540,13 @@ pub fn copy_to_clipboard(s: &mut Session, ids: &[NodeId]) -> Result<()> { fn copy(s: &mut Session, p: &Value) -> Result { let ids = req_targets("edit.copy", s, p)?; - copy_to_clipboard(s, &ids)?; + copy_to_clipboard(s, "edit.copy", &ids)?; Ok(json!({"copied": s.clipboard.nodes.len()})) } fn cut(s: &mut Session, p: &Value) -> Result { let ids = req_targets("edit.cut", s, p)?; - copy_to_clipboard(s, &ids)?; + copy_to_clipboard(s, "edit.cut", &ids)?; let doc = s.doc()?; let layers: Vec = ids.into_iter().filter(|i| !doc.node(*i).is_some_and(Node::is_page)).collect(); delete(s, &json!({"ids": layers})) From 5ea5590673bff20d96097b37cc6e2177e9c69348 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 15:58:24 +0700 Subject: [PATCH 154/817] #680: move the page clipboard test to its own module, check the error id --- crates/engine/src/lib.rs | 2 ++ crates/engine/src/page_clipboard_tests.rs | 36 +++++++++++++++++++++++ crates/engine/src/tests.rs | 17 ----------- 3 files changed, 38 insertions(+), 17 deletions(-) create mode 100644 crates/engine/src/page_clipboard_tests.rs diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 6e0e8b125..9f00467a7 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1592,6 +1592,8 @@ mod open_issues_tests; #[cfg(test)] mod outline_options_tests; #[cfg(test)] +mod page_clipboard_tests; +#[cfg(test)] mod page_copy_navigation_tests; #[cfg(test)] mod page_target_tests; diff --git a/crates/engine/src/page_clipboard_tests.rs b/crates/engine/src/page_clipboard_tests.rs new file mode 100644 index 000000000..79ff74199 --- /dev/null +++ b/crates/engine/src/page_clipboard_tests.rs @@ -0,0 +1,36 @@ +//! `edit.copy` / `edit.cut` skip pages (they aren't layers and can't be pasted), and refuse a +//! selection of only pages under their own command id. + +use serde_json::json; + +use crate::{EngineError, Session}; + +#[test] +fn copy_and_cut_ignore_pages_so_paste_keeps_the_document_valid() { + for cmd in ["edit.copy", "edit.cut"] { + let mut s = Session::new(); + let page = s.page().unwrap(); + s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap(); + match s.execute(cmd, &json!({"ids": [page.0]})) { + Err(EngineError::Disabled(id, _)) => assert_eq!(id, cmd), + r => panic!("{cmd} on a page: {r:?}"), + } + let _ = s.execute("edit.paste", &json!({})); + let doc = s.doc().unwrap(); + assert!(doc.validate().is_empty(), "{cmd}: {:?}", doc.validate()); + assert!(doc.node(page).is_some(), "{cmd} removed the page"); + } +} + +#[test] +fn cut_of_a_page_and_a_layer_moves_only_the_layer() { + let mut s = Session::new(); + let page = s.page().unwrap(); + let r = s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap(); + let rect = crate::params::id_of(&r["id"]).unwrap(); + s.execute("edit.cut", &json!({"ids": [page.0, rect.0]})).unwrap(); + assert!(s.doc().unwrap().node(page).is_some()); + assert!(s.doc().unwrap().node(rect).is_none()); + s.execute("edit.paste", &json!({})).unwrap(); + assert!(s.doc().unwrap().validate().is_empty()); +} diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index 6010559e7..dbf432d41 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -621,20 +621,3 @@ fn find_replace_changing_only_the_case_replaces_every_occurrence() { assert_eq!(s.doc().unwrap().node(t).unwrap().kind.text().unwrap().characters, "FigCraft and FigCraft, FigCraft"); assert_eq!(s.doc().unwrap().node(f).unwrap().name, "FigCraft / FigCraft"); } - -#[test] -fn copy_and_cut_ignore_pages_so_paste_keeps_the_document_valid() { - for cmd in ["edit.copy", "edit.cut"] { - let mut s = sess(); - let page = s.page().unwrap(); - s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap(); - let r = s.execute(cmd, &json!({"ids": [page.0]})); - if let Ok(v) = &r { - assert!(v.get("deleted").is_none_or(|d| d == &json!([])), "{cmd} reported the page as deleted: {v}"); - } - let _ = s.execute("edit.paste", &json!({})); - let doc = s.doc().unwrap(); - assert!(doc.validate().is_empty(), "{cmd}: {:?}", doc.validate()); - assert!(doc.node(page).is_some(), "{cmd} removed the page"); - } -} From 5e2913db34ba306176864cce5309690146dcab75 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 15:59:52 +0700 Subject: [PATCH 155/817] #679: leave the progress docs to the maintainer --- docs/components-parity.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/components-parity.md b/docs/components-parity.md index 8ad788bf1..659676fd4 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-10-16 · **Change:** minor (variant properties reorder by dragging in the Properties section; 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-10-14 · **Change:** minor (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 @@ -19,7 +19,7 @@ accounts). | Component sets / variants, add variant, switch | done | | | 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 variant property by its left margin in the Properties section (or `component.editProperty {index}`); variant properties reorder among themselves; boolean, text, instance swap and slot properties keep a fixed (alphabetical) order | +| Variant property order (names rewritten), duplicate combinations reported | done | reordering through `component.editProperty {index}`; no drag in the panel yet | | Properties: boolean, text, instance swap (preferred values), variant | done | | | Slots (preferred components, fill menu, kept across updates) | done | Figma 2025 feature | | Exposed nested instances | done | hidden ones hide their properties | @@ -76,7 +76,6 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`. | Date | Change | Summary | |---|---|---| -| 2026-10-16 | minor | Variant properties reorder by dragging their left margin in a component or set's Properties section (insertion line, Escape cancels, one undo step; instances follow) | | 2026-10-14 | minor | Variables export in the browser: Export… ▸ Variables JSON / CSS custom properties did nothing in the web build, which has no save dialogs; it now hands the file over as a download (`Services::downloads` / `download`, `variables_export_ui_tests`). Import in the browser still needs a file picker, as do the other exports there. Numbers unchanged. | | 2026-10-13 | minor | Component playground (M3): with an instance, a component or a component set selected, the Inspect tab shows a Playground: a preview of the component and a control for each variant, boolean and text property. What is tried there changes the preview and the code in the Code section, never the file (no undo step, the canvas instance stays as it is); Reset goes back to the component's or the instance's own values. `component.playground {id?, properties?, language?, path?}` gives the same to scripts: the properties with their values, the code, and a PNG on request (`playground_tests`). Left: instance-swap and slot properties in the playground (the command takes an instance swap; the panel has no control for it), a code connect template's snippet with the tried values. Numbers unchanged. | | 2026-10-13 | minor | Variables inside styles (M3): a shared style can bind variables to fields of its value (`style.bind {style, field, variable?}`: a paint style's colours and gradient stops, an effect style's colour, radius, spread and offsets, a grid style's size, count, gutter and offset, a text style's font size, line height, letter spacing, family and style). Every layer using the style shows those fields resolved in its own modes and stays linked when a variable or a mode changes; the style keeps them resolved in the default modes. A style made from a layer keeps that layer's bindings; a new value drops bindings to what is gone. The style editor binds from its property rows (paint colour, shadow colour, blur radius, grid size) and detaches from the variable's chip; the style picker marks styles that use variables. `.fig` export and import carry the bindings on the style, REST layers hand theirs to the style they use. Left: binding text style fields and the other effect and grid fields from the editor (commands only), library variables in the picker, a style's library copy. Numbers unchanged. | From 6f0e14a27176a4399888d46955fe8a29445665c0 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 16:03:41 +0700 Subject: [PATCH 156/817] #673: read the failed step with get() instead of indexing --- apps/figcraft-cli/src/files.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/figcraft-cli/src/files.rs b/apps/figcraft-cli/src/files.rs index 46c8dd221..3e08474a2 100644 --- a/apps/figcraft-cli/src/files.rs +++ b/apps/figcraft-cli/src/files.rs @@ -350,7 +350,8 @@ pub fn run_script(script: &str, input: Option<&str>, out: Option<&str>) -> CliRe Ok(()) }); if let Err(e) = outcome { - let (i, (cmd, _)) = (failed_at, &steps[failed_at]); + let cmd = steps.get(failed_at).map_or("", |(cmd, _)| cmd.as_str()); + let i = failed_at; println!("{}", json!({"step": i, "command": cmd, "ok": false, "error": e.to_string(), "rolledBack": true})); eprintln!("error: step {i} ({cmd}) failed: {e}"); eprintln!("the script's document changes were rolled back"); From 1503f0743cbc440892dbc60b4dc8615d5d0f2955 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 16:06:26 +0700 Subject: [PATCH 157/817] #675: cap the offending value echoed in id/ids errors --- .../engine/src/id_params_behaviour_tests.rs | 10 ++++++++++ crates/engine/src/params.rs | 19 +++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/id_params_behaviour_tests.rs b/crates/engine/src/id_params_behaviour_tests.rs index ae77c8a13..c5207b44e 100644 --- a/crates/engine/src/id_params_behaviour_tests.rs +++ b/crates/engine/src/id_params_behaviour_tests.rs @@ -149,3 +149,13 @@ fn an_image_and_an_instance_parent_are_checked_the_same_way() { let inst = failed(s.execute("instance.create", &json!({"component": 99999, "parent": {"$step": 0}}))); assert!(inst.is_some(), "instance.create refuses both a bad component and a bad parent"); } + +#[test] +fn a_huge_bad_value_is_cut_short_in_the_error() { + let mut s = Session::new(); + card(&mut s); + let junk = "é".repeat(10_000); + let msg = failed(s.execute("node.set", &json!({"ids": junk, "props": {"name": "renamed"}}))).unwrap_or_else(|| panic!("must fail")); + assert!(msg.contains("`ids` must be an array") && msg.ends_with("…)"), "{msg}"); + assert!(msg.chars().count() < 200, "{} chars", msg.chars().count()); +} diff --git a/crates/engine/src/params.rs b/crates/engine/src/params.rs index 67a5b80a8..35a74e0e5 100644 --- a/crates/engine/src/params.rs +++ b/crates/engine/src/params.rs @@ -88,6 +88,17 @@ pub fn req_id(cmd: &str, p: &Value, key: &str) -> Result { id(p, key).ok_or_else(|| bad(cmd, format!("`{key}` must be a node id"))) } +/// The offending value for an error message, cut to a few dozen characters so a huge param +/// doesn't end up in the error whole. +fn shown(v: &Value) -> String { + const MAX: usize = 40; + let text = v.to_string(); + match text.char_indices().nth(MAX) { + Some((cut, _)) => format!("{}…", &text[..cut]), + None => text, + } +} + /// `key` when it is there: a layer id, or an error naming it. Missing and `null` mean "none", so a /// command can tell "no parent given" (use the page) from "a parent was given that isn't an id" — /// which is a mistake, not the default. Without this, `{"$step": 0}` reaching a param that isn't @@ -95,7 +106,7 @@ pub fn req_id(cmd: &str, p: &Value, key: &str) -> Result { pub fn opt_id(cmd: &str, p: &Value, key: &str) -> Result> { match get(p, key) { None | Some(Value::Null) => Ok(None), - Some(v) => id_of(v).map(Some).ok_or_else(|| bad(cmd, format!("`{key}` must be a node id (got {v})"))), + Some(v) => id_of(v).map(Some).ok_or_else(|| bad(cmd, format!("`{key}` must be a node id (got {})", shown(v)))), } } @@ -125,17 +136,17 @@ pub fn req_targets(cmd: &str, s: &Session, p: &Value) -> Result> { match get(p, "ids") { Some(Value::Array(a)) => { if let Some(v) = a.iter().find(|v| id_of(v).is_none()) { - return Err(bad(cmd, format!("`ids`: every entry must be a node id (got {v})"))); + return Err(bad(cmd, format!("`ids`: every entry must be a node id (got {})", shown(v)))); } } Some(Value::Null) | None => { if let Some(v) = get(p, "id").filter(|v| !v.is_null()) && id_of(v).is_none() { - return Err(bad(cmd, format!("`id` must be a node id (got {v})"))); + return Err(bad(cmd, format!("`id` must be a node id (got {})", shown(v)))); } } - Some(v) => return Err(bad(cmd, format!("`ids` must be an array (got {v})"))), + Some(v) => return Err(bad(cmd, format!("`ids` must be an array (got {})", shown(v)))), } let t = targets(s, p); if t.is_empty() { From e095ef1fe1b35aa7e19c06b606f2dadf56afc6dd Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 16:08:01 +0700 Subject: [PATCH 158/817] #652: note that a file stamped in the future is re-read until the clock passes it --- crates/engine/src/library.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/engine/src/library.rs b/crates/engine/src/library.rs index 5f87c8628..daa1f5bd3 100644 --- a/crates/engine/src/library.rs +++ b/crates/engine/src/library.rs @@ -459,6 +459,8 @@ struct Entry { const RACY_STAMP: std::time::Duration = std::time::Duration::from_secs(2); impl Entry { + /// A file stamped in the future (clock skew, unpacked archives) never settles: it is re-read on + /// every load until the clock passes it. fn still_valid(&self, now: &Stamp) -> bool { let settled = match (now.modified, self.read_at) { (Some(modified), Some(read_at)) => modified.checked_add(RACY_STAMP).is_some_and(|t| t < read_at), From 3c73045088480866d6dfd9bf9604a9513ced0677 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 16:11:59 +0700 Subject: [PATCH 159/817] #705: cap what a client buffers from a server at 1 GiB; warn the operator about files over 64 MiB when open and over what the app opens --- apps/figcraft-server/src/config.rs | 14 ++++++++++++++ apps/figcraft-server/src/public_tests.rs | 21 +++++++++++++++++---- crates/collab-net/src/limits.rs | 9 ++++----- docs/server.md | 2 +- 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/apps/figcraft-server/src/config.rs b/apps/figcraft-server/src/config.rs index 3e951e875..101c7815f 100644 --- a/apps/figcraft-server/src/config.rs +++ b/apps/figcraft-server/src/config.rs @@ -135,9 +135,23 @@ impl Config { /// abuse contact, or one whose clients would all count as its proxy). pub fn warnings(&self) -> Vec { let mut out = Vec::new(); + let client_max = NetLimits::default().max_server_message >> 20; + if usize::try_from(self.file_mb()).is_ok_and(|mb| mb >= client_max) { + out.push(format!( + "max_file_mb is {}: the app opens files of up to {} MiB, so a file that large can't be opened", + self.file_mb(), + client_max - 1 + )); + } if !self.open_publish { return out; } + if self.file_mb() > 64 { + out.push(format!( + "open_publish is on with max_file_mb = {}: anyone may send messages that large, and the memory set aside for reading and queueing them grows to eight times it; keep it at 64 or less on a public server", + self.file_mb() + )); + } if self.operator_contact.trim().is_empty() { out.push("open_publish is on but operator_contact is empty: people can't reach you about abuse; set it (and terms_url)".into()); } diff --git a/apps/figcraft-server/src/public_tests.rs b/apps/figcraft-server/src/public_tests.rs index 6403212c4..978d9e8ee 100644 --- a/apps/figcraft-server/src/public_tests.rs +++ b/apps/figcraft-server/src/public_tests.rs @@ -506,8 +506,21 @@ fn files_above_64_mib_fit_every_limit() { assert!(net.max_reading_total >= net.max_reading_block && net.max_queued_total >= net.max_queued_block); assert!(core.max_message_bytes > file, "open={open_publish}: {}", core.max_message_bytes); } - // A client takes the largest file any server can keep, or as much as a 32-bit target can address - // (computed in u64: `4097 << 20` in a 32-bit usize wraps to 1 MiB). - let client = NetLimits::default().max_server_message as u64; - assert!(client > 4096 << 20 || client == u64::from(u32::MAX), "{client}"); + // A client takes such a file too, but caps what any server may make it buffer at 1 GiB. + assert_eq!(NetLimits::default().max_server_message, 1 << 30); +} + +#[test] +fn large_files_warn_the_operator() { + let public_url = Some("wss://figcraft.example.com/".into()); + let warns = |open_publish, mb| { + Config { open_publish, max_file_mb: Some(mb), public_url: public_url.clone(), ..Config::default() }.warnings().join( + " +", + ) + }; + assert!(!warns(true, 64).contains("max_file_mb"), "{}", warns(true, 64)); + assert!(warns(true, 65).contains("open_publish is on with max_file_mb = 65"), "{}", warns(true, 65)); + assert!(!warns(false, 1023).contains("max_file_mb"), "{}", warns(false, 1023)); + assert!(warns(false, 1024).contains("can't be opened"), "{}", warns(false, 1024)); } diff --git a/crates/collab-net/src/limits.rs b/crates/collab-net/src/limits.rs index 021677703..a0647fa6a 100644 --- a/crates/collab-net/src/limits.rs +++ b/crates/collab-net/src/limits.rs @@ -12,10 +12,9 @@ pub struct NetLimits { /// before: its hello. pub max_client_message: usize, pub max_hello: usize, - /// Largest message a client accepts from the host (a welcome carries the whole document): the - /// largest file a `figcraft-server` can be set to keep (`max_file_mb`, at most 4096) and a margin, - /// so a client can open every file a server takes; on a 32-bit target (the browser) as much as - /// `usize` holds. + /// Largest message a client accepts from the host (a welcome carries the whole document): 1 GiB, + /// room for any file up to 1023 MiB and well past the servers' defaults, while a hostile server + /// (any link can name one) can't make the app or a browser tab buffer more than that. pub max_server_message: usize, /// Messages a client may send per second on average, and in a burst; beyond that it is /// disconnected. @@ -64,7 +63,7 @@ impl Default for NetLimits { max_connections: 64, max_client_message: figcraft_collab::Limits::default().max_message_bytes, max_hello: 64 << 10, - max_server_message: usize::try_from(4097u64 << 20).unwrap_or(usize::MAX), + max_server_message: 1 << 30, rate: 100.0, burst: 400.0, hello_timeout: Duration::from_secs(10), diff --git a/docs/server.md b/docs/server.md index 55d784f43..5cbab6a8b 100644 --- a/docs/server.md +++ b/docs/server.md @@ -282,7 +282,7 @@ are errors): | `data` | `figcraft-data` | The data directory | | `public_url` | (the listen address) | How links name the server, when people reach it another way (a reverse proxy: `wss://figcraft.example.com/`) | | `max_files` | 1000 | Most files kept | -| `max_file_mb` | 64 (16 when open) | Largest file (its snapshot), in MiB; a welcome carries the whole file, so messages may be as large as a file and 1 MiB (at least 64 MiB on a private server) | +| `max_file_mb` | 64 (16 when open) | Largest file (its snapshot), in MiB; a welcome carries the whole file, so messages may be as large as a file and 1 MiB (at least 64 MiB on a private server). The app opens files of up to 1023 MiB; above 64 with `open_publish` the server warns | | `max_links` | 100 | Most share links per file | | `max_connections` | 512 | Most open connections | | `max_people` | 256 | Most people in one file at once | From 02b231db6dd9457097017ddc30d96d8a947c724d Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 16:18:50 +0700 Subject: [PATCH 160/817] #712: read the invite link from the URL fragment (#join=), never sent to the web host; ignore overlong links --- apps/figcraft-web/src/main.rs | 10 ++++++---- apps/figcraft-web/src/query.rs | 21 +++++++++++-------- apps/figcraft-web/src/query_tests.rs | 30 ++++++++++++++++++---------- apps/figcraft-web/src/web.rs | 6 +++--- 4 files changed, 41 insertions(+), 26 deletions(-) diff --git a/apps/figcraft-web/src/main.rs b/apps/figcraft-web/src/main.rs index 35aebb02e..7eed2ffb3 100644 --- a/apps/figcraft-web/src/main.rs +++ b/apps/figcraft-web/src/main.rs @@ -13,10 +13,12 @@ //! (browsers block `ws://` from secure pages); serve it over `http://` on a trusted network to //! join from other machines. //! -//! URL query: `?webgl` forces the WebGL2 backend instead of WebGPU; `?join=` joins that live session once the page has loaded, so a bookmark opens a shared file. -//! `join` takes the rest of the query: put it last. The link carries the session's secret, so the -//! URL (and the browser history) is as private as the link itself. +//! URL query flag: `?webgl` forces the WebGL2 backend instead of WebGPU. +//! +//! URL fragment: `#join=` joins that live session once the page has +//! loaded, so a bookmark opens a shared file. `join` takes the rest of the fragment: put it last. +//! The link carries the session's secret; a fragment is never sent to the web host, but the address +//! bar and the browser history keep it, so the URL is as private as the link itself. #[cfg(any(target_arch = "wasm32", test))] mod query; diff --git a/apps/figcraft-web/src/query.rs b/apps/figcraft-web/src/query.rs index be68f598b..befeb36b7 100644 --- a/apps/figcraft-web/src/query.rs +++ b/apps/figcraft-web/src/query.rs @@ -1,10 +1,15 @@ -//! The page's URL query: which flags it sets and the invite link it names. +//! The page's URL: the invite link its fragment names. -/// The invite link in `?join=` (`search` is `location.search`, with or without its `?`), still -/// escaped. `join` takes the rest of the query, so a pasted `figcraft://join?host=…&file=…&token=…` -/// keeps its own `&`s; put it last. -pub fn join_link(search: &str) -> Option<&str> { - let query = search.strip_prefix('?').unwrap_or(search); - let start = if query.starts_with("join=") { 0 } else { query.find("&join=")? + 1 }; - query.get(start + "join=".len()..).filter(|link| !link.is_empty()) +/// The invite link in `#join=` (`fragment` is `location.hash`, with or without its `#`), still +/// escaped. The fragment, unlike the query, never leaves the browser, so the link's secret stays out +/// of the web host's logs and `Referer` headers. `join` takes the rest of the fragment, so a pasted +/// `figcraft://join?host=…&file=…&token=…` keeps its own `&`s. Anything longer than an escaped invite +/// link can be is ignored; what is left is checked by `collab.join` like a link the desktop app is +/// opened with. +pub fn join_link(fragment: &str) -> Option<&str> { + // An invite link is at most 2 KiB; every byte of it escaped is three. + const MAX: usize = 3 * 2048; + let fragment = fragment.strip_prefix('#').unwrap_or(fragment); + let start = if fragment.starts_with("join=") { 0 } else { fragment.find("&join=")? + 1 }; + fragment.get(start + "join=".len()..).filter(|link| !link.is_empty() && link.len() <= MAX) } diff --git a/apps/figcraft-web/src/query_tests.rs b/apps/figcraft-web/src/query_tests.rs index 9582682f2..261ebaeb6 100644 --- a/apps/figcraft-web/src/query_tests.rs +++ b/apps/figcraft-web/src/query_tests.rs @@ -1,21 +1,29 @@ -//! `?join=` in the page's URL. +//! `#join=` in the page's URL. use crate::query::join_link; #[test] -fn join_takes_the_rest_of_the_query() { +fn join_takes_the_rest_of_the_fragment() { let link = "figcraft://join?host=192.168.1.20:47900&file=abc&token=AbCdEfGhIjKlMnOpQrStUv"; - assert_eq!(join_link(&format!("?join={link}")), Some(link), "a pasted link keeps its own &s"); - assert_eq!(join_link(&format!("?webgl&join={link}")), Some(link), "after other flags"); - assert_eq!(join_link("?join=figcraft%3A%2F%2Fjoin%3Fhost%3Dh"), Some("figcraft%3A%2F%2Fjoin%3Fhost%3Dh"), "escaped, decoded later"); - assert_eq!(join_link("join=K7M-2QX-9TD"), Some("K7M-2QX-9TD"), "a join code, no leading ?"); + assert_eq!(join_link(&format!("#join={link}")), Some(link), "a pasted link keeps its own &s"); + assert_eq!(join_link(&format!("#x=1&join={link}")), Some(link), "after other entries"); + assert_eq!(join_link("#join=figcraft%3A%2F%2Fjoin%3Fhost%3Dh"), Some("figcraft%3A%2F%2Fjoin%3Fhost%3Dh"), "escaped, decoded later"); + assert_eq!(join_link("join=K7M-2QX-9TD"), Some("K7M-2QX-9TD"), "a join code, no leading #"); } #[test] -fn no_join_without_the_parameter() { +fn no_join_without_the_entry() { assert_eq!(join_link(""), None); - assert_eq!(join_link("?webgl"), None); - assert_eq!(join_link("?join="), None); - assert_eq!(join_link("?rejoin=x"), None, "only the whole parameter name"); - assert_eq!(join_link("?xjoin=x&a=1"), None); + assert_eq!(join_link("#"), None); + assert_eq!(join_link("#join="), None); + assert_eq!(join_link("#rejoin=x"), None, "only the whole entry name"); + assert_eq!(join_link("#xjoin=x&a=1"), None); + assert_eq!(join_link("?join=x"), None, "the query isn't read: it goes to the web host"); +} + +#[test] +fn an_overlong_link_is_ignored() { + let long = format!("#join=figcraft://join?host=h&file=f&token={}", "a".repeat(7000)); + assert_eq!(join_link(&long), None); + assert_eq!(join_link(&format!("#join={}", "é".repeat(4000))), None, "length counts bytes"); } diff --git a/apps/figcraft-web/src/web.rs b/apps/figcraft-web/src/web.rs index d3c164411..292136212 100644 --- a/apps/figcraft-web/src/web.rs +++ b/apps/figcraft-web/src/web.rs @@ -41,9 +41,9 @@ pub fn start() { let ctx = cc.egui_ctx.clone(); session.live.install(Box::new(figcraft_collab_net::NetLink::new(std::sync::Arc::new(move || ctx.request_repaint())))); let mut fig = FigApp::new(session, Box::new(WebServices { reduce_motion, ctx: cc.egui_ctx.clone() })); - // `?join=`: join that session, as opening an invite link does on the desktop. - let search = query(); - if let Some(link) = crate::query::join_link(&search) { + // `#join=`: join that session, as opening an invite link does on the desktop. + let hash = web_sys::window().and_then(|w| w.location().hash().ok()).unwrap_or_default(); + if let Some(link) = crate::query::join_link(&hash) { let link = js_sys::decode_uri_component(link).ok().and_then(|s| s.as_string()).unwrap_or_else(|| link.to_string()); figcraft_ui_egui::live::open_invite(&mut fig, &link); } From 532b0f7321cf315c3b79bff36cc8e7d194c7b3de Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 16:18:57 +0700 Subject: [PATCH 161/817] Batch 11: Paste here puts copied design layers at the point --- crates/ui-egui/src/design_paste_tests.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/ui-egui/src/design_paste_tests.rs b/crates/ui-egui/src/design_paste_tests.rs index c320230a3..35743a81c 100644 --- a/crates/ui-egui/src/design_paste_tests.rs +++ b/crates/ui-egui/src/design_paste_tests.rs @@ -45,6 +45,16 @@ fn paste_takes_layers_copied_in_another_design_app() { assert_eq!(selected_names(&app), ["Copied layer"]); } +#[test] +fn paste_here_puts_copied_design_layers_at_the_point() { + let html = copied_html(); + let mut app = FigApp::new(Session::new(), Box::new(Clip { html, text: Some(String::new()) })); + crate::menus::paste(&mut app, None, Some((300.0, 200.0))); + let id = app.session.selection()[0]; + let b = app.session.doc().unwrap().world_bounds(id).unwrap(); + assert_eq!((b.x0, b.y0), (300.0, 200.0)); +} + #[test] fn html_from_other_apps_pastes_as_before() { let clip = Clip { html: "Hello".into(), text: Some("Hello".into()) }; From b6d98e28dccc8303c252e590a6c802f380c5cced Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 16:29:31 +0700 Subject: [PATCH 162/817] #699: keep en.toml's end of file as on main --- crates/ui-egui/locales/en.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 53cc5c45f..efd23d04e 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -1606,4 +1606,4 @@ name = "English" "⌘ arrows" = "⌘ arrows" "⌘ click" = "⌘ click" "⌘ scroll" = "⌘ scroll" -"⌥ drag" = "⌥ drag" +"⌥ drag" = "⌥ drag" \ No newline at end of file From 7f7921260ca81914d48e6a69d61c01431f28f611 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 16:29:34 +0700 Subject: [PATCH 163/817] #699: menu input dialog and language picker use the shared widgets; File > Rename edits the file name in place --- crates/ui-egui/src/dialogs.rs | 70 +++++++++++++++----------- crates/ui-egui/src/layers.rs | 3 +- crates/ui-egui/src/lib.rs | 3 ++ crates/ui-egui/src/menu_input_tests.rs | 27 +++++++--- crates/ui-egui/src/menus.rs | 7 +-- 5 files changed, 69 insertions(+), 41 deletions(-) diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 31eb1adb3..649bcb3f0 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -74,7 +74,6 @@ pub enum AboutTab { /// Values collected by a menu or Actions command before dispatching it to the engine. #[derive(Clone, Debug, PartialEq)] pub enum MenuInput { - RenameFile(String), Link(String), Offset(f64), MoveToPage, @@ -274,18 +273,27 @@ pub fn show(app: &mut FigApp, ctx: &Context) { ui.horizontal(|ui| { ui.label(tr("Language")); // Each language by its own name; System follows the OS (the browser on the web). - let langs = i18n::languages().iter().filter(|l| crate::cjk::can_show(l.code)).map(|l| (l.code, l.name)); - let choices: Vec<_> = [("system", tr("System"))].into_iter().chain(langs).collect(); - let selected = - choices.iter().find(|(code, _)| app.session.prefs.language.eq_ignore_ascii_case(code)).map_or(tr("System"), |(_, name)| *name); - egui::ComboBox::from_id_salt("pref_language").selected_text(selected).width(220.0).show_ui(ui, |ui| { - for (code, name) in choices { - if ui.selectable_label(app.session.prefs.language.eq_ignore_ascii_case(code), name).clicked() { - app.run("pref.language", json!({"language": code})); - ui.ctx().request_repaint(); + let langs = || { + [("system", tr("System"))] + .into_iter() + .chain(i18n::languages().iter().filter(|l| crate::cjk::can_show(l.code)).map(|l| (l.code, l.name))) + }; + let on = |code: &str| app.session.prefs.language.eq_ignore_ascii_case(code); + let selected = langs().find(|(code, _)| on(code)).map_or(tr("System"), |(_, name)| name); + let resp = crate::widgets::dropdown(ui, selected, 220.0, None); + let mut pick = None; + crate::right::menu_popup(&resp).show(|ui| { + for (code, name) in langs() { + if crate::right::menu_check(ui, on(code), name, "") { + pick = Some(code); + ui.close(); } } }); + if let Some(code) = pick { + app.run("pref.language", json!({"language": code})); + ui.ctx().request_repaint(); + } }); if let Some(lang) = i18n::current().filter(|l| l.draft) { let note = trf("{language}: draft translation, waiting for a native speaker's review.", &[("language", &lang.name)]); @@ -355,8 +363,8 @@ pub fn show(app: &mut FigApp, ctx: &Context) { /// command so the same validation and undo behaviour apply as for programmatic callers. fn menu_input_dialog(app: &mut FigApp, ctx: &Context) { let Some(mut input) = app.ui.menu_input.take() else { return }; + let t = Tokens::get(ctx); let title = match &input { - MenuInput::RenameFile(_) => i18n::command("file.rename", "Rename file"), MenuInput::Link(_) => i18n::command("text.link", "Create link"), MenuInput::Offset(_) => i18n::command("vector.offset", "Offset path"), MenuInput::MoveToPage => i18n::command("object.moveToPage", "Move to page"), @@ -366,26 +374,28 @@ fn menu_input_dialog(app: &mut FigApp, ctx: &Context) { window(&title, ctx).open(&mut open).show(ctx, |ui| { ui.set_width(320.0); match &mut input { - MenuInput::RenameFile(name) => { - let field = ui.add(egui::TextEdit::singleline(name).desired_width(300.0)); - if (ui.button(tr("Rename")).clicked() || field.lost_focus() && ui.input(|i| i.key_pressed(egui::Key::Enter))) - && !name.trim().is_empty() - { - action = Some(("file.rename", json!({"name": name.trim()}))); - } - } MenuInput::Link(url) => { - let field = ui.add(egui::TextEdit::singleline(url).hint_text("https://").desired_width(300.0)); - if (ui.button(tr("Done")).clicked() || field.lost_focus() && ui.input(|i| i.key_pressed(egui::Key::Enter))) && !url.trim().is_empty() - { - action = Some(("text.link", json!({"url": url.trim()}))); - } + ui.horizontal(|ui| { + let field = crate::widgets::text_input(ui, egui::Id::new("menu_input_link"), url, 250.0, "https://"); + let enter = field.lost_focus() && ui.input(|i| i.key_pressed(egui::Key::Enter)); + let ok = !url.trim().is_empty(); + if (crate::widgets::button(ui, tr("Done"), true, ok).clicked() || enter) && ok { + action = Some(("text.link", json!({"url": url.trim()}))); + } + }); } MenuInput::Offset(offset) => { - ui.add(egui::DragValue::new(offset).speed(1.0).range(-100_000.0..=100_000.0)); - if ui.button(tr("Offset")).clicked() { - action = Some(("vector.offset", json!({"offset": offset}))); - } + ui.horizontal(|ui| { + let id = egui::Id::new("menu_input_offset"); + if let Some(crate::widgets::FieldEdit::Set(v) | crate::widgets::FieldEdit::Scrub(v, _)) = + crate::widgets::number_field(ui, id, crate::widgets::Lead::None, Some(*offset), "", 120.0, 1.0) + { + *offset = v.clamp(-100_000.0, 100_000.0); + } + if crate::widgets::button(ui, tr("Offset"), true, true).clicked() { + action = Some(("vector.offset", json!({"offset": *offset}))); + } + }); } MenuInput::MoveToPage => { let mut choices = 0; @@ -395,7 +405,7 @@ fn menu_input_dialog(app: &mut FigApp, ctx: &Context) { continue; } if let Some(node) = ds.doc.node(page) - && ui.button(&node.name).clicked() + && crate::widgets::button(ui, &node.name, false, true).clicked() { action = Some(("object.moveToPage", json!({"page": page}))); } @@ -403,7 +413,7 @@ fn menu_input_dialog(app: &mut FigApp, ctx: &Context) { } } if choices == 0 { - ui.label(tr("No other pages")); + crate::widgets::label(ui, tr("No other pages"), t.text_secondary); } } } diff --git a/crates/ui-egui/src/layers.rs b/crates/ui-egui/src/layers.rs index 8b6147628..f05c9f87a 100644 --- a/crates/ui-egui/src/layers.rs +++ b/crates/ui-egui/src/layers.rs @@ -148,7 +148,8 @@ pub fn left_panel(app: &mut FigApp, ui: &mut Ui) { } else { let name = app.session.doc().map(|d| d.name.clone()).unwrap_or_default(); let nr = Rect::from_min_max(pos2(head.min.x + 14.0, head.min.y + 14.0), pos2(head.max.x - 48.0, head.min.y + 34.0)); - if let Some(new) = crate::widgets::text_field_inline(ui, Id::new("filename"), &name, nr, semibold(13.0)) { + let start = std::mem::take(&mut app.ui.rename_file); + if let (Some(new), _) = crate::widgets::rename_field(ui, Id::new("filename"), &name, nr, semibold(13.0), start) { app.run("file.rename", json!({"name": new})); } ui.painter().text(pos2(head.min.x + 16.0, head.min.y + 46.0), Align2::LEFT_CENTER, tr("Drafts"), regular(11.0), t.text_secondary); diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index c46713918..982c275fa 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -414,6 +414,8 @@ pub struct UiState { pub preferences: bool, /// A menu command that needs a value before the engine can run it. pub menu_input: Option, + /// File ▸ Rename: the file name in the left panel starts its inline rename on the next frame. + pub rename_file: bool, pub shortcuts_panel: bool, /// The Keyboard shortcuts panel's tab and search text. pub shortcuts_tab: figcraft_engine::keymap::Group, @@ -542,6 +544,7 @@ impl Default for UiState { about_tab: dialogs::AboutTab::About, preferences: false, menu_input: None, + rename_file: false, shortcuts_panel: false, shortcuts_tab: figcraft_engine::keymap::Group::Essential, shortcuts_query: String::new(), diff --git a/crates/ui-egui/src/menu_input_tests.rs b/crates/ui-egui/src/menu_input_tests.rs index 0de3757fb..f317b65bc 100644 --- a/crates/ui-egui/src/menu_input_tests.rs +++ b/crates/ui-egui/src/menu_input_tests.rs @@ -31,13 +31,9 @@ fn preference_actions_open_preferences_without_changing_values() { #[test] fn menu_entries_collect_required_arguments_before_running() { let mut ui = Ui::new(Session::new()); - let name = ui.app.session.doc().unwrap().name.clone(); - for (id, expected) in [ - ("file.rename", MenuInput::RenameFile(name)), - ("text.link", MenuInput::Link(String::new())), - ("vector.offset", MenuInput::Offset(0.0)), - ("object.moveToPage", MenuInput::MoveToPage), - ] { + for (id, expected) in + [("text.link", MenuInput::Link(String::new())), ("vector.offset", MenuInput::Offset(0.0)), ("object.moveToPage", MenuInput::MoveToPage)] + { ui.app.ui.menu_input = None; menus::invoke(&mut ui.app, id); assert_eq!(ui.app.ui.menu_input, Some(expected), "{id}"); @@ -72,3 +68,20 @@ fn batch_rename_opens_its_existing_dialog() { assert_eq!(ui.app.ui.batch_rename.as_ref().map(|d| d.ids.len()), Some(1)); assert!(ui.app.ui.last_error.is_none()); } + +#[test] +fn rename_file_edits_the_file_name_in_place() { + let mut ui = Ui::new(Session::new()); + ui.app.ui.left_collapsed = true; + menus::invoke(&mut ui.app, "file.rename"); + assert!(!ui.app.ui.left_collapsed, "the left panel shows the file name"); + assert!(ui.app.ui.menu_input.is_none(), "no dialog"); + ui.frame(vec![]); + ui.frame(vec![]); + assert!(!ui.app.ui.rename_file, "the rename started"); + assert!(ui.ctx.memory(|m| m.has_focus(egui::Id::new("filename").with("te"))), "the file name's editor has the keyboard"); + ui.frame(vec![egui::Event::Text("Brand kit".into())]); + ui.frame(vec![egui::Event::Key { key: egui::Key::Enter, physical_key: None, pressed: true, repeat: false, modifiers: Default::default() }]); + assert_eq!(ui.app.session.doc().unwrap().name, "Brand kit"); + assert!(ui.app.ui.last_error.is_none()); +} diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 18023e67b..5a9017a82 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -137,10 +137,11 @@ pub fn invoke(app: &mut FigApp, id: &str) { "pref.language" | "pref.userName" | "pref.publishServer" | "pref.nudge" => { app.run("app.preferences", json!({})); } + // The file name in the left panel's header turns into its editor, the name selected. "file.rename" => { - if let Ok(doc) = app.session.doc() { - app.ui.menu_input = Some(crate::dialogs::MenuInput::RenameFile(doc.name.clone())); - } + app.ui.left_tab = crate::LeftTab::File; + app.ui.left_collapsed = false; + app.ui.rename_file = true; } "text.link" => app.ui.menu_input = Some(crate::dialogs::MenuInput::Link(String::new())), "vector.offset" => app.ui.menu_input = Some(crate::dialogs::MenuInput::Offset(0.0)), From 234339a78681c634075336e442ffe1f3685d706b Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Fri, 16 Oct 2026 13:47:07 +0000 Subject: [PATCH 164/817] Refuse pages in edit.copy and edit.cut Found while testing crates/engine/src/cmd/edit.rs:499 (copy_to_clipboard, called from copy at :536 and cut at :542) Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/engine/src/cmd/edit.rs | 11 +++++++++-- crates/engine/src/tests.rs | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index 21f095696..eef4beaa3 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -505,7 +505,12 @@ fn bump_name(n: &str) -> String { /// The copied form of the selection. pub fn copy_to_clipboard(s: &mut Session, ids: &[NodeId]) -> Result<()> { let ds = s.ds()?; - let (nodes, images, bounds) = copied(&ds.doc, ids); + // Pages are not layers: they can't be pasted anywhere. + let layers: Vec = ids.iter().copied().filter(|i| !ds.doc.node(*i).is_some_and(Node::is_page)).collect(); + if layers.is_empty() && !ids.is_empty() { + return Err(EngineError::Disabled("edit.copy".into(), "pages can't be copied; use page.duplicate".into())); + } + let (nodes, images, bounds) = copied(&ds.doc, &layers); let (source, source_path, uid) = (ds.doc.clone(), ds.path.clone(), ds.uid); s.clipboard.source = Some(source); s.clipboard.source_path = source_path; @@ -605,7 +610,9 @@ fn copy(s: &mut Session, p: &Value) -> Result { fn cut(s: &mut Session, p: &Value) -> Result { let ids = req_targets("edit.cut", s, p)?; copy_to_clipboard(s, &ids)?; - delete(s, &json!({"ids": ids})) + let doc = s.doc()?; + let layers: Vec = ids.into_iter().filter(|i| !doc.node(*i).is_some_and(Node::is_page)).collect(); + delete(s, &json!({"ids": layers})) } /// Paste the clipboard under `parent` with the copied top-left moved to `at` (page coords). diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index dbf432d41..6010559e7 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -621,3 +621,20 @@ fn find_replace_changing_only_the_case_replaces_every_occurrence() { assert_eq!(s.doc().unwrap().node(t).unwrap().kind.text().unwrap().characters, "FigCraft and FigCraft, FigCraft"); assert_eq!(s.doc().unwrap().node(f).unwrap().name, "FigCraft / FigCraft"); } + +#[test] +fn copy_and_cut_ignore_pages_so_paste_keeps_the_document_valid() { + for cmd in ["edit.copy", "edit.cut"] { + let mut s = sess(); + let page = s.page().unwrap(); + s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap(); + let r = s.execute(cmd, &json!({"ids": [page.0]})); + if let Ok(v) = &r { + assert!(v.get("deleted").is_none_or(|d| d == &json!([])), "{cmd} reported the page as deleted: {v}"); + } + let _ = s.execute("edit.paste", &json!({})); + let doc = s.doc().unwrap(); + assert!(doc.validate().is_empty(), "{cmd}: {:?}", doc.validate()); + assert!(doc.node(page).is_some(), "{cmd} removed the page"); + } +} From fec54d93619a9356fbefedd50c4f5993ad1f4ec7 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 16:36:54 +0700 Subject: [PATCH 165/817] #599: leave the progress docs to the maintainer --- ROADMAP.md | 2 +- docs/localization-parity.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 2411799f3..006b81b9a 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -111,7 +111,7 @@ native speakers' reviews of the six language drafts need people. | Korean | ko | 100% | draft (needs native review) | | Vietnamese | vi | 0% | none | -Also shipped: Swedish (`sv`: every UI string, command label and menu wording; native review welcome). Figma ships English, Japanese, Korean, French, German, Spanish and Portuguese +Also shipped: Swedish (`sv`: every UI string, 120 of 588 command labels and menu wordings; native review welcome). Figma ships English, Japanese, Korean, French, German, Spanish and Portuguese (Brazil); FigCraft has the localization layer, English and Spanish (Spain and Latin America), French, German, Brazilian Portuguese, Japanese, Korean and Simplified Chinese drafts (Preferences ▸ Language; Traditional Chinese has no catalog; CJK UI diff --git a/docs/localization-parity.md b/docs/localization-parity.md index d3f69a9a0..45a7a925a 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -100,8 +100,8 @@ supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no v | Korean | ko | 2,076 / 2,076 (100%, draft) | yes | Hangul text and IME in documents; UI text in an installed Korean face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | | Vietnamese | vi | 0 (0%) | no | Latin with stacked diacritics | no | none | 3–5 | -Other languages: Swedish (`sv`): every UI string, command label and menu wording translated; native -review welcome. Figma ships none beyond the eight +Other languages: Swedish (`sv`): every UI string translated, and 120 of the 588 command labels and +menu wordings (the rest show in English); native review welcome. Figma ships none beyond the eight above. The layer is done. Per-language hours above are agent hours for a catalog of ~1,800 entries From e912a2efe8b2574b9835caf629c7a871fb436bb7 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 16:38:35 +0700 Subject: [PATCH 166/817] #655: fill.set / stroke.set read index with params::opt_index (#675) --- crates/engine/src/cmd/edit.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index 1d7cb88e2..12ff561e8 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -1184,7 +1184,7 @@ fn paint_list(s: &mut Session, p: &Value, fills: bool, add: bool) -> Result Result { let cmd = if fills { "fill.set" } else { "stroke.set" }; let ids = req_targets(cmd, s, p)?; - let idx = if get(p, "index").is_none() { None } else { Some(req_index(cmd, p, "index")?) }; + let idx = opt_index(cmd, p, "index")?; let new_paint = match get(p, "paint") { Some(v) => Some(paint_of(v).ok_or_else(|| bad(cmd, "invalid paint"))?), None => None, From 00b0b086803d0f8357069036822dc08471b97430 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 17:02:34 +0700 Subject: [PATCH 167/817] #668: a short pages list drags from the rows it shows, not the room it was given --- crates/ui-egui/src/layers.rs | 3 +- crates/ui-egui/src/layers_behaviour_tests.rs | 30 ++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/layers.rs b/crates/ui-egui/src/layers.rs index a6bbe5f52..c9fe528f2 100644 --- a/crates/ui-egui/src/layers.rs +++ b/crates/ui-egui/src/layers.rs @@ -306,7 +306,8 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { { app.run("page.select", json!({"id": p})); } - pages_edge(app, ui, moved.inner_rect.height()); + // `inner_rect` is the room the list was given; a short list shrinks to its rows. + pages_edge(app, ui, moved.inner_rect.height().min(moved.content_size.y)); } /// The pages list's height in a panel with `avail` below the Pages header: the height asked for diff --git a/crates/ui-egui/src/layers_behaviour_tests.rs b/crates/ui-egui/src/layers_behaviour_tests.rs index 14d625a71..d4ef4f8ac 100644 --- a/crates/ui-egui/src/layers_behaviour_tests.rs +++ b/crates/ui-egui/src/layers_behaviour_tests.rs @@ -390,6 +390,36 @@ fn the_line_between_pages_and_layers_drags_to_size_the_pages_list() { assert!((u.row_at(rect).y - before).abs() < 3.0); } +#[test] +fn dragging_up_the_line_under_a_short_pages_list_shrinks_it_at_once() { + // Five pages fit in the room the list is given: the drag starts from the rows shown, not + // from that room, so the line follows the pointer. + let mut s = Session::new(); + let rect = id(s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap()); + for _ in 0..4 { + s.execute("page.add", &json!({})).unwrap(); + } + let first = s.doc().unwrap().pages[0]; + s.execute("page.select", &json!({"id": first})).unwrap(); + s.execute("select.none", &json!({})).unwrap(); + let mut u = Ui::new(s); + let before = u.row_at(rect).y; + let edge = pages_edge_at(&mut u, before); + let at = |dy: f32| Pos2::new(150.0, edge + dy); + let button = |p, pressed| Event::PointerButton { pos: p, button: egui::PointerButton::Primary, pressed, modifiers: Modifiers::NONE }; + u.frame(vec![Event::PointerMoved(at(0.0))]); + u.frame(vec![button(at(0.0), true)]); + for k in 1..=4 { + u.frame(vec![Event::PointerMoved(at(-10.0 * k as f32))]); + } + u.frame(vec![button(at(-40.0), false)]); + for _ in 0..30 { + u.frame(vec![]); + } + let after = u.row_at(rect).y; + assert!((before - after - 40.0).abs() < 3.0, "the layers moved from {before} to {after}"); +} + #[test] fn the_pages_list_keeps_three_rows_and_leaves_the_layers_room() { use crate::layers::{ROW, pages_list_height}; From 41abce53b75e95c470b5148a072c1114ce2daffb Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 18:11:27 +0700 Subject: [PATCH 168/817] #621: a panic inside the boolean-op sweep is bad input, not a crash (text strokes clip to glyph outlines) --- crates/pathops/src/lib.rs | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/crates/pathops/src/lib.rs b/crates/pathops/src/lib.rs index 553fce04f..74a120b12 100644 --- a/crates/pathops/src/lib.rs +++ b/crates/pathops/src/lib.rs @@ -59,6 +59,13 @@ pub fn closed(path: &BezPath) -> BezPath { /// Every coordinate is finite and of a sane magnitude (the sweep needs bounded input). pub use figcraft_geom::measure::finite_path as finite; +/// Run the sweep library on `f`. Version 0.4 can panic on rare near-degenerate input (an internal +/// `unwrap` while ordering curves, hit by some font outlines): that is bad input, not a crash. +// shortcut: no catch where panics abort (wasm32); drop this once a linesweeper release no longer panics there. +fn sweep(f: impl FnOnce() -> Result) -> Result { + std::panic::catch_unwind(std::panic::AssertUnwindSafe(f)).unwrap_or(Err(PathOpsError::BadInput)) +} + fn binary(a: &BezPath, b: &BezPath, op: linesweeper::BinaryOp) -> Result { if a.elements().is_empty() && b.elements().is_empty() { return Ok(BezPath::new()); @@ -66,7 +73,7 @@ fn binary(a: &BezPath, b: &BezPath, op: linesweeper::BinaryOp) -> Result Result, PathOpsE let bbox = closed_paths.iter().filter(|p| !p.elements().is_empty()).map(Shape::bounding_box).reduce(|a, b| a.union(b)); let m = bbox.map(|b| b.x0.abs().max(b.x1.abs()).max(b.y0.abs()).max(b.y1.abs())).unwrap_or(0.0); let eps = (m * f64::EPSILON * 64.0).max(1e-6); + let even_odd: Vec = paths.iter().map(|(_, e)| *e).collect(); + sweep(|| arrange(&closed_paths, &even_odd, eps)) +} + +/// [`faces`] of the closed `paths`, swept with tolerance `eps`. +fn arrange(closed_paths: &[BezPath], even_odd: &[bool], eps: f64) -> Result, PathOpsError> { let topo = linesweeper::topology::Topology::::from_paths(closed_paths.iter().enumerate().map(|(i, p)| (p, i)), eps) .map_err(|_| PathOpsError::BadInput)?; - let even_odd: Vec = paths.iter().map(|(_, e)| *e).collect(); let cover_of = |w: &Windings| -> Vec { w.0.iter() .enumerate() @@ -441,6 +453,13 @@ mod tests { p.area().abs() } + #[test] + fn a_panic_in_the_sweep_is_bad_input() { + let r: Result<(), PathOpsError> = sweep(|| panic!("sweep bug")); + assert!(matches!(r, Err(PathOpsError::BadInput))); + assert!(matches!(sweep(|| Ok(1)), Ok(1))); + } + #[test] fn union_intersect_subtract_exclude() { let a = sq(0.0, 0.0, 10.0); From fdd4eb5cadda8e3c08006829767051967e4bf917 Mon Sep 17 00:00:00 2001 From: BFlat Date: Sat, 17 Oct 2026 19:16:10 +0700 Subject: [PATCH 169/817] Docs: roadmap rows for the community fixes from #524 up (#727, #728, #733, #735, #736, #729) (#744) Adds the progress rows for the community PRs landed today: batches #727, #728, #733, #735 and #736, plus #729. That's 55 PRs, and the batch-13 boolean-op crash guard. - `ROADMAP.md` and `docs/roadmap.md`: the header's "Last updated/Change" line and one revision-history row each. - Headline numbers are unchanged. The per-area rows for the `.fig` import and component overrides come with the #731/#732 PR. --- ROADMAP.md | 3 ++- docs/roadmap.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 006b81b9a..2dcc2b9bb 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -315,6 +315,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | | 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | | 2026-10-17 | minor | Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | diff --git a/docs/roadmap.md b/docs/roadmap.md index 9e9eaec9f..cf2854642 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # FigCraft roadmap: milestones and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (community fixes from #478 up and a control-channel fix (#589); recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading, SVG import budgets, Leptos code, full screen, server snapshots, owner-only preferences, ruzstd 0.9.1, layer cycle repair, batch rollback, Direct3D 12 on Windows, plugin metering; vector edit mode regions: hover hatch, selection and drag; repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` import, best effort; 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 ~79%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; community fixes from #478 up and a control-channel fix (#589); recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading, SVG import budgets, Leptos code, full screen, server snapshots, owner-only preferences, ruzstd 0.9.1, layer cycle repair, batch rollback, Direct3D 12 on Windows, plugin metering; vector edit mode regions: hover hatch, selection and drag; repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` import, best effort; 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 ~79%) · **Target:** Figma Design (desktop app 126.10.7) Forward-looking plan. Where FigCraft stands today: [`ROADMAP.md`](../ROADMAP.md) and [`target-app-parity.md`](target-app-parity.md); the full ranked list: [`gaps.md`](gaps.md). Hours @@ -73,6 +73,7 @@ blockers. | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | | 2026-10-14 | minor | M7: the Small caps button in Type settings showed a box where the UI font has no small-capital `ɢ` (builds without Inter use egui's fonts); its sample is now a capital and a smaller capital, drawn from ordinary letters every UI font has. Numbers unchanged | | 2026-10-14 | minor | M7: Home screen recent files as cards: each card shows the picture its file carries on its first page's colour, the file's icon, name and "Edited ... ago"; sort by name, creation or last change either way; a table view; a click selects, a double-click or Enter opens, arrow keys move; Open, Show in folder and Remove from recents on right-click. Numbers unchanged. | From 6cdfe2ab8e1f4bc39717ebc24620913206059ebe Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 18:15:34 +0700 Subject: [PATCH 170/817] M3: layers inside instances keep their resizing overrides (#731) A layer inside an instance can now override its resizing (hug, fill or fixed, with min and max sizes; override group `resizing`) and its size. They were refused, and imported ones were dropped at the first relayout. Kept through rebuilds, undo, save, .fig and REST import, .fig export and detach; reset per group and with Reset all changes. Position, constraints and absolute or grid placement stay the main's. --- crates/engine/src/cmd/component.rs | 8 +- crates/engine/src/cmd/props.rs | 11 +- crates/engine/src/components.rs | 77 ++++--- .../engine/src/components_behaviour_tests.rs | 15 -- crates/engine/src/components_tests.rs | 2 - crates/engine/src/cursor_tests.rs | 11 +- crates/engine/src/instance_resizing_tests.rs | 190 ++++++++++++++++++ crates/engine/src/lib.rs | 2 + crates/format/src/fig/export.rs | 13 +- crates/format/src/fig/map.rs | 2 + crates/format/src/rest/mod.rs | 18 +- crates/ui-egui/locales/cs.toml | 1 + crates/ui-egui/locales/de.toml | 1 + crates/ui-egui/locales/en.toml | 1 + crates/ui-egui/locales/es.toml | 1 + crates/ui-egui/locales/fr.toml | 1 + crates/ui-egui/locales/id.toml | 1 + crates/ui-egui/locales/ja.toml | 1 + crates/ui-egui/locales/ko.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/tr.toml | 1 + crates/ui-egui/locales/zh-Hans.toml | 1 + crates/ui-egui/src/component_panel.rs | 1 + crates/ui-egui/src/layout_panel.rs | 17 +- docs/components-parity.md | 5 +- docs/file-format-parity.md | 5 +- 28 files changed, 320 insertions(+), 70 deletions(-) create mode 100644 crates/engine/src/instance_resizing_tests.rs diff --git a/crates/engine/src/cmd/component.rs b/crates/engine/src/cmd/component.rs index e35c3f5b2..a8901f241 100644 --- a/crates/engine/src/cmd/component.rs +++ b/crates/engine/src/cmd/component.rs @@ -678,8 +678,8 @@ fn push_changes(s: &mut Session, p: &Value) -> Result { if !doc.contains(component) { return Err(EngineError::Disabled(cmd.into(), "the main component was deleted (use component.restoreMain)".into())); } - // Copy every overridden layer's values to its source in the main (geometry, swaps, property - // values and slot content stay with the instance). + // Copy every overridden layer's values to its source in the main (geometry, resizing, swaps, + // property values and slot content stay with the instance). let mut pushed = 0; for d in doc.subtree(inst) { let Some(n) = doc.node(d).cloned() else { continue }; @@ -691,7 +691,9 @@ fn push_changes(s: &mut Session, p: &Value) -> Result { let groups: BTreeSet = n .overrides .iter() - .filter(|g| !matches!(g.as_str(), "size" | "position" | "component" | "props" | SLOT) && !(d == inst && g.as_str() == "name")) + .filter(|g| { + !matches!(g.as_str(), "size" | "resizing" | "position" | "component" | "props" | SLOT) && !(d == inst && g.as_str() == "name") + }) .cloned() .collect(); for g in &groups { diff --git a/crates/engine/src/cmd/props.rs b/crates/engine/src/cmd/props.rs index 598be752f..78b448c0e 100644 --- a/crates/engine/src/cmd/props.rs +++ b/crates/engine/src/cmd/props.rs @@ -783,12 +783,14 @@ pub fn apply(cmd: &str, doc: &mut Document, id: NodeId, props: &Map &'static str { "features" | "fontFeatures" | "openTypeFeatures" | "listStyle" | "indentation" | "listSpacing" | "maxLines" | "variationSettings" | "hangingPunctuation" | "hangingList" => "textStyle", "cornerRadius" | "cornerSmoothing" | "topLeftRadius" | "topRightRadius" | "bottomRightRadius" | "bottomLeftRadius" => "corners", - "width" | "height" | "w" | "h" | "sizingH" | "sizingV" => "size", + "width" | "height" | "w" | "h" => "size", + "sizingH" | "sizingV" | "layoutSizingHorizontal" | "layoutSizingVertical" | "minWidth" | "maxWidth" | "minHeight" | "maxHeight" => "resizing", "gap" | "itemSpacing" | "columnGap" | "crossGap" | "counterAxisSpacing" | "rowGap" => "gap", "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingHorizontal" | "paddingVertical" => "padding", "mainAlign" | "primaryAxisAlignItems" | "crossAlign" | "counterAxisAlignItems" | "contentAlign" | "counterAxisAlignContent" => "alignment", diff --git a/crates/engine/src/components.rs b/crates/engine/src/components.rs index 30f21b8c4..ff582b8ad 100644 --- a/crates/engine/src/components.rs +++ b/crates/engine/src/components.rs @@ -11,12 +11,12 @@ //! Override groups: `fills`, `strokes`, `effects`, `opacity`, `visible`, `name`, `corners`, //! `characters`, `textStyle` (font, size, spacing, resizing, …), `padding`, `gap` and `alignment` //! (of auto layout: its direction and other settings are the main's), `grids`, `exports`, -//! `interactions`, `component` (a swapped nested instance), `props` (property values of a nested -//! instance) and `slot` (a slot holding the instance's own content). An instance's own export -//! settings and interactions are its own, like its place. `size` and `position` overrides of -//! layers inside an instance are still read and kept, but new ones are refused -//! ([`check_override_edit`]): those layers take their geometry, constraints and resizing from the -//! main; the instance itself resizes. +//! `interactions`, `size` and `resizing` (hug, fill or fixed, with min and max sizes) of layers +//! inside an instance, `component` (a swapped nested instance), `props` (property values of a +//! nested instance) and `slot` (a slot holding the instance's own content). An instance's own +//! export settings, interactions and resizing are its own, like its place. `position` +//! overrides of layers inside an instance are still read and kept, but new ones are refused +//! ([`check_override_edit`]): those layers take their place and constraints from the main. //! //! Switching variants keeps an override where the layer's name path matches and the two variants //! agreed on that property (text layers keep all of theirs); swapping from the Assets panel keeps @@ -58,6 +58,7 @@ pub const OVERRIDE_GROUPS: &[&str] = &[ "exports", "interactions", "size", + "resizing", "position", "component", "props", @@ -388,11 +389,14 @@ pub(crate) fn copy_group(from: &Node, to: &mut Node, g: &str) { "size" => { to.width = from.width; to.height = from.height; - to.child_layout = from.child_layout.clone(); if let (NodeKind::Text(a), NodeKind::Text(b)) = (&from.kind, &mut to.kind) { b.auto_resize = a.auto_resize; } } + "resizing" => { + let (a, b) = (&from.child_layout, &mut to.child_layout); + (b.sizing_h, b.sizing_v, b.min_w, b.max_w, b.min_h, b.max_h) = (a.sizing_h, a.sizing_v, a.min_w, a.max_w, a.min_h, a.max_h); + } "position" => to.transform = from.transform, "component" => { if let (NodeKind::Instance { component: a, .. }, NodeKind::Instance { component: b, .. }) = (&from.kind, &mut to.kind) { @@ -773,6 +777,15 @@ fn sync_instance_depth(doc: &mut Document, inst: NodeId, depth: usize, spare: BT for s in &src { let Some(nid) = map.get(s).copied() else { continue }; let Some(o) = old.get(&nid) else { continue }; + // A frame that kept the size its own resizing gave it: its layers (copied at their main + // layers' places) follow their constraints from its main layer's size. + if o.overrides.contains("resizing") + && !o.overrides.contains("size") + && doc.node(nid).is_some_and(|n| n.kind.is_frame_like() && n.layout.is_none()) + && let Some((mw, mh)) = doc.node(*s).map(|m| (m.width, m.height)) + { + figcraft_layout::apply_constraints(doc, nid, mw, mh); + } if !o.overrides.contains("size") && !o.overrides.contains("position") { continue; } @@ -985,6 +998,9 @@ pub fn diff_groups(a: &Node, b: &Node) -> Vec<&'static str> { if (a.width - b.width).abs() > 1e-6 || (a.height - b.height).abs() > 1e-6 { out.push("size"); } + if resizing(a) != resizing(b) { + out.push("resizing"); + } if a.transform != b.transform { out.push("position"); } @@ -1027,6 +1043,12 @@ pub fn diff_groups(a: &Node, b: &Node) -> Vec<&'static str> { out } +/// The `resizing` group of a layer: how it sizes on each axis, and its min and max sizes. +fn resizing(n: &Node) -> (Sizing, Sizing, [Option; 4]) { + let c = &n.child_layout; + (c.sizing_h, c.sizing_v, [c.min_w, c.max_w, c.min_h, c.max_h]) +} + /// Whether two texts differ in anything but their characters (the `textStyle` group). fn text_style_differs(x: &TextData, y: &TextData) -> bool { x.style != y.style @@ -1107,9 +1129,10 @@ pub fn sync_after_edit(doc: &mut Document, before: &Document, changed: &[NodeId] } let raw = diff_groups(b, n); let mut groups = raw.clone(); - // An instance's own place, export settings and interactions are its own, not overrides. + // An instance's own place, resizing, export settings and interactions are its own, not + // overrides. if top_root { - groups.retain(|g| !matches!(*g, "component" | "props" | "position" | "exports" | "interactions")); + groups.retain(|g| !matches!(*g, "component" | "props" | "position" | "resizing" | "exports" | "interactions")); } if groups.iter().any(|g| matches!(*g, "size" | "position")) { groups.retain(|g| !matches!(*g, "size" | "position") || !geometry_derived(doc, before, id, g)); @@ -1414,7 +1437,7 @@ fn patch_structure(doc: &mut Document, before: &Document, seeds: &[NodeId]) -> b fn child_follows_main(doc: &Document, parent: NodeId, absolute: bool) -> bool { let Some(p) = doc.node(parent) else { return false }; let constrains = p.layout.is_none() || absolute; - let resized = p.overrides.contains("size") + let resized = sized_own(p) || match &p.kind { NodeKind::Instance { component, .. } => { doc.node(*component).is_none_or(|m| (m.width - p.width).abs() > 1e-9 || (m.height - p.height).abs() > 1e-9) @@ -1518,7 +1541,7 @@ fn follows_main_geometry(doc: &Document, id: NodeId) -> bool { chain.windows(2).all(|w| { let (Some(below), Some(a)) = (w.first().and_then(|i| doc.node(*i)), w.get(1).and_then(|i| doc.node(*i))) else { return false }; let constrains = a.layout.is_none() || below.child_layout.absolute; - if a.overrides.contains("size") && constrains { + if sized_own(a) && constrains { return false; } match &a.kind { @@ -1530,6 +1553,12 @@ fn follows_main_geometry(doc: &Document, id: NodeId) -> bool { }) } +/// Whether a layer inside an instance overrides its size or resizing: it may not have its main +/// layer's size, so the layers in it can't take their main layers' places as they are. +fn sized_own(n: &Node) -> bool { + n.overrides.contains("size") || n.overrides.contains("resizing") +} + /// Rebuild every instance of `comps` (and of the components that hold those instances, and so on /// outwards), each outermost instance once, inner components first. fn rebuild_instances(doc: &mut Document, comps: &BTreeSet) { @@ -1665,10 +1694,9 @@ pub fn check_override_edit(before: &Document, after: &Document) -> Result<(), St /// What about layer `id` an edit from `before` to `after` changed that only its main can: the /// auto layout of an instance or a layer in one but its padding, gap and alignment, or the -/// position (rotation too), size, constraints or resizing of a layer inside an instance (the -/// instance itself resizes, and its layers follow; text whose box follows its content still -/// does). `None` when the edit is fine, also when the main changed the same way in this edit (a -/// library update). +/// position (rotation too), constraints or place in auto layout (absolute, grid cell) of a layer +/// inside an instance (its size and resizing are overrides). `None` when the edit is fine, also +/// when the main changed the same way in this edit (a library update). pub fn refused_override(before: &Document, after: &Document, id: NodeId) -> Option<&'static str> { let (n, b) = (after.node(id)?, before.node(id)?); if after.is_remote(id) || n.source != b.source || owning_instance(before, id).is_none() || owning_instance(after, id).is_none() { @@ -1684,8 +1712,12 @@ pub fn refused_override(before: &Document, after: &Document, id: NodeId) -> Opti l }) }; - let size = |x: &Node| (x.width, x.height); - let resized = |x: &Node, y: &Node| (x.width - y.width).abs() > 1e-6 || (x.height - y.height).abs() > 1e-6; + // Child layout settings other than the resizing ones. + let placing = |x: &Node| { + let mut c = x.child_layout.clone(); + (c.sizing_h, c.sizing_v, c.min_w, c.max_w, c.min_h, c.max_h) = (Sizing::Fixed, Sizing::Fixed, None, None, None, None); + c + }; if mode(n) != mode(b) && mode(ma) == mode(mb) { return Some("The auto layout direction"); } @@ -1698,14 +1730,11 @@ pub fn refused_override(before: &Document, after: &Document, id: NodeId) -> Opti if n.transform != b.transform && ma.transform == mb.transform && !geometry_derived(after, before, id, "position") { return Some("A layer's position"); } - if resized(n, b) && size(ma) == size(mb) && !geometry_derived(after, before, id, "size") { - return Some("A layer's size"); - } if n.constraints != b.constraints && ma.constraints == mb.constraints { return Some("A layer's constraints"); } - if n.child_layout != b.child_layout && ma.child_layout == mb.child_layout { - return Some("A layer's resizing"); + if placing(n) != placing(b) && placing(ma) == placing(mb) { + return Some("A layer's place in auto layout"); } None } @@ -1923,6 +1952,7 @@ pub fn rebase_instance(doc: &mut Document, inst: NodeId) { let mut groups: Vec = value_groups(m, n) .into_iter() .filter(|g| !matches!(g.as_str(), "name" | "exports" | "interactions") && !from_variables.contains(&g.as_str())) + .filter(|g| placed_source.is_some() || g != "resizing") .collect(); let named = if placed_source.is_some() { n.name != m.name } else { n.name != default_instance_name(doc, component) }; if named { @@ -1946,7 +1976,8 @@ pub fn rebase_instance(doc: &mut Document, inst: NodeId) { } if let Some(n) = doc.node_mut(inst) { n.source = root_base; - n.overrides.retain(|g| !matches!(g.as_str(), "component" | "props" | "position")); + // A top-level instance's resizing is its own (a nested one's overrides its main layer's). + n.overrides.retain(|g| !matches!(g.as_str(), "component" | "props" | "position") && (placed_source.is_some() || g != "resizing")); n.overrides.extend(root_groups); } } diff --git a/crates/engine/src/components_behaviour_tests.rs b/crates/engine/src/components_behaviour_tests.rs index 325ccdee5..15f660e1e 100644 --- a/crates/engine/src/components_behaviour_tests.rs +++ b/crates/engine/src/components_behaviour_tests.rs @@ -316,14 +316,6 @@ fn what_instances_cannot_override_is_refused() { ("nudge a layer", "transform.nudge", json!({"ids": ["$"], "dx": 1, "dy": 0}), Layer::Bg, "position"), ("rotate a layer", "node.set", json!({"id": "$", "props": {"rotation": 15}}), Layer::Bg, "position and rotation come with the layer's place"), ("flip a layer", "object.flipH", json!({"ids": ["$"]}), Layer::Bg, "position"), - ( - "resize a layer", - "node.set", - json!({"id": "$", "props": {"width": 50}}), - Layer::Bg, - "not among the overridable properties; the instance resizes", - ), - ("resize a text box", "node.set", json!({"id": "$", "props": {"width": 150}}), Layer::Title, "\"the bounds of any text layers\""), ( "change constraints", "node.set", @@ -331,13 +323,6 @@ fn what_instances_cannot_override_is_refused() { Layer::Bg, "\"any constraints applied to the layers\"", ), - ( - "make a layer fill its auto layout", - "node.set", - json!({"id": "$", "props": {"sizingH": "fill"}}), - Layer::Chip, - "resizing comes with the layer's size", - ), ( "take a layer out of auto layout", "node.set", diff --git a/crates/engine/src/components_tests.rs b/crates/engine/src/components_tests.rs index eb21b20ea..209560cdb 100644 --- a/crates/engine/src/components_tests.rs +++ b/crates/engine/src/components_tests.rs @@ -67,8 +67,6 @@ fn overrides_survive_main_edits() { ex(&mut s, "node.set", json!({"id": ibg, "props": {"effects": [{"type": "dropShadow"}]}})); ex(&mut s, "text.set", json!({"id": ititle, "characters": "Overridden"})); ex(&mut s, "node.set", json!({"id": idot, "props": {"visible": false}})); - // A layer inside an instance keeps its main's size (the instance itself resizes). - assert!(s.execute("node.set", &json!({"id": idot, "props": {"width": 30}})).is_err()); let ov = node(&s, ibg).overrides; for g in ["fills", "strokes", "effects", "name"] { assert!(ov.contains(g), "{g} in {ov:?}"); diff --git a/crates/engine/src/cursor_tests.rs b/crates/engine/src/cursor_tests.rs index 05a95f66a..7a9e06216 100644 --- a/crates/engine/src/cursor_tests.rs +++ b/crates/engine/src/cursor_tests.rs @@ -202,15 +202,16 @@ fn an_edit_an_instance_refuses_shows_not_allowed_and_is_undone() { let before = s.doc().unwrap().world_bounds(inner).unwrap(); assert_eq!((before.x0, before.y0, before.x1, before.y1), (450.0, 50.0, 550.0, 150.0)); ex(&mut s, "select.set", json!({"ids": [inner]})); - // Resizing it by its right edge: only the main component can. - assert!(close(resize(hover(&mut s, (550.0, 100.0), NONE)), 0.0), "the handle still shows its arrow"); + // Resizing it by its right edge: a size of its own (an override). + assert!(close(resize(hover(&mut s, (550.0, 100.0), NONE)), 0.0), "the handle shows its arrow"); s.pointer(&ev(PointerKind::Down, (550.0, 100.0), NONE)).unwrap(); s.pointer(&ev(PointerKind::Move, (570.0, 100.0), NONE)).unwrap(); s.pointer(&ev(PointerKind::Move, (600.0, 100.0), NONE)).unwrap(); - assert_eq!(s.tool.overlay.cursor, Cursor::NotAllowed); + assert_ne!(s.tool.overlay.cursor, Cursor::NotAllowed); s.pointer(&ev(PointerKind::Up, (600.0, 100.0), NONE)).unwrap(); - assert_eq!(s.doc().unwrap().world_bounds(inner).unwrap(), before, "the resize was undone"); - // Moving it: refused too. + let before = s.doc().unwrap().world_bounds(inner).unwrap(); + assert_eq!((before.x0, before.x1), (450.0, 600.0), "the resize stays"); + // Moving it: only the main component can. s.pointer(&ev(PointerKind::Down, (500.0, 100.0), NONE)).unwrap(); s.pointer(&ev(PointerKind::Move, (510.0, 110.0), NONE)).unwrap(); s.pointer(&ev(PointerKind::Move, (520.0, 120.0), NONE)).unwrap(); diff --git a/crates/engine/src/instance_resizing_tests.rs b/crates/engine/src/instance_resizing_tests.rs new file mode 100644 index 000000000..43386af96 --- /dev/null +++ b/crates/engine/src/instance_resizing_tests.rs @@ -0,0 +1,190 @@ +//! Size and resizing overrides of layers inside instances: a layer in an instance can hug, fill or +//! keep a fixed size of its own, and that override is kept through relayout, edits of the main +//! (only the overridden property stays), undo, save and reopen (native and .fig), REST import, +//! detach and reset. + +use base64::Engine; +use serde_json::{Value, json}; + +use crate::Session; +use crate::components::tests::{copy_of, ex, healthy, idv, node}; +use figcraft_doc::*; + +/// A "Field" component: a 240×40 fixed horizontal auto layout frame (no padding or gap) holding +/// "Atom", an auto layout frame hugging its 20×20 "Dot" with a min width of 100; and an instance of +/// it. Returns (component, atom, dot, instance). +fn field(s: &mut Session) -> (NodeId, NodeId, NodeId, NodeId) { + let f = idv(&ex(s, "frame.create", json!({"x": 0, "y": 0, "width": 240, "height": 40, "name": "Field"}))); + ex(s, "node.set", json!({"id": f, "props": {"layout": "horizontal", "padding": 0, "gap": 0, "sizingH": "fixed", "sizingV": "fixed"}})); + let atom = idv(&ex(s, "frame.create", json!({"x": 0, "y": 0, "width": 50, "height": 20, "parent": f, "name": "Atom"}))); + ex( + s, + "node.set", + json!({"id": atom, "props": {"layout": "horizontal", "padding": 0, "gap": 0, "sizingH": "hug", "sizingV": "hug", "minWidth": 100}}), + ); + let dot = idv(&ex(s, "shape.rectangle", json!({"x": 0, "y": 0, "width": 20, "height": 20, "parent": atom, "props": {"name": "Dot"}}))); + let c = idv(&ex(s, "component.create", json!({"ids": [f]}))); + let i = idv(&ex(s, "instance.create", json!({"component": c, "x": 0, "y": 100}))); + (c, atom, dot, i) +} + +fn sizing_h(s: &Session, id: NodeId) -> Sizing { + node(s, id).child_layout.sizing_h +} + +/// The layer named `name` below instance `inst`. +fn named(s: &Session, inst: NodeId, name: &str) -> NodeId { + let doc = s.doc().unwrap(); + doc.subtree(inst).into_iter().find(|d| *d != inst && doc.node(*d).is_some_and(|n| n.name == name)).unwrap() +} + +/// The first instance in the document. +fn instance(s: &Session) -> NodeId { + s.doc().unwrap().nodes().find(|n| matches!(n.kind, NodeKind::Instance { .. })).unwrap().id +} + +fn open(s: &mut Session, bytes: &[u8], name: &str) { + ex(s, "file.open", json!({"data": base64::engine::general_purpose::STANDARD.encode(bytes), "name": name})); +} + +#[test] +fn a_layer_in_an_instance_fills_and_keeps_it_through_main_edits() { + let mut s = Session::new(); + let (c, atom, dot, i) = field(&mut s); + let (ia, idot) = (copy_of(&s, i, atom), copy_of(&s, i, dot)); + assert_eq!((sizing_h(&s, ia), node(&s, ia).width), (Sizing::Hug, 100.0), "hugs its dot, at least 100 wide"); + ex(&mut s, "node.set", json!({"id": ia, "props": {"sizingH": "fill"}})); + assert_eq!((sizing_h(&s, ia), node(&s, ia).width), (Sizing::Fill, 240.0), "fills the instance"); + assert!(node(&s, ia).overrides.contains("resizing"), "{:?}", node(&s, ia).overrides); + // Edits of the main relay the instance out: the override stays, other properties follow. + ex(&mut s, "node.set", json!({"id": dot, "props": {"width": 30, "fill": "#ff0000"}})); + assert_eq!((node(&s, ia).width, node(&s, idot).width), (240.0, 30.0)); + ex(&mut s, "node.set", json!({"id": atom, "props": {"minWidth": 120, "fill": "#00ff00"}})); + assert_eq!(node(&s, atom).width, 120.0); + assert_eq!((sizing_h(&s, ia), node(&s, ia).width, node(&s, ia).child_layout.min_w), (Sizing::Fill, 240.0, Some(100.0))); + assert_eq!(node(&s, ia).fills, node(&s, atom).fills, "the fill isn't overridden: it follows the main"); + // The main fixing its own width is the same property: the instance keeps filling. + ex(&mut s, "node.set", json!({"id": atom, "props": {"width": 80}})); + assert_eq!((sizing_h(&s, atom), sizing_h(&s, ia), node(&s, ia).width), (Sizing::Fixed, Sizing::Fill, 240.0)); + // A structure edit of the main rebuilds the instance: the atom fills what the new layer leaves. + ex(&mut s, "shape.rectangle", json!({"x": 0, "y": 0, "width": 5, "height": 5, "parent": c})); + assert_eq!((sizing_h(&s, ia), node(&s, ia).width), (Sizing::Fill, 235.0)); + healthy(&s); + // Back to the main's resizing: no override left. + ex(&mut s, "component.resetOverride", json!({"id": ia, "group": "resizing"})); + assert_eq!((sizing_h(&s, ia), node(&s, ia).width), (Sizing::Fixed, node(&s, atom).width)); + assert!(!node(&s, ia).overrides.contains("resizing")); + healthy(&s); +} + +#[test] +fn size_and_resizing_overrides_undo_reset_and_detach() { + let mut s = Session::new(); + let (_, atom, dot, i) = field(&mut s); + let (ia, idot) = (copy_of(&s, i, atom), copy_of(&s, i, dot)); + ex(&mut s, "node.set", json!({"id": ia, "props": {"sizingH": "fill"}})); + ex(&mut s, "edit.undo", json!({})); + assert_eq!((sizing_h(&s, ia), node(&s, ia).width), (Sizing::Hug, 100.0)); + assert!(node(&s, ia).overrides.is_empty()); + // A fixed size of its own: kept when the main resizes the layer. + ex(&mut s, "node.set", json!({"id": idot, "props": {"width": 50, "height": 10}})); + assert!(node(&s, idot).overrides.contains("size")); + ex(&mut s, "node.set", json!({"id": dot, "props": {"width": 30}})); + assert_eq!((node(&s, idot).width, node(&s, idot).height, node(&s, dot).width), (50.0, 10.0, 30.0)); + // A min width of its own. + ex(&mut s, "node.set", json!({"id": ia, "props": {"minWidth": 150}})); + assert_eq!(node(&s, ia).width, 150.0); + ex(&mut s, "node.set", json!({"id": atom, "props": {"minWidth": 90}})); + assert_eq!(node(&s, ia).width, 150.0); + healthy(&s); + // Reset all changes: the main's values again. + ex(&mut s, "component.resetInstance", json!({"ids": [i]})); + assert_eq!((node(&s, ia).width, node(&s, idot).width), (90.0, 30.0)); + assert!(node(&s, ia).overrides.is_empty() && node(&s, idot).overrides.is_empty()); + // Detaching keeps what the instance showed. + ex(&mut s, "node.set", json!({"id": ia, "props": {"sizingH": "fill"}})); + ex(&mut s, "component.detach", json!({"ids": [i]})); + assert_eq!((sizing_h(&s, ia), node(&s, ia).width, node(&s, ia).source), (Sizing::Fill, 240.0, None)); + healthy(&s); +} + +#[test] +fn layers_in_instances_resize_but_keep_their_place() { + let mut s = Session::new(); + let f = idv(&ex(&mut s, "frame.create", json!({"x": 0, "y": 0, "width": 200, "height": 100, "name": "Card"}))); + let title = idv(&ex(&mut s, "text.create", json!({"text": "Hello", "x": 10, "y": 10, "parent": f, "props": {"name": "Title"}}))); + let c = idv(&ex(&mut s, "component.create", json!({"ids": [f]}))); + let i = idv(&ex(&mut s, "instance.create", json!({"component": c, "x": 300, "y": 0}))); + let it = copy_of(&s, i, title); + ex(&mut s, "node.set", json!({"id": it, "props": {"width": 150}})); + assert_eq!(node(&s, it).width, 150.0, "a text box resizes"); + assert!(node(&s, it).overrides.contains("size")); + // Its place, rotation and constraints are still the main's. + for props in [json!({"x": 50}), json!({"rotation": 15}), json!({"constraints": {"horizontal": "right"}})] { + assert!(s.execute("node.set", &json!({"id": it, "props": props})).is_err(), "{props} is refused"); + } + // The instance's own resizing is its own, not an override. + ex(&mut s, "node.set", json!({"id": i, "props": {"minWidth": 100}})); + assert!(!node(&s, i).overrides.contains("resizing")); + healthy(&s); +} + +#[test] +fn resizing_overrides_survive_save_and_reopen() { + let mut s = Session::new(); + let (_, atom, dot, i) = field(&mut s); + let (ia, idot) = (copy_of(&s, i, atom), copy_of(&s, i, dot)); + ex(&mut s, "node.set", json!({"id": ia, "props": {"sizingH": "fill"}})); + ex(&mut s, "node.set", json!({"id": idot, "props": {"width": 40}})); + let native = figcraft_format::save_bytes(s.doc().unwrap(), None).unwrap(); + let (fig, _) = figcraft_format::fig::export(s.doc().unwrap(), None).unwrap(); + for (bytes, name) in [(native, "field.figcraft"), (fig, "field.fig")] { + let mut s = Session::new(); + open(&mut s, &bytes, name); + let i = instance(&s); + let (ia, idot) = (named(&s, i, "Atom"), named(&s, i, "Dot")); + assert!(node(&s, ia).overrides.contains("resizing"), "{name}: {:?}", node(&s, ia).overrides); + assert!(node(&s, idot).overrides.contains("size"), "{name}: {:?}", node(&s, idot).overrides); + // An edit of the main relays the instance out. + let main = |s: &Session, id: NodeId| node(s, id).source.unwrap(); + let (atom, dot) = (main(&s, ia), main(&s, idot)); + ex(&mut s, "node.set", json!({"id": atom, "props": {"minWidth": 120}})); + ex(&mut s, "node.set", json!({"id": dot, "props": {"width": 30}})); + assert_eq!((sizing_h(&s, ia), node(&s, ia).width, node(&s, idot).width), (Sizing::Fill, 240.0, 40.0), "{name}"); + healthy(&s); + } +} + +#[test] +fn imported_resizing_overrides_survive_relayout() { + let at = |x: f64, y: f64| json!([[1, 0, x], [0, 1, y]]); + let dot = |id: &str| json!({"id": id, "name": "Dot", "type": "RECTANGLE", "relativeTransform": at(0.0, 0.0), "size": {"x": 20, "y": 20}}); + let atom = |id: &str, dot_id: &str, w: f64, more: Value| { + let mut a = json!({"id": id, "name": "Atom", "type": "FRAME", "relativeTransform": at(0.0, 0.0), "size": {"x": w, "y": 20}, + "layoutMode": "HORIZONTAL", "primaryAxisSizingMode": "AUTO", "counterAxisSizingMode": "AUTO", "minWidth": 100, "children": [dot(dot_id)]}); + a.as_object_mut().unwrap().extend(more.as_object().unwrap().clone()); + a + }; + let field = |id: &str, ty: &str, y: f64, kids: Value| { + json!({"id": id, "name": "Field", "type": ty, "relativeTransform": at(0.0, y), "size": {"x": 240, "y": 40}, "layoutMode": "HORIZONTAL", + "primaryAxisSizingMode": "FIXED", "counterAxisSizingMode": "FIXED", "children": kids}) + }; + let mut inst = + field("2:1", "INSTANCE", 100.0, json!([atom("I2:1;1:2", "I2:1;1:3", 240.0, json!({"layoutSizingHorizontal": "FILL", "layoutGrow": 1}))])); + inst["componentId"] = json!("1:1"); + inst["overrides"] = json!([{"id": "I2:1;1:2", "overriddenFields": ["layoutSizingHorizontal", "layoutGrow"]}]); + let file = json!({"name": "Field", "document": {"id": "0:0", "type": "DOCUMENT", "children": [ + {"id": "0:1", "name": "Page", "type": "CANVAS", "children": [field("1:1", "COMPONENT", 0.0, json!([atom("1:2", "1:3", 100.0, json!({}))])), inst]} + ]}, "components": {"1:1": {"key": "k", "name": "Field", "description": ""}}, "styles": {}}); + let mut s = Session::new(); + open(&mut s, file.to_string().as_bytes(), "field.json"); + let i = instance(&s); + let ia = named(&s, i, "Atom"); + assert_eq!((sizing_h(&s, ia), node(&s, ia).width), (Sizing::Fill, 240.0)); + assert!(node(&s, ia).overrides.contains("resizing"), "{:?}", node(&s, ia).overrides); + // The main's first edit relays every instance out from it. + let main_atom = node(&s, ia).source.unwrap(); + ex(&mut s, "node.set", json!({"id": main_atom, "props": {"minWidth": 120}})); + assert_eq!((sizing_h(&s, ia), node(&s, ia).width), (Sizing::Fill, 240.0)); + healthy(&s); +} diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index f49d3fc66..a0d87f9c2 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1623,6 +1623,8 @@ mod import_journal_tests; #[cfg(test)] mod inspect_behaviour_tests; #[cfg(test)] +mod instance_resizing_tests; +#[cfg(test)] mod interaction_rollback_tests; #[cfg(test)] mod invite_links_tests; diff --git a/crates/format/src/fig/export.rs b/crates/format/src/fig/export.rs index de1705ead..ca9e2682a 100644 --- a/crates/format/src/fig/export.rs +++ b/crates/format/src/fig/export.rs @@ -1858,12 +1858,13 @@ impl<'d> Exporter<'d> { let named = set.is_none_or(|s| s.name != n.name); let root_mine: Fields = f.iter().filter(|(k, _)| !OWN.contains(k) && (named || *k != "name")).cloned().collect(); // Each layer below: its id path, the fields that differ from the main's layer, that layer's - // fields, and the component a nested instance was swapped for. + // fields, whether its size is its own (a nested instance, a size override) and the + // component a nested instance was swapped for. struct Row { path: Kv<'static>, changed: Fields, theirs: Fields, - nested: bool, + sized: bool, swap: Option>, } let mut rows: Vec = Vec::new(); @@ -1891,8 +1892,8 @@ impl<'d> Exporter<'d> { (NodeKind::Instance { component, .. }, _) => self.guid_of(*component), _ => None, }; - let nested = matches!(d.kind, NodeKind::Instance { .. }); - rows.push(Row { path: o(vec![("guids", arr(guids))]), changed: changed(mine, &theirs), theirs, nested, swap }); + let sized = matches!(d.kind, NodeKind::Instance { .. }) || d.overrides.contains("size"); + rows.push(Row { path: o(vec![("guids", arr(guids))]), changed: changed(mine, &theirs), theirs, sized, swap }); } // An instance scaled as a whole (the Scale tool) is `factor` times its main in every length: // sizes, places and stroke weights, its own and its layers'. A resized one keeps its weights. @@ -1927,8 +1928,8 @@ impl<'d> Exporter<'d> { let (mut of, mut df): (Fields, Fields) = (vec![("guidPath", r.path.clone())], vec![("guidPath", r.path)]); for (k, v) in r.changed { let follows = follows(k, &v, &r.theirs); - // A nested instance's size is its own to set. - if follows && r.nested && k == "size" { + // A nested instance's size is its own to set, as is a size the layer overrides. + if follows && r.sized && k == "size" { of.push((k, v.clone())); } if follows { &mut df } else { &mut of }.push((k, v)); diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 5c32c583d..230faa7d1 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -860,6 +860,8 @@ impl<'a> Mapper<'a> { "wireFrame": own == "FRAME", "wireInstance": own == "INSTANCE", "slotContent": inst.is_some_and(|i| i.slot_content), + // A size the instance gives this layer itself (kept when the instance relays out). + "sizeOverride": entries.iter().any(|e| e.entry == Entry::Override && e.row.get("size").is_some()), }), ); o.insert("type".into(), json!(ty)); diff --git a/crates/format/src/rest/mod.rs b/crates/format/src/rest/mod.rs index 60f1cc9cd..953522e1f 100644 --- a/crates/format/src/rest/mod.rs +++ b/crates/format/src/rest/mod.rs @@ -481,9 +481,11 @@ impl<'a> Ctx<'a> { let id = self.doc.alloc_id(); let label = kind.label(); let mut n = Node::new(id, kind, text(j, "name").map_or(label, clip_str), w, h); - if self.fig_sources.is_some() && j.get(FIG_SOURCE_FIELD).and_then(|source| source.get("slotOverride")).and_then(Value::as_bool) == Some(true) - { - n.overrides.insert("slot".into()); + // Overrides the .fig names explicitly (the rest are found by comparing with the main). + for (flag, group) in [("slotOverride", "slot"), ("sizeOverride", "size")] { + if self.fig_sources.is_some() && j.get(FIG_SOURCE_FIELD).and_then(|source| source.get(flag)).and_then(Value::as_bool) == Some(true) { + n.overrides.insert(group.into()); + } } n.transform = local(space.world, world); self.common(&mut n, j, parent_mode); @@ -1152,6 +1154,16 @@ fn override_group(field: &str) -> Option<&'static str> { | "textDecorationSkipInk" | "textDecorationColor" => "textStyle", "width" | "height" | "size" => "size", + "layoutSizingHorizontal" + | "layoutSizingVertical" + | "layoutGrow" + | "layoutAlign" + | "primaryAxisSizingMode" + | "counterAxisSizingMode" + | "minWidth" + | "maxWidth" + | "minHeight" + | "maxHeight" => "resizing", "paddingLeft" | "paddingRight" | "paddingTop" | "paddingBottom" | "horizontalPadding" | "verticalPadding" => "padding", "itemSpacing" | "counterAxisSpacing" => "gap", "primaryAxisAlignItems" | "counterAxisAlignItems" => "alignment", diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml index f87bc401a..2459d104a 100644 --- a/crates/ui-egui/locales/cs.toml +++ b/crates/ui-egui/locales/cs.toml @@ -1087,6 +1087,7 @@ status = "draft — needs native review" "Resize by the nudge amount" = "Změnit velikost o velikost posunu" "Resize frames to the device's screen (or the window without a device): their constraints and auto layout respond" = "Přizpůsobit velikost rámců obrazovce zařízení (nebo oknu bez zařízení): omezení a automatické rozvržení se přizpůsobí" "Resize to fit" = "Přizpůsobit velikost obsahu" +"Resizing" = "Změna velikosti" "Resolve" = "Vyřešit" "Resolve change" = "Vyřešit změnu" "Resolved" = "Vyřešené" diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index dd9910778..b679feb71 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -1053,6 +1053,7 @@ status = "draft — needs native review" "Resize by the nudge amount" = "Um die Schrittweite skalieren" "Resize frames to the device's screen (or the window without a device): their constraints and auto layout respond" = "Passt Rahmen an den Bildschirm des Geräts an (ohne Gerät an das Fenster): ihre Constraints und ihr Auto-Layout reagieren" "Resize to fit" = "Größe an Inhalt anpassen" +"Resizing" = "Größenanpassung" "Resolve" = "Erledigen" "Resolve change" = "Änderung erledigen" "Resolved" = "Erledigt" diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 6d5f0a5a4..9ce38a228 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -1107,6 +1107,7 @@ name = "English" "Resize by the nudge amount" = "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 frames to the device's screen (or the window without a device): their constraints and auto layout respond" "Resize to fit" = "Resize to fit" +"Resizing" = "Resizing" "Resolve" = "Resolve" "Resolve change" = "Resolve change" "Resolved" = "Resolved" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 1d43c320e..2849f4ec8 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -1108,6 +1108,7 @@ status = "draft — needs native review" "Resize by the nudge amount" = "Redimensionar según el desplazamiento" "Resize frames to the device's screen (or the window without a device): their constraints and auto layout respond" = "Ajusta los marcos a la pantalla del dispositivo (o a la ventana sin dispositivo): sus restricciones y su diseño automático se adaptan" "Resize to fit" = "Ajustar tamaño" +"Resizing" = "Cambio de tamaño" "Resolve" = "Resolver" "Resolve change" = "Resolver cambio" "Resolved" = "Resuelto" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index c59c1cae0..1c561f15e 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -1047,6 +1047,7 @@ status = "draft — needs native review" "Resize by the nudge amount" = "Redimensionner du pas de décalage" "Resize frames to the device's screen (or the window without a device): their constraints and auto layout respond" = "Redimensionne les cadres à l’écran de l’appareil (ou à la fenêtre sans appareil) : leurs contraintes et leur mise en page auto s’adaptent" "Resize to fit" = "Redimensionner au contenu" +"Resizing" = "Redimensionnement" "Resolve" = "Résoudre" "Resolve change" = "Résoudre la modification" "Resolved" = "Résolu" diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml index 2bb41e038..7a0a3c3ce 100644 --- a/crates/ui-egui/locales/id.toml +++ b/crates/ui-egui/locales/id.toml @@ -1091,6 +1091,7 @@ status = "draft — needs native review" "Resize by the nudge amount" = "Ubah ukuran sebesar jarak geser" "Resize frames to the device's screen (or the window without a device): their constraints and auto layout respond" = "Ubah ukuran frame ke layar perangkat (atau jendela tanpa perangkat): batasan dan auto layout-nya menyesuaikan" "Resize to fit" = "Ubah ukuran agar pas" +"Resizing" = "Pengubahan ukuran" "Resolve" = "Selesaikan" "Resolve change" = "Selesaikan perubahan" "Resolved" = "Terselesaikan" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index 84c3d6b38..b09db3bdd 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -1097,6 +1097,7 @@ status = "draft — needs native review" "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" = "解決済み" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index 0d64aeb10..f2cfcfff5 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -1047,6 +1047,7 @@ status = "draft — needs native review" "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" = "해결됨" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index 98039666b..e9e1300cf 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -1046,6 +1046,7 @@ status = "draft — needs native review" "Resize by the nudge amount" = "Redimensionar pelo valor do deslocamento" "Resize frames to the device's screen (or the window without a device): their constraints and auto layout respond" = "Redimensiona os quadros para a tela do dispositivo (ou para a janela, sem dispositivo): as restrições e o layout automático deles se adaptam" "Resize to fit" = "Redimensionar para caber" +"Resizing" = "Redimensionamento" "Resolve" = "Resolver" "Resolve change" = "Resolver alteração" "Resolved" = "Resolvido" diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 91d0a702e..2023b6929 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -1089,6 +1089,7 @@ name = "Русский" "Resize by the nudge amount" = "Изменить размер на шаг сдвига" "Resize frames to the device's screen (or the window without a device): their constraints and auto layout respond" = "Менять размер Frame под экран устройства (или окно, если устройство не выбрано): ограничения и автолейаут подстраиваются" "Resize to fit" = "Подогнать размер" +"Resizing" = "Изменение размера" "Resolve" = "Решить" "Resolve change" = "Разрешить изменение" "Resolved" = "Решённые" diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index d4e031e4a..51f165084 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -1101,6 +1101,7 @@ name = "Svenska" "Resize by the nudge amount" = "Ändra storlek med knuffavståndet" "Resize frames to the device's screen (or the window without a device): their constraints and auto layout respond" = "Ändra storlek på ramar efter enhetens skärm (eller fönstret utan enhet): deras begränsningar och automatiska layout anpassas" "Resize to fit" = "Anpassa storlek" +"Resizing" = "Storleksändring" "Resolve" = "Lös" "Resolve change" = "Lös ändring" "Resolved" = "Löst" diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml index 7e7996e6c..cc002654d 100644 --- a/crates/ui-egui/locales/tr.toml +++ b/crates/ui-egui/locales/tr.toml @@ -1091,6 +1091,7 @@ name = "Türkçe" "Resize by the nudge amount" = "Kaydırma miktarı kadar yeniden boyutlandır" "Resize frames to the device's screen (or the window without a device): their constraints and auto layout respond" = "Çerçeveleri cihazın ekranına (veya cihaz yoksa pencereye) göre yeniden boyutlandır: kısıtlamaları ve otomatik yerleşimleri tepki verir" "Resize to fit" = "Sığacak şekilde yeniden boyutlandır" +"Resizing" = "Yeniden boyutlandırma" "Resolve" = "Çöz" "Resolve change" = "Değişikliği çöz" "Resolved" = "Çözüldü" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index b95e3b397..702cae7b8 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -1048,6 +1048,7 @@ status = "draft — needs native review" "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" = "已解决" diff --git a/crates/ui-egui/src/component_panel.rs b/crates/ui-egui/src/component_panel.rs index 719c25887..6c9ff7d41 100644 --- a/crates/ui-egui/src/component_panel.rs +++ b/crates/ui-egui/src/component_panel.rs @@ -503,6 +503,7 @@ fn group_label(g: &str) -> String { "exports" => tr("Export settings"), "interactions" => tr("Interactions"), "size" => tr("Size"), + "resizing" => tr("Resizing"), "position" => tr("Position"), "component" => tr("Swapped instance"), "props" => tr("Instance properties"), diff --git a/crates/ui-egui/src/layout_panel.rs b/crates/ui-egui/src/layout_panel.rs index bb60ebeba..9d3c0dcc5 100644 --- a/crates/ui-egui/src/layout_panel.rs +++ b/crates/ui-egui/src/layout_panel.rs @@ -29,8 +29,8 @@ pub fn layout_section(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[Node let al = common(doc, sel, |n| n.layout.clone()); let has_al = matches!(al, Some(Some(_))); let title = if has_al { tr("Auto layout") } else { tr("Layout") }; - // An instance's auto layout is its main's (only padding, gap and alignment are its own), and - // the layers inside it keep their main's size. + // An instance's auto layout is its main's (only padding, gap and alignment are its own); the + // layers inside it override their size and resizing, not their place in the layout. let in_instance = sel.iter().any(|i| figcraft_engine::components::owning_instance(doc, *i).is_some()); let nested = sel.iter().any(|i| figcraft_engine::components::inside_instance(doc, *i)); let btns: Vec<(Icon, &str)> = if in_instance { @@ -49,7 +49,7 @@ pub fn layout_section(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[Node if let Some(Some(l)) = &al { ui.add_enabled_ui(!in_instance, |ui| direction(app, ui, &ids, l)).response.on_disabled_hover_text(from_main); } - ui.add_enabled_ui(!nested, |ui| dimensions(app, ui, doc, sel, has_al)).response.on_disabled_hover_text(from_main); + dimensions(app, ui, doc, sel, has_al, nested, from_main); if let Some(Some(l)) = &al { alignment(app, ui, &ids, l); spacing(app, ui, &ids, l); @@ -146,7 +146,8 @@ fn limit(n: &Node, horizontal: bool, is_min: bool) -> Option { } } -fn dimensions(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId], has_al: bool) { +/// `nested`: layers inside an instance, whose proportion lock is their main's (`from_main` says so). +fn dimensions(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId], has_al: bool, nested: bool, from_main: &str) { let ids = sel.to_vec(); let w_of = |n: &Node| (n.width * 100.0).round() / 100.0; let h_of = |n: &Node| (n.height * 100.0).round() / 100.0; @@ -159,7 +160,13 @@ fn dimensions(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId], has let e = crate::variable_ui::number_field_mixed(app, ui, &ids, "height", Id::new("lay_h"), Lead::Text("H"), h, "", col); app.field_of(&ids, "height", e, h_of, |v| json!(v.max(0.0))); let locked = common(doc, sel, |n| n.constrain_proportions).unwrap_or(false); - if icons::button(ui, if locked { Icon::LinkOn } else { Icon::LinkOff }, 24.0, locked, tr("Constrain proportions")).clicked() { + let link = ui + .add_enabled_ui(!nested, |ui| { + icons::button(ui, if locked { Icon::LinkOn } else { Icon::LinkOff }, 24.0, locked, tr("Constrain proportions")) + }) + .inner + .on_disabled_hover_text(from_main); + if link.clicked() { app.set_props(&ids, json!({"constrainProportions": !locked})); } }); diff --git a/docs/components-parity.md b/docs/components-parity.md index 659676fd4..1ecd96867 100644 --- a/docs/components-parity.md +++ b/docs/components-parity.md @@ -14,8 +14,8 @@ accounts). |---|---|---| | 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 | done | each kept when the main changes that property, reset per group; opacity and corner radius too (documentation silent) | -| What it doesn't: position, rotation, size, constraints and resizing of layers inside it, its auto layout direction and other settings, its structure | done | refused with a message, the fields greyed out; the instance itself resizes and its layers follow the main's constraints | +| 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; the instance itself resizes and its layers follow the main's constraints | | Component sets / variants, add variant, switch | done | | | 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 | | @@ -76,6 +76,7 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`. | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Size and resizing overrides of layers inside instances (#731): a layer in an instance can hug, fill or keep a size of its own (group `resizing`: hug/fill/fixed with min and max; `size`), from the Layout panel, the canvas handles and `node.set`; they were refused, and imported ones were dropped at the first relayout. Kept through main edits of other properties, rebuilds, undo, save, `.fig` and REST import (sizes a `.fig` instance gives its layers and the REST `overrides` fields), `.fig` export and detach; reset per group and with Reset all changes (`instance_resizing_tests`). The row that listed them as not overridable was wrong. Numbers unchanged. | | 2026-10-14 | minor | Variables export in the browser: Export… ▸ Variables JSON / CSS custom properties did nothing in the web build, which has no save dialogs; it now hands the file over as a download (`Services::downloads` / `download`, `variables_export_ui_tests`). Import in the browser still needs a file picker, as do the other exports there. Numbers unchanged. | | 2026-10-13 | minor | Component playground (M3): with an instance, a component or a component set selected, the Inspect tab shows a Playground: a preview of the component and a control for each variant, boolean and text property. What is tried there changes the preview and the code in the Code section, never the file (no undo step, the canvas instance stays as it is); Reset goes back to the component's or the instance's own values. `component.playground {id?, properties?, language?, path?}` gives the same to scripts: the properties with their values, the code, and a PNG on request (`playground_tests`). Left: instance-swap and slot properties in the playground (the command takes an instance swap; the panel has no control for it), a code connect template's snippet with the tried values. Numbers unchanged. | | 2026-10-13 | minor | Variables inside styles (M3): a shared style can bind variables to fields of its value (`style.bind {style, field, variable?}`: a paint style's colours and gradient stops, an effect style's colour, radius, spread and offsets, a grid style's size, count, gutter and offset, a text style's font size, line height, letter spacing, family and style). Every layer using the style shows those fields resolved in its own modes and stays linked when a variable or a mode changes; the style keeps them resolved in the default modes. A style made from a layer keeps that layer's bindings; a new value drops bindings to what is gone. The style editor binds from its property rows (paint colour, shadow colour, blur radius, grid size) and detaches from the variable's chip; the style picker marks styles that use variables. `.fig` export and import carry the bindings on the style, REST layers hand theirs to the style they use. Left: binding text style fields and the other effect and grid fields from the editor (commands only), library variables in the picker, a style's library copy. Numbers unchanged. | diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index d8e517119..e65918534 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -17,9 +17,9 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| -| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Not read: connector labels, table cells beyond their own layers, filled areas with their own fills, per-point stroke joins, variables bound to fields the editor can't bind, fixed or content-sized grid tracks, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs`, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | +| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Not read: connector labels, table cells beyond their own layers, filled areas with their own fills, per-point stroke joins, variables bound to fields the editor can't bind, fixed or content-sized grid tracks, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs`, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | -| REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout, constraints, grids, components, sets, instances with overrides, component properties, styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | +| REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout, constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | | Local library files | team libraries in the cloud | yes (enable a `.figcraft` as a library) | yes (publish) | per-asset versions, updates with overrides kept | see [collaboration-parity](collaboration-parity.md) | @@ -162,6 +162,7 @@ each. | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Instance layers' own size and resizing (#731): a `.fig` import keeps the sizes an instance gives its layers and their hug/fill/fixed and min/max as overrides, a REST import reads the resizing fields of `overrides`, and a `.fig` export writes a layer's own size as an override (it went with the derived layout, which a relayout replaces). Numbers unchanged | | 2026-10-14 | minor | SVG/PDF depth overflow (#208) is checked before bounds and drawing; public checked APIs return the offending root/layer, commands and CLI report it, and no incomplete export replaces an existing file. Tested at depths 255/256/257, with inner roots, hidden branches, masks, raster fallbacks and multiple roots/pages. Numbers unchanged. | | 2026-10-13 | minor | `.fig` export (gap 1): instances write what they change from their main as an override addressed by the main's id (their size, name and paints were lost elsewhere without it), what follows for their layers as derived data, and a scale factor when scaled as a whole; layers of a nested instance swapped for another component keep their overrides; variable collections, modes, variables and their bindings, the modes frames and pages set, shared styles with their links and variable-width strokes are written, and the import reads all of it back (style definitions and unused styles, variable order and scopes, bindings on paint lists, gradient stops, effects and layout grids, page modes, text field bindings, which a `.fig` import used to drop, and width profiles). Opened `.fig` and file JSON documents link nested instances of variants (and any nested instance under a name of its own) to their main's layers; they stayed unlinked, so a second export lost what they changed. Checked by opening written files in other software: resized and scaled instances keep their size and lay their layers out for it, variables with their modes and colour bindings resolve there (a frame set to another mode shows that mode's colours, also inside instances), colour, text, effect and grid styles are listed, and variable-width strokes that are the same on both sides of the path draw with their width; number, string and boolean bindings and bindings on effects, layout guides and gradient stops come across as the values they give but did not show as bound there (their entries now also name the layer field they set, not yet checked there), and strokes wider on one side of the path are written as filled outlines, no longer editable strokes there (the stroke itself is kept as plugin data and our own import puts it back; not yet checked there). Numbers unchanged | | 2026-10-12 | minor | `.fig` export made to open elsewhere (gap 1): the document and its pages say they are visible and opaque (left out, nothing was drawn), the schema in the file uses the format's own names, kinds, field ids and enum values, rectangles are rounded rectangles with four radii, frames and shapes carry their fill outline and plain strokes their stroke outline, text carries its layout settings, font styles use their standard names, line heights that are a share of the font size are raw multipliers, masks keep their type (read back too); the import reads per-side stroke weights whose zero sides are left out. Written files were checked by opening them in other software: layers, fills, gradients, strokes, shadows, vectors, components and text draw as in FigCraft; effects such as glass and noise, images and prototype interactions are still unchecked there, and variables are not written. Numbers unchanged | From 64423c58bc5ab7af44f76aeac9f4e05edae5a680 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 18:45:32 +0700 Subject: [PATCH 171/817] M3: .fig and REST imports keep Hug on auto layout and text (#732) An auto layout frame a .fig records no primary-axis sizing for hugs on that axis (auto layout sized it by its content before that axis could be fixed) instead of turning fixed; an instance that records no auto layout takes its main's; REST frames whose sizing modes are left out hug (the documented default); text hugs by its resize mode (auto width both axes, auto height its height) instead of coming in fixed. --- .../src/fig/auto_layout_sizing_tests.rs | 193 ++++++++++++++++++ crates/format/src/fig/export_tests.rs | 11 + crates/format/src/fig/map.rs | 16 +- crates/format/src/fig/mod.rs | 2 + crates/format/src/rest/props.rs | 11 +- docs/file-format-parity.md | 5 +- 6 files changed, 233 insertions(+), 5 deletions(-) create mode 100644 crates/format/src/fig/auto_layout_sizing_tests.rs diff --git a/crates/format/src/fig/auto_layout_sizing_tests.rs b/crates/format/src/fig/auto_layout_sizing_tests.rs new file mode 100644 index 000000000..99730f70f --- /dev/null +++ b/crates/format/src/fig/auto_layout_sizing_tests.rs @@ -0,0 +1,193 @@ +//! How auto layout frames and text size on import (hug or fixed), on encoded `.fig` files built in +//! code and REST file JSON: the sizing a file records, an auto layout frame that records none, and +//! text that hugs by its resize mode. + +use figcraft_doc::{Document, Sizing}; +use serde_json::{Value, json}; + +use super::kiwi::{Kv, Schema}; + +const SCHEMA: &str = " +enum NodeType NONE DOCUMENT CANVAS FRAME TEXT SYMBOL INSTANCE +enum StackMode NONE HORIZONTAL VERTICAL +enum StackSize FIXED RESIZE_TO_FIT RESIZE_TO_FIT_WITH_IMPLICIT_SIZE +enum TextAutoResize NONE WIDTH_AND_HEIGHT HEIGHT +struct GUID uint sessionID, uint localID +struct Vector float x, float y +struct Matrix float m00, float m01, float m02, float m10, float m11, float m12 +message ParentIndex GUID guid, string position +message TextData string characters +message SymbolData GUID symbolID +message NodeChange GUID guid, ParentIndex parentIndex, NodeType type, string name, Vector size, Matrix transform, StackMode stackMode, StackSize stackPrimarySizing, StackSize stackCounterSizing, TextAutoResize textAutoResize, float fontSize, TextData textData, SymbolData symbolData +message Message NodeChange[] nodeChanges +"; + +type Fields = Vec<(&'static str, Kv<'static>)>; + +fn o(fields: Fields) -> Kv<'static> { + Kv::Object(fields) +} + +fn g(id: u64) -> Kv<'static> { + o(vec![("sessionID", Kv::Uint(1)), ("localID", Kv::Uint(id))]) +} + +fn xy(x: f64, y: f64) -> Kv<'static> { + o(vec![("x", Kv::Float(x as f32)), ("y", Kv::Float(y as f32))]) +} + +fn at(x: f64, y: f64) -> Kv<'static> { + let f = |v: f64| Kv::Float(v as f32); + o(vec![("m00", f(1.0)), ("m01", f(0.0)), ("m02", f(x)), ("m10", f(0.0)), ("m11", f(1.0)), ("m12", f(y))]) +} + +fn node(id: u64, parent: u64, pos: &str, ty: &'static str, name: &str, mut more: Fields) -> Kv<'static> { + let mut v = vec![("guid", g(id)), ("parentIndex", o(vec![("guid", g(parent)), ("position", Kv::Str(pos.into()))]))]; + v.extend([("type", Kv::Enum(ty)), ("name", Kv::Str(name.into()))]); + v.append(&mut more); + o(v) +} + +/// An auto layout frame's fields: its direction and the sizing it records (`None`: none). +fn stack(mode: &'static str, primary: Option<&'static str>, counter: Option<&'static str>) -> Fields { + let mut f = vec![("stackMode", Kv::Enum(mode))]; + f.extend(primary.map(|p| ("stackPrimarySizing", Kv::Enum(p)))); + f.extend(counter.map(|c| ("stackCounterSizing", Kv::Enum(c)))); + f +} + +/// A text layer " text" in `parent`, with resize mode `resize` (`None`: none recorded). +fn label(id: u64, parent: u64, name: &str, resize: Option<&'static str>) -> Kv<'static> { + let mut f = vec![("size", xy(40.0, 16.0)), ("transform", at(0.0, 0.0)), ("fontSize", Kv::Float(12.0))]; + f.push(("textData", o(vec![("characters", Kv::Str(name.into()))]))); + f.extend(resize.map(|r| ("textAutoResize", Kv::Enum(r)))); + node(id, parent, "!", "TEXT", &format!("{name} text"), f) +} + +/// A component at `x` holding a text layer, with `fields` of its own. +fn component(id: u64, x: f64, name: &str, fields: Fields, resize: Option<&'static str>) -> Vec> { + let mut f = vec![("size", xy(40.0, 16.0)), ("transform", at(x, 0.0))]; + f.extend(fields); + vec![node(id, 1, &format!("{id}"), "SYMBOL", name, f), label(id + 1, id, name, resize)] +} + +fn import(nodes: Vec>) -> Document { + let mut all = vec![ + o(vec![ + ("guid", o(vec![("sessionID", Kv::Uint(0)), ("localID", Kv::Uint(0))])), + ("type", Kv::Enum("DOCUMENT")), + ("name", Kv::Str("D".into())), + ]), + o(vec![ + ("guid", g(1)), + ("parentIndex", o(vec![("guid", o(vec![("sessionID", Kv::Uint(0)), ("localID", Kv::Uint(0))])), ("position", Kv::Str("!".into()))])), + ("type", Kv::Enum("CANVAS")), + ("name", Kv::Str("Page".into())), + ]), + ]; + all.extend(nodes); + let schema = Schema::parse(SCHEMA).unwrap(); + let bytes = super::tests::canvas(&schema, &o(vec![("nodeChanges", Kv::Array(all))])); + super::import(&bytes, "sizing").unwrap().0 +} + +fn sizing(doc: &Document, name: &str) -> (Sizing, Sizing) { + let n = doc.nodes().find(|n| n.name == name).unwrap_or_else(|| panic!("no layer {name}")); + (n.child_layout.sizing_h, n.child_layout.sizing_v) +} + +#[test] +fn auto_layout_frames_hug_as_recorded_and_by_default_on_their_primary_axis() { + use Sizing::{Fixed, Hug}; + let fit = Some("RESIZE_TO_FIT"); + // (component, its auto layout fields, expected (horizontal, vertical), derivation) + let rows: Vec<(&str, Fields, (Sizing, Sizing), &str)> = vec![ + ("Button", stack("HORIZONTAL", fit, fit), (Hug, Hug), "both axes hug, as recorded"), + ("Implicit", stack("HORIZONTAL", Some("RESIZE_TO_FIT_WITH_IMPLICIT_SIZE"), fit), (Hug, Hug), "hugging with an implicit size"), + ("Fixed", stack("HORIZONTAL", Some("FIXED"), Some("FIXED")), (Fixed, Fixed), "both axes fixed, as recorded"), + ("Legacy", stack("HORIZONTAL", None, fit), (Hug, Hug), "no primary sizing: the primary axis sizes by its content"), + ("Legacy column", stack("VERTICAL", None, None), (Fixed, Hug), "no sizing: the primary (vertical) axis hugs, the counter axis is fixed"), + ]; + let mut nodes = Vec::new(); + for (k, (name, fields, _, _)) in rows.iter().enumerate() { + nodes.extend(component(10 * (k as u64 + 1), 60.0 * k as f64, name, fields.clone(), Some("WIDTH_AND_HEIGHT"))); + } + let doc = import(nodes); + for (name, _, want, why) in rows { + assert_eq!(sizing(&doc, name), want, "{name}: {why}"); + } +} + +#[test] +fn text_hugs_by_its_resize_mode() { + use Sizing::{Fixed, Hug}; + let fit = Some("RESIZE_TO_FIT"); + let mut nodes = Vec::new(); + for (k, (name, resize)) in + [("Auto width", Some("WIDTH_AND_HEIGHT")), ("Auto height", Some("HEIGHT")), ("Fixed box", Some("NONE")), ("Unset", None)] + .into_iter() + .enumerate() + { + nodes.extend(component(10 * (k as u64 + 1), 60.0 * k as f64, name, stack("HORIZONTAL", fit, fit), resize)); + } + // An instance of the auto width one: it hugs, and so does its copy of the text. + nodes.push(node( + 90, + 1, + "~", + "INSTANCE", + "Auto width instance", + [vec![("size", xy(40.0, 16.0)), ("transform", at(0.0, 100.0)), ("symbolData", o(vec![("symbolID", g(10))]))], stack("HORIZONTAL", fit, fit)] + .concat(), + )); + // One that records nothing of its auto layout: it has its main's. + nodes.push(node( + 91, + 1, + "~~", + "INSTANCE", + "Bare instance", + vec![("size", xy(40.0, 16.0)), ("transform", at(0.0, 150.0)), ("symbolData", o(vec![("symbolID", g(10))]))], + )); + let doc = import(nodes); + for (name, want) in + [("Auto width text", (Hug, Hug)), ("Auto height text", (Fixed, Hug)), ("Fixed box text", (Fixed, Fixed)), ("Unset text", (Fixed, Fixed))] + { + assert_eq!(sizing(&doc, name), want, "{name}"); + } + let inst = doc.nodes().find(|n| n.name == "Auto width instance").unwrap(); + assert_eq!((inst.child_layout.sizing_h, inst.child_layout.sizing_v), (Hug, Hug)); + let copy = inst.children.first().and_then(|c| doc.node(*c)).unwrap(); + assert_eq!((copy.child_layout.sizing_h, copy.child_layout.sizing_v), (Hug, Hug)); + let bare = doc.nodes().find(|n| n.name == "Bare instance").unwrap(); + assert_eq!(bare.layout.as_ref().map(|l| l.mode), Some(figcraft_doc::LayoutMode::Horizontal)); + assert_eq!((bare.child_layout.sizing_h, bare.child_layout.sizing_v), (Hug, Hug)); +} + +#[test] +fn rest_files_read_left_out_sizing_modes_as_hug_and_text_by_its_resize_mode() { + use Sizing::{Fixed, Hug}; + let at = json!([[1, 0, 0], [0, 1, 0]]); + let text = |id: &str, name: &str, more: Value| { + let mut t = json!({"id": id, "name": name, "type": "TEXT", "relativeTransform": at, "size": {"x": 40, "y": 16}, "characters": name, + "style": {"fontFamily": "Inter", "fontSize": 12, "textAutoResize": "WIDTH_AND_HEIGHT"}}); + t.as_object_mut().unwrap().extend(more.as_object().unwrap().clone()); + t + }; + let frame = |id: &str, name: &str, more: Value, kids: Value| { + let mut f = json!({"id": id, "name": name, "type": "COMPONENT", "relativeTransform": at, "size": {"x": 40, "y": 16}, + "layoutMode": "HORIZONTAL", "children": kids}); + f.as_object_mut().unwrap().extend(more.as_object().unwrap().clone()); + f + }; + let file = json!({"name": "Sizing", "document": {"id": "0:0", "type": "DOCUMENT", "children": [{"id": "0:1", "name": "Page", "type": "CANVAS", "children": [ + frame("1:1", "Defaults", json!({}), json!([text("1:2", "Label", json!({}))])), + frame("2:1", "Fixed", json!({"primaryAxisSizingMode": "FIXED", "counterAxisSizingMode": "FIXED"}), + json!([text("2:2", "Fixed label", json!({"layoutSizingHorizontal": "FIXED"}))])), + ]}]}}); + let (doc, _) = crate::rest::import(&file, &crate::rest::no_images).unwrap(); + // The REST API leaves out the default sizing modes (AUTO); explicit per-axis sizing wins. + for (name, want) in [("Defaults", (Hug, Hug)), ("Label", (Hug, Hug)), ("Fixed", (Fixed, Fixed)), ("Fixed label", (Fixed, Hug))] { + assert_eq!(sizing(&doc, name), want, "{name}"); + } +} diff --git a/crates/format/src/fig/export_tests.rs b/crates/format/src/fig/export_tests.rs index 53cfaf917..56e9fcbff 100644 --- a/crates/format/src/fig/export_tests.rs +++ b/crates/format/src/fig/export_tests.rs @@ -595,6 +595,17 @@ fn normalize(n: &mut Node, ix: &dyn Fn(NodeId) -> NodeId) { n.source = None; n.overrides.clear(); n.constrain_proportions = false; + // A text's resize mode is its sizing (the editor keeps them together; generated documents + // don't): auto width hugs both axes, auto height its height. + if let NodeKind::Text(t) = &n.kind { + let cl = &mut n.child_layout; + let hug = |s: &mut Sizing| *s = if *s == Sizing::Fixed { Sizing::Hug } else { *s }; + match t.auto_resize { + TextAutoResize::WidthAndHeight => [&mut cl.sizing_h, &mut cl.sizing_v].into_iter().for_each(hug), + TextAutoResize::Height => hug(&mut cl.sizing_v), + _ => {} + } + } let fold = |ps: &mut Vec| { for p in ps.iter_mut() { if let PaintKind::Solid { color } = &mut p.kind { diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 230faa7d1..25540ff61 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -924,7 +924,16 @@ impl<'a> Mapper<'a> { } else if ty == "INSTANCE" { if let Some((sub, sym)) = self.instance(&mut o, &view, id, inst, &rest_id) { let main = self.nodes.get(&sym).map(|m| View::of(m)); - let fit = Fit::frame(main.and_then(|m| m.size()), view.size()); + let fit = Fit::frame(main.as_ref().and_then(View::size), view.size()); + // An instance that records no auto layout of its own has its main's. + let view = match main { + Some(m) if view.get("stackMode").is_none() && m.get("stackMode").is_some() => { + let layered = View { fitted: view.fitted, ..m.with(view.layers.iter().copied()) }; + self.auto_layout(&mut o, &layered); + layered + } + _ => view.clone(), + }; for c in self.children(&sym) { // The main's branch can live outside the cached context being mapped. kids.extend(self.layer_filtered(&c, Some(&sub), child_space, Some(&view), fit, depth + 1, None)); @@ -1407,7 +1416,10 @@ impl<'a> Mapper<'a> { }; o.insert("counterAxisAlignItems".into(), json!(cross)); let sizing = |k: &str| if v.str(k).is_some_and(|s| s.starts_with("RESIZE_TO_FIT")) { "AUTO" } else { "FIXED" }; - o.insert("primaryAxisSizingMode".into(), json!(sizing("stackPrimarySizing"))); + // A flow that records no sizing for its primary axis sizes it by its content: auto layout + // did before that axis could be fixed. + let primary = if v.get("stackPrimarySizing").is_none() && mode != "GRID" { "AUTO" } else { sizing("stackPrimarySizing") }; + o.insert("primaryAxisSizingMode".into(), json!(primary)); o.insert("counterAxisSizingMode".into(), json!(sizing("stackCounterSizing"))); if let Some(b) = v.flag("bordersTakeSpace") { o.insert("strokesIncludedInLayout".into(), json!(b)); diff --git a/crates/format/src/fig/mod.rs b/crates/format/src/fig/mod.rs index 97f35f63c..fc9293d9e 100644 --- a/crates/format/src/fig/mod.rs +++ b/crates/format/src/fig/mod.rs @@ -13,6 +13,8 @@ //! tables, …) come in as the closest frames, text and vectors. Anything not understood is skipped //! with a warning; malformed input never panics. +#[cfg(test)] +mod auto_layout_sizing_tests; #[cfg(test)] mod connector_label_tests; mod export; diff --git a/crates/format/src/rest/props.rs b/crates/format/src/rest/props.rs index 49c9d372a..1003682b7 100644 --- a/crates/format/src/rest/props.rs +++ b/crates/format/src/rest/props.rs @@ -484,8 +484,17 @@ pub(super) fn child_layout(v: &Value, own: Option, parent_mode: Opti let mut cl = ChildLayout::default(); let horizontal_main = |m: LayoutMode| m != LayoutMode::Vertical; // Legacy fields first, the explicit per-axis sizing wins. + // A text's resize mode is its sizing: auto width hugs both axes, auto height its height. + if text(v, "type") == Some("TEXT") && v.get("style").and_then(|s| text(s, "textTruncation")) != Some("ENDING") { + match v.get("style").and_then(|s| text(s, "textAutoResize")) { + Some("WIDTH_AND_HEIGHT") => (cl.sizing_h, cl.sizing_v) = (Sizing::Hug, Sizing::Hug), + Some("HEIGHT") => cl.sizing_v = Sizing::Hug, + _ => {} + } + } if let Some(m) = own { - let hug = |k: &str| text(v, k) == Some("AUTO"); + // Both default to AUTO (hug) when the file leaves them out. + let hug = |k: &str| text(v, k) != Some("FIXED"); let (main, cross) = (hug("primaryAxisSizingMode"), hug("counterAxisSizingMode")); let (h, w) = if horizontal_main(m) { (main, cross) } else { (cross, main) }; if h { diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index e65918534..250d796a1 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -17,9 +17,9 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| -| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Not read: connector labels, table cells beyond their own layers, filled areas with their own fills, per-point stroke joins, variables bound to fields the editor can't bind, fixed or content-sized grid tracks, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs`, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | +| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included; a flow that records no primary-axis sizing hugs on that axis, an instance that records no auto layout has its main's), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Not read: connector labels, table cells beyond their own layers, filled areas with their own fills, per-point stroke joins, variables bound to fields the editor can't bind, fixed or content-sized grid tracks, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs`, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | -| REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout, constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | +| REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout (sizing modes left out read as hug, as documented), constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | | Local library files | team libraries in the cloud | yes (enable a `.figcraft` as a library) | yes (publish) | per-asset versions, updates with overrides kept | see [collaboration-parity](collaboration-parity.md) | @@ -162,6 +162,7 @@ each. | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Hug on import (#732): auto layout frames a `.fig` records no primary-axis sizing for hug on that axis (auto layout sized that axis by its content before it could be fixed) instead of turning fixed, instances that record no auto layout take their main's (they came in without auto layout and fixed, so longer text overflowed them), REST frames whose sizing modes are left out hug (the documented default), and text hugs by its resize mode (auto width both axes, auto height its height; it came in fixed). Numbers unchanged | | 2026-10-17 | minor | Instance layers' own size and resizing (#731): a `.fig` import keeps the sizes an instance gives its layers and their hug/fill/fixed and min/max as overrides, a REST import reads the resizing fields of `overrides`, and a `.fig` export writes a layer's own size as an override (it went with the derived layout, which a relayout replaces). Numbers unchanged | | 2026-10-14 | minor | SVG/PDF depth overflow (#208) is checked before bounds and drawing; public checked APIs return the offending root/layer, commands and CLI report it, and no incomplete export replaces an existing file. Tested at depths 255/256/257, with inner roots, hidden branches, masks, raster fallbacks and multiple roots/pages. Numbers unchanged. | | 2026-10-13 | minor | `.fig` export (gap 1): instances write what they change from their main as an override addressed by the main's id (their size, name and paints were lost elsewhere without it), what follows for their layers as derived data, and a scale factor when scaled as a whole; layers of a nested instance swapped for another component keep their overrides; variable collections, modes, variables and their bindings, the modes frames and pages set, shared styles with their links and variable-width strokes are written, and the import reads all of it back (style definitions and unused styles, variable order and scopes, bindings on paint lists, gradient stops, effects and layout grids, page modes, text field bindings, which a `.fig` import used to drop, and width profiles). Opened `.fig` and file JSON documents link nested instances of variants (and any nested instance under a name of its own) to their main's layers; they stayed unlinked, so a second export lost what they changed. Checked by opening written files in other software: resized and scaled instances keep their size and lay their layers out for it, variables with their modes and colour bindings resolve there (a frame set to another mode shows that mode's colours, also inside instances), colour, text, effect and grid styles are listed, and variable-width strokes that are the same on both sides of the path draw with their width; number, string and boolean bindings and bindings on effects, layout guides and gradient stops come across as the values they give but did not show as bound there (their entries now also name the layer field they set, not yet checked there), and strokes wider on one side of the path are written as filled outlines, no longer editable strokes there (the stroke itself is kept as plugin data and our own import puts it back; not yet checked there). Numbers unchanged | From ab1ae981f339aff938f6c86059826cb95137f2c0 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 19:51:27 +0700 Subject: [PATCH 172/817] #359: drop the progress-doc edit --- docs/ui-parity.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/ui-parity.md b/docs/ui-parity.md index cda1891b8..62001715e 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-10-15 · **Change:** minor (native-density canvas textures aligned to device pixels; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-15 · **Change:** minor (fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **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: @@ -94,7 +94,6 @@ interaction feel not yet compared. | Item | Status | Notes | |---|---|---| | Pan/zoom: wheel, pinch, Space-drag, Shift+0/1/2, Cmd+0, `+`/`-` | done | Shift-wheel pans sideways, pinch and the zoom tool keep the point under the pointer; zoom steps, limits (2%–25,600%) and frame order pinned where the documentation is silent (`view_behaviour_tests`) | -| Canvas texture sharpness | done (ours) | Native-density canvas images start on whole device pixels, avoiding extra linear-filter blending at fractional zoom, pan and display scale. Placement shifts by at most half a device pixel; texture extent, document geometry and overlays stay unchanged. Stale renders and pixel preview retain their existing projection (`canvas_image_rect_tests`). This does not establish text-rendering parity with Figma. | | Rulers and guides (drag out, move, remove; rotated frames; frame guides) | done | guides belong to the page or a top-level frame (a frame moved into another keeps its guides but they stop applying); a click selects one for Delete, the arrows or the context menu's Remove guide; Alt-drag drops a copy; Alt while dragging measures to the layers in the frame it crosses; ruler numbering checked by eye only | | Frame labels (rotated, right-to-left), size badge | done | | | Outline mode | done | Outlines, outlines for the selection, mask outlines, frame outlines; shapes are clicked on their outlines, reaching layers behind; View ▸ Outlines ▸ Include hidden layers (`view.outlinesHiddenLayers`) outlines hidden layers too and Include object bounds (`view.outlinesObjectBounds`) draws the box of every layer whose outline isn't its box (groups, text, ellipses, vectors); what either draws can be clicked there (a hidden layer on its outline, a group on its box) and nothing else can; both are view settings like the other outline flags (per file, off in a new one, checked in the menu); the lines are light on a dark page (`outline_options_tests`). The main menu now shows a check mark beside every View toggle that is on | @@ -167,7 +166,6 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| -| 2026-10-15 | minor | Canvas image origins align to device pixels only at native render density. Texture extent, stale-render reprojection and pixel preview remain unchanged; deterministic geometry tests cover fractional zoom and display scale. | | 2026-10-15 | minor | Hex fields take CSS colour names (`red` → `FF0000`): fills, strokes, effects, grids, variables, backgrounds and the colour picker | | 2026-10-15 | minor | Typography: drag the line-height, letter-spacing and paragraph-spacing icons to scrub their values; shared numeric-field rates, resize cursor and one Undo step per gesture (#373). | | 2026-10-15 | minor | A click or Tab into a one-line field selects all of its text (hex, inline, name, search and dialog fields); the first click into a fill's hex takes the keyboard | From ac4b98dbd72cea838447bd34621a47f1d40f0801 Mon Sep 17 00:00:00 2001 From: BFlat Date: Sat, 17 Oct 2026 19:56:20 +0700 Subject: [PATCH 173/817] M8: confine MCP file access with --automation-read-root/--automation-write-root (#715) (#746) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - `figcraft-cli mcp --automation-read-root DIR --automation-write-root DIR` (each repeatable, `--flag=DIR` works too). When either is given, every file an agent's tool call reads must lie inside a read root or a write root, and every file it writes inside a write root. Anything else is an ordinary tool error (`automation path rejected: … is outside the folders that may be written: …`); nothing is written and the server keeps serving. Without the flags nothing changes. - The desktop app takes the same flags (`figcraft --control PORT --automation-read-root DIR …`) and confines every control request and every frame of every window to them, so `figcraft-cli mcp --attach` drives a confined app. `--attach` together with the flags is a usage error, because the app runs the commands and only the app can confine them. - New engine module `crates/engine/src/file_access.rs`: `Roots` (resolution and comparison), a thread-scoped `confined(roots, f)`, and the file primitives (`read`, `read_capped`, `open`, `metadata`, `read_dir`, `write` (atomic), `create_dir_all`, `exists`, `is_dir`). Every engine file access now goes through it. `crates/engine/clippy.toml` denies `std::fs::*`, `File::open/create`, `OpenOptions::open`, `Path::exists/is_file/is_dir/metadata/read_dir/canonicalize` and `figcraft_format::{write_file_atomic, save_file, load_file}` everywhere else in the engine, so a command added later is confined without a check of its own. - `ui.screenshot` and `ui.render` return the PNG as base64 `data` when no `path` is given (before, `ui.screenshot` wrote `figcraft-screenshot.png` in the working directory and `ui.render` required a path). The attached MCP backend uses that, so it no longer writes and deletes temporary PNGs, and a confined app needs no exemption for them. - `initialize`'s `instructions` name the folders the agent may read and write. - `figcraft-cli` options may be given more than once (`Args::values`); single-valued options keep the last value, as before. - Docs: `docs/mcp.md` › Confining file access (options, semantics, coverage, resolution, limits), `docs/control-protocol.md` › Confining file access and the optional `path` of `ui.screenshot` / `ui.render`, `docs/cli.md`, `figcraft-cli --help`, and the Automation line plus a revision row in `docs/target-app-parity.md`. Fixes #715, fixes #481. --- apps/figcraft-cli/src/args.rs | 26 +- apps/figcraft-cli/src/main.rs | 29 +- apps/figcraft-cli/tests/cli.rs | 46 +++ apps/figcraft/src/args.rs | 18 +- apps/figcraft/src/args_tests.rs | 12 +- apps/figcraft/src/main.rs | 17 + crates/engine/clippy.toml | 39 ++ crates/engine/src/cmd/create.rs | 6 +- crates/engine/src/cmd/file.rs | 48 +-- crates/engine/src/file_access.rs | 293 ++++++++++++++ crates/engine/src/file_access_tests.rs | 371 ++++++++++++++++++ crates/engine/src/lib.rs | 3 + crates/engine/src/library.rs | 4 +- crates/engine/src/playground.rs | 2 +- crates/engine/src/plugin_directory.rs | 15 +- crates/engine/src/plugins.rs | 29 +- .../engine/tests/library_style_acceptance.rs | 2 +- crates/mcp/src/backend.rs | 28 +- crates/mcp/src/headless.rs | 4 +- crates/mcp/src/server.rs | 31 +- crates/mcp/tests/automation_roots.rs | 126 ++++++ crates/ui-egui/src/colorpicker.rs | 2 +- crates/ui-egui/src/control.rs | 41 +- crates/ui-egui/src/control_roots_tests.rs | 74 ++++ crates/ui-egui/src/home.rs | 3 +- crates/ui-egui/src/home_recents.rs | 10 +- crates/ui-egui/src/lib.rs | 4 + crates/ui-egui/src/menus.rs | 4 +- crates/ui-egui/src/windows.rs | 4 +- docs/cli.md | 7 +- docs/control-protocol.md | 33 +- docs/mcp.md | 56 +++ docs/target-app-parity.md | 5 +- 33 files changed, 1280 insertions(+), 112 deletions(-) create mode 100644 crates/engine/clippy.toml create mode 100644 crates/engine/src/file_access.rs create mode 100644 crates/engine/src/file_access_tests.rs create mode 100644 crates/mcp/tests/automation_roots.rs create mode 100644 crates/ui-egui/src/control_roots_tests.rs diff --git a/apps/figcraft-cli/src/args.rs b/apps/figcraft-cli/src/args.rs index 372082c24..4c162dbb5 100644 --- a/apps/figcraft-cli/src/args.rs +++ b/apps/figcraft-cli/src/args.rs @@ -1,5 +1,6 @@ //! Minimal std-only argument parsing: positionals, `--key value` / `--key=value` / `-o value` -//! options, and boolean `--flag`s. Unknown options are usage errors. +//! options (given again: the last counts, or all with [`Args::values`]), and boolean `--flag`s. +//! Unknown options are usage errors. use std::collections::BTreeMap; @@ -8,7 +9,7 @@ use crate::{CliError, CliResult}; #[derive(Debug, Default)] pub struct Args { pub positional: Vec, - values: BTreeMap, + values: BTreeMap>, flags: Vec, } @@ -34,7 +35,7 @@ impl Args { Some(v) => v, None => it.next().cloned().ok_or_else(|| CliError::Usage(format!("`{arg}` needs a value")))?, }; - a.values.insert(name.to_string(), v); + a.values.entry(name.to_string()).or_default().push(v); } else if flags.contains(&name) && inline.is_none() { a.flags.push(name.to_string()); } else { @@ -45,7 +46,12 @@ impl Args { } pub fn value(&self, k: &str) -> Option { - self.values.get(k).cloned() + self.values.get(k).and_then(|v| v.last()).cloned() + } + + /// Every value of an option that may be given more than once, in order. + pub fn values(&self, k: &str) -> &[String] { + self.values.get(k).map_or(&[], Vec::as_slice) } pub fn flag(&self, k: &str) -> bool { @@ -62,9 +68,9 @@ impl Args { /// PDF print options: `--bleed LENGTH` (points, or "3mm", "0.125in"), `--crop-marks`, /// `--bleed-marks`, `--cmyk`. pub fn print(&self) -> CliResult { - let bleed = match self.values.get("bleed") { + let bleed = match self.value("bleed") { None => 0.0, - Some(s) => figcraft_doc::PrintSettings::parse_length(s) + Some(s) => figcraft_doc::PrintSettings::parse_length(&s) .filter(|b| *b <= figcraft_doc::PrintSettings::MAX_BLEED) .ok_or_else(|| CliError::Usage(format!("--bleed takes points or a length like 3mm or 0.125in (up to 2in), got `{s}`")))?, }; @@ -72,7 +78,7 @@ impl Args { } pub fn scale(&self) -> CliResult { - match self.values.get("scale") { + match self.value("scale") { None => Ok(1.0), Some(s) => s .trim_end_matches('x') @@ -85,7 +91,7 @@ impl Args { /// A comma-separated list of whole numbers (`--layers 1000,10_000`). pub fn usizes(&self, k: &str, default: &[usize]) -> CliResult> { - match self.values.get(k) { + match self.value(k) { None => Ok(default.to_vec()), Some(s) => s .split(',') @@ -110,6 +116,10 @@ mod tests { assert_eq!(a.value("o").as_deref(), Some("out")); assert_eq!(a.scale().unwrap(), 2.0); assert!(a.flag("json")); + let a = Args::parse(&v(&["--root", "a", "--root=b"]), &["root"], &[]).unwrap(); + assert_eq!(a.values("root"), ["a", "b"]); + assert_eq!(a.value("root").as_deref(), Some("b")); + assert!(a.values("none").is_empty()); } #[test] diff --git a/apps/figcraft-cli/src/main.rs b/apps/figcraft-cli/src/main.rs index 590b50f14..281d79ddc 100644 --- a/apps/figcraft-cli/src/main.rs +++ b/apps/figcraft-cli/src/main.rs @@ -23,7 +23,7 @@ USAGE: figcraft-cli render -o [--scale N] [--page NAME] figcraft-cli run [--in ] [--out ] figcraft-cli commands [--json] [--filter TEXT] - figcraft-cli mcp [--attach PORT] + figcraft-cli mcp [--attach PORT] [--automation-read-root DIR]... [--automation-write-root DIR]... figcraft-cli plugin publish --server ws://host:port/[?key=KEY] figcraft-cli perf [--layers N[,N...]] [--instances N[,N...]] figcraft-cli help | --help | --version @@ -42,6 +42,10 @@ crop and bleed marks, CMYK colour). `run` executes a JSON array (or JSON lines) `plugin publish` sends a plugin folder (figcraft-plugin.json, its module, an optional assets/ folder) to a figcraft-server's plugin directory as a new version; the server's key comes from the address or the FIGCRAFT_SERVER_KEY environment variable (which keeps it out of the shell history). +`mcp --automation-read-root DIR` / `--automation-write-root DIR` (each may be repeated; the folders +must exist) confine the files the agent's commands touch: reads only inside a read or write root, +writes only inside a write root, everything else refused. A running app confines itself: start it +with `figcraft --control PORT` and the same flags (`--attach` refuses them). See docs/cli.md and docs/mcp.md."; fn main() -> ExitCode { @@ -133,11 +137,23 @@ fn run(argv: &[String]) -> CliResult { Ok(ExitCode::SUCCESS) } "mcp" => { - let a = Args::parse(rest, &["attach"], &[])?; + let a = Args::parse(rest, &["attach", "automation-read-root", "automation-write-root"], &[])?; if !a.positional.is_empty() { return Err(CliError::Usage("mcp takes no positional arguments".into())); } - mcp(a.value("attach").as_deref()) + let (read, write) = (a.values("automation-read-root"), a.values("automation-write-root")); + let roots = match (read.is_empty() && write.is_empty(), a.value("attach")) { + (true, _) => None, + // The app runs the commands: only its own roots can confine them. + (false, Some(_)) => { + return Err(CliError::Usage( + "--attach can't take automation roots: start the app with them instead (`figcraft --control PORT --automation-read-root DIR ...`)" + .into(), + )); + } + (false, None) => Some(figcraft_engine::file_access::Roots::new(read, write).map_err(CliError::Failed)?), + }; + mcp(a.value("attach").as_deref(), roots) } "plugin" => { let a = Args::parse(rest, &["server"], &[])?; @@ -205,7 +221,7 @@ fn publish_plugin(folder: &str, server: &str) -> CliResult { Ok(ExitCode::SUCCESS) } -fn mcp(attach: Option<&str>) -> CliResult { +fn mcp(attach: Option<&str>, roots: Option) -> CliResult { let backend: Box = match attach { Some(p) => { let addr = if p.contains(':') { @@ -220,7 +236,10 @@ fn mcp(attach: Option<&str>) -> CliResult { None => Box::new(figcraft_mcp::Headless::new()), }; eprintln!("figcraft MCP server ({}) on stdio", backend.describe()); - let mut server = figcraft_mcp::Server::new(backend); + if let Some(r) = &roots { + eprintln!("file access confined to {}", r.to_json()); + } + let mut server = figcraft_mcp::Server::new(backend).with_roots(roots); let stdin = std::io::stdin(); let stdout = std::io::stdout(); server.serve(stdin.lock(), stdout.lock()).map_err(|e| format!("stdio: {e}"))?; diff --git a/apps/figcraft-cli/tests/cli.rs b/apps/figcraft-cli/tests/cli.rs index 9dd522031..7eaf051f5 100644 --- a/apps/figcraft-cli/tests/cli.rs +++ b/apps/figcraft-cli/tests/cli.rs @@ -25,6 +25,9 @@ fn bad_arguments_exit_2_without_panicking() { &["render", "a", "-o"], &["perf", "--shapes", "lots"], &["mcp", "--attach", "notaport"], + // An attached app confines itself: roots go to `figcraft --control`. + &["mcp", "--attach", "7979", "--automation-read-root", "."], + &["mcp", "--automation-write-root"], &["convert", "a"], ] { let out = bin().args(args).output().unwrap(); @@ -120,6 +123,49 @@ fn mcp_over_stdio() { assert_eq!(lines[2]["result"]["isError"], false); } +#[test] +fn mcp_over_stdio_confined_to_automation_roots() { + let d = tmp("roots"); + for sub in ["in", "out", "outside"] { + std::fs::create_dir_all(d.join(sub)).unwrap(); + } + let p = |rel: &str| d.join(rel).to_string_lossy().into_owned(); + // A root that isn't a folder stops the server before it serves. + let out = bin().args(["mcp", "--automation-read-root", &p("missing")]).output().unwrap(); + assert_eq!(out.status.code(), Some(1)); + assert!(String::from_utf8_lossy(&out.stderr).contains("--automation-read-root")); + let mut child = bin() + .args(["mcp", "--automation-read-root", &p("in"), "--automation-write-root", &p("out")]) + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .stderr(Stdio::null()) + .spawn() + .unwrap(); + { + let stdin = child.stdin.as_mut().unwrap(); + let call = |id: u32, tool: &str, args: serde_json::Value| { + serde_json::json!({"jsonrpc": "2.0", "id": id, "method": "tools/call", "params": {"name": tool, "arguments": args}}).to_string() + }; + writeln!(stdin, r#"{{"jsonrpc":"2.0","id":1,"method":"initialize","params":{{"protocolVersion":"2025-06-18"}}}}"#).unwrap(); + writeln!(stdin, "{}", call(2, "create_node", serde_json::json!({"type": "ellipse"}))).unwrap(); + writeln!(stdin, "{}", call(3, "save_file", serde_json::json!({"path": p("outside/a.figcraft")}))).unwrap(); + writeln!(stdin, "{}", call(4, "save_file", serde_json::json!({"path": p("out/a.figcraft")}))).unwrap(); + writeln!(stdin, "{}", call(5, "open_file", serde_json::json!({"path": p("outside/a.figcraft")}))).unwrap(); + writeln!(stdin, "{}", call(6, "open_file", serde_json::json!({"path": p("out/a.figcraft")}))).unwrap(); + } + drop(child.stdin.take()); + let out = child.wait_with_output().unwrap(); + assert!(out.status.success()); + let lines: Vec = String::from_utf8_lossy(&out.stdout).lines().map(|l| serde_json::from_str(l).unwrap()).collect(); + assert_eq!(lines.len(), 6); + assert!(lines[0]["result"]["instructions"].as_str().unwrap().contains("only these folders may be read")); + let error = |i: usize| lines[i]["result"]["isError"] == true; + assert!(!error(1) && error(2) && !error(3) && error(4) && !error(5), "{lines:?}"); + assert!(lines[2]["result"]["content"][0]["text"].as_str().unwrap().contains("automation path rejected")); + assert!(d.join("out/a.figcraft").is_file() && !d.join("outside/a.figcraft").exists()); + let _ = std::fs::remove_dir_all(&d); +} + #[test] fn commands_json_lists_everything() { let out = bin().args(["commands", "--json"]).output().unwrap(); diff --git a/apps/figcraft/src/args.rs b/apps/figcraft/src/args.rs index 2e3099cbf..3b4136d99 100644 --- a/apps/figcraft/src/args.rs +++ b/apps/figcraft/src/args.rs @@ -1,4 +1,5 @@ -//! The command line: `figcraft [--control ] [files…] [figcraft://join?…]`. An invite link +//! The command line: `figcraft [--control ] [--automation-read-root
]… +//! [--automation-write-root ]… [files…] [figcraft://join?…]`. An invite link //! (what the system passes when a `figcraft://` link is opened) joins that session once the window //! is up; everything else that isn't a flag is a file to open, as a path or a `file://` URL (the //! Linux desktop entry passes URLs, `%U`, so that it can also hand over invite links). @@ -11,6 +12,11 @@ pub struct Args { pub files: Vec, /// The last invite link given. pub join: Option, + /// `--automation-read-root ` / `--automation-write-root ` (each repeatable; `=` works + /// too): the folders the app's file access is confined to. A flag without a value gives `""`, + /// which is refused at startup. + pub read_roots: Vec, + pub write_roots: Vec, } /// An invite link rather than a file (`figcraft:` links, in any case). @@ -49,7 +55,15 @@ pub fn parse(args: &[String]) -> Args { let mut out = Args::default(); let mut it = args.iter(); while let Some(a) = it.next() { - if a == "--control" { + let (flag, inline) = a.split_once('=').map_or((a.as_str(), None), |(f, v)| (f, Some(v.to_string()))); + let roots = match flag { + "--automation-read-root" => Some(&mut out.read_roots), + "--automation-write-root" => Some(&mut out.write_roots), + _ => None, + }; + if let Some(roots) = roots { + roots.push(inline.or_else(|| it.next().cloned()).unwrap_or_default()); + } else if a == "--control" { out.control = it.next().and_then(|p| p.parse().ok()); } else if is_invite(a) { out.join = Some(a.clone()); diff --git a/apps/figcraft/src/args_tests.rs b/apps/figcraft/src/args_tests.rs index 0ed404c8f..2ae29b3c8 100644 --- a/apps/figcraft/src/args_tests.rs +++ b/apps/figcraft/src/args_tests.rs @@ -10,12 +10,22 @@ fn args(a: &[&str]) -> Vec { fn files_and_the_control_port() { assert_eq!(parse(&args(&[])), Args::default()); let a = parse(&args(&["--control", "4242", "a.figcraft", "--verbose", "b.svg"])); - assert_eq!(a, Args { control: Some(4242), files: args(&["a.figcraft", "b.svg"]), join: None }); + assert_eq!(a, Args { control: Some(4242), files: args(&["a.figcraft", "b.svg"]), ..Args::default() }); // A missing or bad port is ignored, not taken as a file. assert_eq!(parse(&args(&["--control"])), Args::default()); assert_eq!(parse(&args(&["--control", "nope"])).control, None); } +#[test] +fn automation_roots_repeat_and_are_never_files() { + let a = parse(&args(&["--automation-read-root", "in", "--automation-write-root=out", "--automation-read-root=more", "a.figcraft"])); + assert_eq!(a.read_roots, args(&["in", "more"])); + assert_eq!(a.write_roots, args(&["out"])); + assert_eq!(a.files, args(&["a.figcraft"])); + // A flag without its folder is kept as an empty one, which startup refuses. + assert_eq!(parse(&args(&["--automation-write-root"])).write_roots, args(&[""])); +} + #[test] fn invite_links_join_instead_of_opening() { let link = "figcraft://join?host=192.168.1.20:47900&file=abc&token=AbCdEfGhIjKlMnOpQrStUv"; diff --git a/apps/figcraft/src/main.rs b/apps/figcraft/src/main.rs index fdcc66f9e..651cc5212 100644 --- a/apps/figcraft/src/main.rs +++ b/apps/figcraft/src/main.rs @@ -6,6 +6,11 @@ //! `--control ` (or `FIGCRAFT_CONTROL_PORT`) starts a localhost JSON-lines control server: //! `{"id":1,"method":"engine.execute","params":{"command":"shape.rectangle","params":{"x":0,"y":0,"width":100,"height":100}}}` //! → `{"id":1,"ok":true,"result":{…}}`. Methods: `figcraft_ui_egui::control`. +//! +//! `--automation-read-root ` / `--automation-write-root ` (each repeatable) confine the +//! files the window and the control channel read and write (`figcraft_engine::file_access`); the +//! app's own folders (settings, recovery copies, installed plugins) and opening the files given on +//! the command line are not. A root that isn't an existing folder stops the app at startup. #![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)] #![cfg_attr(all(target_os = "windows", not(debug_assertions)), windows_subsystem = "windows")] @@ -119,6 +124,17 @@ fn main() -> eframe::Result { return Ok(()); } let args = args::parse(&args); + let roots = match ( + args.read_roots.is_empty() && args.write_roots.is_empty(), + figcraft_engine::file_access::Roots::new(&args.read_roots, &args.write_roots), + ) { + (true, _) => None, + (false, Ok(r)) => Some(Arc::new(r)), + (false, Err(e)) => { + eprintln!("FigCraft: {e}"); + std::process::exit(2); + } + }; let port = args.control.or_else(|| std::env::var("FIGCRAFT_CONTROL_PORT").ok().and_then(|p| p.parse().ok())); // System fonts: index them in the background, then wake the UI (an idle window draws no frames) // to lay text out again with them. @@ -174,6 +190,7 @@ fn main() -> eframe::Result { // open (no frame then). figcraft_ui_egui::i18n::set(&session.prefs.language, figcraft_ui_egui::Services::system_language(&svc).as_deref()); let mut fig = FigApp::new(session, Box::new(svc)); + fig.automation_roots = roots; fig.ui.home = false; fig.note_recovered(recovered.copies); if let Some(link) = &args.join { diff --git a/crates/engine/clippy.toml b/crates/engine/clippy.toml new file mode 100644 index 000000000..3ceac8998 --- /dev/null +++ b/crates/engine/clippy.toml @@ -0,0 +1,39 @@ +# The workspace settings (../../clippy.toml; clippy reads only the nearest file), plus the engine's +# own rule: shipped engine code reaches the file system only through `file_access`, which enforces +# the automation roots (#715), so every command is confined without a check of its own. +allow-unwrap-in-tests = true +allow-expect-in-tests = true +allow-panic-in-tests = true +too-many-arguments-threshold = 10 +disallowed-methods = [ + { path = "std::fs::read", reason = "use file_access::read (automation roots)" }, + { path = "std::fs::read_to_string", reason = "use file_access::read (automation roots)" }, + { path = "std::fs::write", reason = "use file_access::write (automation roots)" }, + { path = "std::fs::metadata", reason = "use file_access::metadata (automation roots)" }, + { path = "std::fs::symlink_metadata", reason = "use file_access (automation roots)" }, + { path = "std::fs::read_dir", reason = "use file_access::read_dir (automation roots)" }, + { path = "std::fs::canonicalize", reason = "use file_access (automation roots)" }, + { path = "std::fs::copy", reason = "use file_access (automation roots)" }, + { path = "std::fs::rename", reason = "use file_access (automation roots)" }, + { path = "std::fs::create_dir", reason = "use file_access::create_dir_all (automation roots)" }, + { path = "std::fs::create_dir_all", reason = "use file_access::create_dir_all (automation roots)" }, + { path = "std::fs::remove_file", reason = "use file_access (automation roots)" }, + { path = "std::fs::remove_dir", reason = "use file_access (automation roots)" }, + { path = "std::fs::remove_dir_all", reason = "use file_access (automation roots)" }, + { path = "std::fs::hard_link", reason = "use file_access (automation roots)" }, + { path = "std::fs::File::open", reason = "use file_access::open (automation roots)" }, + { path = "std::fs::File::create", reason = "use file_access::write (automation roots)" }, + { path = "std::fs::File::create_new", reason = "use file_access::write (automation roots)" }, + { path = "std::fs::OpenOptions::open", reason = "use file_access (automation roots)" }, + { path = "std::path::Path::exists", reason = "use file_access::exists (automation roots)" }, + { path = "std::path::Path::try_exists", reason = "use file_access::exists (automation roots)" }, + { path = "std::path::Path::is_file", reason = "use file_access::metadata (automation roots)" }, + { path = "std::path::Path::is_dir", reason = "use file_access::is_dir (automation roots)" }, + { path = "std::path::Path::metadata", reason = "use file_access::metadata (automation roots)" }, + { path = "std::path::Path::symlink_metadata", reason = "use file_access (automation roots)" }, + { path = "std::path::Path::read_dir", reason = "use file_access::read_dir (automation roots)" }, + { path = "std::path::Path::canonicalize", reason = "use file_access (automation roots)" }, + { path = "figcraft_format::write_file_atomic", reason = "use file_access::write (automation roots)" }, + { path = "figcraft_format::save_file", reason = "use file_access::write (automation roots)" }, + { path = "figcraft_format::load_file", reason = "use file_access::read (automation roots)" }, +] diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index 9b471290e..9b3f7067f 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -7,7 +7,7 @@ use serde_json::{Value, json}; use super::{CommandSpec, ok}; use crate::params::*; -use crate::{EngineError, Result, Session, bad, spec}; +use crate::{Result, Session, bad, spec}; /// Frame presets shown by the Frame tool (category, name, width, height). pub const FRAME_PRESETS: &[(&str, &str, f64, f64)] = &[ @@ -313,12 +313,12 @@ fn free_spot(s: &Session, w: f64, h: f64) -> Result<(f64, f64)> { #[cfg(not(target_arch = "wasm32"))] fn read_path(path: &str) -> Result> { - std::fs::read(path).map_err(|e| EngineError::Other(format!("{path}: {e}"))) + crate::file_access::read(path) } #[cfg(target_arch = "wasm32")] fn read_path(path: &str) -> Result> { - Err(EngineError::Other(format!("{path}: files can't be read in the browser"))) + Err(crate::EngineError::Other(format!("{path}: files can't be read in the browser"))) } /// Place an image as a rectangle with an image fill (Figma's image layer). diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index 6ba1ba6ce..511e0fc6b 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -435,7 +435,7 @@ pub(crate) fn recovered(path: &str) -> Result { #[cfg(not(target_arch = "wasm32"))] fn read(path: &str) -> Result> { - std::fs::read(path).map_err(|e| EngineError::Other(format!("{path}: {e}"))) + crate::file_access::read(path) } #[cfg(target_arch = "wasm32")] @@ -445,11 +445,7 @@ fn read(path: &str) -> Result> { /// The bytes of file `path`, refused when it's larger than `max`. pub(crate) fn read_capped(path: &str, max: u64) -> Result> { - let meta = std::fs::metadata(path).map_err(|e| EngineError::Other(format!("{path}: {e}")))?; - if !meta.is_file() || meta.len() > max { - return Err(EngineError::Other(format!("{path}: not a file of at most {max} bytes"))); - } - read(path) + crate::file_access::read_capped(path, max) } /// Write `bytes` to `path` through a uniquely named, exclusively created staging file and one @@ -457,7 +453,7 @@ pub(crate) fn read_capped(path: &str, max: u64) -> Result> { /// truncates `path`, and no file or symlink at a staging name is ever written through. #[cfg(not(target_arch = "wasm32"))] pub(crate) fn write(path: &str, bytes: &[u8]) -> Result<()> { - figcraft_format::write_file_atomic(std::path::Path::new(path), bytes).map_err(|e| EngineError::Other(format!("{path}: {e}"))) + crate::file_access::write(path, bytes) } #[cfg(target_arch = "wasm32")] @@ -577,11 +573,9 @@ fn rest_images(path: &str) -> impl Fn(&str) -> Option> { return None; } let dir = dir.as_ref()?; - ["", ".png", ".jpg", ".jpeg", ".gif", ".webp"].iter().find_map(|e| { - let p = dir.join(format!("{r}{e}")); - let meta = std::fs::metadata(&p).ok()?; - if meta.is_file() && meta.len() <= MAX_IMAGE_FILE { std::fs::read(&p).ok() } else { None } - }) + ["", ".png", ".jpg", ".jpeg", ".gif", ".webp"] + .iter() + .find_map(|e| crate::file_access::read_capped(dir.join(format!("{r}{e}")), MAX_IMAGE_FILE).ok()) } } @@ -604,11 +598,7 @@ fn sibling_variables(path: &str) -> Option { let file = std::path::Path::new(path); let dir = file.parent()?; [format!("{}.variables.json", file_stem(path)), "variables.json".to_string()].iter().map(|n| dir.join(n)).filter(|c| c != file).find_map(|c| { - let meta = std::fs::metadata(&c).ok()?; - if !meta.is_file() || meta.len() > MAX_VARIABLES_FILE { - return None; - } - let v: Value = serde_json::from_slice(&std::fs::read(&c).ok()?).ok()?; + let v: Value = serde_json::from_slice(&crate::file_access::read_capped(c, MAX_VARIABLES_FILE).ok()?).ok()?; figcraft_format::rest::is_variables_json(&v).then_some(v) }) } @@ -646,20 +636,29 @@ fn remember(s: &mut Session, path: &str) { } fn open_recent(s: &mut Session, p: &Value) -> Result { + use crate::file_access::{Access, allow, allowed}; const CMD: &str = "file.openRecent"; + // Confined to automation roots, the recent files outside them are never listed, opened, removed + // or named: `index` counts the files listed. + let listed = |r: &String| allowed(r, Access::Read); if p.get("clear").and_then(Value::as_bool) == Some(true) { - s.prefs.recent_files.clear(); + s.prefs.recent_files.retain(|r| !listed(r)); } if let Some(gone) = string(p, "remove") { - s.prefs.recent_files.retain(|r| *r != gone); + s.prefs.recent_files.retain(|r| *r != gone || !listed(r)); } let path = match (string(p, "path"), num(p, "index")) { - (Some(path), _) => Some(path), - (None, Some(i)) => Some(s.prefs.recent_files.get(i.max(0.0) as usize).cloned().ok_or_else(|| bad(CMD, "no such recent file"))?), + (Some(path), _) => { + allow(&path, Access::Read)?; + 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"))?) + } _ => None, }; if let Some(path) = path { - if !std::path::Path::new(&path).exists() { + if !crate::file_access::exists(&path) { s.prefs.recent_files.retain(|r| *r != path); return Err(bad(CMD, format!("{path} no longer exists"))); } @@ -669,9 +668,10 @@ fn open_recent(s: &mut Session, p: &Value) -> Result { .prefs .recent_files .iter() + .filter(|r| listed(r)) .map(|r| { let name = std::path::Path::new(r).file_name().map_or_else(|| r.clone(), |f| f.to_string_lossy().into_owned()); - json!({"path": r, "name": name, "exists": std::path::Path::new(r).exists()}) + json!({"path": r, "name": name, "exists": crate::file_access::exists(r)}) }) .collect(); Ok(json!({"files": files})) @@ -1183,7 +1183,7 @@ fn export_layers(s: &mut Session, p: &Value) -> Result { let path = std::path::Path::new(d).join(&job.file); // A layer name with slashes exports into folders. if let Some(parent) = path.parent() { - let _ = std::fs::create_dir_all(parent); + let _ = crate::file_access::create_dir_all(parent); } let path = path.to_string_lossy().to_string(); write(&path, &bytes)?; diff --git a/crates/engine/src/file_access.rs b/crates/engine/src/file_access.rs new file mode 100644 index 000000000..8abeaee5d --- /dev/null +++ b/crates/engine/src/file_access.rs @@ -0,0 +1,293 @@ +//! Automation roots (#715): the folders the files an agent's commands read and write must lie in. +//! +//! `figcraft-cli mcp --automation-read-root DIR --automation-write-root DIR` and the desktop app +//! started with the same flags run their work [`confined`] to [`Roots`]: while a scope is active on +//! the thread, every file the engine reads must lie inside a read or a write root and every file it +//! writes inside a write root; anything else is an ordinary error. The engine reaches the file +//! system only through this module (`crates/engine/clippy.toml` denies `std::fs` and friends +//! anywhere else), so every command, present or future, is covered. Without a scope nothing changes. +//! +//! A path is made absolute against the working directory and resolved before it is compared: its +//! links are followed (`std::fs::canonicalize`), and for a file that doesn't exist yet its nearest +//! 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. +#![allow(clippy::disallowed_methods)] + +use std::cell::RefCell; +use std::ffi::{OsStr, OsString}; +use std::path::{Component, Path, PathBuf}; +use std::sync::Arc; + +use crate::{EngineError, Result}; + +/// What a command does with a file. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Access { + Read, + Write, +} + +/// The folders automation may read (read and write roots) and write (write roots), resolved. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct Roots { + read: Vec, + write: Vec, +} + +impl Roots { + /// Roots from the folders given (relative ones against the working directory). Each must be an + /// existing folder. + pub fn new(read: &[String], write: &[String]) -> std::result::Result { + let resolve = |flag: &str, dirs: &[String]| { + dirs.iter() + .map(|d| match std::fs::canonicalize(d) { + Ok(p) if p.is_dir() => Ok(p), + Ok(_) => Err(format!("{flag} {d}: not a folder")), + Err(e) => Err(format!("{flag} {d}: {e}")), + }) + .collect::, String>>() + }; + Ok(Self { read: resolve("--automation-read-root", read)?, write: resolve("--automation-write-root", write)? }) + } + + /// The resolved path to use for `access` to `path`, or why it is refused. + pub fn check(&self, path: &Path, access: Access) -> std::result::Result { + let asked = path.display(); + let (roots, what) = match access { + Access::Read => ([self.read.as_slice(), self.write.as_slice()].concat(), "read"), + Access::Write => (self.write.clone(), "written"), + }; + match resolve(path) { + Ok(resolved) if roots.iter().any(|r| resolved.starts_with(r)) => return Ok(resolved), + Ok(_) => {} + // Why a path can't be resolved says what exists there: only told for paths inside a root. + Err(why) if lexically_inside(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(", "))) + } + + /// The folders as JSON, resolved: `{read: [every folder that may be read], write: [the write roots]}`. + pub fn to_json(&self) -> serde_json::Value { + let list = |v: &[PathBuf]| v.iter().map(|p| shown(p)).collect::>(); + serde_json::json!({"read": list(&[self.read.as_slice(), self.write.as_slice()].concat()), "write": list(&self.write)}) + } +} + +/// Whether `path`, made absolute with its `.` and `..` taken by name (no file system), lies in one +/// of `roots` (as resolved, or as shown without Windows' `\\?\` prefix). +fn lexically_inside(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), + } + } + roots.iter().any(|r| lexical.starts_with(r) || lexical.starts_with(shown(r))) +} + +/// Whether `path` lies in the app's own folder `folder`, both resolved (links and `..` followed); +/// false when either can't be resolved. +#[cfg_attr(target_arch = "wasm32", allow(dead_code))] +pub(crate) fn within_app_folder(path: &Path, folder: &Path) -> bool { + matches!((std::fs::canonicalize(path), std::fs::canonicalize(folder)), (Ok(p), Ok(f)) if p.starts_with(&f)) +} + +/// `p` without Windows' `\\?\` prefix, for messages. +fn shown(p: &Path) -> String { + let s = p.to_string_lossy(); + match s.strip_prefix(r"\\?\UNC\") { + Some(unc) => format!(r"\\{unc}"), + None => s.strip_prefix(r"\\?\").unwrap_or(&s).to_string(), + } +} + +/// `path` made absolute and resolved: links followed, and for a path that doesn't exist yet its +/// nearest existing folder resolved with the rest appended (plain names only). +fn resolve(path: &Path) -> std::result::Result { + if path.as_os_str().is_empty() { + return Err("not a file path".into()); + } + let abs = std::path::absolute(path).map_err(|e| e.to_string())?; + let mut rest: Vec = Vec::new(); + let mut at = abs.as_path(); + loop { + match std::fs::canonicalize(at) { + Ok(mut base) => { + base.extend(rest.iter().rev()); + return Ok(base); + } + Err(e) if e.kind() == std::io::ErrorKind::NotFound => { + // Writing through a link that leads nowhere would create its target, wherever it is. + if std::fs::symlink_metadata(at).is_ok() { + return Err("a link that leads nowhere".into()); + } + match at.components().next_back() { + Some(Component::Normal(name)) => { + plain_name(name)?; + rest.push(name.to_os_string()); + } + Some(Component::CurDir) => {} + _ => return Err("`..` (or a drive) below a folder that doesn't exist".into()), + } + at = at.parent().ok_or("no existing folder")?; + } + Err(e) => return Err(e.to_string()), + } + } +} + +/// A name for a file or folder that doesn't exist yet: on Windows no device (`CON`, `NUL`, `COM1`…) +/// and no alternate data stream (`a:b`). +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(':') { + return Err(format!("`{n}` is a device or stream name, not a file")); + } + } + Ok(()) +} + +thread_local! { + static ROOTS: RefCell>> = const { RefCell::new(None) }; +} + +/// Run `f` with this thread's file access confined to `roots` (unchanged when `None`). +pub fn confined(roots: Option<&Arc>, f: impl FnOnce() -> R) -> R { + match roots { + Some(roots) => scoped(Some(roots.clone()), f), + None => f(), + } +} + +/// Run `f` unconfined: only for the app's own files, never for a path a command was given. +// Only plugins read from disk use it, and the browser has no disk. +#[cfg_attr(target_arch = "wasm32", allow(dead_code))] +pub(crate) fn app_owned(f: impl FnOnce() -> R) -> R { + scoped(None, f) +} + +fn scoped(roots: Option>, f: impl FnOnce() -> R) -> R { + /// Puts the outer scope's roots back, also when `f` panics. + struct Restore(Option>); + impl Drop for Restore { + fn drop(&mut self) { + let outer = self.0.take(); + ROOTS.with(|r| *r.borrow_mut() = outer); + } + } + let _restore = Restore(ROOTS.with(|r| std::mem::replace(&mut *r.borrow_mut(), roots))); + f() +} + +/// The roots this thread's file access is confined to now, if any. +pub fn current() -> Option> { + ROOTS.with(|r| r.borrow().clone()) +} + +/// The path to use for `access` to `path`: resolved when confined, else as given. +pub fn allow(path: impl AsRef, access: Access) -> Result { + let path = path.as_ref(); + match current() { + Some(roots) => roots.check(path, access).map_err(EngineError::Other), + None => Ok(path.to_path_buf()), + } +} + +/// Whether `path` may be accessed so now. +pub fn allowed(path: impl AsRef, access: Access) -> bool { + allow(path, access).is_ok() +} + +fn io(path: &Path) -> impl Fn(std::io::Error) -> EngineError + '_ { + move |e| EngineError::Other(format!("{}: {e}", path.display())) +} + +/// The bytes of file `path`. +pub fn read(path: impl AsRef) -> Result> { + let path = path.as_ref(); + std::fs::read(allow(path, Access::Read)?).map_err(io(path)) +} + +/// The bytes of file `path`, refused when it isn't a file or is larger than `max`. +pub fn read_capped(path: impl AsRef, max: u64) -> Result> { + let path = path.as_ref(); + let p = allow(path, Access::Read)?; + let meta = std::fs::metadata(&p).map_err(io(path))?; + if !meta.is_file() || meta.len() > max { + return Err(EngineError::Other(format!("{}: not a file of at most {max} bytes", path.display()))); + } + std::fs::read(p).map_err(io(path)) +} + +/// File `path` opened for reading. +pub fn open(path: impl AsRef) -> Result { + let path = path.as_ref(); + std::fs::File::open(allow(path, Access::Read)?).map_err(io(path)) +} + +/// What the file system says about `path` (links followed). +pub fn metadata(path: impl AsRef) -> Result { + let path = path.as_ref(); + std::fs::metadata(allow(path, Access::Read)?).map_err(io(path)) +} + +/// Whether `path` is a folder (false when it may not be read). +pub fn is_dir(path: impl AsRef) -> bool { + metadata(path).is_ok_and(|m| m.is_dir()) +} + +/// Whether `path` exists (false when it may not be read). +pub fn exists(path: impl AsRef) -> bool { + metadata(path).is_ok() +} + +/// The paths of the entries of folder `path`. +pub fn read_dir(path: impl AsRef) -> Result> { + let path = path.as_ref(); + let dir = allow(path, Access::Read)?; + Ok(std::fs::read_dir(&dir).map_err(io(path))?.flatten().map(|e| e.path()).collect()) +} + +/// Write `bytes` to `path` through a uniquely named staging file and one atomic rename (see +/// [`figcraft_format::write_file_atomic`]). +pub fn write(path: impl AsRef, bytes: &[u8]) -> Result<()> { + let path = path.as_ref(); + write_atomic(&allow(path, Access::Write)?, bytes).map_err(io(path)) +} + +#[cfg(not(target_arch = "wasm32"))] +fn write_atomic(path: &Path, bytes: &[u8]) -> std::io::Result<()> { + figcraft_format::write_file_atomic(path, bytes) +} + +#[cfg(target_arch = "wasm32")] +fn write_atomic(_: &Path, _: &[u8]) -> std::io::Result<()> { + Err(std::io::Error::new(std::io::ErrorKind::Unsupported, "no file system in the browser")) +} + +/// Create folder `path` and the folders above it that are missing. +pub fn create_dir_all(path: impl AsRef) -> Result<()> { + let path = path.as_ref(); + std::fs::create_dir_all(allow(path, Access::Write)?).map_err(io(path)) +} + +#[cfg(test)] +#[path = "file_access_tests.rs"] +mod tests; diff --git a/crates/engine/src/file_access_tests.rs b/crates/engine/src/file_access_tests.rs new file mode 100644 index 000000000..a05ad88ce --- /dev/null +++ b/crates/engine/src/file_access_tests.rs @@ -0,0 +1,371 @@ +//! Automation roots: how paths are resolved and compared, and that commands run confined can't +//! reach past them. + +use std::path::{Path, PathBuf}; +use std::sync::Arc; + +use serde_json::json; + +use super::{Access, Roots, allow, confined, current}; +use crate::Session; + +/// A fresh folder for one test: `/figcraft-roots--`, holding `root/`, `root2/` +/// (a sibling whose name starts like the root's) and `outside/`. +struct Fixture(PathBuf); + +impl Fixture { + fn new(name: &str) -> Self { + let d = std::env::temp_dir().join(format!("figcraft-roots-{name}-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&d); + for sub in ["root/sub", "root2", "outside"] { + std::fs::create_dir_all(d.join(sub)).unwrap(); + } + std::fs::write(d.join("root/in.txt"), b"in").unwrap(); + std::fs::write(d.join("outside/secret.txt"), b"secret").unwrap(); + Self(d) + } + + fn p(&self, rel: &str) -> String { + self.0.join(rel).to_string_lossy().into_owned() + } + + /// The root as both read and write root. + fn rw(&self) -> Roots { + Roots::new(&[], &[self.p("root")]).unwrap() + } +} + +impl Drop for Fixture { + fn drop(&mut self) { + let _ = std::fs::remove_dir_all(&self.0); + } +} + +#[cfg(unix)] +fn symlink_dir(target: &Path, link: &Path) -> bool { + std::os::unix::fs::symlink(target, link).is_ok() +} + +#[cfg(windows)] +fn symlink_dir(target: &Path, link: &Path) -> bool { + std::os::windows::fs::symlink_dir(target, link).is_ok() +} + +#[cfg(unix)] +fn symlink_file(target: &Path, link: &Path) -> bool { + std::os::unix::fs::symlink(target, link).is_ok() +} + +#[cfg(windows)] +fn symlink_file(target: &Path, link: &Path) -> bool { + std::os::windows::fs::symlink_file(target, link).is_ok() +} + +#[test] +fn inside_is_allowed_and_resolved_outside_is_refused() { + let f = Fixture::new("inside"); + let r = f.rw(); + let got = r.check(Path::new(&f.p("root/in.txt")), Access::Read).unwrap(); + assert_eq!(got, std::fs::canonicalize(f.p("root/in.txt")).unwrap(), "the I/O uses the resolved path"); + assert!(r.check(Path::new(&f.p("root/new.png")), Access::Write).is_ok()); + let e = r.check(Path::new(&f.p("outside/secret.txt")), Access::Read).unwrap_err(); + assert!(e.starts_with("automation path rejected:") && e.contains("outside the folders that may be read"), "{e}"); + assert!(r.check(Path::new(&f.p("outside/new.png")), Access::Write).is_err()); + // The root itself is inside. + assert!(r.check(Path::new(&f.p("root")), Access::Read).is_ok()); +} + +#[test] +fn a_sibling_whose_name_starts_like_the_root_is_outside() { + let f = Fixture::new("prefix"); + let r = f.rw(); + for p in ["root2/x.png", "root2", "root.png"] { + assert!(r.check(Path::new(&f.p(p)), Access::Write).is_err(), "{p}"); + assert!(r.check(Path::new(&f.p(p)), Access::Read).is_err(), "{p}"); + } +} + +#[test] +fn traversal_is_resolved_before_comparing() { + let f = Fixture::new("dots"); + let r = f.rw(); + assert!(r.check(Path::new(&f.p("root/sub/../../outside/secret.txt")), Access::Read).is_err()); + assert!(r.check(Path::new(&f.p("root/sub/../../outside/new.txt")), Access::Write).is_err()); + assert!(r.check(Path::new(&f.p("root/sub/../in.txt")), Access::Read).is_ok()); + assert!(r.check(Path::new(&f.p("root/./sub/../new.txt")), Access::Write).is_ok()); + // `..` below a folder that doesn't exist can't be resolved (on Windows it is taken lexically, + // as the system does, and stays inside). + let deep = f.p("root/missing/../../outside/x.txt"); + assert!(r.check(Path::new(&deep), Access::Write).is_err(), "{deep}"); +} + +#[test] +fn files_that_dont_exist_yet_resolve_through_their_nearest_folder() { + let f = Fixture::new("missing"); + let r = f.rw(); + let got = r.check(Path::new(&f.p("root/a/b/c.png")), Access::Write).unwrap(); + assert_eq!(got, std::fs::canonicalize(f.p("root")).unwrap().join("a").join("b").join("c.png")); + assert!(r.check(Path::new(&f.p("outside/a/b/c.png")), Access::Write).is_err()); +} + +#[test] +fn relative_paths_are_resolved_against_the_working_directory() { + // `cargo test` runs in the crate's folder, which holds Cargo.toml. + let cwd = std::env::current_dir().unwrap().to_string_lossy().into_owned(); + let here = Roots::new(std::slice::from_ref(&cwd), &[]).unwrap(); + assert_eq!(here.check(Path::new("Cargo.toml"), Access::Read).unwrap(), std::fs::canonicalize("Cargo.toml").unwrap()); + assert!(here.check(Path::new("src/../Cargo.toml"), Access::Read).is_ok()); + let f = Fixture::new("relative"); + assert!(f.rw().check(Path::new("Cargo.toml"), Access::Read).is_err()); + // Relative roots too. + assert_eq!(Roots::new(&[".".into()], &[]).unwrap(), here); +} + +#[test] +fn read_and_write_authority_are_separate() { + let f = Fixture::new("modes"); + let read_only = Roots::new(&[f.p("root")], &[]).unwrap(); + assert!(read_only.check(Path::new(&f.p("root/in.txt")), Access::Read).is_ok()); + let e = read_only.check(Path::new(&f.p("root/out.png")), Access::Write).unwrap_err(); + assert!(e.contains("no folder may be written"), "{e}"); + // A write root may be read too; a read root elsewhere doesn't make it writable. + let both = Roots::new(&[f.p("outside")], &[f.p("root")]).unwrap(); + assert!(both.check(Path::new(&f.p("root/in.txt")), Access::Read).is_ok()); + assert!(both.check(Path::new(&f.p("outside/secret.txt")), Access::Read).is_ok()); + assert!(both.check(Path::new(&f.p("outside/new.txt")), Access::Write).is_err()); + // Several roots of each kind. + let many = Roots::new(&[f.p("root"), f.p("root2")], &[f.p("root2"), f.p("outside")]).unwrap(); + assert!(many.check(Path::new(&f.p("outside/new.txt")), Access::Write).is_ok()); + assert!(many.check(Path::new(&f.p("root/new.txt")), Access::Write).is_err()); +} + +#[test] +fn roots_must_be_existing_folders() { + let f = Fixture::new("bad-roots"); + assert!(Roots::new(&[f.p("nope")], &[]).unwrap_err().contains("--automation-read-root")); + assert!(Roots::new(&[], &[f.p("root/in.txt")]).unwrap_err().contains("not a folder")); + assert!(Roots::new(&[], &[String::new()]).is_err()); + assert!(f.rw().check(Path::new(""), Access::Read).is_err()); +} + +#[test] +fn links_that_lead_out_of_a_root_are_outside() { + let f = Fixture::new("links"); + let r = f.rw(); + if !symlink_dir(&f.0.join("outside"), &f.0.join("root/escape")) || !symlink_file(&f.0.join("outside/secret.txt"), &f.0.join("root/secret.txt")) { + eprintln!("skipped: this system doesn't let tests make symbolic links"); + return; + } + assert!(r.check(Path::new(&f.p("root/escape/secret.txt")), Access::Read).is_err()); + assert!(r.check(Path::new(&f.p("root/escape/new.txt")), Access::Write).is_err()); + assert!(r.check(Path::new(&f.p("root/secret.txt")), Access::Read).is_err()); + assert!(r.check(Path::new(&f.p("root/secret.txt")), Access::Write).is_err()); + // A link that leads nowhere: writing through it would create its target. + assert!(symlink_file(&f.0.join("outside/not-yet.txt"), &f.0.join("root/dangling.txt"))); + let e = r.check(Path::new(&f.p("root/dangling.txt")), Access::Write).unwrap_err(); + assert!(e.contains("leads nowhere"), "{e}"); + // A link inside the root to the root is fine. + 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()); +} + +#[cfg(windows)] +#[test] +fn windows_case_devices_and_streams() { + let f = Fixture::new("windows"); + let r = f.rw(); + // Case is taken from the disk: another spelling of the root is the root. + let upper = f.0.join("ROOT").join("IN.TXT"); + assert!(r.check(&upper, Access::Read).is_ok()); + for name in ["CON", "nul.txt", "Com1.png", "LPT9", "a.txt:stream", "conout$"] { + assert!(r.check(&f.0.join("root").join(name), Access::Write).is_err(), "{name}"); + } + assert!(r.check(&f.0.join("root").join("console.png"), Access::Write).is_ok()); + // The `\\?\` form of a path inside is inside; of a path outside, outside. + let verbatim = std::fs::canonicalize(f.p("root")).unwrap().join("v.png"); + assert!(verbatim.to_string_lossy().starts_with(r"\\?\")); + assert!(r.check(&verbatim, Access::Write).is_ok()); + assert!(r.check(&std::fs::canonicalize(f.p("outside")).unwrap().join("v.png"), Access::Write).is_err()); + // Messages don't show the prefix. + let e = r.check(Path::new(&f.p("outside/x.png")), Access::Write).unwrap_err(); + assert!(!e.contains(r"\\?\"), "{e}"); +} + +#[test] +fn a_scope_confines_the_thread_and_ends_with_it() { + let f = Fixture::new("scope"); + let roots = Arc::new(f.rw()); + assert!(current().is_none()); + confined(Some(&roots), || { + assert!(allow(f.p("outside/secret.txt"), Access::Read).is_err()); + assert!(super::read(f.p("outside/secret.txt")).is_err()); + assert_eq!(super::read(f.p("root/in.txt")).unwrap(), b"in"); + // Not confined: the app's own files. + assert_eq!(super::app_owned(|| super::read(f.p("outside/secret.txt")).unwrap()), b"secret"); + assert!(current().is_some(), "back in the scope after app_owned"); + // Another thread isn't confined by this one's scope. + let p = f.p("outside/secret.txt"); + assert!(std::thread::spawn(move || current().is_none() && allow(p, Access::Read).is_ok()).join().unwrap()); + }); + assert!(current().is_none()); + assert!(allow(f.p("outside/secret.txt"), Access::Read).is_ok()); + // A panic inside the scope still ends it. + let r = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| confined(Some(&roots), || panic!("boom")))); + assert!(r.is_err()); + assert!(current().is_none()); + // `None` changes nothing. + assert!(confined(None, || current().is_none())); +} + +#[test] +fn commands_run_confined_read_and_write_only_inside() { + let f = Fixture::new("commands"); + std::fs::create_dir_all(f.0.join("outside/readable")).unwrap(); + let roots = Arc::new(Roots::new(&[f.p("outside/readable")], &[f.p("root")]).unwrap()); + // Unconfined, the outside is writable: the bait files a confined command must not reach. + let bait = f.p("outside/bait.figcraft"); + let mut s = Session::new(); + s.execute("frame.create", &json!({"x": 0, "y": 0, "width": 20, "height": 10})).unwrap(); + s.execute("file.saveAs", &json!({"path": bait})).unwrap(); + std::fs::copy(&bait, f.0.join("outside/readable/ok.figcraft")).unwrap(); + let mut s = Session::new(); + s.execute("frame.create", &json!({"x": 0, "y": 0, "width": 20, "height": 10})).unwrap(); + s.prefs.recent_files = vec![bait.clone(), f.p("root/in.txt")]; + confined(Some(&roots), || { + let e = s.execute("file.export", &json!({"format": "png", "path": f.p("outside/x.png")})).unwrap_err().to_string(); + assert!(e.contains("automation path rejected"), "{e}"); + assert!(s.execute("file.export", &json!({"format": "png", "path": f.p("root/x.png")})).is_ok()); + assert!(s.execute("file.exportLayers", &json!({"dir": f.p("outside/layers")})).is_err()); + assert!(s.execute("file.open", &json!({"path": bait})).is_err()); + assert!(s.execute("file.import", &json!({"path": bait})).is_err()); + assert!(s.execute("file.placeImage", &json!({"path": f.p("outside/secret.txt")})).is_err()); + assert!(s.execute("file.open", &json!({"path": f.p("outside/readable/ok.figcraft")})).is_ok(), "read roots may be read"); + assert!(s.execute("file.save", &json!({})).is_err(), "but not written"); + assert!(s.execute("file.saveAs", &json!({"path": f.p("root/ok.figcraft")})).is_ok()); + // Recent files outside the roots aren't listed. + let recent = s.execute("file.openRecent", &json!({})).unwrap().to_string(); + assert!(!recent.contains("bait") && recent.contains("in.txt"), "{recent}"); + assert!(s.execute("file.openRecent", &json!({"path": bait})).is_err()); + }); + assert!(f.0.join("root/x.png").is_file() && !f.0.join("outside/x.png").exists() && !f.0.join("outside/layers").exists()); +} + +/// Every command, given paths outside the roots in its usual path parameters, writes nothing +/// there and opens nothing from there: they all reach files through `file_access`. +#[test] +fn no_command_reaches_outside_the_roots() { + let f = Fixture::new("sweep"); + let roots = Arc::new(f.rw()); + let outside = f.0.join("outside"); + // Bait the sweep could pick up: a document, an SVG, a PNG and variables JSON, each holding a + // name that must never show up in a document or a result. + let mut s = Session::new(); + s.execute("frame.create", &json!({"x": 0, "y": 0, "width": 20, "height": 10, "name": "BAIT-LAYER"})).unwrap(); + s.execute("file.saveAs", &json!({"path": f.p("outside/bait.figcraft")})).unwrap(); + s.execute("file.export", &json!({"format": "png", "path": f.p("outside/bait.png")})).unwrap(); + std::fs::write( + outside.join("bait.svg"), + r#""#, + ) + .unwrap(); + let before: Vec<_> = std::fs::read_dir(&outside).unwrap().flatten().map(|e| e.file_name()).collect(); + // The bait is what an unconfined command finds. + for (cmd, bait) in [("file.open", "bait.figcraft"), ("file.import", "bait.svg")] { + let mut s = Session::new(); + s.execute(cmd, &json!({"path": f.p(&format!("outside/{bait}"))})).unwrap(); + assert!(crate::inspect::document(&s, 64, true).to_string().contains("BAIT-LAYER"), "{cmd} {bait}"); + } + let mut s = Session::new(); + s.execute("file.placeImage", &json!({"path": f.p("outside/bait.png")})).unwrap(); + assert!(!s.doc().unwrap().images.is_empty()); + for bait in ["bait.figcraft", "bait.svg", "bait.png", "new.figcraft", "new.png"] { + let path = f.p(&format!("outside/{bait}")); + let params = json!({"path": path, "dir": f.p("outside"), "file": path, "variables": path, "folder": f.p("outside"), "confirm": true}); + for c in crate::all_commands() { + let mut s = Session::new(); + let r = confined(Some(&roots), || s.execute(c.id, ¶ms)); + let shown = format!("{r:?}"); + assert!(!shown.contains("BAIT-LAYER"), "{} read {bait}: {shown}", c.id); + let docs = crate::inspect::document(&s, 64, true).to_string(); + assert!(!docs.contains("BAIT-LAYER"), "{} opened {bait}", c.id); + assert!(s.docs.iter().all(|ds| ds.doc.images.is_empty()), "{} placed {bait}", c.id); + let now: Vec<_> = std::fs::read_dir(&outside).unwrap().flatten().map(|e| e.file_name()).collect(); + assert_eq!(now, before, "{} wrote outside the roots with {bait}", c.id); + } + } +} + +#[test] +fn recent_files_outside_the_roots_are_never_opened_removed_or_named() { + let f = Fixture::new("recents"); + let roots = Arc::new(f.rw()); + let (bait, gone, ok) = (f.p("outside/bait.figcraft"), f.p("outside/gone.figcraft"), f.p("root/ok.figcraft")); + let mut s = Session::new(); + s.execute("frame.create", &json!({"x": 0, "y": 0, "width": 20, "height": 10})).unwrap(); + s.execute("file.saveAs", &json!({"path": bait})).unwrap(); + s.execute("file.saveAs", &json!({"path": ok})).unwrap(); + let mut s = Session::new(); + let recents = vec![bait.clone(), gone.clone(), ok.clone()]; + s.prefs.recent_files = recents.clone(); + let quiet = |r: &crate::Result| { + let shown = format!("{r:?}"); + assert!(!shown.contains("bait") && !shown.contains("gone"), "an outside recent file was named: {shown}"); + }; + confined(Some(&roots), || { + let listing = s.execute("file.openRecent", &json!({})); + quiet(&listing); + assert_eq!(listing.unwrap()["files"].as_array().unwrap().len(), 1); + // `index` counts the files listed: 0 is the first one inside the roots. + let opened = s.execute("file.openRecent", &json!({"index": 0})); + quiet(&opened); + assert!(opened.is_ok(), "{opened:?}"); + assert_eq!(s.ds().unwrap().path.as_deref(), Some(ok.as_str())); + for i in [1, 2] { + let r = s.execute("file.openRecent", &json!({"index": i})); + quiet(&r); + assert!(r.is_err()); + } + // A path outside is refused like any outside path, and never dropped from the list. + let e = s.execute("file.openRecent", &json!({"path": gone})).unwrap_err().to_string(); + assert!(e.contains("is outside the folders that may be read") && !e.contains("no longer exists"), "{e}"); + quiet(&s.execute("file.openRecent", &json!({"remove": bait}))); + assert!(s.prefs.recent_files.contains(&bait) && s.prefs.recent_files.contains(&gone)); + // Clear clears what is listed. + quiet(&s.execute("file.openRecent", &json!({"clear": true}))); + }); + assert_eq!(s.prefs.recent_files, vec![bait, gone]); + // Unconfined, a recent file that is gone is still dropped. + s.execute("file.openRecent", &json!({"index": 1})).unwrap_err(); + assert_eq!(s.prefs.recent_files.len(), 1); +} + +#[test] +fn outside_paths_are_refused_alike_whatever_exists_there() { + let f = Fixture::new("oracle"); + let r = f.rw(); + let refusal = |p: &str| r.check(Path::new(p), Access::Write).unwrap_err(); + let standard = |p: &str| format!("automation path rejected: {} is outside the folders that may be written:", Path::new(p).display()); + let mut outside = vec![f.p("outside/secret.txt"), f.p("outside/none.txt"), f.p("outside/missing/../x.txt"), f.p("nowhere/deeper/x.txt")]; + if symlink_file(&f.0.join("outside/not-yet.txt"), &f.0.join("outside/dangling.txt")) { + outside.push(f.p("outside/dangling.txt")); + } + for p in &outside { + let e = refusal(p); + assert!(e.starts_with(&standard(p)), "{p}: {e}"); + } + // Inside a root the reason is given. + if symlink_file(&f.0.join("outside/not-yet.txt"), &f.0.join("root/dangling.txt")) { + assert!(refusal(&f.p("root/dangling.txt")).contains("leads nowhere")); + } +} + +#[test] +fn only_resolved_paths_count_as_the_apps_own_folder() { + let f = Fixture::new("own"); + let install = f.0.join("root"); + assert!(super::within_app_folder(&install.join("in.txt"), &install)); + assert!(!super::within_app_folder(&install.join("..").join("outside").join("secret.txt"), &install), "`..` leaves it"); + assert!(!super::within_app_folder(&f.0.join("root2"), &install), "a folder named like it is another"); + assert!(!super::within_app_folder(&install.join("missing.wasm"), &install)); + assert!(!super::within_app_folder(&install.join("in.txt"), &f.0.join("no-such-folder"))); +} diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index a0d87f9c2..8796dc9c6 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -6,6 +6,8 @@ //! change is one undo step. Pointer tools ([`tools`]) and text editing reduce to the same document //! edits and are journaled the same way. #![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)] +// Tests make and inspect files directly; shipped code goes through `file_access` (clippy.toml). +#![cfg_attr(test, allow(clippy::disallowed_methods))] pub mod al_keys; pub mod annotations; @@ -25,6 +27,7 @@ pub mod devcompare; pub mod devinspect; pub mod distance; pub mod drop; +pub mod file_access; pub mod guard; pub mod guides; pub mod inspect; diff --git a/crates/engine/src/library.rs b/crates/engine/src/library.rs index daa1f5bd3..268635619 100644 --- a/crates/engine/src/library.rs +++ b/crates/engine/src/library.rs @@ -541,7 +541,7 @@ fn now() -> Option { #[cfg(not(target_arch = "wasm32"))] fn stat(path: &str) -> std::result::Result { - let m = std::fs::metadata(path).map_err(|e| format!("{path}: {e}"))?; + let m = crate::file_access::metadata(path).map_err(|e| e.to_string())?; if !m.is_file() { return Err(format!("{path} is not a file")); } @@ -555,7 +555,7 @@ fn stat(_path: &str) -> std::result::Result { #[cfg(not(target_arch = "wasm32"))] fn read_file(path: &str) -> std::result::Result { - let f = std::fs::File::open(path).map_err(|e| format!("{path}: {e}"))?; + let f = crate::file_access::open(path).map_err(|e| e.to_string())?; match figcraft_format::read_library(std::io::BufReader::new(f)) { Ok(Some(lib)) => Ok(lib), Ok(None) => Err(format!("{path} has no published library: open it and publish it first (Libraries ▸ Publish library…)")), diff --git a/crates/engine/src/playground.rs b/crates/engine/src/playground.rs index 0023a6c10..64286cef8 100644 --- a/crates/engine/src/playground.rs +++ b/crates/engine/src/playground.rs @@ -75,7 +75,7 @@ pub fn specs() -> Vec { if let Some(path) = string(p, "path") { let scale = num(p, "scale").filter(|k| k.is_finite()).map_or(2.0, |k| k.clamp(0.01, 16.0)); let png = crate::cmd::file::export_bytes(©, &[inst], ExportFormat::Png, scale)?; - std::fs::write(&path, png).map_err(|e| EngineError::Other(format!("{path}: {e}")))?; + crate::file_access::write(&path, &png)?; out["path"] = json!(path); } Ok(out) diff --git a/crates/engine/src/plugin_directory.rs b/crates/engine/src/plugin_directory.rs index c3bf7dc44..2f721feae 100644 --- a/crates/engine/src/plugin_directory.rs +++ b/crates/engine/src/plugin_directory.rs @@ -147,6 +147,9 @@ fn install(s: &mut Session, p: &Value) -> Result { /// Keep an installed plugin's files in its own folder under the install folder (named by the hash /// of its id, so no id reaches the file system), its module renamed; the manifest's path. Without /// an install folder (the browser, the CLI and tests) the plugin lasts for the session. +// The install folder is the app's own (set by the desktop app, never by a command), so automation +// roots don't apply to it. +#[allow(clippy::disallowed_methods)] fn save(s: &Session, m: &mut Manifest, b: &Bundle) -> std::result::Result, String> { let Some(root) = s.plugins.install_dir.clone() else { return Ok(None) }; #[cfg(not(target_arch = "wasm32"))] @@ -189,6 +192,7 @@ fn save(s: &Session, m: &mut Manifest, b: &Bundle) -> std::result::Result` and `--automation-write-root ` (each repeatable, `--flag=` +works too; the same flags as `figcraft-cli mcp`) confine the files the app reads and writes for +whoever asks: every control request (`engine.execute`, `ui.render`, `ui.screenshot`, `window.new`, +`ui.key`, `ui.menu.invoke`…) and every frame of every window, so input injected with `ui.input` +and what a person does in the window are held to the same folders. Files are read only inside a +read or write root and written only inside a write root; anything else is an ordinary error reply +(`automation path rejected: …`), and recent files outside the roots aren't listed. Paths are +resolved as `docs/mcp.md` › Confining file access describes. A root that isn't an existing folder +stops the app before its window opens. Without the flags nothing changes. + +Not confined: opening the files given on the command line when the app starts and the documents +the system hands over (Finder, Open With; saving them later is confined like any write), and the +app's own folders (preferences, recovery copies, plugins installed from a plugin directory). Run `figcraft-cli mcp --attach PORT` without the flags against +such an app (it refuses them: the app does the confining). `ui.screenshot` and `ui.render` without a +`path` return the PNG as data, which is how the attached MCP server takes them, so it writes no +temporary files. + ## Methods ### `engine.execute {command, params?}` @@ -265,15 +288,17 @@ the annotations the canvas shows). `resetFrameStats` (true: start `framesDrawn` `mentions` the picker offers, `devCompare` (`{id, mode, split}` or `null`), `devFocus` (the frame the focus view shows, or `null`) and `annotationFilter`). -### `ui.screenshot {path}` +### `ui.screenshot {path?}` PNG of the whole window (`window` picks one), UI included (needs a visible window; an idle one draws the frame to -capture). Returns `{path, width, height}`, or an error after 60 s when the window doesn't deliver. +capture). Returns `{path, width, height}`, without `path` `{format: "png", width, height, data}` +(base64), or an error after 60 s when the window doesn't deliver. -### `ui.render {path, scale?, ids?}` +### `ui.render {path?, scale?, ids?}` PNG of the document without UI chrome (works without a window). Without `ids` it exports the -selection, else the page's top-level layers. Returns the export result. +selection, else the page's top-level layers. Returns the export result: written to `path`, or +`{format: "png", data}` (base64) without one. ### `window.new {path?, index?}` diff --git a/docs/mcp.md b/docs/mcp.md index e9b621f10..4e6f7bc3b 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -26,6 +26,62 @@ If that connection cannot be established, the error says the request was not sen A connection the app closed while it sat idle is noticed before the next request is written and replaced then, so a pause between calls is not an error. +### Confining file access + +```sh +figcraft-cli mcp --automation-read-root /work/project --automation-write-root /work/project/out +``` + +```json +{"mcpServers": {"figcraft": {"command": "/path/to/figcraft-cli", + "args": ["mcp", "--automation-read-root", "/work/project", "--automation-write-root", "/work/project/out"]}}} +``` + +The two flags (the other Craft apps take the same ones) keep an agent to the folders you give it. +Each may be given more than once, as `--flag DIR` or `--flag=DIR`: + +- Every file a tool call reads must lie inside a **read root or a write root**; every file it writes + inside a **write root**. Anything else is refused with an ordinary tool error the agent can read + and correct, for example `automation path rejected: /etc/x.png is outside the folders that may be + written: /work/project/out`. Nothing is written and the server keeps serving. +- Read and write authority are separate. With only `--automation-read-root` nothing can be written + to disk (`export` and the export commands without a `path` still return the bytes). Without either + flag nothing changes. +- The roots must be existing folders: a missing one, or a file, stops the server at startup. + `initialize`'s `instructions` name the folders, so the agent knows where it may work. +- **What is covered:** everything a call does, because the engine reaches the file system through + one module (`crates/engine/src/file_access.rs`), and `crates/engine/clippy.toml` refuses `std::fs` + anywhere else in the engine, so a command added later is covered too. That is `open_file` (and the + `variables` file it may name), `save_file`, `export {path}`, and through `run_command` / `batch` + every command that names a file: `file.open`, `file.openRecent` (recent files outside the roots + are never listed, opened, removed or named: `index` counts the files listed), `file.import`, + `file.placeImage`, `image.place`, `file.save`, `file.saveAs`, `file.revert`, `file.recover`, + `file.export`, `file.exportSvg`, `file.exportLayers` (and the folders it makes), `file.exportFramesPdf`, the images and variables JSON read next to an imported REST API + file, `library.add` and the library files open documents link to, `variable.import` / + `variable.export`, `codeConnect.import` / `codeConnect.export`, `component.playground {path}`, + `plugin.import {path}`, a development plugin's module read again from disk, + `plugin.directory.publish {path}` and its assets, `collab.recoverFile {path}`, and the headless + `ui.render` / `ui.screenshot` with a `path`. +- **How paths are resolved:** a relative path is made absolute against the server's working + directory, then its links are followed: the real path is what is compared and what is opened. For + a file that doesn't exist yet, its nearest existing folder is resolved and the rest must be plain + names, so `..` below a folder that doesn't exist is refused, and so is a link that leads nowhere + (writing through it would create its target, wherever that is). A path outside the roots gets + the same refusal whatever exists there, so a refusal doesn't tell what is outside. Folders are + compared by whole names: `/work2/x` is not inside `/work`. On Windows the case comes from the disk (`C:\WORK\x` is + inside `C:\work`), `\\?\` and UNC (`\\server\share\…`) paths are resolved like drive-letter ones, + and new names that are devices (`CON`, `NUL`, `COM1`…) or streams (`a.png:x`) are refused. +- Not confined: the app's own folders, which no tool names (preferences, Data Recovery copies, + plugins installed from a plugin directory, the system fonts). +- `--attach` with either flag is a usage error: the app runs the commands, so only the app can + confine them. Start it with the same flags, `figcraft --control 7979 --automation-read-root DIR + --automation-write-root DIR` (see [Control protocol](control-protocol.md#confining-file-access)), + then attach as usual. The attached `screenshot` gets its PNGs from the app as data, so no + temporary file is written anywhere. +- A path is checked, then opened: another program that swaps a folder for a link in between can + still win that race. The roots keep an agent to the files it was given, not other software on the + computer; if that matters, run the server as a user that can't change the roots' folders. + ### Fonts The headless server lays text out with the same fonts as the app: the fonts built into FigCraft diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index c3842d4f0..07c6a4dd1 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -621,13 +621,16 @@ Carried over from the ROADMAP's "Shipped so far" (2026-10-10). The test count th focus ring) and screen-reader names for the custom controls (AccessKit), presentation player with transitions, light and dark themes, home screen, About/Preferences/shortcuts/variables dialogs. - **Automation:** desktop control channel (`--control `: execute commands, inspect document/UI, - synthetic pointer/keys/typing, menu invocation, screenshots, renders). + synthetic pointer/keys/typing, menu invocation, screenshots, renders). What agents read and write + on disk can be confined to chosen folders (`--automation-read-root` / `--automation-write-root` on + `figcraft-cli mcp` and the desktop app, #715). - **Tests:** 963 `#[test]` functions (2026-10-10) including junk-parameter sweeps over every command (and every vector-edit command while editing), importer fuzzing and render regressions. ## Revision history | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Automation roots (M8, #715, #481): `figcraft-cli mcp --automation-read-root DIR --automation-write-root DIR` (each repeatable, existing folders) and the desktop app with the same flags confine every file a command reads to the read and write roots and every file it writes to the write roots; paths are resolved (links followed, `..`, Windows `\\?\` and UNC paths, case) and compared by whole folder names, anything else is an ordinary error. The engine reaches the file system through one module (enforced by `crates/engine/clippy.toml`), and a sweep runs every command with paths outside the roots. `--attach` refuses the flags (the app confines itself); `ui.screenshot` and `ui.render` return PNG data without a `path`, so the attached MCP server writes no temporary files. Numbers unchanged. | | 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | | 2026-10-17 | minor | Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. | | 2026-10-14 | minor | Russian catalog (M9), reviewed and approved by VanTan: all 2,165 current entries, Русский in Preferences and regional ru tags. Russian integer plurals use one/few/many; contributor display name VanTan added. Existing estimates unchanged. | From 57e455dfa78944e2aae9821366cd9fc507293c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E6=9E=97=E6=A9=A6?= <108113065+yelintong@users.noreply.github.com> Date: Sat, 17 Oct 2026 19:14:54 +0800 Subject: [PATCH 174/817] engine: fill rules as vector.fillRule and vector.reverseLoop Two vector commands behind the fill-rule panel, split out so they can land on their own (the panel is held for a maintainer design decision): - vector.fillRule {ids? | id?, region?, rule: nonZero|evenOdd} sets the winding rule a filled area fills by (the whole layer when region is left out). - vector.reverseLoop {ids? | id?, region, loop} turns one loop round, which is how a hole is made and unmade. reverseLoop no longer swaps the stored ends of a segment a loop shares with a neighbour: reversing the loop's list already flips this loop's traversal of the shared segment, so flipping its segment would turn the neighbour's area round too (bug called out in review). A new test builds two areas that share a segment and checks the shared segment and the neighbour's fill are left alone. Adds the commands to the Vector menu (catalog/parity), their locale labels, and vector_fill_rule_tests (rule per area or whole layer, junk refused, shared segment). --- crates/engine/src/catalog.rs | 2 + crates/engine/src/cmd/structure.rs | 132 ++++++++++++ crates/engine/src/lib.rs | 2 + crates/engine/src/vector_fill_rule_tests.rs | 228 ++++++++++++++++++++ crates/ui-egui/locales/cs.toml | 2 + crates/ui-egui/locales/de.toml | 2 + crates/ui-egui/locales/es.toml | 2 + crates/ui-egui/locales/fr.toml | 2 + crates/ui-egui/locales/id.toml | 2 + crates/ui-egui/locales/ja.toml | 2 + crates/ui-egui/locales/ko.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/tr.toml | 2 + crates/ui-egui/locales/zh-Hans.toml | 2 + 16 files changed, 388 insertions(+) create mode 100644 crates/engine/src/vector_fill_rule_tests.rs diff --git a/crates/engine/src/catalog.rs b/crates/engine/src/catalog.rs index c8f34fc15..6bee50482 100644 --- a/crates/engine/src/catalog.rs +++ b/crates/engine/src/catalog.rs @@ -235,6 +235,8 @@ pub static MENU: &[MenuItem] = &[ m!("Vector", "Delete and heal selection", "vector.deleteHeal"), m!("Vector", "Simplify vector", "vector.simplify"), m!("Vector", "Reverse path direction", "vector.reverse"), + m!("Vector", "Set fill rule", "vector.fillRule"), + m!("Vector", "Reverse loop", "vector.reverseLoop"), m!("Vector", "Offset path", "vector.offset"), // Plugins m!("Plugins", "Run last plugin", "plugins.runLast"), diff --git a/crates/engine/src/cmd/structure.rs b/crates/engine/src/cmd/structure.rs index 500fa021d..c38052ec0 100644 --- a/crates/engine/src/cmd/structure.rs +++ b/crates/engine/src/cmd/structure.rs @@ -103,6 +103,20 @@ pub fn specs() -> Vec { } ok() }), + spec!( + "vector.fillRule", + "Set fill rule", + "{ids? | id?, region? (a filled area of a vector; every area when left out), rule: nonZero|evenOdd}", + true, + fill_rule + ), + spec!( + "vector.reverseLoop", + "Reverse loop", + "{ids? | id?, region, loop} (a loop of a filled area; its direction flips, which changes how the area fills)", + true, + reverse_loop + ), spec!("vector.simplify", "Simplify vector", "{ids?, tolerance?}", true, simplify), spec!("vector.offset", "Offset path", "{ids?, offset}", true, offset_path), spec!("vector.join", "Join selection", "{ids?} (in vector edit mode: joins the selected points)", true, |s, p| { @@ -719,3 +733,121 @@ fn resize_to_fit(s: &mut Session, p: &Value) -> Result { } Ok(json!({"ids": fitted})) } + +/// The vector network of `id`, when it is a vector layer. +fn network_mut(doc: &mut Document, id: NodeId) -> Option<&mut VectorNetwork> { + match &mut doc.get_mut(id).ok()?.kind { + NodeKind::Vector { network } => Some(network), + _ => None, + } +} + +/// The id a fill rule is written as. +fn rule_id(rule: WindingRule) -> &'static str { + match rule { + WindingRule::NonZero => "nonZero", + WindingRule::EvenOdd => "evenOdd", + } +} + +/// `region` as an index: absent (or null) means every area. +fn area_index(cmd: &str, p: &Value) -> Result> { + match get(p, "region") { + None | Some(Value::Null) => Ok(None), + Some(v) => { + let k = f64_of(v).ok_or_else(|| bad(cmd, "`region` must be a number"))?; + if !(0.0..1e9).contains(&k) || k.fract() != 0.0 { + return Err(bad(cmd, "`region` out of range")); + } + Ok(Some(k as usize)) + } + } +} + +/// Segments listed by more than one loop (of any region): reversing a loop must leave them as they +/// are, or a neighbouring area that shares the segment would turn round with it — flipping the +/// neighbour's fill or stroke. Reversing the loop's list already flips this loop's traversal of the +/// shared segment, so its stored direction is left alone. +fn shared_segments(net: &VectorNetwork) -> std::collections::HashSet { + let mut count = std::collections::HashMap::::new(); + for region in &net.regions { + for lp in ®ion.loops { + for &s in lp { + *count.entry(s).or_insert(0) += 1; + } + } + } + count.into_iter().filter(|(_, c)| *c > 1).map(|(s, _)| s).collect() +} + +fn fill_rule(s: &mut Session, p: &Value) -> Result { + let ids = req_targets("vector.fillRule", s, p)?; + let rule = match string(p, "rule").as_deref().map(str::trim) { + Some("evenOdd" | "evenodd" | "EVENODD") => WindingRule::EvenOdd, + Some("nonZero" | "nonzero" | "NONZERO") => WindingRule::NonZero, + _ => return Err(bad("vector.fillRule", "`rule` is nonZero or evenOdd")), + }; + let only = area_index("vector.fillRule", p)?; + let doc = s.doc_mut()?; + let mut count = 0usize; + for id in ids { + let Some(net) = network_mut(doc, id) else { continue }; + match only { + Some(r) => { + if let Some(region) = net.regions.get_mut(r) { + region.winding = rule; + count += 1; + } + } + None => { + for region in &mut net.regions { + region.winding = rule; + count += 1; + } + } + } + } + if count == 0 { + return Err(EngineError::Disabled("vector.fillRule".into(), "no filled area to set (select a vector)".into())); + } + Ok(json!({"regions": count, "rule": rule_id(rule)})) +} + +/// Turn one loop of a filled area round: its segments are walked the other way, so the area it +/// bounds counts the other way in the winding (which turns a hole into a filled part and back). +fn reverse_loop(s: &mut Session, p: &Value) -> Result { + let ids = req_targets("vector.reverseLoop", s, p)?; + let region = req_index("vector.reverseLoop", p, "region")?; + let index = req_index("vector.reverseLoop", p, "loop")?; + let doc = s.doc_mut()?; + let mut reversed = false; + for id in ids { + let Some(net) = network_mut(doc, id) else { continue }; + let Some(loop_) = net.regions.get(region).and_then(|r| r.loops.get(index)).cloned() else { continue }; + // A loop is walked in the order its segments are listed, so the list turned round walks the + // ring the other way. A loop of one or two segments only turns round when its segments are + // stored the other way too (list reversal alone is a no-op for them). + // A segment shared with another loop must NOT be swapped: it belongs to a neighbouring area + // whose winding we leave alone, and reversing the list already flips this loop's traversal + // of it. + let shared = shared_segments(net); + let turned: Vec = loop_.iter().rev().copied().collect(); + for &seg in &turned { + if shared.contains(&seg) { + continue; + } + if let Some(seg) = net.segments.get_mut(seg) { + std::mem::swap(&mut seg.a, &mut seg.b); + std::mem::swap(&mut seg.ta, &mut seg.tb); + } + } + if let Some(l) = net.regions.get_mut(region).and_then(|r| r.loops.get_mut(index)) { + *l = turned; + reversed = true; + } + } + if !reversed { + return Err(EngineError::Disabled("vector.reverseLoop".into(), "no such loop (select a vector with filled areas)".into())); + } + Ok(json!({"reversed": true})) +} diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 8796dc9c6..5e29ae442 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1790,6 +1790,8 @@ mod variables_io_tests; #[cfg(test)] mod vector_behaviour_tests; #[cfg(test)] +mod vector_fill_rule_tests; +#[cfg(test)] mod vector_multi_behaviour_tests; #[cfg(test)] mod vector_offset_tests; diff --git a/crates/engine/src/vector_fill_rule_tests.rs b/crates/engine/src/vector_fill_rule_tests.rs new file mode 100644 index 000000000..db96b669c --- /dev/null +++ b/crates/engine/src/vector_fill_rule_tests.rs @@ -0,0 +1,228 @@ +//! Fill rules on vectors: `vector.fillRule` sets the rule a filled area fills by and +//! `vector.reverseLoop` turns one of its loops round — which is how a hole is made and unmade. +//! The numbers come from the two rules' definitions: non-zero fills where the winding count is not +//! zero (so a hole is a loop running against its outer loop), even-odd where it is odd (so the +//! direction of a loop doesn't matter). + +use figcraft_doc::{NodeId, NodeKind, Region, Segment, VectorNetwork, Vertex, WindingRule}; +use figcraft_geom::{BezPath, Point}; +use serde_json::{Value, json}; + +use crate::Session; + +fn ex(s: &mut Session, cmd: &str, p: Value) -> Value { + s.execute(cmd, &p).unwrap_or_else(|e| panic!("{cmd}: {e}")) +} + +fn net(s: &Session, id: NodeId) -> VectorNetwork { + match &s.doc().unwrap().node(id).unwrap().kind { + NodeKind::Vector { network } => network.clone(), + other => panic!("not a vector: {other:?}"), + } +} + +/// A 100 × 100 square with a 25…75 hole, both loops in one area: the outer one clockwise, the inner +/// one the same way round (so non-zero fills the hole too until it is turned round). +fn ring() -> VectorNetwork { + let mut path = BezPath::new(); + for (x0, y0, x1, y1) in [(0.0, 0.0, 100.0, 100.0), (25.0, 25.0, 75.0, 75.0)] { + path.move_to((x0, y0)); + path.line_to((x1, y0)); + path.line_to((x1, y1)); + path.line_to((x0, y1)); + path.close_path(); + } + let mut net = VectorNetwork::from_path(&path); + net.regions[0].winding = WindingRule::NonZero; + net +} + +/// A selected vector layer holding `ring()`. +fn ringed(s: &mut Session) -> NodeId { + let id = s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 100, "height": 100})).unwrap()["id"].as_u64().unwrap(); + let id = NodeId(id); + ex(s, "vector.edit.begin", json!({"id": id})); + ex(s, "vector.edit.end", json!({})); + { + let doc = s.doc_mut().unwrap(); + match &mut doc.get_mut(id).unwrap().kind { + NodeKind::Vector { network } => *network = ring(), + other => panic!("not a vector: {other:?}"), + } + } + ex(s, "select.set", json!({"ids": [id]})); + id +} + +/// Two 50 × 100 squares side by side share the vertical edge between them: one segment listed by +/// both areas' single loops. A segment shared between areas is the case `vector.reverseLoop` must +/// not flip, or a neighbour's fill or stroke would turn round with it. +fn two_squares() -> VectorNetwork { + // 0:A(0,0) 1:B(50,0) 2:C(100,0) 3:D(100,100) 4:E(50,100) 5:F(0,100) + // s0 A→B (left bottom), s1 B→E (the shared vertical edge), s2 E→F (left top), + // s3 F→A (left left), s4 B→C (right bottom), s5 C→D (right right), s6 D→E (right top); + // the right area's left edge is s1 walked the other way, so the squares share one segment. + // region 0: left square A→B→E→F→A = [s0, s1, s2, s3]. + // region 1: right square B→C→D→E→B = [s4, s5, s6, s1] (s1 walked backwards). + VectorNetwork { + vertices: vec![ + Vertex::new(0.0, 0.0), + Vertex::new(50.0, 0.0), + Vertex::new(100.0, 0.0), + Vertex::new(100.0, 100.0), + Vertex::new(50.0, 100.0), + Vertex::new(0.0, 100.0), + ], + segments: vec![ + Segment::line(0, 1), + Segment::line(1, 4), + Segment::line(4, 5), + Segment::line(5, 0), + Segment::line(1, 2), + Segment::line(2, 3), + Segment::line(3, 4), + ], + regions: vec![ + Region { loops: vec![vec![0, 1, 2, 3]], winding: WindingRule::NonZero }, + Region { loops: vec![vec![4, 5, 6, 1]], winding: WindingRule::NonZero }, + ], + } +} + +/// A selected vector layer holding [`two_squares`]. +fn squared(s: &mut Session) -> NodeId { + let id = s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 100, "height": 100})).unwrap()["id"].as_u64().unwrap(); + let id = NodeId(id); + ex(s, "vector.edit.begin", json!({"id": id})); + ex(s, "vector.edit.end", json!({})); + { + let doc = s.doc_mut().unwrap(); + match &mut doc.get_mut(id).unwrap().kind { + NodeKind::Vector { network } => *network = two_squares(), + other => panic!("not a vector: {other:?}"), + } + } + ex(s, "select.set", json!({"ids": [id]})); + id +} + +/// The point in the middle of the hole, and one on the square's left band. +const HOLE: Point = Point::new(50.0, 50.0); +const BAND: Point = Point::new(10.0, 50.0); + +#[test] +fn a_loop_running_with_its_outer_loop_fills_the_hole_until_it_is_turned_round() { + let mut s = Session::new(); + let id = ringed(&mut s); + let n = net(&s, id); + assert_eq!(n.regions.len(), 1); + assert_eq!(n.regions[0].loops.len(), 2, "an outer loop and the hole's"); + assert!(n.region_contains(0, BAND), "the band fills"); + assert!(n.region_contains(0, HOLE), "the hole fills while its loop runs the same way"); + // Turning the inner loop round makes it a hole under non-zero. + let r = ex(&mut s, "vector.reverseLoop", json!({"id": id, "region": 0, "loop": 1})); + assert_eq!(r["reversed"], json!(true)); + let n = net(&s, id); + assert!(n.region_contains(0, BAND), "the band still fills"); + assert!(!n.region_contains(0, HOLE), "the hole is empty"); + assert_eq!(n.region_winding(0, HOLE), Some(0), "its loops cancel out there"); + // Undo turns it back. + s.undo().unwrap(); + assert!(net(&s, id).region_contains(0, HOLE), "one undo step restores the loop"); +} + +#[test] +fn the_rule_switches_every_area_or_only_the_one_asked_for() { + let mut s = Session::new(); + let id = ringed(&mut s); + // Even-odd leaves the hole empty whatever way its loop runs. + let r = ex(&mut s, "vector.fillRule", json!({"id": id, "rule": "evenOdd"})); + assert_eq!((r["regions"].clone(), r["rule"].clone()), (json!(1), json!("evenOdd"))); + let n = net(&s, id); + assert_eq!(n.regions[0].winding, WindingRule::EvenOdd); + assert!(!n.region_contains(0, HOLE), "even-odd counts the hole's loop as a second crossing"); + // And back. + ex(&mut s, "vector.fillRule", json!({"id": id, "rule": "nonZero"})); + assert!(net(&s, id).region_contains(0, HOLE), "non-zero fills it again"); + // One area of several, by index. + let n = net(&s, id); + let mut two = n.clone(); + two.regions.push(n.regions[0].clone()); + { + let doc = s.doc_mut().unwrap(); + match &mut doc.get_mut(id).unwrap().kind { + NodeKind::Vector { network } => *network = two, + other => panic!("not a vector: {other:?}"), + } + } + ex(&mut s, "vector.fillRule", json!({"id": id, "region": 1, "rule": "evenOdd"})); + let n = net(&s, id); + assert_eq!(n.regions[0].winding, WindingRule::NonZero, "the other area keeps its rule"); + assert_eq!(n.regions[1].winding, WindingRule::EvenOdd); + // Every area at once. + ex(&mut s, "vector.fillRule", json!({"id": id, "rule": "evenOdd"})); + assert!(net(&s, id).regions.iter().all(|r| r.winding == WindingRule::EvenOdd)); +} + +#[test] +fn junk_parameters_are_refused_and_change_nothing() { + let mut s = Session::new(); + let id = ringed(&mut s); + let before = net(&s, id); + for p in [ + json!({"id": id, "rule": "nope"}), + json!({"id": id}), + json!({"id": id, "rule": 7}), + json!({"id": id, "rule": "evenOdd", "region": -1}), + json!({"id": id, "rule": "evenOdd", "region": 1.5}), + json!({"id": id, "rule": "evenOdd", "region": "x"}), + json!({"id": id, "rule": "evenOdd", "region": 99}), + ] { + assert!(s.execute("vector.fillRule", &p).is_err(), "{p} is refused"); + } + for p in [ + json!({"id": id}), + json!({"id": id, "region": 0}), + json!({"id": id, "region": 0, "loop": 99}), + json!({"id": id, "region": 99, "loop": 0}), + json!({"id": id, "region": -2, "loop": 0}), + ] { + assert!(s.execute("vector.reverseLoop", &p).is_err(), "{p} is refused"); + } + assert_eq!(net(&s, id), before, "nothing changed"); + // A rectangle that was never a vector is refused too. + let rect = s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap()["id"].as_u64().unwrap(); + assert!(s.execute("vector.fillRule", &json!({"id": rect, "rule": "evenOdd"})).is_err()); + assert!(s.execute("vector.reverseLoop", &json!({"id": rect, "region": 0, "loop": 0})).is_err()); +} + +#[test] +fn reversing_a_loop_shared_with_a_neighbour_leaves_its_segment_and_fill_alone() { + let mut s = Session::new(); + let id = squared(&mut s); + let n = net(&s, id); + assert_eq!(n.regions.len(), 2, "two areas, side by side"); + // Both areas fill under non-zero: a point in each. + assert!(n.region_contains(0, Point::new(25.0, 50.0)), "the left area fills"); + assert!(n.region_contains(1, Point::new(75.0, 50.0)), "the right area fills"); + // The vertical edge between them is one segment listed by both areas' loops. + const SHARED: usize = 1; + assert!(n.regions[0].loops[0].contains(&SHARED) && n.regions[1].loops[0].contains(&SHARED), "one segment is shared"); + let before = n.segments[SHARED]; + let left_winding = n.region_winding(0, Point::new(25.0, 50.0)).unwrap(); + assert_ne!(left_winding, 0, "the left area winds once"); + // Reverse the left area's only loop. + let r = ex(&mut s, "vector.reverseLoop", json!({"id": id, "region": 0, "loop": 0})); + assert_eq!(r["reversed"], json!(true)); + let n = net(&s, id); + // The shared segment's stored ends are untouched: reversing the loop must not flip a neighbour's + // segment (reversing the list already turns this loop's traversal of it the other way). + assert_eq!(n.segments[SHARED], before, "the shared segment is left as it was"); + // The neighbour's fill is unchanged: it still fills its interior. + assert!(n.region_contains(1, Point::new(75.0, 50.0)), "the neighbour still fills"); + // The reversed loop really turned round: its winding at a left-area point flipped sign. + assert_eq!(n.region_winding(0, Point::new(25.0, 50.0)), Some(-left_winding), "the left loop reversed"); + // Undo restores the shared segment and the loop. + s.undo().unwrap(); + assert_eq!(net(&s, id).segments[SHARED], before, "undo restores the shared segment too"); +} diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml index 2459d104a..7d176d1be 100644 --- a/crates/ui-egui/locales/cs.toml +++ b/crates/ui-egui/locales/cs.toml @@ -2151,11 +2151,13 @@ status = "draft — needs native review" "vector.edit.tool" = "Nástroj úprav vektoru" "vector.edit.transform" = "Transformovat body" "vector.edit.widthPoint" = "Bod šířky" +"vector.fillRule" = "Nastavit pravidlo výplně" "vector.flatten" = "Sloučit do vektoru" "vector.join" = "Spojit výběr" "vector.offset" = "Odsadit cestu" "vector.outlineStroke" = "Převést tah na obrysy" "vector.reverse" = "Obrátit směr cesty" +"vector.reverseLoop" = "Obrátit smyčku" "vector.simplify" = "Zjednodušit vektor" "vector.smoothJoin" = "Hladce spojit výběr" "version.autosave" = "Automaticky uložit verzi" diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index b679feb71..bd6094504 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -2093,11 +2093,13 @@ status = "draft — needs native review" "vector.edit.tool" = "Vektorbearbeitungswerkzeug" "vector.edit.transform" = "Punkte transformieren" "vector.edit.widthPoint" = "Breitenpunkt" +"vector.fillRule" = "Füllregel festlegen" "vector.flatten" = "Zusammenfügen" "vector.join" = "Auswahl verbinden" "vector.offset" = "Pfad versetzen" "vector.outlineStroke" = "Kontur in Pfad umwandeln" "vector.reverse" = "Pfadrichtung umkehren" +"vector.reverseLoop" = "Schleife umdrehen" "vector.simplify" = "Vektor vereinfachen" "vector.smoothJoin" = "Auswahl glatt verbinden" "version.autosave" = "Version automatisch speichern" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 2849f4ec8..f05c5bdd8 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -2183,11 +2183,13 @@ status = "draft — needs native review" "vector.edit.tool" = "Herramienta de edición vectorial" "vector.edit.transform" = "Transformar puntos" "vector.edit.widthPoint" = "Punto de ancho" +"vector.fillRule" = "Establecer regla de relleno" "vector.flatten" = "Acoplar" "vector.join" = "Unir selección" "vector.offset" = "Desplazar trazado" "vector.outlineStroke" = "Contornear trazo" "vector.reverse" = "Invertir dirección del trazado" +"vector.reverseLoop" = "Invertir bucle" "vector.simplify" = "Simplificar vector" "vector.smoothJoin" = "Unir selección con suavizado" "version.autosave" = "Guardar versión automáticamente" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 1c561f15e..621eb7252 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -2084,11 +2084,13 @@ status = "draft — needs native review" "vector.edit.tool" = "Outil de modification vectorielle" "vector.edit.transform" = "Transformer les points" "vector.edit.widthPoint" = "Point de largeur" +"vector.fillRule" = "Définir la règle de remplissage" "vector.flatten" = "Aplatir" "vector.join" = "Joindre la sélection" "vector.offset" = "Décaler le tracé" "vector.outlineStroke" = "Convertir le contour en tracé" "vector.reverse" = "Inverser le sens du tracé" +"vector.reverseLoop" = "Inverser la boucle" "vector.simplify" = "Simplifier le vecteur" "vector.smoothJoin" = "Joindre la sélection en lissant" "version.autosave" = "Enregistrer automatiquement une version" diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml index 7a0a3c3ce..e196f88ba 100644 --- a/crates/ui-egui/locales/id.toml +++ b/crates/ui-egui/locales/id.toml @@ -2155,11 +2155,13 @@ status = "draft — needs native review" "vector.edit.tool" = "Alat edit vector" "vector.edit.transform" = "Transformasi titik" "vector.edit.widthPoint" = "Titik lebar" +"vector.fillRule" = "Atur aturan isian" "vector.flatten" = "Satukan" "vector.join" = "Gabungkan pilihan" "vector.offset" = "Offset path" "vector.outlineStroke" = "Outline stroke" "vector.reverse" = "Balik arah path" +"vector.reverseLoop" = "Balik loop" "vector.simplify" = "Sederhanakan vector" "vector.smoothJoin" = "Gabungkan pilihan dengan halus" "version.autosave" = "Simpan versi otomatis" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index b09db3bdd..533170af2 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -2168,11 +2168,13 @@ status = "draft — needs native review" "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" = "自動保存バージョン" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index f2cfcfff5..09ebef0d1 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -2084,11 +2084,13 @@ status = "draft — needs native review" "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" = "자동 저장 버전" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index e9e1300cf..59802d73a 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -2083,11 +2083,13 @@ status = "draft — needs native review" "vector.edit.tool" = "Ferramenta de edição vetorial" "vector.edit.transform" = "Transformar pontos" "vector.edit.widthPoint" = "Ponto de largura" +"vector.fillRule" = "Definir regra de preenchimento" "vector.flatten" = "Nivelar" "vector.join" = "Unir seleção" "vector.offset" = "Deslocar caminho" "vector.outlineStroke" = "Contornar traço" "vector.reverse" = "Inverter direção do caminho" +"vector.reverseLoop" = "Inverter laço" "vector.simplify" = "Simplificar vetor" "vector.smoothJoin" = "Unir seleção com suavização" "version.autosave" = "Salvar versão automaticamente" diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 2023b6929..bf8e29c7a 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -2153,11 +2153,13 @@ name = "Русский" "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" = "Автосохранить версию" diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index 51f165084..96e8b83a9 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -2176,11 +2176,13 @@ name = "Svenska" "vector.edit.tool" = "Vektorredigeringsverktyg" "vector.edit.transform" = "Transformera punkter" "vector.edit.widthPoint" = "Breddpunkt" +"vector.fillRule" = "Ange fyllnadsregel" "vector.flatten" = "Platta till" "vector.join" = "Sammanfoga markering" "vector.offset" = "Förskjut bana" "vector.outlineStroke" = "Konvertera kontur till form" "vector.reverse" = "Vänd banans riktning" +"vector.reverseLoop" = "Vänd slinga" "vector.simplify" = "Förenkla vektor" "vector.smoothJoin" = "Sammanfoga markering mjukt" "version.autosave" = "Autospara version" diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml index cc002654d..68daa4b3e 100644 --- a/crates/ui-egui/locales/tr.toml +++ b/crates/ui-egui/locales/tr.toml @@ -2155,11 +2155,13 @@ name = "Türkçe" "vector.edit.tool" = "Vektör düzenleme aracı" "vector.edit.transform" = "Noktaları dönüştür" "vector.edit.widthPoint" = "Genişlik noktası" +"vector.fillRule" = "Dolgu kuralını ayarla" "vector.flatten" = "Düzleştir" "vector.join" = "Seçimi birleştir" "vector.offset" = "Yolu ötele" "vector.outlineStroke" = "Konturu ana hatlara dönüştür" "vector.reverse" = "Yol yönünü ters çevir" +"vector.reverseLoop" = "Döngüyü çevir" "vector.simplify" = "Vektörü sadeleştir" "vector.smoothJoin" = "Seçimi yumuşak birleştir" "version.autosave" = "Otomatik kayıt sürümü" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index 702cae7b8..7a8d9b96a 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -2085,11 +2085,13 @@ status = "draft — needs native review" "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" = "自动保存版本" From 96091494a52fcb94e892226e9b1fa1ab3faf68bb Mon Sep 17 00:00:00 2001 From: MarekSpodBiedry <73122968+MarekSpodBiedry@users.noreply.github.com> Date: Sat, 17 Oct 2026 15:03:28 +0200 Subject: [PATCH 175/817] M8: Keyboard shortcuts panel closes on the home screen (#548) --- crates/ui-egui/src/lib.rs | 2 ++ crates/ui-egui/src/shortcuts_tests.rs | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 360955a33..6d867abfe 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1414,6 +1414,8 @@ impl FigApp { return; } if !self.has_files() || self.ui.home { + // The shortcuts panel belongs to the canvas; it doesn't hang over the home screen. + self.ui.shortcuts_panel = false; tabs::tab_bar(self, ui); home::show(self, ui); dialogs::keys(self, &ctx); diff --git a/crates/ui-egui/src/shortcuts_tests.rs b/crates/ui-egui/src/shortcuts_tests.rs index cd0f0ea58..5c1e06fab 100644 --- a/crates/ui-egui/src/shortcuts_tests.rs +++ b/crates/ui-egui/src/shortcuts_tests.rs @@ -188,3 +188,12 @@ fn shortcuts_panel_opens_switches_tabs_and_searches() { u.app.run("help.shortcuts", json!({})); assert!(!u.app.ui.shortcuts_panel, "the command toggles it"); } + +#[test] +fn shortcuts_panel_does_not_show_on_the_home_screen() { + let mut u = Ui::new(Session::empty()); + u.app.ui.home = true; + u.app.ui.shortcuts_panel = true; + u.frame(vec![]); + assert!(!u.app.ui.shortcuts_panel, "the panel closes on the home screen"); +} From 17758458ef02560fbc206eb2dbb83bae0f970fff Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 20:03:45 +0700 Subject: [PATCH 176/817] #575: drop the progress-doc edit --- docs/ui-parity.md | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/docs/ui-parity.md b/docs/ui-parity.md index b534d3179..62001715e 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-10-15 · **Change:** minor (Selection colors for mixed selections (#403); fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-15 · **Change:** minor (fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **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: @@ -109,25 +109,6 @@ interaction feel not yet compared. | Cursors per tool and modifier | done | the engine names a cursor for every tool, modifier and hover target (`tool.overlay.cursor`, tabled in `cursor_tests`) and the UI shows the system's or draws its own at the pointer (`cursors.rs`, `cursors_tests`; original glyphs from lines and the code-drawn icons). Arrow for Move and Scale; two-headed arrows on the handles that follow the handle and the box's rotation; outside a corner a curved rotate arrow turned to that corner, turning with the pointer while rotating; crosshair for the frame, section, slice, shape, pencil and Text tools; the I-beam over a text with the Text tool and over the text being edited; the pen as a cross with what a click does beside it (nothing: a new point; a ring: closes, connects to or goes on from a point; a plus: adds a point on a segment, also Alt in vector edit mode; a curve: bends, the Bend tool or Cmd/Ctrl); open and closed hand for the Hand tool, Space and the middle button; zoom in and out (Alt) while Z is held; eyedropper; comment pin; the copy cursor with Alt over a selected layer and while Alt-dragging; not-allowed while a drag resizes, rotates or moves a layer inside an instance (it is undone on release) and over a layers row that takes no drop. Ruler guides and gradient, crop and padding handles keep their own cursors (the tool's used to replace them). `ui.inspect` reports `cursor`. Left: no cursor for removing a point with the pen (the pen doesn't remove points); the drawn cursors follow the pointer a frame behind the system's; not compared with Figma's side by side | | Multiplayer cursors, cursor chat, spotlight | partial | in live sessions: named cursors, chat bubbles that fade, `/` to chat, spotlight from your avatar's menu with a banner; no audio or reactions | -### Selection colors - -The Design panel shows Selection colors below Effects when the selection contains multiple -paint groups. It includes solid fills and gradients, strokes, descendants and effective text -range fills; images, patterns, hidden paints and masks are omitted. A boolean group's own paints -are included, without its operands. Equal paints from different styles or variables stay separate. -Each row edits the matching slots through the ordinary color picker or hex/opacity fields and -can select their owning layers. A picker drag is one undo step and retains its original targets -even when two colors become equal. Paint discovery is cached per document snapshot and selection; -the rows are virtualized. During an interaction, the panel keeps its cached rows disabled and -defers discovery until the gesture ends; selection commands still process all matching paints. - -Color styles already in the document (including imported styles) can be applied from a row. -As with the existing Fill/Stroke style controls, applying a style replaces the matching layer's -whole fill or stroke list and links it. A text range takes the style's resolved paints while -keeping its typography; the document model has no paint-style link on character ranges. -Browsing enabled libraries and binding/detaching variables from this section are not implemented; -this is **partial** UI parity. - ## Keyboard shortcuts One keymap (`figcraft_engine::keymap`) drives the menus, the canvas, the shortcuts panel, the @@ -185,7 +166,6 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| -| 2026-10-15 | minor | Selection colors (#403): mixed-selection paint editing, color styles and select-by-color; engine and egui regression tests. Bounds and remaining parity are documented above; headline estimates unchanged. | | 2026-10-15 | minor | Hex fields take CSS colour names (`red` → `FF0000`): fills, strokes, effects, grids, variables, backgrounds and the colour picker | | 2026-10-15 | minor | Typography: drag the line-height, letter-spacing and paragraph-spacing icons to scrub their values; shared numeric-field rates, resize cursor and one Undo step per gesture (#373). | | 2026-10-15 | minor | A click or Tab into a one-line field selects all of its text (hex, inline, name, search and dialog fields); the first click into a fill's hex takes the keyboard | From af27ff7d2a7c4e0217757cf082907853032ffb65 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 20:03:54 +0700 Subject: [PATCH 177/817] #575: Selection colors strings and command labels in every catalog --- crates/ui-egui/locales/cs.toml | 8 ++++++++ crates/ui-egui/locales/de.toml | 8 ++++++++ crates/ui-egui/locales/fr.toml | 8 ++++++++ crates/ui-egui/locales/id.toml | 8 ++++++++ crates/ui-egui/locales/ja.toml | 8 ++++++++ crates/ui-egui/locales/ko.toml | 8 ++++++++ crates/ui-egui/locales/pt-BR.toml | 8 ++++++++ crates/ui-egui/locales/ru.toml | 8 ++++++++ crates/ui-egui/locales/sv.toml | 8 ++++++++ crates/ui-egui/locales/tr.toml | 8 ++++++++ crates/ui-egui/locales/zh-Hans.toml | 8 ++++++++ 11 files changed, 88 insertions(+) diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml index 2459d104a..cc0e66fd3 100644 --- a/crates/ui-egui/locales/cs.toml +++ b/crates/ui-egui/locales/cs.toml @@ -638,6 +638,7 @@ status = "draft — needs native review" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Návrh rozhraní a prototypování. Svobodný nástroj s otevřeným zdrojovým kódem, napsaný od základu v jazyce Rust nezávisle na kódu jiných produktů. Součást sady ArtCraft Crafting Apps." "Intersect" = "Průnik" "Intersects" = "Průniky" +"Invalid color" = "Neplatná barva" "Invite link" = "Odkaz s pozvánkou" "Invite link copied" = "Odkaz s pozvánkou zkopírován" "It asks permission to:" = "Žádá o oprávnění:" @@ -804,6 +805,7 @@ status = "draft — needs native review" "No branches. A branch is a copy of the file to try changes in, then review and merge." = "Žádné větve. Větev je kopie souboru pro vyzkoušení změn, které pak zkontrolujete a sloučíte." "No category" = "Bez kategorie" "No changes" = "Žádné změny" +"No color styles" = "Žádné barevné styly" "No colour variables fit here." = "Žádné vhodné barevné proměnné." "No colour variables yet. Create them in Local variables." = "Zatím žádné barevné proměnné. Vytvořte je v Místních proměnných." "No comments yet" = "Zatím žádné komentáře" @@ -1161,12 +1163,14 @@ status = "draft — needs native review" "Select all with same" = "Vybrat vše se stejným" "Select layer" = "Vybrat vrstvu" "Select layers to apply the style to" = "Vyberte vrstvy, na které chcete použít styl" +"Select layers with this color" = "Vybrat vrstvy s touto barvou" "Select overlapping shapes" = "Vyberte překrývající se tvary" "Select points to edit their position, radius and mirroring" = "Vyberte body a upravte jejich polohu, poloměr a zrcadlení" "Select slot" = "Vybrat slot" "Selection" = "Výběr" "Selection box, {w} by {h} at {x}, {y}: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Rámeček výběru, {w} × {h} na pozici {x}, {y}: šipky posouvají, Shift+šipky nebo {cmd}+šipky mění velikost, Enter vybere, Escape zruší" "Selection box: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Rámeček výběru: šipky posouvají, Shift+šipky nebo {cmd}+šipky mění velikost, Enter vybere, Escape zruší" +"Selection colors" = "Barvy výběru" "Send backward" = "Přesunout o úroveň níž" "Send report" = "Odeslat hlášení" "Send to back" = "Přesunout do pozadí" @@ -1992,6 +1996,10 @@ status = "draft — needs native review" "select.sameStroke" = "Vybrat stejný tah" "select.sameText" = "Vybrat stejné vlastnosti textu" "select.set" = "Vybrat" +"selection.applyColorStyle" = "Použít barevný styl na výběr" +"selection.colors" = "Barvy výběru" +"selection.selectColor" = "Vybrat vrstvy s touto barvou" +"selection.setPaint" = "Změnit barvu výběru" "shape.arrow" = "Šipka" "shape.ellipse" = "Elipsa" "shape.line" = "Čára" diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index b679feb71..ba9c90bd9 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -623,6 +623,7 @@ status = "draft — needs native review" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Interface-Design und Prototyping. Ein kostenloses Open-Source-Designwerkzeug, als Clean-Room-Entwicklung von Grund auf in Rust geschrieben, Teil der ArtCraft Crafting Apps." "Intersect" = "Schnittmenge" "Intersects" = "Schnittmengen" +"Invalid color" = "Ungültige Farbe" "Invite link" = "Einladungslink" "Invite link copied" = "Einladungslink kopiert" "It asks permission to:" = "Es möchte:" @@ -777,6 +778,7 @@ status = "draft — needs native review" "No branches. A branch is a copy of the file to try changes in, then review and merge." = "Keine Branches. Ein Branch ist eine Kopie der Datei, in der Sie Änderungen ausprobieren, prüfen und dann zusammenführen." "No category" = "Keine Kategorie" "No changes" = "Keine Änderungen" +"No color styles" = "Keine Farbstile" "No colour variables fit here." = "Hier passen keine Farbvariablen." "No colour variables yet. Create them in Local variables." = "Noch keine Farbvariablen. Erstellen Sie sie unter Lokale Variablen." "No comments yet" = "Noch keine Kommentare" @@ -1125,12 +1127,14 @@ status = "draft — needs native review" "Select all with same" = "Alle auswählen mit gleicher" "Select layer" = "Ebene auswählen" "Select layers to apply the style to" = "Wählen Sie die Ebenen aus, auf die der Stil angewendet werden soll" +"Select layers with this color" = "Ebenen mit dieser Farbe auswählen" "Select overlapping shapes" = "Wählen Sie überlappende Formen aus" "Select points to edit their position, radius and mirroring" = "Wählen Sie Punkte aus, um Position, Radius und Spiegelung zu bearbeiten" "Select slot" = "Slot auswählen" "Selection" = "Auswahl" "Selection box, {w} by {h} at {x}, {y}: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Auswahlrahmen, {w} × {h} bei {x}, {y}: Pfeiltasten verschieben ihn, Umschalt+Pfeiltasten oder {cmd}+Pfeiltasten ändern die Größe, Eingabe wählt aus, Esc bricht ab" "Selection box: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Auswahlrahmen: Pfeiltasten verschieben ihn, Umschalt+Pfeiltasten oder {cmd}+Pfeiltasten ändern die Größe, Eingabe wählt aus, Esc bricht ab" +"Selection colors" = "Auswahlfarben" "Send backward" = "Eine Ebene nach hinten" "Send report" = "Meldung senden" "Send to back" = "In den Hintergrund" @@ -1935,6 +1939,10 @@ status = "draft — needs native review" "select.sameStroke" = "Gleiche Kontur auswählen" "select.sameText" = "Gleiche Texteigenschaften auswählen" "select.set" = "Auswählen" +"selection.applyColorStyle" = "Farbstil auf Auswahl anwenden" +"selection.colors" = "Auswahlfarben" +"selection.selectColor" = "Ebenen mit dieser Farbe auswählen" +"selection.setPaint" = "Farbe der Auswahl ändern" "shape.arrow" = "Pfeil" "shape.ellipse" = "Ellipse" "shape.line" = "Linie" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 1c561f15e..6edfbd03f 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -619,6 +619,7 @@ status = "draft — needs native review" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Design d’interfaces et prototypage. Un outil de design libre et gratuit, développé en salle blanche (clean-room) et écrit de zéro en Rust, membre des Crafting Apps d’ArtCraft." "Intersect" = "Intersection" "Intersects" = "Intersections" +"Invalid color" = "Couleur non valide" "Invite link" = "Lien d’invitation" "Invite link copied" = "Lien d’invitation copié" "It asks permission to:" = "Il demande l’autorisation de :" @@ -773,6 +774,7 @@ status = "draft — needs native review" "No branches. A branch is a copy of the file to try changes in, then review and merge." = "Aucune branche. Une branche est une copie du fichier pour essayer des modifications, puis les relire et les fusionner." "No category" = "Sans catégorie" "No changes" = "Aucune modification" +"No color styles" = "Aucun style de couleur" "No colour variables fit here." = "Aucune variable de couleur ne convient ici." "No colour variables yet. Create them in Local variables." = "Aucune variable de couleur pour l’instant. Créez-en dans Variables locales." "No comments yet" = "Aucun commentaire pour l’instant" @@ -1119,12 +1121,14 @@ status = "draft — needs native review" "Select all with same" = "Sélectionner tout ce qui a le même" "Select layer" = "Sélectionner le calque" "Select layers to apply the style to" = "Sélectionnez les calques auxquels appliquer le style" +"Select layers with this color" = "Sélectionner les calques de cette couleur" "Select overlapping shapes" = "Sélectionnez des formes qui se chevauchent" "Select points to edit their position, radius and mirroring" = "Sélectionnez des points pour modifier leur position, leur rayon et leur symétrie" "Select slot" = "Sélectionner l’emplacement" "Selection" = "Sélection" "Selection box, {w} by {h} at {x}, {y}: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Zone de sélection, {w} sur {h} à {x}, {y} : les flèches la déplacent, Maj+flèches ou {cmd}+flèches la redimensionnent, Entrée sélectionne, Échap annule" "Selection box: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Zone de sélection : les flèches la déplacent, Maj+flèches ou {cmd}+flèches la redimensionnent, Entrée sélectionne, Échap annule" +"Selection colors" = "Couleurs de la sélection" "Send backward" = "Reculer" "Send report" = "Envoyer le signalement" "Send to back" = "Mettre à l’arrière-plan" @@ -1926,6 +1930,10 @@ status = "draft — needs native review" "select.sameStroke" = "Sélectionner le même contour" "select.sameText" = "Sélectionner les mêmes propriétés de texte" "select.set" = "Sélectionner" +"selection.applyColorStyle" = "Appliquer un style de couleur à la sélection" +"selection.colors" = "Couleurs de la sélection" +"selection.selectColor" = "Sélectionner les calques de cette couleur" +"selection.setPaint" = "Changer la couleur de la sélection" "shape.arrow" = "Flèche" "shape.ellipse" = "Ellipse" "shape.line" = "Ligne" diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml index 7a0a3c3ce..99d6cff47 100644 --- a/crates/ui-egui/locales/id.toml +++ b/crates/ui-egui/locales/id.toml @@ -642,6 +642,7 @@ status = "draft — needs native review" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Desain antarmuka dan prototyping. Alat desain clean-room gratis dan open-source yang ditulis dari nol dengan Rust, bagian dari ArtCraft Crafting Apps." "Intersect" = "Irisan" "Intersects" = "Beririsan" +"Invalid color" = "Warna tidak valid" "Invite link" = "Link undangan" "Invite link copied" = "Link undangan disalin" "It asks permission to:" = "Plugin ini meminta izin untuk:" @@ -808,6 +809,7 @@ status = "draft — needs native review" "No branches. A branch is a copy of the file to try changes in, then review and merge." = "Tidak ada branch. Branch adalah salinan file untuk mencoba perubahan, lalu ditinjau dan di-merge." "No category" = "Tanpa kategori" "No changes" = "Tidak ada perubahan" +"No color styles" = "Tidak ada gaya warna" "No colour variables fit here." = "Tidak ada variabel warna yang cocok di sini." "No colour variables yet. Create them in Local variables." = "Belum ada variabel warna. Buat di Variabel lokal." "No comments yet" = "Belum ada komentar" @@ -1165,12 +1167,14 @@ status = "draft — needs native review" "Select all with same" = "Pilih semua yang sama" "Select layer" = "Pilih layer" "Select layers to apply the style to" = "Pilih layer untuk menerapkan gaya" +"Select layers with this color" = "Pilih layer dengan warna ini" "Select overlapping shapes" = "Pilih bentuk yang tumpang tindih" "Select points to edit their position, radius and mirroring" = "Pilih titik untuk mengedit posisi, radius, dan pencerminannya" "Select slot" = "Pilih slot" "Selection" = "Pilihan" "Selection box, {w} by {h} at {x}, {y}: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Kotak pilihan, {w} x {h} di {x}, {y}: panah untuk memindahkan, Shift+panah atau {cmd}+panah untuk mengubah ukuran, Enter untuk memilih, Escape untuk membatalkan" "Selection box: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Kotak pilihan: panah untuk memindahkan, Shift+panah atau {cmd}+panah untuk mengubah ukuran, Enter untuk memilih, Escape untuk membatalkan" +"Selection colors" = "Warna pilihan" "Send backward" = "Bawa mundur" "Send report" = "Kirim laporan" "Send to back" = "Bawa ke paling belakang" @@ -1996,6 +2000,10 @@ status = "draft — needs native review" "select.sameStroke" = "Pilih stroke yang sama" "select.sameText" = "Pilih properti teks yang sama" "select.set" = "Pilih" +"selection.applyColorStyle" = "Terapkan gaya warna ke pilihan" +"selection.colors" = "Warna pilihan" +"selection.selectColor" = "Pilih layer dengan warna ini" +"selection.setPaint" = "Ubah warna pilihan" "shape.arrow" = "Panah" "shape.ellipse" = "Elips" "shape.line" = "Garis" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index b09db3bdd..788ed68bc 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -647,6 +647,7 @@ status = "draft — needs native review" "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 の一つ。" "Intersect" = "交差" "Intersects" = "交差" +"Invalid color" = "無効なカラー" "Invite link" = "招待リンク" "Invite link copied" = "招待リンクをコピー済み" "It asks permission to:" = "次の権限を求めている:" @@ -813,6 +814,7 @@ status = "draft — needs native review" "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 yet" = "コメントはまだない" @@ -1172,12 +1174,14 @@ status = "draft — needs native review" "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 colors" = "選択範囲のカラー" "Send backward" = "背面へ" "Send report" = "報告を送信" "Send to back" = "最背面へ" @@ -2008,6 +2012,10 @@ status = "draft — needs native review" "select.sameStroke" = "同じ線を選択" "select.sameText" = "同じテキストプロパティを選択" "select.set" = "選択" +"selection.applyColorStyle" = "選択範囲にカラースタイルを適用" +"selection.colors" = "選択範囲のカラー" +"selection.selectColor" = "このカラーのレイヤーを選択" +"selection.setPaint" = "選択範囲のカラーを変更" "shape.arrow" = "矢印" "shape.ellipse" = "楕円" "shape.line" = "線" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index f2cfcfff5..a6bfbf6ea 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -619,6 +619,7 @@ status = "draft — needs native review" "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의 하나." "Intersect" = "교차" "Intersects" = "교차" +"Invalid color" = "잘못된 색상" "Invite link" = "초대 링크" "Invite link copied" = "초대 링크 복사됨" "It asks permission to:" = "다음 권한을 요청함:" @@ -773,6 +774,7 @@ status = "draft — needs native review" "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 yet" = "아직 댓글 없음" @@ -1119,12 +1121,14 @@ status = "draft — needs native review" "Select all with same" = "같은 항목 모두 선택" "Select layer" = "레이어 선택" "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 colors" = "선택 항목 색상" "Send backward" = "뒤로 보내기" "Send report" = "신고 보내기" "Send to back" = "맨 뒤로 보내기" @@ -1926,6 +1930,10 @@ status = "draft — needs native review" "select.sameStroke" = "같은 선 선택" "select.sameText" = "같은 텍스트 속성 선택" "select.set" = "선택" +"selection.applyColorStyle" = "선택 항목에 색상 스타일 적용" +"selection.colors" = "선택 항목 색상" +"selection.selectColor" = "이 색상의 레이어 선택" +"selection.setPaint" = "선택 항목 색상 변경" "shape.arrow" = "화살표" "shape.ellipse" = "타원" "shape.line" = "선" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index e9e1300cf..75bbb3014 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -618,6 +618,7 @@ status = "draft — needs native review" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Design de interfaces e prototipagem. Uma ferramenta de design gratuita e de código aberto, com implementação independente (clean-room), escrita do zero em Rust, parte dos Crafting Apps da ArtCraft." "Intersect" = "Interseção" "Intersects" = "Interseções" +"Invalid color" = "Cor inválida" "Invite link" = "Link de convite" "Invite link copied" = "Link de convite copiado" "It asks permission to:" = "Ele pede permissão para:" @@ -772,6 +773,7 @@ status = "draft — needs native review" "No branches. A branch is a copy of the file to try changes in, then review and merge." = "Nenhuma branch. Uma branch é uma cópia do arquivo para testar alterações e depois revisá-las e mesclá-las." "No category" = "Sem categoria" "No changes" = "Nenhuma alteração" +"No color styles" = "Nenhum estilo de cor" "No colour variables fit here." = "Nenhuma variável de cor se encaixa aqui." "No colour variables yet. Create them in Local variables." = "Ainda não há variáveis de cor. Crie-as em Variáveis locais." "No comments yet" = "Ainda não há comentários" @@ -1118,12 +1120,14 @@ status = "draft — needs native review" "Select all with same" = "Selecionar tudo com o mesmo" "Select layer" = "Selecionar camada" "Select layers to apply the style to" = "Selecione as camadas às quais aplicar o estilo" +"Select layers with this color" = "Selecionar camadas com esta cor" "Select overlapping shapes" = "Selecione formas sobrepostas" "Select points to edit their position, radius and mirroring" = "Selecione pontos para editar posição, raio e espelhamento" "Select slot" = "Selecionar slot" "Selection" = "Seleção" "Selection box, {w} by {h} at {x}, {y}: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Caixa de seleção, {w} por {h} em {x}, {y}: as setas a movem, Shift+setas ou {cmd}+setas a redimensionam, Enter seleciona, Esc cancela" "Selection box: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Caixa de seleção: as setas a movem, Shift+setas ou {cmd}+setas a redimensionam, Enter seleciona, Esc cancela" +"Selection colors" = "Cores da seleção" "Send backward" = "Enviar para trás" "Send report" = "Enviar denúncia" "Send to back" = "Enviar para o plano de fundo" @@ -1925,6 +1929,10 @@ status = "draft — needs native review" "select.sameStroke" = "Selecionar mesmo traço" "select.sameText" = "Selecionar mesmas propriedades de texto" "select.set" = "Selecionar" +"selection.applyColorStyle" = "Aplicar estilo de cor à seleção" +"selection.colors" = "Cores da seleção" +"selection.selectColor" = "Selecionar camadas com esta cor" +"selection.setPaint" = "Alterar cor da seleção" "shape.arrow" = "Seta" "shape.ellipse" = "Elipse" "shape.line" = "Linha" diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 2023b6929..782aa225d 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -639,6 +639,7 @@ name = "Русский" "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." "Intersect" = "Пересечение" "Intersects" = "Пересечения" +"Invalid color" = "Недопустимый цвет" "Invite link" = "Ссылка приглашения" "Invite link copied" = "Ссылка приглашения скопирована" "It asks permission to:" = "Запрашивает разрешение на:" @@ -805,6 +806,7 @@ name = "Русский" "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 yet" = "Комментариев пока нет" @@ -1163,12 +1165,14 @@ name = "Русский" "Select all with same" = "Выделить всё с одинаковым" "Select layer" = "Выделить слой" "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 colors" = "Цвета выделения" "Send backward" = "На уровень назад" "Send report" = "Отправить жалобу" "Send to back" = "На задний план" @@ -1994,6 +1998,10 @@ name = "Русский" "select.sameStroke" = "Выделить с одинаковой обводкой" "select.sameText" = "Выделить с одинаковыми свойствами текста" "select.set" = "Выделить" +"selection.applyColorStyle" = "Применить цветовой стиль к выделению" +"selection.colors" = "Цвета выделения" +"selection.selectColor" = "Выделить слои с этим цветом" +"selection.setPaint" = "Изменить цвет выделения" "shape.arrow" = "Стрелка" "shape.ellipse" = "Эллипс" "shape.line" = "Линия" diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index 51f165084..f751ecb56 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -649,6 +649,7 @@ name = "Svenska" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Gränssnittsdesign och prototyper. Ett fritt clean-room-designverktyg med öppen källkod, skrivet från grunden i Rust och en del av ArtCraft Crafting Apps." "Intersect" = "Skärning" "Intersects" = "Skär" +"Invalid color" = "Ogiltig färg" "Invite link" = "Inbjudningslänk" "Invite link copied" = "Inbjudningslänken har kopierats" "It asks permission to:" = "Den ber om behörighet att:" @@ -815,6 +816,7 @@ name = "Svenska" "No branches. A branch is a copy of the file to try changes in, then review and merge." = "Inga grenar. En gren är en kopia av filen där du kan prova ändringar och sedan granska och sammanfoga dem." "No category" = "Ingen kategori" "No changes" = "Inga ändringar" +"No color styles" = "Inga färgformatmallar" "No colour variables fit here." = "Inga färgvariabler passar här." "No colour variables yet. Create them in Local variables." = "Inga färgvariabler än. Skapa dem i Lokala variabler." "No comments yet" = "Inga kommentarer än" @@ -1176,12 +1178,14 @@ name = "Svenska" "Select all with same" = "Markera alla med samma" "Select layer" = "Markera lager" "Select layers to apply the style to" = "Markera de lager som formatmallen ska användas på" +"Select layers with this color" = "Markera lager med den här färgen" "Select overlapping shapes" = "Markera överlappande former" "Select points to edit their position, radius and mirroring" = "Markera punkter för att redigera deras position, radie och spegling" "Select slot" = "Markera plats" "Selection" = "Markering" "Selection box, {w} by {h} at {x}, {y}: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Markeringsruta, {w} gånger {h} vid {x}, {y}: piltangenterna flyttar den, Shift+pilar eller {cmd}+pilar ändrar storleken, Enter markerar, Escape avbryter" "Selection box: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Markeringsruta: piltangenterna flyttar den, Shift+pilar eller {cmd}+pilar ändrar storleken, Enter markerar, Escape avbryter" +"Selection colors" = "Markeringsfärger" "Send backward" = "Flytta bakåt" "Send report" = "Skicka rapport" "Send to back" = "Flytta längst bak" @@ -2016,6 +2020,10 @@ name = "Svenska" "select.sameStroke" = "Markera samma kontur" "select.sameText" = "Markera samma textegenskaper" "select.set" = "Markera" +"selection.applyColorStyle" = "Använd färgformatmall på markeringen" +"selection.colors" = "Markeringsfärger" +"selection.selectColor" = "Markera lager med den här färgen" +"selection.setPaint" = "Ändra markeringens färg" "shape.arrow" = "Pil" "shape.ellipse" = "Ellips" "shape.line" = "Linje" diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml index cc002654d..788d7142c 100644 --- a/crates/ui-egui/locales/tr.toml +++ b/crates/ui-egui/locales/tr.toml @@ -642,6 +642,7 @@ name = "Türkçe" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Arayüz tasarımı ve prototipleme. Rust ile sıfırdan yazılmış, ücretsiz, açık kaynaklı, temiz oda yöntemiyle geliştirilmiş bir tasarım aracı; ArtCraft Crafting Apps ailesinin bir parçası." "Intersect" = "Kesiştir" "Intersects" = "Kesişir" +"Invalid color" = "Geçersiz renk" "Invite link" = "Davet bağlantısı" "Invite link copied" = "Davet bağlantısı kopyalandı" "It asks permission to:" = "Şunlar için izin istiyor:" @@ -808,6 +809,7 @@ name = "Türkçe" "No branches. A branch is a copy of the file to try changes in, then review and merge." = "Dal yok. Dal, değişiklikleri denemek, sonra gözden geçirip birleştirmek için dosyanın bir kopyasıdır." "No category" = "Kategori yok" "No changes" = "Değişiklik yok" +"No color styles" = "Renk stili yok" "No colour variables fit here." = "Buraya uyan renk değişkeni yok." "No colour variables yet. Create them in Local variables." = "Henüz renk değişkeni yok. Onları Yerel değişkenler'de oluşturun." "No comments yet" = "Henüz yorum yok" @@ -1165,12 +1167,14 @@ name = "Türkçe" "Select all with same" = "Aynı olanların tümünü seç" "Select layer" = "Katman seç" "Select layers to apply the style to" = "Stilin uygulanacağı katmanları seçin" +"Select layers with this color" = "Bu renkteki katmanları seç" "Select overlapping shapes" = "Çakışan şekilleri seç" "Select points to edit their position, radius and mirroring" = "Konumlarını, yarıçaplarını ve yansıtmalarını düzenlemek için noktaları seçin" "Select slot" = "Yuvayı seç" "Selection" = "Seçim" "Selection box, {w} by {h} at {x}, {y}: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Seçim kutusu, {x}, {y} konumunda {w} × {h}: oklar onu taşır, Shift+oklar veya {cmd}+oklar boyutlandırır, Enter seçer, Escape iptal eder" "Selection box: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Seçim kutusu: oklar onu taşır, Shift+oklar veya {cmd}+oklar boyutlandırır, Enter seçer, Escape iptal eder" +"Selection colors" = "Seçim renkleri" "Send backward" = "Geriye gönder" "Send report" = "Raporu gönder" "Send to back" = "En arkaya gönder" @@ -1996,6 +2000,10 @@ name = "Türkçe" "select.sameStroke" = "Aynı konturu seç" "select.sameText" = "Aynı metin özelliklerini seç" "select.set" = "Seç" +"selection.applyColorStyle" = "Seçime renk stili uygula" +"selection.colors" = "Seçim renkleri" +"selection.selectColor" = "Bu renkteki katmanları seç" +"selection.setPaint" = "Seçimin rengini değiştir" "shape.arrow" = "Ok" "shape.ellipse" = "Elips" "shape.line" = "Çizgi" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index 702cae7b8..3434832d0 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -620,6 +620,7 @@ status = "draft — needs native review" "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 系列。" "Intersect" = "相交" "Intersects" = "相交" +"Invalid color" = "无效颜色" "Invite link" = "邀请链接" "Invite link copied" = "已复制邀请链接" "It asks permission to:" = "它请求以下权限:" @@ -774,6 +775,7 @@ status = "draft — needs native review" "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 yet" = "还没有评论" @@ -1120,12 +1122,14 @@ status = "draft — needs native review" "Select all with same" = "选择所有相同" "Select layer" = "选择图层" "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 选择,Esc 取消" "Selection box: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "选框:方向键移动,Shift+方向键或 {cmd}+方向键调整大小,Enter 选择,Esc 取消" +"Selection colors" = "所选项颜色" "Send backward" = "下移一层" "Send report" = "发送举报" "Send to back" = "置于底层" @@ -1927,6 +1931,10 @@ status = "draft — needs native review" "select.sameStroke" = "选择相同描边" "select.sameText" = "选择相同文本属性" "select.set" = "选择" +"selection.applyColorStyle" = "将颜色样式应用于所选项" +"selection.colors" = "所选项颜色" +"selection.selectColor" = "选择使用此颜色的图层" +"selection.setPaint" = "更改所选项颜色" "shape.arrow" = "箭头" "shape.ellipse" = "椭圆" "shape.line" = "直线" From 8aa5fd1a3b096ce89e4b191b20981f4f8c1b9189 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 20:10:32 +0700 Subject: [PATCH 178/817] #595: drop the progress-doc edits --- docs/target-app-parity.md | 3 +-- docs/ui-parity.md | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index b599bb30c..c3842d4f0 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # FigCraft parity with Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (Smart-selection spacing fields and on-canvas gap handles (#402); number variables in the text content picker (#629); frames and sections convert into each other (#719); 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) · **Target:** Figma Design (desktop app 126.10.7, macOS) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (number variables in the text content picker (#629); frames and sections convert into each other (#719); 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) · **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 @@ -630,7 +630,6 @@ Carried over from the ROADMAP's "Shipped so far" (2026-10-10). The test count th |---|---|---| | 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | | 2026-10-17 | minor | Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. | -| 2026-10-15 | minor | Smart-selection spacing (#402): Layout fields and pink on-canvas handles adjust horizontal/vertical gaps for movable sibling rows, columns and aligned grids through `arrange.spacing`; mixed gaps normalize, track contents and sizes stay intact, one Undo step per scrub/drag, Escape cancels. Auto-layout flow children and locked/instance-internal layers are excluded. Numbers unchanged. | | 2026-10-14 | minor | Russian catalog (M9), reviewed and approved by VanTan: all 2,165 current entries, Русский in Preferences and regional ru tags. Russian integer plurals use one/few/many; contributor display name VanTan added. Existing estimates unchanged. | | 2026-10-13 | minor | Vector edit mode regions: the filled area under the pointer is hatched (clear of points and segments, holes left out, spacing by octave folding fitted to measurements at several zoom levels, fixed to the shape); click, Shift-click and drag select and move areas with their points (drawn unselected); a click on an empty spot clears them and stays in edit mode (see [ui-parity](ui-parity.md)) | | 2026-10-13 | minor | Plugin log limits (#191): cap each UTF-8 line at 8 KiB, total log bytes at 1 MiB and lines at 1,000 per run/callback before copying guest memory or forwarding to the host. Over-budget runs fail and roll back document edits; callbacks get fresh budgets. Added sandbox boundary/forwarding tests and an engine rollback regression. Percentages and hours unchanged. | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 116dcbb66..62001715e 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-10-15 · **Change:** minor (Smart-selection spacing fields and on-canvas gap handles (#402); fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-15 · **Change:** minor (fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **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: @@ -65,7 +65,6 @@ interaction feel not yet compared. | Ctrl to suspend snapping while dragging (macOS) | done | Control on macOS (Cmd keeps working), Ctrl elsewhere; moving, resizing and drawing | | Measure (Alt hover, Cmd+Alt nested, Shift+Alt padding/gaps) | done | labels never overlap | | Pixel grid snapping, pixel preview, 2x preview | done | moves, resizes and new shapes land on whole pixels; the pixel grid shows from 400% (`view_behaviour_tests`) | -| Smart-selection spacing: numeric fields and canvas handles | done | Layout shows Horizontal/Vertical spacing for movable sibling rows, columns and aligned grids (up to 2,000 layers). Gaps are between track bounds: moving a column/row preserves its internal offsets and sizes. Mixed gaps can be normalized by typing or dragging a handle. Panel, pointer input and drawing share a cached layout; stationary or sub-step drags do not dispatch another edit. Pink gap handles show on hover, report live distances, respect zoom and commit one Undo step; Shift rounds to 10, Alt to 0.1, Escape cancels, release outside the canvas finishes. Parent/child or different-parent selections, auto-layout flow children, locked/hidden layers and instance internals have no spacing controls. This adds gap editing only, not the smart-selection reorder rings (`selection_spacing` engine/UI tests). | | Numeric fields: arithmetic, scrubbing by dragging the label, mixed values | done | Numeric panels use `widgets::number_field`; Typography line height, letter spacing and paragraph spacing share its leading-icon scrub logic (#373), retaining their existing unit parsing, Auto/Mixed values, variable chips and selected-character targeting (`typography_scrub_tests`). Scrubbing the label: a step a point (1 px; 1% of opacity, 1° of rotation), ten with Shift, a tenth with Alt, each stretch at the rate held while it was dragged, one undo step when let go; past the edge of the screen it goes on where the platform reports the mouse's own motion (desktop), otherwise it stops there. Arrow keys: Up/Down step a pixel field by the small nudge and Shift by the big nudge (the preferences), other fields by their own step and ten of it; they work while typing (from what is typed) and with the keyboard on the field. Typing: `+ - * /`, brackets, units (`px`, `°`, `%`, `x`, `ms`), a decimal comma; `+10`, `*2`, `/4` are relative to the value, and `50%`, `+10%`, `-10%` too in a field that isn't a percentage. Enter, Tab or a click elsewhere commits (Tab and Shift+Tab move to the next and previous control), Escape restores; a field left as it was commits nothing (no undo step, and a rounded display isn't written back). Mixed values show "Mixed": a number sets them all, a relative edit or an arrow key goes to each layer from its own value in one undo step, for X, Y, W, H, rotation, opacity, corner radius and stroke weight (elsewhere `+10` on Mixed sets 10 and `*2` does nothing) (`field_tests`). Left: scrubbing a Mixed field (nothing happens), `x2`-style suffix edits, the pointer isn't wrapped to the other side of the screen; rates not compared with Figma's | | Transform box at small sizes | done | a press inside a layer smaller than its handles moves it, the nearest handle wins, handles answer just outside and are hidden under 16 px on screen; cursors follow each handle and the box's rotation | | Locked layers | done | selectable from the layers panel; no handles, not dragged with the rest of a selection | @@ -167,7 +166,6 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| -| 2026-10-15 | minor | Smart-selection spacing (#402): Layout fields and pink on-canvas handles adjust horizontal/vertical gaps for movable sibling rows, columns and aligned grids through `arrange.spacing`; mixed gaps normalize, track contents and sizes stay intact, one Undo step per scrub/drag, Escape cancels. Auto-layout flow children and locked/instance-internal layers are excluded. Numbers unchanged. | | 2026-10-15 | minor | Hex fields take CSS colour names (`red` → `FF0000`): fills, strokes, effects, grids, variables, backgrounds and the colour picker | | 2026-10-15 | minor | Typography: drag the line-height, letter-spacing and paragraph-spacing icons to scrub their values; shared numeric-field rates, resize cursor and one Undo step per gesture (#373). | | 2026-10-15 | minor | A click or Tab into a one-line field selects all of its text (hex, inline, name, search and dialog fields); the first click into a fill's hex takes the keyboard | From 6b52bddc5b4624fc494907ad91e4c8216277cbe8 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 20:10:33 +0700 Subject: [PATCH 179/817] #595: arrange.spacing label in the Swedish catalog --- crates/ui-egui/locales/sv.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index 51f165084..e173bd758 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -1707,6 +1707,7 @@ name = "Svenska" "arrange.packH" = "Packa horisontellt" "arrange.packV" = "Packa vertikalt" "arrange.roundToPixels" = "Avrunda till pixlar" +"arrange.spacing" = "Avstånd" "arrange.tidy" = "Snygga till" "bool.exclude" = "Uteslut markering" "bool.flatten" = "Platta till boolesk form" From cc10c0de557f6306611c5c671a6fc2c0e18bb43a Mon Sep 17 00:00:00 2001 From: Ivan Shishkanov Date: Sat, 17 Oct 2026 16:13:47 +0300 Subject: [PATCH 180/817] M7: use native macOS paste modifiers in tests --- crates/ui-egui/src/paste_image_tests.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/paste_image_tests.rs b/crates/ui-egui/src/paste_image_tests.rs index 48bd142e0..b6775f93a 100644 --- a/crates/ui-egui/src/paste_image_tests.rs +++ b/crates/ui-egui/src/paste_image_tests.rs @@ -163,7 +163,8 @@ impl Win { } } -const CMD: Modifiers = Modifiers::COMMAND.plus(Modifiers::CTRL); +// egui sets `command` for Cmd on macOS and for Ctrl elsewhere; macOS Ctrl is a separate key. +const CMD: Modifiers = if cfg!(target_os = "macos") { Modifiers::COMMAND } else { Modifiers::COMMAND.plus(Modifiers::CTRL) }; fn key(key: Key, pressed: bool, modifiers: Modifiers) -> Event { Event::Key { key, physical_key: Some(key), pressed, repeat: false, modifiers } From 88925c2f820eb176a03df2245c2a82502da41e09 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 20:17:02 +0700 Subject: [PATCH 181/817] #537: drop the progress-doc edits --- ROADMAP.md | 5 +---- docs/gaps.md | 15 +-------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 82b6c4c00..2dcc2b9bb 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (responsive presenter device sizing, bare tablet and computer screens; presenter tab, device picker and thumbnail; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -318,9 +318,6 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | | 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | | 2026-10-17 | minor | Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. | -| 2026-10-16 | minor | The full presenter now scrolls content beyond a responsive phone or tablet screen in both directions. A drag that starts inside the screen continues when the pointer leaves it; the device body stays fixed. Computer presets keep their ordinary scrolling rules. The unsaved-changes dialog appears over presentation when closing a window. The saved design is unchanged. Numbers unchanged. | -| 2026-10-16 | minor | Choosing a device in the presenter now enables responsive layout at that device's screen size, clears offsets from the previous screen, and lets No device restore the design's frame size. Tablet and computer presets show a bare screen at their resolution; phones keep their device body. The saved frame geometry is unchanged. Numbers unchanged. | -| 2026-10-15 | minor | Presenter has a separate tab, keeps its current screen when returning to design, and adds a frame thumbnail, device picker and scale controls. Numbers unchanged. | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | | 2026-10-15 | minor | Drop files anywhere to open them (M7): dragging files over the window shows a "Drop to open" (home) or "Drop to import" (canvas) overlay. On the home screen each supported file opens as a document of its own and other files are turned away with a toast; on the canvas the files import at the drop point. Both wait behind a small card that is on screen before a large file blocks the window. A canvas import stays with the document and page that received the drop even if the tab or page changes meanwhile, and is cancelled with a message if that document or page is gone. Numbers unchanged. | | 2026-10-15 | minor | M7: system font discovery skips entries observed as non-regular files before opening them, avoiding the reproduced named-pipe stall. Regular-file symlinks remain supported; directory depth, font limits and priorities are unchanged. Numbers unchanged. | diff --git a/docs/gaps.md b/docs/gaps.md index 94c387e53..e8b111a8d 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Where FigCraft falls short of Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (responsive presenter device sizing and bare tablet and computer screens; presenter navigation and device controls; bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-15 · **Change:** minor (bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) Every known shortfall against Figma, one entry each, ranked by how much it stops a Figma user from doing real work in FigCraft. Agents: pick work from the top unless the owner says otherwise. The @@ -138,17 +138,6 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe cursor for every tool and modifier, panel widths, dark pages (`field_tests`, `cursor_tests`, `cursors_tests`, `outline_options_tests`, `hide_publishing_tests`, `panel_width_tests`, `theme_pages_tests`). -- **Landed (2026-10-15):** presentation keeps its own tab beside the design, preserves the - current screen when switching back to edit, shows a small current-screen preview and offers - screen, device and scale controls (`present_view_tests`). -- **Landed (2026-10-16):** choosing a presenter device reflows a copy of the frame to its screen - size using constraints and auto layout, clears the previous screen's scroll and pan, and keeps - the file's frame geometry unchanged; No device restores the original size. Tablet and computer - presets show the screen at their resolution without a drawn hardware body. In the full presenter, - dragging inside a phone or tablet scrolls content in either direction when it exceeds the screen, - even when the pointer moves outside the device. The device remains fixed; computer presets keep - their ordinary scrolling rules. These gestures do not alter the file. Closing a window from - presentation shows the unsaved-changes dialog over the presenter. - **Evidence:** ROADMAP item 7 ("Left: tool by tool, panel by panel against the incumbent"). - **Impact:** Figma users notice the feel within minutes; it decides whether they stay. - **Estimate:** 40–60 h. Detail in [`ui-parity.md`](ui-parity.md). @@ -411,8 +400,6 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe | Date | Change | Summary | |---|---|---| -| 2026-10-16 | minor | Gap 4: presenter device selection now uses responsive layout at the selected screen size and resets stale offsets; tablets and computers show bare screens, and the original frame is preserved. Estimates and ranking unchanged. | -| 2026-10-15 | minor | Gap 4: presenter tab, thumbnail, device picker and scale controls. Estimates and ranking unchanged. | | 2026-10-15 | minor | Gap 7: bounded canvas overscan for smoother panning. Estimates and ranking unchanged. | | 2026-10-14 | minor | Russian catalog (M9), reviewed and approved by VanTan: all 2,165 current entries, Русский in Preferences and regional ru tags. Russian integer plurals use one/few/many; contributor display name VanTan added. Existing estimates unchanged. | | 2026-10-13 | minor | Gap 1: the experimental `.fig` export writes instance sizes (resized, filling an auto layout, scaled), variables with modes and bindings, shared styles and variable-width strokes, and the import reads them back. Checked by opening written files in other software: resized and scaled instances keep their size and lay their layers out for it, variables with their modes and colour bindings resolve there (a frame set to another mode shows that mode's colours, also inside instances), colour, text, effect and grid styles are listed, and variable-width strokes that are the same on both sides of the path draw with their width; number, string and boolean bindings and bindings on effects, layout guides and gradient stops come across as the values they give but did not show as bound there (their entries now also name the layer field they set, not yet checked there), and strokes wider on one side of the path are written as filled outlines, no longer editable strokes there (the stroke itself is kept as plugin data and our own import puts it back; not yet checked there). Hours and the ranking unchanged | From e77a02993ed4d2d89d90c72e945bf368d1d386f4 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 20:17:04 +0700 Subject: [PATCH 182/817] #537: remove the two screenshots nothing references --- ATTRIBUTION.md | 2 -- docs/images/shot-8-presenter-tab.png | Bin 75341 -> 0 bytes docs/images/shot-9-device-picker.png | Bin 106019 -> 0 bytes 3 files changed, 2 deletions(-) delete mode 100644 docs/images/shot-8-presenter-tab.png delete mode 100644 docs/images/shot-9-device-picker.png diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md index cf2e7e632..1f72aeb7c 100644 --- a/ATTRIBUTION.md +++ b/ATTRIBUTION.md @@ -14,8 +14,6 @@ MIT OR Apache-2.0. No third-party icon sets are used. | `assets/app-icon/` (all files: `figcraft.svg`, `figcraft-small.svg`, `figcraft-*.png`, `figcraft.ico`, `hicolor/`) | The project owner (engraving-style drawing, vectorised) | Original work, see [`assets/app-icon/README.md`](assets/app-icon/README.md); derived files rendered by `cargo xtask icon` | MIT OR Apache-2.0, [`assets/app-icon/LICENSE.txt`](assets/app-icon/LICENSE.txt) | FigCraft app icon (chameleon) | | `docs/brand/artcraft-logo.svg`, `docs/brand/artcraft-logo.png`, `docs/brand/artcraft-logo-white.svg`, `docs/brand/artcraft-logo-white.png`, `docs/brand/artcraft-mark.svg`, `docs/brand/artcraft-mark.png`, `docs/brand/artcraft-mark-black.svg`, `docs/brand/artcraft-mark-black.png` | ArtCraft Team | storytold/craftrules `assets/brand/` | ArtCraft brand terms (`docs/brand/LICENSE-brand.txt`), not open source | Trademarks; unmodified use within FigCraft only | | `docs/images/` (all screenshots and exports: `shot-*.png`, `art-*.png`) | FigCraft contributors | Screenshots of FigCraft showing synthetic demo documents made in FigCraft, and PNG exports of those documents by FigCraft's renderer | MIT OR Apache-2.0 | No third-party artwork | -| `docs/images/shot-8-presenter-tab.png` | @YarilaFox | Original screenshot of FigCraft presenting a synthetic document made in FigCraft | MIT OR Apache-2.0 | Presenter tab and top bar; no third-party artwork | -| `docs/images/shot-9-device-picker.png` | @YarilaFox | Original screenshot of FigCraft presenting a synthetic document made in FigCraft | MIT OR Apache-2.0 | Device and scale controls; no third-party artwork | | `examples/*.figcraft` | FigCraft contributors | Synthetic demo documents built through FigCraft's command API; invented copy, shapes and vectors drawn from scratch, no images or embedded fonts | MIT OR Apache-2.0 | Text uses Inter (OFL, from craft-fonts or the system); no third-party artwork | ## Fonts (build input, not in this repository) diff --git a/docs/images/shot-8-presenter-tab.png b/docs/images/shot-8-presenter-tab.png deleted file mode 100644 index d5cee8e179bebf78e69afdb7311d460c4a5a072c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 75341 zcmeFa2~<>9);3&@s6=syL1PrBNGHaWN)!jA9HYiWI!POnsFXt@NgPm#VdgqU4JsOA z(4df^({{8KZCeoqN)$ySSTRP?fE1IUqCin1RZ!IZ_uh9pm%-%yzVH9m`>pk^)hjJf zb?>?7?EUO#KYO2ZH~)3!)Q%mV?V!Q9`7Mp6&9@p&tM%>L!f$-v`1)5(i$PCM zpFH7j!7U!1Y4z>E_rAVh=7Y+&Ud-ITa>l~LOLI<$|ND4L+}E!q#0~f8UvB#>@srSh zY#h7zdP3gH%R@@|?Nhz0c6i;J?o)W+pku(p2M?BC=k;M>VRKeppXEEZ!GEd~UR~bA zucc4%=5~iq-9K=!ng8heq&2>z^j+Wji~%Q`|Ly@kxOJo9$lsk??G~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Y$XITuLH4; zYaeUa6S(K}4I=u&e<^5R?(&E&cJw2PpUpTAuClwCkjaWRw>uEHAXV3g0ps z*MZ;{r-#f)?U`)r-f8=mIJ1tKxg9gztk5HrJ8O?fze#YhnOJrU}V;3HADu z@c`P}2ZE-gTun9@ssZwAly&6(3CO=f((8CB8nmA>pJJBoLQA}x25wxEX71=?H6qB z3jrx$H)c^~i3j_(G&`^dV#L=doFtfK_7H-^%2vTwX^83P5tTL&8{LuSoa5aflCO;U zIxe?gcWs!LVJdyk0ev0WB;pv7Ok==(w;oF;NVLHPvhnfXwwHNtmEABI02H4f@fRSD zCcsih65B>OT(C+{gRM1f`|%+HOG+InWe)p1+wFOD-F4qxws`-HVs*>YuodYj(lFFe zV|HfJet>&0!kyGu5P3Q3s7`j4Z6NUvL>qf3o)9mQHLw#?tjUA$Px8Iw)}v`8Jl9iQ z1H|jysm1NmSVVj*DW2u1JOz+BY>lnJ(Qc^i5B9G6fWBw6_mHRB<_V=R$p#-aCW8j~ zotF0z-SkRk6@-`WSSRSmTJLc;`KG1?jDWx=gtb*rKIuadJEDqp5Zk@DGfq{eHA50wO7lZI=NFPKI9N=Mm?fMl)?vX*@Z~t zvb9&rpZ+zTODQ>3CigFhx1UKT{{Kn)FpIF$!ksTR4KZEcT4)J?|GhA0-m^JRFWvnA E02Al^oB#j- diff --git a/docs/images/shot-9-device-picker.png b/docs/images/shot-9-device-picker.png deleted file mode 100644 index 2f4805154b9cef0c9e122acc1c8c7ed484c1d72e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 106019 zcmeFa3s{Wl8$UkDImtOhIYbUih(c+cb68q-+t#T;s}_-j&b>KSLe5DvyDWCKq-~R^ zMoOVFYe`X>P73KTjWkm;^ZxGpnZx@=_WS++4*%=-zpnpv?bUXedFFZUNUi??TwtE7+G*)|-r zdArcQ>}rg1c+LCw+wy3hpP%3Aop}z9Yd-nX7(0Jk8^6}PiWYaie*4|km@jd?Nw z7|R~mZEsUPf`R`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>mu-Dky?bEkp{&Lm`CCbOEy9th-0t~be+*@|x!t_mBJYiE3<6Z|({~+dMJQy%z$ZOh@D|^DX?5SYJL^ z047Z`*+v=uq_qOg1)`0Sx0JOXuyMA_J9Wxhjyp}=CYXn{8PkBxl#g1;%3$hcmnX^b ztfUhK&SfyT)jdi@}RppI|=E; zT!_&bK&o}_AKK0u4R@pQlKPhtWRSlIS8dSM{N4`G@O{gmI-m(~cLIeXEj{IENKP8# ze_*=ByDlj>3(vQ^8ED>Td?dgU`m@jK5*$o5=8u~NfjNSiDYWWg<*uc+w1tYxLLM@{ ze9BXJl3;rf91S{nUoc2di7G3L(oa>|J#oJn)gYydIOowQ<)MK ILUZqjTh)0r*Z=?k From 725e2c6913aeeab509507de738b9156278cbc7b8 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 20:17:14 +0700 Subject: [PATCH 183/817] #537: presenter strings in every catalog --- crates/ui-egui/locales/cs.toml | 4 ++++ crates/ui-egui/locales/de.toml | 4 ++++ crates/ui-egui/locales/fr.toml | 4 ++++ crates/ui-egui/locales/id.toml | 4 ++++ crates/ui-egui/locales/ja.toml | 4 ++++ crates/ui-egui/locales/ko.toml | 4 ++++ crates/ui-egui/locales/pt-BR.toml | 4 ++++ crates/ui-egui/locales/ru.toml | 4 ++++ crates/ui-egui/locales/sv.toml | 4 ++++ crates/ui-egui/locales/tr.toml | 4 ++++ crates/ui-egui/locales/zh-Hans.toml | 4 ++++ 11 files changed, 44 insertions(+) diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml index 2459d104a..24a1f8d52 100644 --- a/crates/ui-egui/locales/cs.toml +++ b/crates/ui-egui/locales/cs.toml @@ -333,6 +333,7 @@ status = "draft — needs native review" "Current version" = "Aktuální verze" "Cursor chat" = "Chat u kurzoru" "Custom" = "Vlastní" +"Custom size" = "Vlastní velikost" "Cut" = "Vyjmout" "Dark" = "Tmavý" "Darken" = "Ztmavit" @@ -795,6 +796,7 @@ status = "draft — needs native review" "Nested instance" = "Vnořená instance" "New design file" = "Nový soubor návrhu" "Newest first" = "Od nejnovějších" +"Next frame" = "Další rámec" "Next or previous control in the focused region" = "Další nebo předchozí ovládací prvek v zaměřené oblasti" "Next ready for dev" = "Další připravené pro vývoj" "Next size option" = "Další možnost velikosti" @@ -811,6 +813,7 @@ status = "draft — needs native review" "No components yet. Select layers and press {keys}." = "Zatím žádné komponenty. Vyberte vrstvy a stiskněte {keys}." "No conflicts." = "Žádné konflikty." "No contributor data was built into this copy." = "Toto sestavení neobsahuje údaje o přispěvatelích." +"No device" = "Bez zařízení" "No fonts match" = "Žádná odpovídající písma" "No join code here (the server is older than join codes, or this address can't be put in one): share the link instead." = "Kód pro připojení není dostupný (server kódy nepodporuje nebo tuto adresu nelze do kódu vložit): sdílejte odkaz." "No layer changes to show." = "Žádné změny vrstev k zobrazení." @@ -994,6 +997,7 @@ status = "draft — needs native review" "Preview" = "Náhled" "Preview this flow" = "Náhled tohoto toku" "Preview this frame" = "Náhled tohoto rámce" +"Previous frame" = "Předchozí rámec" "Previous ready for dev" = "Předchozí připravené pro vývoj" "Progressive" = "Postupné" "Properties" = "Vlastnosti" diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index b679feb71..51a480d48 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -329,6 +329,7 @@ status = "draft — needs native review" "Current version" = "Aktuelle Version" "Cursor chat" = "Cursor-Chat" "Custom" = "Benutzerdefiniert" +"Custom size" = "Benutzerdefinierte Größe" "Cut" = "Ausschneiden" "Dark" = "Dunkel" "Darken" = "Abdunkeln" @@ -768,6 +769,7 @@ status = "draft — needs native review" "Navigate to" = "Navigieren zu" "Nested instance" = "Verschachtelte Instanz" "New design file" = "Neue Designdatei" +"Next frame" = "Nächster Rahmen" "Next or previous control in the focused region" = "Nächstes oder vorheriges Steuerelement im fokussierten Bereich" "Next ready for dev" = "Nächstes bereit für Entwicklung" "Next size option" = "Nächste Größenoption" @@ -784,6 +786,7 @@ status = "draft — needs native review" "No components yet. Select layers and press {keys}." = "Noch keine Komponenten. Wählen Sie Ebenen aus und drücken Sie {keys}." "No conflicts." = "Keine Konflikte." "No contributor data was built into this copy." = "Diese Kopie enthält keine Daten zu Mitwirkenden." +"No device" = "Kein Gerät" "No fonts match" = "Keine passenden Schriften" "No join code here (the server is older than join codes, or this address can't be put in one): share the link instead." = "Hier gibt es keinen Beitrittscode (der Server ist älter als Beitrittscodes, oder diese Adresse passt in keinen): Teilen Sie stattdessen den Link." "No layer changes to show." = "Keine Ebenenänderungen vorhanden." @@ -960,6 +963,7 @@ status = "draft — needs native review" "Preview" = "Vorschau" "Preview this flow" = "Vorschau dieses Ablaufs" "Preview this frame" = "Vorschau dieses Rahmens" +"Previous frame" = "Vorheriger Rahmen" "Previous ready for dev" = "Vorheriges bereit für Entwicklung" "Progressive" = "Progressiv" "Properties" = "Eigenschaften" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 1c561f15e..60985e5e1 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -328,6 +328,7 @@ status = "draft — needs native review" "Current version" = "Version actuelle" "Cursor chat" = "Chat au curseur" "Custom" = "Personnalisé" +"Custom size" = "Taille personnalisée" "Cut" = "Couper" "Dark" = "Sombre" "Darken" = "Assombrir" @@ -764,6 +765,7 @@ status = "draft — needs native review" "Navigate to" = "Naviguer vers" "Nested instance" = "Instance imbriquée" "New design file" = "Nouveau fichier de design" +"Next frame" = "Cadre suivant" "Next or previous control in the focused region" = "Contrôle suivant ou précédent dans la région active" "Next ready for dev" = "Prêt pour le dev suivant" "Next size option" = "Option de taille suivante" @@ -780,6 +782,7 @@ status = "draft — needs native review" "No components yet. Select layers and press {keys}." = "Aucun composant pour l’instant. Sélectionnez des calques et appuyez sur {keys}." "No conflicts." = "Aucun conflit." "No contributor data was built into this copy." = "Cette copie ne contient aucune donnée de contributeurs." +"No device" = "Aucun appareil" "No fonts match" = "Aucune police ne correspond" "No join code here (the server is older than join codes, or this address can't be put in one): share the link instead." = "Pas de code d’accès ici (le serveur est antérieur aux codes d’accès, ou cette adresse ne tient pas dans un code) : partagez plutôt le lien." "No layer changes to show." = "Aucune modification de calque à afficher." @@ -954,6 +957,7 @@ status = "draft — needs native review" "Preview" = "Aperçu" "Preview this flow" = "Prévisualiser ce flux" "Preview this frame" = "Prévisualiser ce cadre" +"Previous frame" = "Cadre précédent" "Previous ready for dev" = "Prêt pour le dev précédent" "Progressive" = "Progressif" "Properties" = "Propriétés" diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml index 7a0a3c3ce..52a2bda65 100644 --- a/crates/ui-egui/locales/id.toml +++ b/crates/ui-egui/locales/id.toml @@ -337,6 +337,7 @@ status = "draft — needs native review" "Current version" = "Versi saat ini" "Cursor chat" = "Chat kursor" "Custom" = "Kustom" +"Custom size" = "Ukuran kustom" "Cut" = "Potong" "Dark" = "Gelap" "Darken" = "Gelapkan" @@ -799,6 +800,7 @@ status = "draft — needs native review" "Nested instance" = "Instance bersarang" "New design file" = "File desain baru" "Newest first" = "Terbaru dulu" +"Next frame" = "Frame berikutnya" "Next or previous control in the focused region" = "Kontrol berikutnya atau sebelumnya di wilayah yang difokuskan" "Next ready for dev" = "Siap dev berikutnya" "Next size option" = "Opsi ukuran berikutnya" @@ -815,6 +817,7 @@ status = "draft — needs native review" "No components yet. Select layers and press {keys}." = "Belum ada component. Pilih layer lalu tekan {keys}." "No conflicts." = "Tidak ada konflik." "No contributor data was built into this copy." = "Tidak ada data kontributor yang disertakan dalam salinan ini." +"No device" = "Tanpa perangkat" "No fonts match" = "Tidak ada font yang cocok" "No join code here (the server is older than join codes, or this address can't be put in one): share the link instead." = "Tidak ada kode gabung di sini (versi server lebih lama dari fitur kode gabung, atau alamat ini tidak dapat dimasukkan ke kode): bagikan link-nya saja." "No layer changes to show." = "Tidak ada perubahan layer untuk ditampilkan." @@ -998,6 +1001,7 @@ status = "draft — needs native review" "Preview" = "Pratinjau" "Preview this flow" = "Pratinjau alur ini" "Preview this frame" = "Pratinjau frame ini" +"Previous frame" = "Frame sebelumnya" "Previous ready for dev" = "Versi siap dev sebelumnya" "Progressive" = "Progresif" "Properties" = "Properti" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index b09db3bdd..4e6a532eb 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -340,6 +340,7 @@ status = "draft — needs native review" "Current version" = "現在のバージョン" "Cursor chat" = "カーソルチャット" "Custom" = "カスタム" +"Custom size" = "カスタムサイズ" "Cut" = "カット" "Dark" = "ダーク" "Darken" = "比較(暗)" @@ -804,6 +805,7 @@ status = "draft — needs native review" "Nested instance" = "ネストされたインスタンス" "New design file" = "新規デザインファイル" "Newest first" = "新しい順" +"Next frame" = "次のフレーム" "Next or previous control in the focused region" = "フォーカス中の領域で次または前のコントロール" "Next ready for dev" = "次の開発準備完了" "Next size option" = "次のサイズオプション" @@ -820,6 +822,7 @@ status = "draft — needs native review" "No components yet. Select layers and press {keys}." = "コンポーネントはまだない。レイヤーを選択して {keys} を押す。" "No conflicts." = "競合なし。" "No contributor data was built into this copy." = "このコピーには貢献者データが含まれていない。" +"No device" = "デバイスなし" "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." = "表示するレイヤーの変更なし。" @@ -1003,6 +1006,7 @@ status = "draft — needs native review" "Preview" = "プレビュー" "Preview this flow" = "このフローをプレビュー" "Preview this frame" = "このフレームをプレビュー" +"Previous frame" = "前のフレーム" "Previous ready for dev" = "前の開発準備完了" "Progressive" = "プログレッシブ" "Properties" = "プロパティ" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index f2cfcfff5..f999f9ad7 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -328,6 +328,7 @@ status = "draft — needs native review" "Current version" = "현재 버전" "Cursor chat" = "커서 채팅" "Custom" = "사용자 지정" +"Custom size" = "사용자 지정 크기" "Cut" = "잘라내기" "Dark" = "다크" "Darken" = "어둡게 하기" @@ -764,6 +765,7 @@ status = "draft — needs native review" "Navigate to" = "이동 대상" "Nested instance" = "중첩된 인스턴스" "New design file" = "새 디자인 파일" +"Next frame" = "다음 프레임" "Next or previous control in the focused region" = "포커스된 영역의 다음 또는 이전 컨트롤" "Next ready for dev" = "다음 개발 준비 완료" "Next size option" = "다음 크기 옵션" @@ -780,6 +782,7 @@ status = "draft — needs native review" "No components yet. Select layers and press {keys}." = "아직 컴포넌트가 없음. 레이어를 선택하고 {keys}를 누르세요." "No conflicts." = "충돌 없음." "No contributor data was built into this copy." = "이 사본에는 기여자 데이터가 포함되지 않음." +"No device" = "기기 없음" "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." = "표시할 레이어 변경 사항 없음." @@ -954,6 +957,7 @@ status = "draft — needs native review" "Preview" = "미리 보기" "Preview this flow" = "이 플로우 미리 보기" "Preview this frame" = "이 프레임 미리 보기" +"Previous frame" = "이전 프레임" "Previous ready for dev" = "이전 개발 준비 완료" "Progressive" = "점진적" "Properties" = "속성" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index e9e1300cf..ea4433279 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -327,6 +327,7 @@ status = "draft — needs native review" "Current version" = "Versão atual" "Cursor chat" = "Chat do cursor" "Custom" = "Personalizado" +"Custom size" = "Tamanho personalizado" "Cut" = "Recortar" "Dark" = "Escuro" "Darken" = "Escurecer" @@ -763,6 +764,7 @@ status = "draft — needs native review" "Navigate to" = "Navegar para" "Nested instance" = "Instância aninhada" "New design file" = "Novo arquivo de design" +"Next frame" = "Próximo quadro" "Next or previous control in the focused region" = "Controle seguinte ou anterior na região em foco" "Next ready for dev" = "Próximo pronto para dev" "Next size option" = "Próxima opção de tamanho" @@ -779,6 +781,7 @@ status = "draft — needs native review" "No components yet. Select layers and press {keys}." = "Ainda não há componentes. Selecione camadas e pressione {keys}." "No conflicts." = "Nenhum conflito." "No contributor data was built into this copy." = "Esta cópia não inclui dados de colaboradores." +"No device" = "Nenhum dispositivo" "No fonts match" = "Nenhuma fonte corresponde" "No join code here (the server is older than join codes, or this address can't be put in one): share the link instead." = "Não há código de acesso aqui (o servidor é anterior aos códigos de acesso, ou este endereço não cabe em um): compartilhe o link." "No layer changes to show." = "Nenhuma alteração de camada para mostrar." @@ -953,6 +956,7 @@ status = "draft — needs native review" "Preview" = "Visualização" "Preview this flow" = "Visualizar este fluxo" "Preview this frame" = "Visualizar este quadro" +"Previous frame" = "Quadro anterior" "Previous ready for dev" = "Anterior pronto para dev" "Progressive" = "Progressivo" "Properties" = "Propriedades" diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 2023b6929..e02e12a1a 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -334,6 +334,7 @@ name = "Русский" "Current version" = "Текущая версия" "Cursor chat" = "Чат у курсора" "Custom" = "Пользовательский" +"Custom size" = "Пользовательский размер" "Cut" = "Вырезать" "Dark" = "Тёмная" "Darken" = "Затемнение" @@ -796,6 +797,7 @@ name = "Русский" "Nested instance" = "Вложенный экземпляр" "New design file" = "Новый файл дизайна" "Newest first" = "Сначала новые" +"Next frame" = "Следующий Frame" "Next or previous control in the focused region" = "Следующий или предыдущий элемент в активной области" "Next ready for dev" = "Следующий готовый к разработке" "Next size option" = "Следующий вариант размера" @@ -812,6 +814,7 @@ name = "Русский" "No components yet. Select layers and press {keys}." = "Компонентов пока нет. Выделите слои и нажмите {keys}." "No conflicts." = "Конфликтов нет." "No contributor data was built into this copy." = "В этой сборке нет данных об участниках." +"No device" = "Без устройства" "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." = "Нет изменений слоёв для показа." @@ -996,6 +999,7 @@ name = "Русский" "Preview" = "Предпросмотр" "Preview this flow" = "Предпросмотр этого сценария" "Preview this frame" = "Предпросмотр этого Frame" +"Previous frame" = "Предыдущий Frame" "Previous ready for dev" = "Предыдущий готовый к разработке" "Progressive" = "Прогрессивный" "Properties" = "Свойства" diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index 51f165084..472b83b17 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -339,6 +339,7 @@ name = "Svenska" "Current version" = "Aktuell version" "Cursor chat" = "Markörchatt" "Custom" = "Anpassad" +"Custom size" = "Anpassad storlek" "Cut" = "Klipp ut" "Dark" = "Mörk" "Darken" = "Mörkare" @@ -806,6 +807,7 @@ name = "Svenska" "Nested instance" = "Kapslad instans" "New design file" = "Ny designfil" "Newest first" = "Nyaste först" +"Next frame" = "Nästa ram" "Next or previous control in the focused region" = "Nästa eller föregående kontroll i den fokuserade regionen" "Next ready for dev" = "Nästa redo för utveckling" "Next size option" = "Nästa storleksalternativ" @@ -822,6 +824,7 @@ name = "Svenska" "No components yet. Select layers and press {keys}." = "Inga komponenter än. Markera lager och tryck på {keys}." "No conflicts." = "Inga konflikter." "No contributor data was built into this copy." = "Inga uppgifter om bidragsgivare finns inbyggda i den här kopian." +"No device" = "Ingen enhet" "No fonts match" = "Inga typsnitt matchar" "No join code here (the server is older than join codes, or this address can't be put in one): share the link instead." = "Ingen anslutningskod här (servern är äldre än anslutningskoder, eller så kan den här adressen inte göras om till en): dela länken i stället." "No layer changes to show." = "Inga lagerändringar att visa." @@ -1007,6 +1010,7 @@ name = "Svenska" "Preview" = "Förhandsgranskning" "Preview this flow" = "Förhandsgranska det här flödet" "Preview this frame" = "Förhandsgranska den här ramen" +"Previous frame" = "Föregående ram" "Previous ready for dev" = "Föregående redo för utveckling" "Progressive" = "Progressiv" "Properties" = "Egenskaper" diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml index cc002654d..4de75c8a8 100644 --- a/crates/ui-egui/locales/tr.toml +++ b/crates/ui-egui/locales/tr.toml @@ -337,6 +337,7 @@ name = "Türkçe" "Current version" = "Geçerli sürüm" "Cursor chat" = "İmleç sohbeti" "Custom" = "Özel" +"Custom size" = "Özel boyut" "Cut" = "Kes" "Dark" = "Koyu" "Darken" = "Koyulaştır" @@ -799,6 +800,7 @@ name = "Türkçe" "Nested instance" = "İç içe örnek" "New design file" = "Yeni tasarım dosyası" "Newest first" = "Önce en yeni" +"Next frame" = "Sonraki çerçeve" "Next or previous control in the focused region" = "Odaklanılan bölgedeki sonraki veya önceki denetim" "Next ready for dev" = "Sonraki geliştirmeye hazır" "Next size option" = "Sonraki boyut seçeneği" @@ -815,6 +817,7 @@ name = "Türkçe" "No components yet. Select layers and press {keys}." = "Henüz bileşen yok. Katmanları seçip {keys} tuşlarına basın." "No conflicts." = "Çakışma yok." "No contributor data was built into this copy." = "Bu kopyaya katkıda bulunan verisi eklenmemiş." +"No device" = "Cihaz yok" "No fonts match" = "Eşleşen yazı tipi yok" "No join code here (the server is older than join codes, or this address can't be put in one): share the link instead." = "Burada katılma kodu yok (sunucu katılma kodlarından eski veya bu adres bir koda sığmıyor): bunun yerine bağlantıyı paylaşın." "No layer changes to show." = "Gösterilecek katman değişikliği yok." @@ -998,6 +1001,7 @@ name = "Türkçe" "Preview" = "Önizleme" "Preview this flow" = "Bu akışı önizle" "Preview this frame" = "Bu çerçeveyi önizle" +"Previous frame" = "Önceki çerçeve" "Previous ready for dev" = "Önceki geliştirmeye hazır" "Progressive" = "Aşamalı" "Properties" = "Özellikler" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index 702cae7b8..8ea0d6a9c 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -329,6 +329,7 @@ status = "draft — needs native review" "Current version" = "当前版本" "Cursor chat" = "光标聊天" "Custom" = "自定义" +"Custom size" = "自定义大小" "Cut" = "剪切" "Dark" = "深色" "Darken" = "变暗" @@ -765,6 +766,7 @@ status = "draft — needs native review" "Navigate to" = "导航到" "Nested instance" = "嵌套实例" "New design file" = "新建设计文件" +"Next frame" = "下一个画框" "Next or previous control in the focused region" = "聚焦区域中的下一个或上一个控件" "Next ready for dev" = "下一个可供开发" "Next size option" = "下一个尺寸选项" @@ -781,6 +783,7 @@ status = "draft — needs native review" "No components yet. Select layers and press {keys}." = "还没有组件。选择图层并按 {keys}。" "No conflicts." = "没有冲突。" "No contributor data was built into this copy." = "此副本未内置贡献者数据。" +"No device" = "无设备" "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." = "没有可显示的图层更改。" @@ -955,6 +958,7 @@ status = "draft — needs native review" "Preview" = "预览" "Preview this flow" = "预览此流程" "Preview this frame" = "预览此画框" +"Previous frame" = "上一个画框" "Previous ready for dev" = "上一个可供开发" "Progressive" = "渐进" "Properties" = "属性" From acfc0352c3fde75f2c717a39863a60a2993986fc Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 20:22:44 +0700 Subject: [PATCH 184/817] #537: frames scroll on phones only as their overflow allows; tablets and laptops keep their device body --- crates/ui-egui/src/present.rs | 109 +++++++++++++++------------------- 1 file changed, 48 insertions(+), 61 deletions(-) diff --git a/crates/ui-egui/src/present.rs b/crates/ui-egui/src/present.rs index 5a9d4bf37..863b540fa 100644 --- a/crates/ui-egui/src/present.rs +++ b/crates/ui-egui/src/present.rs @@ -541,13 +541,7 @@ impl Presenter { /// device's screen, other frames within themselves. fn range(&self, doc: &Document, frame: NodeId) -> (f64, f64) { let vp = if frame == self.current { viewport(doc, frame) } else { None }; - // In a responsive preview, make content outside the device reachable even if the source - // frame has no overflow mode. Its settings and geometry stay untouched in the file. - let mobile = frame == self.current && page_settings(doc, frame).device().is_some_and(|d| d.rotates); - let overflow = doc - .node(frame) - .map_or(Overflow::None, |n| if mobile && self.fit.is_some() && n.overflow == Overflow::None { Overflow::Both } else { n.overflow }); - scroll_range_with_overflow(doc, frame, vp, overflow) + scroll_range_in(doc, frame, vp) } /// What "Scroll to" `dest` moves: every scrolling frame around it, innermost first, brings the @@ -1177,13 +1171,8 @@ pub fn scroll_range(doc: &Document, frame: NodeId) -> (f64, f64) { /// frame taller than the screen scrolls through its whole height. Without a viewport the frame /// shows at its own size and what overflows it scrolls. Only the axes its overflow allows scroll. pub fn scroll_range_in(doc: &Document, frame: NodeId, viewport: Option<(f64, f64)>) -> (f64, f64) { - let overflow = doc.node(frame).map_or(Overflow::None, |n| n.overflow); - scroll_range_with_overflow(doc, frame, viewport, overflow) -} - -fn scroll_range_with_overflow(doc: &Document, frame: NodeId, viewport: Option<(f64, f64)>, overflow: Overflow) -> (f64, f64) { let Some(n) = doc.node(frame) else { return (0.0, 0.0) }; - if overflow == Overflow::None { + if n.overflow == Overflow::None { return (0.0, 0.0); } let (mut x1, mut y1) = (0.0f64, 0.0f64); @@ -1208,8 +1197,8 @@ fn scroll_range_with_overflow(doc: &Document, frame: NodeId, viewport: Option<(f } None => (n.width, n.height), }; - let rx = if matches!(overflow, Overflow::Horizontal | Overflow::Both) { (x1 - vw).max(0.0) } else { 0.0 }; - let ry = if matches!(overflow, Overflow::Vertical | Overflow::Both) { (y1 - vh).max(0.0) } else { 0.0 }; + let rx = if matches!(n.overflow, Overflow::Horizontal | Overflow::Both) { (x1 - vw).max(0.0) } else { 0.0 }; + let ry = if matches!(n.overflow, Overflow::Vertical | Overflow::Both) { (y1 - vh).max(0.0) } else { 0.0 }; (if rx.is_finite() { rx } else { 0.0 }, if ry.is_finite() { ry } else { 0.0 }) } @@ -1546,11 +1535,6 @@ fn body_outset(device: &str, size: Vec2, landscape: bool) -> (f32, f32, f32) { } } -/// Tablet and computer presets size the screen without drawing a hardware shell around it. -fn has_device_body(device: Device) -> bool { - !device.name.starts_with("iPad") && !matches!(device.name, "MacBook Air" | "Desktop") -} - /// Place the presented frame in `area`: on its device's screen (the whole device sized by the /// view's scale option), else the frame itself. Fit and 100% keep the chrome's padding from the /// edges; Fit never goes above 100%. What doesn't fit the window pans (`Presenter::pan`). The @@ -1566,7 +1550,7 @@ fn layout(p: &mut Presenter, area: Rect, chrome: Chrome) -> Option { let fb = disp.world_bounds(p.current)?; let view = if chrome.pane { PresentView::default() } else { p.view }; // Custom sizes are just a screen: no body. - let body = device.filter(|d| view.device_frame && has_device_body(*d) && !d.colors.is_empty()); + let body = device.filter(|d| view.device_frame && !d.colors.is_empty()); let pad = if !fills && matches!(view.scale, PresentScale::Fit | PresentScale::Actual) { chrome.pad } else { 0.0 }; let avail = area.shrink(pad); let (sw, sh) = device.map_or((fb.width(), fb.height()), |d| (d.width, d.height)); @@ -2357,7 +2341,7 @@ fn options_menu(p: &mut Presenter, ui: &mut Ui, device: Option, responsi } ui.separator(); } - if device.is_some_and(|d| has_device_body(d) && !d.colors.is_empty()) && menu_check(ui, p.view.device_frame, tr("Show device frame"), "") { + if device.is_some_and(|d| !d.colors.is_empty()) && menu_check(ui, p.view.device_frame, tr("Show device frame"), "") { p.view.device_frame = !p.view.device_frame; ui.close(); } @@ -2378,7 +2362,7 @@ fn scrollers_at(p: &Presenter, base: &Document, disp: &Document, root: NodeId, p let mut out: Vec = disp .subtree(root) .into_iter() - .filter(|f| disp.node(*f).is_some_and(|n| n.visible)) + .filter(|f| disp.node(*f).is_some_and(|n| n.visible && n.overflow != Overflow::None)) .filter(|f| disp.world_bounds(*f).is_some_and(|b| place.rect(b).contains(q))) .filter(|f| p.range(base, *f) != (0.0, 0.0)) .collect(); @@ -2904,19 +2888,16 @@ mod tests { } #[test] - fn tablet_and_computer_presets_show_only_their_screen_at_the_real_resolution() { + fn device_presets_show_their_screen_at_the_real_resolution_in_their_body() { let mut session = figcraft_engine::Session::new(); let frame = id(&session.execute("node.create", &json!({"type": "frame", "width": 894, "height": 844})).unwrap()); let mut ui = Ui::new(session); ui.run("proto.present", json!({"start": frame})); let area = Rect::from_min_max(pos2(0.0, 40.0), pos2(1440.0, 860.0)); - for (name, width, height, body) in [ - ("iPad mini", 744.0, 1133.0, false), - ("MacBook Air", 1280.0, 832.0, false), - ("Desktop", 1440.0, 1024.0, false), - ("iPhone 17", 402.0, 874.0, true), - ] { + for (name, width, height) in + [("iPad mini", 744.0, 1133.0), ("MacBook Air", 1280.0, 832.0), ("Desktop", 1440.0, 1024.0), ("iPhone 17", 402.0, 874.0)] + { let mut presenter = ui.app.ui.present.take().unwrap(); choose_device(&mut ui.app, &mut presenter, name); ui.app.ui.present = Some(presenter); @@ -2924,38 +2905,52 @@ mod tests { let presenter = ui.app.ui.present.as_mut().unwrap(); let laid = layout(presenter, area, FULL).unwrap(); - assert_eq!(laid.color.is_some(), body, "{name}: body visibility"); + assert!(laid.color.is_some(), "{name}: drawn in its body"); assert!((f64::from(laid.screen.width()) / laid.scale - width).abs() < 0.1, "{name}: width"); assert!((f64::from(laid.screen.height()) / laid.scale - height).abs() < 0.1, "{name}: height"); assert_eq!(ui.app.session.doc().unwrap().node(frame).unwrap().width, 894.0); } } + /// A phone shows a frame's content past its screen only as far as the frame's overflow lets it + /// scroll: with "No scrolling" it's clipped, like on every other device. #[test] - fn responsive_device_scrolls_content_in_both_directions_without_changing_saved_overflow() { - let mut session = figcraft_engine::Session::new(); - let frame = id(&session.execute("node.create", &json!({"type": "frame", "width": 894, "height": 844})).unwrap()); - session.execute("node.create", &json!({"type": "rectangle", "parent": frame, "x": 650, "y": 1050, "width": 80, "height": 80})).unwrap(); - let mut ui = Ui::new(session); - ui.run("proto.present", json!({"start": frame})); - let mut presenter = ui.app.ui.present.take().unwrap(); - choose_device(&mut ui.app, &mut presenter, "iPhone 17"); - ui.app.ui.present = Some(presenter); - ui.frame(vec![]); - - let range = &ui.app.inspect()["presenter"]["scrollRange"]; - assert!(range[0].as_f64().unwrap() > 0.0 && range[1].as_f64().unwrap() > 0.0, "{range}"); + fn a_phone_scrolls_only_what_the_frames_overflow_allows() { + let on_phone = |overflow: &str| { + let mut session = figcraft_engine::Session::new(); + let frame = id(&session.execute("node.create", &json!({"type": "frame", "width": 894, "height": 844})).unwrap()); + session.execute("node.create", &json!({"type": "rectangle", "parent": frame, "x": 650, "y": 1050, "width": 80, "height": 80})).unwrap(); + session.execute("node.set", &json!({"id": frame, "props": {"overflow": overflow}})).unwrap(); + let mut ui = Ui::new(session); + ui.run("proto.present", json!({"start": frame})); + let mut presenter = ui.app.ui.present.take().unwrap(); + choose_device(&mut ui.app, &mut presenter, "iPhone 17"); + ui.app.ui.present = Some(presenter); + ui.frame(vec![]); + (ui, frame) + }; let start = pos2(720.0, 440.0); - ui.button(start, true); - ui.frame(vec![egui::Event::PointerMoved(start - vec2(100.0, 120.0))]); - ui.button(start - vec2(100.0, 120.0), false); - let scroll = &ui.app.inspect()["presenter"]["scroll"]; - assert!(scroll[0].as_f64().unwrap() > 0.0 && scroll[1].as_f64().unwrap() > 0.0, "{scroll}"); - assert_eq!(ui.app.session.doc().unwrap().node(frame).unwrap().overflow, Overflow::None); + let drag = |ui: &mut Ui, to: Pos2| { + ui.button(start, true); + ui.frame(vec![egui::Event::PointerMoved(to)]); + ui.button(to, false); + ui.app.inspect()["presenter"].clone() + }; + + let (mut ui, frame) = on_phone("none"); + assert_eq!(ui.app.inspect()["presenter"]["scrollRange"], json!([0.0, 0.0])); + assert_eq!(drag(&mut ui, start - vec2(100.0, 120.0))["scroll"], json!([0.0, 0.0]), "no scrolling stays clipped"); assert_eq!(ui.app.session.doc().unwrap().node(frame).unwrap().width, 894.0); - // Like the phone preview, the content keeps following a drag after the pointer leaves - // the screen, while the device itself stays fixed on the stage. + let (mut ui, frame) = on_phone("both"); + let range = &ui.app.inspect()["presenter"]["scrollRange"]; + assert!(range[0].as_f64().unwrap() > 0.0 && range[1].as_f64().unwrap() > 0.0, "{range}"); + let scroll = drag(&mut ui, start - vec2(100.0, 120.0))["scroll"].clone(); + assert!(scroll[0].as_f64().unwrap() > 0.0 && scroll[1].as_f64().unwrap() > 0.0, "{scroll}"); + assert_eq!(ui.app.session.doc().unwrap().node(frame).unwrap().width, 894.0); + + // The content keeps following a drag after the pointer leaves the screen, while the + // device itself stays fixed on the stage. ui.frames(60, Vec::new); let area = Rect::from_min_max(pos2(0.0, 40.0), pos2(1440.0, 900.0)); let screen_before = layout(ui.app.ui.present.as_mut().unwrap(), area, FULL).unwrap().screen; @@ -2963,16 +2958,8 @@ mod tests { ui.frame(vec![egui::Event::PointerMoved(pos2(300.0, 300.0))]); let during = ui.app.inspect()["presenter"].clone(); assert!(during["scroll"][0].as_f64().unwrap() > 0.0, "{during}"); - let screen_after = layout(ui.app.ui.present.as_mut().unwrap(), area, FULL).unwrap().screen; - assert_eq!(screen_after, screen_before); + assert_eq!(layout(ui.app.ui.present.as_mut().unwrap(), area, FULL).unwrap().screen, screen_before); ui.button(pos2(300.0, 300.0), false); - - let mut presenter = ui.app.ui.present.take().unwrap(); - choose_device(&mut ui.app, &mut presenter, "Desktop"); - ui.app.ui.present = Some(presenter); - ui.frame(vec![]); - let desktop = ui.app.inspect()["presenter"].clone(); - assert_eq!(desktop["scrollRange"], json!([0.0, 0.0])); } fn doc_with_two_frames() -> (Document, NodeId, NodeId) { From 420ef78842d27e6843beefdd77790a569ed4c0ac Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 20:23:06 +0700 Subject: [PATCH 185/817] #592: drop the README section (the module docs in linux_window.rs cover it) --- README.md | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/README.md b/README.md index 0aa73a0c0..a072a06fe 100644 --- a/README.md +++ b/README.md @@ -358,16 +358,3 @@ Forks and modified versions must remove them. ## Star history [![Star History Chart](https://api.star-history.com/svg?repos=storytold/figcraft&type=Date&legend=top-left)](https://www.star-history.com/?repos=storytold%2Ffigcraft&type=date&legend=top-left) - -## Linux window controls - -On Wayland without the `zxdg_decoration_manager_v1` protocol (including GNOME), -FigCraft enables winit's Adwaita client-side frame with vector minimize, -maximize/restore and close buttons. The tab strip keeps the document names; -the frame's title-font renderer is disabled, so this does not embed Cantarell. -X11 and Wayland compositors advertising server decorations, including KDE and -wlroots, retain FigCraft's existing frameless tab strip and its own controls. - -The actual window backend is checked before requesting the frame. A failed or -slow capability query, or a launch using only an inherited Wayland socket, -keeps the existing custom controls. Desktop names are not used to guess capabilities. From b8f97a5f4f4c354ff218c17782979d0d342f66b3 Mon Sep 17 00:00:00 2001 From: BFlat Date: Sat, 17 Oct 2026 20:29:32 +0700 Subject: [PATCH 186/817] M8: the control channel answers while the window is minimized (#720) (#751) - A minimised or covered window now answers every control request that acts on the app's state (`engine.execute`, `document.inspect`, `node.get`, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `ui.menu.invoke`, `ui.render`, `window.list`, `window.focus`, `app.quit`), in that window's file, from the app's `logic` (no frame drawn). Before, only six methods were answered there. - What only a drawn frame can answer (`ui.screenshot`, `ui.input`, `window.new`) is an error at once for a hidden window: `window 0 is minimised or hidden: `ui.screenshot` needs it on screen (`ui.render` draws the document without it)`. Before, these waited up to 60 s. - `crates/ui-egui/src/control.rs`: the `NO_FRAME` allow-list becomes a short `NEEDS_FRAME` list; `drain_hidden` answers the rest and fails the frame-only ones at once. - Docs: `docs/control-protocol.md` (hidden windows, `ui.screenshot`) and `docs/mcp.md` (attached mode while the window is minimised). ROADMAP progress log and revision history. Part of #720. --- ROADMAP.md | 2 ++ crates/ui-egui/src/control.rs | 25 +++++++++++++++++-------- crates/ui-egui/src/idle_tests.rs | 19 ++++++++++++------- crates/ui-egui/src/windows_tests.rs | 9 +++++---- docs/control-protocol.md | 17 +++++++++++------ docs/mcp.md | 6 ++++++ 6 files changed, 53 insertions(+), 25 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 2dcc2b9bb..a8ae28ab1 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -131,6 +131,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). ## Progress log +- **2026-10-17** · Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. - **2026-10-17** · Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. - **2026-10-17** · Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. - **2026-10-14** · Corner handles win over the corner-radius handles (M1, #292): a press on the inner half of a corner handle's square picked the radius handle 10 px in, so the drag neither resized nor (dragging outward) rounded anything. Inside the drawn square the corner now resizes both sides (in ratio with Shift or the link); further in the radius handle still answers. Regression test in the transform behaviour suite. Numbers unchanged. @@ -315,6 +316,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | | 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | | 2026-10-17 | minor | Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. | diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rs index 45311df23..a66e1ed9c 100644 --- a/crates/ui-egui/src/control.rs +++ b/crates/ui-egui/src/control.rs @@ -139,8 +139,10 @@ pub fn drain(app: &mut FigApp, ctx: &Context) { } } -/// Methods that need no frame drawn (#269): a hidden window answers them too. -const NO_FRAME: &[&str] = &["engine.execute", "engine.commands", "document.inspect", "node.get", "window.list", "ui.render"]; +/// Methods only a drawn frame can answer: a capture of the window, raw window input and a new +/// window (the main window's frame opens it). Everything else acts on the app's state, which a +/// hidden window answers without a frame (#269, #720). +const NEEDS_FRAME: &[&str] = &["ui.screenshot", "ui.input", "window.new"]; /// Whether window `id` draws no frames now: minimised, or covered by other windows (on macOS also /// on another Space). @@ -150,10 +152,11 @@ fn hidden(ctx: &Context, id: u64) -> bool { /// A hidden window (minimised, or covered by other windows) draws no frames, but the desktop app's /// `logic` still runs, for the main window even while every window is hidden: it answers the -/// requests for any hidden window that need no frame, in that window's file, so an attached agent -/// can edit, inspect and save. The rest (screenshots, input, the interface's own state) wait for the -/// window to show; another window on screen is asked to draw, which the main window's frame would -/// do but doesn't while it is hidden. A request for a window that doesn't exist is an error at once. +/// requests for any hidden window, in that window's file, so an attached agent can edit, inspect, +/// type and save while the app is out of sight. What needs a frame ([`NEEDS_FRAME`]) is an error at +/// once instead of waiting for the window to show. A request for a window on screen waits for its +/// frame; another window on screen is asked to draw, which the main window's frame would do but +/// doesn't while it is hidden. A request for a window that doesn't exist is an error at once. pub fn drain_hidden(app: &mut FigApp, ctx: &Context) { for r in std::mem::take(&mut app.control_queue) { if r.is_cancelled() { @@ -164,15 +167,21 @@ pub fn drain_hidden(app: &mut FigApp, ctx: &Context) { let _ = r.reply.send(ControlReply { id: r.id, result: Err(format!("no window {target}")) }); continue; } - if !hidden(ctx, target) || !NO_FRAME.contains(&r.method.as_str()) { + if !hidden(ctx, target) { // Another window on screen draws only when asked: while the main window is hidden no // frame of it does that (`drain`), so ask here. - if target != app.windows.current && !hidden(ctx, target) { + if target != app.windows.current { ctx.request_repaint_of(crate::windows::viewport(target)); } app.control_queue.push(r); continue; } + if NEEDS_FRAME.contains(&r.method.as_str()) { + let error = + format!("window {target} is minimised or hidden: `{}` needs it on screen (`ui.render` draws the document without it)", r.method); + let _ = r.reply.send(ControlReply { id: r.id, result: Err(error) }); + continue; + } // Outside a frame, so outside the frame's guard: within the window's swap, a panic still // ends in recovery copies and leaves every window its own state. let res = crate::windows::as_window(app, target, |app| { diff --git a/crates/ui-egui/src/idle_tests.rs b/crates/ui-egui/src/idle_tests.rs index b78c7474c..6ae195464 100644 --- a/crates/ui-egui/src/idle_tests.rs +++ b/crates/ui-egui/src/idle_tests.rs @@ -332,9 +332,10 @@ fn cjk_names_are_looked_for_in_edits_not_on_every_pan() { } #[test] -fn a_hidden_window_answers_requests_that_need_no_frame() { - // #269: minimised or covered, the window draws no frames, but the app's logic still runs: it - // answers edits, inspection and saves; what needs a frame waits for the window to show. +fn a_hidden_window_answers_at_once() { + // #269, #720: minimised or covered, the window draws no frames, but the app's logic still runs: + // it answers edits, inspection, saves and the interface's state; what needs a frame (a capture + // of the window) is an error at once instead of waiting for the window to show. let dir = std::env::temp_dir().join(format!("figcraft-hidden-save-{}", std::process::id())); std::fs::create_dir_all(&dir).unwrap(); let path = dir.join("hidden.figcraft"); @@ -350,6 +351,7 @@ fn a_hidden_window_answers_requests_that_need_no_frame() { }; h.app.control_queue.push(request(1, "engine.execute", json!({"command": "file.save", "params": {"path": path.to_string_lossy()}}))); h.app.control_queue.push(request(2, "ui.inspect", json!({}))); + h.app.control_queue.push(request(3, "ui.screenshot", json!({"path": dir.join("shot.png").to_string_lossy()}))); let mut hidden = RawInput::default(); hidden.viewports.insert(ViewportId::ROOT, egui::ViewportInfo { minimized: Some(true), ..Default::default() }); let app = &mut h.app; @@ -357,10 +359,13 @@ fn a_hidden_window_answers_requests_that_need_no_frame() { let saved = rx.try_recv().unwrap(); assert_eq!(saved.id, json!(1)); assert!(saved.result.is_ok() && path.exists(), "saved while hidden: {:?}", saved.result); - assert!(rx.try_recv().is_err(), "the interface's state waits for a frame"); - // Shown again: the next frame answers it. - h.frame(vec![]); - assert_eq!(rx.try_recv().unwrap().id, json!(2)); + let inspected = rx.try_recv().unwrap(); + assert_eq!(inspected.id, json!(2)); + assert!(inspected.result.is_ok(), "the interface's state: {:?}", inspected.result); + let shot = rx.try_recv().unwrap(); + assert_eq!(shot.id, json!(3)); + assert!(shot.result.unwrap_err().contains("minimised or hidden"), "a capture needs the window on screen"); + assert!(h.app.control_queue.is_empty(), "nothing waits for the window"); let _ = std::fs::remove_dir_all(&dir); } diff --git a/crates/ui-egui/src/windows_tests.rs b/crates/ui-egui/src/windows_tests.rs index 1a6e91bbc..74c596bd4 100644 --- a/crates/ui-egui/src/windows_tests.rs +++ b/crates/ui-egui/src/windows_tests.rs @@ -116,13 +116,14 @@ fn another_hidden_window_answers_requests_that_need_no_frame_in_its_own_file() { assert_eq!(inspect.try_recv().expect("answered").result.unwrap()["name"], json!("A")); assert_eq!(app.session.ds().unwrap().doc.name, "B"); - // What needs a frame keeps waiting for the other window; an unknown window is an error at once. - let ui = request(&mut app, "ui.inspect", json!({"window": w})); + // What needs a frame, and an unknown window, are errors at once: nothing waits for a window + // that may stay hidden. + let shot = request(&mut app, "ui.screenshot", json!({"window": w, "path": "unused.png"})); let unknown = request(&mut app, "window.list", json!({"window": 99})); logic(&ctx, &mut app, &[ViewportId::ROOT, other]); - assert!(ui.try_recv().is_err(), "waits for the window to show"); + assert!(shot.try_recv().expect("answered").result.unwrap_err().contains(&format!("window {w} is minimised or hidden"))); assert!(unknown.try_recv().expect("answered").result.unwrap_err().contains("no window 99")); - assert_eq!(app.control_queue.len(), 1); + assert!(app.control_queue.is_empty()); } #[test] diff --git a/docs/control-protocol.md b/docs/control-protocol.md index 801bba6b1..3a06874e6 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -37,11 +37,15 @@ requests still queued after the UI timeout are discarded, including requests def window. A command already running is not interrupted. A minimised or covered window (the main one or another, see Windows below) draws no frames, but -still answers `engine.execute`, `engine.commands`, `document.inspect`, `node.get`, `window.list` -and `ui.render`, acting on the file that window shows, so an attached agent can edit, inspect and -save while the app is out of sight. Screenshots, input (`ui.input`, -`ui.pointer`, `ui.key`, `ui.type`) and the interface's own state wait for the window to show, and -time out after 60 s if it doesn't. +still answers every method that acts on the app's state (`engine.execute`, `document.inspect`, +`node.get`, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `ui.render`, `window.list`, +…), in the file that window shows, so an attached agent can edit, inspect and save while the app is +out of sight. The app is not drawn meanwhile and only wakes for requests, at most ten times a +second while minimised, so a request there takes up to about 0.1 s. What only a drawn frame can +answer (`ui.screenshot`, `ui.input`, `window.new`) is an error at once (`window 0 is minimised or +hidden: …`) instead of waiting for the window to show; `ui.render` draws the document without it. +Under Wayland the app can't tell that its window is minimised: where the compositor then stops +drawing it, a request waits for the window and gets the 60 s timeout error. Coordinates are page units, y down. `x`/`y` in `node.set`/`node.create` are relative to the parent frame (groups have no coordinate space of their own). @@ -292,7 +296,8 @@ focus view shows, or `null`) and `annotationFilter`). PNG of the whole window (`window` picks one), UI included (needs a visible window; an idle one draws the frame to capture). Returns `{path, width, height}`, without `path` `{format: "png", width, height, data}` -(base64), or an error after 60 s when the window doesn't deliver. +(base64); an error at once when the window is minimised or hidden, or after 60 s when the window +doesn't deliver. ### `ui.render {path?, scale?, ids?}` diff --git a/docs/mcp.md b/docs/mcp.md index 4e6f7bc3b..12d1a871c 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -26,6 +26,12 @@ If that connection cannot be established, the error says the request was not sen A connection the app closed while it sat idle is noticed before the next request is written and replaced then, so a pause between calls is not an error. +The app keeps answering while its window is minimised or covered by other windows (see +`docs/control-protocol.md`): edits, inspection (`inspect_ui` too), pointer, key and text input and +renders work as usual (minimised, each request to the app takes up to about 0.1 s). Only a capture +of the window itself (`screenshot` with `window`) needs it on screen: it is then an error at once; +`screenshot` without `window` renders the document instead. + ### Confining file access ```sh From c532053396ce7864fa8e5d9856c49244f96d7479 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 20:43:37 +0700 Subject: [PATCH 187/817] #749: clear the shortcuts panel after the home screen draws, so it never shows for a frame --- crates/ui-egui/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 6d867abfe..9ad7bae60 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1414,10 +1414,11 @@ impl FigApp { return; } if !self.has_files() || self.ui.home { - // The shortcuts panel belongs to the canvas; it doesn't hang over the home screen. - self.ui.shortcuts_panel = false; tabs::tab_bar(self, ui); 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). + self.ui.shortcuts_panel = false; dialogs::keys(self, &ctx); dialogs::show(self, &ctx); self.toast_ui(&ctx); From d489235d2c9ef689cb2321e7ddb28aaf57383a65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E6=9E=97=E6=A9=A6?= <108113065+yelintong@users.noreply.github.com> Date: Sat, 17 Oct 2026 22:35:50 +0800 Subject: [PATCH 188/817] engine: short loops in vector.reverseLoop really turn round reverseLoop reversed the list and skipped shared segments, which only turns a loop of three or more round: a one-segment loop has no order at all, and a two-segment ring reads the same whichever way its list is turned, so both answered reversed: true without moving. Three or more segments: reverse the list and leave every stored end alone (a shared one belongs to the neighbour too). One or two: store one segment the other way round, skipping any segment another short loop lists; when none is left to swap, refuse with a clear error and leave the document as it was. Tests: two 2-segment areas over one line that share it, the shared segment listed first in one area and last in the other; each reversal flips that area's winding sign and leaves the shared segment and the neighbour alone. A shared one-segment loop is refused. The 4-segment squares stay as the long-loop case. Drop the two catalog.rs menu lines: they aren't in the reference app's menus, and the Vector menu runs commands without parameters, so both would fail there. --- crates/engine/src/catalog.rs | 2 - crates/engine/src/cmd/structure.rs | 97 +++++++++++------- crates/engine/src/vector_fill_rule_tests.rs | 108 +++++++++++++++++--- 3 files changed, 154 insertions(+), 53 deletions(-) diff --git a/crates/engine/src/catalog.rs b/crates/engine/src/catalog.rs index 6bee50482..c8f34fc15 100644 --- a/crates/engine/src/catalog.rs +++ b/crates/engine/src/catalog.rs @@ -235,8 +235,6 @@ pub static MENU: &[MenuItem] = &[ m!("Vector", "Delete and heal selection", "vector.deleteHeal"), m!("Vector", "Simplify vector", "vector.simplify"), m!("Vector", "Reverse path direction", "vector.reverse"), - m!("Vector", "Set fill rule", "vector.fillRule"), - m!("Vector", "Reverse loop", "vector.reverseLoop"), m!("Vector", "Offset path", "vector.offset"), // Plugins m!("Plugins", "Run last plugin", "plugins.runLast"), diff --git a/crates/engine/src/cmd/structure.rs b/crates/engine/src/cmd/structure.rs index c38052ec0..d38b3dfc5 100644 --- a/crates/engine/src/cmd/structure.rs +++ b/crates/engine/src/cmd/structure.rs @@ -764,20 +764,20 @@ fn area_index(cmd: &str, p: &Value) -> Result> { } } -/// Segments listed by more than one loop (of any region): reversing a loop must leave them as they -/// are, or a neighbouring area that shares the segment would turn round with it — flipping the -/// neighbour's fill or stroke. Reversing the loop's list already flips this loop's traversal of the -/// shared segment, so its stored direction is left alone. -fn shared_segments(net: &VectorNetwork) -> std::collections::HashSet { - let mut count = std::collections::HashMap::::new(); - for region in &net.regions { - for lp in ®ion.loops { - for &s in lp { - *count.entry(s).or_insert(0) += 1; +/// Segments another one- or two-segment loop lists: a short loop takes its direction from the ends +/// its segments are stored with, so re-storing one of those would turn that loop round too. A loop +/// of three or more segments is left out: its ring is walked in list order, which the stored ends +/// don't decide. +fn short_loop_segments(net: &VectorNetwork, skip: (usize, usize)) -> std::collections::HashSet { + let mut out = std::collections::HashSet::new(); + for (r, region) in net.regions.iter().enumerate() { + for (l, lp) in region.loops.iter().enumerate() { + if (r, l) != skip && lp.len() <= 2 { + out.extend(lp.iter().copied()); } } } - count.into_iter().filter(|(_, c)| *c > 1).map(|(s, _)| s).collect() + out } fn fill_rule(s: &mut Session, p: &Value) -> Result { @@ -813,41 +813,66 @@ fn fill_rule(s: &mut Session, p: &Value) -> Result { Ok(json!({"regions": count, "rule": rule_id(rule)})) } +/// One loop of a vector, worked out but not yet written back: its segments in the new order and, +/// for a loop of one or two segments, the one to store the other way. +struct LoopFlip { + id: NodeId, + turned: Vec, + store: Option, +} + /// Turn one loop of a filled area round: its segments are walked the other way, so the area it /// bounds counts the other way in the winding (which turns a hole into a filled part and back). +/// +/// How a loop is walked depends on how many segments it has: +/// - three or more: the order they are listed in, each segment turned to continue from the point +/// reached. Reversing the list is therefore enough, and the stored ends are left alone (a shared +/// segment's ends belong to its neighbour too); +/// - two: the same ring either way round, so one of the two has to be stored the other way instead; +/// - one: only its stored ends say which way it runs, so they are swapped. +/// +/// A short loop can only turn round by re-storing a segment, which is refused when another short +/// loop lists that segment too: it would turn that area round as well. fn reverse_loop(s: &mut Session, p: &Value) -> Result { - let ids = req_targets("vector.reverseLoop", s, p)?; - let region = req_index("vector.reverseLoop", p, "region")?; - let index = req_index("vector.reverseLoop", p, "loop")?; + let cmd = "vector.reverseLoop"; + let ids = req_targets(cmd, s, p)?; + let region = req_index(cmd, p, "region")?; + let index = req_index(cmd, p, "loop")?; let doc = s.doc_mut()?; - let mut reversed = false; + // Work every loop out before touching the document: one that can't turn round refuses the call + // and the others stay as they were. + let mut flips: Vec = Vec::new(); for id in ids { + let Some(NodeKind::Vector { network }) = doc.node(id).map(|n| &n.kind) else { continue }; + let Some(loop_) = network.regions.get(region).and_then(|r| r.loops.get(index)) else { continue }; + if loop_.is_empty() { + continue; + } + let mut store = None; + if loop_.len() <= 2 { + let busy = short_loop_segments(network, (region, index)); + let Some(pick) = loop_.iter().copied().filter(|s| !busy.contains(s)).min() else { + return Err(EngineError::Disabled( + cmd.into(), + "the loop shares its segments with another one- or two-segment loop, so turning it round would turn that one round too".into(), + )); + }; + store = Some(pick); + } + flips.push(LoopFlip { id, turned: loop_.iter().rev().copied().collect(), store }); + } + if flips.is_empty() { + return Err(EngineError::Disabled(cmd.into(), "no such loop (select a vector with filled areas)".into())); + } + for LoopFlip { id, turned, store } in flips { let Some(net) = network_mut(doc, id) else { continue }; - let Some(loop_) = net.regions.get(region).and_then(|r| r.loops.get(index)).cloned() else { continue }; - // A loop is walked in the order its segments are listed, so the list turned round walks the - // ring the other way. A loop of one or two segments only turns round when its segments are - // stored the other way too (list reversal alone is a no-op for them). - // A segment shared with another loop must NOT be swapped: it belongs to a neighbouring area - // whose winding we leave alone, and reversing the list already flips this loop's traversal - // of it. - let shared = shared_segments(net); - let turned: Vec = loop_.iter().rev().copied().collect(); - for &seg in &turned { - if shared.contains(&seg) { - continue; - } - if let Some(seg) = net.segments.get_mut(seg) { - std::mem::swap(&mut seg.a, &mut seg.b); - std::mem::swap(&mut seg.ta, &mut seg.tb); - } + if let Some(seg) = store.and_then(|i| net.segments.get_mut(i)) { + std::mem::swap(&mut seg.a, &mut seg.b); + std::mem::swap(&mut seg.ta, &mut seg.tb); } if let Some(l) = net.regions.get_mut(region).and_then(|r| r.loops.get_mut(index)) { *l = turned; - reversed = true; } } - if !reversed { - return Err(EngineError::Disabled("vector.reverseLoop".into(), "no such loop (select a vector with filled areas)".into())); - } Ok(json!({"reversed": true})) } diff --git a/crates/engine/src/vector_fill_rule_tests.rs b/crates/engine/src/vector_fill_rule_tests.rs index db96b669c..8a8fe850d 100644 --- a/crates/engine/src/vector_fill_rule_tests.rs +++ b/crates/engine/src/vector_fill_rule_tests.rs @@ -37,8 +37,8 @@ fn ring() -> VectorNetwork { net } -/// A selected vector layer holding `ring()`. -fn ringed(s: &mut Session) -> NodeId { +/// A selected vector layer holding `network`. +fn vector_layer(s: &mut Session, network: VectorNetwork) -> NodeId { let id = s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 100, "height": 100})).unwrap()["id"].as_u64().unwrap(); let id = NodeId(id); ex(s, "vector.edit.begin", json!({"id": id})); @@ -46,7 +46,7 @@ fn ringed(s: &mut Session) -> NodeId { { let doc = s.doc_mut().unwrap(); match &mut doc.get_mut(id).unwrap().kind { - NodeKind::Vector { network } => *network = ring(), + NodeKind::Vector { network: net } => *net = network, other => panic!("not a vector: {other:?}"), } } @@ -54,6 +54,11 @@ fn ringed(s: &mut Session) -> NodeId { id } +/// A selected vector layer holding `ring()`. +fn ringed(s: &mut Session) -> NodeId { + vector_layer(s, ring()) +} + /// Two 50 × 100 squares side by side share the vertical edge between them: one segment listed by /// both areas' single loops. A segment shared between areas is the case `vector.reverseLoop` must /// not flip, or a neighbour's fill or stroke would turn round with it. @@ -91,19 +96,43 @@ fn two_squares() -> VectorNetwork { /// A selected vector layer holding [`two_squares`]. fn squared(s: &mut Session) -> NodeId { - let id = s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 100, "height": 100})).unwrap()["id"].as_u64().unwrap(); - let id = NodeId(id); - ex(s, "vector.edit.begin", json!({"id": id})); - ex(s, "vector.edit.end", json!({})); - { - let doc = s.doc_mut().unwrap(); - match &mut doc.get_mut(id).unwrap().kind { - NodeKind::Vector { network } => *network = two_squares(), - other => panic!("not a vector: {other:?}"), - } + vector_layer(s, two_squares()) +} + +/// Two areas of two segments each over the same line: one curve above it and one below. Both areas +/// list the line's segment — the first area first (`[line, above]`), the second area last +/// (`[below, line]`) — and a two-segment ring reads the same whichever way its list is turned, so +/// these only turn round when a segment is stored the other way. +fn two_lenses() -> VectorNetwork { + // 0:A(0,0) 1:B(100,0) + // s0 A→B the straight line both areas use; s1 B→A curving above it; s2 A→B curving below it. + VectorNetwork { + vertices: vec![Vertex::new(0.0, 0.0), Vertex::new(100.0, 0.0)], + segments: vec![ + Segment::line(0, 1), + Segment { a: 1, b: 0, ta: (0.0, -50.0), tb: (0.0, -50.0) }, + Segment { a: 0, b: 1, ta: (0.0, 50.0), tb: (0.0, 50.0) }, + ], + regions: vec![ + Region { loops: vec![vec![0, 1]], winding: WindingRule::NonZero }, + Region { loops: vec![vec![2, 0]], winding: WindingRule::NonZero }, + ], + } +} + +/// A selected vector layer holding [`two_lenses`]. +fn lensed(s: &mut Session) -> NodeId { + vector_layer(s, two_lenses()) +} + +/// Two areas whose only loop is the same closed segment (a curve the path closes with a straight +/// line): a one-segment loop's direction is its segment's stored ends, and both areas read them. +fn one_shared_segment() -> VectorNetwork { + VectorNetwork { + vertices: vec![Vertex::new(0.0, 0.0), Vertex::new(100.0, 0.0)], + segments: vec![Segment { a: 0, b: 1, ta: (0.0, -60.0), tb: (0.0, -60.0) }], + regions: vec![Region { loops: vec![vec![0]], winding: WindingRule::NonZero }, Region { loops: vec![vec![0]], winding: WindingRule::NonZero }], } - ex(s, "select.set", json!({"ids": [id]})); - id } /// The point in the middle of the hole, and one on the square's left band. @@ -226,3 +255,52 @@ fn reversing_a_loop_shared_with_a_neighbour_leaves_its_segment_and_fill_alone() s.undo().unwrap(); assert_eq!(net(&s, id).segments[SHARED], before, "undo restores the shared segment too"); } + +#[test] +fn a_two_segment_loop_turns_round_with_its_shared_segment_listed_first_or_last() { + let mut s = Session::new(); + let id = lensed(&mut s); + const SHARED: usize = 0; + const ABOVE: Point = Point::new(50.0, -25.0); + const BELOW: Point = Point::new(50.0, 25.0); + let n = net(&s, id); + assert_eq!(n.regions.len(), 2, "two areas over the same line"); + assert_eq!((n.regions[0].loops[0][0], n.regions[0].loops[0].len()), (SHARED, 2), "the shared segment is listed first"); + assert_eq!((n.regions[1].loops[0][1], n.regions[1].loops[0].len()), (SHARED, 2), "and last"); + assert!(n.region_contains(0, ABOVE), "the area above the line fills"); + assert!(n.region_contains(1, BELOW), "the area below it fills"); + let (above, below) = (n.region_winding(0, ABOVE).unwrap(), n.region_winding(1, BELOW).unwrap()); + assert_ne!(above, 0, "the area above winds once"); + assert_ne!(below, 0, "the area below winds once"); + let shared = n.segments[SHARED]; + // Turn the area that lists the shared segment first round: a two-segment ring reads the same + // either way, so this only works by storing one of its segments the other way. + assert_eq!(ex(&mut s, "vector.reverseLoop", json!({"id": id, "region": 0, "loop": 0}))["reversed"], json!(true)); + let n = net(&s, id); + assert_eq!(n.segments[SHARED], shared, "the shared segment keeps its ends"); + assert!(n.region_contains(0, ABOVE), "the area still fills"); + assert_eq!(n.region_winding(0, ABOVE), Some(-above), "it really turned round"); + assert_eq!(n.region_winding(1, BELOW), Some(below), "the neighbour did not"); + // And the area that lists it last. + ex(&mut s, "vector.reverseLoop", json!({"id": id, "region": 1, "loop": 0})); + let n = net(&s, id); + assert_eq!(n.segments[SHARED], shared, "still untouched"); + assert_eq!(n.region_winding(1, BELOW), Some(-below), "the second area really turned round"); + assert_eq!(n.region_winding(0, ABOVE), Some(-above), "the first stays as it was"); + // Undo turns each back. + s.undo().unwrap(); + assert_eq!(net(&s, id).region_winding(1, BELOW), Some(below), "undo turns the second back"); + s.undo().unwrap(); + assert_eq!(net(&s, id).region_winding(0, ABOVE), Some(above), "and the first"); +} + +#[test] +fn a_one_segment_loop_shared_with_another_is_refused_instead_of_claiming_a_turn() { + let mut s = Session::new(); + let id = vector_layer(&mut s, one_shared_segment()); + let before = net(&s, id); + let err = s.execute("vector.reverseLoop", &json!({"id": id, "region": 0, "loop": 0})).unwrap_err(); + let message = err.to_string(); + assert!(message.contains("shares its segments"), "the error says why: {message}"); + assert_eq!(net(&s, id), before, "nothing changed"); +} From 825cb1e7afe46b6791ceb6992d21f13a6dba0096 Mon Sep 17 00:00:00 2001 From: RealtaNua Date: Sat, 17 Oct 2026 21:49:32 +0700 Subject: [PATCH 189/817] M7: list the fonts a file uses that aren't installed (#752) Text in a family that isn't installed was drawn in a fallback font without a word. Now: - `text.missingFonts` lists the families a document names that no installed or built-in font provides: text layers and their styled ranges, text styles, and string variables bound to a font family (every mode, through aliases), with the number of text layers. - The desktop app shows a Missing fonts window after the user opens a file that has any: once installed fonts are indexed (before that every one of them would count as missing) and after any import report is closed. Files named on the command line count. Programmatic opens and the browser build never open it by themselves. Text > Missing fonts... shows it for the file in front; Escape closes it. - `figcraft-cli info` prints `missing font` lines (`missingFonts` with --json). - file-format-parity: the row claimed REST import warnings that no code produced. Co-Authored-By: Claude Opus 5.5 (1M context) --- apps/figcraft-cli/src/files.rs | 6 ++ apps/figcraft-cli/tests/fonts.rs | 22 ++++ apps/figcraft/src/main.rs | 3 + crates/engine/src/catalog.rs | 4 +- crates/engine/src/cmd/mod.rs | 1 + crates/engine/src/fonts.rs | 100 ++++++++++++++++++ crates/engine/src/fonts_tests.rs | 123 ++++++++++++++++++++++ crates/engine/src/lib.rs | 1 + crates/text/src/fontdb.rs | 5 + crates/text/src/lib.rs | 4 +- crates/ui-egui/locales/en.toml | 5 + crates/ui-egui/locales/es.toml | 6 ++ crates/ui-egui/src/dialogs.rs | 3 + crates/ui-egui/src/import_report_tests.rs | 2 +- crates/ui-egui/src/lib.rs | 11 ++ crates/ui-egui/src/missing_fonts.rs | 102 ++++++++++++++++++ crates/ui-egui/src/missing_fonts_tests.rs | 112 ++++++++++++++++++++ docs/cli.md | 4 +- docs/file-format-parity.md | 3 +- docs/mcp.md | 2 + 20 files changed, 513 insertions(+), 6 deletions(-) create mode 100644 crates/engine/src/fonts.rs create mode 100644 crates/engine/src/fonts_tests.rs create mode 100644 crates/ui-egui/src/missing_fonts.rs create mode 100644 crates/ui-egui/src/missing_fonts_tests.rs diff --git a/apps/figcraft-cli/src/files.rs b/apps/figcraft-cli/src/files.rs index 3e08474a2..65b19ee46 100644 --- a/apps/figcraft-cli/src/files.rs +++ b/apps/figcraft-cli/src/files.rs @@ -155,6 +155,7 @@ pub fn info(path: &str, as_json: bool) -> CliResult { Some(json!({"id": p, "name": pn.name, "nodes": nodes, "topLevel": pn.children.len(), "frames": frames})) }) .collect(); + let missing = figcraft_engine::fonts::missing(&doc); let v = json!({ "file": path, "name": doc.name, @@ -164,6 +165,7 @@ pub fn info(path: &str, as_json: bool) -> CliResult { "variables": doc.variables.variables.len(), "images": doc.images.len(), "notes": notes, + "missingFonts": missing.iter().map(|m| json!({"family": m.family, "layers": m.layers})).collect::>(), }); if as_json { println!("{}", serde_json::to_string_pretty(&v).unwrap_or_default()); @@ -187,6 +189,10 @@ pub fn info(path: &str, as_json: bool) -> CliResult { println!(" {} {} \"{}\" {}×{}", f["id"], f["type"].as_str().unwrap_or(""), f["name"].as_str().unwrap_or(""), f["width"], f["height"]); } } + for m in &missing { + let layers = if m.layers == 1 { "text layer" } else { "text layers" }; + println!("missing font \"{}\": {} {layers} (drawn in a fallback font)", m.family, m.layers); + } Ok(ExitCode::SUCCESS) } diff --git a/apps/figcraft-cli/tests/fonts.rs b/apps/figcraft-cli/tests/fonts.rs index c5901ac50..ef5c638fa 100644 --- a/apps/figcraft-cli/tests/fonts.rs +++ b/apps/figcraft-cli/tests/fonts.rs @@ -45,3 +45,25 @@ fn headless_runs_resolve_installed_families_unless_opted_out() { assert_eq!(run_one("face", face.clone(), &[], false)["family"], json!(installed), "text uses the installed family"); assert_ne!(run_one("face", face, &["--no-system-fonts"], false)["family"], json!(installed), "opted out, it falls back"); } + +#[test] +fn info_lists_the_fonts_a_file_uses_that_are_missing() { + let d = std::env::temp_dir().join(format!("figcraft-cli-missing-{}", std::process::id())); + std::fs::create_dir_all(&d).unwrap(); + let (script, file) = (d.join("make.json"), d.join("doc.figcraft")); + let text = + |family: &str| json!({"command": "text.create", "params": {"text": "Hamburgefonstiv", "x": 0, "y": 0, "props": {"fontFamily": family}}}); + std::fs::write(&script, json!([text("FigCraft Missing CLI"), text("FigCraft Missing CLI")]).to_string()).unwrap(); + let cli = || Command::new(env!("CARGO_BIN_EXE_figcraft-cli")); + let made = cli().arg("run").arg(&script).arg("--out").arg(&file).output().unwrap(); + assert!(made.status.success(), "{}", String::from_utf8_lossy(&made.stderr)); + + let out = cli().arg("info").arg(&file).arg("--json").output().unwrap(); + assert!(out.status.success(), "{}", String::from_utf8_lossy(&out.stderr)); + let v: Value = serde_json::from_slice(&out.stdout).unwrap(); + assert_eq!(v["missingFonts"], json!([{"family": "FigCraft Missing CLI", "layers": 2}])); + + let out = cli().arg("info").arg(&file).output().unwrap(); + let shown = String::from_utf8_lossy(&out.stdout); + assert!(shown.contains("missing font \"FigCraft Missing CLI\": 2 text layers"), "{shown}"); +} diff --git a/apps/figcraft/src/main.rs b/apps/figcraft/src/main.rs index 651cc5212..a646c7d49 100644 --- a/apps/figcraft/src/main.rs +++ b/apps/figcraft/src/main.rs @@ -159,6 +159,7 @@ fn main() -> eframe::Result { log::error!("{f}: {e}"); } } + let opened: Vec = session.docs.iter().map(|d| d.uid).collect(); // Documents a crashed or killed run left unsaved come back; this run keeps its own copies. let recovery_root = services::config_dir().map(|d| d.join("Recovery")); // The preferences first: they hold the online files a recovered document may be one of. @@ -192,6 +193,8 @@ fn main() -> eframe::Result { let mut fig = FigApp::new(session, Box::new(svc)); fig.automation_roots = roots; fig.ui.home = false; + // Files named on the command line are the user's too: their missing fonts are listed. + fig.ui.font_checks = opened; fig.note_recovered(recovered.copies); if let Some(link) = &args.join { figcraft_ui_egui::live::open_invite(&mut fig, link); diff --git a/crates/engine/src/catalog.rs b/crates/engine/src/catalog.rs index c8f34fc15..4b6cd3fcc 100644 --- a/crates/engine/src/catalog.rs +++ b/crates/engine/src/catalog.rs @@ -213,6 +213,8 @@ pub static MENU: &[MenuItem] = &[ m!("Text/Case", "Uppercase", "text.caseUpper"), m!("Text/Case", "Lowercase", "text.caseLower"), m!("Text/Case", "Title case", "text.caseTitle"), + m!("Text", SEP, ""), + m!("Text", "Missing fonts…", "text.missingFonts"), // Arrange m!("Arrange", "Align left", "align.left"), m!("Arrange", "Align horizontal centers", "align.hcenter"), @@ -287,7 +289,7 @@ pub fn items() -> impl Iterator { } /// Items of FigCraft's own that the parity count leaves out (as it does the `collab.` ones). -const OWN: [&str; 2] = ["file.newFromTemplate", "help.gettingStarted"]; +const OWN: [&str; 3] = ["file.newFromTemplate", "help.gettingStarted", "text.missingFonts"]; /// Coverage: (implemented, total, missing ids). `extra` lists ids implemented by the UI layer. pub fn parity(extra: &[&str]) -> (usize, usize, Vec<&'static str>) { diff --git a/crates/engine/src/cmd/mod.rs b/crates/engine/src/cmd/mod.rs index 6579494ca..28fcd81a6 100644 --- a/crates/engine/src/cmd/mod.rs +++ b/crates/engine/src/cmd/mod.rs @@ -79,6 +79,7 @@ fn registry() -> &'static Registry { list.extend(page::specs()); list.extend(view::specs()); list.extend(text::specs()); + list.extend(crate::fonts::specs()); list.extend(styles::specs()); list.extend(image::specs()); list.extend(variables::specs()); diff --git a/crates/engine/src/fonts.rs b/crates/engine/src/fonts.rs new file mode 100644 index 000000000..e20d4d401 --- /dev/null +++ b/crates/engine/src/fonts.rs @@ -0,0 +1,100 @@ +//! Fonts a document names that this machine doesn't have (#752): text layers, their styled +//! ranges, text styles and the string variables bound to a font family. Text in such a family +//! is drawn in a fallback font, so the user is told which ones are missing. + +use std::collections::BTreeMap; + +use figcraft_doc::{Document, NodeKind, StyleKind, VariableValue, Variables}; +use serde_json::{Value, json}; + +use crate::cmd::CommandSpec; +use crate::{Result, Session, spec}; + +/// A family the document names that no installed or built-in font provides. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct Missing { + /// As the document spells it. + pub family: String, + /// Text layers that use it (0: only a text style or a variable names it). + pub layers: usize, +} + +/// The families `doc` names that the font database doesn't have, by name. On the desktop the +/// installed fonts are indexed in the background: ask once that's done +/// (`figcraft_text::system_fonts_scanned`), or every installed family counts as missing. +pub fn missing(doc: &Document) -> Vec { + // Lower-case family → (spelling, layers). + let mut used: BTreeMap = BTreeMap::new(); + let mut add = |family: &str, layer: bool| { + let family = family.trim(); + if family.is_empty() { + return; + } + let e = used.entry(family.to_lowercase()).or_insert_with(|| (family.to_string(), 0)); + e.1 += usize::from(layer); + }; + for n in doc.nodes() { + if let NodeKind::Text(t) = &n.kind { + let mut families: Vec<&str> = t.spans().into_iter().map(|(_, _, st)| st.font_family.as_str()).collect(); + families.push(&t.style.font_family); + families.sort_by_key(|f| f.trim().to_lowercase()); + families.dedup_by_key(|f| f.trim().to_lowercase()); + for f in families { + add(f, true); + } + } + if let Some(var) = n.bound.get("fontFamily") { + for f in string_values(&doc.variables, var) { + add(&f, false); + } + } + } + for st in &doc.styles { + if let StyleKind::Text { style } = &st.kind { + add(&style.font_family, false); + } + if let Some(var) = st.bound.get("fontFamily") { + for f in string_values(&doc.variables, var) { + add(&f, false); + } + } + } + used.into_values().filter(|(family, _)| !figcraft_text::has_family(family)).map(|(family, layers)| Missing { family, layers }).collect() +} + +/// Every string value of variable `id` in any mode, following aliases (at most 32 deep). +fn string_values(vars: &Variables, id: &str) -> Vec { + let mut out = Vec::new(); + let mut todo = vec![(id.to_string(), 0)]; + while let Some((id, depth)) = todo.pop() { + let Some(var) = vars.get(&id) else { continue }; + for v in var.values.values() { + match v { + VariableValue::String(s) => out.push(s.clone()), + VariableValue::Alias(a) if depth < 32 => todo.push((a.clone(), depth + 1)), + _ => {} + } + } + } + out +} + +fn missing_fonts(s: &mut Session, _: &Value) -> Result { + let families: Vec = missing(s.doc()?).into_iter().map(|m| json!({"family": m.family, "layers": m.layers})).collect(); + s.request_ui("dialog.missingFonts", json!({})); + Ok(json!({"families": families})) +} + +pub fn specs() -> Vec { + vec![spec!( + "text.missingFonts", + "Missing fonts", + "{} fonts the open document names that aren't installed (text layers, styled ranges, text styles, font family variables); the app shows them → {families: [{family, layers}]}", + false, + missing_fonts + )] +} + +#[cfg(test)] +#[path = "fonts_tests.rs"] +mod tests; diff --git a/crates/engine/src/fonts_tests.rs b/crates/engine/src/fonts_tests.rs new file mode 100644 index 000000000..6ba925b38 --- /dev/null +++ b/crates/engine/src/fonts_tests.rs @@ -0,0 +1,123 @@ +use serde_json::json; + +use super::*; +use crate::params::id_of; +use figcraft_doc::{Style, StyleRun, TextStyle}; + +fn text(s: &mut Session, family: &str) -> figcraft_doc::NodeId { + let id = id_of(&s.execute("text.create", &json!({"text": "Hamburgefonstiv", "x": 0, "y": 0})).unwrap()["id"]).unwrap(); + if let NodeKind::Text(t) = &mut s.doc_mut().unwrap().get_mut(id).unwrap().kind { + t.style.font_family = family.into(); + } + id +} + +fn families(s: &mut Session) -> Vec<(String, u64)> { + let r = s.execute("text.missingFonts", &json!({})).unwrap(); + r["families"].as_array().unwrap().iter().map(|f| (f["family"].as_str().unwrap().to_string(), f["layers"].as_u64().unwrap())).collect() +} + +/// An installed family (built in, or found by the system scan), if this machine has any. +fn installed() -> Option { + figcraft_text::scan_system_fonts(); + figcraft_text::family_names().into_iter().next() +} + +#[test] +fn lists_families_of_layers_ranges_styles_and_variables_once_each() { + let mut s = Session::new(); + text(&mut s, "FigCraft Missing A"); + let b = text(&mut s, "figcraft missing a"); + if let NodeKind::Text(t) = &mut s.doc_mut().unwrap().get_mut(b).unwrap().kind { + let style = TextStyle { font_family: "FigCraft Missing B".into(), ..t.style.clone() }; + t.runs.push(StyleRun { start: 0, end: 3, style }); + } + let doc = s.doc_mut().unwrap(); + doc.styles.push(Style { + id: "S:1".into(), + name: "Heading".into(), + description: String::new(), + kind: StyleKind::Text { style: TextStyle { font_family: "FigCraft Missing C".into(), ..TextStyle::default() } }, + bound: Default::default(), + }); + s.execute("variable.createCollection", &json!({"name": "Type", "modes": ["Light", "Dark"]})).unwrap(); + s.execute("variable.create", &json!({"collection": "Type", "name": "Family", "type": "string", "value": "FigCraft Missing D"})).unwrap(); + s.execute("variable.set", &json!({"variable": "Family", "mode": "Dark", "value": "FigCraft Missing H"})).unwrap(); + let var = s.doc().unwrap().variables.get("Family").unwrap().id.clone(); + s.doc_mut().unwrap().get_mut(b).unwrap().bound.insert("fontFamily".into(), var); + + assert_eq!( + families(&mut s), + vec![ + ("FigCraft Missing A".to_string(), 2), + ("FigCraft Missing B".to_string(), 1), + ("FigCraft Missing C".to_string(), 0), + ("FigCraft Missing D".to_string(), 0), + ("FigCraft Missing H".to_string(), 0), + ] + ); + assert!(s.ui_requests.iter().any(|r| r.kind == "dialog.missingFonts")); +} + +#[test] +fn installed_families_are_not_listed() { + let Some(family) = installed() else { + eprintln!("skipped: no fonts on this machine"); + return; + }; + let mut s = Session::new(); + text(&mut s, &family); + text(&mut s, &family.to_uppercase()); + text(&mut s, "FigCraft Missing E"); + assert_eq!(families(&mut s), vec![("FigCraft Missing E".to_string(), 1)]); +} + +#[test] +fn a_family_found_only_by_the_system_scan_is_not_missing() { + figcraft_text::scan_system_fonts(); + let embedded: Vec = figcraft_text::CRAFT_FONTS.iter().map(|f| f.family.to_lowercase()).collect(); + let Some(family) = figcraft_text::family_names().into_iter().find(|f| !embedded.contains(&f.to_lowercase())) else { + eprintln!("skipped: no system fonts on this machine"); + return; + }; + let mut s = Session::new(); + text(&mut s, &family); + assert!(families(&mut s).is_empty(), "{family} is installed"); +} + +#[test] +fn blank_families_and_aliases_are_handled() { + let mut s = Session::new(); + text(&mut s, " "); + s.execute("variable.createCollection", &json!({"name": "Type"})).unwrap(); + s.execute("variable.create", &json!({"collection": "Type", "name": "Base", "type": "string", "value": "FigCraft Missing F"})).unwrap(); + let base = s.doc().unwrap().variables.get("Base").unwrap().id.clone(); + let t = text(&mut s, "FigCraft Missing G"); + let doc = s.doc_mut().unwrap(); + // A variable that only aliases another, and one aliasing itself. + let mut alias = doc.variables.get(&base).unwrap().clone(); + alias.id = "V:alias".into(); + alias.name = "Alias".into(); + for v in alias.values.values_mut() { + *v = VariableValue::Alias(base.clone()); + } + let mut cycle = alias.clone(); + cycle.id = "V:cycle".into(); + cycle.name = "Cycle".into(); + for v in cycle.values.values_mut() { + *v = VariableValue::Alias("V:cycle".into()); + } + doc.variables.variables.push(alias); + doc.variables.variables.push(cycle); + doc.get_mut(t).unwrap().bound.insert("fontFamily".into(), "V:alias".into()); + let other = text(&mut s, "FigCraft Missing G"); + s.doc_mut().unwrap().get_mut(other).unwrap().bound.insert("fontFamily".into(), "V:cycle".into()); + // The bound layer takes the value its alias resolves to; the cycle resolves to nothing. + assert_eq!(families(&mut s), vec![("FigCraft Missing F".to_string(), 1), ("FigCraft Missing G".to_string(), 1)]); +} + +#[test] +fn needs_an_open_document() { + let mut s = Session::empty(); + assert!(s.execute("text.missingFonts", &json!({})).is_err()); +} diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 8796dc9c6..8d6f8f0b5 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -28,6 +28,7 @@ pub mod devinspect; pub mod distance; pub mod drop; pub mod file_access; +pub mod fonts; pub mod guard; pub mod guides; pub mod inspect; diff --git a/crates/text/src/fontdb.rs b/crates/text/src/fontdb.rs index d5ff41907..54adc282f 100644 --- a/crates/text/src/fontdb.rs +++ b/crates/text/src/fontdb.rs @@ -835,6 +835,11 @@ pub fn family_names() -> Vec { db().read().unwrap_or_else(std::sync::PoisonError::into_inner).families() } +/// The global db has `family` (embedded, loaded or indexed; any case). +pub fn has_family(family: &str) -> bool { + db().read().unwrap_or_else(std::sync::PoisonError::into_inner).has_family(family) +} + /// Style names of a family in the global db. pub fn family_styles(family: &str) -> Vec { db().write().unwrap_or_else(std::sync::PoisonError::into_inner).styles(family) diff --git a/crates/text/src/lib.rs b/crates/text/src/lib.rs index 27456d824..721471ad9 100644 --- a/crates/text/src/lib.rs +++ b/crates/text/src/lib.rs @@ -16,8 +16,8 @@ mod onpath; pub use breaks::grapheme_step; pub use color::{ColorBitmap, ColorInk, ColorLayer}; pub use fontdb::{ - Axis, CRAFT_FONTS, Coords, Face, FontDb, NamedInstance, axis_label, db, face_with_char, family_names, family_styles, find_face, no_coords, - scan_system_fonts, scan_system_fonts_on_demand, system_fonts_scanned, + Axis, CRAFT_FONTS, Coords, Face, FontDb, NamedInstance, axis_label, db, face_with_char, family_names, family_styles, find_face, has_family, + no_coords, scan_system_fonts, scan_system_fonts_on_demand, system_fonts_scanned, }; pub use layout::{Decoration, Glyph, Line, TextLayout, layout}; pub use onpath::OnPath; diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 9ce38a228..b387db0d8 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -91,6 +91,7 @@ name = "English" "All components" = "All components" "All fonts" = "All fonts" "All supported properties" = "All supported properties" +"All the fonts this file uses are installed" = "All the fonts this file uses are installed" "All variables" = "All variables" "Alpha" = "Alpha" "Alphabetical" = "Alphabetical" @@ -769,6 +770,7 @@ name = "English" "Mirror angle and length" = "Mirror angle and length" "Mirroring" = "Mirroring" "Missing" = "Missing" +"Missing fonts" = "Missing fonts" "Missing layer" = "Missing layer" "Missing style" = "Missing style" "Missing variable" = "Missing variable" @@ -1366,6 +1368,7 @@ name = "English" "This condition is edited as an expression" = "This condition is edited as an expression" "This file" = "This file" "This file has unsaved changes" = "This file has unsaved changes" +"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 fonts that aren't installed on this computer. Their text is drawn in a fallback font until you install them." "This file is on {server}, open only to you. Share it to let others in with a new code." = "This file is on {server}, open only to you. Share it to let others in with a new code." "This frame is new on the branch." = "This frame is new on the branch." "This frame isn't on the branch." = "This frame isn't on the branch." @@ -1562,6 +1565,7 @@ name = "English" "no bleed" = "no bleed" "nobody else here yet" = "nobody else here yet" "now" = "now" +"only in a text style or variable" = "only in a text style or variable" "or" = "or" "point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "point stroke joins were preserved; dashed or variable-width strokes render with the layer join" "prototype actions of unknown types were skipped" = "prototype actions of unknown types were skipped" @@ -1662,6 +1666,7 @@ name = "English" "{n} replies" = { one = "{n} reply", other = "{n} replies" } "{n} rows" = { one = "{n} row", other = "{n} rows" } "{n} styles" = { one = "{n} style", other = "{n} styles" } +"{n} text layers" = { one = "{n} text layer", other = "{n} text layers" } "{n} variables" = { one = "{n} variable", other = "{n} variables" } "{n} weeks ago" = { one = "{n} week ago", other = "{n} weeks ago" } "{n} years ago" = { one = "{n} year ago", other = "{n} years ago" } diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 2849f4ec8..3e70bc838 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -93,6 +93,7 @@ status = "draft — needs native review" "All comments" = "Todos los comentarios" "All components" = "Todos los componentes" "All fonts" = "Todas las fuentes" +"All the fonts this file uses are installed" = "Todas las fuentes que usa este archivo están instaladas" "All supported properties" = "Todas las propiedades compatibles" "All variables" = "Todas las variables" "Alpha" = "Alfa" @@ -772,6 +773,7 @@ status = "draft — needs native review" "Missing" = "No encontrado" "Missing layer" = "Capa no encontrada" "Missing style" = "Estilo no encontrado" +"Missing fonts" = "Fuentes que faltan" "Missing variable" = "Variable no encontrada" "Miter" = "Inglete" "Miter angle" = "Ángulo de inglete" @@ -1367,6 +1369,7 @@ status = "draft — needs native review" "This condition is edited as an expression" = "Esta condición se edita como expresión" "This file" = "Este archivo" "This file has unsaved changes" = "Este archivo tiene cambios sin guardar" +"This file uses fonts that aren't installed on this computer. Their text is drawn in a fallback font until you install them." = "Este archivo usa fuentes que no están instaladas en este equipo. Su texto se dibuja con una fuente de reserva hasta que las instales." "This file is on {server}, open only to you. Share it to let others in with a new code." = "Este archivo está en {server}, abierto solo para ti. Compártelo para dejar entrar a otros con un código nuevo." "This frame is new on the branch." = "Este marco es nuevo en la rama." "This frame isn't on the branch." = "Este marco no está en la rama." @@ -1563,6 +1566,7 @@ status = "draft — needs native review" "no bleed" = "sin sangrado" "nobody else here yet" = "aún no hay nadie más" "now" = "ahora" +"only in a text style or variable" = "solo en un estilo de texto o una variable" "or" = "o" "point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "se conservaron las uniones de trazo de los puntos; los trazos discontinuos o de ancho variable se dibujan con la unión de la capa" "prototype actions of unknown types were skipped" = "se omitieron las acciones de prototipo de tipos desconocidos" @@ -1663,6 +1667,7 @@ status = "draft — needs native review" "{n} replies" = { one = "{n} respuesta", other = "{n} respuestas" } "{n} rows" = { one = "{n} fila", other = "{n} filas" } "{n} styles" = { one = "{n} estilo", other = "{n} estilos" } +"{n} text layers" = { one = "{n} capa de texto", other = "{n} capas de texto" } "{n} variables" = { one = "{n} variable", other = "{n} variables" } "{n} weeks ago" = { one = "hace {n} semana", other = "hace {n} semanas" } "{n} years ago" = { one = "hace {n} año", other = "hace {n} años" } @@ -2083,6 +2088,7 @@ status = "draft — needs native review" "text.listOutdent" = "Reducir sangría de la lista" "text.listStyle" = "Estilo de lista" "text.maxLines" = "Máximo de líneas" +"text.missingFonts" = "Fuentes que faltan" "text.numberList" = "Lista numerada" "text.onPath" = "Texto en trazado" "text.paragraphIndent" = "Sangría de párrafo" diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 39001b56e..448501abf 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -151,6 +151,7 @@ pub fn keys(app: &mut FigApp, ctx: &Context) { || u.find.is_some() || u.batch_rename.is_some() || u.import_report.is_some() + || u.missing_fonts.is_some() || u.confirm_close || u.export_preview || u.shortcuts_panel @@ -164,6 +165,7 @@ pub fn keys(app: &mut FigApp, ctx: &Context) { || u.find.take().is_some() || u.batch_rename.take().is_some() || u.import_report.take().is_some() + || u.missing_fonts.take().is_some() { return; } @@ -178,6 +180,7 @@ pub fn show(app: &mut FigApp, ctx: &Context) { // Dropped files waiting to open: their card, then (once it has shown) the files. crate::pending_open::pending_opens(app, ctx); crate::import_report::show(app, ctx); + crate::missing_fonts::show(app, ctx); let t = Tokens::get(ctx); if app.ui.about { let mut open = true; diff --git a/crates/ui-egui/src/import_report_tests.rs b/crates/ui-egui/src/import_report_tests.rs index 8742ccd33..a24115823 100644 --- a/crates/ui-egui/src/import_report_tests.rs +++ b/crates/ui-egui/src/import_report_tests.rs @@ -108,7 +108,7 @@ fn escape_closes_the_import_report_like_other_simple_dialogs() { assert!(u.app.ui.import_report.is_none(), "Escape closes the report"); } -fn shown_texts(shapes: Vec) -> Vec { +pub(crate) fn shown_texts(shapes: Vec) -> Vec { fn walk(shape: &egui::Shape, out: &mut Vec) { match shape { egui::Shape::Text(t) => out.push(t.galley.text().to_string()), diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 360955a33..1316faa31 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -40,6 +40,7 @@ pub mod live; pub mod live_text; pub mod measure_overlay; pub mod menus; +pub mod missing_fonts; pub mod online; pub mod pending_open; pub mod plugins_ui; @@ -143,6 +144,8 @@ mod menu_aim_tests; #[cfg(test)] mod menu_input_tests; #[cfg(test)] +mod missing_fonts_tests; +#[cfg(test)] mod online_tests; #[cfg(test)] mod open_issues_tests; @@ -494,6 +497,9 @@ pub struct UiState { pub pending_open_frames: u8, /// The latest successful file import's summary and compatibility notes. pub import_report: Option, + /// Files the user opened whose fonts are yet to be checked (by document uid). + pub font_checks: Vec, + pub missing_fonts: Option, pub screenshot_requests: Vec<(u64, String)>, pub frame_ms: f64, pub render_ms: f64, @@ -619,6 +625,8 @@ impl Default for UiState { pending_opens: Vec::new(), pending_open_frames: 0, import_report: None, + font_checks: Vec::new(), + missing_fonts: None, screenshot_requests: Vec::new(), frame_ms: 0.0, render_ms: 0.0, @@ -747,6 +755,7 @@ impl FigApp { if let Some(result) = &result { import_report::capture(self, id, ¶ms, result); } + missing_fonts::check_later(self, id, result.as_ref()); result } @@ -861,6 +870,7 @@ impl FigApp { self.ui.about_tab = dialogs::AboutTab::About; } "dialog.preferences" => self.ui.preferences = true, + "dialog.missingFonts" => missing_fonts::request(self), "panel.shortcuts" => self.ui.shortcuts_panel = !self.ui.shortcuts_panel, "palette.actions" => menus::toggle_palette(&mut self.ui), "panel.design" => self.ui.right_tab = RightTab::Design, @@ -1636,6 +1646,7 @@ impl FigApp { "importReport": self.ui.import_report.as_ref().map(import_report::Report::inspect), }); state["pendingOpens"] = json!(self.ui.pending_opens.len()); + state["missingFonts"] = json!(self.ui.missing_fonts.as_ref().map(missing_fonts::Shown::inspect)); state } } diff --git a/crates/ui-egui/src/missing_fonts.rs b/crates/ui-egui/src/missing_fonts.rs new file mode 100644 index 000000000..8236ca90a --- /dev/null +++ b/crates/ui-egui/src/missing_fonts.rs @@ -0,0 +1,102 @@ +//! The Missing fonts window (#752): the fonts a file uses that aren't installed, whose text is +//! drawn in a fallback font. It opens by itself after the user opens a file that has any (once +//! the installed fonts are indexed and any import report is closed), and from Text ▸ Missing fonts. + +use egui::RichText; +use figcraft_engine::fonts::{Missing, missing}; +use serde_json::{Value, json}; + +use crate::FigApp; +use crate::i18n::{tr, trn}; +use crate::theme::{Tokens, regular}; + +#[derive(Clone, Debug)] +pub struct Shown { + /// The document it lists: the window goes when that document closes. + pub uid: u64, + pub families: Vec, +} + +impl Shown { + pub fn inspect(&self) -> Value { + json!({"families": self.families.iter().map(|m| json!({"family": m.family, "layers": m.layers})).collect::>()}) + } +} + +/// After a file the user opened (or imported into) is in front: look for missing fonts in it +/// once that can be told ([`show`]). +pub fn check_later(app: &mut FigApp, command: &str, result: Option<&Value>) { + if result.is_some() + && matches!(command, "file.open" | "file.openRecent" | "file.import") + && let Ok(ds) = app.session.ds() + { + app.ui.font_checks.push(ds.uid); + } +} + +/// The window for document `uid`, listing what it misses (even nothing, when asked for). +fn list(app: &mut FigApp, uid: u64) -> Option> { + let ds = app.session.docs.iter().find(|d| d.uid == uid)?; + let families = missing(&ds.doc); + app.ui.missing_fonts = Some(Shown { uid, families: families.clone() }); + Some(families) +} + +/// Text ▸ Missing fonts (`dialog.missingFonts`): the window for the file in front. +pub fn request(app: &mut FigApp) { + if let Ok(uid) = app.session.ds().map(|d| d.uid) { + list(app, uid); + } +} + +/// Installed fonts are indexed: before that, every one of them would count as missing. The +/// browser has only its built-in fonts, so files there don't open the window by themselves. +fn fonts_known() -> bool { + !cfg!(target_arch = "wasm32") && figcraft_text::system_fonts_scanned() +} + +pub fn show(app: &mut FigApp, ctx: &egui::Context) { + if !app.ui.font_checks.is_empty() && app.ui.import_report.is_none() && app.ui.missing_fonts.is_none() && fonts_known() { + let uid = app.ui.font_checks.remove(0); + if list(app, uid).is_some_and(|f| f.is_empty()) { + app.ui.missing_fonts = None; + } + } + if app.ui.missing_fonts.as_ref().is_some_and(|m| !app.session.docs.iter().any(|d| d.uid == m.uid)) { + app.ui.missing_fonts = None; + } + let Some(shown) = &app.ui.missing_fonts else { return }; + let t = Tokens::get(ctx); + let mut open = true; + let mut close_clicked = false; + crate::dialogs::window(tr("Missing fonts"), ctx).open(&mut open).show(ctx, |ui| { + ui.set_width(380.0); + if shown.families.is_empty() { + ui.label(tr("All the fonts this file uses are installed")); + } else { + ui.label( + RichText::new(tr( + "This file uses fonts that aren't installed on this computer. Their text is drawn in a fallback font until you install them.", + )) + .color(t.text_secondary) + .font(regular(11.0)), + ); + ui.add_space(6.0); + egui::ScrollArea::vertical().id_salt("missing_fonts").max_height(260.0).show(ui, |ui| { + for m in &shown.families { + ui.horizontal(|ui| { + ui.label(RichText::new(&m.family).strong()); + let used = + if m.layers == 0 { tr("only in a text style or variable").to_string() } else { trn("{n} text layers", m.layers, &[]) }; + ui.label(RichText::new(used).color(t.text_secondary)); + }); + } + }); + } + ui.add_space(12.0); + close_clicked = crate::widgets::button(ui, tr("Close"), true, true).clicked(); + }); + if !open || close_clicked { + app.ui.missing_fonts = None; + } +} diff --git a/crates/ui-egui/src/missing_fonts_tests.rs b/crates/ui-egui/src/missing_fonts_tests.rs new file mode 100644 index 000000000..ba86cc7e4 --- /dev/null +++ b/crates/ui-egui/src/missing_fonts_tests.rs @@ -0,0 +1,112 @@ +use figcraft_engine::Session; +use serde_json::{Value, json}; + +use crate::import_report::Report; +use crate::layers_drag_tests::Ui; + +/// A saved file with text in `families` (the first two layers share the first family). +fn saved(name: &str, families: &[&str]) -> String { + let mut s = Session::new(); + for (i, f) in families.iter().chain(families.first()).enumerate() { + s.execute("text.create", &json!({"text": "Hamburgefonstiv", "x": 0, "y": 40 * i, "props": {"fontFamily": f}})).unwrap(); + } + let path = std::env::temp_dir().join(format!("figcraft-missing-fonts-{name}-{}.figcraft", std::process::id())); + let path = path.to_string_lossy().into_owned(); + s.execute("file.saveAs", &json!({"path": path})).unwrap(); + path +} + +/// The installed fonts are indexed, as the desktop app does at startup; false when this machine +/// opted out (nothing would ever count as known). +fn fonts_indexed() -> bool { + figcraft_text::scan_system_fonts(); + figcraft_text::system_fonts_scanned() +} + +fn listed(u: &Ui) -> Value { + u.app.inspect()["missingFonts"].clone() +} + +#[test] +fn opening_a_file_lists_its_missing_fonts_and_not_the_installed_ones() { + if !fonts_indexed() { + eprintln!("skipped: system fonts opted out"); + return; + } + let installed = figcraft_text::family_names().into_iter().next(); + let mut families = vec!["FigCraft Missing UI"]; + families.extend(installed.as_deref()); + let path = saved("open", &families); + let mut u = Ui::new(Session::new()); + // Programmatic opens (control channel, MCP, scripts) never open the window. + u.app.run("file.open", json!({"path": path})); + u.frame(vec![]); + assert_eq!(listed(&u), Value::Null); + + u.app.run_user("file.open", json!({"path": path})); + std::fs::remove_file(&path).unwrap(); + u.frame(vec![]); + assert_eq!(listed(&u), json!({"families": [{"family": "FigCraft Missing UI", "layers": 2}]})); + u.frame(vec![]); + let shown = u.frame_output(vec![]).shapes; + assert!(crate::import_report_tests::shown_texts(shown).iter().any(|t| t == "2 text layers")); + + // It goes with its file. + u.app.run("file.close", json!({})); + u.frame(vec![]); + assert_eq!(listed(&u), Value::Null); +} + +#[test] +fn a_file_without_missing_fonts_opens_no_window() { + if !fonts_indexed() { + eprintln!("skipped: system fonts opted out"); + return; + } + let Some(installed) = figcraft_text::family_names().into_iter().next() else { + eprintln!("skipped: no fonts on this machine"); + return; + }; + let path = saved("clean", &[&installed]); + let mut u = Ui::new(Session::new()); + u.app.run_user("file.open", json!({"path": path})); + std::fs::remove_file(&path).unwrap(); + u.frame(vec![]); + assert_eq!(listed(&u), Value::Null); + assert!(u.app.ui.font_checks.is_empty(), "the check ran"); +} + +#[test] +fn it_waits_for_the_import_report_to_close() { + if !fonts_indexed() { + eprintln!("skipped: system fonts opted out"); + return; + } + let path = saved("report", &["FigCraft Missing Report"]); + let mut u = Ui::new(Session::new()); + u.app.run_user("file.open", json!({"path": path})); + std::fs::remove_file(&path).unwrap(); + let mut report = + Report::from_result("file.open", &json!({}), &json!({"warnings": ["Synthetic note"], "summary": {"name": "Synthetic"}})).unwrap(); + report.uid = u.app.session.ds().unwrap().uid; + u.app.ui.import_report = Some(report); + u.frame(vec![]); + assert_eq!(listed(&u), Value::Null, "the import report comes first"); + u.app.ui.import_report = None; + u.frame(vec![]); + assert_eq!(listed(&u)["families"][0]["family"], "FigCraft Missing Report"); +} + +#[test] +fn text_menu_shows_the_window_for_the_file_in_front_even_with_nothing_missing() { + let mut u = Ui::new(Session::new()); + assert!(u.app.run("text.missingFonts", json!({})).is_some()); + assert_eq!(listed(&u), json!({"families": []})); + u.frame(vec![]); + let shown = u.frame_output(vec![]).shapes; + assert!(crate::import_report_tests::shown_texts(shown).iter().any(|t| t == "All the fonts this file uses are installed")); + let escape = + vec![egui::Event::Key { key: egui::Key::Escape, physical_key: None, pressed: true, repeat: false, modifiers: egui::Modifiers::NONE }]; + u.frame(escape); + assert_eq!(listed(&u), Value::Null, "Escape closes it"); +} diff --git a/docs/cli.md b/docs/cli.md index 7b35c2d54..7af73fd60 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -29,7 +29,9 @@ be open to the public: [server.md](server.md#running-a-public-server)). See [ser ### `info [--json]` Pages, node counts, top-level frames (id, type, name, size), style/variable/image counts. Repairs -of a damaged file and import warnings go to stderr as `note:` lines (`notes` with `--json`). +of a damaged file and import warnings go to stderr as `note:` lines (`notes` with `--json`). Fonts the +file names that aren't installed are listed as `missing font` lines (`missingFonts: [{family, +layers}]` with `--json`); their text renders in a fallback font. Every subcommand that reads a file also takes the public REST API file JSON (the response of `GET /v1/files/:key` or of its nodes endpoint, written to a `.json` file): it is imported on the fly. diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 250d796a1..68f00f940 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -156,12 +156,13 @@ each. | Local fonts | yes (font helper / desktop app) | yes (system scan) | | 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 | warnings only (REST import) | +| Missing fonts on open | listed, with replacement | listed (Missing fonts window after an open, Text ▸ Missing fonts…, `text.missingFonts`, `figcraft-cli info`); no replacement; text draws in a fallback font | ## Revision history | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Missing fonts (#752): the fonts a file names that aren't installed (text layers, styled ranges, text styles, font family variables in any mode) are listed when the user opens it (once installed fonts are indexed and any import report is closed), from Text ▸ Missing fonts…, by `text.missingFonts` and by `figcraft-cli info`. The row claimed REST import warnings no code produced. | | 2026-10-17 | minor | Hug on import (#732): auto layout frames a `.fig` records no primary-axis sizing for hug on that axis (auto layout sized that axis by its content before it could be fixed) instead of turning fixed, instances that record no auto layout take their main's (they came in without auto layout and fixed, so longer text overflowed them), REST frames whose sizing modes are left out hug (the documented default), and text hugs by its resize mode (auto width both axes, auto height its height; it came in fixed). Numbers unchanged | | 2026-10-17 | minor | Instance layers' own size and resizing (#731): a `.fig` import keeps the sizes an instance gives its layers and their hug/fill/fixed and min/max as overrides, a REST import reads the resizing fields of `overrides`, and a `.fig` export writes a layer's own size as an override (it went with the derived layout, which a relayout replaces). Numbers unchanged | | 2026-10-14 | minor | SVG/PDF depth overflow (#208) is checked before bounds and drawing; public checked APIs return the offending root/layer, commands and CLI report it, and no incomplete export replaces an existing file. Tested at depths 255/256/257, with inner roots, hidden branches, masks, raster fallbacks and multiple roots/pages. Numbers unchanged. | diff --git a/docs/mcp.md b/docs/mcp.md index 12d1a871c..aa045e61e 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -233,6 +233,8 @@ Or in a project's `.mcp.json`: user units, e.g. `{"wght": 550, "wdth": 85}` (`null` = back to what the style name implies); `text.setVariations {variations, replace?}` merges instead. `text.fonts {family, style?, axes: true}` lists a font's axes and named instances (named instances are also valid `fontStyle` values). + `text.missingFonts` lists the families the document names that aren't installed + (`{families: [{family, layers}]}`); their text draws in a fallback font. OpenType features: `features {"liga": false, "tnum": true}`. Decorations: `textDecorationStyle` (`solid`, `dotted`, `wavy`), `textDecorationThickness` and `textDecorationOffset` (`auto`, px, or `"10%"` of the font size; the offset runs from the baseline From c6d643347329060f8f0d737124025f5158c090dd Mon Sep 17 00:00:00 2001 From: BFlat Date: Sat, 17 Oct 2026 21:56:26 +0700 Subject: [PATCH 190/817] Docs: parity rows for the 2026-10-17 landings (#756) Brings the progress docs up to date with what landed on 2026-10-17: community batches #727, #728, #733, #735, #736 and #753, plus #729, #745, #746 and #751. Docs only. --- ROADMAP.md | 25 +++++----- docs/auto-layout-parity.md | 5 +- docs/collaboration-parity.md | 7 +-- docs/components-parity.md | 9 ++-- docs/file-format-parity.md | 16 ++++--- docs/gaps.md | 93 ++++++++++++++++++++++++++---------- docs/hardware-parity.md | 7 +-- docs/localization-parity.md | 73 ++++++++++++++-------------- docs/parity-checklist.md | 6 +-- docs/prototyping-parity.md | 5 +- docs/roadmap.md | 3 +- docs/target-app-parity.md | 23 ++++++--- docs/ui-parity.md | 29 ++++++----- 13 files changed, 187 insertions(+), 114 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index a8ae28ab1..3908e591c 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -13,7 +13,7 @@ start with [`docs/gaps.md`](docs/gaps.md). | | Value | Kind | |---|---|---| -| Menu/command breadth | **100%** (211 / 211) | measured, [`docs/parity-checklist.md`](docs/parity-checklist.md) (`cargo xtask parity`) | +| Menu/command breadth | **100%** (212 / 212) | measured, [`docs/parity-checklist.md`](docs/parity-checklist.md) (`cargo xtask parity`) | | Feature breadth | **~85%** (core editor ~94%) | estimated, [`docs/target-app-parity.md`](docs/target-app-parity.md) | | Ready for real work | **~53%** | estimated, same doc (written dimension weights and scores) | | Essentials user | **~59%** | estimated: core features 77.8% × 0.92 launch/stability × 0.94 discoverability × 0.88 opening files people send ([method](docs/target-app-parity.md#essentials-user)) | @@ -99,21 +99,21 @@ native speakers' reviews of the six language drafts need people. | Language | Code | Strings | Status | |---|---|---|---| | English | en | 100% | full | -| Simplified Chinese | zh-Hans | 100% | draft (needs native review) | -| Spanish | es, es-419 | 100% (es-419: an overlay of 98 entries) | draft (needs native review) | +| Simplified Chinese | zh-Hans | 95% | draft (needs native review) | +| Spanish | es, es-419 | 100% (es-419: an overlay of 101 entries) | draft (needs native review) | | Hindi | hi | 0% | none | | Arabic | ar | 0% | none | -| French | fr | 100% | draft (needs native review) | -| Portuguese (Brazil) | pt-BR | 100% | draft (needs native review) | -| Indonesian | id | 0% | none | -| Japanese | ja | 100% | draft (needs native review) | -| German | de | 100% | draft (needs native review) | -| Korean | ko | 100% | draft (needs native review) | +| French | fr | 95% | draft (needs native review) | +| Portuguese (Brazil) | pt-BR | 95% | draft (needs native review) | +| Indonesian | id | 99% | draft (needs native review) | +| Japanese | ja | 99% | draft (needs native review) | +| German | de | 96% | draft (needs native review) | +| Korean | ko | 95% | draft (needs native review) | | Vietnamese | vi | 0% | none | -Also shipped: Swedish (`sv`: every UI string, 120 of 588 command labels and menu wordings; native review welcome). Figma ships English, Japanese, Korean, French, German, Spanish and Portuguese +Percentages measured 2026-10-17 over 2,272 entries (strings added since a draft show English). Also shipped: Russian (`ru`, 99%, reviewed by VanTan), Swedish (`sv`, 99.6%, command labels since 2026-10-17; native review welcome), Turkish (`tr`, 99%) and Czech (`cs`, 99%, draft). Figma ships English, Japanese, Korean, French, German, Spanish and Portuguese (Brazil); FigCraft has the localization layer, English and Spanish (Spain and Latin America), -French, German, Brazilian Portuguese, Japanese, Korean and Simplified Chinese drafts (Preferences ▸ +French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese and Indonesian drafts (Preferences ▸ Language; Traditional Chinese has no catalog; CJK UI text uses an installed CJK font, loaded only when needed; adding a language: [`docs/translating.md`](docs/translating.md)). Document text in any script (bidi, Arabic shaping, @@ -316,6 +316,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | | 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | diff --git a/docs/auto-layout-parity.md b/docs/auto-layout-parity.md index ae230608f..ea2cc54f5 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-10-13 · **Change:** minor (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-10-17 · **Change:** minor (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%, @@ -69,7 +69,7 @@ Status: **pass** (a case in the suite holds), **fixed** (the suite found a diver | 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 | | -| Suggest auto layout / "Add auto layout" on a selection | done | | +| Suggest auto layout / "Add auto layout" on a selection | done | adding auto layout to an empty frame keeps its size, Fixed (it collapsed to 20×20); a frame with content still hugs it, as does a new frame wrapped around a selection (#369). `node.set` with auto layout keys on a mix of layers applies them to the frames and warns about the rest instead of failing the whole call (#603) | | Real Figma files laid out identically | **not checked** | needs `.fig` or REST import of real files ([gaps](gaps.md) #1, #3) | | Performance: re-flow only where sizes or places changed | done | measured in `cargo xtask bench` (components at scale) | @@ -77,6 +77,7 @@ Status: **pass** (a case in the suite holds), **fixed** (the suite found a diver | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Community batch #753: adding auto layout to an empty frame keeps its size, Fixed, while a frame with content hugs it (#369); `node.set` applies auto layout keys to the frames among its targets and warns about the others, and a font style the family lacks warns with the nearest face (#603). Checked over MCP. Numbers unchanged | | 2026-10-13 | minor | Auto layout, on-canvas handles of automatic gaps (M2): the handle between spread rows or columns (and between items with an auto gap) shows the distance the layout gives the gap instead of the stored value, and dragging it makes the gap a fixed one from there, as typing a gap in the panel does; one undo step (`gap_handle_tests`). Before, the drag changed a value that had no effect. The documentation is silent on dragging an automatic gap. Numbers unchanged. | | 2026-10-13 | minor | Auto layout, wrapped-line alignment (M2): a wrapping layout's lines (rows of a horizontal one, columns of a vertical one) are packed where the cross alignment says (start, centre, end; before, they always sat at the start), stretch when every child fills across the flow, or take the free space between them (`contentAlign: spaceBetween`, the Design panel's Row/Column gap mode, the alignment pad lighting the whole cross axis). Read from REST JSON and `.fig`, written to `.fig`, `align-content` in CSS, an instance override with the other alignment settings. 13 hand-computed layout cases and command tests. Numbers unchanged. | | 2026-10-11 | minor | Behaviour suite from the public documentation (64 layout cases, 8 command tests). Fixed: padding floor, inside-only included strokes (and included by default), auto gaps stop at 0, grid `fr` like CSS `fr`, canvas stacking actually drawn and hit. Added: auto gaps evenly/around, vertical wrap, grid cell alignment, strokes and canvas stacking controls. Breadth 95% → 98%, ready 68% → 74%, remaining 6–12 h → 3–6 h | diff --git a/docs/collaboration-parity.md b/docs/collaboration-parity.md index 95084d740..ae503633d 100644 --- a/docs/collaboration-parity.md +++ b/docs/collaboration-parity.md @@ -1,6 +1,6 @@ # Collaboration parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-14 · **Change:** minor (removing someone from a live session; live-session revert guard; live sessions per document; a public figcraft-server: open hosting, owner tokens, per-address limits, idle expiry, moderation, install.sh; cursor chat and spotlight in live sessions; branch version history and finer list merges; comments and version history behaviour suite and fixes; hosting the server: `wss://` in the desktop app, server releases, deployment guide; team libraries on the server and swap library; branches: create, update from main, review and merge; wording: the standalone server with share links to edit or view; numbers unchanged) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (server message limits follow `max_file_mb`; a damaged log generation field keeps flushed edits; the web build joins from a `#join=` link; removing someone from a live session; live-session revert guard; live sessions per document; a public figcraft-server: open hosting, owner tokens, per-address limits, idle expiry, moderation, install.sh; cursor chat and spotlight in live sessions; branch version history and finer list merges; comments and version history behaviour suite and fixes; hosting the server: `wss://` in the desktop app, server releases, deployment guide; team libraries on the server and swap library; branches: create, update from main, review and merge; wording: the standalone server with share links to edit or view; numbers unchanged) · **Target:** Figma Design (desktop app 126.10.7) Figma is multiplayer first; FigCraft is local first. **Ready ~13% (estimated):** comments, version history and branches (review and merge) work inside one file; the real-time collaboration core landed in #103 (sync model, @@ -12,10 +12,10 @@ cursors, selections, text carets, cursor chat and spotlights shown live ([`colla | Feature | Figma | FigCraft | Hours | |---|---|---|---| -| Real-time co-editing | yes | **core built, no networking** (#103): client-scoped ids, per-property change sets with fractional positions, server ordering and validation, optimistic clients, binary messages; randomized multi-client convergence tests over real commands. Live sessions over the network landed (`crates/collab-net`): the WebSocket transport (keep-alive, size and rate limits, reconnect with backoff), hosting from the app (this machine or the local network) with invite links, live cursors with name tags, selections, avatars and follow, `collab.*` commands. Document sync between apps works over them (the host's server orders every batch; guests open the host's file as a new tab). Sessions are per document: each open file has its own or none, several run at once (host one, join another, publish a third) and keep syncing behind the tab in front, and closing a file ends its session only. Revert to saved is refused until the document leaves its live session; its access checks and sync association stay intact. Undo is per person (only your own steps, others' later writes left alone), refused edits roll back with a toast, and a reconnect resumes as the same client with what it missed (or a snapshot) and sends what was made offline. The browser build joins (same messages through the browser's WebSocket API); `figcraft://` invite links open the desktop app and join. Styles, variables, collections, modes and comments made in a session take ids from their creator's space (the server checks it), so concurrent creations all survive; modes, per-mode values and replies inside one entry still resolve last-writer-wins. A standalone `figcraft-server` keeps many files, persists them (a snapshot plus a log, compacted), loses nothing confirmed across a restart (apps resume as the same participants) and takes files published from the app (File ▸ Publish to server…). The desktop app and the CLI open `wss://` links too (TLS through a reverse proxy), and releases ship the server for Linux with a deployment guide (systemd, Caddy, nginx, Docker) and `install.sh`. A server can be open to the public: anyone publishes without the key, within limits per address, and files nobody opens expire. Left: server archives beyond Linux | 25–55 | +| Real-time co-editing | yes | **core built, no networking** (#103): client-scoped ids, per-property change sets with fractional positions, server ordering and validation, optimistic clients, binary messages; randomized multi-client convergence tests over real commands. Live sessions over the network landed (`crates/collab-net`): the WebSocket transport (keep-alive, size and rate limits, reconnect with backoff), hosting from the app (this machine or the local network) with invite links, live cursors with name tags, selections, avatars and follow, `collab.*` commands. Document sync between apps works over them (the host's server orders every batch; guests open the host's file as a new tab). Sessions are per document: each open file has its own or none, several run at once (host one, join another, publish a third) and keep syncing behind the tab in front, and closing a file ends its session only. Revert to saved is refused until the document leaves its live session; its access checks and sync association stay intact. Undo is per person (only your own steps, others' later writes left alone), refused edits roll back with a toast, and a reconnect resumes as the same client with what it missed (or a snapshot) and sends what was made offline. The browser build joins (same messages through the browser's WebSocket API); `figcraft://` invite links open the desktop app and join. Styles, variables, collections, modes and comments made in a session take ids from their creator's space (the server checks it), so concurrent creations all survive; modes, per-mode values and replies inside one entry still resolve last-writer-wins. A standalone `figcraft-server` keeps many files, persists them (a snapshot plus a log, compacted), loses nothing confirmed across a restart (apps resume as the same participants) and takes files published from the app (File ▸ Publish to server…). The desktop app and the CLI open `wss://` links too (TLS through a reverse proxy), and releases ship the server for Linux with a deployment guide (systemd, Caddy, nginx, Docker) and `install.sh`. A server can be open to the public: anyone publishes without the key, within limits per address, and files nobody opens expire. Message limits follow the server's `max_file_mb`, so files above 64 MiB publish and open (the client takes at most 1 GiB from a server, and the server warns when large limits meet open publishing, #705); a damaged generation field in a file's log no longer drops the edits flushed to it (#687). Left: server archives beyond Linux | 25–55 | | Live cursors, selections, viewports; follow / observation mode; spotlight | yes | **done, in live sessions**: named cursors, selection outlines, avatars, follow (click an avatar), others' text carets and selected characters with their names, a note when two people type in one layer; spotlight (your avatar's menu, `collab.spotlight`): everyone follows your view and page, people who join later too, anyone who moves their view stops following and a banner offers to follow again, a newer spotlight takes over. Left: polish (no accounts, so anyone in the session can spotlight) | 2–4 | | Cursor chat, audio, high-fives | yes | **partial, in live sessions**: cursor chat (`/` opens a bubble at your pointer; everyone sees it as you type, it fades a few seconds after the last change, Enter sends and Escape takes it back, 100 characters; `collab.cursorChat` for agents); sent as ephemeral presence the host checks and rate-limits, never stored. No audio, high-fives or emote reactions | 2–5 | -| Share links, permissions (view / edit), teams and projects | yes | **partial**: sharing with a join code from the Share popover (online: the file goes to the server in Preferences and the server names its edit and view links with short codes; local network: the app hosts and the code carries its address; one field joins with a code or a link, in the popover and on the home screen); `figcraft-server` share links per file with edit or view access (a viewer sees changes and presence, a "View only" badge and only the moving tools; the server refuses its edits), revocable at once, tokens stored as hashes; managed from the app's Share popover (first links), the server's command line or a managing connection. On a server open to the public, whoever published a file manages it with its owner token (links, name, removal: `collab.manageFile`), which the app remembers: Home ▸ Online lists your online files (open again as owner, start and stop sharing, copy the code, rename, remove, forget), with one request per server for what became of them; anyone in a file can report it, and the operator blocks addresses. The person hosting a session, or a file's owner, removes someone from it (right-click their avatar, `collab.removePerson`): they are disconnected and their address can't join that file again while it runs. The list is per computer: no accounts, teams or projects | 8–17 | +| Share links, permissions (view / edit), teams and projects | yes | **partial**: sharing with a join code from the Share popover (online: the file goes to the server in Preferences and the server names its edit and view links with short codes; local network: the app hosts and the code carries its address; one field joins with a code or a link, in the popover and on the home screen; the browser build also joins from a link in its URL's fragment, `#join=…`, which never reaches the web host's logs, capped at 6 KiB and checked like a `figcraft://` link (#712; unit-tested, not run in a browser)); `figcraft-server` share links per file with edit or view access (a viewer sees changes and presence, a "View only" badge and only the moving tools; the server refuses its edits), revocable at once, tokens stored as hashes; managed from the app's Share popover (first links), the server's command line or a managing connection. On a server open to the public, whoever published a file manages it with its owner token (links, name, removal: `collab.manageFile`), which the app remembers: Home ▸ Online lists your online files (open again as owner, start and stop sharing, copy the code, rename, remove, forget), with one request per server for what became of them; anyone in a file can report it, and the operator blocks addresses. The person hosting a session, or a file's owner, removes someone from it (right-click their avatar, `collab.removePerson`): they are disconnected and their address can't join that file again while it runs. The list is per computer: no accounts, teams or projects | 8–17 | | Comments: pins on frames and layers, threads, reactions, @mentions, resolve, unread, search and filters, links, in the presenter | yes (shared) | **done, local**: stored in the file, your name from Preferences; a behaviour suite from the documentation (pinning and following layers, threads, own edits and deletes, mentions, reactions, C and Shift+C, stepping, filters, saving, copy and paste); restoring a version keeps them. In a live session threads sync and anyone in it can reply, react and resolve (no accounts: a name is who you are) | (shared once multiplayer lands) | | Version history: named versions, autosave checkpoints, view before restore, restore, duplicate | yes (cloud) | **done**, saved in the `.figcraft` file: restoring keeps the replaced design as an autosave first, a titled autosave becomes a named version, merging a branch records the file before and after. Versions are per person in a live session (a shared history needs accounts); no comparing two versions (Dev Mode compares a ready-for-dev layer with its state when marked) | — | | Branching and merging | yes (paid plans) | **done, local**: branches saved in the `.figcraft` file, each opened in its own tab; Review and merge shows both sides' changes since the branch was made and the conflicts (the same property on both sides, or a layer deleted on one side and edited on the other), each resolved for the branch or main; merge as one undo step (the branch is archived, the main file's history gets a version for the merge), update from main, archive. Each branch keeps its own version history (saved, viewed and restored on the branch tab, kept when it is merged or archived); fills, strokes and effects merge item by item. Left: branches in live sessions; other lists (text runs, export settings) conflict as a whole | 1–2 | @@ -26,6 +26,7 @@ cursors, selections, text carets, cursor chat and spotlights shown live ([`colla | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | From community batch #735: server message limits follow `max_file_mb`, so files above 64 MiB publish and open, the client takes at most 1 GiB and the server warns about large limits with open publishing (#705); a damaged generation field no longer drops a log's flushed edits (#687); the web build joins a session from a `#join=` link in its URL (#712, unit-tested and built for wasm, not run in a browser). Percentages and hours unchanged | | 2026-10-14 | minor | Removing someone from a live session (M9, from the owner's use: whoever joined with the invite couldn't be put out short of ending the session for everyone): right-click a person's avatar ▸ "Remove from session", or `collab.removePerson {client}`, when you host the session or own the file on a server (owner token). The hub closes their connection as the session's end for them (they keep their copy and don't reconnect) and bars their address from that file while the session or server runs, so the code or link they hold no longer gets them in; everyone else stays. Protocol addition within version 2 (`Admin removePeer`; older servers say they can't). Addresses are the only identity without accounts: people behind one address are barred together. Percentages and hours unchanged | | 2026-10-13 | minor | Live-session revert guard (M9, #198): `file.revert` is refused while its document belongs to a live session, including publishing, reconnecting and hosting before the welcome. The document, previews, branch tabs and session stay intact; leave the session before reverting a local save. Offline revert is unchanged. Scripted access and sync regressions in `live_access_tests`. Numbers unchanged. | | 2026-10-12 | minor | Your online files (M9): a file put on a server without its key stays its owner's after its tab closes or the app quits. The app records each one with the preferences (server, id, name, owner token, the owner's links, the codes others join with; at most 200; the token never in a command result, `ui.inspect`, a log or debug output) and Home ▸ **Online** lists them: open one as its owner (a new tab, or its tab comes to the front), Start / Stop sharing, Copy code / Copy link, Rename on the server, Remove from server (confirmed), Forget (the file stays on the server). Nothing is asked of a server until the section opens; then one request per server (`Admin owned`, a compatible addition within protocol version 2) says which files are still there, and a server that is offline or older leaves the list as recorded. Tabs of files in a live session carry a mark (shared, or open only to you), toasts about a file that isn't in front name it, and after a crash a recorded file reopens from its server as its owner, its recovery copy kept until its unsent changes are back on the server (or it is opened beside the file). `collab.files`, `collab.openFile`, `collab.forgetFile`; `collab.manageFile` takes its server and token from the record and gains `share` / `unshare`. Files are known per computer, not per person (no accounts): percentages and hours unchanged | diff --git a/docs/components-parity.md b/docs/components-parity.md index 1ecd96867..3b9793b03 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-10-14 · **Change:** minor (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-10-17 · **Change:** minor (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 @@ -19,14 +19,14 @@ accounts). | Component sets / variants, add variant, switch | done | | | 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 | reordering through `component.editProperty {index}`; no drag in the panel yet | +| 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 | | | Slots (preferred components, fill menu, kept across updates) | done | Figma 2025 feature | | Exposed nested instances | done | hidden ones hide their properties | | Descriptions | done | | | Instance swap: panel, Alt-drop from Assets | done | the panel keeps overrides on same-named layers, an Alt-drop from Assets only text layers' | | Assets panel: folders by page, frame and slash names (fold away), thumbnails, search, drag into frames and auto layout slots | done | virtualized; `component.list` gives each one's `folder` | -| Hidden from publishing: a leading `.` or `_` in the name | done | the name decides both ways (adding the prefix takes a published component out, removing it brings it back); no Hide when publishing menu item yet | +| Hidden from publishing: a leading `.` or `_` in the name | done | the name decides both ways (adding the prefix takes a published component out, removing it brings it back); Hide when publishing in the Assets panel's context menu and Libraries ▸ Hide when publishing (see [ui-parity](ui-parity.md)) | | Instances pasted into other files follow their mains | done | missing main restorable | | Component playground (try properties without placing) | partial | variant, boolean and text properties in the Inspect tab and `component.playground`; instance swaps and slots have no control there yet (0.5–1 h) | | Real-world libraries QA | **not checked** | [gaps](gaps.md) #3 | @@ -48,7 +48,7 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`. |---|---|---| | Publish a file's components, sets, styles and variables (per-asset versions) | done | as local library files | | Enable a library in a file; read-only linked copies | done | | -| Library updates available; overrides kept | done | | +| Library updates available; overrides kept | done | a library file saved again within two seconds of being read, at the same length, is read again (its time stamp can't prove it unchanged; #652) | | Team libraries: publish to a `figcraft-server` under the file, enable by a share link (a view link reads it), background update checks | done | [server.md](server.md#team-libraries); no team-wide library list or accounts ([gaps](gaps.md) #10) | | Library analytics | partial | instances per component and the files using them, as apps report them; nothing over time, no detach counts | | Swap library (instances, styles and variables to another library's of the same names, overrides kept) | done | what has no match stays and is listed; one undo step | @@ -76,6 +76,7 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`. | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Variant properties reorder by dragging them in the Properties section, one undo step (#679; was "no drag in the panel yet"); a library file saved again right after it was read is read again, so a quick republish isn't missed (#652); the Hidden from publishing row no longer says the Hide when publishing item is missing (it landed 2026-10-12). Numbers unchanged | | 2026-10-17 | minor | Size and resizing overrides of layers inside instances (#731): a layer in an instance can hug, fill or keep a size of its own (group `resizing`: hug/fill/fixed with min and max; `size`), from the Layout panel, the canvas handles and `node.set`; they were refused, and imported ones were dropped at the first relayout. Kept through main edits of other properties, rebuilds, undo, save, `.fig` and REST import (sizes a `.fig` instance gives its layers and the REST `overrides` fields), `.fig` export and detach; reset per group and with Reset all changes (`instance_resizing_tests`). The row that listed them as not overridable was wrong. Numbers unchanged. | | 2026-10-14 | minor | Variables export in the browser: Export… ▸ Variables JSON / CSS custom properties did nothing in the web build, which has no save dialogs; it now hands the file over as a download (`Services::downloads` / `download`, `variables_export_ui_tests`). Import in the browser still needs a file picker, as do the other exports there. Numbers unchanged. | | 2026-10-13 | minor | Component playground (M3): with an instance, a component or a component set selected, the Inspect tab shows a Playground: a preview of the component and a control for each variant, boolean and text property. What is tried there changes the preview and the code in the Code section, never the file (no undo step, the canvas instance stays as it is); Reset goes back to the component's or the instance's own values. `component.playground {id?, properties?, language?, path?}` gives the same to scripts: the properties with their values, the code, and a PNG on request (`playground_tests`). Left: instance-swap and slot properties in the playground (the command takes an instance swap; the panel has no control for it), a code connect template's snippet with the tried values. Numbers unchanged. | diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 250d796a1..96293b34f 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-14 · **Change:** minor (SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (`.fig` import fidelity from the community batches, budgets for large files, the import report, a `.fig` copy from Save as, paste from another design app; instance layers' size and resizing and Hug on import (#731, #732); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) Every format Figma reads or writes, with FigCraft's support. Sources: `Info.plist` of `/Applications/Figma.app` (document types only; nothing inside the bundle's code was read), Figma's @@ -17,9 +17,9 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| -| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included; a flow that records no primary-axis sizing hugs on that axis, an instance that records no auto layout has its main's), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Not read: connector labels, table cells beyond their own layers, filled areas with their own fills, per-point stroke joins, variables bound to fields the editor can't bind, fixed or content-sized grid tracks, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs`, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | +| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included; a flow that records no primary-axis sizing hugs on that axis, an instance that records no auto layout has its main's), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Since 2026-10-17 (community batches #727, #728): an instance's own identity and the cached library components a file carries, overrides applied by key and order, local text values and instance overrides over a shared text style, grid track sizes (fixed, content-sized, fill), slot content, labels of connectors saved with their drawn path (a static snapshot; the ends aren't live), skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, editable text on a path, image adjustments and images carried in the message. Budgets come from the file's own size (one value per compressed byte, 20M–128M, lower ceilings on 32-bit targets; the layer cap follows), so a 15.4 MB synthetic file with 300,000 layers opens whole; the file's bytes stay out of the command journal; an import report lists what was left out or changed once the file opens. Not read: elbowed or curved connectors without a saved path (drawn straight) and labels of connectors without a saved snapshot, table cells beyond their own layers, filled areas with their own fills, variables bound to fields the editor can't bind, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs` and the per-feature `*_tests.rs` beside them, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | -| REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout (sizing modes left out read as hug, as documented), constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | +| REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout (sizing modes left out read as hug, as documented), constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings, image adjustments (the same tint sign as `.fig`); the import report after opening; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | | Local library files | team libraries in the cloud | yes (enable a `.figcraft` as a library) | yes (publish) | per-asset versions, updates with overrides kept | see [collaboration-parity](collaboration-parity.md) | @@ -36,7 +36,7 @@ and prototype interactions are still unchecked there. | BMP | — | yes | | — | | MP4, MOV, WebM (video fills, paid plans) | yes | **no** | shortcut: decoding H.264/HEVC/VP9 needs non-Rust libraries (FFmpeg or each platform's media framework); presenter playback would reuse the animated GIF clock | 4–8 | | Images over 4096 px | downscaled to 4096 | kept | | — | -| Pasted content from other apps | images, SVG, text, Figma clipboard | images, SVG, text (newest clipboard content wins) | no Figma clipboard (it carries Figma's own binary) | with `.fig` | +| Pasted content from other apps | images, SVG, text, Figma clipboard | images, SVG, text (newest clipboard content wins), **layers copied from another design app, best effort** | Cmd/Ctrl+V reads an image copied in another app (under Wayland through the data-control protocol, not run on Linux here; Linux and BSD clipboard reads give up after 2 s). Copied design layers: the `.fig` canvas in the clipboard's HTML is read like a `.fig` file (with its warnings) and pasted as Paste pastes, in place or into the selected frame (`edit.pasteDesignLayers {html \| data}`, refused over 256 MB before decoding); text copied later pastes as text again. Tested with clipboard HTML made from our own `.fig` export (`design_paste_tests`), never with a real clipboard from other software | with `.fig` | ## Export @@ -56,13 +56,16 @@ export limit, not a native document nesting limit. | WebP | — | yes (ours) | | — | | 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 and React | see [dev-mode-parity](dev-mode-parity.md) | — | -| `.fig` ("Save local copy") | yes | **experimental** | the whole file; see [Export to `.fig`](#export-to-fig-experimental). Round trips through our own importer; written files checked by opening them in other software: layers, fills, gradients, strokes, shadows, vectors, components and text draw as in FigCraft; resized and scaled instances keep their size and lay their layers out for it, variables with their modes and colour bindings resolve there (a frame set to another mode shows that mode's colours, also inside instances), colour, text, effect and grid styles are listed, and variable-width strokes that are the same on both sides of the path draw with their width | 5–15 (non-colour bindings as bindings, checks of effects, images and prototypes, and against real files) | +| `.fig` ("Save local copy") | yes | **experimental** | the whole file, also as a copy from File ▸ Save as… (the document keeps its `.figcraft` path and unsaved state); see [Export to `.fig`](#export-to-fig-experimental). Round trips through our own importer; written files checked by opening them in other software: layers, fills, gradients, strokes, shadows, vectors, components and text draw as in FigCraft; resized and scaled instances keep their size and lay their layers out for it, variables with their modes and colour bindings resolve there (a frame set to another mode shows that mode's colours, also inside instances), colour, text, effect and grid styles are listed, and variable-width strokes that are the same on both sides of the path draw with their width | 5–15 (non-colour bindings as bindings, checks of effects, images and prototypes, and against real files) | ### Export to `.fig` (experimental) `file.export {format: "fig"}` (or a `path` ending in `.fig`), File ▸ Export… ▸ .fig (experimental), `figcraft-cli export -o .fig` (and `convert`) and MCP's `export {format: "fig"}` write -the whole document. The writer (`crates/format/src/fig/export.rs`) works from the same public format +the whole document; so do File ▸ Save as… and `file.save` / `file.saveAs` with a `.fig` path, as a +copy: the document keeps its `.figcraft` path, unsaved changes and version preview, and a file an +earlier build saved under a `.fig` name is never overwritten by Save (`save_format_tests`, +`save_as_tests`). The writer (`crates/format/src/fig/export.rs`) works from the same public format notes as the import and inverts its mapping: the zip holds `canvas.fig` (the fig-kiwi header, then a raw-deflate binary schema and a raw-deflate message), `meta.json`, `thumbnail.png` and `images/`; `meta.json` names the file and gives the page colour and the thumbnail size. The @@ -162,6 +165,7 @@ each. | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | The community batches #727 and #728 in the `.fig` row: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments (also REST), images in the message; budgets from the file's size; the journal keeps no file bytes; the import report. Not read cut to what's left. A `.fig` copy from Save as. Pasted content: layers copied from another design app, best effort (tested only with clipboard HTML made from our own export), and images under Wayland (not run there). All on synthetic files: summary and hours unchanged | | 2026-10-17 | minor | Hug on import (#732): auto layout frames a `.fig` records no primary-axis sizing for hug on that axis (auto layout sized that axis by its content before it could be fixed) instead of turning fixed, instances that record no auto layout take their main's (they came in without auto layout and fixed, so longer text overflowed them), REST frames whose sizing modes are left out hug (the documented default), and text hugs by its resize mode (auto width both axes, auto height its height; it came in fixed). Numbers unchanged | | 2026-10-17 | minor | Instance layers' own size and resizing (#731): a `.fig` import keeps the sizes an instance gives its layers and their hug/fill/fixed and min/max as overrides, a REST import reads the resizing fields of `overrides`, and a `.fig` export writes a layer's own size as an override (it went with the derived layout, which a relayout replaces). Numbers unchanged | | 2026-10-14 | minor | SVG/PDF depth overflow (#208) is checked before bounds and drawing; public checked APIs return the offending root/layer, commands and CLI report it, and no incomplete export replaces an existing file. Tested at depths 255/256/257, with inner roots, hidden branches, masks, raster fallbacks and multiple roots/pages. Numbers unchanged. | diff --git a/docs/gaps.md b/docs/gaps.md index e8b111a8d..9b1a770c1 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Where FigCraft falls short of Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-15 · **Change:** minor (bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (the 2026-10-17 landings: `.fig` import fidelity, budgets for large files, the import report, a `.fig` copy from Save as and paste from another design app (gap 1); menus, the Actions palette, editor fixes, Selection colors and smart-selection spacing (gap 4); catalog counts re-measured (gap 5); bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) Every known shortfall against Figma, one entry each, ranked by how much it stops a Figma user from doing real work in FigCraft. Agents: pick work from the top unless the owner says otherwise. The @@ -14,11 +14,11 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe | # | Gap | Kind | Hours | Doc | |---|---|---|---|---| -| 1 | `.fig` files: best-effort import with editable vector networks and stand-ins for non-design layers landed, and an experimental export (round trips through our own importer; written files opened in other software, where layers, fills, gradients, strokes, shadows, vectors, components and text draw as in FigCraft, instances keep their size and variables with modes and colour styles come across); real-file checks and the small tail left (**beta blocker** until checked on real files, gap 3) | File format | 5–10 | [file-format-parity](file-format-parity.md) | +| 1 | `.fig` files: best-effort import with editable vector networks and stand-ins for non-design layers landed, then (2026-10-17) more fidelity on synthetic files, budgets for large files, an import report and paste from another design app; an experimental export, also as a copy from Save as (round trips through our own importer; written files opened in other software, where layers, fills, gradients, strokes, shadows, vectors, components and text draw as in FigCraft, instances keep their size and variables with modes and colour styles come across); real-file checks and the small tail left (**beta blocker** until checked on real files, gap 3) | File format | 5–10 | [file-format-parity](file-format-parity.md) | | 2 | Multiplayer and sharing are a preview, without accounts (**beta blocker**) | Feature | 42–84 | [collaboration-parity](collaboration-parity.md) | | 3 | Nothing checked against real Figma files | Fidelity | 15–30 | [target-app-parity](target-app-parity.md) | | 4 | Interaction fidelity not compared tool by tool | UI/UX | 40–60 | [ui-parity](ui-parity.md) | -| 5 | Localization: English, reviewed Russian, plus unreviewed Spanish (and Latin American Spanish), French, German, Brazilian Portuguese, Japanese, Korean and Simplified Chinese drafts | Localization | 29–51 | [localization-parity](localization-parity.md) | +| 5 | Localization: English, reviewed Russian, plus unreviewed Spanish (and Latin American Spanish), French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Czech drafts; Turkish and Swedish catalogs | Localization | 29–51 | [localization-parity](localization-parity.md) | | 6 | Plugins: widgets take clicks only, a self-hosted directory but no public catalogue; Figma's plugins don't run | Ecosystem | 8–26 | [target-app-parity](target-app-parity.md) | | 7 | CPU canvas where Figma uses the GPU | Hardware/performance | 30–60 | [hardware-parity](hardware-parity.md) | | 8 | Platform QA: Linux and the browser left (Windows pass done 2026-10-11) | Stability/platforms | 10–20 | [hardware-parity](hardware-parity.md) | @@ -60,20 +60,43 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe derived data for their layers, a scale factor), variables with modes and bindings, shared styles and variable-width strokes are written and read back; checked there: resized and scaled instances keep their size and lay their layers out for it, variables with their modes and colour bindings resolve there (a frame set to another mode shows that mode's colours, also inside instances), colour, text, effect and grid styles are listed, and variable-width strokes that are the same on both sides of the path draw with their width; number, string and boolean bindings and bindings on effects, layout guides and gradient stops come across as the values they give but did not show as bound there (their entries now also name the layer field they set, not yet checked there), and strokes wider on one side of the path are written as filled outlines, no longer editable strokes there (the stroke itself is kept as plugin data and our own import puts it back; not yet checked there), like effects such as glass and noise, images and prototype interactions. -- **Missing:** connector labels, elbowed or curved connectors without a saved path (drawn straight), - table cells beyond their own layers, filled areas of a vector with their own fills, per-point stroke - joins, variables bound to fields the editor can't bind, fixed or content-sized grid tracks and video - fills aren't read; text lays out again with - local fonts. Nothing has been checked against real-world files yet (gap 3). The export is checked - only against our own importer: whether other apps open its files is unknown. +- **Landed (2026-10-17, community batches #727 and #728, then #745):** the import keeps an + instance's own identity and the cached copies of library components a file carries, applies + instance overrides by key and order, lets local text values and instance overrides win over a + shared text style, and reads grid track sizes (fixed, content-sized and fill), slot content, + labels of connectors saved with their drawn path (text and background, as a static snapshot: + the ends aren't live), skip ink, paragraph options and hanging lists, list start numbers, + vertical trim, per-point stroke joins, editable text on a path, image adjustments (the tint + sign shared with the REST import) and images carried in the file's message; layers inside + instances keep their own size and resizing as overrides (#731), and auto layout and text that + record no sizing hug (#732). Large files open within budgets set from the file's own size (one + value per compressed byte, 20M–128M values, lower ceilings on 32-bit targets; a 15.4 MB + synthetic file with 300,000 layers opens whole). After a `.fig`, REST JSON or SVG import an + import report lists what was left out or changed (translated where the catalog has the note; + `file.open {data}` returns a `summary`), and imported file bytes stay out of the command + journal. File ▸ Save as… to a `.fig` name writes an export copy and the document keeps its + `.figcraft` path. Layers copied from another design app paste (`edit.pasteDesignLayers`, and + Cmd/Ctrl+V when the clipboard's HTML holds a `.fig` canvas): read like a `.fig` file, with its + warnings, size-checked (256 MB) before decoding. +- **Missing:** elbowed or curved connectors without a saved path (drawn straight), labels of + connectors without a saved snapshot, table cells beyond their own layers, filled areas of a + vector with their own fills (#634, held for an owner decision on the document model), variables + bound to fields the editor can't bind and video fills aren't read; text lays out again with + local fonts. Nothing has been checked against real-world files yet (gap 3): the 2026-10-17 + changes were tested on files built in code, and paste from another design app on clipboard HTML + made from our own export, never on a real clipboard. The export was checked in other software + on our example documents and small test files only. - **Evidence:** fixtures generated in code (`crates/format/src/fig/tests.rs` and `tail_tests.rs`: kiwi round trips, every mapped feature, vector network blobs, truncation, bit flips and junk never panic); `crates/engine/src/fig_import_tests.rs`. + 2026-10-17: `crates/format/src/fig/{connector_label,slot,source_identity,text_style,text_list,text_paragraph,text_path,text_skip_ink,image_filter,auto_layout_sizing}_tests.rs`, + `map_connector_snapshot_budget_tests.rs`, `crates/engine/src/{save_format,design_paste,instance_resizing}_tests.rs`, + `crates/ui-egui/src/{import_report,save_as}_tests.rs`. Export: 60 generated documents round trip through the importer layer by layer, written files decode with the generic decoder and list parents first, the encoder agrees with the decoder, junk documents never panic (`crates/format/src/fig/export_tests.rs`, `crates/engine/src/fig_export_tests.rs`). - **Impact:** existing work can be brought across, but only real files will show how much of it. -- **Estimate:** 5–10 h for the read tail (real-file fixes, connector labels, table cells); checking the export against real files a further 5–15 h (with gap 3). +- **Estimate:** 5–10 h for the read tail (real-file fixes, table cells, connectors without a saved path); checking the export against real files a further 5–15 h (with gap 3). Unchanged on 2026-10-17: most of the read tail is real-file fixes, which nothing has measured yet. ### 2. Multiplayer and sharing are a preview, without accounts - **Missing:** accounts, teams and projects, per-person permissions, audio, @@ -93,8 +116,11 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe `figcraft-server` keeps many files (snapshot plus log, compacted; restarts lose nothing confirmed), takes files published from the app and hands out share links that let people edit or only view; the desktop app and the browser reach it over `wss://` through a TLS reverse - proxy, and releases ship it with a deployment guide (`docs/server.md`). But there are no - accounts (a link is the access) (`docs/collab-protocol.md`). + proxy, and releases ship it with a deployment guide (`docs/server.md`); server message limits + follow `max_file_mb`, so files above 64 MiB publish and open (#705), a damaged generation field + no longer drops a log's flushed edits (#687), and the browser build joins from a `#join=` link + (#712: unit-tested, not run in a browser). But there are no accounts (a link is the access) + (`docs/collab-protocol.md`). - **Impact:** Figma's defining feature; most teams use it every day. Solo designers can work without it. - **Estimate:** 42–84 h: accounts, teams and per-person permissions, shared comments and versions @@ -138,29 +164,43 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe cursor for every tool and modifier, panel widths, dark pages (`field_tests`, `cursor_tests`, `cursors_tests`, `outline_options_tests`, `hide_publishing_tests`, `panel_width_tests`, `theme_pages_tests`). +- **Landed (2026-10-17, community batches #733, #735, #736 and #729):** submenus open after a + short hover, keep their place while the pointer heads for them (a safe triangle) and reopen + closed (`menu_aim_tests`; timings tuned by feel, not measured); the Actions palette has tabs, + ranked search over every command, a keyboard highlight and recents (`palette_tests`); menu items + that need a value ask for it; live font preview on hover; the colour picker opens on a new fill + or stroke; Shift-drag on a selected layer moves the selection; a double-click near a thin stroke + enters vector edit; points dropped on a point merge; a draggable divider between Pages and + Layers; Paste over and Paste properties from the keyboard; then (#753) Selection colors for mixed + selections and smart-selection spacing fields and canvas handles (no reorder rings). Each was checked in the app (on + Windows; the submenus by their author), none side by side with Figma, none on macOS. - **Evidence:** ROADMAP item 7 ("Left: tool by tool, panel by panel against the incumbent"). - **Impact:** Figma users notice the feel within minutes; it decides whether they stay. - **Estimate:** 40–60 h. Detail in [`ui-parity.md`](ui-parity.md). ### 5. Localization: English, reviewed Russian, plus unreviewed drafts - **Missing:** native reviews of the Spanish, French, German, Brazilian Portuguese, Japanese, - Korean and Simplified Chinese drafts and the Latin American Spanish overlay, the 25 newest strings - in five drafts, Hindi, Arabic, Indonesian and Vietnamese, localized engine messages and number - formatting; CJK UI text on the web without the craft-fonts CJK build. + Korean, Simplified Chinese, Indonesian and Czech drafts and the Latin American Spanish + overlay, the strings added since each catalog was drafted (1–5% of each), Hindi, Arabic and + Vietnamese, localized engine messages and number formatting; CJK UI text on the web without the + craft-fonts CJK build. - **Evidence (measured from source):** the layer landed 2026-10-11: catalogs in - `crates/ui-egui/locales/` (1,371 UI keys plus 524 command labels and 29 menu wordings), - Preferences ▸ Language, `pref.language`; `en.toml` is complete, and `es.toml`, `fr.toml`, - `de.toml`, `pt-BR.toml`, `ja.toml`, `ko.toml` and `zh-Hans.toml` (2026-10-12) are machine drafts - (all but `zh-Hans.toml` lack the 25 newest strings), with `es-419.toml` a Latin American overlay - listing only what differs from Spanish (Spanish and Russian are held to completeness by the check; the - others show English for strings added later). Russian adds all 2,165 current entries, - reviewed and approved by VanTan, with one/few/many integer plurals. + `crates/ui-egui/locales/` (measured 2026-10-17: 1,680 UI keys plus 561 command labels and 31 + menu wordings, 2,272 entries), Preferences ▸ Language, `pref.language`; `en.toml` is complete, + Spanish is held to completeness by the check, and the French, German, Brazilian Portuguese, + Japanese, Korean and Simplified Chinese machine drafts cover 95–99% (strings added since they + were drafted show English), with `es-419.toml` a Latin American overlay listing only what + differs from Spanish. Russian (reviewed and approved by VanTan, one/few/many integer plurals) + covers 98.8%; Indonesian and Czech drafts, a Turkish catalog whose header says a native speaker + reviewed it, and a Swedish catalog (with its command labels since 2026-10-17) cover 98.7–99.6% ([localization-parity](localization-parity.md#languages)). CJK UI text uses an installed CJK face the desktop app loads when something on screen needs it (`crates/ui-egui/src/cjk.rs`). Engine error messages and Dev Mode values stay English. - **Impact:** non-English designers get machine drafts nobody has reviewed yet, and English errors. - **Estimate:** 3–7 h per language plus native review, 4–6 h for engine messages and numbers; - 29–51 h for the key languages left and the drafts' follow-ups. Detail in + 29–51 h for the key languages left and the drafts' follow-ups (kept on 2026-10-17: the + Indonesian draft takes 2–3 h off, about what bringing the drafts that slipped to 95% back to + every string adds). Detail in [`localization-parity.md`](localization-parity.md); how to add one in [`translating.md`](translating.md). @@ -215,7 +255,11 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe PR (Windows 11, the desktop app driven over the control channel, the same workflow through MCP): eight bugs fixed, among them unsaved changes lost when the app was killed or crashed, Ctrl+arrows and Ctrl+Backspace acting on the whole line in text, scrubbed fields snapping back - and skewed linear gradients. + and skewed linear gradients. Linux and the BSDs (2026-10-17, #693): clipboard reads run on a + helper thread that gives up after 2 s, and images copied in other apps paste under Wayland + through the data-control protocol; compiled in CI, not run on a Linux desktop here. Wayland + compositors without server-side decorations (GNOME) give the window winit's Adwaita controls + (#592: checked by its author on GNOME; KDE not run). - **Impact:** unknown bugs on the platforms where FigCraft is most attractive (Linux has no Figma desktop app). - **Estimate:** 10–20 h, partly human (hardware). @@ -400,6 +444,7 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | The 2026-10-17 landings. Gap 1: a new Landed entry (community batches #727 and #728, then #745: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments, images in the message, instance layers' size and resizing overrides, Hug where nothing is recorded; budgets from the file's size; the import report; a `.fig` copy from Save as; paste from another design app), its Missing list cut to what is still left, and the wrong "whether other apps open its files is unknown" replaced by what was checked; all on synthetic files, so the beta blocker and hours stand. Gap 2: server limits, log recovery and web join links in the evidence. Gap 4: menus, the Actions palette and the editor fixes (#733, #735, #736, #729), then Selection colors and smart-selection spacing (#753) landed, none compared side by side. Gap 5: catalog counts re-measured (2,272 entries; drafts at 95–99%; Indonesian, Czech, Turkish and Swedish listed). Gap 8: the Linux and BSD clipboard changes and Wayland window controls, not run there by the maintainers. Ranking and hours unchanged | | 2026-10-15 | minor | Gap 7: bounded canvas overscan for smoother panning. Estimates and ranking unchanged. | | 2026-10-14 | minor | Russian catalog (M9), reviewed and approved by VanTan: all 2,165 current entries, Русский in Preferences and regional ru tags. Russian integer plurals use one/few/many; contributor display name VanTan added. Existing estimates unchanged. | | 2026-10-13 | minor | Gap 1: the experimental `.fig` export writes instance sizes (resized, filling an auto layout, scaled), variables with modes and bindings, shared styles and variable-width strokes, and the import reads them back. Checked by opening written files in other software: resized and scaled instances keep their size and lay their layers out for it, variables with their modes and colour bindings resolve there (a frame set to another mode shows that mode's colours, also inside instances), colour, text, effect and grid styles are listed, and variable-width strokes that are the same on both sides of the path draw with their width; number, string and boolean bindings and bindings on effects, layout guides and gradient stops come across as the values they give but did not show as bound there (their entries now also name the layer field they set, not yet checked there), and strokes wider on one side of the path are written as filled outlines, no longer editable strokes there (the stroke itself is kept as plugin data and our own import puts it back; not yet checked there). Hours and the ranking unchanged | diff --git a/docs/hardware-parity.md b/docs/hardware-parity.md index a990d75b6..bf945c12a 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-10-14 · **Change:** minor (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) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (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; 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) · **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 @@ -14,7 +14,7 @@ since 2025). FigCraft renders the canvas on the CPU and presents it through wgpu |---|---|---|---| | Canvas rendering | GPU | CPU (tiny-skia), banded across cores, retained (re-renders only what an edit or pan touches), levels of detail below 50% zoom; shown through wgpu (WebGPU or WebGL2 in the browser) | 30–60 for a GPU path | | Effects (blurs, glass, noise) | GPU | CPU | in the above | -| HiDPI / Retina | yes | yes (all) | — | +| HiDPI / Retina | yes | yes (all); a canvas image rendered at the screen's density is placed on whole device pixels, so fractional pans, zooms and display scales don't blur it (#359; geometry tests, the snapping not judged by eye) | — | | Wide-gamut display (Display P3) | yes, on capable displays | colours stored and exported in P3; the screen shows sRGB: eframe/egui-wgpu 0.36 configure an 8-bit sRGB surface with no colour space option, although wgpu 30 can present Display P3 or extended sRGB on Metal, DX12, Vulkan and WebGPU (see gaps #18). The colour picker warns about colours outside sRGB and View ▸ Soft-proof sRGB stripes them on the canvas | 2–5 | | Trackpad pinch zoom and two-finger pan | yes | yes (egui zoom delta, smooth scroll) | — | | Pen tablet pressure (pencil, Figma Draw brushes) | yes (forum reports of regressions in 2025) | Windows pens (winit pointer input) and browser styluses that send touch events with a force (an Apple Pencil in Safari); the Pencil records it as the stroke's width profile. A mouse, macOS and Linux tablets and pens sending only pointer events in a browser report none: constant width | 1–3 | @@ -41,7 +41,7 @@ Nothing has been timed against Figma on the same document (needs `.fig` import). |---|---|---|---| | macOS | desktop app (Intel and Apple silicon) | universal `.dmg`, signed and notarized (v0.2.0) | where nearly all QA happens | | Windows x64 / arm64 | desktop app | `.msi` and portable zip for x64, x86 and arm64 | built in CI; Windows: QA pass done 2026-10-11, findings in PR | -| Linux | none (browser only) | AppImage, `.deb`, `.rpm`, Flatpak, tarball, x86_64 and aarch64; riscv64 tarball | CI tests run here | +| Linux | none (browser only) | AppImage, `.deb`, `.rpm`, Flatpak, tarball, x86_64 and aarch64; riscv64 tarball | CI tests run here. Clipboard (also the BSDs): reads run on a helper thread that gives up after 2 s, and images copied in other apps paste under Wayland through the data-control protocol (#693). Under Wayland the app can't tell its window is minimised, so control requests that need a drawn frame may still wait there (#720). None of this run on a Linux desktop here. On a Wayland compositor without server-side decorations (GNOME) the window gets winit's Adwaita controls (#592: checked by its author in a GNOME Wayland session; KDE not run) | | FreeBSD | none | tarball | | | Web | primary (figma.com) | `figcraft-web` (WASM, WebGPU/WebGL2), web zip | no accessibility tree; file access through the browser; copy and paste through the system clipboard (copies written from the copy event, pastes read from the paste event; no pasting images from other apps) | | iOS / Android | apps: view, comment, mirror prototypes | none (the web build is not touch-first) | 20–40 h for a viewer | @@ -50,6 +50,7 @@ Nothing has been timed against Figma on the same document (needs `.fig` import). | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Linux row: clipboard reads on Linux and the BSDs time out after 2 s on a helper thread, images copied in other apps paste under Wayland (arboard's data-control feature, #693), a minimised window can't be detected under Wayland, so frame-only control requests may still wait there (#720), and Wayland compositors without server-side decorations give the window Adwaita controls (#592, checked by its author on GNOME, not by the maintainers; KDE not run); compiled in CI, not run on a Linux desktop. HiDPI row: native-density canvas images placed on whole device pixels (#359, geometry tests; not judged by eye). Numbers unchanged | | 2026-10-14 | minor | Copy and paste in the browser: the web build never wrote to the system clipboard, so Cmd+V after Cmd+C pasted whatever text the clipboard held before (as a text layer) instead of the copied layers. Copies (layers, Copy as SVG/CSS/text/PNG, links) now go out through egui's output, which eframe writes during the copy event (`web_clipboard_tests`). Numbers unchanged. | | 2026-10-11 | minor | Windows QA pass (gap 8): everyday workflows on Windows 11 through the desktop app and MCP; fixed: unsaved changes lost when the app was killed or crashed (recovery copies every few seconds, reopened at the next start), Ctrl+arrows/Backspace/Delete acting on the whole line in text (now by word; Ctrl+Home/End to the text's ends), scrubbed fields snapping back on release, typing on a field Tab reached, Escape not closing dialogs, skewed or vanishing linear gradients, hints cut off at the panel edge, the window-close question in English in the Spanish interface. Percentages and hours unchanged | | 2026-10-11 | minor | Display P3 honest minimum (gap 18): the colour picker of a Display P3 file warns when a colour is outside sRGB (Outside sRGB, with what the canvas and exports do), and View ▸ Soft-proof sRGB (`view.proofSrgb`) stripes the canvas pixels sRGB can't show. Why the canvas still shows sRGB: wgpu 30 can present Display P3 or extended-range sRGB surfaces (Metal, DX12, Vulkan, WebGPU canvases), but eframe/egui-wgpu 0.36 configure an 8-bit sRGB surface with no option for the format or colour space, and egui's renderer writes sRGB-encoded UI colours; showing P3 needs those two upstream (or a patched egui-wgpu). Hardware 13–27 h → 12–26 h; gap 18 6–12 h → 5–11 h; percentages, feature breadth (~79%) and ready for real work (~47%) unchanged at this rounding; full parity ~363–697 h → ~362–696 h | diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 45a7a925a..15d49be9e 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -1,10 +1,11 @@ # Localization parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-12 · **Change:** minor (draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (string counts re-measured: 2,272 entries, the drafts at 95–99%; Swedish command labels and menu wordings; Russian, Swedish, Turkish, Czech and Indonesian listed; a duplicated paragraph removed; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog) · **Target:** Figma Design (desktop app 126.10.7) -FigCraft's interface has a localization layer with an English catalog and Spanish (with a Latin -American overlay), French, German, Brazilian Portuguese, Japanese, Korean and Simplified Chinese -drafts (machine-drafted, waiting for native speakers' review). This page lists the twelve key +FigCraft's interface has a localization layer with an English catalog, a Russian catalog reviewed +by a native speaker, and Spanish (with a Latin American overlay), French, German, Brazilian +Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Czech drafts (machine-drafted, +waiting for native speakers' review), plus Swedish and Turkish catalogs. This page lists the twelve key languages of the craftrules standard, then the other languages Figma ships. How to add a language: [`translating.md`](translating.md). @@ -17,19 +18,21 @@ browser's page translation. The `.lproj` folders in `/Applications/Figma.app` (6 Electron/Chromium locale packs, not Figma's own UI languages. Text *content* in any script is supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no vertical text. -## What FigCraft has (measured 2026-10-12, from source) +## What FigCraft has (measured 2026-10-17, from source) - **Layer:** one TOML catalog per language in `crates/ui-egui/locales/`, baked into the binary by the UI crate's build script (desktop and web; nothing read at run time). Keys are the English text (`tr("Fill")`, `trf` for `{named}` placeholders, `trn` for counts with one/few/many/other plural forms), so a missing translation shows English, never a raw key. One English text that needs two translations takes a context (`"Fill|sizing"`). -- **Strings:** 1,417 UI keys in `en.toml` (36 with plural forms; ~110 are labels from engine and - document data, such as tool names, blend modes and Dev Mode properties) plus 536 command labels - and 29 menu wordings by command id: 1,982 entries. Command ids, the CLI, MCP and the control +- **Strings:** 1,680 UI keys in `en.toml` (41 with plural forms; ~110 are labels from engine and + document data, such as tool names, blend modes and Dev Mode properties) plus 561 command labels + and 31 menu wordings by command id: 2,272 entries (counted against `en.toml` and the complete + Spanish catalog's command and menu tables). Command ids, the CLI, MCP and the control channel stay English. Accessibility names come from the same strings. -- **Language preference:** Preferences ▸ Language (System, English, Deutsch, Español, Español - (Latinoamérica), Français, 日本語, 한국어, Português (Brasil), 简体中文), applied at once without a +- **Language preference:** Preferences ▸ Language (System, then each catalog by its own name: + English, Čeština, Deutsch, Español, Español (Latinoamérica), Français, Bahasa Indonesia, 日本語, + 한국어, Português (Brasil), Русский, Svenska, Türkçe, 简体中文), applied at once without a restart; System takes the first of the OS's preferred languages that has a catalog (on Windows only the first preferred language counts, since that list also holds the languages added for a keyboard; macOS AppleLanguages, `LANGUAGE` then the locale variables on Linux and BSD; a regional @@ -37,13 +40,6 @@ supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no v other Latin American and US Spanish tags to es-419; zh, zh-CN, zh-SG and zh-Hans read zh-Hans, while Traditional Chinese (zh-Hant, zh-TW, zh-HK, zh-MO) has no catalog and reads English or the next OS language, never Simplified) or the browser's language on the web. - (Latinoamérica), Français, 日本語, 한국어, Português (Brasil), Svenska, 简体中文), applied at once without a - restart; System takes the first of the OS's preferred languages that has a catalog (Windows' - language list, macOS AppleLanguages, `LANGUAGE` then the locale variables on Linux and BSD; a regional tag - falls back to its language, pt-PT or pt to pt-BR, and es-419, es-MX, es-AR, es-CO and the other - Latin American and US Spanish tags to es-419; zh, zh-CN, zh-SG and zh-Hans read zh-Hans, while - Traditional Chinese (zh-Hant, zh-TW, zh-HK, zh-MO) has no catalog and reads English or the next OS - language, never Simplified) or the browser's language on the web. `pref.language {language}` sets it from the CLI, MCP and the control channel. - **Regional overlays:** a regional catalog whose language has a catalog lists only what differs (`es-419.toml` over `es.toml`); its UI strings, command labels and menu wordings read the @@ -51,9 +47,9 @@ supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no v - **Check:** `cargo test -p figcraft-ui-egui i18n` fails on keys the code uses that `en.toml` lacks, keys no code uses, unknown command ids, placeholders that differ from English, overlay entries that read as in their base language and, for complete languages (Spanish), anything - untranslated. The other drafts are not held to it: a string added later shows English there - until someone translates it. Every draft translates every string as of 2026-10-12 (checked by - adding each to `COMPLETE` locally and running the check). + untranslated. The other catalogs are not held to it: a string added later shows English there + until someone translates it. Every draft translated every string on 2026-10-12; by 2026-10-17 + the strings added since left them at 95–99% (table below). - **Not yet localized:** messages the engine writes (errors, a few toasts, Dev Mode property values such as "inside"), number formatting (decimal points stay `.`), and decimal plural rules (`trn` takes integers: Czech uses one/few/other and Russian one/few/many; French and Brazilian @@ -87,37 +83,42 @@ supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no v | Language | Code | UI strings translated | Dialogs / tooltips / help | Script support | Native review | Status | Hours to full | |---|---|---|---|---|---|---|---| -| English | en | 2,076 / 2,076 (100%, source) | yes | Latin | yes (source) | full | 0 | -| Simplified Chinese (Mandarin) | zh-Hans | 2,076 / 2,076 (100%, draft) | yes | CJK text and IME in documents; UI text in an installed Chinese face, ahead of Japanese ones (web: the `FIGCRAFT_EMBED_CJK` build); no Traditional Chinese catalog (zh-TW, zh-HK read English) | no | draft | 1–2 (after native review) | -| Spanish | es, es-419 | 2,076 / 2,076 (100%, draft); es-419 overlays 98 Latin American wordings (draft) | yes | Latin | no | draft | 0–1 (after native review) | +| English | en | 2,272 / 2,272 (100%, source) | yes | Latin | yes (source) | full | 0 | +| Simplified Chinese (Mandarin) | zh-Hans | 2,166 / 2,272 (95.3%, draft) | yes | CJK text and IME in documents; UI text in an installed Chinese face, ahead of Japanese ones (web: the `FIGCRAFT_EMBED_CJK` build); no Traditional Chinese catalog (zh-TW, zh-HK read English) | no | draft | 1–2 (after native review) | +| Spanish | es, es-419 | 2,272 / 2,272 (100%, draft); es-419 overlays 101 Latin American wordings (draft) | yes | Latin | no | draft | 0–1 (after native review) | | Hindi | hi | 0 (0%) | no | Devanagari shaping works in documents; UI font fallback to check | no | none | 4–7 | | Arabic | ar | 0 (0%) | no | Bidi, shaping and RTL names work; the UI does not mirror | no | none | 9–15 | -| French | fr | 2,076 / 2,076 (100%, draft) | yes | Latin | no | draft | 1–2 (after native review) | -| Portuguese | pt-BR | 2,076 / 2,076 (100%, draft) | yes | Latin | no | draft | 1–2 (after native review) | -| Indonesian | id | 0 (0%) | no | Latin | no | none | 3–5 | -| Japanese | ja | 2,076 / 2,076 (100%, draft) | yes | CJK text and IME in documents; UI text in an installed Japanese face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | -| German | de | 2,076 / 2,076 (100%, draft) | yes | Latin; long words elide in narrow fields | no | draft | 1–2 (after native review) | -| Korean | ko | 2,076 / 2,076 (100%, draft) | yes | Hangul text and IME in documents; UI text in an installed Korean face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | +| French | fr | 2,167 / 2,272 (95.4%, draft) | yes | Latin | no | draft | 1–2 (after native review) | +| Portuguese | pt-BR | 2,167 / 2,272 (95.4%, draft) | yes | Latin | no | draft | 1–2 (after native review) | +| Indonesian | id | 2,244 / 2,272 (98.8%, draft) | yes | Latin | no | draft | 1–2 (after native review) | +| Japanese | ja | 2,254 / 2,272 (99.2%, draft) | yes | CJK text and IME in documents; UI text in an installed Japanese face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | +| German | de | 2,176 / 2,272 (95.8%, draft) | yes | Latin; long words elide in narrow fields | no | draft | 1–2 (after native review) | +| Korean | ko | 2,166 / 2,272 (95.3%, draft) | yes | Hangul text and IME in documents; UI text in an installed Korean face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | | Vietnamese | vi | 0 (0%) | no | Latin with stacked diacritics | no | none | 3–5 | -Other languages: Swedish (`sv`): every UI string translated, and 120 of the 588 command labels and -menu wordings (the rest show in English); native review welcome. Figma ships none beyond the eight -above. +Other languages (measured 2026-10-17): Russian (`ru`) 2,244 / 2,272 (98.8%), reviewed and approved +by VanTan, one/few/many integer plurals; Swedish (`sv`) 2,264 (99.6%), its command labels and menu +wordings added 2026-10-17 (#599), native review welcome; Turkish (`tr`) 2,243 (98.7%), whose header +says it was machine-drafted and reviewed by a native speaker; Czech (`cs`) 2,244 (98.8%), a draft +with one/few/other plurals. Figma ships none beyond the eight above. The layer is done. Per-language hours above are agent hours for a catalog of ~1,800 entries (a machine draft, then a pass over the panels for overflow), plus each language's plural rule where it isn't one/other; every language also needs a native speaker's review (human). Left before full parity besides the languages: localizing engine messages and number formatting (4–6 h); -right-to-left mirroring of the panels is in Arabic's hours. Total: **29–51 h**. +right-to-left mirroring of the panels is in Arabic's hours. Total: **29–51 h** (kept on +2026-10-17: Indonesian's draft takes 2–3 h off, about what bringing the drafts back from 95% to +every string adds). -Priority: native reviews of the seven drafts and the es-419 overlay (every one of Figma's languages -and variants has one, plus Simplified Chinese, which Figma doesn't ship), then Hindi, Indonesian, -Vietnamese and Arabic. Traditional Chinese is not planned (no catalog; its users see English). +Priority: native reviews of the drafts and the es-419 overlay (every one of Figma's languages +and variants has one, plus Simplified Chinese, Indonesian and Czech, which Figma doesn't ship), then +Hindi, Vietnamese and Arabic. Traditional Chinese is not planned (no catalog; its users see English). ## Revision history | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | String counts re-measured from the catalogs: 1,680 UI keys, 561 command labels and 31 menu wordings (2,272 entries); Spanish complete, the other drafts at 95.3–99.2% (strings added since 2026-10-12 show English), es-419 101 entries. Indonesian has a draft (98.8%; it was listed as none); Russian (98.8%, reviewed), Swedish (99.6%, command labels and menu wordings from #599), Turkish (98.7%) and Czech (98.8%) listed with counts; the language picker's list updated; a paragraph repeated by a merge removed. Grade and hours unchanged (Indonesian's draft is offset by the drafts' new gaps) | | 2026-10-14 | minor | Windows UI language (#291): the interface language comes from Windows' first preferred language alone; that list is also the input-language list (a German keyboard on a Polish system adds Deutsch), and taking the first entry with a catalog turned the interface German there. A first preferred language without a catalog reads English; macOS AppleLanguages and gettext's `LANGUAGE` still take the first language with a catalog | | 2026-10-12 | minor | Drafts catch up again, and the counts with them: French, German, Brazilian Portuguese, Japanese, Korean and Simplified Chinese translate the 71 UI strings and 5 command labels they lacked since sharing with a join code and open hosting (the Share popover, join codes, owner tokens, reports, the .fig export notes), and with Spanish the 26 strings and 3 command labels of your online files (Home ▸ Online, its menu and dialogs, the marks on tabs); machine-drafted in each file's conventions, still drafts. The Latin American overlay adds computadora and agrega where the new Spanish says ordenador and añade (98 entries). 2,076 entries per catalog (1,503 UI strings, 544 command labels, 29 menu wordings) | | 2026-10-12 | minor | Draft catalogs catch up: French, German, Brazilian Portuguese, Japanese and Korean translate the 66 UI strings and 17 command labels added since they were drafted (cursor chat and spotlight, the plugin directory, Rename layers, presentation and snapping keys, list levels, the rotation origin, placing with Enter…), Simplified Chinese the 46 and 12 it lacked; machine-drafted from the English in each file's conventions, still drafts (not in `COMPLETE`). The Latin American overlay adds Control for a gamepad controller and presiona in the plugin directory hint (90 entries, with Enter for the keycap). String counts re-measured: 1,417 UI keys, 536 command labels and 29 menu wordings (1,982 entries), every draft at 100%. Localization grade unchanged | diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index bdb30e880..775a4fcb4 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -1,10 +1,10 @@ # Parity checklist -> **Generated:** 2026-10-13 by `cargo xtask parity`. Do not edit by hand. +> **Generated:** 2026-10-17 by `cargo xtask parity`. Do not edit by hand. -FigCraft commands registered for the incumbent's main menu and toolbar (547 commands in the engine). +FigCraft commands registered for the incumbent's main menu and toolbar (561 commands in the engine). -**211 / 211 menu items (100.0%)** +**212 / 212 menu items (100.0%)** Every catalog item has a command. diff --git a/docs/prototyping-parity.md b/docs/prototyping-parity.md index b92204896..e4cf8c7fd 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-10-13 · **Change:** minor (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-10-17 · **Change:** minor (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, @@ -86,7 +86,7 @@ case pins the current behaviour). | Widgets react to clicks in a presented prototype | done | clicks only, like on the canvas | | Interactive components: instances play their variant's interactions, overridden per trigger | done | | | Drag-driven animations that follow the pointer, in their direction | done | | -| Presenter: device frames and colours, rotation, custom sizes, fit/fill/100%, responsive frames | done | device bodies drawn in code | +| Presenter: device frames and colours, rotation, custom sizes, fit/fill/100%, responsive frames | done | device bodies drawn in code. Presenting opens its own Present tab, which keeps its screen and history while you go back to the design, with a thumbnail of the current frame, previous / next, device presets and scale choices; the frame is laid out again for the device's screen on the prototype's copy (constraints and auto layout; the file is untouched); on phones and tablets overflowing content drags while the device stays put, as the frame's overflow setting allows ("No scrolling" frames clip); closing the window asks about unsaved changes above the presentation (#537). Devices not compared with Figma's | | Hotspot hints, inspect panel in the presenter, comments in the presenter | done | | | Preview pane following edits live | done | | | Edit interactions on several layers at once | done | | @@ -100,6 +100,7 @@ case pins the current behaviour). | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Community batch #753: a Present tab (#537): playback in its own tab that keeps its screen and history, a current-frame thumbnail, previous / next, device presets and scale; the frame reflows to the device's screen on the prototype's copy; phone and tablet content drags inside a fixed device as its overflow allows ("No scrolling" frames clip; iPad mini, MacBook Air and Desktop keep their bodies); the unsaved-changes question shows above the presentation. Checked in the app on Windows. Percentages and hours unchanged | | 2026-10-13 | minor | Prototyping, delays on mouse triggers and manual overlay offsets (M5): mouse enter, leave, down and up wait `delayMs` before their actions run (once while waiting; dropped when the screen or overlay they were on goes away; a pointer that leaves early doesn't cancel, the documentation is silent), and a manual overlay sits at `offset: [x, y]` from the top-left of the layer that opens it (without one, right below it, as before). Delay and X/Y fields in the interaction editor, the player on its own clock, REST import (`delay`, `overlayRelativePosition`), `.fig` import and export (the export's field for mouse delays is unchecked against other software). Numbers unchanged. | | 2026-10-12 | minor | Controller buttons on key/gamepad triggers (Controller menu, player polling on Windows and in the browser, REST import instead of skipping, control channel injection), widgets reacting to clicks in presented prototypes on the prototype's own copy, `proto.evaluate`; the mode lookup and set-variable-mode rules written as cases (they already held). Breadth 90% → 92%, ready unchanged at 74% (controllers on Windows and the browser only; no real prototype QA yet), 3–6 h → 2–5 h | | 2026-10-11 | minor | Behaviour suite from the public documentation (7 model tests, 12 player tests with 21 gestures) and its fixes: on drag follows its animation's direction and the pointer, key combinations, overlay timers from when they open, interactive components play their variant's interactions and change the right instance, physical springs that play until they settle, smart animate overshoots with the easing, fixed layers above scrolling content; added scroll to offsets. Breadth 88% → 90%, ready 70% → 74%, 5–9 h → 3–6 h | diff --git a/docs/roadmap.md b/docs/roadmap.md index cf2854642..8d63a4692 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # FigCraft roadmap: milestones and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; community fixes from #478 up and a control-channel fix (#589); recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading, SVG import budgets, Leptos code, full screen, server snapshots, owner-only preferences, ruzstd 0.9.1, layer cycle repair, batch rollback, Direct3D 12 on Windows, plugin metering; vector edit mode regions: hover hatch, selection and drag; repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` import, best effort; 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 ~79%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community batch #753: Selection colors, smart-selection spacing, a Present tab; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; community fixes from #478 up and a control-channel fix (#589); recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading, SVG import budgets, Leptos code, full screen, server snapshots, owner-only preferences, ruzstd 0.9.1, layer cycle repair, batch rollback, Direct3D 12 on Windows, plugin metering; vector edit mode regions: hover hatch, selection and drag; repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` import, best effort; 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 ~79%) · **Target:** Figma Design (desktop app 126.10.7) Forward-looking plan. Where FigCraft stands today: [`ROADMAP.md`](../ROADMAP.md) and [`target-app-parity.md`](target-app-parity.md); the full ranked list: [`gaps.md`](gaps.md). Hours @@ -73,6 +73,7 @@ blockers. | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | | 2026-10-14 | minor | M7: the Small caps button in Type settings showed a box where the UI font has no small-capital `ɢ` (builds without Inter use egui's fonts); its sample is now a capital and a smaller capital, drawn from ordinary letters every UI font has. Numbers unchanged | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 07c6a4dd1..16a5af69b 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # FigCraft parity with Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (number variables in the text content picker (#629); frames and sections convert into each other (#719); 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) · **Target:** Figma Design (desktop app 126.10.7, macOS) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (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); 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) · **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 @@ -15,7 +15,7 @@ summarizes it; [`gaps.md`](gaps.md) is the ranked work list; the measured menu c | Number | Value | Kind | |---|---|---| -| Menu/command breadth | **100%** (211 / 211 catalogued menu items have a live command) | **measured** (`cargo xtask parity`, 2026-10-12) | +| Menu/command breadth | **100%** (212 / 212 catalogued menu items have a live command) | **measured** (`cargo xtask parity`, 2026-10-17) | | Feature breadth (does each Figma Design feature exist, weighted) | **~85%** (core editor areas 1–16: ~94%) | estimated from the area table below | | Ready for real work | **~53%** | estimated (dimension table below: written weights × written per-dimension scores) | | Essentials user | **~59%** | estimated ([below](#essentials-user): core features 77.8% × discounts 0.92 × 0.94 × 0.88) | @@ -107,7 +107,7 @@ Breadth: does it exist. Ready: depth, correctness and fidelity for real projects | 11 | Components & variants | 9 | 96% | 72% | Real (not synthetic) libraries, `.fig` libraries (a component playground for variant, boolean and text properties, a behaviour suite from the documentation, overrides of padding, gap, grids, exports and interactions, refused geometry overrides, variant-switch and Assets-swap override rules, top-left default variant landed) ([components-parity](components-parity.md)) | 4–9 | | 12 | Styles & variables | 5 | 95% | 76% | Real-library QA (variables inside styles, behaviour suite from the documentation, style folders and order, mode order, code syntax, extended collections with their tail (new library variables as updates, chains through libraries) and variables import/export landed) ([components-parity](components-parity.md)) | 2–4 | | 13 | Prototyping | 6 | 92% | 74% | Video triggers and media actions, controllers on macOS, Linux and FreeBSD, real prototype QA (behaviour suite from the documentation, delays on mouse triggers, manual overlay offsets, key combinations, controller buttons on key/gamepad triggers (Windows and the browser), widgets reacting in prototypes, interactive components playing their variants, drag-driven animations, physical springs landed) ([prototyping-parity](prototyping-parity.md)) | 2–5 | -| 14 | Import/export | 6 | 86% | 58% | `.fig` import's tail (best-effort import, editable vector networks, stand-ins for non-design layers and variable prototype actions landed; no real-file checks yet), checking the rest of the experimental `.fig` export (landed; written files open and draw in other software) on effects, images, prototypes and real files, HEIC/video import, CMYK output intent ([file-format-parity](file-format-parity.md)) | 5–10 | +| 14 | Import/export | 6 | 86% | 58% | `.fig` import's tail (best-effort import, editable vector networks, stand-ins for non-design layers and variable prototype actions landed, then (2026-10-17) grid tracks, slots, labels of connectors saved with their path, per-point joins, text on a path, image adjustments, budgets for large files, an import report and paste from another design app; all on synthetic files, no real-file checks yet), checking the rest of the experimental `.fig` export (landed; written files open and draw in other software) on effects, images, prototypes and real files, HEIC/video import, CMYK output intent ([file-format-parity](file-format-parity.md)) | 5–10 | | 15 | Dev Mode / inspect | 2 | 96% | 72% | Import lines for connected instances inside generated layer trees; an editor extension is left to the MCP server (inspect behaviour suite with colour formats, rem and icon and image assets, code connect, plugins in Dev Mode and dev resources links landed) ([dev-mode-parity](dev-mode-parity.md)) | 0–1 | | 16 | Comments, versions, find, misc | 3 | 87% | 63% | Comments are local only; comparing two versions; branches in live sessions; text runs and other lists besides fills, strokes and effects merge whole (branches with review and merge, their own version history and per-item list merges, and a comments and version history behaviour suite from the documentation landed) | 1–3 | | 17 | Multiplayer & sharing | 8 | 17% | 5% | Core landed (`crates/collab`: ids, change sets, server ordering, convergence tested); live sessions (preview): WebSocket transport, hosting from the desktop app, joining from the app or the browser, invite links that open the app, cursors, selections and follow, cursor chat and spotlight, per-person undo, offline resume; a self-hosted `figcraft-server` with persistence and share links to edit or view, which can be open to the public (owner tokens, limits per address, expiry, moderation). Left: accounts and teams, audio ([collaboration-parity](collaboration-parity.md)) | 42–84 | @@ -124,12 +124,12 @@ Breadth: does it exist. Ready: depth, correctness and fidelity for real projects |---|---|---|---|---|---| | Features (depth) | 35 | 63% | 28–67 (areas 1–13, 15, 16, 20) | The table above; core editor ~72% | this file | | UI/UX fidelity | 15 | 58% | 40–60 | Look & feel compared side by side with UI3 (~65% by the builders); tool-by-tool interaction (modifiers while dragging, hover states, popovers) not yet compared (a cursor for every tool and modifier, number fields and panel widths built from the documentation, not compared); accessibility names and keyboard navigation landed | [ui-parity](ui-parity.md) | -| File formats | 12 | 60% | 5–10 | `.fig` read, best effort, with editable vector networks (tested on generated fixtures, not real files), `.fig` write experimental (round trips through our own importer; written files open and draw in other software); REST JSON import, SVG in/out, PNG/JPG/WebP/PDF export solid, with a behaviour suite from the documentation | [file-format-parity](file-format-parity.md) | +| File formats | 12 | 60% | 5–10 | `.fig` read, best effort, with editable vector networks and (2026-10-17) more fidelity, budgets for large files and an import report (tested on generated fixtures, not real files); layers copied from another design app paste the same way (tested only with clipboard HTML made from our own export), `.fig` write experimental (round trips through our own importer; written files open and draw in other software); REST JSON import, SVG in/out, PNG/JPG/WebP/PDF export solid, with a behaviour suite from the documentation | [file-format-parity](file-format-parity.md) | | Collaboration | 10 | 13% | 52–104 | Local comments, version history and branches with review and merge; the multiplayer core (sync model, server ordering, client reconciliation, convergence tests) landed in #103, and live sessions (preview) co-edit a file hosted by a desktop app or kept on a self-hosted `figcraft-server` with edit and view links, joined from the app or the browser, with cursor chat and spotlight (`docs/collab-protocol.md`) | [collaboration-parity](collaboration-parity.md) | | Stability | 8 | 55% | 20–40 | Never-crash lints, command guard with rollback, recovery copies, 963 tests incl. junk-parameter sweeps and a seeded retained-render walk; but two days old, one release (v0.2.0), no field reports, QA mostly on macOS | [gaps](gaps.md) | | Performance | 6 | 60% | 30–60 | `cargo xtask bench`: 50k-layer page ~8 ms zoomed out, 10k-layer edits ~0.2 ms, 2,000-instance design system edits 4–64 ms; CPU (tiny-skia) canvas where Figma renders on the GPU; nothing timed against Figma on the same file | [hardware-parity](hardware-parity.md) | | Hardware | 3 | 60% | 10–21 | Trackpad pinch and HiDPI yes; pen pressure on Windows and from browser styluses (none from macOS/Linux tablets); several windows (screen-reader tree in the main one only); no GPU canvas, no P3 on screen | [hardware-parity](hardware-parity.md) | -| Localization | 3 | 39% | 29–51 | The layer, English, Russian reviewed by VanTan, and machine drafts of Spanish (with a Latin American overlay), French, German, Brazilian Portuguese, Japanese, Korean and Simplified Chinese (none reviewed by a native speaker; every draft covers all current strings), CJK UI text in installed faces loaded on demand (web: only the craft-fonts CJK build); engine messages stay English | [localization-parity](localization-parity.md) | +| Localization | 3 | 39% | 29–51 | The layer, English, Russian reviewed by VanTan, and machine drafts of Spanish (with a Latin American overlay), French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Czech (none reviewed by a native speaker; measured 2026-10-17, the drafts cover 95–99% of the 2,272 current strings), Swedish and Turkish catalogs, CJK UI text in installed faces loaded on demand (web: only the craft-fonts CJK build); engine messages stay English | [localization-parity](localization-parity.md) | | Platforms | 3 | 75% | 10–20 | macOS, Windows (x64/x86/arm64), Linux, FreeBSD, web all packaged (v0.2.0); Figma also has iOS/Android apps; non-macOS QA thin | [hardware-parity](hardware-parity.md) | | Ecosystem/plugins | 3 | 38% | 8–26 | Own WASM plugins with a Rust SDK and three examples (#101), plugin panels and settings (ABI v2), widgets that take clicks (API 3), a self-hosted plugin directory on `figcraft-server`; no Figma plugin compatibility, no public catalogue or community files; the CLI, control channel and MCP server are ahead of Figma for agents | [gaps](gaps.md) | | AI features | 2 | 0% | 30–60 | None | [gaps](gaps.md) | @@ -423,7 +423,11 @@ Hours in this narrative are the builders' estimates; the tables above supersede JPG, WebP, SVG and PDF, suffix, advanced options: contents only, include bounding box, and for SVG outline text, id attributes and simplified strokes), a preview, and "Export N layers" (`file.exportLayers`) in the panel and the Export dialog. Paste from other apps: images, SVG and text (the newest clipboard - content wins over our own copy; pasted SVG lands centred in the view). SVG import is editable and + content wins over our own copy; pasted SVG lands centred in the view), and layers copied from + another design app (`edit.pasteDesignLayers`: the `.fig` canvas in the clipboard's HTML read + like a `.fig` file, best effort; tested with clipboard HTML made from our own export only). + File ▸ Save as… to a `.fig` name writes an experimental export copy and the document keeps its + `.figcraft` path. SVG import is editable and checked against a corpus of synthetic files (expected pixels worked out by hand, layer structure, export and re-import): groups named from their ids with transforms baked into the layers; rectangles (corner radius), ellipses and lines kept as those shapes; gradients with exact @@ -623,13 +627,18 @@ Carried over from the ROADMAP's "Shipped so far" (2026-10-10). The test count th - **Automation:** desktop control channel (`--control `: execute commands, inspect document/UI, synthetic pointer/keys/typing, menu invocation, screenshots, renders). What agents read and write on disk can be confined to chosen folders (`--automation-read-root` / `--automation-write-root` on - `figcraft-cli mcp` and the desktop app, #715). + `figcraft-cli mcp` and the desktop app, #715). A minimised or covered window answers every + request that acts on the app's state without drawing (about 100 ms each on Windows), and the + ones that need a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) fail at once instead of + waiting 60 s (#720; not tested on macOS, and under Wayland a minimised window can't be told + apart). - **Tests:** 963 `#[test]` functions (2026-10-10) including junk-parameter sweeps over every command (and every vector-edit command while editing), importer fuzzing and render regressions. ## Revision history | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Menu breadth re-run with `cargo xtask parity`: 212 / 212 (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Rows for the 2026-10-17 landings: import/export (area 14) and the file formats dimension name the `.fig` import's new fidelity (instance identity, overrides by key, text style precedence, grid tracks, slots, connector labels, per-point joins, text on a path, image adjustments, list start numbers, vertical trim), budgets from the file's size, the import report, a `.fig` copy from Save as and paste from another design app; the localization evidence takes the re-measured catalog counts (2,272 entries, drafts at 95–99%, Indonesian and Czech drafts, Swedish and Turkish catalogs); the Automation line adds control requests answered while the window is minimised (#720); batch #753's Selection colors, smart-selection spacing, Present tab and auto layout on empty frames are in ui-parity, prototyping-parity and auto-layout-parity. Numbers unchanged: every `.fig` and paste change is checked on synthetic files or clipboard HTML made from our own export, and real files are what gap 1's blocker and the file-exchange discounts wait for; the UI changes (menus, the Actions palette, editor fixes) are not compared side by side, so UI/UX stays at 58%; the localization grade and hours stay (Indonesian's draft is offset by the drafts' new gaps) | | 2026-10-17 | minor | Automation roots (M8, #715, #481): `figcraft-cli mcp --automation-read-root DIR --automation-write-root DIR` (each repeatable, existing folders) and the desktop app with the same flags confine every file a command reads to the read and write roots and every file it writes to the write roots; paths are resolved (links followed, `..`, Windows `\\?\` and UNC paths, case) and compared by whole folder names, anything else is an ordinary error. The engine reaches the file system through one module (enforced by `crates/engine/clippy.toml`), and a sweep runs every command with paths outside the roots. `--attach` refuses the flags (the app confines itself); `ui.screenshot` and `ui.render` return PNG data without a `path`, so the attached MCP server writes no temporary files. Numbers unchanged. | | 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | | 2026-10-17 | minor | Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 62001715e..0cccf008c 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-10-15 · **Change:** minor (fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **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: @@ -15,19 +15,20 @@ interaction feel not yet compared. | Item | Status | Notes | |---|---|---| -| UI3 layout: tab strip as title bar, icon rail, file header, pages + layers, floating bottom toolbar with flyouts, Design / Prototype / Inspect panels | done | frameless window on Windows/Linux with drawn buttons | +| UI3 layout: tab strip as title bar, icon rail, file header, pages + layers, floating bottom toolbar with flyouts, Design / Prototype / Inspect panels | done | frameless window on Windows/Linux with drawn buttons; on a Wayland compositor that offers no server-side decorations (GNOME) the window gets winit's Adwaita controls instead (#592; checked by its author on GNOME, KDE not run) | | Light and dark themes | done | colours from `theme::Tokens`; a file or a page made while the dark theme shows gets a `#1E1E1E` page (`#F5F5F5` in the light theme), its own from then on: changing the theme repaints no page and opened files keep theirs; the file the app opens with takes the theme once it is known; the CLI, MCP and exports have no theme and keep `#F5F5F5`; text drawn with the Text tool is white on a dark page and black on a light one (so is text a command makes in the app without naming a fill; headless sessions keep black) (`theme_pages_tests`, `dark_page_text_tests`) | | Minimize UI (Cmd+\\) | done | | | Resizable panels | done | each panel's edge drags its width (left 200–480, right 240–480, 240 by default; a double-click on the edge or View ▸ Panels ▸ Reset panel widths puts the default back); the widths are each window's own, the main window's are kept in the preferences when a drag ends and come back at the next start, a new window opens with those of the window it comes from; Minimize UI hides the panels and brings them back as they were; the view keeps its centre and zoom while a panel is resized; in a window too small for them the panels give way so the canvas keeps 160 px (the left one first), down to the smallest window (800×500) (`panel_width_tests`). Not compared with Figma's widths; no snap points | -| Actions palette (Cmd+K, Cmd+/) | done | commands; no assets search parity | -| Context menus | done | canvas and layers; Shift+F10 opens them from the keyboard (at the focused layer row or below the canvas selection) and the menu takes the keyboard; the Menu key isn't delivered by the windowing layer (egui 0.36 has no key for it) | +| Actions palette (Cmd+K, Cmd+/) | done | tabs: All (every command, grouped by menu, or Other), 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 opens them from the keyboard (at the focused layer row or below the canvas selection) and the menu takes the keyboard; the Menu key isn't delivered by the windowing layer (egui 0.36 has no key for it) | | 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 | -| Keyboard shortcuts panel | done | 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 | +| 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 | +| 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 | | Colour names in hex fields | done | every hex field (fills, strokes, text ranges, effects, layout grids, colour variables, page and prototype backgrounds, the colour picker's Hex) takes a CSS colour name as well: `red` becomes `FF0000`; case, spaces and hyphens are ignored (`Light Blue`); names are opaque and keep the colour's opacity; hex wins where both could match. The picker's CSS field takes every CSS name too (`Color::from_hex_or_name`, `color::named`) | | Fields select their text on focus | done | a click or Tab into a one-line field selects all of its text, so typing replaces the value: hex and colour fields, number fields, inline fields (a fill's hex, variable values, renames), names, search boxes and dialog fields; a drag from the press selects only what it covers; multi-line fields (descriptions, comments) keep the caret where clicked. The first click into an inline field (a fill's hex) now takes the keyboard; it took a second click (`widgets::select_all_on_focus`, `select_all_tests`) | +| Colour picker on a new fill or stroke | done | + opens the picker on the new paint when the selection shares one paint list; on a mixed selection + adds a paint to each layer and no picker opens (#404) | | Blend mode menus: the layer's (Design panel) and each paint's (colour picker) | done | Pass through and Normal are distinct (Normal isolates a group's or frame's children); paints have no pass-through; plus darker drawn exactly on the canvas | ## Layers and Assets panels @@ -40,15 +41,15 @@ interaction feel not yet compared. | Eye and padlock: click, or drag across rows to set several in one step; layers in a locked frame show a faint padlock | done | the toggles no longer vanish under the pointer (clicks on them could miss) | | Rename: double click, F2 / Cmd+R, Tab to the next row; several layers open Rename layers (match, regular expressions, current name and number codes, start value, preview) | done | numbered in stacking order, pinned | | Find layers (filter by name) | done | not covered by the documentation | -| Pages: add, rename, drag to reorder, duplicate ("Copy of"), delete, dividers (a blank page named with a hyphen) | done | | -| Assets panel: folders from page, frames and slash names (fold away), search, thumbnails, drag onto the canvas or into frames and auto layout, Alt-drop swap, enabled libraries | done | | +| Pages: add, rename, drag to reorder, duplicate ("Copy of"), delete, dividers (a blank page named with a hyphen) | done | the line between Pages and Layers drags to size the pages list, kept in the preferences (`layers_behaviour_tests`) | +| Assets panel: folders from page, frames and slash names (fold away), search, thumbnails, drag onto the canvas or into frames and auto layout, Alt-drop swap, enabled libraries | done | Shift+I (Quick insert) and the toolbar's Resources open it (they didn't, #710) | | Hide when publishing from the Assets panel's context menu | done | a right-click on one of this file's components (also Libraries ▸ Hide when publishing for the selection, `component.hideWhenPublishing {ids?, on?}`): the model's sign of it is the name, so hiding puts a `.` before the name and showing takes the leading `.` and `_` away (one undo step, saved and synced like a rename; a variant or a layer inside hides its whole component or set); a hidden component shows a crossed eye on its tile and a dimmer name, the menu item its check mark; the next publish leaves it out and brings it back when shown again (`hide_publishing_tests`). Library components (read-only here) have no such menu | ## Selection and transform | Item | Status | Notes | |---|---|---| -| Click, Shift-click, marquee, Shift-marquee toggle | done | 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`) | +| 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 | | | Enter / Shift+Enter (children / parent), Tab / Shift+Tab (siblings) | done | Tab renames the next layer while renaming | @@ -68,6 +69,8 @@ interaction feel not yet compared. | Numeric fields: arithmetic, scrubbing by dragging the label, mixed values | done | Numeric panels use `widgets::number_field`; Typography line height, letter spacing and paragraph spacing share its leading-icon scrub logic (#373), retaining their existing unit parsing, Auto/Mixed values, variable chips and selected-character targeting (`typography_scrub_tests`). Scrubbing the label: a step a point (1 px; 1% of opacity, 1° of rotation), ten with Shift, a tenth with Alt, each stretch at the rate held while it was dragged, one undo step when let go; past the edge of the screen it goes on where the platform reports the mouse's own motion (desktop), otherwise it stops there. Arrow keys: Up/Down step a pixel field by the small nudge and Shift by the big nudge (the preferences), other fields by their own step and ten of it; they work while typing (from what is typed) and with the keyboard on the field. Typing: `+ - * /`, brackets, units (`px`, `°`, `%`, `x`, `ms`), a decimal comma; `+10`, `*2`, `/4` are relative to the value, and `50%`, `+10%`, `-10%` too in a field that isn't a percentage. Enter, Tab or a click elsewhere commits (Tab and Shift+Tab move to the next and previous control), Escape restores; a field left as it was commits nothing (no undo step, and a rounded display isn't written back). Mixed values show "Mixed": a number sets them all, a relative edit or an arrow key goes to each layer from its own value in one undo step, for X, Y, W, H, rotation, opacity, corner radius and stroke weight (elsewhere `+10` on Mixed sets 10 and `*2` does nothing) (`field_tests`). Left: scrubbing a Mixed field (nothing happens), `x2`-style suffix edits, the pointer isn't wrapped to the other side of the screen; rates not compared with Figma's | | Transform box at small sizes | done | a press inside a layer smaller than its handles moves it, the nearest handle wins, handles answer just outside and are hidden under 16 px on screen; cursors follow each handle and the box's rotation | | Locked layers | done | selectable from the layers panel; no handles, not dragged with the rest of a selection | +| Smart selection spacing | partial | with layers in a row, a column or an aligned grid selected, the Layout section shows horizontal and vertical spacing ("Mixed" until set; typed, scrubbed, fractional and negative) and pink handles in the gaps on the canvas drag them, one undo step, Escape cancels (`arrange.spacing`; sizes, parents and offsets within each track kept; at most 2,000 layers; flow children, locked layers and layers inside instances left out). No reorder rings for swapping layers; checked by its author on macOS and in the app on Windows (#402) | +| Selection colors | partial | for a mixed selection the Design panel lists their solid and gradient paints (children and text ranges included; hidden paints, masks, images, patterns and boolean operands left out; styles and variables listed apart): editing a colour changes every matching fill and stroke in one undo step, a row selects the layers that use it or applies a colour style of the document (`selection.colors`, `selection.setPaint`, `selection.applyColorStyle`, `selection.selectColor`). No library styles or variable binding from there (#403) | | Keyboard box selection | done | Alt+Space on macOS, Ctrl+Space on Windows and Linux, or F8 (`select.area`): a box around the selection or in the middle of the view; arrows move it, Cmd/Ctrl+arrows or Shift+arrows size it (Shift with Cmd/Ctrl: farther), Enter selects like a marquee (Shift+Enter toggles, Cmd/Ctrl+Enter nested), Escape closes | ## Tools @@ -79,10 +82,10 @@ 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`) | -| Vector edit mode: bend, paint bucket, lasso, cut, eraser, transform box, point snapping, mirroring | done | 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`). Not yet: the transform box around points of several layers; 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); 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`). Not yet: the transform box around points of several layers; 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 | | -| Text: point, auto height, fixed; caret, words, lines, IME | done | carets step over whole emoji and accented letters; CJK words by script run (no dictionary); vertical trim in Type settings; no spell check | +| Text: point, auto height, fixed; caret, words, lines, IME | done | the font picker previews a family on the canvas while hovered (no undo step; Escape restores, #653); 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; CJK words by script run (no dictionary); vertical trim in Type settings; no spell check | | Eyedropper (I) | done | picks the colour seen under the pointer (opaque) into the selection's fill and the recent colours, one undo step (`fx_behaviour_tests`) | | Comment (C), Shift+C to show/hide | done | local only | | Text on a path (Figma Draw) | done | put on from the Design panel or `text.onPath`, not by clicking a path with the Text tool; the path is edited by resizing only | @@ -137,6 +140,9 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look Ctrl+Alt+Shift+K to go to the main component, the arrows panning the view when nothing is selected (`view.pan`, new), Control suspending snapping on macOS, and Space, N, C and F while presenting. The paint bucket's tooltip shows Shift+B (B still works). +- **Fixed (2026-10-17):** Shift+Cmd/Ctrl+V (Paste over selection) and Alt+Cmd/Ctrl+V (Paste + properties) work on the desktop (they were bound but didn't act there, #716); Cmd/Ctrl+V pastes an + image copied in another app (#663). Counts above unchanged (the suite checks bindings). - **Where the documentation disagrees with itself** (noted per row): pixel grid (Shift+' or Cmd+'), letter spacing (Alt or Cmd with < >; Cmd would be the font size keys, Alt bound), Windows remove fill (Alt+/ or Alt+,; Alt+, is letter spacing), the Layers panel on Windows (Alt+1 @@ -166,6 +172,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | The community batches #733, #735, #736, #729 and #753: submenus open after a short hover, keep their place along a safe triangle and reopen closed (main and context menus); the Actions palette's tabs, ranked search, keyboard highlight and recents; menu items that need a value ask for it, File ▸ Rename edits in place; Shift+I and Resources open Assets; a draggable Pages/Layers divider; Shift-drag moves the selection; a double-click near a thin stroke, merging dropped points and Flatten keeping open paths in vector editing; live font preview and the selection highlight after line breaks; the colour picker on a new fill or stroke; Paste over and Paste properties from the keyboard; Selection colors (partial: no library styles or variables there) and smart-selection spacing fields and canvas handles (partial: no reorder rings), both also checked by their author on macOS; the keyboard shortcuts panel closes on the home screen; Adwaita window controls on Wayland compositors without server decorations (checked by its author on GNOME; KDE not run). Checked in the app on Windows (submenus by their author), not side by side with Figma. Summary and hours unchanged | | 2026-10-15 | minor | Hex fields take CSS colour names (`red` → `FF0000`): fills, strokes, effects, grids, variables, backgrounds and the colour picker | | 2026-10-15 | minor | Typography: drag the line-height, letter-spacing and paragraph-spacing icons to scrub their values; shared numeric-field rates, resize cursor and one Undo step per gesture (#373). | | 2026-10-15 | minor | A click or Tab into a one-line field selects all of its text (hex, inline, name, search and dialog fields); the first click into a fill's hex takes the keyboard | From b84ee179d474da8024dd55a707a40cb1f8e19a97 Mon Sep 17 00:00:00 2001 From: JimKnoxx Date: Sat, 17 Oct 2026 17:05:49 +0200 Subject: [PATCH 191/817] M8: draw the macOS shortcut glyphs the UI font lacks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Menus and tooltips showed boxes for ⌃ ⌥ ↵ ⌫ ⇥ ⇞ ⇟ (e.g. Present ⌥⌘↵): egui's default face has ⌘ and ⇧ but not these. The desktop app now adds a system face that has them after the UI fonts. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/theme.rs | 47 +++++++++++++++++++++++++++++++++++++ docs/ui-parity.md | 1 + 2 files changed, 48 insertions(+) diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rs index 080bce43d..933ebece8 100644 --- a/crates/ui-egui/src/theme.rs +++ b/crates/ui-egui/src/theme.rs @@ -274,6 +274,7 @@ pub fn install_fonts(ctx: &Context, system: bool, cjk: u8) { .any(|x| x.has_char(c)) }; extra.extend(crate::bidi::script_fallbacks(&embedded)); + extra.extend(key_symbol_fallbacks(&embedded)); extra.extend(crate::cjk::faces(cjk, lang, &embedded).iter().map(|f| (format!("system-{}-{}", f.family, f.style), font_data(f)))); } extra.extend(craft(true)); @@ -288,6 +289,26 @@ pub fn install_fonts(ctx: &Context, system: bool, cjk: u8) { ctx.set_fonts(fonts); } +/// The glyphs macOS shortcuts are written with ([`figcraft_engine::keymap::display`]). +const KEY_SYMBOLS: &str = "⌃⌥⇧⌘⌫↵⇥⇞⇟←→↑↓"; + +/// System faces for the shortcut glyphs the UI's own fonts lack (egui's default face has ⌘ but +/// not ⌥ or ↵). +fn key_symbol_fallbacks(have: &dyn Fn(char) -> bool) -> Vec<(String, FontData)> { + const FAMILIES: [&str; 6] = ["Lucida Grande", "Apple Symbols", "Segoe UI Symbol", "DejaVu Sans", "Noto Sans Symbols 2", "FreeSans"]; + let mut out = Vec::new(); + let mut taken: Vec> = Vec::new(); + for c in KEY_SYMBOLS.chars() { + if have(c) || taken.iter().any(|f| f.has_char(c)) { + continue; + } + let Some(face) = figcraft_text::face_with_char(c, &FAMILIES) else { continue }; + out.push((format!("system-{}-{}", face.family, face.style), font_data(&face))); + taken.push(face); + } + out +} + /// egui font data over a face's bytes, without copying them (CJK faces are 10–20 MB). Font /// database faces are never dropped, so a system face's shared bytes are kept for good: leaking /// one more reference to them costs a pointer and gives egui the `'static` slice it needs. @@ -331,3 +352,29 @@ pub fn doc_c32(ctx: &Context, c: figcraft_color::Color) -> Color32 { let conv = ctx.data(|d| d.get_temp::(screen_conversion_id())); c32(conv.map_or(c, |k| k.apply(c))) } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn ui_font_draws_every_mac_shortcut_glyph() { + figcraft_text::scan_system_fonts(); + if key_symbol_fallbacks(&|_| false).is_empty() { + eprintln!("no system face with shortcut glyphs; skipping"); + return; + } + let ctx = Context::default(); + install_fonts(&ctx, true, 0); + let input = + egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(egui::pos2(0.0, 0.0), egui::vec2(100.0, 100.0))), ..Default::default() }; + ctx.run_ui(input, |_| {}).textures_delta.clear(); + ctx.fonts_mut(|f| { + for c in KEY_SYMBOLS.chars() { + for font in [regular(11.0), semibold(11.0)] { + assert!(f.has_glyphs(&font, &c.to_string()), "UI font draws {c:?}"); + } + } + }); + } +} diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 0cccf008c..a28749bf2 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -172,6 +172,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| +| 2026-10-17 | patch | macOS shortcut keycaps draw ⌃ ⌥ ↵ ⌫ ⇥ ⇞ ⇟ in menus and tooltips (they were boxes): the desktop app adds a system face with them (Lucida Grande, Apple Symbols, Segoe UI Symbol, DejaVu Sans…) after the UI fonts. Checked in the app on macOS. The web build on a Mac still shows boxes (no system fonts there). Summary and hours unchanged | | 2026-10-17 | minor | The community batches #733, #735, #736, #729 and #753: submenus open after a short hover, keep their place along a safe triangle and reopen closed (main and context menus); the Actions palette's tabs, ranked search, keyboard highlight and recents; menu items that need a value ask for it, File ▸ Rename edits in place; Shift+I and Resources open Assets; a draggable Pages/Layers divider; Shift-drag moves the selection; a double-click near a thin stroke, merging dropped points and Flatten keeping open paths in vector editing; live font preview and the selection highlight after line breaks; the colour picker on a new fill or stroke; Paste over and Paste properties from the keyboard; Selection colors (partial: no library styles or variables there) and smart-selection spacing fields and canvas handles (partial: no reorder rings), both also checked by their author on macOS; the keyboard shortcuts panel closes on the home screen; Adwaita window controls on Wayland compositors without server decorations (checked by its author on GNOME; KDE not run). Checked in the app on Windows (submenus by their author), not side by side with Figma. Summary and hours unchanged | | 2026-10-15 | minor | Hex fields take CSS colour names (`red` → `FF0000`): fills, strokes, effects, grids, variables, backgrounds and the colour picker | | 2026-10-15 | minor | Typography: drag the line-height, letter-spacing and paragraph-spacing icons to scrub their values; shared numeric-field rates, resize cursor and one Undo step per gesture (#373). | From a3c5025186da95d9a519ee212365f7806f058c11 Mon Sep 17 00:00:00 2001 From: RealtaNua Date: Sat, 17 Oct 2026 22:06:03 +0700 Subject: [PATCH 192/817] M7: missing fonts window only after a file opens; wait for the font scan (#752) From review: - The check ran after any file.open/openRecent/import result, so a pasted or dropped image, reopening a file that was already open, or Clear recent brought the window back. It now runs only for results with a `summary` (a file opened, or pages imported), and never in the browser. - Text > Missing fonts... before the startup scan finished listed installed fonts as missing. It now says it is checking the installed fonts and lists them once that is done (`figcraft_text::installed_fonts_known`, also true when system fonts are opted out, where checks used to wait forever). - ROADMAP progress log and file-format-parity status line. Co-Authored-By: Claude Opus 5.5 (1M context) --- ROADMAP.md | 2 + crates/engine/src/fonts.rs | 2 +- crates/engine/src/fonts_tests.rs | 5 ++- crates/text/src/fontdb.rs | 10 +++++ crates/text/src/lib.rs | 2 +- crates/ui-egui/locales/en.toml | 1 + crates/ui-egui/locales/es.toml | 1 + crates/ui-egui/src/missing_fonts.rs | 38 +++++++++++------- crates/ui-egui/src/missing_fonts_tests.rs | 47 ++++++++++++++++++++--- docs/file-format-parity.md | 2 +- 10 files changed, 87 insertions(+), 23 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index a8ae28ab1..3dcf67b51 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -131,6 +131,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). ## Progress log +- **2026-10-17** · Missing fonts (M7, #752): fonts a file names that aren't installed (text layers, styled ranges, text styles, font family variables) are listed in a Missing fonts window after the user opens the file (once installed fonts are indexed and any import report is closed), from Text ▸ Missing fonts…, by `text.missingFonts` and by `figcraft-cli info`. Their text still draws in a fallback font. Numbers unchanged. - **2026-10-17** · Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. - **2026-10-17** · Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. - **2026-10-17** · Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. @@ -316,6 +317,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Missing fonts (M7, #752): fonts a file names that aren't installed are listed after the user opens it, from Text ▸ Missing fonts…, by `text.missingFonts` and by `figcraft-cli info`. Numbers unchanged. | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | | 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | diff --git a/crates/engine/src/fonts.rs b/crates/engine/src/fonts.rs index e20d4d401..3548124d5 100644 --- a/crates/engine/src/fonts.rs +++ b/crates/engine/src/fonts.rs @@ -21,7 +21,7 @@ pub struct Missing { /// The families `doc` names that the font database doesn't have, by name. On the desktop the /// installed fonts are indexed in the background: ask once that's done -/// (`figcraft_text::system_fonts_scanned`), or every installed family counts as missing. +/// (`figcraft_text::installed_fonts_known`), or every installed family counts as missing. pub fn missing(doc: &Document) -> Vec { // Lower-case family → (spelling, layers). let mut used: BTreeMap = BTreeMap::new(); diff --git a/crates/engine/src/fonts_tests.rs b/crates/engine/src/fonts_tests.rs index 6ba925b38..a6e2d213f 100644 --- a/crates/engine/src/fonts_tests.rs +++ b/crates/engine/src/fonts_tests.rs @@ -112,7 +112,10 @@ fn blank_families_and_aliases_are_handled() { doc.get_mut(t).unwrap().bound.insert("fontFamily".into(), "V:alias".into()); let other = text(&mut s, "FigCraft Missing G"); s.doc_mut().unwrap().get_mut(other).unwrap().bound.insert("fontFamily".into(), "V:cycle".into()); - // The bound layer takes the value its alias resolves to; the cycle resolves to nothing. + // The bound layer takes the value its alias resolves to (bindings are applied after the next + // command); the cycle resolves to nothing. + let NodeKind::Text(bound) = &s.doc().unwrap().node(t).unwrap().kind else { panic!() }; + assert_eq!(bound.style.font_family, "FigCraft Missing F"); assert_eq!(families(&mut s), vec![("FigCraft Missing F".to_string(), 1), ("FigCraft Missing G".to_string(), 1)]); } diff --git a/crates/text/src/fontdb.rs b/crates/text/src/fontdb.rs index 54adc282f..d3101bfc6 100644 --- a/crates/text/src/fontdb.rs +++ b/crates/text/src/fontdb.rs @@ -876,6 +876,16 @@ fn system_fonts_opted_out() -> bool { std::env::var_os("FIGCRAFT_NO_SYSTEM_FONTS").is_some_and(|v| !v.is_empty() && v != "0") } +/// Every font text can use is known: the system fonts were indexed, or there are none to index +/// (opted out, or the web). Until then a family the scan would find counts as missing. +pub fn installed_fonts_known() -> bool { + #[cfg(not(target_arch = "wasm32"))] + if !system_fonts_opted_out() { + return system_fonts_scanned(); + } + true +} + /// Index the system fonts the first time the font database is used (headless apps: a run that /// lays out no text never pays for the scan). The desktop app scans in the background instead. pub fn scan_system_fonts_on_demand() { diff --git a/crates/text/src/lib.rs b/crates/text/src/lib.rs index 721471ad9..683350f61 100644 --- a/crates/text/src/lib.rs +++ b/crates/text/src/lib.rs @@ -17,7 +17,7 @@ pub use breaks::grapheme_step; pub use color::{ColorBitmap, ColorInk, ColorLayer}; pub use fontdb::{ Axis, CRAFT_FONTS, Coords, Face, FontDb, NamedInstance, axis_label, db, face_with_char, family_names, family_styles, find_face, has_family, - no_coords, scan_system_fonts, scan_system_fonts_on_demand, system_fonts_scanned, + installed_fonts_known, no_coords, scan_system_fonts, scan_system_fonts_on_demand, system_fonts_scanned, }; pub use layout::{Decoration, Glyph, Line, TextLayout, layout}; pub use onpath::OnPath; diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index b387db0d8..49387e361 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -198,6 +198,7 @@ name = "English" "C or ⇧C" = "C or ⇧C" "CMYK colour" = "CMYK colour" "Can view" = "Can view" +"Checking the fonts installed on this computer…" = "Checking the fonts installed on this computer…" "Checking the server…" = "Checking the server…" "Clear from this list" = "Clear from this list" "Code or invite link" = "Code or invite link" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 3e70bc838..6b4362b7e 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -201,6 +201,7 @@ status = "draft — needs native review" "C or ⇧C" = "C o ⇧C" "CMYK colour" = "Color CMYK" "Can view" = "Puede ver" +"Checking the fonts installed on this computer…" = "Comprobando las fuentes instaladas en este equipo…" "Checking the server…" = "Comprobando el servidor…" "Clear from this list" = "Borrar de esta lista" "Code or invite link" = "Código o enlace de invitación" diff --git a/crates/ui-egui/src/missing_fonts.rs b/crates/ui-egui/src/missing_fonts.rs index 8236ca90a..6c07068dc 100644 --- a/crates/ui-egui/src/missing_fonts.rs +++ b/crates/ui-egui/src/missing_fonts.rs @@ -15,19 +15,26 @@ pub struct Shown { /// The document it lists: the window goes when that document closes. pub uid: u64, pub families: Vec, + /// Asked for before the installed fonts were indexed: the list comes once they are. + pub indexing: bool, } impl Shown { pub fn inspect(&self) -> Value { - json!({"families": self.families.iter().map(|m| json!({"family": m.family, "layers": m.layers})).collect::>()}) + json!({ + "families": self.families.iter().map(|m| json!({"family": m.family, "layers": m.layers})).collect::>(), + "indexing": self.indexing, + }) } } -/// After a file the user opened (or imported into) is in front: look for missing fonts in it -/// once that can be told ([`show`]). +/// After the user opened a file, or imported pages into one (results with a `summary`; not a +/// placed image or SVG, a file that was open already, or Clear recent): look for missing fonts in +/// it once that can be told ([`show`]). Not in the browser, which has only its built-in fonts. pub fn check_later(app: &mut FigApp, command: &str, result: Option<&Value>) { - if result.is_some() + if !cfg!(target_arch = "wasm32") && matches!(command, "file.open" | "file.openRecent" | "file.import") + && result.is_some_and(|r| r.get("summary").is_some()) && let Ok(ds) = app.session.ds() { app.ui.font_checks.push(ds.uid); @@ -38,25 +45,26 @@ pub fn check_later(app: &mut FigApp, command: &str, result: Option<&Value>) { fn list(app: &mut FigApp, uid: u64) -> Option> { let ds = app.session.docs.iter().find(|d| d.uid == uid)?; let families = missing(&ds.doc); - app.ui.missing_fonts = Some(Shown { uid, families: families.clone() }); + app.ui.missing_fonts = Some(Shown { uid, families: families.clone(), indexing: false }); Some(families) } /// Text ▸ Missing fonts (`dialog.missingFonts`): the window for the file in front. pub fn request(app: &mut FigApp) { - if let Ok(uid) = app.session.ds().map(|d| d.uid) { + let Ok(uid) = app.session.ds().map(|d| d.uid) else { return }; + if figcraft_text::installed_fonts_known() { list(app, uid); + } else { + app.ui.missing_fonts = Some(Shown { uid, families: Vec::new(), indexing: true }); } } -/// Installed fonts are indexed: before that, every one of them would count as missing. The -/// browser has only its built-in fonts, so files there don't open the window by themselves. -fn fonts_known() -> bool { - !cfg!(target_arch = "wasm32") && figcraft_text::system_fonts_scanned() -} - pub fn show(app: &mut FigApp, ctx: &egui::Context) { - if !app.ui.font_checks.is_empty() && app.ui.import_report.is_none() && app.ui.missing_fonts.is_none() && fonts_known() { + let known = figcraft_text::installed_fonts_known(); + if let Some(uid) = app.ui.missing_fonts.as_ref().filter(|m| m.indexing && known).map(|m| m.uid) { + list(app, uid); + } + if !app.ui.font_checks.is_empty() && app.ui.import_report.is_none() && app.ui.missing_fonts.is_none() && known { let uid = app.ui.font_checks.remove(0); if list(app, uid).is_some_and(|f| f.is_empty()) { app.ui.missing_fonts = None; @@ -71,7 +79,9 @@ pub fn show(app: &mut FigApp, ctx: &egui::Context) { let mut close_clicked = false; crate::dialogs::window(tr("Missing fonts"), ctx).open(&mut open).show(ctx, |ui| { ui.set_width(380.0); - if shown.families.is_empty() { + if shown.indexing { + ui.label(tr("Checking the fonts installed on this computer…")); + } else if shown.families.is_empty() { ui.label(tr("All the fonts this file uses are installed")); } else { ui.label( diff --git a/crates/ui-egui/src/missing_fonts_tests.rs b/crates/ui-egui/src/missing_fonts_tests.rs index ba86cc7e4..2b11260a4 100644 --- a/crates/ui-egui/src/missing_fonts_tests.rs +++ b/crates/ui-egui/src/missing_fonts_tests.rs @@ -16,11 +16,10 @@ fn saved(name: &str, families: &[&str]) -> String { path } -/// The installed fonts are indexed, as the desktop app does at startup; false when this machine -/// opted out (nothing would ever count as known). +/// The installed fonts are indexed, as the desktop app does at startup. fn fonts_indexed() -> bool { figcraft_text::scan_system_fonts(); - figcraft_text::system_fonts_scanned() + figcraft_text::installed_fonts_known() } fn listed(u: &Ui) -> Value { @@ -42,11 +41,12 @@ fn opening_a_file_lists_its_missing_fonts_and_not_the_installed_ones() { u.app.run("file.open", json!({"path": path})); u.frame(vec![]); assert_eq!(listed(&u), Value::Null); + u.app.run("file.close", json!({})); u.app.run_user("file.open", json!({"path": path})); std::fs::remove_file(&path).unwrap(); u.frame(vec![]); - assert_eq!(listed(&u), json!({"families": [{"family": "FigCraft Missing UI", "layers": 2}]})); + assert_eq!(listed(&u), json!({"families": [{"family": "FigCraft Missing UI", "layers": 2}], "indexing": false})); u.frame(vec![]); let shown = u.frame_output(vec![]).shapes; assert!(crate::import_report_tests::shown_texts(shown).iter().any(|t| t == "2 text layers")); @@ -99,9 +99,10 @@ fn it_waits_for_the_import_report_to_close() { #[test] fn text_menu_shows_the_window_for_the_file_in_front_even_with_nothing_missing() { + assert!(fonts_indexed()); let mut u = Ui::new(Session::new()); assert!(u.app.run("text.missingFonts", json!({})).is_some()); - assert_eq!(listed(&u), json!({"families": []})); + assert_eq!(listed(&u), json!({"families": [], "indexing": false})); u.frame(vec![]); let shown = u.frame_output(vec![]).shapes; assert!(crate::import_report_tests::shown_texts(shown).iter().any(|t| t == "All the fonts this file uses are installed")); @@ -110,3 +111,39 @@ fn text_menu_shows_the_window_for_the_file_in_front_even_with_nothing_missing() u.frame(escape); assert_eq!(listed(&u), Value::Null, "Escape closes it"); } + +#[test] +fn asked_for_before_the_fonts_are_indexed_it_lists_them_once_they_are() { + assert!(fonts_indexed()); + let path = saved("indexing", &["FigCraft Missing Indexing"]); + let mut u = Ui::new(Session::new()); + u.app.run("file.open", json!({"path": path})); + std::fs::remove_file(&path).unwrap(); + // As Text ▸ Missing fonts leaves it while the startup scan is still running. + let uid = u.app.session.ds().unwrap().uid; + u.app.ui.missing_fonts = Some(crate::missing_fonts::Shown { uid, families: Vec::new(), indexing: true }); + u.frame(vec![]); + assert_eq!(listed(&u), json!({"families": [{"family": "FigCraft Missing Indexing", "layers": 2}], "indexing": false})); +} + +#[test] +fn placing_images_or_clearing_recents_does_not_bring_it_back() { + assert!(fonts_indexed()); + let path = saved("place", &["FigCraft Missing Place"]); + let svg = std::env::temp_dir().join(format!("figcraft-missing-fonts-place-{}.svg", std::process::id())); + std::fs::write(&svg, r#""#).unwrap(); + let mut u = Ui::new(Session::new()); + u.app.run_user("file.open", json!({"path": path})); + u.frame(vec![]); + assert_eq!(listed(&u)["families"][0]["family"], "FigCraft Missing Place"); + u.app.ui.missing_fonts = None; + // A placed SVG, the same file opened again (it only comes to the front), Clear recent. + assert!(u.app.run_user("file.import", json!({"path": svg.to_string_lossy()})).is_some()); + assert!(u.app.run_user("file.open", json!({"path": path})).is_some()); + u.app.run_user("file.openRecent", json!({"clear": true})); + std::fs::remove_file(&path).unwrap(); + std::fs::remove_file(&svg).unwrap(); + u.frame(vec![]); + assert!(u.app.ui.font_checks.is_empty()); + assert_eq!(listed(&u), Value::Null); +} diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 68f00f940..5205d55d3 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-14 · **Change:** minor (SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (missing fonts listed on open (#752); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) Every format Figma reads or writes, with FigCraft's support. Sources: `Info.plist` of `/Applications/Figma.app` (document types only; nothing inside the bundle's code was read), Figma's From 6ce46b3532dfba9f1631d2aa9349387d2177130f Mon Sep 17 00:00:00 2001 From: Filip Strajnar Date: Sat, 17 Oct 2026 17:09:51 +0200 Subject: [PATCH 193/817] M1: double-click a frame's name on the canvas to rename it (#757) A frame's name above its top edge (or a section's pill) only selected and dragged it; a double-click there did nothing, since the label lies outside the frame and hits no layer. With the Move or Scale tool, a double-click on a label now selects that frame and asks the UI (`canvas.renameLabel`) for a field over the label with the name selected, as the layers panel and pages list do. Enter or a click elsewhere renames it (`object.rename`, one undo step) and Escape leaves the name as it was. Rotated labels work too. Tests drive the canvas: a double-click on a label opens the field, typing and Enter rename the frame without moving it, undo restores the name, and Escape cancels on a rotated frame. --- crates/engine/src/tools.rs | 11 +++++ crates/ui-egui/src/canvas.rs | 1 + crates/ui-egui/src/frame_label_tests.rs | 55 +++++++++++++++++++++++++ crates/ui-egui/src/frame_labels.rs | 31 ++++++++++++++ crates/ui-egui/src/lib.rs | 9 ++++ docs/roadmap.md | 1 + docs/ui-parity.md | 5 ++- 7 files changed, 111 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/tools.rs b/crates/engine/src/tools.rs index dbda1894b..dba3eaf7e 100644 --- a/crates/engine/src/tools.rs +++ b/crates/engine/src/tools.rs @@ -1875,6 +1875,17 @@ impl Session { self.tool.overlay.marquee = None; self.cancel_interaction()?; } + // A frame's or section's name label: rename it there (the canvas puts a field over it). + if matches!(self.tool.tool, ToolId::Move | ToolId::Scale) + && !(ev.shift || ev.cmd || ev.alt) + && let Some(id) = label_at(&doc, page, &self.tool.labels, ev.p()) + { + if sel != [id] { + self.set_selection(vec![id]); + } + self.request_ui("canvas.renameLabel", serde_json::json!({"id": id})); + return Ok(()); + } let Some(leaf) = self.hit(&doc, page, ev.p(), ev.tol() * 2.0) else { return Ok(()) }; let target = select_target(&doc, leaf, &sel, true); // Text: edit at the click. diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index bc1842704..4c2b66ef0 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -242,6 +242,7 @@ pub fn show(app: &mut FigApp, ui: &mut Ui, worker: &mut Worker) { painter.image(tex.id(), image_rect, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE); } app.session.tool.labels = overlays(app, &painter, &t); + crate::frame_labels::rename_field(app, ui); // The zoom tool's area. if let (Some(start), Some(p)) = (app.canvas.zoom_drag, ctx.input(|i| i.pointer.hover_pos())) { let area = Rect::from_two_pos(start, p); diff --git a/crates/ui-egui/src/frame_label_tests.rs b/crates/ui-egui/src/frame_label_tests.rs index 38ebef0a1..d7f2371ab 100644 --- a/crates/ui-egui/src/frame_label_tests.rs +++ b/crates/ui-egui/src/frame_label_tests.rs @@ -79,3 +79,58 @@ fn pressing_a_rotated_label_selects_and_drags_the_frame() { assert!(after.x0 > before.x0 + 1.0 && after.y0 > before.y0 + 1.0, "{before:?} → {after:?}"); assert_eq!(u.app.session.ds().unwrap().history.undo.len(), undo + 1); } + +fn key(k: egui::Key) -> Vec { + vec![ + Event::Key { key: k, physical_key: None, pressed: true, repeat: false, modifiers: Default::default() }, + Event::Key { key: k, physical_key: None, pressed: false, repeat: false, modifiers: Default::default() }, + ] +} + +/// Double-click `f`'s label and wait for the field to take the keyboard. +fn double_click_label(u: &mut Ui, f: NodeId) { + let at = mid(&label(u, f)); + for _ in 0..2 { + u.button(at, true); + u.button(at, false); + } + u.frame(vec![]); + u.frame(vec![]); +} + +fn name(u: &Ui, f: NodeId) -> String { + u.app.session.doc().unwrap().node(f).unwrap().name.clone() +} + +#[test] +fn double_clicking_a_label_renames_the_frame_there() { + let (mut u, a, b) = setup(); + let before = u.app.session.doc().unwrap().world_bounds(a).unwrap(); + double_click_label(&mut u, a); + assert_eq!(u.app.session.selection(), vec![a]); + assert_eq!(u.app.ui.rename_label.map(|r| r.0), Some(a), "a field over the label"); + // The name starts selected: typing replaces it, Enter keeps it. + u.frame(vec![Event::Text("Sign in".into())]); + u.frame(key(egui::Key::Enter)); + u.frame(vec![]); + assert_eq!(name(&u, a), "Sign in"); + assert!(u.app.ui.rename_label.is_none()); + // The double-click didn't move the frame or rename the other one. + assert_eq!(u.app.session.doc().unwrap().world_bounds(a).unwrap(), before); + assert_eq!(name(&u, b), "Turned"); + // One undo step puts the old name back. + u.app.session.undo().unwrap(); + assert_eq!(name(&u, a), "Upright"); +} + +#[test] +fn escape_leaves_a_label_rename_with_the_old_name() { + let (mut u, _, b) = setup(); + double_click_label(&mut u, b); + assert_eq!(u.app.ui.rename_label.map(|r| r.0), Some(b), "rotated labels rename too"); + u.frame(vec![Event::Text("Nope".into())]); + u.frame(key(egui::Key::Escape)); + u.frame(vec![]); + assert_eq!(name(&u, b), "Turned"); + assert!(u.app.ui.rename_label.is_none()); +} diff --git a/crates/ui-egui/src/frame_labels.rs b/crates/ui-egui/src/frame_labels.rs index 2718fddd1..43dd712db 100644 --- a/crates/ui-egui/src/frame_labels.rs +++ b/crates/ui-egui/src/frame_labels.rs @@ -151,6 +151,37 @@ pub fn draw(app: &FigApp, painter: &Painter, t: &Tokens, doc: &Document, id: Nod Some([area.left_top(), area.right_top(), area.right_bottom(), area.left_bottom()].map(|p| tl + rot * (p - tl))) } +/// Rename `id`'s name label on the canvas: a field over the label from the next frame on. +pub fn start_rename(app: &mut FigApp, id: NodeId) { + // The field takes the focus once it's drawn (as the pages list does). + app.ui.rename_label = Some((id, true)); +} + +/// The field over a label being renamed (see [`start_rename`]): Enter or a click elsewhere +/// renames the layer, Escape keeps the name. +pub fn rename_field(app: &mut FigApp, ui: &mut egui::Ui) { + let Some((id, start)) = app.ui.rename_label else { return }; + let quad = app.session.tool.labels.iter().find(|(i, _)| *i == id).map(|(_, q)| q.map(|p| app.to_screen(p.x, p.y))); + let name = app.session.doc().ok().and_then(|d| d.node(id)).map(|n| n.name.clone()); + let (Some(quad), Some(name)) = (quad, name) else { + app.ui.rename_label = None; + return; + }; + let area = Rect::from_points(&quad); + let font = regular(11.0); + let text_w = ui.painter().layout_no_wrap(name.clone(), font.clone(), Color32::WHITE).size().x; + let rect = Rect::from_min_size(pos2(area.min.x, area.max.y - 16.0), vec2((text_w + 24.0).max(area.width()).clamp(80.0, 480.0), 16.0)); + let (done, open) = crate::widgets::rename_field(ui, egui::Id::new(("frame_label_rename", id)), &name, rect, font, start); + if let Some(new) = done { + app.ui.rename_label = None; + app.run("object.rename", serde_json::json!({"ids": [id], "name": new})); + } else if !open && !start { + app.ui.rename_label = None; + } else { + app.ui.rename_label = Some((id, false)); + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index e6a14ede4..6141b3dd8 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -430,6 +430,9 @@ pub struct UiState { /// The layer being renamed in the layers panel. pub rename: Option, pub rename_page: Option<(NodeId, String)>, + /// The frame or section whose name label on the canvas is being renamed (a double-click on + /// it), and whether the rename just started (its field takes the keyboard when next drawn). + pub rename_label: Option<(NodeId, bool)>, pub main_menu: bool, pub palette: Option, /// The Actions palette's tab. @@ -587,6 +590,7 @@ impl Default for UiState { expanded: BTreeSet::new(), rename: None, rename_page: None, + rename_label: None, main_menu: false, palette: None, palette_tab: menus::PaletteTab::All, @@ -961,6 +965,11 @@ impl FigApp { "layers.collapseAll" => layers::collapse_all(self), "contextMenu" => self.ui.key_menu = true, "selectArea" => self.start_key_box(), + "canvas.renameLabel" => { + if let Some(id) = r.data.get("id").and_then(figcraft_engine::params::id_of) { + frame_labels::start_rename(self, id); + } + } "layers.rename" => { let ids: Vec = r.data.get("ids").and_then(Value::as_array).into_iter().flatten().filter_map(figcraft_engine::params::id_of).collect(); diff --git a/docs/roadmap.md b/docs/roadmap.md index 8d63a4692..b89f18423 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -73,6 +73,7 @@ blockers. | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | M1: double-clicking a frame's or section's name on the canvas renames it in place (#757; Enter commits, Escape cancels, one undo step). Numbers unchanged | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 0cccf008c..d2b3c9e2a 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-10-17 · **Change:** minor (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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (renaming a frame or section from its name on the canvas (#757); 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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **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: @@ -98,7 +98,7 @@ interaction feel not yet compared. |---|---|---| | Pan/zoom: wheel, pinch, Space-drag, Shift+0/1/2, Cmd+0, `+`/`-` | done | Shift-wheel pans sideways, pinch and the zoom tool keep the point under the pointer; zoom steps, limits (2%–25,600%) and frame order pinned where the documentation is silent (`view_behaviour_tests`) | | Rulers and guides (drag out, move, remove; rotated frames; frame guides) | done | guides belong to the page or a top-level frame (a frame moved into another keeps its guides but they stop applying); a click selects one for Delete, the arrows or the context menu's Remove guide; Alt-drag drops a copy; Alt while dragging measures to the layers in the frame it crosses; ruler numbering checked by eye only | -| Frame labels (rotated, right-to-left), size badge | done | | +| Frame labels (rotated, right-to-left), size badge | done | double-click a frame's or section's name to rename it in place: Enter or a click elsewhere keeps the name, Escape restores it, one undo step (#757, `frame_label_tests`) | | Outline mode | done | Outlines, outlines for the selection, mask outlines, frame outlines; shapes are clicked on their outlines, reaching layers behind; View ▸ Outlines ▸ Include hidden layers (`view.outlinesHiddenLayers`) outlines hidden layers too and Include object bounds (`view.outlinesObjectBounds`) draws the box of every layer whose outline isn't its box (groups, text, ellipses, vectors); what either draws can be clicked there (a hidden layer on its outline, a group on its box) and nothing else can; both are view settings like the other outline flags (per file, off in a new one, checked in the menu); the lines are light on a dark page (`outline_options_tests`). The main menu now shows a check mark beside every View toggle that is on | | Slices shown on the canvas (View ▸ Slices) | done | dashed rectangles | | Dragging a layer inside a group keeps it in the group | done | frames and auto layout take other drops | @@ -172,6 +172,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Frame and section names on the canvas rename on a double-click (#757): a field over the label with the name selected; Enter or a click elsewhere commits (`object.rename`, one undo step), Escape cancels. Rotated labels too. Not compared side by side with Figma | | 2026-10-17 | minor | The community batches #733, #735, #736, #729 and #753: submenus open after a short hover, keep their place along a safe triangle and reopen closed (main and context menus); the Actions palette's tabs, ranked search, keyboard highlight and recents; menu items that need a value ask for it, File ▸ Rename edits in place; Shift+I and Resources open Assets; a draggable Pages/Layers divider; Shift-drag moves the selection; a double-click near a thin stroke, merging dropped points and Flatten keeping open paths in vector editing; live font preview and the selection highlight after line breaks; the colour picker on a new fill or stroke; Paste over and Paste properties from the keyboard; Selection colors (partial: no library styles or variables there) and smart-selection spacing fields and canvas handles (partial: no reorder rings), both also checked by their author on macOS; the keyboard shortcuts panel closes on the home screen; Adwaita window controls on Wayland compositors without server decorations (checked by its author on GNOME; KDE not run). Checked in the app on Windows (submenus by their author), not side by side with Figma. Summary and hours unchanged | | 2026-10-15 | minor | Hex fields take CSS colour names (`red` → `FF0000`): fills, strokes, effects, grids, variables, backgrounds and the colour picker | | 2026-10-15 | minor | Typography: drag the line-height, letter-spacing and paragraph-spacing icons to scrub their values; shared numeric-field rates, resize cursor and one Undo step per gesture (#373). | From 0a01188c31da237cf1ecd548b994c375c10fe757 Mon Sep 17 00:00:00 2001 From: BFlat Date: Sat, 17 Oct 2026 22:38:10 +0700 Subject: [PATCH 194/817] M7: translate the .fig import notes (#761) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The import report translates an importer note when the catalog has it, but 30 notes added by the `.fig` import series (#626–#639) had no catalog entries, so they showed in English: connector labels and snapshots, grid track sizing, image filters, slots and their content, vector segment styles, and text on a path. - All 30 are now in `en.toml` and in every full catalog: es, de, fr, pt-BR, ru, ja, ko, zh-Hans, cs, id, sv and tr (30 each). `es-419` overrides only the 3 notes about settings (configuración rather than Spain's ajustes), as the overlay does elsewhere. The wording follows each catalog's existing terms for connector, layer, frame, stroke, grid, slot and text on path. The translations are drafts, like the catalogs, and wait for native speakers' review. - `every_key_in_the_code_is_in_the_english_catalog_and_no_other` now counts each importer note (the `warn("…")` literals in `crates/format/src/fig` and `crates/format/src/rest`) as a required key, not only as an allowed one. A new note that isn't in `en.toml` fails the check, and because Spanish is in `COMPLETE` it has to be translated there too, so the report can't fall behind again. `docs/translating.md` says so. - The importers' texts are unchanged. Notes built with `format!` (layer counts, type names, field names) still show in English, since the report matches whole notes. --- crates/ui-egui/locales/cs.toml | 30 +++++++++++++++++++++++++++++ crates/ui-egui/locales/de.toml | 30 +++++++++++++++++++++++++++++ crates/ui-egui/locales/en.toml | 30 +++++++++++++++++++++++++++++ crates/ui-egui/locales/es-419.toml | 3 +++ crates/ui-egui/locales/es.toml | 30 +++++++++++++++++++++++++++++ crates/ui-egui/locales/fr.toml | 30 +++++++++++++++++++++++++++++ crates/ui-egui/locales/id.toml | 30 +++++++++++++++++++++++++++++ crates/ui-egui/locales/ja.toml | 30 +++++++++++++++++++++++++++++ crates/ui-egui/locales/ko.toml | 30 +++++++++++++++++++++++++++++ crates/ui-egui/locales/pt-BR.toml | 30 +++++++++++++++++++++++++++++ crates/ui-egui/locales/ru.toml | 30 +++++++++++++++++++++++++++++ crates/ui-egui/locales/sv.toml | 30 +++++++++++++++++++++++++++++ crates/ui-egui/locales/tr.toml | 30 +++++++++++++++++++++++++++++ crates/ui-egui/locales/zh-Hans.toml | 30 +++++++++++++++++++++++++++++ crates/ui-egui/src/i18n_tests.rs | 10 +++++----- docs/translating.md | 4 ++++ 16 files changed, 402 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml index 48deda39a..7121548d0 100644 --- a/crates/ui-egui/locales/cs.toml +++ b/crates/ui-egui/locales/cs.toml @@ -1508,13 +1508,25 @@ status = "draft — needs native review" "can edit the document" = "může upravovat dokument" "conditional prototype actions nested too deeply were skipped" = "podmíněné akce prototypu vnořené příliš hluboko byly přeskočeny" "conditional prototype actions with conditions that can't be evaluated were skipped" = "podmíněné akce prototypu s podmínkami, které nelze vyhodnotit, byly přeskočeny" +"connector label background was skipped: style data is missing" = "pozadí popisku spojnice bylo přeskočeno: chybí data stylu" +"connector label was skipped: background bounds are invalid" = "popisek spojnice byl přeskočen: hranice pozadí jsou neplatné" +"connector label was skipped: background transform is invalid" = "popisek spojnice byl přeskočen: transformace pozadí je neplatná" +"connector label was skipped: composed text transform is invalid" = "popisek spojnice byl přeskočen: složená transformace textu je neplatná" +"connector label was skipped: derived background bounds are missing" = "popisek spojnice byl přeskočen: chybí odvozené hranice pozadí" +"connector label was skipped: derived text bounds are missing" = "popisek spojnice byl přeskočen: chybí odvozené hranice textu" +"connector label was skipped: text bounds are invalid" = "popisek spojnice byl přeskočen: hranice textu jsou neplatné" +"connector label was skipped: text style data is missing" = "popisek spojnice byl přeskočen: chybí data stylu textu" +"connector label was skipped: text transform is invalid" = "popisek spojnice byl přeskočen: transformace textu je neplatná" "connector labels were skipped" = "popisky spojnic byly přeskočeny" +"connector layers import as static frame/vector snapshots with labels when present; live endpoint bindings are not retained" = "vrstvy spojnic se importují jako statické snímky rámců nebo vektorů, s popisky, pokud existují; živé vazby koncových bodů se nezachovávají" +"connector snapshot vector data is missing; connector was left empty" = "chybí vektorová data snímku spojnice; spojnice zůstala prázdná" "connectors whose ends can't be placed are empty" = "spojnice, jejichž konce nelze umístit, jsou prázdné" "crop marks" = "ořezové značky" "damaged vector geometry was skipped" = "poškozená vektorová geometrie byla přeskočena" "damaged vector networks import as outlines" = "poškozené vektorové sítě se importují jako obrysy" "development: {path}" = "vývoj: {path}" "document children other than pages were skipped" = "potomci dokumentu, kteří nejsou stránkami, byli přeskočeni" +"duplicate grid track sizing entries use equal tracks" = "duplicitní položky velikosti stop mřížky používají stejně velké stopy" "e.g. count + 1" = "např. count + 1" "e.g. count >= 3 and not done" = "např. count >= 3 and not done" "elbowed and curved connectors without a saved path import as straight lines" = "lomené a zakřivené spojnice bez uložené cesty se importují jako přímky" @@ -1523,14 +1535,20 @@ status = "draft — needs native review" "filled areas of a vector with their own fill use the layer's fill" = "vyplněné oblasti vektoru s vlastní výplní používají výplň vrstvy" "from {server}" = "ze serveru {server}" "gamepad triggers without exactly one known controller button were skipped" = "spouštěče herního ovladače bez právě jednoho známého tlačítka ovladače byly přeskočeny" +"grid track list exceeds 1000 entries; the tracks use the default equal sizing" = "seznam stop mřížky přesahuje 1000 položek; stopy používají výchozí stejnou velikost" +"grid track sizing is unsupported or malformed; affected tracks use equal sizing" = "velikost stop mřížky není podporována nebo je poškozená; dotčené stopy mají stejnou velikost" +"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "seznam velikostí stop mřížky přesahuje 1000 položek; stopy používají výchozí stejnou velikost" "hidden" = "skryté" "iOS" = "iOS" +"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "filtry obrázku jsou nejednoznačné, protože jsou přítomny oba kontejnery filtrů; převod filtrů byl přeskočen" +"image filters use FigCraft's approximate renderer" = "filtry obrázku používají přibližné vykreslování FigCraftu" "instance swap properties whose default component isn't in the file were skipped" = "vlastnosti výměny instance, jejichž výchozí komponenta není v souboru, byly přeskočeny" "instances inside their own main component were imported as frames" = "instance uvnitř vlastní hlavní komponenty byly importovány jako rámce" "instances of components that aren't in the file show no layers" = "instance komponent, které nejsou v souboru, nezobrazují žádné vrstvy" "instances of components that aren't in the file were imported as frames" = "instance komponent, které nejsou v souboru, byly importovány jako rámce" "instances that would nest a component inside itself were imported as frames" = "instance, které by vnořily komponentu samu do sebe, byly importovány jako rámce" "instances without a main component were imported as empty frames" = "instance bez hlavní komponenty byly importovány jako prázdné rámce" +"invalid internal .fig text path data was ignored" = "neplatná interní data textu na cestě ze souboru .fig byla ignorována" "invalid or oversized vector networks import as outlines" = "neplatné nebo příliš velké vektorové sítě se importují jako obrysy" "invalid or oversized vector path data was skipped" = "neplatná nebo příliš velká data vektorových cest byla přeskočena" "just now" = "právě teď" @@ -1538,12 +1556,18 @@ status = "draft — needs native review" "key up triggers import as key presses" = "spouštěče uvolnění klávesy se importují jako stisky klávesy" "layers without a position were placed at their parent's origin" = "vrstvy bez pozice byly umístěny do počátku nadřazeného prvku" "layers without a type were skipped" = "vrstvy bez typu byly přeskočeny" +"legacy image filter container is unsupported; filter conversion was skipped" = "starší kontejner filtrů obrázku není podporován; převod filtrů byl přeskočen" "locked" = "zamknuté" +"malformed image filters container was skipped" = "poškozený kontejner filtrů obrázku byl přeskočen" +"malformed image paintFilter container was skipped" = "poškozený kontejner paintFilter obrázku byl přeskočen" +"malformed slot content assignment was skipped" = "poškozené přiřazení obsahu slotu bylo přeskočeno" "no bleed" = "bez spadávky" "nobody else here yet" = "zatím tu není nikdo další" +"non-default slot settings are not represented and were skipped" = "jiná než výchozí nastavení slotů nelze znázornit a byla přeskočena" "now" = "nyní" "or" = "nebo" "point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "spojení tahu v bodech byla zachována; přerušované tahy a tahy s proměnnou šířkou se kreslí se spojením vrstvy" +"preferred slot component keys cannot be resolved to file nodes and were skipped" = "klíče preferovaných komponent slotů nelze přiřadit k vrstvám souboru, byly přeskočeny" "prototype actions of unknown types were skipped" = "akce prototypu neznámých typů byly přeskočeny" "prototype actions without a destination in the file were skipped" = "akce prototypu bez cíle v souboru byly přeskočeny" "prototype expressions on variables that aren't in the variables JSON were skipped" = "výrazy prototypu s proměnnými, které nejsou v JSON proměnných, byly přeskočeny" @@ -1561,8 +1585,14 @@ status = "draft — needs native review" "set-variable actions with values that don't fit the variable were skipped" = "akce nastavení proměnné s hodnotami, které neodpovídají proměnné, byly přeskočeny" "set-variable actions without a value were skipped" = "akce nastavení proměnné bez hodnoty byly přeskočeny" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "akce nastavení režimu proměnných u kolekcí nebo režimů, které nejsou v JSON proměnných, byly přeskočeny" +"slot content assignment target is missing or is not slot content" = "cíl přiřazení obsahu slotu chybí nebo není obsahem slotu" +"slot content assignment uses the empty GUID sentinel and was skipped" = "přiřazení obsahu slotu používá prázdné GUID jako zarážku a bylo přeskočeno" "some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "některé vektorové body odkazují na nastavení bodů, která v souboru chybí; používají spojení vrstvy a nezaoblené rohy" +"some vector segments refer to style settings missing from the file; they use the layer's stroke" = "některé vektorové segmenty odkazují na nastavení stylu, která v souboru chybí; používají tah vrstvy" +"stale or invalid grid track sizing entries were ignored" = "zastaralé nebo neplatné položky velikosti stop mřížky byly ignorovány" "stars and polygons without point counts or geometry use the default point count" = "hvězdy a mnohoúhelníky bez počtu bodů nebo geometrie používají výchozí počet bodů" +"style settings of some vector segments aren't supported; those segments use the layer's stroke" = "nastavení stylu některých vektorových segmentů nejsou podporována; tyto segmenty používají tah vrstvy" +"text path underline or strikethrough decoration is not rendered" = "podtržení ani přeškrtnutí textu na cestě se nevykresluje" "text style overrides refer to missing table entries" = "přepsání textových stylů odkazují na chybějící položky tabulky" "the file has no pages" = "soubor nemá žádné stránky" "the plugin" = "plugin" diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index 2e0ce5475..0362f897a 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -1458,13 +1458,25 @@ status = "draft — needs native review" "can edit the document" = "kann das Dokument bearbeiten" "conditional prototype actions nested too deeply were skipped" = "zu tief verschachtelte bedingte Prototyp-Aktionen wurden übersprungen" "conditional prototype actions with conditions that can't be evaluated were skipped" = "bedingte Prototyp-Aktionen mit nicht auswertbaren Bedingungen wurden übersprungen" +"connector label background was skipped: style data is missing" = "Hintergrund der Verbinderbeschriftung wurde übersprungen: Stildaten fehlen" +"connector label was skipped: background bounds are invalid" = "Verbinderbeschriftung wurde übersprungen: Grenzen des Hintergrunds sind ungültig" +"connector label was skipped: background transform is invalid" = "Verbinderbeschriftung wurde übersprungen: Transformation des Hintergrunds ist ungültig" +"connector label was skipped: composed text transform is invalid" = "Verbinderbeschriftung wurde übersprungen: zusammengesetzte Texttransformation ist ungültig" +"connector label was skipped: derived background bounds are missing" = "Verbinderbeschriftung wurde übersprungen: abgeleitete Grenzen des Hintergrunds fehlen" +"connector label was skipped: derived text bounds are missing" = "Verbinderbeschriftung wurde übersprungen: abgeleitete Textgrenzen fehlen" +"connector label was skipped: text bounds are invalid" = "Verbinderbeschriftung wurde übersprungen: Textgrenzen sind ungültig" +"connector label was skipped: text style data is missing" = "Verbinderbeschriftung wurde übersprungen: Textstildaten fehlen" +"connector label was skipped: text transform is invalid" = "Verbinderbeschriftung wurde übersprungen: Texttransformation ist ungültig" "connector labels were skipped" = "Verbinderbeschriftungen wurden übersprungen" +"connector layers import as static frame/vector snapshots with labels when present; live endpoint bindings are not retained" = "Verbinderebenen werden als statische Rahmen- oder Vektor-Momentaufnahmen importiert, mit Beschriftungen, sofern vorhanden; dynamische Bindungen der Endpunkte bleiben nicht erhalten" +"connector snapshot vector data is missing; connector was left empty" = "Vektordaten der Verbinder-Momentaufnahme fehlen; der Verbinder bleibt leer" "connectors whose ends can't be placed are empty" = "Verbinder, deren Enden sich nicht platzieren lassen, sind leer" "crop marks" = "Schnittmarken" "damaged vector geometry was skipped" = "beschädigte Vektorgeometrie wurde übersprungen" "damaged vector networks import as outlines" = "beschädigte Vektornetze werden als Umrisse importiert" "development: {path}" = "Entwicklung: {path}" "document children other than pages were skipped" = "Dokumentinhalte, die keine Seiten sind, wurden übersprungen" +"duplicate grid track sizing entries use equal tracks" = "doppelte Größeneinträge für Rasterspuren verwenden gleich große Spuren" "e.g. count + 1" = "z. B. count + 1" "e.g. count >= 3 and not done" = "z. B. count >= 3 and not done" "elbowed and curved connectors without a saved path import as straight lines" = "gewinkelte und gebogene Verbinder ohne gespeicherten Pfad werden als gerade Linien importiert" @@ -1473,26 +1485,38 @@ status = "draft — needs native review" "filled areas of a vector with their own fill use the layer's fill" = "gefüllte Bereiche eines Vektors mit eigener Füllung verwenden die Füllung der Ebene" "from {server}" = "von {server}" "gamepad triggers without exactly one known controller button were skipped" = "Gamepad-Auslöser ohne genau eine bekannte Controllertaste wurden übersprungen" +"grid track list exceeds 1000 entries; the tracks use the default equal sizing" = "die Liste der Rasterspuren hat mehr als 1000 Einträge; die Spuren verwenden die standardmäßige gleiche Größe" +"grid track sizing is unsupported or malformed; affected tracks use equal sizing" = "die Größe der Rasterspuren wird nicht unterstützt oder ist fehlerhaft; betroffene Spuren sind gleich groß" +"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "die Liste der Rasterspurgrößen hat mehr als 1000 Einträge; die Spuren verwenden die standardmäßige gleiche Größe" "hidden" = "ausgeblendet" "iOS" = "iOS" +"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "Bildfilter sind mehrdeutig, weil beide Filtercontainer vorhanden sind; die Filterumwandlung wurde übersprungen" +"image filters use FigCraft's approximate renderer" = "Bildfilter verwenden die näherungsweise Darstellung von FigCraft" "instance swap properties whose default component isn't in the file were skipped" = "Instanztausch-Eigenschaften, deren Standardkomponente nicht in der Datei ist, wurden übersprungen" "instances inside their own main component were imported as frames" = "Instanzen innerhalb ihrer eigenen Hauptkomponente wurden als Rahmen importiert" "instances of components that aren't in the file show no layers" = "Instanzen von Komponenten, die nicht in der Datei sind, zeigen keine Ebenen" "instances of components that aren't in the file were imported as frames" = "Instanzen von Komponenten, die nicht in der Datei sind, wurden als Rahmen importiert" "instances that would nest a component inside itself were imported as frames" = "Instanzen, die eine Komponente in sich selbst verschachteln würden, wurden als Rahmen importiert" "instances without a main component were imported as empty frames" = "Instanzen ohne Hauptkomponente wurden als leere Rahmen importiert" +"invalid internal .fig text path data was ignored" = "ungültige interne .fig-Daten für Text auf Pfad wurden ignoriert" "invalid or oversized vector networks import as outlines" = "ungültige oder zu große Vektornetze werden als Umrisse importiert" "invalid or oversized vector path data was skipped" = "ungültige oder zu große Vektorpfaddaten wurden übersprungen" "key triggers without a supported key were skipped" = "Tastenauslöser ohne unterstützte Taste wurden übersprungen" "key up triggers import as key presses" = "Auslöser beim Loslassen einer Taste werden als Tastendruck importiert" "layers without a position were placed at their parent's origin" = "Ebenen ohne Position wurden am Ursprung ihres übergeordneten Elements platziert" "layers without a type were skipped" = "Ebenen ohne Typ wurden übersprungen" +"legacy image filter container is unsupported; filter conversion was skipped" = "der veraltete Bildfiltercontainer wird nicht unterstützt; die Filterumwandlung wurde übersprungen" "locked" = "gesperrt" +"malformed image filters container was skipped" = "fehlerhafter Bildfiltercontainer wurde übersprungen" +"malformed image paintFilter container was skipped" = "fehlerhafter paintFilter-Container des Bildes wurde übersprungen" +"malformed slot content assignment was skipped" = "fehlerhafte Zuweisung von Slot-Inhalt wurde übersprungen" "no bleed" = "kein Anschnitt" "nobody else here yet" = "noch niemand sonst hier" +"non-default slot settings are not represented and were skipped" = "vom Standard abweichende Slot-Einstellungen werden nicht abgebildet und wurden übersprungen" "now" = "jetzt" "or" = "oder" "point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "die Konturecken der Punkte wurden übernommen; gestrichelte Konturen und Konturen mit variabler Breite werden mit der Ecke der Ebene gezeichnet" +"preferred slot component keys cannot be resolved to file nodes and were skipped" = "bevorzugte Komponentenschlüssel von Slots lassen sich keinen Ebenen der Datei zuordnen und wurden übersprungen" "prototype actions of unknown types were skipped" = "Prototyp-Aktionen unbekannter Art wurden übersprungen" "prototype actions without a destination in the file were skipped" = "Prototyp-Aktionen ohne Ziel in der Datei wurden übersprungen" "prototype expressions on variables that aren't in the variables JSON were skipped" = "Prototyp-Ausdrücke mit Variablen, die nicht im Variablen-JSON sind, wurden übersprungen" @@ -1510,8 +1534,14 @@ status = "draft — needs native review" "set-variable actions with values that don't fit the variable were skipped" = "Aktionen „Variable festlegen“ mit Werten, die nicht zur Variable passen, wurden übersprungen" "set-variable actions without a value were skipped" = "Aktionen „Variable festlegen“ ohne Wert wurden übersprungen" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "Aktionen „Variablenmodus festlegen“ für Sammlungen oder Modi, die nicht im Variablen-JSON sind, wurden übersprungen" +"slot content assignment target is missing or is not slot content" = "das Ziel der Slot-Inhaltszuweisung fehlt oder ist kein Slot-Inhalt" +"slot content assignment uses the empty GUID sentinel and was skipped" = "die Slot-Inhaltszuweisung verwendet die leere GUID als Platzhalterwert und wurde übersprungen" "some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "einige Vektorpunkte verweisen auf Punkteinstellungen, die in der Datei fehlen; sie übernehmen die Ecken der Ebenenkontur und bleiben ungerundet" +"some vector segments refer to style settings missing from the file; they use the layer's stroke" = "einige Vektorsegmente verweisen auf Stileinstellungen, die in der Datei fehlen; sie verwenden die Kontur der Ebene" +"stale or invalid grid track sizing entries were ignored" = "veraltete oder ungültige Größeneinträge für Rasterspuren wurden ignoriert" "stars and polygons without point counts or geometry use the default point count" = "Sterne und Polygone ohne Punktanzahl oder Geometrie verwenden die Standard-Punktanzahl" +"style settings of some vector segments aren't supported; those segments use the layer's stroke" = "Stileinstellungen einiger Vektorsegmente werden nicht unterstützt; diese Segmente verwenden die Kontur der Ebene" +"text path underline or strikethrough decoration is not rendered" = "Unter- oder Durchstreichung von Text auf Pfad wird nicht dargestellt" "text style overrides refer to missing table entries" = "Textstil-Überschreibungen verweisen auf fehlende Tabelleneinträge" "the file has no pages" = "die Datei hat keine Seiten" "the plugin" = "das Plugin" diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 524ebc473..59b25d949 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -1536,13 +1536,25 @@ name = "English" "can edit the document" = "can edit the document" "conditional prototype actions nested too deeply were skipped" = "conditional prototype actions nested too deeply were skipped" "conditional prototype actions with conditions that can't be evaluated 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 background was skipped: style data is missing" +"connector label was skipped: background bounds are invalid" = "connector label was skipped: background bounds are invalid" +"connector label was skipped: background transform is invalid" = "connector label was skipped: background transform is invalid" +"connector label was skipped: composed text 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 background bounds are missing" +"connector label was skipped: derived text 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 bounds are invalid" +"connector label was skipped: text style data is missing" = "connector label was skipped: text style data is missing" +"connector label was skipped: text transform is invalid" = "connector label was skipped: text transform is invalid" "connector labels were skipped" = "connector labels were skipped" +"connector layers import as static frame/vector snapshots with labels when present; live endpoint bindings are not retained" = "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" = "connector snapshot vector data is missing; connector was left empty" "connectors whose ends can't be placed are empty" = "connectors whose ends can't be placed are empty" "crop marks" = "crop marks" "damaged vector geometry was skipped" = "damaged vector geometry was skipped" "damaged vector networks import as outlines" = "damaged vector networks import as outlines" "development: {path}" = "development: {path}" "document children other than pages were skipped" = "document children other than pages were skipped" +"duplicate grid track sizing entries use equal tracks" = "duplicate grid track sizing entries use equal tracks" "e.g. count + 1" = "e.g. count + 1" "e.g. count >= 3 and not done" = "e.g. count >= 3 and not done" "elbowed and curved connectors without a saved path import as straight lines" = "elbowed and curved connectors without a saved path import as straight lines" @@ -1551,14 +1563,20 @@ name = "English" "filled areas of a vector with their own fill use the layer's fill" = "filled areas of a vector with their own fill use the layer's fill" "from {server}" = "from {server}" "gamepad triggers without exactly one known controller button were skipped" = "gamepad triggers without exactly one known controller button were skipped" +"grid track list exceeds 1000 entries; the tracks use the default equal sizing" = "grid track list exceeds 1000 entries; the tracks use the default equal sizing" +"grid track sizing is unsupported or malformed; affected tracks use equal sizing" = "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" = "grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" "hidden" = "hidden" "iOS" = "iOS" +"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "image filters are ambiguous because both filter containers are present; filter conversion was skipped" +"image filters use FigCraft's approximate renderer" = "image filters use FigCraft's approximate renderer" "instance swap properties whose default component isn't in the file were skipped" = "instance swap properties whose default component isn't in the file were skipped" "instances inside their own main component were imported as frames" = "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 show no layers" "instances of components that aren't in the file were imported as frames" = "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 that would nest a component inside itself were imported as frames" "instances without a main component were imported as empty frames" = "instances without a main component were imported as empty frames" +"invalid internal .fig text path data was ignored" = "invalid internal .fig text path data was ignored" "invalid or oversized vector networks import as outlines" = "invalid or oversized vector networks import as outlines" "invalid or oversized vector path data was skipped" = "invalid or oversized vector path data was skipped" "just now" = "just now" @@ -1566,12 +1584,18 @@ name = "English" "key up triggers import as key presses" = "key up triggers import as key presses" "layers without a position were placed at their parent's origin" = "layers without a position were placed at their parent's origin" "layers without a type were skipped" = "layers without a type were skipped" +"legacy image filter container is unsupported; filter conversion was skipped" = "legacy image filter container is unsupported; filter conversion was skipped" "locked" = "locked" +"malformed image filters container was skipped" = "malformed image filters container was skipped" +"malformed image paintFilter container was skipped" = "malformed image paintFilter container was skipped" +"malformed slot content assignment was skipped" = "malformed slot content assignment was skipped" "no bleed" = "no bleed" "nobody else here yet" = "nobody else here yet" +"non-default slot settings are not represented and were skipped" = "non-default slot settings are not represented and were skipped" "now" = "now" "or" = "or" "point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "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" = "preferred slot component keys cannot be resolved to file nodes and were skipped" "prototype actions of unknown types were skipped" = "prototype actions of unknown types were skipped" "prototype actions without a destination in the file 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" = "prototype expressions on variables that aren't in the variables JSON were skipped" @@ -1589,8 +1613,14 @@ name = "English" "set-variable actions with values that don't fit the variable 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 actions without a value were skipped" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" +"slot content assignment target is missing or is not slot content" = "slot content assignment target is missing or is not slot content" +"slot content assignment uses the empty GUID sentinel and was skipped" = "slot content assignment uses the empty GUID sentinel and was skipped" "some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "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" = "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" = "stale or invalid grid track sizing entries were ignored" "stars and polygons without point counts or geometry use the default point count" = "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" = "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 path underline or strikethrough decoration is not rendered" "text style overrides refer to missing table entries" = "text style overrides refer to missing table entries" "the file has no pages" = "the file has no pages" "the plugin" = "the plugin" diff --git a/crates/ui-egui/locales/es-419.toml b/crates/ui-egui/locales/es-419.toml index 74ce97a82..7756fba74 100644 --- a/crates/ui-egui/locales/es-419.toml +++ b/crates/ui-egui/locales/es-419.toml @@ -83,6 +83,9 @@ status = "draft — needs native review" "You'll get the shared file as a new tab and edit it together." = "Recibirás el archivo compartido en una pestaña nueva y lo editarán en conjunto." "gamepad triggers without exactly one known controller button were skipped" = "se omitieron los desencadenantes de control sin exactamente un botón de control conocido" "key up triggers import as key presses" = "los desencadenantes al soltar una tecla se importan como presiones de tecla" +"non-default slot settings are not represented and were skipped" = "la configuración de ranura no predeterminada no se representa y se omitió" +"some vector segments refer to style settings missing from the file; they use the layer's stroke" = "algunos segmentos vectoriales hacen referencia a configuraciones de estilo que faltan en el archivo; usan el trazo de la capa" +"style settings of some vector segments aren't supported; those segments use the layer's stroke" = "la configuración de estilo de algunos segmentos vectoriales no es compatible; esos segmentos usan el trazo de la capa" "{name} is forgotten on this computer; the file stays on {server}" = "{name} se olvidó en esta computadora; el archivo se queda en {server}" "{n} added" = { one = "{n} agregada", other = "{n} agregadas" } diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 872a3ab76..01c5813bd 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -1537,13 +1537,25 @@ status = "draft — needs native review" "can edit the document" = "puede editar el documento" "conditional prototype actions nested too deeply were skipped" = "se omitieron las acciones condicionales de prototipo anidadas a demasiada profundidad" "conditional prototype actions with conditions that can't be evaluated were skipped" = "se omitieron las acciones condicionales de prototipo con condiciones que no se pueden evaluar" +"connector label background was skipped: style data is missing" = "se omitió el fondo de la etiqueta del conector: faltan los datos de estilo" +"connector label was skipped: background bounds are invalid" = "se omitió la etiqueta del conector: los límites del fondo no son válidos" +"connector label was skipped: background transform is invalid" = "se omitió la etiqueta del conector: la transformación del fondo no es válida" +"connector label was skipped: composed text transform is invalid" = "se omitió la etiqueta del conector: la transformación compuesta del texto no es válida" +"connector label was skipped: derived background bounds are missing" = "se omitió la etiqueta del conector: faltan los límites derivados del fondo" +"connector label was skipped: derived text bounds are missing" = "se omitió la etiqueta del conector: faltan los límites derivados del texto" +"connector label was skipped: text bounds are invalid" = "se omitió la etiqueta del conector: los límites del texto no son válidos" +"connector label was skipped: text style data is missing" = "se omitió la etiqueta del conector: faltan los datos del estilo de texto" +"connector label was skipped: text transform is invalid" = "se omitió la etiqueta del conector: la transformación del texto no es válida" "connector labels were skipped" = "se omitieron las etiquetas de los conectores" +"connector layers import as static frame/vector snapshots with labels when present; live endpoint bindings are not retained" = "las capas de conector se importan como instantáneas estáticas de marco o vector, con sus etiquetas si las hay; no se conservan los vínculos dinámicos de los extremos" +"connector snapshot vector data is missing; connector was left empty" = "faltan los datos vectoriales de la instantánea del conector; el conector quedó vacío" "connectors whose ends can't be placed are empty" = "los conectores cuyos extremos no se pueden colocar están vacíos" "crop marks" = "marcas de corte" "damaged vector geometry was skipped" = "se omitió la geometría vectorial dañada" "damaged vector networks import as outlines" = "las redes vectoriales dañadas se importan como contornos" "development: {path}" = "desarrollo: {path}" "document children other than pages were skipped" = "se omitieron los elementos del documento que no son páginas" +"duplicate grid track sizing entries use equal tracks" = "las entradas duplicadas de tamaño de pista de cuadrícula usan pistas iguales" "e.g. count + 1" = "p. ej. count + 1" "e.g. count >= 3 and not done" = "p. ej. count >= 3 and not done" "elbowed and curved connectors without a saved path import as straight lines" = "los conectores angulares y curvos sin trazado guardado se importan como líneas rectas" @@ -1552,14 +1564,20 @@ status = "draft — needs native review" "filled areas of a vector with their own fill use the layer's fill" = "las áreas rellenas de un vector con relleno propio usan el relleno de la capa" "from {server}" = "de {server}" "gamepad triggers without exactly one known controller button were skipped" = "se omitieron los desencadenantes de mando sin exactamente un botón de mando conocido" +"grid track list exceeds 1000 entries; the tracks use the default equal sizing" = "la lista de pistas de cuadrícula supera las 1000 entradas; las pistas usan el tamaño igual predeterminado" +"grid track sizing is unsupported or malformed; affected tracks use equal sizing" = "el tamaño de las pistas de cuadrícula no es compatible o está mal formado; las pistas afectadas usan tamaños iguales" +"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "la lista de tamaños de pista de cuadrícula supera las 1000 entradas; las pistas usan el tamaño igual predeterminado" "hidden" = "oculta" "iOS" = "iOS" +"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "los filtros de imagen son ambiguos porque están los dos contenedores de filtros; se omitió la conversión de filtros" +"image filters use FigCraft's approximate renderer" = "los filtros de imagen usan el renderizado aproximado de FigCraft" "instance swap properties whose default component isn't in the file were skipped" = "se omitieron las propiedades de intercambio de instancia cuyo componente predeterminado no está en el archivo" "instances inside their own main component were imported as frames" = "las instancias dentro de su propio componente principal se importaron como marcos" "instances of components that aren't in the file show no layers" = "las instancias de componentes que no están en el archivo no muestran capas" "instances of components that aren't in the file were imported as frames" = "las instancias de componentes que no están en el archivo se importaron como marcos" "instances that would nest a component inside itself were imported as frames" = "las instancias que anidarían un componente dentro de sí mismo se importaron como marcos" "instances without a main component were imported as empty frames" = "las instancias sin componente principal se importaron como marcos vacíos" +"invalid internal .fig text path data was ignored" = "se ignoraron datos internos no válidos de texto en trazado del .fig" "invalid or oversized vector networks import as outlines" = "las redes vectoriales no válidas o demasiado grandes se importan como contornos" "invalid or oversized vector path data was skipped" = "se omitieron los datos de trazados vectoriales no válidos o demasiado grandes" "just now" = "justo ahora" @@ -1567,12 +1585,18 @@ status = "draft — needs native review" "key up triggers import as key presses" = "los desencadenantes al soltar una tecla se importan como pulsaciones de tecla" "layers without a position were placed at their parent's origin" = "las capas sin posición se colocaron en el origen de su elemento padre" "layers without a type were skipped" = "se omitieron las capas sin tipo" +"legacy image filter container is unsupported; filter conversion was skipped" = "el contenedor antiguo de filtros de imagen no es compatible; se omitió la conversión de filtros" "locked" = "bloqueada" +"malformed image filters container was skipped" = "se omitió el contenedor de filtros de imagen mal formado" +"malformed image paintFilter container was skipped" = "se omitió el contenedor paintFilter de imagen mal formado" +"malformed slot content assignment was skipped" = "se omitió una asignación de contenido de ranura mal formada" "no bleed" = "sin sangrado" "nobody else here yet" = "aún no hay nadie más" +"non-default slot settings are not represented and were skipped" = "los ajustes de ranura no predeterminados no se representan y se omitieron" "now" = "ahora" "or" = "o" "point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "se conservaron las uniones de trazo de los puntos; los trazos discontinuos o de ancho variable se dibujan con la unión de la capa" +"preferred slot component keys cannot be resolved to file nodes and were skipped" = "las claves de componentes preferidos de las ranuras no corresponden a capas del archivo y se omitieron" "prototype actions of unknown types were skipped" = "se omitieron las acciones de prototipo de tipos desconocidos" "prototype actions without a destination in the file were skipped" = "se omitieron las acciones de prototipo sin destino en el archivo" "prototype expressions on variables that aren't in the variables JSON were skipped" = "se omitieron las expresiones de prototipo con variables que no están en el JSON de variables" @@ -1590,8 +1614,14 @@ status = "draft — needs native review" "set-variable actions with values that don't fit the variable were skipped" = "se omitieron las acciones «Establecer variable» con valores que no encajan con la variable" "set-variable actions without a value were skipped" = "se omitieron las acciones «Establecer variable» sin valor" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "se omitieron las acciones «Establecer modo de variable» sobre colecciones o modos que no están en el JSON de variables" +"slot content assignment target is missing or is not slot content" = "el destino de la asignación de contenido de ranura falta o no es contenido de ranura" +"slot content assignment uses the empty GUID sentinel and was skipped" = "la asignación de contenido de ranura usa el GUID vacío como centinela y se omitió" "some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "algunos puntos vectoriales hacen referencia a ajustes de punto que faltan en el archivo; usan las uniones de la capa y esquinas simples" +"some vector segments refer to style settings missing from the file; they use the layer's stroke" = "algunos segmentos vectoriales hacen referencia a ajustes de estilo que faltan en el archivo; usan el trazo de la capa" +"stale or invalid grid track sizing entries were ignored" = "se ignoraron las entradas de tamaño de pista de cuadrícula obsoletas o no válidas" "stars and polygons without point counts or geometry use the default point count" = "las estrellas y los polígonos sin número de puntos ni geometría usan el número de puntos predeterminado" +"style settings of some vector segments aren't supported; those segments use the layer's stroke" = "los ajustes de estilo de algunos segmentos vectoriales no son compatibles; esos segmentos usan el trazo de la capa" +"text path underline or strikethrough decoration is not rendered" = "el subrayado o tachado del texto en trazado no se dibuja" "text style overrides refer to missing table entries" = "las anulaciones de estilo de texto hacen referencia a entradas de tabla que faltan" "the file has no pages" = "el archivo no tiene páginas" "the plugin" = "el plugin" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index e9afd7e5a..17a0d60bf 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -1449,13 +1449,25 @@ status = "draft — needs native review" "can edit the document" = "peut modifier le document" "conditional prototype actions nested too deeply were skipped" = "les actions de prototype conditionnelles trop profondément imbriquées ont été ignorées" "conditional prototype actions with conditions that can't be evaluated were skipped" = "les actions de prototype conditionnelles dont les conditions ne peuvent pas être évaluées ont été ignorées" +"connector label background was skipped: style data is missing" = "l’arrière-plan du libellé du connecteur a été ignoré : les données de style sont manquantes" +"connector label was skipped: background bounds are invalid" = "le libellé du connecteur a été ignoré : les limites de l’arrière-plan ne sont pas valides" +"connector label was skipped: background transform is invalid" = "le libellé du connecteur a été ignoré : la transformation de l’arrière-plan n’est pas valide" +"connector label was skipped: composed text transform is invalid" = "le libellé du connecteur a été ignoré : la transformation composée du texte n’est pas valide" +"connector label was skipped: derived background bounds are missing" = "le libellé du connecteur a été ignoré : les limites dérivées de l’arrière-plan sont manquantes" +"connector label was skipped: derived text bounds are missing" = "le libellé du connecteur a été ignoré : les limites dérivées du texte sont manquantes" +"connector label was skipped: text bounds are invalid" = "le libellé du connecteur a été ignoré : les limites du texte ne sont pas valides" +"connector label was skipped: text style data is missing" = "le libellé du connecteur a été ignoré : les données de style du texte sont manquantes" +"connector label was skipped: text transform is invalid" = "le libellé du connecteur a été ignoré : la transformation du texte n’est pas valide" "connector labels were skipped" = "les libellés des connecteurs ont été ignorés" +"connector layers import as static frame/vector snapshots with labels when present; live endpoint bindings are not retained" = "les calques de connecteur sont importés comme des instantanés statiques de cadre ou de vecteur, avec leurs libellés s’il y en a ; les liaisons dynamiques des extrémités ne sont pas conservées" +"connector snapshot vector data is missing; connector was left empty" = "les données vectorielles de l’instantané du connecteur sont manquantes ; le connecteur reste vide" "connectors whose ends can't be placed are empty" = "les connecteurs dont les extrémités ne peuvent pas être placées sont vides" "crop marks" = "traits de coupe" "damaged vector geometry was skipped" = "la géométrie vectorielle endommagée a été ignorée" "damaged vector networks import as outlines" = "les réseaux vectoriels endommagés sont importés comme tracés" "development: {path}" = "développement : {path}" "document children other than pages were skipped" = "les enfants du document autres que des pages ont été ignorés" +"duplicate grid track sizing entries use equal tracks" = "les entrées de dimensionnement de piste de grille en double utilisent des pistes égales" "e.g. count + 1" = "p. ex. count + 1" "e.g. count >= 3 and not done" = "p. ex. count >= 3 and not done" "elbowed and curved connectors without a saved path import as straight lines" = "les connecteurs coudés et courbes sans tracé enregistré sont importés comme des lignes droites" @@ -1464,26 +1476,38 @@ status = "draft — needs native review" "filled areas of a vector with their own fill use the layer's fill" = "les zones remplies d’un vecteur avec leur propre remplissage utilisent le remplissage du calque" "from {server}" = "depuis {server}" "gamepad triggers without exactly one known controller button were skipped" = "les déclencheurs de manette sans exactement un bouton de manette connu ont été ignorés" +"grid track list exceeds 1000 entries; the tracks use the default equal sizing" = "la liste des pistes de grille dépasse 1 000 entrées ; les pistes utilisent le dimensionnement égal par défaut" +"grid track sizing is unsupported or malformed; affected tracks use equal sizing" = "le dimensionnement des pistes de grille n’est pas pris en charge ou est mal formé ; les pistes concernées ont un dimensionnement égal" +"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "la liste de dimensionnement des pistes de grille dépasse 1 000 entrées ; les pistes utilisent le dimensionnement égal par défaut" "hidden" = "masqué" "iOS" = "iOS" +"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "les filtres d’image sont ambigus, car les deux conteneurs de filtres sont présents ; la conversion des filtres a été ignorée" +"image filters use FigCraft's approximate renderer" = "les filtres d’image utilisent le rendu approximatif de FigCraft" "instance swap properties whose default component isn't in the file were skipped" = "les propriétés de permutation d’instance dont le composant par défaut n’est pas dans le fichier ont été ignorées" "instances inside their own main component were imported as frames" = "les instances placées dans leur propre composant principal ont été importées comme cadres" "instances of components that aren't in the file show no layers" = "les instances de composants absents du fichier n’affichent aucun calque" "instances of components that aren't in the file were imported as frames" = "les instances de composants absents du fichier ont été importées comme cadres" "instances that would nest a component inside itself were imported as frames" = "les instances qui imbriqueraient un composant dans lui-même ont été importées comme cadres" "instances without a main component were imported as empty frames" = "les instances sans composant principal ont été importées comme cadres vides" +"invalid internal .fig text path data was ignored" = "les données internes non valides de texte sur tracé du .fig ont été ignorées" "invalid or oversized vector networks import as outlines" = "les réseaux vectoriels non valides ou trop grands sont importés comme tracés" "invalid or oversized vector path data was skipped" = "les données de tracé vectoriel non valides ou trop grandes ont été ignorées" "key triggers without a supported key were skipped" = "les déclencheurs de touche sans touche prise en charge ont été ignorés" "key up triggers import as key presses" = "les déclencheurs au relâchement d’une touche sont importés comme des appuis sur la touche" "layers without a position were placed at their parent's origin" = "les calques sans position ont été placés à l’origine de leur parent" "layers without a type were skipped" = "les calques sans type ont été ignorés" +"legacy image filter container is unsupported; filter conversion was skipped" = "l’ancien conteneur de filtres d’image n’est pas pris en charge ; la conversion des filtres a été ignorée" "locked" = "verrouillé" +"malformed image filters container was skipped" = "le conteneur de filtres d’image mal formé a été ignoré" +"malformed image paintFilter container was skipped" = "le conteneur paintFilter d’image mal formé a été ignoré" +"malformed slot content assignment was skipped" = "une affectation de contenu d’emplacement mal formée a été ignorée" "no bleed" = "sans fond perdu" "nobody else here yet" = "personne d’autre pour l’instant" +"non-default slot settings are not represented and were skipped" = "les réglages d’emplacement autres que ceux par défaut ne sont pas représentés et ont été ignorés" "now" = "maintenant" "or" = "ou" "point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "les jointures des points ont été conservées ; les contours en pointillés ou à largeur variable sont dessinés avec la jointure du calque" +"preferred slot component keys cannot be resolved to file nodes and were skipped" = "les clés de composants préférés des emplacements ne correspondent à aucun calque du fichier et ont été ignorées" "prototype actions of unknown types were skipped" = "les actions de prototype de types inconnus ont été ignorées" "prototype actions without a destination in the file were skipped" = "les actions de prototype sans destination dans le fichier ont été ignorées" "prototype expressions on variables that aren't in the variables JSON were skipped" = "les expressions de prototype portant sur des variables absentes du JSON des variables ont été ignorées" @@ -1501,8 +1525,14 @@ status = "draft — needs native review" "set-variable actions with values that don't fit the variable were skipped" = "les actions de définition de variable dont les valeurs ne correspondent pas à la variable ont été ignorées" "set-variable actions without a value were skipped" = "les actions de définition de variable sans valeur ont été ignorées" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "les actions de définition du mode de variable portant sur des collections ou des modes absents du JSON des variables ont été ignorées" +"slot content assignment target is missing or is not slot content" = "la cible de l’affectation de contenu d’emplacement est absente ou n’est pas un contenu d’emplacement" +"slot content assignment uses the empty GUID sentinel and was skipped" = "l’affectation de contenu d’emplacement utilise le GUID vide comme sentinelle et a été ignorée" "some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "certains points vectoriels renvoient à des réglages de point absents du fichier ; ils utilisent les jointures du calque et des angles simples" +"some vector segments refer to style settings missing from the file; they use the layer's stroke" = "certains segments vectoriels renvoient à des réglages de style absents du fichier ; ils utilisent le contour du calque" +"stale or invalid grid track sizing entries were ignored" = "les entrées de dimensionnement de piste de grille obsolètes ou non valides ont été ignorées" "stars and polygons without point counts or geometry use the default point count" = "les étoiles et polygones sans nombre de pointes ni géométrie utilisent le nombre de pointes par défaut" +"style settings of some vector segments aren't supported; those segments use the layer's stroke" = "les réglages de style de certains segments vectoriels ne sont pas pris en charge ; ces segments utilisent le contour du calque" +"text path underline or strikethrough decoration is not rendered" = "le soulignement ou le barré du texte sur tracé n’est pas affiché" "text style overrides refer to missing table entries" = "les remplacements de style de texte renvoient à des entrées de table manquantes" "the file has no pages" = "le fichier n’a aucune page" "the plugin" = "le plugin" diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml index a19c15873..a01944fde 100644 --- a/crates/ui-egui/locales/id.toml +++ b/crates/ui-egui/locales/id.toml @@ -1512,13 +1512,25 @@ status = "draft — needs native review" "can edit the document" = "dapat mengedit dokumen" "conditional prototype actions nested too deeply were skipped" = "tindakan prototype kondisional yang bersarang terlalu dalam dilewati" "conditional prototype actions with conditions that can't be evaluated were skipped" = "tindakan prototype kondisional dengan kondisi yang tidak dapat dievaluasi dilewati" +"connector label background was skipped: style data is missing" = "latar belakang label konektor dilewati: data gaya tidak ada" +"connector label was skipped: background bounds are invalid" = "label konektor dilewati: batas latar belakang tidak valid" +"connector label was skipped: background transform is invalid" = "label konektor dilewati: transformasi latar belakang tidak valid" +"connector label was skipped: composed text transform is invalid" = "label konektor dilewati: transformasi gabungan teks tidak valid" +"connector label was skipped: derived background bounds are missing" = "label konektor dilewati: batas turunan latar belakang tidak ada" +"connector label was skipped: derived text bounds are missing" = "label konektor dilewati: batas turunan teks tidak ada" +"connector label was skipped: text bounds are invalid" = "label konektor dilewati: batas teks tidak valid" +"connector label was skipped: text style data is missing" = "label konektor dilewati: data gaya teks tidak ada" +"connector label was skipped: text transform is invalid" = "label konektor dilewati: transformasi teks tidak valid" "connector labels were skipped" = "label konektor dilewati" +"connector layers import as static frame/vector snapshots with labels when present; live endpoint bindings are not retained" = "layer konektor diimpor sebagai snapshot frame/vector statis beserta labelnya jika ada; binding dinamis titik ujung tidak dipertahankan" +"connector snapshot vector data is missing; connector was left empty" = "data vector snapshot konektor tidak ada; konektor dibiarkan kosong" "connectors whose ends can't be placed are empty" = "konektor yang ujungnya tidak dapat ditempatkan kosong" "crop marks" = "tanda potong" "damaged vector geometry was skipped" = "geometri vector yang rusak dilewati" "damaged vector networks import as outlines" = "jaringan vector yang rusak diimpor sebagai outline" "development: {path}" = "pengembangan: {path}" "document children other than pages were skipped" = "anak dokumen selain halaman dilewati" +"duplicate grid track sizing entries use equal tracks" = "entri ukuran track grid yang duplikat memakai track yang sama besar" "e.g. count + 1" = "mis. count + 1" "e.g. count >= 3 and not done" = "mis. count >= 3 and not done" "elbowed and curved connectors without a saved path import as straight lines" = "konektor siku dan lengkung tanpa jalur tersimpan diimpor sebagai garis lurus" @@ -1527,14 +1539,20 @@ status = "draft — needs native review" "filled areas of a vector with their own fill use the layer's fill" = "area terisi pada vector dengan isian sendiri memakai isian layer" "from {server}" = "dari {server}" "gamepad triggers without exactly one known controller button were skipped" = "pemicu gamepad yang tidak memiliki tepat satu tombol kontroler yang dikenal dilewati" +"grid track list exceeds 1000 entries; the tracks use the default equal sizing" = "daftar track grid melebihi 1000 entri; track memakai ukuran sama besar bawaan" +"grid track sizing is unsupported or malformed; affected tracks use equal sizing" = "ukuran track grid tidak didukung atau rusak; track yang terdampak memakai ukuran sama besar" +"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "daftar ukuran track grid melebihi 1000 entri; track memakai ukuran sama besar bawaan" "hidden" = "tersembunyi" "iOS" = "iOS" +"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "filter gambar ambigu karena kedua kontainer filter ada; konversi filter dilewati" +"image filters use FigCraft's approximate renderer" = "filter gambar memakai perenderan perkiraan FigCraft" "instance swap properties whose default component isn't in the file were skipped" = "properti tukar instance yang component bawaannya tidak ada di file dilewati" "instances inside their own main component were imported as frames" = "instance di dalam main component-nya sendiri diimpor sebagai frame" "instances of components that aren't in the file show no layers" = "instance dari component yang tidak ada di file tidak menampilkan layer" "instances of components that aren't in the file were imported as frames" = "instance dari component yang tidak ada di file diimpor sebagai frame" "instances that would nest a component inside itself were imported as frames" = "instance yang akan menyarangkan component di dalam dirinya sendiri diimpor sebagai frame" "instances without a main component were imported as empty frames" = "instance tanpa main component diimpor sebagai frame kosong" +"invalid internal .fig text path data was ignored" = "data teks di path internal .fig yang tidak valid diabaikan" "invalid or oversized vector networks import as outlines" = "jaringan vector yang tidak valid atau terlalu besar diimpor sebagai outline" "invalid or oversized vector path data was skipped" = "data jalur vector yang tidak valid atau terlalu besar dilewati" "just now" = "baru saja" @@ -1542,12 +1560,18 @@ status = "draft — needs native review" "key up triggers import as key presses" = "pemicu saat tombol dilepas diimpor sebagai penekanan tombol" "layers without a position were placed at their parent's origin" = "layer tanpa posisi ditempatkan di titik asal induknya" "layers without a type were skipped" = "layer tanpa tipe dilewati" +"legacy image filter container is unsupported; filter conversion was skipped" = "kontainer filter gambar versi lama tidak didukung; konversi filter dilewati" "locked" = "terkunci" +"malformed image filters container was skipped" = "kontainer filter gambar yang rusak dilewati" +"malformed image paintFilter container was skipped" = "kontainer paintFilter gambar yang rusak dilewati" +"malformed slot content assignment was skipped" = "penetapan konten slot yang rusak dilewati" "no bleed" = "tanpa bleed" "nobody else here yet" = "belum ada orang lain di sini" +"non-default slot settings are not represented and were skipped" = "pengaturan slot non-default tidak dapat direpresentasikan dan dilewati" "now" = "sekarang" "or" = "atau" "point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "sambungan stroke per titik dipertahankan; stroke putus-putus atau berlebar variabel digambar dengan sambungan layer" +"preferred slot component keys cannot be resolved to file nodes and were skipped" = "kunci component pilihan slot tidak dapat dicocokkan dengan layer di file dan dilewati" "prototype actions of unknown types were skipped" = "tindakan prototype dengan tipe yang tidak dikenal dilewati" "prototype actions without a destination in the file were skipped" = "tindakan prototype tanpa tujuan di file dilewati" "prototype expressions on variables that aren't in the variables JSON were skipped" = "ekspresi prototype pada variabel yang tidak ada di JSON variabel dilewati" @@ -1565,8 +1589,14 @@ status = "draft — needs native review" "set-variable actions with values that don't fit the variable were skipped" = "tindakan atur variabel dengan nilai yang tidak cocok dengan variabelnya dilewati" "set-variable actions without a value were skipped" = "tindakan atur variabel tanpa nilai dilewati" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "tindakan atur mode variabel pada koleksi atau mode yang tidak ada di JSON variabel dilewati" +"slot content assignment target is missing or is not slot content" = "target penetapan konten slot tidak ada atau bukan konten slot" +"slot content assignment uses the empty GUID sentinel and was skipped" = "penetapan konten slot memakai GUID kosong sebagai penanda dan dilewati" "some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "beberapa titik vector merujuk ke pengaturan titik yang tidak ada di file; titik tersebut memakai sambungan layer dan sudut biasa" +"some vector segments refer to style settings missing from the file; they use the layer's stroke" = "beberapa segmen vector merujuk ke pengaturan gaya yang tidak ada di file; segmen tersebut memakai stroke layer" +"stale or invalid grid track sizing entries were ignored" = "entri ukuran track grid yang usang atau tidak valid diabaikan" "stars and polygons without point counts or geometry use the default point count" = "bintang dan poligon tanpa jumlah titik atau geometri memakai jumlah titik bawaan" +"style settings of some vector segments aren't supported; those segments use the layer's stroke" = "pengaturan gaya beberapa segmen vector tidak didukung; segmen tersebut memakai stroke layer" +"text path underline or strikethrough decoration is not rendered" = "garis bawah atau coretan pada teks di path tidak digambar" "text style overrides refer to missing table entries" = "penimpaan gaya teks merujuk ke entri tabel yang tidak ada" "the file has no pages" = "file tidak memiliki halaman" "the plugin" = "plugin" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index fb3a95e53..965f8ead4 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -1522,13 +1522,25 @@ status = "draft — needs native review" "can edit the document" = "ドキュメントを編集できる" "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 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 import as straight lines" = "保存されたパスのない折れ線・曲線コネクタは直線としてインポート" @@ -1537,14 +1549,20 @@ status = "draft — needs native review" "filled areas of a vector with their own fill use the layer's fill" = "独自の塗りを持つベクターの塗りつぶし領域にはレイヤーの塗りを使用" "from {server}" = "{server} から" "gamepad triggers without exactly one known controller button were skipped" = "既知のコントローラーボタンがちょうど 1 つではないゲームパッドトリガーをスキップ" +"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 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" = "デフォルトのコンポーネントがファイルにないインスタンスの入れ替えプロパティをスキップ" "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 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" = "無効または大きすぎるベクターパスデータをスキップ" "just now" = "たった今" @@ -1552,12 +1570,18 @@ status = "draft — needs native review" "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" = "旧形式の画像フィルターコンテナは未対応のため、フィルターの変換をスキップ" "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" = "デフォルト以外のスロット設定は再現できないためスキップ" "now" = "たった今" "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" = "変数 JSON にない変数を使うプロトタイプの式をスキップ" @@ -1575,8 +1599,14 @@ status = "draft — needs native review" "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 にないコレクションまたはモードに対する変数モード設定アクションをスキップ" +"slot content assignment target is missing or is not slot content" = "スロットコンテンツの割り当て先がないか、スロットコンテンツではない" +"slot content assignment uses the empty GUID sentinel and was skipped" = "スロットコンテンツの割り当てが空の GUID を番兵値として使用しているためスキップ" "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" = "このプラグイン" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index 7cc9bab58..649fc26c9 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -1449,13 +1449,25 @@ status = "draft — needs native review" "can edit the document" = "문서를 편집할 수 있음" "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 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 import as straight lines" = "저장된 경로가 없는 꺾인 커넥터와 곡선 커넥터는 직선으로 가져옴" @@ -1464,26 +1476,38 @@ status = "draft — needs native review" "filled areas of a vector with their own fill use the layer's fill" = "자체 채우기가 있는 벡터의 채워진 영역은 레이어의 채우기를 사용함" "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 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" = "기본 컴포넌트가 파일에 없는 인스턴스 교체 속성을 건너뜀" "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 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" = "잘못되었거나 너무 큰 벡터 경로 데이터를 건너뜀" "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" = "레거시 이미지 필터 컨테이너는 지원되지 않아 필터 변환을 건너뜀" "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" = "기본값이 아닌 슬롯 설정은 표현할 수 없어 건너뜀" "now" = "방금" "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" = "변수 JSON에 없는 변수에 대한 프로토타입 수식을 건너뜀" @@ -1501,8 +1525,14 @@ status = "draft — needs native review" "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에 없는 컬렉션이나 모드에 대한 변수 모드 설정 액션을 건너뜀" +"slot content assignment target is missing or is not slot content" = "슬롯 콘텐츠 할당 대상이 없거나 슬롯 콘텐츠가 아님" +"slot content assignment uses the empty GUID sentinel and was skipped" = "슬롯 콘텐츠 할당이 빈 GUID를 센티넬 값으로 사용하여 건너뜀" "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" = "이 플러그인" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index 30a3a1861..c31b69476 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -1448,13 +1448,25 @@ status = "draft — needs native review" "can edit the document" = "pode editar o documento" "conditional prototype actions nested too deeply were skipped" = "ações condicionais de protótipo aninhadas profundamente demais foram ignoradas" "conditional prototype actions with conditions that can't be evaluated were skipped" = "ações condicionais de protótipo com condições que não podem ser avaliadas foram ignoradas" +"connector label background was skipped: style data is missing" = "o fundo do rótulo do conector foi ignorado: faltam os dados de estilo" +"connector label was skipped: background bounds are invalid" = "o rótulo do conector foi ignorado: os limites do fundo são inválidos" +"connector label was skipped: background transform is invalid" = "o rótulo do conector foi ignorado: a transformação do fundo é inválida" +"connector label was skipped: composed text transform is invalid" = "o rótulo do conector foi ignorado: a transformação composta do texto é inválida" +"connector label was skipped: derived background bounds are missing" = "o rótulo do conector foi ignorado: faltam os limites derivados do fundo" +"connector label was skipped: derived text bounds are missing" = "o rótulo do conector foi ignorado: faltam os limites derivados do texto" +"connector label was skipped: text bounds are invalid" = "o rótulo do conector foi ignorado: os limites do texto são inválidos" +"connector label was skipped: text style data is missing" = "o rótulo do conector foi ignorado: faltam os dados de estilo do texto" +"connector label was skipped: text transform is invalid" = "o rótulo do conector foi ignorado: a transformação do texto é inválida" "connector labels were skipped" = "rótulos de conectores foram ignorados" +"connector layers import as static frame/vector snapshots with labels when present; live endpoint bindings are not retained" = "camadas de conector são importadas como instantâneos estáticos de quadro ou vetor, com rótulos quando houver; os vínculos dinâmicos das pontas não são mantidos" +"connector snapshot vector data is missing; connector was left empty" = "faltam os dados vetoriais do instantâneo do conector; o conector ficou vazio" "connectors whose ends can't be placed are empty" = "conectores cujas pontas não podem ser posicionadas ficam vazios" "crop marks" = "marcas de corte" "damaged vector geometry was skipped" = "geometria vetorial danificada foi ignorada" "damaged vector networks import as outlines" = "redes vetoriais danificadas são importadas como contornos" "development: {path}" = "desenvolvimento: {path}" "document children other than pages were skipped" = "filhos do documento que não são páginas foram ignorados" +"duplicate grid track sizing entries use equal tracks" = "entradas duplicadas de dimensionamento de faixas da grade usam faixas iguais" "e.g. count + 1" = "por ex. count + 1" "e.g. count >= 3 and not done" = "por ex. count >= 3 and not done" "elbowed and curved connectors without a saved path import as straight lines" = "conectores angulares e curvos sem um caminho salvo são importados como linhas retas" @@ -1463,26 +1475,38 @@ status = "draft — needs native review" "filled areas of a vector with their own fill use the layer's fill" = "áreas preenchidas de um vetor com preenchimento próprio usam o preenchimento da camada" "from {server}" = "de {server}" "gamepad triggers without exactly one known controller button were skipped" = "gatilhos de gamepad sem exatamente um botão de controle conhecido foram ignorados" +"grid track list exceeds 1000 entries; the tracks use the default equal sizing" = "a lista de faixas da grade passa de 1000 entradas; as faixas usam o dimensionamento igual padrão" +"grid track sizing is unsupported or malformed; affected tracks use equal sizing" = "o dimensionamento de faixas da grade não é compatível ou está malformado; as faixas afetadas usam dimensionamento igual" +"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "a lista de dimensionamento de faixas da grade passa de 1000 entradas; as faixas usam o dimensionamento igual padrão" "hidden" = "oculta" "iOS" = "iOS" +"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "os filtros de imagem são ambíguos porque os dois contêineres de filtro estão presentes; a conversão dos filtros foi ignorada" +"image filters use FigCraft's approximate renderer" = "os filtros de imagem usam a renderização aproximada do FigCraft" "instance swap properties whose default component isn't in the file were skipped" = "propriedades de troca de instância cujo componente padrão não está no arquivo foram ignoradas" "instances inside their own main component were imported as frames" = "instâncias dentro do próprio componente principal foram importadas como quadros" "instances of components that aren't in the file show no layers" = "instâncias de componentes que não estão no arquivo não mostram camadas" "instances of components that aren't in the file were imported as frames" = "instâncias de componentes que não estão no arquivo foram importadas como quadros" "instances that would nest a component inside itself were imported as frames" = "instâncias que aninhariam um componente dentro dele mesmo foram importadas como quadros" "instances without a main component were imported as empty frames" = "instâncias sem componente principal foram importadas como quadros vazios" +"invalid internal .fig text path data was ignored" = "dados internos inválidos de texto em caminho do .fig foram ignorados" "invalid or oversized vector networks import as outlines" = "redes vetoriais inválidas ou grandes demais são importadas como contornos" "invalid or oversized vector path data was skipped" = "dados de caminho vetorial inválidos ou grandes demais foram ignorados" "key triggers without a supported key were skipped" = "gatilhos de tecla sem uma tecla compatível foram ignorados" "key up triggers import as key presses" = "gatilhos ao soltar uma tecla são importados como pressionamentos de tecla" "layers without a position were placed at their parent's origin" = "camadas sem posição foram colocadas na origem do elemento pai" "layers without a type were skipped" = "camadas sem tipo foram ignoradas" +"legacy image filter container is unsupported; filter conversion was skipped" = "o contêiner legado de filtros de imagem não é compatível; a conversão dos filtros foi ignorada" "locked" = "bloqueada" +"malformed image filters container was skipped" = "o contêiner de filtros de imagem malformado foi ignorado" +"malformed image paintFilter container was skipped" = "o contêiner paintFilter de imagem malformado foi ignorado" +"malformed slot content assignment was skipped" = "uma atribuição de conteúdo de slot malformada foi ignorada" "no bleed" = "sem sangria" "nobody else here yet" = "ainda não há mais ninguém" +"non-default slot settings are not represented and were skipped" = "configurações de slot diferentes do padrão não são representadas e foram ignoradas" "now" = "agora" "or" = "ou" "point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "as junções de traço por ponto foram mantidas; traços tracejados ou de largura variável são desenhados com a junção da camada" +"preferred slot component keys cannot be resolved to file nodes and were skipped" = "chaves de componentes preferidos de slots não correspondem a camadas do arquivo e foram ignoradas" "prototype actions of unknown types were skipped" = "ações de protótipo de tipos desconhecidos foram ignoradas" "prototype actions without a destination in the file were skipped" = "ações de protótipo sem destino no arquivo foram ignoradas" "prototype expressions on variables that aren't in the variables JSON were skipped" = "expressões de protótipo com variáveis que não estão no JSON de variáveis foram ignoradas" @@ -1500,8 +1524,14 @@ status = "draft — needs native review" "set-variable actions with values that don't fit the variable were skipped" = "ações de definir variável com valores que não cabem na variável foram ignoradas" "set-variable actions without a value were skipped" = "ações de definir variável sem valor foram ignoradas" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "ações de definir modo de variável em coleções ou modos que não estão no JSON de variáveis foram ignoradas" +"slot content assignment target is missing or is not slot content" = "o destino da atribuição de conteúdo de slot está ausente ou não é conteúdo de slot" +"slot content assignment uses the empty GUID sentinel and was skipped" = "a atribuição de conteúdo de slot usa o GUID vazio como sentinela e foi ignorada" "some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "alguns pontos vetoriais se referem a configurações de ponto ausentes no arquivo; eles usam as junções da camada e cantos simples" +"some vector segments refer to style settings missing from the file; they use the layer's stroke" = "alguns segmentos vetoriais se referem a configurações de estilo ausentes no arquivo; eles usam o traço da camada" +"stale or invalid grid track sizing entries were ignored" = "entradas de dimensionamento de faixas da grade obsoletas ou inválidas foram ignoradas" "stars and polygons without point counts or geometry use the default point count" = "estrelas e polígonos sem número de pontas nem geometria usam o número de pontas padrão" +"style settings of some vector segments aren't supported; those segments use the layer's stroke" = "as configurações de estilo de alguns segmentos vetoriais não são compatíveis; esses segmentos usam o traço da camada" +"text path underline or strikethrough decoration is not rendered" = "o sublinhado ou tachado do texto em caminho não é desenhado" "text style overrides refer to missing table entries" = "substituições de estilo de texto se referem a entradas de tabela ausentes" "the file has no pages" = "o arquivo não tem páginas" "the plugin" = "o plugin" diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index d039a14f5..998eefdae 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -1510,13 +1510,25 @@ name = "Русский" "can edit the document" = "может редактировать документ" "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 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 import as straight lines" = "ломаные и изогнутые соединительные линии без сохранённого пути импортируются как прямые" @@ -1525,14 +1537,20 @@ name = "Русский" "filled areas of a vector with their own fill use the layer's fill" = "залитые области вектора с собственной заливкой используют заливку слоя" "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 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" = "свойства замены экземпляра, компонент по умолчанию которых отсутствует в файле, пропущены" "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 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" = "недопустимые или слишком большие данные векторных путей пропущены" "just now" = "только что" @@ -1540,12 +1558,18 @@ name = "Русский" "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" = "устаревший контейнер фильтров изображения не поддерживается; преобразование фильтров пропущено" "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" = "нестандартные настройки слотов не передаются и пропущены" "now" = "сейчас" "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" = "выражения прототипа с переменными, которых нет в JSON переменных, пропущены" @@ -1563,8 +1587,14 @@ name = "Русский" "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 переменных, пропущены" +"slot content assignment target is missing or is not slot content" = "цель назначения содержимого слота отсутствует или не является содержимым слота" +"slot content assignment uses the empty GUID sentinel and was skipped" = "назначение содержимого слота использует пустой GUID-маркер и пропущено" "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" = "плагин" diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index 7ebc07c0c..eea2d3126 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -1529,13 +1529,25 @@ name = "Svenska" "can edit the document" = "kan redigera dokumentet" "conditional prototype actions nested too deeply were skipped" = "villkorliga prototypåtgärder som var nästlade för djupt hoppades över" "conditional prototype actions with conditions that can't be evaluated were skipped" = "villkorliga prototypåtgärder med villkor som inte kan utvärderas hoppades över" +"connector label background was skipped: style data is missing" = "bakgrunden till etiketten på en kopplingslinje hoppades över: stildata saknas" +"connector label was skipped: background bounds are invalid" = "etiketten på en kopplingslinje hoppades över: bakgrundens gränser är ogiltiga" +"connector label was skipped: background transform is invalid" = "etiketten på en kopplingslinje hoppades över: bakgrundens transformering är ogiltig" +"connector label was skipped: composed text transform is invalid" = "etiketten på en kopplingslinje hoppades över: textens sammansatta transformering är ogiltig" +"connector label was skipped: derived background bounds are missing" = "etiketten på en kopplingslinje hoppades över: bakgrundens härledda gränser saknas" +"connector label was skipped: derived text bounds are missing" = "etiketten på en kopplingslinje hoppades över: textens härledda gränser saknas" +"connector label was skipped: text bounds are invalid" = "etiketten på en kopplingslinje hoppades över: textens gränser är ogiltiga" +"connector label was skipped: text style data is missing" = "etiketten på en kopplingslinje hoppades över: textens stildata saknas" +"connector label was skipped: text transform is invalid" = "etiketten på en kopplingslinje hoppades över: textens transformering är ogiltig" "connector labels were skipped" = "etiketter på kopplingslinjer hoppades över" +"connector layers import as static frame/vector snapshots with labels when present; live endpoint bindings are not retained" = "kopplingslinjelager importeras som statiska ögonblicksbilder av ramar eller vektorer, med etiketter om de finns; dynamiska bindningar av ändpunkterna behålls inte" +"connector snapshot vector data is missing; connector was left empty" = "vektordata för kopplingslinjens ögonblicksbild saknas; kopplingslinjen lämnades tom" "connectors whose ends can't be placed are empty" = "kopplingslinjer vars ändar inte kan placeras är tomma" "crop marks" = "skärmärken" "damaged vector geometry was skipped" = "skadad vektorgeometri hoppades över" "damaged vector networks import as outlines" = "skadade vektornätverk importeras som former" "development: {path}" = "utveckling: {path}" "document children other than pages were skipped" = "underordnade objekt i dokumentet som inte är sidor hoppades över" +"duplicate grid track sizing entries use equal tracks" = "dubbla storleksposter för rutnätsspår använder lika stora spår" "e.g. count + 1" = "t.ex. count + 1" "e.g. count >= 3 and not done" = "t.ex. count >= 3 and not done" "elbowed and curved connectors without a saved path import as straight lines" = "vinklade och böjda kopplingslinjer utan sparad bana importeras som raka linjer" @@ -1544,14 +1556,20 @@ name = "Svenska" "filled areas of a vector with their own fill use the layer's fill" = "fyllda områden i en vektor med egen fyllning använder lagrets fyllning" "from {server}" = "från {server}" "gamepad triggers without exactly one known controller button were skipped" = "spelkontrollsutlösare utan exakt en känd kontrollknapp hoppades över" +"grid track list exceeds 1000 entries; the tracks use the default equal sizing" = "listan över rutnätsspår har fler än 1000 poster; spåren får standardstorleken med lika stora spår" +"grid track sizing is unsupported or malformed; affected tracks use equal sizing" = "storleken på rutnätsspår stöds inte eller är felaktig; berörda spår blir lika stora" +"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "listan över storlekar på rutnätsspår har fler än 1000 poster; spåren får standardstorleken med lika stora spår" "hidden" = "dold" "iOS" = "iOS" +"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "bildfiltren är tvetydiga eftersom båda filterbehållarna finns; filterkonverteringen hoppades över" +"image filters use FigCraft's approximate renderer" = "bildfilter använder FigCrafts ungefärliga rendering" "instance swap properties whose default component isn't in the file were skipped" = "egenskaper för instansbyte vars standardkomponent inte finns i filen hoppades över" "instances inside their own main component were imported as frames" = "instanser inuti sin egen huvudkomponent importerades som ramar" "instances of components that aren't in the file show no layers" = "instanser av komponenter som inte finns i filen visar inga lager" "instances of components that aren't in the file were imported as frames" = "instanser av komponenter som inte finns i filen importerades som ramar" "instances that would nest a component inside itself were imported as frames" = "instanser som skulle nästla en komponent i sig själv importerades som ramar" "instances without a main component were imported as empty frames" = "instanser utan huvudkomponent importerades som tomma ramar" +"invalid internal .fig text path data was ignored" = "ogiltiga interna .fig-data för text på bana ignorerades" "invalid or oversized vector networks import as outlines" = "ogiltiga eller för stora vektornätverk importeras som former" "invalid or oversized vector path data was skipped" = "ogiltiga eller för stora vektorbanedata hoppades över" "just now" = "nyss" @@ -1559,12 +1577,18 @@ name = "Svenska" "key up triggers import as key presses" = "utlösare för släppt tangent importeras som tangenttryckningar" "layers without a position were placed at their parent's origin" = "lager utan position placerades i det överordnade objektets origo" "layers without a type were skipped" = "lager utan typ hoppades över" +"legacy image filter container is unsupported; filter conversion was skipped" = "den äldre bildfilterbehållaren stöds inte; filterkonverteringen hoppades över" "locked" = "låst" +"malformed image filters container was skipped" = "en felaktig bildfilterbehållare hoppades över" +"malformed image paintFilter container was skipped" = "en felaktig paintFilter-behållare för bild hoppades över" +"malformed slot content assignment was skipped" = "en felaktig tilldelning av fackinnehåll hoppades över" "no bleed" = "inget utfall" "nobody else here yet" = "ingen annan här än" +"non-default slot settings are not represented and were skipped" = "fackinställningar som avviker från standard återges inte och hoppades över" "now" = "nu" "or" = "eller" "point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "punkternas hörntyper behölls; streckade konturer och konturer med variabel bredd ritas med lagrets hörntyp" +"preferred slot component keys cannot be resolved to file nodes and were skipped" = "nycklar för föredragna komponenter i fack kan inte kopplas till lager i filen och hoppades över" "prototype actions of unknown types were skipped" = "prototypåtgärder av okända typer hoppades över" "prototype actions without a destination in the file were skipped" = "prototypåtgärder utan mål i filen hoppades över" "prototype expressions on variables that aren't in the variables JSON were skipped" = "prototyputtryck med variabler som inte finns i variabel-JSON:en hoppades över" @@ -1582,8 +1606,14 @@ name = "Svenska" "set-variable actions with values that don't fit the variable were skipped" = "åtgärder för att ange variabel med värden som inte passar variabeln hoppades över" "set-variable actions without a value were skipped" = "åtgärder för att ange variabel utan värde hoppades över" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "åtgärder för att ange variabelläge på samlingar eller lägen som inte finns i variabel-JSON:en hoppades över" +"slot content assignment target is missing or is not slot content" = "målet för tilldelningen av fackinnehåll saknas eller är inte fackinnehåll" +"slot content assignment uses the empty GUID sentinel and was skipped" = "tilldelningen av fackinnehåll använder det tomma GUID:t som markörvärde och hoppades över" "some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "vissa vektorpunkter hänvisar till punktinställningar som saknas i filen; de använder lagrets hörntyper och vanliga hörn" +"some vector segments refer to style settings missing from the file; they use the layer's stroke" = "vissa vektorsegment hänvisar till stilinställningar som saknas i filen; de använder lagrets kontur" +"stale or invalid grid track sizing entries were ignored" = "inaktuella eller ogiltiga storleksposter för rutnätsspår ignorerades" "stars and polygons without point counts or geometry use the default point count" = "stjärnor och polygoner utan antal punkter eller geometri använder standardantalet punkter" +"style settings of some vector segments aren't supported; those segments use the layer's stroke" = "stilinställningar för vissa vektorsegment stöds inte; de segmenten använder lagrets kontur" +"text path underline or strikethrough decoration is not rendered" = "understrykning eller genomstrykning av text på bana ritas inte" "text style overrides refer to missing table entries" = "åsidosättningar av textstilar hänvisar till tabellposter som saknas" "the file has no pages" = "filen har inga sidor" "the plugin" = "pluginet" diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml index 94475f3b0..1695864cd 100644 --- a/crates/ui-egui/locales/tr.toml +++ b/crates/ui-egui/locales/tr.toml @@ -1512,13 +1512,25 @@ name = "Türkçe" "can edit the document" = "belgeyi düzenleyebilir" "conditional prototype actions nested too deeply were skipped" = "çok derin iç içe geçmiş koşullu prototip eylemleri atlandı" "conditional prototype actions with conditions that can't be evaluated were skipped" = "değerlendirilemeyen koşullara sahip koşullu prototip eylemleri atlandı" +"connector label background was skipped: style data is missing" = "bağlayıcı etiketinin arka planı atlandı: stil verileri eksik" +"connector label was skipped: background bounds are invalid" = "bağlayıcı etiketi atlandı: arka plan sınırları geçersiz" +"connector label was skipped: background transform is invalid" = "bağlayıcı etiketi atlandı: arka plan dönüşümü geçersiz" +"connector label was skipped: composed text transform is invalid" = "bağlayıcı etiketi atlandı: birleştirilmiş metin dönüşümü geçersiz" +"connector label was skipped: derived background bounds are missing" = "bağlayıcı etiketi atlandı: türetilmiş arka plan sınırları eksik" +"connector label was skipped: derived text bounds are missing" = "bağlayıcı etiketi atlandı: türetilmiş metin sınırları eksik" +"connector label was skipped: text bounds are invalid" = "bağlayıcı etiketi atlandı: metin sınırları geçersiz" +"connector label was skipped: text style data is missing" = "bağlayıcı etiketi atlandı: metin stili verileri eksik" +"connector label was skipped: text transform is invalid" = "bağlayıcı etiketi atlandı: metin dönüşümü geçersiz" "connector labels were skipped" = "bağlayıcı etiketleri atlandı" +"connector layers import as static frame/vector snapshots with labels when present; live endpoint bindings are not retained" = "bağlayıcı katmanları, varsa etiketleriyle birlikte statik çerçeve/vektör anlık görüntüleri olarak içe aktarılır; uç noktaların dinamik bağlantıları korunmaz" +"connector snapshot vector data is missing; connector was left empty" = "bağlayıcı anlık görüntüsünün vektör verileri eksik; bağlayıcı boş bırakıldı" "connectors whose ends can't be placed are empty" = "uçları yerleştirilemeyen bağlayıcılar boş" "crop marks" = "kesim işaretleri" "damaged vector geometry was skipped" = "hasarlı vektör geometrisi atlandı" "damaged vector networks import as outlines" = "hasarlı vektör ağları ana hat olarak içe aktarılır" "development: {path}" = "geliştirme: {path}" "document children other than pages were skipped" = "belgenin sayfa olmayan alt öğeleri atlandı" +"duplicate grid track sizing entries use equal tracks" = "yinelenen ızgara izi boyutlandırma girdileri eşit izler kullanır" "e.g. count + 1" = "ör. count + 1" "e.g. count >= 3 and not done" = "ör. count >= 3 and not done" "elbowed and curved connectors without a saved path import as straight lines" = "kaydedilmiş yolu olmayan dirsekli ve eğri bağlayıcılar düz çizgi olarak içe aktarılır" @@ -1527,14 +1539,20 @@ name = "Türkçe" "filled areas of a vector with their own fill use the layer's fill" = "kendi dolgusu olan vektör dolgu alanları katmanın dolgusunu kullanır" "from {server}" = "kaynak: {server}" "gamepad triggers without exactly one known controller button were skipped" = "tam olarak bir bilinen kumanda düğmesi olmayan oyun kumandası tetikleyicileri atlandı" +"grid track list exceeds 1000 entries; the tracks use the default equal sizing" = "ızgara izi listesi 1000 girdiyi aşıyor; izler varsayılan eşit boyutlandırmayı kullanır" +"grid track sizing is unsupported or malformed; affected tracks use equal sizing" = "ızgara izi boyutlandırması desteklenmiyor veya bozuk; etkilenen izler eşit boyutlandırma kullanır" +"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "ızgara izi boyutlandırma listesi 1000 girdiyi aşıyor; izler varsayılan eşit boyutlandırmayı kullanır" "hidden" = "gizli" "iOS" = "iOS" +"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "iki filtre kapsayıcısı da bulunduğu için görüntü filtreleri belirsiz; filtre dönüştürme atlandı" +"image filters use FigCraft's approximate renderer" = "görüntü filtreleri FigCraft'ın yaklaşık işlemesini kullanır" "instance swap properties whose default component isn't in the file were skipped" = "varsayılan bileşeni dosyada olmayan örnek değiştirme özellikleri atlandı" "instances inside their own main component were imported as frames" = "kendi ana bileşeninin içindeki örnekler çerçeve olarak içe aktarıldı" "instances of components that aren't in the file show no layers" = "dosyada olmayan bileşenlerin örnekleri katman göstermez" "instances of components that aren't in the file were imported as frames" = "dosyada olmayan bileşenlerin örnekleri çerçeve olarak içe aktarıldı" "instances that would nest a component inside itself were imported as frames" = "bir bileşeni kendi içine yerleştirecek örnekler çerçeve olarak içe aktarıldı" "instances without a main component were imported as empty frames" = "ana bileşeni olmayan örnekler boş çerçeve olarak içe aktarıldı" +"invalid internal .fig text path data was ignored" = "yol üzerindeki metne ait geçersiz dahili .fig verileri yok sayıldı" "invalid or oversized vector networks import as outlines" = "geçersiz veya çok büyük vektör ağları ana hat olarak içe aktarılır" "invalid or oversized vector path data was skipped" = "geçersiz veya çok büyük vektör yolu verileri atlandı" "just now" = "az önce" @@ -1542,12 +1560,18 @@ name = "Türkçe" "key up triggers import as key presses" = "tuş bırakma tetikleyicileri tuşa basma olarak içe aktarılır" "layers without a position were placed at their parent's origin" = "konumu olmayan katmanlar üst öğelerinin başlangıç noktasına yerleştirildi" "layers without a type were skipped" = "türü olmayan katmanlar atlandı" +"legacy image filter container is unsupported; filter conversion was skipped" = "eski görüntü filtresi kapsayıcısı desteklenmiyor; filtre dönüştürme atlandı" "locked" = "kilitli" +"malformed image filters container was skipped" = "bozuk görüntü filtreleri kapsayıcısı atlandı" +"malformed image paintFilter container was skipped" = "bozuk görüntü paintFilter kapsayıcısı atlandı" +"malformed slot content assignment was skipped" = "bozuk yuva içeriği ataması atlandı" "no bleed" = "taşma payı yok" "nobody else here yet" = "burada henüz başka kimse yok" +"non-default slot settings are not represented and were skipped" = "varsayılan dışındaki yuva ayarları aktarılamıyor ve atlandı" "now" = "şimdi" "or" = "veya" "point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "nokta başına kontur birleşimleri korundu; kesikli veya değişken genişlikli konturlar katmanın birleşimiyle çizilir" +"preferred slot component keys cannot be resolved to file nodes and were skipped" = "yuvaların tercih edilen bileşen anahtarları dosyadaki katmanlarla eşleştirilemedi ve atlandı" "prototype actions of unknown types were skipped" = "bilinmeyen türdeki prototip eylemleri atlandı" "prototype actions without a destination in the file were skipped" = "dosyada hedefi olmayan prototip eylemleri atlandı" "prototype expressions on variables that aren't in the variables JSON were skipped" = "değişken JSON'unda olmayan değişkenler üzerindeki prototip ifadeleri atlandı" @@ -1565,8 +1589,14 @@ name = "Türkçe" "set-variable actions with values that don't fit the variable were skipped" = "değişkene uymayan değerlere sahip değişken ayarlama eylemleri atlandı" "set-variable actions without a value were skipped" = "değeri olmayan değişken ayarlama eylemleri atlandı" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "değişken JSON'unda olmayan koleksiyonlar veya modlar üzerindeki değişken modu ayarlama eylemleri atlandı" +"slot content assignment target is missing or is not slot content" = "yuva içeriği atamasının hedefi eksik veya yuva içeriği değil" +"slot content assignment uses the empty GUID sentinel and was skipped" = "yuva içeriği ataması boş GUID'i işaretçi olarak kullanıyor ve atlandı" "some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "bazı vektör noktaları dosyada eksik olan nokta ayarlarına başvuruyor; bu noktalar katmanın birleşimlerini ve düz köşeleri kullanır" +"some vector segments refer to style settings missing from the file; they use the layer's stroke" = "bazı vektör segmentleri dosyada eksik olan stil ayarlarına başvuruyor; bu segmentler katmanın konturunu kullanır" +"stale or invalid grid track sizing entries were ignored" = "eski veya geçersiz ızgara izi boyutlandırma girdileri yok sayıldı" "stars and polygons without point counts or geometry use the default point count" = "nokta sayısı veya geometrisi olmayan yıldızlar ve çokgenler varsayılan nokta sayısını kullanır" +"style settings of some vector segments aren't supported; those segments use the layer's stroke" = "bazı vektör segmentlerinin stil ayarları desteklenmiyor; bu segmentler katmanın konturunu kullanır" +"text path underline or strikethrough decoration is not rendered" = "yol üzerindeki metinde altı çizili veya üstü çizili süsleme çizilmez" "text style overrides refer to missing table entries" = "metin stili geçersiz kılmaları eksik tablo girdilerine başvuruyor" "the file has no pages" = "dosyada sayfa yok" "the plugin" = "eklenti" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index 9883a2c2f..31be56110 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -1450,13 +1450,25 @@ status = "draft — needs native review" "can edit the document" = "可编辑文档" "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 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 import as straight lines" = "没有已保存路径的折线和曲线连接线导入为直线" @@ -1465,26 +1477,38 @@ status = "draft — needs native review" "filled areas of a vector with their own fill use the layer's fill" = "具有自身填充的矢量填充区域使用图层的填充" "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 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" = "已跳过默认组件不在文件中的实例替换属性" "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 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" = "已跳过无效或过大的矢量路径数据" "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" = "不支持旧版图片滤镜容器;已跳过滤镜转换" "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" = "非默认的插槽设置无法表示,已跳过" "now" = "刚刚" "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" = "已跳过使用变量 JSON 中没有的变量的原型表达式" @@ -1502,8 +1526,14 @@ status = "draft — needs native review" "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 中没有的集合或模式的设置变量模式操作" +"slot content assignment target is missing or is not slot content" = "插槽内容分配的目标缺失或不是插槽内容" +"slot content assignment uses the empty GUID sentinel and was skipped" = "插槽内容分配使用空 GUID 作为哨兵值,已跳过" "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" = "插件" diff --git a/crates/ui-egui/src/i18n_tests.rs b/crates/ui-egui/src/i18n_tests.rs index 16a06a90b..5bdf2094a 100644 --- a/crates/ui-egui/src/i18n_tests.rs +++ b/crates/ui-egui/src/i18n_tests.rs @@ -166,8 +166,9 @@ fn used_keys() -> BTreeSet { } /// The importers' fixed notes: the string literals passed to `warn` in the `.fig` and REST import -/// sources. The import report shows a note translated when the catalog has it, so an entry for one -/// counts as used, and an entry for a note the importers no longer give shows up as unused. +/// sources. The import report shows a note translated when the catalog has it, so each one is a key +/// `en.toml` (and every complete language) must have, and an entry for a note the importers no +/// longer give shows up as unused. fn importer_notes() -> BTreeSet { let src = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../format/src"); let mut keys = BTreeSet::new(); @@ -249,11 +250,10 @@ fn english() -> &'static Lang { #[test] fn every_key_in_the_code_is_in_the_english_catalog_and_no_other() { - let used: BTreeSet = used_keys().into_iter().chain(dynamic_keys()).collect(); + let used: BTreeSet = used_keys().into_iter().chain(dynamic_keys()).chain(importer_notes()).collect(); let en: BTreeSet = english().ui.iter().map(|(k, _)| k.to_string()).collect(); let missing: Vec<_> = used.difference(&en).collect(); - let notes = importer_notes(); - let unused: Vec<_> = en.difference(&used).filter(|k| !notes.contains(*k)).collect(); + let unused: Vec<_> = en.difference(&used).collect(); assert!( missing.is_empty(), "keys missing from locales/en.toml:\n{}", diff --git a/docs/translating.md b/docs/translating.md index 3aa42d651..0e94d20d2 100644 --- a/docs/translating.md +++ b/docs/translating.md @@ -112,3 +112,7 @@ add the key to `en.toml` and to each complete language (Spanish and Russian); th Labels from the engine and document crates (tool names, blend modes, easing curves…) are looked up at display with `tr(x.label())`; they are listed in `dynamic_labels` in `i18n_tests.rs`. + +The importers' fixed notes (the string literals passed to `warn` in `crates/format/src/fig` and +`crates/format/src/rest`) are keys too: the import report shows them in the UI language, so a new +note goes into `en.toml` and each complete language. Notes built with `format!` show in English. From 9a69f79861fae1cb80e6f21fa45b73b91a4627ac Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 22:39:10 +0700 Subject: [PATCH 195/817] #552: write and read space evenly as SPACE_EVENLY_CSS The format's SPACE_EVENLY is its older name for equal gaps without edge space, so files keep reading it as space between; true space evenly is SPACE_EVENLY_CSS, which the export now writes. --- .../src/fig/auto_layout_sizing_tests.rs | 31 +++++++++++++++++-- crates/format/src/fig/export.rs | 4 +-- crates/format/src/fig/map.rs | 5 +-- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/crates/format/src/fig/auto_layout_sizing_tests.rs b/crates/format/src/fig/auto_layout_sizing_tests.rs index 99730f70f..29580afb9 100644 --- a/crates/format/src/fig/auto_layout_sizing_tests.rs +++ b/crates/format/src/fig/auto_layout_sizing_tests.rs @@ -1,8 +1,8 @@ //! How auto layout frames and text size on import (hug or fixed), on encoded `.fig` files built in //! code and REST file JSON: the sizing a file records, an auto layout frame that records none, and -//! text that hugs by its resize mode. +//! text that hugs by its resize mode. Also how distributed main-axis alignment reads. -use figcraft_doc::{Document, Sizing}; +use figcraft_doc::{Document, MainAlign, Sizing}; use serde_json::{Value, json}; use super::kiwi::{Kv, Schema}; @@ -11,6 +11,7 @@ const SCHEMA: &str = " enum NodeType NONE DOCUMENT CANVAS FRAME TEXT SYMBOL INSTANCE enum StackMode NONE HORIZONTAL VERTICAL enum StackSize FIXED RESIZE_TO_FIT RESIZE_TO_FIT_WITH_IMPLICIT_SIZE +enum StackJustify MIN CENTER MAX SPACE_EVENLY SPACE_BETWEEN SPACE_AROUND SPACE_EVENLY_CSS enum TextAutoResize NONE WIDTH_AND_HEIGHT HEIGHT struct GUID uint sessionID, uint localID struct Vector float x, float y @@ -18,7 +19,7 @@ struct Matrix float m00, float m01, float m02, float m10, float m11, float m12 message ParentIndex GUID guid, string position message TextData string characters message SymbolData GUID symbolID -message NodeChange GUID guid, ParentIndex parentIndex, NodeType type, string name, Vector size, Matrix transform, StackMode stackMode, StackSize stackPrimarySizing, StackSize stackCounterSizing, TextAutoResize textAutoResize, float fontSize, TextData textData, SymbolData symbolData +message NodeChange GUID guid, ParentIndex parentIndex, NodeType type, string name, Vector size, Matrix transform, StackMode stackMode, StackSize stackPrimarySizing, StackSize stackCounterSizing, StackJustify stackPrimaryAlignItems, TextAutoResize textAutoResize, float fontSize, TextData textData, SymbolData symbolData message Message NodeChange[] nodeChanges "; @@ -191,3 +192,27 @@ fn rest_files_read_left_out_sizing_modes_as_hug_and_text_by_its_resize_mode() { assert_eq!(sizing(&doc, name), want, "{name}"); } } + +#[test] +fn distributed_alignment_reads_the_older_evenly_name_as_space_between() { + let rows = [ + ("Between", "SPACE_BETWEEN", MainAlign::SpaceBetween), + ("Older evenly", "SPACE_EVENLY", MainAlign::SpaceBetween), + ("Around", "SPACE_AROUND", MainAlign::SpaceAround), + ("Evenly", "SPACE_EVENLY_CSS", MainAlign::SpaceEvenly), + ]; + let nodes = rows + .iter() + .enumerate() + .flat_map(|(i, (name, align, _))| { + let mut fields = stack("HORIZONTAL", None, None); + fields.push(("stackPrimaryAlignItems", Kv::Enum(align))); + component(10 + 2 * i as u64, 50.0 * i as f64, name, fields, None) + }) + .collect(); + let doc = import(nodes); + for (name, _, want) in rows { + let n = doc.nodes().find(|n| n.name == name).unwrap_or_else(|| panic!("no layer {name}")); + assert_eq!(n.layout.as_ref().map(|l| l.main_align), Some(want), "{name}"); + } +} diff --git a/crates/format/src/fig/export.rs b/crates/format/src/fig/export.rs index ca9e2682a..cac29be37 100644 --- a/crates/format/src/fig/export.rs +++ b/crates/format/src/fig/export.rs @@ -73,7 +73,7 @@ enum StrokeJoin MITER=0 BEVEL=1 ROUND=2 enum ConstraintType MIN=0 CENTER=1 MAX=2 STRETCH=3 SCALE=4 enum StackMode NONE=0 HORIZONTAL=1 VERTICAL=2 GRID=3 enum StackAlign MIN=0 CENTER=1 MAX=2 BASELINE=3 -enum StackJustify MIN=0 CENTER=1 MAX=2 SPACE_EVENLY=3 SPACE_BETWEEN=4 SPACE_AROUND=5 +enum StackJustify MIN=0 CENTER=1 MAX=2 SPACE_EVENLY=3 SPACE_BETWEEN=4 SPACE_AROUND=5 SPACE_EVENLY_CSS=6 enum StackCounterAlign MIN=0 CENTER=1 MAX=2 STRETCH=3 AUTO=4 BASELINE=5 enum StackSize FIXED=0 RESIZE_TO_FIT=1 enum StackWrap NO_WRAP=0 WRAP=1 @@ -1371,7 +1371,7 @@ impl<'d> Exporter<'d> { MainAlign::Max => "MAX", MainAlign::SpaceBetween => "SPACE_BETWEEN", MainAlign::SpaceAround => "SPACE_AROUND", - MainAlign::SpaceEvenly => "SPACE_EVENLY", + MainAlign::SpaceEvenly => "SPACE_EVENLY_CSS", }; let cross = match l.cross_align { CrossAlign::Min => "MIN", diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index a113f902d..2ebe1ee99 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -1405,8 +1405,9 @@ impl<'a> Mapper<'a> { Some("CENTER") => "CENTER", Some("MAX") => "MAX", Some("SPACE_AROUND") => "SPACE_AROUND", - Some("SPACE_EVENLY") => "SPACE_EVENLY", - Some("SPACE_BETWEEN" | "SPACE_EVENLY_CSS") => "SPACE_BETWEEN", + // `SPACE_EVENLY` is the format's older name for equal gaps without edge space. + Some("SPACE_EVENLY_CSS") => "SPACE_EVENLY", + Some("SPACE_BETWEEN" | "SPACE_EVENLY") => "SPACE_BETWEEN", _ => "MIN", }; o.insert("primaryAxisAlignItems".into(), json!(main)); From 68b19422adf0dbf605a472c6c0af6f5a4d23067e Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 22:44:09 +0700 Subject: [PATCH 196/817] M1: REST import reads grid track sizes (#465) gridColumnsSizing and gridRowsSizing are CSS grid-template strings: px tracks are fixed, fr tracks fill, auto/min-content/max-content hug, minmax(_, Nfr) fills and repeat(n, ...) expands; other tracks stay equal (1fr). Tracks past the axis's own count are left out. Files from .fig keep reading the tracks from their source. --- crates/format/src/rest/grid_track_tests.rs | 42 ++++++++++++ crates/format/src/rest/mod.rs | 2 + crates/format/src/rest/props.rs | 78 ++++++++++++++++++++-- docs/file-format-parity.md | 5 +- 4 files changed, 121 insertions(+), 6 deletions(-) create mode 100644 crates/format/src/rest/grid_track_tests.rs diff --git a/crates/format/src/rest/grid_track_tests.rs b/crates/format/src/rest/grid_track_tests.rs new file mode 100644 index 000000000..a11780ca5 --- /dev/null +++ b/crates/format/src/rest/grid_track_tests.rs @@ -0,0 +1,42 @@ +//! REST import of grid track sizes (`gridColumnsSizing`, `gridRowsSizing`: CSS +//! `grid-template-columns`/`-rows` strings). Fixtures are synthetic, written by hand. + +use super::*; +use figcraft_doc::GridTrack; +use serde_json::json; + +fn tracks(columns: Value, rows: Value) -> (Vec, Vec) { + let file = json!({"name": "Fixture", "document": {"id": "0:0", "name": "Document", "type": "DOCUMENT", "children": [ + {"id": "0:1", "name": "Page", "type": "CANVAS", "children": [ + {"id": "1", "name": "Grid", "type": "FRAME", "relativeTransform": [[1, 0, 0], [0, 1, 0]], "size": {"x": 400, "y": 200}, + "layoutMode": "GRID", "gridColumnCount": 7, "gridRowCount": 2, "gridColumnsSizing": columns, "gridRowsSizing": rows} + ]} + ]}}); + let (doc, _) = import(&file, &no_images).unwrap(); + let layout = doc.nodes().find(|n| n.name == "Grid").unwrap().layout.clone().unwrap(); + (layout.column_tracks, layout.row_tracks) +} + +#[test] +fn css_track_strings_set_the_track_sizes() { + let (cols, rows) = tracks(json!("120px 2fr auto"), json!("repeat(2, minmax(0, 1fr))")); + assert_eq!(cols, [GridTrack::fixed(120.0), GridTrack::fill(2.0), GridTrack::hug()]); + assert_eq!(rows, [GridTrack::fill(1.0); 2]); + let (cols, rows) = tracks(json!(" repeat(2, 40px 1.5fr) minmax(64px, 64px) "), json!("min-content max-content")); + assert_eq!(cols, [GridTrack::fixed(40.0), GridTrack::fill(1.5), GridTrack::fixed(40.0), GridTrack::fill(1.5), GridTrack::fixed(64.0)]); + assert_eq!(rows, [GridTrack::hug(); 2]); +} + +#[test] +fn unsupported_or_junk_tracks_are_equal_tracks() { + // Ranges the grid can't express, units it doesn't have and junk keep their place as 1fr. + let (cols, rows) = tracks(json!("minmax(10px, 80px) 5em -3px 0fr NaNpx repeat(x, 1px) 10px"), json!(7)); + assert_eq!(cols, [[GridTrack::default(); 6].as_slice(), &[GridTrack::fixed(10.0)]].concat()); + assert!(rows.is_empty(), "a non-string is ignored"); + // Tracks past the grid's own count are left out; huge repeats and deep nesting stay bounded. + let (cols, rows) = tracks(json!(format!("repeat(999999999999, 1px) {}", "minmax(".repeat(10_000))), json!("1px 2px 3px")); + assert_eq!(cols, [GridTrack::fixed(1.0); 7]); + assert_eq!(rows, [GridTrack::fixed(1.0), GridTrack::fixed(2.0)]); + let (cols, rows) = tracks(json!("1e9px"), json!("( ) )) repeat(2,)")); + assert_eq!((cols, rows.len()), (vec![GridTrack::default()], 2)); +} diff --git a/crates/format/src/rest/mod.rs b/crates/format/src/rest/mod.rs index 953522e1f..be5c71576 100644 --- a/crates/format/src/rest/mod.rs +++ b/crates/format/src/rest/mod.rs @@ -29,6 +29,8 @@ mod fig_sources; #[cfg(test)] mod gamepad_tests; #[cfg(test)] +mod grid_track_tests; +#[cfg(test)] mod import_regression_tests; pub(crate) mod props; pub(crate) mod proto; diff --git a/crates/format/src/rest/props.rs b/crates/format/src/rest/props.rs index 1003682b7..efb7710d5 100644 --- a/crates/format/src/rest/props.rs +++ b/crates/format/src/rest/props.rs @@ -424,6 +424,7 @@ pub(super) fn auto_layout(v: &Value, fig_tracks: bool) -> Option { let pad = |k: &str| len(v, k).unwrap_or(0.0); let count = |k: &str, d: u32| num(v, k).filter(|n| *n >= 1.0).map_or(d, |n| n.min(1000.0) as u32); let grid = mode == LayoutMode::Grid; + let (columns, rows) = (count("gridColumnCount", 2), count("gridRowCount", 2)); Some(AutoLayout { mode, wrap: text(v, "layoutWrap") == Some("WRAP"), @@ -448,15 +449,84 @@ pub(super) fn auto_layout(v: &Value, fig_tracks: bool) -> Option { Some("SPACE_BETWEEN") => ContentAlign::SpaceBetween, _ => ContentAlign::Auto, }, - grid_columns: count("gridColumnCount", 2), - grid_rows: count("gridRowCount", 2), + grid_columns: columns, + grid_rows: rows, strokes_included: flag(v, "strokesIncludedInLayout").unwrap_or(false), reverse_z: flag(v, "itemReverseZIndex").unwrap_or(false), - column_tracks: if fig_tracks && grid { fig_grid_tracks(v, "columnTracks") } else { Vec::new() }, - row_tracks: if fig_tracks && grid { fig_grid_tracks(v, "rowTracks") } else { Vec::new() }, + column_tracks: grid_tracks(v, grid, fig_tracks, "columnTracks", "gridColumnsSizing", columns), + row_tracks: grid_tracks(v, grid, fig_tracks, "rowTracks", "gridRowsSizing", rows), }) } +/// A grid axis's track sizes: from the `.fig` source when there is one, else the API's CSS +/// `grid-template-*` string (at most `count` tracks, the axis's own). +fn grid_tracks(v: &Value, grid: bool, fig_tracks: bool, fig_axis: &str, css_key: &str, count: u32) -> Vec { + match (grid, fig_tracks) { + (false, _) => Vec::new(), + (true, true) => fig_grid_tracks(v, fig_axis), + (true, false) => text(v, css_key).map(|css| css_grid_tracks(css, count as usize)).unwrap_or_default(), + } +} + +/// The first `max` tracks of a CSS `grid-template-columns`/`-rows` value: `120px`, `2fr`, `auto` +/// (hug), `minmax(0, 1fr)` and `repeat(3, …)`; any other track is an equal (1fr) one. +fn css_grid_tracks(css: &str, max: usize) -> Vec { + let mut out = Vec::new(); + for item in css_split(css, char::is_whitespace) { + let repeated = item.strip_prefix("repeat(").and_then(|r| r.strip_suffix(')')).and_then(|r| { + let (count, tracks) = r.split_once(',')?; + Some((count.trim().parse::().ok()?, css_split(tracks, char::is_whitespace))) + }); + let (count, tracks) = repeated.unwrap_or((1, vec![item])); + for t in tracks.iter().cycle().take(count.saturating_mul(tracks.len())) { + if out.len() >= max { + return out; + } + out.push(css_track(t)); + } + } + out +} + +fn css_track(t: &str) -> GridTrack { + let Some(args) = t.strip_prefix("minmax(").and_then(|r| r.strip_suffix(')')) else { return css_size(t).unwrap_or_default() }; + // A flexible maximum is the track's share whatever its minimum; other ranges only when both ends agree. + match css_split(args, |c| c == ',').iter().map(|a| css_size(a.trim())).collect::>()[..] { + [_, Some(max)] if max.sizing == Sizing::Fill => max, + [Some(min), Some(max)] if min == max => min, + _ => GridTrack::default(), + } +} + +fn css_size(t: &str) -> Option { + let n = |s: &str| s.parse::().ok().filter(|n| n.is_finite() && (0.0..=MAX_SIZE).contains(n)); + if let Some(px) = t.strip_suffix("px").and_then(n) { + Some(GridTrack::fixed(px)) + } else if let Some(fr) = t.strip_suffix("fr").and_then(n) { + (fr > 0.0).then(|| GridTrack::fill(fr)) + } else { + matches!(t, "auto" | "min-content" | "max-content").then(GridTrack::hug) + } +} + +/// `s` split at the `sep` characters outside parentheses, empty parts dropped. +fn css_split(s: &str, sep: fn(char) -> bool) -> Vec<&str> { + let (mut parts, mut depth, mut start) = (Vec::new(), 0usize, 0); + for (i, c) in s.char_indices() { + match c { + '(' => depth += 1, + ')' => depth = depth.saturating_sub(1), + c if depth == 0 && sep(c) => { + parts.extend(s.get(start..i).filter(|p| !p.trim().is_empty())); + start = i + c.len_utf8(); + } + _ => {} + } + } + parts.extend(s.get(start..).filter(|p| !p.trim().is_empty())); + parts +} + fn fig_grid_tracks(v: &Value, axis: &str) -> Vec { v.get(crate::rest::FIG_SOURCE_FIELD) .and_then(|source| source.get("gridTracks")) diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 96293b34f..b65f77292 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (`.fig` import fidelity from the community batches, budgets for large files, the import report, a `.fig` copy from Save as, paste from another design app; instance layers' size and resizing and Hug on import (#731, #732); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (REST import reads grid track sizes (#465); `.fig` import fidelity from the community batches, budgets for large files, the import report, a `.fig` copy from Save as, paste from another design app; instance layers' size and resizing and Hug on import (#731, #732); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) Every format Figma reads or writes, with FigCraft's support. Sources: `Info.plist` of `/Applications/Figma.app` (document types only; nothing inside the bundle's code was read), Figma's @@ -19,7 +19,7 @@ and prototype interactions are still unchecked there. |---|---|---|---|---|---| | `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included; a flow that records no primary-axis sizing hugs on that axis, an instance that records no auto layout has its main's), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Since 2026-10-17 (community batches #727, #728): an instance's own identity and the cached library components a file carries, overrides applied by key and order, local text values and instance overrides over a shared text style, grid track sizes (fixed, content-sized, fill), slot content, labels of connectors saved with their drawn path (a static snapshot; the ends aren't live), skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, editable text on a path, image adjustments and images carried in the message. Budgets come from the file's own size (one value per compressed byte, 20M–128M, lower ceilings on 32-bit targets; the layer cap follows), so a 15.4 MB synthetic file with 300,000 layers opens whole; the file's bytes stay out of the command journal; an import report lists what was left out or changed once the file opens. Not read: elbowed or curved connectors without a saved path (drawn straight) and labels of connectors without a saved snapshot, table cells beyond their own layers, filled areas with their own fills, variables bound to fields the editor can't bind, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs` and the per-feature `*_tests.rs` beside them, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | -| REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout (sizing modes left out read as hug, as documented), constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings, image adjustments (the same tint sign as `.fig`); the import report after opening; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | +| REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout (sizing modes left out read as hug, as documented; grid track sizes from `gridColumnsSizing` / `gridRowsSizing`: px, fr, auto, `minmax(0, 1fr)`, `repeat()`), constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings, image adjustments (the same tint sign as `.fig`); the import report after opening; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | | Local library files | team libraries in the cloud | yes (enable a `.figcraft` as a library) | yes (publish) | per-asset versions, updates with overrides kept | see [collaboration-parity](collaboration-parity.md) | @@ -165,6 +165,7 @@ each. | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | REST file JSON import reads grid track sizes from the CSS track strings `gridColumnsSizing` / `gridRowsSizing` (fixed px, fill fr, hug `auto`, `minmax(0, 1fr)`, `repeat()`; other tracks stay equal) (#465). Numbers unchanged | | 2026-10-17 | minor | The community batches #727 and #728 in the `.fig` row: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments (also REST), images in the message; budgets from the file's size; the journal keeps no file bytes; the import report. Not read cut to what's left. A `.fig` copy from Save as. Pasted content: layers copied from another design app, best effort (tested only with clipboard HTML made from our own export), and images under Wayland (not run there). All on synthetic files: summary and hours unchanged | | 2026-10-17 | minor | Hug on import (#732): auto layout frames a `.fig` records no primary-axis sizing for hug on that axis (auto layout sized that axis by its content before it could be fixed) instead of turning fixed, instances that record no auto layout take their main's (they came in without auto layout and fixed, so longer text overflowed them), REST frames whose sizing modes are left out hug (the documented default), and text hugs by its resize mode (auto width both axes, auto height its height; it came in fixed). Numbers unchanged | | 2026-10-17 | minor | Instance layers' own size and resizing (#731): a `.fig` import keeps the sizes an instance gives its layers and their hug/fill/fixed and min/max as overrides, a REST import reads the resizing fields of `overrides`, and a `.fig` export writes a layer's own size as an override (it went with the derived layout, which a relayout replaces). Numbers unchanged | From 91c80a19cc22fedf5ff451a7b73ab7a0f2396a6c Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 22:53:54 +0700 Subject: [PATCH 197/817] M7: find macOS's downloadable CJK system fonts (#406) Current macOS keeps PingFang and other on-demand fonts in its asset store, which the font scan never walked, so Chinese text showed as boxes. The scan now also walks the com_apple_MobileAsset_Font* folders of /System/Library/AssetsV2 (and the older /System/Library/Assets) with the same depth, size and file checks, and Hiragino Sans GB and Heiti SC (preinstalled) join the Chinese UI faces and the text fallbacks. Tested with a folder laid out the same way; not run on a Mac. --- crates/text/src/fontdb.rs | 19 ++++++++++++++++- crates/text/src/fontdb_tests.rs | 38 +++++++++++++++++++++++++++++++++ crates/ui-egui/src/cjk.rs | 2 ++ docs/localization-parity.md | 7 ++++-- 4 files changed, 63 insertions(+), 3 deletions(-) diff --git a/crates/text/src/fontdb.rs b/crates/text/src/fontdb.rs index d5ff41907..a6d52d672 100644 --- a/crates/text/src/fontdb.rs +++ b/crates/text/src/fontdb.rs @@ -406,7 +406,7 @@ fn names(f: &skrifa::FontRef) -> (Option, Option) { } /// Families tried, in order, for characters a text's own font lacks. -const FALLBACK_FAMILIES: [&str; 18] = [ +const FALLBACK_FAMILIES: [&str; 20] = [ "Inter", "Helvetica Neue", "Arial", @@ -416,6 +416,8 @@ const FALLBACK_FAMILIES: [&str; 18] = [ "BIZ UDPGothic", "Hiragino Sans", "PingFang SC", + "Hiragino Sans GB", + "Heiti SC", "Noto Sans CJK SC", "Microsoft YaHei", "Apple SD Gothic Neo", @@ -691,11 +693,17 @@ fn system_font_dirs() -> Vec { let mut v: Vec = Vec::new(); #[cfg(target_os = "macos")] { + // Subfolders (`Supplemental`) are walked too. v.push("/System/Library/Fonts".into()); v.push("/Library/Fonts".into()); if let Some(h) = std::env::var_os("HOME") { v.push(std::path::PathBuf::from(h).join("Library/Fonts")); } + // Fonts the system downloads (PingFang and other CJK faces on current versions) live in + // its asset store; `Assets` is the older versions' store. + for store in ["/System/Library/AssetsV2", "/System/Library/Assets"] { + v.extend(font_asset_dirs(std::path::Path::new(store))); + } } #[cfg(target_os = "windows")] { @@ -714,6 +722,15 @@ fn system_font_dirs() -> Vec { v } +/// The font folders (`com_apple_MobileAsset_Font*`, each holding `.asset/AssetData/*.ttc`) in +/// the macOS asset store `store`: only these are walked, not the store's voices, dictionaries and +/// models. +#[cfg(any(target_os = "macos", test))] +fn font_asset_dirs(store: &std::path::Path) -> Vec { + let Ok(rd) = std::fs::read_dir(store) else { return Vec::new() }; + rd.flatten().filter(|e| e.file_name().to_str().is_some_and(|n| n.starts_with("com_apple_MobileAsset_Font"))).map(|e| e.path()).collect() +} + // Fontconfig's default configuration uses $XDG_DATA_HOME/fonts for user fonts. // Ignore relative XDG paths, as required by the XDG Base Directory Specification. #[cfg(all(unix, not(target_os = "macos")))] diff --git a/crates/text/src/fontdb_tests.rs b/crates/text/src/fontdb_tests.rs index ea762be6f..96ce78426 100644 --- a/crates/text/src/fontdb_tests.rs +++ b/crates/text/src/fontdb_tests.rs @@ -70,6 +70,44 @@ fn the_scan_reads_names_like_a_whole_file_read() { } } +#[test] +fn macos_font_assets_are_found_in_the_asset_store() { + // A store laid out like macOS's: fonts downloaded on demand sit in `.asset/AssetData` + // folders under `com_apple_MobileAsset_Font*`; other assets are never walked. Untested on a Mac. + struct TempDir(std::path::PathBuf); + impl Drop for TempDir { + fn drop(&mut self) { + let _ = std::fs::remove_dir_all(&self.0); + } + } + let tmp = TempDir(std::env::temp_dir().join(format!("figcraft-font-assets-{}", std::process::id()))); + let store = tmp.0.join("AssetsV2"); + let fonts = store.join("com_apple_MobileAsset_Font7"); + let data = |kind: &std::path::Path| kind.join("0f1e2d.asset").join("AssetData"); + for dir in [data(&fonts), data(&store.join("com_apple_MobileAsset_VoiceServices"))] { + std::fs::create_dir_all(dir).unwrap(); + } + // A file under a font-like name is listed but walks to nothing. + std::fs::write(store.join("com_apple_MobileAsset_Font7.plist"), b"not a folder").unwrap(); + let found = font_asset_dirs(&store); + assert!(found.contains(&fonts) && !found.iter().any(|d| d.ends_with("com_apple_MobileAsset_VoiceServices")), "{found:?}"); + assert!(font_asset_dirs(&tmp.0.join("missing")).is_empty()); + // With an installed font to copy in (none on CI), the scan finds it only in the font folder. + let installed = system_font_dirs() + .into_iter() + .find_map(|d| std::fs::read_dir(d).into_iter().flatten().flatten().map(|e| e.path()).find(|p| p.extension().is_some_and(|x| x == "ttf"))); + let Some(font) = installed else { return }; + for kind in ["com_apple_MobileAsset_Font7", "com_apple_MobileAsset_VoiceServices"] { + std::fs::copy(&font, data(&store.join(kind)).join("Font.ttf")).unwrap(); + } + let mut pending = BTreeMap::new(); + for dir in found { + scan_dir(&dir, 0, &mut pending); + } + let paths: Vec<_> = pending.values().flat_map(|(_, p)| p.iter().map(|p| p.path.clone())).collect(); + assert!(!paths.is_empty() && paths.iter().all(|p| p.starts_with(&fonts)), "{paths:?}"); +} + #[cfg(unix)] #[test] fn the_scan_skips_named_pipes() { diff --git a/crates/ui-egui/src/cjk.rs b/crates/ui-egui/src/cjk.rs index c7fb1f986..fd3ecf8cb 100644 --- a/crates/ui-egui/src/cjk.rs +++ b/crates/ui-egui/src/cjk.rs @@ -37,6 +37,8 @@ const CHINESE: &[&str] = &[ "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", + "Hiragino Sans GB", + "Heiti SC", "Noto Sans SC", "Source Han Sans SC", "WenQuanYi Micro Hei", diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 15d49be9e..50fcd4ec3 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -1,6 +1,6 @@ # Localization parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (string counts re-measured: 2,272 entries, the drafts at 95–99%; Swedish command labels and menu wordings; Russian, Swedish, Turkish, Czech and Indonesian listed; a duplicated paragraph removed; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (macOS finds its downloadable CJK system fonts (#406); string counts re-measured: 2,272 entries, the drafts at 95–99%; Swedish command labels and menu wordings; Russian, Swedish, Turkish, Czech and Indonesian listed; a duplicated paragraph removed; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog) · **Target:** Figma Design (desktop app 126.10.7) FigCraft's interface has a localization layer with an English catalog, a Russian catalog reviewed by a native speaker, and Spanish (with a Latin American overlay), French, German, Brazilian @@ -68,7 +68,9 @@ supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no v - **CJK UI fonts:** egui's fonts and Inter have no CJK glyphs. Once the UI language, the open file's names or comments, typed text or the language picker needs Japanese kana, Hangul or Han, the desktop app adds one installed face per script to the UI's fallbacks (Windows: Yu Gothic UI, - Meiryo, Malgun Gothic, Microsoft YaHei; macOS: Hiragino Sans, Apple SD Gothic Neo, PingFang SC; + Meiryo, Malgun Gothic, Microsoft YaHei; macOS: Hiragino Sans, Apple SD Gothic Neo, PingFang SC, + Hiragino Sans GB, Heiti SC, also from the system's downloaded font assets + (`/System/Library/AssetsV2/com_apple_MobileAsset_Font*`, where current versions keep PingFang); Linux and BSD: Noto Sans CJK, Source Han Sans, Nanum, WenQuanYi; the craft-fonts build's BIZ UDPGothic first), the UI language's script first; Han without kana outside a Japanese or Korean UI reads as Chinese, and a Chinese UI puts its Chinese face (Microsoft YaHei, PingFang SC, Noto Sans @@ -118,6 +120,7 @@ Hindi, Vietnamese and Arabic. Traditional Chinese is not planned (no catalog; it | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Chinese showed as boxes on macOS (#406): the font scan also walks the system's downloaded font assets (`/System/Library/AssetsV2` and the older `/System/Library/Assets`, only their `com_apple_MobileAsset_Font*` folders), where current versions keep PingFang SC, and Hiragino Sans GB and Heiti SC join the Chinese UI faces and the text fallbacks. Tested with a folder laid out the same way; not yet run on a Mac | | 2026-10-17 | minor | String counts re-measured from the catalogs: 1,680 UI keys, 561 command labels and 31 menu wordings (2,272 entries); Spanish complete, the other drafts at 95.3–99.2% (strings added since 2026-10-12 show English), es-419 101 entries. Indonesian has a draft (98.8%; it was listed as none); Russian (98.8%, reviewed), Swedish (99.6%, command labels and menu wordings from #599), Turkish (98.7%) and Czech (98.8%) listed with counts; the language picker's list updated; a paragraph repeated by a merge removed. Grade and hours unchanged (Indonesian's draft is offset by the drafts' new gaps) | | 2026-10-14 | minor | Windows UI language (#291): the interface language comes from Windows' first preferred language alone; that list is also the input-language list (a German keyboard on a Polish system adds Deutsch), and taking the first entry with a catalog turned the interface German there. A first preferred language without a catalog reads English; macOS AppleLanguages and gettext's `LANGUAGE` still take the first language with a catalog | | 2026-10-12 | minor | Drafts catch up again, and the counts with them: French, German, Brazilian Portuguese, Japanese, Korean and Simplified Chinese translate the 71 UI strings and 5 command labels they lacked since sharing with a join code and open hosting (the Share popover, join codes, owner tokens, reports, the .fig export notes), and with Spanish the 26 strings and 3 command labels of your online files (Home ▸ Online, its menu and dialogs, the marks on tabs); machine-drafted in each file's conventions, still drafts. The Latin American overlay adds computadora and agrega where the new Spanish says ordenador and añade (98 entries). 2,076 entries per catalog (1,503 UI strings, 544 command labels, 29 menu wordings) | From 03bb164b5cc0fc6990681712e81563f2130f119f Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 23:05:03 +0700 Subject: [PATCH 198/817] M4: Esc after a pen path stays on the same vector layer (#760) Escape or Enter while the pen draws ends the path and keeps its vector in edit mode with the pen, so the next path joins the same layer; another Escape leaves edit mode. Entering edit mode on a layer that already is a vector no longer records an empty undo step. --- crates/engine/src/lib.rs | 2 + crates/engine/src/pen_end_tests.rs | 72 ++++++++++++++++++++++++++++++ crates/engine/src/tools.rs | 35 +++++++++++---- crates/engine/src/vectoredit.rs | 19 ++++---- crates/mcp/src/headless.rs | 2 +- crates/ui-egui/src/shortcuts.rs | 4 +- docs/ui-parity.md | 5 ++- 7 files changed, 115 insertions(+), 24 deletions(-) create mode 100644 crates/engine/src/pen_end_tests.rs diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 2b09c5c37..82d495b48 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1686,6 +1686,8 @@ mod panels_behaviour_tests; #[cfg(test)] mod pdf_print_tests; #[cfg(test)] +mod pen_end_tests; +#[cfg(test)] mod pen_overlay_tests; #[cfg(test)] mod pixel_preview_tests; diff --git a/crates/engine/src/pen_end_tests.rs b/crates/engine/src/pen_end_tests.rs new file mode 100644 index 000000000..a5d24f61c --- /dev/null +++ b/crates/engine/src/pen_end_tests.rs @@ -0,0 +1,72 @@ +//! Ending a pen path with Escape or Enter (#760): the path's vector stays in edit mode with the pen, +//! so the next path is drawn into the same layer; another Escape leaves edit mode. + +use crate::Session; +use crate::tools::{PointerEvent, PointerKind, ToolId}; +use crate::vectoredit::VTool; +use figcraft_doc::NodeKind; + +fn click(s: &mut Session, x: f64, y: f64) { + for kind in [PointerKind::Down, PointerKind::Up] { + s.pointer(&PointerEvent::at(kind, x, y, 1.0)).unwrap(); + } +} + +fn layers(s: &Session) -> usize { + s.doc().unwrap().node(s.page().unwrap()).unwrap().children.len() +} + +/// (points, segments) of vector `id`. +fn shape(s: &Session, id: figcraft_doc::NodeId) -> (usize, usize) { + match &s.doc().unwrap().node(id).unwrap().kind { + NodeKind::Vector { network } => (network.vertices.len(), network.segments.len()), + k => panic!("not a vector: {k:?}"), + } +} + +/// A two-point pen path, ended with `end`. +fn drawn(end: fn(&mut Session)) -> (Session, figcraft_doc::NodeId) { + let mut s = Session::new(); + s.set_tool(ToolId::Pen); + click(&mut s, 100.0, 100.0); + click(&mut s, 200.0, 100.0); + let id = s.tool.pen.as_ref().and_then(|p| p.id).unwrap(); + let undo = s.undo_depth().0; + end(&mut s); + assert!(s.tool.pen.is_none(), "the path ended"); + assert_eq!(s.undo_depth().0, undo + 1, "the path is one undo step"); + let ve = s.ds().unwrap().vector_edit.clone().expect("still editing the vector"); + assert_eq!((ve.id, ve.tool, ve.anchor), (id, VTool::Pen, None), "the pen, with no open end"); + (s, id) +} + +#[test] +fn escape_and_enter_keep_the_vector_in_edit_mode_with_the_pen() { + // Escape, and Enter (its key runs `pen_end`). + let ends: [fn(&mut Session); 2] = [|s| s.escape().unwrap(), |s| s.pen_end().unwrap()]; + for end in ends { + let (mut s, id) = drawn(end); + // The next path goes into the same layer, unconnected to the first. + click(&mut s, 100.0, 300.0); + click(&mut s, 200.0, 300.0); + assert_eq!(layers(&s), 1, "no new layer"); + assert_eq!(shape(&s, id), (4, 2), "two separate paths in one vector network"); + // Escape ends that path, the next one leaves edit mode. + s.escape().unwrap(); + assert!(s.ds().unwrap().vector_edit.is_some()); + s.escape().unwrap(); + assert!(s.ds().unwrap().vector_edit.is_none(), "the second Escape leaves edit mode"); + assert_eq!(s.ds().unwrap().selection, vec![id]); + } +} + +#[test] +fn escape_before_a_segment_leaves_nothing_to_edit() { + let mut s = Session::new(); + s.set_tool(ToolId::Pen); + click(&mut s, 100.0, 100.0); + s.escape().unwrap(); + assert!(s.tool.pen.is_none()); + assert!(s.ds().unwrap().vector_edit.is_none()); + assert_eq!(layers(&s), 0); +} diff --git a/crates/engine/src/tools.rs b/crates/engine/src/tools.rs index dbda1894b..a5b61ca2b 100644 --- a/crates/engine/src/tools.rs +++ b/crates/engine/src/tools.rs @@ -2051,13 +2051,7 @@ impl Session { if self.tool.pen.is_none() && let Some((id, v)) = selected_end_at(&doc, &self.selection(), ev.p(), 8.0 / ev.zoom.max(1e-6)) { - self.set_tool(ToolId::Move); - crate::vectoredit::begin(self, id)?; - crate::vectoredit::set_tool(self, crate::vectoredit::VTool::Pen)?; - return crate::vectoredit::set_state(self, |e| { - e.anchor = Some(v); - e.vertices = vec![v]; - }); + return self.pen_edit(id, Some(v)); } let pen = self.tool.pen.get_or_insert_with(PenPath::default); // Clicking the first anchor closes the path. @@ -2175,7 +2169,30 @@ impl Session { Ok(()) } - /// Finish the pen path (Enter/Escape/double-click). + /// Edit `id` as a vector with the pen, going on from point `anchor` (or, without one, starting + /// a new path in the same layer at the next click). + fn pen_edit(&mut self, id: NodeId, anchor: Option) -> Result<()> { + self.set_tool(ToolId::Move); + crate::vectoredit::begin(self, id)?; + crate::vectoredit::set_tool(self, crate::vectoredit::VTool::Pen)?; + crate::vectoredit::set_state(self, |e| { + e.anchor = anchor; + e.vertices = anchor.into_iter().collect(); + }) + } + + /// Enter/Escape while the pen draws: the path ends but its layer stays in edit mode with the + /// pen, so the next path joins the same vector (another Escape leaves edit mode). + pub fn pen_end(&mut self) -> Result<()> { + let id = self.tool.pen.as_ref().and_then(|p| p.id); + self.pen_finish()?; + match id { + Some(id) if self.doc()?.contains(id) => self.pen_edit(id, None), + _ => Ok(()), + } + } + + /// Finish the pen path (and keep the pen tool: double-click, Delete, a tool switch). pub fn pen_finish(&mut self) -> Result<()> { let pen = self.tool.pen.take(); self.tool.overlay.pen.clear(); @@ -2320,7 +2337,7 @@ impl Session { return Ok(()); } if self.tool.pen.is_some() { - return self.pen_finish(); + return self.pen_end(); } if self.tool.busy() { self.tool.gesture = Gesture::None; diff --git a/crates/engine/src/vectoredit.rs b/crates/engine/src/vectoredit.rs index f923de804..a3fbf803b 100644 --- a/crates/engine/src/vectoredit.rs +++ b/crates/engine/src/vectoredit.rs @@ -508,16 +508,15 @@ pub fn begin_many(s: &mut Session, ids: &[NodeId]) -> Result<()> { let before = s.ds()?.doc.clone(); let mut edited = Vec::new(); let mut first_err = None; - { - let doc = s.doc_mut()?; - for id in ids.iter().take(MAX_EDITED) { - if edited.contains(id) { - continue; - } - match ensure_vector(doc, *id) { - Ok(()) => edited.push(*id), - Err(e) => first_err = first_err.or(Some(e)), - } + for id in ids.iter().take(MAX_EDITED) { + if edited.contains(id) { + continue; + } + // Vectors are left untouched, so editing only them records no undo step. + let is_vector = before.node(*id).is_some_and(|n| matches!(n.kind, NodeKind::Vector { .. })); + match if is_vector { Ok(()) } else { ensure_vector(s.doc_mut()?, *id) } { + Ok(()) => edited.push(*id), + Err(e) => first_err = first_err.or(Some(e)), } } let Some((&id, rest)) = edited.split_first() else { diff --git a/crates/mcp/src/headless.rs b/crates/mcp/src/headless.rs index f3610c861..fcdb21a35 100644 --- a/crates/mcp/src/headless.rs +++ b/crates/mcp/src/headless.rs @@ -160,7 +160,7 @@ impl Headless { self.execute("text.edit.begin", &json!({"id": self.single_text()}))?; } "select.children" if self.session.tool.pen.is_some() => { - let _ = self.session.pen_finish(); + let _ = self.session.pen_end(); } // Enter on shapes edits them as vectors (several at once). "select.children" if self.vector_targets().is_some() => { diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index 09b2c57bb..7a38bc799 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -287,9 +287,9 @@ fn key_event(app: &mut FigApp, key: Key, physical: Option, m: Modifiers, re if m.is_none() && !repeat && opacity_digit(app, key, now) { return true; } - // Enter while the pen is drawing finishes it. + // Enter while the pen is drawing ends the path as Escape does. if key == Key::Enter && app.session.tool.pen.is_some() { - let _ = app.session.pen_finish(); + let _ = app.session.pen_end(); return true; } false diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 0cccf008c..2261cfd99 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-10-17 · **Change:** minor (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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (Escape or Enter after a pen path stays on the same vector (#760); 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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **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: @@ -81,7 +81,7 @@ interaction feel not yet compared. | Frame (presets panel, swap orientation), section, slice | done | | | 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`) | +| 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 or Enter 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`) | | 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); 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`). Not yet: the transform box around points of several layers; 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 | | @@ -172,6 +172,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Escape or Enter while the pen draws ends the path and keeps its vector in edit mode with the pen, so the next path is drawn into the same layer (unconnected); another Escape leaves edit mode (#760). Entering edit mode on a layer that already is a vector no longer records an empty undo step. Numbers unchanged | | 2026-10-17 | minor | The community batches #733, #735, #736, #729 and #753: submenus open after a short hover, keep their place along a safe triangle and reopen closed (main and context menus); the Actions palette's tabs, ranked search, keyboard highlight and recents; menu items that need a value ask for it, File ▸ Rename edits in place; Shift+I and Resources open Assets; a draggable Pages/Layers divider; Shift-drag moves the selection; a double-click near a thin stroke, merging dropped points and Flatten keeping open paths in vector editing; live font preview and the selection highlight after line breaks; the colour picker on a new fill or stroke; Paste over and Paste properties from the keyboard; Selection colors (partial: no library styles or variables there) and smart-selection spacing fields and canvas handles (partial: no reorder rings), both also checked by their author on macOS; the keyboard shortcuts panel closes on the home screen; Adwaita window controls on Wayland compositors without server decorations (checked by its author on GNOME; KDE not run). Checked in the app on Windows (submenus by their author), not side by side with Figma. Summary and hours unchanged | | 2026-10-15 | minor | Hex fields take CSS colour names (`red` → `FF0000`): fills, strokes, effects, grids, variables, backgrounds and the colour picker | | 2026-10-15 | minor | Typography: drag the line-height, letter-spacing and paragraph-spacing icons to scrub their values; shared numeric-field rates, resize cursor and one Undo step per gesture (#373). | From a672a6650fd8da3b5cfe043ecdaf60e624d16076 Mon Sep 17 00:00:00 2001 From: RealtaNua Date: Sat, 17 Oct 2026 23:23:25 +0700 Subject: [PATCH 199/817] fix(ui): glass settings: label the light intensity, keep labels in their fields (#256) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The glass effect's light intensity field had no label, and "Refraction 80%" and "Dispersion 50%" ran into the edge of their fields. The field is labelled "Intensity" in every catalog. Text labels of number fields take their measured width instead of 7 points per character, and a label too long for its field ends in "…" before the value, which is clipped to its own area. This changes every text-labelled number field: Latin labels sit a little tighter, CJK labels get their real width. Refs #256 ("There is one parameter that is not signed in the glass effect editing options. The inscriptions also go beyond their borders."). Co-Authored-By: Claude Opus 5.5 (1M context) --- crates/ui-egui/locales/cs.toml | 1 + crates/ui-egui/locales/de.toml | 1 + crates/ui-egui/locales/en.toml | 1 + crates/ui-egui/locales/es.toml | 1 + crates/ui-egui/locales/fr.toml | 1 + crates/ui-egui/locales/id.toml | 1 + crates/ui-egui/locales/ja.toml | 1 + crates/ui-egui/locales/ko.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/tr.toml | 1 + crates/ui-egui/locales/zh-Hans.toml | 1 + crates/ui-egui/src/field_tests.rs | 79 +++++++++++++++++++++++++++++ crates/ui-egui/src/right.rs | 2 +- crates/ui-egui/src/widgets.rs | 18 +++++-- 16 files changed, 106 insertions(+), 6 deletions(-) diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml index 7121548d0..980513149 100644 --- a/crates/ui-egui/locales/cs.toml +++ b/crates/ui-egui/locales/cs.toml @@ -634,6 +634,7 @@ status = "draft — needs native review" "Instance swap (no other component)" = "Výměna instance (žádná jiná komponenta)" "Instances" = "Instance" "Instant" = "Okamžitě" +"Intensity" = "Intenzita" "Interaction" = "Interakce" "Interactions" = "Interakce" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Návrh rozhraní a prototypování. Svobodný nástroj s otevřeným zdrojovým kódem, napsaný od základu v jazyce Rust nezávisle na kódu jiných produktů. Součást sady ArtCraft Crafting Apps." diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index 0362f897a..07669c1a7 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -619,6 +619,7 @@ status = "draft — needs native review" "Instance swap (no other component)" = "Instanztausch (keine andere Komponente)" "Instances" = "Instanzen" "Instant" = "Sofort" +"Intensity" = "Intensität" "Interaction" = "Interaktion" "Interactions" = "Interaktionen" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Interface-Design und Prototyping. Ein kostenloses Open-Source-Designwerkzeug, als Clean-Room-Entwicklung von Grund auf in Rust geschrieben, Teil der ArtCraft Crafting Apps." diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 59b25d949..b8ae921eb 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -647,6 +647,7 @@ name = "English" "Instance swap (no other component)" = "Instance swap (no other component)" "Instances" = "Instances" "Instant" = "Instant" +"Intensity" = "Intensity" "Interaction" = "Interaction" "Interactions" = "Interactions" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 01c5813bd..405c9836a 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -648,6 +648,7 @@ status = "draft — needs native review" "Instance swap (no other component)" = "Intercambio de instancia (no hay otro componente)" "Instances" = "Instancias" "Instant" = "Instantánea" +"Intensity" = "Intensidad" "Interaction" = "Interacción" "Interactions" = "Interacciones" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Diseño de interfaces y prototipos. Una herramienta de diseño gratuita y de código abierto, de implementación independiente (clean-room), escrita desde cero en Rust, parte de las Crafting Apps de ArtCraft." diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 17a0d60bf..5eb84e9eb 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -615,6 +615,7 @@ status = "draft — needs native review" "Instance swap (no other component)" = "Permutation d’instance (aucun autre composant)" "Instances" = "Instances" "Instant" = "Instantané" +"Intensity" = "Intensité" "Interaction" = "Interaction" "Interactions" = "Interactions" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Design d’interfaces et prototypage. Un outil de design libre et gratuit, développé en salle blanche (clean-room) et écrit de zéro en Rust, membre des Crafting Apps d’ArtCraft." diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml index a01944fde..65a9939cb 100644 --- a/crates/ui-egui/locales/id.toml +++ b/crates/ui-egui/locales/id.toml @@ -638,6 +638,7 @@ status = "draft — needs native review" "Instance swap (no other component)" = "Tukar instance (tidak ada component lain)" "Instances" = "Instance" "Instant" = "Instan" +"Intensity" = "Intensitas" "Interaction" = "Interaksi" "Interactions" = "Interaksi" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Desain antarmuka dan prototyping. Alat desain clean-room gratis dan open-source yang ditulis dari nol dengan Rust, bagian dari ArtCraft Crafting Apps." diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index 965f8ead4..def8ebc47 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -643,6 +643,7 @@ status = "draft — needs native review" "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 の一つ。" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index 649fc26c9..3e1916233 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -615,6 +615,7 @@ status = "draft — needs native review" "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의 하나." diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index c31b69476..aabc8806b 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -614,6 +614,7 @@ status = "draft — needs native review" "Instance swap (no other component)" = "Troca de instância (nenhum outro componente)" "Instances" = "Instâncias" "Instant" = "Instantâneo" +"Intensity" = "Intensidade" "Interaction" = "Interação" "Interactions" = "Interações" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Design de interfaces e prototipagem. Uma ferramenta de design gratuita e de código aberto, com implementação independente (clean-room), escrita do zero em Rust, parte dos Crafting Apps da ArtCraft." diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 998eefdae..7ec18507a 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -635,6 +635,7 @@ name = "Русский" "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." diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index eea2d3126..d57bb25a5 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -645,6 +645,7 @@ name = "Svenska" "Instance swap (no other component)" = "Instansbyte (ingen annan komponent)" "Instances" = "Instanser" "Instant" = "Direkt" +"Intensity" = "Intensitet" "Interaction" = "Interaktion" "Interactions" = "Interaktioner" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Gränssnittsdesign och prototyper. Ett fritt clean-room-designverktyg med öppen källkod, skrivet från grunden i Rust och en del av ArtCraft Crafting Apps." diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml index 1695864cd..a9da62ef1 100644 --- a/crates/ui-egui/locales/tr.toml +++ b/crates/ui-egui/locales/tr.toml @@ -638,6 +638,7 @@ name = "Türkçe" "Instance swap (no other component)" = "Örnek değiştirme (başka bileşen yok)" "Instances" = "Örnekler" "Instant" = "Anında" +"Intensity" = "Yoğunluk" "Interaction" = "Etkileşim" "Interactions" = "Etkileşimler" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Arayüz tasarımı ve prototipleme. Rust ile sıfırdan yazılmış, ücretsiz, açık kaynaklı, temiz oda yöntemiyle geliştirilmiş bir tasarım aracı; ArtCraft Crafting Apps ailesinin bir parçası." diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index 31be56110..a90c1c033 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -616,6 +616,7 @@ status = "draft — needs native review" "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 系列。" diff --git a/crates/ui-egui/src/field_tests.rs b/crates/ui-egui/src/field_tests.rs index 492fdc018..141589721 100644 --- a/crates/ui-egui/src/field_tests.rs +++ b/crates/ui-egui/src/field_tests.rs @@ -473,3 +473,82 @@ fn scrubbing_the_scale_panel_width_scales_live_in_one_undo_step() { let (_, _, w, h) = geom(&u, a); assert_eq!((w, h, undo_steps(&u)), (60.0, 45.0, steps + 1), "40×30 scaled to a width of 60"); } + +/// 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)> { + fn walk(shape: &egui::Shape, clip: egui::Rect, out: &mut Vec<(String, bool, egui::Rect)>) { + match shape { + egui::Shape::Vec(v) => v.iter().for_each(|s| walk(s, clip, out)), + egui::Shape::Text(t) => out.push((t.galley.text().to_string(), t.galley.elided, t.visual_bounding_rect().intersect(clip))), + _ => {} + } + } + let mut out = Vec::new(); + shapes.iter().for_each(|c| walk(&c.shape, c.clip_rect, &mut out)); + out +} + +/// The glass effect's light intensity field is labelled (#256): drawn in the Design panel with the +/// effect's settings open. +#[test] +fn the_glass_light_intensity_field_has_a_label() { + let mut s = Session::new(); + let r = NodeId(s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 100, "height": 80})).unwrap()["id"].as_u64().unwrap()); + s.execute("select.set", &json!({"ids": [r]})).unwrap(); + s.execute("effect.add", &json!({"type": "glass"})).unwrap(); + let mut u = Ui::new(s); + u.ctx.data_mut(|d| d.insert_temp(Id::new(("fx_open", 0usize)), true)); + u.frame(vec![]); + let shapes = u.frame_output(vec![]).shapes; + let lead = u.ctx.read_response(Id::new(("fx_gi", 0usize)).with("lead")).expect("the intensity field is shown").rect; + let labels: Vec = painted_texts(&shapes).into_iter().filter(|(_, _, at)| lead.contains(at.center())).map(|(text, ..)| text).collect(); + assert_eq!(labels, ["Intensity"]); +} + +/// A glass settings field's width in the Design panel at its default width. +const GLASS_FIELD_W: f32 = 98.0; + +/// The glass settings' labels leave their values room in every language, and are cut only when +/// they would crowd them (#256). +#[test] +fn glass_labels_fit_beside_their_values_in_every_language() { + use crate::i18n::{self, Text}; + let keys = ["Light|glass", "Intensity", "Refraction", "Depth", "Dispersion", "Frost", "Splay"]; + let ctx = egui::Context::default(); + let mut out = ctx.run_ui(Default::default(), |ui| { + let width = |s: &str| ui.painter().layout_no_wrap(s.to_string(), crate::theme::regular(11.0), egui::Color32::WHITE).size().x; + for lang in i18n::languages() { + for key in keys { + let label = lang.ui.iter().find(|(k, _)| *k == key).map_or(key, |(_, t)| match t { + Text::Plain(s) | Text::Plural { other: s, .. } => s, + }); + let (lead, value) = (crate::widgets::text_lead_width(ui, label, GLASS_FIELD_W), width("100%")); + assert!(lead + value <= GLASS_FIELD_W, "{}: no room for the value beside {label:?}", lang.code); + // Cut off only when it would crowd the value's 32 points (es "Profundidad"). + if 12.0 + width(label) <= GLASS_FIELD_W - 32.0 { + assert!(lead >= 12.0 + width(label), "{}: {label:?} is cut off", lang.code); + } + } + } + }); + out.textures_delta.clear(); +} + +#[test] +fn a_label_too_long_for_its_field_ends_in_an_ellipsis_before_the_value() { + let ctx = egui::Context::default(); + let mut field = egui::Rect::NOTHING; + let mut out = ctx.run_ui(Default::default(), |ui| { + let lead = crate::widgets::Lead::Text("A label much wider than its field"); + let _ = crate::widgets::number_field(ui, Id::new("long"), lead, Some(80.0), "%", 60.0, 1.0); + field = ui.min_rect(); + }); + out.textures_delta.clear(); + let texts = painted_texts(&out.shapes); + let [(_, label_cut, l), (value, value_cut, v)] = texts.as_slice() else { panic!("the label and the value: {texts:?}") }; + assert!(*label_cut, "the label ends in an ellipsis"); + assert_eq!((value.as_str(), *value_cut), ("80%", false), "the value shows whole"); + assert!(field.contains_rect(*l) && field.contains_rect(*v), "both inside the field {field:?}: {l:?} {v:?}"); + assert!(l.max.x < v.min.x, "the label stops before the value: {l:?} {v:?}"); +} diff --git a/crates/ui-egui/src/right.rs b/crates/ui-egui/src/right.rs index 47f3e5d36..31272ff2c 100644 --- a/crates/ui-egui/src/right.rs +++ b/crates/ui-egui/src/right.rs @@ -1887,7 +1887,7 @@ fn effect_settings(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], i: usize, e: & row(ui, 32.0, |ui| { let ed = widgets::number_field(ui, Id::new(("fx_gl", i)), Lead::Text(tr("Light|glass")), Some(g.light_angle.round()), "°", half, 1.0); edit(app, ed, &|v| with(&|gl| gl.light_angle = v.clamp(-180.0, 180.0))); - let ed = widgets::number_field(ui, Id::new(("fx_gi", i)), Lead::None, pct(g.light_intensity), "%", half, 1.0); + let ed = widgets::number_field(ui, Id::new(("fx_gi", i)), Lead::Text(tr("Intensity")), pct(g.light_intensity), "%", half, 1.0); edit(app, ed, &|v| with(&|gl| gl.light_intensity = unit(v))); }); row(ui, 32.0, |ui| { diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index b44135454..4763b47c9 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -202,7 +202,7 @@ fn number_field_impl( let mut out: Option = None; let lead_w = match lead { Lead::None | Lead::Named(_) => 6.0, - Lead::Text(s) => (12.0 + s.chars().count() as f32 * 7.0).max(24.0), + Lead::Text(s) => text_lead_width(ui, s, width), Lead::Icon(..) => 24.0, }; let lead_rect = Rect::from_min_size(rect.min, vec2(lead_w, FIELD_H)); @@ -223,7 +223,7 @@ fn number_field_impl( } match lead { Lead::Text(s) => { - ui.painter().text(pos2(lead_rect.min.x + 8.0, rect.center().y), Align2::LEFT_CENTER, s, regular(11.0), t.text_secondary); + crate::bidi::paint_name(ui.painter(), pos2(lead_rect.min.x + 8.0, rect.center().y), s, regular(11.0), t.text_secondary, lead_w - 12.0); } Lead::Icon(i, _) => { icons::paint(ui.painter(), Rect::from_center_size(lead_rect.center() + vec2(1.0, 0.0), vec2(14.0, 14.0)), i, t.icon_secondary) @@ -347,7 +347,7 @@ fn number_field_impl( None => empty.to_string(), }; let col = if value.is_some() { t.text } else { t.text_secondary }; - ui.painter().text(pos2(edit_rect.min.x, rect.center().y), Align2::LEFT_CENTER, s, regular(11.0), col); + ui.painter().with_clip_rect(edit_rect).text(pos2(edit_rect.min.x, rect.center().y), Align2::LEFT_CENTER, s, regular(11.0), col); } } // The variable button shows while the pointer is over a bindable field. @@ -369,6 +369,13 @@ fn number_field_impl( (out, bind) } +/// The width a text label takes at the start of a field `field_w` wide: the label as drawn plus +/// its padding, leaving the value room for a few characters (a longer label ends in an ellipsis). +pub(crate) fn text_lead_width(ui: &Ui, label: &str, field_w: f32) -> f32 { + let text = ui.painter().layout_no_wrap(label.to_string(), regular(11.0), Color32::PLACEHOLDER).size().x; + (12.0 + text).min(field_w - 32.0).max(24.0) +} + /// A field bound to a variable: the lead, then the variable's name in a chip; the chip opens the /// picker and the detach button unbinds. /// A field showing the variable `name` bound to it in `rect`: click to change, detach to unbind. @@ -383,8 +390,9 @@ pub fn bound_field(ui: &mut Ui, id: Id, lead: Lead, rect: Rect, name: &str) -> O let lead_w = match lead { Lead::None | Lead::Named(_) => 4.0, Lead::Text(s) => { - ui.painter().text(pos2(rect.min.x + 8.0, rect.center().y), Align2::LEFT_CENTER, s, regular(11.0), t.text_secondary); - (12.0 + s.chars().count() as f32 * 7.0).max(24.0) + let w = text_lead_width(ui, s, rect.width()); + crate::bidi::paint_name(ui.painter(), pos2(rect.min.x + 8.0, rect.center().y), s, regular(11.0), t.text_secondary, w - 12.0); + w } Lead::Icon(i, _) => { icons::paint(ui.painter(), Rect::from_center_size(pos2(rect.min.x + 13.0, rect.center().y), vec2(14.0, 14.0)), i, t.icon_secondary); From 1c16aeae094e81ad08a399e05cb4f3cb3ed5c59d Mon Sep 17 00:00:00 2001 From: RealtaNua Date: Sat, 17 Oct 2026 23:25:51 +0700 Subject: [PATCH 200/817] fix(canvas): the Pencil previews its stroke in its own colour and weight (#256) While drawing, the Pencil previewed its stroke in the theme's text colour, 2 points wide: white in dark theme, so over a white shape nothing showed until the mouse was let go. The preview now uses the colour and weight the Pencil draws with (one constant, PENCIL_STROKE, black at 2 pt), scaled by the zoom, at least 1 pt. It doesn't show pen pressure or a brush, which only the finished vector has. Refs #256 ("The 'draw' tool is not visible when you are drawing. You can see it after you release the mouse."). Co-Authored-By: Claude Opus 5.5 (1M context) --- crates/engine/src/tools.rs | 7 +++-- crates/ui-egui/src/canvas.rs | 4 ++- crates/ui-egui/src/canvas_fixes_tests.rs | 33 ++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/tools.rs b/crates/engine/src/tools.rs index dbda1894b..2674552e9 100644 --- a/crates/engine/src/tools.rs +++ b/crates/engine/src/tools.rs @@ -661,6 +661,9 @@ fn on_corner_square(doc: &Document, sel: &[NodeId], p: Point, zoom: f64) -> bool /// handles: the canvas draws just its outline (the handles still answer just outside it). pub const SMALL_BOX_PX: f64 = 16.0; +/// The stroke the Pencil draws: its colour and weight (the canvas previews it the same). +pub const PENCIL_STROKE: (figcraft_color::Color, f64) = (figcraft_color::Color::BLACK, 2.0); + /// The shorter and longer sides, in screen pixels, of the box with `corners` (tl, tr, br, bl). pub fn box_sides_px(corners: &[Point; 4], zoom: f64) -> (f64, f64) { let [a, b, _, d] = corners; @@ -2210,8 +2213,8 @@ impl Session { let mut local = fitted.clone(); local.apply_affine(pw.inverse()); let _ = d; - let mut props = - json!({"fills": [], "strokes": ["#000000"], "strokeWeight": 2, "strokeCap": "round", "strokeJoin": "round", "strokeAlign": "center"}); + let (color, weight) = PENCIL_STROKE; + let mut props = json!({"fills": [], "strokes": [color.to_css_hex()], "strokeWeight": weight, "strokeCap": "round", "strokeJoin": "round", "strokeAlign": "center"}); // Pen pressure becomes the stroke's width profile (brushes follow it too). if let Some(points) = pressure_profile(points, pressure) { props["widthProfile"] = json!(points); diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index bc1842704..d7928b76a 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -1128,7 +1128,9 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ if !ov.pen.is_empty() { let pts: Vec = ov.pen.iter().map(|[x, y]| app.to_screen(*x, *y)).collect(); if app.session.tool.tool == ToolId::Pencil { - painter.add(Shape::line(pts, stroke(t.text, 2.0))); + // The stroke it will make, in its colour and weight (at least a point when zoomed out). + let (color, weight) = figcraft_engine::tools::PENCIL_STROKE; + painter.add(Shape::line(pts, stroke(doc_c32(painter.ctx(), color), ((weight * zoom) as f32).max(1.0)))); } else { for [x0, y0, x1, y1] in &ov.pen_handles { bezier_handle(painter, app.to_screen(*x0, *y0), app.to_screen(*x1, *y1), 3.5, Color32::WHITE); diff --git a/crates/ui-egui/src/canvas_fixes_tests.rs b/crates/ui-egui/src/canvas_fixes_tests.rs index 3b593daef..4cd32d565 100644 --- a/crates/ui-egui/src/canvas_fixes_tests.rs +++ b/crates/ui-egui/src/canvas_fixes_tests.rs @@ -128,3 +128,36 @@ fn the_pen_draws_the_handles_of_the_point_being_dragged_and_a_curved_band() { let band = shapes.iter().any(|s| matches!(s, Shape::CubicBezier(c) if c.points[0].distance(a) < 0.5 && c.points[1].distance(at(&u, 140.0, 100.0)) < 0.5 && c.stroke.color == accent)); assert!(band, "a curve leaving along the out handle"); } + +/// While drawing, the Pencil shows the stroke it will make, in its colour and weight (#256): in a +/// dark theme the theme's text colour was white, so over a white shape nothing showed until the +/// stroke was let go. +#[test] +fn the_pencil_previews_its_stroke_in_its_colour_and_weight() { + let mut u = Ui::new(Session::new()); + u.app.run("tool.set", json!({"tool": "pencil"})); + let (color, weight) = figcraft_engine::tools::PENCIL_STROKE; + let preview = |shapes: &[Shape]| { + shapes.iter().find_map(|s| match s { + Shape::Path(p) if !p.closed && p.points.len() >= 3 && p.stroke.color == egui::epaint::ColorMode::Solid(crate::theme::c32(color)) => { + Some(p.stroke.width) + } + _ => None, + }) + }; + let at = |u: &Ui, x: f64, y: f64| u.app.to_screen(x, y); + let start = at(&u, 10.0, 10.0); + u.button(start, true); + for i in 1..=6 { + let p = at(&u, 10.0 + 12.0 * f64::from(i), 10.0 + 6.0 * f64::from(i % 2)); + u.frame(vec![egui::Event::PointerMoved(p)]); + } + let zoom = u.app.session.ds().unwrap().view.zoom; + let w = preview(&flat(&u.frame_output(vec![]).shapes)).expect("a preview while drawing"); + assert!((w - (weight * zoom) as f32).abs() < 0.01, "{w} for {weight} at {zoom}"); + // Zoomed far out it stays visible. + u.app.session.ds_mut().unwrap().view.zoom = 0.05; + let p = at(&u, 120.0, 40.0); + let w = preview(&flat(&u.frame_output(vec![egui::Event::PointerMoved(p)]).shapes)).expect("still previewing"); + assert!((w - 1.0).abs() < 0.01, "at least a point: {w}"); +} From e03c2a65f7a28e43a18e6bb0196e9c3a8ad14bca Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 23:43:32 +0700 Subject: [PATCH 201/817] #766: check a label before a widget's clickable part on a double-click --- crates/engine/src/tools.rs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/crates/engine/src/tools.rs b/crates/engine/src/tools.rs index dba3eaf7e..d5485c9c8 100644 --- a/crates/engine/src/tools.rs +++ b/crates/engine/src/tools.rs @@ -1859,6 +1859,20 @@ impl Session { if self.tool.tool == ToolId::Pen { return self.pen_finish(); } + // A frame's or section's name label: rename it there (the canvas puts a field over it). + // Labels come before widgets, as on a press; the second press began a move: undo it. + if matches!(self.tool.tool, ToolId::Move | ToolId::Scale) + && !(ev.shift || ev.cmd || ev.alt) + && let Some(id) = label_at(&doc, page, &self.tool.labels, ev.p()) + { + self.tool.gesture = Gesture::None; + self.cancel_interaction()?; + if sel != [id] { + self.set_selection(vec![id]); + } + self.request_ui("canvas.renameLabel", serde_json::json!({"id": id})); + return Ok(()); + } // Quick clicks on a widget's clickable part are clicks, one by one. if matches!(self.tool.tool, ToolId::Move | ToolId::Scale) && !(ev.shift || ev.cmd || ev.alt) @@ -1875,17 +1889,6 @@ impl Session { self.tool.overlay.marquee = None; self.cancel_interaction()?; } - // A frame's or section's name label: rename it there (the canvas puts a field over it). - if matches!(self.tool.tool, ToolId::Move | ToolId::Scale) - && !(ev.shift || ev.cmd || ev.alt) - && let Some(id) = label_at(&doc, page, &self.tool.labels, ev.p()) - { - if sel != [id] { - self.set_selection(vec![id]); - } - self.request_ui("canvas.renameLabel", serde_json::json!({"id": id})); - return Ok(()); - } let Some(leaf) = self.hit(&doc, page, ev.p(), ev.tol() * 2.0) else { return Ok(()) }; let target = select_target(&doc, leaf, &sel, true); // Text: edit at the click. From f33ffb4367af045b202afac6024e01c06cbdb29e Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 23:43:58 +0700 Subject: [PATCH 202/817] #766: keep the label rename in layers::Rename like the layers panel --- crates/ui-egui/src/frame_label_tests.rs | 4 ++-- crates/ui-egui/src/frame_labels.rs | 27 +++++++++---------------- crates/ui-egui/src/lib.rs | 9 +++------ 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/crates/ui-egui/src/frame_label_tests.rs b/crates/ui-egui/src/frame_label_tests.rs index d7f2371ab..dbb981bd1 100644 --- a/crates/ui-egui/src/frame_label_tests.rs +++ b/crates/ui-egui/src/frame_label_tests.rs @@ -108,7 +108,7 @@ fn double_clicking_a_label_renames_the_frame_there() { let before = u.app.session.doc().unwrap().world_bounds(a).unwrap(); double_click_label(&mut u, a); assert_eq!(u.app.session.selection(), vec![a]); - assert_eq!(u.app.ui.rename_label.map(|r| r.0), Some(a), "a field over the label"); + assert_eq!(u.app.ui.rename_label.map(|r| r.id), Some(a), "a field over the label"); // The name starts selected: typing replaces it, Enter keeps it. u.frame(vec![Event::Text("Sign in".into())]); u.frame(key(egui::Key::Enter)); @@ -127,7 +127,7 @@ fn double_clicking_a_label_renames_the_frame_there() { fn escape_leaves_a_label_rename_with_the_old_name() { let (mut u, _, b) = setup(); double_click_label(&mut u, b); - assert_eq!(u.app.ui.rename_label.map(|r| r.0), Some(b), "rotated labels rename too"); + assert_eq!(u.app.ui.rename_label.map(|r| r.id), Some(b), "rotated labels rename too"); u.frame(vec![Event::Text("Nope".into())]); u.frame(key(egui::Key::Escape)); u.frame(vec![]); diff --git a/crates/ui-egui/src/frame_labels.rs b/crates/ui-egui/src/frame_labels.rs index 43dd712db..79557141e 100644 --- a/crates/ui-egui/src/frame_labels.rs +++ b/crates/ui-egui/src/frame_labels.rs @@ -151,18 +151,13 @@ pub fn draw(app: &FigApp, painter: &Painter, t: &Tokens, doc: &Document, id: Nod Some([area.left_top(), area.right_top(), area.right_bottom(), area.left_bottom()].map(|p| tl + rot * (p - tl))) } -/// Rename `id`'s name label on the canvas: a field over the label from the next frame on. -pub fn start_rename(app: &mut FigApp, id: NodeId) { - // The field takes the focus once it's drawn (as the pages list does). - app.ui.rename_label = Some((id, true)); -} - -/// The field over a label being renamed (see [`start_rename`]): Enter or a click elsewhere -/// renames the layer, Escape keeps the name. +/// The field over a frame's or section's name label being renamed (`UiState::rename_label`, from a +/// double-click on the label): Enter or a click elsewhere renames the layer, Escape keeps the name. +/// The rename ends when the field lets go of the keyboard or the label is gone. pub fn rename_field(app: &mut FigApp, ui: &mut egui::Ui) { - let Some((id, start)) = app.ui.rename_label else { return }; - let quad = app.session.tool.labels.iter().find(|(i, _)| *i == id).map(|(_, q)| q.map(|p| app.to_screen(p.x, p.y))); - let name = app.session.doc().ok().and_then(|d| d.node(id)).map(|n| n.name.clone()); + let Some(r) = app.ui.rename_label else { return }; + let quad = app.session.tool.labels.iter().find(|(i, _)| *i == r.id).map(|(_, q)| q.map(|p| app.to_screen(p.x, p.y))); + let name = app.session.doc().ok().and_then(|d| d.node(r.id)).map(|n| n.name.clone()); let (Some(quad), Some(name)) = (quad, name) else { app.ui.rename_label = None; return; @@ -171,14 +166,10 @@ pub fn rename_field(app: &mut FigApp, ui: &mut egui::Ui) { let font = regular(11.0); let text_w = ui.painter().layout_no_wrap(name.clone(), font.clone(), Color32::WHITE).size().x; let rect = Rect::from_min_size(pos2(area.min.x, area.max.y - 16.0), vec2((text_w + 24.0).max(area.width()).clamp(80.0, 480.0), 16.0)); - let (done, open) = crate::widgets::rename_field(ui, egui::Id::new(("frame_label_rename", id)), &name, rect, font, start); + let (done, open) = crate::widgets::rename_field(ui, egui::Id::new(("frame_label_rename", r.id)), &name, rect, font, r.start); + app.ui.rename_label = open.then_some(crate::layers::Rename { id: r.id, start: false }); if let Some(new) = done { - app.ui.rename_label = None; - app.run("object.rename", serde_json::json!({"ids": [id], "name": new})); - } else if !open && !start { - app.ui.rename_label = None; - } else { - app.ui.rename_label = Some((id, false)); + app.run("object.rename", serde_json::json!({"ids": [r.id], "name": new})); } } diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 6141b3dd8..80a4b784d 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -430,9 +430,8 @@ pub struct UiState { /// The layer being renamed in the layers panel. pub rename: Option, pub rename_page: Option<(NodeId, String)>, - /// The frame or section whose name label on the canvas is being renamed (a double-click on - /// it), and whether the rename just started (its field takes the keyboard when next drawn). - pub rename_label: Option<(NodeId, bool)>, + /// The frame or section whose name label on the canvas is being renamed (a double-click on it). + pub rename_label: Option, pub main_menu: bool, pub palette: Option, /// The Actions palette's tab. @@ -966,9 +965,7 @@ impl FigApp { "contextMenu" => self.ui.key_menu = true, "selectArea" => self.start_key_box(), "canvas.renameLabel" => { - if let Some(id) = r.data.get("id").and_then(figcraft_engine::params::id_of) { - frame_labels::start_rename(self, id); - } + self.ui.rename_label = r.data.get("id").and_then(figcraft_engine::params::id_of).map(|id| layers::Rename { id, start: true }); } "layers.rename" => { let ids: Vec = From a7da760f9c21d9ec48b58e699cafae538f0f880e Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 23:44:41 +0700 Subject: [PATCH 203/817] #766: drop the progress-doc edits (the maintainer adds those) --- docs/roadmap.md | 1 - docs/ui-parity.md | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/roadmap.md b/docs/roadmap.md index b89f18423..8d63a4692 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -73,7 +73,6 @@ blockers. | Date | Change | Summary | |---|---|---| -| 2026-10-17 | minor | M1: double-clicking a frame's or section's name on the canvas renames it in place (#757; Enter commits, Escape cancels, one undo step). Numbers unchanged | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index d2b3c9e2a..0cccf008c 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-10-17 · **Change:** minor (renaming a frame or section from its name on the canvas (#757); 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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **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: @@ -98,7 +98,7 @@ interaction feel not yet compared. |---|---|---| | Pan/zoom: wheel, pinch, Space-drag, Shift+0/1/2, Cmd+0, `+`/`-` | done | Shift-wheel pans sideways, pinch and the zoom tool keep the point under the pointer; zoom steps, limits (2%–25,600%) and frame order pinned where the documentation is silent (`view_behaviour_tests`) | | Rulers and guides (drag out, move, remove; rotated frames; frame guides) | done | guides belong to the page or a top-level frame (a frame moved into another keeps its guides but they stop applying); a click selects one for Delete, the arrows or the context menu's Remove guide; Alt-drag drops a copy; Alt while dragging measures to the layers in the frame it crosses; ruler numbering checked by eye only | -| Frame labels (rotated, right-to-left), size badge | done | double-click a frame's or section's name to rename it in place: Enter or a click elsewhere keeps the name, Escape restores it, one undo step (#757, `frame_label_tests`) | +| Frame labels (rotated, right-to-left), size badge | done | | | Outline mode | done | Outlines, outlines for the selection, mask outlines, frame outlines; shapes are clicked on their outlines, reaching layers behind; View ▸ Outlines ▸ Include hidden layers (`view.outlinesHiddenLayers`) outlines hidden layers too and Include object bounds (`view.outlinesObjectBounds`) draws the box of every layer whose outline isn't its box (groups, text, ellipses, vectors); what either draws can be clicked there (a hidden layer on its outline, a group on its box) and nothing else can; both are view settings like the other outline flags (per file, off in a new one, checked in the menu); the lines are light on a dark page (`outline_options_tests`). The main menu now shows a check mark beside every View toggle that is on | | Slices shown on the canvas (View ▸ Slices) | done | dashed rectangles | | Dragging a layer inside a group keeps it in the group | done | frames and auto layout take other drops | @@ -172,7 +172,6 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| -| 2026-10-17 | minor | Frame and section names on the canvas rename on a double-click (#757): a field over the label with the name selected; Enter or a click elsewhere commits (`object.rename`, one undo step), Escape cancels. Rotated labels too. Not compared side by side with Figma | | 2026-10-17 | minor | The community batches #733, #735, #736, #729 and #753: submenus open after a short hover, keep their place along a safe triangle and reopen closed (main and context menus); the Actions palette's tabs, ranked search, keyboard highlight and recents; menu items that need a value ask for it, File ▸ Rename edits in place; Shift+I and Resources open Assets; a draggable Pages/Layers divider; Shift-drag moves the selection; a double-click near a thin stroke, merging dropped points and Flatten keeping open paths in vector editing; live font preview and the selection highlight after line breaks; the colour picker on a new fill or stroke; Paste over and Paste properties from the keyboard; Selection colors (partial: no library styles or variables there) and smart-selection spacing fields and canvas handles (partial: no reorder rings), both also checked by their author on macOS; the keyboard shortcuts panel closes on the home screen; Adwaita window controls on Wayland compositors without server decorations (checked by its author on GNOME; KDE not run). Checked in the app on Windows (submenus by their author), not side by side with Figma. Summary and hours unchanged | | 2026-10-15 | minor | Hex fields take CSS colour names (`red` → `FF0000`): fills, strokes, effects, grids, variables, backgrounds and the colour picker | | 2026-10-15 | minor | Typography: drag the line-height, letter-spacing and paragraph-spacing icons to scrub their values; shared numeric-field rates, resize cursor and one Undo step per gesture (#373). | From 76f0edce08dec541c8f266971608dbdb6891d890 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 17 Oct 2026 23:44:41 +0700 Subject: [PATCH 204/817] #766: port the engine test, a section and click-elsewhere UI case, and the control-protocol note --- crates/engine/src/frame_label_tests.rs | 24 +++++++++++++++++++++++- crates/ui-egui/src/frame_label_tests.rs | 24 +++++++++++++++++++++++- docs/control-protocol.md | 3 ++- 3 files changed, 48 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/frame_label_tests.rs b/crates/engine/src/frame_label_tests.rs index 8e9ede7ba..3da9522fc 100644 --- a/crates/engine/src/frame_label_tests.rs +++ b/crates/engine/src/frame_label_tests.rs @@ -1,6 +1,7 @@ //! Frame name labels as pointer targets: a press on a label (its area as the canvas drew it, //! turned with a rotated frame) selects the frame and drags it in one undo step, hovering it -//! highlights the frame, and labels of locked, hidden, deleted or other pages' frames do nothing. +//! highlights the frame, a double-click asks the UI to rename it there, and labels of locked, +//! hidden, deleted or other pages' frames do nothing. use figcraft_doc::NodeId; use figcraft_geom::Point; @@ -90,3 +91,24 @@ fn labels_of_frames_that_cant_be_picked_do_nothing() { let flat = [Point::new(1.0, 1.0); 4]; assert_eq!(label_at(s.doc().unwrap(), page, &[(f, nan), (f, flat)], Point::new(1.0, 1.0)), None); } + +#[test] +fn double_clicking_a_label_asks_to_rename_its_frame() { + let (mut s, f, q) = setup(); + let c = center(&q); + let before = s.doc().unwrap().world_bounds(f).unwrap(); + let undo = s.ds().unwrap().history.undo.len(); + for kind in [PointerKind::Down, PointerKind::Up, PointerKind::Down, PointerKind::DoubleClick] { + s.pointer(&ev(kind, c)).unwrap(); + } + assert_eq!(s.selection(), vec![f]); + let asked = s.ui_requests.iter().find(|r| r.kind == "canvas.renameLabel").map(|r| id_of(&r.data["id"])); + assert_eq!(asked, Some(Some(f)), "the UI renames the frame at its label"); + assert_eq!(s.doc().unwrap().world_bounds(f), Some(before), "not moved"); + assert_eq!(s.ds().unwrap().history.undo.len(), undo, "nothing to undo yet"); + // Other tools ignore the label. + s.ui_requests.clear(); + s.set_tool(crate::tools::ToolId::Hand); + s.pointer(&ev(PointerKind::DoubleClick, c)).unwrap(); + assert!(s.ui_requests.iter().all(|r| r.kind != "canvas.renameLabel")); +} diff --git a/crates/ui-egui/src/frame_label_tests.rs b/crates/ui-egui/src/frame_label_tests.rs index dbb981bd1..687669e87 100644 --- a/crates/ui-egui/src/frame_label_tests.rs +++ b/crates/ui-egui/src/frame_label_tests.rs @@ -1,6 +1,6 @@ //! Frame name labels on the canvas, driven through egui headless: an upright frame's label sits //! just above its top-left corner, a rotated frame's runs along its turned top edge, and pressing -//! either label selects and drags its frame. +//! either label selects and drags its frame; double-clicking one renames the frame or section there. use egui::{Event, Pos2, pos2, vec2}; use figcraft_doc::NodeId; @@ -134,3 +134,25 @@ fn escape_leaves_a_label_rename_with_the_old_name() { assert_eq!(name(&u, b), "Turned"); assert!(u.app.ui.rename_label.is_none()); } + +#[test] +fn a_sections_label_renames_it_and_a_click_elsewhere_commits() { + let mut s = Session::new(); + let a = id(s.execute("node.create", &json!({"type": "section", "x": 0, "y": 0, "width": 300, "height": 200, "name": "Area"})).unwrap()); + s.execute("select.none", &json!({})).unwrap(); + let mut u = Ui::new(s); + u.frame(vec![]); + let undo = u.app.session.ds().unwrap().history.undo.len(); + double_click_label(&mut u, a); + assert_eq!(u.app.ui.rename_label.map(|r| r.id), Some(a), "a field over the section's label"); + assert_eq!(u.app.session.selection(), vec![a]); + u.frame(vec![Event::Text("Zone".into())]); + let at = mid(&label(&u, a)); + let away = pos2(at.x + 200.0, at.y + 500.0); + u.button(away, true); + u.button(away, false); + u.frame(vec![]); + assert_eq!(name(&u, a), "Zone", "a click on the canvas commits"); + assert!(u.app.ui.rename_label.is_none()); + assert_eq!(u.app.session.ds().unwrap().history.undo.len(), undo + 1, "one undo step"); +} diff --git a/docs/control-protocol.md b/docs/control-protocol.md index 3a06874e6..0dc52a1e4 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -198,7 +198,8 @@ A mouse gesture with the current tool. `kind`: `down`, `move`, `up`, `click`, `d (`x`, `y`) or screen pixels (`sx`, `sy`). `pressure` (0–1) is pen pressure (the Pencil records it); a drag's pressure goes from `pressure` to `pressureTo`. Returns `{selection, tool}`. With the Move and Scale tools, a press on a frame's or section's name label (as the canvas last drew it, along a rotated -frame's top edge) selects and drags that frame. +frame's top edge) selects and drags that frame; a double-click there renames the frame in place in +the desktop app (the name field opens over the label). ```json {"id":4,"method":"engine.execute","params":{"command":"tool.set","params":{"tool":"ellipse"}}} From 7b9ebaacbb971fb4f4098156ecf67e2aaa7c8182 Mon Sep 17 00:00:00 2001 From: RealtaNua Date: Sat, 17 Oct 2026 23:50:48 +0700 Subject: [PATCH 205/817] =?UTF-8?q?fix(ui):=20fitting=20Intensity=20transl?= =?UTF-8?q?ations;=20cut=20values=20end=20in=20"=E2=80=A6",=20cut=20labels?= =?UTF-8?q?=20show=20on=20hover=20(#256)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From review: - ru and pt-BR "Intensity" were too long for the glass field and ended in "…"; they are now "Яркость" and "Brilho", which fit. - A value too long for its field ends in "…" instead of being clipped, so "100000" never shows as "10". - A label cut short shows whole on hover. - The every-language test now checks the Intensity label fits whole in each catalog (it fails with the old ru translation); the panel test checks the label isn't cut and that the field is the 98.5 points the language test measures against. Co-Authored-By: Claude Opus 5.5 (1M context) --- crates/ui-egui/locales/pt-BR.toml | 2 +- crates/ui-egui/locales/ru.toml | 2 +- crates/ui-egui/src/field_tests.rs | 33 ++++++++++++++----------------- crates/ui-egui/src/widgets.rs | 10 ++++++++-- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index aabc8806b..d970db144 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -614,7 +614,7 @@ status = "draft — needs native review" "Instance swap (no other component)" = "Troca de instância (nenhum outro componente)" "Instances" = "Instâncias" "Instant" = "Instantâneo" -"Intensity" = "Intensidade" +"Intensity" = "Brilho" "Interaction" = "Interação" "Interactions" = "Interações" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Design de interfaces e prototipagem. Uma ferramenta de design gratuita e de código aberto, com implementação independente (clean-room), escrita do zero em Rust, parte dos Crafting Apps da ArtCraft." diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 7ec18507a..dc8500233 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -635,7 +635,7 @@ name = "Русский" "Instance swap (no other component)" = "Замена экземпляра (других компонентов нет)" "Instances" = "Экземпляры" "Instant" = "Мгновенно" -"Intensity" = "Интенсивность" +"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." diff --git a/crates/ui-egui/src/field_tests.rs b/crates/ui-egui/src/field_tests.rs index 141589721..9ddc48e52 100644 --- a/crates/ui-egui/src/field_tests.rs +++ b/crates/ui-egui/src/field_tests.rs @@ -502,34 +502,31 @@ fn the_glass_light_intensity_field_has_a_label() { u.frame(vec![]); let shapes = u.frame_output(vec![]).shapes; let lead = u.ctx.read_response(Id::new(("fx_gi", 0usize)).with("lead")).expect("the intensity field is shown").rect; - let labels: Vec = painted_texts(&shapes).into_iter().filter(|(_, _, at)| lead.contains(at.center())).map(|(text, ..)| text).collect(); - assert_eq!(labels, ["Intensity"]); + let labels: Vec<(String, bool)> = + painted_texts(&shapes).into_iter().filter(|(_, _, at)| lead.contains(at.center())).map(|(text, cut, _)| (text, cut)).collect(); + assert_eq!(labels, [("Intensity".to_string(), false)], "labelled, and not cut short"); + let field = u.ctx.read_response(Id::new(("fx_gi", 0usize)).with("field")).expect("its value").rect; + assert_eq!(field.max.x - lead.min.x, GLASS_FIELD_W, "the width the next test measures against"); } /// A glass settings field's width in the Design panel at its default width. -const GLASS_FIELD_W: f32 = 98.0; +const GLASS_FIELD_W: f32 = 98.5; -/// The glass settings' labels leave their values room in every language, and are cut only when -/// they would crowd them (#256). +/// The light intensity label this fix adds fits whole beside its value in every language (#256). +/// Other glass labels may end in "…" in some languages (es "Profundidad"); a longer +/// "Intensity" translation fails here. #[test] -fn glass_labels_fit_beside_their_values_in_every_language() { +fn the_intensity_label_fits_whole_in_every_language() { use crate::i18n::{self, Text}; - let keys = ["Light|glass", "Intensity", "Refraction", "Depth", "Dispersion", "Frost", "Splay"]; let ctx = egui::Context::default(); let mut out = ctx.run_ui(Default::default(), |ui| { let width = |s: &str| ui.painter().layout_no_wrap(s.to_string(), crate::theme::regular(11.0), egui::Color32::WHITE).size().x; for lang in i18n::languages() { - for key in keys { - let label = lang.ui.iter().find(|(k, _)| *k == key).map_or(key, |(_, t)| match t { - Text::Plain(s) | Text::Plural { other: s, .. } => s, - }); - let (lead, value) = (crate::widgets::text_lead_width(ui, label, GLASS_FIELD_W), width("100%")); - assert!(lead + value <= GLASS_FIELD_W, "{}: no room for the value beside {label:?}", lang.code); - // Cut off only when it would crowd the value's 32 points (es "Profundidad"). - if 12.0 + width(label) <= GLASS_FIELD_W - 32.0 { - assert!(lead >= 12.0 + width(label), "{}: {label:?} is cut off", lang.code); - } - } + let label = lang.ui.iter().find(|(k, _)| *k == "Intensity").map_or("Intensity", |(_, t)| match t { + Text::Plain(s) | Text::Plural { other: s, .. } => s, + }); + let lead = crate::widgets::text_lead_width(ui, label, GLASS_FIELD_W); + assert!(lead >= 12.0 + width(label), "{}: {label:?} would end in \"…\"", lang.code); } }); out.textures_delta.clear(); diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index 4763b47c9..c415842db 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -223,7 +223,12 @@ fn number_field_impl( } match lead { Lead::Text(s) => { - crate::bidi::paint_name(ui.painter(), pos2(lead_rect.min.x + 8.0, rect.center().y), s, regular(11.0), t.text_secondary, lead_w - 12.0); + let galley = crate::bidi::name_galley(ui.painter(), s, regular(11.0), t.text_secondary, lead_w - 12.0); + // A label cut short shows whole on hover. + if galley.elided { + lead_resp.clone().on_hover_text(s); + } + ui.painter().galley(pos2(lead_rect.min.x + 8.0, rect.center().y - galley.size().y / 2.0), galley, t.text_secondary); } Lead::Icon(i, _) => { icons::paint(ui.painter(), Rect::from_center_size(lead_rect.center() + vec2(1.0, 0.0), vec2(14.0, 14.0)), i, t.icon_secondary) @@ -347,7 +352,8 @@ fn number_field_impl( None => empty.to_string(), }; let col = if value.is_some() { t.text } else { t.text_secondary }; - ui.painter().with_clip_rect(edit_rect).text(pos2(edit_rect.min.x, rect.center().y), Align2::LEFT_CENTER, s, regular(11.0), col); + // A value too long for its room ends in "…", so a cut number never reads as another. + crate::bidi::paint_name(ui.painter(), pos2(edit_rect.min.x, rect.center().y), &s, regular(11.0), col, edit_rect.width()); } } // The variable button shows while the pointer is over a bindable field. From 913634bec8f8bec9b09bfbff05e78e9cdab70916 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 00:13:49 +0700 Subject: [PATCH 206/817] #385: outline modes and soft-proof stay with their file; one toggle table for the menu's check marks --- crates/engine/src/cmd/view.rs | 108 ++++++++++------------ crates/engine/src/view_behaviour_tests.rs | 5 + 2 files changed, 52 insertions(+), 61 deletions(-) diff --git a/crates/engine/src/cmd/view.rs b/crates/engine/src/cmd/view.rs index 61c592e04..69b938e91 100644 --- a/crates/engine/src/cmd/view.rs +++ b/crates/engine/src/cmd/view.rs @@ -22,31 +22,33 @@ fn flag(s: &mut Session, p: &Value, f: fn(&mut ViewState) -> &mut bool) -> Resul /// One of a view's on/off settings. type Slot = fn(&mut ViewState) -> &mut bool; -/// The View menu's toggles the preferences keep: files opened or made later start with them. -const KEPT: &[(&str, Slot)] = &[ - ("view.pixelGrid", |v| &mut v.pixel_grid), - ("view.layoutGrids", |v| &mut v.layout_grids), - ("view.rulers", |v| &mut v.rulers), - ("view.slices", |v| &mut v.show_slices), - ("view.comments", |v| &mut v.comments), - ("view.multiplayerCursors", |v| &mut v.multiplayer_cursors), - ("view.outlines", |v| &mut v.outlines), - ("view.outlinesSelection", |v| &mut v.outlines_selection), - ("view.outlinesHiddenLayers", |v| &mut v.outline_hidden), - ("view.outlinesObjectBounds", |v| &mut v.outline_bounds), - ("view.maskOutlines", |v| &mut v.mask_outlines), - ("view.frameOutlines", |v| &mut v.frame_outlines), - ("view.proofSrgb", |v| &mut v.proof_srgb), - ("view.snapGeometry", |v| &mut v.snap_geometry), - ("view.snapObjects", |v| &mut v.snap_objects), - ("view.snapPixel", |v| &mut v.snap_pixel), +/// The View menu's on/off toggles (Pixel preview, with its scale, has its own command), and +/// whether the preferences keep each: files opened or made later start with the kept ones. Outline +/// modes and the sRGB soft-proof stay with their file, so a new file never opens in one. +const TOGGLES: &[(&str, Slot, bool)] = &[ + ("view.pixelGrid", |v| &mut v.pixel_grid, true), + ("view.layoutGrids", |v| &mut v.layout_grids, true), + ("view.rulers", |v| &mut v.rulers, true), + ("view.slices", |v| &mut v.show_slices, true), + ("view.comments", |v| &mut v.comments, true), + ("view.multiplayerCursors", |v| &mut v.multiplayer_cursors, true), + ("view.outlines", |v| &mut v.outlines, false), + ("view.outlinesSelection", |v| &mut v.outlines_selection, false), + ("view.outlinesHiddenLayers", |v| &mut v.outline_hidden, true), + ("view.outlinesObjectBounds", |v| &mut v.outline_bounds, true), + ("view.maskOutlines", |v| &mut v.mask_outlines, true), + ("view.frameOutlines", |v| &mut v.frame_outlines, true), + ("view.proofSrgb", |v| &mut v.proof_srgb, false), + ("view.snapGeometry", |v| &mut v.snap_geometry, true), + ("view.snapObjects", |v| &mut v.snap_objects, true), + ("view.snapPixel", |v| &mut v.snap_pixel, true), ]; -/// A View toggle the preferences keep: the file's view changes and the preferences remember it. -fn kept(s: &mut Session, p: &Value, id: &str) -> Result { - let Some((_, f)) = KEPT.iter().find(|(k, _)| *k == id) else { return Err(bad(id, "not a View toggle")) }; - let r = flag(s, p, *f)?; - if let Some(on) = r.get("on").and_then(Value::as_bool) { +/// View toggle `id`: the file's view changes, and the preferences remember a kept one. +fn toggle(s: &mut Session, p: &Value, id: &str) -> Result { + let Some(&(_, f, keep)) = TOGGLES.iter().find(|(k, ..)| *k == id) else { return Err(bad(id, "not a View toggle")) }; + let r = flag(s, p, f)?; + if keep && let Some(on) = r.get("on").and_then(Value::as_bool) { s.prefs.view.insert(id.to_string(), on); } Ok(r) @@ -54,7 +56,7 @@ fn kept(s: &mut Session, p: &Value, id: &str) -> Result { /// Set `v`'s View toggles to the ones the preferences keep (the others stay as they are). pub(crate) fn apply_kept(prefs: &crate::Prefs, v: &mut ViewState) { - for (id, f) in KEPT { + for (id, f, _) in TOGGLES.iter().filter(|t| t.2) { if let Some(on) = prefs.view.get(*id) { *f(v) = *on; } @@ -64,27 +66,11 @@ pub(crate) fn apply_kept(prefs: &crate::Prefs, v: &mut ViewState) { /// Whether the View menu's toggle `id` is on (the menus show a check mark); `None` for a command /// that isn't one. pub fn checked(s: &Session, id: &str) -> Option { - let v = &s.ds().ok()?.view; - Some(match id { - "view.pixelGrid" => v.pixel_grid, - "view.layoutGrids" => v.layout_grids, - "view.rulers" => v.rulers, - "view.slices" => v.show_slices, - "view.comments" => v.comments, - "view.multiplayerCursors" => v.multiplayer_cursors, - "view.outlines" => v.outlines, - "view.outlinesSelection" => v.outlines_selection, - "view.outlinesHiddenLayers" => v.outline_hidden, - "view.outlinesObjectBounds" => v.outline_bounds, - "view.maskOutlines" => v.mask_outlines, - "view.pixelPreview" => v.pixel_preview, - "view.frameOutlines" => v.frame_outlines, - "view.proofSrgb" => v.proof_srgb, - "view.snapGeometry" => v.snap_geometry, - "view.snapObjects" => v.snap_objects, - "view.snapPixel" => v.snap_pixel, - _ => return None, - }) + let mut v = s.ds().ok()?.view.clone(); + if id == "view.pixelPreview" { + return Some(v.pixel_preview); + } + TOGGLES.iter().find(|(k, ..)| *k == id).map(|(_, f, _)| *f(&mut v)) } /// Pixel preview: toggles, or turns on at a resolution of 1x or 2x. @@ -277,46 +263,46 @@ pub fn specs() -> Vec { spec!("view.nextFrame", "Zoom to next frame", "{}", false, |s, _| zoom_frame(s, 1)), spec!("view.prevPage", "Previous page", "{}", false, |s, _| page_step(s, -1)), spec!("view.nextPage", "Next page", "{}", false, |s, _| page_step(s, 1)), - spec!("view.pixelGrid", "Pixel grid", "{on?}", false, |s, p| kept(s, p, "view.pixelGrid")), - spec!("view.layoutGrids", "Layout grids", "{on?}", false, |s, p| kept(s, p, "view.layoutGrids")), - spec!("view.rulers", "Rulers", "{on?}", false, |s, p| kept(s, p, "view.rulers")), - spec!("view.slices", "Slices", "{on?}", false, |s, p| kept(s, p, "view.slices")), - spec!("view.comments", "Comments", "{on?}", false, |s, p| kept(s, p, "view.comments")), + spec!("view.pixelGrid", "Pixel grid", "{on?}", false, |s, p| toggle(s, p, "view.pixelGrid")), + spec!("view.layoutGrids", "Layout grids", "{on?}", false, |s, p| toggle(s, p, "view.layoutGrids")), + spec!("view.rulers", "Rulers", "{on?}", false, |s, p| toggle(s, p, "view.rulers")), + spec!("view.slices", "Slices", "{on?}", false, |s, p| toggle(s, p, "view.slices")), + spec!("view.comments", "Comments", "{on?}", false, |s, p| toggle(s, p, "view.comments")), spec!("view.multiplayerCursors", "Multiplayer cursors", "{on?} others' cursors in a live session", false, |s, p| { - kept(s, p, "view.multiplayerCursors") + toggle(s, p, "view.multiplayerCursors") }), spec!("view.pan", "Pan the view", "{dx, dy (arrow-key steps, e.g. 1 or -1), big? (ten times as far, like Shift)}", false, pan), - spec!("view.outlines", "Outlines", "{on?}", false, |s, p| kept(s, p, "view.outlines")), + spec!("view.outlines", "Outlines", "{on?}", false, |s, p| toggle(s, p, "view.outlines")), spec!("view.outlinesSelection", "Outlines for selection", "{on?} outline mode for the selected layers only", false, |s, p| { - kept(s, p, "view.outlinesSelection") + toggle(s, p, "view.outlinesSelection") }), spec!( "view.outlinesHiddenLayers", "Include hidden layers in outlines", "{on?} outline mode (and outlines for the selection) outlines hidden layers too; they can be clicked there", false, - |s, p| { kept(s, p, "view.outlinesHiddenLayers") } + |s, p| { toggle(s, p, "view.outlinesHiddenLayers") } ), spec!( "view.outlinesObjectBounds", "Include object bounds in outlines", "{on?} outline mode also draws each layer's box (groups, text, vectors); a click on a box's edge picks its layer", false, - |s, p| { kept(s, p, "view.outlinesObjectBounds") } + |s, p| { toggle(s, p, "view.outlinesObjectBounds") } ), - spec!("view.maskOutlines", "Mask outlines", "{on?}", false, |s, p| kept(s, p, "view.maskOutlines")), + spec!("view.maskOutlines", "Mask outlines", "{on?}", false, |s, p| toggle(s, p, "view.maskOutlines")), spec!("view.pixelPreview", "Pixel preview", "{on?, scale? (1|2: rendered pixels per page pixel; turns it on)}", false, pixel_preview), - spec!("view.frameOutlines", "Frame outlines", "{on?}", false, |s, p| kept(s, p, "view.frameOutlines")), + spec!("view.frameOutlines", "Frame outlines", "{on?}", false, |s, p| toggle(s, p, "view.frameOutlines")), spec!( "view.proofSrgb", "Soft-proof sRGB", "{on?} mark the colours of a Display P3 file that sRGB screens and files can't show", false, - |s, p| { kept(s, p, "view.proofSrgb") } + |s, p| { toggle(s, p, "view.proofSrgb") } ), - spec!("view.snapGeometry", "Snap to geometry", "{on?}", false, |s, p| kept(s, p, "view.snapGeometry")), - spec!("view.snapObjects", "Snap to objects", "{on?}", false, |s, p| kept(s, p, "view.snapObjects")), - spec!("view.snapPixel", "Snap to pixel grid", "{on?}", false, |s, p| kept(s, p, "view.snapPixel")), + spec!("view.snapGeometry", "Snap to geometry", "{on?}", false, |s, p| toggle(s, p, "view.snapGeometry")), + spec!("view.snapObjects", "Snap to objects", "{on?}", false, |s, p| toggle(s, p, "view.snapObjects")), + spec!("view.snapPixel", "Snap to pixel grid", "{on?}", false, |s, p| toggle(s, p, "view.snapPixel")), spec!("view.toggleUi", "Show/Hide UI", "{on?}", false, |s, p| flag(s, p, |v| &mut v.ui_hidden)), spec!("view.fullscreen", "Full screen", "{on?} the window fills the screen (the desktop app; a no-op headless)", false, |s, p| { s.request_ui("window.fullscreen", json!({"on": boolean(p, "on")})); diff --git a/crates/engine/src/view_behaviour_tests.rs b/crates/engine/src/view_behaviour_tests.rs index f8d9750c8..7f9e5a844 100644 --- a/crates/engine/src/view_behaviour_tests.rs +++ b/crates/engine/src/view_behaviour_tests.rs @@ -756,6 +756,10 @@ fn view_toggles_are_kept_for_the_next_launch() { for (cmd, on, _, _) in &rows { ex(&mut s, cmd, json!({"on": on})); } + // Modes stay with their file: a new one never opens in outline mode or soft-proofing. + for cmd in ["view.outlines", "view.outlinesSelection", "view.proofSrgb"] { + ex(&mut s, cmd, json!({"on": true})); + } // The app writes its preferences as JSON and reads them back at the next launch. let saved = serde_json::to_value(&s.prefs).unwrap(); let mut next = Session::empty(); @@ -765,4 +769,5 @@ fn view_toggles_are_kept_for_the_next_launch() { for (cmd, on, get, why) in rows { assert_eq!(get(view), on, "{cmd}: {why}"); } + assert!(!view.outlines && !view.outlines_selection && !view.proof_srgb, "{view:?}"); } From 694c3114e8ff852e187019a38b05f0111bceae27 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 00:22:13 +0700 Subject: [PATCH 207/817] #758: drop the progress-doc edits (the maintainer adds those) --- ROADMAP.md | 2 -- docs/file-format-parity.md | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index a97fc7848..3908e591c 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -131,7 +131,6 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). ## Progress log -- **2026-10-17** · Missing fonts (M7, #752): fonts a file names that aren't installed (text layers, styled ranges, text styles, font family variables) are listed in a Missing fonts window after the user opens the file (once installed fonts are indexed and any import report is closed), from Text ▸ Missing fonts…, by `text.missingFonts` and by `figcraft-cli info`. Their text still draws in a fallback font. Numbers unchanged. - **2026-10-17** · Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. - **2026-10-17** · Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. - **2026-10-17** · Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. @@ -317,7 +316,6 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| -| 2026-10-17 | minor | Missing fonts (M7, #752): fonts a file names that aren't installed are listed after the user opens it, from Text ▸ Missing fonts…, by `text.missingFonts` and by `figcraft-cli info`. Numbers unchanged. | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 72294f68d..96293b34f 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (missing fonts listed on open (#752); `.fig` import fidelity from the community batches, budgets for large files, the import report, a `.fig` copy from Save as, paste from another design app; instance layers' size and resizing and Hug on import (#731, #732); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (`.fig` import fidelity from the community batches, budgets for large files, the import report, a `.fig` copy from Save as, paste from another design app; instance layers' size and resizing and Hug on import (#731, #732); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) Every format Figma reads or writes, with FigCraft's support. Sources: `Info.plist` of `/Applications/Figma.app` (document types only; nothing inside the bundle's code was read), Figma's @@ -159,13 +159,12 @@ each. | Local fonts | yes (font helper / desktop app) | yes (system scan) | | 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 fonts on open | listed, with replacement | listed (Missing fonts window after an open, Text ▸ Missing fonts…, `text.missingFonts`, `figcraft-cli info`); no replacement; text draws in a fallback font | +| Missing-font replacement on open | yes | warnings only (REST import) | ## Revision history | Date | Change | Summary | |---|---|---| -| 2026-10-17 | minor | Missing fonts (#752): the fonts a file names that aren't installed (text layers, styled ranges, text styles, font family variables in any mode) are listed when the user opens it (once installed fonts are indexed and any import report is closed), from Text ▸ Missing fonts…, by `text.missingFonts` and by `figcraft-cli info`. The row claimed REST import warnings no code produced. | | 2026-10-17 | minor | The community batches #727 and #728 in the `.fig` row: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments (also REST), images in the message; budgets from the file's size; the journal keeps no file bytes; the import report. Not read cut to what's left. A `.fig` copy from Save as. Pasted content: layers copied from another design app, best effort (tested only with clipboard HTML made from our own export), and images under Wayland (not run there). All on synthetic files: summary and hours unchanged | | 2026-10-17 | minor | Hug on import (#732): auto layout frames a `.fig` records no primary-axis sizing for hug on that axis (auto layout sized that axis by its content before it could be fixed) instead of turning fixed, instances that record no auto layout take their main's (they came in without auto layout and fixed, so longer text overflowed them), REST frames whose sizing modes are left out hug (the documented default), and text hugs by its resize mode (auto width both axes, auto height its height; it came in fixed). Numbers unchanged | | 2026-10-17 | minor | Instance layers' own size and resizing (#731): a `.fig` import keeps the sizes an instance gives its layers and their hug/fill/fixed and min/max as overrides, a REST import reads the resizing fields of `overrides`, and a `.fig` export writes a layer's own size as an override (it went with the derived layout, which a relayout replaces). Numbers unchanged | From 7ee2772da8697b5353cf3bf30fa576b8f037362a Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 00:22:21 +0700 Subject: [PATCH 208/817] #758: ask whether the installed fonts are indexed only while a list waits for them --- crates/ui-egui/src/missing_fonts.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/crates/ui-egui/src/missing_fonts.rs b/crates/ui-egui/src/missing_fonts.rs index 6c07068dc..b6c794777 100644 --- a/crates/ui-egui/src/missing_fonts.rs +++ b/crates/ui-egui/src/missing_fonts.rs @@ -60,14 +60,17 @@ pub fn request(app: &mut FigApp) { } pub fn show(app: &mut FigApp, ctx: &egui::Context) { - let known = figcraft_text::installed_fonts_known(); - if let Some(uid) = app.ui.missing_fonts.as_ref().filter(|m| m.indexing && known).map(|m| m.uid) { - list(app, uid); - } - if !app.ui.font_checks.is_empty() && app.ui.import_report.is_none() && app.ui.missing_fonts.is_none() && known { - let uid = app.ui.font_checks.remove(0); - if list(app, uid).is_some_and(|f| f.is_empty()) { - app.ui.missing_fonts = None; + // Whether the installed fonts are indexed is asked only while a list waits for it. + let waiting = app.ui.missing_fonts.as_ref().filter(|m| m.indexing).map(|m| m.uid); + if (waiting.is_some() || !app.ui.font_checks.is_empty()) && figcraft_text::installed_fonts_known() { + if let Some(uid) = waiting { + list(app, uid); + } + if !app.ui.font_checks.is_empty() && app.ui.import_report.is_none() && app.ui.missing_fonts.is_none() { + let uid = app.ui.font_checks.remove(0); + if list(app, uid).is_some_and(|f| f.is_empty()) { + app.ui.missing_fonts = None; + } } } if app.ui.missing_fonts.as_ref().is_some_and(|m| !app.session.docs.iter().any(|d| d.uid == m.uid)) { From cbf6d2df415e63e1be800e24dda4dbc79f821539 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 00:33:32 +0700 Subject: [PATCH 209/817] #762: drop the progress-doc edit (the maintainer adds those) --- docs/ui-parity.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/ui-parity.md b/docs/ui-parity.md index a28749bf2..0cccf008c 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -172,7 +172,6 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| -| 2026-10-17 | patch | macOS shortcut keycaps draw ⌃ ⌥ ↵ ⌫ ⇥ ⇞ ⇟ in menus and tooltips (they were boxes): the desktop app adds a system face with them (Lucida Grande, Apple Symbols, Segoe UI Symbol, DejaVu Sans…) after the UI fonts. Checked in the app on macOS. The web build on a Mac still shows boxes (no system fonts there). Summary and hours unchanged | | 2026-10-17 | minor | The community batches #733, #735, #736, #729 and #753: submenus open after a short hover, keep their place along a safe triangle and reopen closed (main and context menus); the Actions palette's tabs, ranked search, keyboard highlight and recents; menu items that need a value ask for it, File ▸ Rename edits in place; Shift+I and Resources open Assets; a draggable Pages/Layers divider; Shift-drag moves the selection; a double-click near a thin stroke, merging dropped points and Flatten keeping open paths in vector editing; live font preview and the selection highlight after line breaks; the colour picker on a new fill or stroke; Paste over and Paste properties from the keyboard; Selection colors (partial: no library styles or variables there) and smart-selection spacing fields and canvas handles (partial: no reorder rings), both also checked by their author on macOS; the keyboard shortcuts panel closes on the home screen; Adwaita window controls on Wayland compositors without server decorations (checked by its author on GNOME; KDE not run). Checked in the app on Windows (submenus by their author), not side by side with Figma. Summary and hours unchanged | | 2026-10-15 | minor | Hex fields take CSS colour names (`red` → `FF0000`): fills, strokes, effects, grids, variables, backgrounds and the colour picker | | 2026-10-15 | minor | Typography: drag the line-height, letter-spacing and paragraph-spacing icons to scrub their values; shared numeric-field rates, resize cursor and one Undo step per gesture (#373). | From 7fd936c8ba55819ebe7b52bd7b5becdecbe3c229 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 00:36:36 +0700 Subject: [PATCH 210/817] #762: one system fallback helper for scripts and shortcut glyphs, a face added once; the glyph test skips when this machine's fonts lack some --- crates/ui-egui/src/bidi.rs | 17 ++++------------- crates/ui-egui/src/theme.rs | 34 ++++++++++++++++++++++++---------- 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/crates/ui-egui/src/bidi.rs b/crates/ui-egui/src/bidi.rs index 915c7e115..58c5df933 100644 --- a/crates/ui-egui/src/bidi.rs +++ b/crates/ui-egui/src/bidi.rs @@ -274,8 +274,9 @@ fn word_at(text: &str, i: usize) -> (usize, usize) { (a, b) } -/// Faces the UI adds for scripts its own fonts lack (desktop: from the system), as egui font data. -pub fn script_fallbacks(have: &dyn Fn(char) -> bool) -> Vec<(String, egui::FontData)> { +/// Faces the UI adds for scripts its own fonts lack (desktop: from the system), as egui font data; +/// `taken` as for [`crate::theme::system_fallbacks`]. +pub fn script_fallbacks(have: &dyn Fn(char) -> bool, taken: &mut Vec>) -> Vec<(String, egui::FontData)> { // Hebrew, Arabic letters, Arabic presentation forms (what joined names are drawn with). const SAMPLES: [char; 3] = ['\u{05D0}', '\u{0628}', '\u{FE91}']; const FAMILIES: [&str; 11] = [ @@ -291,17 +292,7 @@ pub fn script_fallbacks(have: &dyn Fn(char) -> bool) -> Vec<(String, egui::FontD "FreeSans", "Noto Sans", ]; - let mut out: Vec<(String, egui::FontData)> = Vec::new(); - let mut taken: Vec> = Vec::new(); - for c in SAMPLES { - if have(c) || taken.iter().any(|f| f.has_char(c)) { - continue; - } - let Some(face) = figcraft_text::face_with_char(c, &FAMILIES) else { continue }; - out.push((format!("system-{}-{}", face.family, face.style), crate::theme::font_data(&face))); - taken.push(face); - } - out + crate::theme::system_fallbacks(SAMPLES, &FAMILIES, have, taken) } #[cfg(test)] diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rs index 933ebece8..a4fa87544 100644 --- a/crates/ui-egui/src/theme.rs +++ b/crates/ui-egui/src/theme.rs @@ -273,8 +273,9 @@ pub fn install_fonts(ctx: &Context, system: bool, cjk: u8) { .filter_map(|f| figcraft_text::find_face(f, "Regular")) .any(|x| x.has_char(c)) }; - extra.extend(crate::bidi::script_fallbacks(&embedded)); - extra.extend(key_symbol_fallbacks(&embedded)); + let mut taken = Vec::new(); + extra.extend(crate::bidi::script_fallbacks(&embedded, &mut taken)); + extra.extend(key_symbol_fallbacks(&embedded, &mut taken)); extra.extend(crate::cjk::faces(cjk, lang, &embedded).iter().map(|f| (format!("system-{}-{}", f.family, f.style), font_data(f)))); } extra.extend(craft(true)); @@ -291,18 +292,30 @@ pub fn install_fonts(ctx: &Context, system: bool, cjk: u8) { /// The glyphs macOS shortcuts are written with ([`figcraft_engine::keymap::display`]). const KEY_SYMBOLS: &str = "⌃⌥⇧⌘⌫↵⇥⇞⇟←→↑↓"; +/// System families that have them, in order of preference. +const KEY_FAMILIES: [&str; 6] = ["Lucida Grande", "Apple Symbols", "Segoe UI Symbol", "DejaVu Sans", "Noto Sans Symbols 2", "FreeSans"]; /// System faces for the shortcut glyphs the UI's own fonts lack (egui's default face has ⌘ but -/// not ⌥ or ↵). -fn key_symbol_fallbacks(have: &dyn Fn(char) -> bool) -> Vec<(String, FontData)> { - const FAMILIES: [&str; 6] = ["Lucida Grande", "Apple Symbols", "Segoe UI Symbol", "DejaVu Sans", "Noto Sans Symbols 2", "FreeSans"]; +/// not ⌥ or ↵); `taken` as for [`system_fallbacks`]. +fn key_symbol_fallbacks(have: &dyn Fn(char) -> bool, taken: &mut Vec>) -> Vec<(String, FontData)> { + system_fallbacks(KEY_SYMBOLS.chars(), &KEY_FAMILIES, have, taken) +} + +/// System faces, the first of `families` that has each, for the `samples` neither the UI's own +/// fonts (`have`) nor the faces already `taken` draw. Each face found joins `taken`, so a face that +/// several lists name is added once. +pub(crate) fn system_fallbacks( + samples: impl IntoIterator, + families: &[&str], + have: &dyn Fn(char) -> bool, + taken: &mut Vec>, +) -> Vec<(String, FontData)> { let mut out = Vec::new(); - let mut taken: Vec> = Vec::new(); - for c in KEY_SYMBOLS.chars() { + for c in samples { if have(c) || taken.iter().any(|f| f.has_char(c)) { continue; } - let Some(face) = figcraft_text::face_with_char(c, &FAMILIES) else { continue }; + let Some(face) = figcraft_text::face_with_char(c, families) else { continue }; out.push((format!("system-{}-{}", face.family, face.style), font_data(&face))); taken.push(face); } @@ -360,8 +373,9 @@ mod tests { #[test] fn ui_font_draws_every_mac_shortcut_glyph() { figcraft_text::scan_system_fonts(); - if key_symbol_fallbacks(&|_| false).is_empty() { - eprintln!("no system face with shortcut glyphs; skipping"); + let lacking: String = KEY_SYMBOLS.chars().filter(|c| figcraft_text::face_with_char(*c, &KEY_FAMILIES).is_none()).collect(); + if !lacking.is_empty() { + eprintln!("no system face here draws {lacking}; skipping"); return; } let ctx = Context::default(); From 89c5d3dfe6d788ca8ba0e1c2480fdb18247af8ec Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Thu, 15 Oct 2026 03:33:28 +0200 Subject: [PATCH 211/817] Keep View toggles such as Rulers in the preferences Fixes #379 Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Opus 5.5 Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/engine/src/cmd/view.rs | 74 ++++++++++++++++++----- crates/engine/src/lib.rs | 18 ++++++ crates/engine/src/view_behaviour_tests.rs | 24 ++++++++ crates/ui-egui/src/lib.rs | 2 + 4 files changed, 102 insertions(+), 16 deletions(-) diff --git a/crates/engine/src/cmd/view.rs b/crates/engine/src/cmd/view.rs index de69e6908..61c592e04 100644 --- a/crates/engine/src/cmd/view.rs +++ b/crates/engine/src/cmd/view.rs @@ -19,6 +19,48 @@ fn flag(s: &mut Session, p: &Value, f: fn(&mut ViewState) -> &mut bool) -> Resul Ok(json!({"on": *slot})) } +/// One of a view's on/off settings. +type Slot = fn(&mut ViewState) -> &mut bool; + +/// The View menu's toggles the preferences keep: files opened or made later start with them. +const KEPT: &[(&str, Slot)] = &[ + ("view.pixelGrid", |v| &mut v.pixel_grid), + ("view.layoutGrids", |v| &mut v.layout_grids), + ("view.rulers", |v| &mut v.rulers), + ("view.slices", |v| &mut v.show_slices), + ("view.comments", |v| &mut v.comments), + ("view.multiplayerCursors", |v| &mut v.multiplayer_cursors), + ("view.outlines", |v| &mut v.outlines), + ("view.outlinesSelection", |v| &mut v.outlines_selection), + ("view.outlinesHiddenLayers", |v| &mut v.outline_hidden), + ("view.outlinesObjectBounds", |v| &mut v.outline_bounds), + ("view.maskOutlines", |v| &mut v.mask_outlines), + ("view.frameOutlines", |v| &mut v.frame_outlines), + ("view.proofSrgb", |v| &mut v.proof_srgb), + ("view.snapGeometry", |v| &mut v.snap_geometry), + ("view.snapObjects", |v| &mut v.snap_objects), + ("view.snapPixel", |v| &mut v.snap_pixel), +]; + +/// A View toggle the preferences keep: the file's view changes and the preferences remember it. +fn kept(s: &mut Session, p: &Value, id: &str) -> Result { + let Some((_, f)) = KEPT.iter().find(|(k, _)| *k == id) else { return Err(bad(id, "not a View toggle")) }; + let r = flag(s, p, *f)?; + if let Some(on) = r.get("on").and_then(Value::as_bool) { + s.prefs.view.insert(id.to_string(), on); + } + Ok(r) +} + +/// Set `v`'s View toggles to the ones the preferences keep (the others stay as they are). +pub(crate) fn apply_kept(prefs: &crate::Prefs, v: &mut ViewState) { + for (id, f) in KEPT { + if let Some(on) = prefs.view.get(*id) { + *f(v) = *on; + } + } +} + /// Whether the View menu's toggle `id` is on (the menus show a check mark); `None` for a command /// that isn't one. pub fn checked(s: &Session, id: &str) -> Option { @@ -235,46 +277,46 @@ pub fn specs() -> Vec { spec!("view.nextFrame", "Zoom to next frame", "{}", false, |s, _| zoom_frame(s, 1)), spec!("view.prevPage", "Previous page", "{}", false, |s, _| page_step(s, -1)), spec!("view.nextPage", "Next page", "{}", false, |s, _| page_step(s, 1)), - spec!("view.pixelGrid", "Pixel grid", "{on?}", false, |s, p| flag(s, p, |v| &mut v.pixel_grid)), - spec!("view.layoutGrids", "Layout grids", "{on?}", false, |s, p| flag(s, p, |v| &mut v.layout_grids)), - spec!("view.rulers", "Rulers", "{on?}", false, |s, p| flag(s, p, |v| &mut v.rulers)), - spec!("view.slices", "Slices", "{on?}", false, |s, p| flag(s, p, |v| &mut v.show_slices)), - spec!("view.comments", "Comments", "{on?}", false, |s, p| flag(s, p, |v| &mut v.comments)), + spec!("view.pixelGrid", "Pixel grid", "{on?}", false, |s, p| kept(s, p, "view.pixelGrid")), + spec!("view.layoutGrids", "Layout grids", "{on?}", false, |s, p| kept(s, p, "view.layoutGrids")), + spec!("view.rulers", "Rulers", "{on?}", false, |s, p| kept(s, p, "view.rulers")), + spec!("view.slices", "Slices", "{on?}", false, |s, p| kept(s, p, "view.slices")), + spec!("view.comments", "Comments", "{on?}", false, |s, p| kept(s, p, "view.comments")), spec!("view.multiplayerCursors", "Multiplayer cursors", "{on?} others' cursors in a live session", false, |s, p| { - flag(s, p, |v| &mut v.multiplayer_cursors) + kept(s, p, "view.multiplayerCursors") }), spec!("view.pan", "Pan the view", "{dx, dy (arrow-key steps, e.g. 1 or -1), big? (ten times as far, like Shift)}", false, pan), - spec!("view.outlines", "Outlines", "{on?}", false, |s, p| flag(s, p, |v| &mut v.outlines)), + spec!("view.outlines", "Outlines", "{on?}", false, |s, p| kept(s, p, "view.outlines")), spec!("view.outlinesSelection", "Outlines for selection", "{on?} outline mode for the selected layers only", false, |s, p| { - flag(s, p, |v| &mut v.outlines_selection) + kept(s, p, "view.outlinesSelection") }), spec!( "view.outlinesHiddenLayers", "Include hidden layers in outlines", "{on?} outline mode (and outlines for the selection) outlines hidden layers too; they can be clicked there", false, - |s, p| { flag(s, p, |v| &mut v.outline_hidden) } + |s, p| { kept(s, p, "view.outlinesHiddenLayers") } ), spec!( "view.outlinesObjectBounds", "Include object bounds in outlines", "{on?} outline mode also draws each layer's box (groups, text, vectors); a click on a box's edge picks its layer", false, - |s, p| { flag(s, p, |v| &mut v.outline_bounds) } + |s, p| { kept(s, p, "view.outlinesObjectBounds") } ), - spec!("view.maskOutlines", "Mask outlines", "{on?}", false, |s, p| flag(s, p, |v| &mut v.mask_outlines)), + spec!("view.maskOutlines", "Mask outlines", "{on?}", false, |s, p| kept(s, p, "view.maskOutlines")), spec!("view.pixelPreview", "Pixel preview", "{on?, scale? (1|2: rendered pixels per page pixel; turns it on)}", false, pixel_preview), - spec!("view.frameOutlines", "Frame outlines", "{on?}", false, |s, p| flag(s, p, |v| &mut v.frame_outlines)), + spec!("view.frameOutlines", "Frame outlines", "{on?}", false, |s, p| kept(s, p, "view.frameOutlines")), spec!( "view.proofSrgb", "Soft-proof sRGB", "{on?} mark the colours of a Display P3 file that sRGB screens and files can't show", false, - |s, p| { flag(s, p, |v| &mut v.proof_srgb) } + |s, p| { kept(s, p, "view.proofSrgb") } ), - spec!("view.snapGeometry", "Snap to geometry", "{on?}", false, |s, p| flag(s, p, |v| &mut v.snap_geometry)), - spec!("view.snapObjects", "Snap to objects", "{on?}", false, |s, p| flag(s, p, |v| &mut v.snap_objects)), - spec!("view.snapPixel", "Snap to pixel grid", "{on?}", false, |s, p| flag(s, p, |v| &mut v.snap_pixel)), + spec!("view.snapGeometry", "Snap to geometry", "{on?}", false, |s, p| kept(s, p, "view.snapGeometry")), + spec!("view.snapObjects", "Snap to objects", "{on?}", false, |s, p| kept(s, p, "view.snapObjects")), + spec!("view.snapPixel", "Snap to pixel grid", "{on?}", false, |s, p| kept(s, p, "view.snapPixel")), spec!("view.toggleUi", "Show/Hide UI", "{on?}", false, |s, p| flag(s, p, |v| &mut v.ui_hidden)), spec!("view.fullscreen", "Full screen", "{on?} the window fills the screen (the desktop app; a no-op headless)", false, |s, p| { s.request_ui("window.fullscreen", json!({"on": boolean(p, "on")})); diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index f49d3fc66..d0fc93869 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -372,6 +372,8 @@ pub struct DocState { /// The last duplicate while its copies are the selection: Duplicate repeats its offset (see /// [`cmd::edit::Duplicated`]; not saved). pub(crate) last_duplicate: Option, + /// The View toggles the preferences keep were applied ([`Session::apply_view_prefs`]). + view_from_prefs: bool, } /// A version shown on the canvas in place of the document: read-only until it's restored or the @@ -431,6 +433,7 @@ impl DocState { guide: None, rotation_origin: None, last_duplicate: None, + view_from_prefs: false, }; st.zoom_to_fit(); st @@ -663,6 +666,10 @@ pub struct Prefs { /// `widget:`. #[serde(skip_serializing_if = "Vec::is_empty")] pub recent_actions: Vec, + /// The View menu's toggles turned on or off (rulers, pixel grid, snapping…), by command id: + /// files opened or made later start with them. Missing: the toggle's default. + #[serde(skip_serializing_if = "BTreeMap::is_empty")] + pub view: BTreeMap, } /// Recently run actions kept for the Actions palette (newest first). @@ -697,6 +704,7 @@ impl Default for Prefs { home_sort: "modified".into(), home_order: "desc".into(), recent_actions: Vec::new(), + view: BTreeMap::new(), } } } @@ -848,6 +856,14 @@ impl Session { s } + /// Files new to the session start with the View toggles the preferences keep. + pub fn apply_view_prefs(&mut self) { + for ds in self.docs.iter_mut().filter(|d| !d.view_from_prefs) { + cmd::view::apply_kept(&self.prefs, &mut ds.view); + ds.view_from_prefs = true; + } + } + pub fn ds(&self) -> Result<&DocState> { self.docs.get(self.active).ok_or(EngineError::NoDocument) } @@ -889,6 +905,7 @@ impl Session { return Err(EngineError::Disabled(id.into(), "leave the live session before reverting to the saved file".into())); } branches::sync(self); + self.apply_view_prefs(); if textpreview::COMMANDS.contains(&id) { // A live preview is no edit: no undo step, normalisation or rollback here. let r = guard::run(id, || (spec.run)(self, params)); @@ -914,6 +931,7 @@ impl Session { match &result { Ok(_) => { self.after_command(spec, before); + self.apply_view_prefs(); if spec.history && id != "edit.repeat" { self.last_command = Some((id.to_string(), params.clone())); } diff --git a/crates/engine/src/view_behaviour_tests.rs b/crates/engine/src/view_behaviour_tests.rs index 27bc37710..f8d9750c8 100644 --- a/crates/engine/src/view_behaviour_tests.rs +++ b/crates/engine/src/view_behaviour_tests.rs @@ -742,3 +742,27 @@ fn alt_measures_between_layers() { assert_eq!(measured(&mut s, p, m), want, "{why}"); } } + +#[test] +fn view_toggles_are_kept_for_the_next_launch() { + let mut s = Session::new(); + // (command, turned to, ViewState field, derivation) + let rows: Vec<(&str, bool, fn(&ViewState) -> bool, &str)> = vec![ + ("view.rulers", true, |v| v.rulers, "rulers shown stay shown"), + ("view.pixelGrid", false, |v| v.pixel_grid, "a hidden pixel grid stays hidden"), + ("view.layoutGrids", false, |v| v.layout_grids, "hidden layout grids stay hidden"), + ("view.snapPixel", false, |v| v.snap_pixel, "snapping to the pixel grid off stays off"), + ]; + for (cmd, on, _, _) in &rows { + ex(&mut s, cmd, json!({"on": on})); + } + // The app writes its preferences as JSON and reads them back at the next launch. + let saved = serde_json::to_value(&s.prefs).unwrap(); + let mut next = Session::empty(); + next.prefs = serde_json::from_value(saved).unwrap(); + ex(&mut next, "file.new", json!({})); + let view = &next.ds().unwrap().view; + for (cmd, on, get, why) in rows { + assert_eq!(get(view), on, "{cmd}: {why}"); + } +} diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 8f1996ca8..70e581f42 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1357,6 +1357,8 @@ impl FigApp { } self.background_done(&ctx); } + // Files that arrived without a command (joined, recovered) take the kept View toggles too. + self.session.apply_view_prefs(); windows::begin(self, &ctx); let (files, prefs) = (self.session.docs.len(), self.session.prefs.clone()); self.frame(ui); From 42242e3c8b88e556282926e09c223bc809aaa1e7 Mon Sep 17 00:00:00 2001 From: BFlat Date: Sun, 18 Oct 2026 01:41:15 +0700 Subject: [PATCH 212/817] M1: IME composition in text layers (#747) (#755) - Text editing on the canvas now tells the platform it wants the IME on **every** frame of the edit. Before, it only did so on frames that brought input events. - The candidate window opens at the caret. Before, it opened at the canvas corner: the desktop integration places it by `IMEOutput.rect`, which was the whole canvas. - Keys that reach the editor while a composition is in progress belong to the IME. Enter, Escape, Backspace, arrows and shortcuts don't act on the text then, so Enter picking a candidate doesn't add a newline. - New test `crates/ui-egui/src/ime_tests.rs`. - Docs: the IME rows in `docs/ui-parity.md` and `ROADMAP.md` now say it hasn't been checked on a Mac. Fixes #747. --- ROADMAP.md | 2 +- crates/ui-egui/src/ime_tests.rs | 87 +++++++++++++++++++++++++++++++++ crates/ui-egui/src/lib.rs | 2 + crates/ui-egui/src/shortcuts.rs | 15 ++++-- docs/ui-parity.md | 5 +- 5 files changed, 104 insertions(+), 7 deletions(-) create mode 100644 crates/ui-egui/src/ime_tests.rs diff --git a/ROADMAP.md b/ROADMAP.md index 3908e591c..8a587286d 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -117,7 +117,7 @@ French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese and I Language; Traditional Chinese has no catalog; CJK UI text uses an installed CJK font, loaded only when needed; adding a language: [`docs/translating.md`](docs/translating.md)). Document text in any script (bidi, Arabic shaping, -IME) already works. Detail: [`docs/localization-parity.md`](docs/localization-parity.md). +IME) already works (macOS IME composition fixed for #747, not yet checked on a Mac). Detail: [`docs/localization-parity.md`](docs/localization-parity.md). ## Upcoming diff --git a/crates/ui-egui/src/ime_tests.rs b/crates/ui-egui/src/ime_tests.rs new file mode 100644 index 000000000..a6db0cbdd --- /dev/null +++ b/crates/ui-egui/src/ime_tests.rs @@ -0,0 +1,87 @@ +//! IME composition in a text layer, driven through egui headless with the events macOS sends for +//! Pinyin ("nihao", then a candidate picked): the platform keeps the IME on every frame of the +//! edit (an idle frame too) with the candidate window at the caret, the composition shows without +//! entering the document, keys pressed while composing are the IME's, and the commit lands once. + +use egui::{Event, ImeEvent, Key, Modifiers, RawInput, Rect}; +use figcraft_doc::{NodeId, NodeKind}; +use figcraft_engine::Session; +use serde_json::json; + +use crate::layers_drag_tests::Ui; + +fn key(key: Key, pressed: bool) -> Event { + Event::Key { key, physical_key: None, pressed, repeat: false, modifiers: Modifiers::NONE } +} + +fn preedit(text: &str) -> Event { + let n = text.chars().count(); + Event::Ime(ImeEvent::Preedit { text: text.into(), active_range_chars: (n > 0).then_some(n..n) }) +} + +#[expect(deprecated, reason = "egui still delivers these, and the editor must ignore them")] +fn enabled_disabled() -> (Event, Event) { + (Event::Ime(ImeEvent::Enabled), Event::Ime(ImeEvent::Disabled)) +} + +fn text(u: &Ui, id: NodeId) -> String { + match &u.app.session.doc().unwrap().node(id).unwrap().kind { + NodeKind::Text(t) => t.characters.clone(), + _ => panic!("not text"), + } +} + +/// One frame; the IME output it leaves for the platform (`None` turns the IME off). +fn ime(u: &mut Ui, events: Vec) -> Rect { + let ime = u.frame_raw(RawInput { events, ..Default::default() }).platform_output.ime.expect("the IME stays on while editing"); + assert_eq!(ime.rect, ime.cursor_rect, "the desktop places candidates by `rect`: the caret"); + ime.cursor_rect +} + +fn composing(u: &Ui) -> Option { + u.app.session.ds().unwrap().text_edit.as_ref().expect("still editing").preedit.as_ref().map(|p| p.text.clone()) +} + +#[test] +fn pinyin_composes_inline_and_commits_once_with_the_ime_on_every_frame() { + // The text is measured with a font: without craft-fonts a system one, scanned here rather than + // by whichever test happens to run first (#333). + figcraft_text::scan_system_fonts(); + let mut s = Session::new(); + let t = NodeId(s.execute("text.create", &json!({"text": "Hi", "x": 40, "y": 40})).unwrap()["id"].as_u64().unwrap()); + // On a machine without any font nothing lays out and every caret sits at the start. + let fonts = figcraft_text::layout_node(s.doc().unwrap().node(t).unwrap()).is_some_and(|(l, _)| !l.glyphs.is_empty()); + let mut u = Ui::new(s); + figcraft_engine::textedit::begin(&mut u.app.session, t, Some(2), false).unwrap(); + // An idle frame (the caret blinking) keeps the IME on, or macOS drops the composition. + let caret = ime(&mut u, vec![]); + let ds = u.app.session.ds().unwrap(); + let b = ds.doc.world_bounds(t).unwrap(); + let layer = Rect::from_two_pos(u.app.to_screen(b.x0, b.y0), u.app.to_screen(b.x1, b.y1)).expand(1.0); + assert!(layer.contains(caret.center()), "candidates open at the caret ({caret:?} in {layer:?})"); + + let (enabled, disabled) = enabled_disabled(); + ime(&mut u, vec![enabled, preedit("n")]); + ime(&mut u, vec![]); + let mid = ime(&mut u, vec![preedit("ni")]); + assert!(!fonts || mid.min.x > caret.min.x, "the IME cursor follows the composition"); + // A key the platform leaks while composing (Backspace) belongs to the IME, not the text. + ime(&mut u, vec![key(Key::Backspace, true), preedit("nih"), key(Key::Backspace, false)]); + ime(&mut u, vec![preedit("nihao")]); + assert_eq!(composing(&u).as_deref(), Some("nihao")); + assert_eq!(text(&u, t), "Hi", "the composition isn't in the document yet"); + + // Enter confirms the candidate: no newline, editing goes on. + let after = ime(&mut u, vec![key(Key::Enter, true), preedit(""), Event::Ime(ImeEvent::Commit("你好".into())), disabled, key(Key::Enter, false)]); + assert_eq!(text(&u, t), "Hi你好"); + assert_eq!(composing(&u), None); + let te = u.app.session.ds().unwrap().text_edit.clone().unwrap(); + assert_eq!((te.caret, te.anchor), (4, 4)); + assert!(!fonts || after.min.x > caret.min.x, "the caret moved past the committed text"); + ime(&mut u, vec![]); + assert_eq!(text(&u, t), "Hi你好", "committed once"); + + // Keys are the editor's again once the composition is over. + ime(&mut u, vec![key(Key::Enter, true), key(Key::Enter, false), Event::Text("!".into())]); + assert_eq!(text(&u, t), "Hi你好\n!"); +} diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index e6a14ede4..ceea7005d 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -117,6 +117,8 @@ mod home_tests; #[cfg(test)] mod idle_tests; #[cfg(test)] +mod ime_tests; +#[cfg(test)] mod import_report_tests; #[cfg(test)] mod layers_behaviour_tests; diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index 09b2c57bb..f68a24f3c 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -102,14 +102,16 @@ pub fn handle(app: &mut FigApp, ctx: &Context, typing: bool, swallowed: Swallowe return; } let events: Vec = ctx.input(|i| i.events.clone()); - if events.is_empty() { - return; - } + // Every frame while editing, even one without input: a frame without the IME output turns the + // platform's IME off, which drops the composition (macOS then types plain letters). let editing = app.session.ds().map(|d| d.text_edit.is_some()).unwrap_or(false); if editing { text_keys(app, ctx, &events); return; } + if events.is_empty() { + return; + } // An image-only clipboard brings no paste event: paste from the key then. The browser sends // the press; the desktop shell swallows it and sends only the release. let paste_event = events.iter().any(|e| matches!(e, Event::Paste(_))); @@ -448,6 +450,10 @@ fn text_keys(app: &mut FigApp, ctx: &Context, events: &[Event]) { } } Event::Key { key, physical_key, pressed: true, modifiers: m, .. } => { + // Keys during a composition are the IME's (Enter picks a candidate, Escape cancels). + if app.session.ds().is_ok_and(|d| d.text_edit.as_ref().is_some_and(|te| te.preedit.is_some())) { + continue; + } if (m.command || m.alt || m.ctrl) && text_shortcut(app, *key, *physical_key, *m) { skip_text = true; continue; @@ -532,7 +538,8 @@ fn ime_output(app: &FigApp, ctx: &Context) { ctx.output_mut(|o| { o.ime = Some(egui::output::IMEOutput { purpose: egui::IMEPurpose::Normal, - rect: app.canvas.rect, + // The desktop places the candidate window by `rect` (the web by `cursor_rect`). + rect: cursor_rect, cursor_rect, should_interrupt_composition: false, }) diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 0cccf008c..64bda29f3 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-10-17 · **Change:** minor (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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **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: @@ -85,7 +85,7 @@ interaction feel not yet compared. | 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); 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`). Not yet: the transform box around points of several layers; 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 | | -| Text: point, auto height, fixed; caret, words, lines, IME | done | the font picker previews a family on the canvas while hovered (no undo step; Escape restores, #653); 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; CJK words by script run (no dictionary); vertical trim in Type settings; no spell check | +| Text: point, auto height, fixed; caret, words, lines, IME | done | the font picker previews a family on the canvas while hovered (no undo step; Escape restores, #653); 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; 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 | | Eyedropper (I) | done | picks the colour seen under the pointer (opaque) into the selection's fill and the recent colours, one undo step (`fx_behaviour_tests`) | | Comment (C), Shift+C to show/hide | done | local only | | Text on a path (Figma Draw) | done | put on from the Design panel or `text.onPath`, not by clicking a path with the Text tool; the path is edited by resizing only | @@ -172,6 +172,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Text layers keep the platform IME on for every frame of an edit, not only frames with input (an idle frame turned it off and macOS dropped each composition, #747); the candidate window opens at the caret instead of the canvas corner; keys pressed while composing go to the IME | | 2026-10-17 | minor | The community batches #733, #735, #736, #729 and #753: submenus open after a short hover, keep their place along a safe triangle and reopen closed (main and context menus); the Actions palette's tabs, ranked search, keyboard highlight and recents; menu items that need a value ask for it, File ▸ Rename edits in place; Shift+I and Resources open Assets; a draggable Pages/Layers divider; Shift-drag moves the selection; a double-click near a thin stroke, merging dropped points and Flatten keeping open paths in vector editing; live font preview and the selection highlight after line breaks; the colour picker on a new fill or stroke; Paste over and Paste properties from the keyboard; Selection colors (partial: no library styles or variables there) and smart-selection spacing fields and canvas handles (partial: no reorder rings), both also checked by their author on macOS; the keyboard shortcuts panel closes on the home screen; Adwaita window controls on Wayland compositors without server decorations (checked by its author on GNOME; KDE not run). Checked in the app on Windows (submenus by their author), not side by side with Figma. Summary and hours unchanged | | 2026-10-15 | minor | Hex fields take CSS colour names (`red` → `FF0000`): fills, strokes, effects, grids, variables, backgrounds and the colour picker | | 2026-10-15 | minor | Typography: drag the line-height, letter-spacing and paragraph-spacing icons to scrub their values; shared numeric-field rates, resize cursor and one Undo step per gesture (#373). | From bc5a2b8fa76a63d93b6000e92c5d445d670e6f42 Mon Sep 17 00:00:00 2001 From: Natnael-Dev Date: Sat, 17 Oct 2026 21:45:51 +0300 Subject: [PATCH 213/817] fix(proto): delete prototype interaction without deleting component (#767) When an interaction noodle or interaction editor was selected in the Prototype tab, pressing Delete or Backspace (or executing edit.delete) targeted the selected layer/component instead of deleting the prototype connection. - Intercept Backspace and Delete in shortcuts::key_event and run_binding when an interaction is selected in the Prototype tab to remove the interaction using proto.interaction.remove rather than deleting the layer. - Ensure clicking on empty canvas or outside noodles/handles deselects the active interaction noodle/editor. - Close the interaction editor when navigating away from the Prototype tab. - Add regression tests in proto_editor_tests verifying interaction deletion with Delete/Backspace keeps the component intact, and Escape closes the interaction editor before deselecting the component. --- crates/ui-egui/src/proto_canvas.rs | 3 ++ crates/ui-egui/src/proto_editor_tests.rs | 61 ++++++++++++++++++++++++ crates/ui-egui/src/proto_panel.rs | 43 +++++++++++++++-- crates/ui-egui/src/right.rs | 3 ++ crates/ui-egui/src/shortcuts.rs | 20 ++++++++ 5 files changed, 126 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/proto_canvas.rs b/crates/ui-egui/src/proto_canvas.rs index 6310c05c1..1187944df 100644 --- a/crates/ui-egui/src/proto_canvas.rs +++ b/crates/ui-egui/src/proto_canvas.rs @@ -272,6 +272,9 @@ pub fn input(app: &mut FigApp, ui: &egui::Ui, resp: &egui::Response) -> bool { crate::proto_panel::open_editor(&ctx, Some((n.source, n.index))); return true; } + if pressed && crate::proto_panel::editor(&ctx).is_some() { + crate::proto_panel::open_editor(&ctx, None); + } false } diff --git a/crates/ui-egui/src/proto_editor_tests.rs b/crates/ui-egui/src/proto_editor_tests.rs index 2372c20e0..31988a353 100644 --- a/crates/ui-egui/src/proto_editor_tests.rs +++ b/crates/ui-egui/src/proto_editor_tests.rs @@ -226,3 +226,64 @@ fn the_presenter_inspects_the_layer_under_the_pointer() { assert_eq!(presenter(&u)["inspected"], json!(a)); assert_eq!(u.app.inspect()["presentOptions"]["inspect"], json!(true)); } + +#[test] +fn deleting_a_prototype_interaction_removes_the_interaction_not_the_component() { + 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]})); + crate::proto_panel::open_editor(&u.ctx, Some((btn, 0))); + u.frames(1, Vec::new); + + assert!(u.app.session.doc().unwrap().node(btn).is_some()); + assert_eq!(u.app.session.doc().unwrap().node(btn).unwrap().interactions.len(), 1); + assert_eq!(crate::proto_panel::editor(&u.ctx), Some((btn, 0))); + + // Pressing Delete when an interaction is selected should delete the interaction, NOT the component. + u.key(pos2(100.0, 100.0), egui::Key::Delete); + + assert!(u.app.session.doc().unwrap().node(btn).is_some(), "Bug #767 regression: component was deleted when deleting prototype interaction!"); + assert_eq!(u.app.session.doc().unwrap().node(btn).unwrap().interactions.len(), 0, "the interaction should be removed"); + assert_eq!(crate::proto_panel::editor(&u.ctx), None); + + // Re-add interaction and test Backspace as well. + u.run("proto.interaction.add", json!({"id": btn, "dest": b})); + assert_eq!(u.app.session.doc().unwrap().node(btn).unwrap().interactions.len(), 1); + crate::proto_panel::open_editor(&u.ctx, Some((btn, 0))); + u.frames(1, Vec::new); + u.key(pos2(100.0, 100.0), egui::Key::Backspace); + assert!(u.app.session.doc().unwrap().node(btn).is_some()); + assert_eq!(u.app.session.doc().unwrap().node(btn).unwrap().interactions.len(), 0); + assert_eq!(crate::proto_panel::editor(&u.ctx), None); + + // When NO interaction is active, Delete deletes the component as normal. + u.key(pos2(100.0, 100.0), egui::Key::Delete); + assert!(u.app.session.doc().unwrap().node(btn).is_none(), "when no interaction is selected, Delete removes the layer"); +} + +#[test] +fn escape_closes_prototype_editor_without_deselecting_layer() { + 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]})); + crate::proto_panel::open_editor(&u.ctx, Some((btn, 0))); + u.frames(1, Vec::new); + + assert_eq!(crate::proto_panel::editor(&u.ctx), Some((btn, 0))); + assert_eq!(u.app.session.selection(), vec![btn]); + + // First Escape closes the interaction editor; layer remains selected. + u.key(pos2(100.0, 100.0), egui::Key::Escape); + 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. + 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"); +} diff --git a/crates/ui-egui/src/proto_panel.rs b/crates/ui-egui/src/proto_panel.rs index 47312e991..20546008d 100644 --- a/crates/ui-egui/src/proto_panel.rs +++ b/crates/ui-egui/src/proto_panel.rs @@ -40,6 +40,44 @@ pub fn editor(ctx: &egui::Context) -> Option<(NodeId, usize)> { ctx.data(|d| d.get_temp(editor_id())) } +/// Whether an interaction is selected (its editor is open). +pub fn has_selected_interaction(app: &FigApp, ctx: &egui::Context) -> bool { + let Some((node, index)) = editor(ctx) else { return false }; + let Ok(ds) = app.session.ds() else { return false }; + ds.doc.node(node).and_then(|n| n.interactions.get(index)).is_some() +} + +/// Delete the selected interaction (when one is active in the Prototype tab). +/// Returns true if an interaction was deleted. +pub fn delete_selected_interaction(app: &mut FigApp, ctx: &egui::Context) -> bool { + if app.ui.right_tab != crate::RightTab::Prototype { + return false; + } + let Some((node, index)) = editor(ctx) else { return false }; + let Ok(ds) = app.session.ds() else { return false }; + if ds.doc.node(node).and_then(|n| n.interactions.get(index)).is_none() { + open_editor(ctx, None); + return false; + } + open_editor(ctx, None); + let ids = targets_for(app, node); + app.run("proto.interaction.remove", json!({"ids": ids, "index": index})); + true +} + +/// Close the interaction editor if open. Returns true if it was open. +pub fn close_editor(ctx: &egui::Context) -> bool { + if capturing(ctx) || crate::variable_ui::picker_open(ctx) { + return false; + } + if editor(ctx).is_some() { + open_editor(ctx, None); + true + } else { + false + } +} + const TRIGGERS: [&str; 10] = [ tr_noop("On click"), tr_noop("On drag"), @@ -607,8 +645,6 @@ fn interactions(app: &mut FigApp, ui: &mut Ui, doc: &Document, page: NodeId, nod #[allow(clippy::too_many_arguments)] fn editor_popover(app: &mut FigApp, ctx: &egui::Context, doc: &Document, page: NodeId, node: NodeId, k: usize, it: &Interaction, at: Pos2) { let t = Tokens::get(ctx); - // Escape in a field (it cancels the edit) doesn't close the editor. - let typing = ctx.egui_wants_keyboard_input(); let width = 280.0; let screen = ctx.content_rect(); let pos = pos2(at.x - width, at.y.min(screen.max.y - 420.0).max(screen.min.y + 48.0)); @@ -652,8 +688,7 @@ fn editor_popover(app: &mut FigApp, ctx: &egui::Context, doc: &Document, page: N }); }); }); - let escape = ctx.input(|i| i.key_pressed(egui::Key::Escape)) && !typing && !capturing(ctx) && !crate::variable_ui::picker_open(ctx); - if close || escape { + if close { open_editor(ctx, None); } } diff --git a/crates/ui-egui/src/right.rs b/crates/ui-egui/src/right.rs index 47f3e5d36..3e2d70c37 100644 --- a/crates/ui-egui/src/right.rs +++ b/crates/ui-egui/src/right.rs @@ -135,6 +135,9 @@ pub fn right_panel(app: &mut FigApp, ui: &mut Ui) { } ui.painter().galley(pos2(r.min.x + 8.0, r.center().y - galley.size().y / 2.0), galley, if active { t.text } else { t.text_secondary }); if resp.clicked() { + if app.ui.right_tab != tab { + crate::proto_panel::open_editor(ui.ctx(), None); + } app.ui.right_tab = tab; } x = r.max.x + 2.0; diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index 09b2c57bb..2408b8f12 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -210,6 +210,11 @@ pub fn swallowed_paste(app: &mut FigApp, ctx: &Context) -> Swallowed { pub fn run_binding(app: &mut FigApp, id: &str) { match id { "select.none" => { + if let Some(ctx) = &app.ui_context { + if crate::proto_panel::close_editor(ctx) { + return; + } + } if let Err(e) = app.session.escape() { app.toast(e.to_string()); } @@ -218,6 +223,14 @@ pub fn run_binding(app: &mut FigApp, id: &str) { "edit.delete" if app.session.tool.pen.is_some() => { let _ = app.session.pen_finish(); } + "edit.delete" + if app.ui.right_tab == crate::RightTab::Prototype + && app.ui_context.as_ref().is_some_and(|ctx| crate::proto_panel::has_selected_interaction(app, ctx)) => + { + if let Some(ctx) = app.ui_context.clone() { + let _ = crate::proto_panel::delete_selected_interaction(app, &ctx); + } + } // Enter with a shape or frame tool chosen places one in the middle of the view. "select.children" if app.session.tool.tool.draws_shape() => { app.run("tool.place", json!({})); @@ -228,6 +241,9 @@ pub fn run_binding(app: &mut FigApp, id: &str) { } fn key_event(app: &mut FigApp, key: Key, physical: Option, m: Modifiers, repeat: bool, now: f64, ctx: &Context) -> bool { + if key == Key::Escape && crate::proto_panel::close_editor(ctx) { + return true; + } if key == Key::Escape && crate::selection_spacing::cancel(app, ctx) { return true; } @@ -238,6 +254,10 @@ fn key_event(app: &mut FigApp, key: Key, physical: Option, m: Modifiers, re if matches!(key, Key::Backspace | Key::Delete) && m.is_none() && app.ui.picker.is_some() && crate::handles::remove_selected_stop(app, ctx) { return true; } + // An interaction selected in the Prototype tab: Delete removes that interaction, not the component. + if matches!(key, Key::Backspace | Key::Delete) && m.is_none() && crate::proto_panel::delete_selected_interaction(app, ctx) { + return true; + } // Vector edit mode and the shape builder have their own keys (tools, nudging points, delete, // join, Enter to finish); the rest fall through. match app.session.tool_key(key.name(), m.shift, m.alt, m.command) { From 1e7983a5509e85b34b73d29a2b9e72ed623b68a2 Mon Sep 17 00:00:00 2001 From: Natnael-Dev Date: Sat, 17 Oct 2026 21:47:40 +0300 Subject: [PATCH 214/817] docs(evidence): record verification evidence for #767 fix --- evidence/fix-delete-prototype-interaction.md | 64 ++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 evidence/fix-delete-prototype-interaction.md diff --git a/evidence/fix-delete-prototype-interaction.md b/evidence/fix-delete-prototype-interaction.md new file mode 100644 index 000000000..54808f9ec --- /dev/null +++ b/evidence/fix-delete-prototype-interaction.md @@ -0,0 +1,64 @@ +# Evidence: Fix Delete Prototype Interaction (#767) + +## Task Summary +- **Target Issue:** upstream [#767](https://github.com/storytold/figcraft/issues/767) - "When deleting a prototype, it also deletes the component." +- **PR:** [#776](https://github.com/storytold/figcraft/pull/776) +- **Branch:** `fix/delete-prototype-interaction` +- **Head Commit:** `bc5a2b8` + +## Root Cause +When an interaction noodle or interaction editor was clicked/selected in the Prototype tab, `proto_canvas.rs` set document selection to `[n.source]` (the layer). When Delete or Backspace was pressed, `shortcuts.rs` dispatched `edit.delete` without checking if an interaction was active, deleting the component instead of the interaction connection. + +## Implemented Fix +- Added `has_selected_interaction`, `delete_selected_interaction`, and `close_editor` in `crates/ui-egui/src/proto_panel.rs`. +- Handled `Key::Delete` and `Key::Backspace` in `shortcuts::key_event` and `run_binding` when in `RightTab::Prototype` with an active interaction, removing the interaction with `proto.interaction.remove` rather than deleting the layer. +- Added canvas deselect on click in `crates/ui-egui/src/proto_canvas.rs` and tab-switch close in `crates/ui-egui/src/right.rs`. +- Handled `Key::Escape` to close the interaction editor first before stepping out / deselecting layers. +- Added comprehensive headless regression tests in `crates/ui-egui/src/proto_editor_tests.rs`. + +## Raw Verification Evidence + +### 1. Test Execution (`cargo test -p figcraft-ui-egui --lib -- proto`) +```text +running 21 tests +test proto_editor_tests::the_builder_takes_variable_operator_value_conditions ... ok +test proto_canvas::tests::curves_leave_the_facing_side ... ok +test perf_tests::prototype_sources_follow_edits_and_undo ... ok +test proto_editor_tests::deleting_a_prototype_interaction_removes_the_interaction_not_the_component ... ok +test proto_editor_tests::the_presenter_inspects_the_layer_under_the_pointer ... ok +test present::tail_tests::prototypes_without_gamepad_triggers_dont_poll ... ok +test proto_responsive_tests::custom_sizes_present_as_a_bare_screen ... ok +test present::tail_tests::widgets_react_to_clicks_in_the_presented_prototype ... ok +test proto_editor_tests::a_click_where_nothing_reacts_flashes_the_hotspots ... ok +test proto_responsive_tests::prototype_panel_shows_colours_custom_sizes_and_responsive ... ok +test proto_editor_tests::escape_closes_prototype_editor_without_deselecting_layer ... ok +test proto_editor_tests::the_interaction_editor_shows_conditionals_and_picks_their_variables ... ok +test proto_responsive_tests::library_collections_show_in_the_mode_picker_under_their_library ... ok +test proto_reorder_tests::actions_inside_a_conditional_block_drag_within_their_block ... ok +test proto_reorder_tests::escape_cancels_an_action_drag_and_keeps_the_editor_open ... ok +test proto_reorder_tests::dragging_an_action_row_reorders_the_actions_in_one_step ... ok +test field_tests::scrubbing_a_prototype_delay_sets_it_once_when_let_go ... ok +test proto_editor_tests::typed_conditions_are_checked_and_errors_show_until_fixed ... ok +test proto_responsive_tests::without_a_device_a_responsive_frame_fills_the_window_at_100_percent ... ok +test proto_responsive_tests::responsive_frames_take_the_devices_screen_live ... ok +test idle_tests::the_prototype_curve_preview_plays_then_rests ... ok + +test result: ok. 21 passed; 0 failed; 0 ignored; 0 measured; 500 filtered out; finished in 0.15s +``` +Exit code: 0 +Passed: 21 +Failed: 0 +Skipped: 0 + +### 2. Format Verification (`cargo fmt --check`) +```text +Exit code: 0 +No formatting diffs found. +``` + +### 3. Git Status & PR +```text +Branch: fix/delete-prototype-interaction +Pull Request: https://github.com/storytold/figcraft/pull/776 +Target: storytold/figcraft:main +``` From 154baa4467f33bde2e26aff9f30cb9cf5c9dfa78 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 01:49:02 +0700 Subject: [PATCH 215/817] M7: a rename selects the whole name, so typing replaces it --- crates/ui-egui/src/layers_rename_tests.rs | 25 +++++++++++++++++++ crates/ui-egui/src/widgets.rs | 30 ++++++++++++++++------- docs/ui-parity.md | 5 ++-- 3 files changed, 49 insertions(+), 11 deletions(-) diff --git a/crates/ui-egui/src/layers_rename_tests.rs b/crates/ui-egui/src/layers_rename_tests.rs index 4f5c6af80..c4b9211c8 100644 --- a/crates/ui-egui/src/layers_rename_tests.rs +++ b/crates/ui-egui/src/layers_rename_tests.rs @@ -170,3 +170,28 @@ fn a_rename_scrolled_out_of_view_goes_on() { press(&mut u, Key::Enter, Modifiers::NONE); assert_eq!(name(&u, top), "Far"); } + +#[test] +fn a_key_typed_in_the_frame_a_rename_starts_replaces_the_name() { + // The app draws no frame between the double-click's last release (or F2, or File ▸ Rename) and + // the first key, so the name field first shows in the frame that types into it. + let (mut u, a, _, _, c) = setup(); + let p = u.row_at(c); + for _ in 0..2 { + u.button(p, true); + u.button(p, false); + } + type_text(&mut u, "Hero"); + press(&mut u, Key::Enter, Modifiers::NONE); + assert_eq!(name(&u, c), "Hero", "a double-click rename"); + u.app.session.execute("select.set", &json!({"ids": [a]})).unwrap(); + u.frame(vec![]); + press(&mut u, Key::F2, Modifiers::NONE); + type_text(&mut u, "Base"); + press(&mut u, Key::Enter, Modifiers::NONE); + assert_eq!(name(&u, a), "Base", "an F2 rename"); + crate::menus::invoke(&mut u.app, "file.rename"); + type_text(&mut u, "Brand kit"); + press(&mut u, Key::Enter, Modifiers::NONE); + assert_eq!(u.app.session.doc().unwrap().name, "Brand kit", "File ▸ Rename"); +} diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index b44135454..3a3f2322e 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -501,7 +501,7 @@ fn text_field_in(ui: &mut Ui, id: Id, value: &str, rect: Rect, placeholder: &str if started { editing = Some(value.to_string()); ui.memory_mut(|m| m.request_focus(id.with("te"))); - select_all_next(ui, id.with("te")); + select_all_next(ui, id.with("te"), value); } let mut out = None; match editing { @@ -593,21 +593,33 @@ pub fn select_all_on_focus(ui: &Ui, r: &Response, text: &str) { ui.data_mut(|d| d.remove::(pending)); return; } - if let Some(mut state) = egui::TextEdit::load_state(ui.ctx(), r.id) { - let all = egui::text::CCursorRange::two(egui::text::CCursor::new(0), egui::text::CCursor::new(text.chars().count())); - state.cursor.set_char_range(Some(all)); - state.store(ui.ctx(), r.id); - ui.ctx().request_repaint(); + // A key typed in the frame the edit started already replaced the selection laid beforehand. + if r.changed() { + ui.data_mut(|d| d.remove::(pending)); + return; } + select_all(ui, r.id, text); + ui.ctx().request_repaint(); if !down { ui.data_mut(|d| d.remove::(pending)); } } /// Has [`select_all_on_focus`] select all of editor `te_id` from now on (an edit that starts -/// with the editor already focused, which then gains no focus). -fn select_all_next(ui: &Ui, te_id: Id) { +/// with the editor already focused, which then gains no focus). Call it before adding the editor: +/// the text is selected at once, so a key typed in the frame the edit starts (the frame after a +/// double-click or F2 is often the one with the first key) replaces it. +fn select_all_next(ui: &Ui, te_id: Id, text: &str) { ui.data_mut(|d| d.insert_temp(select_all_id(te_id), true)); + select_all(ui, te_id, text); +} + +/// Selects all of `text` in editor `te_id`. +fn select_all(ui: &Ui, te_id: Id, text: &str) { + let mut state = egui::TextEdit::load_state(ui.ctx(), te_id).unwrap_or_default(); + let all = egui::text::CCursorRange::two(egui::text::CCursor::new(0), egui::text::CCursor::new(text.chars().count())); + state.cursor.set_char_range(Some(all)); + state.store(ui.ctx(), te_id); } fn select_all_id(te_id: Id) -> Id { @@ -1015,7 +1027,7 @@ pub fn text_field_inline(ui: &mut Ui, id: Id, value: &str, rect: Rect, font: egu if started { buf = Some(value.to_string()); ui.memory_mut(|m| m.request_focus(te_id)); - select_all_next(ui, te_id); + select_all_next(ui, te_id, value); } match buf { Some(mut text) => { diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 0cccf008c..c4d3bedd6 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-10-17 · **Change:** minor (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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (a rename selects the whole name, so typing replaces it; 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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **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: @@ -27,7 +27,7 @@ interaction feel not yet compared. | 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 | | Colour names in hex fields | done | every hex field (fills, strokes, text ranges, effects, layout grids, colour variables, page and prototype backgrounds, the colour picker's Hex) takes a CSS colour name as well: `red` becomes `FF0000`; case, spaces and hyphens are ignored (`Light Blue`); names are opaque and keep the colour's opacity; hex wins where both could match. The picker's CSS field takes every CSS name too (`Color::from_hex_or_name`, `color::named`) | -| Fields select their text on focus | done | a click or Tab into a one-line field selects all of its text, so typing replaces the value: hex and colour fields, number fields, inline fields (a fill's hex, variable values, renames), names, search boxes and dialog fields; a drag from the press selects only what it covers; multi-line fields (descriptions, comments) keep the caret where clicked. The first click into an inline field (a fill's hex) now takes the keyboard; it took a second click (`widgets::select_all_on_focus`, `select_all_tests`) | +| Fields select their text on focus | done | a click or Tab into a one-line field selects all of its text, so typing replaces the value: hex and colour fields, number fields, inline fields (a fill's hex, variable values, renames), names, search boxes and dialog fields; a drag from the press selects only what it covers; multi-line fields (descriptions, comments) keep the caret where clicked. The first click into an inline field (a fill's hex) now takes the keyboard; it took a second click. A rename (double-click, F2, File ▸ Rename, a page) selects the whole name before its field first draws, so a key typed in that same frame replaces the name; it was appended (`widgets::select_all_on_focus`, `select_all_tests`, `layers_rename_tests`) | | Colour picker on a new fill or stroke | done | + opens the picker on the new paint when the selection shares one paint list; on a mixed selection + adds a paint to each layer and no picker opens (#404) | | Blend mode menus: the layer's (Design panel) and each paint's (colour picker) | done | Pass through and Normal are distinct (Normal isolates a group's or frame's children); paints have no pass-through; plus darker drawn exactly on the canvas | @@ -172,6 +172,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| +| 2026-10-18 | minor | A rename (layers double-click, F2, File ▸ Rename, a page) selects the whole name in the frame its field first draws, so the first key replaces the name instead of being appended. Checked in the app on Windows over the control channel | | 2026-10-17 | minor | The community batches #733, #735, #736, #729 and #753: submenus open after a short hover, keep their place along a safe triangle and reopen closed (main and context menus); the Actions palette's tabs, ranked search, keyboard highlight and recents; menu items that need a value ask for it, File ▸ Rename edits in place; Shift+I and Resources open Assets; a draggable Pages/Layers divider; Shift-drag moves the selection; a double-click near a thin stroke, merging dropped points and Flatten keeping open paths in vector editing; live font preview and the selection highlight after line breaks; the colour picker on a new fill or stroke; Paste over and Paste properties from the keyboard; Selection colors (partial: no library styles or variables there) and smart-selection spacing fields and canvas handles (partial: no reorder rings), both also checked by their author on macOS; the keyboard shortcuts panel closes on the home screen; Adwaita window controls on Wayland compositors without server decorations (checked by its author on GNOME; KDE not run). Checked in the app on Windows (submenus by their author), not side by side with Figma. Summary and hours unchanged | | 2026-10-15 | minor | Hex fields take CSS colour names (`red` → `FF0000`): fills, strokes, effects, grids, variables, backgrounds and the colour picker | | 2026-10-15 | minor | Typography: drag the line-height, letter-spacing and paragraph-spacing icons to scrub their values; shared numeric-field rates, resize cursor and one Undo step per gesture (#373). | From 37419afe146f19134170887dd2b23b97e64f00ac Mon Sep 17 00:00:00 2001 From: skylar taylor-barrick Date: Sat, 17 Oct 2026 13:19:13 -0600 Subject: [PATCH 216/817] Open only web links and local libraries from a document A document carries things the app acts on for whoever opens it. Three of them were taken as given. Prototype Open link and Dev Mode dev resources both reached the platform's opener with any scheme. In the web build the opener is window.open, so a saved document could run script in the app's own origin; on the desktop any scheme went to the system's handler. Both now pass through the new engine module `doc_urls`, which allows http, https and mailto and nothing else. It is an allow-list on purpose: a list of known-bad schemes is outgrown by every handler a platform adds. A figcraft:// invite link joined the session at once. The system hands the app whatever such link was followed, which may come from a page or a message, so the Join dialog now opens with the link filled in and the person confirms. A library link stored in a document was loaded from wherever it pointed. Only a path on this computer is followed now, so opening someone else's file cannot make the app contact their server (which on Windows would also send credentials). Tests: each change has one that fails without it, verified by reverting. The prototype test fires through an afterDelay trigger, since no click is needed, and keeps a positive case so a refusal cannot pass vacuously. --- Cargo.lock | 6 ++ Cargo.toml | 3 + crates/engine/Cargo.toml | 1 + crates/engine/src/doc_urls.rs | 48 +++++++++++++ crates/engine/src/doc_urls_tests.rs | 87 +++++++++++++++++++++++ crates/engine/src/lib.rs | 5 ++ crates/engine/src/library_path_tests.rs | 30 ++++++++ crates/engine/src/library_server.rs | 7 ++ crates/ui-egui/src/dev_mode.rs | 5 +- crates/ui-egui/src/lib.rs | 2 + crates/ui-egui/src/live.rs | 12 ++-- crates/ui-egui/src/live_join_tests.rs | 11 +-- crates/ui-egui/src/present.rs | 4 +- crates/ui-egui/src/present_links_tests.rs | 71 ++++++++++++++++++ 14 files changed, 280 insertions(+), 12 deletions(-) create mode 100644 crates/engine/src/doc_urls.rs create mode 100644 crates/engine/src/doc_urls_tests.rs create mode 100644 crates/engine/src/library_path_tests.rs create mode 100644 crates/ui-egui/src/present_links_tests.rs diff --git a/Cargo.lock b/Cargo.lock index 9baacd586..a61d87cc4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -856,6 +856,11 @@ dependencies = [ "libc", ] +[[package]] +name = "craft-docpath" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=82a24b006eefa036b43c09a67fb9a3fbd17ffe63#82a24b006eefa036b43c09a67fb9a3fbd17ffe63" + [[package]] name = "crc32fast" version = "1.5.2" @@ -1511,6 +1516,7 @@ name = "figcraft-engine" version = "0.6.0" dependencies = [ "base64 0.22.1", + "craft-docpath", "figcraft-collab", "figcraft-color", "figcraft-doc", diff --git a/Cargo.toml b/Cargo.toml index 8f125ac3e..fe0893282 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,6 +32,9 @@ figcraft-mcp = { path = "crates/mcp" } figcraft-collab-net = { path = "crates/collab-net" } figcraft-plugin = { path = "crates/plugin" } +# Which paths stored in a document may be followed (craft-libs). +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "82a24b006eefa036b43c09a67fb9a3fbd17ffe63" } + # foundation kurbo = { version = "0.13", features = ["serde"] } thiserror = "2" diff --git a/crates/engine/Cargo.toml b/crates/engine/Cargo.toml index f610c38b3..545d872cc 100644 --- a/crates/engine/Cargo.toml +++ b/crates/engine/Cargo.toml @@ -20,6 +20,7 @@ figcraft-render = { workspace = true } figcraft-format = { workspace = true } figcraft-svg = { workspace = true } figcraft-pdf = { workspace = true } +craft-docpath = { workspace = true } figcraft-plugin = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } diff --git a/crates/engine/src/doc_urls.rs b/crates/engine/src/doc_urls.rs new file mode 100644 index 000000000..3b8417cd2 --- /dev/null +++ b/crates/engine/src/doc_urls.rs @@ -0,0 +1,48 @@ +//! Which URLs stored in a document may be handed to the browser or the system opener. +//! +//! A document can carry URLs that the app opens for whoever views it: a prototype's Open link +//! action ([`crate::proto_run`]) and Dev Mode's dev resources ([`crate::dev_resources`]). Both end +//! up at the platform's opener, so a document that someone else made chooses what that opener is +//! asked to do. Only the schemes a browser would follow on a plain link are allowed: +//! +//! - `javascript:` runs script. In the web build the opener is `window.open`, which executes it in +//! the app's own origin, so a saved document becomes stored XSS. +//! - `file:` and `smb:` reach the file system; on Windows a UNC host also sends credentials. +//! - Windows hands `ms-…:` schemes to application handlers, and macOS and Linux hand unknown +//! schemes to whichever application registered them. +//! +//! The check is lexical and does no I/O. It is deliberately an allow-list: a deny-list of known +//! dangerous schemes is outgrown by every new handler a platform adds. + +/// The schemes a URL stored in a document may use. +const WEB_SCHEMES: [&str; 3] = ["http", "https", "mailto"]; + +/// Whether `url`, stored in a document, may be opened. +/// +/// Requires a scheme from [`WEB_SCHEMES`], compared ignoring ASCII case. A URL with no scheme is +/// refused: the opener would resolve it against the app's own page on the web. Control characters +/// are refused anywhere, because browsers ignore some of them inside a scheme (`java\tscript:` +/// reaches a `javascript:` handler), and `http`/`https` must name a host. +pub fn openable(url: &str) -> bool { + let url = url.trim(); + if url.is_empty() || url.chars().any(char::is_control) { + return false; + } + let Some((scheme, rest)) = url.split_once(':') else { return false }; + // An RFC 3986 scheme, so a stray colon in text cannot look like one. + let mut chars = scheme.chars(); + if !chars.next().is_some_and(|c| c.is_ascii_alphabetic()) || !chars.all(|c| c.is_ascii_alphanumeric() || matches!(c, '+' | '-' | '.')) { + return false; + } + if !WEB_SCHEMES.iter().any(|s| scheme.eq_ignore_ascii_case(s)) { + return false; + } + if scheme.eq_ignore_ascii_case("mailto") { + // `mailto:` names an address. + return !rest.is_empty(); + } + // `http` and `https` name a host, so the authority is required: `http:x` is not a web link, + // and `http:///p` has no host. + let Some(after) = rest.strip_prefix("//") else { return false }; + !after.is_empty() && !after.starts_with('/') +} diff --git a/crates/engine/src/doc_urls_tests.rs b/crates/engine/src/doc_urls_tests.rs new file mode 100644 index 000000000..d42029a0f --- /dev/null +++ b/crates/engine/src/doc_urls_tests.rs @@ -0,0 +1,87 @@ +//! A URL stored in a document reaches the browser or the system opener, so only the schemes a +//! browser follows on a plain link are allowed ([`crate::doc_urls`]). + +use crate::doc_urls::openable; + +#[test] +fn web_links_are_opened() { + for url in [ + "http://example.com", + "https://example.com", + "https://example.com/a/b?c=d#e", + "HTTPS://EXAMPLE.COM", + "HtTp://example.com", + "mailto:a@b.c", + "mailto:a@b.c?subject=hi", + " https://example.com ", + "https://user:pw@example.com:8443/p", + ] { + assert!(openable(url), "{url:?} should open"); + } +} + +#[test] +fn script_and_handler_schemes_are_refused() { + for url in [ + // Runs in the app's own origin on the web build: a saved document would be stored XSS. + "javascript:alert(1)", + "JavaScript:alert(1)", + "jAvAsCrIpT:alert(document.cookie)", + "vbscript:msgbox(1)", + "data:text/html,", + "blob:https://example.com/x", + // Reach the file system; a UNC host also sends Windows credentials. + "file:///etc/passwd", + "file://attacker.example/share/x", + "smb://attacker.example/share/x", + "webdav://attacker.example/x", + // Windows application handlers. + "ms-msdt:/id PCWDiagnostic", + "ms-officecmd:x", + "search-ms:query=x", + "shell:startup", + // Anything else a platform may have registered. + "tel:+1234", + "sms:+1234", + "ssh://host", + "ftp://host/x", + "figcraft://join?host=127.0.0.1", + "zoommtg://zoom.us/join?x", + "view-source:https://example.com", + "jar:https://example.com/x!/y", + ] { + assert!(!openable(url), "{url:?} must be refused"); + } +} + +#[test] +fn a_scheme_is_required_and_control_characters_are_refused() { + for url in [ + // No scheme: the web opener would resolve these against the app's own page. + "", + " ", + "example.com", + "/etc/passwd", + "//example.com", + "\\\\host\\share\\x", + "about", + // Browsers ignore some control characters inside a scheme, so a smuggled one must not + // leave `javascript` looking like an unknown scheme that we then refuse by luck. + "java\tscript:alert(1)", + "java\nscript:alert(1)", + "java\rscript:alert(1)", + "javascript\u{0}:alert(1)", + "https://example.com/\u{0}", + // A colon in ordinary text is not a scheme. + "see page 2: the diagram", + "1https://example.com", + // The allowed schemes still need their own part. + "mailto:", + "http:", + "http:example.com", + "http:///p", + "https://", + ] { + assert!(!openable(url), "{url:?} must be refused"); + } +} diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 2b09c5c37..80de797eb 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -26,6 +26,7 @@ pub mod dev_resources; pub mod devcompare; pub mod devinspect; pub mod distance; +pub mod doc_urls; pub mod drop; pub mod file_access; pub mod guard; @@ -1576,6 +1577,8 @@ mod devfocus_tests; #[cfg(test)] mod devinspect_tests; #[cfg(test)] +mod doc_urls_tests; +#[cfg(test)] mod double_click_tests; #[cfg(test)] mod draw_tools_tests; @@ -1636,6 +1639,8 @@ mod invite_links_tests; #[cfg(test)] mod keymap_tests; #[cfg(test)] +mod library_path_tests; +#[cfg(test)] mod library_range_styles_tests; #[cfg(test)] mod library_variables_tests; diff --git a/crates/engine/src/library_path_tests.rs b/crates/engine/src/library_path_tests.rs new file mode 100644 index 000000000..f15105dc8 --- /dev/null +++ b/crates/engine/src/library_path_tests.rs @@ -0,0 +1,30 @@ +//! A library link is stored in the document, so it is followed only on this computer +//! ([`crate::library_server`]): a path on another server would make opening someone else's file +//! contact that server, and on Windows send the credentials of whoever opened it. + +use crate::Session; + +#[test] +fn a_library_is_opened_only_from_this_computer() { + let mut s = Session::new(); + for path in [ + r"\\attacker.example\share\lib.figcraft", + "//attacker.example/share/lib.figcraft", + "file://attacker.example/share/lib.figcraft", + r"\\?\UNC\attacker.example\share\lib.figcraft", + r"\\.\pipe\lib", + "https://attacker.example/lib.figcraft", + ] { + let e = s.fetch_library(path, false).expect_err(&format!("{path} must be refused")); + assert!(e.to_string().contains("only from this computer"), "{path}: {e}"); + } +} + +#[test] +fn a_local_library_path_is_still_followed() { + let mut s = Session::new(); + // Refused for being absent, not for where it is: the gate let it through. + let missing = std::env::temp_dir().join("figcraft-no-such-library.figcraft"); + let e = s.fetch_library(&missing.to_string_lossy(), false).expect_err("the file does not exist"); + assert!(!e.to_string().contains("only from this computer"), "a local path must not be refused as remote: {e}"); +} diff --git a/crates/engine/src/library_server.rs b/crates/engine/src/library_server.rs index dbd97a0b2..99d5f29af 100644 --- a/crates/engine/src/library_server.rs +++ b/crates/engine/src/library_server.rs @@ -129,6 +129,13 @@ impl Session { /// document uses the library. pub fn fetch_library(&mut self, path: &str, fresh: bool) -> Result> { if !is_server_link(path) { + // A library link is stored in the document, so opening someone else's file would + // otherwise reach whatever path it names. Only a path on this computer is followed: a + // network share would make opening a document contact that server, and on Windows + // send the credentials of whoever opened it. + if !craft_docpath::is_local(path) { + return Err(EngineError::Other(format!("{path}: a library is opened only from this computer"))); + } return self.libraries.load(path); } let have = match self.libraries.cached(path) { diff --git a/crates/ui-egui/src/dev_mode.rs b/crates/ui-egui/src/dev_mode.rs index 0fedccd7f..f5c7e40ff 100644 --- a/crates/ui-egui/src/dev_mode.rs +++ b/crates/ui-egui/src/dev_mode.rs @@ -635,8 +635,9 @@ pub fn dev_resources_section(app: &mut FigApp, ui: &mut Ui, doc: &Document, id: }; ui.painter().text(pos2(x, r.center().y + 7.0), Align2::LEFT_CENTER, widgets::elide(ui, &below, text_w), regular(10.0), t.text_secondary); crate::a11y::link(&resp, name); - // Opened only on a click, never fetched. - if resp.on_hover_text(url.as_str()).clicked() { + // Opened only on a click, never fetched, and a dev resource's URL comes from the + // document, so only a web link opens. + if resp.on_hover_text(url.as_str()).clicked() && figcraft_engine::doc_urls::openable(&url) { ui.ctx().open_url(egui::OpenUrl::new_tab(url)); } if let Some(i) = item.index { diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index e6a14ede4..4dba320ca 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -171,6 +171,8 @@ mod plugins_browse_tests; #[cfg(test)] mod popup_width_tests; #[cfg(test)] +mod present_links_tests; +#[cfg(test)] mod present_tests; #[cfg(test)] mod present_view_tests; diff --git a/crates/ui-egui/src/live.rs b/crates/ui-egui/src/live.rs index 35af5d14a..513060aba 100644 --- a/crates/ui-egui/src/live.rs +++ b/crates/ui-egui/src/live.rs @@ -1047,12 +1047,14 @@ pub fn open_join(app: &mut FigApp, link: &str) { app.ui.live.focus_join = true; } -/// An invite link the app was opened with (`figcraft figcraft://join?…`): join at once; a link -/// that can't be used shows in the Join dialog with the reason. +/// An invite link the app was opened with (`figcraft figcraft://join?…`): the Join dialog opens +/// with the link filled in, so joining is the person's own choice. +/// +/// The system hands the app any `figcraft://` link that is followed, which may be a page, a +/// message or a document rather than something the person meant to act on, so the link is shown +/// and confirmed rather than acted on. pub fn open_invite(app: &mut FigApp, link: &str) { - if app.run("collab.join", json!({"link": link.trim()})).is_none() { - open_join(app, link.trim()); - } + open_join(app, link.trim()); } /// Escape closes the Join or Publish dialog (before the canvas's shortcuts see it: it doesn't diff --git a/crates/ui-egui/src/live_join_tests.rs b/crates/ui-egui/src/live_join_tests.rs index d74521638..61567ce0d 100644 --- a/crates/ui-egui/src/live_join_tests.rs +++ b/crates/ui-egui/src/live_join_tests.rs @@ -47,12 +47,14 @@ fn escape_closes_the_join_dialog_and_keeps_the_selection() { } #[test] -fn opening_the_app_with_an_invite_link_joins() { +fn opening_the_app_with_an_invite_link_asks_before_joining() { let (mut h, _) = Harness::new(); let link = "figcraft://join?host=127.0.0.1:47900&file=abc&token=AbCdEfGhIjKlMnOpQrStUv"; crate::live::open_invite(&mut h.app, &format!(" {link} ")); - assert_eq!(h.app.session.live().status, Status::Connecting); - assert!(h.app.ui.live.join.is_none(), "no dialog: it joins at once"); + // The system hands the app whatever `figcraft://` link was followed, which may come from a + // page or a message, so the link is shown and confirmed rather than acted on. + assert_eq!(h.app.ui.live.join.as_deref(), Some(link), "the dialog opens with the link filled in"); + assert_eq!(h.app.session.live().status, Status::Off, "nothing is joined until the person confirms"); } /// The browser's link: joins, can't host; joining fails here to show the dialog path. @@ -82,7 +84,8 @@ fn a_link_that_cant_be_used_opens_the_dialog_with_it() { h.app.session.live.install(Box::new(Browser)); crate::live::open_invite(&mut h.app, "figcraft://nope"); assert_eq!(h.app.ui.live.join.as_deref(), Some("figcraft://nope"), "the link stays in the field to fix"); - assert!(h.app.ui.last_error.as_deref().is_some_and(|e| e.contains("not a live session invite"))); + // The link is not tried until the person presses Join, so its reason shows then, not now. + assert!(h.app.ui.last_error.is_none()); assert_eq!(h.app.session.live().status, Status::Off); } diff --git a/crates/ui-egui/src/present.rs b/crates/ui-egui/src/present.rs index 863b540fa..cc78c86bd 100644 --- a/crates/ui-egui/src/present.rs +++ b/crates/ui-egui/src/present.rs @@ -865,7 +865,9 @@ impl Presenter { } Action::CloseOverlay => self.close_overlay(now), Action::OpenUrl { url } => { - if !url.trim().is_empty() { + // The URL comes from the document and this action fires from whatever trigger the + // prototype sets, including a delay, so no click is implied: only a web link opens. + if figcraft_engine::doc_urls::openable(url) { self.urls.push(url.clone()); } true diff --git a/crates/ui-egui/src/present_links_tests.rs b/crates/ui-egui/src/present_links_tests.rs new file mode 100644 index 000000000..8223890c2 --- /dev/null +++ b/crates/ui-egui/src/present_links_tests.rs @@ -0,0 +1,71 @@ +//! A prototype's Open link action carries a URL from the document and fires from whatever trigger +//! the prototype sets, including a delay, so the player hands the opener only a web link +//! ([`figcraft_engine::doc_urls`]). Without that, a saved document opens `javascript:` in the web +//! build's own origin (stored XSS) and `smb:`/`ms-…:` through the desktop's handlers. + +use std::sync::{Arc, Mutex}; + +use figcraft_engine::Session; +use serde_json::{Value, json}; + +use crate::Services; +use crate::present_tests::{Ui as Harness, id}; + +/// Records every URL the player asks the platform to open. +#[derive(Default)] +struct Opened(Arc>>); + +impl Services for Opened { + fn open_url(&mut self, url: &str) { + if let Ok(mut v) = self.0.lock() { + v.push(url.to_string()); + } + } +} + +fn ex(s: &mut Session, cmd: &str, p: Value) -> Value { + s.execute(cmd, &p).unwrap_or_else(|e| panic!("{cmd} {p}: {e}")) +} + +/// A presented frame whose layer opens `url` 100ms after the screen appears — no click anywhere. +fn opens_after_a_delay(url: &str) -> Vec { + let mut s = Session::new(); + let f = id(&ex(&mut s, "frame.create", json!({"x": 0, "y": 0, "width": 300, "height": 400, "name": "A"}))); + let layer = id(&ex(&mut s, "shape.rectangle", json!({"x": 10, "y": 10, "width": 30, "height": 30, "parent": f}))); + ex( + &mut s, + "proto.interaction.add", + json!({"id": layer, "trigger": {"type": "afterDelay", "ms": 100}, "action": {"type": "openUrl", "url": url}, "transition": {"type": "instant"}}), + ); + let seen = Arc::new(Mutex::new(Vec::new())); + let mut u = Harness::new(s); + u.app.services = Box::new(Opened(seen.clone())); + u.run("proto.present", json!({"start": f})); + // Well past the delay. + u.frames(40, Vec::new); + seen.lock().map(|v| v.clone()).unwrap_or_default() +} + +#[test] +fn a_prototype_opens_web_links() { + assert_eq!(opens_after_a_delay("https://example.com/a"), ["https://example.com/a"]); + assert_eq!(opens_after_a_delay("mailto:a@b.c"), ["mailto:a@b.c"]); +} + +#[test] +fn a_prototype_cannot_open_a_script_or_handler_url() { + for url in [ + // In the web build the opener is `window.open`, which runs this in the app's own origin. + "javascript:alert(document.cookie)", + "JavaScript:alert(1)", + "data:text/html,", + // Reaches the file system; a UNC host also sends Windows credentials. + "file:///etc/passwd", + "smb://attacker.example/share/x", + // Handed to an application handler by the desktop. + "ms-msdt:/id PCWDiagnostic", + "figcraft://join?host=127.0.0.1:47900&file=f&token=t", + ] { + assert!(opens_after_a_delay(url).is_empty(), "{url:?} must never reach the opener"); + } +} From f7188de93dfe820a1e434af58551b3eb23c1d97b Mon Sep 17 00:00:00 2001 From: skylar taylor-barrick Date: Sat, 17 Oct 2026 13:35:44 -0600 Subject: [PATCH 217/817] Drop a needless borrow in the dev-resource link gate clippy::needless_borrow; `url` is already a reference. Missed on review because a workspace clippy run aborts at the first failing crate, which was figcraft-format. --- crates/ui-egui/src/dev_mode.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/dev_mode.rs b/crates/ui-egui/src/dev_mode.rs index f5c7e40ff..d34560885 100644 --- a/crates/ui-egui/src/dev_mode.rs +++ b/crates/ui-egui/src/dev_mode.rs @@ -637,7 +637,7 @@ pub fn dev_resources_section(app: &mut FigApp, ui: &mut Ui, doc: &Document, id: crate::a11y::link(&resp, name); // Opened only on a click, never fetched, and a dev resource's URL comes from the // document, so only a web link opens. - if resp.on_hover_text(url.as_str()).clicked() && figcraft_engine::doc_urls::openable(&url) { + if resp.on_hover_text(url.as_str()).clicked() && figcraft_engine::doc_urls::openable(url) { ui.ctx().open_url(egui::OpenUrl::new_tab(url)); } if let Some(i) = item.index { From c7acd1a81d48f1bf49071a55877e012a395c5b6e Mon Sep 17 00:00:00 2001 From: skylar taylor-barrick Date: Sat, 17 Oct 2026 13:35:44 -0600 Subject: [PATCH 218/817] chore: clear the rustc 1.96 clippy lints that fail xtask ci Unrelated to the security changes in this branch; `main` already failed `clippy --workspace --all-targets -- -D warnings` without them. Eight clippy::nonminimal_bool sites across seven files, each taking clippy's own suggested rewrite. Every rewrite is pure boolean algebra with the negation kept outside, so the float comparisons and their NaN behaviour are untouched: !A && !B becomes !(A || B), and !opt.is_some_and(f) becomes opt.is_none_or(!f). Two sites needed explicit parentheses the suggestion omitted, where the rewritten term is the left operand of an && and || binds looser. designcraft cleared the same lint in bc840130; this is figcraft's equivalent. --- apps/figcraft-server/src/config.rs | 2 +- crates/collab-net/src/invite.rs | 2 +- crates/engine/src/cmd/component.rs | 4 +--- crates/engine/src/cmd/edit.rs | 2 +- crates/engine/src/components.rs | 2 +- crates/format/src/fig/export.rs | 15 ++++++++------- crates/format/src/fig/map.rs | 2 +- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/apps/figcraft-server/src/config.rs b/apps/figcraft-server/src/config.rs index 101c7815f..d5f4f761e 100644 --- a/apps/figcraft-server/src/config.rs +++ b/apps/figcraft-server/src/config.rs @@ -182,7 +182,7 @@ impl Config { return Err("`idle_days` must be from 0 to 3650".into()); } let terms = self.terms_url.trim(); - if !terms.is_empty() && !(terms.starts_with("https://") || terms.starts_with("http://")) || terms.contains(char::is_whitespace) { + if !(terms.is_empty() || terms.starts_with("https://") || terms.starts_with("http://")) || terms.contains(char::is_whitespace) { return Err("`terms_url` must be a web address (https://…)".into()); } if self.operator_contact.chars().count() > 120 || self.operator_contact.chars().any(char::is_control) || terms.len() > 500 { diff --git a/crates/collab-net/src/invite.rs b/crates/collab-net/src/invite.rs index bfa2e606e..617ad5187 100644 --- a/crates/collab-net/src/invite.rs +++ b/crates/collab-net/src/invite.rs @@ -203,7 +203,7 @@ fn pairs(query: &str) -> Result, String> { fn with_port(authority: &str, default: u16) -> String { let has_port = match authority.rsplit_once(':') { // `[v6]` alone has colons inside the brackets only. - Some((h, p)) => !(h.starts_with('[') && !h.ends_with(']')) && !p.contains(']'), + Some((h, p)) => (!h.starts_with('[') || h.ends_with(']')) && !p.contains(']'), None => false, }; if has_port { authority.to_string() } else { format!("{authority}:{default}") } diff --git a/crates/engine/src/cmd/component.rs b/crates/engine/src/cmd/component.rs index a8901f241..ff7a56df4 100644 --- a/crates/engine/src/cmd/component.rs +++ b/crates/engine/src/cmd/component.rs @@ -691,9 +691,7 @@ fn push_changes(s: &mut Session, p: &Value) -> Result { let groups: BTreeSet = n .overrides .iter() - .filter(|g| { - !matches!(g.as_str(), "size" | "resizing" | "position" | "component" | "props" | SLOT) && !(d == inst && g.as_str() == "name") - }) + .filter(|g| !(matches!(g.as_str(), "size" | "resizing" | "position" | "component" | "props" | SLOT) || d == inst && g.as_str() == "name")) .cloned() .collect(); for g in &groups { diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index 804c78198..a4769a35c 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -1356,7 +1356,7 @@ fn pattern_fill(s: &mut Session, p: &Value) -> Result { const CMD: &str = "fill.pattern"; let src = req_id(CMD, p, "source")?; let doc = s.doc()?; - if !doc.node(src).is_some_and(|n| !n.is_page()) { + if doc.node(src).is_none_or(|n| n.is_page()) { return Err(bad(CMD, "`source` must be a layer")); } if req_targets(CMD, s, p)?.iter().any(|t| doc.is_ancestor(*t, src)) { diff --git a/crates/engine/src/components.rs b/crates/engine/src/components.rs index ff582b8ad..56efc5c9a 100644 --- a/crates/engine/src/components.rs +++ b/crates/engine/src/components.rs @@ -1498,7 +1498,7 @@ fn patch_copies(doc: &mut Document, seeds: &[(NodeId, Vec<&'static str>)]) -> bo let gs: Vec<&'static str> = groups .iter() .copied() - .filter(|g| !cn.overrides.contains(*g) && !(root && matches!(*g, "visible" | "name" | "position" | "exports" | "interactions"))) + .filter(|g| !(cn.overrides.contains(*g) || root && matches!(*g, "visible" | "name" | "position" | "exports" | "interactions"))) .collect(); if gs.is_empty() { continue; diff --git a/crates/format/src/fig/export.rs b/crates/format/src/fig/export.rs index ca9e2682a..45234bd8d 100644 --- a/crates/format/src/fig/export.rs +++ b/crates/format/src/fig/export.rs @@ -1736,7 +1736,7 @@ impl<'d> Exporter<'d> { let sp = &n.stroke; let (w, h, weight) = (n.width, n.height, sp.weight); let plain = n.strokes.iter().any(|p| p.visible) && sp.dashes.is_empty() && sp.sides.is_none() && sp.profile().is_none() && sp.brush.is_none(); - if !plain || !(weight.is_finite() && weight > 0.0 && w.is_finite() && h.is_finite()) { + if !(plain && weight.is_finite() && weight > 0.0 && w.is_finite() && h.is_finite()) { return; } let whole = matches!(n.kind, NodeKind::Ellipse { sweep, inner, .. } if inner == 0.0 && sweep.abs() >= std::f64::consts::TAU - 1e-9); @@ -2217,12 +2217,13 @@ fn outlined(n: &Node) -> Option<(Node, String)> { NodeKind::Line | NodeKind::Vector { .. } | NodeKind::Ellipse { .. } | NodeKind::Polygon { .. } | NodeKind::Star { .. } | NodeKind::Rectangle ); let shown = |paints: &[Paint]| paints.iter().any(|p| p.visible); - if !shape - || sp.brush.is_some() - || !sp.profile().is_some_and(one_sided) - || !(sp.weight.is_finite() && sp.weight > 0.0) - || !shown(&n.strokes) - || shown(&n.fills) + if !(shape + && sp.brush.is_none() + && sp.profile().is_some_and(one_sided) + && sp.weight.is_finite() + && sp.weight > 0.0 + && shown(&n.strokes) + && !shown(&n.fills)) { return None; } diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 25540ff61..d9aba17ee 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -2045,7 +2045,7 @@ impl<'a> Mapper<'a> { self.warn("slot content assignment uses the empty GUID sentinel and was skipped"); continue; } - if !self.nodes.get(&target).is_some_and(|n| n.get("isSlotContent").and_then(Kv::bool) == Some(true)) { + if self.nodes.get(&target).is_none_or(|n| n.get("isSlotContent").and_then(Kv::bool) != Some(true)) { self.warn("slot content assignment target is missing or is not slot content"); continue; } From dd980c884fae132703ae26612751a459e8e55f46 Mon Sep 17 00:00:00 2001 From: Yarila Date: Sat, 17 Oct 2026 22:00:16 +0500 Subject: [PATCH 219/817] M7: search known files and templates from Home --- ROADMAP.md | 3 +- crates/ui-egui/locales/en.toml | 4 + crates/ui-egui/locales/es.toml | 4 + crates/ui-egui/locales/ru.toml | 4 + crates/ui-egui/src/control.rs | 5 +- crates/ui-egui/src/home.rs | 187 ++++++++++++++++++++++++++++++- crates/ui-egui/src/home_tests.rs | 77 +++++++++++++ crates/ui-egui/src/lib.rs | 1 + crates/ui-egui/src/online.rs | 2 +- docs/control-protocol.md | 5 +- docs/gaps.md | 3 +- docs/ui-parity.md | 4 +- 12 files changed, 287 insertions(+), 12 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 3908e591c..5a77b0955 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (Home search across known files and starter templates; community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -316,6 +316,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Home sidebar search filters open, recent and saved online files plus starter templates, opens a result through its existing action, and shows an empty state; no server-wide query. Numbers unchanged. | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 59b25d949..27b8ec3d3 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -830,6 +830,7 @@ name = "English" "No contributor data was built into this copy." = "No contributor data was built into this copy." "No device" = "No device" "No fonts match" = "No fonts match" +"No files or templates match your search" = "No files or templates match your search" "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 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 layer changes to show." "No libraries yet. Add a .figcraft file that was published as a library, or paste a team library's link." = "No libraries yet. Add a .figcraft file that was published as a library, or paste a team library's link." @@ -1175,6 +1176,8 @@ name = "English" "Search actions, layers and tools" = "Search actions, layers and tools" "Search assets" = "Search assets" "Search comments" = "Search comments" +"Search files and templates" = "Search files and templates" +"Search results" = "Search results" "Search fonts" = "Search fonts" "Search layers" = "Search layers" "Search shortcuts" = "Search shortcuts" @@ -1403,6 +1406,7 @@ name = "English" "Truncate with an ellipsis" = "Truncate with an ellipsis" "Try again" = "Try again" "Try another search or filter." = "Try another search or filter." +"Try another search, or browse templates." = "Try another search, or browse templates." "Try another word, or look at every kind." = "Try another word, or look at every kind." "Turn a layer into a component, reuse it, and change every copy at once" = "Turn a layer into a component, reuse it, and change every copy at once" "Two digits" = "Two digits" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 01c5813bd..8c28e1498 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -831,6 +831,7 @@ status = "draft — needs native review" "No contributor data was built into this copy." = "Esta copia no incluye datos de colaboradores." "No device" = "Sin dispositivo" "No fonts match" = "Ninguna fuente coincide" +"No files or templates match your search" = "Ningún archivo ni plantilla coincide con tu búsqueda" "No join code here (the server is older than join codes, or this address can't be put in one): share the link instead." = "Aquí no hay código para unirse (el servidor es anterior a los códigos, o esta dirección no cabe en uno): comparte el enlace." "No layer changes to show." = "No hay cambios de capas que mostrar." "No libraries yet. Add a .figcraft file that was published as a library, or paste a team library's link." = "Aún no hay bibliotecas. Añade un archivo .figcraft publicado como biblioteca o pega el enlace de una biblioteca de equipo." @@ -1176,6 +1177,8 @@ status = "draft — needs native review" "Search actions, layers and tools" = "Buscar acciones, capas y herramientas" "Search assets" = "Buscar recursos" "Search comments" = "Buscar comentarios" +"Search files and templates" = "Buscar archivos y plantillas" +"Search results" = "Resultados de búsqueda" "Search fonts" = "Buscar fuentes" "Search layers" = "Buscar capas" "Search shortcuts" = "Buscar atajos" @@ -1404,6 +1407,7 @@ status = "draft — needs native review" "Truncate with an ellipsis" = "Truncar con puntos suspensivos" "Try again" = "Reintentar" "Try another search or filter." = "Prueba otra búsqueda u otro filtro." +"Try another search, or browse templates." = "Prueba otra búsqueda o explora las plantillas." "Try another word, or look at every kind." = "Prueba con otra palabra o mira todos los tipos." "Turn a layer into a component, reuse it, and change every copy at once" = "Convierte una capa en componente, reutilízalo y cambia todas las copias a la vez" "Two digits" = "Dos dígitos" diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 998eefdae..a0675ee03 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -818,6 +818,7 @@ name = "Русский" "No contributor data was built into this copy." = "В этой сборке нет данных об участниках." "No device" = "Без устройства" "No fonts match" = "Подходящих шрифтов нет" +"No files or templates match your search" = "Файлы и шаблоны по запросу не найдены" "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, опубликованный как библиотека, или вставьте ссылку на командную библиотеку." @@ -1156,6 +1157,8 @@ name = "Русский" "Search actions, layers and tools" = "Поиск действий, слоёв и инструментов" "Search assets" = "Поиск ресурсов" "Search comments" = "Поиск комментариев" +"Search files and templates" = "Поиск файлов и шаблонов" +"Search results" = "Результаты поиска" "Search fonts" = "Поиск шрифтов" "Search layers" = "Поиск слоёв" "Search shortcuts" = "Поиск сочетаний клавиш" @@ -1381,6 +1384,7 @@ name = "Русский" "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" = "Две цифры" diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rs index a66e1ed9c..a4a8dd15d 100644 --- a/crates/ui-egui/src/control.rs +++ b/crates/ui-egui/src/control.rs @@ -15,7 +15,7 @@ //! for the frames that follow (all false: released); `gamepad` presses a controller button in the //! prototype playing (presenter or preview pane) //! - `ui.menu.invoke {id}` — a menu item exactly like clicking it (may open a dialog) -//! - `ui.set {rightTab?, leftTab?, theme?, home?, homeSection?, homeRecentsView?, homeRecentsSort?, homeRecentsOrder?, palette?, focusRegion?, preview?, presentScroll?, …}` +//! - `ui.set {rightTab?, leftTab?, theme?, home?, homeSection?, homeSearch?, homeRecentsView?, homeRecentsSort?, homeRecentsOrder?, palette?, focusRegion?, preview?, presentScroll?, …}` //! - `ui.screenshot {path?}` — PNG of the window (needs a visible window), written to `path` or //! returned as base64 `data` //! - `ui.render {path?, scale?, ids?}` — PNG of the document (no UI chrome; works without a @@ -429,6 +429,9 @@ pub fn handle(app: &mut FigApp, ctx: &Context, method: &str, p: &Value) -> Resul if let Some(section) = p.get("homeSection").and_then(Value::as_str).and_then(crate::home::Section::parse) { app.ui.home_view.section = section; } + if let Some(query) = p.get("homeSearch").and_then(Value::as_str) { + app.ui.home_view.file_query = query.chars().take(256).collect(); + } if let Some(view) = p.get("homeRecentsView").and_then(Value::as_str).and_then(crate::home_recents::View::parse) { view.store(&mut app.session.prefs); } diff --git a/crates/ui-egui/src/home.rs b/crates/ui-egui/src/home.rs index 856b018ee..3ea255762 100644 --- a/crates/ui-egui/src/home.rs +++ b/crates/ui-egui/src/home.rs @@ -4,6 +4,7 @@ //! the documents themselves, searched and filtered by kind). use std::collections::BTreeMap; +use std::path::Path; use egui::{Align2, Color32, CornerRadius, Id, Rect, Response, Sense, Stroke, StrokeKind, Ui, pos2, vec2}; use figcraft_engine::templates::{Kind, TEMPLATES, Template}; @@ -51,6 +52,8 @@ impl Section { #[derive(Default)] pub struct Home { pub section: Section, + /// Searches known files and starter templates together from the home sidebar. + pub file_query: String, /// The Templates search text and kind filter. pub query: String, pub kind: Option, @@ -143,7 +146,7 @@ pub fn show(app: &mut FigApp, ui: &mut Ui) { let left = Rect::from_min_size(rect.min, vec2(SIDEBAR, rect.height())); ui.painter().line_segment([left.right_top(), left.right_bottom()], Stroke::new(1.0, t.border)); sidebar(app, ui, &t, left); - if app.ui.home_view.section == Section::Online { + if app.ui.home_view.file_query.trim().is_empty() && app.ui.home_view.section == Section::Online { // Your online files lay themselves out in the area (and scroll their own list). let area = Rect::from_min_max(pos2(left.max.x + 40.0, rect.min.y + 24.0), rect.max - vec2(40.0, 24.0)); crate::online::section(app, ui, area, &t); @@ -155,9 +158,14 @@ pub fn show(app: &mut FigApp, ui: &mut Ui) { egui::ScrollArea::vertical().id_salt("home").auto_shrink([false, false]).show(ui, |ui| { egui::Frame::NONE.inner_margin(egui::Margin::symmetric(40, 24)).show(ui, |ui| { ui.spacing_mut().item_spacing = vec2(GAP, 0.0); - match app.ui.home_view.section { - Section::Templates => templates(app, ui, &t), - _ => recents(app, ui, &t), + if app.ui.home_view.file_query.trim().is_empty() { + match app.ui.home_view.section { + Section::Templates => templates(app, ui, &t), + _ => recents(app, ui, &t), + } + } else { + search_results(app, ui, &t); + opened_join(app); } }); }); @@ -198,10 +206,39 @@ fn sidebar(app: &mut FigApp, ui: &mut Ui, t: &Tokens, left: Rect) { icons::paint(ui.painter(), Rect::from_min_size(pos2(left.min.x + 16.0, y), vec2(20.0, 20.0)), Icon::Logo, ACCENT); ui.painter().text(pos2(left.min.x + 44.0, y + 10.0), Align2::LEFT_CENTER, "FigCraft", semibold(14.0), t.text); y += 48.0; + let search = Rect::from_min_size(pos2(left.min.x + 8.0, y), vec2(SIDEBAR - 16.0, 32.0)); + ui.scope_builder(egui::UiBuilder::new().max_rect(search), |ui| { + ui.painter().rect_filled(search, CornerRadius::same(5), t.field); + icons::paint( + ui.painter(), + Rect::from_center_size(pos2(search.min.x + 18.0, search.center().y), vec2(16.0, 16.0)), + Icon::Search, + t.icon_secondary, + ); + let text_rect = Rect::from_min_max(pos2(search.min.x + 36.0, search.center().y - 8.0), pos2(search.max.x - 8.0, search.center().y + 8.0)); + let mut child = ui.new_child(egui::UiBuilder::new().max_rect(text_rect)); + let response = child.add( + egui::TextEdit::singleline(&mut app.ui.home_view.file_query) + .id(Id::new("home_file_search")) + .frame(egui::Frame::NONE) + .font(regular(12.0)) + .hint_text(tr("Search files and templates")) + .vertical_align(egui::Align::Center) + .desired_width(text_rect.width()), + ); + widgets::select_all_on_focus(ui, &response, &app.ui.home_view.file_query); + a11y::text(&response, tr("Search files and templates"), &app.ui.home_view.file_query); + if response.has_focus() { + ui.painter().rect_stroke(search, CornerRadius::same(5), Stroke::new(1.0, t.accent), StrokeKind::Inside); + } else if ui.rect_contains_pointer(search) { + ui.painter().rect_stroke(search, CornerRadius::same(5), Stroke::new(1.0, t.field_hover_border), StrokeKind::Inside); + } + }); + y += 32.0 + 4.0; for (section, icon, label) in Section::ALL { let r = Rect::from_min_size(pos2(left.min.x + 8.0, y), vec2(SIDEBAR - 16.0, 32.0)); let resp = ui.interact(r, ui.id().with(("home_section", label)), Sense::click()); - let current = app.ui.home_view.section == section; + let current = app.ui.home_view.file_query.trim().is_empty() && app.ui.home_view.section == section; a11y::tab(&resp, tr(label), current); if current || resp.hovered() { ui.painter().rect_filled(r, CornerRadius::same(5), if current { t.selected_row } else { t.hover }); @@ -211,11 +248,151 @@ fn sidebar(app: &mut FigApp, ui: &mut Ui, t: &Tokens, left: Rect) { ui.painter().text(pos2(r.min.x + 36.0, r.center().y), Align2::LEFT_CENTER, tr(label), regular(12.0), t.text); if resp.clicked() { app.ui.home_view.section = section; + app.ui.home_view.file_query.clear(); } y += 34.0; } } +fn file_matches(name: &str, location: &str, query: &str) -> bool { + name.to_lowercase().contains(query) || location.to_lowercase().contains(query) +} + +/// A search result with a name and optional location on separate lines. The larger hit target +/// keeps a short results list readable on the wide home screen. +fn search_file_card(ui: &mut Ui, t: &Tokens, id: Id, row: &FileRow) -> bool { + let (r, _) = ui.allocate_exact_size(vec2(ui.available_width().min(640.0), 64.0), Sense::hover()); + let resp = ui.interact(r, id, Sense::click()); + a11y::button(&resp, row.name); + ui.painter().rect_filled(r, CornerRadius::same(8), if resp.hovered() { t.hover } else { t.field }); + ui.painter().rect_stroke(r, CornerRadius::same(8), Stroke::new(1.0, t.border), StrokeKind::Inside); + focus_ring(ui, t, r, &resp, 8); + if let Some((icon, tint)) = row.mark { + let mark = Rect::from_center_size(pos2(r.min.x + 29.0, r.center().y), vec2(20.0, 20.0)); + icons::paint(ui.painter(), mark, icon, tint); + } + let width = (r.width() - 78.0).max(1.0); + let name = widgets::elide_font(ui, row.name, width, semibold(13.0)); + let name_y = if row.detail.is_empty() { r.center().y } else { r.min.y + 23.0 }; + ui.painter().text(pos2(r.min.x + 58.0, name_y), Align2::LEFT_CENTER, name, semibold(13.0), row.ink); + if !row.detail.is_empty() { + let detail = widgets::elide_start_font(ui, row.detail, width, regular(row.detail_size)); + ui.painter().text(pos2(r.min.x + 58.0, r.min.y + 44.0), Align2::LEFT_CENTER, detail, regular(row.detail_size), row.detail_ink); + } + if !row.detail.is_empty() { resp.on_hover_text(row.detail).clicked() } else { resp.clicked() } +} + +/// One search over known files and starter templates. It never sends a query or owner token to a +/// server; online files are opened through their existing owner-token command only on click. +fn search_results(app: &mut FigApp, ui: &mut Ui, t: &Tokens) { + heading(ui, t, tr("Search results")); + let query = app.ui.home_view.file_query.trim().to_lowercase(); + let mut count = 0; + let mut switch = None; + let open_paths: Vec<&str> = app.session.docs.iter().filter_map(|d| d.path.as_deref()).collect(); + + let open: Vec<_> = + app.session.docs.iter().enumerate().filter(|(_, d)| file_matches(&d.doc.name, d.path.as_deref().unwrap_or_default(), &query)).collect(); + if !open.is_empty() { + subheading(ui, t, tr("Open files")); + for (index, d) in open { + count += 1; + let row = FileRow { + mark: Some((Icon::Logo, ACCENT)), + name: &d.doc.name, + ink: t.text, + detail: d.path.as_deref().unwrap_or_default(), + detail_size: 11.0, + detail_ink: t.text_secondary, + }; + if search_file_card(ui, t, ui.id().with(("search_open", d.uid)), &row) { + switch = Some(index); + } + ui.add_space(8.0); + } + } + + let recent: Vec<(String, String)> = app + .session + .prefs + .recent_files + .iter() + .filter(|p| !open_paths.contains(&p.as_str())) + .filter_map(|path| { + let p = Path::new(path); + let name = p.file_stem().or_else(|| p.file_name()).map_or_else(|| path.clone(), |n| n.to_string_lossy().into_owned()); + file_matches(&name, path, &query).then(|| (path.clone(), name)) + }) + .collect(); + let mut open_recent = None; + if !recent.is_empty() { + subheading(ui, t, tr("Recent files")); + for (path, name) in &recent { + count += 1; + let row = FileRow { + mark: Some((Icon::Page, t.icon_secondary)), + name, + ink: t.text, + detail: path, + detail_size: 11.0, + detail_ink: t.text_secondary, + }; + if search_file_card(ui, t, ui.id().with(("search_recent", path)), &row) { + open_recent = Some(path.clone()); + } + ui.add_space(8.0); + } + } + + let online: Vec<_> = app.session.prefs.online_files.iter().filter(|f| file_matches(&f.name, &f.server, &query)).cloned().collect(); + let mut open_online = None; + if !online.is_empty() { + subheading(ui, t, tr("Online files")); + for f in &online { + count += 1; + let host = figcraft_engine::online::server_host(&f.server); + let icon = crate::online::mark(f.shared.is_some()); + let row = FileRow { + mark: Some((icon, if f.shared.is_some() { t.success } else { t.icon_secondary })), + name: &f.name, + ink: t.text, + detail: host, + detail_size: 11.0, + detail_ink: t.text_secondary, + }; + if search_file_card(ui, t, ui.id().with(("search_online", &f.server, &f.file)), &row) { + open_online = Some(f.clone()); + } + ui.add_space(8.0); + } + } + let templates: Vec<&Template> = TEMPLATES.iter().filter(|template| matches(template, &query, None)).collect(); + if !templates.is_empty() { + subheading(ui, t, tr("Templates")); + template_grid(app, ui, t, &templates); + } + if count == 0 && templates.is_empty() { + ui.label(egui::RichText::new(tr("No files or templates match your search")).font(semibold(13.0)).color(t.text)); + ui.add_space(6.0); + widgets::label(ui, tr("Try another search, or browse templates."), t.text_secondary); + ui.add_space(16.0); + if widgets::button(ui, tr("Show all templates"), false, true).clicked() { + app.ui.home_view.file_query.clear(); + app.ui.home_view.section = Section::Templates; + } + } + if let Some(index) = switch { + app.run("doc.switch", json!({"index": index})); + app.ui.home = false; + } else if let Some(path) = open_recent { + if app.run_user("file.open", json!({"path": path})).is_some() { + app.ui.home = false; + } + } else if let Some(file) = open_online { + crate::online::open(app, &file); + } +} + /// A ring around a card or row that has the keyboard. fn focus_ring(ui: &Ui, t: &Tokens, rect: Rect, resp: &Response, radius: u8) { if resp.has_focus() { diff --git a/crates/ui-egui/src/home_tests.rs b/crates/ui-egui/src/home_tests.rs index a975bec2d..db052303d 100644 --- a/crates/ui-egui/src/home_tests.rs +++ b/crates/ui-egui/src/home_tests.rs @@ -6,6 +6,7 @@ use egui::accesskit::Role; use egui::{Event, Key, Modifiers, PointerButton, Pos2, Rect, Shape}; use figcraft_engine::Session; +use figcraft_engine::online::OnlineFile; use figcraft_engine::templates::TEMPLATES; use serde_json::json; @@ -184,6 +185,82 @@ fn typing_in_the_search_field_filters() { assert!(u.app.session.docs.is_empty(), "typing opens nothing"); } +#[test] +fn home_search_finds_known_files_and_opens_an_existing_tab() { + let mut session = Session::new(); + session.execute("file.rename", &json!({"name": "North Trail"})).unwrap(); + session.docs[0].path = Some("C:/designs/North Trail.figcraft".into()); + session.prefs.recent_files = + vec!["C:/designs/North Trail.figcraft".into(), "C:/designs/South Trail.figcraft".into(), "C:/designs/Other.figcraft".into()]; + session.prefs.online_files.push(OnlineFile { + server: "wss://share.example/".into(), + file: "trail".into(), + name: "Trail Live".into(), + owner: "test-only-secret".into(), + ..OnlineFile::default() + }); + let mut u = Ui::new(session); + u.app.ui.home = true; + u.app.ui.home_view.file_query = " TRAIL ".into(); + let s = shapes(&mut u); + assert!(has_text(&s, "Search results")); + assert!(has_text(&s, "North Trail") && has_text(&s, "South Trail") && has_text(&s, "Trail Live")); + assert!(!has_text(&s, "Other") && !has_text(&s, "test-only-secret")); + assert_eq!(texts(&s).iter().filter(|(name, pos, _)| name == "North Trail" && pos.y > 90.0).count(), 1, "an open file is not repeated in recents"); + assert_eq!(u.app.inspect()["homeSearch"], " TRAIL "); + + u.app.ui.home_view.file_query = "nothing matches".into(); + let s = shapes(&mut u); + assert!(has_text(&s, "No files or templates match your search")); + assert!(!has_text(&s, "Trail Live") && !has_text(&s, "South Trail")); + assert!(!texts(&s).iter().any(|(name, pos, _)| name == "North Trail" && pos.y > 90.0)); + + u.app.ui.home_view.file_query = "north".into(); + let s = shapes(&mut u); + click(&mut u, text_center(&s, "North Trail")); + assert!(!u.app.ui.home, "choosing an open result shows its editor tab"); + assert_eq!(u.app.session.docs.len(), 1); +} + +#[test] +fn home_search_field_filters_as_typed_and_a_section_click_clears_it() { + let mut u = first_run(); + u.app.session.prefs.recent_files = vec!["C:/designs/Glacier.figcraft".into(), "C:/designs/Forest.figcraft".into()]; + let s = shapes(&mut u); + click(&mut u, text_center(&s, "Search files and templates")); + u.frame(vec![Event::Text("glacier".into())]); + let s = shapes(&mut u); + assert_eq!(u.app.ui.home_view.file_query, "glacier"); + assert!(has_text(&s, "Glacier") && !has_text(&s, "Forest")); + click(&mut u, text_center(&s, "Recents")); + assert!(u.app.ui.home_view.file_query.is_empty()); + assert!(has_text(&shapes(&mut u), "Forest")); +} + +#[test] +fn home_search_includes_templates_and_opens_a_matching_card() { + let mut u = first_run(); + u.app.ui.home_view.file_query = "MOBILE".into(); + let s = settle(&mut u); + assert!(has_text(&s, "Templates") && has_text(&s, "Mobile app")); + assert!(!has_text(&s, "Dashboard")); + click(&mut u, text_center(&s, "Mobile app")); + assert_eq!(u.app.session.doc().unwrap().name, "Mobile app"); + assert!(!u.app.ui.home); +} + +#[test] +fn empty_home_search_can_browse_all_templates() { + let mut u = first_run(); + u.app.ui.home_view.file_query = "no such design".into(); + let s = shapes(&mut u); + assert!(has_text(&s, "No files or templates match your search")); + click(&mut u, text_center(&s, "Show all templates")); + assert!(u.app.ui.home_view.file_query.is_empty()); + assert_eq!(u.app.ui.home_view.section, Section::Templates); + assert!(has_text(&settle(&mut u), "Dashboard")); +} + #[test] fn thumbnails_are_cached_per_theme() { let mut u = first_run(); diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index e6a14ede4..b2d6831ff 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1656,6 +1656,7 @@ impl FigApp { "lastError": self.ui.last_error, "importReport": self.ui.import_report.as_ref().map(import_report::Report::inspect), }); + state["homeSearch"] = json!(self.ui.home_view.file_query); state["pendingOpens"] = json!(self.ui.pending_opens.len()); state } diff --git a/crates/ui-egui/src/online.rs b/crates/ui-egui/src/online.rs index 261424cb0..2f054986d 100644 --- a/crates/ui-egui/src/online.rs +++ b/crates/ui-egui/src/online.rs @@ -72,7 +72,7 @@ fn manage(app: &mut FigApp, ctx: &egui::Context, f: (&str, &str), action: &str, } /// Open recorded file `f` as its owner; its tab shows once the file arrives. -fn open(app: &mut FigApp, f: &OnlineFile) { +pub(crate) fn open(app: &mut FigApp, f: &OnlineFile) { let Some(r) = app.run("collab.openFile", json!({"server": f.server, "file": f.file})) else { return }; if r["alreadyOpen"] == true && !r["document"].is_null() { app.ui.home = false; diff --git a/docs/control-protocol.md b/docs/control-protocol.md index 3a06874e6..c9bf9de06 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -247,12 +247,13 @@ separate calls. Returns `{queued}`. Invoke a menu item exactly like clicking it (this may open a dialog). Returns `{ok, lastError}`. -### `ui.set {rightTab?, leftTab?, theme?, home?, homeSection?, homeRecentsView?, homeRecentsSort?, homeRecentsOrder?, palette?, mainMenu?, focusRegion?, colorPicker?, variables?, layerFilter?, collapseLayers?, exportPreview?, preview?, presentScroll?, colorProfileDialog?, stylePicker?, stylePickerEdit?, stylePickerView?, iconGallery?, protoEditor?, contextMenu?, contextSelectLayer?, commentOpen?, commentDraft?, commentFilter?, commentSort?, commentSearch?, commentReply?, commentEdit?, presentComments?, devCompare?, devCompareMode?, devCompareSplit?, annotationFilter?, resetFrameStats?, pluginsWindow?, pluginsTab?, pluginConfirm?, pluginForm?}` +### `ui.set {rightTab?, leftTab?, theme?, home?, homeSection?, homeSearch?, homeRecentsView?, homeRecentsSort?, homeRecentsOrder?, palette?, mainMenu?, focusRegion?, colorPicker?, variables?, layerFilter?, collapseLayers?, exportPreview?, preview?, presentScroll?, colorProfileDialog?, stylePicker?, stylePickerEdit?, stylePickerView?, iconGallery?, protoEditor?, contextMenu?, contextSelectLayer?, commentOpen?, commentDraft?, commentFilter?, commentSort?, commentSearch?, commentReply?, commentEdit?, presentComments?, devCompare?, devCompareMode?, devCompareSplit?, annotationFilter?, resetFrameStats?, pluginsWindow?, pluginsTab?, pluginConfirm?, pluginForm?}` Switch panels and modes: `rightTab` `design|prototype|inspect`, `leftTab` `file|assets`, `theme`, `home` (bool), `homeSection` (`recents`, `online` or `templates`: which section the home screen shows, as `ui.inspect` reports it; opening `online` asks each server once what became of your online files), `homeRecentsView` (`grid|list`), `homeRecentsSort` (`modified|name|created`) and `homeRecentsOrder` (`desc|asc`): how the home screen shows its recent files (kept in the preferences; `ui.inspect` reports them under `homeRecents` with each file and whether its picture is in), `palette` (bool: the Actions palette), `mainMenu` (bool, or a top-level menu such -as `"Plugins"` to open the main menu with it open), `pluginsWindow` (bool: Plugins ▸ Manage +as `"Plugins"` to open the main menu with it open), `homeSearch` (text, at most 256 characters: filters locally known open, recent and online files plus starter templates in Home; an empty string returns to the selected section), +`pluginsWindow` (bool: Plugins ▸ Manage plugins…), `pluginsTab` (`installed|browse`: that window's tab), `pluginConfirm` (a plugin id of the directory listed last: its install confirmation shows, as its Install button would; `null` closes it), `pluginForm` (`{id, command?}`: start that plugin command like its menu item, opening diff --git a/docs/gaps.md b/docs/gaps.md index 9b1a770c1..85ed33adb 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Where FigCraft falls short of Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (the 2026-10-17 landings: `.fig` import fidelity, budgets for large files, the import report, a `.fig` copy from Save as and paste from another design app (gap 1); menus, the Actions palette, editor fixes, Selection colors and smart-selection spacing (gap 4); catalog counts re-measured (gap 5); bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (Home search across known files and starter templates; the 2026-10-17 landings: `.fig` import fidelity, budgets for large files, the import report, a `.fig` copy from Save as and paste from another design app (gap 1); menus, the Actions palette, editor fixes, Selection colors and smart-selection spacing (gap 4); catalog counts re-measured (gap 5); bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) Every known shortfall against Figma, one entry each, ranked by how much it stops a Figma user from doing real work in FigCraft. Agents: pick work from the top unless the owner says otherwise. The @@ -444,6 +444,7 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Home sidebar searches known open, recent and online files plus starter templates. Accounts and server-wide discovery remain in gap 2; estimates unchanged. | | 2026-10-17 | minor | The 2026-10-17 landings. Gap 1: a new Landed entry (community batches #727 and #728, then #745: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments, images in the message, instance layers' size and resizing overrides, Hug where nothing is recorded; budgets from the file's size; the import report; a `.fig` copy from Save as; paste from another design app), its Missing list cut to what is still left, and the wrong "whether other apps open its files is unknown" replaced by what was checked; all on synthetic files, so the beta blocker and hours stand. Gap 2: server limits, log recovery and web join links in the evidence. Gap 4: menus, the Actions palette and the editor fixes (#733, #735, #736, #729), then Selection colors and smart-selection spacing (#753) landed, none compared side by side. Gap 5: catalog counts re-measured (2,272 entries; drafts at 95–99%; Indonesian, Czech, Turkish and Swedish listed). Gap 8: the Linux and BSD clipboard changes and Wayland window controls, not run there by the maintainers. Ranking and hours unchanged | | 2026-10-15 | minor | Gap 7: bounded canvas overscan for smoother panning. Estimates and ranking unchanged. | | 2026-10-14 | minor | Russian catalog (M9), reviewed and approved by VanTan: all 2,165 current entries, Русский in Preferences and regional ru tags. Russian integer plurals use one/few/many; contributor display name VanTan added. Existing estimates unchanged. | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 0cccf008c..40568c6c9 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-10-17 · **Change:** minor (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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (Home sidebar file and template search; 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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **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: @@ -22,6 +22,7 @@ interaction feel not yet compared. | Actions palette (Cmd+K, Cmd+/) | done | tabs: All (every command, grouped by menu, or Other), 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 opens them from the keyboard (at the focused layer row or below the canvas selection) and the menu takes the keyboard; the Menu key isn't delivered by the windowing layer (egui 0.36 has no key for it) | | 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 | +| Home search | done (ours) | A field in the left sidebar filters open tabs, recent local files and saved online files by name, path or server, plus starter templates by name, description, kind and size. Matching file cards and template cards open through their existing actions; selecting a section clears the query. It does not search other people's projects or files that have never been opened here (`ui.set {homeSearch}`; `ui.inspect.homeSearch`). | | 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 | | 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 | @@ -172,6 +173,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Home sidebar search over known open, recent and online files plus starter templates, with a no-results state. No server-wide search. Estimates unchanged. | | 2026-10-17 | minor | The community batches #733, #735, #736, #729 and #753: submenus open after a short hover, keep their place along a safe triangle and reopen closed (main and context menus); the Actions palette's tabs, ranked search, keyboard highlight and recents; menu items that need a value ask for it, File ▸ Rename edits in place; Shift+I and Resources open Assets; a draggable Pages/Layers divider; Shift-drag moves the selection; a double-click near a thin stroke, merging dropped points and Flatten keeping open paths in vector editing; live font preview and the selection highlight after line breaks; the colour picker on a new fill or stroke; Paste over and Paste properties from the keyboard; Selection colors (partial: no library styles or variables there) and smart-selection spacing fields and canvas handles (partial: no reorder rings), both also checked by their author on macOS; the keyboard shortcuts panel closes on the home screen; Adwaita window controls on Wayland compositors without server decorations (checked by its author on GNOME; KDE not run). Checked in the app on Windows (submenus by their author), not side by side with Figma. Summary and hours unchanged | | 2026-10-15 | minor | Hex fields take CSS colour names (`red` → `FF0000`): fills, strokes, effects, grids, variables, backgrounds and the colour picker | | 2026-10-15 | minor | Typography: drag the line-height, letter-spacing and paragraph-spacing icons to scrub their values; shared numeric-field rates, resize cursor and one Undo step per gesture (#373). | From 1f0d9a9107bfd611aa4ee13b5c973948826c4a98 Mon Sep 17 00:00:00 2001 From: Yarila Date: Sat, 17 Oct 2026 22:30:03 +0500 Subject: [PATCH 220/817] M7: show file previews in Home search --- ROADMAP.md | 2 +- crates/ui-egui/src/home.rs | 60 ++++++++++++------------------ crates/ui-egui/src/home_recents.rs | 52 +++++++++++++++++++++++++- crates/ui-egui/src/home_tests.rs | 29 +++++++++++++++ docs/ui-parity.md | 4 +- 5 files changed, 107 insertions(+), 40 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 5a77b0955..3e9319d14 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -316,7 +316,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| -| 2026-10-17 | minor | Home sidebar search filters open, recent and saved online files plus starter templates, opens a result through its existing action, and shows an empty state; no server-wide query. Numbers unchanged. | +| 2026-10-17 | minor | Home sidebar search filters open, recent and saved online files plus starter templates, opens a result through its existing action, and shows an empty state. Local results reuse recent-file previews and file-type icons; no server-wide query. Numbers unchanged. | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | diff --git a/crates/ui-egui/src/home.rs b/crates/ui-egui/src/home.rs index 3ea255762..77d1a1a32 100644 --- a/crates/ui-egui/src/home.rs +++ b/crates/ui-egui/src/home.rs @@ -12,6 +12,7 @@ use serde_json::json; use crate::FigApp; use crate::a11y; +use crate::home_recents::SearchHit; use crate::i18n::{tr, tr_noop}; use crate::icons::{self, Icon}; use crate::theme::{ACCENT, Tokens, regular, semibold}; @@ -258,8 +259,8 @@ fn file_matches(name: &str, location: &str, query: &str) -> bool { name.to_lowercase().contains(query) || location.to_lowercase().contains(query) } -/// A search result with a name and optional location on separate lines. The larger hit target -/// keeps a short results list readable on the wide home screen. +/// An online search result with a name and optional location on separate lines. Local files use +/// the Recent files cards below so their stored preview and file-type icon are also shown here. fn search_file_card(ui: &mut Ui, t: &Tokens, id: Id, row: &FileRow) -> bool { let (r, _) = ui.allocate_exact_size(vec2(ui.available_width().min(640.0), 64.0), Sense::hover()); let resp = ui.interact(r, id, Sense::click()); @@ -269,7 +270,8 @@ fn search_file_card(ui: &mut Ui, t: &Tokens, id: Id, row: &FileRow) -> bool { focus_ring(ui, t, r, &resp, 8); if let Some((icon, tint)) = row.mark { let mark = Rect::from_center_size(pos2(r.min.x + 29.0, r.center().y), vec2(20.0, 20.0)); - icons::paint(ui.painter(), mark, icon, tint); + ui.painter().rect_filled(mark, CornerRadius::same(4), t.field); + icons::paint(ui.painter(), mark.shrink(2.0), icon, tint); } let width = (r.width() - 78.0).max(1.0); let name = widgets::elide_font(ui, row.name, width, semibold(13.0)); @@ -293,30 +295,15 @@ fn search_results(app: &mut FigApp, ui: &mut Ui, t: &Tokens) { let open: Vec<_> = app.session.docs.iter().enumerate().filter(|(_, d)| file_matches(&d.doc.name, d.path.as_deref().unwrap_or_default(), &query)).collect(); - if !open.is_empty() { - subheading(ui, t, tr("Open files")); - for (index, d) in open { - count += 1; - let row = FileRow { - mark: Some((Icon::Logo, ACCENT)), - name: &d.doc.name, - ink: t.text, - detail: d.path.as_deref().unwrap_or_default(), - detail_size: 11.0, - detail_ink: t.text_secondary, - }; - if search_file_card(ui, t, ui.id().with(("search_open", d.uid)), &row) { - switch = Some(index); - } - ui.add_space(8.0); - } - } + let open_hits: Vec = + open.iter().map(|(_, d)| SearchHit { key: format!("open:{}", d.uid), path: d.path.clone(), name: d.doc.name.clone() }).collect(); let recent: Vec<(String, String)> = app .session .prefs .recent_files .iter() + .filter(|p| figcraft_engine::file_access::allowed(p, figcraft_engine::file_access::Access::Read)) .filter(|p| !open_paths.contains(&p.as_str())) .filter_map(|path| { let p = Path::new(path); @@ -324,23 +311,24 @@ fn search_results(app: &mut FigApp, ui: &mut Ui, t: &Tokens) { file_matches(&name, path, &query).then(|| (path.clone(), name)) }) .collect(); + let recent_hits: Vec = + recent.iter().map(|(path, name)| SearchHit { key: format!("recent:{path}"), path: Some(path.clone()), name: name.clone() }).collect(); + let preview_paths: Vec = open_hits.iter().chain(&recent_hits).filter_map(|hit| hit.path.clone()).collect(); + let reduce_motion = app.reduce_motion(); + app.ui.home_view.recents.prepare_search(ui.ctx(), &preview_paths, ui.input(|i| i.time)); + if !open_hits.is_empty() { + subheading(ui, t, tr("Open files")); + count += open_hits.len(); + if let Some(hit) = crate::home_recents::search_grid(ui, t, &mut app.ui.home_view.recents, &open_hits, reduce_motion) { + switch = open.get(hit).map(|(index, _)| *index); + } + } let mut open_recent = None; - if !recent.is_empty() { + if !recent_hits.is_empty() { subheading(ui, t, tr("Recent files")); - for (path, name) in &recent { - count += 1; - let row = FileRow { - mark: Some((Icon::Page, t.icon_secondary)), - name, - ink: t.text, - detail: path, - detail_size: 11.0, - detail_ink: t.text_secondary, - }; - if search_file_card(ui, t, ui.id().with(("search_recent", path)), &row) { - open_recent = Some(path.clone()); - } - ui.add_space(8.0); + count += recent_hits.len(); + if let Some(hit) = crate::home_recents::search_grid(ui, t, &mut app.ui.home_view.recents, &recent_hits, reduce_motion) { + open_recent = recent_hits.get(hit).and_then(|hit| hit.path.clone()); } } diff --git a/crates/ui-egui/src/home_recents.rs b/crates/ui-egui/src/home_recents.rs index 1796eb02e..8ccc3cec9 100644 --- a/crates/ui-egui/src/home_recents.rs +++ b/crates/ui-egui/src/home_recents.rs @@ -504,6 +504,12 @@ impl Recents { paths.iter().map(|p| Shown::new(p, self.files.get(p).and_then(|k| k.stat))).collect() } + /// Share the Recent files thumbnail cache with Home search. The existing loader keeps file + /// reads off the UI thread and only requests pictures for cards that are on screen. + pub(crate) fn prepare_search(&mut self, ctx: &egui::Context, paths: &[String], time: f64) { + self.refresh(ctx, paths, time); + } + /// For `ui.inspect`: each file listed, whether it is there and whether its picture is in. pub fn inspect(&self, prefs: &Prefs) -> Value { let paths: Vec = listed(&prefs.recent_files).take(SHOWN).cloned().collect(); @@ -724,7 +730,8 @@ fn arrows(ui: &Ui, recents: &mut Recents, files: &[Shown], across: usize, down: /// The square file-type mark before a name. fn file_icon(ui: &Ui, t: &Tokens, center: egui::Pos2, path: &str) { let r = Rect::from_center_size(center, vec2(16.0, 16.0)); - match FileKind::of(Path::new(path)) { + let kind = if path.is_empty() { FileKind::FigCraft } else { FileKind::of(Path::new(path)) }; + match kind { FileKind::FigCraft | FileKind::Fig => { ui.painter().rect_filled(r, CornerRadius::same(4), ACCENT); icons::paint(ui.painter(), r.shrink(3.0), Icon::Logo, Color32::WHITE); @@ -741,6 +748,49 @@ fn file_icon(ui: &Ui, t: &Tokens, center: egui::Pos2, path: &str) { } } +/// A file found by the Home sidebar search. A tab without a disk path has no stored preview yet. +pub(crate) struct SearchHit { + pub key: String, + pub path: Option, + pub name: String, +} + +/// Search results use the same preview, file-type icon and footer as Recent files. A single click +/// still opens the result, as it did before the visual change. +pub(crate) fn search_grid(ui: &mut Ui, t: &Tokens, recents: &mut Recents, files: &[SearchHit], reduce_motion: bool) -> Option { + let (columns, card_w) = grid_columns(ui.available_width()); + let (picture_h, card_h) = card_heights(card_w); + let (time, now) = (ui.input(|i| i.time), figcraft_engine::cmd::comment::now_secs()); + let mut chosen = None; + let mut fading = false; + for (row_index, row) in files.chunks(columns).enumerate() { + let (r, _) = ui.allocate_exact_size(vec2(ui.available_width(), card_h), Sense::hover()); + for (column, file) in row.iter().enumerate() { + let rect = Rect::from_min_size(pos2(r.min.x + column as f32 * (card_w + GAP), r.min.y), vec2(card_w, card_h)); + let resp = ui.interact(rect, ui.id().with(("search_file_card", &file.key)), Sense::click()); + let stat = file.path.as_deref().and_then(|path| recents.files.get(path).and_then(|k| k.stat)); + let shown = Shown { path: file.path.clone().unwrap_or_default(), name: file.name.clone(), stat }; + a11y::named_button(&resp, &spoken(&shown, now)); + let resp = if let Some(path) = file.path.as_deref() { resp.on_hover_text(path) } else { resp }; + let visible = ui.is_rect_visible(rect); + let picture = file.path.as_deref().and_then(|path| recents.picture(path, visible, time)); + if visible { + let alpha = picture.as_ref().map_or(1.0, |(_, _, a)| if reduce_motion { 1.0 } else { *a }); + fading |= alpha < 1.0; + card(ui, t, rect, picture_h, &resp, false, &shown, stat.unwrap_or_default(), picture, alpha, now); + } + if resp.clicked() { + chosen = Some(row_index * columns + column); + } + } + ui.add_space(GAP); + } + if fading { + ui.ctx().request_repaint(); + } + chosen +} + /// The name a card or row has for screen readers: "name, Edited 3 hours ago". fn spoken(file: &Shown, now: u64) -> String { let detail = file.detail(now); diff --git a/crates/ui-egui/src/home_tests.rs b/crates/ui-egui/src/home_tests.rs index db052303d..cf34e5b3c 100644 --- a/crates/ui-egui/src/home_tests.rs +++ b/crates/ui-egui/src/home_tests.rs @@ -222,6 +222,35 @@ fn home_search_finds_known_files_and_opens_an_existing_tab() { assert_eq!(u.app.session.docs.len(), 1); } +#[test] +fn home_search_shows_a_saved_files_preview() { + let dir = std::env::temp_dir().join(format!("figcraft-home-search-preview-{}", std::process::id())); + std::fs::create_dir_all(&dir).unwrap(); + let path = dir.join("Search preview.figcraft"); + let image = image::RgbaImage::from_pixel(64, 32, image::Rgba([30, 140, 210, 255])); + let mut png = Vec::new(); + image.write_to(&mut std::io::Cursor::new(&mut png), image::ImageFormat::Png).unwrap(); + let doc = figcraft_doc::Document::new("Search preview"); + std::fs::write(&path, figcraft_format::save_bytes(&doc, Some(&png)).unwrap()).unwrap(); + + let mut session = Session::empty(); + session.prefs.recent_files.push(path.to_string_lossy().into_owned()); + let mut u = Ui::new(session); + u.app.ui.home_view.file_query = "Search preview".into(); + for _ in 0..400 { + u.frame(vec![]); + if u.app.inspect()["homeRecents"]["files"][0]["picture"] == "picture" { + break; + } + std::thread::sleep(std::time::Duration::from_millis(5)); + } + let s = shapes(&mut u); + assert!(has_text(&s, "Search preview")); + assert!(s.iter().any(|s| matches!(s, Shape::Mesh(m) if m.texture_id != egui::TextureId::default())), "the saved preview is drawn"); + let _ = std::fs::remove_file(path); + let _ = std::fs::remove_dir(dir); +} + #[test] fn home_search_field_filters_as_typed_and_a_section_click_clears_it() { let mut u = first_run(); diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 40568c6c9..13f89118a 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -22,7 +22,7 @@ interaction feel not yet compared. | Actions palette (Cmd+K, Cmd+/) | done | tabs: All (every command, grouped by menu, or Other), 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 opens them from the keyboard (at the focused layer row or below the canvas selection) and the menu takes the keyboard; the Menu key isn't delivered by the windowing layer (egui 0.36 has no key for it) | | 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 | -| Home search | done (ours) | A field in the left sidebar filters open tabs, recent local files and saved online files by name, path or server, plus starter templates by name, description, kind and size. Matching file cards and template cards open through their existing actions; selecting a section clears the query. It does not search other people's projects or files that have never been opened here (`ui.set {homeSearch}`; `ui.inspect.homeSearch`). | +| Home search | done (ours) | A field in the left sidebar filters open tabs, recent local files and saved online files by name, path or server, plus starter templates by name, description, kind and size. Local file results reuse the Recent files thumbnail and file-type icon; online files have an icon but no local preview. Matching cards open through their existing actions; selecting a section clears the query. It does not search other people's projects or files that have never been opened here (`ui.set {homeSearch}`; `ui.inspect.homeSearch`). | | 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 | | 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 | @@ -173,7 +173,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| -| 2026-10-17 | minor | Home sidebar search over known open, recent and online files plus starter templates, with a no-results state. No server-wide search. Estimates unchanged. | +| 2026-10-17 | minor | Home sidebar search over known open, recent and online files plus starter templates, with a no-results state. Local results reuse the Recent files previews and file-type icons. No server-wide search. Estimates unchanged. | | 2026-10-17 | minor | The community batches #733, #735, #736, #729 and #753: submenus open after a short hover, keep their place along a safe triangle and reopen closed (main and context menus); the Actions palette's tabs, ranked search, keyboard highlight and recents; menu items that need a value ask for it, File ▸ Rename edits in place; Shift+I and Resources open Assets; a draggable Pages/Layers divider; Shift-drag moves the selection; a double-click near a thin stroke, merging dropped points and Flatten keeping open paths in vector editing; live font preview and the selection highlight after line breaks; the colour picker on a new fill or stroke; Paste over and Paste properties from the keyboard; Selection colors (partial: no library styles or variables there) and smart-selection spacing fields and canvas handles (partial: no reorder rings), both also checked by their author on macOS; the keyboard shortcuts panel closes on the home screen; Adwaita window controls on Wayland compositors without server decorations (checked by its author on GNOME; KDE not run). Checked in the app on Windows (submenus by their author), not side by side with Figma. Summary and hours unchanged | | 2026-10-15 | minor | Hex fields take CSS colour names (`red` → `FF0000`): fills, strokes, effects, grids, variables, backgrounds and the colour picker | | 2026-10-15 | minor | Typography: drag the line-height, letter-spacing and paragraph-spacing icons to scrub their values; shared numeric-field rates, resize cursor and one Undo step per gesture (#373). | From 1fe78aec6679b49791aae326dcde93e86e400da3 Mon Sep 17 00:00:00 2001 From: Yarila Date: Sat, 17 Oct 2026 22:01:33 +0500 Subject: [PATCH 221/817] M7: respect theme in presenter controls and backdrop --- ROADMAP.md | 1 + crates/doc/src/proto.rs | 11 +++++++++++ crates/engine/src/cmd/proto.rs | 1 + crates/engine/src/proto_present_tests.rs | 15 +++++++++++++++ crates/ui-egui/src/present.rs | 17 +++++------------ crates/ui-egui/src/proto_panel.rs | 7 ++++++- docs/ui-parity.md | 1 + 7 files changed, 40 insertions(+), 13 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 8a587286d..74953dd58 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -316,6 +316,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | The presenter device and scale menus follow the active UI theme. The default presentation backdrop uses the theme canvas token, while a background explicitly selected in Prototype settings remains saved. Numbers unchanged. | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | diff --git a/crates/doc/src/proto.rs b/crates/doc/src/proto.rs index a844774c5..e89a3ed75 100644 --- a/crates/doc/src/proto.rs +++ b/crates/doc/src/proto.rs @@ -803,6 +803,10 @@ impl DeviceRotation { pub struct PrototypeSettings { pub device: String, pub background: figcraft_color::Color, + /// Distinguishes a user-selected colour from the legacy default so the presenter can use + /// its theme canvas token until a background is explicitly chosen. + #[serde(skip_serializing_if = "is_false")] + pub background_custom: bool, /// Applies to devices that turn (phones and tablets). pub rotation: DeviceRotation, /// The device's colour: one of its model's [`Device::colors`] by name (empty or one the model @@ -823,6 +827,7 @@ impl Default for PrototypeSettings { Self { device: "None".into(), background: figcraft_color::Color::from_rgb8_const(0x1E, 0x1E, 0x1E), + background_custom: false, rotation: DeviceRotation::Portrait, color: String::new(), custom_size: PrototypeSettings::CUSTOM_DEFAULT, @@ -859,6 +864,12 @@ pub struct Device { } impl PrototypeSettings { + /// Whether presentation should use the UI theme's canvas token. Old files only stored a + /// colour, so their original default is also treated as automatic. + pub fn uses_theme_background(&self) -> bool { + !self.background_custom && self.background == Self::default().background + } + /// The devices to pick from ("None" presents the frame at its own size). pub const DEVICES: [Device; 19] = [ Device { diff --git a/crates/engine/src/cmd/proto.rs b/crates/engine/src/cmd/proto.rs index be6907b51..438290e64 100644 --- a/crates/engine/src/cmd/proto.rs +++ b/crates/engine/src/cmd/proto.rs @@ -187,6 +187,7 @@ fn settings(s: &mut Session, p: &Value) -> Result { let mut next = prototype.clone(); if let Some(c) = bg { next.background = c; + next.background_custom = true; } if let Some(d) = dev { next.device = d; diff --git a/crates/engine/src/proto_present_tests.rs b/crates/engine/src/proto_present_tests.rs index 9d2bc48ba..c48f3eadd 100644 --- a/crates/engine/src/proto_present_tests.rs +++ b/crates/engine/src/proto_present_tests.rs @@ -16,6 +16,21 @@ fn settings(s: &Session) -> PrototypeSettings { } } +#[test] +fn prototype_background_uses_the_theme_until_a_colour_is_chosen() { + let mut s = Session::new(); + assert!(settings(&s).uses_theme_background()); + // Choosing even the old default explicitly must keep it through a file round trip. + s.execute("proto.settings", &json!({"background": "#1E1E1E"})).unwrap(); + assert!(!settings(&s).uses_theme_background()); + let bytes = figcraft_format::save_bytes(s.doc().unwrap(), None).unwrap(); + let (doc, _) = figcraft_format::load_bytes(&bytes).unwrap(); + let NodeKind::Page { prototype, .. } = &doc.node(doc.pages[0]).unwrap().kind else { panic!("not a page") }; + assert!(!prototype.uses_theme_background()); + s.execute("edit.undo", &json!({})).unwrap(); + assert!(settings(&s).uses_theme_background()); +} + #[test] fn device_rotation_turns_phones_and_tablets_and_is_saved() { let mut s = Session::new(); diff --git a/crates/ui-egui/src/present.rs b/crates/ui-egui/src/present.rs index cc78c86bd..7ce5e9b7a 100644 --- a/crates/ui-egui/src/present.rs +++ b/crates/ui-egui/src/present.rs @@ -1788,8 +1788,7 @@ fn navigation_bar(p: &mut Presenter, ctx: &egui::Context, now: f64) -> Option prototype.clone(), _ => proto::PrototypeSettings::default(), }; - let bg = settings.background; + let bg = if settings.uses_theme_background() { + let canvas = Tokens::get(ui.ctx()).canvas; + figcraft_color::Color::from_rgb8_const(canvas.r(), canvas.g(), canvas.b()) + } else { + settings.background + }; let model = settings.model(); // Phones and tablets turn: a toggle beside the device picker. let rotates = model.is_some_and(|d| d.rotates); diff --git a/docs/ui-parity.md b/docs/ui-parity.md index dcda2c4e5..188b2168e 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -174,6 +174,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look |---|---|---| | 2026-10-17 | minor | Escape or Enter while the pen draws ends the path and keeps its vector in edit mode with the pen, so the next path is drawn into the same layer (unconnected); another Escape leaves edit mode (#760). Entering edit mode on a layer that already is a vector no longer records an empty undo step. Numbers unchanged | | 2026-10-17 | minor | Text layers keep the platform IME on for every frame of an edit, not only frames with input (an idle frame turned it off and macOS dropped each composition, #747); the candidate window opens at the caret instead of the canvas corner; keys pressed while composing go to the IME | +| 2026-10-17 | minor | Presenter device and scale menus use the active theme; the default backdrop uses the theme canvas token, preserving explicit Prototype background choices. Checked in the Windows app. Estimates unchanged. | | 2026-10-17 | minor | The community batches #733, #735, #736, #729 and #753: submenus open after a short hover, keep their place along a safe triangle and reopen closed (main and context menus); the Actions palette's tabs, ranked search, keyboard highlight and recents; menu items that need a value ask for it, File ▸ Rename edits in place; Shift+I and Resources open Assets; a draggable Pages/Layers divider; Shift-drag moves the selection; a double-click near a thin stroke, merging dropped points and Flatten keeping open paths in vector editing; live font preview and the selection highlight after line breaks; the colour picker on a new fill or stroke; Paste over and Paste properties from the keyboard; Selection colors (partial: no library styles or variables there) and smart-selection spacing fields and canvas handles (partial: no reorder rings), both also checked by their author on macOS; the keyboard shortcuts panel closes on the home screen; Adwaita window controls on Wayland compositors without server decorations (checked by its author on GNOME; KDE not run). Checked in the app on Windows (submenus by their author), not side by side with Figma. Summary and hours unchanged | | 2026-10-15 | minor | Hex fields take CSS colour names (`red` → `FF0000`): fills, strokes, effects, grids, variables, backgrounds and the colour picker | | 2026-10-15 | minor | Typography: drag the line-height, letter-spacing and paragraph-spacing icons to scrub their values; shared numeric-field rates, resize cursor and one Undo step per gesture (#373). | From c846f157dcdced43444f536cef5d1d5fb32bac5b Mon Sep 17 00:00:00 2001 From: Nathanael Date: Sun, 18 Oct 2026 07:34:38 +0700 Subject: [PATCH 222/817] fix(ui): SVG and PDF export rows offer no size (#256) (#768) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(ui): SVG and PDF export rows offer no size (#256) The size picker (1x, 2x, 512w…) showed on every export row, but SVG and PDF are vector and their export ignores it (export_bytes_with). It now shows for PNG, JPG and WebP only, and the suffix field takes its width. Refs #256 ("exporting to SVG is offered in different resolutions, although this should not be the case"). Co-Authored-By: Claude Opus 5.5 (1M context) * fix(ui): export size field as an Option; test WebP too (#256) From review: the size field's width is an Option instead of a negative width, and the test checks WebP as well as JPG. Co-Authored-By: Claude Opus 5.5 (1M context) --------- Co-authored-by: Claude Opus 5.5 (1M context) --- crates/ui-egui/src/export_panel.rs | 23 ++++++++++-------- crates/ui-egui/src/export_preview_tests.rs | 28 +++++++++++++++++++++- 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/crates/ui-egui/src/export_panel.rs b/crates/ui-egui/src/export_panel.rs index ade5df297..8617c35a8 100644 --- a/crates/ui-egui/src/export_panel.rs +++ b/crates/ui-egui/src/export_panel.rs @@ -60,20 +60,23 @@ pub fn section(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { } } -/// One export setting: size (typed or picked), suffix, format, advanced options and remove; a -/// PDF's print settings under it. +/// One export setting: size (typed or picked; images only, SVG and PDF are vector), suffix, +/// format, advanced options and remove; a PDF's print settings under it. fn setting_row(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], i: usize, e: &ExportSetting) { row(ui, 32.0, |ui| { // Tighter spacing so the advanced options and remove buttons fit beside the fields. ui.spacing_mut().item_spacing.x = 4.0; - let (size_w, format_w, button, gap) = (52.0, 54.0, 22.0, ui.spacing().item_spacing.x); - let suffix_w = (ui.available_width() - size_w - format_w - button * 2.0 - gap * 4.0).max(32.0); - let presets: Vec = - ExportSize::SCALES.iter().map(|value| ExportSize::Scale { value: *value }.label()).chain(["512w".into(), "512h".into()]).collect(); - if let Some(s) = widgets::combo_field(ui, Id::new(("export_size", i)), &e.size.label(), size_w, &presets) - && ExportSize::parse(&s) != Some(e.size) - { - app.run("export.update", json!({"ids": ids, "index": i, "size": s})); + let (format_w, button, gap) = (54.0, 22.0, ui.spacing().item_spacing.x); + let size_w = e.format.is_raster().then_some(52.0); + let suffix_w = (ui.available_width() - size_w.map_or(0.0, |w| w + gap) - format_w - button * 2.0 - gap * 3.0).max(32.0); + if let Some(size_w) = size_w { + let presets: Vec = + ExportSize::SCALES.iter().map(|value| ExportSize::Scale { value: *value }.label()).chain(["512w".into(), "512h".into()]).collect(); + if let Some(s) = widgets::combo_field(ui, Id::new(("export_size", i)), &e.size.label(), size_w, &presets) + && ExportSize::parse(&s) != Some(e.size) + { + app.run("export.update", json!({"ids": ids, "index": i, "size": s})); + } } if let Some(sfx) = widgets::text_field(ui, Id::new(("export_suffix", i)), &e.suffix, suffix_w, tr("Suffix")) && sfx != e.suffix diff --git a/crates/ui-egui/src/export_preview_tests.rs b/crates/ui-egui/src/export_preview_tests.rs index 3d536a017..d57e294dd 100644 --- a/crates/ui-egui/src/export_preview_tests.rs +++ b/crates/ui-egui/src/export_preview_tests.rs @@ -1,6 +1,7 @@ //! The Export section's Preview row: a slice paints nothing itself, so its preview must show the //! page content under it — the same thing exporting the slice writes — and not a blank -//! transparency checkerboard next to a correct export. +//! transparency checkerboard next to a correct export. And its setting rows: a size only for +//! images. use figcraft_doc::{Document, NodeId}; use figcraft_engine::Session; @@ -50,3 +51,28 @@ fn other_layers_preview_themselves() { assert_eq!([pix.width(), pix.height()], [200, 100], "the layer's own area"); assert!(paints(&pix)); } + +/// SVG and PDF are vector: their export rows offer no size, which their export ignores (#256). +#[test] +fn export_rows_offer_a_size_for_images_only() { + let mut s = Session::new(); + let r = crate::present_tests::id(&s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 100, "height": 80})).unwrap()); + s.execute("select.set", &json!({"ids": [r]})).unwrap(); + s.execute("export.add", &json!({"ids": [r]})).unwrap(); + let mut u = crate::layers_drag_tests::Ui::new(s); + let size_menu = |u: &crate::layers_drag_tests::Ui| u.ctx.read_response(egui::Id::new(("export_size", 0)).with("menu")).is_some(); + u.frame(vec![]); + assert!(size_menu(&u), "PNG has sizes"); + for format in ["svg", "pdf"] { + u.app.run("export.update", json!({"ids": [r], "index": 0, "format": format})); + u.frame(vec![]); + u.frame(vec![]); + assert!(!size_menu(&u), "{format} is vector: no size"); + } + for format in ["jpg", "webp"] { + u.app.run("export.update", json!({"ids": [r], "index": 0, "format": format})); + u.frame(vec![]); + u.frame(vec![]); + assert!(size_menu(&u), "{format} has sizes again"); + } +} From 84a86e1d841e8ac74df20a6077e02f733303aad6 Mon Sep 17 00:00:00 2001 From: Nathanael Date: Sun, 18 Oct 2026 07:35:47 +0700 Subject: [PATCH 223/817] fix(ui): Rotation gets its own icon, not Corner radius's (#256) (#769) * fix(ui): Rotation gets its own icon, not Corner radius's (#256) The Rotation field showed the corner radius icon, so the two fields looked alike. Rotation now shows an angle: two rays from a vertex with the arc between them, drawn in code like the rest of the icon set. Refs #256 ("The icon for rotating objects is the same as for rounding corners"). Co-Authored-By: Claude Opus 5.5 (1M context) * fix(ui): the angle icon is drawn unhinted and centred; its test sits with the icons (#256) From review: the rays and the arc are both unhinted, so the arc meets the rays at the 14 px field size; the glyph moves up half a unit to centre it like the other leads; the test moves from a11y_tests.rs to the icon tests. Co-Authored-By: Claude Opus 5.5 (1M context) --------- Co-authored-by: Claude Opus 5.5 (1M context) --- crates/ui-egui/src/icons.rs | 45 +++++++++++++++++++++++++++++++++++++ crates/ui-egui/src/right.rs | 2 +- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs index 867b08944..fa4fb66ea 100644 --- a/crates/ui-egui/src/icons.rs +++ b/crates/ui-egui/src/icons.rs @@ -83,6 +83,7 @@ icons! { FlipH, FlipV, CornerRadius, + Angle, IndependentCorners, LinkOn, LinkOff, @@ -694,6 +695,12 @@ fn draw(p: &P, icon: Icon) { p.fill(&[(3.0, 9.0), (13.0, 9.0), (13.0, 14.0)]); } CornerRadius => p.corner(2.5, 2.5, 1.0, 1.0, 11.5, 6.0), + Angle => { + // Two rays from a vertex, the arc between them marking the angle (all unhinted, so + // the arc meets the rays at every size). + p.path(&[(13.5, 13.0), (2.5, 13.0), (10.5, 3.0)], false); + p.path(&arc_pts(2.5, 13.0, 6.0, (-10.0f32).atan2(8.0), 0.0).collect::>(), false); + } IndependentCorners => { for (x, y, dx, dy) in [(2.5, 2.5, 1.0, 1.0), (13.5, 2.5, -1.0, 1.0), (2.5, 13.5, 1.0, -1.0), (13.5, 13.5, -1.0, -1.0)] { p.corner(x, y, dx, dy, 4.0, 2.0); @@ -1181,4 +1188,42 @@ mod tests { assert_eq!(triangulate(&rev).len(), (arrow.len() - 2) * 3); assert!(triangulate(&arrow[..2]).is_empty()); } + + /// The points painted inside `area`, relative to the top left of what's painted there (in + /// quarter points), so the same icon gives the same marks wherever its field puts it. + fn marks(shapes: &[egui::epaint::ClippedShape], area: Rect) -> Vec<(i32, i32)> { + fn walk(shape: &Shape, out: &mut Vec) { + match shape { + Shape::Vec(v) => v.iter().for_each(|s| walk(s, out)), + Shape::LineSegment { points, .. } => out.extend(points), + Shape::Path(p) => out.extend(&p.points), + Shape::Circle(c) => out.push(c.center), + _ => {} + } + } + let mut pts = Vec::new(); + shapes.iter().for_each(|c| walk(&c.shape, &mut pts)); + pts.retain(|p| area.contains(*p)); + let x0 = pts.iter().map(|p| p.x).fold(f32::INFINITY, f32::min); + let y0 = pts.iter().map(|p| p.y).fold(f32::INFINITY, f32::min); + let mut out: Vec<(i32, i32)> = pts.into_iter().map(|p| (((p.x - x0) * 4.0).round() as i32, ((p.y - y0) * 4.0).round() as i32)).collect(); + out.sort_unstable(); + out.dedup(); + out + } + + /// The Design panel's Rotation field shows an icon of its own, not Corner radius's (#256). + #[test] + fn rotation_and_corner_radius_fields_show_different_icons() { + let mut s = figcraft_engine::Session::new(); + let r = s.execute("shape.rectangle", &serde_json::json!({"x": 0, "y": 0, "width": 100, "height": 80})).unwrap()["id"].clone(); + s.execute("select.set", &serde_json::json!({"ids": [r]})).unwrap(); + let mut u = crate::layers_drag_tests::Ui::new(s); + u.frame(vec![]); + let shapes = u.frame_output(vec![]).shapes; + let lead = |name: &str| u.ctx.read_response(egui::Id::new(name).with("lead")).map(|r| r.rect).unwrap_or_else(|| panic!("{name} is shown")); + let (rotation, radius) = (marks(&shapes, lead("pos_rot")), marks(&shapes, lead("ap_rad"))); + assert!(!rotation.is_empty() && !radius.is_empty(), "both draw an icon"); + assert_ne!(rotation, radius); + } } diff --git a/crates/ui-egui/src/right.rs b/crates/ui-egui/src/right.rs index 47f3e5d36..0483f0229 100644 --- a/crates/ui-egui/src/right.rs +++ b/crates/ui-egui/src/right.rs @@ -657,7 +657,7 @@ fn position_fields(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId] }); widgets::sublabels(ui, tr("Rotation"), None); row(ui, 32.0, |ui| { - let e = widgets::number_field_mixed(ui, Id::new("pos_rot"), Lead::Icon(Icon::CornerRadius, tr("Rotation")), rot, "°", col, 1.0); + let e = widgets::number_field_mixed(ui, Id::new("pos_rot"), Lead::Icon(Icon::Angle, tr("Rotation")), rot, "°", col, 1.0); app.field_of(&ids, "rotation", e, rot_of, |v| json!(v)); let items = [ (Icon::Rotate, tr("Rotate 90° right")), From 47438dd4a2e8b49a7e6bb3dfd480262dadc37f12 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sat, 17 Oct 2026 21:43:28 -0400 Subject: [PATCH 224/817] Release 0.7.0 Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 42 +++++++++++++++++++++--------------------- Cargo.toml | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a61d87cc4..86bccfa35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1413,7 +1413,7 @@ checksum = "b97b65636e5b9ef369943878ac74335ba1c55c1cb6adbf1e2c293c624248d693" [[package]] name = "figcraft" -version = "0.6.0" +version = "0.7.0" dependencies = [ "arboard", "eframe", @@ -1440,7 +1440,7 @@ dependencies = [ [[package]] name = "figcraft-cli" -version = "0.6.0" +version = "0.7.0" dependencies = [ "figcraft-doc", "figcraft-engine", @@ -1454,7 +1454,7 @@ dependencies = [ [[package]] name = "figcraft-collab" -version = "0.6.0" +version = "0.7.0" dependencies = [ "base64 0.22.1", "figcraft-color", @@ -1469,7 +1469,7 @@ dependencies = [ [[package]] name = "figcraft-collab-net" -version = "0.6.0" +version = "0.7.0" dependencies = [ "base64 0.22.1", "figcraft-collab", @@ -1492,7 +1492,7 @@ dependencies = [ [[package]] name = "figcraft-color" -version = "0.6.0" +version = "0.7.0" dependencies = [ "kurbo", "serde", @@ -1501,7 +1501,7 @@ dependencies = [ [[package]] name = "figcraft-doc" -version = "0.6.0" +version = "0.7.0" dependencies = [ "figcraft-color", "figcraft-geom", @@ -1513,7 +1513,7 @@ dependencies = [ [[package]] name = "figcraft-engine" -version = "0.6.0" +version = "0.7.0" dependencies = [ "base64 0.22.1", "craft-docpath", @@ -1541,7 +1541,7 @@ dependencies = [ [[package]] name = "figcraft-format" -version = "0.6.0" +version = "0.7.0" dependencies = [ "figcraft-doc", "figcraft-pathops", @@ -1556,7 +1556,7 @@ dependencies = [ [[package]] name = "figcraft-geom" -version = "0.6.0" +version = "0.7.0" dependencies = [ "kurbo", "serde", @@ -1564,7 +1564,7 @@ dependencies = [ [[package]] name = "figcraft-layout" -version = "0.6.0" +version = "0.7.0" dependencies = [ "figcraft-doc", "figcraft-geom", @@ -1572,7 +1572,7 @@ dependencies = [ [[package]] name = "figcraft-mcp" -version = "0.6.0" +version = "0.7.0" dependencies = [ "base64 0.22.1", "figcraft-collab-net", @@ -1588,7 +1588,7 @@ dependencies = [ [[package]] name = "figcraft-pathops" -version = "0.6.0" +version = "0.7.0" dependencies = [ "figcraft-doc", "figcraft-geom", @@ -1597,7 +1597,7 @@ dependencies = [ [[package]] name = "figcraft-pdf" -version = "0.6.0" +version = "0.7.0" dependencies = [ "figcraft-color", "figcraft-doc", @@ -1614,7 +1614,7 @@ dependencies = [ [[package]] name = "figcraft-plugin" -version = "0.6.0" +version = "0.7.0" dependencies = [ "figcraft-color", "serde", @@ -1627,7 +1627,7 @@ dependencies = [ [[package]] name = "figcraft-render" -version = "0.6.0" +version = "0.7.0" dependencies = [ "crc32fast", "figcraft-color", @@ -1645,7 +1645,7 @@ dependencies = [ [[package]] name = "figcraft-server" -version = "0.6.0" +version = "0.7.0" dependencies = [ "crc32fast", "ctrlc", @@ -1669,7 +1669,7 @@ dependencies = [ [[package]] name = "figcraft-svg" -version = "0.6.0" +version = "0.7.0" dependencies = [ "base64 0.22.1", "figcraft-color", @@ -1685,7 +1685,7 @@ dependencies = [ [[package]] name = "figcraft-text" -version = "0.6.0" +version = "0.7.0" dependencies = [ "figcraft-doc", "figcraft-geom", @@ -1699,7 +1699,7 @@ dependencies = [ [[package]] name = "figcraft-ui-egui" -version = "0.6.0" +version = "0.7.0" dependencies = [ "base64 0.22.1", "egui", @@ -1724,7 +1724,7 @@ dependencies = [ [[package]] name = "figcraft-web" -version = "0.6.0" +version = "0.7.0" dependencies = [ "eframe", "egui", @@ -5934,7 +5934,7 @@ checksum = "9440ea3e5aeabb0ac63af70daf835274065238cdd0cec83418f417eae38bacee" [[package]] name = "xtask" -version = "0.6.0" +version = "0.7.0" dependencies = [ "figcraft-engine", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index fe0893282..932da46f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ exclude = ["plugins"] # default-members = ["crates/*", "apps/figcraft", "apps/figcraft-cli", "xtask"] [workspace.package] -version = "0.6.0" +version = "0.7.0" edition = "2024" license = "MIT OR Apache-2.0" rust-version = "1.95" From e9be17427f06695c1cb1074b2ce993b903b65893 Mon Sep 17 00:00:00 2001 From: sanches Date: Sun, 18 Oct 2026 05:14:35 +0300 Subject: [PATCH 225/817] M9: French catalog at 100% of the strings (still a draft) The 91 UI strings, 12 command labels and 2 menu wordings the strings added since the French catalog was drafted left in English are translated in the catalog's conventions (NBSP before : ! and inside guillemets, one/other plurals, 0 singular): starter templates and the Templates tab, the home screen's recents table with its sorting and dates in the French way, dropping files to open or import, the Getting started tips with sharing by code, the Playground's bound-variable chip, smart-selection spacing, outline mode's options, the converting and panel-width commands. Appended to each section; still requires native review. --- ROADMAP.md | 5 +- contributors/people.toml | 3 + crates/ui-egui/locales/fr.toml | 111 +++++++++++++++++++++++++++++++++ docs/gaps.md | 11 ++-- docs/localization-parity.md | 5 +- 5 files changed, 126 insertions(+), 9 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 8a587286d..ecde012e4 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (French at 100% of the strings, an unreviewed draft; language table re-measured; preceding: 2026-10-17 community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -103,7 +103,7 @@ native speakers' reviews of the six language drafts need people. | Spanish | es, es-419 | 100% (es-419: an overlay of 101 entries) | draft (needs native review) | | Hindi | hi | 0% | none | | Arabic | ar | 0% | none | -| French | fr | 95% | draft (needs native review) | +| French | fr | 100% | draft (needs native review) | | Portuguese (Brazil) | pt-BR | 95% | draft (needs native review) | | Indonesian | id | 99% | draft (needs native review) | | Japanese | ja | 99% | draft (needs native review) | @@ -316,6 +316,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-18 | minor | French at 100% of the strings (gap 5, `fr.toml`): what the strings added since the draft left in English in the French catalog — the templates and their kinds with descriptions, the home screen's recents table (sorting, "Show in folder", the dates in the French way), dropping files to open or import, the Getting started tips with sharing by code, the Playground's bound-variable chip, smart-selection spacing, outline mode's options, the converting and panel-width tail — is translated: 91 UI strings, 12 command labels and 2 menu wordings, appended to the sections in the catalog's conventions (NBSP before : ! and inside « », one/other plurals with 0 singular). Still a draft awaiting native review; the language table row and per-area docs re-measured; numbers unchanged | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | diff --git a/contributors/people.toml b/contributors/people.toml index ace49f7b2..8b14373eb 100644 --- a/contributors/people.toml +++ b/contributors/people.toml @@ -53,3 +53,6 @@ sync_github_name = false [people.krinry] display_name = "krinry" sync_github_name = true + +[people.pechnikov2026-star] +sync_github_name = true diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 17a0d60bf..785305402 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -1637,6 +1637,99 @@ status = "draft — needs native review" "⌘ scroll" = "⌘ défilement" "⌥ drag" = "⌥ glisser" +# Strings translated since the draft (2026-10-18), appended; a native review is still pending. +"A responsive product page: hero, features, figures, a quote and a footer" = "Une page produit responsive : héros, fonctionnalités, chiffres, une citation et un pied de page" +"A title, an agenda, a big figure, a chart and a closing slide" = "Un titre, un sommaire, un grand chiffre, un graphique et une diapositive de clôture" +"A to Z" = "A à Z" +"Adding to {name}" = "Ajout dans {name}" +"Alphabetical" = "Alphabétique" +"An analytics screen on a grid: figures, charts drawn from vectors and a table" = "Un écran d’analyse sur une grille : chiffres, graphiques tracés en vectoriel et un tableau" +"Apps" = "Applications" +"Apr" = "avr." +"Aug" = "août" +"Bound to {name}. Click to detach the variable." = "Lié à {name}. Cliquez pour détacher la variable." +"Colour and text styles, Light and Dark variables, buttons, inputs and cards" = "Styles de couleur et de texte, variables Clair et Sombre, boutons, champs et cartes" +"Convert to frame" = "Convertir en cadre" +"Convert to section" = "Convertir en section" +"Created" = "Création" +"Dashboard" = "Tableau de bord" +"Date created" = "Date de création" +"Dec" = "déc." +"Design system starter" = "Base de système de design" +"Draw a frame" = "Tracer un cadre" +"Drop a .figcraft, .fig, .json, .svg or image file." = "Déposez un fichier .figcraft, .fig, .json, .svg ou une image." +"Drop to import" = "Déposer pour importer" +"Drop to open" = "Déposer pour ouvrir" +"Edited {when}" = "Modifié {when}" +"Export frames and layers as PNG, JPG, SVG or PDF" = "Exporter les cadres et les calques en PNG, JPG, SVG ou PDF" +"Feb" = "févr." +"File not found" = "Fichier introuvable" +"Four screens of a trail app with components and a prototype flow" = "Quatre écrans d’une application de randonnée avec des composants et un flux de prototype" +"Getting started" = "Premiers pas" +"Greyscale components and two example screens to sketch a flow with" = "Composants en niveaux de gris et deux écrans d’exemple pour esquisser un flux" +"Hide these tips (Getting started in the Help menu shows them again)" = "Masquer ces astuces (Premiers pas dans le menu Aide les affiche de nouveau)" +"Hide when publishing" = "Masquer à la publication" +"Icon components on a 24 px grid with keylines and a size preview" = "Composants d’icônes sur une grille de 24 px avec repères et aperçu de la taille" +"Icon set starter" = "Base de jeu d’icônes" +"Jan" = "janv." +"Jul" = "juil." +"Jun" = "juin" +"Kits" = "Kits" +"Landing page" = "Page de destination" +"Last modified" = "Dernière modification" +"Link frames on the Prototype tab, then present the flow" = "Reliez les cadres dans l’onglet Prototype, puis présentez le flux" +"Make a component" = "Créer un composant" +"Mar" = "mars" +"May" = "mai" +"Mobile app" = "Application mobile" +"Newest first" = "Plus récent d’abord" +"No other pages" = "Aucune autre page" +"No templates match your search" = "Aucun modèle ne correspond à votre recherche" +"Nov" = "nov." +"Oct" = "oct." +"Oldest first" = "Plus ancien d’abord" +"One announcement in five common sizes: square, portrait, story, link and banner" = "Une annonce en cinq formats courants : carré, portrait, story, lien et bannière" +"Opening the file…" = "Ouverture du fichier…" +"Opening {n} files as new files" = { one = "Ouverture comme nouveau fichier", other = "Ouverture de {n} fichiers comme nouveaux fichiers" } +"Order" = "Ordre" +"Other" = "Autre" +"Pick the Frame tool, then drag on the canvas or choose a device size" = "Choisissez l’outil Cadre, puis faites glisser sur le canevas ou choisissez une taille d’appareil" +"Playground" = "Bac à sable" +"Plugin" = "Plugin" +"Plugins & widgets" = "Plugins et widgets" +"Presentation slides" = "Diapositives de présentation" +"Remove from recents" = "Retirer des récents" +"Search templates" = "Rechercher des modèles" +"See all templates" = "Voir tous les modèles" +"Select layers and they space themselves as their content changes" = "Sélectionnez des calques et leur espacement s’ajuste quand leur contenu change" +"Sep" = "sept." +"Share with a code" = "Partager avec un code" +"Show all templates" = "Afficher tous les modèles" +"Show in Explorer" = "Afficher dans l’Explorateur" +"Show in Finder" = "Afficher dans le Finder" +"Show in folder" = "Afficher dans le dossier" +"Social and slides" = "Réseaux sociaux et diapositives" +"Social post sizes" = "Formats de publications sociales" +"Sort by" = "Trier par" +"Sort by {column}" = "Trier par {column}" +"Start from a template" = "Commencer avec un modèle" +"Start sharing with the Share button, then pass on the code it gives" = "Commencez à partager avec le bouton Partager, puis communiquez le code qu’il donne" +"Templates" = "Modèles" +"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é." +"Try another word, or look at every kind." = "Essayez un autre mot, ou regardez chaque type." +"Turn a layer into a component, reuse it, and change every copy at once" = "Transformez un calque en composant, réutilisez-le et modifiez toutes les copies d’un coup" +"Uses variables: each layer shows them in its own mode" = "Utilise des variables : chaque calque les affiche dans son propre mode" +"Websites" = "Sites web" +"What you try here changes this preview and the code below, not the file" = "Ce que vous essayez ici change cet aperçu et le code ci-dessous, pas le fichier" +"Widget" = "Widget" +"Wireframe kit" = "Kit de wireframes" +"Z to A" = "Z à A" +"just now" = "à l’instant" +"yesterday" = "hier" +"{month} {day}, {year}" = "{day} {month} {year}" + [commands] "align.bottom" = "Aligner en bas" "align.hcenter" = "Aligner les centres horizontalement" @@ -2193,6 +2286,20 @@ status = "draft — needs native review" "window.focus" = "Mettre la fenêtre au premier plan" "window.new" = "Nouvelle fenêtre" +# Commands translated since the draft (2026-10-18), appended. +"component.hideWhenPublishing" = "Masquer à la publication" +"component.playground" = "Bac à sable de composant" +"file.newFromTemplate" = "Nouveau à partir d’un modèle" +"help.gettingStarted" = "Premiers pas" +"object.convertToFrame" = "Convertir en cadre" +"object.convertToGroup" = "Convertir en groupe" +"object.convertToSection" = "Convertir en section" +"style.bind" = "Lier une variable dans un style" +"template.list" = "Lister les modèles" +"view.outlinesHiddenLayers" = "Inclure les calques masqués dans les contours" +"view.outlinesObjectBounds" = "Inclure les limites des objets dans les contours" +"view.panelWidths" = "Réinitialiser la largeur des panneaux" + [menu] "bool.exclude" = "Exclure" "bool.flatten" = "Aplatir" @@ -2223,3 +2330,7 @@ status = "draft — needs native review" "view.themeDark" = "Sombre" "view.themeLight" = "Clair" "view.themeSystem" = "Suivre le système" + +# Menu wordings translated since the draft (2026-10-18), appended. +"view.outlinesHiddenLayers" = "Inclure les calques masqués" +"view.outlinesObjectBounds" = "Inclure les limites des objets" diff --git a/docs/gaps.md b/docs/gaps.md index 9b1a770c1..68ce570e4 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Where FigCraft falls short of Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (the 2026-10-17 landings: `.fig` import fidelity, budgets for large files, the import report, a `.fig` copy from Save as and paste from another design app (gap 1); menus, the Actions palette, editor fixes, Selection colors and smart-selection spacing (gap 4); catalog counts re-measured (gap 5); bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (French at 100% of the strings as an unreviewed draft; preceding: the 2026-10-17 landings: `.fig` import fidelity, budgets for large files, the import report, a `.fig` copy from Save as and paste from another design app (gap 1); menus, the Actions palette, editor fixes, Selection colors and smart-selection spacing (gap 4); catalog counts re-measured (gap 5); bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) Every known shortfall against Figma, one entry each, ranked by how much it stops a Figma user from doing real work in FigCraft. Agents: pick work from the top unless the owner says otherwise. The @@ -18,7 +18,7 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe | 2 | Multiplayer and sharing are a preview, without accounts (**beta blocker**) | Feature | 42–84 | [collaboration-parity](collaboration-parity.md) | | 3 | Nothing checked against real Figma files | Fidelity | 15–30 | [target-app-parity](target-app-parity.md) | | 4 | Interaction fidelity not compared tool by tool | UI/UX | 40–60 | [ui-parity](ui-parity.md) | -| 5 | Localization: English, reviewed Russian, plus unreviewed Spanish (and Latin American Spanish), French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Czech drafts; Turkish and Swedish catalogs | Localization | 29–51 | [localization-parity](localization-parity.md) | +| 5 | Localization: English, reviewed Russian, plus unreviewed Spanish (and Latin American Spanish), German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Czech drafts; French complete as an unreviewed draft; Turkish and Swedish catalogs | Localization | 29–51 | [localization-parity](localization-parity.md) | | 6 | Plugins: widgets take clicks only, a self-hosted directory but no public catalogue; Figma's plugins don't run | Ecosystem | 8–26 | [target-app-parity](target-app-parity.md) | | 7 | CPU canvas where Figma uses the GPU | Hardware/performance | 30–60 | [hardware-parity](hardware-parity.md) | | 8 | Platform QA: Linux and the browser left (Windows pass done 2026-10-11) | Stability/platforms | 10–20 | [hardware-parity](hardware-parity.md) | @@ -187,9 +187,10 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe - **Evidence (measured from source):** the layer landed 2026-10-11: catalogs in `crates/ui-egui/locales/` (measured 2026-10-17: 1,680 UI keys plus 561 command labels and 31 menu wordings, 2,272 entries), Preferences ▸ Language, `pref.language`; `en.toml` is complete, - Spanish is held to completeness by the check, and the French, German, Brazilian Portuguese, - Japanese, Korean and Simplified Chinese machine drafts cover 95–99% (strings added since they - were drafted show English), with `es-419.toml` a Latin American overlay listing only what + Spanish is held to completeness by the check, and French (2026-10-18) covers every string as a + draft; the German, Brazilian Portuguese, Japanese, Korean and Simplified Chinese machine drafts + cover 95–99% (strings added since they were drafted show English), with `es-419.toml` a Latin + American overlay listing only what differs from Spanish. Russian (reviewed and approved by VanTan, one/few/many integer plurals) covers 98.8%; Indonesian and Czech drafts, a Turkish catalog whose header says a native speaker reviewed it, and a Swedish catalog (with its command labels since 2026-10-17) cover 98.7–99.6% ([localization-parity](localization-parity.md#languages)). diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 50fcd4ec3..8f6f748f8 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -1,6 +1,6 @@ # Localization parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (macOS finds its downloadable CJK system fonts (#406); string counts re-measured: 2,272 entries, the drafts at 95–99%; Swedish command labels and menu wordings; Russian, Swedish, Turkish, Czech and Indonesian listed; a duplicated paragraph removed; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (French at 100% of the strings, still an unreviewed draft; macOS finds its downloadable CJK system fonts (#406); string counts re-measured: 2,272 entries, the drafts at 95–99%; Swedish command labels and menu wordings; Russian, Swedish, Turkish, Czech and Indonesian listed; a duplicated paragraph removed; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog) · **Target:** Figma Design (desktop app 126.10.7) FigCraft's interface has a localization layer with an English catalog, a Russian catalog reviewed by a native speaker, and Spanish (with a Latin American overlay), French, German, Brazilian @@ -90,7 +90,7 @@ supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no v | Spanish | es, es-419 | 2,272 / 2,272 (100%, draft); es-419 overlays 101 Latin American wordings (draft) | yes | Latin | no | draft | 0–1 (after native review) | | Hindi | hi | 0 (0%) | no | Devanagari shaping works in documents; UI font fallback to check | no | none | 4–7 | | Arabic | ar | 0 (0%) | no | Bidi, shaping and RTL names work; the UI does not mirror | no | none | 9–15 | -| French | fr | 2,167 / 2,272 (95.4%, draft) | yes | Latin | no | draft | 1–2 (after native review) | +| French | fr | 2,272 / 2,272 (100%, draft) | yes | Latin | no | draft | 1–2 (after native review) | | Portuguese | pt-BR | 2,167 / 2,272 (95.4%, draft) | yes | Latin | no | draft | 1–2 (after native review) | | Indonesian | id | 2,244 / 2,272 (98.8%, draft) | yes | Latin | no | draft | 1–2 (after native review) | | Japanese | ja | 2,254 / 2,272 (99.2%, draft) | yes | CJK text and IME in documents; UI text in an installed Japanese face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | @@ -120,6 +120,7 @@ Hindi, Vietnamese and Arabic. Traditional Chinese is not planned (no catalog; it | Date | Change | Summary | |---|---|---| +| 2026-10-18 | minor | The French draft catches up to 100%: `fr.toml` translates the 91 UI strings, 12 command labels (`file.newFromTemplate`, `template.list`, `help.gettingStarted`, `component.playground`, `component.hideWhenPublishing`, `object.convertTo{Frame,Group,Section}`, `style.bind`, `view.outlinesHiddenLayers`, `view.outlinesObjectBounds`, `view.panelWidths`) and 2 menu wordings (the two outlines options) that the strings added since it was drafted left in English: starter templates and the Templates tab, the home screen's recents table with its sorting and "Show in folder", dropping files to open or import, the Getting started tips, sharing with a code, a rendered component's Playground bound-variable chip, smart-selection spacing and the outline options, and the dates on the recent cards (months abbreviated the French way, "A à Z"/"Z à A"); appended to each section in the catalog's conventions (NBSP before `:` `!` and inside « », one/other plurals with 0 counting as singular). Still a draft, awaiting native review; the language table row is re-measured | | 2026-10-17 | minor | Chinese showed as boxes on macOS (#406): the font scan also walks the system's downloaded font assets (`/System/Library/AssetsV2` and the older `/System/Library/Assets`, only their `com_apple_MobileAsset_Font*` folders), where current versions keep PingFang SC, and Hiragino Sans GB and Heiti SC join the Chinese UI faces and the text fallbacks. Tested with a folder laid out the same way; not yet run on a Mac | | 2026-10-17 | minor | String counts re-measured from the catalogs: 1,680 UI keys, 561 command labels and 31 menu wordings (2,272 entries); Spanish complete, the other drafts at 95.3–99.2% (strings added since 2026-10-12 show English), es-419 101 entries. Indonesian has a draft (98.8%; it was listed as none); Russian (98.8%, reviewed), Swedish (99.6%, command labels and menu wordings from #599), Turkish (98.7%) and Czech (98.8%) listed with counts; the language picker's list updated; a paragraph repeated by a merge removed. Grade and hours unchanged (Indonesian's draft is offset by the drafts' new gaps) | | 2026-10-14 | minor | Windows UI language (#291): the interface language comes from Windows' first preferred language alone; that list is also the input-language list (a German keyboard on a Polish system adds Deutsch), and taking the first entry with a catalog turned the interface German there. A first preferred language without a catalog reads English; macOS AppleLanguages and gettext's `LANGUAGE` still take the first language with a catalog | From cf6bd4eeb29a925f3dced1f420f03a6c588d2a28 Mon Sep 17 00:00:00 2001 From: RealtaNua Date: Sat, 17 Oct 2026 21:49:32 +0700 Subject: [PATCH 226/817] M7: list the fonts a file uses that aren't installed (#752) Text in a family that isn't installed was drawn in a fallback font without a word. Now: - `text.missingFonts` lists the families a document names that no installed or built-in font provides: text layers and their styled ranges, text styles, and string variables bound to a font family (every mode, through aliases), with the number of text layers. - The desktop app shows a Missing fonts window after the user opens a file that has any: once installed fonts are indexed (before that every one of them would count as missing) and after any import report is closed. Files named on the command line count. Programmatic opens and the browser build never open it by themselves. Text > Missing fonts... shows it for the file in front; Escape closes it. - `figcraft-cli info` prints `missing font` lines (`missingFonts` with --json). - file-format-parity: the row claimed REST import warnings that no code produced. Co-Authored-By: Claude Opus 5.5 (1M context) --- apps/figcraft-cli/src/files.rs | 6 ++ apps/figcraft-cli/tests/fonts.rs | 22 ++++ apps/figcraft/src/main.rs | 3 + crates/engine/src/catalog.rs | 4 +- crates/engine/src/cmd/mod.rs | 1 + crates/engine/src/fonts.rs | 100 ++++++++++++++++++ crates/engine/src/fonts_tests.rs | 123 ++++++++++++++++++++++ crates/engine/src/lib.rs | 1 + crates/text/src/fontdb.rs | 5 + crates/text/src/lib.rs | 4 +- crates/ui-egui/locales/en.toml | 5 + crates/ui-egui/locales/es.toml | 6 ++ crates/ui-egui/src/dialogs.rs | 3 + crates/ui-egui/src/import_report_tests.rs | 2 +- crates/ui-egui/src/lib.rs | 11 ++ crates/ui-egui/src/missing_fonts.rs | 102 ++++++++++++++++++ crates/ui-egui/src/missing_fonts_tests.rs | 112 ++++++++++++++++++++ docs/cli.md | 4 +- docs/file-format-parity.md | 3 +- docs/mcp.md | 2 + 20 files changed, 513 insertions(+), 6 deletions(-) create mode 100644 crates/engine/src/fonts.rs create mode 100644 crates/engine/src/fonts_tests.rs create mode 100644 crates/ui-egui/src/missing_fonts.rs create mode 100644 crates/ui-egui/src/missing_fonts_tests.rs diff --git a/apps/figcraft-cli/src/files.rs b/apps/figcraft-cli/src/files.rs index 3e08474a2..65b19ee46 100644 --- a/apps/figcraft-cli/src/files.rs +++ b/apps/figcraft-cli/src/files.rs @@ -155,6 +155,7 @@ pub fn info(path: &str, as_json: bool) -> CliResult { Some(json!({"id": p, "name": pn.name, "nodes": nodes, "topLevel": pn.children.len(), "frames": frames})) }) .collect(); + let missing = figcraft_engine::fonts::missing(&doc); let v = json!({ "file": path, "name": doc.name, @@ -164,6 +165,7 @@ pub fn info(path: &str, as_json: bool) -> CliResult { "variables": doc.variables.variables.len(), "images": doc.images.len(), "notes": notes, + "missingFonts": missing.iter().map(|m| json!({"family": m.family, "layers": m.layers})).collect::>(), }); if as_json { println!("{}", serde_json::to_string_pretty(&v).unwrap_or_default()); @@ -187,6 +189,10 @@ pub fn info(path: &str, as_json: bool) -> CliResult { println!(" {} {} \"{}\" {}×{}", f["id"], f["type"].as_str().unwrap_or(""), f["name"].as_str().unwrap_or(""), f["width"], f["height"]); } } + for m in &missing { + let layers = if m.layers == 1 { "text layer" } else { "text layers" }; + println!("missing font \"{}\": {} {layers} (drawn in a fallback font)", m.family, m.layers); + } Ok(ExitCode::SUCCESS) } diff --git a/apps/figcraft-cli/tests/fonts.rs b/apps/figcraft-cli/tests/fonts.rs index c5901ac50..ef5c638fa 100644 --- a/apps/figcraft-cli/tests/fonts.rs +++ b/apps/figcraft-cli/tests/fonts.rs @@ -45,3 +45,25 @@ fn headless_runs_resolve_installed_families_unless_opted_out() { assert_eq!(run_one("face", face.clone(), &[], false)["family"], json!(installed), "text uses the installed family"); assert_ne!(run_one("face", face, &["--no-system-fonts"], false)["family"], json!(installed), "opted out, it falls back"); } + +#[test] +fn info_lists_the_fonts_a_file_uses_that_are_missing() { + let d = std::env::temp_dir().join(format!("figcraft-cli-missing-{}", std::process::id())); + std::fs::create_dir_all(&d).unwrap(); + let (script, file) = (d.join("make.json"), d.join("doc.figcraft")); + let text = + |family: &str| json!({"command": "text.create", "params": {"text": "Hamburgefonstiv", "x": 0, "y": 0, "props": {"fontFamily": family}}}); + std::fs::write(&script, json!([text("FigCraft Missing CLI"), text("FigCraft Missing CLI")]).to_string()).unwrap(); + let cli = || Command::new(env!("CARGO_BIN_EXE_figcraft-cli")); + let made = cli().arg("run").arg(&script).arg("--out").arg(&file).output().unwrap(); + assert!(made.status.success(), "{}", String::from_utf8_lossy(&made.stderr)); + + let out = cli().arg("info").arg(&file).arg("--json").output().unwrap(); + assert!(out.status.success(), "{}", String::from_utf8_lossy(&out.stderr)); + let v: Value = serde_json::from_slice(&out.stdout).unwrap(); + assert_eq!(v["missingFonts"], json!([{"family": "FigCraft Missing CLI", "layers": 2}])); + + let out = cli().arg("info").arg(&file).output().unwrap(); + let shown = String::from_utf8_lossy(&out.stdout); + assert!(shown.contains("missing font \"FigCraft Missing CLI\": 2 text layers"), "{shown}"); +} diff --git a/apps/figcraft/src/main.rs b/apps/figcraft/src/main.rs index 10147c2cc..fe89d0a75 100644 --- a/apps/figcraft/src/main.rs +++ b/apps/figcraft/src/main.rs @@ -161,6 +161,7 @@ fn main() -> eframe::Result { log::error!("{f}: {e}"); } } + let opened: Vec = session.docs.iter().map(|d| d.uid).collect(); // Documents a crashed or killed run left unsaved come back; this run keeps its own copies. let recovery_root = services::config_dir().map(|d| d.join("Recovery")); // The preferences first: they hold the online files a recovered document may be one of. @@ -194,6 +195,8 @@ fn main() -> eframe::Result { let mut fig = FigApp::new(session, Box::new(svc)); fig.automation_roots = roots; fig.ui.home = false; + // Files named on the command line are the user's too: their missing fonts are listed. + fig.ui.font_checks = opened; fig.note_recovered(recovered.copies); if let Some(link) = &args.join { figcraft_ui_egui::live::open_invite(&mut fig, link); diff --git a/crates/engine/src/catalog.rs b/crates/engine/src/catalog.rs index c8f34fc15..4b6cd3fcc 100644 --- a/crates/engine/src/catalog.rs +++ b/crates/engine/src/catalog.rs @@ -213,6 +213,8 @@ pub static MENU: &[MenuItem] = &[ m!("Text/Case", "Uppercase", "text.caseUpper"), m!("Text/Case", "Lowercase", "text.caseLower"), m!("Text/Case", "Title case", "text.caseTitle"), + m!("Text", SEP, ""), + m!("Text", "Missing fonts…", "text.missingFonts"), // Arrange m!("Arrange", "Align left", "align.left"), m!("Arrange", "Align horizontal centers", "align.hcenter"), @@ -287,7 +289,7 @@ pub fn items() -> impl Iterator { } /// Items of FigCraft's own that the parity count leaves out (as it does the `collab.` ones). -const OWN: [&str; 2] = ["file.newFromTemplate", "help.gettingStarted"]; +const OWN: [&str; 3] = ["file.newFromTemplate", "help.gettingStarted", "text.missingFonts"]; /// Coverage: (implemented, total, missing ids). `extra` lists ids implemented by the UI layer. pub fn parity(extra: &[&str]) -> (usize, usize, Vec<&'static str>) { diff --git a/crates/engine/src/cmd/mod.rs b/crates/engine/src/cmd/mod.rs index b942fc250..f011238d9 100644 --- a/crates/engine/src/cmd/mod.rs +++ b/crates/engine/src/cmd/mod.rs @@ -80,6 +80,7 @@ fn registry() -> &'static Registry { list.extend(page::specs()); list.extend(view::specs()); list.extend(text::specs()); + list.extend(crate::fonts::specs()); list.extend(styles::specs()); list.extend(image::specs()); list.extend(variables::specs()); diff --git a/crates/engine/src/fonts.rs b/crates/engine/src/fonts.rs new file mode 100644 index 000000000..e20d4d401 --- /dev/null +++ b/crates/engine/src/fonts.rs @@ -0,0 +1,100 @@ +//! Fonts a document names that this machine doesn't have (#752): text layers, their styled +//! ranges, text styles and the string variables bound to a font family. Text in such a family +//! is drawn in a fallback font, so the user is told which ones are missing. + +use std::collections::BTreeMap; + +use figcraft_doc::{Document, NodeKind, StyleKind, VariableValue, Variables}; +use serde_json::{Value, json}; + +use crate::cmd::CommandSpec; +use crate::{Result, Session, spec}; + +/// A family the document names that no installed or built-in font provides. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct Missing { + /// As the document spells it. + pub family: String, + /// Text layers that use it (0: only a text style or a variable names it). + pub layers: usize, +} + +/// The families `doc` names that the font database doesn't have, by name. On the desktop the +/// installed fonts are indexed in the background: ask once that's done +/// (`figcraft_text::system_fonts_scanned`), or every installed family counts as missing. +pub fn missing(doc: &Document) -> Vec { + // Lower-case family → (spelling, layers). + let mut used: BTreeMap = BTreeMap::new(); + let mut add = |family: &str, layer: bool| { + let family = family.trim(); + if family.is_empty() { + return; + } + let e = used.entry(family.to_lowercase()).or_insert_with(|| (family.to_string(), 0)); + e.1 += usize::from(layer); + }; + for n in doc.nodes() { + if let NodeKind::Text(t) = &n.kind { + let mut families: Vec<&str> = t.spans().into_iter().map(|(_, _, st)| st.font_family.as_str()).collect(); + families.push(&t.style.font_family); + families.sort_by_key(|f| f.trim().to_lowercase()); + families.dedup_by_key(|f| f.trim().to_lowercase()); + for f in families { + add(f, true); + } + } + if let Some(var) = n.bound.get("fontFamily") { + for f in string_values(&doc.variables, var) { + add(&f, false); + } + } + } + for st in &doc.styles { + if let StyleKind::Text { style } = &st.kind { + add(&style.font_family, false); + } + if let Some(var) = st.bound.get("fontFamily") { + for f in string_values(&doc.variables, var) { + add(&f, false); + } + } + } + used.into_values().filter(|(family, _)| !figcraft_text::has_family(family)).map(|(family, layers)| Missing { family, layers }).collect() +} + +/// Every string value of variable `id` in any mode, following aliases (at most 32 deep). +fn string_values(vars: &Variables, id: &str) -> Vec { + let mut out = Vec::new(); + let mut todo = vec![(id.to_string(), 0)]; + while let Some((id, depth)) = todo.pop() { + let Some(var) = vars.get(&id) else { continue }; + for v in var.values.values() { + match v { + VariableValue::String(s) => out.push(s.clone()), + VariableValue::Alias(a) if depth < 32 => todo.push((a.clone(), depth + 1)), + _ => {} + } + } + } + out +} + +fn missing_fonts(s: &mut Session, _: &Value) -> Result { + let families: Vec = missing(s.doc()?).into_iter().map(|m| json!({"family": m.family, "layers": m.layers})).collect(); + s.request_ui("dialog.missingFonts", json!({})); + Ok(json!({"families": families})) +} + +pub fn specs() -> Vec { + vec![spec!( + "text.missingFonts", + "Missing fonts", + "{} fonts the open document names that aren't installed (text layers, styled ranges, text styles, font family variables); the app shows them → {families: [{family, layers}]}", + false, + missing_fonts + )] +} + +#[cfg(test)] +#[path = "fonts_tests.rs"] +mod tests; diff --git a/crates/engine/src/fonts_tests.rs b/crates/engine/src/fonts_tests.rs new file mode 100644 index 000000000..6ba925b38 --- /dev/null +++ b/crates/engine/src/fonts_tests.rs @@ -0,0 +1,123 @@ +use serde_json::json; + +use super::*; +use crate::params::id_of; +use figcraft_doc::{Style, StyleRun, TextStyle}; + +fn text(s: &mut Session, family: &str) -> figcraft_doc::NodeId { + let id = id_of(&s.execute("text.create", &json!({"text": "Hamburgefonstiv", "x": 0, "y": 0})).unwrap()["id"]).unwrap(); + if let NodeKind::Text(t) = &mut s.doc_mut().unwrap().get_mut(id).unwrap().kind { + t.style.font_family = family.into(); + } + id +} + +fn families(s: &mut Session) -> Vec<(String, u64)> { + let r = s.execute("text.missingFonts", &json!({})).unwrap(); + r["families"].as_array().unwrap().iter().map(|f| (f["family"].as_str().unwrap().to_string(), f["layers"].as_u64().unwrap())).collect() +} + +/// An installed family (built in, or found by the system scan), if this machine has any. +fn installed() -> Option { + figcraft_text::scan_system_fonts(); + figcraft_text::family_names().into_iter().next() +} + +#[test] +fn lists_families_of_layers_ranges_styles_and_variables_once_each() { + let mut s = Session::new(); + text(&mut s, "FigCraft Missing A"); + let b = text(&mut s, "figcraft missing a"); + if let NodeKind::Text(t) = &mut s.doc_mut().unwrap().get_mut(b).unwrap().kind { + let style = TextStyle { font_family: "FigCraft Missing B".into(), ..t.style.clone() }; + t.runs.push(StyleRun { start: 0, end: 3, style }); + } + let doc = s.doc_mut().unwrap(); + doc.styles.push(Style { + id: "S:1".into(), + name: "Heading".into(), + description: String::new(), + kind: StyleKind::Text { style: TextStyle { font_family: "FigCraft Missing C".into(), ..TextStyle::default() } }, + bound: Default::default(), + }); + s.execute("variable.createCollection", &json!({"name": "Type", "modes": ["Light", "Dark"]})).unwrap(); + s.execute("variable.create", &json!({"collection": "Type", "name": "Family", "type": "string", "value": "FigCraft Missing D"})).unwrap(); + s.execute("variable.set", &json!({"variable": "Family", "mode": "Dark", "value": "FigCraft Missing H"})).unwrap(); + let var = s.doc().unwrap().variables.get("Family").unwrap().id.clone(); + s.doc_mut().unwrap().get_mut(b).unwrap().bound.insert("fontFamily".into(), var); + + assert_eq!( + families(&mut s), + vec![ + ("FigCraft Missing A".to_string(), 2), + ("FigCraft Missing B".to_string(), 1), + ("FigCraft Missing C".to_string(), 0), + ("FigCraft Missing D".to_string(), 0), + ("FigCraft Missing H".to_string(), 0), + ] + ); + assert!(s.ui_requests.iter().any(|r| r.kind == "dialog.missingFonts")); +} + +#[test] +fn installed_families_are_not_listed() { + let Some(family) = installed() else { + eprintln!("skipped: no fonts on this machine"); + return; + }; + let mut s = Session::new(); + text(&mut s, &family); + text(&mut s, &family.to_uppercase()); + text(&mut s, "FigCraft Missing E"); + assert_eq!(families(&mut s), vec![("FigCraft Missing E".to_string(), 1)]); +} + +#[test] +fn a_family_found_only_by_the_system_scan_is_not_missing() { + figcraft_text::scan_system_fonts(); + let embedded: Vec = figcraft_text::CRAFT_FONTS.iter().map(|f| f.family.to_lowercase()).collect(); + let Some(family) = figcraft_text::family_names().into_iter().find(|f| !embedded.contains(&f.to_lowercase())) else { + eprintln!("skipped: no system fonts on this machine"); + return; + }; + let mut s = Session::new(); + text(&mut s, &family); + assert!(families(&mut s).is_empty(), "{family} is installed"); +} + +#[test] +fn blank_families_and_aliases_are_handled() { + let mut s = Session::new(); + text(&mut s, " "); + s.execute("variable.createCollection", &json!({"name": "Type"})).unwrap(); + s.execute("variable.create", &json!({"collection": "Type", "name": "Base", "type": "string", "value": "FigCraft Missing F"})).unwrap(); + let base = s.doc().unwrap().variables.get("Base").unwrap().id.clone(); + let t = text(&mut s, "FigCraft Missing G"); + let doc = s.doc_mut().unwrap(); + // A variable that only aliases another, and one aliasing itself. + let mut alias = doc.variables.get(&base).unwrap().clone(); + alias.id = "V:alias".into(); + alias.name = "Alias".into(); + for v in alias.values.values_mut() { + *v = VariableValue::Alias(base.clone()); + } + let mut cycle = alias.clone(); + cycle.id = "V:cycle".into(); + cycle.name = "Cycle".into(); + for v in cycle.values.values_mut() { + *v = VariableValue::Alias("V:cycle".into()); + } + doc.variables.variables.push(alias); + doc.variables.variables.push(cycle); + doc.get_mut(t).unwrap().bound.insert("fontFamily".into(), "V:alias".into()); + let other = text(&mut s, "FigCraft Missing G"); + s.doc_mut().unwrap().get_mut(other).unwrap().bound.insert("fontFamily".into(), "V:cycle".into()); + // The bound layer takes the value its alias resolves to; the cycle resolves to nothing. + assert_eq!(families(&mut s), vec![("FigCraft Missing F".to_string(), 1), ("FigCraft Missing G".to_string(), 1)]); +} + +#[test] +fn needs_an_open_document() { + let mut s = Session::empty(); + assert!(s.execute("text.missingFonts", &json!({})).is_err()); +} diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 2254269e5..508e70f99 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -29,6 +29,7 @@ pub mod distance; pub mod doc_urls; pub mod drop; pub mod file_access; +pub mod fonts; pub mod guard; pub mod guides; pub mod inspect; diff --git a/crates/text/src/fontdb.rs b/crates/text/src/fontdb.rs index a6d52d672..8d1840b1a 100644 --- a/crates/text/src/fontdb.rs +++ b/crates/text/src/fontdb.rs @@ -852,6 +852,11 @@ pub fn family_names() -> Vec { db().read().unwrap_or_else(std::sync::PoisonError::into_inner).families() } +/// The global db has `family` (embedded, loaded or indexed; any case). +pub fn has_family(family: &str) -> bool { + db().read().unwrap_or_else(std::sync::PoisonError::into_inner).has_family(family) +} + /// Style names of a family in the global db. pub fn family_styles(family: &str) -> Vec { db().write().unwrap_or_else(std::sync::PoisonError::into_inner).styles(family) diff --git a/crates/text/src/lib.rs b/crates/text/src/lib.rs index 27456d824..721471ad9 100644 --- a/crates/text/src/lib.rs +++ b/crates/text/src/lib.rs @@ -16,8 +16,8 @@ mod onpath; pub use breaks::grapheme_step; pub use color::{ColorBitmap, ColorInk, ColorLayer}; pub use fontdb::{ - Axis, CRAFT_FONTS, Coords, Face, FontDb, NamedInstance, axis_label, db, face_with_char, family_names, family_styles, find_face, no_coords, - scan_system_fonts, scan_system_fonts_on_demand, system_fonts_scanned, + Axis, CRAFT_FONTS, Coords, Face, FontDb, NamedInstance, axis_label, db, face_with_char, family_names, family_styles, find_face, has_family, + no_coords, scan_system_fonts, scan_system_fonts_on_demand, system_fonts_scanned, }; pub use layout::{Decoration, Glyph, Line, TextLayout, layout}; pub use onpath::OnPath; diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 59b25d949..4003891b6 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -91,6 +91,7 @@ name = "English" "All components" = "All components" "All fonts" = "All fonts" "All supported properties" = "All supported properties" +"All the fonts this file uses are installed" = "All the fonts this file uses are installed" "All variables" = "All variables" "Alpha" = "Alpha" "Alphabetical" = "Alphabetical" @@ -771,6 +772,7 @@ name = "English" "Mirror angle and length" = "Mirror angle and length" "Mirroring" = "Mirroring" "Missing" = "Missing" +"Missing fonts" = "Missing fonts" "Missing layer" = "Missing layer" "Missing style" = "Missing style" "Missing variable" = "Missing variable" @@ -1374,6 +1376,7 @@ name = "English" "This condition is edited as an expression" = "This condition is edited as an expression" "This file" = "This file" "This file has unsaved changes" = "This file has unsaved changes" +"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 fonts that aren't installed on this computer. Their text is drawn in a fallback font until you install them." "This file is on {server}, open only to you. Share it to let others in with a new code." = "This file is on {server}, open only to you. Share it to let others in with a new code." "This frame is new on the branch." = "This frame is new on the branch." "This frame isn't on the branch." = "This frame isn't on the branch." @@ -1593,6 +1596,7 @@ name = "English" "nobody else here yet" = "nobody else here yet" "non-default slot settings are not represented and were skipped" = "non-default slot settings are not represented and were skipped" "now" = "now" +"only in a text style or variable" = "only in a text style or variable" "or" = "or" "point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "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" = "preferred slot component keys cannot be resolved to file nodes and were skipped" @@ -1700,6 +1704,7 @@ name = "English" "{n} replies" = { one = "{n} reply", other = "{n} replies" } "{n} rows" = { one = "{n} row", other = "{n} rows" } "{n} styles" = { one = "{n} style", other = "{n} styles" } +"{n} text layers" = { one = "{n} text layer", other = "{n} text layers" } "{n} variables" = { one = "{n} variable", other = "{n} variables" } "{n} weeks ago" = { one = "{n} week ago", other = "{n} weeks ago" } "{n} years ago" = { one = "{n} year ago", other = "{n} years ago" } diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 01c5813bd..b442d6d3b 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -93,6 +93,7 @@ status = "draft — needs native review" "All comments" = "Todos los comentarios" "All components" = "Todos los componentes" "All fonts" = "Todas las fuentes" +"All the fonts this file uses are installed" = "Todas las fuentes que usa este archivo están instaladas" "All supported properties" = "Todas las propiedades compatibles" "All variables" = "Todas las variables" "Alpha" = "Alfa" @@ -774,6 +775,7 @@ status = "draft — needs native review" "Missing" = "No encontrado" "Missing layer" = "Capa no encontrada" "Missing style" = "Estilo no encontrado" +"Missing fonts" = "Fuentes que faltan" "Missing variable" = "Variable no encontrada" "Miter" = "Inglete" "Miter angle" = "Ángulo de inglete" @@ -1375,6 +1377,7 @@ status = "draft — needs native review" "This condition is edited as an expression" = "Esta condición se edita como expresión" "This file" = "Este archivo" "This file has unsaved changes" = "Este archivo tiene cambios sin guardar" +"This file uses fonts that aren't installed on this computer. Their text is drawn in a fallback font until you install them." = "Este archivo usa fuentes que no están instaladas en este equipo. Su texto se dibuja con una fuente de reserva hasta que las instales." "This file is on {server}, open only to you. Share it to let others in with a new code." = "Este archivo está en {server}, abierto solo para ti. Compártelo para dejar entrar a otros con un código nuevo." "This frame is new on the branch." = "Este marco es nuevo en la rama." "This frame isn't on the branch." = "Este marco no está en la rama." @@ -1594,6 +1597,7 @@ status = "draft — needs native review" "nobody else here yet" = "aún no hay nadie más" "non-default slot settings are not represented and were skipped" = "los ajustes de ranura no predeterminados no se representan y se omitieron" "now" = "ahora" +"only in a text style or variable" = "solo en un estilo de texto o una variable" "or" = "o" "point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "se conservaron las uniones de trazo de los puntos; los trazos discontinuos o de ancho variable se dibujan con la unión de la capa" "preferred slot component keys cannot be resolved to file nodes and were skipped" = "las claves de componentes preferidos de las ranuras no corresponden a capas del archivo y se omitieron" @@ -1701,6 +1705,7 @@ status = "draft — needs native review" "{n} replies" = { one = "{n} respuesta", other = "{n} respuestas" } "{n} rows" = { one = "{n} fila", other = "{n} filas" } "{n} styles" = { one = "{n} estilo", other = "{n} estilos" } +"{n} text layers" = { one = "{n} capa de texto", other = "{n} capas de texto" } "{n} variables" = { one = "{n} variable", other = "{n} variables" } "{n} weeks ago" = { one = "hace {n} semana", other = "hace {n} semanas" } "{n} years ago" = { one = "hace {n} año", other = "hace {n} años" } @@ -2126,6 +2131,7 @@ status = "draft — needs native review" "text.listOutdent" = "Reducir sangría de la lista" "text.listStyle" = "Estilo de lista" "text.maxLines" = "Máximo de líneas" +"text.missingFonts" = "Fuentes que faltan" "text.numberList" = "Lista numerada" "text.onPath" = "Texto en trazado" "text.paragraphIndent" = "Sangría de párrafo" diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 39001b56e..448501abf 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -151,6 +151,7 @@ pub fn keys(app: &mut FigApp, ctx: &Context) { || u.find.is_some() || u.batch_rename.is_some() || u.import_report.is_some() + || u.missing_fonts.is_some() || u.confirm_close || u.export_preview || u.shortcuts_panel @@ -164,6 +165,7 @@ pub fn keys(app: &mut FigApp, ctx: &Context) { || u.find.take().is_some() || u.batch_rename.take().is_some() || u.import_report.take().is_some() + || u.missing_fonts.take().is_some() { return; } @@ -178,6 +180,7 @@ pub fn show(app: &mut FigApp, ctx: &Context) { // Dropped files waiting to open: their card, then (once it has shown) the files. crate::pending_open::pending_opens(app, ctx); crate::import_report::show(app, ctx); + crate::missing_fonts::show(app, ctx); let t = Tokens::get(ctx); if app.ui.about { let mut open = true; diff --git a/crates/ui-egui/src/import_report_tests.rs b/crates/ui-egui/src/import_report_tests.rs index 8742ccd33..a24115823 100644 --- a/crates/ui-egui/src/import_report_tests.rs +++ b/crates/ui-egui/src/import_report_tests.rs @@ -108,7 +108,7 @@ fn escape_closes_the_import_report_like_other_simple_dialogs() { assert!(u.app.ui.import_report.is_none(), "Escape closes the report"); } -fn shown_texts(shapes: Vec) -> Vec { +pub(crate) fn shown_texts(shapes: Vec) -> Vec { fn walk(shape: &egui::Shape, out: &mut Vec) { match shape { egui::Shape::Text(t) => out.push(t.galley.text().to_string()), diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 5d1be479f..b3a705ca4 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -40,6 +40,7 @@ pub mod live; pub mod live_text; pub mod measure_overlay; pub mod menus; +pub mod missing_fonts; pub mod online; pub mod pending_open; pub mod plugins_ui; @@ -149,6 +150,8 @@ mod menu_aim_tests; #[cfg(test)] mod menu_input_tests; #[cfg(test)] +mod missing_fonts_tests; +#[cfg(test)] mod online_tests; #[cfg(test)] mod open_issues_tests; @@ -506,6 +509,9 @@ pub struct UiState { pub pending_open_frames: u8, /// The latest successful file import's summary and compatibility notes. pub import_report: Option, + /// Files the user opened whose fonts are yet to be checked (by document uid). + pub font_checks: Vec, + pub missing_fonts: Option, pub screenshot_requests: Vec<(u64, String)>, pub frame_ms: f64, pub render_ms: f64, @@ -633,6 +639,8 @@ impl Default for UiState { pending_opens: Vec::new(), pending_open_frames: 0, import_report: None, + font_checks: Vec::new(), + missing_fonts: None, screenshot_requests: Vec::new(), frame_ms: 0.0, render_ms: 0.0, @@ -761,6 +769,7 @@ impl FigApp { if let Some(result) = &result { import_report::capture(self, id, ¶ms, result); } + missing_fonts::check_later(self, id, result.as_ref()); result } @@ -875,6 +884,7 @@ impl FigApp { self.ui.about_tab = dialogs::AboutTab::About; } "dialog.preferences" => self.ui.preferences = true, + "dialog.missingFonts" => missing_fonts::request(self), "panel.shortcuts" => self.ui.shortcuts_panel = !self.ui.shortcuts_panel, "palette.actions" => menus::toggle_palette(&mut self.ui), "panel.design" => self.ui.right_tab = RightTab::Design, @@ -1661,6 +1671,7 @@ impl FigApp { "importReport": self.ui.import_report.as_ref().map(import_report::Report::inspect), }); state["pendingOpens"] = json!(self.ui.pending_opens.len()); + state["missingFonts"] = json!(self.ui.missing_fonts.as_ref().map(missing_fonts::Shown::inspect)); state } } diff --git a/crates/ui-egui/src/missing_fonts.rs b/crates/ui-egui/src/missing_fonts.rs new file mode 100644 index 000000000..8236ca90a --- /dev/null +++ b/crates/ui-egui/src/missing_fonts.rs @@ -0,0 +1,102 @@ +//! The Missing fonts window (#752): the fonts a file uses that aren't installed, whose text is +//! drawn in a fallback font. It opens by itself after the user opens a file that has any (once +//! the installed fonts are indexed and any import report is closed), and from Text ▸ Missing fonts. + +use egui::RichText; +use figcraft_engine::fonts::{Missing, missing}; +use serde_json::{Value, json}; + +use crate::FigApp; +use crate::i18n::{tr, trn}; +use crate::theme::{Tokens, regular}; + +#[derive(Clone, Debug)] +pub struct Shown { + /// The document it lists: the window goes when that document closes. + pub uid: u64, + pub families: Vec, +} + +impl Shown { + pub fn inspect(&self) -> Value { + json!({"families": self.families.iter().map(|m| json!({"family": m.family, "layers": m.layers})).collect::>()}) + } +} + +/// After a file the user opened (or imported into) is in front: look for missing fonts in it +/// once that can be told ([`show`]). +pub fn check_later(app: &mut FigApp, command: &str, result: Option<&Value>) { + if result.is_some() + && matches!(command, "file.open" | "file.openRecent" | "file.import") + && let Ok(ds) = app.session.ds() + { + app.ui.font_checks.push(ds.uid); + } +} + +/// The window for document `uid`, listing what it misses (even nothing, when asked for). +fn list(app: &mut FigApp, uid: u64) -> Option> { + let ds = app.session.docs.iter().find(|d| d.uid == uid)?; + let families = missing(&ds.doc); + app.ui.missing_fonts = Some(Shown { uid, families: families.clone() }); + Some(families) +} + +/// Text ▸ Missing fonts (`dialog.missingFonts`): the window for the file in front. +pub fn request(app: &mut FigApp) { + if let Ok(uid) = app.session.ds().map(|d| d.uid) { + list(app, uid); + } +} + +/// Installed fonts are indexed: before that, every one of them would count as missing. The +/// browser has only its built-in fonts, so files there don't open the window by themselves. +fn fonts_known() -> bool { + !cfg!(target_arch = "wasm32") && figcraft_text::system_fonts_scanned() +} + +pub fn show(app: &mut FigApp, ctx: &egui::Context) { + if !app.ui.font_checks.is_empty() && app.ui.import_report.is_none() && app.ui.missing_fonts.is_none() && fonts_known() { + let uid = app.ui.font_checks.remove(0); + if list(app, uid).is_some_and(|f| f.is_empty()) { + app.ui.missing_fonts = None; + } + } + if app.ui.missing_fonts.as_ref().is_some_and(|m| !app.session.docs.iter().any(|d| d.uid == m.uid)) { + app.ui.missing_fonts = None; + } + let Some(shown) = &app.ui.missing_fonts else { return }; + let t = Tokens::get(ctx); + let mut open = true; + let mut close_clicked = false; + crate::dialogs::window(tr("Missing fonts"), ctx).open(&mut open).show(ctx, |ui| { + ui.set_width(380.0); + if shown.families.is_empty() { + ui.label(tr("All the fonts this file uses are installed")); + } else { + ui.label( + RichText::new(tr( + "This file uses fonts that aren't installed on this computer. Their text is drawn in a fallback font until you install them.", + )) + .color(t.text_secondary) + .font(regular(11.0)), + ); + ui.add_space(6.0); + egui::ScrollArea::vertical().id_salt("missing_fonts").max_height(260.0).show(ui, |ui| { + for m in &shown.families { + ui.horizontal(|ui| { + ui.label(RichText::new(&m.family).strong()); + let used = + if m.layers == 0 { tr("only in a text style or variable").to_string() } else { trn("{n} text layers", m.layers, &[]) }; + ui.label(RichText::new(used).color(t.text_secondary)); + }); + } + }); + } + ui.add_space(12.0); + close_clicked = crate::widgets::button(ui, tr("Close"), true, true).clicked(); + }); + if !open || close_clicked { + app.ui.missing_fonts = None; + } +} diff --git a/crates/ui-egui/src/missing_fonts_tests.rs b/crates/ui-egui/src/missing_fonts_tests.rs new file mode 100644 index 000000000..ba86cc7e4 --- /dev/null +++ b/crates/ui-egui/src/missing_fonts_tests.rs @@ -0,0 +1,112 @@ +use figcraft_engine::Session; +use serde_json::{Value, json}; + +use crate::import_report::Report; +use crate::layers_drag_tests::Ui; + +/// A saved file with text in `families` (the first two layers share the first family). +fn saved(name: &str, families: &[&str]) -> String { + let mut s = Session::new(); + for (i, f) in families.iter().chain(families.first()).enumerate() { + s.execute("text.create", &json!({"text": "Hamburgefonstiv", "x": 0, "y": 40 * i, "props": {"fontFamily": f}})).unwrap(); + } + let path = std::env::temp_dir().join(format!("figcraft-missing-fonts-{name}-{}.figcraft", std::process::id())); + let path = path.to_string_lossy().into_owned(); + s.execute("file.saveAs", &json!({"path": path})).unwrap(); + path +} + +/// The installed fonts are indexed, as the desktop app does at startup; false when this machine +/// opted out (nothing would ever count as known). +fn fonts_indexed() -> bool { + figcraft_text::scan_system_fonts(); + figcraft_text::system_fonts_scanned() +} + +fn listed(u: &Ui) -> Value { + u.app.inspect()["missingFonts"].clone() +} + +#[test] +fn opening_a_file_lists_its_missing_fonts_and_not_the_installed_ones() { + if !fonts_indexed() { + eprintln!("skipped: system fonts opted out"); + return; + } + let installed = figcraft_text::family_names().into_iter().next(); + let mut families = vec!["FigCraft Missing UI"]; + families.extend(installed.as_deref()); + let path = saved("open", &families); + let mut u = Ui::new(Session::new()); + // Programmatic opens (control channel, MCP, scripts) never open the window. + u.app.run("file.open", json!({"path": path})); + u.frame(vec![]); + assert_eq!(listed(&u), Value::Null); + + u.app.run_user("file.open", json!({"path": path})); + std::fs::remove_file(&path).unwrap(); + u.frame(vec![]); + assert_eq!(listed(&u), json!({"families": [{"family": "FigCraft Missing UI", "layers": 2}]})); + u.frame(vec![]); + let shown = u.frame_output(vec![]).shapes; + assert!(crate::import_report_tests::shown_texts(shown).iter().any(|t| t == "2 text layers")); + + // It goes with its file. + u.app.run("file.close", json!({})); + u.frame(vec![]); + assert_eq!(listed(&u), Value::Null); +} + +#[test] +fn a_file_without_missing_fonts_opens_no_window() { + if !fonts_indexed() { + eprintln!("skipped: system fonts opted out"); + return; + } + let Some(installed) = figcraft_text::family_names().into_iter().next() else { + eprintln!("skipped: no fonts on this machine"); + return; + }; + let path = saved("clean", &[&installed]); + let mut u = Ui::new(Session::new()); + u.app.run_user("file.open", json!({"path": path})); + std::fs::remove_file(&path).unwrap(); + u.frame(vec![]); + assert_eq!(listed(&u), Value::Null); + assert!(u.app.ui.font_checks.is_empty(), "the check ran"); +} + +#[test] +fn it_waits_for_the_import_report_to_close() { + if !fonts_indexed() { + eprintln!("skipped: system fonts opted out"); + return; + } + let path = saved("report", &["FigCraft Missing Report"]); + let mut u = Ui::new(Session::new()); + u.app.run_user("file.open", json!({"path": path})); + std::fs::remove_file(&path).unwrap(); + let mut report = + Report::from_result("file.open", &json!({}), &json!({"warnings": ["Synthetic note"], "summary": {"name": "Synthetic"}})).unwrap(); + report.uid = u.app.session.ds().unwrap().uid; + u.app.ui.import_report = Some(report); + u.frame(vec![]); + assert_eq!(listed(&u), Value::Null, "the import report comes first"); + u.app.ui.import_report = None; + u.frame(vec![]); + assert_eq!(listed(&u)["families"][0]["family"], "FigCraft Missing Report"); +} + +#[test] +fn text_menu_shows_the_window_for_the_file_in_front_even_with_nothing_missing() { + let mut u = Ui::new(Session::new()); + assert!(u.app.run("text.missingFonts", json!({})).is_some()); + assert_eq!(listed(&u), json!({"families": []})); + u.frame(vec![]); + let shown = u.frame_output(vec![]).shapes; + assert!(crate::import_report_tests::shown_texts(shown).iter().any(|t| t == "All the fonts this file uses are installed")); + let escape = + vec![egui::Event::Key { key: egui::Key::Escape, physical_key: None, pressed: true, repeat: false, modifiers: egui::Modifiers::NONE }]; + u.frame(escape); + assert_eq!(listed(&u), Value::Null, "Escape closes it"); +} diff --git a/docs/cli.md b/docs/cli.md index 7b35c2d54..7af73fd60 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -29,7 +29,9 @@ be open to the public: [server.md](server.md#running-a-public-server)). See [ser ### `info [--json]` Pages, node counts, top-level frames (id, type, name, size), style/variable/image counts. Repairs -of a damaged file and import warnings go to stderr as `note:` lines (`notes` with `--json`). +of a damaged file and import warnings go to stderr as `note:` lines (`notes` with `--json`). Fonts the +file names that aren't installed are listed as `missing font` lines (`missingFonts: [{family, +layers}]` with `--json`); their text renders in a fallback font. Every subcommand that reads a file also takes the public REST API file JSON (the response of `GET /v1/files/:key` or of its nodes endpoint, written to a `.json` file): it is imported on the fly. diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index b65f77292..54e2dd25c 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -159,7 +159,7 @@ each. | Local fonts | yes (font helper / desktop app) | yes (system scan) | | 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 | warnings only (REST import) | +| Missing fonts on open | listed, with replacement | listed (Missing fonts window after an open, Text ▸ Missing fonts…, `text.missingFonts`, `figcraft-cli info`); no replacement; text draws in a fallback font | ## Revision history @@ -167,6 +167,7 @@ each. |---|---|---| | 2026-10-17 | minor | REST file JSON import reads grid track sizes from the CSS track strings `gridColumnsSizing` / `gridRowsSizing` (fixed px, fill fr, hug `auto`, `minmax(0, 1fr)`, `repeat()`; other tracks stay equal) (#465). Numbers unchanged | | 2026-10-17 | minor | The community batches #727 and #728 in the `.fig` row: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments (also REST), images in the message; budgets from the file's size; the journal keeps no file bytes; the import report. Not read cut to what's left. A `.fig` copy from Save as. Pasted content: layers copied from another design app, best effort (tested only with clipboard HTML made from our own export), and images under Wayland (not run there). All on synthetic files: summary and hours unchanged | +| 2026-10-17 | minor | Missing fonts (#752): the fonts a file names that aren't installed (text layers, styled ranges, text styles, font family variables in any mode) are listed when the user opens it (once installed fonts are indexed and any import report is closed), from Text ▸ Missing fonts…, by `text.missingFonts` and by `figcraft-cli info`. The row claimed REST import warnings no code produced. | | 2026-10-17 | minor | Hug on import (#732): auto layout frames a `.fig` records no primary-axis sizing for hug on that axis (auto layout sized that axis by its content before it could be fixed) instead of turning fixed, instances that record no auto layout take their main's (they came in without auto layout and fixed, so longer text overflowed them), REST frames whose sizing modes are left out hug (the documented default), and text hugs by its resize mode (auto width both axes, auto height its height; it came in fixed). Numbers unchanged | | 2026-10-17 | minor | Instance layers' own size and resizing (#731): a `.fig` import keeps the sizes an instance gives its layers and their hug/fill/fixed and min/max as overrides, a REST import reads the resizing fields of `overrides`, and a `.fig` export writes a layer's own size as an override (it went with the derived layout, which a relayout replaces). Numbers unchanged | | 2026-10-14 | minor | SVG/PDF depth overflow (#208) is checked before bounds and drawing; public checked APIs return the offending root/layer, commands and CLI report it, and no incomplete export replaces an existing file. Tested at depths 255/256/257, with inner roots, hidden branches, masks, raster fallbacks and multiple roots/pages. Numbers unchanged. | diff --git a/docs/mcp.md b/docs/mcp.md index e63283bdc..a84bf05b2 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -233,6 +233,8 @@ Or in a project's `.mcp.json`: user units, e.g. `{"wght": 550, "wdth": 85}` (`null` = back to what the style name implies); `text.setVariations {variations, replace?}` merges instead. `text.fonts {family, style?, axes: true}` lists a font's axes and named instances (named instances are also valid `fontStyle` values). + `text.missingFonts` lists the families the document names that aren't installed + (`{families: [{family, layers}]}`); their text draws in a fallback font. OpenType features: `features {"liga": false, "tnum": true}`. Decorations: `textDecorationStyle` (`solid`, `dotted`, `wavy`), `textDecorationThickness` and `textDecorationOffset` (`auto`, px, or `"10%"` of the font size; the offset runs from the baseline From db43dc5a4a25fc0b908286da451d6ee413ea5243 Mon Sep 17 00:00:00 2001 From: RealtaNua Date: Sat, 17 Oct 2026 22:06:03 +0700 Subject: [PATCH 227/817] M7: missing fonts window only after a file opens; wait for the font scan (#752) From review: - The check ran after any file.open/openRecent/import result, so a pasted or dropped image, reopening a file that was already open, or Clear recent brought the window back. It now runs only for results with a `summary` (a file opened, or pages imported), and never in the browser. - Text > Missing fonts... before the startup scan finished listed installed fonts as missing. It now says it is checking the installed fonts and lists them once that is done (`figcraft_text::installed_fonts_known`, also true when system fonts are opted out, where checks used to wait forever). - ROADMAP progress log and file-format-parity status line. Co-Authored-By: Claude Opus 5.5 (1M context) --- ROADMAP.md | 2 + crates/engine/src/fonts.rs | 2 +- crates/engine/src/fonts_tests.rs | 5 ++- crates/text/src/fontdb.rs | 10 +++++ crates/text/src/lib.rs | 2 +- crates/ui-egui/locales/en.toml | 1 + crates/ui-egui/locales/es.toml | 1 + crates/ui-egui/src/missing_fonts.rs | 38 +++++++++++------- crates/ui-egui/src/missing_fonts_tests.rs | 47 ++++++++++++++++++++--- docs/file-format-parity.md | 2 +- 10 files changed, 87 insertions(+), 23 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 8a587286d..7cef08a31 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -131,6 +131,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). ## Progress log +- **2026-10-17** · Missing fonts (M7, #752): fonts a file names that aren't installed (text layers, styled ranges, text styles, font family variables) are listed in a Missing fonts window after the user opens the file (once installed fonts are indexed and any import report is closed), from Text ▸ Missing fonts…, by `text.missingFonts` and by `figcraft-cli info`. Their text still draws in a fallback font. Numbers unchanged. - **2026-10-17** · Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. - **2026-10-17** · Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. - **2026-10-17** · Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. @@ -317,6 +318,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | +| 2026-10-17 | minor | Missing fonts (M7, #752): fonts a file names that aren't installed are listed after the user opens it, from Text ▸ Missing fonts…, by `text.missingFonts` and by `figcraft-cli info`. Numbers unchanged. | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | | 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | diff --git a/crates/engine/src/fonts.rs b/crates/engine/src/fonts.rs index e20d4d401..3548124d5 100644 --- a/crates/engine/src/fonts.rs +++ b/crates/engine/src/fonts.rs @@ -21,7 +21,7 @@ pub struct Missing { /// The families `doc` names that the font database doesn't have, by name. On the desktop the /// installed fonts are indexed in the background: ask once that's done -/// (`figcraft_text::system_fonts_scanned`), or every installed family counts as missing. +/// (`figcraft_text::installed_fonts_known`), or every installed family counts as missing. pub fn missing(doc: &Document) -> Vec { // Lower-case family → (spelling, layers). let mut used: BTreeMap = BTreeMap::new(); diff --git a/crates/engine/src/fonts_tests.rs b/crates/engine/src/fonts_tests.rs index 6ba925b38..a6e2d213f 100644 --- a/crates/engine/src/fonts_tests.rs +++ b/crates/engine/src/fonts_tests.rs @@ -112,7 +112,10 @@ fn blank_families_and_aliases_are_handled() { doc.get_mut(t).unwrap().bound.insert("fontFamily".into(), "V:alias".into()); let other = text(&mut s, "FigCraft Missing G"); s.doc_mut().unwrap().get_mut(other).unwrap().bound.insert("fontFamily".into(), "V:cycle".into()); - // The bound layer takes the value its alias resolves to; the cycle resolves to nothing. + // The bound layer takes the value its alias resolves to (bindings are applied after the next + // command); the cycle resolves to nothing. + let NodeKind::Text(bound) = &s.doc().unwrap().node(t).unwrap().kind else { panic!() }; + assert_eq!(bound.style.font_family, "FigCraft Missing F"); assert_eq!(families(&mut s), vec![("FigCraft Missing F".to_string(), 1), ("FigCraft Missing G".to_string(), 1)]); } diff --git a/crates/text/src/fontdb.rs b/crates/text/src/fontdb.rs index 8d1840b1a..f9eda2c6d 100644 --- a/crates/text/src/fontdb.rs +++ b/crates/text/src/fontdb.rs @@ -893,6 +893,16 @@ fn system_fonts_opted_out() -> bool { std::env::var_os("FIGCRAFT_NO_SYSTEM_FONTS").is_some_and(|v| !v.is_empty() && v != "0") } +/// Every font text can use is known: the system fonts were indexed, or there are none to index +/// (opted out, or the web). Until then a family the scan would find counts as missing. +pub fn installed_fonts_known() -> bool { + #[cfg(not(target_arch = "wasm32"))] + if !system_fonts_opted_out() { + return system_fonts_scanned(); + } + true +} + /// Index the system fonts the first time the font database is used (headless apps: a run that /// lays out no text never pays for the scan). The desktop app scans in the background instead. pub fn scan_system_fonts_on_demand() { diff --git a/crates/text/src/lib.rs b/crates/text/src/lib.rs index 721471ad9..683350f61 100644 --- a/crates/text/src/lib.rs +++ b/crates/text/src/lib.rs @@ -17,7 +17,7 @@ pub use breaks::grapheme_step; pub use color::{ColorBitmap, ColorInk, ColorLayer}; pub use fontdb::{ Axis, CRAFT_FONTS, Coords, Face, FontDb, NamedInstance, axis_label, db, face_with_char, family_names, family_styles, find_face, has_family, - no_coords, scan_system_fonts, scan_system_fonts_on_demand, system_fonts_scanned, + installed_fonts_known, no_coords, scan_system_fonts, scan_system_fonts_on_demand, system_fonts_scanned, }; pub use layout::{Decoration, Glyph, Line, TextLayout, layout}; pub use onpath::OnPath; diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 4003891b6..41c5b9d6a 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -198,6 +198,7 @@ name = "English" "C or ⇧C" = "C or ⇧C" "CMYK colour" = "CMYK colour" "Can view" = "Can view" +"Checking the fonts installed on this computer…" = "Checking the fonts installed on this computer…" "Checking the server…" = "Checking the server…" "Clear from this list" = "Clear from this list" "Code or invite link" = "Code or invite link" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index b442d6d3b..db4fba3e0 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -201,6 +201,7 @@ status = "draft — needs native review" "C or ⇧C" = "C o ⇧C" "CMYK colour" = "Color CMYK" "Can view" = "Puede ver" +"Checking the fonts installed on this computer…" = "Comprobando las fuentes instaladas en este equipo…" "Checking the server…" = "Comprobando el servidor…" "Clear from this list" = "Borrar de esta lista" "Code or invite link" = "Código o enlace de invitación" diff --git a/crates/ui-egui/src/missing_fonts.rs b/crates/ui-egui/src/missing_fonts.rs index 8236ca90a..6c07068dc 100644 --- a/crates/ui-egui/src/missing_fonts.rs +++ b/crates/ui-egui/src/missing_fonts.rs @@ -15,19 +15,26 @@ pub struct Shown { /// The document it lists: the window goes when that document closes. pub uid: u64, pub families: Vec, + /// Asked for before the installed fonts were indexed: the list comes once they are. + pub indexing: bool, } impl Shown { pub fn inspect(&self) -> Value { - json!({"families": self.families.iter().map(|m| json!({"family": m.family, "layers": m.layers})).collect::>()}) + json!({ + "families": self.families.iter().map(|m| json!({"family": m.family, "layers": m.layers})).collect::>(), + "indexing": self.indexing, + }) } } -/// After a file the user opened (or imported into) is in front: look for missing fonts in it -/// once that can be told ([`show`]). +/// After the user opened a file, or imported pages into one (results with a `summary`; not a +/// placed image or SVG, a file that was open already, or Clear recent): look for missing fonts in +/// it once that can be told ([`show`]). Not in the browser, which has only its built-in fonts. pub fn check_later(app: &mut FigApp, command: &str, result: Option<&Value>) { - if result.is_some() + if !cfg!(target_arch = "wasm32") && matches!(command, "file.open" | "file.openRecent" | "file.import") + && result.is_some_and(|r| r.get("summary").is_some()) && let Ok(ds) = app.session.ds() { app.ui.font_checks.push(ds.uid); @@ -38,25 +45,26 @@ pub fn check_later(app: &mut FigApp, command: &str, result: Option<&Value>) { fn list(app: &mut FigApp, uid: u64) -> Option> { let ds = app.session.docs.iter().find(|d| d.uid == uid)?; let families = missing(&ds.doc); - app.ui.missing_fonts = Some(Shown { uid, families: families.clone() }); + app.ui.missing_fonts = Some(Shown { uid, families: families.clone(), indexing: false }); Some(families) } /// Text ▸ Missing fonts (`dialog.missingFonts`): the window for the file in front. pub fn request(app: &mut FigApp) { - if let Ok(uid) = app.session.ds().map(|d| d.uid) { + let Ok(uid) = app.session.ds().map(|d| d.uid) else { return }; + if figcraft_text::installed_fonts_known() { list(app, uid); + } else { + app.ui.missing_fonts = Some(Shown { uid, families: Vec::new(), indexing: true }); } } -/// Installed fonts are indexed: before that, every one of them would count as missing. The -/// browser has only its built-in fonts, so files there don't open the window by themselves. -fn fonts_known() -> bool { - !cfg!(target_arch = "wasm32") && figcraft_text::system_fonts_scanned() -} - pub fn show(app: &mut FigApp, ctx: &egui::Context) { - if !app.ui.font_checks.is_empty() && app.ui.import_report.is_none() && app.ui.missing_fonts.is_none() && fonts_known() { + let known = figcraft_text::installed_fonts_known(); + if let Some(uid) = app.ui.missing_fonts.as_ref().filter(|m| m.indexing && known).map(|m| m.uid) { + list(app, uid); + } + if !app.ui.font_checks.is_empty() && app.ui.import_report.is_none() && app.ui.missing_fonts.is_none() && known { let uid = app.ui.font_checks.remove(0); if list(app, uid).is_some_and(|f| f.is_empty()) { app.ui.missing_fonts = None; @@ -71,7 +79,9 @@ pub fn show(app: &mut FigApp, ctx: &egui::Context) { let mut close_clicked = false; crate::dialogs::window(tr("Missing fonts"), ctx).open(&mut open).show(ctx, |ui| { ui.set_width(380.0); - if shown.families.is_empty() { + if shown.indexing { + ui.label(tr("Checking the fonts installed on this computer…")); + } else if shown.families.is_empty() { ui.label(tr("All the fonts this file uses are installed")); } else { ui.label( diff --git a/crates/ui-egui/src/missing_fonts_tests.rs b/crates/ui-egui/src/missing_fonts_tests.rs index ba86cc7e4..2b11260a4 100644 --- a/crates/ui-egui/src/missing_fonts_tests.rs +++ b/crates/ui-egui/src/missing_fonts_tests.rs @@ -16,11 +16,10 @@ fn saved(name: &str, families: &[&str]) -> String { path } -/// The installed fonts are indexed, as the desktop app does at startup; false when this machine -/// opted out (nothing would ever count as known). +/// The installed fonts are indexed, as the desktop app does at startup. fn fonts_indexed() -> bool { figcraft_text::scan_system_fonts(); - figcraft_text::system_fonts_scanned() + figcraft_text::installed_fonts_known() } fn listed(u: &Ui) -> Value { @@ -42,11 +41,12 @@ fn opening_a_file_lists_its_missing_fonts_and_not_the_installed_ones() { u.app.run("file.open", json!({"path": path})); u.frame(vec![]); assert_eq!(listed(&u), Value::Null); + u.app.run("file.close", json!({})); u.app.run_user("file.open", json!({"path": path})); std::fs::remove_file(&path).unwrap(); u.frame(vec![]); - assert_eq!(listed(&u), json!({"families": [{"family": "FigCraft Missing UI", "layers": 2}]})); + assert_eq!(listed(&u), json!({"families": [{"family": "FigCraft Missing UI", "layers": 2}], "indexing": false})); u.frame(vec![]); let shown = u.frame_output(vec![]).shapes; assert!(crate::import_report_tests::shown_texts(shown).iter().any(|t| t == "2 text layers")); @@ -99,9 +99,10 @@ fn it_waits_for_the_import_report_to_close() { #[test] fn text_menu_shows_the_window_for_the_file_in_front_even_with_nothing_missing() { + assert!(fonts_indexed()); let mut u = Ui::new(Session::new()); assert!(u.app.run("text.missingFonts", json!({})).is_some()); - assert_eq!(listed(&u), json!({"families": []})); + assert_eq!(listed(&u), json!({"families": [], "indexing": false})); u.frame(vec![]); let shown = u.frame_output(vec![]).shapes; assert!(crate::import_report_tests::shown_texts(shown).iter().any(|t| t == "All the fonts this file uses are installed")); @@ -110,3 +111,39 @@ fn text_menu_shows_the_window_for_the_file_in_front_even_with_nothing_missing() u.frame(escape); assert_eq!(listed(&u), Value::Null, "Escape closes it"); } + +#[test] +fn asked_for_before_the_fonts_are_indexed_it_lists_them_once_they_are() { + assert!(fonts_indexed()); + let path = saved("indexing", &["FigCraft Missing Indexing"]); + let mut u = Ui::new(Session::new()); + u.app.run("file.open", json!({"path": path})); + std::fs::remove_file(&path).unwrap(); + // As Text ▸ Missing fonts leaves it while the startup scan is still running. + let uid = u.app.session.ds().unwrap().uid; + u.app.ui.missing_fonts = Some(crate::missing_fonts::Shown { uid, families: Vec::new(), indexing: true }); + u.frame(vec![]); + assert_eq!(listed(&u), json!({"families": [{"family": "FigCraft Missing Indexing", "layers": 2}], "indexing": false})); +} + +#[test] +fn placing_images_or_clearing_recents_does_not_bring_it_back() { + assert!(fonts_indexed()); + let path = saved("place", &["FigCraft Missing Place"]); + let svg = std::env::temp_dir().join(format!("figcraft-missing-fonts-place-{}.svg", std::process::id())); + std::fs::write(&svg, r#""#).unwrap(); + let mut u = Ui::new(Session::new()); + u.app.run_user("file.open", json!({"path": path})); + u.frame(vec![]); + assert_eq!(listed(&u)["families"][0]["family"], "FigCraft Missing Place"); + u.app.ui.missing_fonts = None; + // A placed SVG, the same file opened again (it only comes to the front), Clear recent. + assert!(u.app.run_user("file.import", json!({"path": svg.to_string_lossy()})).is_some()); + assert!(u.app.run_user("file.open", json!({"path": path})).is_some()); + u.app.run_user("file.openRecent", json!({"clear": true})); + std::fs::remove_file(&path).unwrap(); + std::fs::remove_file(&svg).unwrap(); + u.frame(vec![]); + assert!(u.app.ui.font_checks.is_empty()); + assert_eq!(listed(&u), Value::Null); +} diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 54e2dd25c..900559dfd 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (REST import reads grid track sizes (#465); `.fig` import fidelity from the community batches, budgets for large files, the import report, a `.fig` copy from Save as, paste from another design app; instance layers' size and resizing and Hug on import (#731, #732); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (missing fonts listed on open (#752); REST import reads grid track sizes (#465); `.fig` import fidelity from the community batches, budgets for large files, the import report, a `.fig` copy from Save as, paste from another design app; instance layers' size and resizing and Hug on import (#731, #732); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) Every format Figma reads or writes, with FigCraft's support. Sources: `Info.plist` of `/Applications/Figma.app` (document types only; nothing inside the bundle's code was read), Figma's From 9b489a052ef963a2d601481bbd010e00fb0296ac Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 11:34:42 +0700 Subject: [PATCH 228/817] #776: drop the evidence log --- evidence/fix-delete-prototype-interaction.md | 64 -------------------- 1 file changed, 64 deletions(-) delete mode 100644 evidence/fix-delete-prototype-interaction.md diff --git a/evidence/fix-delete-prototype-interaction.md b/evidence/fix-delete-prototype-interaction.md deleted file mode 100644 index 54808f9ec..000000000 --- a/evidence/fix-delete-prototype-interaction.md +++ /dev/null @@ -1,64 +0,0 @@ -# Evidence: Fix Delete Prototype Interaction (#767) - -## Task Summary -- **Target Issue:** upstream [#767](https://github.com/storytold/figcraft/issues/767) - "When deleting a prototype, it also deletes the component." -- **PR:** [#776](https://github.com/storytold/figcraft/pull/776) -- **Branch:** `fix/delete-prototype-interaction` -- **Head Commit:** `bc5a2b8` - -## Root Cause -When an interaction noodle or interaction editor was clicked/selected in the Prototype tab, `proto_canvas.rs` set document selection to `[n.source]` (the layer). When Delete or Backspace was pressed, `shortcuts.rs` dispatched `edit.delete` without checking if an interaction was active, deleting the component instead of the interaction connection. - -## Implemented Fix -- Added `has_selected_interaction`, `delete_selected_interaction`, and `close_editor` in `crates/ui-egui/src/proto_panel.rs`. -- Handled `Key::Delete` and `Key::Backspace` in `shortcuts::key_event` and `run_binding` when in `RightTab::Prototype` with an active interaction, removing the interaction with `proto.interaction.remove` rather than deleting the layer. -- Added canvas deselect on click in `crates/ui-egui/src/proto_canvas.rs` and tab-switch close in `crates/ui-egui/src/right.rs`. -- Handled `Key::Escape` to close the interaction editor first before stepping out / deselecting layers. -- Added comprehensive headless regression tests in `crates/ui-egui/src/proto_editor_tests.rs`. - -## Raw Verification Evidence - -### 1. Test Execution (`cargo test -p figcraft-ui-egui --lib -- proto`) -```text -running 21 tests -test proto_editor_tests::the_builder_takes_variable_operator_value_conditions ... ok -test proto_canvas::tests::curves_leave_the_facing_side ... ok -test perf_tests::prototype_sources_follow_edits_and_undo ... ok -test proto_editor_tests::deleting_a_prototype_interaction_removes_the_interaction_not_the_component ... ok -test proto_editor_tests::the_presenter_inspects_the_layer_under_the_pointer ... ok -test present::tail_tests::prototypes_without_gamepad_triggers_dont_poll ... ok -test proto_responsive_tests::custom_sizes_present_as_a_bare_screen ... ok -test present::tail_tests::widgets_react_to_clicks_in_the_presented_prototype ... ok -test proto_editor_tests::a_click_where_nothing_reacts_flashes_the_hotspots ... ok -test proto_responsive_tests::prototype_panel_shows_colours_custom_sizes_and_responsive ... ok -test proto_editor_tests::escape_closes_prototype_editor_without_deselecting_layer ... ok -test proto_editor_tests::the_interaction_editor_shows_conditionals_and_picks_their_variables ... ok -test proto_responsive_tests::library_collections_show_in_the_mode_picker_under_their_library ... ok -test proto_reorder_tests::actions_inside_a_conditional_block_drag_within_their_block ... ok -test proto_reorder_tests::escape_cancels_an_action_drag_and_keeps_the_editor_open ... ok -test proto_reorder_tests::dragging_an_action_row_reorders_the_actions_in_one_step ... ok -test field_tests::scrubbing_a_prototype_delay_sets_it_once_when_let_go ... ok -test proto_editor_tests::typed_conditions_are_checked_and_errors_show_until_fixed ... ok -test proto_responsive_tests::without_a_device_a_responsive_frame_fills_the_window_at_100_percent ... ok -test proto_responsive_tests::responsive_frames_take_the_devices_screen_live ... ok -test idle_tests::the_prototype_curve_preview_plays_then_rests ... ok - -test result: ok. 21 passed; 0 failed; 0 ignored; 0 measured; 500 filtered out; finished in 0.15s -``` -Exit code: 0 -Passed: 21 -Failed: 0 -Skipped: 0 - -### 2. Format Verification (`cargo fmt --check`) -```text -Exit code: 0 -No formatting diffs found. -``` - -### 3. Git Status & PR -```text -Branch: fix/delete-prototype-interaction -Pull Request: https://github.com/storytold/figcraft/pull/776 -Target: storytold/figcraft:main -``` From d712f2ffd14c74f285433c7e99be1a32737d9db5 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 11:34:43 +0700 Subject: [PATCH 229/817] #776: collapse the nested if in select.none (clippy) --- crates/ui-egui/src/shortcuts.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index 50fee385a..695457afe 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -212,10 +212,10 @@ pub fn swallowed_paste(app: &mut FigApp, ctx: &Context) -> Swallowed { pub fn run_binding(app: &mut FigApp, id: &str) { match id { "select.none" => { - if let Some(ctx) = &app.ui_context { - if crate::proto_panel::close_editor(ctx) { - return; - } + if let Some(ctx) = &app.ui_context + && crate::proto_panel::close_editor(ctx) + { + return; } if let Err(e) = app.session.escape() { app.toast(e.to_string()); From 0f8e29bc9fd804f13d957bcf9c3ab6342fd709ff Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 11:35:34 +0700 Subject: [PATCH 230/817] #772: drop the progress-doc edits (maintainer adds them) --- ROADMAP.md | 1 - docs/ui-parity.md | 1 - 2 files changed, 2 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 74953dd58..8a587286d 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -316,7 +316,6 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| -| 2026-10-17 | minor | The presenter device and scale menus follow the active UI theme. The default presentation backdrop uses the theme canvas token, while a background explicitly selected in Prototype settings remains saved. Numbers unchanged. | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 188b2168e..dcda2c4e5 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -174,7 +174,6 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look |---|---|---| | 2026-10-17 | minor | Escape or Enter while the pen draws ends the path and keeps its vector in edit mode with the pen, so the next path is drawn into the same layer (unconnected); another Escape leaves edit mode (#760). Entering edit mode on a layer that already is a vector no longer records an empty undo step. Numbers unchanged | | 2026-10-17 | minor | Text layers keep the platform IME on for every frame of an edit, not only frames with input (an idle frame turned it off and macOS dropped each composition, #747); the candidate window opens at the caret instead of the canvas corner; keys pressed while composing go to the IME | -| 2026-10-17 | minor | Presenter device and scale menus use the active theme; the default backdrop uses the theme canvas token, preserving explicit Prototype background choices. Checked in the Windows app. Estimates unchanged. | | 2026-10-17 | minor | The community batches #733, #735, #736, #729 and #753: submenus open after a short hover, keep their place along a safe triangle and reopen closed (main and context menus); the Actions palette's tabs, ranked search, keyboard highlight and recents; menu items that need a value ask for it, File ▸ Rename edits in place; Shift+I and Resources open Assets; a draggable Pages/Layers divider; Shift-drag moves the selection; a double-click near a thin stroke, merging dropped points and Flatten keeping open paths in vector editing; live font preview and the selection highlight after line breaks; the colour picker on a new fill or stroke; Paste over and Paste properties from the keyboard; Selection colors (partial: no library styles or variables there) and smart-selection spacing fields and canvas handles (partial: no reorder rings), both also checked by their author on macOS; the keyboard shortcuts panel closes on the home screen; Adwaita window controls on Wayland compositors without server decorations (checked by its author on GNOME; KDE not run). Checked in the app on Windows (submenus by their author), not side by side with Figma. Summary and hours unchanged | | 2026-10-15 | minor | Hex fields take CSS colour names (`red` → `FF0000`): fills, strokes, effects, grids, variables, backgrounds and the colour picker | | 2026-10-15 | minor | Typography: drag the line-height, letter-spacing and paragraph-spacing icons to scrub their values; shared numeric-field rates, resize cursor and one Undo step per gesture (#373). | From 1768be296522671489f755e0c9c566eb3b411ef0 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 11:35:38 +0700 Subject: [PATCH 231/817] #772: leave the presentation backdrop as the file sets it (owner decision) --- crates/doc/src/proto.rs | 11 ----------- crates/engine/src/cmd/proto.rs | 1 - crates/engine/src/proto_present_tests.rs | 15 --------------- crates/ui-egui/src/present.rs | 3 +-- crates/ui-egui/src/proto_panel.rs | 7 +------ 5 files changed, 2 insertions(+), 35 deletions(-) diff --git a/crates/doc/src/proto.rs b/crates/doc/src/proto.rs index e89a3ed75..a844774c5 100644 --- a/crates/doc/src/proto.rs +++ b/crates/doc/src/proto.rs @@ -803,10 +803,6 @@ impl DeviceRotation { pub struct PrototypeSettings { pub device: String, pub background: figcraft_color::Color, - /// Distinguishes a user-selected colour from the legacy default so the presenter can use - /// its theme canvas token until a background is explicitly chosen. - #[serde(skip_serializing_if = "is_false")] - pub background_custom: bool, /// Applies to devices that turn (phones and tablets). pub rotation: DeviceRotation, /// The device's colour: one of its model's [`Device::colors`] by name (empty or one the model @@ -827,7 +823,6 @@ impl Default for PrototypeSettings { Self { device: "None".into(), background: figcraft_color::Color::from_rgb8_const(0x1E, 0x1E, 0x1E), - background_custom: false, rotation: DeviceRotation::Portrait, color: String::new(), custom_size: PrototypeSettings::CUSTOM_DEFAULT, @@ -864,12 +859,6 @@ pub struct Device { } impl PrototypeSettings { - /// Whether presentation should use the UI theme's canvas token. Old files only stored a - /// colour, so their original default is also treated as automatic. - pub fn uses_theme_background(&self) -> bool { - !self.background_custom && self.background == Self::default().background - } - /// The devices to pick from ("None" presents the frame at its own size). pub const DEVICES: [Device; 19] = [ Device { diff --git a/crates/engine/src/cmd/proto.rs b/crates/engine/src/cmd/proto.rs index 438290e64..be6907b51 100644 --- a/crates/engine/src/cmd/proto.rs +++ b/crates/engine/src/cmd/proto.rs @@ -187,7 +187,6 @@ fn settings(s: &mut Session, p: &Value) -> Result { let mut next = prototype.clone(); if let Some(c) = bg { next.background = c; - next.background_custom = true; } if let Some(d) = dev { next.device = d; diff --git a/crates/engine/src/proto_present_tests.rs b/crates/engine/src/proto_present_tests.rs index c48f3eadd..9d2bc48ba 100644 --- a/crates/engine/src/proto_present_tests.rs +++ b/crates/engine/src/proto_present_tests.rs @@ -16,21 +16,6 @@ fn settings(s: &Session) -> PrototypeSettings { } } -#[test] -fn prototype_background_uses_the_theme_until_a_colour_is_chosen() { - let mut s = Session::new(); - assert!(settings(&s).uses_theme_background()); - // Choosing even the old default explicitly must keep it through a file round trip. - s.execute("proto.settings", &json!({"background": "#1E1E1E"})).unwrap(); - assert!(!settings(&s).uses_theme_background()); - let bytes = figcraft_format::save_bytes(s.doc().unwrap(), None).unwrap(); - let (doc, _) = figcraft_format::load_bytes(&bytes).unwrap(); - let NodeKind::Page { prototype, .. } = &doc.node(doc.pages[0]).unwrap().kind else { panic!("not a page") }; - assert!(!prototype.uses_theme_background()); - s.execute("edit.undo", &json!({})).unwrap(); - assert!(settings(&s).uses_theme_background()); -} - #[test] fn device_rotation_turns_phones_and_tablets_and_is_saved() { let mut s = Session::new(); diff --git a/crates/ui-egui/src/present.rs b/crates/ui-egui/src/present.rs index 7ce5e9b7a..36eceb86b 100644 --- a/crates/ui-egui/src/present.rs +++ b/crates/ui-egui/src/present.rs @@ -2088,8 +2088,7 @@ fn player(p: &mut Presenter, ui: &mut Ui, rect: Rect, now: f64, chrome: Chrome) p.clock = now; let bar = Rect::from_min_size(rect.min, vec2(rect.width(), chrome.bar_h)); let area = Rect::from_min_max(pos2(rect.min.x, bar.max.y), rect.max); - let settings = p.doc.as_ref().map(|d| page_settings(d, p.current)).unwrap_or_default(); - let bg = if settings.uses_theme_background() { Tokens::get(ui.ctx()).canvas } else { crate::theme::doc_c32(ui.ctx(), settings.background) }; + let bg = crate::theme::doc_c32(ui.ctx(), p.doc.as_ref().map(|d| page_settings(d, p.current)).unwrap_or_default().background); let r = chrome.round; ui.painter().rect_filled(area, CornerRadius { nw: 0, ne: 0, sw: r, se: r }, bg); let action = top_bar(p, ui, bar, now, chrome); diff --git a/crates/ui-egui/src/proto_panel.rs b/crates/ui-egui/src/proto_panel.rs index 3bec9f872..47312e991 100644 --- a/crates/ui-egui/src/proto_panel.rs +++ b/crates/ui-egui/src/proto_panel.rs @@ -401,12 +401,7 @@ fn settings(app: &mut FigApp, ui: &mut Ui, doc: &Document, page: NodeId) { Some(NodeKind::Page { prototype, .. }) => prototype.clone(), _ => proto::PrototypeSettings::default(), }; - let bg = if settings.uses_theme_background() { - let canvas = Tokens::get(ui.ctx()).canvas; - figcraft_color::Color::from_rgb8_const(canvas.r(), canvas.g(), canvas.b()) - } else { - settings.background - }; + let bg = settings.background; let model = settings.model(); // Phones and tablets turn: a toggle beside the device picker. let rotates = model.is_some_and(|d| d.rotates); From d828e6379ef0b99d6a26670bd3f9c72ad0ab9681 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 11:36:06 +0700 Subject: [PATCH 232/817] #783: drop the progress-doc edits (maintainer adds them) --- ROADMAP.md | 5 ++--- docs/gaps.md | 11 +++++------ docs/localization-parity.md | 5 ++--- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index ecde012e4..8a587286d 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (French at 100% of the strings, an unreviewed draft; language table re-measured; preceding: 2026-10-17 community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -103,7 +103,7 @@ native speakers' reviews of the six language drafts need people. | Spanish | es, es-419 | 100% (es-419: an overlay of 101 entries) | draft (needs native review) | | Hindi | hi | 0% | none | | Arabic | ar | 0% | none | -| French | fr | 100% | draft (needs native review) | +| French | fr | 95% | draft (needs native review) | | Portuguese (Brazil) | pt-BR | 95% | draft (needs native review) | | Indonesian | id | 99% | draft (needs native review) | | Japanese | ja | 99% | draft (needs native review) | @@ -316,7 +316,6 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| -| 2026-10-18 | minor | French at 100% of the strings (gap 5, `fr.toml`): what the strings added since the draft left in English in the French catalog — the templates and their kinds with descriptions, the home screen's recents table (sorting, "Show in folder", the dates in the French way), dropping files to open or import, the Getting started tips with sharing by code, the Playground's bound-variable chip, smart-selection spacing, outline mode's options, the converting and panel-width tail — is translated: 91 UI strings, 12 command labels and 2 menu wordings, appended to the sections in the catalog's conventions (NBSP before : ! and inside « », one/other plurals with 0 singular). Still a draft awaiting native review; the language table row and per-area docs re-measured; numbers unchanged | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | diff --git a/docs/gaps.md b/docs/gaps.md index 68ce570e4..9b1a770c1 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Where FigCraft falls short of Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (French at 100% of the strings as an unreviewed draft; preceding: the 2026-10-17 landings: `.fig` import fidelity, budgets for large files, the import report, a `.fig` copy from Save as and paste from another design app (gap 1); menus, the Actions palette, editor fixes, Selection colors and smart-selection spacing (gap 4); catalog counts re-measured (gap 5); bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (the 2026-10-17 landings: `.fig` import fidelity, budgets for large files, the import report, a `.fig` copy from Save as and paste from another design app (gap 1); menus, the Actions palette, editor fixes, Selection colors and smart-selection spacing (gap 4); catalog counts re-measured (gap 5); bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) Every known shortfall against Figma, one entry each, ranked by how much it stops a Figma user from doing real work in FigCraft. Agents: pick work from the top unless the owner says otherwise. The @@ -18,7 +18,7 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe | 2 | Multiplayer and sharing are a preview, without accounts (**beta blocker**) | Feature | 42–84 | [collaboration-parity](collaboration-parity.md) | | 3 | Nothing checked against real Figma files | Fidelity | 15–30 | [target-app-parity](target-app-parity.md) | | 4 | Interaction fidelity not compared tool by tool | UI/UX | 40–60 | [ui-parity](ui-parity.md) | -| 5 | Localization: English, reviewed Russian, plus unreviewed Spanish (and Latin American Spanish), German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Czech drafts; French complete as an unreviewed draft; Turkish and Swedish catalogs | Localization | 29–51 | [localization-parity](localization-parity.md) | +| 5 | Localization: English, reviewed Russian, plus unreviewed Spanish (and Latin American Spanish), French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Czech drafts; Turkish and Swedish catalogs | Localization | 29–51 | [localization-parity](localization-parity.md) | | 6 | Plugins: widgets take clicks only, a self-hosted directory but no public catalogue; Figma's plugins don't run | Ecosystem | 8–26 | [target-app-parity](target-app-parity.md) | | 7 | CPU canvas where Figma uses the GPU | Hardware/performance | 30–60 | [hardware-parity](hardware-parity.md) | | 8 | Platform QA: Linux and the browser left (Windows pass done 2026-10-11) | Stability/platforms | 10–20 | [hardware-parity](hardware-parity.md) | @@ -187,10 +187,9 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe - **Evidence (measured from source):** the layer landed 2026-10-11: catalogs in `crates/ui-egui/locales/` (measured 2026-10-17: 1,680 UI keys plus 561 command labels and 31 menu wordings, 2,272 entries), Preferences ▸ Language, `pref.language`; `en.toml` is complete, - Spanish is held to completeness by the check, and French (2026-10-18) covers every string as a - draft; the German, Brazilian Portuguese, Japanese, Korean and Simplified Chinese machine drafts - cover 95–99% (strings added since they were drafted show English), with `es-419.toml` a Latin - American overlay listing only what + Spanish is held to completeness by the check, and the French, German, Brazilian Portuguese, + Japanese, Korean and Simplified Chinese machine drafts cover 95–99% (strings added since they + were drafted show English), with `es-419.toml` a Latin American overlay listing only what differs from Spanish. Russian (reviewed and approved by VanTan, one/few/many integer plurals) covers 98.8%; Indonesian and Czech drafts, a Turkish catalog whose header says a native speaker reviewed it, and a Swedish catalog (with its command labels since 2026-10-17) cover 98.7–99.6% ([localization-parity](localization-parity.md#languages)). diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 8f6f748f8..50fcd4ec3 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -1,6 +1,6 @@ # Localization parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (French at 100% of the strings, still an unreviewed draft; macOS finds its downloadable CJK system fonts (#406); string counts re-measured: 2,272 entries, the drafts at 95–99%; Swedish command labels and menu wordings; Russian, Swedish, Turkish, Czech and Indonesian listed; a duplicated paragraph removed; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (macOS finds its downloadable CJK system fonts (#406); string counts re-measured: 2,272 entries, the drafts at 95–99%; Swedish command labels and menu wordings; Russian, Swedish, Turkish, Czech and Indonesian listed; a duplicated paragraph removed; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog) · **Target:** Figma Design (desktop app 126.10.7) FigCraft's interface has a localization layer with an English catalog, a Russian catalog reviewed by a native speaker, and Spanish (with a Latin American overlay), French, German, Brazilian @@ -90,7 +90,7 @@ supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no v | Spanish | es, es-419 | 2,272 / 2,272 (100%, draft); es-419 overlays 101 Latin American wordings (draft) | yes | Latin | no | draft | 0–1 (after native review) | | Hindi | hi | 0 (0%) | no | Devanagari shaping works in documents; UI font fallback to check | no | none | 4–7 | | Arabic | ar | 0 (0%) | no | Bidi, shaping and RTL names work; the UI does not mirror | no | none | 9–15 | -| French | fr | 2,272 / 2,272 (100%, draft) | yes | Latin | no | draft | 1–2 (after native review) | +| French | fr | 2,167 / 2,272 (95.4%, draft) | yes | Latin | no | draft | 1–2 (after native review) | | Portuguese | pt-BR | 2,167 / 2,272 (95.4%, draft) | yes | Latin | no | draft | 1–2 (after native review) | | Indonesian | id | 2,244 / 2,272 (98.8%, draft) | yes | Latin | no | draft | 1–2 (after native review) | | Japanese | ja | 2,254 / 2,272 (99.2%, draft) | yes | CJK text and IME in documents; UI text in an installed Japanese face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | @@ -120,7 +120,6 @@ Hindi, Vietnamese and Arabic. Traditional Chinese is not planned (no catalog; it | Date | Change | Summary | |---|---|---| -| 2026-10-18 | minor | The French draft catches up to 100%: `fr.toml` translates the 91 UI strings, 12 command labels (`file.newFromTemplate`, `template.list`, `help.gettingStarted`, `component.playground`, `component.hideWhenPublishing`, `object.convertTo{Frame,Group,Section}`, `style.bind`, `view.outlinesHiddenLayers`, `view.outlinesObjectBounds`, `view.panelWidths`) and 2 menu wordings (the two outlines options) that the strings added since it was drafted left in English: starter templates and the Templates tab, the home screen's recents table with its sorting and "Show in folder", dropping files to open or import, the Getting started tips, sharing with a code, a rendered component's Playground bound-variable chip, smart-selection spacing and the outline options, and the dates on the recent cards (months abbreviated the French way, "A à Z"/"Z à A"); appended to each section in the catalog's conventions (NBSP before `:` `!` and inside « », one/other plurals with 0 counting as singular). Still a draft, awaiting native review; the language table row is re-measured | | 2026-10-17 | minor | Chinese showed as boxes on macOS (#406): the font scan also walks the system's downloaded font assets (`/System/Library/AssetsV2` and the older `/System/Library/Assets`, only their `com_apple_MobileAsset_Font*` folders), where current versions keep PingFang SC, and Hiragino Sans GB and Heiti SC join the Chinese UI faces and the text fallbacks. Tested with a folder laid out the same way; not yet run on a Mac | | 2026-10-17 | minor | String counts re-measured from the catalogs: 1,680 UI keys, 561 command labels and 31 menu wordings (2,272 entries); Spanish complete, the other drafts at 95.3–99.2% (strings added since 2026-10-12 show English), es-419 101 entries. Indonesian has a draft (98.8%; it was listed as none); Russian (98.8%, reviewed), Swedish (99.6%, command labels and menu wordings from #599), Turkish (98.7%) and Czech (98.8%) listed with counts; the language picker's list updated; a paragraph repeated by a merge removed. Grade and hours unchanged (Indonesian's draft is offset by the drafts' new gaps) | | 2026-10-14 | minor | Windows UI language (#291): the interface language comes from Windows' first preferred language alone; that list is also the input-language list (a German keyboard on a Polish system adds Deutsch), and taking the first entry with a catalog turned the interface German there. A first preferred language without a catalog reads English; macOS AppleLanguages and gettext's `LANGUAGE` still take the first language with a catalog | From d654a14720c5775685c218e1ff2bdc686be542d7 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 11:37:21 +0700 Subject: [PATCH 233/817] #783: put the new French rows in their sorted places --- crates/ui-egui/locales/fr.toml | 216 ++++++++++++++++----------------- 1 file changed, 105 insertions(+), 111 deletions(-) diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 785305402..6aeaf50c4 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -19,7 +19,10 @@ status = "draft — needs native review" "A collection of this file with these modes and variables: override their values per mode and add variables of its own" = "Une collection de ce fichier avec ces modes et ces variables : remplacez leurs valeurs par mode et ajoutez vos propres variables" "A .figcraft file with this name already exists. Choose its full name to confirm replacement." = "Un fichier .figcraft portant ce nom existe déjà. Choisissez son nom complet pour confirmer le remplacement." "A layer on its own aligns to its frame: select more layers, or one in a frame" = "Un calque seul s’aligne sur son cadre : sélectionnez d’autres calques, ou un calque dans un cadre" +"A responsive product page: hero, features, figures, a quote and a footer" = "Une page produit responsive : héros, fonctionnalités, chiffres, une citation et un pied de page" "A spring plays until it settles: its mass, stiffness and damping set how long" = "Un ressort joue jusqu’à ce qu’il se stabilise : sa masse, sa rigidité et son amortissement en fixent la durée" +"A title, an agenda, a big figure, a chart and a closing slide" = "Un titre, un sommaire, un grand chiffre, un graphique et une diapositive de clôture" +"A to Z" = "A à Z" "About" = "À propos" "About FigCraft" = "À propos de FigCraft" "About this server" = "À propos de ce serveur" @@ -65,6 +68,7 @@ status = "draft — needs native review" "Add variant with a new value" = "Ajouter une variante avec une nouvelle valeur" "Added" = "Ajouté" "Added the library \"{name}\"" = "Bibliothèque « {name} » ajoutée" +"Adding to {name}" = "Ajout dans {name}" "Adjust" = "Réglages" "Adjustment presets" = "Préréglages" "Advanced" = "Avancé" @@ -90,7 +94,9 @@ status = "draft — needs native review" "All supported properties" = "Toutes les propriétés prises en charge" "All variables" = "Toutes les variables" "Alpha" = "Alpha" +"Alphabetical" = "Alphabétique" "Alt+drag" = "Alt+glisser" +"An analytics screen on a grid: figures, charts drawn from vectors and a table" = "Un écran d’analyse sur une grille : chiffres, graphiques tracés en vectoriel et un tableau" "An invite link that opens FigCraft and joins" = "Un lien d’invitation qui ouvre FigCraft et rejoint la session" "Anchor" = "Ancre" "Android" = "Android" @@ -109,6 +115,8 @@ status = "draft — needs native review" "Apply variable" = "Appliquer une variable" "Apply variable to text" = "Appliquer une variable au texte" "Apply variable to visibility" = "Appliquer une variable à la visibilité" +"Apps" = "Applications" +"Apr" = "avr." "Arc" = "Arc" "Arc ratio" = "Rapport de l’arc" "Arc start" = "Début de l’arc" @@ -120,6 +128,7 @@ status = "draft — needs native review" "As typed" = "Tel que saisi" "Asking the server…" = "Interrogation du serveur…" "Assets" = "Ressources" +"Aug" = "août" "Auto" = "Auto" "Auto (space around)" = "Auto (espace autour)" "Auto (space between)" = "Auto (espace entre)" @@ -164,6 +173,7 @@ status = "draft — needs native review" "Bottom" = "Bas" "Bottom left radius" = "Rayon inférieur gauche" "Bottom right radius" = "Rayon inférieur droit" +"Bound to {name}. Click to detach the variable." = "Lié à {name}. Cliquez pour détacher la variable." "Branch" = "Branche" "Branch archived" = "Branche archivée" "Branch merged" = "Branche fusionnée" @@ -250,6 +260,7 @@ status = "draft — needs native review" "Color values in this file are in this color space." = "Les valeurs de couleur de ce fichier sont dans cet espace colorimétrique." "Color variables" = "Variables de couleur" "Colour" = "Couleur" +"Colour and text styles, Light and Dark variables, buttons, inputs and cards" = "Styles de couleur et de texte, variables Clair et Sombre, boutons, champs et cartes" "Column" = "Colonne" "Column gap" = "Espacement des colonnes" "Column sizes" = "Tailles des colonnes" @@ -286,6 +297,8 @@ status = "draft — needs native review" "Contributors" = "Contributeurs" "Contributors: {people} · Commits: {commits}" = "Contributeurs : {people} · Commits : {commits}" "Controller" = "Manette" +"Convert to frame" = "Convertir en cadre" +"Convert to section" = "Convertir en section" "Cool" = "Froid" "Copied as CSS" = "Copié en CSS" "Copied as PNG" = "Copié en PNG" @@ -319,6 +332,7 @@ status = "draft — needs native review" "Create property…" = "Créer une propriété…" "Create style" = "Créer un style" "Create style from the selected text" = "Créer un style à partir du texte sélectionné" +"Created" = "Création" "Crop" = "Recadrer" "Crop marks" = "Traits de coupe" "Ctrl+arrows" = "Ctrl+flèches" @@ -333,6 +347,9 @@ status = "draft — needs native review" "Dark" = "Sombre" "Darken" = "Assombrir" "Dash" = "Tirets" +"Dashboard" = "Tableau de bord" +"Date created" = "Date de création" +"Dec" = "déc." "Decoration style" = "Style de décoration" "Decoration" = "Décoration" "Deep select" = "Sélection en profondeur" @@ -359,6 +376,7 @@ status = "draft — needs native review" "Description" = "Description" "Description (optional)" = "Description (facultative)" "Design" = "Design" +"Design system starter" = "Base de système de design" "Desktop" = "Ordinateur" "Destination" = "Destination" "Detach alias" = "Détacher l’alias" @@ -394,8 +412,12 @@ status = "draft — needs native review" "Drafts" = "Brouillons" "Drag the stroke to add a width point" = "Faites glisser le contour pour ajouter un point de largeur" "Draw" = "Dessin" +"Draw a frame" = "Tracer un cadre" "Drawing tools" = "Outils de dessin" +"Drop a .figcraft, .fig, .json, .svg or image file." = "Déposez un fichier .figcraft, .fig, .json, .svg ou une image." "Drop shadow" = "Ombre portée" +"Drop to import" = "Déposer pour importer" +"Drop to open" = "Déposer pour ouvrir" "Dual-licensed MIT OR Apache-2.0. Made by the ArtCraft team and community." = "Double licence MIT OR Apache-2.0. Réalisé par l’équipe et la communauté ArtCraft." "Duo" = "Duo" "Duplicate" = "Dupliquer" @@ -412,6 +434,7 @@ status = "draft — needs native review" "Edit style" = "Modifier le style" "Edit variable" = "Modifier la variable" "Edit with the builder" = "Modifier avec l’assistant" +"Edited {when}" = "Modifié {when}" "Effect settings" = "Réglages de l’effet" "Effect styles" = "Styles d’effet" "Effects" = "Effets" @@ -442,6 +465,7 @@ status = "draft — needs native review" "Expand" = "Développer" "Export" = "Exporter" "Export all" = "Tout exporter" +"Export frames and layers as PNG, JPG, SVG or PDF" = "Exporter les cadres et les calques en PNG, JPG, SVG ou PDF" "Export page as PNG" = "Exporter la page en PNG" "Export settings" = "Réglages d’exportation" "Export variables" = "Exporter les variables" @@ -461,11 +485,13 @@ status = "draft — needs native review" "F" = "F" "Fade" = "Fondu" "False" = "Faux" +"Feb" = "févr." "Fetching from the server…" = "Récupération depuis le serveur…" "FigCraft couldn't open its window: {error}" = "FigCraft n’a pas pu ouvrir sa fenêtre : {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 ne prend pas encore en charge toutes les fonctionnalités de ces fichiers. Les notes indiquent ce qui a été omis ou modifié dans la copie importée ; le fichier d’origine reste inchangé." "File" = "Fichier" "File name" = "Nom du fichier" +"File not found" = "Fichier introuvable" "File published" = "Fichier publié" "Files aren't end-to-end encrypted: the server's operator can read them." = "Les fichiers ne sont pas chiffrés de bout en bout : l’opérateur du serveur peut les lire." "Files nobody opens for {n} days are deleted." = { one = "Les fichiers que personne n’ouvre pendant {n} jour sont supprimés.", other = "Les fichiers que personne n’ouvre pendant {n} jours sont supprimés." } @@ -512,6 +538,7 @@ status = "draft — needs native review" "Font size" = "Taille de police" "Font style" = "Style de police" "Forget on this computer" = "Oublier sur cet ordinateur" +"Four screens of a trail app with components and a prototype flow" = "Quatre écrans d’une application de randonnée avec des composants et un flux de prototype" "Fractions" = "Fractions" "Frame" = "Cadre" "Frame selection" = "Encadrer la sélection" @@ -525,6 +552,7 @@ status = "draft — needs native review" "Gap between columns" = "Espacement entre les colonnes" "Gap between items" = "Espacement entre les éléments" "Gap between rows" = "Espacement entre les lignes" +"Getting started" = "Premiers pas" "Give the address of a server open to the public, or a server's address with its key (`figcraft-server key` prints it)." = "Indiquez l’adresse d’un serveur ouvert au public, ou l’adresse d’un serveur avec sa clé (`figcraft-server key` l’affiche)." "Glass" = "Verre" "Go to main component" = "Aller au composant principal" @@ -533,6 +561,7 @@ status = "draft — needs native review" "Gradient" = "Dégradé" "Gray" = "Gris" "Green" = "Vert" +"Greyscale components and two example screens to sketch a flow with" = "Composants en niveaux de gris et deux écrans d’exemple pour esquisser un flux" "Grid" = "Grille" "Grid ({size})" = "Grille ({size})" "Grid styles" = "Styles de grille" @@ -554,6 +583,8 @@ status = "draft — needs native review" "Hide contents" = "Masquer le contenu" "Hide from publishing" = "Exclure de la publication" "Hide section contents" = "Masquer le contenu de la section" +"Hide these tips (Getting started in the Help menu shows them again)" = "Masquer ces astuces (Premiers pas dans le menu Aide les affiche de nouveau)" +"Hide when publishing" = "Masquer à la publication" "Highlight layers on hover" = "Mettre en évidence les calques au survol" "Highlights" = "Hautes lumières" "Hold Alt" = "Maintenir Alt" @@ -575,6 +606,8 @@ status = "draft — needs native review" "Hue" = "Teinte" "Hug" = "Ajuster" "Hug contents" = "Ajuster au contenu" +"Icon components on a 24 px grid with keylines and a size preview" = "Composants d’icônes sur une grille de 24 px avec repères et aperçu de la taille" +"Icon set starter" = "Base de jeu d’icônes" "If it keeps happening, please report it at {link} with this message." = "Si cela se reproduit, signalez-le sur {link} avec ce message." "If" = "Si" "If {condition}" = "Si {condition}" @@ -624,6 +657,7 @@ status = "draft — needs native review" "Invite link" = "Lien d’invitation" "Invite link copied" = "Lien d’invitation copié" "It asks permission to:" = "Il demande l’autorisation de :" +"Jan" = "janv." "Join" = "Rejoindre" "Join code copied" = "Code d’accès copié" "Join code or invite link" = "Code d’accès ou lien d’invitation" @@ -634,6 +668,8 @@ status = "draft — needs native review" "Joined {file}" = "Connecté à {file}" "Joining…" = "Connexion…" "Join|stroke" = "Jointure" +"Jul" = "juil." +"Jun" = "juin" "Just now" = "À l’instant" "Justify" = "Justifier" "Keep appearance" = "Conserver l’apparence" @@ -643,11 +679,14 @@ status = "draft — needs native review" "Key/Gamepad" = "Touche/manette" "Key/Gamepad {key}" = "Touche/manette {key}" "Keyboard shortcuts" = "Raccourcis clavier" +"Kits" = "Kits" +"Landing page" = "Page de destination" "Language" = "Langue" "Lasso" = "Lasso" "Last" = "Dernier" "Last change: {note}" = "Dernière modification : {note}" "Last commit" = "Dernier commit" +"Last modified" = "Dernière modification" "Last on top" = "Dernier au-dessus" "Layer blur" = "Flou de calque" "Layer name" = "Nom du calque" @@ -686,6 +725,7 @@ status = "draft — needs native review" "Link" = "Lien" "Link copied" = "Lien copié" "Link docs, code or tickets for developers." = "Liez de la documentation, du code ou des tickets pour les développeurs." +"Link frames on the Prototype tab, then present the flow" = "Reliez les cadres dans l’onglet Prototype, puis présentez le flux" "Link this component to its code component: instances then show your real snippet with their values." = "Reliez ce composant à son composant de code : les instances affichent alors votre véritable extrait avec leurs valeurs." "List spacing" = "Espacement de liste" "List style" = "Style de liste" @@ -703,7 +743,9 @@ status = "draft — needs native review" "Main" = "Principal" "Main component deleted" = "Composant principal supprimé" "Main menu" = "Menu principal" +"Make a component" = "Créer un composant" "Make slot" = "Créer un emplacement" +"Mar" = "mars" "Margin" = "Marge" "Mark all as read" = "Tout marquer comme lu" "Mark as resolved" = "Marquer comme résolu" @@ -716,6 +758,7 @@ status = "draft — needs native review" "Max W" = "L max." "Max lines" = "Lignes max." "Maximize" = "Agrandir" +"May" = "mai" "Measure to the selection" = "Mesurer jusqu’à la sélection" "Merge into main" = "Fusionner dans le principal" "Merge regions" = "Fusionner les régions" @@ -737,6 +780,7 @@ status = "draft — needs native review" "Mixed" = "Mixte" "Mixed fonts" = "Polices mixtes" "Mixed interactions: click + to replace them" = "Interactions mixtes : cliquez sur + pour les remplacer" +"Mobile app" = "Application mobile" "Mode" = "Mode" "Model" = "Modèle" "Models" = "Modèles" @@ -766,6 +810,7 @@ status = "draft — needs native review" "Navigate to" = "Naviguer vers" "Nested instance" = "Instance imbriquée" "New design file" = "Nouveau fichier de design" +"Newest first" = "Plus récent d’abord" "Next frame" = "Cadre suivant" "Next or previous control in the focused region" = "Contrôle suivant ou précédent dans la région active" "Next ready for dev" = "Prêt pour le dev suivant" @@ -799,6 +844,7 @@ status = "draft — needs native review" "No model credits were built into this copy." = "Cette copie ne contient aucun crédit de modèle." "No number variables fit here." = "Aucune variable numérique ne convient ici." "No number variables yet. Create them in Local variables." = "Aucune variable numérique pour l’instant. Créez-en dans Variables locales." +"No other pages" = "Aucune autre page" "No paints" = "Aucune peinture" "No plugins on {server}." = "Aucun plugin sur {server}." "No plugins yet. Import a development plugin from its figcraft-plugin.json." = "Aucun plugin pour l’instant. Importez un plugin en développement depuis son figcraft-plugin.json." @@ -812,6 +858,7 @@ status = "draft — needs native review" "No string variables yet. Create them in Local variables." = "Aucune variable de chaîne pour l’instant. Créez-en dans Variables locales." "No styles yet." = "Aucun style pour l’instant." "No styles yet. Click + to create one from the selection." = "Aucun style pour l’instant. Cliquez sur + pour en créer un à partir de la sélection." +"No templates match your search" = "Aucun modèle ne correspond à votre recherche" "No text styles yet. Click + to create one from the selected text." = "Aucun style de texte pour l’instant. Cliquez sur + pour en créer un à partir du texte sélectionné." "No variables fit here." = "Aucune variable ne convient ici." "No variables yet. Create them in Local variables." = "Aucune variable pour l’instant. Créez-en dans Variables locales." @@ -831,6 +878,7 @@ status = "draft — needs native review" "Nothing here yet. Set a frame's status to list it." = "Rien pour l’instant. Attribuez un statut à un cadre pour le lister ici." "Nothing online yet. Use Share on a file to put it online and it is listed here." = "Rien en ligne pour l’instant. Utilisez Partager sur un fichier pour le mettre en ligne et il apparaîtra ici." "Nothing to export" = "Rien à exporter" +"Nov" = "nov." "Now" = "Maintenant" "Nudge (Shift: big nudge)" = "Décaler (Maj : grand décalage)" "Nudge amount" = "Pas de décalage" @@ -839,13 +887,16 @@ status = "draft — needs native review" "Number ↓" = "Numéro ↓" "Numbered list" = "Liste numérotée" "Object" = "Objet" +"Oct" = "oct." "Off" = "Non" "Offered first when filling the slot (any content is allowed)" = "Proposés en premier pour remplir l’emplacement (tout contenu est autorisé)" "Offered first when swapping the instance (any component is allowed)" = "Proposés en premier pour permuter l’instance (tout composant est autorisé)" "Offset" = "Décalage" +"Oldest first" = "Plus ancien d’abord" "On click" = "Au clic" "On drag" = "Au glissement" "On this page" = "Sur cette page" +"One announcement in five common sizes: square, portrait, story, link and banner" = "Une annonce en cinq formats courants : carré, portrait, story, lien et bannière" "Online" = "En ligne" "Online files" = "Fichiers en ligne" "Online sharing is off: files are shared on the local network only." = "Le partage en ligne est désactivé : les fichiers ne sont partagés que sur le réseau local." @@ -870,9 +921,13 @@ status = "draft — needs native review" "Open variables ({count})" = "Ouvrir les variables ({count})" "Opened as a new document" = "Ouvert comme nouveau document" "Opened “{name}” in a new tab" = "« {name} » ouvert dans un nouvel onglet" +"Opening the file…" = "Ouverture du fichier…" +"Opening {n} files as new files" = { one = "Ouverture comme nouveau fichier", other = "Ouverture de {n} fichiers comme nouveaux fichiers" } "Open|comments" = "Ouverts" "Options" = "Options" "Orange" = "Orange" +"Order" = "Ordre" +"Other" = "Autre" "Other apps may not open every .fig file exported here." = "D’autres applications risquent de ne pas ouvrir tous les fichiers .fig exportés ici." "Others lose access and keep their copy; the file stays on the server for you" = "Les autres perdent l’accès et conservent leur copie ; le fichier reste sur le serveur pour vous" "Others type this under Share ▸ Join with a code" = "Les autres le saisissent dans Partager ▸ Rejoindre avec un code" @@ -893,6 +948,7 @@ status = "draft — needs native review" "Page" = "Page" "Pages" = "Pages" "Pages added to the document" = "Pages ajoutées au document" +"Pick the Frame tool, then drag on the canvas or choose a device size" = "Choisissez l’outil Cadre, puis faites glisser sur le canevas ou choisissez une taille d’appareil" "Placed on the current page" = "Placé sur la page actuelle" "Pages: {pages}" = "Pages : {pages}" "Paint bucket" = "Pot de peinture" @@ -930,7 +986,10 @@ status = "draft — needs native review" "Place a shape or frame (its tool chosen)" = "Placer une forme ou un cadre (outil choisi)" "Place automatically" = "Placer automatiquement" "Place image" = "Placer une image" +"Playground" = "Bac à sable" +"Plugin" = "Plugin" "Plugins" = "Plugins" +"Plugins & widgets" = "Plugins et widgets" "Plugins run in FigCraft's sandbox, without files, network or clock. Install only plugins you trust." = "Les plugins s’exécutent dans le bac à sable de FigCraft, sans fichiers, réseau ni horloge. N’installez que des plugins de confiance." "Plus darker" = "Plus foncé" "Plus lighter" = "Plus clair" @@ -947,6 +1006,7 @@ status = "draft — needs native review" "Present or preview" = "Présenter ou prévisualiser" "Present this flow" = "Présenter ce flux" "Presentation" = "Présentation" +"Presentation slides" = "Diapositives de présentation" "Presenting: comments" = "Présentation : commentaires" "Presenting: cycle the size options" = "Présentation : parcourir les options de taille" "Presenting: full screen" = "Présentation : plein écran" @@ -1003,6 +1063,7 @@ status = "draft — needs native review" "Remove auto layout" = "Retirer la mise en page auto" "Remove dev resource" = "Retirer la ressource de développement" "Remove export setting" = "Retirer le réglage d’exportation" +"Remove from recents" = "Retirer des récents" "Remove from server" = "Retirer du serveur" "Remove from server…" = "Retirer du serveur…" "Remove guide" = "Retirer le repère" @@ -1115,15 +1176,18 @@ status = "draft — needs native review" "Search layers" = "Rechercher des calques" "Search plugins" = "Rechercher des plugins" "Search shortcuts" = "Rechercher des raccourcis" +"Search templates" = "Rechercher des modèles" "Section" = "Section" "Section color" = "Couleur de la section" "Sections" = "Sections" +"See all templates" = "Voir tous les modèles" "Select a frame and add a starting point to present it as a flow." = "Sélectionnez un cadre et ajoutez un point de départ pour le présenter comme un flux." "Select a frame to preview it" = "Sélectionnez un cadre pour le prévisualiser" "Select a layer to see its properties and code" = "Sélectionnez un calque pour voir ses propriétés et son code" "Select all" = "Tout sélectionner" "Select all with same" = "Sélectionner tout ce qui a le même" "Select layer" = "Sélectionner le calque" +"Select layers and they space themselves as their content changes" = "Sélectionnez des calques et leur espacement s’ajuste quand leur contenu change" "Select layers to apply the style to" = "Sélectionnez les calques auxquels appliquer le style" "Select layers with this color" = "Sélectionner les calques de cette couleur" "Select overlapping shapes" = "Sélectionnez des formes qui se chevauchent" @@ -1136,6 +1200,7 @@ status = "draft — needs native review" "Send backward" = "Reculer" "Send report" = "Envoyer le signalement" "Send to back" = "Mettre à l’arrière-plan" +"Sep" = "sept." "Server address" = "Adresse du serveur" "Server address (ws://host:47900/)" = "Adresse du serveur (ws://host:47900/)" "Server for online sharing" = "Serveur pour le partage en ligne" @@ -1150,6 +1215,7 @@ status = "draft — needs native review" "Shape tools" = "Outils de forme" "Share" = "Partager" "Share this file" = "Partager ce fichier" +"Share with a code" = "Partager avec un code" "Share: live session, export" = "Partager : session en direct, exportation" "Shared" = "Partagé" "Shared: copy its code from the file's menu" = "Partagé : copiez son code depuis le menu du fichier" @@ -1159,6 +1225,7 @@ status = "draft — needs native review" "Sharing online · {people}" = "Partage en ligne · {people}" "Sharing stopped: the file stays on the server, open only to you" = "Partage arrêté : le fichier reste sur le serveur, accessible à vous seul" "Show" = "Afficher" +"Show all templates" = "Afficher tous les modèles" "Show as grid" = "Afficher en grille" "Show as list" = "Afficher en liste" "Show autosaves" = "Afficher les sauvegardes auto" @@ -1167,6 +1234,9 @@ status = "draft — needs native review" "Show device frame" = "Afficher le cadre de l’appareil" "Show dimensions on objects" = "Afficher les dimensions sur les objets" "Show hotspot hints" = "Afficher les zones interactives" +"Show in Explorer" = "Afficher dans l’Explorateur" +"Show in Finder" = "Afficher dans le Finder" +"Show in folder" = "Afficher dans le dossier" "Show only this on the canvas" = "Afficher uniquement ceci sur le canevas" "Show open" = "Afficher les ouverts" "Show section contents" = "Afficher le contenu de la section" @@ -1191,13 +1261,17 @@ status = "draft — needs native review" "Small caps" = "Petites capitales" "Smart animate" = "Animation intelligente" "Snap to pixel grid" = "Aimanter à la grille de pixels" +"Social and slides" = "Réseaux sociaux et diapositives" "Social media" = "Réseaux sociaux" +"Social post sizes" = "Formats de publications sociales" "Soft light" = "Lumière douce" "Solid" = "Continu" "Some variants have the same property values: give each one a unique combination" = "Certaines variantes ont les mêmes valeurs de propriété : donnez à chacune une combinaison unique" "Sort" = "Trier" +"Sort by" = "Trier par" "Sort by date" = "Trier par date" "Sort by page" = "Trier par page" +"Sort by {column}" = "Trier par {column}" "Space around" = "Espace autour" "Space between" = "Espace entre" "Space drag" = "Espace et glisser" @@ -1216,9 +1290,11 @@ status = "draft — needs native review" "Start" = "Début" "Start ascending from / stop descending at" = "Compter vers le haut depuis / vers le bas jusqu’à" "Start from a blank canvas" = "Commencer avec un canevas vide" +"Start from a template" = "Commencer avec un modèle" "Start on path" = "Début sur le tracé" "Start point" = "Point de départ" "Start sharing" = "Commencer le partage" +"Start sharing with the Share button, then pass on the code it gives" = "Commencez à partager avec le bouton Partager, puis communiquez le code qu’il donne" "Starting to share…" = "Démarrage du partage…" "Status" = "Statut" "Sticky" = "Collant" @@ -1267,6 +1343,7 @@ status = "draft — needs native review" "Tell the server's operator what is wrong with it" = "Indiquez à l’opérateur du serveur ce qui ne va pas" "Temperature" = "Température" "Template" = "Modèle" +"Templates" = "Modèles" "Terms" = "Conditions" "Text" = "Texte" "Text align" = "Alignement du texte" @@ -1276,6 +1353,9 @@ status = "draft — needs native review" "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 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é." "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." = "Le fichier est supprimé du serveur : plus personne ne pourra l’ouvrir ni le rejoindre depuis celui-ci, et c’est irréversible. Les copies ouvertes restent à ceux qui les ont." "The file now holds another library" = "Le fichier contient désormais une autre bibliothèque" "The file now holds another library (\"{name}\")" = "Le fichier contient désormais une autre bibliothèque (« {name} »)" @@ -1324,6 +1404,8 @@ status = "draft — needs native review" "Truncate with an ellipsis" = "Tronquer avec des points de suspension" "Try again" = "Réessayer" "Try another search or filter." = "Essayez une autre recherche ou un autre filtre." +"Try another word, or look at every kind." = "Essayez un autre mot, ou regardez chaque type." +"Turn a layer into a component, reuse it, and change every copy at once" = "Transformez un calque en composant, réutilisez-le et modifiez toutes les copies d’un coup" "Two digits" = "Deux chiffres" "Type" = "Type" "Type settings" = "Réglages typographiques" @@ -1362,6 +1444,7 @@ status = "draft — needs native review" "Use the layer's fill" = "Utiliser le remplissage du calque" "Used in {files} · {instances}" = "Utilisé dans {files} · {instances}" "Username" = "Nom d’utilisateur" +"Uses variables: each layer shows them in its own mode" = "Utilise des variables : chaque calque les affiche dans son propre mode" "Value" = "Valeur" "Variable" = "Variable" "Variable collections" = "Collections de variables" @@ -1400,21 +1483,25 @@ status = "draft — needs native review" "Web" = "Web" "WebSocket URL" = "URL WebSocket" "WebSocket URL copied" = "URL WebSocket copiée" +"Websites" = "Sites web" "Wedge" = "Coin" "Weight" = "Graisse" "What changed since it was marked ready for dev" = "Ce qui a changé depuis le marquage prêt pour le dev" "What is wrong with this file? The server's operator gets your report." = "Qu’est-ce qui ne va pas avec ce fichier ? L’opérateur du serveur reçoit votre signalement." "What it's for" = "À quoi il sert" "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." = "L’état d’origine de cette modification est inconnu : elle date d’avant que FigCraft ne conserve une copie des cadres prêts pour le dev. Résolvez la modification (ou marquez-la à nouveau comme prête) pour comparer à partir de maintenant." +"What you try here changes this preview and the code below, not the file" = "Ce que vous essayez ici change cet aperçu et le code ci-dessous, pas le fichier" "While hovering" = "Pendant le survol" "While pressing" = "Pendant l’appui" "White" = "Blanc" "Who runs it, its terms and how long it keeps files" = "Qui le gère, ses conditions et combien de temps il conserve les fichiers" "Why it changed" = "Pourquoi cela a changé" +"Widget" = "Widget" "Widgets" = "Widgets" "Width" = "Largeur" "Width point" = "Point de largeur" "Width profile" = "Profil de largeur" +"Wireframe kit" = "Kit de wireframes" "With the layers' export settings" = "Avec les réglages d’exportation des calques" "Wrap" = "Renvoi à la ligne" "Wrap in new section" = "Envelopper dans une nouvelle section" @@ -1429,6 +1516,7 @@ status = "draft — needs native review" "Your name in comments" = "Votre nom dans les commentaires" "Your system asks for reduced motion: animations stay off." = "Votre système demande de réduire les animations : elles restent désactivées." "Z" = "Z" +"Z to A" = "Z à A" "Zoom" = "Zoom" "Zoom around the pointer" = "Zoomer autour du pointeur" "Zoom device to fill window" = "Zoomer l’appareil pour remplir la fenêtre" @@ -1492,6 +1580,7 @@ status = "draft — needs native review" "invalid internal .fig text path data was ignored" = "les données internes non valides de texte sur tracé du .fig ont été ignorées" "invalid or oversized vector networks import as outlines" = "les réseaux vectoriels non valides ou trop grands sont importés comme tracés" "invalid or oversized vector path data was skipped" = "les données de tracé vectoriel non valides ou trop grandes ont été ignorées" +"just now" = "à l’instant" "key triggers without a supported key were skipped" = "les déclencheurs de touche sans touche prise en charge ont été ignorés" "key up triggers import as key presses" = "les déclencheurs au relâchement d’une touche sont importés comme des appuis sur la touche" "layers without a position were placed at their parent's origin" = "les calques sans position ont été placés à l’origine de leur parent" @@ -1559,9 +1648,11 @@ status = "draft — needs native review" "very long vector paths were skipped" = "les tracés vectoriels très longs ont été ignorés" "video actions are not supported and were skipped" = "les actions vidéo ne sont pas prises en charge et ont été ignorées" "video triggers are not supported and were skipped" = "les déclencheurs vidéo ne sont pas pris en charge et ont été ignorés" +"yesterday" = "hier" "{instances} in {files}" = "{instances} dans {files}" "{language}: draft translation, waiting for a native speaker's review." = "{language} : traduction provisoire, en attente de relecture par un locuteur natif." "{length} bleed" = "fond perdu de {length}" +"{month} {day}, {year}" = "{day} {month} {year}" "{name}\nClick to apply to the selection" = "{name}\nCliquez pour l’appliquer à la sélection" "{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}\nFaites glisser sur le canevas, ou cliquez pour le placer au centre de la vue.\nMaintenez Alt (Option) en le déposant sur une instance pour la permuter." "{name} (from {library})" = "{name} (de {library})" @@ -1637,99 +1728,6 @@ status = "draft — needs native review" "⌘ scroll" = "⌘ défilement" "⌥ drag" = "⌥ glisser" -# Strings translated since the draft (2026-10-18), appended; a native review is still pending. -"A responsive product page: hero, features, figures, a quote and a footer" = "Une page produit responsive : héros, fonctionnalités, chiffres, une citation et un pied de page" -"A title, an agenda, a big figure, a chart and a closing slide" = "Un titre, un sommaire, un grand chiffre, un graphique et une diapositive de clôture" -"A to Z" = "A à Z" -"Adding to {name}" = "Ajout dans {name}" -"Alphabetical" = "Alphabétique" -"An analytics screen on a grid: figures, charts drawn from vectors and a table" = "Un écran d’analyse sur une grille : chiffres, graphiques tracés en vectoriel et un tableau" -"Apps" = "Applications" -"Apr" = "avr." -"Aug" = "août" -"Bound to {name}. Click to detach the variable." = "Lié à {name}. Cliquez pour détacher la variable." -"Colour and text styles, Light and Dark variables, buttons, inputs and cards" = "Styles de couleur et de texte, variables Clair et Sombre, boutons, champs et cartes" -"Convert to frame" = "Convertir en cadre" -"Convert to section" = "Convertir en section" -"Created" = "Création" -"Dashboard" = "Tableau de bord" -"Date created" = "Date de création" -"Dec" = "déc." -"Design system starter" = "Base de système de design" -"Draw a frame" = "Tracer un cadre" -"Drop a .figcraft, .fig, .json, .svg or image file." = "Déposez un fichier .figcraft, .fig, .json, .svg ou une image." -"Drop to import" = "Déposer pour importer" -"Drop to open" = "Déposer pour ouvrir" -"Edited {when}" = "Modifié {when}" -"Export frames and layers as PNG, JPG, SVG or PDF" = "Exporter les cadres et les calques en PNG, JPG, SVG ou PDF" -"Feb" = "févr." -"File not found" = "Fichier introuvable" -"Four screens of a trail app with components and a prototype flow" = "Quatre écrans d’une application de randonnée avec des composants et un flux de prototype" -"Getting started" = "Premiers pas" -"Greyscale components and two example screens to sketch a flow with" = "Composants en niveaux de gris et deux écrans d’exemple pour esquisser un flux" -"Hide these tips (Getting started in the Help menu shows them again)" = "Masquer ces astuces (Premiers pas dans le menu Aide les affiche de nouveau)" -"Hide when publishing" = "Masquer à la publication" -"Icon components on a 24 px grid with keylines and a size preview" = "Composants d’icônes sur une grille de 24 px avec repères et aperçu de la taille" -"Icon set starter" = "Base de jeu d’icônes" -"Jan" = "janv." -"Jul" = "juil." -"Jun" = "juin" -"Kits" = "Kits" -"Landing page" = "Page de destination" -"Last modified" = "Dernière modification" -"Link frames on the Prototype tab, then present the flow" = "Reliez les cadres dans l’onglet Prototype, puis présentez le flux" -"Make a component" = "Créer un composant" -"Mar" = "mars" -"May" = "mai" -"Mobile app" = "Application mobile" -"Newest first" = "Plus récent d’abord" -"No other pages" = "Aucune autre page" -"No templates match your search" = "Aucun modèle ne correspond à votre recherche" -"Nov" = "nov." -"Oct" = "oct." -"Oldest first" = "Plus ancien d’abord" -"One announcement in five common sizes: square, portrait, story, link and banner" = "Une annonce en cinq formats courants : carré, portrait, story, lien et bannière" -"Opening the file…" = "Ouverture du fichier…" -"Opening {n} files as new files" = { one = "Ouverture comme nouveau fichier", other = "Ouverture de {n} fichiers comme nouveaux fichiers" } -"Order" = "Ordre" -"Other" = "Autre" -"Pick the Frame tool, then drag on the canvas or choose a device size" = "Choisissez l’outil Cadre, puis faites glisser sur le canevas ou choisissez une taille d’appareil" -"Playground" = "Bac à sable" -"Plugin" = "Plugin" -"Plugins & widgets" = "Plugins et widgets" -"Presentation slides" = "Diapositives de présentation" -"Remove from recents" = "Retirer des récents" -"Search templates" = "Rechercher des modèles" -"See all templates" = "Voir tous les modèles" -"Select layers and they space themselves as their content changes" = "Sélectionnez des calques et leur espacement s’ajuste quand leur contenu change" -"Sep" = "sept." -"Share with a code" = "Partager avec un code" -"Show all templates" = "Afficher tous les modèles" -"Show in Explorer" = "Afficher dans l’Explorateur" -"Show in Finder" = "Afficher dans le Finder" -"Show in folder" = "Afficher dans le dossier" -"Social and slides" = "Réseaux sociaux et diapositives" -"Social post sizes" = "Formats de publications sociales" -"Sort by" = "Trier par" -"Sort by {column}" = "Trier par {column}" -"Start from a template" = "Commencer avec un modèle" -"Start sharing with the Share button, then pass on the code it gives" = "Commencez à partager avec le bouton Partager, puis communiquez le code qu’il donne" -"Templates" = "Modèles" -"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é." -"Try another word, or look at every kind." = "Essayez un autre mot, ou regardez chaque type." -"Turn a layer into a component, reuse it, and change every copy at once" = "Transformez un calque en composant, réutilisez-le et modifiez toutes les copies d’un coup" -"Uses variables: each layer shows them in its own mode" = "Utilise des variables : chaque calque les affiche dans son propre mode" -"Websites" = "Sites web" -"What you try here changes this preview and the code below, not the file" = "Ce que vous essayez ici change cet aperçu et le code ci-dessous, pas le fichier" -"Widget" = "Widget" -"Wireframe kit" = "Kit de wireframes" -"Z to A" = "Z à A" -"just now" = "à l’instant" -"yesterday" = "hier" -"{month} {day}, {year}" = "{day} {month} {year}" - [commands] "align.bottom" = "Aligner en bas" "align.hcenter" = "Aligner les centres horizontalement" @@ -1819,8 +1817,10 @@ status = "draft — needs native review" "component.editProperty" = "Modifier la propriété de composant" "component.exposeInstance" = "Exposer l’instance imbriquée" "component.goToMain" = "Aller au composant principal" +"component.hideWhenPublishing" = "Masquer à la publication" "component.list" = "Lister les composants" "component.makeSlot" = "Créer un emplacement" +"component.playground" = "Bac à sable de composant" "component.properties" = "Propriétés du composant" "component.pushChanges" = "Transmettre les modifications au composant principal" "component.removeSlot" = "Retirer l’emplacement" @@ -1879,6 +1879,7 @@ status = "draft — needs native review" "file.exportSvg" = "Exporter la sélection en SVG" "file.import" = "Importer" "file.new" = "Nouveau fichier de design" +"file.newFromTemplate" = "Nouveau à partir d’un modèle" "file.open" = "Ouvrir" "file.openRecent" = "Ouvrir un fichier récent" "file.placeImage" = "Placer une image" @@ -1906,6 +1907,7 @@ status = "draft — needs native review" "guide.remove" = "Retirer le repère" "guide.select" = "Sélectionner le repère" "help.about" = "À propos de FigCraft" +"help.gettingStarted" = "Premiers pas" "help.page" = "Page d’aide" "help.shortcuts" = "Raccourcis clavier" "image.adjust" = "Régler l’image" @@ -1959,6 +1961,9 @@ status = "draft — needs native review" "node.reparent" = "Déplacer le calque dans" "node.set" = "Définir les propriétés" "object.batchRename" = "Renommer par lot" +"object.convertToFrame" = "Convertir en cadre" +"object.convertToGroup" = "Convertir en groupe" +"object.convertToSection" = "Convertir en section" "object.flipH" = "Retourner horizontalement" "object.flipV" = "Retourner verticalement" "object.frameSelection" = "Encadrer la sélection" @@ -2079,6 +2084,7 @@ status = "draft — needs native review" "stroke.set" = "Définir le contour" "stroke.widthProfile" = "Profil de largeur" "style.apply" = "Appliquer le style" +"style.bind" = "Lier une variable dans un style" "style.create" = "Créer un style" "style.delete" = "Supprimer le style" "style.detach" = "Détacher le style" @@ -2087,6 +2093,7 @@ status = "draft — needs native review" "style.move" = "Déplacer les styles" "style.renameFolder" = "Renommer le dossier de styles" "style.update" = "Modifier le style" +"template.list" = "Lister les modèles" "text.alignCenter" = "Centrer" "text.alignJustify" = "Justifier" "text.alignLeft" = "Aligner à gauche" @@ -2252,8 +2259,11 @@ status = "draft — needs native review" "view.nextPage" = "Page suivante" "view.nextRegion" = "Activer la région suivante" "view.outlines" = "Contours" +"view.outlinesHiddenLayers" = "Inclure les calques masqués dans les contours" +"view.outlinesObjectBounds" = "Inclure les limites des objets dans les contours" "view.outlinesSelection" = "Contours de la sélection" "view.pan" = "Faire défiler la vue" +"view.panelWidths" = "Réinitialiser la largeur des panneaux" "view.pixelGrid" = "Grille de pixels" "view.pixelPreview" = "Aperçu des pixels" "view.prevFrame" = "Zoomer sur le cadre précédent" @@ -2286,20 +2296,6 @@ status = "draft — needs native review" "window.focus" = "Mettre la fenêtre au premier plan" "window.new" = "Nouvelle fenêtre" -# Commands translated since the draft (2026-10-18), appended. -"component.hideWhenPublishing" = "Masquer à la publication" -"component.playground" = "Bac à sable de composant" -"file.newFromTemplate" = "Nouveau à partir d’un modèle" -"help.gettingStarted" = "Premiers pas" -"object.convertToFrame" = "Convertir en cadre" -"object.convertToGroup" = "Convertir en groupe" -"object.convertToSection" = "Convertir en section" -"style.bind" = "Lier une variable dans un style" -"template.list" = "Lister les modèles" -"view.outlinesHiddenLayers" = "Inclure les calques masqués dans les contours" -"view.outlinesObjectBounds" = "Inclure les limites des objets dans les contours" -"view.panelWidths" = "Réinitialiser la largeur des panneaux" - [menu] "bool.exclude" = "Exclure" "bool.flatten" = "Aplatir" @@ -2325,12 +2321,10 @@ status = "draft — needs native review" "view.design" = "Design" "view.layers" = "Calques" "view.outlines" = "Afficher les contours" +"view.outlinesHiddenLayers" = "Inclure les calques masqués" +"view.outlinesObjectBounds" = "Inclure les limites des objets" "view.outlinesSelection" = "Afficher les contours de la sélection" "view.prototype" = "Prototype" "view.themeDark" = "Sombre" "view.themeLight" = "Clair" "view.themeSystem" = "Suivre le système" - -# Menu wordings translated since the draft (2026-10-18), appended. -"view.outlinesHiddenLayers" = "Inclure les calques masqués" -"view.outlinesObjectBounds" = "Inclure les limites des objets" From 6a334fa3541f364aebe786bd97949bdb04ac6ce2 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 11:37:58 +0700 Subject: [PATCH 234/817] #765: drop the progress-doc edits (maintainer adds them) --- ROADMAP.md | 3 +-- docs/gaps.md | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 3732103cd..8a587286d 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (Home search across known files and starter templates; community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -316,7 +316,6 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| -| 2026-10-17 | minor | Home sidebar search filters open, recent and saved online files plus starter templates, opens a result through its existing action, and shows an empty state. Local results reuse recent-file previews and file-type icons; no server-wide query. Numbers unchanged. | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | diff --git a/docs/gaps.md b/docs/gaps.md index 85ed33adb..9b1a770c1 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Where FigCraft falls short of Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (Home search across known files and starter templates; the 2026-10-17 landings: `.fig` import fidelity, budgets for large files, the import report, a `.fig` copy from Save as and paste from another design app (gap 1); menus, the Actions palette, editor fixes, Selection colors and smart-selection spacing (gap 4); catalog counts re-measured (gap 5); bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (the 2026-10-17 landings: `.fig` import fidelity, budgets for large files, the import report, a `.fig` copy from Save as and paste from another design app (gap 1); menus, the Actions palette, editor fixes, Selection colors and smart-selection spacing (gap 4); catalog counts re-measured (gap 5); bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) Every known shortfall against Figma, one entry each, ranked by how much it stops a Figma user from doing real work in FigCraft. Agents: pick work from the top unless the owner says otherwise. The @@ -444,7 +444,6 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe | Date | Change | Summary | |---|---|---| -| 2026-10-17 | minor | Home sidebar searches known open, recent and online files plus starter templates. Accounts and server-wide discovery remain in gap 2; estimates unchanged. | | 2026-10-17 | minor | The 2026-10-17 landings. Gap 1: a new Landed entry (community batches #727 and #728, then #745: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments, images in the message, instance layers' size and resizing overrides, Hug where nothing is recorded; budgets from the file's size; the import report; a `.fig` copy from Save as; paste from another design app), its Missing list cut to what is still left, and the wrong "whether other apps open its files is unknown" replaced by what was checked; all on synthetic files, so the beta blocker and hours stand. Gap 2: server limits, log recovery and web join links in the evidence. Gap 4: menus, the Actions palette and the editor fixes (#733, #735, #736, #729), then Selection colors and smart-selection spacing (#753) landed, none compared side by side. Gap 5: catalog counts re-measured (2,272 entries; drafts at 95–99%; Indonesian, Czech, Turkish and Swedish listed). Gap 8: the Linux and BSD clipboard changes and Wayland window controls, not run there by the maintainers. Ranking and hours unchanged | | 2026-10-15 | minor | Gap 7: bounded canvas overscan for smoother panning. Estimates and ranking unchanged. | | 2026-10-14 | minor | Russian catalog (M9), reviewed and approved by VanTan: all 2,165 current entries, Русский in Preferences and regional ru tags. Russian integer plurals use one/few/many; contributor display name VanTan added. Existing estimates unchanged. | From f90becadab1085c60e1d0dcd17d176597759889e Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 11:52:32 +0700 Subject: [PATCH 235/817] #765: search results use Home's own Open files rows and Recent files section (the full list stays known, so pictures and the selection survive a search); search_grid, SearchHit, prepare_search and search_file_card go; the field is widgets::text_input and Escape clears it --- crates/ui-egui/src/home.rs | 158 +++++++---------------------- crates/ui-egui/src/home_recents.rs | 72 ++++--------- crates/ui-egui/src/home_tests.rs | 56 +++++++++- 3 files changed, 107 insertions(+), 179 deletions(-) diff --git a/crates/ui-egui/src/home.rs b/crates/ui-egui/src/home.rs index 77d1a1a32..236e27861 100644 --- a/crates/ui-egui/src/home.rs +++ b/crates/ui-egui/src/home.rs @@ -4,7 +4,6 @@ //! the documents themselves, searched and filtered by kind). use std::collections::BTreeMap; -use std::path::Path; use egui::{Align2, Color32, CornerRadius, Id, Rect, Response, Sense, Stroke, StrokeKind, Ui, pos2, vec2}; use figcraft_engine::templates::{Kind, TEMPLATES, Template}; @@ -12,7 +11,6 @@ use serde_json::json; use crate::FigApp; use crate::a11y; -use crate::home_recents::SearchHit; use crate::i18n::{tr, tr_noop}; use crate::icons::{self, Icon}; use crate::theme::{ACCENT, Tokens, regular, semibold}; @@ -207,35 +205,16 @@ fn sidebar(app: &mut FigApp, ui: &mut Ui, t: &Tokens, left: Rect) { icons::paint(ui.painter(), Rect::from_min_size(pos2(left.min.x + 16.0, y), vec2(20.0, 20.0)), Icon::Logo, ACCENT); ui.painter().text(pos2(left.min.x + 44.0, y + 10.0), Align2::LEFT_CENTER, "FigCraft", semibold(14.0), t.text); y += 48.0; - let search = Rect::from_min_size(pos2(left.min.x + 8.0, y), vec2(SIDEBAR - 16.0, 32.0)); + let search = Rect::from_min_size(pos2(left.min.x + 8.0, y), vec2(SIDEBAR - 16.0, widgets::FIELD_H)); ui.scope_builder(egui::UiBuilder::new().max_rect(search), |ui| { - ui.painter().rect_filled(search, CornerRadius::same(5), t.field); - icons::paint( - ui.painter(), - Rect::from_center_size(pos2(search.min.x + 18.0, search.center().y), vec2(16.0, 16.0)), - Icon::Search, - t.icon_secondary, - ); - let text_rect = Rect::from_min_max(pos2(search.min.x + 36.0, search.center().y - 8.0), pos2(search.max.x - 8.0, search.center().y + 8.0)); - let mut child = ui.new_child(egui::UiBuilder::new().max_rect(text_rect)); - let response = child.add( - egui::TextEdit::singleline(&mut app.ui.home_view.file_query) - .id(Id::new("home_file_search")) - .frame(egui::Frame::NONE) - .font(regular(12.0)) - .hint_text(tr("Search files and templates")) - .vertical_align(egui::Align::Center) - .desired_width(text_rect.width()), - ); - widgets::select_all_on_focus(ui, &response, &app.ui.home_view.file_query); + let response = + widgets::text_input(ui, Id::new("home_file_search"), &mut app.ui.home_view.file_query, search.width(), tr("Search files and templates")); a11y::text(&response, tr("Search files and templates"), &app.ui.home_view.file_query); - if response.has_focus() { - ui.painter().rect_stroke(search, CornerRadius::same(5), Stroke::new(1.0, t.accent), StrokeKind::Inside); - } else if ui.rect_contains_pointer(search) { - ui.painter().rect_stroke(search, CornerRadius::same(5), Stroke::new(1.0, t.field_hover_border), StrokeKind::Inside); + if (response.has_focus() || response.lost_focus()) && ui.input(|i| i.key_pressed(egui::Key::Escape)) { + app.ui.home_view.file_query.clear(); } }); - y += 32.0 + 4.0; + y += widgets::FIELD_H + 12.0; for (section, icon, label) in Section::ALL { let r = Rect::from_min_size(pos2(left.min.x + 8.0, y), vec2(SIDEBAR - 16.0, 32.0)); let resp = ui.interact(r, ui.id().with(("home_section", label)), Sense::click()); @@ -259,78 +238,13 @@ fn file_matches(name: &str, location: &str, query: &str) -> bool { name.to_lowercase().contains(query) || location.to_lowercase().contains(query) } -/// An online search result with a name and optional location on separate lines. Local files use -/// the Recent files cards below so their stored preview and file-type icon are also shown here. -fn search_file_card(ui: &mut Ui, t: &Tokens, id: Id, row: &FileRow) -> bool { - let (r, _) = ui.allocate_exact_size(vec2(ui.available_width().min(640.0), 64.0), Sense::hover()); - let resp = ui.interact(r, id, Sense::click()); - a11y::button(&resp, row.name); - ui.painter().rect_filled(r, CornerRadius::same(8), if resp.hovered() { t.hover } else { t.field }); - ui.painter().rect_stroke(r, CornerRadius::same(8), Stroke::new(1.0, t.border), StrokeKind::Inside); - focus_ring(ui, t, r, &resp, 8); - if let Some((icon, tint)) = row.mark { - let mark = Rect::from_center_size(pos2(r.min.x + 29.0, r.center().y), vec2(20.0, 20.0)); - ui.painter().rect_filled(mark, CornerRadius::same(4), t.field); - icons::paint(ui.painter(), mark.shrink(2.0), icon, tint); - } - let width = (r.width() - 78.0).max(1.0); - let name = widgets::elide_font(ui, row.name, width, semibold(13.0)); - let name_y = if row.detail.is_empty() { r.center().y } else { r.min.y + 23.0 }; - ui.painter().text(pos2(r.min.x + 58.0, name_y), Align2::LEFT_CENTER, name, semibold(13.0), row.ink); - if !row.detail.is_empty() { - let detail = widgets::elide_start_font(ui, row.detail, width, regular(row.detail_size)); - ui.painter().text(pos2(r.min.x + 58.0, r.min.y + 44.0), Align2::LEFT_CENTER, detail, regular(row.detail_size), row.detail_ink); - } - if !row.detail.is_empty() { resp.on_hover_text(row.detail).clicked() } else { resp.clicked() } -} - /// One search over known files and starter templates. It never sends a query or owner token to a /// server; online files are opened through their existing owner-token command only on click. fn search_results(app: &mut FigApp, ui: &mut Ui, t: &Tokens) { heading(ui, t, tr("Search results")); let query = app.ui.home_view.file_query.trim().to_lowercase(); - let mut count = 0; - let mut switch = None; - let open_paths: Vec<&str> = app.session.docs.iter().filter_map(|d| d.path.as_deref()).collect(); - - let open: Vec<_> = - app.session.docs.iter().enumerate().filter(|(_, d)| file_matches(&d.doc.name, d.path.as_deref().unwrap_or_default(), &query)).collect(); - let open_hits: Vec = - open.iter().map(|(_, d)| SearchHit { key: format!("open:{}", d.uid), path: d.path.clone(), name: d.doc.name.clone() }).collect(); - - let recent: Vec<(String, String)> = app - .session - .prefs - .recent_files - .iter() - .filter(|p| figcraft_engine::file_access::allowed(p, figcraft_engine::file_access::Access::Read)) - .filter(|p| !open_paths.contains(&p.as_str())) - .filter_map(|path| { - let p = Path::new(path); - let name = p.file_stem().or_else(|| p.file_name()).map_or_else(|| path.clone(), |n| n.to_string_lossy().into_owned()); - file_matches(&name, path, &query).then(|| (path.clone(), name)) - }) - .collect(); - let recent_hits: Vec = - recent.iter().map(|(path, name)| SearchHit { key: format!("recent:{path}"), path: Some(path.clone()), name: name.clone() }).collect(); - let preview_paths: Vec = open_hits.iter().chain(&recent_hits).filter_map(|hit| hit.path.clone()).collect(); - let reduce_motion = app.reduce_motion(); - app.ui.home_view.recents.prepare_search(ui.ctx(), &preview_paths, ui.input(|i| i.time)); - if !open_hits.is_empty() { - subheading(ui, t, tr("Open files")); - count += open_hits.len(); - if let Some(hit) = crate::home_recents::search_grid(ui, t, &mut app.ui.home_view.recents, &open_hits, reduce_motion) { - switch = open.get(hit).map(|(index, _)| *index); - } - } - let mut open_recent = None; - if !recent_hits.is_empty() { - subheading(ui, t, tr("Recent files")); - count += recent_hits.len(); - if let Some(hit) = crate::home_recents::search_grid(ui, t, &mut app.ui.home_view.recents, &recent_hits, reduce_motion) { - open_recent = recent_hits.get(hit).and_then(|hit| hit.path.clone()); - } - } + let mut count = open_files(app, ui, t, &query); + count += crate::home_recents::section(app, ui, t, &query); let online: Vec<_> = app.session.prefs.online_files.iter().filter(|f| file_matches(&f.name, &f.server, &query)).cloned().collect(); let mut open_online = None; @@ -348,10 +262,9 @@ fn search_results(app: &mut FigApp, ui: &mut Ui, t: &Tokens) { detail_size: 11.0, detail_ink: t.text_secondary, }; - if search_file_card(ui, t, ui.id().with(("search_online", &f.server, &f.file)), &row) { + if listed(ui, t, ui.id().with(("search_online", &f.server, &f.file)), 36.0, &row) { open_online = Some(f.clone()); } - ui.add_space(8.0); } } let templates: Vec<&Template> = TEMPLATES.iter().filter(|template| matches(template, &query, None)).collect(); @@ -369,14 +282,7 @@ fn search_results(app: &mut FigApp, ui: &mut Ui, t: &Tokens) { app.ui.home_view.section = Section::Templates; } } - if let Some(index) = switch { - app.run("doc.switch", json!({"index": index})); - app.ui.home = false; - } else if let Some(path) = open_recent { - if app.run_user("file.open", json!({"path": path})).is_some() { - app.ui.home = false; - } - } else if let Some(file) = open_online { + if let Some(file) = open_online { crate::online::open(app, &file); } } @@ -455,22 +361,7 @@ fn recents(app: &mut FigApp, ui: &mut Ui, t: &Tokens) { ui.add_space(28.0); getting_started(app, ui, t); } - if !app.session.docs.is_empty() { - subheading(ui, t, tr("Open files")); - let mut switch = None; - for (i, d) in app.session.docs.iter().enumerate() { - let detail = d.path.as_deref().unwrap_or_default(); - let row = - FileRow { mark: Some((Icon::Logo, ACCENT)), name: &d.doc.name, ink: t.text, detail, detail_size: 11.0, detail_ink: t.text_secondary }; - if listed(ui, t, ui.id().with(("open", d.uid)), 36.0, &row) { - switch = Some(i); - } - } - if let Some(i) = switch { - app.run("doc.switch", json!({"index": i})); - app.ui.home = false; - } - } + open_files(app, ui, t, ""); if crate::home_recents::listed(&app.session.prefs.recent_files).next().is_none() { // A first run: nothing to reopen yet, so offer something to start from. subheading(ui, t, tr("Start from a template")); @@ -482,7 +373,32 @@ fn recents(app: &mut FigApp, ui: &mut Ui, t: &Tokens) { } return; } - crate::home_recents::section(app, ui, t); + crate::home_recents::section(app, ui, t, ""); +} + +/// The Open files list: the documents whose name or path has `query` (lower case; all for ""), a +/// row each; choosing one shows its tab. How many are listed. +fn open_files(app: &mut FigApp, ui: &mut Ui, t: &Tokens, query: &str) -> usize { + let hit = |d: &&figcraft_engine::DocState| file_matches(&d.doc.name, d.path.as_deref().unwrap_or_default(), query); + let count = app.session.docs.iter().filter(hit).count(); + if count == 0 { + return 0; + } + subheading(ui, t, tr("Open files")); + let mut switch = None; + for (i, d) in app.session.docs.iter().enumerate().filter(|(_, d)| hit(d)) { + let detail = d.path.as_deref().unwrap_or_default(); + let row = + FileRow { mark: Some((Icon::Logo, ACCENT)), name: &d.doc.name, ink: t.text, detail, detail_size: 11.0, detail_ink: t.text_secondary }; + if listed(ui, t, ui.id().with(("open", d.uid)), 36.0, &row) { + switch = Some(i); + } + } + if let Some(i) = switch { + app.run("doc.switch", json!({"index": i})); + app.ui.home = false; + } + count } /// The file joined from the home screen (a code, or one of your online files) opened in a tab of diff --git a/crates/ui-egui/src/home_recents.rs b/crates/ui-egui/src/home_recents.rs index 8ccc3cec9..aeeb0f276 100644 --- a/crates/ui-egui/src/home_recents.rs +++ b/crates/ui-egui/src/home_recents.rs @@ -504,12 +504,6 @@ impl Recents { paths.iter().map(|p| Shown::new(p, self.files.get(p).and_then(|k| k.stat))).collect() } - /// Share the Recent files thumbnail cache with Home search. The existing loader keeps file - /// reads off the UI thread and only requests pictures for cards that are on screen. - pub(crate) fn prepare_search(&mut self, ctx: &egui::Context, paths: &[String], time: f64) { - self.refresh(ctx, paths, time); - } - /// For `ui.inspect`: each file listed, whether it is there and whether its picture is in. pub fn inspect(&self, prefs: &Prefs) -> Value { let paths: Vec = listed(&prefs.recent_files).take(SHOWN).cloned().collect(); @@ -560,16 +554,27 @@ enum Action { View(View), } -/// The Recent files heading, its toolbar and the files as cards or a table. -pub fn section(app: &mut FigApp, ui: &mut Ui, t: &Tokens) { - let paths: Vec = listed(&app.session.prefs.recent_files).take(SHOWN).cloned().collect(); +/// The Recent files heading, its toolbar and the files as cards or a table. With a `query` (lower +/// case, from the Home search) only the files not open whose path has it, from every recent file; +/// nothing at all when none has it. How many files are shown. +pub fn section(app: &mut FigApp, ui: &mut Ui, t: &Tokens, query: &str) -> usize { + let searching = !query.is_empty(); + // A search reaches every recent file; the files shown without one stay known through it. + let paths: Vec = listed(&app.session.prefs.recent_files).take(if searching { usize::MAX } else { SHOWN }).cloned().collect(); let time = ui.input(|i| i.time); let now = figcraft_engine::cmd::comment::now_secs(); let reduce_motion = app.reduce_motion(); let (view, sort) = (View::of(&app.session.prefs), Sort::of(&app.session.prefs)); let state = &mut app.ui.home_view.recents; state.refresh(ui.ctx(), &paths, time); - let files = sorted(state.shown(&paths), sort); + let mut files = sorted(state.shown(&paths), sort); + if searching { + let docs = &app.session.docs; + files.retain(|f| f.path.to_lowercase().contains(query) && !docs.iter().any(|d| d.path.as_deref() == Some(f.path.as_str()))); + if files.is_empty() { + return 0; + } + } let with_created = files.iter().any(|f| f.stat.is_some_and(|s| s.created.is_some())); let mut action = toolbar(ui, t, view, sort, with_created); ui.add_space(16.0); @@ -599,6 +604,7 @@ pub fn section(app: &mut FigApp, ui: &mut Ui, t: &Tokens) { } None => {} } + files.len() } /// "Recent files", and at the right the sort menu and the grid and list buttons. @@ -730,8 +736,7 @@ fn arrows(ui: &Ui, recents: &mut Recents, files: &[Shown], across: usize, down: /// The square file-type mark before a name. fn file_icon(ui: &Ui, t: &Tokens, center: egui::Pos2, path: &str) { let r = Rect::from_center_size(center, vec2(16.0, 16.0)); - let kind = if path.is_empty() { FileKind::FigCraft } else { FileKind::of(Path::new(path)) }; - match kind { + match FileKind::of(Path::new(path)) { FileKind::FigCraft | FileKind::Fig => { ui.painter().rect_filled(r, CornerRadius::same(4), ACCENT); icons::paint(ui.painter(), r.shrink(3.0), Icon::Logo, Color32::WHITE); @@ -748,49 +753,6 @@ fn file_icon(ui: &Ui, t: &Tokens, center: egui::Pos2, path: &str) { } } -/// A file found by the Home sidebar search. A tab without a disk path has no stored preview yet. -pub(crate) struct SearchHit { - pub key: String, - pub path: Option, - pub name: String, -} - -/// Search results use the same preview, file-type icon and footer as Recent files. A single click -/// still opens the result, as it did before the visual change. -pub(crate) fn search_grid(ui: &mut Ui, t: &Tokens, recents: &mut Recents, files: &[SearchHit], reduce_motion: bool) -> Option { - let (columns, card_w) = grid_columns(ui.available_width()); - let (picture_h, card_h) = card_heights(card_w); - let (time, now) = (ui.input(|i| i.time), figcraft_engine::cmd::comment::now_secs()); - let mut chosen = None; - let mut fading = false; - for (row_index, row) in files.chunks(columns).enumerate() { - let (r, _) = ui.allocate_exact_size(vec2(ui.available_width(), card_h), Sense::hover()); - for (column, file) in row.iter().enumerate() { - let rect = Rect::from_min_size(pos2(r.min.x + column as f32 * (card_w + GAP), r.min.y), vec2(card_w, card_h)); - let resp = ui.interact(rect, ui.id().with(("search_file_card", &file.key)), Sense::click()); - let stat = file.path.as_deref().and_then(|path| recents.files.get(path).and_then(|k| k.stat)); - let shown = Shown { path: file.path.clone().unwrap_or_default(), name: file.name.clone(), stat }; - a11y::named_button(&resp, &spoken(&shown, now)); - let resp = if let Some(path) = file.path.as_deref() { resp.on_hover_text(path) } else { resp }; - let visible = ui.is_rect_visible(rect); - let picture = file.path.as_deref().and_then(|path| recents.picture(path, visible, time)); - if visible { - let alpha = picture.as_ref().map_or(1.0, |(_, _, a)| if reduce_motion { 1.0 } else { *a }); - fading |= alpha < 1.0; - card(ui, t, rect, picture_h, &resp, false, &shown, stat.unwrap_or_default(), picture, alpha, now); - } - if resp.clicked() { - chosen = Some(row_index * columns + column); - } - } - ui.add_space(GAP); - } - if fading { - ui.ctx().request_repaint(); - } - chosen -} - /// The name a card or row has for screen readers: "name, Edited 3 hours ago". fn spoken(file: &Shown, now: u64) -> String { let detail = file.detail(now); diff --git a/crates/ui-egui/src/home_tests.rs b/crates/ui-egui/src/home_tests.rs index cf34e5b3c..c493a0a1d 100644 --- a/crates/ui-egui/src/home_tests.rs +++ b/crates/ui-egui/src/home_tests.rs @@ -202,7 +202,7 @@ fn home_search_finds_known_files_and_opens_an_existing_tab() { let mut u = Ui::new(session); u.app.ui.home = true; u.app.ui.home_view.file_query = " TRAIL ".into(); - let s = shapes(&mut u); + let s = settle(&mut u); assert!(has_text(&s, "Search results")); assert!(has_text(&s, "North Trail") && has_text(&s, "South Trail") && has_text(&s, "Trail Live")); assert!(!has_text(&s, "Other") && !has_text(&s, "test-only-secret")); @@ -258,12 +258,62 @@ fn home_search_field_filters_as_typed_and_a_section_click_clears_it() { let s = shapes(&mut u); click(&mut u, text_center(&s, "Search files and templates")); u.frame(vec![Event::Text("glacier".into())]); - let s = shapes(&mut u); + let s = settle(&mut u); assert_eq!(u.app.ui.home_view.file_query, "glacier"); assert!(has_text(&s, "Glacier") && !has_text(&s, "Forest")); click(&mut u, text_center(&s, "Recents")); assert!(u.app.ui.home_view.file_query.is_empty()); - assert!(has_text(&shapes(&mut u), "Forest")); + let s = shapes(&mut u); + assert!(has_text(&s, "Forest")); + // Escape in the field clears the search too. + click(&mut u, text_center(&s, "Search files and templates")); + u.frame(vec![Event::Text("forest".into())]); + assert_eq!(u.app.ui.home_view.file_query, "forest"); + u.frame(vec![Event::Key { key: Key::Escape, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::NONE }]); + assert!(u.app.ui.home_view.file_query.is_empty(), "Escape clears the search"); +} + +/// A search keeps what the recent files it doesn't match know: back from it, their pictures and +/// the selection are still there (nothing is read again). +#[test] +fn a_search_keeps_the_other_recent_files_pictures_and_the_selection() { + let dir = std::env::temp_dir().join(format!("figcraft-home-search-cache-{}", std::process::id())); + std::fs::create_dir_all(&dir).unwrap(); + let mut png = Vec::new(); + image::RgbaImage::from_pixel(8, 8, image::Rgba([30, 140, 210, 255])) + .write_to(&mut std::io::Cursor::new(&mut png), image::ImageFormat::Png) + .unwrap(); + let paths: Vec = ["Alpine", "Basin"] + .into_iter() + .map(|name| { + let path = dir.join(format!("{name}.figcraft")); + std::fs::write(&path, figcraft_format::save_bytes(&figcraft_doc::Document::new(name), Some(&png)).unwrap()).unwrap(); + path.to_string_lossy().into_owned() + }) + .collect(); + let mut session = Session::empty(); + session.prefs.recent_files = paths.clone(); + let mut u = Ui::new(session); + let pictures = |u: &mut Ui| -> Vec { + u.app.inspect()["homeRecents"]["files"].as_array().unwrap().iter().map(|f| f["picture"].clone()).collect() + }; + for _ in 0..400 { + u.frame(vec![]); + if pictures(&mut u).iter().all(|p| p == "picture") { + break; + } + std::thread::sleep(std::time::Duration::from_millis(5)); + } + assert!(pictures(&mut u).iter().all(|p| p == "picture"), "both pictures are in"); + u.app.ui.home_view.recents.selected = Some(paths[1].clone()); + u.app.ui.home_view.file_query = "alpine".into(); + let s = shapes(&mut u); + assert!(has_text(&s, "Alpine") && !has_text(&s, "Basin")); + u.app.ui.home_view.file_query.clear(); + u.frame(vec![]); + assert!(pictures(&mut u).iter().all(|p| p == "picture"), "no picture is read again"); + assert_eq!(u.app.ui.home_view.recents.selected.as_deref(), Some(paths[1].as_str()), "the selection stays"); + let _ = std::fs::remove_dir_all(dir); } #[test] From 55a0712b117a14d3d5713e44ece22f34ba0030cb Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 12:06:04 +0700 Subject: [PATCH 236/817] #758: leave the progress docs to the maintainer --- ROADMAP.md | 2 -- docs/file-format-parity.md | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 7cef08a31..8a587286d 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -131,7 +131,6 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). ## Progress log -- **2026-10-17** · Missing fonts (M7, #752): fonts a file names that aren't installed (text layers, styled ranges, text styles, font family variables) are listed in a Missing fonts window after the user opens the file (once installed fonts are indexed and any import report is closed), from Text ▸ Missing fonts…, by `text.missingFonts` and by `figcraft-cli info`. Their text still draws in a fallback font. Numbers unchanged. - **2026-10-17** · Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. - **2026-10-17** · Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. - **2026-10-17** · Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. @@ -318,7 +317,6 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | -| 2026-10-17 | minor | Missing fonts (M7, #752): fonts a file names that aren't installed are listed after the user opens it, from Text ▸ Missing fonts…, by `text.missingFonts` and by `figcraft-cli info`. Numbers unchanged. | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | | 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 900559dfd..b65f77292 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (missing fonts listed on open (#752); REST import reads grid track sizes (#465); `.fig` import fidelity from the community batches, budgets for large files, the import report, a `.fig` copy from Save as, paste from another design app; instance layers' size and resizing and Hug on import (#731, #732); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (REST import reads grid track sizes (#465); `.fig` import fidelity from the community batches, budgets for large files, the import report, a `.fig` copy from Save as, paste from another design app; instance layers' size and resizing and Hug on import (#731, #732); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) Every format Figma reads or writes, with FigCraft's support. Sources: `Info.plist` of `/Applications/Figma.app` (document types only; nothing inside the bundle's code was read), Figma's @@ -159,7 +159,7 @@ each. | Local fonts | yes (font helper / desktop app) | yes (system scan) | | 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 fonts on open | listed, with replacement | listed (Missing fonts window after an open, Text ▸ Missing fonts…, `text.missingFonts`, `figcraft-cli info`); no replacement; text draws in a fallback font | +| Missing-font replacement on open | yes | warnings only (REST import) | ## Revision history @@ -167,7 +167,6 @@ each. |---|---|---| | 2026-10-17 | minor | REST file JSON import reads grid track sizes from the CSS track strings `gridColumnsSizing` / `gridRowsSizing` (fixed px, fill fr, hug `auto`, `minmax(0, 1fr)`, `repeat()`; other tracks stay equal) (#465). Numbers unchanged | | 2026-10-17 | minor | The community batches #727 and #728 in the `.fig` row: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments (also REST), images in the message; budgets from the file's size; the journal keeps no file bytes; the import report. Not read cut to what's left. A `.fig` copy from Save as. Pasted content: layers copied from another design app, best effort (tested only with clipboard HTML made from our own export), and images under Wayland (not run there). All on synthetic files: summary and hours unchanged | -| 2026-10-17 | minor | Missing fonts (#752): the fonts a file names that aren't installed (text layers, styled ranges, text styles, font family variables in any mode) are listed when the user opens it (once installed fonts are indexed and any import report is closed), from Text ▸ Missing fonts…, by `text.missingFonts` and by `figcraft-cli info`. The row claimed REST import warnings no code produced. | | 2026-10-17 | minor | Hug on import (#732): auto layout frames a `.fig` records no primary-axis sizing for hug on that axis (auto layout sized that axis by its content before it could be fixed) instead of turning fixed, instances that record no auto layout take their main's (they came in without auto layout and fixed, so longer text overflowed them), REST frames whose sizing modes are left out hug (the documented default), and text hugs by its resize mode (auto width both axes, auto height its height; it came in fixed). Numbers unchanged | | 2026-10-17 | minor | Instance layers' own size and resizing (#731): a `.fig` import keeps the sizes an instance gives its layers and their hug/fill/fixed and min/max as overrides, a REST import reads the resizing fields of `overrides`, and a `.fig` export writes a layer's own size as an override (it went with the derived layout, which a relayout replaces). Numbers unchanged | | 2026-10-14 | minor | SVG/PDF depth overflow (#208) is checked before bounds and drawing; public checked APIs return the offending root/layer, commands and CLI report it, and no incomplete export replaces an existing file. Tested at depths 255/256/257, with inner roots, hidden branches, masks, raster fallbacks and multiple roots/pages. Numbers unchanged. | From ac606a2d43882cf0f3ef3eb2930139b1657b9cce Mon Sep 17 00:00:00 2001 From: sanches Date: Sun, 18 Oct 2026 08:02:15 +0300 Subject: [PATCH 237/817] M9: Dutch catalog, machine-drafted (nl.toml) --- ROADMAP.md | 17 +- crates/ui-egui/locales/nl.toml | 2331 ++++++++++++++++++++++++++++++ crates/ui-egui/src/i18n_tests.rs | 13 +- docs/gaps.md | 24 +- docs/localization-parity.md | 53 +- docs/translating.md | 14 +- 6 files changed, 2397 insertions(+), 55 deletions(-) create mode 100644 crates/ui-egui/locales/nl.toml diff --git a/ROADMAP.md b/ROADMAP.md index 8a587286d..a8af7b498 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (Dutch draft catalog complete at 100% of the strings, machine-drafted and awaiting native review; language table re-measured over 2,315 entries; preceding: 2026-10-17 community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -63,7 +63,7 @@ native speakers' reviews of the six language drafts need people. | Stability | 55% | 20–40 | [gaps](docs/gaps.md) | | Performance | 60% | 30–60 | [hardware-parity](docs/hardware-parity.md) | | Hardware | 60% | 10–21 | [hardware-parity](docs/hardware-parity.md) | -| Localization | 39% (layer; English; Spanish with a Latin American overlay, French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese drafts; CJK UI fonts) | 29–51 | [localization-parity](docs/localization-parity.md) | +| Localization | 39% (layer; English; Spanish with a Latin American overlay, French, German, Dutch, Brazilian Portuguese, Japanese, Korean, Simplified Chinese drafts; CJK UI fonts) | 29–51 | [localization-parity](docs/localization-parity.md) | | Platforms | 75% | 10–20 | [hardware-parity](docs/hardware-parity.md) | | Ecosystem / plugins | 38% (own WASM plugins with panels, settings and widgets; a self-hosted plugin directory) | 8–26 | [gaps](docs/gaps.md) | | AI features | 0% | 30–60 | [gaps](docs/gaps.md) | @@ -103,6 +103,7 @@ native speakers' reviews of the six language drafts need people. | Spanish | es, es-419 | 100% (es-419: an overlay of 101 entries) | draft (needs native review) | | Hindi | hi | 0% | none | | Arabic | ar | 0% | none | +| Dutch | nl | 100% | draft (needs native review) | | French | fr | 95% | draft (needs native review) | | Portuguese (Brazil) | pt-BR | 95% | draft (needs native review) | | Indonesian | id | 99% | draft (needs native review) | @@ -111,9 +112,14 @@ native speakers' reviews of the six language drafts need people. | Korean | ko | 95% | draft (needs native review) | | Vietnamese | vi | 0% | none | -Percentages measured 2026-10-17 over 2,272 entries (strings added since a draft show English). Also shipped: Russian (`ru`, 99%, reviewed by VanTan), Swedish (`sv`, 99.6%, command labels since 2026-10-17; native review welcome), Turkish (`tr`, 99%) and Czech (`cs`, 99%, draft). Figma ships English, Japanese, Korean, French, German, Spanish and Portuguese +Percentages measured 2026-10-18 over 2,315 entries (1,718 UI keys, 566 command labels and 31 menu +wordings; strings added since a draft show English). Also shipped: Russian (`ru`, 99%, reviewed by +VanTan), Swedish (`sv`, 99.6%, command labels since 2026-10-17; native review welcome), Turkish +(`tr`, 99%) and Czech (`cs`, 99%, draft). Figma ships English, Japanese, Korean, French, German, +Spanish and Portuguese (Brazil); FigCraft has the localization layer, English and Spanish (Spain and Latin America), -French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese and Indonesian drafts (Preferences ▸ +French, German, Dutch, Brazilian Portuguese, Japanese, Korean, Simplified Chinese and Indonesian +drafts (Preferences ▸ Language; Traditional Chinese has no catalog; CJK UI text uses an installed CJK font, loaded only when needed; adding a language: [`docs/translating.md`](docs/translating.md)). Document text in any script (bidi, Arabic shaping, @@ -126,7 +132,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). 1. `.fig` import's tail: fixes from real files, connector labels, table cells, filled areas with their own fills (the best-effort import, editable vector networks, the other layer kinds and variable prototype actions landed 2026-10-11): 5–10 h; then checking the rest of the experimental `.fig` export (landed 2026-10-12; written files open and draw in other software) on effects, images, prototypes and real files: 5–15 h. 2. Real-file corpus and measured fidelity: 15–30 h. 3. Tool-by-tool interaction pass against Figma: 40–60 h. -4. Languages: native reviews of the es, fr, de, pt-BR, ja and ko drafts (people), Latin American Spanish (1–2 h), then Simplified Chinese (3–5 h). +4. Languages: native reviews of the es, fr, nl, de, pt-BR, ja and ko drafts (people), Latin American Spanish (1–2 h), then Simplified Chinese (3–5 h). 5. Multiplayer (M9): accounts and teams on top of the live sessions and the standalone server (transport, hosting, invite links that open the app, document sync, presence with remote text carets, cursor chat and spotlight, per-user undo, reconnect with offline edits, collision-free ids for styles, variables and comments, the browser client, `figcraft-server` with persistence and share links to edit or view, team libraries on the server landed): 42–84 h. ## Progress log @@ -316,6 +322,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-18 | minor | Dutch draft catalog (gap 5): `nl.toml` translates every UI string (1,718 keys; 41 with plural forms, one/other), every command label (566) and every menu wording (31) — 2,315 entries, machine-drafted in one style pass and marked as a draft awaiting native review; established tool terms (frame, auto layout, component, variant, prototype, overlay, widget, plugin, branch, constraints) and blend-mode, brush-preset and boolean names stay English, informal je register, infinitive menu labels, months abbreviated the Dutch way (jan., feb., mrt., apr., mei, …), `%` without a space and ordinary quotes. Preferences ▸ Language lists Nederlands; System maps any Dutch tag (nl-NL, nl…) to it, and the language-tag tests that used Dutch as a no-catalog example switched to Hindi. String counts re-measured from all catalogs: 1,718 UI keys, 566 command labels and 31 menu wordings (2,315 entries); the other drafts read 95–99% on the new basis. Numbers unchanged | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | diff --git a/crates/ui-egui/locales/nl.toml b/crates/ui-egui/locales/nl.toml new file mode 100644 index 000000000..c8eb06978 --- /dev/null +++ b/crates/ui-egui/locales/nl.toml @@ -0,0 +1,2331 @@ +# FigCraft interface strings: Dutch (Nederlands). +# +# Draft — needs native review: machine-drafted from the English catalog. Established tool terms +# (frame, auto layout, component, variant, prototype, overlay, widget, plugin, branch, constraints) +# and blend-mode, brush-preset and boolean names stay as they are. See docs/translating.md. + +[meta] +name = "Nederlands" +status = "draft — needs native review" + +[ui] + +"% of all commits" = "% van alle commits" +"(no longer published)" = "(niet langer gepubliceerd)" +"({n} warnings: some entries were skipped)" = { one = "({n} waarschuwing: sommige items zijn overgeslagen)", other = "({n} waarschuwingen: sommige items zijn overgeslagen)" } +"+ Create variable" = "+ Variabele maken" +".fig (experimental)" = ".fig (experimental)" +"1…9, 0" = "1…9, 0" +"@{login}: {prs} PRs, {commits} commits, +{added} / −{deleted} lines (Δ {delta}), +{bin_added} / −{bin_deleted} binary assets, {first} – {last}" = "@{login}: {prs} PRs, {commits} commits, +{added} / −{deleted} regels (Δ {delta}), +{bin_added} / −{bin_deleted} binaire assets, {first} – {last}" +"A .figcraft file with this name already exists. Choose its full name to confirm replacement." = "Er bestaat al een .figcraft-bestand met deze naam. Kies de volledige naam om de vervanging te bevestigen." +"A collection of this file with these modes and variables: override their values per mode and add variables of its own" = "Een verzameling van dit bestand met deze modi en variabelen: overschrijf hun waarden per modus en voeg er eigen variabelen toe" +"A layer on its own aligns to its frame: select more layers, or one in a frame" = "Een losse laag wordt uitgelijnd op zijn frame: selecteer meer lagen, of één in een frame" +"A responsive product page: hero, features, figures, a quote and a footer" = "Een responsive productpagina: hero, features, afbeeldingen, een citaat en een footer" +"A spring plays until it settles: its mass, stiffness and damping set how long" = "Een veer speelt tot hij tot rust komt: zijn massa, stijfheid en demping bepalen hoe lang" +"A title, an agenda, a big figure, a chart and a closing slide" = "Een titel, een agenda, een grote afbeelding, een grafiek en een afsluitende dia" +"A to Z" = "A tot Z" +"About" = "Over" +"About FigCraft" = "Over FigCraft" +"About this server" = "Over deze server" +"Action" = "Actie" +"Actions" = "Acties" +"Actions for {name}" = "Acties voor {name}" +"Actions…" = "Acties…" +"Active" = "Actief" +"Actual size (100%)" = "Werkelijke grootte (100%)" +"Add a category" = "Categorie toevoegen" +"Add a comment" = "Reactie toevoegen" +"Add a description" = "Beschrijving toevoegen" +"Add a frame (F) or a shape (R) to get started" = "Voeg een frame (F) of een vorm (R) toe om te beginnen" +"Add a layer or component to tile first" = "Voeg eerst een laag of component toe om als tegel te gebruiken" +"Add a note for developers" = "Notitie voor ontwikkelaars toevoegen" +"Add action" = "Actie toevoegen" +"Add actions for when no condition holds" = "Voeg acties toe voor het geval geen enkele voorwaarde geldt" +"Add an annotation for developers" = "Annotatie voor developers toevoegen" +"Add another condition" = "Nog een voorwaarde toevoegen" +"Add auto layout" = "Auto layout toevoegen" +"Add background behind overlay" = "Achtergrond achter overlay toevoegen" +"Add content to this slot" = "Voeg inhoud toe aan dit slot" +"Add dev resource" = "Dev-resource toevoegen" +"Add effect" = "Effect toevoegen" +"Add export setting" = "Exportinstelling toevoegen" +"Add fill" = "Vulling toevoegen" +"Add interaction" = "Interactie toevoegen" +"Add layout grid" = "Layoutraster toevoegen" +"Add library" = "Bibliotheek toevoegen" +"Add library file…" = "Bibliotheekbestand toevoegen…" +"Add max height" = "Maximale hoogte toevoegen" +"Add max width" = "Maximale breedte toevoegen" +"Add min height" = "Minimale hoogte toevoegen" +"Add min width" = "Minimale breedte toevoegen" +"Add mode" = "Modus toevoegen" +"Add new page" = "Nieuwe pagina toevoegen" +"Add or update collections from a variables JSON" = "Voeg verzamelingen toe of werk ze bij vanuit een variables-JSON" +"Add properties to make instances configurable" = "Voeg eigenschappen toe om instances configureerbaar te maken" +"Add reaction" = "Reactie toevoegen" +"Add starting point" = "Startpunt toevoegen" +"Add stroke" = "Lijn toevoegen" +"Add variant" = "Variant toevoegen" +"Add variant with a new value" = "Variant met een nieuwe waarde toevoegen" +"Added" = "Toegevoegd" +"Added the library \"{name}\"" = "Bibliotheek \"{name}\" toegevoegd" +"Adding to {name}" = "Toevoegen aan {name}" +"Adjust" = "Aanpassen" +"Adjustment presets" = "Aanpassingspresets" +"Advanced" = "Geavanceerd" +"Advanced stroke" = "Geavanceerde lijn" +"After delay" = "Na vertraging" +"After delay {ms}ms" = "Na {ms}ms vertraging" +"Align" = "Uitlijnen" +"Align bottom" = "Onderaan uitlijnen" +"Align center" = "Midden uitlijnen" +"Align horizontal centers" = "Horizontale middens uitlijnen" +"Align left" = "Links uitlijnen" +"Align middle" = "Midden uitlijnen" +"Align right" = "Rechts uitlijnen" +"Align text baselines" = "Tekstbasislijnen uitlijnen" +"Align top" = "Bovenaan uitlijnen" +"Align vertical centers" = "Verticale middens uitlijnen" +"Alignment" = "Uitlijning" +"All" = "Alle" +"All categories" = "Alle categorieën" +"All comments" = "Alle reacties" +"All components" = "Alle components" +"All fonts" = "Alle lettertypen" +"All supported properties" = "Alle ondersteunde eigenschappen" +"All variables" = "Alle variabelen" +"Alpha" = "Alpha" +"Alphabetical" = "Alfabetisch" +"Alt+drag" = "Alt+drag" +"An analytics screen on a grid: figures, charts drawn from vectors and a table" = "Een analysescherm op een raster: cijfers, diagrammen getekend met vectoren en een tabel" +"An invite link that opens FigCraft and joins" = "Een uitnodigingslink die FigCraft opent en waarmee je deelneemt" +"Anchor" = "Anker" +"Android" = "Android" +"Angular" = "Angular" +"Animation" = "Animatie" +"Annotations" = "Annotaties" +"Annotations shown on the canvas" = "Annotaties die op het canvas worden weergegeven" +"Another server, or one that needs its key. The usual server is set in Preferences." = "Een andere server, of een server waarvoor je een sleutel nodig hebt. De gebruikelijke server stel je in bij Voorkeuren." +"Any status" = "Alle statussen" +"Anyone on your network with this code can edit the file, while this app stays open." = "Iedereen in je netwerk met deze code kan het bestand bewerken, zolang deze app open blijft." +"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." = "Iedereen met de bewerklink kan het bestand wijzigen; de weergavelink laat mensen alleen kijken. De links bevatten geheimen: deel ze alsof het wachtwoorden zijn. Met `figcraft-server links` maak je er meer en trek je ze in." +"Anyone with this code can edit the file." = "Iedereen met deze code kan het bestand bewerken." +"Anyone with this code can look at the file, not change it." = "Iedereen met deze code kan het bestand bekijken, maar niet wijzigen." +"Appearance" = "Weergave" +"Apply a component property" = "Een componenteigenschap toepassen" +"Apply variable" = "Variabele toepassen" +"Apply variable to text" = "Variabele toepassen op tekst" +"Apply variable to visibility" = "Variabele toepassen op zichtbaarheid" +"Apps" = "Apps" +"Apr" = "apr." +"Arc" = "Boog" +"Arc ratio" = "Boogverhouding" +"Arc start" = "Start van de boog" +"Arc sweep" = "Boogdoorloop" +"Archive" = "Archiveren" +"Archived" = "Gearchiveerd" +"Arrange" = "Schikken" +"Arrow" = "Pijl" +"As typed" = "Zoals getypt" +"Asking the server…" = "Bezig met vragen aan de server…" +"Assets" = "Assets" +"Aug" = "aug." +"Auto" = "Auto" +"Auto (space around)" = "Auto (ruimte eromheen)" +"Auto (space between)" = "Auto (afstand ertussen)" +"Auto (space evenly)" = "Auto (gelijkmatig verdelen)" +"Auto ({mode})" = "Auto ({mode})" +"Auto columns" = "Automatische kolommen" +"Auto gap" = "Automatische afstand" +"Auto height" = "Automatische hoogte" +"Auto layout" = "Auto layout" +"Auto rows" = "Automatische rijen" +"Auto width" = "Automatische breedte" +"Back" = "Terug" +"Back to Ready for dev" = "Terug naar Ready for dev" +"Back to Ready for dev: the next change compares with how it is now" = "Terug naar Gereed voor dev: de volgende wijziging wordt vergeleken met hoe het nu is" +"Back to assets" = "Terug naar assets" +"Back to current" = "Terug naar huidige" +"Back to styles" = "Terug naar stijlen" +"Back to the FigCraft server" = "Terug naar de FigCraft-server" +"Back to the canvas from a focused region" = "Terug naar het canvas vanuit een focusgebied" +"Back to the current version" = "Terug naar de huidige versie" +"Back to the font's value" = "Terug naar de waarde van het lettertype" +"Back to the values the font style implies" = "Terug naar de waarden die bij de lettertypestijl horen" +"Background" = "Achtergrond" +"Background blur" = "Achtergrondvervaging" +"Basics" = "Basis" +"Before" = "Voor" +"Bend" = "Buiging" +"Bevel" = "Afgeschuind" +"Binary assets added" = "Binaire assets toegevoegd" +"Binary assets removed" = "Verwijderde binaire assets" +"Black & white" = "Black & white" +"Bleed" = "Afloop" +"Bleed marks" = "Aansnijmarkeringen" +"Bleed marks need a bleed" = "Aansnijtekens vereisen een aansnijrand" +"Blend" = "Mengmodus" +"Blend mode" = "Blendmodus" +"Blue" = "Blauw" +"Blur" = "Vervaging" +"Boolean" = "Boolean" +"Boolean groups" = "Booleaanse groepen" +"Both directions" = "Beide richtingen" +"Bottom" = "Onder" +"Bottom left radius" = "Radius linksonder" +"Bottom right radius" = "Radius rechtsonder" +"Bound to {name}. Click to detach the variable." = "Gekoppeld aan {name}. Klik om de variabele los te koppelen." +"Branch" = "Branch" +"Branch archived" = "Branch gearchiveerd" +"Branch merged" = "Branch samengevoegd" +"Branch name" = "Branchnaam" +"Branch of {file}" = "Branch van {file}" +"Branch of {file} · merged or archived" = "Branch van {file} · samengevoegd of gearchiveerd" +"Branch updated from main" = "Branch bijgewerkt vanaf main" +"Branch {name}" = "Branch {name}" +"Branches" = "Branches" +"Bring forward" = "Naar voren brengen" +"Bring the main file's changes into the branch" = "De wijzigingen uit het hoofdbestand in de branch brengen" +"Bring to front" = "Op de voorgrond plaatsen" +"Bristle" = "Bristle" +"Browse" = "Bladeren" +"Brush" = "Penseel" +"Brush rotation jitter" = "Penseelrotatiejitter" +"Brush scatter" = "Penseelverstrooiing" +"Brush size jitter" = "Penseelgrootte-jitter" +"Brush spacing" = "Penseelafstand" +"Bulleted list" = "Lijst met opsommingstekens" +"C or Shift+C" = "C of Shift+C" +"C or ⇧C" = "C of ⇧C" +"CMYK colour" = "CMYK-kleur" +"CSS custom properties…" = "CSS-variabelen…" +"Can edit" = "Kan bewerken" +"Can view" = "Kan bekijken" +"Can't read this library: {e}" = "Kan deze bibliotheek niet lezen: {e}" +"Cancel" = "Annuleren" +"Canvas" = "Canvas" +"Canvas stacking" = "Stapeling op canvas" +"Cap height to baseline" = "Hoofdletterhoogte tot basislijn" +"Case" = "Hoofdlettergebruik" +"Case-sensitive forms" = "Hoofdlettergevoelige vormen" +"Categories" = "Categorieën" +"Center" = "Midden" +"Change alias" = "Alias wijzigen" +"Change resolved" = "Wijziging opgelost" +"Change style" = "Stijl wijzigen" +"Change to" = "Wijzigen naar" +"Change to needs a layer inside a variant" = "Wijzigen naar vereist een laag binnen een variant" +"Changed" = "Gewijzigd" +"Changed on both sides: keep one" = "Aan beide kanten gewijzigd: één behouden" +"Changes on main" = "Wijzigingen op main" +"Changes on the branch" = "Wijzigingen op de branch" +"Changes unknown" = "Onbekende wijzigingen" +"Checking the server…" = "Server controleren…" +"Choose React, Leptos, SwiftUI or Compose above to connect this component to its code." = "Kies hierboven React, Leptos, SwiftUI of Compose om dit component aan zijn code te koppelen." +"Choose another profile to change it." = "Kies een ander profiel om dit te wijzigen." +"Choose collection" = "Kies een verzameling" +"Choose image" = "Afbeelding kiezen" +"Choose mode" = "Modus kiezen" +"Choose variable" = "Variabele kiezen" +"Circle" = "Cirkel" +"Clear from this list" = "Verwijderen uit deze lijst" +"Clear recent" = "Recenten wissen" +"Click + to replace mixed content" = "Klik op + om gemengde inhoud te vervangen" +"Click anywhere on the canvas to leave one." = "Klik ergens op het canvas om er een achter te laten." +"Click or drag to merge · {alt} removes" = "Klik of sleep om samen te voegen · {alt} verwijdert" +"Click or drag to remove · {alt} merges" = "Klik of sleep om te verwijderen · {alt} voegt samen" +"Click to record a key" = "Klik om een toets op te nemen" +"Clip content" = "Inhoud bijsnijden" +"Clip to shape" = "Bijsnijden op vorm" +"Close" = "Sluiten" +"Close overlay" = "Overlay sluiten" +"Close preview" = "Voorvertoning sluiten" +"Close tab" = "Tabblad sluiten" +"Close version history" = "Versiegeschiedenis sluiten" +"Close when clicking outside" = "Sluiten bij klikken erbuiten" +"Close without saving" = "Sluiten zonder opslaan" +"Code" = "Code" +"Code or invite link" = "Code of uitnodigingslink" +"Code syntax" = "Code-syntaxis" +"Collapse" = "Inklappen" +"Collapse panel" = "Paneel samenvouwen" +"Collection" = "Verzameling" +"Collections" = "Verzamelingen" +"Color" = "Kleur" +"Color burn" = "Color burn" +"Color dodge" = "Color dodge" +"Color format" = "Kleurnotatie" +"Color profile" = "Kleurprofiel" +"Color profile: {name}" = "Kleurprofiel: {name}" +"Color styles" = "Kleurstijlen" +"Color values in this file are in this color space." = "Kleurwaarden in dit bestand gebruiken deze kleurruimte." +"Color variables" = "Kleurvariabelen" +"Colour" = "Kleur" +"Colour and text styles, Light and Dark variables, buttons, inputs and cards" = "Kleur- en tekststijlen, lichte en donkere variabelen, knoppen, invoervelden en kaarten" +"Column" = "Kolom" +"Column gap" = "Kolomafstand" +"Column sizes" = "Kolomgroottes" +"Column span" = "Kolomspan" +"Columns" = "Kolommen" +"Columns {count}" = "Kolommen {count}" +"Comment" = "Reactie" +"Comments" = "Reacties" +"Commits" = "Commits" +"Company" = "Bedrijf" +"Compare changes" = "Wijzigingen vergelijken" +"Compatibility notes" = "Compatibiliteitsopmerkingen" +"Completed" = "Voltooid" +"Component" = "Component" +"Component name" = "Componentnaam" +"Component property" = "Componenteigenschap" +"Component set" = "Componentenset" +"Component sets" = "Componentensets" +"Components" = "Components" +"Conditional" = "Voorwaardelijk" +"Confetti" = "Confetti" +"Conflicts" = "Conflicten" +"Connect to code" = "Verbinden met code" +"Connected" = "Verbonden" +"Connected to code: {from}" = "Verbonden met code: {from}" +"Connection lost, reconnecting (attempt {attempt})…" = "Verbinding verbroken, opnieuw verbinden (poging {attempt})…" +"Constrain proportions" = "Verhoudingen vergrendelen" +"Constraints" = "Constraints" +"Content" = "Inhoud" +"Contents hidden" = "Inhoud verborgen" +"Contents only" = "Alleen de inhoud" +"Contextual alternates" = "Contextuele alternatieven" +"Contrast" = "Contrast" +"Contributors" = "Bijdragers" +"Contributors: {people} · Commits: {commits}" = "Bijdragers: {people} · Commits: {commits}" +"Controller" = "Controller" +"Convert to frame" = "Converteren naar frame" +"Convert to section" = "Converteren naar sectie" +"Cool" = "Cool" +"Copied as CSS" = "Gekopieerd als CSS" +"Copied as PNG" = "Gekopieerd als PNG" +"Copied as SVG" = "Gekopieerd als SVG" +"Copied as text" = "Gekopieerd als tekst" +"Copied {value}" = "{value} gekopieerd" +"Copy" = "Kopiëren" +"Copy as" = "Kopiëren als" +"Copy as CSS" = "Kopiëren als CSS" +"Copy as PNG" = "Kopiëren als PNG" +"Copy as SVG" = "Kopiëren als SVG" +"Copy code" = "Code kopiëren" +"Copy link" = "Link kopiëren" +"Copy the {label}" = "Kopieer de {label}" +"Copy {value}" = "{value} kopiëren" +"Corner radius" = "Hoekradius" +"Corner smoothing" = "Hoekafvlakking" +"Couldn't download the variables" = "De variabelen konden niet worden gedownload" +"Couldn't reach {server}: showing what this computer remembers." = "Kon {server} niet bereiken: toont wat deze computer onthoudt." +"Couldn't save automatically: {error}" = "Kan niet automatisch opslaan: {error}" +"Count" = "Aantal" +"Create" = "Maken" +"Create a variable collection first" = "Maak eerst een variabeleverzameling" +"Create a variable first" = "Maak eerst een variabele" +"Create alias" = "Alias maken" +"Create branch" = "Branch aanmaken" +"Create collection" = "Verzameling maken" +"Create component" = "Component maken" +"Create component property" = "Componenteigenschap maken" +"Create components, styles or variables to publish them as a library." = "Maak componenten, stijlen of variabelen om ze als bibliotheek te publiceren." +"Create property…" = "Eigenschap maken…" +"Create style" = "Stijl maken" +"Create style from the selected text" = "Stijl maken van de geselecteerde tekst" +"Created" = "Gemaakt" +"Crop" = "Bijsnijden" +"Crop marks" = "Snijtekens" +"Ctrl+arrows" = "Ctrl+pijltjes" +"Ctrl+click" = "Ctrl+click" +"Ctrl+scroll" = "Ctrl+scroll" +"Current name" = "Huidige naam" +"Current version" = "Huidige versie" +"Cursor chat" = "Cursorchat" +"Custom" = "Aangepast" +"Custom size" = "Aangepaste grootte" +"Cut" = "Knippen" +"Dark" = "Donker" +"Darken" = "Darken" +"Dash" = "Streep" +"Dashboard" = "Dashboard" +"Date created" = "Aanmaakdatum" +"Dec" = "dec." +"Decoration" = "Decoratie" +"Decoration style" = "Decoratiestijl" +"Deep select" = "Diep selecteren" +"Default" = "Standaard" +"Default content" = "Standaardinhoud" +"Default value (the top-left variant)" = "Standaardwaarde (de variant linksboven)" +"Delay" = "Vertraging" +"Delete" = "Verwijderen" +"Delete category (its annotations stay)" = "Categorie verwijderen (de annotaties blijven staan)" +"Delete collection" = "Verzameling verwijderen" +"Delete group" = "Groep verwijderen" +"Delete mode" = "Modus verwijderen" +"Delete page" = "Pagina verwijderen" +"Delete preset" = "Preset verwijderen" +"Delete property" = "Eigenschap verwijderen" +"Delete the style (layers keep their values)" = "Verwijdert de stijl (lagen behouden hun waarden)" +"Delete thread" = "Gesprek verwijderen" +"Delete variable" = "Variabele verwijderen" +"Delete “{name}”? This can't be undone." = "“{name}” verwijderen? Dit kan niet ongedaan worden gemaakt." +"Density" = "Dichtheid" +"Depth" = "Diepte" +"Describe how and when to use this component" = "Beschrijf hoe en wanneer je dit component gebruikt" +"Describe what changed" = "Beschrijf wat er is gewijzigd" +"Description" = "Beschrijving" +"Description (optional)" = "Beschrijving (optioneel)" +"Design" = "Design" +"Design system starter" = "Designsysteem-starter" +"Desktop" = "Desktop" +"Destination" = "Bestemming" +"Detach alias" = "Alias loskoppelen" +"Detach instance" = "Instance loskoppelen" +"Detach property" = "Eigenschap loskoppelen" +"Detach style" = "Stijl loskoppelen" +"Detach styles" = "Stijlen loskoppelen" +"Detach variable" = "Variabele loskoppelen" +"Details" = "Details" +"Dev Mode" = "Dev Mode" +"Dev resources" = "Dev-bronnen" +"Development" = "Ontwikkeling" +"Device" = "Apparaat" +"Device at 100%" = "Apparaat op 100%" +"Diamond" = "Ruit" +"Difference" = "Difference" +"Dimensions" = "Afmetingen" +"Direction" = "Richting" +"Disconnect from code" = "Loskoppelen van code" +"Dispersion" = "Dispersie" +"Display name" = "Weergavenaam" +"Dissolve" = "Dissolve" +"Distribute and tidy" = "Verdelen en opruimen" +"Distribute horizontal spacing" = "Horizontale afstand verdelen" +"Distribute vertical spacing" = "Verticale afstand verdelen" +"Divider" = "Scheidslijn" +"Don't truncate" = "Niet afkappen" +"Done" = "Klaar" +"Done editing" = "Klaar met bewerken" +"Dots" = "Dots" +"Dotted" = "Gestippeld" +"Down" = "Onder" +"Drafts" = "Concepten" +"Drag the stroke to add a width point" = "Sleep de lijn om een breedtepunt toe te voegen" +"Draw" = "Tekenen" +"Draw a frame" = "Teken een frame" +"Drawing tools" = "Tekengereedschap" +"Drop a .figcraft, .fig, .json, .svg or image file." = "Laat een .figcraft-, .fig-, .json-, .svg- of afbeeldingsbestand los." +"Drop shadow" = "Slagschaduw" +"Drop to import" = "Loslaten om te importeren" +"Drop to open" = "Loslaten om te openen" +"Dual-licensed MIT OR Apache-2.0. Made by the ArtCraft team and community." = "Dual-licensed MIT OR Apache-2.0. Made by the ArtCraft team and community." +"Duo" = "Duo" +"Duplicate" = "Dupliceren" +"Duplicate by dragging" = "Dupliceren door te slepen" +"Duplicate mode" = "Modus dupliceren" +"Duplicate page" = "Pagina dupliceren" +"Edit" = "Bewerken" +"Edit as an expression" = "Bewerken als expressie" +"Edit colour" = "Kleur bewerken" +"Edit comment" = "Reactie bewerken" +"Edit dev resource" = "Dev-resource bewerken" +"Edit link" = "Link bewerken" +"Edit link copied" = "Link om te bewerken gekopieerd" +"Edit style" = "Stijl bewerken" +"Edit variable" = "Variabele bewerken" +"Edit with the builder" = "Bewerken met de builder" +"Edited {when}" = "Bewerkt {when}" +"Effect settings" = "Effectinstellingen" +"Effect styles" = "Effectstijlen" +"Effects" = "Effecten" +"Ellipse" = "Ellips" +"Ellipses" = "Ellipsen" +"Else" = "Anders" +"Else if" = "Anders als" +"Embedded profile" = "Ingebed profiel" +"Empty" = "Leeg" +"End" = "End" +"End point" = "Eindpunt" +"Ends the session; everyone keeps their copy" = "Beëindigt de sessie; iedereen houdt zijn eigen kopie" +"Enter" = "Enter" +"Enter the address of a figcraft-server and press Browse to see the plugins it offers." = "Voer het adres van een figcraft-server in en druk op Bladeren om te zien welke plugins het aanbiedt." +"Enter to save · Esc to cancel" = "Enter om op te slaan · Esc om te annuleren" +"Eraser" = "Gum" +"Esc" = "Esc" +"Essential" = "Essentieel" +"Every conflict has a choice." = "Elk conflict heeft een keuze." +"Every top-level frame already starts a flow" = "Elk frame op het hoogste niveau begint al een flow" +"Exact opacity (4 then 5: 45%)" = "Exacte dekking (4 dan 5: 45%)" +"Exclude" = "Exclude" +"Excluded" = "Uitgesloten" +"Excluded from layout" = "Uitgesloten van de layout" +"Excludes" = "Sluit uit" +"Exclusion" = "Exclusion" +"Exit focus view (Esc)" = "Focusweergave afsluiten (Esc)" +"Expand" = "Uitvouwen" +"Export" = "Exporteren" +"Export all" = "Alles exporteren" +"Export frames and layers as PNG, JPG, SVG or PDF" = "Frames en lagen exporteren als PNG, JPG, SVG of PDF" +"Export page as PNG" = "Pagina exporteren als PNG" +"Export settings" = "Exportinstellingen" +"Export variables" = "Variabelen exporteren" +"Export {name}" = "{name} exporteren" +"Export {n} layers" = { one = "{n} laag exporteren", other = "{n} lagen exporteren" } +"Exported {file}" = "{file} geëxporteerd" +"Exported {name}" = "{name} geëxporteerd" +"Exported {name}; {n} kinds of content were left out" = { one = "{name} geëxporteerd; {n} soort content is niet meegenomen", other = "{name} geëxporteerd; {n} soorten content zijn niet meegenomen" } +"Exported {n} files" = { one = "{n} bestand geëxporteerd", other = "{n} bestanden geëxporteerd" } +"Export…" = "Exporteren…" +"Expose properties to instances" = "Eigenschappen beschikbaar maken voor instances" +"Exposure" = "Belichting" +"Expression" = "Expressie" +"Extend collection" = "Verzameling uitbreiden" +"Extends \"{name}\": overridden values are marked" = "Erft van “{name}”: overschreven waarden zijn gemarkeerd" +"Eye" = "Oog" +"F" = "F" +"Fade" = "Fade" +"False" = "Onwaar" +"Feb" = "feb." +"Fetching from the server…" = "Bezig met ophalen van de server…" +"FigCraft couldn't open its window: {error}" = "FigCraft kon zijn venster niet openen: {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 ondersteunt nog niet elke functie van deze bestanden. De notities vermelden wat er in de geïmporteerde kopie is weggelaten of gewijzigd; het originele bestand is ongewijzigd." +"File" = "Bestand" +"File name" = "Bestandsnaam" +"File not found" = "Bestand niet gevonden" +"File published" = "Bestand gepubliceerd" +"Files aren't end-to-end encrypted: the server's operator can read them." = "Bestanden zijn niet end-to-end versleuteld: de beheerder van de server kan ze lezen." +"Files nobody opens for {n} days are deleted." = { one = "Na {n} dag zonder openen wordt een bestand verwijderd.", other = "Na {n} dagen zonder openen wordt een bestand verwijderd." } +"Fill" = "Vulling" +"Fill (fr)" = "Vullen (fr)" +"Fill container" = "Container vullen" +"Fill window" = "Venster vullen" +"Fills" = "Vullingen" +"Fill|sizing" = "Vullen" +"Filter and sort" = "Filteren en sorteren" +"Find" = "Zoeken" +"Find and replace" = "Zoeken en vervangen" +"Find layers" = "Lagen zoeken" +"First" = "Eerste" +"First commit" = "Eerste commit" +"First on top" = "Eerste bovenaan" +"Fit" = "Inpassen" +"Fit device to window" = "Apparaat inpassen in het venster" +"Fit to contents" = "Aanpassen aan inhoud" +"Fit to window" = "Inpassen in venster" +"Fit width" = "Breedte inpassen" +"Fixed" = "Vast" +"Fixed gap" = "Vaste afstand" +"Fixed size" = "Vaste grootte" +"Flatten" = "Samenvoegen tot vector" +"Flip" = "Spiegelen" +"Flip horizontal" = "Horizontaal spiegelen" +"Flip text to the other side" = "Tekst naar de andere kant spiegelen" +"Flip vertical" = "Verticaal spiegelen" +"Flip width profile" = "Breedteprofiel spiegelen" +"Flow starting point" = "Flow-startpunt" +"Flow starting points" = "Flow-startpunten" +"Flows" = "Flows" +"Focus view" = "Focusweergave" +"Fold autosaves" = "Automatisch opgeslagen versies inklappen" +"Folder: click to collapse" = "Map: klik om samen te vouwen" +"Folder: click to expand" = "Map: klik om uit te klappen" +"Follow" = "Volgen" +"Follow {name}" = "{name} volgen" +"Following" = "Volgend" +"Following {name} · {key} to stop" = "Volgt {name} · {key} om te stoppen" +"Font" = "Lettertype" +"Font not installed" = "Lettertype niet geïnstalleerd" +"Font size" = "Lettertypegrootte" +"Font style" = "Lettertypestijl" +"Forget on this computer" = "Vergeten op deze computer" +"Four screens of a trail app with components and a prototype flow" = "Vier schermen van een wandelroute-app met componenten en een prototype-flow" +"Fractions" = "Breuken" +"Frame" = "Frame" +"Frame selection" = "Selectie in frame plaatsen" +"Frame tools" = "Frame-hulpmiddelen" +"Frames" = "Frames" +"From the library \"{name}\": read-only" = "Uit de bibliotheek \"{name}\": alleen-lezen" +"From {name}" = "Van {name}" +"From {server}" = "Van {server}" +"Frost" = "Frost" +"Gap" = "Afstand" +"Gap between columns" = "Afstand tussen kolommen" +"Gap between items" = "Afstand tussen items" +"Gap between rows" = "Afstand tussen rijen" +"Getting started" = "Aan de slag" +"Give the address of a server open to the public, or a server's address with its key (`figcraft-server key` prints it)." = "Geef het adres van een server die openbaar bereikbaar is, of het adres van een server met bijbehorende key (`figcraft-server key` toont die)." +"Glass" = "Glass" +"Go to main component" = "Naar hoofdcomponent gaan" +"Go to {name}" = "Ga naar {name}" +"Grab bag" = "Grab bag" +"Gradient" = "Verloop" +"Gray" = "Grijs" +"Green" = "Groen" +"Greyscale components and two example screens to sketch a flow with" = "Grijswaardencomponenten en twee voorbeeldschermen om een flow mee te schetsen" +"Grid" = "Raster" +"Grid ({size})" = "Raster ({size})" +"Grid styles" = "Rasterstijlen" +"Grid {size}" = "Raster {size}" +"Group" = "Groep" +"Group selection" = "Selectie groeperen" +"Groups" = "Groepen" +"Gutter" = "Tussenruimte" +"Hand tool" = "Handgereedschap" +"Hanging list" = "Lijst met hangende inspringing" +"Hanging punctuation" = "Uithangende leestekens" +"Hard light" = "Hard light" +"Height" = "Hoogte" +"Help" = "Help" +"Help and resources" = "Help en bronnen" +"Help page" = "Helppagina" +"Here: {names}" = "Hier: {names}" +"Hidden" = "Verborgen" +"Hide contents" = "Inhoud verbergen" +"Hide from publishing" = "Verbergen bij publiceren" +"Hide section contents" = "Sectie-inhoud verbergen" +"Hide these tips (Getting started in the Help menu shows them again)" = "Deze tips verbergen (Aan de slag in het menu Help toont ze opnieuw)" +"Hide when publishing" = "Verbergen bij publiceren" +"Highlight layers on hover" = "Lagen uitlichten bij aanwijzen" +"Highlights" = "Hooglichten" +"Hold Alt" = "Houd Alt ingedrukt" +"Hold Alt+Z" = "Houd Alt+Z ingedrukt" +"Hold Ctrl" = "Ctrl ingedrukt houden" +"Hold Z" = "Houd Z ingedrukt" +"Hold ⌃ or ⌘" = "Houd ⌃ of ⌘ ingedrukt" +"Hold ⌥" = "Houd ⌥ ingedrukt" +"Hold ⌥Z" = "Houd ⌥Z ingedrukt" +"Home" = "Home" +"Horizontal" = "Horizontaal" +"Horizontal align" = "Horizontaal uitlijnen" +"Horizontal hex" = "Horizontaal hex" +"Horizontal padding" = "Horizontale padding" +"Horizontal spacing" = "Horizontale afstand" +"Hosted by {operator}" = "Gehost door {operator}" +"Hover a layer to see its properties" = "Houd de muis boven een laag om de eigenschappen te zien" +"Hover other layers to measure the distance" = "Beweeg over andere lagen om de afstand te meten" +"Hue" = "Hue" +"Hug" = "Hug" +"Hug contents" = "Aangepast aan inhoud" +"Icon components on a 24 px grid with keylines and a size preview" = "Iconcomponents op een raster van 24 px met keylines en een voorvertoning van de grootte" +"Icon set starter" = "Iconenset-starter" +"If" = "Als" +"If it keeps happening, please report it at {link} with this message." = "Als dit blijft gebeuren, meld het dan op {link} met dit bericht." +"If {condition}" = "Als {condition}" +"Ignore auto layout (absolute position)" = "Auto layout negeren (absolute positie)" +"Image" = "Afbeelding" +"Images" = "Afbeeldingen" +"Import" = "Importeren" +"Import path" = "Importpad" +"Import plugin from manifest" = "Plugin importeren vanuit een manifest" +"Import plugin from manifest…" = "Plugin importeren vanuit manifest…" +"Import report" = "Importrapport" +"Import variables" = "Variabelen importeren" +"Imported document" = "Geïmporteerd document" +"Imported {name}" = "{name} geïmporteerd" +"Imported {n} new variables, updated {updated}" = { one = "{n} nieuwe variabele geïmporteerd, {updated} bijgewerkt", other = "{n} nieuwe variabelen geïmporteerd, {updated} bijgewerkt" } +"Import…" = "Importeren…" +"In an instance, this comes from the main component" = "In een instance komt dit uit de hoofdcomponent" +"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)." = "In de browser kun je deelnemen aan sessies die de desktop-app host en aan bestanden die op een FigCraft-server staan. Een pagina die via https is geopend, bereikt andere computers alleen via wss://-links (een server achter TLS)." +"Include bounding box" = "Bounding box meenemen" +"Include id attribute" = "id-attribuut opnemen" +"Included" = "Inbegrepen" +"Included in layout" = "Inbegrepen in de layout" +"Individual corners" = "Individuele hoeken" +"Individual strokes" = "Afzonderlijke lijnen" +"Ink" = "Ink" +"Inner shadow" = "Binnenschaduw" +"Inside" = "Binnen" +"Inspect" = "Inspecteren" +"Inspect the layer under the pointer: size, colours, typography" = "Inspecteer de laag onder de muisaanwijzer: grootte, kleuren, typografie" +"Install" = "Installeren" +"Install plugin" = "Plugin installeren" +"Installed" = "Geïnstalleerd" +"Installed {name}" = "{name} geïnstalleerd" +"Installing…" = "Installeren…" +"Instance" = "Instance" +"Instance properties" = "Instance-eigenschappen" +"Instance swap" = "Instance verwisselen" +"Instance swap (no other component)" = "Instance verwisselen (geen andere component)" +"Instances" = "Instances" +"Instant" = "Direct" +"Interaction" = "Interactie" +"Interactions" = "Interacties" +"Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Interface-ontwerp en prototyping. Een gratis, open-source, clean-room ontwerptool, helemaal van nul geschreven in Rust, onderdeel van de ArtCraft Crafting Apps." +"Intersect" = "Intersect" +"Intersects" = "Overlapt" +"Invalid color" = "Ongeldige kleur" +"Invite link" = "Uitnodigingslink" +"Invite link copied" = "Uitnodigingslink gekopieerd" +"It asks permission to:" = "Het vraagt toestemming om:" +"Jan" = "jan." +"Join" = "Deelnemen" +"Join code copied" = "Toegangscode gekopieerd" +"Join code or invite link" = "Deelnamecode of uitnodigingslink" +"Join live session" = "Deelnemen aan live-sessie" +"Join us on Discord" = "Chat met ons op Discord" +"Join with a code" = "Deelnemen met een code" +"Joined" = "Erbij gekomen" +"Joined {file}" = "Deelgenomen aan {file}" +"Joining…" = "Bezig met deelnemen…" +"Join|stroke" = "Hoek" +"Jul" = "jul." +"Jun" = "jun." +"Just now" = "Zojuist" +"Justify" = "Uitvullen" +"Keep appearance" = "Uiterlijk behouden" +"Keep appearance converts every color value to {profile} so colors look the same. Keep values leaves the numbers as they are, so colors shift." = "Kleur behouden converteert elke kleurwaarde naar {profile}, zodat kleuren er hetzelfde uitzien. Waarden behouden laat de getallen staan, waardoor kleuren verschuiven." +"Keep tool selected after use" = "Tool na gebruik geselecteerd houden" +"Keep values" = "Waarden behouden" +"Key/Gamepad" = "Toets/Gamepad" +"Key/Gamepad {key}" = "Toets/Gamepad {key}" +"Keyboard shortcuts" = "Sneltoetsen" +"Kits" = "Kits" +"Landing page" = "Landingspagina" +"Language" = "Taal" +"Lasso" = "Lasso" +"Last" = "Laatst" +"Last change: {note}" = "Laatste wijziging: {note}" +"Last commit" = "Laatste commit" +"Last modified" = "Laatst gewijzigd" +"Last on top" = "Laatste bovenaan" +"Layer blur" = "Laagvervaging" +"Layer name" = "Laagnaam" +"Layers" = "Lagen" +"Layers in an instance take their position from the main component" = "Lagen in een instance nemen hun positie over van de hoofdcomponent" +"Layout" = "Layout" +"Layout grid" = "Layoutraster" +"Layout grid settings" = "Instellingen voor layoutraster" +"Layout grids" = "Layout-rasters" +"Leave session" = "Sessie verlaten" +"Leaves" = "Leaves" +"Left" = "Links" +"Left & right" = "Links en rechts" +"Left side" = "Linkerkant" +"Left side width" = "Breedte linkerkant" +"Letter case" = "Letterkast" +"Letter spacing" = "Letterafstand" +"Libraries" = "Bibliotheken" +"Libraries in this file" = "Bibliotheken in dit bestand" +"Library updates available" = "Bibliotheekupdates beschikbaar" +"Library: click to collapse" = "Bibliotheek: klik om samen te vouwen" +"Library: click to expand" = "Bibliotheek: klik om uit te klappen" +"Library: its variables are read-only here; edit them in the library file and publish it" = "Bibliotheek: de variabelen zijn hier alleen-lezen; bewerk ze in het bibliotheekbestand en publiceer dat" +"Light" = "Licht" +"Lighten" = "Lighten" +"Light|glass" = "Light" +"Line" = "Lijn" +"Line arrow" = "Lijnpijl" +"Line delta" = "Regeldelta" +"Line height" = "Regelafstand" +"Linear" = "Lineair" +"Lines" = "Lijnen" +"Lines +/−" = "Regels +/−" +"Lines added" = "Toegevoegde regels" +"Lines deleted" = "Regels verwijderd" +"Link" = "Koppeling" +"Link copied" = "Link gekopieerd" +"Link docs, code or tickets for developers." = "Koppel documentatie, code of tickets voor ontwikkelaars." +"Link frames on the Prototype tab, then present the flow" = "Koppel frames op het Prototype-tabblad en presenteer daarna de flow" +"Link this component to its code component: instances then show your real snippet with their values." = "Koppel deze component aan zijn codecomponent: instances laten dan je echte snippet zien met hun waarden." +"List spacing" = "Lijstafstand" +"List style" = "Lijststijl" +"Live session" = "Live sessie" +"Live · {people}" = "Live · {people}" +"Local components" = "Lokale componenten" +"Local network" = "Lokaal netwerk" +"Local styles" = "Lokale stijlen" +"Local variables" = "Lokale variabelen" +"Lock/Unlock" = "Vergrendelen/ontgrendelen" +"Locked" = "Vergrendeld" +"Lowercase" = "Kleine letters" +"Luminance" = "Luminantie" +"Luminosity" = "Luminosity" +"Main" = "Main" +"Main component deleted" = "Hoofdcomponent verwijderd" +"Main menu" = "Hoofdmenu" +"Make a component" = "Maak een component" +"Make slot" = "Slot maken" +"Mar" = "mrt." +"Margin" = "Marge" +"Mark all as read" = "Markeer alles als gelezen" +"Mark as resolved" = "Markeren als opgelost" +"Mark as unread" = "Markeren als ongelezen" +"Mark as unresolved" = "Markeren als onopgelost" +"Mask" = "Masker" +"Mass · Stiffness · Damping" = "Massa · Stijfheid · Demping" +"Match (empty: the whole name)" = "Overeenkomst (leeg: de hele naam)" +"Max H" = "Max H" +"Max W" = "Max B" +"Max lines" = "Max. regels" +"Maximize" = "Maximaliseren" +"May" = "mei" +"Measure to the selection" = "Meten tot de selectie" +"Merge into main" = "Samenvoegen in main" +"Merge regions" = "Gebieden samenvoegen" +"Merge the branch into the main file (one undo step) and archive it" = "Voeg de branch samen met het hoofdbestand (één keer ongedaan maken) en archiveer hem" +"Merged" = "Samengevoegd" +"Merged PRs" = "Samengevoegde PRs" +"Min H" = "Min H" +"Min W" = "Min. B" +"Minimize" = "Minimaliseren" +"Mirror angle" = "Hoek spiegelen" +"Mirror angle and length" = "Spiegel hoek en lengte" +"Mirroring" = "Spiegeling" +"Missing" = "Ontbreekt" +"Missing layer" = "Ontbrekende laag" +"Missing style" = "Ontbrekende stijl" +"Missing variable" = "Ontbrekende variabele" +"Miter" = "Punt" +"Miter angle" = "Verstekhoek" +"Mixed" = "Gemengd" +"Mixed fonts" = "Gemengde lettertypen" +"Mixed interactions: click + to replace them" = "Gemengde interacties: klik op + om ze te vervangen" +"Mobile app" = "Mobiele app" +"Mode" = "Modus" +"Model" = "Model" +"Models" = "Modellen" +"Mono" = "Mono" +"More" = "Meer" +"More instance actions" = "Meer instance-acties" +"Mouse down" = "Muisknop ingedrukt" +"Mouse enter" = "Muis erover" +"Mouse leave" = "Muis verlaat" +"Mouse up" = "Muis loslaten" +"Move" = "Verplaatsen" +"Move along the toolbar or the layer rows" = "Beweeg langs de werkbalk of de rijen met lagen" +"Move column left" = "Kolom naar links verplaatsen" +"Move column right" = "Kolom naar rechts verplaatsen" +"Move down" = "Omlaag verplaatsen" +"Move in" = "Naar binnen bewegen" +"Move out" = "Naar buiten verplaatsen" +"Move tools" = "Verplaatsgereedschap" +"Move up" = "Omhoog verplaatsen" +"Moved to {name}" = "Verplaatst naar {name}" +"Multi" = "Multi" +"Multiply" = "Multiply" +"Muted" = "Muted" +"Name" = "Naam" +"Name (A–Z)" = "Naam (A–Z)" +"Named instance" = "Benoemde instance" +"Navigate to" = "Ga naar" +"Nested instance" = "Geneste instance" +"New design file" = "Nieuw ontwerpbestand" +"Newest first" = "Nieuwste eerst" +"Next frame" = "Volgend frame" +"Next or previous control in the focused region" = "Volgende of vorige bedieningselement in het gebied met focus" +"Next ready for dev" = "Volgende klaar voor dev" +"Next size option" = "Volgende grootteoptie" +"No assets: no export settings, icons or images. Add export settings in the Design tab." = "Geen assets: geen exportinstellingen, pictogrammen of afbeeldingen. Voeg exportinstellingen toe op het Design-tabblad." +"No boolean variables fit here." = "Er passen hier geen booleaanse variabelen." +"No boolean variables yet. Create them in Local variables." = "Nog geen booleaanse variabelen. Maak ze in Lokale variabelen." +"No branches. A branch is a copy of the file to try changes in, then review and merge." = "Geen branches. Een branch is een kopie van het bestand om wijzigingen in uit te proberen, daarna te beoordelen en samen te voegen." +"No category" = "Geen categorie" +"No changes" = "Geen wijzigingen" +"No color styles" = "Geen kleurstijlen" +"No colour variables fit here." = "Hier passen geen kleurvariabelen." +"No colour variables yet. Create them in Local variables." = "Nog geen kleurvariabelen. Maak ze in Lokale variabelen." +"No comments yet" = "Nog geen reacties" +"No compatibility warnings reported" = "Geen compatibiliteitswaarschuwingen gerapporteerd" +"No components yet. Select layers and press {keys}." = "Nog geen components. Selecteer lagen en druk op {keys}." +"No conflicts." = "Geen conflicten." +"No contributor data was built into this copy." = "In deze kopie zijn geen bijdragersgegevens ingebouwd." +"No device" = "Geen apparaat" +"No fonts match" = "Geen lettertypen gevonden" +"No join code here (the server is older than join codes, or this address can't be put in one): share the link instead." = "Hier is geen toegangscode (de server is ouder dan toegangscodes, of dit adres past niet in een code): deel in plaats daarvan de link." +"No layer changes to show." = "Geen lagenwijzigingen om te tonen." +"No libraries yet. Add a .figcraft file that was published as a library, or paste a team library's link." = "Nog geen bibliotheken. Voeg een .figcraft-bestand toe dat als bibliotheek is gepubliceerd, of plak de link van een teambibliotheek." +"No list" = "Geen lijst" +"No matching comments" = "Geen overeenkomende reacties" +"No matching components" = "Geen overeenkomende components" +"No matching layers" = "Geen bijpassende lagen" +"No matching styles" = "Geen bijpassende stijlen" +"No matching variables" = "Geen passende variabelen" +"No mirroring" = "Geen spiegeling" +"No model credits were built into this copy." = "Er zijn geen modelcredits in deze kopie ingebouwd." +"No number variables fit here." = "Hier passen geen getalvariabelen." +"No number variables yet. Create them in Local variables." = "Nog geen getalvariabelen. Maak ze in Lokale variabelen." +"No other pages" = "Geen andere pagina's" +"No paints" = "Geen vullingen" +"No plugins on {server}." = "Geen plugins op {server}." +"No plugins yet. Import a development plugin from its figcraft-plugin.json." = "Nog geen plugins. Importeer een development-plugin via zijn figcraft-plugin.json." +"No preferred components" = "Geen voorkeurscomponenten" +"No preset" = "Geen preset" +"No saved versions yet. Save a version to mark a point in your work you can come back to." = "Nog geen opgeslagen versies. Sla een versie op om een moment in je werk vast te leggen waar je later naartoe kunt terugkeren." +"No scrolling" = "Geen scrollen" +"No shortcuts match" = "Er komen geen sneltoetsen overeen" +"No status" = "Geen status" +"No string variables fit here." = "Er passen hier geen string-variabelen." +"No string variables yet. Create them in Local variables." = "Nog geen tekenreeksvariabelen. Maak ze aan in Lokale variabelen." +"No styles yet." = "Nog geen stijlen." +"No styles yet. Click + to create one from the selection." = "Nog geen stijlen. Klik op + om er een te maken vanuit de selectie." +"No templates match your search" = "Geen sjablonen gevonden voor je zoekopdracht" +"No text styles yet. Click + to create one from the selected text." = "Nog geen tekststijlen. Klik op + om er een te maken vanuit de geselecteerde tekst." +"No variables fit here." = "Er passen hier geen variabelen." +"No variables yet. Create them in Local variables." = "Nog geen variabelen. Maak ze in Lokale variabelen." +"Nobody else is here yet" = "Er is nog niemand anders hier" +"Noise" = "Ruis" +"None" = "Geen" +"None." = "Geen." +"Normal" = "Normal" +"Not bound" = "Niet gekoppeld" +"Not in a live session" = "Niet in een live sessie" +"Not in this font" = "Niet in dit lettertype" +"Not properties, kept as written: {names}" = "Geen eigenschappen, ongewijzigd overgenomen: {names}" +"Not read yet" = "Nog niet gelezen" +"Not shared" = "Niet gedeeld" +"Note {n}" = "Notitie {n}" +"Nothing changed since this was marked ready for dev." = "Er is niets gewijzigd sinds dit was gemarkeerd als ready for dev." +"Nothing here yet. Set a frame's status to list it." = "Nog niets hier. Stel de status van een frame in om het hier te tonen." +"Nothing online yet. Use Share on a file to put it online and it is listed here." = "Er staat nog niets online. Gebruik Delen bij een bestand om het online te zetten, dan wordt het hier vermeld." +"Nothing to export" = "Niets te exporteren" +"Nov" = "nov." +"Now" = "Nu" +"Nudge (Shift: big nudge)" = "Verschuiven (Shift: grote stap)" +"Nudge amount" = "Stapafstand" +"Number" = "Getal" +"Number ↑" = "Getal ↑" +"Number ↓" = "Nummer ↓" +"Numbered list" = "Genummerde lijst" +"Object" = "Object" +"Oct" = "okt." +"Off" = "Uit" +"Offered first when filling the slot (any content is allowed)" = "Wordt het eerst aangeboden bij het vullen van de slot (elke inhoud is toegestaan)" +"Offered first when swapping the instance (any component is allowed)" = "Wordt als eerste aangeboden bij het verwisselen van de instance (elk component is toegestaan)" +"Offset" = "Verschuiving" +"Oldest first" = "Oudste eerst" +"On click" = "Bij klik" +"On drag" = "Bij slepen" +"On this page" = "Op deze pagina" +"One announcement in five common sizes: square, portrait, story, link and banner" = "Eén aankondiging in vijf gangbare formaten: vierkant, staand, story, link en banner" +"Online" = "Online" +"Online files" = "Online bestanden" +"Online sharing is off: files are shared on the local network only." = "Online delen staat uit: bestanden worden alleen op het lokale netwerk gedeeld." +"Only the first changed layers are listed." = "Alleen de eerste gewijzigde lagen worden weergegeven." +"Only the first {n} changed layers are listed." = "Er worden alleen de eerste {n} gewijzigde lagen weergegeven." +"Only your threads" = "Alleen jouw gesprekken" +"Opacity" = "Dekking" +"Opacity & blend" = "Dekking & blend" +"Opacity 10%…90%, 0: 100%" = "Dekking 10%…90%, 0: 100%" +"Open" = "Openen" +"Open .figcraft, .svg or images" = "Open .figcraft, .svg of afbeeldingen" +"Open branch" = "Branch openen" +"Open file" = "Bestand openen" +"Open files" = "Geopende bestanden" +"Open in focus view" = "Openen in focusweergave" +"Open in new window" = "Openen in een nieuw venster" +"Open invite links in FigCraft" = "Uitnodigingslinks openen in FigCraft" +"Open link" = "Link openen" +"Open link {url}" = "Link {url} openen" +"Open overlay" = "Overlay openen" +"Open prototype preview" = "Voorvertoning van prototype openen" +"Open variables ({count})" = "Variabelen openen ({count})" +"Opened as a new document" = "Geopend als nieuw document" +"Opened “{name}” in a new tab" = "“{name}” geopend in een nieuw tabblad" +"Opening the file…" = "Bestand openen…" +"Opening {n} files as new files" = { one = "Openen als nieuw bestand", other = "{n} bestanden openen als nieuwe bestanden" } +"Open|comments" = "Open" +"Options" = "Opties" +"Orange" = "Oranje" +"Order" = "Volgorde" +"Other" = "Overige" +"Other apps may not open every .fig file exported here." = "Het kan zijn dat andere apps niet elk .fig-bestand openen dat hier wordt geëxporteerd." +"Others lose access and keep their copy; the file stays on the server for you" = "Anderen verliezen de toegang en behouden hun kopie; het bestand blijft voor jou op de server" +"Others type this under Share ▸ Join with a code" = "Anderen typen dit onder Delen ▸ Deelnemen met een code" +"Outline stroke" = "Lijn omzetten naar contour" +"Outline text" = "Tekst omzetten in outlines" +"Outlines" = "Contouren" +"Outside" = "Buiten" +"Overflow" = "Overloop" +"Overlay" = "Overlay" +"Overlay position" = "Overlaypositie" +"Overridden here (the collection it extends has another value)" = "Hier overschreven (de verzameling die het uitbreidt heeft een andere waarde)" +"Overrides" = "Overschrijvingen" +"Owner token" = "Eigenaartoken" +"Owner token copied" = "Eigenaartoken gekopieerd" +"PDF print options" = "PDF-afdrukopties" +"PDF print settings" = "PDF-afdrukinstellingen" +"Padding" = "Padding" +"Page" = "Pagina" +"Pages" = "Pagina's" +"Pages added to the document" = "Pagina's toegevoegd aan het document" +"Pages: {pages}" = "Pagina's: {pages}" +"Paint bucket" = "Vulemmertje" +"Pan the canvas" = "Verschuif het canvas" +"Pan with nothing selected (Shift: farther)" = "Verschuiven zonder selectie (Shift: verder)" +"Panels" = "Panelen" +"Paper" = "Paper" +"Paragraph indent" = "Alinea-inspringen" +"Paragraph indent applies to left-aligned text" = "Alineainspringing geldt voor links uitgelijnde tekst" +"Paragraph spacing" = "Alinea-afstand" +"Pass through" = "Pass through" +"Paste a link (https://…)" = "Plak een link (https://…)" +"Paste a team library link (a view link)" = "Plak een link naar een teambibliotheek (een weergavelink)" +"Paste here" = "Hier plakken" +"Paste to replace" = "Plakken om te vervangen" +"Pasted design layers; {n} kinds of content were left out" = { one = "Ontwerplagen geplakt; {n} soort inhoud is weggelaten", other = "Ontwerplagen geplakt; {n} soorten inhoud zijn weggelaten" } +"Pattern" = "Patroon" +"Pattern alignment" = "Patroonuitlijning" +"Pattern scale" = "Patroonschaal" +"Pattern source" = "Patroonbron" +"Pen" = "Pen" +"Pencil" = "Potlood" +"People in this file" = "Personen in dit bestand" +"People join from anywhere with a code. The file is kept on {server} while you share it." = "Mensen kunnen met een code van overal deelnemen. Het bestand blijft op {server} staan zolang je het deelt." +"People on your network join with a code. Nothing goes through a server." = "Mensen op je netwerk nemen deel met een code. Er gaat niets via een server." +"Phone" = "Telefoon" +"Pick color" = "Kleur opnemen" +"Pick color (I)" = "Kleur kiezen (I)" +"Pick one font family first" = "Kies eerst één lettertypefamilie" +"Pick the Frame tool, then drag on the canvas or choose a device size" = "Kies de Frame-tool en sleep daarna op het canvas of kies een apparaatgrootte" +"Pin a property" = "Eigenschap vastspelden" +"Pinch" = "Pinch" +"Pixel grid" = "Pixelraster" +"Pixel preview 1x" = "Pixelvoorvertoning 1x" +"Pixel preview 2x" = "Pixelvoorvertoning 2x" +"Place a shape or frame (its tool chosen)" = "Plaats een vorm of frame (het bijbehorende gereedschap is gekozen)" +"Place automatically" = "Automatisch plaatsen" +"Place image" = "Afbeelding plaatsen" +"Placed on the current page" = "Geplaatst op de huidige pagina" +"Playground" = "Playground" +"Plugin" = "Plugin" +"Plugins" = "Plugins" +"Plugins & widgets" = "Plugins & widgets" +"Plugins run in FigCraft's sandbox, without files, network or clock. Install only plugins you trust." = "Plugins draaien in de sandbox van FigCraft, zonder bestanden, netwerk of klok. Installeer alleen plugins die je vertrouwt." +"Plus darker" = "Plus darker" +"Plus lighter" = "Plus lighter" +"Point" = "Punt" +"Points" = "Punten" +"Polygon" = "Veelhoek" +"Polygons" = "Veelhoeken" +"Port" = "Poort" +"Position" = "Positie" +"Post" = "Plaatsen" +"Preferences" = "Voorkeuren" +"Preferred" = "Voorkeur" +"Present" = "Presenteren" +"Present or preview" = "Presenteren of voorvertonen" +"Present this flow" = "Deze flow presenteren" +"Presentation" = "Presentatie" +"Presentation slides" = "Presentatiedia's" +"Presenting: comments" = "Presenteren: reacties" +"Presenting: cycle the size options" = "Presenteren: door de grootteopties bladeren" +"Presenting: full screen" = "Presenteren: volledig scherm" +"Presenting: next frame" = "Presenteren: volgende frame" +"Presenting: previous frame" = "Presenteren: vorig frame" +"Presenting: restart" = "Presenteren: opnieuw starten" +"Preserve scroll position" = "Scrollpositie behouden" +"Presets" = "Presets" +"Press a key…" = "Druk op een toets…" +"Preview" = "Voorvertoning" +"Preview this flow" = "Voorvertoning van deze flow" +"Preview this frame" = "Dit frame voorvertonen" +"Previous frame" = "Vorige frame" +"Previous ready for dev" = "Vorige klaar voor developers" +"Progressive" = "Progressive" +"Properties" = "Eigenschappen" +"Prototype" = "Prototype" +"Prototype preview" = "Prototypevoorvertoning" +"Prototype settings" = "Prototype-instellingen" +"Publish" = "Publiceren" +"Publish changes" = "Wijzigingen publiceren" +"Publish to another server…" = "Publiceren op een andere server…" +"Publish to server" = "Publiceren naar de server" +"Published version {v}" = "Gepubliceerde versie {v}" +"Published version {v} to the server" = "Versie {v} naar de server gepubliceerd" +"Published version {v}: save the file so other files can use it" = "Gepubliceerde versie {v}: sla het bestand op zodat andere bestanden het kunnen gebruiken" +"Published · {people}" = "Gepubliceerd · {people}" +"Publishing to a server needs the desktop app; in the browser you can join a server's files" = "Publiceren naar een server vraagt om de desktop-app; in de browser kun je deelnemen aan de bestanden van een server" +"Publishing with the server's key." = "Publiceren met de sleutel van de server." +"Publishing…" = "Bezig met publiceren…" +"Push" = "Pushen" +"Push changes to main component" = "Wijzigingen naar hoofdcomponent doorvoeren" +"Put text on path" = "Tekst op pad plaatsen" +"R" = "R" +"Radial" = "Radiaal" +"Radius" = "Radius" +"Ratio" = "Verhouding" +"Reading the library…" = "Bibliotheek wordt gelezen…" +"Ready for dev" = "Klaar voor dev" +"Real name" = "Echte naam" +"Recent" = "Onlangs geopend" +"Recent files" = "Onlangs geopende bestanden" +"Recents" = "Onlangs geopend" +"Recovered {n} unsaved files after the app quit unexpectedly: save them to keep them" = { one = "Na een onverwachte afsluiting van de app is één niet-opgeslagen bestand hersteld: sla het op om het te bewaren", other = "Na een onverwachte afsluiting van de app zijn {n} niet-opgeslagen bestanden hersteld: sla ze op om ze te bewaren" } +"Rectangle" = "Rechthoek" +"Rectangles" = "Rechthoeken" +"Red" = "Rood" +"Reduce motion" = "Beweging verminderen" +"Refraction" = "Breking" +"Regular expression" = "Reguliere expressie" +"Remove" = "Verwijderen" +"Remove all" = "Alles verwijderen" +"Remove annotation" = "Annotatie verwijderen" +"Remove auto layout" = "Auto layout verwijderen" +"Remove dev resource" = "Dev-resource verwijderen" +"Remove export setting" = "Exportinstelling verwijderen" +"Remove from recents" = "Verwijderen uit onlangs geopend" +"Remove from server" = "Van de server verwijderen" +"Remove from server…" = "Van server verwijderen…" +"Remove guide" = "Hulplijn verwijderen" +"Remove interaction" = "Interactie verwijderen" +"Remove library from this file" = "Bibliotheek uit dit bestand verwijderen" +"Remove min and max" = "Min en max verwijderen" +"Remove min and max height" = "Minimale en maximale hoogte verwijderen" +"Remove min and max width" = "Minimale en maximale breedte verwijderen" +"Remove regions" = "Gebieden verwijderen" +"Remove slot" = "Vak verwijderen" +"Remove starting point" = "Startpunt verwijderen" +"Remove stop" = "Stop verwijderen" +"Remove text from path" = "Tekst losmaken van pad" +"Remove the else and its actions" = "De else en de bijbehorende acties verwijderen" +"Remove this condition and its actions" = "Deze voorwaarde en de bijbehorende acties verwijderen" +"Remove this file from the server? It can't be shared or opened from there again. Your copy stays open here." = "Dit bestand van de server verwijderen? Het kan daarna niet meer worden gedeeld of geopend vanaf de server. Jouw kopie blijft hier open." +"Remove {name} from session" = "{name} verwijderen uit de sessie" +"Remove {name} from {server}?" = "{name} van {server} verwijderen?" +"Removed" = "Verwijderd" +"Removed from the server" = "Van de server verwijderd" +"Removed since it was marked" = "Verwijderd sinds het was gemarkeerd" +"Rename" = "Hernoemen" +"Rename duplicated layers" = "Gedupliceerde lagen hernoemen" +"Rename folder" = "Map hernoemen" +"Rename group" = "Groep hernoemen" +"Rename layers" = "Lagen hernoemen" +"Rename mode" = "Modus hernoemen" +"Rename on the server" = "Hernoemen op de server" +"Rename on the server…" = "Hernoemen op de server…" +"Rename page" = "Pagina hernoemen" +"Rename to" = "Hernoemen naar" +"Replace all" = "Alles vervangen" +"Replace mixed export settings" = "Gemengde exportinstellingen vervangen" +"Replace with" = "Vervangen door" +"Replace with a new interaction" = "Vervangen door een nieuwe interactie" +"Reply" = "Antwoorden" +"Report" = "Melden" +"Report this file…" = "Dit bestand melden…" +"Reset" = "Herstellen" +"Reset adjustments" = "Aanpassingen herstellen" +"Reset all changes" = "Alle wijzigingen terugdraaien" +"Reset all overrides on this layer" = "Alle overschrijvingen op deze laag herstellen" +"Reset overrides" = "Overschrijvingen terugzetten" +"Reset slot" = "Slot terugzetten" +"Reset this override" = "Deze overschrijving terugzetten" +"Reset to style" = "Terugzetten naar stijl" +"Reset to the inherited value" = "Terugzetten naar de overgeërfde waarde" +"Resize by the nudge amount" = "Formaat wijzigen met de stapafstand" +"Resize frames to the device's screen (or the window without a device): their constraints and auto layout respond" = "Pas het formaat van frames aan naar het scherm van het apparaat (of het venster zonder apparaat): hun constraints en auto layout reageren" +"Resize to fit" = "Formaat aanpassen aan inhoud" +"Resizing" = "Formaat wijzigen" +"Resolve" = "Oplossen" +"Resolve change" = "Wijziging oplossen" +"Resolved" = "Opgelost" +"Resources" = "Bronnen" +"Responsive" = "Responsive" +"Restart" = "Opnieuw starten" +"Restore" = "Terugzetten" +"Restore main component" = "Hoofdcomponent terugzetten" +"Restore this version" = "Deze versie terugzetten" +"Restored “{name}”" = "“{name}” teruggezet" +"Reverse the order" = "Volgorde omdraaien" +"Reversed triangle" = "Omgekeerde driehoek" +"Review and merge" = "Controleren en samenvoegen" +"Ribbon" = "Ribbon" +"Right" = "Rechts" +"Right side" = "Rechterkant" +"Right side width" = "Breedte rechterkant" +"Rotate 90°" = "90° draaien" +"Rotate 90° right" = "90° naar rechts draaien" +"Rotate to landscape" = "Draai naar liggend" +"Rotate to portrait" = "Draaien naar staand" +"Rotation" = "Rotatie" +"Rotation jitter" = "Verspreide rotatie" +"Round" = "Rond" +"Rounded" = "Rounded" +"Row" = "Rij" +"Row gap" = "Rijafstand" +"Row sizes" = "Rijgroottes" +"Row span" = "Rijbereik" +"Rows" = "Rijen" +"Rows {count}" = "Rijen {count}" +"Rulers" = "Linialen" +"Run" = "Uitvoeren" +"Run {label}" = "{label} uitvoeren" +"SHA-256: {sha}…" = "SHA-256: {sha}…" +"Same as layer" = "Zoals de laag" +"Saturation" = "Verzadiging" +"Save" = "Opslaan" +"Save as" = "Opslaan als" +"Save as preset…" = "Opslaan als preset…" +"Save files automatically" = "Bestanden automatisch opslaan" +"Save version {key}" = "Versie opslaan {key}" +"Saved" = "Opgeslagen" +"Saved {name}" = "{name} opgeslagen" +"Say something" = "Zeg iets" +"Scale" = "Schalen" +"Scatter" = "Scatter" +"Scoping: where pickers offer it" = "Bereik: waar keuzeschermen hem aanbieden" +"Screen" = "Screen" +"Scroll behavior" = "Scrollgedrag" +"Scroll to" = "Scrollen naar" +"Scroll to layer" = "Naar laag scrollen" +"Scroll with parent" = "Scrollen met bovenliggend" +"Search" = "Zoeken" +"Search actions, layers and tools" = "Zoek naar acties, lagen en tools" +"Search assets" = "Zoek assets" +"Search comments" = "Zoeken in reacties" +"Search fonts" = "Lettertypen zoeken" +"Search layers" = "Lagen doorzoeken" +"Search plugins" = "Zoeken naar plugins" +"Search shortcuts" = "Sneltoetsen zoeken" +"Search templates" = "Sjablonen zoeken" +"Section" = "Sectie" +"Section color" = "Sectiekleur" +"Sections" = "Secties" +"See all templates" = "Alle sjablonen bekijken" +"Select a frame and add a starting point to present it as a flow." = "Selecteer een frame en voeg een startpunt toe om het als flow te presenteren." +"Select a frame to preview it" = "Kies een frame voor een voorvertoning" +"Select a layer to see its properties and code" = "Selecteer een laag om de eigenschappen en de code te zien" +"Select all" = "Alles selecteren" +"Select all with same" = "Alles met hetzelfde selecteren" +"Select layer" = "Laag selecteren" +"Select layers and they space themselves as their content changes" = "Selecteer lagen en ze passen hun afstand automatisch aan als de inhoud verandert" +"Select layers to apply the style to" = "Selecteer lagen om de stijl op toe te passen" +"Select layers with this color" = "Lagen met deze kleur selecteren" +"Select overlapping shapes" = "Overlappende vormen selecteren" +"Select points to edit their position, radius and mirroring" = "Selecteer punten om hun positie, radius en spiegeling te bewerken" +"Select slot" = "Kies een slot" +"Selection" = "Selectie" +"Selection box, {w} by {h} at {x}, {y}: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Selectiekader, {w} bij {h} op {x}, {y}: pijlen verplaatsen het, Shift+pijlen of {cmd}+pijlen wijzigen het formaat, Enter selecteert, Escape annuleert" +"Selection box: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Selectiekader: pijltjes verplaatsen het, Shift+pijltjes of {cmd}+pijltjes vergroten of verkleinen het, Enter selecteert, Escape annuleert" +"Selection colors" = "Kleuren in selectie" +"Send backward" = "Naar achteren sturen" +"Send report" = "Rapport verzenden" +"Send to back" = "Naar achterste brengen" +"Sep" = "sep." +"Server address" = "Serveradres" +"Server address (ws://host:47900/)" = "Serveradres (ws://host:47900/)" +"Server for online sharing" = "Server voor online delen" +"Set as default" = "Als standaard instellen" +"Set variable" = "Variabele instellen" +"Set variable mode" = "Variabelemodus instellen" +"Set variable {name}" = "Variabele {name} instellen" +"Set {name} to {value}" = "{name} instellen op {value}" +"Shadows" = "Schaduwen" +"Shape" = "Vorm" +"Shape builder" = "Shape builder" +"Shape tools" = "Vormgereedschap" +"Share" = "Delen" +"Share this file" = "Dit bestand delen" +"Share with a code" = "Delen met een code" +"Share: live session, export" = "Delen: live-sessie, exporteren" +"Shared" = "Gedeeld" +"Shared: copy its code from the file's menu" = "Gedeeld: kopieer de code uit het menu van het bestand" +"Sharing a file needs the desktop app; here you can join one." = "Een bestand delen vereist de desktop-app; hier kun je aan één deelnemen." +"Sharing on the local network (online sharing is off: no server is set in Preferences)." = "Delen op het lokale netwerk (online delen staat uit: er is geen server ingesteld in Voorkeuren)." +"Sharing on your network · {people}" = "Delen via je netwerk · {people}" +"Sharing online · {people}" = "Delen online · {people}" +"Sharing stopped: the file stays on the server, open only to you" = "Delen gestopt: het bestand blijft op de server staan, alleen voor jou toegankelijk" +"Show" = "Weergeven" +"Show all templates" = "Alle sjablonen tonen" +"Show as grid" = "Als raster weergeven" +"Show as list" = "Weergeven als lijst" +"Show autosaves" = "Automatisch opgeslagen versies tonen" +"Show behind transparent areas" = "Weergeven achter transparante gebieden" +"Show comments (Shift+C)" = "Reacties tonen (Shift+C)" +"Show device frame" = "Apparaatframe weergeven" +"Show dimensions on objects" = "Toon afmetingen op objecten" +"Show hotspot hints" = "Hints voor hotspots tonen" +"Show in Explorer" = "Weergeven in Verkenner" +"Show in Finder" = "In Finder weergeven" +"Show in folder" = "In map tonen" +"Show only this on the canvas" = "Alleen dit op het canvas weergeven" +"Show open" = "Openstaande tonen" +"Show section contents" = "Sectie-inhoud weergeven" +"Show this layer" = "Deze laag tonen" +"Show usage" = "Gebruik weergeven" +"Show/Hide" = "Tonen/Verbergen" +"Show/Hide UI" = "UI tonen/verbergen" +"Side by side" = "Naast elkaar" +"Sidebar" = "Zijbalk" +"Simplify stroke" = "Lijn vereenvoudigen" +"Size" = "Grootte" +"Size jitter" = "Groottevariatie" +"Skip ink" = "Skip ink" +"Slashed zero" = "Nul met schuine streep" +"Slice" = "Slice" +"Slices" = "Slices" +"Slide in" = "Inschuiven" +"Slide out" = "Uitschuiven" +"Slot" = "Slot" +"Slot content" = "Slotinhoud" +"Small capitals" = "Kapitelen" +"Small caps" = "Kleine kapitalen" +"Smart animate" = "Smart animate" +"Snap to pixel grid" = "Uitlijnen op pixelraster" +"Social and slides" = "Sociale media en dia's" +"Social media" = "Sociale media" +"Social post sizes" = "Maten voor sociale posts" +"Soft light" = "Soft light" +"Solid" = "Effen" +"Some variants have the same property values: give each one a unique combination" = "Sommige varianten hebben dezelfde eigenschapswaarden: geef elke variant een unieke combinatie" +"Sort" = "Sorteren" +"Sort by" = "Sorteren op" +"Sort by date" = "Op datum sorteren" +"Sort by page" = "Sorteren op pagina" +"Sort by {column}" = "Sorteren op {column}" +"Space around" = "Ruimte rondom" +"Space between" = "Ruimte ertussen" +"Space drag" = "Slepen met de spatiebalk" +"Space evenly" = "Gelijkmatig verdelen" +"Space+drag" = "Space+drag" +"Spacing" = "Afstand" +"Spam, stolen work, abuse…" = "Spam, gestolen werk, misbruik…" +"Splay" = "Splay" +"Spotlight me" = "Spotlight mij" +"Spread" = "Spread" +"Square" = "Vierkant" +"Standard" = "Standaard" +"Standard ligatures" = "Standaardligaturen" +"Star" = "Ster" +"Stars" = "Stars" +"Start" = "Start" +"Start ascending from / stop descending at" = "Begin oplopend vanaf / stop aflopend bij" +"Start from a blank canvas" = "Begin vanaf een leeg canvas" +"Start from a template" = "Begin met een sjabloon" +"Start on path" = "Begin op het pad" +"Start point" = "Startpunt" +"Start sharing" = "Delen starten" +"Start sharing with the Share button, then pass on the code it gives" = "Begin met delen via de knop Delen en geef daarna de code door die je krijgt" +"Starting to share…" = "Bezig met delen…" +"Status" = "Status" +"Sticky" = "Sticky" +"Stop" = "Stoppen" +"Stop following {name}" = "Stop met {name} te volgen" +"Stop session" = "Sessie stoppen" +"Stop sharing" = "Stoppen met delen" +"Stop spotlighting" = "Stop met uitlichten" +"Stop {n} {hex}" = "Stop {n} {hex}" +"Stretch" = "Uitrekken" +"Strikethrough" = "Doorstrepen" +"String" = "Tekenreeks" +"Stroke" = "Lijn" +"Stroke style" = "Lijnstijl" +"Stroke weight" = "Lijndikte" +"Strokes" = "Lijnen" +"Style" = "Stijl" +"Styles" = "Stijlen" +"Stylistic set 1" = "Stilistische set 1" +"Stylistic set 2" = "Stylistische set 2" +"Stylistic set 3" = "Stylistische set 3" +"Stylistic set 4" = "Stilistische set 4" +"Stylistic set 5" = "Stilistische set 5" +"Subtract" = "Subtract" +"Subtracts" = "Trekt af" +"Suffix" = "Achtervoegsel" +"Suspend snapping while dragging" = "Uitlijning opschorten tijdens het slepen" +"Swap instance" = "Instance verwisselen" +"Swap library: use another library's assets of the same names" = "Bibliotheek verwisselen: assets met dezelfde namen uit een andere bibliotheek gebruiken" +"Swap orientation" = "Oriëntatie verwisselen" +"Swap overlay" = "Overlay verwisselen" +"Swap to {name}" = "Wisselen naar {name}" +"Swap width and height" = "Breedte en hoogte omwisselen" +"Swapped instance" = "Verwisselde instance" +"Swapped {n} assets" = { one = "{n} asset verwisseld", other = "{n} assets verwisseld" } +"Swapped {n} assets; {missed} had no match and still use the old library" = { one = "{n} asset verwisseld; {missed} had geen overeenkomst en gebruikt nog de oude bibliotheek", other = "{n} assets verwisseld; {missed} hadden geen overeenkomst en gebruiken nog de oude bibliotheek" } +"Sweep" = "Sweep" +"System" = "Systeem" +"Tab / Shift+Tab" = "Tab / Shift+Tab" +"Table" = "Tabel" +"Tablet" = "Tablet" +"Tabular numbers" = "Tabulaire cijfers" +"Take the values from the first selected layer" = "Waarden van de eerste geselecteerde laag overnemen" +"Taper" = "Taper" +"Taper both ends" = "Beide uiteinden versmallen" +"Tell the server's operator what is wrong with it" = "Vertel de beheerder van de server wat er mis mee is" +"Temperature" = "Temperatuur" +"Template" = "Sjabloon" +"Templates" = "Sjablonen" +"Terms" = "Voorwaarden" +"Text" = "Tekst" +"Text align" = "Tekstuitlijning" +"Text content" = "Tekstinhoud" +"Text style" = "Tekststijl" +"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 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." +"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." = "Het bestand wordt van de server verwijderd: niemand kan het daar nog openen of eraan deelnemen, en dit kan niet ongedaan worden gemaakt. Kopieën die open zijn, blijven bij wie ze heeft." +"The file now holds another library" = "Het bestand bevat nu een andere bibliotheek" +"The file now holds another library (\"{name}\")" = "Het bestand bevat nu een andere bibliotheek (\"{name}\")" +"The files you shared or published online from this computer. They stay on their server until you remove them." = "De bestanden die je vanaf deze computer online hebt gedeeld of gepubliceerd. Ze blijven op hun server totdat je ze verwijdert." +"The link carries the session's secret: share it only with people you invite." = "De link bevat het geheim van de sessie: deel hem alleen met mensen die je uitnodigt." +"The name in your online files and on the server. The document inside keeps its own name." = "De naam in je online bestanden en op de server. Het document erin behoudt zijn eigen naam." +"The selection uses several text styles: click to apply one" = "De selectie gebruikt meerdere tekststijlen: klik om er een toe te passen" +"The server deletes this file if nobody opens it before {date}." = "De server verwijdert dit bestand als niemand het vóór {date} opent." +"The whole file" = "Het hele bestand" +"Theme" = "Thema" +"There's no destination for that action" = "Er is geen doel voor die actie" +"Thickness" = "Dikte" +"This branch can't be reviewed: {e}" = "Deze branch kan niet worden beoordeeld: {e}" +"This branch was merged or archived." = "Deze branch is samengevoegd of gearchiveerd." +"This computer only" = "Alleen op deze computer" +"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." = "Deze computer onthoudt het eigenaartoken, zodat het bestand beheerd kan worden vanuit de Online-lijst op het beginscherm. Kopieer het om het bestand vanaf een andere plek te beheren: het is het wachtwoord voor dit bestand en wordt niet opnieuw weergegeven." +"This condition is edited as an expression" = "Deze voorwaarde wordt als expressie bewerkt" +"This file" = "Dit bestand" +"This file has unsaved changes" = "Dit bestand heeft niet-opgeslagen wijzigingen" +"This file is on {server}, open only to you. Share it to let others in with a new code." = "Dit bestand staat op {server}, alleen toegankelijk voor jou. Deel het om anderen binnen te laten met een nieuwe code." +"This frame is new on the branch." = "Dit frame is nieuw op de branch." +"This frame isn't on the branch." = "Dit frame staat niet op de branch." +"This server is open to the public: no key needed." = "Deze server is voor iedereen toegankelijk: geen sleutel nodig." +"This server needs its key: add ?key=… to the address (`figcraft-server key` prints it on the server's machine)." = "Deze server heeft een sleutel nodig: voeg ?key=… toe aan het adres (`figcraft-server key` toont die op de computer van de server)." +"This server takes files only with its key: see Advanced." = "Deze server accepteert bestanden alleen met de bijbehorende sleutel: zie Geavanceerd." +"Tidy up" = "Opruimen" +"Tile" = "Tegelen" +"Tile type" = "Tegeltype" +"Tint" = "Tint" +"Title" = "Titel" +"Title case" = "Hoofdletter per woord" +"To share this library with your team, publish the file to a server (Share ▸ Publish to server…), then publish the library there." = "Om deze bibliotheek met je team te delen, publiceer het bestand naar een server (Delen ▸ Publiceren naar server…), publiceer daarna de bibliotheek." +"Toggle" = "Omschakelen" +"Toggle light/dark theme" = "Wisselen tussen licht/donker thema" +"Toggle visibility" = "Zichtbaarheid omschakelen" +"Tools" = "Gereedschappen" +"Top" = "Boven" +"Top & bottom" = "Boven & onder" +"Top left radius" = "Radius linksboven" +"Top right radius" = "Hoekradius rechtsboven" +"Transform" = "Transformeren" +"Triangle arrow" = "Driehoekspijl" +"Trigger" = "Trigger" +"True" = "Waar" +"Truncate text" = "Tekst afkappen" +"Truncate with an ellipsis" = "Afkappen met een beletselteken" +"Try again" = "Probeer het opnieuw" +"Try another search or filter." = "Probeer een andere zoekopdracht of filter." +"Try another word, or look at every kind." = "Probeer een ander woord, of bekijk alle soorten." +"Turn a layer into a component, reuse it, and change every copy at once" = "Maak van een laag een component, hergebruik die en verander alle kopieën tegelijk" +"Two digits" = "Twee cijfers" +"Type" = "Type" +"Type settings" = "Tekstinstellingen" +"Type the join code you were given, or paste an invite link." = "Typ de toegangscode die je hebt gekregen, of plak een uitnodigingslink." +"Typography" = "Typografie" +"Underline" = "Onderstrepen" +"Undo takes back only your own changes; what others changed since stays." = "Ongedaan maken zet alleen je eigen wijzigingen terug; wat anderen sindsdien hebben gewijzigd, blijft staan." +"Ungroup" = "Groep opheffen" +"Uniform" = "Gelijkmatig" +"Union" = "Union" +"Unions" = "Unies" +"Unknown — treated as sRGB" = "Onbekend — behandeld als sRGB" +"Unread" = "Ongelezen" +"Unresolve" = "Oplossing ongedaan maken" +"Unsaved changes" = "Niet-opgeslagen wijzigingen" +"Unsaved changes in {names}. Close the window and lose them?" = "Niet-opgeslagen wijzigingen in {names}. Het venster sluiten en ze verliezen?" +"Unsaved changes: save first ({save}), or close the tab with {alt}-click to discard" = "Niet-opgeslagen wijzigingen: sla eerst op ({save}), of sluit het tabblad met {alt}-klik om ze te verwerpen" +"Unsaved changes: save first, or close again with {key} to discard" = "Niet-opgeslagen wijzigingen: sla eerst op, of sluit nogmaals met {key} om te verwerpen" +"Up" = "Omhoog" +"Update" = "Bijwerken" +"Update from main" = "Bijwerken vanaf main" +"Update from selection" = "Bijwerken vanuit de selectie" +"Update plugin" = "Plugin bijwerken" +"Updated {components} and {styles}" = "{components} en {styles} bijgewerkt" +"Updated {name}" = "{name} bijgewerkt" +"Updating the graphics driver often helps. To use OpenGL only, start FigCraft from a Command Prompt with:" = "Het bijwerken van de grafische driver helpt vaak. Om alleen OpenGL te gebruiken, start je FigCraft vanaf de Opdrachtprompt met:" +"Updating the graphics driver often helps. WGPU_BACKEND (vulkan, gl, metal) names another graphics API to try." = "Het bijwerken van de grafische driver helpt vaak. WGPU_BACKEND (vulkan, gl, metal) noemt een andere grafische API om te proberen." +"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." = "Uploadt dit bestand naar een FigCraft-server en houdt dit tabblad daarmee gesynchroniseerd. Je krijgt een link om te bewerken en een link om te bekijken." +"Uppercase" = "Hoofdletters" +"Use a fixed value" = "Gebruik een vaste waarde" +"Use an expression, e.g. count + 1" = "Gebruik een expressie, bijv. count + 1" +"Use as mask" = "Gebruiken als masker" +"Use auto layout" = "Auto layout gebruiken" +"Use number keys for opacity" = "Gebruik cijfertoetsen voor dekking" +"Use the .figcraft or .fig extension." = "Gebruik de extensie .figcraft of .fig." +"Use the layer's fill" = "De vulling van de laag gebruiken" +"Used in {files} · {instances}" = "Gebruikt in {files} · {instances}" +"Username" = "Gebruikersnaam" +"Uses variables: each layer shows them in its own mode" = "Gebruikt variabelen: elke laag toont ze in zijn eigen modus" +"Value" = "Waarde" +"Variable" = "Variabele" +"Variable collections" = "Verzamelingen van variabelen" +"Variable modes" = "Variabelemodi" +"Variable width" = "Variabele breedte" +"Variables" = "Variabelen" +"Variables JSON…" = "Variabelen-JSON…" +"Variables store reusable values (colours, numbers, strings, booleans) with modes such as Light and Dark." = "Variabelen slaan herbruikbare waarden (kleuren, getallen, tekenreeksen, booleans) op met modi zoals Light en Dark." +"Variant" = "Variant" +"Vector" = "Vector" +"Vectors" = "Vectoren" +"Version" = "Versie" +"Version history" = "Versiegeschiedenis" +"Version {version}" = "Versie {version}" +"Version {v} · {components} · {styles} · {variables}" = "Versie {v} · {components} · {styles} · {variables}" +"Vertical" = "Verticaal" +"Vertical align" = "Verticaal uitlijnen" +"Vertical hex" = "Verticale hex" +"Vertical padding" = "Verticale padding" +"Vertical spacing" = "Verticale afstand" +"Vertical trim" = "Verticaal bijsnijden" +"View" = "Weergave" +"View link" = "Weergavelink" +"View link copied" = "Weergavelink gekopieerd" +"View only" = "Alleen weergeven" +"View only: you see every change as it happens but can't edit. Leave to keep a copy you can edit." = "Alleen weergeven: je ziet elke wijziging live terwijl die plaatsvindt, maar je kunt niet bewerken. Verlaat de sessie om een kopie te bewaren die je kunt bewerken." +"Viewing “{name}”" = "“{name}” bekijken" +"Violet" = "Violet" +"Visibility" = "Zichtbaarheid" +"Visible" = "Zichtbaar" +"Vivid" = "Vivid" +"WGPU_BACKEND is set and names the graphics API to use; unsetting it lets FigCraft choose." = "WGPU_BACKEND is ingesteld en geeft de te gebruiken grafische API aan; als je het uitzet, kiest FigCraft zelf." +"Warm" = "Warm" +"Watch" = "Watch" +"Wavy" = "Golvend" +"Web" = "Web" +"WebSocket URL" = "WebSocket-URL" +"WebSocket URL copied" = "WebSocket-URL gekopieerd" +"Websites" = "Websites" +"Wedge" = "Wedge" +"Weight" = "Dikte" +"What changed since it was marked ready for dev" = "Wat er veranderd is sinds het is gemarkeerd als klaar voor Dev Mode" +"What is wrong with this file? The server's operator gets your report." = "Wat klopt er niet aan dit bestand? Je melding gaat naar de beheerder van de server." +"What it's for" = "Waarvoor het dient" +"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." = "Vanwaar dit is veranderd, is niet bekend: het veranderde voordat FigCraft een kopie bewaarde van dev-klare frames. Los de wijziging op (of markeer het weer als te vergelijken) om vanaf nu te kunnen vergelijken." +"What you try here changes this preview and the code below, not the file" = "Wat je hier probeert, wijzigt deze voorvertoning en de code hieronder, niet het bestand" +"While hovering" = "Tijdens het aanwijzen" +"While pressing" = "Tijdens het indrukken" +"White" = "Wit" +"Who runs it, its terms and how long it keeps files" = "Wie het beheert, de voorwaarden en hoelang het bestanden bewaart" +"Why it changed" = "Waarom het is veranderd" +"Widget" = "Widget" +"Widgets" = "Widgets" +"Width" = "Breedte" +"Width point" = "Breedtepunt" +"Width profile" = "Breedteprofiel" +"Wireframe kit" = "Wireframekit" +"With the layers' export settings" = "Met de exportinstellingen van de lagen" +"Wrap" = "Omloop" +"Wrap in new section" = "Inpakken in een nieuwe sectie" +"Yellow" = "Geel" +"Yesterday" = "Gisteren" +"You" = "Jij" +"You'll get the shared file as a new tab and edit it together." = "Je krijgt het gedeelde bestand als nieuw tabblad en bewerkt het samen." +"You're spotlighting: everyone follows your view" = "Je bent in de spotlight: iedereen volgt jouw weergave" +"Your copy of the file stays open" = "Je kopie van het bestand blijft open" +"Your copy stays open; the file stays on the server" = "Jouw kopie blijft open; het bestand blijft op de server" +"Your name" = "Jouw naam" +"Your name in comments" = "Je naam in reacties" +"Your system asks for reduced motion: animations stay off." = "Jouw systeem vraagt om minder beweging: animaties blijven uit." +"Z" = "Z" +"Z to A" = "Z tot A" +"Zoom" = "Zoom" +"Zoom around the pointer" = "Inzoomen rond de aanwijzer" +"Zoom device to fill window" = "Apparaat inzoomen om het venster te vullen" +"Zoom in" = "Inzoomen" +"Zoom out" = "Uitzoomen" +"Zoom to 100%" = "Zoomen naar 100%" +"Zoom to 200%" = "Inzoomen op 200%" +"Zoom to 50%" = "Zoomen naar 50%" +"Zoom to fit" = "Inpassen" +"Zoom to selection" = "Inzoomen op selectie" +"Zoom tool: click to zoom in, drag an area" = "Zoomgereedschap: klik om in te zoomen, sleep om een gebied te selecteren" +"Zoom tool: zoom out" = "Zoomgereedschap: uitzoomen" +"and {n} more" = { one = "en {n} meer", other = "en {n} meer" } +"bleed marks" = "afloopmarkeringen" +"by {author}" = "door {author}" +"call any command its access allows" = "elke opdracht aanroepen die diens toegang toestaat" +"call only: {commands}" = "alleen aanroepbaar: {commands}" +"can edit the document" = "kan het document bewerken" +"conditional prototype actions nested too deeply were skipped" = "Voorwaardelijke prototype-acties die te diep genest zijn, zijn overgeslagen" +"conditional prototype actions with conditions that can't be evaluated were skipped" = "voorwaardelijke prototypeacties met voorwaarden die niet konden worden geëvalueerd zijn overgeslagen" +"connector label background was skipped: style data is missing" = "achtergrond van connectorlabel overgeslagen: stijldata ontbreekt" +"connector label was skipped: background bounds are invalid" = "connectorlabel is overgeslagen: achtergrondgrenzen zijn ongeldig" +"connector label was skipped: background transform is invalid" = "connector labels overgeslagen: achtergrondtransformatie is ongeldig" +"connector label was skipped: composed text transform is invalid" = "connectorlabel is overgeslagen: samengestelde teksttransformatie is ongeldig" +"connector label was skipped: derived background bounds are missing" = "connectorlabel is overgeslagen: afgeleide achtergrondgrenzen ontbreken" +"connector label was skipped: derived text bounds are missing" = "connectorlabel is overgeslagen: afgeleide tekstgrenzen ontbreken" +"connector label was skipped: text bounds are invalid" = "connectorlabel overgeslagen: de tekstafmetingen zijn ongeldig" +"connector label was skipped: text style data is missing" = "connectorlabel is overgeslagen: tekststijlgegevens ontbreken" +"connector label was skipped: text transform is invalid" = "Het label van de verbinding is overgeslagen: de teksttransformatie is ongeldig" +"connector labels were skipped" = "labels van connectoren zijn overgeslagen" +"connector layers import as static frame/vector snapshots with labels when present; live endpoint bindings are not retained" = "connectorlagen worden geïmporteerd als statische frame-/vectormomentopnames met labels indien aanwezig; live eindpuntkoppelingen worden niet behouden" +"connector snapshot vector data is missing; connector was left empty" = "vectordata in de connector-snapshot ontbreekt; connector is leeggelaten" +"connectors whose ends can't be placed are empty" = "connectors waarvan de uiteinden niet geplaatst kunnen worden zijn leeg" +"crop marks" = "snijmarkeringen" +"damaged vector geometry was skipped" = "beschadigde vectorgeometrie is overgeslagen" +"damaged vector networks import as outlines" = "beschadigde vectornetwerken worden geïmporteerd als outlines" +"development: {path}" = "ontwikkeling: {path}" +"document children other than pages were skipped" = "documentkinderen anders dan pagina's zijn overgeslagen" +"duplicate grid track sizing entries use equal tracks" = "Dubbele vermeldingen voor trackgroottes gebruiken gelijke tracks" +"e.g. count + 1" = "bijv. count + 1" +"e.g. count >= 3 and not done" = "bijv. aantal >= 3 en niet klaar" +"elbowed and curved connectors without a saved path import as straight lines" = "haakse en gebogen connectors zonder opgeslagen pad worden geïmporteerd als rechte lijnen" +"entries without a node type were skipped" = "items zonder node-type zijn overgeslagen" +"figcraft:// links from a browser, chat or email open this app and join the session." = "figcraft://-links uit een browser, chat of e-mail openen deze app en laten je deelnemen aan de sessie." +"filled areas of a vector with their own fill use the layer's fill" = "gevulde gebieden van een vector met een eigen vulling gebruiken de vulling van de laag" +"from {server}" = "van {server}" +"gamepad triggers without exactly one known controller button were skipped" = "gamepad-triggers zonder precies één bekende controllerknop zijn overgeslagen" +"grid track list exceeds 1000 entries; the tracks use the default equal sizing" = "de lijst met rastertracks overschrijdt 1000 items; de tracks gebruiken de standaard gelijke grootte" +"grid track sizing is unsupported or malformed; affected tracks use equal sizing" = "Trackgrootte wordt niet ondersteund of is ongeldig opgemaakt; de betreffende tracks gebruiken gelijke groottes" +"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "de lijst met maten voor rastertracks bevat meer dan 1000 items; de tracks gebruiken de standaard gelijke maat" +"hidden" = "verborgen" +"iOS" = "iOS" +"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "afbeeldingsfilters zijn dubbelzinnig omdat beide filtercontainers aanwezig zijn; filterconversie is overgeslagen" +"image filters use FigCraft's approximate renderer" = "afbeeldingsfilters gebruiken de benaderende renderer van FigCraft" +"instance swap properties whose default component isn't in the file were skipped" = "instance-swap-eigenschappen waarvan de standaardcomponent niet in het bestand zit, zijn overgeslagen" +"instances inside their own main component were imported as frames" = "instances in hun eigen hoofdcomponent zijn geïmporteerd als frames" +"instances of components that aren't in the file show no layers" = "instances van components die niet in het bestand staan, tonen geen lagen" +"instances of components that aren't in the file were imported as frames" = "instances van componenten die het bestand niet bevat zijn als frames geïmporteerd" +"instances that would nest a component inside itself were imported as frames" = "Instanties die een component in zichzelf zouden nesten, zijn als frames geïmporteerd" +"instances without a main component were imported as empty frames" = "instances zonder hoofdcomponent zijn geïmporteerd als lege frames" +"invalid internal .fig text path data was ignored" = "ongeldige padgegevens van interne .fig-tekst zijn genegeerd" +"invalid or oversized vector networks import as outlines" = "ongeldige of te grote vectornetwerken worden geïmporteerd als contouren" +"invalid or oversized vector path data was skipped" = "ongeldige of te grote vectorpadgegevens zijn overgeslagen" +"just now" = "zojuist" +"key triggers without a supported key were skipped" = "key-triggers zonder een ondersteunde toets zijn overgeslagen" +"key up triggers import as key presses" = "key-up-triggers worden geïmporteerd als toetsaanslagen" +"layers without a position were placed at their parent's origin" = "lagen zonder positie zijn op de oorsprong van het bovenliggende element geplaatst" +"layers without a type were skipped" = "lagen zonder type zijn overgeslagen" +"legacy image filter container is unsupported; filter conversion was skipped" = "Verouderde container voor beeldfilters wordt niet ondersteund; filterconversie is overgeslagen" +"locked" = "vergrendeld" +"malformed image filters container was skipped" = "misvormde container met afbeeldingsfilters is overgeslagen" +"malformed image paintFilter container was skipped" = "onjuist gevormde image paintFilter-container is overgeslagen" +"malformed slot content assignment was skipped" = "onjuiste toewijzing van slot-inhoud is overgeslagen" +"no bleed" = "geen afloop" +"nobody else here yet" = "nog niemand anders hier" +"non-default slot settings are not represented and were skipped" = "niet-standaard slot-instellingen zijn niet overgenomen en zijn overgeslagen" +"now" = "nu" +"or" = "of" +"point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "Lijnverbindingen op punten zijn behouden; gestreepte lijnen of lijnen met variabele breedte worden weergegeven met de verbinding van de laag" +"preferred slot component keys cannot be resolved to file nodes and were skipped" = "voorkeurssleutels van slotcomponenten konden niet naar bestandsknooppunten worden herleid en zijn overgeslagen" +"prototype actions of unknown types were skipped" = "prototypeacties van onbekende typen zijn overgeslagen" +"prototype actions without a destination in the file were skipped" = "prototype-acties zonder bestemming in het bestand zijn overgeslagen" +"prototype expressions on variables that aren't in the variables JSON were skipped" = "prototype-expressies over variabelen die niet in de variables-JSON staan zijn overgeslagen" +"prototype expressions with unsupported functions were skipped" = "prototype-expressies met niet-ondersteunde functies zijn overgeslagen" +"prototype interactions without supported actions were skipped" = "prototype-interacties zonder ondersteunde acties zijn overgeslagen" +"prototype navigations of unknown types were skipped" = "prototype-navigaties van onbekende typen zijn overgeslagen" +"prototype transitions of unknown types play instantly" = "prototype-overgangen van onbekende typen worden direct afgespeeld" +"prototype triggers of unknown types were skipped" = "prototype-triggers van onbekende typen zijn overgeslagen" +"put a widget on the canvas" = "een widget op het canvas zetten" +"read and edit the document" = "het document lezen en bewerken" +"read the document" = "lees het document" +"reads the document" = "leest het document" +"set-variable actions on variables that aren't in the variables JSON were skipped" = "set-variable-acties op variabelen die niet in de variables-JSON staan zijn overgeslagen" +"set-variable actions with values that can't be evaluated were skipped" = "set-variable-acties met waarden die niet kunnen worden geëvalueerd zijn overgeslagen" +"set-variable actions with values that don't fit the variable were skipped" = "set-variable-acties met waarden die niet in de variabele passen, zijn overgeslagen" +"set-variable actions without a value were skipped" = "set-variable-acties zonder waarde zijn overgeslagen" +"set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "set-variable-mode-acties op verzamelingen of modi die niet in de variables JSON staan, zijn overgeslagen" +"slot content assignment target is missing or is not slot content" = "het toewijzingsdoel van slotcontent ontbreekt of is geen slotcontent" +"slot content assignment uses the empty GUID sentinel and was skipped" = "Toewijzing van slot-inhoud gebruikt de lege GUID-sentinelwaarde en is overgeslagen" +"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "sommige vectorpunten verwijzen naar puntinstellingen die ontbreken in het bestand; ze gebruiken de verbindingen van de laag en gewone hoeken" +"some vector segments refer to style settings missing from the file; they use the layer's stroke" = "sommige vectorsegmenten verwijzen naar stijlinstellingen die in het bestand ontbreken; ze gebruiken de lijn van de laag" +"stale or invalid grid track sizing entries were ignored" = "verouderde of ongeldige items voor de trackgroottes van het raster zijn genegeerd" +"stars and polygons without point counts or geometry use the default point count" = "sterren en veelhoeken zonder puntaantallen of geometrie gebruiken het standaardpuntaantal" +"style settings of some vector segments aren't supported; those segments use the layer's stroke" = "stijlinstellingen van sommige vectorsegmenten worden niet ondersteund; die segmenten gebruiken de lijn van de laag" +"text path underline or strikethrough decoration is not rendered" = "onderstreep- of doorhaaldecoratie op een tekstpad wordt niet weergegeven" +"text style overrides refer to missing table entries" = "tekststijl-overschrijvingen verwijzen naar ontbrekende tabelitems" +"the file has no pages" = "het bestand heeft geen pagina's" +"the plugin" = "de plugin" +"the variables JSON has no `variableCollections` (expected the local variables response) and was ignored" = "De variabelen-JSON bevat geen `variableCollections` (de respons van lokale variabelen was verwacht) en is genegeerd" +"this session only" = "alleen voor deze sessie" +"unknown component property types were skipped" = "componenteigenschappen van onbekende typen zijn overgeslagen" +"variable aliases to variables that aren't in the variables JSON (or of another type) were skipped" = "variabele-aliassen naar variabelen die niet in de variables JSON zitten (of van een ander type zijn) zijn overgeslagen" +"variable bindings to properties the layer doesn't have were skipped" = "variabelekoppelingen naar eigenschappen die de laag niet heeft zijn overgeslagen" +"variable bindings to variables that aren't in the variables JSON (library variables) were skipped" = "variabelekoppelingen naar variabelen die niet in de variabelen-JSON zitten (bibliotheekvariabelen) zijn overgeslagen" +"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)" = "variabelekoppelingen zijn overgeslagen: de bestands-JSON bevat geen variabelendefinities (geef de JSON van lokale variabelen mee als `variables`, of voeg de `meta` ervan naast de bestands-JSON in)" +"variable bindings whose variable type doesn't fit the property were skipped" = "variabelekoppelingen waarvan het variabeletype niet bij de eigenschap past zijn overgeslagen" +"variable collections without modes were skipped" = "variabeleverzamelingen zonder modi zijn overgeslagen" +"variable mode lookups in prototype expressions that aren't a variable and one of its modes were skipped" = "opzoekingen in prototype-expressies naar andere combinaties dan een variabele en een van zijn modi zijn overgeslagen" +"variable modes of collections that aren't in the file were skipped" = "Variabelemodi van verzamelingen die niet in het bestand staan, zijn overgeslagen" +"variable modes of collections that aren't in the variables JSON were skipped" = "variabelemodi van verzamelingen die niet in de variables-JSON staan zijn overgeslagen" +"variable values that don't match their type (or composed colours) were skipped" = "waarden van variabelen die niet bij hun type passen (of samengestelde kleuren) zijn overgeslagen" +"variables of unknown types were skipped" = "variabelen van onbekende typen zijn overgeslagen" +"variables whose collection isn't in the variables JSON were skipped" = "variabelen waarvan de verzameling niet in de variables-JSON zit zijn overgeslagen" +"variables without readable values were skipped" = "variabelen zonder leesbare waarde zijn overgeslagen" +"vector points with unknown stroke joins use the layer join" = "vectorpunten met onbekende lijnverbindingen gebruiken de verbinding van de laag" +"vectors without geometry are empty" = "vectoren zonder geometrie zijn leeg" +"vectors without geometry are empty (export the file JSON with geometry=paths)" = "vectoren zonder geometrie zijn leeg (exporteer de bestands-JSON met geometry=paths)" +"very long text was cut to 1,048,576 characters" = "zeer lange tekst is ingekort tot 1.048.576 tekens" +"very long vector paths were skipped" = "Zeer lange vectorpaden zijn overgeslagen" +"video actions are not supported and were skipped" = "videoacties worden niet ondersteund en zijn overgeslagen" +"video triggers are not supported and were skipped" = "videotriggers worden niet ondersteund en zijn overgeslagen" +"yesterday" = "gisteren" +"{instances} in {files}" = "{instances} in {files}" +"{language}: draft translation, waiting for a native speaker's review." = "{language}: voorlopige vertaling, wacht op controle door een moedertaalspreker." +"{length} bleed" = "{length} afloop" +"{month} {day}, {year}" = "{day} {month} {year}" +"{name} (from {library})" = "{name} (uit {library})" +"{name} (you)" = "{name} (jij)" +"{name} ({layers} layers)" = "{name} ({layers} lagen)" +"{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}, standaard {default}. Dubbelklik op de schuifregelaar om terug te gaan naar de waarde van de stijl; Escape tijdens het slepen annuleert." +"{name} cleared from the list" = "{name} uit de lijst verwijderd" +"{name} from {path}" = "{name} uit {path}" +"{name} is forgotten on this computer; the file stays on {server}" = "{name} is op deze computer vergeten; het bestand blijft op {server}" +"{name} is on the server." = "{name} staat op de server." +"{name} is spotlighting" = "{name} staat in de spotlight" +"{name} was removed from the server" = "{name} is van de server verwijderd" +"{name} · deleted on main" = "{name} · verwijderd op main" +"{name} · deleted on the branch" = "{name} · verwijderd op de branch" +"{name} · not published" = "{name} · niet gepubliceerd" +"{name} · on a server" = "{name} · op een server" +"{name} · published version {v}" = "{name} · gepubliceerde versie {v}" +"{name} · version {v} on the server" = "{name} · versie {v} op de server" +"{name}, in a live session" = "{name}, in een live sessie" +"{name}, online, open only to you" = "{name}, online, alleen voor jou toegankelijk" +"{name}, {kind}, {w} by {h}, selected" = "{name}, {kind}, {w} bij {h}, geselecteerd" +"{name}\nClick to apply to the selection" = "{name}\nKlik om op de selectie toe te passen" +"{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}\nSleep naar het canvas, of klik om in het midden van de weergave te plaatsen.\nHoud Alt (Option) ingedrukt terwijl je op een instance loslaat om die te verwisselen." +"{n} added" = { one = "{n} toegevoegd", other = "{n} toegevoegd" } +"{n} autosave versions" = { one = "{n} automatisch opgeslagen versie", other = "{n} automatisch opgeslagen versies" } +"{n} changed" = { one = "{n} gewijzigd", other = "{n} gewijzigd" } +"{n} columns" = { one = "{n} kolom", other = "{n} kolommen" } +"{n} components" = { one = "{n} component", other = "{n} componenten" } +"{n} components and styles have newer versions" = { one = "{n} component of stijl heeft een nieuwere versie", other = "{n} components en stijlen hebben nieuwere versies" } +"{n} conflicts to resolve" = { one = "{n} conflict om op te lossen", other = "{n} conflicten om op te lossen" } +"{n} days ago" = { one = "{n} dag geleden", other = "{n} dagen geleden" } +"{n} files" = { one = "{n} bestand", other = "{n} bestanden" } +"{n} hours ago" = { one = "{n} uur geleden", other = "{n} uur geleden" } +"{n} instances" = { one = "{n} instance", other = "{n} instances" } +"{n} layers" = { one = "{n} laag", other = "{n} lagen" } +"{n} layers as one file" = { one = "{n} laag als één bestand", other = "{n} lagen als één bestand" } +"{n} layers selected" = { one = "{n} laag geselecteerd", other = "{n} lagen geselecteerd" } +"{n} layers · {parts}" = { one = "{n} laag · {parts}", other = "{n} lagen · {parts}" } +"{n} matches" = { one = "{n} overeenkomst", other = "{n} overeenkomsten" } +"{n} minutes ago" = { one = "{n} minuut geleden", other = "{n} minuten geleden" } +"{n} months ago" = { one = "{n} maand geleden", other = "{n} maanden geleden" } +"{n} more notes omitted from this report" = { one = "{n} extra notitie weggelaten uit dit rapport", other = "{n} extra notities weggelaten uit dit rapport" } +"{n} of {total}" = "{n} van {total}" +"{n} people joined" = { one = "{n} persoon is erbij gekomen", other = "{n} personen zijn erbij gekomen" } +"{n} preferred components" = { one = "{n} voorkeurscomponent", other = "{n} voorkeurscomponenten" } +"{n} ready" = { one = "{n} klaar", other = "{n} klaar" } +"{n} removed" = { one = "{n} verwijderd", other = "{n} verwijderd" } +"{n} replies" = { one = "{n} antwoord", other = "{n} antwoorden" } +"{n} rows" = { one = "{n} rij", other = "{n} rijen" } +"{n} styles" = { one = "{n} stijl", other = "{n} stijlen" } +"{n} variables" = { one = "{n} variabele", other = "{n} variabelen" } +"{n} weeks ago" = { one = "{n} week geleden", other = "{n} weken geleden" } +"{n} years ago" = { one = "{n} jaar geleden", other = "{n} jaar geleden" } +"{n}d" = "{n}d" +"{n}h" = "{n}h" +"{n}m" = "{n}m" +"{n}w" = "{n}w" +"{page}, nothing selected" = "{page}, niets geselecteerd" +"{profile} (current)" = "{profile} (huidig)" +"{property} is its value; {property ? \"a\" : \"b\"} picks a string. Other {…} stays as written." = "{property} is de waarde ervan; {property ? \"a\" : \"b\"} kiest een string. Andere {…} blijven letterlijk staan." +"{server} can't say what became of your files (it is older than this app)." = "{server} kan niet zeggen wat er met je bestanden is gebeurd (deze is ouder dan deze app)." +"{server} · No longer on the server" = "{server} · Niet meer op de server" +"{server} · {shared} · Opened {date}" = "{server} · {shared} · Geopend op {date}" +"{tool} hold {key}" = "{tool} {key} ingedrukt houden" +"{value} isn't a colour" = "{value} is geen kleur" +"{when} · edited" = "{when} · bewerkt" +"←" = "←" +"← ↑ → ↓" = "← ↑ → ↓" +"← → ↑ ↓" = "← → ↑ ↓" +"→, Space or N" = "→, Spatie of N" +"↵" = "↵" +"⇥ / ⇧⇥" = "⇥ / ⇧⇥" +"⌘ arrows" = "⌘ arrows" +"⌘ click" = "⌘ click" +"⌘ scroll" = "⌘ scroll" +"⌥ drag" = "⌥ drag" + +[commands] +"align.bottom" = "Onder uitlijnen" +"align.hcenter" = "Horizontale middens uitlijnen" +"align.left" = "Links uitlijnen" +"align.right" = "Rechts uitlijnen" +"align.top" = "Boven uitlijnen" +"align.vcenter" = "Verticale middens uitlijnen" +"annotation.add" = "Annotatie toevoegen" +"annotation.addCategory" = "Annotatiecategorie toevoegen" +"annotation.categories" = "Annotatiecategorieën" +"annotation.edit" = "Annotatie bewerken" +"annotation.editCategory" = "Annotatiecategorie bewerken" +"annotation.list" = "Annotaties weergeven" +"annotation.remove" = "Annotatie verwijderen" +"annotation.removeCategory" = "Annotatiecategorie verwijderen" +"app.actions" = "Acties" +"app.preferences" = "Voorkeuren" +"arrange.back" = "Achteraan plaatsen" +"arrange.backward" = "Naar achteren sturen" +"arrange.forward" = "Naar voren brengen" +"arrange.front" = "Vooraan plaatsen" +"arrange.packH" = "Horizontaal samenpakken" +"arrange.packV" = "Verticaal stapelen" +"arrange.roundToPixels" = "Afronden op pixels" +"arrange.spacing" = "Afstand" +"arrange.tidy" = "Opruimen" +"bool.exclude" = "Exclude toepassen op selectie" +"bool.flatten" = "Boolean afvlakken" +"bool.intersect" = "Intersect toepassen op selectie" +"bool.subtract" = "Selectie aftrekken" +"bool.union" = "Union toepassen op selectie" +"branch.archive" = "Branch archiveren" +"branch.create" = "Branch maken" +"branch.list" = "Branches weergeven" +"branch.merge" = "Branch samenvoegen" +"branch.open" = "Branch openen" +"branch.review" = "Branch beoordelen" +"branch.updateFromMain" = "Bijwerken vanaf main" +"codeConnect.export" = "Codeverbindingen exporteren" +"codeConnect.import" = "Codekoppelingen importeren" +"codeConnect.remove" = "Koppeling met code verbreken" +"codeConnect.set" = "Aan code koppelen" +"collab.cursor" = "Cursor weergeven op" +"collab.cursorChat" = "Cursorchat" +"collab.diff" = "Syncwijzigingen weergeven" +"collab.files" = "Jouw online bestanden" +"collab.follow" = "Volgen" +"collab.forgetFile" = "Online bestand vergeten" +"collab.host" = "Live sessie starten" +"collab.join" = "Deelnemen aan live sessie" +"collab.leave" = "Live sessie verlaten" +"collab.manageFile" = "Gepubliceerd bestand beheren" +"collab.openFile" = "Online bestand openen" +"collab.peers" = "Mensen in dit bestand" +"collab.publish" = "Publiceren op server" +"collab.recoverFile" = "Online bestand herstellen" +"collab.registerLinks" = "Uitnodigingslinks openen in FigCraft" +"collab.removePerson" = "Uit sessie verwijderen" +"collab.report" = "Bestand melden bij serverbeheerder" +"collab.serverInfo" = "Serverinformatie" +"collab.share" = "Delen met een deelnamecode" +"collab.spotlight" = "Mij in de spotlight zetten" +"collab.stop" = "Livesessie stoppen" +"command.batch" = "Meerdere opdrachten uitvoeren" +"comment.add" = "Reactie toevoegen" +"comment.delete" = "Reactie verwijderen" +"comment.edit" = "Reactie bewerken" +"comment.link" = "Link naar reactie kopiëren" +"comment.list" = "Reacties weergeven" +"comment.markRead" = "Reactie als gelezen markeren" +"comment.move" = "Reactie verplaatsen" +"comment.next" = "Volgende reactie" +"comment.open" = "Reactie openen" +"comment.people" = "Personen in reacties" +"comment.react" = "Op reactie reageren" +"comment.reply" = "Op reactie antwoorden" +"comment.resolve" = "Reactie oplossen" +"comment.zoom" = "Inzoomen op reacties" +"component.addProperty" = "Componenteigenschap toevoegen" +"component.addVariant" = "Variant toevoegen" +"component.bindProperty" = "Laag aan eigenschap koppelen" +"component.combineVariants" = "Combineren als varianten" +"component.create" = "Component maken" +"component.createMultiple" = "Meerdere componenten maken" +"component.deleteProperty" = "Componenteigenschap verwijderen" +"component.detach" = "Instance loskoppelen" +"component.editProperty" = "Componenteigenschap bewerken" +"component.exposeInstance" = "Geneste instance zichtbaar maken" +"component.goToMain" = "Naar hoofdcomponent gaan" +"component.hideWhenPublishing" = "Verbergen bij publiceren" +"component.list" = "Componenten weergeven" +"component.makeSlot" = "Slot maken" +"component.playground" = "Componentplayground" +"component.properties" = "Componenteigenschappen" +"component.pushChanges" = "Wijzigingen naar hoofdcomponent pushen" +"component.removeSlot" = "Slot verwijderen" +"component.resetInstance" = "Alle wijzigingen herstellen" +"component.resetOverride" = "Overschrijving resetten" +"component.restoreMain" = "Hoofdcomponent terugzetten" +"dev.compare" = "Wijzigingen vergelijken" +"dev.focus" = "Focusweergave" +"dev.resolveChange" = "Wijziging oplossen" +"dev.unfocus" = "Focusweergave verlaten" +"devResource.add" = "Dev-resource toevoegen" +"devResource.edit" = "Dev-resource bewerken" +"devResource.list" = "Dev-resources weergeven" +"devResource.remove" = "Dev-resource verwijderen" +"distribute.horizontal" = "Horizontale afstand verdelen" +"distribute.vertical" = "Verticale afstand verdelen" +"doc.home" = "Home" +"doc.list" = "Documenten weergeven" +"doc.nextTab" = "Volgend tabblad" +"doc.previousTab" = "Vorig tabblad" +"doc.switch" = "Document wisselen" +"edit.copy" = "Kopiëren" +"edit.copyAsCss" = "Kopiëren als CSS" +"edit.copyAsPng" = "Kopiëren als PNG" +"edit.copyAsSvg" = "Kopiëren als SVG" +"edit.copyAsText" = "Kopiëren als tekst" +"edit.copyLink" = "Link naar selectie kopiëren" +"edit.copyProperties" = "Eigenschappen kopiëren" +"edit.cut" = "Knippen" +"edit.delete" = "Verwijderen" +"edit.duplicate" = "Dupliceren" +"edit.findReplace" = "Zoeken en vervangen" +"edit.paste" = "Plakken" +"edit.pasteDesignLayers" = "Ontwerplagen plakken" +"edit.pasteOver" = "Plakken over selectie" +"edit.pasteProperties" = "Eigenschappen plakken" +"edit.pasteReplace" = "Plakken ter vervanging" +"edit.pickColor" = "Kleur oppikken" +"edit.redo" = "Opnieuw" +"edit.repeat" = "Laatste opdracht herhalen" +"edit.setDefaultProperties" = "Standaardeigenschappen instellen" +"edit.undo" = "Ongedaan maken" +"effect.add" = "Effect toevoegen" +"effect.move" = "Effect verplaatsen" +"effect.remove" = "Effect verwijderen" +"effect.set" = "Effect instellen" +"export.add" = "Exportinstelling toevoegen" +"export.remove" = "Exportinstelling verwijderen" +"export.update" = "Exportinstelling bewerken" +"file.close" = "Tabblad sluiten" +"file.colorProfile" = "Kleurprofiel" +"file.duplicate" = "Bestand dupliceren" +"file.export" = "Exporteren" +"file.exportFramesPdf" = "Frames exporteren naar PDF" +"file.exportLayers" = "Lagen exporteren" +"file.exportSvg" = "Selectie exporteren als SVG" +"file.import" = "Importeren" +"file.new" = "Nieuw ontwerpbestand" +"file.newFromTemplate" = "Nieuw vanuit sjabloon" +"file.open" = "Openen" +"file.openRecent" = "Onlangs geopende bestanden" +"file.placeImage" = "Afbeelding plaatsen" +"file.recover" = "Bestand herstellen" +"file.rename" = "Bestand hernoemen" +"file.revert" = "Terugdraaien naar opgeslagen versie" +"file.save" = "Opslaan" +"file.saveAs" = "Opslaan als" +"file.saveVersion" = "Opslaan in versiegeschiedenis" +"file.versionHistory" = "Versiegeschiedenis weergeven" +"fill.add" = "Vulling toevoegen" +"fill.move" = "Vulling verplaatsen" +"fill.pattern" = "Patroonvulling" +"fill.remove" = "Vulling verwijderen" +"fill.set" = "Vulling instellen" +"frame.create" = "Frame maken" +"frame.presets" = "Frame-voorinstellingen weergeven" +"frame.swapOrientation" = "Oriëntatie omwisselen" +"grid.add" = "Layoutraster toevoegen" +"grid.move" = "Layoutraster verplaatsen" +"grid.remove" = "Layoutraster verwijderen" +"guide.add" = "Hulplijn toevoegen" +"guide.clear" = "Alle hulplijnen verwijderen" +"guide.move" = "Hulplijn verplaatsen" +"guide.remove" = "Hulplijn verwijderen" +"guide.select" = "Hulplijn selecteren" +"help.about" = "Over FigCraft" +"help.gettingStarted" = "Aan de slag" +"help.page" = "Helppagina" +"help.shortcuts" = "Sneltoetsen" +"image.adjust" = "Afbeelding aanpassen" +"image.deletePreset" = "Afbeeldingspreset verwijderen" +"image.place" = "Afbeelding plaatsen" +"image.presets" = "Afbeeldingsvoorinstellingen" +"image.savePreset" = "Voorinstelling voor afbeelding opslaan" +"inspect.assets" = "Assets inspecteren" +"inspect.code" = "Code voor laag" +"inspect.componentCode" = "Componentcode" +"inspect.properties" = "Eigenschappen inspecteren" +"inspect.readyForDev" = "Ready for dev" +"instance.create" = "Instance maken" +"instance.exposed" = "Zichtbare geneste instances" +"instance.place" = "Instance plaatsen" +"instance.resetSlot" = "Slot herstellen" +"instance.setProperties" = "Eigenschappen van instance instellen" +"instance.slotInsert" = "In slot invoegen" +"instance.swap" = "Instance verwisselen" +"instance.swapAt" = "Instance op punt verwisselen" +"layers.collapseAll" = "Lagen inklappen" +"layout.add" = "Auto layout toevoegen" +"layout.remove" = "Auto layout verwijderen" +"layout.setTrack" = "Grootte van rastertrack instellen" +"layout.suggest" = "Auto layout voorstellen" +"libraries.open" = "Bibliotheken" +"libraries.publish" = "Bibliotheek publiceren…" +"library.acceptUpdates" = "Bibliotheekupdates accepteren" +"library.add" = "Bibliotheek toevoegen" +"library.aliasVariable" = "Alias van bibliotheekvariabele maken" +"library.applyStyle" = "Bibliotheekstijl toepassen" +"library.bindVariable" = "Bibliotheekvariabele koppelen" +"library.extendCollection" = "Bibliotheekverzameling uitbreiden" +"library.import" = "Bibliotheekcomponent importeren" +"library.importVariable" = "Bibliotheekvariabele importeren" +"library.list" = "Bibliotheken weergeven" +"library.place" = "Bibliotheekcomponent plaatsen" +"library.publish" = "Bibliotheek publiceren" +"library.publishToServer" = "Bibliotheek naar server publiceren" +"library.remove" = "Bibliotheek verwijderen" +"library.setVariableMode" = "Modus van bibliotheekvariabele instellen" +"library.swap" = "Bibliotheek verwisselen" +"library.swapAt" = "Instance verwisselen voor bibliotheekcomponent" +"library.updates" = "Bibliotheekupdates" +"library.usage" = "Bibliotheekgebruik" +"measure.distances" = "Afstanden meten" +"measure.padding" = "Padding van auto layout meten" +"node.create" = "Laag maken" +"node.get" = "Laag ophalen" +"node.reorder" = "Laag herordenen" +"node.reparent" = "Laag verplaatsen naar" +"node.set" = "Eigenschappen instellen" +"object.batchRename" = "Batch hernoemen" +"object.convertToFrame" = "Converteren naar frame" +"object.convertToGroup" = "Converteren naar groep" +"object.convertToSection" = "Converteren naar sectie" +"object.flipH" = "Horizontaal spiegelen" +"object.flipV" = "Verticaal spiegelen" +"object.frameSelection" = "Selectie framen" +"object.group" = "Selectie groeperen" +"object.hideOthers" = "Overige lagen verbergen" +"object.mask" = "Als masker gebruiken" +"object.moveToPage" = "Verplaatsen naar pagina" +"object.opacityKeys" = "Dekking via cijfertoetsen" +"object.rasterize" = "Selectie rasteriseren" +"object.releaseMask" = "Masker opheffen" +"object.removeFill" = "Vulling verwijderen" +"object.removeFrame" = "Frame verwijderen" +"object.removeStroke" = "Lijn verwijderen" +"object.rename" = "Hernoemen" +"object.resizeToFit" = "Formaat aanpassen aan inhoud" +"object.rotate180" = "180° draaien" +"object.rotateLeft" = "90° naar links draaien" +"object.rotateRight" = "90° naar rechts draaien" +"object.setThumbnail" = "Instellen als miniatuur" +"object.swapFillStroke" = "Vulling en lijn omwisselen" +"object.toggleLock" = "Selectie vergrendelen/ontgrendelen" +"object.toggleVisible" = "Selectie tonen/verbergen" +"object.ungroup" = "Selectie ontgroeperen" +"object.wrapInSection" = "In nieuwe sectie plaatsen" +"page.add" = "Pagina toevoegen" +"page.delete" = "Pagina verwijderen" +"page.duplicate" = "Pagina dupliceren" +"page.list" = "Pagina's weergeven" +"page.move" = "Pagina verplaatsen" +"page.rename" = "Pagina hernoemen" +"page.select" = "Naar pagina gaan" +"page.setBackground" = "Pagina-achtergrond" +"paint.documentColors" = "Documentkleuren" +"plugin.close" = "Pluginpaneel sluiten" +"plugin.directory.install" = "Plugin installeren vanuit map" +"plugin.directory.list" = "Plugincatalogus doorbladeren" +"plugin.directory.publish" = "Plugin naar catalogus publiceren" +"plugin.directory.unpublish" = "Publicatie van plugin in catalogus ongedaan maken" +"plugin.event" = "Bedieningselement in pluginpaneel gebruiken" +"plugin.import" = "Plugin importeren vanuit manifest…" +"plugin.list" = "Plugins weergeven" +"plugin.remove" = "Plugin verwijderen" +"plugin.run" = "Plugin uitvoeren" +"plugin.ui" = "Pluginpaneel" +"plugins.manage" = "Plugins beheren…" +"plugins.runLast" = "Laatste plugin uitvoeren" +"pref.autoSave" = "Bestanden automatisch opslaan" +"pref.highlightHover" = "Lagen markeren bij aanwijzen" +"pref.keepTool" = "Gereedschap geselecteerd houden na gebruik" +"pref.language" = "Interfacetaal" +"pref.nudge" = "Stapafstand" +"pref.numberKeysOpacity" = "Cijfertoetsen gebruiken voor dekking" +"pref.publishServer" = "Server voor online delen" +"pref.reduceMotion" = "Beweging verminderen" +"pref.renameDuplicates" = "Gedupliceerde lagen hernoemen" +"pref.showDimensions" = "Afmetingen op objecten tonen" +"pref.userName" = "Je naam in reacties" +"proto.action.add" = "Prototypeactie toevoegen" +"proto.action.move" = "Volgorde van prototypeactie wijzigen" +"proto.action.remove" = "Prototype-actie verwijderen" +"proto.action.set" = "Prototype-actie bewerken" +"proto.closePreview" = "Prototype-voorvertoning sluiten" +"proto.conditional.addBlock" = "Else if / else toevoegen" +"proto.conditional.removeBlock" = "if / else if / else verwijderen" +"proto.conditional.setCondition" = "Voorwaarde bewerken" +"proto.evaluate" = "Prototype-expressie evalueren" +"proto.flow.add" = "Startpunt van flow toevoegen" +"proto.flow.remove" = "Flow verwijderen" +"proto.flow.rename" = "Flow hernoemen" +"proto.interaction.add" = "Interactie toevoegen" +"proto.interaction.clear" = "Alle interacties verwijderen" +"proto.interaction.remove" = "Interactie verwijderen" +"proto.interaction.set" = "Interactie bewerken" +"proto.present" = "Presenteren" +"proto.presentOptions" = "Presentatieopties" +"proto.preview" = "Prototypevoorvertoning openen" +"proto.settings" = "Prototype-instellingen" +"section.toggleContents" = "Sectie-inhoud verbergen/weergeven" +"select.add" = "Toevoegen aan selectie" +"select.all" = "Alles selecteren" +"select.area" = "Gebied selecteren" +"select.byName" = "Lagen op naam selecteren" +"select.children" = "Onderliggende items selecteren" +"select.inverse" = "Selectie omkeren" +"select.layersAt" = "Lagen op een punt" +"select.matching" = "Overeenkomende lagen selecteren" +"select.next" = "Volgende laag op hetzelfde niveau selecteren" +"select.none" = "Selectie opheffen" +"select.parent" = "Bovenliggende selecteren" +"select.previous" = "Vorige laag op hetzelfde niveau selecteren" +"select.remove" = "Uit selectie verwijderen" +"select.sameEffect" = "Zelfde effect selecteren" +"select.sameFill" = "Dezelfde vulling selecteren" +"select.sameFont" = "Lagen met hetzelfde lettertype selecteren" +"select.sameInstance" = "Zelfde instance selecteren" +"select.sameProperties" = "Dezelfde eigenschappen selecteren" +"select.sameStroke" = "Lagen met dezelfde lijn selecteren" +"select.sameText" = "Dezelfde teksteigenschappen selecteren" +"select.set" = "Selecteren" +"selection.applyColorStyle" = "Kleurstijl op selectie toepassen" +"selection.colors" = "Selectiekleuren" +"selection.selectColor" = "Lagen op kleur selecteren" +"selection.setPaint" = "Selectiekleur wijzigen" +"shape.arrow" = "Pijl" +"shape.ellipse" = "Ellips" +"shape.line" = "Lijn" +"shape.polygon" = "Veelhoek" +"shape.rectangle" = "Rechthoek" +"shape.star" = "Ster" +"shapeBuilder.merge" = "Gebieden samenvoegen" +"shapeBuilder.mode" = "Shape builder-modus" +"shapeBuilder.regions" = "Shape builder-gebieden" +"shapeBuilder.remove" = "Gebieden verwijderen" +"stroke.add" = "Lijn toevoegen" +"stroke.brush" = "Penseel" +"stroke.move" = "Lijn verplaatsen" +"stroke.remove" = "Lijn verwijderen" +"stroke.set" = "Lijn instellen" +"stroke.widthProfile" = "Breedteprofiel" +"style.apply" = "Stijl toepassen" +"style.bind" = "Variabele aan stijl koppelen" +"style.create" = "Stijl maken" +"style.delete" = "Stijl verwijderen" +"style.detach" = "Stijl loskoppelen" +"style.duplicate" = "Stijl dupliceren" +"style.list" = "Stijlen weergeven" +"style.move" = "Stijlen verplaatsen" +"style.renameFolder" = "Stijlmap hernoemen" +"style.update" = "Stijl bewerken" +"template.list" = "Sjablonen weergeven" +"text.alignCenter" = "Midden uitlijnen" +"text.alignJustify" = "Uitvullen" +"text.alignLeft" = "Links uitlijnen" +"text.alignRight" = "Rechts uitlijnen" +"text.bold" = "Vet" +"text.bulletList" = "Lijst met opsommingstekens" +"text.case" = "Hoofdlettergebruik" +"text.caseLower" = "Kleine letters" +"text.caseOriginal" = "Oorspronkelijk hoofdlettergebruik" +"text.caseSmallCaps" = "Kleine hoofdletters" +"text.caseTitle" = "Hoofdletters per woord" +"text.caseUpper" = "Hoofdletters" +"text.create" = "Tekst" +"text.decoration" = "Decoratie" +"text.edit.begin" = "Tekst bewerken" +"text.edit.caret" = "Invoegpunt instellen" +"text.edit.end" = "Tekst bewerken stoppen" +"text.edit.insert" = "Tekst typen" +"text.edit.key" = "Tekstoets" +"text.edit.preedit" = "Tekst samenstellen (IME)" +"text.edit.selectLine" = "Regel selecteren" +"text.edit.selectWord" = "Woord selecteren" +"text.edit.selection" = "Tekstselectie" +"text.endPreview" = "Tekstvoorvertoning beëindigen" +"text.fonts" = "Lettertypen weergeven" +"text.italic" = "Cursief" +"text.lineHeightDown" = "Regelafstand verkleinen" +"text.lineHeightUp" = "Regelafstand vergroten" +"text.link" = "Link maken" +"text.listIndent" = "Lijst inspringen" +"text.listOutdent" = "Inspringing lijst verkleinen" +"text.listStyle" = "Lijststijl" +"text.maxLines" = "Maximaal aantal regels" +"text.numberList" = "Genummerde lijst" +"text.onPath" = "Tekst op pad" +"text.paragraphIndent" = "Alinea-inspringing" +"text.paragraphSpacing" = "Alinea-afstand" +"text.pathOptions" = "Opties voor tekstpad" +"text.preview" = "Tekstwijziging voorvertonen" +"text.removeFromPath" = "Tekst van pad verwijderen" +"text.set" = "Tekst instellen" +"text.setFeatures" = "OpenType-functies" +"text.setVariations" = "Assen van variabele lettertypen" +"text.sizeDown" = "Lettergrootte verkleinen" +"text.sizeUp" = "Lettertypegrootte vergroten" +"text.strikethrough" = "Doorstrepen" +"text.style" = "Tekstbereik opmaken" +"text.trackingDown" = "Letterafstand verkleinen" +"text.trackingUp" = "Letterafstand vergroten" +"text.underline" = "Onderstrepen" +"text.weightDown" = "Lettertypedikte verkleinen" +"text.weightUp" = "Letterdikte vergroten" +"tool.arrow" = "Pijl" +"tool.comment" = "Reactie" +"tool.ellipse" = "Ellips" +"tool.frame" = "Frame" +"tool.hand" = "Hand" +"tool.line" = "Lijn" +"tool.move" = "Verplaatsen" +"tool.pen" = "Pen" +"tool.pencil" = "Potlood" +"tool.pencilBrush" = "Potloodpenseel" +"tool.place" = "Plaatsen met de tool" +"tool.polygon" = "Veelhoek" +"tool.rectangle" = "Rechthoek" +"tool.scale" = "Schalen" +"tool.scaleAnchor" = "Schaalanker" +"tool.section" = "Sectie" +"tool.set" = "Gereedschap kiezen" +"tool.shapeBuilder" = "Shape builder" +"tool.slice" = "Slice" +"tool.star" = "Ster" +"tool.text" = "Tekst" +"transform.move" = "Verplaatsen" +"transform.moveTo" = "Verplaatsen naar" +"transform.nudge" = "Verschuiven" +"transform.nudgeSize" = "Formaat wijzigen in stappen" +"transform.resize" = "Formaat wijzigen" +"transform.rotate" = "Draaien" +"transform.rotationOrigin" = "Rotatiepunt verplaatsen" +"transform.scale" = "Schalen" +"transform.setRotationOrigin" = "Rotatiepunt instellen" +"variable.addMode" = "Modus toevoegen" +"variable.bind" = "Variabele koppelen" +"variable.create" = "Variabele maken" +"variable.createCollection" = "Variabeleverzameling maken" +"variable.delete" = "Variabele verwijderen" +"variable.deleteCollection" = "Verzameling verwijderen" +"variable.duplicate" = "Variabele dupliceren" +"variable.export" = "Variabelen exporteren" +"variable.import" = "Variabelen importeren" +"variable.list" = "Variabelen weergeven" +"variable.moveMode" = "Modus verplaatsen" +"variable.removeMode" = "Modus verwijderen" +"variable.renameCollection" = "Verzameling hernoemen" +"variable.renameMode" = "Modus hernoemen" +"variable.resetOverride" = "Overschrijving van variabele resetten" +"variable.set" = "Variabelewaarde instellen" +"variable.setMode" = "Variabelemodus instellen" +"variable.update" = "Variabele bewerken" +"vector.create" = "Vector" +"vector.deleteHeal" = "Selectie verwijderen en herstellen" +"vector.edit.addVertex" = "Punt toevoegen" +"vector.edit.begin" = "Vector bewerken" +"vector.edit.bend" = "Segment buigen" +"vector.edit.bounds" = "Grenzen van geselecteerde punten" +"vector.edit.connect" = "Punten verbinden" +"vector.edit.cornerRadius" = "Hoekradius van punt" +"vector.edit.cut" = "Pad knippen" +"vector.edit.delete" = "Punten verwijderen" +"vector.edit.end" = "Klaar met bewerken" +"vector.edit.erase" = "Wissen" +"vector.edit.lasso" = "Met lasso selecteren" +"vector.edit.mirroring" = "Handgrepen spiegelen" +"vector.edit.moveHandles" = "Handgrepen verplaatsen" +"vector.edit.moveVertices" = "Punten verplaatsen" +"vector.edit.nudge" = "Punten verschuiven" +"vector.edit.paint" = "Verfemmer" +"vector.edit.pen" = "Penpunt" +"vector.edit.penEnd" = "Penpad beëindigen" +"vector.edit.position" = "Puntpositie" +"vector.edit.resize" = "Formaat van punten wijzigen" +"vector.edit.rotate" = "Punten draaien" +"vector.edit.select" = "Punten selecteren" +"vector.edit.selectAll" = "Alle punten selecteren" +"vector.edit.setHandle" = "Handgreep instellen" +"vector.edit.smooth" = "Punten glad of scherp maken" +"vector.edit.state" = "Status van vectorbewerking" +"vector.edit.strokeCap" = "Lijneinde van punt" +"vector.edit.strokeJoin" = "Lijnaansluiting van punt" +"vector.edit.tool" = "Tool voor vectorbewerking" +"vector.edit.transform" = "Punten transformeren" +"vector.edit.widthPoint" = "Breedtepunt" +"vector.flatten" = "Afvlakken" +"vector.join" = "Selectie samenvoegen" +"vector.offset" = "Pad offsetten" +"vector.outlineStroke" = "Lijn omzetten naar contouren" +"vector.reverse" = "Padrichting omkeren" +"vector.simplify" = "Vector vereenvoudigen" +"vector.smoothJoin" = "Selectie vloeiend samenvoegen" +"version.autosave" = "Versie automatisch opslaan" +"version.delete" = "Versie verwijderen" +"version.duplicate" = "Versie dupliceren" +"version.exitPreview" = "Terug naar huidige versie" +"version.list" = "Versies weergeven" +"version.preview" = "Versie bekijken" +"version.rename" = "Versie hernoemen" +"version.restore" = "Versie terugzetten" +"view.assets" = "Assetpaneel" +"view.comments" = "Reacties" +"view.contextMenu" = "Contextmenu tonen" +"view.design" = "Ontwerppaneel" +"view.designPrototype" = "Wisselen tussen Design en Prototype" +"view.devMode" = "Dev Mode" +"view.frameOutlines" = "Framecontouren" +"view.fullscreen" = "Volledig scherm" +"view.get" = "Weergave ophalen" +"view.layers" = "Lagenpaneel" +"view.layoutGrids" = "Layoutrasters" +"view.leftSidebar" = "Linkerzijbalk tonen/verbergen" +"view.maskOutlines" = "Maskercontouren" +"view.multiplayerCursors" = "Multiplayer-cursors" +"view.nextFrame" = "Inzoomen op volgend frame" +"view.nextPage" = "Volgende pagina" +"view.nextRegion" = "Volgend gebied focussen" +"view.outlines" = "Contouren" +"view.outlinesHiddenLayers" = "Verborgen lagen opnemen in contouren" +"view.outlinesObjectBounds" = "Objectgrenzen opnemen in contouren" +"view.outlinesSelection" = "Contouren voor selectie" +"view.pan" = "Weergave verschuiven" +"view.panelWidths" = "Paneelbreedtes herstellen" +"view.pixelGrid" = "Pixelraster" +"view.pixelPreview" = "Pixelvoorvertoning" +"view.prevFrame" = "Inzoomen op vorig frame" +"view.prevPage" = "Vorige pagina" +"view.previousRegion" = "Vorige regio focussen" +"view.proofSrgb" = "sRGB-proefweergave" +"view.prototype" = "Prototypepaneel" +"view.rulers" = "Linialen" +"view.set" = "Weergave instellen" +"view.slices" = "Slices" +"view.snapGeometry" = "Uitlijnen op geometrie" +"view.snapObjects" = "Uitlijnen op objecten" +"view.snapPixel" = "Uitlijnen op pixelraster" +"view.themeDark" = "Donker thema" +"view.themeLight" = "Licht thema" +"view.themeSystem" = "Systeemthema volgen" +"view.toggleUi" = "UI tonen/verbergen" +"view.zoom100" = "Inzoomen op 100%" +"view.zoom200" = "Zoomen naar 200%" +"view.zoom50" = "Zoom instellen op 50%" +"view.zoomAt" = "Zoomgereedschap" +"view.zoomFit" = "Inpassen" +"view.zoomIn" = "Inzoomen" +"view.zoomOut" = "Uitzoomen" +"view.zoomSelection" = "Inzoomen op selectie" +"widget.click" = "Op widget klikken" +"widget.insert" = "Widget invoegen" +"widget.list" = "Widgets weergeven" +"window.focus" = "Venster naar voren brengen" +"window.new" = "Nieuw venster" + +[menu] +"bool.exclude" = "Exclude" +"bool.flatten" = "Flatten" +"bool.intersect" = "Intersect" +"bool.subtract" = "Subtract" +"bool.union" = "Union" +"file.duplicate" = "Dupliceren" +"file.import" = "Importeren uit bestand…" +"file.rename" = "Hernoemen" +"libraries.open" = "Bibliotheken openen" +"select.sameEffect" = "Effect" +"select.sameFill" = "Vulling" +"select.sameFont" = "Lettertype" +"select.sameInstance" = "Instance" +"select.sameProperties" = "Eigenschappen" +"select.sameStroke" = "Lijn" +"select.sameText" = "Teksteigenschappen" +"text.alignCenter" = "Tekst centreren" +"text.alignJustify" = "Tekst uitvullen" +"text.alignLeft" = "Tekst links uitlijnen" +"text.alignRight" = "Tekst rechts uitlijnen" +"view.assets" = "Assets" +"view.design" = "Ontwerp" +"view.layers" = "Lagen" +"view.outlines" = "Omtrekken weergeven" +"view.outlinesHiddenLayers" = "Verborgen lagen meenemen" +"view.outlinesObjectBounds" = "Objectgrenzen meenemen" +"view.outlinesSelection" = "Omtrekken van selectie weergeven" +"view.prototype" = "Prototype" +"view.themeDark" = "Donker" +"view.themeLight" = "Licht" +"view.themeSystem" = "Systeem volgen" diff --git a/crates/ui-egui/src/i18n_tests.rs b/crates/ui-egui/src/i18n_tests.rs index 5bdf2094a..d4d81d7b9 100644 --- a/crates/ui-egui/src/i18n_tests.rs +++ b/crates/ui-egui/src/i18n_tests.rs @@ -343,11 +343,12 @@ fn system_languages_pick_the_first_one_with_a_catalog() { // Portugal's Portuguese and a bare "pt" read the Brazilian catalog. assert_eq!(code("system", Some("pt-PT")), "pt-BR"); assert_eq!(code("pt", None), "pt-BR"); - // An OS list: the first language there is a catalog for (English counts). - assert_eq!(code("system", Some("nl-NL,de-DE,en-US")), "de"); - assert_eq!(code("system", Some("nl-NL, en-US,fr-FR")), "en"); - assert_eq!(code("system", Some("nl,da")), "en"); - assert_eq!(code("system", Some("nl,sv")), "sv"); + // An OS list: the first language there is a catalog for (English counts). Hindi has no + // catalog (Dutch gained one; `hi` keeps exercising the no-catalog path). + assert_eq!(code("system", Some("hi-IN,de-DE,en-US")), "de"); + assert_eq!(code("system", Some("hi-IN, en-US,fr-FR")), "en"); + assert_eq!(code("system", Some("hi,da")), "en"); + assert_eq!(code("system", Some("hi,sv")), "sv"); assert_eq!(code("fr", Some("de-DE")), "fr", "a chosen language beats the system's"); } @@ -472,7 +473,7 @@ fn russian_language_tags_and_integer_plurals() { assert_eq!(resolve(tag, None), ru, "{tag}"); assert_eq!(resolve("system", Some(tag)), ru, "{tag}"); } - assert_eq!(resolve("system", Some("nl,ru-RU,en-US")), ru); + assert_eq!(resolve("system", Some("hi,ru-RU,en-US")), ru); for n in [1, 21, 31, 101, 1_001] { assert_eq!(plural("ru", n), Plural::One, "{n}"); assert_eq!(fill(counted(ru, "{n} layers", n), &[("n", &n)]), format!("{n} слой")); diff --git a/docs/gaps.md b/docs/gaps.md index 9b1a770c1..68ee6d105 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Where FigCraft falls short of Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (the 2026-10-17 landings: `.fig` import fidelity, budgets for large files, the import report, a `.fig` copy from Save as and paste from another design app (gap 1); menus, the Actions palette, editor fixes, Selection colors and smart-selection spacing (gap 4); catalog counts re-measured (gap 5); bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (a Dutch draft: `nl.toml` at 100% of the strings, machine-drafted, awaiting native review; the catalogs re-measured over 2,315 entries; preceding: the 2026-10-17 landings: `.fig` import fidelity, budgets for large files, the import report, a `.fig` copy from Save as and paste from another design app (gap 1); menus, the Actions palette, editor fixes, Selection colors and smart-selection spacing (gap 4); catalog counts re-measured (gap 5); bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) Every known shortfall against Figma, one entry each, ranked by how much it stops a Figma user from doing real work in FigCraft. Agents: pick work from the top unless the owner says otherwise. The @@ -18,7 +18,7 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe | 2 | Multiplayer and sharing are a preview, without accounts (**beta blocker**) | Feature | 42–84 | [collaboration-parity](collaboration-parity.md) | | 3 | Nothing checked against real Figma files | Fidelity | 15–30 | [target-app-parity](target-app-parity.md) | | 4 | Interaction fidelity not compared tool by tool | UI/UX | 40–60 | [ui-parity](ui-parity.md) | -| 5 | Localization: English, reviewed Russian, plus unreviewed Spanish (and Latin American Spanish), French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Czech drafts; Turkish and Swedish catalogs | Localization | 29–51 | [localization-parity](localization-parity.md) | +| 5 | Localization: English, reviewed Russian, plus unreviewed Spanish (and Latin American Spanish), German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Czech drafts; Dutch complete as an unreviewed draft; Turkish and Swedish catalogs | Localization | 29–51 | [localization-parity](localization-parity.md) | | 6 | Plugins: widgets take clicks only, a self-hosted directory but no public catalogue; Figma's plugins don't run | Ecosystem | 8–26 | [target-app-parity](target-app-parity.md) | | 7 | CPU canvas where Figma uses the GPU | Hardware/performance | 30–60 | [hardware-parity](hardware-parity.md) | | 8 | Platform QA: Linux and the browser left (Windows pass done 2026-10-11) | Stability/platforms | 10–20 | [hardware-parity](hardware-parity.md) | @@ -179,26 +179,27 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe - **Estimate:** 40–60 h. Detail in [`ui-parity.md`](ui-parity.md). ### 5. Localization: English, reviewed Russian, plus unreviewed drafts -- **Missing:** native reviews of the Spanish, French, German, Brazilian Portuguese, Japanese, - Korean, Simplified Chinese, Indonesian and Czech drafts and the Latin American Spanish +- **Missing:** native reviews of the Spanish, French, German, Dutch, Brazilian Portuguese, + Japanese, Korean, Simplified Chinese, Indonesian and Czech drafts and the Latin American Spanish overlay, the strings added since each catalog was drafted (1–5% of each), Hindi, Arabic and Vietnamese, localized engine messages and number formatting; CJK UI text on the web without the craft-fonts CJK build. - **Evidence (measured from source):** the layer landed 2026-10-11: catalogs in - `crates/ui-egui/locales/` (measured 2026-10-17: 1,680 UI keys plus 561 command labels and 31 - menu wordings, 2,272 entries), Preferences ▸ Language, `pref.language`; `en.toml` is complete, - Spanish is held to completeness by the check, and the French, German, Brazilian Portuguese, - Japanese, Korean and Simplified Chinese machine drafts cover 95–99% (strings added since they - were drafted show English), with `es-419.toml` a Latin American overlay listing only what + `crates/ui-egui/locales/` (measured 2026-10-18: 1,718 UI keys plus 566 command labels and 31 + menu wordings, 2,315 entries), Preferences ▸ Language, `pref.language`; `en.toml` is complete, + Spanish is held to completeness by the check, and Dutch (2026-10-18) covers every string as a + draft; the German, Brazilian Portuguese, Japanese, Korean and Simplified Chinese machine drafts + cover 95–99% (strings added since they were drafted show English), with `es-419.toml` a Latin + American overlay listing only what differs from Spanish. Russian (reviewed and approved by VanTan, one/few/many integer plurals) covers 98.8%; Indonesian and Czech drafts, a Turkish catalog whose header says a native speaker - reviewed it, and a Swedish catalog (with its command labels since 2026-10-17) cover 98.7–99.6% ([localization-parity](localization-parity.md#languages)). + reviewed it, and a Swedish catalog (with its command labels since 2026-10-17) cover 98.8–99.6% ([localization-parity](localization-parity.md#languages)). CJK UI text uses an installed CJK face the desktop app loads when something on screen needs it (`crates/ui-egui/src/cjk.rs`). Engine error messages and Dev Mode values stay English. - **Impact:** non-English designers get machine drafts nobody has reviewed yet, and English errors. - **Estimate:** 3–7 h per language plus native review, 4–6 h for engine messages and numbers; - 29–51 h for the key languages left and the drafts' follow-ups (kept on 2026-10-17: the + 29–51 h for the key languages left and the drafts' follow-ups (kept on 2026-10-18: the Indonesian draft takes 2–3 h off, about what bringing the drafts that slipped to 95% back to every string adds). Detail in [`localization-parity.md`](localization-parity.md); how to add one in @@ -444,6 +445,7 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe | Date | Change | Summary | |---|---|---| +| 2026-10-18 | minor | Dutch draft (gap 5): `nl.toml` at 100% of the strings (1,718 UI keys, 566 command labels, 31 menu wordings — 2,315 entries), machine-drafted, a draft awaiting native review; the catalog counts re-measured over all languages (the other drafts read 95–99% on the new basis), the language table rows and evidence refreshed. Ranking and hours unchanged | | 2026-10-17 | minor | The 2026-10-17 landings. Gap 1: a new Landed entry (community batches #727 and #728, then #745: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments, images in the message, instance layers' size and resizing overrides, Hug where nothing is recorded; budgets from the file's size; the import report; a `.fig` copy from Save as; paste from another design app), its Missing list cut to what is still left, and the wrong "whether other apps open its files is unknown" replaced by what was checked; all on synthetic files, so the beta blocker and hours stand. Gap 2: server limits, log recovery and web join links in the evidence. Gap 4: menus, the Actions palette and the editor fixes (#733, #735, #736, #729), then Selection colors and smart-selection spacing (#753) landed, none compared side by side. Gap 5: catalog counts re-measured (2,272 entries; drafts at 95–99%; Indonesian, Czech, Turkish and Swedish listed). Gap 8: the Linux and BSD clipboard changes and Wayland window controls, not run there by the maintainers. Ranking and hours unchanged | | 2026-10-15 | minor | Gap 7: bounded canvas overscan for smoother panning. Estimates and ranking unchanged. | | 2026-10-14 | minor | Russian catalog (M9), reviewed and approved by VanTan: all 2,165 current entries, Русский in Preferences and regional ru tags. Russian integer plurals use one/few/many; contributor display name VanTan added. Existing estimates unchanged. | diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 50fcd4ec3..7df91731c 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -1,12 +1,12 @@ # Localization parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (macOS finds its downloadable CJK system fonts (#406); string counts re-measured: 2,272 entries, the drafts at 95–99%; Swedish command labels and menu wordings; Russian, Swedish, Turkish, Czech and Indonesian listed; a duplicated paragraph removed; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (a Dutch draft: `nl.toml` at 100% of the strings, machine-drafted, awaiting native review; the language table re-measured over 2,315 entries; macOS finds its downloadable CJK system fonts (#406); Swedish command labels and menu wordings; Russian, Swedish, Turkish, Czech and Indonesian listed; a duplicated paragraph removed; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog) · **Target:** Figma Design (desktop app 126.10.7) FigCraft's interface has a localization layer with an English catalog, a Russian catalog reviewed by a native speaker, and Spanish (with a Latin American overlay), French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Czech drafts (machine-drafted, -waiting for native speakers' review), plus Swedish and Turkish catalogs. This page lists the twelve key -languages of the craftrules standard, then the other languages Figma ships. How to add a +waiting for native speakers' review), plus Dutch, Swedish and Turkish catalogs. This page lists the +twelve key languages of the craftrules standard, then the other languages Figma ships. How to add a language: [`translating.md`](translating.md). ## What Figma ships @@ -18,21 +18,21 @@ browser's page translation. The `.lproj` folders in `/Applications/Figma.app` (6 Electron/Chromium locale packs, not Figma's own UI languages. Text *content* in any script is supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no vertical text. -## What FigCraft has (measured 2026-10-17, from source) +## What FigCraft has (measured 2026-10-18, from source) - **Layer:** one TOML catalog per language in `crates/ui-egui/locales/`, baked into the binary by the UI crate's build script (desktop and web; nothing read at run time). Keys are the English text (`tr("Fill")`, `trf` for `{named}` placeholders, `trn` for counts with one/few/many/other plural forms), so a missing translation shows English, never a raw key. One English text that needs two translations takes a context (`"Fill|sizing"`). -- **Strings:** 1,680 UI keys in `en.toml` (41 with plural forms; ~110 are labels from engine and - document data, such as tool names, blend modes and Dev Mode properties) plus 561 command labels - and 31 menu wordings by command id: 2,272 entries (counted against `en.toml` and the complete +- **Strings:** 1,718 UI keys in `en.toml` (41 with plural forms; ~110 are labels from engine and + document data, such as tool names, blend modes and Dev Mode properties) plus 566 command labels + and 31 menu wordings by command id: 2,315 entries (counted against `en.toml` and the complete Spanish catalog's command and menu tables). Command ids, the CLI, MCP and the control channel stay English. Accessibility names come from the same strings. - **Language preference:** Preferences ▸ Language (System, then each catalog by its own name: English, Čeština, Deutsch, Español, Español (Latinoamérica), Français, Bahasa Indonesia, 日本語, - 한국어, Português (Brasil), Русский, Svenska, Türkçe, 简体中文), applied at once without a + 한국어, Nederlands, Português (Brasil), Русский, Svenska, Türkçe, 简体中文), applied at once without a restart; System takes the first of the OS's preferred languages that has a catalog (on Windows only the first preferred language counts, since that list also holds the languages added for a keyboard; macOS AppleLanguages, `LANGUAGE` then the locale variables on Linux and BSD; a regional @@ -85,23 +85,24 @@ supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no v | Language | Code | UI strings translated | Dialogs / tooltips / help | Script support | Native review | Status | Hours to full | |---|---|---|---|---|---|---|---| -| English | en | 2,272 / 2,272 (100%, source) | yes | Latin | yes (source) | full | 0 | -| Simplified Chinese (Mandarin) | zh-Hans | 2,166 / 2,272 (95.3%, draft) | yes | CJK text and IME in documents; UI text in an installed Chinese face, ahead of Japanese ones (web: the `FIGCRAFT_EMBED_CJK` build); no Traditional Chinese catalog (zh-TW, zh-HK read English) | no | draft | 1–2 (after native review) | -| Spanish | es, es-419 | 2,272 / 2,272 (100%, draft); es-419 overlays 101 Latin American wordings (draft) | yes | Latin | no | draft | 0–1 (after native review) | +| English | en | 2,315 / 2,315 (100%, source) | yes | Latin | yes (source) | full | 0 | +| Simplified Chinese (Mandarin) | zh-Hans | 2,209 / 2,315 (95.4%, draft) | yes | CJK text and IME in documents; UI text in an installed Chinese face, ahead of Japanese ones (web: the `FIGCRAFT_EMBED_CJK` build); no Traditional Chinese catalog (zh-TW, zh-HK read English) | no | draft | 1–2 (after native review) | +| Spanish | es, es-419 | 2,315 / 2,315 (100%, draft); es-419 overlays 104 Latin American wordings (draft) | yes | Latin | no | draft | 0–1 (after native review) | | Hindi | hi | 0 (0%) | no | Devanagari shaping works in documents; UI font fallback to check | no | none | 4–7 | | Arabic | ar | 0 (0%) | no | Bidi, shaping and RTL names work; the UI does not mirror | no | none | 9–15 | -| French | fr | 2,167 / 2,272 (95.4%, draft) | yes | Latin | no | draft | 1–2 (after native review) | -| Portuguese | pt-BR | 2,167 / 2,272 (95.4%, draft) | yes | Latin | no | draft | 1–2 (after native review) | -| Indonesian | id | 2,244 / 2,272 (98.8%, draft) | yes | Latin | no | draft | 1–2 (after native review) | -| Japanese | ja | 2,254 / 2,272 (99.2%, draft) | yes | CJK text and IME in documents; UI text in an installed Japanese face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | -| German | de | 2,176 / 2,272 (95.8%, draft) | yes | Latin; long words elide in narrow fields | no | draft | 1–2 (after native review) | -| Korean | ko | 2,166 / 2,272 (95.3%, draft) | yes | Hangul text and IME in documents; UI text in an installed Korean face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | +| French | fr | 2,210 / 2,315 (95.5%, draft) | yes | Latin | no | draft | 1–2 (after native review) | +| Portuguese | pt-BR | 2,210 / 2,315 (95.5%, draft) | yes | Latin | no | draft | 1–2 (after native review) | +| Indonesian | id | 2,287 / 2,315 (98.8%, draft) | yes | Latin | no | draft | 1–2 (after native review) | +| Japanese | ja | 2,297 / 2,315 (99.2%, draft) | yes | CJK text and IME in documents; UI text in an installed Japanese face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | +| German | de | 2,219 / 2,315 (95.9%, draft) | yes | Latin; long words elide in narrow fields | no | draft | 1–2 (after native review) | +| Korean | ko | 2,209 / 2,315 (95.4%, draft) | yes | Hangul text and IME in documents; UI text in an installed Korean face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | | Vietnamese | vi | 0 (0%) | no | Latin with stacked diacritics | no | none | 3–5 | -Other languages (measured 2026-10-17): Russian (`ru`) 2,244 / 2,272 (98.8%), reviewed and approved -by VanTan, one/few/many integer plurals; Swedish (`sv`) 2,264 (99.6%), its command labels and menu -wordings added 2026-10-17 (#599), native review welcome; Turkish (`tr`) 2,243 (98.7%), whose header -says it was machine-drafted and reviewed by a native speaker; Czech (`cs`) 2,244 (98.8%), a draft +Other languages (measured 2026-10-18): Russian (`ru`) 2,287 / 2,315 (98.8%), reviewed and approved +by VanTan, one/few/many integer plurals; Dutch (`nl`) 2,315 / 2,315 (100%), machine-drafted, one/other +plurals; Swedish (`sv`) 2,307 (99.6%), its command labels and menu +wordings added 2026-10-17 (#599), native review welcome; Turkish (`tr`) 2,286 (98.8%), whose header +says it was machine-drafted and reviewed by a native speaker; Czech (`cs`) 2,287 (98.8%), a draft with one/few/other plurals. Figma ships none beyond the eight above. The layer is done. Per-language hours above are agent hours for a catalog of ~1,800 entries @@ -109,17 +110,19 @@ The layer is done. Per-language hours above are agent hours for a catalog of ~1, it isn't one/other; every language also needs a native speaker's review (human). Left before full parity besides the languages: localizing engine messages and number formatting (4–6 h); right-to-left mirroring of the panels is in Arabic's hours. Total: **29–51 h** (kept on -2026-10-17: Indonesian's draft takes 2–3 h off, about what bringing the drafts back from 95% to -every string adds). +2026-10-18: bringing the drafts that slipped behind the newest strings back again balances +against the finished drafts like Indonesian's). Priority: native reviews of the drafts and the es-419 overlay (every one of Figma's languages -and variants has one, plus Simplified Chinese, Indonesian and Czech, which Figma doesn't ship), then -Hindi, Vietnamese and Arabic. Traditional Chinese is not planned (no catalog; its users see English). +and variants has one, plus Simplified Chinese, Indonesian, Czech and Dutch, which Figma doesn't +ship), then Hindi, Vietnamese and Arabic. Traditional Chinese is not planned (no catalog; its users +see English). ## Revision history | Date | Change | Summary | |---|---|---| +| 2026-10-18 | minor | A Dutch draft (gap 5): `nl.toml` translates every UI string (1,718 keys; 41 with plural forms, one/other), every command label (566) and every menu wording (31) — 2,315 entries — machine-drafted in one style pass (informal je register, infinitive menu labels, sentence case, months abbreviated the Dutch way: jan., feb., mrt., apr., mei…; established tool terms such as frame, auto layout, component, variant, prototype, overlay, widget, plugin, branch and constraints, and blend-mode, brush-preset and boolean names stay English) and marked as a draft awaiting native review; Preferences ▸ Language lists Nederlands, System maps any Dutch tag (nl-NL, nl…) to it, Dutch's default plural rule is the one/other default. The language-tag tests that used Dutch as a language without a catalog switched to Hindi, and the language table is re-measured over 2,315 entries (the drafts read 95–99%) | | 2026-10-17 | minor | Chinese showed as boxes on macOS (#406): the font scan also walks the system's downloaded font assets (`/System/Library/AssetsV2` and the older `/System/Library/Assets`, only their `com_apple_MobileAsset_Font*` folders), where current versions keep PingFang SC, and Hiragino Sans GB and Heiti SC join the Chinese UI faces and the text fallbacks. Tested with a folder laid out the same way; not yet run on a Mac | | 2026-10-17 | minor | String counts re-measured from the catalogs: 1,680 UI keys, 561 command labels and 31 menu wordings (2,272 entries); Spanish complete, the other drafts at 95.3–99.2% (strings added since 2026-10-12 show English), es-419 101 entries. Indonesian has a draft (98.8%; it was listed as none); Russian (98.8%, reviewed), Swedish (99.6%, command labels and menu wordings from #599), Turkish (98.7%) and Czech (98.8%) listed with counts; the language picker's list updated; a paragraph repeated by a merge removed. Grade and hours unchanged (Indonesian's draft is offset by the drafts' new gaps) | | 2026-10-14 | minor | Windows UI language (#291): the interface language comes from Windows' first preferred language alone; that list is also the input-language list (a German keyboard on a Polish system adds Deutsch), and taking the first entry with a catalog turned the interface German there. A first preferred language without a catalog reads English; macOS AppleLanguages and gettext's `LANGUAGE` still take the first language with a catalog | diff --git a/docs/translating.md b/docs/translating.md index 0e94d20d2..1ea1b94fa 100644 --- a/docs/translating.md +++ b/docs/translating.md @@ -15,14 +15,12 @@ Simplified. `pref.language {language}` does the same from the CLI, MCP and the control channel. The catalogs: English (`en`, the source), and Spanish (`es`, with the Latin American overlay -`es-419`), French (`fr`), German (`de`), Brazilian Portuguese (`pt-BR`), Japanese (`ja`), Korean (`ko`), -Simplified Chinese (`zh-Hans`), Czech (`cs`) and Indonesian (`id`), machine-drafted and waiting for -native speakers' review. Russian (`ru`, Русский) was reviewed and approved by VanTan; its catalog -keeps Frame, Dev Mode and Smart animate as familiar tool names and uses « » quotes. Turkish (`tr`) -was machine-drafted and reviewed by a native speaker. -`es-419`), French (`fr`), German (`de`), Brazilian Portuguese (`pt-BR`), Japanese (`ja`), Korean (`ko`) -and Simplified Chinese (`zh-Hans`), machine-drafted and waiting for native speakers' review, and -Swedish (`sv`), which translates every UI string, command label and menu wording. +`es-419`), French (`fr`), German (`de`), Dutch (`nl`), Brazilian Portuguese (`pt-BR`), Japanese (`ja`), +Korean (`ko`), Simplified Chinese (`zh-Hans`), Czech (`cs`) and Indonesian (`id`), machine-drafted +and waiting for native speakers' review. Russian (`ru`, Русский) was reviewed and approved by +VanTan; its catalog keeps Frame, Dev Mode 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. ## The catalogs From a819e0a18847a865f6535712a580228f7ae7bde8 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 12:28:27 +0700 Subject: [PATCH 238/817] =?UTF-8?q?#776:=20Edit=20=E2=96=B8=20Delete=20fro?= =?UTF-8?q?m=20the=20menu=20bar=20removes=20the=20open=20interaction=20too?= =?UTF-8?q?=20(the=20guard=20moves=20to=20menus::invoke,=20which=20the=20D?= =?UTF-8?q?elete=20binding=20also=20reaches);=20has=5Fselected=5Finteracti?= =?UTF-8?q?on=20goes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/ui-egui/src/menus.rs | 3 +++ crates/ui-egui/src/proto_editor_tests.rs | 17 +++++++++++++++++ crates/ui-egui/src/proto_panel.rs | 7 ------- crates/ui-egui/src/shortcuts.rs | 8 -------- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index c917bd236..e32f50c88 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -114,6 +114,9 @@ pub fn record_recent(app: &mut FigApp, key: &str) { pub fn invoke(app: &mut FigApp, id: &str) { match id { + // Edit ▸ Delete (and the Delete binding) with an interaction open in the Prototype tab + // removes that interaction, not the layer (#767). + "edit.delete" if app.ui_context.clone().is_some_and(|ctx| crate::proto_panel::delete_selected_interaction(app, &ctx)) => {} "file.open" => app.open_dialog(), "plugin.import" => crate::plugins_ui::import_dialog(app), "file.import" => app.import_dialog(false), diff --git a/crates/ui-egui/src/proto_editor_tests.rs b/crates/ui-egui/src/proto_editor_tests.rs index 31988a353..c63e62c60 100644 --- a/crates/ui-egui/src/proto_editor_tests.rs +++ b/crates/ui-egui/src/proto_editor_tests.rs @@ -262,6 +262,23 @@ fn deleting_a_prototype_interaction_removes_the_interaction_not_the_component() assert!(u.app.session.doc().unwrap().node(btn).is_none(), "when no interaction is selected, Delete removes the layer"); } +/// Edit ▸ Delete from the menu bar does the same as the Delete key (#767). +#[test] +fn edit_delete_from_the_menu_removes_the_open_interaction_not_the_layer() { + 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]})); + crate::proto_panel::open_editor(&u.ctx, Some((btn, 0))); + u.frames(1, Vec::new); + crate::menus::invoke(&mut u.app, "edit.delete"); + let doc = u.app.session.doc().unwrap(); + assert!(doc.node(btn).is_some_and(|n| n.interactions.is_empty()), "the interaction goes, the layer stays"); + assert_eq!(crate::proto_panel::editor(&u.ctx), None); + crate::menus::invoke(&mut u.app, "edit.delete"); + assert!(u.app.session.doc().unwrap().node(btn).is_none(), "with no interaction open, Edit ▸ Delete deletes the layer"); +} + #[test] fn escape_closes_prototype_editor_without_deselecting_layer() { let (s, a, _b, btn) = setup(); diff --git a/crates/ui-egui/src/proto_panel.rs b/crates/ui-egui/src/proto_panel.rs index 20546008d..85af66c59 100644 --- a/crates/ui-egui/src/proto_panel.rs +++ b/crates/ui-egui/src/proto_panel.rs @@ -40,13 +40,6 @@ pub fn editor(ctx: &egui::Context) -> Option<(NodeId, usize)> { ctx.data(|d| d.get_temp(editor_id())) } -/// Whether an interaction is selected (its editor is open). -pub fn has_selected_interaction(app: &FigApp, ctx: &egui::Context) -> bool { - let Some((node, index)) = editor(ctx) else { return false }; - let Ok(ds) = app.session.ds() else { return false }; - ds.doc.node(node).and_then(|n| n.interactions.get(index)).is_some() -} - /// Delete the selected interaction (when one is active in the Prototype tab). /// Returns true if an interaction was deleted. pub fn delete_selected_interaction(app: &mut FigApp, ctx: &egui::Context) -> bool { diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index 695457afe..f31979600 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -225,14 +225,6 @@ pub fn run_binding(app: &mut FigApp, id: &str) { "edit.delete" if app.session.tool.pen.is_some() => { let _ = app.session.pen_finish(); } - "edit.delete" - if app.ui.right_tab == crate::RightTab::Prototype - && app.ui_context.as_ref().is_some_and(|ctx| crate::proto_panel::has_selected_interaction(app, ctx)) => - { - if let Some(ctx) = app.ui_context.clone() { - let _ = crate::proto_panel::delete_selected_interaction(app, &ctx); - } - } // Enter with a shape or frame tool chosen places one in the middle of the view. "select.children" if app.session.tool.tool.draws_shape() => { app.run("tool.place", json!({})); From 633455c380aeda72fb8d198805ef3f9007045c3c Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 13:25:02 +0700 Subject: [PATCH 239/817] #787: leave the progress docs to the maintainer --- ROADMAP.md | 17 ++++-------- docs/gaps.md | 24 ++++++++--------- docs/localization-parity.md | 53 +++++++++++++++++-------------------- 3 files changed, 41 insertions(+), 53 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index a8af7b498..8a587286d 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (Dutch draft catalog complete at 100% of the strings, machine-drafted and awaiting native review; language table re-measured over 2,315 entries; preceding: 2026-10-17 community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -63,7 +63,7 @@ native speakers' reviews of the six language drafts need people. | Stability | 55% | 20–40 | [gaps](docs/gaps.md) | | Performance | 60% | 30–60 | [hardware-parity](docs/hardware-parity.md) | | Hardware | 60% | 10–21 | [hardware-parity](docs/hardware-parity.md) | -| Localization | 39% (layer; English; Spanish with a Latin American overlay, French, German, Dutch, Brazilian Portuguese, Japanese, Korean, Simplified Chinese drafts; CJK UI fonts) | 29–51 | [localization-parity](docs/localization-parity.md) | +| Localization | 39% (layer; English; Spanish with a Latin American overlay, French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese drafts; CJK UI fonts) | 29–51 | [localization-parity](docs/localization-parity.md) | | Platforms | 75% | 10–20 | [hardware-parity](docs/hardware-parity.md) | | Ecosystem / plugins | 38% (own WASM plugins with panels, settings and widgets; a self-hosted plugin directory) | 8–26 | [gaps](docs/gaps.md) | | AI features | 0% | 30–60 | [gaps](docs/gaps.md) | @@ -103,7 +103,6 @@ native speakers' reviews of the six language drafts need people. | Spanish | es, es-419 | 100% (es-419: an overlay of 101 entries) | draft (needs native review) | | Hindi | hi | 0% | none | | Arabic | ar | 0% | none | -| Dutch | nl | 100% | draft (needs native review) | | French | fr | 95% | draft (needs native review) | | Portuguese (Brazil) | pt-BR | 95% | draft (needs native review) | | Indonesian | id | 99% | draft (needs native review) | @@ -112,14 +111,9 @@ native speakers' reviews of the six language drafts need people. | Korean | ko | 95% | draft (needs native review) | | Vietnamese | vi | 0% | none | -Percentages measured 2026-10-18 over 2,315 entries (1,718 UI keys, 566 command labels and 31 menu -wordings; strings added since a draft show English). Also shipped: Russian (`ru`, 99%, reviewed by -VanTan), Swedish (`sv`, 99.6%, command labels since 2026-10-17; native review welcome), Turkish -(`tr`, 99%) and Czech (`cs`, 99%, draft). Figma ships English, Japanese, Korean, French, German, -Spanish and Portuguese +Percentages measured 2026-10-17 over 2,272 entries (strings added since a draft show English). Also shipped: Russian (`ru`, 99%, reviewed by VanTan), Swedish (`sv`, 99.6%, command labels since 2026-10-17; native review welcome), Turkish (`tr`, 99%) and Czech (`cs`, 99%, draft). Figma ships English, Japanese, Korean, French, German, Spanish and Portuguese (Brazil); FigCraft has the localization layer, English and Spanish (Spain and Latin America), -French, German, Dutch, Brazilian Portuguese, Japanese, Korean, Simplified Chinese and Indonesian -drafts (Preferences ▸ +French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese and Indonesian drafts (Preferences ▸ Language; Traditional Chinese has no catalog; CJK UI text uses an installed CJK font, loaded only when needed; adding a language: [`docs/translating.md`](docs/translating.md)). Document text in any script (bidi, Arabic shaping, @@ -132,7 +126,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). 1. `.fig` import's tail: fixes from real files, connector labels, table cells, filled areas with their own fills (the best-effort import, editable vector networks, the other layer kinds and variable prototype actions landed 2026-10-11): 5–10 h; then checking the rest of the experimental `.fig` export (landed 2026-10-12; written files open and draw in other software) on effects, images, prototypes and real files: 5–15 h. 2. Real-file corpus and measured fidelity: 15–30 h. 3. Tool-by-tool interaction pass against Figma: 40–60 h. -4. Languages: native reviews of the es, fr, nl, de, pt-BR, ja and ko drafts (people), Latin American Spanish (1–2 h), then Simplified Chinese (3–5 h). +4. Languages: native reviews of the es, fr, de, pt-BR, ja and ko drafts (people), Latin American Spanish (1–2 h), then Simplified Chinese (3–5 h). 5. Multiplayer (M9): accounts and teams on top of the live sessions and the standalone server (transport, hosting, invite links that open the app, document sync, presence with remote text carets, cursor chat and spotlight, per-user undo, reconnect with offline edits, collision-free ids for styles, variables and comments, the browser client, `figcraft-server` with persistence and share links to edit or view, team libraries on the server landed): 42–84 h. ## Progress log @@ -322,7 +316,6 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| -| 2026-10-18 | minor | Dutch draft catalog (gap 5): `nl.toml` translates every UI string (1,718 keys; 41 with plural forms, one/other), every command label (566) and every menu wording (31) — 2,315 entries, machine-drafted in one style pass and marked as a draft awaiting native review; established tool terms (frame, auto layout, component, variant, prototype, overlay, widget, plugin, branch, constraints) and blend-mode, brush-preset and boolean names stay English, informal je register, infinitive menu labels, months abbreviated the Dutch way (jan., feb., mrt., apr., mei, …), `%` without a space and ordinary quotes. Preferences ▸ Language lists Nederlands; System maps any Dutch tag (nl-NL, nl…) to it, and the language-tag tests that used Dutch as a no-catalog example switched to Hindi. String counts re-measured from all catalogs: 1,718 UI keys, 566 command labels and 31 menu wordings (2,315 entries); the other drafts read 95–99% on the new basis. Numbers unchanged | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | diff --git a/docs/gaps.md b/docs/gaps.md index 68ee6d105..9b1a770c1 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Where FigCraft falls short of Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (a Dutch draft: `nl.toml` at 100% of the strings, machine-drafted, awaiting native review; the catalogs re-measured over 2,315 entries; preceding: the 2026-10-17 landings: `.fig` import fidelity, budgets for large files, the import report, a `.fig` copy from Save as and paste from another design app (gap 1); menus, the Actions palette, editor fixes, Selection colors and smart-selection spacing (gap 4); catalog counts re-measured (gap 5); bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (the 2026-10-17 landings: `.fig` import fidelity, budgets for large files, the import report, a `.fig` copy from Save as and paste from another design app (gap 1); menus, the Actions palette, editor fixes, Selection colors and smart-selection spacing (gap 4); catalog counts re-measured (gap 5); bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) Every known shortfall against Figma, one entry each, ranked by how much it stops a Figma user from doing real work in FigCraft. Agents: pick work from the top unless the owner says otherwise. The @@ -18,7 +18,7 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe | 2 | Multiplayer and sharing are a preview, without accounts (**beta blocker**) | Feature | 42–84 | [collaboration-parity](collaboration-parity.md) | | 3 | Nothing checked against real Figma files | Fidelity | 15–30 | [target-app-parity](target-app-parity.md) | | 4 | Interaction fidelity not compared tool by tool | UI/UX | 40–60 | [ui-parity](ui-parity.md) | -| 5 | Localization: English, reviewed Russian, plus unreviewed Spanish (and Latin American Spanish), German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Czech drafts; Dutch complete as an unreviewed draft; Turkish and Swedish catalogs | Localization | 29–51 | [localization-parity](localization-parity.md) | +| 5 | Localization: English, reviewed Russian, plus unreviewed Spanish (and Latin American Spanish), French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Czech drafts; Turkish and Swedish catalogs | Localization | 29–51 | [localization-parity](localization-parity.md) | | 6 | Plugins: widgets take clicks only, a self-hosted directory but no public catalogue; Figma's plugins don't run | Ecosystem | 8–26 | [target-app-parity](target-app-parity.md) | | 7 | CPU canvas where Figma uses the GPU | Hardware/performance | 30–60 | [hardware-parity](hardware-parity.md) | | 8 | Platform QA: Linux and the browser left (Windows pass done 2026-10-11) | Stability/platforms | 10–20 | [hardware-parity](hardware-parity.md) | @@ -179,27 +179,26 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe - **Estimate:** 40–60 h. Detail in [`ui-parity.md`](ui-parity.md). ### 5. Localization: English, reviewed Russian, plus unreviewed drafts -- **Missing:** native reviews of the Spanish, French, German, Dutch, Brazilian Portuguese, - Japanese, Korean, Simplified Chinese, Indonesian and Czech drafts and the Latin American Spanish +- **Missing:** native reviews of the Spanish, French, German, Brazilian Portuguese, Japanese, + Korean, Simplified Chinese, Indonesian and Czech drafts and the Latin American Spanish overlay, the strings added since each catalog was drafted (1–5% of each), Hindi, Arabic and Vietnamese, localized engine messages and number formatting; CJK UI text on the web without the craft-fonts CJK build. - **Evidence (measured from source):** the layer landed 2026-10-11: catalogs in - `crates/ui-egui/locales/` (measured 2026-10-18: 1,718 UI keys plus 566 command labels and 31 - menu wordings, 2,315 entries), Preferences ▸ Language, `pref.language`; `en.toml` is complete, - Spanish is held to completeness by the check, and Dutch (2026-10-18) covers every string as a - draft; the German, Brazilian Portuguese, Japanese, Korean and Simplified Chinese machine drafts - cover 95–99% (strings added since they were drafted show English), with `es-419.toml` a Latin - American overlay listing only what + `crates/ui-egui/locales/` (measured 2026-10-17: 1,680 UI keys plus 561 command labels and 31 + menu wordings, 2,272 entries), Preferences ▸ Language, `pref.language`; `en.toml` is complete, + Spanish is held to completeness by the check, and the French, German, Brazilian Portuguese, + Japanese, Korean and Simplified Chinese machine drafts cover 95–99% (strings added since they + were drafted show English), with `es-419.toml` a Latin American overlay listing only what differs from Spanish. Russian (reviewed and approved by VanTan, one/few/many integer plurals) covers 98.8%; Indonesian and Czech drafts, a Turkish catalog whose header says a native speaker - reviewed it, and a Swedish catalog (with its command labels since 2026-10-17) cover 98.8–99.6% ([localization-parity](localization-parity.md#languages)). + reviewed it, and a Swedish catalog (with its command labels since 2026-10-17) cover 98.7–99.6% ([localization-parity](localization-parity.md#languages)). CJK UI text uses an installed CJK face the desktop app loads when something on screen needs it (`crates/ui-egui/src/cjk.rs`). Engine error messages and Dev Mode values stay English. - **Impact:** non-English designers get machine drafts nobody has reviewed yet, and English errors. - **Estimate:** 3–7 h per language plus native review, 4–6 h for engine messages and numbers; - 29–51 h for the key languages left and the drafts' follow-ups (kept on 2026-10-18: the + 29–51 h for the key languages left and the drafts' follow-ups (kept on 2026-10-17: the Indonesian draft takes 2–3 h off, about what bringing the drafts that slipped to 95% back to every string adds). Detail in [`localization-parity.md`](localization-parity.md); how to add one in @@ -445,7 +444,6 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe | Date | Change | Summary | |---|---|---| -| 2026-10-18 | minor | Dutch draft (gap 5): `nl.toml` at 100% of the strings (1,718 UI keys, 566 command labels, 31 menu wordings — 2,315 entries), machine-drafted, a draft awaiting native review; the catalog counts re-measured over all languages (the other drafts read 95–99% on the new basis), the language table rows and evidence refreshed. Ranking and hours unchanged | | 2026-10-17 | minor | The 2026-10-17 landings. Gap 1: a new Landed entry (community batches #727 and #728, then #745: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments, images in the message, instance layers' size and resizing overrides, Hug where nothing is recorded; budgets from the file's size; the import report; a `.fig` copy from Save as; paste from another design app), its Missing list cut to what is still left, and the wrong "whether other apps open its files is unknown" replaced by what was checked; all on synthetic files, so the beta blocker and hours stand. Gap 2: server limits, log recovery and web join links in the evidence. Gap 4: menus, the Actions palette and the editor fixes (#733, #735, #736, #729), then Selection colors and smart-selection spacing (#753) landed, none compared side by side. Gap 5: catalog counts re-measured (2,272 entries; drafts at 95–99%; Indonesian, Czech, Turkish and Swedish listed). Gap 8: the Linux and BSD clipboard changes and Wayland window controls, not run there by the maintainers. Ranking and hours unchanged | | 2026-10-15 | minor | Gap 7: bounded canvas overscan for smoother panning. Estimates and ranking unchanged. | | 2026-10-14 | minor | Russian catalog (M9), reviewed and approved by VanTan: all 2,165 current entries, Русский in Preferences and regional ru tags. Russian integer plurals use one/few/many; contributor display name VanTan added. Existing estimates unchanged. | diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 7df91731c..50fcd4ec3 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -1,12 +1,12 @@ # Localization parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (a Dutch draft: `nl.toml` at 100% of the strings, machine-drafted, awaiting native review; the language table re-measured over 2,315 entries; macOS finds its downloadable CJK system fonts (#406); Swedish command labels and menu wordings; Russian, Swedish, Turkish, Czech and Indonesian listed; a duplicated paragraph removed; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (macOS finds its downloadable CJK system fonts (#406); string counts re-measured: 2,272 entries, the drafts at 95–99%; Swedish command labels and menu wordings; Russian, Swedish, Turkish, Czech and Indonesian listed; a duplicated paragraph removed; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog) · **Target:** Figma Design (desktop app 126.10.7) FigCraft's interface has a localization layer with an English catalog, a Russian catalog reviewed by a native speaker, and Spanish (with a Latin American overlay), French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Czech drafts (machine-drafted, -waiting for native speakers' review), plus Dutch, Swedish and Turkish catalogs. This page lists the -twelve key languages of the craftrules standard, then the other languages Figma ships. How to add a +waiting for native speakers' review), plus Swedish and Turkish catalogs. This page lists the twelve key +languages of the craftrules standard, then the other languages Figma ships. How to add a language: [`translating.md`](translating.md). ## What Figma ships @@ -18,21 +18,21 @@ browser's page translation. The `.lproj` folders in `/Applications/Figma.app` (6 Electron/Chromium locale packs, not Figma's own UI languages. Text *content* in any script is supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no vertical text. -## What FigCraft has (measured 2026-10-18, from source) +## What FigCraft has (measured 2026-10-17, from source) - **Layer:** one TOML catalog per language in `crates/ui-egui/locales/`, baked into the binary by the UI crate's build script (desktop and web; nothing read at run time). Keys are the English text (`tr("Fill")`, `trf` for `{named}` placeholders, `trn` for counts with one/few/many/other plural forms), so a missing translation shows English, never a raw key. One English text that needs two translations takes a context (`"Fill|sizing"`). -- **Strings:** 1,718 UI keys in `en.toml` (41 with plural forms; ~110 are labels from engine and - document data, such as tool names, blend modes and Dev Mode properties) plus 566 command labels - and 31 menu wordings by command id: 2,315 entries (counted against `en.toml` and the complete +- **Strings:** 1,680 UI keys in `en.toml` (41 with plural forms; ~110 are labels from engine and + document data, such as tool names, blend modes and Dev Mode properties) plus 561 command labels + and 31 menu wordings by command id: 2,272 entries (counted against `en.toml` and the complete Spanish catalog's command and menu tables). Command ids, the CLI, MCP and the control channel stay English. Accessibility names come from the same strings. - **Language preference:** Preferences ▸ Language (System, then each catalog by its own name: English, Čeština, Deutsch, Español, Español (Latinoamérica), Français, Bahasa Indonesia, 日本語, - 한국어, Nederlands, Português (Brasil), Русский, Svenska, Türkçe, 简体中文), applied at once without a + 한국어, Português (Brasil), Русский, Svenska, Türkçe, 简体中文), applied at once without a restart; System takes the first of the OS's preferred languages that has a catalog (on Windows only the first preferred language counts, since that list also holds the languages added for a keyboard; macOS AppleLanguages, `LANGUAGE` then the locale variables on Linux and BSD; a regional @@ -85,24 +85,23 @@ supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no v | Language | Code | UI strings translated | Dialogs / tooltips / help | Script support | Native review | Status | Hours to full | |---|---|---|---|---|---|---|---| -| English | en | 2,315 / 2,315 (100%, source) | yes | Latin | yes (source) | full | 0 | -| Simplified Chinese (Mandarin) | zh-Hans | 2,209 / 2,315 (95.4%, draft) | yes | CJK text and IME in documents; UI text in an installed Chinese face, ahead of Japanese ones (web: the `FIGCRAFT_EMBED_CJK` build); no Traditional Chinese catalog (zh-TW, zh-HK read English) | no | draft | 1–2 (after native review) | -| Spanish | es, es-419 | 2,315 / 2,315 (100%, draft); es-419 overlays 104 Latin American wordings (draft) | yes | Latin | no | draft | 0–1 (after native review) | +| English | en | 2,272 / 2,272 (100%, source) | yes | Latin | yes (source) | full | 0 | +| Simplified Chinese (Mandarin) | zh-Hans | 2,166 / 2,272 (95.3%, draft) | yes | CJK text and IME in documents; UI text in an installed Chinese face, ahead of Japanese ones (web: the `FIGCRAFT_EMBED_CJK` build); no Traditional Chinese catalog (zh-TW, zh-HK read English) | no | draft | 1–2 (after native review) | +| Spanish | es, es-419 | 2,272 / 2,272 (100%, draft); es-419 overlays 101 Latin American wordings (draft) | yes | Latin | no | draft | 0–1 (after native review) | | Hindi | hi | 0 (0%) | no | Devanagari shaping works in documents; UI font fallback to check | no | none | 4–7 | | Arabic | ar | 0 (0%) | no | Bidi, shaping and RTL names work; the UI does not mirror | no | none | 9–15 | -| French | fr | 2,210 / 2,315 (95.5%, draft) | yes | Latin | no | draft | 1–2 (after native review) | -| Portuguese | pt-BR | 2,210 / 2,315 (95.5%, draft) | yes | Latin | no | draft | 1–2 (after native review) | -| Indonesian | id | 2,287 / 2,315 (98.8%, draft) | yes | Latin | no | draft | 1–2 (after native review) | -| Japanese | ja | 2,297 / 2,315 (99.2%, draft) | yes | CJK text and IME in documents; UI text in an installed Japanese face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | -| German | de | 2,219 / 2,315 (95.9%, draft) | yes | Latin; long words elide in narrow fields | no | draft | 1–2 (after native review) | -| Korean | ko | 2,209 / 2,315 (95.4%, draft) | yes | Hangul text and IME in documents; UI text in an installed Korean face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | +| French | fr | 2,167 / 2,272 (95.4%, draft) | yes | Latin | no | draft | 1–2 (after native review) | +| Portuguese | pt-BR | 2,167 / 2,272 (95.4%, draft) | yes | Latin | no | draft | 1–2 (after native review) | +| Indonesian | id | 2,244 / 2,272 (98.8%, draft) | yes | Latin | no | draft | 1–2 (after native review) | +| Japanese | ja | 2,254 / 2,272 (99.2%, draft) | yes | CJK text and IME in documents; UI text in an installed Japanese face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | +| German | de | 2,176 / 2,272 (95.8%, draft) | yes | Latin; long words elide in narrow fields | no | draft | 1–2 (after native review) | +| Korean | ko | 2,166 / 2,272 (95.3%, draft) | yes | Hangul text and IME in documents; UI text in an installed Korean face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | | Vietnamese | vi | 0 (0%) | no | Latin with stacked diacritics | no | none | 3–5 | -Other languages (measured 2026-10-18): Russian (`ru`) 2,287 / 2,315 (98.8%), reviewed and approved -by VanTan, one/few/many integer plurals; Dutch (`nl`) 2,315 / 2,315 (100%), machine-drafted, one/other -plurals; Swedish (`sv`) 2,307 (99.6%), its command labels and menu -wordings added 2026-10-17 (#599), native review welcome; Turkish (`tr`) 2,286 (98.8%), whose header -says it was machine-drafted and reviewed by a native speaker; Czech (`cs`) 2,287 (98.8%), a draft +Other languages (measured 2026-10-17): Russian (`ru`) 2,244 / 2,272 (98.8%), reviewed and approved +by VanTan, one/few/many integer plurals; Swedish (`sv`) 2,264 (99.6%), its command labels and menu +wordings added 2026-10-17 (#599), native review welcome; Turkish (`tr`) 2,243 (98.7%), whose header +says it was machine-drafted and reviewed by a native speaker; Czech (`cs`) 2,244 (98.8%), a draft with one/few/other plurals. Figma ships none beyond the eight above. The layer is done. Per-language hours above are agent hours for a catalog of ~1,800 entries @@ -110,19 +109,17 @@ The layer is done. Per-language hours above are agent hours for a catalog of ~1, it isn't one/other; every language also needs a native speaker's review (human). Left before full parity besides the languages: localizing engine messages and number formatting (4–6 h); right-to-left mirroring of the panels is in Arabic's hours. Total: **29–51 h** (kept on -2026-10-18: bringing the drafts that slipped behind the newest strings back again balances -against the finished drafts like Indonesian's). +2026-10-17: Indonesian's draft takes 2–3 h off, about what bringing the drafts back from 95% to +every string adds). Priority: native reviews of the drafts and the es-419 overlay (every one of Figma's languages -and variants has one, plus Simplified Chinese, Indonesian, Czech and Dutch, which Figma doesn't -ship), then Hindi, Vietnamese and Arabic. Traditional Chinese is not planned (no catalog; its users -see English). +and variants has one, plus Simplified Chinese, Indonesian and Czech, which Figma doesn't ship), then +Hindi, Vietnamese and Arabic. Traditional Chinese is not planned (no catalog; its users see English). ## Revision history | Date | Change | Summary | |---|---|---| -| 2026-10-18 | minor | A Dutch draft (gap 5): `nl.toml` translates every UI string (1,718 keys; 41 with plural forms, one/other), every command label (566) and every menu wording (31) — 2,315 entries — machine-drafted in one style pass (informal je register, infinitive menu labels, sentence case, months abbreviated the Dutch way: jan., feb., mrt., apr., mei…; established tool terms such as frame, auto layout, component, variant, prototype, overlay, widget, plugin, branch and constraints, and blend-mode, brush-preset and boolean names stay English) and marked as a draft awaiting native review; Preferences ▸ Language lists Nederlands, System maps any Dutch tag (nl-NL, nl…) to it, Dutch's default plural rule is the one/other default. The language-tag tests that used Dutch as a language without a catalog switched to Hindi, and the language table is re-measured over 2,315 entries (the drafts read 95–99%) | | 2026-10-17 | minor | Chinese showed as boxes on macOS (#406): the font scan also walks the system's downloaded font assets (`/System/Library/AssetsV2` and the older `/System/Library/Assets`, only their `com_apple_MobileAsset_Font*` folders), where current versions keep PingFang SC, and Hiragino Sans GB and Heiti SC join the Chinese UI faces and the text fallbacks. Tested with a folder laid out the same way; not yet run on a Mac | | 2026-10-17 | minor | String counts re-measured from the catalogs: 1,680 UI keys, 561 command labels and 31 menu wordings (2,272 entries); Spanish complete, the other drafts at 95.3–99.2% (strings added since 2026-10-12 show English), es-419 101 entries. Indonesian has a draft (98.8%; it was listed as none); Russian (98.8%, reviewed), Swedish (99.6%, command labels and menu wordings from #599), Turkish (98.7%) and Czech (98.8%) listed with counts; the language picker's list updated; a paragraph repeated by a merge removed. Grade and hours unchanged (Indonesian's draft is offset by the drafts' new gaps) | | 2026-10-14 | minor | Windows UI language (#291): the interface language comes from Windows' first preferred language alone; that list is also the input-language list (a German keyboard on a Polish system adds Deutsch), and taking the first entry with a catalog turned the interface German there. A first preferred language without a catalog reads English; macOS AppleLanguages and gettext's `LANGUAGE` still take the first language with a catalog | From ae89635e009aa54face30ac23ff0d6be68c4108f Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 13:25:03 +0700 Subject: [PATCH 240/817] #787: translate the 11 strings main gained since the catalog was drafted --- crates/ui-egui/locales/nl.toml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crates/ui-egui/locales/nl.toml b/crates/ui-egui/locales/nl.toml index c8eb06978..8d8cac680 100644 --- a/crates/ui-egui/locales/nl.toml +++ b/crates/ui-egui/locales/nl.toml @@ -93,6 +93,7 @@ status = "draft — needs native review" "All components" = "Alle components" "All fonts" = "Alle lettertypen" "All supported properties" = "Alle ondersteunde eigenschappen" +"All the fonts this file uses are installed" = "Alle lettertypen die dit bestand gebruikt zijn geïnstalleerd" "All variables" = "Alle variabelen" "Alpha" = "Alpha" "Alphabetical" = "Alfabetisch" @@ -220,6 +221,7 @@ status = "draft — needs native review" "Changes on main" = "Wijzigingen op main" "Changes on the branch" = "Wijzigingen op de branch" "Changes unknown" = "Onbekende wijzigingen" +"Checking the fonts installed on this computer…" = "De lettertypen op deze computer worden gecontroleerd…" "Checking the server…" = "Server controleren…" "Choose React, Leptos, SwiftUI or Compose above to connect this component to its code." = "Kies hierboven React, Leptos, SwiftUI of Compose om dit component aan zijn code te koppelen." "Choose another profile to change it." = "Kies een ander profiel om dit te wijzigen." @@ -649,6 +651,7 @@ status = "draft — needs native review" "Instance swap (no other component)" = "Instance verwisselen (geen andere component)" "Instances" = "Instances" "Instant" = "Direct" +"Intensity" = "Intensiteit" "Interaction" = "Interactie" "Interactions" = "Interacties" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Interface-ontwerp en prototyping. Een gratis, open-source, clean-room ontwerptool, helemaal van nul geschreven in Rust, onderdeel van de ArtCraft Crafting Apps." @@ -773,6 +776,7 @@ status = "draft — needs native review" "Mirror angle and length" = "Spiegel hoek en lengte" "Mirroring" = "Spiegeling" "Missing" = "Ontbreekt" +"Missing fonts" = "Ontbrekende lettertypen" "Missing layer" = "Ontbrekende laag" "Missing style" = "Ontbrekende stijl" "Missing variable" = "Ontbrekende variabele" @@ -831,6 +835,7 @@ status = "draft — needs native review" "No conflicts." = "Geen conflicten." "No contributor data was built into this copy." = "In deze kopie zijn geen bijdragersgegevens ingebouwd." "No device" = "Geen apparaat" +"No files or templates match your search" = "Geen bestanden of sjablonen komen overeen met je zoekopdracht" "No fonts match" = "Geen lettertypen gevonden" "No join code here (the server is older than join codes, or this address can't be put in one): share the link instead." = "Hier is geen toegangscode (de server is ouder dan toegangscodes, of dit adres past niet in een code): deel in plaats daarvan de link." "No layer changes to show." = "Geen lagenwijzigingen om te tonen." @@ -1173,9 +1178,11 @@ status = "draft — needs native review" "Search actions, layers and tools" = "Zoek naar acties, lagen en tools" "Search assets" = "Zoek assets" "Search comments" = "Zoeken in reacties" +"Search files and templates" = "Bestanden en sjablonen zoeken" "Search fonts" = "Lettertypen zoeken" "Search layers" = "Lagen doorzoeken" "Search plugins" = "Zoeken naar plugins" +"Search results" = "Zoekresultaten" "Search shortcuts" = "Sneltoetsen zoeken" "Search templates" = "Sjablonen zoeken" "Section" = "Sectie" @@ -1377,6 +1384,7 @@ status = "draft — needs native review" "This file" = "Dit bestand" "This file has unsaved changes" = "Dit bestand heeft niet-opgeslagen wijzigingen" "This file is on {server}, open only to you. Share it to let others in with a new code." = "Dit bestand staat op {server}, alleen toegankelijk voor jou. Deel het om anderen binnen te laten met een nieuwe code." +"This file uses fonts that aren't installed on this computer. Their text is drawn in a fallback font until you install them." = "Dit bestand gebruikt lettertypen die niet op deze computer zijn geïnstalleerd. Hun tekst wordt in een vervangend lettertype getoond tot je ze installeert." "This frame is new on the branch." = "Dit frame is nieuw op de branch." "This frame isn't on the branch." = "Dit frame staat niet op de branch." "This server is open to the public: no key needed." = "Deze server is voor iedereen toegankelijk: geen sleutel nodig." @@ -1405,6 +1413,7 @@ status = "draft — needs native review" "Truncate with an ellipsis" = "Afkappen met een beletselteken" "Try again" = "Probeer het opnieuw" "Try another search or filter." = "Probeer een andere zoekopdracht of filter." +"Try another search, or browse templates." = "Probeer een andere zoekopdracht of bekijk de sjablonen." "Try another word, or look at every kind." = "Probeer een ander woord, of bekijk alle soorten." "Turn a layer into a component, reuse it, and change every copy at once" = "Maak van een laag een component, hergebruik die en verander alle kopieën tegelijk" "Two digits" = "Twee cijfers" @@ -1595,6 +1604,7 @@ status = "draft — needs native review" "nobody else here yet" = "nog niemand anders hier" "non-default slot settings are not represented and were skipped" = "niet-standaard slot-instellingen zijn niet overgenomen en zijn overgeslagen" "now" = "nu" +"only in a text style or variable" = "alleen in een tekststijl of variabele" "or" = "of" "point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "Lijnverbindingen op punten zijn behouden; gestreepte lijnen of lijnen met variabele breedte worden weergegeven met de verbinding van de laag" "preferred slot component keys cannot be resolved to file nodes and were skipped" = "voorkeurssleutels van slotcomponenten konden niet naar bestandsknooppunten worden herleid en zijn overgeslagen" @@ -1702,6 +1712,7 @@ status = "draft — needs native review" "{n} replies" = { one = "{n} antwoord", other = "{n} antwoorden" } "{n} rows" = { one = "{n} rij", other = "{n} rijen" } "{n} styles" = { one = "{n} stijl", other = "{n} stijlen" } +"{n} text layers" = { one = "{n} tekstlaag", other = "{n} tekstlagen" } "{n} variables" = { one = "{n} variabele", other = "{n} variabelen" } "{n} weeks ago" = { one = "{n} week geleden", other = "{n} weken geleden" } "{n} years ago" = { one = "{n} jaar geleden", other = "{n} jaar geleden" } From 99e5db399ba3141a4b06c4a4e61c5fe2128e3ebf Mon Sep 17 00:00:00 2001 From: BFlat Date: Sun, 18 Oct 2026 14:09:51 +0700 Subject: [PATCH 241/817] M7: quitting on macOS ends the process after saving, avoiding the Touch Bar teardown crash (#781) (#791) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - **Quit (macOS):** `on_exit` now calls `services::shutdown` and then, on macOS only, `std::process::exit(0)`. This happens before eframe tears the windows down, which is where the crash in #781 is thrown (same approach as the sibling apps, tracked in craft-libs#3). - **`services::shutdown(app, dir, recovery)`** replaces `save_state`. It runs on every platform and everything in it is finished before it returns: 1. the preferences (`state.json`) are written atomically, as before; 2. this run's recovery copies are settled by the new `Recovery::quit(session, asked)`: - if the unsaved-changes question was asked (`ui.quit`: last window closed through the question, or `app.quit`), or nothing is unsaved, it works as before: `finish()` removes them; - otherwise the unsaved documents are copied (waiting for any copy still being written) and the copies stay for the next start, as after a crash. This is the macOS Quit menu (Cmd+Q): winit's menu calls `terminate:`, which reaches `on_exit` without asking. Until now that path removed the recovery copies of files that had unsaved changes; 3. live sessions end explicitly: a session this app hosts tells everyone and stops; a joined session is left. Before, this only happened in the app's thread-local destructor at process exit, if at all. - If the app can't be reached in `on_exit` (it's busy), the recovery copies are left on disk for the next start rather than removed. Quit paths checked: - **Cmd+Q / the menu bar's Quit (macOS):** `terminate:` → winit `applicationWillTerminate` → eframe `exiting` → `on_exit`. Covered. - **Last window closed** (close button, title bar Close, Dock/Finder quit Apple event → `Close`): `on_close_request` → `begin` sets `ui.quit` → root `Close` → `on_exit`. Covered. - **`app.quit` (control channel / MCP):** sets `ui.quit` and closes the root window → `on_exit`. Covered. Its reply goes to the connection thread before the window closes. The process now ends sooner after that, so a client that reads very slowly could in theory see EOF instead of the reply (not seen). - **The frame guard (panic):** isn't a quit. It writes recovery copies and the app keeps running, so it doesn't need this. A panic outside the guard aborts as before. - **eframe error mid-run:** eframe also calls `on_exit` before `run_native` returns `Err`. On macOS that error now only reaches the log (eframe logs it), not the "window couldn't open" box. Startup failures still show the box: `on_exit` only runs once the app exists. Part of #781. --- apps/figcraft/src/main.rs | 11 +++++---- apps/figcraft/src/recovery.rs | 11 +++++++++ apps/figcraft/src/recovery_tests.rs | 17 ++++++++++++++ apps/figcraft/src/services.rs | 14 +++++++++--- apps/figcraft/src/services_tests.rs | 35 +++++++++++++++++++++++++++++ docs/hardware-parity.md | 5 +++-- 6 files changed, 84 insertions(+), 9 deletions(-) diff --git a/apps/figcraft/src/main.rs b/apps/figcraft/src/main.rs index fe89d0a75..ddb702043 100644 --- a/apps/figcraft/src/main.rs +++ b/apps/figcraft/src/main.rs @@ -107,10 +107,13 @@ impl eframe::App for App { } fn on_exit(&mut self) { - with_app(|fig| services::save_state(fig)); - if let Some(r) = recovery::lock(&self.recovery).take() { - r.finish(); - } + // With the app out of reach (busy), its recovery copies stay for the next start. + let copies = recovery::lock(&self.recovery).take(); + with_app(|fig| services::shutdown(fig, services::config_dir().as_deref(), copies)); + // Everything is kept: end before the windows' teardown, where AppKit's Touch Bar support + // throws on the content view AccessKit restores (craft-libs#3, #781). + #[cfg(target_os = "macos")] + std::process::exit(0); } } diff --git a/apps/figcraft/src/recovery.rs b/apps/figcraft/src/recovery.rs index b2614598f..62243bc73 100644 --- a/apps/figcraft/src/recovery.rs +++ b/apps/figcraft/src/recovery.rs @@ -250,6 +250,17 @@ impl Recovery { self.written.insert(uid, Copy { done: None, flight: Some((vec![revision], writer)) }); } + /// Quitting: a normal quit ([`finish`](Self::finish)) when the unsaved-changes question was + /// `asked` or nothing is unsaved. Otherwise (macOS's Quit menu ends the app without asking) the + /// unsaved documents are copied and the copies stay for the next start, as after a crash. + pub fn quit(mut self, s: &Session, asked: bool) { + if asked || !s.docs.iter().any(|d| needs_copy(s, d)) { + return self.finish(); + } + self.write(s, true); + self.settle(s); + } + /// A normal quit: the documents were saved or their changes discarded on purpose. (Earlier /// runs' copies still waiting for their outcome stay for the next start.) pub fn finish(self) { diff --git a/apps/figcraft/src/recovery_tests.rs b/apps/figcraft/src/recovery_tests.rs index a3d608f9d..8f384b87c 100644 --- a/apps/figcraft/src/recovery_tests.rs +++ b/apps/figcraft/src/recovery_tests.rs @@ -167,6 +167,23 @@ fn a_normal_quit_removes_the_recovered_copies_it_took_over() { let _ = std::fs::remove_dir_all(&root); } +#[test] +fn quitting_without_the_unsaved_question_keeps_copies_for_the_next_start() { + let root = root("quitunasked"); + // macOS's Quit menu: nothing asked, so the unsaved document comes back next time. + let s = edited(); + Recovery::start(&root).unwrap().quit(&s, false); + let mut next = Session::empty(); + assert_eq!(recover(&root, &mut next), 1); + let _ = std::fs::remove_dir_all(&root); + // Asked (saved or discarded on purpose), or nothing unsaved: nothing is left. + for (s, asked) in [(edited(), true), (Session::new(), false)] { + Recovery::start(&root).unwrap().quit(&s, asked); + assert!(std::fs::read_dir(&root).unwrap().next().is_none(), "asked: {asked}"); + } + let _ = std::fs::remove_dir_all(&root); +} + #[test] fn a_run_whose_folder_name_is_still_held_takes_another() { let root = root("pidreuse"); diff --git a/apps/figcraft/src/services.rs b/apps/figcraft/src/services.rs index 6930f44d4..7ee41ada0 100644 --- a/apps/figcraft/src/services.rs +++ b/apps/figcraft/src/services.rs @@ -167,10 +167,18 @@ fn reveal(path: &Path) -> std::io::Result<()> { /// The preferences' file in the config folder. const STATE: &str = "state.json"; -pub fn save_state(app: &FigApp) { - if let Some(dir) = config_dir() { - write_prefs(&dir, &app.session.prefs); +/// Everything quitting keeps, all done when it returns (macOS then ends the process): the +/// preferences in `dir`, this run's recovery copies ([`Recovery::quit`](crate::recovery::Recovery::quit)) +/// and the live sessions' ends (one this app hosts tells everyone and stops; a joined one leaves). +pub fn shutdown(app: &mut FigApp, dir: Option<&Path>, recovery: Option) { + if let Some(dir) = dir { + write_prefs(dir, &app.session.prefs); } + // Before the sessions end: a recovered online file's copy waits for its session's outcome. + if let Some(r) = recovery { + r.quit(&app.session, app.ui.quit); + } + drop(std::mem::take(&mut app.session.live)); } /// Write `prefs` to `dir` atomically (a temporary file renamed over the old one: a crash leaves diff --git a/apps/figcraft/src/services_tests.rs b/apps/figcraft/src/services_tests.rs index 2390b92fc..2abec5bba 100644 --- a/apps/figcraft/src/services_tests.rs +++ b/apps/figcraft/src/services_tests.rs @@ -82,3 +82,38 @@ fn preferences_are_readable_by_their_owner_only() { assert_eq!(mode(&dir.join("state.json")), 0o600); let _ = std::fs::remove_dir_all(&dir); } + +/// A live link that only records the sessions it was told to leave. +struct Leaves(Arc>>); + +impl figcraft_engine::live::LiveLink for Leaves { + fn host(&mut self, _: u64, _: figcraft_engine::live::HostOptions) -> Result { + Err("not in this test".into()) + } + fn join(&mut self, _: u64, _: &str, _: &str) -> Result<(), String> { + Ok(()) + } + fn leave(&mut self, session: u64) { + self.0.lock().unwrap().push(session); + } + fn presence(&mut self, _: u64, _: &figcraft_engine::live::Presence) {} + fn send(&mut self, _: u64, _: figcraft_engine::figcraft_collab::message::ClientMsg) {} + fn poll(&mut self) -> Vec<(u64, figcraft_engine::live::Event)> { + Vec::new() + } +} + +#[test] +fn quitting_keeps_the_preferences_and_ends_the_live_sessions() { + let dir = root("shutdown"); + let mut fig = start(&dir); + let left = Arc::new(Mutex::new(Vec::new())); + fig.session.live.install(Box::new(Leaves(left.clone()))); + let joined = fig.run("collab.join", json!({"link": "ws://127.0.0.1:9/?file=f1&token=EditSecretEditSecret00"})).unwrap(); + fig.session.prefs.user_name = "Ada".into(); + crate::services::shutdown(&mut fig, Some(&dir), None); + assert_eq!(*left.lock().unwrap(), [joined["session"].as_u64().unwrap()], "the session was left"); + assert!(!fig.session.live.available(), "nothing is left to send on"); + assert_eq!(start(&dir).session.prefs.user_name, "Ada", "the preferences were kept"); + let _ = std::fs::remove_dir_all(&dir); +} diff --git a/docs/hardware-parity.md b/docs/hardware-parity.md index bf945c12a..df8229818 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-10-17 · **Change:** minor (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; 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) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (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; 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) · **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 @@ -39,7 +39,7 @@ Nothing has been timed against Figma on the same document (needs `.fig` import). | Platform | Figma | FigCraft | Notes | |---|---|---|---| -| macOS | desktop app (Intel and Apple silicon) | universal `.dmg`, signed and notarized (v0.2.0) | where nearly all QA happens | +| macOS | desktop app (Intel and Apple silicon) | universal `.dmg`, signed and notarized (v0.2.0) | where nearly all QA happens. Quitting ends the process once the preferences, recovery copies and live sessions are taken care of: the window's teardown crashed on Macs with a Touch Bar (#781); Quit from the menu bar, which asks nothing, keeps unsaved files' recovery copies for the next start | | Windows x64 / arm64 | desktop app | `.msi` and portable zip for x64, x86 and arm64 | built in CI; Windows: QA pass done 2026-10-11, findings in PR | | Linux | none (browser only) | AppImage, `.deb`, `.rpm`, Flatpak, tarball, x86_64 and aarch64; riscv64 tarball | CI tests run here. Clipboard (also the BSDs): reads run on a helper thread that gives up after 2 s, and images copied in other apps paste under Wayland through the data-control protocol (#693). Under Wayland the app can't tell its window is minimised, so control requests that need a drawn frame may still wait there (#720). None of this run on a Linux desktop here. On a Wayland compositor without server-side decorations (GNOME) the window gets winit's Adwaita controls (#592: checked by its author in a GNOME Wayland session; KDE not run) | | FreeBSD | none | tarball | | @@ -50,6 +50,7 @@ Nothing has been timed against Figma on the same document (needs `.fig` import). | Date | Change | Summary | |---|---|---| +| 2026-10-18 | minor | macOS quit crash (#781): on Macs with a Touch Bar the app could crash as it quit (an exception in AppKit's Touch Bar support while the window's content view, which the accessibility adapter subclasses, was torn down). Quitting now keeps everything (preferences, this run's recovery copies, live sessions ended) and then ends the process before that teardown. Quit from the menu bar ends the app without the unsaved-changes question, so unsaved files' recovery copies now stay and reopen at the next start instead of being removed. Numbers unchanged | | 2026-10-17 | minor | Linux row: clipboard reads on Linux and the BSDs time out after 2 s on a helper thread, images copied in other apps paste under Wayland (arboard's data-control feature, #693), a minimised window can't be detected under Wayland, so frame-only control requests may still wait there (#720), and Wayland compositors without server-side decorations give the window Adwaita controls (#592, checked by its author on GNOME, not by the maintainers; KDE not run); compiled in CI, not run on a Linux desktop. HiDPI row: native-density canvas images placed on whole device pixels (#359, geometry tests; not judged by eye). Numbers unchanged | | 2026-10-14 | minor | Copy and paste in the browser: the web build never wrote to the system clipboard, so Cmd+V after Cmd+C pasted whatever text the clipboard held before (as a text layer) instead of the copied layers. Copies (layers, Copy as SVG/CSS/text/PNG, links) now go out through egui's output, which eframe writes during the copy event (`web_clipboard_tests`). Numbers unchanged. | | 2026-10-11 | minor | Windows QA pass (gap 8): everyday workflows on Windows 11 through the desktop app and MCP; fixed: unsaved changes lost when the app was killed or crashed (recovery copies every few seconds, reopened at the next start), Ctrl+arrows/Backspace/Delete acting on the whole line in text (now by word; Ctrl+Home/End to the text's ends), scrubbed fields snapping back on release, typing on a field Tab reached, Escape not closing dialogs, skewed or vanishing linear gradients, hints cut off at the panel edge, the window-close question in English in the Spanish interface. Percentages and hours unchanged | From 8629a6f586f7637fb0148c75c585a8e7fbc21e3d Mon Sep 17 00:00:00 2001 From: BFlat Date: Sun, 18 Oct 2026 14:59:14 +0700 Subject: [PATCH 242/817] M3: variable.import reads variables outside `meta` and never imports nothing silently (#790) (#793) Fixes #790. Fixes #790. --- crates/engine/src/cmd/variables_io.rs | 2 +- crates/engine/src/lib.rs | 2 + .../src/variables_import_shapes_tests.rs | 60 +++++++++++++++++++ crates/format/src/rest/mod.rs | 23 +++++-- crates/format/src/rest/variables.rs | 20 ++++++- docs/components-parity.md | 5 +- docs/mcp.md | 7 ++- 7 files changed, 106 insertions(+), 13 deletions(-) create mode 100644 crates/engine/src/variables_import_shapes_tests.rs diff --git a/crates/engine/src/cmd/variables_io.rs b/crates/engine/src/cmd/variables_io.rs index 99a786400..f3b9a820d 100644 --- a/crates/engine/src/cmd/variables_io.rs +++ b/crates/engine/src/cmd/variables_io.rs @@ -25,7 +25,7 @@ pub fn specs() -> Vec { spec!( "variable.import", "Import variables", - "{variables (the local variables JSON, as variable.export writes it: an object, JSON text or a path)} collections join this file's collection of the same name (values by mode name; new modes and variables are added, a variable of another type is skipped), others are added → {collections (added), variables (added), updated, warnings}", + "{variables (the local variables JSON, as variable.export writes it: an object, JSON text or a path; `variableCollections` and `variables` under `meta` or at the top level)} collections join this file's collection of the same name (values by mode name; new modes and variables are added, a variable of another type is skipped), others are added → {collections (added), variables (added), updated, warnings (also when it holds no variables, or fewer than its collections list)}", true, import ), diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index af0f555e6..fedcffc96 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1816,6 +1816,8 @@ mod variables_behaviour_tests; #[cfg(test)] mod variables_editor_tests; #[cfg(test)] +mod variables_import_shapes_tests; +#[cfg(test)] mod variables_io_tests; #[cfg(test)] mod vector_behaviour_tests; diff --git a/crates/engine/src/variables_import_shapes_tests.rs b/crates/engine/src/variables_import_shapes_tests.rs new file mode 100644 index 000000000..067ccab23 --- /dev/null +++ b/crates/engine/src/variables_import_shapes_tests.rs @@ -0,0 +1,60 @@ +//! `variable.import` reads `variables` next to `variableCollections`, under `meta` or at the top +//! level, and never imports nothing without saying so (#790). + +use serde_json::{Value, json}; + +use crate::Session; + +fn collections() -> Value { + json!({"VC:1": {"id": "VC:1", "name": "Theme", "modes": [{"modeId": "1:0", "name": "Light"}], "defaultModeId": "1:0", + "variableIds": ["VariableID:1"]}}) +} + +fn variables() -> Value { + json!({"VariableID:1": {"id": "VariableID:1", "name": "bg", "variableCollectionId": "VC:1", "resolvedType": "COLOR", + "valuesByMode": {"1:0": {"r": 1.0, "g": 1.0, "b": 1.0, "a": 1.0}}}}) +} + +fn import(json: Value) -> Value { + let mut s = Session::new(); + match s.execute("variable.import", &json!({"variables": json})) { + Ok(r) => r, + Err(e) => panic!("{e}"), + } +} + +#[test] +fn variables_import_reads_every_shape() { + for shape in [ + json!({"meta": {"variableCollections": collections(), "variables": variables()}}), + json!({"variableCollections": collections(), "variables": variables()}), + json!({"meta": {"variableCollections": collections()}, "variables": variables()}), + json!({"variableCollections": collections(), "meta": {"variables": variables()}}), + ] { + let r = import(shape.clone()); + assert_eq!((r["collections"].as_u64(), r["variables"].as_u64()), (Some(1), Some(1)), "{shape}: {r}"); + assert_eq!(r["warnings"], json!([]), "{shape}: {r}"); + } +} + +#[test] +fn variables_import_never_imports_nothing_silently() { + // Collections without variables: they are added, with a warning saying where variables go. + let r = import(json!({"meta": {"variableCollections": collections()}})); + assert_eq!((r["collections"].as_u64(), r["variables"].as_u64()), (Some(1), Some(0)), "{r}"); + assert!(r["warnings"].to_string().contains("no variables found: expected `meta.variables`"), "{r}"); + // An empty file's export reads back with the same warning, not an error. + let mut s = Session::new(); + let text = s.execute("variable.export", &json!({})).unwrap()["text"].as_str().unwrap().to_string(); + let r = s.execute("variable.import", &json!({"variables": text})).unwrap(); + assert!(r["warnings"].to_string().contains("no variables found"), "{r}"); + // Collections listing variables that aren't there. + let mut colls = collections(); + colls["VC:1"]["variableIds"] = json!(["VariableID:1", "VariableID:2"]); + let r = import(json!({"meta": {"variableCollections": colls, "variables": variables()}})); + assert_eq!(r["variables"].as_u64(), Some(1), "{r}"); + assert!(r["warnings"].to_string().contains("1 of the 2 variables the collections list in `variableIds` weren't imported"), "{r}"); + // No collections anywhere: an error naming the expected shape. + let e = Session::new().execute("variable.import", &json!({"variables": {"variables": variables()}})).unwrap_err().to_string(); + assert!(e.contains("(`meta.variableCollections` and `meta.variables`)"), "{e}"); +} diff --git a/crates/format/src/rest/mod.rs b/crates/format/src/rest/mod.rs index be5c71576..232afc258 100644 --- a/crates/format/src/rest/mod.rs +++ b/crates/format/src/rest/mod.rs @@ -106,12 +106,25 @@ pub fn is_variables_json(v: &Value) -> bool { } /// The collections and variables of a local variables response (or its `meta`), checked like a -/// file's, with the warnings about what was skipped; None when `v` isn't one. +/// file's, with the warnings about what was skipped (and when it holds no variables at all, or +/// fewer than its collections list); None when `v` isn't one. pub fn read_variables(v: &Value) -> Option<(figcraft_doc::Variables, Vec)> { - let src = variables::source(v)?; + variables::source(v)?; let mut cx = Ctx::new(Document::new("Variables"), &no_images); - cx.variables(src); - Some((std::mem::take(&mut cx.doc.variables), cx.warnings.finish())) + cx.variables(v); + let vars = std::mem::take(&mut cx.doc.variables); + let mut warnings = cx.warnings.finish(); + if vars.variables.is_empty() { + warnings.push("no variables found: expected `meta.variables` (an object of variables by id, next to `meta.variableCollections`)".into()); + } else { + let listed = variables::listed_ids(v); + let read: BTreeSet<&str> = vars.variables.iter().map(|x| x.id.as_str()).collect(); + let missing = listed.difference(&read).count(); + if missing > 0 { + warnings.push(format!("{missing} of the {} variables the collections list in `variableIds` weren't imported", listed.len())); + } + } + Some((vars, warnings)) } /// Import `bytes` when they are REST API file JSON; `None` when they are something else (the @@ -191,7 +204,7 @@ fn import_parts( cx.collect_meta(e); } // Variables first: layers link to them as they are built. - for src in [variables::source(v), variables.and_then(variables::source)].into_iter().flatten() { + for src in [Some(v), variables].into_iter().flatten() { cx.variables(src); } if variables.is_some_and(|x| variables::source(x).is_none()) { diff --git a/crates/format/src/rest/variables.rs b/crates/format/src/rest/variables.rs index 91d14001c..d58da409b 100644 --- a/crates/format/src/rest/variables.rs +++ b/crates/format/src/rest/variables.rs @@ -27,6 +27,16 @@ pub fn source(v: &Value) -> Option<&Value> { [v.get("meta"), Some(v)].into_iter().flatten().find(|m| m.get("variableCollections").is_some_and(Value::is_object)) } +/// The variable ids the collections of a local variables response list in `variableIds`. +pub(super) fn listed_ids(v: &Value) -> BTreeSet<&str> { + source(v) + .into_iter() + .flat_map(|src| objects(src, "variableCollections", MAX_COLLECTIONS)) + .flat_map(|(_, c)| list(c, "variableIds").iter().filter_map(Value::as_str).map(clip_str)) + .take(MAX_VARIABLES) + .collect() +} + pub(super) fn kind_of(t: &str) -> Option { Some(match t { "COLOR" => VariableType::Color, @@ -118,14 +128,18 @@ fn objects<'v>(v: &'v Value, key: &str, max: usize) -> impl Iterator { - /// Add the collections and variables of a local variables response (or its `meta`). - pub(super) fn variables(&mut self, src: &Value) { + /// Add the collections and variables of a local variables response (or its `meta`); nothing + /// when `v` isn't one. The `variables` map is read next to `variableCollections`, or from + /// `meta` or the top level when it sits on the other side. + pub(super) fn variables(&mut self, v: &Value) { + let Some(src) = source(v) else { return }; for (key, c) in objects(src, "variableCollections", MAX_COLLECTIONS) { self.collection(key, c); } + let holder = [Some(src), v.get("meta"), Some(v)].into_iter().flatten().find(|m| m.get("variables").is_some_and(Value::is_object)); let mut found: Vec = Vec::new(); let mut seen: BTreeSet = BTreeSet::new(); - for (key, v) in objects(src, "variables", MAX_VARIABLES) { + for (key, v) in holder.into_iter().flat_map(|h| objects(h, "variables", MAX_VARIABLES)) { if let Some(var) = self.variable(key, v) && seen.insert(var.id.clone()) { diff --git a/docs/components-parity.md b/docs/components-parity.md index 3b9793b03..2640ed1c0 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-10-17 · **Change:** minor (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-10-18 · **Change:** minor (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 @@ -69,13 +69,14 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`. | Explicit modes per frame, library collections' modes | done | | | Gradient stops and variant properties bound to variables | done | a stop's binding follows it when earlier stops are removed | | Extended collections | done | library collections, including a library's own extended collections (chains through libraries); overrides per mode with reset; follow library updates, variables new to the library collection being an update of their own; modes inherited. Checked with synthetic libraries only ([gaps](gaps.md) #14) | -| Variables import/export (JSON) | done | the REST local variables shape (round-trips; merges by collection, mode and variable name); CSS custom properties export; in the browser the export arrives as a download (import there still needs a file picker) | +| Variables import/export (JSON) | done | the REST local variables shape (round-trips; merges by collection, mode and variable name; `variableCollections` and `variables` read under `meta` or at the top level, a warning when no variables are found or fewer than the collections list); CSS custom properties export; in the browser the export arrives as a download (import there still needs a file picker) | | Expressions in prototype set-variable actions | done | see [prototyping-parity](prototyping-parity.md) | ## Revision history | Date | Change | Summary | |---|---|---| +| 2026-10-18 | minor | Variables import (#790): a `variables` map outside `meta` (or `meta.variables` next to top-level collections) is read, and an import that finds no variables, or fewer than the collections' `variableIds` list, says so in `warnings` instead of succeeding silently | | 2026-10-17 | minor | Variant properties reorder by dragging them in the Properties section, one undo step (#679; was "no drag in the panel yet"); a library file saved again right after it was read is read again, so a quick republish isn't missed (#652); the Hidden from publishing row no longer says the Hide when publishing item is missing (it landed 2026-10-12). Numbers unchanged | | 2026-10-17 | minor | Size and resizing overrides of layers inside instances (#731): a layer in an instance can hug, fill or keep a size of its own (group `resizing`: hug/fill/fixed with min and max; `size`), from the Layout panel, the canvas handles and `node.set`; they were refused, and imported ones were dropped at the first relayout. Kept through main edits of other properties, rebuilds, undo, save, `.fig` and REST import (sizes a `.fig` instance gives its layers and the REST `overrides` fields), `.fig` export and detach; reset per group and with Reset all changes (`instance_resizing_tests`). The row that listed them as not overridable was wrong. Numbers unchanged. | | 2026-10-14 | minor | Variables export in the browser: Export… ▸ Variables JSON / CSS custom properties did nothing in the web build, which has no save dialogs; it now hands the file over as a download (`Services::downloads` / `download`, `variables_export_ui_tests`). Import in the browser still needs a file picker, as do the other exports there. Numbers unchanged. | diff --git a/docs/mcp.md b/docs/mcp.md index a84bf05b2..786fde0aa 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -883,10 +883,13 @@ path?}` writes this file's collections (default: all but library copies) as a lo response (`format: "json"`, the default) or as CSS custom properties (`format: "css"`: the default mode on `:root`, each other mode on `[data-=""]`, aliases as `var(--name)`), and returns `{text}` (or writes `path` and returns `{path}`). `variable.import {variables}` (an object, -JSON text or a path) reads one back: a collection joins this file's collection of the same name +JSON text or a path; `variableCollections` and `variables` under `meta` or at the top level) reads +one back: a collection joins this file's collection of the same name (values matched by mode name, new modes and variables added, a same-named variable of another type skipped with a warning; library copies and extended collections are never targets), others are -added; aliases are checked for loops; it returns `{collections, variables, updated, warnings}`. The +added; aliases are checked for loops; it returns `{collections, variables, updated, warnings}`, +with a warning when the JSON holds no variables (`no variables found: expected meta.variables …`) +or fewer than its collections list in `variableIds`. The Variables editor's Import… and Export… buttons do the same through file dialogs. Strokes take colour styles and variables like fills: `style.apply {style, target: "stroke"}` links From 55fbcd0d7ea6a1349002dc775cd361924796e96b Mon Sep 17 00:00:00 2001 From: Esa Komulainen Date: Sun, 18 Oct 2026 11:03:36 +0300 Subject: [PATCH 243/817] M10: add Finnish (fi) interface catalog --- crates/ui-egui/locales/fi.toml | 2343 ++++++++++++++++++++++++++++++ crates/ui-egui/src/i18n_tests.rs | 40 + docs/translating.md | 12 + 3 files changed, 2395 insertions(+) create mode 100644 crates/ui-egui/locales/fi.toml diff --git a/crates/ui-egui/locales/fi.toml b/crates/ui-egui/locales/fi.toml new file mode 100644 index 000000000..eb3ce94c2 --- /dev/null +++ b/crates/ui-egui/locales/fi.toml @@ -0,0 +1,2343 @@ +# Finnish interface catalog. Original translations; MIT OR Apache-2.0. +# AI-assisted draft; not reviewed by a human Finnish/native speaker. +# Sentence case, imperative commands. Integer plurals: 1 taso, 0/2/21 tasoa. +# Product names, shortcut notation, numeric glyphs and code examples retain their identity. +# Command ids and context suffixes are immutable keys; translated text is display-only. +# Completeness measured against the English UI and live command/menu source sets; see tests. + +[meta] +name = "Suomi" +status = "draft — needs native review" + +[ui] +"% of all commits" = "% kaikista muutoksista" +"(no longer published)" = "(ei enää julkaistu)" +"({n} warnings: some entries were skipped)" = { one = "({n} varoitus: joitakin kohteita ohitettiin)", other = "({n} varoitusta: joitakin kohteita ohitettiin)" } +"+ Create variable" = "+ Luo muuttuja" +".fig (experimental)" = ".fig (kokeellinen)" +"1…9, 0" = "1…9, 0" +"@{login}: {prs} PRs, {commits} commits, +{added} / −{deleted} lines (Δ {delta}), +{bin_added} / −{bin_deleted} binary assets, {first} – {last}" = "@{login}: PR:t {prs}, muutokset {commits}, rivit +{added} / −{deleted} (Δ {delta}), binääriresurssit +{bin_added} / −{bin_deleted}, {first} – {last}" +"A .figcraft file with this name already exists. Choose its full name to confirm replacement." = "Tämänniminen .figcraft-tiedosto on jo olemassa. Vahvista korvaaminen valitsemalla sen koko nimi." +"A collection of this file with these modes and variables: override their values per mode and add variables of its own" = "Tämän tiedoston kokoelma, joka sisältää nämä tilat ja muuttujat. Voit ohittaa niiden arvot tilakohtaisesti ja lisätä omia muuttujia." +"A layer on its own aligns to its frame: select more layers, or one in a frame" = "Yksittäinen taso tasataan kehykseensä. Valitse useampia tasoja tai yksi kehyksen sisällä oleva taso." +"A responsive product page: hero, features, figures, a quote and a footer" = "Mukautuva tuotesivu: pääosio, ominaisuudet, tunnusluvut, lainaus ja alatunniste" +"A spring plays until it settles: its mass, stiffness and damping set how long" = "Jousi liikkuu, kunnes se asettuu. Sen massa, jäykkyys ja vaimennus määräävät keston." +"A title, an agenda, a big figure, a chart and a closing slide" = "Otsikko, esityslista, suuri tunnusluku, kaavio ja päätösdia" +"A to Z" = "A:sta Z:aan" +"About" = "Tietoja" +"About FigCraft" = "Tietoja FigCraftista" +"About this server" = "Tietoja tästä palvelimesta" +"Action" = "Toiminto" +"Actions" = "Toiminnot" +"Actions for {name}" = "Kohteen {name} toiminnot" +"Actions…" = "Toiminnot…" +"Active" = "Aktiivinen" +"Actual size (100%)" = "Todellinen koko (100 %)" +"Add a category" = "Lisää luokka" +"Add a comment" = "Lisää kommentti" +"Add a description" = "Lisää kuvaus" +"Add a frame (F) or a shape (R) to get started" = "Aloita lisäämällä kehys (F) tai muoto (R)" +"Add a layer or component to tile first" = "Lisää ensin laatoitettava taso tai komponentti" +"Add a note for developers" = "Lisää huomautus kehittäjille" +"Add action" = "Lisää toiminto" +"Add actions for when no condition holds" = "Lisää toimintoja tilanteeseen, jossa mikään ehto ei täyty" +"Add an annotation for developers" = "Lisää huomautus kehittäjille" +"Add another condition" = "Lisää toinen ehto" +"Add auto layout" = "Lisää automaattinen asettelu" +"Add background behind overlay" = "Lisää tausta peittokuvan taakse" +"Add content to this slot" = "Lisää sisältöä tähän sisältöpaikkaan" +"Add dev resource" = "Lisää kehittäjäresurssi" +"Add effect" = "Lisää tehoste" +"Add export setting" = "Lisää vientiasetus" +"Add fill" = "Lisää täyttö" +"Add interaction" = "Lisää vuorovaikutus" +"Add layout grid" = "Lisää asetteluruudukko" +"Add library" = "Lisää kirjasto" +"Add library file…" = "Lisää kirjastotiedosto…" +"Add max height" = "Lisää enimmäiskorkeus" +"Add max width" = "Lisää enimmäisleveys" +"Add min height" = "Lisää vähimmäiskorkeus" +"Add min width" = "Lisää vähimmäisleveys" +"Add mode" = "Lisää tila" +"Add new page" = "Lisää uusi sivu" +"Add or update collections from a variables JSON" = "Lisää tai päivitä kokoelmia muuttujien JSON-tiedostosta" +"Add properties to make instances configurable" = "Lisää ominaisuuksia, jotta ilmentymiä voi mukauttaa" +"Add reaction" = "Lisää reaktio" +"Add starting point" = "Lisää aloituspiste" +"Add stroke" = "Lisää reunaviiva" +"Add variant" = "Lisää variantti" +"Add variant with a new value" = "Lisää variantti uudella arvolla" +"Added" = "Lisätty" +"Added the library \"{name}\"" = "Kirjasto ”{name}” lisätty" +"Adding to {name}" = "Lisätään kohteeseen {name}" +"Adjust" = "Säädä" +"Adjustment presets" = "Säädön esiasetukset" +"Advanced" = "Lisäasetukset" +"Advanced stroke" = "Reunaviivan lisäasetukset" +"After delay" = "Viiveen jälkeen" +"After delay {ms}ms" = "Viiveen {ms}ms jälkeen" +"Align" = "Tasaa" +"Align bottom" = "Tasaa alas" +"Align center" = "Keskitä" +"Align horizontal centers" = "Keskitä vaakasuunnassa" +"Align left" = "Tasaa vasemmalle" +"Align middle" = "Tasaa keskelle" +"Align right" = "Tasaa oikealle" +"Align text baselines" = "Tasaa tekstin peruslinjat" +"Align top" = "Tasaa ylös" +"Align vertical centers" = "Keskitä pystysuunnassa" +"Alignment" = "Tasaus" +"All" = "Kaikki" +"All categories" = "Kaikki luokat" +"All comments" = "Kaikki kommentit" +"All components" = "Kaikki komponentit" +"All fonts" = "Kaikki fontit" +"All supported properties" = "Kaikki tuetut ominaisuudet" +"All the fonts this file uses are installed" = "Kaikki tämän tiedoston käyttämät fontit on asennettu" +"All variables" = "Kaikki muuttujat" +"Alpha" = "Alfa" +"Alphabetical" = "Aakkosjärjestys" +"Alt+drag" = "Alt+drag" +"An analytics screen on a grid: figures, charts drawn from vectors and a table" = "Analytiikkanäkymä ruudukossa: tunnuslukuja, vektoreista piirrettyjä kaavioita ja taulukko" +"An invite link that opens FigCraft and joins" = "Kutsulinkki, joka avaa FigCraftin ja liittyy istuntoon" +"Anchor" = "Ankkuri" +"Android" = "Android" +"Angular" = "Kulmaliukuväri" +"Animation" = "Animaatio" +"Annotations" = "Huomautukset" +"Annotations shown on the canvas" = "Piirtoalueella näytettävät huomautukset" +"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 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ä." +"Appearance" = "Ulkoasu" +"Apply a component property" = "Käytä komponentin ominaisuutta" +"Apply variable" = "Käytä muuttujaa" +"Apply variable to text" = "Käytä muuttujaa tekstiin" +"Apply variable to visibility" = "Käytä muuttujaa näkyvyyteen" +"Apps" = "Sovellukset" +"Apr" = "huhtik." +"Arc" = "Kaari" +"Arc ratio" = "Kaaren suhde" +"Arc start" = "Kaaren alku" +"Arc sweep" = "Kaaren pyyhkäisy" +"Archive" = "Arkistoi" +"Archived" = "Arkistoitu" +"Arrange" = "Järjestä" +"Arrow" = "Nuoli" +"As typed" = "Kirjoitetussa muodossa" +"Asking the server…" = "Kysytään palvelimelta…" +"Assets" = "Resurssit" +"Aug" = "elok." +"Auto" = "Automaattinen" +"Auto (space around)" = "Automaattinen (tila ympärillä)" +"Auto (space between)" = "Automaattinen (tila välissä)" +"Auto (space evenly)" = "Automaattinen (tasavälein)" +"Auto ({mode})" = "Automaattinen ({mode})" +"Auto columns" = "Automaattiset sarakkeet" +"Auto gap" = "Automaattinen väli" +"Auto height" = "Automaattinen korkeus" +"Auto layout" = "Automaattinen asettelu" +"Auto rows" = "Automaattiset rivit" +"Auto width" = "Automaattinen leveys" +"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" +"Back to assets" = "Takaisin resursseihin" +"Back to current" = "Takaisin nykyiseen" +"Back to styles" = "Takaisin tyyleihin" +"Back to the FigCraft server" = "Takaisin FigCraft-palvelimelle" +"Back to the canvas from a focused region" = "Palaa kohdistetulta alueelta piirtoalueelle" +"Back to the current version" = "Takaisin nykyiseen versioon" +"Back to the font's value" = "Palauta fontin arvo" +"Back to the values the font style implies" = "Palauta fonttityylin mukaiset arvot" +"Background" = "Tausta" +"Background blur" = "Taustan sumennus" +"Basics" = "Perusteet" +"Before" = "Ennen" +"Bend" = "Taivutus" +"Bevel" = "Viiste" +"Binary assets added" = "Lisätyt binääriresurssit" +"Binary assets removed" = "Poistetut binääriresurssit" +"Black & white" = "Mustavalkoinen" +"Bleed" = "Leikkuuvara" +"Bleed marks" = "Leikkuuvaramerkit" +"Bleed marks need a bleed" = "Leikkuuvaramerkit edellyttävät leikkuuvaraa" +"Blend" = "Sekoitus" +"Blend mode" = "Sekoitustila" +"Blue" = "Sininen" +"Blur" = "Sumennus" +"Boolean" = "Totuusarvo" +"Boolean groups" = "Boolen ryhmät" +"Both directions" = "Molemmat suunnat" +"Bottom" = "Alhaalta" +"Bottom left radius" = "Vasemman alakulman säde" +"Bottom right radius" = "Oikean alakulman säde" +"Bound to {name}. Click to detach the variable." = "Sidottu muuttujaan {name}. Irrota muuttuja napsauttamalla." +"Branch" = "Haara" +"Branch archived" = "Haara arkistoitu" +"Branch merged" = "Haara yhdistetty" +"Branch name" = "Haaran nimi" +"Branch of {file}" = "Tiedoston {file} haara" +"Branch of {file} · merged or archived" = "Tiedoston {file} haara · yhdistetty tai arkistoitu" +"Branch updated from main" = "Haara päivitetty päähaarasta" +"Branch {name}" = "Haara {name}" +"Branches" = "Haarat" +"Bring forward" = "Tuo eteenpäin" +"Bring the main file's changes into the branch" = "Tuo päätiedoston muutokset haaraan" +"Bring to front" = "Tuo etummaiseksi" +"Bristle" = "Harjas" +"Browse" = "Selaa" +"Brush" = "Sivellin" +"Brush rotation jitter" = "Siveltimen kierron vaihtelu" +"Brush scatter" = "Siveltimen hajonta" +"Brush size jitter" = "Siveltimen koon vaihtelu" +"Brush spacing" = "Siveltimen välistys" +"Bulleted list" = "Luettelomerkitty luettelo" +"C or Shift+C" = "C or Shift+C" +"C or ⇧C" = "C or ⇧C" +"CMYK colour" = "CMYK-väri" +"CSS custom properties…" = "CSS:n mukautetut ominaisuudet…" +"Can edit" = "Voi muokata" +"Can view" = "Voi katsella" +"Can't read this library: {e}" = "Kirjastoa ei voi lukea: {e}" +"Cancel" = "Peruuta" +"Canvas" = "Piirtoalue" +"Canvas stacking" = "Piirtoalueen pinoamisjärjestys" +"Cap height to baseline" = "Versaalikorkeudesta peruslinjaan" +"Case" = "Kirjainkoko" +"Case-sensitive forms" = "Kirjainkokoon mukautuvat muodot" +"Categories" = "Luokat" +"Center" = "Keskelle" +"Change alias" = "Vaihda alias" +"Change resolved" = "Muutos ratkaistu" +"Change style" = "Vaihda tyyli" +"Change to" = "Vaihda kohteeksi" +"Change to needs a layer inside a variant" = "Vaihto edellyttää variantin sisällä olevaa tasoa" +"Changed" = "Muutettu" +"Changed on both sides: keep one" = "Muutettu molemmilla puolilla: säilytä toinen" +"Changes on main" = "Päähaaran muutokset" +"Changes on the branch" = "Haaran muutokset" +"Changes unknown" = "Muutokset tuntemattomia" +"Checking the fonts installed on this computer…" = "Tarkistetaan tämän tietokoneen asennettuja fontteja…" +"Checking the server…" = "Tarkistetaan palvelinta…" +"Choose React, Leptos, SwiftUI or Compose above to connect this component to its code." = "Valitse yllä React, Leptos, SwiftUI tai Compose yhdistääksesi tämän komponentin sen koodiin." +"Choose another profile to change it." = "Vaihda valitsemalla toinen profiili." +"Choose collection" = "Valitse kokoelma" +"Choose image" = "Valitse kuva" +"Choose mode" = "Valitse tila" +"Choose variable" = "Valitse muuttuja" +"Circle" = "Ympyrä" +"Clear from this list" = "Poista tästä luettelosta" +"Clear recent" = "Tyhjennä viimeisimmät" +"Click + to replace mixed content" = "Korvaa vaihteleva sisältö napsauttamalla +" +"Click anywhere on the canvas to leave one." = "Lisää huomautus napsauttamalla mitä tahansa piirtoalueen kohtaa." +"Click or drag to merge · {alt} removes" = "Yhdistä napsauttamalla tai vetämällä · {alt} poistaa" +"Click or drag to remove · {alt} merges" = "Poista napsauttamalla tai vetämällä · {alt} yhdistää" +"Click to record a key" = "Tallenna näppäin napsauttamalla" +"Clip content" = "Leikkaa sisältö rajoihin" +"Clip to shape" = "Leikkaa muotoon" +"Close" = "Sulje" +"Close overlay" = "Sulje peittokuva" +"Close preview" = "Sulje esikatselu" +"Close tab" = "Sulje välilehti" +"Close version history" = "Sulje versiohistoria" +"Close when clicking outside" = "Sulje napsautettaessa ulkopuolelle" +"Close without saving" = "Sulje tallentamatta" +"Code" = "Koodi" +"Code or invite link" = "Koodi tai kutsulinkki" +"Code syntax" = "Koodin syntaksi" +"Collapse" = "Tiivistä muunnokset" +"Collapse panel" = "Supista paneeli" +"Collection" = "Kokoelma" +"Collections" = "Kokoelmat" +"Color" = "Väri" +"Color burn" = "Värivarjostus" +"Color dodge" = "Värilisävalotus" +"Color format" = "Värimuoto" +"Color profile" = "Väriprofiili" +"Color profile: {name}" = "Väriprofiili: {name}" +"Color styles" = "Värityylit" +"Color values in this file are in this color space." = "Tämän tiedoston väriarvot ovat tässä väriavaruudessa." +"Color variables" = "Värimuuttujat" +"Colour" = "Väri" +"Colour and text styles, Light and Dark variables, buttons, inputs and cards" = "Väri- ja tekstityylejä, vaalean ja tumman tilan muuttujia, painikkeita, syötekenttiä ja kortteja" +"Column" = "Sarake" +"Column gap" = "Sarakkeiden väli" +"Column sizes" = "Sarakkeiden koot" +"Column span" = "Sarakeulottuvuus" +"Columns" = "Sarakkeet" +"Columns {count}" = "Sarakkeita: {count}" +"Comment" = "Kommentti" +"Comments" = "Kommentit" +"Commits" = "Muutokset" +"Company" = "Yritys" +"Compare changes" = "Vertaa muutoksia" +"Compatibility notes" = "Yhteensopivuushuomautukset" +"Completed" = "Valmis" +"Component" = "Komponentti" +"Component name" = "Komponentin nimi" +"Component property" = "Komponentin ominaisuus" +"Component set" = "Komponenttijoukko" +"Component sets" = "Komponenttijoukot" +"Components" = "Komponentit" +"Conditional" = "Ehdollinen" +"Confetti" = "Konfetti" +"Conflicts" = "Ristiriidat" +"Connect to code" = "Yhdistä koodiin" +"Connected" = "Yhdistetty" +"Connected to code: {from}" = "Yhdistetty koodiin: {from}" +"Connection lost, reconnecting (attempt {attempt})…" = "Yhteys katkesi, yhdistetään uudelleen (yritys {attempt})…" +"Constrain proportions" = "Säilytä mittasuhteet" +"Constraints" = "Rajoitteet" +"Content" = "Sisältö" +"Contents hidden" = "Sisältö kätketty" +"Contents only" = "Vain sisältö" +"Contextual alternates" = "Kontekstuaaliset vaihtoehdot" +"Contrast" = "Kontrasti" +"Contributors" = "Tekijät" +"Contributors: {people} · Commits: {commits}" = "Tekijät: {people} · Muutokset: {commits}" +"Controller" = "Ohjain" +"Convert to frame" = "Muunna kehykseksi" +"Convert to section" = "Muunna osioksi" +"Cool" = "Viileä" +"Copied as CSS" = "Kopioitu CSS-muodossa" +"Copied as PNG" = "Kopioitu PNG-muodossa" +"Copied as SVG" = "Kopioitu SVG-muodossa" +"Copied as text" = "Kopioitu tekstinä" +"Copied {value}" = "Kopioitu: {value}" +"Copy" = "Kopioi" +"Copy as" = "Kopioi muodossa" +"Copy as CSS" = "Kopioi CSS-muodossa" +"Copy as PNG" = "Kopioi PNG-muodossa" +"Copy as SVG" = "Kopioi SVG-muodossa" +"Copy code" = "Kopioi koodi" +"Copy link" = "Kopioi linkki" +"Copy the {label}" = "Kopioi: {label}" +"Copy {value}" = "Kopioi: {value}" +"Corner radius" = "Kulman säde" +"Corner smoothing" = "Kulman pehmennys" +"Couldn't download the variables" = "Muuttujia ei voitu ladata" +"Couldn't reach {server}: showing what this computer remembers." = "Palvelimeen {server} ei saatu yhteyttä. Näytetään tämän tietokoneen muistamat tiedot." +"Couldn't save automatically: {error}" = "Automaattinen tallennus epäonnistui: {error}" +"Count" = "Määrä" +"Create" = "Luo" +"Create a variable collection first" = "Luo ensin muuttujakokoelma" +"Create a variable first" = "Luo ensin muuttuja" +"Create alias" = "Luo alias" +"Create branch" = "Luo haara" +"Create collection" = "Luo kokoelma" +"Create component" = "Luo komponentti" +"Create component property" = "Luo komponentin ominaisuus" +"Create components, styles or variables to publish them as a library." = "Luo komponentteja, tyylejä tai muuttujia, jotta voit julkaista ne kirjastona." +"Create property…" = "Luo ominaisuus…" +"Create style" = "Luo tyyli" +"Create style from the selected text" = "Luo tyyli valitusta tekstistä" +"Created" = "Luotu" +"Crop" = "Rajaa" +"Crop marks" = "Leikkausmerkit" +"Ctrl+arrows" = "Ctrl+arrows" +"Ctrl+click" = "Ctrl+click" +"Ctrl+scroll" = "Ctrl+scroll" +"Current name" = "Nykyinen nimi" +"Current version" = "Nykyinen versio" +"Cursor chat" = "Kohdistinkeskustelu" +"Custom" = "Mukautettu" +"Custom size" = "Mukautettu koko" +"Cut" = "Leikkaa" +"Dark" = "Tumma" +"Darken" = "Tummenna" +"Dash" = "Katkoviiva" +"Dashboard" = "Koontinäkymä" +"Date created" = "Luontipäivä" +"Dec" = "jouluk." +"Decoration" = "Koristelu" +"Decoration style" = "Koristelun tyyli" +"Deep select" = "Valitse sisäkkäinen kohde" +"Default" = "Oletus" +"Default content" = "Oletussisältö" +"Default value (the top-left variant)" = "Oletusarvo (vasemman yläkulman variantti)" +"Delay" = "Viive" +"Delete" = "Poista" +"Delete category (its annotations stay)" = "Poista luokka (sen huomautukset säilyvät)" +"Delete collection" = "Poista kokoelma" +"Delete group" = "Poista ryhmä" +"Delete mode" = "Poista tila" +"Delete page" = "Poista sivu" +"Delete preset" = "Poista esiasetus" +"Delete property" = "Poista ominaisuus" +"Delete the style (layers keep their values)" = "Poista tyyli (tasojen arvot säilyvät)" +"Delete thread" = "Poista keskustelu" +"Delete variable" = "Poista muuttuja" +"Delete “{name}”? This can't be undone." = "Poistetaanko ”{name}”? Tätä ei voi kumota." +"Density" = "Tiheys" +"Depth" = "Syvyys" +"Describe how and when to use this component" = "Kuvaile, miten ja milloin tätä komponenttia käytetään" +"Describe what changed" = "Kuvaile muutokset" +"Description" = "Kuvaus" +"Description (optional)" = "Kuvaus (valinnainen)" +"Design" = "Suunnittelu" +"Design system starter" = "Muotoilujärjestelmän aloituspohja" +"Desktop" = "Työpöytä" +"Destination" = "Kohde" +"Detach alias" = "Irrota alias" +"Detach instance" = "Irrota ilmentymä" +"Detach property" = "Irrota ominaisuus" +"Detach style" = "Irrota tyyli" +"Detach styles" = "Irrota tyylit" +"Detach variable" = "Irrota muuttuja" +"Details" = "Tiedot" +"Dev Mode" = "Kehittäjätila" +"Dev resources" = "Kehittäjäresurssit" +"Development" = "Kehitys" +"Device" = "Laite" +"Device at 100%" = "Laite koossa 100 %" +"Diamond" = "Vinoneliö" +"Difference" = "Erotus" +"Dimensions" = "Mitat" +"Direction" = "Suunta" +"Disconnect from code" = "Katkaise yhteys koodiin" +"Dispersion" = "Hajonta" +"Display name" = "Näyttönimi" +"Dissolve" = "Häivytys" +"Distribute and tidy" = "Jaa ja järjestä" +"Distribute horizontal spacing" = "Jaa vaakavälit tasan" +"Distribute vertical spacing" = "Jaa pystyvälit tasan" +"Divider" = "Erotin" +"Don't truncate" = "Älä lyhennä" +"Done" = "Valmis" +"Done editing" = "Lopeta muokkaus" +"Dots" = "Pisteet" +"Dotted" = "Pisteviiva" +"Down" = "Alas" +"Drafts" = "Luonnokset" +"Drag the stroke to add a width point" = "Lisää leveyspiste vetämällä reunaviivaa" +"Draw" = "Piirrä" +"Draw a frame" = "Piirrä kehys" +"Drawing tools" = "Piirtotyökalut" +"Drop a .figcraft, .fig, .json, .svg or image file." = "Pudota .figcraft-, .fig-, .json-, .svg- tai kuvatiedosto." +"Drop shadow" = "Heittovarjo" +"Drop to import" = "Tuo pudottamalla" +"Drop to open" = "Avaa pudottamalla" +"Dual-licensed MIT OR Apache-2.0. Made by the ArtCraft team and community." = "Kaksoislisensoitu: MIT OR Apache-2.0. ArtCraft-tiimin ja yhteisön tekemä." +"Duo" = "Kaksivärinen" +"Duplicate" = "Monista" +"Duplicate by dragging" = "Monista vetämällä" +"Duplicate mode" = "Monista tila" +"Duplicate page" = "Monista sivu" +"Edit" = "Muokkaa" +"Edit as an expression" = "Muokkaa lausekkeena" +"Edit colour" = "Muokkaa väriä" +"Edit comment" = "Muokkaa kommenttia" +"Edit dev resource" = "Muokkaa kehittäjäresurssia" +"Edit link" = "Muokkaa linkkiä" +"Edit link copied" = "Muokkauslinkki kopioitu" +"Edit style" = "Muokkaa tyyliä" +"Edit variable" = "Muokkaa muuttujaa" +"Edit with the builder" = "Muokkaa rakentimella" +"Edited {when}" = "Muokattu {when}" +"Effect settings" = "Tehosteen asetukset" +"Effect styles" = "Tehostetyylit" +"Effects" = "Tehosteet" +"Ellipse" = "Ellipsi" +"Ellipses" = "Ellipsit" +"Else" = "Muuten" +"Else if" = "Muuten jos" +"Embedded profile" = "Upotettu profiili" +"Empty" = "Tyhjä" +"End" = "Loppu" +"End point" = "Loppupiste" +"Ends the session; everyone keeps their copy" = "Lopettaa istunnon. Kaikki säilyttävät oman kopionsa." +"Enter" = "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" +"Esc" = "Esc" +"Essential" = "Olennainen" +"Every conflict has a choice." = "Jokaiselle ristiriidalle on valittu ratkaisu." +"Every top-level frame already starts a flow" = "Jokainen ylimmän tason kehys aloittaa jo kulun" +"Exact opacity (4 then 5: 45%)" = "Tarkka peittävyys (4 ja sitten 5: 45 %)" +"Exclude" = "Jätä pois" +"Excluded" = "Jätetty pois" +"Excluded from layout" = "Jätetty pois asettelusta" +"Excludes" = "Poissulkee" +"Exclusion" = "Poissulku" +"Exit focus view (Esc)" = "Poistu kohdistusnäkymästä (Esc)" +"Expand" = "Laajenna" +"Export" = "Vie" +"Export all" = "Vie kaikki" +"Export frames and layers as PNG, JPG, SVG or PDF" = "Vie kehyksiä ja tasoja PNG-, JPG-, SVG- tai PDF-muodossa" +"Export page as PNG" = "Vie sivu PNG-muodossa" +"Export settings" = "Vientiasetukset" +"Export variables" = "Vie muuttujat" +"Export {name}" = "Vie {name}" +"Export {n} layers" = { one = "Vie {n} taso", other = "Vie {n} tasoa" } +"Exported {file}" = "Viety: {file}" +"Exported {name}" = "Viety: {name}" +"Exported {name}; {n} kinds of content were left out" = { one = "Viety {name}; {n} sisältötyyppi jätettiin pois", other = "Viety {name}; {n} sisältötyyppiä jätettiin pois" } +"Exported {n} files" = { one = "Viety {n} tiedosto", other = "Viety {n} tiedostoa" } +"Export…" = "Vie…" +"Expose properties to instances" = "Tuo ominaisuudet ilmentymien käyttöön" +"Exposure" = "Valotus" +"Expression" = "Lauseke" +"Extend collection" = "Laajenna kokoelmaa" +"Extends \"{name}\": overridden values are marked" = "Laajentaa kokoelmaa ”{name}”: ohitetut arvot on merkitty" +"Eye" = "Silmä" +"F" = "F" +"Fade" = "Häivytys" +"False" = "Epätosi" +"Feb" = "helmik." +"Fetching from the server…" = "Haetaan palvelimelta…" +"FigCraft couldn't open its window: {error}" = "FigCraft ei voinut avata ikkunaansa: {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 ei vielä tue näiden tiedostojen kaikkia ominaisuuksia. Huomautukset kertovat, mitä tuodusta kopiosta jätettiin pois tai muutettiin. Alkuperäinen tiedosto säilyy ennallaan." +"File" = "Tiedosto" +"File name" = "Tiedostonimi" +"File not found" = "Tiedostoa ei löydy" +"File published" = "Tiedosto julkaistu" +"Files aren't end-to-end encrypted: the server's operator can read them." = "Tiedostoja ei salata päästä päähän. Palvelimen ylläpitäjä voi lukea ne." +"Files nobody opens for {n} days are deleted." = { one = "Tiedostot, joita kukaan ei avaa {n} päivään, poistetaan.", other = "Tiedostot, joita kukaan ei avaa {n} päivään, poistetaan." } +"Fill" = "Täyttö" +"Fill (fr)" = "Täytä (fr)" +"Fill container" = "Täytä säilö" +"Fill window" = "Täytä ikkuna" +"Fills" = "Täytöt" +"Fill|sizing" = "Täytä" +"Filter and sort" = "Suodata ja lajittele" +"Find" = "Etsi" +"Find and replace" = "Etsi ja korvaa" +"Find layers" = "Etsi tasoja" +"First" = "Ensimmäinen" +"First commit" = "Ensimmäinen muutos" +"First on top" = "Ensimmäinen päällimmäisenä" +"Fit" = "Sovita" +"Fit device to window" = "Sovita laite ikkunaan" +"Fit to contents" = "Sovita sisältöön" +"Fit to window" = "Sovita ikkunaan" +"Fit width" = "Sovita leveyteen" +"Fixed" = "Kiinteä" +"Fixed gap" = "Kiinteä väli" +"Fixed size" = "Kiinteä koko" +"Flatten" = "Yhdistä vektorimuodoksi" +"Flip" = "Peilaa" +"Flip horizontal" = "Peilaa vaakasuunnassa" +"Flip text to the other side" = "Siirrä teksti toiselle puolelle" +"Flip vertical" = "Peilaa pystysuunnassa" +"Flip width profile" = "Peilaa leveysprofiili" +"Flow starting point" = "Kulun aloituspiste" +"Flow starting points" = "Kulkujen aloituspisteet" +"Flows" = "Kulut" +"Focus view" = "Kohdistusnäkymä" +"Fold autosaves" = "Tiivistä automaattiset tallennukset" +"Folder: click to collapse" = "Kansio: supista napsauttamalla" +"Folder: click to expand" = "Kansio: laajenna napsauttamalla" +"Follow" = "Seuraa" +"Follow {name}" = "Seuraa käyttäjää {name}" +"Following" = "Seurataan" +"Following {name} · {key} to stop" = "Seurataan käyttäjää {name} · lopeta painamalla {key}" +"Font" = "Fontti" +"Font not installed" = "Fonttia ei ole asennettu" +"Font size" = "Fonttikoko" +"Font style" = "Fonttityyli" +"Forget on this computer" = "Unohda tällä tietokoneella" +"Four screens of a trail app with components and a prototype flow" = "Retkeilysovelluksen neljä näkymää, komponentit ja prototyypin kulku" +"Fractions" = "Murtoluvut" +"Frame" = "Kehys" +"Frame selection" = "Kehystä valinta" +"Frame tools" = "Kehystyökalut" +"Frames" = "Kehykset" +"From the library \"{name}\": read-only" = "Kirjastosta ”{name}”: vain luku" +"From {name}" = "Lähteestä {name}" +"From {server}" = "Palvelimelta {server}" +"Frost" = "Huurre" +"Gap" = "Väli" +"Gap between columns" = "Sarakkeiden väli" +"Gap between items" = "Kohteiden väli" +"Gap between rows" = "Rivien väli" +"Getting started" = "Aloittaminen" +"Give the address of a server open to the public, or a server's address with its key (`figcraft-server key` prints it)." = "Anna julkisen palvelimen osoite tai palvelimen osoite avaimineen (`figcraft-server key` tulostaa avaimen)." +"Glass" = "Lasi" +"Go to main component" = "Siirry pääkomponenttiin" +"Go to {name}" = "Siirry kohteeseen {name}" +"Grab bag" = "Sekalaiset" +"Gradient" = "Liukuväri" +"Gray" = "Harmaa" +"Green" = "Vihreä" +"Greyscale components and two example screens to sketch a flow with" = "Harmaasävykomponentit ja kaksi esimerkkinäkymää kulun luonnosteluun" +"Grid" = "Ruudukko" +"Grid ({size})" = "Ruudukko ({size})" +"Grid styles" = "Ruudukkotyylit" +"Grid {size}" = "Ruudukko {size}" +"Group" = "Ryhmä" +"Group selection" = "Ryhmittele valinta" +"Groups" = "Ryhmät" +"Gutter" = "Palstaväli" +"Hand tool" = "Käsityökalu" +"Hanging list" = "Riippuva luettelo" +"Hanging punctuation" = "Välimerkkien ulonnus" +"Hard light" = "Kova valo" +"Height" = "Korkeus" +"Help" = "Ohje" +"Help and resources" = "Ohje ja resurssit" +"Help page" = "Ohjesivu" +"Here: {names}" = "Paikalla: {names}" +"Hidden" = "Kätketty" +"Hide contents" = "Kätke sisältö" +"Hide from publishing" = "Jätä julkaisematta" +"Hide section contents" = "Kätke osion sisältö" +"Hide these tips (Getting started in the Help menu shows them again)" = "Kätke nämä vinkit (Ohje-valikon Aloittaminen näyttää ne uudelleen)" +"Hide when publishing" = "Kätke julkaistaessa" +"Highlight layers on hover" = "Korosta tasot osoitettaessa" +"Highlights" = "Huippuvalot" +"Hold Alt" = "Pidä Alt painettuna" +"Hold Alt+Z" = "Pidä Alt+Z painettuna" +"Hold Ctrl" = "Pidä Ctrl painettuna" +"Hold Z" = "Pidä Z painettuna" +"Hold ⌃ or ⌘" = "Pidä ⌃ tai ⌘ painettuna" +"Hold ⌥" = "Pidä ⌥ painettuna" +"Hold ⌥Z" = "Pidä ⌥Z painettuna" +"Home" = "Aloitus" +"Horizontal" = "Vaakasuunta" +"Horizontal align" = "Vaakatasaus" +"Horizontal hex" = "Vaakasuuntainen kuusikulmio" +"Horizontal padding" = "Vaakasuuntainen sisämarginaali" +"Horizontal spacing" = "Vaakavälistys" +"Hosted by {operator}" = "Ylläpitäjä: {operator}" +"Hover a layer to see its properties" = "Näytä tason ominaisuudet viemällä osoitin sen päälle" +"Hover other layers to measure the distance" = "Mittaa etäisyys viemällä osoitin muiden tasojen päälle" +"Hue" = "Sävy" +"Hug" = "Sovita sisältöön" +"Hug contents" = "Sovita sisältöön" +"Icon components on a 24 px grid with keylines and a size preview" = "Kuvakekomponentteja 24 px:n ruudukossa, apulinjat ja koon esikatselu" +"Icon set starter" = "Kuvakejoukon aloituspohja" +"If" = "Jos" +"If it keeps happening, please report it at {link} with this message." = "Jos ongelma jatkuu, ilmoita siitä osoitteessa {link} ja liitä tämä viesti mukaan." +"If {condition}" = "Jos {condition}" +"Ignore auto layout (absolute position)" = "Ohita automaattinen asettelu (absoluuttinen sijainti)" +"Image" = "Kuva" +"Images" = "Kuvat" +"Import" = "Tuo" +"Import path" = "Tuontipolku" +"Import plugin from manifest" = "Tuo liitännäinen manifestista" +"Import plugin from manifest…" = "Tuo liitännäinen manifestista…" +"Import report" = "Tuontiraportti" +"Import variables" = "Tuo muuttujat" +"Imported document" = "Tuotu asiakirja" +"Imported {name}" = "Tuotu: {name}" +"Imported {n} new variables, updated {updated}" = { one = "Tuotu {n} uusi muuttuja, päivitetty {updated}", other = "Tuotu {n} uutta muuttujaa, päivitetty {updated}" } +"Import…" = "Tuo…" +"In an instance, this comes from the main component" = "Ilmentymässä tämä arvo tulee pääkomponentista" +"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)." = "Selaimessa voit liittyä työpöytäsovelluksen isännöimiin istuntoihin ja FigCraft-palvelimen tiedostoihin. https-sivu tavoittaa muut tietokoneet vain wss://-linkeillä (TLS:n takana oleva palvelin)." +"Include bounding box" = "Sisällytä rajauslaatikko" +"Include id attribute" = "Sisällytä id-määrite" +"Included" = "Sisällytetty" +"Included in layout" = "Sisällytetty asetteluun" +"Individual corners" = "Kulmat erikseen" +"Individual strokes" = "Reunaviivat erikseen" +"Ink" = "Muste" +"Inner shadow" = "Sisävarjo" +"Inside" = "Sisäpuolella" +"Inspect" = "Tarkastele" +"Inspect the layer under the pointer: size, colours, typography" = "Tarkastele osoittimen alla olevaa tasoa: koko, värit ja typografia" +"Install" = "Asenna" +"Install plugin" = "Asenna liitännäinen" +"Installed" = "Asennettu" +"Installed {name}" = "Asennettu: {name}" +"Installing…" = "Asennetaan…" +"Instance" = "Ilmentymä" +"Instance properties" = "Ilmentymän ominaisuudet" +"Instance swap" = "Ilmentymän vaihto" +"Instance swap (no other component)" = "Ilmentymän vaihto (ei muuta komponenttia)" +"Instances" = "Ilmentymät" +"Instant" = "Välitön" +"Intensity" = "Vahvuus" +"Interaction" = "Vuorovaikutus" +"Interactions" = "Vuorovaikutukset" +"Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Käyttöliittymien suunnittelu ja prototyypit. Ilmainen avoimen lähdekoodin suunnittelutyökalu, joka on toteutettu riippumattomasti alusta alkaen Rustilla. Osa ArtCraft-sovellusperhettä." +"Intersect" = "Leikkaus" +"Intersects" = "Leikkaa" +"Invalid color" = "Virheellinen väri" +"Invite link" = "Kutsulinkki" +"Invite link copied" = "Kutsulinkki kopioitu" +"It asks permission to:" = "Se pyytää oikeutta:" +"Jan" = "tammik." +"Join" = "Liity" +"Join code copied" = "Liittymiskoodi kopioitu" +"Join code or invite link" = "Liittymiskoodi tai kutsulinkki" +"Join live session" = "Liity reaaliaikaiseen istuntoon" +"Join us on Discord" = "Liity yhteisöömme Discordissa" +"Join with a code" = "Liity koodilla" +"Joined" = "Liitytty" +"Joined {file}" = "Liitytty tiedostoon {file}" +"Joining…" = "Liitytään…" +"Join|stroke" = "Liitos" +"Jul" = "heinäk." +"Jun" = "kesäk." +"Just now" = "Juuri nyt" +"Justify" = "Tasaa molemmat reunat" +"Keep appearance" = "Säilytä ulkoasu" +"Keep appearance converts every color value to {profile} so colors look the same. Keep values leaves the numbers as they are, so colors shift." = "Säilytä ulkoasu muuntaa kaikki väriarvot profiiliin {profile}, jotta värit näyttävät samoilta. Säilytä arvot jättää lukuarvot ennalleen, jolloin värit muuttuvat." +"Keep tool selected after use" = "Pidä työkalu valittuna käytön jälkeen" +"Keep values" = "Säilytä arvot" +"Key/Gamepad" = "Näppäin/peliohjain" +"Key/Gamepad {key}" = "Näppäin/peliohjain {key}" +"Keyboard shortcuts" = "Pikanäppäimet" +"Kits" = "Paketit" +"Landing page" = "Laskeutumissivu" +"Language" = "Kieli" +"Lasso" = "Lasso" +"Last" = "Viimeinen" +"Last change: {note}" = "Viimeisin muutos: {note}" +"Last commit" = "Viimeisin muutos" +"Last modified" = "Viimeksi muokattu" +"Last on top" = "Viimeinen päällimmäisenä" +"Layer blur" = "Tason sumennus" +"Layer name" = "Tason nimi" +"Layers" = "Tasot" +"Layers in an instance take their position from the main component" = "Ilmentymän tasot saavat sijaintinsa pääkomponentista" +"Layout" = "Asettelu" +"Layout grid" = "Asetteluruudukko" +"Layout grid settings" = "Asetteluruudukon asetukset" +"Layout grids" = "Asetteluruudukot" +"Leave session" = "Poistu istunnosta" +"Leaves" = "Lehdet" +"Left" = "Vasen" +"Left & right" = "Vasen ja oikea" +"Left side" = "Vasen puoli" +"Left side width" = "Vasemman puolen leveys" +"Letter case" = "Kirjainkoko" +"Letter spacing" = "Merkkiväli" +"Libraries" = "Kirjastot" +"Libraries in this file" = "Tämän tiedoston kirjastot" +"Library updates available" = "Kirjastopäivityksiä saatavilla" +"Library: click to collapse" = "Kirjasto: supista napsauttamalla" +"Library: click to expand" = "Kirjasto: laajenna napsauttamalla" +"Library: its variables are read-only here; edit them in the library file and publish it" = "Kirjasto: sen muuttujat ovat tässä vain luettavissa. Muokkaa niitä kirjastotiedostossa ja julkaise se." +"Light" = "Vaalea" +"Lighten" = "Vaalenna" +"Light|glass" = "Valo" +"Line" = "Viiva" +"Line arrow" = "Viivanuoli" +"Line delta" = "Rivimuutos" +"Line height" = "Rivikorkeus" +"Linear" = "Lineaarinen" +"Lines" = "Viivat" +"Lines +/−" = "Rivit +/−" +"Lines added" = "Lisätyt rivit" +"Lines deleted" = "Poistetut rivit" +"Link" = "Linkki" +"Link copied" = "Linkki kopioitu" +"Link docs, code or tickets for developers." = "Linkitä dokumentaatiota, koodia tai tehtäviä kehittäjille." +"Link frames on the Prototype tab, then present the flow" = "Linkitä kehykset Prototyyppi-välilehdellä ja esitä sitten kulku" +"Link this component to its code component: instances then show your real snippet with their values." = "Yhdistä tämä komponentti sen koodikomponenttiin. Ilmentymät näyttävät sitten todellisen koodikatkelmasi omilla arvoillaan." +"List spacing" = "Luettelon välistys" +"List style" = "Luettelotyyli" +"Live session" = "Reaaliaikainen istunto" +"Live · {people}" = "Reaaliaikainen · {people}" +"Local components" = "Paikalliset komponentit" +"Local network" = "Paikallisverkko" +"Local styles" = "Paikalliset tyylit" +"Local variables" = "Paikalliset muuttujat" +"Lock/Unlock" = "Lukitse/avaa lukitus" +"Locked" = "Lukittu" +"Lowercase" = "Pienet kirjaimet" +"Luminance" = "Luminanssi" +"Luminosity" = "Valoisuus" +"Main" = "Päähaara" +"Main component deleted" = "Pääkomponentti poistettu" +"Main menu" = "Päävalikko" +"Make a component" = "Luo komponentti" +"Make slot" = "Luo sisältöpaikka" +"Mar" = "maalisk." +"Margin" = "Marginaali" +"Mark all as read" = "Merkitse kaikki luetuiksi" +"Mark as resolved" = "Merkitse ratkaistuksi" +"Mark as unread" = "Merkitse lukemattomaksi" +"Mark as unresolved" = "Merkitse ratkaisemattomaksi" +"Mask" = "Maski" +"Mass · Stiffness · Damping" = "Massa · jäykkyys · vaimennus" +"Match (empty: the whole name)" = "Etsittävä (tyhjä: koko nimi)" +"Max H" = "Enimmäiskorkeus" +"Max W" = "Enimmäisleveys" +"Max lines" = "Rivien enimmäismäärä" +"Maximize" = "Suurenna" +"May" = "toukok." +"Measure to the selection" = "Mittaa valintaan" +"Merge into main" = "Yhdistä päähaaraan" +"Merge regions" = "Yhdistä alueet" +"Merge the branch into the main file (one undo step) and archive it" = "Yhdistä haara päätiedostoon (yksi kumottava toiminto) ja arkistoi se" +"Merged" = "Yhdistetty" +"Merged PRs" = "Yhdistetyt PR:t" +"Min H" = "Vähimmäiskorkeus" +"Min W" = "Vähimmäisleveys" +"Minimize" = "Pienennä" +"Mirror angle" = "Peilaa kulma" +"Mirror angle and length" = "Peilaa kulma ja pituus" +"Mirroring" = "Peilaus" +"Missing" = "Puuttuu" +"Missing fonts" = "Puuttuvat fontit" +"Missing layer" = "Puuttuva taso" +"Missing style" = "Puuttuva tyyli" +"Missing variable" = "Puuttuva muuttuja" +"Miter" = "Jiiri" +"Miter angle" = "Jiirikulma" +"Mixed" = "Useita arvoja" +"Mixed fonts" = "Useita fontteja" +"Mixed interactions: click + to replace them" = "Vaihtelevia vuorovaikutuksia: korvaa napsauttamalla +" +"Mobile app" = "Mobiilisovellus" +"Mode" = "Tila" +"Model" = "Malli" +"Models" = "Mallit" +"Mono" = "Yksivärinen" +"More" = "Lisää" +"More instance actions" = "Lisää ilmentymän toimintoja" +"Mouse down" = "Hiiren painallus" +"Mouse enter" = "Osoitin saapuu" +"Mouse leave" = "Osoitin poistuu" +"Mouse up" = "Hiiren vapautus" +"Move" = "Siirrä" +"Move along the toolbar or the layer rows" = "Siirry työkalurivillä tai tasoriveillä" +"Move column left" = "Siirrä sarake vasemmalle" +"Move column right" = "Siirrä sarake oikealle" +"Move down" = "Siirrä alas" +"Move in" = "Siirry sisään" +"Move out" = "Siirry ulos" +"Move tools" = "Siirtotyökalut" +"Move up" = "Siirrä ylös" +"Moved to {name}" = "Siirretty kohteeseen {name}" +"Multi" = "Monivärinen" +"Multiply" = "Kerro" +"Muted" = "Hillitty" +"Name" = "Nimi" +"Name (A–Z)" = "Nimi (A–Z)" +"Named instance" = "Nimetty ilmentymä" +"Navigate to" = "Siirry kohteeseen" +"Nested instance" = "Sisäkkäinen ilmentymä" +"New design file" = "Uusi suunnittelutiedosto" +"Newest first" = "Uusimmat ensin" +"Next frame" = "Seuraava kehys" +"Next or previous control in the focused region" = "Seuraava tai edellinen säädin kohdistetulla alueella" +"Next ready for dev" = "Seuraava kehitysvalmis" +"Next size option" = "Seuraava kokovaihtoehto" +"No assets: no export settings, icons or images. Add export settings in the Design tab." = "Ei resursseja: ei vientiasetuksia, kuvakkeita tai kuvia. Lisää vientiasetuksia Suunnittelu-välilehdellä." +"No boolean variables fit here." = "Tähän ei sovi totuusarvomuuttujia." +"No boolean variables yet. Create them in Local variables." = "Ei vielä totuusarvomuuttujia. Luo niitä Paikalliset muuttujat -näkymässä." +"No branches. A branch is a copy of the file to try changes in, then review and merge." = "Ei haaroja. Haara on tiedoston kopio, jossa voi kokeilla muutoksia ja sitten tarkistaa ja yhdistää ne." +"No category" = "Ei luokkaa" +"No changes" = "Ei muutoksia" +"No color styles" = "Ei värityylejä" +"No colour variables fit here." = "Tähän ei sovi värimuuttujia." +"No colour variables yet. Create them in Local variables." = "Ei vielä värimuuttujia. Luo niitä Paikalliset muuttujat -näkymässä." +"No comments yet" = "Ei vielä kommentteja" +"No compatibility warnings reported" = "Yhteensopivuusvaroituksia ei ilmoitettu" +"No components yet. Select layers and press {keys}." = "Ei vielä komponentteja. Valitse tasoja ja paina {keys}." +"No conflicts." = "Ei ristiriitoja." +"No contributor data was built into this copy." = "Tähän versioon ei ole sisällytetty tekijätietoja." +"No device" = "Ei laitetta" +"No files or templates match your search" = "Hakua vastaavia tiedostoja tai malleja ei löydy" +"No fonts match" = "Vastaavia fontteja ei löydy" +"No join code here (the server is older than join codes, or this address can't be put in one): share the link instead." = "Liittymiskoodia ei ole (palvelin on liittymiskoodeja vanhempi tai tätä osoitetta ei voi sisällyttää koodiin). Jaa linkki sen sijaan." +"No layer changes to show." = "Ei näytettäviä tasomuutoksia." +"No libraries yet. Add a .figcraft file that was published as a library, or paste a team library's link." = "Ei vielä kirjastoja. Lisää kirjastona julkaistu .figcraft-tiedosto tai liitä tiimikirjaston linkki." +"No list" = "Ei luetteloa" +"No matching comments" = "Vastaavia kommentteja ei löydy" +"No matching components" = "Vastaavia komponentteja ei löydy" +"No matching layers" = "Vastaavia tasoja ei löydy" +"No matching styles" = "Vastaavia tyylejä ei löydy" +"No matching variables" = "Vastaavia muuttujia ei löydy" +"No mirroring" = "Ei peilausta" +"No model credits were built into this copy." = "Tähän versioon ei ole sisällytetty mallien tekijätietoja." +"No number variables fit here." = "Tähän ei sovi lukumuuttujia." +"No number variables yet. Create them in Local variables." = "Ei vielä lukumuuttujia. Luo niitä Paikalliset muuttujat -näkymässä." +"No other pages" = "Ei muita sivuja" +"No paints" = "Ei täyttöjä" +"No plugins on {server}." = "Palvelimella {server} ei ole liitännäisiä." +"No plugins yet. Import a development plugin from its figcraft-plugin.json." = "Ei vielä liitännäisiä. Tuo kehitysliitännäinen sen figcraft-plugin.json-tiedostosta." +"No preferred components" = "Ei ensisijaisia komponentteja" +"No preset" = "Ei esiasetusta" +"No saved versions yet. Save a version to mark a point in your work you can come back to." = "Ei vielä tallennettuja versioita. Tallenna versio, jotta voit palata tähän työvaiheeseen myöhemmin." +"No scrolling" = "Ei vieritystä" +"No shortcuts match" = "Vastaavia pikanäppäimiä ei löydy" +"No status" = "Ei tilaa" +"No string variables fit here." = "Tähän ei sovi merkkijonomuuttujia." +"No string variables yet. Create them in Local variables." = "Ei vielä merkkijonomuuttujia. Luo niitä Paikalliset muuttujat -näkymässä." +"No styles yet." = "Ei vielä tyylejä." +"No styles yet. Click + to create one from the selection." = "Ei vielä tyylejä. Luo tyyli valinnasta napsauttamalla +." +"No templates match your search" = "Hakua vastaavia malleja ei löydy" +"No text styles yet. Click + to create one from the selected text." = "Ei vielä tekstityylejä. Luo tyyli valitusta tekstistä napsauttamalla +." +"No variables fit here." = "Tähän ei sovi muuttujia." +"No variables yet. Create them in Local variables." = "Ei vielä muuttujia. Luo niitä Paikalliset muuttujat -näkymässä." +"Nobody else is here yet" = "Kukaan muu ei ole vielä paikalla" +"Noise" = "Kohina" +"None" = "Ei mitään" +"None." = "Ei mitään." +"Normal" = "Normaali" +"Not bound" = "Ei sidottu" +"Not in a live session" = "Ei reaaliaikaisessa istunnossa" +"Not in this font" = "Ei tässä fontissa" +"Not properties, kept as written: {names}" = "Eivät ole ominaisuuksia, säilytetään sellaisinaan: {names}" +"Not read yet" = "Ei vielä luettu" +"Not shared" = "Ei jaettu" +"Note {n}" = "Huomautus {n}" +"Nothing changed since this was marked ready for dev." = "Mikään ei ole muuttunut kehitysvalmiiksi merkitsemisen jälkeen." +"Nothing here yet. Set a frame's status to list it." = "Ei vielä sisältöä. Lisää kehys luetteloon asettamalla sen tila." +"Nothing online yet. Use Share on a file to put it online and it is listed here." = "Ei vielä verkkotiedostoja. Julkaise tiedosto verkkoon Jaa-toiminnolla, niin se näkyy tässä." +"Nothing to export" = "Ei vietävää" +"Nov" = "marrask." +"Now" = "Nyt" +"Nudge (Shift: big nudge)" = "Siirrä askel (Shift: suuri askel)" +"Nudge amount" = "Siirtoaskeleen koko" +"Number" = "Luku" +"Number ↑" = "Luku ↑" +"Number ↓" = "Luku ↓" +"Numbered list" = "Numeroitu luettelo" +"Object" = "Objekti" +"Oct" = "lokak." +"Off" = "Ei käytössä" +"Offered first when filling the slot (any content is allowed)" = "Ehdotetaan ensin sisältöpaikkaa täytettäessä (kaikki sisältö sallitaan)" +"Offered first when swapping the instance (any component is allowed)" = "Ehdotetaan ensin ilmentymää vaihdettaessa (kaikki komponentit sallitaan)" +"Offset" = "Siirtymä" +"Oldest first" = "Vanhimmat ensin" +"On click" = "Napsautettaessa" +"On drag" = "Vedettäessä" +"On this page" = "Tällä sivulla" +"One announcement in five common sizes: square, portrait, story, link and banner" = "Yksi ilmoitus viidessä tavallisessa koossa: neliö, pysty, tarina, linkki ja banneri" +"Online" = "Verkossa" +"Online files" = "Verkkotiedostot" +"Online sharing is off: files are shared on the local network only." = "Verkkojakaminen on pois käytöstä. Tiedostoja jaetaan vain lähiverkossa." +"Only the first changed layers are listed." = "Vain ensimmäiset muuttuneet tasot näytetään." +"Only the first {n} changed layers are listed." = "Vain ensimmäiset {n} muuttunutta tasoa näytetään." +"Only your threads" = "Vain omat keskustelut" +"Opacity" = "Peittävyys" +"Opacity & blend" = "Peittävyys ja sekoitus" +"Opacity 10%…90%, 0: 100%" = "Peittävyys 10 %…90 %, 0: 100 %" +"Open" = "Avaa" +"Open .figcraft, .svg or images" = "Avaa .figcraft-, .svg- tai kuvatiedostoja" +"Open branch" = "Avaa haara" +"Open file" = "Avaa tiedosto" +"Open files" = "Avaa tiedostoja" +"Open in focus view" = "Avaa kohdistusnäkymässä" +"Open in new window" = "Avaa uudessa ikkunassa" +"Open invite links in FigCraft" = "Avaa kutsulinkit FigCraftissa" +"Open link" = "Avaa linkki" +"Open link {url}" = "Avaa linkki {url}" +"Open overlay" = "Avaa peittokuva" +"Open prototype preview" = "Avaa prototyypin esikatselu" +"Open variables ({count})" = "Avaa muuttujat ({count})" +"Opened as a new document" = "Avattu uutena asiakirjana" +"Opened “{name}” in a new tab" = "”{name}” avattu uudessa välilehdessä" +"Opening the file…" = "Avataan tiedostoa…" +"Opening {n} files as new files" = { one = "Avataan uutena tiedostona", other = "Avataan uusia tiedostoja: {n}" } +"Open|comments" = "Avoin" +"Options" = "Asetukset" +"Orange" = "Oranssi" +"Order" = "Järjestys" +"Other" = "Muu" +"Other apps may not open every .fig file exported here." = "Muut sovellukset eivät välttämättä avaa kaikkia tässä vietyjä .fig-tiedostoja." +"Others lose access and keep their copy; the file stays on the server for you" = "Muiden käyttöoikeus päättyy, ja he säilyttävät kopionsa. Tiedosto jää palvelimelle käyttöösi." +"Others type this under Share ▸ Join with a code" = "Muut kirjoittavat tämän kohtaan Jaa ▸ Liity koodilla" +"Outline stroke" = "Muunna reunaviiva poluksi" +"Outline text" = "Muunna teksti poluiksi" +"Outlines" = "Ääriviivat" +"Outside" = "Ulkopuolella" +"Overflow" = "Ylivuoto" +"Overlay" = "Peittokuva" +"Overlay position" = "Peittokuvan sijainti" +"Overridden here (the collection it extends has another value)" = "Ohitettu tässä (laajennetussa kokoelmassa on toinen arvo)" +"Overrides" = "Ohitukset" +"Owner token" = "Omistajan tunniste" +"Owner token copied" = "Omistajan tunniste kopioitu" +"PDF print options" = "PDF-tulostusasetukset" +"PDF print settings" = "PDF-tulostusasetukset" +"Padding" = "Sisämarginaali" +"Page" = "Sivu" +"Pages" = "Sivut" +"Pages added to the document" = "Sivut lisätty asiakirjaan" +"Pages: {pages}" = "Sivut: {pages}" +"Paint bucket" = "Maalipurkki" +"Pan the canvas" = "Siirrä piirtoaluetta" +"Pan with nothing selected (Shift: farther)" = "Siirrä näkymää ilman valintaa (Shift: pidemmälle)" +"Panels" = "Paneelit" +"Paper" = "Paperi" +"Paragraph indent" = "Kappaleen sisennys" +"Paragraph indent applies to left-aligned text" = "Kappaleen sisennys koskee vasemmalle tasattua tekstiä" +"Paragraph spacing" = "Kappaleväli" +"Pass through" = "Läpivienti" +"Paste a link (https://…)" = "Liitä linkki (https://…)" +"Paste a team library link (a view link)" = "Liitä tiimikirjaston linkki (katselulinkki)" +"Paste here" = "Liitä tähän" +"Paste to replace" = "Liitä korvaten" +"Pasted design layers; {n} kinds of content were left out" = { one = "Suunnittelutasot liitetty; {n} sisältötyyppi jätettiin pois", other = "Suunnittelutasot liitetty; {n} sisältötyyppiä jätettiin pois" } +"Pattern" = "Kuvio" +"Pattern alignment" = "Kuvion tasaus" +"Pattern scale" = "Kuvion skaalaus" +"Pattern source" = "Kuvion lähde" +"Pen" = "Kynä" +"Pencil" = "Lyijykynä" +"People in this file" = "Tämän tiedoston käyttäjät" +"People join from anywhere with a code. The file is kept on {server} while you share it." = "Käyttäjät voivat liittyä koodilla mistä tahansa. Tiedosto säilytetään palvelimella {server} jakamisen ajan." +"People on your network join with a code. Nothing goes through a server." = "Lähiverkkosi käyttäjät liittyvät koodilla. Mitään ei kulje palvelimen kautta." +"Phone" = "Puhelin" +"Pick color" = "Poimi väri" +"Pick color (I)" = "Poimi väri (I)" +"Pick one font family first" = "Valitse ensin yksi fonttiperhe" +"Pick the Frame tool, then drag on the canvas or choose a device size" = "Valitse Kehys-työkalu ja vedä piirtoalueella tai valitse laitteen koko" +"Pin a property" = "Kiinnitä ominaisuus" +"Pinch" = "Nipistys" +"Pixel grid" = "Pikseliruudukko" +"Pixel preview 1x" = "Pikseliesikatselu 1x" +"Pixel preview 2x" = "Pikseliesikatselu 2x" +"Place a shape or frame (its tool chosen)" = "Sijoita muoto tai kehys (sen työkalu valittuna)" +"Place automatically" = "Sijoita automaattisesti" +"Place image" = "Sijoita kuva" +"Placed on the current page" = "Sijoitettu nykyiselle sivulle" +"Playground" = "Kokeilualue" +"Plugin" = "Liitännäinen" +"Plugins" = "Liitännäiset" +"Plugins & widgets" = "Liitännäiset ja pienoisohjelmat" +"Plugins run in FigCraft's sandbox, without files, network or clock. Install only plugins you trust." = "Liitännäiset toimivat FigCraftin eristetyssä ympäristössä ilman tiedostoja, verkkoa tai kelloa. Asenna vain luottamiasi liitännäisiä." +"Plus darker" = "Tummempi summa" +"Plus lighter" = "Vaaleampi summa" +"Point" = "Piste" +"Points" = "Pisteet" +"Polygon" = "Monikulmio" +"Polygons" = "Monikulmiot" +"Port" = "Portti" +"Position" = "Sijainti" +"Post" = "Lähetä" +"Preferences" = "Asetukset" +"Preferred" = "Ensisijainen" +"Present" = "Esitä" +"Present or preview" = "Esitä tai esikatsele" +"Present this flow" = "Esitä tämä kulku" +"Presentation" = "Esitys" +"Presentation slides" = "Esitysdiat" +"Presenting: comments" = "Esitys: kommentit" +"Presenting: cycle the size options" = "Esitys: kierrä kokovaihtoehtoja" +"Presenting: full screen" = "Esitys: koko näyttö" +"Presenting: next frame" = "Esitys: seuraava kehys" +"Presenting: previous frame" = "Esitys: edellinen kehys" +"Presenting: restart" = "Esitys: aloita uudelleen" +"Preserve scroll position" = "Säilytä vierityksen sijainti" +"Presets" = "Esiasetukset" +"Press a key…" = "Paina näppäintä…" +"Preview" = "Esikatselu" +"Preview this flow" = "Esikatsele tätä kulkua" +"Preview this frame" = "Esikatsele tätä kehystä" +"Previous frame" = "Edellinen kehys" +"Previous ready for dev" = "Edellinen kehitysvalmis" +"Progressive" = "Asteittainen" +"Properties" = "Ominaisuudet" +"Prototype" = "Prototyyppi" +"Prototype preview" = "Prototyypin esikatselu" +"Prototype settings" = "Prototyypin asetukset" +"Publish" = "Julkaise" +"Publish changes" = "Julkaise muutokset" +"Publish to another server…" = "Julkaise toiselle palvelimelle…" +"Publish to server" = "Julkaise palvelimelle" +"Published version {v}" = "Julkaistu versio {v}" +"Published version {v} to the server" = "Versio {v} julkaistu palvelimelle" +"Published version {v}: save the file so other files can use it" = "Versio {v} julkaistu: tallenna tiedosto, jotta muut tiedostot voivat käyttää sitä" +"Published · {people}" = "Julkaistu · {people}" +"Publishing to a server needs the desktop app; in the browser you can join a server's files" = "Palvelimelle julkaiseminen vaatii työpöytäsovelluksen. Selaimessa voit liittyä palvelimen tiedostoihin." +"Publishing with the server's key." = "Julkaistaan palvelimen avaimella." +"Publishing…" = "Julkaistaan…" +"Push" = "Työntö" +"Push changes to main component" = "Siirrä muutokset pääkomponenttiin" +"Put text on path" = "Sijoita teksti polulle" +"R" = "R" +"Radial" = "Säteittäinen" +"Radius" = "Säde" +"Ratio" = "Suhde" +"Reading the library…" = "Luetaan kirjastoa…" +"Ready for dev" = "Kehitysvalmis" +"Real name" = "Oikea nimi" +"Recent" = "Viimeisimmät" +"Recent files" = "Viimeksi avatut tiedostot" +"Recents" = "Viimeisimmät" +"Recovered {n} unsaved files after the app quit unexpectedly: save them to keep them" = { one = "Tallentamaton tiedosto palautettiin sovelluksen sulkeuduttua odottamatta. Tallenna se säilyttääksesi sen.", other = "Palautettu {n} tallentamatonta tiedostoa sovelluksen sulkeuduttua odottamatta. Tallenna ne säilyttääksesi ne." } +"Rectangle" = "Suorakulmio" +"Rectangles" = "Suorakulmiot" +"Red" = "Punainen" +"Reduce motion" = "Vähennä liikettä" +"Refraction" = "Taittuminen" +"Regular expression" = "Säännöllinen lauseke" +"Remove" = "Poista" +"Remove all" = "Poista kaikki" +"Remove annotation" = "Poista huomautus" +"Remove auto layout" = "Poista automaattinen asettelu" +"Remove dev resource" = "Poista kehittäjäresurssi" +"Remove export setting" = "Poista vientiasetus" +"Remove from recents" = "Poista viimeisimmistä" +"Remove from server" = "Poista palvelimelta" +"Remove from server…" = "Poista palvelimelta…" +"Remove guide" = "Poista apuviiva" +"Remove interaction" = "Poista vuorovaikutus" +"Remove library from this file" = "Poista kirjasto tästä tiedostosta" +"Remove min and max" = "Poista vähimmäis- ja enimmäisrajat" +"Remove min and max height" = "Poista korkeuden vähimmäis- ja enimmäisrajat" +"Remove min and max width" = "Poista leveyden vähimmäis- ja enimmäisrajat" +"Remove regions" = "Poista alueet" +"Remove slot" = "Poista sisältöpaikka" +"Remove starting point" = "Poista aloituspiste" +"Remove stop" = "Poista liukuvärin piste" +"Remove text from path" = "Poista teksti polulta" +"Remove the else and its actions" = "Poista muuten-haara ja sen toiminnot" +"Remove this condition and its actions" = "Poista tämä ehto ja sen toiminnot" +"Remove this file from the server? It can't be shared or opened from there again. Your copy stays open here." = "Poistetaanko tämä tiedosto palvelimelta? Sitä ei voi enää jakaa tai avata sieltä. Oma kopiosi pysyy auki tässä." +"Remove {name} from session" = "Poista {name} istunnosta" +"Remove {name} from {server}?" = "Poistetaanko {name} palvelimelta {server}?" +"Removed" = "Poistettu" +"Removed from the server" = "Poistettu palvelimelta" +"Removed since it was marked" = "Poistettu merkitsemisen jälkeen" +"Rename" = "Nimeä uudelleen" +"Rename duplicated layers" = "Nimeä monistetut tasot uudelleen" +"Rename folder" = "Nimeä kansio uudelleen" +"Rename group" = "Nimeä ryhmä uudelleen" +"Rename layers" = "Nimeä tasot uudelleen" +"Rename mode" = "Nimeä tila uudelleen" +"Rename on the server" = "Nimeä uudelleen palvelimella" +"Rename on the server…" = "Nimeä uudelleen palvelimella…" +"Rename page" = "Nimeä sivu uudelleen" +"Rename to" = "Uusi nimi" +"Replace all" = "Korvaa kaikki" +"Replace mixed export settings" = "Korvaa vaihtelevat vientiasetukset" +"Replace with" = "Korvaa kohteella" +"Replace with a new interaction" = "Korvaa uudella vuorovaikutuksella" +"Reply" = "Vastaa" +"Report" = "Ilmoita" +"Report this file…" = "Ilmoita tästä tiedostosta…" +"Reset" = "Palauta" +"Reset adjustments" = "Palauta säädöt" +"Reset all changes" = "Palauta kaikki muutokset" +"Reset all overrides on this layer" = "Palauta kaikki tämän tason ohitukset" +"Reset overrides" = "Palauta ohitukset" +"Reset slot" = "Palauta sisältöpaikka" +"Reset this override" = "Palauta tämä ohitus" +"Reset to style" = "Palauta tyylin arvo" +"Reset to the inherited value" = "Palauta peritty arvo" +"Resize by the nudge amount" = "Muuta kokoa siirtoaskeleen verran" +"Resize frames to the device's screen (or the window without a device): their constraints and auto layout respond" = "Sovita kehysten koko laitteen näyttöön (tai ikkunaan ilman laitetta). Rajoitteet ja automaattinen asettelu mukautuvat." +"Resize to fit" = "Sovita koko" +"Resizing" = "Koon muuttaminen" +"Resolve" = "Ratkaise" +"Resolve change" = "Ratkaise muutos" +"Resolved" = "Ratkaistu" +"Resources" = "Resurssit" +"Responsive" = "Mukautuva" +"Restart" = "Aloita uudelleen" +"Restore" = "Palauta" +"Restore main component" = "Palauta pääkomponentti" +"Restore this version" = "Palauta tämä versio" +"Restored “{name}”" = "”{name}” palautettu" +"Reverse the order" = "Käännä järjestys" +"Reversed triangle" = "Käänteinen kolmio" +"Review and merge" = "Tarkista ja yhdistä" +"Ribbon" = "Valintanauha" +"Right" = "Oikea" +"Right side" = "Oikea puoli" +"Right side width" = "Oikean puolen leveys" +"Rotate 90°" = "Kierrä 90°" +"Rotate 90° right" = "Kierrä 90° oikealle" +"Rotate to landscape" = "Käännä vaakasuuntaan" +"Rotate to portrait" = "Käännä pystysuuntaan" +"Rotation" = "Kierto" +"Rotation jitter" = "Kierron vaihtelu" +"Round" = "Pyöreä" +"Rounded" = "Pyöristetty" +"Row" = "Rivi" +"Row gap" = "Rivien väli" +"Row sizes" = "Rivien koot" +"Row span" = "Riviulottuvuus" +"Rows" = "Rivit" +"Rows {count}" = "Rivejä: {count}" +"Rulers" = "Viivaimet" +"Run" = "Suorita" +"Run {label}" = "Suorita {label}" +"SHA-256: {sha}…" = "SHA-256: {sha}…" +"Same as layer" = "Sama kuin tasolla" +"Saturation" = "Kylläisyys" +"Save" = "Tallenna" +"Save as" = "Tallenna nimellä" +"Save as preset…" = "Tallenna esiasetuksena…" +"Save files automatically" = "Tallenna tiedostot automaattisesti" +"Save version {key}" = "Tallenna versio {key}" +"Saved" = "Tallennettu" +"Saved {name}" = "Tallennettu: {name}" +"Say something" = "Kirjoita viesti" +"Scale" = "Skaalaus" +"Scatter" = "Hajonta" +"Scoping: where pickers offer it" = "Käyttöalue: missä valitsimet tarjoavat tätä" +"Screen" = "Rasteri" +"Scroll behavior" = "Vierityksen toiminta" +"Scroll to" = "Vieritä kohteeseen" +"Scroll to layer" = "Vieritä tasoon" +"Scroll with parent" = "Vieritä emotason mukana" +"Search" = "Etsi" +"Search actions, layers and tools" = "Etsi toimintoja, tasoja ja työkaluja" +"Search assets" = "Etsi resursseja" +"Search comments" = "Etsi kommentteja" +"Search files and templates" = "Etsi tiedostoja ja malleja" +"Search fonts" = "Etsi fontteja" +"Search layers" = "Etsi tasoja" +"Search plugins" = "Etsi liitännäisiä" +"Search results" = "Hakutulokset" +"Search shortcuts" = "Etsi pikanäppäimiä" +"Search templates" = "Etsi malleja" +"Section" = "Osio" +"Section color" = "Osion väri" +"Sections" = "Osiot" +"See all templates" = "Näytä kaikki mallit" +"Select a frame and add a starting point to present it as a flow." = "Valitse kehys ja lisää aloituspiste, jotta voit esittää sen kulkuna." +"Select a frame to preview it" = "Valitse kehys esikatseltavaksi" +"Select a layer to see its properties and code" = "Valitse taso, jotta näet sen ominaisuudet ja koodin" +"Select all" = "Valitse kaikki" +"Select all with same" = "Valitse kaikki samalla ominaisuudella" +"Select layer" = "Valitse taso" +"Select layers and they space themselves as their content changes" = "Valitse tasoja, niin niiden välit mukautuvat sisällön muuttuessa" +"Select layers to apply the style to" = "Valitse tasot, joihin tyyliä käytetään" +"Select layers with this color" = "Valitse tämänväriset tasot" +"Select overlapping shapes" = "Valitse päällekkäiset muodot" +"Select points to edit their position, radius and mirroring" = "Valitse pisteitä muokataksesi niiden sijaintia, sädettä ja peilausta" +"Select slot" = "Valitse sisältöpaikka" +"Selection" = "Valinta" +"Selection box, {w} by {h} at {x}, {y}: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Valintalaatikko, {w} × {h} kohdassa {x}, {y}: nuolet siirtävät, Shift+nuolet tai {cmd}+nuolet muuttavat kokoa, Enter valitsee, Escape peruuttaa" +"Selection box: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Valintalaatikko: nuolet siirtävät, Shift+nuolet tai {cmd}+nuolet muuttavat kokoa, Enter valitsee, Escape peruuttaa" +"Selection colors" = "Valinnan värit" +"Send backward" = "Vie taaksepäin" +"Send report" = "Lähetä ilmoitus" +"Send to back" = "Vie takimmaiseksi" +"Sep" = "syysk." +"Server address" = "Palvelimen osoite" +"Server address (ws://host:47900/)" = "Palvelimen osoite (ws://host:47900/)" +"Server for online sharing" = "Verkkojakamisen palvelin" +"Set as default" = "Aseta oletukseksi" +"Set variable" = "Aseta muuttuja" +"Set variable mode" = "Aseta muuttujan tila" +"Set variable {name}" = "Aseta muuttuja {name}" +"Set {name} to {value}" = "Aseta {name} arvoon {value}" +"Shadows" = "Varjot" +"Shape" = "Muoto" +"Shape builder" = "Muodonrakennin" +"Shape tools" = "Muototyökalut" +"Share" = "Jaa" +"Share this file" = "Jaa tämä tiedosto" +"Share with a code" = "Jaa koodilla" +"Share: live session, export" = "Jaa: reaaliaikainen istunto, vienti" +"Shared" = "Jaettu" +"Shared: copy its code from the file's menu" = "Jaettu: kopioi koodi tiedoston valikosta" +"Sharing a file needs the desktop app; here you can join one." = "Tiedoston jakaminen vaatii työpöytäsovelluksen. Tässä voit liittyä jaettuun tiedostoon." +"Sharing on the local network (online sharing is off: no server is set in Preferences)." = "Jaetaan lähiverkossa (verkkojakaminen on pois käytöstä: asetuksissa ei ole palvelinta)." +"Sharing on your network · {people}" = "Jaetaan lähiverkossasi · {people}" +"Sharing online · {people}" = "Jaetaan verkossa · {people}" +"Sharing stopped: the file stays on the server, open only to you" = "Jakaminen lopetettu: tiedosto jää palvelimelle vain sinun käyttöösi" +"Show" = "Näytä" +"Show all templates" = "Näytä kaikki mallit" +"Show as grid" = "Näytä ruudukkona" +"Show as list" = "Näytä luettelona" +"Show autosaves" = "Näytä automaattiset tallennukset" +"Show behind transparent areas" = "Näytä läpinäkyvien alueiden takana" +"Show comments (Shift+C)" = "Näytä kommentit (Shift+C)" +"Show device frame" = "Näytä laitteen kehys" +"Show dimensions on objects" = "Näytä objektien mitat" +"Show hotspot hints" = "Näytä aktiivisten kohtien vihjeet" +"Show in Explorer" = "Näytä Resurssienhallinnassa" +"Show in Finder" = "Näytä Finderissa" +"Show in folder" = "Näytä kansiossa" +"Show only this on the canvas" = "Näytä piirtoalueella vain tämä" +"Show open" = "Näytä avoimet" +"Show section contents" = "Näytä osion sisältö" +"Show this layer" = "Näytä tämä taso" +"Show usage" = "Näytä käyttö" +"Show/Hide" = "Näytä/kätke" +"Show/Hide UI" = "Näytä/kätke käyttöliittymä" +"Side by side" = "Vierekkäin" +"Sidebar" = "Sivupalkki" +"Simplify stroke" = "Yksinkertaista reunaviiva" +"Size" = "Koko" +"Size jitter" = "Koon vaihtelu" +"Skip ink" = "Väistä merkkien viivoja" +"Slashed zero" = "Viivallinen nolla" +"Slice" = "Viipale" +"Slices" = "Viipaleet" +"Slide in" = "Liu'u sisään" +"Slide out" = "Liu'u ulos" +"Slot" = "Sisältöpaikka" +"Slot content" = "Sisältöpaikan sisältö" +"Small capitals" = "Kapiteelit" +"Small caps" = "Kapiteelit" +"Smart animate" = "Älykäs animointi" +"Snap to pixel grid" = "Tartu pikseliruudukkoon" +"Social and slides" = "Some ja diat" +"Social media" = "Sosiaalinen media" +"Social post sizes" = "Somejulkaisujen koot" +"Soft light" = "Pehmeä valo" +"Solid" = "Yksivärinen" +"Some variants have the same property values: give each one a unique combination" = "Joillakin varianteilla on samat ominaisuusarvot. Anna kullekin yksilöllinen yhdistelmä." +"Sort" = "Lajittele" +"Sort by" = "Lajitteluperuste" +"Sort by date" = "Lajittele päivämäärän mukaan" +"Sort by page" = "Lajittele sivun mukaan" +"Sort by {column}" = "Lajittele sarakkeen {column} mukaan" +"Space around" = "Tila ympärillä" +"Space between" = "Tila välissä" +"Space drag" = "Space drag" +"Space evenly" = "Tasavälein" +"Space+drag" = "Space+drag" +"Spacing" = "Välistys" +"Spam, stolen work, abuse…" = "Roskaposti, varastettu työ, väärinkäyttö…" +"Splay" = "Harotus" +"Spotlight me" = "Nosta minut esiin" +"Spread" = "Leviäminen" +"Square" = "Neliö" +"Standard" = "Vakio" +"Standard ligatures" = "Tavalliset ligatuurit" +"Star" = "Tähti" +"Stars" = "Tähdet" +"Start" = "Alku" +"Start ascending from / stop descending at" = "Nousevan osan alku / laskevan osan loppu" +"Start from a blank canvas" = "Aloita tyhjältä piirtoalueelta" +"Start from a template" = "Aloita mallista" +"Start on path" = "Aloituskohta polulla" +"Start point" = "Alkupiste" +"Start sharing" = "Aloita jakaminen" +"Start sharing with the Share button, then pass on the code it gives" = "Aloita jakaminen Jaa-painikkeella ja välitä sen antama koodi" +"Starting to share…" = "Aloitetaan jakamista…" +"Status" = "Tila" +"Sticky" = "Kiinnittyvä" +"Stop" = "Pysäytä" +"Stop following {name}" = "Lopeta käyttäjän {name} seuraaminen" +"Stop session" = "Lopeta istunto" +"Stop sharing" = "Lopeta jakaminen" +"Stop spotlighting" = "Lopeta esiin nostaminen" +"Stop {n} {hex}" = "Piste {n} {hex}" +"Stretch" = "Venytys" +"Strikethrough" = "Yliviivaus" +"String" = "Merkkijono" +"Stroke" = "Reunaviiva" +"Stroke style" = "Reunaviivan tyyli" +"Stroke weight" = "Reunaviivan paksuus" +"Strokes" = "Reunaviivat" +"Style" = "Tyyli" +"Styles" = "Tyylit" +"Stylistic set 1" = "Tyylijoukko 1" +"Stylistic set 2" = "Tyylijoukko 2" +"Stylistic set 3" = "Tyylijoukko 3" +"Stylistic set 4" = "Tyylijoukko 4" +"Stylistic set 5" = "Tyylijoukko 5" +"Subtract" = "Vähennä" +"Subtracts" = "Vähentää" +"Suffix" = "Jälkiliite" +"Suspend snapping while dragging" = "Keskeytä tarttuminen vetämisen ajaksi" +"Swap instance" = "Vaihda ilmentymä" +"Swap library: use another library's assets of the same names" = "Vaihda kirjasto: käytä toisen kirjaston samannimisiä resursseja" +"Swap orientation" = "Vaihda suunta" +"Swap overlay" = "Vaihda peittokuva" +"Swap to {name}" = "Vaihda kohteeseen {name}" +"Swap width and height" = "Vaihda leveys ja korkeus keskenään" +"Swapped instance" = "Ilmentymä vaihdettu" +"Swapped {n} assets" = { one = "Vaihdettu {n} resurssi", other = "Vaihdettu {n} resurssia" } +"Swapped {n} assets; {missed} had no match and still use the old library" = { one = "Vaihdettu {n} resurssi; ilman vastinetta jäi {missed}, ja ne käyttävät yhä vanhaa kirjastoa", other = "Vaihdettu {n} resurssia; ilman vastinetta jäi {missed}, ja ne käyttävät yhä vanhaa kirjastoa" } +"Sweep" = "Pyyhkäisy" +"System" = "Järjestelmä" +"Tab / Shift+Tab" = "Tab / Shift+Tab" +"Table" = "Taulukko" +"Tablet" = "Tabletti" +"Tabular numbers" = "Tasalevyiset numerot" +"Take the values from the first selected layer" = "Ota arvot ensimmäisestä valitusta tasosta" +"Taper" = "Kapeneminen" +"Taper both ends" = "Kavenna molemmat päät" +"Tell the server's operator what is wrong with it" = "Kerro palvelimen ylläpitäjälle, mikä siinä on vikana" +"Temperature" = "Lämpötila" +"Template" = "Malli" +"Templates" = "Mallit" +"Terms" = "Ehdot" +"Text" = "Teksti" +"Text align" = "Tekstin tasaus" +"Text content" = "Tekstisisältö" +"Text style" = "Tekstityyli" +"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 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." +"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." = "Tiedosto poistetaan palvelimelta. Kukaan ei voi enää avata sitä tai liittyä siihen sieltä, eikä tätä voi kumota. Avoimet kopiot säilyvät käyttäjillään." +"The file now holds another library" = "Tiedosto sisältää nyt toisen kirjaston" +"The file now holds another library (\"{name}\")" = "Tiedosto sisältää nyt toisen kirjaston (”{name}”)" +"The files you shared or published online from this computer. They stay on their server until you remove them." = "Tältä tietokoneelta verkossa jakamasi tai julkaisemasi tiedostot. Ne säilyvät palvelimellaan, kunnes poistat ne." +"The link carries the session's secret: share it only with people you invite." = "Linkki sisältää istunnon salaisen tunnisteen. Jaa se vain kutsumillesi henkilöille." +"The name in your online files and on the server. The document inside keeps its own name." = "Nimi verkkotiedostoissasi ja palvelimella. Sisällä oleva asiakirja säilyttää oman nimensä." +"The selection uses several text styles: click to apply one" = "Valinta käyttää useita tekstityylejä. Käytä yhtä niistä napsauttamalla." +"The server deletes this file if nobody opens it before {date}." = "Palvelin poistaa tämän tiedoston, ellei kukaan avaa sitä ennen päivää {date}." +"The whole file" = "Koko tiedosto" +"Theme" = "Teema" +"There's no destination for that action" = "Toiminnolla ei ole kohdetta" +"Thickness" = "Paksuus" +"This branch can't be reviewed: {e}" = "Tätä haaraa ei voi tarkistaa: {e}" +"This branch was merged or archived." = "Tämä haara on yhdistetty tai arkistoitu." +"This computer only" = "Vain tämä tietokone" +"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." = "Tämä tietokone muistaa omistajan tunnisteen, joten tiedostoa voi hallita aloitusnäkymän Verkossa-luettelosta. Kopioi tunniste hallitaksesi tiedostoa muualla. Se on tämän tiedoston salasana, eikä sitä näytetä uudelleen." +"This condition is edited as an expression" = "Tätä ehtoa muokataan lausekkeena" +"This file" = "Tämä tiedosto" +"This file has unsaved changes" = "Tässä tiedostossa on tallentamattomia muutoksia" +"This file is on {server}, open only to you. Share it to let others in with a new code." = "Tämä tiedosto on palvelimella {server} vain sinun käytössäsi. Jaa se, jotta muut voivat liittyä uudella koodilla." +"This file uses fonts that aren't installed on this computer. Their text is drawn in a fallback font until you install them." = "Tämä tiedosto käyttää fontteja, joita ei ole asennettu tälle tietokoneelle. Teksti piirretään korvaavalla fontilla, kunnes asennat puuttuvat fontit." +"This frame is new on the branch." = "Tämä kehys on uusi haarassa." +"This frame isn't on the branch." = "Tätä kehystä ei ole haarassa." +"This server is open to the public: no key needed." = "Tämä palvelin on julkinen: avainta ei tarvita." +"This server needs its key: add ?key=… to the address (`figcraft-server key` prints it on the server's machine)." = "Tämä palvelin tarvitsee avaimen. Lisää osoitteeseen ?key=… (`figcraft-server key` tulostaa avaimen palvelimen koneella)." +"This server takes files only with its key: see Advanced." = "Tämä palvelin ottaa tiedostoja vastaan vain avaimellaan. Katso Lisäasetukset." +"Tidy up" = "Järjestä tasavälein" +"Tile" = "Laatoitus" +"Tile type" = "Laatan tyyppi" +"Tint" = "Sävytys" +"Title" = "Otsikko" +"Title case" = "Sanojen isot alkukirjaimet" +"To share this library with your team, publish the file to a server (Share ▸ Publish to server…), then publish the library there." = "Jaa tämä kirjasto tiimillesi julkaisemalla tiedosto palvelimelle (Jaa ▸ Julkaise palvelimelle…) ja julkaisemalla kirjasto siellä." +"Toggle" = "Vaihda tila" +"Toggle light/dark theme" = "Vaihda vaalea/tumma teema" +"Toggle visibility" = "Vaihda näkyvyys" +"Tools" = "Työkalut" +"Top" = "Ylhäältä" +"Top & bottom" = "Ylä- ja alareuna" +"Top left radius" = "Vasemman yläkulman säde" +"Top right radius" = "Oikean yläkulman säde" +"Transform" = "Muunna" +"Triangle arrow" = "Kolmionuoli" +"Trigger" = "Laukaisin" +"True" = "Tosi" +"Truncate text" = "Lyhennä tekstiä" +"Truncate with an ellipsis" = "Lyhennä kolmella pisteellä" +"Try again" = "Yritä uudelleen" +"Try another search or filter." = "Kokeile toista hakua tai suodatinta." +"Try another search, or browse templates." = "Kokeile toista hakua tai selaa malleja." +"Try another word, or look at every kind." = "Kokeile toista sanaa tai katso kaikki tyypit." +"Turn a layer into a component, reuse it, and change every copy at once" = "Muunna taso komponentiksi, käytä sitä uudelleen ja muuta kaikkia kopioita kerralla" +"Two digits" = "Kaksi numeroa" +"Type" = "Teksti" +"Type settings" = "Tekstiasetukset" +"Type the join code you were given, or paste an invite link." = "Kirjoita saamasi liittymiskoodi tai liitä kutsulinkki." +"Typography" = "Typografia" +"Underline" = "Alleviivaus" +"Undo takes back only your own changes; what others changed since stays." = "Kumoaminen peruu vain omat muutoksesi. Muiden sen jälkeen tekemät muutokset säilyvät." +"Ungroup" = "Pura ryhmittely" +"Uniform" = "Tasainen" +"Union" = "Yhdiste" +"Unions" = "Yhdistää" +"Unknown — treated as sRGB" = "Tuntematon — käsitellään sRGB:nä" +"Unread" = "Lukematon" +"Unresolve" = "Merkitse ratkaisemattomaksi" +"Unsaved changes" = "Tallentamattomat muutokset" +"Unsaved changes in {names}. Close the window and lose them?" = "Tallentamattomia muutoksia kohteissa {names}. Suljetaanko ikkuna ja hylätään ne?" +"Unsaved changes: save first ({save}), or close the tab with {alt}-click to discard" = "Tallentamattomia muutoksia: tallenna ensin ({save}) tai hylkää sulkemalla välilehti {alt}-napsautuksella" +"Unsaved changes: save first, or close again with {key} to discard" = "Tallentamattomia muutoksia: tallenna ensin tai hylkää sulkemalla uudelleen näppäimellä {key}" +"Up" = "Ylös" +"Update" = "Päivitä" +"Update from main" = "Päivitä päähaarasta" +"Update from selection" = "Päivitä valinnasta" +"Update plugin" = "Päivitä liitännäinen" +"Updated {components} and {styles}" = "Päivitetty {components} ja {styles}" +"Updated {name}" = "Päivitetty: {name}" +"Updating the graphics driver often helps. To use OpenGL only, start FigCraft from a Command Prompt with:" = "Näytönohjainajurin päivittäminen auttaa usein. Käytä vain OpenGL:ää käynnistämällä FigCraft komentokehotteesta näin:" +"Updating the graphics driver often helps. WGPU_BACKEND (vulkan, gl, metal) names another graphics API to try." = "Näytönohjainajurin päivittäminen auttaa usein. WGPU_BACKEND (vulkan, gl, metal) määrittää toisen kokeiltavan grafiikkarajapinnan." +"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." = "Lataa tämän tiedoston FigCraft-palvelimelle ja pitää tämän välilehden synkronoituna sen kanssa. Saat muokkauslinkin ja katselulinkin." +"Uppercase" = "Isot kirjaimet" +"Use a fixed value" = "Käytä kiinteää arvoa" +"Use an expression, e.g. count + 1" = "Käytä lauseketta, esim. count + 1" +"Use as mask" = "Käytä maskina" +"Use auto layout" = "Käytä automaattista asettelua" +"Use number keys for opacity" = "Säädä peittävyyttä numeronäppäimillä" +"Use the .figcraft or .fig extension." = "Käytä .figcraft- tai .fig-tiedostopäätettä." +"Use the layer's fill" = "Käytä tason täyttöä" +"Used in {files} · {instances}" = "Käytössä tiedostoissa {files} · {instances}" +"Username" = "Käyttäjänimi" +"Uses variables: each layer shows them in its own mode" = "Käyttää muuttujia: kukin taso näyttää ne omassa tilassaan" +"Value" = "Arvo" +"Variable" = "Muuttuja" +"Variable collections" = "Muuttujakokoelmat" +"Variable modes" = "Muuttujatilat" +"Variable width" = "Vaihteleva leveys" +"Variables" = "Muuttujat" +"Variables JSON…" = "Muuttujat JSON…" +"Variables store reusable values (colours, numbers, strings, booleans) with modes such as Light and Dark." = "Muuttujat tallentavat uudelleenkäytettäviä arvoja (värejä, lukuja, merkkijonoja ja totuusarvoja). Niillä voi olla tiloja, kuten vaalea ja tumma." +"Variant" = "Variantti" +"Vector" = "Vektori" +"Vectors" = "Vektorit" +"Version" = "Versio" +"Version history" = "Versiohistoria" +"Version {version}" = "Versio {version}" +"Version {v} · {components} · {styles} · {variables}" = "Versio {v} · {components} · {styles} · {variables}" +"Vertical" = "Pystysuunta" +"Vertical align" = "Pystytasaus" +"Vertical hex" = "Pystysuuntainen kuusikulmio" +"Vertical padding" = "Pystysuuntainen sisämarginaali" +"Vertical spacing" = "Pystyvälistys" +"Vertical trim" = "Pystysuuntainen rajaus" +"View" = "Näytä" +"View link" = "Katselulinkki" +"View link copied" = "Katselulinkki kopioitu" +"View only" = "Vain katselu" +"View only: you see every change as it happens but can't edit. Leave to keep a copy you can edit." = "Vain katselu: näet kaikki muutokset reaaliajassa, mutta et voi muokata. Poistu säilyttääksesi muokattavan kopion." +"Viewing “{name}”" = "Katsellaan tiedostoa ”{name}”" +"Violet" = "Violetti" +"Visibility" = "Näkyvyys" +"Visible" = "Näkyvä" +"Vivid" = "Kirkas" +"WGPU_BACKEND is set and names the graphics API to use; unsetting it lets FigCraft choose." = "WGPU_BACKEND on asetettu ja määrittää käytettävän grafiikkarajapinnan. Poista se käytöstä, jotta FigCraft voi valita." +"Warm" = "Lämmin" +"Watch" = "Seuraa" +"Wavy" = "Aaltoileva" +"Web" = "Verkko" +"WebSocket URL" = "WebSocket-URL" +"WebSocket URL copied" = "WebSocket-URL kopioitu" +"Websites" = "Verkkosivustot" +"Wedge" = "Kiila" +"Weight" = "Paksuus" +"What changed since it was marked ready for dev" = "Muutokset kehitysvalmiiksi merkitsemisen jälkeen" +"What is wrong with this file? The server's operator gets your report." = "Mikä tässä tiedostossa on vikana? Palvelimen ylläpitäjä saa ilmoituksesi." +"What it's for" = "Käyttötarkoitus" +"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." = "Aiempi tila ei ole tiedossa: muutos tehtiin ennen kuin FigCraft tallensi kopioita kehitysvalmiista kehyksistä. Ratkaise muutos tai merkitse kehys uudelleen valmiiksi, jotta jatkossa vertailu onnistuu." +"What you try here changes this preview and the code below, not the file" = "Tässä kokeilemasi asiat muuttavat esikatselua ja alla olevaa koodia, eivät tiedostoa" +"While hovering" = "Osoitettaessa" +"While pressing" = "Painettaessa" +"White" = "Valkoinen" +"Who runs it, its terms and how long it keeps files" = "Ylläpitäjä, käyttöehdot ja tiedostojen säilytysaika" +"Why it changed" = "Muutoksen syy" +"Widget" = "Pienoisohjelma" +"Widgets" = "Pienoisohjelmat" +"Width" = "Leveys" +"Width point" = "Leveyspiste" +"Width profile" = "Leveysprofiili" +"Wireframe kit" = "Rautalankapaketti" +"With the layers' export settings" = "Tasojen vientiasetuksilla" +"Wrap" = "Rivitys" +"Wrap in new section" = "Ympäröi uudella osiolla" +"Yellow" = "Keltainen" +"Yesterday" = "Eilen" +"You" = "Sinä" +"You'll get the shared file as a new tab and edit it together." = "Jaettu tiedosto avautuu uuteen välilehteen, ja voitte muokata sitä yhdessä." +"You're spotlighting: everyone follows your view" = "Olet esillä: kaikki seuraavat näkymääsi" +"Your copy of the file stays open" = "Oma kopiosi tiedostosta pysyy auki" +"Your copy stays open; the file stays on the server" = "Oma kopiosi pysyy auki, ja tiedosto jää palvelimelle" +"Your name" = "Nimesi" +"Your name in comments" = "Nimesi kommenteissa" +"Your system asks for reduced motion: animations stay off." = "Järjestelmäsi pyytää vähennettyä liikettä. Animaatiot pidetään pois käytöstä." +"Z" = "Z" +"Z to A" = "Z:sta A:han" +"Zoom" = "Zoomaus" +"Zoom around the pointer" = "Zoomaa osoittimen ympärillä" +"Zoom device to fill window" = "Zoomaa laite ikkunan kokoiseksi" +"Zoom in" = "Lähennä" +"Zoom out" = "Loitonna" +"Zoom to 100%" = "Zoomaa kokoon 100 %" +"Zoom to 200%" = "Zoomaa kokoon 200 %" +"Zoom to 50%" = "Zoomaa kokoon 50 %" +"Zoom to fit" = "Sovita näkymään" +"Zoom to selection" = "Zoomaa valintaan" +"Zoom tool: click to zoom in, drag an area" = "Zoomaustyökalu: lähennä napsauttamalla tai vedä alue" +"Zoom tool: zoom out" = "Zoomaustyökalu: loitonna" +"and {n} more" = { one = "ja vielä {n}", other = "ja vielä {n}" } +"bleed marks" = "leikkuuvaramerkit" +"by {author}" = "tekijä: {author}" +"call any command its access allows" = "kutsua kaikkia käyttöoikeuksiensa sallimia komentoja" +"call only: {commands}" = "kutsua vain: {commands}" +"can edit the document" = "voi muokata asiakirjaa" +"conditional prototype actions nested too deeply were skipped" = "liian syvälle sisäkkäiset ehdolliset prototyyppitoiminnot ohitettiin" +"conditional prototype actions with conditions that can't be evaluated were skipped" = "ehdolliset prototyyppitoiminnot ohitettiin, koska niiden ehtoja ei voi laskea" +"connector label background was skipped: style data is missing" = "yhdistimen tekstin tausta ohitettiin: tyylitiedot puuttuvat" +"connector label was skipped: background bounds are invalid" = "yhdistimen teksti ohitettiin: taustan rajat ovat virheelliset" +"connector label was skipped: background transform is invalid" = "yhdistimen teksti ohitettiin: taustan muunnos on virheellinen" +"connector label was skipped: composed text transform is invalid" = "yhdistimen teksti ohitettiin: yhdistetty tekstimuunnos on virheellinen" +"connector label was skipped: derived background bounds are missing" = "yhdistimen teksti ohitettiin: johdetut taustan rajat puuttuvat" +"connector label was skipped: derived text bounds are missing" = "yhdistimen teksti ohitettiin: johdetut tekstin rajat puuttuvat" +"connector label was skipped: text bounds are invalid" = "yhdistimen teksti ohitettiin: tekstin rajat ovat virheelliset" +"connector label was skipped: text style data is missing" = "yhdistimen teksti ohitettiin: tekstin tyylitiedot puuttuvat" +"connector label was skipped: text transform is invalid" = "yhdistimen teksti ohitettiin: tekstin muunnos on virheellinen" +"connector labels were skipped" = "yhdistimien tekstit ohitettiin" +"connector layers import as static frame/vector snapshots with labels when present; live endpoint bindings are not retained" = "yhdistintasot tuodaan staattisina kehys- ja vektorikuvina mahdollisine teksteineen; päiden reaaliaikaisia sidoksia ei säilytetä" +"connector snapshot vector data is missing; connector was left empty" = "yhdistimen vektorikuvatiedot puuttuvat; yhdistin jätettiin tyhjäksi" +"connectors whose ends can't be placed are empty" = "yhdistimet, joiden päitä ei voi sijoittaa, ovat tyhjiä" +"crop marks" = "leikkausmerkit" +"damaged vector geometry was skipped" = "vaurioitunut vektorigeometria ohitettiin" +"damaged vector networks import as outlines" = "vaurioituneet vektoriverkot tuodaan ääriviivoina" +"development: {path}" = "kehitys: {path}" +"document children other than pages were skipped" = "asiakirjan muut kuin sivuina olevat alikohteet ohitettiin" +"duplicate grid track sizing entries use equal tracks" = "päällekkäiset ruudukon kokomääritykset käyttävät tasakokoisia osia" +"e.g. count + 1" = "esim. count + 1" +"e.g. count >= 3 and not done" = "esim. count >= 3 and not done" +"elbowed and curved connectors without a saved path import as straight lines" = "mutkaiset ja kaarevat yhdistimet, joilla ei ole tallennettua polkua, tuodaan suorina viivoina" +"entries without a node type were skipped" = "kohteet, joilta puuttuu solmutyyppi, ohitettiin" +"figcraft:// links from a browser, chat or email open this app and join the session." = "selaimen, keskustelun tai sähköpostin figcraft://-linkit avaavat tämän sovelluksen ja liittyvät istuntoon." +"filled areas of a vector with their own fill use the layer's fill" = "vektorin omalla täytöllä määritetyt alueet käyttävät tason täyttöä" +"from {server}" = "palvelimelta {server}" +"gamepad triggers without exactly one known controller button were skipped" = "peliohjainlaukaisimet, joilla ei ole täsmälleen yhtä tunnettua ohjainpainiketta, ohitettiin" +"grid track list exceeds 1000 entries; the tracks use the default equal sizing" = "ruudukon osien luettelo ylittää 1000 kohdetta; osat käyttävät oletuksen mukaista tasakokoa" +"grid track sizing is unsupported or malformed; affected tracks use equal sizing" = "ruudukon kokomääritys on virheellinen tai sitä ei tueta; kyseiset osat käyttävät tasakokoa" +"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "ruudukon kokomääritysten luettelo ylittää 1000 kohdetta; osat käyttävät oletuksen mukaista tasakokoa" +"hidden" = "kätketty" +"iOS" = "iOS" +"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "kuvasuotimet ovat monitulkintaisia, koska molemmat suodinsäilöt ovat läsnä; suotimien muunnos ohitettiin" +"image filters use FigCraft's approximate renderer" = "kuvasuotimet käyttävät FigCraftin likimääräistä renderöijää" +"instance swap properties whose default component isn't in the file were skipped" = "ilmentymän vaihto-ominaisuudet ohitettiin, koska niiden oletuskomponenttia ei ole tiedostossa" +"instances inside their own main component were imported as frames" = "oman pääkomponenttinsa sisällä olevat ilmentymät tuotiin kehyksinä" +"instances of components that aren't in the file show no layers" = "tiedostosta puuttuvien komponenttien ilmentymät eivät näytä tasoja" +"instances of components that aren't in the file were imported as frames" = "tiedostosta puuttuvien komponenttien ilmentymät tuotiin kehyksinä" +"instances that would nest a component inside itself were imported as frames" = "ilmentymät, jotka sijoittaisivat komponentin itsensä sisään, tuotiin kehyksinä" +"instances without a main component were imported as empty frames" = "ilmentymät, joilta puuttuu pääkomponentti, tuotiin tyhjinä kehyksinä" +"invalid internal .fig text path data was ignored" = "virheelliset sisäiset .fig-tekstipolun tiedot ohitettiin" +"invalid or oversized vector networks import as outlines" = "virheelliset tai liian suuret vektoriverkot tuodaan ääriviivoina" +"invalid or oversized vector path data was skipped" = "virheelliset tai liian suuret vektoripolun tiedot ohitettiin" +"just now" = "juuri nyt" +"key triggers without a supported key were skipped" = "näppäinlaukaisimet, joilla ei ole tuettua näppäintä, ohitettiin" +"key up triggers import as key presses" = "näppäimen vapautuslaukaisimet tuodaan näppäimen painalluksina" +"layers without a position were placed at their parent's origin" = "tasot, joilta puuttuu sijainti, sijoitettiin emotasonsa origoon" +"layers without a type were skipped" = "tasot, joilta puuttuu tyyppi, ohitettiin" +"legacy image filter container is unsupported; filter conversion was skipped" = "vanhaa kuvasuodinsäilöä ei tueta; suotimien muunnos ohitettiin" +"locked" = "lukittu" +"malformed image filters container was skipped" = "virheellinen image filters -säilö ohitettiin" +"malformed image paintFilter container was skipped" = "virheellinen image paintFilter -säilö ohitettiin" +"malformed slot content assignment was skipped" = "virheellinen sisältöpaikan sisällön määritys ohitettiin" +"no bleed" = "ei leikkuuvaraa" +"nobody else here yet" = "kukaan muu ei ole vielä paikalla" +"non-default slot settings are not represented and were skipped" = "oletuksesta poikkeavia sisältöpaikan asetuksia ei esitetä, ja ne ohitettiin" +"now" = "nyt" +"only in a text style or variable" = "vain tekstityylissä tai muuttujassa" +"or" = "tai" +"point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "pisteiden viivaliitokset säilytettiin; katko- ja vaihtelevanlevyiset viivat käyttävät tason liitostyyliä" +"preferred slot component keys cannot be resolved to file nodes and were skipped" = "sisältöpaikan ensisijaisten komponenttien avaimia ei voitu yhdistää tiedoston solmuihin, ja ne ohitettiin" +"prototype actions of unknown types were skipped" = "tuntemattoman tyyppiset prototyyppitoiminnot ohitettiin" +"prototype actions without a destination in the file were skipped" = "prototyyppitoiminnot, joiden kohdetta ei ole tiedostossa, ohitettiin" +"prototype expressions on variables that aren't in the variables JSON were skipped" = "muuttujiin viittaavat prototyyppilausekkeet ohitettiin, koska muuttujia ei ole muuttujien JSON-tiedostossa" +"prototype expressions with unsupported functions were skipped" = "prototyyppilausekkeet, joissa on tukemattomia funktioita, ohitettiin" +"prototype interactions without supported actions were skipped" = "prototyypin vuorovaikutukset, joissa ei ole tuettuja toimintoja, ohitettiin" +"prototype navigations of unknown types were skipped" = "tuntemattoman tyyppiset prototyypin siirtymät kohteeseen ohitettiin" +"prototype transitions of unknown types play instantly" = "tuntemattoman tyyppiset prototyypin siirtymäanimaatiot toistuvat välittömästi" +"prototype triggers of unknown types were skipped" = "tuntemattoman tyyppiset prototyypin laukaisimet ohitettiin" +"put a widget on the canvas" = "lisätä pienoisohjelman piirtoalueelle" +"read and edit the document" = "lukea ja muokata asiakirjaa" +"read the document" = "lukea asiakirjan" +"reads the document" = "lukee asiakirjan" +"set-variable actions on variables that aren't in the variables JSON were skipped" = "muuttujan asetustoiminnot ohitettiin, koska muuttujia ei ole muuttujien JSON-tiedostossa" +"set-variable actions with values that can't be evaluated were skipped" = "muuttujan asetustoiminnot ohitettiin, koska arvoja ei voi laskea" +"set-variable actions with values that don't fit the variable were skipped" = "muuttujan asetustoiminnot ohitettiin, koska arvot eivät sovi muuttujaan" +"set-variable actions without a value were skipped" = "muuttujan asetustoiminnot, joilta puuttuu arvo, ohitettiin" +"set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "muuttujatilan asetustoiminnot ohitettiin, koska kokoelmia tai tiloja ei ole muuttujien JSON-tiedostossa" +"slot content assignment target is missing or is not slot content" = "sisältöpaikan määrityksen kohde puuttuu tai ei ole sisältöpaikan sisältöä" +"slot content assignment uses the empty GUID sentinel and was skipped" = "sisältöpaikan määritys käyttää tyhjää GUID-erikoisarvoa, ja se ohitettiin" +"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "jotkin vektoripisteet viittaavat tiedostosta puuttuviin pisteasetuksiin; ne käyttävät tason liitostyyliä ja tavallisia kulmia" +"some vector segments refer to style settings missing from the file; they use the layer's stroke" = "jotkin vektorisegmentit viittaavat tiedostosta puuttuviin tyyliasetuksiin; ne käyttävät tason reunaviivaa" +"stale or invalid grid track sizing entries were ignored" = "vanhentuneet tai virheelliset ruudukon kokomääritykset ohitettiin" +"stars and polygons without point counts or geometry use the default point count" = "tähdet ja monikulmiot, joilta puuttuu pistemäärä tai geometria, käyttävät oletuspistemäärää" +"style settings of some vector segments aren't supported; those segments use the layer's stroke" = "joidenkin vektorisegmenttien tyyliasetuksia ei tueta; nämä segmentit käyttävät tason reunaviivaa" +"text path underline or strikethrough decoration is not rendered" = "tekstipolun alleviivausta tai yliviivausta ei renderöidä" +"text style overrides refer to missing table entries" = "tekstityylin ohitukset viittaavat puuttuviin taulukkokohteisiin" +"the file has no pages" = "tiedostossa ei ole sivuja" +"the plugin" = "liitännäinen" +"the variables JSON has no `variableCollections` (expected the local variables response) and was ignored" = "muuttujien JSON-tiedostosta puuttuu `variableCollections` (odotettiin paikallisten muuttujien vastausta), ja tiedosto ohitettiin" +"this session only" = "vain tämä istunto" +"unknown component property types were skipped" = "tuntemattoman tyyppiset komponenttiominaisuudet ohitettiin" +"variable aliases to variables that aren't in the variables JSON (or of another type) were skipped" = "muuttuja-aliakset ohitettiin, koska kohdemuuttujia ei ole muuttujien JSON-tiedostossa tai ne ovat eri tyyppiä" +"variable bindings to properties the layer doesn't have were skipped" = "muuttujasidokset ominaisuuksiin, joita tasolla ei ole, ohitettiin" +"variable bindings to variables that aren't in the variables JSON (library variables) were skipped" = "muuttujasidokset muuttujiin, joita ei ole muuttujien JSON-tiedostossa (kirjastomuuttujat), ohitettiin" +"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)" = "muuttujasidokset ohitettiin: tiedoston JSON ei määritä muuttujia (anna paikallisten muuttujien JSON arvona `variables` tai sisällytä sen `meta` tiedoston JSONin viereen)" +"variable bindings whose variable type doesn't fit the property were skipped" = "muuttujasidokset, joiden muuttujatyyppi ei sovi ominaisuuteen, ohitettiin" +"variable collections without modes were skipped" = "muuttujakokoelmat, joilla ei ole tiloja, ohitettiin" +"variable mode lookups in prototype expressions that aren't a variable and one of its modes were skipped" = "prototyyppilausekkeiden muuttujatilahaut, jotka eivät ole muuttuja ja jokin sen tiloista, ohitettiin" +"variable modes of collections that aren't in the file were skipped" = "tiedostosta puuttuvien kokoelmien muuttujatilat ohitettiin" +"variable modes of collections that aren't in the variables JSON were skipped" = "muuttujien JSON-tiedostosta puuttuvien kokoelmien muuttujatilat ohitettiin" +"variable values that don't match their type (or composed colours) were skipped" = "muuttujien arvot, jotka eivät vastaa tyyppiään (tai yhdistettyjä värejä), ohitettiin" +"variables of unknown types were skipped" = "tuntemattoman tyyppiset muuttujat ohitettiin" +"variables whose collection isn't in the variables JSON were skipped" = "muuttujat, joiden kokoelmaa ei ole muuttujien JSON-tiedostossa, ohitettiin" +"variables without readable values were skipped" = "muuttujat, joiden arvoja ei voi lukea, ohitettiin" +"vector points with unknown stroke joins use the layer join" = "vektoripisteet, joilla on tuntematon liitostyyli, käyttävät tason liitostyyliä" +"vectors without geometry are empty" = "vektorit ilman geometriaa ovat tyhjiä" +"vectors without geometry are empty (export the file JSON with geometry=paths)" = "vektorit ilman geometriaa ovat tyhjiä (vie tiedoston JSON asetuksella geometry=paths)" +"very long text was cut to 1,048,576 characters" = "erittäin pitkä teksti katkaistiin 1 048 576 merkkiin" +"very long vector paths were skipped" = "erittäin pitkät vektoripolut ohitettiin" +"video actions are not supported and were skipped" = "videotoimintoja ei tueta, ja ne ohitettiin" +"video triggers are not supported and were skipped" = "videolaukaisimia ei tueta, ja ne ohitettiin" +"yesterday" = "eilen" +"{instances} in {files}" = "{instances} tiedostoissa {files}" +"{language}: draft translation, waiting for a native speaker's review." = "{language}: käännösluonnos, joka odottaa äidinkielisen puhujan tarkistusta." +"{length} bleed" = "Leikkuuvara {length}" +"{month} {day}, {year}" = "{day}. {month} {year}" +"{name}\nClick to apply to the selection" = "{name}\nKäytä valintaan napsauttamalla" +"{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}\nVedä piirtoalueelle tai sijoita näkymän keskelle napsauttamalla.\nVaihda ilmentymä pudottamalla sen päälle Alt (Option) painettuna." +"{name} (from {library})" = "{name} (kirjastosta {library})" +"{name} (you)" = "{name} (sinä)" +"{name} ({layers} layers)" = "{name} (tasoja: {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}, oletus {default}. Palauta tyylin arvo kaksoisnapsauttamalla liukusäädintä. Escape peruuttaa vetämisen." +"{name} cleared from the list" = "{name} poistettu luettelosta" +"{name} from {path}" = "{name} polusta {path}" +"{name} is forgotten on this computer; the file stays on {server}" = "{name} on unohdettu tällä tietokoneella. Tiedosto jää palvelimelle {server}." +"{name} is on the server." = "{name} on palvelimella." +"{name} is spotlighting" = "{name} nostaa näkymäänsä esiin" +"{name} was removed from the server" = "{name} poistettiin palvelimelta" +"{name} · deleted on main" = "{name} · poistettu päähaarassa" +"{name} · deleted on the branch" = "{name} · poistettu haarassa" +"{name} · not published" = "{name} · ei julkaistu" +"{name} · on a server" = "{name} · palvelimella" +"{name} · published version {v}" = "{name} · julkaistu versio {v}" +"{name} · version {v} on the server" = "{name} · versio {v} palvelimella" +"{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" +"{n} added" = { one = "Lisätty: {n}", other = "Lisätty: {n}" } +"{n} autosave versions" = { one = "{n} automaattisesti tallennettu versio", other = "{n} automaattisesti tallennettua versiota" } +"{n} changed" = { one = "Muutettu: {n}", other = "Muutettu: {n}" } +"{n} columns" = { one = "{n} sarake", other = "{n} saraketta" } +"{n} components" = { one = "{n} komponentti", other = "{n} komponenttia" } +"{n} components and styles have newer versions" = { one = "Uudempi versio saatavilla: {n} komponentti tai tyyli", other = "Uudempia versioita saatavilla: {n} komponenttia ja tyyliä" } +"{n} conflicts to resolve" = { one = "{n} ratkaistava ristiriita", other = "{n} ratkaistavaa ristiriitaa" } +"{n} days ago" = { one = "{n} päivä sitten", other = "{n} päivää sitten" } +"{n} files" = { one = "{n} tiedosto", other = "{n} tiedostoa" } +"{n} hours ago" = { one = "{n} tunti sitten", other = "{n} tuntia sitten" } +"{n} instances" = { one = "{n} ilmentymä", other = "{n} ilmentymää" } +"{n} layers" = { one = "{n} taso", other = "{n} tasoa" } +"{n} layers as one file" = { one = "{n} taso yhtenä tiedostona", other = "{n} tasoa yhtenä tiedostona" } +"{n} layers selected" = { one = "{n} taso valittu", other = "{n} tasoa valittu" } +"{n} layers · {parts}" = { one = "{n} taso · {parts}", other = "{n} tasoa · {parts}" } +"{n} matches" = { one = "{n} osuma", other = "{n} osumaa" } +"{n} minutes ago" = { one = "{n} minuutti sitten", other = "{n} minuuttia sitten" } +"{n} months ago" = { one = "{n} kuukausi sitten", other = "{n} kuukautta sitten" } +"{n} more notes omitted from this report" = { one = "Tästä raportista on jätetty pois vielä {n} huomautus", other = "Tästä raportista on jätetty pois vielä {n} huomautusta" } +"{n} of {total}" = "{n} / {total}" +"{n} people joined" = { one = "{n} henkilö liittyi", other = "{n} henkilöä liittyi" } +"{n} preferred components" = { one = "{n} ensisijainen komponentti", other = "{n} ensisijaista komponenttia" } +"{n} ready" = { one = "{n} valmis", other = "{n} valmista" } +"{n} removed" = { one = "Poistettu: {n}", other = "Poistettu: {n}" } +"{n} replies" = { one = "{n} vastaus", other = "{n} vastausta" } +"{n} rows" = { one = "{n} rivi", other = "{n} riviä" } +"{n} styles" = { one = "{n} tyyli", other = "{n} tyyliä" } +"{n} text layers" = { one = "{n} tekstitaso", other = "{n} tekstitasoa" } +"{n} variables" = { one = "{n} muuttuja", other = "{n} muuttujaa" } +"{n} weeks ago" = { one = "{n} viikko sitten", other = "{n} viikkoa sitten" } +"{n} years ago" = { one = "{n} vuosi sitten", other = "{n} vuotta sitten" } +"{n}d" = "{n}pv" +"{n}h" = "{n}t" +"{n}m" = "{n}min" +"{n}w" = "{n}vk" +"{page}, nothing selected" = "{page}, ei valintaa" +"{profile} (current)" = "{profile} (nykyinen)" +"{property} is its value; {property ? \"a\" : \"b\"} picks a string. Other {…} stays as written." = "{property} on sen arvo. {property ? \"a\" : \"b\"} valitsee merkkijonon. Muut {…}-ilmaukset säilyvät sellaisinaan." +"{server} can't say what became of your files (it is older than this app)." = "{server} ei pysty kertomaan tiedostojesi tilaa (se on tätä sovellusta vanhempi)." +"{server} · No longer on the server" = "{server} · Ei enää palvelimella" +"{server} · {shared} · Opened {date}" = "{server} · {shared} · Avattu {date}" +"{tool} hold {key}" = "{tool} pidä {key} painettuna" +"{value} isn't a colour" = "{value} ei ole väri" +"{when} · edited" = "{when} · muokattu" +"←" = "←" +"← ↑ → ↓" = "← ↑ → ↓" +"← → ↑ ↓" = "← → ↑ ↓" +"→, Space or N" = "→, Space or N" +"↵" = "↵" +"⇥ / ⇧⇥" = "⇥ / ⇧⇥" +"⌘ arrows" = "⌘ arrows" +"⌘ click" = "⌘ click" +"⌘ scroll" = "⌘ scroll" +"⌥ drag" = "⌥ drag" + +[commands] +"align.bottom" = "Tasaa alas" +"align.hcenter" = "Keskitä vaakasuunnassa" +"align.left" = "Tasaa vasemmalle" +"align.right" = "Tasaa oikealle" +"align.top" = "Tasaa ylös" +"align.vcenter" = "Keskitä pystysuunnassa" +"annotation.add" = "Lisää huomautus" +"annotation.addCategory" = "Lisää huomautusluokka" +"annotation.categories" = "Huomautusten luokat" +"annotation.edit" = "Muokkaa huomautusta" +"annotation.editCategory" = "Muokkaa huomautusluokkaa" +"annotation.list" = "Luettele huomautukset" +"annotation.remove" = "Poista huomautus" +"annotation.removeCategory" = "Poista huomautusluokka" +"app.actions" = "Toiminnot" +"app.preferences" = "Asetukset" +"arrange.back" = "Vie takimmaiseksi" +"arrange.backward" = "Vie taaksepäin" +"arrange.forward" = "Tuo eteenpäin" +"arrange.front" = "Tuo etummaiseksi" +"arrange.packH" = "Pakkaa vaakasuunnassa" +"arrange.packV" = "Pakkaa pystysuunnassa" +"arrange.roundToPixels" = "Pyöristä pikseleihin" +"arrange.spacing" = "Välistys" +"arrange.tidy" = "Järjestä tasavälein" +"bool.exclude" = "Sulje valinnan päällekkäinen alue pois" +"bool.flatten" = "Yhdistä Boolen muoto vektoriksi" +"bool.intersect" = "Leikkaa valinnan yhteinen alue" +"bool.subtract" = "Vähennä valinta" +"bool.union" = "Yhdistä valinta" +"branch.archive" = "Arkistoi haara" +"branch.create" = "Luo haara" +"branch.list" = "Luettele haarat" +"branch.merge" = "Yhdistä haara" +"branch.open" = "Avaa haara" +"branch.review" = "Tarkista haara" +"branch.updateFromMain" = "Päivitä päähaarasta" +"codeConnect.export" = "Vie koodiyhteydet" +"codeConnect.import" = "Tuo koodiyhteydet" +"codeConnect.remove" = "Katkaise yhteys koodiin" +"codeConnect.set" = "Yhdistä koodiin" +"collab.cursor" = "Näytä kohdistin kohdassa" +"collab.cursorChat" = "Kohdistinkeskustelu" +"collab.diff" = "Näytä synkronoinnin muutokset" +"collab.files" = "Omat verkkotiedostot" +"collab.follow" = "Seuraa" +"collab.forgetFile" = "Unohda verkkotiedosto" +"collab.host" = "Aloita reaaliaikainen istunto" +"collab.join" = "Liity reaaliaikaiseen istuntoon" +"collab.leave" = "Poistu reaaliaikaisesta istunnosta" +"collab.manageFile" = "Hallitse julkaistua tiedostoa" +"collab.openFile" = "Avaa verkkotiedosto" +"collab.peers" = "Tämän tiedoston käyttäjät" +"collab.publish" = "Julkaise palvelimelle" +"collab.recoverFile" = "Palauta verkkotiedosto" +"collab.registerLinks" = "Avaa kutsulinkit FigCraftissa" +"collab.removePerson" = "Poista istunnosta" +"collab.report" = "Ilmoita tiedostosta palvelimen ylläpitäjälle" +"collab.serverInfo" = "Palvelimen tiedot" +"collab.share" = "Jaa liittymiskoodilla" +"collab.spotlight" = "Nosta minut esiin" +"collab.stop" = "Lopeta reaaliaikainen istunto" +"command.batch" = "Suorita useita komentoja" +"comment.add" = "Lisää kommentti" +"comment.delete" = "Poista kommentti" +"comment.edit" = "Muokkaa kommenttia" +"comment.link" = "Kopioi linkki kommenttiin" +"comment.list" = "Luettele kommentit" +"comment.markRead" = "Merkitse kommentti luetuksi" +"comment.move" = "Siirrä kommentti" +"comment.next" = "Seuraava kommentti" +"comment.open" = "Avaa kommentti" +"comment.people" = "Kommenttien osallistujat" +"comment.react" = "Reagoi kommenttiin" +"comment.reply" = "Vastaa kommenttiin" +"comment.resolve" = "Ratkaise kommentti" +"comment.zoom" = "Zoomaa kommentteihin" +"component.addProperty" = "Lisää komponentin ominaisuus" +"component.addVariant" = "Lisää variantti" +"component.bindProperty" = "Sido taso ominaisuuteen" +"component.combineVariants" = "Yhdistä varianteiksi" +"component.create" = "Luo komponentti" +"component.createMultiple" = "Luo useita komponentteja" +"component.deleteProperty" = "Poista komponentin ominaisuus" +"component.detach" = "Irrota ilmentymä" +"component.editProperty" = "Muokkaa komponentin ominaisuutta" +"component.exposeInstance" = "Tuo sisäkkäinen ilmentymä käyttöön" +"component.goToMain" = "Siirry pääkomponenttiin" +"component.hideWhenPublishing" = "Kätke julkaistaessa" +"component.list" = "Luettele komponentit" +"component.makeSlot" = "Luo sisältöpaikka" +"component.playground" = "Komponenttien kokeilualue" +"component.properties" = "Komponentin ominaisuudet" +"component.pushChanges" = "Siirrä muutokset pääkomponenttiin" +"component.removeSlot" = "Poista sisältöpaikka" +"component.resetInstance" = "Palauta kaikki muutokset" +"component.resetOverride" = "Palauta ohitus" +"component.restoreMain" = "Palauta pääkomponentti" +"dev.compare" = "Vertaa muutoksia" +"dev.focus" = "Kohdistusnäkymä" +"dev.resolveChange" = "Ratkaise muutos" +"dev.unfocus" = "Poistu kohdistusnäkymästä" +"devResource.add" = "Lisää kehittäjäresurssi" +"devResource.edit" = "Muokkaa kehittäjäresurssia" +"devResource.list" = "Luettele kehittäjäresurssit" +"devResource.remove" = "Poista kehittäjäresurssi" +"distribute.horizontal" = "Jaa vaakavälit tasan" +"distribute.vertical" = "Jaa pystyvälit tasan" +"doc.home" = "Aloitus" +"doc.list" = "Luettele asiakirjat" +"doc.nextTab" = "Seuraava välilehti" +"doc.previousTab" = "Edellinen välilehti" +"doc.switch" = "Vaihda asiakirjaa" +"edit.copy" = "Kopioi" +"edit.copyAsCss" = "Kopioi CSS-muodossa" +"edit.copyAsPng" = "Kopioi PNG-muodossa" +"edit.copyAsSvg" = "Kopioi SVG-muodossa" +"edit.copyAsText" = "Kopioi tekstinä" +"edit.copyLink" = "Kopioi linkki valintaan" +"edit.copyProperties" = "Kopioi ominaisuudet" +"edit.cut" = "Leikkaa" +"edit.delete" = "Poista" +"edit.duplicate" = "Monista" +"edit.findReplace" = "Etsi ja korvaa" +"edit.paste" = "Liitä" +"edit.pasteDesignLayers" = "Liitä suunnittelutasoja" +"edit.pasteOver" = "Liitä valinnan päälle" +"edit.pasteProperties" = "Liitä ominaisuudet" +"edit.pasteReplace" = "Liitä korvaten" +"edit.pickColor" = "Poimi väri" +"edit.redo" = "Tee uudelleen" +"edit.repeat" = "Toista viimeisin komento" +"edit.setDefaultProperties" = "Aseta oletusominaisuudet" +"edit.undo" = "Kumoa" +"effect.add" = "Lisää tehoste" +"effect.move" = "Siirrä tehoste" +"effect.remove" = "Poista tehoste" +"effect.set" = "Aseta tehoste" +"export.add" = "Lisää vientiasetus" +"export.remove" = "Poista vientiasetus" +"export.update" = "Muokkaa vientiasetusta" +"file.close" = "Sulje välilehti" +"file.colorProfile" = "Väriprofiili" +"file.duplicate" = "Monista tiedosto" +"file.export" = "Vie" +"file.exportFramesPdf" = "Vie kehykset PDF-muodossa" +"file.exportLayers" = "Vie tasot" +"file.exportSvg" = "Vie valinta SVG-muodossa" +"file.import" = "Tuo" +"file.new" = "Uusi suunnittelutiedosto" +"file.newFromTemplate" = "Uusi mallista" +"file.open" = "Avaa" +"file.openRecent" = "Avaa viimeksi avattu" +"file.placeImage" = "Sijoita kuva" +"file.recover" = "Palauta tiedosto" +"file.rename" = "Nimeä tiedosto uudelleen" +"file.revert" = "Palauta tallennettu" +"file.save" = "Tallenna" +"file.saveAs" = "Tallenna nimellä" +"file.saveVersion" = "Tallenna versiohistoriaan" +"file.versionHistory" = "Näytä versiohistoria" +"fill.add" = "Lisää täyttö" +"fill.move" = "Siirrä täyttö" +"fill.pattern" = "Kuviotäyttö" +"fill.remove" = "Poista täyttö" +"fill.set" = "Aseta täyttö" +"frame.create" = "Luo kehys" +"frame.presets" = "Luettele kehysten esiasetukset" +"frame.swapOrientation" = "Vaihda suunta" +"grid.add" = "Lisää asetteluruudukko" +"grid.move" = "Siirrä asetteluruudukko" +"grid.remove" = "Poista asetteluruudukko" +"guide.add" = "Lisää apuviiva" +"guide.clear" = "Poista kaikki apuviivat" +"guide.move" = "Siirrä apuviiva" +"guide.remove" = "Poista apuviiva" +"guide.select" = "Valitse apuviiva" +"help.about" = "Tietoja FigCraftista" +"help.gettingStarted" = "Aloittaminen" +"help.page" = "Ohjesivu" +"help.shortcuts" = "Pikanäppäimet" +"image.adjust" = "Säädä kuvaa" +"image.deletePreset" = "Poista kuvan esiasetus" +"image.place" = "Sijoita kuva" +"image.presets" = "Kuvan esiasetukset" +"image.savePreset" = "Tallenna kuvan esiasetus" +"inspect.assets" = "Tarkastele resursseja" +"inspect.code" = "Tason koodi" +"inspect.componentCode" = "Komponentin koodi" +"inspect.properties" = "Tarkastele ominaisuuksia" +"inspect.readyForDev" = "Kehitysvalmis" +"instance.create" = "Luo ilmentymä" +"instance.exposed" = "Käyttöön tuodut sisäkkäiset ilmentymät" +"instance.place" = "Sijoita ilmentymä" +"instance.resetSlot" = "Palauta sisältöpaikka" +"instance.setProperties" = "Aseta ilmentymän ominaisuudet" +"instance.slotInsert" = "Lisää sisältöpaikkaan" +"instance.swap" = "Vaihda ilmentymä" +"instance.swapAt" = "Vaihda ilmentymä pisteessä" +"layers.collapseAll" = "Supista tasot" +"layout.add" = "Lisää automaattinen asettelu" +"layout.remove" = "Poista automaattinen asettelu" +"layout.setTrack" = "Aseta ruudukon osan koko" +"layout.suggest" = "Ehdota automaattista asettelua" +"libraries.open" = "Kirjastot" +"libraries.publish" = "Julkaise kirjasto…" +"library.acceptUpdates" = "Hyväksy kirjaston päivitykset" +"library.add" = "Lisää kirjasto" +"library.aliasVariable" = "Luo alias kirjastomuuttujaan" +"library.applyStyle" = "Käytä kirjastotyyliä" +"library.bindVariable" = "Sido kirjastomuuttuja" +"library.extendCollection" = "Laajenna kirjastokokoelmaa" +"library.import" = "Tuo kirjastokomponentti" +"library.importVariable" = "Tuo kirjastomuuttuja" +"library.list" = "Luettele kirjastot" +"library.place" = "Sijoita kirjastokomponentti" +"library.publish" = "Julkaise kirjasto" +"library.publishToServer" = "Julkaise kirjasto palvelimelle" +"library.remove" = "Poista kirjasto" +"library.setVariableMode" = "Aseta kirjastomuuttujan tila" +"library.swap" = "Vaihda kirjasto" +"library.swapAt" = "Vaihda ilmentymä kirjastokomponenttiin" +"library.updates" = "Kirjaston päivitykset" +"library.usage" = "Kirjaston käyttö" +"measure.distances" = "Mittaa etäisyyksiä" +"measure.padding" = "Mittaa automaattisen asettelun sisämarginaali" +"node.create" = "Luo taso" +"node.get" = "Hae taso" +"node.reorder" = "Muuta tason järjestystä" +"node.reparent" = "Siirrä taso kohteeseen" +"node.set" = "Aseta ominaisuudet" +"object.batchRename" = "Nimeä joukko uudelleen" +"object.convertToFrame" = "Muunna kehykseksi" +"object.convertToGroup" = "Muunna ryhmäksi" +"object.convertToSection" = "Muunna osioksi" +"object.flipH" = "Peilaa vaakasuunnassa" +"object.flipV" = "Peilaa pystysuunnassa" +"object.frameSelection" = "Kehystä valinta" +"object.group" = "Ryhmittele valinta" +"object.hideOthers" = "Kätke muut tasot" +"object.mask" = "Käytä maskina" +"object.moveToPage" = "Siirrä sivulle" +"object.opacityKeys" = "Peittävyys numeronäppäimillä" +"object.rasterize" = "Rasteroi valinta" +"object.releaseMask" = "Vapauta maski" +"object.removeFill" = "Poista täyttö" +"object.removeFrame" = "Poista kehys" +"object.removeStroke" = "Poista reunaviiva" +"object.rename" = "Nimeä uudelleen" +"object.resizeToFit" = "Sovita koko" +"object.rotate180" = "Kierrä 180°" +"object.rotateLeft" = "Kierrä 90° vasemmalle" +"object.rotateRight" = "Kierrä 90° oikealle" +"object.setThumbnail" = "Aseta pikkukuvaksi" +"object.swapFillStroke" = "Vaihda täyttö ja reunaviiva keskenään" +"object.toggleLock" = "Lukitse/avaa valinnan lukitus" +"object.toggleVisible" = "Näytä/kätke valinta" +"object.ungroup" = "Pura valinnan ryhmittely" +"object.wrapInSection" = "Ympäröi uudella osiolla" +"page.add" = "Lisää sivu" +"page.delete" = "Poista sivu" +"page.duplicate" = "Monista sivu" +"page.list" = "Luettele sivut" +"page.move" = "Siirrä sivu" +"page.rename" = "Nimeä sivu uudelleen" +"page.select" = "Siirry sivulle" +"page.setBackground" = "Sivun tausta" +"paint.documentColors" = "Asiakirjan värit" +"plugin.close" = "Sulje liitännäispaneeli" +"plugin.directory.install" = "Asenna liitännäinen hakemistosta" +"plugin.directory.list" = "Selaa liitännäishakemistoa" +"plugin.directory.publish" = "Julkaise liitännäinen hakemistoon" +"plugin.directory.unpublish" = "Peru liitännäisen julkaisu hakemistosta" +"plugin.event" = "Käytä liitännäispaneelin säädintä" +"plugin.import" = "Tuo liitännäinen manifestista…" +"plugin.list" = "Luettele liitännäiset" +"plugin.remove" = "Poista liitännäinen" +"plugin.run" = "Suorita liitännäinen" +"plugin.ui" = "Liitännäispaneeli" +"plugins.manage" = "Hallitse liitännäisiä…" +"plugins.runLast" = "Suorita viimeisin liitännäinen" +"pref.autoSave" = "Tallenna tiedostot automaattisesti" +"pref.highlightHover" = "Korosta tasot osoitettaessa" +"pref.keepTool" = "Pidä työkalu valittuna käytön jälkeen" +"pref.language" = "Käyttöliittymän kieli" +"pref.nudge" = "Siirtoaskeleen koko" +"pref.numberKeysOpacity" = "Säädä peittävyyttä numeronäppäimillä" +"pref.publishServer" = "Verkkojakamisen palvelin" +"pref.reduceMotion" = "Vähennä liikettä" +"pref.renameDuplicates" = "Nimeä monistetut tasot uudelleen" +"pref.showDimensions" = "Näytä objektien mitat" +"pref.userName" = "Nimesi kommenteissa" +"proto.action.add" = "Lisää prototyyppitoiminto" +"proto.action.move" = "Muuta prototyyppitoimintojen järjestystä" +"proto.action.remove" = "Poista prototyyppitoiminto" +"proto.action.set" = "Muokkaa prototyyppitoimintoa" +"proto.closePreview" = "Sulje prototyypin esikatselu" +"proto.conditional.addBlock" = "Lisää muuten jos / muuten" +"proto.conditional.removeBlock" = "Poista jos / muuten jos / muuten" +"proto.conditional.setCondition" = "Muokkaa ehtoa" +"proto.evaluate" = "Laske prototyyppilauseke" +"proto.flow.add" = "Lisää kulun aloituspiste" +"proto.flow.remove" = "Poista kulku" +"proto.flow.rename" = "Nimeä kulku uudelleen" +"proto.interaction.add" = "Lisää vuorovaikutus" +"proto.interaction.clear" = "Poista kaikki vuorovaikutukset" +"proto.interaction.remove" = "Poista vuorovaikutus" +"proto.interaction.set" = "Muokkaa vuorovaikutusta" +"proto.present" = "Esitä" +"proto.presentOptions" = "Esityksen asetukset" +"proto.preview" = "Avaa prototyypin esikatselu" +"proto.settings" = "Prototyypin asetukset" +"section.toggleContents" = "Kätke/näytä osion sisältö" +"select.add" = "Lisää valintaan" +"select.all" = "Valitse kaikki" +"select.area" = "Valitse alue" +"select.byName" = "Valitse tasoja nimen perusteella" +"select.children" = "Valitse alikohteet" +"select.inverse" = "Käännä valinta" +"select.layersAt" = "Pisteessä olevat tasot" +"select.matching" = "Valitse vastaavat tasot" +"select.next" = "Valitse seuraava rinnakkaiskohde" +"select.none" = "Poista valinta" +"select.parent" = "Valitse emotaso" +"select.previous" = "Valitse edellinen rinnakkaiskohde" +"select.remove" = "Poista valinnasta" +"select.sameEffect" = "Valitse sama tehoste" +"select.sameFill" = "Valitse sama täyttö" +"select.sameFont" = "Valitse sama fontti" +"select.sameInstance" = "Valitse sama ilmentymä" +"select.sameProperties" = "Valitse samat ominaisuudet" +"select.sameStroke" = "Valitse sama reunaviiva" +"select.sameText" = "Valitse samat tekstiominaisuudet" +"select.set" = "Valitse" +"selection.applyColorStyle" = "Käytä valinnan värityyliä" +"selection.colors" = "Valinnan värit" +"selection.selectColor" = "Valitse tämänväriset tasot" +"selection.setPaint" = "Muuta valinnan väriä" +"shape.arrow" = "Nuoli" +"shape.ellipse" = "Ellipsi" +"shape.line" = "Viiva" +"shape.polygon" = "Monikulmio" +"shape.rectangle" = "Suorakulmio" +"shape.star" = "Tähti" +"shapeBuilder.merge" = "Yhdistä alueet" +"shapeBuilder.mode" = "Muodonrakentimen tila" +"shapeBuilder.regions" = "Muodonrakentimen alueet" +"shapeBuilder.remove" = "Poista alueet" +"stroke.add" = "Lisää reunaviiva" +"stroke.brush" = "Sivellin" +"stroke.move" = "Siirrä reunaviiva" +"stroke.remove" = "Poista reunaviiva" +"stroke.set" = "Aseta reunaviiva" +"stroke.widthProfile" = "Leveysprofiili" +"style.apply" = "Käytä tyyliä" +"style.bind" = "Sido muuttuja tyylissä" +"style.create" = "Luo tyyli" +"style.delete" = "Poista tyyli" +"style.detach" = "Irrota tyyli" +"style.duplicate" = "Monista tyyli" +"style.list" = "Luettele tyylit" +"style.move" = "Siirrä tyylejä" +"style.renameFolder" = "Nimeä tyylikansio uudelleen" +"style.update" = "Muokkaa tyyliä" +"template.list" = "Luettele mallit" +"text.alignCenter" = "Keskitä" +"text.alignJustify" = "Tasaa molemmat reunat" +"text.alignLeft" = "Tasaa vasemmalle" +"text.alignRight" = "Tasaa oikealle" +"text.bold" = "Lihavointi" +"text.bulletList" = "Luettelomerkitty luettelo" +"text.case" = "Kirjainkoko" +"text.caseLower" = "Pienet kirjaimet" +"text.caseOriginal" = "Alkuperäinen kirjainkoko" +"text.caseSmallCaps" = "Kapiteelit" +"text.caseTitle" = "Sanojen isot alkukirjaimet" +"text.caseUpper" = "Isot kirjaimet" +"text.create" = "Teksti" +"text.decoration" = "Koristelu" +"text.edit.begin" = "Muokkaa tekstiä" +"text.edit.caret" = "Aseta kohdistin" +"text.edit.end" = "Lopeta tekstin muokkaus" +"text.edit.insert" = "Kirjoita tekstiä" +"text.edit.key" = "Tekstinäppäin" +"text.edit.preedit" = "Koosta tekstiä (IME)" +"text.edit.selectLine" = "Valitse rivi" +"text.edit.selectWord" = "Valitse sana" +"text.edit.selection" = "Tekstivalinta" +"text.endPreview" = "Lopeta tekstin esikatselu" +"text.fonts" = "Luettele fontit" +"text.italic" = "Kursivointi" +"text.lineHeightDown" = "Pienennä rivikorkeutta" +"text.lineHeightUp" = "Suurenna rivikorkeutta" +"text.link" = "Luo linkki" +"text.listIndent" = "Sisennä luettelo" +"text.listOutdent" = "Vähennä luettelon sisennystä" +"text.listStyle" = "Luettelotyyli" +"text.maxLines" = "Rivien enimmäismäärä" +"text.missingFonts" = "Puuttuvat fontit" +"text.numberList" = "Numeroitu luettelo" +"text.onPath" = "Teksti polulla" +"text.paragraphIndent" = "Kappaleen sisennys" +"text.paragraphSpacing" = "Kappaleväli" +"text.pathOptions" = "Tekstipolun asetukset" +"text.preview" = "Esikatsele tekstimuutosta" +"text.removeFromPath" = "Poista teksti polulta" +"text.set" = "Aseta teksti" +"text.setFeatures" = "OpenType-ominaisuudet" +"text.setVariations" = "Muuttuvan fontin akselit" +"text.sizeDown" = "Pienennä fonttikokoa" +"text.sizeUp" = "Suurenna fonttikokoa" +"text.strikethrough" = "Yliviivaus" +"text.style" = "Muotoile tekstialue" +"text.trackingDown" = "Pienennä merkkiväliä" +"text.trackingUp" = "Suurenna merkkiväliä" +"text.underline" = "Alleviivaus" +"text.weightDown" = "Vähennä fontin paksuutta" +"text.weightUp" = "Lisää fontin paksuutta" +"tool.arrow" = "Nuoli" +"tool.comment" = "Kommentti" +"tool.ellipse" = "Ellipsi" +"tool.frame" = "Kehys" +"tool.hand" = "Käsi" +"tool.line" = "Viiva" +"tool.move" = "Siirrä" +"tool.pen" = "Kynä" +"tool.pencil" = "Lyijykynä" +"tool.pencilBrush" = "Lyijykynäsivellin" +"tool.place" = "Sijoita työkalulla" +"tool.polygon" = "Monikulmio" +"tool.rectangle" = "Suorakulmio" +"tool.scale" = "Skaalaus" +"tool.scaleAnchor" = "Skaalauksen ankkuri" +"tool.section" = "Osio" +"tool.set" = "Valitse työkalu" +"tool.shapeBuilder" = "Muodonrakennin" +"tool.slice" = "Viipale" +"tool.star" = "Tähti" +"tool.text" = "Teksti" +"transform.move" = "Siirrä" +"transform.moveTo" = "Siirrä kohteeseen" +"transform.nudge" = "Siirrä askelittain" +"transform.nudgeSize" = "Muuta kokoa askelittain" +"transform.resize" = "Muuta kokoa" +"transform.rotate" = "Kierrä" +"transform.rotationOrigin" = "Siirrä kiertokeskipistettä" +"transform.scale" = "Skaalaus" +"transform.setRotationOrigin" = "Aseta kiertokeskipiste" +"variable.addMode" = "Lisää tila" +"variable.bind" = "Sido muuttuja" +"variable.create" = "Luo muuttuja" +"variable.createCollection" = "Luo muuttujakokoelma" +"variable.delete" = "Poista muuttuja" +"variable.deleteCollection" = "Poista kokoelma" +"variable.duplicate" = "Monista muuttuja" +"variable.export" = "Vie muuttujat" +"variable.import" = "Tuo muuttujat" +"variable.list" = "Luettele muuttujat" +"variable.moveMode" = "Siirrä tila" +"variable.removeMode" = "Poista tila" +"variable.renameCollection" = "Nimeä kokoelma uudelleen" +"variable.renameMode" = "Nimeä tila uudelleen" +"variable.resetOverride" = "Palauta muuttujan ohitus" +"variable.set" = "Aseta muuttujan arvo" +"variable.setMode" = "Aseta muuttujan tila" +"variable.update" = "Muokkaa muuttujaa" +"vector.create" = "Vektori" +"vector.deleteHeal" = "Poista ja korjaa valinta" +"vector.edit.addVertex" = "Lisää piste" +"vector.edit.begin" = "Muokkaa vektoria" +"vector.edit.bend" = "Taivuta segmenttiä" +"vector.edit.bounds" = "Valittujen pisteiden rajat" +"vector.edit.connect" = "Yhdistä pisteet" +"vector.edit.cornerRadius" = "Pisteen kulmasäde" +"vector.edit.cut" = "Leikkaa polku" +"vector.edit.delete" = "Poista pisteet" +"vector.edit.end" = "Lopeta muokkaus" +"vector.edit.erase" = "Pyyhi" +"vector.edit.lasso" = "Valitse lassolla" +"vector.edit.mirroring" = "Kahvojen peilaus" +"vector.edit.moveHandles" = "Siirrä kahvoja" +"vector.edit.moveVertices" = "Siirrä pisteitä" +"vector.edit.nudge" = "Siirrä pisteitä askelittain" +"vector.edit.paint" = "Maalipurkki" +"vector.edit.pen" = "Kynän piste" +"vector.edit.penEnd" = "Päätä kynäpolku" +"vector.edit.position" = "Pisteen sijainti" +"vector.edit.resize" = "Muuta pisteiden kokoa" +"vector.edit.rotate" = "Kierrä pisteitä" +"vector.edit.select" = "Valitse pisteitä" +"vector.edit.selectAll" = "Valitse kaikki pisteet" +"vector.edit.setHandle" = "Aseta kahva" +"vector.edit.smooth" = "Pehmennä tai terävöitä pisteitä" +"vector.edit.state" = "Vektorimuokkauksen tila" +"vector.edit.strokeCap" = "Pisteen viivanpää" +"vector.edit.strokeJoin" = "Pisteen viivaliitos" +"vector.edit.tool" = "Vektorimuokkauksen työkalu" +"vector.edit.transform" = "Muunna pisteitä" +"vector.edit.widthPoint" = "Leveyspiste" +"vector.flatten" = "Yhdistä vektorimuodoksi" +"vector.join" = "Yhdistä valinta" +"vector.offset" = "Siirrä polun reunaa" +"vector.outlineStroke" = "Muunna reunaviiva poluksi" +"vector.reverse" = "Käännä polun suunta" +"vector.simplify" = "Yksinkertaista vektori" +"vector.smoothJoin" = "Yhdistä valinta pehmeästi" +"version.autosave" = "Tallenna versio automaattisesti" +"version.delete" = "Poista versio" +"version.duplicate" = "Monista versio" +"version.exitPreview" = "Takaisin nykyiseen versioon" +"version.list" = "Luettele versiot" +"version.preview" = "Katsele versiota" +"version.rename" = "Nimeä versio uudelleen" +"version.restore" = "Palauta versio" +"view.assets" = "Resurssipaneeli" +"view.comments" = "Kommentit" +"view.contextMenu" = "Näytä pikavalikko" +"view.design" = "Suunnittelupaneeli" +"view.designPrototype" = "Vaihda suunnittelun ja prototyypin välillä" +"view.devMode" = "Kehittäjätila" +"view.frameOutlines" = "Kehysten ääriviivat" +"view.fullscreen" = "Koko näyttö" +"view.get" = "Hae näkymä" +"view.layers" = "Tasopaneeli" +"view.layoutGrids" = "Asetteluruudukot" +"view.leftSidebar" = "Näytä/kätke vasen sivupalkki" +"view.maskOutlines" = "Maskien ääriviivat" +"view.multiplayerCursors" = "Yhteiskäytön kohdistimet" +"view.nextFrame" = "Zoomaa seuraavaan kehykseen" +"view.nextPage" = "Seuraava sivu" +"view.nextRegion" = "Kohdista seuraava alue" +"view.outlines" = "Ääriviivat" +"view.outlinesHiddenLayers" = "Sisällytä kätketyt tasot ääriviivoihin" +"view.outlinesObjectBounds" = "Sisällytä objektien rajat ääriviivoihin" +"view.outlinesSelection" = "Valinnan ääriviivat" +"view.pan" = "Siirrä näkymää" +"view.panelWidths" = "Palauta paneelien leveydet" +"view.pixelGrid" = "Pikseliruudukko" +"view.pixelPreview" = "Pikseliesikatselu" +"view.prevFrame" = "Zoomaa edelliseen kehykseen" +"view.prevPage" = "Edellinen sivu" +"view.previousRegion" = "Kohdista edellinen alue" +"view.proofSrgb" = "sRGB-vedossimulointi" +"view.prototype" = "Prototyyppipaneeli" +"view.rulers" = "Viivaimet" +"view.set" = "Aseta näkymä" +"view.slices" = "Viipaleet" +"view.snapGeometry" = "Tartu geometriaan" +"view.snapObjects" = "Tartu objekteihin" +"view.snapPixel" = "Tartu pikseliruudukkoon" +"view.themeDark" = "Tumma teema" +"view.themeLight" = "Vaalea teema" +"view.themeSystem" = "Seuraa järjestelmän teemaa" +"view.toggleUi" = "Näytä/kätke käyttöliittymä" +"view.zoom100" = "Zoomaa kokoon 100 %" +"view.zoom200" = "Zoomaa kokoon 200 %" +"view.zoom50" = "Zoomaa kokoon 50 %" +"view.zoomAt" = "Zoomaustyökalu" +"view.zoomFit" = "Sovita näkymään" +"view.zoomIn" = "Lähennä" +"view.zoomOut" = "Loitonna" +"view.zoomSelection" = "Zoomaa valintaan" +"widget.click" = "Napsauta pienoisohjelmaa" +"widget.insert" = "Lisää pienoisohjelma" +"widget.list" = "Luettele pienoisohjelmat" +"window.focus" = "Tuo ikkuna etummaiseksi" +"window.new" = "Uusi ikkuna" + +[menu] +"bool.exclude" = "Jätä pois" +"bool.flatten" = "Yhdistä vektorimuodoksi" +"bool.intersect" = "Leikkaus" +"bool.subtract" = "Vähennä" +"bool.union" = "Yhdiste" +"file.duplicate" = "Monista" +"file.import" = "Tuo tiedostosta…" +"file.rename" = "Nimeä uudelleen" +"libraries.open" = "Avaa kirjastot" +"select.sameEffect" = "Tehoste" +"select.sameFill" = "Täyttö" +"select.sameFont" = "Fontti" +"select.sameInstance" = "Ilmentymä" +"select.sameProperties" = "Ominaisuudet" +"select.sameStroke" = "Reunaviiva" +"select.sameText" = "Tekstiominaisuudet" +"text.alignCenter" = "Keskitä teksti" +"text.alignJustify" = "Tasaa tekstin molemmat reunat" +"text.alignLeft" = "Tasaa teksti vasemmalle" +"text.alignRight" = "Tasaa teksti oikealle" +"view.assets" = "Resurssit" +"view.design" = "Suunnittelu" +"view.layers" = "Tasot" +"view.outlines" = "Näytä ääriviivat" +"view.outlinesHiddenLayers" = "Sisällytä kätketyt tasot" +"view.outlinesObjectBounds" = "Sisällytä objektien rajat" +"view.outlinesSelection" = "Näytä valinnan ääriviivat" +"view.prototype" = "Prototyyppi" +"view.themeDark" = "Tumma" +"view.themeLight" = "Vaalea" +"view.themeSystem" = "Seuraa järjestelmää" diff --git a/crates/ui-egui/src/i18n_tests.rs b/crates/ui-egui/src/i18n_tests.rs index d4d81d7b9..ea85ad32f 100644 --- a/crates/ui-egui/src/i18n_tests.rs +++ b/crates/ui-egui/src/i18n_tests.rs @@ -8,6 +8,46 @@ use super::*; /// Languages that must translate every UI string and command label. const COMPLETE: &[&str] = &["es"]; +#[test] +fn finnish_locale_tags_and_integer_plurals() { + let fi = resolve("fi", None); + assert_eq!(LANGS[fi].code, "fi"); + assert_eq!(LANGS[fi].name, "Suomi"); + assert!(LANGS[fi].draft, "AI-assisted Finnish still needs human review"); + let mut session = figcraft_engine::Session::new(); + session.execute("pref.language", &serde_json::json!({"language":"fi"})).unwrap(); + let saved = serde_json::to_string(&session.prefs).unwrap(); + let restored: figcraft_engine::Prefs = serde_json::from_str(&saved).unwrap(); + assert_eq!(restored.language, "fi"); + for locale in ["fi-FI", "fi_FI.UTF-8", "FI-fi", "fi"] { + assert_eq!(resolve("system", Some(locale)), fi, "{locale}"); + } + for (count, expected) in [(0, "0 tasoa"), (1, "1 taso"), (2, "2 tasoa"), (21, "21 tasoa"), (101, "101 tasoa")] { + assert_eq!(fill(counted(fi, "{n} layers", count), &[("n", &count)]), expected); + } + assert_eq!(fill(counted(fi, "{n} minutes ago", 1), &[("n", &1)]), "1 minuutti sitten"); + assert_eq!(fill(counted(fi, "{n} minutes ago", 2), &[("n", &2)]), "2 minuuttia sitten"); + assert_eq!(fill(counted(fi, "{n} people joined", 2), &[("n", &2)]), "2 henkilöä liittyi"); +} + +#[test] +fn finnish_keeps_interpolated_names_and_context_specific_labels() { + let fi = resolve("fi", None); + let text = |key| match lookup(fi, key).unwrap() { + Text::Plain(s) => *s, + _ => panic!("expected a plain Finnish label: {key}"), + }; + assert_eq!(text("Cancel"), "Peruuta"); + assert_eq!(text("Fill"), "Täyttö"); + assert_eq!(text("Fill|sizing"), "Täytä"); + assert_eq!(text("Join|stroke"), "Liitos"); + assert_eq!(text("Open|comments"), "Avoin"); + assert_eq!(fill(text("Actions for {name}"), &[("name", &"File {1}.figcraft")]), "Kohteen File {1}.figcraft toiminnot"); + assert!(lookup(fi, "My layer {name}.svg").is_none()); + assert!(matches!(find(LANGS[fi].commands, "edit.undo"), Some(Text::Plain("Kumoa")))); + assert!(matches!(find(LANGS[fi].menu, "file.import"), Some(Text::Plain("Tuo tiedostosta…")))); +} + /// Keys looked up from data rather than written as `tr("…")` in the code: the main menu's /// submenu names (the engine's menu catalog) and labels of engine and document enums. fn dynamic_keys() -> BTreeSet { diff --git a/docs/translating.md b/docs/translating.md index 1ea1b94fa..3700bab4c 100644 --- a/docs/translating.md +++ b/docs/translating.md @@ -68,6 +68,18 @@ language also needs its script in `cjk::language`. ## Adding a language +Finnish (`fi`, Suomi) is an AI-assisted draft awaiting native-speaker review. Its initial catalog +covers the current 1,729 English UI keys, 567 command labels and 31 menu-specific wordings, including +42 plural entries. Counts use singular only for 1 (`1 taso`, `0/2/21 tasoa`); this already follows +the default integer rule. Context keys distinguish paint `Fill` (Täyttö), sizing `Fill|sizing` +(Täytä), stroke `Join|stroke` (Liitos) and comment status `Open|comments` (Avoin). +The build discovers `fi.toml` automatically; `fi-FI` and `fi_FI.UTF-8` resolve to it. Product names, +code identifiers and shortcut notation retain their identity. Like the other unreviewed catalogs, +Finnish remains a draft outside `COMPLETE`; future English additions may fall back until translated. +Noise modes Mono/Duo/Multi describe one, two or many grain colours and read Yksivärinen, +Kaksivärinen and Monivärinen, independently of their stable enum names. +The narrow glass-effect light-intensity field uses Vahvuus so its complete label fits beside the value. + 1. Copy `crates/ui-egui/locales/es.toml` to `.toml` (a BCP 47 code: `fr`, `pt-BR`, `ja`) and set `[meta] name` and `status = "draft — needs native review"`. 2. Translate every value; keep the keys. Keep `{placeholders}` exactly, "…" where English has it, From e35f8eb1b78f7f30355509144e4e4f0d4a2f1905 Mon Sep 17 00:00:00 2001 From: Ashsajal Date: Sun, 18 Oct 2026 14:15:56 +0600 Subject: [PATCH 244/817] M8: wait for a recovery folder lock that frees itself (#334) A child process forked before its exec inherits the run's open descriptors, and a flock lasts while any descriptor for the file is open. A crashed run whose folder lock was still held by such a child read as a run that was still going, so recover_all skipped it and its unsaved documents were not opened at the next start. The desktop app's tests failed intermittently for the same reason whenever another test spawned a process in parallel (the reduced-motion read spawns gsettings on Linux and the BSDs): recovery_tests failed in 23 of 60 runs of the whole binary and never on its own. Taking a folder's lock now retries try_lock briefly, so a lock that frees itself is no longer read as a live run while a run that really is running still keeps its folder. Regression test: a_lock_freed_a_moment_later_is_not_a_run_that_is_still_going holds the crashed run's lock on a second descriptor, the way a forked child does, and frees it shortly after; the copies come back. The recovery tests that collide with a spawning test went from 8 failures in 10 runs to 0 in 10. --- apps/figcraft/src/recovery.rs | 29 +++++++++++++++++++++++------ apps/figcraft/src/recovery_tests.rs | 22 ++++++++++++++++++++++ docs/hardware-parity.md | 1 + 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/apps/figcraft/src/recovery.rs b/apps/figcraft/src/recovery.rs index 62243bc73..0ad97f0d7 100644 --- a/apps/figcraft/src/recovery.rs +++ b/apps/figcraft/src/recovery.rs @@ -120,8 +120,7 @@ impl Recovery { (0..10).find_map(|n| { let dir = root.join(if n == 0 { pid.to_string() } else { format!("{pid}-{n}") }); std::fs::create_dir_all(&dir).ok()?; - let lock = File::options().write(true).create(true).truncate(false).open(dir.join(LOCK)).ok()?; - lock.try_lock().ok()?; + let lock = lock_briefly(&dir.join(LOCK))?; Some(Self { dir, _lock: lock, written: HashMap::new(), next: 0.0, waiting: Vec::new() }) }) } @@ -293,6 +292,27 @@ fn remove_kept(w: Waiting) { /// The extension of the note beside the copy of a document that is one of your online files. const ONLINE: &str = "online"; +/// How long a folder's lock that frees itself is waited for, and between the tries. +const LOCK_WAIT: (usize, std::time::Duration) = (20, std::time::Duration::from_millis(5)); + +/// Lock the folder's `file`, waiting briefly for a lock that frees itself. A child between its +/// `fork` and its `exec` inherits the run's open descriptors, and a `flock` lasts while any +/// descriptor for the file is open, so a run that has ended can look like one that is still going +/// for the length of that window. A run that really is running holds the lock for as long as it +/// runs, and we give up on it after [`LOCK_WAIT`] (#334). +fn lock_briefly(file: &Path) -> Option { + let lock = File::options().write(true).create(true).truncate(false).open(file).ok()?; + let (tries, pause) = LOCK_WAIT; + for _ in 0..tries { + match lock.try_lock() { + Ok(()) => return Some(lock), + Err(std::fs::TryLockError::WouldBlock) => std::thread::sleep(pause), + Err(_) => return None, + } + } + None +} + /// The copy at `file` is of one of your online files: join that file again as its owner, keeping /// the copy to compare with what arrives. The session, or `None` when the copy isn't one (or its /// file isn't recorded any more, or is open already): then it opens as any other copy. @@ -369,10 +389,7 @@ pub fn recover_all(root: &Path, s: &mut Session) -> Recovered { continue; } // Still running (another window of the app), or not ours to take. - let Ok(lock) = File::options().write(true).create(true).truncate(false).open(path.join(LOCK)) else { continue }; - if lock.try_lock().is_err() { - continue; - } + let Some(lock) = lock_briefly(&path.join(LOCK)) else { continue }; let lock = Arc::new(lock); let files: Vec = std::fs::read_dir(&path).into_iter().flatten().flatten().map(|f| f.path()).collect(); for f in &files { diff --git a/apps/figcraft/src/recovery_tests.rs b/apps/figcraft/src/recovery_tests.rs index 8f384b87c..c05e86d0b 100644 --- a/apps/figcraft/src/recovery_tests.rs +++ b/apps/figcraft/src/recovery_tests.rs @@ -203,6 +203,28 @@ fn a_run_whose_folder_name_is_still_held_takes_another() { let _ = std::fs::remove_dir_all(&root); } +/// #334: a lock that frees itself is not a run that is still going. A child between its `fork` and +/// its `exec` inherits the run's open descriptors and a `flock` lasts while any descriptor for the +/// file is open, so a crashed run's copies must still come back once that child has exec'd. +#[test] +fn a_lock_freed_a_moment_later_is_not_a_run_that_is_still_going() { + let root = root("fork-window"); + crashed(&edited(), &root); + // Hold the crashed run's folder lock on a second descriptor, the way a child forked before its + // exec holds it, and free it shortly after. + let lock = std::fs::File::options().write(true).create(true).truncate(false).open(root.join("crashed").join("lock")).unwrap(); + lock.try_lock().unwrap(); + let freed = std::thread::spawn(move || { + std::thread::sleep(std::time::Duration::from_millis(40)); + drop(lock); + }); + // The next start waits for that lock rather than reading the run as still going. + let mut next = Session::empty(); + assert_eq!(recover(&root, &mut next), 1, "the copies come back once the lock frees itself"); + freed.join().unwrap(); + let _ = std::fs::remove_dir_all(&root); +} + /// The rectangles in `doc`. fn rectangles(doc: &figcraft_engine::doc::Document) -> usize { doc.nodes().filter(|n| matches!(n.kind, figcraft_engine::doc::NodeKind::Rectangle)).count() diff --git a/docs/hardware-parity.md b/docs/hardware-parity.md index df8229818..4780a0a85 100644 --- a/docs/hardware-parity.md +++ b/docs/hardware-parity.md @@ -50,6 +50,7 @@ Nothing has been timed against Figma on the same document (needs `.fig` import). | Date | Change | Summary | |---|---|---| +| 2026-10-18 | minor | Recovery copies and the fork/exec window (#334): a child process forked before its `exec` (the `gsettings` read of the reduced-motion setting, any spawn) inherits the running app's open recovery-folder lock, and a `flock` lasts while any descriptor for the file is open. A crashed run whose lock was still held by such a child therefore read as "still running" and its unsaved documents were not recovered at the next start, and the desktop app's tests failed intermittently whenever another test spawned a process in parallel. Taking a folder's lock now waits briefly for one that frees itself, so only a run that is really running keeps its folder. No numbers changed | | 2026-10-18 | minor | macOS quit crash (#781): on Macs with a Touch Bar the app could crash as it quit (an exception in AppKit's Touch Bar support while the window's content view, which the accessibility adapter subclasses, was torn down). Quitting now keeps everything (preferences, this run's recovery copies, live sessions ended) and then ends the process before that teardown. Quit from the menu bar ends the app without the unsaved-changes question, so unsaved files' recovery copies now stay and reopen at the next start instead of being removed. Numbers unchanged | | 2026-10-17 | minor | Linux row: clipboard reads on Linux and the BSDs time out after 2 s on a helper thread, images copied in other apps paste under Wayland (arboard's data-control feature, #693), a minimised window can't be detected under Wayland, so frame-only control requests may still wait there (#720), and Wayland compositors without server-side decorations give the window Adwaita controls (#592, checked by its author on GNOME, not by the maintainers; KDE not run); compiled in CI, not run on a Linux desktop. HiDPI row: native-density canvas images placed on whole device pixels (#359, geometry tests; not judged by eye). Numbers unchanged | | 2026-10-14 | minor | Copy and paste in the browser: the web build never wrote to the system clipboard, so Cmd+V after Cmd+C pasted whatever text the clipboard held before (as a text layer) instead of the copied layers. Copies (layers, Copy as SVG/CSS/text/PNG, links) now go out through egui's output, which eframe writes during the copy event (`web_clipboard_tests`). Numbers unchanged. | From ef535e49b02f44735e0cf13ced886131b2aa21b8 Mon Sep 17 00:00:00 2001 From: BFlat Date: Sun, 18 Oct 2026 15:52:30 +0700 Subject: [PATCH 245/817] M1: REST import keeps slot layers and instances' slot content (#792) (#796) Fixes #792. Fixes #792. --- crates/engine/src/lib.rs | 2 + crates/engine/src/rest_slot_tests.rs | 91 +++++++++++ crates/format/src/rest/mod.rs | 112 ++++++++++++- crates/format/src/rest/slot_tests.rs | 229 +++++++++++++++++++++++++++ crates/ui-egui/locales/en.toml | 1 + crates/ui-egui/locales/es.toml | 1 + docs/file-format-parity.md | 5 +- 7 files changed, 431 insertions(+), 10 deletions(-) create mode 100644 crates/engine/src/rest_slot_tests.rs create mode 100644 crates/format/src/rest/slot_tests.rs diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index fedcffc96..c32a99bb7 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1744,6 +1744,8 @@ mod proto_run_tests; #[cfg(test)] mod proto_tail_tests; #[cfg(test)] +mod rest_slot_tests; +#[cfg(test)] mod retained_walk_tests; #[cfg(test)] mod rotated_guides_tests; diff --git a/crates/engine/src/rest_slot_tests.rs b/crates/engine/src/rest_slot_tests.rs new file mode 100644 index 000000000..e272c3a70 --- /dev/null +++ b/crates/engine/src/rest_slot_tests.rs @@ -0,0 +1,91 @@ +//! Slots opened from REST file JSON: instances keep their own slot content through edits and +//! moves of the mains, and through saving. + +use crate::Session; +use crate::components::tests::{ex, healthy, idv}; +use crate::components::*; +use base64::Engine as _; +use figcraft_doc::*; +use serde_json::{Value, json}; + +fn at(x: f64, y: f64) -> Value { + json!([[1, 0, x], [0, 1, y]]) +} + +fn text(id: &str, s: &str) -> Value { + json!({"id": id, "name": s, "type": "TEXT", "characters": s, "relativeTransform": at(0.0, 0.0), "size": {"x": 100, "y": 20}}) +} + +/// A Chip main, a Container main with an empty "Slot", and an instance of Container whose slot +/// holds a text and a chip. +fn file() -> Value { + let slot = |id: &str, kids: Value| json!({"id": id, "name": "Slot", "type": "SLOT", "relativeTransform": at(10.0, 40.0), "size": {"x": 280, "y": 100}, "children": kids}); + let guid = |l: u32| json!({"guid": {"sessionID": 5, "localID": l}}); + let chip = json!({"id": "2:3", "name": "Chip", "type": "INSTANCE", "componentId": "1:9", "relativeTransform": at(0.0, 30.0), "size": {"x": 40, "y": 20}, + "children": [{"id": "I2:3;1:10", "name": "Dot", "type": "ELLIPSE", "relativeTransform": at(2.0, 2.0), "size": {"x": 16, "y": 16}}]}); + json!({"name": "Slots", "document": {"id": "0:0", "type": "DOCUMENT", "children": [{"id": "0:1", "name": "Page", "type": "CANVAS", "children": [ + {"id": "1:9", "name": "Chip", "type": "COMPONENT", "relativeTransform": at(0.0, 400.0), "size": {"x": 40, "y": 20}, "children": [ + {"id": "1:10", "name": "Dot", "type": "ELLIPSE", "relativeTransform": at(2.0, 2.0), "size": {"x": 16, "y": 16}} + ]}, + {"id": "1:2", "name": "Container", "type": "COMPONENT", "relativeTransform": at(0.0, 0.0), "size": {"x": 300, "y": 160}, + "componentPropertyDefinitions": {"Slot#1:3": {"type": "SLOT", "defaultValue": guid(1)}}, + "children": [text("1:4", "Title"), slot("1:5", json!([]))]}, + {"id": "2:1", "name": "Container", "type": "INSTANCE", "componentId": "1:2", "relativeTransform": at(400.0, 0.0), "size": {"x": 300, "y": 160}, + "componentProperties": {"Slot#1:3": {"type": "SLOT", "value": guid(7)}}, + "children": [text("I2:1;1:4", "Title"), slot("I2:1;1:5", json!([text("2:2", "Reports in progress"), chip]))]} + ]}]}}) +} + +fn named(doc: &Document, kind: fn(&NodeKind) -> bool, name: &str) -> NodeId { + doc.nodes().find(|n| n.name == name && kind(&n.kind)).map(|n| n.id).unwrap_or_else(|| panic!("no {name}")) +} + +/// The instance's slot and the names of what it holds. +fn slot_content(s: &Session) -> (NodeId, Vec) { + let doc = s.doc().unwrap(); + let inst = named(doc, |k| matches!(k, NodeKind::Instance { .. }), "Container"); + let (slot, _) = slots_of(doc, inst).into_iter().next().expect("the instance has its slot"); + let names = doc.node(slot).unwrap().children.iter().map(|c| doc.node(*c).unwrap().name.clone()).collect(); + (slot, names) +} + +#[test] +fn rest_slot_content_survives_main_edits_moves_and_saving() { + let mut s = Session::new(); + let data = base64::engine::general_purpose::STANDARD.encode(serde_json::to_vec(&file()).unwrap()); + ex(&mut s, "file.open", json!({"data": data, "name": "slots.json"})); + healthy(&s); + let want = vec!["Reports in progress".to_string(), "Chip".to_string()]; + let (slot, names) = slot_content(&s); + assert_eq!(names, want); + let doc = s.doc().unwrap(); + assert_eq!(slot_name(doc, slot).as_deref(), Some("Slot")); + assert!(slot_edited(doc, slot), "the instance's own content"); + let chip = named(doc, |k| matches!(k, NodeKind::Instance { .. }), "Chip"); + assert!(!inside_instance(doc, chip), "content stands alone"); + + // Edit and move both mains (the container's and the one used in the content). + let main = named(doc, |k| matches!(k, NodeKind::Component { .. }), "Container"); + let chip_main = named(doc, |k| matches!(k, NodeKind::Component { .. }), "Chip"); + let title = doc.node(main).unwrap().children[0]; + ex(&mut s, "node.set", json!({"id": title, "props": {"fill": "#ff0000"}})); + ex(&mut s, "node.set", json!({"id": main, "props": {"width": 320}})); + let holder = idv(&ex(&mut s, "frame.create", json!({"x": -1000, "y": 0, "width": 900, "height": 900, "name": "Design system"}))); + ex(&mut s, "node.reparent", json!({"ids": [main, chip_main], "parent": holder})); + healthy(&s); + assert_eq!(slot_content(&s).1, want, "kept across syncs"); + + // Saving and opening again keeps it. + let bytes = figcraft_format::save_bytes(s.doc().unwrap(), None).unwrap(); + let data = base64::engine::general_purpose::STANDARD.encode(bytes); + let mut again = Session::new(); + ex(&mut again, "file.open", json!({"data": data, "name": "slots.figcraft"})); + healthy(&again); + let (slot, names) = slot_content(&again); + assert_eq!(names, want); + assert!(slot_edited(again.doc().unwrap(), slot)); + + // Resetting the slot shows the main's (empty) default content. + ex(&mut again, "instance.resetSlot", json!({"id": slot})); + assert!(slot_content(&again).1.is_empty()); +} diff --git a/crates/format/src/rest/mod.rs b/crates/format/src/rest/mod.rs index 232afc258..78279e915 100644 --- a/crates/format/src/rest/mod.rs +++ b/crates/format/src/rest/mod.rs @@ -6,8 +6,8 @@ //! (`relativeTransform`, else `absoluteBoundingBox` + `rotation`), paints, strokes, effects, //! corners, constraints, auto layout, layout grids, export settings, text with styled runs, //! vectors from `fillGeometry` / `strokeGeometry`, components, component sets, instances and -//! component properties are imported. Image fills keep their `imageRef` as the image key and -//! show a grey placeholder unless an [`ImageResolver`] supplies the bytes (nothing is fetched). +//! component properties (slots included) are imported. Image fills keep their `imageRef` as the +//! image key and show a grey placeholder unless an [`ImageResolver`] supplies the bytes (nothing is fetched). //! Prototyping comes along: interactions (triggers, actions, transitions, easing), flows, //! scrolling and the prototype device. Variables come from the local variables response //! (`GET /v1/files/:key/variables/local`), embedded next to the file JSON or passed separately @@ -37,6 +37,8 @@ pub(crate) mod proto; #[cfg(test)] mod proto_variable_tests; #[cfg(test)] +pub(crate) mod slot_tests; +#[cfg(test)] mod tests; mod text; mod variables; @@ -381,6 +383,10 @@ pub(crate) struct Ctx<'a> { style_meta: BTreeMap<&'a str, &'a Value>, /// Instances (imported as frames until their main is resolved) with their JSON. instances: Vec<(NodeId, &'a Value)>, + /// `SLOT` layers (imported as frames until their slot property is resolved) with their JSON. + slots: Vec<(NodeId, &'a Value)>, + /// Slot property defaults (the main's slot content id): (component or set, property) → value. + slot_defaults: BTreeMap<(NodeId, String), &'a Value>, /// Instance-swap property defaults: (component or set, property, REST id of the default). swap_defaults: Vec<(NodeId, String, String)>, /// Property definitions of component sets, shared by their variants. @@ -415,6 +421,8 @@ impl<'a> Ctx<'a> { set_meta: BTreeMap::new(), style_meta: BTreeMap::new(), instances: Vec::new(), + slots: Vec::new(), + slot_defaults: BTreeMap::new(), swap_defaults: Vec::new(), set_defs: BTreeMap::new(), flows: Vec::new(), @@ -515,8 +523,10 @@ impl<'a> Ctx<'a> { sources.record(id, j, primary); } } - if ty == "INSTANCE" { - self.instances.push((id, j)); + match ty { + "INSTANCE" => self.instances.push((id, j)), + "SLOT" => self.slots.push((id, j)), + _ => {} } let kids = children(j); if kids.is_empty() { @@ -539,8 +549,8 @@ impl<'a> Ctx<'a> { let point_count = || num(j, "pointCount").filter(|c| *c >= 3.0).map(|c| c.min(1000.0) as u32); let has_geometry = !list(j, "fillGeometry").is_empty() || !list(j, "strokeGeometry").is_empty(); Some(match ty { - // Instances start as frames; `finish` links them to their main. - "FRAME" | "INSTANCE" => NodeKind::Frame, + // Instances and slots start as frames; `finish` links them to their main and property. + "FRAME" | "INSTANCE" | "SLOT" => NodeKind::Frame, "GROUP" => NodeKind::Group, "SECTION" => NodeKind::Section { contents_hidden: flag(j, "sectionContentsHidden").unwrap_or(false) }, "RECTANGLE" => NodeKind::Rectangle, @@ -751,7 +761,7 @@ impl<'a> Ctx<'a> { } /// Component property definitions (variant ones are implied by the variant names). - fn prop_defs(&mut self, owner: NodeId, j: &Value) -> BTreeMap { + fn prop_defs(&mut self, owner: NodeId, j: &'a Value) -> BTreeMap { let mut out = BTreeMap::new(); for (name, d) in j.get("componentPropertyDefinitions").and_then(Value::as_object).into_iter().flatten().take(256) { let default = d.get("defaultValue"); @@ -765,7 +775,13 @@ impl<'a> Ctx<'a> { continue; } Some("VARIANT") => continue, - Some("SLOT") if self.fig_sources.is_some() => PropDef::Slot { preferred: Vec::new() }, + Some("SLOT") => { + if let Some(d) = default { + self.slot_defaults.insert((owner, name.clone()), d); + } + self.slot_notes(d); + PropDef::Slot { preferred: Vec::new() } + } _ => { self.warn("unknown component property types were skipped"); continue; @@ -776,6 +792,20 @@ impl<'a> Ctx<'a> { out } + /// Notes on what a slot property sets that the editor doesn't keep: preferred components (keys + /// of library components, not layers of the file) and limits on its content. + fn slot_notes(&mut self, d: &Value) { + if !list(d, "preferredValues").is_empty() { + self.warn("preferred slot component keys cannot be resolved to file nodes and were skipped"); + } + // Insertion and empty-slot display only change editing aids, not what the file shows. + let s = d.get("slotSettings"); + let limit = |k: &str| s.and_then(|s| num(s, k)).is_some_and(|n| n != 0.0); + if limit("minChildren") || limit("maxChildren") || s.and_then(|s| flag(s, "allowPreferredValuesOnly")) == Some(true) { + self.warn("non-default slot settings are not represented and were skipped"); + } + } + /// Shared styles with their values (`styleDefinitions`, written by the `.fig` import: a list of /// `{id, name, description, styleType, node}`, the node being a layer that shows the style), in /// the file's order. Layers then link to them; styles that no layer uses come across too. @@ -984,6 +1014,7 @@ impl<'a> Ctx<'a> { /// outside components, and instances that would nest a component inside itself (directly or /// through other components), stay frames. fn resolve_instances(&mut self) { + let frames: BTreeSet = self.instances.iter().map(|(i, _)| *i).collect(); let mut links: Vec<(NodeId, NodeId, &'a Value)> = Vec::new(); for (inst, j) in std::mem::take(&mut self.instances) { match text(j, "componentId").and_then(|r| self.component(r)) { @@ -1013,6 +1044,7 @@ impl<'a> Ctx<'a> { linked.push((inst, j)); } } + self.resolve_slots(&frames, &linked); // Overridden fields the file lists, on the instance and its layers. for (inst, j) in linked { for o in list(j, "overrides") { @@ -1028,6 +1060,70 @@ impl<'a> Ctx<'a> { } } + /// `SLOT` layers. In a main component a slot is bound to its slot property: the one the layer + /// references, else the one named like it, else the main's only slot property left. In an + /// instance it follows its main's slot, and holds the instance's own content (kept across syncs) + /// unless the instance's value of the property is the main's default content (without the + /// values to compare, a slot holding layers keeps them as its own). A slot without a property + /// stays a frame. `frames`: every instance + /// layer of the file, `linked`: those that became instances. + fn resolve_slots(&mut self, frames: &BTreeSet, linked: &[(NodeId, &'a Value)]) { + let linked: BTreeMap = linked.iter().copied().collect(); + let mut bound: BTreeSet<(NodeId, String)> = BTreeSet::new(); + for (id, j) in std::mem::take(&mut self.slots) { + // The nearest main component or instance above the slot owns it; in an instance whose + // main isn't in the file (a frame), the slot stays a frame too. + let owner = self.doc.ancestors(id).into_iter().find_map(|a| match self.doc.node(a).map(|n| &n.kind) { + Some(NodeKind::Instance { component, .. }) => Some(linked.get(&a).map(|j| (*component, Some(*j)))), + Some(NodeKind::Component { .. }) => Some(Some((a, None))), + _ => frames.contains(&a).then_some(None), + }); + let Some(owner) = owner else { + self.warn("slot layers without a matching slot property were imported as frames"); + continue; + }; + let Some((main, inst)) = owner else { continue }; + let Some(NodeKind::Component { props, .. }) = self.doc.node(main).map(|n| &n.kind) else { continue }; + let defs: Vec<&String> = props.iter().filter(|(_, d)| matches!(d, PropDef::Slot { .. })).map(|(k, _)| k).collect(); + let layer = text(j, "name").unwrap_or_default(); + let refs: Vec<&str> = + j.get("componentPropertyReferences").and_then(Value::as_object).into_iter().flatten().filter_map(|(_, v)| v.as_str()).collect(); + // An instance's slot is matched against all of its main's slot properties. + let free: Vec<&&String> = defs.iter().filter(|d| inst.is_some() || !bound.contains(&(main, (**d).clone()))).collect(); + let name = defs + .iter() + .find(|d| refs.contains(&d.as_str())) + .or_else(|| defs.iter().find(|d| short_prop_name(d) == layer)) + .or_else(|| if free.len() == 1 { free.first().copied() } else { None }) + .map(|d| (*d).clone()); + let Some(n) = self.doc.node(id) else { continue }; + let has_content = !n.children.is_empty(); + let Some(inst) = inst else { + match name.filter(|p| bound.insert((main, p.clone()))) { + Some(p) => { + if let Some(n) = self.doc.node_mut(id) { + n.prop_refs.insert("slot".into(), p); + } + } + None => self.warn("slot layers without a matching slot property were imported as frames"), + } + continue; + }; + let set = self.doc.node(main).and_then(|n| n.parent); + let default = + name.as_ref().and_then(|p| [Some(main), set].into_iter().flatten().find_map(|o| self.slot_defaults.get(&(o, p.clone())).copied())); + let value = name.as_ref().and_then(|p| inst.get("componentProperties")?.get(p)?.get("value")); + let own = name.is_some() + && match (value, default) { + (Some(v), Some(d)) => v != d, + _ => has_content, + }; + if own && let Some(n) = self.doc.node_mut(id) { + n.overrides.insert("slot".into()); + } + } + } + /// An instance's property values (variant values are implied by the main it shows). fn instance_props(&self, j: &Value) -> BTreeMap { let mut out = BTreeMap::new(); diff --git a/crates/format/src/rest/slot_tests.rs b/crates/format/src/rest/slot_tests.rs new file mode 100644 index 000000000..d85d15c62 --- /dev/null +++ b/crates/format/src/rest/slot_tests.rs @@ -0,0 +1,229 @@ +//! `SLOT` layers of the REST file JSON: bound to their slot property in a main component, and +//! holding each instance's own content (synthetic files). + +use super::*; +use serde_json::json; + +fn at(x: f64, y: f64) -> Value { + json!([[1, 0, x], [0, 1, y]]) +} + +pub(crate) fn file(children: Value) -> Value { + json!({"name": "Slots", "schemaVersion": 0, "document": {"id": "0:0", "name": "Document", "type": "DOCUMENT", "children": [ + {"id": "0:1", "name": "Page", "type": "CANVAS", "children": children} + ]}}) +} + +fn content_id(local: u32) -> Value { + json!({"guid": {"sessionID": 5, "localID": local}}) +} + +fn slot(id: &str, name: &str, children: Value) -> Value { + json!({"id": id, "name": name, "type": "SLOT", "relativeTransform": at(10.0, 40.0), "size": {"x": 280, "y": 100}, "children": children}) +} + +fn label(id: &str, text: &str) -> Value { + json!({"id": id, "name": text, "type": "TEXT", "characters": text, "relativeTransform": at(0.0, 0.0), "size": {"x": 100, "y": 20}}) +} + +/// A "Chip" component (`1:9`), a "Container" component (`1:2`) with a "Title" text and an empty +/// "Slot" (property `Slot#1:3`, default content 5:1), and the given layers after them. +pub(crate) fn container_file(more: Vec) -> Value { + let mut layers = vec![ + json!({"id": "1:9", "name": "Chip", "type": "COMPONENT", "relativeTransform": at(0.0, 400.0), "size": {"x": 40, "y": 20}, "children": [ + {"id": "1:10", "name": "Dot", "type": "ELLIPSE", "relativeTransform": at(2.0, 2.0), "size": {"x": 16, "y": 16}} + ]}), + json!({"id": "1:2", "name": "Container", "type": "COMPONENT", "relativeTransform": at(0.0, 0.0), "size": {"x": 300, "y": 160}, + "componentPropertyDefinitions": {"Slot#1:3": {"type": "SLOT", "defaultValue": content_id(1)}}, + "children": [label("1:4", "Title"), slot("1:5", "Slot", json!([]))]}), + ]; + layers.extend(more); + file(Value::Array(layers)) +} + +/// An instance `id` of Container at `x` whose slot holds `content` (property value `value`). +pub(crate) fn container(id: &str, x: f64, value: Value, content: Value) -> Value { + json!({"id": id, "name": "Container", "type": "INSTANCE", "componentId": "1:2", "relativeTransform": at(x, 0.0), "size": {"x": 300, "y": 160}, + "componentProperties": {"Slot#1:3": {"type": "SLOT", "value": value}}, + "children": [label(&format!("I{id};1:4"), "Title"), slot(&format!("I{id};1:5"), "Slot", content)]}) +} + +pub(crate) fn chip(id: &str) -> Value { + json!({"id": id, "name": "Chip", "type": "INSTANCE", "componentId": "1:9", "relativeTransform": at(0.0, 30.0), "size": {"x": 40, "y": 20}, "children": [ + {"id": format!("I{id};1:10"), "name": "Dot", "type": "ELLIPSE", "relativeTransform": at(2.0, 2.0), "size": {"x": 16, "y": 16}} + ]}) +} + +fn by_rest<'d>(doc: &'d Document, v: &Value, rest: &str) -> &'d Node { + // Names repeat across copies: find by position in the file's tree instead. + fn path(v: &Value, rest: &str, out: &mut Vec) -> bool { + if v.get("id").and_then(Value::as_str) == Some(rest) { + return true; + } + for (i, c) in v.get("children").and_then(Value::as_array).into_iter().flatten().enumerate() { + out.push(i); + if path(c, rest, out) { + return true; + } + out.pop(); + } + false + } + let mut p = Vec::new(); + assert!(path(&v["document"]["children"][0], rest, &mut p), "no {rest} in the file"); + let mut id = doc.pages[0]; + for i in p { + id = doc.node(id).unwrap().children[i]; + } + doc.node(id).unwrap() +} + +fn names(doc: &Document, n: &Node) -> Vec { + n.children.iter().map(|c| doc.node(*c).unwrap().name.clone()).collect() +} + +#[test] +fn slot_layers_bind_to_their_property_and_keep_instance_content() { + let v = container_file(vec![ + container("2:1", 400.0, content_id(7), json!([label("2:2", "Reports in progress"), chip("2:3")])), + container("3:1", 800.0, content_id(1), json!([])), + ]); + let (doc, warnings) = import(&v, &no_images).unwrap(); + assert!(warnings.iter().all(|w| !w.contains("SLOT") && !w.contains("slot")), "{warnings:?}"); + + let main = by_rest(&doc, &v, "1:2"); + let NodeKind::Component { props, .. } = &main.kind else { panic!("{:?}", main.kind) }; + assert_eq!(props.get("Slot"), Some(&PropDef::Slot { preferred: Vec::new() }), "named without its #id suffix"); + let main_slot = by_rest(&doc, &v, "1:5"); + assert!(matches!(main_slot.kind, NodeKind::Frame)); + assert_eq!(main_slot.prop_refs.get("slot").map(String::as_str), Some("Slot")); + assert!(main_slot.children.is_empty(), "the main's slot stays empty"); + + let filled = by_rest(&doc, &v, "I2:1;1:5"); + assert!(filled.overrides.contains("slot"), "the instance's own content"); + assert!(filled.prop_refs.is_empty(), "an instance's slot follows its main's"); + assert_eq!(names(&doc, filled), ["Reports in progress", "Chip"]); + let chip = by_rest(&doc, &v, "2:3"); + assert!(matches!(chip.kind, NodeKind::Instance { .. }), "instances in slot content link to their own main"); + + let default = by_rest(&doc, &v, "I3:1;1:5"); + assert!(!default.overrides.contains("slot"), "the main's default content follows the main"); +} + +#[test] +fn slot_ownership_without_values_follows_the_content() { + let mut owned = container("2:1", 400.0, json!(null), json!([label("2:2", "Own")])); + owned["componentProperties"] = json!({}); + let mut empty = container("3:1", 800.0, json!(null), json!([])); + empty["componentProperties"] = json!({}); + let v = container_file(vec![owned, empty]); + let (doc, _) = import(&v, &no_images).unwrap(); + assert!(by_rest(&doc, &v, "I2:1;1:5").overrides.contains("slot")); + assert!(!by_rest(&doc, &v, "I3:1;1:5").overrides.contains("slot")); +} + +#[test] +fn slots_match_by_reference_then_name_then_the_one_left() { + let comp = json!({"id": "1:2", "name": "Card", "type": "COMPONENT", "relativeTransform": at(0.0, 0.0), "size": {"x": 300, "y": 300}, + "componentPropertyDefinitions": { + "Header#1:3": {"type": "SLOT", "defaultValue": content_id(1)}, + "Body#1:4": {"type": "SLOT", "defaultValue": content_id(2)}, + "Footer#1:5": {"type": "SLOT", "defaultValue": content_id(3)}, + "Visible#1:6": {"type": "BOOLEAN", "defaultValue": true} + }, + "children": [ + {"id": "1:7", "name": "Top", "type": "SLOT", "componentPropertyReferences": {"visible": "Visible#1:6", "slot": "Header#1:3"}, + "relativeTransform": at(0.0, 0.0), "size": {"x": 300, "y": 50}}, + {"id": "1:8", "name": "Body", "type": "SLOT", "relativeTransform": at(0.0, 50.0), "size": {"x": 300, "y": 50}}, + {"id": "1:9", "name": "Bottom", "type": "SLOT", "relativeTransform": at(0.0, 100.0), "size": {"x": 300, "y": 50}} + ]}); + let v = file(json!([comp])); + let (doc, warnings) = import(&v, &no_images).unwrap(); + assert!(warnings.is_empty(), "{warnings:?}"); + let bound = |rest: &str| by_rest(&doc, &v, rest).prop_refs.get("slot").cloned(); + assert_eq!(bound("1:7").as_deref(), Some("Header")); + assert_eq!(by_rest(&doc, &v, "1:7").prop_refs.get("visible").map(String::as_str), Some("Visible")); + assert_eq!(bound("1:8").as_deref(), Some("Body")); + assert_eq!(bound("1:9").as_deref(), Some("Footer")); +} + +#[test] +fn variants_share_their_set_slot_property() { + let variant = |id: &str, name: &str, x: f64| { + json!({"id": id, "name": name, "type": "COMPONENT", "relativeTransform": at(x, 0.0), "size": {"x": 100, "y": 100}, + "children": [slot(&format!("{id}s"), "Content", json!([]))]}) + }; + let set = json!({"id": "1:1", "name": "Panel", "type": "COMPONENT_SET", "relativeTransform": at(0.0, 0.0), "size": {"x": 300, "y": 100}, + "componentPropertyDefinitions": {"Size": {"type": "VARIANT", "defaultValue": "Small"}, "Content#2:1": {"type": "SLOT", "defaultValue": content_id(1)}}, + "children": [variant("1:2", "Size=Small", 0.0), variant("1:3", "Size=Large", 150.0)]}); + let inst = json!({"id": "4:1", "name": "Panel", "type": "INSTANCE", "componentId": "1:3", "relativeTransform": at(0.0, 300.0), "size": {"x": 100, "y": 100}, + "componentProperties": {"Content#2:1": {"type": "SLOT", "value": content_id(9)}}, + "children": [slot("I4:1;1:3s", "Content", json!([label("4:2", "Mine")]))]}); + let v = file(json!([set, inst])); + let (doc, warnings) = import(&v, &no_images).unwrap(); + assert!(warnings.is_empty(), "{warnings:?}"); + for rest in ["1:2s", "1:3s"] { + assert_eq!(by_rest(&doc, &v, rest).prop_refs.get("slot").map(String::as_str), Some("Content"), "{rest}"); + } + assert!(by_rest(&doc, &v, "I4:1;1:3s").overrides.contains("slot")); +} + +#[test] +fn nested_instances_own_the_slots_of_their_main() { + // A "Screen" main places a Container whose slot holds a chip; an instance of Screen places + // other content in that nested slot. + let screen = json!({"id": "6:1", "name": "Screen", "type": "COMPONENT", "relativeTransform": at(0.0, 600.0), "size": {"x": 300, "y": 160}, + "children": [container("6:2", 0.0, content_id(7), json!([chip("6:3")]))]}); + let nested = container("I7:1;6:2", 0.0, content_id(8), json!([label("7:2", "Other")])); + let outer = json!({"id": "7:1", "name": "Screen", "type": "INSTANCE", "componentId": "6:1", "relativeTransform": at(400.0, 600.0), "size": {"x": 300, "y": 160}, + "children": [nested]}); + let v = container_file(vec![screen, outer]); + let (doc, _) = import(&v, &no_images).unwrap(); + let in_main = by_rest(&doc, &v, "I6:2;1:5"); + assert!(in_main.overrides.contains("slot") && in_main.prop_refs.is_empty()); + assert!(matches!(by_rest(&doc, &v, "6:3").kind, NodeKind::Instance { .. })); + let in_outer = by_rest(&doc, &v, "II7:1;6:2;1:5"); + assert!(in_outer.overrides.contains("slot")); + assert_eq!(names(&doc, in_outer), ["Other"]); +} + +#[test] +fn slots_outside_components_or_without_a_property_stay_frames() { + let mut no_def = container_file(Vec::new()); + no_def["document"]["children"][0]["children"][1].as_object_mut().unwrap().remove("componentPropertyDefinitions"); + let loose = slot("8:1", "Loose", json!([label("8:2", "Kept")])); + no_def["document"]["children"][0]["children"].as_array_mut().unwrap().push(loose); + let (doc, warnings) = import(&no_def, &no_images).unwrap(); + assert!(warnings.iter().any(|w| w.starts_with("slot layers without a matching slot property were imported as frames (×2)")), "{warnings:?}"); + let kept = by_rest(&doc, &no_def, "8:1"); + assert!(matches!(kept.kind, NodeKind::Frame) && kept.prop_refs.is_empty()); + assert_eq!(names(&doc, kept), ["Kept"]); + assert!(by_rest(&doc, &no_def, "1:5").prop_refs.is_empty()); +} + +#[test] +fn slot_settings_the_editor_cannot_keep_are_noted() { + let mut v = container_file(Vec::new()); + v["document"]["children"][0]["children"][1]["componentPropertyDefinitions"]["Slot#1:3"]["slotSettings"] = + json!({"stretchChildOnInsert": true, "displayEmptyByDefault": true, "minChildren": null, "maxChildren": 3}); + v["document"]["children"][0]["children"][1]["componentPropertyDefinitions"]["Slot#1:3"]["preferredValues"] = + json!([{"type": "COMPONENT", "key": "abc"}]); + let (_, warnings) = import(&v, &no_images).unwrap(); + assert!(warnings.iter().any(|w| w == "non-default slot settings are not represented and were skipped"), "{warnings:?}"); + assert!(warnings.iter().any(|w| w == "preferred slot component keys cannot be resolved to file nodes and were skipped"), "{warnings:?}"); + let mut plain = container_file(Vec::new()); + plain["document"]["children"][0]["children"][1]["componentPropertyDefinitions"]["Slot#1:3"]["slotSettings"] = + json!({"stretchChildOnInsert": true, "minChildren": null, "maxChildren": null, "allowPreferredValuesOnly": false}); + assert!(import(&plain, &no_images).unwrap().1.is_empty()); +} + +#[test] +fn junk_slot_json_never_panics() { + for junk in [json!(null), json!(1), json!("x"), json!([]), json!({"guid": null}), json!({"type": "SLOT"})] { + let mut v = container_file(vec![container("2:1", 400.0, junk.clone(), json!([label("2:2", "A")]))]); + v["document"]["children"][0]["children"][1]["componentPropertyDefinitions"]["Slot#1:3"] = + json!({"type": "SLOT", "defaultValue": junk.clone(), "slotSettings": junk.clone(), "preferredValues": junk.clone()}); + v["document"]["children"][0]["children"][1]["children"][1]["componentPropertyReferences"] = json!({"slot": junk}); + assert!(import(&v, &no_images).is_ok()); + } +} diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index c015e1b54..17f6b4c5f 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -1625,6 +1625,7 @@ name = "English" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" "slot content assignment target is missing or is not slot content" = "slot content assignment target is missing or is not slot content" "slot content assignment uses the empty GUID sentinel and was skipped" = "slot content assignment uses the empty GUID sentinel and was skipped" +"slot layers without a matching slot property were imported as frames" = "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 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" = "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" = "stale or invalid grid track sizing entries were ignored" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 479172678..d054e2223 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -1626,6 +1626,7 @@ status = "draft — needs native review" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "se omitieron las acciones «Establecer modo de variable» sobre colecciones o modos que no están en el JSON de variables" "slot content assignment target is missing or is not slot content" = "el destino de la asignación de contenido de ranura falta o no es contenido de ranura" "slot content assignment uses the empty GUID sentinel and was skipped" = "la asignación de contenido de ranura usa el GUID vacío como centinela y se omitió" +"slot layers without a matching slot property were imported as frames" = "las capas de ranura sin una propiedad de ranura correspondiente se importaron como marcos" "some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "algunos puntos vectoriales hacen referencia a ajustes de punto que faltan en el archivo; usan las uniones de la capa y esquinas simples" "some vector segments refer to style settings missing from the file; they use the layer's stroke" = "algunos segmentos vectoriales hacen referencia a ajustes de estilo que faltan en el archivo; usan el trazo de la capa" "stale or invalid grid track sizing entries were ignored" = "se ignoraron las entradas de tamaño de pista de cuadrícula obsoletas o no válidas" diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index b65f77292..adf0b0f2c 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (REST import reads grid track sizes (#465); `.fig` import fidelity from the community batches, budgets for large files, the import report, a `.fig` copy from Save as, paste from another design app; instance layers' size and resizing and Hug on import (#731, #732); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (REST import keeps slot layers and instances' slot content (#792); REST import reads grid track sizes (#465); `.fig` import fidelity from the community batches, budgets for large files, the import report, a `.fig` copy from Save as, paste from another design app; instance layers' size and resizing and Hug on import (#731, #732); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) Every format Figma reads or writes, with FigCraft's support. Sources: `Info.plist` of `/Applications/Figma.app` (document types only; nothing inside the bundle's code was read), Figma's @@ -19,7 +19,7 @@ and prototype interactions are still unchecked there. |---|---|---|---|---|---| | `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included; a flow that records no primary-axis sizing hugs on that axis, an instance that records no auto layout has its main's), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Since 2026-10-17 (community batches #727, #728): an instance's own identity and the cached library components a file carries, overrides applied by key and order, local text values and instance overrides over a shared text style, grid track sizes (fixed, content-sized, fill), slot content, labels of connectors saved with their drawn path (a static snapshot; the ends aren't live), skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, editable text on a path, image adjustments and images carried in the message. Budgets come from the file's own size (one value per compressed byte, 20M–128M, lower ceilings on 32-bit targets; the layer cap follows), so a 15.4 MB synthetic file with 300,000 layers opens whole; the file's bytes stay out of the command journal; an import report lists what was left out or changed once the file opens. Not read: elbowed or curved connectors without a saved path (drawn straight) and labels of connectors without a saved snapshot, table cells beyond their own layers, filled areas with their own fills, variables bound to fields the editor can't bind, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs` and the per-feature `*_tests.rs` beside them, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | -| REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout (sizing modes left out read as hug, as documented; grid track sizes from `gridColumnsSizing` / `gridRowsSizing`: px, fr, auto, `minmax(0, 1fr)`, `repeat()`), constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings, image adjustments (the same tint sign as `.fig`); the import report after opening; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | +| REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout (sizing modes left out read as hug, as documented; grid track sizes from `gridColumnsSizing` / `gridRowsSizing`: px, fr, auto, `minmax(0, 1fr)`, `repeat()`), constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, slots (`SLOT` layers bound to their slot property; an instance's slot keeps its content as the instance's own unless its property value is the main's default content; slot limits and preferred components are warnings), styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings, image adjustments (the same tint sign as `.fig`); the import report after opening; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | | Local library files | team libraries in the cloud | yes (enable a `.figcraft` as a library) | yes (publish) | per-asset versions, updates with overrides kept | see [collaboration-parity](collaboration-parity.md) | @@ -165,6 +165,7 @@ each. | Date | Change | Summary | |---|---|---| +| 2026-10-18 | minor | REST file JSON import keeps `SLOT` layers (#792): they were dropped with everything placed in them, which emptied every instance's slot. A slot in a main component becomes a slot frame bound to its `SLOT` property (the one it references, else the one named like it, else the only one left), and an instance's slot holds the instance's own content, kept across syncs, moves of the mains and saving, unless the instance's property value is the main's default content (without values, a slot that holds layers keeps them). Instances in slot content link to their own mains. Slot content limits, preferred-only and preferred components are warnings. Synthetic files only. Numbers unchanged | | 2026-10-17 | minor | REST file JSON import reads grid track sizes from the CSS track strings `gridColumnsSizing` / `gridRowsSizing` (fixed px, fill fr, hug `auto`, `minmax(0, 1fr)`, `repeat()`; other tracks stay equal) (#465). Numbers unchanged | | 2026-10-17 | minor | The community batches #727 and #728 in the `.fig` row: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments (also REST), images in the message; budgets from the file's size; the journal keeps no file bytes; the import report. Not read cut to what's left. A `.fig` copy from Save as. Pasted content: layers copied from another design app, best effort (tested only with clipboard HTML made from our own export), and images under Wayland (not run there). All on synthetic files: summary and hours unchanged | | 2026-10-17 | minor | Hug on import (#732): auto layout frames a `.fig` records no primary-axis sizing for hug on that axis (auto layout sized that axis by its content before it could be fixed) instead of turning fixed, instances that record no auto layout take their main's (they came in without auto layout and fixed, so longer text overflowed them), REST frames whose sizing modes are left out hug (the documented default), and text hugs by its resize mode (auto width both axes, auto height its height; it came in fixed). Numbers unchanged | From 13fdae3d44ea27780c2e273d4aa65d9b3379b59c Mon Sep 17 00:00:00 2001 From: Ashsajal Date: Sun, 18 Oct 2026 14:55:12 +0600 Subject: [PATCH 246/817] M9: the other item lists merge one by item when a branch merges (gap 17) Fills, strokes and effects already merged item by item, so both sides changing different items of one of those lists was no conflict. Every other list conflicted as a whole: both sides editing different export settings, or different guides, or different prototype interactions, or different accessibility annotations or Dev Mode links, each had to be resolved by hand for the whole list, though the items stand on their own. Export settings, guides, prototype interactions, accessibility annotations and the Dev Mode code links and resources now merge item by item, with the same rule: the same item changed both ways, an item removed on one side, or different items added on both sides still conflict. Properties that are keyed maps rather than item lists (bound, varModes, overrides, propRefs, pluginData) are deliberately left out: their items line up by key, not by position. Text runs are left whole too: they live in the node's text data, so merging them item by item means splitting a property the change format keeps whole. Replaces the test that documented the gap (other_lists_still_conflict_as_a_whole) with one that checks each new list merges, and adds one for the same item changed both ways still conflicting. --- crates/collab/src/merge.rs | 27 +++++++++--- crates/collab/src/merge_list_tests.rs | 61 +++++++++++++++++++++++---- docs/collaboration-parity.md | 5 ++- docs/gaps.md | 11 ++++- 4 files changed, 86 insertions(+), 18 deletions(-) diff --git a/crates/collab/src/merge.rs b/crates/collab/src/merge.rs index bb18e661e..381b43934 100644 --- a/crates/collab/src/merge.rs +++ b/crates/collab/src/merge.rs @@ -4,10 +4,12 @@ //! //! A conflict is the same property (or document-level entry) changed on both sides to different //! values, or a layer deleted on one side while the other side edited it or something inside it -//! (including adding layers to it or moving layers into or out of it). Fills, strokes and effects -//! merge item by item: both sides changing different items of the list (or one adding items at its -//! end) is no conflict, only the same item changed both ways or the list shortened on a side -//! while the other changed it. Nothing that conflicts is +//! (including adding layers to it or moving layers into or out of it). The layer lists whose items +//! stand on their own (fills, strokes, effects, export settings, guides, prototype interactions, +//! accessibility annotations and the Dev Mode links and resources) merge item by item: both sides +//! changing different items of the list (or one adding items at its end) is no conflict, only the +//! same item changed both ways or the list shortened on a side while the other changed it. Nothing +//! that conflicts is //! merged until it is resolved: each conflict is resolved for one side, and the other side's //! changes to it are left out. Everything else from both sides is kept. @@ -159,8 +161,21 @@ fn by_key(changes: &[Change]) -> BTreeMap> { out } -/// List properties whose items merge one by one. -const PER_ITEM: &[Prop] = &[Prop::Fills, Prop::Strokes, Prop::Effects]; +/// List properties whose items merge one by item: the items stand on their own, so both sides +/// changing different ones (or one side adding at its end) is no conflict. Properties that are +/// keyed maps rather than item lists (`bound`, `varModes`, `overrides`, `propRefs`, `pluginData`) +/// are not here: their items line up by key, not by position. +const PER_ITEM: &[Prop] = &[ + Prop::Fills, + Prop::Strokes, + Prop::Effects, + Prop::Exports, + Prop::Guides, + Prop::Interactions, + Prop::Annotations, + Prop::CodeLinks, + Prop::DevResources, +]; /// Both sides' writes `b` and `m` of list property `key` merged item by item against the base /// (see [`merge_items`]); `None` when `key` isn't such a list or the writes conflict. diff --git a/crates/collab/src/merge_list_tests.rs b/crates/collab/src/merge_list_tests.rs index 436e6b6f3..8b2371458 100644 --- a/crates/collab/src/merge_list_tests.rs +++ b/crates/collab/src/merge_list_tests.rs @@ -1,5 +1,7 @@ -//! Fills, strokes and effects merge item by item: different items changed on each side merge, -//! the same item changed both ways conflicts. +//! The layer lists whose items stand on their own (fills, strokes, effects, export settings, +//! guides, prototype interactions, accessibility annotations, Dev Mode links and resources) merge +//! item by item: different items changed on each side merge, the same item changed both ways +//! conflicts. use figcraft_color::{Color, Paint}; use figcraft_doc::{Document, Effect, NodeId, NodeKind}; @@ -100,19 +102,60 @@ fn the_same_item_changed_both_ways_conflicts() { } #[test] -fn other_lists_still_conflict_as_a_whole() { - // Docs silent: lists other than fills, strokes and effects (export settings here) still - // conflict whole when both sides change them. +fn the_other_item_lists_merge_one_by_one_too() { + // Export settings, guides, prototype interactions, accessibility annotations and the Dev Mode + // links and resources are item lists like fills: both sides changing different items merges. let (mut base, _, _, r) = files(); let export = |suffix: &str| figcraft_doc::ExportSetting { suffix: suffix.into(), ..Default::default() }; - base.get_mut(r).unwrap().exports = vec![export("@1"), export("@2")]; + let guide = |vertical: bool, offset: f64| figcraft_doc::Guide { vertical, offset }; + let annot = |label: &str| figcraft_doc::Annotation { label: label.into(), properties: Vec::new(), category: None }; + let link = + |name: &str| figcraft_doc::CodeLink { language: "react".into(), import_path: String::new(), name: name.into(), template: String::new() }; + let res = |url: &str| figcraft_doc::DevResource { url: url.into(), name: String::new() }; + let n = base.get_mut(r).unwrap(); + n.exports = vec![export("@1"), export("@2")]; + n.guides = vec![guide(true, 10.0), guide(false, 20.0)]; + n.annotations = vec![annot("a1"), annot("a2")]; + n.code_links = vec![link("L1"), link("L2")]; + n.dev_resources = vec![res("https://a.test"), res("https://b.test")]; let (mut branch, mut main) = (base.clone(), base.clone()); branch.set_client_id(base.highest_id_space() + 1); - branch.get_mut(r).unwrap().exports[0] = export("@b"); - main.get_mut(r).unwrap().exports[1] = export("@m"); + // The branch changes the first item of each list; main the second. + let b = branch.get_mut(r).unwrap(); + (b.exports[0].suffix, b.guides[0].offset, b.annotations[0].label, b.code_links[0].name, b.dev_resources[0].url) = + ("@b".into(), 11.0, "b1".into(), "LB".into(), "https://branch.test".into()); + let m = main.get_mut(r).unwrap(); + (m.exports[1].suffix, m.guides[1].offset, m.annotations[1].label, m.code_links[1].name, m.dev_resources[1].url) = + ("@m".into(), 22.0, "m2".into(), "LM".into(), "https://main.test".into()); + both_ways(&base, &branch, &main, |doc| { + let n = doc.node(r).unwrap(); + let suffixes: Vec<&str> = n.exports.iter().map(|e| e.suffix.as_str()).collect(); + assert_eq!(suffixes, ["@b", "@m"], "export settings"); + let offsets: Vec = n.guides.iter().map(|g| g.offset).collect(); + assert_eq!(offsets, [11.0, 22.0], "guides"); + let labels: Vec<&str> = n.annotations.iter().map(|a| a.label.as_str()).collect(); + assert_eq!(labels, ["b1", "m2"], "annotations"); + let names: Vec<&str> = n.code_links.iter().map(|l| l.name.as_str()).collect(); + assert_eq!(names, ["LB", "LM"], "code links"); + let urls: Vec<&str> = n.dev_resources.iter().map(|d| d.url.as_str()).collect(); + assert_eq!(urls, ["https://branch.test", "https://main.test"], "dev resources"); + }); +} + +#[test] +fn the_same_item_of_another_list_changed_both_ways_conflicts() { + let (mut base, _, _, r) = files(); + base.get_mut(r).unwrap().exports = vec![ + figcraft_doc::ExportSetting { suffix: "@1".into(), ..Default::default() }, + figcraft_doc::ExportSetting { suffix: "@2".into(), ..Default::default() }, + ]; + let (mut branch, mut main) = (base.clone(), base.clone()); + branch.set_client_id(base.highest_id_space() + 1); + branch.get_mut(r).unwrap().exports[0].suffix = "@b".into(); + main.get_mut(r).unwrap().exports[0].suffix = "@m".into(); let p = plan(&base, &branch, &main).unwrap(); let keys: Vec = p.conflicts.iter().map(|c| c.key.to_string()).collect(); - assert_eq!(keys, [format!("{r}/exports")]); + assert_eq!(keys, [format!("{r}/exports")], "the same item changed both ways still conflicts"); } #[test] diff --git a/docs/collaboration-parity.md b/docs/collaboration-parity.md index ae503633d..920a96215 100644 --- a/docs/collaboration-parity.md +++ b/docs/collaboration-parity.md @@ -18,7 +18,7 @@ cursors, selections, text carets, cursor chat and spotlights shown live ([`colla | Share links, permissions (view / edit), teams and projects | yes | **partial**: sharing with a join code from the Share popover (online: the file goes to the server in Preferences and the server names its edit and view links with short codes; local network: the app hosts and the code carries its address; one field joins with a code or a link, in the popover and on the home screen; the browser build also joins from a link in its URL's fragment, `#join=…`, which never reaches the web host's logs, capped at 6 KiB and checked like a `figcraft://` link (#712; unit-tested, not run in a browser)); `figcraft-server` share links per file with edit or view access (a viewer sees changes and presence, a "View only" badge and only the moving tools; the server refuses its edits), revocable at once, tokens stored as hashes; managed from the app's Share popover (first links), the server's command line or a managing connection. On a server open to the public, whoever published a file manages it with its owner token (links, name, removal: `collab.manageFile`), which the app remembers: Home ▸ Online lists your online files (open again as owner, start and stop sharing, copy the code, rename, remove, forget), with one request per server for what became of them; anyone in a file can report it, and the operator blocks addresses. The person hosting a session, or a file's owner, removes someone from it (right-click their avatar, `collab.removePerson`): they are disconnected and their address can't join that file again while it runs. The list is per computer: no accounts, teams or projects | 8–17 | | Comments: pins on frames and layers, threads, reactions, @mentions, resolve, unread, search and filters, links, in the presenter | yes (shared) | **done, local**: stored in the file, your name from Preferences; a behaviour suite from the documentation (pinning and following layers, threads, own edits and deletes, mentions, reactions, C and Shift+C, stepping, filters, saving, copy and paste); restoring a version keeps them. In a live session threads sync and anyone in it can reply, react and resolve (no accounts: a name is who you are) | (shared once multiplayer lands) | | Version history: named versions, autosave checkpoints, view before restore, restore, duplicate | yes (cloud) | **done**, saved in the `.figcraft` file: restoring keeps the replaced design as an autosave first, a titled autosave becomes a named version, merging a branch records the file before and after. Versions are per person in a live session (a shared history needs accounts); no comparing two versions (Dev Mode compares a ready-for-dev layer with its state when marked) | — | -| Branching and merging | yes (paid plans) | **done, local**: branches saved in the `.figcraft` file, each opened in its own tab; Review and merge shows both sides' changes since the branch was made and the conflicts (the same property on both sides, or a layer deleted on one side and edited on the other), each resolved for the branch or main; merge as one undo step (the branch is archived, the main file's history gets a version for the merge), update from main, archive. Each branch keeps its own version history (saved, viewed and restored on the branch tab, kept when it is merged or archived); fills, strokes and effects merge item by item. Left: branches in live sessions; other lists (text runs, export settings) conflict as a whole | 1–2 | +| Branching and merging | yes (paid plans) | **done, local**: branches saved in the `.figcraft` file, each opened in its own tab; Review and merge shows both sides' changes since the branch was made and the conflicts (the same property on both sides, or a layer deleted on one side and edited on the other), each resolved for the branch or main; merge as one undo step (the branch is archived, the main file's history gets a version for the merge), update from main, archive. Each branch keeps its own version history (saved, viewed and restored on the branch tab, kept when it is merged or archived); fills, strokes, effects, export settings, guides, prototype interactions, accessibility annotations and the Dev Mode links and resources merge item by item. Left: branches in live sessions; text runs conflict as a whole | 1–2 | | Team / organization libraries | yes | **partial**: a file's library is published to `figcraft-server` under the file and enabled in other files by a share link (per-asset versions, background update checks, overrides kept), usage counts per component and file, swapping a library by names ([components-parity](components-parity.md), [server.md](server.md#team-libraries)). No team-wide library list, accounts or analytics over time | 4–8 | | Notifications, activity | yes | no | with sharing | @@ -35,6 +35,9 @@ cursors, selections, text carets, cursor chat and spotlights shown live ([`colla | 2026-10-12 | minor | Public `figcraft-server` hardened against resource exhaustion after a security review: messages capped by what a connection is for (a file's size when open), byte-bounded send queues and a bound on bytes waiting for the hub, files checked as they grow (refused batches roll back with the reason; per-address and total caps count growth), the core's recent-batch memory bounded in bytes, no confirmation for changes that couldn't be written, team libraries only in key-published files on public servers with unpacking bounded by the file cap, usage reports kept in memory, layered IPv6 limits (/64, /56, /48), a global publish rate, connections reserved for sessions, per-address download shares, library connections cut on revoke and removal, a private data directory and key, and safer install.sh, systemd and backups. Percentages and hours unchanged | | 2026-10-12 | minor | A public `figcraft-server` (open hosting): with `open_publish = true` anyone publishes a file without the server key and gets its edit and view links plus an owner token (128 bits, shown once, stored hashed) that lists, makes and revokes its links, renames it or removes it (`collab.manageFile`); limits per address (connections at once and a minute, messages a second, publishes an hour, files and MiB kept; IPv6 by /64; `X-Forwarded-For` believed only from `trusted_proxy`; tables capped at 10,000 addresses) and for everyone (`max_total_mb`), each refusal saying why; files published without the key expire after `idle_days` unopened (the date shown to everyone in the file); moderation (`files list --sort size|age|idle`, `block-ip`, `reports`, a Report button and `collab.report`); the operator's contact and terms shown in the Share dialog; `GET /healthz` on the same port; `packaging/server/install.sh` for a Debian/Ubuntu machine behind Caddy and a nightly backup timer. Protocol additions within version 2, gated like signals (older apps get clear refusals). Hosting infrastructure rather than a Figma feature: percentages and hours unchanged | | 2026-10-12 | minor | Cursor chat and spotlight in live sessions: `/` opens a chat bubble at your pointer that everyone sees as you type and that fades a few seconds after the last change (Enter sends, Escape takes it back, 100 characters, control characters dropped); your avatar's menu (or `collab.spotlight`) asks everyone to follow your view and page, latecomers included, until they move their own view. Both travel as signals: ephemeral presence the host validates, rate-limits (20 a second per person) and passes only to clients that announce they read them, so older clients keep working; never in the document or the log. Live cursors / follow / spotlight row partial → done, 8–15 h → 2–4 h; cursor chat row no → partial (no audio or reactions), 4–8 h → 2–5 h; multiplayer 45–90 h → 42–84 h (it counted these rows only in part); remaining 55–110 h (stale: team libraries had already gone to 4–8 h) → 46–92 h; collaboration ~13% unchanged at this rounding | +| Date | Change | Summary | +|---|---|---| +| 2026-10-18 | minor | Branch merge, gap 17: the layer lists whose items stand on their own merge item by item, not just fills, strokes and effects. Export settings, guides, prototype interactions, accessibility annotations and the Dev Mode code links and resources now merge item by item, each conflicting only when the same item changed on both sides, an item was removed on one side, or both sides added different items. Text runs are left whole (they live in the node's text data). Numbers unchanged | | 2026-10-12 | minor | A branch's own version history and finer list merges (gap 17): versions saved or autosaved on a branch tab go into the branch (viewed, restored, renamed, deleted and duplicated there, saved in the file with it); merging adds a version to the main file's history and the merged or archived branch keeps its own; fills, strokes and effects merge item by item, conflicting only when the same item changed both ways, an item was removed on one side or both sides added different items. Comments, versions, find, misc breadth 85% → 87%, ready 60% → 61%, 2–5 h → 1–4 h; gap 17 1–3 h → 1–2 h; feature breadth (~82%) and ready for real work (~51%) unchanged at this rounding; full parity ~306–595 h → ~305–594 h | | 2026-10-12 | minor | Comments and version history behaviour suite written from the public documentation (15 tests, about 80 table rows plus stepwise checks; 4 tests failed before the fixes) and its fixes: in a live session, threads made in the session couldn't be replied to, edited, reacted to, resolved, moved, deleted or opened (their ids, from their creator's id space, were refused as out of range); restoring a version brought back that version's comments, losing newer threads and replies (comments now stay, those on layers the version lacks staying where they were); restoring now keeps the replaced design in the history as an autosave first, unless a version of it was just saved or restored; giving an autosave a title makes it a named version (it could be dropped to make room); merging a branch adds the main file as it was and then a `Merged “”` version to its history. Pinned where the documentation is silent: pins go to the innermost frame under them, copies, duplicates and duplicated pages come without comments, replying reopens a resolved thread, versions stay with whoever saved them in a live session (a shared history needs accounts). Left: a branch's own version history, comparing two versions; percentages and hours unchanged here (comments and versions are graded with feature area 16 in target-app-parity) | | 2026-10-11 | minor | Hosting `figcraft-server`: the desktop app and `figcraft-cli` open `wss://` links (rustls with Mozilla's root certificates, always verified; `FIGCRAFT_CA_FILE` adds a private authority), releases ship the server for Linux x86_64 and aarch64, it stops gracefully on SIGTERM or Ctrl+C, and `docs/server.md` has a deployment guide (systemd unit, Caddy, nginx, Docker); percentages and hours unchanged until the next re-measure | diff --git a/docs/gaps.md b/docs/gaps.md index 9b1a770c1..dd42a75bf 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -397,8 +397,14 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe different items changed on each side, or items added at the end on one side, merge without a conflict; only the same item changed both ways, an item removed on one side, or different items added on both sides conflict (as the whole list). -- **Missing:** branches of a file in a live session are refused; other lists (text runs, export - settings, guides…) still conflict as a whole; the branch history has no entries of its own for +- **Landed (2026-10-18):** the other layer lists whose items stand on their own merge item by item + too: export settings, guides, prototype interactions, accessibility annotations and the Dev Mode + code links and resources, each with the same rule as fills (the same item changed both ways still + conflicts). Properties that are keyed maps rather than item lists (`bound`, `varModes`, + `overrides`, `propRefs`, `pluginData`) deliberately do not: their items line up by key. +- **Missing:** branches of a file in a live session are refused; text runs still conflict as a + whole (they live in the node's text data, so merging them means splitting a property the change + format keeps whole); the branch history has no entries of its own for its creation or updates from main (only saved versions, autosaves and the merge on main). - **Estimate:** 1–2 h. @@ -444,6 +450,7 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe | Date | Change | Summary | |---|---|---| +| 2026-10-18 | minor | Gap 17: export settings, guides, prototype interactions, accessibility annotations and the Dev Mode code links and resources merge item by item like fills, strokes and effects (the same item changed both ways still conflicts). Text runs are left whole: they live in the node's text data, so merging them means splitting a property the change format keeps whole. Ranking and hours unchanged | | 2026-10-17 | minor | The 2026-10-17 landings. Gap 1: a new Landed entry (community batches #727 and #728, then #745: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments, images in the message, instance layers' size and resizing overrides, Hug where nothing is recorded; budgets from the file's size; the import report; a `.fig` copy from Save as; paste from another design app), its Missing list cut to what is still left, and the wrong "whether other apps open its files is unknown" replaced by what was checked; all on synthetic files, so the beta blocker and hours stand. Gap 2: server limits, log recovery and web join links in the evidence. Gap 4: menus, the Actions palette and the editor fixes (#733, #735, #736, #729), then Selection colors and smart-selection spacing (#753) landed, none compared side by side. Gap 5: catalog counts re-measured (2,272 entries; drafts at 95–99%; Indonesian, Czech, Turkish and Swedish listed). Gap 8: the Linux and BSD clipboard changes and Wayland window controls, not run there by the maintainers. Ranking and hours unchanged | | 2026-10-15 | minor | Gap 7: bounded canvas overscan for smoother panning. Estimates and ranking unchanged. | | 2026-10-14 | minor | Russian catalog (M9), reviewed and approved by VanTan: all 2,165 current entries, Русский in Preferences and regional ru tags. Russian integer plurals use one/few/many; contributor display name VanTan added. Existing estimates unchanged. | From d7a27c593ed15ad3ea8654bce15971fde7ac0c23 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 16:13:34 +0700 Subject: [PATCH 247/817] #795: wait once at startup for held recovery folders, only on Unix Collect the folders whose lock is held, wait 100 ms once and retry only those, instead of up to 100 ms per held folder. Recovery::start takes its folder without waiting again (a held name already falls through to another). Windows doesn't pass the lock to child processes, so the wait and its test are Unix-only; the test holds the lock 10 ms against the 100 ms wait. --- apps/figcraft/src/recovery.rs | 46 ++++++++++++++++------------- apps/figcraft/src/recovery_tests.rs | 3 +- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/apps/figcraft/src/recovery.rs b/apps/figcraft/src/recovery.rs index 0ad97f0d7..06b0cbeb7 100644 --- a/apps/figcraft/src/recovery.rs +++ b/apps/figcraft/src/recovery.rs @@ -120,7 +120,7 @@ impl Recovery { (0..10).find_map(|n| { let dir = root.join(if n == 0 { pid.to_string() } else { format!("{pid}-{n}") }); std::fs::create_dir_all(&dir).ok()?; - let lock = lock_briefly(&dir.join(LOCK))?; + let lock = lock_folder(&dir).ok()?; Some(Self { dir, _lock: lock, written: HashMap::new(), next: 0.0, waiting: Vec::new() }) }) } @@ -292,25 +292,15 @@ fn remove_kept(w: Waiting) { /// The extension of the note beside the copy of a document that is one of your online files. const ONLINE: &str = "online"; -/// How long a folder's lock that frees itself is waited for, and between the tries. -const LOCK_WAIT: (usize, std::time::Duration) = (20, std::time::Duration::from_millis(5)); +/// How long the startup waits, once, for folder locks that may free themselves (#334). +#[cfg(unix)] +const LOCK_WAIT: std::time::Duration = std::time::Duration::from_millis(100); -/// Lock the folder's `file`, waiting briefly for a lock that frees itself. A child between its -/// `fork` and its `exec` inherits the run's open descriptors, and a `flock` lasts while any -/// descriptor for the file is open, so a run that has ended can look like one that is still going -/// for the length of that window. A run that really is running holds the lock for as long as it -/// runs, and we give up on it after [`LOCK_WAIT`] (#334). -fn lock_briefly(file: &Path) -> Option { - let lock = File::options().write(true).create(true).truncate(false).open(file).ok()?; - let (tries, pause) = LOCK_WAIT; - for _ in 0..tries { - match lock.try_lock() { - Ok(()) => return Some(lock), - Err(std::fs::TryLockError::WouldBlock) => std::thread::sleep(pause), - Err(_) => return None, - } - } - None +/// Lock the folder `dir` (`WouldBlock` while another process holds it). +fn lock_folder(dir: &Path) -> Result { + let lock = File::options().write(true).create(true).truncate(false).open(dir.join(LOCK)).map_err(std::fs::TryLockError::Error)?; + lock.try_lock()?; + Ok(lock) } /// The copy at `file` is of one of your online files: join that file again as its owner, keeping @@ -382,6 +372,7 @@ pub fn recover_all(root: &Path, s: &mut Session) -> Recovered { } } }; + let (mut free, mut held) = (Vec::new(), Vec::new()); for e in entries.flatten() { let path = e.path(); if !path.is_dir() { @@ -389,7 +380,22 @@ pub fn recover_all(root: &Path, s: &mut Session) -> Recovered { continue; } // Still running (another window of the app), or not ours to take. - let Some(lock) = lock_briefly(&path.join(LOCK)) else { continue }; + match lock_folder(&path) { + Ok(lock) => free.push((path, lock)), + Err(std::fs::TryLockError::WouldBlock) => held.push(path), + Err(_) => {} + } + } + // A child between its `fork` and its `exec` shares the run's open descriptors, and a `flock` + // lasts while any of them is open, so an ended run's folder can look held for a moment. Wait + // once, however many folders are held, and try those again (#334). Windows doesn't pass the + // lock to child processes. + #[cfg(unix)] + if !held.is_empty() { + std::thread::sleep(LOCK_WAIT); + free.extend(held.into_iter().filter_map(|path| lock_folder(&path).ok().map(|lock| (path, lock)))); + } + for (path, lock) in free { let lock = Arc::new(lock); let files: Vec = std::fs::read_dir(&path).into_iter().flatten().flatten().map(|f| f.path()).collect(); for f in &files { diff --git a/apps/figcraft/src/recovery_tests.rs b/apps/figcraft/src/recovery_tests.rs index c05e86d0b..0322e2374 100644 --- a/apps/figcraft/src/recovery_tests.rs +++ b/apps/figcraft/src/recovery_tests.rs @@ -206,6 +206,7 @@ fn a_run_whose_folder_name_is_still_held_takes_another() { /// #334: a lock that frees itself is not a run that is still going. A child between its `fork` and /// its `exec` inherits the run's open descriptors and a `flock` lasts while any descriptor for the /// file is open, so a crashed run's copies must still come back once that child has exec'd. +#[cfg(unix)] #[test] fn a_lock_freed_a_moment_later_is_not_a_run_that_is_still_going() { let root = root("fork-window"); @@ -215,7 +216,7 @@ fn a_lock_freed_a_moment_later_is_not_a_run_that_is_still_going() { let lock = std::fs::File::options().write(true).create(true).truncate(false).open(root.join("crashed").join("lock")).unwrap(); lock.try_lock().unwrap(); let freed = std::thread::spawn(move || { - std::thread::sleep(std::time::Duration::from_millis(40)); + std::thread::sleep(std::time::Duration::from_millis(10)); drop(lock); }); // The next start waits for that lock rather than reading the run as still going. From 8d3a3e617167ce1ad5f7e2374065f252ed494d79 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 16:13:41 +0700 Subject: [PATCH 248/817] #795: drop the hardware-parity revision row (test-only effect; the maintainer records it) --- docs/hardware-parity.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/hardware-parity.md b/docs/hardware-parity.md index 4780a0a85..df8229818 100644 --- a/docs/hardware-parity.md +++ b/docs/hardware-parity.md @@ -50,7 +50,6 @@ Nothing has been timed against Figma on the same document (needs `.fig` import). | Date | Change | Summary | |---|---|---| -| 2026-10-18 | minor | Recovery copies and the fork/exec window (#334): a child process forked before its `exec` (the `gsettings` read of the reduced-motion setting, any spawn) inherits the running app's open recovery-folder lock, and a `flock` lasts while any descriptor for the file is open. A crashed run whose lock was still held by such a child therefore read as "still running" and its unsaved documents were not recovered at the next start, and the desktop app's tests failed intermittently whenever another test spawned a process in parallel. Taking a folder's lock now waits briefly for one that frees itself, so only a run that is really running keeps its folder. No numbers changed | | 2026-10-18 | minor | macOS quit crash (#781): on Macs with a Touch Bar the app could crash as it quit (an exception in AppKit's Touch Bar support while the window's content view, which the accessibility adapter subclasses, was torn down). Quitting now keeps everything (preferences, this run's recovery copies, live sessions ended) and then ends the process before that teardown. Quit from the menu bar ends the app without the unsaved-changes question, so unsaved files' recovery copies now stay and reopen at the next start instead of being removed. Numbers unchanged | | 2026-10-17 | minor | Linux row: clipboard reads on Linux and the BSDs time out after 2 s on a helper thread, images copied in other apps paste under Wayland (arboard's data-control feature, #693), a minimised window can't be detected under Wayland, so frame-only control requests may still wait there (#720), and Wayland compositors without server-side decorations give the window Adwaita controls (#592, checked by its author on GNOME, not by the maintainers; KDE not run); compiled in CI, not run on a Linux desktop. HiDPI row: native-density canvas images placed on whole device pixels (#359, geometry tests; not judged by eye). Numbers unchanged | | 2026-10-14 | minor | Copy and paste in the browser: the web build never wrote to the system clipboard, so Cmd+V after Cmd+C pasted whatever text the clipboard held before (as a text layer) instead of the copied layers. Copies (layers, Copy as SVG/CSS/text/PNG, links) now go out through egui's output, which eframe writes during the copy event (`web_clipboard_tests`). Numbers unchanged. | From 6743c682031fa1636b8fbdb118b484e6fd1d1bdd Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 16:14:27 +0700 Subject: [PATCH 249/817] #794: drop the Finnish-only tests that pin wordings (the generic catalog tests cover fi) --- crates/ui-egui/src/i18n_tests.rs | 40 -------------------------------- 1 file changed, 40 deletions(-) diff --git a/crates/ui-egui/src/i18n_tests.rs b/crates/ui-egui/src/i18n_tests.rs index ea85ad32f..d4d81d7b9 100644 --- a/crates/ui-egui/src/i18n_tests.rs +++ b/crates/ui-egui/src/i18n_tests.rs @@ -8,46 +8,6 @@ use super::*; /// Languages that must translate every UI string and command label. const COMPLETE: &[&str] = &["es"]; -#[test] -fn finnish_locale_tags_and_integer_plurals() { - let fi = resolve("fi", None); - assert_eq!(LANGS[fi].code, "fi"); - assert_eq!(LANGS[fi].name, "Suomi"); - assert!(LANGS[fi].draft, "AI-assisted Finnish still needs human review"); - let mut session = figcraft_engine::Session::new(); - session.execute("pref.language", &serde_json::json!({"language":"fi"})).unwrap(); - let saved = serde_json::to_string(&session.prefs).unwrap(); - let restored: figcraft_engine::Prefs = serde_json::from_str(&saved).unwrap(); - assert_eq!(restored.language, "fi"); - for locale in ["fi-FI", "fi_FI.UTF-8", "FI-fi", "fi"] { - assert_eq!(resolve("system", Some(locale)), fi, "{locale}"); - } - for (count, expected) in [(0, "0 tasoa"), (1, "1 taso"), (2, "2 tasoa"), (21, "21 tasoa"), (101, "101 tasoa")] { - assert_eq!(fill(counted(fi, "{n} layers", count), &[("n", &count)]), expected); - } - assert_eq!(fill(counted(fi, "{n} minutes ago", 1), &[("n", &1)]), "1 minuutti sitten"); - assert_eq!(fill(counted(fi, "{n} minutes ago", 2), &[("n", &2)]), "2 minuuttia sitten"); - assert_eq!(fill(counted(fi, "{n} people joined", 2), &[("n", &2)]), "2 henkilöä liittyi"); -} - -#[test] -fn finnish_keeps_interpolated_names_and_context_specific_labels() { - let fi = resolve("fi", None); - let text = |key| match lookup(fi, key).unwrap() { - Text::Plain(s) => *s, - _ => panic!("expected a plain Finnish label: {key}"), - }; - assert_eq!(text("Cancel"), "Peruuta"); - assert_eq!(text("Fill"), "Täyttö"); - assert_eq!(text("Fill|sizing"), "Täytä"); - assert_eq!(text("Join|stroke"), "Liitos"); - assert_eq!(text("Open|comments"), "Avoin"); - assert_eq!(fill(text("Actions for {name}"), &[("name", &"File {1}.figcraft")]), "Kohteen File {1}.figcraft toiminnot"); - assert!(lookup(fi, "My layer {name}.svg").is_none()); - assert!(matches!(find(LANGS[fi].commands, "edit.undo"), Some(Text::Plain("Kumoa")))); - assert!(matches!(find(LANGS[fi].menu, "file.import"), Some(Text::Plain("Tuo tiedostosta…")))); -} - /// Keys looked up from data rather than written as `tr("…")` in the code: the main menu's /// submenu names (the engine's menu catalog) and labels of engine and document enums. fn dynamic_keys() -> BTreeSet { From ddd42b36bd09bc654f7a6daf70f534549b086baf Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 16:14:27 +0700 Subject: [PATCH 250/817] #794: list Finnish with the other catalogs in translating.md instead of a status paragraph --- docs/translating.md | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/docs/translating.md b/docs/translating.md index 3700bab4c..d8addcbc7 100644 --- a/docs/translating.md +++ b/docs/translating.md @@ -15,12 +15,12 @@ Simplified. `pref.language {language}` does the same from the CLI, MCP and the control channel. The catalogs: English (`en`, the source), and Spanish (`es`, with the Latin American overlay -`es-419`), French (`fr`), German (`de`), Dutch (`nl`), Brazilian Portuguese (`pt-BR`), Japanese (`ja`), -Korean (`ko`), Simplified Chinese (`zh-Hans`), Czech (`cs`) and Indonesian (`id`), machine-drafted -and waiting for native speakers' review. Russian (`ru`, Русский) was reviewed and approved by -VanTan; its catalog keeps Frame, Dev Mode 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. +`es-419`), French (`fr`), German (`de`), Dutch (`nl`), Brazilian Portuguese (`pt-BR`), Japanese +(`ja`), Korean (`ko`), Simplified Chinese (`zh-Hans`), Czech (`cs`), Indonesian (`id`) and Finnish +(`fi`), machine-drafted and waiting for native speakers' review. Russian (`ru`, Русский) was +reviewed and approved by VanTan; its catalog keeps Frame, Dev Mode 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. ## The catalogs @@ -68,18 +68,6 @@ language also needs its script in `cjk::language`. ## Adding a language -Finnish (`fi`, Suomi) is an AI-assisted draft awaiting native-speaker review. Its initial catalog -covers the current 1,729 English UI keys, 567 command labels and 31 menu-specific wordings, including -42 plural entries. Counts use singular only for 1 (`1 taso`, `0/2/21 tasoa`); this already follows -the default integer rule. Context keys distinguish paint `Fill` (Täyttö), sizing `Fill|sizing` -(Täytä), stroke `Join|stroke` (Liitos) and comment status `Open|comments` (Avoin). -The build discovers `fi.toml` automatically; `fi-FI` and `fi_FI.UTF-8` resolve to it. Product names, -code identifiers and shortcut notation retain their identity. Like the other unreviewed catalogs, -Finnish remains a draft outside `COMPLETE`; future English additions may fall back until translated. -Noise modes Mono/Duo/Multi describe one, two or many grain colours and read Yksivärinen, -Kaksivärinen and Monivärinen, independently of their stable enum names. -The narrow glass-effect light-intensity field uses Vahvuus so its complete label fits beside the value. - 1. Copy `crates/ui-egui/locales/es.toml` to `.toml` (a BCP 47 code: `fr`, `pt-BR`, `ja`) and set `[meta] name` and `status = "draft — needs native review"`. 2. Translate every value; keep the keys. Keep `{placeholders}` exactly, "…" where English has it, From d1125130f69c379a730a3d0bdb8b8cb70375c53f Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 16:14:45 +0700 Subject: [PATCH 251/817] #794: translate the slot-layers import note added on main --- crates/ui-egui/locales/fi.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/ui-egui/locales/fi.toml b/crates/ui-egui/locales/fi.toml index eb3ce94c2..602574d79 100644 --- a/crates/ui-egui/locales/fi.toml +++ b/crates/ui-egui/locales/fi.toml @@ -1627,6 +1627,7 @@ status = "draft — needs native review" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "muuttujatilan asetustoiminnot ohitettiin, koska kokoelmia tai tiloja ei ole muuttujien JSON-tiedostossa" "slot content assignment target is missing or is not slot content" = "sisältöpaikan määrityksen kohde puuttuu tai ei ole sisältöpaikan sisältöä" "slot content assignment uses the empty GUID sentinel and was skipped" = "sisältöpaikan määritys käyttää tyhjää GUID-erikoisarvoa, ja se ohitettiin" +"slot layers without a matching slot property were imported as frames" = "sisältöpaikkatasot, joilla ei ole vastaavaa sisältöpaikkaominaisuutta, tuotiin kehyksinä" "some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "jotkin vektoripisteet viittaavat tiedostosta puuttuviin pisteasetuksiin; ne käyttävät tason liitostyyliä ja tavallisia kulmia" "some vector segments refer to style settings missing from the file; they use the layer's stroke" = "jotkin vektorisegmentit viittaavat tiedostosta puuttuviin tyyliasetuksiin; ne käyttävät tason reunaviivaa" "stale or invalid grid track sizing entries were ignored" = "vanhentuneet tai virheelliset ruudukon kokomääritykset ohitettiin" From be47f99534a9e900f68c7a6385ad11611fcd283e Mon Sep 17 00:00:00 2001 From: phonedu <135960865+phonedu@users.noreply.github.com> Date: Sun, 18 Oct 2026 17:23:44 +0800 Subject: [PATCH 252/817] M1: component sets keep the dashed canvas outline out of the document Node::new gave every component set a purple dashed stroke, so export and screenshot drew the editor frame into the image. Sets now start with no paint; the canvas draws the dashed frame itself, and files written by earlier versions lose exactly that stored decoration when opened. A stroke someone chose is kept. --- crates/doc/src/node.rs | 4 ++-- crates/engine/src/export_behaviour_tests.rs | 14 +++++++++++++ crates/format/src/large_tests.rs | 23 +++++++++++++++++++++ crates/format/src/lib.rs | 19 ++++++++++++++++- crates/ui-egui/src/canvas.rs | 7 +++++++ crates/ui-egui/src/canvas_fixes_tests.rs | 14 +++++++++++++ 6 files changed, 78 insertions(+), 3 deletions(-) diff --git a/crates/doc/src/node.rs b/crates/doc/src/node.rs index 00f7d5599..582cdb757 100644 --- a/crates/doc/src/node.rs +++ b/crates/doc/src/node.rs @@ -565,14 +565,14 @@ impl Node { NodeKind::Text(_) => vec![Paint::solid(Color::BLACK)], _ => vec![], }; + // A component set's purple dashed frame is editor chrome: the canvas draws it, and it is + // never a stroke in the document, so exports don't show it. let strokes = match &kind { NodeKind::Line => vec![Paint::solid(Color::BLACK)], - NodeKind::ComponentSet { .. } => vec![Paint::solid(Color::from_rgb8_const(0x97, 0x47, 0xFF))], _ => vec![], }; let stroke = match &kind { NodeKind::Line | NodeKind::Vector { .. } => StrokeProps { align: StrokeAlign::Center, ..Default::default() }, - NodeKind::ComponentSet { .. } => StrokeProps { dashes: vec![10.0, 5.0], ..Default::default() }, _ => StrokeProps::default(), }; let blend = if kind.is_container() { BlendMode::PassThrough } else { BlendMode::Normal }; diff --git a/crates/engine/src/export_behaviour_tests.rs b/crates/engine/src/export_behaviour_tests.rs index 6896ce3e0..e3652a19c 100644 --- a/crates/engine/src/export_behaviour_tests.rs +++ b/crates/engine/src/export_behaviour_tests.rs @@ -317,6 +317,20 @@ fn svg_export_options() { assert!(svg.contains("stroke-width=\"4\""), "an inside stroke on a rectangle simplifies too (the rectangle inset by half the weight)"); } +#[test] +fn a_component_sets_editor_outline_is_not_exported() { + let mut s = Session::new(); + let a = id(&ex(&mut s, "node.create", json!({"type": "component", "x": 0, "y": 0, "width": 100, "height": 40}))); + let b = id(&ex(&mut s, "node.create", json!({"type": "component", "x": 300, "y": 0, "width": 100, "height": 40}))); + let set = id(&ex(&mut s, "component.combineVariants", json!({"ids": [a, b]}))); + assert!(s.doc().unwrap().node(set).unwrap().strokes.is_empty(), "the purple dashed frame is editor chrome, not a stroke"); + let svg = text(&export(&mut s, json!({"ids": [set], "format": "svg"}))); + assert!(!svg.to_ascii_lowercase().contains("9747ff") && !svg.contains("stroke-dasharray"), "{svg}"); + let png = pixels(&export(&mut s, json!({"ids": [set]}))); + let purple = png.pixels().filter(|p| p[3] > 0 && p[0].abs_diff(0x97) < 24 && p[1].abs_diff(0x47) < 24 && p[2].abs_diff(0xFF) < 24).count(); + assert_eq!(purple, 0, "the exported set has no purple outline pixels"); +} + #[test] fn copy_as_png_svg_and_code() { let mut s = Session::new(); diff --git a/crates/format/src/large_tests.rs b/crates/format/src/large_tests.rs index 889074f18..45eaf27c9 100644 --- a/crates/format/src/large_tests.rs +++ b/crates/format/src/large_tests.rs @@ -186,6 +186,29 @@ fn files_with_every_field_spelled_out_still_open() { assert_same_doc(&d, &again); } +#[test] +fn a_component_sets_old_editor_outline_is_dropped_on_open() { + let mut d = Document::new("Sets"); + let page = d.first_page().unwrap(); + let old = d.create(page, NodeKind::ComponentSet { description: String::new() }, "Button", 0.0, 0.0, 100.0, 40.0).unwrap(); + let custom = d.create(page, NodeKind::ComponentSet { description: String::new() }, "Chip", 0.0, 80.0, 100.0, 40.0).unwrap(); + // As 0.6.0 wrote every set: the canvas's purple dashed outline stored as a real stroke. + let n = d.get_mut(old).unwrap(); + n.strokes = vec![Paint::solid(Color::from_rgb8_const(0x97, 0x47, 0xFF))]; + n.stroke.dashes = vec![10.0, 5.0]; + // A stroke someone chose is design content and stays. + let n = d.get_mut(custom).unwrap(); + n.strokes = vec![Paint::solid(Color::from_rgb8_const(0x11, 0x22, 0x33))]; + n.stroke.dashes = vec![1.0, 2.0]; + let text = serde_json::to_string(&to_json(&d).unwrap()).unwrap(); + let (back, _) = from_json(&text).unwrap(); + let old = back.node(old).unwrap(); + assert!(old.strokes.is_empty() && old.stroke.dashes.is_empty(), "the decoration is canvas chrome, not a document stroke"); + let custom = back.node(custom).unwrap(); + assert_eq!(custom.strokes.len(), 1, "a real stroke is not the decoration"); + assert_eq!(custom.stroke.dashes, vec![1.0, 2.0]); +} + #[test] fn the_header_is_read_on_its_own() { // A newer file is refused before its document is looked at, whatever the version's size. diff --git a/crates/format/src/lib.rs b/crates/format/src/lib.rs index 9f7e51bc4..93e67e5bb 100644 --- a/crates/format/src/lib.rs +++ b/crates/format/src/lib.rs @@ -28,7 +28,8 @@ use std::collections::{BTreeMap, BTreeSet}; use std::io::{Read, Seek, Write}; use std::sync::Arc; -use figcraft_doc::{Document, ImageData}; +use figcraft_doc::color::{Color, Paint}; +use figcraft_doc::{Document, ImageData, NodeKind}; use serde::de::{Deserializer, IgnoredAny, MapAccess, Visitor}; use serde::{Deserialize, Serialize, Serializer}; use serde_json::{Value, json}; @@ -309,6 +310,21 @@ impl<'de> Deserialize<'de> for Header { } } +/// Earlier versions gave every component set the purple dashed outline of the canvas as a real +/// stroke, so it exported with the set. New sets carry no paint; files written back then lose +/// exactly that decoration when opened, and the canvas draws the outline itself. +fn drop_component_set_decoration(doc: &mut Document) { + let decoration = Paint::solid(Color::from_rgb8_const(0x97, 0x47, 0xFF)); + let ids: Vec<_> = doc.nodes().filter(|n| matches!(n.kind, NodeKind::ComponentSet { .. })).map(|n| n.id).collect(); + for id in ids { + let Some(n) = doc.node_mut(id) else { continue }; + if n.strokes.len() == 1 && n.strokes.first() == Some(&decoration) && n.stroke.dashes.as_slice() == [10.0, 5.0] { + n.strokes.clear(); + n.stroke.dashes.clear(); + } + } +} + /// Parse `document.json` content; also returns its [`ImageIndex`]. The header is checked first /// (a newer file is refused before its document is read), then the document is deserialized /// straight from the text. @@ -321,6 +337,7 @@ fn parse_json(text: &str) -> Result<(Document, Vec, ImageIndex), FormatE return Err(FormatError::Newer(u32::try_from(ver).unwrap_or(u32::MAX))); } let mut doc: Document = serde_json::from_str(text).map_err(corrupt)?; + drop_component_set_decoration(&mut doc); let issues = doc.validate(); if !issues.is_empty() { doc.repair(); diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 9e0c1d797..627fae565 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -936,6 +936,13 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ if labelled && let Some(q) = crate::frame_labels::draw(app, painter, t, &doc, *c, sel.contains(c), ds.hover == Some(*c)) { labels.push((*c, q.map(|p| app.to_page(p)))); } + // Component sets keep Figma's purple dashed frame on the canvas: editor chrome, not a + // document paint, so it never shows in an export. + if matches!(n.kind, NodeKind::ComponentSet { .. }) + && let Some(q) = node_quad(app, &doc, *c) + { + painter.add(Shape::dashed_line(&[q[0], q[1], q[2], q[3], q[0]], stroke(COMPONENT, 1.0), 4.0, 3.0)); + } } // Prototype connections. crate::proto_canvas::draw(app, painter); diff --git a/crates/ui-egui/src/canvas_fixes_tests.rs b/crates/ui-egui/src/canvas_fixes_tests.rs index 4cd32d565..bca1f4fbc 100644 --- a/crates/ui-egui/src/canvas_fixes_tests.rs +++ b/crates/ui-egui/src/canvas_fixes_tests.rs @@ -51,6 +51,20 @@ fn frame_outlines_and_slices_draw_when_shown() { assert!(!outlined(&shapes, quad(&u, inner)) && dashes_along(&shapes, sq[0], sq[1]) == 0, "both turn off again"); } +#[test] +fn component_sets_draw_their_editor_outline() { + let mut s = Session::new(); + let a = id(&s.execute("node.create", &json!({"type": "component", "x": 0, "y": 0, "width": 100, "height": 40})).unwrap()); + let b = id(&s.execute("node.create", &json!({"type": "component", "x": 200, "y": 0, "width": 100, "height": 40})).unwrap()); + let set = id(&s.execute("component.combineVariants", &json!({"ids": [a, b]})).unwrap()); + s.execute("select.set", &json!({"ids": []})).unwrap(); + assert!(s.doc().unwrap().node(set).unwrap().strokes.is_empty(), "the outline is not a document stroke"); + let mut u = Ui::new(s); + let q = crate::canvas::node_quad(&u.app, u.app.session.doc().unwrap(), set).unwrap(); + let shapes = flat(&u.frame_output(vec![]).shapes); + assert!(dashes_along(&shapes, q[0], q[1]) > 3, "the set shows its dashed outline"); +} + /// A job a few hundred milliseconds of rendering big. fn big_job(doc: &Arc, page: figcraft_doc::NodeId, scale: f64) -> crate::render_worker::Job { crate::render_worker::Job { From 911831fb89b0e380b513b0033fa5a37a6b0f573c Mon Sep 17 00:00:00 2001 From: phonedu <135960865+phonedu@users.noreply.github.com> Date: Sun, 18 Oct 2026 17:23:49 +0800 Subject: [PATCH 253/817] M1: vector.create scales its path to width/height A path's intrinsic box replaced the width and height asked for, so an icon imported at 24 stayed on its source grid. Scale the geometry to the requested size; with one side the other keeps its proportion. A path or point set that draws nothing is an error now, not an invisible 0x0 layer. --- crates/engine/src/cmd/create.rs | 59 +++++++++++++++++---- crates/engine/src/vector_behaviour_tests.rs | 25 +++++++++ 2 files changed, 75 insertions(+), 9 deletions(-) diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index 9b3f7067f..dedd1e493 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -73,9 +73,13 @@ pub fn specs() -> Vec { spec!("text.create", "Text", "{text, x, y, parent?, width? (fixed width wraps), props? (fontSize, fontFamily, …)}", true, |s, p| { create_kind(s, p, "text") }), - spec!("vector.create", "Vector", "{path (SVG path data) | points [[x,y],..], closed?, x?, y?, parent?, props?}", true, |s, p| create_kind( - s, p, "vector" - )), + spec!( + "vector.create", + "Vector", + "{path (SVG path data) | points [[x,y],..], closed?, x?, y?, width?, height? (scale the path; one keeps its proportion), parent?, props?}", + true, + |s, p| create_kind(s, p, "vector") + ), spec!( "image.place", "Place image", @@ -162,6 +166,27 @@ pub fn parse_path_data(d: &str) -> Option { figcraft_geom::BezPath::from_svg(d).ok() } +/// How much a vector's path is scaled to take the size asked for: with both sides, each scales +/// independently (as resizing a vector does); with one, the other keeps its proportion. +fn vector_scale(width: Option, height: Option, bw: f64, bh: f64) -> (f64, f64) { + let fit = |asked: Option, have: f64| match asked { + Some(a) if have > 1e-9 => a.max(0.0) / have, + _ => 1.0, + }; + match (width, height) { + (Some(_), Some(_)) => (fit(width, bw), fit(height, bh)), + (Some(_), None) => { + let s = fit(width, bw); + (s, s) + } + (None, Some(_)) => { + let s = fit(height, bh); + (s, s) + } + (None, None) => (1.0, 1.0), + } +} + pub fn create(s: &mut Session, p: &Value) -> Result { let cmd = "node.create"; let t = string(p, "type").ok_or_else(|| bad(cmd, "`type` is required"))?; @@ -187,20 +212,32 @@ pub fn create(s: &mut Session, p: &Value) -> Result { "Section" => (num_or(p, "width", 400.0), num_or(p, "height", 300.0)), _ => (num_or(p, "width", 100.0), num_or(p, "height", 100.0)), }; - // Vectors: path data or points define the shape and its box. + // Vectors: path data or points define the shape and its box. `width`/`height`, when asked + // for, scale the geometry: both sides independently, one side proportionally. let mut offset = (0.0, 0.0); + let asked = (num(p, "width"), num(p, "height")); if let NodeKind::Vector { network } = &mut kind { if let Some(d) = string(p, "path") { let mut path = parse_path_data(&d).ok_or_else(|| bad(cmd, "`path` is not valid SVG path data"))?; use figcraft_geom::Shape; let bb = path.bounding_box(); + if bb.width() <= 1e-9 && bb.height() <= 1e-9 { + return Err(bad(cmd, "`path` draws nothing: a vector needs a visible line or area")); + } path.apply_affine(figcraft_geom::Affine::translate((-bb.x0, -bb.y0))); + let (sx, sy) = vector_scale(asked.0, asked.1, bb.width(), bb.height()); + if sx != 1.0 || sy != 1.0 { + path.apply_affine(figcraft_geom::Affine::scale_non_uniform(sx, sy)); + } *network = VectorNetwork::from_path(&path); + if network.segments.is_empty() { + return Err(bad(cmd, "`path` draws nothing: a vector needs a visible line or area")); + } if boolean(p, "closed") == Some(false) { network.regions.clear(); } - w = bb.width(); - h = bb.height(); + w = bb.width() * sx; + h = bb.height() * sy; offset = (bb.x0, bb.y0); } else if let Some(Value::Array(pts)) = get(p, "points") { let pts: Vec = pts.iter().filter_map(|v| Some(Point::new(f64_of(v.get(0)?)?, f64_of(v.get(1)?)?))).collect(); @@ -208,10 +245,14 @@ pub fn create(s: &mut Session, p: &Value) -> Result { return Err(bad(cmd, "`points` needs at least two [x, y] pairs")); } let bb = figcraft_geom::points_bounds(pts.iter().copied()).unwrap_or_default(); - let local: Vec = pts.iter().map(|q| Point::new(q.x - bb.x0, q.y - bb.y0)).collect(); + if bb.width() <= 1e-9 && bb.height() <= 1e-9 { + return Err(bad(cmd, "`points` draws nothing: a vector needs a visible line or area")); + } + let (sx, sy) = vector_scale(asked.0, asked.1, bb.width(), bb.height()); + let local: Vec = pts.iter().map(|q| Point::new((q.x - bb.x0) * sx, (q.y - bb.y0) * sy)).collect(); *network = VectorNetwork::from_points(&local, boolean(p, "closed").unwrap_or(false)); - w = bb.width(); - h = bb.height(); + w = bb.width() * sx; + h = bb.height() * sy; offset = (bb.x0, bb.y0); } } diff --git a/crates/engine/src/vector_behaviour_tests.rs b/crates/engine/src/vector_behaviour_tests.rs index 8899dc4e0..042b3321a 100644 --- a/crates/engine/src/vector_behaviour_tests.rs +++ b/crates/engine/src/vector_behaviour_tests.rs @@ -439,3 +439,28 @@ fn bend_paint_bucket_cut_join_and_eraser_tools() { assert_eq!(net(&s, id).segments.len(), 2, "the eraser removes what it passes over"); assert_eq!(s.doc().unwrap().node(page).unwrap().children, vec![id], "and the pieces stay one layer"); } + +#[test] +fn vector_paths_take_the_requested_size_and_refuse_empty_geometry() { + let mut s = Session::new(); + let path = "M0 0 L24 0 L24 24 L0 24 Z"; + let intrinsic = id_of(&ex(&mut s, "vector.create", json!({"path": path}))["id"]).unwrap(); + let n = s.doc().unwrap().node(intrinsic).unwrap(); + assert_eq!((n.width, n.height), (24.0, 24.0), "a path without a size keeps its intrinsic box"); + // Both sides: each scales independently, like resizing a vector. + let both = id_of(&ex(&mut s, "vector.create", json!({"path": path, "width": 16, "height": 8}))["id"]).unwrap(); + let n = s.doc().unwrap().node(both).unwrap(); + assert_eq!((n.width, n.height), (16.0, 8.0)); + let n = net(&s, both); + let max = n.vertices.iter().fold((0.0f64, 0.0f64), |(x, y), v| (x.max(v.x), y.max(v.y))); + assert!((max.0 - 16.0).abs() < 1e-9 && (max.1 - 8.0).abs() < 1e-9, "{max:?}: the geometry itself is scaled"); + // One side: the other keeps its proportion. + let width = id_of(&ex(&mut s, "vector.create", json!({"path": path, "width": 16}))["id"]).unwrap(); + let n = s.doc().unwrap().node(width).unwrap(); + assert_eq!((n.width, n.height), (16.0, 16.0)); + // A path or point set that draws nothing is an error, not an invisible zero-size layer. + let e = s.execute("vector.create", &json!({"path": "M5 5"})).unwrap_err().to_string(); + assert!(e.contains("draws nothing"), "{e}"); + let e = s.execute("vector.create", &json!({"points": [[5, 5], [5, 5]]})).unwrap_err().to_string(); + assert!(e.contains("draws nothing"), "{e}"); +} From c87baa37cc4a6c6e3ab7ef48c65faf56db7de15f Mon Sep 17 00:00:00 2001 From: phonedu <135960865+phonedu@users.noreply.github.com> Date: Sun, 18 Oct 2026 17:48:51 +0800 Subject: [PATCH 254/817] docs: record the component set outline and vector size behaviour --- docs/components-parity.md | 1 + docs/mcp.md | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/docs/components-parity.md b/docs/components-parity.md index 2640ed1c0..8be233629 100644 --- a/docs/components-parity.md +++ b/docs/components-parity.md @@ -76,6 +76,7 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`. | Date | Change | Summary | |---|---|---| +| 2026-10-18 | minor | Component sets: the purple dashed frame is canvas chrome again. A new set carries no stroke, the canvas draws the outline, and exports and screenshots leave it out; a file written by 0.6.0 loses exactly that stored decoration when opened. A stroke someone chose stays. Numbers unchanged | | 2026-10-18 | minor | Variables import (#790): a `variables` map outside `meta` (or `meta.variables` next to top-level collections) is read, and an import that finds no variables, or fewer than the collections' `variableIds` list, says so in `warnings` instead of succeeding silently | | 2026-10-17 | minor | Variant properties reorder by dragging them in the Properties section, one undo step (#679; was "no drag in the panel yet"); a library file saved again right after it was read is read again, so a quick republish isn't missed (#652); the Hidden from publishing row no longer says the Hide when publishing item is missing (it landed 2026-10-12). Numbers unchanged | | 2026-10-17 | minor | Size and resizing overrides of layers inside instances (#731): a layer in an instance can hug, fill or keep a size of its own (group `resizing`: hug/fill/fixed with min and max; `size`), from the Layout panel, the canvas handles and `node.set`; they were refused, and imported ones were dropped at the first relayout. Kept through main edits of other properties, rebuilds, undo, save, `.fig` and REST import (sizes a `.fig` instance gives its layers and the REST `overrides` fields), `.fig` export and detach; reset per group and with Reset all changes (`instance_resizing_tests`). The row that listed them as not overridable was wrong. Numbers unchanged. | diff --git a/docs/mcp.md b/docs/mcp.md index 786fde0aa..caecf3724 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -426,6 +426,11 @@ on; `key` resolves keys the way the canvas does. Commands behind keys: ### Editing vectors +`vector.create {path | points}` makes the layer's box from the geometry; `width`/`height` scale +the geometry to the size asked for (with both, each side independently; with one, the other keeps +its proportion). A path or point set that draws nothing is refused instead of making an invisible +0×0 layer. + Vector edit mode is driven with `run_command` (or `pointer`/`key` for gestures): `vector.edit.begin {id? | ids?}` (default the selection; converts shapes to vectors; several layers are edited at once, the first active; `key` Enter with shapes selected does the same), From de2915908c94fe0ab707af9e6d1ce29d84f05cc8 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 17:01:02 +0700 Subject: [PATCH 255/817] #798: drop progress-doc edits (maintainer-owned) --- docs/collaboration-parity.md | 5 +---- docs/gaps.md | 11 ++--------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/docs/collaboration-parity.md b/docs/collaboration-parity.md index 920a96215..ae503633d 100644 --- a/docs/collaboration-parity.md +++ b/docs/collaboration-parity.md @@ -18,7 +18,7 @@ cursors, selections, text carets, cursor chat and spotlights shown live ([`colla | Share links, permissions (view / edit), teams and projects | yes | **partial**: sharing with a join code from the Share popover (online: the file goes to the server in Preferences and the server names its edit and view links with short codes; local network: the app hosts and the code carries its address; one field joins with a code or a link, in the popover and on the home screen; the browser build also joins from a link in its URL's fragment, `#join=…`, which never reaches the web host's logs, capped at 6 KiB and checked like a `figcraft://` link (#712; unit-tested, not run in a browser)); `figcraft-server` share links per file with edit or view access (a viewer sees changes and presence, a "View only" badge and only the moving tools; the server refuses its edits), revocable at once, tokens stored as hashes; managed from the app's Share popover (first links), the server's command line or a managing connection. On a server open to the public, whoever published a file manages it with its owner token (links, name, removal: `collab.manageFile`), which the app remembers: Home ▸ Online lists your online files (open again as owner, start and stop sharing, copy the code, rename, remove, forget), with one request per server for what became of them; anyone in a file can report it, and the operator blocks addresses. The person hosting a session, or a file's owner, removes someone from it (right-click their avatar, `collab.removePerson`): they are disconnected and their address can't join that file again while it runs. The list is per computer: no accounts, teams or projects | 8–17 | | Comments: pins on frames and layers, threads, reactions, @mentions, resolve, unread, search and filters, links, in the presenter | yes (shared) | **done, local**: stored in the file, your name from Preferences; a behaviour suite from the documentation (pinning and following layers, threads, own edits and deletes, mentions, reactions, C and Shift+C, stepping, filters, saving, copy and paste); restoring a version keeps them. In a live session threads sync and anyone in it can reply, react and resolve (no accounts: a name is who you are) | (shared once multiplayer lands) | | Version history: named versions, autosave checkpoints, view before restore, restore, duplicate | yes (cloud) | **done**, saved in the `.figcraft` file: restoring keeps the replaced design as an autosave first, a titled autosave becomes a named version, merging a branch records the file before and after. Versions are per person in a live session (a shared history needs accounts); no comparing two versions (Dev Mode compares a ready-for-dev layer with its state when marked) | — | -| Branching and merging | yes (paid plans) | **done, local**: branches saved in the `.figcraft` file, each opened in its own tab; Review and merge shows both sides' changes since the branch was made and the conflicts (the same property on both sides, or a layer deleted on one side and edited on the other), each resolved for the branch or main; merge as one undo step (the branch is archived, the main file's history gets a version for the merge), update from main, archive. Each branch keeps its own version history (saved, viewed and restored on the branch tab, kept when it is merged or archived); fills, strokes, effects, export settings, guides, prototype interactions, accessibility annotations and the Dev Mode links and resources merge item by item. Left: branches in live sessions; text runs conflict as a whole | 1–2 | +| Branching and merging | yes (paid plans) | **done, local**: branches saved in the `.figcraft` file, each opened in its own tab; Review and merge shows both sides' changes since the branch was made and the conflicts (the same property on both sides, or a layer deleted on one side and edited on the other), each resolved for the branch or main; merge as one undo step (the branch is archived, the main file's history gets a version for the merge), update from main, archive. Each branch keeps its own version history (saved, viewed and restored on the branch tab, kept when it is merged or archived); fills, strokes and effects merge item by item. Left: branches in live sessions; other lists (text runs, export settings) conflict as a whole | 1–2 | | Team / organization libraries | yes | **partial**: a file's library is published to `figcraft-server` under the file and enabled in other files by a share link (per-asset versions, background update checks, overrides kept), usage counts per component and file, swapping a library by names ([components-parity](components-parity.md), [server.md](server.md#team-libraries)). No team-wide library list, accounts or analytics over time | 4–8 | | Notifications, activity | yes | no | with sharing | @@ -35,9 +35,6 @@ cursors, selections, text carets, cursor chat and spotlights shown live ([`colla | 2026-10-12 | minor | Public `figcraft-server` hardened against resource exhaustion after a security review: messages capped by what a connection is for (a file's size when open), byte-bounded send queues and a bound on bytes waiting for the hub, files checked as they grow (refused batches roll back with the reason; per-address and total caps count growth), the core's recent-batch memory bounded in bytes, no confirmation for changes that couldn't be written, team libraries only in key-published files on public servers with unpacking bounded by the file cap, usage reports kept in memory, layered IPv6 limits (/64, /56, /48), a global publish rate, connections reserved for sessions, per-address download shares, library connections cut on revoke and removal, a private data directory and key, and safer install.sh, systemd and backups. Percentages and hours unchanged | | 2026-10-12 | minor | A public `figcraft-server` (open hosting): with `open_publish = true` anyone publishes a file without the server key and gets its edit and view links plus an owner token (128 bits, shown once, stored hashed) that lists, makes and revokes its links, renames it or removes it (`collab.manageFile`); limits per address (connections at once and a minute, messages a second, publishes an hour, files and MiB kept; IPv6 by /64; `X-Forwarded-For` believed only from `trusted_proxy`; tables capped at 10,000 addresses) and for everyone (`max_total_mb`), each refusal saying why; files published without the key expire after `idle_days` unopened (the date shown to everyone in the file); moderation (`files list --sort size|age|idle`, `block-ip`, `reports`, a Report button and `collab.report`); the operator's contact and terms shown in the Share dialog; `GET /healthz` on the same port; `packaging/server/install.sh` for a Debian/Ubuntu machine behind Caddy and a nightly backup timer. Protocol additions within version 2, gated like signals (older apps get clear refusals). Hosting infrastructure rather than a Figma feature: percentages and hours unchanged | | 2026-10-12 | minor | Cursor chat and spotlight in live sessions: `/` opens a chat bubble at your pointer that everyone sees as you type and that fades a few seconds after the last change (Enter sends, Escape takes it back, 100 characters, control characters dropped); your avatar's menu (or `collab.spotlight`) asks everyone to follow your view and page, latecomers included, until they move their own view. Both travel as signals: ephemeral presence the host validates, rate-limits (20 a second per person) and passes only to clients that announce they read them, so older clients keep working; never in the document or the log. Live cursors / follow / spotlight row partial → done, 8–15 h → 2–4 h; cursor chat row no → partial (no audio or reactions), 4–8 h → 2–5 h; multiplayer 45–90 h → 42–84 h (it counted these rows only in part); remaining 55–110 h (stale: team libraries had already gone to 4–8 h) → 46–92 h; collaboration ~13% unchanged at this rounding | -| Date | Change | Summary | -|---|---|---| -| 2026-10-18 | minor | Branch merge, gap 17: the layer lists whose items stand on their own merge item by item, not just fills, strokes and effects. Export settings, guides, prototype interactions, accessibility annotations and the Dev Mode code links and resources now merge item by item, each conflicting only when the same item changed on both sides, an item was removed on one side, or both sides added different items. Text runs are left whole (they live in the node's text data). Numbers unchanged | | 2026-10-12 | minor | A branch's own version history and finer list merges (gap 17): versions saved or autosaved on a branch tab go into the branch (viewed, restored, renamed, deleted and duplicated there, saved in the file with it); merging adds a version to the main file's history and the merged or archived branch keeps its own; fills, strokes and effects merge item by item, conflicting only when the same item changed both ways, an item was removed on one side or both sides added different items. Comments, versions, find, misc breadth 85% → 87%, ready 60% → 61%, 2–5 h → 1–4 h; gap 17 1–3 h → 1–2 h; feature breadth (~82%) and ready for real work (~51%) unchanged at this rounding; full parity ~306–595 h → ~305–594 h | | 2026-10-12 | minor | Comments and version history behaviour suite written from the public documentation (15 tests, about 80 table rows plus stepwise checks; 4 tests failed before the fixes) and its fixes: in a live session, threads made in the session couldn't be replied to, edited, reacted to, resolved, moved, deleted or opened (their ids, from their creator's id space, were refused as out of range); restoring a version brought back that version's comments, losing newer threads and replies (comments now stay, those on layers the version lacks staying where they were); restoring now keeps the replaced design in the history as an autosave first, unless a version of it was just saved or restored; giving an autosave a title makes it a named version (it could be dropped to make room); merging a branch adds the main file as it was and then a `Merged “”` version to its history. Pinned where the documentation is silent: pins go to the innermost frame under them, copies, duplicates and duplicated pages come without comments, replying reopens a resolved thread, versions stay with whoever saved them in a live session (a shared history needs accounts). Left: a branch's own version history, comparing two versions; percentages and hours unchanged here (comments and versions are graded with feature area 16 in target-app-parity) | | 2026-10-11 | minor | Hosting `figcraft-server`: the desktop app and `figcraft-cli` open `wss://` links (rustls with Mozilla's root certificates, always verified; `FIGCRAFT_CA_FILE` adds a private authority), releases ship the server for Linux x86_64 and aarch64, it stops gracefully on SIGTERM or Ctrl+C, and `docs/server.md` has a deployment guide (systemd unit, Caddy, nginx, Docker); percentages and hours unchanged until the next re-measure | diff --git a/docs/gaps.md b/docs/gaps.md index dd42a75bf..9b1a770c1 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -397,14 +397,8 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe different items changed on each side, or items added at the end on one side, merge without a conflict; only the same item changed both ways, an item removed on one side, or different items added on both sides conflict (as the whole list). -- **Landed (2026-10-18):** the other layer lists whose items stand on their own merge item by item - too: export settings, guides, prototype interactions, accessibility annotations and the Dev Mode - code links and resources, each with the same rule as fills (the same item changed both ways still - conflicts). Properties that are keyed maps rather than item lists (`bound`, `varModes`, - `overrides`, `propRefs`, `pluginData`) deliberately do not: their items line up by key. -- **Missing:** branches of a file in a live session are refused; text runs still conflict as a - whole (they live in the node's text data, so merging them means splitting a property the change - format keeps whole); the branch history has no entries of its own for +- **Missing:** branches of a file in a live session are refused; other lists (text runs, export + settings, guides…) still conflict as a whole; the branch history has no entries of its own for its creation or updates from main (only saved versions, autosaves and the merge on main). - **Estimate:** 1–2 h. @@ -450,7 +444,6 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe | Date | Change | Summary | |---|---|---| -| 2026-10-18 | minor | Gap 17: export settings, guides, prototype interactions, accessibility annotations and the Dev Mode code links and resources merge item by item like fills, strokes and effects (the same item changed both ways still conflicts). Text runs are left whole: they live in the node's text data, so merging them means splitting a property the change format keeps whole. Ranking and hours unchanged | | 2026-10-17 | minor | The 2026-10-17 landings. Gap 1: a new Landed entry (community batches #727 and #728, then #745: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments, images in the message, instance layers' size and resizing overrides, Hug where nothing is recorded; budgets from the file's size; the import report; a `.fig` copy from Save as; paste from another design app), its Missing list cut to what is still left, and the wrong "whether other apps open its files is unknown" replaced by what was checked; all on synthetic files, so the beta blocker and hours stand. Gap 2: server limits, log recovery and web join links in the evidence. Gap 4: menus, the Actions palette and the editor fixes (#733, #735, #736, #729), then Selection colors and smart-selection spacing (#753) landed, none compared side by side. Gap 5: catalog counts re-measured (2,272 entries; drafts at 95–99%; Indonesian, Czech, Turkish and Swedish listed). Gap 8: the Linux and BSD clipboard changes and Wayland window controls, not run there by the maintainers. Ranking and hours unchanged | | 2026-10-15 | minor | Gap 7: bounded canvas overscan for smoother panning. Estimates and ranking unchanged. | | 2026-10-14 | minor | Russian catalog (M9), reviewed and approved by VanTan: all 2,165 current entries, Русский in Preferences and regional ru tags. Russian integer plurals use one/few/many; contributor display name VanTan added. Existing estimates unchanged. | From a4c7e259abf38485434249551478f7a459ab17b6 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 17:01:02 +0700 Subject: [PATCH 256/817] #798: layout grids merge item by item, code links merge whole (keyed by language); fix stale doc comments --- crates/collab/src/change.rs | 5 +++-- crates/collab/src/merge.rs | 21 +++++++++++---------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/crates/collab/src/change.rs b/crates/collab/src/change.rs index 32a491843..0608ba67c 100644 --- a/crates/collab/src/change.rs +++ b/crates/collab/src/change.rs @@ -87,8 +87,9 @@ macro_rules! node_props { ($($variant:ident => $field:ident),* $(,)?) => { /// A node property: the tree position (`parent`, `position`) or one saved field of /// [`Node`]. List-valued fields (fills, text runs, vector networks…) are one property each, - /// replaced whole (three-way merges line fills, strokes and effects up item by item, see - /// [`merge`](crate::merge)). New properties go at the end (the binary form numbers them). + /// replaced whole (three-way merges line the lists whose items stand on their own, such as + /// fills, up item by item, see [`merge`](crate::merge)). New properties go at the end (the + /// binary form numbers them). #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub enum Prop { diff --git a/crates/collab/src/merge.rs b/crates/collab/src/merge.rs index 381b43934..5132ce75f 100644 --- a/crates/collab/src/merge.rs +++ b/crates/collab/src/merge.rs @@ -5,13 +5,12 @@ //! A conflict is the same property (or document-level entry) changed on both sides to different //! values, or a layer deleted on one side while the other side edited it or something inside it //! (including adding layers to it or moving layers into or out of it). The layer lists whose items -//! stand on their own (fills, strokes, effects, export settings, guides, prototype interactions, -//! accessibility annotations and the Dev Mode links and resources) merge item by item: both sides +//! stand on their own (fills, strokes, effects, layout grids, export settings, guides, prototype +//! interactions, accessibility annotations and Dev Mode resources) merge item by item: both sides //! changing different items of the list (or one adding items at its end) is no conflict, only the //! same item changed both ways or the list shortened on a side while the other changed it. Nothing -//! that conflicts is -//! merged until it is resolved: each conflict is resolved for one side, and the other side's -//! changes to it are left out. Everything else from both sides is kept. +//! that conflicts is merged until it is resolved: each conflict is resolved for one side, and the +//! other side's changes to it are left out. Everything else from both sides is kept. use std::collections::{BTreeMap, BTreeSet}; use std::fmt; @@ -161,19 +160,21 @@ fn by_key(changes: &[Change]) -> BTreeMap> { out } -/// List properties whose items merge one by item: the items stand on their own, so both sides -/// changing different ones (or one side adding at its end) is no conflict. Properties that are -/// keyed maps rather than item lists (`bound`, `varModes`, `overrides`, `propRefs`, `pluginData`) -/// are not here: their items line up by key, not by position. +/// List properties whose items merge one by one: the items stand on their own, so both sides +/// changing different ones (or one side adding at its end) is no conflict. Sets and keyed maps +/// (`bound`, `varModes`, `overrides`, `propRefs`, `pluginData`) are not here: their items line up +/// by key, not by position. const PER_ITEM: &[Prop] = &[ Prop::Fills, Prop::Strokes, Prop::Effects, + Prop::Grids, Prop::Exports, Prop::Guides, Prop::Interactions, Prop::Annotations, - Prop::CodeLinks, + // Not `CodeLinks`: there is one per language, and lining them up by position could leave two + // for one language (the second hidden), so they merge whole. Prop::DevResources, ]; From 53c8308b66072aad100eba6626da7b33d29a406e Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 17:01:03 +0700 Subject: [PATCH 257/817] #798: test layout grids, code links and interactions (add, change, delete, conflicts) --- crates/collab/src/merge_list_tests.rs | 89 +++++++++++++++++++++------ 1 file changed, 71 insertions(+), 18 deletions(-) diff --git a/crates/collab/src/merge_list_tests.rs b/crates/collab/src/merge_list_tests.rs index 8b2371458..e92f6bbbf 100644 --- a/crates/collab/src/merge_list_tests.rs +++ b/crates/collab/src/merge_list_tests.rs @@ -1,10 +1,10 @@ -//! The layer lists whose items stand on their own (fills, strokes, effects, export settings, -//! guides, prototype interactions, accessibility annotations, Dev Mode links and resources) merge -//! item by item: different items changed on each side merge, the same item changed both ways +//! The layer lists whose items stand on their own (fills, strokes, effects, layout grids, export +//! settings, guides, prototype interactions, accessibility annotations and Dev Mode resources) +//! merge item by item: different items changed on each side merge, the same item changed both ways //! conflicts. use figcraft_color::{Color, Paint}; -use figcraft_doc::{Document, Effect, NodeId, NodeKind}; +use figcraft_doc::{Document, Effect, LayoutGrid, NodeId, NodeKind, proto}; use serde_json::{Value, json}; use crate::merge::{Key, Side, merge_items, plan}; @@ -103,30 +103,29 @@ fn the_same_item_changed_both_ways_conflicts() { #[test] fn the_other_item_lists_merge_one_by_one_too() { - // Export settings, guides, prototype interactions, accessibility annotations and the Dev Mode - // links and resources are item lists like fills: both sides changing different items merges. + // Layout grids, export settings, guides, accessibility annotations and Dev Mode resources are + // item lists like fills: both sides changing different items merges. let (mut base, _, _, r) = files(); let export = |suffix: &str| figcraft_doc::ExportSetting { suffix: suffix.into(), ..Default::default() }; let guide = |vertical: bool, offset: f64| figcraft_doc::Guide { vertical, offset }; let annot = |label: &str| figcraft_doc::Annotation { label: label.into(), properties: Vec::new(), category: None }; - let link = - |name: &str| figcraft_doc::CodeLink { language: "react".into(), import_path: String::new(), name: name.into(), template: String::new() }; + let grid = |size: f64| LayoutGrid { size, ..Default::default() }; let res = |url: &str| figcraft_doc::DevResource { url: url.into(), name: String::new() }; let n = base.get_mut(r).unwrap(); n.exports = vec![export("@1"), export("@2")]; n.guides = vec![guide(true, 10.0), guide(false, 20.0)]; n.annotations = vec![annot("a1"), annot("a2")]; - n.code_links = vec![link("L1"), link("L2")]; + n.grids = vec![grid(10.0), grid(20.0)]; n.dev_resources = vec![res("https://a.test"), res("https://b.test")]; let (mut branch, mut main) = (base.clone(), base.clone()); branch.set_client_id(base.highest_id_space() + 1); // The branch changes the first item of each list; main the second. let b = branch.get_mut(r).unwrap(); - (b.exports[0].suffix, b.guides[0].offset, b.annotations[0].label, b.code_links[0].name, b.dev_resources[0].url) = - ("@b".into(), 11.0, "b1".into(), "LB".into(), "https://branch.test".into()); + (b.exports[0].suffix, b.guides[0].offset, b.annotations[0].label, b.grids[0].size, b.dev_resources[0].url) = + ("@b".into(), 11.0, "b1".into(), 12.0, "https://branch.test".into()); let m = main.get_mut(r).unwrap(); - (m.exports[1].suffix, m.guides[1].offset, m.annotations[1].label, m.code_links[1].name, m.dev_resources[1].url) = - ("@m".into(), 22.0, "m2".into(), "LM".into(), "https://main.test".into()); + (m.exports[1].suffix, m.guides[1].offset, m.annotations[1].label, m.grids[1].size, m.dev_resources[1].url) = + ("@m".into(), 22.0, "m2".into(), 24.0, "https://main.test".into()); both_ways(&base, &branch, &main, |doc| { let n = doc.node(r).unwrap(); let suffixes: Vec<&str> = n.exports.iter().map(|e| e.suffix.as_str()).collect(); @@ -135,8 +134,8 @@ fn the_other_item_lists_merge_one_by_one_too() { assert_eq!(offsets, [11.0, 22.0], "guides"); let labels: Vec<&str> = n.annotations.iter().map(|a| a.label.as_str()).collect(); assert_eq!(labels, ["b1", "m2"], "annotations"); - let names: Vec<&str> = n.code_links.iter().map(|l| l.name.as_str()).collect(); - assert_eq!(names, ["LB", "LM"], "code links"); + let sizes: Vec = n.grids.iter().map(|g| g.size).collect(); + assert_eq!(sizes, [12.0, 24.0], "layout grids"); let urls: Vec<&str> = n.dev_resources.iter().map(|d| d.url.as_str()).collect(); assert_eq!(urls, ["https://branch.test", "https://main.test"], "dev resources"); }); @@ -145,17 +144,71 @@ fn the_other_item_lists_merge_one_by_one_too() { #[test] fn the_same_item_of_another_list_changed_both_ways_conflicts() { let (mut base, _, _, r) = files(); - base.get_mut(r).unwrap().exports = vec![ + let link = |language: &str| figcraft_doc::CodeLink { language: language.into(), ..Default::default() }; + let n = base.get_mut(r).unwrap(); + n.exports = vec![ figcraft_doc::ExportSetting { suffix: "@1".into(), ..Default::default() }, figcraft_doc::ExportSetting { suffix: "@2".into(), ..Default::default() }, ]; + n.code_links = vec![link("react"), link("vue")]; let (mut branch, mut main) = (base.clone(), base.clone()); branch.set_client_id(base.highest_id_space() + 1); branch.get_mut(r).unwrap().exports[0].suffix = "@b".into(); main.get_mut(r).unwrap().exports[0].suffix = "@m".into(); + // Code links are one per language, not an item list: different links changed still conflict. + branch.get_mut(r).unwrap().code_links[0].name = "B".into(); + main.get_mut(r).unwrap().code_links[1].name = "M".into(); let p = plan(&base, &branch, &main).unwrap(); - let keys: Vec = p.conflicts.iter().map(|c| c.key.to_string()).collect(); - assert_eq!(keys, [format!("{r}/exports")], "the same item changed both ways still conflicts"); + let mut keys: Vec = p.conflicts.iter().map(|c| c.key.to_string()).collect(); + keys.sort(); + let mut want = [format!("{r}/codeLinks"), format!("{r}/exports")]; + want.sort(); + assert_eq!(keys, want); +} + +#[test] +fn interactions_merge_item_by_item() { + let ia = |duration_ms: u32| proto::Interaction { + trigger: Default::default(), + actions: vec![proto::Action::Back], + transition: Default::default(), + duration_ms, + easing: Default::default(), + delay_ms: 0, + }; + let durations = |doc: &Document, r: NodeId| doc.node(r).unwrap().interactions.iter().map(|i| i.duration_ms).collect::>(); + let (mut base, _, _, r) = files(); + base.get_mut(r).unwrap().interactions = vec![ia(100), ia(200)]; + let fork = || { + let (mut branch, main) = (base.clone(), base.clone()); + branch.set_client_id(base.highest_id_space() + 1); + (branch, main) + }; + // The branch changes the first interaction and adds one; main changes the second. + let (mut branch, mut main) = fork(); + branch.get_mut(r).unwrap().interactions[0].duration_ms = 150; + branch.get_mut(r).unwrap().interactions.push(ia(300)); + main.get_mut(r).unwrap().interactions[1].duration_ms = 250; + both_ways(&base, &branch, &main, |doc| assert_eq!(durations(doc, r), [150, 250, 300])); + // The branch deletes one while main leaves them alone. + let (mut branch, mut main) = fork(); + branch.get_mut(r).unwrap().interactions.remove(0); + main.get_mut(r).unwrap().fills[0] = red(); + both_ways(&base, &branch, &main, |doc| assert_eq!(durations(doc, r), [200])); + // The same interaction changed both ways, or one deleted while the other side changed the + // list, conflicts. + for delete in [false, true] { + let (mut branch, mut main) = fork(); + if delete { + branch.get_mut(r).unwrap().interactions.remove(0); + } else { + branch.get_mut(r).unwrap().interactions[1].duration_ms = 220; + } + main.get_mut(r).unwrap().interactions[1].duration_ms = 250; + let p = plan(&base, &branch, &main).unwrap(); + let keys: Vec = p.conflicts.iter().map(|c| c.key.to_string()).collect(); + assert_eq!(keys, [format!("{r}/interactions")], "delete: {delete}"); + } } #[test] From adb23f0ff19470f43bb7872be2409a117b6ef477 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 17:01:03 +0700 Subject: [PATCH 258/817] #798: branch.review docs name the lists that merge item by item --- docs/mcp.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/mcp.md b/docs/mcp.md index 786fde0aa..4f149503f 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -972,10 +972,11 @@ branches). Driven with `run_command`: name, property, branch, main, deletedBy?}]}`. `layers` are the changed layers with their property changes formatted like Inspect (`fill #2563EB → #DC2626`); `document` lists styles, variables, comments and file settings. A conflict is the same property changed on both sides to different - values (key `/`, e.g. `4/fills`; fills, strokes and effects compare item by - item, so changing different items of one list on each side, or adding items at its end on one - side, merges without a conflict; a layer's parent and position are one - property, `parent`), a layer deleted on one side while the other edited it or what's inside it + values (key `/`, e.g. `4/fills`; fills, strokes, effects, layout grids, + export settings, guides, prototype interactions, annotations and Dev Mode resources compare item + by item, so changing different items of one list on each side, or adding items at its end on one + side, merges without a conflict; other lists, such as code links, compare whole; a layer's parent + and position are one property, `parent`), a layer deleted on one side while the other edited it or what's inside it (`/layer`, with `deletedBy`), or a document-level entry or setting changed on both sides (`style/`, `variable/`, `comment/`, `doc/`…). - `branch.merge {id?, resolutions?}` merges the branch into the main file as one undo step, From aff3c4f18bec87927e86f0606bee9639f6f718d4 Mon Sep 17 00:00:00 2001 From: phonedu <135960865+phonedu@users.noreply.github.com> Date: Sun, 18 Oct 2026 18:22:48 +0800 Subject: [PATCH 259/817] M1: gate the outline migration on a marker and refuse impossible vector sizes Review follow-up. A file written by this version carries editorOutlines, so a stroke someone chose is kept even when it matches the old decoration; only files without the marker get the one-time legacy cleanup. vector.create now errors when a requested side cannot scale the geometry or when both axes would collapse, instead of creating an invisible layer. --- crates/engine/src/cmd/create.rs | 28 +++++++++++++-------- crates/engine/src/vector_behaviour_tests.rs | 8 ++++++ crates/format/src/large_tests.rs | 11 ++++++-- crates/format/src/lib.rs | 16 ++++++++++-- docs/mcp.md | 3 ++- 5 files changed, 50 insertions(+), 16 deletions(-) diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index dedd1e493..84fa419a1 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -167,24 +167,30 @@ pub fn parse_path_data(d: &str) -> Option { } /// How much a vector's path is scaled to take the size asked for: with both sides, each scales -/// independently (as resizing a vector does); with one, the other keeps its proportion. -fn vector_scale(width: Option, height: Option, bw: f64, bh: f64) -> (f64, f64) { - let fit = |asked: Option, have: f64| match asked { - Some(a) if have > 1e-9 => a.max(0.0) / have, - _ => 1.0, +/// independently (as resizing a vector does); with one, the other keeps its proportion. A size +/// asked for on an axis the geometry has none of is an error, not silently ignored. +fn vector_scale(width: Option, height: Option, bw: f64, bh: f64, what: &str) -> std::result::Result<(f64, f64), String> { + let fit = |asked: Option, have: f64, axis: &str| match asked { + Some(a) if have > 1e-9 => Ok(a.max(0.0) / have), + Some(_) => Err(format!("`{axis}` can't size {what} with no {} extent", if axis == "width" { "horizontal" } else { "vertical" })), + None => Ok(1.0), }; - match (width, height) { - (Some(_), Some(_)) => (fit(width, bw), fit(height, bh)), + let (sx, sy) = match (width, height) { + (Some(_), Some(_)) => (fit(width, bw, "width")?, fit(height, bh, "height")?), (Some(_), None) => { - let s = fit(width, bw); + let s = fit(width, bw, "width")?; (s, s) } (None, Some(_)) => { - let s = fit(height, bh); + let s = fit(height, bh, "height")?; (s, s) } (None, None) => (1.0, 1.0), + }; + if sx <= 0.0 && sy <= 0.0 { + return Err(format!("`width` and `height` would make {what} 0×0")); } + Ok((sx, sy)) } pub fn create(s: &mut Session, p: &Value) -> Result { @@ -225,7 +231,7 @@ pub fn create(s: &mut Session, p: &Value) -> Result { return Err(bad(cmd, "`path` draws nothing: a vector needs a visible line or area")); } path.apply_affine(figcraft_geom::Affine::translate((-bb.x0, -bb.y0))); - let (sx, sy) = vector_scale(asked.0, asked.1, bb.width(), bb.height()); + let (sx, sy) = vector_scale(asked.0, asked.1, bb.width(), bb.height(), "a path").map_err(|e| bad(cmd, e))?; if sx != 1.0 || sy != 1.0 { path.apply_affine(figcraft_geom::Affine::scale_non_uniform(sx, sy)); } @@ -248,7 +254,7 @@ pub fn create(s: &mut Session, p: &Value) -> Result { if bb.width() <= 1e-9 && bb.height() <= 1e-9 { return Err(bad(cmd, "`points` draws nothing: a vector needs a visible line or area")); } - let (sx, sy) = vector_scale(asked.0, asked.1, bb.width(), bb.height()); + let (sx, sy) = vector_scale(asked.0, asked.1, bb.width(), bb.height(), "a point set").map_err(|e| bad(cmd, e))?; let local: Vec = pts.iter().map(|q| Point::new((q.x - bb.x0) * sx, (q.y - bb.y0) * sy)).collect(); *network = VectorNetwork::from_points(&local, boolean(p, "closed").unwrap_or(false)); w = bb.width() * sx; diff --git a/crates/engine/src/vector_behaviour_tests.rs b/crates/engine/src/vector_behaviour_tests.rs index 042b3321a..35d610746 100644 --- a/crates/engine/src/vector_behaviour_tests.rs +++ b/crates/engine/src/vector_behaviour_tests.rs @@ -463,4 +463,12 @@ fn vector_paths_take_the_requested_size_and_refuse_empty_geometry() { assert!(e.contains("draws nothing"), "{e}"); let e = s.execute("vector.create", &json!({"points": [[5, 5], [5, 5]]})).unwrap_err().to_string(); assert!(e.contains("draws nothing"), "{e}"); + // A size on an axis the geometry has none of is refused, not silently ignored. + let e = s.execute("vector.create", &json!({"path": "M0 0 L0 24", "width": 16})).unwrap_err().to_string(); + assert!(e.contains("horizontal extent"), "{e}"); + let e = s.execute("vector.create", &json!({"path": "M0 0 L24 0", "height": 16})).unwrap_err().to_string(); + assert!(e.contains("vertical extent"), "{e}"); + // A size that would collapse both axes is refused too. + let e = s.execute("vector.create", &json!({"path": path, "width": 0})).unwrap_err().to_string(); + assert!(e.contains("0×0"), "{e}"); } diff --git a/crates/format/src/large_tests.rs b/crates/format/src/large_tests.rs index 45eaf27c9..143dc82a0 100644 --- a/crates/format/src/large_tests.rs +++ b/crates/format/src/large_tests.rs @@ -187,7 +187,7 @@ fn files_with_every_field_spelled_out_still_open() { } #[test] -fn a_component_sets_old_editor_outline_is_dropped_on_open() { +fn a_component_sets_old_editor_outline_is_dropped_only_without_the_marker() { let mut d = Document::new("Sets"); let page = d.first_page().unwrap(); let old = d.create(page, NodeKind::ComponentSet { description: String::new() }, "Button", 0.0, 0.0, 100.0, 40.0).unwrap(); @@ -200,8 +200,15 @@ fn a_component_sets_old_editor_outline_is_dropped_on_open() { let n = d.get_mut(custom).unwrap(); n.strokes = vec![Paint::solid(Color::from_rgb8_const(0x11, 0x22, 0x33))]; n.stroke.dashes = vec![1.0, 2.0]; + // A file this version writes carries the marker: the same stroke is a choice, not decoration. let text = serde_json::to_string(&to_json(&d).unwrap()).unwrap(); - let (back, _) = from_json(&text).unwrap(); + let (current, _) = from_json(&text).unwrap(); + assert_eq!(current.node(old).unwrap().strokes.len(), 1, "a marked file keeps a stroke someone chose"); + assert_eq!(current.node(custom).unwrap().strokes.len(), 1); + // A file without the marker is from a version that stored the decoration; drop exactly that. + let mut legacy = to_json(&d).unwrap(); + legacy.as_object_mut().unwrap().remove("editorOutlines"); + let (back, _) = from_json(&serde_json::to_string(&legacy).unwrap()).unwrap(); let old = back.node(old).unwrap(); assert!(old.strokes.is_empty() && old.stroke.dashes.is_empty(), "the decoration is canvas chrome, not a document stroke"); let custom = back.node(custom).unwrap(); diff --git a/crates/format/src/lib.rs b/crates/format/src/lib.rs index 93e67e5bb..4ae154e74 100644 --- a/crates/format/src/lib.rs +++ b/crates/format/src/lib.rs @@ -232,13 +232,18 @@ struct DocumentJson<'a> { version: u32, #[serde(rename = "imageIndex", serialize_with = "image_index")] images: &'a BTreeMap, + /// The editor draws component-set outlines itself instead of storing them as strokes. Files + /// without this marker were written by a version that stored the purple dashed outline as a + /// real stroke (see [`drop_component_set_decoration`]). + #[serde(rename = "editorOutlines")] + editor_outlines: bool, #[serde(flatten)] doc: &'a Document, } impl<'a> DocumentJson<'a> { fn new(doc: &'a Document) -> Self { - Self { format: FORMAT, version: VERSION, images: &doc.images, doc } + Self { format: FORMAT, version: VERSION, images: &doc.images, editor_outlines: true, doc } } } @@ -277,6 +282,8 @@ type ImageIndex = Option>; struct Header { version: Option, images: ImageIndex, + /// Whether the writer drew component-set outlines outside the document. + editor_outlines: bool, } impl<'de> Deserialize<'de> for Header { @@ -292,6 +299,7 @@ impl<'de> Deserialize<'de> for Header { while let Some(key) = map.next_key::()? { match key.as_str() { "version" => h.version = map.next_value::()?.as_u64(), + "editorOutlines" => h.editor_outlines = map.next_value::()?.as_bool().unwrap_or(false), "imageIndex" => { h.images = map .next_value::()? @@ -337,7 +345,11 @@ fn parse_json(text: &str) -> Result<(Document, Vec, ImageIndex), FormatE return Err(FormatError::Newer(u32::try_from(ver).unwrap_or(u32::MAX))); } let mut doc: Document = serde_json::from_str(text).map_err(corrupt)?; - drop_component_set_decoration(&mut doc); + // Only files from before the marker can carry the old stored decoration; a file this version + // wrote keeps a stroke someone chose, even one that looks exactly like it. + if !header.editor_outlines { + drop_component_set_decoration(&mut doc); + } let issues = doc.validate(); if !issues.is_empty() { doc.repair(); diff --git a/docs/mcp.md b/docs/mcp.md index caecf3724..864bc1f19 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -429,7 +429,8 @@ on; `key` resolves keys the way the canvas does. Commands behind keys: `vector.create {path | points}` makes the layer's box from the geometry; `width`/`height` scale the geometry to the size asked for (with both, each side independently; with one, the other keeps its proportion). A path or point set that draws nothing is refused instead of making an invisible -0×0 layer. +0×0 layer, as is a size on an axis the geometry has none of and a size that would collapse both +axes. Vector edit mode is driven with `run_command` (or `pointer`/`key` for gestures): `vector.edit.begin {id? | ids?}` (default the selection; converts shapes to vectors; several layers From 55aa0165fd8ba2ef9d2e0821ef20a6f7b661a8db Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 17:41:11 +0700 Subject: [PATCH 260/817] #801: keep a component set's outline as its real stroke (reverts the export change) --- crates/doc/src/node.rs | 4 +-- crates/engine/src/export_behaviour_tests.rs | 14 --------- crates/format/src/large_tests.rs | 30 ------------------- crates/format/src/lib.rs | 33 ++------------------- crates/ui-egui/src/canvas.rs | 7 ----- crates/ui-egui/src/canvas_fixes_tests.rs | 14 --------- docs/components-parity.md | 1 - 7 files changed, 4 insertions(+), 99 deletions(-) diff --git a/crates/doc/src/node.rs b/crates/doc/src/node.rs index 582cdb757..00f7d5599 100644 --- a/crates/doc/src/node.rs +++ b/crates/doc/src/node.rs @@ -565,14 +565,14 @@ impl Node { NodeKind::Text(_) => vec![Paint::solid(Color::BLACK)], _ => vec![], }; - // A component set's purple dashed frame is editor chrome: the canvas draws it, and it is - // never a stroke in the document, so exports don't show it. let strokes = match &kind { NodeKind::Line => vec![Paint::solid(Color::BLACK)], + NodeKind::ComponentSet { .. } => vec![Paint::solid(Color::from_rgb8_const(0x97, 0x47, 0xFF))], _ => vec![], }; let stroke = match &kind { NodeKind::Line | NodeKind::Vector { .. } => StrokeProps { align: StrokeAlign::Center, ..Default::default() }, + NodeKind::ComponentSet { .. } => StrokeProps { dashes: vec![10.0, 5.0], ..Default::default() }, _ => StrokeProps::default(), }; let blend = if kind.is_container() { BlendMode::PassThrough } else { BlendMode::Normal }; diff --git a/crates/engine/src/export_behaviour_tests.rs b/crates/engine/src/export_behaviour_tests.rs index e3652a19c..6896ce3e0 100644 --- a/crates/engine/src/export_behaviour_tests.rs +++ b/crates/engine/src/export_behaviour_tests.rs @@ -317,20 +317,6 @@ fn svg_export_options() { assert!(svg.contains("stroke-width=\"4\""), "an inside stroke on a rectangle simplifies too (the rectangle inset by half the weight)"); } -#[test] -fn a_component_sets_editor_outline_is_not_exported() { - let mut s = Session::new(); - let a = id(&ex(&mut s, "node.create", json!({"type": "component", "x": 0, "y": 0, "width": 100, "height": 40}))); - let b = id(&ex(&mut s, "node.create", json!({"type": "component", "x": 300, "y": 0, "width": 100, "height": 40}))); - let set = id(&ex(&mut s, "component.combineVariants", json!({"ids": [a, b]}))); - assert!(s.doc().unwrap().node(set).unwrap().strokes.is_empty(), "the purple dashed frame is editor chrome, not a stroke"); - let svg = text(&export(&mut s, json!({"ids": [set], "format": "svg"}))); - assert!(!svg.to_ascii_lowercase().contains("9747ff") && !svg.contains("stroke-dasharray"), "{svg}"); - let png = pixels(&export(&mut s, json!({"ids": [set]}))); - let purple = png.pixels().filter(|p| p[3] > 0 && p[0].abs_diff(0x97) < 24 && p[1].abs_diff(0x47) < 24 && p[2].abs_diff(0xFF) < 24).count(); - assert_eq!(purple, 0, "the exported set has no purple outline pixels"); -} - #[test] fn copy_as_png_svg_and_code() { let mut s = Session::new(); diff --git a/crates/format/src/large_tests.rs b/crates/format/src/large_tests.rs index 143dc82a0..889074f18 100644 --- a/crates/format/src/large_tests.rs +++ b/crates/format/src/large_tests.rs @@ -186,36 +186,6 @@ fn files_with_every_field_spelled_out_still_open() { assert_same_doc(&d, &again); } -#[test] -fn a_component_sets_old_editor_outline_is_dropped_only_without_the_marker() { - let mut d = Document::new("Sets"); - let page = d.first_page().unwrap(); - let old = d.create(page, NodeKind::ComponentSet { description: String::new() }, "Button", 0.0, 0.0, 100.0, 40.0).unwrap(); - let custom = d.create(page, NodeKind::ComponentSet { description: String::new() }, "Chip", 0.0, 80.0, 100.0, 40.0).unwrap(); - // As 0.6.0 wrote every set: the canvas's purple dashed outline stored as a real stroke. - let n = d.get_mut(old).unwrap(); - n.strokes = vec![Paint::solid(Color::from_rgb8_const(0x97, 0x47, 0xFF))]; - n.stroke.dashes = vec![10.0, 5.0]; - // A stroke someone chose is design content and stays. - let n = d.get_mut(custom).unwrap(); - n.strokes = vec![Paint::solid(Color::from_rgb8_const(0x11, 0x22, 0x33))]; - n.stroke.dashes = vec![1.0, 2.0]; - // A file this version writes carries the marker: the same stroke is a choice, not decoration. - let text = serde_json::to_string(&to_json(&d).unwrap()).unwrap(); - let (current, _) = from_json(&text).unwrap(); - assert_eq!(current.node(old).unwrap().strokes.len(), 1, "a marked file keeps a stroke someone chose"); - assert_eq!(current.node(custom).unwrap().strokes.len(), 1); - // A file without the marker is from a version that stored the decoration; drop exactly that. - let mut legacy = to_json(&d).unwrap(); - legacy.as_object_mut().unwrap().remove("editorOutlines"); - let (back, _) = from_json(&serde_json::to_string(&legacy).unwrap()).unwrap(); - let old = back.node(old).unwrap(); - assert!(old.strokes.is_empty() && old.stroke.dashes.is_empty(), "the decoration is canvas chrome, not a document stroke"); - let custom = back.node(custom).unwrap(); - assert_eq!(custom.strokes.len(), 1, "a real stroke is not the decoration"); - assert_eq!(custom.stroke.dashes, vec![1.0, 2.0]); -} - #[test] fn the_header_is_read_on_its_own() { // A newer file is refused before its document is looked at, whatever the version's size. diff --git a/crates/format/src/lib.rs b/crates/format/src/lib.rs index 4ae154e74..9f7e51bc4 100644 --- a/crates/format/src/lib.rs +++ b/crates/format/src/lib.rs @@ -28,8 +28,7 @@ use std::collections::{BTreeMap, BTreeSet}; use std::io::{Read, Seek, Write}; use std::sync::Arc; -use figcraft_doc::color::{Color, Paint}; -use figcraft_doc::{Document, ImageData, NodeKind}; +use figcraft_doc::{Document, ImageData}; use serde::de::{Deserializer, IgnoredAny, MapAccess, Visitor}; use serde::{Deserialize, Serialize, Serializer}; use serde_json::{Value, json}; @@ -232,18 +231,13 @@ struct DocumentJson<'a> { version: u32, #[serde(rename = "imageIndex", serialize_with = "image_index")] images: &'a BTreeMap, - /// The editor draws component-set outlines itself instead of storing them as strokes. Files - /// without this marker were written by a version that stored the purple dashed outline as a - /// real stroke (see [`drop_component_set_decoration`]). - #[serde(rename = "editorOutlines")] - editor_outlines: bool, #[serde(flatten)] doc: &'a Document, } impl<'a> DocumentJson<'a> { fn new(doc: &'a Document) -> Self { - Self { format: FORMAT, version: VERSION, images: &doc.images, editor_outlines: true, doc } + Self { format: FORMAT, version: VERSION, images: &doc.images, doc } } } @@ -282,8 +276,6 @@ type ImageIndex = Option>; struct Header { version: Option, images: ImageIndex, - /// Whether the writer drew component-set outlines outside the document. - editor_outlines: bool, } impl<'de> Deserialize<'de> for Header { @@ -299,7 +291,6 @@ impl<'de> Deserialize<'de> for Header { while let Some(key) = map.next_key::()? { match key.as_str() { "version" => h.version = map.next_value::()?.as_u64(), - "editorOutlines" => h.editor_outlines = map.next_value::()?.as_bool().unwrap_or(false), "imageIndex" => { h.images = map .next_value::()? @@ -318,21 +309,6 @@ impl<'de> Deserialize<'de> for Header { } } -/// Earlier versions gave every component set the purple dashed outline of the canvas as a real -/// stroke, so it exported with the set. New sets carry no paint; files written back then lose -/// exactly that decoration when opened, and the canvas draws the outline itself. -fn drop_component_set_decoration(doc: &mut Document) { - let decoration = Paint::solid(Color::from_rgb8_const(0x97, 0x47, 0xFF)); - let ids: Vec<_> = doc.nodes().filter(|n| matches!(n.kind, NodeKind::ComponentSet { .. })).map(|n| n.id).collect(); - for id in ids { - let Some(n) = doc.node_mut(id) else { continue }; - if n.strokes.len() == 1 && n.strokes.first() == Some(&decoration) && n.stroke.dashes.as_slice() == [10.0, 5.0] { - n.strokes.clear(); - n.stroke.dashes.clear(); - } - } -} - /// Parse `document.json` content; also returns its [`ImageIndex`]. The header is checked first /// (a newer file is refused before its document is read), then the document is deserialized /// straight from the text. @@ -345,11 +321,6 @@ fn parse_json(text: &str) -> Result<(Document, Vec, ImageIndex), FormatE return Err(FormatError::Newer(u32::try_from(ver).unwrap_or(u32::MAX))); } let mut doc: Document = serde_json::from_str(text).map_err(corrupt)?; - // Only files from before the marker can carry the old stored decoration; a file this version - // wrote keeps a stroke someone chose, even one that looks exactly like it. - if !header.editor_outlines { - drop_component_set_decoration(&mut doc); - } let issues = doc.validate(); if !issues.is_empty() { doc.repair(); diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 627fae565..9e0c1d797 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -936,13 +936,6 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ if labelled && let Some(q) = crate::frame_labels::draw(app, painter, t, &doc, *c, sel.contains(c), ds.hover == Some(*c)) { labels.push((*c, q.map(|p| app.to_page(p)))); } - // Component sets keep Figma's purple dashed frame on the canvas: editor chrome, not a - // document paint, so it never shows in an export. - if matches!(n.kind, NodeKind::ComponentSet { .. }) - && let Some(q) = node_quad(app, &doc, *c) - { - painter.add(Shape::dashed_line(&[q[0], q[1], q[2], q[3], q[0]], stroke(COMPONENT, 1.0), 4.0, 3.0)); - } } // Prototype connections. crate::proto_canvas::draw(app, painter); diff --git a/crates/ui-egui/src/canvas_fixes_tests.rs b/crates/ui-egui/src/canvas_fixes_tests.rs index bca1f4fbc..4cd32d565 100644 --- a/crates/ui-egui/src/canvas_fixes_tests.rs +++ b/crates/ui-egui/src/canvas_fixes_tests.rs @@ -51,20 +51,6 @@ fn frame_outlines_and_slices_draw_when_shown() { assert!(!outlined(&shapes, quad(&u, inner)) && dashes_along(&shapes, sq[0], sq[1]) == 0, "both turn off again"); } -#[test] -fn component_sets_draw_their_editor_outline() { - let mut s = Session::new(); - let a = id(&s.execute("node.create", &json!({"type": "component", "x": 0, "y": 0, "width": 100, "height": 40})).unwrap()); - let b = id(&s.execute("node.create", &json!({"type": "component", "x": 200, "y": 0, "width": 100, "height": 40})).unwrap()); - let set = id(&s.execute("component.combineVariants", &json!({"ids": [a, b]})).unwrap()); - s.execute("select.set", &json!({"ids": []})).unwrap(); - assert!(s.doc().unwrap().node(set).unwrap().strokes.is_empty(), "the outline is not a document stroke"); - let mut u = Ui::new(s); - let q = crate::canvas::node_quad(&u.app, u.app.session.doc().unwrap(), set).unwrap(); - let shapes = flat(&u.frame_output(vec![]).shapes); - assert!(dashes_along(&shapes, q[0], q[1]) > 3, "the set shows its dashed outline"); -} - /// A job a few hundred milliseconds of rendering big. fn big_job(doc: &Arc, page: figcraft_doc::NodeId, scale: f64) -> crate::render_worker::Job { crate::render_worker::Job { diff --git a/docs/components-parity.md b/docs/components-parity.md index 8be233629..2640ed1c0 100644 --- a/docs/components-parity.md +++ b/docs/components-parity.md @@ -76,7 +76,6 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`. | Date | Change | Summary | |---|---|---| -| 2026-10-18 | minor | Component sets: the purple dashed frame is canvas chrome again. A new set carries no stroke, the canvas draws the outline, and exports and screenshots leave it out; a file written by 0.6.0 loses exactly that stored decoration when opened. A stroke someone chose stays. Numbers unchanged | | 2026-10-18 | minor | Variables import (#790): a `variables` map outside `meta` (or `meta.variables` next to top-level collections) is read, and an import that finds no variables, or fewer than the collections' `variableIds` list, says so in `warnings` instead of succeeding silently | | 2026-10-17 | minor | Variant properties reorder by dragging them in the Properties section, one undo step (#679; was "no drag in the panel yet"); a library file saved again right after it was read is read again, so a quick republish isn't missed (#652); the Hidden from publishing row no longer says the Hide when publishing item is missing (it landed 2026-10-12). Numbers unchanged | | 2026-10-17 | minor | Size and resizing overrides of layers inside instances (#731): a layer in an instance can hug, fill or keep a size of its own (group `resizing`: hug/fill/fixed with min and max; `size`), from the Layout panel, the canvas handles and `node.set`; they were refused, and imported ones were dropped at the first relayout. Kept through main edits of other properties, rebuilds, undo, save, `.fig` and REST import (sizes a `.fig` instance gives its layers and the REST `overrides` fields), `.fig` export and detach; reset per group and with Reset all changes (`instance_resizing_tests`). The row that listed them as not overridable was wrong. Numbers unchanged. | From f1d336249a3dddaf0688eb8c2b58e267e77ca87a Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 17:54:24 +0700 Subject: [PATCH 261/817] #801: vector.create accepts 0 on an axis the geometry has none of and refuses a flattening size; points scaling tests --- crates/engine/src/cmd/create.rs | 24 +++++++++------- crates/engine/src/vector_behaviour_tests.rs | 31 +++++++++++++++++++-- 2 files changed, 42 insertions(+), 13 deletions(-) diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index 84fa419a1..3a9f6d67f 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -167,15 +167,23 @@ pub fn parse_path_data(d: &str) -> Option { } /// How much a vector's path is scaled to take the size asked for: with both sides, each scales -/// independently (as resizing a vector does); with one, the other keeps its proportion. A size -/// asked for on an axis the geometry has none of is an error, not silently ignored. +/// independently (as resizing a vector does); with one, the other keeps its proportion. A size on +/// an axis the geometry has none of is an error unless it is 0 (a line's height), and a size of 0 +/// or less on an axis it has is refused rather than flattening it. fn vector_scale(width: Option, height: Option, bw: f64, bh: f64, what: &str) -> std::result::Result<(f64, f64), String> { let fit = |asked: Option, have: f64, axis: &str| match asked { - Some(a) if have > 1e-9 => Ok(a.max(0.0) / have), - Some(_) => Err(format!("`{axis}` can't size {what} with no {} extent", if axis == "width" { "horizontal" } else { "vertical" })), None => Ok(1.0), + Some(a) if have <= 1e-9 => { + if a == 0.0 { + Ok(1.0) + } else { + Err(format!("`{axis}` can't size {what} with no {} extent", if axis == "width" { "horizontal" } else { "vertical" })) + } + } + Some(a) if a > 0.0 && (a / have).is_finite() => Ok(a / have), + Some(_) => Err(format!("`{axis}` must be a positive, finite size: 0 or less would flatten {what}")), }; - let (sx, sy) = match (width, height) { + Ok(match (width, height) { (Some(_), Some(_)) => (fit(width, bw, "width")?, fit(height, bh, "height")?), (Some(_), None) => { let s = fit(width, bw, "width")?; @@ -186,11 +194,7 @@ fn vector_scale(width: Option, height: Option, bw: f64, bh: f64, what: (s, s) } (None, None) => (1.0, 1.0), - }; - if sx <= 0.0 && sy <= 0.0 { - return Err(format!("`width` and `height` would make {what} 0×0")); - } - Ok((sx, sy)) + }) } pub fn create(s: &mut Session, p: &Value) -> Result { diff --git a/crates/engine/src/vector_behaviour_tests.rs b/crates/engine/src/vector_behaviour_tests.rs index 35d610746..fb734085b 100644 --- a/crates/engine/src/vector_behaviour_tests.rs +++ b/crates/engine/src/vector_behaviour_tests.rs @@ -468,7 +468,32 @@ fn vector_paths_take_the_requested_size_and_refuse_empty_geometry() { assert!(e.contains("horizontal extent"), "{e}"); let e = s.execute("vector.create", &json!({"path": "M0 0 L24 0", "height": 16})).unwrap_err().to_string(); assert!(e.contains("vertical extent"), "{e}"); - // A size that would collapse both axes is refused too. - let e = s.execute("vector.create", &json!({"path": path, "width": 0})).unwrap_err().to_string(); - assert!(e.contains("0×0"), "{e}"); + // But 0 on an axis it has none of is what it already is: a horizontal line with height 0. + let line = id_of(&ex(&mut s, "vector.create", json!({"path": "M0 0 L24 0", "width": 16, "height": 0}))["id"]).unwrap(); + let n = s.doc().unwrap().node(line).unwrap(); + assert_eq!((n.width, n.height), (16.0, 0.0)); + // A size of 0 or less on an axis it has would flatten it, so it is refused, alone or with the other. + for p in [json!({"path": path, "width": 0}), json!({"path": path, "width": 16, "height": 0}), json!({"path": path, "width": -4, "height": 8})] { + let e = s.execute("vector.create", &p).unwrap_err().to_string(); + assert!(e.contains("positive"), "{p}: {e}"); + } +} + +#[test] +fn vector_points_take_the_requested_size() { + let mut s = Session::new(); + let points = json!([[10, 20], [34, 20], [34, 32]]); + let corners = |s: &Session, id: NodeId| net(s, id).vertices.iter().map(|v| (v.x, v.y)).collect::>(); + // Both sides: each axis scales on its own; the vertices move with the box. + let both = id_of(&ex(&mut s, "vector.create", json!({"points": points, "x": 10, "y": 20, "width": 48, "height": 6}))["id"]).unwrap(); + let n = s.doc().unwrap().node(both).unwrap(); + assert_eq!((n.width, n.height), (48.0, 6.0)); + assert_eq!(corners(&s, both), vec![(0.0, 0.0), (48.0, 0.0), (48.0, 6.0)]); + // One side: the other keeps its proportion. + let one = id_of(&ex(&mut s, "vector.create", json!({"points": points, "height": 24}))["id"]).unwrap(); + let n = s.doc().unwrap().node(one).unwrap(); + assert_eq!((n.width, n.height), (48.0, 24.0)); + assert_eq!(corners(&s, one), vec![(0.0, 0.0), (48.0, 0.0), (48.0, 24.0)]); + let e = s.execute("vector.create", &json!({"points": points, "width": 16, "height": -1})).unwrap_err().to_string(); + assert!(e.contains("positive"), "{e}"); } From 057bf9a28955b5eb427362436acd0dc4dc82736c Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 18 Oct 2026 17:54:25 +0700 Subject: [PATCH 262/817] #801: create_node and mcp.md say width/height scale a vector's path --- crates/mcp/src/tools.rs | 2 +- docs/mcp.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/mcp/src/tools.rs b/crates/mcp/src/tools.rs index 79ef49458..7714da5a3 100644 --- a/crates/mcp/src/tools.rs +++ b/crates/mcp/src/tools.rs @@ -147,7 +147,7 @@ pub fn tool_definitions() -> Vec { "type": {"type": "string", "enum": ["frame", "rectangle", "ellipse", "polygon", "star", "line", "arrow", "text", "vector", "section", "component", "slice"], "description": "Layer type"}, "x": num("Left, relative to the parent frame (default 0)"), "y": num("Top, relative to the parent frame (default 0)"), - "width": num("Width (default 100; text hugs its content unless width is set, which makes it wrap)"), + "width": num("Width (default 100; text hugs its content unless width is set, which makes it wrap; for a vector with path, width/height scale the path, one alone keeping its proportion, and without them the path's own box is used)"), "height": num("Height (default 100; ignored for lines/arrows and auto-height text)"), "parent": id_schema("Parent frame/group/component id (default: the current page)"), "index": int("Z-index among the parent's children (default: on top)"), diff --git a/docs/mcp.md b/docs/mcp.md index 6191b7410..c5ffe99f5 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -429,8 +429,8 @@ on; `key` resolves keys the way the canvas does. Commands behind keys: `vector.create {path | points}` makes the layer's box from the geometry; `width`/`height` scale the geometry to the size asked for (with both, each side independently; with one, the other keeps its proportion). A path or point set that draws nothing is refused instead of making an invisible -0×0 layer, as is a size on an axis the geometry has none of and a size that would collapse both -axes. +0×0 layer, as is a size on an axis the geometry has none of (except 0, such as a horizontal line's +height) and a size of 0 or less on an axis it has, which would flatten it. Vector edit mode is driven with `run_command` (or `pointer`/`key` for gestures): `vector.edit.begin {id? | ids?}` (default the selection; converts shapes to vectors; several layers From fec902b7d554f9d764115dc397ff40d0851d6fc7 Mon Sep 17 00:00:00 2001 From: phonedu <135960865+phonedu@users.noreply.github.com> Date: Sun, 18 Oct 2026 19:00:25 +0800 Subject: [PATCH 263/817] M1: refuse negative vector sizes A negative width or height was clamped to zero by the scale helper, producing a layer smaller than asked for; vector.create now says so. Regression test covers width -10 with height 8. --- crates/engine/src/cmd/create.rs | 7 ++++++- crates/engine/src/vector_behaviour_tests.rs | 4 +++- docs/mcp.md | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index 84fa419a1..d9e64203b 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -170,8 +170,13 @@ pub fn parse_path_data(d: &str) -> Option { /// independently (as resizing a vector does); with one, the other keeps its proportion. A size /// asked for on an axis the geometry has none of is an error, not silently ignored. fn vector_scale(width: Option, height: Option, bw: f64, bh: f64, what: &str) -> std::result::Result<(f64, f64), String> { + for (axis, asked) in [("width", width), ("height", height)] { + if asked.is_some_and(|a| a < 0.0) { + return Err(format!("`{axis}` can't be negative")); + } + } let fit = |asked: Option, have: f64, axis: &str| match asked { - Some(a) if have > 1e-9 => Ok(a.max(0.0) / have), + Some(a) if have > 1e-9 => Ok(a / have), Some(_) => Err(format!("`{axis}` can't size {what} with no {} extent", if axis == "width" { "horizontal" } else { "vertical" })), None => Ok(1.0), }; diff --git a/crates/engine/src/vector_behaviour_tests.rs b/crates/engine/src/vector_behaviour_tests.rs index 35d610746..7410bc04f 100644 --- a/crates/engine/src/vector_behaviour_tests.rs +++ b/crates/engine/src/vector_behaviour_tests.rs @@ -468,7 +468,9 @@ fn vector_paths_take_the_requested_size_and_refuse_empty_geometry() { assert!(e.contains("horizontal extent"), "{e}"); let e = s.execute("vector.create", &json!({"path": "M0 0 L24 0", "height": 16})).unwrap_err().to_string(); assert!(e.contains("vertical extent"), "{e}"); - // A size that would collapse both axes is refused too. + // A size that would collapse both axes is refused too, and so is a negative one. let e = s.execute("vector.create", &json!({"path": path, "width": 0})).unwrap_err().to_string(); assert!(e.contains("0×0"), "{e}"); + let e = s.execute("vector.create", &json!({"path": path, "width": -10, "height": 8})).unwrap_err().to_string(); + assert!(e.contains("can't be negative"), "{e}"); } diff --git a/docs/mcp.md b/docs/mcp.md index 864bc1f19..cb2cb8707 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -429,8 +429,8 @@ on; `key` resolves keys the way the canvas does. Commands behind keys: `vector.create {path | points}` makes the layer's box from the geometry; `width`/`height` scale the geometry to the size asked for (with both, each side independently; with one, the other keeps its proportion). A path or point set that draws nothing is refused instead of making an invisible -0×0 layer, as is a size on an axis the geometry has none of and a size that would collapse both -axes. +0×0 layer, as is a size on an axis the geometry has none of, a negative size, and a size that +would collapse both axes. Vector edit mode is driven with `run_command` (or `pointer`/`key` for gestures): `vector.edit.begin {id? | ids?}` (default the selection; converts shapes to vectors; several layers From 018b8166b277c812fed857ff0d958a005ce4a8b0 Mon Sep 17 00:00:00 2001 From: BFlat Date: Sun, 18 Oct 2026 18:50:19 +0700 Subject: [PATCH 264/817] M3: a bound colour variable's alpha applies once, not squared (#802) (#804) Fixes #802. Fixes #802. --- crates/engine/src/binding_lists_tests.rs | 2 +- crates/engine/src/bound_alpha_tests.rs | 131 +++++++++++++++++++++++ crates/engine/src/cmd/file.rs | 1 + crates/engine/src/cmd/props.rs | 7 +- crates/engine/src/cmd/styles.rs | 82 +++++++++++++- crates/engine/src/cmd/variables.rs | 6 +- crates/engine/src/codegen.rs | 2 +- crates/engine/src/lib.rs | 2 + crates/ui-egui/src/colorpicker.rs | 21 +++- docs/components-parity.md | 5 +- 10 files changed, 247 insertions(+), 12 deletions(-) create mode 100644 crates/engine/src/bound_alpha_tests.rs diff --git a/crates/engine/src/binding_lists_tests.rs b/crates/engine/src/binding_lists_tests.rs index 493c8f60d..805b0afed 100644 --- a/crates/engine/src/binding_lists_tests.rs +++ b/crates/engine/src/binding_lists_tests.rs @@ -46,7 +46,7 @@ fn a_bound_fill_colour_keeps_the_other_fills() { let fills = s.doc().unwrap().node(r).unwrap().fills.clone(); assert_eq!(fills.len(), 2, "the second fill stays"); assert_eq!(fills[0].kind, PaintKind::Solid { color: Color::from_rgb8_const(0xFF, 0, 0) }); - assert_eq!(fills[0].opacity, 0.5, "the bound paint keeps its opacity"); + assert_eq!(fills[0].opacity, 1.0, "the variable brings the whole colour, alpha included"); assert_eq!(fills[1].kind, PaintKind::Solid { color: Color::from_rgb8_const(0, 0xFF, 0) }); // Removing the bound (first) fill takes the binding with it. ex(&mut s, "fill.remove", json!({"ids": [r], "index": 0})); diff --git a/crates/engine/src/bound_alpha_tests.rs b/crates/engine/src/bound_alpha_tests.rs new file mode 100644 index 000000000..b7210f0f7 --- /dev/null +++ b/crates/engine/src/bound_alpha_tests.rs @@ -0,0 +1,131 @@ +//! A colour variable's alpha applies once to the paint it is bound to (#802): a `#RRGGBBAA` fill keeps +//! its alpha in the paint opacity, and binding a variable with alpha hands the variable the whole +//! colour, so the two alphas don't multiply (canvas, SVG, `.fig` round trips, mode switches). + +use figcraft_doc::NodeId; +use serde_json::json; + +use crate::Session; + +/// 0x80 / 255 and 0x40 / 255. +const HALF: f32 = 128.0 / 255.0; +const QUARTER: f32 = 64.0 / 255.0; + +fn ex(s: &mut Session, cmd: &str, p: serde_json::Value) { + s.execute(cmd, &p).unwrap_or_else(|e| panic!("{cmd}: {e}")); +} + +/// A rectangle filled `#0D6EFD80` and a colour variable `tint` (Light `light`, Dark `dark`). +fn setup(light: &str, dark: &str) -> (Session, NodeId) { + let mut s = Session::new(); + let r = s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 10, "height": 10, "props": {"fill": "#0D6EFD80"}})).unwrap(); + let r = NodeId(r["id"].as_u64().unwrap()); + ex(&mut s, "variable.createCollection", json!({"name": "Tokens", "modes": ["Light", "Dark"]})); + ex(&mut s, "variable.create", json!({"collection": "Tokens", "name": "tint", "type": "color", "value": light})); + ex(&mut s, "variable.set", json!({"variable": "tint", "mode": "Dark", "value": dark})); + (s, r) +} + +/// The fill's effective alpha (colour alpha times paint opacity). +fn alpha(s: &Session, r: NodeId) -> f32 { + s.doc().unwrap().node(r).unwrap().fills[0].solid_color().unwrap().a +} + +/// The alpha byte of the rectangle rendered on its own (transparent backdrop). +fn pixel_alpha(s: &Session, r: NodeId) -> u8 { + let pix = figcraft_render::render_node(s.doc().unwrap(), r, 1.0).unwrap(); + let i = ((5 * pix.width() + 5) * 4 + 3) as usize; + pix.data()[i] +} + +fn near(a: f32, b: f32) -> bool { + (a - b).abs() < 2e-3 +} + +#[test] +fn a_hex_with_alpha_keeps_its_alpha_in_the_opacity() { + let (s, r) = setup("#0D6EFD80", "#0D6EFD40"); + let p = &s.doc().unwrap().node(r).unwrap().fills[0]; + assert_eq!(p.kind, figcraft_color::PaintKind::Solid { color: figcraft_color::Color::from_rgb8_const(0x0D, 0x6E, 0xFD) }); + assert!(near(p.opacity, HALF)); + assert_eq!(pixel_alpha(&s, r), 128); +} + +#[test] +fn a_bound_variable_alpha_applies_once() { + // The fill and the variable are both #0D6EFD80: the result is 50%, not 25%. + let (mut s, r) = setup("#0D6EFD80", "#0D6EFD40"); + ex(&mut s, "variable.bind", json!({"ids": [r.0], "field": "fill", "variable": "tint"})); + assert!(near(alpha(&s, r), HALF), "{}", alpha(&s, r)); + assert_eq!(pixel_alpha(&s, r), 128); + let svg = figcraft_svg::export_svg(s.doc().unwrap(), &[r], &figcraft_svg::SvgOptions::default()).unwrap(); + assert!(svg.contains("fill=\"#0D6EFD\" fill-opacity=\"0.502\""), "{svg}"); + // Binding the same variable again changes nothing. + ex(&mut s, "variable.bind", json!({"ids": [r.0], "field": "fill", "variable": "tint"})); + assert!(near(alpha(&s, r), HALF)); +} + +#[test] +fn unbinding_keeps_the_colour_with_its_alpha_in_the_opacity() { + let (mut s, r) = setup("#0D6EFD40", "#0D6EFD"); + ex(&mut s, "variable.bind", json!({"ids": [r.0], "field": "fill", "variable": "tint"})); + assert_eq!(pixel_alpha(&s, r), 64); + ex(&mut s, "variable.bind", json!({"ids": [r.0], "field": "fill", "variable": null})); + let p = &s.doc().unwrap().node(r).unwrap().fills[0]; + assert_eq!(p.kind, figcraft_color::PaintKind::Solid { color: figcraft_color::Color::from_rgb8_const(0x0D, 0x6E, 0xFD) }); + assert!(near(p.opacity, QUARTER), "{}", p.opacity); + assert_eq!(pixel_alpha(&s, r), 64); + // Undo restores the binding and its paint. + ex(&mut s, "edit.undo", json!({})); + assert!(!s.doc().unwrap().node(r).unwrap().bound.is_empty()); + assert_eq!(pixel_alpha(&s, r), 64); +} + +#[test] +fn modes_switch_the_alpha_without_accumulating() { + let (mut s, r) = setup("#0D6EFD40", "#0D6EFD80"); + ex(&mut s, "variable.bind", json!({"ids": [r.0], "field": "fill", "variable": "tint"})); + for (mode, want) in [("Dark", HALF), ("Light", QUARTER), ("Dark", HALF), ("Light", QUARTER)] { + ex(&mut s, "variable.setMode", json!({"collection": "Tokens", "mode": mode})); + assert!(near(alpha(&s, r), want), "{mode}: {}", alpha(&s, r)); + } + // An opacity set while bound multiplies on top and survives mode switches. + ex(&mut s, "fill.set", json!({"ids": [r.0], "index": 0, "opacity": 0.5})); + ex(&mut s, "variable.setMode", json!({"collection": "Tokens", "mode": "Dark"})); + assert!(near(alpha(&s, r), HALF * 0.5)); +} + +#[test] +fn node_set_and_style_bindings_apply_the_alpha_once() { + let (mut s, r) = setup("#0D6EFD80", "#0D6EFD40"); + let var = s.doc().unwrap().variables.get("tint").unwrap().id.clone(); + ex(&mut s, "node.set", json!({"id": r.0, "props": {"boundVariables": {"fill": var}}})); + assert!(near(alpha(&s, r), HALF)); + ex(&mut s, "node.set", json!({"id": r.0, "props": {"boundVariables": {"fill": null}}})); + assert!(near(s.doc().unwrap().node(r).unwrap().fills[0].opacity, HALF)); + // A paint style made from a `#RRGGBBAA` colour, bound to the variable. + let st = s.execute("style.create", &json!({"type": "paint", "name": "Tint", "value": "#0D6EFD80"})).unwrap()["id"].clone(); + ex(&mut s, "style.bind", json!({"style": st, "field": "fills/0/color", "variable": "tint"})); + ex(&mut s, "style.apply", json!({"ids": [r.0], "style": st})); + assert!(near(alpha(&s, r), HALF), "{}", alpha(&s, r)); +} + +#[test] +fn a_fig_round_trip_keeps_the_alpha_once() { + let (mut s, r) = setup("#0D6EFD80", "#0D6EFD40"); + ex(&mut s, "variable.bind", json!({"ids": [r.0], "field": "fill", "variable": "tint"})); + ex(&mut s, "fill.set", json!({"ids": [r.0], "index": 0, "opacity": 0.5})); + let (bytes, _) = figcraft_format::fig::export(s.doc().unwrap(), None).unwrap(); + let back = crate::cmd::file::load_fig(&bytes, "x").unwrap().unwrap().doc; + let n = back.nodes().find(|n| !n.bound.is_empty()).unwrap(); + let a = n.fills[0].solid_color().unwrap().a; + assert!(near(a, HALF * 0.5), "{a}"); +} + +#[test] +fn code_gives_a_translucent_stroke_its_alpha_once() { + let (mut s, r) = setup("#0D6EFD80", "#0D6EFD40"); + ex(&mut s, "stroke.add", json!({"ids": [r.0], "color": "#FF000080"})); + let code = s.execute("inspect.code", &json!({"id": r.0})).unwrap()["code"].as_str().unwrap_or_default().to_string(); + assert!(code.contains("solid rgba(255, 0, 0, 0.50)"), "{code}"); +} diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index 511e0fc6b..bc13bc701 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -548,6 +548,7 @@ pub(crate) fn load_fig(bytes: &[u8], name: &str) -> Option = diff --git a/crates/engine/src/cmd/props.rs b/crates/engine/src/cmd/props.rs index ca62962da..8a1f4e1cd 100644 --- a/crates/engine/src/cmd/props.rs +++ b/crates/engine/src/cmd/props.rs @@ -775,10 +775,15 @@ pub fn apply(cmd: &str, doc: &mut Document, id: NodeId, props: &Map { + if n.bound.get(field).map(String::as_str) != Some(vid) { + crate::cmd::styles::rebind_paint_alpha(&mut n.fills, &mut n.strokes, field, true); + } n.bound.insert(field.clone(), vid.to_string()); } None => { - n.bound.remove(field); + if n.bound.remove(field).is_some() { + crate::cmd::styles::rebind_paint_alpha(&mut n.fills, &mut n.strokes, field, false); + } } } } diff --git a/crates/engine/src/cmd/styles.rs b/crates/engine/src/cmd/styles.rs index 25e36e3ad..adeb22506 100644 --- a/crates/engine/src/cmd/styles.rs +++ b/crates/engine/src/cmd/styles.rs @@ -458,10 +458,19 @@ fn bind_style(s: &mut Session, p: &Value) -> Result { match var { Some((_, kind)) if kind != want => return Err(bad(cmd, format!("`{field}` takes a {} variable, not a {} one", want.id(), kind.id()))), Some((id, _)) => { + if style.bound.get(&key) != Some(&id) + && let StyleKind::Paint { paints } = &mut style.kind + { + rebind_paint_alpha(paints, &mut [], &key, true); + } style.bound.insert(key, id); } None => { - style.bound.remove(&key); + if style.bound.remove(&key).is_some() + && let StyleKind::Paint { paints } = &mut style.kind + { + rebind_paint_alpha(paints, &mut [], &key, false); + } } } // The style takes its default-mode value, and each layer using it its own. @@ -770,16 +779,41 @@ pub fn bind(s: &mut Session, p: &Value) -> Result { let n = doc.get_mut(i)?; match &vid { Some(v) => { + if n.bound.get(&field) != Some(v) { + rebind_paint_alpha(&mut n.fills, &mut n.strokes, &field, true); + } n.bound.insert(field.clone(), v.clone()); } None => { - n.bound.remove(&field); + if n.bound.remove(&field).is_some() { + rebind_paint_alpha(&mut n.fills, &mut n.strokes, &field, false); + } } } } ok() } +/// A colour variable bound to a solid paint owns its whole colour, alpha included. Binding restarts +/// the opacity (which holds the alpha a typed colour had, see `Paint::solid`) at 1, so the +/// variable's alpha applies once; unbinding moves the colour's alpha back into the opacity, where a +/// typed colour keeps it. An opacity set while bound multiplies on top and stays. +pub(crate) fn rebind_paint_alpha(fills: &mut [Paint], strokes: &mut [Paint], field: &str, bind: bool) { + use super::lists::{BoundList, list_binding}; + let Some((list, i, "color")) = list_binding(field) else { return }; + let paints = match list { + BoundList::Fills => fills, + BoundList::Strokes => strokes, + _ => return, + }; + if let Some(p) = paints.get_mut(i) + && let PaintKind::Solid { color } = &mut p.kind + { + p.opacity = if bind { 1.0 } else { p.opacity * color.a }; + color.a = 1.0; + } +} + /// `variable.setMode`: choose a collection's mode on frames (the page when none are given). pub fn set_mode(s: &mut Session, p: &Value) -> Result { let cmd = "variable.setMode"; @@ -916,6 +950,49 @@ pub fn apply_bindings_to(doc: &mut Document, only: Option<&std::collections::BTr apply_bindings_matching(doc, only, |_| true); } +/// Imported files (`.fig`, REST) keep a solid paint's alpha in its opacity, a bound paint's too, +/// while the bound colour brings its own alpha: take the variable's alpha back out of the opacity +/// (styles' paints and layers') before the bindings are first resolved, so it applies once. +pub(crate) fn unfold_imported_bound_alpha(doc: &mut Document) { + use super::lists::{BoundList, list_binding}; + fn alphas(vars: &Variables, bound: &BTreeMap, modes: &BTreeMap) -> Vec<(BoundList, usize, f32)> { + let found = bound.iter().filter_map(|(field, var)| match (list_binding(field)?, vars.resolve(var, modes)?) { + ((list @ (BoundList::Fills | BoundList::Strokes), i, "color"), VariableValue::Color(c)) if c.a > 0.0 && c.a < 1.0 => Some((list, i, c.a)), + _ => None, + }); + found.collect() + } + fn unfold(p: Option<&mut Paint>, a: f32) { + if let Some(p) = p + && matches!(p.kind, PaintKind::Solid { .. }) + { + p.opacity = (p.opacity / a).min(1.0); + } + } + let pending = doc.take_dirty(); + for i in 0..doc.styles.len() { + let found = doc.styles.get(i).map(|s| alphas(&doc.variables, &s.bound, &BTreeMap::new())).unwrap_or_default(); + if let Some(StyleKind::Paint { paints }) = doc.styles.get_mut(i).filter(|_| !found.is_empty()).map(|s| &mut s.kind) { + for (_, j, a) in found { + unfold(paints.get_mut(j), a); + } + } + } + let ids: Vec = doc.nodes().filter(|n| !n.bound.is_empty()).map(|n| n.id).collect(); + for id in ids { + let found = doc.node(id).map(|n| alphas(&doc.variables, &n.bound, &doc.modes_for(id))).unwrap_or_default(); + if found.is_empty() { + continue; + } + let Ok(n) = doc.get_mut(id) else { continue }; + for (list, j, a) in found { + unfold(if list == BoundList::Fills { n.fills.get_mut(j) } else { n.strokes.get_mut(j) }, a); + } + } + doc.take_dirty(); + doc.mark_dirty(pending); +} + /// Settle imported paint colours before the document is first shown. Other bindings can affect /// layout or component structure, which must be resolved through the normal edit pipeline. pub(crate) fn apply_paint_bindings_on_load(doc: &mut Document) { @@ -1104,7 +1181,6 @@ pub fn document_colors(doc: &Document, page: NodeId) -> Vec<(Color, usize)> { stack.extend(n.children.iter().copied()); for paint in n.fills.iter().chain(n.strokes.iter()).filter(|p| p.visible) { if let Some(c) = paint.solid_color() { - let c = c.with_alpha(c.a * paint.opacity); counts.entry(c.to_rgba8()).or_insert((c, 0)).1 += 1; } } diff --git a/crates/engine/src/cmd/variables.rs b/crates/engine/src/cmd/variables.rs index 3e6dc69d6..53b62ee46 100644 --- a/crates/engine/src/cmd/variables.rs +++ b/crates/engine/src/cmd/variables.rs @@ -288,7 +288,11 @@ pub(crate) fn forget_variables(doc: &mut Document, gone: &BTreeSet) doc.variables.variables.retain(|v| !gone.contains(&v.id)); let users: Vec = doc.nodes().filter(|n| n.bound.values().any(|v| gone.contains(v))).map(|n| n.id).collect(); for id in users { - doc.get_mut(id)?.bound.retain(|_, v| !gone.contains(v)); + let n = doc.get_mut(id)?; + for (field, _) in n.bound.iter().filter(|(_, v)| gone.contains(*v)) { + super::styles::rebind_paint_alpha(&mut n.fills, &mut n.strokes, field, false); + } + n.bound.retain(|_, v| !gone.contains(v)); } Ok(()) } diff --git a/crates/engine/src/codegen.rs b/crates/engine/src/codegen.rs index 7d35229f1..6dd806462 100644 --- a/crates/engine/src/codegen.rs +++ b/crates/engine/src/codegen.rs @@ -256,7 +256,7 @@ fn stroke_color(n: &Node) -> Option { if !n.has_visible_stroke() { return None; } - n.strokes.iter().filter(|p| p.visible).find_map(|p| p.solid_color().map(|c| c.with_alpha(c.a * p.opacity))) + n.strokes.iter().filter(|p| p.visible).find_map(|p| p.solid_color()) } fn drop_shadow(n: &Node) -> Option<&Shadow> { diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index c32a99bb7..312c2e878 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1554,6 +1554,8 @@ mod binding_lists_tests; #[cfg(test)] mod booleans_tests; #[cfg(test)] +mod bound_alpha_tests; +#[cfg(test)] mod branch_tests; #[cfg(test)] mod branch_versions_tests; diff --git a/crates/ui-egui/src/colorpicker.rs b/crates/ui-egui/src/colorpicker.rs index f4a27c5e4..be1648359 100644 --- a/crates/ui-egui/src/colorpicker.rs +++ b/crates/ui-egui/src/colorpicker.rs @@ -120,8 +120,7 @@ fn current_paint(app: &FigApp, target: &PickerTarget) -> Option { /// Write `paint` to the target. `live` edits are part of an ongoing drag. fn write(app: &mut FigApp, target: &PickerTarget, paint: &Paint, live: bool) { if let PickerTarget::PluginField { plugin, control, .. } = target { - let c = paint.solid_color().unwrap_or(Color::BLACK); - let hex = c.with_alpha(c.a * paint.opacity).to_css_hex(); + let hex = paint.solid_color().unwrap_or(Color::BLACK).to_css_hex(); let (plugin, control) = (plugin.clone(), control.clone()); if !live { crate::plugins_ui::set_field(app, &plugin, &control, &hex); @@ -153,7 +152,7 @@ fn write(app: &mut FigApp, target: &PickerTarget, paint: &Paint, live: bool) { } PickerTarget::Variable { id, mode } => { let c = paint.solid_color().unwrap_or(Color::BLACK); - app.session.execute("variable.set", &json!({"variable": id, "mode": mode, "value": c.with_alpha(c.a * paint.opacity).to_css_hex()})) + app.session.execute("variable.set", &json!({"variable": id, "mode": mode, "value": c.to_css_hex()})) } PickerTarget::PluginField { .. } => return, PickerTarget::Style { id, index } => { @@ -1181,6 +1180,22 @@ mod selection_color_tests { assert_eq!(app.session.doc().unwrap().node(a).unwrap().fills[0].solid_color().unwrap().to_hex(), "FF0000"); } + #[test] + fn writing_a_variable_keeps_its_alpha() { + // The picker holds a colour variable's alpha as the paint opacity; writing it back applies it once. + let (mut app, _, _) = setup(); + app.session.execute("variable.createCollection", &json!({"name":"T"})).unwrap(); + let v = app.session.execute("variable.create", &json!({"collection":"T","name":"tint","type":"color","value":"#0D6EFD80"})).unwrap(); + let var = app.session.doc().unwrap().variables.get(v["id"].as_str().unwrap()).unwrap().clone(); + let target = PickerTarget::Variable { id: var.id.clone(), mode: var.values.keys().next().unwrap().clone() }; + for _ in 0..2 { + let paint = current_paint(&app, &target).unwrap(); + write(&mut app, &target, &paint, false); + } + let c = current_paint(&app, &target).unwrap().solid_color().unwrap(); + assert_eq!(c.to_css_hex().to_uppercase(), "#0D6EFD80"); + } + #[test] fn picker_does_not_follow_selection_or_document_switches() { let (mut app, _, _) = setup(); diff --git a/docs/components-parity.md b/docs/components-parity.md index 2640ed1c0..46bc0fab6 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-10-18 · **Change:** minor (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-10-18 · **Change:** minor (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 @@ -65,7 +65,7 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`. | Modes: add, duplicate, rename, delete, set as default / reorder | done | layers on Auto follow a new default; explicit modes stay | | Deleting a bound variable or its collection | done | layers keep their last value and are unbound; aliases to it take its values | | Code syntax per platform (Web, iOS, Android) | done | generated CSS uses the Web name; in the variables JSON; SwiftUI/Compose code doesn't name variables yet | -| Bindings: fills, strokes, effects, opacity, padding, gaps, sizes, radius, font size/weight, line height, letter spacing, paragraph spacing/indent, text, visibility, layout grids, instance properties | done | type-checked per field; number variables fill text content | +| Bindings: fills, strokes, effects, opacity, padding, gaps, sizes, radius, font size/weight, line height, letter spacing, paragraph spacing/indent, text, visibility, layout grids, instance properties | done | type-checked per field; number variables fill text content; a colour variable bound to a solid paint brings its whole colour, alpha included, once (the paint's opacity restarts at 100% on binding, an opacity set while bound multiplies on top; unbinding moves the alpha back into the opacity) | | Explicit modes per frame, library collections' modes | done | | | Gradient stops and variant properties bound to variables | done | a stop's binding follows it when earlier stops are removed | | Extended collections | done | library collections, including a library's own extended collections (chains through libraries); overrides per mode with reset; follow library updates, variables new to the library collection being an update of their own; modes inherited. Checked with synthetic libraries only ([gaps](gaps.md) #14) | @@ -76,6 +76,7 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`. | Date | Change | Summary | |---|---|---| +| 2026-10-18 | minor | A bound colour variable's alpha applies once (#802): a `#RRGGBBAA` paint keeps its alpha in the paint opacity, and binding a variable with alpha left that opacity in place, so a 50% fill bound to a 50% variable drew at 25%. Binding (`variable.bind`, `node.set` `boundVariables`, `style.bind`) now restarts the paint's opacity at 100% and unbinding (also deleting the variable) moves the colour's alpha back into the opacity; `.fig` and REST imports take the variable's alpha back out of a bound paint's opacity, so `.fig` round trips no longer square it. Colour-picker edits of a colour variable or a plugin colour field, generated CSS strokes and the document colours list counted the paint opacity twice and now count it once (`bound_alpha_tests`). Numbers unchanged | | 2026-10-18 | minor | Variables import (#790): a `variables` map outside `meta` (or `meta.variables` next to top-level collections) is read, and an import that finds no variables, or fewer than the collections' `variableIds` list, says so in `warnings` instead of succeeding silently | | 2026-10-17 | minor | Variant properties reorder by dragging them in the Properties section, one undo step (#679; was "no drag in the panel yet"); a library file saved again right after it was read is read again, so a quick republish isn't missed (#652); the Hidden from publishing row no longer says the Hide when publishing item is missing (it landed 2026-10-12). Numbers unchanged | | 2026-10-17 | minor | Size and resizing overrides of layers inside instances (#731): a layer in an instance can hug, fill or keep a size of its own (group `resizing`: hug/fill/fixed with min and max; `size`), from the Layout panel, the canvas handles and `node.set`; they were refused, and imported ones were dropped at the first relayout. Kept through main edits of other properties, rebuilds, undo, save, `.fig` and REST import (sizes a `.fig` instance gives its layers and the REST `overrides` fields), `.fig` export and detach; reset per group and with Reset all changes (`instance_resizing_tests`). The row that listed them as not overridable was wrong. Numbers unchanged. | From 4707cb1579bfdfac3145a441d8014b9ef9e1c005 Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Sun, 18 Oct 2026 13:58:13 +0200 Subject: [PATCH 265/817] M1: wrap errors name the command that was run Grouping, framing, auto layout, masks, outline stroke and the boolean commands share wrap(), which named `object.group` in every refusal (`layout.add` on a page: "invalid parameters for `object.group`"). wrap() now takes the calling command's id. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/booleans.rs | 2 +- crates/engine/src/cmd/structure.rs | 31 ++++++++++---------- crates/engine/src/convert_container_tests.rs | 17 +++++++++++ 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/crates/engine/src/booleans.rs b/crates/engine/src/booleans.rs index 87d901533..c3de51cbe 100644 --- a/crates/engine/src/booleans.rs +++ b/crates/engine/src/booleans.rs @@ -124,7 +124,7 @@ pub(crate) fn apply(s: &mut Session, cmd: &str, p: &Value, op: BoolOp) -> Result } return Ok(json!({"ids": ids, "operation": op})); } - let out = crate::cmd::structure::wrap_boolean(s, p, op)?; + let out = crate::cmd::structure::wrap_boolean(s, p, cmd, op)?; // Operands of a new group follow its operation. if let Some(g) = crate::params::id_of(&out["id"]) { let doc = s.doc_mut()?; diff --git a/crates/engine/src/cmd/structure.rs b/crates/engine/src/cmd/structure.rs index 75ddac3d8..003872ef2 100644 --- a/crates/engine/src/cmd/structure.rs +++ b/crates/engine/src/cmd/structure.rs @@ -12,9 +12,9 @@ use crate::{EngineError, Result, Session, bad, spec}; pub fn specs() -> Vec { vec![ - spec!("object.group", "Group selection", "{ids?, name?}", true, |s, p| wrap(s, p, Wrap::Group)), + spec!("object.group", "Group selection", "{ids?, name?}", true, |s, p| wrap(s, p, "object.group", Wrap::Group)), spec!("object.ungroup", "Ungroup selection", "{ids?}", true, ungroup), - spec!("object.frameSelection", "Frame selection", "{ids?, name?}", true, |s, p| wrap(s, p, Wrap::Frame)), + spec!("object.frameSelection", "Frame selection", "{ids?, name?}", true, |s, p| wrap(s, p, "object.frameSelection", Wrap::Frame)), spec!("object.removeFrame", "Remove frame", "{ids?}", true, ungroup), spec!( "object.convertToGroup", @@ -42,7 +42,7 @@ pub fn specs() -> Vec { "Wrap in new section", "{ids?, name?} (layers on the page or in a section; the section wraps them with some room)", true, - |s, p| wrap(s, p, Wrap::Section) + |s, p| wrap(s, p, "object.wrapInSection", Wrap::Section) ), spec!( "object.resizeToFit", @@ -128,26 +128,27 @@ const SECTION_PAD: f64 = 40.0; const BOOL_PARAMS: &str = "{ids?} — layers inside boolean groups: sets their own operation (how each combines with the operands below it); one boolean group: sets its operation (every operand follows it); otherwise wraps the layers in a new boolean group"; /// Wrap the selection in a new boolean group doing `op`. -pub(crate) fn wrap_boolean(s: &mut Session, p: &Value, op: BoolOp) -> Result { - wrap(s, p, Wrap::Bool(op)) +pub(crate) fn wrap_boolean(s: &mut Session, p: &Value, cmd: &str, op: BoolOp) -> Result { + wrap(s, p, cmd, Wrap::Bool(op)) } -/// Wrap the selection in a new container at the topmost selected layer's place. -fn wrap(s: &mut Session, p: &Value, w: Wrap) -> Result { - let ids = req_targets("object.group", s, p)?; +/// Wrap the selection in a new container at the topmost selected layer's place. Errors name `cmd`, +/// the command that asked. +fn wrap(s: &mut Session, p: &Value, cmd: &str, w: Wrap) -> Result { + let ids = req_targets(cmd, s, p)?; let doc = s.doc_mut()?; let ids = z_sorted(doc, &roots(doc, &ids)); - let top = *ids.last().ok_or_else(|| bad("object.group", "nothing selected"))?; - let parent = doc.get(top)?.parent.ok_or_else(|| bad("object.group", "can't group a page"))?; + let top = *ids.last().ok_or_else(|| bad(cmd, "nothing selected"))?; + let parent = doc.get(top)?.parent.ok_or_else(|| bad(cmd, "can't group a page"))?; // Sections sit on the page or in sections, never in frames or groups. let board = |doc: &Document, i: NodeId| { doc.node(i).and_then(|n| n.parent).and_then(|p| doc.node(p)).is_some_and(|p| p.is_page() || matches!(p.kind, NodeKind::Section { .. })) }; if matches!(w, Wrap::Section) && !ids.iter().all(|i| board(doc, *i)) { - return Err(bad("object.wrapInSection", "only layers on the page or in a section can be wrapped in a section")); + return Err(bad(cmd, "only layers on the page or in a section can be wrapped in a section")); } if !matches!(w, Wrap::Section) && ids.iter().any(|i| doc.node(*i).is_some_and(|n| matches!(n.kind, NodeKind::Section { .. }))) { - return Err(bad("object.group", "sections can't go in groups or frames")); + return Err(bad(cmd, "sections can't go in groups or frames")); } let index = doc.index_in_parent(top).map(|i| i + 1); let mut bounds = doc.bounds_of(&ids).unwrap_or_default(); @@ -338,7 +339,7 @@ fn mask(s: &mut Session, p: &Value) -> Result { return ok(); } // Group, then the bottom-most child is the mask. - let r = wrap(s, &json!({"ids": ids, "name": "Mask group"}), Wrap::Group)?; + let r = wrap(s, &json!({"ids": ids, "name": "Mask group"}), "object.mask", Wrap::Group)?; let gid = id_of(&r["id"]).ok_or_else(|| EngineError::Other("group failed".into()))?; let doc = s.doc_mut()?; if let Some(first) = doc.get(gid)?.children.first().copied() { @@ -472,7 +473,7 @@ fn outline_stroke(s: &mut Session, p: &Value) -> Result { let f = doc.get_mut(fill_id)?; f.strokes.clear(); } - let r = wrap(s, &json!({"ids": [fill_id, vid], "name": n.name}), Wrap::Group)?; + let r = wrap(s, &json!({"ids": [fill_id, vid], "name": n.name}), "vector.outlineStroke", Wrap::Group)?; if let Some(g) = id_of(&r["id"]) { out.push(g); } @@ -519,7 +520,7 @@ fn layout_add(s: &mut Session, p: &Value) -> Result { ids } else { // Wrap non-frames in a new frame without a fill, then add auto layout to it. - let r = wrap(s, &json!({"ids": ids}), Wrap::Frame)?; + let r = wrap(s, &json!({"ids": ids}), "layout.add", Wrap::Frame)?; let fid = id_of(&r["id"]).ok_or_else(|| EngineError::Other("wrap failed".into()))?; let f = s.doc_mut()?.get_mut(fid)?; f.fills.clear(); diff --git a/crates/engine/src/convert_container_tests.rs b/crates/engine/src/convert_container_tests.rs index 620388d27..bf682a804 100644 --- a/crates/engine/src/convert_container_tests.rs +++ b/crates/engine/src/convert_container_tests.rs @@ -194,3 +194,20 @@ fn only_frames_on_the_page_or_in_a_section_become_sections() { assert!(err.contains("holds sections"), "{err}"); assert!(matches!(kind(&s, sec), NodeKind::Section { .. }), "nothing changed"); } + +#[test] +fn wrapping_errors_name_the_command_that_was_run() { + // Grouping, framing, auto layout, masks and booleans share one wrapping step; a refusal names + // the command that asked, not `object.group`. + let mut s = Session::new(); + let page = s.page().unwrap(); + for cmd in ["object.group", "object.frameSelection", "layout.add", "bool.union"] { + let err = s.execute(cmd, &json!({"ids": [page]})).unwrap_err().to_string(); + assert!(err.contains(&format!("`{cmd}`")), "{cmd}: {err}"); + } + let r = rect(&mut s, page, 0.0, 0.0); + let f = id(ex(&mut s, "frame.create", json!({"x": 100, "y": 0, "width": 100, "height": 100}))); + let inner = rect(&mut s, f, 10.0, 10.0); + let err = s.execute("object.wrapInSection", &json!({"ids": [inner, r]})).unwrap_err().to_string(); + assert!(err.contains("`object.wrapInSection`"), "{err}"); +} From d3327d79f38e5de5c9bf0c54b33104dd788276c8 Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Sun, 18 Oct 2026 13:58:13 +0200 Subject: [PATCH 266/817] Contributors: add my name for the About window --- contributors/people.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contributors/people.toml b/contributors/people.toml index 8b14373eb..0a4eceb12 100644 --- a/contributors/people.toml +++ b/contributors/people.toml @@ -56,3 +56,6 @@ sync_github_name = true [people.pechnikov2026-star] sync_github_name = true + +[people.MortenHusted] +sync_github_name = true From c7261cb907cc74b2025d8c331f495d6e59f17007 Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Sun, 18 Oct 2026 14:14:38 +0200 Subject: [PATCH 267/817] M3: an explicit paint edit detaches the variable bound to what it changed fill.set, stroke.set and node.set fill/fills/stroke/strokes reported ok while normalize put the bound colour straight back, and node.set {fills: []} brought the bound paint back. They now drop a paint's colour, opacity or stop binding where the edit changed that value, as selection.setPaint already did (its comparison moves to lists::rebind_edited_paint, which also lets stop bindings follow a removed stop). boundVariables applies last in props::apply, so a binding given with the paints in one call stays. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/binding_lists_tests.rs | 74 +++++++++++++++++++++ crates/engine/src/cmd/edit.rs | 2 +- crates/engine/src/cmd/lists.rs | 43 +++++++++++- crates/engine/src/cmd/props.rs | 36 +++++++--- crates/engine/src/components_scale_tests.rs | 26 ++++++++ crates/engine/src/selection_colors.rs | 41 ++---------- crates/engine/src/variables_io_tests.rs | 26 ++++++++ 7 files changed, 199 insertions(+), 49 deletions(-) diff --git a/crates/engine/src/binding_lists_tests.rs b/crates/engine/src/binding_lists_tests.rs index 805b0afed..9db9975a9 100644 --- a/crates/engine/src/binding_lists_tests.rs +++ b/crates/engine/src/binding_lists_tests.rs @@ -97,3 +97,77 @@ fn effect_moves_and_removals_reject_junk() { ex(&mut s, "effect.remove", json!({"ids": [r], "index": 7})); assert_eq!(s.doc().unwrap().node(r).unwrap().effects.len(), 1); } + +fn fill_hex(s: &Session, r: NodeId) -> Vec { + s.doc().unwrap().node(r).unwrap().fills.iter().filter_map(|p| p.solid_color()).map(|c| c.to_hex()).collect() +} + +fn brand_id(s: &Session) -> String { + s.doc().unwrap().variables.get("brand").unwrap().id.clone() +} + +#[test] +fn explicit_paint_edits_detach_the_colour_binding() { + // An edit that reported success keeps its colour: the binding it overwrote lets go (as + // selection colours already do), instead of putting the variable's colour back. + let edits = [ + ("fill.set", json!({"color": "#00FF00"})), + ("node.set", json!({"props": {"fill": "#00FF00"}})), + ("node.set", json!({"props": {"fills": ["#00FF00"]}})), + ]; + for (cmd, mut p) in edits { + let (mut s, r) = setup(); + ex(&mut s, "variable.bind", json!({"ids": [r], "field": "fill", "variable": "brand"})); + p["ids"] = json!([r]); + ex(&mut s, cmd, p.clone()); + assert_eq!(fill_hex(&s, r), ["00FF00"], "{cmd} {p}"); + assert!(bound(&s, r).is_empty(), "{cmd} {p}"); + ex(&mut s, "variable.set", json!({"variable": "brand", "value": "#123456"})); + assert_eq!(fill_hex(&s, r), ["00FF00"], "{cmd} {p}: no longer follows the variable"); + } + for (cmd, mut p) in [("stroke.set", json!({"color": "#00FF00"})), ("node.set", json!({"props": {"stroke": "#00FF00"}}))] { + let (mut s, r) = setup(); + ex(&mut s, "node.set", json!({"ids": [r], "props": {"strokes": ["#000000"]}})); + ex(&mut s, "variable.bind", json!({"ids": [r], "field": "stroke", "variable": "brand"})); + p["ids"] = json!([r]); + ex(&mut s, cmd, p); + let n = s.doc().unwrap().node(r).unwrap(); + assert_eq!(n.strokes[0].solid_color().map(|c| c.to_hex()).as_deref(), Some("00FF00"), "{cmd}"); + assert!(n.bound.is_empty(), "{cmd}"); + } +} + +#[test] +fn clearing_bound_fills_adds_no_paint_back() { + let (mut s, r) = setup(); + ex(&mut s, "variable.bind", json!({"ids": [r], "field": "fill", "variable": "brand"})); + ex(&mut s, "node.set", json!({"ids": [r], "props": {"fills": []}})); + assert!(s.doc().unwrap().node(r).unwrap().fills.is_empty()); + assert!(bound(&s, r).is_empty()); + ex(&mut s, "variable.set", json!({"variable": "brand", "value": "#123456"})); + assert!(s.doc().unwrap().node(r).unwrap().fills.is_empty(), "the variable doesn't bring the fill back"); +} + +#[test] +fn paint_opacity_edits_keep_the_colour_binding() { + let (mut s, r) = setup(); + ex(&mut s, "variable.bind", json!({"ids": [r], "field": "fill", "variable": "brand"})); + ex(&mut s, "fill.set", json!({"ids": [r], "opacity": 0.5})); + ex(&mut s, "variable.set", json!({"variable": "brand", "value": "#0000FF"})); + assert_eq!(fill_hex(&s, r), ["0000FF"], "the colour still follows the variable"); + assert_eq!(s.doc().unwrap().node(r).unwrap().fills[0].opacity, 0.5); + // The same colour with another opacity, through node.set, keeps it too. + ex(&mut s, "node.set", json!({"ids": [r], "props": {"fills": [{"type": "solid", "color": "#0000FF", "opacity": 0.25}]}})); + assert_eq!(bound(&s, r).len(), 1); + assert_eq!(s.doc().unwrap().node(r).unwrap().fills[0].opacity, 0.25); +} + +#[test] +fn paints_set_with_their_binding_in_the_same_call_keep_it() { + let (mut s, r) = setup(); + ex(&mut s, "variable.bind", json!({"ids": [r], "field": "fill", "variable": "brand"})); + let brand = brand_id(&s); + ex(&mut s, "node.set", json!({"ids": [r], "props": {"fills": ["#00FF00"], "boundVariables": {"fill": brand}}})); + assert_eq!(bound(&s, r), [("fill".to_string(), brand)]); + assert_eq!(fill_hex(&s, r), ["FF0000"], "the binding given with the paints applies"); +} diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index a4769a35c..ae2f1dc89 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -1342,7 +1342,7 @@ fn paint_set(s: &mut Session, p: &Value, fills: bool) -> Result { if let Some(b) = blend(p, "blend") { slot.blend = b; } - super::lists::remap_stop_bindings(n, fills, at, &old); + super::lists::rebind_edited_paint(n, fills, at, &old); if fills { n.styles.fill = None; } else { diff --git a/crates/engine/src/cmd/lists.rs b/crates/engine/src/cmd/lists.rs index 769d0a29c..287c9ddd0 100644 --- a/crates/engine/src/cmd/lists.rs +++ b/crates/engine/src/cmd/lists.rs @@ -112,7 +112,8 @@ pub fn stop_binding(field: &str) -> Option { /// Keep the gradient stop bindings of paint `index` of `n`'s fills (or strokes) on their stops after /// the paint changed from `old`: one stop removed shifts the later ones down (the removed one's /// binding goes); a paint that is no longer a gradient drops them. Other edits keep stop indices. -pub(crate) fn remap_stop_bindings(n: &mut Node, fills: bool, index: usize, old: &figcraft_color::Paint) { +/// Returns the removed stop's index. +pub(crate) fn remap_stop_bindings(n: &mut Node, fills: bool, index: usize, old: &figcraft_color::Paint) -> Option { use figcraft_color::PaintKind; let list = if fills { BoundList::Fills } else { BoundList::Strokes }; let new = if fills { n.fills.get(index) } else { n.strokes.get(index) }; @@ -122,11 +123,11 @@ pub(crate) fn remap_stop_bindings(n: &mut Node, fills: bool, index: usize, old: // The first stop that differs is the removed one when the rest moved down unchanged. let k = a.stops.iter().zip(&b.stops).position(|(x, y)| x != y).unwrap_or(b.stops.len()); if a.stops.get(k + 1..) != b.stops.get(k..) { - return; + return None; } Some(k) } - (_, Some(PaintKind::Gradient(_))) => return, + (_, Some(PaintKind::Gradient(_))) => return None, _ => None, }; let keys: Vec<(String, Option)> = n @@ -150,6 +151,42 @@ pub(crate) fn remap_stop_bindings(n: &mut Node, fills: bool, index: usize, old: } } n.bound.extend(kept); + removed +} + +/// After an explicit edit changed paint `index` of `n`'s fills (or strokes) from `old`: its stop +/// bindings follow a removed stop, then each binding whose value the edit changed (the colour, the +/// opacity, a stop's colour) lets go, so the edit stays instead of being put back from the +/// variable. Bindings whose value the edit kept stay; a paint that is gone takes its bindings. +pub(crate) fn rebind_edited_paint(n: &mut Node, fills: bool, index: usize, old: &figcraft_color::Paint) { + let removed = remap_stop_bindings(n, fills, index, old); + let mut old = old.clone(); + if let (Some(k), figcraft_color::PaintKind::Gradient(g)) = (removed, &mut old.kind) + && k < g.stops.len() + { + g.stops.remove(k); + } + let list = if fills { BoundList::Fills } else { BoundList::Strokes }; + let new = if fills { n.fills.get(index) } else { n.strokes.get(index) }.cloned(); + n.bound.retain(|key, _| match list_binding(key) { + Some((l, i, field)) if l == list && i == index => new.as_ref().is_some_and(|new| paint_field_kept(&old, new, field)), + _ => true, + }); +} + +/// Whether a paint's bound `field` (`color`, `opacity`, `stops//color`, …) has the same value in +/// `new` as in `old`. +fn paint_field_kept(old: &figcraft_color::Paint, new: &figcraft_color::Paint, field: &str) -> bool { + use figcraft_color::PaintKind; + match field { + "color" => matches!((&old.kind, &new.kind), (PaintKind::Solid { color: a }, PaintKind::Solid { color: b }) if a == b), + "opacity" => old.opacity == new.opacity, + _ => match (stop_binding(field), &old.kind, &new.kind) { + (Some(j), PaintKind::Gradient(a), PaintKind::Gradient(b)) => a.stops.get(j).map(|s| s.color) == b.stops.get(j).map(|s| s.color), + (Some(_), _, _) => false, + _ => old == new, + }, + } } /// Where item `k` lands when the item at `from` moves to `to`. diff --git a/crates/engine/src/cmd/props.rs b/crates/engine/src/cmd/props.rs index 8a1f4e1cd..5df46003c 100644 --- a/crates/engine/src/cmd/props.rs +++ b/crates/engine/src/cmd/props.rs @@ -315,18 +315,32 @@ fn layout_mut<'a>(cmd: &str, k: &str, n: &'a mut Node) -> Result<&'a mut AutoLay Ok(ensure_layout(n)) } -/// Apply a property map to one node. `x`/`y` are relative to the parent. -pub fn apply(cmd: &str, doc: &mut Document, id: NodeId, props: &Map) -> Result<()> { - let mut unknown = Vec::new(); - // Geometry keys first so rotation applies to the final size. - let order = |k: &str| match k { +/// Replace a node's fills (or strokes). Bindings on the paints whose bound values the new list +/// changed let go, as an explicit edit does (see `lists::rebind_edited_paint`). +fn set_paints(n: &mut Node, fills: bool, paints: Vec) { + let old = std::mem::replace(if fills { &mut n.fills } else { &mut n.strokes }, paints); + for (i, p) in old.iter().enumerate() { + super::lists::rebind_edited_paint(n, fills, i, p); + } +} + +/// The order [`apply`] takes keys in: geometry first so rotation applies to the final size, variable +/// bindings last so paints set in the same call don't detach them. +fn apply_order(k: &str) -> u8 { + match k { "width" | "height" | "w" | "h" => 0, "rotation" => 2, "x" | "y" => 3, + "boundVariables" => 4, _ => 1, - }; + } +} + +/// Apply a property map to one node. `x`/`y` are relative to the parent. +pub fn apply(cmd: &str, doc: &mut Document, id: NodeId, props: &Map) -> Result<()> { + let mut unknown = Vec::new(); let mut keys: Vec<(&String, &Value)> = props.iter().collect(); - keys.sort_by_key(|(k, _)| order(k)); + keys.sort_by_key(|(k, _)| apply_order(k)); for (k, v) in keys { let k = k.as_str(); match k { @@ -398,15 +412,15 @@ pub fn apply(cmd: &str, doc: &mut Document, id: NodeId, props: &Map doc.get_mut(id)?.fills = paints_of(v).ok_or_else(|| bad(cmd, "`fills` must be paints or colours"))?, + "fills" => set_paints(doc.get_mut(id)?, true, paints_of(v).ok_or_else(|| bad(cmd, "`fills` must be paints or colours"))?), "fill" => { let c = color_of(v).ok_or_else(|| bad(cmd, "`fill` must be a colour"))?; - doc.get_mut(id)?.fills = vec![Paint::solid(c)]; + set_paints(doc.get_mut(id)?, true, vec![Paint::solid(c)]); } - "strokes" => doc.get_mut(id)?.strokes = paints_of(v).ok_or_else(|| bad(cmd, "`strokes` must be paints or colours"))?, + "strokes" => set_paints(doc.get_mut(id)?, false, paints_of(v).ok_or_else(|| bad(cmd, "`strokes` must be paints or colours"))?), "stroke" => { let c = color_of(v).ok_or_else(|| bad(cmd, "`stroke` must be a colour"))?; - doc.get_mut(id)?.strokes = vec![Paint::solid(c)]; + set_paints(doc.get_mut(id)?, false, vec![Paint::solid(c)]); } "strokeWeight" => doc.get_mut(id)?.stroke.weight = f64_of(v).ok_or_else(|| bad(cmd, "`strokeWeight` must be a number"))?.max(0.0), "strokeAlign" => doc.get_mut(id)?.stroke.align = enum_of(v).ok_or_else(|| bad(cmd, "strokeAlign: inside|center|outside"))?, diff --git a/crates/engine/src/components_scale_tests.rs b/crates/engine/src/components_scale_tests.rs index c796dad8a..68465932b 100644 --- a/crates/engine/src/components_scale_tests.rs +++ b/crates/engine/src/components_scale_tests.rs @@ -747,3 +747,29 @@ fn alt_dropping_a_library_component_swaps_to_it() { assert!(doc.node(glyph).unwrap().overrides.is_empty()); let _ = std::fs::remove_dir_all(dir); } + +#[test] +fn a_fill_set_on_a_bound_instance_layer_detaches_it_as_an_override() { + // Without unbinding first: the explicit colour detaches the variable on the instance layer only, + // and stays through main edits until the override is reset. + let mut s = Session::new(); + let (chip, _) = bound_chip(&mut s); + let i = crate::params::id_of(&ex(&mut s, "instance.create", json!({"component": chip, "x": 200, "y": 0}))["id"]).unwrap(); + let bg = find_path(s.doc().unwrap(), i, &["Bg"]).unwrap(); + ex(&mut s, "node.set", json!({"ids": [bg], "props": {"fill": "#ff00ff"}})); + let n = s.doc().unwrap().node(bg).unwrap().clone(); + assert_eq!(n.fills[0].solid_color().unwrap().to_hex(), "FF00FF"); + assert!(!n.bound.contains_key("fill")); + assert!(n.overrides.contains("fills")); + let main_bg = find_path(s.doc().unwrap(), chip, &["Bg"]).unwrap(); + ex(&mut s, "node.set", json!({"ids": [main_bg], "props": {"height": 28}})); + ex(&mut s, "variable.set", json!({"variable": "Chip", "value": "#445566"})); + let doc = s.doc().unwrap(); + healthy(doc); + assert_eq!(doc.node(bg).unwrap().fills[0].solid_color().unwrap().to_hex(), "FF00FF"); + assert!(doc.node(main_bg).unwrap().bound.contains_key("fill"), "the main keeps its binding"); + ex(&mut s, "component.resetOverride", json!({"id": bg, "group": "fills"})); + let n = s.doc().unwrap().node(bg).unwrap(); + assert!(n.bound.contains_key("fill")); + assert_eq!(n.fills[0].solid_color().unwrap().to_hex(), "445566"); +} diff --git a/crates/engine/src/selection_colors.rs b/crates/engine/src/selection_colors.rs index e604c7986..875c6416b 100644 --- a/crates/engine/src/selection_colors.rs +++ b/crates/engine/src/selection_colors.rs @@ -9,7 +9,7 @@ use figcraft_doc::{Document, NodeId, NodeKind, StyleKind}; use serde::{Deserialize, Serialize}; use serde_json::{Value, json}; -use crate::cmd::lists::{BoundList, list_binding}; +use crate::cmd::lists::{BoundList, list_binding, rebind_edited_paint}; use crate::params::*; use crate::{CommandSpec, Result, Session, bad, spec}; @@ -153,37 +153,6 @@ fn checked_targets(s: &Session, p: &Value, cmd: &str) -> Result Ok(ts) } -/// Detach variables only where the explicit edit changed their value. In particular, an -/// opacity edit keeps the color binding and a range edit keeps other characters' node bindings. -fn unbind_changed(n: &mut figcraft_doc::Node, t: &PaintTarget, old: &Paint, new: &Paint) { - // Range fills override the node's paints; the node binding still belongs to other chars. - if t.range.is_some() { - return; - } - let list = if t.fills { BoundList::Fills } else { BoundList::Strokes }; - n.bound.retain(|key, _| { - let Some((l, index, field)) = list_binding(key) else { return true }; - if l != list || index != t.index { - return true; - } - match field { - "color" => match (&old.kind, &new.kind) { - (PaintKind::Solid { color: a }, PaintKind::Solid { color: b }) => a == b, - _ => false, - }, - "opacity" => old.opacity == new.opacity, - _ => { - let stop = field.strip_prefix("stops/").and_then(|s| s.strip_suffix("/color")).and_then(|s| s.parse::().ok()); - match (stop, &old.kind, &new.kind) { - (Some(i), PaintKind::Gradient(a), PaintKind::Gradient(b)) => a.stops.get(i).map(|s| s.color) == b.stops.get(i).map(|s| s.color), - (Some(_), _, _) => false, - _ => old == new, - } - } - } - }); -} - fn set_paint(s: &mut Session, p: &Value) -> Result { const CMD: &str = "selection.setPaint"; let targets = checked_targets(s, p, CMD)?; @@ -197,18 +166,22 @@ fn set_paint(s: &mut Session, p: &Value) -> Result { let old = slot.clone(); *slot = paint.clone(); let n = s.doc_mut()?.get_mut(target.id)?; - unbind_changed(n, target, &old, &paint); + // Variables detach only where the edit changed their value; range fills override the node's + // paints, whose bindings still belong to the other characters. if let Some((start, end)) = target.range { if let NodeKind::Text(t) = &mut n.kind { t.restyle(start, end, |style| style.fills = Some(paints.clone())); } - } else if target.fills { + continue; + } + if target.fills { n.fills = paints; n.styles.fill = None; } else { n.strokes = paints; n.styles.stroke = None; } + rebind_edited_paint(n, target.fills, target.index, &old); } Ok(json!({"ok": true})) } diff --git a/crates/engine/src/variables_io_tests.rs b/crates/engine/src/variables_io_tests.rs index 5c7305bb5..3a57d9eac 100644 --- a/crates/engine/src/variables_io_tests.rs +++ b/crates/engine/src/variables_io_tests.rs @@ -371,3 +371,29 @@ fn variant_properties_follow_string_variables() { assert_eq!(main(&s), variants[1]); healthy(&s); } + +#[test] +fn paints_replaced_through_node_set_keep_unchanged_stop_bindings() { + let mut s = Session::new(); + let r = gradient_rect(&mut s); + ex(&mut s, "variable.bind", json!({"ids": [r], "field": "fills/0/stops/2/color", "variable": "brand"})); + ex(&mut s, "variable.bind", json!({"ids": [r], "field": "fills/0/stops/1/color", "variable": "ink"})); + let cur = |s: &Session| s.doc().unwrap().node(r).unwrap().fills[0].clone(); + // Removing the first stop moves both bindings down with their stops. + let mut p = cur(&s); + if let PaintKind::Gradient(g) = &mut p.kind { + g.stops.remove(0); + } + ex(&mut s, "node.set", json!({"ids": [r], "props": {"fills": [p]}})); + assert_eq!(bound_keys(&s, r), ["fills/0/stops/0/color", "fills/0/stops/1/color"]); + // Recolouring one bound stop detaches that stop only. + let mut p = cur(&s); + if let PaintKind::Gradient(g) = &mut p.kind { + g.stops[0].color = Color::WHITE; + } + ex(&mut s, "node.set", json!({"ids": [r], "props": {"fills": [p]}})); + assert_eq!(bound_keys(&s, r), ["fills/0/stops/1/color"]); + ex(&mut s, "variable.set", json!({"variable": "brand", "value": "#0000ff"})); + assert_eq!(stops(&s, r), ["FFFFFF", "0000FF"]); + healthy(&s); +} From d71f24741a0de1fd6787ed00e9a80f4537e92e5e Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Sun, 18 Oct 2026 14:18:25 +0200 Subject: [PATCH 268/817] #807: test the object.mask and vector.outlineStroke refusals too Both reach wrap() (a page in a mask, a section outlined into a group) and named `object.group` before. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/convert_container_tests.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/engine/src/convert_container_tests.rs b/crates/engine/src/convert_container_tests.rs index bf682a804..be338a82f 100644 --- a/crates/engine/src/convert_container_tests.rs +++ b/crates/engine/src/convert_container_tests.rs @@ -206,6 +206,12 @@ fn wrapping_errors_name_the_command_that_was_run() { assert!(err.contains(&format!("`{cmd}`")), "{cmd}: {err}"); } let r = rect(&mut s, page, 0.0, 0.0); + let err = s.execute("object.mask", &json!({"ids": [page, r]})).unwrap_err().to_string(); + assert!(err.contains("`object.mask`"), "{err}"); + let section = id(ex(&mut s, "node.create", json!({"type": "section", "x": 300, "y": 0, "width": 100, "height": 100}))); + ex(&mut s, "node.set", json!({"ids": [section], "props": {"fills": ["#FFFFFF"], "strokes": ["#000000"], "strokeWeight": 1}})); + let err = s.execute("vector.outlineStroke", &json!({"ids": [section]})).unwrap_err().to_string(); + assert!(err.contains("`vector.outlineStroke`"), "{err}"); let f = id(ex(&mut s, "frame.create", json!({"x": 100, "y": 0, "width": 100, "height": 100}))); let inner = rect(&mut s, f, 10.0, 10.0); let err = s.execute("object.wrapInSection", &json!({"ids": [inner, r]})).unwrap_err().to_string(); From 9ae3223d22ec8dbd3f21f336ab04d3820b6f62b7 Mon Sep 17 00:00:00 2001 From: Lucas Date: Sun, 18 Oct 2026 14:20:19 +0200 Subject: [PATCH 269/817] feat(i18n): Complete Polish translation (pl) Add full Polish localization for FigCraft UI, commands, and menus. Includes Polish CLDR integer plural rules (one, few, many, other) and eliminates all untranslated strings and borrowings. Co-Authored-By: Antigravity --- crates/ui-egui/locales/pl.toml | 2325 ++++++++++++++++++++++++++++++++ crates/ui-egui/src/i18n.rs | 6 +- 2 files changed, 2328 insertions(+), 3 deletions(-) create mode 100644 crates/ui-egui/locales/pl.toml diff --git a/crates/ui-egui/locales/pl.toml b/crates/ui-egui/locales/pl.toml new file mode 100644 index 000000000..de3c727e8 --- /dev/null +++ b/crates/ui-egui/locales/pl.toml @@ -0,0 +1,2325 @@ +# FigCraft interface strings: Polish. +# +# Complete, native-quality Polish localization for FigCraft. +# Clean-room implementation adhering strictly to ArtCraft standards. + +[meta] +name = "Polski" + +[ui] +"% of all commits" = "% wszystkich commitów" +"(no longer published)" = "(już niepublikowane)" +"({n} warnings: some entries were skipped)" = { one = "({n} ostrzeżenie: niektóre wpisy zostały pominięte)", few = "({n} ostrzeżenia: niektóre wpisy zostały pominięte)", many = "({n} ostrzeżeń: niektóre wpisy zostały pominięte)", other = "({n} ostrzeżeń: niektóre wpisy zostały pominięte)" } +"+ Create variable" = "+ Utwórz zmienną" +".fig (experimental)" = ".fig (eksperymentalny)" +"1…9, 0" = "1…9, 0" +"@{login}: {prs} PRs, {commits} commits, +{added} / −{deleted} lines (Δ {delta}), +{bin_added} / −{bin_deleted} binary assets, {first} – {last}" = "@{login}: PR: {prs}, commitów: {commits}, +{added} / −{deleted} wierszy (Δ {delta}), +{bin_added} / −{bin_deleted} zasobów binarnych, {first} – {last}" +"A collection of this file with these modes and variables: override their values per mode and add variables of its own" = "Kolekcja tego pliku z tymi trybami i zmiennymi: nadpisuj ich wartości dla poszczególnych trybów i dodawaj własne zmienne" +"A .figcraft file with this name already exists. Choose its full name to confirm replacement." = "Plik .figcraft o tej nazwie już istnieje. Wybierz pełną nazwę, aby potwierdzić zastąpienie." +"A layer on its own aligns to its frame: select more layers, or one in a frame" = "Pojedyncza warstwa wyrównuje się do swojej ramki: zaznacz więcej warstw lub warstwę w ramce" +"A responsive product page: hero, features, figures, a quote and a footer" = "Responsywna strona produktu: sekcja hero, funkcje, statystyki, cytat i stopka" +"A spring plays until it settles: its mass, stiffness and damping set how long" = "Animacja sprężynowa trwa do ustabilizowania: jej masa, sztywność i tłumienie określają czas" +"A title, an agenda, a big figure, a chart and a closing slide" = "Tytuł, agenda, wyróżniona liczba, wykres i slajd końcowy" +"A to Z" = "Od A do Z" +"About" = "O programie" +"About FigCraft" = "O programie FigCraft" +"About this server" = "O tym serwerze" +"Action" = "Akcja" +"Actions" = "Akcje" +"Actions for {name}" = "Akcje dla: {name}" +"Actions…" = "Akcje…" +"Active" = "Aktywny" +"Actual size (100%)" = "Rozmiar rzeczywisty (100%)" +"Add a category" = "Dodaj kategorię" +"Add a comment" = "Dodaj komentarz" +"Add a description" = "Dodaj opis" +"Add a frame (F) or a shape (R) to get started" = "Dodaj ramkę (F) lub kształt (R), aby rozpocząć" +"Add a layer or component to tile first" = "Najpierw dodaj warstwę lub komponent do powielenia" +"Add a note for developers" = "Dodaj notatkę dla programistów" +"Add action" = "Dodaj akcję" +"Add actions for when no condition holds" = "Dodaj akcje wykonywane, gdy żaden warunek nie jest spełniony" +"Add an annotation for developers" = "Dodaj adnotację dla programistów" +"Add another condition" = "Dodaj kolejny warunek" +"Add auto layout" = "Dodaj Auto layout" +"Add background behind overlay" = "Dodaj tło za nakładką" +"Add content to this slot" = "Dodaj zawartość do tego gniazda" +"Add dev resource" = "Dodaj zasób programistyczny" +"Add effect" = "Dodaj efekt" +"Add export setting" = "Dodaj ustawienie eksportu" +"Add fill" = "Dodaj wypełnienie" +"Add interaction" = "Dodaj interakcję" +"Add layout grid" = "Dodaj siatkę układu" +"Add library" = "Dodaj bibliotekę" +"Add library file…" = "Dodaj plik biblioteki…" +"Add max height" = "Dodaj maksymalną wysokość" +"Add max width" = "Dodaj maksymalną szerokość" +"Add min height" = "Dodaj minimalną wysokość" +"Add min width" = "Dodaj minimalną szerokość" +"Add mode" = "Dodaj tryb" +"Add new page" = "Dodaj nową stronę" +"Add or update collections from a variables JSON" = "Dodaj lub zaktualizuj kolekcje z pliku JSON ze zmiennymi" +"Add properties to make instances configurable" = "Dodaj właściwości, aby umożliwić konfigurację instancji" +"Add reaction" = "Dodaj reakcję" +"Add starting point" = "Dodaj punkt startowy" +"Add stroke" = "Dodaj obrys" +"Add variant" = "Dodaj wariant" +"Add variant with a new value" = "Dodaj wariant z nową wartością" +"Added" = "Dodano" +"Added the library \"{name}\"" = "Dodano bibliotekę „{name}”" +"Adding to {name}" = "Dodawanie do: {name}" +"Adjust" = "Dopasowanie" +"Adjustment presets" = "Presety korekt" +"Advanced" = "Zaawansowane" +"Advanced stroke" = "Zaawansowany obrys" +"After delay" = "Po opóźnieniu" +"After delay {ms}ms" = "Po opóźnieniu {ms} ms" +"Align" = "Wyrównaj" +"Align bottom" = "Wyrównaj do dołu" +"Align center" = "Wyrównaj do środka" +"Align horizontal centers" = "Wyrównaj poziomo do środka" +"Align left" = "Wyrównaj do lewej" +"Align middle" = "Wyrównaj do środka pionowo" +"Align right" = "Wyrównaj do prawej" +"Align text baselines" = "Wyrównaj do linii bazowych tekstu" +"Align top" = "Wyrównaj do góry" +"Align vertical centers" = "Wyrównaj pionowo do środka" +"Alignment" = "Wyrównanie" +"All" = "Wszystko" +"All categories" = "Wszystkie kategorie" +"All comments" = "Wszystkie komentarze" +"All components" = "Wszystkie komponenty" +"All fonts" = "Wszystkie czcionki" +"All supported properties" = "Wszystkie obsługiwane właściwości" +"All variables" = "Wszystkie zmienne" +"Alpha" = "Alfa" +"Alphabetical" = "Alfabetycznie" +"Alt+drag" = "Alt+przeciągnięcie" +"An analytics screen on a grid: figures, charts drawn from vectors and a table" = "Ekran analityczny na siatce: wykresy wektorowe, liczby i tabela" +"An invite link that opens FigCraft and joins" = "Link z zaproszeniem otwierający FigCraft i dołączający do sesji" +"Anchor" = "Punkt zaczepienia" +"Android" = "Android" +"Angular" = "Kątowy" +"Animation" = "Animacja" +"Annotations" = "Adnotacje" +"Annotations shown on the canvas" = "Adnotacje widoczne na płótnie" +"Another server, or one that needs its key. The usual server is set in Preferences." = "Inny serwer lub serwer wymagający klucza. Domyślny serwer konfiguruje się w Preferencjach." +"Any status" = "Dowolny status" +"Anyone on your network with this code can edit the file, while this app stays open." = "Każdy w Twojej sieci z tym kodem może edytować plik, dopóki ta aplikacja pozostaje otwarta." +"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." = "Każdy z linkiem do edycji może modyfikować plik; link do podglądu pozwala tylko oglądać. Linki zawierają tokeny: traktuj je jak hasła. Polecenie `figcraft-server links` tworzy i unieważnia linki." +"Anyone with this code can edit the file." = "Każdy z tym kodem może edytować plik." +"Anyone with this code can look at the file, not change it." = "Każdy z tym kodem może przeglądać plik bez możliwości zmian." +"Appearance" = "Wygląd" +"Apply a component property" = "Zastosuj właściwość komponentu" +"Apply variable" = "Zastosuj zmienną" +"Apply variable to text" = "Zastosuj zmienną do tekstu" +"Apply variable to visibility" = "Zastosuj zmienną do widoczności" +"Apps" = "Aplikacje" +"Apr" = "Kwi" +"Arc" = "Łuk" +"Arc ratio" = "Proporcja łuku" +"Arc start" = "Początek łuku" +"Arc sweep" = "Rozpiętość łuku" +"Archive" = "Zarchiwizuj" +"Archived" = "Zarchiwizowano" +"Arrange" = "Ułóż" +"Arrow" = "Strzałka" +"As typed" = "Zgodnie z wpisanym" +"Asking the server…" = "Odpytywanie serwera…" +"Assets" = "Zasoby" +"Aug" = "Sie" +"Auto" = "Automatycznie" +"Auto (space around)" = "Automatycznie (odstęp dookoła)" +"Auto (space between)" = "Automatycznie (odstęp między)" +"Auto (space evenly)" = "Automatycznie (równy odstęp)" +"Auto ({mode})" = "Automatycznie ({mode})" +"Auto columns" = "Automatyczne kolumny" +"Auto gap" = "Automatyczny odstęp" +"Auto height" = "Automatyczna wysokość" +"Auto layout" = "Automatyczny układ" +"Auto rows" = "Automatyczne wiersze" +"Auto width" = "Automatyczna szerokość" +"Back to the FigCraft server" = "Powrót do serwera FigCraft" +"Back to the font's value" = "Powrót do wartości czcionki" +"Back" = "Tył" +"Back to Ready for dev" = "Powrót do Gotowe do wdrożenia" +"Back to Ready for dev: the next change compares with how it is now" = "Powrót do Gotowe do wdrożenia: kolejna zmiana zostanie porównana ze stanem obecnym" +"Back to assets" = "Powrót do zasobów" +"Back to current" = "Powrót do bieżącej" +"Back to styles" = "Powrót do stylów" +"Back to the canvas from a focused region" = "Powrót do płótna z wybranego obszaru" +"Back to the current version" = "Powrót do bieżącej wersji" +"Back to the values the font style implies" = "Powrót do wartości wynikających ze stylu czcionki" +"Background" = "Tło" +"Background blur" = "Rozmycie tła" +"Basics" = "Podstawy" +"Before" = "Przed" +"Bend" = "Wygnij" +"Bevel" = "Ścięte" +"Binary assets added" = "Dodane pliki binarne" +"Binary assets removed" = "Usunięte pliki binarne" +"Black & white" = "Czerń i biel" +"Bleed" = "Spad" +"Bleed marks" = "Znaczniki spadu" +"Bleed marks need a bleed" = "Znaczniki spadu wymagają zdefiniowania spadu" +"Blend" = "Mieszanie" +"Blend mode" = "Tryb mieszania" +"Blue" = "Niebieski" +"Blur" = "Rozmycie" +"Boolean" = "Wartość logiczna" +"Boolean groups" = "Grupy logiczne (Boolean)" +"Both directions" = "W obu kierunkach" +"Bottom" = "Dół" +"Bottom left radius" = "Promień lewego dolnego narożnika" +"Bottom right radius" = "Promień prawego dolnego narożnika" +"Branch" = "Gałąź" +"Branch archived" = "Gałąź zarchiwizowana" +"Branch merged" = "Gałąź scalona" +"Branch name" = "Nazwa gałęzi" +"Branch of {file}" = "Gałąź pliku {file}" +"Branch of {file} · merged or archived" = "Gałąź pliku {file} · scalona lub zarchiwizowana" +"Branch updated from main" = "Gałąź zaktualizowana z głównej" +"Branch {name}" = "Gałąź {name}" +"Branches" = "Gałęzie" +"Bound to {name}. Click to detach the variable." = "Powiązano z: {name}. Kliknij, aby odłączyć zmienną." +"Bring forward" = "Przenieś do przodu" +"Bring the main file's changes into the branch" = "Pobierz zmiany z pliku głównego do gałęzi" +"Bring to front" = "Przenieś na wierzch" +"Bristle" = "Włosiankowy" +"Browse" = "Przeglądaj" +"Brush" = "Pędzel" +"Brush rotation jitter" = "Fluktuacja obrotu pędzla" +"Brush scatter" = "Rozrzut pędzla" +"Brush size jitter" = "Fluktuacja rozmiaru pędzla" +"Brush spacing" = "Odstęp pędzla" +"Bulleted list" = "Lista punktowana" +"C or Shift+C" = "C lub Shift+C" +"C or ⇧C" = "C lub ⇧C" +"CMYK colour" = "Kolor CMYK" +"Can view" = "Może przeglądać" +"Checking the server…" = "Sprawdzanie serwera…" +"Clear from this list" = "Usuń z tej listy" +"Code or invite link" = "Kod lub link z zaproszeniem" +"Color profile: {name}" = "Profil kolorów: {name}" +"Colour and text styles, Light and Dark variables, buttons, inputs and cards" = "Style kolorów i tekstu, zmienne Jasne i Ciemne, przyciski, pola wprowadzania i karty" +"Convert to frame" = "Konwertuj na ramkę" +"Convert to section" = "Konwertuj na sekcję" +"CSS custom properties…" = "Właściwości niestandardowe CSS…" +"Can edit" = "Może edytować" +"Can't read this library: {e}" = "Nie można odczytać tej biblioteki: {e}" +"Cancel" = "Anuluj" +"Canvas" = "Płótno" +"Canvas stacking" = "Kolejność na płótnie" +"Cap height to baseline" = "Wysokość wersalików do linii bazowej" +"Case" = "Wielkość liter" +"Case-sensitive forms" = "Formy zależne od wielkości liter" +"Categories" = "Kategorie" +"Center" = "Środek" +"Change alias" = "Zmień alias" +"Change resolved" = "Zmiana rozwiązana" +"Change style" = "Zmień styl" +"Change to" = "Zmień na" +"Change to needs a layer inside a variant" = "Opcja Zmień na wymaga warstwy wewnątrz wariantu" +"Changed" = "Zmieniono" +"Changed on both sides: keep one" = "Zmieniono po obu stronach: zachowaj jedną wersję" +"Changes on main" = "Zmiany w gałęzi głównej" +"Changes on the branch" = "Zmiany w gałęzi" +"Changes unknown" = "Nieznane zmiany" +"Choose React, Leptos, SwiftUI or Compose above to connect this component to its code." = "Wybierz React, Leptos, SwiftUI lub Compose powyżej, aby połączyć ten komponent z jego kodem." +"Choose another profile to change it." = "Wybierz inny profil, aby go zmienić." +"Choose collection" = "Wybierz kolekcję" +"Choose image" = "Wybierz obraz" +"Choose mode" = "Wybierz tryb" +"Choose variable" = "Wybierz zmienną" +"Circle" = "Koło" +"Clear recent" = "Wyczyść ostatnie" +"Click + to replace mixed content" = "Kliknij +, aby zastąpić zawartość mieszaną" +"Click anywhere on the canvas to leave one." = "Kliknij w dowolnym miejscu na płótnie, aby zostawić komentarz." +"Click or drag to merge · {alt} removes" = "Kliknij lub przeciągnij, aby scalić · {alt} usuwa" +"Click or drag to remove · {alt} merges" = "Kliknij lub przeciągnij, aby usunąć · {alt} scala" +"Click to record a key" = "Kliknij, aby zarejestrować klawisz" +"Clip content" = "Przycinaj zawartość" +"Clip to shape" = "Przytnij do kształtu" +"Close" = "Zamknij" +"Close overlay" = "Zamknij nakładkę" +"Close preview" = "Zamknij podgląd" +"Close tab" = "Zamknij kartę" +"Close version history" = "Zamknij historię wersji" +"Close when clicking outside" = "Zamknij przy kliknięciu poza obszarem" +"Close without saving" = "Zamknij bez zapisywania" +"Code" = "Kod" +"Code syntax" = "Składnia kodu" +"Collapse" = "Zwiń" +"Collapse panel" = "Zwiń panel" +"Collection" = "Kolekcja" +"Collections" = "Kolekcje" +"Color" = "Kolor" +"Color burn" = "Ściemnianie" +"Color dodge" = "Rozjaśnianie" +"Color format" = "Format koloru" +"Color profile" = "Profil kolorów" +"Color styles" = "Style kolorów" +"Color values in this file are in this color space." = "Wartości kolorów w tym pliku są w tej przestrzeni kolorów." +"Color variables" = "Zmienne koloru" +"Colour" = "Kolor" +"Column" = "Kolumna" +"Column gap" = "Odstęp kolumn" +"Column sizes" = "Rozmiary kolumn" +"Column span" = "Rozpiętość kolumn" +"Columns" = "Kolumny" +"Columns {count}" = "Kolumny: {count}" +"Comment" = "Komentarz" +"Comments" = "Komentarze" +"Commits" = "Commity" +"Company" = "Firma" +"Compare changes" = "Porównaj zmiany" +"Compatibility notes" = "Uwagi dotyczące zgodności" +"Completed" = "Ukończone" +"Component" = "Komponent" +"Component name" = "Nazwa komponentu" +"Component property" = "Właściwość komponentu" +"Component set" = "Zestaw komponentów" +"Component sets" = "Zestawy komponentów" +"Components" = "Komponenty" +"Conditional" = "Warunek (Conditional)" +"Confetti" = "Konfetti" +"Conflicts" = "Konflikty" +"Connect to code" = "Połącz z kodem" +"Connected" = "Połączono" +"Connected to code: {from}" = "Połączono z kodem: {from}" +"Connection lost, reconnecting (attempt {attempt})…" = "Utracono połączenie, ponowne łączenie (próba {attempt})…" +"Constrain proportions" = "Zachowaj proporcje" +"Constraints" = "Więzy" +"Content" = "Zawartość" +"Contents hidden" = "Zawartość ukryta" +"Contents only" = "Tylko zawartość" +"Contextual alternates" = "Alternatywy kontekstowe" +"Contrast" = "Kontrast" +"Contributors" = "Współtwórcy" +"Contributors: {people} · Commits: {commits}" = "Współtwórcy: {people} · Commity: {commits}" +"Controller" = "Kontroler" +"Cool" = "Chłodny" +"Copied as CSS" = "Skopiowano jako CSS" +"Copied as PNG" = "Skopiowano jako PNG" +"Copied as SVG" = "Skopiowano jako SVG" +"Copied as text" = "Skopiowano jako tekst" +"Copied {value}" = "Skopiowano {value}" +"Copy" = "Kopiuj" +"Copy as" = "Kopiuj jako" +"Copy as CSS" = "Kopiuj jako CSS" +"Copy as PNG" = "Kopiuj jako PNG" +"Copy as SVG" = "Kopiuj jako SVG" +"Copy code" = "Kopiuj kod" +"Copy link" = "Kopiuj link" +"Copy the {label}" = "Kopiuj {label}" +"Copy {value}" = "Kopiuj {value}" +"Corner radius" = "Zaokrąglenie rogów" +"Corner smoothing" = "Wygładzanie narożników (Corner smoothing)" +"Couldn't download the variables" = "Nie udało się pobrać zmiennych" +"Couldn't reach {server}: showing what this computer remembers." = "Nie udało się połączyć z {server}: pokazywanie zawartości zapamiętanej przez ten komputer." +"Couldn't save automatically: {error}" = "Nie udało się zapisać automatycznie: {error}" +"Count" = "Licznik" +"Create" = "Utwórz" +"Create a variable collection first" = "Najpierw utwórz kolekcję zmiennych" +"Create a variable first" = "Najpierw utwórz zmienną" +"Create alias" = "Utwórz alias" +"Create branch" = "Utwórz gałąź" +"Create collection" = "Utwórz kolekcję" +"Create component" = "Utwórz komponent" +"Create component property" = "Utwórz właściwość komponentu" +"Create components, styles or variables to publish them as a library." = "Twórz komponenty, style lub zmienne, aby opublikować je jako bibliotekę." +"Create property…" = "Utwórz właściwość…" +"Create style" = "Utwórz styl" +"Create style from the selected text" = "Utwórz styl z zaznaczonego tekstu" +"Created" = "Utworzono" +"Crop" = "Przytnij" +"Crop marks" = "Znaczniki przycięcia" +"Ctrl+arrows" = "Ctrl+strzałki" +"Ctrl+click" = "Ctrl+kliknięcie" +"Ctrl+scroll" = "Ctrl+przewijanie" +"Current name" = "Bieżąca nazwa" +"Current version" = "Bieżąca wersja" +"Cursor chat" = "Czat kursora" +"Custom" = "Niestandardowy" +"Custom size" = "Rozmiar niestandardowy" +"Cut" = "Wytnij" +"Dark" = "Ciemny" +"Darken" = "Ciemniej" +"Dash" = "Kreska" +"Dashboard" = "Pulpit" +"Date created" = "Data utworzenia" +"Dec" = "Gru" +"Decoration style" = "Styl dekoracji" +"Decoration" = "Dekoracja tekstu" +"Deep select" = "Głębokie zaznaczanie" +"Default" = "Domyślne" +"Default content" = "Domyślna zawartość" +"Default value (the top-left variant)" = "Wartość domyślna (lewy górny wariant)" +"Delay" = "Opóźnienie" +"Delete" = "Usuń" +"Delete category (its annotations stay)" = "Usuń kategorię (jej adnotacje pozostaną)" +"Delete collection" = "Usuń kolekcję" +"Delete group" = "Usuń grupę" +"Delete mode" = "Usuń tryb" +"Delete page" = "Usuń stronę" +"Delete preset" = "Usuń ustawienie" +"Delete property" = "Usuń właściwość" +"Delete the style (layers keep their values)" = "Usuń styl (warstwy zachowają swoje wartości)" +"Delete thread" = "Usuń wątek" +"Delete variable" = "Usuń zmienną" +"Delete “{name}”? This can't be undone." = "Usunąć „{name}”? Tej operacji nie można cofnąć." +"Density" = "Gęstość" +"Depth" = "Głębia" +"Describe how and when to use this component" = "Opisz sposób i warunki użycia tego komponentu" +"Describe what changed" = "Opisz wprowadzone zmiany" +"Description" = "Opis" +"Description (optional)" = "Opis (opcjonalnie)" +"Design" = "Projektowanie" +"Design system starter" = "Pakiet startowy systemu projektowego (Design System)" +"Desktop" = "Pulpit" +"Destination" = "Miejsce docelowe" +"Detach alias" = "Odłącz alias" +"Detach instance" = "Odłącz instancję" +"Detach property" = "Odłącz właściwość" +"Detach style" = "Odłącz styl" +"Detach styles" = "Odłącz style" +"Detach variable" = "Odłącz zmienną" +"Details" = "Szczegóły" +"Dev Mode" = "Tryb deweloperski" +"Dev resources" = "Zasoby programistyczne" +"Development" = "Programowanie" +"Device" = "Urządzenie" +"Device at 100%" = "Urządzenie w 100%" +"Diamond" = "Rombowy" +"Difference" = "Różnica" +"Dimensions" = "Wymiary" +"Direction" = "Kierunek" +"Disconnect from code" = "Odłącz od kodu" +"Dispersion" = "Dyspersja" +"Display name" = "Nazwa wyświetlana" +"Dissolve" = "Rozpuszczanie" +"Distribute and tidy" = "Rozmieść i uporządkuj" +"Distribute horizontal spacing" = "Rozmieść poziomo" +"Distribute vertical spacing" = "Rozmieść pionowo" +"Divider" = "Rozdzielacz" +"Don't truncate" = "Nie obcinaj tekstu" +"Done" = "Gotowe" +"Done editing" = "Zakończ edycję" +"Dots" = "Kropki" +"Dotted" = "Kropkowany" +"Down" = "W dół" +"Drafts" = "Szkice" +"Drag the stroke to add a width point" = "Przeciągnij obrys, aby dodać punkt szerokości" +"Draw" = "Rysuj" +"Draw a frame" = "Narysuj ramkę" +"Drawing tools" = "Narzędzia rysowania" +"Drop a .figcraft, .fig, .json, .svg or image file." = "Upuść plik .figcraft, .fig, .json, .svg lub plik obrazu." +"Drop to import" = "Upuść, aby zaimportować" +"Drop to open" = "Upuść, aby otworzyć" +"Drop shadow" = "Cień" +"Dual-licensed MIT OR Apache-2.0. Made by the ArtCraft team and community." = "Podwójna licencja MIT LUB Apache-2.0. Stworzone przez zespół ArtCraft i społeczność." +"Duo" = "Duet" +"Duplicate" = "Powiel" +"Duplicate by dragging" = "Powiel przez przeciągnięcie" +"Duplicate mode" = "Powiel tryb" +"Duplicate page" = "Powiel stronę" +"Edit" = "Edycja" +"Edit as an expression" = "Edytuj jako wyrażenie" +"Edit colour" = "Edytuj kolor" +"Edit comment" = "Edytuj komentarz" +"Edit dev resource" = "Edytuj zasób programistyczny" +"Edit link" = "Edytuj link" +"Edit link copied" = "Skopiowano link do edycji" +"Edit style" = "Edytuj styl" +"Edit variable" = "Edytuj zmienną" +"Edit with the builder" = "Edytuj za pomocą kreatora" +"Edited {when}" = "Edytowano {when}" +"Effect settings" = "Ustawienia efektów" +"Effect styles" = "Style efektów" +"Effects" = "Efekty" +"Ellipse" = "Elipsa" +"Ellipses" = "Elipsy" +"Else" = "W przeciwnym razie" +"Else if" = "W przeciwnym razie jeśli" +"Embedded profile" = "Wbudowany profil" +"Empty" = "Puste" +"End" = "End" +"End point" = "Punkt końcowy" +"Ends the session; everyone keeps their copy" = "Kończy sesję; każdy zachowuje swoją kopię" +"Enter" = "Enter" +"Enter the address of a figcraft-server and press Browse to see the plugins it offers." = "Wprowadź adres figcraft-server i kliknij Przeglądaj, aby zobaczyć dostępne wtyczki." +"Enter to save · Esc to cancel" = "Enter, aby zapisać · Esc, aby anulować" +"Eraser" = "Gumka" +"Esc" = "Esc" +"Essential" = "Podstawowe" +"Every conflict has a choice." = "Każdy konflikt ma rozwiązanie do wyboru." +"Every top-level frame already starts a flow" = "Każda ramka najwyższego poziomu rozpoczyna już przepływ" +"Exact opacity (4 then 5: 45%)" = "Dokładna nieprzezroczystość (4, potem 5: 45%)" +"Exclude" = "Wyklucz" +"Excluded" = "Wykluczono" +"Excluded from layout" = "Wykluczono z układu" +"Excludes" = "Wyklucza" +"Exclusion" = "Wykluczenie" +"Exit focus view (Esc)" = "Wyjdź z widoku skupienia (Esc)" +"Expand" = "Rozwiń" +"Export" = "Eksportuj" +"Export all" = "Eksportuj wszystko" +"Export frames and layers as PNG, JPG, SVG or PDF" = "Eksportuj ramki i warstwy jako PNG, JPG, SVG lub PDF" +"Export page as PNG" = "Eksportuj stronę jako PNG" +"Export settings" = "Ustawienia eksportu" +"Export variables" = "Eksportuj zmienne" +"Export {name}" = "Eksportuj {name}" +"Export {n} layers" = { one = "Eksportuj {n} warstwę", few = "Eksportuj {n} warstwy", many = "Eksportuj {n} warstw", other = "Eksportuj {n} warstw" } +"Exported {file}" = "Wyeksportowano {file}" +"Exported {name}" = "Wyeksportowano {name}" +"Exported {name}; {n} kinds of content were left out" = { one = "Wyeksportowano {name}; pominięto {n} rodzaj zawartości", few = "Wyeksportowano {name}; pominięto {n} rodzaje zawartości", many = "Wyeksportowano {name}; pominięto {n} rodzajów zawartości", other = "Wyeksportowano {name}; pominięto {n} rodzajów zawartości" } +"Exported {n} files" = { one = "Wyeksportowano {n} plik", few = "Wyeksportowano {n} pliki", many = "Wyeksportowano {n} plików", other = "Wyeksportowano {n} plików" } +"Export…" = "Eksport…" +"Expose properties to instances" = "Udostępnij właściwości instancjom" +"Exposure" = "Czas naświetlania" +"Expression" = "Wyrażenie" +"Extend collection" = "Rozszerz kolekcję" +"Extends \"{name}\": overridden values are marked" = "Rozszerza „{name}”: nadpisane wartości są oznaczone" +"Eye" = "Oko" +"F" = "F" +"Fade" = "Zanikanie" +"False" = "Fałsz" +"Feb" = "Lut" +"Fetching from the server…" = "Pobieranie z serwera…" +"FigCraft couldn't open its window: {error}" = "FigCraft nie mógł otworzyć okna: {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 nie obsługuje jeszcze wszystkich funkcji tych plików. Uwagi wymieniają elementy pominięte lub zmienione w zaimportowanej kopii; oryginalny plik pozostaje niezmieniony." +"File" = "Plik" +"File name" = "Nazwa pliku" +"File not found" = "Nie znaleziono pliku" +"File published" = "Plik został opublikowany" +"Files aren't end-to-end encrypted: the server's operator can read them." = "Pliki nie są szyfrowane end-to-end: administrator serwera może je odczytać." +"Files nobody opens for {n} days are deleted." = { one = "Pliki, których nikt nie otwiera przez {n} dzień, są usuwane.", few = "Pliki, których nikt nie otwiera przez {n} dni, są usuwane.", many = "Pliki, których nikt nie otwiera przez {n} dni, są usuwane.", other = "Pliki, których nikt nie otwiera przez {n} dni, są usuwane." } +"Fill" = "Wypełnienie" +"Fill (fr)" = "Wypełnienie (fr)" +"Fill container" = "Wypełnij kontener" +"Fill window" = "Wypełnij okno" +"Fills" = "Wypełnienia" +"Fill|sizing" = "Fill|sizing" +"Filter and sort" = "Filtruj i sortuj" +"Find" = "Znajdź" +"Find and replace" = "Znajdź i zamień" +"Find layers" = "Znajdź warstwy" +"First" = "Pierwszy" +"First commit" = "Pierwszy commit" +"First on top" = "Pierwszy na wierzchu" +"Fit" = "Dopasuj" +"Fit device to window" = "Dopasuj urządzenie do okna" +"Fit to contents" = "Dopasuj do zawartości" +"Fit to window" = "Dopasuj do okna" +"Fit width" = "Dopasuj szerokość" +"Fixed" = "Stałe" +"Fixed gap" = "Stały odstęp" +"Fixed size" = "Stały rozmiar" +"Flatten" = "Spłaszcz" +"Flip" = "Odbij" +"Flip horizontal" = "Odbij w poziomie" +"Flip text to the other side" = "Przerzuć tekst na drugą stronę" +"Flip vertical" = "Odbij w pionie" +"Flip width profile" = "Odwróć profil szerokości" +"Flow starting point" = "Punkt startowy przepływu" +"Flow starting points" = "Punkty startowe przepływu" +"Flows" = "Przepływy" +"Focus view" = "Widok skupienia" +"Fold autosaves" = "Zwiń automatyczne zapisy" +"Folder: click to collapse" = "Folder: kliknij, aby zwinąć" +"Folder: click to expand" = "Folder: kliknij, aby rozwinąć" +"Follow" = "Obserwuj" +"Follow {name}" = "Obserwuj: {name}" +"Following" = "Obserwowanie" +"Following {name} · {key} to stop" = "Obserwowanie {name} · {key}, aby zatrzymać" +"Font" = "Czcionka" +"Font not installed" = "Czcionka niezainstalowana" +"Font size" = "Rozmiar czcionki" +"Font style" = "Styl czcionki" +"Forget on this computer" = "Zapomnij na tym komputerze" +"Four screens of a trail app with components and a prototype flow" = "Cztery ekrany aplikacji z komponentami i przepływem prototypu" +"Fractions" = "Ułamki" +"Frame" = "Ramka" +"Frame selection" = "Utwórz ramkę z zaznaczenia" +"Frame tools" = "Narzędzia ramek" +"Frames" = "Ramki" +"From the library \"{name}\": read-only" = "Z biblioteki „{name}”: tylko do odczytu" +"From {name}" = "Od {name}" +"From {server}" = "Z serwera {server}" +"Frost" = "Szron" +"Gap" = "Odstęp" +"Gap between columns" = "Odstęp między kolumnami" +"Gap between items" = "Odstęp między elementami" +"Gap between rows" = "Odstęp między wierszami" +"Getting started" = "Pierwsze kroki" +"Give the address of a server open to the public, or a server's address with its key (`figcraft-server key` prints it)." = "Podaj adres serwera publicznego lub adres serwera z jego kluczem (polecenie `figcraft-server key` go wyświetla)." +"Glass" = "Szkło" +"Go to main component" = "Przejdź do głównego komponentu" +"Go to {name}" = "Przejdź do: {name}" +"Grab bag" = "Lista dowolna" +"Gradient" = "Gradient" +"Gray" = "Szary" +"Green" = "Zielony" +"Greyscale components and two example screens to sketch a flow with" = "Komponenty w odcieniach szarości i dwa przykładowe ekrany do naszkicowania przepływu" +"Grid" = "Siatka" +"Grid ({size})" = "Siatka ({size})" +"Grid styles" = "Style siatki" +"Grid {size}" = "Siatka {size}" +"Group" = "Grupa" +"Group selection" = "Grupuj zaznaczenie" +"Groups" = "Grupy" +"Gutter" = "Odstęp" +"Hand tool" = "Narzędzie Rączka" +"Hanging list" = "Lista z wysunięciem" +"Hanging punctuation" = "Wiszące znaki interpunkcyjne" +"Hard light" = "Mocne światło" +"Height" = "Wysokość" +"Help" = "Pomoc" +"Help and resources" = "Pomoc i zasoby" +"Help page" = "Strona pomocy" +"Here: {names}" = "Tutaj: {names}" +"Hidden" = "Ukryty" +"Hide contents" = "Ukryj zawartość" +"Hide from publishing" = "Ukryj przed publikacją" +"Hide section contents" = "Ukryj zawartość sekcji" +"Hide these tips (Getting started in the Help menu shows them again)" = "Ukryj te wskazówki (Pierwsze kroki w menu Pomoc wyświetli je ponownie)" +"Hide when publishing" = "Ukryj podczas publikacji" +"Highlight layers on hover" = "Wyróżniaj warstwy po najechaniu kursorem" +"Highlights" = "Światła" +"Hold Alt" = "Przytrzymaj Alt" +"Hold Alt+Z" = "Przytrzymaj Alt+Z" +"Hold Ctrl" = "Przytrzymaj Ctrl" +"Hold Z" = "Przytrzymaj Z" +"Hold ⌃ or ⌘" = "Przytrzymaj ⌃ lub ⌘" +"Hold ⌥" = "Przytrzymaj ⌥" +"Hold ⌥Z" = "Przytrzymaj ⌥Z" +"Home" = "Start" +"Horizontal" = "Poziomo" +"Horizontal align" = "Wyrównanie poziome" +"Horizontal hex" = "Poziomy sześciokąt" +"Horizontal padding" = "Marginesy poziome" +"Horizontal spacing" = "Odstępy poziome" +"Hosted by {operator}" = "Hostowane przez {operator}" +"Hover a layer to see its properties" = "Najedź na warstwę, aby zobaczyć jej właściwości" +"Hover other layers to measure the distance" = "Najedź na inne warstwy, aby zmierzyć odległość" +"Hue" = "Odcień" +"Hug" = "Dopasuj" +"Hug contents" = "Dopasuj do zawartości" +"Icon components on a 24 px grid with keylines and a size preview" = "Komponenty ikon na siatce 24 px z liniami pomocniczymi i podglądem rozmiaru" +"Icon set starter" = "Zestaw początkowy ikon" +"If it keeps happening, please report it at {link} with this message." = "Jeśli problem będzie się powtarzał, zgłoś go pod adresem {link}, dołączając tę wiadomość." +"If" = "Jeżeli" +"If {condition}" = "Jeżeli {condition}" +"Ignore auto layout (absolute position)" = "Ignoruj automatyczny układ (pozycja bezwzględna)" +"Image" = "Obraz" +"Images" = "Obrazy" +"Import" = "Importuj" +"Import path" = "Ścieżka importu" +"Import plugin from manifest" = "Zaimportuj wtyczkę z manifestu" +"Import plugin from manifest…" = "Zaimportuj wtyczkę z manifestu…" +"Import report" = "Raport importu" +"Import variables" = "Importuj zmienne" +"Imported document" = "Zaimportowany dokument" +"Imported {name}" = "Zaimportowano {name}" +"Imported {n} new variables, updated {updated}" = { one = "Zaimportowano {n} nową zmienną, zaktualizowano {updated}", few = "Zaimportowano {n} nowe zmienne, zaktualizowano {updated}", many = "Zaimportowano {n} nowych zmiennych, zaktualizowano {updated}", other = "Zaimportowano {n} nowych zmiennych, zaktualizowano {updated}" } +"Import…" = "Importuj…" +"In an instance, this comes from the main component" = "W instancji pochodzi to z głównego komponentu" +"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)." = "W przeglądarce możesz dołączać do sesji hostowanych przez aplikację desktopową oraz do plików na serwerze FigCraft. Strona otwarta przez https łączy się z innymi komputerami tylko przez linki wss:// (serwer za TLS)." +"Include bounding box" = "Dołącz ramkę otaczającą" +"Include id attribute" = "Dołącz atrybut id" +"Included" = "Uwzględniono" +"Included in layout" = "Uwzględniono w układzie" +"Individual corners" = "Niezależne narożniki" +"Individual strokes" = "Niezależne obrysy" +"Ink" = "Farba" +"Inner shadow" = "Cień wewnętrzny" +"Inside" = "Wewnątrz" +"Inspect" = "Inspekcja" +"Inspect the layer under the pointer: size, colours, typography" = "Sprawdź warstwę pod kursorem: rozmiar, kolory, typografia" +"Install plugin" = "Zainstaluj wtyczkę" +"Install" = "Zainstaluj" +"Installed {name}" = "Zainstalowano {name}" +"Installed" = "Zainstalowano" +"Installing…" = "Instalowanie…" +"Instance" = "Instancja" +"Instance properties" = "Właściwości instancji" +"Instance swap" = "Podmiana instancji" +"Instance swap (no other component)" = "Podmiana instancji (brak innego komponentu)" +"Instances" = "Instancje" +"Instant" = "Natychmiastowo" +"Interaction" = "Interakcja" +"Interactions" = "Interakcje" +"Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Projektowanie interfejsów i prototypowanie. Darmowe, otwartoźródłowe, czysto implementowane narzędzie projektowe napisane od podstaw w Rust, część ArtCraft Crafting Apps." +"Intersect" = "Przetnij" +"Intersects" = "Przecina" +"Invalid color" = "Nieprawidłowy kolor" +"Invite link" = "Link z zaproszeniem" +"Invite link copied" = "Skopiowano link z zaproszeniem" +"It asks permission to:" = "Wymaga uprawnień do:" +"Jan" = "Sty" +"Join" = "Połącz" +"Join code copied" = "Skopiowano kod dołączenia" +"Join code or invite link" = "Kod dołączenia lub link z zaproszeniem" +"Join live session" = "Dołącz do sesji na żywo" +"Join us on Discord" = "Dołącz do nas na Discordzie" +"Join with a code" = "Dołącz za pomocą kodu" +"Joined" = "Dołączono" +"Joined {file}" = "Dołączono do: {file}" +"Joining…" = "Dołączanie…" +"Join|stroke" = "Join|stroke" +"Jul" = "Lip" +"Jun" = "Cze" +"Just now" = "Przed chwilą" +"Justify" = "Wyjustuj" +"Keep appearance" = "Zachowaj wygląd" +"Keep appearance converts every color value to {profile} so colors look the same. Keep values leaves the numbers as they are, so colors shift." = "Zachowanie wyglądu konwertuje każdą wartość koloru na {profile}, aby kolory wyglądały tak samo. Zachowanie wartości pozostawia liczby bez zmian, co może zmienić odcienie barw." +"Keep tool selected after use" = "Pozostaw narzędzie wybrane po użyciu" +"Keep values" = "Zachowaj wartości" +"Key/Gamepad" = "Klawisz/Kontroler" +"Key/Gamepad {key}" = "Klawisz/Kontroler {key}" +"Keyboard shortcuts" = "Skróty klawiaturowe" +"Kits" = "Zestawy" +"Landing page" = "Strona docelowa (Landing page)" +"Language" = "Język" +"Lasso" = "Lasso" +"Last" = "Ostatni" +"Last change: {note}" = "Ostatnia zmiana: {note}" +"Last commit" = "Ostatni commit" +"Last modified" = "Ostatnia modyfikacja" +"Last on top" = "Ostatni na wierzchu" +"Layer blur" = "Rozmycie warstwy" +"Layer name" = "Nazwa warstwy" +"Layers" = "Warstwy" +"Layers in an instance take their position from the main component" = "Warstwy w instancji przyjmują pozycję z głównego komponentu" +"Layout" = "Układ" +"Layout grid" = "Siatka układu" +"Layout grid settings" = "Ustawienia siatki układu" +"Layout grids" = "Siatki układu" +"Leave session" = "Opuść sesję" +"Leaves" = "Opuszcza" +"Left" = "Do lewej" +"Left & right" = "Lewa i prawa" +"Left side" = "Lewa strona" +"Left side width" = "Szerokość lewej strony" +"Letter case" = "Wielkość liter" +"Letter spacing" = "Światło tekstu" +"Libraries" = "Biblioteki" +"Libraries in this file" = "Biblioteki w tym pliku" +"Library updates available" = "Dostępne aktualizacje biblioteki" +"Library: click to collapse" = "Biblioteka: kliknij, aby zwinąć" +"Library: click to expand" = "Biblioteka: kliknij, aby rozwinąć" +"Library: its variables are read-only here; edit them in the library file and publish it" = "Biblioteka: jej zmienne są tutaj tylko do odczytu; edytuj je w pliku biblioteki i opublikuj" +"Light" = "Lekki" +"Lighten" = "Jaśniej" +"Light|glass" = "Light|glass" +"Line" = "Linia" +"Line arrow" = "Strzałka liniowa" +"Line delta" = "Różnica wierszy" +"Line height" = "Interlinia" +"Linear" = "Liniowy" +"Lines" = "Linie" +"Lines +/−" = "Wiersze +/−" +"Lines added" = "Dodane wiersze" +"Lines deleted" = "Usunięte wiersze" +"Link" = "Łącze" +"Link copied" = "Skopiowano link" +"Link docs, code or tickets for developers." = "Dołącz dokumentację, kod lub zgłoszenia dla programistów." +"Link frames on the Prototype tab, then present the flow" = "Połącz ramki na karcie Prototyp, a następnie zaprezentuj przepływ" +"Link this component to its code component: instances then show your real snippet with their values." = "Połącz ten komponent z jego odpowiednikiem w kodzie: instancje wyświetlą wtedy rzeczywisty fragment kodu z ich wartościami." +"List spacing" = "Odstępy listy" +"List style" = "Styl listy" +"Live session" = "Sesja na żywo" +"Live · {people}" = "Na żywo · {people}" +"Local components" = "Komponenty lokalne" +"Local network" = "Sieć lokalna" +"Local styles" = "Style lokalne" +"Local variables" = "Zmienne lokalne" +"Lock/Unlock" = "Zablokuj/Odblokuj" +"Locked" = "Zablokowane" +"Lowercase" = "Małe litery" +"Luminance" = "Luminancja" +"Luminosity" = "Jasność" +"Main" = "Główny" +"Main component deleted" = "Usunięto główny komponent" +"Main menu" = "Menu główne" +"Make a component" = "Utwórz komponent" +"Make slot" = "Utwórz gniazdo (slot)" +"Mar" = "Mar" +"Margin" = "Margines" +"Mark all as read" = "Oznacz wszystkie jako przeczytane" +"Mark as resolved" = "Oznacz jako rozwiązane" +"Mark as unread" = "Oznacz jako nieprzeczytane" +"Mark as unresolved" = "Oznacz jako nierozwiązane" +"Mask" = "Maska" +"Mass · Stiffness · Damping" = "Masa · Sztywność · Tłumienie" +"Match (empty: the whole name)" = "Dopasowanie (puste: cała nazwa)" +"Max H" = "Maks. wys." +"Max W" = "Maks. szer." +"Max lines" = "Maks. linii" +"Maximize" = "Maksymalizuj" +"May" = "maja" +"Measure to the selection" = "Zmierz odległość do zaznaczenia" +"Merge into main" = "Scal z gałęzią główną" +"Merge regions" = "Scal obszary" +"Merge the branch into the main file (one undo step) and archive it" = "Scal gałąź z plikiem głównym (jeden krok cofnięcia) i zarchiwizuj ją" +"Merged" = "Scalone" +"Merged PRs" = "Scalone PR" +"Min H" = "Min. wys." +"Min W" = "Min. szer." +"Minimize" = "Minimalizuj" +"Mirror angle" = "Kąt odbicia lustrzanego" +"Mirror angle and length" = "Kąt i długość odbicia lustrzanego" +"Mirroring" = "Odbicie lustrzane" +"Missing" = "Brak" +"Missing layer" = "Brakująca warstwa" +"Missing style" = "Brakujący styl" +"Missing variable" = "Brakująca zmienna" +"Miter" = "Ostre" +"Miter angle" = "Kąt ścięcia (miter)" +"Mixed" = "Różne wartości" +"Mixed fonts" = "Różne czcionki" +"Mixed interactions: click + to replace them" = "Różne interakcje: kliknij +, aby je zastąpić" +"Mobile app" = "Aplikacja mobilna" +"Mode" = "Tryb" +"Model" = "Model" +"Models" = "Modele" +"Mono" = "Mono" +"More" = "Więcej" +"More instance actions" = "Więcej akcji instancji" +"Mouse down" = "Naciśnięcie myszy" +"Mouse enter" = "Wskazanie myszą (Mouse enter)" +"Mouse leave" = "Opuszczenie kursora myszy" +"Mouse up" = "Zwolnienie przycisku myszy" +"Move along the toolbar or the layer rows" = "Przechodź wzdłuż paska narzędzi lub wierszy warstw" +"Move" = "Przesuń" +"Move column left" = "Przesuń kolumnę w lewo" +"Move column right" = "Przesuń kolumnę w prawo" +"Move down" = "Przesuń w dół" +"Move in" = "Wsuń" +"Move out" = "Wysuń" +"Move tools" = "Narzędzia przesuwania" +"Move up" = "Przesuń w górę" +"Moved to {name}" = "Przeniesiono do: {name}" +"Multi" = "Wiele" +"Multiply" = "Mnożenie" +"Muted" = "Stonowany" +"Name" = "Nazwa" +"Name (A–Z)" = "Nazwa (A–Z)" +"Named instance" = "Nazwana instancja" +"Navigate to" = "Przejdź do" +"Nested instance" = "Zagnieżdżona instancja" +"New design file" = "Nowy plik projektu" +"Newest first" = "Najpierw najnowsze" +"Next or previous control in the focused region" = "Następny lub poprzedni element w aktywnym obszarze" +"Next frame" = "Następna klatka" +"Next ready for dev" = "Następny element gotowy do wdrożenia" +"Next size option" = "Następna opcja rozmiaru" +"No assets: no export settings, icons or images. Add export settings in the Design tab." = "Brak zasobów: brak ustawień eksportu, ikon lub obrazów. Dodaj ustawienia eksportu na karcie Projekt." +"No boolean variables fit here." = "Żadna zmienna logiczna (boolean) tutaj nie pasuje." +"No boolean variables yet. Create them in Local variables." = "Brak zmiennych logicznych. Utwórz je w Zmiennych lokalnych." +"No branches. A branch is a copy of the file to try changes in, then review and merge." = "Brak gałęzi. Gałąź to kopia pliku do testowania zmian, a następnie ich przeglądu i scalenia." +"No category" = "Bez kategorii" +"No changes" = "Brak zmian" +"No color styles" = "Brak stylów kolorów" +"No colour variables fit here." = "Żadna zmienna koloru tutaj nie pasuje." +"No colour variables yet. Create them in Local variables." = "Brak zmiennych koloru. Utwórz je w Zmiennych lokalnych." +"No comments yet" = "Brak komentarzy" +"No compatibility warnings reported" = "Nie zgłoszono ostrzeżeń o zgodności" +"No components yet. Select layers and press {keys}." = "Brak komponentów. Zaznacz warstwy i naciśnij {keys}." +"No conflicts." = "Brak konfliktów." +"No contributor data was built into this copy." = "Ta kopia nie zawiera danych o współtwórcach." +"No device" = "Brak urządzenia" +"No fonts match" = "Brak pasujących czcionek" +"No join code here (the server is older than join codes, or this address can't be put in one): share the link instead." = "Brak kodu dołączenia (serwer jest starszy niż kody dołączenia lub ten adres nie może być zakodowany): zamiast tego udostępnij link." +"No layer changes to show." = "Brak zmian warstw do wyświetlenia." +"No libraries yet. Add a .figcraft file that was published as a library, or paste a team library's link." = "Brak bibliotek. Dodaj plik .figcraft opublikowany jako biblioteka lub wklej link do biblioteki zespołu." +"No list" = "Brak listy" +"No matching comments" = "Brak pasujących komentarzy" +"No matching components" = "Brak pasujących komponentów" +"No matching layers" = "Brak pasujących warstw" +"No matching styles" = "Brak pasujących stylów" +"No matching variables" = "Brak pasujących zmiennych" +"No mirroring" = "Brak odbicia lustrzanego" +"No model credits were built into this copy." = "Ta kopia nie zawiera informacji o modelach." +"No number variables fit here." = "Żadna zmienna liczbowa tutaj nie pasuje." +"No number variables yet. Create them in Local variables." = "Brak zmiennych liczbowych. Utwórz je w Zmiennych lokalnych." +"No other pages" = "Brak innych stron" +"No paints" = "Brak wypełnień/obrysów" +"No plugins on {server}." = "Brak wtyczek na {server}." +"No plugins yet. Import a development plugin from its figcraft-plugin.json." = "Brak wtyczek. Zaimportuj wtyczkę deweloperską z pliku figcraft-plugin.json." +"No preferred components" = "Brak preferowanych komponentów" +"No preset" = "Brak presetu" +"No saved versions yet. Save a version to mark a point in your work you can come back to." = "Brak zapisanych wersji. Zapisz wersję, aby oznaczyć punkt w pracy, do którego możesz wrócić." +"No scrolling" = "Brak przewijania" +"No shortcuts match" = "Brak pasujących skrótów" +"No status" = "Brak statusu" +"No string variables fit here." = "Żadna zmienna tekstowa tutaj nie pasuje." +"No string variables yet. Create them in Local variables." = "Brak zmiennych tekstowych. Utwórz je w Zmiennych lokalnych." +"No styles yet." = "Brak stylów." +"No styles yet. Click + to create one from the selection." = "Brak stylów. Kliknij +, aby utworzyć styl z zaznaczenia." +"No templates match your search" = "Żaden szablon nie pasuje do wyszukiwania" +"No text styles yet. Click + to create one from the selected text." = "Brak stylów tekstu. Kliknij +, aby utworzyć styl z zaznaczonego tekstu." +"No variables fit here." = "Żadne zmienne tutaj nie pasują." +"No variables yet. Create them in Local variables." = "Brak zmiennych. Utwórz je w Zmiennych lokalnych." +"Nobody else is here yet" = "Nikogo innego tu jeszcze nie ma" +"Noise" = "Szum" +"None" = "Brak" +"None." = "Brak." +"Normal" = "Zwykły" +"Not bound" = "Nieprzypisane" +"Not in a live session" = "Nie jesteś w sesji na żywo" +"Not in this font" = "Brak w tej czcionce" +"Not properties, kept as written: {names}" = "Nie są to właściwości, zachowano bez zmian: {names}" +"Not read yet" = "Jeszcze nieprzeczytane" +"Not shared" = "Nieudostępnione" +"Note {n}" = "Notatka {n}" +"Nothing changed since this was marked ready for dev." = "Nic się nie zmieniło od czasu oznaczenia jako gotowe do wdrożenia." +"Nothing here yet. Set a frame's status to list it." = "Nic tu jeszcze nie ma. Ustaw status ramki, aby ją wyświetlić." +"Nothing online yet. Use Share on a file to put it online and it is listed here." = "Brak plików online. Użyj Udostępnij na pliku, aby umieścić go online i wyświetlić tutaj." +"Nothing to export" = "Nic do wyeksportowania" +"Nov" = "Lis" +"Now" = "Teraz" +"Nudge (Shift: big nudge)" = "Krok przesunięcia (Shift: duży krok)" +"Nudge amount" = "Wielkość kroku przesunięcia" +"Number" = "Liczba" +"Number ↑" = "Liczba ↑" +"Number ↓" = "Liczba ↓" +"Numbered list" = "Lista numerowana" +"Object" = "Obiekt" +"Oct" = "Paź" +"Off" = "Wyłączone" +"Offered first when filling the slot (any content is allowed)" = "Proponowane w pierwszej kolejności przy wypełnianiu gniazda (dowolna zawartość jest dozwolona)" +"Offered first when swapping the instance (any component is allowed)" = "Proponowane w pierwszej kolejności przy podmianie instancji (dowolny komponent jest dozwolony)" +"Offset" = "Przesunięcie" +"Oldest first" = "Najpierw najstarsze" +"On click" = "Przy kliknięciu" +"On drag" = "Podczas przeciągania" +"On this page" = "Na tej stronie" +"One announcement in five common sizes: square, portrait, story, link and banner" = "Jedno ogłoszenie w pięciu popularnych rozmiarach: kwadrat, pion, relacja, link i baner" +"Online" = "Online" +"Online files" = "Pliki online" +"Online sharing is off: files are shared on the local network only." = "Udostępnianie online jest wyłączone: pliki są udostępniane tylko w sieci lokalnej." +"Only the first changed layers are listed." = "Wymieniono tylko pierwsze zmienione warstwy." +"Only the first {n} changed layers are listed." = "Wymieniono tylko pierwsze {n} zmienionych warstw." +"Only your threads" = "Tylko Twoje wątki" +"Opacity" = "Krycie" +"Opacity & blend" = "Nieprzezroczystość i mieszanie" +"Opacity 10%…90%, 0: 100%" = "Nieprzezroczystość 10%…90%, 0: 100%" +"Open" = "Otwórz" +"Open .figcraft, .svg or images" = "Otwórz .figcraft, .svg lub obrazy" +"Open branch" = "Otwórz gałąź" +"Open file" = "Otwórz plik" +"Open files" = "Otwórz pliki" +"Open in focus view" = "Otwórz w widoku skupienia" +"Open in new window" = "Otwórz w nowym oknie" +"Open invite links in FigCraft" = "Otwieraj linki z zaproszeniem w FigCraft" +"Open link" = "Otwórz łącze" +"Open link {url}" = "Otwórz link: {url}" +"Open overlay" = "Otwórz nakładkę" +"Open prototype preview" = "Otwórz podgląd prototypu" +"Open variables ({count})" = "Otwórz zmienne ({count})" +"Opened as a new document" = "Otwarto jako nowy dokument" +"Opened “{name}” in a new tab" = "Otwarto „{name}” w nowej karcie" +"Opening the file…" = "Otwieranie pliku…" +"Opening {n} files as new files" = { one = "Otwieranie jako nowy plik", few = "Otwieranie {n} plików jako nowe pliki", many = "Otwieranie {n} plików jako nowe pliki", other = "Otwieranie {n} plików jako nowe pliki" } +"Open|comments" = "Open|comments" +"Options" = "Opcje" +"Orange" = "Pomarańczowy" +"Order" = "Kolejność" +"Other apps may not open every .fig file exported here." = "Inne aplikacje mogą nie otworzyć każdego pliku .fig wyeksportowanego tutaj." +"Other" = "Inne" +"Others lose access and keep their copy; the file stays on the server for you" = "Inni tracą dostęp i zachowują swoją kopię; plik pozostaje na serwerze dla Ciebie" +"Others type this under Share ▸ Join with a code" = "Inni wpisują to w menu Udostępnij ▸ Dołącz za pomocą kodu" +"Outline stroke" = "Przekształć obrys w ścieżkę" +"Outline text" = "Kontury tekstu" +"Outlines" = "Kontury" +"Outside" = "Na zewnątrz" +"Overflow" = "Przepełnienie (overflow)" +"Overlay" = "Nakładka" +"Overlay position" = "Pozycja nakładki" +"Overridden here (the collection it extends has another value)" = "Nadpisane tutaj (kolekcja, którą rozszerza, ma inną wartość)" +"Overrides" = "Nadpisania" +"Owner token" = "Token właściciela" +"Owner token copied" = "Skopiowano token właściciela" +"PDF print options" = "Opcje druku PDF" +"PDF print settings" = "Ustawienia druku PDF" +"Padding" = "Marginesy wewnętrzne" +"Page" = "Strona" +"Pages" = "Strony" +"Pages added to the document" = "Strony dodane do dokumentu" +"Placed on the current page" = "Umieszczono na bieżącej stronie" +"Pages: {pages}" = "Strony: {pages}" +"Paint bucket" = "Wiadro z farbą" +"Pan the canvas" = "Przesuwaj płótno" +"Pan with nothing selected (Shift: farther)" = "Przesuwaj przy braku zaznaczenia (Shift: dalej)" +"Panels" = "Panele" +"Paper" = "Papier" +"Paragraph indent" = "Wcięcie akapitu" +"Paragraph indent applies to left-aligned text" = "Wcięcie akapitu dotyczy tekstu wyrównanego do lewej" +"Paragraph spacing" = "Odstęp akapitu" +"Pass through" = "Przepuszczanie" +"Paste a link (https://…)" = "Wklej link (https://…)" +"Paste a team library link (a view link)" = "Wklej link do biblioteki zespołu (link do podglądu)" +"Paste here" = "Wklej tutaj" +"Paste to replace" = "Wklej, aby zastąpić" +"Pasted design layers; {n} kinds of content were left out" = { one = "Wklejono warstwy projektu; pominięto {n} rodzaj zawartości", few = "Wklejono warstwy projektu; pominięto {n} rodzaje zawartości", many = "Wklejono warstwy projektu; pominięto {n} rodzajów zawartości", other = "Wklejono warstwy projektu; pominięto {n} rodzajów zawartości" } +"Pattern" = "Wzór" +"Pattern alignment" = "Wyrównanie wzoru" +"Pattern scale" = "Skala wzoru" +"Pattern source" = "Źródło wzoru" +"Pen" = "Pióro" +"Pencil" = "Ołówek" +"People in this file" = "Osoby w tym pliku" +"People join from anywhere with a code. The file is kept on {server} while you share it." = "Użytkownicy dołączają z dowolnego miejsca za pomocą kodu. Plik jest przechowywany na {server} podczas udostępniania." +"People on your network join with a code. Nothing goes through a server." = "Użytkownicy w Twojej sieci dołączają za pomocą kodu. Nic nie przechodzi przez serwer zewnętrzny." +"Phone" = "Telefon" +"Pick color" = "Wybierz kolor" +"Pick color (I)" = "Wybierz kolor (I)" +"Pick one font family first" = "Najpierw wybierz jedną rodzinę czcionek" +"Pick the Frame tool, then drag on the canvas or choose a device size" = "Wybierz narzędzie Ramka, a następnie przeciągnij po płótnie lub wybierz rozmiar urządzenia" +"Pin a property" = "Przypnij właściwość" +"Pinch" = "Uszczypnięcie" +"Pixel grid" = "Siatka pikseli" +"Pixel preview 1x" = "Podgląd pikselowy 1x" +"Pixel preview 2x" = "Podgląd pikselowy 2x" +"Place a shape or frame (its tool chosen)" = "Umieść kształt lub ramkę (wybrane narzędzie)" +"Place automatically" = "Umieść automatycznie" +"Place image" = "Umieść obraz" +"Plugin" = "Wtyczka" +"Plugins run in FigCraft's sandbox, without files, network or clock. Install only plugins you trust." = "Wtyczki działają w piaskownicy FigCraft, bez dostępu do plików, sieci czy zegara. Instaluj tylko zaufane wtyczki." +"Plugins" = "Wtyczki" +"Plugins & widgets" = "Wtyczki i widżety" +"Plus darker" = "Plus ciemniejszy" +"Plus lighter" = "Plus jaśniejszy" +"Point" = "Punkt" +"Points" = "Punkty" +"Polygon" = "Wielokąt" +"Polygons" = "Wielokąty" +"Port" = "Port" +"Position" = "Położenie" +"Post" = "Opublikuj" +"Preferences" = "Preferencje" +"Preferred" = "Preferowane" +"Present" = "Prezentuj" +"Present or preview" = "Prezentuj lub wyświetl podgląd" +"Present this flow" = "Prezentuj ten przepływ" +"Presentation" = "Prezentacja" +"Presentation slides" = "Slajdy prezentacji" +"Presenting: comments" = "Prezentacja: komentarze" +"Presenting: cycle the size options" = "Prezentacja: przełączaj opcje rozmiaru" +"Presenting: full screen" = "Prezentacja: pełny ekran" +"Presenting: next frame" = "Prezentacja: następna ramka" +"Presenting: previous frame" = "Prezentacja: poprzednia ramka" +"Presenting: restart" = "Prezentacja: uruchom ponownie" +"Preserve scroll position" = "Zachowaj pozycję przewijania" +"Presets" = "Ustawienia wstępne" +"Press a key…" = "Naciśnij klawisz…" +"Playground" = "Piaskownica (Playground)" +"Preview" = "Podgląd" +"Preview this flow" = "Podgląd tego przepływu" +"Preview this frame" = "Podgląd tej ramki" +"Previous frame" = "Poprzednia klatka" +"Previous ready for dev" = "Poprzedni gotowy do wdrożenia" +"Progressive" = "Progresywny" +"Properties" = "Właściwości" +"Prototype" = "Prototyp" +"Prototype preview" = "Podgląd prototypu" +"Prototype settings" = "Ustawienia prototypu" +"Publish" = "Publikuj" +"Publish changes" = "Publikuj zmiany" +"Publish to another server…" = "Publikuj na innym serwerze…" +"Publish to server" = "Publikuj na serwerze" +"Published version {v}" = "Opublikowano wersję {v}" +"Published version {v} to the server" = "Opublikowano wersję {v} na serwerze" +"Published version {v}: save the file so other files can use it" = "Opublikowano wersję {v}: zapisz plik, aby inne pliki mogły go używać" +"Published · {people}" = "Opublikowano · {people}" +"Publishing to a server needs the desktop app; in the browser you can join a server's files" = "Publikowanie na serwerze wymaga aplikacji desktopowej; w przeglądarce możesz dołączać do plików serwera" +"Publishing with the server's key." = "Publikowanie przy użyciu klucza serwera." +"Publishing…" = "Publikowanie…" +"Push" = "Wypychanie" +"Push changes to main component" = "Wypchnij zmiany do głównego komponentu" +"Put text on path" = "Umieść tekst na ścieżce" +"R" = "R" +"Radial" = "Promienisty" +"Radius" = "Promień" +"Ratio" = "Proporcje" +"Reading the library…" = "Odczytywanie biblioteki…" +"Ready for dev" = "Gotowe do wdrożenia" +"Real name" = "Imię i nazwisko" +"Recent" = "Ostatnie" +"Recent files" = "Ostatnie pliki" +"Recents" = "Ostatnie" +"Recovered {n} unsaved files after the app quit unexpectedly: save them to keep them" = { one = "Odzyskano niezapisany plik po nieoczekiwanym zamknięciu programu: zapisz go, aby go zachować", few = "Odzyskano {n} niezapisane pliki po nieoczekiwanym zamknięciu programu: zapisz je, aby je zachować", many = "Odzyskano {n} niezapisanych plików po nieoczekiwanym zamknięciu programu: zapisz je, aby je zachować", other = "Odzyskano {n} niezapisanych plików po nieoczekiwanym zamknięciu programu: zapisz je, aby je zachować" } +"Rectangle" = "Prostokąt" +"Rectangles" = "Prostokąty" +"Red" = "Czerwony" +"Reduce motion" = "Ogranicz ruch" +"Refraction" = "Załamanie światła (refrakcja)" +"Regular expression" = "Wyrażenie regularne" +"Remove" = "Usuń" +"Remove all" = "Usuń wszystko" +"Remove annotation" = "Usuń adnotację" +"Remove auto layout" = "Usuń Auto layout" +"Remove dev resource" = "Usuń zasób programistyczny" +"Remove export setting" = "Usuń ustawienie eksportu" +"Remove from recents" = "Usuń z ostatnich" +"Remove from server" = "Usuń z serwera" +"Remove from server…" = "Usuń z serwera…" +"Remove guide" = "Usuń linię pomocniczą" +"Remove interaction" = "Usuń interakcję" +"Remove library from this file" = "Usuń bibliotekę z tego pliku" +"Remove min and max" = "Usuń min. i maks." +"Remove min and max height" = "Usuń minimalną i maksymalną wysokość" +"Remove min and max width" = "Usuń minimalną i maksymalną szerokość" +"Remove regions" = "Usuń obszary" +"Remove slot" = "Usuń gniazdo" +"Remove starting point" = "Usuń punkt startowy" +"Remove stop" = "Usuń punkt" +"Remove text from path" = "Usuń tekst ze ścieżki" +"Remove the else and its actions" = "Usuń warunek przeciwny (else) i jego akcje" +"Remove this condition and its actions" = "Usuń ten warunek i jego akcje" +"Remove this file from the server? It can't be shared or opened from there again. Your copy stays open here." = "Usunąć ten plik z serwera? Nie będzie można go już stamtąd udostępnić ani otworzyć. Twoja kopia pozostanie otwarta tutaj." +"Remove {name} from session" = "Usuń {name} z sesji" +"Remove {name} from {server}?" = "Usunąć {name} z {server}?" +"Removed" = "Usunięto" +"Removed from the server" = "Usunięto z serwera" +"Removed since it was marked" = "Usunięto od momentu oznaczenia" +"Rename" = "Zmień nazwę" +"Rename duplicated layers" = "Zmień nazwę powielonych warstw" +"Rename folder" = "Zmień nazwę folderu" +"Rename group" = "Zmień nazwę grupy" +"Rename layers" = "Zmień nazwę warstw" +"Rename mode" = "Zmień nazwę trybu" +"Rename on the server" = "Zmień nazwę na serwerze" +"Rename on the server…" = "Zmień nazwę na serwerze…" +"Rename page" = "Zmień nazwę strony" +"Rename to" = "Zmień nazwę na" +"Replace all" = "Zamień wszystko" +"Replace mixed export settings" = "Zastąp zróżnicowane ustawienia eksportu" +"Replace with" = "Zamień na" +"Replace with a new interaction" = "Zastąp nową interakcją" +"Reply" = "Odpowiedz" +"Report" = "Raport" +"Report this file…" = "Zgłoś ten plik…" +"Reset" = "Resetuj" +"Reset adjustments" = "Zresetuj korekty" +"Reset all changes" = "Zresetuj wszystkie zmiany" +"Reset all overrides on this layer" = "Zresetuj wszystkie nadpisania na tej warstwie" +"Reset overrides" = "Zresetuj nadpisania" +"Reset slot" = "Zresetuj gniazdo" +"Reset this override" = "Zresetuj to nadpisanie" +"Reset to style" = "Przywróć styl" +"Reset to the inherited value" = "Przywróć wartość dziedziczoną" +"Resize by the nudge amount" = "Zmień rozmiar o wielkość kroku przesunięcia" +"Resize frames to the device's screen (or the window without a device): their constraints and auto layout respond" = "Dopasuj ramki do ekranu urządzenia (lub okna bez urządzenia): ich ograniczenia i automatyczny układ odpowiednio zareagują" +"Resize to fit" = "Dopasuj rozmiar" +"Resizing" = "Zmiana rozmiaru" +"Resolve" = "Rozwiąż" +"Resolve change" = "Rozwiąż zmianę" +"Resolved" = "Rozwiązany" +"Resources" = "Zasoby" +"Responsive" = "Responsywny" +"Restart" = "Uruchom ponownie" +"Restore" = "Przywróć" +"Restore main component" = "Przywróć główny komponent" +"Restore this version" = "Przywróć tę wersję" +"Restored “{name}”" = "Przywrócono „{name}”" +"Reverse the order" = "Odwróć kolejność" +"Reversed triangle" = "Odwrócony trójkąt" +"Review and merge" = "Przejrzyj i scal" +"Ribbon" = "Wstążka" +"Right" = "Do prawej" +"Right side" = "Prawa strona" +"Right side width" = "Szerokość prawej strony" +"Rotate 90°" = "Obróć o 90°" +"Rotate 90° right" = "Obróć o 90° w prawo" +"Rotate to landscape" = "Obróć do orientacji poziomej" +"Rotate to portrait" = "Obróć do orientacji pionowej" +"Rotation" = "Obrót" +"Rotation jitter" = "Drżenie obrotu (jitter)" +"Round" = "Okrągłe" +"Rounded" = "Zaokrąglone" +"Row" = "Wiersz" +"Row gap" = "Odstęp między wierszami" +"Row sizes" = "Rozmiary wierszy" +"Row span" = "Rozpiętość wierszy" +"Rows" = "Wiersze" +"Rows {count}" = "Wiersze: {count}" +"Rulers" = "Linijki" +"Run" = "Uruchom" +"Run {label}" = "Uruchom {label}" +"Save files automatically" = "Zapisuj pliki automatycznie" +"Search templates" = "Szukaj szablonów" +"See all templates" = "Zobacz wszystkie szablony" +"Select layers and they space themselves as their content changes" = "Zaznacz warstwy, a będą automatycznie zachowywać odstępy przy zmianie zawartości" +"SHA-256: {sha}…" = "SHA-256: {sha}…" +"Same as layer" = "Taki sam jak warstwa" +"Saturation" = "Nasycenie" +"Save" = "Zapisz" +"Save as" = "Zapisz jako" +"Save as preset…" = "Zapisz jako preset…" +"Save version {key}" = "Zapisz wersję {key}" +"Saved" = "Zapisano" +"Saved {name}" = "Zapisano: {name}" +"Say something" = "Napisz coś" +"Scale" = "Skaluj" +"Scatter" = "Rozproszenie" +"Scoping: where pickers offer it" = "Zakres: gdzie próbniki go oferują" +"Screen" = "Ekran" +"Scroll behavior" = "Zachowanie przewijania" +"Scroll to" = "Przewiń do" +"Scroll to layer" = "Przewiń do warstwy" +"Scroll with parent" = "Przewijaj z rodzicem" +"Search plugins" = "Szukaj wtyczek" +"Search" = "Szukaj" +"Search actions, layers and tools" = "Szukaj akcji, warstw i narzędzi" +"Search assets" = "Szukaj zasobów" +"Search comments" = "Szukaj komentarzy" +"Search fonts" = "Szukaj czcionek" +"Search layers" = "Szukaj warstw" +"Search shortcuts" = "Szukaj skrótów" +"Section" = "Sekcja" +"Section color" = "Kolor sekcji" +"Sections" = "Sekcje" +"Select a frame and add a starting point to present it as a flow." = "Wybierz ramkę i dodaj punkt początkowy, aby zaprezentować ją jako przepływ." +"Select a frame to preview it" = "Wybierz ramkę, aby wyświetlić jej podgląd" +"Select a layer to see its properties and code" = "Wybierz warstwę, aby zobaczyć jej właściwości i kod" +"Select all" = "Zaznacz wszystko" +"Select all with same" = "Zaznacz wszystko z takim samym" +"Select layer" = "Zaznacz warstwę" +"Select layers to apply the style to" = "Zaznacz warstwy, do których chcesz zastosować styl" +"Select layers with this color" = "Zaznacz warstwy z tym kolorem" +"Select overlapping shapes" = "Zaznacz nakładające się kształty" +"Select points to edit their position, radius and mirroring" = "Zaznacz punkty, aby edytować ich pozycję, promień i odbicie lustrzane" +"Select slot" = "Zaznacz gniazdo (slot)" +"Selection colors" = "Kolory zaznaczenia" +"Selection" = "Zaznaczenie" +"Selection box, {w} by {h} at {x}, {y}: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Ramka zaznaczenia, {w} × {h} w ({x}, {y}): strzałki przesuwają, Shift+strzałki lub {cmd}+strzałki zmieniają rozmiar, Enter zatwierdza, Escape anuluje" +"Selection box: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Ramka zaznaczenia: strzałki przesuwają, Shift+strzałki lub {cmd}+strzałki zmieniają rozmiar, Enter zatwierdza, Escape anuluje" +"Send backward" = "Przenieś do tyłu" +"Send report" = "Wyślij zgłoszenie" +"Send to back" = "Przenieś na spód" +"Sep" = "Wrz" +"Server address (ws://host:47900/)" = "Adres serwera (ws://host:47900/)" +"Server address" = "Adres serwera" +"Server for online sharing" = "Serwer do udostępniania online" +"Set as default" = "Ustaw jako domyślne" +"Set variable" = "Ustaw zmienną" +"Set variable mode" = "Ustaw tryb zmiennej" +"Set variable {name}" = "Ustaw zmienną {name}" +"Set {name} to {value}" = "Ustaw {name} na {value}" +"Shadows" = "Cienie" +"Shape" = "Kształt" +"Shape builder" = "Kreator kształtów" +"Shape tools" = "Narzędzia kształtów" +"Share" = "Udostępnij" +"Share this file" = "Udostępnij ten plik" +"Share with a code" = "Udostępnij za pomocą kodu" +"Share: live session, export" = "Udostępnianie: sesja na żywo, eksport" +"Shared" = "Udostępniono" +"Shared: copy its code from the file's menu" = "Udostępniono: skopiuj kod z menu pliku" +"Sharing a file needs the desktop app; here you can join one." = "Udostępnianie pliku wymaga aplikacji desktopowej; tutaj możesz tylko dołączyć." +"Sharing on the local network (online sharing is off: no server is set in Preferences)." = "Udostępnianie w sieci lokalnej (udostępnianie online wyłączone: brak serwera w Preferencjach)." +"Sharing on your network · {people}" = "Udostępnianie w Twojej sieci · {people}" +"Sharing online · {people}" = "Udostępnianie online · {people}" +"Sharing stopped: the file stays on the server, open only to you" = "Zatrzymano udostępnianie: plik pozostaje na serwerze, otwarty tylko dla Ciebie" +"Show" = "Pokaż" +"Show all templates" = "Pokaż wszystkie szablony" +"Show as grid" = "Pokaż jako siatkę" +"Show as list" = "Pokaż jako listę" +"Show autosaves" = "Pokaż automatyczne zapisy" +"Show behind transparent areas" = "Pokaż za przezroczystymi obszarami" +"Show comments (Shift+C)" = "Pokaż komentarze (Shift+C)" +"Show device frame" = "Pokaż ramkę urządzenia" +"Show dimensions on objects" = "Pokaż wymiary na obiektach" +"Show hotspot hints" = "Pokaż podpowiedzi obszarów klikalnych (hotspots)" +"Show in Explorer" = "Pokaż w Eksploratorze" +"Show in Finder" = "Pokaż w Finderze" +"Show in folder" = "Pokaż w folderze" +"Show only this on the canvas" = "Pokaż tylko ten element na płótnie" +"Show open" = "Pokaż otwarte" +"Show section contents" = "Pokaż zawartość sekcji" +"Show this layer" = "Pokaż tę warstwę" +"Show usage" = "Pokaż użycie" +"Show/Hide" = "Pokaż/Ukryj" +"Show/Hide UI" = "Pokaż/Ukryj interfejs" +"Side by side" = "Obok siebie" +"Sidebar" = "Panel boczny" +"Simplify stroke" = "Uprość obrys" +"Size" = "Rozmiar" +"Size jitter" = "Rozrzut rozmiaru" +"Skip ink" = "Pomiń atrament" +"Slashed zero" = "Przekreślone zero" +"Slice" = "Wycinek" +"Slices" = "Plasterki" +"Slide in" = "Wsuń slajd" +"Slide out" = "Wysuń slajd" +"Slot" = "Gniazdo (slot)" +"Slot content" = "Zawartość gniazda" +"Small capitals" = "Kapitaliki" +"Small caps" = "Kapitaliki" +"Smart animate" = "Inteligentna animacja (Smart animate)" +"Snap to pixel grid" = "Przyciągaj do siatki pikseli" +"Social and slides" = "Social media i slajdy" +"Social media" = "Media społecznościowe" +"Social post sizes" = "Rozmiary postów w mediach społecznościowych" +"Soft light" = "Łagodne światło" +"Solid" = "Jednolity" +"Some variants have the same property values: give each one a unique combination" = "Niektóre warianty mają takie same wartości właściwości: nadaj każdemu unikalną kombinację" +"Sort" = "Sortuj" +"Sort by" = "Sortuj według" +"Sort by date" = "Sortuj według daty" +"Sort by page" = "Sortuj według strony" +"Sort by {column}" = "Sortuj według: {column}" +"Space around" = "Równe odstępy z marginesem (Space around)" +"Space between" = "Równe odstępy między elementami (Space between)" +"Space drag" = "Przesuwanie spacją" +"Space evenly" = "Rozmieść równomiernie" +"Space+drag" = "Spacja+przeciągnięcie" +"Spacing" = "Odstępy" +"Spam, stolen work, abuse…" = "Spam, plagiat, naruszenie zasad…" +"Splay" = "Rozszerzenie" +"Spotlight me" = "Wyróżnij mój widok (Spotlight me)" +"Spread" = "Rozszerzenie" +"Square" = "Kwadratowe" +"Standard" = "Standardowy" +"Standard ligatures" = "Ligatury standardowe" +"Star" = "Gwiazda" +"Stars" = "Gwiazdy" +"Start" = "Uruchom" +"Start ascending from / stop descending at" = "Początek narastania od / koniec opadania w" +"Start from a blank canvas" = "Zacznij od pustego płótna" +"Start from a template" = "Zacznij od szablonu" +"Start on path" = "Początek na ścieżce" +"Start point" = "Punkt początkowy" +"Start sharing" = "Rozpocznij udostępnianie" +"Start sharing with the Share button, then pass on the code it gives" = "Rozpocznij udostępnianie przyciskiem Udostępnij, a następnie przekaż wygenerowany kod" +"Starting to share…" = "Rozpoczynanie udostępniania…" +"Status" = "Stan" +"Sticky" = "Przyklejony (sticky)" +"Stop" = "Zatrzymaj" +"Stop following {name}" = "Przestań obserwować: {name}" +"Stop session" = "Zatrzymaj sesję" +"Stop sharing" = "Zatrzymaj udostępnianie" +"Stop spotlighting" = "Zatrzymaj wyróżnianie widoku" +"Stop {n} {hex}" = "Punkt przejścia {n} {hex}" +"Stretch" = "Rozciągnięcie" +"Strikethrough" = "Przekreślenie" +"String" = "Tekst (string)" +"Stroke" = "Obrys" +"Stroke style" = "Styl obrysu" +"Stroke weight" = "Grubość obrysu" +"Strokes" = "Obrysy" +"Style" = "Styl" +"Styles" = "Style" +"Stylistic set 1" = "Zestaw stylistyczny 1" +"Stylistic set 2" = "Zestaw stylistyczny 2" +"Stylistic set 3" = "Zestaw stylistyczny 3" +"Stylistic set 4" = "Zestaw stylistyczny 4" +"Stylistic set 5" = "Zestaw stylistyczny 5" +"Subtract" = "Odejmij" +"Subtracts" = "Odejmuje" +"Suffix" = "Przyrostek" +"Suspend snapping while dragging" = "Zawieś przyciąganie podczas przeciągania" +"Swap instance" = "Podmień instancję" +"Swap library: use another library's assets of the same names" = "Podmień bibliotekę: użyj zasobów innej biblioteki o tych samych nazwach" +"Swap orientation" = "Zmień orientację" +"Swap overlay" = "Podmień nakładkę" +"Swap to {name}" = "Podmień na {name}" +"Swap width and height" = "Zamień szerokość i wysokość" +"Swapped instance" = "Podmieniono instancję" +"Swapped {n} assets" = { one = "Podmieniono {n} zasób", few = "Podmieniono {n} zasoby", many = "Podmieniono {n} zasobów", other = "Podmieniono {n} zasobów" } +"Swapped {n} assets; {missed} had no match and still use the old library" = { one = "Podmieniono {n} zasób; {missed} nie ma dopasowania i nadal używa starej biblioteki", few = "Podmieniono {n} zasoby; {missed} nie ma dopasowania i nadal używa starej biblioteki", many = "Podmieniono {n} zasobów; {missed} nie ma dopasowania i nadal używa starej biblioteki", other = "Podmieniono {n} zasobów; {missed} nie ma dopasowania i nadal używa starej biblioteki" } +"Sweep" = "Przemiatanie (sweep)" +"System" = "Systemowy" +"Tab / Shift+Tab" = "Tab / Shift+Tab" +"Table" = "Tabela" +"Tablet" = "Tablet" +"Tabular numbers" = "Cyfry tabelaryczne" +"Take the values from the first selected layer" = "Pobierz wartości z pierwszej zaznaczonej warstwy" +"Taper" = "Zwężanie" +"Taper both ends" = "Zwężaj oba końce" +"Tell the server's operator what is wrong with it" = "Poinformuj administratora serwera, co jest nie tak" +"Temperature" = "Temperatura" +"Template" = "Szablon" +"Templates" = "Szablony" +"Terms" = "Warunki" +"Text" = "Tekst" +"Text align" = "Wyrównanie tekstu" +"Text content" = "Zawartość tekstu" +"Text style" = "Styl tekstu" +"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 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." +"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." = "Plik został usunięty z serwera: nikt nie może go już stamtąd otworzyć ani do niego dołączyć, a tej operacji nie można cofnąć. Otwarte kopie pozostają u ich posiadaczy." +"The file now holds another library" = "Plik zawiera teraz inną bibliotekę" +"The file now holds another library (\"{name}\")" = "Plik zawiera teraz inną bibliotekę („{name}”)" +"The files you shared or published online from this computer. They stay on their server until you remove them." = "Pliki udostępnione lub opublikowane online z tego komputera. Pozostają na serwerze do momentu ich usunięcia." +"The link carries the session's secret: share it only with people you invite." = "Link zawiera sekret sesji: udostępniaj go tylko osobom, które zapraszasz." +"The name in your online files and on the server. The document inside keeps its own name." = "Nazwa w Twoich plikach online i na serwerze. Dokument wewnątrz zachowuje własną nazwę." +"The selection uses several text styles: click to apply one" = "Zaznaczenie używa kilku stylów tekstu: kliknij, aby zastosować jeden" +"The server deletes this file if nobody opens it before {date}." = "Serwer usunie ten plik, jeśli nikt go nie otworzy przed {date}." +"The whole file" = "Cały plik" +"Theme" = "Motyw" +"There's no destination for that action" = "Brak miejsca docelowego dla tej akcji" +"Thickness" = "Grubość" +"This branch can't be reviewed: {e}" = "Tej gałęzi nie można przejrzeć: {e}" +"This branch was merged or archived." = "Ta gałąź została scalona lub zarchiwizowana." +"This computer only" = "Tylko ten komputer" +"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." = "Ten komputer pamięta token właściciela, więc plik może być zarządzany z listy Online na ekranie głównym. Skopiuj go, aby zarządzać plikiem z innego miejsca: jest to hasło do tego pliku i nie zostanie ponownie wyświetlone." +"This condition is edited as an expression" = "Ten warunek jest edytowany jako wyrażenie" +"This file" = "Ten plik" +"This file has unsaved changes" = "Ten plik ma niezapisane zmiany" +"This file is on {server}, open only to you. Share it to let others in with a new code." = "Ten plik znajduje się na {server}, otwarty tylko dla Ciebie. Udostępnij go, aby wpuścić innych nowym kodem." +"This frame is new on the branch." = "Ta ramka jest nowa w gałęzi." +"This frame isn't on the branch." = "Tej ramki nie ma w gałęzi." +"This server is open to the public: no key needed." = "Ten serwer jest otwarty publicznie: klucz nie jest wymagany." +"This server needs its key: add ?key=… to the address (`figcraft-server key` prints it on the server's machine)." = "Ten serwer wymaga klucza: dodaj ?key=… do adresu (polecenie `figcraft-server key` wyświetla go na maszynie serwera)." +"This server takes files only with its key: see Advanced." = "Ten serwer przyjmuje pliki tylko z kluczem: zobacz Zaawansowane." +"Tidy up" = "Uporządkuj" +"Tile" = "Sąsiadująco" +"Tile type" = "Typ kafelka" +"Tint" = "Odcień barwny" +"Title" = "Tytuł" +"Title case" = "Jak W Tytule" +"To share this library with your team, publish the file to a server (Share ▸ Publish to server…), then publish the library there." = "Aby udostępnić tę bibliotekę zespołowi, opublikuj plik na serwerze (Udostępnij ▸ Publikuj na serwerze…), a następnie opublikuj tam bibliotekę." +"Toggle" = "Przełącz" +"Toggle light/dark theme" = "Przełącz motyw jasny/ciemny" +"Toggle visibility" = "Przełącz widoczność" +"Tools" = "Narzędzia" +"Top" = "Góra" +"Top & bottom" = "Góra i dół" +"Top left radius" = "Promień górnego lewego narożnika" +"Top right radius" = "Promień górnego prawego narożnika" +"Transform" = "Przekształć" +"Triangle arrow" = "Strzałka trójkątna" +"Trigger" = "Wyzwalacz" +"True" = "Prawda" +"Truncate text" = "Utnij tekst" +"Truncate with an ellipsis" = "Utnij tekst z wielokropkiem (…)" +"Try again" = "Spróbuj ponownie" +"Try another search or filter." = "Wypróbuj inne wyszukiwanie lub filtr." +"Try another word, or look at every kind." = "Wypróbuj inne słowo lub przejrzyj wszystkie typy." +"Turn a layer into a component, reuse it, and change every copy at once" = "Przekształć warstwę w komponent, używaj jej ponownie i modyfikuj wszystkie kopie naraz" +"Two digits" = "Dwie cyfry" +"Type" = "Tekst" +"Type settings" = "Ustawienia tekstu" +"Type the join code you were given, or paste an invite link." = "Wpisz otrzymany kod dołączenia lub wklej link z zaproszeniem." +"Typography" = "Typografia" +"Underline" = "Podkreślenie" +"Undo takes back only your own changes; what others changed since stays." = "Cofanie odwołuje tylko Twoje własne zmiany; modyfikacje wprowadzone przez innych pozostają." +"Ungroup" = "Rozgrupuj" +"Uniform" = "Jednolity" +"Union" = "Suma zbiorów" +"Unions" = "Sumy" +"Unknown — treated as sRGB" = "Nieznany — traktowany jako sRGB" +"Unread" = "Nieprzeczytane" +"Unresolve" = "Cofnij rozwiązanie" +"Unsaved changes" = "Niezapisane zmiany" +"Unsaved changes in {names}. Close the window and lose them?" = "Niezapisane zmiany w: {names}. Zamknąć okno i utracić je?" +"Unsaved changes: save first ({save}), or close the tab with {alt}-click to discard" = "Niezapisane zmiany: najpierw zapisz ({save}) lub zamknij kartę z {alt}-kliknięciem, aby odrzucić" +"Unsaved changes: save first, or close again with {key} to discard" = "Niezapisane zmiany: najpierw zapisz lub naciśnij ponownie {key}, aby odrzucić" +"Up" = "W górę" +"Update plugin" = "Zaktualizuj wtyczkę" +"Update" = "Aktualizuj" +"Update from main" = "Zaktualizuj z gałęzi głównej" +"Update from selection" = "Zaktualizuj z zaznaczenia" +"Updated {components} and {styles}" = "Zaktualizowano {components} i {styles}" +"Updated {name}" = "Zaktualizowano {name}" +"Updating the graphics driver often helps. To use OpenGL only, start FigCraft from a Command Prompt with:" = "Aktualizacja sterownika graficznego często pomaga. Aby używać tylko OpenGL, uruchom FigCraft z wiersza poleceń za pomocą:" +"Updating the graphics driver often helps. WGPU_BACKEND (vulkan, gl, metal) names another graphics API to try." = "Aktualizacja sterownika graficznego często pomaga. Zmienna WGPU_BACKEND (vulkan, gl, metal) pozwala wybrać inne graficzne API do wypróbowania." +"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." = "Przesyła ten plik na serwer FigCraft i synchronizuje tę kartę na bieżąco. Otrzymujesz link do edycji oraz link do podglądu." +"Uppercase" = "WIELKIE LITERY" +"Use a fixed value" = "Użyj stałej wartości" +"Use an expression, e.g. count + 1" = "Użyj wyrażenia, np. count + 1" +"Use as mask" = "Użyj jako maski" +"Use auto layout" = "Użyj automatycznego układu" +"Use number keys for opacity" = "Użyj klawiszy numerycznych dla nieprzezroczystości" +"Use the .figcraft or .fig extension." = "Użyj rozszerzenia .figcraft lub .fig." +"Use the layer's fill" = "Użyj wypełnienia warstwy" +"Used in {files} · {instances}" = "Używane w {files} · {instances}" +"Username" = "Nazwa użytkownika" +"Value" = "Wartość" +"Uses variables: each layer shows them in its own mode" = "Używa zmiennych: każda warstwa wyświetla je we własnym trybie" +"Variable" = "Zmienna" +"Variable collections" = "Kolekcje zmiennych" +"Variable modes" = "Tryby zmiennych" +"Variable width" = "Zmienna szerokość" +"Variables" = "Zmienne" +"Variables JSON…" = "JSON ze zmiennymi…" +"Variables store reusable values (colours, numbers, strings, booleans) with modes such as Light and Dark." = "Zmienne przechowują wartości wielokrotnego użytku (kolory, liczby, teksty, wartości logiczne) z trybami takimi jak Jasny i Ciemny." +"Variant" = "Wariant" +"Vector" = "Wektor" +"Vectors" = "Wektory" +"Version" = "Wersja" +"Version history" = "Historia wersji" +"Version {version}" = "Wersja {version}" +"Version {v} · {components} · {styles} · {variables}" = "Wersja {v} · {components} · {styles} · {variables}" +"Vertical" = "Pionowo" +"Vertical align" = "Wyrównanie pionowe" +"Vertical hex" = "Pionowy sześciokąt" +"Vertical padding" = "Marginesy pionowe" +"Vertical spacing" = "Odstępy pionowe" +"Vertical trim" = "Przycinanie pionowe (vertical trim)" +"View" = "Widok" +"View link" = "Link do podglądu" +"View link copied" = "Skopiowano link do podglądu" +"View only" = "Tylko podgląd" +"View only: you see every change as it happens but can't edit. Leave to keep a copy you can edit." = "Tylko podgląd: widzisz każdą zmianę w czasie rzeczywistym, ale nie możesz edytować. Opuść sesję, aby zachować kopię do edycji." +"Viewing “{name}”" = "Podglądanie „{name}”" +"Violet" = "Fiolet" +"Visibility" = "Widoczność" +"Visible" = "Widoczne" +"Vivid" = "Żywe kolory" +"WGPU_BACKEND is set and names the graphics API to use; unsetting it lets FigCraft choose." = "Zmienna WGPU_BACKEND jest ustawiona i określa używane API graficzne; jej usunięcie pozwala FigCraft dokonać wyboru." +"Warm" = "Ciepły" +"Watch" = "Zegarek" +"Wavy" = "Falisty" +"Web" = "Internet" +"Websites" = "Strony internetowe" +"WebSocket URL" = "Adres WebSocket URL" +"WebSocket URL copied" = "Skopiowano adres WebSocket URL" +"Wedge" = "Klin" +"Weight" = "Grubość" +"What you try here changes this preview and the code below, not the file" = "To, co wypróbujesz tutaj, zmienia ten podgląd i kod poniżej, a nie plik" +"What changed since it was marked ready for dev" = "Co się zmieniło od czasu oznaczenia jako gotowe do wdrożenia" +"What is wrong with this file? The server's operator gets your report." = "Co jest nie tak z tym plikiem? Administrator serwera otrzyma Twoje zgłoszenie." +"What it's for" = "Do czego to służy" +"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." = "Nie wiadomo, w stosunku do czego zaszła zmiana: ramka zmieniła się, zanim FigCraft zaczął zapisywać kopię ramek gotowych do wdrożenia. Rozwiąż zmianę (lub oznacz ponownie jako gotowe), aby móc porównywać od teraz." +"While hovering" = "Podczas najechania" +"While pressing" = "Podczas naciskania" +"White" = "Biały" +"Who runs it, its terms and how long it keeps files" = "Kto zarządza serwerem, jego regulamin i czas przechowywania plików" +"Why it changed" = "Dlaczego to się zmieniło" +"Widget" = "Widżet" +"Widgets" = "Widżety" +"Width" = "Szerokość" +"Width point" = "Punkt szerokości" +"Width profile" = "Profil szerokości" +"Wireframe kit" = "Zestaw makiet (Wireframe kit)" +"With the layers' export settings" = "Z ustawieniami eksportu warstw" +"Wrap" = "Owinięcie" +"Wrap in new section" = "Zawiń w nową sekcję" +"Yellow" = "Żółty" +"Yesterday" = "Wczoraj" +"You" = "Ty" +"You'll get the shared file as a new tab and edit it together." = "Otrzymasz udostępniony plik jako nową kartę i będziecie go edytować wspólnie." +"You're spotlighting: everyone follows your view" = "Wyróżniasz swój widok (spotlight): wszyscy podążają za Twoim widokiem" +"Your copy of the file stays open" = "Twoja kopia pliku pozostaje otwarta" +"Your copy stays open; the file stays on the server" = "Twoja kopia pozostaje otwarta; plik pozostaje na serwerze" +"Your name" = "Twoje imię i nazwisko" +"Your name in comments" = "Twoje imię w komentarzach" +"Your system asks for reduced motion: animations stay off." = "Twój system preferuje ograniczony ruch: animacje pozostają wyłączone." +"Z" = "Z" +"Z to A" = "Od Z do A" +"Zoom" = "Powiększenie" +"Zoom around the pointer" = "Powiększaj wokół kursora" +"Zoom device to fill window" = "Dopasuj urządzenie do okna z powiększeniem" +"Zoom in" = "Powiększ" +"Zoom out" = "Pomniejsz" +"Zoom to 100%" = "Powiększ do 100%" +"Zoom to 200%" = "Powiększ do 200%" +"Zoom to 50%" = "Zmniejsz do 50%" +"Zoom to fit" = "Dopasuj do okna" +"Zoom to selection" = "Powiększaj do zaznaczenia" +"Zoom tool: click to zoom in, drag an area" = "Narzędzie powiększenia: kliknij, aby przybliżyć, przeciągnij obszar" +"Zoom tool: zoom out" = "Narzędzie powiększenia: oddal" +"and {n} more" = { one = "i jeszcze {n}", few = "i jeszcze {n}", many = "i jeszcze {n}", other = "i jeszcze {n}" } +"bleed marks" = "znaczniki spadu" +"by {author}" = "autor: {author}" +"call any command its access allows" = "wywołaj dowolne polecenie, na które zezwala dostęp" +"call only: {commands}" = "wywołaj tylko: {commands}" +"can edit the document" = "może edytować dokument" +"conditional prototype actions nested too deeply were skipped" = "zbyt głęboko zagnieżdżone warunkowe akcje prototypu zostały pominięte" +"conditional prototype actions with conditions that can't be evaluated were skipped" = "warunkowe akcje prototypu z warunkami niemożliwymi do obliczenia zostały pominięte" +"connector label background was skipped: style data is missing" = "tło etykiety łącznika zostało pominięte: brak danych stylu" +"connector label was skipped: background bounds are invalid" = "etykieta łącznika została pominięta: nieprawidłowe granice tła" +"connector label was skipped: background transform is invalid" = "etykieta łącznika została pominięta: nieprawidłowe przekształcenie tła" +"connector label was skipped: composed text transform is invalid" = "etykieta łącznika została pominięta: nieprawidłowe przekształcenie tekstu złożonego" +"connector label was skipped: derived background bounds are missing" = "etykieta łącznika została pominięta: brak wyznaczonych granic tła" +"connector label was skipped: derived text bounds are missing" = "etykieta łącznika została pominięta: brak wyznaczonych granic tekstu" +"connector label was skipped: text bounds are invalid" = "etykieta łącznika została pominięta: nieprawidłowe granice tekstu" +"connector label was skipped: text style data is missing" = "etykieta łącznika została pominięta: brak danych stylu tekstu" +"connector label was skipped: text transform is invalid" = "etykieta łącznika została pominięta: nieprawidłowe przekształcenie tekstu" +"connector labels were skipped" = "etykiety łączników zostały pominięte" +"connector layers import as static frame/vector snapshots with labels when present; live endpoint bindings are not retained" = "warstwy łączników są importowane jako statyczne ramki/wektory z etykietami; aktywne punkty końcowe nie są zachowywane" +"connector snapshot vector data is missing; connector was left empty" = "brak danych wektorowych łącznika; łącznik pozostał pusty" +"connectors whose ends can't be placed are empty" = "łączniki, których końców nie można umieścić, pozostają puste" +"crop marks" = "Znaczniki przycięcia" +"damaged vector geometry was skipped" = "uszkodzona geometria wektorowa została pominięta" +"damaged vector networks import as outlines" = "uszkodzone sieci wektorowe są importowane jako kontury" +"development: {path}" = "wersja rozwojowa: {path}" +"document children other than pages were skipped" = "elementy podrzędne dokumentu inne niż strony zostały pominięte" +"duplicate grid track sizing entries use equal tracks" = "zduplikowane wpisy rozmiaru siatki używają równych pasów" +"e.g. count + 1" = "np. count + 1" +"e.g. count >= 3 and not done" = "np. count >= 3 and not done" +"elbowed and curved connectors without a saved path import as straight lines" = "złamane i zakrzywione łączniki bez zapisanej ścieżki są importowane jako linie proste" +"entries without a node type were skipped" = "wpisy bez typu węzła zostały pominięte" +"figcraft:// links from a browser, chat or email open this app and join the session." = "linki figcraft:// z przeglądarki, czatu lub poczty e-mail otwierają tę aplikację i dołączają do sesji." +"filled areas of a vector with their own fill use the layer's fill" = "wypełnione obszary wektora z własnym wypełnieniem używają wypełnienia warstwy" +"from {server}" = "z serwera {server}" +"gamepad triggers without exactly one known controller button were skipped" = "wyzwalacze kontrolera bez dokładnie jednego znanego przycisku zostały pominięte" +"grid track list exceeds 1000 entries; the tracks use the default equal sizing" = "lista ścieżek siatki przekracza 1000 pozycji; ścieżki używają domyślnego równego rozmiaru" +"grid track sizing is unsupported or malformed; affected tracks use equal sizing" = "rozmiar ścieżek siatki jest nieobsługiwany lub nieprawidłowy; dotknięte ścieżki używają równego rozmiaru" +"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "lista rozmiarów ścieżek siatki przekracza 1000 pozycji; ścieżki używają domyślnego równego rozmiaru" +"hidden" = "ukryty" +"iOS" = "iOS" +"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "filtry obrazu są niejednoznaczne, ponieważ obecne są oba kontenery filtrów; konwersja filtrów została pominięta" +"image filters use FigCraft's approximate renderer" = "filtry obrazu używają przybliżonego renderera FigCraft" +"instance swap properties whose default component isn't in the file were skipped" = "właściwości podmiany instancji, których domyślny komponent nie znajduje się w pliku, zostały pominięte" +"instances inside their own main component were imported as frames" = "instancje wewnątrz własnego głównego komponentu zostały zaimportowane jako ramki" +"instances of components that aren't in the file show no layers" = "instancje komponentów, których nie ma w pliku, nie pokazują żadnych warstw" +"instances of components that aren't in the file were imported as frames" = "instancje komponentów, których nie ma w pliku, zostały zaimportowane jako ramki" +"instances that would nest a component inside itself were imported as frames" = "instancje zagnieżdżające komponent wewnątrz samego siebie zostały zaimportowane jako ramki" +"instances without a main component were imported as empty frames" = "instancje bez głównego komponentu zostały zaimportowane jako puste ramki" +"invalid internal .fig text path data was ignored" = "nieprawidłowe wewnętrzne dane ścieżki tekstu .fig zostały zignorowane" +"invalid or oversized vector networks import as outlines" = "nieprawidłowe lub przewymiarowane sieci wektorowe są importowane jako kontury" +"invalid or oversized vector path data was skipped" = "nieprawidłowe lub przewymiarowane dane ścieżki wektorowej zostały pominięte" +"just now" = "przed chwilą" +"key triggers without a supported key were skipped" = "wyzwalacze klawiszy z nieobsługiwanym klawiszem zostały pominięte" +"key up triggers import as key presses" = "wyzwalacze zwolnienia klawisza są importowane jako naciśnięcia klawiszy" +"layers without a position were placed at their parent's origin" = "warstwy bez określonej pozycji zostały umieszczone w punkcie początkowym rodzica" +"layers without a type were skipped" = "warstwy bez typu zostały pominięte" +"legacy image filter container is unsupported; filter conversion was skipped" = "przestarzały kontener filtrów obrazu jest nieobsługiwany; konwersja filtrów została pominięta" +"locked" = "Zablokowane" +"malformed image filters container was skipped" = "nieprawidłowy kontener filtrów obrazu został pominięty" +"malformed image paintFilter container was skipped" = "nieprawidłowy kontener filtrów malowania (paintFilter) został pominięty" +"malformed slot content assignment was skipped" = "nieprawidłowe przypisanie zawartości gniazda zostało pominięte" +"no bleed" = "brak spadu" +"nobody else here yet" = "nikogo innego tu jeszcze nie ma" +"non-default slot settings are not represented and were skipped" = "niedomyślne ustawienia gniazd nie są reprezentowane i zostały pominięte" +"now" = "teraz" +"or" = "lub" +"point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "połączenia punktów obrysu zostały zachowane; obrysy przerywane lub o zmiennej szerokości renderują się z łączeniem warstwy" +"preferred slot component keys cannot be resolved to file nodes and were skipped" = "klucze preferowanych komponentów gniazda nie mogą zostać dopasowane do węzłów pliku i zostały pominięte" +"prototype actions of unknown types were skipped" = "akcje prototypu o nieznanych typach zostały pominięte" +"prototype actions without a destination in the file were skipped" = "akcje prototypu bez miejsca docelowego w pliku zostały pominięte" +"prototype expressions on variables that aren't in the variables JSON were skipped" = "wyrażenia prototypu operujące na zmiennych, których nie ma w pliku JSON ze zmiennymi, zostały pominięte" +"prototype expressions with unsupported functions were skipped" = "wyrażenia prototypu z nieobsługiwanymi funkcjami zostały pominięte" +"prototype interactions without supported actions were skipped" = "interakcje prototypu bez obsługiwanych akcji zostały pominięte" +"prototype navigations of unknown types were skipped" = "nawigacje prototypu o nieznanych typach zostały pominięte" +"prototype transitions of unknown types play instantly" = "przejścia prototypu o nieznanych typach odtwarzają się natychmiast" +"prototype triggers of unknown types were skipped" = "wyzwalacze prototypu o nieznanych typach zostały pominięte" +"put a widget on the canvas" = "umieść widżet na płótnie" +"read and edit the document" = "odczytuj i edytuj dokument" +"read the document" = "odczytuj dokument" +"reads the document" = "odczytuje dokument" +"set-variable actions on variables that aren't in the variables JSON were skipped" = "akcje set-variable operujące na zmiennych, których nie ma w pliku JSON ze zmiennymi, zostały pominięte" +"set-variable actions with values that can't be evaluated were skipped" = "akcje set-variable z wartościami, których nie można obliczyć, zostały pominięte" +"set-variable actions with values that don't fit the variable were skipped" = "akcje set-variable z wartościami niepasującymi do zmiennej zostały pominięte" +"set-variable actions without a value were skipped" = "akcje set-variable bez wartości zostały pominięte" +"set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "akcje set-variable-mode dla kolekcji lub trybów, których nie ma w pliku JSON ze zmiennymi, zostały pominięte" +"slot content assignment target is missing or is not slot content" = "cel przypisania zawartości gniazda nie istnieje lub nie jest zawartością gniazda" +"slot content assignment uses the empty GUID sentinel and was skipped" = "przypisanie zawartości gniazda używa pustego identyfikatora GUID i zostało pominięte" +"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "niektóre punkty wektorowe odwołują się do ustawień punktów brakujących w pliku; używają połączeń warstwy i zwykłych narożników" +"some vector segments refer to style settings missing from the file; they use the layer's stroke" = "niektóre segmenty wektorowe odwołują się do ustawień stylu brakujących w pliku; używają obrysu warstwy" +"stale or invalid grid track sizing entries were ignored" = "nieaktualne lub nieprawidłowe wpisy rozmiarów ścieżek siatki zostały zignorowane" +"stars and polygons without point counts or geometry use the default point count" = "gwiazdy i wielokąty bez określonej liczby wierzchołków lub geometrii używają domyślnej liczby punktów" +"style settings of some vector segments aren't supported; those segments use the layer's stroke" = "ustawienia stylu niektórych segmentów wektorowych nie są obsługiwane; segmenty te używają obrysu warstwy" +"text path underline or strikethrough decoration is not rendered" = "podkreślenie lub przekreślenie tekstu na ścieżce nie jest renderowane" +"text style overrides refer to missing table entries" = "nadpisania stylu tekstu odwołują się do brakujących wpisów w tabeli" +"the file has no pages" = "plik nie zawiera stron" +"the plugin" = "wtyczka" +"the variables JSON has no `variableCollections` (expected the local variables response) and was ignored" = "plik JSON ze zmiennymi nie zawiera `variableCollections` (oczekiwano odpowiedzi ze zmiennymi lokalnymi) i został zignorowany" +"this session only" = "tylko ta sesja" +"unknown component property types were skipped" = "nieznane typy właściwości komponentu zostały pominięte" +"variable aliases to variables that aren't in the variables JSON (or of another type) were skipped" = "aliasy zmiennych wskazujące na zmienne nieobecne w pliku JSON ze zmiennymi (lub innego typu) zostały pominięte" +"variable bindings to properties the layer doesn't have were skipped" = "powiązania zmiennych z właściwościami, których warstwa nie posiada, zostały pominięte" +"variable bindings to variables that aren't in the variables JSON (library variables) were skipped" = "powiązania zmiennych ze zmiennymi nieobecnymi w pliku JSON ze zmiennymi (zmienne biblioteki) zostały pominięte" +"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)" = "powiązania zmiennych zostały pominięte: plik JSON nie zawiera definicji zmiennych (przekaż JSON zmiennych lokalnych jako `variables` lub osadź jego `meta` obok pliku JSON)" +"variable bindings whose variable type doesn't fit the property were skipped" = "powiązania zmiennych, których typ nie pasuje do właściwości, zostały pominięte" +"variable collections without modes were skipped" = "kolekcje zmiennych bez trybów zostały pominięte" +"variable mode lookups in prototype expressions that aren't a variable and one of its modes were skipped" = "odwołania do trybu zmiennej w wyrażeniach prototypu niebędące zmienną i jednym z jej trybów zostały pominięte" +"variable modes of collections that aren't in the file were skipped" = "tryby zmiennych dla kolekcji nieobecnych w pliku zostały pominięte" +"variable modes of collections that aren't in the variables JSON were skipped" = "tryby zmiennych dla kolekcji nieobecnych w pliku JSON ze zmiennymi zostały pominięte" +"variable values that don't match their type (or composed colours) were skipped" = "wartości zmiennych niezgodne ze swoim typem (lub złożone kolory) zostały pominięte" +"variables of unknown types were skipped" = "zmienne o nieznanych typach zostały pominięte" +"variables whose collection isn't in the variables JSON were skipped" = "zmienne, których kolekcji nie ma w pliku JSON ze zmiennymi, zostały pominięte" +"variables without readable values were skipped" = "zmienne bez czytelnych wartości zostały pominięte" +"vector points with unknown stroke joins use the layer join" = "punkty wektorowe z nieznanymi połączeniami obrysu używają połączenia warstwy" +"vectors without geometry are empty" = "wektory bez geometrii są puste" +"vectors without geometry are empty (export the file JSON with geometry=paths)" = "wektory bez geometrii są puste (wyeksportuj plik JSON z opcją geometry=paths)" +"very long text was cut to 1,048,576 characters" = "bardzo długi tekst został przycięty do 1 048 576 znaków" +"very long vector paths were skipped" = "bardzo długie ścieżki wektorowe zostały pominięte" +"video actions are not supported and were skipped" = "akcje wideo nie są obsługiwane i zostały pominięte" +"video triggers are not supported and were skipped" = "wyzwalacze wideo nie są obsługiwane i zostały pominięte" +"yesterday" = "wczoraj" +"{instances} in {files}" = "{instances} w {files}" +"{language}: draft translation, waiting for a native speaker's review." = "{language}: wersja robocza tłumaczenia, oczekuje na weryfikację przez native speakera." +"{length} bleed" = "spad {length}" +"{month} {day}, {year}" = "{day} {month} {year}" +"{name} cleared from the list" = "Usunięto {name} z listy" +"{name} is forgotten on this computer; the file stays on {server}" = "{name} usunięto z pamięci tego komputera; plik pozostaje na {server}" +"{name} is on the server." = "{name} znajduje się na serwerze." +"{name} is spotlighting" = "{name} prezentuje widok (spotlight)" +"{name}\nClick to apply to the selection" = "{name}\nKliknij, aby zastosować do zaznaczenia" +"{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}\nPrzeciągnij na płótno lub kliknij, aby umieścić na środku widoku.\nPrzytrzymaj klawisz Alt (Option) podczas upuszczania na instancję, aby ją zamienić." +"{name} (from {library})" = "{name} (z biblioteki {library})" +"{name} (you)" = "{name} (Ty)" +"{name} ({layers} layers)" = "{name} ({layers} warstw)" +"{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}, domyślnie {default}. Kliknij dwukrotnie suwak, aby przywrócić wartość stylu; naciśnięcie Escape podczas przeciągania anuluje." +"{name} from {path}" = "{name} z {path}" +"{name} was removed from the server" = "Plik {name} został usunięty z serwera" +"{name} · deleted on main" = "{name} · usunięto w gałęzi głównej" +"{name} · deleted on the branch" = "{name} · usunięto w gałęzi" +"{name} · not published" = "{name} · nieopublikowane" +"{name} · on a server" = "{name} · na serwerze" +"{name} · published version {v}" = "{name} · opublikowana wersja {v}" +"{name} · version {v} on the server" = "{name} · wersja {v} na serwerze" +"{name}, in a live session" = "{name}, w sesji na żywo" +"{name}, online, open only to you" = "{name}, online, otwarty tylko dla Ciebie" +"{name}, {kind}, {w} by {h}, selected" = "{name}, {kind}, {w} × {h}, zaznaczono" +"{n} added" = { one = "Dodano {n}", few = "Dodano {n}", many = "Dodano {n}", other = "Dodano {n}" } +"{n} autosave versions" = { one = "{n} wersja autozapisu", few = "{n} wersje autozapisu", many = "{n} wersji autozapisu", other = "{n} wersji autozapisu" } +"{n} changed" = { one = "Zmieniono {n}", few = "Zmieniono {n}", many = "Zmieniono {n}", other = "Zmieniono {n}" } +"{n} columns" = { one = "{n} kolumna", few = "{n} kolumny", many = "{n} kolumn", other = "{n} kolumn" } +"{n} components" = { one = "{n} komponent", few = "{n} komponenty", many = "{n} komponentów", other = "{n} komponentów" } +"{n} components and styles have newer versions" = { one = "{n} komponent lub styl ma nowszą wersję", few = "{n} komponenty i style mają nowsze wersje", many = "{n} komponentów i stylów ma nowsze wersje", other = "{n} komponentów i stylów ma nowsze wersje" } +"{n} conflicts to resolve" = { one = "{n} konflikt do rozwiązania", few = "{n} konflikty do rozwiązania", many = "{n} konfliktów do rozwiązania", other = "{n} konfliktów do rozwiązania" } +"{n} days ago" = { one = "{n} dzień temu", few = "{n} dni temu", many = "{n} dni temu", other = "{n} dni temu" } +"{n} files" = { one = "{n} plik", few = "{n} pliki", many = "{n} plików", other = "{n} plików" } +"{n} hours ago" = { one = "{n} godzinę temu", few = "{n} godziny temu", many = "{n} godzin temu", other = "{n} godzin temu" } +"{n} instances" = { one = "{n} instancja", few = "{n} instancje", many = "{n} instancji", other = "{n} instancji" } +"{n} layers" = { one = "{n} warstwa", few = "{n} warstwy", many = "{n} warstw", other = "{n} warstw" } +"{n} layers as one file" = { one = "{n} warstwa jako jeden plik", few = "{n} warstwy jako jeden plik", many = "{n} warstw jako jeden plik", other = "{n} warstw jako jeden plik" } +"{n} layers selected" = { one = "Zaznaczono {n} warstwę", few = "Zaznaczono {n} warstwy", many = "Zaznaczono {n} warstw", other = "Zaznaczono {n} warstw" } +"{n} layers · {parts}" = { one = "{n} warstwa · {parts}", few = "{n} warstwy · {parts}", many = "{n} warstw · {parts}", other = "{n} warstw · {parts}" } +"{n} matches" = { one = "{n} dopasowanie", few = "{n} dopasowania", many = "{n} dopasowań", other = "{n} dopasowań" } +"{n} minutes ago" = { one = "{n} minutę temu", few = "{n} minuty temu", many = "{n} minut temu", other = "{n} minut temu" } +"{n} months ago" = { one = "{n} miesiąc temu", few = "{n} miesiące temu", many = "{n} miesięcy temu", other = "{n} miesięcy temu" } +"{n} more notes omitted from this report" = { one = "Pominięto jeszcze {n} notatkę w tym raporcie", few = "Pominięto jeszcze {n} notatki w tym raporcie", many = "Pominięto jeszcze {n} notatek w tym raporcie", other = "Pominięto jeszcze {n} notatek w tym raporcie" } +"{n} of {total}" = "{n} z {total}" +"{n} people joined" = { one = "Dołączyła {n} osoba", few = "Dołączyły {n} osoby", many = "Dołączyło {n} osób", other = "Dołączyło {n} osób" } +"{n} preferred components" = { one = "{n} preferowany komponent", few = "{n} preferowane komponenty", many = "{n} preferowanych komponentów", other = "{n} preferowanych komponentów" } +"{n} ready" = { one = "{n} gotowy", few = "{n} gotowe", many = "{n} gotowych", other = "{n} gotowych" } +"{n} removed" = { one = "Usunięto {n}", few = "Usunięto {n}", many = "Usunięto {n}", other = "Usunięto {n}" } +"{n} replies" = { one = "{n} odpowiedź", few = "{n} odpowiedzi", many = "{n} odpowiedzi", other = "{n} odpowiedzi" } +"{n} rows" = { one = "{n} wiersz", few = "{n} wiersze", many = "{n} wierszy", other = "{n} wierszy" } +"{n} styles" = { one = "{n} styl", few = "{n} style", many = "{n} stylów", other = "{n} stylów" } +"{n} variables" = { one = "{n} zmienna", few = "{n} zmienne", many = "{n} zmiennych", other = "{n} zmiennych" } +"{n} weeks ago" = { one = "{n} tydzień temu", few = "{n} tygodnie temu", many = "{n} tygodni temu", other = "{n} tygodni temu" } +"{n} years ago" = { one = "{n} rok temu", few = "{n} lata temu", many = "{n} lat temu", other = "{n} lat temu" } +"{n}d" = "{n} d" +"{n}h" = "{n} godz." +"{n}m" = "{n} min" +"{n}w" = "{n} tyg." +"{page}, nothing selected" = "{page}, nic nie zaznaczono" +"{profile} (current)" = "{profile} (bieżący)" +"{property} is its value; {property ? \"a\" : \"b\"} picks a string. Other {…} stays as written." = "{property} to jej wartość; {property ? \"a\" : \"b\"} wybiera tekst. Pozostałe wyrażenia {…} pozostają bez zmian." +"{server} can't say what became of your files (it is older than this app)." = "{server} nie może określić stanu Twoich plików (jest starszy niż ta aplikacja)." +"{server} · No longer on the server" = "{server} · Brak na serwerze" +"{server} · {shared} · Opened {date}" = "{server} · {shared} · Otwarto {date}" +"{tool} hold {key}" = "{tool} przytrzymaj {key}" +"{value} isn't a colour" = "Wartość {value} nie jest kolorem" +"{when} · edited" = "{when} · edytowano" +"← ↑ → ↓" = "← ↑ → ↓" +"← → ↑ ↓" = "← → ↑ ↓" +"←" = "←" +"→, Space or N" = "→, Spacja lub N" +"↵" = "↵" +"⇥ / ⇧⇥" = "⇥ / ⇧⇥" +"⌘ arrows" = "⌘ strzałki" +"⌘ click" = "⌘ kliknięcie" +"⌘ scroll" = "⌘ przewijanie" +"⌥ drag" = "⌥ przeciągnięcie" + +[commands] +"align.bottom" = "Wyrównaj do dołu" +"align.hcenter" = "Wyrównaj poziomo do środka" +"align.left" = "Wyrównaj do lewej" +"align.right" = "Wyrównaj do prawej" +"align.top" = "Wyrównaj do góry" +"align.vcenter" = "Wyrównaj pionowo do środka" +"annotation.add" = "Dodaj adnotację" +"annotation.addCategory" = "Dodaj kategorię adnotacji" +"annotation.categories" = "Kategorie adnotacji" +"annotation.edit" = "Edytuj adnotację" +"annotation.editCategory" = "Edytuj kategorię adnotacji" +"annotation.list" = "Lista adnotacji" +"annotation.remove" = "Usuń adnotację" +"annotation.removeCategory" = "Usuń kategorię adnotacji" +"app.actions" = "Akcje" +"app.preferences" = "Preferencje" +"arrange.back" = "Przesuń na sam spód" +"arrange.backward" = "Przesuń do tyłu" +"arrange.forward" = "Przesuń do przodu" +"arrange.front" = "Przesuń na sam wierzch" +"arrange.packH" = "Upakuj w poziomie" +"arrange.packV" = "Upakuj w pionie" +"arrange.roundToPixels" = "Zaokrąglij do pikseli" +"arrange.spacing" = "Odstępy" +"arrange.tidy" = "Uporządkuj" +"bool.exclude" = "Wyklucz zaznaczenie" +"bool.flatten" = "Spłaszcz operację logiczną" +"bool.intersect" = "Część wspólna zaznaczenia" +"bool.subtract" = "Odejmij zaznaczenie" +"bool.union" = "Połącz zaznaczenie" +"branch.archive" = "Zarchiwizuj gałąź" +"branch.create" = "Utwórz gałąź" +"branch.list" = "Lista gałęzi" +"branch.merge" = "Scal gałąź" +"branch.open" = "Otwórz gałąź" +"branch.review" = "Przejrzyj gałąź" +"branch.updateFromMain" = "Zaktualizuj z gałęzi głównej" +"codeConnect.export" = "Eksportuj połączenia kodu" +"codeConnect.import" = "Importuj połączenia kodu" +"codeConnect.remove" = "Odłącz od kodu" +"codeConnect.set" = "Połącz z kodem" +"collab.cursor" = "Pokaż kursor na pozycji" +"collab.cursorChat" = "Czat kursora" +"collab.diff" = "Pokaż zmiany synchronizacji" +"collab.files" = "Twoje pliki online" +"collab.follow" = "Obserwuj" +"collab.forgetFile" = "Zapomnij plik online" +"collab.host" = "Rozpocznij sesję na żywo" +"collab.join" = "Dołącz do sesji na żywo" +"collab.leave" = "Opuść sesję na żywo" +"collab.manageFile" = "Zarządzaj opublikowanym plikiem" +"collab.openFile" = "Otwórz plik online" +"collab.peers" = "Osoby w tym pliku" +"collab.publish" = "Opublikuj na serwerze" +"collab.recoverFile" = "Odzyskaj plik online" +"collab.registerLinks" = "Otwieraj linki z zaproszeniem w FigCraft" +"collab.report" = "Zgłoś plik operatorowi serwera" +"collab.serverInfo" = "Informacje o serwerze" +"collab.share" = "Udostępnij z kodem dołączenia" +"collab.spotlight" = "Wyróżnij mój widok" +"collab.stop" = "Zatrzymaj sesję na żywo" +"command.batch" = "Wykonaj serię poleceń" +"comment.add" = "Dodaj komentarz" +"comment.delete" = "Usuń komentarz" +"comment.edit" = "Edytuj komentarz" +"comment.link" = "Kopiuj link do komentarza" +"comment.list" = "Lista komentarzy" +"comment.markRead" = "Oznacz komentarz jako przeczytany" +"comment.move" = "Przenieś komentarz" +"comment.next" = "Następny komentarz" +"comment.open" = "Otwórz komentarz" +"comment.people" = "Osoby w komentarzach" +"comment.react" = "Zareaguj na komentarz" +"comment.reply" = "Odpowiedz na komentarz" +"comment.resolve" = "Rozwiąż komentarz" +"comment.zoom" = "Powiększ do komentarzy" +"component.addProperty" = "Dodaj właściwość komponentu" +"component.addVariant" = "Dodaj wariant" +"component.bindProperty" = "Powiąż warstwę z właściwością" +"component.combineVariants" = "Połącz jako warianty" +"component.create" = "Utwórz komponent" +"component.createMultiple" = "Utwórz wiele komponentów" +"component.deleteProperty" = "Usuń właściwość komponentu" +"component.detach" = "Odłącz instancję" +"component.editProperty" = "Edytuj właściwość komponentu" +"component.exposeInstance" = "Udostępnij zagnieżdżoną instancję" +"component.goToMain" = "Przejdź do głównego komponentu" +"component.hideWhenPublishing" = "Ukryj podczas publikowania" +"component.list" = "Lista komponentów" +"component.makeSlot" = "Utwórz gniazdo (Slot)" +"component.playground" = "Środowisko testowe komponentu (Playground)" +"component.properties" = "Właściwości komponentu" +"component.pushChanges" = "Zastosuj zmiany w głównym komponencie" +"component.removeSlot" = "Usuń gniazdo" +"component.resetInstance" = "Zresetuj wszystkie zmiany" +"component.resetOverride" = "Zresetuj zmianę" +"component.restoreMain" = "Przywróć główny komponent" +"dev.compare" = "Porównaj zmiany" +"dev.focus" = "Widok skupienia" +"dev.resolveChange" = "Rozwiąż zmianę" +"dev.unfocus" = "Wyjdź z widoku skupienia" +"devResource.add" = "Dodaj zasób programistyczny" +"devResource.edit" = "Edytuj zasób programistyczny" +"devResource.list" = "Lista zasobów programistycznych" +"devResource.remove" = "Usuń zasób programistyczny" +"distribute.horizontal" = "Rozmieść równe odstępy poziome" +"distribute.vertical" = "Rozmieść równe odstępy pionowe" +"doc.home" = "Ekran główny" +"doc.list" = "Lista dokumentów" +"doc.nextTab" = "Następna karta" +"doc.previousTab" = "Poprzednia karta" +"doc.switch" = "Przełącz dokument" +"edit.copy" = "Kopiuj" +"edit.copyAsCss" = "Kopiuj jako CSS" +"edit.copyAsPng" = "Kopiuj jako PNG" +"edit.copyAsSvg" = "Kopiuj jako SVG" +"edit.copyAsText" = "Kopiuj jako tekst" +"edit.copyLink" = "Kopiuj łącze do zaznaczenia" +"edit.copyProperties" = "Kopiuj właściwości" +"edit.cut" = "Wytnij" +"edit.delete" = "Usuń" +"edit.duplicate" = "Powiel" +"edit.findReplace" = "Znajdź i zamień…" +"edit.paste" = "Wklej" +"edit.pasteDesignLayers" = "Wklej warstwy projektu" +"edit.pasteOver" = "Wklej na zaznaczenie" +"edit.pasteProperties" = "Wklej właściwości" +"edit.pasteReplace" = "Wklej, aby zastąpić" +"edit.pickColor" = "Wybierz kolor" +"edit.redo" = "Ponów" +"edit.repeat" = "Powtórz ostatnie polecenie" +"edit.setDefaultProperties" = "Ustaw właściwości domyślne" +"edit.undo" = "Cofnij" +"effect.add" = "Dodaj efekt" +"effect.move" = "Przenieś efekt" +"effect.remove" = "Usuń efekt" +"effect.set" = "Ustaw efekt" +"export.add" = "Dodaj ustawienie eksportu" +"export.remove" = "Usuń ustawienie eksportu" +"export.update" = "Edytuj ustawienie eksportu" +"file.close" = "Zamknij kartę" +"file.colorProfile" = "Profil kolorów" +"file.duplicate" = "Powiel plik" +"file.export" = "Eksportuj…" +"file.exportFramesPdf" = "Eksportuj ramki do PDF" +"file.exportLayers" = "Eksportuj warstwy" +"file.exportSvg" = "Eksportuj zaznaczenie jako SVG" +"file.import" = "Importuj z pliku…" +"file.new" = "Nowy plik projektu" +"file.newFromTemplate" = "Nowy z szablonu" +"file.open" = "Otwórz…" +"file.openRecent" = "Otwórz ostatnie" +"file.placeImage" = "Umieść obraz" +"file.recover" = "Odzyskaj plik" +"file.rename" = "Zmień nazwę pliku" +"file.revert" = "Przywróć do zapisanego" +"file.save" = "Zapisz" +"file.saveAs" = "Zapisz jako…" +"file.saveVersion" = "Zapisz w historii wersji…" +"file.versionHistory" = "Pokaż historię wersji" +"fill.add" = "Dodaj wypełnienie" +"fill.move" = "Przenieś wypełnienie" +"fill.pattern" = "Wypełnienie wzorem" +"fill.remove" = "Usuń wypełnienie" +"fill.set" = "Ustaw wypełnienie" +"frame.create" = "Utwórz ramkę" +"frame.presets" = "Lista presetów ramek" +"frame.swapOrientation" = "Zmień orientację ramki" +"grid.add" = "Dodaj siatkę układu" +"grid.move" = "Przenieś siatkę układu" +"grid.remove" = "Usuń siatkę układu" +"guide.add" = "Dodaj prowadnicę" +"guide.clear" = "Wyczyść prowadnice" +"guide.move" = "Przesuń prowadnicę" +"guide.remove" = "Usuń prowadnicę" +"guide.select" = "Zaznacz prowadnicę" +"help.about" = "O programie FigCraft" +"help.gettingStarted" = "Wprowadzenie" +"help.page" = "Strona pomocy" +"help.shortcuts" = "Skróty klawiszowe" +"image.adjust" = "Dostosuj obraz" +"image.deletePreset" = "Usuń preset obrazu" +"image.place" = "Umieść obraz" +"image.presets" = "Presety obrazów" +"image.savePreset" = "Zapisz preset obrazu" +"inspect.assets" = "Zasoby do inspekcji" +"inspect.code" = "Kod warstwy" +"inspect.componentCode" = "Kod komponentu" +"inspect.properties" = "Właściwości do inspekcji" +"inspect.readyForDev" = "Gotowe do wdrożenia" +"instance.create" = "Utwórz instancję" +"instance.exposed" = "Udostępnione zagnieżdżone instancje" +"instance.place" = "Umieść instancję" +"instance.resetSlot" = "Zresetuj gniazdo" +"instance.setProperties" = "Ustaw właściwości instancji" +"instance.slotInsert" = "Wstaw do gniazda" +"instance.swap" = "Podmień instancję" +"instance.swapAt" = "Podmień instancję w punkcie" +"layers.collapseAll" = "Zwiń wszystkie warstwy" +"layout.add" = "Dodaj automatyczny układ" +"layout.remove" = "Usuń automatyczny układ" +"layout.setTrack" = "Ustaw rozmiar linii siatki" +"layout.suggest" = "Sugeruj automatyczny układ" +"libraries.open" = "Biblioteki" +"libraries.publish" = "Publikuj bibliotekę…" +"library.acceptUpdates" = "Zaakceptuj aktualizacje biblioteki" +"library.add" = "Dodaj bibliotekę" +"library.aliasVariable" = "Utwórz alias zmiennej biblioteki" +"library.applyStyle" = "Zastosuj styl biblioteki" +"library.bindVariable" = "Powiąż zmienną biblioteki" +"library.extendCollection" = "Rozszerz kolekcję biblioteki" +"library.import" = "Importuj komponent biblioteki" +"library.importVariable" = "Importuj zmienną biblioteki" +"library.list" = "Lista bibliotek" +"library.place" = "Umieść komponent biblioteki" +"library.publish" = "Opublikuj bibliotekę" +"library.publishToServer" = "Opublikuj bibliotekę na serwerze" +"library.remove" = "Usuń bibliotekę" +"library.setVariableMode" = "Ustaw tryb zmiennej biblioteki" +"library.swap" = "Podmień bibliotekę" +"library.swapAt" = "Podmień instancję na komponent biblioteki" +"library.updates" = "Aktualizacje biblioteki" +"library.usage" = "Użycie biblioteki" +"measure.distances" = "Zmierz odległości" +"measure.padding" = "Zmierz marginesy automatycznego układu" +"node.create" = "Utwórz warstwę" +"node.get" = "Pobierz warstwę" +"node.reorder" = "Zmień kolejność warstwy" +"node.reparent" = "Przenieś warstwę do" +"node.set" = "Ustaw właściwości" +"object.batchRename" = "Zmień nazwy wsadowo…" +"object.convertToFrame" = "Konwertuj na ramkę" +"object.convertToGroup" = "Konwertuj na grupę" +"object.flipH" = "Odbij w poziomie" +"object.flipV" = "Odbij w pionie" +"object.frameSelection" = "Umieść zaznaczenie w ramce" +"object.group" = "Grupuj zaznaczenie" +"object.hideOthers" = "Ukryj pozostałe warstwy" +"object.mask" = "Użyj jako maski" +"object.moveToPage" = "Przenieś na stronę" +"object.opacityKeys" = "Krycie z klawiatury numerycznej" +"object.rasterize" = "Rasteryzuj zaznaczenie" +"object.releaseMask" = "Zwolnij maskę" +"object.removeFill" = "Usuń wypełnienie" +"object.removeFrame" = "Usuń ramkę" +"object.removeStroke" = "Usuń obrys" +"object.rename" = "Zmień nazwę" +"object.resizeToFit" = "Dopasuj rozmiar do zawartości" +"object.rotate180" = "Obróć o 180°" +"object.rotateLeft" = "Obróć o 90° w lewo" +"object.rotateRight" = "Obróć o 90° w prawo" +"object.setThumbnail" = "Ustaw jako miniaturę" +"object.swapFillStroke" = "Zamień wypełnienie i obrys" +"object.toggleLock" = "Zablokuj/Odblokuj zaznaczenie" +"object.toggleVisible" = "Pokaż/Ukryj zaznaczenie" +"object.ungroup" = "Rozgrupuj zaznaczenie" +"object.wrapInSection" = "Umieść w nowej sekcji" +"page.add" = "Dodaj stronę" +"page.delete" = "Usuń stronę" +"page.duplicate" = "Powiel stronę" +"page.list" = "Lista stron" +"page.move" = "Przenieś stronę" +"page.rename" = "Zmień nazwę strony" +"page.select" = "Przejdź do strony" +"page.setBackground" = "Tło strony" +"paint.documentColors" = "Kolory dokumentu" +"plugin.close" = "Zamknij panel wtyczki" +"plugin.directory.install" = "Zainstaluj wtyczkę z katalogu" +"plugin.directory.list" = "Przeglądaj katalog wtyczek" +"plugin.directory.publish" = "Opublikuj wtyczkę w katalogu" +"plugin.directory.unpublish" = "Wycofaj wtyczkę z katalogu" +"plugin.event" = "Użyj kontrolki panelu wtyczki" +"plugin.import" = "Importuj wtyczkę z manifestu…" +"plugin.list" = "Lista wtyczek" +"plugin.remove" = "Usuń wtyczkę" +"plugin.run" = "Uruchom wtyczkę" +"plugin.ui" = "Panel wtyczki" +"plugins.manage" = "Zarządzaj wtyczkami…" +"plugins.runLast" = "Uruchom ponownie ostatnią wtyczkę" +"pref.highlightHover" = "Podświetlaj warstwy przy najechaniu myszą" +"pref.keepTool" = "Zachowaj wybrane narzędzie po użyciu" +"pref.language" = "Język interfejsu" +"pref.nudge" = "Wartości przesunięcia (Nudge)" +"pref.numberKeysOpacity" = "Klawisze numeryczne zmieniają krycie" +"pref.publishServer" = "Serwer do udostępniania online" +"pref.reduceMotion" = "Ogranicz animacje" +"pref.renameDuplicates" = "Zmieniaj nazwy duplikatów" +"pref.showDimensions" = "Pokazuj wymiary przy zaznaczeniu" +"pref.userName" = "Twoja nazwa w komentarzach" +"proto.action.add" = "Dodaj akcję prototypu" +"proto.action.move" = "Zmień kolejność akcji prototypu" +"proto.action.remove" = "Usuń akcję prototypu" +"proto.action.set" = "Edytuj akcję prototypu" +"proto.closePreview" = "Zamknij podgląd prototypu" +"proto.conditional.addBlock" = "Dodaj else if / else" +"proto.conditional.removeBlock" = "Usuń if / else if / else" +"proto.conditional.setCondition" = "Edytuj warunek" +"proto.evaluate" = "Oblicz wyrażenie prototypu" +"proto.flow.add" = "Dodaj punkt początkowy przepływu" +"proto.flow.remove" = "Usuń przepływ" +"proto.flow.rename" = "Zmień nazwę przepływu" +"proto.interaction.add" = "Dodaj interakcję" +"proto.interaction.clear" = "Usuń wszystkie interakcje" +"proto.interaction.remove" = "Usuń interakcję" +"proto.interaction.set" = "Edytuj interakcję" +"proto.present" = "Prezentuj" +"proto.presentOptions" = "Opcje prezentacji" +"proto.preview" = "Otwórz podgląd prototypu" +"proto.settings" = "Ustawienia prototypu" +"section.toggleContents" = "Ukryj/Pokaż zawartość sekcji" +"select.add" = "Dodaj do zaznaczenia" +"select.all" = "Zaznacz wszystko" +"select.area" = "Zaznacz obszar" +"select.byName" = "Zaznacz warstwy po nazwie" +"select.children" = "Zaznacz elementy podrzędne" +"select.inverse" = "Odwróć zaznaczenie" +"select.layersAt" = "Warstwy w punkcie" +"select.matching" = "Zaznacz pasujące warstwy" +"select.next" = "Zaznacz następną warstwę" +"select.none" = "Odznacz wszystko" +"select.parent" = "Zaznacz element nadrzędny" +"select.previous" = "Zaznacz poprzednią warstwę" +"select.remove" = "Usuń z zaznaczenia" +"select.sameEffect" = "Zaznacz elementy z takim samym efektem" +"select.sameFill" = "Zaznacz elementy z takim samym wypełnieniem" +"select.sameFont" = "Zaznacz elementy z taką samą czcionką" +"select.sameInstance" = "Zaznacz taką samą instancję" +"select.sameProperties" = "Zaznacz elementy z takimi samymi właściwościami" +"select.sameStroke" = "Zaznacz elementy z takim samym obrysem" +"select.sameText" = "Zaznacz elementy z takimi samymi właściwościami tekstu" +"select.set" = "Zaznacz" +"selection.applyColorStyle" = "Zastosuj styl koloru do zaznaczenia" +"selection.colors" = "Kolory zaznaczenia" +"selection.selectColor" = "Zaznacz warstwy z kolorem" +"selection.setPaint" = "Zmień kolor zaznaczenia" +"shape.arrow" = "Strzałka" +"shape.ellipse" = "Elipsa" +"shape.line" = "Linia" +"shape.polygon" = "Wielokąt" +"shape.rectangle" = "Prostokąt" +"shape.star" = "Gwiazda" +"shapeBuilder.merge" = "Połącz obszary kształtów" +"shapeBuilder.mode" = "Tryb generatora kształtów" +"shapeBuilder.regions" = "Obszary generatora kształtów" +"shapeBuilder.remove" = "Usuń obszary" +"stroke.add" = "Dodaj obrys" +"stroke.brush" = "Pędzel" +"stroke.move" = "Przenieś obrys" +"stroke.remove" = "Usuń obrys" +"stroke.set" = "Ustaw obrys" +"stroke.widthProfile" = "Profil grubości" +"style.apply" = "Zastosuj styl" +"style.bind" = "Powiąż zmienną w stylu" +"style.create" = "Utwórz styl" +"style.delete" = "Usuń styl" +"style.detach" = "Odłącz styl" +"style.duplicate" = "Powiel styl" +"style.list" = "Lista stylów" +"style.move" = "Przenieś style" +"style.renameFolder" = "Zmień nazwę folderu stylów" +"style.update" = "Edytuj styl" +"template.list" = "Lista szablonów" +"text.alignCenter" = "Wyrównaj tekst do środka" +"text.alignJustify" = "Wyjustuj tekst" +"text.alignLeft" = "Wyrównaj tekst do lewej" +"text.alignRight" = "Wyrównaj tekst do prawej" +"text.bold" = "Pogrubienie" +"text.bulletList" = "Lista punktowana" +"text.case" = "Wielkość liter" +"text.caseLower" = "Małe litery" +"text.caseOriginal" = "Oryginalna wielkość liter" +"text.caseSmallCaps" = "Kapitaliki" +"text.caseTitle" = "Jak nazwy własne" +"text.caseUpper" = "Wielkie litery" +"text.create" = "Tekst" +"text.decoration" = "Dekoracja tekstu" +"text.edit.begin" = "Edytuj tekst" +"text.edit.caret" = "Ustaw kursor tekstu" +"text.edit.end" = "Zakończ edycję tekstu" +"text.edit.insert" = "Wpisz tekst" +"text.edit.key" = "Klawisz tekstu" +"text.edit.preedit" = "Redaguj tekst" +"text.edit.selectLine" = "Zaznacz wiersz" +"text.edit.selectWord" = "Zaznacz słowo" +"text.edit.selection" = "Zaznaczenie tekstu" +"text.endPreview" = "Zakończ podgląd tekstu" +"text.fonts" = "Lista czcionek" +"text.italic" = "Kursywa" +"text.lineHeightDown" = "Zmniejsz interlinię" +"text.lineHeightUp" = "Zwiększ interlinię" +"text.link" = "Wstaw łącze" +"text.listIndent" = "Zwiększ wcięcie listy" +"text.listOutdent" = "Zmniejsz wcięcie listy" +"text.listStyle" = "Styl listy" +"text.maxLines" = "Maksymalna liczba wierszy" +"text.numberList" = "Lista numerowana" +"text.onPath" = "Tekst na ścieżce" +"text.paragraphIndent" = "Wcięcie akapitu" +"text.paragraphSpacing" = "Odstęp między akapitami" +"text.pathOptions" = "Opcje ścieżki tekstu" +"text.preview" = "Podgląd zmiany tekstu" +"text.removeFromPath" = "Usuń tekst ze ścieżki" +"text.set" = "Ustaw tekst" +"text.setFeatures" = "Funkcje OpenType" +"text.setVariations" = "Osie czcionki zmiennej (Variable Font)" +"text.sizeDown" = "Zmniejsz rozmiar czcionki" +"text.sizeUp" = "Zwiększ rozmiar czcionki" +"text.strikethrough" = "Przekreślenie" +"text.style" = "Zastosuj styl do fragmentu tekstu" +"text.trackingDown" = "Zmniejsz odstęp między literami" +"text.trackingUp" = "Zwiększ odstęp między literami" +"text.underline" = "Podkreślenie" +"text.weightDown" = "Zmniejsz grubość czcionki" +"text.weightUp" = "Zwiększ grubość czcionki" +"tool.arrow" = "Strzałka" +"tool.comment" = "Komentarz" +"tool.ellipse" = "Elipsa" +"tool.frame" = "Ramka" +"tool.hand" = "Rączka" +"tool.line" = "Linia" +"tool.move" = "Wskaźnik" +"tool.pen" = "Pióro" +"tool.pencil" = "Ołówek" +"tool.pencilBrush" = "Pędzel ołówka" +"tool.place" = "Umieść za pomocą narzędzia" +"tool.polygon" = "Wielokąt" +"tool.rectangle" = "Prostokąt" +"tool.scale" = "Skalowanie" +"tool.scaleAnchor" = "Punkt zaczepienia skalowania" +"tool.section" = "Sekcja" +"tool.set" = "Wybierz narzędzie" +"tool.shapeBuilder" = "Generator kształtów" +"tool.slice" = "Plaster" +"tool.star" = "Gwiazda" +"tool.text" = "Tekst" +"transform.move" = "Przenieś" +"transform.moveTo" = "Przenieś do" +"transform.nudge" = "Przesuń o krok (Nudge)" +"transform.nudgeSize" = "Zmień rozmiar o krok" +"transform.resize" = "Zmień rozmiar" +"transform.rotate" = "Obróć" +"transform.rotationOrigin" = "Przesuń punkt obrotu" +"transform.scale" = "Skaluj" +"transform.setRotationOrigin" = "Ustaw punkt obrotu" +"variable.addMode" = "Dodaj tryb" +"variable.bind" = "Powiąż zmienną" +"variable.create" = "Utwórz zmienną" +"variable.createCollection" = "Utwórz kolekcję zmiennych" +"variable.delete" = "Usuń zmienną" +"variable.deleteCollection" = "Usuń kolekcję" +"variable.duplicate" = "Powiel zmienną" +"variable.export" = "Eksportuj zmienne" +"variable.import" = "Importuj zmienne" +"variable.list" = "Lista zmiennych" +"variable.moveMode" = "Przenieś tryb" +"variable.removeMode" = "Usuń tryb" +"variable.renameCollection" = "Zmień nazwę kolekcji" +"variable.renameMode" = "Zmień nazwę trybu" +"variable.resetOverride" = "Zresetuj nadpisanie zmiennej" +"variable.set" = "Ustaw wartość zmiennej" +"variable.setMode" = "Ustaw tryb zmiennej" +"variable.update" = "Edytuj zmienną" +"vector.create" = "Wektor" +"vector.deleteHeal" = "Usuń punkt i napraw zaznaczenie" +"vector.edit.addVertex" = "Dodaj punkt" +"vector.edit.begin" = "Edytuj wektor" +"vector.edit.bend" = "Zegnij segment" +"vector.edit.bounds" = "Granice zaznaczonych punktów" +"vector.edit.connect" = "Połącz punkty" +"vector.edit.cornerRadius" = "Promień zaokrąglenia punktu" +"vector.edit.cut" = "Rozetnij ścieżkę" +"vector.edit.delete" = "Usuń punkty" +"vector.edit.end" = "Zakończ edycję" +"vector.edit.erase" = "Wymaż" +"vector.edit.lasso" = "Zaznacz lasso" +"vector.edit.mirroring" = "Symetria uchwytów" +"vector.edit.moveHandles" = "Przesuń uchwyty" +"vector.edit.moveVertices" = "Przesuń punkty" +"vector.edit.nudge" = "Przesuń punkty o krok" +"vector.edit.paint" = "Wiadro z farbą" +"vector.edit.pen" = "Punkt pióra" +"vector.edit.penEnd" = "Zakończ ścieżkę pióra" +"vector.edit.position" = "Pozycja punktu" +"vector.edit.resize" = "Zmień rozmiar punktów" +"vector.edit.rotate" = "Obróć punkty" +"vector.edit.select" = "Zaznacz punkty" +"vector.edit.selectAll" = "Zaznacz wszystkie punkty" +"vector.edit.setHandle" = "Ustaw uchwyt" +"vector.edit.smooth" = "Wygładź lub wyostrz punkty" +"vector.edit.state" = "Stan edycji wektora" +"vector.edit.strokeCap" = "Zakończenie obrysu punktu" +"vector.edit.strokeJoin" = "Połączenie obrysu punktu" +"vector.edit.tool" = "Narzędzie edycji wektora" +"vector.edit.transform" = "Przekształć punkty" +"vector.edit.widthPoint" = "Punkt szerokości" +"vector.flatten" = "Spłaszcz do wektora" +"vector.join" = "Połącz ścieżki" +"vector.offset" = "Przesunięcie ścieżki (Offset)" +"vector.outlineStroke" = "Przekształć obrys w ścieżkę" +"vector.reverse" = "Odwróć kierunek ścieżki" +"vector.simplify" = "Uprość wektor" +"vector.smoothJoin" = "Płynne połączenie zaznaczenia" +"version.autosave" = "Wersja autozapisu" +"version.delete" = "Usuń wersję" +"version.duplicate" = "Powiel wersję" +"version.exitPreview" = "Powrót do bieżącej wersji" +"version.list" = "Historia wersji" +"version.preview" = "Wyświetl wersję" +"version.rename" = "Zmień nazwę wersji" +"version.restore" = "Przywróć wersję" +"view.assets" = "Panel zasobów" +"view.comments" = "Pokaż komentarze" +"view.contextMenu" = "Pokaż menu kontekstowe" +"view.design" = "Panel projektu" +"view.designPrototype" = "Przełącz między Projektem a Prototypem" +"view.devMode" = "Tryb programisty" +"view.frameOutlines" = "Kontury ramek" +"view.fullscreen" = "Tryb pełnoekranowy" +"view.get" = "Pobierz widok" +"view.layers" = "Panel warstw" +"view.layoutGrids" = "Siatki układu" +"view.leftSidebar" = "Pokaż/Ukryj lewy pasek boczny" +"view.maskOutlines" = "Kontury masek" +"view.multiplayerCursors" = "Kursory innych użytkowników" +"view.nextFrame" = "Przejdź do następnej ramki" +"view.nextPage" = "Następna strona" +"view.nextRegion" = "Przejdź do następnego obszaru" +"view.outlines" = "Pokaż kontury" +"view.outlinesHiddenLayers" = "Pokaż kontury ukrytych warstw" +"view.outlinesObjectBounds" = "Pokaż granice obiektów" +"view.outlinesSelection" = "Pokaż kontury zaznaczenia" +"view.pan" = "Przesuń widok" +"view.panelWidths" = "Zresetuj szerokości paneli" +"view.pixelGrid" = "Siatka pikseli" +"view.pixelPreview" = "Podgląd pikseli" +"view.prevFrame" = "Przejdź do poprzedniej ramki" +"view.prevPage" = "Poprzednia strona" +"view.previousRegion" = "Przejdź do poprzedniego obszaru" +"view.proofSrgb" = "Symulacja sRGB (Soft-proof)" +"view.prototype" = "Panel prototypu" +"view.rulers" = "Linijki" +"view.set" = "Ustaw widok" +"view.slices" = "Plastry" +"view.snapGeometry" = "Przyciągaj do geometrii" +"view.snapObjects" = "Przyciągaj do obiektów" +"view.snapPixel" = "Przyciągaj do pikseli" +"view.themeDark" = "Ciemny motyw" +"view.themeLight" = "Jasny motyw" +"view.themeSystem" = "Motyw zgodny z systemem" +"view.toggleUi" = "Pokaż/Ukryj interfejs" +"view.zoom100" = "Powiększenie 100%" +"view.zoom200" = "Powiększenie 200%" +"view.zoom50" = "Powiększenie 50%" +"view.zoomAt" = "Narzędzie lupy" +"view.zoomFit" = "Dopasuj do ekranu" +"view.zoomIn" = "Powiększ" +"view.zoomOut" = "Pomniejsz" +"view.zoomSelection" = "Powiększ do zaznaczenia" +"widget.click" = "Kliknij widżet" +"widget.insert" = "Wstaw widżet" +"widget.list" = "Lista widżetów" +"window.focus" = "Przesuń okno na wierzch" +"window.new" = "Nowe okno" + +[menu] +"bool.exclude" = "Wyklucz" +"bool.flatten" = "Spłaszcz" +"bool.intersect" = "Część wspólna" +"bool.subtract" = "Odejmij" +"bool.union" = "Połącz" +"file.duplicate" = "Powiel" +"file.import" = "Importuj z pliku…" +"file.rename" = "Zmień nazwę" +"libraries.open" = "Otwórz biblioteki" +"select.sameEffect" = "Efekt" +"select.sameFill" = "Wypełnienie" +"select.sameFont" = "Czcionka" +"select.sameInstance" = "Instancja" +"select.sameProperties" = "Właściwości" +"select.sameStroke" = "Obrys" +"select.sameText" = "Właściwości tekstu" +"text.alignCenter" = "Wyrównaj do środka" +"text.alignJustify" = "Wyjustuj" +"text.alignLeft" = "Wyrównaj do lewej" +"text.alignRight" = "Wyrównaj do prawej" +"view.assets" = "Zasoby" +"view.design" = "Projekt" +"view.layers" = "Warstwy" +"view.outlines" = "Pokaż kontury" +"view.outlinesHiddenLayers" = "Uwzględnij ukryte warstwy" +"view.outlinesObjectBounds" = "Uwzględnij granice obiektów" +"view.outlinesSelection" = "Pokaż kontury zaznaczenia" +"view.prototype" = "Prototyp" +"view.themeDark" = "Ciemny" +"view.themeLight" = "Jasny" +"view.themeSystem" = "Zgodny z systemem" diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs index 22ea1a728..51e4c37b6 100644 --- a/crates/ui-egui/src/i18n.rs +++ b/crates/ui-egui/src/i18n.rs @@ -171,9 +171,9 @@ fn plural(code: &str, n: usize) -> Plural { "cs" if n == 1 => Plural::One, "cs" if (2..=4).contains(&n) => Plural::Few, "cs" => Plural::Other, - "ru" if n % 10 == 1 && n % 100 != 11 => Plural::One, - "ru" if (2..=4).contains(&(n % 10)) && !(12..=14).contains(&(n % 100)) => Plural::Few, - "ru" => Plural::Many, + "ru" | "pl" if n % 10 == 1 && n % 100 != 11 => Plural::One, + "ru" | "pl" if (2..=4).contains(&(n % 10)) && !(12..=14).contains(&(n % 100)) => Plural::Few, + "ru" | "pl" => Plural::Many, "ja" | "ko" | "zh-Hans" => Plural::Other, "fr" | "pt-BR" if n <= 1 => Plural::One, _ if n == 1 => Plural::One, From d8ff1441b1cd47cb45f1e58b030409ef6f1e24bf Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 18 Oct 2026 08:34:53 -0400 Subject: [PATCH 270/817] docs: drop references to competing commercial software (#786) * docs: drop references to competing commercial software * docs: clarify parity checklist coverage in status callout * #786: say interface design once in the tagline --------- Co-authored-by: bflatastic --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a072a06fe..0a2598984 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@

FigCraft

- Interface design; an open-source, clean-room reimplementation of Figma, rebuilt in pure Rust.
+ Interface design and prototyping: open source, collaborative and built in pure Rust.
Frames, auto layout, components and variants, vector networks, styles, variables and prototypes,
in a native app that opens instantly and works offline. Open source, and yours.

@@ -62,7 +62,7 @@

🎛️ Familiar by design

- The toolbar, layers panel, Design panel, menus and shortcuts sit where your hands expect them. If you know Figma, you already know FigCraft. + The toolbar, layers panel, Design panel, menus and shortcuts sit right where your hands expect them.

⚡ Native and fast

@@ -262,7 +262,7 @@ New contributors and AI agents: start with [`AGENTS.md`](AGENTS.md), then [`docs Installers for macOS (universal, signed and notarized), Windows (x64, x86 and arm64), Linux (AppImage, `.deb`, `.rpm`, Flatpak and tarball), FreeBSD and the web are attached to each [GitHub release](https://github.com/storytold/figcraft/releases). Maintainers: [`docs/releasing.md`](docs/releasing.md) explains how releases are built, signed and published. > [!IMPORTANT] -> **Status:** FigCraft is in **alpha**: about 49% of the way to replacing Figma for real work, by our own estimate. Nearly all of Figma's main menu is wired ([`docs/parity-checklist.md`](docs/parity-checklist.md)) and the core editor works end to end, but FigCraft opens `.fig` files only best effort, has only a first preview of multiplayer (live sessions hosted from the app or a self-hosted server, with per-person undo and share links to edit or to view; no accounts, teams or cloud yet), runs its own WebAssembly plugins rather than Figma's, and hasn't been checked against real Figma documents. The honest, area-by-area picture is in the [roadmap](ROADMAP.md) and [`docs/target-app-parity.md`](docs/target-app-parity.md). Expect rough edges and please file issues, or tell us what broke on [Discord](https://discord.gg/artcraft). +> **Status:** FigCraft is in **alpha**: about 49% of the way to replacing proprietary tools for real work, by our own estimate. Nearly all tracked interface design actions in the menu checklist are wired ([`docs/parity-checklist.md`](docs/parity-checklist.md)) and the core editor works end to end, but FigCraft opens `.fig` files only best effort, has only a first preview of multiplayer (live sessions hosted from the app or a self-hosted server, with per-person undo and share links to edit or to view; no accounts, teams or cloud yet), runs its own WebAssembly plugins, and hasn't been checked against real design documents. The honest, area-by-area picture is in the [roadmap](ROADMAP.md) and [`docs/target-app-parity.md`](docs/target-app-parity.md). Expect rough edges and please file issues, or tell us what broke on [Discord](https://discord.gg/artcraft). ## Privacy and online sharing @@ -348,8 +348,6 @@ ArtCraft Team and are not covered by this license. They may be used only unmodif part of this repository and FigCraft, under [`docs/brand/LICENSE-brand.txt`](docs/brand/LICENSE-brand.txt). Forks and modified versions must remove them. -Figma is a trademark of Figma, Inc. FigCraft is an independent, open-source project and is not affiliated with, sponsored by or endorsed by Figma, Inc.; the name is used only to describe the workflows FigCraft is compatible with. -
]… [files…] [figcraft://join?…]`. An invite link //! (what the system passes when a `figcraft://` link is opened) joins that session once the window //! is up; everything else that isn't a flag is a file to open, as a path or a `file://` URL (the -//! Linux desktop entry passes URLs, `%U`, so that it can also hand over invite links). +//! Linux desktop entry passes URLs, `%U`, so that it can also hand over invite links). Any other +//! `--flag` is unknown and stops the app at startup (#836): a mistyped root flag must never leave +//! the app running unconfined. After a bare `--`, every argument is a file. /// What the app was started with. #[derive(Debug, Default, PartialEq, Eq)] @@ -17,6 +19,8 @@ pub struct Args { /// which is refused at startup. pub read_roots: Vec, pub write_roots: Vec, + /// `--flags` the app doesn't know, as given. + pub unknown: Vec, } /// An invite link rather than a file (`figcraft:` links, in any case). @@ -55,6 +59,10 @@ pub fn parse(args: &[String]) -> Args { let mut out = Args::default(); let mut it = args.iter(); while let Some(a) = it.next() { + if a == "--" { + out.files.extend(it.by_ref().cloned()); + break; + } let (flag, inline) = a.split_once('=').map_or((a.as_str(), None), |(f, v)| (f, Some(v.to_string()))); let roots = match flag { "--automation-read-root" => Some(&mut out.read_roots), @@ -69,7 +77,9 @@ pub fn parse(args: &[String]) -> Args { out.join = Some(a.clone()); } else if let Some(path) = file_url_path(a) { out.files.push(path); - } else if !a.starts_with("--") { + } else if a.starts_with("--") { + out.unknown.push(a.clone()); + } else { out.files.push(a.clone()); } } diff --git a/apps/figcraft/src/args_tests.rs b/apps/figcraft/src/args_tests.rs index 2ae29b3c8..9c23a3f4b 100644 --- a/apps/figcraft/src/args_tests.rs +++ b/apps/figcraft/src/args_tests.rs @@ -9,7 +9,7 @@ fn args(a: &[&str]) -> Vec { #[test] fn files_and_the_control_port() { assert_eq!(parse(&args(&[])), Args::default()); - let a = parse(&args(&["--control", "4242", "a.figcraft", "--verbose", "b.svg"])); + let a = parse(&args(&["--control", "4242", "a.figcraft", "b.svg"])); assert_eq!(a, Args { control: Some(4242), files: args(&["a.figcraft", "b.svg"]), ..Args::default() }); // A missing or bad port is ignored, not taken as a file. assert_eq!(parse(&args(&["--control"])), Args::default()); @@ -26,6 +26,19 @@ fn automation_roots_repeat_and_are_never_files() { assert_eq!(parse(&args(&["--automation-write-root"])).write_roots, args(&[""])); } +#[test] +fn unknown_flags_are_refused_never_ignored() { + // #836: a mistyped root flag (or one an older release lacks) must stop the app, not start it + // unconfined. Both forms, with and without `=`. + let a = parse(&args(&["--automation-write-roots", "out", "--automation-write-dir=out", "--verbose", "a.figcraft"])); + assert_eq!(a.unknown, args(&["--automation-write-roots", "--automation-write-dir=out", "--verbose"])); + assert!(a.write_roots.is_empty()); + // Single-dash arguments are left as they were (files); after `--` everything is a file. + let a = parse(&args(&["--control", "1", "--", "--odd.figcraft", "--automation-write-root=x"])); + assert_eq!(a.files, args(&["--odd.figcraft", "--automation-write-root=x"])); + assert!(a.unknown.is_empty() && a.write_roots.is_empty()); +} + #[test] fn invite_links_join_instead_of_opening() { let link = "figcraft://join?host=192.168.1.20:47900&file=abc&token=AbCdEfGhIjKlMnOpQrStUv"; diff --git a/apps/figcraft/src/main.rs b/apps/figcraft/src/main.rs index ddb702043..1bba81e81 100644 --- a/apps/figcraft/src/main.rs +++ b/apps/figcraft/src/main.rs @@ -10,7 +10,8 @@ //! `--automation-read-root ` / `--automation-write-root ` (each repeatable) confine the //! files the window and the control channel read and write (`figcraft_engine::file_access`); the //! app's own folders (settings, recovery copies, installed plugins) and opening the files given on -//! the command line are not. A root that isn't an existing folder stops the app at startup. +//! the command line are not. A root that isn't an existing folder stops the app at startup, and so +//! does any flag the app doesn't know (a mistyped root flag must not start the app unconfined). #![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)] #![cfg_attr(all(target_os = "windows", not(debug_assertions)), windows_subsystem = "windows")] @@ -129,6 +130,12 @@ fn main() -> eframe::Result { return Ok(()); } let args = args::parse(&args); + if let Some(flag) = args.unknown.first() { + eprintln!( + "FigCraft: unknown option {flag}\nUsage: figcraft [--control PORT] [--automation-read-root DIR]... [--automation-write-root DIR]... [FILE | figcraft://join?...]..." + ); + std::process::exit(2); + } let roots = match ( args.read_roots.is_empty() && args.write_roots.is_empty(), figcraft_engine::file_access::Roots::new(&args.read_roots, &args.write_roots), diff --git a/crates/ui-egui/src/control_roots_tests.rs b/crates/ui-egui/src/control_roots_tests.rs index cc0065061..35454bb5d 100644 --- a/crates/ui-egui/src/control_roots_tests.rs +++ b/crates/ui-egui/src/control_roots_tests.rs @@ -57,6 +57,24 @@ fn a_confined_app_writes_only_inside_its_write_root() { assert!(app.session.execute("file.export", &json!({"format": "svg", "path": p("outside/own.svg")})).is_ok()); } +#[test] +fn a_confined_app_saves_only_inside_its_write_root() { + // #836: saving over the control channel, both as a new file and to the current one. + let (mut app, d) = confined_app("save"); + let p = |rel: &str| d.0.join(rel).to_string_lossy().into_owned(); + for cmd in ["file.saveAs", "file.save"] { + let e = handle(&mut app, "engine.execute", json!({"command": cmd, "params": {"path": p("outside/a.figcraft")}})).unwrap_err(); + assert!(e.contains("automation path rejected"), "{cmd}: {e}"); + let e = handle(&mut app, "engine.execute", json!({"command": cmd, "params": {"path": p("out/../outside/b.figcraft")}})).unwrap_err(); + assert!(e.contains("automation path rejected"), "{cmd}: {e}"); + } + assert_eq!(std::fs::read_dir(d.0.join("outside")).unwrap().count(), 0, "nothing written outside the root"); + handle(&mut app, "engine.execute", json!({"command": "file.saveAs", "params": {"path": p("out/in.figcraft")}})).unwrap(); + assert!(d.0.join("out/in.figcraft").is_file()); + // Saving again goes to the same file, inside the root. + handle(&mut app, "engine.execute", json!({"command": "file.save", "params": {}})).unwrap(); +} + #[test] fn window_captures_are_written_through_the_roots_or_returned() { let (app, d) = confined_app("capture"); diff --git a/docs/control-protocol.md b/docs/control-protocol.md index 3ae9d287b..858d24352 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -71,7 +71,10 @@ and what a person does in the window are held to the same folders. Files are rea read or write root and written only inside a write root; anything else is an ordinary error reply (`automation path rejected: …`), and recent files outside the roots aren't listed. Paths are resolved as `docs/mcp.md` › Confining file access describes. A root that isn't an existing folder -stops the app before its window opens. Without the flags nothing changes. +stops the app before its window opens, and so does any option the app doesn't know (a mistyped +flag such as `--automation-write-roots` exits with `unknown option`, never starts unconfined). +Without the flags nothing changes. The flags arrived in FigCraft 0.7.0: 0.6.0 and earlier ignore +them and confine nothing. Not confined: opening the files given on the command line when the app starts and the documents the system hands over (Finder, Open With; saving them later is confined like any write), and the From 3878f89bd69b0d3694fa198506199cb24c9719b7 Mon Sep 17 00:00:00 2001 From: Al Rifat Sabbir <150162343+alrifatsabbir@users.noreply.github.com> Date: Mon, 19 Oct 2026 03:27:24 +0600 Subject: [PATCH 302/817] Change order of characters in language script test --- crates/ui-egui/src/cjk.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/cjk.rs b/crates/ui-egui/src/cjk.rs index dd195dcf2..b5dbf7399 100644 --- a/crates/ui-egui/src/cjk.rs +++ b/crates/ui-egui/src/cjk.rs @@ -162,7 +162,7 @@ mod tests { fn the_ui_language_script_comes_first() { let order = |need, ui| samples(need, ui).into_iter().map(|(c, _)| c).collect::(); let first_face = |need, ui| samples(need, ui).first().and_then(|(_, f)| f.first()).copied(); - assert_eq!(order(KANA | HAN | HANGUL | BENGALI, 0), "あ漢한অ"); + assert_eq!(order(KANA | HAN | HANGUL | BENGALI, language("bn")), "অあ漢한"); assert_eq!(order(KANA | HAN | HANGUL, KANA | HAN), "あ漢한"); assert_eq!(order(KANA | HAN | HANGUL, HANGUL), "한漢あ"); assert_eq!(order(HANGUL, 0), "한"); From 85c5286d396b91f2208d9d640aeace82afec43d6 Mon Sep 17 00:00:00 2001 From: Muamer Mustafic Date: Sun, 18 Oct 2026 23:40:33 +0200 Subject: [PATCH 303/817] M1: doc comments for the menu invoke and SVG clipboard export (#808) Co-authored-by: Cursor --- crates/ui-egui/src/menus.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index d34b609b5..85caa9da6 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -112,6 +112,8 @@ pub fn record_recent(app: &mut FigApp, key: &str) { r.truncate(figcraft_engine::MAX_RECENT_ACTIONS); } +/// Run a menu, shortcut or palette action by id: actions that need the UI (dialogs, panels, the +/// clipboard) are handled here, the rest go to the engine. pub fn invoke(app: &mut FigApp, id: &str) { match id { // Edit ▸ Delete (and the Delete binding) with an interaction open in the Prototype tab @@ -247,6 +249,7 @@ fn text_layers_text(doc: &figcraft_doc::Document, ids: &[figcraft_doc::NodeId]) texts.map(|t| t.join("\n")).filter(|t| !t.is_empty()) } +/// The layers as SVG text for other apps (None when the export fails). fn figcraft_svg_export(doc: &figcraft_doc::Document, ids: &[figcraft_doc::NodeId]) -> Option { let bytes = figcraft_engine::cmd::file::export_bytes(doc, ids, figcraft_doc::ExportFormat::Svg, 1.0).ok()?; String::from_utf8(bytes).ok() From 79ac16a2561e1f571999a09d890f8abf08fbeccb Mon Sep 17 00:00:00 2001 From: Muamer Mustafic Date: Sun, 18 Oct 2026 23:40:35 +0200 Subject: [PATCH 304/817] M3: doc comments for the structure commands and binding re-apply (#810) Co-authored-by: Cursor --- crates/engine/src/cmd/structure.rs | 2 ++ crates/engine/src/cmd/styles.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/crates/engine/src/cmd/structure.rs b/crates/engine/src/cmd/structure.rs index 0f29069db..7a5bd1fcc 100644 --- a/crates/engine/src/cmd/structure.rs +++ b/crates/engine/src/cmd/structure.rs @@ -10,6 +10,8 @@ use super::{CommandSpec, ok}; use crate::params::*; use crate::{EngineError, Result, Session, bad, spec}; +/// The layer structure commands: group, frame, mask, boolean operations, flatten, auto layout +/// add/remove, move to page and vector path edits. pub fn specs() -> Vec { vec![ spec!("object.group", "Group selection", "{ids?, name?}", true, |s, p| wrap(s, p, Wrap::Group)), diff --git a/crates/engine/src/cmd/styles.rs b/crates/engine/src/cmd/styles.rs index 649ee033b..47bbd0aa0 100644 --- a/crates/engine/src/cmd/styles.rs +++ b/crates/engine/src/cmd/styles.rs @@ -1007,6 +1007,8 @@ pub(crate) fn apply_paint_bindings_on_load(doc: &mut Document) { doc.mark_dirty(pending); } +/// Re-apply the variable bindings whose field passes `include`, on the `only` nodes (every bound +/// node when `None`). Auto layout fields wait while their node has no auto layout. fn apply_bindings_matching(doc: &mut Document, only: Option<&std::collections::BTreeSet>, include: impl Fn(&str) -> bool) { use super::lists::{BoundList, list_binding}; if doc.variables.variables.is_empty() { From 847e610550042966daa3dc6fe094585163831469 Mon Sep 17 00:00:00 2001 From: Al Rifat Sabbir <150162343+alrifatsabbir@users.noreply.github.com> Date: Mon, 19 Oct 2026 03:46:01 +0600 Subject: [PATCH 305/817] Add Bengali script support in build.rs --- crates/text/build.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/text/build.rs b/crates/text/build.rs index d02defefe..836efa153 100644 --- a/crates/text/build.rs +++ b/crates/text/build.rs @@ -62,12 +62,13 @@ fn craft_fonts(dir: &std::path::Path, manifest_rel: &str) -> Result Date: Sun, 18 Oct 2026 23:50:27 +0200 Subject: [PATCH 306/817] M7: a web file picker closed without a cancel event settles on refocus (#759) Co-authored-by: Cursor --- apps/figcraft-web/src/web.rs | 62 ++++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 10 deletions(-) diff --git a/apps/figcraft-web/src/web.rs b/apps/figcraft-web/src/web.rs index 015112527..dd767116a 100644 --- a/apps/figcraft-web/src/web.rs +++ b/apps/figcraft-web/src/web.rs @@ -162,19 +162,11 @@ async fn pick_file(accept: &str) -> Result)>, wasm_bindg input.set_hidden(true); // Some browsers (older Safari) open the picker only for an input in the page. body.append_child(&input)?; - // Settles on `change` (a file was picked) or `cancel` (the picker was closed without one). - let mut settle = |resolve: js_sys::Function, _reject: js_sys::Function| { - let done = wasm_bindgen::closure::Closure::once_into_js(move || { - let _ = resolve.call0(&wasm_bindgen::JsValue::NULL); - }); - let _ = input.add_event_listener_with_callback("change", done.unchecked_ref()); - let _ = input.add_event_listener_with_callback("cancel", done.unchecked_ref()); - }; - let closed = js_sys::Promise::new(&mut settle); + let (closed, picker) = PickerClosed::new(&window, input.clone()); input.click(); let result = wasm_bindgen_futures::JsFuture::from(closed).await; let file = input.files().and_then(|files| files.get(0)); - input.remove(); + drop(picker); result?; let Some(file) = file else { return Ok(None) }; if file.size() > MAX_PICKED_BYTES { @@ -184,6 +176,56 @@ async fn pick_file(accept: &str) -> Result)>, wasm_bindg Ok(Some((file.name(), js_sys::Uint8Array::new(&buffer).to_vec()))) } +/// How long after the page gets focus back the file picker counts as closed (milliseconds): a +/// picked file's `change` can come just after the focus, and must win. +const PICKER_FOCUS_SETTLE_MS: i32 = 1_000; + +/// Settles a file picker's promise once: on `change` (a file was picked), on `cancel` (closed +/// without one) or shortly after the page gets focus back, for browsers that never send `cancel` +/// (Safari before 16.4), where the pick would otherwise stay pending and block every later one. +/// Dropping it (also when the pick is abandoned) removes the input, the focus listener and its timer. +struct PickerClosed { + window: web_sys::Window, + input: web_sys::HtmlInputElement, + _settle: wasm_bindgen::closure::Closure, + on_focus: wasm_bindgen::closure::Closure, + timer: std::rc::Rc>>, +} + +impl PickerClosed { + fn new(window: &web_sys::Window, input: web_sys::HtmlInputElement) -> (js_sys::Promise, Self) { + let resolve = std::rc::Rc::new(std::cell::RefCell::new(None::)); + let slot = resolve.clone(); + let closed = js_sys::Promise::new(&mut |res, _rej| *slot.borrow_mut() = Some(res)); + let settle = wasm_bindgen::closure::Closure::::new(move || { + if let Some(res) = resolve.borrow_mut().take() { + let _ = res.call0(&wasm_bindgen::JsValue::NULL); + } + }); + let _ = input.add_event_listener_with_callback("change", settle.as_ref().unchecked_ref()); + let _ = input.add_event_listener_with_callback("cancel", settle.as_ref().unchecked_ref()); + let timer = std::rc::Rc::new(std::cell::Cell::new(None)); + let (w, t, f) = (window.clone(), timer.clone(), settle.as_ref().unchecked_ref::().clone()); + let on_focus = wasm_bindgen::closure::Closure::::new(move || { + if t.get().is_none() { + t.set(w.set_timeout_with_callback_and_timeout_and_arguments_0(&f, PICKER_FOCUS_SETTLE_MS).ok()); + } + }); + let _ = window.add_event_listener_with_callback("focus", on_focus.as_ref().unchecked_ref()); + (closed, Self { window: window.clone(), input, _settle: settle, on_focus, timer }) + } +} + +impl Drop for PickerClosed { + fn drop(&mut self) { + if let Some(t) = self.timer.take() { + self.window.clear_timeout_with_handle(t); + } + let _ = self.window.remove_event_listener_with_callback("focus", self.on_focus.as_ref().unchecked_ref()); + self.input.remove(); + } +} + fn download(name: &str, bytes: &[u8]) -> Result<(), wasm_bindgen::JsValue> { let window = web_sys::window().ok_or("no window")?; let document = window.document().ok_or("no document")?; From 4a54aa733fe2a755337a58faaae1787d088c2215 Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Sun, 18 Oct 2026 23:00:13 +0200 Subject: [PATCH 307/817] M3: .fig imports keep the properties variant layers are bound to Each variant of a component set keeps a copy of the set's property definitions (an id and a parentPropDefId, no name or type), and the variant's layers and its instances' assignments use the copy's id. Those copies were skipped, so imported variants lost every boolean, text and instance swap binding, and instances lost their property values. In Untitled UI (8,074 copies) an input's "Hint text" no longer followed its property. A copy now names the definition it was made from. Co-Authored-By: Claude Opus 5.5 --- crates/format/src/fig/map.rs | 32 +++++-- crates/format/src/fig/mod.rs | 2 + crates/format/src/fig/prop_value_tests.rs | 107 ++++++++++++++++++++++ 3 files changed, 134 insertions(+), 7 deletions(-) create mode 100644 crates/format/src/fig/prop_value_tests.rs diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 7df4d9e21..6e4ea86f3 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -368,6 +368,9 @@ struct Mapper<'a> { blobs: Vec<&'a [u8]>, /// Component property definitions: id → (REST name "Name#id", type). prop_defs: BTreeMap, + /// The copies of a set's definitions each variant keeps (no name or type of their own; the + /// variant's layers and its instances' assignments use them): copy id → the definition's id. + prop_parents: BTreeMap, /// File nodes by asset `key` and `version`: references can name a collection, variable or /// style as the asset instead of the guid, and the file carries the resources to resolve /// them (the collection node itself says the same `key`). @@ -402,6 +405,7 @@ impl<'a> Mapper<'a> { let mut nodes = BTreeMap::new(); let mut kids: BTreeMap> = BTreeMap::new(); let mut prop_defs = BTreeMap::new(); + let mut prop_parents = BTreeMap::new(); let changes = msg.get("nodeChanges").map(Kv::list).unwrap_or_default(); // The last change of a GUID wins; a REMOVED change deletes what came before it. for n in changes { @@ -423,10 +427,11 @@ impl<'a> Mapper<'a> { kids.entry(parent).or_default().push((p.get("position").and_then(Kv::str).unwrap_or(""), id.clone())); } for d in n.get("componentPropDefs").map(Kv::list).unwrap_or_default() { - if let (Some(did), Some(name), Some(ty)) = - (d.get("id").and_then(guid), d.get("name").and_then(Kv::str), d.get("type").and_then(Kv::str)) - { + let Some(did) = d.get("id").and_then(guid) else { continue }; + if let (Some(name), Some(ty)) = (d.get("name").and_then(Kv::str), d.get("type").and_then(Kv::str)) { prop_defs.insert(did.clone(), (format!("{name}#{did}"), ty)); + } else if let Some(parent) = d.get("parentPropDefId").and_then(guid) { + prop_parents.insert(did, parent); } } } @@ -450,6 +455,7 @@ impl<'a> Mapper<'a> { kids, blobs, prop_defs, + prop_parents, assets, styles: Obj::new(), components: Obj::new(), @@ -651,7 +657,19 @@ impl<'a> Mapper<'a> { } fn is_instance_swap(&self, def: &Kv) -> Option<()> { - matches!(self.prop_defs.get(&guid(def)?), Some((_, "INSTANCE_SWAP"))).then_some(()) + matches!(self.prop_def(&guid(def)?), Some((_, "INSTANCE_SWAP"))).then_some(()) + } + + /// The definition `def` names: its own, or the set's for a variant's copy of it. + fn prop_def(&self, def: &str) -> Option<&(String, &'a str)> { + let mut def = def; + for _ in 0..=MAX_DEPTH { + if let Some(found) = self.prop_defs.get(def) { + return Some(found); + } + def = self.prop_parents.get(def)?; + } + None } /// The branches of the internal canvas `id` that hold the `required_mains` (with the frames @@ -1892,7 +1910,7 @@ impl<'a> Mapper<'a> { // Expanded frames must follow their main frame's source link. A direct slot reference // makes the engine resolve ownership against the instance, where the property is not defined. if !(field == "slot" && inst.is_some()) - && let Some((name, _)) = self.prop_defs.get(&def) + && let Some((name, _)) = self.prop_def(&def) { refs.insert(field.into(), json!(name)); } @@ -1945,7 +1963,7 @@ impl<'a> Mapper<'a> { let assignments = v.list("componentPropAssignments"); let mut props = Obj::new(); for a in assignments { - let Some((name, ty)) = a.get("defID").and_then(guid).and_then(|d| self.prop_defs.get(&d).cloned()) else { continue }; + let Some((name, ty)) = a.get("defID").and_then(guid).and_then(|d| self.prop_def(&d).cloned()) else { continue }; let val = a.get("value"); let p = match ty { "BOOL" => val.and_then(|x| x.get("boolValue")).and_then(Kv::bool).map(|b| json!({"type": "BOOLEAN", "value": b})), @@ -2031,7 +2049,7 @@ impl<'a> Mapper<'a> { all_props.entry(d).or_insert(val); } let Some(def) = a.get("defID").and_then(guid) else { continue }; - if self.prop_defs.get(&def).is_none_or(|(_, ty)| *ty != "SLOT") { + if self.prop_def(&def).is_none_or(|(_, ty)| *ty != "SLOT") { continue; } let var_value = a.get("varValue"); diff --git a/crates/format/src/fig/mod.rs b/crates/format/src/fig/mod.rs index fc9293d9e..4c103d088 100644 --- a/crates/format/src/fig/mod.rs +++ b/crates/format/src/fig/mod.rs @@ -26,6 +26,8 @@ pub mod kiwi; mod map; mod network; #[cfg(test)] +mod prop_value_tests; +#[cfg(test)] mod slot_tests; #[cfg(test)] mod source_identity_tests; diff --git a/crates/format/src/fig/prop_value_tests.rs b/crates/format/src/fig/prop_value_tests.rs new file mode 100644 index 000000000..3e24c3301 --- /dev/null +++ b/crates/format/src/fig/prop_value_tests.rs @@ -0,0 +1,107 @@ +//! Component properties as current `.fig` files write them, on synthetic messages: the copy of a +//! set's definitions each variant keeps (`parentPropDefId`, no name or type of its own). + +use figcraft_doc::NodeKind; +use serde_json::Value; + +use super::kiwi::Kv; +use super::map::to_rest; + +fn g(local: u32) -> Kv<'static> { + Kv::Object(vec![("sessionID", Kv::Uint(9)), ("localID", Kv::Uint(u64::from(local)))]) +} + +fn o(fields: Vec<(&'static str, Kv<'static>)>) -> Kv<'static> { + Kv::Object(fields) +} + +fn s(text: &str) -> Kv<'static> { + Kv::Str(text.into()) +} + +fn node(local: u32, kind: &'static str, name: &str, parent: Option, mut fields: Vec<(&'static str, Kv<'static>)>) -> Kv<'static> { + let mut all = vec![("guid", g(local)), ("type", Kv::Enum(kind)), ("name", s(name))]; + if let Some(parent) = parent { + all.push(("parentIndex", o(vec![("guid", g(parent)), ("position", s("!"))]))); + } + all.append(&mut fields); + o(all) +} + +/// A layer's `field` bound to property definition `def`. +fn bound(field: &'static str, def: u32) -> (&'static str, Kv<'static>) { + let entry = o(vec![ + ("variableField", Kv::Enum(field)), + ("variableData", o(vec![("value", o(vec![("propRefValue", o(vec![("defId", g(def))]))])), ("dataType", Kv::Enum("PROP_REF"))])), + ]); + ("parameterConsumptionMap", o(vec![("entries", Kv::Array(vec![entry]))])) +} + +fn definition(id: u32, name: &str, kind: &'static str, initial: Kv<'static>) -> Kv<'static> { + o(vec![("id", g(id)), ("name", s(name)), ("type", Kv::Enum(kind)), ("initialValue", initial)]) +} + +fn message(nodes: Vec>) -> Kv<'static> { + let mut all = vec![node(1, "DOCUMENT", "Document", None, vec![]), node(2, "CANVAS", "Page", Some(1), vec![])]; + all.extend(nodes); + o(vec![("nodeChanges", Kv::Array(all))]) +} + +fn by_id<'v>(v: &'v Value, id: &str) -> &'v Value { + fn find<'v>(v: &'v Value, id: &str) -> Option<&'v Value> { + if v.get("id").and_then(Value::as_str) == Some(id) { + return Some(v); + } + v.get("children").and_then(Value::as_array).into_iter().flatten().find_map(|v| find(v, id)) + } + find(v, id).unwrap_or_else(|| panic!("no layer {id}")) +} + +fn instance_props(doc: &figcraft_doc::Document) -> &std::collections::BTreeMap { + let instance = doc.ids().filter_map(|id| doc.node(id)).find(|n| n.name == "Instance").unwrap(); + let NodeKind::Instance { props, .. } = &instance.kind else { panic!("not an instance") }; + props +} + +#[test] +fn variant_layers_bind_to_the_set_properties_their_copies_name() { + let msg = message(vec![ + node( + 9, + "FRAME", + "Field", + Some(2), + vec![ + ("isStateGroup", Kv::Bool(true)), + ("componentPropDefs", Kv::Array(vec![definition(70, "Hint", "BOOL", o(vec![("boolValue", Kv::Bool(true))]))])), + ], + ), + node( + 10, + "SYMBOL", + "State=Default", + Some(9), + vec![("componentPropDefs", Kv::Array(vec![o(vec![("id", g(71)), ("parentPropDefId", g(70))])]))], + ), + node(11, "TEXT", "Hint text", Some(10), vec![bound("VISIBLE", 71)]), + node( + 20, + "INSTANCE", + "Instance", + Some(2), + vec![ + ("symbolData", o(vec![("symbolID", g(10))])), + ("componentPropAssignments", Kv::Array(vec![o(vec![("defID", g(71)), ("value", o(vec![("boolValue", Kv::Bool(false))]))])])), + ], + ), + ]); + let (rest, _, _) = to_rest(&msg, "Synthetic", crate::rest::MAX_NODES); + assert_eq!(by_id(&rest["document"], "9:9")["componentPropertyDefinitions"]["Hint#9:70"]["type"], "BOOLEAN"); + assert_eq!(by_id(&rest["document"], "9:11")["componentPropertyReferences"]["visible"], "Hint#9:70"); + assert_eq!(by_id(&rest["document"], "9:20")["componentProperties"]["Hint#9:70"]["value"], false); + + let (doc, _) = crate::rest::import_fig(&rest, &crate::rest::no_images).unwrap(); + let hint = doc.ids().filter_map(|id| doc.node(id)).find(|n| n.name == "Hint text" && n.source.is_none()).unwrap(); + assert_eq!(hint.prop_refs.get("visible").map(String::as_str), Some("Hint")); + assert_eq!(instance_props(&doc).get("Hint"), Some(&Value::Bool(false))); +} From 544b2455c9ab82fbba44c95a3b3396da9c22bdc2 Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Sun, 18 Oct 2026 16:49:34 +0200 Subject: [PATCH 308/817] M8: a path in a root reached through a link is told why it is refused When a path can't be resolved (a link that leads nowhere, `..` below a missing folder), the reason is given only for paths inside a root. That check compared the path as typed with the roots resolved, so a root reached through a link (`/tmp/work` on macOS is `/private/tmp/work`) called its own dangling links "outside the folders that may be written: /private/tmp/work", and a link out of a root still had its reason told. The existing part of the path is now resolved before the comparison, as the roots were. This is also why `links_that_lead_out_of_a_root_are_outside` and `outside_paths_are_refused_alike_whatever_exists_there` failed on macOS, where the temp folder is under `/var` -> `/private/var`. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/file_access.rs | 22 +++++++++++++++++----- crates/engine/src/file_access_tests.rs | 17 +++++++++++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/file_access.rs b/crates/engine/src/file_access.rs index 8abeaee5d..709b34a71 100644 --- a/crates/engine/src/file_access.rs +++ b/crates/engine/src/file_access.rs @@ -62,7 +62,7 @@ impl Roots { Ok(resolved) if roots.iter().any(|r| resolved.starts_with(r)) => return Ok(resolved), Ok(_) => {} // Why a path can't be resolved says what exists there: only told for paths inside a root. - Err(why) if lexically_inside(path, &roots) => return Err(format!("automation path rejected: {asked}: {why}")), + Err(why) if inside_as_far_as_it_exists(path, &roots) => return Err(format!("automation path rejected: {asked}: {why}")), Err(_) => {} } if roots.is_empty() { @@ -79,9 +79,10 @@ impl Roots { } } -/// Whether `path`, made absolute with its `.` and `..` taken by name (no file system), lies in one -/// of `roots` (as resolved, or as shown without Windows' `\\?\` prefix). -fn lexically_inside(path: &Path, roots: &[PathBuf]) -> bool { +/// 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() { @@ -93,7 +94,18 @@ fn lexically_inside(path: &Path, roots: &[PathBuf]) -> bool { c => lexical.push(c), } } - roots.iter().any(|r| lexical.starts_with(r) || lexical.starts_with(shown(r))) + let mut rest: Vec<&OsStr> = Vec::new(); + let mut at = lexical.as_path(); + let resolved = loop { + if let Ok(mut base) = std::fs::canonicalize(at) { + base.extend(rest.iter().rev()); + break base; + } + let (Some(name), Some(parent)) = (at.file_name(), at.parent()) else { return false }; + rest.push(name); + at = parent; + }; + roots.iter().any(|r| resolved.starts_with(r)) } /// Whether `path` lies in the app's own folder `folder`, both resolved (links and `..` followed); diff --git a/crates/engine/src/file_access_tests.rs b/crates/engine/src/file_access_tests.rs index a05ad88ce..ba55e1348 100644 --- a/crates/engine/src/file_access_tests.rs +++ b/crates/engine/src/file_access_tests.rs @@ -348,6 +348,10 @@ fn outside_paths_are_refused_alike_whatever_exists_there() { let mut outside = vec![f.p("outside/secret.txt"), f.p("outside/none.txt"), f.p("outside/missing/../x.txt"), f.p("nowhere/deeper/x.txt")]; if symlink_file(&f.0.join("outside/not-yet.txt"), &f.0.join("outside/dangling.txt")) { outside.push(f.p("outside/dangling.txt")); + // Reached through a link in the root, it is outside all the same. + if symlink_dir(&f.0.join("outside"), &f.0.join("root/escape")) { + outside.push(f.p("root/escape/dangling.txt")); + } } for p in &outside { let e = refusal(p); @@ -359,6 +363,19 @@ fn outside_paths_are_refused_alike_whatever_exists_there() { } } +#[test] +fn a_root_given_through_a_link_tells_why_paths_in_it_are_refused() { + let f = Fixture::new("linked-root"); + if !symlink_dir(&f.0.join("root"), &f.0.join("via")) || !symlink_file(&f.0.join("outside/not-yet.txt"), &f.0.join("root/dangling.txt")) { + eprintln!("skipped: this system doesn't let tests make symbolic links"); + return; + } + // Like `/tmp/work` on macOS, where `/tmp` leads to `/private/tmp`. + let r = Roots::new(&[], &[f.p("via")]).unwrap(); + let e = r.check(Path::new(&f.p("via/dangling.txt")), Access::Write).unwrap_err(); + assert!(e.contains("leads nowhere"), "{e}"); +} + #[test] fn only_resolved_paths_count_as_the_apps_own_folder() { let f = Fixture::new("own"); From c530b4067d6324853cec77c95c8b1a7351540cb7 Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Sun, 18 Oct 2026 23:01:33 +0200 Subject: [PATCH 309/817] M3: .fig imports read property values written only as variables A component property assignment carries its value in `value`, and in current files also in the variable form `varValue`. Many assignments leave `value` empty and say it only in `varValue` (booleans as boolValue, instance swaps as symbolIdValue, text as textDataValue), and those were ignored: a hidden layer showed and a swapped icon stayed the default. In Untitled UI that is 1,643 booleans and 185 swaps, so inputs showed their hint text, help icon and leading icon on top of the neighbouring layers. Both forms are read now. Co-Authored-By: Claude Opus 5.5 --- crates/format/src/fig/map.rs | 30 +++++++--- crates/format/src/fig/prop_value_tests.rs | 67 ++++++++++++++++++++++- 2 files changed, 89 insertions(+), 8 deletions(-) diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 6e4ea86f3..22043650a 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -646,7 +646,7 @@ impl<'a> Mapper<'a> { targets.extend(data.and_then(|d| d.get("symbolID")).and_then(guid)); for assignment in row.get("componentPropAssignments").map(Kv::list).unwrap_or_default() { if assignment.get("defID").is_some_and(|def| self.is_instance_swap(def).is_some()) { - targets.extend(assignment.get("value").and_then(|v| v.get("guidValue")).and_then(guid)); + targets.extend(assigned(assignment).and_then(prop_guid)); } } let overrides = data.and_then(|d| d.get("symbolOverrides")).map(Kv::list).unwrap_or_default(); @@ -1929,7 +1929,7 @@ impl<'a> Mapper<'a> { if own_text(v) != Some(t) { o.remove("characterStyleOverrides"); o.remove("styleOverrideTable"); - if let Some(tv) = val.get("textValue") { + if let Some(tv) = prop_text_data(val) { let size = o.get("style").and_then(|s| s.get("fontSize")).and_then(Value::as_f64); char_styles(o, tv, size, &mut |w| self.warn(w)); } @@ -1951,7 +1951,7 @@ impl<'a> Mapper<'a> { // An instance swap property value picks the main. if let Some(i) = outer && let Some(def) = prop_ref(v, "OVERRIDDEN_SYMBOL_ID") - && let Some(g) = i.props.get(&def).and_then(|p| p.get("guidValue")).and_then(guid) + && let Some(g) = i.props.get(&def).and_then(|p| prop_guid(p)) { sym = Some(g); } @@ -1964,11 +1964,11 @@ impl<'a> Mapper<'a> { let mut props = Obj::new(); for a in assignments { let Some((name, ty)) = a.get("defID").and_then(guid).and_then(|d| self.prop_def(&d).cloned()) else { continue }; - let val = a.get("value"); + let val = assigned(a); let p = match ty { "BOOL" => val.and_then(|x| x.get("boolValue")).and_then(Kv::bool).map(|b| json!({"type": "BOOLEAN", "value": b})), "TEXT" => val.and_then(prop_text).map(|t| json!({"type": "TEXT", "value": t})), - "INSTANCE_SWAP" => val.and_then(|x| x.get("guidValue")).and_then(guid).map(|g| json!({"type": "INSTANCE_SWAP", "value": g})), + "INSTANCE_SWAP" => val.and_then(prop_guid).map(|g| json!({"type": "INSTANCE_SWAP", "value": g})), _ => None, }; if let Some(p) = p { @@ -2045,7 +2045,7 @@ impl<'a> Mapper<'a> { let mut all_props: BTreeMap> = outer.map(|i| (*i.props).clone()).unwrap_or_default(); let mut slot_contents: BTreeMap = outer.map(|i| (*i.slot_contents).clone()).unwrap_or_default(); for a in assignments { - if let (Some(d), Some(val)) = (a.get("defID").and_then(guid), a.get("value")) { + if let (Some(d), Some(val)) = (a.get("defID").and_then(guid), assigned(a)) { all_props.entry(d).or_insert(val); } let Some(def) = a.get("defID").and_then(guid) else { continue }; @@ -2795,7 +2795,23 @@ fn char_styles(o: &mut Obj, td: &Kv, size: Option, warn: &mut dyn FnMut(Str /// The text of a component property value. fn prop_text<'k>(v: &'k Kv) -> Option<&'k str> { - v.get("textValue").and_then(|t| t.get("characters")).and_then(Kv::str) + prop_text_data(v).and_then(|t| t.get("characters")).and_then(Kv::str) +} + +/// The text data of a component property value: `textValue`, or `textDataValue` in the variable form. +fn prop_text_data<'k, 's>(v: &'k Kv<'s>) -> Option<&'k Kv<'s>> { + v.get("textValue").or_else(|| v.get("textDataValue")) +} + +/// The main an instance swap value names: `guidValue`, or `symbolIdValue` in the variable form. +fn prop_guid(v: &Kv) -> Option { + v.get("guidValue").and_then(guid).or_else(|| v.get("symbolIdValue")?.get("guid").and_then(guid)) +} + +/// The value a component property assignment sets: `value`, or the variable form `varValue` holds +/// when `value` is empty, as current files write many booleans and instance swaps. +fn assigned<'k, 's>(assignment: &'k Kv<'s>) -> Option<&'k Kv<'s>> { + assignment.get("value").filter(|v| !matches!(v, Kv::Object(fields) if fields.is_empty())).or_else(|| assignment.get("varValue")?.get("value")) } /// The property a layer's `field` is bound to (`parameterConsumptionMap`). diff --git a/crates/format/src/fig/prop_value_tests.rs b/crates/format/src/fig/prop_value_tests.rs index 3e24c3301..577b811a9 100644 --- a/crates/format/src/fig/prop_value_tests.rs +++ b/crates/format/src/fig/prop_value_tests.rs @@ -1,5 +1,6 @@ //! Component properties as current `.fig` files write them, on synthetic messages: the copy of a -//! set's definitions each variant keeps (`parentPropDefId`, no name or type of its own). +//! set's definitions each variant keeps (`parentPropDefId`, no name or type of its own), and +//! assignments that carry their value only in the variable form (`varValue`). use figcraft_doc::NodeKind; use serde_json::Value; @@ -41,6 +42,15 @@ fn definition(id: u32, name: &str, kind: &'static str, initial: Kv<'static>) -> o(vec![("id", g(id)), ("name", s(name)), ("type", Kv::Enum(kind)), ("initialValue", initial)]) } +/// An assignment of `def` that leaves `value` empty and says it in `varValue` only. +fn variable_assignment(def: u32, data_type: &'static str, value: Kv<'static>) -> Kv<'static> { + o(vec![ + ("defID", g(def)), + ("value", o(vec![])), + ("varValue", o(vec![("value", value), ("dataType", Kv::Enum(data_type)), ("resolvedDataType", Kv::Enum(data_type))])), + ]) +} + fn message(nodes: Vec>) -> Kv<'static> { let mut all = vec![node(1, "DOCUMENT", "Document", None, vec![]), node(2, "CANVAS", "Page", Some(1), vec![])]; all.extend(nodes); @@ -105,3 +115,58 @@ fn variant_layers_bind_to_the_set_properties_their_copies_name() { assert_eq!(hint.prop_refs.get("visible").map(String::as_str), Some("Hint")); assert_eq!(instance_props(&doc).get("Hint"), Some(&Value::Bool(false))); } + +#[test] +fn property_values_written_only_as_variables_are_applied() { + let msg = message(vec![ + node( + 10, + "SYMBOL", + "Field", + Some(2), + vec![( + "componentPropDefs", + Kv::Array(vec![ + definition(70, "Hint", "BOOL", o(vec![("boolValue", Kv::Bool(true))])), + definition(71, "Label", "TEXT", o(vec![("textValue", o(vec![("characters", s("Label"))]))])), + definition(72, "Icon", "INSTANCE_SWAP", o(vec![("guidValue", g(40))])), + ]), + )], + ), + node(11, "TEXT", "Hint text", Some(10), vec![bound("VISIBLE", 70)]), + node(12, "TEXT", "Label", Some(10), vec![("textData", o(vec![("characters", s("Label"))])), bound("TEXT_DATA", 71)]), + node(13, "INSTANCE", "Icon", Some(10), vec![("symbolData", o(vec![("symbolID", g(40))])), bound("OVERRIDDEN_SYMBOL_ID", 72)]), + node(40, "SYMBOL", "Mail", Some(2), vec![]), + node(41, "SYMBOL", "Card", Some(2), vec![]), + node( + 20, + "INSTANCE", + "Instance", + Some(2), + vec![ + ("symbolData", o(vec![("symbolID", g(10))])), + ( + "componentPropAssignments", + Kv::Array(vec![ + variable_assignment(70, "BOOLEAN", o(vec![("boolValue", Kv::Bool(false))])), + variable_assignment(71, "TEXT_DATA", o(vec![("textDataValue", o(vec![("characters", s("Name on card"))]))])), + variable_assignment(72, "SYMBOL_ID", o(vec![("symbolIdValue", o(vec![("guid", g(41))]))])), + ]), + ), + ], + ), + ]); + let (rest, _, _) = to_rest(&msg, "Synthetic", crate::rest::MAX_NODES); + let instance = by_id(&rest["document"], "9:20"); + assert_eq!(instance["componentProperties"]["Hint#9:70"]["value"], false); + assert_eq!(instance["componentProperties"]["Label#9:71"]["value"], "Name on card"); + assert_eq!(instance["componentProperties"]["Icon#9:72"]["value"], "9:41"); + assert_eq!(by_id(instance, "I9:20;9:11")["visible"], false); + assert_eq!(by_id(instance, "I9:20;9:12")["characters"], "Name on card"); + assert_eq!(by_id(instance, "I9:20;9:13")["componentId"], "9:41"); + + let (doc, _) = crate::rest::import_fig(&rest, &crate::rest::no_images).unwrap(); + let props = instance_props(&doc); + assert_eq!(props.get("Hint"), Some(&Value::Bool(false))); + assert_eq!(props.get("Label"), Some(&Value::String("Name on card".into()))); +} From f97789ade13a7c3ba27dac8078e1c38b14ff5eb4 Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Sun, 18 Oct 2026 23:13:03 +0200 Subject: [PATCH 310/817] M7: CSS borders follow individual stroke sides A layer with individual stroke sides (a header with only a bottom divider, strokeSides [0, 0, 1, 0]) came out of the CSS, HTML, React and Leptos code as `border: 1px solid ...` on all four sides, because the border was written from the stroke weight alone. With individual sides it is now a border-top/right/bottom/left for each side that has a weight, and a side bound to a variable names it (border-top: var(--border-top, 3px)). Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/codegen.rs | 24 +++++++++++++++++--- crates/engine/src/inspect_behaviour_tests.rs | 20 ++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/codegen.rs b/crates/engine/src/codegen.rs index 6dd806462..ac7c96fa0 100644 --- a/crates/engine/src/codegen.rs +++ b/crates/engine/src/codegen.rs @@ -259,6 +259,25 @@ fn stroke_color(n: &Node) -> Option { n.strokes.iter().filter(|p| p.visible).find_map(|p| p.solid_color()) } +/// The CSS borders a solid stroke makes: one `border`, or with individual stroke sides a border +/// on each side that has a weight. +fn css_borders(doc: &Document, n: &Node, t: &mut Tokens) -> Vec<(String, String)> { + let Some(c) = stroke_color(n) else { return Vec::new() }; + let Some(sides) = n.stroke.sides else { + let weight = tok(doc, n, &["strokeWeight"], format!("{}px", num(n.stroke.weight)), t); + return vec![("border".into(), format!("{weight} solid {}", tok(doc, n, &["stroke"], c.to_css(), t)))]; + }; + let color = tok(doc, n, &["stroke"], c.to_css(), t); + let named = ["top", "right", "bottom", "left"].into_iter().zip(crate::cmd::props::STROKE_SIDES); + named + .zip(sides) + .filter(|(_, weight)| *weight > 0.0) + .map(|((side, field), weight)| { + (format!("border-{side}"), format!("{} solid {color}", tok(doc, n, &[field], format!("{}px", num(weight)), t))) + }) + .collect() +} + fn drop_shadow(n: &Node) -> Option<&Shadow> { n.effects.iter().filter(|e| e.visible).find_map(|e| match &e.kind { EffectKind::DropShadow(s) => Some(s), @@ -452,9 +471,8 @@ pub(crate) fn css_decls(doc: &Document, n: &Node, t: &mut Tokens, hug: (bool, bo PaintKind::Pattern(_) => put("background", "url(pattern.png) repeat".into()), } } - if let Some(c) = stroke_color(n) { - let weight = tok(doc, n, &["strokeWeight"], px(n.stroke.weight), t); - put("border", format!("{weight} solid {}", tok(doc, n, &["stroke"], c.to_css(), t))); + for (key, value) in css_borders(doc, n, t) { + put(&key, value); } let shadows: Vec = n .effects diff --git a/crates/engine/src/inspect_behaviour_tests.rs b/crates/engine/src/inspect_behaviour_tests.rs index a52cac86f..c4bcc6be6 100644 --- a/crates/engine/src/inspect_behaviour_tests.rs +++ b/crates/engine/src/inspect_behaviour_tests.rs @@ -214,6 +214,26 @@ fn css_for_common_layers() { } } +/// Individual stroke sides are borders on those sides only: a header with a divider under it isn't +/// boxed in, and a side bound to a variable names it. +#[test] +fn css_borders_follow_individual_stroke_sides() { + let mut s = Session::new(); + let r = rect(&mut s, 0.0, 0.0, 100.0, 50.0, None); + set(&mut s, &[r], json!({"strokes": ["#000000"], "strokeWeight": 1, "strokeSides": [0, 0, 2, 0]})); + let c = css(&mut s, r); + assert!(c.contains("border-bottom: 2px solid #000000;"), "{c}"); + assert!(!c.contains("border:") && !c.contains("border-top") && !c.contains("border-right") && !c.contains("border-left"), "{c}"); + + let col = ex(&mut s, "variable.createCollection", json!({"name": "Borders"})); + let col = col["id"].as_str().unwrap().to_string(); + ex(&mut s, "variable.create", json!({"collection": col, "name": "border/top", "type": "number", "value": 3})); + ex(&mut s, "variable.bind", json!({"ids": [r], "field": "strokeTopWeight", "variable": "border/top"})); + let c = css(&mut s, r); + assert!(c.contains("border-top: var(--border-top, 3px) solid #000000;"), "{c}"); + assert!(c.contains("border-bottom: 2px solid #000000;"), "{c}"); +} + #[test] fn native_code_for_a_simple_layer() { let mut s = Session::new(); From 017517fbb9c1b1dfa96ff23ed9e5f5f8363b23da Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Sun, 18 Oct 2026 23:44:37 +0200 Subject: [PATCH 311/817] #847: an instance's values are kept under the original definition An assignment and the layers that read it can name different copies of one definition (the set's own id on one side, a variant's copy on the other). The values were kept under the id the assignment names and read under the id the layer names, so such a value never reached its layer. Both sides now go through prop_root, the definition the copies were made from (CodeRabbit on #847). In Untitled UI, 143 assignments name a copy that no layer reads while another copy of it is read. Co-Authored-By: Claude Opus 5.5 --- crates/format/src/fig/map.rs | 22 ++++++++++++++----- crates/format/src/fig/prop_value_tests.rs | 26 ++++++++++++++++++----- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 22043650a..8e4671511 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -660,6 +660,18 @@ impl<'a> Mapper<'a> { matches!(self.prop_def(&guid(def)?), Some((_, "INSTANCE_SWAP"))).then_some(()) } + /// The definition a copy of it was made from, followed to the original: the values an instance + /// sets are kept under it, since an assignment and the layers that read it may name different + /// copies of one definition. + fn prop_root(&self, def: &str) -> String { + let mut def = def; + for _ in 0..=MAX_DEPTH { + let Some(parent) = self.prop_parents.get(def) else { break }; + def = parent; + } + def.to_string() + } + /// The definition `def` names: its own, or the set's for a variant's copy of it. fn prop_def(&self, def: &str) -> Option<&(String, &'a str)> { let mut def = def; @@ -926,7 +938,7 @@ impl<'a> Mapper<'a> { } self.prop_refs(&mut o, &view, inst); let slot_content = if own == "FRAME" { - prop_ref(&view, "SLOT_CONTENT_ID").and_then(|def| inst.and_then(|i| i.slot_contents.get(&def).cloned())) + prop_ref(&view, "SLOT_CONTENT_ID").and_then(|def| inst.and_then(|i| i.slot_contents.get(&self.prop_root(&def)).cloned())) } else { None }; @@ -1914,7 +1926,7 @@ impl<'a> Mapper<'a> { { refs.insert(field.into(), json!(name)); } - let Some(val) = inst.and_then(|i| i.props.get(&def)) else { continue }; + let Some(val) = inst.and_then(|i| i.props.get(&self.prop_root(&def))) else { continue }; match field { "visible" => { if let Some(b) = val.get("boolValue").and_then(Kv::bool) { @@ -1951,7 +1963,7 @@ impl<'a> Mapper<'a> { // An instance swap property value picks the main. if let Some(i) = outer && let Some(def) = prop_ref(v, "OVERRIDDEN_SYMBOL_ID") - && let Some(g) = i.props.get(&def).and_then(|p| prop_guid(p)) + && let Some(g) = i.props.get(&self.prop_root(&def)).and_then(|p| prop_guid(p)) { sym = Some(g); } @@ -2046,7 +2058,7 @@ impl<'a> Mapper<'a> { let mut slot_contents: BTreeMap = outer.map(|i| (*i.slot_contents).clone()).unwrap_or_default(); for a in assignments { if let (Some(d), Some(val)) = (a.get("defID").and_then(guid), assigned(a)) { - all_props.entry(d).or_insert(val); + all_props.entry(self.prop_root(&d)).or_insert(val); } let Some(def) = a.get("defID").and_then(guid) else { continue }; if self.prop_def(&def).is_none_or(|(_, ty)| *ty != "SLOT") { @@ -2070,7 +2082,7 @@ impl<'a> Mapper<'a> { self.warn("slot content assignment target is missing or is not slot content"); continue; } - slot_contents.entry(def).or_insert(target); + slot_contents.entry(self.prop_root(&def)).or_insert(target); } let mut symbols = outer.map(|i| i.symbols.clone()).unwrap_or_default(); symbols.push(sym.clone()); diff --git a/crates/format/src/fig/prop_value_tests.rs b/crates/format/src/fig/prop_value_tests.rs index 577b811a9..24248d32a 100644 --- a/crates/format/src/fig/prop_value_tests.rs +++ b/crates/format/src/fig/prop_value_tests.rs @@ -73,9 +73,10 @@ fn instance_props(doc: &figcraft_doc::Document) -> &std::collections::BTreeMap Kv<'static> { + message(vec![ node( 9, "FRAME", @@ -101,10 +102,15 @@ fn variant_layers_bind_to_the_set_properties_their_copies_name() { Some(2), vec![ ("symbolData", o(vec![("symbolID", g(10))])), - ("componentPropAssignments", Kv::Array(vec![o(vec![("defID", g(71)), ("value", o(vec![("boolValue", Kv::Bool(false))]))])])), + ("componentPropAssignments", Kv::Array(vec![o(vec![("defID", g(assigned)), ("value", o(vec![("boolValue", Kv::Bool(false))]))])])), ], ), - ]); + ]) +} + +#[test] +fn variant_layers_bind_to_the_set_properties_their_copies_name() { + let msg = field_set(71); let (rest, _, _) = to_rest(&msg, "Synthetic", crate::rest::MAX_NODES); assert_eq!(by_id(&rest["document"], "9:9")["componentPropertyDefinitions"]["Hint#9:70"]["type"], "BOOLEAN"); assert_eq!(by_id(&rest["document"], "9:11")["componentPropertyReferences"]["visible"], "Hint#9:70"); @@ -116,6 +122,16 @@ fn variant_layers_bind_to_the_set_properties_their_copies_name() { assert_eq!(instance_props(&doc).get("Hint"), Some(&Value::Bool(false))); } +/// An assignment reaches layers that read another copy of its definition: here the instance sets +/// the set's own definition while the variant's layer reads the variant's copy. +#[test] +fn assignments_reach_layers_that_read_another_copy_of_their_definition() { + let (rest, _, _) = to_rest(&field_set(70), "Synthetic", crate::rest::MAX_NODES); + let instance = by_id(&rest["document"], "9:20"); + assert_eq!(instance["componentProperties"]["Hint#9:70"]["value"], false); + assert_eq!(by_id(instance, "I9:20;9:11")["visible"], false); +} + #[test] fn property_values_written_only_as_variables_are_applied() { let msg = message(vec![ From 147a37435006f8853bb961f8d197ddd7107bbe32 Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Sun, 18 Oct 2026 23:22:31 +0200 Subject: [PATCH 312/817] M3: a refused slot names component.makeSlot component.makeSlot adds its slot property through add_prop, which named itself in every error: making a second slot called "Content" said "invalid parameters for `component.addProperty`: a property named `Content` already exists", a command the caller never ran. add_prop now takes the command errors name, the fix #807 makes for wrap. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/component.rs | 9 +++++++-- crates/engine/src/slot_tests.rs | 11 +++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/cmd/component.rs b/crates/engine/src/cmd/component.rs index ff7a56df4..42730a37c 100644 --- a/crates/engine/src/cmd/component.rs +++ b/crates/engine/src/cmd/component.rs @@ -608,7 +608,7 @@ fn make_slot(s: &mut Session, p: &Value) -> Result { let owner = Owner::resolve(doc, id).ok_or_else(|| bad(cmd, "the frame isn't inside a component"))?; let name = string(p, "name").unwrap_or_else(|| fresh_prop_name(doc, &owner, &n.name)); let preferred = get(p, "preferred").cloned().unwrap_or(Value::Null); - add_prop(s, &json!({"id": id, "layer": id, "name": name, "type": "slot", "preferred": preferred})) + add_prop_for(cmd, s, &json!({"id": id, "layer": id, "name": name, "type": "slot", "preferred": preferred})) } fn remove_slot(s: &mut Session, p: &Value) -> Result { @@ -1039,7 +1039,12 @@ fn valid_prop_name(cmd: &str, name: &str) -> Result { } fn add_prop(s: &mut Session, p: &Value) -> Result { - let cmd = "component.addProperty"; + add_prop_for("component.addProperty", s, p) +} + +/// Add a component property for command `cmd`, which errors name (`component.makeSlot` adds its +/// slot property here). +fn add_prop_for(cmd: &str, s: &mut Session, p: &Value) -> Result { let target = targets(s, p).first().copied().ok_or_else(|| bad(cmd, "select a component"))?; let name = valid_prop_name(cmd, &req_string(cmd, p, "name")?)?; let t = req_string(cmd, p, "type")?; diff --git a/crates/engine/src/slot_tests.rs b/crates/engine/src/slot_tests.rs index 516cb9d6c..cbf824d9f 100644 --- a/crates/engine/src/slot_tests.rs +++ b/crates/engine/src/slot_tests.rs @@ -41,6 +41,17 @@ fn props_of(s: &mut Session, id: NodeId) -> Vec { ex(s, "component.properties", json!({"id": id}))["properties"].as_array().cloned().unwrap_or_default() } +/// A refused slot is reported by `component.makeSlot`, the command that was run, not by the +/// property command it adds its slot property through. +#[test] +fn a_refused_slot_names_make_slot() { + let mut s = Session::new(); + let (c, ..) = slot_card(&mut s); + let other = idv(&ex(&mut s, "frame.create", json!({"x": 150, "y": 10, "width": 40, "height": 30, "parent": c, "name": "Other"}))); + let err = s.execute("component.makeSlot", &json!({"id": other, "name": "Content"})).unwrap_err().to_string(); + assert!(err.contains("`component.makeSlot`") && err.contains("a property named `Content` already exists"), "{err}"); +} + #[test] fn slots_are_frames_of_a_main_with_a_slot_property() { let mut s = Session::new(); From 6f90717e712d5052d64512c997a1d9a066b83cc7 Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Sun, 18 Oct 2026 23:35:50 +0200 Subject: [PATCH 313/817] M3: effects refuse keys they don't read instead of dropping them node.set refuses unknown properties, but the effects inside it were read by serde, which drops keys it doesn't know. A drop shadow given offsetX/offsetY (the names variable bindings use for its offset) was stored with the default offset [0, 4] and the call said ok. effect.add and effect.set dropped them the same way. The three now refuse what the effect doesn't read and say what it takes: "effects[0]: unknown properties: offsetX, offsetY (a dropShadow takes blend, color, offset, radius, showBehind, spread, type, visible)". A key counts as read when setting it to null makes the effect fail to parse or come out different, so serde's aliases count as read without a list of them here. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/edit.rs | 6 ++-- crates/engine/src/cmd/props.rs | 44 +++++++++++++++++++++++++++++- crates/engine/src/effects_tests.rs | 26 ++++++++++++++++++ 3 files changed, 72 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index a4769a35c..3c4a180df 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -261,7 +261,7 @@ pub fn specs() -> Vec { }), spec!("effect.set", "Set effect", "{ids?, index, effect {..}}", true, |s, p| { let i = req_index("effect.set", p, "index")?; - let e: Effect = parse("effect.set", p, "effect")?.ok_or_else(|| bad("effect.set", "`effect` required"))?; + let e = super::props::effect_from("effect.set", p, "effect")?.ok_or_else(|| bad("effect.set", "`effect` required"))?; for id in req_targets("effect.set", s, p)? { let n = s.doc_mut()?.get_mut(id)?; if let Some(slot) = n.effects.get_mut(i) { @@ -1376,8 +1376,8 @@ fn pattern_fill(s: &mut Session, p: &Value) -> Result { } fn effect_add(s: &mut Session, p: &Value) -> Result { - let e: Effect = match get(p, "effect") { - Some(v) => serde_json::from_value(v.clone()).map_err(|e| bad("effect.add", e.to_string()))?, + let e: Effect = match super::props::effect_from("effect.add", p, "effect")? { + Some(e) => e, None => { let ty = string(p, "type").unwrap_or_else(|| "dropShadow".into()); Effect::of_type(&ty).ok_or_else(|| bad("effect.add", format!("unknown effect type `{ty}`")))? diff --git a/crates/engine/src/cmd/props.rs b/crates/engine/src/cmd/props.rs index 8a1f4e1cd..8fd4ff40c 100644 --- a/crates/engine/src/cmd/props.rs +++ b/crates/engine/src/cmd/props.rs @@ -61,6 +61,48 @@ pub fn snake(v: &Value) -> Value { } } +/// `v` as an effect list, refusing keys an effect doesn't read: serde dropped them without a word, +/// so a shadow given `offsetY` kept the default offset. +pub fn effects_from(cmd: &str, v: &Value) -> Result> { + let effects: Vec = serde_json::from_value(snake(v)).map_err(|e| bad(cmd, format!("effects: {e}")))?; + for (i, given) in v.as_array().into_iter().flatten().enumerate() { + refuse_ignored_effect_keys(cmd, &format!("effects[{i}]"), given, |v| serde_json::from_value(snake(v)).ok())?; + } + Ok(effects) +} + +/// `p[key]` as one effect, read as serde reads it (its aliases too), refusing keys it doesn't read. +pub fn effect_from(cmd: &str, p: &Value, key: &str) -> Result> { + let Some(v) = get(p, key) else { return Ok(None) }; + let effect: Effect = serde_json::from_value(v.clone()).map_err(|e| bad(cmd, format!("`{key}`: {e}")))?; + refuse_ignored_effect_keys(cmd, &format!("`{key}`"), v, |v| serde_json::from_value(v.clone()).ok())?; + Ok(Some(effect)) +} + +/// Refuse the keys of effect `given` that `parse` ignores, naming the keys the effect takes. Set to +/// null, a key it reads fails to parse or changes the effect; a key it ignores changes nothing. +fn refuse_ignored_effect_keys(cmd: &str, at: &str, given: &Value, parse: impl Fn(&Value) -> Option) -> Result<()> { + let Some(fields) = given.as_object() else { return Ok(()) }; + let parsed = parse(given); + let ignored: Vec<&str> = fields + .iter() + .filter(|(_, v)| !v.is_null()) + .filter(|(k, _)| { + let mut probe = fields.clone(); + probe.insert((*k).clone(), Value::Null); + parse(&Value::Object(probe)).is_some_and(|e| Some(e) == parsed) + }) + .map(|(k, _)| k.as_str()) + .collect(); + if ignored.is_empty() { + return Ok(()); + } + let takes = parsed.and_then(|e| serde_json::to_value(e).ok()).map(crate::inspect::camel).unwrap_or_default(); + let kind = takes.get("type").and_then(Value::as_str).unwrap_or("effect").to_string(); + let names: Vec<&str> = takes.as_object().into_iter().flatten().map(|(k, _)| k.as_str()).collect(); + Err(bad(cmd, format!("{at}: unknown properties: {} (a {kind} takes {})", ignored.join(", "), names.join(", ")))) +} + pub(crate) fn enum_of(v: &Value) -> Option { let s = v.as_str()?; // Accept camelCase, snake/upper-case and spaced variants. @@ -462,7 +504,7 @@ pub fn apply(cmd: &str, doc: &mut Document, id: NodeId, props: &Map doc.get_mut(id)?.corners.smoothing = f64_of(v).unwrap_or(0.0).clamp(0.0, 1.0), - "effects" => doc.get_mut(id)?.effects = serde_json::from_value(snake(v)).map_err(|e| bad(cmd, format!("effects: {e}")))?, + "effects" => doc.get_mut(id)?.effects = effects_from(cmd, v)?, "clip" | "clipsContent" => doc.get_mut(id)?.clip = v.as_bool().ok_or_else(|| bad(cmd, "`clip` must be a boolean"))?, "isMask" => doc.get_mut(id)?.is_mask = v.as_bool().unwrap_or(false), "devStatus" => { diff --git a/crates/engine/src/effects_tests.rs b/crates/engine/src/effects_tests.rs index be69fac20..607b77114 100644 --- a/crates/engine/src/effects_tests.rs +++ b/crates/engine/src/effects_tests.rs @@ -51,6 +51,32 @@ fn effect_set_edits_noise_texture_and_glass() { assert!(s.execute("effect.set", &json!({"ids": [r], "index": 0, "effect": {"type": "glass", "depth": "deep"}})).is_err()); } +/// A key an effect doesn't have is refused, naming what it takes: serde dropped it without a word, +/// so a shadow given `offsetX`/`offsetY` (the names variable bindings use) kept the default offset. +#[test] +fn effects_refuse_keys_they_dont_have() { + let mut s = Session::new(); + let r = rect(&mut s); + let shadow = json!({"type": "dropShadow", "color": "#00000040", "offsetX": 0, "offsetY": 1, "radius": 3}); + let err = s.execute("node.set", &json!({"ids": [r], "props": {"effects": [shadow]}})).unwrap_err().to_string(); + assert!(err.contains("effects[0]") && err.contains("offsetX, offsetY") && err.contains("offset"), "{err}"); + assert!(s.doc().unwrap().node(r).unwrap().effects.is_empty(), "nothing stored"); + let err = s.execute("effect.add", &json!({"ids": [r], "effect": {"type": "layerBlur", "radious": 8}})).unwrap_err().to_string(); + assert!(err.contains("radious"), "{err}"); + s.execute("effect.add", &json!({"ids": [r], "type": "dropShadow"})).unwrap(); + let err = s.execute("effect.set", &json!({"ids": [r], "index": 0, "effect": {"type": "dropShadow", "spred": 2}})).unwrap_err().to_string(); + assert!(err.contains("spred"), "{err}"); + // Every kind's own keys still go in, camelCase or snake_case, and so does what inspect reports. + for ty in ["innerShadow", "layerBlur", "backgroundBlur", "noise", "texture", "glass"] { + s.execute("effect.add", &json!({"ids": [r], "type": ty})).unwrap(); + } + let reported = crate::inspect::node_json(s.doc().unwrap(), r, 0)["effects"].clone(); + s.execute("node.set", &json!({"ids": [r], "props": {"effects": reported}})).unwrap(); + let camel = json!({"type": "dropShadow", "offset": [0, 1], "showBehind": true, "visible": true}); + let snake = json!({"type": "innerShadow", "offset": [0, 1], "show_behind": false}); + s.execute("node.set", &json!({"ids": [r], "props": {"effects": [camel, snake]}})).unwrap(); +} + #[test] fn scaling_scales_grain_and_glass() { let mut s = Session::new(); From 4e4bf54bb6b9168b7e61a393b10d8099d14555a1 Mon Sep 17 00:00:00 2001 From: Cody Campbell Date: Sun, 18 Oct 2026 18:53:32 -0400 Subject: [PATCH 314/817] M1: smart-selection drag reordering --- ROADMAP.md | 2 + crates/engine/src/cmd/arrange.rs | 49 +++++ crates/engine/src/lib.rs | 3 + crates/engine/src/selection_reorder.rs | 107 ++++++++++ crates/engine/src/selection_reorder_tests.rs | 152 ++++++++++++++ crates/engine/src/tests.rs | 3 + crates/ui-egui/locales/en.toml | 1 + crates/ui-egui/locales/es.toml | 2 + crates/ui-egui/src/selection_spacing.rs | 192 ++++++++++++++---- crates/ui-egui/src/selection_spacing_tests.rs | 128 ++++++++++++ docs/gaps.md | 6 +- docs/parity-checklist.md | 4 +- docs/target-app-parity.md | 5 +- docs/ui-parity.md | 5 +- 14 files changed, 607 insertions(+), 52 deletions(-) create mode 100644 crates/engine/src/selection_reorder.rs create mode 100644 crates/engine/src/selection_reorder_tests.rs diff --git a/ROADMAP.md b/ROADMAP.md index 8a587286d..1c3db7e40 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -131,6 +131,8 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). ## Progress log +- **2026-10-18** · Smart-selection drag reordering (M1): Smart-selection center rings insert a layer through a regular row, column or complete top-left-aligned grid; Command/Ctrl-drag swaps entries. Unequal sizes reflow with the original gaps, hierarchy and selection stay intact, and each drag is one undo step. Escape or Undo during the drag cancels; switching documents, pages or tools rolls back the owning gesture. Mixed gaps, incomplete grids and unsupported selections keep spacing controls without reorder rings. Multiple marked items and irregular-grid insertion remain unimplemented. Engine and raw-input UI regression tests; desktop Linux before/during/after screenshots and insertion, undo/redo and Escape checked on synthetic cards. No side-by-side comparison with the incumbent. Headline estimates unchanged. Validation: 1,039 engine unit tests passed (2 ignored), 555 UI unit tests passed (1 ignored); formatting, layering, assets, parity and `cargo xtask wasm` passed. Clippy passes with only the existing `collapsible_match` findings suppressed; strict `cargo xtask ci` stops on seven findings in unchanged UI files. The workspace test run stops on the unchanged text crate’s `tail_tests::hanging_punctuation_outside_the_aligned_edge` (2 lines instead of 1); no text code changed. + - **2026-10-17** · Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. - **2026-10-17** · Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. - **2026-10-17** · Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. diff --git a/crates/engine/src/cmd/arrange.rs b/crates/engine/src/cmd/arrange.rs index ad6c21d12..3b4d2b263 100644 --- a/crates/engine/src/cmd/arrange.rs +++ b/crates/engine/src/cmd/arrange.rs @@ -27,6 +27,13 @@ pub fn specs() -> Vec { spacing ), spec!("arrange.tidy", "Tidy up", "{ids?, spacing?}", true, tidy), + spec!( + "arrange.reorder", + "Reorder selection", + "{ids?, source, target, swap?, fromGesture?} (insert at target's visual slot; no hierarchy changes)", + true, + reorder + ), spec!("arrange.packH", "Pack horizontal", "{ids?}", true, |s, p| pack(s, p, true)), spec!("arrange.packV", "Pack vertical", "{ids?}", true, |s, p| pack(s, p, false)), spec!("arrange.roundToPixels", "Round to pixels", "{ids?}", true, round_px), @@ -554,6 +561,48 @@ pub(crate) fn resize_cmd(s: &mut Session, p: &Value) -> Result { ok() } +/// Reorder visual slots without rebuilding or reparenting layers. +fn reorder(s: &mut Session, p: &Value) -> Result { + let cmd = "arrange.reorder"; + let ids = req_targets(cmd, s, p)?; + let source = req_id(cmd, p, "source")?; + let target = req_id(cmd, p, "target")?; + let ds = s.ds()?; + let base = ds.interaction.as_ref().filter(|_| boolean(p, "fromGesture") == Some(true)).map(|i| i.doc.clone()).unwrap_or_else(|| ds.doc.clone()); + let layout = + crate::selection_reorder::ReorderLayout::new(&base, &ids).ok_or_else(|| bad(cmd, "select a regular row, column or complete aligned grid"))?; + let positions = layout + .positions(source, target, boolean(p, "swap") == Some(true)) + .ok_or_else(|| bad(cmd, "source and target must belong to the selection"))?; + // Validate every delta before editing; absolute targets always come from the gesture's + // snapshot so crossing several slots and returning to the start does not accumulate edits. + let doc = s.doc()?; + let mut moves = Vec::new(); + for (id, at) in positions { + let now = doc.world_bounds(id).ok_or_else(|| bad(cmd, "layer is no longer available"))?; + let (dx, dy) = (at.x - now.x0, at.y - now.y0); + if !dx.is_finite() || !dy.is_finite() { + return Err(bad(cmd, "non-finite reorder result")); + } + if dx.abs() > 1e-9 || dy.abs() > 1e-9 { + let node = doc.get(id)?; + let parent = node.parent.map(|p| doc.world_transform(p)).unwrap_or(Affine::IDENTITY); + let transform = parent.inverse() * Affine::translate((dx, dy)) * parent * node.transform; + if !transform.as_coeffs().iter().all(|v| v.is_finite()) { + return Err(bad(cmd, "non-finite local transform")); + } + moves.push((id, dx, dy)); + } + } + if !moves.is_empty() { + let doc = s.doc_mut()?; + for (id, dx, dy) in moves { + move_world(doc, id, dx, dy)?; + } + } + ok() +} + /// Set the distances between smart-selection tracks without rebuilding/reparenting the layers. fn spacing(s: &mut Session, p: &Value) -> Result { let ids = req_targets("arrange.spacing", s, p)?; diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 312c2e878..c3c53c35b 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -49,6 +49,7 @@ pub mod proto_run; pub mod rename; pub mod rotation_origin; pub mod selection_colors; +pub mod selection_reorder; pub mod selection_spacing; pub mod shape_handles; pub mod shapebuilder; @@ -1838,5 +1839,7 @@ mod view_behaviour_tests; #[cfg(test)] mod widgets_tests; +#[cfg(test)] +mod selection_reorder_tests; #[cfg(test)] mod selection_spacing_tests; diff --git a/crates/engine/src/selection_reorder.rs b/crates/engine/src/selection_reorder.rs new file mode 100644 index 000000000..e538fc8bc --- /dev/null +++ b/crates/engine/src/selection_reorder.rs @@ -0,0 +1,107 @@ +//! Geometry for reordering a smart selection. Only regular, non-overlapping rows, columns +//! and complete top-left-aligned grids have unambiguous insertion slots. +//! Behavior reference: https://help.figma.com/hc/en-us/articles/360040450233 +//! (public documentation only; multi-item marking and irregular grids remain out of scope). +use figcraft_doc::{Document, NodeId}; +use figcraft_geom::{Point, Rect}; + +use crate::selection_spacing::selection_spacing; + +#[derive(Clone, Debug)] +pub struct ReorderLayout { + /// Visual order, independent of selection order and layer stacking. + pub slots: Vec<(NodeId, Rect)>, + columns: usize, + rows: usize, + gap_x: f64, + gap_y: f64, +} + +impl ReorderLayout { + pub fn new(doc: &Document, ids: &[NodeId]) -> Option { + let layout = selection_spacing(doc, ids); + let h = layout.horizontal.as_ref(); + let v = layout.vertical.as_ref(); + let gap = |axis: Option<&crate::selection_spacing::Axis>| match axis { + Some(a) => a.value.filter(|v| *v >= 0.0), + None => Some(0.0), + }; + let (gap_x, gap_y) = (gap(h)?, gap(v)?); + let columns = h.map_or(1, |a| a.tracks.len()); + let rows = v.map_or(1, |a| a.tracks.len()); + if ids.len() < 2 || columns.checked_mul(rows)? != ids.len() { + return None; + } + let mut cells = std::collections::BTreeMap::new(); + for id in ids { + let col = match h { + Some(a) => a.tracks.iter().position(|t| t.ids.contains(id))?, + None => 0, + }; + let row = match v { + Some(a) => a.tracks.iter().position(|t| t.ids.contains(id))?, + None => 0, + }; + let b = doc.world_bounds(*id)?; + if columns > 1 && rows > 1 { + let x = h?.tracks.get(col)?.bounds.x0; + let y = v?.tracks.get(row)?.bounds.y0; + if (b.x0 - x).abs() > 0.01 || (b.y0 - y).abs() > 0.01 { + return None; + } + } + if cells.insert((row, col), (*id, b)).is_some() { + return None; + } + } + Some(Self { slots: cells.into_values().collect(), columns, rows, gap_x, gap_y }) + } + + /// Insertion shifts intervening items; swapping exchanges just two entries. Sizes and + /// original gaps are retained, so unequal-sized layers reflow instead of overlapping. + pub fn positions(&self, source: NodeId, target: NodeId, swap: bool) -> Option> { + let from = self.slots.iter().position(|(id, _)| *id == source)?; + let to = self.slots.iter().position(|(id, _)| *id == target)?; + if from == to { + return Some(self.slots.iter().map(|(id, b)| (*id, Point::new(b.x0, b.y0))).collect()); + } + let mut order = self.slots.clone(); + if swap { + order.swap(from, to); + } else { + let item = order.remove(from); + order.insert(to, item); + } + let mut widths = vec![0.0_f64; self.columns]; + let mut heights = vec![0.0_f64; self.rows]; + for (i, (_, b)) in order.iter().enumerate() { + let w = widths.get_mut(i % self.columns)?; + *w = w.max(b.width()); + let h = heights.get_mut(i / self.columns)?; + *h = h.max(b.height()); + } + let x0 = self.slots.iter().map(|(_, b)| b.x0).fold(f64::INFINITY, f64::min); + let y0 = self.slots.iter().map(|(_, b)| b.y0).fold(f64::INFINITY, f64::min); + let starts = |sizes: &[f64], mut at: f64, gap: f64| { + sizes + .iter() + .map(|size| { + let start = at; + at += size + gap; + start + }) + .collect::>() + }; + let xs = starts(&widths, x0, self.gap_x); + let ys = starts(&heights, y0, self.gap_y); + order + .iter() + .enumerate() + .map(|(i, (id, b))| { + let x = if self.columns == 1 { b.x0 } else { *xs.get(i % self.columns)? }; + let y = if self.rows == 1 { b.y0 } else { *ys.get(i / self.columns)? }; + Some((*id, Point::new(x, y))) + }) + .collect() + } +} diff --git a/crates/engine/src/selection_reorder_tests.rs b/crates/engine/src/selection_reorder_tests.rs new file mode 100644 index 000000000..83ae5b310 --- /dev/null +++ b/crates/engine/src/selection_reorder_tests.rs @@ -0,0 +1,152 @@ +use crate::{Session, selection_reorder::ReorderLayout}; +use figcraft_doc::NodeId; +use serde_json::json; + +fn rect(s: &mut Session, x: f64, y: f64, w: f64, h: f64, parent: Option) -> NodeId { + NodeId(s.execute("shape.rectangle", &json!({"x":x,"y":y,"width":w,"height":h,"parent":parent})).unwrap()["id"].as_u64().unwrap()) +} +fn xy(s: &Session, id: NodeId) -> (f64, f64) { + let b = s.doc().unwrap().world_bounds(id).unwrap(); + (b.x0, b.y0) +} + +#[test] +fn insertion_reflows_unequal_sizes_with_original_gaps_and_hierarchy() { + for vertical in [false, true] { + let mut s = Session::new(); + let mut ids = vec![]; + for (at, size) in [(0., 40.), (50., 60.), (120., 20.)] { + ids.push(rect( + &mut s, + if vertical { 0. } else { at }, + if vertical { at } else { 0. }, + if vertical { 30. } else { size }, + if vertical { size } else { 30. }, + None, + )); + } + let before = s.doc().unwrap().clone(); + // Explicit selection order must not determine visual order. + s.execute("arrange.reorder", &json!({"ids":[ids[2],ids[0],ids[1]],"source":ids[0],"target":ids[2]})).unwrap(); + for (id, at) in [(ids[1], 0.), (ids[2], 70.), (ids[0], 100.)] { + assert_eq!(xy(&s, id), if vertical { (0., at) } else { (at, 0.) }); + let old = before.node(id).unwrap(); + let new = s.doc().unwrap().node(id).unwrap(); + assert_eq!((new.width, new.height, new.parent), (old.width, old.height, old.parent)); + } + assert_eq!(s.doc().unwrap().node(s.ds().unwrap().page).unwrap().children, before.node(s.ds().unwrap().page).unwrap().children); + s.undo().unwrap(); + assert_eq!(s.doc().unwrap(), &before); + s.redo().unwrap(); + assert_eq!(xy(&s, ids[0]), if vertical { (0., 100.) } else { (100., 0.) }); + } +} + +#[test] +fn grids_insert_across_rows_and_swap_only_the_two_entries() { + let mut s = Session::new(); + let mut ids = vec![]; + for row in 0..2 { + for col in 0..3 { + ids.push(rect(&mut s, col as f64 * 70., row as f64 * 60., 50., 40., None)); + } + } + let before = s.doc().unwrap().clone(); + s.execute("arrange.reorder", &json!({"ids":ids,"source":ids[0],"target":ids[4]})).unwrap(); + assert_eq!(xy(&s, ids[0]), (70., 60.)); + assert_eq!(xy(&s, ids[3]), (140., 0.)); + assert_eq!(xy(&s, ids[5]), (140., 60.)); + s.undo().unwrap(); + s.execute("arrange.reorder", &json!({"ids":ids,"source":ids[0],"target":ids[4],"swap":true})).unwrap(); + assert_eq!(xy(&s, ids[0]), (70., 60.)); + assert_eq!(xy(&s, ids[4]), (0., 0.)); + for id in [ids[1], ids[2], ids[3], ids[5]] { + assert_eq!(s.doc().unwrap().node(id), before.node(id)); + } +} + +#[test] +fn grid_reflow_keeps_gaps_with_different_sizes() { + let mut s = Session::new(); + let a = rect(&mut s, 0., 0., 40., 30., None); + let b = rect(&mut s, 50., 0., 60., 30., None); + let c = rect(&mut s, 0., 50., 40., 50., None); + let d = rect(&mut s, 50., 50., 60., 50., None); + s.execute("arrange.reorder", &json!({"ids":[a,b,c,d],"source":a,"target":d})).unwrap(); + assert_eq!(xy(&s, b), (0., 0.)); + assert_eq!(xy(&s, c), (70., 0.)); + assert_eq!(xy(&s, d), (0., 70.)); + assert_eq!(xy(&s, a), (70., 70.)); +} + +#[test] +fn previews_are_absolute_and_returning_to_start_is_a_noop() { + let mut s = Session::new(); + let ids: Vec<_> = (0..3).map(|i| rect(&mut s, i as f64 * 70., 0., 50., 40., None)).collect(); + s.execute("select.set", &json!({"ids":ids})).unwrap(); + let before = s.doc().unwrap().clone(); + let history = s.undo_depth().0; + s.begin_interaction("Reorder selection").unwrap(); + for target in [ids[2], ids[1], ids[0]] { + s.execute("arrange.reorder", &json!({"ids":ids,"source":ids[0],"target":target,"fromGesture":true})).unwrap(); + } + s.commit_interaction().unwrap(); + assert_eq!(s.doc().unwrap(), &before); + assert_eq!(s.undo_depth().0, history); + s.begin_interaction("Reorder selection").unwrap(); + for target in [ids[1], ids[2]] { + s.execute("arrange.reorder", &json!({"ids":ids,"source":ids[0],"target":target,"fromGesture":true})).unwrap(); + } + s.commit_interaction().unwrap(); + assert_eq!(s.undo_depth().0, history + 1); + assert_eq!(s.selection(), ids); + s.undo().unwrap(); + assert_eq!(s.doc().unwrap(), &before); +} + +#[test] +fn invalid_selections_and_targets_do_not_edit_the_document() { + let mut s = Session::new(); + let a = rect(&mut s, 0., 0., 50., 40., None); + let b = rect(&mut s, 70., 0., 50., 40., None); + let c = rect(&mut s, 160., 0., 50., 40., None); + for args in [ + json!({"ids":[a,b,c],"source":a,"target":b}), // Mixed gaps. + json!({"ids":[a,b],"source":c,"target":b}), + json!({"ids":[a,b],"source":a,"target":999999}), + json!({"ids":[a,a,b],"source":a,"target":b}), + json!({"ids":[a,b],"source":[],"target":b}), + ] { + let before = s.doc().unwrap().clone(); + assert!(s.execute("arrange.reorder", &args).is_err()); + assert_eq!(s.doc().unwrap(), &before); + } + for props in [json!({"locked":true}), json!({"visible":false})] { + s.execute("node.set", &json!({"id":b,"props":props})).unwrap(); + assert!(ReorderLayout::new(s.doc().unwrap(), &[a, b]).is_none()); + s.execute("node.set", &json!({"id":b,"props":{"locked":false,"visible":true}})).unwrap(); + } + let d = rect(&mut s, 0., 70., 50., 40., None); + assert!(ReorderLayout::new(s.doc().unwrap(), &[a, b, d]).is_none(), "an incomplete grid has no slots"); + let frame = + NodeId(s.execute("frame.create", &json!({"width":300,"height":100,"props":{"layout":"horizontal"}})).unwrap()["id"].as_u64().unwrap()); + let x = rect(&mut s, 0., 0., 50., 40., Some(frame)); + let y = rect(&mut s, 70., 0., 50., 40., Some(frame)); + assert!(ReorderLayout::new(s.doc().unwrap(), &[x, y]).is_none()); + assert!(ReorderLayout::new(s.doc().unwrap(), &[a, x]).is_none()); +} + +#[test] +fn reordering_children_of_a_rotated_parent_uses_page_coordinates() { + let mut s = Session::new(); + let frame = NodeId( + s.execute("frame.create", &json!({"x":200,"y":200,"width":300,"height":100,"props":{"rotation":90}})).unwrap()["id"].as_u64().unwrap(), + ); + let a = rect(&mut s, 0., 0., 50., 40., Some(frame)); + let b = rect(&mut s, 70., 0., 50., 40., Some(frame)); + let (pa, pb) = (xy(&s, a), xy(&s, b)); + s.execute("arrange.reorder", &json!({"ids":[a,b],"source":a,"target":b})).unwrap(); + let (qa, qb) = (xy(&s, a), xy(&s, b)); + assert!((qa.0 - pb.0).abs() < 1e-7 && (qa.1 - pb.1).abs() < 1e-7); + assert!((qb.0 - pa.0).abs() < 1e-7 && (qb.1 - pa.1).abs() < 1e-7); +} diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index d8ebfc9e6..145f4f074 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -418,6 +418,9 @@ fn every_command_survives_junk_params() { // Selection color slots: malformed indexes, ranges and paints. json!({"targets": [{"id": 2, "fills": true, "index": -1, "range": [0, 1e308]}], "paint": {"type": "solid", "color": "invalid"}}), json!({"targets": [{"id": 2, "fills": "yes", "index": 0, "range": [4, 1]}], "style": 5}), + // Smart-selection reorder targets and modes as junk. + json!({"ids": [2, 3], "source": -1, "target": {"id": 3}, "swap": [], "fromGesture": true}), + json!({"source": 1e308, "target": "NaN", "swap": "yes", "fromGesture": []}), // Rotation origins and placing with a tool as junk. json!({"tool": [1], "x": 1e308, "y": "NaN", "reset": "maybe", "on": {"x": 1}}), json!({"tool": "frame", "x": -1e308, "y": 1e308, "reset": true, "on": "yes"}), diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 17f6b4c5f..ffc75fe12 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -8,6 +8,7 @@ name = "English" [ui] +"Reorder selection" = "Reorder selection" "% of all commits" = "% of all commits" "(no longer published)" = "(no longer published)" "({n} warnings: some entries were skipped)" = { one = "({n} warning: some entries were skipped)", other = "({n} warnings: some entries were skipped)" } diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index d054e2223..96662b9d4 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -8,6 +8,7 @@ name = "Español" status = "draft — needs native review" [ui] +"Reorder selection" = "Reordenar selección" "Compatibility notes" = "Notas de compatibilidad" "Couldn't download the variables" = "No se pudieron descargar las variables" @@ -1741,6 +1742,7 @@ status = "draft — needs native review" "⌥ drag" = "⌥ arrastrar" [commands] +"arrange.reorder" = "Reordenar selección" "align.bottom" = "Alinear abajo" "align.hcenter" = "Alinear centros horizontales" "align.left" = "Alinear a la izquierda" diff --git a/crates/ui-egui/src/selection_spacing.rs b/crates/ui-egui/src/selection_spacing.rs index 5110be1c2..c24654042 100644 --- a/crates/ui-egui/src/selection_spacing.rs +++ b/crates/ui-egui/src/selection_spacing.rs @@ -3,6 +3,7 @@ use std::sync::Arc; use egui::{CursorIcon, Id, Pos2, Rect, Stroke, Ui, vec2}; use figcraft_doc::{Document, NodeId}; +use figcraft_engine::selection_reorder::ReorderLayout; use figcraft_engine::selection_spacing::{Axis, SelectionSpacing, selection_spacing}; use serde_json::json; @@ -20,6 +21,7 @@ struct LayoutCache { ids: Vec, frame: u64, layout: Arc, + reorder: Option>, } fn layout(app: &FigApp, ctx: &egui::Context, ids: &[NodeId]) -> Arc { @@ -41,25 +43,58 @@ fn layout(app: &FigApp, ctx: &egui::Context, ids: &[NodeId]) -> Arc Option> { + layout(app, ctx, ids); + ctx.data(|d| d.get_temp::(Id::new("selection_spacing_layout"))).and_then(|c| c.reorder) +} + fn drag_id() -> Id { Id::new("selection_spacing_drag") } +#[derive(Clone)] +enum Action { + Spacing { axis: Axis, value: f64, last_value: Option }, + Reorder { layout: Arc, source: NodeId, target: NodeId, swap: bool }, +} + #[derive(Clone)] struct Drag { ids: Vec, - axis: Axis, + action: Action, start: Pos2, - value: f64, uid: u64, page: NodeId, moved: bool, - last_value: Option, +} + +fn start_drag(app: &mut FigApp, ctx: &egui::Context, ids: Vec, p: Pos2, action: Action) { + let label = match action { + Action::Spacing { .. } => tr("Spacing"), + Action::Reorder { .. } => tr("Reorder selection"), + }; + if app.session.begin_interaction(label).is_ok() + && let Ok(ds) = app.session.ds() + { + let drag = Drag { ids, action, start: p, uid: ds.uid, page: ds.page, moved: false }; + app.ui.layers_focus = false; + app.ui.key_box = None; + ctx.memory_mut(|m| { + if let Some(f) = m.focused() { + m.surrender_focus(f); + } + }); + ctx.data_mut(|d| d.insert_temp(drag_id(), drag)); + } } pub fn panel(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId]) { @@ -146,7 +181,7 @@ pub fn cancel(app: &mut FigApp, ctx: &egui::Context) -> bool { /// Retire handles when another document, page, tool or editing context takes over. pub fn sync(app: &mut FigApp, ctx: &egui::Context) { if let Some(drag) = ctx.data(|d| d.get_temp::(drag_id())) { - let same = app.session.ds().is_ok_and(|d| d.uid == drag.uid && d.page == drag.page && d.selection == drag.ids); + let same = app.session.ds().is_ok_and(|d| d.uid == drag.uid && d.page == drag.page && d.selection == drag.ids && d.interaction.is_some()); if !same || !available(app) { cancel(app, ctx); } @@ -157,39 +192,77 @@ pub fn sync(app: &mut FigApp, ctx: &egui::Context) { pub fn input(app: &mut FigApp, ctx: &egui::Context, pos: Option, hovered: bool, space: bool) -> bool { let dragging = ctx.data(|d| d.get_temp::(drag_id())); if let Some(mut drag) = dragging { - let same = app.session.ds().is_ok_and(|d| d.uid == drag.uid && d.page == drag.page && d.selection == drag.ids); + let same = app.session.ds().is_ok_and(|d| d.uid == drag.uid && d.page == drag.page && d.selection == drag.ids && d.interaction.is_some()); if !same { cancel(app, ctx); return true; } let down = ctx.input(|i| i.pointer.primary_down()); if let Some(p) = pos { - let zoom = app.session.ds().map_or(1.0, |d| d.view.zoom).max(1e-6); - let distance = if drag.axis.vertical { p.y - drag.start.y } else { p.x - drag.start.x }; - drag.moved |= distance.abs() >= 3.0; - if drag.moved { - let value = ctx - .input(|i| { - let quantum = if i.modifiers.alt { - 0.1 - } else if i.modifiers.shift { - 10.0 - } else { - 1.0 - }; - ((drag.value + f64::from(distance) / zoom) / quantum).round() * quantum - }) - .clamp(-1e6, 1e6); - let key = if drag.axis.vertical { "vertical" } else { "horizontal" }; - if drag.last_value != Some(value) { - match app.session.execute("arrange.spacing", &json!({"ids":drag.ids,key:value,"fromGesture":true})) { - Ok(_) => drag.last_value = Some(value), - Err(e) => app.toast(e.to_string()), + match &mut drag.action { + Action::Spacing { axis, value: original, last_value } => { + let zoom = app.session.ds().map_or(1.0, |d| d.view.zoom).max(1e-6); + let distance = if axis.vertical { p.y - drag.start.y } else { p.x - drag.start.x }; + drag.moved |= distance.abs() >= 3.0; + if drag.moved { + let value = ctx + .input(|i| { + let quantum = if i.modifiers.alt { + 0.1 + } else if i.modifiers.shift { + 10.0 + } else { + 1.0 + }; + ((*original + f64::from(distance) / zoom) / quantum).round() * quantum + }) + .clamp(-1e6, 1e6); + let key = if axis.vertical { "vertical" } else { "horizontal" }; + if *last_value != Some(value) { + match app.session.execute("arrange.spacing", &json!({"ids":drag.ids,key:value,"fromGesture":true})) { + Ok(_) => *last_value = Some(value), + Err(e) => app.toast(e.to_string()), + } + } } } + Action::Reorder { layout, source, target, swap } if app.canvas.rect.contains(p) => { + drag.moved |= p.distance(drag.start) >= 3.0; + // Hit original slots, never the moving preview: otherwise a stationary + // pointer could alternate between two permutations on successive frames. + let nearest = layout + .slots + .iter() + .min_by(|a, b| { + let center = |b: figcraft_geom::Rect| app.to_screen((b.x0 + b.x1) * 0.5, (b.y0 + b.y1) * 0.5); + center(a.1).distance_sq(p).total_cmp(¢er(b.1).distance_sq(p)) + }) + .map(|(id, _)| *id) + .unwrap_or(*source); + let swapping = ctx.input(|i| i.modifiers.command); + if drag.moved && (nearest != *target || swapping != *swap) { + match app + .session + .execute("arrange.reorder", &json!({"ids":drag.ids,"source":source,"target":nearest,"swap":swapping,"fromGesture":true})) + { + Ok(_) => { + *target = nearest; + *swap = swapping; + } + Err(e) => app.toast(e.to_string()), + } + } + } + // A release over a panel or outside the window commits the last canvas + // preview; the release's sentinel coordinates must not select a new slot. + Action::Reorder { .. } => {} } } - ctx.set_cursor_icon(if drag.axis.vertical { CursorIcon::ResizeVertical } else { CursorIcon::ResizeHorizontal }); + ctx.set_cursor_icon(match &drag.action { + Action::Spacing { axis, .. } if axis.vertical => CursorIcon::ResizeVertical, + Action::Spacing { .. } => CursorIcon::ResizeHorizontal, + Action::Reorder { .. } => CursorIcon::Grabbing, + }); if !down { let _ = app.session.commit_interaction(); ctx.data_mut(|d| d.remove::(drag_id())); @@ -198,11 +271,27 @@ pub fn input(app: &mut FigApp, ctx: &egui::Context, pos: Option, hovered: } return true; } - if !hovered || space || !available(app) || ctx.input(|i| i.modifiers.command) { + if !hovered || space || !available(app) { return false; } let Some(p) = pos else { return false }; let ids = app.session.selection(); + if let Some(reorder) = reorder_layout(app, ctx, &ids) { + for (id, b) in &reorder.slots { + let center = app.to_screen((b.x0 + b.x1) * 0.5, (b.y0 + b.y1) * 0.5); + if center.distance(p) <= 8.0 { + ctx.set_cursor_icon(CursorIcon::Grab); + if ctx.input(|i| i.pointer.primary_pressed()) { + let source = *id; + start_drag(app, ctx, ids, p, Action::Reorder { layout: reorder, source, target: source, swap: false }); + } + return true; + } + } + } + if ctx.input(|i| i.modifiers.command) { + return false; + } let layout = layout(app, ctx, &ids); for axis in [layout.horizontal.as_ref(), layout.vertical.as_ref()].into_iter().flatten() { for h in handles(app, axis) { @@ -210,20 +299,8 @@ pub fn input(app: &mut FigApp, ctx: &egui::Context, pos: Option, hovered: continue; } ctx.set_cursor_icon(if axis.vertical { CursorIcon::ResizeVertical } else { CursorIcon::ResizeHorizontal }); - if ctx.input(|i| i.pointer.primary_pressed()) - && app.session.begin_interaction(tr("Spacing")).is_ok() - && let Ok(ds) = app.session.ds() - { - let drag = - Drag { ids, axis: axis.clone(), start: p, value: h.value, uid: ds.uid, page: ds.page, moved: false, last_value: axis.value }; - app.ui.layers_focus = false; - app.ui.key_box = None; - ctx.memory_mut(|m| { - if let Some(f) = m.focused() { - m.surrender_focus(f); - } - }); - ctx.data_mut(|d| d.insert_temp(drag_id(), drag)); + if ctx.input(|i| i.pointer.primary_pressed()) { + start_drag(app, ctx, ids, p, Action::Spacing { axis: axis.clone(), value: h.value, last_value: axis.value }); } return true; } @@ -244,8 +321,33 @@ pub fn draw(app: &FigApp, painter: &egui::Painter) { if drag.is_none() && !hover.is_some_and(|p| rect.contains(p)) { return; } - let axes = if let Some(d) = &drag { - vec![d.axis.clone()] + let reorder = match drag.as_ref().map(|d| &d.action) { + Some(Action::Reorder { layout, .. }) => Some(layout.clone()), + Some(Action::Spacing { .. }) => None, + None => reorder_layout(app, ctx, &ds.selection), + }; + if let Some(layout) = reorder { + for (id, _) in &layout.slots { + let Some(b) = ds.doc.world_bounds(*id) else { continue }; + let center = app.to_screen((b.x0 + b.x1) * 0.5, (b.y0 + b.y1) * 0.5); + let hot = hover.is_some_and(|p| center.distance(p) <= 8.0); + let active = matches!(drag.as_ref().map(|d| &d.action), Some(Action::Reorder { source, .. }) if source == id); + if active { + painter.circle_filled(center, 4.5, PINK); + } else { + painter.circle_stroke(center, 4.5, Stroke::new(if hot { 2.5 } else { 1.5 }, PINK)); + } + } + } + if let Some(Drag { action: Action::Reorder { layout, target, .. }, moved: true, .. }) = &drag { + if let Some((_, b)) = layout.slots.iter().find(|(id, _)| id == target) { + let rect = Rect::from_two_pos(app.to_screen(b.x0, b.y0), app.to_screen(b.x1, b.y1)).expand(3.0); + painter.rect_stroke(rect, 0, Stroke::new(2.0, crate::theme::ACCENT), egui::StrokeKind::Outside); + } + return; + } + let axes = if let Some(Drag { action: Action::Spacing { axis, .. }, .. }) = &drag { + vec![axis.clone()] } else { let layout = layout(app, ctx, &ds.selection); [layout.horizontal.clone(), layout.vertical.clone()].into_iter().flatten().collect() diff --git a/crates/ui-egui/src/selection_spacing_tests.rs b/crates/ui-egui/src/selection_spacing_tests.rs index 453bd60dc..685f7b4e9 100644 --- a/crates/ui-egui/src/selection_spacing_tests.rs +++ b/crates/ui-egui/src/selection_spacing_tests.rs @@ -205,3 +205,131 @@ fn stationary_gap_drag_does_not_change_the_document_again() { u.button(p + vec2(20.2 * z, 0.), false); assert_eq!(xy(&u, ids[1]), (200., 100.)); } + +#[test] +fn reorder_ring_drag_inserts_across_grid_rows_as_one_undo_step() { + let (mut u, ids) = scene(true); + let before = u.app.session.undo_depth().0; + let p = u.app.to_screen(125., 130.); + let target = u.app.to_screen(205., 230.); + let output = u.frame_output(vec![Event::PointerMoved(p)]); + assert_eq!(output.platform_output.cursor_icon, egui::CursorIcon::Grab); + drag(&mut u, p, target - p, true); + assert_eq!(xy(&u, ids[0]), (180., 200.)); + assert_eq!(xy(&u, ids[3]), (260., 100.)); + assert_eq!(u.app.session.selection(), ids); + assert_eq!(u.app.session.undo_depth().0, before + 1); + u.app.run("edit.undo", json!({})); + assert_eq!(xy(&u, ids[0]), (100., 100.)); + u.app.run("edit.redo", json!({})); + assert_eq!(xy(&u, ids[0]), (180., 200.)); +} + +#[test] +fn reorder_ring_escape_click_and_returning_home_make_no_undo_step() { + for action in [0, 1, 2] { + let (mut u, ids) = scene(false); + let history = u.app.session.undo_depth().0; + let before = u.app.session.doc().unwrap().clone(); + let p = u.app.to_screen(125., 130.); + let target = u.app.to_screen(285., 130.); + u.frame(vec![Event::PointerMoved(p)]); + if action == 0 { + u.button(p, true); + } else { + drag(&mut u, p, target - p, false); + assert_eq!(xy(&u, ids[0]), (260., 100.)); + if action == 1 { + key(&mut u, Key::Escape); + } else { + u.frame(vec![Event::PointerMoved(p)]); + } + } + u.button(p, false); + u.frame(vec![]); + assert_eq!(u.app.session.doc().unwrap(), &before); + assert_eq!(u.app.session.undo_depth().0, history); + assert_eq!(u.app.session.selection(), ids); + assert!(u.app.session.ds().unwrap().interaction.is_none()); + } +} + +#[test] +fn command_drag_swaps_and_a_stationary_pointer_keeps_the_preview() { + let (mut u, ids) = scene(true); + let p = u.app.to_screen(125., 130.); + let target = u.app.to_screen(205., 230.); + // The modifier can already be down when the handle is pressed. + let m = Modifiers::COMMAND; + u.frame_with(vec![Event::PointerMoved(p)], m); + u.frame_with(vec![Event::PointerButton { pos: p, button: egui::PointerButton::Primary, pressed: true, modifiers: m }], m); + u.frame_with(vec![Event::PointerMoved(target)], m); + assert_eq!(xy(&u, ids[0]), (180., 200.)); + assert_eq!(xy(&u, ids[4]), (100., 100.)); + assert_eq!(xy(&u, ids[1]), (180., 100.)); + let snapshot = u.app.session.ds().unwrap().doc.clone(); + for _ in 0..5 { + u.frame_with(vec![], m); + } + assert!(std::sync::Arc::ptr_eq(&snapshot, &u.app.session.ds().unwrap().doc)); + // Changing modifiers without moving the pointer switches to insertion. + u.frame(vec![]); + assert_eq!(xy(&u, ids[1]), (100., 100.)); + assert_eq!(xy(&u, ids[4]), (100., 200.)); + u.button(target, false); +} + +#[test] +fn switching_documents_during_reordering_rolls_back_its_owner() { + let (mut u, ids) = scene(false); + let before = u.app.session.doc().unwrap().clone(); + let p = u.app.to_screen(125., 130.); + let target = u.app.to_screen(285., 130.); + drag(&mut u, p, target - p, false); + u.app.run("file.new", json!({})); + u.app.session.begin_interaction("Unrelated").unwrap(); + u.frame(vec![]); + assert!(u.app.session.ds().unwrap().interaction.is_some()); + u.app.session.active = 0; + assert_eq!(u.app.session.doc().unwrap(), &before); + assert_eq!(u.app.session.selection(), ids); +} + +#[test] +fn reorder_release_outside_window_commits_and_undo_while_dragging_cancels() { + for undo in [false, true] { + let (mut u, ids) = scene(false); + let history = u.app.session.undo_depth().0; + let p = u.app.to_screen(125., 130.); + let target = u.app.to_screen(285., 130.); + drag(&mut u, p, target - p, false); + if undo { + let m = Modifiers::COMMAND; + u.frame_with(vec![Event::Key { key: Key::Z, physical_key: None, pressed: true, repeat: false, modifiers: m }], m); + } + u.frame(vec![Event::PointerGone]); + u.button(Pos2::new(-1., -1.), false); + u.frame(vec![]); + assert_eq!(u.app.session.undo_depth().0, history + usize::from(!undo)); + assert_eq!(xy(&u, ids[0]), if undo { (100., 100.) } else { (260., 100.) }); + assert!(u.app.session.ds().unwrap().interaction.is_none()); + } +} + +#[test] +fn an_externally_finished_reorder_cannot_resume_on_later_pointer_motion() { + let (mut u, ids) = scene(false); + let p = u.app.to_screen(125., 130.); + let target = u.app.to_screen(285., 130.); + drag(&mut u, p, target - p, false); + u.app.session.commit_interaction().unwrap(); + let history = u.app.session.undo_depth().0; + let committed = u.app.session.doc().unwrap().clone(); + let middle = u.app.to_screen(205., 130.); + u.frame(vec![Event::PointerMoved(middle)]); + u.button(middle, false); + u.frame(vec![]); + assert_eq!(u.app.session.doc().unwrap(), &committed); + assert_eq!(u.app.session.undo_depth().0, history); + assert_eq!(xy(&u, ids[0]), (260., 100.)); +} diff --git a/docs/gaps.md b/docs/gaps.md index 9b1a770c1..5f2255e63 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Where FigCraft falls short of Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (the 2026-10-17 landings: `.fig` import fidelity, budgets for large files, the import report, a `.fig` copy from Save as and paste from another design app (gap 1); menus, the Actions palette, editor fixes, Selection colors and smart-selection spacing (gap 4); catalog counts re-measured (gap 5); bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (smart-selection drag reordering; the 2026-10-17 landings: `.fig` import fidelity, budgets for large files, the import report, a `.fig` copy from Save as and paste from another design app (gap 1); menus, the Actions palette, editor fixes, Selection colors and smart-selection spacing (gap 4); catalog counts re-measured (gap 5); bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) Every known shortfall against Figma, one entry each, ranked by how much it stops a Figma user from doing real work in FigCraft. Agents: pick work from the top unless the owner says otherwise. The @@ -174,6 +174,9 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe Layers; Paste over and Paste properties from the keyboard; then (#753) Selection colors for mixed selections and smart-selection spacing fields and canvas handles (no reorder rings). Each was checked in the app (on Windows; the submenus by their author), none side by side with Figma, none on macOS. +- **Landed (2026-10-18):** smart-selection center rings for single-layer insertion and + Command/Ctrl swaps in regular rows, columns and complete top-left-aligned grids; live preview, + cancellation and one undo step. Multiple marked layers and irregular-grid insertion remain. - **Evidence:** ROADMAP item 7 ("Left: tool by tool, panel by panel against the incumbent"). - **Impact:** Figma users notice the feel within minutes; it decides whether they stay. - **Estimate:** 40–60 h. Detail in [`ui-parity.md`](ui-parity.md). @@ -444,6 +447,7 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe | Date | Change | Summary | |---|---|---| +| 2026-10-18 | minor | Smart-selection center rings insert a layer through a regular row, column or complete top-left-aligned grid; Command/Ctrl-drag swaps entries. Unequal sizes reflow with the original gaps, hierarchy and selection stay intact, and each drag is one undo step. Escape or Undo during the drag cancels; switching documents, pages or tools rolls back the owning gesture. Mixed gaps, incomplete grids and unsupported selections keep spacing controls without reorder rings. Multiple marked items and irregular-grid insertion remain unimplemented. Engine and raw-input UI regression tests; desktop Linux before/during/after screenshots and insertion, undo/redo and Escape checked on synthetic cards. No side-by-side comparison with the incumbent. Headline estimates unchanged. | | 2026-10-17 | minor | The 2026-10-17 landings. Gap 1: a new Landed entry (community batches #727 and #728, then #745: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments, images in the message, instance layers' size and resizing overrides, Hug where nothing is recorded; budgets from the file's size; the import report; a `.fig` copy from Save as; paste from another design app), its Missing list cut to what is still left, and the wrong "whether other apps open its files is unknown" replaced by what was checked; all on synthetic files, so the beta blocker and hours stand. Gap 2: server limits, log recovery and web join links in the evidence. Gap 4: menus, the Actions palette and the editor fixes (#733, #735, #736, #729), then Selection colors and smart-selection spacing (#753) landed, none compared side by side. Gap 5: catalog counts re-measured (2,272 entries; drafts at 95–99%; Indonesian, Czech, Turkish and Swedish listed). Gap 8: the Linux and BSD clipboard changes and Wayland window controls, not run there by the maintainers. Ranking and hours unchanged | | 2026-10-15 | minor | Gap 7: bounded canvas overscan for smoother panning. Estimates and ranking unchanged. | | 2026-10-14 | minor | Russian catalog (M9), reviewed and approved by VanTan: all 2,165 current entries, Русский in Preferences and regional ru tags. Russian integer plurals use one/few/many; contributor display name VanTan added. Existing estimates unchanged. | diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index 775a4fcb4..d53c9c52e 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -1,8 +1,8 @@ # Parity checklist -> **Generated:** 2026-10-17 by `cargo xtask parity`. Do not edit by hand. +> **Generated:** 2026-10-18 by `cargo xtask parity`. Do not edit by hand. -FigCraft commands registered for the incumbent's main menu and toolbar (561 commands in the engine). +FigCraft commands registered for the incumbent's main menu and toolbar (563 commands in the engine). **212 / 212 menu items (100.0%)** diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 16a5af69b..a9a1a507a 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # FigCraft parity with Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (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); 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) · **Target:** Figma Design (desktop app 126.10.7, macOS) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (smart-selection drag reordering; 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); 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) · **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 @@ -95,7 +95,7 @@ Breadth: does it exist. Ready: depth, correctness and fidelity for real projects | # | Area | Weight | Breadth | Ready | Remaining | Hours | |---|---|---|---|---|---|---| | 1 | Canvas & navigation | 6 | 98% | 74% | Outline mode's Include hidden layers and Include object bounds, Display P3 on screen, QA at extreme zooms (behaviour suite for navigation, rulers, guides, layout grids and outline mode landed: guide selection, Auto grid counts, outline-mode clicks) | 1–4 | -| 2 | Selection & transform | 8 | 97% | 72% | Handles, measuring and snapping checked tool by tool against Figma and real files (snap distance, handle reach, cursors); children turned off a right angle scale without skew, approximately (behaviour suite from the documentation, rotated groups and mixed selections, equal spacing snapping, Cmd/Ctrl to ignore constraints and marquees inside frames landed) | 3–5 | +| 2 | Selection & transform | 8 | 97% | 72% | Handles, measuring and snapping checked tool by tool against Figma and real files (snap distance, handle reach, cursors); children turned off a right angle scale without skew, approximately (behaviour suite from the documentation, rotated groups and mixed selections, equal spacing snapping, Cmd/Ctrl to ignore constraints and marquees inside frames landed; smart-selection rings reorder single layers in regular rows, columns and complete aligned grids, with Command/Ctrl swaps; multi-item marks and irregular-grid insertion remain) | 3–5 | | 3 | Layers panel | 5 | 99% | 85% | QA with long real files (behaviour suite from the documentation, Rename layers dialog, sweeping eyes and padlocks, page dragging and dividers, several layers dropped together, keyboard box selection, F2 rename, Shift+F10 context menu and 10k-layer timings landed) | 1–2 | | 4 | Shapes & vector | 8 | 99% | 73% | Corner smoothing on polygons, stars and vectors; the transform box around points of several layers; per-point caps and joins on dashed, variable-width and brush strokes; vector QA with real files (behaviour suites from the documentation, corner radius and star ratio handles, rounded vector points drawn, also beside curved segments, a cap and join per point, several handles dragged together, cut and paint bucket drags, delete and heal along the curve, a boolean group's look by operation and the miter angle landed) | 1–3 | | 5 | Paint | 7 | 90% | 71% | Video fills, wide-gamut canvas, HEIC images; plus darker in PDF (behaviour suite from the documentation, pass-through and isolating groups, clipping frames that don't isolate, plus darker, animated GIF fills, TIFF images and embedded image colour profiles landed) | 2–5 | @@ -638,6 +638,7 @@ Carried over from the ROADMAP's "Shipped so far" (2026-10-10). The test count th | Date | Change | Summary | |---|---|---| +| 2026-10-18 | minor | Smart-selection center rings insert a layer through a regular row, column or complete top-left-aligned grid; Command/Ctrl-drag swaps entries. Unequal sizes reflow with the original gaps, hierarchy and selection stay intact, and each drag is one undo step. Escape or Undo during the drag cancels; switching documents, pages or tools rolls back the owning gesture. Mixed gaps, incomplete grids and unsupported selections keep spacing controls without reorder rings. Multiple marked items and irregular-grid insertion remain unimplemented. Engine and raw-input UI regression tests; desktop Linux before/during/after screenshots and insertion, undo/redo and Escape checked on synthetic cards. No side-by-side comparison with the incumbent. Headline estimates unchanged. | | 2026-10-17 | minor | Menu breadth re-run with `cargo xtask parity`: 212 / 212 (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Rows for the 2026-10-17 landings: import/export (area 14) and the file formats dimension name the `.fig` import's new fidelity (instance identity, overrides by key, text style precedence, grid tracks, slots, connector labels, per-point joins, text on a path, image adjustments, list start numbers, vertical trim), budgets from the file's size, the import report, a `.fig` copy from Save as and paste from another design app; the localization evidence takes the re-measured catalog counts (2,272 entries, drafts at 95–99%, Indonesian and Czech drafts, Swedish and Turkish catalogs); the Automation line adds control requests answered while the window is minimised (#720); batch #753's Selection colors, smart-selection spacing, Present tab and auto layout on empty frames are in ui-parity, prototyping-parity and auto-layout-parity. Numbers unchanged: every `.fig` and paste change is checked on synthetic files or clipboard HTML made from our own export, and real files are what gap 1's blocker and the file-exchange discounts wait for; the UI changes (menus, the Actions palette, editor fixes) are not compared side by side, so UI/UX stays at 58%; the localization grade and hours stay (Indonesian's draft is offset by the drafts' new gaps) | | 2026-10-17 | minor | Automation roots (M8, #715, #481): `figcraft-cli mcp --automation-read-root DIR --automation-write-root DIR` (each repeatable, existing folders) and the desktop app with the same flags confine every file a command reads to the read and write roots and every file it writes to the write roots; paths are resolved (links followed, `..`, Windows `\\?\` and UNC paths, case) and compared by whole folder names, anything else is an ordinary error. The engine reaches the file system through one module (enforced by `crates/engine/clippy.toml`), and a sweep runs every command with paths outside the roots. `--attach` refuses the flags (the app confines itself); `ui.screenshot` and `ui.render` return PNG data without a `path`, so the attached MCP server writes no temporary files. Numbers unchanged. | | 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 766284f1d..eab5aafe4 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-10-18 · **Change:** minor (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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (smart-selection drag reordering; 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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **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: @@ -69,7 +69,7 @@ interaction feel not yet compared. | Numeric fields: arithmetic, scrubbing by dragging the label, mixed values | done | Numeric panels use `widgets::number_field`; Typography line height, letter spacing and paragraph spacing share its leading-icon scrub logic (#373), retaining their existing unit parsing, Auto/Mixed values, variable chips and selected-character targeting (`typography_scrub_tests`). Scrubbing the label: a step a point (1 px; 1% of opacity, 1° of rotation), ten with Shift, a tenth with Alt, each stretch at the rate held while it was dragged, one undo step when let go; past the edge of the screen it goes on where the platform reports the mouse's own motion (desktop), otherwise it stops there. Arrow keys: Up/Down step a pixel field by the small nudge and Shift by the big nudge (the preferences), other fields by their own step and ten of it; they work while typing (from what is typed) and with the keyboard on the field. Typing: `+ - * /`, brackets, units (`px`, `°`, `%`, `x`, `ms`), a decimal comma; `+10`, `*2`, `/4` are relative to the value, and `50%`, `+10%`, `-10%` too in a field that isn't a percentage. Enter, Tab or a click elsewhere commits (Tab and Shift+Tab move to the next and previous control), Escape restores; a field left as it was commits nothing (no undo step, and a rounded display isn't written back). Mixed values show "Mixed": a number sets them all, a relative edit or an arrow key goes to each layer from its own value in one undo step, for X, Y, W, H, rotation, opacity, corner radius and stroke weight (elsewhere `+10` on Mixed sets 10 and `*2` does nothing) (`field_tests`). Left: scrubbing a Mixed field (nothing happens), `x2`-style suffix edits, the pointer isn't wrapped to the other side of the screen; rates not compared with Figma's | | Transform box at small sizes | done | a press inside a layer smaller than its handles moves it, the nearest handle wins, handles answer just outside and are hidden under 16 px on screen; cursors follow each handle and the box's rotation | | Locked layers | done | selectable from the layers panel; no handles, not dragged with the rest of a selection | -| Smart selection spacing | partial | with layers in a row, a column or an aligned grid selected, the Layout section shows horizontal and vertical spacing ("Mixed" until set; typed, scrubbed, fractional and negative) and pink handles in the gaps on the canvas drag them, one undo step, Escape cancels (`arrange.spacing`; sizes, parents and offsets within each track kept; at most 2,000 layers; flow children, locked layers and layers inside instances left out). No reorder rings for swapping layers; checked by its author on macOS and in the app on Windows (#402) | +| Smart selection spacing | partial | with layers in a row, a column or an aligned grid selected, the Layout section shows horizontal and vertical spacing ("Mixed" until set; typed, scrubbed, fractional and negative) and pink handles in the gaps on the canvas drag them, one undo step, Escape cancels (`arrange.spacing`; sizes, parents and offsets within each track kept; at most 2,000 layers; flow children, locked layers and layers inside instances left out). Center rings drag a single layer through a regular row, column or complete top-left-aligned grid; Command/Ctrl swaps entries. Preview, target outline, Escape cancellation and one-step undo (`arrange.reorder`, `selection_reorder_tests`, `selection_spacing_tests`). Sizes, gaps and layer hierarchy kept. Mixed gaps and incomplete or differently aligned grids have no rings; multiple marked-item dragging remains. Spacing checked by its author on macOS and in the app on Windows (#402) | | Selection colors | partial | for a mixed selection the Design panel lists their solid and gradient paints (children and text ranges included; hidden paints, masks, images, patterns and boolean operands left out; styles and variables listed apart): editing a colour changes every matching fill and stroke in one undo step, a row selects the layers that use it or applies a colour style of the document (`selection.colors`, `selection.setPaint`, `selection.applyColorStyle`, `selection.selectColor`). No library styles or variable binding from there (#403) | | Keyboard box selection | done | Alt+Space on macOS, Ctrl+Space on Windows and Linux, or F8 (`select.area`): a box around the selection or in the middle of the view; arrows move it, Cmd/Ctrl+arrows or Shift+arrows size it (Shift with Cmd/Ctrl: farther), Enter selects like a marquee (Shift+Enter toggles, Cmd/Ctrl+Enter nested), Escape closes | @@ -172,6 +172,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| +| 2026-10-18 | minor | Smart-selection center rings insert a layer through a regular row, column or complete top-left-aligned grid; Command/Ctrl-drag swaps entries. Unequal sizes reflow with the original gaps, hierarchy and selection stay intact, and each drag is one undo step. Escape or Undo during the drag cancels; switching documents, pages or tools rolls back the owning gesture. Mixed gaps, incomplete grids and unsupported selections keep spacing controls without reorder rings. Multiple marked items and irregular-grid insertion remain unimplemented. Engine and raw-input UI regression tests; desktop Linux before/during/after screenshots and insertion, undo/redo and Escape checked on synthetic cards. No side-by-side comparison with the incumbent. Headline estimates unchanged. | | 2026-10-18 | minor | A rename (layers double-click, F2, File ▸ Rename, a page) selects the whole name in the frame its field first draws, so the first key replaces the name instead of being appended. Checked in the app on Windows over the control channel | | 2026-10-17 | minor | Escape or Enter while the pen draws ends the path and keeps its vector in edit mode with the pen, so the next path is drawn into the same layer (unconnected); another Escape leaves edit mode (#760). Entering edit mode on a layer that already is a vector no longer records an empty undo step. Numbers unchanged | | 2026-10-17 | minor | Text layers keep the platform IME on for every frame of an edit, not only frames with input (an idle frame turned it off and macOS dropped each composition, #747); the candidate window opens at the caret instead of the canvas corner; keys pressed while composing go to the IME | From caf0f44d90eb1afd57c06971f7c78d9ed887388c Mon Sep 17 00:00:00 2001 From: AJ Richardson Date: Mon, 19 Oct 2026 16:08:26 +1000 Subject: [PATCH 315/817] #855: The Search button for the pages doesn't work as expected --- crates/ui-egui/locales/en.toml | 1 + crates/ui-egui/locales/es.toml | 1 + crates/ui-egui/src/layers.rs | 57 ++++++++++++++++++-- crates/ui-egui/src/layers_behaviour_tests.rs | 44 +++++++++++++++ crates/ui-egui/src/lib.rs | 5 ++ 5 files changed, 103 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 17f6b4c5f..23879786d 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -1184,6 +1184,7 @@ name = "English" "Search results" = "Search results" "Search fonts" = "Search fonts" "Search layers" = "Search layers" +"Search pages" = "Search pages" "Search shortcuts" = "Search shortcuts" "Section" = "Section" "Section color" = "Section color" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index d054e2223..0d5097e16 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -1185,6 +1185,7 @@ status = "draft — needs native review" "Search results" = "Resultados de búsqueda" "Search fonts" = "Buscar fuentes" "Search layers" = "Buscar capas" +"Search pages" = "Buscar páginas" "Search shortcuts" = "Buscar atajos" "Section" = "Sección" "Section color" = "Color de sección" diff --git a/crates/ui-egui/src/layers.rs b/crates/ui-egui/src/layers.rs index 32f66f80e..8159d569b 100644 --- a/crates/ui-egui/src/layers.rs +++ b/crates/ui-egui/src/layers.rs @@ -184,13 +184,20 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { app.ui.pages_open = !app.ui.pages_open; } let sr = Rect::from_center_size(pos2(hr.max.x - 50.0, hr.center().y), vec2(24.0, 24.0)); - let sresp = ui.interact(sr, ui.id().with("lsearch"), Sense::click()).tip(crate::shortcuts::tip(tr("Find"), "edit.findReplace")); + let sresp = ui.interact(sr, ui.id().with("lsearch"), Sense::click()).tip(tr("Search pages")); if sresp.hovered() { ui.painter().rect_filled(sr, CornerRadius::same(5), t.hover); } icons::paint(ui.painter(), sr.shrink(5.0), Icon::Search, t.icon); + let search_id = Id::new("page_search_field"); + let mut focus_search = false; if sresp.clicked() { - app.ui.find = Some((String::new(), String::new())); + app.ui.page_search = !app.ui.page_search; + app.ui.page_filter.clear(); + if app.ui.page_search { + app.ui.pages_open = true; + focus_search = true; + } } let ar = Rect::from_center_size(pos2(hr.max.x - 22.0, hr.center().y), vec2(24.0, 24.0)); let aresp = ui.interact(ar, ui.id().with("addpage"), Sense::click()).tip(tr("Add new page")); @@ -204,9 +211,16 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { if !app.ui.pages_open { return; } + if app.ui.page_search { + page_search_field(app, ui, &t, w, search_id, focus_search); + } let Ok(ds) = app.session.ds() else { return }; let pages: Vec<(NodeId, String, bool)> = ds.doc.pages.iter().filter_map(|p| ds.doc.node(*p).map(|n| (*p, n.name.clone(), ds.doc.is_divider(*p)))).collect(); + let filter = app.ui.page_filter.trim().to_lowercase(); + let visible_pages: Vec<(NodeId, String, bool)> = + pages.iter().filter(|(_, name, divider)| filter.is_empty() || (!divider && name.to_lowercase().contains(&filter))).cloned().collect(); + let filtering = !filter.is_empty(); let cur = ds.page; let sel = ds.selection.clone(); let mut select = None; @@ -220,9 +234,12 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { // A long list scrolls in its own area, so the layers keep their room below it. let max_h = pages_list_height(app.ui.pages_height, ui.available_height()); let mut moved = egui::ScrollArea::vertical().id_salt("pages_list").max_height(max_h).show(ui, |ui| { - for (k, (id, name, divider)) in pages.iter().cloned().enumerate() { - let (r, resp) = ui.allocate_exact_size(vec2(w, 32.0), Sense::click_and_drag()); - reorder.row_by(&resp, k, r, || if divider { tr("Divider").to_string() } else { name.clone() }); + for (k, (id, name, divider)) in visible_pages.iter().cloned().enumerate() { + let sense = if filtering { Sense::click() } else { Sense::click_and_drag() }; + let (r, resp) = ui.allocate_exact_size(vec2(w, 32.0), sense); + if !filtering { + reorder.row_by(&resp, k, r, || if divider { tr("Divider").to_string() } else { name.clone() }); + } a11y::list_item(&resp, if divider { tr("Divider") } else { &name }, id == cur); let r = r.shrink2(vec2(8.0, 0.0)); a11y::ring_around(ui, r, &resp); @@ -311,6 +328,36 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { pages_edge(app, ui, moved.inner_rect.height().min(moved.content_size.y)); } +/// The Pages panel's inline filter (Escape clears and closes it). +fn page_search_field(app: &mut FigApp, ui: &mut Ui, t: &Tokens, w: f32, id: Id, focus: bool) { + let (fr, _) = ui.allocate_exact_size(vec2(w, 32.0), Sense::hover()); + let field = Rect::from_min_max(pos2(fr.min.x + 12.0, fr.min.y + 2.0), pos2(fr.max.x - 12.0, fr.max.y - 6.0)); + ui.painter().rect_filled(field, CornerRadius::same(5), t.field); + icons::paint(ui.painter(), Rect::from_center_size(pos2(field.min.x + 12.0, field.center().y), vec2(12.0, 12.0)), Icon::Search, t.icon_secondary); + let te_rect = Rect::from_min_max(pos2(field.min.x + 24.0, field.center().y - 7.0), pos2(field.max.x - 6.0, field.center().y + 7.0)); + let mut child = ui.new_child(egui::UiBuilder::new().max_rect(te_rect)); + let r = child.add( + egui::TextEdit::singleline(&mut app.ui.page_filter) + .id(id) + .frame(egui::Frame::NONE) + .font(regular(11.0)) + .hint_text(tr("Search pages")) + .vertical_align(egui::Align::Center) + .desired_width(te_rect.width()), + ); + if focus { + r.request_focus(); + } + crate::widgets::select_all_on_focus(ui, &r, &app.ui.page_filter); + if r.has_focus() { + ui.painter().rect_stroke(field, CornerRadius::same(5), Stroke::new(1.0, t.accent), egui::StrokeKind::Inside); + } + if (r.has_focus() || r.lost_focus()) && ui.input(|i| i.key_pressed(egui::Key::Escape)) { + app.ui.page_search = false; + app.ui.page_filter.clear(); + } +} + /// The pages list's height in a panel with `avail` below the Pages header: the height asked for /// (by default 40% of it), at least three rows, and leaving the layers their header and three rows. pub(crate) fn pages_list_height(asked: Option, avail: f32) -> f32 { diff --git a/crates/ui-egui/src/layers_behaviour_tests.rs b/crates/ui-egui/src/layers_behaviour_tests.rs index d4ef4f8ac..170154050 100644 --- a/crates/ui-egui/src/layers_behaviour_tests.rs +++ b/crates/ui-egui/src/layers_behaviour_tests.rs @@ -199,6 +199,50 @@ fn page_row(u: &mut Ui, page: NodeId, back: NodeId) -> Pos2 { panic!("no row for page {page:?}"); } +#[test] +fn pages_search_button_opens_the_filter_and_escape_clears_it() { + let s = Session::new(); + let _ = s.page().unwrap(); + let mut u = Ui::new(s); + + // The search icon in the Pages header opens the page-name field, not Find and Replace. + click(&mut u, Pos2::new(246.0, 124.0), Modifiers::NONE); + assert!(u.app.ui.page_search, "the Pages search is open"); + assert!(u.app.ui.find.is_none(), "page search does not open Find and Replace"); + u.frame(vec![Event::Text("COMPON".into())]); + assert_eq!(u.app.ui.page_filter, "COMPON", "typing can start immediately"); + u.frame(vec![Event::Key { key: egui::Key::Escape, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::NONE }]); + assert!(!u.app.ui.page_search, "Escape closes page search"); + assert!(u.app.ui.page_filter.is_empty(), "Escape clears the filter"); +} + +#[test] +fn pages_search_filters_page_names_case_insensitively() { + let mut s = Session::new(); + let _overview = s.page().unwrap(); + let components = id(s.execute("page.add", &json!({"name": "Components"})).unwrap()); + let library = id(s.execute("page.add", &json!({"name": "Library"})).unwrap()); + s.execute("page.select", &json!({"id": library})).unwrap(); + let mut u = Ui::new(s); + u.app.ui.page_search = true; + u.app.ui.page_filter = "COMPON".into(); + let shapes = u.frame_output(vec![]).shapes; + let text = crate::live_tests::texts(&crate::live_tests::flat(&shapes)); + assert!(text.iter().any(|(label, _, _)| label == "Components"), "the matching page remains visible"); + assert!(!text.iter().any(|(label, _, _)| label == "Library"), "nonmatching pages are filtered out"); + + // Search leaves only Components; the active page starts as Library. + for y in (150..400).step_by(4) { + let p = Pos2::new(150.0, y as f32); + u.button(p, true); + u.button(p, false); + if u.app.session.page().unwrap() == components { + break; + } + } + assert_eq!(u.app.session.page().unwrap(), components, "matching is case-insensitive and opens the named page"); +} + #[test] fn pages_drag_to_reorder_and_dividers_open_nothing() { let mut s = Session::new(); diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 450317b43..efb0776d9 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -431,6 +431,9 @@ pub struct UiState { pub last_right_tab: RightTab, pub left_tab: LeftTab, pub pages_open: bool, + /// Pages panel search: open, and the case-insensitive name filter. + pub page_search: bool, + pub page_filter: String, /// The height asked for the pages list (`None`: a share of the panel). pub pages_height: Option, pub expanded: BTreeSet, @@ -595,6 +598,8 @@ impl Default for UiState { last_right_tab: RightTab::Design, left_tab: LeftTab::File, pages_open: true, + page_search: false, + page_filter: String::new(), pages_height: None, expanded: BTreeSet::new(), rename: None, From 3b7b28c03c9feb94e729e3ff95f997ada79bf85a Mon Sep 17 00:00:00 2001 From: AJ Richardson Date: Mon, 19 Oct 2026 16:37:52 +1000 Subject: [PATCH 316/817] improve page search functionality to close with Escape key even when unfocused --- crates/ui-egui/src/layers.rs | 2 +- crates/ui-egui/src/layers_behaviour_tests.rs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/layers.rs b/crates/ui-egui/src/layers.rs index 8159d569b..b93b97a39 100644 --- a/crates/ui-egui/src/layers.rs +++ b/crates/ui-egui/src/layers.rs @@ -352,7 +352,7 @@ fn page_search_field(app: &mut FigApp, ui: &mut Ui, t: &Tokens, w: f32, id: Id, if r.has_focus() { ui.painter().rect_stroke(field, CornerRadius::same(5), Stroke::new(1.0, t.accent), egui::StrokeKind::Inside); } - if (r.has_focus() || r.lost_focus()) && ui.input(|i| i.key_pressed(egui::Key::Escape)) { + if app.ui.page_search && ui.input(|i| i.key_pressed(egui::Key::Escape)) { app.ui.page_search = false; app.ui.page_filter.clear(); } diff --git a/crates/ui-egui/src/layers_behaviour_tests.rs b/crates/ui-egui/src/layers_behaviour_tests.rs index 170154050..a1f3685a2 100644 --- a/crates/ui-egui/src/layers_behaviour_tests.rs +++ b/crates/ui-egui/src/layers_behaviour_tests.rs @@ -216,6 +216,19 @@ fn pages_search_button_opens_the_filter_and_escape_clears_it() { assert!(u.app.ui.page_filter.is_empty(), "Escape clears the filter"); } +#[test] +fn pages_search_escape_closes_even_when_the_field_is_unfocused() { + let mut u = Ui::new(Session::new()); + u.app.ui.page_search = true; + u.app.ui.page_filter = "COMPON".into(); + u.frame(vec![]); + + u.frame(vec![Event::Key { key: egui::Key::Escape, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::NONE }]); + + assert!(!u.app.ui.page_search, "Escape closes page search without field focus"); + assert!(u.app.ui.page_filter.is_empty(), "Escape clears the filter without field focus"); +} + #[test] fn pages_search_filters_page_names_case_insensitively() { let mut s = Session::new(); From be9e72f74d34fdcaaf256d078ee6dcad3691bf40 Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Mon, 19 Oct 2026 09:15:34 +0200 Subject: [PATCH 317/817] M3: instances follow the variable modes their main component sets An instance copied its main's variable modes when it was made and kept the copy as modes of its own. Switching it to another variant kept the old variant's modes, and a mode set on the main later never reached it. Instances now take the modes their main sets through the link (`Document::inherited_modes`), closer than any frame around them. Modes set on the instance itself still win and stay through variant switches. Bindings are re-applied for the instances of a main that chose another mode and for an instance that switched mains. Detaching keeps the modes the instance took from its main, and the Variable modes panel shows them as the instance's Auto value. Instances made before this change keep their copy as modes of their own; setting one back to Auto lets it follow its main. Co-Authored-By: Claude Opus 5.5 --- crates/doc/src/lib.rs | 38 +++++-- crates/engine/src/cmd/component.rs | 14 +++ crates/engine/src/components.rs | 2 + crates/engine/src/instance_modes_tests.rs | 128 ++++++++++++++++++++++ crates/engine/src/lib.rs | 24 +++- crates/ui-egui/src/right.rs | 4 +- 6 files changed, 194 insertions(+), 16 deletions(-) create mode 100644 crates/engine/src/instance_modes_tests.rs diff --git a/crates/doc/src/lib.rs b/crates/doc/src/lib.rs index 07700e8ce..d131b2f08 100644 --- a/crates/doc/src/lib.rs +++ b/crates/doc/src/lib.rs @@ -949,21 +949,39 @@ impl Document { self.styles.iter().find(|s| s.id == id || s.name == id) } - /// The effective variable modes for a node (walking up its ancestors). + /// The effective variable modes for a node: the ones it sets over [`Self::inherited_modes`]. pub fn modes_for(&self, id: NodeId) -> BTreeMap { - let mut out = BTreeMap::new(); - let mut chain = vec![id]; - chain.extend(self.ancestors(id)); - for c in chain.into_iter().rev() { - if let Some(n) = self.node(c) { - for (k, v) in &n.var_modes { - out.insert(k.clone(), v.clone()); - } - } + let mut out = self.inherited_modes(id); + if let Some(n) = self.node(id) { + out.extend(n.var_modes.iter().map(|(k, v)| (k.clone(), v.clone()))); } out } + /// The modes a node is on where it sets none (Auto): its ancestors', and for an instance the + /// ones its main component sets, which are closer than any container's. + pub fn inherited_modes(&self, id: NodeId) -> BTreeMap { + let mut out = BTreeMap::new(); + for c in self.ancestors(id).into_iter().rev() { + if let Some(n) = self.node(c) { + out.extend(self.main_modes(n).chain(&n.var_modes).map(|(k, v)| (k.clone(), v.clone()))); + } + } + if let Some(n) = self.node(id) { + out.extend(self.main_modes(n).map(|(k, v)| (k.clone(), v.clone()))); + } + out + } + + /// The modes an instance's main component sets (none for other layers). + fn main_modes<'a>(&'a self, n: &Node) -> impl Iterator { + let main = match n.kind { + NodeKind::Instance { component, .. } => self.node(component), + _ => None, + }; + main.into_iter().flat_map(|m| &m.var_modes) + } + /// Check structural invariants (used by tests and after loading untrusted files). pub fn validate(&self) -> Vec { let mut issues = Vec::new(); diff --git a/crates/engine/src/cmd/component.rs b/crates/engine/src/cmd/component.rs index ff7a56df4..6840bcf48 100644 --- a/crates/engine/src/cmd/component.rs +++ b/crates/engine/src/cmd/component.rs @@ -472,6 +472,7 @@ fn detach(s: &mut Session, p: &Value) -> Result { // Own layers lose their link (slot content stays as it is); nested instances stay // instances of their own mains. let nested = unlink_layers(doc, i, Some(i)); + keep_main_modes(doc, i)?; let n = doc.get_mut(i)?; n.kind = NodeKind::Frame; n.source = None; @@ -491,6 +492,19 @@ fn detach(s: &mut Session, p: &Value) -> Result { Ok(json!({"ids": out})) } +/// Make the variable modes instance `i` takes from its main its own (it's being detached). +fn keep_main_modes(doc: &mut Document, i: NodeId) -> Result<()> { + let modes = match doc.get(i)?.kind { + NodeKind::Instance { component, .. } => doc.node(component).map(|m| m.var_modes.clone()).unwrap_or_default(), + _ => return Ok(()), + }; + let own = &mut doc.get_mut(i)?.var_modes; + for (c, m) in modes { + own.entry(c).or_insert(m); + } + Ok(()) +} + fn reset_instance(s: &mut Session, p: &Value) -> Result { let cmd = "component.resetInstance"; let ids = req_targets(cmd, s, p)?; diff --git a/crates/engine/src/components.rs b/crates/engine/src/components.rs index 56efc5c9a..ea67bb07c 100644 --- a/crates/engine/src/components.rs +++ b/crates/engine/src/components.rs @@ -285,6 +285,8 @@ pub fn create_instance_at(doc: &mut Document, component: NodeId, parent: NodeId, root.dev_resources.clear(); // The main's interactions play on its instances in prototypes; the instance's own start empty. root.interactions.clear(); + // So do the variable modes the main sets (see `Document::inherited_modes`). + root.var_modes.clear(); doc.insert(root, parent, index)?; sync_instance(doc, id); Ok(id) diff --git a/crates/engine/src/instance_modes_tests.rs b/crates/engine/src/instance_modes_tests.rs new file mode 100644 index 000000000..79007622d --- /dev/null +++ b/crates/engine/src/instance_modes_tests.rs @@ -0,0 +1,128 @@ +//! Variable modes on instances: an instance is on the modes its main component sets, under the +//! ones set on the instance itself, so switching variants or changing the main's mode reaches it. + +use serde_json::{Value, json}; + +use crate::Session; +use crate::params::id_of; +use figcraft_doc::NodeId; + +fn run(s: &mut Session, cmd: &str, p: Value) -> Value { + s.execute(cmd, &p).unwrap_or_else(|e| panic!("{cmd} {p}: {e}")) +} + +fn id(v: Value) -> NodeId { + id_of(&v["id"]).unwrap() +} + +fn fill(s: &Session, n: NodeId) -> String { + s.doc().unwrap().node(n).unwrap().fills.first().and_then(|p| p.solid_color()).map(|c| c.to_hex()).unwrap_or_default() +} + +fn set_mode(s: &mut Session, n: NodeId, mode: Value) { + run(s, "variable.setMode", json!({"ids": [n], "collection": "Tone", "mode": mode})); +} + +/// A "Tone" collection whose variable `c` is red in mode A and blue in mode B. +fn tone(s: &mut Session) { + run(s, "variable.createCollection", json!({"name": "Tone", "modes": ["A", "B"]})); + run(s, "variable.create", json!({"collection": "Tone", "name": "c", "type": "color", "values": {"A": "#FF0000", "B": "#0000FF"}})); +} + +/// A component filled from `c`, on `mode` when one is given. +fn swatch(s: &mut Session, name: &str, mode: Option<&str>) -> NodeId { + let f = id(run(s, "frame.create", json!({"x": 0, "y": 0, "width": 40, "height": 40, "name": name}))); + run(s, "variable.bind", json!({"ids": [f], "field": "fill", "variable": "c"})); + if let Some(m) = mode { + set_mode(s, f, json!(m)); + } + id(run(s, "component.create", json!({"ids": [f]}))) +} + +/// A set "Kind" whose variants A and B each set their own Tone mode. +fn kinds(s: &mut Session) -> (NodeId, NodeId) { + tone(s); + let a = swatch(s, "Kind=A", Some("A")); + let b = swatch(s, "Kind=B", Some("B")); + let set = id(run(s, "component.combineVariants", json!({"ids": [a, b]}))); + (set, b) +} + +fn instance(s: &mut Session, component: NodeId) -> NodeId { + id(run(s, "instance.create", json!({"component": component, "x": 200, "y": 0}))) +} + +fn switch(s: &mut Session, i: NodeId, kind: &str) { + run(s, "instance.setProperties", json!({"ids": [i], "properties": {"Kind": kind}})); +} + +#[test] +fn switching_variants_takes_the_new_variants_mode() { + let mut s = Session::new(); + let (set, _) = kinds(&mut s); + let i = instance(&mut s, set); + assert_eq!(fill(&s, i), "FF0000"); + switch(&mut s, i, "B"); + assert_eq!(fill(&s, i), "0000FF", "variant B sets mode B"); + switch(&mut s, i, "A"); + assert_eq!(fill(&s, i), "FF0000"); + assert!(s.doc().unwrap().node(i).unwrap().var_modes.is_empty(), "the instance sets no mode of its own"); +} + +#[test] +fn instances_follow_a_mode_their_main_sets_later() { + let mut s = Session::new(); + tone(&mut s); + let main = swatch(&mut s, "Chip", None); + let i = instance(&mut s, main); + assert_eq!(fill(&s, i), "FF0000", "no mode set: the collection's default"); + set_mode(&mut s, main, json!("B")); + assert_eq!(fill(&s, i), "0000FF"); + set_mode(&mut s, main, Value::Null); + assert_eq!(fill(&s, i), "FF0000", "the main back on Auto"); +} + +#[test] +fn a_mode_set_on_the_instance_wins_and_stays_through_variant_switches() { + let mut s = Session::new(); + let (set, _) = kinds(&mut s); + let i = instance(&mut s, set); + set_mode(&mut s, i, json!("B")); + assert_eq!(fill(&s, i), "0000FF"); + for kind in ["B", "A"] { + switch(&mut s, i, kind); + assert_eq!(fill(&s, i), "0000FF", "own mode B on variant {kind}"); + } + set_mode(&mut s, i, Value::Null); + assert_eq!(fill(&s, i), "FF0000", "back on Auto: variant A's mode"); +} + +#[test] +fn a_main_mode_is_closer_than_the_frame_around_the_instance() { + let mut s = Session::new(); + let (_, b) = kinds(&mut s); + let frame = id(run(&mut s, "frame.create", json!({"x": 0, "y": 300, "width": 200, "height": 100}))); + set_mode(&mut s, frame, json!("A")); + let i = id(run(&mut s, "instance.create", json!({"component": b, "x": 10, "y": 10, "parent": frame}))); + assert_eq!(fill(&s, i), "0000FF", "the main's mode B, not the frame's A"); + // Nested: an outer component on mode A holding an instance of B. + let outer_frame = id(run(&mut s, "frame.create", json!({"x": 0, "y": 500, "width": 100, "height": 100, "name": "Outer"}))); + run(&mut s, "instance.create", json!({"component": b, "x": 0, "y": 0, "parent": outer_frame})); + set_mode(&mut s, outer_frame, json!("A")); + let outer = id(run(&mut s, "component.create", json!({"ids": [outer_frame]}))); + let copy = instance(&mut s, outer); + let nested = s.doc().unwrap().node(copy).unwrap().children[0]; + assert_eq!(fill(&s, nested), "0000FF"); +} + +#[test] +fn detaching_keeps_the_mode_it_took_from_its_main() { + let mut s = Session::new(); + let (set, b) = kinds(&mut s); + let i = instance(&mut s, set); + switch(&mut s, i, "B"); + run(&mut s, "component.detach", json!({"ids": [i]})); + set_mode(&mut s, b, json!("A")); + assert_eq!(fill(&s, i), "0000FF", "the detached frame keeps mode B"); + assert_eq!(s.doc().unwrap().node(i).unwrap().var_modes.len(), 1); +} diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 312c2e878..3145c8a94 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1460,21 +1460,35 @@ fn affects_layout(before: &Document, doc: &Document, id: NodeId) -> bool { } /// The layers whose variable bindings an edit may have changed: every bound layer when a variable -/// changed, else the touched layers and everything below those that moved, are new or chose -/// another variable mode (modes are inherited). +/// changed, else the touched layers and everything below those that moved, are new, chose +/// another variable mode or became an instance of another main (modes are inherited, an +/// instance's from its main too), and the instances of a main that chose another mode. fn binding_scope(doc: &Document, before: &Document, touched: &BTreeSet) -> Option> { if doc.variables != before.variables { return None; } + let main = |n: &Node| match n.kind { + figcraft_doc::NodeKind::Instance { component, .. } => Some(component), + _ => None, + }; let mut out = BTreeSet::new(); for &id in touched { let Some(n) = doc.node(id) else { continue }; - let inherited = before.node(id).is_none_or(|b| b.var_modes != n.var_modes || b.parent != n.parent); - if inherited { + let Some(b) = before.node(id) else { + out.extend(doc.subtree(id)); + continue; + }; + let modes = b.var_modes != n.var_modes; + if modes || b.parent != n.parent || main(b) != main(n) { out.extend(doc.subtree(id)); } else { out.insert(id); } + if modes && matches!(n.kind, figcraft_doc::NodeKind::Component { .. }) { + for i in components::instances_of(doc, id) { + out.extend(doc.subtree(i)); + } + } } Some(out) } @@ -1652,6 +1666,8 @@ mod import_journal_tests; #[cfg(test)] mod inspect_behaviour_tests; #[cfg(test)] +mod instance_modes_tests; +#[cfg(test)] mod instance_resizing_tests; #[cfg(test)] mod interaction_rollback_tests; diff --git a/crates/ui-egui/src/right.rs b/crates/ui-egui/src/right.rs index 53eaf9535..5fd7dfc44 100644 --- a/crates/ui-egui/src/right.rs +++ b/crates/ui-egui/src/right.rs @@ -961,8 +961,8 @@ fn variable_modes(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) // The collection's name, then a wider mode picker ("Auto (Light)") across both field columns. let col = widgets::col_width(ui.available_width()); let (name_w, pick_w) = ((col * 0.7).round(), (col * 1.3).round()); - // Auto resolves from the parent of the first selected layer. - let parent_modes = sel.first().and_then(|i| doc.node(*i)).and_then(|n| n.parent).map(|p| doc.modes_for(p)).unwrap_or_default(); + // Auto resolves as for the first selected layer: from its parent, or an instance's main. + let parent_modes = sel.first().map(|i| doc.inherited_modes(*i)).unwrap_or_default(); let mut group = None; for r in &rows { let c = r.coll; From be212f00e6af5398ca0a889783b7151c8c49b265 Mon Sep 17 00:00:00 2001 From: slyim <125447219+slyim@users.noreply.github.com> Date: Mon, 19 Oct 2026 11:25:34 +0300 Subject: [PATCH 318/817] #826: the stroke-width test covers the Frame and Text marks Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/toolbar.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index de5993b4a..2f8c19724 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -509,6 +509,9 @@ mod tests { assert_eq!(mark.len(), 1, "one width at {ppp}×: {mark:?}"); assert_eq!(widths(ppp, Icon::Chevron, CARET), mark, "caret at {ppp}×"); assert_eq!(widths(ppp, Icon::Code, GLYPH), mark, "mode mark at {ppp}×"); + for icon in [Icon::Frame, Icon::Text] { + assert_eq!(widths(ppp, icon, GLYPH), mark, "{icon:?} at {ppp}×"); + } } } } From 5d40b3f42f8b6d9ef8f324ea9a530cbff4bb58de Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Mon, 19 Oct 2026 10:53:34 +0200 Subject: [PATCH 319/817] fix(pages): Delete deletes the page picked in the Pages list (#859) Clicking a page row (or the add-page button) gives the Pages list the keyboard: Delete or Backspace with no layers selected now deletes the current page instead of failing with "nothing is selected". No confirmation; a "Page deleted" toast says so and Undo brings it back. The context menu's Delete page shows the same toast. Selecting layers, clicking a layer row or pressing on the canvas gives Delete back to the layers. --- crates/ui-egui/locales/cs.toml | 1 + crates/ui-egui/locales/de.toml | 1 + crates/ui-egui/locales/en.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/ja.toml | 1 + crates/ui-egui/locales/ko.toml | 1 + crates/ui-egui/locales/nl.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/tr.toml | 1 + crates/ui-egui/locales/zh-Hans.toml | 1 + crates/ui-egui/src/canvas.rs | 1 + crates/ui-egui/src/layers.rs | 13 +++- crates/ui-egui/src/layers_keys_tests.rs | 81 ++++++++++++++++++++++++- crates/ui-egui/src/lib.rs | 5 ++ crates/ui-egui/src/menus.rs | 6 ++ crates/ui-egui/src/selection_spacing.rs | 1 + 21 files changed, 119 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml index 980513149..a7e8be383 100644 --- a/crates/ui-egui/locales/cs.toml +++ b/crates/ui-egui/locales/cs.toml @@ -929,6 +929,7 @@ status = "draft — needs native review" "PDF print settings" = "Nastavení tisku PDF" "Padding" = "Vnitřní odsazení" "Page" = "Stránka" +"Page deleted" = "Stránka smazána" "Pages" = "Stránky" "Pages added to the document" = "Stránky přidány do dokumentu" "Placed on the current page" = "Umístěno na aktuální stránku" diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index 07669c1a7..e910863b9 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -898,6 +898,7 @@ status = "draft — needs native review" "PDF print settings" = "PDF-Druckeinstellungen" "Padding" = "Innenabstand" "Page" = "Seite" +"Page deleted" = "Seite gelöscht" "Pages" = "Seiten" "Pages added to the document" = "Seiten zum Dokument hinzugefügt" "Placed on the current page" = "Auf der aktuellen Seite platziert" diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 17f6b4c5f..7220519db 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -950,6 +950,7 @@ name = "English" "PDF print settings" = "PDF print settings" "Padding" = "Padding" "Page" = "Page" +"Page deleted" = "Page deleted" "Pages" = "Pages" "Pages added to the document" = "Pages added to the document" "Placed on the current page" = "Placed on the current page" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index d054e2223..63c731316 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -951,6 +951,7 @@ status = "draft — needs native review" "PDF print settings" = "Ajustes de impresión PDF" "Padding" = "Margen interno" "Page" = "Página" +"Page deleted" = "Página eliminada" "Pages" = "Páginas" "Pages added to the document" = "Páginas añadidas al documento" "Placed on the current page" = "Colocado en la página actual" diff --git a/crates/ui-egui/locales/fi.toml b/crates/ui-egui/locales/fi.toml index 602574d79..6f12dd555 100644 --- a/crates/ui-egui/locales/fi.toml +++ b/crates/ui-egui/locales/fi.toml @@ -952,6 +952,7 @@ status = "draft — needs native review" "PDF print settings" = "PDF-tulostusasetukset" "Padding" = "Sisämarginaali" "Page" = "Sivu" +"Page deleted" = "Sivu poistettu" "Pages" = "Sivut" "Pages added to the document" = "Sivut lisätty asiakirjaan" "Pages: {pages}" = "Sivut: {pages}" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 5edf1a624..4af37b1d7 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -947,6 +947,7 @@ status = "draft — needs native review" "PDF print settings" = "Réglages d’impression PDF" "Padding" = "Marge intérieure" "Page" = "Page" +"Page deleted" = "Page supprimée" "Pages" = "Pages" "Pages added to the document" = "Pages ajoutées au document" "Pick the Frame tool, then drag on the canvas or choose a device size" = "Choisissez l’outil Cadre, puis faites glisser sur le canevas ou choisissez une taille d’appareil" diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml index 65a9939cb..9c5aa4a6c 100644 --- a/crates/ui-egui/locales/id.toml +++ b/crates/ui-egui/locales/id.toml @@ -933,6 +933,7 @@ status = "draft — needs native review" "PDF print settings" = "Pengaturan cetak PDF" "Padding" = "Padding" "Page" = "Halaman" +"Page deleted" = "Halaman dihapus" "Pages" = "Halaman" "Pages added to the document" = "Halaman ditambahkan ke dokumen" "Placed on the current page" = "Ditempatkan di halaman saat ini" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index def8ebc47..b5dcaf272 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -938,6 +938,7 @@ status = "draft — needs native review" "PDF print settings" = "PDF 印刷設定" "Padding" = "パディング" "Page" = "ページ" +"Page deleted" = "ページは削除済み" "Pages" = "ページ" "Pages added to the document" = "ページをドキュメントに追加した" "Placed on the current page" = "現在のページに配置した" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index 3e1916233..70669778d 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -892,6 +892,7 @@ status = "draft — needs native review" "PDF print settings" = "PDF 인쇄 설정" "Padding" = "패딩" "Page" = "페이지" +"Page deleted" = "페이지가 삭제됨" "Pages" = "페이지" "Pages added to the document" = "문서에 페이지 추가됨" "Placed on the current page" = "현재 페이지에 배치됨" diff --git a/crates/ui-egui/locales/nl.toml b/crates/ui-egui/locales/nl.toml index 8d8cac680..d49e5f037 100644 --- a/crates/ui-egui/locales/nl.toml +++ b/crates/ui-egui/locales/nl.toml @@ -952,6 +952,7 @@ status = "draft — needs native review" "PDF print settings" = "PDF-afdrukinstellingen" "Padding" = "Padding" "Page" = "Pagina" +"Page deleted" = "Pagina verwijderd" "Pages" = "Pagina's" "Pages added to the document" = "Pagina's toegevoegd aan het document" "Pages: {pages}" = "Pagina's: {pages}" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index d970db144..00ec38a96 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -891,6 +891,7 @@ status = "draft — needs native review" "PDF print settings" = "Configurações de impressão em PDF" "Padding" = "Espaçamento interno" "Page" = "Página" +"Page deleted" = "Página excluída" "Pages" = "Páginas" "Pages added to the document" = "Páginas adicionadas ao documento" "Placed on the current page" = "Colocado na página atual" diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 8d371cbed..c72c3edbc 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -932,6 +932,7 @@ name = "Русский" "PDF print settings" = "Настройки печати PDF" "Padding" = "Внутренние отступы" "Page" = "Страница" +"Page deleted" = "Страница удалена" "Pages" = "Страницы" "Pages added to the document" = "Страницы добавлены в документ" "Placed on the current page" = "Размещено на текущей странице" diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index d57bb25a5..7c3174142 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -942,6 +942,7 @@ name = "Svenska" "PDF print settings" = "PDF-utskriftsinställningar" "Padding" = "Utfyllnad" "Page" = "Sida" +"Page deleted" = "Sidan har raderats" "Pages" = "Sidor" "Pages added to the document" = "Sidor tillagda i dokumentet" "Placed on the current page" = "Placerat på den aktuella sidan" diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml index a9da62ef1..c9339e1fe 100644 --- a/crates/ui-egui/locales/tr.toml +++ b/crates/ui-egui/locales/tr.toml @@ -933,6 +933,7 @@ name = "Türkçe" "PDF print settings" = "PDF baskı ayarları" "Padding" = "İç boşluk" "Page" = "Sayfa" +"Page deleted" = "Sayfa silindi" "Pages" = "Sayfalar" "Pages added to the document" = "Sayfalar belgeye eklendi" "Placed on the current page" = "Geçerli sayfaya yerleştirildi" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index a90c1c033..e726ca325 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -893,6 +893,7 @@ status = "draft — needs native review" "PDF print settings" = "PDF 打印设置" "Padding" = "内边距" "Page" = "页面" +"Page deleted" = "页面已删除" "Pages" = "页面" "Pages added to the document" = "页面已添加到文档" "Placed on the current page" = "已放置在当前页面" diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 9e0c1d797..94daf657f 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -544,6 +544,7 @@ fn input(app: &mut FigApp, ui: &mut Ui, resp: &egui::Response) -> bool { // A press on the canvas gives the keyboard back to it (arrows nudge again). if resp.hovered() && ctx.input(|i| i.pointer.any_pressed()) { app.ui.layers_focus = false; + app.ui.pages_focus = false; app.ui.key_box = None; } // Zoom (pinch, Cmd/Ctrl+scroll) about the pointer; plain scroll pans. diff --git a/crates/ui-egui/src/layers.rs b/crates/ui-egui/src/layers.rs index 32f66f80e..514b8f75b 100644 --- a/crates/ui-egui/src/layers.rs +++ b/crates/ui-egui/src/layers.rs @@ -199,6 +199,7 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { } icons::paint(ui.painter(), ar.shrink(5.0), Icon::Plus, t.icon); if aresp.clicked() { + app.ui.pages_focus = true; app.run("page.add", json!({})); } if !app.ui.pages_open { @@ -257,6 +258,8 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { } if resp.clicked() && !divider { select = Some(id); + app.ui.pages_focus = true; + app.ui.layers_focus = false; } if resp.double_clicked() { app.ui.rename_page = Some((id, name.clone())); @@ -274,7 +277,7 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { ui.close(); } if ui.button(tr("Delete page")).clicked() { - app.run("page.delete", json!({"id": id})); + delete_page(app, id); ui.close(); } }); @@ -311,6 +314,13 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { pages_edge(app, ui, moved.inner_rect.height().min(moved.content_size.y)); } +/// Delete `page` (no confirmation: Undo brings it back) and say so. +pub(crate) fn delete_page(app: &mut FigApp, page: NodeId) { + if app.run("page.delete", json!({"id": page})).is_some() { + app.toast(tr("Page deleted")); + } +} + /// The pages list's height in a panel with `avail` below the Pages header: the height asked for /// (by default 40% of it), at least three rows, and leaving the layers their header and three rows. pub(crate) fn pages_list_height(asked: Option, avail: f32) -> f32 { @@ -1064,6 +1074,7 @@ fn layers(app: &mut FigApp, ui: &mut Ui) { } if let Some((id, m)) = clicked { app.ui.layers_focus = true; + app.ui.pages_focus = false; let order: Vec = rows.iter().map(|r| r.id).collect(); let pos = |x: NodeId| order.iter().position(|o| *o == x); let anchor = app.ui.layer_anchor.filter(|a| sel.contains(a)).and_then(pos); diff --git a/crates/ui-egui/src/layers_keys_tests.rs b/crates/ui-egui/src/layers_keys_tests.rs index b78890a89..d0b5f7860 100644 --- a/crates/ui-egui/src/layers_keys_tests.rs +++ b/crates/ui-egui/src/layers_keys_tests.rs @@ -1,8 +1,8 @@ //! Arrow keys in the layers panel once a row has been clicked: up/down through the rows (Shift //! extends), left/right to collapse, expand, and go to the parent or first child; a press on the -//! canvas gives arrows back to nudging. +//! canvas gives arrows back to nudging. Delete after a click in the Pages list deletes the page. -use egui::{Event, Key, Modifiers, pos2}; +use egui::{Event, Key, Modifiers, Pos2, pos2, vec2}; use figcraft_doc::NodeId; use figcraft_engine::Session; use serde_json::json; @@ -107,3 +107,80 @@ fn a_canvas_press_gives_arrows_back_to_nudging() { let doc = u.app.session.doc().unwrap(); assert_eq!(doc.node(c).unwrap().transform.translation().x, 201.0); } + +/// The middle of `page`'s row in the Pages list, found by clicking down the list until it opens; +/// then back to `back`. +fn page_row(u: &mut Ui, page: NodeId, back: NodeId) -> Pos2 { + for y in (90..400).step_by(4) { + let p = pos2(150.0, y as f32); + u.button(p, true); + u.button(p, false); + if u.app.session.page().unwrap() == page { + u.app.session.execute("page.select", &json!({"id": back})).unwrap(); + u.frame(vec![]); + // Rows are 32 high: aim at the middle, past the hit tolerance at its edge. + return p + vec2(0.0, 12.0); + } + } + panic!("no row for page {page:?}"); +} + +fn pages(u: &Ui) -> usize { + u.app.session.doc().unwrap().pages.len() +} + +#[test] +fn delete_after_clicking_a_page_deletes_it_without_asking() { + // #859: Delete on a page picked in the Pages list said "nothing is selected". + let (mut u, ..) = setup(); + let first = u.app.session.page().unwrap(); + let second = id(u.app.session.execute("page.add", &json!({})).unwrap()); + u.app.session.execute("page.select", &json!({"id": first})).unwrap(); + u.frame(vec![]); + let row = page_row(&mut u, second, first); + u.button(row, true); + u.button(row, false); + assert_eq!(u.app.session.page().unwrap(), second); + key(&mut u, Key::Delete, false); + // Gone at once, no confirmation: a toast says so and Undo brings it back. + assert_eq!(pages(&u), 1); + assert!(!u.app.session.doc().unwrap().pages.contains(&second)); + assert_eq!(u.app.ui.toast.as_ref().map(|t| t.0.as_str()), Some("Page deleted")); + u.app.run("edit.undo", json!({})); + assert_eq!(pages(&u), 2); + // Backspace (the Mac's delete key) does the same. + let row = page_row(&mut u, second, first); + u.button(row, true); + u.button(row, false); + key(&mut u, Key::Backspace, false); + assert_eq!(pages(&u), 1); + // The last page stays. + key(&mut u, Key::Delete, false); + assert_eq!(pages(&u), 1); +} + +#[test] +fn selected_layers_or_a_canvas_press_take_delete_back_from_the_pages_list() { + let (mut u, a, ..) = setup(); + let first = u.app.session.page().unwrap(); + let second = id(u.app.session.execute("page.add", &json!({})).unwrap()); + u.frame(vec![]); + let row = page_row(&mut u, first, second); + u.button(row, true); + u.button(row, false); + assert_eq!(u.app.session.page().unwrap(), first); + assert!(u.app.ui.pages_focus); + // Layers selected after the click (Select all, say): Delete deletes them, not the page. + u.app.run("select.set", json!({"ids": [a]})); + key(&mut u, Key::Delete, false); + assert_eq!(pages(&u), 2); + assert!(u.app.session.doc().unwrap().node(a).is_none()); + // A press on the canvas gives Delete back to it. + let p = pos2(900.0, 700.0); + u.button(p, true); + u.button(p, false); + assert!(!u.app.ui.pages_focus); + u.app.run("select.none", json!({})); + key(&mut u, Key::Delete, false); + assert_eq!(pages(&u), 2, "Delete with nothing selected on the canvas deletes no page"); +} diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 450317b43..9a1cc3a83 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -500,6 +500,10 @@ pub struct UiState { /// The layers panel has the keyboard: arrow keys move through its rows instead of nudging /// (set by a click on a row, cleared by a press on the canvas). pub layers_focus: bool, + /// The pages list has the keyboard: Delete with no layers selected deletes the current page (set + /// by a click on a page row or the add-page button, cleared by a click on a layer row or a press + /// on the canvas). + pub pages_focus: bool, pub layers_seen_sel: Vec, pub dark: bool, pub follow_system: bool, @@ -634,6 +638,7 @@ impl Default for UiState { layer_filter: String::new(), layer_anchor: None, layers_focus: false, + pages_focus: false, layers_seen_sel: Vec::new(), dark: false, follow_system: false, diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index e32f50c88..dfdf290ae 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -117,6 +117,12 @@ pub fn invoke(app: &mut FigApp, id: &str) { // Edit ▸ Delete (and the Delete binding) with an interaction open in the Prototype tab // removes that interaction, not the layer (#767). "edit.delete" if app.ui_context.clone().is_some_and(|ctx| crate::proto_panel::delete_selected_interaction(app, &ctx)) => {} + // After a click in the Pages list, with no layers selected, it deletes the current page (#859). + "edit.delete" if app.ui.pages_focus && app.session.selection().is_empty() => { + if let Ok(page) = app.session.page() { + crate::layers::delete_page(app, page); + } + } "file.open" => app.open_dialog(), "plugin.import" => crate::plugins_ui::import_dialog(app), "file.import" => app.import_dialog(false), diff --git a/crates/ui-egui/src/selection_spacing.rs b/crates/ui-egui/src/selection_spacing.rs index 5110be1c2..c05b9ec3f 100644 --- a/crates/ui-egui/src/selection_spacing.rs +++ b/crates/ui-egui/src/selection_spacing.rs @@ -217,6 +217,7 @@ pub fn input(app: &mut FigApp, ctx: &egui::Context, pos: Option, hovered: let drag = Drag { ids, axis: axis.clone(), start: p, value: h.value, uid: ds.uid, page: ds.page, moved: false, last_value: axis.value }; app.ui.layers_focus = false; + app.ui.pages_focus = false; app.ui.key_box = None; ctx.memory_mut(|m| { if let Some(f) = m.focused() { From 139e0ba3084a964ca1e09e0c78c07b105dcb0709 Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Mon, 19 Oct 2026 10:53:34 +0200 Subject: [PATCH 320/817] chore(contributors): add AganzeFelicite to people.toml --- contributors/people.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contributors/people.toml b/contributors/people.toml index 8b14373eb..03b99aa1e 100644 --- a/contributors/people.toml +++ b/contributors/people.toml @@ -56,3 +56,6 @@ sync_github_name = true [people.pechnikov2026-star] sync_github_name = true + +[people.AganzeFelicite] +sync_github_name = true From d2dfe2ef20c4ba1f78ada75508ae03743cf857d7 Mon Sep 17 00:00:00 2001 From: YarilaFox <102650794+YarilaFox@users.noreply.github.com> Date: Mon, 19 Oct 2026 14:21:52 +0500 Subject: [PATCH 321/817] M7: preserve active tab and support tab reordering --- crates/engine/src/cmd/file.rs | 42 ++++++++++++++++++++++++++--- 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/ja.toml | 1 + crates/ui-egui/locales/ko.toml | 1 + crates/ui-egui/locales/nl.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/tr.toml | 1 + crates/ui-egui/locales/zh-Hans.toml | 1 + 15 files changed, 53 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index bc13bc701..8e59b3031 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -92,6 +92,20 @@ pub fn specs() -> Vec { ), spec!("file.placeImage", "Place image", "{path | data, x?, y?}", true, super::create::place_image), spec!("file.close", "Close tab", "{index?, force? (discard unsaved changes)}", false, close), + spec!("file.moveTab", "Move tab", "{from, to} (indices among open documents)", false, |s, p| { + let from = req_index("file.moveTab", p, "from")?; + let to = req_index("file.moveTab", p, "to")?; + if from >= s.docs.len() || to >= s.docs.len() { + return Err(bad("file.moveTab", "no such document")); + } + if from != to { + let active_uid = s.docs.get(s.active).map(|d| d.uid); + let doc = s.docs.remove(from); + s.docs.insert(to, doc); + s.active = active_uid.and_then(|uid| s.docs.iter().position(|d| d.uid == uid)).unwrap_or(0); + } + Ok(json!({"index": to})) + }), spec!( "file.recover", "Recover file", @@ -1374,14 +1388,36 @@ fn close(s: &mut Session, p: &Value) -> Result { return Err(EngineError::Disabled("file.close".into(), "the document has unsaved changes (pass force: true to discard)".into())); } let uid = ds.uid; + let active_uid = s.docs.get(s.active).map(|d| d.uid); s.docs.remove(i); - if s.active >= s.docs.len() { - s.active = s.docs.len().saturating_sub(1); - } + // Removing a tab before the active one shifts its index; keep the same document selected. + s.active = active_uid.and_then(|a| s.docs.iter().position(|d| d.uid == a)).unwrap_or(i.min(s.docs.len().saturating_sub(1))); crate::branches::close_tabs(s, uid, None); ok() } +#[cfg(test)] +mod tab_order_tests { + use super::*; + + #[test] + fn moving_and_closing_inactive_tabs_preserves_the_active_document() { + let mut session = Session::new(); + for name in ["Two", "Three", "Four"] { + session.execute("file.new", &json!({"name": name})).unwrap(); + } + session.execute("doc.switch", &json!({"index": 2})).unwrap(); + let active_uid = session.docs[session.active].uid; + let moved_uid = session.docs[0].uid; + session.execute("file.moveTab", &json!({"from": 0, "to": 2})).unwrap(); + assert_eq!(session.docs[2].uid, moved_uid); + assert_eq!(session.docs[session.active].uid, active_uid); + session.execute("file.close", &json!({"index": 0})).unwrap(); + assert_eq!(session.docs[session.active].uid, active_uid); + assert!(session.execute("file.moveTab", &json!({"from": 0, "to": 99})).is_err()); + } +} + /// Ctrl+Tab / Ctrl+Shift+Tab: the next or previous open document, wrapping around. fn cycle_doc(s: &mut Session, dir: i64) -> Result { let n = s.docs.len() as i64; diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml index 980513149..b092c6051 100644 --- a/crates/ui-egui/locales/cs.toml +++ b/crates/ui-egui/locales/cs.toml @@ -1849,6 +1849,7 @@ status = "draft — needs native review" "file.exportLayers" = "Exportovat vrstvy" "file.exportSvg" = "Exportovat výběr jako SVG" "file.import" = "Importovat" +"file.moveTab" = "Přesunout kartu" "file.new" = "Nový soubor návrhu" "file.newFromTemplate" = "Nový ze šablony" "file.open" = "Otevřít" diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index 07669c1a7..e0f72435f 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -1795,6 +1795,7 @@ status = "draft — needs native review" "file.exportLayers" = "Ebenen exportieren" "file.exportSvg" = "Auswahl als SVG exportieren" "file.import" = "Importieren" +"file.moveTab" = "Tab verschieben" "file.new" = "Neue Designdatei" "file.open" = "Öffnen" "file.openRecent" = "Zuletzt verwendete öffnen" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index d054e2223..970118ef2 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -1890,6 +1890,7 @@ status = "draft — needs native review" "file.exportLayers" = "Exportar capas" "file.exportSvg" = "Exportar selección como SVG" "file.import" = "Importar" +"file.moveTab" = "Mover pestaña" "file.new" = "Nuevo archivo de diseño" "file.newFromTemplate" = "Nuevo desde plantilla" "file.open" = "Abrir" diff --git a/crates/ui-egui/locales/fi.toml b/crates/ui-egui/locales/fi.toml index 602574d79..2e944086c 100644 --- a/crates/ui-egui/locales/fi.toml +++ b/crates/ui-egui/locales/fi.toml @@ -1891,6 +1891,7 @@ status = "draft — needs native review" "file.exportLayers" = "Vie tasot" "file.exportSvg" = "Vie valinta SVG-muodossa" "file.import" = "Tuo" +"file.moveTab" = "Siirrä välilehti" "file.new" = "Uusi suunnittelutiedosto" "file.newFromTemplate" = "Uusi mallista" "file.open" = "Avaa" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 5edf1a624..a052fdaf9 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -1879,6 +1879,7 @@ status = "draft — needs native review" "file.exportLayers" = "Exporter les calques" "file.exportSvg" = "Exporter la sélection en SVG" "file.import" = "Importer" +"file.moveTab" = "Déplacer l’onglet" "file.new" = "Nouveau fichier de design" "file.newFromTemplate" = "Nouveau à partir d’un modèle" "file.open" = "Ouvrir" diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml index 65a9939cb..ca8a9561d 100644 --- a/crates/ui-egui/locales/id.toml +++ b/crates/ui-egui/locales/id.toml @@ -1853,6 +1853,7 @@ status = "draft — needs native review" "file.exportLayers" = "Ekspor layer" "file.exportSvg" = "Ekspor pilihan sebagai SVG" "file.import" = "Impor" +"file.moveTab" = "Pindahkan tab" "file.new" = "File desain baru" "file.newFromTemplate" = "Baru dari templat" "file.open" = "Buka" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index def8ebc47..218fbca6c 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -1864,6 +1864,7 @@ status = "draft — needs native review" "file.exportLayers" = "レイヤーを書き出し" "file.exportSvg" = "選択範囲を SVG で書き出し" "file.import" = "インポート" +"file.moveTab" = "タブを移動" "file.new" = "新規デザインファイル" "file.newFromTemplate" = "テンプレートから新規作成" "file.open" = "開く" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index 3e1916233..b9931717a 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -1786,6 +1786,7 @@ status = "draft — needs native review" "file.exportLayers" = "레이어 내보내기" "file.exportSvg" = "선택 항목을 SVG로 내보내기" "file.import" = "가져오기" +"file.moveTab" = "탭 이동" "file.new" = "새 디자인 파일" "file.open" = "열기" "file.openRecent" = "최근 파일 열기" diff --git a/crates/ui-egui/locales/nl.toml b/crates/ui-egui/locales/nl.toml index 8d8cac680..d007002ca 100644 --- a/crates/ui-egui/locales/nl.toml +++ b/crates/ui-egui/locales/nl.toml @@ -1890,6 +1890,7 @@ status = "draft — needs native review" "file.exportLayers" = "Lagen exporteren" "file.exportSvg" = "Selectie exporteren als SVG" "file.import" = "Importeren" +"file.moveTab" = "Tabblad verplaatsen" "file.new" = "Nieuw ontwerpbestand" "file.newFromTemplate" = "Nieuw vanuit sjabloon" "file.open" = "Openen" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index d970db144..80529d015 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -1785,6 +1785,7 @@ status = "draft — needs native review" "file.exportLayers" = "Exportar camadas" "file.exportSvg" = "Exportar seleção como SVG" "file.import" = "Importar" +"file.moveTab" = "Mover aba" "file.new" = "Novo arquivo de design" "file.open" = "Abrir" "file.openRecent" = "Abrir recente" diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 8d371cbed..b6c08e952 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -1855,6 +1855,7 @@ name = "Русский" "file.exportLayers" = "Экспортировать слои" "file.exportSvg" = "Экспортировать выделение в SVG" "file.import" = "Импорт" +"file.moveTab" = "Переместить вкладку" "file.new" = "Новый файл дизайна" "file.newFromTemplate" = "Создать из шаблона" "file.open" = "Открыть" diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index d57bb25a5..babc35b1e 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -1872,6 +1872,7 @@ name = "Svenska" "file.exportLayers" = "Exportera lager" "file.exportSvg" = "Exportera som SVG" "file.import" = "Importera" +"file.moveTab" = "Flytta flik" "file.new" = "Nytt" "file.newFromTemplate" = "Nytt från mall" "file.open" = "Öppna" diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml index a9da62ef1..7a604aa0f 100644 --- a/crates/ui-egui/locales/tr.toml +++ b/crates/ui-egui/locales/tr.toml @@ -1853,6 +1853,7 @@ name = "Türkçe" "file.exportLayers" = "Katmanları dışa aktar" "file.exportSvg" = "Seçimi SVG olarak dışa aktar" "file.import" = "İçe aktar" +"file.moveTab" = "Sekmeyi taşı" "file.new" = "Yeni tasarım dosyası" "file.newFromTemplate" = "Şablondan yeni" "file.open" = "Aç" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index a90c1c033..8752fbbfa 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -1787,6 +1787,7 @@ status = "draft — needs native review" "file.exportLayers" = "导出图层" "file.exportSvg" = "将所选项导出为 SVG" "file.import" = "导入" +"file.moveTab" = "移动标签页" "file.new" = "新建设计文件" "file.open" = "打开" "file.openRecent" = "打开最近的文件" From 2af54a26fb20e5064b25513a0ec565991c58ea96 Mon Sep 17 00:00:00 2001 From: YarilaFox <102650794+YarilaFox@users.noreply.github.com> Date: Mon, 19 Oct 2026 14:23:04 +0500 Subject: [PATCH 322/817] M7: keep tab strip usable with many files --- crates/ui-egui/src/tabs.rs | 386 +++++++++++++++++++++++---- crates/ui-egui/src/titlebar_tests.rs | 75 ++++++ 2 files changed, 408 insertions(+), 53 deletions(-) diff --git a/crates/ui-egui/src/tabs.rs b/crates/ui-egui/src/tabs.rs index 381b09dd1..047d5faa6 100644 --- a/crates/ui-egui/src/tabs.rs +++ b/crates/ui-egui/src/tabs.rs @@ -2,6 +2,8 @@ //! the title bar: its empty space drags the window (double-click maximises), and it carries the //! window buttons; the window's edges resize it. +use std::collections::{HashMap, HashSet}; + use egui::{Align2, Color32, CornerRadius, Rect, Sense, Stroke, Ui, pos2, vec2}; use serde_json::json; @@ -12,22 +14,151 @@ use crate::theme::{Tokens, regular}; use crate::{FigApp, TitleBar}; pub const HEIGHT: f32 = 40.0; +const MIN_TAB_WIDTH: f32 = 96.0; +const OVERFLOW_WIDTH: f32 = 32.0; +const OPEN_TIME: f64 = 0.18; +const CLOSE_TIME: f64 = 0.24; + +#[derive(Clone)] +struct TabSnapshot { + name: String, + rect: Rect, + active: bool, +} + +#[derive(Clone)] +struct ClosingTab { + snapshot: TabSnapshot, + started: f64, +} + +#[derive(Clone, Default)] +struct TabMotion { + initialized: bool, + known: HashSet, + opening: HashMap, + last_visible: HashMap, + closing: Vec, +} + +impl TabMotion { + /// Track tabs added or removed since the previous frame and expire their animations. + fn begin_frame(&mut self, current: HashSet, now: f64, reduce_motion: bool) { + if self.initialized && !reduce_motion { + for uid in current.difference(&self.known) { + self.opening.insert(*uid, now); + } + for uid in self.known.difference(¤t) { + if let Some(snapshot) = self.last_visible.get(uid) { + self.closing.push(ClosingTab { snapshot: snapshot.clone(), started: now }); + } + } + } + self.initialized = true; + self.known = current; + self.last_visible.clear(); + if reduce_motion { + self.opening.clear(); + self.closing.clear(); + } else { + self.opening.retain(|uid, started| self.known.contains(uid) && now - *started < OPEN_TIME); + self.closing.retain(|tab| now - tab.started < CLOSE_TIME); + } + } + + /// Return the entering tab's progress, or full width when it is not animating. + fn open_progress(&self, uid: u64, now: f64) -> f32 { + self.opening.get(&uid).map_or(1.0, |started| ((now - started) / OPEN_TIME).clamp(0.0, 1.0) as f32) + } + + /// Keep requesting frames while an opening or closing tab remains visible. + fn is_animating(&self) -> bool { + !self.opening.is_empty() || !self.closing.is_empty() + } +} + +/// Paint removed tabs as fading snapshots below the strip until their exit motion ends. +fn paint_closing_tabs(ui: &Ui, t: &Tokens, motion: &TabMotion, now: f64) { + if motion.closing.is_empty() { + return; + } + let painter = ui.ctx().layer_painter(egui::LayerId::new(egui::Order::Foreground, ui.id().with("closing_tabs"))); + for tab in &motion.closing { + let progress = ((now - tab.started) / CLOSE_TIME).clamp(0.0, 1.0) as f32; + let opacity = (1.0 - progress).powi(2); + let r = tab.snapshot.rect.translate(vec2(0.0, 40.0 * progress * progress)); + painter.rect_filled(r, CornerRadius::same(4), if tab.snapshot.active { t.tab_active } else { t.hover }.linear_multiply(opacity)); + icons::paint( + &painter, + Rect::from_center_size(pos2(r.min.x + 18.0, r.center().y), vec2(14.0, 14.0)), + Icon::Logo, + crate::theme::ACCENT.linear_multiply(opacity), + ); + crate::bidi::paint_name( + &painter, + pos2(r.min.x + 32.0, r.center().y), + &tab.snapshot.name, + regular(12.0), + t.text.linear_multiply(opacity), + (r.width() - 64.0).max(0.0), + ); + icons::paint( + &painter, + Rect::from_center_size(pos2(r.max.x - 16.0, r.center().y), vec2(10.0, 10.0)), + Icon::Close, + t.icon_secondary.linear_multiply(opacity), + ); + } +} + +struct TabLayout { + first: usize, + widths: Vec, + overflow: bool, +} + +/// Shrink open tabs before moving the excess into the overflow menu. +fn tab_layout(preferred: &[f32], available: f32, active: Option) -> TabLayout { + let count = preferred.len(); + let overflow = count as f32 * MIN_TAB_WIDTH > available; + let visible = if overflow { ((available - OVERFLOW_WIDTH).max(0.0) / MIN_TAB_WIDTH).floor() as usize } else { count }.min(count); + let first = active.unwrap_or(0).saturating_sub(visible / 2).min(count - visible); + let mut widths = preferred[first..first + visible].to_vec(); + let budget = (available - if overflow { OVERFLOW_WIDTH } else { 0.0 }).max(0.0); + let mut excess = (widths.iter().sum::() - budget).max(0.0); + while excess > 0.01 { + let flexible = widths.iter().filter(|w| **w > MIN_TAB_WIDTH + 0.01).count(); + if flexible == 0 { + break; + } + let share = excess / flexible as f32; + let mut removed = 0.0; + for width in &mut widths { + let shrink = (*width - MIN_TAB_WIDTH).max(0.0).min(share); + *width -= shrink; + removed += shrink; + } + excess -= removed; + } + TabLayout { first, widths, overflow } +} + +/// Final document index and insertion marker for a tab dropped among the visible tabs. +fn tab_drop_position(visible: &[(usize, Rect)], from: usize, pointer_x: f32) -> Option<(usize, f32)> { + let others: Vec<_> = visible.iter().copied().filter(|(index, _)| *index != from).collect(); + let slot = others.partition_point(|(_, rect)| rect.center().x < pointer_x); + if let Some(&(index, rect)) = others.get(slot) { + Some((index - usize::from(from < index), rect.min.x)) + } else { + let &(index, rect) = others.last()?; + Some((index + usize::from(from > index), rect.max.x)) + } +} pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { let t = Tokens::get(ui.ctx()); egui::Panel::top("tab_bar").exact_size(HEIGHT).frame(egui::Frame::NONE.fill(t.tab_bar)).show(ui, |ui| { let rect = ui.max_rect(); - // Empty space moves the window (first, so the tabs and buttons on top take their clicks). - if app.ui.title_bar != TitleBar::Native { - let drag = ui.interact(rect, ui.id().with("titlebar_drag"), Sense::click_and_drag()); - if drag.drag_started() { - ui.ctx().send_viewport_cmd(egui::ViewportCommand::StartDrag); - } - if drag.double_clicked() { - let max = ui.input(|i| i.viewport().maximized.unwrap_or(false)); - ui.ctx().send_viewport_cmd(egui::ViewportCommand::Maximized(!max)); - } - } let buttons_w = if app.ui.title_bar == TitleBar::Custom { window_buttons(app, ui, rect) } else { 0.0 }; let mut x = rect.min.x + if app.ui.title_bar == TitleBar::Inset { 76.0 } else { 8.0 }; // Home. @@ -49,28 +180,65 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { } x += 44.0; ui.painter().line_segment([pos2(x, rect.min.y), pos2(x, rect.max.y)], Stroke::new(1.0, t.border)); + let document_tabs: Vec = app.session.docs.iter().enumerate().filter_map(|(i, d)| app.shows(d.uid).then_some(i)).collect(); + let now = ui.input(|input| input.time); + let motion_id = ui.id().with("tab_motion"); + let mut motion = ui.ctx().data_mut(|data| data.get_temp::(motion_id).unwrap_or_default()); + let current_uids = document_tabs.iter().filter_map(|&i| app.session.docs.get(i).map(|d| d.uid)).collect(); + motion.begin_frame(current_uids, now, app.reduce_motion()); + let preferred: Vec = document_tabs + .iter() + .map(|&i| { + let d = &app.session.docs[i]; + let mark_w = if live_mark(app, d.uid).is_some() { 18.0 } else { 0.0 }; + let dot_w = if d.is_dirty() && mark_w > 0.0 { 12.0 } else { 0.0 }; + (regular(12.0).size * 0.6 * d.doc.name.chars().count() as f32 + 64.0 + mark_w + dot_w).clamp(120.0, 220.0) + }) + .collect(); + // Leave the new-tab button, theme toggle, window controls and a draggable gap free. + let present_w = if app.ui.present.is_some() || app.ui.paused_present.is_some() { 128.0 } else { 0.0 }; + let available = (rect.max.x - buttons_w - 70.0 - x - 34.0 - present_w).max(0.0); + let active_tab = document_tabs.iter().position(|&i| i == app.session.active); + let layout = tab_layout(&preferred, available, active_tab); + let mut tab_rects = Vec::with_capacity(layout.widths.len()); + let mut tab_x = x; + for &width in &layout.widths { + tab_rects.push(Rect::from_min_size(pos2(tab_x, rect.min.y), vec2(width, HEIGHT))); + tab_x += width; + } let mut switch = None; let mut close = None; // A tab dragged off the strip, or "Open in new window", moves to a window of its own. let mut detach = None; + let mut dragging = None; + let mut dropped = None; let several = !ui.ctx().embed_viewports(); - for (i, d) in app.session.docs.iter().enumerate().filter(|(_, d)| app.shows(d.uid)) { + for (slot, &w) in layout.widths.iter().enumerate() { + let i = document_tabs[layout.first + slot]; + let d = &app.session.docs[i]; let active = i == app.session.active && !app.ui.home && app.ui.present.is_none(); let name = d.doc.name.clone(); // In a live session: a mark after the name says whether others get in. let live = live_mark(app, d.uid); let mark_w = if live.is_some() { 18.0 } else { 0.0 }; - // (A file in a session is rarely saved here: its unsaved dot gets room beside the mark.) let dirty = d.is_dirty(); - let dot_w = if dirty && live.is_some() { 12.0 } else { 0.0 }; - let w = (regular(12.0).size * 0.6 * name.chars().count() as f32 + 64.0 + mark_w + dot_w).clamp(120.0, 220.0); - let r = Rect::from_min_size(pos2(x, rect.min.y), vec2(w, HEIGHT)); - let resp = ui.interact(r, ui.id().with(("tab", d.uid)), if several { Sense::click_and_drag() } else { Sense::click() }); - if resp.drag_stopped() + let r = tab_rects[slot]; + let body_r = Rect::from_min_max(r.min, pos2(r.max.x - 32.0, r.max.y)); + let close_r = Rect::from_min_max(body_r.right_top(), r.max); + let resp = ui.interact(body_r, ui.id().with(("tab", d.uid)), Sense::click_and_drag()); + let cresp = ui.interact(close_r, ui.id().with(("tabclose", d.uid)), Sense::click()).tip(tr("Close tab")); + if (resp.dragged() || resp.drag_stopped()) && let Some(p) = ui.input(|inp| inp.pointer.latest_pos()) - && (p.y - rect.center().y).abs() > HEIGHT * 2.0 { - detach = Some((i, Some(p))); + if resp.drag_stopped() { + if several && (p.y - rect.center().y).abs() > HEIGHT * 2.0 { + detach = Some((i, Some(p))); + } else if (rect.min.y - 12.0..=rect.max.y + 12.0).contains(&p.y) { + dropped = Some((i, p.x)); + } + } else { + dragging = Some((i, p)); + } } if several { resp.context_menu(|ui| { @@ -88,43 +256,47 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { }; let resp = if live.is_some() { resp.on_hover_text(&label) } else { resp }; crate::a11y::tab(&resp, &label, active); + let progress = motion.open_progress(d.uid, now); + let paint_r = r.translate(vec2(-28.0 * (1.0 - progress).powi(2), 0.0)); + let painter = ui.painter().with_clip_rect(r); if active { - ui.painter().rect_filled(r, CornerRadius::ZERO, t.tab_active); - } else if resp.hovered() { - ui.painter().rect_filled(r, CornerRadius::ZERO, t.hover); + painter.rect_filled(paint_r, CornerRadius::ZERO, t.tab_active.linear_multiply(progress)); + } else if resp.hovered() || cresp.hovered() { + painter.rect_filled(paint_r, CornerRadius::ZERO, t.hover.linear_multiply(progress)); } icons::paint( - ui.painter(), - Rect::from_center_size(pos2(r.min.x + 18.0, r.center().y), vec2(14.0, 14.0)), + &painter, + Rect::from_center_size(pos2(paint_r.min.x + 18.0, paint_r.center().y), vec2(14.0, 14.0)), Icon::Logo, - crate::theme::ACCENT, + crate::theme::ACCENT.linear_multiply(progress), ); // The unsaved-changes dot follows the name on screen, whichever way the name reads. let shown = crate::bidi::paint_name( - ui.painter(), - pos2(r.min.x + 32.0, r.center().y), + &painter, + pos2(paint_r.min.x + 32.0, paint_r.center().y), &name, regular(12.0), - t.text, - w - mark_w - if dirty { 72.0 } else { 60.0 }, + t.text.linear_multiply(progress), + (w - mark_w - if dirty { 72.0 } else { 60.0 }).max(0.0), ); if let Some(shared) = live { - let at = Rect::from_center_size(pos2(r.max.x - 38.0, r.center().y), vec2(14.0, 14.0)); - icons::paint(ui.painter(), at, crate::online::mark(shared), if shared { t.success } else { t.icon_secondary }); + let at = Rect::from_center_size(pos2(paint_r.max.x - 38.0, paint_r.center().y), vec2(14.0, 14.0)); + icons::paint(&painter, at, crate::online::mark(shared), if shared { t.success } else { t.icon_secondary }.linear_multiply(progress)); } if dirty { - ui.painter().text(pos2(shown.max.x + 4.0, r.center().y), Align2::LEFT_CENTER, "•", regular(12.0), t.text); + painter.text(pos2(shown.max.x + 4.0, paint_r.center().y), Align2::LEFT_CENTER, "•", regular(12.0), t.text.linear_multiply(progress)); } - let cr = Rect::from_center_size(pos2(r.max.x - 16.0, r.center().y), vec2(18.0, 18.0)); - if resp.hovered() || active { - let cresp = ui.interact(cr, ui.id().with(("tabclose", d.uid)), Sense::click()).tip(tr("Close tab")); + let cr = Rect::from_center_size(close_r.center() + vec2(paint_r.min.x - r.min.x, 0.0), vec2(18.0, 18.0)); + // The close target never overlaps the draggable body, including on inactive tabs. + if resp.hovered() || cresp.hovered() || active { if cresp.hovered() { - ui.painter().rect_filled(cr, CornerRadius::same(4), t.pressed); - } - icons::paint(ui.painter(), cr.shrink(4.0), Icon::Close, t.icon_secondary); - if cresp.clicked() { - close = Some(i); + painter.rect_filled(cr, CornerRadius::same(4), t.pressed.linear_multiply(progress)); } + icons::paint(&painter, cr.shrink(4.0), Icon::Close, t.icon_secondary.linear_multiply(progress)); + } + motion.last_visible.insert(d.uid, TabSnapshot { name, rect: r, active }); + if cresp.clicked() { + close = Some(i); } if resp.clicked() && close.is_none() { switch = Some(i); @@ -135,35 +307,68 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { x += w; ui.painter().line_segment([pos2(x, rect.min.y + 10.0), pos2(x, rect.max.y - 10.0)], Stroke::new(1.0, t.border)); } + let visible: Vec<(usize, Rect)> = tab_rects.iter().copied().enumerate().map(|(slot, r)| (document_tabs[layout.first + slot], r)).collect(); + if let Some((from, p)) = dragging + && (rect.min.y - 12.0..=rect.max.y + 12.0).contains(&p.y) + && let Some((_, at)) = tab_drop_position(&visible, from, p.x) + { + ui.painter().line_segment([pos2(at, rect.min.y + 5.0), pos2(at, rect.max.y - 5.0)], Stroke::new(3.0, crate::theme::ACCENT)); + } + let reorder = dropped.and_then(|(from, at)| tab_drop_position(&visible, from, at).map(|(to, _)| (from, to))); + if layout.overflow { + let r = Rect::from_min_size(pos2(x, rect.min.y), vec2(OVERFLOW_WIDTH, HEIGHT)); + let resp = ui.interact(r, ui.id().with("tab_overflow"), Sense::click()).tip(tr("Open files")); + crate::a11y::menu_button(&resp, tr("Open files"), crate::a11y::menu_open(&resp)); + if resp.hovered() { + ui.painter().rect_filled(r, CornerRadius::ZERO, t.hover); + } + icons::paint(ui.painter(), Rect::from_center_size(r.center(), vec2(14.0, 14.0)), Icon::Chevron, t.icon); + egui::Popup::menu(&resp).style(crate::right::menu_style).show(|ui| { + ui.set_min_width(180.0); + egui::ScrollArea::vertical().max_height(400.0).show(ui, |ui| { + for (slot, &i) in document_tabs.iter().enumerate() { + if (layout.first..layout.first + layout.widths.len()).contains(&slot) { + continue; + } + let d = &app.session.docs[i]; + if ui.button(&d.doc.name).clicked() { + switch = Some(i); + ui.close(); + } + } + }); + }); + x += OVERFLOW_WIDTH; + } // Presentations live in their own tab. Switching back to the design keeps the player // state (current screen, navigation history and scroll position) for the return trip. if app.ui.present.is_some() || app.ui.paused_present.is_some() { let w = 128.0; let r = Rect::from_min_size(pos2(x, rect.min.y), vec2(w, HEIGHT)); - let resp = ui.interact(r, ui.id().with("presentation_tab"), Sense::click()).tip(tr("Present")); + let body_r = Rect::from_min_max(r.min, pos2(r.max.x - 32.0, r.max.y)); + let close_r = Rect::from_min_max(body_r.right_top(), r.max); + let resp = ui.interact(body_r, ui.id().with("presentation_tab"), Sense::click()).tip(tr("Present")); + let close_resp = ui.interact(close_r, ui.id().with("presentation_close"), Sense::click()).tip(tr("Close preview")); let active = app.ui.present.is_some(); crate::a11y::tab(&resp, tr("Present"), active); if active { ui.painter().rect_filled(r, CornerRadius::ZERO, t.tab_active); - } else if resp.hovered() { + } else if resp.hovered() || close_resp.hovered() { ui.painter().rect_filled(r, CornerRadius::ZERO, t.hover); } icons::paint(ui.painter(), Rect::from_center_size(pos2(x + 19.0, r.center().y), vec2(14.0, 14.0)), Icon::Play, t.icon); ui.painter().text(pos2(x + 34.0, r.center().y), Align2::LEFT_CENTER, tr("Present"), regular(12.0), t.text); - let cr = Rect::from_center_size(pos2(r.max.x - 16.0, r.center().y), vec2(18.0, 18.0)); - if resp.hovered() || active { - let close_resp = ui.interact(cr, ui.id().with("presentation_close"), Sense::click()).tip(tr("Close preview")); + let cr = Rect::from_center_size(close_r.center(), vec2(18.0, 18.0)); + if resp.hovered() || close_resp.hovered() || active { if close_resp.hovered() { ui.painter().rect_filled(cr, CornerRadius::same(4), t.pressed); } icons::paint(ui.painter(), cr.shrink(4.0), Icon::Close, t.icon_secondary); - if close_resp.clicked() { - app.ui.present = None; - app.ui.paused_present = None; - app.ui.present_uid = None; - } else if resp.clicked() && !active { - resume_presentation(app); - } + } + if close_resp.clicked() { + app.ui.present = None; + app.ui.paused_present = None; + app.ui.present_uid = None; } else if resp.clicked() && !active { resume_presentation(app); } @@ -195,6 +400,18 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { let cmd = if app.ui.dark { "view.themeLight" } else { "view.themeDark" }; app.run(cmd, json!({})); } + // Only the free space drags the window. A full-bar drag target steals tab drags. + if app.ui.title_bar != TitleBar::Native && x + 34.0 < theme_r.min.x { + let free = Rect::from_min_max(pos2(x + 34.0, rect.min.y), pos2(theme_r.min.x, rect.max.y)); + let drag = ui.interact(free, ui.id().with("titlebar_drag"), Sense::click_and_drag()); + if drag.drag_started() { + ui.ctx().send_viewport_cmd(egui::ViewportCommand::StartDrag); + } + if drag.double_clicked() { + let max = ui.input(|i| i.viewport().maximized.unwrap_or(false)); + ui.ctx().send_viewport_cmd(egui::ViewportCommand::Maximized(!max)); + } + } if let Some(i) = switch { if let Some(p) = app.ui.present.take() { app.ui.paused_present = Some(p); @@ -209,6 +426,11 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { app.toast(e); } } + if let Some((from, to)) = reorder + && from != to + { + app.run("file.moveTab", json!({"from": from, "to": to})); + } if let Some(i) = close { // A branch tab's edits live on in its main file: closing it loses nothing. let dirty = app.session.docs.get(i).is_some_and(|d| d.is_dirty() && d.branch_of.is_none()); @@ -230,6 +452,11 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { app.ui.present_uid = None; } } + paint_closing_tabs(ui, &t, &motion, now); + if motion.is_animating() { + ui.ctx().request_repaint(); + } + ui.ctx().data_mut(|data| data.insert_temp(motion_id, motion)); let _ = Color32::TRANSPARENT; let _ = Align2::LEFT_TOP; }); @@ -325,3 +552,56 @@ pub fn resize_edges(ctx: &egui::Context) { } }); } + +#[cfg(test)] +mod layout_tests { + use super::{MIN_TAB_WIDTH, OVERFLOW_WIDTH, TabMotion, TabSnapshot, tab_drop_position, tab_layout}; + use egui::{Rect, pos2}; + use std::collections::HashSet; + + #[test] + fn tabs_shrink_to_fit_before_overflowing() { + let preferred = vec![120.0; 10]; + let layout = tab_layout(&preferred, 1100.0, Some(5)); + assert!(!layout.overflow); + assert_eq!(layout.first, 0); + assert_eq!(layout.widths.len(), preferred.len()); + assert!(layout.widths.iter().all(|&width| (width - 110.0).abs() < 0.01)); + } + + #[test] + fn excess_tabs_leave_room_for_overflow_and_keep_the_active_tab_visible() { + let preferred = vec![120.0; 24]; + let available = 1100.0; + let layout = tab_layout(&preferred, available, Some(23)); + assert!(layout.overflow); + assert!(layout.first <= 23 && 23 < layout.first + layout.widths.len()); + assert!(layout.widths.iter().all(|&width| width >= MIN_TAB_WIDTH)); + assert!(layout.widths.iter().sum::() + OVERFLOW_WIDTH <= available + 0.01); + } + + #[test] + fn drop_position_places_a_tab_between_its_neighbors() { + let visible = (0..4) + .map(|index| (index, Rect::from_min_max(pos2(index as f32 * 120.0, 0.0), pos2((index + 1) as f32 * 120.0, 40.0)))) + .collect::>(); + assert_eq!(tab_drop_position(&visible, 0, 330.0).map(|(to, _)| to), Some(2)); + assert_eq!(tab_drop_position(&visible, 3, 30.0).map(|(to, _)| to), Some(0)); + } + + #[test] + fn new_tabs_animate_and_closed_tabs_fall_unless_motion_is_reduced() { + let mut motion = TabMotion::default(); + motion.begin_frame(HashSet::from([1]), 0.0, false); + assert!(!motion.is_animating()); + let snapshot = TabSnapshot { name: "First".into(), rect: Rect::from_min_max(pos2(0.0, 0.0), pos2(120.0, 40.0)), active: false }; + motion.last_visible.insert(1, snapshot.clone()); + motion.begin_frame(HashSet::from([1, 2]), 1.0, false); + assert_eq!(motion.open_progress(2, 1.0), 0.0); + motion.last_visible.insert(1, snapshot); + motion.begin_frame(HashSet::from([2]), 1.05, false); + assert_eq!(motion.closing.len(), 1); + motion.begin_frame(HashSet::from([2]), 1.06, true); + assert!(!motion.is_animating()); + } +} diff --git a/crates/ui-egui/src/titlebar_tests.rs b/crates/ui-egui/src/titlebar_tests.rs index e9224404d..9f1916c17 100644 --- a/crates/ui-egui/src/titlebar_tests.rs +++ b/crates/ui-egui/src/titlebar_tests.rs @@ -158,6 +158,81 @@ fn tabs_and_new_tab_keep_their_clicks() { assert!(opened, "the new-tab button took no click"); } +#[test] +fn many_tabs_do_not_cover_the_window_buttons() { + let mut u = Ui::new(TitleBar::Custom); + for _ in 0..24 { + u.app.session.execute("file.new", &json!({})).unwrap(); + } + u.frame(vec![]); + let before = u.app.session.docs.len(); + u.click(pos2(SIZE.x - 222.0, 20.0)); + assert_eq!(u.app.session.docs.len(), before + 1, "the new-tab button must stay reachable"); + assert!(u.click(window_button(0)).contains(&ViewportCommand::Minimized(true))); + assert!(u.click(window_button(1)).contains(&ViewportCommand::Maximized(true))); + u.click(window_button(2)); + assert!(u.frame(vec![]).contains(&ViewportCommand::Close)); +} + +#[test] +fn close_button_on_inactive_tab_closes_it_without_switching() { + let mut u = Ui::new(TitleBar::Custom); + u.app.session.execute("file.new", &json!({})).unwrap(); + u.app.session.execute("file.new", &json!({})).unwrap(); + let active_uid = u.app.session.docs[u.app.session.active].uid; + let inactive_uid = u.app.session.docs[1].uid; + let close_button = pos2(270.0, 20.0); + u.frame(vec![Event::PointerMoved(close_button)]); + u.click(close_button); + assert!( + !u.app.session.docs.iter().any(|doc| doc.uid == inactive_uid), + "docs={}, active={}, last_error={:?}, target_dirty={}", + u.app.session.docs.len(), + u.app.session.active, + u.app.ui.last_error, + u.app.session.docs.iter().find(|doc| doc.uid == inactive_uid).is_some_and(|doc| doc.is_dirty()) + ); + assert_eq!(u.app.session.docs[u.app.session.active].uid, active_uid); +} + +#[test] +fn closing_a_tab_before_the_active_one_keeps_the_active_file() { + let mut u = Ui::new(TitleBar::Custom); + for _ in 0..3 { + u.app.session.execute("file.new", &json!({})).unwrap(); + } + u.app.session.execute("doc.switch", &json!({"index": 2})).unwrap(); + let active_uid = u.app.session.docs[u.app.session.active].uid; + let closed_uid = u.app.session.docs[0].uid; + let close_button = pos2(156.0, 20.0); + u.frame(vec![Event::PointerMoved(close_button)]); + u.click(close_button); + assert!(!u.app.session.docs.iter().any(|doc| doc.uid == closed_uid)); + assert_eq!(u.app.session.docs[u.app.session.active].uid, active_uid); +} + +#[test] +fn dragging_a_tab_along_the_bar_reorders_it_without_detaching() { + let mut u = Ui::new(TitleBar::Custom); + for name in ["Two", "Three", "Four"] { + u.app.session.execute("file.new", &json!({"name": name})).unwrap(); + } + let moved_uid = u.app.session.docs[0].uid; + let active_uid = u.app.session.docs[u.app.session.active].uid; + u.frame(vec![]); + let commands = u.drag(pos2(100.0, 20.0), vec2(310.0, 0.0)); + assert!(!commands.contains(&ViewportCommand::StartDrag), "{commands:?}"); + assert_eq!( + u.app.session.docs[2].uid, + moved_uid, + "order={:?}, active={}, error={:?}", + u.app.session.docs.iter().map(|d| d.uid).collect::>(), + u.app.session.active, + u.app.ui.last_error + ); + assert_eq!(u.app.session.docs[u.app.session.active].uid, active_uid); +} + #[test] fn a_system_title_bar_leaves_the_window_alone() { let mut u = Ui::new(TitleBar::Native); From fd02772d224f2e406c64b7df49be36d13d000d91 Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Mon, 19 Oct 2026 11:34:21 +0200 Subject: [PATCH 323/817] refactor(text): one helper for the chars that end a line --- crates/text/src/layout.rs | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/crates/text/src/layout.rs b/crates/text/src/layout.rs index 7fc6e11ad..6266dc2b1 100644 --- a/crates/text/src/layout.rs +++ b/crates/text/src/layout.rs @@ -157,6 +157,11 @@ fn deco_len(m: DecorationLength, size: f64, auto: f64) -> f64 { if v.is_finite() { v } else { auto } } +/// A char that ends its line: a newline (which also ends the paragraph). +fn is_line_break(c: char) -> bool { + c == '\n' +} + /// Opening punctuation, which hangs outside a line's start. fn opens(c: char) -> bool { matches!(c, '"' | '\'' | '\u{201C}' | '\u{2018}' | '\u{201E}' | '\u{201A}' | '\u{00AB}' | '\u{2039}' | '(' | '[' | '{' | '\u{00BF}' | '\u{00A1}') @@ -332,7 +337,7 @@ pub fn layout(text: &TextData, box_width: Option, box_height: Option) } // Colour emoji are their own, large faces (Apple Color Emoji is ~180 MB): they are read only // for a text with emoji, or with characters nothing above covers. - let covered = |c: char| c == '\n' || faces.iter().flatten().any(|f| f.has_char(c)) || fallbacks.iter().any(|f| f.has_char(c)); + let covered = |c: char| is_line_break(c) || faces.iter().flatten().any(|f| f.has_char(c)) || fallbacks.iter().any(|f| f.has_char(c)); let emoji = if chars.iter().any(|c| is_emoji(*c) || !covered(*c)) { dbw.emoji_fallbacks() } else { Vec::new() }; fallbacks.extend(emoji.iter().cloned()); drop(dbw); @@ -370,7 +375,7 @@ pub fn layout(text: &TextData, box_width: Option, box_height: Option) { return f.clone(); } - if c == '\n' || primary.has_char(c) { + if is_line_break(c) || primary.has_char(c) { return primary.clone(); } let fallbacks = style_fallbacks.get(st_idx).unwrap_or(&fallbacks); @@ -382,13 +387,15 @@ pub fn layout(text: &TextData, box_width: Option, box_height: Option) let mut seg_end = seg_start + 1; while seg_end < *end && chars.get(seg_end).is_some_and(|c| { - *c != '\n' && first != '\n' && (!cluster_start.get(seg_end).copied().unwrap_or(true) || face_for(*c).id == face.id) + !is_line_break(*c) + && !is_line_break(first) + && (!cluster_start.get(seg_end).copied().unwrap_or(true) || face_for(*c).id == face.id) }) && level_at(seg_end) == level { seg_end += 1; } - if first == '\n' { + if is_line_break(first) { items.push(Item { face: face.clone(), coords: no_coords(), @@ -401,7 +408,7 @@ pub fn layout(text: &TextData, box_width: Option, box_height: Option) char_start: seg_start, char_end: seg_start + 1, style: st_idx, - ch: '\n', + ch: first, level, }); } else { @@ -546,7 +553,7 @@ pub fn layout(text: &TextData, box_width: Option, box_height: Option) let baseline = y + (lh - (asc + desc)) / 2.0 + asc; // Trailing spaces don't count for width/alignment. let mut vis_end = *e; - while vis_end > *s && items.get(vis_end - 1).is_some_and(|it| it.is_space() || it.ch == '\n') { + while vis_end > *s && items.get(vis_end - 1).is_some_and(|it| it.is_space() || is_line_break(it.ch)) { vis_end -= 1; } // Letter spacing separates glyphs: none after the line's last visible one. @@ -574,7 +581,7 @@ pub fn layout(text: &TextData, box_width: Option, box_height: Option) .get(vis_end..*e) .unwrap_or(&[]) .iter() - .filter(|it| it.ch != '\n') + .filter(|it| !is_line_break(it.ch)) .map(|it| it.adv + if it.is_space() { justify_extra } else { 0.0 }) .sum(); let mut pen = if rtl_line { -trailing } else { line_indent - hang_l }; @@ -649,7 +656,7 @@ pub fn layout(text: &TextData, box_width: Option, box_height: Option) (0..line_items.len()).collect() }; for it in order.iter().filter_map(|k| line_items.get(*k)) { - if it.ch == '\n' { + if is_line_break(it.ch) { continue; } let size = styles.get(it.style).map(|st| sanitize_size(st.font_size)).unwrap_or(12.0) * it.scale; From 855bbb328fde58feee6d8cbc5d5d380c87235cc9 Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Mon, 19 Oct 2026 11:34:34 +0200 Subject: [PATCH 324/817] refactor(text): Line::break_after for carets and selections Carets, clicks and selections asked `para_end && !last_line` to mean "the line ends with a break char". Record that on the line instead, so a break that doesn't end the paragraph can use the same rules. No behaviour change: today only a newline ends a line early. --- crates/text/src/layout.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/crates/text/src/layout.rs b/crates/text/src/layout.rs index 6266dc2b1..7aef4e5ed 100644 --- a/crates/text/src/layout.rs +++ b/crates/text/src/layout.rs @@ -82,6 +82,9 @@ pub struct Line { pub x: f64, /// The line ends a paragraph (hard break or end of text). pub para_end: bool, + /// The line ends with a line break char: a newline, or a line separator (U+2028) that breaks + /// the line inside its paragraph. + pub break_after: bool, /// The paragraph runs right to left (its first strong character is right-to-left). pub rtl: bool, } @@ -498,6 +501,7 @@ pub fn layout(text: &TextData, box_width: Option, box_height: Option) } i += 1; } + let break_after = |e: usize| e.checked_sub(1).and_then(|i| items.get(i)).is_some_and(|it| is_line_break(it.ch)); if line_start < items.len() || lines.is_empty() || lines.last().is_some_and(|l| l.2) { lines.push((line_start, items.len(), true, para)); } @@ -694,6 +698,7 @@ pub fn layout(text: &TextData, box_width: Option, box_height: Option) width: width + line_indent - hang_l - hang_r, x: 0.0, para_end: *para_end, + break_after: break_after(*e), rtl: rtl_line, }); y += lh; @@ -1151,11 +1156,11 @@ impl TextLayout { let last_line = li + 1 == self.lines.len(); let in_line = index >= line.char_start && (index < line.char_end || (last_line && index <= line.char_end)); // A caret at the end of a soft-wrapped line belongs to the next line. - if !(in_line || index == line.char_end && line.para_end && !last_line) { + if !(in_line || index == line.char_end && line.break_after && !last_line) { continue; } - if index == line.char_end && line.para_end && !last_line { - // Before the newline: end of this line. + if index == line.char_end && line.break_after && !last_line { + // Before the line break: end of this line. let x = self.line_end_x(line); return (x, li); } @@ -1186,8 +1191,8 @@ impl TextLayout { if !line.rtl && !gl.iter().any(|g| g.rtl) { return None; } - // The caret can't sit after a paragraph's newline on its own line. - let end = if line.para_end && li + 1 < self.lines.len() { line.char_end.saturating_sub(1) } else { line.char_end }; + // The caret can't sit after a line's break on its own line. + let end = if line.break_after && li + 1 < self.lines.len() { line.char_end.saturating_sub(1) } else { line.char_end }; let next = (line.char_start..=end.max(line.char_start)) .filter(|i| *i != index) .map(|i| (i, self.caret(i).0)) @@ -1254,7 +1259,7 @@ impl TextLayout { } } let last_line = li + 1 == self.lines.len(); - let end = if line.para_end && !last_line { line.char_end.saturating_sub(1).max(line.char_start) } else { line.char_end }; + let end = if line.break_after && !last_line { line.char_end.saturating_sub(1).max(line.char_start) } else { line.char_end }; // Right of a right-to-left line is its start. if line.rtl { line.char_start } else { end } } @@ -1286,7 +1291,7 @@ impl TextLayout { let x0 = if a <= line.char_start { self.line_start_x(line) } else { self.caret(a).0 }; let x1 = if b >= line.char_end { // The last line has no paragraph break to show, so it ends at its glyphs. - self.line_end_x(line) + if line.para_end && !last && b > line.char_end.saturating_sub(1) { 4.0 } else { 0.0 } + self.line_end_x(line) + if line.break_after && !last && b > line.char_end.saturating_sub(1) { 4.0 } else { 0.0 } } else { self.caret(b).0 }; From 692f45123c5b4b28053bfa90c531f5861f414335 Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Mon, 19 Oct 2026 11:34:47 +0200 Subject: [PATCH 325/817] fix(text): a line separator breaks the line inside its paragraph (#852) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Figma stores Shift+Enter as U+2028. `.fig` imports keep it, but layout only broke lines at a newline, so imported text ran soft-broken lines together ("Option 1SL: …"), lost the empty line of a separator followed by a newline, and put glyph bullets on one line. A line separator now ends its line without ending the paragraph: no paragraph spacing and no new list marker after it, the next line keeps the item's indent, and it draws no glyph. A trailing one leaves an empty last line, and a line it cuts short isn't stretched when justified. --- crates/text/src/layout.rs | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/crates/text/src/layout.rs b/crates/text/src/layout.rs index 7aef4e5ed..f9139f6fb 100644 --- a/crates/text/src/layout.rs +++ b/crates/text/src/layout.rs @@ -160,9 +160,13 @@ fn deco_len(m: DecorationLength, size: f64, auto: f64) -> f64 { if v.is_finite() { v } else { auto } } -/// A char that ends its line: a newline (which also ends the paragraph). +/// The line separator (U+2028): a line break inside a paragraph, as Figma's Shift+Enter stores it +/// (imported text keeps it; typed text has newlines only). +const LINE_SEPARATOR: char = '\u{2028}'; + +/// A char that ends its line: a newline (which also ends the paragraph) or a line separator. fn is_line_break(c: char) -> bool { - c == '\n' + c == '\n' || c == LINE_SEPARATOR } /// Opening punctuation, which hangs outside a line's start. @@ -475,6 +479,17 @@ pub fn layout(text: &TextData, box_width: Option, box_height: Option) para += 1; continue; } + // A line separator (Figma's Shift+Enter) breaks the line inside its paragraph: no + // paragraph spacing and no new list marker after it. + if it.ch == LINE_SEPARATOR { + lines.push((line_start, i + 1, false, para)); + i += 1; + line_start = i; + x = 0.0; + last_break = None; + para_first_line = false; + continue; + } let line_indent = line_indent_of(para, para_first_line, it.char_start); let w = it.adv; // Hanging punctuation takes no room inside the box. @@ -502,7 +517,7 @@ pub fn layout(text: &TextData, box_width: Option, box_height: Option) i += 1; } let break_after = |e: usize| e.checked_sub(1).and_then(|i| items.get(i)).is_some_and(|it| is_line_break(it.ch)); - if line_start < items.len() || lines.is_empty() || lines.last().is_some_and(|l| l.2) { + if line_start < items.len() || lines.is_empty() || lines.last().is_some_and(|l| l.2 || break_after(l.1)) { lines.push((line_start, items.len(), true, para)); } @@ -574,7 +589,9 @@ pub fn layout(text: &TextData, box_width: Option, box_height: Option) // Justify: extra space per gap. let gaps = items.get(*s..vis_end).unwrap_or(&[]).iter().filter(|it| it.is_space()).count(); let justify_extra = match (text.align_h, wrap) { - (TextAlignH::Justified, Some(maxw)) if !para_end && gaps > 0 => ((maxw - line_indent + hang_l + hang_r - width) / gaps as f64).max(0.0), + (TextAlignH::Justified, Some(maxw)) if !para_end && !break_after(*e) && gaps > 0 => { + ((maxw - line_indent + hang_l + hang_r - width) / gaps as f64).max(0.0) + } _ => 0.0, }; // Where the visible text ends once justified. From 9e4dcc9204b3d694f6c9a2085524b6d9defa2444 Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Mon, 19 Oct 2026 11:34:58 +0200 Subject: [PATCH 326/817] test(text): line separators in layout, lists and carets (#852) --- crates/text/src/lib.rs | 2 + crates/text/src/line_separator_tests.rs | 82 +++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 crates/text/src/line_separator_tests.rs diff --git a/crates/text/src/lib.rs b/crates/text/src/lib.rs index 683350f61..8160cc90f 100644 --- a/crates/text/src/lib.rs +++ b/crates/text/src/lib.rs @@ -150,6 +150,8 @@ mod behaviour_tests; #[cfg(test)] mod cache_tests; #[cfg(test)] +mod line_separator_tests; +#[cfg(test)] mod list_tests; #[cfg(test)] mod metrics_tests; diff --git a/crates/text/src/line_separator_tests.rs b/crates/text/src/line_separator_tests.rs new file mode 100644 index 000000000..d5ad16b02 --- /dev/null +++ b/crates/text/src/line_separator_tests.rs @@ -0,0 +1,82 @@ +//! A line separator (U+2028: what Figma's Shift+Enter stores, and `.fig` imports keep) breaks the +//! line inside its paragraph: no paragraph spacing or new list marker after it, and no glyph (#852). + +use super::*; +use figcraft_doc::{LineHeight, ListStyle, TextAutoResize, TextData}; + +const EPS: f64 = 1e-6; + +/// A 20 px text on 30 px lines in the default face, or None (skip) on a machine without fonts. +fn text(s: &str) -> Option { + scan_system_fonts(); + let f = db().write().unwrap().default_face()?; + let mut t = TextData::new(s); + (t.style.font_family, t.style.font_style) = (f.family.clone(), f.style.clone()); + t.style.font_size = 20.0; + t.style.line_height = LineHeight::Pixels(30.0); + t.auto_resize = TextAutoResize::WidthAndHeight; + Some(t) +} + +/// The chars of each line. +fn line_texts(t: &TextData, l: &TextLayout) -> Vec { + let chars: Vec = t.characters.chars().collect(); + l.lines.iter().map(|ln| chars.get(ln.char_start..ln.char_end).unwrap_or(&[]).iter().collect::()).collect() +} + +#[test] +fn breaks_the_line_but_not_the_paragraph() { + let Some(mut t) = text("one\u{2028}two\nthree") else { return }; + t.paragraph_spacing = 10.0; + let l = layout(&t, None, None); + assert_eq!(line_texts(&t, &l), ["one\u{2028}", "two\n", "three"]); + assert!(!l.lines[0].para_end && l.lines[0].break_after); + assert!(l.lines[1].para_end && l.lines[1].break_after); + assert!(!l.lines[2].break_after); + // Paragraph spacing after the newline only: 30, then 30 + 10. + assert!((l.lines[1].top - 30.0).abs() < EPS && (l.lines[2].top - 70.0).abs() < EPS, "{} {}", l.lines[1].top, l.lines[2].top); + // The separator draws nothing. + assert!(l.glyphs.iter().all(|g| !(g.char_start..g.char_end).contains(&3))); +} + +#[test] +fn before_a_newline_or_at_the_end_it_leaves_an_empty_line() { + // "Hi,⏎¶Season" in #852: Figma shows an empty line between the two. + let Some(t) = text("Hi,\u{2028}\nSeason") else { return }; + let l = layout(&t, None, None); + assert_eq!(line_texts(&t, &l), ["Hi,\u{2028}", "\n", "Season"]); + let Some(t) = text("end\u{2028}") else { return }; + let l = layout(&t, None, None); + assert_eq!(line_texts(&t, &l), ["end\u{2028}", ""]); + assert!((l.height - 60.0).abs() < EPS, "{}", l.height); +} + +#[test] +fn a_list_item_continues_after_it_without_a_new_marker() { + let Some(mut t) = text("item\u{2028}more\nnext") else { return }; + t.list = ListStyle::Bulleted; + let l = layout(&t, None, None); + assert_eq!(line_texts(&t, &l), ["item\u{2028}", "more\n", "next"]); + // Markers are the glyphs that cover no char: one per paragraph. + assert_eq!(l.glyphs.iter().filter(|g| g.char_start == g.char_end).count(), 2); + // The line after the separator lines up with the item's text, past the bullet. + let text_x = |li: usize| l.glyphs.iter().find(|g| g.char_start == l.lines[li].char_start && g.char_end > g.char_start).map(|g| g.x); + let (first, cont) = (text_x(0).unwrap(), text_x(1).unwrap()); + assert!(first > 0.0 && (first - cont).abs() < 1e-3, "{first} {cont}"); +} + +#[test] +fn carets_and_clicks_treat_it_like_a_newline() { + let (Some(sep), Some(nl)) = (text("ab\u{2028}cd"), text("ab\ncd")) else { return }; + let (ls, ln) = (layout(&sep, None, None), layout(&nl, None, None)); + for i in 0..=5 { + assert_eq!(ls.caret(i), ln.caret(i), "caret before char {i}"); + } + for line in &ln.lines { + for x in [-10.0, 5.0, line.width + 50.0] { + assert_eq!(ls.hit(x, line.top + 5.0), ln.hit(x, line.top + 5.0), "click at {x} on the line at {}", line.top); + } + } + // A click right of the first line lands before the separator, not after it. + assert_eq!(ls.hit(ls.lines[0].width + 50.0, ls.lines[0].top + 5.0), 2); +} From 7af44512e78083e152f60ab57a03a8fe2adaf2b3 Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Mon, 19 Oct 2026 11:46:47 +0200 Subject: [PATCH 327/817] refactor(pages): remember which file the Pages list focus belongs to --- crates/ui-egui/src/canvas.rs | 2 +- crates/ui-egui/src/layers.rs | 7 ++++--- crates/ui-egui/src/layers_keys_tests.rs | 4 ++-- crates/ui-egui/src/lib.rs | 10 +++++----- crates/ui-egui/src/menus.rs | 2 +- crates/ui-egui/src/selection_spacing.rs | 2 +- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 94daf657f..234b07b27 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -544,7 +544,7 @@ fn input(app: &mut FigApp, ui: &mut Ui, resp: &egui::Response) -> bool { // A press on the canvas gives the keyboard back to it (arrows nudge again). if resp.hovered() && ctx.input(|i| i.pointer.any_pressed()) { app.ui.layers_focus = false; - app.ui.pages_focus = false; + app.ui.pages_focus = None; app.ui.key_box = None; } // Zoom (pinch, Cmd/Ctrl+scroll) about the pointer; plain scroll pans. diff --git a/crates/ui-egui/src/layers.rs b/crates/ui-egui/src/layers.rs index 514b8f75b..eaba5538d 100644 --- a/crates/ui-egui/src/layers.rs +++ b/crates/ui-egui/src/layers.rs @@ -199,7 +199,7 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { } icons::paint(ui.painter(), ar.shrink(5.0), Icon::Plus, t.icon); if aresp.clicked() { - app.ui.pages_focus = true; + app.ui.pages_focus = app.session.ds().ok().map(|d| d.uid); app.run("page.add", json!({})); } if !app.ui.pages_open { @@ -209,6 +209,7 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { let pages: Vec<(NodeId, String, bool)> = ds.doc.pages.iter().filter_map(|p| ds.doc.node(*p).map(|n| (*p, n.name.clone(), ds.doc.is_divider(*p)))).collect(); let cur = ds.page; + let uid = ds.uid; let sel = ds.selection.clone(); let mut select = None; let mut rename_done: Option<(NodeId, String)> = None; @@ -258,7 +259,7 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { } if resp.clicked() && !divider { select = Some(id); - app.ui.pages_focus = true; + app.ui.pages_focus = Some(uid); app.ui.layers_focus = false; } if resp.double_clicked() { @@ -1074,7 +1075,7 @@ fn layers(app: &mut FigApp, ui: &mut Ui) { } if let Some((id, m)) = clicked { app.ui.layers_focus = true; - app.ui.pages_focus = false; + app.ui.pages_focus = None; let order: Vec = rows.iter().map(|r| r.id).collect(); let pos = |x: NodeId| order.iter().position(|o| *o == x); let anchor = app.ui.layer_anchor.filter(|a| sel.contains(a)).and_then(pos); diff --git a/crates/ui-egui/src/layers_keys_tests.rs b/crates/ui-egui/src/layers_keys_tests.rs index d0b5f7860..48a6a5914 100644 --- a/crates/ui-egui/src/layers_keys_tests.rs +++ b/crates/ui-egui/src/layers_keys_tests.rs @@ -169,7 +169,7 @@ fn selected_layers_or_a_canvas_press_take_delete_back_from_the_pages_list() { u.button(row, true); u.button(row, false); assert_eq!(u.app.session.page().unwrap(), first); - assert!(u.app.ui.pages_focus); + assert!(u.app.ui.pages_focus.is_some()); // Layers selected after the click (Select all, say): Delete deletes them, not the page. u.app.run("select.set", json!({"ids": [a]})); key(&mut u, Key::Delete, false); @@ -179,7 +179,7 @@ fn selected_layers_or_a_canvas_press_take_delete_back_from_the_pages_list() { let p = pos2(900.0, 700.0); u.button(p, true); u.button(p, false); - assert!(!u.app.ui.pages_focus); + assert!(u.app.ui.pages_focus.is_none()); u.app.run("select.none", json!({})); key(&mut u, Key::Delete, false); assert_eq!(pages(&u), 2, "Delete with nothing selected on the canvas deletes no page"); diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 9a1cc3a83..702a87d6b 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -500,10 +500,10 @@ pub struct UiState { /// The layers panel has the keyboard: arrow keys move through its rows instead of nudging /// (set by a click on a row, cleared by a press on the canvas). pub layers_focus: bool, - /// The pages list has the keyboard: Delete with no layers selected deletes the current page (set - /// by a click on a page row or the add-page button, cleared by a click on a layer row or a press - /// on the canvas). - pub pages_focus: bool, + /// The file (its `uid`) whose pages list has the keyboard: Delete with no layers selected deletes + /// its current page (set by a click on a page row or the add-page button, cleared by a click on a + /// layer row or a press on the canvas). + pub pages_focus: Option, pub layers_seen_sel: Vec, pub dark: bool, pub follow_system: bool, @@ -638,7 +638,7 @@ impl Default for UiState { layer_filter: String::new(), layer_anchor: None, layers_focus: false, - pages_focus: false, + pages_focus: None, layers_seen_sel: Vec::new(), dark: false, follow_system: false, diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index dfdf290ae..a8961b222 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -118,7 +118,7 @@ pub fn invoke(app: &mut FigApp, id: &str) { // removes that interaction, not the layer (#767). "edit.delete" if app.ui_context.clone().is_some_and(|ctx| crate::proto_panel::delete_selected_interaction(app, &ctx)) => {} // After a click in the Pages list, with no layers selected, it deletes the current page (#859). - "edit.delete" if app.ui.pages_focus && app.session.selection().is_empty() => { + "edit.delete" if app.ui.pages_focus.is_some() && app.session.selection().is_empty() => { if let Ok(page) = app.session.page() { crate::layers::delete_page(app, page); } diff --git a/crates/ui-egui/src/selection_spacing.rs b/crates/ui-egui/src/selection_spacing.rs index c05b9ec3f..3048ab274 100644 --- a/crates/ui-egui/src/selection_spacing.rs +++ b/crates/ui-egui/src/selection_spacing.rs @@ -217,7 +217,7 @@ pub fn input(app: &mut FigApp, ctx: &egui::Context, pos: Option, hovered: let drag = Drag { ids, axis: axis.clone(), start: p, value: h.value, uid: ds.uid, page: ds.page, moved: false, last_value: axis.value }; app.ui.layers_focus = false; - app.ui.pages_focus = false; + app.ui.pages_focus = None; app.ui.key_box = None; ctx.memory_mut(|m| { if let Some(f) = m.focused() { From 9f895a37d55a925e8c269836c8cdbd7875e7fe24 Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Mon, 19 Oct 2026 11:48:35 +0200 Subject: [PATCH 328/817] fix(pages): Delete deletes no page once the Pages list is off screen The Pages list kept the keyboard after a switch to the Assets tab or to another open file, so Delete with nothing selected deleted a page there. It now deletes a page only while the list that was clicked is on screen (File tab, list expanded, panel and interface shown) and its file is the one open. --- crates/ui-egui/src/layers.rs | 7 +++++ crates/ui-egui/src/layers_keys_tests.rs | 38 +++++++++++++++++++++++++ crates/ui-egui/src/menus.rs | 5 ++-- 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/layers.rs b/crates/ui-egui/src/layers.rs index eaba5538d..e168da7de 100644 --- a/crates/ui-egui/src/layers.rs +++ b/crates/ui-egui/src/layers.rs @@ -315,6 +315,13 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { pages_edge(app, ui, moved.inner_rect.height().min(moved.content_size.y)); } +/// The Pages list has the keyboard: a page row (or the add-page button) of the open file was +/// clicked last, and the list is still on screen. +pub(crate) fn pages_have_keyboard(app: &FigApp) -> bool { + let Ok(ds) = app.session.ds() else { return false }; + app.ui.pages_focus == Some(ds.uid) && app.ui.pages_open && !app.ui.left_collapsed && !ds.view.ui_hidden && app.ui.left_tab == LeftTab::File +} + /// Delete `page` (no confirmation: Undo brings it back) and say so. pub(crate) fn delete_page(app: &mut FigApp, page: NodeId) { if app.run("page.delete", json!({"id": page})).is_some() { diff --git a/crates/ui-egui/src/layers_keys_tests.rs b/crates/ui-egui/src/layers_keys_tests.rs index 48a6a5914..71a1242dc 100644 --- a/crates/ui-egui/src/layers_keys_tests.rs +++ b/crates/ui-egui/src/layers_keys_tests.rs @@ -184,3 +184,41 @@ fn selected_layers_or_a_canvas_press_take_delete_back_from_the_pages_list() { key(&mut u, Key::Delete, false); assert_eq!(pages(&u), 2, "Delete with nothing selected on the canvas deletes no page"); } + +#[test] +fn delete_deletes_no_page_once_the_pages_list_is_off_screen_or_another_file_is_open() { + let (mut u, ..) = setup(); + let first = u.app.session.page().unwrap(); + let second = id(u.app.session.execute("page.add", &json!({})).unwrap()); + u.app.session.execute("page.select", &json!({"id": first})).unwrap(); + u.frame(vec![]); + let row = page_row(&mut u, second, first); + let click = |u: &mut Ui| { + u.button(row, true); + u.button(row, false); + assert!(u.app.ui.pages_focus.is_some()); + }; + // The Assets tab, a collapsed Pages list, a collapsed left panel. + let hide: [fn(&mut Ui, bool); 3] = [ + |u, on| u.app.ui.left_tab = if on { crate::LeftTab::Assets } else { crate::LeftTab::File }, + |u, on| u.app.ui.pages_open = !on, + |u, on| u.app.ui.left_collapsed = on, + ]; + for (k, hide) in hide.iter().enumerate() { + click(&mut u); + hide(&mut u, true); + u.frame(vec![]); + key(&mut u, Key::Delete, false); + assert_eq!(pages(&u), 2, "case {k}: the list is off screen"); + hide(&mut u, false); + u.frame(vec![]); + } + // Another file open: its pages are safe. + click(&mut u); + u.app.run("file.new", json!({})); + u.app.run("page.add", json!({})); + u.frame(vec![]); + assert_eq!(pages(&u), 2); + key(&mut u, Key::Delete, false); + assert_eq!(pages(&u), 2, "the other file keeps its pages"); +} diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index a8961b222..244adcf1a 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -117,8 +117,9 @@ pub fn invoke(app: &mut FigApp, id: &str) { // Edit ▸ Delete (and the Delete binding) with an interaction open in the Prototype tab // removes that interaction, not the layer (#767). "edit.delete" if app.ui_context.clone().is_some_and(|ctx| crate::proto_panel::delete_selected_interaction(app, &ctx)) => {} - // After a click in the Pages list, with no layers selected, it deletes the current page (#859). - "edit.delete" if app.ui.pages_focus.is_some() && app.session.selection().is_empty() => { + // After a click in the Pages list, while the list is on screen and its file open, with no + // layers selected, it deletes the current page (#859). + "edit.delete" if crate::layers::pages_have_keyboard(app) && app.session.selection().is_empty() => { if let Ok(page) = app.session.page() { crate::layers::delete_page(app, page); } From e17fccd7abe5419c19869dc3ed70899dd7eb6981 Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Mon, 19 Oct 2026 11:50:07 +0200 Subject: [PATCH 329/817] fix(pages): a second Delete after deleting layers keeps the page After a click in the Pages list, layers selected since (Select all, say) took the first Delete, which left nothing selected, so a second Delete deleted the page. Delete that doesn't take the page now ends the Pages list's hold on the keyboard. --- crates/ui-egui/src/layers_keys_tests.rs | 7 +++++++ crates/ui-egui/src/menus.rs | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/crates/ui-egui/src/layers_keys_tests.rs b/crates/ui-egui/src/layers_keys_tests.rs index 71a1242dc..63f8ce74c 100644 --- a/crates/ui-egui/src/layers_keys_tests.rs +++ b/crates/ui-egui/src/layers_keys_tests.rs @@ -175,7 +175,14 @@ fn selected_layers_or_a_canvas_press_take_delete_back_from_the_pages_list() { key(&mut u, Key::Delete, false); assert_eq!(pages(&u), 2); assert!(u.app.session.doc().unwrap().node(a).is_none()); + // Nothing is selected now, but the list gave up the keyboard: a second Delete keeps the page. + assert!(u.app.ui.pages_focus.is_none()); + key(&mut u, Key::Delete, false); + assert_eq!(pages(&u), 2, "a second Delete keeps the page"); // A press on the canvas gives Delete back to it. + u.button(row, true); + u.button(row, false); + assert!(u.app.ui.pages_focus.is_some()); let p = pos2(900.0, 700.0); u.button(p, true); u.button(p, false); diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 244adcf1a..0d83024a4 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -124,6 +124,12 @@ pub fn invoke(app: &mut FigApp, id: &str) { crate::layers::delete_page(app, page); } } + // Otherwise the list gives up the keyboard: once Delete has taken layers selected since the + // click (Select all, say), a second Delete must not take the page. + "edit.delete" if app.ui.pages_focus.is_some() => { + app.ui.pages_focus = None; + app.run(id, json!({})); + } "file.open" => app.open_dialog(), "plugin.import" => crate::plugins_ui::import_dialog(app), "file.import" => app.import_dialog(false), From 1b66fec3ece5123e21ba6680ff11d0e8182edebb Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Mon, 19 Oct 2026 12:12:54 +0200 Subject: [PATCH 330/817] fix(text): the caret after a line break sits on the next line `caret` put the index right after a line break (a newline, or a line separator) at the end of the line above, so after Enter the caret showed on the previous line until something was typed, and Up/Down counted lines from there. The index before the break stays at the end of its line; the one after it is now on the next line, as after a wrap. Selection highlights already started such lines at their own start (#665); their comment no longer describes the old caret. --- crates/text/src/layout.rs | 13 ++++--------- crates/text/src/tests.rs | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/crates/text/src/layout.rs b/crates/text/src/layout.rs index f9139f6fb..014bb1cde 100644 --- a/crates/text/src/layout.rs +++ b/crates/text/src/layout.rs @@ -1171,16 +1171,12 @@ impl TextLayout { pub fn caret(&self, index: usize) -> (f64, usize) { for (li, line) in self.lines.iter().enumerate() { let last_line = li + 1 == self.lines.len(); + // A caret at a line's end belongs to the next line, whether the line wraps or ends with a + // line break (before the break it is still on this line: past its glyphs). let in_line = index >= line.char_start && (index < line.char_end || (last_line && index <= line.char_end)); - // A caret at the end of a soft-wrapped line belongs to the next line. - if !(in_line || index == line.char_end && line.break_after && !last_line) { + if !in_line { continue; } - if index == line.char_end && line.break_after && !last_line { - // Before the line break: end of this line. - let x = self.line_end_x(line); - return (x, li); - } let gl = self.glyphs.get(line.glyph_start..line.glyph_end).unwrap_or(&[]); for g in gl { if g.char_end == g.char_start { @@ -1303,8 +1299,7 @@ impl TextLayout { out.extend(Self::mixed_selection(gl, a, b, line)); continue; } - // From the line's own start: `caret(char_start)` after a hard break is the end of the - // line above. + // From the line's own start. let x0 = if a <= line.char_start { self.line_start_x(line) } else { self.caret(a).0 }; let x1 = if b >= line.char_end { // The last line has no paragraph break to show, so it ends at its glyphs. diff --git a/crates/text/src/tests.rs b/crates/text/src/tests.rs index f5eaab6bf..ebf5889ce 100644 --- a/crates/text/src/tests.rs +++ b/crates/text/src/tests.rs @@ -481,3 +481,19 @@ fn selection_after_a_line_break_starts_at_the_line_start() { // A break followed by text still doesn't highlight the next line's start. assert!(rect_on(&l, &l.selection_rects(0, 6), 1).is_none()); } + +#[test] +fn the_caret_after_a_line_break_sits_on_the_next_line() { + if !have_fonts() { + return; + } + // Before the break: the end of its line; after it: the start of the next (after Enter, the + // caret shows on the new line, and Up/Down count from there). + let l = layout(&TextData::new("ab\ncd"), None, None); + assert_eq!(l.caret(2).1, 0); + assert!(l.caret(2).0 > 0.0); + assert_eq!(l.caret(3), (0.0, 1)); + // A trailing break: the caret sits on the empty last line. + let l = layout(&TextData::new("ab\n"), None, None); + assert_eq!(l.caret(3), (0.0, 1)); +} From b930ea5871ab6b7cc11a92c86a7ba787b8461609 Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Mon, 19 Oct 2026 12:13:12 +0200 Subject: [PATCH 331/817] test(text): the caret's line on either side of a line separator (#852) --- crates/text/src/line_separator_tests.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/text/src/line_separator_tests.rs b/crates/text/src/line_separator_tests.rs index d5ad16b02..a7042483f 100644 --- a/crates/text/src/line_separator_tests.rs +++ b/crates/text/src/line_separator_tests.rs @@ -77,6 +77,10 @@ fn carets_and_clicks_treat_it_like_a_newline() { assert_eq!(ls.hit(x, line.top + 5.0), ln.hit(x, line.top + 5.0), "click at {x} on the line at {}", line.top); } } + // Before the separator: the end of the first line; after it: the start of the second. + assert_eq!(ls.caret(2).1, 0); + assert!(ls.caret(2).0 > 0.0); + assert_eq!(ls.caret(3), (0.0, 1)); // A click right of the first line lands before the separator, not after it. assert_eq!(ls.hit(ls.lines[0].width + 50.0, ls.lines[0].top + 5.0), 2); } From 40d7ce14ce94a86f6ad251624be43961f0adeb3c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2026 10:18:38 +0000 Subject: [PATCH 332/817] ci(deps): bump actions/checkout Bumps the actions group with 1 update in the / directory: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 4 to 7 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e613617a1..9700a8e91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: name: test (ubuntu-latest) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Install Linux system dependencies (egui/winit/rfd) run: | @@ -74,7 +74,7 @@ jobs: name: wasm32 check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: dtolnay/rust-toolchain@stable with: targets: wasm32-unknown-unknown From 3e83ae44b73bcff28880131dfb270ed67b478137 Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Mon, 19 Oct 2026 12:50:43 +0200 Subject: [PATCH 333/817] fix(pages): a prototype gesture on the canvas ends the Pages list focus --- crates/ui-egui/src/canvas.rs | 2 ++ crates/ui-egui/src/proto_canvas.rs | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 234b07b27..9adaf8ab6 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -490,6 +490,8 @@ fn zoom_tool(app: &mut FigApp, ui: &Ui, resp: &egui::Response, pos: Pos2, mods: /// then doesn't show. fn input(app: &mut FigApp, ui: &mut Ui, resp: &egui::Response) -> bool { if crate::proto_canvas::input(app, ui, resp) { + // A prototype gesture is a press on the canvas too: the Pages list gives up the keyboard. + app.ui.pages_focus = None; return true; } let ctx = ui.ctx().clone(); diff --git a/crates/ui-egui/src/proto_canvas.rs b/crates/ui-egui/src/proto_canvas.rs index 1187944df..5def6c2a9 100644 --- a/crates/ui-egui/src/proto_canvas.rs +++ b/crates/ui-egui/src/proto_canvas.rs @@ -282,6 +282,26 @@ pub fn input(app: &mut FigApp, ui: &egui::Ui, resp: &egui::Response) -> bool { mod tests { use super::*; + /// A press on a connection handle takes the keyboard from the Pages list, as a press anywhere + /// else on the canvas does, so a later Delete can't take the page (#859). + #[test] + fn a_press_on_a_connection_handle_ends_the_pages_list_focus() { + let mut s = figcraft_engine::Session::new(); + let a = s.execute("frame.create", &json!({"x": 0, "y": 0, "width": 200, "height": 150})).unwrap(); + let a = crate::present_tests::id(&a); + s.execute("select.set", &json!({"ids": [a]})).unwrap(); + let mut u = crate::present_tests::Ui::new(s); + u.app.ui.right_tab = RightTab::Prototype; + u.run("view.zoomSelection", json!({})); + u.frames(2, Vec::new); + u.app.ui.pages_focus = u.app.session.ds().ok().map(|d| d.uid); + let doc = u.app.session.doc().unwrap().clone(); + let (_, at) = *handles(&u.app, &doc, &[a]).first().unwrap(); + u.button(at, true); + assert!(u.app.ui.pages_focus.is_none()); + u.button(at, false); + } + #[test] fn curves_leave_the_facing_side() { let a = Rect::from_min_size(pos2(0.0, 0.0), vec2(50.0, 20.0)); From 6e7b63bc16e5e8a1b321fbb1ec19c6600ec4b8bd Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Mon, 19 Oct 2026 12:50:43 +0200 Subject: [PATCH 334/817] fix(pages): Delete that removes an interaction ends the Pages list focus --- crates/ui-egui/src/proto_editor_tests.rs | 23 +++++++++++++++++++++++ crates/ui-egui/src/proto_panel.rs | 2 ++ 2 files changed, 25 insertions(+) diff --git a/crates/ui-egui/src/proto_editor_tests.rs b/crates/ui-egui/src/proto_editor_tests.rs index c63e62c60..80d49616d 100644 --- a/crates/ui-egui/src/proto_editor_tests.rs +++ b/crates/ui-egui/src/proto_editor_tests.rs @@ -304,3 +304,26 @@ fn escape_closes_prototype_editor_without_deselecting_layer() { u.key(pos2(100.0, 100.0), egui::Key::Escape); assert!(u.app.session.selection().is_empty(), "selection cleared on third escape"); } + +/// After a click in the Pages list, Delete that removes an interaction ends the list's hold on the +/// keyboard: with the layer deselected afterwards, Delete doesn't take the page (#859). +#[test] +fn deleting_an_interaction_ends_the_pages_list_focus() { + let (s, _a, _b, btn) = setup(); + let mut u = Ui::new(s); + let first = u.app.session.page().unwrap(); + u.run("page.add", json!({})); + u.run("page.select", json!({"id": first})); + // As after a click on the page's row (layers_keys_tests clicks the real row). + u.app.ui.pages_focus = u.app.session.ds().ok().map(|d| d.uid); + u.app.ui.right_tab = crate::RightTab::Prototype; + u.run("select.set", json!({"ids": [btn]})); + crate::proto_panel::open_editor(&u.ctx, Some((btn, 0))); + u.frames(1, Vec::new); + u.key(pos2(100.0, 100.0), egui::Key::Delete); + assert_eq!(u.app.session.doc().unwrap().node(btn).unwrap().interactions.len(), 0); + assert!(u.app.ui.pages_focus.is_none()); + u.run("select.none", json!({})); + u.key(pos2(100.0, 100.0), egui::Key::Delete); + assert_eq!(u.app.session.doc().unwrap().pages.len(), 2, "the page stays"); +} diff --git a/crates/ui-egui/src/proto_panel.rs b/crates/ui-egui/src/proto_panel.rs index 85af66c59..111afa785 100644 --- a/crates/ui-egui/src/proto_panel.rs +++ b/crates/ui-egui/src/proto_panel.rs @@ -53,6 +53,8 @@ pub fn delete_selected_interaction(app: &mut FigApp, ctx: &egui::Context) -> boo return false; } open_editor(ctx, None); + // Delete went to the interaction, so a later one doesn't go to the Pages list. + app.ui.pages_focus = None; let ids = targets_for(app, node); app.run("proto.interaction.remove", json!({"ids": ids, "index": index})); true From 710c95e527e6b6fa35d28aac043c49472b7ebffc Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Mon, 19 Oct 2026 12:52:09 +0200 Subject: [PATCH 335/817] test(text): a selection across a line separator shows the break (#852) --- crates/text/src/line_separator_tests.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crates/text/src/line_separator_tests.rs b/crates/text/src/line_separator_tests.rs index a7042483f..6891f97b1 100644 --- a/crates/text/src/line_separator_tests.rs +++ b/crates/text/src/line_separator_tests.rs @@ -84,3 +84,14 @@ fn carets_and_clicks_treat_it_like_a_newline() { // A click right of the first line lands before the separator, not after it. assert_eq!(ls.hit(ls.lines[0].width + 50.0, ls.lines[0].top + 5.0), 2); } + +#[test] +fn a_selection_across_it_shows_the_break_like_a_newline() { + let (Some(sep), Some(nl)) = (text("ab\u{2028}cd"), text("ab\ncd")) else { return }; + let (ls, ln) = (layout(&sep, None, None), layout(&nl, None, None)); + let (before, across) = (ls.selection_rects(0, 2), ls.selection_rects(0, 5)); + assert_eq!((before.len(), across.len()), (1, 2)); + // Reaching past the separator adds the 4 px break mark at the first line's end. + assert!((across[0].width() - before[0].width() - 4.0).abs() < EPS, "{} {}", across[0].width(), before[0].width()); + assert_eq!(across, ln.selection_rects(0, 5)); +} From b7c9c712b1be155e6426e04673abdf4ca92a4dd9 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Mon, 19 Oct 2026 11:21:34 +0000 Subject: [PATCH 336/817] Reject server addresses whose port is not all ASCII digits Found while testing crates/collab-net/src/invite.rs:valid_host (around line 205) Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/collab-net/src/invite.rs | 3 ++- crates/collab-net/src/invite_tests.rs | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/collab-net/src/invite.rs b/crates/collab-net/src/invite.rs index 617ad5187..47ca18503 100644 --- a/crates/collab-net/src/invite.rs +++ b/crates/collab-net/src/invite.rs @@ -220,7 +220,8 @@ fn valid_host(s: &str) -> bool { return true; } let Some((name, port)) = s.rsplit_once(':') else { return false }; - port.parse::().is_ok_and(|p| p != 0) + port.bytes().all(|b| b.is_ascii_digit()) + && port.parse::().is_ok_and(|p| p != 0) && (1..=253).contains(&name.len()) && name.bytes().all(|b| b.is_ascii_alphanumeric() || b == b'-' || b == b'.') && !name.starts_with(['-', '.']) diff --git a/crates/collab-net/src/invite_tests.rs b/crates/collab-net/src/invite_tests.rs index 02017517d..d4d132963 100644 --- a/crates/collab-net/src/invite_tests.rs +++ b/crates/collab-net/src/invite_tests.rs @@ -123,3 +123,11 @@ proptest! { prop_assert_eq!(Invite::parse(&i.url()), Ok(i)); } } + +#[test] +fn port_must_be_all_digits() { + assert!(Endpoint::parse("ws://localhost:80/").is_ok()); + for bad in ["ws://localhost:+80/", "ws://localhost:-80/", "ws://localhost:/"] { + assert!(Endpoint::parse(bad).is_err(), "accepted {bad}"); + } +} From 0108a7c2f5dda45304320469caa0c8e36cac1d65 Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Mon, 19 Oct 2026 13:34:40 +0200 Subject: [PATCH 337/817] M3: copied components paste as instances within their file Co-Authored-By: Codex (GPT-6) --- crates/engine/src/cmd/edit.rs | 23 +++- .../engine/src/components_behaviour_tests.rs | 112 ++++++++++++++++++ crates/engine/src/lib.rs | 9 ++ 3 files changed, 143 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index a4769a35c..52ffc04a5 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -515,6 +515,13 @@ pub fn copy_to_clipboard(s: &mut Session, cmd: &str, ids: &[NodeId]) -> Result<( s.clipboard.source = Some(source); s.clipboard.source_path = source_path; s.clipboard.source_doc = uid; + s.clipboard.copied_components = nodes + .iter() + .filter(|(_, sub)| { + cmd == "edit.copy" && sub.first().is_some_and(|n| matches!(n.kind, NodeKind::Component { .. } | NodeKind::ComponentSet { .. })) + }) + .map(|(root, _)| *root) + .collect(); s.clipboard.nodes = nodes; s.clipboard.images = images; s.clipboard.bounds = bounds; @@ -593,7 +600,8 @@ fn paste_design_layers(s: &mut Session, p: &Value) -> Result { let (nodes, images, bounds) = copied(&doc, &tops); let props = s.clipboard.props.take(); // No open file has id 0. So paste treats this copy as a copy from a different file. - s.clipboard = crate::Clipboard { nodes, images, props, bounds, source_doc: 0, source: Some(doc), source_path: None }; + s.clipboard = + crate::Clipboard { nodes, images, props, bounds, source_doc: 0, source: Some(doc), source_path: None, copied_components: BTreeSet::new() }; let mut out = paste(s, p)?; if !other.issues.is_empty() { out["warnings"] = json!(other.issues); @@ -623,6 +631,7 @@ pub fn paste_into(s: &mut Session, parent: NodeId, at: Option<(f64, f64)>) -> Re } // From another file: its instances follow the mains this file can have. let foreign = clip.source.as_ref().filter(|_| s.ds().is_ok_and(|d| d.uid != clip.source_doc)); + let copy_local = s.ds()?.uid == clip.source_doc; let doc = s.doc_mut()?; for (k, v) in &clip.images { doc.images.entry(k.clone()).or_insert_with(|| v.clone()); @@ -636,6 +645,16 @@ pub fn paste_into(s: &mut Session, parent: NodeId, at: Option<(f64, f64)>) -> Re let mut out = Vec::new(); let mut all = BTreeMap::new(); for (root, nodes) in &clip.nodes { + if copy_local + && clip.copied_components.contains(root) + && let Some(n) = nodes.first().filter(|n| matches!(n.kind, NodeKind::Component { .. })) + && doc.node(*root).is_some_and(|n| matches!(n.kind, NodeKind::Component { .. })) + { + let instance = crate::components::create_instance(doc, *root, parent, 0.0, 0.0)?; + doc.get_mut(instance)?.transform = doc.world_transform(parent).inverse() * shift * n.transform; + out.push(instance); + continue; + } let mut map = BTreeMap::new(); for n in nodes { map.insert(n.id, doc.alloc_id()); @@ -661,10 +680,12 @@ fn paste(s: &mut Session, p: &Value) -> Result { // else in the frame's centre; otherwise in place on the page (or the viewport centre). let sel = s.selection(); let doc = s.doc()?; + let copy_local = s.ds()?.uid == s.clipboard.source_doc; let target = id(p, "parent").or_else(|| { sel.first() .copied() .filter(|i| sel.len() == 1 && doc.node(*i).is_some_and(|n| n.kind.is_frame_like() && !matches!(n.kind, NodeKind::Instance { .. }))) + .filter(|i| !copy_local || !s.clipboard.copied_components.iter().any(|root| doc.is_ancestor(*root, *i))) }); let parent = target.unwrap_or(page); let at = match (num(p, "x"), num(p, "y")) { diff --git a/crates/engine/src/components_behaviour_tests.rs b/crates/engine/src/components_behaviour_tests.rs index 15f660e1e..e068c6cff 100644 --- a/crates/engine/src/components_behaviour_tests.rs +++ b/crates/engine/src/components_behaviour_tests.rs @@ -82,6 +82,118 @@ fn text(n: &Node) -> &TextData { n.kind.text().unwrap() } +#[test] +fn copying_a_main_component_pastes_a_linked_instance() { + for command in ["edit.paste", "edit.pasteOver", "edit.pasteReplace"] { + let mut s = Session::new(); + let k = kit(&mut s); + ex(&mut s, "select.set", json!({"ids": [k.card]})); + ex(&mut s, "edit.copy", json!({})); + if command != "edit.paste" { + ex(&mut s, "select.set", json!({"ids": [k.inst]})); + } + let before = undo_len(&s); + let pasted = crate::params::id_of(&ex(&mut s, command, json!({}))["ids"][0]).unwrap(); + assert_eq!(component_of(&s, pasted), k.card, "{command}"); + assert_eq!(node(&s, pasted).parent, Some(s.page().unwrap())); + assert_eq!(node(&s, pasted).source, Some(k.card)); + assert_eq!(undo_len(&s), before + 1); + ex(&mut s, "edit.undo", json!({})); + assert!(s.doc().unwrap().node(pasted).is_none()); + ex(&mut s, "edit.redo", json!({})); + assert_eq!(component_of(&s, pasted), k.card); + ex(&mut s, "node.set", json!({"id": k.title, "props": {"characters": "Updated"}})); + assert_eq!(chars(&s, copy_of(&s, pasted, k.title)), "Updated"); + healthy(&s); + } +} + +#[test] +fn copying_a_variant_pastes_an_instance_but_copying_its_set_keeps_the_components() { + let mut s = Session::new(); + let (set, _, hover) = button_set(&mut s); + ex(&mut s, "select.set", json!({"ids": [hover]})); + ex(&mut s, "edit.copy", json!({})); + let pasted = crate::params::id_of(&ex(&mut s, "edit.paste", json!({}))["ids"][0]).unwrap(); + assert_eq!(component_of(&s, pasted), hover); + assert_eq!(node(&s, pasted).name, node(&s, set).name); + let NodeKind::Instance { props, .. } = &node(&s, pasted).kind else { panic!("pasted variant is not an instance") }; + assert_eq!(chars(&s, layer(&s, pasted, "Label").unwrap()), "Hover"); + assert_eq!(props["Show dot"], true); + assert_eq!(node(&s, pasted).parent, Some(s.page().unwrap())); + + ex(&mut s, "select.set", json!({"ids": [set]})); + ex(&mut s, "edit.copy", json!({})); + let copied_set = crate::params::id_of(&ex(&mut s, "edit.paste", json!({}))["ids"][0]).unwrap(); + assert!(matches!(node(&s, copied_set).kind, NodeKind::ComponentSet { .. })); + assert_eq!(node(&s, copied_set).parent, Some(s.page().unwrap())); + assert_eq!(kids(&s, copied_set).len(), 2); + for variant in kids(&s, copied_set) { + assert!(matches!(node(&s, variant).kind, NodeKind::Component { .. })); + assert!(!kids(&s, set).contains(&variant)); + } + healthy(&s); +} + +#[test] +fn cut_components_and_components_copied_to_another_file_remain_components() { + for (copy, undo_cut, new_file) in [("edit.cut", false, false), ("edit.cut", true, false), ("edit.copy", false, true)] { + let mut s = Session::new(); + let k = kit(&mut s); + ex(&mut s, copy, json!({"ids": [k.card]})); + if undo_cut { + ex(&mut s, "edit.undo", json!({})); + } + if new_file { + ex(&mut s, "file.new", json!({})); + } + let page = s.page().unwrap(); + let pasted = crate::params::id_of(&ex(&mut s, "edit.paste", json!({"parent": page}))["ids"][0]).unwrap(); + assert!(matches!(node(&s, pasted).kind, NodeKind::Component { .. }), "{copy}, undo={undo_cut}, new_file={new_file}"); + assert_eq!(kids(&s, pasted).len(), 3); + healthy(&s); + } +} + +#[test] +fn copying_a_component_does_not_link_to_an_id_reused_after_undo() { + let mut s = Session::new(); + let frame = idv(&ex(&mut s, "frame.create", json!({"width": 120, "height": 60, "name": "Copied main"}))); + let main = idv(&ex(&mut s, "component.create", json!({"ids": [frame]}))); + ex(&mut s, "edit.copy", json!({"ids": [main]})); + s.undo().unwrap(); + s.undo().unwrap(); + let other = idv(&ex(&mut s, "frame.create", json!({"width": 300, "height": 200, "name": "Unrelated main"}))); + ex(&mut s, "component.create", json!({"ids": [other]})); + assert_eq!(other, main, "undo makes the original id available again"); + let page = s.page().unwrap(); + let pasted = crate::params::id_of(&ex(&mut s, "edit.paste", json!({"parent": page}))["ids"][0]).unwrap(); + assert_eq!(node(&s, pasted).name, "Copied main"); + assert_eq!((node(&s, pasted).width, node(&s, pasted).height), (120.0, 60.0)); + assert!(matches!(node(&s, pasted).kind, NodeKind::Component { .. })); + healthy(&s); +} + +#[test] +fn pasted_component_instances_keep_the_copied_transform_in_the_target_frame() { + let mut s = Session::new(); + let k = kit(&mut s); + ex(&mut s, "node.set", json!({"id": k.card, "props": {"rotation": 30}})); + let original = s.doc().unwrap().world_transform(k.card); + let frame = idv(&ex(&mut s, "frame.create", json!({"x": -100, "y": -100, "width": 1000, "height": 1000}))); + ex(&mut s, "edit.copy", json!({"ids": [k.card]})); + let pasted = crate::params::id_of(&ex(&mut s, "edit.paste", json!({"parent": frame}))["ids"][0]).unwrap(); + assert_eq!(component_of(&s, pasted), k.card); + for (actual, expected) in s.doc().unwrap().world_transform(pasted).as_coeffs().into_iter().zip(original.as_coeffs()) { + assert!((actual - expected).abs() < 1e-9); + } + assert_eq!(node(&s, pasted).parent, Some(frame)); + let before = s.doc().unwrap().clone(); + assert!(s.execute("edit.paste", &json!({"parent": k.card})).is_err()); + assert_eq!(s.doc().unwrap(), &before, "pasting into the main is refused atomically"); + healthy(&s); +} + #[test] fn overridable_properties_stay_through_main_edits_and_reset() { // (what, layer, group, override on the instance, the same property edited on the main, read, diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 312c2e878..cf5698011 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -735,6 +735,8 @@ pub struct Clipboard { /// The page-space bounds of the copied selection. pub bounds: Option, pub source_doc: u64, + /// Copied component/set roots, excluding cuts and originals discarded by undo (ids are reused). + pub copied_components: std::collections::BTreeSet, /// The document copied from (pastes into other files follow its mains) and its file path. pub source: Option>, pub source_path: Option, @@ -1166,6 +1168,13 @@ impl Session { } ds.clean_selection(); ds.revision += 1; + let (uid, doc) = (ds.uid, ds.doc.clone()); + if self.clipboard.source_doc == uid { + self.clipboard.copied_components.retain(|id| { + doc.node(*id) + .is_some_and(|n| matches!(n.kind, figcraft_doc::NodeKind::Component { .. } | figcraft_doc::NodeKind::ComponentSet { .. })) + }); + } Ok(true) } From 41c123657e0771358ed2ed5bcec797596e96132f Mon Sep 17 00:00:00 2001 From: Davit Matchakhelidze Date: Mon, 19 Oct 2026 15:25:00 +0400 Subject: [PATCH 338/817] i18n: Georgian (ka) interface language MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds crates/ui-egui/locales/ka.toml (ქართული): every key of en.toml (1,730 UI strings), every command label (567) and every menu wording (31), marked as a draft. Georgian has no letter case and keeps a noun singular after a numeral, so plural entries give the same text for one and other. System picks it for ka, ka-GE and ka_GE.UTF-8; pref.language's help text lists ka. Inter and egui's fonts have no Georgian, so the UI draws it in craft-fonts' Noto Sans Georgian: it joins the built-in faces in theme::install_fonts and the web build keeps it (crates/text/build.rs). craft-fonts-ref moves to a71c20e3 (storytold/craft-fonts#27, the commit that adds the face) in the release and FreeBSD workflows, and the release builds the web version with craft-fonts (web-craft-fonts: true). Tests: the Georgian locale tags, draft status and count-neutral plurals, and that the built-in Georgian face draws every Georgian letter in the catalog (skipped without craft-fonts). Docs: localization-parity, translating, mcp, README and ROADMAP. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YMTAbGNRxnMEzRvYnQGphF --- .github/workflows/freebsd.yml | 2 +- .github/workflows/release.yml | 3 +- README.md | 2 +- ROADMAP.md | 2 +- crates/engine/src/cmd/view.rs | 2 +- crates/text/build.rs | 6 +- crates/ui-egui/locales/ka.toml | 2344 ++++++++++++++++++++++++++++++ crates/ui-egui/src/i18n_tests.rs | 35 + crates/ui-egui/src/theme.rs | 2 +- docs/localization-parity.md | 10 +- docs/mcp.md | 2 +- docs/translating.md | 18 +- 12 files changed, 2407 insertions(+), 21 deletions(-) create mode 100644 crates/ui-egui/locales/ka.toml diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index b01af0524..ff15bfbc4 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -32,4 +32,4 @@ jobs: uses: storytold/craft-common-actions/.github/workflows/freebsd.yml@main with: run-package-check: true - craft-fonts-ref: 43913056ce82a3fdad0ef69f6b88d1dc922a8104 + craft-fonts-ref: a71c20e30af613287c504f7e685ca8fad77752bc diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 75f7a5fae..e8444c525 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,8 +24,9 @@ jobs: with: app-name: figcraft app-title: FigCraft - craft-fonts-ref: 43913056ce82a3fdad0ef69f6b88d1dc922a8104 + craft-fonts-ref: a71c20e30af613287c504f7e685ca8fad77752bc has-server: true + web-craft-fonts: true version: ${{ inputs.version }} secrets: APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} diff --git a/README.md b/README.md index 0a2598984..ae4c9f24c 100644 --- a/README.md +++ b/README.md @@ -227,7 +227,7 @@ The desktop app also offers a loopback-only control channel (`figcraft --control - **Its own renderer:** tiny-skia on every core for the canvas and exports, with layer blending, effects and masks; booleans from linesweeper, geometry from kurbo, text from skrifa and HarfRust. - **Runs in the browser:** the whole engine and UI compile to WebAssembly. - **Accessible:** screen readers get names, roles, values and states for the tools, layer rows, fields, dropdowns, tabs and menus (AccessKit on desktop), F6 moves the keyboard between the toolbar, layers, canvas and properties (Tab within them, Escape back to the canvas), the system's reduce-motion setting is honoured, and panel text meets WCAG AA contrast in both themes. -- **Languages:** English, Russian and Turkish (reviewed by native speakers), and Spanish, French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Czech and Indonesian drafts, picked in Preferences or taken from the system or browser and switched live; adding a language is one catalog file ([`docs/translating.md`](docs/translating.md)). +- **Languages:** English, Russian and Turkish (reviewed by native speakers), and Spanish, French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Czech, Indonesian and Georgian drafts, picked in Preferences or taken from the system or browser and switched live; adding a language is one catalog file ([`docs/translating.md`](docs/translating.md)). - **Plugins:** sandboxed WebAssembly plugins (a metered, pure-Rust interpreter with a memory cap and no file or network access, in the browser too) that act through the same commands, each run one undo step, within the permissions their manifest asks for. A Rust SDK and three example plugins are in [`plugins/`](plugins); see [`docs/plugins.md`](docs/plugins.md). - **Live sessions (preview):** share the open file from the app (Share ▸ Start sharing: online through a server, or on your local network), give the others the short join code it shows (or the invite link), and edit it together: everyone's changes sync live, with cursors, selections, avatars and follow, and undo takes back only your own changes. Others join from the desktop app (invite links open it) or from the browser build. See [`docs/collab-protocol.md`](docs/collab-protocol.md). - **A server of your own (preview):** `figcraft-server` keeps a team's files, publishes them from the app (File ▸ Publish to server…, or Share ▸ Online with your server in Preferences) and hands out share links and join codes that let people edit or only view; files survive restarts and apps reconnect where they were. No accounts yet: links are the access. Releases ship it for Linux, and the desktop app joins over `wss://`; [hosting it on a rented Linux server](docs/server.md#deploy-on-a-linux-server) takes a systemd unit and Caddy or nginx (or Docker). See [`docs/server.md`](docs/server.md). diff --git a/ROADMAP.md b/ROADMAP.md index 8a587286d..a83c23473 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -111,7 +111,7 @@ native speakers' reviews of the six language drafts need people. | Korean | ko | 95% | draft (needs native review) | | Vietnamese | vi | 0% | none | -Percentages measured 2026-10-17 over 2,272 entries (strings added since a draft show English). Also shipped: Russian (`ru`, 99%, reviewed by VanTan), Swedish (`sv`, 99.6%, command labels since 2026-10-17; native review welcome), Turkish (`tr`, 99%) and Czech (`cs`, 99%, draft). Figma ships English, Japanese, Korean, French, German, Spanish and Portuguese +Percentages measured 2026-10-17 over 2,272 entries (strings added since a draft show English). Also shipped: Russian (`ru`, 99%, reviewed by VanTan), Swedish (`sv`, 99.6%, command labels since 2026-10-17; native review welcome), Turkish (`tr`, 99%), Czech (`cs`, 99%, draft) and Georgian (`ka`, 100%, draft). Figma ships English, Japanese, Korean, French, German, Spanish and Portuguese (Brazil); FigCraft has the localization layer, English and Spanish (Spain and Latin America), French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese and Indonesian drafts (Preferences ▸ Language; Traditional Chinese has no catalog; CJK UI diff --git a/crates/engine/src/cmd/view.rs b/crates/engine/src/cmd/view.rs index 69b938e91..fbc2c54dd 100644 --- a/crates/engine/src/cmd/view.rs +++ b/crates/engine/src/cmd/view.rs @@ -409,7 +409,7 @@ pub fn specs() -> Vec { spec!( "pref.language", "Interface language", - "{language: system|en|cs|ru|es|es-419|fr|de|pt-BR|ja|ko|zh-Hans|…; else English}", + "{language: system|en|cs|ru|es|es-419|fr|de|pt-BR|ja|ka|ko|zh-Hans|…; else English}", false, |s, p| { let lang = req_string("pref.language", p, "language")?; diff --git a/crates/text/build.rs b/crates/text/build.rs index d02defefe..a3f4c6125 100644 --- a/crates/text/build.rs +++ b/crates/text/build.rs @@ -65,9 +65,9 @@ fn craft_fonts(dir: &std::path::Path, manifest_rel: &str) -> Result= 3 and not done" = "მაგ. count >= 3 and not done" +"elbowed and curved connectors without a saved path import as straight lines" = "შენახული ტრაექტორიის გარეშე კუთხოვანი და მრუდი შემაერთებლები სწორ ხაზებად იმპორტირდება" +"entries without a node type were skipped" = "კვანძის ტიპის გარეშე ჩანაწერები გამოტოვებულია" +"figcraft:// links from a browser, chat or email open this app and join the session." = "ბრაუზერიდან, ჩატიდან ან ელფოსტიდან figcraft:// ბმულები ხსნის ამ აპს და უერთდება სესიას." +"filled areas of a vector with their own fill use the layer's fill" = "ვექტორის შევსებული არეები საკუთარი შევსებით შრის შევსებას იყენებს" +"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 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" = "ინსტანსის ჩანაცვლების თვისებები, რომელთა ნაგულისხმევი კომპონენტი ფაილში არ არის, გამოტოვებულია" +"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 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" = "ვექტორული ტრაექტორიის არასწორი ან ზედმეტად დიდი მონაცემები გამოტოვებულია" +"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" = "გამოსახულების ფილტრების ძველი კონტეინერი მხარდაუჭერელია; ფილტრების გარდაქმნა გამოტოვებულია" +"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" = "სლოტის არანაგულისხმევი პარამეტრები არ არის წარმოდგენილი და გამოტოვებულია" +"now" = "ახლა" +"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" = "პროტოტიპის ექსპრესიები იმ ცვლადებზე, რომლებიც ცვლადების 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" = "ცვლადის დაყენების მოქმედებები იმ ცვლადებზე, რომლებიც ცვლადების 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" = "ცვლადის რეჟიმის დაყენების მოქმედებები იმ კოლექციებზე ან რეჟიმებზე, რომლებიც ცვლადების JSON-ში არ არის, გამოტოვებულია" +"slot content assignment target is missing or is not slot content" = "სლოტის შიგთავსის მინიჭების სამიზნე აკლია ან სლოტის შიგთავსი არ არის" +"slot content assignment uses the empty GUID sentinel and was skipped" = "სლოტის შიგთავსის მინიჭება ცარიელ GUID მარკერს იყენებს და გამოტოვებულია" +"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" = "ცვლადების 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" = "ცვლადის ალიასები იმ ცვლადებზე, რომლებიც ცვლადების 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" = "ცვლადების მიბმები იმ ცვლადებზე, რომლებიც ცვლადების 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-ში ცვლადების განსაზღვრებები არ არის (გადაეცით ლოკალური ცვლადების 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" = "იმ კოლექციების ცვლადის რეჟიმები, რომლებიც ცვლადების JSON-ში არ არის, გამოტოვებულია" +"variable values that don't match their type (or composed colours) were skipped" = "ცვლადის მნიშვნელობები, რომლებიც თავიანთ ტიპს არ შეესაბამება (ან შედგენილი ფერები), გამოტოვებულია" +"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" = "უცნობი კონტურის შეერთების მქონე ვექტორული წერტილები შრის შეერთებას იყენებს" +"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" = "გუშინ" +"{instances} in {files}" = "{instances} — {files}" +"{language}: draft translation, waiting for a native speaker's review." = "{language}: თარგმანის მონახაზი, ელოდება მშობლიური ენის მცოდნის განხილვას." +"{length} bleed" = "ჭრისპირა არე: {length}" +"{month} {day}, {year}" = "{day} {month}, {year}" +"{name} cleared from the list" = "{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}\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} from {path}" = "{name} — {path}" +"{name} was removed from the server" = "{name} წაიშალა სერვერიდან" +"{name} · deleted on main" = "{name} · წაშლილია მთავარში" +"{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}, 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} files" = { one = "ფაილი: {n}", other = "ფაილი: {n}" } +"{n} hours ago" = { 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} 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}" = "{n} / {total}" +"{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} variables" = { 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}, არაფერია მონიშნული" +"{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}" +"{value} isn't a colour" = "{value} ფერი არ არის" +"{when} · edited" = "{when} · რედაქტირებულია" +"← ↑ → ↓" = "← ↑ → ↓" +"← → ↑ ↓" = "← → ↑ ↓" +"←" = "←" +"→, Space or N" = "→, Space ან N" +"↵" = "↵" +"⇥ / ⇧⇥" = "⇥ / ⇧⇥" +"⌘ arrows" = "⌘ ისრები" +"⌘ click" = "⌘ დაწკაპუნება" +"⌘ scroll" = "⌘ გადახვევა" +"⌥ drag" = "⌥ გადათრევა" +"All the fonts this file uses are installed" = "ამ ფაილის ყველა შრიფტი დაინსტალირებულია" +"Checking the fonts installed on this computer…" = "ამ კომპიუტერზე დაინსტალირებული შრიფტების შემოწმება…" +"Intensity" = "ძალა" +"Missing fonts" = "მიუწვდომელი შრიფტები" +"No files or templates match your search" = "ძიების შესაბამისი ფაილი ან შაბლონი არ მოიძებნა" +"Search files and templates" = "ფაილებისა და შაბლონების ძიება" +"Search results" = "ძიების შედეგები" +"This file uses fonts that aren't installed on this computer. Their text is drawn in a fallback font until you install them." = "ეს ფაილი იყენებს შრიფტებს, რომლებიც ამ კომპიუტერზე დაინსტალირებული არ არის. მათი ტექსტი სათადარიგო შრიფტით გამოისახება, სანამ მათ არ დააინსტალირებთ." +"Try another search, or browse templates." = "სცადეთ სხვა ძიება ან დაათვალიერეთ შაბლონები." +"only in a text style or variable" = "მხოლოდ ტექსტის სტილში ან ცვლადში" +"slot layers without a matching slot property were imported as frames" = "სლოტის შრეები, რომლებსაც შესაბამისი სლოტის თვისება არ აქვს, ჩარჩოებად იმპორტირდა" +"{n} text layers" = { one = "ტექსტის შრე: {n}", other = "ტექსტის შრე: {n}" } + +[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.roundToPixels" = "პიქსელებამდე დამრგვალება" +"arrange.spacing" = "ინტერვალი" +"arrange.tidy" = "მოწესრიგება" +"bool.exclude" = "მონიშნულის გამორიცხვა" +"bool.flatten" = "ლოგიკური ოპერაციის გაბრტყელება" +"bool.intersect" = "მონიშნულის გადაკვეთა" +"bool.subtract" = "მონიშნულის გამოკლება" +"bool.union" = "მონიშნულის გაერთიანება" +"branch.archive" = "განშტოების დაარქივება" +"branch.create" = "განშტოების შექმნა" +"branch.list" = "განშტოებების სია" +"branch.merge" = "განშტოების შერწყმა" +"branch.open" = "განშტოების გახსნა" +"branch.review" = "განშტოების განხილვა" +"branch.updateFromMain" = "მთავარიდან განახლება" +"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.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.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" = "მთავარი კომპონენტის აღდგენა" +"dev.compare" = "ცვლილებების შედარება" +"dev.focus" = "ფოკუსის ხედი" +"dev.resolveChange" = "ცვლილების გადაწყვეტა" +"dev.unfocus" = "ფოკუსის ხედიდან გასვლა" +"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.move" = "ეფექტის გადატანა" +"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.import" = "იმპორტი" +"file.new" = "ახალი დიზაინის ფაილი" +"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.move" = "შევსების გადატანა" +"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.gettingStarted" = "პირველი ნაბიჯები" +"help.about" = "FigCraft-ის შესახებ" +"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.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.showDimensions" = "ზომების ჩვენება ობიექტებზე" +"pref.userName" = "თქვენი სახელი კომენტარებში" +"proto.action.add" = "პროტოტიპის მოქმედების დამატება" +"proto.action.move" = "პროტოტიპის მოქმედების გადალაგება" +"proto.action.remove" = "პროტოტიპის მოქმედების წაშლა" +"proto.action.set" = "პროტოტიპის მოქმედების რედაქტირება" +"proto.closePreview" = "პროტოტიპის წინასწარი ნახვის დახურვა" +"proto.conditional.addBlock" = "„სხვა შემთხვევაში, თუ“ / „სხვა შემთხვევაში“-ს დამატება" +"proto.conditional.removeBlock" = "„თუ“ / „სხვა შემთხვევაში, თუ“ / „სხვა შემთხვევაში“-ს წაშლა" +"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.colors" = "მონიშნულის ფერები" +"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.move" = "კონტურის გადატანა" +"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" = "სტილის რედაქტირება" +"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.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.fonts" = "შრიფტების სია" +"text.italic" = "დახრილი" +"text.lineHeightDown" = "სტრიქონის სიმაღლის შემცირება" +"text.lineHeightUp" = "სტრიქონის სიმაღლის გაზრდა" +"text.missingFonts" = "მიუწვდომელი შრიფტები" +"text.link" = "ბმულის შექმნა" +"text.listIndent" = "სიის შეწევის გაზრდა" +"text.listOutdent" = "სიის შეწევის შემცირება" +"text.listStyle" = "სიის სტილი" +"text.maxLines" = "მაქს. სტრიქონები" +"text.numberList" = "დანომრილი სია" +"text.onPath" = "ტექსტი ტრაექტორიაზე" +"text.paragraphIndent" = "აბზაცის შეწევა" +"text.paragraphSpacing" = "აბზაცთა ინტერვალი" +"text.pathOptions" = "ტრაექტორიაზე ტექსტის პარამეტრები" +"text.preview" = "ტექსტის ცვლილების გადახედვა" +"text.removeFromPath" = "ტექსტის ტრაექტორიიდან მოხსნა" +"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.ellipse" = "ელიფსი" +"tool.frame" = "ჩარჩო" +"tool.hand" = "ხელი" +"tool.line" = "ხაზი" +"tool.move" = "გადაადგილება" +"tool.pen" = "კალამი" +"tool.pencil" = "ფანქარი" +"tool.pencilBrush" = "ფანქრის ფუნჯი" +"tool.place" = "ხელსაწყოთი განთავსება" +"tool.polygon" = "მრავალკუთხედი" +"tool.rectangle" = "მართკუთხედი" +"tool.scale" = "მასშტაბირება" +"tool.scaleAnchor" = "მასშტაბირების საყრდენი წერტილი" +"tool.section" = "სექცია" +"tool.set" = "ხელსაწყოს არჩევა" +"tool.shapeBuilder" = "ფიგურების კონსტრუქტორი" +"tool.slice" = "ნაჭერი" +"tool.star" = "ვარსკვლავი" +"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.flatten" = "გაბრტყელება" +"vector.join" = "მონიშნულის შეერთება" +"vector.offset" = "ტრაექტორიის წანაცვლება" +"vector.outlineStroke" = "კონტურის ფიგურად გარდაქმნა" +"vector.reverse" = "ტრაექტორიის მიმართულების შებრუნება" +"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.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.fullscreen" = "სრული ეკრანი" +"view.prototype" = "პროტოტიპის პანელი" +"view.rulers" = "სახაზავები" +"view.set" = "ხედის დაყენება" +"view.slices" = "ნაჭრები" +"view.snapGeometry" = "გეომეტრიაზე მიბმა" +"view.snapObjects" = "ობიექტებზე მიბმა" +"view.snapPixel" = "პიქსელურ ბადეზე მიბმა" +"view.themeDark" = "ბნელი თემა" +"view.themeLight" = "ღია თემა" +"view.themeSystem" = "სისტემის თემის მიყოლა" +"view.toggleUi" = "ინტერფეისის ჩვენება/დამალვა" +"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" = "ვიჯეტების სია" +"window.focus" = "ფანჯრის წინა პლანზე გადმოტანა" +"window.new" = "ახალი ფანჯარა" +"template.list" = "შაბლონების სია" + +[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/i18n_tests.rs b/crates/ui-egui/src/i18n_tests.rs index d4d81d7b9..98a3ac4ee 100644 --- a/crates/ui-egui/src/i18n_tests.rs +++ b/crates/ui-egui/src/i18n_tests.rs @@ -421,6 +421,41 @@ fn japanese_korean_and_chinese_have_no_plural_forms() { } } +#[test] +fn georgian_is_a_draft_with_count_neutral_plurals() { + let code = |pref: &str, system: Option<&str>| LANGS[resolve(pref, system)].code; + for tag in ["ka", "ka-GE", "ka_GE.UTF-8"] { + assert_eq!(code("system", Some(tag)), "ka", "{tag}"); + } + let ka = LANGS.iter().position(|l| l.code == "ka").unwrap(); + assert!(LANGS[ka].draft && LANGS[ka].name == "ქართული"); + // A noun stays singular after a numeral: both forms read the same where English counts in both. + for (k, t) in LANGS[ka].ui { + if let (Text::Plural { one: Some(one), other, .. }, Some(Text::Plural { one: Some(en_one), .. })) = (t, find(english().ui, k)) { + assert!(!en_one.contains("{n}") || one == other, "ka: {k:?}"); + } + } +} + +/// Release builds embed craft-fonts' Noto Sans Georgian (`theme::install_fonts`' built-in faces), +/// since Inter and egui's fonts have no Georgian: it draws every Georgian letter the catalog uses. +#[test] +fn the_built_in_georgian_face_draws_the_georgian_catalog() { + let Some(face) = figcraft_text::find_face("Noto Sans Georgian", "Regular").filter(|f| f.family == "Noto Sans Georgian") else { + eprintln!("built without craft-fonts' Noto Sans Georgian; skipping"); + return; + }; + let ka = &LANGS[LANGS.iter().position(|l| l.code == "ka").unwrap()]; + let georgian = |c: &char| matches!(u32::from(*c), 0x10A0..=0x10FF | 0x1C90..=0x1CBF | 0x2D00..=0x2D2F); + let mut letters: BTreeSet = BTreeSet::new(); + for (_, t) in ka.ui.iter().chain(ka.commands).chain(ka.menu) { + letters.extend(forms(t).into_iter().flat_map(str::chars).filter(georgian)); + } + assert!(letters.len() > 30, "{letters:?}"); + let missing: String = letters.iter().filter(|c| !face.has_char(**c)).collect(); + assert!(missing.is_empty(), "no glyph for {missing:?}"); +} + #[test] fn chinese_reads_simplified_and_traditional_has_no_catalog() { let code = |pref: &str, system: Option<&str>| LANGS[resolve(pref, system)].code; diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rs index a4fa87544..dfdacd2d1 100644 --- a/crates/ui-egui/src/theme.rs +++ b/crates/ui-egui/src/theme.rs @@ -253,7 +253,7 @@ pub fn install_fonts(ctx: &Context, system: bool, cjk: u8) { semi.extend(fonts.families.get(&FontFamily::Proportional).cloned().unwrap_or_default()); fonts.families.insert(FontFamily::Name("semibold".into()), semi); // CJK and other scripts from craft-fonts as fallbacks (Noto Sans CJK only with FIGCRAFT_EMBED_CJK). - const BUILT_IN: [&str; 4] = ["Inter", "BIZ UDPGothic", "Noto Sans CJK SC", "Noto Sans Arabic"]; + const BUILT_IN: [&str; 5] = ["Inter", "BIZ UDPGothic", "Noto Sans CJK SC", "Noto Sans Arabic", "Noto Sans Georgian"]; let lang = crate::i18n::current().map_or("en", |l| l.code); // A Chinese UI draws Han in a Chinese face: the built-in Japanese one goes after the system faces. let late = |family: &str| family == "BIZ UDPGothic" && crate::cjk::language(lang) == crate::cjk::HAN; diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 50fcd4ec3..ccf8c22ac 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -1,10 +1,10 @@ # Localization parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (macOS finds its downloadable CJK system fonts (#406); string counts re-measured: 2,272 entries, the drafts at 95–99%; Swedish command labels and menu wordings; Russian, Swedish, Turkish, Czech and Indonesian listed; a duplicated paragraph removed; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-19 · **Change:** minor (Georgian (`ka`) draft catalog; macOS finds its downloadable CJK system fonts (#406); string counts re-measured: 2,272 entries, the drafts at 95–99%; Swedish command labels and menu wordings; Russian, Swedish, Turkish, Czech and Indonesian listed; a duplicated paragraph removed; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog) · **Target:** Figma Design (desktop app 126.10.7) FigCraft's interface has a localization layer with an English catalog, a Russian catalog reviewed by a native speaker, and Spanish (with a Latin American overlay), French, German, Brazilian -Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Czech drafts (machine-drafted, +Portuguese, Japanese, Korean, Simplified Chinese, Indonesian, Czech and Georgian drafts (machine-drafted, waiting for native speakers' review), plus Swedish and Turkish catalogs. This page lists the twelve key languages of the craftrules standard, then the other languages Figma ships. How to add a language: [`translating.md`](translating.md). @@ -32,7 +32,7 @@ supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no v channel stay English. Accessibility names come from the same strings. - **Language preference:** Preferences ▸ Language (System, then each catalog by its own name: English, Čeština, Deutsch, Español, Español (Latinoamérica), Français, Bahasa Indonesia, 日本語, - 한국어, Português (Brasil), Русский, Svenska, Türkçe, 简体中文), applied at once without a + ქართული, 한국어, Português (Brasil), Русский, Svenska, Türkçe, 简体中文), applied at once without a restart; System takes the first of the OS's preferred languages that has a catalog (on Windows only the first preferred language counts, since that list also holds the languages added for a keyboard; macOS AppleLanguages, `LANGUAGE` then the locale variables on Linux and BSD; a regional @@ -102,7 +102,9 @@ Other languages (measured 2026-10-17): Russian (`ru`) 2,244 / 2,272 (98.8%), rev by VanTan, one/few/many integer plurals; Swedish (`sv`) 2,264 (99.6%), its command labels and menu wordings added 2026-10-17 (#599), native review welcome; Turkish (`tr`) 2,243 (98.7%), whose header says it was machine-drafted and reviewed by a native speaker; Czech (`cs`) 2,244 (98.8%), a draft -with one/few/other plurals. Figma ships none beyond the eight above. +with one/few/other plurals; Georgian (`ka`) 2,328 / 2,328 (100%, measured 2026-10-19), a draft +whose plural entries read the same for one and other (a noun stays singular after a count), its UI +text in craft-fonts' Noto Sans Georgian (built in, on the web too). Figma ships none beyond the eight above. The layer is done. Per-language hours above are agent hours for a catalog of ~1,800 entries (a machine draft, then a pass over the panels for overflow), plus each language's plural rule where diff --git a/docs/mcp.md b/docs/mcp.md index c5ffe99f5..b9f30922f 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -419,7 +419,7 @@ on; `key` resolves keys the way the canvas does. Commands behind keys: accessibility setting turns it on too). Prototype transitions still play. - `pref.autoSave {on?}`: files that have a path save themselves a few seconds after they change (off by default; the desktop app's timer does it, so scripts still call `file.save`). -- `pref.language {language: system|en|cs|ru|es|es-419|fr|de|pt-BR|ja|ko|zh-Hans|…}`: the app's interface language, applied live ("system": +- `pref.language {language: system|en|cs|ru|es|es-419|fr|de|pt-BR|ja|ka|ko|zh-Hans|…}`: the app's interface language, applied live ("system": - `pref.language {language: system|en|es|es-419|fr|de|pt-BR|ja|ko|sv|zh-Hans|…}`: the app's interface language, applied live ("system": the OS or browser language; a language without a catalog shows English). Command ids, labels and every result stay English. diff --git a/docs/translating.md b/docs/translating.md index d8addcbc7..2d186770f 100644 --- a/docs/translating.md +++ b/docs/translating.md @@ -16,8 +16,8 @@ Simplified. The catalogs: English (`en`, the source), and Spanish (`es`, with the Latin American overlay `es-419`), French (`fr`), German (`de`), Dutch (`nl`), Brazilian Portuguese (`pt-BR`), Japanese -(`ja`), Korean (`ko`), Simplified Chinese (`zh-Hans`), Czech (`cs`), Indonesian (`id`) and Finnish -(`fi`), machine-drafted and waiting for native speakers' review. Russian (`ru`, Русский) was +(`ja`), Korean (`ko`), Simplified Chinese (`zh-Hans`), Czech (`cs`), Indonesian (`id`), Finnish +(`fi`) and Georgian (`ka`), machine-drafted and waiting for native speakers' review. Russian (`ru`, Русский) was reviewed and approved by VanTan; its catalog keeps Frame, Dev Mode 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. @@ -57,14 +57,18 @@ komponenta, instance, varianta, automatické rozvržení, omezení, výplň, tah proměnná, styl). Indonesian uses bare imperatives for buttons and menu items (Simpan, Hapus), the formal Anda (never kamu), keeps established design terms in English (frame, layer, component, instance, auto layout, plugin, file) and keeps a noun unchanged after a count, so its plural entries -give only `other`. +give only `other`. Georgian has no letter case (never write Mtavruli for capitals), uses verbal nouns +for commands (გვერდის დამატება) and keeps a noun singular after a numeral, so counts read +"შრე: {n}" and its plural entries give the same text for `one` and `other`. CJK text needs a CJK font, which egui and Inter lack: the desktop app adds an installed one when something on screen needs it (see `crates/ui-egui/src/cjk.rs`). The web build has no system fonts, so Japanese, Korean and Chinese appear there only in a build with craft-fonts and `FIGCRAFT_EMBED_CJK=1` (Noto Sans CJK SC, +16 MB); otherwise they are left out of the picker. A -Chinese UI puts its Chinese face first so Han takes Simplified Chinese shapes. A new CJK or other non-Latin -language also needs its script in `cjk::language`. +Chinese UI puts its Chinese face first so Han takes Simplified Chinese shapes. Georgian is drawn in +craft-fonts' Noto Sans Georgian, one of the built-in faces in `theme::install_fonts` (and kept in +web builds by `crates/text/build.rs`). A new CJK or other non-Latin language also needs its script in +`cjk::language`, or a built-in craft-fonts face. ## Adding a language @@ -84,8 +88,8 @@ language also needs its script in `cjk::language`. 4. To require full coverage, add the code to `COMPLETE` in [`crates/ui-egui/src/i18n_tests.rs`](../crates/ui-egui/src/i18n_tests.rs). Every later PR that adds a string then has to translate it into each complete language, so only Spanish is there: - French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Czech and Indonesian - are registered as drafts, Russian and Turkish are reviewed but not required, and a string added + French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Czech, Indonesian and + Georgian are registered as drafts, Russian and Turkish are reviewed but not required, and a string added later shows English in them until it is translated. To list what a draft lacks, add its code to `COMPLETE` locally and run the check. 5. Run the check and look at the panels in the app (longer words must fit the right panel): From 6a163721dcf5eb98f36b482aeeaa926b23646625 Mon Sep 17 00:00:00 2001 From: justinjohn0306 Date: Mon, 19 Oct 2026 17:33:29 +0530 Subject: [PATCH 339/817] M3: explicit edits of bound scalar fields detach their variable (#809) An explicit edit of a bound width, height, opacity, gap, padding, corner radius, stroke weight, arc or text field reported ok, but normalize wrote the variable's value straight back. Now the edit sticks and that field's binding is dropped, as paint edits already do. - `styles::bound_before` / `detach_edited`: compare each layer-level bound field's stored value before and after the edit (`bound_field`), so keys written unchanged keep their bindings and fields moved along with another (proportions, min/max) lose theirs. A binding the edit itself made (`boundVariables`) stays. List and component property bindings are left to their own rules. - Hooked into node.set, transform.resize, object.opacityKeys, text.style and `Session::preview` (canvas drags of the selected layers). Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/arrange.rs | 2 + crates/engine/src/cmd/edit.rs | 10 +- crates/engine/src/cmd/styles.rs | 98 +++++++++++++++++++ crates/engine/src/cmd/text.rs | 2 + crates/engine/src/lib.rs | 3 + .../engine/src/variables_behaviour_tests.rs | 54 ++++++++++ docs/mcp.md | 5 +- docs/target-app-parity.md | 1 + 8 files changed, 172 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/cmd/arrange.rs b/crates/engine/src/cmd/arrange.rs index ad6c21d12..22c9c181e 100644 --- a/crates/engine/src/cmd/arrange.rs +++ b/crates/engine/src/cmd/arrange.rs @@ -528,6 +528,7 @@ pub(crate) fn resize_cmd(s: &mut Session, p: &Value) -> Result { let (col, row) = string(p, "anchor").and_then(|a| crate::tools::anchor_of(&a)).unwrap_or((0, 0)); let (ax, ay) = (f64::from(col) / 2.0, f64::from(row) / 2.0); let doc = s.doc_mut()?; + let before = super::styles::bound_before(doc, &ids); for i in ids { let n = doc.get(i)?; let (ow, oh) = (n.width, n.height); @@ -551,6 +552,7 @@ pub(crate) fn resize_cmd(s: &mut Session, p: &Value) -> Result { } super::props::restore_worlds(doc, &kept)?; } + super::styles::detach_edited(doc, &before); ok() } diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index a4769a35c..ef63a31a7 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -931,9 +931,13 @@ pub fn opacity_from_digits(digits: &str) -> Option { fn opacity_keys(s: &mut Session, p: &Value) -> Result { let digits = req_string("object.opacityKeys", p, "digits")?; let o = opacity_from_digits(&digits).ok_or_else(|| bad("object.opacityKeys", "`digits` must be one or two digits"))?; - for i in req_targets("object.opacityKeys", s, p)? { - s.doc_mut()?.get_mut(i)?.opacity = o; + let ids = req_targets("object.opacityKeys", s, p)?; + let doc = s.doc_mut()?; + let before = super::styles::bound_before(doc, &ids); + for i in ids { + doc.get_mut(i)?.opacity = o; } + super::styles::detach_edited(doc, &before); Ok(json!({"opacity": o})) } @@ -1181,10 +1185,12 @@ fn set(s: &mut Session, p: &Value) -> Result { } } let doc = s.doc_mut()?; + let before = super::styles::bound_before(doc, &ids); for i in ids { let props = if skipped.contains(&i) { &without_layout } else { &props }; super::props::apply("node.set", doc, i, props)?; } + super::styles::detach_edited(doc, &before); if let Some(o) = pivot { for (i, q) in pinned { let d = o - doc.world_transform(i) * q; diff --git a/crates/engine/src/cmd/styles.rs b/crates/engine/src/cmd/styles.rs index adeb22506..c449cace8 100644 --- a/crates/engine/src/cmd/styles.rs +++ b/crates/engine/src/cmd/styles.rs @@ -950,6 +950,104 @@ pub fn apply_bindings_to(doc: &mut Document, only: Option<&std::collections::BTr apply_bindings_matching(doc, only, |_| true); } +/// The layers `ids` before an explicit edit, for [`detach_edited`] (only those with bindings). +pub(crate) fn bound_before(doc: &Document, ids: &[NodeId]) -> Vec> { + ids.iter().filter_map(|i| doc.node_arc(*i)).filter(|n| !n.bound.is_empty()).cloned().collect() +} + +/// An explicit edit sticks: each layer's own bound field (not a list item's) whose value the edit +/// changed drops its binding, which would otherwise write the variable's value back (#809). +/// Compared by value, so keys written unchanged keep their bindings and fields moved along with +/// another (proportions, min/max) lose theirs. +pub(crate) fn detach_edited(doc: &mut Document, before: &[std::sync::Arc]) { + for old in before { + let Some(n) = doc.node(old.id) else { continue }; + let edited: Vec = n + .bound + .keys() + // A binding the edit itself made (`boundVariables`) stays. + .filter(|f| old.bound.get(*f) == n.bound.get(*f)) + .filter(|f| super::lists::list_binding(f).is_none() && !f.starts_with(crate::components::PROP_BINDING)) + .filter(|f| bound_field(old, f) != bound_field(n, f)) + .cloned() + .collect(); + if edited.is_empty() { + continue; + } + if let Ok(n) = doc.get_mut(old.id) { + for f in edited { + n.bound.remove(&f); + } + } + } +} + +/// The stored value a layer-level binding writes, comparable (`None`: the layer has no such field). +fn bound_field(n: &Node, field: &str) -> Option { + let text = |f: &dyn Fn(&TextStyle) -> String| match &n.kind { + NodeKind::Text(t) => Some(std::iter::once(&t.style).chain(t.runs.iter().map(|r| &r.style)).map(f).collect::>().join(",")), + _ => None, + }; + let layout = n.layout.as_ref(); + let cl = &n.child_layout; + let pad = |i: usize| layout.and_then(|l| l.padding.get(i).copied()); + Some(match field { + "width" => format!("{}", n.width), + "height" => format!("{}", n.height), + "minWidth" => format!("{:?}", cl.min_w), + "maxWidth" => format!("{:?}", cl.max_w), + "minHeight" => format!("{:?}", cl.min_h), + "maxHeight" => format!("{:?}", cl.max_h), + "opacity" => format!("{}", n.opacity), + "visible" => format!("{}", n.visible), + "gap" | "columnGap" => format!("{:?}", layout.map(|l| l.gap)), + "crossGap" | "rowGap" => format!("{:?}", layout.map(|l| l.cross_gap)), + "padding" => format!("{:?}", layout.map(|l| l.padding)), + "paddingTop" => format!("{:?}", pad(0)), + "paddingRight" => format!("{:?}", pad(1)), + "paddingBottom" => format!("{:?}", pad(2)), + "paddingLeft" => format!("{:?}", pad(3)), + "paddingHorizontal" => format!("{:?}", (pad(1), pad(3))), + "paddingVertical" => format!("{:?}", (pad(0), pad(2))), + "cornerRadius" => format!("{:?}", n.corners.radii), + "topLeftRadius" => format!("{:?}", n.corners.radii.first()), + "topRightRadius" => format!("{:?}", n.corners.radii.get(1)), + "bottomRightRadius" => format!("{:?}", n.corners.radii.get(2)), + "bottomLeftRadius" => format!("{:?}", n.corners.radii.get(3)), + "strokeWeight" => format!("{:?}", (n.stroke.weight, n.stroke.sides)), + "strokeTopWeight" | "strokeRightWeight" | "strokeBottomWeight" | "strokeLeftWeight" => format!("{:?}", n.stroke.sides), + "arcStart" | "arcSweep" | "arcInner" => match &n.kind { + NodeKind::Ellipse { start, sweep, inner } => format!( + "{}", + if field == "arcStart" { + start + } else if field == "arcSweep" { + sweep + } else { + inner + } + ), + _ => return None, + }, + "characters" => match &n.kind { + NodeKind::Text(t) => t.characters.clone(), + _ => return None, + }, + "paragraphSpacing" | "paragraphIndent" => match &n.kind { + NodeKind::Text(t) => format!("{}", if field == "paragraphSpacing" { t.paragraph_spacing } else { t.paragraph_indent }), + _ => return None, + }, + "fontFamily" => text(&|s| s.font_family.clone())?, + "fontStyle" => text(&|s| s.font_style.clone())?, + "fontWeight" => text(&|s| s.weight().to_string())?, + "fontSize" => text(&|s| s.font_size.to_string())?, + "lineHeight" => text(&|s| format!("{:?}", s.line_height))?, + "letterSpacing" => text(&|s| format!("{:?}", s.letter_spacing))?, + // shortcut: other layer-level fields keep their binding on edits; add a reader when one is bound in practice. + _ => return None, + }) +} + /// Imported files (`.fig`, REST) keep a solid paint's alpha in its opacity, a bound paint's too, /// while the bound colour brings its own alpha: take the variable's alpha back out of the opacity /// (styles' paints and layers') before the bindings are first resolved, so it applies once. diff --git a/crates/engine/src/cmd/text.rs b/crates/engine/src/cmd/text.rs index 3b861895a..a10e9265b 100644 --- a/crates/engine/src/cmd/text.rs +++ b/crates/engine/src/cmd/text.rs @@ -364,6 +364,7 @@ pub fn specs() -> Vec { let ids = req_targets("text.style", s, p)?; let m = p.as_object().cloned().unwrap_or_default(); let doc = s.doc_mut()?; + let before = super::styles::bound_before(doc, &ids); for i in ids { let n = doc.get_mut(i)?; let NodeKind::Text(t) = &mut n.kind else { return Err(bad("text.style", format!("{i} is not text"))) }; @@ -377,6 +378,7 @@ pub fn specs() -> Vec { super::props::apply_text_style("text.style", t, a, b, k, v)?; } } + super::styles::detach_edited(doc, &before); ok() } ), diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 312c2e878..29b40eaa9 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1098,8 +1098,11 @@ impl Session { let Some(it) = ds.interaction.clone() else { return Err(EngineError::Other("no gesture in progress".into())) }; let mut doc = (*it.doc).clone(); let mut sel = it.selection.clone(); + // What the gesture changes on the selected layers is an explicit edit. + let before = cmd::styles::bound_before(&doc, &it.selection); let res = f(&mut doc, &mut sel); if res.is_ok() { + cmd::styles::detach_edited(&mut doc, &before); normalize(&mut doc, &it.doc); // The same preview again (a handle held still) keeps the document: a new one would // re-render the canvas for nothing. diff --git a/crates/engine/src/variables_behaviour_tests.rs b/crates/engine/src/variables_behaviour_tests.rs index 5a868a637..45fda6a59 100644 --- a/crates/engine/src/variables_behaviour_tests.rs +++ b/crates/engine/src/variables_behaviour_tests.rs @@ -365,3 +365,57 @@ fn number_variables_are_pixels_and_edits_are_one_undo_step() { s.undo().unwrap(); assert_eq!(lh(&s), LineHeight::Pixels(20.0), "the value and the bound layer go back together"); } + +#[test] +fn explicit_edits_of_bound_fields_stick_and_detach_that_binding() { + // #809: an edit of a bound field detaches its binding (as a paint edit does) instead of + // the variable's value coming back; bindings whose value the edit kept stay. + let mut s = Session::new(); + run(&mut s, "variable.createCollection", json!({"name": "C"})); + let w = vid(run(&mut s, "variable.create", json!({"collection": "C", "name": "w", "type": "number", "value": 48}))); + let o = vid(run(&mut s, "variable.create", json!({"collection": "C", "name": "o", "type": "number", "value": 40}))); + let r = rect(&mut s, None); + for (field, v) in [("width", &w), ("height", &w), ("opacity", &o)] { + run(&mut s, "variable.bind", json!({"ids": [r], "field": field, "variable": v})); + } + assert_eq!((node(&s, r).width, node(&s, r).opacity), (48.0, 0.4)); + + run(&mut s, "node.set", json!({"ids": [r], "width": 100, "opacity": 0.4})); + let n = node(&s, r); + assert_eq!(n.width, 100.0); + assert!(!n.bound.contains_key("width")); + assert!(n.bound.contains_key("height") && n.bound.contains_key("opacity"), "unchanged values keep their bindings"); + + run(&mut s, "transform.resize", json!({"ids": [r], "height": 30})); + assert_eq!(node(&s, r).height, 30.0); + assert!(!node(&s, r).bound.contains_key("height")); + + run(&mut s, "object.opacityKeys", json!({"ids": [r], "digits": "9"})); + assert_eq!(node(&s, r).opacity, 0.9); + assert!(node(&s, r).bound.is_empty()); + + // A value set with its binding in the same call keeps the new binding. + run(&mut s, "node.set", json!({"ids": [r], "width": 5, "boundVariables": {"width": w}})); + assert_eq!((node(&s, r).width, node(&s, r).bound.get("width")), (48.0, Some(&w))); +} + +#[test] +fn a_gesture_or_a_text_style_on_a_bound_field_detaches_it() { + let mut s = Session::new(); + run(&mut s, "variable.createCollection", json!({"name": "C"})); + let v = vid(run(&mut s, "variable.create", json!({"collection": "C", "name": "r", "type": "number", "value": 8}))); + let r = rect(&mut s, None); + run(&mut s, "variable.bind", json!({"ids": [r], "field": "cornerRadius", "variable": v})); + s.begin_interaction("Edit").unwrap(); + let props = serde_json::Map::from_iter([("cornerRadius".to_string(), json!(2))]); + s.preview(|d, _| crate::cmd::props::apply("node.set", d, r, &props)).unwrap(); + s.commit_interaction().unwrap(); + assert_eq!(node(&s, r).corners.radii, [2.0; 4]); + assert!(node(&s, r).bound.is_empty()); + + let t = id(run(&mut s, "text.create", json!({"x": 0, "y": 0, "text": "Hi"}))); + run(&mut s, "variable.bind", json!({"ids": [t], "field": "fontSize", "variable": v})); + run(&mut s, "text.style", json!({"id": t, "fontSize": 20})); + assert!(node(&s, t).bound.is_empty()); + assert_eq!(node(&s, t).kind.text().unwrap().style.font_size, 20.0); +} diff --git a/docs/mcp.md b/docs/mcp.md index c5ffe99f5..00f5386d8 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -267,7 +267,10 @@ Or in a project's `.mcp.json`: `style.duplicate {style}` adds " copy" right below, `style.renameFolder {folder, name}`. - **Variables**: `variable.bind` refuses a variable of a type the field doesn't take (a colour on `width`); scopes only filter pickers. `variable.delete` / `variable.deleteCollection` unbind the - layers using them (they keep their last value) and give aliases to them their values. + layers using them (they keep their last value) and give aliases to them their values. An + explicit edit that changes a bound field's value (`node.set`, `transform.resize`, + `object.opacityKeys`, `text.style`, a canvas drag) detaches that field's variable; fields the edit + left as they were stay bound. `variable.addMode {from}` duplicates a mode, `variable.moveMode {collection, mode, to}` reorders (index 0 is the default mode, which layers on Auto follow). `variable.update {codeSyntax: {WEB?, iOS?, ANDROID?}}` sets code names (`""` clears); generated CSS uses the Web one. diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 16a5af69b..3e1e64b02 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -638,6 +638,7 @@ Carried over from the ROADMAP's "Shipped so far" (2026-10-10). The test count th | Date | Change | Summary | |---|---|---| +| 2026-10-19 | minor | Bound scalar fields (M3, #809): an explicit edit that changes a bound width, height, min/max size, opacity, visibility, gap, padding, corner radius, stroke weight, arc or text field (`node.set`, `transform.resize`, `object.opacityKeys`, `text.style`, canvas drags) detaches that binding instead of the variable's value coming back; compared by value, so fields the edit left alone stay bound. Numbers unchanged | | 2026-10-17 | minor | Menu breadth re-run with `cargo xtask parity`: 212 / 212 (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Rows for the 2026-10-17 landings: import/export (area 14) and the file formats dimension name the `.fig` import's new fidelity (instance identity, overrides by key, text style precedence, grid tracks, slots, connector labels, per-point joins, text on a path, image adjustments, list start numbers, vertical trim), budgets from the file's size, the import report, a `.fig` copy from Save as and paste from another design app; the localization evidence takes the re-measured catalog counts (2,272 entries, drafts at 95–99%, Indonesian and Czech drafts, Swedish and Turkish catalogs); the Automation line adds control requests answered while the window is minimised (#720); batch #753's Selection colors, smart-selection spacing, Present tab and auto layout on empty frames are in ui-parity, prototyping-parity and auto-layout-parity. Numbers unchanged: every `.fig` and paste change is checked on synthetic files or clipboard HTML made from our own export, and real files are what gap 1's blocker and the file-exchange discounts wait for; the UI changes (menus, the Actions palette, editor fixes) are not compared side by side, so UI/UX stays at 58%; the localization grade and hours stay (Indonesian's draft is offset by the drafts' new gaps) | | 2026-10-17 | minor | Automation roots (M8, #715, #481): `figcraft-cli mcp --automation-read-root DIR --automation-write-root DIR` (each repeatable, existing folders) and the desktop app with the same flags confine every file a command reads to the read and write roots and every file it writes to the write roots; paths are resolved (links followed, `..`, Windows `\\?\` and UNC paths, case) and compared by whole folder names, anything else is an ordinary error. The engine reaches the file system through one module (enforced by `crates/engine/clippy.toml`), and a sweep runs every command with paths outside the roots. `--attach` refuses the flags (the app confines itself); `ui.screenshot` and `ui.render` return PNG data without a `path`, so the attached MCP server writes no temporary files. Numbers unchanged. | | 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | From 82a50dad1b2dca0a2fd64c4332c59a901af987e7 Mon Sep 17 00:00:00 2001 From: justinjohn0306 Date: Mon, 19 Oct 2026 17:53:24 +0530 Subject: [PATCH 340/817] M7: a preference to start on the Home screen (#857) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Launching opens a new empty file, which then has to be closed to get back to Home. Preferences ▸ "Start on the Home screen" (`pref.startOnHome {on?}`, off by default) starts the desktop app on Home instead. Files named on the command line and recovered files still open. Co-Authored-By: Claude Opus 5.5 --- apps/figcraft/src/main.rs | 4 ++-- crates/engine/src/cmd/view.rs | 1 + crates/engine/src/lib.rs | 3 +++ crates/ui-egui/locales/de.toml | 2 ++ crates/ui-egui/locales/en.toml | 1 + 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/ja.toml | 2 ++ crates/ui-egui/locales/ko.toml | 2 ++ crates/ui-egui/locales/nl.toml | 2 ++ crates/ui-egui/locales/pt-BR.toml | 2 ++ crates/ui-egui/locales/sv.toml | 2 ++ crates/ui-egui/locales/zh-Hans.toml | 2 ++ crates/ui-egui/src/dialogs.rs | 3 +++ docs/mcp.md | 2 ++ 16 files changed, 32 insertions(+), 2 deletions(-) diff --git a/apps/figcraft/src/main.rs b/apps/figcraft/src/main.rs index 1bba81e81..e98f93733 100644 --- a/apps/figcraft/src/main.rs +++ b/apps/figcraft/src/main.rs @@ -194,9 +194,9 @@ fn main() -> eframe::Result { session.live.links = figcraft_collab_net::links::system(); session.invite_links_startup(); // A first run (no settings kept yet, nothing to open) starts on the home screen, with its - // tips and templates; later runs start in a new file. + // tips and templates; later runs start in a new file unless the preference says Home. let first_run = svc.prefs.is_none() && args.join.is_none(); - if session.docs.is_empty() && !first_run { + if session.docs.is_empty() && !first_run && !session.prefs.start_on_home { let _ = session.execute("file.new", &json!({})); } // The interface language from the first frame on, and for the message when the window can't diff --git a/crates/engine/src/cmd/view.rs b/crates/engine/src/cmd/view.rs index 69b938e91..bdf673390 100644 --- a/crates/engine/src/cmd/view.rs +++ b/crates/engine/src/cmd/view.rs @@ -371,6 +371,7 @@ pub fn specs() -> Vec { spec!("pref.numberKeysOpacity", "Use number keys for opacity", "{on?}", false, |s, p| pref(s, p, |x| &mut x.number_keys_opacity)), spec!("pref.reduceMotion", "Reduce motion", "{on?}", false, |s, p| pref(s, p, |x| &mut x.reduce_motion)), spec!("pref.autoSave", "Save files automatically", "{on?}", false, |s, p| pref(s, p, |x| &mut x.auto_save)), + spec!("pref.startOnHome", "Start on the Home screen", "{on?}", false, |s, p| pref(s, p, |x| &mut x.start_on_home)), spec!("pref.nudge", "Nudge amount", "{small?, big?}", false, |s, p| { s.prefs.nudge_small = num(p, "small").unwrap_or(s.prefs.nudge_small).clamp(0.01, 1000.0); s.prefs.nudge_big = num(p, "big").unwrap_or(s.prefs.nudge_big).clamp(0.01, 10000.0); diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 312c2e878..4653253f5 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -633,6 +633,8 @@ pub struct Prefs { /// Files that have a path are saved by themselves a few seconds after they change (the app's /// timer; off: only File ▸ Save writes them). pub auto_save: bool, + /// The desktop app starts on the Home screen instead of in a new file. + pub start_on_home: bool, /// `figcraft://` invite links open this app (`collab.registerLinks`); `None`: on for installed /// builds, off for development builds. pub invite_links: Option, @@ -699,6 +701,7 @@ impl Default for Prefs { user_name: cmd::comment::DEFAULT_AUTHOR.into(), reduce_motion: false, auto_save: false, + start_on_home: false, invite_links: None, plugins: Vec::new(), plugin_settings: BTreeMap::new(), diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index 07669c1a7..c5d7dc7ee 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -1102,6 +1102,7 @@ status = "draft — needs native review" "Save as" = "Speichern unter" "Save as preset…" = "Als Vorgabe speichern…" "Save files automatically" = "Dateien automatisch speichern" +"Start on the Home screen" = "Mit Start beginnen" "Save version {key}" = "Version speichern {key}" "Saved" = "Gespeichert" "Saved {name}" = "{name} gespeichert" @@ -1923,6 +1924,7 @@ status = "draft — needs native review" "plugins.manage" = "Plugins verwalten…" "plugins.runLast" = "Letztes Plugin ausführen" "pref.autoSave" = "Dateien automatisch speichern" +"pref.startOnHome" = "Mit Start beginnen" "pref.highlightHover" = "Ebenen beim Überfahren hervorheben" "pref.keepTool" = "Werkzeug nach Verwendung ausgewählt lassen" "pref.language" = "Sprache der Benutzeroberfläche" diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 17f6b4c5f..26f10defa 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -1298,6 +1298,7 @@ name = "English" "Start from a blank canvas" = "Start from a blank canvas" "Start from a template" = "Start from a template" "Start on path" = "Start on path" +"Start on the Home screen" = "Start on the Home screen" "Start point" = "Start point" "Start sharing" = "Start sharing" "Start sharing with the Share button, then pass on the code it gives" = "Start sharing with the Share button, then pass on the code it gives" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index d054e2223..1a73816e1 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -1155,6 +1155,7 @@ status = "draft — needs native review" "Run" = "Ejecutar" "Run {label}" = "Ejecutar {label}" "Save files automatically" = "Guardar archivos automáticamente" +"Start on the Home screen" = "Empezar en Inicio" "Search templates" = "Buscar plantillas" "See all templates" = "Ver todas las plantillas" "Select layers and they space themselves as their content changes" = "Selecciona capas y se espaciarán solas cuando cambie su contenido" @@ -2023,6 +2024,7 @@ status = "draft — needs native review" "plugins.manage" = "Gestionar plugins…" "plugins.runLast" = "Ejecutar el último plugin" "pref.autoSave" = "Guardar archivos automáticamente" +"pref.startOnHome" = "Empezar en Inicio" "pref.highlightHover" = "Resaltar capas al pasar el cursor" "pref.keepTool" = "Mantener la herramienta tras usarla" "pref.language" = "Idioma de la interfaz" diff --git a/crates/ui-egui/locales/fi.toml b/crates/ui-egui/locales/fi.toml index 602574d79..6a47a8f2e 100644 --- a/crates/ui-egui/locales/fi.toml +++ b/crates/ui-egui/locales/fi.toml @@ -1162,6 +1162,7 @@ status = "draft — needs native review" "Save as" = "Tallenna nimellä" "Save as preset…" = "Tallenna esiasetuksena…" "Save files automatically" = "Tallenna tiedostot automaattisesti" +"Start on the Home screen" = "Aloita Aloitus-näkymästä" "Save version {key}" = "Tallenna versio {key}" "Saved" = "Tallennettu" "Saved {name}" = "Tallennettu: {name}" @@ -2024,6 +2025,7 @@ status = "draft — needs native review" "plugins.manage" = "Hallitse liitännäisiä…" "plugins.runLast" = "Suorita viimeisin liitännäinen" "pref.autoSave" = "Tallenna tiedostot automaattisesti" +"pref.startOnHome" = "Aloita Aloitus-näkymästä" "pref.highlightHover" = "Korosta tasot osoitettaessa" "pref.keepTool" = "Pidä työkalu valittuna käytön jälkeen" "pref.language" = "Käyttöliittymän kieli" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 5edf1a624..947281a25 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -1157,6 +1157,7 @@ status = "draft — needs native review" "Save as" = "Enregistrer sous" "Save as preset…" = "Enregistrer comme préréglage…" "Save files automatically" = "Enregistrer les fichiers automatiquement" +"Start on the Home screen" = "Démarrer sur l’Accueil" "Save version {key}" = "Enregistrer une version {key}" "Saved" = "Enregistré" "Saved {name}" = "{name} enregistré" @@ -2012,6 +2013,7 @@ status = "draft — needs native review" "plugins.manage" = "Gérer les plugins…" "plugins.runLast" = "Exécuter le dernier plugin" "pref.autoSave" = "Enregistrer les fichiers automatiquement" +"pref.startOnHome" = "Démarrer sur l’Accueil" "pref.highlightHover" = "Mettre en évidence les calques au survol" "pref.keepTool" = "Garder l’outil sélectionné après usage" "pref.language" = "Langue de l’interface" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index def8ebc47..ed71e6719 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -1146,6 +1146,7 @@ status = "draft — needs native review" "Save as" = "名前を付けて保存" "Save as preset…" = "プリセットとして保存…" "Save files automatically" = "ファイルを自動保存" +"Start on the Home screen" = "起動時にホームを表示" "Save version {key}" = "バージョンを保存 {key}" "Saved" = "保存済み" "Saved {name}" = "{name} を保存済み" @@ -1996,6 +1997,7 @@ status = "draft — needs native review" "plugins.manage" = "プラグインを管理…" "plugins.runLast" = "最後のプラグインを実行" "pref.autoSave" = "ファイルを自動保存" +"pref.startOnHome" = "起動時にホームを表示" "pref.highlightHover" = "ホバー時にレイヤーをハイライト" "pref.keepTool" = "使用後もツールを選択したままにする" "pref.language" = "インターフェースの言語" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index 3e1916233..43c9a22ea 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -1096,6 +1096,7 @@ status = "draft — needs native review" "Save as" = "다른 이름으로 저장" "Save as preset…" = "프리셋으로 저장…" "Save files automatically" = "파일 자동 저장" +"Start on the Home screen" = "홈에서 시작" "Save version {key}" = "버전 저장 {key}" "Saved" = "저장됨" "Saved {name}" = "{name} 저장됨" @@ -1914,6 +1915,7 @@ status = "draft — needs native review" "plugins.manage" = "플러그인 관리…" "plugins.runLast" = "마지막 플러그인 실행" "pref.autoSave" = "파일 자동 저장" +"pref.startOnHome" = "홈에서 시작" "pref.highlightHover" = "마우스를 올리면 레이어 강조" "pref.keepTool" = "사용 후에도 도구 선택 유지" "pref.language" = "인터페이스 언어" diff --git a/crates/ui-egui/locales/nl.toml b/crates/ui-egui/locales/nl.toml index 8d8cac680..0e28ad9c9 100644 --- a/crates/ui-egui/locales/nl.toml +++ b/crates/ui-egui/locales/nl.toml @@ -1162,6 +1162,7 @@ status = "draft — needs native review" "Save as" = "Opslaan als" "Save as preset…" = "Opslaan als preset…" "Save files automatically" = "Bestanden automatisch opslaan" +"Start on the Home screen" = "Starten op Home" "Save version {key}" = "Versie opslaan {key}" "Saved" = "Opgeslagen" "Saved {name}" = "{name} opgeslagen" @@ -2023,6 +2024,7 @@ status = "draft — needs native review" "plugins.manage" = "Plugins beheren…" "plugins.runLast" = "Laatste plugin uitvoeren" "pref.autoSave" = "Bestanden automatisch opslaan" +"pref.startOnHome" = "Starten op Home" "pref.highlightHover" = "Lagen markeren bij aanwijzen" "pref.keepTool" = "Gereedschap geselecteerd houden na gebruik" "pref.language" = "Interfacetaal" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index d970db144..625599f7e 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -1095,6 +1095,7 @@ status = "draft — needs native review" "Save as" = "Salvar como" "Save as preset…" = "Salvar como predefinição…" "Save files automatically" = "Salvar arquivos automaticamente" +"Start on the Home screen" = "Começar no Início" "Save version {key}" = "Salvar versão {key}" "Saved" = "Salvo" "Saved {name}" = "{name} salvo" @@ -1913,6 +1914,7 @@ status = "draft — needs native review" "plugins.manage" = "Gerenciar plugins…" "plugins.runLast" = "Executar o último plugin" "pref.autoSave" = "Salvar arquivos automaticamente" +"pref.startOnHome" = "Começar no Início" "pref.highlightHover" = "Destacar camadas ao passar o cursor" "pref.keepTool" = "Manter a ferramenta selecionada após o uso" "pref.language" = "Idioma da interface" diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index d57bb25a5..3593e2cd6 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -1144,6 +1144,7 @@ name = "Svenska" "Run" = "Kör" "Run {label}" = "Kör {label}" "Save files automatically" = "Spara filer automatiskt" +"Start on the Home screen" = "Börja på Start" "Search templates" = "Sök mallar" "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" @@ -2004,6 +2005,7 @@ name = "Svenska" "plugins.manage" = "Hantera plugin-program…" "plugins.runLast" = "Kör senaste plugin" "pref.autoSave" = "Spara filer automatiskt" +"pref.startOnHome" = "Börja på Start" "pref.highlightHover" = "Framhäv lager vid hovring" "pref.keepTool" = "Behåll verktyget markerat efter användning" "pref.language" = "Gränssnittsspråk" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index a90c1c033..e4a52a683 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -1097,6 +1097,7 @@ status = "draft — needs native review" "Save as" = "另存为" "Save as preset…" = "存储为预设…" "Save files automatically" = "自动保存文件" +"Start on the Home screen" = "启动时显示主页" "Save version {key}" = "保存版本 {key}" "Saved" = "已保存" "Saved {name}" = "已保存 {name}" @@ -1915,6 +1916,7 @@ status = "draft — needs native review" "plugins.manage" = "管理插件…" "plugins.runLast" = "运行上一个插件" "pref.autoSave" = "自动保存文件" +"pref.startOnHome" = "启动时显示主页" "pref.highlightHover" = "悬停时高亮图层" "pref.keepTool" = "使用后保持工具选中" "pref.language" = "界面语言" diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 448501abf..5b1888a0a 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -223,6 +223,9 @@ pub fn show(app: &mut FigApp, ctx: &Context) { if !cfg!(target_arch = "wasm32") && crate::widgets::checkbox(ui, prefs.auto_save, tr("Save files automatically")) { toggles.push("pref.autoSave"); } + if !cfg!(target_arch = "wasm32") && crate::widgets::checkbox(ui, prefs.start_on_home, tr("Start on the Home screen")) { + toggles.push("pref.startOnHome"); + } for c in toggles { app.run(c, json!({})); } diff --git a/docs/mcp.md b/docs/mcp.md index c5ffe99f5..90cc75f5c 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -419,6 +419,8 @@ on; `key` resolves keys the way the canvas does. Commands behind keys: accessibility setting turns it on too). Prototype transitions still play. - `pref.autoSave {on?}`: files that have a path save themselves a few seconds after they change (off by default; the desktop app's timer does it, so scripts still call `file.save`). +- `pref.startOnHome {on?}`: the desktop app starts on the Home screen instead of in a new file + (off by default; files named on the command line still open). - `pref.language {language: system|en|cs|ru|es|es-419|fr|de|pt-BR|ja|ko|zh-Hans|…}`: the app's interface language, applied live ("system": - `pref.language {language: system|en|es|es-419|fr|de|pt-BR|ja|ko|sv|zh-Hans|…}`: the app's interface language, applied live ("system": the OS or browser language; a language without a catalog shows English). Command ids, labels and From ccddaa74cd82546420119d814f1ee0fcd6a9fc1a Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Mon, 19 Oct 2026 12:27:23 +0000 Subject: [PATCH 341/817] Clamp overflowing colour channels to 1 instead of 0 Found while testing crates/color/src/lib.rs:63 (clamp01, used by Color::new via parse_css at :155-166) Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/color/src/lib.rs | 2 +- crates/color/src/tests.rs | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/color/src/lib.rs b/crates/color/src/lib.rs index d6859a510..8e9f98d92 100644 --- a/crates/color/src/lib.rs +++ b/crates/color/src/lib.rs @@ -61,7 +61,7 @@ impl<'de> Deserialize<'de> for Color { } fn clamp01(v: f32) -> f32 { - if v.is_finite() { v.clamp(0.0, 1.0) } else { 0.0 } + if v.is_nan() { 0.0 } else { v.clamp(0.0, 1.0) } } impl Default for Color { diff --git a/crates/color/src/tests.rs b/crates/color/src/tests.rs index 68a838e05..4cf875bbf 100644 --- a/crates/color/src/tests.rs +++ b/crates/color/src/tests.rs @@ -80,7 +80,7 @@ fn blend_names() { #[test] fn nan_inputs_are_sanitized() { let c = Color::new(f32::NAN, 2.0, -1.0, f32::INFINITY); - assert_eq!(c.to_rgba8(), [0, 255, 0, 0]); + assert_eq!(c.to_rgba8(), [0, 255, 0, 255]); } #[test] @@ -106,3 +106,11 @@ fn crop_defaults_to_fill_and_roundtrips() { assert!((a - b).abs() < 1e-9); } } + +#[test] +fn infinite_channels_clamp() { + let c = Color::parse_css("rgb(1e40, 0, 0)").unwrap(); + assert_eq!(c.r, 1.0); + let c = Color::new(f32::INFINITY, f32::NEG_INFINITY, f32::NAN, f32::INFINITY); + assert_eq!((c.r, c.g, c.b, c.a), (1.0, 0.0, 0.0, 1.0)); +} From d2367d1eac095bc92c3541ff5dc3aed292142cfb Mon Sep 17 00:00:00 2001 From: Davit Matchakhelidze Date: Mon, 19 Oct 2026 16:35:09 +0400 Subject: [PATCH 342/817] Web: offer Georgian only when Noto Sans Georgian is built in; ROADMAP lists the Georgian draft Without craft-fonts the web build has no Georgian face and can't read installed fonts, so the language picker and System must skip Georgian there, as they already skip Japanese, Korean and Chinese without their faces. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YMTAbGNRxnMEzRvYnQGphF --- ROADMAP.md | 2 +- crates/ui-egui/src/cjk.rs | 28 +++++++++++++++++++++++----- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index a83c23473..bceed27a2 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -113,7 +113,7 @@ native speakers' reviews of the six language drafts need people. Percentages measured 2026-10-17 over 2,272 entries (strings added since a draft show English). Also shipped: Russian (`ru`, 99%, reviewed by VanTan), Swedish (`sv`, 99.6%, command labels since 2026-10-17; native review welcome), Turkish (`tr`, 99%), Czech (`cs`, 99%, draft) and Georgian (`ka`, 100%, draft). Figma ships English, Japanese, Korean, French, German, Spanish and Portuguese (Brazil); FigCraft has the localization layer, English and Spanish (Spain and Latin America), -French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese and Indonesian drafts (Preferences ▸ +French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Georgian drafts (Preferences ▸ Language; Traditional Chinese has no catalog; CJK UI text uses an installed CJK font, loaded only when needed; adding a language: [`docs/translating.md`](docs/translating.md)). Document text in any script (bidi, Arabic shaping, diff --git a/crates/ui-egui/src/cjk.rs b/crates/ui-egui/src/cjk.rs index fd3ecf8cb..d280bca5a 100644 --- a/crates/ui-egui/src/cjk.rs +++ b/crates/ui-egui/src/cjk.rs @@ -69,13 +69,22 @@ pub fn language(code: &str) -> u8 { } /// Whether the UI can draw language `code`: always on desktop (a system face is found when it's -/// needed; tofu at worst), on the web only with built-in faces for its scripts. The language -/// picker and the system language skip a language it can't. +/// needed; tofu at worst), on the web only with built-in faces for its scripts (Georgian: craft-fonts' +/// Noto Sans Georgian). The language picker and the system language skip a language it can't. pub fn can_show(code: &str) -> bool { + shows(code, cfg!(target_arch = "wasm32")) +} + +/// [`can_show`] in a desktop or (`web`) a web build. +fn shows(code: &str, web: bool) -> bool { + if !web { + return true; + } + if code.split('-').next() == Some("ka") { + return figcraft_text::face_with_char('ა', &["Noto Sans Georgian"]).is_some(); + } let need = language(code); - need == 0 - || !cfg!(target_arch = "wasm32") - || samples(need, 0).iter().all(|(c, _)| figcraft_text::face_with_char(*c, &["BIZ UDPGothic", "Noto Sans CJK SC"]).is_some()) + need == 0 || samples(need, 0).iter().all(|(c, _)| figcraft_text::face_with_char(*c, &["BIZ UDPGothic", "Noto Sans CJK SC"]).is_some()) } /// A character standing for each script in `need`, with the families to look for it in, the UI @@ -133,6 +142,15 @@ mod tests { assert!(["en", "es", "es-419", "fr", "de", "pt-BR", "tr", "id"].iter().all(|c| can_show(c))); } + #[test] + fn the_web_offers_georgian_only_with_its_face() { + assert!(shows("ka", false), "desktop always lists Georgian"); + let face = figcraft_text::face_with_char('ა', &["Noto Sans Georgian"]).is_some(); + assert_eq!(shows("ka", true), face); + assert_eq!(shows("ka-GE", true), face); + assert!(shows("en", true) && shows("tr", true)); + } + #[test] fn the_ui_language_script_comes_first() { let order = |need, ui| samples(need, ui).into_iter().map(|(c, _)| c).collect::(); From df42e380f2f68259479c0f0e3182e3841627cef3 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Mon, 19 Oct 2026 12:37:21 +0000 Subject: [PATCH 343/817] Reject non-hex characters inside invite link percent escapes Found while testing crates/collab-net/src/invite.rs:242 (percent_decode) Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/collab-net/src/invite.rs | 3 +++ crates/collab-net/src/invite_tests.rs | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/crates/collab-net/src/invite.rs b/crates/collab-net/src/invite.rs index 617ad5187..4a2e11cbc 100644 --- a/crates/collab-net/src/invite.rs +++ b/crates/collab-net/src/invite.rs @@ -239,6 +239,9 @@ fn percent_decode(s: &str) -> Option { while let Some(&b) = bytes.get(i) { if b == b'%' { let hex = bytes.get(i + 1..i + 3)?; + if !hex.iter().all(u8::is_ascii_hexdigit) { + return None; + } out.push(u8::from_str_radix(std::str::from_utf8(hex).ok()?, 16).ok()?); i += 3; } else { diff --git a/crates/collab-net/src/invite_tests.rs b/crates/collab-net/src/invite_tests.rs index 02017517d..3a02f0fa0 100644 --- a/crates/collab-net/src/invite_tests.rs +++ b/crates/collab-net/src/invite_tests.rs @@ -123,3 +123,11 @@ proptest! { prop_assert_eq!(Invite::parse(&i.url()), Ok(i)); } } + +#[test] +fn plus_or_sign_inside_a_percent_escape_is_broken() { + assert!(Endpoint::parse("ws://example.org/a/?key=%41").is_ok()); + for bad in ["%+1", "%-1", "%1", "%+a"] { + assert!(Endpoint::parse(&format!("ws://example.org/a/?key={bad}")).is_err(), "{bad}"); + } +} From 258d6f61c0ad632da8c397fc02585225ff571164 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Mon, 19 Oct 2026 14:49:19 +0200 Subject: [PATCH 344/817] Reject non-hex characters in live::parse_color Found while testing crates/engine/src/live.rs:85 Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/engine/src/live.rs | 2 +- crates/engine/tests/live_parse_color.rs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 crates/engine/tests/live_parse_color.rs diff --git a/crates/engine/src/live.rs b/crates/engine/src/live.rs index 4001b1563..ed13de5f0 100644 --- a/crates/engine/src/live.rs +++ b/crates/engine/src/live.rs @@ -81,7 +81,7 @@ pub const PEOPLE: [&str; 8] = ["#0D99FF", "#9747FF", "#14AE5C", "#F24822", "#D97 /// `#RRGGBB` → (r, g, b); `None` for anything else. pub fn parse_color(s: &str) -> Option<(u8, u8, u8)> { - let hex = s.strip_prefix('#').filter(|h| h.len() == 6 && h.is_ascii())?; + let hex = s.strip_prefix('#').filter(|h| h.len() == 6 && h.bytes().all(|b| b.is_ascii_hexdigit()))?; let byte = |i: usize| hex.get(i..i + 2).and_then(|b| u8::from_str_radix(b, 16).ok()); Some((byte(0)?, byte(2)?, byte(4)?)) } diff --git a/crates/engine/tests/live_parse_color.rs b/crates/engine/tests/live_parse_color.rs new file mode 100644 index 000000000..9e28f74ec --- /dev/null +++ b/crates/engine/tests/live_parse_color.rs @@ -0,0 +1,8 @@ +use figcraft_engine::live::parse_color; + +#[test] +fn parse_color_rejects_signs_and_non_hex() { + assert_eq!(parse_color("#+1+2+3"), None); + assert_eq!(parse_color("#-1-2-3"), None); + assert_eq!(parse_color("#0D99FF"), Some((13, 153, 255))); +} From 4b12a82839907bffc221b6a8ed585eaa9927d794 Mon Sep 17 00:00:00 2001 From: YarilaFox <102650794+YarilaFox@users.noreply.github.com> Date: Mon, 19 Oct 2026 19:43:58 +0500 Subject: [PATCH 345/817] M7: refresh FigCraft brand colors and wordmark --- crates/text/build.rs | 5 +- crates/ui-egui/src/colorpicker.rs | 2 +- crates/ui-egui/src/comments.rs | 2 +- crates/ui-egui/src/dialogs.rs | 11 ++-- crates/ui-egui/src/home.rs | 8 +-- crates/ui-egui/src/home_recents.rs | 2 +- crates/ui-egui/src/present.rs | 4 +- crates/ui-egui/src/proto_panel.rs | 2 +- crates/ui-egui/src/right.rs | 6 +-- crates/ui-egui/src/theme.rs | 83 ++++++++++++++++++++++++------ crates/ui-egui/src/toolbar.rs | 6 +-- crates/ui-egui/src/widgets.rs | 8 +-- 12 files changed, 95 insertions(+), 44 deletions(-) diff --git a/crates/text/build.rs b/crates/text/build.rs index d02defefe..f5f5096b3 100644 --- a/crates/text/build.rs +++ b/crates/text/build.rs @@ -65,9 +65,8 @@ fn craft_fonts(dir: &std::path::Path, manifest_rel: &str) -> Result Option { let del_resp = ui.interact(del, ui.id().with(("cp_preset_del", name)), Sense::click()).tip(tr("Delete preset")); let hot = resp.hovered() || del_resp.hovered(); if hot { - ui.painter().rect_filled(r, CornerRadius::same(5), crate::theme::ACCENT); + ui.painter().rect_filled(r, CornerRadius::same(5), t.menu_hover); } let col = if hot { Color32::WHITE } else { t.text }; ui.painter().text(pos2(r.min.x + 8.0, r.center().y), Align2::LEFT_CENTER, name, regular(11.5), col); diff --git a/crates/ui-egui/src/comments.rs b/crates/ui-egui/src/comments.rs index 5918dfc03..2706bd8a1 100644 --- a/crates/ui-egui/src/comments.rs +++ b/crates/ui-egui/src/comments.rs @@ -400,7 +400,7 @@ pub fn draw(app: &FigApp, painter: &egui::Painter) { if let Some((x, y, _)) = &app.ui.comments.draft { let r = pin_rect(app.to_screen(*x, *y)); painter.rect_filled(r, BUBBLE, ACCENT); - painter.circle_filled(r.center(), 3.0, Color32::WHITE); + painter.circle_filled(r.center(), 3.0, crate::theme::ACCENT_ON); } } diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 448501abf..4550d1867 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -3,7 +3,7 @@ use std::path::Path; -use egui::{Align2, Color32, Context, CornerRadius, RichText, Sense, Stroke, vec2}; +use egui::{Align2, Context, CornerRadius, RichText, Sense, Stroke, vec2}; use figcraft_color::ColorProfile; use figcraft_doc::{ExportFormat, ExportSetting, ExportSize, NodeId}; use figcraft_engine::cmd::file::{export_jobs, exportable_layers}; @@ -12,8 +12,7 @@ use serde_json::{Value, json}; use crate::FigApp; use crate::export_panel::{export_layers, save_one, suggested_name}; use crate::i18n::{self, tr, tr_noop, trf, trn}; -use crate::icons::{self, Icon}; -use crate::theme::{ACCENT, Tokens, regular, semibold}; +use crate::theme::{Tokens, regular, semibold}; pub const VERSION: &str = env!("CARGO_PKG_VERSION"); @@ -122,10 +121,10 @@ pub(crate) fn tab_strip(ui: &mut egui::Ui, t: &Tokens, tabs fn about_body(ui: &mut egui::Ui, t: &Tokens) { ui.horizontal(|ui| { let (r, _) = ui.allocate_exact_size(vec2(48.0, 48.0), Sense::hover()); - ui.painter().rect_filled(r, CornerRadius::same(10), ACCENT); - icons::paint(ui.painter(), r.shrink(10.0), Icon::Logo, Color32::WHITE); + crate::theme::paint_app_icon(ui, r); ui.vertical(|ui| { - ui.label(RichText::new("FigCraft").font(semibold(18.0))); + let (wordmark, _) = ui.allocate_exact_size(vec2(130.0, 23.0), Sense::hover()); + crate::theme::paint_wordmark(ui.painter(), egui::pos2(wordmark.min.x, wordmark.center().y), 18.0, t); ui.label(RichText::new(trf("Version {version}", &[("version", &VERSION)])).color(t.text_secondary)); }); }); diff --git a/crates/ui-egui/src/home.rs b/crates/ui-egui/src/home.rs index 236e27861..34f351000 100644 --- a/crates/ui-egui/src/home.rs +++ b/crates/ui-egui/src/home.rs @@ -202,9 +202,9 @@ fn dropped(app: &mut FigApp, ctx: &egui::Context) { fn sidebar(app: &mut FigApp, ui: &mut Ui, t: &Tokens, left: Rect) { let mut y = left.min.y + 20.0; - icons::paint(ui.painter(), Rect::from_min_size(pos2(left.min.x + 16.0, y), vec2(20.0, 20.0)), Icon::Logo, ACCENT); - ui.painter().text(pos2(left.min.x + 44.0, y + 10.0), Align2::LEFT_CENTER, "FigCraft", semibold(14.0), t.text); - y += 48.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))); + crate::theme::paint_wordmark(ui.painter(), pos2(left.min.x + 52.0, y + 12.0), 16.0, t); + y += 52.0; let search = Rect::from_min_size(pos2(left.min.x + 8.0, y), vec2(SIDEBAR - 16.0, widgets::FIELD_H)); ui.scope_builder(egui::UiBuilder::new().max_rect(search), |ui| { let response = @@ -325,7 +325,7 @@ fn action_card(ui: &mut Ui, t: &Tokens, icon: Icon, title: &str, sub: &str) -> b card_frame(ui, t, r, &resp); let ir = Rect::from_min_size(pos2(r.min.x + 16.0, r.center().y - 16.0), vec2(32.0, 32.0)); ui.painter().rect_filled(ir, CornerRadius::same(6), ACCENT); - icons::paint(ui.painter(), ir.shrink(8.0), icon, Color32::WHITE); + icons::paint(ui.painter(), ir.shrink(8.0), icon, t.accent_on); ui.painter().text(pos2(r.min.x + 60.0, r.center().y - 8.0), Align2::LEFT_CENTER, title_shown, semibold(12.0), t.text); ui.painter().text(pos2(r.min.x + 60.0, r.center().y + 9.0), Align2::LEFT_CENTER, sub_shown, regular(11.0), t.text_secondary); resp.clicked() diff --git a/crates/ui-egui/src/home_recents.rs b/crates/ui-egui/src/home_recents.rs index aeeb0f276..708fb4dbf 100644 --- a/crates/ui-egui/src/home_recents.rs +++ b/crates/ui-egui/src/home_recents.rs @@ -739,7 +739,7 @@ fn file_icon(ui: &Ui, t: &Tokens, center: egui::Pos2, path: &str) { match FileKind::of(Path::new(path)) { FileKind::FigCraft | FileKind::Fig => { ui.painter().rect_filled(r, CornerRadius::same(4), ACCENT); - icons::paint(ui.painter(), r.shrink(3.0), Icon::Logo, Color32::WHITE); + icons::paint(ui.painter(), r.shrink(3.0), Icon::Logo, t.accent_on); } kind => { ui.painter().rect_filled(r, CornerRadius::same(4), t.field); diff --git a/crates/ui-egui/src/present.rs b/crates/ui-egui/src/present.rs index 36eceb86b..786f5c5a1 100644 --- a/crates/ui-egui/src/present.rs +++ b/crates/ui-egui/src/present.rs @@ -2234,9 +2234,9 @@ fn top_bar(p: &mut Presenter, ui: &mut Ui, bar: Rect, now: f64, chrome: Chrome) resp = resp.tip(tr("Inspect the layer under the pointer: size, colours, typography")); } if chrome.pane { - icons::paint(ui.painter(), br.shrink(5.0), *icon, t.icon); + icons::paint(ui.painter(), br.shrink(5.0), *icon, if on { t.accent_on } else { t.icon }); } else { - ui.painter().text(br.center(), Align2::CENTER_CENTER, shown, regular(11.5), text); + ui.painter().text(br.center(), Align2::CENTER_CENTER, shown, regular(11.5), if on { t.accent_on } else { text }); } if *act == BarAction::Options { let menu = crate::right::menu_popup(&resp).width(220.0).show(|ui| options_menu(p, ui, device, settings.responsive, now)); diff --git a/crates/ui-egui/src/proto_panel.rs b/crates/ui-egui/src/proto_panel.rs index 85af66c59..710bab999 100644 --- a/crates/ui-egui/src/proto_panel.rs +++ b/crates/ui-egui/src/proto_panel.rs @@ -1048,7 +1048,7 @@ fn animation_rows(app: &mut FigApp, ui: &mut Ui, node: NodeId, k: usize, it: &In let w = ui.available_width().max(200.0); let (r, rr) = ui.allocate_exact_size(vec2(w, 26.0), Sense::click()); if rr.hovered() { - ui.painter().rect_filled(r, CornerRadius::same(5), ACCENT); + ui.painter().rect_filled(r, CornerRadius::same(5), t.menu_hover); } let col = if rr.hovered() { Color32::WHITE } else { t.text }; curve(ui.painter(), Rect::from_min_size(pos2(r.min.x + 6.0, r.min.y + 4.0), vec2(28.0, 18.0)), *e, col, None); diff --git a/crates/ui-egui/src/right.rs b/crates/ui-egui/src/right.rs index 53eaf9535..e6d2b8b9d 100644 --- a/crates/ui-egui/src/right.rs +++ b/crates/ui-egui/src/right.rs @@ -84,12 +84,12 @@ pub fn right_panel(app: &mut FigApp, ui: &mut Ui) { // Top bar: people (you and the others in a live session), present, share. let (top, _) = ui.allocate_exact_size(vec2(w, 48.0), Sense::hover()); // As wide as its label needs (longer in some languages). - let label = ui.painter().layout_no_wrap(tr("Share").to_string(), semibold(11.5), Color32::WHITE); + let label = ui.painter().layout_no_wrap(tr("Share").to_string(), semibold(11.5), t.accent_on); let sw = (label.size().x + 24.0).max(56.0); let share = Rect::from_min_size(pos2(top.max.x - 14.0 - sw, top.center().y - 16.0), vec2(sw, 32.0)); let sresp = ui.interact(share, ui.id().with("share"), Sense::click()).tip(tr("Share: live session, export")); ui.painter().rect_filled(share, CornerRadius::same(6), if sresp.hovered() { t.accent_hover } else { ACCENT }); - ui.painter().galley(share.center() - label.size() / 2.0, label, Color32::WHITE); + ui.painter().galley(share.center() - label.size() / 2.0, label, t.accent_on); crate::live::share_popover(app, &sresp); // Play presents; its chevron opens the play menu (present, or preview in a pane). let play = Rect::from_min_size(pos2(share.min.x - 50.0, top.center().y - 14.0), vec2(42.0, 28.0)); @@ -284,7 +284,7 @@ pub fn menu_row(ui: &mut Ui, label: &str, shortcut: &str, art_w: f32, art: impl a11y::own_focus(&resp); let hovered = resp.hovered() || resp.has_focus(); if hovered { - ui.painter().rect_filled(r, CornerRadius::same(5), ACCENT); + ui.painter().rect_filled(r, CornerRadius::same(5), t.menu_hover); } let col = if hovered { Color32::WHITE } else { t.text }; ui.painter().galley(pos2(r.min.x + MENU_PAD, r.center().y - text.size().y / 2.0), text, col); diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rs index a4fa87544..517f9089f 100644 --- a/crates/ui-egui/src/theme.rs +++ b/crates/ui-egui/src/theme.rs @@ -1,6 +1,6 @@ //! Design tokens (UI3 light and dark) and fonts. -use std::sync::Arc; +use std::sync::{Arc, OnceLock}; use egui::{Color32, Context, FontData, FontDefinitions, FontFamily, FontId, Stroke, TextStyle, Visuals}; @@ -23,6 +23,7 @@ pub struct Tokens { pub field_hover_border: Color32, pub accent: Color32, pub accent_hover: Color32, + pub accent_on: Color32, pub accent_text: Color32, pub selected_row: Color32, pub selected_row_child: Color32, @@ -44,7 +45,10 @@ pub struct Tokens { pub focus: Color32, } -pub const ACCENT: Color32 = Color32::from_rgb(0x0D, 0x99, 0xFF); +/// FigCraft's brand green, shared with the original app icon. +pub const ACCENT: Color32 = Color32::from_rgb(0x02, 0xDA, 0x96); +/// Ink on the bright green brand surface (white would not have enough contrast). +pub const ACCENT_ON: Color32 = Color32::from_rgb(0x07, 0x35, 0x2A); pub const COMPONENT: Color32 = Color32::from_rgb(0x97, 0x47, 0xFF); /// Handoff status badges (white text on these, in both themes). pub const DEV_READY: Color32 = Color32::from_rgb(0x14, 0xAE, 0x5C); @@ -71,11 +75,12 @@ impl Tokens { field: Color32::from_rgb(0xF5, 0xF5, 0xF5), field_hover_border: Color32::from_rgb(0xE6, 0xE6, 0xE6), accent: ACCENT, - accent_hover: Color32::from_rgb(0x00, 0x7B, 0xE5), - // 5.2:1 on white, 4.6:1 on selected rows: WCAG AA for text. - accent_text: Color32::from_rgb(0x00, 0x6B, 0xD1), - selected_row: Color32::from_rgb(0xE5, 0xF4, 0xFF), - selected_row_child: Color32::from_rgb(0xF2, 0xF9, 0xFF), + accent_hover: Color32::from_rgb(0x00, 0xAD, 0x78), + accent_on: ACCENT_ON, + // Darker green keeps links and labels legible on white and selected rows. + accent_text: Color32::from_rgb(0x00, 0x7A, 0x56), + selected_row: Color32::from_rgb(0xE0, 0xFB, 0xF1), + selected_row_child: Color32::from_rgb(0xF1, 0xFC, 0xF7), component: COMPONENT, component_row: Color32::from_rgb(0xF1, 0xE9, 0xFF), danger: Color32::from_rgb(0xF2, 0x48, 0x22), @@ -87,9 +92,9 @@ impl Tokens { shadow: Color32::from_black_alpha(40), menu: Color32::from_rgb(0x1E, 0x1E, 0x1E), menu_text: Color32::from_rgb(0xFF, 0xFF, 0xFF), - menu_hover: ACCENT, + menu_hover: Color32::from_rgb(0x00, 0x6B, 0x4C), menu_dim: Color32::from_rgb(0x9A, 0x9A, 0x9A), - focus: Color32::from_rgb(0x00, 0x6B, 0xD1), + focus: Color32::from_rgb(0x00, 0x7A, 0x56), } } @@ -111,10 +116,11 @@ impl Tokens { field: Color32::from_rgb(0x38, 0x38, 0x38), field_hover_border: Color32::from_rgb(0x4D, 0x4D, 0x4D), accent: ACCENT, - accent_hover: Color32::from_rgb(0x3D, 0xAD, 0xFF), - accent_text: Color32::from_rgb(0x7C, 0xC4, 0xF8), - selected_row: Color32::from_rgb(0x2A, 0x45, 0x5C), - selected_row_child: Color32::from_rgb(0x2D, 0x37, 0x41), + accent_hover: Color32::from_rgb(0x52, 0xE9, 0xB7), + accent_on: ACCENT_ON, + accent_text: Color32::from_rgb(0x52, 0xE9, 0xB7), + selected_row: Color32::from_rgb(0x16, 0x42, 0x36), + selected_row_child: Color32::from_rgb(0x12, 0x37, 0x2D), component: Color32::from_rgb(0xD2, 0x7C, 0xFF), component_row: Color32::from_rgb(0x3E, 0x30, 0x52), danger: Color32::from_rgb(0xF2, 0x48, 0x22), @@ -126,7 +132,7 @@ impl Tokens { shadow: Color32::from_black_alpha(90), menu: Color32::from_rgb(0x1E, 0x1E, 0x1E), menu_text: Color32::from_rgb(0xFF, 0xFF, 0xFF), - menu_hover: ACCENT, + menu_hover: Color32::from_rgb(0x00, 0x6B, 0x4C), menu_dim: Color32::from_rgb(0x9A, 0x9A, 0x9A), focus: ACCENT, } @@ -226,7 +232,8 @@ pub fn on_dark(ui: &mut egui::Ui, f: impl FnOnce(&mut egui::Ui) -> R) -> R { r } -/// UI fonts: Inter (from the craft-fonts build input) when present, else egui's defaults; with +/// UI fonts: Inter and the Archivo wordmark (from the craft-fonts build input) when present; +/// otherwise egui's defaults. With /// `system`, also system faces for scripts those lack (Hebrew, joined Arabic) so names in them show, /// and faces for the CJK scripts in `cjk` ([`crate::cjk`]). pub fn install_fonts(ctx: &Context, system: bool, cjk: u8) { @@ -252,6 +259,18 @@ pub fn install_fonts(ctx: &Context, system: bool, cjk: u8) { } semi.extend(fonts.families.get(&FontFamily::Proportional).cloned().unwrap_or_default()); fonts.families.insert(FontFamily::Name("semibold".into()), semi); + // Keep the logo's typeface independent of UI text. System Archivo is used when available; + // releases with craft-fonts embed it so the wordmark does not depend on installation. + let archivo = find("Archivo", "SemiBold") + .map(FontData::from_static) + .or_else(|| system.then(|| figcraft_text::find_face("Archivo", "SemiBold")).flatten().map(|face| font_data(&face))); + let mut brand = Vec::new(); + if let Some(data) = archivo { + fonts.font_data.insert("archivo".into(), Arc::new(data)); + brand.push("archivo".into()); + } + brand.extend(fonts.families.get(&FontFamily::Name("semibold".into())).cloned().unwrap_or_default()); + fonts.families.insert(FontFamily::Name("brand".into()), brand); // CJK and other scripts from craft-fonts as fallbacks (Noto Sans CJK only with FIGCRAFT_EMBED_CJK). const BUILT_IN: [&str; 4] = ["Inter", "BIZ UDPGothic", "Noto Sans CJK SC", "Noto Sans Arabic"]; let lang = crate::i18n::current().map_or("en", |l| l.code); @@ -339,6 +358,40 @@ pub fn semibold(size: f32) -> FontId { FontId::new(size, FontFamily::Name("semibold".into())) } +pub fn brand(size: f32) -> FontId { + FontId::new(size, FontFamily::Name("brand".into())) +} + +/// The two-tone Archivo wordmark used in the home sidebar and About window. +pub fn paint_wordmark(painter: &egui::Painter, left_center: egui::Pos2, size: f32, t: &Tokens) { + let font = brand(size); + let fig = painter.layout_no_wrap("Fig".into(), font.clone(), t.text); + let fig_width = fig.size().x; + painter.galley(egui::pos2(left_center.x, left_center.y - fig.size().y / 2.0), fig, t.text); + painter.text(egui::pos2(left_center.x + fig_width, left_center.y), egui::Align2::LEFT_CENTER, "Craft", font, t.accent); +} + +/// Paint the owner's original chameleon icon from the existing app asset. +pub fn paint_app_icon(ui: &egui::Ui, rect: egui::Rect) { + static ICON: OnceLock> = OnceLock::new(); + let image = ICON.get_or_init(|| { + let rgba = image::load_from_memory(include_bytes!("../../../assets/app-icon/figcraft-64.png")).ok()?.to_rgba8(); + Some(egui::ColorImage::from_rgba_unmultiplied([rgba.width() as usize, rgba.height() as usize], rgba.as_raw())) + }); + let Some(image) = image else { + ui.painter().rect_filled(rect, egui::CornerRadius::same(5), ACCENT); + crate::icons::paint(ui.painter(), rect.shrink(rect.width() * 0.22), crate::icons::Icon::Logo, ACCENT_ON); + return; + }; + let id = egui::Id::new("figcraft_original_app_icon"); + let texture = ui.ctx().data(|data| data.get_temp::(id)).unwrap_or_else(|| { + let texture = ui.ctx().load_texture("figcraft-original-app-icon", image.clone(), egui::TextureOptions::LINEAR); + ui.ctx().data_mut(|data| data.insert_temp(id, texture.clone())); + texture + }); + ui.painter().image(texture.id(), rect, egui::Rect::from_min_max(egui::pos2(0.0, 0.0), egui::pos2(1.0, 1.0)), Color32::WHITE); +} + pub fn regular(size: f32) -> FontId { FontId::new(size, FontFamily::Proportional) } diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index 6da9badb6..1902ad89a 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -149,7 +149,7 @@ fn main_toolbar(app: &mut FigApp, ui: &mut Ui, canvas: Rect, t: &Tokens) { } else if resp.hovered() { ui.painter().rect_filled(r, CornerRadius::same(5), t.hover); } - icons::paint(ui.painter(), r.shrink(7.0), icon, if actions_open { Color32::WHITE } else { t.icon }); + icons::paint(ui.painter(), r.shrink(7.0), icon, if actions_open { t.accent_on } else { t.icon }); if resp.clicked() { if id == "actions" { crate::menus::toggle_palette(&mut app.ui); @@ -379,7 +379,7 @@ fn tool_cell(ui: &mut Ui, t: &Tokens, r: Rect, id: impl egui::AsIdSalt, icon: Ic Color32::TRANSPARENT }; ui.painter().rect_filled(r, CornerRadius::same(5), bg); - icons::paint(ui.painter(), r.shrink(7.0), icon, if active { Color32::WHITE } else { t.icon }); + icons::paint(ui.painter(), r.shrink(7.0), icon, if active { t.accent_on } else { t.icon }); resp } @@ -396,7 +396,7 @@ fn done_button(ui: &mut Ui, t: &Tokens, x: f32, cy: f32, tip: &str) -> bool { let done = Rect::from_min_size(pos2(x + 12.0, cy - 14.0), vec2(DONE_W, 28.0)); let resp = ui.interact(done, ui.id().with("tool_done"), Sense::click()).tip(tip); ui.painter().rect_filled(done, CornerRadius::same(6), if resp.hovered() { t.accent_hover } else { ACCENT }); - ui.painter().text(done.center(), Align2::CENTER_CENTER, tr("Done"), crate::theme::semibold(11.5), Color32::WHITE); + ui.painter().text(done.center(), Align2::CENTER_CENTER, tr("Done"), crate::theme::semibold(11.5), t.accent_on); resp.clicked() } diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index 940d7a799..ea7f4de3b 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -974,7 +974,7 @@ pub fn checkbox(ui: &mut Ui, on: bool, label: &str) -> bool { let b = Rect::from_min_size(pos2(rect.min.x, rect.center().y - 7.0), vec2(14.0, 14.0)); if on { ui.painter().rect_filled(b, CornerRadius::same(3), t.accent); - icons::paint(ui.painter(), b.shrink(1.5), Icon::Check, Color32::WHITE); + icons::paint(ui.painter(), b.shrink(1.5), Icon::Check, t.accent_on); } else { ui.painter().rect_stroke(b, CornerRadius::same(3), Stroke::new(1.0, t.border_strong), StrokeKind::Inside); } @@ -990,7 +990,7 @@ pub fn radio(ui: &mut Ui, on: bool, label: &str) -> bool { let c = pos2(rect.min.x + 7.0, rect.center().y); if on { ui.painter().circle_filled(c, 7.0, t.accent); - ui.painter().circle_filled(c, 2.5, Color32::WHITE); + ui.painter().circle_filled(c, 2.5, t.accent_on); } else { ui.painter().circle_stroke(c, 6.5, Stroke::new(1.0, if resp.hovered() { t.accent } else { t.border_strong })); } @@ -1008,8 +1008,8 @@ pub fn button(ui: &mut Ui, label: &str, primary: bool, enabled: bool) -> Respons a11y::button(&resp, label); let hot = enabled && resp.hovered(); let (fill, text) = match (primary, hot) { - (true, false) => (t.accent, Color32::WHITE), - (true, true) => (t.accent_hover, Color32::WHITE), + (true, false) => (t.accent, t.accent_on), + (true, true) => (t.accent_hover, t.accent_on), (false, false) => (Color32::TRANSPARENT, t.text), (false, true) => (t.hover, t.text), }; From 3e02bffbbc72d3baece8ea4096ef7a9cfaf5db1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E6=9E=97=E6=A9=A6?= <108113065+yelintong@users.noreply.github.com> Date: Mon, 19 Oct 2026 22:51:57 +0800 Subject: [PATCH 346/817] Layout grids: Auto line width for columns and rows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Columns and rows can now set their line width to Auto: a width of 0 (or typing the word "Auto" / "自动" in the field) draws a one-pixel hairline down the band's middle, like the square grid, instead of a filled band. - grid_lines: a non-stretched grid with size <= 0 emits a hairline at each band's middle rather than a zero/negative-width rect. - canvas: a degenerate (zero-width or zero-height) grid rect is painted as a 1px line; a filled band is still painted as a rectangle. - number_field: a field whose placeholder is "Auto" also accepts the word "Auto"/"自动", mapping it to 0. - right: the grid size field shows "Auto" and the align menu no longer forces a 60px band on a zero width. - props: document the Auto semantics of LayoutGrid::size. - ROADMAP.md / docs/ui-parity.md: note the change. - layout tests: regression test for the Auto hairline. --- ROADMAP.md | 3 ++- crates/doc/src/props.rs | 4 +++- crates/layout/src/lib.rs | 11 ++++++++++- crates/layout/src/tests.rs | 24 ++++++++++++++++++++++++ crates/ui-egui/src/canvas.rs | 7 ++++++- crates/ui-egui/src/right.rs | 11 +++++++---- crates/ui-egui/src/widgets.rs | 19 +++++++++++++++---- docs/ui-parity.md | 5 +++-- 8 files changed, 70 insertions(+), 14 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 8a587286d..acd5bfbba 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-19 · **Change:** minor (community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -316,6 +316,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-19 | minor | Layout grids: columns and rows can set their line width to Auto (a width of 0, or typing the word “Auto” / “自动” in the field), drawing a one-pixel hairline down each band's middle like the square grid instead of a filled band; the width field shows “Auto” as its placeholder and clears to Auto. The align menu no longer forces a 60 px band on a zero width (it keeps Auto); only stale sub-pixel widths are lifted. Regression test in the layout suite. Numbers unchanged. | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | diff --git a/crates/doc/src/props.rs b/crates/doc/src/props.rs index 4f6491c1c..388241498 100644 --- a/crates/doc/src/props.rs +++ b/crates/doc/src/props.rs @@ -1189,7 +1189,9 @@ pub enum GridAlign { #[serde(default)] pub struct LayoutGrid { pub kind: GridKind, - /// Grid: cell size. Fixed (not stretched) columns/rows: their width/height. + /// Grid: cell size. Fixed (not stretched) columns/rows: their width/height. 0 (or Auto) draws + /// a one-pixel hairline like the square grid; a positive value draws a band that many + /// document units wide. pub size: f64, /// Columns/rows: how many (0: Auto, as many fixed-size ones as fit; a stretched grid has 1). pub count: u32, diff --git a/crates/layout/src/lib.rs b/crates/layout/src/lib.rs index 02e7bdaf8..3adeaf33b 100644 --- a/crates/layout/src/lib.rs +++ b/crates/layout/src/lib.rs @@ -1047,6 +1047,9 @@ pub fn grid_lines(g: &LayoutGrid, w: f64, h: f64) -> Vec { let total = if cols { w } else { h }; let gutter = if g.gutter.is_finite() { g.gutter.max(0.0) } else { 0.0 }; let offset = if g.offset.is_finite() { g.offset.max(0.0) } else { 0.0 }; + // Auto width (size 0, a non-stretched grid) draws a one-pixel hairline down the + // band's middle, like the square grid; otherwise a filled band of `size`. + let auto = g.size <= 0.0 && g.align != GridAlign::Stretch; let count = match g.count { // Auto: as many fixed-size columns (rows) as fit in the room the type leaves them. 0 if g.align != GridAlign::Stretch => { @@ -1074,7 +1077,13 @@ pub fn grid_lines(g: &LayoutGrid, w: f64, h: f64) -> Vec { }; for i in 0..count { let a = start + i as f64 * (size + gutter); - out.push(if cols { Rect::new(a, 0.0, a + size, h) } else { Rect::new(0.0, a, w, a + size) }); + if auto { + // A one-pixel hairline down the band's middle (the square grid's lines). + let c = a + size / 2.0; + out.push(if cols { Rect::new(c, 0.0, c, h) } else { Rect::new(0.0, c, w, c) }); + } else { + out.push(if cols { Rect::new(a, 0.0, a + size, h) } else { Rect::new(0.0, a, w, a + size) }); + } } } } diff --git a/crates/layout/src/tests.rs b/crates/layout/src/tests.rs index 0af9861b8..81e0500cd 100644 --- a/crates/layout/src/tests.rs +++ b/crates/layout/src/tests.rs @@ -447,3 +447,27 @@ fn grid_hostile_values() { assert!(x.is_finite() && y.is_finite() && w.is_finite() && h.is_finite()); } } + +#[test] +fn grid_lines_auto_width_columns_rows_hairline() { + // Columns with Auto width (size 0, non-stretched) draw one-pixel hairlines at each band's + // middle, like the square grid; a set width draws filled bands. + let g = LayoutGrid { kind: GridKind::Columns, align: GridAlign::Min, count: 3, size: 0.0, gutter: 10.0, offset: 0.0, ..LayoutGrid::default() }; + let lines = grid_lines(&g, 300.0, 50.0); + assert_eq!(lines.len(), 3, "three hairlines"); + for r in &lines { + assert!((r.x0 - r.x1).abs() < 1e-9 && (r.y0 - r.y1).abs() > 1.0, "a vertical hairline: {r:?}"); + } + // A positive width draws filled bands again. + let g = LayoutGrid { kind: GridKind::Columns, align: GridAlign::Min, count: 3, size: 8.0, gutter: 10.0, offset: 0.0, ..LayoutGrid::default() }; + let lines = grid_lines(&g, 300.0, 50.0); + assert!(lines.iter().all(|r| (r.x1 - r.x0).abs() > 1e-9), "a set width draws bands"); + + // Rows Auto width: horizontal hairlines. + let g = LayoutGrid { kind: GridKind::Rows, align: GridAlign::Min, count: 2, size: 0.0, gutter: 10.0, offset: 0.0, ..LayoutGrid::default() }; + let lines = grid_lines(&g, 50.0, 200.0); + assert_eq!(lines.len(), 2, "two hairlines"); + for r in &lines { + assert!((r.y0 - r.y1).abs() < 1e-9 && (r.x0 - r.x1).abs() > 1.0, "a horizontal hairline: {r:?}"); + } +} diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 9e0c1d797..d8ae41ec2 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -923,7 +923,12 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ let a = w * Point::new(r.x0, r.y0); let b = w * Point::new(r.x1, r.y1); let (sa, sb) = (app.to_screen(a.x, a.y), app.to_screen(b.x, b.y)); - if g.kind == figcraft_doc::GridKind::Grid { + // The square grid and an Auto-width line draw one-pixel hairlines; a filled + // band (a column/row with a set width) is painted as a rectangle. + if g.kind == figcraft_doc::GridKind::Grid + || (r.x0 - r.x1).abs() < 1e-9 + || (r.y0 - r.y1).abs() < 1e-9 + { painter.line_segment([sa, sb], stroke(col, 1.0)); } else { painter.rect_filled(Rect::from_two_pos(sa, sb), CornerRadius::ZERO, col); diff --git a/crates/ui-egui/src/right.rs b/crates/ui-egui/src/right.rs index 53eaf9535..f433a48a5 100644 --- a/crates/ui-egui/src/right.rs +++ b/crates/ui-egui/src/right.rs @@ -2069,12 +2069,13 @@ fn grid_settings(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], list: &[LayoutGr menu_popup(&resp).show(|ui| { for (k, (name, a)) in names.iter().zip(aligns).enumerate() { if menu_check(ui, k == cur, name, "") { - // Fixed-size columns need a size of their own. + // Keep Auto (size 0); only lift stale sub-pixel sizes (0 < size < 1) to a + // sensible band, so a width typed as 0 stays Auto. app.run( "node.set", set(&|x| { x.align = a; - if a != GridAlign::Stretch && !(x.size.is_finite() && x.size > 0.0) { + if a != GridAlign::Stretch && x.size > 0.0 && x.size < 1.0 { x.size = 60.0; } if a == GridAlign::Stretch { @@ -2099,14 +2100,16 @@ fn grid_settings(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], list: &[LayoutGr GridAlign::Center => { widgets::sublabels(ui, span, Some(tr("Gutter"))); row(ui, 32.0, |ui| { - field(app, ui, "size", g.size, &size); + let e = crate::variable_ui::number_field_or(app, ui, ids, &format!("layoutGrids/{i}/size"), Id::new(("grid_field", "size", i)), Some(g.size), col, tr("Auto"), Lead::None, ""); + app.field_run(e, "node.set", |v| set(&|x| x.size = v.max(0.0))); field(app, ui, "gutter", g.gutter, &gutter); }); } GridAlign::Min | GridAlign::Max => { widgets::sublabels(ui, span, Some(tr("Offset"))); row(ui, 32.0, |ui| { - field(app, ui, "size", g.size, &size); + let e = crate::variable_ui::number_field_or(app, ui, ids, &format!("layoutGrids/{i}/size"), Id::new(("grid_field", "size", i)), Some(g.size), col, tr("Auto"), Lead::None, ""); + app.field_run(e, "node.set", |v| set(&|x| x.size = v.max(0.0))); field(app, ui, "offset", g.offset, &offset); }); widgets::sublabels(ui, tr("Gutter"), None); diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index 940d7a799..294bd36c4 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -259,10 +259,21 @@ fn number_field_impl( }; // A relative edit of no single value goes to each layer's own. let set = |v: f64| Edit::All(FieldEdit::Set(v)); - let typed = |text: &str| match (parse(text, suffix == "%")?, value) { - (Typed::Value(v), _) => Some(set(v)), - (Typed::Rel(r), Some(cur)) => r.apply(cur).map(set), - (Typed::Rel(r), None) => Some(Edit::Each(r)), + let typed = |text: &str| { + // A field whose placeholder is "Auto" (grid width/count, auto-gap, …) also takes the + // word "Auto" (or the Chinese "自动") as input, setting it to 0 — its automatic value. + let auto_token: &str = &*tr("Auto"); + if empty == auto_token { + let t = text.trim(); + if t.eq_ignore_ascii_case("auto") || t == "自动" { + return Some(set(0.0)); + } + } + match (parse(text, suffix == "%")?, value) { + (Typed::Value(v), _) => Some(set(v)), + (Typed::Rel(r), Some(cur)) => r.apply(cur).map(set), + (Typed::Rel(r), None) => Some(Edit::Each(r)), + } }; // With the keyboard on the field (Tab) and nothing typed yet, the arrows step it as it is. if editing.is_none() diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 766284f1d..3ea38a0a1 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-10-18 · **Change:** minor (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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-19 · **Change:** minor (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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **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: @@ -105,7 +105,7 @@ interaction feel not yet compared. | Frames and sections drawn around layers take those fully inside; sections never drop into frames | done | not in auto layout frames | | Resizing a section leaves its contents in place | done | | | Masks: what a mask hides doesn't take clicks; a mask group's box is the mask's | done | | -| Layout grids (Ctrl+G) | done | columns, rows and grid; stretch, left, centre, right; Auto count; several per frame; styles; not shown or snapped on a rotated frame; a nested frame's grids snap but only top-level frames draw them | +| Layout grids (Ctrl+G) | done | columns, rows and grid; Auto line width (0 draws a one-pixel hairline); stretch, left, centre, right; Auto count; several per frame; styles; not shown or snapped on a rotated frame; a nested frame's grids snap but only top-level frames draw them | | Gamut warnings for Display P3 files | done | colour picker note; View ▸ Soft-proof sRGB stripes what sRGB can't show (the canvas itself is sRGB) | | Gradient and padding/gap handles on the canvas | done | | | Hover outline, selection colours, handle sizes | done | measured from UI3 screenshots | @@ -172,6 +172,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| +| 2026-10-19 | minor | Layout grids: columns and rows take an Auto line width (0 or “Auto”), drawing a one-pixel hairline down each band's middle; the width field shows “Auto” and typing it clears the width. The align menu keeps a zero width as Auto instead of forcing 60 px. Regression test added. | | 2026-10-18 | minor | A rename (layers double-click, F2, File ▸ Rename, a page) selects the whole name in the frame its field first draws, so the first key replaces the name instead of being appended. Checked in the app on Windows over the control channel | | 2026-10-17 | minor | Escape or Enter while the pen draws ends the path and keeps its vector in edit mode with the pen, so the next path is drawn into the same layer (unconnected); another Escape leaves edit mode (#760). Entering edit mode on a layer that already is a vector no longer records an empty undo step. Numbers unchanged | | 2026-10-17 | minor | Text layers keep the platform IME on for every frame of an edit, not only frames with input (an idle frame turned it off and macOS dropped each composition, #747); the candidate window opens at the caret instead of the canvas corner; keys pressed while composing go to the IME | From 2f14eeda609ed8b41c12d9a31024b708e54db425 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 19 Oct 2026 22:09:04 +0700 Subject: [PATCH 347/817] #871: leave progress docs to the maintainer --- docs/target-app-parity.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 3e1e64b02..16a5af69b 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -638,7 +638,6 @@ Carried over from the ROADMAP's "Shipped so far" (2026-10-10). The test count th | Date | Change | Summary | |---|---|---| -| 2026-10-19 | minor | Bound scalar fields (M3, #809): an explicit edit that changes a bound width, height, min/max size, opacity, visibility, gap, padding, corner radius, stroke weight, arc or text field (`node.set`, `transform.resize`, `object.opacityKeys`, `text.style`, canvas drags) detaches that binding instead of the variable's value coming back; compared by value, so fields the edit left alone stay bound. Numbers unchanged | | 2026-10-17 | minor | Menu breadth re-run with `cargo xtask parity`: 212 / 212 (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Rows for the 2026-10-17 landings: import/export (area 14) and the file formats dimension name the `.fig` import's new fidelity (instance identity, overrides by key, text style precedence, grid tracks, slots, connector labels, per-point joins, text on a path, image adjustments, list start numbers, vertical trim), budgets from the file's size, the import report, a `.fig` copy from Save as and paste from another design app; the localization evidence takes the re-measured catalog counts (2,272 entries, drafts at 95–99%, Indonesian and Czech drafts, Swedish and Turkish catalogs); the Automation line adds control requests answered while the window is minimised (#720); batch #753's Selection colors, smart-selection spacing, Present tab and auto layout on empty frames are in ui-parity, prototyping-parity and auto-layout-parity. Numbers unchanged: every `.fig` and paste change is checked on synthetic files or clipboard HTML made from our own export, and real files are what gap 1's blocker and the file-exchange discounts wait for; the UI changes (menus, the Actions palette, editor fixes) are not compared side by side, so UI/UX stays at 58%; the localization grade and hours stay (Indonesian's draft is offset by the drafts' new gaps) | | 2026-10-17 | minor | Automation roots (M8, #715, #481): `figcraft-cli mcp --automation-read-root DIR --automation-write-root DIR` (each repeatable, existing folders) and the desktop app with the same flags confine every file a command reads to the read and write roots and every file it writes to the write roots; paths are resolved (links followed, `..`, Windows `\\?\` and UNC paths, case) and compared by whole folder names, anything else is an ordinary error. The engine reaches the file system through one module (enforced by `crates/engine/clippy.toml`), and a sweep runs every command with paths outside the roots. `--attach` refuses the flags (the app confines itself); `ui.screenshot` and `ui.render` return PNG data without a `path`, so the attached MCP server writes no temporary files. Numbers unchanged. | | 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | From 09427e72be1ec8214f97066046935f1931e4918c Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 19 Oct 2026 22:09:05 +0700 Subject: [PATCH 348/817] #871: text style shortcuts and text.set detach the bound field they change --- crates/engine/src/cmd/text.rs | 17 +++++++++++------ crates/engine/src/variables_behaviour_tests.rs | 12 ++++++++++++ docs/mcp.md | 3 ++- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/crates/engine/src/cmd/text.rs b/crates/engine/src/cmd/text.rs index a10e9265b..2e7d282aa 100644 --- a/crates/engine/src/cmd/text.rs +++ b/crates/engine/src/cmd/text.rs @@ -18,6 +18,7 @@ fn style(s: &mut Session, p: &Value, f: impl Fn(&mut TextStyle)) -> Result Result = ids.into_iter().flat_map(|i| doc.subtree(i)).collect(); + let before = super::styles::bound_before(doc, &ids); + for d in ids { + if let Some(NodeKind::Text(t)) = doc.node_mut(d).map(|n| &mut n.kind) { + let n = t.char_count(); + t.restyle(0, n, &f); } } + super::styles::detach_edited(doc, &before); ok() } @@ -348,11 +351,13 @@ pub fn specs() -> Vec { let c = string(p, "characters").or_else(|| string(p, "text")).ok_or_else(|| bad("text.set", "`characters` required"))?; let ids = req_targets("text.set", s, p)?; let doc = s.doc_mut()?; + let before = super::styles::bound_before(doc, &ids); for i in ids { let mut m = Map::new(); m.insert("characters".into(), json!(c)); super::props::apply("text.set", doc, i, &m)?; } + super::styles::detach_edited(doc, &before); ok() }), spec!( diff --git a/crates/engine/src/variables_behaviour_tests.rs b/crates/engine/src/variables_behaviour_tests.rs index 45fda6a59..d1ac8498c 100644 --- a/crates/engine/src/variables_behaviour_tests.rs +++ b/crates/engine/src/variables_behaviour_tests.rs @@ -418,4 +418,16 @@ fn a_gesture_or_a_text_style_on_a_bound_field_detaches_it() { run(&mut s, "text.style", json!({"id": t, "fontSize": 20})); assert!(node(&s, t).bound.is_empty()); assert_eq!(node(&s, t).kind.text().unwrap().style.font_size, 20.0); + + // The font size/weight/tracking shortcuts and text content edits detach too. + run(&mut s, "variable.bind", json!({"ids": [t], "field": "fontSize", "variable": v})); + assert_eq!(node(&s, t).kind.text().unwrap().style.font_size, 8.0); + run(&mut s, "text.sizeUp", json!({"ids": [t]})); + assert_eq!(node(&s, t).kind.text().unwrap().style.font_size, 9.0); + assert!(node(&s, t).bound.is_empty()); + let c = vid(run(&mut s, "variable.create", json!({"collection": "C", "name": "c", "type": "string", "value": "Hello"}))); + run(&mut s, "variable.bind", json!({"ids": [t], "field": "characters", "variable": c})); + run(&mut s, "text.set", json!({"id": t, "characters": "Bye"})); + assert_eq!(node(&s, t).kind.text().unwrap().characters, "Bye"); + assert!(node(&s, t).bound.is_empty()); } diff --git a/docs/mcp.md b/docs/mcp.md index 00f5386d8..520f20997 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -269,7 +269,8 @@ Or in a project's `.mcp.json`: `width`); scopes only filter pickers. `variable.delete` / `variable.deleteCollection` unbind the layers using them (they keep their last value) and give aliases to them their values. An explicit edit that changes a bound field's value (`node.set`, `transform.resize`, - `object.opacityKeys`, `text.style`, a canvas drag) detaches that field's variable; fields the edit + `object.opacityKeys`, `text.style`, `text.set`, the text size, weight and + tracking shortcuts, a canvas drag) detaches that field's variable; fields the edit left as they were stay bound. `variable.addMode {from}` duplicates a mode, `variable.moveMode {collection, mode, to}` reorders (index 0 is the default mode, which layers on Auto follow). `variable.update {codeSyntax: {WEB?, From 0008fc79012182209866d52415d37c1be22ec279 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 19 Oct 2026 22:18:15 +0700 Subject: [PATCH 349/817] #878: move the parse_color test into live_tests --- crates/engine/src/live_tests.rs | 8 ++++++++ crates/engine/tests/live_parse_color.rs | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 crates/engine/tests/live_parse_color.rs diff --git a/crates/engine/src/live_tests.rs b/crates/engine/src/live_tests.rs index cacc4f378..5cdccf698 100644 --- a/crates/engine/src/live_tests.rs +++ b/crates/engine/src/live_tests.rs @@ -507,3 +507,11 @@ fn hosting_commands_check_what_they_are_given() { assert!(e.contains("join a file"), "{e}"); assert!(s.execute("collab.report", &json!({"reason": " \n "})).unwrap_err().to_string().contains("few words")); } + +#[test] +fn parse_color_rejects_signs_and_non_hex() { + use crate::live::parse_color; + assert_eq!(parse_color("#+1+2+3"), None); + assert_eq!(parse_color("#-1-2-3"), None); + assert_eq!(parse_color("#0D99FF"), Some((13, 153, 255))); +} diff --git a/crates/engine/tests/live_parse_color.rs b/crates/engine/tests/live_parse_color.rs deleted file mode 100644 index 9e28f74ec..000000000 --- a/crates/engine/tests/live_parse_color.rs +++ /dev/null @@ -1,8 +0,0 @@ -use figcraft_engine::live::parse_color; - -#[test] -fn parse_color_rejects_signs_and_non_hex() { - assert_eq!(parse_color("#+1+2+3"), None); - assert_eq!(parse_color("#-1-2-3"), None); - assert_eq!(parse_color("#0D99FF"), Some((13, 153, 255))); -} From 5738ce673c890541b519af4e3f41b48009fec98b Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 19 Oct 2026 22:20:37 +0700 Subject: [PATCH 350/817] #839: mcp reuses roots_of for its automation roots --- apps/figcraft-cli/src/main.rs | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/apps/figcraft-cli/src/main.rs b/apps/figcraft-cli/src/main.rs index d9f757d0f..badc5bc30 100644 --- a/apps/figcraft-cli/src/main.rs +++ b/apps/figcraft-cli/src/main.rs @@ -56,18 +56,17 @@ See docs/cli.md and docs/mcp.md."; /// unconfined, as before; giving either confines every file the subcommand touches (#833). const ROOT_FLAGS: [&str; 2] = ["automation-read-root", "automation-write-root"]; -fn roots_of(a: &Args) -> CliResult>> { +fn roots_of(a: &Args) -> CliResult> { let (read, write) = (a.values("automation-read-root"), a.values("automation-write-root")); if read.is_empty() && write.is_empty() { return Ok(None); } - let roots = figcraft_engine::file_access::Roots::new(read, write).map_err(CliError::Failed)?; - Ok(Some(std::sync::Arc::new(roots))) + Ok(Some(figcraft_engine::file_access::Roots::new(read, write).map_err(CliError::Failed)?)) } /// Runs `f` confined to the roots `a` carries. fn confined(a: &Args, f: impl FnOnce() -> CliResult) -> CliResult { - let roots = roots_of(a)?; + let roots = roots_of(a)?.map(std::sync::Arc::new); figcraft_engine::file_access::confined(roots.as_ref(), f) } @@ -163,23 +162,20 @@ fn run(argv: &[String]) -> CliResult { Ok(ExitCode::SUCCESS) } "mcp" => { - let a = Args::parse(rest, &["attach", "automation-read-root", "automation-write-root"], &[])?; + let valued = [&["attach"][..], &ROOT_FLAGS[..]].concat(); + let a = Args::parse(rest, &valued, &[])?; if !a.positional.is_empty() { return Err(CliError::Usage("mcp takes no positional arguments".into())); } - let (read, write) = (a.values("automation-read-root"), a.values("automation-write-root")); - let roots = match (read.is_empty() && write.is_empty(), a.value("attach")) { - (true, _) => None, - // The app runs the commands: only its own roots can confine them. - (false, Some(_)) => { - return Err(CliError::Usage( - "--attach can't take automation roots: start the app with them instead (`figcraft --control PORT --automation-read-root DIR ...`)" - .into(), - )); - } - (false, None) => Some(figcraft_engine::file_access::Roots::new(read, write).map_err(CliError::Failed)?), - }; - mcp(a.value("attach").as_deref(), roots) + let attach = a.value("attach"); + // The app runs the commands: only its own roots can confine them. + if attach.is_some() && ROOT_FLAGS.iter().any(|f| !a.values(f).is_empty()) { + return Err(CliError::Usage( + "--attach can't take automation roots: start the app with them instead (`figcraft --control PORT --automation-read-root DIR ...`)" + .into(), + )); + } + mcp(attach.as_deref(), roots_of(&a)?) } "plugin" => { let a = Args::parse(rest, &["server"], &[])?; From bafc814712761919efbba4ae80ff473650d84a46 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 19 Oct 2026 22:22:32 +0700 Subject: [PATCH 351/817] #830: drop the progress-doc edit (docs/hardware-parity.md) --- docs/hardware-parity.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/hardware-parity.md b/docs/hardware-parity.md index bc0de68dc..df8229818 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-10-18 · **Change:** minor (the web build opens files: File ▸ Open, Import and Place image through the browser's file picker, dropped files read (#759); 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; 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) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (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; 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) · **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 @@ -43,14 +43,13 @@ Nothing has been timed against Figma on the same document (needs `.fig` import). | Windows x64 / arm64 | desktop app | `.msi` and portable zip for x64, x86 and arm64 | built in CI; Windows: QA pass done 2026-10-11, findings in PR | | Linux | none (browser only) | AppImage, `.deb`, `.rpm`, Flatpak, tarball, x86_64 and aarch64; riscv64 tarball | CI tests run here. Clipboard (also the BSDs): reads run on a helper thread that gives up after 2 s, and images copied in other apps paste under Wayland through the data-control protocol (#693). Under Wayland the app can't tell its window is minimised, so control requests that need a drawn frame may still wait there (#720). None of this run on a Linux desktop here. On a Wayland compositor without server-side decorations (GNOME) the window gets winit's Adwaita controls (#592: checked by its author in a GNOME Wayland session; KDE not run) | | FreeBSD | none | tarball | | -| Web | primary (figma.com) | `figcraft-web` (WASM, WebGPU/WebGL2), web zip | no accessibility tree; file access through the browser: File ▸ Open, Import and Place image use its file picker, dropped files are read (a drop on the home screen opens, a drop on the canvas imports, as on the desktop), saving and exports are downloads; pickers for libraries, variables, plugin manifests and image fills still need a path and do nothing there; copy and paste through the system clipboard (copies written from the copy event, pastes read from the paste event; no pasting images from other apps) | +| Web | primary (figma.com) | `figcraft-web` (WASM, WebGPU/WebGL2), web zip | no accessibility tree; file access through the browser; copy and paste through the system clipboard (copies written from the copy event, pastes read from the paste event; no pasting images from other apps) | | iOS / Android | apps: view, comment, mirror prototypes | none (the web build is not touch-first) | 20–40 h for a viewer | ## Revision history | Date | Change | Summary | |---|---|---| -| 2026-10-18 | minor | Opening files in the web build (#759): File ▸ Open, Import and Place image did nothing there (the pickers return a path, which a browser never has) and dropped files were ignored (eframe hands their contents over asynchronously). A platform can now pick a file's name and contents (`Services::pick_open_contents`; the browser's ``), which `file.open` and `file.import` take as `data` and `name`, and a dropped file without a path waits behind the opening card until its contents arrive, or says it couldn't be read (`async_dialog_tests`, `home_tests`; the browser half built for wasm, not run in a browser). Numbers unchanged | | 2026-10-18 | minor | macOS quit crash (#781): on Macs with a Touch Bar the app could crash as it quit (an exception in AppKit's Touch Bar support while the window's content view, which the accessibility adapter subclasses, was torn down). Quitting now keeps everything (preferences, this run's recovery copies, live sessions ended) and then ends the process before that teardown. Quit from the menu bar ends the app without the unsaved-changes question, so unsaved files' recovery copies now stay and reopen at the next start instead of being removed. Numbers unchanged | | 2026-10-17 | minor | Linux row: clipboard reads on Linux and the BSDs time out after 2 s on a helper thread, images copied in other apps paste under Wayland (arboard's data-control feature, #693), a minimised window can't be detected under Wayland, so frame-only control requests may still wait there (#720), and Wayland compositors without server-side decorations give the window Adwaita controls (#592, checked by its author on GNOME, not by the maintainers; KDE not run); compiled in CI, not run on a Linux desktop. HiDPI row: native-density canvas images placed on whole device pixels (#359, geometry tests; not judged by eye). Numbers unchanged | | 2026-10-14 | minor | Copy and paste in the browser: the web build never wrote to the system clipboard, so Cmd+V after Cmd+C pasted whatever text the clipboard held before (as a text layer) instead of the copied layers. Copies (layers, Copy as SVG/CSS/text/PNG, links) now go out through egui's output, which eframe writes during the copy event (`web_clipboard_tests`). Numbers unchanged. | From b744ff3e145353ee271d2c792f575ef58fce5f94 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 19 Oct 2026 22:39:23 +0700 Subject: [PATCH 352/817] #830: cap files read in the browser at 512 MiB, and say why a file isn't opened --- apps/figcraft-web/src/web.rs | 25 ++++---- crates/ui-egui/locales/cs.toml | 1 + crates/ui-egui/locales/de.toml | 1 + crates/ui-egui/locales/en.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/ja.toml | 1 + crates/ui-egui/locales/ko.toml | 1 + crates/ui-egui/locales/nl.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/tr.toml | 1 + crates/ui-egui/locales/zh-Hans.toml | 1 + crates/ui-egui/src/async_dialog_tests.rs | 32 +++++++++- crates/ui-egui/src/canvas.rs | 2 +- crates/ui-egui/src/home.rs | 7 ++- crates/ui-egui/src/home_tests.rs | 11 ++-- crates/ui-egui/src/lib.rs | 74 ++++++++++++++++++------ crates/ui-egui/src/pending_open.rs | 13 ++--- 22 files changed, 136 insertions(+), 43 deletions(-) diff --git a/apps/figcraft-web/src/web.rs b/apps/figcraft-web/src/web.rs index dd767116a..f08ca90f2 100644 --- a/apps/figcraft-web/src/web.rs +++ b/apps/figcraft-web/src/web.rs @@ -147,12 +147,10 @@ impl Services for WebServices { } } -/// The largest file read from the picker (browsers read at most 4 GiB into one buffer). -const MAX_PICKED_BYTES: f64 = u32::MAX as f64; - /// The file picked in the browser's file picker (`accept`: the extensions it offers), with its -/// name; `None` when the picker is cancelled. -async fn pick_file(accept: &str) -> Result)>, wasm_bindgen::JsValue> { +/// name; `None` when the picker is cancelled, `Some(Err)` with what to tell the user when the file +/// can't be read. +async fn pick_file(accept: &str) -> Result), String>>, wasm_bindgen::JsValue> { let window = web_sys::window().ok_or("no window")?; let document = window.document().ok_or("no document")?; let body = document.body().ok_or("no body")?; @@ -169,15 +167,22 @@ async fn pick_file(accept: &str) -> Result)>, wasm_bindg drop(picker); result?; let Some(file) = file else { return Ok(None) }; - if file.size() > MAX_PICKED_BYTES { - return Err(format!("{} is too large to read in the browser", file.name()).into()); + let name = file.name(); + if let Err(why) = figcraft_ui_egui::browser_can_read(&name, file.size()) { + return Ok(Some(Err(why))); } - let buffer = wasm_bindgen_futures::JsFuture::from(file.array_buffer()).await?; - Ok(Some((file.name(), js_sys::Uint8Array::new(&buffer).to_vec()))) + Ok(Some(match wasm_bindgen_futures::JsFuture::from(file.array_buffer()).await { + Ok(buffer) => Ok((name, js_sys::Uint8Array::new(&buffer).to_vec())), + Err(e) => { + log::error!("couldn't read {name}: {e:?}"); + Err(figcraft_ui_egui::unreadable(&name)) + } + })) } /// How long after the page gets focus back the file picker counts as closed (milliseconds): a -/// picked file's `change` can come just after the focus, and must win. +/// picked file's `change` can come just after the focus, and must win. A `change` later than this +/// (a slow cloud-backed file in a browser that never sends `cancel`) counts as a cancel. const PICKER_FOCUS_SETTLE_MS: i32 = 1_000; /// Settles a file picker's promise once: on `change` (a file was picked), on `cancel` (closed diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml index 980513149..8ef219660 100644 --- a/crates/ui-egui/locales/cs.toml +++ b/crates/ui-egui/locales/cs.toml @@ -1629,6 +1629,7 @@ status = "draft — needs native review" "{name} is forgotten on this computer; the file stays on {server}" = "Zapomenuto v tomto počítači: {name}; soubor zůstává na serveru {server}" "{name} is on the server." = "{name} je na serveru." "{name} is spotlighting" = "{name} sdílí pohled" +"{name} is too large to open in the browser (over 512 MB)." = "Soubor {name} je příliš velký na otevření v prohlížeči (více než 512 MB)." "{name}\nClick to apply to the selection" = "{name}\nKliknutím použijete na výběr" "{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}\nPřetáhněte na plátno nebo kliknutím umístěte doprostřed zobrazení.\nPři puštění na instanci podržte Alt (Option) a vyměňte ji." "{name} (from {library})" = "{name} (z {library})" diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index 07669c1a7..2294e82d4 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -1583,6 +1583,7 @@ status = "draft — needs native review" "{name} is forgotten on this computer; the file stays on {server}" = "{name} wurde auf diesem Computer vergessen; die Datei bleibt auf {server}" "{name} is on the server." = "{name} liegt auf dem Server." "{name} is spotlighting" = "{name} hat das Spotlight" +"{name} is too large to open in the browser (over 512 MB)." = "{name} ist zu groß, um im Browser geöffnet zu werden (über 512 MB)." "{name} was removed from the server" = "{name} wurde vom Server entfernt" "{name} · deleted on main" = "{name} · in der Hauptdatei gelöscht" "{name} · deleted on the branch" = "{name} · im Branch gelöscht" diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 5d5b18563..9a7aba634 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -1668,6 +1668,7 @@ name = "English" "{name} is forgotten on this computer; the file stays on {server}" = "{name} is forgotten on this computer; the file stays on {server}" "{name} is on the server." = "{name} is on the server." "{name} is spotlighting" = "{name} is spotlighting" +"{name} is too large to open in the browser (over 512 MB)." = "{name} is too large to open in the browser (over 512 MB)." "{name}\nClick to apply to the selection" = "{name}\nClick to apply to the selection" "{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}\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} (from {library})" = "{name} (from {library})" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 56b6d29c2..b4c7c3352 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -1669,6 +1669,7 @@ status = "draft — needs native review" "{name} is forgotten on this computer; the file stays on {server}" = "{name} se olvidó en este ordenador; el archivo se queda en {server}" "{name} is on the server." = "{name} está en el servidor." "{name} is spotlighting" = "{name} está en el foco" +"{name} is too large to open in the browser (over 512 MB)." = "{name} es demasiado grande para abrirlo en el navegador (más de 512 MB)." "{name}\nClick to apply to the selection" = "{name}\nHaz clic para aplicarlo a la selecció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}\nArrastra al lienzo o haz clic para colocarlo en el centro de la vista.\nMantén Alt (Opción) al soltar sobre una instancia para intercambiarla." "{name} (from {library})" = "{name} (de {library})" diff --git a/crates/ui-egui/locales/fi.toml b/crates/ui-egui/locales/fi.toml index 602574d79..2521e46cb 100644 --- a/crates/ui-egui/locales/fi.toml +++ b/crates/ui-egui/locales/fi.toml @@ -1676,6 +1676,7 @@ status = "draft — needs native review" "{name} is forgotten on this computer; the file stays on {server}" = "{name} on unohdettu tällä tietokoneella. Tiedosto jää palvelimelle {server}." "{name} is on the server." = "{name} on palvelimella." "{name} is spotlighting" = "{name} nostaa näkymäänsä esiin" +"{name} is too large to open in the browser (over 512 MB)." = "{name} on liian suuri avattavaksi selaimessa (yli 512 Mt)." "{name} was removed from the server" = "{name} poistettiin palvelimelta" "{name} · deleted on main" = "{name} · poistettu päähaarassa" "{name} · deleted on the branch" = "{name} · poistettu haarassa" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 5edf1a624..1faff4c3a 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -1665,6 +1665,7 @@ status = "draft — needs native review" "{name} is forgotten on this computer; the file stays on {server}" = "{name} est oublié sur cet ordinateur ; le fichier reste sur {server}" "{name} is on the server." = "{name} est sur le serveur." "{name} is spotlighting" = "{name} est sous les projecteurs" +"{name} is too large to open in the browser (over 512 MB)." = "{name} est trop volumineux pour être ouvert dans le navigateur (plus de 512 Mo)." "{name} was removed from the server" = "{name} a été retiré du serveur" "{name} · deleted on main" = "{name} · supprimé dans le principal" "{name} · deleted on the branch" = "{name} · supprimé dans la branche" diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml index 65a9939cb..705484d89 100644 --- a/crates/ui-egui/locales/id.toml +++ b/crates/ui-egui/locales/id.toml @@ -1633,6 +1633,7 @@ status = "draft — needs native review" "{name} is forgotten on this computer; the file stays on {server}" = "{name} dilupakan di komputer ini; file tetap ada di {server}" "{name} is on the server." = "{name} ada di server." "{name} is spotlighting" = "{name} sedang spotlight" +"{name} is too large to open in the browser (over 512 MB)." = "{name} terlalu besar untuk dibuka di browser (lebih dari 512 MB)." "{name}\nClick to apply to the selection" = "{name}\nKlik untuk menerapkan ke pilihan" "{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}\nSeret ke kanvas, atau klik untuk menaruh di tengah tampilan.\nTahan Alt (Option) saat melepas di atas instance untuk menukarnya." "{name} (from {library})" = "{name} (dari {library})" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index def8ebc47..069eb09ac 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -1650,6 +1650,7 @@ status = "draft — needs native review" "{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} · メインで削除" "{name} · deleted on the branch" = "{name} · ブランチで削除" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index 3e1916233..e3d8bae8a 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -1574,6 +1574,7 @@ status = "draft — needs native review" "{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}은(는) 너무 커서 브라우저에서 열 수 없습니다(512MB 초과)." "{name} was removed from the server" = "{name}을(를) 서버에서 제거함" "{name} · deleted on main" = "{name} · 메인에서 삭제됨" "{name} · deleted on the branch" = "{name} · 브랜치에서 삭제됨" diff --git a/crates/ui-egui/locales/nl.toml b/crates/ui-egui/locales/nl.toml index 8d8cac680..7a8b41f48 100644 --- a/crates/ui-egui/locales/nl.toml +++ b/crates/ui-egui/locales/nl.toml @@ -1673,6 +1673,7 @@ status = "draft — needs native review" "{name} is forgotten on this computer; the file stays on {server}" = "{name} is op deze computer vergeten; het bestand blijft op {server}" "{name} is on the server." = "{name} staat op de server." "{name} is spotlighting" = "{name} staat in de spotlight" +"{name} is too large to open in the browser (over 512 MB)." = "{name} is te groot om in de browser te openen (meer dan 512 MB)." "{name} was removed from the server" = "{name} is van de server verwijderd" "{name} · deleted on main" = "{name} · verwijderd op main" "{name} · deleted on the branch" = "{name} · verwijderd op de branch" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index d970db144..1fdbd1a3f 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -1573,6 +1573,7 @@ status = "draft — needs native review" "{name} is forgotten on this computer; the file stays on {server}" = "{name} foi esquecido neste computador; o arquivo continua em {server}" "{name} is on the server." = "{name} está no servidor." "{name} is spotlighting" = "{name} está em destaque" +"{name} is too large to open in the browser (over 512 MB)." = "{name} é grande demais para abrir no navegador (mais de 512 MB)." "{name} was removed from the server" = "{name} foi removido do servidor" "{name} · deleted on main" = "{name} · excluído no principal" "{name} · deleted on the branch" = "{name} · excluído na branch" diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 8d371cbed..17e50e778 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -1635,6 +1635,7 @@ 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 МБ)." "{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})" diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index d57bb25a5..c57f2f6aa 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -1650,6 +1650,7 @@ name = "Svenska" "{name} is forgotten on this computer; the file stays on {server}" = "{name} har glömts på den här datorn; filen finns kvar på {server}" "{name} is on the server." = "{name} finns på servern." "{name} is spotlighting" = "{name} har spotlight" +"{name} is too large to open in the browser (over 512 MB)." = "{name} är för stor för att öppnas i webbläsaren (över 512 MB)." "{name}\nClick to apply to the selection" = "{name}\nKlicka för att använda på markeringen" "{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}\nDra till arbetsytan, eller klicka för att placera i mitten av vyn.\nHåll ned Alt (Option) när du släpper på en instans för att byta ut den." "{name} (from {library})" = "{name} (från {library})" diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml index a9da62ef1..83b63c8cc 100644 --- a/crates/ui-egui/locales/tr.toml +++ b/crates/ui-egui/locales/tr.toml @@ -1633,6 +1633,7 @@ name = "Türkçe" "{name} is forgotten on this computer; the file stays on {server}" = "{name} bu bilgisayarda unutuldu; dosya {server} üzerinde kalır" "{name} is on the server." = "{name} sunucuda." "{name} is spotlighting" = "{name} öne çıkarıyor" +"{name} is too large to open in the browser (over 512 MB)." = "{name}, tarayıcıda açılamayacak kadar büyük (512 MB'tan fazla)." "{name}\nClick to apply to the selection" = "{name}\nSeçime uygulamak için tıklayı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}\nTuvale sürükleyin veya görünümün ortasına yerleştirmek için tıklayın.\nBir örneği değiştirmek için üzerine bırakırken Alt (Option) tuşunu basılı tutun." "{name} (from {library})" = "{name} ({library} kitaplığından)" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index a90c1c033..57f2d44ba 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -1568,6 +1568,7 @@ status = "draft — needs native review" "{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}\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})" diff --git a/crates/ui-egui/src/async_dialog_tests.rs b/crates/ui-egui/src/async_dialog_tests.rs index ad5dcfbc8..f38ac8242 100644 --- a/crates/ui-egui/src/async_dialog_tests.rs +++ b/crates/ui-egui/src/async_dialog_tests.rs @@ -87,10 +87,40 @@ impl Services for Contents { panic!("a platform that picks contents is never asked for a path") } fn pick_open_contents(&mut self, _title: &str, _exts: &[&str]) -> Option { - Some(Box::pin(std::future::ready(Some((self.0.to_string(), self.1.clone()))))) + Some(Box::pin(std::future::ready(Some(Ok((self.0.to_string(), self.1.clone())))))) } } +/// The browser, with a picked file it won't read. +struct Unreadable(String); + +impl Services for Unreadable { + fn pick_open_contents(&mut self, _title: &str, _exts: &[&str]) -> Option { + Some(Box::pin(std::future::ready(Some(Err(self.0.clone()))))) + } +} + +#[test] +fn a_picked_file_that_cannot_be_read_says_why_and_opens_nothing() { + let why = crate::browser_can_read("Huge.fig", 600.0 * 1024.0 * 1024.0).unwrap_err(); + let mut app = FigApp::new(Session::empty(), Box::new(Unreadable(why.clone()))); + app.open_dialog(); + app.poll_dialog(&egui::Context::default()); + assert!(app.session.docs.is_empty()); + assert_eq!(app.ui.last_error.as_deref(), Some(why.as_str())); + assert!(why.contains("Huge.fig"), "{why}"); +} + +#[test] +fn the_browser_reads_files_up_to_512_mib() { + let max = (512u64 << 20) as f64; + assert!(crate::browser_can_read("a", 0.0).is_ok()); + assert!(crate::browser_can_read("a", max).is_ok()); + assert!(crate::browser_can_read("a", max + 1.0).is_err()); + assert!(crate::browser_can_read("a", f64::NAN).is_err()); + assert!(crate::browser_can_read("a", f64::INFINITY).is_err()); +} + #[test] fn open_dialog_opens_picked_contents_as_a_new_unsaved_document() { let bytes = figcraft_format::save_bytes(&figcraft_doc::Document::new("Picked"), None).unwrap(); diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index ce003f66c..fba8be683 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -510,7 +510,7 @@ fn input(app: &mut FigApp, ui: &mut Ui, resp: &egui::Response) -> bool { let (params, read) = if path.exists() { (json!({"path": path.to_string_lossy(), "x": pt.x, "y": pt.y}), None) } else { - (json!({"name": name, "x": pt.x, "y": pt.y}), Some(crate::dropped_bytes(&f))) + (json!({"name": name, "x": pt.x, "y": pt.y}), Some(crate::dropped_bytes(&f, &name))) }; let Some(target) = app.session.ds().ok().map(|doc| crate::pending_open::ImportTarget { uid: doc.uid, page: doc.page, name: doc.doc.name.clone() }) diff --git a/crates/ui-egui/src/home.rs b/crates/ui-egui/src/home.rs index 0d372d1bd..f945b27d0 100644 --- a/crates/ui-egui/src/home.rs +++ b/crates/ui-egui/src/home.rs @@ -187,8 +187,11 @@ fn dropped(app: &mut FigApp, ctx: &egui::Context) { } // `opens` saw an extension, so there is a file name to tell the format by. let name = path.file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_default(); - let (params, read) = - if path.exists() { (json!({"path": path.to_string_lossy()}), None) } else { (json!({"name": name}), Some(crate::dropped_bytes(&f))) }; + let (params, read) = if path.exists() { + (json!({"path": path.to_string_lossy()}), None) + } else { + (json!({"name": name}), Some(crate::dropped_bytes(&f, &name))) + }; app.ui.pending_opens.push(crate::pending_open::PendingOpen { label: name, params, command: "file.open", target: None, read }); } } diff --git a/crates/ui-egui/src/home_tests.rs b/crates/ui-egui/src/home_tests.rs index ea812ea09..0606c2e5d 100644 --- a/crates/ui-egui/src/home_tests.rs +++ b/crates/ui-egui/src/home_tests.rs @@ -573,9 +573,12 @@ fn dropping_a_file_without_one_on_disk_opens_it_as_a_new_unsaved_document() { assert!(!path.exists(), "nothing is written"); } -/// A drop whose contents arrive later, as every drop in the browser does: `None` until `arrived` +/// What a drop's read gives, once it has arrived. +type Arrival = std::rc::Rc, String>>>>; + +/// A drop whose contents arrive later, as every drop in the browser does: pending until `arrived` /// holds them. -fn later(arrived: &std::rc::Rc>>>>) -> crate::ReadFuture { +fn later(arrived: &Arrival) -> crate::ReadFuture { let arrived = arrived.clone(); Box::pin(std::future::poll_fn(move |_| match arrived.borrow_mut().take() { Some(bytes) => std::task::Poll::Ready(bytes), @@ -603,7 +606,7 @@ fn a_dropped_file_whose_contents_arrive_later_opens_once_they_do() { assert!(has_text(&s, "Browser drop.svg"), "the card shows while the contents are read"); } assert!(u.app.session.docs.is_empty(), "nothing opens before the contents arrive"); - *arrived.borrow_mut() = Some(Some(svg)); + *arrived.borrow_mut() = Some(Ok(svg)); for _ in 0..3 { u.frame(vec![]); } @@ -617,7 +620,7 @@ fn a_dropped_file_whose_contents_arrive_later_opens_once_they_do() { #[test] fn a_dropped_file_that_cannot_be_read_says_so_and_opens_nothing() { - let arrived = std::rc::Rc::new(std::cell::RefCell::new(Some(None))); + let arrived = std::rc::Rc::new(std::cell::RefCell::new(Some(Err(crate::unreadable("Unreadable.figcraft"))))); let mut u = first_run(); u.app.ui.home = true; u.app.ui.pending_opens.push(crate::pending_open::PendingOpen { diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 026228dc3..4b44c861d 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -295,32 +295,55 @@ pub trait Services { } pub type DialogFuture = Pin>>>; -/// A picked file's name and contents ([`Services::pick_open_contents`]). -pub type ContentsFuture = Pin)>>>>; -/// A dropped file's contents, read once they arrive (`None`: they couldn't be read). -pub type ReadFuture = Pin>>>>; +/// A picked file's name and contents ([`Services::pick_open_contents`]); `None` when the picker +/// was cancelled, `Err` with what to tell the user when the file couldn't be read. +pub type ContentsFuture = Pin), String>>>>>; +/// A dropped file's contents, read once they arrive (`Err`: what to tell the user when they +/// couldn't be read). +pub type ReadFuture = Pin, String>>>>; type PickFuture = Pin>>>; type DialogDone = Box; -/// What a dialog picked: a path, or a file's name and contents where there are no paths. +/// What a dialog picked: a path, or a file's name and contents where there are no paths, or why +/// the picked file couldn't be read. enum Picked { Path(PathBuf), Contents(String, Vec), + Unreadable(String), } impl Picked { - /// The file as `file.open` and `file.import` take it. - fn file_params(self) -> Value { + /// The file as `file.open` and `file.import` take it (`Err`: what to tell the user instead). + fn file_params(self) -> Result { match self { - Picked::Path(p) => json!({"path": p.to_string_lossy()}), + Picked::Path(p) => Ok(json!({"path": p.to_string_lossy()})), Picked::Contents(name, bytes) => { use base64::Engine as _; - json!({"data": base64::engine::general_purpose::STANDARD.encode(&bytes), "name": name}) + Ok(json!({"data": base64::engine::general_purpose::STANDARD.encode(&bytes), "name": name})) } + Picked::Unreadable(why) => Err(why), } } } +/// What the user is told about a file whose contents couldn't be read. +pub fn unreadable(name: &str) -> String { + i18n::trf("Couldn't read {name}.", &[("name", &name)]) +} + +/// The largest file read in the browser: wasm has at most 4 GiB of memory, and a file's contents +/// are held about three times on their way to `file.open` (the bytes, base64, decoded again). +/// As large as one member of a `.figcraft` file may be. +const MAX_BROWSER_FILE: f64 = (512u64 << 20) as f64; + +/// Checks a file of `size` bytes before the browser reads it (`Err`: what to tell the user). +pub fn browser_can_read(name: &str, size: f64) -> Result<(), String> { + if size.is_nan() || size > MAX_BROWSER_FILE { + return Err(i18n::trf("{name} is too large to open in the browser (over 512 MB).", &[("name", &name)])); + } + Ok(()) +} + /// A native dialog in flight. The app keeps working while it is open, so its result goes to the /// file and window it was opened for, not to whichever is in front when it closes. struct PendingDialog { @@ -809,6 +832,11 @@ impl FigApp { fn failed(&mut self, id: &str, e: &figcraft_engine::EngineError) { let msg = e.to_string(); log::warn!("{id}: {msg}"); + self.show_error(msg); + } + + /// Show an error as a toast, kept as the last error. + pub(crate) fn show_error(&mut self, msg: String) { self.toast(msg.clone()); self.ui.last_error = Some(msg); } @@ -1154,7 +1182,9 @@ impl FigApp { self.start_pick( |services| -> PickFuture { match services.pick_open_contents(title, exts) { - Some(read) => Box::pin(async move { read.await.map(|(name, bytes)| Picked::Contents(name, bytes)) }), + Some(read) => { + Box::pin(async move { read.await.map(|r| r.map_or_else(Picked::Unreadable, |(name, bytes)| Picked::Contents(name, bytes))) }) + } None => { let pick = services.pick_open(title, exts); Box::pin(async move { pick.await.map(Picked::Path) }) @@ -1162,7 +1192,10 @@ impl FigApp { } }, pin, - move |app, picked| done(app, picked.file_params()), + move |app, picked| match picked.file_params() { + Ok(file) => done(app, file), + Err(why) => app.show_error(why), + }, ); } @@ -1751,17 +1784,22 @@ pub(crate) fn opens(path: &Path) -> bool { path.extension().and_then(|e| e.to_str()).is_some_and(|e| OPEN_EXTENSIONS.iter().any(|x| x.eq_ignore_ascii_case(e))) } -/// Reads the contents of a dropped file that has no file on disk to read by path. +/// Reads the contents of dropped file `name` that has no file on disk to read by path. #[cfg(not(target_arch = "wasm32"))] -pub(crate) fn dropped_bytes(f: &egui::DroppedFileHandle) -> ReadFuture { - Box::pin(std::future::ready(f.bytes().ok())) +pub(crate) fn dropped_bytes(f: &egui::DroppedFileHandle, name: &str) -> ReadFuture { + Box::pin(std::future::ready(f.bytes().map_err(|_| unreadable(name)))) } -/// Reads the contents of a dropped file; the browser hands them over asynchronously. +/// Reads the contents of dropped file `name`; the browser hands them over asynchronously. #[cfg(target_arch = "wasm32")] -pub(crate) fn dropped_bytes(f: &egui::DroppedFileHandle) -> ReadFuture { - let f = f.clone(); - Box::pin(async move { f.bytes_async().await.ok() }) +pub(crate) fn dropped_bytes(f: &egui::DroppedFileHandle, name: &str) -> ReadFuture { + let (f, name) = (f.clone(), name.to_string()); + Box::pin(async move { + if let Some(file) = f.web_file() { + browser_can_read(&name, file.size())?; + } + f.bytes_async().await.map_err(|_| unreadable(&name)) + }) } /// While files are dragged over the window: a tinted, outlined `rect` with `label` in its middle, diff --git a/crates/ui-egui/src/pending_open.rs b/crates/ui-egui/src/pending_open.rs index ef798eca9..9575a1ea9 100644 --- a/crates/ui-egui/src/pending_open.rs +++ b/crates/ui-egui/src/pending_open.rs @@ -72,8 +72,7 @@ fn run_pending(app: &mut FigApp, pending: PendingOpen) -> Option { /// An import that has no destination left: nothing is imported, and the user is told why. fn cancel(app: &mut FigApp, message: String) { - app.ui.last_error = Some(message.clone()); - app.toast(message); + app.show_error(message); } /// Frames the card is drawn before the files open: egui lays a new card out invisibly on its first @@ -94,20 +93,20 @@ fn read_contents(app: &mut FigApp, ctx: &egui::Context) -> bool { reading = true; true } - Poll::Ready(Some(bytes)) => { + Poll::Ready(Ok(bytes)) => { use base64::Engine as _; pending.params["data"] = json!(base64::engine::general_purpose::STANDARD.encode(&bytes)); pending.read = None; true } - Poll::Ready(None) => { - unread.push(pending.label.clone()); + Poll::Ready(Err(why)) => { + unread.push(why); false } } }); - for name in unread { - cancel(app, trf("Couldn't read {name}.", &[("name", &name)])); + for why in unread { + app.show_error(why); } reading } From 80c8c7fa8775cc02ba520a4e242b4f58baa6a6c2 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 19 Oct 2026 22:39:25 +0700 Subject: [PATCH 353/817] #830: "Couldn't read {name}." in every full catalog --- crates/ui-egui/locales/cs.toml | 1 + crates/ui-egui/locales/de.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/ja.toml | 1 + crates/ui-egui/locales/ko.toml | 1 + crates/ui-egui/locales/nl.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/tr.toml | 1 + crates/ui-egui/locales/zh-Hans.toml | 1 + 13 files changed, 13 insertions(+) diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml index 8ef219660..c4cd98f40 100644 --- a/crates/ui-egui/locales/cs.toml +++ b/crates/ui-egui/locales/cs.toml @@ -310,6 +310,7 @@ status = "draft — needs native review" "Corner radius" = "Poloměr rohu" "Corner smoothing" = "Vyhlazení rohů" "Couldn't reach {server}: showing what this computer remembers." = "Server {server} není dostupný: zobrazuje se stav uložený v tomto počítači." +"Couldn't read {name}." = "Soubor {name} se nepodařilo přečíst." "Count" = "Počet" "Create" = "Vytvořit" "Create a variable collection first" = "Nejprve vytvořte kolekci proměnných" diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index 2294e82d4..51afd4420 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -306,6 +306,7 @@ status = "draft — needs native review" "Corner smoothing" = "Eckenglättung" "Couldn't download the variables" = "Die Variablen konnten nicht heruntergeladen werden" "Couldn't reach {server}: showing what this computer remembers." = "{server} war nicht erreichbar: Es wird angezeigt, was dieser Computer gespeichert hat." +"Couldn't read {name}." = "{name} konnte nicht gelesen werden." "Couldn't save automatically: {error}" = "Automatisches Speichern fehlgeschlagen: {error}" "Count" = "Anzahl" "Create" = "Erstellen" diff --git a/crates/ui-egui/locales/fi.toml b/crates/ui-egui/locales/fi.toml index 2521e46cb..db5d25794 100644 --- a/crates/ui-egui/locales/fi.toml +++ b/crates/ui-egui/locales/fi.toml @@ -321,6 +321,7 @@ status = "draft — needs native review" "Corner smoothing" = "Kulman pehmennys" "Couldn't download the variables" = "Muuttujia ei voitu ladata" "Couldn't reach {server}: showing what this computer remembers." = "Palvelimeen {server} ei saatu yhteyttä. Näytetään tämän tietokoneen muistamat tiedot." +"Couldn't read {name}." = "Tiedostoa {name} ei voitu lukea." "Couldn't save automatically: {error}" = "Automaattinen tallennus epäonnistui: {error}" "Count" = "Määrä" "Create" = "Luo" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 1faff4c3a..98c860ba8 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -318,6 +318,7 @@ status = "draft — needs native review" "Corner smoothing" = "Lissage des angles" "Couldn't download the variables" = "Impossible de télécharger les variables" "Couldn't reach {server}: showing what this computer remembers." = "Impossible de joindre {server} : affichage de ce dont cet ordinateur se souvient." +"Couldn't read {name}." = "Impossible de lire {name}." "Couldn't save automatically: {error}" = "Impossible d’enregistrer automatiquement : {error}" "Count" = "Nombre" "Create" = "Créer" diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml index 705484d89..0b5598614 100644 --- a/crates/ui-egui/locales/id.toml +++ b/crates/ui-egui/locales/id.toml @@ -314,6 +314,7 @@ status = "draft — needs native review" "Corner radius" = "Radius sudut" "Corner smoothing" = "Penghalusan sudut" "Couldn't reach {server}: showing what this computer remembers." = "Tidak dapat terhubung ke {server}: menampilkan data yang diingat komputer ini." +"Couldn't read {name}." = "Tidak dapat membaca {name}." "Count" = "Jumlah" "Create" = "Buat" "Create a variable collection first" = "Buat koleksi variabel terlebih dahulu" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index 069eb09ac..712a6f3f5 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -316,6 +316,7 @@ status = "draft — needs native review" "Corner radius" = "角の半径" "Corner smoothing" = "角のスムージング" "Couldn't reach {server}: showing what this computer remembers." = "{server} に接続できない:このコンピューターが覚えている内容を表示中。" +"Couldn't read {name}." = "{name} を読み込めませんでした。" "Couldn't save automatically: {error}" = "自動保存できませんでした:{error}" "Count" = "数" "Create" = "作成" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index e3d8bae8a..cfdb018da 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -305,6 +305,7 @@ status = "draft — needs native review" "Corner radius" = "모서리 반경" "Corner smoothing" = "모서리 스무딩" "Couldn't reach {server}: showing what this computer remembers." = "{server}에 연결할 수 없음: 이 컴퓨터가 기억하는 내용을 표시함." +"Couldn't read {name}." = "{name}을(를) 읽을 수 없습니다." "Couldn't save automatically: {error}" = "자동으로 저장할 수 없음: {error}" "Count" = "개수" "Create" = "만들기" diff --git a/crates/ui-egui/locales/nl.toml b/crates/ui-egui/locales/nl.toml index 7a8b41f48..da645e7dd 100644 --- a/crates/ui-egui/locales/nl.toml +++ b/crates/ui-egui/locales/nl.toml @@ -321,6 +321,7 @@ status = "draft — needs native review" "Corner smoothing" = "Hoekafvlakking" "Couldn't download the variables" = "De variabelen konden niet worden gedownload" "Couldn't reach {server}: showing what this computer remembers." = "Kon {server} niet bereiken: toont wat deze computer onthoudt." +"Couldn't read {name}." = "Kon {name} niet lezen." "Couldn't save automatically: {error}" = "Kan niet automatisch opslaan: {error}" "Count" = "Aantal" "Create" = "Maken" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index 1fdbd1a3f..343463f36 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -304,6 +304,7 @@ status = "draft — needs native review" "Corner smoothing" = "Suavização de cantos" "Couldn't download the variables" = "Não foi possível baixar as variáveis" "Couldn't reach {server}: showing what this computer remembers." = "Não foi possível alcançar {server}: mostrando o que este computador lembra." +"Couldn't read {name}." = "Não foi possível ler {name}." "Couldn't save automatically: {error}" = "Não foi possível salvar automaticamente: {error}" "Count" = "Quantidade" "Create" = "Criar" diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 17e50e778..eb264cd99 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -311,6 +311,7 @@ name = "Русский" "Corner radius" = "Радиус углов" "Corner smoothing" = "Сглаживание углов" "Couldn't reach {server}: showing what this computer remembers." = "Не удалось связаться с {server}: показаны данные, сохранённые на этом компьютере." +"Couldn't read {name}." = "Не удалось прочитать {name}." "Count" = "Количество" "Create" = "Создать" "Create a variable collection first" = "Сначала создайте коллекцию переменных" diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index c57f2f6aa..97e4cb412 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -315,6 +315,7 @@ name = "Svenska" "Corner smoothing" = "Hörnutjämning" "Couldn't download the variables" = "Det gick inte att hämta variablerna" "Couldn't reach {server}: showing what this computer remembers." = "Det gick inte att nå {server}: visar det som den här datorn minns." +"Couldn't read {name}." = "Det gick inte att läsa {name}." "Couldn't save automatically: {error}" = "Det gick inte att spara automatiskt: {error}" "Count" = "Antal" "Create" = "Skapa" diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml index 83b63c8cc..e9fbf7f08 100644 --- a/crates/ui-egui/locales/tr.toml +++ b/crates/ui-egui/locales/tr.toml @@ -314,6 +314,7 @@ name = "Türkçe" "Corner radius" = "Köşe yarıçapı" "Corner smoothing" = "Köşe yumuşatma" "Couldn't reach {server}: showing what this computer remembers." = "{server} sunucusuna ulaşılamadı: bu bilgisayarın hatırladıkları gösteriliyor." +"Couldn't read {name}." = "{name} okunamadı." "Count" = "Sayı" "Create" = "Oluştur" "Create a variable collection first" = "Önce bir değişken koleksiyonu oluşturun" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index 57f2d44ba..81874aeb3 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -306,6 +306,7 @@ status = "draft — needs native review" "Corner radius" = "圆角半径" "Corner smoothing" = "圆角平滑" "Couldn't reach {server}: showing what this computer remembers." = "无法连接 {server}:显示的是这台电脑记录的内容。" +"Couldn't read {name}." = "无法读取 {name}。" "Couldn't save automatically: {error}" = "无法自动保存:{error}" "Count" = "数量" "Create" = "创建" From 5a4b7c279502214203f8292e9a6adcded0e51c8a Mon Sep 17 00:00:00 2001 From: YarilaFox <102650794+YarilaFox@users.noreply.github.com> Date: Mon, 19 Oct 2026 20:51:47 +0500 Subject: [PATCH 354/817] M7: make brand accents legible and fix home tests --- .github/workflows/release.yml | 1 + crates/text/build.rs | 4 +-- crates/ui-egui/src/assets_panel.rs | 2 +- crates/ui-egui/src/comments.rs | 9 +++--- crates/ui-egui/src/dev_mode.rs | 2 +- crates/ui-egui/src/home.rs | 2 +- crates/ui-egui/src/home_recents.rs | 2 +- crates/ui-egui/src/home_recents_tests.rs | 6 ++-- crates/ui-egui/src/layers.rs | 4 +-- crates/ui-egui/src/lib.rs | 6 ++-- crates/ui-egui/src/present.rs | 2 +- crates/ui-egui/src/proto_panel.rs | 2 +- crates/ui-egui/src/right.rs | 8 ++--- crates/ui-egui/src/style_picker.rs | 2 +- crates/ui-egui/src/theme.rs | 41 +++++++++++++----------- crates/ui-egui/src/toolbar.rs | 8 ++--- crates/ui-egui/src/typography.rs | 14 ++++---- crates/ui-egui/src/widgets.rs | 10 +++--- 18 files changed, 66 insertions(+), 59 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 75f7a5fae..6e1aa660f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,6 +25,7 @@ jobs: app-name: figcraft app-title: FigCraft craft-fonts-ref: 43913056ce82a3fdad0ef69f6b88d1dc922a8104 + web-craft-fonts: true has-server: true version: ${{ inputs.version }} secrets: diff --git a/crates/text/build.rs b/crates/text/build.rs index f5f5096b3..6d59a9931 100644 --- a/crates/text/build.rs +++ b/crates/text/build.rs @@ -65,8 +65,8 @@ fn craft_fonts(dir: &std::path::Path, manifest_rel: &str) -> Result String { ); crate::widgets::select_all_on_focus(ui, &r, &filter); if r.has_focus() { - ui.painter().rect_stroke(field, CornerRadius::same(5), Stroke::new(1.0, t.accent), egui::StrokeKind::Inside); + ui.painter().rect_stroke(field, CornerRadius::same(5), Stroke::new(1.0, crate::theme::ACCENT), egui::StrokeKind::Inside); if ui.input(|i| i.key_pressed(egui::Key::Escape)) { filter.clear(); } diff --git a/crates/ui-egui/src/comments.rs b/crates/ui-egui/src/comments.rs index 2706bd8a1..d33c81ee0 100644 --- a/crates/ui-egui/src/comments.rs +++ b/crates/ui-egui/src/comments.rs @@ -189,10 +189,10 @@ pub fn cluster(points: &[Pos2], r: f32) -> Vec> { } /// A message's text with its @mentions of `people` picked out, wrapped at `width`. -pub fn rich_text(text: &str, people: &[&str], color: Color32, width: f32) -> LayoutJob { +pub fn rich_text(text: &str, people: &[&str], color: Color32, mention_color: Color32, width: f32) -> LayoutJob { let mut job = LayoutJob::default(); let plain = TextFormat { font_id: regular(12.0), color, ..Default::default() }; - let mention = TextFormat { font_id: semibold(12.0), color: ACCENT, ..Default::default() }; + let mention = TextFormat { font_id: semibold(12.0), color: mention_color, ..Default::default() }; let mut at = 0; for r in mention_ranges(text, people) { job.append(text.get(at..r.start).unwrap_or(""), 0.0, plain.clone()); @@ -729,7 +729,7 @@ fn message( ui.add_space(indent); let mut names: Vec<&str> = cx.people.iter().map(String::as_str).collect(); names.push(cx.me); - ui.add(egui::Label::new(rich_text(&m.text, &names, t.text, ui.available_width())).wrap()); + ui.add(egui::Label::new(rich_text(&m.text, &names, t.text, t.accent_text, ui.available_width())).wrap()); }); } } @@ -1062,7 +1062,8 @@ pub fn panel(app: &mut FigApp, ui: &mut Ui) { ui.add_space(16.0); ui.label(egui::RichText::new(tr(app.ui.comments.filter.label())).font(regular(11.0)).color(t.text_secondary)); ui.add_space(4.0); - if ui.add(egui::Label::new(egui::RichText::new(tr("Show open")).font(regular(11.0)).color(ACCENT)).sense(Sense::click())).clicked() { + if ui.add(egui::Label::new(egui::RichText::new(tr("Show open")).font(regular(11.0)).color(t.accent_text)).sense(Sense::click())).clicked() + { app.ui.comments.filter = Filter::Open; } }); diff --git a/crates/ui-egui/src/dev_mode.rs b/crates/ui-egui/src/dev_mode.rs index d34560885..0b429820d 100644 --- a/crates/ui-egui/src/dev_mode.rs +++ b/crates/ui-egui/src/dev_mode.rs @@ -628,7 +628,7 @@ pub fn dev_resources_section(app: &mut FigApp, ui: &mut Ui, doc: &Document, id: } icons::paint(ui.painter(), Rect::from_center_size(pos2(r.min.x + PAD + 7.0, r.center().y), vec2(14.0, 14.0)), Icon::Link, t.icon_secondary); let x = r.min.x + PAD + 22.0; - ui.painter().text(pos2(x, r.center().y - 7.0), Align2::LEFT_CENTER, widgets::elide(ui, name, text_w), semibold(11.0), ACCENT); + ui.painter().text(pos2(x, r.center().y - 7.0), Align2::LEFT_CENTER, widgets::elide(ui, name, text_w), semibold(11.0), t.accent_text); let below = match item.from.and_then(|f| doc.node(f)) { Some(m) => trf("From {name}", &[("name", &m.name)]), None => url.clone(), diff --git a/crates/ui-egui/src/home.rs b/crates/ui-egui/src/home.rs index 34f351000..700390a9a 100644 --- a/crates/ui-egui/src/home.rs +++ b/crates/ui-egui/src/home.rs @@ -324,7 +324,7 @@ fn action_card(ui: &mut Ui, t: &Tokens, icon: Icon, title: &str, sub: &str) -> b } card_frame(ui, t, r, &resp); let ir = Rect::from_min_size(pos2(r.min.x + 16.0, r.center().y - 16.0), vec2(32.0, 32.0)); - ui.painter().rect_filled(ir, CornerRadius::same(6), ACCENT); + ui.painter().rect_filled(ir, CornerRadius::same(6), t.accent); icons::paint(ui.painter(), ir.shrink(8.0), icon, t.accent_on); ui.painter().text(pos2(r.min.x + 60.0, r.center().y - 8.0), Align2::LEFT_CENTER, title_shown, semibold(12.0), t.text); ui.painter().text(pos2(r.min.x + 60.0, r.center().y + 9.0), Align2::LEFT_CENTER, sub_shown, regular(11.0), t.text_secondary); diff --git a/crates/ui-egui/src/home_recents.rs b/crates/ui-egui/src/home_recents.rs index 708fb4dbf..81d682406 100644 --- a/crates/ui-egui/src/home_recents.rs +++ b/crates/ui-egui/src/home_recents.rs @@ -738,7 +738,7 @@ fn file_icon(ui: &Ui, t: &Tokens, center: egui::Pos2, path: &str) { let r = Rect::from_center_size(center, vec2(16.0, 16.0)); match FileKind::of(Path::new(path)) { FileKind::FigCraft | FileKind::Fig => { - ui.painter().rect_filled(r, CornerRadius::same(4), ACCENT); + ui.painter().rect_filled(r, CornerRadius::same(4), t.accent); icons::paint(ui.painter(), r.shrink(3.0), Icon::Logo, t.accent_on); } kind => { diff --git a/crates/ui-egui/src/home_recents_tests.rs b/crates/ui-egui/src/home_recents_tests.rs index 1c3235ddb..e49866ab4 100644 --- a/crates/ui-egui/src/home_recents_tests.rs +++ b/crates/ui-egui/src/home_recents_tests.rs @@ -256,9 +256,11 @@ fn rects_of(s: &[Shape], c: egui::Color32) -> usize { s.iter().filter(|s| matches!(s, Shape::Rect(r) if r.fill == c)).count() } -/// Images drawn (meshes with a texture of their own). +/// Preview images in the main content area, excluding the branded sidebar icon. fn images(s: &[Shape]) -> usize { - s.iter().filter(|s| matches!(s, Shape::Mesh(m) if m.texture_id != egui::TextureId::default())).count() + s.iter() + .filter(|s| matches!(s, Shape::Mesh(m) if m.texture_id != egui::TextureId::default() && m.vertices.iter().any(|v| v.pos.x > 240.0))) + .count() } #[test] diff --git a/crates/ui-egui/src/layers.rs b/crates/ui-egui/src/layers.rs index 32f66f80e..26b63a5b5 100644 --- a/crates/ui-egui/src/layers.rs +++ b/crates/ui-egui/src/layers.rs @@ -332,7 +332,7 @@ fn pages_edge(app: &mut FigApp, ui: &mut Ui, shown: f32) { if active { ui.ctx().set_cursor_icon(egui::CursorIcon::ResizeVertical); } - let (width, colour) = if active { (2.0, t.accent) } else { (1.0, t.border) }; + let (width, colour) = if active { (2.0, ACCENT) } else { (1.0, t.border) }; ui.painter().line_segment([line.left_center(), line.right_center()], Stroke::new(width, colour)); let asked = if resp.double_clicked() { Some(None) @@ -642,7 +642,7 @@ fn search_field(app: &mut FigApp, ui: &mut Ui, t: &Tokens, w: f32, id: Id) { ); crate::widgets::select_all_on_focus(ui, &r, &app.ui.layer_filter); if r.has_focus() { - ui.painter().rect_stroke(field, CornerRadius::same(5), Stroke::new(1.0, t.accent), egui::StrokeKind::Inside); + ui.painter().rect_stroke(field, CornerRadius::same(5), Stroke::new(1.0, ACCENT), egui::StrokeKind::Inside); } if (r.has_focus() || r.lost_focus()) && ui.input(|i| i.key_pressed(egui::Key::Escape)) { app.ui.layer_search = false; diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 450317b43..c38242532 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1032,7 +1032,7 @@ impl FigApp { let resp = ui.interact(rect, id, egui::Sense::click_and_drag()); if resp.hovered() || resp.dragged() { ui.ctx().set_cursor_icon(egui::CursorIcon::ResizeHorizontal); - ui.painter().vline(x, rows, egui::Stroke::new(2.0, theme::Tokens::get(ui.ctx()).accent)); + ui.painter().vline(x, rows, egui::Stroke::new(2.0, theme::ACCENT)); } if resp.double_clicked() { return Some(PANEL_DEFAULT); @@ -1716,11 +1716,11 @@ pub(crate) fn drop_overlay(ctx: &egui::Context, rect: egui::Rect, label: &str) { let painter = ctx.layer_painter(egui::LayerId::new(egui::Order::Foreground, egui::Id::new("drop_overlay"))); let area = rect.shrink(4.0); painter.rect_filled(area, egui::CornerRadius::same(8), t.accent.gamma_multiply(0.12)); - painter.rect_stroke(area, egui::CornerRadius::same(8), egui::Stroke::new(2.0, t.accent), egui::StrokeKind::Inside); + painter.rect_stroke(area, egui::CornerRadius::same(8), egui::Stroke::new(2.0, theme::ACCENT), egui::StrokeKind::Inside); let galley = painter.layout_no_wrap(label.to_owned(), theme::semibold(14.0), t.text); let pill = egui::Rect::from_center_size(area.center(), galley.size() + egui::vec2(32.0, 16.0)); painter.rect_filled(pill, egui::CornerRadius::same(8), t.panel); - painter.rect_stroke(pill, egui::CornerRadius::same(8), egui::Stroke::new(1.0, t.accent), egui::StrokeKind::Inside); + painter.rect_stroke(pill, egui::CornerRadius::same(8), egui::Stroke::new(1.0, theme::ACCENT), egui::StrokeKind::Inside); painter.galley(pill.center() - galley.size() / 2.0, galley, t.text); // Hovering sends no pointer events on every platform: keep the overlay current. ctx.request_repaint(); diff --git a/crates/ui-egui/src/present.rs b/crates/ui-egui/src/present.rs index 786f5c5a1..9c0f1608d 100644 --- a/crates/ui-egui/src/present.rs +++ b/crates/ui-egui/src/present.rs @@ -2223,7 +2223,7 @@ fn top_bar(p: &mut Presenter, ui: &mut Ui, bar: Rect, now: f64, chrome: Chrome) } let on = (*act == BarAction::Comments && p.view.comments) || (*act == BarAction::Inspect && p.view.inspect); if on { - ui.painter().rect_filled(br, CornerRadius::same(5), ACCENT); + ui.painter().rect_filled(br, CornerRadius::same(5), t.accent); } else if resp.hovered() { ui.painter().rect_filled(br, CornerRadius::same(5), hover); } diff --git a/crates/ui-egui/src/proto_panel.rs b/crates/ui-egui/src/proto_panel.rs index 710bab999..86085b8f3 100644 --- a/crates/ui-egui/src/proto_panel.rs +++ b/crates/ui-egui/src/proto_panel.rs @@ -763,7 +763,7 @@ fn trigger_rows(app: &mut FigApp, ui: &mut Ui, node: NodeId, k: usize, it: &Inte let id = capture_id().with("field"); ui.painter().rect_filled(r, CornerRadius::same(5), t.field); if cap { - ui.painter().rect_stroke(r, CornerRadius::same(5), Stroke::new(1.0, t.accent), StrokeKind::Inside); + ui.painter().rect_stroke(r, CornerRadius::same(5), Stroke::new(1.0, ACCENT), StrokeKind::Inside); ui.memory_mut(|m| m.request_focus(id)); let _ = ui.interact(r, id, Sense::focusable_noninteractive()); let pressed = ui.input(|i| { diff --git a/crates/ui-egui/src/right.rs b/crates/ui-egui/src/right.rs index e6d2b8b9d..2dc71192c 100644 --- a/crates/ui-egui/src/right.rs +++ b/crates/ui-egui/src/right.rs @@ -11,7 +11,7 @@ use crate::i18n::{tr, trf, trn}; use crate::icons::{self, Icon}; use crate::list_drag::{ListDrag, move_flags, remove_flags}; use crate::style_picker::{self, StyleSlot}; -use crate::theme::{ACCENT, Tokens, regular, semibold}; +use crate::theme::{Tokens, regular, semibold}; use crate::widgets::{self, Edit, FIELD_H, FieldEdit, Lead, PAD}; use crate::{FigApp, RightTab}; @@ -88,7 +88,7 @@ pub fn right_panel(app: &mut FigApp, ui: &mut Ui) { let sw = (label.size().x + 24.0).max(56.0); let share = Rect::from_min_size(pos2(top.max.x - 14.0 - sw, top.center().y - 16.0), vec2(sw, 32.0)); let sresp = ui.interact(share, ui.id().with("share"), Sense::click()).tip(tr("Share: live session, export")); - ui.painter().rect_filled(share, CornerRadius::same(6), if sresp.hovered() { t.accent_hover } else { ACCENT }); + ui.painter().rect_filled(share, CornerRadius::same(6), if sresp.hovered() { t.accent_hover } else { t.accent }); ui.painter().galley(share.center() - label.size() / 2.0, label, t.accent_on); crate::live::share_popover(app, &sresp); // Play presents; its chevron opens the play menu (present, or preview in a pane). @@ -286,11 +286,11 @@ pub fn menu_row(ui: &mut Ui, label: &str, shortcut: &str, art_w: f32, art: impl if hovered { ui.painter().rect_filled(r, CornerRadius::same(5), t.menu_hover); } - let col = if hovered { Color32::WHITE } else { t.text }; + let col = t.menu_text; ui.painter().galley(pos2(r.min.x + MENU_PAD, r.center().y - text.size().y / 2.0), text, col); if let Some(k) = keys { let at = pos2(r.max.x - MENU_PAD - k.size().x, r.center().y - k.size().y / 2.0); - ui.painter().galley(at, k, if hovered { Color32::WHITE } else { t.text_secondary }); + ui.painter().galley(at, k, if hovered { t.menu_text } else { t.menu_dim }); } art(ui.painter(), r, col); resp diff --git a/crates/ui-egui/src/style_picker.rs b/crates/ui-egui/src/style_picker.rs index 966ea4828..29c9c5a94 100644 --- a/crates/ui-egui/src/style_picker.rs +++ b/crates/ui-egui/src/style_picker.rs @@ -482,7 +482,7 @@ fn style_grid(ui: &mut Ui, list: &[(&Style, Key)], applied: Option<&Key>, editab None => preview(ui, r, s, StyleSlot::Fill), } if applied == Some(key) { - ui.painter().rect_stroke(r.expand(2.0), CornerRadius::same(5), Stroke::new(2.0, t.accent), egui::StrokeKind::Inside); + ui.painter().rect_stroke(r.expand(2.0), CornerRadius::same(5), Stroke::new(2.0, crate::theme::ACCENT), egui::StrokeKind::Inside); } else if resp.hovered() && !text { ui.painter().rect_stroke(r.expand(2.0), CornerRadius::same(4), Stroke::new(1.0, t.menu_text), egui::StrokeKind::Inside); } diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rs index 517f9089f..01b9e7f59 100644 --- a/crates/ui-egui/src/theme.rs +++ b/crates/ui-egui/src/theme.rs @@ -45,14 +45,17 @@ pub struct Tokens { pub focus: Color32, } -/// FigCraft's brand green, shared with the original app icon. -pub const ACCENT: Color32 = Color32::from_rgb(0x02, 0xDA, 0x96); +/// FigCraft's brand green for solid surfaces. +pub const BRAND: Color32 = Color32::from_rgb(0x02, 0xDA, 0x96); +/// Contrast-safe green for thin selection outlines and white-on-green labels. +/// It reaches 4.5:1 on white and 3:1 on the dark canvas. +pub const ACCENT: Color32 = Color32::from_rgb(0x00, 0x87, 0x5F); /// Ink on the bright green brand surface (white would not have enough contrast). pub const ACCENT_ON: Color32 = Color32::from_rgb(0x07, 0x35, 0x2A); pub const COMPONENT: Color32 = Color32::from_rgb(0x97, 0x47, 0xFF); /// Handoff status badges (white text on these, in both themes). -pub const DEV_READY: Color32 = Color32::from_rgb(0x14, 0xAE, 0x5C); -pub const DEV_CHANGED: Color32 = Color32::from_rgb(0xD9, 0x7A, 0x06); +pub const DEV_READY: Color32 = Color32::from_rgb(0x08, 0x7D, 0x4F); +pub const DEV_CHANGED: Color32 = Color32::from_rgb(0xA7, 0x5B, 0x00); pub const DEV_COMPLETED: Color32 = Color32::from_rgb(0x6E, 0x6E, 0x73); impl Tokens { @@ -74,7 +77,7 @@ impl Tokens { pressed: Color32::from_rgb(0xE6, 0xE6, 0xE6), field: Color32::from_rgb(0xF5, 0xF5, 0xF5), field_hover_border: Color32::from_rgb(0xE6, 0xE6, 0xE6), - accent: ACCENT, + accent: BRAND, accent_hover: Color32::from_rgb(0x00, 0xAD, 0x78), accent_on: ACCENT_ON, // Darker green keeps links and labels legible on white and selected rows. @@ -84,7 +87,7 @@ impl Tokens { component: COMPONENT, component_row: Color32::from_rgb(0xF1, 0xE9, 0xFF), danger: Color32::from_rgb(0xF2, 0x48, 0x22), - success: Color32::from_rgb(0x14, 0xAE, 0x5C), + success: DEV_READY, warning: Color32::from_rgb(0xFF, 0xCD, 0x29), guide: Color32::from_rgb(0xF2, 0x48, 0x22), tab_bar: Color32::from_rgb(0xE8, 0xE8, 0xE8), @@ -92,7 +95,7 @@ impl Tokens { shadow: Color32::from_black_alpha(40), menu: Color32::from_rgb(0x1E, 0x1E, 0x1E), menu_text: Color32::from_rgb(0xFF, 0xFF, 0xFF), - menu_hover: Color32::from_rgb(0x00, 0x6B, 0x4C), + menu_hover: ACCENT, menu_dim: Color32::from_rgb(0x9A, 0x9A, 0x9A), focus: Color32::from_rgb(0x00, 0x7A, 0x56), } @@ -115,7 +118,7 @@ impl Tokens { pressed: Color32::from_rgb(0x44, 0x44, 0x44), field: Color32::from_rgb(0x38, 0x38, 0x38), field_hover_border: Color32::from_rgb(0x4D, 0x4D, 0x4D), - accent: ACCENT, + accent: BRAND, accent_hover: Color32::from_rgb(0x52, 0xE9, 0xB7), accent_on: ACCENT_ON, accent_text: Color32::from_rgb(0x52, 0xE9, 0xB7), @@ -124,7 +127,7 @@ impl Tokens { component: Color32::from_rgb(0xD2, 0x7C, 0xFF), component_row: Color32::from_rgb(0x3E, 0x30, 0x52), danger: Color32::from_rgb(0xF2, 0x48, 0x22), - success: Color32::from_rgb(0x14, 0xAE, 0x5C), + success: DEV_READY, warning: Color32::from_rgb(0xFF, 0xCD, 0x29), guide: Color32::from_rgb(0xF2, 0x48, 0x22), tab_bar: Color32::from_rgb(0x1E, 0x1E, 0x1E), @@ -132,9 +135,9 @@ impl Tokens { shadow: Color32::from_black_alpha(90), menu: Color32::from_rgb(0x1E, 0x1E, 0x1E), menu_text: Color32::from_rgb(0xFF, 0xFF, 0xFF), - menu_hover: Color32::from_rgb(0x00, 0x6B, 0x4C), + menu_hover: ACCENT, menu_dim: Color32::from_rgb(0x9A, 0x9A, 0x9A), - focus: ACCENT, + focus: BRAND, } } @@ -192,7 +195,7 @@ fn visuals(t: Tokens) -> Visuals { v.window_corner_radius = egui::CornerRadius::same(13); v.menu_corner_radius = egui::CornerRadius::same(13); v.selection.bg_fill = t.accent.gamma_multiply(0.3); - v.selection.stroke = Stroke::new(1.0, t.accent); + v.selection.stroke = Stroke::new(1.0, ACCENT); v.hyperlink_color = t.accent_text; for w in [&mut v.widgets.inactive, &mut v.widgets.hovered, &mut v.widgets.active, &mut v.widgets.open, &mut v.widgets.noninteractive] { w.corner_radius = egui::CornerRadius::same(5); @@ -208,10 +211,10 @@ fn visuals(t: Tokens) -> Visuals { v.widgets.hovered.bg_stroke = Stroke::new(1.0, t.field_hover_border); v.widgets.active.bg_fill = t.pressed; v.widgets.active.weak_bg_fill = t.pressed; - v.widgets.active.bg_stroke = Stroke::new(1.0, t.accent); + v.widgets.active.bg_stroke = Stroke::new(1.0, ACCENT); v.popup_shadow = egui::Shadow { offset: [0, 4], blur: 16, spread: 0, color: t.shadow }; v.window_shadow = egui::Shadow { offset: [0, 8], blur: 24, spread: 0, color: t.shadow }; - v.text_cursor.stroke = Stroke::new(1.0, t.accent); + v.text_cursor.stroke = Stroke::new(1.0, ACCENT); v } @@ -261,9 +264,9 @@ pub fn install_fonts(ctx: &Context, system: bool, cjk: u8) { fonts.families.insert(FontFamily::Name("semibold".into()), semi); // Keep the logo's typeface independent of UI text. System Archivo is used when available; // releases with craft-fonts embed it so the wordmark does not depend on installation. - let archivo = find("Archivo", "SemiBold") - .map(FontData::from_static) - .or_else(|| system.then(|| figcraft_text::find_face("Archivo", "SemiBold")).flatten().map(|face| font_data(&face))); + let archivo = find("Archivo", "SemiBold").map(FontData::from_static).or_else(|| { + system.then(|| figcraft_text::find_face("Archivo", "SemiBold")).flatten().filter(|face| face.family == "Archivo").map(|face| font_data(&face)) + }); let mut brand = Vec::new(); if let Some(data) = archivo { fonts.font_data.insert("archivo".into(), Arc::new(data)); @@ -368,7 +371,7 @@ pub fn paint_wordmark(painter: &egui::Painter, left_center: egui::Pos2, size: f3 let fig = painter.layout_no_wrap("Fig".into(), font.clone(), t.text); let fig_width = fig.size().x; painter.galley(egui::pos2(left_center.x, left_center.y - fig.size().y / 2.0), fig, t.text); - painter.text(egui::pos2(left_center.x + fig_width, left_center.y), egui::Align2::LEFT_CENTER, "Craft", font, t.accent); + painter.text(egui::pos2(left_center.x + fig_width, left_center.y), egui::Align2::LEFT_CENTER, "Craft", font, t.accent_text); } /// Paint the owner's original chameleon icon from the existing app asset. @@ -379,7 +382,7 @@ pub fn paint_app_icon(ui: &egui::Ui, rect: egui::Rect) { Some(egui::ColorImage::from_rgba_unmultiplied([rgba.width() as usize, rgba.height() as usize], rgba.as_raw())) }); let Some(image) = image else { - ui.painter().rect_filled(rect, egui::CornerRadius::same(5), ACCENT); + ui.painter().rect_filled(rect, egui::CornerRadius::same(5), BRAND); crate::icons::paint(ui.painter(), rect.shrink(rect.width() * 0.22), crate::icons::Icon::Logo, ACCENT_ON); return; }; diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index 1902ad89a..58409b974 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -9,7 +9,7 @@ use crate::FigApp; use crate::a11y::{self, Nav, Region, Tip}; use crate::i18n::{tr, tr_noop, trf}; use crate::icons::{self, Icon}; -use crate::theme::{ACCENT, Tokens, regular}; +use crate::theme::{Tokens, regular}; struct Group { key: &'static str, @@ -145,7 +145,7 @@ fn main_toolbar(app: &mut FigApp, ui: &mut Ui, canvas: Rect, t: &Tokens) { // The Actions button reads on while its panel is open; clicking it again closes it. let actions_open = id == "actions" && app.ui.palette.is_some(); if actions_open { - ui.painter().rect_filled(r, CornerRadius::same(5), ACCENT); + ui.painter().rect_filled(r, CornerRadius::same(5), t.accent); } else if resp.hovered() { ui.painter().rect_filled(r, CornerRadius::same(5), t.hover); } @@ -372,7 +372,7 @@ fn tool_cell(ui: &mut Ui, t: &Tokens, r: Rect, id: impl egui::AsIdSalt, icon: Ic }); a11y::toggle(&resp, tip, active); let bg = if active { - ACCENT + t.accent } else if resp.hovered() { t.hover } else { @@ -395,7 +395,7 @@ fn done_button(ui: &mut Ui, t: &Tokens, x: f32, cy: f32, tip: &str) -> bool { divider(ui, t, x, cy); let done = Rect::from_min_size(pos2(x + 12.0, cy - 14.0), vec2(DONE_W, 28.0)); let resp = ui.interact(done, ui.id().with("tool_done"), Sense::click()).tip(tip); - ui.painter().rect_filled(done, CornerRadius::same(6), if resp.hovered() { t.accent_hover } else { ACCENT }); + ui.painter().rect_filled(done, CornerRadius::same(6), if resp.hovered() { t.accent_hover } else { t.accent }); ui.painter().text(done.center(), Align2::CENTER_CENTER, tr("Done"), crate::theme::semibold(11.5), t.accent_on); resp.clicked() } diff --git a/crates/ui-egui/src/typography.rs b/crates/ui-egui/src/typography.rs index 7740a9e02..06185d0cd 100644 --- a/crates/ui-egui/src/typography.rs +++ b/crates/ui-egui/src/typography.rs @@ -587,7 +587,7 @@ fn decoration_details(app: &mut FigApp, ui: &mut Ui, styles: &[TextStyle], apply if !auto && ui .add( - egui::Label::new(egui::RichText::new(tr("Auto")).font(regular(11.0)).color(Tokens::get(ui.ctx()).accent)) + egui::Label::new(egui::RichText::new(tr("Auto")).font(regular(11.0)).color(Tokens::get(ui.ctx()).accent_text)) .sense(Sense::click()), ) .on_hover_text(tip) @@ -713,7 +713,7 @@ fn variable_axes(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], styles: &[TextSt } if styles.iter().any(|s| !s.variations.is_empty()) { ui.add_space(8.0); - let r = ui.add(egui::Label::new(egui::RichText::new(tr("Reset to style")).font(regular(11.0)).color(t.accent)).sense(Sense::click())); + let r = ui.add(egui::Label::new(egui::RichText::new(tr("Reset to style")).font(regular(11.0)).color(t.accent_text)).sense(Sense::click())); if r.on_hover_text(tr("Back to the values the font style implies")).clicked() { app.run("text.setVariations", json!({"ids": ids, "variations": {}, "replace": true})); } @@ -789,7 +789,7 @@ fn axis_slider(ui: &mut Ui, id: Id, axis: &figcraft_text::Axis, value: Option, supported: match on { Some(true) => { ui.painter().rect_filled(b, CornerRadius::same(3), t.accent); - icons::paint(ui.painter(), b.shrink(1.5), Icon::Check, Color32::WHITE); + icons::paint(ui.painter(), b.shrink(1.5), Icon::Check, t.accent_on); } Some(false) => { ui.painter().rect_stroke(b, CornerRadius::same(3), Stroke::new(1.0, t.border_strong), StrokeKind::Inside); } None => { ui.painter().rect_filled(b, CornerRadius::same(3), t.accent); - ui.painter().line_segment([pos2(b.min.x + 3.5, b.center().y), pos2(b.max.x - 3.5, b.center().y)], Stroke::new(1.5, Color32::WHITE)); + ui.painter().line_segment([pos2(b.min.x + 3.5, b.center().y), pos2(b.max.x - 3.5, b.center().y)], Stroke::new(1.5, t.accent_on)); } } let col = if supported { t.text } else { t.text_tertiary }; @@ -1025,7 +1025,7 @@ fn lead_field(ui: &mut Ui, id: Id, glyph: LeadGlyph, value: &str, width: f32, ti crate::a11y::text(&resp, tip, value); ui.painter().rect_filled(rect, CornerRadius::same(5), t.field); if editing.is_some() { - ui.painter().rect_stroke(rect, CornerRadius::same(5), Stroke::new(1.0, t.accent), StrokeKind::Inside); + ui.painter().rect_stroke(rect, CornerRadius::same(5), Stroke::new(1.0, crate::theme::ACCENT), StrokeKind::Inside); } else if resp.hovered() { ui.painter().rect_stroke(rect, CornerRadius::same(5), Stroke::new(1.0, t.field_hover_border), StrokeKind::Inside); } @@ -1274,7 +1274,7 @@ pub(crate) fn font_picker(ui: &mut Ui, current: Option<&str>, just_opened: bool) if hovered { ui.painter().rect_filled(rect, CornerRadius::same(5), t.accent); } - let col = if hovered { Color32::WHITE } else { t.text }; + let col = if hovered { t.accent_on } else { t.text }; if current.is_some_and(|c| c.eq_ignore_ascii_case(f)) { icons::paint( ui.painter(), diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index ea7f4de3b..ca7504aec 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -217,7 +217,7 @@ fn number_field_impl( let hovered = field_resp.hovered() || lead_resp.hovered() || editing.is_some(); ui.painter().rect_filled(rect, CornerRadius::same(5), t.field); if editing.is_some() { - ui.painter().rect_stroke(rect, CornerRadius::same(5), Stroke::new(1.0, t.accent), StrokeKind::Inside); + ui.painter().rect_stroke(rect, CornerRadius::same(5), Stroke::new(1.0, crate::theme::ACCENT), StrokeKind::Inside); } else if hovered { ui.painter().rect_stroke(rect, CornerRadius::same(5), Stroke::new(1.0, t.field_hover_border), StrokeKind::Inside); } @@ -507,7 +507,7 @@ fn text_field_in(ui: &mut Ui, id: Id, value: &str, rect: Rect, placeholder: &str a11y::text(&resp, name, value); ui.painter().rect_filled(rect, CornerRadius::same(5), t.field); if editing.is_some() { - ui.painter().rect_stroke(rect, CornerRadius::same(5), Stroke::new(1.0, t.accent), StrokeKind::Inside); + ui.painter().rect_stroke(rect, CornerRadius::same(5), Stroke::new(1.0, crate::theme::ACCENT), StrokeKind::Inside); } else if resp.hovered() { ui.painter().rect_stroke(rect, CornerRadius::same(5), Stroke::new(1.0, t.field_hover_border), StrokeKind::Inside); } @@ -570,7 +570,7 @@ pub fn text_input(ui: &mut Ui, id: Id, text: &mut String, width: f32, hint: &str ui.painter().rect_filled(rect, CornerRadius::same(5), t.field); let r = field_editor(ui, rect, id, text, hint); if r.has_focus() { - ui.painter().rect_stroke(rect, CornerRadius::same(5), Stroke::new(1.0, t.accent), StrokeKind::Inside); + ui.painter().rect_stroke(rect, CornerRadius::same(5), Stroke::new(1.0, crate::theme::ACCENT), StrokeKind::Inside); } else if ui.rect_contains_pointer(rect) { ui.painter().rect_stroke(rect, CornerRadius::same(5), Stroke::new(1.0, t.field_hover_border), StrokeKind::Inside); } @@ -992,7 +992,7 @@ pub fn radio(ui: &mut Ui, on: bool, label: &str) -> bool { ui.painter().circle_filled(c, 7.0, t.accent); ui.painter().circle_filled(c, 2.5, t.accent_on); } else { - ui.painter().circle_stroke(c, 6.5, Stroke::new(1.0, if resp.hovered() { t.accent } else { t.border_strong })); + ui.painter().circle_stroke(c, 6.5, Stroke::new(1.0, if resp.hovered() { crate::theme::ACCENT } else { t.border_strong })); } ui.painter().text(pos2(rect.min.x + 22.0, rect.center().y), Align2::LEFT_CENTER, label, regular(11.0), t.text); resp.clicked() @@ -1046,7 +1046,7 @@ pub fn text_field_inline(ui: &mut Ui, id: Id, value: &str, rect: Rect, font: egu match buf { Some(mut text) => { ui.painter().rect_filled(rect.expand(2.0), CornerRadius::same(4), t.panel); - ui.painter().rect_stroke(rect.expand(2.0), CornerRadius::same(4), Stroke::new(1.0, t.accent), StrokeKind::Inside); + ui.painter().rect_stroke(rect.expand(2.0), CornerRadius::same(4), Stroke::new(1.0, crate::theme::ACCENT), StrokeKind::Inside); let mut child = ui.new_child(egui::UiBuilder::new().max_rect(rect)); let r = crate::bidi::single_line(&mut child, te_id, &mut text, font, rect.width()); a11y::own_focus(&r); From 8450d18c8e1d390441573bb25acc312fb5d4373a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E6=9E=97=E6=A9=A6?= <108113065+yelintong@users.noreply.github.com> Date: Tue, 20 Oct 2026 00:13:37 +0800 Subject: [PATCH 355/817] Layout grids: Auto width takes the word only where 0 is Auto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review fixes for #881 (FredApps, CodeRabbit). - number_field: the word for Auto (the placeholder's own text in the UI's language, or "auto") is taken only by a field that asks for it (`Empty::Auto`), not by every field whose placeholder reads "Auto". An auto layout's gap ("Auto" is Space between) and a prototype overlay's offset ("Auto" is no offset) keep their own meaning of 0; the fixed "自动" match is gone. - layout: Auto width has no hidden 60 px band — the bands step by the gutter alone, so the pitch is what the panel shows. A zero-width band snaps to one line, not two identical edges. - right: the width field shows "Auto" (not 0) when there is no width, and a stretched grid shows it dim and not editable (its bands divide the frame), with the margin and gutter still editable. - tests: the field suite checks the word on a grid's width (0) and on an auto layout's gap (nothing); the layout suite pins the gutter pitch, the Auto count and a stretched grid's bands. - docs: ROADMAP and ui-parity state the pitch and what changes for saved grids. --- ROADMAP.md | 2 +- crates/doc/src/props.rs | 5 +- crates/layout/src/lib.rs | 26 ++++++---- crates/layout/src/tests.rs | 16 ++++++- crates/ui-egui/src/field_tests.rs | 76 +++++++++++++++++++++++++++++ crates/ui-egui/src/proto_panel.rs | 15 +++++- crates/ui-egui/src/right.rs | 46 ++++++++++++++---- crates/ui-egui/src/variable_ui.rs | 24 ++++++++-- crates/ui-egui/src/widgets.rs | 79 ++++++++++++++++++++++++++----- docs/ui-parity.md | 4 +- 10 files changed, 250 insertions(+), 43 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index acd5bfbba..b9851508c 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -316,7 +316,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| -| 2026-10-19 | minor | Layout grids: columns and rows can set their line width to Auto (a width of 0, or typing the word “Auto” / “自动” in the field), drawing a one-pixel hairline down each band's middle like the square grid instead of a filled band; the width field shows “Auto” as its placeholder and clears to Auto. The align menu no longer forces a 60 px band on a zero width (it keeps Auto); only stale sub-pixel widths are lifted. Regression test in the layout suite. Numbers unchanged. | +| 2026-10-19 | minor | Layout grids: columns and rows can set their line width to Auto (a width of 0, or typing the word for Auto — the field's own placeholder text in the UI's language, or “auto” — in the field), drawing a one-pixel hairline at each band's start like the square grid instead of a filled band, with the gutter alone as the step between the lines. The width field shows “Auto” when there is no width; a stretched grid shows it dim and not editable, its bands dividing the frame. Only the grid's width and count take the word: an auto layout's gap, whose “Auto” is Space between, and a prototype overlay's offset, whose “Auto” is no offset, keep their own meaning of 0. The align menu no longer forces a 60 px band on a zero width (it keeps Auto); only stale sub-pixel widths are lifted. A saved non-stretched grid with a width of 0 now draws hairlines where it drew 60 px bands, and snaps to one line per band instead of two edges. Regression tests in the layout and field suites. Numbers unchanged. | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | diff --git a/crates/doc/src/props.rs b/crates/doc/src/props.rs index 388241498..33120404a 100644 --- a/crates/doc/src/props.rs +++ b/crates/doc/src/props.rs @@ -1190,8 +1190,9 @@ pub enum GridAlign { pub struct LayoutGrid { pub kind: GridKind, /// Grid: cell size. Fixed (not stretched) columns/rows: their width/height. 0 (or Auto) draws - /// a one-pixel hairline like the square grid; a positive value draws a band that many - /// document units wide. + /// a one-pixel hairline at each band's start, like the square grid, and the bands step by + /// `gutter` alone (there is no width to add); a positive value draws a band that many document + /// units wide. A stretched grid works its bands out from the frame and ignores `size`. pub size: f64, /// Columns/rows: how many (0: Auto, as many fixed-size ones as fit; a stretched grid has 1). pub count: u32, diff --git a/crates/layout/src/lib.rs b/crates/layout/src/lib.rs index 3adeaf33b..a8376363a 100644 --- a/crates/layout/src/lib.rs +++ b/crates/layout/src/lib.rs @@ -1047,15 +1047,17 @@ pub fn grid_lines(g: &LayoutGrid, w: f64, h: f64) -> Vec { let total = if cols { w } else { h }; let gutter = if g.gutter.is_finite() { g.gutter.max(0.0) } else { 0.0 }; let offset = if g.offset.is_finite() { g.offset.max(0.0) } else { 0.0 }; - // Auto width (size 0, a non-stretched grid) draws a one-pixel hairline down the - // band's middle, like the square grid; otherwise a filled band of `size`. + // Auto width (size 0, a non-stretched grid) draws a one-pixel hairline at the band's + // start, like the square grid; otherwise a filled band of `size`. Auto has no width of + // its own, so the gutter alone is the step between the lines. let auto = g.size <= 0.0 && g.align != GridAlign::Stretch; + let fixed = if g.size.is_finite() && g.size > 0.0 { g.size } else { 0.0 }; let count = match g.count { // Auto: as many fixed-size columns (rows) as fit in the room the type leaves them. 0 if g.align != GridAlign::Stretch => { - let size = if g.size.is_finite() && g.size > 0.0 { g.size } else { 60.0 }; let room = if g.align == GridAlign::Center { total } else { total - offset }; - ((room + gutter) / (size + gutter)).floor().clamp(1.0, 500.0) as usize + let step = fixed + gutter; + if step > 0.0 { ((room + gutter) / step).floor().clamp(1.0, 500.0) as usize } else { 1 } } n => n.clamp(1, 500) as usize, }; @@ -1065,7 +1067,7 @@ pub fn grid_lines(g: &LayoutGrid, w: f64, h: f64) -> Vec { (offset, size) } _ => { - let size = if g.size.is_finite() && g.size > 0.0 { g.size } else { 60.0 }; + let size = fixed; let span = size * count as f64 + gutter * (count - 1) as f64; let start = match g.align { GridAlign::Min => offset, @@ -1078,9 +1080,8 @@ pub fn grid_lines(g: &LayoutGrid, w: f64, h: f64) -> Vec { for i in 0..count { let a = start + i as f64 * (size + gutter); if auto { - // A one-pixel hairline down the band's middle (the square grid's lines). - let c = a + size / 2.0; - out.push(if cols { Rect::new(c, 0.0, c, h) } else { Rect::new(0.0, c, w, c) }); + // A one-pixel hairline where the band would start (the square grid's lines). + out.push(if cols { Rect::new(a, 0.0, a, h) } else { Rect::new(0.0, a, w, a) }); } else { out.push(if cols { Rect::new(a, 0.0, a + size, h) } else { Rect::new(0.0, a, w, a + size) }); } @@ -1113,11 +1114,16 @@ pub fn grid_snap_lines_in(doc: &Document, frame: NodeId, xf: Affine) -> (Vec { xs.push(a.x); - xs.push(b.x); + // An Auto-width band is one line, not an edge pair. + if (b.x - a.x).abs() > 1e-9 { + xs.push(b.x); + } } GridKind::Rows => { ys.push(a.y); - ys.push(b.y); + if (b.y - a.y).abs() > 1e-9 { + ys.push(b.y); + } } GridKind::Grid => { if (r.x0 - r.x1).abs() < 1e-9 { diff --git a/crates/layout/src/tests.rs b/crates/layout/src/tests.rs index 81e0500cd..cf8e944a1 100644 --- a/crates/layout/src/tests.rs +++ b/crates/layout/src/tests.rs @@ -451,13 +451,21 @@ fn grid_hostile_values() { #[test] fn grid_lines_auto_width_columns_rows_hairline() { // Columns with Auto width (size 0, non-stretched) draw one-pixel hairlines at each band's - // middle, like the square grid; a set width draws filled bands. + // start, like the square grid; a set width draws filled bands. let g = LayoutGrid { kind: GridKind::Columns, align: GridAlign::Min, count: 3, size: 0.0, gutter: 10.0, offset: 0.0, ..LayoutGrid::default() }; let lines = grid_lines(&g, 300.0, 50.0); assert_eq!(lines.len(), 3, "three hairlines"); for r in &lines { assert!((r.x0 - r.x1).abs() < 1e-9 && (r.y0 - r.y1).abs() > 1.0, "a vertical hairline: {r:?}"); } + // Auto has no width of its own, so the gutter alone is the step between the lines (no band + // width hidden in it). + let xs: Vec = lines.iter().map(|r| r.x0).collect(); + assert_eq!(xs, [0.0, 10.0, 20.0], "Auto steps by the gutter: {xs:?}"); + // Auto count: as many hairlines as the gutter fits. + let g = LayoutGrid { kind: GridKind::Columns, align: GridAlign::Min, count: 0, size: 0.0, gutter: 10.0, offset: 0.0, ..LayoutGrid::default() }; + let lines = grid_lines(&g, 300.0, 50.0); + assert_eq!(lines.len(), 31, "300 wide, 10 apart: 31 lines"); // A positive width draws filled bands again. let g = LayoutGrid { kind: GridKind::Columns, align: GridAlign::Min, count: 3, size: 8.0, gutter: 10.0, offset: 0.0, ..LayoutGrid::default() }; let lines = grid_lines(&g, 300.0, 50.0); @@ -470,4 +478,10 @@ fn grid_lines_auto_width_columns_rows_hairline() { for r in &lines { assert!((r.y0 - r.y1).abs() < 1e-9 && (r.x0 - r.x1).abs() > 1.0, "a horizontal hairline: {r:?}"); } + // A stretched grid works its bands out from the frame whatever its width says. + let g = + LayoutGrid { kind: GridKind::Columns, align: GridAlign::Stretch, count: 4, size: 0.0, gutter: 10.0, offset: 0.0, ..LayoutGrid::default() }; + let lines = grid_lines(&g, 400.0, 50.0); + assert!(lines.iter().all(|r| (r.x1 - r.x0) > 1.0), "stretch draws bands, not hairlines: {lines:?}"); + assert!((lines[0].x0 - 0.0).abs() < 1e-9 && (lines[3].x1 - 400.0).abs() < 1e-9, "the bands fill the frame"); } diff --git a/crates/ui-egui/src/field_tests.rs b/crates/ui-egui/src/field_tests.rs index 9ddc48e52..1f9b1e5d0 100644 --- a/crates/ui-egui/src/field_tests.rs +++ b/crates/ui-egui/src/field_tests.rs @@ -549,3 +549,79 @@ fn a_label_too_long_for_its_field_ends_in_an_ellipsis_before_the_value() { assert!(field.contains_rect(*l) && field.contains_rect(*v), "both inside the field {field:?}: {l:?} {v:?}"); assert!(l.max.x < v.min.x, "the label stops before the value: {l:?} {v:?}"); } + +/// The middle of the field with response `id`. +fn at(u: &Ui, id: Id) -> Pos2 { + u.ctx.read_response(id.with("field")).unwrap_or_else(|| panic!("no field {id:?}")).rect.center() +} + +/// Type `text` into the field whose response is `id` and press Enter. +fn type_at(u: &mut Ui, id: Id, text: &str) { + let p = at(u, id); + click(u, p); + u.frame(vec![Event::Text(text.into())]); + key(u, Key::Enter, Modifiers::NONE); + u.frame(vec![]); +} + +/// A frame with one layout grid, its settings open in the Design panel. +fn grid_ui(grid: serde_json::Value) -> (Ui, NodeId) { + let mut s = Session::new(); + let f = id(s.execute("frame.create", &json!({"x": 0, "y": 0, "width": 400, "height": 300})).unwrap()); + s.execute("node.set", &json!({"ids": [f], "props": {"grids": [grid]}})).unwrap(); + s.execute("select.set", &json!({"ids": [f]})).unwrap(); + let mut u = Ui::new(s); + u.ctx.data_mut(|d| d.insert_temp(Id::new(("grid_open", 0usize)), true)); + u.frame(vec![]); + (u, f) +} + +/// Scroll the Design panel down: the grid settings sit below the fold on the test screen. +fn scroll_panel(u: &mut Ui) { + let wheel = Event::MouseWheel { + unit: egui::MouseWheelUnit::Point, + delta: egui::vec2(0.0, -300.0), + phase: egui::TouchPhase::Move, + modifiers: Modifiers::NONE, + }; + for _ in 0..4 { + u.frame(vec![Event::PointerMoved(pos2(1300.0, 600.0)), wheel.clone()]); + } + for _ in 0..5 { + u.frame(vec![]); + } +} + +/// The word for Auto types 0 only where 0 *is* the automatic value: a layout grid's width and +/// count do, an auto layout's gap (Auto there is "Space between") does not. Keying it on the +/// field's placeholder said 0 everywhere, which turned the gap's mode off. +#[test] +fn typing_auto_is_zero_only_where_zero_is_the_automatic_value() { + let (mut u, f) = grid_ui(json!({"kind": "columns", "align": "min", "count": 3, "size": 8, "gutter": 10})); + let size = |u: &Ui| u.app.session.doc().unwrap().node(f).unwrap().grids[0].size; + assert_eq!(size(&u), 8.0); + scroll_panel(&mut u); + type_at(&mut u, Id::new(("grid_field", "size", 0usize)), "Auto"); + assert_eq!(size(&u), 0.0, "a grid's width: Auto is 0"); + type_at(&mut u, Id::new(("grid_field", "size", 0usize)), "6"); + assert_eq!(size(&u), 6.0, "and a number is that width"); + // A stretched grid works its width out from the frame: the field shows Auto and takes no edit. + let (mut u, f) = grid_ui(json!({"kind": "columns", "align": "stretch", "count": 3, "size": 0})); + scroll_panel(&mut u); + assert!(u.ctx.read_response(Id::new(("grid_field", "size", 0usize)).with("field")).is_some(), "the width row is shown"); + type_at(&mut u, Id::new(("grid_field", "size", 0usize)), "40"); + assert_eq!(u.app.session.doc().unwrap().node(f).unwrap().grids[0].size, 0.0, "a stretched grid's width isn't set"); + + // The auto layout's gap: its placeholder says Auto, but Auto is a mode, not 0. + let mut s = Session::new(); + let f = id(s.execute("frame.create", &json!({"x": 0, "y": 0, "width": 400, "height": 300})).unwrap()); + s.execute("layout.add", &json!({"ids": [f], "direction": "vertical"})).unwrap(); + s.execute("node.set", &json!({"ids": [f], "props": {"mainAlign": "spaceBetween"}})).unwrap(); + s.execute("select.set", &json!({"ids": [f]})).unwrap(); + let mut u = Ui::new(s); + u.frame(vec![]); + let gap = |u: &Ui| u.app.session.doc().unwrap().node(f).unwrap().layout.as_ref().unwrap().gap; + let before = gap(&u); + type_at(&mut u, Id::new("al_gap"), "Auto"); + assert_eq!(gap(&u), before, "the word isn't a value where Auto is a mode"); +} diff --git a/crates/ui-egui/src/proto_panel.rs b/crates/ui-egui/src/proto_panel.rs index 85af66c59..c0a1903bd 100644 --- a/crates/ui-egui/src/proto_panel.rs +++ b/crates/ui-egui/src/proto_panel.rs @@ -924,7 +924,20 @@ pub(crate) fn action_fields(app: &mut FigApp, ui: &mut Ui, doc: &Document, page: let w = ((ui.available_width() - 6.0) / 2.0).max(36.0); for (i, (name, key)) in [("X", "proto_ov_x"), ("Y", "proto_ov_y")].into_iter().enumerate() { let shown = offset.and_then(|o| o.get(i).copied()); - let Some(e) = widgets::number_field_bindable(ui, slot.id(key), Lead::Text(name), shown, "", w, 1.0, None, tr("Auto")).0 + // "Auto" is no offset (right below the layer), not 0: the word isn't taken + // as a value here. + let Some(e) = widgets::number_field_bindable( + ui, + slot.id(key), + Lead::Text(name), + shown, + "", + w, + 1.0, + None, + widgets::Empty::Text(tr("Auto")), + ) + .0 else { continue; }; diff --git a/crates/ui-egui/src/right.rs b/crates/ui-egui/src/right.rs index f433a48a5..e5ec55ef4 100644 --- a/crates/ui-egui/src/right.rs +++ b/crates/ui-egui/src/right.rs @@ -2056,8 +2056,7 @@ fn grid_settings(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], list: &[LayoutGr // 0 is Auto for fixed-size columns (rows); a stretched grid has at least one. let count = (!auto_count(g)).then(|| f64::from(g.count.max(1))); let key = format!("layoutGrids/{i}/count"); - let e = - crate::variable_ui::number_field_or(app, ui, ids, &key, Id::new(("grid_field", "count", i)), count, col, tr("Auto"), Lead::None, ""); + let e = crate::variable_ui::number_field_auto(app, ui, ids, &key, Id::new(("grid_field", "count", i)), count, col, Lead::None, ""); app.field_run(e, "node.set", |v| { set(&|x| x.count = if x.align == GridAlign::Stretch { v.round().clamp(1.0, 1000.0) } else { v.round().clamp(0.0, 1000.0) } as u32) }); @@ -2069,8 +2068,9 @@ fn grid_settings(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], list: &[LayoutGr menu_popup(&resp).show(|ui| { for (k, (name, a)) in names.iter().zip(aligns).enumerate() { if menu_check(ui, k == cur, name, "") { - // Keep Auto (size 0); only lift stale sub-pixel sizes (0 < size < 1) to a - // sensible band, so a width typed as 0 stays Auto. + // Auto (size 0) stays Auto whatever the alignment: a stretched grid works + // its bands out from the frame, and a fixed one draws hairlines. Only a + // stale sub-pixel width (older files) is lifted to a visible band. app.run( "node.set", set(&|x| { @@ -2089,27 +2089,53 @@ fn grid_settings(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], list: &[LayoutGr }); }); let span = if cols { tr("Width") } else { tr("Height") }; + // 0 is Auto: no band, a one-pixel hairline at each band's start. A stretched grid works + // its bands out from the frame instead, so its width is not set at all. + let span_value = (g.size > 0.0).then_some(g.size); match g.align { GridAlign::Stretch => { - widgets::sublabels(ui, tr("Margin"), Some(tr("Gutter"))); + widgets::sublabels(ui, span, Some(tr("Margin"))); row(ui, 32.0, |ui| { + // The frame, divided by the count: shown as Auto and not editable. + widgets::number_field_disabled(ui, Id::new(("grid_field", "size", i)), Lead::Named(span), tr("Auto"), col); field(app, ui, "offset", g.offset, &offset); - field(app, ui, "gutter", g.gutter, &gutter); }); + widgets::sublabels(ui, tr("Gutter"), None); + row(ui, 32.0, |ui| field(app, ui, "gutter", g.gutter, &gutter)); } GridAlign::Center => { widgets::sublabels(ui, span, Some(tr("Gutter"))); row(ui, 32.0, |ui| { - let e = crate::variable_ui::number_field_or(app, ui, ids, &format!("layoutGrids/{i}/size"), Id::new(("grid_field", "size", i)), Some(g.size), col, tr("Auto"), Lead::None, ""); - app.field_run(e, "node.set", |v| set(&|x| x.size = v.max(0.0))); + let we = crate::variable_ui::number_field_auto( + app, + ui, + ids, + &format!("layoutGrids/{i}/size"), + Id::new(("grid_field", "size", i)), + span_value, + col, + Lead::None, + "", + ); + app.field_run(we, "node.set", |v| set(&|x| x.size = v.max(0.0))); field(app, ui, "gutter", g.gutter, &gutter); }); } GridAlign::Min | GridAlign::Max => { widgets::sublabels(ui, span, Some(tr("Offset"))); row(ui, 32.0, |ui| { - let e = crate::variable_ui::number_field_or(app, ui, ids, &format!("layoutGrids/{i}/size"), Id::new(("grid_field", "size", i)), Some(g.size), col, tr("Auto"), Lead::None, ""); - app.field_run(e, "node.set", |v| set(&|x| x.size = v.max(0.0))); + let we = crate::variable_ui::number_field_auto( + app, + ui, + ids, + &format!("layoutGrids/{i}/size"), + Id::new(("grid_field", "size", i)), + span_value, + col, + Lead::None, + "", + ); + app.field_run(we, "node.set", |v| set(&|x| x.size = v.max(0.0))); field(app, ui, "offset", g.offset, &offset); }); widgets::sublabels(ui, tr("Gutter"), None); diff --git a/crates/ui-egui/src/variable_ui.rs b/crates/ui-egui/src/variable_ui.rs index e6cc6860e..7f6ff6a4a 100644 --- a/crates/ui-egui/src/variable_ui.rs +++ b/crates/ui-egui/src/variable_ui.rs @@ -17,7 +17,7 @@ use crate::a11y::Tip; use crate::i18n::tr; use crate::icons::{self, Icon}; use crate::theme::{Tokens, regular, semibold}; -use crate::widgets::{self, BindEvent, Edit, FieldEdit, Lead}; +use crate::widgets::{self, BindEvent, Edit, Empty, FieldEdit, Lead}; /// What picking a variable does. #[derive(Clone)] @@ -258,7 +258,23 @@ pub fn number_field_or( lead: Lead, suffix: &str, ) -> Option { - number_field_edit(app, ui, ids, field, id, value, width, empty, lead, suffix)?.settled() + number_field_edit(app, ui, ids, field, id, value, width, Empty::Text(empty), lead, suffix)?.settled() +} + +/// [`number_field_or`] for a field where 0 is its automatic value (a layout grid's width or +/// count): typing the word for Auto sets 0. See [`widgets::number_field_auto`]. +pub fn number_field_auto( + app: &mut FigApp, + ui: &mut Ui, + ids: &[NodeId], + field: &str, + id: Id, + value: Option, + width: f32, + lead: Lead, + suffix: &str, +) -> Option { + number_field_edit(app, ui, ids, field, id, value, width, Empty::Auto, lead, suffix)?.settled() } /// [`number_field`] over several layers: a relative edit of mixed values comes back as one for @@ -274,7 +290,7 @@ pub fn number_field_mixed( suffix: &str, width: f32, ) -> Option { - number_field_edit(app, ui, ids, field, id, value, width, tr("Mixed"), lead, suffix) + number_field_edit(app, ui, ids, field, id, value, width, Empty::Text(tr("Mixed")), lead, suffix) } fn number_field_edit( @@ -285,7 +301,7 @@ fn number_field_edit( id: Id, value: Option, width: f32, - empty: &str, + empty: Empty<'_>, lead: Lead, suffix: &str, ) -> Option { diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index 294bd36c4..c8a28d48e 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -37,6 +37,25 @@ impl Lead<'_> { } } +/// What a number field shows when it has no single value, and whether that word types 0. +#[derive(Clone, Copy)] +pub enum Empty<'a> { + /// Dim text that is only a label ("Mixed", or "Auto" where 0 means something else). + Text(&'a str), + /// Auto, in the UI's language: 0 is the field's automatic value, so the word types 0. + Auto, +} + +impl<'a> Empty<'a> { + /// The text shown when the field has no value. + fn text(self) -> &'a str { + match self { + Empty::Text(s) => s, + Empty::Auto => tr("Auto"), + } + } +} + /// Result of a field edit. pub enum FieldEdit { /// Committed a new value (Enter, Tab or focus loss; an arrow key's step). @@ -157,18 +176,54 @@ pub fn number_field(ui: &mut Ui, id: Id, lead: Lead, value: Option, suffix: /// [`number_field`] over several layers: without a single value (`value` None, "Mixed") a relative /// edit comes back as one for each layer ([`Edit::Each`]). pub fn number_field_mixed(ui: &mut Ui, id: Id, lead: Lead, value: Option, suffix: &str, width: f32, step: f64) -> Option { - number_field_bindable(ui, id, lead, value, suffix, width, step, None, tr("Mixed")).0 + number_field_bindable(ui, id, lead, value, suffix, width, step, None, Empty::Text(tr("Mixed"))).0 } /// [`number_field`] that shows `empty` (dim) for no value instead of "Mixed" (e.g. "Auto"): there /// is no value to edit relative to, so `+4` is 4. pub fn number_field_or(ui: &mut Ui, id: Id, value: Option, empty: &str, width: f32, step: f64) -> Option { - number_field_impl(ui, id, Lead::None, value, "", width, step, None, empty).0?.settled() + number_field_impl(ui, id, Lead::None, value, "", width, step, None, Empty::Text(empty)).0?.settled() +} + +/// [`number_field_or`] for a field where 0 *is* its automatic value (a layout grid's width or +/// count): typing the word for Auto — the placeholder's own text in the UI's language, or the +/// English "auto" — sets 0. Only fields that ask for it get this; a field merely showing "Auto" +/// as its placeholder keeps its own meaning of 0. +pub fn number_field_auto(ui: &mut Ui, id: Id, value: Option, width: f32, step: f64) -> Option { + number_field_impl(ui, id, Lead::None, value, "", width, step, None, Empty::Auto).0?.settled() +} + +/// A number field that can't be edited, showing `empty` (dim): for a value the app works out +/// itself (a stretched grid's band width), so the row keeps its shape. +pub fn number_field_disabled(ui: &mut Ui, id: Id, lead: Lead, empty: &str, width: f32) { + let t = Tokens::get(ui.ctx()); + let (rect, _) = ui.allocate_exact_size(vec2(width, FIELD_H), Sense::hover()); + let resp = ui.interact(rect, id.with("field"), Sense::hover()); + a11y::number(&resp, lead.name(), None, "", empty); + ui.painter().rect_filled(rect, CornerRadius::same(5), t.field); + let lead_w = match lead { + Lead::None | Lead::Named(_) => 6.0, + Lead::Text(s) => text_lead_width(ui, s, width), + Lead::Icon(..) => 24.0, + }; + let lead_rect = Rect::from_min_size(rect.min, vec2(lead_w, FIELD_H)); + match lead { + Lead::Text(s) => { + let galley = crate::bidi::name_galley(ui.painter(), s, regular(11.0), t.text_tertiary, lead_w - 12.0); + ui.painter().galley(pos2(lead_rect.min.x + 8.0, rect.center().y - galley.size().y / 2.0), galley, t.text_tertiary); + } + Lead::Icon(i, _) => { + icons::paint(ui.painter(), Rect::from_center_size(lead_rect.center() + vec2(1.0, 0.0), vec2(14.0, 14.0)), i, t.icon_secondary) + } + Lead::None | Lead::Named(_) => {} + } + ui.painter().text(pos2(rect.min.x + lead_w, rect.center().y), Align2::LEFT_CENTER, empty, regular(11.0), t.text_tertiary); } /// [`number_field`] that can bind a variable: `binding` None = not bindable, `Some(None)` = shows /// a variable button on hover, `Some(Some(name))` = bound (shows the name; click to change, the -/// detach button unbinds). No value shows `empty` ("Mixed", "Auto"). +/// detach button unbinds). No value shows `empty` ("Mixed", "Auto"); [`Empty::Auto`] also takes +/// the word for Auto as 0. pub fn number_field_bindable( ui: &mut Ui, id: Id, @@ -178,7 +233,7 @@ pub fn number_field_bindable( width: f32, step: f64, binding: Option>, - empty: &str, + empty: Empty<'_>, ) -> (Option, Option) { number_field_impl(ui, id, lead, value, suffix, width, step, binding, empty) } @@ -192,7 +247,7 @@ fn number_field_impl( width: f32, step: f64, binding: Option>, - empty: &str, + empty: Empty<'_>, ) -> (Option, Option) { let t = Tokens::get(ui.ctx()); let (rect, _) = ui.allocate_exact_size(vec2(width, FIELD_H), Sense::hover()); @@ -210,7 +265,7 @@ fn number_field_impl( let editing_id = id.with("editing"); let mut editing: Option = ui.data(|d| d.get_temp(editing_id)); let field_resp = ui.interact(edit_rect, id.with("field"), Sense::click()); - a11y::number(&field_resp, lead.name(), value, suffix, empty); + a11y::number(&field_resp, lead.name(), value, suffix, empty.text()); a11y::ring_around(ui, rect, &field_resp); // The label scrubs with the pointer; the keyboard stops at the value only. let lead_resp = ui.interact(lead_rect, id.with("lead"), Sense::CLICK | Sense::DRAG); @@ -260,12 +315,12 @@ fn number_field_impl( // A relative edit of no single value goes to each layer's own. let set = |v: f64| Edit::All(FieldEdit::Set(v)); let typed = |text: &str| { - // A field whose placeholder is "Auto" (grid width/count, auto-gap, …) also takes the - // word "Auto" (or the Chinese "自动") as input, setting it to 0 — its automatic value. - let auto_token: &str = &*tr("Auto"); - if empty == auto_token { + // A field where 0 is its automatic value takes the word for Auto as input too: the + // placeholder's own text (so it is what the field shows, in the UI's language) or the + // English word. + if let Empty::Auto = empty { let t = text.trim(); - if t.eq_ignore_ascii_case("auto") || t == "自动" { + if t == empty.text() || t.eq_ignore_ascii_case("auto") { return Some(set(0.0)); } } @@ -360,7 +415,7 @@ fn number_field_impl( None => { let s = match value { Some(v) => format!("{}{}", fmt_num(v), suffix), - None => empty.to_string(), + None => empty.text().to_string(), }; let col = if value.is_some() { t.text } else { t.text_secondary }; // A value too long for its room ends in "…", so a cut number never reads as another. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 3ea38a0a1..7f7c6cb38 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -105,7 +105,7 @@ interaction feel not yet compared. | Frames and sections drawn around layers take those fully inside; sections never drop into frames | done | not in auto layout frames | | Resizing a section leaves its contents in place | done | | | Masks: what a mask hides doesn't take clicks; a mask group's box is the mask's | done | | -| Layout grids (Ctrl+G) | done | columns, rows and grid; Auto line width (0 draws a one-pixel hairline); stretch, left, centre, right; Auto count; several per frame; styles; not shown or snapped on a rotated frame; a nested frame's grids snap but only top-level frames draw them | +| Layout grids (Ctrl+G) | done | columns, rows and grid; Auto line width (0 draws a one-pixel hairline at each band's start, spaced by the gutter; a stretched grid computes its width and shows Auto dim); stretch, left, centre, right; Auto count; several per frame; styles; not shown or snapped on a rotated frame; a nested frame's grids snap but only top-level frames draw them | | Gamut warnings for Display P3 files | done | colour picker note; View ▸ Soft-proof sRGB stripes what sRGB can't show (the canvas itself is sRGB) | | Gradient and padding/gap handles on the canvas | done | | | Hover outline, selection colours, handle sizes | done | measured from UI3 screenshots | @@ -172,7 +172,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| -| 2026-10-19 | minor | Layout grids: columns and rows take an Auto line width (0 or “Auto”), drawing a one-pixel hairline down each band's middle; the width field shows “Auto” and typing it clears the width. The align menu keeps a zero width as Auto instead of forcing 60 px. Regression test added. | +| 2026-10-19 | minor | Layout grids: columns and rows take an Auto line width (0, or typing the word for Auto), drawing a one-pixel hairline at each band's start with the gutter as the step; the width field shows “Auto” and typing it clears the width; a stretched grid shows the width dim and computed. The word is taken only by the fields where 0 is Auto (the grid's width and count), not by an auto layout's gap or a prototype overlay's offset. The align menu keeps a zero width as Auto instead of forcing 60 px. Regression tests in the layout and field suites. | | 2026-10-18 | minor | A rename (layers double-click, F2, File ▸ Rename, a page) selects the whole name in the frame its field first draws, so the first key replaces the name instead of being appended. Checked in the app on Windows over the control channel | | 2026-10-17 | minor | Escape or Enter while the pen draws ends the path and keeps its vector in edit mode with the pen, so the next path is drawn into the same layer (unconnected); another Escape leaves edit mode (#760). Entering edit mode on a layer that already is a vector no longer records an empty undo step. Numbers unchanged | | 2026-10-17 | minor | Text layers keep the platform IME on for every frame of an edit, not only frames with input (an idle frame turned it off and macOS dropped each composition, #747); the candidate window opens at the caret instead of the canvas corner; keys pressed while composing go to the IME | From afa431b47a84fb6fce9f30c26c741a29777d1859 Mon Sep 17 00:00:00 2001 From: YarilaFox <102650794+YarilaFox@users.noreply.github.com> Date: Mon, 19 Oct 2026 21:26:49 +0500 Subject: [PATCH 356/817] M7: credit Archivo font in attribution --- ATTRIBUTION.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md index 1f72aeb7c..96dff6a9e 100644 --- a/ATTRIBUTION.md +++ b/ATTRIBUTION.md @@ -25,6 +25,7 @@ Release builds embed fonts from the optional craft-fonts build input | Family | Licence | Upstream | |---|---|---| | Inter | SIL Open Font License 1.1 | https://github.com/rsms/inter | +| Archivo | SIL Open Font License 1.1 | [Google Fonts / Archivo](https://github.com/google/fonts/tree/6c70c829f09ea345d3590406693220ea35c6553f/ofl/archivo) | | Roboto, Montserrat, Lato, Open Sans, Poppins, Nunito Sans, Merriweather, Playfair Display, Source Sans 3, Source Serif 4, Carlito, Caladea | SIL Open Font License 1.1 | Google Fonts / upstream repositories (see craft-fonts) | | Liberation Sans, Serif, Mono | SIL Open Font License 1.1 | https://github.com/liberationfonts | | BIZ UDPGothic, BIZ UDMincho, Shippori Mincho, Noto Sans Arabic | SIL Open Font License 1.1 | Google Fonts (see craft-fonts) | From 113d7ec1069a6c5541a187038096a3ce425ef7a3 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 19 Oct 2026 23:37:27 +0700 Subject: [PATCH 357/817] #831: overflow menu lists open files with the shared menu rows (active checked); drop the falling close animation; update tab motion in place instead of cloning it every frame --- crates/ui-egui/src/tabs.rs | 159 +++++++++++-------------------------- 1 file changed, 47 insertions(+), 112 deletions(-) diff --git a/crates/ui-egui/src/tabs.rs b/crates/ui-egui/src/tabs.rs index 047d5faa6..c10edcfd8 100644 --- a/crates/ui-egui/src/tabs.rs +++ b/crates/ui-egui/src/tabs.rs @@ -2,8 +2,6 @@ //! the title bar: its empty space drags the window (double-click maximises), and it carries the //! window buttons; the window's edges resize it. -use std::collections::{HashMap, HashSet}; - use egui::{Align2, Color32, CornerRadius, Rect, Sense, Stroke, Ui, pos2, vec2}; use serde_json::json; @@ -17,98 +15,40 @@ pub const HEIGHT: f32 = 40.0; const MIN_TAB_WIDTH: f32 = 96.0; const OVERFLOW_WIDTH: f32 = 32.0; const OPEN_TIME: f64 = 0.18; -const CLOSE_TIME: f64 = 0.24; - -#[derive(Clone)] -struct TabSnapshot { - name: String, - rect: Rect, - active: bool, -} - -#[derive(Clone)] -struct ClosingTab { - snapshot: TabSnapshot, - started: f64, -} +/// Which tabs were open last frame and when the newly opened ones appeared. It is updated in place +/// in egui's memory; it only allocates when the set of tabs changes. #[derive(Clone, Default)] struct TabMotion { initialized: bool, - known: HashSet, - opening: HashMap, - last_visible: HashMap, - closing: Vec, + known: Vec, + opening: Vec<(u64, f64)>, } impl TabMotion { - /// Track tabs added or removed since the previous frame and expire their animations. - fn begin_frame(&mut self, current: HashSet, now: f64, reduce_motion: bool) { - if self.initialized && !reduce_motion { - for uid in current.difference(&self.known) { - self.opening.insert(*uid, now); - } - for uid in self.known.difference(¤t) { - if let Some(snapshot) = self.last_visible.get(uid) { - self.closing.push(ClosingTab { snapshot: snapshot.clone(), started: now }); + /// Track tabs added since the previous frame and expire their animations. + fn begin_frame(&mut self, current: impl Iterator + Clone, now: f64, reduce_motion: bool) { + if !self.known.iter().copied().eq(current.clone()) { + if self.initialized && !reduce_motion { + for uid in current.clone().filter(|uid| !self.known.contains(uid)) { + self.opening.push((uid, now)); } } + self.known = current.collect(); } self.initialized = true; - self.known = current; - self.last_visible.clear(); if reduce_motion { self.opening.clear(); - self.closing.clear(); } else { - self.opening.retain(|uid, started| self.known.contains(uid) && now - *started < OPEN_TIME); - self.closing.retain(|tab| now - tab.started < CLOSE_TIME); + let known = &self.known; + self.opening.retain(|(uid, started)| known.contains(uid) && now - *started < OPEN_TIME); } } - - /// Return the entering tab's progress, or full width when it is not animating. - fn open_progress(&self, uid: u64, now: f64) -> f32 { - self.opening.get(&uid).map_or(1.0, |started| ((now - started) / OPEN_TIME).clamp(0.0, 1.0) as f32) - } - - /// Keep requesting frames while an opening or closing tab remains visible. - fn is_animating(&self) -> bool { - !self.opening.is_empty() || !self.closing.is_empty() - } } -/// Paint removed tabs as fading snapshots below the strip until their exit motion ends. -fn paint_closing_tabs(ui: &Ui, t: &Tokens, motion: &TabMotion, now: f64) { - if motion.closing.is_empty() { - return; - } - let painter = ui.ctx().layer_painter(egui::LayerId::new(egui::Order::Foreground, ui.id().with("closing_tabs"))); - for tab in &motion.closing { - let progress = ((now - tab.started) / CLOSE_TIME).clamp(0.0, 1.0) as f32; - let opacity = (1.0 - progress).powi(2); - let r = tab.snapshot.rect.translate(vec2(0.0, 40.0 * progress * progress)); - painter.rect_filled(r, CornerRadius::same(4), if tab.snapshot.active { t.tab_active } else { t.hover }.linear_multiply(opacity)); - icons::paint( - &painter, - Rect::from_center_size(pos2(r.min.x + 18.0, r.center().y), vec2(14.0, 14.0)), - Icon::Logo, - crate::theme::ACCENT.linear_multiply(opacity), - ); - crate::bidi::paint_name( - &painter, - pos2(r.min.x + 32.0, r.center().y), - &tab.snapshot.name, - regular(12.0), - t.text.linear_multiply(opacity), - (r.width() - 64.0).max(0.0), - ); - icons::paint( - &painter, - Rect::from_center_size(pos2(r.max.x - 16.0, r.center().y), vec2(10.0, 10.0)), - Icon::Close, - t.icon_secondary.linear_multiply(opacity), - ); - } +/// The entering tab's progress among `opening` (from [`TabMotion`]), or 1 when it is not animating. +fn open_progress(opening: &[(u64, f64)], uid: u64, now: f64) -> f32 { + opening.iter().find(|(u, _)| *u == uid).map_or(1.0, |(_, started)| ((now - started) / OPEN_TIME).clamp(0.0, 1.0) as f32) } struct TabLayout { @@ -183,9 +123,14 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { let document_tabs: Vec = app.session.docs.iter().enumerate().filter_map(|(i, d)| app.shows(d.uid).then_some(i)).collect(); let now = ui.input(|input| input.time); let motion_id = ui.id().with("tab_motion"); - let mut motion = ui.ctx().data_mut(|data| data.get_temp::(motion_id).unwrap_or_default()); - let current_uids = document_tabs.iter().filter_map(|&i| app.session.docs.get(i).map(|d| d.uid)).collect(); - motion.begin_frame(current_uids, now, app.reduce_motion()); + let current_uids = document_tabs.iter().filter_map(|&i| app.session.docs.get(i).map(|d| d.uid)); + let reduce_motion = app.reduce_motion(); + // Cloning `opening` is free while nothing animates (an empty Vec). + let opening = ui.ctx().data_mut(|data| { + let motion = data.get_temp_mut_or_default::(motion_id); + motion.begin_frame(current_uids, now, reduce_motion); + motion.opening.clone() + }); let preferred: Vec = document_tabs .iter() .map(|&i| { @@ -217,7 +162,7 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { let i = document_tabs[layout.first + slot]; let d = &app.session.docs[i]; let active = i == app.session.active && !app.ui.home && app.ui.present.is_none(); - let name = d.doc.name.clone(); + let name = &d.doc.name; // In a live session: a mark after the name says whether others get in. let live = live_mark(app, d.uid); let mark_w = if live.is_some() { 18.0 } else { 0.0 }; @@ -250,13 +195,13 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { }); } let label = match live { - Some(true) => trf("{name}, in a live session", &[("name", &name)]), - Some(false) => trf("{name}, online, open only to you", &[("name", &name)]), + Some(true) => trf("{name}, in a live session", &[("name", name)]), + Some(false) => trf("{name}, online, open only to you", &[("name", name)]), None => name.clone(), }; let resp = if live.is_some() { resp.on_hover_text(&label) } else { resp }; crate::a11y::tab(&resp, &label, active); - let progress = motion.open_progress(d.uid, now); + let progress = open_progress(&opening, d.uid, now); let paint_r = r.translate(vec2(-28.0 * (1.0 - progress).powi(2), 0.0)); let painter = ui.painter().with_clip_rect(r); if active { @@ -274,7 +219,7 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { let shown = crate::bidi::paint_name( &painter, pos2(paint_r.min.x + 32.0, paint_r.center().y), - &name, + name, regular(12.0), t.text.linear_multiply(progress), (w - mark_w - if dirty { 72.0 } else { 60.0 }).max(0.0), @@ -294,7 +239,6 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { } icons::paint(&painter, cr.shrink(4.0), Icon::Close, t.icon_secondary.linear_multiply(progress)); } - motion.last_visible.insert(d.uid, TabSnapshot { name, rect: r, active }); if cresp.clicked() { close = Some(i); } @@ -323,15 +267,13 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { ui.painter().rect_filled(r, CornerRadius::ZERO, t.hover); } icons::paint(ui.painter(), Rect::from_center_size(r.center(), vec2(14.0, 14.0)), Icon::Chevron, t.icon); - egui::Popup::menu(&resp).style(crate::right::menu_style).show(|ui| { - ui.set_min_width(180.0); + crate::right::menu_popup(&resp).show(|ui| { egui::ScrollArea::vertical().max_height(400.0).show(ui, |ui| { - for (slot, &i) in document_tabs.iter().enumerate() { - if (layout.first..layout.first + layout.widths.len()).contains(&slot) { - continue; - } - let d = &app.session.docs[i]; - if ui.button(&d.doc.name).clicked() { + for &i in &document_tabs { + let Some(d) = app.session.docs.get(i) else { continue }; + let on = i == app.session.active && !app.ui.home && app.ui.present.is_none(); + let label = if d.is_dirty() { format!("{} •", d.doc.name) } else { d.doc.name.clone() }; + if crate::right::menu_check(ui, on, &label, "") { switch = Some(i); ui.close(); } @@ -452,13 +394,9 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { app.ui.present_uid = None; } } - paint_closing_tabs(ui, &t, &motion, now); - if motion.is_animating() { + if !opening.is_empty() { ui.ctx().request_repaint(); } - ui.ctx().data_mut(|data| data.insert_temp(motion_id, motion)); - let _ = Color32::TRANSPARENT; - let _ = Align2::LEFT_TOP; }); } @@ -555,9 +493,8 @@ pub fn resize_edges(ctx: &egui::Context) { #[cfg(test)] mod layout_tests { - use super::{MIN_TAB_WIDTH, OVERFLOW_WIDTH, TabMotion, TabSnapshot, tab_drop_position, tab_layout}; + use super::{MIN_TAB_WIDTH, OPEN_TIME, OVERFLOW_WIDTH, TabMotion, open_progress, tab_drop_position, tab_layout}; use egui::{Rect, pos2}; - use std::collections::HashSet; #[test] fn tabs_shrink_to_fit_before_overflowing() { @@ -590,18 +527,16 @@ mod layout_tests { } #[test] - fn new_tabs_animate_and_closed_tabs_fall_unless_motion_is_reduced() { + fn new_tabs_animate_unless_motion_is_reduced() { let mut motion = TabMotion::default(); - motion.begin_frame(HashSet::from([1]), 0.0, false); - assert!(!motion.is_animating()); - let snapshot = TabSnapshot { name: "First".into(), rect: Rect::from_min_max(pos2(0.0, 0.0), pos2(120.0, 40.0)), active: false }; - motion.last_visible.insert(1, snapshot.clone()); - motion.begin_frame(HashSet::from([1, 2]), 1.0, false); - assert_eq!(motion.open_progress(2, 1.0), 0.0); - motion.last_visible.insert(1, snapshot); - motion.begin_frame(HashSet::from([2]), 1.05, false); - assert_eq!(motion.closing.len(), 1); - motion.begin_frame(HashSet::from([2]), 1.06, true); - assert!(!motion.is_animating()); + motion.begin_frame([1].into_iter(), 0.0, false); + assert!(motion.opening.is_empty(), "the tabs open at start-up don't animate"); + motion.begin_frame([1, 2].into_iter(), 1.0, false); + assert_eq!(open_progress(&motion.opening, 2, 1.0), 0.0); + assert_eq!(open_progress(&motion.opening, 1, 1.0), 1.0); + motion.begin_frame([1, 2].into_iter(), 1.0 + 2.0 * OPEN_TIME, false); + assert!(motion.opening.is_empty(), "the animation ends"); + motion.begin_frame([1, 2, 3].into_iter(), 2.0, true); + assert!(motion.opening.is_empty(), "Reduce motion opens tabs at once"); } } From cecc2865b04db2c145e5f46d67569bad3e9e4ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E6=9E=97=E6=A9=A6?= <108113065+yelintong@users.noreply.github.com> Date: Tue, 20 Oct 2026 00:39:29 +0800 Subject: [PATCH 358/817] Layout grids: a stretched grid's count takes no Auto CodeRabbit: typing "Auto" in the count of a stretched grid set 0, which the setter clamped to 1. The count field only takes the word where 0 is Auto (a fixed-size grid); a stretched grid's count is a plain number. --- crates/ui-egui/src/field_tests.rs | 3 +++ crates/ui-egui/src/right.rs | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/field_tests.rs b/crates/ui-egui/src/field_tests.rs index 1f9b1e5d0..9f278a54d 100644 --- a/crates/ui-egui/src/field_tests.rs +++ b/crates/ui-egui/src/field_tests.rs @@ -611,6 +611,9 @@ fn typing_auto_is_zero_only_where_zero_is_the_automatic_value() { assert!(u.ctx.read_response(Id::new(("grid_field", "size", 0usize)).with("field")).is_some(), "the width row is shown"); type_at(&mut u, Id::new(("grid_field", "size", 0usize)), "40"); assert_eq!(u.app.session.doc().unwrap().node(f).unwrap().grids[0].size, 0.0, "a stretched grid's width isn't set"); + // Nor its count: a stretched grid has at least one band, so the word commits nothing. + type_at(&mut u, Id::new(("grid_field", "count", 0usize)), "Auto"); + assert_eq!(u.app.session.doc().unwrap().node(f).unwrap().grids[0].count, 3, "a stretched grid keeps its count"); // The auto layout's gap: its placeholder says Auto, but Auto is a mode, not 0. let mut s = Session::new(); diff --git a/crates/ui-egui/src/right.rs b/crates/ui-egui/src/right.rs index e5ec55ef4..97b3f5ec4 100644 --- a/crates/ui-egui/src/right.rs +++ b/crates/ui-egui/src/right.rs @@ -2056,7 +2056,13 @@ fn grid_settings(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], list: &[LayoutGr // 0 is Auto for fixed-size columns (rows); a stretched grid has at least one. let count = (!auto_count(g)).then(|| f64::from(g.count.max(1))); let key = format!("layoutGrids/{i}/count"); - let e = crate::variable_ui::number_field_auto(app, ui, ids, &key, Id::new(("grid_field", "count", i)), count, col, Lead::None, ""); + let id = Id::new(("grid_field", "count", i)); + // A stretched grid has at least one band, so 0 (Auto) isn't a count it can take. + let e = if g.align == GridAlign::Stretch { + crate::variable_ui::number_field_or(app, ui, ids, &key, id, count, col, "", Lead::None, "") + } else { + crate::variable_ui::number_field_auto(app, ui, ids, &key, id, count, col, Lead::None, "") + }; app.field_run(e, "node.set", |v| { set(&|x| x.count = if x.align == GridAlign::Stretch { v.round().clamp(1.0, 1000.0) } else { v.round().clamp(0.0, 1000.0) } as u32) }); From 4cc2230013ed3253e957239c8374dc96e7946097 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 19 Oct 2026 23:43:38 +0700 Subject: [PATCH 359/817] #861: one search field for Pages and Layers; Escape closes it only from the field and goes no further; the search button shows when it's on; filter pages in the row loop --- crates/ui-egui/src/layers.rs | 70 ++++++-------------- crates/ui-egui/src/layers_behaviour_tests.rs | 26 ++++++-- 2 files changed, 43 insertions(+), 53 deletions(-) diff --git a/crates/ui-egui/src/layers.rs b/crates/ui-egui/src/layers.rs index 25aed36e0..cd2652f49 100644 --- a/crates/ui-egui/src/layers.rs +++ b/crates/ui-egui/src/layers.rs @@ -185,18 +185,16 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { } let sr = Rect::from_center_size(pos2(hr.max.x - 50.0, hr.center().y), vec2(24.0, 24.0)); let sresp = ui.interact(sr, ui.id().with("lsearch"), Sense::click()).tip(tr("Search pages")); - if sresp.hovered() { + if sresp.hovered() || app.ui.page_search { ui.painter().rect_filled(sr, CornerRadius::same(5), t.hover); } icons::paint(ui.painter(), sr.shrink(5.0), Icon::Search, t.icon); let search_id = Id::new("page_search_field"); - let mut focus_search = false; if sresp.clicked() { app.ui.page_search = !app.ui.page_search; app.ui.page_filter.clear(); if app.ui.page_search { app.ui.pages_open = true; - focus_search = true; } } let ar = Rect::from_center_size(pos2(hr.max.x - 22.0, hr.center().y), vec2(24.0, 24.0)); @@ -213,14 +211,12 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { return; } if app.ui.page_search { - page_search_field(app, ui, &t, w, search_id, focus_search); + search_field(ui, &t, w, search_id, tr("Search pages"), &mut app.ui.page_filter, &mut app.ui.page_search, sresp.clicked()); } let Ok(ds) = app.session.ds() else { return }; let pages: Vec<(NodeId, String, bool)> = ds.doc.pages.iter().filter_map(|p| ds.doc.node(*p).map(|n| (*p, n.name.clone(), ds.doc.is_divider(*p)))).collect(); let filter = app.ui.page_filter.trim().to_lowercase(); - let visible_pages: Vec<(NodeId, String, bool)> = - pages.iter().filter(|(_, name, divider)| filter.is_empty() || (!divider && name.to_lowercase().contains(&filter))).cloned().collect(); let filtering = !filter.is_empty(); let cur = ds.page; let uid = ds.uid; @@ -236,7 +232,10 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { // A long list scrolls in its own area, so the layers keep their room below it. let max_h = pages_list_height(app.ui.pages_height, ui.available_height()); let mut moved = egui::ScrollArea::vertical().id_salt("pages_list").max_height(max_h).show(ui, |ui| { - for (k, (id, name, divider)) in visible_pages.iter().cloned().enumerate() { + for (k, (id, name, divider)) in pages.iter().cloned().enumerate() { + if filtering && (divider || !name.to_lowercase().contains(&filter)) { + continue; + } let sense = if filtering { Sense::click() } else { Sense::click_and_drag() }; let (r, resp) = ui.allocate_exact_size(vec2(w, 32.0), sense); if !filtering { @@ -332,36 +331,6 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { pages_edge(app, ui, moved.inner_rect.height().min(moved.content_size.y)); } -/// The Pages panel's inline filter (Escape clears and closes it). -fn page_search_field(app: &mut FigApp, ui: &mut Ui, t: &Tokens, w: f32, id: Id, focus: bool) { - let (fr, _) = ui.allocate_exact_size(vec2(w, 32.0), Sense::hover()); - let field = Rect::from_min_max(pos2(fr.min.x + 12.0, fr.min.y + 2.0), pos2(fr.max.x - 12.0, fr.max.y - 6.0)); - ui.painter().rect_filled(field, CornerRadius::same(5), t.field); - icons::paint(ui.painter(), Rect::from_center_size(pos2(field.min.x + 12.0, field.center().y), vec2(12.0, 12.0)), Icon::Search, t.icon_secondary); - let te_rect = Rect::from_min_max(pos2(field.min.x + 24.0, field.center().y - 7.0), pos2(field.max.x - 6.0, field.center().y + 7.0)); - let mut child = ui.new_child(egui::UiBuilder::new().max_rect(te_rect)); - let r = child.add( - egui::TextEdit::singleline(&mut app.ui.page_filter) - .id(id) - .frame(egui::Frame::NONE) - .font(regular(11.0)) - .hint_text(tr("Search pages")) - .vertical_align(egui::Align::Center) - .desired_width(te_rect.width()), - ); - if focus { - r.request_focus(); - } - crate::widgets::select_all_on_focus(ui, &r, &app.ui.page_filter); - if r.has_focus() { - ui.painter().rect_stroke(field, CornerRadius::same(5), Stroke::new(1.0, t.accent), egui::StrokeKind::Inside); - } - if app.ui.page_search && ui.input(|i| i.key_pressed(egui::Key::Escape)) { - app.ui.page_search = false; - app.ui.page_filter.clear(); - } -} - /// The Pages list has the keyboard: a page row (or the add-page button) of the open file was /// clicked last, and the list is still on screen. pub(crate) fn pages_have_keyboard(app: &FigApp) -> bool { @@ -688,8 +657,10 @@ fn set_expanded_deep(doc: &Document, id: NodeId, open: bool, expanded: &mut BTre } } -/// The search row under the Layers header (live filter; Escape closes it). -fn search_field(app: &mut FigApp, ui: &mut Ui, t: &Tokens, w: f32, id: Id) { +/// The search row under the Pages or Layers header: a live filter `text`, taking the keyboard when +/// `focus` (just opened). Escape in it clears it and closes the row (`open`), and goes no further +/// (the canvas keeps its selection). +fn search_field(ui: &mut Ui, t: &Tokens, w: f32, id: Id, hint: &str, text: &mut String, open: &mut bool, focus: bool) { let (fr, _) = ui.allocate_exact_size(vec2(w, 32.0), Sense::hover()); let field = Rect::from_min_max(pos2(fr.min.x + 12.0, fr.min.y + 2.0), pos2(fr.max.x - 12.0, fr.max.y - 6.0)); ui.painter().rect_filled(field, CornerRadius::same(5), t.field); @@ -697,21 +668,25 @@ fn search_field(app: &mut FigApp, ui: &mut Ui, t: &Tokens, w: f32, id: Id) { let te_rect = Rect::from_min_max(pos2(field.min.x + 24.0, field.center().y - 7.0), pos2(field.max.x - 6.0, field.center().y + 7.0)); let mut child = ui.new_child(egui::UiBuilder::new().max_rect(te_rect)); let r = child.add( - egui::TextEdit::singleline(&mut app.ui.layer_filter) + egui::TextEdit::singleline(text) .id(id) .frame(egui::Frame::NONE) .font(regular(11.0)) - .hint_text(tr("Find layers")) + .hint_text(hint) .vertical_align(egui::Align::Center) .desired_width(te_rect.width()), ); - crate::widgets::select_all_on_focus(ui, &r, &app.ui.layer_filter); + // After the field: the click that opened it ends elsewhere, which would take the focus back. + if focus { + r.request_focus(); + } + crate::widgets::select_all_on_focus(ui, &r, text); if r.has_focus() { ui.painter().rect_stroke(field, CornerRadius::same(5), Stroke::new(1.0, t.accent), egui::StrokeKind::Inside); } - if (r.has_focus() || r.lost_focus()) && ui.input(|i| i.key_pressed(egui::Key::Escape)) { - app.ui.layer_search = false; - app.ui.layer_filter.clear(); + if (r.has_focus() || r.lost_focus()) && ui.input_mut(|i| i.consume_key(egui::Modifiers::NONE, egui::Key::Escape)) { + *open = false; + text.clear(); } } @@ -730,12 +705,9 @@ fn layers(app: &mut FigApp, ui: &mut Ui) { if sresp.clicked() { app.ui.layer_search = !app.ui.layer_search; app.ui.layer_filter.clear(); - if app.ui.layer_search { - ui.memory_mut(|m| m.request_focus(search_id)); - } } if app.ui.layer_search { - search_field(app, ui, &t, w, search_id); + search_field(ui, &t, w, search_id, tr("Find layers"), &mut app.ui.layer_filter, &mut app.ui.layer_search, sresp.clicked()); } let Ok(ds) = app.session.ds() else { return }; let doc = ds.doc.clone(); diff --git a/crates/ui-egui/src/layers_behaviour_tests.rs b/crates/ui-egui/src/layers_behaviour_tests.rs index a1f3685a2..b963ee827 100644 --- a/crates/ui-egui/src/layers_behaviour_tests.rs +++ b/crates/ui-egui/src/layers_behaviour_tests.rs @@ -217,16 +217,34 @@ fn pages_search_button_opens_the_filter_and_escape_clears_it() { } #[test] -fn pages_search_escape_closes_even_when_the_field_is_unfocused() { - let mut u = Ui::new(Session::new()); +fn pages_search_leaves_escape_to_the_canvas_when_the_field_is_unfocused() { + let mut s = Session::new(); + let r = rect(&mut s, "r", 0.0, None); + s.execute("select.set", &json!({"ids": [r]})).unwrap(); + let mut u = Ui::new(s); u.app.ui.page_search = true; u.app.ui.page_filter = "COMPON".into(); u.frame(vec![]); u.frame(vec![Event::Key { key: egui::Key::Escape, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::NONE }]); - assert!(!u.app.ui.page_search, "Escape closes page search without field focus"); - assert!(u.app.ui.page_filter.is_empty(), "Escape clears the filter without field focus"); + assert!(u.app.session.selection().is_empty(), "Escape deselects on the canvas"); + assert!(u.app.ui.page_search, "the page search stays open"); + assert_eq!(u.app.ui.page_filter, "COMPON", "and keeps its filter"); +} + +#[test] +fn escape_in_the_pages_search_does_not_reach_the_canvas() { + let mut s = Session::new(); + let r = rect(&mut s, "r", 0.0, None); + s.execute("select.set", &json!({"ids": [r]})).unwrap(); + let mut u = Ui::new(s); + click(&mut u, Pos2::new(246.0, 124.0), Modifiers::NONE); + assert!(u.app.ui.page_search); + u.frame(vec![Event::Text("x".into())]); + u.frame(vec![Event::Key { key: egui::Key::Escape, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::NONE }]); + assert!(!u.app.ui.page_search, "Escape closes the page search"); + assert_eq!(u.app.session.selection(), vec![r], "and leaves the selection alone"); } #[test] From 203ec13e03bd70ce696f9afabab48dd49172ce45 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 19 Oct 2026 23:43:40 +0700 Subject: [PATCH 360/817] #821: text.loadFont reads at most MAX_FONT_FILE (the font scan's 256 MiB cap) --- crates/engine/src/cmd/create.rs | 6 ++---- crates/engine/src/cmd/text.rs | 2 +- crates/text/src/fontdb.rs | 8 +++++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index 6ec7d4e59..3a9f6d67f 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -362,15 +362,13 @@ fn free_spot(s: &Session, w: f64, h: f64) -> Result<(f64, f64)> { }) } -/// The bytes of the file at `path`, within the session's allowed file roots. #[cfg(not(target_arch = "wasm32"))] -pub(super) fn read_path(path: &str) -> Result> { +fn read_path(path: &str) -> Result> { crate::file_access::read(path) } -/// The browser has no files to read: always an error. #[cfg(target_arch = "wasm32")] -pub(super) fn read_path(path: &str) -> Result> { +fn read_path(path: &str) -> Result> { Err(crate::EngineError::Other(format!("{path}: files can't be read in the browser"))) } diff --git a/crates/engine/src/cmd/text.rs b/crates/engine/src/cmd/text.rs index 0f0f003de..6e1f5c3db 100644 --- a/crates/engine/src/cmd/text.rs +++ b/crates/engine/src/cmd/text.rs @@ -497,7 +497,7 @@ pub fn specs() -> Vec { let b64 = b64.split_once(',').map(|(_, d)| d.to_string()).unwrap_or(b64); base64::engine::general_purpose::STANDARD.decode(b64.trim()).map_err(|e| bad(cmd, format!("`data`: {e}")))? } else if let Some(path) = string(p, "path") { - super::create::read_path(&path)? + super::file::read_capped(&path, figcraft_text::fontdb::MAX_FONT_FILE)? } else { return Err(bad(cmd, "pass `path` or `data` (base64)")); }; diff --git a/crates/text/src/fontdb.rs b/crates/text/src/fontdb.rs index 814d3a2f7..604f3eee5 100644 --- a/crates/text/src/fontdb.rs +++ b/crates/text/src/fontdb.rs @@ -819,13 +819,19 @@ fn scan_dir(dir: &std::path::Path, depth: usize, out: &mut BTreeMap MAX_FONT_FILE { + continue; + } + let Some(bytes) = usize::try_from(meta.len()).ok().and_then(|l| index_bytes(&path, l)) else { continue }; for (index, family, style) in faces_in(&bytes) { out.entry(family.to_lowercase()).or_insert_with(|| (family.clone(), Vec::new())).1.push(Pending { path: path.clone(), index, style }); } } } +/// The largest font file read (CJK collections run to ~120 MB, Apple Color Emoji ~180 MB). +pub const MAX_FONT_FILE: u64 = 256 * 1024 * 1024; + /// The parts of a font file the scan reads: headers, table directories and `name` tables, at their /// offsets in a zeroed buffer of the file's length (reading whole files was most of the scan). fn index_bytes(path: &std::path::Path, len: usize) -> Option> { From 7126deaed001c6e03c25046a44c80c75e8233ec5 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 19 Oct 2026 23:43:40 +0700 Subject: [PATCH 361/817] #821: es and fi labels for text.rescanFonts, text.loadFont, text.refit --- crates/ui-egui/locales/es.toml | 3 +++ crates/ui-egui/locales/fi.toml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index b4c7c3352..1af2f09f4 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -2139,6 +2139,7 @@ status = "draft — needs native review" "text.listIndent" = "Aumentar sangría de la lista" "text.listOutdent" = "Reducir sangría de la lista" "text.listStyle" = "Estilo de lista" +"text.loadFont" = "Cargar archivo de fuente" "text.maxLines" = "Máximo de líneas" "text.missingFonts" = "Fuentes que faltan" "text.numberList" = "Lista numerada" @@ -2147,7 +2148,9 @@ status = "draft — needs native review" "text.paragraphSpacing" = "Espacio entre párrafos" "text.pathOptions" = "Opciones de texto en trazado" "text.preview" = "Previsualizar cambio de texto" +"text.refit" = "Ajustar texto a las fuentes" "text.removeFromPath" = "Quitar texto del trazado" +"text.rescanFonts" = "Volver a buscar fuentes instaladas" "text.set" = "Establecer texto" "text.setFeatures" = "Funciones OpenType" "text.setVariations" = "Ejes de fuente variable" diff --git a/crates/ui-egui/locales/fi.toml b/crates/ui-egui/locales/fi.toml index db5d25794..2dff384bc 100644 --- a/crates/ui-egui/locales/fi.toml +++ b/crates/ui-egui/locales/fi.toml @@ -2141,6 +2141,7 @@ status = "draft — needs native review" "text.listIndent" = "Sisennä luettelo" "text.listOutdent" = "Vähennä luettelon sisennystä" "text.listStyle" = "Luettelotyyli" +"text.loadFont" = "Lataa fonttitiedosto" "text.maxLines" = "Rivien enimmäismäärä" "text.missingFonts" = "Puuttuvat fontit" "text.numberList" = "Numeroitu luettelo" @@ -2149,7 +2150,9 @@ status = "draft — needs native review" "text.paragraphSpacing" = "Kappaleväli" "text.pathOptions" = "Tekstipolun asetukset" "text.preview" = "Esikatsele tekstimuutosta" +"text.refit" = "Sovita teksti fontteihin" "text.removeFromPath" = "Poista teksti polulta" +"text.rescanFonts" = "Etsi asennetut fontit uudelleen" "text.set" = "Aseta teksti" "text.setFeatures" = "OpenType-ominaisuudet" "text.setVariations" = "Muuttuvan fontin akselit" From 6325a323eecb26ddf2fdf738e34fbb9230a21b74 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 19 Oct 2026 23:43:41 +0700 Subject: [PATCH 362/817] #821: move the loadFont/rescanFonts test into fonts_tests --- crates/engine/src/fonts_tests.rs | 18 ++++++++++++++++++ crates/engine/src/tests.rs | 18 ------------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/crates/engine/src/fonts_tests.rs b/crates/engine/src/fonts_tests.rs index 463fb9046..0fe6dcb3f 100644 --- a/crates/engine/src/fonts_tests.rs +++ b/crates/engine/src/fonts_tests.rs @@ -195,3 +195,21 @@ fn refit_reaches_text_in_instances() { assert_eq!(refitted(&r), vec![copy.0]); assert_eq!(width(&s, copy), want); } + +/// `text.loadFont` refuses what isn't a font file; `text.rescanFonts` reports what it added. +#[test] +fn fonts_load_from_files_and_rescans_report_new_families() { + let mut s = Session::new(); + assert!(s.execute("text.loadFont", &json!({})).is_err()); + assert!(s.execute("text.loadFont", &json!({"data": "bm90IGEgZm9udA=="})).is_err(), "not a font file"); + assert!(s.execute("text.loadFont", &json!({"data": "%%%"})).is_err()); + assert!(s.execute("text.loadFont", &json!({"path": "no-such-dir/x.ttf"})).is_err()); + if let Some(f) = figcraft_text::CRAFT_FONTS.first() { + use base64::Engine as _; + let data = base64::engine::general_purpose::STANDARD.encode(f.bytes); + let r = s.execute("text.loadFont", &json!({"data": data})).unwrap(); + assert_eq!(r["families"].as_array().map(Vec::len), Some(1)); + } + let r = s.execute("text.rescanFonts", &json!({})).unwrap(); + assert!(r["added"].is_array()); +} diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index ad3b6aa33..d6e2c9e05 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -627,21 +627,3 @@ fn find_replace_changing_only_the_case_replaces_every_occurrence() { assert_eq!(s.doc().unwrap().node(t).unwrap().kind.text().unwrap().characters, "FigCraft and FigCraft, FigCraft"); assert_eq!(s.doc().unwrap().node(f).unwrap().name, "FigCraft / FigCraft"); } - -/// `text.loadFont` refuses what isn't a font file; `text.rescanFonts` reports what it added. -#[test] -fn fonts_load_from_files_and_rescans_report_new_families() { - let mut s = sess(); - assert!(s.execute("text.loadFont", &json!({})).is_err()); - assert!(s.execute("text.loadFont", &json!({"data": "bm90IGEgZm9udA=="})).is_err(), "not a font file"); - assert!(s.execute("text.loadFont", &json!({"data": "%%%"})).is_err()); - assert!(s.execute("text.loadFont", &json!({"path": "no-such-dir/x.ttf"})).is_err()); - if let Some(f) = figcraft_text::CRAFT_FONTS.first() { - use base64::Engine as _; - let data = base64::engine::general_purpose::STANDARD.encode(f.bytes); - let r = s.execute("text.loadFont", &json!({"data": data})).unwrap(); - assert_eq!(r["families"].as_array().map(Vec::len), Some(1)); - } - let r = s.execute("text.rescanFonts", &json!({})).unwrap(); - assert!(r["added"].is_array()); -} From 9fddc4b058aa4440f8e629ea8530cef2efbe0504 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 19 Oct 2026 23:49:00 +0700 Subject: [PATCH 363/817] #854: drop the progress-doc edits (ROADMAP, gaps, parity docs, generated checklist); the maintainer adds them --- ROADMAP.md | 2 -- docs/gaps.md | 6 +----- docs/parity-checklist.md | 4 ++-- docs/target-app-parity.md | 5 ++--- docs/ui-parity.md | 5 ++--- 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 1c3db7e40..8a587286d 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -131,8 +131,6 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). ## Progress log -- **2026-10-18** · Smart-selection drag reordering (M1): Smart-selection center rings insert a layer through a regular row, column or complete top-left-aligned grid; Command/Ctrl-drag swaps entries. Unequal sizes reflow with the original gaps, hierarchy and selection stay intact, and each drag is one undo step. Escape or Undo during the drag cancels; switching documents, pages or tools rolls back the owning gesture. Mixed gaps, incomplete grids and unsupported selections keep spacing controls without reorder rings. Multiple marked items and irregular-grid insertion remain unimplemented. Engine and raw-input UI regression tests; desktop Linux before/during/after screenshots and insertion, undo/redo and Escape checked on synthetic cards. No side-by-side comparison with the incumbent. Headline estimates unchanged. Validation: 1,039 engine unit tests passed (2 ignored), 555 UI unit tests passed (1 ignored); formatting, layering, assets, parity and `cargo xtask wasm` passed. Clippy passes with only the existing `collapsible_match` findings suppressed; strict `cargo xtask ci` stops on seven findings in unchanged UI files. The workspace test run stops on the unchanged text crate’s `tail_tests::hanging_punctuation_outside_the_aligned_edge` (2 lines instead of 1); no text code changed. - - **2026-10-17** · Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. - **2026-10-17** · Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. - **2026-10-17** · Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. diff --git a/docs/gaps.md b/docs/gaps.md index 5f2255e63..9b1a770c1 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Where FigCraft falls short of Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (smart-selection drag reordering; the 2026-10-17 landings: `.fig` import fidelity, budgets for large files, the import report, a `.fig` copy from Save as and paste from another design app (gap 1); menus, the Actions palette, editor fixes, Selection colors and smart-selection spacing (gap 4); catalog counts re-measured (gap 5); bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (the 2026-10-17 landings: `.fig` import fidelity, budgets for large files, the import report, a `.fig` copy from Save as and paste from another design app (gap 1); menus, the Actions palette, editor fixes, Selection colors and smart-selection spacing (gap 4); catalog counts re-measured (gap 5); bounded canvas pan overscan; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail) · **Target:** Figma Design (desktop app 126.10.7) Every known shortfall against Figma, one entry each, ranked by how much it stops a Figma user from doing real work in FigCraft. Agents: pick work from the top unless the owner says otherwise. The @@ -174,9 +174,6 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe Layers; Paste over and Paste properties from the keyboard; then (#753) Selection colors for mixed selections and smart-selection spacing fields and canvas handles (no reorder rings). Each was checked in the app (on Windows; the submenus by their author), none side by side with Figma, none on macOS. -- **Landed (2026-10-18):** smart-selection center rings for single-layer insertion and - Command/Ctrl swaps in regular rows, columns and complete top-left-aligned grids; live preview, - cancellation and one undo step. Multiple marked layers and irregular-grid insertion remain. - **Evidence:** ROADMAP item 7 ("Left: tool by tool, panel by panel against the incumbent"). - **Impact:** Figma users notice the feel within minutes; it decides whether they stay. - **Estimate:** 40–60 h. Detail in [`ui-parity.md`](ui-parity.md). @@ -447,7 +444,6 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe | Date | Change | Summary | |---|---|---| -| 2026-10-18 | minor | Smart-selection center rings insert a layer through a regular row, column or complete top-left-aligned grid; Command/Ctrl-drag swaps entries. Unequal sizes reflow with the original gaps, hierarchy and selection stay intact, and each drag is one undo step. Escape or Undo during the drag cancels; switching documents, pages or tools rolls back the owning gesture. Mixed gaps, incomplete grids and unsupported selections keep spacing controls without reorder rings. Multiple marked items and irregular-grid insertion remain unimplemented. Engine and raw-input UI regression tests; desktop Linux before/during/after screenshots and insertion, undo/redo and Escape checked on synthetic cards. No side-by-side comparison with the incumbent. Headline estimates unchanged. | | 2026-10-17 | minor | The 2026-10-17 landings. Gap 1: a new Landed entry (community batches #727 and #728, then #745: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments, images in the message, instance layers' size and resizing overrides, Hug where nothing is recorded; budgets from the file's size; the import report; a `.fig` copy from Save as; paste from another design app), its Missing list cut to what is still left, and the wrong "whether other apps open its files is unknown" replaced by what was checked; all on synthetic files, so the beta blocker and hours stand. Gap 2: server limits, log recovery and web join links in the evidence. Gap 4: menus, the Actions palette and the editor fixes (#733, #735, #736, #729), then Selection colors and smart-selection spacing (#753) landed, none compared side by side. Gap 5: catalog counts re-measured (2,272 entries; drafts at 95–99%; Indonesian, Czech, Turkish and Swedish listed). Gap 8: the Linux and BSD clipboard changes and Wayland window controls, not run there by the maintainers. Ranking and hours unchanged | | 2026-10-15 | minor | Gap 7: bounded canvas overscan for smoother panning. Estimates and ranking unchanged. | | 2026-10-14 | minor | Russian catalog (M9), reviewed and approved by VanTan: all 2,165 current entries, Русский in Preferences and regional ru tags. Russian integer plurals use one/few/many; contributor display name VanTan added. Existing estimates unchanged. | diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index d53c9c52e..775a4fcb4 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -1,8 +1,8 @@ # Parity checklist -> **Generated:** 2026-10-18 by `cargo xtask parity`. Do not edit by hand. +> **Generated:** 2026-10-17 by `cargo xtask parity`. Do not edit by hand. -FigCraft commands registered for the incumbent's main menu and toolbar (563 commands in the engine). +FigCraft commands registered for the incumbent's main menu and toolbar (561 commands in the engine). **212 / 212 menu items (100.0%)** diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index a9a1a507a..16a5af69b 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # FigCraft parity with Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (smart-selection drag reordering; 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); 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) · **Target:** Figma Design (desktop app 126.10.7, macOS) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (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); 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) · **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 @@ -95,7 +95,7 @@ Breadth: does it exist. Ready: depth, correctness and fidelity for real projects | # | Area | Weight | Breadth | Ready | Remaining | Hours | |---|---|---|---|---|---|---| | 1 | Canvas & navigation | 6 | 98% | 74% | Outline mode's Include hidden layers and Include object bounds, Display P3 on screen, QA at extreme zooms (behaviour suite for navigation, rulers, guides, layout grids and outline mode landed: guide selection, Auto grid counts, outline-mode clicks) | 1–4 | -| 2 | Selection & transform | 8 | 97% | 72% | Handles, measuring and snapping checked tool by tool against Figma and real files (snap distance, handle reach, cursors); children turned off a right angle scale without skew, approximately (behaviour suite from the documentation, rotated groups and mixed selections, equal spacing snapping, Cmd/Ctrl to ignore constraints and marquees inside frames landed; smart-selection rings reorder single layers in regular rows, columns and complete aligned grids, with Command/Ctrl swaps; multi-item marks and irregular-grid insertion remain) | 3–5 | +| 2 | Selection & transform | 8 | 97% | 72% | Handles, measuring and snapping checked tool by tool against Figma and real files (snap distance, handle reach, cursors); children turned off a right angle scale without skew, approximately (behaviour suite from the documentation, rotated groups and mixed selections, equal spacing snapping, Cmd/Ctrl to ignore constraints and marquees inside frames landed) | 3–5 | | 3 | Layers panel | 5 | 99% | 85% | QA with long real files (behaviour suite from the documentation, Rename layers dialog, sweeping eyes and padlocks, page dragging and dividers, several layers dropped together, keyboard box selection, F2 rename, Shift+F10 context menu and 10k-layer timings landed) | 1–2 | | 4 | Shapes & vector | 8 | 99% | 73% | Corner smoothing on polygons, stars and vectors; the transform box around points of several layers; per-point caps and joins on dashed, variable-width and brush strokes; vector QA with real files (behaviour suites from the documentation, corner radius and star ratio handles, rounded vector points drawn, also beside curved segments, a cap and join per point, several handles dragged together, cut and paint bucket drags, delete and heal along the curve, a boolean group's look by operation and the miter angle landed) | 1–3 | | 5 | Paint | 7 | 90% | 71% | Video fills, wide-gamut canvas, HEIC images; plus darker in PDF (behaviour suite from the documentation, pass-through and isolating groups, clipping frames that don't isolate, plus darker, animated GIF fills, TIFF images and embedded image colour profiles landed) | 2–5 | @@ -638,7 +638,6 @@ Carried over from the ROADMAP's "Shipped so far" (2026-10-10). The test count th | Date | Change | Summary | |---|---|---| -| 2026-10-18 | minor | Smart-selection center rings insert a layer through a regular row, column or complete top-left-aligned grid; Command/Ctrl-drag swaps entries. Unequal sizes reflow with the original gaps, hierarchy and selection stay intact, and each drag is one undo step. Escape or Undo during the drag cancels; switching documents, pages or tools rolls back the owning gesture. Mixed gaps, incomplete grids and unsupported selections keep spacing controls without reorder rings. Multiple marked items and irregular-grid insertion remain unimplemented. Engine and raw-input UI regression tests; desktop Linux before/during/after screenshots and insertion, undo/redo and Escape checked on synthetic cards. No side-by-side comparison with the incumbent. Headline estimates unchanged. | | 2026-10-17 | minor | Menu breadth re-run with `cargo xtask parity`: 212 / 212 (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Rows for the 2026-10-17 landings: import/export (area 14) and the file formats dimension name the `.fig` import's new fidelity (instance identity, overrides by key, text style precedence, grid tracks, slots, connector labels, per-point joins, text on a path, image adjustments, list start numbers, vertical trim), budgets from the file's size, the import report, a `.fig` copy from Save as and paste from another design app; the localization evidence takes the re-measured catalog counts (2,272 entries, drafts at 95–99%, Indonesian and Czech drafts, Swedish and Turkish catalogs); the Automation line adds control requests answered while the window is minimised (#720); batch #753's Selection colors, smart-selection spacing, Present tab and auto layout on empty frames are in ui-parity, prototyping-parity and auto-layout-parity. Numbers unchanged: every `.fig` and paste change is checked on synthetic files or clipboard HTML made from our own export, and real files are what gap 1's blocker and the file-exchange discounts wait for; the UI changes (menus, the Actions palette, editor fixes) are not compared side by side, so UI/UX stays at 58%; the localization grade and hours stay (Indonesian's draft is offset by the drafts' new gaps) | | 2026-10-17 | minor | Automation roots (M8, #715, #481): `figcraft-cli mcp --automation-read-root DIR --automation-write-root DIR` (each repeatable, existing folders) and the desktop app with the same flags confine every file a command reads to the read and write roots and every file it writes to the write roots; paths are resolved (links followed, `..`, Windows `\\?\` and UNC paths, case) and compared by whole folder names, anything else is an ordinary error. The engine reaches the file system through one module (enforced by `crates/engine/clippy.toml`), and a sweep runs every command with paths outside the roots. `--attach` refuses the flags (the app confines itself); `ui.screenshot` and `ui.render` return PNG data without a `path`, so the attached MCP server writes no temporary files. Numbers unchanged. | | 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index eab5aafe4..766284f1d 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-10-18 · **Change:** minor (smart-selection drag reordering; 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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **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: @@ -69,7 +69,7 @@ interaction feel not yet compared. | Numeric fields: arithmetic, scrubbing by dragging the label, mixed values | done | Numeric panels use `widgets::number_field`; Typography line height, letter spacing and paragraph spacing share its leading-icon scrub logic (#373), retaining their existing unit parsing, Auto/Mixed values, variable chips and selected-character targeting (`typography_scrub_tests`). Scrubbing the label: a step a point (1 px; 1% of opacity, 1° of rotation), ten with Shift, a tenth with Alt, each stretch at the rate held while it was dragged, one undo step when let go; past the edge of the screen it goes on where the platform reports the mouse's own motion (desktop), otherwise it stops there. Arrow keys: Up/Down step a pixel field by the small nudge and Shift by the big nudge (the preferences), other fields by their own step and ten of it; they work while typing (from what is typed) and with the keyboard on the field. Typing: `+ - * /`, brackets, units (`px`, `°`, `%`, `x`, `ms`), a decimal comma; `+10`, `*2`, `/4` are relative to the value, and `50%`, `+10%`, `-10%` too in a field that isn't a percentage. Enter, Tab or a click elsewhere commits (Tab and Shift+Tab move to the next and previous control), Escape restores; a field left as it was commits nothing (no undo step, and a rounded display isn't written back). Mixed values show "Mixed": a number sets them all, a relative edit or an arrow key goes to each layer from its own value in one undo step, for X, Y, W, H, rotation, opacity, corner radius and stroke weight (elsewhere `+10` on Mixed sets 10 and `*2` does nothing) (`field_tests`). Left: scrubbing a Mixed field (nothing happens), `x2`-style suffix edits, the pointer isn't wrapped to the other side of the screen; rates not compared with Figma's | | Transform box at small sizes | done | a press inside a layer smaller than its handles moves it, the nearest handle wins, handles answer just outside and are hidden under 16 px on screen; cursors follow each handle and the box's rotation | | Locked layers | done | selectable from the layers panel; no handles, not dragged with the rest of a selection | -| Smart selection spacing | partial | with layers in a row, a column or an aligned grid selected, the Layout section shows horizontal and vertical spacing ("Mixed" until set; typed, scrubbed, fractional and negative) and pink handles in the gaps on the canvas drag them, one undo step, Escape cancels (`arrange.spacing`; sizes, parents and offsets within each track kept; at most 2,000 layers; flow children, locked layers and layers inside instances left out). Center rings drag a single layer through a regular row, column or complete top-left-aligned grid; Command/Ctrl swaps entries. Preview, target outline, Escape cancellation and one-step undo (`arrange.reorder`, `selection_reorder_tests`, `selection_spacing_tests`). Sizes, gaps and layer hierarchy kept. Mixed gaps and incomplete or differently aligned grids have no rings; multiple marked-item dragging remains. Spacing checked by its author on macOS and in the app on Windows (#402) | +| Smart selection spacing | partial | with layers in a row, a column or an aligned grid selected, the Layout section shows horizontal and vertical spacing ("Mixed" until set; typed, scrubbed, fractional and negative) and pink handles in the gaps on the canvas drag them, one undo step, Escape cancels (`arrange.spacing`; sizes, parents and offsets within each track kept; at most 2,000 layers; flow children, locked layers and layers inside instances left out). No reorder rings for swapping layers; checked by its author on macOS and in the app on Windows (#402) | | Selection colors | partial | for a mixed selection the Design panel lists their solid and gradient paints (children and text ranges included; hidden paints, masks, images, patterns and boolean operands left out; styles and variables listed apart): editing a colour changes every matching fill and stroke in one undo step, a row selects the layers that use it or applies a colour style of the document (`selection.colors`, `selection.setPaint`, `selection.applyColorStyle`, `selection.selectColor`). No library styles or variable binding from there (#403) | | Keyboard box selection | done | Alt+Space on macOS, Ctrl+Space on Windows and Linux, or F8 (`select.area`): a box around the selection or in the middle of the view; arrows move it, Cmd/Ctrl+arrows or Shift+arrows size it (Shift with Cmd/Ctrl: farther), Enter selects like a marquee (Shift+Enter toggles, Cmd/Ctrl+Enter nested), Escape closes | @@ -172,7 +172,6 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| -| 2026-10-18 | minor | Smart-selection center rings insert a layer through a regular row, column or complete top-left-aligned grid; Command/Ctrl-drag swaps entries. Unequal sizes reflow with the original gaps, hierarchy and selection stay intact, and each drag is one undo step. Escape or Undo during the drag cancels; switching documents, pages or tools rolls back the owning gesture. Mixed gaps, incomplete grids and unsupported selections keep spacing controls without reorder rings. Multiple marked items and irregular-grid insertion remain unimplemented. Engine and raw-input UI regression tests; desktop Linux before/during/after screenshots and insertion, undo/redo and Escape checked on synthetic cards. No side-by-side comparison with the incumbent. Headline estimates unchanged. | | 2026-10-18 | minor | A rename (layers double-click, F2, File ▸ Rename, a page) selects the whole name in the frame its field first draws, so the first key replaces the name instead of being appended. Checked in the app on Windows over the control channel | | 2026-10-17 | minor | Escape or Enter while the pen draws ends the path and keeps its vector in edit mode with the pen, so the next path is drawn into the same layer (unconnected); another Escape leaves edit mode (#760). Entering edit mode on a layer that already is a vector no longer records an empty undo step. Numbers unchanged | | 2026-10-17 | minor | Text layers keep the platform IME on for every frame of an edit, not only frames with input (an idle frame turned it off and macOS dropped each composition, #747); the candidate window opens at the caret instead of the canvas corner; keys pressed while composing go to the IME | From cfbb5a8f504f3c0150b0ee404621a1ac20da38cd Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 19 Oct 2026 23:49:01 +0700 Subject: [PATCH 364/817] #854: no help-centre URL in selection_reorder.rs --- crates/engine/src/selection_reorder.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/engine/src/selection_reorder.rs b/crates/engine/src/selection_reorder.rs index e538fc8bc..d54109c79 100644 --- a/crates/engine/src/selection_reorder.rs +++ b/crates/engine/src/selection_reorder.rs @@ -1,7 +1,6 @@ //! Geometry for reordering a smart selection. Only regular, non-overlapping rows, columns //! and complete top-left-aligned grids have unambiguous insertion slots. -//! Behavior reference: https://help.figma.com/hc/en-us/articles/360040450233 -//! (public documentation only; multi-item marking and irregular grids remain out of scope). +//! Marking several items and irregular grids are out of scope. use figcraft_doc::{Document, NodeId}; use figcraft_geom::{Point, Rect}; From 109b90c0aac1a9c881e126c2389da07858efa4d0 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 19 Oct 2026 23:49:02 +0700 Subject: [PATCH 365/817] #854: locale entries in sorted position --- crates/ui-egui/locales/en.toml | 2 +- crates/ui-egui/locales/es.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 132fda0bd..0544ecccd 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -8,7 +8,6 @@ name = "English" [ui] -"Reorder selection" = "Reorder selection" "% of all commits" = "% of all commits" "(no longer published)" = "(no longer published)" "({n} warnings: some entries were skipped)" = { one = "({n} warning: some entries were skipped)", other = "({n} warnings: some entries were skipped)" } @@ -1101,6 +1100,7 @@ name = "English" "Rename on the server…" = "Rename on the server…" "Rename page" = "Rename page" "Rename to" = "Rename to" +"Reorder selection" = "Reorder selection" "Replace all" = "Replace all" "Replace mixed export settings" = "Replace mixed export settings" "Replace with" = "Replace with" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index dc8bc40bf..862f05700 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -8,7 +8,6 @@ name = "Español" status = "draft — needs native review" [ui] -"Reorder selection" = "Reordenar selección" "Compatibility notes" = "Notas de compatibilidad" "Couldn't download the variables" = "No se pudieron descargar las variables" @@ -1102,6 +1101,7 @@ status = "draft — needs native review" "Rename on the server…" = "Cambiar el nombre en el servidor…" "Rename page" = "Cambiar nombre de página" "Rename to" = "Nuevo nombre" +"Reorder selection" = "Reordenar selección" "Replace all" = "Reemplazar todo" "Replace mixed export settings" = "Reemplazar ajustes de exportación mixtos" "Replace with" = "Reemplazar con" @@ -1743,7 +1743,6 @@ status = "draft — needs native review" "⌥ drag" = "⌥ arrastrar" [commands] -"arrange.reorder" = "Reordenar selección" "align.bottom" = "Alinear abajo" "align.hcenter" = "Alinear centros horizontales" "align.left" = "Alinear a la izquierda" @@ -1766,6 +1765,7 @@ status = "draft — needs native review" "arrange.front" = "Traer al frente" "arrange.packH" = "Agrupar en horizontal" "arrange.packV" = "Agrupar en vertical" +"arrange.reorder" = "Reordenar selección" "arrange.roundToPixels" = "Redondear a píxeles" "arrange.spacing" = "Espaciado" "arrange.tidy" = "Ordenar" From bb793470f1c30d3df6cfcf44148af37acaa7cd7d Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 19 Oct 2026 23:49:03 +0700 Subject: [PATCH 366/817] #854: no reorder ring on a layer under 16 px on screen, and its hit radius is at most a quarter of the layer, so a small layer still drags the selection --- crates/ui-egui/src/selection_spacing.rs | 17 ++++++++---- crates/ui-egui/src/selection_spacing_tests.rs | 26 +++++++++++++++++++ 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/selection_spacing.rs b/crates/ui-egui/src/selection_spacing.rs index 01e32d30f..3a39955ac 100644 --- a/crates/ui-egui/src/selection_spacing.rs +++ b/crates/ui-egui/src/selection_spacing.rs @@ -61,6 +61,15 @@ fn drag_id() -> Id { Id::new("selection_spacing_drag") } +/// The reorder ring of a layer with world bounds `b`: its centre on screen and hit radius. The +/// radius is 8 px, at most a quarter of the layer's smaller side on screen, so most of a small +/// layer still drags the selection; a layer under 16 px on screen has no ring. +fn ring(app: &FigApp, b: figcraft_geom::Rect) -> Option<(Pos2, f32)> { + let zoom = app.session.ds().map_or(1.0, |d| d.view.zoom); + let side = ((b.x1 - b.x0).min(b.y1 - b.y0) * zoom) as f32; + (side >= 16.0).then(|| (app.to_screen((b.x0 + b.x1) * 0.5, (b.y0 + b.y1) * 0.5), (side / 4.0).min(8.0))) +} + #[derive(Clone)] enum Action { Spacing { axis: Axis, value: f64, last_value: Option }, @@ -279,8 +288,7 @@ pub fn input(app: &mut FigApp, ctx: &egui::Context, pos: Option, hovered: let ids = app.session.selection(); if let Some(reorder) = reorder_layout(app, ctx, &ids) { for (id, b) in &reorder.slots { - let center = app.to_screen((b.x0 + b.x1) * 0.5, (b.y0 + b.y1) * 0.5); - if center.distance(p) <= 8.0 { + if ring(app, *b).is_some_and(|(center, r)| center.distance(p) <= r) { ctx.set_cursor_icon(CursorIcon::Grab); if ctx.input(|i| i.pointer.primary_pressed()) { let source = *id; @@ -329,9 +337,8 @@ pub fn draw(app: &FigApp, painter: &egui::Painter) { }; if let Some(layout) = reorder { for (id, _) in &layout.slots { - let Some(b) = ds.doc.world_bounds(*id) else { continue }; - let center = app.to_screen((b.x0 + b.x1) * 0.5, (b.y0 + b.y1) * 0.5); - let hot = hover.is_some_and(|p| center.distance(p) <= 8.0); + let Some((center, r)) = ds.doc.world_bounds(*id).and_then(|b| ring(app, b)) else { continue }; + let hot = hover.is_some_and(|p| center.distance(p) <= r); let active = matches!(drag.as_ref().map(|d| &d.action), Some(Action::Reorder { source, .. }) if source == id); if active { painter.circle_filled(center, 4.5, PINK); diff --git a/crates/ui-egui/src/selection_spacing_tests.rs b/crates/ui-egui/src/selection_spacing_tests.rs index 685f7b4e9..2ee44742f 100644 --- a/crates/ui-egui/src/selection_spacing_tests.rs +++ b/crates/ui-egui/src/selection_spacing_tests.rs @@ -333,3 +333,29 @@ fn an_externally_finished_reorder_cannot_resume_on_later_pointer_motion() { assert_eq!(u.app.session.undo_depth().0, history); assert_eq!(xy(&u, ids[0]), (260., 100.)); } + +#[test] +fn small_layers_on_screen_have_no_reorder_ring_and_drag_the_selection_from_their_middle() { + let mut u = Ui::new(Session::new()); + let z = u.app.session.ds().unwrap().view.zoom; + // 12 px squares 36 px apart on screen: a regular row, too small for rings. + let ids: Vec = (0..3) + .map(|col| { + let p = json!({"x": (100. + f64::from(col) * 36.) / z, "y": 100. / z, "width": 12. / z, "height": 12. / z}); + NodeId(u.app.session.execute("shape.rectangle", &p).unwrap()["id"].as_u64().unwrap()) + }) + .collect(); + u.app.session.execute("select.set", &json!({"ids": ids})).unwrap(); + let before: Vec<_> = ids.iter().map(|id| xy(&u, *id)).collect(); + let p = u.app.to_screen(before[0].0 + 6. / z, before[0].1 + 6. / z); + let output = u.frame_output(vec![Event::PointerMoved(p)]); + assert_ne!(output.platform_output.cursor_icon, egui::CursorIcon::Grab); + drag(&mut u, p, vec2(0., 60.), true); + let after: Vec<_> = ids.iter().map(|id| xy(&u, *id)).collect(); + assert!(after[0].1 > before[0].1, "the selection moved: {before:?} -> {after:?}"); + assert!( + before.iter().zip(&after).all(|(b, a)| (a.0 - b.0).abs() < 1e-6 && (a.1 - b.1 - (after[0].1 - before[0].1)).abs() < 1e-6), + "all together, in order" + ); + assert_eq!(u.app.session.selection(), ids); +} From 99a8ef0e26555f80c5ee8c859c8589feba972068 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 19 Oct 2026 23:55:26 +0700 Subject: [PATCH 367/817] #832: drop the progress-doc edits (ROADMAP header, log and revision rows, auto-layout-parity row); the maintainer adds them --- ROADMAP.md | 4 +--- docs/auto-layout-parity.md | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index b00408dc7..8a587286d 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (individual padding in the Layout panel, M2) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -131,7 +131,6 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). ## Progress log -- **2026-10-18** · Individual padding in the Layout panel (M2): the Spacing row's toggle opens per-side Top/Right/Bottom/Left fields in a 2×2 grid in place of the H/V fields, each bound to its own padding key with one undo step; shut H/V fields show both values ("16,54") when the sides disagree instead of "Mixed". Original code-drawn side icons, English and Spanish strings. Numbers unchanged. - **2026-10-17** · Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. - **2026-10-17** · Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. - **2026-10-17** · Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. @@ -317,7 +316,6 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| -| 2026-10-18 | minor | Individual padding in the Layout panel (M2): the Spacing row's toggle opens per-side Top/Right/Bottom/Left fields in a 2×2 grid in place of the H/V fields, each bound to its own padding key with one undo step; shut H/V fields show both values ("16,54") when the sides disagree instead of "Mixed". Original code-drawn side icons, English and Spanish strings. Numbers unchanged. | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | diff --git a/docs/auto-layout-parity.md b/docs/auto-layout-parity.md index 5342135a3..ea2cc54f5 100644 --- a/docs/auto-layout-parity.md +++ b/docs/auto-layout-parity.md @@ -64,7 +64,7 @@ Status: **pass** (a case in the suite holds), **fixed** (the suite found a diver | Nested hug/fill settling in one pass (three levels, wrapping fill text, grid rows) | done | | | 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); the Layout panel's Spacing row opens per-side padding fields (Top/Right/Bottom/Left) behind a toggle | +| 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` | | 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 | | @@ -77,7 +77,6 @@ Status: **pass** (a case in the suite holds), **fixed** (the suite found a diver | Date | Change | Summary | |---|---|---| -| 2026-10-18 | minor | Individual padding in the Layout panel (M2): the Spacing row's toggle opens per-side Top/Right/Bottom/Left fields in a 2×2 grid in place of the H/V fields, each bound to its own padding key with one undo step; shut H/V fields show both values ("16,54") when the sides disagree instead of "Mixed". Original code-drawn side icons, English and Spanish strings (`padding_individual_tests`). Numbers unchanged | | 2026-10-17 | minor | Community batch #753: adding auto layout to an empty frame keeps its size, Fixed, while a frame with content hugs it (#369); `node.set` applies auto layout keys to the frames among its targets and warns about the others, and a font style the family lacks warns with the nearest face (#603). Checked over MCP. Numbers unchanged | | 2026-10-13 | minor | Auto layout, on-canvas handles of automatic gaps (M2): the handle between spread rows or columns (and between items with an auto gap) shows the distance the layout gives the gap instead of the stored value, and dragging it makes the gap a fixed one from there, as typing a gap in the panel does; one undo step (`gap_handle_tests`). Before, the drag changed a value that had no effect. The documentation is silent on dragging an automatic gap. Numbers unchanged. | | 2026-10-13 | minor | Auto layout, wrapped-line alignment (M2): a wrapping layout's lines (rows of a horizontal one, columns of a vertical one) are packed where the cross alignment says (start, centre, end; before, they always sat at the start), stretch when every child fills across the flow, or take the free space between them (`contentAlign: spaceBetween`, the Design panel's Row/Column gap mode, the alignment pad lighting the whole cross axis). Read from REST JSON and `.fig`, written to `.fig`, `align-content` in CSS, an instance override with the other alignment settings. 13 hand-computed layout cases and command tests. Numbers unchanged. | From 742e911652b41cc1bed3428a422533ee0709adfd Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 19 Oct 2026 23:58:26 +0700 Subject: [PATCH 368/817] #832: the per-side fields are two plain rows like Individual corners (toggle in the first); shut H/V fields read Mixed when their sides disagree; no comment naming the incumbent --- crates/ui-egui/src/layout_panel.rs | 143 +++++++----------- .../ui-egui/src/padding_individual_tests.rs | 6 +- 2 files changed, 60 insertions(+), 89 deletions(-) diff --git a/crates/ui-egui/src/layout_panel.rs b/crates/ui-egui/src/layout_panel.rs index 6c8d66935..b5ff1d45f 100644 --- a/crates/ui-egui/src/layout_panel.rs +++ b/crates/ui-egui/src/layout_panel.rs @@ -4,7 +4,7 @@ //! alignment in its cell, and clip content. Everything goes through `node.set` props or `layout.*` //! commands. -use egui::{Align, Align2, CornerRadius, Id, Layout, Rect, Sense, Stroke, StrokeKind, Ui, pos2, vec2}; +use egui::{Align2, CornerRadius, Id, Rect, Sense, Stroke, StrokeKind, Ui, pos2, vec2}; use figcraft_doc::*; use serde_json::json; @@ -401,97 +401,66 @@ fn alignment(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], l: &AutoLayout) { } } -/// The Spacing row: gap fields, then the H/V padding pair (or the 2x2 per-side -/// grid while the individual-padding toggle is open). +/// The Spacing row: the H/V padding pair, or, with Individual padding on, two rows of one field +/// per side (like Individual corners). fn spacing(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], l: &AutoLayout) { let col = widgets::col_width(ui.available_width()); let [pt, pr, pb, pl] = l.padding; let open = ui.data(|d| d.get_temp::(Id::new("indep_padding"))).unwrap_or(false); - if open { - // Each side on its own, like Figma's individual padding: a 2x2 grid of sides with - // the toggle at its right, replacing the H/V row while open. Every measure copies - // a plain row: 32px rows, the panel's own inter-row gap, 8px between the fields. - let gap = ui.spacing().item_spacing.y; - let total = 32.0 * 2.0 + gap; - let fields_w = col * 2.0 + 8.0; - let top = ("paddingTop", tr("Top padding"), Icon::PaddingTop, pt, 0); - let right = ("paddingRight", tr("Right padding"), Icon::PaddingRight, pr, 1); - let bottom = ("paddingBottom", tr("Bottom padding"), Icon::PaddingBottom, pb, 2); - let left = ("paddingLeft", tr("Left padding"), Icon::PaddingLeft, pl, 3); - block(ui, total, 0.0, |ui| { - ui.allocate_ui_with_layout(vec2(fields_w, total), Layout::top_down(Align::LEFT), |ui| { - ui.spacing_mut().item_spacing.y = 0.0; - // The horizontal pair (left, right) on the left, the vertical pair on the right. - for (r, pair) in [[&left, &top], [&right, &bottom]].iter().enumerate() { - if r > 0 { - ui.add_space(gap); - } - ui.allocate_ui_with_layout(vec2(fields_w, 32.0), Layout::left_to_right(Align::Center), |ui| { - ui.spacing_mut().item_spacing.x = 8.0; - for (key, name, icon, v, k) in pair.iter() { - let e = crate::variable_ui::number_field( - app, - ui, - ids, - key, - Id::new(("padding", *k)), - Lead::Icon(*icon, name), - Some(*v), - "", - col, - ); - app.field(ids, key, e, |v| json!(v.max(0.0))); - } - }); - } - }); - // The toggle keeps the shut row's rect: full-height strip, button 4px - // down, centred in the top 32px exactly like the shut row. - ui.allocate_ui_with_layout(vec2(24.0, total), Layout::top_down(Align::Center), |ui| { - ui.add_space(4.0); - if icons::button(ui, Icon::IndependentPadding, 24.0, true, tr("Individual padding")).clicked() { - ui.data_mut(|d| d.insert_temp(Id::new("indep_padding"), false)); - } - }); - }); - return; - } - row(ui, 32.0, |ui| { - // Sides that disagree show both values ("16,54") instead of "Mixed". - let h_pair = format!("{},{}", widgets::fmt_num(pl), widgets::fmt_num(pr)); - let h_empty = if pl == pr { tr("Mixed") } else { h_pair.as_str() }; - let e = crate::variable_ui::number_field_or( - app, - ui, - ids, - "paddingHorizontal", - Id::new("al_padh"), - (pl == pr).then_some(pl), - col, - h_empty, - Lead::Icon(Icon::PaddingH, tr("Horizontal padding")), - "", - ); - app.field(ids, "paddingHorizontal", e, |v| json!(v.max(0.0))); - let v_pair = format!("{},{}", widgets::fmt_num(pt), widgets::fmt_num(pb)); - let v_empty = if pt == pb { tr("Mixed") } else { v_pair.as_str() }; - let e = crate::variable_ui::number_field_or( - app, - ui, - ids, - "paddingVertical", - Id::new("al_padv"), - (pt == pb).then_some(pt), - col, - v_empty, - Lead::Icon(Icon::PaddingV, tr("Vertical padding")), - "", - ); - app.field(ids, "paddingVertical", e, |v| json!(v.max(0.0))); - if icons::button(ui, Icon::IndependentPadding, 24.0, false, tr("Individual padding")).clicked() { - ui.data_mut(|d| d.insert_temp(Id::new("indep_padding"), true)); + let toggle = |ui: &mut Ui| { + if icons::button(ui, Icon::IndependentPadding, 24.0, open, tr("Individual padding")).clicked() { + ui.data_mut(|d| d.insert_temp(Id::new("indep_padding"), !open)); } - }); + }; + if open { + // `l` is the selection's common layout, so its sides are common too. `k` indexes + // [top, right, bottom, left]. + let sides = [ + ("paddingLeft", tr("Left padding"), Icon::PaddingLeft, pl, 3), + ("paddingTop", tr("Top padding"), Icon::PaddingTop, pt, 0), + ("paddingRight", tr("Right padding"), Icon::PaddingRight, pr, 1), + ("paddingBottom", tr("Bottom padding"), Icon::PaddingBottom, pb, 2), + ]; + for (r, pair) in sides.chunks(2).enumerate() { + row(ui, 32.0, |ui| { + for (key, name, icon, v, k) in pair { + let e = crate::variable_ui::number_field(app, ui, ids, key, Id::new(("padding", *k)), Lead::Icon(*icon, name), Some(*v), "", col); + app.field(ids, key, e, |v| json!(v.max(0.0))); + } + if r == 0 { + toggle(ui); + } + }); + } + } else { + row(ui, 32.0, |ui| { + let e = crate::variable_ui::number_field( + app, + ui, + ids, + "paddingHorizontal", + Id::new("al_padh"), + Lead::Icon(Icon::PaddingH, tr("Horizontal padding")), + (pl == pr).then_some(pl), + "", + col, + ); + app.field(ids, "paddingHorizontal", e, |v| json!(v.max(0.0))); + let e = crate::variable_ui::number_field( + app, + ui, + ids, + "paddingVertical", + Id::new("al_padv"), + Lead::Icon(Icon::PaddingV, tr("Vertical padding")), + (pt == pb).then_some(pt), + "", + col, + ); + app.field(ids, "paddingVertical", e, |v| json!(v.max(0.0))); + toggle(ui); + }); + } if l.mode != LayoutMode::Grid && l.wrap { // Wrapped rows (horizontal) or columns (vertical): the gap between them. let vertical = l.mode == LayoutMode::Vertical; diff --git a/crates/ui-egui/src/padding_individual_tests.rs b/crates/ui-egui/src/padding_individual_tests.rs index 28a207bc8..bc95886e9 100644 --- a/crates/ui-egui/src/padding_individual_tests.rs +++ b/crates/ui-egui/src/padding_individual_tests.rs @@ -90,13 +90,15 @@ fn named_field(u: &mut Ui, label: &str) -> Pos2 { pos2(((b.x0 + b.x1) / 2.0) as f32, ((b.y0 + b.y1) / 2.0) as f32) } -/// The shut pair fields edit their own axis: horizontal touches left and right -/// only, vertical touches top and bottom only. +/// The shut pair fields read Mixed when their sides disagree and edit their own axis: horizontal +/// touches left and right only, vertical touches top and bottom only. #[test] fn shut_pair_fields_edit_their_own_axis() { let (mut u, f) = scene(); u.app.run("node.set", json!({"ids": [f], "props": {"paddingLeft": 16.0, "paddingRight": 54.0}})); assert_eq!(padding(&u, f), [10.0, 54.0, 10.0, 16.0]); + let shown = crate::live_tests::texts(&crate::live_tests::flat(&u.frame_output(vec![]).shapes)); + assert!(shown.iter().any(|(t, _, _)| t == "Mixed"), "sides that disagree read Mixed: {shown:?}"); let h = named_field(&mut u, "Horizontal padding"); click(&mut u, h); u.frame(vec![Event::Text("20".into())]); From 08c3f8f9441b1c2a237c41c828334a7914b7d0aa Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 19 Oct 2026 23:59:59 +0700 Subject: [PATCH 369/817] #812: mark Polish as a machine draft (status line, neutral header) --- crates/ui-egui/locales/pl.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/locales/pl.toml b/crates/ui-egui/locales/pl.toml index de3c727e8..1e9c79551 100644 --- a/crates/ui-egui/locales/pl.toml +++ b/crates/ui-egui/locales/pl.toml @@ -1,10 +1,10 @@ # FigCraft interface strings: Polish. # -# Complete, native-quality Polish localization for FigCraft. -# Clean-room implementation adhering strictly to ArtCraft standards. +# Draft: machine-drafted, waiting for a native speaker's review. [meta] name = "Polski" +status = "draft — needs native review" [ui] "% of all commits" = "% wszystkich commitów" From 75784f24d66dc4529eb48dcc609393b088f48f14 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 00:00:00 +0700 Subject: [PATCH 370/817] #812: Polish for the UI strings and commands main added since --- crates/ui-egui/locales/pl.toml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/crates/ui-egui/locales/pl.toml b/crates/ui-egui/locales/pl.toml index 1e9c79551..aa5b7533a 100644 --- a/crates/ui-egui/locales/pl.toml +++ b/crates/ui-egui/locales/pl.toml @@ -90,6 +90,7 @@ status = "draft — needs native review" "All components" = "Wszystkie komponenty" "All fonts" = "Wszystkie czcionki" "All supported properties" = "Wszystkie obsługiwane właściwości" +"All the fonts this file uses are installed" = "Wszystkie czcionki używane w tym pliku są zainstalowane" "All variables" = "Wszystkie zmienne" "Alpha" = "Alfa" "Alphabetical" = "Alfabetycznie" @@ -196,6 +197,7 @@ status = "draft — needs native review" "C or ⇧C" = "C lub ⇧C" "CMYK colour" = "Kolor CMYK" "Can view" = "Może przeglądać" +"Checking the fonts installed on this computer…" = "Sprawdzanie czcionek zainstalowanych na tym komputerze…" "Checking the server…" = "Sprawdzanie serwera…" "Clear from this list" = "Usuń z tej listy" "Code or invite link" = "Kod lub link z zaproszeniem" @@ -316,6 +318,7 @@ status = "draft — needs native review" "Corner smoothing" = "Wygładzanie narożników (Corner smoothing)" "Couldn't download the variables" = "Nie udało się pobrać zmiennych" "Couldn't reach {server}: showing what this computer remembers." = "Nie udało się połączyć z {server}: pokazywanie zawartości zapamiętanej przez ten komputer." +"Couldn't read {name}." = "Nie udało się odczytać pliku {name}." "Couldn't save automatically: {error}" = "Nie udało się zapisać automatycznie: {error}" "Count" = "Licznik" "Create" = "Utwórz" @@ -646,6 +649,7 @@ status = "draft — needs native review" "Instance swap (no other component)" = "Podmiana instancji (brak innego komponentu)" "Instances" = "Instancje" "Instant" = "Natychmiastowo" +"Intensity" = "Intensywność" "Interaction" = "Interakcja" "Interactions" = "Interakcje" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Projektowanie interfejsów i prototypowanie. Darmowe, otwartoźródłowe, czysto implementowane narzędzie projektowe napisane od podstaw w Rust, część ArtCraft Crafting Apps." @@ -770,6 +774,7 @@ status = "draft — needs native review" "Mirror angle and length" = "Kąt i długość odbicia lustrzanego" "Mirroring" = "Odbicie lustrzane" "Missing" = "Brak" +"Missing fonts" = "Brakujące czcionki" "Missing layer" = "Brakująca warstwa" "Missing style" = "Brakujący styl" "Missing variable" = "Brakująca zmienna" @@ -829,6 +834,7 @@ status = "draft — needs native review" "No contributor data was built into this copy." = "Ta kopia nie zawiera danych o współtwórcach." "No device" = "Brak urządzenia" "No fonts match" = "Brak pasujących czcionek" +"No files or templates match your search" = "Żaden plik ani szablon nie pasuje do wyszukiwania" "No join code here (the server is older than join codes, or this address can't be put in one): share the link instead." = "Brak kodu dołączenia (serwer jest starszy niż kody dołączenia lub ten adres nie może być zakodowany): zamiast tego udostępnij link." "No layer changes to show." = "Brak zmian warstw do wyświetlenia." "No libraries yet. Add a .figcraft file that was published as a library, or paste a team library's link." = "Brak bibliotek. Dodaj plik .figcraft opublikowany jako biblioteka lub wklej link do biblioteki zespołu." @@ -1174,6 +1180,8 @@ status = "draft — needs native review" "Search actions, layers and tools" = "Szukaj akcji, warstw i narzędzi" "Search assets" = "Szukaj zasobów" "Search comments" = "Szukaj komentarzy" +"Search files and templates" = "Szukaj plików i szablonów" +"Search results" = "Wyniki wyszukiwania" "Search fonts" = "Szukaj czcionek" "Search layers" = "Szukaj warstw" "Search shortcuts" = "Szukaj skrótów" @@ -1373,6 +1381,7 @@ status = "draft — needs native review" "This condition is edited as an expression" = "Ten warunek jest edytowany jako wyrażenie" "This file" = "Ten plik" "This file has unsaved changes" = "Ten plik ma niezapisane zmiany" +"This file uses fonts that aren't installed on this computer. Their text is drawn in a fallback font until you install them." = "Ten plik używa czcionek, które nie są zainstalowane na tym komputerze. Do czasu ich zainstalowania tekst jest wyświetlany czcionką zastępczą." "This file is on {server}, open only to you. Share it to let others in with a new code." = "Ten plik znajduje się na {server}, otwarty tylko dla Ciebie. Udostępnij go, aby wpuścić innych nowym kodem." "This frame is new on the branch." = "Ta ramka jest nowa w gałęzi." "This frame isn't on the branch." = "Tej ramki nie ma w gałęzi." @@ -1402,6 +1411,7 @@ status = "draft — needs native review" "Truncate with an ellipsis" = "Utnij tekst z wielokropkiem (…)" "Try again" = "Spróbuj ponownie" "Try another search or filter." = "Wypróbuj inne wyszukiwanie lub filtr." +"Try another search, or browse templates." = "Spróbuj innego wyszukiwania lub przejrzyj szablony." "Try another word, or look at every kind." = "Wypróbuj inne słowo lub przejrzyj wszystkie typy." "Turn a layer into a component, reuse it, and change every copy at once" = "Przekształć warstwę w komponent, używaj jej ponownie i modyfikuj wszystkie kopie naraz" "Two digits" = "Dwie cyfry" @@ -1592,6 +1602,7 @@ status = "draft — needs native review" "nobody else here yet" = "nikogo innego tu jeszcze nie ma" "non-default slot settings are not represented and were skipped" = "niedomyślne ustawienia gniazd nie są reprezentowane i zostały pominięte" "now" = "teraz" +"only in a text style or variable" = "tylko w stylu tekstu lub zmiennej" "or" = "lub" "point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "połączenia punktów obrysu zostały zachowane; obrysy przerywane lub o zmiennej szerokości renderują się z łączeniem warstwy" "preferred slot component keys cannot be resolved to file nodes and were skipped" = "klucze preferowanych komponentów gniazda nie mogą zostać dopasowane do węzłów pliku i zostały pominięte" @@ -1614,6 +1625,7 @@ status = "draft — needs native review" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "akcje set-variable-mode dla kolekcji lub trybów, których nie ma w pliku JSON ze zmiennymi, zostały pominięte" "slot content assignment target is missing or is not slot content" = "cel przypisania zawartości gniazda nie istnieje lub nie jest zawartością gniazda" "slot content assignment uses the empty GUID sentinel and was skipped" = "przypisanie zawartości gniazda używa pustego identyfikatora GUID i zostało pominięte" +"slot layers without a matching slot property were imported as frames" = "warstwy gniazd bez pasującej właściwości gniazda zostały zaimportowane jako ramki" "some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "niektóre punkty wektorowe odwołują się do ustawień punktów brakujących w pliku; używają połączeń warstwy i zwykłych narożników" "some vector segments refer to style settings missing from the file; they use the layer's stroke" = "niektóre segmenty wektorowe odwołują się do ustawień stylu brakujących w pliku; używają obrysu warstwy" "stale or invalid grid track sizing entries were ignored" = "nieaktualne lub nieprawidłowe wpisy rozmiarów ścieżek siatki zostały zignorowane" @@ -1655,6 +1667,7 @@ status = "draft — needs native review" "{name} is forgotten on this computer; the file stays on {server}" = "{name} usunięto z pamięci tego komputera; plik pozostaje na {server}" "{name} is on the server." = "{name} znajduje się na serwerze." "{name} is spotlighting" = "{name} prezentuje widok (spotlight)" +"{name} is too large to open in the browser (over 512 MB)." = "Plik {name} jest za duży, aby otworzyć go w przeglądarce (ponad 512 MB)." "{name}\nClick to apply to the selection" = "{name}\nKliknij, aby zastosować do zaznaczenia" "{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}\nPrzeciągnij na płótno lub kliknij, aby umieścić na środku widoku.\nPrzytrzymaj klawisz Alt (Option) podczas upuszczania na instancję, aby ją zamienić." "{name} (from {library})" = "{name} (z biblioteki {library})" @@ -1699,6 +1712,7 @@ status = "draft — needs native review" "{n} replies" = { one = "{n} odpowiedź", few = "{n} odpowiedzi", many = "{n} odpowiedzi", other = "{n} odpowiedzi" } "{n} rows" = { one = "{n} wiersz", few = "{n} wiersze", many = "{n} wierszy", other = "{n} wierszy" } "{n} styles" = { one = "{n} styl", few = "{n} style", many = "{n} stylów", other = "{n} stylów" } +"{n} text layers" = { one = "{n} warstwa tekstowa", few = "{n} warstwy tekstowe", many = "{n} warstw tekstowych", other = "{n} warstw tekstowych" } "{n} variables" = { one = "{n} zmienna", few = "{n} zmienne", many = "{n} zmiennych", other = "{n} zmiennych" } "{n} weeks ago" = { one = "{n} tydzień temu", few = "{n} tygodnie temu", many = "{n} tygodni temu", other = "{n} tygodni temu" } "{n} years ago" = { one = "{n} rok temu", few = "{n} lata temu", many = "{n} lat temu", other = "{n} lat temu" } @@ -1783,6 +1797,7 @@ status = "draft — needs native review" "collab.publish" = "Opublikuj na serwerze" "collab.recoverFile" = "Odzyskaj plik online" "collab.registerLinks" = "Otwieraj linki z zaproszeniem w FigCraft" +"collab.removePerson" = "Usuń z sesji" "collab.report" = "Zgłoś plik operatorowi serwera" "collab.serverInfo" = "Informacje o serwerze" "collab.share" = "Udostępnij z kodem dołączenia" @@ -1960,6 +1975,7 @@ status = "draft — needs native review" "object.batchRename" = "Zmień nazwy wsadowo…" "object.convertToFrame" = "Konwertuj na ramkę" "object.convertToGroup" = "Konwertuj na grupę" +"object.convertToSection" = "Konwertuj na sekcję" "object.flipH" = "Odbij w poziomie" "object.flipV" = "Odbij w pionie" "object.frameSelection" = "Umieść zaznaczenie w ramce" @@ -2006,6 +2022,7 @@ status = "draft — needs native review" "plugin.ui" = "Panel wtyczki" "plugins.manage" = "Zarządzaj wtyczkami…" "plugins.runLast" = "Uruchom ponownie ostatnią wtyczkę" +"pref.autoSave" = "Zapisuj pliki automatycznie" "pref.highlightHover" = "Podświetlaj warstwy przy najechaniu myszą" "pref.keepTool" = "Zachowaj wybrane narzędzie po użyciu" "pref.language" = "Język interfejsu" @@ -2122,6 +2139,7 @@ status = "draft — needs native review" "text.listOutdent" = "Zmniejsz wcięcie listy" "text.listStyle" = "Styl listy" "text.maxLines" = "Maksymalna liczba wierszy" +"text.missingFonts" = "Brakujące czcionki" "text.numberList" = "Lista numerowana" "text.onPath" = "Tekst na ścieżce" "text.paragraphIndent" = "Wcięcie akapitu" From d087645a00f07c62c47549b3c6bbb83217b9511a Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 00:00:03 +0700 Subject: [PATCH 371/817] #812: Polish in docs/translating.md and the plural comment --- crates/ui-egui/src/i18n.rs | 2 +- docs/translating.md | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs index 4a7ef81ce..98bc3d8f7 100644 --- a/crates/ui-egui/src/i18n.rs +++ b/crates/ui-egui/src/i18n.rs @@ -183,7 +183,7 @@ fn plural(code: &str, n: usize) -> Plural { } // CLDR's million-count "many" in French, Spanish and Portuguese still reads their existing -// "other" wording. Czech supplies separate few forms; Russian supplies few/many forms. +// "other" wording. Czech supplies separate few forms; Russian and Polish supply few/many forms. /// Whether count `n` takes the "one" form: 0 and 1 in French and Brazilian Portuguese, never in /// Japanese, Korean and Chinese (no plural forms: always "other"), 1 elsewhere (CLDR's integer rules). diff --git a/docs/translating.md b/docs/translating.md index d8addcbc7..a6acd9b0b 100644 --- a/docs/translating.md +++ b/docs/translating.md @@ -16,8 +16,8 @@ Simplified. The catalogs: English (`en`, the source), and Spanish (`es`, with the Latin American overlay `es-419`), French (`fr`), German (`de`), Dutch (`nl`), Brazilian Portuguese (`pt-BR`), Japanese -(`ja`), Korean (`ko`), Simplified Chinese (`zh-Hans`), Czech (`cs`), Indonesian (`id`) and Finnish -(`fi`), machine-drafted and waiting for native speakers' review. Russian (`ru`, Русский) was +(`ja`), Korean (`ko`), Simplified Chinese (`zh-Hans`), Czech (`cs`), Indonesian (`id`), Finnish +(`fi`) and Polish (`pl`), machine-drafted and waiting for native speakers' review. Russian (`ru`, Русский) was reviewed and approved by VanTan; its catalog keeps Frame, Dev Mode 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. @@ -81,6 +81,8 @@ language also needs its script in `cjk::language`. a missing key uses the fallback catalog's own plural rule. Czech uses `one` for 1, `few` for 2–4 and `other` for 0 and 5+ (e.g. `{n} vrstva`, `{n} vrstvy`, `{n} vrstev`). Keep `{n}` in all three forms. Czech's CLDR `many` applies only to decimals; `trn` takes integer counts. + Polish uses `one` for 1 only, `few` like Russian (2–4, 22–24… except 12–14) and `many` for + the other integers, including 0 and 21 (e.g. `{n} warstwa`, `{n} warstwy`, `{n} warstw`). 4. To require full coverage, add the code to `COMPLETE` in [`crates/ui-egui/src/i18n_tests.rs`](../crates/ui-egui/src/i18n_tests.rs). Every later PR that adds a string then has to translate it into each complete language, so only Spanish is there: From f2ede63dd931502f81f1f72f7d92e5795ac2507f Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 00:00:09 +0700 Subject: [PATCH 372/817] #867: comments describe the line separator without naming another product --- crates/text/src/layout.rs | 6 +++--- crates/text/src/line_separator_tests.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/text/src/layout.rs b/crates/text/src/layout.rs index 014bb1cde..26ae3d338 100644 --- a/crates/text/src/layout.rs +++ b/crates/text/src/layout.rs @@ -160,8 +160,8 @@ fn deco_len(m: DecorationLength, size: f64, auto: f64) -> f64 { if v.is_finite() { v } else { auto } } -/// The line separator (U+2028): a line break inside a paragraph, as Figma's Shift+Enter stores it -/// (imported text keeps it; typed text has newlines only). +/// The line separator (U+2028): a line break inside a paragraph, as `.fig` files store a soft +/// break (imported text keeps it; typed text has newlines only). const LINE_SEPARATOR: char = '\u{2028}'; /// A char that ends its line: a newline (which also ends the paragraph) or a line separator. @@ -479,7 +479,7 @@ pub fn layout(text: &TextData, box_width: Option, box_height: Option) para += 1; continue; } - // A line separator (Figma's Shift+Enter) breaks the line inside its paragraph: no + // A line separator (a soft break) breaks the line inside its paragraph: no // paragraph spacing and no new list marker after it. if it.ch == LINE_SEPARATOR { lines.push((line_start, i + 1, false, para)); diff --git a/crates/text/src/line_separator_tests.rs b/crates/text/src/line_separator_tests.rs index 6891f97b1..13f91786c 100644 --- a/crates/text/src/line_separator_tests.rs +++ b/crates/text/src/line_separator_tests.rs @@ -1,4 +1,4 @@ -//! A line separator (U+2028: what Figma's Shift+Enter stores, and `.fig` imports keep) breaks the +//! A line separator (U+2028: a soft break in `.fig` files, kept on import) breaks the //! line inside its paragraph: no paragraph spacing or new list marker after it, and no glyph (#852). use super::*; @@ -41,7 +41,7 @@ fn breaks_the_line_but_not_the_paragraph() { #[test] fn before_a_newline_or_at_the_end_it_leaves_an_empty_line() { - // "Hi,⏎¶Season" in #852: Figma shows an empty line between the two. + // "Hi,⏎¶Season" in #852: an empty line between the two. let Some(t) = text("Hi,\u{2028}\nSeason") else { return }; let l = layout(&t, None, None); assert_eq!(line_texts(&t, &l), ["Hi,\u{2028}", "\n", "Season"]); From 7543759150cb3cd0b39536c8db5f60d932711dbc Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 00:02:46 +0700 Subject: [PATCH 373/817] #872: leave the progress docs (ROADMAP, localization-parity) to the maintainer --- ROADMAP.md | 4 ++-- docs/localization-parity.md | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index bceed27a2..8a587286d 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -111,9 +111,9 @@ native speakers' reviews of the six language drafts need people. | Korean | ko | 95% | draft (needs native review) | | Vietnamese | vi | 0% | none | -Percentages measured 2026-10-17 over 2,272 entries (strings added since a draft show English). Also shipped: Russian (`ru`, 99%, reviewed by VanTan), Swedish (`sv`, 99.6%, command labels since 2026-10-17; native review welcome), Turkish (`tr`, 99%), Czech (`cs`, 99%, draft) and Georgian (`ka`, 100%, draft). Figma ships English, Japanese, Korean, French, German, Spanish and Portuguese +Percentages measured 2026-10-17 over 2,272 entries (strings added since a draft show English). Also shipped: Russian (`ru`, 99%, reviewed by VanTan), Swedish (`sv`, 99.6%, command labels since 2026-10-17; native review welcome), Turkish (`tr`, 99%) and Czech (`cs`, 99%, draft). Figma ships English, Japanese, Korean, French, German, Spanish and Portuguese (Brazil); FigCraft has the localization layer, English and Spanish (Spain and Latin America), -French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Georgian drafts (Preferences ▸ +French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese and Indonesian drafts (Preferences ▸ Language; Traditional Chinese has no catalog; CJK UI text uses an installed CJK font, loaded only when needed; adding a language: [`docs/translating.md`](docs/translating.md)). Document text in any script (bidi, Arabic shaping, diff --git a/docs/localization-parity.md b/docs/localization-parity.md index ccf8c22ac..50fcd4ec3 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -1,10 +1,10 @@ # Localization parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-19 · **Change:** minor (Georgian (`ka`) draft catalog; macOS finds its downloadable CJK system fonts (#406); string counts re-measured: 2,272 entries, the drafts at 95–99%; Swedish command labels and menu wordings; Russian, Swedish, Turkish, Czech and Indonesian listed; a duplicated paragraph removed; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (macOS finds its downloadable CJK system fonts (#406); string counts re-measured: 2,272 entries, the drafts at 95–99%; Swedish command labels and menu wordings; Russian, Swedish, Turkish, Czech and Indonesian listed; a duplicated paragraph removed; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog) · **Target:** Figma Design (desktop app 126.10.7) FigCraft's interface has a localization layer with an English catalog, a Russian catalog reviewed by a native speaker, and Spanish (with a Latin American overlay), French, German, Brazilian -Portuguese, Japanese, Korean, Simplified Chinese, Indonesian, Czech and Georgian drafts (machine-drafted, +Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Czech drafts (machine-drafted, waiting for native speakers' review), plus Swedish and Turkish catalogs. This page lists the twelve key languages of the craftrules standard, then the other languages Figma ships. How to add a language: [`translating.md`](translating.md). @@ -32,7 +32,7 @@ supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no v channel stay English. Accessibility names come from the same strings. - **Language preference:** Preferences ▸ Language (System, then each catalog by its own name: English, Čeština, Deutsch, Español, Español (Latinoamérica), Français, Bahasa Indonesia, 日本語, - ქართული, 한국어, Português (Brasil), Русский, Svenska, Türkçe, 简体中文), applied at once without a + 한국어, Português (Brasil), Русский, Svenska, Türkçe, 简体中文), applied at once without a restart; System takes the first of the OS's preferred languages that has a catalog (on Windows only the first preferred language counts, since that list also holds the languages added for a keyboard; macOS AppleLanguages, `LANGUAGE` then the locale variables on Linux and BSD; a regional @@ -102,9 +102,7 @@ Other languages (measured 2026-10-17): Russian (`ru`) 2,244 / 2,272 (98.8%), rev by VanTan, one/few/many integer plurals; Swedish (`sv`) 2,264 (99.6%), its command labels and menu wordings added 2026-10-17 (#599), native review welcome; Turkish (`tr`) 2,243 (98.7%), whose header says it was machine-drafted and reviewed by a native speaker; Czech (`cs`) 2,244 (98.8%), a draft -with one/few/other plurals; Georgian (`ka`) 2,328 / 2,328 (100%, measured 2026-10-19), a draft -whose plural entries read the same for one and other (a noun stays singular after a count), its UI -text in craft-fonts' Noto Sans Georgian (built in, on the web too). Figma ships none beyond the eight above. +with one/few/other plurals. Figma ships none beyond the eight above. The layer is done. Per-language hours above are agent hours for a catalog of ~1,800 entries (a machine draft, then a pass over the panels for overflow), plus each language's plural rule where From 381ec852034538af1e72b71ccb604d5d486f79b1 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 00:02:47 +0700 Subject: [PATCH 374/817] #872: keep the web release without craft-fonts (Georgian is desktop-only for now) --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e8444c525..0d1723d83 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,6 @@ jobs: app-title: FigCraft craft-fonts-ref: a71c20e30af613287c504f7e685ca8fad77752bc has-server: true - web-craft-fonts: true version: ${{ inputs.version }} secrets: APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} From 97f2c99d6bd6d117361718130a23a049ad794049 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 00:03:02 +0700 Subject: [PATCH 375/817] #872: the web release leaves Georgian out; one pref.language line in docs/mcp.md --- docs/mcp.md | 3 +-- docs/translating.md | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/mcp.md b/docs/mcp.md index b9f30922f..62bbc9915 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -419,8 +419,7 @@ on; `key` resolves keys the way the canvas does. Commands behind keys: accessibility setting turns it on too). Prototype transitions still play. - `pref.autoSave {on?}`: files that have a path save themselves a few seconds after they change (off by default; the desktop app's timer does it, so scripts still call `file.save`). -- `pref.language {language: system|en|cs|ru|es|es-419|fr|de|pt-BR|ja|ka|ko|zh-Hans|…}`: the app's interface language, applied live ("system": -- `pref.language {language: system|en|es|es-419|fr|de|pt-BR|ja|ko|sv|zh-Hans|…}`: the app's interface language, applied live ("system": +- `pref.language {language: system|en|cs|ru|es|es-419|fr|de|pt-BR|ja|ka|ko|sv|zh-Hans|…}`: the app's interface language, applied live ("system": the OS or browser language; a language without a catalog shows English). Command ids, labels and every result stay English. diff --git a/docs/translating.md b/docs/translating.md index 2d186770f..8de314e57 100644 --- a/docs/translating.md +++ b/docs/translating.md @@ -66,8 +66,9 @@ something on screen needs it (see `crates/ui-egui/src/cjk.rs`). The web build ha so Japanese, Korean and Chinese appear there only in a build with craft-fonts and `FIGCRAFT_EMBED_CJK=1` (Noto Sans CJK SC, +16 MB); otherwise they are left out of the picker. A Chinese UI puts its Chinese face first so Han takes Simplified Chinese shapes. Georgian is drawn in -craft-fonts' Noto Sans Georgian, one of the built-in faces in `theme::install_fonts` (and kept in -web builds by `crates/text/build.rs`). A new CJK or other non-Latin language also needs its script in +craft-fonts' Noto Sans Georgian, one of the built-in faces in `theme::install_fonts`. Web builds +keep it only when built with craft-fonts (`crates/text/build.rs`); the web release isn't, so its +picker leaves Georgian out. A new CJK or other non-Latin language also needs its script in `cjk::language`, or a built-in craft-fonts face. ## Adding a language From ce615ada10f8a75646f876e21dbb492f95fb766b Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 00:03:30 +0700 Subject: [PATCH 376/817] #872: ka.toml keys in en.toml's order, commands sorted --- crates/ui-egui/locales/ka.toml | 39 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/crates/ui-egui/locales/ka.toml b/crates/ui-egui/locales/ka.toml index 127e6212b..10d0c8e73 100644 --- a/crates/ui-egui/locales/ka.toml +++ b/crates/ui-egui/locales/ka.toml @@ -9,8 +9,6 @@ name = "ქართული" status = "draft — needs native review" [ui] - -"Compatibility notes" = "თავსებადობის შენიშვნები" "% of all commits" = "ყველა კომიტის %" "(no longer published)" = "(აღარ არის გამოქვეყნებული)" "({n} warnings: some entries were skipped)" = { one = "(გაფრთხილება: {n}; ზოგი ჩანაწერი გამოტოვებულია)", other = "(გაფრთხილება: {n}; ზოგი ჩანაწერი გამოტოვებულია)" } @@ -94,6 +92,7 @@ status = "draft — needs native review" "All components" = "ყველა კომპონენტი" "All fonts" = "ყველა შრიფტი" "All supported properties" = "ყველა მხარდაჭერილი თვისება" +"All the fonts this file uses are installed" = "ამ ფაილის ყველა შრიფტი დაინსტალირებულია" "All variables" = "ყველა ცვლადი" "Alpha" = "ალფა" "Alphabetical" = "ანბანის მიხედვით" @@ -200,11 +199,14 @@ status = "draft — needs native review" "C or ⇧C" = "C ან ⇧C" "CMYK colour" = "CMYK ფერი" "Can view" = "შეუძლია ნახვა" +"Checking the fonts installed on this computer…" = "ამ კომპიუტერზე დაინსტალირებული შრიფტების შემოწმება…" "Checking the server…" = "სერვერის შემოწმება…" "Clear from this list" = "ამ სიიდან ამოღება" "Code or invite link" = "კოდი ან მოსაწვევი ბმული" "Color profile: {name}" = "ფერის პროფილი: {name}" "Colour and text styles, Light and Dark variables, buttons, inputs and cards" = "ფერისა და ტექსტის სტილები, ღია და მუქი ცვლადები, ღილაკები, შეყვანის ველები და ბარათები" +"Convert to frame" = "ჩარჩოდ გარდაქმნა" +"Convert to section" = "სექციად გარდაქმნა" "CSS custom properties…" = "CSS-ის მორგებული თვისებები…" "Can edit" = "შეუძლია რედაქტირება" "Can't read this library: {e}" = "ამ ბიბლიოთეკის წაკითხვა ვერ მოხერხდა: {e}" @@ -274,6 +276,7 @@ status = "draft — needs native review" "Commits" = "კომიტები" "Company" = "კომპანია" "Compare changes" = "ცვლილებების შედარება" +"Compatibility notes" = "თავსებადობის შენიშვნები" "Completed" = "დასრულებული" "Component" = "კომპონენტი" "Component name" = "კომპონენტის სახელი" @@ -304,8 +307,6 @@ status = "draft — needs native review" "Copied as SVG" = "დაკოპირდა როგორც SVG" "Copied as text" = "დაკოპირდა როგორც ტექსტი" "Copied {value}" = "დაკოპირდა: {value}" -"Convert to frame" = "ჩარჩოდ გარდაქმნა" -"Convert to section" = "სექციად გარდაქმნა" "Copy" = "კოპირება" "Copy as" = "კოპირება როგორც" "Copy as CSS" = "კოპირება როგორც CSS" @@ -649,6 +650,7 @@ status = "draft — needs native review" "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." = "ინტერფეისის დიზაინი და პროტოტიპირება. უფასო, ღია კოდის, დამოუკიდებლად (clean-room) შექმნილი დიზაინის ხელსაწყო, ნულიდან დაწერილი Rust-ზე, ArtCraft Crafting Apps-ის ნაწილი." @@ -773,6 +775,7 @@ status = "draft — needs native review" "Mirror angle and length" = "კუთხისა და სიგრძის არეკვლა" "Mirroring" = "არეკვლა" "Missing" = "აკლია" +"Missing fonts" = "მიუწვდომელი შრიფტები" "Missing layer" = "შრე ვერ მოიძებნა" "Missing style" = "სტილი ვერ მოიძებნა" "Missing variable" = "ცვლადი ვერ მოიძებნა" @@ -832,6 +835,7 @@ status = "draft — needs native review" "No contributor data was built into this copy." = "ამ ასლში მონაწილეების მონაცემები არ არის ჩაშენებული." "No device" = "მოწყობილობის გარეშე" "No fonts match" = "შესაბამისი შრიფტი არ მოიძებნა" +"No files or templates match your search" = "ძიების შესაბამისი ფაილი ან შაბლონი არ მოიძებნა" "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 ფაილი ან ჩასვით გუნდის ბიბლიოთეკის ბმული." @@ -1177,6 +1181,8 @@ status = "draft — needs native review" "Search actions, layers and tools" = "მოქმედებების, შრეებისა და ხელსაწყოების ძიება" "Search assets" = "რესურსების ძიება" "Search comments" = "კომენტარების ძიება" +"Search files and templates" = "ფაილებისა და შაბლონების ძიება" +"Search results" = "ძიების შედეგები" "Search fonts" = "შრიფტების ძიება" "Search layers" = "შრეების ძიება" "Search shortcuts" = "მალსახმობების ძიება" @@ -1376,6 +1382,7 @@ status = "draft — needs native review" "This condition is edited as an expression" = "ეს პირობა ექსპრესიად რედაქტირდება" "This file" = "ეს ფაილი" "This file has unsaved changes" = "ამ ფაილს შეუნახავი ცვლილებები აქვს" +"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 is on {server}, open only to you. Share it to let others in with a new code." = "ეს ფაილი {server}-ზეა და მხოლოდ თქვენთვისაა ღია. გააზიარეთ, რომ სხვები ახალი კოდით შემოუშვათ." "This frame is new on the branch." = "ეს ჩარჩო განშტოებაში ახალია." "This frame isn't on the branch." = "ეს ჩარჩო განშტოებაში არ არის." @@ -1405,6 +1412,7 @@ status = "draft — needs native review" "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" = "ორი ციფრი" @@ -1595,6 +1603,7 @@ status = "draft — needs native review" "nobody else here yet" = "აქ ჯერ სხვა არავინაა" "non-default slot settings are not represented and were skipped" = "სლოტის არანაგულისხმევი პარამეტრები არ არის წარმოდგენილი და გამოტოვებულია" "now" = "ახლა" +"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" = "სლოტის სასურველი კომპონენტების გასაღებები ფაილის კვანძებთან ვერ დაკავშირდა და გამოტოვებულია" @@ -1617,6 +1626,7 @@ status = "draft — needs native review" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "ცვლადის რეჟიმის დაყენების მოქმედებები იმ კოლექციებზე ან რეჟიმებზე, რომლებიც ცვლადების JSON-ში არ არის, გამოტოვებულია" "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" = "ბადის ტრეკის ზომის მოძველებული ან არასწორი ჩანაწერები იგნორირებულია" @@ -1702,6 +1712,7 @@ status = "draft — needs native review" "{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} weeks ago" = { one = "{n} კვირის წინ", other = "{n} კვირის წინ" } "{n} years ago" = { one = "{n} წლის წინ", other = "{n} წლის წინ" } @@ -1728,18 +1739,6 @@ status = "draft — needs native review" "⌘ click" = "⌘ დაწკაპუნება" "⌘ scroll" = "⌘ გადახვევა" "⌥ drag" = "⌥ გადათრევა" -"All the fonts this file uses are installed" = "ამ ფაილის ყველა შრიფტი დაინსტალირებულია" -"Checking the fonts installed on this computer…" = "ამ კომპიუტერზე დაინსტალირებული შრიფტების შემოწმება…" -"Intensity" = "ძალა" -"Missing fonts" = "მიუწვდომელი შრიფტები" -"No files or templates match your search" = "ძიების შესაბამისი ფაილი ან შაბლონი არ მოიძებნა" -"Search files and templates" = "ფაილებისა და შაბლონების ძიება" -"Search results" = "ძიების შედეგები" -"This file uses fonts that aren't installed on this computer. Their text is drawn in a fallback font until you install them." = "ეს ფაილი იყენებს შრიფტებს, რომლებიც ამ კომპიუტერზე დაინსტალირებული არ არის. მათი ტექსტი სათადარიგო შრიფტით გამოისახება, სანამ მათ არ დააინსტალირებთ." -"Try another search, or browse templates." = "სცადეთ სხვა ძიება ან დაათვალიერეთ შაბლონები." -"only in a text style or variable" = "მხოლოდ ტექსტის სტილში ან ცვლადში" -"slot layers without a matching slot property were imported as frames" = "სლოტის შრეები, რომლებსაც შესაბამისი სლოტის თვისება არ აქვს, ჩარჩოებად იმპორტირდა" -"{n} text layers" = { one = "ტექსტის შრე: {n}", other = "ტექსტის შრე: {n}" } [commands] "align.bottom" = "ქვემოთ სწორება" @@ -1919,8 +1918,8 @@ status = "draft — needs native review" "guide.move" = "დამხმარე ხაზის გადაადგილება" "guide.remove" = "დამხმარე ხაზის მოცილება" "guide.select" = "დამხმარე ხაზის მონიშვნა" -"help.gettingStarted" = "პირველი ნაბიჯები" "help.about" = "FigCraft-ის შესახებ" +"help.gettingStarted" = "პირველი ნაბიჯები" "help.page" = "დახმარების გვერდი" "help.shortcuts" = "კლავიატურის მალსახმობები" "image.adjust" = "გამოსახულების კორექცია" @@ -2106,6 +2105,7 @@ status = "draft — needs native review" "style.move" = "სტილების გადატანა" "style.renameFolder" = "სტილების საქაღალდის სახელის შეცვლა" "style.update" = "სტილის რედაქტირება" +"template.list" = "შაბლონების სია" "text.alignCenter" = "ცენტრში სწორება" "text.alignJustify" = "ორმხრივი სწორება" "text.alignLeft" = "მარცხნივ სწორება" @@ -2134,12 +2134,12 @@ status = "draft — needs native review" "text.italic" = "დახრილი" "text.lineHeightDown" = "სტრიქონის სიმაღლის შემცირება" "text.lineHeightUp" = "სტრიქონის სიმაღლის გაზრდა" -"text.missingFonts" = "მიუწვდომელი შრიფტები" "text.link" = "ბმულის შექმნა" "text.listIndent" = "სიის შეწევის გაზრდა" "text.listOutdent" = "სიის შეწევის შემცირება" "text.listStyle" = "სიის სტილი" "text.maxLines" = "მაქს. სტრიქონები" +"text.missingFonts" = "მიუწვდომელი შრიფტები" "text.numberList" = "დანომრილი სია" "text.onPath" = "ტექსტი ტრაექტორიაზე" "text.paragraphIndent" = "აბზაცის შეწევა" @@ -2262,6 +2262,7 @@ status = "draft — needs native review" "view.designPrototype" = "გადართვა დიზაინსა და პროტოტიპს შორის" "view.devMode" = "დეველოპერის რეჟიმი" "view.frameOutlines" = "ჩარჩოების კონტურები" +"view.fullscreen" = "სრული ეკრანი" "view.get" = "ხედის მიღება" "view.layers" = "შრეების პანელი" "view.layoutGrids" = "განლაგების ბადეები" @@ -2283,7 +2284,6 @@ status = "draft — needs native review" "view.prevPage" = "წინა გვერდი" "view.previousRegion" = "წინა არეზე ფოკუსირება" "view.proofSrgb" = "ეკრანზე sRGB-ის სიმულაცია" -"view.fullscreen" = "სრული ეკრანი" "view.prototype" = "პროტოტიპის პანელი" "view.rulers" = "სახაზავები" "view.set" = "ხედის დაყენება" @@ -2308,7 +2308,6 @@ status = "draft — needs native review" "widget.list" = "ვიჯეტების სია" "window.focus" = "ფანჯრის წინა პლანზე გადმოტანა" "window.new" = "ახალი ფანჯარა" -"template.list" = "შაბლონების სია" [menu] "bool.exclude" = "გამორიცხვა" From e358c695cc8a5f9b5f6e8f0e8daaac20792b1156 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 00:05:51 +0700 Subject: [PATCH 377/817] =?UTF-8?q?#813:=20Bengali=20in=20script=20detecti?= =?UTF-8?q?on=20(cjk::ALL),=20restore=20the=20=E3=81=82=E6=BC=A2=ED=95=9C?= =?UTF-8?q?=20assert,=20doc=20comments,=20rustfmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/ui-egui/src/cjk.rs | 28 ++++++++++++---------------- crates/ui-egui/src/lib.rs | 4 ++-- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/crates/ui-egui/src/cjk.rs b/crates/ui-egui/src/cjk.rs index 5f8af5dce..35323efe7 100644 --- a/crates/ui-egui/src/cjk.rs +++ b/crates/ui-egui/src/cjk.rs @@ -1,8 +1,9 @@ -//! Chinese, Japanese, Korean and Bengali text in the UI. egui's own fonts and Inter have no CJK or non-Latin glyphs, so -//! the UI adds a face per script it needs: the UI language's, the scripts in the open file's names +//! Chinese, Japanese, Korean and Bengali text in the UI. egui's own fonts and Inter have no glyphs +//! for them, so the UI adds a face per script it needs: the UI language's, the scripts in the open file's names //! and comments, the language picker's and typed text. Desktop finds them among the installed //! fonts (the system font scan), only once one is needed, so English users load none; the web -//! build has only the CJK and non-Latin faces built in from craft-fonts (`FIGCRAFT_EMBED_CJK`), else none. +//! build has only the CJK faces built in from craft-fonts (`FIGCRAFT_EMBED_CJK`), else none (no +//! Bengali face is built in, so the web leaves Bengali out). use std::sync::Arc; @@ -12,15 +13,14 @@ pub const KANA: u8 = 1; pub const HANGUL: u8 = 2; /// Han characters (and CJK punctuation and full-width forms). pub const HAN: u8 = 4; +/// Bengali script. pub const BENGALI: u8 = 8; +/// Every script bit: nothing more to look for once all have a face. +pub const ALL: u8 = KANA | HANGUL | HAN | BENGALI; + +/// Bengali faces: cross-platform, Windows, macOS, then Linux names. +const BENGALI_FONTS: &[&str] = &["Noto Sans Bengali", "Nirmala UI", "Bangla Sangam MN", "Kalpurush", "SolaimanLipi"]; -const BENGALI_FONTS: &[&str] = &[ - "Noto Sans Bengali", - "Nirmala UI", - "Bangla Sangam MN", - "Kalpurush", - "SolaimanLipi", -]; /// Japanese faces, the built-in one first: Windows, macOS, then Linux names. const JAPANESE: &[&str] = &[ "BIZ UDPGothic", @@ -108,12 +108,7 @@ fn samples(need: u8, ui: u8) -> Vec<(char, Vec<&'static str>)> { (false, HANGUL) => ('漢', [KOREAN, JAPANESE, CHINESE].concat()), (false, _) => ('漢', [JAPANESE, KOREAN, CHINESE].concat()), }; - let mut v = vec![ - (KANA, ('あ', JAPANESE.to_vec())), - (HAN, han), - (HANGUL, ('한', KOREAN.to_vec())), - (BENGALI, ('অ', BENGALI_FONTS.to_vec())), - ]; + let mut v = vec![(KANA, ('あ', JAPANESE.to_vec())), (HAN, han), (HANGUL, ('한', KOREAN.to_vec())), (BENGALI, ('অ', BENGALI_FONTS.to_vec()))]; match ui { HANGUL => v.reverse(), HAN => v.swap(0, 1), @@ -178,6 +173,7 @@ mod tests { fn the_ui_language_script_comes_first() { let order = |need, ui| samples(need, ui).into_iter().map(|(c, _)| c).collect::(); let first_face = |need, ui| samples(need, ui).first().and_then(|(_, f)| f.first()).copied(); + assert_eq!(order(KANA | HAN | HANGUL, 0), "あ漢한"); assert_eq!(order(KANA | HAN | HANGUL | BENGALI, language("bn")), "অあ漢한"); assert_eq!(order(KANA | HAN | HANGUL, KANA | HAN), "あ漢한"); assert_eq!(order(KANA | HAN | HANGUL, HANGUL), "한漢あ"); diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 4b44c861d..3b5b108d9 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1288,11 +1288,11 @@ impl FigApp { self.session.prefs.reduce_motion || self.services.reduce_motion() } - /// The CJK scripts the UI shows: the language's, the language picker's (Preferences open), + /// The CJK and Bengali scripts the UI shows: the language's, the language picker's (Preferences open), /// typed text's, and those in the open file's names and comments (read when it changes, not /// mid-drag). Nothing is checked once every script has a face. fn cjk_needed(&mut self, ctx: &egui::Context, installed: u8) -> u8 { - if installed == cjk::KANA | cjk::HANGUL | cjk::HAN { + if installed == cjk::ALL { return installed; } let mut need = i18n::current().map_or(0, |l| cjk::language(l.code)); From 22ef4fdd99596d7ba095fac6de9ad7accd2b9ec1 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 00:13:45 +0700 Subject: [PATCH 378/817] #874: locale entries in sorted position --- crates/ui-egui/locales/de.toml | 4 ++-- crates/ui-egui/locales/es.toml | 4 ++-- crates/ui-egui/locales/fi.toml | 4 ++-- crates/ui-egui/locales/fr.toml | 4 ++-- crates/ui-egui/locales/ja.toml | 4 ++-- crates/ui-egui/locales/ko.toml | 4 ++-- crates/ui-egui/locales/nl.toml | 4 ++-- crates/ui-egui/locales/pt-BR.toml | 4 ++-- crates/ui-egui/locales/sv.toml | 4 ++-- crates/ui-egui/locales/zh-Hans.toml | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index c5d7dc7ee..c2ea2e6e8 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -1102,7 +1102,6 @@ status = "draft — needs native review" "Save as" = "Speichern unter" "Save as preset…" = "Als Vorgabe speichern…" "Save files automatically" = "Dateien automatisch speichern" -"Start on the Home screen" = "Mit Start beginnen" "Save version {key}" = "Version speichern {key}" "Saved" = "Gespeichert" "Saved {name}" = "{name} gespeichert" @@ -1225,6 +1224,7 @@ status = "draft — needs native review" "Start ascending from / stop descending at" = "Aufwärts zählen ab / abwärts zählen bis" "Start from a blank canvas" = "Mit einer leeren Arbeitsfläche beginnen" "Start on path" = "Anfang auf dem Pfad" +"Start on the Home screen" = "Mit Start beginnen" "Start point" = "Startpunkt" "Start sharing" = "Teilen starten" "Starting to share…" = "Teilen wird gestartet…" @@ -1924,7 +1924,6 @@ status = "draft — needs native review" "plugins.manage" = "Plugins verwalten…" "plugins.runLast" = "Letztes Plugin ausführen" "pref.autoSave" = "Dateien automatisch speichern" -"pref.startOnHome" = "Mit Start beginnen" "pref.highlightHover" = "Ebenen beim Überfahren hervorheben" "pref.keepTool" = "Werkzeug nach Verwendung ausgewählt lassen" "pref.language" = "Sprache der Benutzeroberfläche" @@ -1934,6 +1933,7 @@ status = "draft — needs native review" "pref.reduceMotion" = "Bewegung reduzieren" "pref.renameDuplicates" = "Duplizierte Ebenen umbenennen" "pref.showDimensions" = "Abmessungen an Objekten anzeigen" +"pref.startOnHome" = "Mit Start beginnen" "pref.userName" = "Ihr Name in Kommentaren" "proto.action.add" = "Prototyp-Aktion hinzufügen" "proto.action.move" = "Prototyp-Aktion neu anordnen" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 1a73816e1..2a61b974b 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -1155,7 +1155,6 @@ status = "draft — needs native review" "Run" = "Ejecutar" "Run {label}" = "Ejecutar {label}" "Save files automatically" = "Guardar archivos automáticamente" -"Start on the Home screen" = "Empezar en Inicio" "Search templates" = "Buscar plantillas" "See all templates" = "Ver todas las plantillas" "Select layers and they space themselves as their content changes" = "Selecciona capas y se espaciarán solas cuando cambie su contenido" @@ -1300,6 +1299,7 @@ status = "draft — needs native review" "Start from a blank canvas" = "Empieza con un lienzo en blanco" "Start from a template" = "Empieza con una plantilla" "Start on path" = "Inicio en el trazado" +"Start on the Home screen" = "Empezar en Inicio" "Start point" = "Punto inicial" "Start sharing" = "Empezar a compartir" "Start sharing with the Share button, then pass on the code it gives" = "Empieza a compartir con el botón Compartir y pasa el código que te da" @@ -2024,7 +2024,6 @@ status = "draft — needs native review" "plugins.manage" = "Gestionar plugins…" "plugins.runLast" = "Ejecutar el último plugin" "pref.autoSave" = "Guardar archivos automáticamente" -"pref.startOnHome" = "Empezar en Inicio" "pref.highlightHover" = "Resaltar capas al pasar el cursor" "pref.keepTool" = "Mantener la herramienta tras usarla" "pref.language" = "Idioma de la interfaz" @@ -2034,6 +2033,7 @@ status = "draft — needs native review" "pref.reduceMotion" = "Reducir movimiento" "pref.renameDuplicates" = "Renombrar capas duplicadas" "pref.showDimensions" = "Mostrar dimensiones en los objetos" +"pref.startOnHome" = "Empezar en Inicio" "pref.userName" = "Tu nombre en los comentarios" "proto.action.add" = "Añadir acción de prototipo" "proto.action.move" = "Reordenar acción de prototipo" diff --git a/crates/ui-egui/locales/fi.toml b/crates/ui-egui/locales/fi.toml index 6a47a8f2e..783395d83 100644 --- a/crates/ui-egui/locales/fi.toml +++ b/crates/ui-egui/locales/fi.toml @@ -1162,7 +1162,6 @@ status = "draft — needs native review" "Save as" = "Tallenna nimellä" "Save as preset…" = "Tallenna esiasetuksena…" "Save files automatically" = "Tallenna tiedostot automaattisesti" -"Start on the Home screen" = "Aloita Aloitus-näkymästä" "Save version {key}" = "Tallenna versio {key}" "Saved" = "Tallennettu" "Saved {name}" = "Tallennettu: {name}" @@ -1301,6 +1300,7 @@ status = "draft — needs native review" "Start from a blank canvas" = "Aloita tyhjältä piirtoalueelta" "Start from a template" = "Aloita mallista" "Start on path" = "Aloituskohta polulla" +"Start on the Home screen" = "Aloita Aloitus-näkymästä" "Start point" = "Alkupiste" "Start sharing" = "Aloita jakaminen" "Start sharing with the Share button, then pass on the code it gives" = "Aloita jakaminen Jaa-painikkeella ja välitä sen antama koodi" @@ -2025,7 +2025,6 @@ status = "draft — needs native review" "plugins.manage" = "Hallitse liitännäisiä…" "plugins.runLast" = "Suorita viimeisin liitännäinen" "pref.autoSave" = "Tallenna tiedostot automaattisesti" -"pref.startOnHome" = "Aloita Aloitus-näkymästä" "pref.highlightHover" = "Korosta tasot osoitettaessa" "pref.keepTool" = "Pidä työkalu valittuna käytön jälkeen" "pref.language" = "Käyttöliittymän kieli" @@ -2035,6 +2034,7 @@ status = "draft — needs native review" "pref.reduceMotion" = "Vähennä liikettä" "pref.renameDuplicates" = "Nimeä monistetut tasot uudelleen" "pref.showDimensions" = "Näytä objektien mitat" +"pref.startOnHome" = "Aloita Aloitus-näkymästä" "pref.userName" = "Nimesi kommenteissa" "proto.action.add" = "Lisää prototyyppitoiminto" "proto.action.move" = "Muuta prototyyppitoimintojen järjestystä" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 947281a25..ea20ab107 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -1157,7 +1157,6 @@ status = "draft — needs native review" "Save as" = "Enregistrer sous" "Save as preset…" = "Enregistrer comme préréglage…" "Save files automatically" = "Enregistrer les fichiers automatiquement" -"Start on the Home screen" = "Démarrer sur l’Accueil" "Save version {key}" = "Enregistrer une version {key}" "Saved" = "Enregistré" "Saved {name}" = "{name} enregistré" @@ -1294,6 +1293,7 @@ status = "draft — needs native review" "Start from a blank canvas" = "Commencer avec un canevas vide" "Start from a template" = "Commencer avec un modèle" "Start on path" = "Début sur le tracé" +"Start on the Home screen" = "Démarrer sur l’Accueil" "Start point" = "Point de départ" "Start sharing" = "Commencer le partage" "Start sharing with the Share button, then pass on the code it gives" = "Commencez à partager avec le bouton Partager, puis communiquez le code qu’il donne" @@ -2013,7 +2013,6 @@ status = "draft — needs native review" "plugins.manage" = "Gérer les plugins…" "plugins.runLast" = "Exécuter le dernier plugin" "pref.autoSave" = "Enregistrer les fichiers automatiquement" -"pref.startOnHome" = "Démarrer sur l’Accueil" "pref.highlightHover" = "Mettre en évidence les calques au survol" "pref.keepTool" = "Garder l’outil sélectionné après usage" "pref.language" = "Langue de l’interface" @@ -2023,6 +2022,7 @@ status = "draft — needs native review" "pref.reduceMotion" = "Réduire les animations" "pref.renameDuplicates" = "Renommer les calques dupliqués" "pref.showDimensions" = "Afficher les dimensions sur les objets" +"pref.startOnHome" = "Démarrer sur l’Accueil" "pref.userName" = "Votre nom dans les commentaires" "proto.action.add" = "Ajouter une action de prototype" "proto.action.move" = "Réordonner l’action de prototype" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index ed71e6719..0f617b6fb 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -1146,7 +1146,6 @@ status = "draft — needs native review" "Save as" = "名前を付けて保存" "Save as preset…" = "プリセットとして保存…" "Save files automatically" = "ファイルを自動保存" -"Start on the Home screen" = "起動時にホームを表示" "Save version {key}" = "バージョンを保存 {key}" "Saved" = "保存済み" "Saved {name}" = "{name} を保存済み" @@ -1283,6 +1282,7 @@ status = "draft — needs native review" "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" = "共有ボタンで共有を開始し、表示されたコードを相手に伝える" @@ -1997,7 +1997,6 @@ status = "draft — needs native review" "plugins.manage" = "プラグインを管理…" "plugins.runLast" = "最後のプラグインを実行" "pref.autoSave" = "ファイルを自動保存" -"pref.startOnHome" = "起動時にホームを表示" "pref.highlightHover" = "ホバー時にレイヤーをハイライト" "pref.keepTool" = "使用後もツールを選択したままにする" "pref.language" = "インターフェースの言語" @@ -2007,6 +2006,7 @@ status = "draft — needs native review" "pref.reduceMotion" = "動きを減らす" "pref.renameDuplicates" = "複製したレイヤーの名前を変更" "pref.showDimensions" = "オブジェクトに寸法を表示" +"pref.startOnHome" = "起動時にホームを表示" "pref.userName" = "コメントに表示する名前" "proto.action.add" = "プロトタイプのアクションを追加" "proto.action.move" = "プロトタイプのアクションの順序を変更" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index 43c9a22ea..a96a0991f 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -1096,7 +1096,6 @@ status = "draft — needs native review" "Save as" = "다른 이름으로 저장" "Save as preset…" = "프리셋으로 저장…" "Save files automatically" = "파일 자동 저장" -"Start on the Home screen" = "홈에서 시작" "Save version {key}" = "버전 저장 {key}" "Saved" = "저장됨" "Saved {name}" = "{name} 저장됨" @@ -1219,6 +1218,7 @@ status = "draft — needs native review" "Start ascending from / stop descending at" = "오름차순 시작 값 / 내림차순 끝 값" "Start from a blank canvas" = "빈 캔버스로 시작" "Start on path" = "패스 시작 위치" +"Start on the Home screen" = "홈에서 시작" "Start point" = "시작점" "Start sharing" = "공유 시작" "Starting to share…" = "공유를 시작하는 중…" @@ -1915,7 +1915,6 @@ status = "draft — needs native review" "plugins.manage" = "플러그인 관리…" "plugins.runLast" = "마지막 플러그인 실행" "pref.autoSave" = "파일 자동 저장" -"pref.startOnHome" = "홈에서 시작" "pref.highlightHover" = "마우스를 올리면 레이어 강조" "pref.keepTool" = "사용 후에도 도구 선택 유지" "pref.language" = "인터페이스 언어" @@ -1925,6 +1924,7 @@ status = "draft — needs native review" "pref.reduceMotion" = "동작 줄이기" "pref.renameDuplicates" = "복제한 레이어 이름 바꾸기" "pref.showDimensions" = "개체에 치수 표시" +"pref.startOnHome" = "홈에서 시작" "pref.userName" = "댓글에 표시할 이름" "proto.action.add" = "프로토타입 액션 추가" "proto.action.move" = "프로토타입 액션 순서 변경" diff --git a/crates/ui-egui/locales/nl.toml b/crates/ui-egui/locales/nl.toml index 0e28ad9c9..cf861d2ae 100644 --- a/crates/ui-egui/locales/nl.toml +++ b/crates/ui-egui/locales/nl.toml @@ -1162,7 +1162,6 @@ status = "draft — needs native review" "Save as" = "Opslaan als" "Save as preset…" = "Opslaan als preset…" "Save files automatically" = "Bestanden automatisch opslaan" -"Start on the Home screen" = "Starten op Home" "Save version {key}" = "Versie opslaan {key}" "Saved" = "Opgeslagen" "Saved {name}" = "{name} opgeslagen" @@ -1301,6 +1300,7 @@ status = "draft — needs native review" "Start from a blank canvas" = "Begin vanaf een leeg canvas" "Start from a template" = "Begin met een sjabloon" "Start on path" = "Begin op het pad" +"Start on the Home screen" = "Starten op Home" "Start point" = "Startpunt" "Start sharing" = "Delen starten" "Start sharing with the Share button, then pass on the code it gives" = "Begin met delen via de knop Delen en geef daarna de code door die je krijgt" @@ -2024,7 +2024,6 @@ status = "draft — needs native review" "plugins.manage" = "Plugins beheren…" "plugins.runLast" = "Laatste plugin uitvoeren" "pref.autoSave" = "Bestanden automatisch opslaan" -"pref.startOnHome" = "Starten op Home" "pref.highlightHover" = "Lagen markeren bij aanwijzen" "pref.keepTool" = "Gereedschap geselecteerd houden na gebruik" "pref.language" = "Interfacetaal" @@ -2034,6 +2033,7 @@ status = "draft — needs native review" "pref.reduceMotion" = "Beweging verminderen" "pref.renameDuplicates" = "Gedupliceerde lagen hernoemen" "pref.showDimensions" = "Afmetingen op objecten tonen" +"pref.startOnHome" = "Starten op Home" "pref.userName" = "Je naam in reacties" "proto.action.add" = "Prototypeactie toevoegen" "proto.action.move" = "Volgorde van prototypeactie wijzigen" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index 625599f7e..721ebf64c 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -1095,7 +1095,6 @@ status = "draft — needs native review" "Save as" = "Salvar como" "Save as preset…" = "Salvar como predefinição…" "Save files automatically" = "Salvar arquivos automaticamente" -"Start on the Home screen" = "Começar no Início" "Save version {key}" = "Salvar versão {key}" "Saved" = "Salvo" "Saved {name}" = "{name} salvo" @@ -1218,6 +1217,7 @@ status = "draft — needs native review" "Start ascending from / stop descending at" = "Contar para cima a partir de / para baixo até" "Start from a blank canvas" = "Comece com uma tela em branco" "Start on path" = "Início no caminho" +"Start on the Home screen" = "Começar no Início" "Start point" = "Ponto inicial" "Start sharing" = "Começar a compartilhar" "Starting to share…" = "Começando a compartilhar…" @@ -1914,7 +1914,6 @@ status = "draft — needs native review" "plugins.manage" = "Gerenciar plugins…" "plugins.runLast" = "Executar o último plugin" "pref.autoSave" = "Salvar arquivos automaticamente" -"pref.startOnHome" = "Começar no Início" "pref.highlightHover" = "Destacar camadas ao passar o cursor" "pref.keepTool" = "Manter a ferramenta selecionada após o uso" "pref.language" = "Idioma da interface" @@ -1924,6 +1923,7 @@ status = "draft — needs native review" "pref.reduceMotion" = "Reduzir movimento" "pref.renameDuplicates" = "Renomear camadas duplicadas" "pref.showDimensions" = "Mostrar dimensões nos objetos" +"pref.startOnHome" = "Começar no Início" "pref.userName" = "Seu nome nos comentários" "proto.action.add" = "Adicionar ação de protótipo" "proto.action.move" = "Reordenar ação de protótipo" diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index 3593e2cd6..183a53810 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -1144,7 +1144,6 @@ name = "Svenska" "Run" = "Kör" "Run {label}" = "Kör {label}" "Save files automatically" = "Spara filer automatiskt" -"Start on the Home screen" = "Börja på Start" "Search templates" = "Sök mallar" "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" @@ -1287,6 +1286,7 @@ name = "Svenska" "Start from a blank canvas" = "Börja med en tom arbetsyta" "Start from a template" = "Börja med en mall" "Start on path" = "Början på banan" +"Start on the Home screen" = "Börja på Start" "Start point" = "Startpunkt" "Start sharing" = "Börja dela" "Start sharing with the Share button, then pass on the code it gives" = "Börja dela med knappen Dela och skicka sedan vidare koden du får" @@ -2005,7 +2005,6 @@ name = "Svenska" "plugins.manage" = "Hantera plugin-program…" "plugins.runLast" = "Kör senaste plugin" "pref.autoSave" = "Spara filer automatiskt" -"pref.startOnHome" = "Börja på Start" "pref.highlightHover" = "Framhäv lager vid hovring" "pref.keepTool" = "Behåll verktyget markerat efter användning" "pref.language" = "Gränssnittsspråk" @@ -2015,6 +2014,7 @@ name = "Svenska" "pref.reduceMotion" = "Minska rörelse" "pref.renameDuplicates" = "Byt namn på duplicerade lager" "pref.showDimensions" = "Visa dimensioner på objekt" +"pref.startOnHome" = "Börja på Start" "pref.userName" = "Ditt namn i kommentarer" "proto.action.add" = "Lägg till prototypåtgärd" "proto.action.move" = "Ändra ordning på prototypåtgärd" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index e4a52a683..5383c0411 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -1097,7 +1097,6 @@ status = "draft — needs native review" "Save as" = "另存为" "Save as preset…" = "存储为预设…" "Save files automatically" = "自动保存文件" -"Start on the Home screen" = "启动时显示主页" "Save version {key}" = "保存版本 {key}" "Saved" = "已保存" "Saved {name}" = "已保存 {name}" @@ -1220,6 +1219,7 @@ status = "draft — needs native review" "Start ascending from / stop descending at" = "升序起点 / 降序终点" "Start from a blank canvas" = "从空白画布开始" "Start on path" = "路径起点" +"Start on the Home screen" = "启动时显示主页" "Start point" = "起点" "Start sharing" = "开始分享" "Starting to share…" = "正在开始分享…" @@ -1916,7 +1916,6 @@ status = "draft — needs native review" "plugins.manage" = "管理插件…" "plugins.runLast" = "运行上一个插件" "pref.autoSave" = "自动保存文件" -"pref.startOnHome" = "启动时显示主页" "pref.highlightHover" = "悬停时高亮图层" "pref.keepTool" = "使用后保持工具选中" "pref.language" = "界面语言" @@ -1926,6 +1925,7 @@ status = "draft — needs native review" "pref.reduceMotion" = "减少动态效果" "pref.renameDuplicates" = "重命名副本图层" "pref.showDimensions" = "在对象上显示尺寸" +"pref.startOnHome" = "启动时显示主页" "pref.userName" = "评论中显示的名字" "proto.action.add" = "添加原型操作" "proto.action.move" = "调整原型操作顺序" From 9877b8e6cce1da2da20d44f8e39464b764efcc29 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 00:13:46 +0700 Subject: [PATCH 379/817] #874: test that the Start on the Home screen preference persists (old settings read off) --- crates/engine/src/cmd/view.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/crates/engine/src/cmd/view.rs b/crates/engine/src/cmd/view.rs index bdf673390..b8a2569c0 100644 --- a/crates/engine/src/cmd/view.rs +++ b/crates/engine/src/cmd/view.rs @@ -523,3 +523,24 @@ pub fn specs() -> Vec { #[allow(dead_code)] fn unused(_: NodeId) {} + +#[cfg(test)] +mod start_on_home_tests { + use serde_json::json; + + use crate::Session; + + #[test] + fn start_on_home_is_a_preference_that_persists() { + let mut s = Session::new(); + assert!(!s.prefs.start_on_home); + assert_eq!(s.execute("pref.startOnHome", &json!({})).unwrap()["on"], true); + assert!(s.prefs.start_on_home); + // Saved with the other preferences and read back; older settings files without it read as off. + let saved: crate::Prefs = serde_json::from_value(serde_json::to_value(&s.prefs).unwrap()).unwrap(); + assert!(saved.start_on_home); + assert_eq!(s.execute("pref.startOnHome", &json!({"on": false})).unwrap()["on"], false); + let old: crate::Prefs = serde_json::from_value(json!({"theme": "dark"})).unwrap(); + assert!(!old.start_on_home); + } +} From 21d5090db2d3ea08eaddd840e775a6cbb56b8011 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 00:13:47 +0700 Subject: [PATCH 380/817] #874: --control starts in a new file whatever the preference (control callers expect a document), with a test --- apps/figcraft/src/main.rs | 25 ++++++++++++++++++++++--- docs/mcp.md | 3 ++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/apps/figcraft/src/main.rs b/apps/figcraft/src/main.rs index e98f93733..00856c5d5 100644 --- a/apps/figcraft/src/main.rs +++ b/apps/figcraft/src/main.rs @@ -193,10 +193,8 @@ fn main() -> eframe::Result { // default, never a build from source unless asked). session.live.links = figcraft_collab_net::links::system(); session.invite_links_startup(); - // A first run (no settings kept yet, nothing to open) starts on the home screen, with its - // tips and templates; later runs start in a new file unless the preference says Home. let first_run = svc.prefs.is_none() && args.join.is_none(); - if session.docs.is_empty() && !first_run && !session.prefs.start_on_home { + if session.docs.is_empty() && opens_new_file(first_run, session.prefs.start_on_home, port.is_some()) { let _ = session.execute("file.new", &json!({})); } // The interface language from the first frame on, and for the message when the window can't @@ -268,6 +266,14 @@ fn main() -> eframe::Result { result } +/// With nothing to open, whether the window starts in a new file rather than on the home screen. +/// A first run (no settings kept yet) shows the home screen's tips and templates, and later runs +/// start in a new file unless the preference asks for Home, which `--control` overrides: its +/// callers expect a document to act on. +fn opens_new_file(first_run: bool, start_on_home: bool, control: bool) -> bool { + !first_run && (!start_on_home || control) +} + fn desktop_title_bar() -> figcraft_ui_egui::TitleBar { use figcraft_ui_egui::TitleBar; if cfg!(target_os = "macos") { TitleBar::Inset } else { TitleBar::Custom } @@ -292,3 +298,16 @@ mod linux_window_tests { assert_eq!(viewport.decorations, Some(false)); } } + +#[cfg(test)] +mod start_tests { + use super::opens_new_file; + + #[test] + fn the_home_preference_starts_on_home_except_for_control_callers() { + assert!(opens_new_file(false, false, false), "a new file by default"); + assert!(!opens_new_file(false, true, false), "Home when the preference asks"); + assert!(opens_new_file(false, true, true), "--control still starts with a document"); + assert!(!opens_new_file(true, false, false), "a first run shows the home screen"); + } +} diff --git a/docs/mcp.md b/docs/mcp.md index 90cc75f5c..fb94dabf6 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -420,7 +420,8 @@ on; `key` resolves keys the way the canvas does. Commands behind keys: - `pref.autoSave {on?}`: files that have a path save themselves a few seconds after they change (off by default; the desktop app's timer does it, so scripts still call `file.save`). - `pref.startOnHome {on?}`: the desktop app starts on the Home screen instead of in a new file - (off by default; files named on the command line still open). + (off by default; files named on the command line still open, and `--control` starts in a new + file anyway, so control callers have a document). - `pref.language {language: system|en|cs|ru|es|es-419|fr|de|pt-BR|ja|ko|zh-Hans|…}`: the app's interface language, applied live ("system": - `pref.language {language: system|en|es|es-419|fr|de|pt-BR|ja|ko|sv|zh-Hans|…}`: the app's interface language, applied live ("system": the OS or browser language; a language without a catalog shows English). Command ids, labels and From a9975ccc220aec2794643206d1bb9ced435eedc5 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 00:13:55 +0700 Subject: [PATCH 381/817] #818: drop the progress-doc edits (ROADMAP revision row, ui-parity rows); the maintainer adds them --- ROADMAP.md | 1 - docs/ui-parity.md | 2 -- 2 files changed, 3 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index e5ed24d65..8a587286d 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -319,7 +319,6 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | -| 2026-10-17 | minor | Interface size (#540): Preferences ▸ Interface size and `pref.uiScale` make the whole interface larger or smaller. Auto keeps the system's display scale (its entry shows the size it draws at); a fixed size from 75 % to 300 % is absolute, so 100 % is one screen pixel per point on every system. A window too small for a fixed size draws a smaller one until it is larger (the choice is kept); the browser keeps its own zoom. Cmd/Ctrl +/-/0 still zoom the canvas only. Numbers unchanged. | | 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | | 2026-10-17 | minor | Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index c935e0094..766284f1d 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -165,7 +165,6 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Keyboard navigation: F6 regions, Tab within, focus ring | done | | | Layers panel from the keyboard: arrows, F2 / Cmd+R rename (the row gets the keyboard back), Shift+F10 context menu; 10k-layer lists | done | revealing a layer, expanding, collapsing and arrow keys timed in `cargo xtask bench` | | Reduced motion | done | system setting or preference | -| Interface size (Preferences ▸ Interface size, `pref.uiScale`) | done on desktop | Auto (the system's scale) or a fixed size from 75 % to 300 %, where 100 % is one screen pixel per point on every system; held back while the window is too small for it; the browser keeps its own zoom | | WCAG AA contrast of secondary and accent text | done | | | Tested with VoiceOver, NVDA, Narrator, Orca | missing | human QA | @@ -177,7 +176,6 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | 2026-10-17 | minor | Escape or Enter while the pen draws ends the path and keeps its vector in edit mode with the pen, so the next path is drawn into the same layer (unconnected); another Escape leaves edit mode (#760). Entering edit mode on a layer that already is a vector no longer records an empty undo step. Numbers unchanged | | 2026-10-17 | minor | Text layers keep the platform IME on for every frame of an edit, not only frames with input (an idle frame turned it off and macOS dropped each composition, #747); the candidate window opens at the caret instead of the canvas corner; keys pressed while composing go to the IME | | 2026-10-17 | minor | The community batches #733, #735, #736, #729 and #753: submenus open after a short hover, keep their place along a safe triangle and reopen closed (main and context menus); the Actions palette's tabs, ranked search, keyboard highlight and recents; menu items that need a value ask for it, File ▸ Rename edits in place; Shift+I and Resources open Assets; a draggable Pages/Layers divider; Shift-drag moves the selection; a double-click near a thin stroke, merging dropped points and Flatten keeping open paths in vector editing; live font preview and the selection highlight after line breaks; the colour picker on a new fill or stroke; Paste over and Paste properties from the keyboard; Selection colors (partial: no library styles or variables there) and smart-selection spacing fields and canvas handles (partial: no reorder rings), both also checked by their author on macOS; the keyboard shortcuts panel closes on the home screen; Adwaita window controls on Wayland compositors without server decorations (checked by its author on GNOME; KDE not run). Checked in the app on Windows (submenus by their author), not side by side with Figma. Summary and hours unchanged | -| 2026-10-17 | minor | Interface size preference (#540): Preferences ▸ Interface size and `pref.uiScale`, Auto or a fixed size from 75 % to 300 %, absolute (100 % is one screen pixel per point whatever the system's scale) | | 2026-10-15 | minor | Hex fields take CSS colour names (`red` → `FF0000`): fills, strokes, effects, grids, variables, backgrounds and the colour picker | | 2026-10-15 | minor | Typography: drag the line-height, letter-spacing and paragraph-spacing icons to scrub their values; shared numeric-field rates, resize cursor and one Undo step per gesture (#373). | | 2026-10-15 | minor | A click or Tab into a one-line field selects all of its text (hex, inline, name, search and dialog fields); the first click into a fill's hex takes the keyboard | From 20e4028afa2a5f7c922ba591e62d1a7a1dac9be1 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 00:23:14 +0700 Subject: [PATCH 382/817] #818: interface sizes are relative to the system's display scale (100% is native, Auto goes; 75-200% in Preferences, pref.uiScale takes 0.75-3, "auto" reads as 1); interface_size moved above batch_rename_dialog's doc comment; tests and docs follow --- crates/engine/src/a11y_keys_tests.rs | 34 +++++----- crates/engine/src/cmd/view.rs | 9 ++- crates/engine/src/lib.rs | 25 +++---- crates/ui-egui/locales/en.toml | 3 +- crates/ui-egui/locales/es.toml | 3 +- crates/ui-egui/locales/fr.toml | 3 +- crates/ui-egui/src/dialogs.rs | 28 ++++---- crates/ui-egui/src/lib.rs | 22 +++---- crates/ui-egui/src/ui_scale.rs | 99 +++++++++++++--------------- crates/ui-egui/src/ui_scale_tests.rs | 69 +++++++++---------- docs/control-protocol.md | 5 +- docs/mcp.md | 11 ++-- 12 files changed, 138 insertions(+), 173 deletions(-) diff --git a/crates/engine/src/a11y_keys_tests.rs b/crates/engine/src/a11y_keys_tests.rs index 72507df5f..e4892bcae 100644 --- a/crates/engine/src/a11y_keys_tests.rs +++ b/crates/engine/src/a11y_keys_tests.rs @@ -57,25 +57,23 @@ fn reduce_motion_is_a_preference_that_persists() { } #[test] -fn interface_size_is_auto_until_chosen_and_a_chosen_size_is_absolute_and_persists() { +fn interface_size_is_relative_to_the_system_and_persists() { let mut s = Session::new(); - assert_eq!(s.prefs.ui_scale, None); - assert_eq!(s.execute("pref.uiScale", &json!({})).unwrap()["scale"], "auto"); - // A fixed size: 1.0 is one screen pixel per point, so the number is not multiplied by the system's scale. + assert_eq!(s.prefs.ui_scale, 1.0, "the system's own size by default"); + assert_eq!(s.execute("pref.uiScale", &json!({})).unwrap()["scale"], 1.0); assert_eq!(s.execute("pref.uiScale", &json!({"scale": 1.25})).unwrap()["scale"], 1.25); - assert_eq!(s.prefs.ui_scale, Some(1.25)); - // Reading changes nothing; "auto" goes back to the system's scale. + assert_eq!(s.prefs.ui_scale, 1.25); + // Reading changes nothing; "auto" (older scripts) is the system's own size. assert_eq!(s.execute("pref.uiScale", &json!({})).unwrap()["scale"], 1.25); - assert_eq!(s.execute("pref.uiScale", &json!({"scale": "Auto"})).unwrap()["scale"], "auto"); - assert_eq!(s.prefs.ui_scale, None); + assert_eq!(s.execute("pref.uiScale", &json!({"scale": "Auto"})).unwrap()["scale"], 1.0); // Nothing to undo: the document didn't change. assert!(!s.ds().map(|d| d.is_dirty()).unwrap_or(false)); - // Saved with the other preferences. - s.prefs.ui_scale = Some(2.5); + // Saved with the other preferences and read back. + s.prefs.ui_scale = 0.9; let v = serde_json::to_value(&s.prefs).unwrap(); - assert_eq!(v["ui_scale"], 2.5); + assert_eq!(v["ui_scale"], 0.9); let back: crate::Prefs = serde_json::from_value(v).unwrap(); - assert_eq!(back.ui_scale, Some(2.5)); + assert_eq!(back.ui_scale, 0.9); } #[test] @@ -86,22 +84,22 @@ fn interface_size_stops_at_the_ends_and_junk_never_changes_it() { assert_eq!(s.execute("pref.uiScale", &json!({"scale": 1e308})).unwrap()["scale"], crate::UI_SCALE_MAX); // The size is a factor (1.25), not a percentage: 125 is far past the end and stops there. assert_eq!(s.execute("pref.uiScale", &json!({"scale": 125})).unwrap()["scale"], crate::UI_SCALE_MAX); - s.prefs.ui_scale = Some(1.5); + s.prefs.ui_scale = 1.5; for junk in [json!({"scale": "NaN"}), json!({"scale": "big"}), json!({"scale": [1]}), json!({"scale": {"x": 1}})] { assert!(s.execute("pref.uiScale", &junk).is_err(), "{junk}"); - assert_eq!(s.prefs.ui_scale, Some(1.5), "{junk}"); + assert_eq!(s.prefs.ui_scale, 1.5, "{junk}"); } } #[test] -fn a_settings_file_without_or_with_a_wrong_interface_size_reads_as_auto_and_keeps_the_rest() { +fn a_settings_file_without_or_with_a_wrong_interface_size_reads_as_the_systems_size_and_keeps_the_rest() { let old: crate::Prefs = serde_json::from_value(json!({"theme": "dark"})).unwrap(); - assert_eq!(old.ui_scale, None); + assert_eq!(old.ui_scale, 1.0); for bad in [json!("big"), json!(null), json!([2]), json!(true)] { let p: crate::Prefs = serde_json::from_value(json!({"theme": "dark", "ui_scale": bad})).unwrap(); - assert_eq!((p.ui_scale, p.theme.as_str()), (None, "dark"), "{bad}"); + assert_eq!((p.ui_scale, p.theme.as_str()), (1.0, "dark"), "{bad}"); } // A number out of range is clamped rather than refused. let p: crate::Prefs = serde_json::from_value(json!({"ui_scale": 99, "theme": "dark"})).unwrap(); - assert_eq!((p.ui_scale, p.theme.as_str()), (Some(crate::UI_SCALE_MAX), "dark")); + assert_eq!((p.ui_scale, p.theme.as_str()), (crate::UI_SCALE_MAX, "dark")); } diff --git a/crates/engine/src/cmd/view.rs b/crates/engine/src/cmd/view.rs index 9b929118a..eb573c570 100644 --- a/crates/engine/src/cmd/view.rs +++ b/crates/engine/src/cmd/view.rs @@ -373,19 +373,18 @@ pub fn specs() -> Vec { spec!( "pref.uiScale", "Interface size", - "{scale?: \"auto\" or a fixed size from 0.75 to 3, 1 being one screen pixel per point whatever scale the system reports, so 1.25 is 125 %, not 125 (outside the range it stops at the nearest end; omit: just read it)} → {scale: \"auto\" or the size}: how large the whole interface is drawn; auto keeps the system's scale; the canvas zoom is separate", + "{scale?: a size from 0.75 to 3 relative to the system's display scale, 1 being the system's own size, so 1.25 is 125 %, not 125 (outside the range it stops at the nearest end; \"auto\" is 1; omit: just read it)} → {scale}: how large the whole interface is drawn; the canvas zoom is separate", false, |s, p| { match get(p, "scale") { None => {} - Some(Value::String(v)) if v.trim().eq_ignore_ascii_case("auto") => s.prefs.ui_scale = None, + Some(Value::String(v)) if v.trim().eq_ignore_ascii_case("auto") => s.prefs.ui_scale = 1.0, Some(_) => { let scale = req_num("pref.uiScale", p, "scale")?; - s.prefs.ui_scale = - Some(crate::clamp_ui_scale(scale).ok_or_else(|| bad("pref.uiScale", "`scale` must be a finite number or \"auto\""))?); + s.prefs.ui_scale = crate::clamp_ui_scale(scale).ok_or_else(|| bad("pref.uiScale", "`scale` must be a finite number"))?; } } - Ok(json!({"scale": s.prefs.ui_scale.map_or(json!("auto"), |v| json!(v))})) + Ok(json!({"scale": s.prefs.ui_scale})) } ), spec!("pref.autoSave", "Save files automatically", "{on?}", false, |s, p| pref(s, p, |x| &mut x.auto_save)), diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index c8010399e..c70a145f6 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -603,20 +603,21 @@ impl DocState { } } -/// The smallest and largest fixed interface size: 1.0 is one screen pixel per point, whatever scale -/// the system reports. +/// The smallest and largest interface size, relative to the system's display scale (1.0 is the +/// system's own size). pub const UI_SCALE_MIN: f64 = 0.75; pub const UI_SCALE_MAX: f64 = 3.0; -/// `scale` kept between [`UI_SCALE_MIN`] and [`UI_SCALE_MAX`]; not a finite number: `None` (Auto). +/// `scale` kept between [`UI_SCALE_MIN`] and [`UI_SCALE_MAX`]; not a finite number: `None`. pub fn clamp_ui_scale(scale: f64) -> Option { scale.is_finite().then(|| scale.clamp(UI_SCALE_MIN, UI_SCALE_MAX)) } -/// Reads the saved interface size. Anything but a number reads as Auto and a number out of range is -/// clamped, so a settings file edited by hand never costs the other preferences. -fn read_ui_scale<'de, D: serde::Deserializer<'de>>(d: D) -> std::result::Result, D::Error> { - Ok(Value::deserialize(d)?.as_f64().and_then(clamp_ui_scale)) +/// Reads the saved interface size. Anything but a number reads as 1 (the system's size) and a +/// number out of range is clamped, so a settings file edited by hand never costs the other +/// preferences. +fn read_ui_scale<'de, D: serde::Deserializer<'de>>(d: D) -> std::result::Result { + Ok(Value::deserialize(d)?.as_f64().and_then(clamp_ui_scale).unwrap_or(1.0)) } /// App-wide preferences that commands read (nudge amounts, behaviours). @@ -646,11 +647,11 @@ pub struct Prefs { /// Reduce motion: the interface's own animations are off (the system's setting turns them off /// too). Prototype transitions still play. pub reduce_motion: bool, - /// How large the whole interface is drawn. `None` is Auto: the scale the system reports. A - /// number is a fixed size, 1.0 being one screen pixel per point, so it ignores the system's - /// scale (kept between [`UI_SCALE_MIN`] and [`UI_SCALE_MAX`]). The canvas zoom is separate. + /// How large the whole interface is drawn, relative to the system's display scale: 1.0 is the + /// system's own size, 1.25 a quarter larger (kept between [`UI_SCALE_MIN`] and + /// [`UI_SCALE_MAX`]). The canvas zoom is separate. #[serde(deserialize_with = "read_ui_scale")] - pub ui_scale: Option, + pub ui_scale: f64, /// Files that have a path are saved by themselves a few seconds after they change (the app's /// timer; off: only File ▸ Save writes them). pub auto_save: bool, @@ -719,7 +720,7 @@ impl Default for Prefs { language: "system".into(), user_name: cmd::comment::DEFAULT_AUTHOR.into(), reduce_motion: false, - ui_scale: None, + ui_scale: 1.0, auto_save: false, invite_links: None, plugins: Vec::new(), diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index b16d95509..16e74b5e2 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -134,9 +134,7 @@ name = "English" "Auto (space between)" = "Auto (space between)" "Auto (space evenly)" = "Auto (space evenly)" "Auto ({mode})" = "Auto ({mode})" -"Auto ({percent}%)" = "Auto ({percent}%)" "Auto columns" = "Auto columns" -"Auto follows your system's display scaling; the other sizes ignore it. Document zoom is separate." = "Auto follows your system's display scaling; the other sizes ignore it. Document zoom is separate." "Auto gap" = "Auto gap" "Auto height" = "Auto height" "Auto layout" = "Auto layout" @@ -1064,6 +1062,7 @@ name = "English" "Reduce motion" = "Reduce motion" "Refraction" = "Refraction" "Regular expression" = "Regular expression" +"Relative to your system's display scaling (100% is the system's own size). Document zoom is separate." = "Relative to your system's display scaling (100% is the system's own size). Document zoom is separate." "Remove" = "Remove" "Remove all" = "Remove all" "Remove annotation" = "Remove annotation" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 61ec88733..2e7bcff2a 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -8,8 +8,6 @@ name = "Español" status = "draft — needs native review" [ui] -"Auto ({percent}%)" = "Auto ({percent}%)" -"Auto follows your system's display scaling; the other sizes ignore it. Document zoom is separate." = "Auto sigue el escalado de pantalla del sistema; los demás tamaños lo ignoran. El zoom del documento es independiente." "Compatibility notes" = "Notas de compatibilidad" "Couldn't download the variables" = "No se pudieron descargar las variables" @@ -1065,6 +1063,7 @@ status = "draft — needs native review" "Reduce motion" = "Reducir movimiento" "Refraction" = "Refracción" "Regular expression" = "Expresión regular" +"Relative to your system's display scaling (100% is the system's own size). Document zoom is separate." = "Relativo al escalado de pantalla del sistema (100% es el tamaño del propio sistema). El zoom del documento es independiente." "Remove" = "Quitar" "Remove all" = "Quitar todo" "Remove annotation" = "Quitar anotación" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index ff88477fa..c3dd05532 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -134,9 +134,7 @@ status = "draft — needs native review" "Auto (space between)" = "Auto (espace entre)" "Auto (space evenly)" = "Auto (espace égal)" "Auto ({mode})" = "Auto ({mode})" -"Auto ({percent}%)" = "Auto ({percent} %)" "Auto columns" = "Colonnes auto" -"Auto follows your system's display scaling; the other sizes ignore it. Document zoom is separate." = "Auto suit la mise à l’échelle d’affichage de votre système ; les autres tailles l’ignorent. Le zoom du document est distinct." "Auto gap" = "Espacement auto" "Auto height" = "Hauteur auto" "Auto layout" = "Mise en page auto" @@ -1061,6 +1059,7 @@ status = "draft — needs native review" "Reduce motion" = "Réduire les animations" "Refraction" = "Réfraction" "Regular expression" = "Expression régulière" +"Relative to your system's display scaling (100% is the system's own size). Document zoom is separate." = "Relative à la mise à l’échelle d’affichage de votre système (100 % est la taille du système). Le zoom du document est distinct." "Remove" = "Retirer" "Remove all" = "Tout retirer" "Remove annotation" = "Retirer l’annotation" diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 3fb2c2d4f..c69f5616a 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -479,33 +479,25 @@ pub(crate) fn batch_rename_params(b: &BatchRenameUi) -> serde_json::Value { p } -/// Rename layers: Match, Rename to with buttons for the current name and numbers, where numbers -/// start, a preview of the first new names, then one `object.batchRename`. -/// Preferences ▸ Interface size: Auto (the system's scale) or a fixed size, as a drop-down that -/// takes effect at once, with what each means written out. The browser has its own zoom, so there +/// Preferences ▸ Interface size: a size relative to the system's display scale (100 % is the +/// system's own), as a drop-down that takes effect at once. The browser has its own zoom, so there /// the row only says so. -fn interface_size(app: &mut FigApp, ui: &mut egui::Ui, chosen: Option) { +fn interface_size(app: &mut FigApp, ui: &mut egui::Ui, chosen: f64) { let t = Tokens::get(ui.ctx()); if cfg!(target_arch = "wasm32") { ui.label(tr("Interface size")); crate::widgets::label(ui, tr("Use your browser's zoom to change the interface size."), t.text_secondary); return; } - let percent = |scale: f32| crate::ui_scale::percent(scale); - let auto = trf("Auto ({percent}%)", &[("percent", &percent(app.ui.ui_native))]); - let fixed = |size: f64| trf("{percent}%", &[("percent", &percent(size as f32))]); - let shown = chosen.map_or_else(|| auto.clone(), fixed); + let percent = |size: f64| trf("{percent}%", &[("percent", &crate::ui_scale::percent(size as f32))]); + let shown = percent(chosen); ui.horizontal(|ui| { ui.label(tr("Interface size")); let resp = crate::widgets::dropdown(ui, &shown, 120.0, None); crate::a11y::combo(&resp, tr("Interface size"), &shown, crate::a11y::menu_open(&resp)); crate::right::menu_popup(&resp).show(|ui| { - if crate::right::menu_check(ui, chosen.is_none(), &auto, "") { - app.run("pref.uiScale", json!({"scale": "auto"})); - ui.close(); - } for size in crate::ui_scale::SIZES { - if crate::right::menu_check(ui, chosen == Some(size), &fixed(size), "") { + if crate::right::menu_check(ui, (chosen - size).abs() < 1e-6, &percent(size), "") { app.run("pref.uiScale", json!({"scale": size})); ui.close(); } @@ -514,19 +506,21 @@ fn interface_size(app: &mut FigApp, ui: &mut egui::Ui, chosen: Option) { }); crate::widgets::label( ui, - tr("Auto follows your system's display scaling; the other sizes ignore it. Document zoom is separate."), + tr("Relative to your system's display scaling (100% is the system's own size). Document zoom is separate."), t.text_secondary, ); // Said in words, not only by the menu's value: the window is too small for the size chosen. - if let Some(size) = chosen.filter(|_| app.ui.ui_scale.limited) { + if app.ui.ui_scale.limited { let note = trf( "The window is too small for {size}%, so the interface is drawn at {drawn}%. Make the window larger to use {size}%.", - &[("size", &percent(size as f32)), ("drawn", &percent(app.ui.ui_scale.drawn))], + &[("size", &crate::ui_scale::percent(chosen as f32)), ("drawn", &crate::ui_scale::percent(app.ui.ui_scale.zoom))], ); crate::widgets::label(ui, ¬e, t.text_secondary); } } +/// Rename layers: Match, Rename to with buttons for the current name and numbers, where numbers +/// start, a preview of the first new names, then one `object.batchRename`. fn batch_rename_dialog(app: &mut FigApp, ctx: &Context) { let Some(mut b) = app.ui.batch_rename.clone() else { return }; let t = Tokens::get(ctx); diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index f329c5212..7f7dcca6b 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -462,11 +462,9 @@ pub struct UiState { pub menu_input: Option, /// File ▸ Rename: the file name in the left panel starts its inline rename on the next frame. pub rename_file: bool, - /// What the interface size drew last frame: the system's scale (what Auto shows) and whether - /// the window held a fixed size back. Set by [`FigApp::logic`] for the main window. + /// What the interface size drew last frame and whether the window held it back. Set by + /// [`FigApp::logic`] for the main window. pub ui_scale: ui_scale::Plan, - /// The system's scale of the main window, as of the last frame. - pub ui_native: f32, pub shortcuts_panel: bool, /// The Keyboard shortcuts panel's tab and search text. pub shortcuts_tab: figcraft_engine::keymap::Group, @@ -620,8 +618,7 @@ impl Default for UiState { preferences: false, menu_input: None, rename_file: false, - ui_scale: ui_scale::plan(None, None, None), - ui_native: 1.0, + ui_scale: ui_scale::plan(1.0, None, None), shortcuts_panel: false, shortcuts_tab: figcraft_engine::keymap::Group::Essential, shortcuts_query: String::new(), @@ -1271,16 +1268,15 @@ impl FigApp { theme::install_fonts(ctx, true, cjk); } } - // egui's zoom is for the whole app, so only the main window sets it (a window on another - // screen has its own system scale). The browser keeps its own zoom: Auto there. + // egui's zoom is for the whole app and multiplies each window's own system scale, so the + // size is the same relative to every screen; the main window, whose size can hold a size + // back, sets it. The browser keeps its own zoom. if ctx.viewport_id() == egui::ViewportId::ROOT { - let native = ctx.native_pixels_per_point(); let window_px = ctx.content_rect().size() * ctx.pixels_per_point(); - let fixed = if cfg!(target_arch = "wasm32") { None } else { self.session.prefs.ui_scale }; - let plan = ui_scale::plan(fixed, native, Some((window_px.x, window_px.y))); + let size = if cfg!(target_arch = "wasm32") { 1.0 } else { self.session.prefs.ui_scale }; + let plan = ui_scale::plan(size, ctx.native_pixels_per_point(), Some((window_px.x, window_px.y))); ctx.set_zoom_factor(plan.zoom); self.ui.ui_scale = plan; - self.ui.ui_native = native.filter(|n| n.is_finite() && *n > 0.0).unwrap_or(1.0); } let dark = match self.session.prefs.theme.as_str() { "dark" => true, @@ -1701,7 +1697,7 @@ impl FigApp { }); state["homeSearch"] = json!(self.ui.home_view.file_query); // Set apart from the literal above, which is at the macro recursion limit. - state["uiScale"] = json!({"choice": self.session.prefs.ui_scale.map_or(json!("auto"), |v| json!(v)), "drawn": self.ui.ui_scale.drawn, "limited": self.ui.ui_scale.limited}); + state["uiScale"] = json!({"choice": self.session.prefs.ui_scale, "zoom": self.ui.ui_scale.zoom, "drawn": self.ui.ui_scale.drawn, "limited": self.ui.ui_scale.limited}); state["pendingOpens"] = json!(self.ui.pending_opens.len()); state["missingFonts"] = json!(self.ui.missing_fonts.as_ref().map(missing_fonts::Shown::inspect)); state diff --git a/crates/ui-egui/src/ui_scale.rs b/crates/ui-egui/src/ui_scale.rs index 91d790ccb..6b275a078 100644 --- a/crates/ui-egui/src/ui_scale.rs +++ b/crates/ui-egui/src/ui_scale.rs @@ -1,11 +1,10 @@ //! The interface size (Preferences ▸ Interface size, `pref.uiScale`): how the saved choice becomes //! egui's zoom factor. //! -//! egui draws at `pixels_per_point = zoom factor × the system's scale`. Auto leaves the zoom at 1 so -//! the system's scale rules. A fixed size is absolute: 100 % is one screen pixel per point on every -//! system, so the zoom is the size divided by the system's scale (a Retina Mac at 2× needs 0.5 to -//! show 100 %). A fixed size is held back while the window is too small to lay the interface out at -//! it; the saved choice never changes. +//! egui draws at `pixels_per_point = zoom factor × the system's scale`. The size is relative to the +//! system's scale, so it is the zoom itself: 100 % is the system's own size on every screen (native +//! on a Retina Mac too), 125 % a quarter larger. A size above 100 % is held back while the window is +//! too small to lay the interface out at it; the saved choice never changes. /// The smallest window, in points, the interface is laid out for: the main window's minimum size. pub const FIT_POINTS: (f32, f32) = (800.0, 500.0); @@ -16,32 +15,31 @@ const ZOOM_RANGE: (f32, f32) = (0.1, 10.0); /// What to give egui for a saved choice on this screen and window. #[derive(Clone, Copy, Debug, PartialEq)] pub struct Plan { - /// For `Context::set_zoom_factor`. + /// For `Context::set_zoom_factor`: the size drawn, relative to the system's scale. pub zoom: f32, /// Physical pixels per point once drawn (the zoom times the system's scale). pub drawn: f32, - /// A fixed size was chosen but the window is too small for it, so a smaller one is drawn. + /// The window is too small for the size chosen, so a smaller one is drawn. pub limited: bool, } -/// The plan for `choice` (`None`: Auto), the system's scale `native` and the window's size in -/// physical pixels `window_px`. An unknown, zero or not finite value reads as no information: a -/// system scale of 1 and a window of any size. -pub fn plan(choice: Option, native: Option, window_px: Option<(f32, f32)>) -> Plan { +/// The plan for `choice` (relative to the system's scale), the system's scale `native` and the +/// window's size in physical pixels `window_px`. An unknown, zero or not finite value reads as no +/// information: a size of 1, a system scale of 1 and a window of any size. +pub fn plan(choice: f64, native: Option, window_px: Option<(f32, f32)>) -> Plan { let native = native.filter(|n| n.is_finite() && *n > 0.0).unwrap_or(1.0); - let Some(want) = choice.map(|c| c as f32).filter(|c| c.is_finite() && *c > 0.0) else { - return Plan { zoom: 1.0, drawn: native, limited: false }; - }; - let fit = - window_px.filter(|(w, h)| w.is_finite() && h.is_finite() && *w > 0.0 && *h > 0.0).map(|(w, h)| (w / FIT_POINTS.0).min(h / FIT_POINTS.1)); - // Never below 1 (or the size asked, when that is smaller): a tiny window doesn't shrink the interface further. - let target = match fit { + let want = Some(choice as f32).filter(|c| c.is_finite() && *c > 0.0).unwrap_or(1.0); + // The largest zoom at which the window still holds the smallest layout. + let fit = window_px + .filter(|(w, h)| w.is_finite() && h.is_finite() && *w > 0.0 && *h > 0.0) + .map(|(w, h)| (w / FIT_POINTS.0).min(h / FIT_POINTS.1) / native); + // Never below 100 % (or the size asked, when that is smaller): a tiny window doesn't shrink the interface further. + let zoom = match fit { Some(fit) if want > fit => fit.max(want.min(1.0)), _ => want, - }; - let zoom = (target / native).clamp(ZOOM_RANGE.0, ZOOM_RANGE.1); - let drawn = zoom * native; - Plan { zoom, drawn, limited: drawn < want - 0.005 } + } + .clamp(ZOOM_RANGE.0, ZOOM_RANGE.1); + Plan { zoom, drawn: zoom * native, limited: zoom < want - 0.005 } } /// A size as the percentage Preferences shows (1.25 → 125). @@ -49,79 +47,70 @@ pub fn percent(scale: f32) -> u32 { (scale * 100.0).round().clamp(0.0, 100_000.0) as u32 } -/// The fixed sizes Preferences offers, after Auto. -pub const SIZES: [f64; 7] = [0.75, 1.0, 1.25, 1.5, 2.0, 2.5, 3.0]; +/// The sizes Preferences offers, relative to the system's scale (`pref.uiScale` takes up to 3). +pub const SIZES: [f64; 8] = [0.75, 0.9, 1.0, 1.1, 1.25, 1.5, 1.75, 2.0]; #[cfg(test)] mod tests { use super::*; - const BIG: Option<(f32, f32)> = Some((5000.0, 3000.0)); + const BIG: Option<(f32, f32)> = Some((20000.0, 12000.0)); #[test] - fn auto_keeps_the_systems_scale_on_every_screen() { - for native in [1.0, 1.25, 1.5, 1.75, 2.0, 3.0] { - let p = plan(None, Some(native), BIG); - assert_eq!((p.zoom, p.drawn, p.limited), (1.0, native, false), "{native}"); - } - } - - #[test] - fn a_fixed_size_is_the_same_size_whatever_the_systems_scale() { + fn a_size_is_relative_to_the_systems_scale_on_every_screen() { // Windows 100/125/150/175 %, Retina 2×, a bare X11 window manager's guessed 2×, a 3× screen. for native in [1.0, 1.25, 1.5, 1.75, 2.0, 3.0] { + let p = plan(1.0, Some(native), BIG); + assert_eq!((p.zoom, p.drawn, p.limited), (1.0, native, false), "100 % is the system's own size on {native}"); for size in SIZES { - let p = plan(Some(size), Some(native), BIG); - assert!((p.drawn - size as f32).abs() < 1e-5, "{size} on {native}: drawn {}", p.drawn); + let p = plan(size, Some(native), BIG); + assert!((p.zoom - size as f32).abs() < 1e-5, "{size} on {native}: zoom {}", p.zoom); + assert!((p.drawn - size as f32 * native).abs() < 1e-4, "{size} on {native}: drawn {}", p.drawn); assert!(!p.limited, "{size} on {native}"); } } - // 100 % on a 2× screen really is half the Auto size: the zoom is 0.5. - assert_eq!(plan(Some(1.0), Some(2.0), BIG).zoom, 0.5); } #[test] fn a_missing_or_unusable_scale_reads_as_1_and_never_gives_egui_a_bad_zoom() { for native in [None, Some(0.0), Some(-2.0), Some(f32::NAN), Some(f32::INFINITY)] { - for choice in [None, Some(1.5), Some(f64::NAN), Some(f64::INFINITY), Some(-1.0), Some(0.0), Some(1e300)] { + for choice in [1.0, 1.5, f64::NAN, f64::INFINITY, -1.0, 0.0, 1e300] { let p = plan(choice, native, Some((f32::NAN, 0.0))); assert!(p.zoom.is_finite() && (ZOOM_RANGE.0..=ZOOM_RANGE.1).contains(&p.zoom), "{choice:?} {native:?}: {p:?}"); assert!(p.drawn.is_finite() && p.drawn > 0.0, "{choice:?} {native:?}: {p:?}"); } } - // A choice that isn't a usable number is Auto. - assert_eq!(plan(Some(f64::NAN), Some(2.0), BIG), plan(None, Some(2.0), BIG)); + // A choice that isn't a usable number is the system's own size. + assert_eq!(plan(f64::NAN, Some(2.0), BIG), plan(1.0, Some(2.0), BIG)); } #[test] fn a_small_window_holds_a_big_size_back_without_going_below_100() { - // The minimum window on a Retina Mac: 800 × 500 points is 1600 × 1000 pixels. + // The minimum window on a Retina Mac: 800 × 500 points is 1600 × 1000 pixels, which holds 100 % only. let min = Some((1600.0, 1000.0)); - let p = plan(Some(3.0), Some(2.0), min); - assert_eq!((p.drawn, p.limited), (2.0, true)); - assert!(!plan(Some(2.0), Some(2.0), min).limited); - // The same window on a 1× screen: 800 × 500 pixels hold only 100 %. - let p = plan(Some(2.0), Some(1.0), Some((800.0, 500.0))); - assert_eq!((p.drawn, p.limited), (1.0, true)); + let p = plan(1.5, Some(2.0), min); + assert_eq!((p.zoom, p.drawn, p.limited), (1.0, 2.0, true)); + assert!(!plan(1.0, Some(2.0), min).limited); + // A larger window on a 1× screen: 1200 × 750 pixels hold 150 %. + let p = plan(2.0, Some(1.0), Some((1200.0, 750.0))); + assert_eq!((p.zoom, p.limited), (1.5, true)); // A window smaller than the minimum (a tiling window manager): never below 100 %, and never // below a smaller size the person chose. - assert_eq!(plan(Some(2.0), Some(1.0), Some((400.0, 250.0))).drawn, 1.0); - let p = plan(Some(0.75), Some(1.0), Some((400.0, 250.0))); - assert_eq!((p.drawn, p.limited), (0.75, false)); + assert_eq!(plan(2.0, Some(1.0), Some((400.0, 250.0))).zoom, 1.0); + let p = plan(0.75, Some(1.0), Some((400.0, 250.0))); + assert_eq!((p.zoom, p.limited), (0.75, false)); } #[test] fn the_limit_does_not_depend_on_the_zoom_so_it_cannot_flicker() { // The window's size in pixels is the same whatever zoom is drawn now, so the plan for it is too. let px = Some((1700.0, 1100.0)); - let a = plan(Some(2.5), Some(2.0), px); - let b = plan(Some(2.5), Some(2.0), px); - assert_eq!(a, b); + assert_eq!(plan(2.5, Some(2.0), px), plan(2.5, Some(2.0), px)); } #[test] fn percentages_round_like_the_menu_shows_them() { - assert_eq!([percent(0.75), percent(1.0), percent(1.25), percent(2.0), percent(1.7999)], [75, 100, 125, 200, 180]); + assert_eq!([percent(0.75), percent(0.9), percent(1.1), percent(1.25), percent(2.0), percent(1.7999)], [75, 90, 110, 125, 200, 180]); assert_eq!([percent(f32::NAN), percent(-1.0)], [0, 0]); } } diff --git a/crates/ui-egui/src/ui_scale_tests.rs b/crates/ui-egui/src/ui_scale_tests.rs index 189552e7e..018c963a1 100644 --- a/crates/ui-egui/src/ui_scale_tests.rs +++ b/crates/ui-egui/src/ui_scale_tests.rs @@ -1,5 +1,5 @@ -//! The interface size, driven through egui headless on screens of different system scales: Auto -//! leaves the system's scale alone, a fixed size comes out the same on every screen, and the +//! The interface size, driven through egui headless on screens of different system scales: 100 % +//! leaves the system's scale alone, another size is relative to it on every screen, and the //! Preferences drop-down tells a screen reader its name and value. //! //! The test window's size is fixed in points, so it grows with the zoom here; the limit for a small @@ -29,25 +29,25 @@ fn settle(u: &mut Ui, native: f32) { const SCREENS: [f32; 5] = [1.0, 1.25, 1.5, 2.0, 3.0]; #[test] -fn auto_leaves_the_systems_scale_and_the_menu_can_say_what_it_is() { +fn by_default_the_interface_is_the_systems_own_size() { for native in SCREENS { let mut u = Ui::new(Session::new()); settle(&mut u, native); assert_eq!(u.ctx.zoom_factor(), 1.0, "{native}"); assert_eq!(u.ctx.pixels_per_point(), native, "{native}"); - assert_eq!(u.app.ui.ui_native, native, "what Auto shows in the menu: {native}"); } } #[test] -fn a_fixed_size_draws_the_same_on_every_screen_and_auto_brings_the_systems_scale_back() { +fn a_size_is_relative_to_the_systems_scale_on_every_screen_and_auto_is_100() { for native in SCREENS { let mut u = Ui::new(Session::new()); - for size in [0.75_f64, 1.0, 1.5] { + for size in [0.75_f64, 0.9, 1.25, 1.5] { assert!(u.app.run("pref.uiScale", json!({"scale": size})).is_some()); settle(&mut u, native); let drawn = u.ctx.pixels_per_point(); - assert!((drawn - size as f32).abs() < 1e-4, "{size} on a {native}× screen drew at {drawn}"); + assert!((drawn - size as f32 * native).abs() < 1e-4, "{size} on a {native}× screen drew at {drawn}"); + assert!((u.ctx.zoom_factor() - size as f32).abs() < 1e-5, "{size} on {native}"); assert!(!u.app.ui.ui_scale.limited, "{size} on {native}"); } assert!(u.app.run("pref.uiScale", json!({"scale": "auto"})).is_some()); @@ -68,8 +68,8 @@ fn the_interface_size_menu_has_a_name_a_value_and_a_state_for_a_screen_reader() let n = nodes.iter().find(|n| n.role() == Role::ComboBox && n.label() == Some("Interface size")).expect("an Interface size menu"); (n.value().map(str::to_owned), n.is_expanded()) }; - // Auto says the size it draws at: a 2× screen is 200 %. - assert_eq!(combo(&mut u), (Some("Auto (200%)".to_owned()), Some(false))); + // 100 % is the system's own size, whatever it is (2× here). + assert_eq!(combo(&mut u), (Some("100%".to_owned()), Some(false))); u.app.run("pref.uiScale", json!({"scale": 1.25})); assert_eq!(combo(&mut u), (Some("125%".to_owned()), Some(false))); } @@ -100,17 +100,14 @@ fn every_window_size_system_scale_and_interface_size_lays_out_inside_the_window( (5120.0, 2880.0), (2560.0, 520.0), ]; - let mut choices: Vec> = vec![None]; - choices.extend(SIZES.iter().map(|s| Some(*s))); for native in [1.0_f32, 1.25, 1.5, 1.75, 2.0, 3.0] { for (w, h) in windows { let px = vec2(w * native, h * native); - for choice in &choices { - let case = format!("{w}x{h} pt at {native}x, {choice:?}"); + for want in SIZES { + let case = format!("{w}x{h} pt at {native}x, {want}"); let mut app = FigApp::new(Session::new(), Box::new(NoServices)); - let scale = choice.map_or(json!("auto"), |c| json!(c)); - assert!(app.run("pref.uiScale", json!({"scale": scale})).is_some(), "{case}"); + assert!(app.run("pref.uiScale", json!({"scale": want})).is_some(), "{case}"); let ctx = egui::Context::default(); let mut time = 0.0; let mut seen = Vec::new(); @@ -129,24 +126,18 @@ fn every_window_size_system_scale_and_interface_size_lays_out_inside_the_window( assert!(ppp.is_finite() && ppp > 0.0 && content.x.is_finite() && content.y.is_finite(), "{case}: {ppp} {content:?}"); let plan = app.ui.ui_scale; assert!((ppp - plan.drawn).abs() < 1e-3, "{case}: egui draws at {ppp}, the plan said {}", plan.drawn); - match choice { - None => assert!((ppp - native).abs() < 1e-3 && !plan.limited, "{case}: Auto must keep the system's scale"), - Some(want) => { - let want = *want as f32; - assert_eq!(plan.limited, ppp < want - 0.005, "{case}: limited flag"); - // Above 100 % the window holds the smallest layout; at or below it there is nothing more to give up. - if ppp > 1.001 { - assert!( - content.x >= FIT_POINTS.0 - 0.5 && content.y >= FIT_POINTS.1 - 0.5, - "{case}: window is {content:?} points at {ppp}" - ); - } - // It never draws bigger than asked, and only a window too small for it draws smaller. - assert!(ppp <= want + 1e-3, "{case}"); - if !plan.limited { - assert!((ppp - want).abs() < 1e-3, "{case}"); - } - } + // The size drawn, relative to the system's scale. + let zoom = ppp / native; + let want = want as f32; + assert_eq!(plan.limited, zoom < want - 0.005, "{case}: limited flag"); + // Above 100 % the window holds the smallest layout; at or below it there is nothing more to give up. + if zoom > 1.001 { + assert!(content.x >= FIT_POINTS.0 - 0.5 && content.y >= FIT_POINTS.1 - 0.5, "{case}: window is {content:?} points at {ppp}"); + } + // It never draws bigger than asked, and only a window too small for it draws smaller. + assert!(zoom <= want + 1e-3, "{case}"); + if !plan.limited { + assert!((zoom - want).abs() < 1e-3, "{case}"); } let panels = &app.inspect()["panels"]; let side = panels["left"].as_f64().unwrap_or(0.0) + panels["right"].as_f64().unwrap_or(0.0); @@ -191,7 +182,7 @@ fn the_interface_size_menu_works_from_the_keyboard() { u.app.ui.preferences = true; u.ctx.enable_accesskit(); settle(&mut u, 1.0); - assert_eq!(chosen(&u), json!("auto")); + assert_eq!(chosen(&u), json!(1.0)); // Escape closes the menu and nothing else: the size is unchanged and Preferences stays open. open(&mut u); @@ -199,14 +190,14 @@ fn the_interface_size_menu_works_from_the_keyboard() { u.frame(vec![]); assert!(!Popup::is_any_open(&u.ctx)); assert!(u.app.ui.preferences, "the first Escape closes the menu only"); - assert_eq!(chosen(&u), json!("auto")); + assert_eq!(chosen(&u), json!(1.0)); - // The arrows enter the menu on Auto (which says the size it draws at) and go down through the - // sizes (75, 100, 125); Enter picks the one that has the keyboard and closes the menu. + // The arrows enter the menu on its first size and go down through the sizes (75, 90, 100, 110, + // 125); Enter picks the one that has the keyboard and closes the menu. open(&mut u); press(&mut u, Key::ArrowDown); - assert_eq!(focused_name(&u.ctx), "Auto (100%)"); - for _ in 0..3 { + assert_eq!(focused_name(&u.ctx), "75%"); + for _ in 0..4 { press(&mut u, Key::ArrowDown); } assert_eq!(focused_name(&u.ctx), "125%"); diff --git a/docs/control-protocol.md b/docs/control-protocol.md index c54fbd7e4..08c08b085 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -173,8 +173,9 @@ instance, a dragged axis slider; see `text.preview` in [mcp.md](mcp.md)). pointer press, so the focus ring shows) and the name of the `control` with the keyboard (what a screen reader announces; empty when nothing has it). `reduceMotion` is true when the preference or the system's accessibility setting turns the interface's animations off. `uiScale` is the interface -size: the `choice` (`"auto"` or a fixed size, `pref.uiScale`), what is `drawn` (physical pixels per -point) and whether the window is too small for the choice (`limited`, so `drawn` is smaller). `live` is the live +size: the `choice` (relative to the system's display scale, `pref.uiScale`), the `zoom` drawn +(relative too), what that is in physical pixels per point (`drawn`) and whether the window is too +small for the choice (`limited`, so `zoom` is smaller). `live` is the live session of the window's active file as the window shows it (sessions are per file: another tab shows its own, or `status: "off"`): `session` (its id, null when the file isn't in one), `sessions` (how many the app has running), `status`, `role`, the number of `peers`, who you `follow`, the diff --git a/docs/mcp.md b/docs/mcp.md index 42a6222db..46c0fd0f8 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -417,12 +417,11 @@ on; `key` resolves keys the way the canvas does. Commands behind keys: nested layers), Escape or a click drops it. - `pref.reduceMotion {on?}`: reduced motion (the interface's own animations off; the system's accessibility setting turns it on too). Prototype transitions still play. -- `pref.uiScale {scale?}`: how large the whole interface is drawn. `scale` is `"auto"` (the system's - display scale, the default) or a fixed size from 0.75 to 3 where 1 is one screen pixel per point - whatever scale the system reports, so a 2× screen needs 2 to match Auto. 1.25 means 125 %, not 125 - (outside the range it stops at the nearest end). Omit `scale` to read it. The canvas zoom is separate. - A window too small for a fixed size draws a smaller one until it is larger; the choice is kept. - In the browser the interface always follows the browser's zoom. +- `pref.uiScale {scale?}`: how large the whole interface is drawn, relative to the system's display + scale: 1 (the default) is the system's own size on every screen, 1.25 means 125 %, not 125; from + 0.75 to 3 (outside the range it stops at the nearest end; `"auto"` is 1). Omit `scale` to read it. + The canvas zoom is separate. A window too small for a size above 100 % draws a smaller one until + it is larger; the choice is kept. In the browser the interface always follows the browser's zoom. - `pref.autoSave {on?}`: files that have a path save themselves a few seconds after they change (off by default; the desktop app's timer does it, so scripts still call `file.save`). - `pref.language {language: system|en|cs|ru|es|es-419|fr|de|pt-BR|ja|ko|zh-Hans|…}`: the app's interface language, applied live ("system": From ec9bb5f978af44ffdb57d303a0dd8c3254301690 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 00:26:06 +0700 Subject: [PATCH 383/817] #812: a shorter Intensity label that fits the glass field --- crates/ui-egui/locales/pl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/locales/pl.toml b/crates/ui-egui/locales/pl.toml index aa5b7533a..23f7dee8e 100644 --- a/crates/ui-egui/locales/pl.toml +++ b/crates/ui-egui/locales/pl.toml @@ -649,7 +649,7 @@ status = "draft — needs native review" "Instance swap (no other component)" = "Podmiana instancji (brak innego komponentu)" "Instances" = "Instancje" "Instant" = "Natychmiastowo" -"Intensity" = "Intensywność" +"Intensity" = "Siła" "Interaction" = "Interakcja" "Interactions" = "Interakcje" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Projektowanie interfejsów i prototypowanie. Darmowe, otwartoźródłowe, czysto implementowane narzędzie projektowe napisane od podstaw w Rust, część ArtCraft Crafting Apps." From 9ea757736f821178b196a893d84c26bce3cb5649 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 00:45:55 +0700 Subject: [PATCH 384/817] #880: leave web font embedding off until the font pin carries Archivo --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e1aa660f..75f7a5fae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,6 @@ jobs: app-name: figcraft app-title: FigCraft craft-fonts-ref: 43913056ce82a3fdad0ef69f6b88d1dc922a8104 - web-craft-fonts: true has-server: true version: ${{ inputs.version }} secrets: From 088693cfd351c8f4056bb782a03d4d8d49d23c58 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 00:45:56 +0700 Subject: [PATCH 385/817] #880: canvas overlays take the green that stands out on the page; white text stays on the darker green --- crates/ui-egui/src/canvas.rs | 96 +++++++++++++++++------------- crates/ui-egui/src/frame_labels.rs | 2 +- crates/ui-egui/src/handles.rs | 19 +++--- crates/ui-egui/src/proto_canvas.rs | 27 ++++++--- crates/ui-egui/src/theme.rs | 36 +++++++++++ 5 files changed, 124 insertions(+), 56 deletions(-) diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 9e0c1d797..71dd9e8b7 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -12,7 +12,7 @@ use serde_json::json; use crate::FigApp; use crate::i18n::{tr, trf, trn}; use crate::render_worker::{Done, Job, Worker}; -use crate::theme::{ACCENT, COMPONENT, Tokens, doc_c32, regular, semibold}; +use crate::theme::{COMPONENT, Tokens, doc_c32, regular, semibold}; pub struct CanvasState { pub rect: Rect, @@ -233,6 +233,7 @@ pub fn show(app: &mut FigApp, ui: &mut Ui, worker: &mut Worker) { }) .unwrap_or(t.canvas); painter.rect_filled(rect, CornerRadius::ZERO, bg); + crate::theme::set_canvas_page(&ctx, bg); if let (Some(tex), Some(v), true) = (&app.canvas.texture, &app.canvas.tex_view, shown.is_some() && app.canvas.tex_of == shown) { // Re-project the last render onto the current view. let tl = app.to_screen(v.origin.0, v.origin.1); @@ -247,8 +248,8 @@ pub fn show(app: &mut FigApp, ui: &mut Ui, worker: &mut Worker) { if let (Some(start), Some(p)) = (app.canvas.zoom_drag, ctx.input(|i| i.pointer.hover_pos())) { let area = Rect::from_two_pos(start, p); if area.width() > 4.0 || area.height() > 4.0 { - painter.rect_filled(area, CornerRadius::ZERO, ACCENT.gamma_multiply(0.1)); - painter.rect_stroke(area, CornerRadius::ZERO, Stroke::new(1.0, ACCENT), StrokeKind::Inside); + painter.rect_filled(area, CornerRadius::ZERO, accent(&painter).gamma_multiply(0.1)); + painter.rect_stroke(area, CornerRadius::ZERO, Stroke::new(1.0, accent(&painter)), StrokeKind::Inside); } } crate::dev_mode::draw(app, &painter); @@ -809,11 +810,11 @@ fn swap_highlight(app: &FigApp, painter: &egui::Painter, doc: &Document, id: Nod } /// The outline colour for a layer: purple for components, sets and instances and every layer in -/// them, blue otherwise. -fn outline_colour(doc: &Document, id: NodeId) -> Color32 { +/// them, the page's overlay `green` otherwise. +fn outline_colour(doc: &Document, id: NodeId, green: Color32) -> Color32 { use figcraft_engine::components::{owning_component, owning_instance}; let set = matches!(doc.node(id).map(|n| &n.kind), Some(NodeKind::ComponentSet { .. })); - if set || owning_component(doc, id).is_some() || owning_instance(doc, id).is_some() { COMPONENT } else { ACCENT } + if set || owning_component(doc, id).is_some() || owning_instance(doc, id).is_some() { COMPONENT } else { green } } /// The outline path of shapes (ellipses, vectors) for hover/selection outlines. @@ -946,20 +947,20 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ && app.session.prefs.highlight_on_hover && app.session.tool.overlay.measure_box.is_none() { - draw_outline(app, painter, &doc, h, stroke(outline_colour(&doc, h), 1.5)); + draw_outline(app, painter, &doc, h, stroke(outline_colour(&doc, h, accent(painter)), 1.5)); } // Inside a boolean group (an operand selected or in vector edit mode): every operand's outline, // so the shapes making the live result stay visible while one of them changes. let operands = figcraft_engine::booleans::outlined_operands(&doc, &sel, ds.vector_edit.as_ref().map(|ve| ve.id)); for id in operands.iter().filter(|o| !sel.contains(o)) { - draw_outline(app, painter, &doc, *id, stroke(outline_colour(&doc, *id).gamma_multiply(0.6), 1.0)); + draw_outline(app, painter, &doc, *id, stroke(outline_colour(&doc, *id, accent(painter)).gamma_multiply(0.6), 1.0)); } // Mask outlines (a mask doesn't draw itself), frame outlines and slices, as the View menu shows. if view.mask_outlines || view.frame_outlines || view.show_slices { for id in doc.subtree(page) { let Some(n) = doc.node(id).filter(|n| n.visible) else { continue }; if view.mask_outlines && n.is_mask { - draw_outline(app, painter, &doc, id, stroke(ACCENT, 1.0)); + draw_outline(app, painter, &doc, id, stroke(accent(painter), 1.0)); } else if view.frame_outlines && n.kind.is_frame_like() { draw_outline(app, painter, &doc, id, stroke(t.text_secondary, 1.0)); } else if view.show_slices @@ -975,20 +976,20 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ if let Some(d) = ov.drop_target && let Some(q) = node_quad(app, &doc, d) { - quad(painter, q, stroke(if figcraft_engine::components::is_slot(&doc, d) { COMPONENT } else { ACCENT }, 1.0)); + quad(painter, q, stroke(if figcraft_engine::components::is_slot(&doc, d) { COMPONENT } else { accent(painter) }, 1.0)); } slot_badges(app, painter, &doc, &sel, ov.drop_target); if let Some(t) = ov.swap_target { swap_highlight(app, painter, &doc, t); } if let Some([x0, y0, x1, y1]) = ov.insert_line { - painter.line_segment([app.to_screen(x0, y0), app.to_screen(x1, y1)], stroke(ACCENT, 2.0)); + painter.line_segment([app.to_screen(x0, y0), app.to_screen(x1, y1)], stroke(accent(painter), 2.0)); } if let Some([x0, y0, x1, y1]) = ov.drop_cell { let r = Rect::from_two_pos(app.to_screen(x0, y0), app.to_screen(x1, y1)); - painter.rect_filled(r, CornerRadius::same(2), ACCENT.gamma_multiply(0.12)); + painter.rect_filled(r, CornerRadius::same(2), accent(painter).gamma_multiply(0.12)); let pts = [r.left_top(), r.right_top(), r.right_bottom(), r.left_bottom(), r.left_top()]; - painter.add(Shape::dashed_line(&pts, stroke(ACCENT, 1.5), 4.0, 3.0)); + painter.add(Shape::dashed_line(&pts, stroke(accent(painter), 1.5), 4.0, 3.0)); } // Vector edit mode, with the transform box around several selected points. // The selection's size label, which measurement labels keep clear of. @@ -1011,13 +1012,13 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ width_overlay(app, painter, &doc, &ve, zoom); } else if let Some(c) = app.session.vector_edit_box() { let label = format!("{} × {}", fmt((c[1] - c[0]).hypot()), fmt((c[3] - c[0]).hypot())); - size_label = transform_box(app, painter, c.map(|p| app.to_screen(p.x, p.y)), ACCENT, true, 4, label); + size_label = transform_box(app, painter, c.map(|p| app.to_screen(p.x, p.y)), accent(painter), true, 4, label); } } // Selection. let editing = ds.text_edit.clone(); if !sel.is_empty() && editing.is_none() && ds.vector_edit.is_none() { - let col = if sel.iter().any(|i| outline_colour(&doc, *i) == COMPONENT) { COMPONENT } else { ACCENT }; + let col = if sel.iter().any(|i| outline_colour(&doc, *i, accent(painter)) == COMPONENT) { COMPONENT } else { accent(painter) }; for id in &sel { draw_outline(app, painter, &doc, *id, stroke(col, 1.0)); } @@ -1086,12 +1087,12 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ { let layout = &text.layout; if let Some(q) = node_quad(app, edoc, te.id) { - quad(painter, q, stroke(ACCENT, 1.0)); + quad(painter, q, stroke(accent(painter), 1.0)); } let (a, b) = (te.caret.min(te.anchor), te.caret.max(te.anchor)); if a != b && preedit.is_none() { for q in text.selection(app, a, b) { - painter.add(Shape::convex_polygon(q.to_vec(), ACCENT.gamma_multiply(0.3), Stroke::NONE)); + painter.add(Shape::convex_polygon(q.to_vec(), accent(painter).gamma_multiply(0.3), Stroke::NONE)); } } if let Some(p) = preedit { @@ -1122,8 +1123,8 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ // Marquee. if let Some([x0, y0, x1, y1]) = ov.marquee.or(app.ui.key_box) { let r = Rect::from_two_pos(app.to_screen(x0, y0), app.to_screen(x1, y1)); - painter.rect_filled(r, CornerRadius::ZERO, ACCENT.gamma_multiply(0.1)); - painter.rect_stroke(r, CornerRadius::ZERO, stroke(ACCENT, 1.0), StrokeKind::Inside); + painter.rect_filled(r, CornerRadius::ZERO, accent(painter).gamma_multiply(0.1)); + painter.rect_stroke(r, CornerRadius::ZERO, stroke(accent(painter), 1.0), StrokeKind::Inside); } // Pen path. if !ov.pen.is_empty() { @@ -1138,7 +1139,7 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ } for p in &pts { painter.circle_filled(*p, 3.5, Color32::WHITE); - painter.circle_stroke(*p, 3.5, stroke(ACCENT, 1.0)); + painter.circle_stroke(*p, 3.5, stroke(accent(painter), 1.0)); } if let Some([x0, y0, x1, y1]) = ov.rubber { let (a, b) = (app.to_screen(x0, y0), app.to_screen(x1, y1)); @@ -1150,11 +1151,11 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ [a, h, b, b], false, Color32::TRANSPARENT, - stroke(ACCENT, 1.0), + stroke(accent(painter), 1.0), )); } None => { - painter.line_segment([a, b], stroke(ACCENT, 1.0)); + painter.line_segment([a, b], stroke(accent(painter), 1.0)); } } } @@ -1165,7 +1166,7 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ let c = app.to_screen(x, y); let rs = (r * app.session.ds().map(|d| d.view.zoom).unwrap_or(1.0)) as f32; painter.circle_stroke(c, rs, stroke(Color32::WHITE, 3.0)); - painter.circle_stroke(c, rs, stroke(ACCENT, 1.5)); + painter.circle_stroke(c, rs, stroke(accent(painter), 1.5)); } // Lasso (vector edit mode). if ov.lasso.len() > 1 { @@ -1173,7 +1174,7 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ if let Some(first) = pts.first().copied() { pts.push(first); } - painter.add(Shape::dashed_line(&pts, stroke(ACCENT, 1.0), 4.0, 3.0)); + painter.add(Shape::dashed_line(&pts, stroke(accent(painter), 1.0), 4.0, 3.0)); } // Guides (under the rulers). crate::guides::draw(app, painter); @@ -1207,7 +1208,7 @@ fn transform_box(app: &FigApp, painter: &egui::Painter, q: [Pos2; 4], col: Color fn pill(painter: &egui::Painter, at: Pos2, align: Align2, text: String, col: Color32) -> Rect { let galley = painter.layout_no_wrap(text, semibold(11.0), Color32::WHITE); let r = align.anchor_size(at, galley.size() + vec2(8.0, 4.0)); - painter.rect_filled(r, CornerRadius::same(3), col); + painter.rect_filled(r, CornerRadius::same(3), crate::theme::under_white(col)); painter.galley(r.min + vec2(4.0, 2.0), galley, Color32::WHITE); r } @@ -1264,7 +1265,7 @@ fn width_overlay(app: &FigApp, painter: &egui::Painter, doc: &Document, ve: &fig let sp = |p: &[f64; 2]| app.to_screen(p[0], p[1]); let draw = |h: &figcraft_engine::vectoredit::WidthHandle, ghost: bool| { let (c, a, b) = (sp(&h.at), sp(&h.sides[0]), sp(&h.sides[1])); - let col = if ghost { ACCENT.gamma_multiply(0.5) } else { ACCENT }; + let col = if ghost { accent(painter).gamma_multiply(0.5) } else { accent(painter) }; painter.line_segment([a, b], stroke(Color32::from_white_alpha(160), 3.0)); painter.line_segment([a, b], stroke(col, 1.0)); for (e, side) in [(a, WidthSide::Right), (b, WidthSide::Left)] { @@ -1276,7 +1277,7 @@ fn width_overlay(app: &FigApp, painter: &egui::Painter, doc: &Document, ve: &fig let on = !ghost && ve.width_point == Some(h.index); let hovered = !ghost && hover == Some(WHit::Point { index: h.index }); let r = if hovered { 5.0 } else { 4.0 }; - painter.circle_filled(c, r, if on { ACCENT } else { Color32::WHITE }); + painter.circle_filled(c, r, if on { accent(painter) } else { Color32::WHITE }); painter.circle_stroke(c, r, stroke(col, 1.0)); }; for h in width_handles(doc, ve, zoom) { @@ -1292,9 +1293,9 @@ fn width_overlay(app: &FigApp, painter: &egui::Painter, doc: &Document, ve: &fig /// A bezier handle from its anchor `v` to its end `e` (screen points): the line, and a dot of /// radius `r` filled with `fill` (vector edit mode and the Pen draw them alike). fn bezier_handle(painter: &egui::Painter, v: Pos2, e: Pos2, r: f32, fill: Color32) { - painter.line_segment([v, e], stroke(ACCENT, 1.0)); + painter.line_segment([v, e], stroke(accent(painter), 1.0)); painter.circle_filled(e, r, fill); - painter.circle_stroke(e, r, stroke(ACCENT, 1.0)); + painter.circle_stroke(e, r, stroke(accent(painter), 1.0)); } /// Vector edit mode: a layer's segments, handles and points (`points`) with its `hover`ed part, and @@ -1313,7 +1314,7 @@ fn vector_overlay( // Paint bucket target: hatched like a fill to come. if active && !ov.face.is_empty() { let polys: Vec> = ov.face.iter().map(|poly| poly.iter().map(sp).collect()).collect(); - hatched(painter, &polys, ACCENT); + hatched(painter, &polys, accent(painter)); } if active { region_hatch(app, painter); @@ -1331,7 +1332,7 @@ fn vector_overlay( } else { 1.5 }; - painter.add(egui::epaint::CubicBezierShape::from_points_stroke([a, b, c, d], false, Color32::TRANSPARENT, stroke(ACCENT, w))); + painter.add(egui::epaint::CubicBezierShape::from_points_stroke([a, b, c, d], false, Color32::TRANSPARENT, stroke(accent(painter), w))); } if !points { return; @@ -1339,7 +1340,7 @@ fn vector_overlay( for h in &o.handles { let hovered = hover == Some(VHit::Handle { seg: h.seg, start: h.start }); let on = o.selected_handles.contains(&(h.seg, h.start)); - bezier_handle(painter, sp(&h.vertex), sp(&h.handle), if hovered { 4.5 } else { 3.5 }, if on { ACCENT } else { Color32::WHITE }); + bezier_handle(painter, sp(&h.vertex), sp(&h.handle), if hovered { 4.5 } else { 3.5 }, if on { accent(painter) } else { Color32::WHITE }); } for (i, v) in o.vertices.iter().enumerate() { let p = sp(v); @@ -1347,14 +1348,14 @@ fn vector_overlay( let size = if hovered { 9.0 } else { 7.0 }; let r = Rect::from_center_size(p, vec2(size, size)); let on = o.selected_vertices.contains(&i); - painter.rect_filled(r, CornerRadius::same(5), if on { ACCENT } else { Color32::WHITE }); - painter.rect_stroke(r, CornerRadius::same(5), stroke(ACCENT, 1.0), StrokeKind::Inside); + painter.rect_filled(r, CornerRadius::same(5), if on { accent(painter) } else { Color32::WHITE }); + painter.rect_stroke(r, CornerRadius::same(5), stroke(accent(painter), 1.0), StrokeKind::Inside); if o.anchor == Some(i) { - painter.circle_stroke(p, 7.5, stroke(ACCENT, 1.0)); + painter.circle_stroke(p, 7.5, stroke(accent(painter), 1.0)); } } if let Some([x0, y0, x1, y1]) = ov.rubber.filter(|_| active) { - painter.add(Shape::dashed_line(&[app.to_screen(x0, y0), app.to_screen(x1, y1)], stroke(ACCENT, 1.0), 4.0, 3.0)); + painter.add(Shape::dashed_line(&[app.to_screen(x0, y0), app.to_screen(x1, y1)], stroke(accent(painter), 1.0), 4.0, 3.0)); } } @@ -1371,7 +1372,7 @@ fn region_hatch(app: &FigApp, painter: &egui::Painter) { let r = painter.clip_rect(); let clip = figcraft_geom::Rect::new(f64::from(r.min.x), f64::from(r.min.y), f64::from(r.max.x), f64::from(r.max.y)); for [a, b] in app.session.vector_region_hatch(view, Some(clip)) { - painter.line_segment([pos2(a.x as f32, a.y as f32), pos2(b.x as f32, b.y as f32)], stroke(ACCENT, REGION_HATCH_WIDTH)); + painter.line_segment([pos2(a.x as f32, a.y as f32), pos2(b.x as f32, b.y as f32)], stroke(accent(painter), REGION_HATCH_WIDTH)); } } @@ -1386,10 +1387,10 @@ fn builder_overlay(app: &FigApp, painter: &egui::Painter, t: &Tokens, arr: &figc for r in &arr.regions { for poly in screen(r) { painter.add(Shape::closed_line(poly.clone(), stroke(Color32::from_white_alpha(150), 2.5))); - painter.add(Shape::closed_line(poly, stroke(ACCENT, 1.0))); + painter.add(Shape::closed_line(poly, stroke(accent(painter), 1.0))); } } - let col = if ov.builder_remove { t.danger } else { ACCENT }; + let col = if ov.builder_remove { t.danger } else { accent(painter) }; for r in ov.builder_regions.iter().filter_map(|i| arr.regions.get(*i)) { hatched(painter, &screen(r), col); } @@ -1499,8 +1500,16 @@ fn rulers(app: &FigApp, painter: &egui::Painter, t: &Tokens, doc: &Document, sel // Highlight the selection's span. if let Some(b) = doc.bounds_of(sel) { let (a, bb) = (app.to_screen(b.x0, b.y0), app.to_screen(b.x1, b.y1)); - painter.rect_filled(Rect::from_min_max(pos2(a.x, r.min.y), pos2(bb.x, r.min.y + size)), CornerRadius::ZERO, ACCENT.gamma_multiply(0.15)); - painter.rect_filled(Rect::from_min_max(pos2(r.min.x, a.y), pos2(r.min.x + size, bb.y)), CornerRadius::ZERO, ACCENT.gamma_multiply(0.15)); + painter.rect_filled( + Rect::from_min_max(pos2(a.x, r.min.y), pos2(bb.x, r.min.y + size)), + CornerRadius::ZERO, + accent(painter).gamma_multiply(0.15), + ); + painter.rect_filled( + Rect::from_min_max(pos2(r.min.x, a.y), pos2(r.min.x + size, bb.y)), + CornerRadius::ZERO, + accent(painter).gamma_multiply(0.15), + ); } let mut x = (p0.x / step).floor() * step; while x <= p1.x { @@ -1528,3 +1537,8 @@ pub fn fmt(v: f64) -> String { #[cfg(test)] #[path = "zoom_preview_tests.rs"] mod zoom_preview_tests; + +/// The overlay green for the page this painter draws on ([`crate::theme::canvas_accent`]). +fn accent(p: &egui::Painter) -> Color32 { + crate::theme::canvas_accent(p.ctx()) +} diff --git a/crates/ui-egui/src/frame_labels.rs b/crates/ui-egui/src/frame_labels.rs index 79557141e..9e8b2e7ab 100644 --- a/crates/ui-egui/src/frame_labels.rs +++ b/crates/ui-egui/src/frame_labels.rs @@ -103,7 +103,7 @@ pub fn draw(app: &FigApp, painter: &Painter, t: &Tokens, doc: &Document, id: Nod let col = if is_comp { COMPONENT } else if selected || hovered { - ACCENT + crate::theme::canvas_accent(painter.ctx()) } else { t.text_secondary }; diff --git a/crates/ui-egui/src/handles.rs b/crates/ui-egui/src/handles.rs index ca38bee71..ec489bf82 100644 --- a/crates/ui-egui/src/handles.rs +++ b/crates/ui-egui/src/handles.rs @@ -11,7 +11,7 @@ use figcraft_geom::Point; use serde_json::json; use crate::colorpicker::PickerTarget; -use crate::theme::{ACCENT, semibold}; +use crate::theme::semibold; use crate::{FigApp, RightTab}; pub(crate) const PINK: Color32 = Color32::from_rgb(0xF2, 0x48, 0x8C); @@ -293,7 +293,12 @@ pub fn draw(app: &FigApp, painter: &egui::Painter) { painter.rect_filled(r, CornerRadius::same(2), crate::theme::doc_c32(painter.ctx(), s.color.with_alpha(1.0))); painter.rect_stroke(r, CornerRadius::same(2), Stroke::new(2.0, Color32::WHITE), StrokeKind::Outside); if i == selected { - painter.rect_stroke(r.expand(2.0), CornerRadius::same(3), Stroke::new(1.5, ACCENT), StrokeKind::Outside); + painter.rect_stroke( + r.expand(2.0), + CornerRadius::same(3), + Stroke::new(1.5, crate::theme::canvas_accent(painter.ctx())), + StrokeKind::Outside, + ); } } for (i, p) in [a, b, c].iter().enumerate() { @@ -301,7 +306,7 @@ pub fn draw(app: &FigApp, painter: &egui::Painter) { continue; } painter.circle_filled(*p, 5.0, Color32::WHITE); - painter.circle_stroke(*p, 5.0, Stroke::new(1.5, ACCENT)); + painter.circle_stroke(*p, 5.0, Stroke::new(1.5, crate::theme::canvas_accent(painter.ctx()))); } return; } @@ -311,8 +316,8 @@ pub fn draw(app: &FigApp, painter: &egui::Painter) { painter.line_segment([a, b], Stroke::new(1.0, Color32::from_black_alpha(120))); // The start is hollow (least blur), the end filled (most blur by default). painter.circle_filled(a, 5.0, Color32::WHITE); - painter.circle_stroke(a, 5.0, Stroke::new(1.5, ACCENT)); - painter.circle_filled(b, 5.0, ACCENT); + painter.circle_stroke(a, 5.0, Stroke::new(1.5, crate::theme::canvas_accent(painter.ctx()))); + painter.circle_filled(b, 5.0, crate::theme::canvas_accent(painter.ctx())); painter.circle_stroke(b, 5.0, Stroke::new(1.5, Color32::WHITE)); return; } @@ -320,11 +325,11 @@ pub fn draw(app: &FigApp, painter: &egui::Painter) { let Some(c) = crop_corners(app, id, r) else { return }; let outline = vec![c[0], c[1], c[2], c[3], c[0]]; painter.add(Shape::line(outline.clone(), Stroke::new(2.0, Color32::WHITE))); - painter.add(Shape::line(outline, Stroke::new(1.0, ACCENT))); + painter.add(Shape::line(outline, Stroke::new(1.0, crate::theme::canvas_accent(painter.ctx())))); for p in c { let hr = Rect::from_center_size(p, vec2(8.0, 8.0)); painter.rect_filled(hr, CornerRadius::ZERO, Color32::WHITE); - painter.rect_stroke(hr, CornerRadius::ZERO, Stroke::new(1.0, ACCENT), StrokeKind::Inside); + painter.rect_stroke(hr, CornerRadius::ZERO, Stroke::new(1.0, crate::theme::canvas_accent(painter.ctx())), StrokeKind::Inside); } return; } diff --git a/crates/ui-egui/src/proto_canvas.rs b/crates/ui-egui/src/proto_canvas.rs index 1187944df..97acdeb1d 100644 --- a/crates/ui-egui/src/proto_canvas.rs +++ b/crates/ui-egui/src/proto_canvas.rs @@ -8,7 +8,6 @@ use egui::{Color32, CornerRadius, Id, Pos2, Rect, Shape, Stroke, StrokeKind, pos use figcraft_doc::{Document, NodeId}; use serde_json::{Value, json}; -use crate::theme::ACCENT; use crate::{FigApp, RightTab}; const HANDLE_R: f32 = 7.0; @@ -140,7 +139,7 @@ fn arrow(painter: &egui::Painter, pts: &[Pos2; 4], col: Color32) { } fn plus_handle(painter: &egui::Painter, c: Pos2, hot: bool) { - painter.circle_filled(c, HANDLE_R + if hot { 1.0 } else { 0.0 }, ACCENT); + painter.circle_filled(c, HANDLE_R + if hot { 1.0 } else { 0.0 }, crate::theme::canvas_accent(painter.ctx())); painter.circle_stroke(c, HANDLE_R + if hot { 1.0 } else { 0.0 }, Stroke::new(1.5, Color32::WHITE)); painter.line_segment([c - vec2(3.5, 0.0), c + vec2(3.5, 0.0)], Stroke::new(1.5, Color32::WHITE)); painter.line_segment([c - vec2(0.0, 3.5), c + vec2(0.0, 3.5)], Stroke::new(1.5, Color32::WHITE)); @@ -161,7 +160,11 @@ pub fn draw(app: &FigApp, painter: &egui::Painter) { let selected = sel.contains(&nd.source); let is_open = open == Some((nd.source, nd.index)); let near = dragging.is_none() && hover.is_some_and(|q| bezier_distance(&nd.pts, q) < 5.0); - let col = if selected || is_open || near { ACCENT } else { ACCENT.gamma_multiply(0.55) }; + let col = if selected || is_open || near { + crate::theme::canvas_accent(painter.ctx()) + } else { + crate::theme::canvas_accent(painter.ctx()).gamma_multiply(0.55) + }; let w = if is_open || near { 2.5 } else if selected { @@ -177,7 +180,12 @@ pub fn draw(app: &FigApp, painter: &egui::Painter) { .and_then(|it| figcraft_doc::proto::walk(&it.actions).find_map(|a| a.dest())) && let Some(r) = screen_rect(app, doc, dest) { - painter.rect_stroke(r, CornerRadius::ZERO, Stroke::new(1.0, ACCENT.gamma_multiply(0.7)), StrokeKind::Outside); + painter.rect_stroke( + r, + CornerRadius::ZERO, + Stroke::new(1.0, crate::theme::canvas_accent(painter.ctx()).gamma_multiply(0.7)), + StrokeKind::Outside, + ); } painter.add(egui::epaint::CubicBezierShape::from_points_stroke(nd.pts, false, Color32::TRANSPARENT, Stroke::new(w, col))); painter.circle_filled(nd.pts[0], 3.5, col); @@ -190,12 +198,17 @@ pub fn draw(app: &FigApp, painter: &egui::Painter) { && doc.top_level_frame(d.source) != Some(f) && let Some(r) = screen_rect(app, doc, f) { - painter.rect_stroke(r, CornerRadius::ZERO, Stroke::new(2.0, ACCENT), StrokeKind::Outside); + painter.rect_stroke(r, CornerRadius::ZERO, Stroke::new(2.0, crate::theme::canvas_accent(painter.ctx())), StrokeKind::Outside); } let dx = ((d.pos.x - d.from.x).abs() * 0.5).max(30.0) * if d.pos.x >= d.from.x { 1.0 } else { -1.0 }; let pts = [d.from, d.from + vec2(dx, 0.0), d.pos - vec2(dx, 0.0), d.pos]; - painter.add(egui::epaint::CubicBezierShape::from_points_stroke(pts, false, Color32::TRANSPARENT, Stroke::new(2.0, ACCENT))); - arrow(painter, &pts, ACCENT); + painter.add(egui::epaint::CubicBezierShape::from_points_stroke( + pts, + false, + Color32::TRANSPARENT, + Stroke::new(2.0, crate::theme::canvas_accent(painter.ctx())), + )); + arrow(painter, &pts, crate::theme::canvas_accent(painter.ctx())); plus_handle(painter, d.from, true); } None => { diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rs index 01b9e7f59..d81e1380b 100644 --- a/crates/ui-egui/src/theme.rs +++ b/crates/ui-egui/src/theme.rs @@ -52,6 +52,27 @@ pub const BRAND: Color32 = Color32::from_rgb(0x02, 0xDA, 0x96); pub const ACCENT: Color32 = Color32::from_rgb(0x00, 0x87, 0x5F); /// Ink on the bright green brand surface (white would not have enough contrast). pub const ACCENT_ON: Color32 = Color32::from_rgb(0x07, 0x35, 0x2A); +/// Id of the canvas overlays' green for this frame ([`set_canvas_page`]). +const CANVAS_ACCENT: &str = "figcraft-canvas-accent"; + +/// Remember the page colour the canvas shows. Its overlays (outlines, handles, arrows) take +/// whichever green contrasts more with it: the bright one on a dark page, the darker on a light one. +pub fn set_canvas_page(ctx: &Context, page: Color32) { + let c = |x: Color32| figcraft_color::Color::new(f32::from(x.r()) / 255.0, f32::from(x.g()) / 255.0, f32::from(x.b()) / 255.0, 1.0); + let pick = if c(BRAND).contrast(c(page)) > c(ACCENT).contrast(c(page)) { BRAND } else { ACCENT }; + ctx.data_mut(|d| d.insert_temp(egui::Id::new(CANVAS_ACCENT), pick)); +} + +/// The green for overlays drawn on the page ([`set_canvas_page`]); [`ACCENT`] before a page shows. +pub fn canvas_accent(ctx: &Context) -> Color32 { + ctx.data(|d| d.get_temp(egui::Id::new(CANVAS_ACCENT))).unwrap_or(ACCENT) +} + +/// A fill under white text: the darker green stands in for the bright one. +pub fn under_white(c: Color32) -> Color32 { + if c == BRAND { ACCENT } else { c } +} + pub const COMPONENT: Color32 = Color32::from_rgb(0x97, 0x47, 0xFF); /// Handoff status badges (white text on these, in both themes). pub const DEV_READY: Color32 = Color32::from_rgb(0x08, 0x7D, 0x4F); @@ -426,6 +447,21 @@ pub fn doc_c32(ctx: &Context, c: figcraft_color::Color) -> Color32 { mod tests { use super::*; + #[test] + fn canvas_overlays_take_the_green_that_stands_out_on_the_page() { + let ctx = Context::default(); + assert_eq!(canvas_accent(&ctx), ACCENT, "before any page shows"); + set_canvas_page(&ctx, Color32::from_rgb(0x1E, 0x1E, 0x1E)); + assert_eq!(canvas_accent(&ctx), BRAND, "the bright green on a dark page"); + set_canvas_page(&ctx, Color32::WHITE); + assert_eq!(canvas_accent(&ctx), ACCENT, "the darker green on a light page"); + set_canvas_page(&ctx, Color32::from_rgb(0xF5, 0xF5, 0xF5)); + assert_eq!(canvas_accent(&ctx), ACCENT); + // White text never sits on the bright green. + assert_eq!(under_white(BRAND), ACCENT); + assert_eq!(under_white(COMPONENT), COMPONENT); + } + #[test] fn ui_font_draws_every_mac_shortcut_glyph() { figcraft_text::scan_system_fonts(); From a8fa1f0fb46a2f30b405d09d08de866a8792cbbc Mon Sep 17 00:00:00 2001 From: Al Rifat Sabbir <150162343+alrifatsabbir@users.noreply.github.com> Date: Tue, 20 Oct 2026 01:01:50 +0600 Subject: [PATCH 386/817] Add Al Rifat Sabbir to contributors list --- contributors/people.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contributors/people.toml b/contributors/people.toml index 0a4eceb12..dfa2f02fc 100644 --- a/contributors/people.toml +++ b/contributors/people.toml @@ -37,6 +37,11 @@ real_name = "Justin John" [people.Losminek] +[people.alrifatsabbir] +real_name = "Al Rifat Sabbir" +display_name = "Al Rifat Sabbir" +sync_github_name = true + [people.RevDonz] [people.Nael-Nathanael] From 7d0ecd2294e0bd1a4afe301cc2d116ea582c40b9 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Mon, 19 Oct 2026 19:17:28 +0000 Subject: [PATCH 387/817] Place files dropped together on the canvas side by side Fixes #886 Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/ui-egui/src/home_tests.rs | 27 +++++++++++++++++++++++++++ crates/ui-egui/src/pending_open.rs | 22 ++++++++++++++++++++-- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/home_tests.rs b/crates/ui-egui/src/home_tests.rs index 0606c2e5d..c74c35bff 100644 --- a/crates/ui-egui/src/home_tests.rs +++ b/crates/ui-egui/src/home_tests.rs @@ -699,6 +699,33 @@ fn dropping_a_native_file_on_canvas_keeps_its_receiving_document_after_tab_switc assert_eq!(u.app.session.docs.iter().map(|doc| doc.doc.pages.len()).collect::>(), [2, 1]); } +#[test] +fn dropping_several_files_on_canvas_places_them_side_by_side() { + let dir = Temp::new(); + let svg = r##""##; + let paths: Vec<_> = ["a.svg", "b.svg", "c.svg"].iter().map(|n| dir.path(n)).collect(); + for path in &paths { + std::fs::write(path, svg).unwrap(); + } + let mut u = Ui::new(Session::new()); + u.app.ui.home = false; + u.frame(vec![]); + let pos = u.app.canvas.rect.center(); + let files: Vec = paths.iter().map(|p| std::sync::Arc::new(Dropped(p.clone())) as egui::DroppedFileHandle).collect(); + u.frame_raw(egui::RawInput { events: vec![Event::PointerMoved(pos)], dropped_files: files, ..Default::default() }); + for _ in 0..4 { + u.frame(vec![]); + } + assert!(u.app.ui.pending_opens.is_empty()); + let doc = u.app.session.doc().unwrap(); + let page = u.app.session.page().unwrap(); + let rects: Vec<_> = doc.node(page).unwrap().children.iter().map(|c| doc.world_bounds(*c).unwrap()).collect(); + assert_eq!(rects.len(), 3); + for pair in rects.windows(2) { + assert!(pair[1].x0 > pair[0].x1, "left to right with a gap: {rects:?}"); + } +} + #[test] fn canvas_import_uses_queued_page_and_restores_the_page_selected_while_waiting() { let dir = Temp::new(); diff --git a/crates/ui-egui/src/pending_open.rs b/crates/ui-egui/src/pending_open.rs index 9575a1ea9..501367c0c 100644 --- a/crates/ui-egui/src/pending_open.rs +++ b/crates/ui-egui/src/pending_open.rs @@ -75,6 +75,9 @@ fn cancel(app: &mut FigApp, message: String) { app.show_error(message); } +/// Space between files dropped together on the canvas. +const IMPORT_GAP: f64 = 20.0; + /// Frames the card is drawn before the files open: egui lays a new card out invisibly on its first /// frame, so the second one is the first the window shows. const FRAMES_BEFORE_OPENING: u8 = 2; @@ -122,11 +125,26 @@ pub fn pending_opens(app: &mut FigApp, ctx: &egui::Context) { ctx.request_repaint(); if app.ui.pending_open_frames >= FRAMES_BEFORE_OPENING && !reading { app.ui.pending_open_frames = 0; - for pending in std::mem::take(&mut app.ui.pending_opens) { + // Files dropped together land side by side: each starts where the previous one ends. + let mut next_x: Option = None; + for mut pending in std::mem::take(&mut app.ui.pending_opens) { let command = pending.command; - if run_pending(app, pending).is_some() && command == "file.open" { + let canvas = command == "file.import" && pending.params.get("x").is_some(); + if canvas && let Some(x) = next_x { + pending.params["x"] = json!(x); + } + let page = pending.target.as_ref().map(|t| (t.uid, t.page)); + let result = run_pending(app, pending); + if result.is_some() && command == "file.open" { app.ui.home = false; } + if canvas { + let right = result.as_ref().and_then(|r| r.get("id")?.as_u64()).and_then(|id| { + let doc = &app.session.docs.iter().find(|d| Some(d.uid) == page.map(|p| p.0))?.doc; + doc.world_bounds(NodeId(id)).map(|b| b.x1) + }); + next_x = right.map(|r| r + IMPORT_GAP).or(next_x); + } } return; } From fbb4a22e01893b815073fc2917c0882058c655d2 Mon Sep 17 00:00:00 2001 From: Kushagra Kumar Date: Tue, 20 Oct 2026 01:12:13 +0530 Subject: [PATCH 388/817] fix(collab-net): allow live sessions above 64 MiB and report accurate transport limits (#857) - Configure server write loop in hub.rs with max_server_message so outgoing ServerMsg payloads above 64 MiB (e.g. document snapshots in Welcome messages) are delivered without socket termination. - Set core max_message_bytes in local live session HostConfig to max_server_message. - Map tungstenite Capacity errors in guest read loop to Outcome::Failed with accurate size limits rather than Outcome::Refused which falsely reported 'The host refused'. - Add loopback tests verifying Welcome delivery above client message limits and accurate diagnostics on client capacity overrun. --- crates/collab-net/src/guest.rs | 12 ++++- crates/collab-net/src/hub.rs | 20 ++++---- crates/collab-net/src/link.rs | 2 +- crates/collab-net/src/loopback_tests.rs | 66 +++++++++++++++++++++++++ 4 files changed, 89 insertions(+), 11 deletions(-) diff --git a/crates/collab-net/src/guest.rs b/crates/collab-net/src/guest.rs index eb899b8df..1cfd784cd 100644 --- a/crates/collab-net/src/guest.rs +++ b/crates/collab-net/src/guest.rs @@ -367,7 +367,17 @@ fn read_loop(mut ws: WebSocket, ctx: &ReaderCtx) { Ok(Message::Close(f)) => break f.map_or_else(|| closed(0, ""), |f| closed(f.code.into(), &f.reason)), Ok(Message::Text(_)) => break Outcome::Refused("the host sent a text message".into()), Ok(_) => {} - Err(tungstenite::Error::Capacity(_)) => break Outcome::Refused("the host sent a message over the size limit".into()), + Err(tungstenite::Error::Capacity(_)) => { + let max = ctx.cfg.limits.max_server_message; + let limit = if max >= 1 << 20 { + format!("{} MiB", max >> 20) + } else if max >= 1 << 10 { + format!("{} KiB", max >> 10) + } else { + format!("{max} bytes") + }; + break Outcome::Failed(format!("received message exceeded size limit (max {limit})")); + } Err(e) => break Outcome::Retry(e.to_string()), } }; diff --git a/crates/collab-net/src/hub.rs b/crates/collab-net/src/hub.rs index 5cf3e5191..8ddde6e26 100644 --- a/crates/collab-net/src/hub.rs +++ b/crates/collab-net/src/hub.rs @@ -860,7 +860,7 @@ fn serve(mut stream: TcpStream, conn: u64, hub: &Sender, limits: NetLimit let Ok(peer) = stream.peer_addr().map(|a| a.ip().to_canonical()) else { return }; let proxied = limits.trusted_proxy.is_some_and(|p| p.to_canonical() == peer); let Ok((rd, wr, sock)) = Duplex::split(stream, None) else { return }; - let cfg = config(limits.max_client_message); + let write_cfg = config(limits.max_server_message); let mut forwarded = None; // The handshake callback's type is tungstenite's (its error is an HTTP response). #[allow(clippy::result_large_err)] @@ -904,14 +904,16 @@ fn serve(mut stream: TcpStream, conn: u64, hub: &Sender, limits: NetLimit max_block: limits.max_queued_block, max_all: limits.max_queued_total, }; - let writer = - match sock.try_clone().map(|s| spawn("live-write", move || write_loop(WebSocket::from_raw_socket(wr, Role::Server, Some(cfg)), &rx, &s))) { - Ok(Ok(t)) => t, - _ => { - shutdown(&sock); - return; - } - }; + let writer = match sock + .try_clone() + .map(|s| spawn("live-write", move || write_loop(WebSocket::from_raw_socket(wr, Role::Server, Some(write_cfg)), &rx, &s))) + { + Ok(Ok(t)) => t, + _ => { + shutdown(&sock); + return; + } + }; let end = |why: Option<&str>| { if let Some(why) = why { refuse(&out, why); diff --git a/crates/collab-net/src/link.rs b/crates/collab-net/src/link.rs index a84395aa8..66d07477d 100644 --- a/crates/collab-net/src/link.rs +++ b/crates/collab-net/src/link.rs @@ -139,7 +139,7 @@ impl LiveLink for NetLink { doc, name: o.name, limits: self.limits, - core: figcraft_collab::Limits::default(), + core: figcraft_collab::Limits { max_message_bytes: self.limits.max_server_message, ..figcraft_collab::Limits::default() }, }; let host = Host::start(cfg, inbox.clone()).map_err(|e| format!("can't listen on {ip}: {e}"))?; let invite = Invite::new(host.addr().to_string(), file, token); diff --git a/crates/collab-net/src/loopback_tests.rs b/crates/collab-net/src/loopback_tests.rs index 32c86bd0c..9d86939cf 100644 --- a/crates/collab-net/src/loopback_tests.rs +++ b/crates/collab-net/src/loopback_tests.rs @@ -642,3 +642,69 @@ fn the_host_removes_someone_and_they_cant_come_back() { host.stop(); assert_eq!(host.connections(), 0); } + +#[test] +fn welcome_messages_larger_than_client_message_limit_are_delivered() { + let mut doc = Document::new("A".repeat(3000)); + doc.repair(); + let probe = Probe::new(); + let limits = NetLimits { max_client_message: 1024, max_server_message: 64 << 10, ..fast_limits() }; + let cfg = HostConfig { + addr: SocketAddr::from(([127, 0, 0, 1], 0)), + any_port_if_taken: false, + file: FILE.into(), + token: TOKEN.into(), + doc, + name: "Hana".into(), + limits, + core: Limits { max_message_bytes: 64 << 10, ..Limits::default() }, + }; + let mut host = Host::start(cfg, probe.inbox.clone()).unwrap(); + let invite = Invite::new(host.addr().to_string(), FILE, TOKEN); + + let guest_probe = Probe::new(); + let mut guest_cfg = quick(GuestConfig::new(invite, "Ada".into())); + guest_cfg.limits = limits; + let _g = Guest::start(guest_cfg, guest_probe.inbox.clone()).unwrap(); + let mut gp = guest_probe; + gp.wait("welcome", welcomed); + assert!(welcomed(&gp.events)); + host.stop(); +} + +#[test] +fn oversized_server_message_reports_accurate_diagnostic() { + let mut doc = Document::new("B".repeat(3000)); + doc.repair(); + let probe = Probe::new(); + let limits = NetLimits { max_server_message: 64 << 10, ..fast_limits() }; + let cfg = HostConfig { + addr: SocketAddr::from(([127, 0, 0, 1], 0)), + any_port_if_taken: false, + file: FILE.into(), + token: TOKEN.into(), + doc, + name: "Hana".into(), + limits, + core: Limits { max_message_bytes: 64 << 10, ..Limits::default() }, + }; + let mut host = Host::start(cfg, probe.inbox.clone()).unwrap(); + let invite = Invite::new(host.addr().to_string(), FILE, TOKEN); + + let guest_probe = Probe::new(); + let mut guest_cfg = quick(GuestConfig::new(invite, "Ada".into())); + guest_cfg.limits = NetLimits { max_server_message: 512, ..fast_limits() }; + let _g = Guest::start(guest_cfg, guest_probe.inbox.clone()).unwrap(); + let mut gp = guest_probe; + gp.wait("accurate failure diagnostic", |e| { + e.iter().any(|ev| { + matches!( + ev, + Event::Status(Status::Failed { reason }) + if !reason.contains("The host refused") && reason.contains("received message exceeded size limit (max 512 bytes)") + ) + }) + }); + assert!(!welcomed(&gp.events)); + host.stop(); +} From 227e182f6889e8f42f7527f0fb79731c7d95419c Mon Sep 17 00:00:00 2001 From: Kushagra Kumar Date: Tue, 20 Oct 2026 01:23:09 +0530 Subject: [PATCH 389/817] fix(collab-net): report exact bytes when server message limit is not a whole unit --- crates/collab-net/src/guest.rs | 4 ++-- crates/collab-net/src/loopback_tests.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/collab-net/src/guest.rs b/crates/collab-net/src/guest.rs index 1cfd784cd..7a986ea5c 100644 --- a/crates/collab-net/src/guest.rs +++ b/crates/collab-net/src/guest.rs @@ -369,9 +369,9 @@ fn read_loop(mut ws: WebSocket, ctx: &ReaderCtx) { Ok(_) => {} Err(tungstenite::Error::Capacity(_)) => { let max = ctx.cfg.limits.max_server_message; - let limit = if max >= 1 << 20 { + let limit = if max >= 1 << 20 && max.is_multiple_of(1 << 20) { format!("{} MiB", max >> 20) - } else if max >= 1 << 10 { + } else if max >= 1 << 10 && max.is_multiple_of(1 << 10) { format!("{} KiB", max >> 10) } else { format!("{max} bytes") diff --git a/crates/collab-net/src/loopback_tests.rs b/crates/collab-net/src/loopback_tests.rs index 9d86939cf..eebda6de4 100644 --- a/crates/collab-net/src/loopback_tests.rs +++ b/crates/collab-net/src/loopback_tests.rs @@ -693,7 +693,7 @@ fn oversized_server_message_reports_accurate_diagnostic() { let guest_probe = Probe::new(); let mut guest_cfg = quick(GuestConfig::new(invite, "Ada".into())); - guest_cfg.limits = NetLimits { max_server_message: 512, ..fast_limits() }; + guest_cfg.limits = NetLimits { max_server_message: 1536, ..fast_limits() }; let _g = Guest::start(guest_cfg, guest_probe.inbox.clone()).unwrap(); let mut gp = guest_probe; gp.wait("accurate failure diagnostic", |e| { @@ -701,7 +701,7 @@ fn oversized_server_message_reports_accurate_diagnostic() { matches!( ev, Event::Status(Status::Failed { reason }) - if !reason.contains("The host refused") && reason.contains("received message exceeded size limit (max 512 bytes)") + if !reason.contains("The host refused") && reason.contains("received message exceeded size limit (max 1536 bytes)") ) }) }); From e8a6033199c6fc6cbe12bccd580d58e63d2b6f2e Mon Sep 17 00:00:00 2001 From: Kushagra Kumar Date: Tue, 20 Oct 2026 01:33:32 +0530 Subject: [PATCH 390/817] test(collab-net): add ignored loopback test exercising welcome delivery above 64 MiB --- crates/collab-net/src/loopback_tests.rs | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/crates/collab-net/src/loopback_tests.rs b/crates/collab-net/src/loopback_tests.rs index eebda6de4..b59f767c3 100644 --- a/crates/collab-net/src/loopback_tests.rs +++ b/crates/collab-net/src/loopback_tests.rs @@ -708,3 +708,33 @@ fn oversized_server_message_reports_accurate_diagnostic() { assert!(!welcomed(&gp.events)); host.stop(); } + +#[test] +#[ignore = "allocates a document larger than 64 MiB: cargo test -p figcraft-collab-net -- --ignored"] +fn welcome_larger_than_64_mib_is_delivered() { + let mut doc = Document::new("A".repeat((64 << 20) + 4096)); + doc.repair(); + let probe = Probe::new(); + let limits = NetLimits { max_client_message: 1024, max_server_message: 128 << 20, ..fast_limits() }; + let cfg = HostConfig { + addr: SocketAddr::from(([127, 0, 0, 1], 0)), + any_port_if_taken: false, + file: FILE.into(), + token: TOKEN.into(), + doc, + name: "Hana".into(), + limits, + core: Limits { max_message_bytes: 128 << 20, ..Limits::default() }, + }; + let mut host = Host::start(cfg, probe.inbox.clone()).unwrap(); + let invite = Invite::new(host.addr().to_string(), FILE, TOKEN); + + let guest_probe = Probe::new(); + let mut guest_cfg = quick(GuestConfig::new(invite, "Ada".into())); + guest_cfg.limits = limits; + let _g = Guest::start(guest_cfg, guest_probe.inbox.clone()).unwrap(); + let mut gp = guest_probe; + gp.wait("welcome", welcomed); + assert!(welcomed(&gp.events)); + host.stop(); +} From 6369b6b7a5fa2c073e23cc67328bb48e8a7a92bd Mon Sep 17 00:00:00 2001 From: Kushagra Kumar Date: Tue, 20 Oct 2026 01:43:50 +0530 Subject: [PATCH 391/817] test(collab-net): exercise NetLink host in large welcome regression test --- crates/collab-net/src/loopback_tests.rs | 30 ------------------------- crates/collab-net/src/session_tests.rs | 16 +++++++++++++ 2 files changed, 16 insertions(+), 30 deletions(-) diff --git a/crates/collab-net/src/loopback_tests.rs b/crates/collab-net/src/loopback_tests.rs index b59f767c3..eebda6de4 100644 --- a/crates/collab-net/src/loopback_tests.rs +++ b/crates/collab-net/src/loopback_tests.rs @@ -708,33 +708,3 @@ fn oversized_server_message_reports_accurate_diagnostic() { assert!(!welcomed(&gp.events)); host.stop(); } - -#[test] -#[ignore = "allocates a document larger than 64 MiB: cargo test -p figcraft-collab-net -- --ignored"] -fn welcome_larger_than_64_mib_is_delivered() { - let mut doc = Document::new("A".repeat((64 << 20) + 4096)); - doc.repair(); - let probe = Probe::new(); - let limits = NetLimits { max_client_message: 1024, max_server_message: 128 << 20, ..fast_limits() }; - let cfg = HostConfig { - addr: SocketAddr::from(([127, 0, 0, 1], 0)), - any_port_if_taken: false, - file: FILE.into(), - token: TOKEN.into(), - doc, - name: "Hana".into(), - limits, - core: Limits { max_message_bytes: 128 << 20, ..Limits::default() }, - }; - let mut host = Host::start(cfg, probe.inbox.clone()).unwrap(); - let invite = Invite::new(host.addr().to_string(), FILE, TOKEN); - - let guest_probe = Probe::new(); - let mut guest_cfg = quick(GuestConfig::new(invite, "Ada".into())); - guest_cfg.limits = limits; - let _g = Guest::start(guest_cfg, guest_probe.inbox.clone()).unwrap(); - let mut gp = guest_probe; - gp.wait("welcome", welcomed); - assert!(welcomed(&gp.events)); - host.stop(); -} diff --git a/crates/collab-net/src/session_tests.rs b/crates/collab-net/src/session_tests.rs index 329201237..de60b211a 100644 --- a/crates/collab-net/src/session_tests.rs +++ b/crates/collab-net/src/session_tests.rs @@ -249,3 +249,19 @@ fn cursor_chat_and_spotlight_between_apps() { pump(&mut host, &mut guest, "the spotlight ending", |_, g| g.live().spotlight.is_none()); pump(&mut host, &mut late, "the spotlight ending for the late joiner", |_, l| l.live().spotlight.is_none() && l.live().follow.is_none()); } + +#[test] +#[ignore = "allocates a document larger than 64 MiB: cargo test -p figcraft-collab-net -- --ignored"] +fn welcome_larger_than_64_mib_is_delivered() { + let mut host = session("Hana"); + let mut guest = session("Ada"); + host.doc_mut().unwrap().name = "A".repeat((64 << 20) + 4096); + let r = host.execute("collab.host", &json!({"port": 0})).unwrap(); + assert_eq!(r["status"], "live"); + let link = r["link"].as_str().unwrap().to_string(); + let r = guest.execute("collab.join", &json!({"link": link})).unwrap(); + assert_eq!(r["status"], "connecting"); + pump(&mut host, &mut guest, "the large welcome", |h, g| g.live().status == Status::Live && h.live().peers.len() == 1); + assert_eq!(guest.doc().unwrap().name.len(), (64 << 20) + 4096); + host.execute("collab.stop", &json!({})).unwrap(); +} From 8d5a29dfda4817fb40a1d9338c233987ba45102f Mon Sep 17 00:00:00 2001 From: JimKnoxx Date: Sat, 17 Oct 2026 16:49:22 +0200 Subject: [PATCH 392/817] M5: one presentation tab per page of a file Main plays a presentation in a single "Present" tab. Now each page of a file gets its own tab, named "file - page", and the name follows renames. Play on a page that has a tab shows that tab as it was; from another start frame it starts again. A tab keeps its own copy of the prototype: it plays on after its file closes, and a saved file opened again gets its tabs back. A tab whose file is closed or not in front never reads or changes the file in front (device, responsive, comments). Escape or the tab's X closes that tab and goes back to its file, or Home. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/lib.rs | 26 +-- crates/ui-egui/src/present.rs | 38 +++- crates/ui-egui/src/present_tab_tests.rs | 146 ++++++++++++++++ crates/ui-egui/src/present_view_tests.rs | 4 +- crates/ui-egui/src/tabs.rs | 210 +++++++++++++++++------ docs/prototyping-parity.md | 4 +- 6 files changed, 352 insertions(+), 76 deletions(-) create mode 100644 crates/ui-egui/src/present_tab_tests.rs diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index fe766c369..4561e5a1a 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -181,6 +181,8 @@ mod popup_width_tests; #[cfg(test)] mod present_links_tests; #[cfg(test)] +mod present_tab_tests; +#[cfg(test)] mod present_tests; #[cfg(test)] mod present_view_tests; @@ -538,10 +540,10 @@ pub struct UiState { /// A message at the bottom of the window and how long it has been showing. pub toast: Option<(String, ToastClock)>, pub present: Option, - /// A presentation kept alive while its design tab or Home is in front. - pub paused_present: Option, - /// The file that owns the presentation tab. - pub present_uid: Option, + pub presents: Vec, + /// The tab shown last. It is on screen while `present` has a value. + pub present_active: Option, + pub present_next: u64, /// The full-window presenter's options (how it sizes the prototype), kept between /// presentations. pub present_view: present::PresentView, @@ -692,8 +694,9 @@ impl Default for UiState { icon_gallery: false, toast: None, present: None, - paused_present: None, - present_uid: None, + presents: Vec::new(), + present_active: None, + present_next: 1, present_view: present::PresentView::default(), preview: None, picker: None, @@ -1015,12 +1018,7 @@ impl FigApp { "dialog.colorProfile" => self.ui.color_profile = self.session.doc().ok().map(|d| d.color_profile), "present" => { if let Some(start) = r.data.get("start").and_then(figcraft_engine::params::id_of) { - let mut p = present::Presenter::new(start); - p.view = self.ui.present_view; - self.ui.present = Some(p); - self.ui.paused_present = None; - self.ui.present_uid = self.session.docs.get(self.session.active).map(|d| d.uid); - self.ui.home = false; + tabs::open_present(self, start); } } "present.options" => { @@ -1563,6 +1561,7 @@ impl FigApp { // The Inspect tab measures on hover without Alt. self.session.tool.redlines = self.ui.right_tab == RightTab::Inspect; self.end_pen_outside_design(); + tabs::relink_presents(self); tabs::tab_bar(self, ui); if self.ui.present.is_some() { // A close request can arrive while the presenter fills the window. Let its unsaved @@ -1749,7 +1748,7 @@ impl FigApp { "focus": {"region": self.ui.nav.region.id(), "keyboard": self.ui.nav.keyboard}, "reduceMotion": self.reduce_motion(), "presenting": self.ui.present.is_some(), - "presenter": self.ui.present.as_ref().or(self.ui.paused_present.as_ref()).map(present::Presenter::inspect), + "presenter": tabs::shown_or_paused(self).map(present::Presenter::inspect), "presentOptions": {"scale": self.ui.present_view.scale.id(), "deviceFrame": self.ui.present_view.device_frame, "comments": self.ui.present_view.comments, "hotspotHints": self.ui.present_view.hotspot_hints, "inspect": self.ui.present_view.inspect}, "preview": self.ui.preview.as_ref().map(|p| p.player.inspect()), "mainMenu": self.ui.main_menu, @@ -1803,6 +1802,7 @@ impl FigApp { state["uiScale"] = json!({"choice": self.session.prefs.ui_scale, "zoom": self.ui.ui_scale.zoom, "drawn": self.ui.ui_scale.drawn, "limited": self.ui.ui_scale.limited}); state["pendingOpens"] = json!(self.ui.pending_opens.len()); state["missingFonts"] = json!(self.ui.missing_fonts.as_ref().map(missing_fonts::Shown::inspect)); + state["presentTabs"] = tabs::present_tabs_inspect(self); state } } diff --git a/crates/ui-egui/src/present.rs b/crates/ui-egui/src/present.rs index 9c0f1608d..a579d376a 100644 --- a/crates/ui-egui/src/present.rs +++ b/crates/ui-egui/src/present.rs @@ -330,6 +330,10 @@ impl Presenter { true } + pub fn start(&self) -> NodeId { + self.start + } + pub fn new(start: NodeId) -> Self { Self { current: start, @@ -1642,12 +1646,26 @@ enum BarAction { Inspect, } +pub struct PresentTab { + pub id: u64, + /// Empty while the tab is on screen: then the player is in `app.ui.present`. + pub pres: Option, + pub doc_uid: u64, + pub path: Option, + pub page: NodeId, + pub file: String, + pub page_name: String, +} + /// The full-window presenter (while `app.ui.present` is set). Escape or Close ends it. pub fn show(app: &mut FigApp, ui: &mut Ui) { let ctx = ui.ctx().clone(); let now = ctx.input(|i| i.time); let Some(mut pres) = app.ui.present.take() else { return }; - if let Ok(ds) = app.session.ds() { + // A tab can play a file that is closed or not in front. Then it must not read or change + // the file in front. + let live = crate::tabs::present_owner_active(app); + if live && let Ok(ds) = app.session.ds() { pres.sync(&ds.doc, now); } poll_pads(app, &mut pres, &ctx); @@ -1684,7 +1702,8 @@ pub fn show(app: &mut FigApp, ui: &mut Ui) { Some(BarAction::Inspect) => pres.view.inspect = !pres.view.inspect, _ => {} } - if pres.view.comments + if live + && pres.view.comments && let Some((frame, place, clip)) = pres.shown { crate::comments::presenter(app, &ctx, frame, place, clip); @@ -1694,17 +1713,20 @@ pub fn show(app: &mut FigApp, ui: &mut Ui) { finish(app, &mut pres); // The options carry over to the next presentation. app.ui.present_view = pres.view; - if let Some(BarAction::Responsive(on)) = action { + if live && let Some(BarAction::Responsive(on)) = action { app.run("proto.settings", json!({"responsive": on})); } - if let Some(device) = picked_device { + if live && let Some(device) = picked_device { choose_device(app, &mut pres, &device); } - if action == Some(BarAction::Close) || ctx.input(|i| i.key_pressed(egui::Key::Escape)) { - app.ui.present_uid = None; - return; - } app.ui.present = Some(pres); + if action == Some(BarAction::Close) || ctx.input(|i| i.key_pressed(egui::Key::Escape)) { + if let Some(id) = app.ui.present_active { + crate::tabs::close_present(app, id); + } else { + app.ui.present = None; + } + } } /// Device choices in the presenter use the screen's real dimensions and reflow a copy of the diff --git a/crates/ui-egui/src/present_tab_tests.rs b/crates/ui-egui/src/present_tab_tests.rs new file mode 100644 index 000000000..58f3c9806 --- /dev/null +++ b/crates/ui-egui/src/present_tab_tests.rs @@ -0,0 +1,146 @@ +use egui::{Key, Pos2, pos2}; +use serde_json::{Value, json}; + +use crate::present_tests::{Ui, id, setup}; + +const FILE_TAB: Pos2 = pos2(100.0, 20.0); + +fn click(u: &mut Ui, at: Pos2) { + u.button(at, true); + u.button(at, false); + u.frame(vec![]); +} + +fn tabs(u: &Ui) -> Value { + u.app.inspect()["presentTabs"].clone() +} + +fn presenting(u: &Ui) -> bool { + u.app.inspect()["presenting"] == json!(true) +} + +/// The middle of presentation tab `k` and of its close button, after `files` file tabs named +/// "Untitled". +fn present_tab(u: &Ui, files: usize, k: usize) -> (Pos2, Pos2) { + let width = |chars: usize, lo: f32, hi: f32| (12.0 * 0.6 * chars as f32 + 64.0).clamp(lo, hi); + let mut x = 52.0 + files as f32 * width("Untitled".len(), 120.0, 220.0); + let names: Vec = tabs(u).as_array().unwrap().iter().map(|t| t["name"].as_str().unwrap().to_string()).collect(); + for n in names.iter().take(k) { + x += width(n.chars().count(), 140.0, 260.0); + } + let w = width(names[k].chars().count(), 140.0, 260.0); + (pos2(x + w / 2.0, 20.0), pos2(x + w - 16.0, 20.0)) +} + +#[test] +fn the_tab_is_named_after_the_file_and_page_and_its_x_closes_it() { + let (mut u, a, ..) = setup(); + u.run("proto.present", json!({"start": a})); + assert!(presenting(&u)); + assert_eq!(tabs(&u), json!([{"name": "Untitled - Page 1", "active": true}])); + click(&mut u, FILE_TAB); + assert!(!presenting(&u)); + assert_eq!(tabs(&u)[0]["active"], false); + let (tab, close) = present_tab(&u, 1, 0); + click(&mut u, tab); + assert!(presenting(&u)); + click(&mut u, close); + assert_eq!((presenting(&u), tabs(&u)), (false, json!([]))); + assert!(!u.app.ui.home, "back to its file"); +} + +#[test] +fn play_again_shows_the_tab_as_it_was_and_another_page_opens_a_new_one() { + let (mut u, a, b, _) = setup(); + u.run("proto.present", json!({"start": a})); + u.key(pos2(720.0, 470.0), Key::ArrowRight); + click(&mut u, FILE_TAB); + u.run("proto.present", json!({"start": a})); + assert_eq!(tabs(&u).as_array().unwrap().len(), 1, "same page: the same tab"); + assert_eq!(u.app.inspect()["presenter"]["current"], json!(b), "it shows the prototype as it was"); + u.run("proto.present", json!({"start": b})); + assert_eq!(tabs(&u).as_array().unwrap().len(), 1); + assert_eq!(u.app.inspect()["presenter"]["history"], json!([]), "another start frame starts again"); + + click(&mut u, FILE_TAB); + let page = id(&u.run("page.add", json!({"name": "Second"}))); + u.run("page.select", json!({"id": page})); + let c = id(&u.run("node.create", json!({"type": "frame", "name": "C", "x": 0, "y": 0, "width": 200, "height": 200}))); + u.run("proto.present", json!({"start": c})); + assert_eq!(tabs(&u), json!([{"name": "Untitled - Page 1", "active": false}, {"name": "Untitled - Second", "active": true}])); + let (first, _) = present_tab(&u, 1, 0); + click(&mut u, first); + assert_eq!(tabs(&u), json!([{"name": "Untitled - Page 1", "active": true}, {"name": "Untitled - Second", "active": false}])); + assert_eq!(u.app.inspect()["presenter"]["current"], json!(b)); +} + +#[test] +fn the_presentation_plays_on_when_its_file_closes() { + let (mut u, a, b, _) = setup(); + let hot = id(&u.run("node.create", json!({"type": "rectangle", "parent": a, "x": 0, "y": 0, "width": 393, "height": 80}))); + u.run("proto.interaction.add", json!({"id": hot, "dest": b})); + u.run("proto.present", json!({"start": a})); + click(&mut u, FILE_TAB); + u.run("file.close", json!({"index": 0, "force": true})); + assert_eq!(tabs(&u), json!([{"name": "Untitled - Page 1", "active": false}])); + let (tab, _) = present_tab(&u, 0, 0); + click(&mut u, tab); + assert!(presenting(&u)); + let spot = u.app.inspect()["presenter"]["hotspots"][0]["rect"].clone(); + let r: Vec = spot.as_array().unwrap().iter().map(|v| v.as_f64().unwrap() as f32).collect(); + click(&mut u, pos2((r[0] + r[2]) / 2.0, (r[1] + r[3]) / 2.0)); + u.frames(60, Vec::new); + assert_eq!(u.app.inspect()["presenter"]["current"], json!(b), "the prototype still plays"); + u.key(pos2(700.0, 500.0), Key::Escape); + assert_eq!(tabs(&u), json!([])); + assert!(u.app.ui.home, "no file to go back to: Home"); +} + +#[test] +fn a_tab_whose_file_closed_leaves_the_file_in_front_alone() { + let (mut u, a, ..) = setup(); + u.run("proto.present", json!({"start": a})); + click(&mut u, FILE_TAB); + u.run("file.new", json!({})); + u.run("file.close", json!({"index": 0, "force": true})); + let (tab, _) = present_tab(&u, 1, 0); + click(&mut u, tab); + u.frames(5, Vec::new); + assert!(presenting(&u)); + assert!(!crate::tabs::present_owner_active(&u.app)); + assert_eq!(u.app.inspect()["presenter"]["current"], json!(a), "it keeps playing its own copy"); + assert!(!u.app.session.ds().unwrap().is_dirty()); +} + +#[test] +fn a_saved_file_opened_again_gets_its_tab_back() { + let (mut u, a, ..) = setup(); + let dir = std::env::temp_dir().join(format!("figcraft-present-tab-{}", std::process::id())); + std::fs::create_dir_all(&dir).unwrap(); + let path = dir.join("Proto.figcraft").to_string_lossy().to_string(); + u.run("file.saveAs", json!({"path": path})); + u.run("proto.present", json!({"start": a})); + click(&mut u, FILE_TAB); + u.run("file.close", json!({"index": 0})); + u.run("file.open", json!({"path": path})); + u.run("proto.present", json!({"start": a})); + assert_eq!(tabs(&u), json!([{"name": "Untitled - Page 1", "active": true}])); + u.key(pos2(700.0, 500.0), Key::Escape); + assert!(!u.app.ui.home, "back to its file"); + assert_eq!(tabs(&u), json!([])); + let _ = std::fs::remove_dir_all(&dir); +} + +#[test] +fn renaming_the_file_or_the_page_renames_the_tab() { + let (mut u, a, ..) = setup(); + u.run("proto.present", json!({"start": a})); + click(&mut u, FILE_TAB); + u.run("file.rename", json!({"name": "Playground"})); + u.run("page.rename", json!({"name": "Calendar"})); + u.frame(vec![]); + assert_eq!(tabs(&u), json!([{"name": "Playground - Calendar", "active": false}])); + u.run("file.close", json!({"index": 0, "force": true})); + u.frame(vec![]); + assert_eq!(tabs(&u)[0]["name"], "Playground - Calendar", "the names stay when the file closes"); +} diff --git a/crates/ui-egui/src/present_view_tests.rs b/crates/ui-egui/src/present_view_tests.rs index 8fdd5eb05..42647dc09 100644 --- a/crates/ui-egui/src/present_view_tests.rs +++ b/crates/ui-egui/src/present_view_tests.rs @@ -106,14 +106,14 @@ fn presentation_tab_keeps_the_current_screen_when_returning_to_the_editor() { u.button(design_tab, true); u.button(design_tab, false); assert!(u.app.ui.present.is_none()); - assert_eq!(u.app.ui.paused_present.as_ref().map(|p| p.current), Some(b)); + assert_eq!(presenter(&u)["current"], json!(b)); let name_len = u.app.session.doc().unwrap().name.chars().count() as f32; let design_w = (12.0 * 0.6 * name_len + 64.0).clamp(120.0, 220.0); let preview_tab = pos2(8.0 + 44.0 + design_w + 40.0, 20.0); u.button(preview_tab, true); u.button(preview_tab, false); - assert!(u.app.ui.paused_present.is_none()); + assert!(u.app.ui.present.is_some()); assert_eq!(presenter(&u)["current"], json!(b)); } diff --git a/crates/ui-egui/src/tabs.rs b/crates/ui-egui/src/tabs.rs index c10edcfd8..94cfe19bb 100644 --- a/crates/ui-egui/src/tabs.rs +++ b/crates/ui-egui/src/tabs.rs @@ -3,11 +3,13 @@ //! window buttons; the window's edges resize it. use egui::{Align2, Color32, CornerRadius, Rect, Sense, Stroke, Ui, pos2, vec2}; +use figcraft_doc::NodeId; use serde_json::json; use crate::a11y::Tip; use crate::i18n::{tr, trf}; use crate::icons::{self, Icon}; +use crate::present::{PresentTab, Presenter}; use crate::theme::{Tokens, regular}; use crate::{FigApp, TitleBar}; @@ -113,9 +115,7 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { } icons::paint(ui.painter(), Rect::from_center_size(hr.center(), vec2(16.0, 16.0)), Icon::Home, t.icon); if hresp.clicked() { - if let Some(p) = app.ui.present.take() { - app.ui.paused_present = Some(p); - } + pause_present(app); app.ui.home = true; } x += 44.0; @@ -141,7 +141,7 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { }) .collect(); // Leave the new-tab button, theme toggle, window controls and a draggable gap free. - let present_w = if app.ui.present.is_some() || app.ui.paused_present.is_some() { 128.0 } else { 0.0 }; + let present_w: f32 = app.ui.presents.iter().map(present_tab_width).sum(); let available = (rect.max.x - buttons_w - 70.0 - x - 34.0 - present_w).max(0.0); let active_tab = document_tabs.iter().position(|&i| i == app.session.active); let layout = tab_layout(&preferred, available, active_tab); @@ -282,37 +282,18 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { }); x += OVERFLOW_WIDTH; } - // Presentations live in their own tab. Switching back to the design keeps the player + // Presentations live in their own tabs. Switching back to the design keeps the player // state (current screen, navigation history and scroll position) for the return trip. - if app.ui.present.is_some() || app.ui.paused_present.is_some() { - let w = 128.0; - let r = Rect::from_min_size(pos2(x, rect.min.y), vec2(w, HEIGHT)); - let body_r = Rect::from_min_max(r.min, pos2(r.max.x - 32.0, r.max.y)); - let close_r = Rect::from_min_max(body_r.right_top(), r.max); - let resp = ui.interact(body_r, ui.id().with("presentation_tab"), Sense::click()).tip(tr("Present")); - let close_resp = ui.interact(close_r, ui.id().with("presentation_close"), Sense::click()).tip(tr("Close preview")); - let active = app.ui.present.is_some(); - crate::a11y::tab(&resp, tr("Present"), active); - if active { - ui.painter().rect_filled(r, CornerRadius::ZERO, t.tab_active); - } else if resp.hovered() || close_resp.hovered() { - ui.painter().rect_filled(r, CornerRadius::ZERO, t.hover); + let mut to_present = None; + let mut close_present_tab = None; + for tab in &app.ui.presents { + let active = app.ui.present.is_some() && app.ui.present_active == Some(tab.id); + let (w, clicked, closed) = present_tab(ui, &t, tab, x, rect, active); + if clicked && !active { + to_present = Some(tab.id); } - icons::paint(ui.painter(), Rect::from_center_size(pos2(x + 19.0, r.center().y), vec2(14.0, 14.0)), Icon::Play, t.icon); - ui.painter().text(pos2(x + 34.0, r.center().y), Align2::LEFT_CENTER, tr("Present"), regular(12.0), t.text); - let cr = Rect::from_center_size(close_r.center(), vec2(18.0, 18.0)); - if resp.hovered() || close_resp.hovered() || active { - if close_resp.hovered() { - ui.painter().rect_filled(cr, CornerRadius::same(4), t.pressed); - } - icons::paint(ui.painter(), cr.shrink(4.0), Icon::Close, t.icon_secondary); - } - if close_resp.clicked() { - app.ui.present = None; - app.ui.paused_present = None; - app.ui.present_uid = None; - } else if resp.clicked() && !active { - resume_presentation(app); + if closed { + close_present_tab = Some(tab.id); } x += w; ui.painter().line_segment([pos2(x, rect.min.y + 10.0), pos2(x, rect.max.y - 10.0)], Stroke::new(1.0, t.border)); @@ -325,9 +306,7 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { } icons::paint(ui.painter(), nr.shrink(7.0), Icon::Plus, t.icon); if nresp.clicked() { - if let Some(p) = app.ui.present.take() { - app.ui.paused_present = Some(p); - } + pause_present(app); app.run("file.new", json!({})); app.ui.home = false; } @@ -355,12 +334,15 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { } } if let Some(i) = switch { - if let Some(p) = app.ui.present.take() { - app.ui.paused_present = Some(p); - } + pause_present(app); app.run("doc.switch", json!({"index": i})); app.ui.home = false; } + if let Some(id) = close_present_tab { + close_present(app, id); + } else if let Some(id) = to_present { + show_present(app, id); + } if let Some((i, at)) = detach { // Where the pointer let go, on the screen. let at = at.and_then(|p| ui.input(|inp| inp.viewport().inner_rect).map(|r| r.min + p.to_vec2() - vec2(60.0, HEIGHT / 2.0))); @@ -388,11 +370,6 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { } else { app.run("file.close", json!({"index": i})); } - if app.ui.present_uid.is_some_and(|uid| !app.session.docs.iter().any(|d| d.uid == uid)) { - app.ui.present = None; - app.ui.paused_present = None; - app.ui.present_uid = None; - } } if !opening.is_empty() { ui.ctx().request_repaint(); @@ -400,16 +377,145 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { }); } -fn resume_presentation(app: &mut FigApp) { - let Some(uid) = app.ui.present_uid else { return }; - let Some(index) = app.session.docs.iter().position(|d| d.uid == uid) else { - app.ui.paused_present = None; - app.ui.present_uid = None; +fn present_tab(ui: &mut Ui, t: &Tokens, tab: &PresentTab, x: f32, bar: Rect, active: bool) -> (f32, bool, bool) { + let label = present_tab_name(tab); + let w = present_tab_width(tab); + let r = Rect::from_min_size(pos2(x, bar.min.y), vec2(w, HEIGHT)); + let resp = ui.interact(r, ui.id().with(("presentation_tab", tab.id)), Sense::click()).tip(tr("Present")); + crate::a11y::tab(&resp, &label, active); + if active { + ui.painter().rect_filled(r, CornerRadius::ZERO, t.tab_active); + } else if resp.hovered() { + ui.painter().rect_filled(r, CornerRadius::ZERO, t.hover); + } + icons::paint(ui.painter(), Rect::from_center_size(pos2(x + 19.0, r.center().y), vec2(14.0, 14.0)), Icon::Play, t.icon); + crate::bidi::paint_name(ui.painter(), pos2(x + 34.0, r.center().y), &label, regular(12.0), t.text, w - 62.0); + let mut closed = false; + if resp.hovered() || active { + let cr = Rect::from_center_size(pos2(r.max.x - 16.0, r.center().y), vec2(18.0, 18.0)); + let cresp = ui.interact(cr, ui.id().with(("presentation_close", tab.id)), Sense::click()).tip(tr("Close preview")); + if cresp.hovered() { + ui.painter().rect_filled(cr, CornerRadius::same(4), t.pressed); + } + icons::paint(ui.painter(), cr.shrink(4.0), Icon::Close, t.icon_secondary); + closed = cresp.clicked(); + } + (w, resp.clicked() && !closed, closed || resp.middle_clicked()) +} + +fn present_tab_width(tab: &PresentTab) -> f32 { + (regular(12.0).size * 0.6 * present_tab_name(tab).chars().count() as f32 + 64.0).clamp(140.0, 260.0) +} + +fn present_tab_name(tab: &PresentTab) -> String { + if tab.page_name.is_empty() { tab.file.clone() } else { format!("{} - {}", tab.file, tab.page_name) } +} + +pub fn present_tabs_inspect(app: &FigApp) -> serde_json::Value { + let on_screen = |id| app.ui.present.is_some() && app.ui.present_active == Some(id); + app.ui.presents.iter().map(|t| json!({"name": present_tab_name(t), "active": on_screen(t.id)})).collect() +} + +pub fn shown_or_paused(app: &FigApp) -> Option<&Presenter> { + app.ui.present.as_ref().or_else(|| { + let id = app.ui.present_active?; + app.ui.presents.iter().find(|t| t.id == id)?.pres.as_ref() + }) +} + +fn owner(app: &FigApp, uid: u64) -> Option { + app.session.docs.iter().position(|d| d.uid == uid && app.shows(uid)) +} + +pub fn present_owner_active(app: &FigApp) -> bool { + let Some(tab) = app.ui.present_active.and_then(|id| app.ui.presents.iter().find(|t| t.id == id)) else { return true }; + owner(app, tab.doc_uid).is_some_and(|i| i == app.session.active) +} + +fn pause_present(app: &mut FigApp) { + let Some(p) = app.ui.present.take() else { return }; + let id = app.ui.present_active; + if let Some(t) = app.ui.presents.iter_mut().find(|t| Some(t.id) == id) { + t.pres = Some(p); + } +} + +pub fn open_present(app: &mut FigApp, start: NodeId) { + let Ok(ds) = app.session.ds() else { return }; + let (uid, path) = (ds.uid, ds.path.clone()); + let page = ds.doc.page_of(start).unwrap_or(ds.page); + let file = ds.doc.name.clone(); + let page_name = ds.doc.node(page).map(|n| n.name.clone()).unwrap_or_default(); + let mut pres = Presenter::new(start); + pres.view = app.ui.present_view; + let same = |t: &&PresentTab| t.page == page && (t.doc_uid == uid || (path.is_some() && t.path == path)); + if let Some(id) = app.ui.presents.iter().find(same).map(|t| t.id) { + show_present(app, id); + if app.ui.present.as_ref().is_some_and(|p| p.start() != start) { + app.ui.present = Some(pres); + } return; - }; - app.run("doc.switch", json!({"index": index})); + } + pause_present(app); + let id = app.ui.present_next; + app.ui.present_next += 1; + app.ui.presents.push(PresentTab { id, pres: None, doc_uid: uid, path, page, file, page_name }); + app.ui.present = Some(pres); + app.ui.present_active = Some(id); app.ui.home = false; - app.ui.present = app.ui.paused_present.take(); +} + +fn show_present(app: &mut FigApp, id: u64) { + app.ui.home = false; + if app.ui.present.is_some() && app.ui.present_active == Some(id) { + return; + } + pause_present(app); + let Some(tab) = app.ui.presents.iter_mut().find(|t| t.id == id) else { return }; + let Some(p) = tab.pres.take() else { return }; + let uid = tab.doc_uid; + if let Some(i) = owner(app, uid).filter(|i| *i != app.session.active) { + app.run("doc.switch", json!({"index": i})); + } + app.ui.present = Some(p); + app.ui.present_active = Some(id); +} + +pub fn close_present(app: &mut FigApp, id: u64) { + let Some(k) = app.ui.presents.iter().position(|t| t.id == id) else { return }; + let tab = app.ui.presents.remove(k); + if app.ui.present_active != Some(id) { + return; + } + app.ui.present_active = None; + if app.ui.present.take().is_none() { + return; + } + match owner(app, tab.doc_uid) { + Some(i) => { + if i != app.session.active { + app.run("doc.switch", json!({"index": i})); + } + app.ui.home = false; + } + None => app.ui.home = true, + } +} + +/// A file that opens again has a new uid. Find it by its path to give its tabs back. +pub fn relink_presents(app: &mut FigApp) { + let docs = &app.session.docs; + for t in &mut app.ui.presents { + let found = docs.iter().find(|d| d.uid == t.doc_uid).or_else(|| docs.iter().find(|d| t.path.is_some() && d.path == t.path)); + if let Some(d) = found { + t.doc_uid = d.uid; + t.path = d.path.clone(); + t.file = d.doc.name.clone(); + if let Some(n) = d.doc.node(t.page) { + t.page_name = n.name.clone(); + } + } + } } /// What the tab of document `uid` says about its live session: others get in (`true`: a session diff --git a/docs/prototyping-parity.md b/docs/prototyping-parity.md index e4cf8c7fd..c0a7c008e 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-10-17 · **Change:** minor (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-10-17 · **Change:** minor (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, @@ -54,6 +54,7 @@ case pins the current behaviour). | Open link | pass | always a new tab or browser window (opening in place would leave the prototype) | | 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` | +| 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` | | Expressions: a variable reads the mode where the interaction runs (a frame that chose a mode, else the page's); `name[Mode]` reads a given mode whatever is chosen; operators on numbers, text (`+` joins), booleans and comparisons | pass | `mode_lookups_read_a_given_mode_or_the_layers_current_one`, `proto_expr_mode_tests` | @@ -100,6 +101,7 @@ case pins the current behaviour). | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Presentation tabs: one per page of a file instead of a single "Present" tab, named "file - page" (renames follow); Play shows a page's tab as it was; tabs outlive their file and come back when a saved file opens again. Numbers unchanged. | | 2026-10-17 | minor | Community batch #753: a Present tab (#537): playback in its own tab that keeps its screen and history, a current-frame thumbnail, previous / next, device presets and scale; the frame reflows to the device's screen on the prototype's copy; phone and tablet content drags inside a fixed device as its overflow allows ("No scrolling" frames clip; iPad mini, MacBook Air and Desktop keep their bodies); the unsaved-changes question shows above the presentation. Checked in the app on Windows. Percentages and hours unchanged | | 2026-10-13 | minor | Prototyping, delays on mouse triggers and manual overlay offsets (M5): mouse enter, leave, down and up wait `delayMs` before their actions run (once while waiting; dropped when the screen or overlay they were on goes away; a pointer that leaves early doesn't cancel, the documentation is silent), and a manual overlay sits at `offset: [x, y]` from the top-left of the layer that opens it (without one, right below it, as before). Delay and X/Y fields in the interaction editor, the player on its own clock, REST import (`delay`, `overlayRelativePosition`), `.fig` import and export (the export's field for mouse delays is unchecked against other software). Numbers unchanged. | | 2026-10-12 | minor | Controller buttons on key/gamepad triggers (Controller menu, player polling on Windows and in the browser, REST import instead of skipping, control channel injection), widgets reacting to clicks in presented prototypes on the prototype's own copy, `proto.evaluate`; the mode lookup and set-variable-mode rules written as cases (they already held). Breadth 90% → 92%, ready unchanged at 74% (controllers on Windows and the browser only; no real prototype QA yet), 3–6 h → 2–5 h | From bbe691cb43f0739e60913214e87cac5609b82d96 Mon Sep 17 00:00:00 2001 From: JimKnoxx Date: Sun, 18 Oct 2026 10:47:35 +0200 Subject: [PATCH 393/817] M5: presentation tabs: test both owner guards, document the tab functions Review follow-up. The closed-owner test now picks a device and switches Responsive in the presenter and checks that the file in front keeps its prototype settings, so removing either `live` guard in present::show fails it. The present harness gets frame_output for the AccessKit tree. The new tab functions get doc comments. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/present.rs | 1 + crates/ui-egui/src/present_tab_tests.rs | 46 +++++++++++++++++++++++++ crates/ui-egui/src/present_tests.rs | 9 ++++- crates/ui-egui/src/tabs.rs | 13 +++++++ 4 files changed, 68 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/present.rs b/crates/ui-egui/src/present.rs index a579d376a..184e7a9f8 100644 --- a/crates/ui-egui/src/present.rs +++ b/crates/ui-egui/src/present.rs @@ -330,6 +330,7 @@ impl Presenter { true } + /// The frame the presentation started from (Restart goes back there). pub fn start(&self) -> NodeId { self.start } diff --git a/crates/ui-egui/src/present_tab_tests.rs b/crates/ui-egui/src/present_tab_tests.rs index 58f3c9806..610c2ab1c 100644 --- a/crates/ui-egui/src/present_tab_tests.rs +++ b/crates/ui-egui/src/present_tab_tests.rs @@ -1,4 +1,6 @@ +use egui::accesskit::{Node, Role}; use egui::{Key, Pos2, pos2}; +use figcraft_doc::proto::PrototypeSettings; use serde_json::{Value, json}; use crate::present_tests::{Ui, id, setup}; @@ -19,6 +21,41 @@ fn presenting(u: &Ui) -> bool { u.app.inspect()["presenting"] == json!(true) } +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 centre(n: &Node) -> Pos2 { + let b = n.bounds().unwrap(); + pos2(((b.x0 + b.x1) / 2.0) as f32, ((b.y0 + b.y1) / 2.0) as f32) +} + +fn click_label(u: &mut Ui, label: &str) { + let all = nodes(u); + let n = all.iter().find(|n| n.label().is_some_and(|l| l.trim() == label)).unwrap_or_else(|| panic!("no {label:?} on screen")); + click(u, centre(n)); +} + +/// The presenter bar's Options button: it has no label, and sits right of Show comments. +fn open_options(u: &mut Ui) { + let all = nodes(u); + let comments = all.iter().find(|n| n.label() == Some("Show comments (Shift+C)")).unwrap().bounds().unwrap(); + let options = all + .iter() + .filter(|n| n.role() == Role::Unknown && n.label().is_none()) + .filter(|n| n.bounds().is_some_and(|b| b.y0 == comments.y0 && b.x0 > comments.x1)) + .min_by(|a, b| a.bounds().unwrap().x0.total_cmp(&b.bounds().unwrap().x0)) + .expect("the Options button"); + click(u, centre(options)); +} + +fn front_settings(u: &Ui) -> PrototypeSettings { + let page = u.app.session.page().unwrap(); + crate::present::page_settings(u.app.session.doc().unwrap(), page) +} + /// The middle of presentation tab `k` and of its close button, after `files` file tabs named /// "Untitled". fn present_tab(u: &Ui, files: usize, k: usize) -> (Pos2, Pos2) { @@ -109,6 +146,15 @@ fn a_tab_whose_file_closed_leaves_the_file_in_front_alone() { assert!(presenting(&u)); assert!(!crate::tabs::present_owner_active(&u.app)); assert_eq!(u.app.inspect()["presenter"]["current"], json!(a), "it keeps playing its own copy"); + let before = front_settings(&u); + click_label(&mut u, "iPhone 16"); + click_label(&mut u, "iPhone 17 402×874"); + assert!(presenting(&u)); + for size in ["Fixed size", "Responsive"] { + open_options(&mut u); + click_label(&mut u, size); + } + assert_eq!(front_settings(&u), before, "picking a device or Responsive leaves the file in front alone"); assert!(!u.app.session.ds().unwrap().is_dirty()); } diff --git a/crates/ui-egui/src/present_tests.rs b/crates/ui-egui/src/present_tests.rs index a1e4ebe23..c1a28cd45 100644 --- a/crates/ui-egui/src/present_tests.rs +++ b/crates/ui-egui/src/present_tests.rs @@ -23,11 +23,18 @@ impl Ui { } pub(crate) fn frame(&mut self, events: Vec) { + self.frame_output(events); + } + + /// [`Self::frame`], returning what egui output (the AccessKit tree when it's enabled). + pub(crate) fn frame_output(&mut self, events: Vec) -> egui::FullOutput { self.time += 1.0 / 60.0; let input = RawInput { screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(1440.0, 900.0))), time: Some(self.time), events, ..Default::default() }; let app = &mut self.app; - self.ctx.run_ui(input, |ui| app.ui(ui)).textures_delta.clear(); + let mut out = self.ctx.run_ui(input, |ui| app.ui(ui)); + out.textures_delta.clear(); + out } pub(crate) fn frames(&mut self, n: usize, events: impl Fn() -> Vec) { diff --git a/crates/ui-egui/src/tabs.rs b/crates/ui-egui/src/tabs.rs index 94cfe19bb..ed1f692d5 100644 --- a/crates/ui-egui/src/tabs.rs +++ b/crates/ui-egui/src/tabs.rs @@ -377,6 +377,8 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { }); } +/// One presentation tab at `x`: its width, whether it was clicked and whether it was closed (its +/// X or a middle click). fn present_tab(ui: &mut Ui, t: &Tokens, tab: &PresentTab, x: f32, bar: Rect, active: bool) -> (f32, bool, bool) { let label = present_tab_name(tab); let w = present_tab_width(tab); @@ -407,15 +409,18 @@ fn present_tab_width(tab: &PresentTab) -> f32 { (regular(12.0).size * 0.6 * present_tab_name(tab).chars().count() as f32 + 64.0).clamp(140.0, 260.0) } +/// "file - page", or the file alone when the page has no name. fn present_tab_name(tab: &PresentTab) -> String { if tab.page_name.is_empty() { tab.file.clone() } else { format!("{} - {}", tab.file, tab.page_name) } } +/// The presentation tabs for `ui.inspect`: each one's name and whether it is on screen. pub fn present_tabs_inspect(app: &FigApp) -> serde_json::Value { let on_screen = |id| app.ui.present.is_some() && app.ui.present_active == Some(id); app.ui.presents.iter().map(|t| json!({"name": present_tab_name(t), "active": on_screen(t.id)})).collect() } +/// The presenter on screen, else the paused one of the active presentation tab. pub fn shown_or_paused(app: &FigApp) -> Option<&Presenter> { app.ui.present.as_ref().or_else(|| { let id = app.ui.present_active?; @@ -423,15 +428,19 @@ pub fn shown_or_paused(app: &FigApp) -> Option<&Presenter> { }) } +/// The index of the open file with `uid`, when a file tab shows it. fn owner(app: &FigApp, uid: u64) -> Option { app.session.docs.iter().position(|d| d.uid == uid && app.shows(uid)) } +/// The presentation on screen plays the file in front (or no tab holds it). Only then may it read +/// and change that file. pub fn present_owner_active(app: &FigApp) -> bool { let Some(tab) = app.ui.present_active.and_then(|id| app.ui.presents.iter().find(|t| t.id == id)) else { return true }; owner(app, tab.doc_uid).is_some_and(|i| i == app.session.active) } +/// Puts the presenter on screen back into its tab, where it keeps its state. fn pause_present(app: &mut FigApp) { let Some(p) = app.ui.present.take() else { return }; let id = app.ui.present_active; @@ -440,6 +449,8 @@ fn pause_present(app: &mut FigApp) { } } +/// Presents from `start`: the tab of its page in this file shows again (from `start` when that +/// changed), else a new tab opens. pub fn open_present(app: &mut FigApp, start: NodeId) { let Ok(ds) = app.session.ds() else { return }; let (uid, path) = (ds.uid, ds.path.clone()); @@ -465,6 +476,7 @@ pub fn open_present(app: &mut FigApp, start: NodeId) { app.ui.home = false; } +/// Brings tab `id` to the front and its file too, when that file is open. fn show_present(app: &mut FigApp, id: u64) { app.ui.home = false; if app.ui.present.is_some() && app.ui.present_active == Some(id) { @@ -481,6 +493,7 @@ fn show_present(app: &mut FigApp, id: u64) { app.ui.present_active = Some(id); } +/// Closes tab `id`. If it was on screen, its file comes to the front, or Home when it is closed. pub fn close_present(app: &mut FigApp, id: u64) { let Some(k) = app.ui.presents.iter().position(|t| t.id == id) else { return }; let tab = app.ui.presents.remove(k); From 4a73289a91f3f8b9b88c018d8f7837087188fd23 Mon Sep 17 00:00:00 2001 From: JimKnoxx Date: Mon, 19 Oct 2026 22:34:27 +0200 Subject: [PATCH 394/817] M5: presentation tabs: keep them off the window controls, close X on every frame Presentation tabs now take at most half the free strip while file tabs share it. They shrink to the minimum tab width first, then the rest go into an overflow menu, so they never reach the new-tab button, theme toggle or window buttons. The close X has its own hit rect next to the tab body and is registered every frame, so a click on it can no longer select the tab instead. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/locales/cs.toml | 1 + crates/ui-egui/locales/de.toml | 1 + crates/ui-egui/locales/en.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/ja.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/tr.toml | 1 + crates/ui-egui/locales/zh-Hans.toml | 1 + crates/ui-egui/src/tabs.rs | 89 ++++++++++++++++++++++------- 17 files changed, 84 insertions(+), 21 deletions(-) diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml index eea0e8dcb..4a4eda3c6 100644 --- a/crates/ui-egui/locales/cs.toml +++ b/crates/ui-egui/locales/cs.toml @@ -898,6 +898,7 @@ status = "draft — needs native review" "Open branch" = "Otevřít větev" "Open file" = "Otevřít soubor" "Open files" = "Otevřít soubory" +"Open presentations" = "Otevřené prezentace" "Open in focus view" = "Otevřít v zaměřeném pohledu" "Open in new window" = "Otevřít v novém okně" "Open invite links in FigCraft" = "Otevírat odkazy s pozvánkou v aplikaci FigCraft" diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index f61464b8f..e752b70ab 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -866,6 +866,7 @@ status = "draft — needs native review" "Open branch" = "Branch öffnen" "Open file" = "Datei öffnen" "Open files" = "Geöffnete Dateien" +"Open presentations" = "Geöffnete Präsentationen" "Open in focus view" = "In Fokusansicht öffnen" "Open in new window" = "In neuem Fenster öffnen" "Open invite links in FigCraft" = "Einladungslinks in FigCraft öffnen" diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index ccf833bea..0d849918e 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -920,6 +920,7 @@ name = "English" "Open branch" = "Open branch" "Open file" = "Open file" "Open files" = "Open files" +"Open presentations" = "Open presentations" "Open in focus view" = "Open in focus view" "Open in new window" = "Open in new window" "Open invite links in FigCraft" = "Open invite links in FigCraft" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 1187c658f..598a152c8 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -921,6 +921,7 @@ status = "draft — needs native review" "Open branch" = "Abrir rama" "Open file" = "Abrir archivo" "Open files" = "Archivos abiertos" +"Open presentations" = "Presentaciones abiertas" "Open in focus view" = "Abrir en vista de enfoque" "Open in new window" = "Abrir en una ventana nueva" "Open invite links in FigCraft" = "Abrir enlaces de invitación en FigCraft" diff --git a/crates/ui-egui/locales/fi.toml b/crates/ui-egui/locales/fi.toml index 205a9d294..5ff69193d 100644 --- a/crates/ui-egui/locales/fi.toml +++ b/crates/ui-egui/locales/fi.toml @@ -918,6 +918,7 @@ status = "draft — needs native review" "Open branch" = "Avaa haara" "Open file" = "Avaa tiedosto" "Open files" = "Avaa tiedostoja" +"Open presentations" = "Avoimet esitykset" "Open in focus view" = "Avaa kohdistusnäkymässä" "Open in new window" = "Avaa uudessa ikkunassa" "Open invite links in FigCraft" = "Avaa kutsulinkit FigCraftissa" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index b038b3356..4445c2487 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -914,6 +914,7 @@ status = "draft — needs native review" "Open branch" = "Ouvrir la branche" "Open file" = "Ouvrir un fichier" "Open files" = "Fichiers ouverts" +"Open presentations" = "Présentations ouvertes" "Open in focus view" = "Ouvrir en vue ciblée" "Open in new window" = "Ouvrir dans une nouvelle fenêtre" "Open invite links in FigCraft" = "Ouvrir les liens d’invitation dans FigCraft" diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml index f21e1ca3c..d6e8b84af 100644 --- a/crates/ui-egui/locales/id.toml +++ b/crates/ui-egui/locales/id.toml @@ -902,6 +902,7 @@ status = "draft — needs native review" "Open branch" = "Buka branch" "Open file" = "Buka file" "Open files" = "Buka file" +"Open presentations" = "Presentasi yang terbuka" "Open in focus view" = "Buka di tampilan fokus" "Open in new window" = "Buka di jendela baru" "Open invite links in FigCraft" = "Buka link undangan di FigCraft" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index c42790f35..d38885485 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -907,6 +907,7 @@ status = "draft — needs native review" "Open branch" = "ブランチを開く" "Open file" = "ファイルを開く" "Open files" = "開いているファイル" +"Open presentations" = "開いているプレゼンテーション" "Open in focus view" = "フォーカスビューで開く" "Open in new window" = "新しいウィンドウで開く" "Open invite links in FigCraft" = "招待リンクを FigCraft で開く" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index b33b36b95..af8d9364f 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -862,6 +862,7 @@ status = "draft — needs native review" "Open branch" = "브랜치 열기" "Open file" = "파일 열기" "Open files" = "열린 파일" +"Open presentations" = "열린 프레젠테이션" "Open in focus view" = "포커스 보기로 열기" "Open in new window" = "새 창에서 열기" "Open invite links in FigCraft" = "초대 링크를 FigCraft에서 열기" diff --git a/crates/ui-egui/locales/nl.toml b/crates/ui-egui/locales/nl.toml index 54851043f..75cc2a24e 100644 --- a/crates/ui-egui/locales/nl.toml +++ b/crates/ui-egui/locales/nl.toml @@ -918,6 +918,7 @@ status = "draft — needs native review" "Open branch" = "Branch openen" "Open file" = "Bestand openen" "Open files" = "Geopende bestanden" +"Open presentations" = "Geopende presentaties" "Open in focus view" = "Openen in focusweergave" "Open in new window" = "Openen in een nieuw venster" "Open invite links in FigCraft" = "Uitnodigingslinks openen in FigCraft" diff --git a/crates/ui-egui/locales/pl.toml b/crates/ui-egui/locales/pl.toml index 23f7dee8e..8051ee934 100644 --- a/crates/ui-egui/locales/pl.toml +++ b/crates/ui-egui/locales/pl.toml @@ -915,6 +915,7 @@ status = "draft — needs native review" "Open branch" = "Otwórz gałąź" "Open file" = "Otwórz plik" "Open files" = "Otwórz pliki" +"Open presentations" = "Otwarte prezentacje" "Open in focus view" = "Otwórz w widoku skupienia" "Open in new window" = "Otwórz w nowym oknie" "Open invite links in FigCraft" = "Otwieraj linki z zaproszeniem w FigCraft" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index b41d827a9..d26f79264 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -861,6 +861,7 @@ status = "draft — needs native review" "Open branch" = "Abrir branch" "Open file" = "Abrir arquivo" "Open files" = "Arquivos abertos" +"Open presentations" = "Apresentações abertas" "Open in focus view" = "Abrir na visualização em foco" "Open in new window" = "Abrir em nova janela" "Open invite links in FigCraft" = "Abrir links de convite no FigCraft" diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 6dd68a170..2f9f5773f 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -901,6 +901,7 @@ name = "Русский" "Open branch" = "Открыть ветку" "Open file" = "Открыть файл" "Open files" = "Открыть файлы" +"Open presentations" = "Открытые презентации" "Open in focus view" = "Открыть в режиме фокуса" "Open in new window" = "Открыть в новом окне" "Open invite links in FigCraft" = "Открывать ссылки приглашения в FigCraft" diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index d86779e02..076023112 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -909,6 +909,7 @@ name = "Svenska" "Open branch" = "Öppna gren" "Open file" = "Öppna fil" "Open files" = "Öppna filer" +"Open presentations" = "Öppna presentationer" "Open in focus view" = "Öppna i fokusvy" "Open in new window" = "Öppna i nytt fönster" "Open invite links in FigCraft" = "Öppna inbjudningslänkar i FigCraft" diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml index bd8bb7c9d..fe45eaee2 100644 --- a/crates/ui-egui/locales/tr.toml +++ b/crates/ui-egui/locales/tr.toml @@ -902,6 +902,7 @@ name = "Türkçe" "Open branch" = "Dalı aç" "Open file" = "Dosya aç" "Open files" = "Dosyaları aç" +"Open presentations" = "Açık sunumlar" "Open in focus view" = "Odak görünümünde aç" "Open in new window" = "Yeni pencerede aç" "Open invite links in FigCraft" = "Davet bağlantılarını FigCraft'ta aç" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index 94c919425..dd5f0d00a 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -863,6 +863,7 @@ status = "draft — needs native review" "Open branch" = "打开分支" "Open file" = "打开文件" "Open files" = "打开的文件" +"Open presentations" = "打开的演示" "Open in focus view" = "在聚焦视图中打开" "Open in new window" = "在新窗口中打开" "Open invite links in FigCraft" = "在 FigCraft 中打开邀请链接" diff --git a/crates/ui-egui/src/tabs.rs b/crates/ui-egui/src/tabs.rs index ed1f692d5..adb1d08dd 100644 --- a/crates/ui-egui/src/tabs.rs +++ b/crates/ui-egui/src/tabs.rs @@ -141,8 +141,13 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { }) .collect(); // Leave the new-tab button, theme toggle, window controls and a draggable gap free. - let present_w: f32 = app.ui.presents.iter().map(present_tab_width).sum(); - let available = (rect.max.x - buttons_w - 70.0 - x - 34.0 - present_w).max(0.0); + let room = (rect.max.x - buttons_w - 70.0 - x - 34.0).max(0.0); + let present_pref: Vec = app.ui.presents.iter().map(present_tab_width).collect(); + let present_on = app.ui.present.as_ref().and(app.ui.present_active); + let active_present = present_on.and_then(|id| app.ui.presents.iter().position(|p| p.id == id)); + let present_layout = tab_layout(&present_pref, present_room(room, &present_pref, !document_tabs.is_empty()), active_present); + let present_used = present_layout.widths.iter().sum::() + if present_layout.overflow { OVERFLOW_WIDTH } else { 0.0 }; + let available = (room - present_used).max(0.0); let active_tab = document_tabs.iter().position(|&i| i == app.session.active); let layout = tab_layout(&preferred, available, active_tab); let mut tab_rects = Vec::with_capacity(layout.widths.len()); @@ -286,9 +291,9 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { // state (current screen, navigation history and scroll position) for the return trip. let mut to_present = None; let mut close_present_tab = None; - for tab in &app.ui.presents { - let active = app.ui.present.is_some() && app.ui.present_active == Some(tab.id); - let (w, clicked, closed) = present_tab(ui, &t, tab, x, rect, active); + for (tab, &w) in app.ui.presents.iter().skip(present_layout.first).zip(&present_layout.widths) { + let active = present_on == Some(tab.id); + let (clicked, closed) = present_tab(ui, &t, tab, Rect::from_min_size(pos2(x, rect.min.y), vec2(w, HEIGHT)), active); if clicked && !active { to_present = Some(tab.id); } @@ -298,6 +303,29 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { x += w; ui.painter().line_segment([pos2(x, rect.min.y + 10.0), pos2(x, rect.max.y - 10.0)], Stroke::new(1.0, t.border)); } + if present_layout.overflow { + let r = Rect::from_min_size(pos2(x, rect.min.y), vec2(OVERFLOW_WIDTH, HEIGHT)); + let resp = ui.interact(r, ui.id().with("present_overflow"), Sense::click()).tip(tr("Open presentations")); + crate::a11y::menu_button(&resp, tr("Open presentations"), crate::a11y::menu_open(&resp)); + if resp.hovered() { + ui.painter().rect_filled(r, CornerRadius::ZERO, t.hover); + } + icons::paint(ui.painter(), Rect::from_center_size(r.center(), vec2(14.0, 14.0)), Icon::Chevron, t.icon); + crate::right::menu_popup(&resp).show(|ui| { + egui::ScrollArea::vertical().max_height(400.0).show(ui, |ui| { + for tab in &app.ui.presents { + let on = present_on == Some(tab.id); + if crate::right::menu_check(ui, on, &present_tab_name(tab), "") { + if !on { + to_present = Some(tab.id); + } + ui.close(); + } + } + }); + }); + x += OVERFLOW_WIDTH; + } // New tab. let nr = Rect::from_center_size(pos2(x + 20.0, rect.center().y), vec2(28.0, 28.0)); let nresp = ui.interact(nr, ui.id().with("newtab"), Sense::click()).tip(crate::shortcuts::tip(tr("New design file"), "file.new")); @@ -377,32 +405,38 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) { }); } -/// One presentation tab at `x`: its width, whether it was clicked and whether it was closed (its -/// X or a middle click). -fn present_tab(ui: &mut Ui, t: &Tokens, tab: &PresentTab, x: f32, bar: Rect, active: bool) -> (f32, bool, bool) { +/// One presentation tab in `r`: whether it was clicked and whether it was closed (its X or a +/// middle click). +fn present_tab(ui: &mut Ui, t: &Tokens, tab: &PresentTab, r: Rect, active: bool) -> (bool, bool) { let label = present_tab_name(tab); - let w = present_tab_width(tab); - let r = Rect::from_min_size(pos2(x, bar.min.y), vec2(w, HEIGHT)); - let resp = ui.interact(r, ui.id().with(("presentation_tab", tab.id)), Sense::click()).tip(tr("Present")); + let body_r = Rect::from_min_max(r.min, pos2(r.max.x - 32.0, r.max.y)); + let close_r = Rect::from_min_max(body_r.right_top(), r.max); + let resp = ui.interact(body_r, ui.id().with(("presentation_tab", tab.id)), Sense::click()).tip(tr("Present")); + let cresp = ui.interact(close_r, ui.id().with(("presentation_close", tab.id)), Sense::click()).tip(tr("Close preview")); crate::a11y::tab(&resp, &label, active); + let hovered = resp.hovered() || cresp.hovered(); if active { ui.painter().rect_filled(r, CornerRadius::ZERO, t.tab_active); - } else if resp.hovered() { + } else if hovered { ui.painter().rect_filled(r, CornerRadius::ZERO, t.hover); } - icons::paint(ui.painter(), Rect::from_center_size(pos2(x + 19.0, r.center().y), vec2(14.0, 14.0)), Icon::Play, t.icon); - crate::bidi::paint_name(ui.painter(), pos2(x + 34.0, r.center().y), &label, regular(12.0), t.text, w - 62.0); - let mut closed = false; - if resp.hovered() || active { - let cr = Rect::from_center_size(pos2(r.max.x - 16.0, r.center().y), vec2(18.0, 18.0)); - let cresp = ui.interact(cr, ui.id().with(("presentation_close", tab.id)), Sense::click()).tip(tr("Close preview")); + icons::paint(ui.painter(), Rect::from_center_size(pos2(r.min.x + 19.0, r.center().y), vec2(14.0, 14.0)), Icon::Play, t.icon); + crate::bidi::paint_name(ui.painter(), pos2(r.min.x + 34.0, r.center().y), &label, regular(12.0), t.text, r.width() - 62.0); + if hovered || active { + let cr = Rect::from_center_size(close_r.center(), vec2(18.0, 18.0)); if cresp.hovered() { ui.painter().rect_filled(cr, CornerRadius::same(4), t.pressed); } icons::paint(ui.painter(), cr.shrink(4.0), Icon::Close, t.icon_secondary); - closed = cresp.clicked(); } - (w, resp.clicked() && !closed, closed || resp.middle_clicked()) + let closed = cresp.clicked() || resp.middle_clicked() || cresp.middle_clicked(); + (resp.clicked(), closed) +} + +/// The part of the strip's free `room` the presentation tabs may use: all they want, but at most +/// half of it while file tabs share the strip, so they shrink or overflow before covering controls. +fn present_room(room: f32, preferred: &[f32], files: bool) -> f32 { + preferred.iter().sum::().min(if files { room / 2.0 } else { room }) } fn present_tab_width(tab: &PresentTab) -> f32 { @@ -612,9 +646,22 @@ pub fn resize_edges(ctx: &egui::Context) { #[cfg(test)] mod layout_tests { - use super::{MIN_TAB_WIDTH, OPEN_TIME, OVERFLOW_WIDTH, TabMotion, open_progress, tab_drop_position, tab_layout}; + use super::{MIN_TAB_WIDTH, OPEN_TIME, OVERFLOW_WIDTH, TabMotion, open_progress, present_room, tab_drop_position, tab_layout}; use egui::{Rect, pos2}; + #[test] + fn many_presentation_tabs_stay_inside_their_share_of_the_strip() { + let preferred = vec![260.0; 8]; + let room = 900.0; + let layout = tab_layout(&preferred, present_room(room, &preferred, true), Some(7)); + assert!(layout.overflow); + assert!(layout.first <= 7 && 7 < layout.first + layout.widths.len()); + assert!(layout.widths.iter().all(|&width| width >= MIN_TAB_WIDTH)); + assert!(layout.widths.iter().sum::() + OVERFLOW_WIDTH <= room / 2.0 + 0.01); + assert_eq!(present_room(room, &preferred, false), room); + assert_eq!(present_room(room, &[200.0], true), 200.0); + } + #[test] fn tabs_shrink_to_fit_before_overflowing() { let preferred = vec![120.0; 10]; From 89529b3d0035a3835f6282873243ae02e2985bee Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 04:22:26 +0700 Subject: [PATCH 395/817] #889: drop the hub write-cap and core-limit changes (neither is read) --- crates/collab-net/src/hub.rs | 20 +++++++++----------- crates/collab-net/src/link.rs | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/crates/collab-net/src/hub.rs b/crates/collab-net/src/hub.rs index 8ddde6e26..5cf3e5191 100644 --- a/crates/collab-net/src/hub.rs +++ b/crates/collab-net/src/hub.rs @@ -860,7 +860,7 @@ fn serve(mut stream: TcpStream, conn: u64, hub: &Sender, limits: NetLimit let Ok(peer) = stream.peer_addr().map(|a| a.ip().to_canonical()) else { return }; let proxied = limits.trusted_proxy.is_some_and(|p| p.to_canonical() == peer); let Ok((rd, wr, sock)) = Duplex::split(stream, None) else { return }; - let write_cfg = config(limits.max_server_message); + let cfg = config(limits.max_client_message); let mut forwarded = None; // The handshake callback's type is tungstenite's (its error is an HTTP response). #[allow(clippy::result_large_err)] @@ -904,16 +904,14 @@ fn serve(mut stream: TcpStream, conn: u64, hub: &Sender, limits: NetLimit max_block: limits.max_queued_block, max_all: limits.max_queued_total, }; - let writer = match sock - .try_clone() - .map(|s| spawn("live-write", move || write_loop(WebSocket::from_raw_socket(wr, Role::Server, Some(write_cfg)), &rx, &s))) - { - Ok(Ok(t)) => t, - _ => { - shutdown(&sock); - return; - } - }; + let writer = + match sock.try_clone().map(|s| spawn("live-write", move || write_loop(WebSocket::from_raw_socket(wr, Role::Server, Some(cfg)), &rx, &s))) { + Ok(Ok(t)) => t, + _ => { + shutdown(&sock); + return; + } + }; let end = |why: Option<&str>| { if let Some(why) = why { refuse(&out, why); diff --git a/crates/collab-net/src/link.rs b/crates/collab-net/src/link.rs index 66d07477d..a84395aa8 100644 --- a/crates/collab-net/src/link.rs +++ b/crates/collab-net/src/link.rs @@ -139,7 +139,7 @@ impl LiveLink for NetLink { doc, name: o.name, limits: self.limits, - core: figcraft_collab::Limits { max_message_bytes: self.limits.max_server_message, ..figcraft_collab::Limits::default() }, + core: figcraft_collab::Limits::default(), }; let host = Host::start(cfg, inbox.clone()).map_err(|e| format!("can't listen on {ip}: {e}"))?; let invite = Invite::new(host.addr().to_string(), file, token); From ddde77db0aa282d4db91490f1b1352288691b48f Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 04:26:04 +0700 Subject: [PATCH 396/817] M9: release fonts: web build embeds craft-fonts, pin back to the Latin manifest (#885) The browser has no system fonts, and since releases moved to the shared workflow the web build was made without craft-fonts: no font list and no text drawn. The Georgian change also re-pinned craft-fonts to its main, which has no fonts/latin-manifest.txt, so the next release would fail under CRAFT_FONTS_REQUIRED. Pin the Latin commit again until one commit has both (craft-fonts#42); desktop Georgian uses an installed font. --- .github/workflows/release.yml | 8 +++++++- ROADMAP.md | 1 + docs/releasing.md | 14 +++++++++----- docs/translating.md | 5 +++-- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0d1723d83..dd2aefddb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,8 +24,14 @@ jobs: with: app-name: figcraft app-title: FigCraft - craft-fonts-ref: a71c20e30af613287c504f7e685ca8fad77752bc + # Needs fonts/latin-manifest.txt (Inter): crates/text/build.rs fails a release without it. Only + # craft-fonts' pr/latin-presentation-fonts has it; its main has Noto Sans Georgian but no Inter. + # Re-pin once one commit has both (storytold/craft-fonts#42). + craft-fonts-ref: 43913056ce82a3fdad0ef69f6b88d1dc922a8104 has-server: true + # The browser has no system fonts: without craft-fonts the web build can't draw text (#885). + # crates/text/build.rs keeps the web build to Inter. + web-craft-fonts: true version: ${{ inputs.version }} secrets: APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} diff --git a/ROADMAP.md b/ROADMAP.md index 8a587286d..224bf7af6 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -316,6 +316,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-20 | minor | Release fonts (#885): the web release embeds craft-fonts again (Inter), so the browser version draws text and lists fonts; it had none since releases moved to the shared workflow. The craft-fonts pin goes back to the commit with the Latin manifest (the Georgian change had moved it to one without Inter, which would have failed the next release). Numbers unchanged. | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | diff --git a/docs/releasing.md b/docs/releasing.md index 7e9220ff0..07492f6cd 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -95,13 +95,17 @@ examples from `packaging/server/` (systemd unit, Caddyfile, nginx; the Dockerfil the sources). Linux only for now; elsewhere operators build it with `cargo build --release -p figcraft-server`. -**Fonts.** Every build job checks out [craft-fonts](https://github.com/storytold/craft-fonts) at -`CRAFT_FONTS_REF` (top of `release.yml`) and builds with `CRAFT_FONTS_DIR` and -`CRAFT_FONTS_REQUIRED=1`, so releases embed its fonts and fail rather than ship without them. +**Fonts.** Every build job, the web one included (`web-craft-fonts`), checks out +[craft-fonts](https://github.com/storytold/craft-fonts) at `craft-fonts-ref` (in `release.yml`) and +builds with `CRAFT_FONTS_DIR` and `CRAFT_FONTS_REQUIRED=1`, so releases embed its fonts and fail +rather than ship without them. The browser has no system fonts, so a web build without craft-fonts +can't draw text. `crates/text/build.rs` reads both `fonts/manifest.txt` and `fonts/latin-manifest.txt`, so the pin must be a commit that has the Latin manifest (today `4391305`, on craft-fonts' -`pr/latin-presentation-fonts` branch; re-pin to `main` once that lands). The web build embeds -only Inter. Packages carry each embedded font's licence as `OFL-.txt` +`pr/latin-presentation-fonts` branch; re-pin to `main` once that lands). That commit has no +Noto Sans Georgian (craft-fonts' main has it but no Latin manifest), so desktop Georgian uses an +installed font; re-pin when one commit has both (craft-fonts#42). The web build embeds only Inter, +Noto Sans Georgian and the Archivo SemiBold wordmark, when the pin has them. Packages carry each embedded font's licence as `OFL-.txt` (`copy_font_licences` in `packaging/env.sh`; `Contents/Resources/Licenses` in the macOS app). ### macOS diff --git a/docs/translating.md b/docs/translating.md index b7b23d0bf..04d9906b2 100644 --- a/docs/translating.md +++ b/docs/translating.md @@ -66,8 +66,9 @@ something on screen needs it (see `crates/ui-egui/src/cjk.rs`). The web build ha so Japanese, Korean and Chinese appear there only in a build with craft-fonts and `FIGCRAFT_EMBED_CJK=1` (Noto Sans CJK SC, +16 MB); otherwise they are left out of the picker. A Chinese UI puts its Chinese face first so Han takes Simplified Chinese shapes. Georgian is drawn in -craft-fonts' Noto Sans Georgian, one of the built-in faces in `theme::install_fonts`. Web builds -keep it only when built with craft-fonts (`crates/text/build.rs`); the web release isn't, so its +craft-fonts' Noto Sans Georgian, one of the built-in faces in `theme::install_fonts`, or else in an +installed font on the desktop. Web builds keep it only when the craft-fonts they're built with has +it (`crates/text/build.rs`); the commit releases pin doesn't yet (`docs/releasing.md`), so the web picker leaves Georgian out. A new CJK or other non-Latin language also needs its script in `cjk::language`, or a built-in craft-fonts face. From cc4799061e240a17aca12174114bafe70b4d9343 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 04:38:28 +0700 Subject: [PATCH 397/817] #889: say a join is too large in words for people (native and web), translated; keep one test --- crates/collab-net/src/driver.rs | 5 ++- crates/collab-net/src/driver_tests.rs | 11 ++++- crates/collab-net/src/guest.rs | 14 +----- crates/collab-net/src/join.rs | 8 +++- crates/collab-net/src/loopback_tests.rs | 58 +++++-------------------- crates/collab-net/src/session_tests.rs | 16 ------- crates/engine/src/live.rs | 4 ++ crates/ui-egui/locales/en.toml | 1 + crates/ui-egui/locales/es.toml | 1 + crates/ui-egui/src/i18n_tests.rs | 9 ++++ crates/ui-egui/src/lib.rs | 2 +- crates/ui-egui/src/live.rs | 14 ++++-- 12 files changed, 60 insertions(+), 83 deletions(-) diff --git a/crates/collab-net/src/driver.rs b/crates/collab-net/src/driver.rs index b8f6c1541..4ebbec157 100644 --- a/crates/collab-net/src/driver.rs +++ b/crates/collab-net/src/driver.rs @@ -16,7 +16,7 @@ use figcraft_engine::live::{Event, Status}; use web_time::Instant; use crate::inbox::Inbox; -use crate::join::{GuestConfig, Next, Outcome, Resuming, Seen, Taken, after, closed, hello, resolved, take, unresolved}; +use crate::join::{GuestConfig, Next, Outcome, Resuming, Seen, Taken, after, closed, hello, resolved, take, too_large, unresolved}; use crate::throttle::{PRESENCE_INTERVAL, Throttle, earliest}; /// A WebSocket the driver opens, writes and closes; what it receives comes back through the @@ -114,6 +114,9 @@ impl Driver { /// A binary message from the host. pub(crate) fn message(&mut self, bytes: &[u8], now: Instant) { let Some(c) = self.conn.as_mut() else { return }; + if bytes.len() > self.cfg.limits.max_server_message { + return self.end(too_large(&self.cfg.limits), now); + } c.last_heard = now; let taken = match message::decode::(bytes, self.cfg.limits.max_server_message) { // The join code's answer: join the file it opens, on a new connection. diff --git a/crates/collab-net/src/driver_tests.rs b/crates/collab-net/src/driver_tests.rs index ca6563c5f..5e395b981 100644 --- a/crates/collab-net/src/driver_tests.rs +++ b/crates/collab-net/src/driver_tests.rs @@ -10,7 +10,7 @@ use std::time::{Duration, Instant}; use figcraft_collab::message::{self, ClientMsg, Presence, ServerMsg}; use figcraft_collab::{Client, Limits, Outgoing, Server}; use figcraft_doc::{Document, NodeId}; -use figcraft_engine::live::{Event, Status}; +use figcraft_engine::live::{Event, Status, TOO_LARGE_TO_JOIN}; use tungstenite::protocol::WebSocket; use tungstenite::{Bytes, Message}; @@ -262,6 +262,15 @@ fn refusals_and_the_end_of_the_session_are_final() { assert!(d.done()); assert!(matches!(statuses(&inbox.drain()).last(), Some(Status::Failed { reason }) if reason.starts_with("The host refused"))); } + // A message over the size limit: the file is too large for this app, not refused by the host. + let inbox = Inbox::new(Arc::new(|| {})); + let mut cfg = GuestConfig::new(invite(), "Ada".into()); + cfg.limits.max_server_message = 2 << 20; + let mut d = Driver::start(Script::default(), cfg, inbox.clone(), t0); + d.opened(t0); + d.message(&vec![0; (2 << 20) + 1], t0); + assert!(d.done()); + assert!(matches!(statuses(&inbox.drain()).last(), Some(Status::Failed { reason }) if *reason == TOO_LARGE_TO_JOIN.replace("{mb}", "2"))); } #[test] diff --git a/crates/collab-net/src/guest.rs b/crates/collab-net/src/guest.rs index 7a986ea5c..2e1d5046c 100644 --- a/crates/collab-net/src/guest.rs +++ b/crates/collab-net/src/guest.rs @@ -26,7 +26,7 @@ use tungstenite::{Bytes, Message}; use crate::inbox::Inbox; use crate::invite::{Endpoint, Invite}; pub use crate::join::GuestConfig; -use crate::join::{Next, Outcome, Resuming, Seen, Taken, after, closed, hello, resolved, take, unresolved}; +use crate::join::{Next, Outcome, Resuming, Seen, Taken, after, closed, hello, resolved, take, too_large, unresolved}; use crate::manage; use crate::net::{Duplex, NetLimits, config, open, shutdown}; use crate::throttle::{PRESENCE_INTERVAL, Throttle, earliest}; @@ -367,17 +367,7 @@ fn read_loop(mut ws: WebSocket, ctx: &ReaderCtx) { Ok(Message::Close(f)) => break f.map_or_else(|| closed(0, ""), |f| closed(f.code.into(), &f.reason)), Ok(Message::Text(_)) => break Outcome::Refused("the host sent a text message".into()), Ok(_) => {} - Err(tungstenite::Error::Capacity(_)) => { - let max = ctx.cfg.limits.max_server_message; - let limit = if max >= 1 << 20 && max.is_multiple_of(1 << 20) { - format!("{} MiB", max >> 20) - } else if max >= 1 << 10 && max.is_multiple_of(1 << 10) { - format!("{} KiB", max >> 10) - } else { - format!("{max} bytes") - }; - break Outcome::Failed(format!("received message exceeded size limit (max {limit})")); - } + Err(tungstenite::Error::Capacity(_)) => break too_large(&ctx.cfg.limits), Err(e) => break Outcome::Retry(e.to_string()), } }; diff --git a/crates/collab-net/src/join.rs b/crates/collab-net/src/join.rs index 81cd2437c..cc3be839f 100644 --- a/crates/collab-net/src/join.rs +++ b/crates/collab-net/src/join.rs @@ -7,7 +7,7 @@ use std::time::Duration; use figcraft_collab::Client; use figcraft_collab::message::{ClientMsg, Peer, Resume, ServerMsg}; -use figcraft_engine::live::{Event, Role, SessionInfo, Status}; +use figcraft_engine::live::{Event, Role, SessionInfo, Status, TOO_LARGE_TO_JOIN}; use crate::inbox::Inbox; use crate::invite::Invite; @@ -95,6 +95,12 @@ pub(crate) fn unresolved(cfg: &GuestConfig, outcome: Outcome) -> Outcome { }) } +/// The host sent a message over this app's size limit (the file's welcome, usually): final, and +/// not the host's doing. +pub(crate) fn too_large(limits: &NetLimits) -> Outcome { + Outcome::Failed(TOO_LARGE_TO_JOIN.replace("{mb}", &(limits.max_server_message >> 20).to_string())) +} + /// The server's answer to the join code: the invite is whole now. pub(crate) fn resolved(cfg: &mut GuestConfig, file: String, token: String) -> Result<(), Outcome> { if !crate::invite::valid_id(&file, 1, 64) || !crate::invite::valid_id(&token, 16, 128) { diff --git a/crates/collab-net/src/loopback_tests.rs b/crates/collab-net/src/loopback_tests.rs index eebda6de4..a043d8c79 100644 --- a/crates/collab-net/src/loopback_tests.rs +++ b/crates/collab-net/src/loopback_tests.rs @@ -10,7 +10,7 @@ use std::time::{Duration, Instant}; use figcraft_collab::message::{self, ClientMsg, Hello, Presence, ServerMsg, Signal}; use figcraft_collab::{Client, Limits}; use figcraft_doc::{Document, NodeId}; -use figcraft_engine::live::{Event, PEOPLE, Status}; +use figcraft_engine::live::{Event, PEOPLE, Status, TOO_LARGE_TO_JOIN}; use tungstenite::protocol::WebSocket; use tungstenite::{Bytes, Message}; @@ -644,11 +644,10 @@ fn the_host_removes_someone_and_they_cant_come_back() { } #[test] -fn welcome_messages_larger_than_client_message_limit_are_delivered() { - let mut doc = Document::new("A".repeat(3000)); +fn a_welcome_over_the_size_limit_says_the_file_is_too_large() { + let mut doc = Document::new("B".repeat(1 << 20)); doc.repair(); let probe = Probe::new(); - let limits = NetLimits { max_client_message: 1024, max_server_message: 64 << 10, ..fast_limits() }; let cfg = HostConfig { addr: SocketAddr::from(([127, 0, 0, 1], 0)), any_port_if_taken: false, @@ -656,55 +655,18 @@ fn welcome_messages_larger_than_client_message_limit_are_delivered() { token: TOKEN.into(), doc, name: "Hana".into(), - limits, - core: Limits { max_message_bytes: 64 << 10, ..Limits::default() }, + limits: fast_limits(), + core: Limits::default(), }; let mut host = Host::start(cfg, probe.inbox.clone()).unwrap(); let invite = Invite::new(host.addr().to_string(), FILE, TOKEN); - let guest_probe = Probe::new(); let mut guest_cfg = quick(GuestConfig::new(invite, "Ada".into())); - guest_cfg.limits = limits; - let _g = Guest::start(guest_cfg, guest_probe.inbox.clone()).unwrap(); - let mut gp = guest_probe; - gp.wait("welcome", welcomed); - assert!(welcomed(&gp.events)); - host.stop(); -} - -#[test] -fn oversized_server_message_reports_accurate_diagnostic() { - let mut doc = Document::new("B".repeat(3000)); - doc.repair(); - let probe = Probe::new(); - let limits = NetLimits { max_server_message: 64 << 10, ..fast_limits() }; - let cfg = HostConfig { - addr: SocketAddr::from(([127, 0, 0, 1], 0)), - any_port_if_taken: false, - file: FILE.into(), - token: TOKEN.into(), - doc, - name: "Hana".into(), - limits, - core: Limits { max_message_bytes: 64 << 10, ..Limits::default() }, - }; - let mut host = Host::start(cfg, probe.inbox.clone()).unwrap(); - let invite = Invite::new(host.addr().to_string(), FILE, TOKEN); - - let guest_probe = Probe::new(); - let mut guest_cfg = quick(GuestConfig::new(invite, "Ada".into())); - guest_cfg.limits = NetLimits { max_server_message: 1536, ..fast_limits() }; - let _g = Guest::start(guest_cfg, guest_probe.inbox.clone()).unwrap(); - let mut gp = guest_probe; - gp.wait("accurate failure diagnostic", |e| { - e.iter().any(|ev| { - matches!( - ev, - Event::Status(Status::Failed { reason }) - if !reason.contains("The host refused") && reason.contains("received message exceeded size limit (max 1536 bytes)") - ) - }) - }); + guest_cfg.limits = NetLimits { max_server_message: 1 << 20, ..fast_limits() }; + let mut gp = Probe::new(); + let _g = Guest::start(guest_cfg, gp.inbox.clone()).unwrap(); + let too_large = TOO_LARGE_TO_JOIN.replace("{mb}", "1"); + gp.wait("the file too large to join", |e| e.iter().any(|ev| matches!(ev, Event::Status(Status::Failed { reason }) if *reason == too_large))); assert!(!welcomed(&gp.events)); host.stop(); } diff --git a/crates/collab-net/src/session_tests.rs b/crates/collab-net/src/session_tests.rs index de60b211a..329201237 100644 --- a/crates/collab-net/src/session_tests.rs +++ b/crates/collab-net/src/session_tests.rs @@ -249,19 +249,3 @@ fn cursor_chat_and_spotlight_between_apps() { pump(&mut host, &mut guest, "the spotlight ending", |_, g| g.live().spotlight.is_none()); pump(&mut host, &mut late, "the spotlight ending for the late joiner", |_, l| l.live().spotlight.is_none() && l.live().follow.is_none()); } - -#[test] -#[ignore = "allocates a document larger than 64 MiB: cargo test -p figcraft-collab-net -- --ignored"] -fn welcome_larger_than_64_mib_is_delivered() { - let mut host = session("Hana"); - let mut guest = session("Ada"); - host.doc_mut().unwrap().name = "A".repeat((64 << 20) + 4096); - let r = host.execute("collab.host", &json!({"port": 0})).unwrap(); - assert_eq!(r["status"], "live"); - let link = r["link"].as_str().unwrap().to_string(); - let r = guest.execute("collab.join", &json!({"link": link})).unwrap(); - assert_eq!(r["status"], "connecting"); - pump(&mut host, &mut guest, "the large welcome", |h, g| g.live().status == Status::Live && h.live().peers.len() == 1); - assert_eq!(guest.doc().unwrap().name.len(), (64 << 20) + 4096); - host.execute("collab.stop", &json!({})).unwrap(); -} diff --git a/crates/engine/src/live.rs b/crates/engine/src/live.rs index ed13de5f0..cd8a0f03b 100644 --- a/crates/engine/src/live.rs +++ b/crates/engine/src/live.rs @@ -86,6 +86,10 @@ pub fn parse_color(s: &str) -> Option<(u8, u8, u8)> { Some((byte(0)?, byte(2)?, byte(4)?)) } +/// Why a join failed when a message from the host is over this app's size limit (`{mb}`: the +/// limit in MB). The UI translates it. +pub const TOO_LARGE_TO_JOIN: &str = "This file is too large to join here (up to {mb} MB)"; + /// The connection to a live session. #[derive(Clone, Debug, Default, PartialEq, Serialize)] #[serde(rename_all = "camelCase", tag = "state")] diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index ccf833bea..ae566fc81 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -1393,6 +1393,7 @@ name = "English" "This condition is edited as an expression" = "This condition is edited as an expression" "This file" = "This file" "This file has unsaved changes" = "This file has unsaved changes" +"This file is too large to join here (up to {mb} MB)" = "This file is too large to join here (up to {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 fonts that aren't installed on this computer. Their text is drawn in a fallback font until you install them." "This file is on {server}, open only to you. Share it to let others in with a new code." = "This file is on {server}, open only to you. Share it to let others in with a new code." "This frame is new on the branch." = "This frame is new on the branch." diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 1187c658f..596feda6e 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -1394,6 +1394,7 @@ status = "draft — needs native review" "This condition is edited as an expression" = "Esta condición se edita como expresión" "This file" = "Este archivo" "This file has unsaved changes" = "Este archivo tiene cambios sin guardar" +"This file is too large to join here (up to {mb} MB)" = "Este archivo es demasiado grande para unirte aquí (hasta {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." = "Este archivo usa fuentes que no están instaladas en este equipo. Su texto se dibuja con una fuente de reserva hasta que las instales." "This file is on {server}, open only to you. Share it to let others in with a new code." = "Este archivo está en {server}, abierto solo para ti. Compártelo para dejar entrar a otros con un código nuevo." "This frame is new on the branch." = "Este marco es nuevo en la rama." diff --git a/crates/ui-egui/src/i18n_tests.rs b/crates/ui-egui/src/i18n_tests.rs index fcf21fde9..046212c16 100644 --- a/crates/ui-egui/src/i18n_tests.rs +++ b/crates/ui-egui/src/i18n_tests.rs @@ -135,6 +135,7 @@ fn dynamic_labels() -> Vec<&'static str> { v.extend(Group::ALL.iter().map(|g| g.label())); v.extend(GESTURES.iter().flat_map(|(_, label, mac, other)| [*label, *mac, *other])); v.extend(DATA_LABELS); + v.push(figcraft_engine::live::TOO_LARGE_TO_JOIN); // The starter templates' names, descriptions and kinds. v.extend(figcraft_engine::templates::TEMPLATES.iter().flat_map(|t| [t.name, t.description, t.kind.label()])); v @@ -327,6 +328,14 @@ fn lookups_fall_back_to_english_and_fill_placeholders() { assert!(matches!(lookup(es, k), Some(x) if std::ptr::eq(x, t))); } +#[test] +fn a_live_failure_the_ui_knows_is_read_back_for_translation() { + use figcraft_engine::live::TOO_LARGE_TO_JOIN; + let reason = TOO_LARGE_TO_JOIN.replace("{mb}", "1024"); + assert!(matches!(crate::live::failure_text(&reason), std::borrow::Cow::Owned(t) if t == reason)); + assert!(matches!(crate::live::failure_text("Couldn't reach the server"), std::borrow::Cow::Borrowed(_))); +} + #[test] fn system_languages_pick_the_first_one_with_a_catalog() { let code = |pref: &str, system: Option<&str>| LANGS[resolve(pref, system)].code; diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 84aedd6ab..8495c30de 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1510,7 +1510,7 @@ impl FigApp { // What happened in a live session (the network woke us for it). if self.session.live_poll() { if let Some(m) = self.session.message.take() { - self.toast(m); + self.toast(live::failure_text(&m)); } self.background_done(&ctx); } diff --git a/crates/ui-egui/src/live.rs b/crates/ui-egui/src/live.rs index 513060aba..a4baa3034 100644 --- a/crates/ui-egui/src/live.rs +++ b/crates/ui-egui/src/live.rs @@ -13,10 +13,11 @@ //! and it fades a few seconds after the last change (frames are asked for only until then). //! Spotlight: your avatar's menu asks everyone to follow you; a banner says so and stops it. +use std::borrow::Cow; use std::collections::BTreeMap; use egui::{Align2, Color32, CornerRadius, Pos2, Rect, Sense, Shape, Stroke, Ui, pos2, vec2}; -use figcraft_engine::live::{Access, PEOPLE, Role, SessionId, Share, Signal, Status, Via, initials, parse_color, presence_page}; +use figcraft_engine::live::{Access, PEOPLE, Role, SessionId, Share, Signal, Status, TOO_LARGE_TO_JOIN, Via, initials, parse_color, presence_page}; use serde_json::{Value, json}; use crate::FigApp; @@ -595,7 +596,7 @@ pub fn share_popover(app: &mut FigApp, anchor: &egui::Response) { (Status::Reconnecting { attempt }, _) => { (trf("Connection lost, reconnecting (attempt {attempt})…", &[("attempt", attempt)]), t.text_secondary) } - (Status::Failed { .. }, _) => (status.label(), t.danger), + (Status::Failed { reason }, _) => (failure_text(reason).into_owned(), t.danger), _ => (tr(&status.label()).to_string(), t.text_secondary), }; if !line.is_empty() { @@ -695,11 +696,18 @@ pub fn join_field(app: &mut FigApp, ui: &mut Ui, typed: &mut String, id: egui::I pub fn join_status(app: &FigApp, ui: &mut Ui, t: &Tokens, session: SessionId) { match app.session.live.get(session).map(|l| &l.status) { Some(Status::Connecting) => widgets::label(ui, tr("Joining…"), t.text_secondary), - Some(Status::Failed { reason }) => widgets::label(ui, reason, t.danger), + Some(Status::Failed { reason }) => widgets::label(ui, &failure_text(reason), t.danger), _ => {} } } +/// Why a live session failed, in the UI language when it is a reason the UI knows (the transport's +/// English otherwise). +pub(crate) fn failure_text(reason: &str) -> Cow<'_, str> { + let mb = TOO_LARGE_TO_JOIN.split_once("{mb}").and_then(|(before, after)| reason.strip_prefix(before)?.strip_suffix(after)); + mb.map_or(Cow::Borrowed(reason), |mb| Cow::Owned(trf(TOO_LARGE_TO_JOIN, &[("mb", &mb)]))) +} + /// Not in a session: your name, how to share (online or on the local network), start; or join /// one with a code. Everything else is under Advanced. fn start_ui(app: &mut FigApp, ui: &mut Ui, t: &Tokens) { From f99fdea3b64c2d3da3acd92bacc8612b7e487b6e Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 04:39:13 +0700 Subject: [PATCH 398/817] #881: leave the progress docs to the maintainer --- ROADMAP.md | 3 +-- docs/ui-parity.md | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index b9851508c..8a587286d 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-19 · **Change:** minor (community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -316,7 +316,6 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| -| 2026-10-19 | minor | Layout grids: columns and rows can set their line width to Auto (a width of 0, or typing the word for Auto — the field's own placeholder text in the UI's language, or “auto” — in the field), drawing a one-pixel hairline at each band's start like the square grid instead of a filled band, with the gutter alone as the step between the lines. The width field shows “Auto” when there is no width; a stretched grid shows it dim and not editable, its bands dividing the frame. Only the grid's width and count take the word: an auto layout's gap, whose “Auto” is Space between, and a prototype overlay's offset, whose “Auto” is no offset, keep their own meaning of 0. The align menu no longer forces a 60 px band on a zero width (it keeps Auto); only stale sub-pixel widths are lifted. A saved non-stretched grid with a width of 0 now draws hairlines where it drew 60 px bands, and snaps to one line per band instead of two edges. Regression tests in the layout and field suites. Numbers unchanged. | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 7f7c6cb38..766284f1d 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-10-19 · **Change:** minor (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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **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: @@ -105,7 +105,7 @@ interaction feel not yet compared. | Frames and sections drawn around layers take those fully inside; sections never drop into frames | done | not in auto layout frames | | Resizing a section leaves its contents in place | done | | | Masks: what a mask hides doesn't take clicks; a mask group's box is the mask's | done | | -| Layout grids (Ctrl+G) | done | columns, rows and grid; Auto line width (0 draws a one-pixel hairline at each band's start, spaced by the gutter; a stretched grid computes its width and shows Auto dim); stretch, left, centre, right; Auto count; several per frame; styles; not shown or snapped on a rotated frame; a nested frame's grids snap but only top-level frames draw them | +| Layout grids (Ctrl+G) | done | columns, rows and grid; stretch, left, centre, right; Auto count; several per frame; styles; not shown or snapped on a rotated frame; a nested frame's grids snap but only top-level frames draw them | | Gamut warnings for Display P3 files | done | colour picker note; View ▸ Soft-proof sRGB stripes what sRGB can't show (the canvas itself is sRGB) | | Gradient and padding/gap handles on the canvas | done | | | Hover outline, selection colours, handle sizes | done | measured from UI3 screenshots | @@ -172,7 +172,6 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| -| 2026-10-19 | minor | Layout grids: columns and rows take an Auto line width (0, or typing the word for Auto), drawing a one-pixel hairline at each band's start with the gutter as the step; the width field shows “Auto” and typing it clears the width; a stretched grid shows the width dim and computed. The word is taken only by the fields where 0 is Auto (the grid's width and count), not by an auto layout's gap or a prototype overlay's offset. The align menu keeps a zero width as Auto instead of forcing 60 px. Regression tests in the layout and field suites. | | 2026-10-18 | minor | A rename (layers double-click, F2, File ▸ Rename, a page) selects the whole name in the frame its field first draws, so the first key replaces the name instead of being appended. Checked in the app on Windows over the control channel | | 2026-10-17 | minor | Escape or Enter while the pen draws ends the path and keeps its vector in edit mode with the pen, so the next path is drawn into the same layer (unconnected); another Escape leaves edit mode (#760). Entering edit mode on a layer that already is a vector no longer records an empty undo step. Numbers unchanged | | 2026-10-17 | minor | Text layers keep the platform IME on for every frame of an edit, not only frames with input (an idle frame turned it off and macOS dropped each composition, #747); the candidate window opens at the caret instead of the canvas corner; keys pressed while composing go to the IME | From 309271851fca5fda92a4856d834c79f3fbdcbbb4 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 04:39:14 +0700 Subject: [PATCH 399/817] #881: keep fixed grids at width 0 drawing bands as before (no hairlines) --- crates/doc/src/props.rs | 5 +---- crates/layout/src/lib.rs | 27 ++++++------------------- crates/layout/src/tests.rs | 38 ------------------------------------ crates/ui-egui/src/canvas.rs | 7 +------ 4 files changed, 8 insertions(+), 69 deletions(-) diff --git a/crates/doc/src/props.rs b/crates/doc/src/props.rs index 33120404a..4f6491c1c 100644 --- a/crates/doc/src/props.rs +++ b/crates/doc/src/props.rs @@ -1189,10 +1189,7 @@ pub enum GridAlign { #[serde(default)] pub struct LayoutGrid { pub kind: GridKind, - /// Grid: cell size. Fixed (not stretched) columns/rows: their width/height. 0 (or Auto) draws - /// a one-pixel hairline at each band's start, like the square grid, and the bands step by - /// `gutter` alone (there is no width to add); a positive value draws a band that many document - /// units wide. A stretched grid works its bands out from the frame and ignores `size`. + /// Grid: cell size. Fixed (not stretched) columns/rows: their width/height. pub size: f64, /// Columns/rows: how many (0: Auto, as many fixed-size ones as fit; a stretched grid has 1). pub count: u32, diff --git a/crates/layout/src/lib.rs b/crates/layout/src/lib.rs index a8376363a..02e7bdaf8 100644 --- a/crates/layout/src/lib.rs +++ b/crates/layout/src/lib.rs @@ -1047,17 +1047,12 @@ pub fn grid_lines(g: &LayoutGrid, w: f64, h: f64) -> Vec { let total = if cols { w } else { h }; let gutter = if g.gutter.is_finite() { g.gutter.max(0.0) } else { 0.0 }; let offset = if g.offset.is_finite() { g.offset.max(0.0) } else { 0.0 }; - // Auto width (size 0, a non-stretched grid) draws a one-pixel hairline at the band's - // start, like the square grid; otherwise a filled band of `size`. Auto has no width of - // its own, so the gutter alone is the step between the lines. - let auto = g.size <= 0.0 && g.align != GridAlign::Stretch; - let fixed = if g.size.is_finite() && g.size > 0.0 { g.size } else { 0.0 }; let count = match g.count { // Auto: as many fixed-size columns (rows) as fit in the room the type leaves them. 0 if g.align != GridAlign::Stretch => { + let size = if g.size.is_finite() && g.size > 0.0 { g.size } else { 60.0 }; let room = if g.align == GridAlign::Center { total } else { total - offset }; - let step = fixed + gutter; - if step > 0.0 { ((room + gutter) / step).floor().clamp(1.0, 500.0) as usize } else { 1 } + ((room + gutter) / (size + gutter)).floor().clamp(1.0, 500.0) as usize } n => n.clamp(1, 500) as usize, }; @@ -1067,7 +1062,7 @@ pub fn grid_lines(g: &LayoutGrid, w: f64, h: f64) -> Vec { (offset, size) } _ => { - let size = fixed; + let size = if g.size.is_finite() && g.size > 0.0 { g.size } else { 60.0 }; let span = size * count as f64 + gutter * (count - 1) as f64; let start = match g.align { GridAlign::Min => offset, @@ -1079,12 +1074,7 @@ pub fn grid_lines(g: &LayoutGrid, w: f64, h: f64) -> Vec { }; for i in 0..count { let a = start + i as f64 * (size + gutter); - if auto { - // A one-pixel hairline where the band would start (the square grid's lines). - out.push(if cols { Rect::new(a, 0.0, a, h) } else { Rect::new(0.0, a, w, a) }); - } else { - out.push(if cols { Rect::new(a, 0.0, a + size, h) } else { Rect::new(0.0, a, w, a + size) }); - } + out.push(if cols { Rect::new(a, 0.0, a + size, h) } else { Rect::new(0.0, a, w, a + size) }); } } } @@ -1114,16 +1104,11 @@ pub fn grid_snap_lines_in(doc: &Document, frame: NodeId, xf: Affine) -> (Vec { xs.push(a.x); - // An Auto-width band is one line, not an edge pair. - if (b.x - a.x).abs() > 1e-9 { - xs.push(b.x); - } + xs.push(b.x); } GridKind::Rows => { ys.push(a.y); - if (b.y - a.y).abs() > 1e-9 { - ys.push(b.y); - } + ys.push(b.y); } GridKind::Grid => { if (r.x0 - r.x1).abs() < 1e-9 { diff --git a/crates/layout/src/tests.rs b/crates/layout/src/tests.rs index cf8e944a1..0af9861b8 100644 --- a/crates/layout/src/tests.rs +++ b/crates/layout/src/tests.rs @@ -447,41 +447,3 @@ fn grid_hostile_values() { assert!(x.is_finite() && y.is_finite() && w.is_finite() && h.is_finite()); } } - -#[test] -fn grid_lines_auto_width_columns_rows_hairline() { - // Columns with Auto width (size 0, non-stretched) draw one-pixel hairlines at each band's - // start, like the square grid; a set width draws filled bands. - let g = LayoutGrid { kind: GridKind::Columns, align: GridAlign::Min, count: 3, size: 0.0, gutter: 10.0, offset: 0.0, ..LayoutGrid::default() }; - let lines = grid_lines(&g, 300.0, 50.0); - assert_eq!(lines.len(), 3, "three hairlines"); - for r in &lines { - assert!((r.x0 - r.x1).abs() < 1e-9 && (r.y0 - r.y1).abs() > 1.0, "a vertical hairline: {r:?}"); - } - // Auto has no width of its own, so the gutter alone is the step between the lines (no band - // width hidden in it). - let xs: Vec = lines.iter().map(|r| r.x0).collect(); - assert_eq!(xs, [0.0, 10.0, 20.0], "Auto steps by the gutter: {xs:?}"); - // Auto count: as many hairlines as the gutter fits. - let g = LayoutGrid { kind: GridKind::Columns, align: GridAlign::Min, count: 0, size: 0.0, gutter: 10.0, offset: 0.0, ..LayoutGrid::default() }; - let lines = grid_lines(&g, 300.0, 50.0); - assert_eq!(lines.len(), 31, "300 wide, 10 apart: 31 lines"); - // A positive width draws filled bands again. - let g = LayoutGrid { kind: GridKind::Columns, align: GridAlign::Min, count: 3, size: 8.0, gutter: 10.0, offset: 0.0, ..LayoutGrid::default() }; - let lines = grid_lines(&g, 300.0, 50.0); - assert!(lines.iter().all(|r| (r.x1 - r.x0).abs() > 1e-9), "a set width draws bands"); - - // Rows Auto width: horizontal hairlines. - let g = LayoutGrid { kind: GridKind::Rows, align: GridAlign::Min, count: 2, size: 0.0, gutter: 10.0, offset: 0.0, ..LayoutGrid::default() }; - let lines = grid_lines(&g, 50.0, 200.0); - assert_eq!(lines.len(), 2, "two hairlines"); - for r in &lines { - assert!((r.y0 - r.y1).abs() < 1e-9 && (r.x0 - r.x1).abs() > 1.0, "a horizontal hairline: {r:?}"); - } - // A stretched grid works its bands out from the frame whatever its width says. - let g = - LayoutGrid { kind: GridKind::Columns, align: GridAlign::Stretch, count: 4, size: 0.0, gutter: 10.0, offset: 0.0, ..LayoutGrid::default() }; - let lines = grid_lines(&g, 400.0, 50.0); - assert!(lines.iter().all(|r| (r.x1 - r.x0) > 1.0), "stretch draws bands, not hairlines: {lines:?}"); - assert!((lines[0].x0 - 0.0).abs() < 1e-9 && (lines[3].x1 - 400.0).abs() < 1e-9, "the bands fill the frame"); -} diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index b400e56da..96bd20bfd 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -923,12 +923,7 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ let a = w * Point::new(r.x0, r.y0); let b = w * Point::new(r.x1, r.y1); let (sa, sb) = (app.to_screen(a.x, a.y), app.to_screen(b.x, b.y)); - // The square grid and an Auto-width line draw one-pixel hairlines; a filled - // band (a column/row with a set width) is painted as a rectangle. - if g.kind == figcraft_doc::GridKind::Grid - || (r.x0 - r.x1).abs() < 1e-9 - || (r.y0 - r.y1).abs() < 1e-9 - { + if g.kind == figcraft_doc::GridKind::Grid { painter.line_segment([sa, sb], stroke(col, 1.0)); } else { painter.rect_filled(Rect::from_two_pos(sa, sb), CornerRadius::ZERO, col); From a7d064895868a9369ef9217bd985a54b39e7c69c Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 04:45:44 +0700 Subject: [PATCH 400/817] #881: fixed grids keep their pixel Width and the Stretch->Left lift to 60; the stretched Auto width reuses the number field (disabled) --- crates/ui-egui/src/right.rs | 40 +++++++------------------------ crates/ui-egui/src/variable_ui.rs | 2 +- crates/ui-egui/src/widgets.rs | 35 --------------------------- 3 files changed, 9 insertions(+), 68 deletions(-) diff --git a/crates/ui-egui/src/right.rs b/crates/ui-egui/src/right.rs index b0e4286da..afa884a87 100644 --- a/crates/ui-egui/src/right.rs +++ b/crates/ui-egui/src/right.rs @@ -2074,14 +2074,12 @@ fn grid_settings(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], list: &[LayoutGr menu_popup(&resp).show(|ui| { for (k, (name, a)) in names.iter().zip(aligns).enumerate() { if menu_check(ui, k == cur, name, "") { - // Auto (size 0) stays Auto whatever the alignment: a stretched grid works - // its bands out from the frame, and a fixed one draws hairlines. Only a - // stale sub-pixel width (older files) is lifted to a visible band. + // Fixed-size columns need a size of their own. app.run( "node.set", set(&|x| { x.align = a; - if a != GridAlign::Stretch && x.size > 0.0 && x.size < 1.0 { + if a != GridAlign::Stretch && !(x.size.is_finite() && x.size > 0.0) { x.size = 60.0; } if a == GridAlign::Stretch { @@ -2095,15 +2093,15 @@ fn grid_settings(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], list: &[LayoutGr }); }); let span = if cols { tr("Width") } else { tr("Height") }; - // 0 is Auto: no band, a one-pixel hairline at each band's start. A stretched grid works - // its bands out from the frame instead, so its width is not set at all. - let span_value = (g.size > 0.0).then_some(g.size); match g.align { GridAlign::Stretch => { widgets::sublabels(ui, span, Some(tr("Margin"))); row(ui, 32.0, |ui| { // The frame, divided by the count: shown as Auto and not editable. - widgets::number_field_disabled(ui, Id::new(("grid_field", "size", i)), Lead::Named(span), tr("Auto"), col); + ui.add_enabled_ui(false, |ui| { + let auto = widgets::Empty::Text(tr("Auto")); + widgets::number_field_bindable(ui, Id::new(("grid_field", "size", i)), Lead::Named(span), None, "", col, 1.0, None, auto) + }); field(app, ui, "offset", g.offset, &offset); }); widgets::sublabels(ui, tr("Gutter"), None); @@ -2112,36 +2110,14 @@ fn grid_settings(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], list: &[LayoutGr GridAlign::Center => { widgets::sublabels(ui, span, Some(tr("Gutter"))); row(ui, 32.0, |ui| { - let we = crate::variable_ui::number_field_auto( - app, - ui, - ids, - &format!("layoutGrids/{i}/size"), - Id::new(("grid_field", "size", i)), - span_value, - col, - Lead::None, - "", - ); - app.field_run(we, "node.set", |v| set(&|x| x.size = v.max(0.0))); + field(app, ui, "size", g.size, &size); field(app, ui, "gutter", g.gutter, &gutter); }); } GridAlign::Min | GridAlign::Max => { widgets::sublabels(ui, span, Some(tr("Offset"))); row(ui, 32.0, |ui| { - let we = crate::variable_ui::number_field_auto( - app, - ui, - ids, - &format!("layoutGrids/{i}/size"), - Id::new(("grid_field", "size", i)), - span_value, - col, - Lead::None, - "", - ); - app.field_run(we, "node.set", |v| set(&|x| x.size = v.max(0.0))); + field(app, ui, "size", g.size, &size); field(app, ui, "offset", g.offset, &offset); }); widgets::sublabels(ui, tr("Gutter"), None); diff --git a/crates/ui-egui/src/variable_ui.rs b/crates/ui-egui/src/variable_ui.rs index 7f6ff6a4a..39c5396e9 100644 --- a/crates/ui-egui/src/variable_ui.rs +++ b/crates/ui-egui/src/variable_ui.rs @@ -262,7 +262,7 @@ pub fn number_field_or( } /// [`number_field_or`] for a field where 0 is its automatic value (a layout grid's width or -/// count): typing the word for Auto sets 0. See [`widgets::number_field_auto`]. +/// count): typing the word for Auto sets 0 ([`Empty::Auto`]). pub fn number_field_auto( app: &mut FigApp, ui: &mut Ui, diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index 8b66965f1..2d986c646 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -185,41 +185,6 @@ pub fn number_field_or(ui: &mut Ui, id: Id, value: Option, empty: &str, wid number_field_impl(ui, id, Lead::None, value, "", width, step, None, Empty::Text(empty)).0?.settled() } -/// [`number_field_or`] for a field where 0 *is* its automatic value (a layout grid's width or -/// count): typing the word for Auto — the placeholder's own text in the UI's language, or the -/// English "auto" — sets 0. Only fields that ask for it get this; a field merely showing "Auto" -/// as its placeholder keeps its own meaning of 0. -pub fn number_field_auto(ui: &mut Ui, id: Id, value: Option, width: f32, step: f64) -> Option { - number_field_impl(ui, id, Lead::None, value, "", width, step, None, Empty::Auto).0?.settled() -} - -/// A number field that can't be edited, showing `empty` (dim): for a value the app works out -/// itself (a stretched grid's band width), so the row keeps its shape. -pub fn number_field_disabled(ui: &mut Ui, id: Id, lead: Lead, empty: &str, width: f32) { - let t = Tokens::get(ui.ctx()); - let (rect, _) = ui.allocate_exact_size(vec2(width, FIELD_H), Sense::hover()); - let resp = ui.interact(rect, id.with("field"), Sense::hover()); - a11y::number(&resp, lead.name(), None, "", empty); - ui.painter().rect_filled(rect, CornerRadius::same(5), t.field); - let lead_w = match lead { - Lead::None | Lead::Named(_) => 6.0, - Lead::Text(s) => text_lead_width(ui, s, width), - Lead::Icon(..) => 24.0, - }; - let lead_rect = Rect::from_min_size(rect.min, vec2(lead_w, FIELD_H)); - match lead { - Lead::Text(s) => { - let galley = crate::bidi::name_galley(ui.painter(), s, regular(11.0), t.text_tertiary, lead_w - 12.0); - ui.painter().galley(pos2(lead_rect.min.x + 8.0, rect.center().y - galley.size().y / 2.0), galley, t.text_tertiary); - } - Lead::Icon(i, _) => { - icons::paint(ui.painter(), Rect::from_center_size(lead_rect.center() + vec2(1.0, 0.0), vec2(14.0, 14.0)), i, t.icon_secondary) - } - Lead::None | Lead::Named(_) => {} - } - ui.painter().text(pos2(rect.min.x + lead_w, rect.center().y), Align2::LEFT_CENTER, empty, regular(11.0), t.text_tertiary); -} - /// [`number_field`] that can bind a variable: `binding` None = not bindable, `Some(None)` = shows /// a variable button on hover, `Some(Some(name))` = bound (shows the name; click to change, the /// detach button unbinds). No value shows `empty` ("Mixed", "Auto"); [`Empty::Auto`] also takes From 0f95ce3d5bd9438b209334699ede51f652dfaa6a Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 04:45:45 +0700 Subject: [PATCH 401/817] #881: test Auto in a fixed grid's count, scroll to the field instead of a fixed point --- crates/ui-egui/src/field_tests.rs | 48 +++++++++++++++++-------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/crates/ui-egui/src/field_tests.rs b/crates/ui-egui/src/field_tests.rs index 9f278a54d..fea0be8ea 100644 --- a/crates/ui-egui/src/field_tests.rs +++ b/crates/ui-egui/src/field_tests.rs @@ -576,43 +576,49 @@ fn grid_ui(grid: serde_json::Value) -> (Ui, NodeId) { (u, f) } -/// Scroll the Design panel down: the grid settings sit below the fold on the test screen. -fn scroll_panel(u: &mut Ui) { +/// Scroll the Design panel (over its own field `id`) until that field is on the test screen: the +/// grid settings sit below the fold. +fn scroll_to(u: &mut Ui, id: Id) { let wheel = Event::MouseWheel { unit: egui::MouseWheelUnit::Point, delta: egui::vec2(0.0, -300.0), phase: egui::TouchPhase::Move, modifiers: Modifiers::NONE, }; - for _ in 0..4 { - u.frame(vec![Event::PointerMoved(pos2(1300.0, 600.0)), wheel.clone()]); - } - for _ in 0..5 { - u.frame(vec![]); + for _ in 0..10 { + let p = at(u, id); + if p.y < 860.0 { + break; + } + u.frame(vec![Event::PointerMoved(pos2(p.x, 500.0)), wheel.clone()]); + // Let the scroll settle. + for _ in 0..30 { + u.frame(vec![]); + } } } -/// The word for Auto types 0 only where 0 *is* the automatic value: a layout grid's width and -/// count do, an auto layout's gap (Auto there is "Space between") does not. Keying it on the -/// field's placeholder said 0 everywhere, which turned the gap's mode off. +/// The word for Auto types 0 only where 0 *is* the automatic value: a fixed layout grid's count +/// does, an auto layout's gap (Auto there is "Space between") does not. Keying it on the field's +/// placeholder said 0 everywhere, which turned the gap's mode off. #[test] fn typing_auto_is_zero_only_where_zero_is_the_automatic_value() { + let count_id = Id::new(("grid_field", "count", 0usize)); let (mut u, f) = grid_ui(json!({"kind": "columns", "align": "min", "count": 3, "size": 8, "gutter": 10})); - let size = |u: &Ui| u.app.session.doc().unwrap().node(f).unwrap().grids[0].size; - assert_eq!(size(&u), 8.0); - scroll_panel(&mut u); - type_at(&mut u, Id::new(("grid_field", "size", 0usize)), "Auto"); - assert_eq!(size(&u), 0.0, "a grid's width: Auto is 0"); - type_at(&mut u, Id::new(("grid_field", "size", 0usize)), "6"); - assert_eq!(size(&u), 6.0, "and a number is that width"); + let count = |u: &Ui| u.app.session.doc().unwrap().node(f).unwrap().grids[0].count; + scroll_to(&mut u, count_id); + type_at(&mut u, count_id, "Auto"); + assert_eq!(count(&u), 0, "a fixed grid's count: Auto is 0"); + type_at(&mut u, count_id, "4"); + assert_eq!(count(&u), 4, "and a number is that count"); // A stretched grid works its width out from the frame: the field shows Auto and takes no edit. let (mut u, f) = grid_ui(json!({"kind": "columns", "align": "stretch", "count": 3, "size": 0})); - scroll_panel(&mut u); - assert!(u.ctx.read_response(Id::new(("grid_field", "size", 0usize)).with("field")).is_some(), "the width row is shown"); - type_at(&mut u, Id::new(("grid_field", "size", 0usize)), "40"); + let size_id = Id::new(("grid_field", "size", 0usize)); + scroll_to(&mut u, size_id); + type_at(&mut u, size_id, "40"); assert_eq!(u.app.session.doc().unwrap().node(f).unwrap().grids[0].size, 0.0, "a stretched grid's width isn't set"); // Nor its count: a stretched grid has at least one band, so the word commits nothing. - type_at(&mut u, Id::new(("grid_field", "count", 0usize)), "Auto"); + type_at(&mut u, count_id, "Auto"); assert_eq!(u.app.session.doc().unwrap().node(f).unwrap().grids[0].count, 3, "a stretched grid keeps its count"); // The auto layout's gap: its placeholder says Auto, but Auto is a mode, not 0. From 629c297de9d650802511cdc73449544198ca4250 Mon Sep 17 00:00:00 2001 From: johnpetersa19 Date: Mon, 19 Oct 2026 18:49:06 -0300 Subject: [PATCH 402/817] M2.1: add missing Brazilian Portuguese translations Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- crates/ui-egui/locales/pt-BR.toml | 114 ++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index b41d827a9..ff720a491 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -1640,6 +1640,120 @@ status = "draft — needs native review" "⌘ click" = "⌘ clique" "⌘ scroll" = "⌘ rolar" "⌥ drag" = "⌥ arrastar" +"A responsive product page: hero, features, figures, a quote and a footer" = "Uma página de produto responsiva: destaque, recursos, dados, depoimento e rodapé" +"A title, an agenda, a big figure, a chart and a closing slide" = "Um título, uma pauta, um número em destaque, um gráfico e um slide de encerramento" +"A to Z" = "De A a Z" +"Adding to {name}" = "Adicionando a {name}" +"All the fonts this file uses are installed" = "Todas as fontes usadas neste arquivo estão instaladas" +"Alphabetical" = "Alfabética" +"An analytics screen on a grid: figures, charts drawn from vectors and a table" = "Uma tela de análise em grade: dados, gráficos vetoriais e uma tabela" +"Apps" = "Aplicativos" +"Apr" = "abr." +"Aug" = "ago." +"Bottom padding" = "Espaçamento interno inferior" +"Bound to {name}. Click to detach the variable." = "Vinculada a {name}. Clique para desvincular a variável." +"Checking the fonts installed on this computer…" = "Verificando as fontes instaladas neste computador…" +"Colour and text styles, Light and Dark variables, buttons, inputs and cards" = "Estilos de cor e texto, variáveis Claro e Escuro, botões, campos e cartões" +"Convert to frame" = "Converter em quadro" +"Convert to section" = "Converter em seção" +"Created" = "Criado" +"Dashboard" = "Painel" +"Date created" = "Data de criação" +"Dec" = "dez." +"Design system starter" = "Ponto de partida para sistema de design" +"Draw a frame" = "Desenhe um quadro" +"Drop a .figcraft, .fig, .json, .svg or image file." = "Solte um arquivo .figcraft, .fig, .json, .svg ou uma imagem." +"Drop to import" = "Solte para importar" +"Drop to open" = "Solte para abrir" +"Edited {when}" = "Editado {when}" +"Export frames and layers as PNG, JPG, SVG or PDF" = "Exporte quadros e camadas como PNG, JPG, SVG ou PDF" +"Feb" = "fev." +"File not found" = "Arquivo não encontrado" +"Four screens of a trail app with components and a prototype flow" = "Quatro telas de um aplicativo de trilhas com componentes e um fluxo de protótipo" +"Getting started" = "Primeiros passos" +"Greyscale components and two example screens to sketch a flow with" = "Componentes em escala de cinza e duas telas de exemplo para esboçar um fluxo" +"Hide these tips (Getting started in the Help menu shows them again)" = "Ocultar estas dicas (Primeiros passos no menu Ajuda as exibe novamente)" +"Hide when publishing" = "Ocultar ao publicar" +"Icon components on a 24 px grid with keylines and a size preview" = "Componentes de ícone em uma grade de 24 px, com linhas-guia e prévia de tamanho" +"Icon set starter" = "Ponto de partida para conjunto de ícones" +"Individual padding" = "Preenchimento individual" +"Interface size" = "Tamanho da interface" +"Jan" = "jan." +"Jul" = "jul." +"Jun" = "jun." +"Kits" = "Kits" +"Landing page" = "Página de apresentação" +"Last modified" = "Modificado por último" +"Left padding" = "Espaçamento interno à esquerda" +"Link frames on the Prototype tab, then present the flow" = "Vincule os quadros na aba Protótipo e apresente o fluxo" +"Make a component" = "Criar um componente" +"Mar" = "mar." +"May" = "mai." +"Missing fonts" = "Fontes ausentes" +"Mobile app" = "Aplicativo para celular" +"Newest first" = "Mais recentes primeiro" +"No files or templates match your search" = "Nenhum arquivo ou modelo corresponde à sua busca" +"No other pages" = "Não há outras páginas" +"No templates match your search" = "Nenhum modelo corresponde à sua busca" +"Nov" = "nov." +"Oct" = "out." +"Oldest first" = "Mais antigos primeiro" +"One announcement in five common sizes: square, portrait, story, link and banner" = "Um anúncio em cinco tamanhos comuns: quadrado, retrato, story, link e banner" +"Opening the file…" = "Abrindo o arquivo…" +"Opening {n} files as new files" = { one = "Abrindo como um novo arquivo", other = "Abrindo {n} arquivos como novos arquivos" } +"Order" = "Ordem" +"Other" = "Outro" +"Pick the Frame tool, then drag on the canvas or choose a device size" = "Selecione a ferramenta Quadro e arraste na tela ou escolha o tamanho de um dispositivo" +"Plugin" = "Plugin" +"Plugins & widgets" = "Plugins e widgets" +"Presentation slides" = "Slides de apresentação" +"Playground" = "Área de testes" +"Relative to your system's display scaling (100% is the system's own size). Document zoom is separate." = "Em relação à escala de exibição do sistema (100% corresponde ao tamanho definido pelo sistema). O zoom do documento é independente." +"Remove from recents" = "Remover dos recentes" +"Reorder selection" = "Reordenar seleção" +"Right padding" = "Espaçamento interno à direita" +"Search templates" = "Buscar modelos" +"See all templates" = "Ver todos os modelos" +"Select layers and they space themselves as their content changes" = "Selecione camadas e elas ajustarão o espaçamento conforme o conteúdo mudar" +"Search files and templates" = "Buscar arquivos e modelos" +"Search results" = "Resultados da busca" +"Search pages" = "Buscar páginas" +"Sep" = "set." +"Share with a code" = "Compartilhar com um código" +"Show all templates" = "Mostrar todos os modelos" +"Show in Explorer" = "Mostrar no Explorador de Arquivos" +"Show in Finder" = "Mostrar no Finder" +"Show in folder" = "Mostrar na pasta" +"Social and slides" = "Redes sociais e slides" +"Social post sizes" = "Tamanhos de publicação para redes sociais" +"Sort by" = "Ordenar por" +"Sort by {column}" = "Ordenar por {column}" +"Start from a template" = "Começar com um modelo" +"Start sharing with the Share button, then pass on the code it gives" = "Comece a compartilhar pelo botão Compartilhar e envie o código gerado" +"Templates" = "Modelos" +"The destination document is unavailable. Nothing was imported." = "O documento de destino está indisponível. Nada foi importado." +"The destination document was closed. Nothing was imported." = "O documento de destino foi fechado. Nada foi importado." +"The destination page was removed. Nothing was imported." = "A página de destino foi removida. Nada foi importado." +"The window is too small for {size}%, so the interface is drawn at {drawn}%. Make the window larger to use {size}%." = "A janela é pequena demais para {size}%, então a interface é exibida em {drawn}%. Aumente a janela para usar {size}%." +"This file uses fonts that aren't installed on this computer. Their text is drawn in a fallback font until you install them." = "Este arquivo usa fontes que não estão instaladas neste computador. O texto será exibido com uma fonte substituta até que você as instale." +"Top padding" = "Espaçamento interno superior" +"Try another search, or browse templates." = "Tente outra busca ou explore os modelos." +"Try another word, or look at every kind." = "Tente outra palavra ou veja todos os tipos." +"Turn a layer into a component, reuse it, and change every copy at once" = "Transforme uma camada em componente, reutilize-a e altere todas as cópias de uma só vez" +"Use your browser's zoom to change the interface size." = "Use o zoom do navegador para alterar o tamanho da interface." +"Uses variables: each layer shows them in its own mode" = "Usa variáveis: cada camada as exibe em seu próprio modo" +"Websites" = "Sites" +"What you try here changes this preview and the code below, not the file" = "O que você experimentar aqui altera esta prévia e o código abaixo, não o arquivo" +"Widget" = "Widget" +"Wireframe kit" = "Kit de wireframe" +"Z to A" = "De Z a A" +"just now" = "agora mesmo" +"only in a text style or variable" = "somente em um estilo de texto ou variável" +"slot layers without a matching slot property were imported as frames" = "camadas de slot sem uma propriedade de slot correspondente foram importadas como quadros" +"yesterday" = "ontem" +"{month} {day}, {year}" = "{day} de {month} de {year}" +"{n} text layers" = { one = "{n} camada de texto", other = "{n} camadas de texto" } +"{percent}%" = "{percent}%" [commands] "align.bottom" = "Alinhar embaixo" From 9ee0c7f57268d0f6bf370aa799be61c356ea489f Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 04:57:20 +0700 Subject: [PATCH 403/817] M1: readable disabled and selected text (#890) The dim text token (disabled buttons, placeholders, hints) was 2.1:1 on the light theme's panels; disabled buttons also faded to 40% opacity, and selected text was drawn in the dark green, 1.4:1 on the dark theme's selection highlight. The dim text token is now at least 3:1 against panels, fields and selected rows in both themes while staying dimmer than secondary text, a disabled button is grey with that text, and selected text takes the theme's readable green. A test checks the ratios with the colour contrast helper. --- ROADMAP.md | 1 + crates/ui-egui/src/theme.rs | 44 +++++++++++++++++++++++++++++++---- crates/ui-egui/src/widgets.rs | 20 ++++++++-------- docs/ui-parity.md | 3 ++- 4 files changed, 53 insertions(+), 15 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 8a587286d..b1a69e46e 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -316,6 +316,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-20 | minor | Readable disabled and selected text (#890): the dim text colour (disabled buttons, placeholders, hints) is at least 3:1 against panels, fields and selected rows in both themes (it was 2.1:1 in the light theme), a disabled button is grey with that text instead of fading to 40%, and selected text (renaming a page or layer, any text box) takes the theme's readable green on the highlight (1.4:1 in the dark theme before, now 4.2:1 or more); checked with the colour contrast helper (`theme::tests`). Numbers unchanged | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rs index 777b04b16..611371cec 100644 --- a/crates/ui-egui/src/theme.rs +++ b/crates/ui-egui/src/theme.rs @@ -14,6 +14,8 @@ pub struct Tokens { pub border_strong: Color32, pub text: Color32, pub text_secondary: Color32, + /// Dim text: disabled controls, placeholders, hints. At least 3:1 against the panels, fields + /// and selected rows, yet dimmer than `text_secondary`. pub text_tertiary: Color32, pub icon: Color32, pub icon_secondary: Color32, @@ -58,11 +60,15 @@ const CANVAS_ACCENT: &str = "figcraft-canvas-accent"; /// Remember the page colour the canvas shows. Its overlays (outlines, handles, arrows) take /// whichever green contrasts more with it: the bright one on a dark page, the darker on a light one. pub fn set_canvas_page(ctx: &Context, page: Color32) { - let c = |x: Color32| figcraft_color::Color::new(f32::from(x.r()) / 255.0, f32::from(x.g()) / 255.0, f32::from(x.b()) / 255.0, 1.0); let pick = if c(BRAND).contrast(c(page)) > c(ACCENT).contrast(c(page)) { BRAND } else { ACCENT }; ctx.data_mut(|d| d.insert_temp(egui::Id::new(CANVAS_ACCENT), pick)); } +/// `x` (opaque) as a document colour, for its contrast with another. +fn c(x: Color32) -> figcraft_color::Color { + figcraft_color::Color::new(f32::from(x.r()) / 255.0, f32::from(x.g()) / 255.0, f32::from(x.b()) / 255.0, 1.0) +} + /// The green for overlays drawn on the page ([`set_canvas_page`]); [`ACCENT`] before a page shows. pub fn canvas_accent(ctx: &Context) -> Color32 { ctx.data(|d| d.get_temp(egui::Id::new(CANVAS_ACCENT))).unwrap_or(ACCENT) @@ -91,7 +97,7 @@ impl Tokens { text: Color32::from_rgb(0x1E, 0x1E, 0x1E), // 4.7:1 on fields and hovered rows (#F5F5F5), 4.6:1 on selected rows: WCAG AA. text_secondary: Color32::from_rgb(0x6E, 0x6E, 0x6E), - text_tertiary: Color32::from_rgb(0xB3, 0xB3, 0xB3), + text_tertiary: Color32::from_rgb(0x8A, 0x8A, 0x8A), icon: Color32::from_rgb(0x1E, 0x1E, 0x1E), icon_secondary: Color32::from_rgb(0x75, 0x75, 0x75), hover: Color32::from_rgb(0xF5, 0xF5, 0xF5), @@ -132,7 +138,7 @@ impl Tokens { border_strong: Color32::from_rgb(0x55, 0x55, 0x55), text: Color32::from_rgb(0xFF, 0xFF, 0xFF), text_secondary: Color32::from_rgb(0xB3, 0xB3, 0xB3), - text_tertiary: Color32::from_rgb(0x75, 0x75, 0x75), + text_tertiary: Color32::from_rgb(0x88, 0x88, 0x88), icon: Color32::from_rgb(0xF5, 0xF5, 0xF5), icon_secondary: Color32::from_rgb(0xB3, 0xB3, 0xB3), hover: Color32::from_rgb(0x38, 0x38, 0x38), @@ -216,7 +222,9 @@ fn visuals(t: Tokens) -> Visuals { v.window_corner_radius = egui::CornerRadius::same(13); v.menu_corner_radius = egui::CornerRadius::same(13); v.selection.bg_fill = t.accent.gamma_multiply(0.3); - v.selection.stroke = Stroke::new(1.0, ACCENT); + // Also the colour of selected text on that highlight (and a focused text box's outline): the + // theme's readable green, not the darker one that sinks into the dark theme's highlight. + v.selection.stroke = Stroke::new(1.0, t.accent_text); v.hyperlink_color = t.accent_text; for w in [&mut v.widgets.inactive, &mut v.widgets.hovered, &mut v.widgets.active, &mut v.widgets.open, &mut v.widgets.noninteractive] { w.corner_radius = egui::CornerRadius::same(5); @@ -462,6 +470,34 @@ mod tests { assert_eq!(under_white(COMPONENT), COMPONENT); } + /// `fill` (premultiplied, maybe translucent) painted over the opaque `bg`. + fn over(fill: Color32, bg: Color32) -> Color32 { + let k = 1.0 - f32::from(fill.a()) / 255.0; + let mix = |f: u8, b: u8| (f32::from(f) + f32::from(b) * k).round().min(255.0) as u8; + Color32::from_rgb(mix(fill.r(), bg.r()), mix(fill.g(), bg.g()), mix(fill.b(), bg.b())) + } + + #[test] + fn disabled_and_selected_text_stay_readable_in_both_themes() { + for t in [Tokens::light(), Tokens::dark()] { + let theme = if t.dark { "dark" } else { "light" }; + // Disabled text (a disabled button's label, placeholders) on panels, fields and + // selected rows, still dimmer than secondary text. + for bg in [t.panel, t.field, t.hover, t.selected_row] { + let ratio = c(t.text_tertiary).contrast(c(bg)); + assert!(ratio >= 3.0, "{theme}: dim text {:?} on {bg:?} is {ratio:.2}:1", t.text_tertiary); + assert!(ratio < c(t.text_secondary).contrast(c(bg)), "{theme}: dim text reads dimmer than secondary text"); + } + // Selected text (renaming a page or layer, any text box) on the selection highlight. + let v = visuals(t); + for bg in [t.panel, t.field] { + let highlight = over(v.selection.bg_fill, bg); + let ratio = c(v.selection.stroke.color).contrast(c(highlight)); + assert!(ratio >= 3.0, "{theme}: selected text on {highlight:?} is {ratio:.2}:1"); + } + } + } + #[test] fn ui_font_draws_every_mac_shortcut_glyph() { figcraft_text::scan_system_fonts(); diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index ca7504aec..b695e918e 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -999,26 +999,26 @@ pub fn radio(ui: &mut Ui, on: bool, label: &str) -> bool { } /// A text button: `primary` is filled with the accent colour, otherwise outlined. A disabled -/// button is dimmed and never reports clicks. +/// button is grey with dim text (still readable) and never reports clicks. pub fn button(ui: &mut Ui, label: &str, primary: bool, enabled: bool) -> Response { let t = Tokens::get(ui.ctx()); let galley = ui.painter().layout_no_wrap(label.to_string(), regular(11.0), t.text); let sense = if enabled { Sense::click() } else { Sense::hover() }; let (rect, resp) = ui.allocate_exact_size(vec2(galley.size().x + 24.0, FIELD_H), sense); a11y::button(&resp, label); - let hot = enabled && resp.hovered(); - let (fill, text) = match (primary, hot) { - (true, false) => (t.accent, t.accent_on), - (true, true) => (t.accent_hover, t.accent_on), - (false, false) => (Color32::TRANSPARENT, t.text), - (false, true) => (t.hover, t.text), + let (fill, text) = match (enabled, primary, resp.hovered()) { + (false, true, _) => (t.field, t.text_tertiary), + (false, false, _) => (Color32::TRANSPARENT, t.text_tertiary), + (true, true, false) => (t.accent, t.accent_on), + (true, true, true) => (t.accent_hover, t.accent_on), + (true, false, false) => (Color32::TRANSPARENT, t.text), + (true, false, true) => (t.hover, t.text), }; - let dim = |c: Color32| if enabled { c } else { c.gamma_multiply(0.4) }; - ui.painter().rect_filled(rect, CornerRadius::same(5), dim(fill)); + ui.painter().rect_filled(rect, CornerRadius::same(5), fill); if !primary { ui.painter().rect_stroke(rect, CornerRadius::same(5), Stroke::new(1.0, t.border_strong), StrokeKind::Inside); } - ui.painter().text(rect.center(), Align2::CENTER_CENTER, label, regular(11.0), dim(text)); + ui.painter().text(rect.center(), Align2::CENTER_CENTER, label, regular(11.0), text); resp } diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 766284f1d..2f55709e9 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -165,13 +165,14 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Keyboard navigation: F6 regions, Tab within, focus ring | done | | | Layers panel from the keyboard: arrows, F2 / Cmd+R rename (the row gets the keyboard back), Shift+F10 context menu; 10k-layer lists | done | revealing a layer, expanding, collapsing and arrow keys timed in `cargo xtask bench` | | Reduced motion | done | system setting or preference | -| WCAG AA contrast of secondary and accent text | done | | +| WCAG AA contrast of secondary and accent text | done | disabled and dim text at least 3:1 against panels, fields and selected rows, selected text at least 3:1 on its highlight, in both themes (`theme::tests`, #890) | | Tested with VoiceOver, NVDA, Narrator, Orca | missing | human QA | ## Revision history | Date | Change | Summary | |---|---|---| +| 2026-10-20 | minor | Readable disabled and selected text (#890): the dim text colour (disabled buttons, placeholders, hints) is at least 3:1 against panels, fields and selected rows in both themes (it was 2.1:1 in the light theme), a disabled button is grey with that text instead of fading to 40%, and selected text (renaming a page or layer, any text box) takes the theme's readable green on the highlight (1.4:1 in the dark theme before, now 4.2:1 or more); checked with the colour contrast helper (`theme::tests`). Numbers unchanged | | 2026-10-18 | minor | A rename (layers double-click, F2, File ▸ Rename, a page) selects the whole name in the frame its field first draws, so the first key replaces the name instead of being appended. Checked in the app on Windows over the control channel | | 2026-10-17 | minor | Escape or Enter while the pen draws ends the path and keeps its vector in edit mode with the pen, so the next path is drawn into the same layer (unconnected); another Escape leaves edit mode (#760). Entering edit mode on a layer that already is a vector no longer records an empty undo step. Numbers unchanged | | 2026-10-17 | minor | Text layers keep the platform IME on for every frame of an edit, not only frames with input (an idle frame turned it off and macOS dropped each composition, #747); the candidate window opens at the caret instead of the canvas corner; keys pressed while composing go to the IME | From 5617c9416740163b9251536fecb5951958be5325 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 04:47:15 +0700 Subject: [PATCH 404/817] M1: nudge while measuring; distances follow, handles hide (#894) Alt+arrows were left out of the nudge keys, so with Alt held to measure the arrows did nothing and the distances never changed. The arrows now nudge with Alt held too (Shift: the big step); the hover measurement is recomputed every frame, so the labels follow each nudge. While measuring to another layer the selection's handles and size label hide; both layers keep their outlines. --- ROADMAP.md | 1 + crates/ui-egui/src/canvas.rs | 28 +++++++--- crates/ui-egui/src/lib.rs | 2 + crates/ui-egui/src/measure_nudge_tests.rs | 64 +++++++++++++++++++++++ crates/ui-egui/src/shortcuts.rs | 5 +- docs/ui-parity.md | 3 +- 6 files changed, 92 insertions(+), 11 deletions(-) create mode 100644 crates/ui-egui/src/measure_nudge_tests.rs diff --git a/ROADMAP.md b/ROADMAP.md index 8a587286d..7bb020757 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -316,6 +316,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-20 | minor | Measuring while nudging (#894): with Alt held over another layer, the arrows nudge the selection (Shift: the big step) and the distances follow every nudge (Alt+arrows used to do nothing); while measuring, the selection's handles and size label hide and both layers keep their outlines (`measure_nudge_tests`). Numbers unchanged | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 96bd20bfd..491639869 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -1011,7 +1011,7 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ width_overlay(app, painter, &doc, &ve, zoom); } else if let Some(c) = app.session.vector_edit_box() { let label = format!("{} × {}", fmt((c[1] - c[0]).hypot()), fmt((c[3] - c[0]).hypot())); - size_label = transform_box(app, painter, c.map(|p| app.to_screen(p.x, p.y)), accent(painter), true, 4, label); + size_label = transform_box(app, painter, c.map(|p| app.to_screen(p.x, p.y)), accent(painter), true, 4, Some(label)); } } // Selection. @@ -1035,8 +1035,10 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ // A layer smaller than its handles on screen shows just its outline (they still answer // just outside it). let tiny = figcraft_engine::tools::box_sides_px(&b, zoom).1 < figcraft_engine::tools::SMALL_BOX_PX; + // Measuring to another layer (Alt held) shows just the outlines: no handles or size. + let measuring = app.session.tool.overlay.measure_box.is_some(); // Locked layers (selected in the layers panel) can't be resized: no handles either. - let handles = if sel.iter().any(|i| figcraft_engine::tools::locked_in(&doc, *i)) { + let handles = if measuring || sel.iter().any(|i| figcraft_engine::tools::locked_in(&doc, *i)) { 0 } else if is_line { 2 @@ -1045,9 +1047,11 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ } else { 4 }; - size_label = transform_box(app, painter, b.map(|p| app.to_screen(p.x, p.y)), col, sel.len() > 1, handles, label); - arc_overlay(app, painter, col); - shape_overlay(app, painter, col); + size_label = transform_box(app, painter, b.map(|p| app.to_screen(p.x, p.y)), col, sel.len() > 1, handles, (!measuring).then_some(label)); + if !measuring { + arc_overlay(app, painter, col); + shape_overlay(app, painter, col); + } if app.session.tool.tool == ToolId::Scale { // The point that stays put: the dragged pivot, else the anchor. let pivot = scale @@ -1185,8 +1189,16 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ } /// A transform box (screen corners tl, tr, br, bl): its outline when `outline`, the first `handles` -/// corner handles and, when dimensions are shown, the size `label` under it (its box returned). -fn transform_box(app: &FigApp, painter: &egui::Painter, q: [Pos2; 4], col: Color32, outline: bool, handles: usize, label: String) -> Option { +/// corner handles and, when dimensions are shown, the size `label` (if any) under it (its box returned). +fn transform_box( + app: &FigApp, + painter: &egui::Painter, + q: [Pos2; 4], + col: Color32, + outline: bool, + handles: usize, + label: Option, +) -> Option { if outline { quad(painter, q, stroke(col, 1.0)); } @@ -1195,7 +1207,7 @@ fn transform_box(app: &FigApp, painter: &egui::Painter, q: [Pos2; 4], col: Color painter.rect_filled(r, CornerRadius::same(1), Color32::WHITE); painter.rect_stroke(r, CornerRadius::same(1), stroke(col, 1.0), StrokeKind::Inside); } - if app.session.prefs.show_dimensions { + if let Some(label) = label.filter(|_| app.session.prefs.show_dimensions) { let bottom = q.iter().map(|p| p.y).fold(f32::MIN, f32::max); let cx = q.iter().map(|p| p.x).sum::() / 4.0; return Some(pill(painter, pos2(cx, bottom + 9.0), Align2::CENTER_TOP, label, col)); diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 84aedd6ab..8a42d6ad7 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -147,6 +147,8 @@ mod live_tests; #[cfg(test)] mod live_text_tests; #[cfg(test)] +mod measure_nudge_tests; +#[cfg(test)] mod menu_aim_tests; #[cfg(test)] mod menu_input_tests; diff --git a/crates/ui-egui/src/measure_nudge_tests.rs b/crates/ui-egui/src/measure_nudge_tests.rs new file mode 100644 index 000000000..b4a5a2475 --- /dev/null +++ b/crates/ui-egui/src/measure_nudge_tests.rs @@ -0,0 +1,64 @@ +//! Nudging while measuring (#894), driven through egui headless: with Alt held over another layer +//! the arrows still nudge the selection (Shift: the big step), the distance follows every nudge, +//! and the selection's handles and size label hide while measuring (its outline stays). + +use egui::{Event, Key, Modifiers, Pos2, Shape}; +use figcraft_doc::NodeId; +use figcraft_engine::Session; +use serde_json::json; + +use crate::layers_drag_tests::Ui; +use crate::live_tests::flat; +use crate::present_tests::id; + +fn labels(u: &Ui) -> Vec { + u.app.session.tool.overlay.guides.iter().filter_map(|g| g.label.clone()).collect() +} + +fn top(u: &Ui, i: NodeId) -> f64 { + u.app.session.doc().unwrap().world_bounds(i).unwrap().y0 +} + +/// Press and release `key` with `m` held, then a settled frame (the pointer still over the canvas). +fn press(u: &mut Ui, key: Key, m: Modifiers, at: Pos2) { + let ev = |pressed| Event::Key { key, physical_key: None, pressed, repeat: false, modifiers: m }; + u.frame_with(vec![ev(true), ev(false)], m); + u.frame_with(vec![Event::PointerMoved(at)], m); +} + +/// Whether the frame drew corner handles or a text `label`. +fn drew(shapes: &[Shape], label: &str) -> (bool, bool) { + let handle = shapes.iter().any(|s| matches!(s, Shape::Rect(r) if (r.rect.width() - 8.0).abs() < 0.1 && (r.rect.height() - 8.0).abs() < 0.1)); + let text = shapes.iter().any(|s| matches!(s, Shape::Text(t) if t.galley.text() == label)); + (handle, text) +} + +#[test] +fn arrows_nudge_while_measuring_and_the_distance_follows() { + let mut s = Session::new(); + let upper = id(&s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 100, "height": 40})).unwrap()); + let lower = id(&s.execute("shape.rectangle", &json!({"x": 0, "y": 140, "width": 100, "height": 40})).unwrap()); + s.execute("select.set", &json!({"ids": [lower]})).unwrap(); + let mut u = Ui::new(s); + let over = u.app.to_screen(50.0, 20.0); + let (alt, shift_alt) = (Modifiers { alt: true, ..Modifiers::NONE }, Modifiers { alt: true, shift: true, ..Modifiers::NONE }); + + // Not measuring: the selection shows its handles and size. + let shapes = flat(&u.frame_with(vec![Event::PointerMoved(over)], Modifiers::NONE).shapes); + assert_eq!(drew(&shapes, "100 × 40"), (true, true), "handles and size label show"); + + u.frame_with(vec![Event::PointerMoved(over)], alt); + let shapes = flat(&u.frame_with(vec![Event::PointerMoved(over)], alt).shapes); + assert!(u.app.session.tool.overlay.measure_box.is_some(), "Alt over the other layer measures to it"); + assert!(labels(&u).contains(&"100".to_string()), "the gap: {:?}", labels(&u)); + assert_eq!(drew(&shapes, "100 × 40"), (false, false), "measuring hides the handles and size label"); + + press(&mut u, Key::ArrowUp, alt, over); + assert_eq!(top(&u, lower), 139.0, "Alt+Up nudges by the small step"); + assert!(labels(&u).contains(&"99".to_string()), "the gap follows the nudge: {:?}", labels(&u)); + + press(&mut u, Key::ArrowUp, shift_alt, over); + assert_eq!(top(&u, lower), 129.0, "Shift+Alt+Up nudges by the big step"); + assert!(labels(&u).contains(&"89".to_string()), "the gap follows the big nudge: {:?}", labels(&u)); + assert_eq!(top(&u, upper), 0.0, "the measured layer stays put"); +} diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index f31979600..c86cfdf16 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -279,7 +279,8 @@ fn key_event(app: &mut FigApp, key: Key, physical: Option, m: Modifiers, re if app.ui.layers_focus && !m.command && !m.alt && crate::layers::key_nav(app, key, m.shift) { return true; } - // Arrow nudges; with nothing selected the arrows pan the view. + // Arrow nudges, Alt held too (measuring stays on while the selection moves); with nothing + // selected the arrows pan the view. let (dx, dy) = match key { Key::ArrowLeft => (-1.0, 0.0), Key::ArrowRight => (1.0, 0.0), @@ -287,7 +288,7 @@ fn key_event(app: &mut FigApp, key: Key, physical: Option, m: Modifiers, re Key::ArrowDown => (0.0, 1.0), _ => (0.0, 0.0), }; - if (dx, dy) != (0.0, 0.0) && !m.alt { + if (dx, dy) != (0.0, 0.0) { if app.session.selection().is_empty() { app.run("view.pan", json!({"dx": dx, "dy": dy, "big": m.shift})); } else if m.command { diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 766284f1d..5b45eeb3b 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -64,7 +64,7 @@ interaction feel not yet compared. | 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`; thresholds not yet compared with Figma's | | Ctrl to suspend snapping while dragging (macOS) | done | Control on macOS (Cmd keeps working), Ctrl elsewhere; moving, resizing and drawing | -| Measure (Alt hover, Cmd+Alt nested, Shift+Alt padding/gaps) | done | labels never overlap | +| Measure (Alt hover, Cmd+Alt nested, Shift+Alt padding/gaps) | done | labels never overlap; the arrows still nudge while measuring (Shift: the big step) and the distances follow; the selection's handles and size label hide while measuring (`measure_nudge_tests`, #894) | | Pixel grid snapping, pixel preview, 2x preview | done | moves, resizes and new shapes land on whole pixels; the pixel grid shows from 400% (`view_behaviour_tests`) | | Numeric fields: arithmetic, scrubbing by dragging the label, mixed values | done | Numeric panels use `widgets::number_field`; Typography line height, letter spacing and paragraph spacing share its leading-icon scrub logic (#373), retaining their existing unit parsing, Auto/Mixed values, variable chips and selected-character targeting (`typography_scrub_tests`). Scrubbing the label: a step a point (1 px; 1% of opacity, 1° of rotation), ten with Shift, a tenth with Alt, each stretch at the rate held while it was dragged, one undo step when let go; past the edge of the screen it goes on where the platform reports the mouse's own motion (desktop), otherwise it stops there. Arrow keys: Up/Down step a pixel field by the small nudge and Shift by the big nudge (the preferences), other fields by their own step and ten of it; they work while typing (from what is typed) and with the keyboard on the field. Typing: `+ - * /`, brackets, units (`px`, `°`, `%`, `x`, `ms`), a decimal comma; `+10`, `*2`, `/4` are relative to the value, and `50%`, `+10%`, `-10%` too in a field that isn't a percentage. Enter, Tab or a click elsewhere commits (Tab and Shift+Tab move to the next and previous control), Escape restores; a field left as it was commits nothing (no undo step, and a rounded display isn't written back). Mixed values show "Mixed": a number sets them all, a relative edit or an arrow key goes to each layer from its own value in one undo step, for X, Y, W, H, rotation, opacity, corner radius and stroke weight (elsewhere `+10` on Mixed sets 10 and `*2` does nothing) (`field_tests`). Left: scrubbing a Mixed field (nothing happens), `x2`-style suffix edits, the pointer isn't wrapped to the other side of the screen; rates not compared with Figma's | | Transform box at small sizes | done | a press inside a layer smaller than its handles moves it, the nearest handle wins, handles answer just outside and are hidden under 16 px on screen; cursors follow each handle and the box's rotation | @@ -172,6 +172,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| +| 2026-10-20 | minor | Measuring while nudging (#894): with Alt held over another layer, the arrows nudge the selection (Shift: the big step) and the distances follow every nudge (Alt+arrows used to do nothing); while measuring, the selection's handles and size label hide and both layers keep their outlines (`measure_nudge_tests`). Numbers unchanged | | 2026-10-18 | minor | A rename (layers double-click, F2, File ▸ Rename, a page) selects the whole name in the frame its field first draws, so the first key replaces the name instead of being appended. Checked in the app on Windows over the control channel | | 2026-10-17 | minor | Escape or Enter while the pen draws ends the path and keeps its vector in edit mode with the pen, so the next path is drawn into the same layer (unconnected); another Escape leaves edit mode (#760). Entering edit mode on a layer that already is a vector no longer records an empty undo step. Numbers unchanged | | 2026-10-17 | minor | Text layers keep the platform IME on for every frame of an edit, not only frames with input (an idle frame turned it off and macOS dropped each composition, #747); the candidate window opens at the caret instead of the canvas corner; keys pressed while composing go to the IME | From 05da6b21259dc13271fc5e576e1e9deab685ecf2 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 04:54:29 +0700 Subject: [PATCH 405/817] M1: node.get reports layer data (pluginData) (#879) Layer data written with node.set {props: {pluginData}} was saved but no command read it back. node.get (the command, the control method and MCP get_node) and document.inspect now report pluginData as {key: value} when a layer or page has any, so a tool keeping state in a file can read it on its next run. Widget keys are included: the plugin rules only stop plugins writing them, and widget.list already reports that state. --- ROADMAP.md | 1 + crates/engine/src/inspect.rs | 4 ++++ crates/engine/src/lib.rs | 2 ++ crates/engine/src/plugin_data_tests.rs | 30 ++++++++++++++++++++++++++ docs/control-protocol.md | 4 +++- docs/mcp.md | 2 +- docs/plugins.md | 4 +++- docs/target-app-parity.md | 3 ++- 8 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 crates/engine/src/plugin_data_tests.rs diff --git a/ROADMAP.md b/ROADMAP.md index 8a587286d..22d49f33c 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -316,6 +316,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-20 | minor | Layer data reads back (#879): `node.get` (the command, the control method and MCP `get_node`) and `document.inspect` report a layer's or page's `pluginData` as `{key: value}` when it has any, so a tool that keeps state in a file with `node.set {props: {pluginData}}` can read it on its next run (`plugin_data_tests`). Numbers unchanged | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | diff --git a/crates/engine/src/inspect.rs b/crates/engine/src/inspect.rs index 88bc015ad..a6973f013 100644 --- a/crates/engine/src/inspect.rs +++ b/crates/engine/src/inspect.rs @@ -165,6 +165,10 @@ pub fn node_json(doc: &Document, id: NodeId, depth: usize) -> Value { o.insert("operandOperation".into(), json!(op)); } } + // Layer data written with `node.set {props: {pluginData}}` (pages too). + if !n.plugin_data.is_empty() { + o.insert("pluginData".into(), json!(n.plugin_data)); + } match &n.kind { NodeKind::Text(t) => { o.insert("characters".into(), json!(t.characters)); diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index f55bc1db0..0871eebf4 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1775,6 +1775,8 @@ mod pixel_preview_tests; #[cfg(test)] mod playground_tests; #[cfg(test)] +mod plugin_data_tests; +#[cfg(test)] mod plugin_directory_tests; #[cfg(test)] mod plugin_panels_tests; diff --git a/crates/engine/src/plugin_data_tests.rs b/crates/engine/src/plugin_data_tests.rs new file mode 100644 index 000000000..076786b79 --- /dev/null +++ b/crates/engine/src/plugin_data_tests.rs @@ -0,0 +1,30 @@ +//! Layer data (`pluginData`) reads back through `node.get` and `document.inspect` (#879): what +//! `node.set` writes on a layer or a page comes back as `{key: value}`, a removed key goes, and a +//! layer without any reports none. + +use crate::Session; +use crate::components::tests::{ex, idv}; +use serde_json::json; + +#[test] +fn node_get_reports_the_layer_data_node_set_wrote() { + let mut s = Session::new(); + let f = idv(&ex(&mut s, "frame.create", json!({"x": 0, "y": 0, "width": 100, "height": 100}))); + let r = idv(&ex(&mut s, "shape.rectangle", json!({"x": 0, "y": 0, "width": 10, "height": 10}))); + let page = s.ds().unwrap().page; + assert!(ex(&mut s, "node.get", json!({"id": f})).get("pluginData").is_none(), "no data, no field"); + ex(&mut s, "node.set", json!({"ids": [f], "props": {"pluginData": {"com.example.sync": "{\"v\":1}", "n": 2}}})); + ex(&mut s, "node.set", json!({"ids": [page], "props": {"pluginData": {"com.example.sync": "page"}}})); + let got = ex(&mut s, "node.get", json!({"id": f}))["pluginData"].clone(); + assert_eq!(got, json!({"com.example.sync": "{\"v\":1}", "n": "2"}), "values read back as the strings stored"); + assert_eq!(ex(&mut s, "node.get", json!({"id": page}))["pluginData"], json!({"com.example.sync": "page"}), "pages keep data too"); + assert!(ex(&mut s, "node.get", json!({"id": r})).get("pluginData").is_none(), "other layers report none"); + // The document tree reports it as well (the page and its children). + let tree = crate::inspect::document(&s, 2, false); + assert_eq!(tree["pages"][0]["pluginData"], json!({"com.example.sync": "page"})); + // A null removes a key; undo brings it back. + ex(&mut s, "node.set", json!({"ids": [f], "props": {"pluginData": {"n": null}}})); + assert_eq!(ex(&mut s, "node.get", json!({"id": f}))["pluginData"], json!({"com.example.sync": "{\"v\":1}"})); + ex(&mut s, "edit.undo", json!({})); + assert_eq!(ex(&mut s, "node.get", json!({"id": f}))["pluginData"]["n"], "2"); +} diff --git a/docs/control-protocol.md b/docs/control-protocol.md index 08c08b085..c9ae53313 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -131,7 +131,9 @@ component/instance links, overrides, `slot` (a slot layer's property name), boun `devStatus` (handoff status), `devChanged` (changed since it was marked ready for dev), `annotations` (Dev Mode notes: `[{label, properties, category?}]`), `codeLinks` (a component's links to code: `[{language, importPath, name, template}]`), `devResources` (links for developers, -its own and inherited: `[{name, url, index?, from?}]`). The auto layout props +its own and inherited: `[{name, url, index?, from?}]`), `pluginData` (layer data written with +`node.set {props: {pluginData: {key: value}}}`, pages included: `{key: value}`, values as strings; +only when there is some). The auto layout props that `node.set` accepts are listed in [mcp.md](mcp.md#conventions-agents-must-know). ### `ui.inspect {}` diff --git a/docs/mcp.md b/docs/mcp.md index ca41cc33c..dfea95cc2 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -299,7 +299,7 @@ Or in a project's `.mcp.json`: | `create_node {type, x, y, width, height, parent, index, name, text, path, props}` | Create a frame, rectangle, ellipse, polygon, star, line, arrow, text, vector, section, component or slice; returns `{id, node}`. | | `set_properties {ids, props}` | `node.set` on layers (geometry, fills, strokes, effects, corner radius, auto layout, sizing, constraints, masks (`isMask`, `maskType: alpha\|vector\|luminance`), handoff status (`devStatus: none\|readyForDev\|completed`; marking again clears "Changed"), a section's `sectionContentsHidden`, text…); returns the updated layers. | | `inspect_document {depth, allPages}` | The document as JSON (layer tree, styles, selection, history). | -| `get_node {id, depth}` | One layer as JSON. | +| `get_node {id, depth}` | One layer as JSON; `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?}` | png, jpg, svg, webp, pdf, or `fig`: the whole file as `.fig`, experimental (see Exporting `.fig` files below); `size` is `2x`, `512w` or `512h`. 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); `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. 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. 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. | diff --git a/docs/plugins.md b/docs/plugins.md index 5867bd25c..9b1a8f4ef 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -460,4 +460,6 @@ import what you need from `figcraft`. vectors, components or variables). - Panels: no images, sliders or free layout inside a panel. - Data in the document: plugins keep data on layers (pages included) with `node.set {props: - {pluginData: {key: value}}}`; there is no separate per-document store. + {pluginData: {key: value}}}` (a `null` value removes a key) and read it back with `node.get`, which + reports `pluginData: {key: value}` (values as strings) when a layer has any; there is no separate + per-document store. diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 16a5af69b..a1a5bf128 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -111,7 +111,7 @@ Breadth: does it exist. Ready: depth, correctness and fidelity for real projects | 15 | Dev Mode / inspect | 2 | 96% | 72% | Import lines for connected instances inside generated layer trees; an editor extension is left to the MCP server (inspect behaviour suite with colour formats, rem and icon and image assets, code connect, plugins in Dev Mode and dev resources links landed) ([dev-mode-parity](dev-mode-parity.md)) | 0–1 | | 16 | Comments, versions, find, misc | 3 | 87% | 63% | Comments are local only; comparing two versions; branches in live sessions; text runs and other lists besides fills, strokes and effects merge whole (branches with review and merge, their own version history and per-item list merges, and a comments and version history behaviour suite from the documentation landed) | 1–3 | | 17 | Multiplayer & sharing | 8 | 17% | 5% | Core landed (`crates/collab`: ids, change sets, server ordering, convergence tested); live sessions (preview): WebSocket transport, hosting from the desktop app, joining from the app or the browser, invite links that open the app, cursors, selections and follow, cursor chat and spotlight, per-person undo, offline resume; a self-hosted `figcraft-server` with persistence and share links to edit or view, which can be open to the public (owner tokens, limits per address, expiry, moderation). Left: accounts and teams, audio ([collaboration-parity](collaboration-parity.md)) | 42–84 | -| 18 | Plugins & widgets | 4 | 60% | 35% | Own sandboxed WASM plugins landed (#101: manifest, permissions, menu, Run last, Manage, SDK), with log byte/count limits checked before allocation and host forwarding ([logging limits](plugins.md#logging-limits)), plugin panels called back per button or changed value and per-plugin settings (ABI v2), then widgets (API 3: plugin-drawn layers on the canvas with state kept in the document, redrawn on clicks; a Counter example), panels side by side and a colour picker for plugin colour fields, then a plugin directory on `figcraft-server` (publish with the server key, browse, install after a permissions confirmation, hash-checked downloads, updates by version). Left: a public catalogue, publisher accounts and signatures, ratings, background update checks, the directory in the browser; widgets take clicks only (no text input, property menus, hover or timers) and draw frames, text, shapes and images only; Figma's plugins are JavaScript and don't run (a JS engine would be an owner decision) ([plugins.md](plugins.md)) | 8–26 | +| 18 | Plugins & widgets | 4 | 60% | 35% | Own sandboxed WASM plugins landed (#101: manifest, permissions, menu, Run last, Manage, SDK), with log byte/count limits checked before allocation and host forwarding ([logging limits](plugins.md#logging-limits)), plugin panels called back per button or changed value and per-plugin settings (ABI v2), then widgets (API 3: plugin-drawn layers on the canvas with state kept in the document, redrawn on clicks; a Counter example), panels side by side and a colour picker for plugin colour fields, then a plugin directory on `figcraft-server` (publish with the server key, browse, install after a permissions confirmation, hash-checked downloads, updates by version); layer data written with `node.set {props: {pluginData}}` reads back through `node.get` (#879). Left: a public catalogue, publisher accounts and signatures, ratings, background update checks, the directory in the browser; widgets take clicks only (no text input, property menus, hover or timers) and draw frames, text, shapes and images only; Figma's plugins are JavaScript and don't run (a JS engine would be an owner decision) ([plugins.md](plugins.md)) | 8–26 | | 19 | Team libraries & organization | 2 | 70% | 40% | Libraries kept on `figcraft-server` under their file and enabled by a share link (per-asset versions, background update checks, overrides kept), usage counts per component and file, swapping a library by names. Left: team-wide library lists, accounts and permissions, analytics over time, pushed update notices | 4–8 | | 20 | Figma Draw extras | 2 | 88% | 60% | Have: variable width, lasso, shape builder, noise/texture, text on a path, pattern fills, stretch and scatter brushes, pen pressure (Windows pens, browser styluses), multi-edit (several vector layers in edit mode at once). Missing: pressure from macOS/Linux tablets | 1–3 | | 21 | AI features | 3 | 0% | 0% | First draft, rename layers, image edit/remove background, visual search, Make: needs local models (owner decision) | 30–60 | @@ -638,6 +638,7 @@ Carried over from the ROADMAP's "Shipped so far" (2026-10-10). The test count th | Date | Change | Summary | |---|---|---| +| 2026-10-20 | minor | Layer data reads back (#879): `node.get` (the command, the control method and MCP `get_node`) and `document.inspect` report a layer's or page's `pluginData` as `{key: value}` when it has any, so a tool that keeps state in a file with `node.set {props: {pluginData}}` can read it on its next run (`plugin_data_tests`). Numbers unchanged | | 2026-10-17 | minor | Menu breadth re-run with `cargo xtask parity`: 212 / 212 (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Rows for the 2026-10-17 landings: import/export (area 14) and the file formats dimension name the `.fig` import's new fidelity (instance identity, overrides by key, text style precedence, grid tracks, slots, connector labels, per-point joins, text on a path, image adjustments, list start numbers, vertical trim), budgets from the file's size, the import report, a `.fig` copy from Save as and paste from another design app; the localization evidence takes the re-measured catalog counts (2,272 entries, drafts at 95–99%, Indonesian and Czech drafts, Swedish and Turkish catalogs); the Automation line adds control requests answered while the window is minimised (#720); batch #753's Selection colors, smart-selection spacing, Present tab and auto layout on empty frames are in ui-parity, prototyping-parity and auto-layout-parity. Numbers unchanged: every `.fig` and paste change is checked on synthetic files or clipboard HTML made from our own export, and real files are what gap 1's blocker and the file-exchange discounts wait for; the UI changes (menus, the Actions palette, editor fixes) are not compared side by side, so UI/UX stays at 58%; the localization grade and hours stay (Indonesian's draft is offset by the drafts' new gaps) | | 2026-10-17 | minor | Automation roots (M8, #715, #481): `figcraft-cli mcp --automation-read-root DIR --automation-write-root DIR` (each repeatable, existing folders) and the desktop app with the same flags confine every file a command reads to the read and write roots and every file it writes to the write roots; paths are resolved (links followed, `..`, Windows `\\?\` and UNC paths, case) and compared by whole folder names, anything else is an ordinary error. The engine reaches the file system through one module (enforced by `crates/engine/clippy.toml`), and a sweep runs every command with paths outside the roots. `--attach` refuses the flags (the app confines itself); `ui.screenshot` and `ui.render` return PNG data without a `path`, so the attached MCP server writes no temporary files. Numbers unchanged. | | 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | From bae2f057a17ce06a8cf09fd3e1cbc3d60b4a556e Mon Sep 17 00:00:00 2001 From: Davit Matchakhelidze Date: Tue, 20 Oct 2026 02:11:55 +0400 Subject: [PATCH 406/817] i18n(ka): the catalog header and docs say how Georgian was made (AI-assisted, native-reviewed); still a draft Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YMTAbGNRxnMEzRvYnQGphF --- crates/ui-egui/locales/ka.toml | 8 +++++--- docs/translating.md | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/locales/ka.toml b/crates/ui-egui/locales/ka.toml index 10d0c8e73..1c9d5ad8b 100644 --- a/crates/ui-egui/locales/ka.toml +++ b/crates/ui-egui/locales/ka.toml @@ -1,8 +1,10 @@ # FigCraft interface strings: Georgian. # -# Draft — needs native review: machine-drafted from the English catalog. Brand names and keyboard -# glyphs stay as they are. Georgian has no letter case, and a noun after a numeral stays singular, so -# counts read "შრე: {n}" and plural entries give the same text for one and other. See docs/translating.md. +# Written with AI assistance (Claude) from the meaning of each English string, following the glossary +# the Craft apps share, and reviewed by a native Georgian speaker; kept as a draft until a maintainer +# changes its status. Brand names and keyboard glyphs stay as they are. Georgian has no letter case, +# and a noun after a numeral stays singular, so counts read "შრე: {n}" and plural entries give the +# same text for one and other. See docs/translating.md. [meta] name = "ქართული" diff --git a/docs/translating.md b/docs/translating.md index 04d9906b2..0c011fa36 100644 --- a/docs/translating.md +++ b/docs/translating.md @@ -17,7 +17,9 @@ Simplified. The catalogs: English (`en`, the source), and Spanish (`es`, with the Latin American overlay `es-419`), French (`fr`), German (`de`), Dutch (`nl`), Brazilian Portuguese (`pt-BR`), Japanese (`ja`), Korean (`ko`), Simplified Chinese (`zh-Hans`), Czech (`cs`), Indonesian (`id`), Finnish -(`fi`), Polish (`pl`), Georgian (`ka`) and Bengali (`bn`), machine-drafted and waiting for native speakers' review. Russian (`ru`, Русский) was +(`fi`), Polish (`pl`) and Bengali (`bn`), machine-drafted and waiting for native speakers' review. Georgian +(`ka`) was written with AI assistance and reviewed by a native speaker, and stays a draft until a +maintainer changes its status. Russian (`ru`, Русский) was reviewed and approved by VanTan; its catalog keeps Frame, Dev Mode 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. From e123a2efe76fe5d80c2bc408461e5a079d3a587c Mon Sep 17 00:00:00 2001 From: Davit Matchakhelidze Date: Tue, 20 Oct 2026 02:33:25 +0400 Subject: [PATCH 407/817] i18n(ka): the draft status says the review is done and approval pending; the guide and the field doc say both kinds of draft Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YMTAbGNRxnMEzRvYnQGphF --- crates/ui-egui/locales/ka.toml | 2 +- crates/ui-egui/src/i18n.rs | 3 ++- docs/translating.md | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/locales/ka.toml b/crates/ui-egui/locales/ka.toml index 1c9d5ad8b..5b73b4fbc 100644 --- a/crates/ui-egui/locales/ka.toml +++ b/crates/ui-egui/locales/ka.toml @@ -8,7 +8,7 @@ [meta] name = "ქართული" -status = "draft — needs native review" +status = "draft — reviewed by a native speaker, awaiting a maintainer's approval" [ui] "% of all commits" = "ყველა კომიტის %" diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs index 98bc3d8f7..9faff0016 100644 --- a/crates/ui-egui/src/i18n.rs +++ b/crates/ui-egui/src/i18n.rs @@ -27,7 +27,8 @@ pub struct Lang { pub code: &'static str, /// The language's own name for itself (the language picker shows it untranslated). pub name: &'static str, - /// Machine-drafted, waiting for a native speaker's review (`[meta] status`). + /// A draft (`[meta] status` set): waiting for a native speaker's review, or reviewed and waiting for + /// a maintainer's approval. pub draft: bool, /// Index into [`LANGS`] of the catalog a regional one overlays ("es" under "es-419": it lists /// only what differs), else 0 (English). diff --git a/docs/translating.md b/docs/translating.md index 0c011fa36..eaa59755b 100644 --- a/docs/translating.md +++ b/docs/translating.md @@ -108,7 +108,7 @@ picker leaves Georgian out. A new CJK or other non-Latin language also needs its The check fails on keys the code uses that `en.toml` lacks (it prints the lines to paste), keys no code uses, unknown command ids, placeholders that don't match English, and, for complete languages, anything untranslated. Machine-drafted catalogs stay marked as drafts until a native speaker has -reviewed them. +reviewed them; a reviewed catalog stays a draft until a maintainer approves it (its `status` says which). ## Adding strings in code From b82369201dec672737e6f09b15ffa2ae76d0b31b Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 05:44:46 +0700 Subject: [PATCH 408/817] M3: duplicating a main component makes an instance (#892) Duplicate and Alt-drag copied a main component as a second main. Within its file the copy is now an instance of it (components::copy_in_file, shared by edit.duplicate and the Alt-drag copy), as Copy then Paste already was. A variant duplicated in its set stays a new variant. --- ROADMAP.md | 1 + crates/engine/src/cmd/edit.rs | 15 +++-- crates/engine/src/components.rs | 15 +++++ .../engine/src/components_behaviour_tests.rs | 61 +++++++++++++++++++ crates/engine/src/tools.rs | 2 +- docs/components-parity.md | 4 +- 6 files changed, 92 insertions(+), 6 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 224bf7af6..0f643f532 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -316,6 +316,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-20 | minor | Duplicating a main component makes an instance (#892): Duplicate and Alt-drag copied a main component as a second main; within its file the copy is now an instance of it, as Copy then Paste already was (a variant duplicated in its set stays a variant). Numbers unchanged. | | 2026-10-20 | minor | Release fonts (#885): the web release embeds craft-fonts again (Inter), so the browser version draws text and lists fonts; it had none since releases moved to the shared workflow. The craft-fonts pin goes back to the commit with the Latin manifest (the Georgian change had moved it to one without Inter, which would have failed the next release). Numbers unchanged. | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index 7d107d0c3..a16fbb386 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -18,13 +18,19 @@ pub fn specs() -> Vec { spec!( "edit.duplicate", "Duplicate", - "{ids?, dx?, dy? (page offset; default: the offset of the last duplicate when ids are its copies, still selected; else top-level frames to the right with a 100 gap, everything else in place)}", + "{ids?, dx?, dy? (page offset; default: the offset of the last duplicate when ids are its copies, still selected; else top-level frames to the right with a 100 gap, everything else in place)} a main component's copy is an instance of it (a variant stays a new variant in its set)", true, duplicate ), spec!("edit.copy", "Copy", "{ids?}", false, copy), spec!("edit.cut", "Cut", "{ids?}", true, cut), - spec!("edit.paste", "Paste", "{parent?, x?, y? (page coordinates of the pasted top-left)}", true, paste), + 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)", + true, + paste + ), spec!( "edit.pasteDesignLayers", "Paste design layers", @@ -466,7 +472,7 @@ fn duplicate(s: &mut Session, p: &Value) -> Result { let top_frame = doc.node(parent).is_some_and(Node::is_page) && n.kind.is_frame_like(); let idx = doc.index_in_parent(i).map(|x| x + 1); let w = n.width; - let nid = doc.duplicate_into(i, parent, idx)?; + let nid = crate::components::copy_in_file(doc, i, parent, idx)?; let (dx, dy) = match (num(p, "dx"), num(p, "dy")) { (Some(dx), dy) => (dx, dy.unwrap_or(0.0)), (None, Some(dy)) => (0.0, dy), @@ -481,7 +487,8 @@ fn duplicate(s: &mut Session, p: &Value) -> Result { nn.transform = Affine::translate((dx, dy)) * nn.transform; } } - if rename { + // An instance keeps the name instances get by default. + if rename && !matches!(doc.get(nid)?.kind, NodeKind::Instance { .. }) { let nn = doc.get_mut(nid)?; nn.name = bump_name(&nn.name); } diff --git a/crates/engine/src/components.rs b/crates/engine/src/components.rs index ea67bb07c..67259d030 100644 --- a/crates/engine/src/components.rs +++ b/crates/engine/src/components.rs @@ -292,6 +292,21 @@ pub fn create_instance_at(doc: &mut Document, component: NodeId, parent: NodeId, Ok(id) } +/// Copy `id` within its own file under `parent` (at `index`), keeping its local transform. A file +/// has one main per component, so a main component's copy is an instance of it; a variant copied +/// into its set stays a new variant, and every other layer is deep-copied. +pub fn copy_in_file(doc: &mut Document, id: NodeId, parent: NodeId, index: Option) -> Result { + let n = doc.get(id)?; + let in_set = doc.node(parent).is_some_and(|p| matches!(p.kind, NodeKind::ComponentSet { .. })); + if !matches!(n.kind, NodeKind::Component { .. }) || in_set { + return doc.duplicate_into(id, parent, index); + } + let transform = n.transform; + let instance = create_instance_at(doc, id, parent, 0.0, 0.0, index)?; + doc.get_mut(instance)?.transform = transform; + Ok(instance) +} + /// Which part of the carried overrides to apply. #[derive(Clone, Copy, PartialEq)] enum Carry { diff --git a/crates/engine/src/components_behaviour_tests.rs b/crates/engine/src/components_behaviour_tests.rs index e068c6cff..ff78f73b5 100644 --- a/crates/engine/src/components_behaviour_tests.rs +++ b/crates/engine/src/components_behaviour_tests.rs @@ -194,6 +194,67 @@ fn pasted_component_instances_keep_the_copied_transform_in_the_target_frame() { healthy(&s); } +#[test] +fn duplicating_a_main_component_makes_a_linked_instance() { + for rename in [false, true] { + let mut s = Session::new(); + ex(&mut s, "pref.renameDuplicates", json!({"on": rename})); + let k = kit(&mut s); + let rect = idv(&ex(&mut s, "shape.rectangle", json!({"x": 0, "y": 300, "width": 50, "height": 50, "props": {"name": "Box"}}))); + let before = s.doc().unwrap().clone(); + let out = ex(&mut s, "edit.duplicate", json!({"ids": [k.card, rect]})); + let ids: Vec = out["ids"].as_array().unwrap().iter().filter_map(crate::params::id_of).collect(); + assert_eq!(s.selection(), ids); + let copy = *ids.iter().find(|i| matches!(node(&s, **i).kind, NodeKind::Instance { .. })).expect("the main's copy is an instance"); + assert_eq!(component_of(&s, copy), k.card); + assert_eq!(node(&s, copy).name, "Card", "instances keep their default name (rename={rename})"); + assert_eq!(node(&s, copy).parent, Some(s.page().unwrap())); + let (b, c) = (s.doc().unwrap().world_bounds(k.card).unwrap(), s.doc().unwrap().world_bounds(copy).unwrap()); + assert_eq!((c.x0, c.y0, c.width(), c.height()), (b.x1 + 100.0, b.y0, b.width(), b.height()), "a top-level frame's offset"); + let other = *ids.iter().find(|i| **i != copy).unwrap(); + assert!(matches!(node(&s, other).kind, NodeKind::Rectangle), "other layers are still copied"); + ex(&mut s, "node.set", json!({"id": k.title, "props": {"characters": "Updated"}})); + assert_eq!(chars(&s, copy_of(&s, copy, k.title)), "Updated", "the instance follows its main"); + ex(&mut s, "edit.undo", json!({})); + ex(&mut s, "edit.undo", json!({})); + assert_eq!(*s.doc().unwrap(), before, "undo restores exactly"); + healthy(&s); + } +} + +#[test] +fn alt_dragging_a_main_component_copies_an_instance() { + use crate::tools::{PointerEvent, PointerKind}; + let mut s = Session::new(); + let f = idv(&ex(&mut s, "frame.create", json!({"x": 0, "y": 0, "width": 100, "height": 100, "name": "Tile"}))); + let main = idv(&ex(&mut s, "component.create", json!({"ids": [f]}))); + let ev = |kind, x| PointerEvent { alt: true, ..PointerEvent::at(kind, x, 50.0, 1.0) }; + s.pointer(&ev(PointerKind::Down, 50.0)).unwrap(); + s.pointer(&ev(PointerKind::Move, 150.0)).unwrap(); + s.pointer(&ev(PointerKind::Move, 250.0)).unwrap(); + s.pointer(&ev(PointerKind::Up, 250.0)).unwrap(); + let [copy] = s.selection()[..] else { panic!("one copy selected") }; + assert_eq!(component_of(&s, copy), main); + assert_eq!(s.doc().unwrap().world_bounds(copy).unwrap().x0, 200.0); + assert_eq!(s.doc().unwrap().world_bounds(main).unwrap().x0, 0.0, "the main stays"); + healthy(&s); +} + +#[test] +fn duplicating_a_variant_adds_a_variant_to_its_set() { + let mut s = Session::new(); + let (set, _, hover) = button_set(&mut s); + let copy = crate::params::id_of(&ex(&mut s, "edit.duplicate", json!({"ids": [hover]}))["ids"][0]).unwrap(); + assert!(matches!(node(&s, copy).kind, NodeKind::Component { .. })); + assert_eq!(node(&s, copy).parent, Some(set)); + assert_eq!(kids(&s, set).len(), 3); + // A whole set duplicates as a new set of variants. + let set2 = crate::params::id_of(&ex(&mut s, "edit.duplicate", json!({"ids": [set]}))["ids"][0]).unwrap(); + assert!(matches!(node(&s, set2).kind, NodeKind::ComponentSet { .. })); + assert!(kids(&s, set2).iter().all(|v| matches!(node(&s, *v).kind, NodeKind::Component { .. }))); + healthy(&s); +} + #[test] fn overridable_properties_stay_through_main_edits_and_reset() { // (what, layer, group, override on the instance, the same property edited on the main, read, diff --git a/crates/engine/src/tools.rs b/crates/engine/src/tools.rs index ad4d78d85..f0115e1f5 100644 --- a/crates/engine/src/tools.rs +++ b/crates/engine/src/tools.rs @@ -1300,7 +1300,7 @@ impl Session { for i in &ids { let parent = doc.get(*i)?.parent.unwrap_or(page); let idx = doc.index_in_parent(*i).map(|x| x + 1); - copies.push(doc.duplicate_into(*i, parent, idx)?); + copies.push(crate::components::copy_in_file(doc, *i, parent, idx)?); } moving = copies; *sel = moving.clone(); diff --git a/docs/components-parity.md b/docs/components-parity.md index 46bc0fab6..dcd93305f 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-10-18 · **Change:** minor (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-10-20 · **Change:** minor (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 @@ -17,6 +17,7 @@ accounts). | 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; the instance itself resizes and its layers follow the main's constraints | | Component sets / variants, add variant, switch | done | | +| A main's copy within its file is an instance of it: Duplicate, Alt-drag, Copy then Paste | done | a variant duplicated in its set stays a new variant and a whole set copies as a new set; only the copied roots become instances (a main inside a copied frame is copied as a main); Cut then Paste and pastes into other files keep the component (#892) | | 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}` | @@ -76,6 +77,7 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`. | Date | Change | Summary | |---|---|---| +| 2026-10-20 | minor | A main component's copy within its file is an instance of it (#892): Duplicate (`edit.duplicate`) and Alt-drag on the canvas made a second main; they now place an instance where the copy went (same offset, the instance's default name, selected), as Copy then Paste already did. A variant duplicated in its set stays a new variant. | | 2026-10-18 | minor | A bound colour variable's alpha applies once (#802): a `#RRGGBBAA` paint keeps its alpha in the paint opacity, and binding a variable with alpha left that opacity in place, so a 50% fill bound to a 50% variable drew at 25%. Binding (`variable.bind`, `node.set` `boundVariables`, `style.bind`) now restarts the paint's opacity at 100% and unbinding (also deleting the variable) moves the colour's alpha back into the opacity; `.fig` and REST imports take the variable's alpha back out of a bound paint's opacity, so `.fig` round trips no longer square it. Colour-picker edits of a colour variable or a plugin colour field, generated CSS strokes and the document colours list counted the paint opacity twice and now count it once (`bound_alpha_tests`). Numbers unchanged | | 2026-10-18 | minor | Variables import (#790): a `variables` map outside `meta` (or `meta.variables` next to top-level collections) is read, and an import that finds no variables, or fewer than the collections' `variableIds` list, says so in `warnings` instead of succeeding silently | | 2026-10-17 | minor | Variant properties reorder by dragging them in the Properties section, one undo step (#679; was "no drag in the panel yet"); a library file saved again right after it was read is read again, so a quick republish isn't missed (#652); the Hidden from publishing row no longer says the Hide when publishing item is missing (it landed 2026-10-12). Numbers unchanged | From 77ffc57432e8f8f419901a8309375747e35c84c7 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 20 Oct 2026 05:47:15 +0700 Subject: [PATCH 409/817] #896: "Individual padding" uses the catalog's word for padding (Preenchimento is Fill) --- crates/ui-egui/locales/pt-BR.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index ff720a491..d8f857e0f 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -1676,7 +1676,7 @@ status = "draft — needs native review" "Hide when publishing" = "Ocultar ao publicar" "Icon components on a 24 px grid with keylines and a size preview" = "Componentes de ícone em uma grade de 24 px, com linhas-guia e prévia de tamanho" "Icon set starter" = "Ponto de partida para conjunto de ícones" -"Individual padding" = "Preenchimento individual" +"Individual padding" = "Espaçamento interno individual" "Interface size" = "Tamanho da interface" "Jan" = "jan." "Jul" = "jul." From eb7ead94555c338cbd97ea7a530c228ea61854a2 Mon Sep 17 00:00:00 2001 From: sanches Date: Tue, 20 Oct 2026 01:59:51 +0300 Subject: [PATCH 410/817] M9: Russian catalog catch-up: the 56 strings added since the review (machine-drafted) --- crates/ui-egui/locales/ru.toml | 57 ++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 6dd68a170..6e173a925 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -1,5 +1,6 @@ # FigCraft interface strings: Russian. # Wording reviewed and approved by VanTan. +# Strings added since that review (2026-10-20) are a machine draft awaiting review. # Keep Frame, Dev Mode and Smart animate as familiar tool names. # See docs/translating.md; plural forms follow Russian integer rules. @@ -16,6 +17,7 @@ name = "Русский" "@{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 с таким именем уже существует. Чтобы подтвердить замену, выберите его полное имя." +"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 title, an agenda, a big figure, a chart and a closing slide" = "Заголовок, повестка, крупный показатель, диаграмма и заключительный слайд" @@ -65,6 +67,7 @@ name = "Русский" "Add variant with a new value" = "Добавить вариант с новым значением" "Added" = "Добавлено" "Added the library \"{name}\"" = "Добавлена библиотека «{name}»" +"Adding to {name}" = "Добавление в {name}" "Adjust" = "Коррекция" "Adjustment presets" = "Пресеты коррекции" "Advanced" = "Дополнительно" @@ -88,6 +91,7 @@ name = "Русский" "All components" = "Все компоненты" "All fonts" = "Все шрифты" "All supported properties" = "Все поддерживаемые свойства" +"All the fonts this file uses are installed" = "Все шрифты, которые использует этот файл, установлены" "All variables" = "Все переменные" "Alpha" = "Альфа" "Alphabetical" = "По алфавиту" @@ -168,6 +172,7 @@ name = "Русский" "Both directions" = "Оба направления" "Bottom" = "Снизу" "Bottom left radius" = "Радиус нижнего левого угла" +"Bottom padding" = "Нижний внутренний отступ" "Bottom right radius" = "Радиус нижнего правого угла" "Branch" = "Ветка" "Branch archived" = "Ветка архивирована" @@ -194,6 +199,7 @@ name = "Русский" "C or ⇧C" = "C или ⇧C" "CMYK colour" = "Цвет CMYK" "Can view" = "Может просматривать" +"Checking the fonts installed on this computer…" = "Проверка шрифтов, установленных на этом компьютере…" "Checking the server…" = "Проверка сервера…" "Clear from this list" = "Убрать из этого списка" "Code or invite link" = "Код или ссылка приглашения" @@ -293,6 +299,8 @@ name = "Русский" "Contributors" = "Участники" "Contributors: {people} · Commits: {commits}" = "Участники: {people} · Коммиты: {commits}" "Controller" = "Контроллер" +"Convert to frame" = "Преобразовать во Frame" +"Convert to section" = "Преобразовать в секцию" "Cool" = "Холодный" "Copied as CSS" = "Скопировано как CSS" "Copied as PNG" = "Скопировано как PNG" @@ -310,8 +318,10 @@ name = "Русский" "Copy {value}" = "Копировать {value}" "Corner radius" = "Радиус углов" "Corner smoothing" = "Сглаживание углов" +"Couldn't download the variables" = "Не удалось загрузить переменные" "Couldn't reach {server}: showing what this computer remembers." = "Не удалось связаться с {server}: показаны данные, сохранённые на этом компьютере." "Couldn't read {name}." = "Не удалось прочитать {name}." +"Couldn't save automatically: {error}" = "Не удалось сохранить автоматически: {error}" "Count" = "Количество" "Create" = "Создать" "Create a variable collection first" = "Сначала создайте коллекцию переменных" @@ -407,7 +417,10 @@ name = "Русский" "Draw" = "Рисование" "Draw a frame" = "Нарисовать Frame" "Drawing tools" = "Инструменты рисования" +"Drop a .figcraft, .fig, .json, .svg or image file." = "Перетащите файл .figcraft, .fig, .json, .svg или изображение." "Drop shadow" = "Внешняя тень" +"Drop to import" = "Отпустите, чтобы импортировать" +"Drop to open" = "Отпустите, чтобы открыть" "Dual-licensed MIT OR Apache-2.0. Made by the ArtCraft team and community." = "Двойная лицензия MIT OR Apache-2.0. Создано командой и сообществом ArtCraft." "Duo" = "Дуо" "Duplicate" = "Дублировать" @@ -477,6 +490,7 @@ name = "Русский" "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 пока поддерживает не все возможности этих файлов. В замечаниях перечислено, что было пропущено или изменено в импортированной копии; исходный файл не меняется." "File" = "Файл" "File name" = "Имя файла" @@ -598,6 +612,7 @@ name = "Русский" "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)" = "Игнорировать автолейаут (абсолютная позиция)" "Image" = "Изображение" @@ -619,6 +634,7 @@ name = "Русский" "Included" = "Включено" "Included in layout" = "Участвует в компоновке" "Individual corners" = "Углы по отдельности" +"Individual padding" = "Внутренние отступы по отдельности" "Individual strokes" = "Обводки по отдельности" "Ink" = "Чернила" "Inner shadow" = "Внутренняя тень" @@ -640,6 +656,7 @@ name = "Русский" "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" = "Размер интерфейса" "Intersect" = "Пересечение" "Intersects" = "Пересечения" "Invalid color" = "Недопустимый цвет" @@ -689,6 +706,7 @@ name = "Русский" "Leaves" = "Листья" "Left" = "Слева" "Left & right" = "Слева и справа" +"Left padding" = "Левый внутренний отступ" "Left side" = "Левая сторона" "Left side width" = "Ширина левой стороны" "Letter case" = "Регистр букв" @@ -761,6 +779,7 @@ name = "Русский" "Mirror angle and length" = "Отражать угол и длину" "Mirroring" = "Зеркальность" "Missing" = "Отсутствует" +"Missing fonts" = "Отсутствующие шрифты" "Missing layer" = "Слой отсутствует" "Missing style" = "Стиль отсутствует" "Missing variable" = "Переменная отсутствует" @@ -911,10 +930,13 @@ name = "Русский" "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 = "Открытие {n} файла как нового", few = "Открытие {n} файлов как новых", many = "Открытие {n} файлов как новых", 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" = "Другие участники вводят это в «Поделиться» ▸ «Подключиться по коду»" @@ -974,6 +996,8 @@ name = "Русский" "Place a shape or frame (its tool chosen)" = "Разместить фигуру или Frame (выбранным инструментом)" "Place automatically" = "Разместить автоматически" "Place image" = "Разместить изображение" +"Plugin" = "Плагин" +"Plugins & widgets" = "Плагины и виджеты" "Plugins run in FigCraft's sandbox, without files, network or clock. Install only plugins you trust." = "Плагины работают в песочнице FigCraft без доступа к файлам, сети и часам. Устанавливайте только плагины, которым доверяете." "Plugins" = "Плагины" "Plus darker" = "Линейное затемнение" @@ -1043,6 +1067,7 @@ name = "Русский" "Reduce motion" = "Уменьшить движение" "Refraction" = "Преломление" "Regular expression" = "Регулярное выражение" +"Relative to your system's display scaling (100% is the system's own size). Document zoom is separate." = "Относительно масштаба экрана в системе (100% — собственный размер системы). Масштаб документа задаётся отдельно." "Remove" = "Удалить" "Remove all" = "Удалить всё" "Remove annotation" = "Удалить аннотацию" @@ -1066,6 +1091,7 @@ name = "Русский" "Remove the else and its actions" = "Удалить «Иначе» и его действия" "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" = "Удалено с сервера" @@ -1080,6 +1106,7 @@ name = "Русский" "Rename on the server…" = "Переименовать на сервере…" "Rename page" = "Переименовать страницу" "Rename to" = "Новое имя" +"Reorder selection" = "Изменить порядок выделения" "Replace all" = "Заменить всё" "Replace mixed export settings" = "Заменить разные настройки экспорта" "Replace with" = "Заменить на" @@ -1115,6 +1142,7 @@ name = "Русский" "Review and merge" = "Проверить и объединить" "Ribbon" = "Лента" "Right" = "Справа" +"Right padding" = "Правый внутренний отступ" "Right side" = "Правая сторона" "Right side width" = "Ширина правой стороны" "Rotate 90°" = "Повернуть на 90°" @@ -1134,6 +1162,8 @@ name = "Русский" "Rulers" = "Линейки" "Run" = "Запустить" "Run {label}" = "Запустить {label}" +"Save files automatically" = "Автоматически сохранять файлы" +"Search pages" = "Поиск страниц" "Search templates" = "Поиск шаблонов" "See all templates" = "Все шаблоны" "Select layers and they space themselves as their content changes" = "Выделите слои: интервалы между ними будут подстраиваться при изменении содержимого" @@ -1278,6 +1308,7 @@ name = "Русский" "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" = "Включите общий доступ кнопкой «Поделиться», затем передайте полученный код" @@ -1339,6 +1370,9 @@ name = "Русский" "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 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}»)" @@ -1348,6 +1382,7 @@ 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" = "Толщина" @@ -1359,6 +1394,8 @@ name = "Русский" "This file" = "Этот файл" "This file has unsaved changes" = "В файле есть несохранённые изменения" "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} МБ)" +"This file uses fonts that aren't installed on this computer. Their text is drawn in a fallback font until you install them." = "В этом файле используются шрифты, не установленные на этом компьютере. Их текст отрисовывается запасным шрифтом, пока вы их не установите." "This frame is new on the branch." = "Этот Frame добавлен в ветке." "This frame isn't on the branch." = "Этого Frame нет в ветке." "This server is open to the public: no key needed." = "Сервер общедоступен: ключ не нужен." @@ -1378,6 +1415,7 @@ name = "Русский" "Top" = "Сверху" "Top & bottom" = "Сверху и снизу" "Top left radius" = "Радиус верхнего левого угла" +"Top padding" = "Верхний внутренний отступ" "Top right radius" = "Радиус верхнего правого угла" "Transform" = "Трансформация" "Triangle arrow" = "Треугольная стрелка" @@ -1415,6 +1453,8 @@ name = "Русский" "Update from selection" = "Обновить из выделения" "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, запустите FigCraft из командной строки с параметром:" +"Updating the graphics driver often helps. WGPU_BACKEND (vulkan, gl, metal) names another graphics API to try." = "Часто помогает обновление драйвера видеокарты. Переменная WGPU_BACKEND (vulkan, gl, metal) задаёт другой графический API, который можно попробовать." "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" = "Использовать фиксированное значение" @@ -1424,6 +1464,7 @@ name = "Русский" "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" = "Имя пользователя" "Value" = "Значение" @@ -1458,6 +1499,7 @@ name = "Русский" "Visibility" = "Видимость" "Visible" = "Видимый" "Vivid" = "Яркий" +"WGPU_BACKEND is set and names the graphics API to use; unsetting it lets FigCraft choose." = "Переменная WGPU_BACKEND задана и указывает используемый графический API; если её убрать, FigCraft выберет сам." "Warm" = "Тёплый" "Watch" = "Часы" "Wavy" = "Волнистый" @@ -1477,6 +1519,7 @@ name = "Русский" "White" = "Белый" "Who runs it, its terms and how long it keeps files" = "Оператор, условия и срок хранения файлов" "Why it changed" = "Причина изменения" +"Widget" = "Виджет" "Widgets" = "Виджеты" "Width" = "Ширина" "Width point" = "Точка ширины" @@ -1574,6 +1617,7 @@ name = "Русский" "nobody else here yet" = "здесь пока больше никого нет" "non-default slot settings are not represented and were skipped" = "нестандартные настройки слотов не передаются и пропущены" "now" = "сейчас" +"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" = "ключи предпочтительных компонентов слотов не удалось сопоставить со слоями файла, они пропущены" @@ -1596,6 +1640,7 @@ name = "Русский" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "действия смены режима переменных для коллекций или режимов, которых нет в JSON переменных, пропущены" "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" = "устаревшие или недопустимые записи размеров треков сетки проигнорированы" @@ -1682,6 +1727,7 @@ name = "Русский" "{n} replies" = { one = "{n} ответ", few = "{n} ответа", many = "{n} ответов", other = "{n} ответа" } "{n} rows" = { one = "{n} строка", few = "{n} строки", many = "{n} строк", other = "{n} строки" } "{n} styles" = { one = "{n} стиль", few = "{n} стиля", many = "{n} стилей", other = "{n} стиля" } +"{n} text layers" = { one = "{n} текстовый слой", few = "{n} текстовых слоя", many = "{n} текстовых слоёв", other = "{n} текстовых слоя" } "{n} variables" = { one = "{n} переменная", few = "{n} переменные", many = "{n} переменных", other = "{n} переменной" } "{n} weeks ago" = { one = "{n} неделю назад", few = "{n} недели назад", many = "{n} недель назад", other = "{n} недели назад" } "{n} years ago" = { one = "{n} год назад", few = "{n} года назад", many = "{n} лет назад", other = "{n} года назад" } @@ -1690,6 +1736,7 @@ name = "Русский" "{n}m" = "{n} мин" "{n}w" = "{n} нед" "{page}, nothing selected" = "{page}, ничего не выделено" +"{percent}%" = "{percent}%" "{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} не может сообщить, что стало с вашими файлами (версия сервера старее приложения)." @@ -1732,6 +1779,7 @@ name = "Русский" "arrange.front" = "На передний план" "arrange.packH" = "Уплотнить по горизонтали" "arrange.packV" = "Уплотнить по вертикали" +"arrange.reorder" = "Изменить порядок выделения" "arrange.roundToPixels" = "Округлить до пикселей" "arrange.spacing" = "Интервал" "arrange.tidy" = "Упорядочить" @@ -1766,6 +1814,7 @@ name = "Русский" "collab.publish" = "Опубликовать на сервере" "collab.recoverFile" = "Восстановить онлайн-файл" "collab.registerLinks" = "Открывать ссылки приглашения в FigCraft" +"collab.removePerson" = "Убрать из сессии" "collab.report" = "Пожаловаться на файл оператору сервера" "collab.serverInfo" = "Информация о сервере" "collab.share" = "Поделиться по коду подключения" @@ -1944,6 +1993,7 @@ name = "Русский" "object.batchRename" = "Массовое переименование" "object.convertToFrame" = "Преобразовать во Frame" "object.convertToGroup" = "Преобразовать в группу" +"object.convertToSection" = "Преобразовать в секцию" "object.flipH" = "Отразить по горизонтали" "object.flipV" = "Отразить по вертикали" "object.frameSelection" = "Поместить выделение во Frame" @@ -1990,6 +2040,7 @@ name = "Русский" "plugin.ui" = "Панель плагина" "plugins.manage" = "Управление плагинами…" "plugins.runLast" = "Запустить последний плагин" +"pref.autoSave" = "Автоматически сохранять файлы" "pref.highlightHover" = "Подсвечивать слои при наведении" "pref.keepTool" = "Оставлять инструмент выбранным после использования" "pref.language" = "Язык интерфейса" @@ -1999,6 +2050,8 @@ name = "Русский" "pref.reduceMotion" = "Уменьшить движение" "pref.renameDuplicates" = "Переименовывать дубликаты слоёв" "pref.showDimensions" = "Показать размеры объектов" +"pref.startOnHome" = "Начинать с главной" +"pref.uiScale" = "Размер интерфейса" "pref.userName" = "Ваше имя в комментариях" "proto.action.add" = "Добавить действие прототипа" "proto.action.move" = "Изменить порядок действия прототипа" @@ -2104,14 +2157,18 @@ name = "Русский" "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" = "Оси вариативного шрифта" From 594dc8c6cf50a03b6d88abce877794f286f759b9 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Mon, 19 Oct 2026 22:20:57 -0400 Subject: [PATCH 411/817] Release 0.8.0 Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 42 +++++++++++++++++++++--------------------- Cargo.toml | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 86bccfa35..1d047aa42 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1413,7 +1413,7 @@ checksum = "b97b65636e5b9ef369943878ac74335ba1c55c1cb6adbf1e2c293c624248d693" [[package]] name = "figcraft" -version = "0.7.0" +version = "0.8.0" dependencies = [ "arboard", "eframe", @@ -1440,7 +1440,7 @@ dependencies = [ [[package]] name = "figcraft-cli" -version = "0.7.0" +version = "0.8.0" dependencies = [ "figcraft-doc", "figcraft-engine", @@ -1454,7 +1454,7 @@ dependencies = [ [[package]] name = "figcraft-collab" -version = "0.7.0" +version = "0.8.0" dependencies = [ "base64 0.22.1", "figcraft-color", @@ -1469,7 +1469,7 @@ dependencies = [ [[package]] name = "figcraft-collab-net" -version = "0.7.0" +version = "0.8.0" dependencies = [ "base64 0.22.1", "figcraft-collab", @@ -1492,7 +1492,7 @@ dependencies = [ [[package]] name = "figcraft-color" -version = "0.7.0" +version = "0.8.0" dependencies = [ "kurbo", "serde", @@ -1501,7 +1501,7 @@ dependencies = [ [[package]] name = "figcraft-doc" -version = "0.7.0" +version = "0.8.0" dependencies = [ "figcraft-color", "figcraft-geom", @@ -1513,7 +1513,7 @@ dependencies = [ [[package]] name = "figcraft-engine" -version = "0.7.0" +version = "0.8.0" dependencies = [ "base64 0.22.1", "craft-docpath", @@ -1541,7 +1541,7 @@ dependencies = [ [[package]] name = "figcraft-format" -version = "0.7.0" +version = "0.8.0" dependencies = [ "figcraft-doc", "figcraft-pathops", @@ -1556,7 +1556,7 @@ dependencies = [ [[package]] name = "figcraft-geom" -version = "0.7.0" +version = "0.8.0" dependencies = [ "kurbo", "serde", @@ -1564,7 +1564,7 @@ dependencies = [ [[package]] name = "figcraft-layout" -version = "0.7.0" +version = "0.8.0" dependencies = [ "figcraft-doc", "figcraft-geom", @@ -1572,7 +1572,7 @@ dependencies = [ [[package]] name = "figcraft-mcp" -version = "0.7.0" +version = "0.8.0" dependencies = [ "base64 0.22.1", "figcraft-collab-net", @@ -1588,7 +1588,7 @@ dependencies = [ [[package]] name = "figcraft-pathops" -version = "0.7.0" +version = "0.8.0" dependencies = [ "figcraft-doc", "figcraft-geom", @@ -1597,7 +1597,7 @@ dependencies = [ [[package]] name = "figcraft-pdf" -version = "0.7.0" +version = "0.8.0" dependencies = [ "figcraft-color", "figcraft-doc", @@ -1614,7 +1614,7 @@ dependencies = [ [[package]] name = "figcraft-plugin" -version = "0.7.0" +version = "0.8.0" dependencies = [ "figcraft-color", "serde", @@ -1627,7 +1627,7 @@ dependencies = [ [[package]] name = "figcraft-render" -version = "0.7.0" +version = "0.8.0" dependencies = [ "crc32fast", "figcraft-color", @@ -1645,7 +1645,7 @@ dependencies = [ [[package]] name = "figcraft-server" -version = "0.7.0" +version = "0.8.0" dependencies = [ "crc32fast", "ctrlc", @@ -1669,7 +1669,7 @@ dependencies = [ [[package]] name = "figcraft-svg" -version = "0.7.0" +version = "0.8.0" dependencies = [ "base64 0.22.1", "figcraft-color", @@ -1685,7 +1685,7 @@ dependencies = [ [[package]] name = "figcraft-text" -version = "0.7.0" +version = "0.8.0" dependencies = [ "figcraft-doc", "figcraft-geom", @@ -1699,7 +1699,7 @@ dependencies = [ [[package]] name = "figcraft-ui-egui" -version = "0.7.0" +version = "0.8.0" dependencies = [ "base64 0.22.1", "egui", @@ -1724,7 +1724,7 @@ dependencies = [ [[package]] name = "figcraft-web" -version = "0.7.0" +version = "0.8.0" dependencies = [ "eframe", "egui", @@ -5934,7 +5934,7 @@ checksum = "9440ea3e5aeabb0ac63af70daf835274065238cdd0cec83418f417eae38bacee" [[package]] name = "xtask" -version = "0.7.0" +version = "0.8.0" dependencies = [ "figcraft-engine", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 932da46f8..1eef32c76 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ exclude = ["plugins"] # default-members = ["crates/*", "apps/figcraft", "apps/figcraft-cli", "xtask"] [workspace.package] -version = "0.7.0" +version = "0.8.0" edition = "2024" license = "MIT OR Apache-2.0" rust-version = "1.95" From 414aa1b63c1c8a89db256e2b213dc142fd57905a Mon Sep 17 00:00:00 2001 From: xiaou61 <113765024+xiaou61@users.noreply.github.com> Date: Tue, 20 Oct 2026 11:04:13 +0800 Subject: [PATCH 412/817] M1: write grid track sizes in .fig export (#465) The import has read `gridColumnsSizing` / `gridRowsSizing` since #630, but the export wrote only equal tracks and warned about it, so a grid with a fixed column beside two weighted ones came back equal after a save and reload. Write the sizing map next to the order map, keyed by the same track ids: fixed px, fractional fill and content-sized tracks keep their sizes. A track the format has no name for (negative or out-of-range size, or a document track the frame doesn't list) keeps its id and reads back equal, with the existing warning. Co-authored-by: xiaou61 <113765024+xiaou61@users.noreply.github.com> --- crates/format/src/fig/export.rs | 50 +++++++++++++++++++++++---- crates/format/src/fig/export_tests.rs | 39 +++++++++++++++++++++ crates/format/src/fig/map.rs | 2 +- docs/file-format-parity.md | 9 ++--- 4 files changed, 89 insertions(+), 11 deletions(-) diff --git a/crates/format/src/fig/export.rs b/crates/format/src/fig/export.rs index 0cad21228..190f4055c 100644 --- a/crates/format/src/fig/export.rs +++ b/crates/format/src/fig/export.rs @@ -25,10 +25,10 @@ use figcraft_doc::proto::{ Action, Direction, Easing, GAMEPAD_BUTTONS, Interaction, KeyMods, Overflow, OverlayPosition, ScrollPosition, Transition, Trigger, }; use figcraft_doc::{ - AutoLayout, BoolOp, ContentAlign, CrossAlign, Document, EffectKind, ExportSize, GridAlign, GridKind, HConstraint, LayoutMode, LetterSpacing, - LineHeight, ListStyle, MainAlign, MaskType, Node, NodeId, NodeKind, NoiseMode, PropDef, Sizing, StrokeAlign, StrokeCap, StrokeJoin, StyleKind, - TextAlignH, TextAlignV, TextAutoResize, TextCase, TextData, TextDecoration, TextStyle, VConstraint, VariableType, VariableValue, VectorNetwork, - WindingRule, + AutoLayout, BoolOp, ContentAlign, CrossAlign, Document, EffectKind, ExportSize, GridAlign, GridKind, GridTrack, HConstraint, LayoutMode, + LetterSpacing, LineHeight, ListStyle, MainAlign, MaskType, Node, NodeId, NodeKind, NoiseMode, PropDef, Sizing, StrokeAlign, StrokeCap, + StrokeJoin, StyleKind, TextAlignH, TextAlignV, TextAutoResize, TextCase, TextData, TextDecoration, TextStyle, VConstraint, VariableType, + VariableValue, VectorNetwork, WindingRule, }; use serde_json::Value; @@ -168,7 +168,12 @@ message PrototypeStartingPoint string name=1, string position=3 message OverlayBackgroundAppearance OverlayBackgroundType backgroundType=1, Color backgroundColor=2 message GUIDPositionMapEntry GUID id=1, string position=2 message GUIDPositionMap GUIDPositionMapEntry[] entries=1 -message NodeChange GUID guid=1, NodePhase phase=2, ParentIndex parentIndex=3, NodeType type=4, string name=5, bool visible=6, bool locked=7, float opacity=8, BlendMode blendMode=9, Vector size=11, Matrix transform=12, bool mask=16, MaskType maskType=317, float backgroundOpacity=19, bool backgroundEnabled=15, bool internalOnly=142, string description=318, StyleType styleType=163, string sortPosition=320, StyleId styleIdForFill=332, StyleId styleIdForStrokeFill=333, StyleId styleIdForText=334, StyleId styleIdForEffect=335, StyleId styleIdForGrid=336, VariableDataMap variableConsumptionMap=307, VariableModeBySetMap variableModeBySetMap=316, VariableSetMode[] variableSetModes=312, VariableSetID variableSetID=313, VariableResolvedDataType variableResolvedType=314, VariableDataValues variableDataValues=315, VariableScope[] variableScopes=353, DocumentColorProfile documentColorProfile=349, Paint[] fillPaints=38, Paint[] strokePaints=39, float strokeWeight=26, StrokeAlign strokeAlign=29, StrokeJoin strokeJoin=31, StrokeCap strokeCap=30, float[] dashPattern=13, float miterLimit=25, bool borderStrokeWeightsIndependent=299, float borderTopWeight=295, float borderRightWeight=298, float borderBottomWeight=296, float borderLeftWeight=297, Effect[] effects=43, float cornerRadius=20, float cornerSmoothing=160, bool rectangleCornerRadiiIndependent=149, float rectangleTopLeftCornerRadius=145, float rectangleTopRightCornerRadius=146, float rectangleBottomRightCornerRadius=148, float rectangleBottomLeftCornerRadius=147, ConstraintType horizontalConstraint=28, ConstraintType verticalConstraint=37, bool frameMaskDisabled=115, bool resizeToFit=117, bool isStateGroup=225, bool sectionContentsHidden=283, Color backgroundColor=50, StackMode stackMode=105, float stackSpacing=107, float stackCounterSpacing=324, StackWrap stackWrap=323, StackCounterAlignContent stackCounterAlignContent=343, float stackHorizontalPadding=209, float stackVerticalPadding=210, float stackPaddingRight=233, float stackPaddingBottom=234, StackJustify stackPrimaryAlignItems=230, StackAlign stackCounterAlignItems=231, StackSize stackPrimarySizing=229, StackSize stackCounterSizing=221, bool bordersTakeSpace=294, bool stackReverseZIndex=271, float gridColumnGap=438, float gridRowGap=437, GUIDPositionMap gridColumns=436, GUIDPositionMap gridRows=435, float stackChildPrimaryGrow=232, StackCounterAlign stackChildAlignSelf=236, StackPositioning stackPositioning=269, OptionalVector minSize=325, OptionalVector maxSize=326, GUID gridColumnAnchor=440, GUID gridRowAnchor=439, uint gridColumnSpan=442, uint gridRowSpan=441, LayoutGrid[] layoutGrids=47, ExportSettings[] exportSettings=45, TextData textData=42, FontName fontName=41, float fontSize=21, Number lineHeight=40, Number letterSpacing=165, TextCase textCase=34, TextDecoration textDecoration=35, TextAlignHorizontal textAlignHorizontal=32, TextAlignVertical textAlignVertical=33, TextAutoResize textAutoResize=46, TextTruncation textTruncation=280, int maxLines=351, float paragraphSpacing=23, float paragraphIndent=22, Hyperlink hyperlink=223, bool autoRename=14, bool fontVariantCommonLigatures=127, bool fontVariantContextualLigatures=128, string fontVersion=202, uint textUserLayoutVersion=203, uint textExplicitLayoutVersion=396, uint textBidiVersion=279, float textTracking=27, bool textDecorationSkipInk=412, EmojiImageSet emojiImageSet=391, uint styleID=49, Path[] fillGeometry=51, Path[] strokeGeometry=52, VectorData vectorData=48, VectorMirror handleMirroring=44, uint count=10, float starInnerScale=24, ArcData arcData=195, BooleanOperation booleanOperation=36, string symbolDescription=144, VariableWidthPoint[] variableWidthPoints=447, PluginData[] pluginData=204, SymbolData symbolData=113, NodeChange[] derivedSymbolData=125, GUID overriddenSymbolID=143, ComponentPropDef[] componentPropDefs=266, ComponentPropAssignment[] componentPropAssignments=268, VariableDataMap parameterConsumptionMap=445, GUIDPath guidPath=111, PrototypeInteraction[] prototypeInteractions=226, PrototypeStartingPoint prototypeStartingPoint=249, ScrollDirection scrollDirection=159, ScrollBehavior scrollBehavior=186, OverlayPositionType overlayPositionType=198, OverlayBackgroundInteraction overlayBackgroundInteraction=200, OverlayBackgroundAppearance overlayBackgroundAppearance=201 +enum GridTrackSizingType FLEX=0 FIXED=1 HUG=2 UNKNOWN=3 +message GridTrackSizeFunction GridTrackSizingType type=1, float value=2 +message GridTrackSize GridTrackSizeFunction minSizing=1, GridTrackSizeFunction maxSizing=2 +message GridTrackSizeEntry GUID id=1, GridTrackSize trackSize=2 +message GridTrackSizeMap GridTrackSizeEntry[] entries=1 +message NodeChange GUID guid=1, NodePhase phase=2, ParentIndex parentIndex=3, NodeType type=4, string name=5, bool visible=6, bool locked=7, float opacity=8, BlendMode blendMode=9, Vector size=11, Matrix transform=12, bool mask=16, MaskType maskType=317, float backgroundOpacity=19, bool backgroundEnabled=15, bool internalOnly=142, string description=318, StyleType styleType=163, string sortPosition=320, StyleId styleIdForFill=332, StyleId styleIdForStrokeFill=333, StyleId styleIdForText=334, StyleId styleIdForEffect=335, StyleId styleIdForGrid=336, VariableDataMap variableConsumptionMap=307, VariableModeBySetMap variableModeBySetMap=316, VariableSetMode[] variableSetModes=312, VariableSetID variableSetID=313, VariableResolvedDataType variableResolvedType=314, VariableDataValues variableDataValues=315, VariableScope[] variableScopes=353, DocumentColorProfile documentColorProfile=349, Paint[] fillPaints=38, Paint[] strokePaints=39, float strokeWeight=26, StrokeAlign strokeAlign=29, StrokeJoin strokeJoin=31, StrokeCap strokeCap=30, float[] dashPattern=13, float miterLimit=25, bool borderStrokeWeightsIndependent=299, float borderTopWeight=295, float borderRightWeight=298, float borderBottomWeight=296, float borderLeftWeight=297, Effect[] effects=43, float cornerRadius=20, float cornerSmoothing=160, bool rectangleCornerRadiiIndependent=149, float rectangleTopLeftCornerRadius=145, float rectangleTopRightCornerRadius=146, float rectangleBottomRightCornerRadius=148, float rectangleBottomLeftCornerRadius=147, ConstraintType horizontalConstraint=28, ConstraintType verticalConstraint=37, bool frameMaskDisabled=115, bool resizeToFit=117, bool isStateGroup=225, bool sectionContentsHidden=283, Color backgroundColor=50, StackMode stackMode=105, float stackSpacing=107, float stackCounterSpacing=324, StackWrap stackWrap=323, StackCounterAlignContent stackCounterAlignContent=343, float stackHorizontalPadding=209, float stackVerticalPadding=210, float stackPaddingRight=233, float stackPaddingBottom=234, StackJustify stackPrimaryAlignItems=230, StackAlign stackCounterAlignItems=231, StackSize stackPrimarySizing=229, StackSize stackCounterSizing=221, bool bordersTakeSpace=294, bool stackReverseZIndex=271, float gridColumnGap=438, float gridRowGap=437, GUIDPositionMap gridColumns=436, GUIDPositionMap gridRows=435, GridTrackSizeMap gridColumnsSizing=443, GridTrackSizeMap gridRowsSizing=444, float stackChildPrimaryGrow=232, StackCounterAlign stackChildAlignSelf=236, StackPositioning stackPositioning=269, OptionalVector minSize=325, OptionalVector maxSize=326, GUID gridColumnAnchor=440, GUID gridRowAnchor=439, uint gridColumnSpan=442, uint gridRowSpan=441, LayoutGrid[] layoutGrids=47, ExportSettings[] exportSettings=45, TextData textData=42, FontName fontName=41, float fontSize=21, Number lineHeight=40, Number letterSpacing=165, TextCase textCase=34, TextDecoration textDecoration=35, TextAlignHorizontal textAlignHorizontal=32, TextAlignVertical textAlignVertical=33, TextAutoResize textAutoResize=46, TextTruncation textTruncation=280, int maxLines=351, float paragraphSpacing=23, float paragraphIndent=22, Hyperlink hyperlink=223, bool autoRename=14, bool fontVariantCommonLigatures=127, bool fontVariantContextualLigatures=128, string fontVersion=202, uint textUserLayoutVersion=203, uint textExplicitLayoutVersion=396, uint textBidiVersion=279, float textTracking=27, bool textDecorationSkipInk=412, EmojiImageSet emojiImageSet=391, uint styleID=49, Path[] fillGeometry=51, Path[] strokeGeometry=52, VectorData vectorData=48, VectorMirror handleMirroring=44, uint count=10, float starInnerScale=24, ArcData arcData=195, BooleanOperation booleanOperation=36, string symbolDescription=144, VariableWidthPoint[] variableWidthPoints=447, PluginData[] pluginData=204, SymbolData symbolData=113, NodeChange[] derivedSymbolData=125, GUID overriddenSymbolID=143, ComponentPropDef[] componentPropDefs=266, ComponentPropAssignment[] componentPropAssignments=268, VariableDataMap parameterConsumptionMap=445, GUIDPath guidPath=111, PrototypeInteraction[] prototypeInteractions=226, PrototypeStartingPoint prototypeStartingPoint=249, ScrollDirection scrollDirection=159, ScrollBehavior scrollBehavior=186, OverlayPositionType overlayPositionType=198, OverlayBackgroundInteraction overlayBackgroundInteraction=200, OverlayBackgroundAppearance overlayBackgroundAppearance=201 struct Blob byte[] bytes message Message MessageType type=1, uint sessionID=2, NodeChange[] nodeChanges=4, Blob[] blobs=6 "; @@ -277,6 +282,20 @@ fn s(x: &str) -> Kv<'static> { fn b(x: bool) -> Kv<'static> { Kv::Bool(x) } + +/// A track's size as the format's enum name and value, when both sizing functions agree (the +/// importer keeps only those). `None`: the format has no name for it, so an equal track stands in. +fn grid_track_size(track: &GridTrack) -> Option<(&'static str, f64)> { + let value = track.value; + let fits = value.is_finite() && (0.0..=crate::fig::map::MAX_GRID_TRACK_VALUE).contains(&value); + match track.sizing { + Sizing::Fixed if fits => Some(("FIXED", value)), + Sizing::Fill if fits && value > 0.0 => Some(("FLEX", value)), + Sizing::Hug => Some(("HUG", 0.0)), + _ => None, + } +} + fn guid(session: u32, local: u32) -> Kv<'static> { o(vec![("sessionID", u(session)), ("localID", u(local))]) } @@ -1415,9 +1434,28 @@ impl<'d> Exporter<'d> { )]) }; f.extend([("gridColumnGap", fl(l.gap)), ("gridRowGap", fl(l.cross_gap)), ("gridColumns", map(&cols)), ("gridRows", map(&rows))]); - if l.column_tracks.iter().chain(&l.row_tracks).any(|t| t.sizing != Sizing::Fill) { + // Sizing is keyed by track id like the order map. A track the document doesn't set is + // left out, and one the format can't hold keeps its id (the import equalises it). + let sizing = |tracks: &[GridTrack], ids: &[u32]| -> Option> { + let mut entries = Vec::new(); + for (i, id) in ids.iter().enumerate() { + let Some(track) = tracks.get(i) else { continue }; + if let Some((kind, value)) = grid_track_size(track) { + let size = || o(vec![("type", e(kind)), ("value", fl(value))]); + entries.push(o(vec![("id", guid(AUX, *id)), ("trackSize", o(vec![("minSizing", size()), ("maxSizing", size())]))])); + } + } + (!entries.is_empty()).then(|| o(vec![("entries", arr(entries))])) + }; + let (column_sizing, row_sizing) = (sizing(&l.column_tracks, &cols), sizing(&l.row_tracks, &rows)); + if l.column_tracks.iter().chain(&l.row_tracks).any(|t| grid_track_size(t).is_none()) { self.warn("grid tracks of fixed or content size were written as equal tracks"); } + for (name, sizing) in [("gridColumnsSizing", column_sizing), ("gridRowsSizing", row_sizing)] { + if let Some(v) = sizing { + f.push((name, v)); + } + } self.tracks.insert(key, (cols, rows)); } else { let spread = l.content_align == ContentAlign::SpaceBetween; diff --git a/crates/format/src/fig/export_tests.rs b/crates/format/src/fig/export_tests.rs index 0eac95712..adb7be6dc 100644 --- a/crates/format/src/fig/export_tests.rs +++ b/crates/format/src/fig/export_tests.rs @@ -1022,6 +1022,45 @@ fn junk_documents_never_panic() { } } +/// Grid track sizes reach the file and come back: fixed px, fractional fill and hug tracks, and a +/// track the format has no name for leaves an equal track behind instead of failing the write. +#[test] +fn grid_track_sizes_round_trip() { + let mut doc = Document::new("File"); + let page = doc.first_page().unwrap(); + let grid = doc.create(page, NodeKind::Frame, "Grid", 0.0, 0.0, 400.0, 200.0).unwrap(); + { + let node = doc.node_mut(grid).unwrap(); + node.layout = Some(AutoLayout { + mode: LayoutMode::Grid, + grid_columns: 3, + grid_rows: 2, + column_tracks: vec![GridTrack::fixed(120.0), GridTrack::fill(2.0), GridTrack::hug()], + row_tracks: vec![GridTrack::fill(1.0), GridTrack::fixed(50.0)], + ..AutoLayout::default() + }); + } + let (bytes, warnings) = export(&doc, None).unwrap(); + assert!(warnings.is_empty(), "{warnings:?}"); + let (back, iw) = import(&bytes, "File").unwrap(); + assert!(iw.is_empty(), "{iw:?}"); + let l = back.node(back.pages[0]).and_then(|p| p.children.first()).and_then(|c| back.node(*c)).and_then(|n| n.layout.clone()).unwrap(); + assert_eq!(l.column_tracks, vec![GridTrack::fixed(120.0), GridTrack::fill(2.0), GridTrack::hug()]); + assert_eq!(l.row_tracks, vec![GridTrack::fill(1.0), GridTrack::fixed(50.0)]); + + // A negative fixed track is no size the format can name: the write still succeeds, the track + // falls back to an equal one, and the warning says so. + let mut odd = doc.clone(); + if let Some(l) = odd.node_mut(grid).and_then(|n| n.layout.as_mut()) { + l.column_tracks[0] = GridTrack::fixed(-5.0); + } + let (bytes, warnings) = export(&odd, None).unwrap(); + assert_eq!(warnings, vec!["grid tracks of fixed or content size were written as equal tracks".to_string()]); + let (back, _) = import(&bytes, "File").unwrap(); + let l = back.node(back.pages[0]).and_then(|p| p.children.first()).and_then(|c| back.node(*c)).and_then(|n| n.layout.clone()).unwrap(); + assert_eq!(l.column_tracks[0], GridTrack::fill(1.0), "an unwritable track reads back equal"); +} + /// A frame's own min/max size survives whatever its parent is, not only under auto layout. #[test] fn frame_size_limits_survive_without_auto_layout_parent() { diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 8e4671511..ec0dd8e46 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -24,7 +24,7 @@ const MAX_DEPTH: usize = 256; /// Most path commands read from one geometry blob. const MAX_COMMANDS: usize = 200_000; const MAX_GRID_TRACKS: usize = 1_000; -const MAX_GRID_TRACK_VALUE: f64 = 1e6; +pub(super) const MAX_GRID_TRACK_VALUE: f64 = 1e6; /// Id of "no style". const NO_STYLE: &str = "4294967295:4294967295"; /// Longest asset `key` or `version` kept for resolving references given as assets. diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index adf0b0f2c..6b020d725 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -122,10 +122,10 @@ each. image adjustments, glass settings other than frost, springs other than Gentle (written as ease out), set-variable, set-variable-mode and conditional actions, scroll-to offsets, text decoration looks, variable font axes, text on a path, nested list levels, list spacing, hanging punctuation, - leading trim, OpenType features, per-layer operations inside boolean groups, grid tracks of fixed - or content size, different stroke ends on lines. Not written at all: stroke outlines of dashed and - per-side strokes and of inside or outside strokes on polygons, stars and vectors, glyph outlines - of text (a reader lays text out with its own fonts), version history and branches. + leading trim, OpenType features, per-layer operations inside boolean groups, different stroke ends + on lines. Not written at all: stroke outlines of dashed and per-side strokes and of inside or + outside strokes on polygons, stars and vectors, glyph outlines of text (a reader lays text out + with its own fonts), version history and branches. - **Checked by opening written files in other software:** the example documents and a small test file open there, and layers, fills, gradients, strokes, shadows, vectors, components and text draw as in FigCraft. A file saved again there and read back keeps the layer tree and properties; two @@ -165,6 +165,7 @@ each. | Date | Change | Summary | |---|---|---| +| 2026-10-20 | minor | `.fig` export writes grid track sizes (`gridColumnsSizing` / `gridRowsSizing`): fixed px, fractional fill and content-sized tracks keep their sizes and come back through our own importer (#465). Tracks whose sizing the format has no name for (a negative or out-of-range size, a constrained min/max) keep their id and read back equal, with the existing warning. Numbers unchanged | | 2026-10-18 | minor | REST file JSON import keeps `SLOT` layers (#792): they were dropped with everything placed in them, which emptied every instance's slot. A slot in a main component becomes a slot frame bound to its `SLOT` property (the one it references, else the one named like it, else the only one left), and an instance's slot holds the instance's own content, kept across syncs, moves of the mains and saving, unless the instance's property value is the main's default content (without values, a slot that holds layers keeps them). Instances in slot content link to their own mains. Slot content limits, preferred-only and preferred components are warnings. Synthetic files only. Numbers unchanged | | 2026-10-17 | minor | REST file JSON import reads grid track sizes from the CSS track strings `gridColumnsSizing` / `gridRowsSizing` (fixed px, fill fr, hug `auto`, `minmax(0, 1fr)`, `repeat()`; other tracks stay equal) (#465). Numbers unchanged | | 2026-10-17 | minor | The community batches #727 and #728 in the `.fig` row: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments (also REST), images in the message; budgets from the file's size; the journal keeps no file bytes; the import report. Not read cut to what's left. A `.fig` copy from Save as. Pasted content: layers copied from another design app, best effort (tested only with clipboard HTML made from our own export), and images under Wayland (not run there). All on synthetic files: summary and hours unchanged | From ea2fa7c367731823a404d3cd37fcd2b5ea9ead90 Mon Sep 17 00:00:00 2001 From: xiaou61 <113765024+xiaou61@users.noreply.github.com> Date: Tue, 20 Oct 2026 11:08:21 +0800 Subject: [PATCH 413/817] M1: say that the automation roots reach only the headless side (#835) The CLI help and docs/mcp.md described the roots as confining whatever the run touches, which reads as if they also applied to `mcp --attach`. They don't: an attached server runs the commands inside the app, and the app confines them from its own flags. VectorCraft documents the same split, and the missing sentence is what made the difference confusing, as #835 reports. Co-authored-by: xiaou61 <113765024+xiaou61@users.noreply.github.com> --- apps/figcraft-cli/src/main.rs | 9 +++++---- docs/cli.md | 4 +++- docs/mcp.md | 4 ++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/apps/figcraft-cli/src/main.rs b/apps/figcraft-cli/src/main.rs index badc5bc30..7c5fe485b 100644 --- a/apps/figcraft-cli/src/main.rs +++ b/apps/figcraft-cli/src/main.rs @@ -46,10 +46,11 @@ the FIGCRAFT_SERVER_KEY environment variable (which keeps it out of the shell hi `--automation-read-root DIR` / `--automation-write-root DIR` (each may be repeated; the folders must exist) confine the files a subcommand touches: reads only inside a read or write root, writes only inside a write root, everything else refused -- so giving no write root denies writing -altogether. They are taken by `mcp`, to confine the agent's commands, and by `info`, `export`, -`convert`, `render` and `run`, to confine that one run; without them a subcommand reads and writes -as the user who started it, as before. A running app confines itself: start it with -`figcraft --control PORT` and the same flags (`--attach` refuses them). +altogether. They reach the headless side only: `mcp` takes them to confine the agent's commands, +and `info`, `export`, `convert`, `render` and `run` to confine that one run; without them a +subcommand reads and writes as the user who started it, as before. A `mcp --attach` server is +confined by the app it attaches to, not by flags passed to the CLI: start that app with +`figcraft --control PORT` and the same roots (`--attach` refuses them). See docs/cli.md and docs/mcp.md."; /// The automation roots a file subcommand was given, if any. Omitting both leaves the run diff --git a/docs/cli.md b/docs/cli.md index 699b6ba27..22ee9fa8c 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -186,7 +186,9 @@ Serve MCP on stdio: headless by default, or attached to a running app started wi `figcraft --control PORT`. See [mcp.md](mcp.md). The automation roots (each repeatable; existing folders) confine the files the agent's calls read (inside a read or write root) and write (inside a write root); everything else is refused ([mcp.md › Confining file access](mcp.md#confining-file-access)). -With `--attach` they are refused: start the app with them instead. The headless session can host, join and publish +They apply to the headless session only, and that is why `--attach` refuses them: an attached server +is confined by the app it attaches to, from the flags that app was started with. The headless +session can host, join and publish live sessions (`collab.*`: without a key on a server open to the public, with `collab.serverInfo`, `collab.manageFile` for the owner token and `collab.report`) and use plugin directories (`plugin.directory.*`); the one-shot `run` can't (no network link). diff --git a/docs/mcp.md b/docs/mcp.md index dfea95cc2..30882b419 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -34,6 +34,10 @@ of the window itself (`screenshot` with `window`) needs it on screen: it is then ### Confining file access +The roots below belong to the **headless** side: the session `figcraft-cli mcp` runs itself, with +no window. A server attached with `--attach` runs the commands inside the app instead, so the app +confines them — from the flags it was started with, not from anything passed to the CLI. + ```sh figcraft-cli mcp --automation-read-root /work/project --automation-write-root /work/project/out ``` From beb87d86965dfc507050bab2cd6c9349d18ab4d8 Mon Sep 17 00:00:00 2001 From: xiaou61 <113765024+xiaou61@users.noreply.github.com> Date: Tue, 20 Oct 2026 11:14:02 +0800 Subject: [PATCH 414/817] M1: describe the fallback the export actually takes (#465) The warning still said fixed and content-sized tracks were written as equal tracks, which the export no longer does. It now reports only the tracks whose size the format can't hold, and only for the tracks an exported grid has. Co-authored-by: xiaou61 <113765024+xiaou61@users.noreply.github.com> --- crates/format/src/fig/export.rs | 19 ++++++++++++------- crates/format/src/fig/export_tests.rs | 2 +- docs/file-format-parity.md | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/crates/format/src/fig/export.rs b/crates/format/src/fig/export.rs index 190f4055c..2d02539eb 100644 --- a/crates/format/src/fig/export.rs +++ b/crates/format/src/fig/export.rs @@ -1436,20 +1436,25 @@ impl<'d> Exporter<'d> { f.extend([("gridColumnGap", fl(l.gap)), ("gridRowGap", fl(l.cross_gap)), ("gridColumns", map(&cols)), ("gridRows", map(&rows))]); // Sizing is keyed by track id like the order map. A track the document doesn't set is // left out, and one the format can't hold keeps its id (the import equalises it). - let sizing = |tracks: &[GridTrack], ids: &[u32]| -> Option> { + let mut dropped = false; + let sizing = |tracks: &[GridTrack], ids: &[u32], dropped: &mut bool| -> Option> { let mut entries = Vec::new(); for (i, id) in ids.iter().enumerate() { let Some(track) = tracks.get(i) else { continue }; - if let Some((kind, value)) = grid_track_size(track) { - let size = || o(vec![("type", e(kind)), ("value", fl(value))]); - entries.push(o(vec![("id", guid(AUX, *id)), ("trackSize", o(vec![("minSizing", size()), ("maxSizing", size())]))])); + match grid_track_size(track) { + Some((kind, value)) => { + let size = || o(vec![("type", e(kind)), ("value", fl(value))]); + entries.push(o(vec![("id", guid(AUX, *id)), ("trackSize", o(vec![("minSizing", size()), ("maxSizing", size())]))])); + } + None => *dropped = true, } } (!entries.is_empty()).then(|| o(vec![("entries", arr(entries))])) }; - let (column_sizing, row_sizing) = (sizing(&l.column_tracks, &cols), sizing(&l.row_tracks, &rows)); - if l.column_tracks.iter().chain(&l.row_tracks).any(|t| grid_track_size(t).is_none()) { - self.warn("grid tracks of fixed or content size were written as equal tracks"); + let column_sizing = sizing(&l.column_tracks, &cols, &mut dropped); + let row_sizing = sizing(&l.row_tracks, &rows, &mut dropped); + if dropped { + self.warn("grid tracks whose size the format can't hold were written as equal tracks"); } for (name, sizing) in [("gridColumnsSizing", column_sizing), ("gridRowsSizing", row_sizing)] { if let Some(v) = sizing { diff --git a/crates/format/src/fig/export_tests.rs b/crates/format/src/fig/export_tests.rs index adb7be6dc..cc47371f9 100644 --- a/crates/format/src/fig/export_tests.rs +++ b/crates/format/src/fig/export_tests.rs @@ -1055,7 +1055,7 @@ fn grid_track_sizes_round_trip() { l.column_tracks[0] = GridTrack::fixed(-5.0); } let (bytes, warnings) = export(&odd, None).unwrap(); - assert_eq!(warnings, vec!["grid tracks of fixed or content size were written as equal tracks".to_string()]); + assert_eq!(warnings, vec!["grid tracks whose size the format can't hold were written as equal tracks".to_string()]); let (back, _) = import(&bytes, "File").unwrap(); let l = back.node(back.pages[0]).and_then(|p| p.children.first()).and_then(|c| back.node(*c)).and_then(|n| n.layout.clone()).unwrap(); assert_eq!(l.column_tracks[0], GridTrack::fill(1.0), "an unwritable track reads back equal"); diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 6b020d725..a745d8c30 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -165,7 +165,7 @@ each. | Date | Change | Summary | |---|---|---| -| 2026-10-20 | minor | `.fig` export writes grid track sizes (`gridColumnsSizing` / `gridRowsSizing`): fixed px, fractional fill and content-sized tracks keep their sizes and come back through our own importer (#465). Tracks whose sizing the format has no name for (a negative or out-of-range size, a constrained min/max) keep their id and read back equal, with the existing warning. Numbers unchanged | +| 2026-10-20 | minor | `.fig` export writes grid track sizes (`gridColumnsSizing` / `gridRowsSizing`): fixed px, fractional fill and content-sized tracks keep their sizes and come back through our own importer (#465). Tracks whose size the format can't hold (a negative or out-of-range value) keep their id and read back equal, with a warning. Numbers unchanged | | 2026-10-18 | minor | REST file JSON import keeps `SLOT` layers (#792): they were dropped with everything placed in them, which emptied every instance's slot. A slot in a main component becomes a slot frame bound to its `SLOT` property (the one it references, else the one named like it, else the only one left), and an instance's slot holds the instance's own content, kept across syncs, moves of the mains and saving, unless the instance's property value is the main's default content (without values, a slot that holds layers keeps them). Instances in slot content link to their own mains. Slot content limits, preferred-only and preferred components are warnings. Synthetic files only. Numbers unchanged | | 2026-10-17 | minor | REST file JSON import reads grid track sizes from the CSS track strings `gridColumnsSizing` / `gridRowsSizing` (fixed px, fill fr, hug `auto`, `minmax(0, 1fr)`, `repeat()`; other tracks stay equal) (#465). Numbers unchanged | | 2026-10-17 | minor | The community batches #727 and #728 in the `.fig` row: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments (also REST), images in the message; budgets from the file's size; the journal keeps no file bytes; the import report. Not read cut to what's left. A `.fig` copy from Save as. Pasted content: layers copied from another design app, best effort (tested only with clipboard HTML made from our own export), and images under Wayland (not run there). All on synthetic files: summary and hours unchanged | From bbe1a12eeb1b91c843e3b531bd6cd14ed36a7b11 Mon Sep 17 00:00:00 2001 From: RiceDee <345114586+RiceDee@users.noreply.github.com> Date: Tue, 20 Oct 2026 15:29:27 +1100 Subject: [PATCH 415/817] test(ui-egui): idle harness scans system fonts before its first frame --- crates/ui-egui/src/idle_tests.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/ui-egui/src/idle_tests.rs b/crates/ui-egui/src/idle_tests.rs index 6ae195464..192073b32 100644 --- a/crates/ui-egui/src/idle_tests.rs +++ b/crates/ui-egui/src/idle_tests.rs @@ -26,6 +26,10 @@ pub(crate) struct Harness { impl Harness { pub(crate) fn new(s: Session) -> Self { + // The one system font scan bumps the layout generation, which makes the canvas render + // again: scanned here, before the first frame, rather than by whichever test happens to + // run first while this one waits for idle (#333). + figcraft_text::scan_system_fonts(); Self { ctx: egui::Context::default(), app: FigApp::new(s, Box::new(NoServices)), time: 0.0 } } From bcd5b6e6329e1e2aabab75a8bef5b6e2a816075e Mon Sep 17 00:00:00 2001 From: RiceDee <345114586+RiceDee@users.noreply.github.com> Date: Tue, 20 Oct 2026 16:18:13 +1100 Subject: [PATCH 416/817] #903: Combine as variants in the context menu and Design panel; Add variant on a lone component --- crates/engine/src/cmd/component.rs | 92 +++++++-- crates/engine/src/lib.rs | 2 + crates/engine/src/variants_discovery_tests.rs | 179 ++++++++++++++++++ crates/ui-egui/src/component_panel.rs | 27 ++- crates/ui-egui/src/lib.rs | 2 + crates/ui-egui/src/menus.rs | 13 ++ .../ui-egui/src/variants_discovery_tests.rs | 111 +++++++++++ docs/components-parity.md | 2 +- 8 files changed, 406 insertions(+), 22 deletions(-) create mode 100644 crates/engine/src/variants_discovery_tests.rs create mode 100644 crates/ui-egui/src/variants_discovery_tests.rs diff --git a/crates/engine/src/cmd/component.rs b/crates/engine/src/cmd/component.rs index bf99c5920..9023b1fa5 100644 --- a/crates/engine/src/cmd/component.rs +++ b/crates/engine/src/cmd/component.rs @@ -56,11 +56,17 @@ pub fn specs() -> Vec { s.set_selection(out.iter().filter_map(id_of).collect()); Ok(json!({"ids": out})) }), - spec!("component.combineVariants", "Combine as variants", "{ids? (components)}", true, combine), + spec!( + "component.combineVariants", + "Combine as variants", + "{ids? (main components; none already a variant, a library copy or inside an instance)} (wraps them in a new component set; names without `=` become \"Property 1=Default\", \"Property 1=VariantN\")", + true, + combine + ), spec!( "component.addVariant", "Add variant", - "{id? (component set or variant), property?, value?} (duplicates the variant; `property`=`value` names the new one)", + "{id? (component set, variant, or a main component not in a set yet: it becomes a set of itself and the new variant), property?, value?} (duplicates the variant; `property`=`value` names the new one)", true, add_variant ), @@ -331,12 +337,11 @@ fn create(s: &mut Session, p: &Value) -> Result { } /// Wrap components in a new component set (named after the first) placed around them. -fn wrap_in_set(doc: &mut Document, ids: &[NodeId]) -> Result { - let cmd = "component.combineVariants"; +fn wrap_in_set(cmd: &str, doc: &mut Document, ids: &[NodeId]) -> Result { let top = *ids.last().ok_or_else(|| bad(cmd, "nothing selected"))?; let parent = doc.get(top)?.parent.ok_or_else(|| bad(cmd, "page"))?; if inside_instance(doc, top) || owning_instance(doc, parent).is_some() { - return Err(EngineError::Disabled(cmd.into(), "components inside an instance can't be combined".into())); + return Err(EngineError::Disabled(cmd.into(), INSIDE_INSTANCE.into())); } let bounds = doc.bounds_of(ids).unwrap_or_default(); let pw = doc.world_transform(parent); @@ -358,22 +363,71 @@ fn wrap_in_set(doc: &mut Document, ids: &[NodeId]) -> Result { Ok(set) } -fn combine(s: &mut Session, p: &Value) -> Result { - let cmd = "component.combineVariants"; - let ids = req_targets(cmd, s, p)?; - let doc = s.doc_mut()?; +const INSIDE_INSTANCE: &str = "components inside an instance can't become variants"; + +/// Why `ids` (distinct) can't become the variants of a new component set, or `None` when they +/// can: anything but main components, components that are variants already (combining them would +/// put a set in a set), library copies, components inside an instance, and a component inside +/// another one of `ids`. +fn combine_refusal(doc: &Document, ids: &[NodeId]) -> Option<&'static str> { if !ids.iter().all(|i| doc.node(*i).is_some_and(|n| matches!(n.kind, NodeKind::Component { .. }))) { - return Err(bad(cmd, "select components only")); + Some("select components only") + } else if ids.iter().any(|i| variant_set(doc, *i).is_some()) { + Some("components that are variants already can't be combined again") + } else if ids.iter().any(|i| doc.is_remote(*i)) { + Some(crate::library::READ_ONLY) + } else if ids.iter().any(|i| inside_instance(doc, *i)) { + Some(INSIDE_INSTANCE) + } else if roots(doc, ids).len() != ids.len() { + Some("a component can't be combined with one inside it") + } else { + None } - let ids = z_sorted(doc, &ids); - let set = wrap_in_set(doc, &ids)?; +} + +/// Whether "Combine as variants" is on offer for `ids` (menus and the Design panel): two or more +/// main components that [`combine_refusal`] lets through. +pub fn can_combine_variants(doc: &Document, ids: &[NodeId]) -> bool { + ids.len() >= 2 && combine_refusal(doc, ids).is_none() && ids.iter().collect::>().len() == ids.len() +} + +/// Whether "Add variant" is on offer for `id`: a component set with variants, a variant, or a main +/// component not in a set yet (it becomes one); never a library copy or inside an instance. +pub fn can_add_variant(doc: &Document, id: NodeId) -> bool { + let Some(n) = doc.node(id) else { return false }; + let local = !doc.is_remote(id) && !inside_instance(doc, id); + match n.kind { + NodeKind::ComponentSet { .. } => { + local && n.children.iter().any(|c| doc.node(*c).is_some_and(|c| matches!(c.kind, NodeKind::Component { .. }))) + } + NodeKind::Component { .. } => local, + _ => false, + } +} + +/// Wrap `ids` (z-sorted main components) in a new component set, naming them "Property 1=Default", +/// "Property 1=VariantN" unless already in prop=value form. Returns the set. +fn make_variant_set(cmd: &str, doc: &mut Document, ids: &[NodeId]) -> Result { + let set = wrap_in_set(cmd, doc, ids)?; for (k, i) in ids.iter().enumerate() { - // Name variants "Property 1=Variant N" unless already in prop=value form. let node = doc.get_mut(*i)?; if !node.name.contains('=') { node.name = format!("Property 1={}", if k == 0 { "Default".to_string() } else { format!("Variant{}", k + 1) }); } } + Ok(set) +} + +fn combine(s: &mut Session, p: &Value) -> Result { + let cmd = "component.combineVariants"; + 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_mut()?; + if let Some(why) = combine_refusal(doc, &ids) { + return Err(EngineError::Disabled(cmd.into(), why.into())); + } + let ids = z_sorted(doc, &ids); + let set = make_variant_set(cmd, doc, &ids)?; s.set_selection(vec![set]); Ok(json!({"id": set})) } @@ -397,15 +451,19 @@ fn fit_set(doc: &mut Document, set: NodeId) { fn add_variant(s: &mut Session, p: &Value) -> Result { let cmd = "component.addVariant"; - let t = targets(s, p).first().copied().ok_or_else(|| bad(cmd, "select a component set or variant"))?; + let t = targets(s, p).first().copied().ok_or_else(|| bad(cmd, "select a component set or component"))?; let doc = s.doc_mut()?; let (set, base) = match doc.get(t)?.kind { NodeKind::ComponentSet { .. } => { let last = doc.get(t)?.children.last().copied().ok_or_else(|| bad(cmd, "the component set is empty"))?; (t, last) } - NodeKind::Component { .. } => (variant_set(doc, t).ok_or_else(|| bad(cmd, "the component isn't a variant (combine as variants first)"))?, t), - _ => return Err(bad(cmd, "select a component set or variant")), + NodeKind::Component { .. } => match variant_set(doc, t) { + Some(set) => (set, t), + // A main component on its own becomes a set of itself, then gains the new variant. + None => (make_variant_set(cmd, doc, &[t])?, t), + }, + _ => return Err(bad(cmd, "select a component set or component")), }; let options = variant_options(doc, set); let mut pairs = variant_props(&doc.get(base)?.name); @@ -1103,7 +1161,7 @@ fn add_prop_for(cmd: &str, s: &mut Session, p: &Value) -> Result { .unwrap_or_else(|| "Default".into()); let set = match owner { Owner::Set(s) => s, - Owner::Comp(c) => wrap_in_set(doc, &[c])?, + Owner::Comp(c) => wrap_in_set(cmd, doc, &[c])?, }; for c in Owner::Set(set).components(doc) { let cn = doc.get_mut(c)?; diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 0871eebf4..68f805786 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1881,6 +1881,8 @@ mod variables_import_shapes_tests; #[cfg(test)] mod variables_io_tests; #[cfg(test)] +mod variants_discovery_tests; +#[cfg(test)] mod vector_behaviour_tests; #[cfg(test)] mod vector_multi_behaviour_tests; diff --git a/crates/engine/src/variants_discovery_tests.rs b/crates/engine/src/variants_discovery_tests.rs new file mode 100644 index 000000000..b792e727c --- /dev/null +++ b/crates/engine/src/variants_discovery_tests.rs @@ -0,0 +1,179 @@ +//! Combine as variants and Add variant where people look for them (#903): the predicates the +//! context menu and the Design panel offer them by, combining refusing components that are +//! variants already (it used to put a set inside a set), and Add variant on a main component that +//! isn't in a set yet making it one. + +use serde_json::json; + +use crate::Session; +use crate::cmd::component::{can_add_variant, can_combine_variants}; +use crate::components::tests::{ex, healthy, idv, kids, node}; +use figcraft_doc::*; + +/// A main component named `name` at `x`, made from a 120×40 frame with a "Bg" rectangle. +fn component(s: &mut Session, name: &str, x: f64) -> NodeId { + let f = idv(&ex(s, "frame.create", json!({"x": x, "y": 0, "width": 120, "height": 40, "name": name}))); + ex(s, "shape.rectangle", json!({"x": 0, "y": 0, "width": 120, "height": 40, "parent": f, "props": {"name": "Bg"}})); + idv(&ex(s, "component.create", json!({"ids": [f]}))) +} + +fn undo_len(s: &Session) -> usize { + s.ds().unwrap().history.undo.len() +} + +fn sets(s: &Session) -> usize { + s.doc().unwrap().nodes().filter(|n| matches!(n.kind, NodeKind::ComponentSet { .. })).count() +} + +#[test] +fn combine_is_offered_for_two_or_more_main_components_only() { + let mut s = Session::new(); + let a = component(&mut s, "A", 0.0); + let b = component(&mut s, "B", 200.0); + let frame = idv(&ex(&mut s, "frame.create", json!({"x": 0, "y": 300, "width": 50, "height": 50}))); + let inst = idv(&ex(&mut s, "instance.create", json!({"component": a, "x": 0, "y": 400}))); + let doc = s.doc().unwrap(); + assert!(can_combine_variants(doc, &[a, b])); + assert!(!can_combine_variants(doc, &[]), "nothing selected"); + assert!(!can_combine_variants(doc, &[a]), "one component (the command still takes it)"); + assert!(!can_combine_variants(doc, &[a, a]), "the same component twice"); + assert!(!can_combine_variants(doc, &[a, frame]), "a frame isn't a component"); + assert!(!can_combine_variants(doc, &[a, inst]), "an instance isn't a main component"); + + let c = component(&mut s, "C", 400.0); + let d = component(&mut s, "D", 600.0); + let set = idv(&ex(&mut s, "component.combineVariants", json!({"ids": [c, d]}))); + let doc = s.doc().unwrap(); + assert!(!can_combine_variants(doc, &[c, d]), "variants of one set"); + assert!(!can_combine_variants(doc, &[c, a]), "a variant and a lone component"); + assert!(!can_combine_variants(doc, &[set, a]), "a set isn't a component"); + + // Components in different frames still combine. + let holder = idv(&ex(&mut s, "frame.create", json!({"x": 0, "y": 600, "width": 300, "height": 100}))); + let e = component(&mut s, "E", 0.0); + ex(&mut s, "node.reparent", json!({"ids": [e], "parent": holder})); + assert!(can_combine_variants(s.doc().unwrap(), &[a, e])); +} + +#[test] +fn add_variant_is_offered_for_sets_variants_and_lone_components() { + let mut s = Session::new(); + let a = component(&mut s, "A", 0.0); + let b = component(&mut s, "B", 200.0); + let lone = component(&mut s, "Lone", 400.0); + let set = idv(&ex(&mut s, "component.combineVariants", json!({"ids": [a, b]}))); + let frame = idv(&ex(&mut s, "frame.create", json!({"x": 0, "y": 300, "width": 50, "height": 50}))); + let inst = idv(&ex(&mut s, "instance.create", json!({"component": lone, "x": 0, "y": 400}))); + let doc = s.doc().unwrap(); + assert!(can_add_variant(doc, set)); + assert!(can_add_variant(doc, a)); + assert!(can_add_variant(doc, lone)); + assert!(!can_add_variant(doc, frame)); + assert!(!can_add_variant(doc, inst)); + assert!(!can_add_variant(doc, kids(&s, inst)[0]), "a layer inside an instance"); + assert!(!can_add_variant(doc, NodeId(999_999))); +} + +#[test] +fn combining_variants_again_is_refused_instead_of_nesting_sets() { + let mut s = Session::new(); + let a = component(&mut s, "State=Default", 0.0); + let b = component(&mut s, "State=Hover", 200.0); + let lone = component(&mut s, "State=Pressed", 400.0); + let set = idv(&ex(&mut s, "component.combineVariants", json!({"ids": [a, b]}))); + let before = s.doc().unwrap().clone(); + let steps = undo_len(&s); + for ids in [vec![a, b], vec![a, lone]] { + let err = s.execute("component.combineVariants", &json!({"ids": ids})).unwrap_err(); + assert!(err.to_string().contains("variants already"), "{err}"); + } + assert_eq!(*s.doc().unwrap(), before, "a refused combine changes nothing"); + assert_eq!(undo_len(&s), steps); + assert_eq!(sets(&s), 1); + assert_eq!(kids(&s, set), vec![a, b]); + // One lone component still makes a set of one (other commands rely on it). + ex(&mut s, "component.combineVariants", json!({"ids": [lone]})); + assert_eq!(sets(&s), 2); + healthy(&s); +} + +#[test] +fn combining_refuses_nested_components_and_components_inside_instances() { + let mut s = Session::new(); + // A "Card" component holding an "Icon" component. + let card = idv(&ex(&mut s, "frame.create", json!({"x": 0, "y": 0, "width": 200, "height": 100, "name": "Card"}))); + let icon = idv(&ex(&mut s, "frame.create", json!({"x": 10, "y": 10, "width": 20, "height": 20, "name": "Icon", "parent": card}))); + let icon = idv(&ex(&mut s, "component.create", json!({"ids": [icon]}))); + let card = idv(&ex(&mut s, "component.create", json!({"ids": [card]}))); + let other = component(&mut s, "Other", 300.0); + let inst = idv(&ex(&mut s, "instance.create", json!({"component": card, "x": 0, "y": 300}))); + let inner = kids(&s, inst).into_iter().find(|c| matches!(node(&s, *c).kind, NodeKind::Component { .. })).expect("the instance's copy of Icon"); + + let doc = s.doc().unwrap(); + assert!(!can_combine_variants(doc, &[card, icon]), "a component and one inside it"); + assert!(can_combine_variants(doc, &[icon, other]), "a nested component with another one is fine"); + assert!(!can_combine_variants(doc, &[inner, other]), "a component inside an instance"); + let before = s.doc().unwrap().clone(); + let err = s.execute("component.combineVariants", &json!({"ids": [card, icon]})).unwrap_err(); + assert!(err.to_string().contains("inside it"), "{err}"); + assert_eq!(*s.doc().unwrap(), before); +} + +#[test] +fn add_variant_on_a_lone_component_makes_it_a_set_in_one_step() { + let mut s = Session::new(); + let c = component(&mut s, "Button", 0.0); + let inst = idv(&ex(&mut s, "instance.create", json!({"component": c, "x": 0, "y": 300}))); + let before = s.doc().unwrap().clone(); + let steps = undo_len(&s); + + let v = idv(&ex(&mut s, "component.addVariant", json!({"id": c}))); + let set = node(&s, c).parent.unwrap(); + let set_node = node(&s, set); + assert!(matches!(set_node.kind, NodeKind::ComponentSet { .. })); + assert_eq!(set_node.name, "Button", "the set takes the component's name"); + assert_eq!(kids(&s, set), vec![c, v]); + assert_eq!(node(&s, c).name, "Property 1=Default"); + assert_eq!(node(&s, v).name, "Property 1=Variant2"); + assert_eq!(s.selection(), vec![v]); + assert!(set_node.height >= 40.0 * 2.0 + 20.0, "the set wraps both variants: {}", set_node.height); + assert!(matches!(node(&s, inst).kind, NodeKind::Instance { component, .. } if component == c), "instances keep their main"); + assert_eq!(undo_len(&s), steps + 1, "wrapping and adding are one undo step"); + healthy(&s); + + s.undo().unwrap(); + assert_eq!(*s.doc().unwrap(), before, "undo puts the lone component back"); +} + +#[test] +fn add_variant_on_a_lone_component_keeps_prop_value_names_and_rolls_back_on_errors() { + let mut s = Session::new(); + let c = component(&mut s, "Size=Small", 0.0); + let before = s.doc().unwrap().clone(); + let steps = undo_len(&s); + assert!(s.execute("component.addVariant", &json!({"id": c, "property": "Nope", "value": "x"})).is_err()); + assert_eq!(*s.doc().unwrap(), before, "a refused Add variant leaves no set behind"); + assert_eq!(undo_len(&s), steps); + + let v = idv(&ex(&mut s, "component.addVariant", json!({"id": c, "property": "Size", "value": "Large"}))); + assert_eq!(node(&s, c).name, "Size=Small"); + assert_eq!(node(&s, v).name, "Size=Large"); + healthy(&s); +} + +#[test] +fn add_variant_on_a_lone_component_in_auto_layout_keeps_its_place() { + let mut s = Session::new(); + let row = idv(&ex(&mut s, "frame.create", json!({"x": 0, "y": 0, "width": 400, "height": 100, "name": "Row"}))); + ex(&mut s, "layout.add", json!({"ids": [row]})); + let first = idv(&ex(&mut s, "shape.rectangle", json!({"x": 0, "y": 0, "width": 40, "height": 40, "parent": row}))); + let c = component(&mut s, "Chip", 0.0); + ex(&mut s, "node.reparent", json!({"ids": [c], "parent": row})); + let last = idv(&ex(&mut s, "shape.rectangle", json!({"x": 0, "y": 0, "width": 40, "height": 40, "parent": row}))); + + ex(&mut s, "component.addVariant", json!({"id": c})); + let set = node(&s, c).parent.unwrap(); + assert_eq!(kids(&s, row), vec![first, set, last], "the set takes the component's place in the row"); + assert_eq!(kids(&s, set).len(), 2); + healthy(&s); +} diff --git a/crates/ui-egui/src/component_panel.rs b/crates/ui-egui/src/component_panel.rs index 6c9ff7d41..2b2573c78 100644 --- a/crates/ui-egui/src/component_panel.rs +++ b/crates/ui-egui/src/component_panel.rs @@ -2,8 +2,9 @@ //! //! - An instance: its main component (with a swap menu), variant dropdowns, property values, //! the selected layer's overrides, and Reset / Detach / Go to main / Push changes. -//! - A component or component set: its properties (add, rename, default, delete) and, for a set, -//! the variant property matrix. +//! - A component or component set: its properties (add, rename, default, delete), Add variant +//! (a lone main component becomes a set) and, for a set, the variant property matrix. +//! - Several main components: Combine as variants. //! - A layer inside a component: bind its visibility / text / instance to a property, or make a //! frame a slot. //! - A slot inside an instance (and an instance's slot properties): fill it with components @@ -11,6 +12,7 @@ use egui::{Id, Sense, Ui, vec2}; use figcraft_doc::*; +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, slot_def, slot_edited, slots_of, variant_conflicts, variant_options, variant_props, variant_set, @@ -27,7 +29,10 @@ use crate::widgets; /// Entry point (called from the Design panel header for every selection). pub fn instance_section(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { - let [id] = sel else { return }; + let [id] = sel else { + combine_ui(app, ui, doc, sel); + return; + }; let Some(n) = doc.node(*id) else { return }; match &n.kind { NodeKind::Instance { .. } => instance_ui(app, ui, doc, n), @@ -57,6 +62,19 @@ pub fn instance_section(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[No } } +/// Two or more main components selected: a button combines them into a component set. +fn combine_ui(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { + if !can_combine_variants(doc, sel) { + return; + } + row(ui, 32.0, |ui| { + let label = crate::i18n::command("component.combineVariants", "Combine as variants"); + if widgets::dropdown(ui, &label, 160.0, Some(Icon::ComponentSet)).clicked() { + app.run("component.combineVariants", json!({"ids": sel})); + } + }); +} + /// A component's description: a multi-line field, saved when it loses focus. fn description_ui(app: &mut FigApp, ui: &mut Ui, id: NodeId, description: &str) { widgets::separator(ui); @@ -365,7 +383,8 @@ fn properties_ui(app: &mut FigApp, ui: &mut Ui, doc: &Document, owner: NodeId) { }); } } - if is_set { + // A lone main component too: Add variant makes it a set of itself and the new variant. + if can_add_variant(doc, owner) { row(ui, 32.0, |ui| { if widgets::dropdown(ui, tr("Add variant"), 120.0, Some(Icon::Plus)).clicked() { app.run("component.addVariant", json!({"id": owner})); diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 072aec62d..363b5d33d 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -215,6 +215,8 @@ mod variables_export_ui_tests; #[cfg(test)] mod variables_rename_tests; #[cfg(test)] +mod variants_discovery_tests; +#[cfg(test)] mod vector_panel_tests; #[cfg(test)] mod vector_tail_ui_tests; diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index e81a7c493..9659c6b33 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -853,6 +853,14 @@ pub fn popups(app: &mut FigApp, ctx: &egui::Context) { None } }); + // Two or more main components combine into a component set. Judged on the selection + // the command acts on: a layer row right-clicked in a multi-selection passes only itself. + let combine = app + .session + .doc() + .ok() + .filter(|doc| figcraft_engine::cmd::component::can_combine_variants(doc, &app.session.selection())) + .map(|_| i18n::command("component.combineVariants", "Combine as variants")); let mut entries: Vec<(&str, &str)> = if has_sel { vec![ (tr("Copy"), "edit.copy"), @@ -910,6 +918,11 @@ pub fn popups(app: &mut FigApp, ctx: &egui::Context) { { entries.insert(at + 1, entry); } + if let Some(label) = &combine + && let Some(at) = entries.iter().position(|e| e.1 == "component.create") + { + entries.insert(at + 1, (label, "component.combineVariants")); + } // A right-clicked ruler guide (selected, with no layers) can be removed. if !has_sel && app.session.ds().is_ok_and(|d| d.selected_guide().is_some()) { entries.splice(0..0, [(tr("Remove guide"), "guide.remove"), ("-", "")]); diff --git a/crates/ui-egui/src/variants_discovery_tests.rs b/crates/ui-egui/src/variants_discovery_tests.rs new file mode 100644 index 000000000..e153d9822 --- /dev/null +++ b/crates/ui-egui/src/variants_discovery_tests.rs @@ -0,0 +1,111 @@ +//! Combine as variants and Add variant where people look for them (#903), driven through egui +//! headless: the Design panel offers Combine for two or more main components and Add variant for +//! a lone one, and the canvas / layers context menu lists Combine only when it applies. + +use egui::Pos2; +use figcraft_doc::{NodeId, NodeKind}; +use figcraft_engine::Session; +use serde_json::json; + +use crate::layers_drag_tests::Ui; +use crate::live_tests::{flat, has_text, text_center}; +use crate::present_tests::id; + +const COMBINE: &str = "Combine as variants"; + +/// A session with lone main components named A, B and C side by side, and a frame. Returns +/// (session, [a, b, c], frame). +fn doc() -> (Session, [NodeId; 3], NodeId) { + let mut s = Session::new(); + let mut comps = Vec::new(); + for (k, name) in ["A", "B", "C"].iter().enumerate() { + let f = id(&s.execute("frame.create", &json!({"x": k * 160, "y": 0, "width": 120, "height": 40, "name": name})).unwrap()); + comps.push(id(&s.execute("component.create", &json!({"ids": [f]})).unwrap())); + } + let frame = id(&s.execute("frame.create", &json!({"x": 0, "y": 200, "width": 60, "height": 60})).unwrap()); + (s, [comps[0], comps[1], comps[2]], frame) +} + +fn select(u: &mut Ui, ids: &[NodeId]) { + u.app.session.execute("select.set", &json!({"ids": ids})).unwrap(); + u.frame(vec![]); +} + +/// The text painted this frame. +fn shows(u: &mut Ui, s: &str) -> Option { + let shapes = flat(&u.frame_output(vec![]).shapes); + has_text(&shapes, s).then(|| text_center(&shapes, s)) +} + +fn click(u: &mut Ui, p: Pos2) { + u.button(p, true); + u.button(p, false); +} + +fn set_of(u: &Ui, c: NodeId) -> Option { + let doc = u.app.session.doc().unwrap(); + doc.node(c).and_then(|n| n.parent).filter(|p| doc.node(*p).is_some_and(|n| matches!(n.kind, NodeKind::ComponentSet { .. }))) +} + +fn undo_len(u: &Ui) -> usize { + u.app.session.ds().unwrap().history.undo.len() +} + +#[test] +fn the_design_panel_combines_two_selected_components() { + let (s, [a, b, _], _) = doc(); + let mut u = Ui::new(s); + select(&mut u, &[a, b]); + let at = shows(&mut u, COMBINE).expect("the Design panel offers Combine as variants"); + let undo = undo_len(&u); + click(&mut u, at); + let set = set_of(&u, a).expect("combined into a set"); + assert_eq!(set_of(&u, b), Some(set)); + assert_eq!(u.app.session.selection(), vec![set]); + assert_eq!(undo_len(&u), undo + 1); + assert!(u.app.ui.last_error.is_none(), "{:?}", u.app.ui.last_error); + assert!(shows(&mut u, COMBINE).is_none(), "a set selected: nothing to combine"); +} + +#[test] +fn the_design_panel_offers_combine_only_when_it_applies() { + // The cases are the engine's (`can_combine_variants`); this pins the panel to it. + let (s, [a, ..], frame) = doc(); + let mut u = Ui::new(s); + select(&mut u, &[a, frame]); + assert!(shows(&mut u, COMBINE).is_none(), "a component and a frame"); +} + +#[test] +fn the_design_panel_adds_a_variant_to_a_lone_component() { + let (s, [a, ..], _) = doc(); + let mut u = Ui::new(s); + select(&mut u, &[a]); + let at = shows(&mut u, "Add variant").expect("a lone main component offers Add variant"); + click(&mut u, at); + let set = set_of(&u, a).expect("the component became a set"); + assert_eq!(u.app.session.doc().unwrap().node(set).unwrap().children.len(), 2); + assert!(u.app.ui.last_error.is_none(), "{:?}", u.app.ui.last_error); +} + +#[test] +fn the_context_menu_lists_combine_for_two_selected_components() { + let (s, [a, b, _], _) = doc(); + let mut u = Ui::new(s); + // One component: no Combine, Create component as before. + select(&mut u, &[a]); + u.app.ui.context_menu = Some((Pos2::new(700.0, 300.0), vec![a])); + assert!(shows(&mut u, COMBINE).is_none()); + assert!(shows(&mut u, "Create component").is_some()); + u.app.ui.context_menu = None; + // Two components, right-clicked on one layer row (the menu gets only that row): judged on + // the selection, which is what the command combines. + select(&mut u, &[a, b]); + u.app.ui.context_menu = Some((Pos2::new(700.0, 300.0), vec![a])); + u.frame(vec![]); + let at = shows(&mut u, COMBINE).expect("the context menu offers Combine as variants"); + click(&mut u, at); + let set = set_of(&u, a).expect("combined into a set"); + assert_eq!(set_of(&u, b), Some(set)); + assert!(u.app.ui.context_menu.is_none(), "the menu closes"); +} diff --git a/docs/components-parity.md b/docs/components-parity.md index dcd93305f..fad4c6fe0 100644 --- a/docs/components-parity.md +++ b/docs/components-parity.md @@ -16,7 +16,7 @@ accounts). | 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; the instance itself resizes and its layers follow the main's constraints | -| Component sets / variants, add variant, switch | done | | +| Component sets / variants, add variant, switch | done | Combine as variants is in the Object menu, and the canvas and layers context menu and the Design panel offer it when two or more main components are selected; Add variant on a main component not in a set yet makes it a set of itself and the new variant, one undo step (#903); components that are variants already aren't combined again (it used to put a set inside a set) | | A main's copy within its file is an instance of it: Duplicate, Alt-drag, Copy then Paste | done | a variant duplicated in its set stays a new variant and a whole set copies as a new set; only the copied roots become instances (a main inside a copied frame is copied as a main); Cut then Paste and pastes into other files keep the component (#892) | | 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 | | From b5a315a7482002343fcb2a4411b4ea6c3b82d2f3 Mon Sep 17 00:00:00 2001 From: RiceDee <345114586+RiceDee@users.noreply.github.com> Date: Tue, 20 Oct 2026 16:32:16 +1100 Subject: [PATCH 417/817] #903: name a new component set from its variants' path, not their first property A component set took its name from the first variant's name up to the first '/' or '=', so variants named "State=Default, Size=Small" made a set called "State". The set now takes the path before the last '/' ("Button/State=Hover" -> "Button", "Icons/Arrow/Dir=Up" -> "Icons/Arrow"), keeps a plain name as is ("Button"), and otherwise gets the next numbered default ("Component 1"), as a new component does. --- crates/engine/src/cmd/component.rs | 15 +++++---- .../engine/src/components_behaviour_tests.rs | 32 +++++++++++++++++++ 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/cmd/component.rs b/crates/engine/src/cmd/component.rs index bf99c5920..47ea804c4 100644 --- a/crates/engine/src/cmd/component.rs +++ b/crates/engine/src/cmd/component.rs @@ -330,6 +330,14 @@ fn create(s: &mut Session, p: &Value) -> Result { Ok(json!({"id": target})) } +/// The name a new component set takes from its first variant: the path before the last '/' +/// ("Button/State=Hover" → "Button"), or a plain name as is ("Button"). A bare "prop=value" name +/// ("State=Default, Size=Small") names no set. +fn set_name_from(variant: &str) -> Option { + let base = variant.rsplit_once('/').map_or(variant, |(path, _)| path).trim(); + (!base.is_empty() && !base.contains('=')).then(|| base.to_string()) +} + /// Wrap components in a new component set (named after the first) placed around them. fn wrap_in_set(doc: &mut Document, ids: &[NodeId]) -> Result { let cmd = "component.combineVariants"; @@ -341,12 +349,7 @@ fn wrap_in_set(doc: &mut Document, ids: &[NodeId]) -> Result { let bounds = doc.bounds_of(ids).unwrap_or_default(); let pw = doc.world_transform(parent); let local = figcraft_geom::transform_rect_bbox(pw.inverse(), bounds.inflate(20.0, 20.0)); - let base = ids - .first() - .and_then(|i| doc.node(*i)) - .map(|n| n.name.split(['/', '=']).next().unwrap_or("Component").trim().to_string()) - .filter(|n| !n.is_empty() && !n.contains(',')) - .unwrap_or_else(|| "Component".into()); + let base = ids.first().and_then(|i| doc.node(*i)).and_then(|n| set_name_from(&n.name)).unwrap_or_else(|| doc.next_name("Component")); let set = doc.alloc_id(); let mut n = Node::new(set, NodeKind::ComponentSet { description: String::new() }, base, local.width(), local.height()); n.transform = figcraft_geom::Affine::translate((local.x0, local.y0)); diff --git a/crates/engine/src/components_behaviour_tests.rs b/crates/engine/src/components_behaviour_tests.rs index ff78f73b5..7a5c1f90a 100644 --- a/crates/engine/src/components_behaviour_tests.rs +++ b/crates/engine/src/components_behaviour_tests.rs @@ -879,3 +879,35 @@ fn auto_layout_instances_follow_their_main() { assert_eq!(node(&s, i).child_layout.min_w, Some(80.0)); healthy(&s); } + +#[test] +fn a_new_component_set_is_named_after_its_first_variant() { + // "Button/State=Hover" groups under "Button": the set takes the path before the last '/'. + // A bare property name ("State=Default, Size=Small") names no set, and neither does an empty + // name: the set gets the next numbered default, like a new component. A plain name is kept. + let rows = [ + ("Button/State=Hover", "Button", "slash-prefixed: the path before the last '/'"), + ("Icons/Arrow/Dir=Up", "Icons/Arrow", "nested path: everything before the last '/'"), + ("State=Default, Size=Small", "Component 1", "bare prop=value: not \"State\""), + ("", "Component 1", "empty name: the numbered default"), + ]; + for (name, expected, why) in rows { + let mut s = Session::new(); + let f = idv(&ex(&mut s, "frame.create", json!({"x": 0, "y": 0, "width": 40, "height": 20}))); + ex(&mut s, "node.set", json!({"id": f, "props": {"name": name}})); + let c = idv(&ex(&mut s, "component.create", json!({"ids": [f]}))); + assert_eq!(node(&s, c).name, name, "{why}: the variant keeps its name"); + let set = idv(&ex(&mut s, "component.combineVariants", json!({"ids": [c]}))); + assert_eq!(node(&s, set).name, expected, "{why}"); + healthy(&s); + } + + // Add variant on a lone component (a variant property on it) wraps it in a set named after it. + let mut s = Session::new(); + let f = idv(&ex(&mut s, "frame.create", json!({"x": 0, "y": 0, "width": 40, "height": 20, "name": "Button"}))); + let c = idv(&ex(&mut s, "component.create", json!({"ids": [f]}))); + let set = idv(&ex(&mut s, "component.addProperty", json!({"id": c, "name": "State", "type": "variant"}))); + assert_eq!(node(&s, set).name, "Button"); + assert_eq!(node(&s, c).name, "State=Default"); + healthy(&s); +} From 49586b1c47d649e5598502227a592630e1c23e66 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Tue, 20 Oct 2026 09:30:01 +0000 Subject: [PATCH 418/817] Reject malformed alpha and extra args in Color::parse_css Found while testing crates/color/src/lib.rs:165 (also :173) Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/color/src/lib.rs | 16 ++++++++++++++-- crates/color/src/tests.rs | 10 ++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/crates/color/src/lib.rs b/crates/color/src/lib.rs index 8e9f98d92..fdad0fa70 100644 --- a/crates/color/src/lib.rs +++ b/crates/color/src/lib.rs @@ -162,7 +162,13 @@ impl Color { p.parse::().ok().map(|v| v / 255.0) } }; - let alpha = parts.get(3).and_then(|a| parse_alpha(a)).unwrap_or(1.0); + let alpha = match parts.get(3) { + Some(a) => parse_alpha(a)?, + None => 1.0, + }; + if parts.len() > 4 { + return None; + } return Some(Self::new(num(0)?, num(1)?, num(2)?, alpha)); } if let Some(inner) = t.strip_prefix("hsla(").or_else(|| t.strip_prefix("hsl(")).and_then(|r| r.strip_suffix(')')) { @@ -170,7 +176,13 @@ impl Color { let h = parts.first()?.trim_end_matches("deg").parse::().ok()?; let s = parts.get(1)?.trim_end_matches('%').parse::().ok()? / 100.0; let l = parts.get(2)?.trim_end_matches('%').parse::().ok()? / 100.0; - let alpha = parts.get(3).and_then(|a| parse_alpha(a)).unwrap_or(1.0); + let alpha = match parts.get(3) { + Some(a) => parse_alpha(a)?, + None => 1.0, + }; + if parts.len() > 4 { + return None; + } return Some(Hsl { h, s, l }.to_color().with_alpha(alpha)); } if t == "transparent" { diff --git a/crates/color/src/tests.rs b/crates/color/src/tests.rs index 4cf875bbf..2216b6fa9 100644 --- a/crates/color/src/tests.rs +++ b/crates/color/src/tests.rs @@ -114,3 +114,13 @@ fn infinite_channels_clamp() { let c = Color::new(f32::INFINITY, f32::NEG_INFINITY, f32::NAN, f32::INFINITY); assert_eq!((c.r, c.g, c.b, c.a), (1.0, 0.0, 0.0, 1.0)); } + +#[test] +fn malformed_alpha_or_extra_args_rejected() { + assert_eq!(Color::parse_css("rgba(0,0,0,abc)"), None); + assert_eq!(Color::parse_css("hsla(0,0%,0%,abc)"), None); + assert_eq!(Color::parse_css("rgb(1,2,3,4,5)"), None); + assert_eq!(Color::parse_css("hsl(0,0%,0%,0.5,1)"), None); + assert_eq!(Color::parse_css("rgb(1,2,3)").unwrap().a, 1.0); + assert_eq!(Color::parse_css("rgba(1,2,3,0.5)").unwrap().a, 0.5); +} From b1f0eafbf7e226b29ecb211b2fe8cee1efce00e5 Mon Sep 17 00:00:00 2001 From: Hamza Date: Tue, 20 Oct 2026 16:29:32 +0500 Subject: [PATCH 419/817] MCP: inspect_document answers within what a client can read MCP stdio is newline-delimited JSON, so one tool result is one message and has to fit the client's read buffer whole; there is no streaming of part of one. The TypeScript SDK's stdio transport defaults to 10 MiB and hosts rarely raise it, so a document whose tree went past that killed the server: the client stopped reading, the pipe broke, and every later call in the session failed. The tree is now reported at the deepest depth that fits, found by bisection, with a `truncated` object giving the depth asked for, the depth used, both sizes, the limit and a pointer to get_node for reading one subtree deeply. `maxBytes` lets a caller that knows its own buffer say so; the default is 8 MiB, leaving the envelope 2 MiB of the usual 10. The size is measured as the transport sends it -- pretty-printed and then escaped inside the text block, which adds about a tenth (342,136 bytes of tree became 379,954 on the wire in the fixture). A kilobyte is reserved for the marker itself, which is added after the measurement. A limit below even the shallowest tree still answers, at depth 0, with the marker saying so: there is nothing smaller to send, and an error would leave the caller with nothing at all. The tool description now says that each level of depth multiplies the response and points at get_node, which the report notes would have been enough on its own to avoid the crash. Fixes #912. --- crates/mcp/src/tools.rs | 87 +++++++++++++++++++++- crates/mcp/tests/inspect_response_limit.rs | 72 ++++++++++++++++++ 2 files changed, 156 insertions(+), 3 deletions(-) create mode 100644 crates/mcp/tests/inspect_response_limit.rs diff --git a/crates/mcp/src/tools.rs b/crates/mcp/src/tools.rs index 7714da5a3..92773e03c 100644 --- a/crates/mcp/src/tools.rs +++ b/crates/mcp/src/tools.rs @@ -173,9 +173,13 @@ pub fn tool_definitions() -> Vec { tool( "inspect_document", "Inspect document", - "The active document as JSON: name, path, dirty flag, current page, selection, the current page's layer tree (id, name, type, x/y relative to the parent frame (groups don't count), width, height, absoluteBounds in page coordinates, fills, strokes, effects, cornerRadius, layout, sizing, text properties, component links, overrides, bound variables), other pages summarised, styles, variable count and the undo history. Use it to verify every change.", + "The active document as JSON: name, path, dirty flag, current page, selection, the current page's layer tree (id, name, type, x/y relative to the parent frame (groups don't count), width, height, absoluteBounds in page coordinates, fills, strokes, effects, cornerRadius, layout, sizing, text properties, component links, overrides, bound variables), other pages summarised, styles, variable count and the undo history. Use it to verify every change. Each level of `depth` multiplies the response, and `allPages` multiplies it again: on a large document the tree is reported at a shallower depth than asked for, with a `truncated` object saying so. Use get_node to read one subtree deeply instead.", obj( - json!({"depth": int("Tree depth for the current page (default 4)"), "allPages": boolean("Expand every page, not only the current one")}), + json!({ + "depth": int("Tree depth for the current page (default 4)"), + "allPages": boolean("Expand every page, not only the current one"), + "maxBytes": int("Largest response to send, in bytes on the wire (default 8388608, which fits the usual 10 MiB client buffer)"), + }), &[], ), true, @@ -562,6 +566,27 @@ fn set_properties(b: &mut dyn Backend, a: &Map) -> Result Result<(Value, usize), String> { + let value = b.call("document.inspect", json!({"depth": depth, "allPages": all}))?; + let text = serde_json::to_string_pretty(&value).unwrap_or_default(); + let wire = serde_json::to_string(&text).map_or(text.len(), |s| s.len()); + Ok((value, wire)) +} + fn inspect_document(b: &mut dyn Backend, a: &Map) -> Result { let depth = n_arg(a, "depth")?.unwrap_or(4.0).clamp(0.0, 64.0) as u64; let all = match a.get("allPages") { @@ -569,7 +594,63 @@ fn inspect_document(b: &mut dyn Backend, a: &Map) -> Result *x, Some(_) => return Err("`allPages` must be a boolean".into()), }; - b.call("document.inspect", json!({"depth": depth, "allPages": all})).map(|v| ToolResult::json(&v)) + // A caller that knows its own buffer can say so; 1 KiB is below the shallowest tree, so the + // floor only keeps the arithmetic sane. + let max_bytes = match n_arg(a, "maxBytes")? { + Some(v) if v < 1024.0 => return Err("`maxBytes` must be at least 1024".into()), + Some(v) => v.min(usize::MAX as f64) as usize, + None => MAX_RESPONSE, + }; + + let (value, wire) = inspect_at(b, depth, all)?; + if wire <= max_bytes || depth == 0 { + return Ok(ToolResult::json(&value)); + } + + // The deepest tree that fits, by bisection: a deeper tree holds every node of a shallower one, + // so the size does not fall as the depth grows. Bisecting keeps this to about six more walks + // of the document rather than one per level. + let (mut lo, mut hi) = (0u64, depth - 1); + let mut best: Option<(u64, Value, usize)> = None; + while lo <= hi { + let mid = lo + (hi - lo) / 2; + let (v, w) = inspect_at(b, mid, all)?; + if w + MARKER_RESERVE <= max_bytes { + best = Some((mid, v, w)); + if mid == hi { + break; + } + lo = mid + 1; + } else if mid == 0 { + // Not even the shallowest tree fits. Send it anyway and say so: there is nothing + // smaller to send, and an error would leave the caller with nothing at all. + best = Some((0, v, w)); + break; + } else { + hi = mid - 1; + } + } + + let Some((used, mut value, used_wire)) = best else { + return Ok(ToolResult::json(&value)); + }; + if let Some(obj) = value.as_object_mut() { + obj.insert( + "truncated".into(), + json!({ + "requestedDepth": depth, + "depth": used, + "requestedDepthBytes": wire, + "bytes": used_wire, + "maxBytes": max_bytes, + "reason": format!( + "the tree at depth {depth} would be {wire} bytes on the wire, over the {max_bytes}-byte limit a client can read in one message; it is reported at depth {used} instead" + ), + "hint": "get_node({id, depth}) walks one subtree at a time, so a deep tree can be read in parts without a size limit", + }), + ); + } + Ok(ToolResult::json(&value)) } fn get_node(b: &mut dyn Backend, a: &Map) -> Result { diff --git a/crates/mcp/tests/inspect_response_limit.rs b/crates/mcp/tests/inspect_response_limit.rs new file mode 100644 index 000000000..0d9f9e6d6 --- /dev/null +++ b/crates/mcp/tests/inspect_response_limit.rs @@ -0,0 +1,72 @@ +//! `inspect_document` must not emit a message larger than a client can read in one piece: MCP +//! stdio is newline-delimited JSON, so one result is one message, and a client whose read buffer +//! it exceeds closes the pipe and kills the server for the rest of the session (#912). +#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)] +mod common; +use common::Client; +use serde_json::{Value, json}; + +/// A document whose tree is far larger than the limits used below. +fn busy() -> Client { + let mut c = Client::new(); + for i in 0..40 { + let frame = c.create(json!({"type": "frame", "x": i * 10, "y": 0, "width": 200, "height": 200})); + for j in 0..12 { + c.create(json!({"type": "rectangle", "parent": frame, "x": j * 5, "y": 5, "width": 20, "height": 20})); + } + } + c +} + +/// The response and what its text block takes on the wire, escaped as the transport sends it. +fn inspect(c: &mut Client, args: Value) -> (Value, usize) { + let r = c.call("inspect_document", args.clone()); + assert_eq!(r["isError"], false, "{args}: {}", r["content"][0]["text"]); + let text = r["content"][0]["text"].as_str().expect("a text block"); + let wire = serde_json::to_string(&text).unwrap().len(); + (serde_json::from_str(text).expect("the block is JSON"), wire) +} + +#[test] +fn a_tree_too_large_for_the_client_is_reported_shallower_and_says_so() { + let mut c = busy(); + let (full, full_wire) = inspect(&mut c, json!({"depth": 6, "allPages": true})); + assert!(full["truncated"].is_null(), "a tree within the limit is not truncated: {}", full["truncated"]); + assert!(full_wire > 30_000, "the fixture has to outgrow the limits below: {full_wire}"); + + // Asked for more than the caller can read: a shallower tree, inside the limit, and a marker. + let (cut, cut_wire) = inspect(&mut c, json!({"depth": 6, "allPages": true, "maxBytes": 30_000})); + assert!(cut_wire <= 30_000, "the response still exceeds maxBytes: {cut_wire}"); + let t = &cut["truncated"]; + assert_eq!(t["requestedDepth"], 6, "{t}"); + assert!(t["depth"].as_u64().unwrap() < 6, "the depth was reduced: {t}"); + assert_eq!(t["maxBytes"], 30_000, "{t}"); + assert_eq!(t["requestedDepthBytes"], full_wire, "the marker says what the full tree would have taken: {t}"); + // The marker points at the way to read the rest. + assert!(t["hint"].as_str().unwrap_or("").contains("get_node"), "{t}"); + // Still a usable document, not just a marker: the page and its top-level layers are there. + assert!(!cut["currentPage"].is_null(), "{cut}"); + assert!(cut["pages"][0]["children"].as_array().is_some_and(|c| !c.is_empty()), "{cut}"); + + // The deepest tree that fits is the one sent: a limit that admits the whole tree is not cut. + let (whole, _) = inspect(&mut c, json!({"depth": 6, "allPages": true, "maxBytes": full_wire})); + assert!(whole["truncated"].is_null(), "a limit at the exact size is not a truncation: {}", whole["truncated"]); +} + +#[test] +fn a_limit_below_the_shallowest_tree_still_answers() { + // Nothing smaller than depth 0 exists, so it is sent with the marker rather than an error: + // an error would leave the caller with nothing at all. + let mut c = busy(); + let (v, _) = inspect(&mut c, json!({"depth": 6, "allPages": true, "maxBytes": 1024})); + assert_eq!(v["truncated"]["depth"], 0, "{}", v["truncated"]); + assert_eq!(v["truncated"]["requestedDepth"], 6, "{}", v["truncated"]); +} + +#[test] +fn maxbytes_is_checked() { + let mut c = Client::new(); + let r = c.call("inspect_document", json!({"depth": 1, "maxBytes": 10})); + assert_eq!(r["isError"], true, "{r}"); + assert!(r["content"][0]["text"].as_str().unwrap_or("").contains("at least 1024"), "{r}"); +} From 31da698dd5509d9f5af26add0e4999b6f04f7a1b Mon Sep 17 00:00:00 2001 From: YarilaFox <102650794+YarilaFox@users.noreply.github.com> Date: Tue, 20 Oct 2026 17:38:11 +0500 Subject: [PATCH 420/817] Fill selected layer when pasting an image --- ROADMAP.md | 1 + crates/engine/src/cmd/create.rs | 23 +++++++++++- crates/engine/src/cmd/edit.rs | 26 ++++++++++++- crates/ui-egui/src/menus.rs | 16 ++++++++ crates/ui-egui/src/paste_image_tests.rs | 49 +++++++++++++++++++++++++ docs/ui-parity.md | 7 +++- 6 files changed, 118 insertions(+), 4 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 4e0d088d3..7d85338a4 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -131,6 +131,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). ## Progress log +- **2026-10-20** · Pasting an image into a selected layer (M7): Cmd/Ctrl+V fills one selected shape, frame, text layer or boolean result with an image copied from another app or from FigCraft, keeping the layer's geometry and one undo step; with no selection or Paste here, it makes a separate image layer. Synthetic clipboard and oval export tests cover the paths. Numbers unchanged. - **2026-10-17** · Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. - **2026-10-17** · Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. - **2026-10-17** · Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index 3a9f6d67f..68375716c 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -83,7 +83,7 @@ pub fn specs() -> Vec { spec!( "image.place", "Place image", - "{data (base64) | path, x?, y?, width?, height?, parent?, mode? (fill|fit|crop|tile)} → {id, image, width, height, imageProfile (its embedded colour profile; null: taken as sRGB)}", + "{data (base64) | path, x?, y?, width?, height?, parent?, target? (an existing shape to fill instead of making a layer), mode? (fill|fit|crop|tile)} → {id, image, width, height, imageProfile (its embedded colour profile; null: taken as sRGB)}", true, place_image ), @@ -372,9 +372,21 @@ fn read_path(path: &str) -> Result> { Err(crate::EngineError::Other(format!("{path}: files can't be read in the browser"))) } +/// Layers that can show an image inside their own outline. +pub fn accepts_image_fill(kind: &NodeKind) -> bool { + kind.is_shape() || kind.is_frame_like() || matches!(kind, NodeKind::Text(_) | NodeKind::BooleanOp { .. }) +} + /// Place an image as a rectangle with an image fill (Figma's image layer). pub fn place_image(s: &mut Session, p: &Value) -> Result { let cmd = "image.place"; + let target = opt_id(cmd, p, "target")?; + if let Some(id) = target { + let node = s.doc()?.node(id).ok_or(crate::EngineError::NoNode(id))?; + if !accepts_image_fill(&node.kind) { + return Err(bad(cmd, "`target` must be a layer that can have a fill")); + } + } let bytes = if let Some(b64) = string(p, "data") { use base64::Engine as _; let b64 = b64.split_once(',').map(|(_, d)| d.to_string()).unwrap_or(b64); @@ -390,6 +402,15 @@ pub fn place_image(s: &mut Session, p: &Value) -> Result { "tile" => ImageScaleMode::Tile, _ => ImageScaleMode::Fill, }; + if let Some(id) = target { + let doc = s.doc_mut()?; + let (hash, _, _) = figcraft_format::add_image(doc, bytes).map_err(|e| bad(cmd, e.to_string()))?; + let profile = figcraft_render::images::profile_name(&hash, doc.images.get(&hash)); + let node = doc.get_mut(id)?; + node.fills = vec![Paint::image(hash.clone(), mode)]; + node.styles.fill = None; + return Ok(json!({"id": id, "image": hash, "width": node.width, "height": node.height, "imageProfile": profile})); + } let page = s.page()?; let parent = crate::params::opt_id(cmd, p, "parent")?.unwrap_or(page); let ds = s.ds_mut()?; diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index a16fbb386..dc9c7b770 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -27,7 +27,7 @@ pub fn specs() -> Vec { 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)} a single copied image fills a selected shape; 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 ), @@ -681,11 +681,33 @@ pub fn paste_into(s: &mut Session, parent: NodeId, at: Option<(f64, f64)>) -> Re Ok(out) } +fn copied_image(s: &Session) -> Option<(String, ImageData)> { + let [(_, nodes)] = s.clipboard.nodes.as_slice() else { return None }; + let [node] = nodes.as_slice() else { return None }; + let [paint] = node.fills.as_slice() else { return None }; + let figcraft_color::PaintKind::Image(image) = &paint.kind else { return None }; + s.clipboard.images.get(&image.image).map(|data| (image.image.clone(), data.clone())) +} + fn paste(s: &mut Session, p: &Value) -> Result { + let sel = s.selection(); + if get(p, "parent").is_none() + && get(p, "x").is_none() + && get(p, "y").is_none() + && let [target] = sel.as_slice() + && s.doc()?.node(*target).is_some_and(|node| super::create::accepts_image_fill(&node.kind)) + && let Some((hash, data)) = copied_image(s) + { + let doc = s.doc_mut()?; + doc.images.entry(hash.clone()).or_insert(data); + let node = doc.get_mut(*target)?; + node.fills = vec![figcraft_color::Paint::image(hash, figcraft_color::ImageScaleMode::Fill)]; + node.styles.fill = None; + return Ok(json!({"ids": [target]})); + } 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). - let sel = s.selection(); let doc = s.doc()?; let copy_local = s.ds()?.uid == s.clipboard.source_doc; let target = id(p, "parent").or_else(|| { diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index e81a7c493..2002be0b1 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -36,6 +36,22 @@ pub const UI_COMMANDS: &[&str] = &[ /// other way to read it). `at`: the page point to paste at (Paste here); `None` pastes in the /// middle of the view. pub fn paste(app: &mut FigApp, event_text: Option<&str>, at: Option<(f64, f64)>) { + let selected_layer = match app.session.selection().as_slice() { + [id] if at.is_none() + && app.session.doc().ok().and_then(|d| d.node(*id)).is_some_and(|n| figcraft_engine::cmd::create::accepts_image_fill(&n.kind)) => + { + Some(*id) + } + _ => None, + }; + if let Some(target) = selected_layer + && let Some((png, _, _)) = clipboard_png(app) + { + use base64::Engine as _; + let b64 = base64::engine::general_purpose::STANDARD.encode(png); + app.run("image.place", json!({"data": b64, "target": target})); + return; + } // Only HTML that holds readable design data takes this path; other HTML pastes as before. if let Some(html) = app.services.clipboard_get_html().filter(|h| figcraft_engine::cmd::edit::design_clipboard_buffer(h).is_some()) { let mut params = json!({"html": html}); diff --git a/crates/ui-egui/src/paste_image_tests.rs b/crates/ui-egui/src/paste_image_tests.rs index b6775f93a..6fbc41014 100644 --- a/crates/ui-egui/src/paste_image_tests.rs +++ b/crates/ui-egui/src/paste_image_tests.rs @@ -58,6 +58,7 @@ impl Win { fn new() -> Self { let mut s = Session::new(); s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 100, "height": 50})).unwrap(); + s.execute("select.none", &json!({})).unwrap(); let ctx = egui::Context::default(); let clip = Rc::new(RefCell::new(Clip::default())); let app = FigApp::new(s, Box::new(Desktop(clip.clone()))); @@ -176,10 +177,57 @@ fn cmd_v_pastes_an_image_copied_elsewhere() { w.copy_image_elsewhere(); w.cmd_v(CMD); assert_eq!(w.named("Pasted image"), 1, "the image was pasted from the key's release"); + w.app.session.execute("select.none", &json!({})).unwrap(); w.cmd_v(CMD); assert_eq!(w.named("Pasted image"), 2, "and again"); } +#[test] +fn cmd_v_fills_a_selected_oval_without_adding_a_layer() { + let mut w = Win::new(); + let oval = + NodeId(w.app.session.execute("shape.ellipse", &json!({"x": 200, "y": 100, "width": 120, "height": 80})).unwrap()["id"].as_u64().unwrap()); + let before = w.app.session.doc().unwrap().node_count(); + let original_fill = w.app.session.doc().unwrap().node(oval).unwrap().fills.clone(); + w.copy_image_elsewhere(); + w.cmd_v(CMD); + + let doc = w.app.session.doc().unwrap(); + let node = doc.node(oval).unwrap(); + assert_eq!(doc.node_count(), before); + assert!(matches!(node.kind, figcraft_doc::NodeKind::Ellipse { .. })); + assert!(matches!(node.fills[0].kind, figcraft_color::PaintKind::Image(_))); + assert_eq!((node.width, node.height), (120.0, 80.0)); + assert_eq!(w.app.session.selection(), vec![oval]); + let png = figcraft_engine::cmd::file::export_bytes(doc, &[oval], figcraft_doc::ExportFormat::Png, 1.0).unwrap(); + let pixels = image::load_from_memory(&png).unwrap().to_rgba8(); + assert_eq!(pixels.get_pixel(0, 0)[3], 0, "the picture stays inside the oval"); + assert_eq!(pixels.get_pixel(60, 40)[3], 255, "the oval contains the picture"); + + w.app.session.undo().unwrap(); + assert_eq!(w.app.session.doc().unwrap().node(oval).unwrap().fills, original_fill); +} + +#[test] +fn cmd_v_fills_a_selected_oval_with_an_image_copied_in_figcraft() { + let mut w = Win::new(); + w.copy_image_elsewhere(); + w.cmd_v(CMD); + let source = w.app.session.selection()[0]; + crate::menus::invoke(&mut w.app, "edit.copy"); + + let oval = + NodeId(w.app.session.execute("shape.ellipse", &json!({"x": 200, "y": 100, "width": 120, "height": 80})).unwrap()["id"].as_u64().unwrap()); + let before = w.app.session.doc().unwrap().node_count(); + w.cmd_v(CMD); + + let doc = w.app.session.doc().unwrap(); + assert_eq!(doc.node_count(), before); + assert!(doc.contains(source)); + assert!(matches!(doc.node(oval).unwrap().fills[0].kind, figcraft_color::PaintKind::Image(_))); + assert_eq!(w.app.session.selection(), vec![oval]); +} + #[test] fn cmd_released_before_v_still_pastes_the_image() { let mut w = Win::new(); @@ -247,6 +295,7 @@ fn a_paste_event_from_another_key_does_not_block_the_next_cmd_v() { // Shift+Insert on Windows. w.frame(vec![Event::Paste("text".into())]); w.frame(vec![key(Key::Insert, false, Modifiers::SHIFT)]); + w.app.session.execute("select.none", &json!({})).unwrap(); w.copy_image_elsewhere(); w.cmd_v(CMD); assert_eq!(w.named("Pasted image"), 1); diff --git a/docs/ui-parity.md b/docs/ui-parity.md index d87103f07..3a53e7470 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-10-18 · **Change:** minor (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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-20 · **Change:** minor (pasting a copied image into one selected fillable layer; 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; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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) · **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: @@ -143,6 +143,10 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look - **Fixed (2026-10-17):** Shift+Cmd/Ctrl+V (Paste over selection) and Alt+Cmd/Ctrl+V (Paste properties) work on the desktop (they were bound but didn't act there, #716); Cmd/Ctrl+V pastes an image copied in another app (#663). Counts above unchanged (the suite checks bindings). +- **Fixed (2026-10-20):** Cmd/Ctrl+V makes an image fill when one fillable layer is selected (a + shape, frame, text or boolean result), whether the image came from the system clipboard or a + copied FigCraft image layer. With no selection it still creates an image layer; Paste here still + uses the requested position. The oval stays an oval and clips the image (`paste_image_tests`). - **Where the documentation disagrees with itself** (noted per row): pixel grid (Shift+' or Cmd+'), letter spacing (Alt or Cmd with < >; Cmd would be the font size keys, Alt bound), Windows remove fill (Alt+/ or Alt+,; Alt+, is letter spacing), the Layers panel on Windows (Alt+1 @@ -172,6 +176,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| +| 2026-10-20 | minor | A copied image pastes as the fill of one selected fillable layer, preserving its outline and size. With no selection, or with Paste here, the image remains a separate layer. Synthetic desktop clipboard tests cover both external and FigCraft copies, an oval's exported pixels, and Undo. Counts and hours unchanged | | 2026-10-20 | minor | Readable disabled and selected text (#890): the dim text colour (disabled buttons, placeholders, hints) is at least 3:1 against panels, fields and selected rows in both themes (it was 2.1:1 in the light theme), a disabled button is grey with that text instead of fading to 40%, and selected text (renaming a page or layer, any text box) takes the theme's readable green on the highlight (1.4:1 in the dark theme before, now 4.2:1 or more); checked with the colour contrast helper (`theme::tests`). Numbers unchanged | | 2026-10-20 | minor | Measuring while nudging (#894): with Alt held over another layer, the arrows nudge the selection (Shift: the big step) and the distances follow every nudge (Alt+arrows used to do nothing); while measuring, the selection's handles and size label hide and both layers keep their outlines (`measure_nudge_tests`). Numbers unchanged | | 2026-10-18 | minor | A rename (layers double-click, F2, File ▸ Rename, a page) selects the whole name in the frame its field first draws, so the first key replaces the name instead of being appended. Checked in the app on Windows over the control channel | From 23463f719b01153ee89bba9c47b6d44fefee03de Mon Sep 17 00:00:00 2001 From: YarilaFox <102650794+YarilaFox@users.noreply.github.com> Date: Tue, 20 Oct 2026 16:23:42 +0500 Subject: [PATCH 421/817] M7: keep saved document titles in sync with filenames --- crates/engine/src/cmd/file.rs | 11 +++++-- crates/engine/src/lib.rs | 4 ++- crates/engine/src/live_access_tests.rs | 4 +-- crates/engine/src/save_format_tests.rs | 40 ++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index 8e59b3031..7380711fe 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -542,7 +542,8 @@ fn load_with( return Ok((figcraft_format::Loaded { issues: warnings, ..doc.into() }, true)); } let mut loaded = figcraft_format::load_bytes_with_versions(bytes).map_err(|e| EngineError::Other(e.to_string()))?; - if loaded.doc.name.is_empty() { + // Older files saved an untouched default title even after the user chose a filename. + if loaded.doc.name.is_empty() || loaded.doc.name == "Untitled" { loaded.doc.name = file_stem(name_hint); } Ok((loaded, false)) @@ -853,8 +854,14 @@ fn save_to(s: &mut Session, path: String) -> Result { } let i = crate::branches::file_tab(s); let ds = s.docs.get_mut(i).ok_or(EngineError::NoDocument)?; - let bytes = file_bytes(ds)?; + let mut snapshot = FileSnapshot::of(ds); + let follows_path = ds.path.as_deref().map_or(ds.doc.name == "Untitled", |old| ds.doc.name == file_stem(old)); + if follows_path && ds.path.as_deref() != Some(path.as_str()) { + Arc::make_mut(&mut snapshot.doc).name = file_stem(&path); + } + let bytes = snapshot.encode()?; write(&path, &bytes)?; + ds.doc = snapshot.doc; ds.path = Some(path.clone()); ds.mark_saved(); ds.revision += 1; diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 0871eebf4..a220dbc41 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1062,7 +1062,9 @@ impl Session { }; let Some(ds) = self.docs.iter_mut().find(|d| d.uid == uid) else { return }; let changed = !Arc::ptr_eq(&ds.doc, &bdoc); - if changed { + // Saving may adopt the chosen filename as the document title. The encoded snapshot is + // already final; normalising it again would detach it from the saved baseline. + if changed && !matches!(spec.id, "file.save" | "file.saveAs") { normalize(ds.doc_mut(), &bdoc); } let edit = changed && ds.interaction.is_none(); diff --git a/crates/engine/src/live_access_tests.rs b/crates/engine/src/live_access_tests.rs index 7f5a4488f..c2c75bb5e 100644 --- a/crates/engine/src/live_access_tests.rs +++ b/crates/engine/src/live_access_tests.rs @@ -265,7 +265,7 @@ fn revert_offline_file_works_while_another_file_is_live_and_after_leaving() { s.execute("file.new", &json!({})).unwrap(); let offline_path = saved_file(&mut s); s.execute("file.revert", &json!({})).unwrap(); - assert_eq!(s.doc().unwrap().name, "Untitled"); + assert_eq!(s.doc().unwrap().name, offline_path.file_stem().unwrap().to_string_lossy()); assert!(!s.ds().unwrap().is_dirty()); assert_eq!(s.ds().unwrap().versions.len(), 1); assert_eq!(s.live_of(uid).doc_uid, Some(uid)); @@ -273,7 +273,7 @@ fn revert_offline_file_works_while_another_file_is_live_and_after_leaving() { s.execute("doc.switch", &json!({"index": 0})).unwrap(); s.execute("collab.leave", &json!({})).unwrap(); s.execute("file.revert", &json!({})).unwrap(); - assert_eq!(s.doc().unwrap().name, "Untitled"); + assert_eq!(s.doc().unwrap().name, path.file_stem().unwrap().to_string_lossy()); assert!(!s.ds().unwrap().is_dirty()); assert_eq!(s.ds().unwrap().versions.len(), 1); assert_eq!(s.live().doc_uid, None); diff --git a/crates/engine/src/save_format_tests.rs b/crates/engine/src/save_format_tests.rs index 4473ef7c8..d635808eb 100644 --- a/crates/engine/src/save_format_tests.rs +++ b/crates/engine/src/save_format_tests.rs @@ -89,6 +89,46 @@ fn assert_save_state_unchanged(s: &Session, before: &DocState, recent: &[String] assert_eq!(s.prefs.recent_files, recent); } +#[test] +fn first_native_save_uses_chosen_filename_for_an_untitled_document() { + let mut files = SaveFiles::new(); + let path = files.path("Redis.figcraft"); + let copy = files.path("Redis copy.figcraft"); + let manual_copy = files.path("Other.figcraft"); + let mut s = Session::new(); + s.execute("file.saveAs", &json!({"path": path.to_string_lossy()})).unwrap(); + assert_eq!(s.ds().unwrap().doc.name, "Redis"); + assert!(!s.ds().unwrap().is_dirty()); + assert_eq!(figcraft_format::load_bytes(&std::fs::read(&path).unwrap()).unwrap().0.name, "Redis"); + + let mut reopened = Session::empty(); + reopened.execute("file.open", &json!({"path": path.to_string_lossy()})).unwrap(); + assert_eq!(reopened.ds().unwrap().doc.name, "Redis"); + + s.execute("file.saveAs", &json!({"path": copy.to_string_lossy()})).unwrap(); + assert_eq!(s.ds().unwrap().doc.name, "Redis copy"); + s.execute("file.rename", &json!({"name": "Chosen title"})).unwrap(); + s.execute("file.saveAs", &json!({"path": manual_copy.to_string_lossy()})).unwrap(); + assert_eq!(s.ds().unwrap().doc.name, "Chosen title"); +} + +#[test] +fn opening_an_older_file_uses_its_filename_only_for_the_default_title() { + let mut files = SaveFiles::new(); + let old_path = files.path("Redis.figcraft"); + let named_path = files.path("Other.figcraft"); + let mut original = Session::new(); + std::fs::write(&old_path, crate::cmd::file::file_bytes(original.ds().unwrap()).unwrap()).unwrap(); + original.execute("file.rename", &json!({"name": "Chosen title"})).unwrap(); + std::fs::write(&named_path, crate::cmd::file::file_bytes(original.ds().unwrap()).unwrap()).unwrap(); + + let mut reopened = Session::empty(); + reopened.execute("file.open", &json!({"path": old_path.to_string_lossy()})).unwrap(); + assert_eq!(reopened.ds().unwrap().doc.name, "Redis"); + reopened.execute("file.open", &json!({"path": named_path.to_string_lossy()})).unwrap(); + assert_eq!(reopened.ds().unwrap().doc.name, "Chosen title"); +} + fn read_fig(path: &std::path::Path, result: &Value) -> figcraft_doc::Document { let bytes = std::fs::read(path).unwrap(); assert_eq!(result["format"], "fig"); From a55963841973ae4fc31122c49349fe6aacc7cdee Mon Sep 17 00:00:00 2001 From: YarilaFox <102650794+YarilaFox@users.noreply.github.com> Date: Tue, 20 Oct 2026 17:57:10 +0500 Subject: [PATCH 422/817] M7: avoid Windows GNU UIA crash --- .cargo/config.toml | 7 +++++++ apps/figcraft/build.rs | 1 + apps/figcraft/src/main.rs | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/.cargo/config.toml b/.cargo/config.toml index acebfe9f0..8abc94d79 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -3,5 +3,12 @@ [env] CRAFT_FONTS_DIR = { value = "../craft-fonts", relative = true } +# The Windows UI Automation adapter can be asked about a node that disappeared in the +# same frame. On MinGW, converting that HRESULT through windows-result's thread COM +# error-info path has crashed in GetErrorInfo. Keep the HRESULT without that extra +# COM lookup; this leaves the AccessKit tree and screen-reader support enabled. +[target.x86_64-pc-windows-gnu] +rustflags = ["--cfg=windows_slim_errors"] + [alias] xtask = "run -q -p xtask --" diff --git a/apps/figcraft/build.rs b/apps/figcraft/build.rs index 64f978350..6ed8a047d 100644 --- a/apps/figcraft/build.rs +++ b/apps/figcraft/build.rs @@ -1,6 +1,7 @@ //! Windows: embed the icon and version info in figcraft.exe and size its main thread's stack //! (no-op elsewhere). fn main() { + println!("cargo::rustc-check-cfg=cfg(windows_slim_errors)"); println!("cargo::rerun-if-changed=../../assets/app-icon/figcraft.ico"); let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default(); if target_os == "windows" { diff --git a/apps/figcraft/src/main.rs b/apps/figcraft/src/main.rs index 00856c5d5..887db45aa 100644 --- a/apps/figcraft/src/main.rs +++ b/apps/figcraft/src/main.rs @@ -15,6 +15,11 @@ #![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)] #![cfg_attr(all(target_os = "windows", not(debug_assertions)), windows_subsystem = "windows")] +// A missing Windows GNU flag re-enables the COM error-info lookup that crashes while AccessKit +// reports a removed UI Automation node. Catch build configurations that drop the workaround. +#[cfg(all(target_os = "windows", target_env = "gnu", not(windows_slim_errors)))] +compile_error!("Windows GNU builds must set windows_slim_errors to keep UI Automation responsive"); + #[cfg(target_os = "macos")] mod apple_events; mod args; From fc37c808aaa83773a27f94e629efe156f7ef5f1a Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Tue, 20 Oct 2026 15:27:27 +0200 Subject: [PATCH 423/817] M7: a document dropped on the canvas opens as a new file (#916) A .figcraft, .fig or file JSON dropped on the canvas ran file.import, which added its pages to the file in front. It now opens as a file of its own, as on the home screen, in the browser too. Images and SVG still import at the drop point; File > Import still adds pages. - pending_open::open_dropped queues a dropped file as file.open; the home screen and the canvas share it. - Dragging only documents over the canvas says "Drop to open" (not in the browser, which names no file until the drop). - The tab-switch import test drops an SVG: it pinned where an import lands, using a .figcraft only as a file to import. --- ROADMAP.md | 1 + crates/ui-egui/src/canvas.rs | 11 ++++-- crates/ui-egui/src/home.rs | 12 ++----- crates/ui-egui/src/home_tests.rs | 55 +++++++++++++++++++++++++++--- crates/ui-egui/src/lib.rs | 6 ++++ crates/ui-egui/src/pending_open.rs | 10 ++++++ 6 files changed, 79 insertions(+), 16 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 4e0d088d3..f43cd015b 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -316,6 +316,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-20 | minor | A document dropped on the canvas opens (#916): a `.figcraft`, `.fig` or file JSON dropped on the canvas opens as a file of its own, as on the home screen, in the browser too; it used to add its pages to the file in front. Images and SVG still import at the drop point, File ▸ Import still adds pages, and dragging only documents over the canvas says "Drop to open" (not in the browser, which names no file until the drop). Numbers unchanged | | 2026-10-20 | minor | Duplicating a main component makes an instance (#892): Duplicate and Alt-drag copied a main component as a second main; within its file the copy is now an instance of it, as Copy then Paste already was (a variant duplicated in its set stays a variant). Numbers unchanged. | | 2026-10-20 | minor | Readable disabled and selected text (#890): the dim text colour (disabled buttons, placeholders, hints) is at least 3:1 against panels, fields and selected rows in both themes (it was 2.1:1 in the light theme), a disabled button is grey with that text instead of fading to 40%, and selected text (renaming a page or layer, any text box) takes the theme's readable green on the highlight (1.4:1 in the dark theme before, now 4.2:1 or more); checked with the colour contrast helper (`theme::tests`). Numbers unchanged | | 2026-10-20 | minor | Layer data reads back (#879): `node.get` (the command, the control method and MCP `get_node`) and `document.inspect` report a layer's or page's `pluginData` as `{key: value}` when it has any, so a tool that keeps state in a file with `node.set {props: {pluginData}}` can read it on its next run (`plugin_data_tests`). Numbers unchanged | diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 491639869..46451ae0c 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -183,7 +183,9 @@ pub fn show(app: &mut FigApp, ui: &mut Ui, worker: &mut Worker) { } } let own_cursor = input(app, ui, &resp); - crate::drop_overlay(&ctx, ctx.content_rect(), tr("Drop to import")); + // A browser names no dragged file until the drop, so documents there still say "import". + let documents = ctx.input(|i| i.raw.hovered_files.iter().all(|f| f.path.as_deref().is_some_and(crate::is_document))); + crate::drop_overlay(&ctx, ctx.content_rect(), if documents { tr("Drop to open") } else { tr("Drop to import") }); crate::guides::end_released(&ctx); crate::live::track_pointer(app, &ctx); app.sync_preedit(); @@ -504,10 +506,15 @@ fn input(app: &mut FigApp, ui: &mut Ui, resp: &egui::Response) -> bool { if !app.canvas.dragging && crate::selection_spacing::input(app, &ctx, hover_pos, resp.hovered(), app.canvas.space_pan) { return false; } - // Dropped files import onto the canvas, behind a card while they do ([`crate::pending_open`]). + // Dropped files import onto the canvas, behind a card while they do ([`crate::pending_open`]); + // a dropped document opens as a file of its own, as on the home screen. let dropped = ctx.input(|i| i.raw.dropped_files.clone()); for f in dropped { let path = f.path().to_path_buf(); + if crate::is_document(&path) { + crate::pending_open::open_dropped(app, &f); + continue; + } let pt = hover_pos.map(|h| app.to_page(h)).unwrap_or_default(); let name = path.file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_else(|| "dropped.png".into()); let (params, read) = if path.exists() { diff --git a/crates/ui-egui/src/home.rs b/crates/ui-egui/src/home.rs index c174242a3..b532d9a7e 100644 --- a/crates/ui-egui/src/home.rs +++ b/crates/ui-egui/src/home.rs @@ -180,19 +180,11 @@ pub fn show(app: &mut FigApp, ui: &mut Ui) { fn dropped(app: &mut FigApp, ctx: &egui::Context) { let files = ctx.input(|i| i.raw.dropped_files.clone()); for f in files { - let path = f.path().to_path_buf(); - if !crate::opens(&path) { + if !crate::opens(f.path()) { app.toast(tr("Drop a .figcraft, .fig, .json, .svg or image file.")); continue; } - // `opens` saw an extension, so there is a file name to tell the format by. - let name = path.file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_default(); - let (params, read) = if path.exists() { - (json!({"path": path.to_string_lossy()}), None) - } else { - (json!({"name": name}), Some(crate::dropped_bytes(&f, &name))) - }; - app.ui.pending_opens.push(crate::pending_open::PendingOpen { label: name, params, command: "file.open", target: None, read }); + crate::pending_open::open_dropped(app, &f); } } diff --git a/crates/ui-egui/src/home_tests.rs b/crates/ui-egui/src/home_tests.rs index c74c35bff..ebbf6d95e 100644 --- a/crates/ui-egui/src/home_tests.rs +++ b/crates/ui-egui/src/home_tests.rs @@ -668,9 +668,8 @@ fn dropping_a_native_file_on_the_home_screen_opens_it() { #[test] fn dropping_a_native_file_on_canvas_keeps_its_receiving_document_after_tab_switch() { let dir = Temp::new(); - let path = dir.path("Canvas import.figcraft"); - let mut source = Session::new(); - source.execute("file.saveAs", &json!({"path": path.to_string_lossy()})).unwrap(); + let path = dir.path("Canvas import.svg"); + std::fs::write(&path, r#""#).unwrap(); let mut session = Session::new(); let target_uid = session.ds().unwrap().uid; @@ -696,7 +695,55 @@ fn dropping_a_native_file_on_canvas_keeps_its_receiving_document_after_tab_switc u.frame(vec![]); assert_eq!(u.app.session.ds().unwrap().uid, other_uid, "the user's active tab stays in front"); - assert_eq!(u.app.session.docs.iter().map(|doc| doc.doc.pages.len()).collect::>(), [2, 1]); + let layers = |uid: u64| { + let doc = &u.app.session.docs.iter().find(|doc| doc.uid == uid).unwrap().doc; + doc.node(doc.pages[0]).unwrap().children.len() + }; + assert_eq!((layers(target_uid), layers(other_uid)), (1, 0), "the drop lands in the tab that received it"); +} + +#[test] +fn dropping_a_document_on_canvas_opens_it_as_a_new_file() { + let dir = Temp::new(); + let path = dir.path("Dropped.figcraft"); + let mut saved = Session::new(); + saved.execute("file.saveAs", &json!({"path": path.to_string_lossy()})).unwrap(); + let mut u = Ui::new(Session::new()); + u.app.ui.home = false; + u.frame(vec![]); + let before = u.app.session.doc().unwrap().clone(); + let s = drop_file(&mut u, &path); + assert!(has_text(&s, "Drop to open"), "dragging a document over the canvas says it opens"); + let s = flat(&u.frame_output(vec![]).shapes); + assert!(has_text(&s, "Opening as a new file"), "the card says so too"); + u.frame(vec![]); + assert!(u.app.ui.pending_opens.is_empty()); + assert_eq!(u.app.session.docs.len(), 2, "a tab of its own"); + assert_eq!(u.app.session.ds().unwrap().path.as_deref(), Some(path.to_string_lossy().as_ref()), "in front"); + assert_eq!(u.app.session.docs[0].doc.as_ref(), &before, "the file that was open gets no pages added"); +} + +#[test] +fn a_document_dropped_on_canvas_without_a_file_on_disk_opens_as_a_new_file() { + // Every drop in the browser (#916). + let dir = Temp::new(); + let saved = dir.path("Saved.figcraft"); + Session::new().execute("file.saveAs", &json!({"path": saved.to_string_lossy()})).unwrap(); + let bytes = std::fs::read(&saved).unwrap(); + let mut u = Ui::new(Session::new()); + u.app.ui.home = false; + u.frame(vec![]); + let pos = u.app.canvas.rect.center(); + let file: egui::DroppedFileHandle = std::sync::Arc::new(DroppedBytes("Shared.figcraft".into(), bytes)); + u.frame_raw(egui::RawInput { events: vec![Event::PointerMoved(pos)], dropped_files: vec![file], ..Default::default() }); + for _ in 0..3 { + u.frame(vec![]); + } + assert!(u.app.ui.pending_opens.is_empty()); + assert_eq!(u.app.ui.last_error, None); + assert_eq!(u.app.session.docs.len(), 2, "a tab of its own"); + assert_eq!(u.app.session.docs[0].doc.pages.len(), 1, "no pages added to the open file"); + assert_eq!(u.app.session.docs[1].path, None, "with no save path made up for it"); } #[test] diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 072aec62d..0fd22c53d 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1817,6 +1817,12 @@ pub(crate) fn opens(path: &Path) -> bool { path.extension().and_then(|e| e.to_str()).is_some_and(|e| OPEN_EXTENSIONS.iter().any(|x| x.eq_ignore_ascii_case(e))) } +/// Whether `path` is a whole document (`.figcraft`, `.fig`, file JSON) rather than an image or SVG: +/// dropped on the canvas it opens as a file of its own instead of adding its pages to the open one. +pub(crate) fn is_document(path: &Path) -> bool { + path.extension().and_then(|e| e.to_str()).is_some_and(|e| ["figcraft", "fig", "json"].iter().any(|x| x.eq_ignore_ascii_case(e))) +} + /// Reads the contents of dropped file `name` that has no file on disk to read by path. #[cfg(not(target_arch = "wasm32"))] pub(crate) fn dropped_bytes(f: &egui::DroppedFileHandle, name: &str) -> ReadFuture { diff --git a/crates/ui-egui/src/pending_open.rs b/crates/ui-egui/src/pending_open.rs index 501367c0c..f5e978c61 100644 --- a/crates/ui-egui/src/pending_open.rs +++ b/crates/ui-egui/src/pending_open.rs @@ -32,6 +32,16 @@ pub struct ImportTarget { pub name: String, } +/// Queues dropped file `f` to open as a document of its own: by path, or by its contents when there +/// is no file on disk to read. Callers checked its extension, so there is a name to tell the format by. +pub(crate) fn open_dropped(app: &mut FigApp, f: &egui::DroppedFileHandle) { + let path = f.path(); + let name = path.file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_default(); + let (params, read) = + if path.exists() { (json!({"path": path.to_string_lossy()}), None) } else { (json!({"name": name}), Some(crate::dropped_bytes(f, &name))) }; + app.ui.pending_opens.push(PendingOpen { label: name, params, command: "file.open", target: None, read }); +} + fn run_pending(app: &mut FigApp, pending: PendingOpen) -> Option { let target = match pending.target { Some(target) => target, From cabe2e3cfb14a26cf4d5049ece9d27b812781f66 Mon Sep 17 00:00:00 2001 From: Lucas Date: Tue, 20 Oct 2026 15:58:55 +0200 Subject: [PATCH 424/817] i18n(pl): native review, catch-up and terminology fixes - Mark Polish catalog as reviewed and approved by native speaker (@lukasz-sklad) - Replace "Lekki" with "Jasny" for Light mode - Translate disambiguated context keys (Fill|sizing, Join|stroke, Light|glass, Open|comments) - Catch up with 15 UI strings added in recent main commits - Update docs/translating.md to list Polish as reviewed --- crates/ui-egui/locales/pl.toml | 30 +++++++++++++++++++++++------- docs/translating.md | 12 ++++++------ 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/crates/ui-egui/locales/pl.toml b/crates/ui-egui/locales/pl.toml index 23f7dee8e..b6a7bf532 100644 --- a/crates/ui-egui/locales/pl.toml +++ b/crates/ui-egui/locales/pl.toml @@ -1,10 +1,11 @@ # FigCraft interface strings: Polish. # -# Draft: machine-drafted, waiting for a native speaker's review. +# Wording reviewed and approved by Lucas (@lukasz-sklad). +# Complete Polish localization for FigCraft. +# See docs/translating.md; plural forms follow Polish CLDR integer rules. [meta] name = "Polski" -status = "draft — needs native review" [ui] "% of all commits" = "% wszystkich commitów" @@ -171,6 +172,7 @@ status = "draft — needs native review" "Both directions" = "W obu kierunkach" "Bottom" = "Dół" "Bottom left radius" = "Promień lewego dolnego narożnika" +"Bottom padding" = "Margines dolny" "Bottom right radius" = "Promień prawego dolnego narożnika" "Branch" = "Gałąź" "Branch archived" = "Gałąź zarchiwizowana" @@ -501,7 +503,7 @@ status = "draft — needs native review" "Fill container" = "Wypełnij kontener" "Fill window" = "Wypełnij okno" "Fills" = "Wypełnienia" -"Fill|sizing" = "Fill|sizing" +"Fill|sizing" = "Wypełnij" "Filter and sort" = "Filtruj i sortuj" "Find" = "Znajdź" "Find and replace" = "Znajdź i zamień" @@ -632,6 +634,7 @@ status = "draft — needs native review" "Included" = "Uwzględniono" "Included in layout" = "Uwzględniono w układzie" "Individual corners" = "Niezależne narożniki" +"Individual padding" = "Niezależne marginesy" "Individual strokes" = "Niezależne obrysy" "Ink" = "Farba" "Inner shadow" = "Cień wewnętrzny" @@ -653,6 +656,7 @@ status = "draft — needs native review" "Interaction" = "Interakcja" "Interactions" = "Interakcje" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Projektowanie interfejsów i prototypowanie. Darmowe, otwartoźródłowe, czysto implementowane narzędzie projektowe napisane od podstaw w Rust, część ArtCraft Crafting Apps." +"Interface size" = "Rozmiar interfejsu" "Intersect" = "Przetnij" "Intersects" = "Przecina" "Invalid color" = "Nieprawidłowy kolor" @@ -669,7 +673,7 @@ status = "draft — needs native review" "Joined" = "Dołączono" "Joined {file}" = "Dołączono do: {file}" "Joining…" = "Dołączanie…" -"Join|stroke" = "Join|stroke" +"Join|stroke" = "Łączenie" "Jul" = "Lip" "Jun" = "Cze" "Just now" = "Przed chwilą" @@ -702,6 +706,7 @@ status = "draft — needs native review" "Leaves" = "Opuszcza" "Left" = "Do lewej" "Left & right" = "Lewa i prawa" +"Left padding" = "Margines lewy" "Left side" = "Lewa strona" "Left side width" = "Szerokość lewej strony" "Letter case" = "Wielkość liter" @@ -712,9 +717,9 @@ status = "draft — needs native review" "Library: click to collapse" = "Biblioteka: kliknij, aby zwinąć" "Library: click to expand" = "Biblioteka: kliknij, aby rozwinąć" "Library: its variables are read-only here; edit them in the library file and publish it" = "Biblioteka: jej zmienne są tutaj tylko do odczytu; edytuj je w pliku biblioteki i opublikuj" -"Light" = "Lekki" +"Light" = "Jasny" "Lighten" = "Jaśniej" -"Light|glass" = "Light|glass" +"Light|glass" = "Światło" "Line" = "Linia" "Line arrow" = "Strzałka liniowa" "Line delta" = "Różnica wierszy" @@ -927,7 +932,7 @@ status = "draft — needs native review" "Opened “{name}” in a new tab" = "Otwarto „{name}” w nowej karcie" "Opening the file…" = "Otwieranie pliku…" "Opening {n} files as new files" = { one = "Otwieranie jako nowy plik", few = "Otwieranie {n} plików jako nowe pliki", many = "Otwieranie {n} plików jako nowe pliki", other = "Otwieranie {n} plików jako nowe pliki" } -"Open|comments" = "Open|comments" +"Open|comments" = "Otwarte" "Options" = "Opcje" "Orange" = "Pomarańczowy" "Order" = "Kolejność" @@ -950,6 +955,7 @@ status = "draft — needs native review" "PDF print settings" = "Ustawienia druku PDF" "Padding" = "Marginesy wewnętrzne" "Page" = "Strona" +"Page deleted" = "Strona została usunięta" "Pages" = "Strony" "Pages added to the document" = "Strony dodane do dokumentu" "Placed on the current page" = "Umieszczono na bieżącej stronie" @@ -1061,6 +1067,7 @@ status = "draft — needs native review" "Reduce motion" = "Ogranicz ruch" "Refraction" = "Załamanie światła (refrakcja)" "Regular expression" = "Wyrażenie regularne" +"Relative to your system's display scaling (100% is the system's own size). Document zoom is separate." = "Względem skalowania ekranu Twojego systemu (100% to domyślny rozmiar systemu). Powiększenie dokumentu jest niezależne." "Remove" = "Usuń" "Remove all" = "Usuń wszystko" "Remove annotation" = "Usuń adnotację" @@ -1099,6 +1106,7 @@ status = "draft — needs native review" "Rename on the server…" = "Zmień nazwę na serwerze…" "Rename page" = "Zmień nazwę strony" "Rename to" = "Zmień nazwę na" +"Reorder selection" = "Zmień kolejność zaznaczenia" "Replace all" = "Zamień wszystko" "Replace mixed export settings" = "Zastąp zróżnicowane ustawienia eksportu" "Replace with" = "Zamień na" @@ -1134,6 +1142,7 @@ status = "draft — needs native review" "Review and merge" = "Przejrzyj i scal" "Ribbon" = "Wstążka" "Right" = "Do prawej" +"Right padding" = "Margines prawy" "Right side" = "Prawa strona" "Right side width" = "Szerokość prawej strony" "Rotate 90°" = "Obróć o 90°" @@ -1184,6 +1193,7 @@ status = "draft — needs native review" "Search results" = "Wyniki wyszukiwania" "Search fonts" = "Szukaj czcionek" "Search layers" = "Szukaj warstw" +"Search pages" = "Szukaj stron" "Search shortcuts" = "Szukaj skrótów" "Section" = "Sekcja" "Section color" = "Kolor sekcji" @@ -1298,6 +1308,7 @@ status = "draft — needs native review" "Start from a blank canvas" = "Zacznij od pustego płótna" "Start from a template" = "Zacznij od szablonu" "Start on path" = "Początek na ścieżce" +"Start on the Home screen" = "Rozpoczynaj od ekranu głównego" "Start point" = "Punkt początkowy" "Start sharing" = "Rozpocznij udostępnianie" "Start sharing with the Share button, then pass on the code it gives" = "Rozpocznij udostępnianie przyciskiem Udostępnij, a następnie przekaż wygenerowany kod" @@ -1371,6 +1382,7 @@ status = "draft — needs native review" "The selection uses several text styles: click to apply one" = "Zaznaczenie używa kilku stylów tekstu: kliknij, aby zastosować jeden" "The server deletes this file if nobody opens it before {date}." = "Serwer usunie ten plik, jeśli nikt go nie otworzy przed {date}." "The whole file" = "Cały plik" +"The window is too small for {size}%, so the interface is drawn at {drawn}%. Make the window larger to use {size}%." = "Okno jest zbyt małe dla {size}%, więc interfejs jest wyświetlany w {drawn}%. Powiększ okno, aby użyć {size}%." "Theme" = "Motyw" "There's no destination for that action" = "Brak miejsca docelowego dla tej akcji" "Thickness" = "Grubość" @@ -1381,6 +1393,7 @@ status = "draft — needs native review" "This condition is edited as an expression" = "Ten warunek jest edytowany jako wyrażenie" "This file" = "Ten plik" "This file has unsaved changes" = "Ten plik ma niezapisane zmiany" +"This file is too large to join here (up to {mb} MB)" = "Ten plik jest zbyt duży, aby do niego dołączyć (maksymalnie {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." = "Ten plik używa czcionek, które nie są zainstalowane na tym komputerze. Do czasu ich zainstalowania tekst jest wyświetlany czcionką zastępczą." "This file is on {server}, open only to you. Share it to let others in with a new code." = "Ten plik znajduje się na {server}, otwarty tylko dla Ciebie. Udostępnij go, aby wpuścić innych nowym kodem." "This frame is new on the branch." = "Ta ramka jest nowa w gałęzi." @@ -1402,6 +1415,7 @@ status = "draft — needs native review" "Top" = "Góra" "Top & bottom" = "Góra i dół" "Top left radius" = "Promień górnego lewego narożnika" +"Top padding" = "Margines górny" "Top right radius" = "Promień górnego prawego narożnika" "Transform" = "Przekształć" "Triangle arrow" = "Strzałka trójkątna" @@ -1450,6 +1464,7 @@ status = "draft — needs native review" "Use number keys for opacity" = "Użyj klawiszy numerycznych dla nieprzezroczystości" "Use the .figcraft or .fig extension." = "Użyj rozszerzenia .figcraft lub .fig." "Use the layer's fill" = "Użyj wypełnienia warstwy" +"Use your browser's zoom to change the interface size." = "Użyj powiększenia przeglądarki, aby zmienić rozmiar interfejsu." "Used in {files} · {instances}" = "Używane w {files} · {instances}" "Username" = "Nazwa użytkownika" "Value" = "Wartość" @@ -1721,6 +1736,7 @@ status = "draft — needs native review" "{n}m" = "{n} min" "{n}w" = "{n} tyg." "{page}, nothing selected" = "{page}, nic nie zaznaczono" +"{percent}%" = "{percent}%" "{profile} (current)" = "{profile} (bieżący)" "{property} is its value; {property ? \"a\" : \"b\"} picks a string. Other {…} stays as written." = "{property} to jej wartość; {property ? \"a\" : \"b\"} wybiera tekst. Pozostałe wyrażenia {…} pozostają bez zmian." "{server} can't say what became of your files (it is older than this app)." = "{server} nie może określić stanu Twoich plików (jest starszy niż ta aplikacja)." diff --git a/docs/translating.md b/docs/translating.md index eaa59755b..7b01d391c 100644 --- a/docs/translating.md +++ b/docs/translating.md @@ -17,12 +17,12 @@ Simplified. The catalogs: English (`en`, the source), and Spanish (`es`, with the Latin American overlay `es-419`), French (`fr`), German (`de`), Dutch (`nl`), Brazilian Portuguese (`pt-BR`), Japanese (`ja`), Korean (`ko`), Simplified Chinese (`zh-Hans`), Czech (`cs`), Indonesian (`id`), Finnish -(`fi`), Polish (`pl`) and Bengali (`bn`), machine-drafted and waiting for native speakers' review. Georgian -(`ka`) was written with AI assistance and reviewed by a native speaker, and stays a draft until a -maintainer changes its status. Russian (`ru`, Русский) was -reviewed and approved by VanTan; its catalog keeps Frame, Dev Mode 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. +(`fi`) and Bengali (`bn`), machine-drafted and waiting for native speakers' review. Polish (`pl`, +Polski) was reviewed and approved by Lucas (@lukasz-sklad). Georgian (`ka`) was written with AI +assistance and reviewed by a native speaker, and stays a draft until a maintainer changes its status. +Russian (`ru`, Русский) was reviewed and approved by VanTan; its catalog keeps Frame, Dev Mode 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. ## The catalogs From 7c68ebf183b8c3ebcd6befa97b60ed7ec9905348 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Tue, 20 Oct 2026 14:27:09 +0000 Subject: [PATCH 425/817] Reject non-hex characters in Local::from_link token Found while testing crates/collab/src/code.rs:~150 (Local::from_link, u64::from_str_radix on the token) Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/collab/src/code.rs | 2 +- crates/collab/src/code_tests.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/collab/src/code.rs b/crates/collab/src/code.rs index c046682ab..6eebe9f74 100644 --- a/crates/collab/src/code.rs +++ b/crates/collab/src/code.rs @@ -135,7 +135,7 @@ impl Local { let query = link.strip_prefix("figcraft://join?")?; let get = |key: &str| query.split('&').find_map(|kv| kv.split_once('=').filter(|(k, _)| *k == key).map(|(_, v)| v)); let addr: std::net::SocketAddrV4 = get("host")?.parse().ok()?; - let hex = get("token")?.strip_prefix(TOKEN_PREFIX).filter(|h| h.len() == 11)?; + let hex = get("token")?.strip_prefix(TOKEN_PREFIX).filter(|h| h.len() == 11 && h.bytes().all(|b| b.is_ascii_hexdigit()))?; let local = Local { ip: *addr.ip(), port: addr.port(), secret: u64::from_str_radix(hex, 16).ok()? }; (get("file") == Some(LOCAL_FILE) && local.port != 0).then_some(local) } diff --git a/crates/collab/src/code_tests.rs b/crates/collab/src/code_tests.rs index 2dd902b32..31bd34885 100644 --- a/crates/collab/src/code_tests.rs +++ b/crates/collab/src/code_tests.rs @@ -104,6 +104,7 @@ fn only_local_session_links_have_a_code() { "figcraft://join?host=[::1]:47900&file=local&token=local-0123456789a", "figcraft://join?host=192.168.1.20:0&file=local&token=local-0123456789a", "figcraft://join?host=192.168.1.20:47900&file=local&token=local-0123456789az", + "figcraft://join?host=10.0.0.1:47900&file=local&token=local-+0000000001", "figcraft://join?server=wss://example.org/&file=local&token=local-0123456789a", "ws://192.168.1.20:47900/?file=local&token=local-0123456789a", "", From 728f5c48ef1a0357f1fd86b0c0a6b4939c2add45 Mon Sep 17 00:00:00 2001 From: Lucas Date: Tue, 20 Oct 2026 16:46:58 +0200 Subject: [PATCH 426/817] i18n(pl): add Polish labels for remaining 7 engine commands - Add Polish command labels for arrange.reorder, file.moveTab, pref.startOnHome, pref.uiScale, text.loadFont, text.refit, and text.rescanFonts. - Ensures 100% command coverage with zero fallback to English in the Actions palette. --- crates/ui-egui/locales/pl.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/ui-egui/locales/pl.toml b/crates/ui-egui/locales/pl.toml index b6a7bf532..209de490c 100644 --- a/crates/ui-egui/locales/pl.toml +++ b/crates/ui-egui/locales/pl.toml @@ -1779,6 +1779,7 @@ name = "Polski" "arrange.front" = "Przesuń na sam wierzch" "arrange.packH" = "Upakuj w poziomie" "arrange.packV" = "Upakuj w pionie" +"arrange.reorder" = "Zmień kolejność zaznaczenia" "arrange.roundToPixels" = "Zaokrąglij do pikseli" "arrange.spacing" = "Odstępy" "arrange.tidy" = "Uporządkuj" @@ -1906,6 +1907,7 @@ name = "Polski" "file.exportLayers" = "Eksportuj warstwy" "file.exportSvg" = "Eksportuj zaznaczenie jako SVG" "file.import" = "Importuj z pliku…" +"file.moveTab" = "Przenieś kartę" "file.new" = "Nowy plik projektu" "file.newFromTemplate" = "Nowy z szablonu" "file.open" = "Otwórz…" @@ -2048,6 +2050,8 @@ name = "Polski" "pref.reduceMotion" = "Ogranicz animacje" "pref.renameDuplicates" = "Zmieniaj nazwy duplikatów" "pref.showDimensions" = "Pokazuj wymiary przy zaznaczeniu" +"pref.startOnHome" = "Rozpoczynaj od ekranu głównego" +"pref.uiScale" = "Rozmiar interfejsu" "pref.userName" = "Twoja nazwa w komentarzach" "proto.action.add" = "Dodaj akcję prototypu" "proto.action.move" = "Zmień kolejność akcji prototypu" @@ -2154,6 +2158,7 @@ name = "Polski" "text.listIndent" = "Zwiększ wcięcie listy" "text.listOutdent" = "Zmniejsz wcięcie listy" "text.listStyle" = "Styl listy" +"text.loadFont" = "Wczytaj plik czcionki" "text.maxLines" = "Maksymalna liczba wierszy" "text.missingFonts" = "Brakujące czcionki" "text.numberList" = "Lista numerowana" @@ -2162,7 +2167,9 @@ name = "Polski" "text.paragraphSpacing" = "Odstęp między akapitami" "text.pathOptions" = "Opcje ścieżki tekstu" "text.preview" = "Podgląd zmiany tekstu" +"text.refit" = "Dopasuj tekst do czcionek" "text.removeFromPath" = "Usuń tekst ze ścieżki" +"text.rescanFonts" = "Wyszukaj ponownie zainstalowane czcionki" "text.set" = "Ustaw tekst" "text.setFeatures" = "Funkcje OpenType" "text.setVariations" = "Osie czcionki zmiennej (Variable Font)" From 6165d2ec85a0b139a73af82b8e9e1e8d3d75c6d2 Mon Sep 17 00:00:00 2001 From: YarilaFox <102650794+YarilaFox@users.noreply.github.com> Date: Tue, 20 Oct 2026 20:12:47 +0500 Subject: [PATCH 427/817] M7: preserve bindings and design layers when pasting images --- crates/engine/src/cmd/create.rs | 10 ++++++-- crates/engine/src/cmd/edit.rs | 3 +-- crates/ui-egui/src/design_paste_tests.rs | 28 +++++++++++++++++++++ crates/ui-egui/src/menus.rs | 32 ++++++++++++------------ crates/ui-egui/src/paste_image_tests.rs | 17 +++++++++++++ 5 files changed, 70 insertions(+), 20 deletions(-) diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index 68375716c..dc3160560 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -377,6 +377,13 @@ pub fn accepts_image_fill(kind: &NodeKind) -> bool { kind.is_shape() || kind.is_frame_like() || matches!(kind, NodeKind::Text(_) | NodeKind::BooleanOp { .. }) } +/// Replace the fill list and detach variable bindings on paints that the image replaces. +pub(crate) fn replace_with_image_fill(node: &mut Node, image: String, mode: ImageScaleMode) { + node.fills = vec![Paint::image(image, mode)]; + node.bound.retain(|key, _| !matches!(super::lists::list_binding(key), Some((super::lists::BoundList::Fills, _, _)))); + node.styles.fill = None; +} + /// Place an image as a rectangle with an image fill (Figma's image layer). pub fn place_image(s: &mut Session, p: &Value) -> Result { let cmd = "image.place"; @@ -407,8 +414,7 @@ pub fn place_image(s: &mut Session, p: &Value) -> Result { let (hash, _, _) = figcraft_format::add_image(doc, bytes).map_err(|e| bad(cmd, e.to_string()))?; let profile = figcraft_render::images::profile_name(&hash, doc.images.get(&hash)); let node = doc.get_mut(id)?; - node.fills = vec![Paint::image(hash.clone(), mode)]; - node.styles.fill = None; + replace_with_image_fill(node, hash.clone(), mode); return Ok(json!({"id": id, "image": hash, "width": node.width, "height": node.height, "imageProfile": profile})); } let page = s.page()?; diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index dc9c7b770..93636cab4 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -701,8 +701,7 @@ fn paste(s: &mut Session, p: &Value) -> Result { let doc = s.doc_mut()?; doc.images.entry(hash.clone()).or_insert(data); let node = doc.get_mut(*target)?; - node.fills = vec![figcraft_color::Paint::image(hash, figcraft_color::ImageScaleMode::Fill)]; - node.styles.fill = None; + super::create::replace_with_image_fill(node, hash, figcraft_color::ImageScaleMode::Fill); return Ok(json!({"ids": [target]})); } let page = s.page()?; diff --git a/crates/ui-egui/src/design_paste_tests.rs b/crates/ui-egui/src/design_paste_tests.rs index 35743a81c..82c366c78 100644 --- a/crates/ui-egui/src/design_paste_tests.rs +++ b/crates/ui-egui/src/design_paste_tests.rs @@ -45,6 +45,34 @@ fn paste_takes_layers_copied_in_another_design_app() { assert_eq!(selected_names(&app), ["Copied layer"]); } +struct HtmlAndImage(String); + +impl Services for HtmlAndImage { + fn clipboard_get_html(&mut self) -> Option { + Some(self.0.clone()) + } + fn clipboard_get_image(&mut self) -> Option<(u32, u32, Vec)> { + Some((2, 2, vec![255; 16])) + } +} + +#[test] +fn editable_design_layers_take_priority_over_a_png_representation() { + let mut session = Session::new(); + let selected = session.execute("shape.ellipse", &json!({"x": 100, "y": 100, "width": 80, "height": 80})).unwrap()["id"].as_u64().unwrap(); + let mut app = FigApp::new(session, Box::new(HtmlAndImage(copied_html()))); + let before = app.session.doc().unwrap().node_count(); + + crate::menus::paste(&mut app, None, None); + + assert_eq!(selected_names(&app), ["Copied layer"]); + assert_eq!(app.session.doc().unwrap().node_count(), before + 1); + assert!(matches!( + app.session.doc().unwrap().node(figcraft_doc::NodeId(selected)).unwrap().fills[0].kind, + figcraft_color::PaintKind::Solid { .. } + )); +} + #[test] fn paste_here_puts_copied_design_layers_at_the_point() { let html = copied_html(); diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 2002be0b1..b3647a8fa 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -36,22 +36,6 @@ pub const UI_COMMANDS: &[&str] = &[ /// other way to read it). `at`: the page point to paste at (Paste here); `None` pastes in the /// middle of the view. pub fn paste(app: &mut FigApp, event_text: Option<&str>, at: Option<(f64, f64)>) { - let selected_layer = match app.session.selection().as_slice() { - [id] if at.is_none() - && app.session.doc().ok().and_then(|d| d.node(*id)).is_some_and(|n| figcraft_engine::cmd::create::accepts_image_fill(&n.kind)) => - { - Some(*id) - } - _ => None, - }; - if let Some(target) = selected_layer - && let Some((png, _, _)) = clipboard_png(app) - { - use base64::Engine as _; - let b64 = base64::engine::general_purpose::STANDARD.encode(png); - app.run("image.place", json!({"data": b64, "target": target})); - return; - } // Only HTML that holds readable design data takes this path; other HTML pastes as before. if let Some(html) = app.services.clipboard_get_html().filter(|h| figcraft_engine::cmd::edit::design_clipboard_buffer(h).is_some()) { let mut params = json!({"html": html}); @@ -69,6 +53,22 @@ pub fn paste(app: &mut FigApp, event_text: Option<&str>, at: Option<(f64, f64)>) } return; } + let selected_layer = match app.session.selection().as_slice() { + [id] if at.is_none() + && app.session.doc().ok().and_then(|d| d.node(*id)).is_some_and(|n| figcraft_engine::cmd::create::accepts_image_fill(&n.kind)) => + { + Some(*id) + } + _ => None, + }; + if let Some(target) = selected_layer + && let Some((png, _, _)) = clipboard_png(app) + { + use base64::Engine as _; + let b64 = base64::engine::general_purpose::STANDARD.encode(png); + app.run("image.place", json!({"data": b64, "target": target})); + return; + } let sys_text = app.services.clipboard_get_text().or_else(|| event_text.map(str::to_string)).filter(|t| !t.is_empty()); let ours = sys_text.is_some() && sys_text == app.ui.last_copy; let (cx, cy) = at.or_else(|| app.session.ds().ok().map(|d| (d.view.cx, d.view.cy))).unwrap_or((0.0, 0.0)); diff --git a/crates/ui-egui/src/paste_image_tests.rs b/crates/ui-egui/src/paste_image_tests.rs index 6fbc41014..c659569c1 100644 --- a/crates/ui-egui/src/paste_image_tests.rs +++ b/crates/ui-egui/src/paste_image_tests.rs @@ -208,6 +208,23 @@ fn cmd_v_fills_a_selected_oval_without_adding_a_layer() { assert_eq!(w.app.session.doc().unwrap().node(oval).unwrap().fills, original_fill); } +#[test] +fn pasting_an_image_detaches_the_replaced_fill_variable() { + let mut w = Win::new(); + let oval = + NodeId(w.app.session.execute("shape.ellipse", &json!({"x": 200, "y": 100, "width": 120, "height": 80})).unwrap()["id"].as_u64().unwrap()); + w.app.session.execute("variable.createCollection", &json!({"name": "Theme"})).unwrap(); + w.app.session.execute("variable.create", &json!({"collection": "Theme", "name": "brand", "type": "color", "value": "#FF0000"})).unwrap(); + w.app.session.execute("variable.bind", &json!({"ids": [oval.0], "field": "fill", "variable": "brand"})).unwrap(); + assert!(!w.app.session.doc().unwrap().node(oval).unwrap().bound.is_empty()); + + w.copy_image_elsewhere(); + w.cmd_v(CMD); + let node = w.app.session.doc().unwrap().node(oval).unwrap(); + assert!(matches!(node.fills[0].kind, figcraft_color::PaintKind::Image(_))); + assert!(node.bound.is_empty(), "the old colour variable must not remain on the image fill"); +} + #[test] fn cmd_v_fills_a_selected_oval_with_an_image_copied_in_figcraft() { let mut w = Win::new(); From 92290dd208f4423a9de1e0402eff93a675cd200a Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 20 Oct 2026 11:32:08 -0400 Subject: [PATCH 428/817] docs: add SonarCloud and CodeRabbit badges to README (#820) * docs: add SonarCloud and CodeRabbit badges to README * docs: put SonarCloud and CodeRabbit badges on their own line --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index ae4c9f24c..63bc739bf 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,9 @@ macOS · Windows · Linux · FreeBSD · Web License: MIT OR Apache-2.0 Status: early alpha +
+ Scanned by SonarCloud + Reviewed by CodeRabbit

From d9c924c3ba7114dff9141c667aec56d3764f3af9 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Tue, 20 Oct 2026 11:39:30 -0400 Subject: [PATCH 429/817] Skip CodeRabbit reviews on Dependabot PRs (#937) Adds .coderabbit.yaml so CodeRabbit no longer reviews or comments on PRs opened by dependabot[bot]. Co-authored-by: Claude Opus 5.5 --- .coderabbit.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .coderabbit.yaml diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 000000000..2408084cf --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,6 @@ +# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json +reviews: + auto_review: + # Dependabot bumps are checked by CI; skip CodeRabbit reviews on them. + ignore_usernames: + - "dependabot[bot]" From 8b198ea364b9cc1c5646c69fe6999cdf677eb1bb Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Tue, 20 Oct 2026 15:41:47 +0000 Subject: [PATCH 430/817] Strip default port in same_server when the address has a path Found while testing crates/engine/src/online.rs:118 Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/engine/src/online.rs | 7 ++++++- crates/engine/src/online_tests.rs | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/online.rs b/crates/engine/src/online.rs index b982580ea..667137322 100644 --- a/crates/engine/src/online.rs +++ b/crates/engine/src/online.rs @@ -120,7 +120,12 @@ pub fn same_server(a: &str, b: &str) -> bool { let s = plain_server(s).to_ascii_lowercase(); let s = s.trim_end_matches('/'); let port = if s.starts_with("wss://") { ":443" } else { ":80" }; - s.strip_suffix(port).unwrap_or(s).to_string() + let start = s.find("://").map_or(0, |i| i + 3); + let end = s[start..].find('/').map_or(s.len(), |i| start + i); + match s[start..end].strip_suffix(port) { + Some(host) => format!("{}{}{}", &s[..start], host, &s[end..]), + None => s.to_string(), + } }; norm(a) == norm(b) } diff --git a/crates/engine/src/online_tests.rs b/crates/engine/src/online_tests.rs index 1e341b146..c211c505e 100644 --- a/crates/engine/src/online_tests.rs +++ b/crates/engine/src/online_tests.rs @@ -583,3 +583,11 @@ fn debug_output_of_a_record_leaves_the_secrets_out() { no_secrets("debug", &text); assert!(text.contains("share.example") && text.contains(".."), "{text}"); } + +#[test] +fn same_server_ignores_the_default_port_before_a_path() { + use crate::online::same_server; + assert!(same_server("wss://share.example:443/figcraft/", "wss://share.example/figcraft/")); + assert!(same_server("ws://host:80/x", "ws://host/x")); + assert!(!same_server("wss://share.example:8443/figcraft/", "wss://share.example/figcraft/")); +} From bf3fc3cc6e8f181d3a7a19d2cf0a5efae43a7bbb Mon Sep 17 00:00:00 2001 From: YarilaFox <102650794+YarilaFox@users.noreply.github.com> Date: Tue, 20 Oct 2026 16:23:47 +0500 Subject: [PATCH 431/817] M7: dismiss comment draft when switching tools --- crates/ui-egui/src/comments_tests.rs | 14 +++++++++++++- crates/ui-egui/src/lib.rs | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/comments_tests.rs b/crates/ui-egui/src/comments_tests.rs index 696ff3228..f1b32a4bd 100644 --- a/crates/ui-egui/src/comments_tests.rs +++ b/crates/ui-egui/src/comments_tests.rs @@ -7,7 +7,7 @@ use egui::{Event, Key, Modifiers, Pos2, pos2, vec2}; use figcraft_engine::Session; use serde_json::{Value, json}; -use crate::comments::{cluster, insert_mention, mention_matches, mention_query}; +use crate::comments::{cluster, insert_mention, mention_matches, mention_query, start_draft}; use crate::present_tests::{Ui, id}; fn add(s: &mut Session, x: f64, y: f64, text: &str, author: &str) -> u64 { @@ -41,6 +41,18 @@ fn comments(u: &Ui) -> Value { u.app.inspect()["comments"].clone() } +#[test] +fn switching_from_comment_to_move_closes_the_unposted_composer() { + let mut u = Ui::new(Session::new()); + u.app.run("tool.set", json!({"tool": "comment"})); + start_draft(&mut u.app, 100.0, 80.0); + assert!(comments(&u)["draft"].is_array()); + + u.app.run("tool.set", json!({"tool": "move"})); + u.frame(vec![]); + assert!(comments(&u)["draft"].is_null()); +} + #[test] fn mention_helpers() { // The `@query` before the cursor. diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 072aec62d..061142867 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -834,6 +834,9 @@ impl FigApp { /// Run a command, surfacing errors as a toast. Returns the result. pub fn run(&mut self, id: &str, params: Value) -> Option { let r = self.session.execute(id, ¶ms); + if id == "tool.set" && r.is_ok() && self.session.tool.tool != figcraft_engine::tools::ToolId::Comment { + self.ui.comments.draft = None; + } self.handle_ui_requests(); r.map_err(|e| self.failed(id, &e)).ok() } From 1c79c1646fefb531006459d8a2c7a53fcc43c06a Mon Sep 17 00:00:00 2001 From: Siade Lucas Date: Tue, 20 Oct 2026 12:53:21 -0300 Subject: [PATCH 432/817] ui: scroll active page into view when selection changes --- contributors/people.toml | 4 +++ crates/ui-egui/src/layers.rs | 5 ++++ crates/ui-egui/src/layers_behaviour_tests.rs | 27 ++++++++++++++++++++ crates/ui-egui/src/lib.rs | 3 +++ 4 files changed, 39 insertions(+) diff --git a/contributors/people.toml b/contributors/people.toml index b91728912..273079350 100644 --- a/contributors/people.toml +++ b/contributors/people.toml @@ -24,6 +24,10 @@ display_name = "VanTan" real_name = "Tyler Jennings" display_name = "tylerjenningsw" +[people.SiadeLucas] +real_name = "Siade Lucas" +sync_github_name = true + [people.Silvertree2010] display_name = "Netter" sync_github_name = false diff --git a/crates/ui-egui/src/layers.rs b/crates/ui-egui/src/layers.rs index dfab115aa..212ae413f 100644 --- a/crates/ui-egui/src/layers.rs +++ b/crates/ui-egui/src/layers.rs @@ -229,6 +229,8 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { let mut move_to: Option<(NodeId, String)> = None; // Pages are dragged up and down the list to reorder them. let mut reorder = crate::list_drag::ListDrag::in_order(ui, "pages"); + let scroll_to_cur = app.ui.pages_seen_page != Some(cur); + app.ui.pages_seen_page = Some(cur); // A long list scrolls in its own area, so the layers keep their room below it. let max_h = pages_list_height(app.ui.pages_height, ui.available_height()); let mut moved = egui::ScrollArea::vertical().id_salt("pages_list").max_height(max_h).show(ui, |ui| { @@ -238,6 +240,9 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { } let sense = if filtering { Sense::click() } else { Sense::click_and_drag() }; let (r, resp) = ui.allocate_exact_size(vec2(w, 32.0), sense); + if scroll_to_cur && id == cur { + ui.scroll_to_rect(r, None); + } if !filtering { reorder.row_by(&resp, k, r, || if divider { tr("Divider").to_string() } else { name.clone() }); } diff --git a/crates/ui-egui/src/layers_behaviour_tests.rs b/crates/ui-egui/src/layers_behaviour_tests.rs index b963ee827..cb62540cc 100644 --- a/crates/ui-egui/src/layers_behaviour_tests.rs +++ b/crates/ui-egui/src/layers_behaviour_tests.rs @@ -507,3 +507,30 @@ fn the_pages_list_keeps_three_rows_and_leaves_the_layers_room() { // A panel too short for both keeps the three rows. assert_eq!(pages_list_height(Some(500.0), 100.0), 3.0 * ROW); } + +/// Selecting a page that is far down the list automatically scrolls it into view. +#[test] +fn selecting_a_distant_page_scrolls_it_into_view() { + let mut s = Session::new(); + let rect = id(s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap()); + for _ in 0..40 { + s.execute("page.add", &json!({})).unwrap(); + } + let pages = s.doc().unwrap().pages.clone(); + let first = pages[0]; + let last = *pages.last().unwrap(); + s.execute("page.select", &json!({"id": first})).unwrap(); + s.execute("select.none", &json!({})).unwrap(); + let mut u = Ui::new(s); + let layer = u.row_at(rect); + u.frame(vec![]); + // Select the last page. + u.app.run("page.select", json!({"id": last})); + for _ in 0..15 { + u.frame(vec![]); + } + assert_eq!(u.app.ui.pages_seen_page, Some(last)); + let opened = pages_down_to(&mut u, layer.y - 60.0); + let top = pages.iter().position(|p| Some(p) == opened.first()).unwrap(); + assert!(top > 20, "the list scrolled past its first pages to reveal the selection (top row: page {top})"); +} diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 072aec62d..fb44b60a1 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -495,6 +495,8 @@ pub struct UiState { pub page_filter: String, /// The height asked for the pages list (`None`: a share of the panel). pub pages_height: Option, + /// The active page when last drawn in the pages list, to scroll it into view when selected. + pub pages_seen_page: Option, pub expanded: BTreeSet, /// The layer being renamed in the layers panel. pub rename: Option, @@ -667,6 +669,7 @@ impl Default for UiState { page_search: false, page_filter: String::new(), pages_height: None, + pages_seen_page: None, expanded: BTreeSet::new(), rename: None, rename_page: None, From 3df5673627026deba90fcfbf089c0ac1fa0d49dc Mon Sep 17 00:00:00 2001 From: Hamza Date: Tue, 20 Oct 2026 20:56:08 +0500 Subject: [PATCH 433/817] MCP: maxBytes is the whole message, and depth 0 says when it is over Two things the limit got wrong, both reported by CodeRabbit on #915. maxBytes was compared with the escaped text block alone, but what goes on the wire is that block inside a content object, inside the JSON-RPC result, with the request id and the newline the transport writes: a block measured at exactly maxBytes left as a larger message than the caller said it could read. A kilobyte of the caller's figure is now kept for that wrapping. About ninety bytes of it is fixed and the rest is the request id, so the figure holds for any id up to roughly 900 bytes -- every id in practice, a number or a UUID. Sizing the real envelope here would mean handing the transport's request id to every tool, and the assumption is written down instead, in the schema and at the constant. A depth: 0 request over the limit returned early, so the one response that cannot be made any smaller was the one sent without the truncated marker -- while a bisection that walked down to depth 0 sent the same tree with it. Depth 0 now takes the same path as the bisection: the tree goes out, over the limit, with the marker saying so. Without the first fix the test reports a limit at the exact size of the tree as no truncation; without the second the depth-0 marker is absent (left: (None, None), right: (Some(0), Some(0))). --- crates/mcp/src/tools.rs | 68 ++++++++++++++-------- crates/mcp/tests/inspect_response_limit.rs | 29 ++++++++- 2 files changed, 70 insertions(+), 27 deletions(-) diff --git a/crates/mcp/src/tools.rs b/crates/mcp/src/tools.rs index 92773e03c..d04ea6209 100644 --- a/crates/mcp/src/tools.rs +++ b/crates/mcp/src/tools.rs @@ -178,7 +178,9 @@ pub fn tool_definitions() -> Vec { json!({ "depth": int("Tree depth for the current page (default 4)"), "allPages": boolean("Expand every page, not only the current one"), - "maxBytes": int("Largest response to send, in bytes on the wire (default 8388608, which fits the usual 10 MiB client buffer)"), + "maxBytes": int( + "Largest response to send, in bytes of the whole JSON-RPC message (default 8388608, which fits the usual 10 MiB client buffer); 1024 of it is kept for the envelope and the request id" + ), }), &[], ), @@ -578,6 +580,14 @@ const MAX_RESPONSE: usize = 8 << 20; /// otherwise be able to push a response that only just fitted back over the limit. const MARKER_RESERVE: usize = 1 << 10; +/// Room kept for everything the text block is wrapped in: the content object and `isError`, the +/// JSON-RPC envelope (`jsonrpc`, `id`, `result`) and the newline the transport writes after it. +/// About ninety bytes of that is fixed and the rest is the request id, so `maxBytes` holds for +/// any id up to roughly 900 bytes -- which is every id in practice, a number or a UUID. An id +/// larger than that is the one case where the message can pass the caller's figure, and sizing +/// the real envelope here would mean handing the transport's request id to every tool. +const ENVELOPE_RESERVE: usize = 1 << 10; + /// The document at `depth`, and what its text block would take on the wire. The tree is sent as a /// text block, so it is measured pretty-printed *and* escaped -- escaping adds about a tenth. fn inspect_at(b: &mut dyn Backend, depth: u64, all: bool) -> Result<(Value, usize), String> { @@ -602,37 +612,45 @@ fn inspect_document(b: &mut dyn Backend, a: &Map) -> Result MAX_RESPONSE, }; + // What the tree itself may take: the caller's figure is for the whole message. + let budget = max_bytes.saturating_sub(ENVELOPE_RESERVE); + let (value, wire) = inspect_at(b, depth, all)?; - if wire <= max_bytes || depth == 0 { + if wire <= budget { return Ok(ToolResult::json(&value)); } - // The deepest tree that fits, by bisection: a deeper tree holds every node of a shallower one, - // so the size does not fall as the depth grows. Bisecting keeps this to about six more walks - // of the document rather than one per level. - let (mut lo, mut hi) = (0u64, depth - 1); - let mut best: Option<(u64, Value, usize)> = None; - while lo <= hi { - let mid = lo + (hi - lo) / 2; - let (v, w) = inspect_at(b, mid, all)?; - if w + MARKER_RESERVE <= max_bytes { - best = Some((mid, v, w)); - if mid == hi { + let (used, mut value, used_wire) = if depth == 0 { + // Depth 0 is the shallowest tree there is, so there is nothing smaller to send: it goes + // out over the limit with the marker saying so, the same as a bisection that reaches + // depth 0. An error would leave the caller with nothing at all. + (0, value, wire) + } else { + // The deepest tree that fits, by bisection: a deeper tree holds every node of a shallower + // one, so the size does not fall as the depth grows. Bisecting keeps this to about six + // more walks of the document rather than one per level. + let (mut lo, mut hi) = (0u64, depth - 1); + let mut best: Option<(u64, Value, usize)> = None; + while lo <= hi { + let mid = lo + (hi - lo) / 2; + let (v, w) = inspect_at(b, mid, all)?; + if w + MARKER_RESERVE <= budget { + best = Some((mid, v, w)); + if mid == hi { + break; + } + lo = mid + 1; + } else if mid == 0 { + best = Some((0, v, w)); break; + } else { + hi = mid - 1; } - lo = mid + 1; - } else if mid == 0 { - // Not even the shallowest tree fits. Send it anyway and say so: there is nothing - // smaller to send, and an error would leave the caller with nothing at all. - best = Some((0, v, w)); - break; - } else { - hi = mid - 1; } - } - - let Some((used, mut value, used_wire)) = best else { - return Ok(ToolResult::json(&value)); + match best { + Some(found) => found, + None => return Ok(ToolResult::json(&value)), + } }; if let Some(obj) = value.as_object_mut() { obj.insert( diff --git a/crates/mcp/tests/inspect_response_limit.rs b/crates/mcp/tests/inspect_response_limit.rs index 0d9f9e6d6..5e36b5a9b 100644 --- a/crates/mcp/tests/inspect_response_limit.rs +++ b/crates/mcp/tests/inspect_response_limit.rs @@ -6,6 +6,10 @@ mod common; use common::Client; use serde_json::{Value, json}; +/// The allowance `inspect_document` keeps for the content object, the JSON-RPC envelope and the +/// request id (`ENVELOPE_RESERVE`). +const ENVELOPE: usize = 1024; + /// A document whose tree is far larger than the limits used below. fn busy() -> Client { let mut c = Client::new(); @@ -49,8 +53,29 @@ fn a_tree_too_large_for_the_client_is_reported_shallower_and_says_so() { assert!(cut["pages"][0]["children"].as_array().is_some_and(|c| !c.is_empty()), "{cut}"); // The deepest tree that fits is the one sent: a limit that admits the whole tree is not cut. - let (whole, _) = inspect(&mut c, json!({"depth": 6, "allPages": true, "maxBytes": full_wire})); - assert!(whole["truncated"].is_null(), "a limit at the exact size is not a truncation: {}", whole["truncated"]); + // maxBytes is the whole message, so the tree fits under it with room for the envelope, not + // at it: a text block of exactly maxBytes would be sent inside a larger message than that. + let (whole, _) = inspect(&mut c, json!({"depth": 6, "allPages": true, "maxBytes": full_wire + ENVELOPE})); + assert!(whole["truncated"].is_null(), "a limit that leaves room for the envelope is not a truncation: {}", whole["truncated"]); + let (tight, _) = inspect(&mut c, json!({"depth": 6, "allPages": true, "maxBytes": full_wire})); + assert_eq!(tight["truncated"]["requestedDepth"], 6, "a limit at the exact size of the tree leaves none for the envelope: {tight}"); +} + +/// Every over-limit response carries the marker, however the depth was arrived at: a caller that +/// asked for depth 0 has no other way to learn that its limit was passed. +#[test] +fn a_depth_0_response_over_the_limit_says_so_too() { + let mut c = busy(); + let (deep, _) = inspect(&mut c, json!({"depth": 0, "allPages": true})); + assert!(deep["truncated"].is_null(), "within the default limit: {}", deep["truncated"]); + let (v, wire) = inspect(&mut c, json!({"depth": 0, "allPages": true, "maxBytes": 1024})); + let t = &v["truncated"]; + assert_eq!((t["requestedDepth"].as_u64(), t["depth"].as_u64()), (Some(0), Some(0)), "{t}"); + // `bytes` is the tree, measured before the marker was added to it, so the message that goes + // out is larger still -- there being nothing smaller to send. + assert_eq!(t["bytes"], t["requestedDepthBytes"], "{t}"); + assert!(wire > 1024, "the depth-0 tree is sent over the limit, with the marker saying so: {wire}"); + assert!(!v["pages"].is_null(), "the tree is still sent, there being nothing smaller: {v}"); } #[test] From 8f3afbf6a13e7b7547f4ab4040e88660de48d2e7 Mon Sep 17 00:00:00 2001 From: YarilaFox <102650794+YarilaFox@users.noreply.github.com> Date: Tue, 20 Oct 2026 21:04:04 +0500 Subject: [PATCH 434/817] M7: clear comment drafts for control-channel tool changes --- crates/ui-egui/src/comments_tests.rs | 17 +++++++++++++++++ crates/ui-egui/src/control.rs | 1 + crates/ui-egui/src/lib.rs | 11 ++++++++--- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/comments_tests.rs b/crates/ui-egui/src/comments_tests.rs index f1b32a4bd..eea2278e9 100644 --- a/crates/ui-egui/src/comments_tests.rs +++ b/crates/ui-egui/src/comments_tests.rs @@ -53,6 +53,23 @@ fn switching_from_comment_to_move_closes_the_unposted_composer() { assert!(comments(&u)["draft"].is_null()); } +#[test] +fn control_channel_tool_switch_closes_the_unposted_composer() { + let mut u = Ui::new(Session::new()); + u.app.run("tool.set", json!({"tool": "comment"})); + start_draft(&mut u.app, 100.0, 80.0); + assert!(comments(&u)["draft"].is_array()); + + let invalid = json!({"command": "tool.set", "params": {"tool": "not-a-tool"}}); + assert!(crate::control::handle(&mut u.app, &egui::Context::default(), "engine.execute", &invalid).is_err()); + assert!(comments(&u)["draft"].is_array()); + + crate::control::handle(&mut u.app, &egui::Context::default(), "engine.execute", &json!({"command": "tool.set", "params": {"tool": "move"}})) + .unwrap(); + u.frame(vec![]); + assert!(comments(&u)["draft"].is_null()); +} + #[test] fn mention_helpers() { // The `@query` before the cursor. diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rs index a4a8dd15d..2d35609a2 100644 --- a/crates/ui-egui/src/control.rs +++ b/crates/ui-egui/src/control.rs @@ -239,6 +239,7 @@ pub fn handle(app: &mut FigApp, ctx: &Context, method: &str, p: &Value) -> Resul let cmd = p.get("command").and_then(Value::as_str).ok_or("`command` required")?; let params = p.get("params").cloned().unwrap_or(json!({})); let r = app.session.execute(cmd, ¶ms).map_err(|e| e.to_string()); + app.clear_comment_draft_after_tool_set(cmd, r.is_ok()); // Programmatic calls never open dialogs. app.session.ui_requests.retain(|u| !u.kind.starts_with("dialog.")); app.handle_ui_requests(); diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 061142867..d728dc27c 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -831,12 +831,17 @@ impl FigApp { } } + /// Dismiss the composer after a successful switch away from the Comment tool. + pub(crate) fn clear_comment_draft_after_tool_set(&mut self, id: &str, succeeded: bool) { + if id == "tool.set" && succeeded && self.session.tool.tool != figcraft_engine::tools::ToolId::Comment { + self.ui.comments.draft = None; + } + } + /// Run a command, surfacing errors as a toast. Returns the result. pub fn run(&mut self, id: &str, params: Value) -> Option { let r = self.session.execute(id, ¶ms); - if id == "tool.set" && r.is_ok() && self.session.tool.tool != figcraft_engine::tools::ToolId::Comment { - self.ui.comments.draft = None; - } + self.clear_comment_draft_after_tool_set(id, r.is_ok()); self.handle_ui_requests(); r.map_err(|e| self.failed(id, &e)).ok() } From 77f4271061d2ca4fd011764b256f9126d4236672 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Tue, 20 Oct 2026 17:03:45 +0000 Subject: [PATCH 435/817] Fix trim_num saturating whole numbers beyond i64 range Found while testing crates/doc/src/text.rs:64 Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/doc/src/text.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/doc/src/text.rs b/crates/doc/src/text.rs index 097dd189b..458426ad7 100644 --- a/crates/doc/src/text.rs +++ b/crates/doc/src/text.rs @@ -60,6 +60,9 @@ impl LetterSpacing { } pub fn trim_num(v: f64) -> String { + if v.abs() >= 9.0e18 { + return format!("{v}"); + } let r = (v * 100.0).round() / 100.0; if r.fract().abs() < 1e-9 { format!("{}", r as i64) } else { format!("{r}") } } @@ -760,6 +763,15 @@ impl TextData { mod case_tests { use super::*; + #[test] + fn trim_num_prints_huge_whole_numbers() { + assert_eq!(trim_num(1e19), "10000000000000000000"); + assert_eq!(trim_num(-1e19), "-10000000000000000000"); + assert_eq!(trim_num(12.0), "12"); + let v = 12345678901234567890.0_f64; + assert_eq!(trim_num(v).parse::().unwrap(), v); + } + #[test] fn title_case_respects_context() { assert_eq!(TextCase::Title.apply("hello wORLD don't 3d x-ray"), "Hello WORLD Don't 3d X-Ray"); From 570144ee90e217da2ef27c1c5a4e839f6f0c06df Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Tue, 20 Oct 2026 17:49:45 +0000 Subject: [PATCH 436/817] Reject multiple leading '#' in Color::from_hex Found while testing crates/color/src/lib.rs:125 Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/color/src/lib.rs | 3 ++- crates/color/src/tests.rs | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/crates/color/src/lib.rs b/crates/color/src/lib.rs index 8e9f98d92..e2ca70162 100644 --- a/crates/color/src/lib.rs +++ b/crates/color/src/lib.rs @@ -122,7 +122,8 @@ impl Color { /// Parse hex the way the colour field does: `#` optional, 1, 2, 3, 4, 6 or 8 digits /// (`F` → `FFFFFF`, `AB` → `ABABAB`, `ABC` → `AABBCC`). pub fn from_hex(s: &str) -> Option { - let s = s.trim().trim_start_matches('#'); + let s = s.trim(); + let s = s.strip_prefix('#').unwrap_or(s); if !s.chars().all(|c| c.is_ascii_hexdigit()) { return None; } diff --git a/crates/color/src/tests.rs b/crates/color/src/tests.rs index 4cf875bbf..fdec5b561 100644 --- a/crates/color/src/tests.rs +++ b/crates/color/src/tests.rs @@ -114,3 +114,12 @@ fn infinite_channels_clamp() { let c = Color::new(f32::INFINITY, f32::NEG_INFINITY, f32::NAN, f32::INFINITY); assert_eq!((c.r, c.g, c.b, c.a), (1.0, 0.0, 0.0, 1.0)); } + +#[test] +fn hex_allows_at_most_one_leading_hash() { + assert!(Color::from_hex("##ff0000").is_none()); + assert!(Color::from_hex("###fff").is_none()); + assert!(Color::from_hex_or_name("##ff0000").is_none()); + assert_eq!(Color::from_hex("#ff0000").unwrap().to_hex(), "FF0000"); + assert_eq!(Color::from_hex("ff0000").unwrap().to_hex(), "FF0000"); +} From b788b55286accda85f72bb2e846f9db7ba81b88d Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Tue, 20 Oct 2026 20:43:51 +0200 Subject: [PATCH 437/817] Keep a solid paint's own opacity when binding a colour variable Fixes #923 Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Opus 5.5 --- crates/color/src/lib.rs | 26 ++++++++++++++++++++---- crates/engine/src/binding_lists_tests.rs | 2 +- crates/engine/src/bound_alpha_tests.rs | 22 ++++++++++++++++++++ crates/engine/src/cmd/edit.rs | 2 ++ crates/engine/src/cmd/styles.rs | 16 +++++++++++---- crates/format/src/fig/assets_tests.rs | 5 ++++- crates/format/src/fig/export_tests.rs | 2 +- crates/format/src/rest/props.rs | 2 +- 8 files changed, 65 insertions(+), 12 deletions(-) diff --git a/crates/color/src/lib.rs b/crates/color/src/lib.rs index 8e9f98d92..d7ff9089c 100644 --- a/crates/color/src/lib.rs +++ b/crates/color/src/lib.rs @@ -537,7 +537,7 @@ pub enum PaintKind { } /// One fill or stroke paint. -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct Paint { #[serde(flatten)] pub kind: PaintKind, @@ -547,6 +547,17 @@ pub struct Paint { pub visible: bool, #[serde(default)] pub blend: BlendMode, + /// The opacity holds the alpha of a typed solid colour (see [`Paint::solid`]) rather than an + /// opacity set on its own: a colour variable bound to the paint replaces it. + #[serde(default, rename = "colorAlpha", skip_serializing_if = "std::ops::Not::not")] + pub color_alpha: bool, +} + +/// Paints compare by what they paint; where the opacity came from doesn't matter. +impl PartialEq for Paint { + fn eq(&self, other: &Self) -> bool { + self.kind == other.kind && self.opacity == other.opacity && self.visible == other.visible && self.blend == other.blend + } } fn yes() -> bool { @@ -555,11 +566,17 @@ fn yes() -> bool { impl Paint { pub fn solid(color: Color) -> Self { - Self { kind: PaintKind::Solid { color: color.with_alpha(1.0) }, opacity: color.a, visible: true, blend: BlendMode::Normal } + Self { + kind: PaintKind::Solid { color: color.with_alpha(1.0) }, + opacity: color.a, + visible: true, + blend: BlendMode::Normal, + color_alpha: color.a < 1.0, + } } pub fn gradient(g: Gradient) -> Self { - Self { kind: PaintKind::Gradient(g), opacity: 1.0, visible: true, blend: BlendMode::Normal } + Self { kind: PaintKind::Gradient(g), opacity: 1.0, visible: true, blend: BlendMode::Normal, color_alpha: false } } pub fn image(hash: impl Into, mode: ImageScaleMode) -> Self { @@ -575,12 +592,13 @@ impl Paint { opacity: 1.0, visible: true, blend: BlendMode::Normal, + color_alpha: false, } } /// Layer `source` (a node id) tiled at its own size. pub fn pattern(source: u64) -> Self { - Self { kind: PaintKind::Pattern(PatternPaint::new(source)), opacity: 1.0, visible: true, blend: BlendMode::Normal } + Self { kind: PaintKind::Pattern(PatternPaint::new(source)), opacity: 1.0, visible: true, blend: BlendMode::Normal, color_alpha: false } } /// The solid colour (with the paint opacity folded into alpha), if solid. diff --git a/crates/engine/src/binding_lists_tests.rs b/crates/engine/src/binding_lists_tests.rs index 9db9975a9..8b221efdd 100644 --- a/crates/engine/src/binding_lists_tests.rs +++ b/crates/engine/src/binding_lists_tests.rs @@ -46,7 +46,7 @@ fn a_bound_fill_colour_keeps_the_other_fills() { let fills = s.doc().unwrap().node(r).unwrap().fills.clone(); assert_eq!(fills.len(), 2, "the second fill stays"); assert_eq!(fills[0].kind, PaintKind::Solid { color: Color::from_rgb8_const(0xFF, 0, 0) }); - assert_eq!(fills[0].opacity, 1.0, "the variable brings the whole colour, alpha included"); + assert_eq!(fills[0].opacity, 0.5, "the bound paint keeps its opacity"); assert_eq!(fills[1].kind, PaintKind::Solid { color: Color::from_rgb8_const(0, 0xFF, 0) }); // Removing the bound (first) fill takes the binding with it. ex(&mut s, "fill.remove", json!({"ids": [r], "index": 0})); diff --git a/crates/engine/src/bound_alpha_tests.rs b/crates/engine/src/bound_alpha_tests.rs index b7210f0f7..c54f0fb7b 100644 --- a/crates/engine/src/bound_alpha_tests.rs +++ b/crates/engine/src/bound_alpha_tests.rs @@ -129,3 +129,25 @@ fn code_gives_a_translucent_stroke_its_alpha_once() { let code = s.execute("inspect.code", &json!({"id": r.0})).unwrap()["code"].as_str().unwrap_or_default().to_string(); assert!(code.contains("solid rgba(255, 0, 0, 0.50)"), "{code}"); } + +#[test] +fn binding_keeps_an_opacity_set_on_the_paint() { + // A 15% tint whose colour comes from a variable (#923): the bind replaces the colour only. + let mut s = Session::new(); + ex(&mut s, "variable.createCollection", json!({"name": "Tokens", "modes": ["Light"]})); + ex(&mut s, "variable.create", json!({"collection": "Tokens", "name": "red", "type": "color", "value": "#FF0000"})); + let props = json!({"fills": [{"type": "solid", "color": "#000000", "opacity": 0.15}]}); + let r = s.execute("node.create", &json!({"type": "rectangle", "x": 0, "y": 0, "width": 10, "height": 10, "props": props})).unwrap(); + let r = NodeId(r["id"].as_u64().unwrap()); + ex(&mut s, "variable.bind", json!({"ids": [r.0], "field": "fill", "variable": "red"})); + let p = s.doc().unwrap().node(r).unwrap().fills[0].clone(); + assert_eq!(p.kind, figcraft_color::PaintKind::Solid { color: figcraft_color::Color::from_rgb8_const(0xFF, 0, 0) }); + assert!(near(p.opacity, 0.15), "{}", p.opacity); + ex(&mut s, "variable.bind", json!({"ids": [r.0], "field": "fill", "variable": null})); + assert!(near(s.doc().unwrap().node(r).unwrap().fills[0].opacity, 0.15)); + // An opacity set on a `#RRGGBBAA` fill is the user's too, and stays. + let (mut s, r) = setup("#FF0000", "#FF0000"); + ex(&mut s, "fill.set", json!({"ids": [r.0], "index": 0, "opacity": 0.25})); + ex(&mut s, "variable.bind", json!({"ids": [r.0], "field": "fill", "variable": "tint"})); + assert!(near(alpha(&s, r), 0.25), "{}", alpha(&s, r)); +} diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index a16fbb386..88079c070 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -1365,10 +1365,12 @@ fn paint_set(s: &mut Session, p: &Value, fills: bool) -> Result { slot.kind = figcraft_color::PaintKind::Solid { color: c.with_alpha(1.0) }; if c.a < 1.0 { slot.opacity = c.a; + slot.color_alpha = true; } } if let Some(o) = num(p, "opacity") { slot.opacity = (if o > 1.0 { o / 100.0 } else { o }).clamp(0.0, 1.0) as f32; + slot.color_alpha = false; } if let Some(v) = boolean(p, "visible") { slot.visible = v; diff --git a/crates/engine/src/cmd/styles.rs b/crates/engine/src/cmd/styles.rs index af029e5f7..dd93bac38 100644 --- a/crates/engine/src/cmd/styles.rs +++ b/crates/engine/src/cmd/styles.rs @@ -805,9 +805,9 @@ pub fn bind(s: &mut Session, p: &Value) -> Result { } /// A colour variable bound to a solid paint owns its whole colour, alpha included. Binding restarts -/// the opacity (which holds the alpha a typed colour had, see `Paint::solid`) at 1, so the -/// variable's alpha applies once; unbinding moves the colour's alpha back into the opacity, where a -/// typed colour keeps it. An opacity set while bound multiplies on top and stays. +/// an opacity that holds the alpha a typed colour had (see `Paint::solid`) at 1, so the variable's +/// alpha applies once; an opacity set on its own, before or while bound, multiplies on top and +/// stays. Unbinding moves the colour's alpha back into the opacity, where a typed colour keeps it. pub(crate) fn rebind_paint_alpha(fills: &mut [Paint], strokes: &mut [Paint], field: &str, bind: bool) { use super::lists::{BoundList, list_binding}; let Some((list, i, "color")) = list_binding(field) else { return }; @@ -819,7 +819,15 @@ pub(crate) fn rebind_paint_alpha(fills: &mut [Paint], strokes: &mut [Paint], fie if let Some(p) = paints.get_mut(i) && let PaintKind::Solid { color } = &mut p.kind { - p.opacity = if bind { 1.0 } else { p.opacity * color.a }; + if bind { + if p.color_alpha { + p.opacity = 1.0; + } + p.color_alpha = false; + } else if color.a < 1.0 { + p.opacity *= color.a; + p.color_alpha = true; + } color.a = 1.0; } } diff --git a/crates/format/src/fig/assets_tests.rs b/crates/format/src/fig/assets_tests.rs index 4777be185..b48dd9d38 100644 --- a/crates/format/src/fig/assets_tests.rs +++ b/crates/format/src/fig/assets_tests.rs @@ -104,7 +104,10 @@ fn themed() -> Document { add(&mut doc, frame, NodeKind::Rectangle, "Swatch", (10.0, 10.0), (80.0, 60.0), &|n| { let mut g = Gradient::default_for(GradientKind::Linear, Color::BLACK); g.stops = vec![ColorStop { position: 0.0, color: Color::BLACK }, ColorStop { position: 1.0, color: Color::WHITE }]; - n.fills = vec![solid(0.5, 0.5, 0.5), Paint { kind: PaintKind::Gradient(g), opacity: 1.0, visible: true, blend: BlendMode::Normal }]; + n.fills = vec![ + solid(0.5, 0.5, 0.5), + Paint { kind: PaintKind::Gradient(g), opacity: 1.0, visible: true, blend: BlendMode::Normal, color_alpha: false }, + ]; n.strokes = vec![solid(0.0, 0.0, 0.0), solid(1.0, 0.0, 0.0)]; n.effects = vec![Effect { kind: EffectKind::DropShadow(Shadow { diff --git a/crates/format/src/fig/export_tests.rs b/crates/format/src/fig/export_tests.rs index 0eac95712..8d93d51e4 100644 --- a/crates/format/src/fig/export_tests.rs +++ b/crates/format/src/fig/export_tests.rs @@ -74,7 +74,7 @@ fn paint(r: &mut Lcg, image: &str) -> Paint { p.kind } }; - Paint { kind, opacity: r.pick(&[1.0, 0.5, 0.25]), visible: r.chance(85), blend: r.pick(&BLENDS) } + Paint { kind, opacity: r.pick(&[1.0, 0.5, 0.25]), visible: r.chance(85), blend: r.pick(&BLENDS), color_alpha: false } } fn effect(r: &mut Lcg) -> Effect { diff --git a/crates/format/src/rest/props.rs b/crates/format/src/rest/props.rs index efb7710d5..ff06c737e 100644 --- a/crates/format/src/rest/props.rs +++ b/crates/format/src/rest/props.rs @@ -139,7 +139,7 @@ fn paint(cx: &mut Ctx, p: &Value) -> Option { return None; } }; - Some(Paint { kind, opacity, visible: flag(p, "visible").unwrap_or(true), blend: paint_blend(p) }) + Some(Paint { kind, opacity, visible: flag(p, "visible").unwrap_or(true), blend: paint_blend(p), color_alpha: false }) } /// Gradient handles are already in the node's unit box (start, end, width), like ours. From f3e5d2abc4c5db3289dce999bc1c1ed47303975d Mon Sep 17 00:00:00 2001 From: Hamza Date: Wed, 21 Oct 2026 00:06:57 +0500 Subject: [PATCH 438/817] .fig import: a note says how much of the file it covers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A .fig import's notes were deduplicated and left uncounted, so each kind was named once with no sign of how much of the file it applied to: a file whose every text layer lost a setting read exactly like one where a single layer did. That is what made the loss in #467 invisible -- the reporter saw one line while three kinds of data went, one of them on all 83 text layers. The mapper now collects its notes through the same `Warnings` the REST importer already uses, which keeps the first-seen order and the cap and appends `(×n)` where a note was met more than once. Nothing else changes: the note text stays the catalog key it was, and the import report already reads a `(×n)` suffix off before translating the base (`ui-egui`'s `note_text`), so a counted note is still translated. `figcraft-cli info` prints these notes, so it now names each kind with its count. With the count dropped again, the test reports the two notes plain: ["connector layers import as static frame/vector snapshots ...", "connector label was skipped: depth limit prevents nested ..."] Part of #467. --- crates/format/src/fig/map.rs | 18 +++++---- .../map_connector_snapshot_budget_tests.rs | 40 +++++++++++++++++-- crates/format/src/rest/mod.rs | 19 +++++++-- 3 files changed, 61 insertions(+), 16 deletions(-) diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 8e4671511..f36cbb834 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -58,7 +58,7 @@ pub(super) fn to_rest(msg: &Kv, name: &str, max_nodes: usize) -> (Value, Vec { library_contexts: Vec, /// Layers visited while scanning internal canvases, across all of them. library_scan_count: usize, - warnings: Vec, + warnings: crate::rest::Warnings, count: usize, /// Most layers produced or scanned, instance expansion included; the one place the cap comes /// from (see [`super::layer_budget`]). @@ -464,7 +464,7 @@ impl<'a> Mapper<'a> { override_scope_entries: 0, library_contexts: Vec::new(), library_scan_count: 0, - warnings: Vec::new(), + warnings: crate::rest::Warnings::default(), count: 0, max_nodes, networks: Vec::new(), @@ -493,12 +493,14 @@ impl<'a> Mapper<'a> { .cloned() } + /// A note about what this file's mapping left out or changed. Counted, as the REST importer + /// counts its own: these notes are met once per layer, so the kinds were named once each with + /// no sign of how much of the file they covered -- a file whose every text layer lost a + /// setting read the same as one where a single layer did (#467). The collector keeps the + /// first-seen order and the same cap, since some notes name fields of the file (image + /// filters). fn warn(&mut self, w: impl Into) { - let w = w.into(); - // Capped like the REST importer's list: some warnings name fields of the file (image filters). - if self.warnings.len() < crate::rest::MAX_WARNINGS && !self.warnings.contains(&w) { - self.warnings.push(w); - } + self.warnings.add(w.into()); } fn children(&self, id: &str) -> Vec { diff --git a/crates/format/src/fig/map_connector_snapshot_budget_tests.rs b/crates/format/src/fig/map_connector_snapshot_budget_tests.rs index ca47578da..8727c31b7 100644 --- a/crates/format/src/fig/map_connector_snapshot_budget_tests.rs +++ b/crates/format/src/fig/map_connector_snapshot_budget_tests.rs @@ -115,14 +115,14 @@ fn connector_snapshot_respects_last_and_zero_child_slots() { assert!(!children[0]["fillGeometry"].as_array().unwrap().is_empty(), "saved outline survives the budget limit"); assert_eq!(children[0]["fillGeometry"][0]["path"], "M 0 0 L 20 10"); assert_eq!(mapper.count, MAX_NODES); - assert!(mapper.warnings.iter().any(|warning| warning == &format!("the file has more than {MAX_NODES} layers; connector label was skipped"))); + assert!(mapper.warnings.seen().any(|warning| warning == format!("the file has more than {MAX_NODES} layers; connector label was skipped"))); let mut mapper = Mapper::new(&message, MAX_NODES); mapper.count = MAX_NODES; let children = mapper.connector_snapshot_children(&view, "1:123"); assert!(children.is_empty()); assert_eq!(mapper.count, MAX_NODES, "the node budget is never exceeded"); - assert!(mapper.warnings.iter().any(|warning| warning.contains("connector snapshot children were skipped"))); + assert!(mapper.warnings.seen().any(|warning| warning.contains("connector snapshot children were skipped"))); } #[test] @@ -133,7 +133,7 @@ fn connector_snapshot_flattens_vector_at_depth_and_node_limits() { assert_eq!(depth_limited["type"], "VECTOR"); assert!(!depth_limited["fillGeometry"].as_array().unwrap().is_empty()); assert!(depth_limited.get("children").is_none()); - assert!(mapper.warnings.iter().any(|warning| warning == "connector label was skipped: depth limit prevents nested snapshot children")); + assert!(mapper.warnings.seen().any(|warning| warning == "connector label was skipped: depth limit prevents nested snapshot children")); let mut mapper = Mapper::new(&message, MAX_NODES); mapper.count = MAX_NODES - 1; @@ -142,5 +142,37 @@ fn connector_snapshot_flattens_vector_at_depth_and_node_limits() { assert!(!budget_limited["fillGeometry"].as_array().unwrap().is_empty()); assert!(budget_limited.get("children").is_none()); assert_eq!(mapper.count, MAX_NODES); - assert!(mapper.warnings.iter().any(|warning| warning == "connector label was skipped: node budget prevents nested snapshot children")); + assert!(mapper.warnings.seen().any(|warning| warning == "connector label was skipped: node budget prevents nested snapshot children")); +} + +/// A mapper note is met once per layer, so the kinds were named once each with no sign of how much +/// of the file they covered: a file whose every layer lost a setting read the same as one where a +/// single layer did (#467). They are counted now, with the `(×n)` the REST importer already uses +/// and the import report already reads back off before translating a note. +#[test] +fn a_note_met_more_than_once_carries_its_count() { + let message = message(); + + let mut mapper = Mapper::new(&message, MAX_NODES); + for _ in 0..2 { + mapper.layer("1:123", None, Affine::IDENTITY, None, None, MAX_DEPTH).expect("terminal connector"); + } + let notes = std::mem::take(&mut mapper.warnings).finish(); + let counted: Vec<&String> = notes.iter().filter(|n| n.contains("(×")).collect(); + assert!( + counted.iter().any(|n| n.ends_with("(×2)") && n.contains("connector label was skipped: depth limit")), + "the note met twice says so: {notes:?}" + ); + assert!(notes.iter().all(|n| !n.ends_with("(×1)")), "a count of one is left off: {notes:?}"); + + // One layer, and the same notes have no count at all. + let mut mapper = Mapper::new(&message, MAX_NODES); + mapper.layer("1:123", None, Affine::IDENTITY, None, None, MAX_DEPTH).expect("terminal connector"); + let once = std::mem::take(&mut mapper.warnings).finish(); + assert!(once.iter().all(|n| !n.contains("(×")), "{once:?}"); + assert_eq!( + once.len(), + counted.len() + notes.iter().filter(|n| !n.contains("(×")).count(), + "the same kinds, counted or not: {once:?} vs {notes:?}" + ); } diff --git a/crates/format/src/rest/mod.rs b/crates/format/src/rest/mod.rs index 78279e915..b86b0b91b 100644 --- a/crates/format/src/rest/mod.rs +++ b/crates/format/src/rest/mod.rs @@ -329,15 +329,16 @@ fn children(v: &Value) -> &[Value] { v.get("children").and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default() } -/// Distinct warnings in first-seen order, with repeat counts. +/// Distinct warnings in first-seen order, with repeat counts. Shared with the `.fig` mapper +/// (`crate::fig::map`), whose notes repeat per layer in the same way. #[derive(Default)] -struct Warnings { +pub(crate) struct Warnings { list: Vec<(String, usize)>, index: BTreeMap, } impl Warnings { - fn add(&mut self, msg: String) { + pub(crate) fn add(&mut self, msg: String) { if let Some(i) = self.index.get(&msg) { if let Some(e) = self.list.get_mut(*i) { e.1 += 1; @@ -348,7 +349,17 @@ impl Warnings { } } - fn finish(self) -> Vec { + /// The notes met so far, without their counts, for the tests that ask whether one was met + /// (the product reads them through [`Self::finish`], with the counts). + #[cfg(test)] + pub(crate) fn seen(&self) -> impl Iterator { + self.list.iter().map(|(msg, _)| msg.as_str()) + } + + /// The notes, each with `(×n)` after it where it was met more than once. The import report + /// reads that suffix off before it looks the note up in the catalogue, so a counted note is + /// still translated (`ui-egui`'s `note_text`). + pub(crate) fn finish(self) -> Vec { self.list.into_iter().map(|(m, n)| if n > 1 { format!("{m} (×{n})") } else { m }).collect() } } From df5ffec87b8a1efbbef7ffe397ba33312df9345c Mon Sep 17 00:00:00 2001 From: Mex <44814932+MMexicann@users.noreply.github.com> Date: Tue, 20 Oct 2026 21:25:49 +0200 Subject: [PATCH 439/817] M0.9: allow literal dash-prefixed CLI filenames --- ROADMAP.md | 4 ++++ apps/figcraft-cli/src/args.rs | 4 ++++ apps/figcraft-cli/src/main.rs | 39 +++++++++++++++++++++------------- apps/figcraft-cli/tests/cli.rs | 32 ++++++++++++++++++++++++++++ docs/cli.md | 4 ++++ 5 files changed, 68 insertions(+), 15 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 4e0d088d3..f80b829d8 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -131,6 +131,10 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). ## Progress log +- **2026-10-20** · CLI option terminator (M0.9): `--` ends option parsing, so dash-prefixed + filenames open normally; the global `--no-system-fonts` flag also respects the terminator. + Binary regression coverage opens five such native files and checks their JSON info. + - **2026-10-17** · Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. - **2026-10-17** · Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. - **2026-10-17** · Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. diff --git a/apps/figcraft-cli/src/args.rs b/apps/figcraft-cli/src/args.rs index 4c162dbb5..665f7ee07 100644 --- a/apps/figcraft-cli/src/args.rs +++ b/apps/figcraft-cli/src/args.rs @@ -18,6 +18,10 @@ impl Args { let mut a = Args::default(); let mut it = argv.iter(); while let Some(arg) = it.next() { + if arg == "--" { + a.positional.extend(it.cloned()); + break; + } let name = if let Some(n) = arg.strip_prefix("--") { n } else if let Some(n) = arg.strip_prefix('-').filter(|n| n.len() == 1 && !n.starts_with(|c: char| c.is_ascii_digit())) { diff --git a/apps/figcraft-cli/src/main.rs b/apps/figcraft-cli/src/main.rs index badc5bc30..c5d7833c6 100644 --- a/apps/figcraft-cli/src/main.rs +++ b/apps/figcraft-cli/src/main.rs @@ -101,15 +101,24 @@ impl From for CliError { pub type CliResult = Result; -fn run(argv: &[String]) -> CliResult { - let system_fonts = !argv.iter().any(|a| a == "--no-system-fonts"); - let argv: Vec = argv.iter().filter(|a| *a != "--no-system-fonts").cloned().collect(); - if system_fonts { +fn parse_args(argv: &[String], valued: &[&str], flags: &[&str]) -> CliResult { + let flags = [flags, &["no-system-fonts"]].concat(); + let args = Args::parse(argv, valued, &flags)?; + if !args.flag("no-system-fonts") { // Text lays out with the installed fonts, like the desktop app, so headless renders and // auto layout sizes match what users see. figcraft_text::scan_system_fonts_on_demand(); } - let Some((cmd, rest)) = argv.split_first() else { return Err(CliError::Usage("missing subcommand".into())) }; + Ok(args) +} + +fn run(argv: &[String]) -> CliResult { + let Some(command_index) = argv.iter().position(|a| a != "--no-system-fonts") else { + return Err(CliError::Usage("missing subcommand".into())); + }; + let cmd = argv.get(command_index).ok_or_else(|| CliError::Usage("missing subcommand".into()))?; + // Keep leading global flags with the subcommand's options, where values and `--` are parsed. + let rest: Vec = argv.iter().enumerate().filter(|(i, _)| *i != command_index).map(|(_, a)| a.clone()).collect(); match cmd.as_str() { "help" | "--help" | "-h" => { println!("{USAGE}"); @@ -120,13 +129,13 @@ fn run(argv: &[String]) -> CliResult { Ok(ExitCode::SUCCESS) } "info" => { - let a = Args::parse(rest, &ROOT_FLAGS, &["json"])?; + let a = parse_args(&rest, &ROOT_FLAGS, &["json"])?; let file = a.one_positional("info ")?; confined(&a, || files::info(&file, a.flag("json"))) } "export" => { let valued = [&["format", "scale", "page", "node", "o", "out", "bleed"][..], &ROOT_FLAGS[..]].concat(); - let a = Args::parse(rest, &valued, &["crop-marks", "bleed-marks", "cmyk"])?; + let a = parse_args(&rest, &valued, &["crop-marks", "bleed-marks", "cmyk"])?; let file = a.one_positional("export -o ")?; let out = a.value("o").or_else(|| a.value("out")).ok_or_else(|| CliError::Usage("export needs -o ".into()))?; let target = @@ -134,7 +143,7 @@ fn run(argv: &[String]) -> CliResult { confined(&a, || files::export(&file, &out, &target)) } "convert" => { - let a = Args::parse(rest, &ROOT_FLAGS, &[])?; + let a = parse_args(&rest, &ROOT_FLAGS, &[])?; match a.positional.as_slice() { [i, o] => confined(&a, || files::convert(i, o)), _ => Err(CliError::Usage("convert ".into())), @@ -142,19 +151,19 @@ fn run(argv: &[String]) -> CliResult { } "render" => { let valued = [&["o", "out", "scale", "page"][..], &ROOT_FLAGS[..]].concat(); - let a = Args::parse(rest, &valued, &[])?; + let a = parse_args(&rest, &valued, &[])?; let file = a.one_positional("render -o ")?; let out = a.value("o").or_else(|| a.value("out")).ok_or_else(|| CliError::Usage("render needs -o ".into()))?; confined(&a, || files::render(&file, &out, a.scale()?, a.value("page").as_deref())) } "run" => { let valued = [&["in", "out"][..], &ROOT_FLAGS[..]].concat(); - let a = Args::parse(rest, &valued, &[])?; + let a = parse_args(&rest, &valued, &[])?; let script = a.one_positional("run ")?; confined(&a, || files::run_script(&script, a.value("in").as_deref(), a.value("out").as_deref())) } "commands" => { - let a = Args::parse(rest, &["filter"], &["json"])?; + let a = parse_args(&rest, &["filter"], &["json"])?; if !a.positional.is_empty() { return Err(CliError::Usage("commands takes no positional arguments".into())); } @@ -163,7 +172,7 @@ fn run(argv: &[String]) -> CliResult { } "mcp" => { let valued = [&["attach"][..], &ROOT_FLAGS[..]].concat(); - let a = Args::parse(rest, &valued, &[])?; + let a = parse_args(&rest, &valued, &[])?; if !a.positional.is_empty() { return Err(CliError::Usage("mcp takes no positional arguments".into())); } @@ -178,7 +187,7 @@ fn run(argv: &[String]) -> CliResult { mcp(attach.as_deref(), roots_of(&a)?) } "plugin" => { - let a = Args::parse(rest, &["server"], &[])?; + let a = parse_args(&rest, &["server"], &[])?; match a.positional.as_slice() { [verb, folder] if verb == "publish" => { let server = a.value("server").ok_or_else(|| CliError::Usage("plugin publish needs --server ws://host:port/".into()))?; @@ -188,10 +197,10 @@ fn run(argv: &[String]) -> CliResult { } } "perf" => { - let a = Args::parse(rest, &["layers", "instances"], &[])?; + let a = parse_args(&rest, &["layers", "instances"], &[])?; let sizes: Vec = a.usizes("layers", &[1000, 10_000])?.into_iter().map(|n| n.clamp(10, 2_000_000)).collect(); let instances: Vec = a.usizes("instances", &[2000])?.into_iter().filter(|n| *n > 0).map(|n| n.min(100_000)).collect(); - perf::run(&sizes, &instances, system_fonts) + perf::run(&sizes, &instances, !a.flag("no-system-fonts")) } other => Err(CliError::Usage(format!("unknown subcommand `{other}`"))), } diff --git a/apps/figcraft-cli/tests/cli.rs b/apps/figcraft-cli/tests/cli.rs index eb42b8d88..1928cab56 100644 --- a/apps/figcraft-cli/tests/cli.rs +++ b/apps/figcraft-cli/tests/cli.rs @@ -14,6 +14,38 @@ fn tmp(name: &str) -> std::path::PathBuf { d } +#[test] +fn option_terminator_allows_dash_prefixed_filenames() { + let dir = tmp("option-terminator"); + let doc = figcraft_doc::Document::new("Dash-prefixed file"); + let bytes = figcraft_format::save_bytes(&doc, None).unwrap(); + for name in ["--drawing.figcraft", "-h", "--json", "--no-system-fonts", "--"] { + std::fs::write(dir.join(name), &bytes).unwrap(); + let output = bin().current_dir(&dir).args(["info", "--json", "--no-system-fonts", "--", name]).output().unwrap(); + assert!(output.status.success(), "{name}: {}", String::from_utf8_lossy(&output.stderr)); + let info: serde_json::Value = serde_json::from_slice(&output.stdout).unwrap(); + assert_eq!(info["file"], name); + assert_eq!(info["name"], "Dash-prefixed file"); + } + std::fs::remove_dir_all(dir).unwrap(); +} + +#[test] +fn global_font_flag_respects_option_values() { + for filter in ["--", "--no-system-fonts"] { + let output = bin().args(["commands", "--filter", filter, "--no-system-fonts", "--json"]).output().unwrap(); + assert!(output.status.success(), "{filter}: {}", String::from_utf8_lossy(&output.stderr)); + assert!(serde_json::from_slice::(&output.stdout).unwrap().is_array()); + } +} + +#[test] +fn global_font_flag_can_precede_the_subcommand() { + let output = bin().args(["--no-system-fonts", "commands", "--json"]).output().unwrap(); + assert!(output.status.success(), "{}", String::from_utf8_lossy(&output.stderr)); + assert!(!serde_json::from_slice::>(&output.stdout).unwrap().is_empty()); +} + #[test] fn bad_arguments_exit_2_without_panicking() { for args in [ diff --git a/docs/cli.md b/docs/cli.md index 699b6ba27..37e4b5945 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -6,6 +6,10 @@ commands, serve MCP and measure performance. Build it with Bad arguments print usage and exit with code 2; failures exit with 1. The CLI never panics on input. +Put options before `--` to pass a filename beginning with a dash, for example +`figcraft-cli info --json -- --drawing.figcraft`. Every argument after `--` is literal, +including a filename named `--no-system-fonts`. + ## Fonts Text lays out and renders with the same fonts as the desktop app: the fonts built into FigCraft From 1aa1d61bd4aeb2aa93bfc04e2a3156227631bab4 Mon Sep 17 00:00:00 2001 From: Hamza Date: Wed, 21 Oct 2026 00:29:14 +0500 Subject: [PATCH 440/817] MCP: get_node keeps to the limit too, and windows a wide node inspect_document sends a shallower tree when the document's is too large and points at get_node for the rest, so get_node was the way out of that limit -- and it had none of its own. Measured against a document with a frame of 15,000 children, through figcraft-cli mcp: inspect_document depth 64, allPages 14.29 MiB (8.00 MiB cap not applied before #915) get_node depth 64 10.51 MiB Both are over the 10 MiB buffer the report is about, and for get_node no depth makes it smaller: the width is at depth 1, so depth 1 is already 9.12 MiB of text and depth 0 has no children at all. get_node now takes the same maxBytes, cuts the subtree by depth as the document's tree is cut, and then takes a window over the children when even depth 1 is too large. The marker says how many children were shown of how many, and the offset to ask for next; `offset` is a new argument for reading the rest. After this: get_node depth 64 8.00 MiB, children 11427 of 15000 from 0, next 11427 The hint in inspect_document's marker no longer promises that get_node has no size limit, since that was the hole: it now says a wide node answers with a window and an offset. The test pages through a windowed node and asserts every child is reported exactly once, in order, with every page inside the limit. Unbounded, the first page is 23,003 bytes against a 7,667-byte limit. --- crates/mcp/src/tools.rs | 185 +++++++++++++++++++-- crates/mcp/tests/inspect_response_limit.rs | 57 +++++++ 2 files changed, 224 insertions(+), 18 deletions(-) diff --git a/crates/mcp/src/tools.rs b/crates/mcp/src/tools.rs index d04ea6209..19f2be354 100644 --- a/crates/mcp/src/tools.rs +++ b/crates/mcp/src/tools.rs @@ -189,8 +189,18 @@ pub fn tool_definitions() -> Vec { tool( "get_node", "Get layer", - "One layer as JSON (same fields as inspect_document) with its children to `depth`.", - obj(json!({"id": id_schema("Layer id"), "depth": int("Child depth (default 1)")}), &["id"]), + "One layer as JSON (same fields as inspect_document) with its children to `depth`. A subtree too large for one message is reported at a shallower depth, or with a window of the children, and a `truncated` object says so and gives the `offset` to ask for next.", + obj( + json!({ + "id": id_schema("Layer id"), + "depth": int("Child depth (default 1)"), + "offset": int("First child to report (default 0), for reading a node with more children than fit in one message"), + "maxBytes": int( + "Largest response to send, in bytes of the whole JSON-RPC message (default 8388608, which fits the usual 10 MiB client buffer); 1024 of it is kept for the envelope and the request id" + ), + }), + &["id"], + ), true, ), tool( @@ -588,12 +598,38 @@ const MARKER_RESERVE: usize = 1 << 10; /// the real envelope here would mean handing the transport's request id to every tool. const ENVELOPE_RESERVE: usize = 1 << 10; +/// What the caller says it can read, as the bytes its *tree* may take: the figure is for the whole +/// message, so the envelope's share comes off it here. +fn budget(a: &Map) -> Result<(usize, usize), String> { + // A caller that knows its own buffer can say so; 1 KiB is below the shallowest tree, so the + // floor only keeps the arithmetic sane. + let max_bytes = match n_arg(a, "maxBytes")? { + Some(v) if v < 1024.0 => return Err("`maxBytes` must be at least 1024".into()), + Some(v) => v.min(usize::MAX as f64) as usize, + None => MAX_RESPONSE, + }; + Ok((max_bytes, max_bytes.saturating_sub(ENVELOPE_RESERVE))) +} + +/// What a value's text block would take on the wire. It is sent as a text block, so it is measured +/// pretty-printed *and* escaped -- escaping adds about a tenth. +fn wire_size(value: &Value) -> usize { + let text = serde_json::to_string_pretty(value).unwrap_or_default(); + serde_json::to_string(&text).map_or(text.len(), |s| s.len()) +} + /// The document at `depth`, and what its text block would take on the wire. The tree is sent as a /// text block, so it is measured pretty-printed *and* escaped -- escaping adds about a tenth. fn inspect_at(b: &mut dyn Backend, depth: u64, all: bool) -> Result<(Value, usize), String> { let value = b.call("document.inspect", json!({"depth": depth, "allPages": all}))?; - let text = serde_json::to_string_pretty(&value).unwrap_or_default(); - let wire = serde_json::to_string(&text).map_or(text.len(), |s| s.len()); + let wire = wire_size(&value); + Ok((value, wire)) +} + +/// One layer's subtree at `depth`, and what its text block would take on the wire. +fn node_at(b: &mut dyn Backend, id: u64, depth: u64) -> Result<(Value, usize), String> { + let value = b.call("node.get", json!({"id": id, "depth": depth}))?; + let wire = wire_size(&value); Ok((value, wire)) } @@ -604,16 +640,7 @@ fn inspect_document(b: &mut dyn Backend, a: &Map) -> Result *x, Some(_) => return Err("`allPages` must be a boolean".into()), }; - // A caller that knows its own buffer can say so; 1 KiB is below the shallowest tree, so the - // floor only keeps the arithmetic sane. - let max_bytes = match n_arg(a, "maxBytes")? { - Some(v) if v < 1024.0 => return Err("`maxBytes` must be at least 1024".into()), - Some(v) => v.min(usize::MAX as f64) as usize, - None => MAX_RESPONSE, - }; - - // What the tree itself may take: the caller's figure is for the whole message. - let budget = max_bytes.saturating_sub(ENVELOPE_RESERVE); + let (max_bytes, budget) = budget(a)?; let (value, wire) = inspect_at(b, depth, all)?; if wire <= budget { @@ -664,21 +691,143 @@ fn inspect_document(b: &mut dyn Backend, a: &Map) -> Result) -> Result { let id = id_arg(a.get("id").ok_or("`id` is required")?)?; let depth = n_arg(a, "depth")?.unwrap_or(1.0).clamp(0.0, 64.0) as u64; - let v = b.call("node.get", json!({"id": id, "depth": depth}))?; - if v.is_null() { + let offset = n_arg(a, "offset")?.unwrap_or(0.0).max(0.0).min(u32::MAX as f64) as usize; + let (max_bytes, budget) = budget(a)?; + + let (value, wire) = node_at(b, id, depth)?; + if value.is_null() { return Err(format!("no such layer {id}")); } - Ok(ToolResult::json(&v)) + if wire <= budget && offset == 0 { + return Ok(ToolResult::json(&value)); + } + + // The deepest subtree that fits, by bisection, as the document's tree is cut. A node asked for + // at a depth of its own children only (1) cannot be made shallower without losing them all, + // so that is where the window takes over. + let (mut used, mut value, mut used_wire) = (depth, value, wire); + if depth > 1 && offset == 0 { + let (mut lo, mut hi) = (1u64, depth - 1); + while lo <= hi { + let mid = lo + (hi - lo) / 2; + let (v, w) = node_at(b, id, mid)?; + if w + MARKER_RESERVE <= budget { + (used, value, used_wire) = (mid, v, w); + if mid == hi { + break; + } + lo = mid + 1; + } else if mid == 1 { + (used, value, used_wire) = (1, v, w); + break; + } else { + hi = mid - 1; + } + } + if used_wire + MARKER_RESERVE <= budget { + return Ok(ToolResult::json(&with_marker(value, depth, used, wire, used_wire, max_bytes, None))); + } + } + + // Still over, or a window was asked for: the children from `offset` that fit. + let total = value.get("children").and_then(Value::as_array).map_or(0, Vec::len); + let window = children_window(&mut value, offset, budget.saturating_sub(MARKER_RESERVE)); + let shown = value.get("children").and_then(Value::as_array).map_or(0, Vec::len); + let next = (offset + shown < total).then_some(offset + shown); + let used_wire = wire_size(&value); + let mut out = with_marker( + value, + depth, + used, + wire, + used_wire, + max_bytes, + Some(json!({ + "from": offset, + "shown": shown, + "total": total, + "nextOffset": next, + })), + ); + if window && next.is_none() && offset == 0 && used == depth { + // Nothing was left out after all (an offset of zero that fitted whole). + out.as_object_mut().map(|o| o.remove("truncated")); + } + Ok(ToolResult::json(&out)) +} + +/// Keep the children from `offset` that fit in `budget`, and say whether any were left out. The +/// window is found by bisection: a node with thousands of children would otherwise be serialised +/// once per child. +fn children_window(value: &mut Value, offset: usize, budget: usize) -> bool { + let Some(all) = value.get("children").and_then(Value::as_array).cloned() else { return false }; + let rest: Vec = all.iter().skip(offset).cloned().collect(); + let fits = |value: &mut Value, n: usize| { + if let Some(obj) = value.as_object_mut() { + obj.insert("children".into(), Value::Array(rest.iter().take(n).cloned().collect())); + } + wire_size(value) <= budget + }; + if fits(value, rest.len()) { + return rest.len() != all.len(); + } + // The largest window that fits, between none and all of the rest. + let (mut lo, mut hi) = (0usize, rest.len()); + while lo < hi { + let mid = lo + (hi - lo).div_ceil(2); + if fits(value, mid) { lo = mid } else { hi = mid - 1 } + } + fits(value, lo); + true +} + +/// `value` with the `truncated` object saying how it was cut. `children`: the window, when the +/// children were cut as well as (or instead of) the depth. +fn with_marker(mut value: Value, asked: u64, used: u64, asked_wire: usize, used_wire: usize, max_bytes: usize, children: Option) -> Value { + if let Some(obj) = value.as_object_mut() { + let mut marker = json!({ + "requestedDepth": asked, + "depth": used, + "requestedDepthBytes": asked_wire, + "bytes": used_wire, + "maxBytes": max_bytes, + }); + match &children { + Some(window) => { + marker["children"] = window.clone(); + marker["reason"] = json!(format!( + "the subtree at depth {asked} would be {asked_wire} bytes on the wire, over the {max_bytes}-byte limit a client can read in one message; its children are reported from {} instead", + window.get("from").and_then(Value::as_u64).unwrap_or(0) + )); + marker["hint"] = json!("ask again with the `offset` in `children.nextOffset` for the rest, or get_node({id, depth}) on one child"); + } + None => { + marker["reason"] = json!(format!( + "the subtree at depth {asked} would be {asked_wire} bytes on the wire, over the {max_bytes}-byte limit a client can read in one message; it is reported at depth {used} instead" + )); + marker["hint"] = json!("get_node({id, depth}) on a child reads deeper, one subtree at a time"); + } + } + obj.insert("truncated".into(), marker); + } + value } fn select(b: &mut dyn Backend, a: &Map) -> Result { diff --git a/crates/mcp/tests/inspect_response_limit.rs b/crates/mcp/tests/inspect_response_limit.rs index 5e36b5a9b..b6d8b92e5 100644 --- a/crates/mcp/tests/inspect_response_limit.rs +++ b/crates/mcp/tests/inspect_response_limit.rs @@ -95,3 +95,60 @@ fn maxbytes_is_checked() { assert_eq!(r["isError"], true, "{r}"); assert!(r["content"][0]["text"].as_str().unwrap_or("").contains("at least 1024"), "{r}"); } + +/// `inspect_document` sends a shallower tree and points at `get_node` for the rest, so `get_node` +/// must keep to the same limit -- it was unbounded. Measured on `main`: a frame with 15,000 +/// children answers with a 10.5 MiB message at depth 1, over the 10 MiB buffer the report is +/// about, and no depth makes that smaller because the width is at depth 1. The children are +/// windowed instead, with the offset to ask for next. +#[test] +fn a_node_with_more_children_than_fit_is_windowed() { + let mut c = Client::new(); + let frame = c.create(json!({"type": "frame", "x": 0, "y": 0, "width": 400, "height": 400})); + for i in 0..40 { + c.create(json!({"type": "rectangle", "parent": frame, "x": i * 5, "y": 5, "width": 20, "height": 20})); + } + + // Whole, to measure against: every child, no marker. + let (whole, whole_wire) = get_node(&mut c, json!({"id": frame, "depth": 1})); + let total = whole["children"].as_array().expect("children").len(); + assert_eq!(total, 40, "{whole}"); + assert!(whole["truncated"].is_null(), "within the default limit: {}", whole["truncated"]); + + // A limit that holds only some of them: a window, and the marker says how many and what next. + let limit = whole_wire / 3; + assert!(limit >= 1024, "the fixture has to outgrow the floor: {whole_wire}"); + let (cut, cut_wire) = get_node(&mut c, json!({"id": frame, "depth": 1, "maxBytes": limit})); + assert!(cut_wire <= limit, "the response still exceeds maxBytes: {cut_wire} > {limit}"); + let window = &cut["truncated"]["children"]; + let shown = cut["children"].as_array().expect("children").len(); + assert_eq!(window["from"], json!(0), "{window}"); + assert_eq!(window["shown"], json!(shown), "{window}"); + assert_eq!(window["total"], json!(total), "{window}"); + assert!(shown > 0 && shown < total, "some children, not all: {shown} of {total}"); + assert_eq!(window["nextOffset"], json!(shown), "the offset to ask for next: {window}"); + // The layer itself is still there, not just a marker. + assert_eq!(cut["id"], whole["id"]); + + // Paging through with that offset reaches every child exactly once, in order. + let mut seen: Vec = Vec::new(); + let mut offset = Some(0u64); + while let Some(at) = offset { + let (page, wire) = get_node(&mut c, json!({"id": frame, "depth": 1, "maxBytes": limit, "offset": at})); + assert!(wire <= limit, "page at {at} exceeds maxBytes: {wire}"); + seen.extend(page["children"].as_array().cloned().unwrap_or_default()); + offset = page["truncated"]["children"]["nextOffset"].as_u64(); + assert!(seen.len() <= total, "a page repeated a child: {} of {total}", seen.len()); + } + assert_eq!(seen.len(), total, "every child was reported once"); + assert_eq!(seen, whole["children"].as_array().cloned().unwrap_or_default(), "in the same order"); +} + +/// The response and what its text block takes on the wire, for one `get_node` call. +fn get_node(c: &mut Client, args: Value) -> (Value, usize) { + let r = c.call("get_node", args.clone()); + assert_eq!(r["isError"], false, "{args}: {}", r["content"][0]["text"]); + let text = r["content"][0]["text"].as_str().expect("a text block"); + let wire = serde_json::to_string(&text).unwrap().len() + ENVELOPE; + (serde_json::from_str(text).expect("the block is JSON"), wire) +} From 59f3b3b73343489d737a4c5c4c1bd8f129fd3b14 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Wed, 21 Oct 2026 00:31:03 +0200 Subject: [PATCH 441/817] Fix Title Case restarting mid-word across styled runs in SVG export Found while testing crates/svg/src/lib.rs:589 (also :604 and :611) Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/svg/src/lib.rs | 6 ++++-- crates/svg/src/tests.rs | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/crates/svg/src/lib.rs b/crates/svg/src/lib.rs index 1433b9428..55176aaf7 100644 --- a/crates/svg/src/lib.rs +++ b/crates/svg/src/lib.rs @@ -586,7 +586,8 @@ impl W<'_> { } let end = glyphs.get(j).map_or(line.char_end, |g| g.char_start).max(start).min(chars.len()); let text: String = chars.get(start.min(end)..end).unwrap_or(&[]).iter().collect(); - let text = st.case.apply(text.trim_end_matches(['\n', '\r'])); + let prev = start.checked_sub(1).and_then(|k| chars.get(k)).copied(); + let text = st.case.apply_after(text.trim_end_matches(['\n', '\r']), prev); let own = match layout.styles.get(style).and_then(|s| s.fills.as_ref()) { Some(fills) => { let a = fills.iter().find_map(|p| self.paint_attr(p, n.width, n.height)).unwrap_or_else(|| "fill=\"none\"".into()); @@ -601,7 +602,8 @@ impl W<'_> { continue; } let text: String = chars.get(line.char_start..line.char_end.min(chars.len())).unwrap_or(&[]).iter().collect(); - let text = st.case.apply(text.trim_end_matches(['\n', '\r'])); + let prev = line.char_start.checked_sub(1).and_then(|k| chars.get(k)).copied(); + let text = st.case.apply_after(text.trim_end_matches(['\n', '\r']), prev); let (x, y) = layout.glyphs.get(line.glyph_start).map_or((0.0, line.baseline), |g| (g.x, g.y)); let _ = write!(spans, "{}", num(x), num(y), esc(&text)); } diff --git a/crates/svg/src/tests.rs b/crates/svg/src/tests.rs index 5a333d078..8dece77f4 100644 --- a/crates/svg/src/tests.rs +++ b/crates/svg/src/tests.rs @@ -116,6 +116,25 @@ fn text_run_fill_survives_live_text_export() { assert!(svg.contains("fill=\"#00FF00\"") && svg.contains(">b") && svg.contains(">a"), "{svg}"); } +#[test] +fn title_case_does_not_restart_words_across_fill_runs_in_live_text() { + use figcraft_doc::{StyleRun, TextCase, TextData}; + figcraft_text::scan_system_fonts(); + let mut d = Document::new("t"); + let page = d.first_page().unwrap(); + let mut text = TextData::new("hello"); + text.style.font_size = 24.0; + text.style.case = TextCase::Title; + let mut style = text.style.clone(); + style.fills = Some(vec![Paint::solid(Color::from_hex("00FF00").unwrap())]); + text.runs.push(StyleRun { start: 2, end: 3, style }); + text.normalize(); + let id = d.create(page, NodeKind::Text(text), "Text", 0.0, 0.0, 200.0, 40.0).unwrap(); + d.get_mut(id).unwrap().fills = vec![Paint::solid(Color::BLACK)]; + let svg = export_svg(&d, &[id], &SvgOptions { outline_text: false, ..SvgOptions::default() }).unwrap(); + assert!(svg.contains(">He") && svg.contains(">l") && svg.contains(">lo"), "{svg}"); +} + #[test] fn point_joins_equal_to_the_layer_join_keep_a_plain_stroke() { use figcraft_doc::{StrokeJoin, VectorNetwork}; From f53f37dfe0c647871a85dafaf2ee3a9a7c825b0a Mon Sep 17 00:00:00 2001 From: Siade Lucas Date: Tue, 20 Oct 2026 21:28:09 -0300 Subject: [PATCH 442/817] ui: scope page tracker by document UID and update on render Include document UID in pages_seen_page to correctly handle page selection and scroll tracking when switching between documents. Record page as seen only after the active row renders so that pages filtered out by search scroll into view when the filter is cleared. --- crates/ui-egui/src/layers.rs | 15 +++++++--- crates/ui-egui/src/layers_behaviour_tests.rs | 31 +++++++++++++++++++- crates/ui-egui/src/lib.rs | 4 +-- 3 files changed, 43 insertions(+), 7 deletions(-) diff --git a/crates/ui-egui/src/layers.rs b/crates/ui-egui/src/layers.rs index 212ae413f..f172b309e 100644 --- a/crates/ui-egui/src/layers.rs +++ b/crates/ui-egui/src/layers.rs @@ -229,8 +229,9 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { let mut move_to: Option<(NodeId, String)> = None; // Pages are dragged up and down the list to reorder them. let mut reorder = crate::list_drag::ListDrag::in_order(ui, "pages"); - let scroll_to_cur = app.ui.pages_seen_page != Some(cur); - app.ui.pages_seen_page = Some(cur); + let page_key = (uid, cur); + let scroll_to_cur = app.ui.pages_seen_page != Some(page_key); + let mut current_row_rendered = false; // A long list scrolls in its own area, so the layers keep their room below it. let max_h = pages_list_height(app.ui.pages_height, ui.available_height()); let mut moved = egui::ScrollArea::vertical().id_salt("pages_list").max_height(max_h).show(ui, |ui| { @@ -240,8 +241,11 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { } let sense = if filtering { Sense::click() } else { Sense::click_and_drag() }; let (r, resp) = ui.allocate_exact_size(vec2(w, 32.0), sense); - if scroll_to_cur && id == cur { - ui.scroll_to_rect(r, None); + if id == cur { + current_row_rendered = true; + if scroll_to_cur { + ui.scroll_to_rect(r, None); + } } if !filtering { reorder.row_by(&resp, k, r, || if divider { tr("Divider").to_string() } else { name.clone() }); @@ -306,6 +310,9 @@ fn pages(app: &mut FigApp, ui: &mut Ui) { } reorder.finish(ui) }); + if current_row_rendered { + app.ui.pages_seen_page = Some(page_key); + } // A drop outside the list's visible area (and the row gap at its edges) isn't on a page row, // even one scrolled out of view. if !ui.input(|i| i.pointer.latest_pos()).is_some_and(|p| moved.inner_rect.expand2(vec2(0.0, 3.0)).contains(p)) { diff --git a/crates/ui-egui/src/layers_behaviour_tests.rs b/crates/ui-egui/src/layers_behaviour_tests.rs index cb62540cc..4d987e66d 100644 --- a/crates/ui-egui/src/layers_behaviour_tests.rs +++ b/crates/ui-egui/src/layers_behaviour_tests.rs @@ -529,8 +529,37 @@ fn selecting_a_distant_page_scrolls_it_into_view() { for _ in 0..15 { u.frame(vec![]); } - assert_eq!(u.app.ui.pages_seen_page, Some(last)); + assert_eq!(u.app.ui.pages_seen_page, Some((u.app.session.ds().unwrap().uid, last))); let opened = pages_down_to(&mut u, layer.y - 60.0); let top = pages.iter().position(|p| Some(p) == opened.first()).unwrap(); assert!(top > 20, "the list scrolled past its first pages to reveal the selection (top row: page {top})"); } + +/// If the active page is filtered out by search, it is not marked as seen +/// until the filter is cleared and its row actually renders. +#[test] +fn filtered_out_active_page_is_seen_only_after_rendering() { + let mut s = Session::new(); + let p1 = s.doc().unwrap().pages[0]; + let p2 = id(s.execute("page.add", &json!({})).unwrap()); + s.execute("page.rename", &json!({"id": p1, "name": "Alpha"})).unwrap(); + s.execute("page.rename", &json!({"id": p2, "name": "Beta"})).unwrap(); + s.execute("page.select", &json!({"id": p1})).unwrap(); + let uid = s.ds().unwrap().uid; + let mut u = Ui::new(s); + assert_eq!(u.app.ui.pages_seen_page, Some((uid, p1))); + + // Filter to only "Alpha", then select "Beta" (p2). + u.app.ui.page_search = true; + u.app.ui.page_filter = "Alpha".into(); + u.app.run("page.select", json!({"id": p2})); + u.frame(vec![]); + + // Beta was filtered out and not rendered, so pages_seen_page has not recorded it. + assert_ne!(u.app.ui.pages_seen_page, Some((uid, p2))); + + // Clear filter: Beta renders now and is recorded. + u.app.ui.page_filter.clear(); + u.frame(vec![]); + assert_eq!(u.app.ui.pages_seen_page, Some((uid, p2))); +} diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index fb44b60a1..8801238de 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -495,8 +495,8 @@ pub struct UiState { pub page_filter: String, /// The height asked for the pages list (`None`: a share of the panel). pub pages_height: Option, - /// The active page when last drawn in the pages list, to scroll it into view when selected. - pub pages_seen_page: Option, + /// The document and active page last drawn in the pages list. + pub pages_seen_page: Option<(u64, NodeId)>, pub expanded: BTreeSet, /// The layer being renamed in the layers panel. pub rename: Option, From 2e12bdfd91a3c59d5dda02e3738f3e5cbf40d2f5 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Wed, 21 Oct 2026 02:46:23 +0200 Subject: [PATCH 443/817] Keep open subpaths open in ReverseSubpaths::reverse_subpaths Found while testing crates/geom/src/lib.rs:287 Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/geom/src/lib.rs | 4 +++- crates/geom/src/tests.rs | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/crates/geom/src/lib.rs b/crates/geom/src/lib.rs index da351e5bb..e0a4dde06 100644 --- a/crates/geom/src/lib.rs +++ b/crates/geom/src/lib.rs @@ -284,7 +284,9 @@ impl ReverseSubpaths for BezPath { kurbo::PathSeg::Cubic(c) => out.curve_to(c.p1, c.p2, c.p3), } } - out.close_path(); + if matches!(seg_path.elements().last(), Some(kurbo::PathEl::ClosePath)) { + out.close_path(); + } } out } diff --git a/crates/geom/src/tests.rs b/crates/geom/src/tests.rs index b99d7d8c3..15e24d494 100644 --- a/crates/geom/src/tests.rs +++ b/crates/geom/src/tests.rs @@ -108,3 +108,18 @@ fn set_rotation_keeps_center() { } } } + +#[test] +fn reverse_subpaths_preserves_open_and_closed() { + let mut open = BezPath::new(); + open.move_to((0.0, 0.0)); + open.line_to((10.0, 0.0)); + open.line_to((10.0, 10.0)); + let r = ::reverse_subpaths(&open); + assert!(!r.elements().iter().any(|e| matches!(e, kurbo::PathEl::ClosePath)), "{:?}", r.elements()); + + let mut closed = open.clone(); + closed.close_path(); + let r = ::reverse_subpaths(&closed); + assert!(matches!(r.elements().last(), Some(kurbo::PathEl::ClosePath)), "{:?}", r.elements()); +} From 1f78ca6abaa7f9bb8e790dac9dc5dd826e171755 Mon Sep 17 00:00:00 2001 From: AKY <85772856+arksky1@users.noreply.github.com> Date: Wed, 21 Oct 2026 13:34:40 +0900 Subject: [PATCH 444/817] Add Korean support Preserve existing Korean translations and exclude unused keys and keys already proposed in open PRs. Static catalog, key, placeholder, ellipsis, shortcut and whitespace checks passed. Cargo fmt, clippy, tests, xtasks and native/web UI validation were not run: Rust tools are unavailable and installation awaits approval. See docs/korean-translation-validation.md. --- crates/ui-egui/locales/ko.toml | 141 ++++++++++++++++++++++++++ docs/korean-translation-validation.md | 25 +++++ 2 files changed, 166 insertions(+) create mode 100644 docs/korean-translation-validation.md diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index b33b36b95..e7ad4f082 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -1641,6 +1641,122 @@ status = "draft — needs native review" "⌘ click" = "⌘ 클릭" "⌘ scroll" = "⌘ 스크롤" "⌥ drag" = "⌥ 드래그" +"A responsive product page: hero, features, figures, a quote and a footer" = "대표 영역, 기능, 수치, 인용문, 푸터로 구성된 반응형 제품 페이지" +"A title, an agenda, a big figure, a chart and a closing slide" = "제목, 목차, 주요 수치, 차트, 마무리 슬라이드" +"A to Z" = "이름 오름차순" +"Adding to {name}" = "{name}에 추가 중" +"All the fonts this file uses are installed" = "이 파일에 사용된 모든 글꼴이 설치되어 있습니다." +"Alphabetical" = "가나다순" +"An analytics screen on a grid: figures, charts drawn from vectors and a table" = "수치, 벡터 차트, 표를 격자로 배치한 분석 화면" +"Apps" = "앱" +"Apr" = "4월" +"Aug" = "8월" +"Bottom padding" = "아래쪽 안쪽 여백" +"Bound to {name}. Click to detach the variable." = "{name}에 연결되어 있습니다. 클릭하면 변수 연결을 해제합니다." +"Checking the fonts installed on this computer…" = "이 컴퓨터에 설치된 글꼴 확인 중…" +"Colour and text styles, Light and Dark variables, buttons, inputs and cards" = "색상 및 텍스트 스타일, 밝게·어둡게 변수, 버튼, 입력란, 카드" +"Convert to frame" = "프레임으로 변환" +"Convert to section" = "섹션으로 변환" +"Couldn't download the variables" = "변수를 다운로드할 수 없습니다." +"Created" = "만든 날짜" +"Dashboard" = "대시보드" +"Date created" = "만든 날짜" +"Dec" = "12월" +"Design system starter" = "디자인 시스템 시작 키트" +"Draw a frame" = "프레임 그리기" +"Drop a .figcraft, .fig, .json, .svg or image file." = ".figcraft, .fig, .json, .svg 또는 이미지 파일을 놓으세요." +"Drop to import" = "놓아서 가져오기" +"Drop to open" = "놓아서 열기" +"Edited {when}" = "{when} 편집" +"Export frames and layers as PNG, JPG, SVG or PDF" = "프레임과 레이어를 PNG, JPG, SVG 또는 PDF로 내보내기" +"Feb" = "2월" +"File not found" = "파일을 찾을 수 없습니다." +"Four screens of a trail app with components and a prototype flow" = "컴포넌트와 프로토타입 흐름이 포함된 트레일 앱 화면 4개" +"Getting started" = "시작하기" +"Greyscale components and two example screens to sketch a flow with" = "흐름을 구상할 수 있는 회색 음영 컴포넌트와 예시 화면 2개" +"Hide these tips (Getting started in the Help menu shows them again)" = "팁 숨기기(도움말 메뉴의 시작하기에서 다시 표시)" +"Hide when publishing" = "게시할 때 숨기기" +"Icon components on a 24 px grid with keylines and a size preview" = "키라인과 크기 미리 보기가 포함된 24px 격자의 아이콘 컴포넌트" +"Icon set starter" = "아이콘 세트 시작 키트" +"Individual padding" = "개별 안쪽 여백" +"Interface size" = "인터페이스 크기" +"Jan" = "1월" +"Jul" = "7월" +"Jun" = "6월" +"Kits" = "키트" +"Landing page" = "랜딩 페이지" +"Last modified" = "마지막 수정" +"Left padding" = "왼쪽 안쪽 여백" +"Link frames on the Prototype tab, then present the flow" = "프로토타입 탭에서 프레임을 연결한 다음 흐름을 실행해 보세요." +"Make a component" = "컴포넌트 만들기" +"Mar" = "3월" +"May" = "5월" +"Missing fonts" = "없는 글꼴" +"Mobile app" = "모바일 앱" +"Newest first" = "최신순" +"No files or templates match your search" = "검색 조건에 맞는 파일이나 템플릿이 없습니다." +"No other pages" = "다른 페이지 없음" +"No templates match your search" = "검색 조건에 맞는 템플릿이 없습니다." +"Nov" = "11월" +"Oct" = "10월" +"Oldest first" = "오래된순" +"One announcement in five common sizes: square, portrait, story, link and banner" = "하나의 공지를 정사각형, 세로형, 스토리, 링크, 배너의 일반적인 5가지 크기로 구성" +"Opening the file…" = "파일 여는 중…" +"Opening {n} files as new files" = { other = "파일 {n}개를 새 파일로 여는 중" } +"Order" = "순서" +"Other" = "기타" +"Pick the Frame tool, then drag on the canvas or choose a device size" = "프레임 도구를 선택한 뒤 캔버스에서 드래그하거나 기기 크기를 고르세요." +"Plugin" = "플러그인" +"Plugins & widgets" = "플러그인 및 위젯" +"Presentation slides" = "프레젠테이션 슬라이드" +"Playground" = "실험 공간" +"Relative to your system's display scaling (100% is the system's own size). Document zoom is separate." = "시스템 디스플레이 배율을 기준으로 합니다(100%는 시스템 기본 크기). 문서 확대/축소는 별도입니다." +"Remove from recents" = "최근 목록에서 제거" +"Reorder selection" = "선택 항목 순서 변경" +"Right padding" = "오른쪽 안쪽 여백" +"Search templates" = "템플릿 검색" +"See all templates" = "모든 템플릿 보기" +"Select layers and they space themselves as their content changes" = "레이어를 선택하면 내용 변경에 맞춰 간격이 자동으로 조정됩니다." +"Search files and templates" = "파일 및 템플릿 검색" +"Search results" = "검색 결과" +"Search pages" = "페이지 검색" +"Sep" = "9월" +"Share with a code" = "코드로 공유" +"Show all templates" = "모든 템플릿 표시" +"Show in Explorer" = "탐색기에서 보기" +"Show in Finder" = "Finder에서 보기" +"Show in folder" = "폴더에서 보기" +"Social and slides" = "소셜 및 슬라이드" +"Social post sizes" = "소셜 게시물 크기" +"Sort by" = "정렬 기준" +"Sort by {column}" = "{column} 기준 정렬" +"Start from a template" = "템플릿으로 시작" +"Start sharing with the Share button, then pass on the code it gives" = "공유 버튼으로 공유를 시작한 뒤 표시되는 코드를 전달하세요." +"Templates" = "템플릿" +"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 window is too small for {size}%, so the interface is drawn at {drawn}%. Make the window larger to use {size}%." = "창이 너무 작아 {size}% 대신 {drawn}%로 표시합니다. {size}%를 사용하려면 창을 키우세요." +"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." = "이 파일은 이 컴퓨터에 없는 글꼴을 사용합니다. 해당 글꼴을 설치할 때까지 대체 글꼴로 표시합니다." +"Top padding" = "위쪽 안쪽 여백" +"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" = "레이어를 컴포넌트로 만들고 재사용하여 모든 사본을 한 번에 변경하세요." +"Use your browser's zoom to change the interface size." = "인터페이스 크기는 브라우저의 확대/축소로 변경하세요." +"Uses variables: each layer shows them in its own mode" = "변수 사용: 각 레이어의 모드에 따라 표시합니다." +"Websites" = "웹사이트" +"What you try here changes this preview and the code below, not the file" = "여기서 변경한 내용은 미리 보기와 아래 코드에만 적용되며 파일은 바뀌지 않습니다." +"Widget" = "위젯" +"Wireframe kit" = "와이어프레임 키트" +"Z to A" = "이름 내림차순" +"just now" = "방금" +"only in a text style or variable" = "텍스트 스타일 또는 변수에서만 사용" +"slot layers without a matching slot property were imported as frames" = "일치하는 슬롯 속성이 없는 슬롯 레이어를 프레임으로 가져왔습니다." +"yesterday" = "어제" +"{month} {day}, {year}" = "{year}년 {month} {day}일" +"{n} text layers" = { other = "텍스트 레이어 {n}개" } +"{percent}%" = "{percent}%" [commands] "align.bottom" = "아래쪽 정렬" @@ -2199,6 +2315,24 @@ status = "draft — needs native review" "widget.list" = "위젯 목록" "window.focus" = "창을 맨 앞으로 가져오기" "window.new" = "새 창" +"arrange.reorder" = "선택 항목 순서 변경" +"component.hideWhenPublishing" = "게시할 때 숨기기" +"object.convertToGroup" = "그룹으로 변환" +"object.convertToFrame" = "프레임으로 변환" +"object.convertToSection" = "섹션으로 변환" +"text.rescanFonts" = "설치된 글꼴 다시 검색" +"text.loadFont" = "글꼴 파일 불러오기" +"view.outlinesHiddenLayers" = "윤곽선에 숨겨진 레이어 포함" +"view.outlinesObjectBounds" = "윤곽선에 개체 경계 포함" +"view.panelWidths" = "패널 너비 초기화" +"pref.uiScale" = "인터페이스 크기" +"help.gettingStarted" = "시작하기" +"style.bind" = "스타일에 변수 연결" +"component.playground" = "컴포넌트 실험실" +"text.missingFonts" = "누락된 글꼴" +"text.refit" = "글꼴에 맞게 텍스트 조정" +"template.list" = "템플릿 목록" +"file.newFromTemplate" = "템플릿에서 새로 만들기" [menu] "bool.exclude" = "제외" @@ -2230,3 +2364,10 @@ status = "draft — needs native review" "view.themeDark" = "다크" "view.themeLight" = "라이트" "view.themeSystem" = "시스템 따르기" +"file.newFromTemplate" = "템플릿에서 새로 만들기…" +"view.outlinesHiddenLayers" = "숨겨진 레이어 포함" +"view.outlinesObjectBounds" = "개체 경계 포함" +"view.panelWidths" = "패널 너비 초기화" +"text.missingFonts" = "누락된 글꼴…" +"component.hideWhenPublishing" = "게시할 때 숨기기" +"help.gettingStarted" = "시작하기" diff --git a/docs/korean-translation-validation.md b/docs/korean-translation-validation.md new file mode 100644 index 000000000..ad5cdcec2 --- /dev/null +++ b/docs/korean-translation-validation.md @@ -0,0 +1,25 @@ +# Korean translation validation + +Catalog additions against `d9c924c3ba7114dff9141c667aec56d3764f3af9`: **141** entries. Existing Korean entries are unchanged. The provided translation data was checked against the current Rust sources; candidate keys with no matching production literal were excluded. No new translations were generated. + +## Static checks + +- Catalog structure, unique keys, original key preservation, named placeholders, trailing ellipses, and explicit shortcut tokens checked with Python 3.14.5. +- FigCraft TOML was parsed with the standard TOML parser; Korean plural entries keep only `other`. +- New entries have source-location evidence in the local audit; dynamic labels use the existing translation paths. +- `git diff --check` passed. + +## Checks not run + +Cargo, rustc, and rustfmt are unavailable in this environment. Rust installation is awaiting user approval; no tools were installed. The following checks have **not** been run: + +- `cargo test -p figcraft-ui-egui` +- `cargo fmt --all --check` +- `cargo clippy -p figcraft-ui-egui --all-targets -- -D warnings` +- `cargo xtask layers`, `cargo xtask assets`, `cargo xtask wasm`, and the full `cargo xtask ci` gate +- Native and web UI rendering, layout, runtime language switching, and font/glyph coverage + +## Candidate filtering + +- Excluded 0 supplied candidate keys without a matching production source literal. +- Excluded 0 supplied keys already proposed in open Korean translation PRs. From 9cbe31221a81cf058ff72e1e1a928a5cfee2fe3b Mon Sep 17 00:00:00 2001 From: AKY <85772856+arksky1@users.noreply.github.com> Date: Wed, 21 Oct 2026 13:56:38 +0900 Subject: [PATCH 445/817] Record Korean translation coverage checks Use only root-supplied Korean translations; overlapping unmerged PRs are not dependencies. Preserve existing main translations. Static catalog, placeholder and source-lookup checks passed. Rust and native/web UI tests were not run because Rust installation remains awaiting approval. --- docs/korean-translation-validation.md | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/docs/korean-translation-validation.md b/docs/korean-translation-validation.md index ad5cdcec2..8b679261c 100644 --- a/docs/korean-translation-validation.md +++ b/docs/korean-translation-validation.md @@ -1,25 +1,30 @@ # Korean translation validation -Catalog additions against `d9c924c3ba7114dff9141c667aec56d3764f3af9`: **141** entries. Existing Korean entries are unchanged. The provided translation data was checked against the current Rust sources; candidate keys with no matching production literal were excluded. No new translations were generated. +Catalog additions against `d9c924c3ba7114dff9141c667aec56d3764f3af9`: **141** entries. Every existing Korean entry is preserved. Only translations supplied by the root task were used. + +## Independent coverage + +- Restored 0 root-supplied keys previously omitted because an unmerged third-party PR also proposed them. These keys are included in this branch; no unmerged PR is required to supply them. +- The third-party PR patches were used to identify overlap, not as translation sources. +- The correction ZIP contains 153 direct-lookup mappings. All 153 keys and root-provided values were verified against their current source locations. +- Correction ZIP SHA256: `a97cb9c22e110d177ca7a5f0a70db976aee34056ae030fca2c3d9a0e884f755f`. ## Static checks -- Catalog structure, unique keys, original key preservation, named placeholders, trailing ellipses, and explicit shortcut tokens checked with Python 3.14.5. -- FigCraft TOML was parsed with the standard TOML parser; Korean plural entries keep only `other`. -- New entries have source-location evidence in the local audit; dynamic labels use the existing translation paths. +- Catalog syntax/table shape, unique keys, source keys, named placeholders, trailing ellipses, explicit shortcut tokens, and preservation of all existing Korean entries passed. +- Tokenized source audit: 1449 unique direct translation lookup keys; 0 word-bearing keys still missing from this catalog. +- Recorded 153 dynamic lookup sites for source inspection. Variable document text, file names, and machine identifiers retain their existing behavior. +- Finite dynamic checks passed: PhotoCraft menu catalog (632 keys), VectorCraft render-site table (21 keys), FigCraft English UI (1,747 keys), required command reference (574 keys), and menu reference (31 keys). All accepted root-supplied context/id/plural keys resolve. - `git diff --check` passed. ## Checks not run -Cargo, rustc, and rustfmt are unavailable in this environment. Rust installation is awaiting user approval; no tools were installed. The following checks have **not** been run: +Cargo, rustc, and rustfmt are unavailable. Rust installation remains awaiting user approval; no tools were installed. The following were not run: - `cargo test -p figcraft-ui-egui` - `cargo fmt --all --check` - `cargo clippy -p figcraft-ui-egui --all-targets -- -D warnings` -- `cargo xtask layers`, `cargo xtask assets`, `cargo xtask wasm`, and the full `cargo xtask ci` gate -- Native and web UI rendering, layout, runtime language switching, and font/glyph coverage +- `cargo xtask layers`, `cargo xtask assets`, `cargo xtask wasm`, and `cargo xtask ci` +- Native/web UI rendering, layout, runtime switching, and font/glyph coverage -## Candidate filtering - -- Excluded 0 supplied candidate keys without a matching production source literal. -- Excluded 0 supplied keys already proposed in open Korean translation PRs. +Static checks do not replace runtime verification or prove coverage of arbitrary runtime-generated messages. From 35da7b7cff99ca7f5aba7574d0c72155461e7cf1 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 21 Oct 2026 06:05:08 -0400 Subject: [PATCH 446/817] feat(window): adopt shared craft-window for Linux decorations (depends on craft-libs#217) (#971) * feat(window): adopt shared craft-window for Linux decorations Replace FigCraft's bespoke Wayland xdg-decoration probe (apps/figcraft/src/linux_window.rs) with the shared craft-window crate from craft-libs, so every Craft app agrees on who draws the window frame per desktop. The decision is now made once, before the viewport is built, by craft_window::Choice::probe(Prefix::new("FIGCRAFT")) and mapped onto FigCraft's existing TitleBar enum: Frame::Desktop => TitleBar::Native (TitleBar::Inset on macOS, unchanged) Frame::App(_) => TitleBar::Custom This drops the old runtime send_viewport_cmd(Decorations(..)) switch and the linux_window probe. macOS keeps its inset traffic lights and Windows keeps the system frame exactly as before. The only behaviour change: on KDE and other Wayland compositors with server-side decorations (Sway, Hyprland, COSMIC) FigCraft now keeps the native frame instead of always drawing its own custom title bar, matching the rest of the suite. NOT MERGEABLE YET: craft-window is pinned to the unmerged feature branch from storytold/craft-libs#217 and must be repointed to a merged rev before this can land. * fix(window): preserve Windows titlebar; pin craft-window to merged rev - Keep FigCraft's own custom title bar on Windows. craft-window returns Frame::Desktop on Windows, and the mapper was turning that into TitleBar::Native, flipping Windows from its existing undecorated custom bar to the system frame. Map Frame::Desktop to Custom on Windows (as macOS maps to Inset); only Linux/BSD Frame::Desktop becomes Native. This keeps macOS and Windows unchanged; the sole change stays KDE/Wayland. - Repoint craft-window from the (now-merged) feature branch to the squash commit on storytold/craft-libs (craft-libs#217), and commit Cargo.lock. Verified: cargo build -p figcraft and cargo test -p figcraft (53 tests) pass against the merged dependency; rustfmt clean. --- Cargo.lock | 409 +++++++++++++----------------- Cargo.toml | 3 + apps/figcraft/Cargo.toml | 9 +- apps/figcraft/src/linux_window.rs | 112 -------- apps/figcraft/src/main.rs | 96 +++++-- 5 files changed, 260 insertions(+), 369 deletions(-) delete mode 100644 apps/figcraft/src/linux_window.rs diff --git a/Cargo.lock b/Cargo.lock index 1d047aa42..e5941f572 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -244,9 +244,9 @@ dependencies = [ [[package]] name = "arboard" -version = "3.6.1" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0348a1c054491f4bfe6ab86a7b6ab1e44e45d899005de92f58b3df180b36ddaf" +checksum = "aeb9553e62312c8756a5979254fc6d7da8bbeb5986a1e17037fab932f7037917" dependencies = [ "clipboard-win", "image", @@ -258,7 +258,7 @@ dependencies = [ "objc2-foundation 0.3.2", "parking_lot", "percent-encoding", - "windows-sys 0.60.2", + "windows-sys 0.61.2", "wl-clipboard-rs", "x11rb", ] @@ -392,7 +392,7 @@ checksum = "4f8abc12baad266b1c8cec146854c195b5864b4221d4b2ca7296a7ae82d9e451" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -427,7 +427,7 @@ checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -491,15 +491,6 @@ version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" -[[package]] -name = "bit-set" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" -dependencies = [ - "bit-vec 0.8.0", -] - [[package]] name = "bit-set" version = "0.10.0" @@ -510,10 +501,13 @@ dependencies = [ ] [[package]] -name = "bit-vec" -version = "0.8.0" +name = "bit-set" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" +checksum = "56d87354e4229f54a44f7bf2435906a4656dba36026ab6eaca629a2c436a691c" +dependencies = [ + "bit-vec 0.10.1", +] [[package]] name = "bit-vec" @@ -521,6 +515,16 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b71798fca2c1fe1086445a7258a4bc81e6e49dcd24c8d0dd9a1e57395b603f51" +[[package]] +name = "bit-vec" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5727b15fa97d4f4fee0a3b7c3d550ed0269f54329207b86388de918604e31269" +dependencies = [ + "borsh", + "serde", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -582,6 +586,30 @@ dependencies = [ "piper", ] +[[package]] +name = "borsh" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "553c5d846a6ba5150c65e3b1b8ec073bcf1abc20f9b7220de384a4443ea4e20a" +dependencies = [ + "borsh-derive", + "bytes", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12cdfe656708a01f89b451a7d36466e6fe6c414de0aa18fc54f864f6f9ca9f56" +dependencies = [ + "once_cell", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 3.0.9", +] + [[package]] name = "bumpalo" version = "3.20.3" @@ -605,7 +633,7 @@ checksum = "6a1f896587b6f2c069c73d2f0913e2d590c3990285cd2f0b6aa02b786b4c679c" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -672,9 +700,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.6.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f74872d07caf508b30a21f6836e7d7016a2eaf7d9ff4f48deaa58cd8a0407630" +checksum = "877bf67ac8e52449eb2f9e98a344ea163beb70dd1f9eebe3cc5357dcfeaee4df" dependencies = [ "find-msvc-tools", "jobserver", @@ -766,9 +794,9 @@ checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" [[package]] name = "combine" -version = "4.6.8" +version = "4.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfc320937d09e6de266b31b9afb480f197d7a861be86be7cb2ea7e5d1bfffc5e" +checksum = "4356eba6976435498d05a311ee9fc486da3bc81c200d3f0d7dd9703b41913f92" dependencies = [ "bytes", "memchr", @@ -829,6 +857,12 @@ dependencies = [ "libc", ] +[[package]] +name = "core_detect" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" + [[package]] name = "core_maths" version = "0.1.1" @@ -861,11 +895,20 @@ name = "craft-docpath" version = "0.1.0" source = "git+https://github.com/storytold/craft-libs?rev=82a24b006eefa036b43c09a67fb9a3fbd17ffe63#82a24b006eefa036b43c09a67fb9a3fbd17ffe63" +[[package]] +name = "craft-window" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=1f805378d454dac48b5c214029d254055fdf961b#1f805378d454dac48b5c214029d254055fdf961b" +dependencies = [ + "egui", + "wayland-client", +] + [[package]] name = "crc32fast" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a7799fd6b852db0e61728dde9a204c423b44d689dbd432522543614b490e78" +checksum = "0ba106e844045ddc02c20768ac4b0b7cb45f2cc2ecbd833ac9f5dacb183c2055" dependencies = [ "cfg-if", ] @@ -951,9 +994,9 @@ checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376" [[package]] name = "defmt" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2953bfe4f93bbd20cc71198842756f77d161884c99ebbabc41d80231ded88d1" +checksum = "e4a0795ac740cb54d7b3775c9c17345f6aaecf884c01733b39d6017738e0e3e1" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -961,21 +1004,21 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad9c72e7ca2137e0dc3813245a0d282fd6daad32fd800af018306a9169b5fe8" +checksum = "840bb056bd99c495c9188198a258ab787c79f306d864db3e6e8451442d6d8366" dependencies = [ "defmt-parser", "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.9", ] [[package]] name = "defmt-parser" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" +checksum = "71958f69fb2de856c5dd51ac9377e986ca1aa5919f931bf5395a807277f889a0" dependencies = [ "thiserror 2.0.21", ] @@ -988,7 +1031,7 @@ checksum = "1b034bd7d5f032402a2479444dcc6f74e36a03f31854d41680fb240ef682a1ac" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -1038,7 +1081,7 @@ checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -1313,7 +1356,7 @@ dependencies = [ "ecolor", "emath", "epaint_default_fonts", - "font-types 0.12.6", + "font-types 0.12.7", "harfrust 0.12.0", "log", "nohash-hasher", @@ -1335,9 +1378,9 @@ checksum = "773fa9c96dd0dbef887e39d0ed6177f141cce4d68e6041df77570aa3702dfa13" [[package]] name = "equivalent" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" [[package]] name = "errno" @@ -1416,6 +1459,7 @@ name = "figcraft" version = "0.8.0" dependencies = [ "arboard", + "craft-window", "eframe", "egui", "env_logger", @@ -1427,11 +1471,9 @@ dependencies = [ "fmv-macos-events", "image", "log", - "raw-window-handle", "rfd", "serde_json", "wat", - "wayland-client", "webbrowser", "windows", "winit", @@ -1740,9 +1782,9 @@ dependencies = [ [[package]] name = "find-msvc-tools" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedcfb3409746eddb02b9e19ebda1c3394f759a152e48ee875a0844d1b955484" +checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48" [[package]] name = "fixedbitset" @@ -1810,9 +1852,9 @@ dependencies = [ [[package]] name = "font-types" -version = "0.12.6" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c92d9081c7ab3bd83ef1eecdfad090f3d966e3ce74106779664114cfe1a6274" +checksum = "835ae9d781464a79026cde387f9cbc650c9a4909d7cf7e658b127e3c35d2f35d" dependencies = [ "bytemuck", ] @@ -1857,7 +1899,7 @@ checksum = "ea5190182e6915eb873ddbc16e23b711b6eb1f9c00a0d0a3a91b5f6228475225" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -1908,7 +1950,7 @@ checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -2606,9 +2648,9 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" [[package]] name = "libc" -version = "0.2.190" +version = "0.2.191" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce5d3ddc6d3fa000eb1536d85e147bfe31aacaba692ed6a876f95cb7c855be78" +checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" [[package]] name = "libloading" @@ -2635,7 +2677,7 @@ dependencies = [ "bitflags 2.13.2", "libc", "plain", - "redox_syscall 0.9.4", + "redox_syscall 0.9.5", ] [[package]] @@ -2677,9 +2719,9 @@ checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" [[package]] name = "litrs" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" +checksum = "4744e383959f0db86ede514b809b1c53251889093803c05267acc7d4e7030d70" [[package]] name = "lock_api" @@ -3236,7 +3278,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -3492,15 +3534,6 @@ dependencies = [ "zerovec", ] -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy", -] - [[package]] name = "presser" version = "0.3.1" @@ -3533,16 +3566,17 @@ checksum = "3d595e54a326bc53c1c197b32d295e14b169e3cfeaa8dc82b529f947fba6bcf5" [[package]] name = "proptest" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744" +checksum = "b8530004ccb15eae51c7e40009fbe317f341f804db54dc033eec1c50be28cfa0" dependencies = [ - "bit-set 0.8.0", - "bit-vec 0.8.0", + "bit-set 0.11.1", + "bit-vec 0.10.1", "bitflags 2.13.2", + "chacha20", + "core_detect", "num-traits", - "rand 0.9.5", - "rand_chacha", + "rand", "rand_xorshift", "regex-syntax", "rusty-fork", @@ -3598,16 +3632,6 @@ version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" -[[package]] -name = "rand" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" -dependencies = [ - "rand_chacha", - "rand_core 0.9.5", -] - [[package]] name = "rand" version = "0.10.3" @@ -3619,24 +3643,11 @@ dependencies = [ "rand_core 0.10.1", ] -[[package]] -name = "rand_chacha" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core 0.9.5", -] - [[package]] name = "rand_core" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" -dependencies = [ - "getrandom 0.3.4", -] [[package]] name = "rand_core" @@ -3646,11 +3657,11 @@ checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" [[package]] name = "rand_xorshift" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +checksum = "60aa6af80be32871323012e02e6e65f8a7cc7890931ae421d217ad8fe0df2ccf" dependencies = [ - "rand_core 0.9.5", + "rand_core 0.10.1", ] [[package]] @@ -3723,7 +3734,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "046a7d674daf459825b32f5062056d6882db0d2f5a479fbd76ccfc870ac18709" dependencies = [ "bytemuck", - "font-types 0.12.6", + "font-types 0.12.7", "once_cell", ] @@ -3734,7 +3745,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "005c8acf251756c478b0bf402885bfd88a1476020c4c7e6060edc1aa68da38ea" dependencies = [ "bytemuck", - "font-types 0.12.6", + "font-types 0.12.7", "once_cell", ] @@ -3745,7 +3756,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5a0cf4bb6cbce4c29756270d189a5e400ac05e91192161d83a0bcb6e68492e8" dependencies = [ "bytemuck", - "font-types 0.12.6", + "font-types 0.12.7", "once_cell", ] @@ -3769,9 +3780,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "737970939a87c6fa31e7acad13307bccbb017a073b695b6089a2c484f929e20e" +checksum = "580c875845b41ecb1564ad1ae4703044cef774145e3d7a94dc2b3fa7c97868fd" dependencies = [ "bitflags 2.13.2", ] @@ -3916,9 +3927,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.45" +version = "0.23.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d41d731c7d2f962d1ccc364cec258de3c0e93b38c2fb3ba97ac74513048d634" +checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf" dependencies = [ "log", "once_cell", @@ -3940,9 +3951,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.15" +version = "0.103.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c3cf1d8b1e7d4927e2d154c3fcb02979afb9939629c62cd9048d4f07b60ac2" +checksum = "4443b1b6d39d7c663139942cc4558262562d2c84123bb6282ef177009ca8b281" dependencies = [ "ring", "rustls-pki-types", @@ -4077,14 +4088,14 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] name = "serde_json" -version = "1.0.151" +version = "1.0.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" dependencies = [ "itoa", "memchr", @@ -4101,7 +4112,7 @@ checksum = "8d3b1629de253c70a0508c3899572da79ca359fdab27c7920ff00406df418906" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -4235,9 +4246,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.16.2" +version = "1.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9395f0f0eee849a9b707b2f06bb92a6a422090e2123bb2ef8e87a0e61892a8e" +checksum = "5b3dc8af474f516a851ff4bd12db780f948b9250ad37211e4eec0bccea54e01b" dependencies = [ "serde", ] @@ -4401,9 +4412,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.6" +version = "3.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee" +checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b" dependencies = [ "proc-macro2", "quote", @@ -4418,7 +4429,7 @@ checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -4480,7 +4491,7 @@ checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -4566,9 +4577,9 @@ checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee" [[package]] name = "tokio" -version = "1.53.2" +version = "1.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e95f91fcc7a621e8b030f6aa23c71fe9838ae2fb4d8118b75602a328f5144044" +checksum = "a0c168a474b95bfecfe908a65d4bdffc523144b649a74c09c286afb35d53e0bc" dependencies = [ "pin-project-lite", ] @@ -4687,7 +4698,7 @@ dependencies = [ "http", "httparse", "log", - "rand 0.10.3", + "rand", "sha1", "thiserror 2.0.21", ] @@ -4750,9 +4761,9 @@ checksum = "0b993bddc193ae5bd0d623b49ec06ac3e9312875fdae725a975c51db1cc1677f" [[package]] name = "unicode-ident" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" [[package]] name = "unicode-properties" @@ -4844,9 +4855,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.27.0" +version = "1.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97277d36b9c3ace13e58fa6e753f8b0bbbf302a18dd193240d70f9e29681059a" +checksum = "7cc1186384beb7dd8eedea376413fd654937285ea6c9cfbb928dc3043ea4b606" dependencies = [ "js-sys", "serde_core", @@ -4963,7 +4974,7 @@ dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", "wasm-bindgen-shared", ] @@ -4978,12 +4989,12 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.261.0" +version = "0.262.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2608e8bb6d67fd68f5a8d0eb1363d6e7bcbc1f8ded5a0bd3a1e382462b876b22" +checksum = "4495a6f85dd94c411c749303efcbc5defade0b0cbdbc0541495241ab917a9b5a" dependencies = [ "leb128fmt", - "wasmparser 0.261.0", + "wasmparser 0.262.0", ] [[package]] @@ -5038,9 +5049,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.261.0" +version = "0.262.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f20f20e44f7e8aeb6744823ea9d869ede51e51be4fdaedede2852282e54d2d8" +checksum = "974d643b125b272607e2fff8012ea14a8328acd7621e4bafa7afb32500052b1b" dependencies = [ "bitflags 2.13.2", "indexmap", @@ -5049,9 +5060,9 @@ dependencies = [ [[package]] name = "wast" -version = "261.0.0" +version = "262.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "776443145731a4062e5b0d392892a2005909b6ab72d9fdc3cad53dd1a714e44a" +checksum = "30612a0c29249b5f185888a107e8a519d920226b7d07f9d351fd094e9f75eb23" dependencies = [ "bumpalo", "leb128fmt", @@ -5062,9 +5073,9 @@ dependencies = [ [[package]] name = "wat" -version = "1.261.0" +version = "1.262.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7b4d1a49ea73a8f3326e74e3a05db667001b16bd1035ed3356fc1a0ed05ca7f" +checksum = "e228027f2b07bbaf946980ebbe2437fca73be6f54c40c2a8d4f42f277075f8d1" dependencies = [ "wast", ] @@ -5242,9 +5253,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a" +checksum = "1c1c8e20c8a38fc7d65abfe74eb7280e4aa667e8eec8bc84996d2874810748d9" dependencies = [ "rustls-pki-types", ] @@ -5575,7 +5586,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -5584,16 +5595,7 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" -dependencies = [ - "windows-targets 0.53.5", + "windows-targets", ] [[package]] @@ -5611,31 +5613,14 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.53.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" -dependencies = [ - "windows-link", - "windows_aarch64_gnullvm 0.53.1", - "windows_aarch64_msvc 0.53.1", - "windows_i686_gnu 0.53.1", - "windows_i686_gnullvm 0.53.1", - "windows_i686_msvc 0.53.1", - "windows_x86_64_gnu 0.53.1", - "windows_x86_64_gnullvm 0.53.1", - "windows_x86_64_msvc 0.53.1", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] @@ -5653,96 +5638,48 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" - [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" -[[package]] -name = "windows_i686_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" - [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_i686_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" - [[package]] name = "winit" version = "0.30.13" @@ -5806,9 +5743,9 @@ dependencies = [ [[package]] name = "winresource" -version = "0.1.31" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0986a8b1d586b7d3e4fe3d9ea39fb451ae22869dcea4aa109d287a374d866087" +checksum = "a2bc6d36480b829272a5bdabf08e6dca8004761c1da7e35efef800540c66221b" dependencies = [ "toml", "version_check", @@ -5959,7 +5896,7 @@ checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", "synstructure", ] @@ -6031,7 +5968,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", "zbus_names", "zvariant", "zvariant_utils", @@ -6039,9 +5976,9 @@ dependencies = [ [[package]] name = "zbus_names" -version = "4.3.4" +version = "4.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8bf88b4a3ff53e883001e0e0115b297a9d53c31b9c1edd2bfdd853e3428624e" +checksum = "812a12be4ead7a59e18ea8f047d08add0066b73bc62fc1467066a2472ae088dd" dependencies = [ "serde", "winnow", @@ -6071,18 +6008,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.62" +version = "0.8.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86502bf56ac7c77571a32e2647bb2a15894565e981fb2a48d7bde2d91c965a9d" +checksum = "e5fe1f8f1b06191a00962174c61aa5005e0bb391a6d80d07e24d115c01a92ed8" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.62" +version = "0.8.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5457206954b06561e2608c7e19cf58b1926586d999c246eebe4502f7e2039d1a" +checksum = "863ad3ac83293fb4d740aedbfdc9240dd8d1a50c1099acd76ce80ce7c7230c7f" dependencies = [ "proc-macro2", "quote", @@ -6106,7 +6043,7 @@ checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", "synstructure", ] @@ -6146,23 +6083,21 @@ checksum = "34df6fc39dbd26ddc9c10e6a2984476e13acce22e64e4487636ef494369225da" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] name = "zip" -version = "2.4.2" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabe6324e908f85a1c52063ce7aa26b68dcb7eb6dbc83a2d148403c9bc3eba50" +checksum = "1dcb24d0152526ae49b9b96c1dcf71850ca1e0b882e4e28ed898a93c41334744" dependencies = [ "arbitrary", "crc32fast", "crossbeam-utils", - "displaydoc", "flate2", "indexmap", "memchr", - "thiserror 2.0.21", "zopfli", ] @@ -6180,9 +6115,9 @@ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" [[package]] name = "zopfli" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f05cd8797d63865425ff89b5c4a48804f35ba0ce8d125800027ad6017d2b5249" +checksum = "aaf7fc5d30c28483d93805c4a5e12b05bbb52407fa67c5f8bd552374cd01fb11" dependencies = [ "bumpalo", "crc32fast", @@ -6207,9 +6142,9 @@ dependencies = [ [[package]] name = "zvariant" -version = "5.15.0" +version = "5.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1d34c27cc6cdd1f458427519dd6b8612f7b7e3f7b9a0b2355d041dda9869147" +checksum = "80bf6d6cd6a4b601acb64cfb8284cdc643fcfa75ef26ae3c46ec8aa4e8a1fbb7" dependencies = [ "endi", "enumflags2", @@ -6222,14 +6157,14 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "5.15.0" +version = "5.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864155e69b4352db0c7f374917bf45d1e0c8d17659c8b3dbf9795f3673f8c497" +checksum = "ef2672456ba1cb54b5eaec136e63135b3c7495fb938e53b28a62e633496d486d" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", "zvariant_utils", ] @@ -6242,6 +6177,6 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 3.0.6", + "syn 3.0.9", "winnow", ] diff --git a/Cargo.toml b/Cargo.toml index 1eef32c76..bb06ba2ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,6 +34,9 @@ figcraft-plugin = { path = "crates/plugin" } # Which paths stored in a document may be followed (craft-libs). craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "82a24b006eefa036b43c09a67fb9a3fbd17ffe63" } +# Who draws the window frame on Linux — the compositor or the app — so every Craft app shows the +# same native titlebar per desktop (craft-libs). The `egui` feature adds `decorate`/`decorations`. +craft-window = { git = "https://github.com/storytold/craft-libs", rev = "1f805378d454dac48b5c214029d254055fdf961b", features = ["egui"] } # foundation kurbo = { version = "0.13", features = ["serde"] } diff --git a/apps/figcraft/Cargo.toml b/apps/figcraft/Cargo.toml index fac4842b1..6196d08d8 100644 --- a/apps/figcraft/Cargo.toml +++ b/apps/figcraft/Cargo.toml @@ -16,6 +16,10 @@ figcraft-ui-egui = { workspace = true } figcraft-collab-net = { workspace = true } figcraft-format = { workspace = true } figcraft-text = { workspace = true } +# Shared decision of who draws the window frame on Linux (compositor vs. app), replacing the +# bespoke Wayland xdg-decoration probe. See `[workspace.dependencies]`: pinned to the unmerged +# craft-libs#217 branch and must be repointed to a merged `rev` before this PR is mergeable. +craft-window = { workspace = true } egui = { workspace = true } eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit", "wayland", "x11"] } serde_json = { workspace = true } @@ -45,7 +49,6 @@ wat = { workspace = true } winresource = "0.1" [target.'cfg(target_os = "linux")'.dependencies] -# Use vector window controls without a title-font renderer or embedded Cantarell. +# Use vector window controls without a title-font renderer or embedded Cantarell. The compositor +# probe that used to need raw-window-handle and wayland-client here now lives in craft-window. winit = { version = "0.30", default-features = false, features = ["wayland-csd-adwaita-notitle"] } -raw-window-handle = "0.6" -wayland-client = "0.31" diff --git a/apps/figcraft/src/linux_window.rs b/apps/figcraft/src/linux_window.rs deleted file mode 100644 index f47b61e03..000000000 --- a/apps/figcraft/src/linux_window.rs +++ /dev/null @@ -1,112 +0,0 @@ -//! Request winit's frame only on Wayland compositors without xdg-decoration. -//! Desktop/session names cannot identify the backend of an individual window. - -use std::os::unix::net::UnixStream; -use std::path::PathBuf; -use std::sync::mpsc; -use std::time::Duration; - -use raw_window_handle::{HasDisplayHandle, RawDisplayHandle}; -use wayland_client::globals::{GlobalListContents, registry_queue_init}; -use wayland_client::protocol::wl_registry; -use wayland_client::{Connection, Dispatch, QueueHandle}; - -/// Capture the socket path before winit consumes an inherited WAYLAND_SOCKET. -/// Never consume, duplicate or query that inherited connection: there may be no -/// independently addressable display, or WAYLAND_DISPLAY may name another server. -pub fn display_socket() -> Option { - if std::env::var_os("WAYLAND_SOCKET").is_some_and(|s| !s.is_empty()) { - return None; - } - let display = std::env::var_os("WAYLAND_DISPLAY").filter(|s| !s.is_empty())?; - let path = PathBuf::from(display); - if path.is_absolute() { - Some(path) - } else { - std::env::var_os("XDG_RUNTIME_DIR").filter(|s| !s.is_empty()).map(|dir| PathBuf::from(dir).join(path)) - } -} - -pub fn needs_native_frame(cc: &eframe::CreationContext<'_>, socket: Option) -> bool { - let wayland = cc.display_handle().is_ok_and(|h| matches!(h.as_raw(), RawDisplayHandle::Wayland(_))); - if !wayland { - log::debug!("window controls: non-Wayland window, retaining custom controls"); - return false; - } - let server_decorations = socket.and_then(probe); - log::debug!("window controls: Wayland xdg-decoration available: {server_decorations:?}"); - native_frame(wayland, server_decorations) -} - -fn native_frame(wayland: bool, server_decorations: Option) -> bool { - wayland && server_decorations == Some(false) -} - -fn probe(socket: PathBuf) -> Option { - // The compositor must not be able to block startup on a registry roundtrip. - // On failure/timeout retain FigCraft's own working title bar and buttons. - let (send, receive) = mpsc::sync_channel(1); - std::thread::Builder::new() - .name("wayland-decorations".into()) - .spawn(move || { - let _ = send.send(registry_has_decorations(socket)); - }) - .ok()?; - receive.recv_timeout(Duration::from_millis(500)).ok().flatten() -} - -fn registry_has_decorations(socket: PathBuf) -> Option { - // A fresh connection leaves winit's event queue and inherited descriptors alone. - let stream = UnixStream::connect(socket).ok()?; - let connection = Connection::from_socket(stream).ok()?; - let (globals, _queue) = registry_queue_init::(&connection).ok()?; - Some(globals.contents().with_list(|list| list.iter().any(|g| g.interface == "zxdg_decoration_manager_v1"))) -} - -struct Registry; - -impl Dispatch for Registry { - fn event( - _state: &mut Self, - _registry: &wl_registry::WlRegistry, - _event: wl_registry::Event, - _data: &GlobalListContents, - _connection: &Connection, - _queue: &QueueHandle, - ) { - } -} - -#[cfg(test)] -mod tests { - #[test] - fn only_wayland_without_server_decorations_uses_the_frame() { - for (wayland, server_decorations, expected) in [ - (false, None, false), - (false, Some(false), false), - (false, Some(true), false), - (true, Some(true), false), - (true, Some(false), true), - (true, None, false), - ] { - assert_eq!(super::native_frame(wayland, server_decorations), expected); - } - } - - #[test] - fn an_unavailable_display_keeps_the_custom_controls() { - assert_eq!(super::probe("/nonexistent/figcraft-wayland-test".into()), None); - } - - #[test] - fn an_unresponsive_display_cannot_block_window_startup() -> std::io::Result<()> { - let socket = std::env::temp_dir().join(format!("figcraft-decoration-timeout-{}", std::process::id())); - let listener = std::os::unix::net::UnixListener::bind(&socket)?; - let start = std::time::Instant::now(); - assert_eq!(super::probe(socket.clone()), None); - assert!(start.elapsed() < std::time::Duration::from_secs(2)); - drop(listener); - let _ = std::fs::remove_file(socket); - Ok(()) - } -} diff --git a/apps/figcraft/src/main.rs b/apps/figcraft/src/main.rs index 00856c5d5..0b71149a9 100644 --- a/apps/figcraft/src/main.rs +++ b/apps/figcraft/src/main.rs @@ -21,8 +21,6 @@ mod args; mod control_server; mod gamepad; mod graphics; -#[cfg(target_os = "linux")] -mod linux_window; mod recovery; mod services; mod startup; @@ -222,8 +220,13 @@ fn main() -> eframe::Result { .with_inner_size([1440.0, 900.0]) .with_min_inner_size([800.0, 500.0]) .with_drag_and_drop(true); - // Start frameless on Linux; the app creator checks the actual display backend - // before enabling a client-side frame. Other windows inherit that decision. + // Who draws the window frame is decided once, before the viewport is built, by the shared + // craft-window crate (the rest of the Craft suite uses it too). On macOS the system frame is + // kept with FigCraft's inset traffic lights; on Windows it is the system frame; on Linux the + // decision follows the desktop: a Wayland compositor with server-side decorations (KDE, Sway, + // Hyprland, COSMIC) or an X11 window manager keeps the native frame, while GNOME's Mutter — + // which draws no server-side frame — leaves it to the app's own custom title bar. This replaces + // 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); if let Some(icon) = icon { @@ -232,8 +235,6 @@ fn main() -> eframe::Result { let mut options = eframe::NativeOptions { viewport, renderer: eframe::Renderer::Wgpu, ..Default::default() }; graphics::configure(&mut options.wgpu_options); figcraft_ui_egui::windows::install(fig); - #[cfg(target_os = "linux")] - let linux_display = linux_window::display_socket(); // Registered before the event loop starts, so it catches the Finder event that launched the app // as well as later ones. Lives until the event loop returns; the app creator only borrows it. #[cfg(target_os = "macos")] @@ -244,11 +245,6 @@ fn main() -> eframe::Result { "FigCraft", options, Box::new(move |_cc| { - #[cfg(target_os = "linux")] - if linux_window::needs_native_frame(_cc, linux_display) { - let _ = with_app(|fig| fig.ui.title_bar = figcraft_ui_egui::TitleBar::Native); - _cc.egui_ctx.send_viewport_cmd(egui::ViewportCommand::Decorations(true)); - } Ok(Box::new(App { queue, ctx_slot, @@ -274,9 +270,35 @@ fn opens_new_file(first_run: bool, start_on_home: bool, control: bool) -> bool { !first_run && (!start_on_home || control) } +/// The title bar FigCraft starts with, decided by the shared craft-window crate so every Craft app +/// agrees on who draws the frame per desktop. The override variable is `FIGCRAFT_TITLEBAR` +/// (`app` / `system`). macOS keeps its inset traffic lights unchanged (craft-window returns the +/// desktop frame there); Windows keeps the system frame; on Linux the compositor/window manager +/// decides (KDE/Sway/Hyprland/COSMIC and X11 keep the native frame, GNOME gets the custom one). fn desktop_title_bar() -> figcraft_ui_egui::TitleBar { + let choice = craft_window::Choice::probe(craft_window::Prefix::new("FIGCRAFT")); + title_bar_for(choice.into_frame()) +} + +/// Map craft-window's [`craft_window::Frame`] onto FigCraft's own [`figcraft_ui_egui::TitleBar`]. +/// +/// `Frame::App` means the app draws its own frame — FigCraft's custom title bar. `Frame::Desktop` +/// means the desktop draws it, but FigCraft keeps each platform's existing look there: +/// - macOS: the inset title bar with its traffic lights (`TitleBar::Inset`), unchanged. +/// - Windows: FigCraft's own custom title bar (`TitleBar::Custom`), unchanged — Windows never used +/// the plain native frame, and craft-window returning `Desktop` on Windows must not change that. +/// - Linux and the BSDs: the compositor's native frame (`TitleBar::Native`). This is the only +/// behaviour change: KDE and the other server-side-decoration compositors now keep their frame. +fn title_bar_for(frame: craft_window::Frame) -> figcraft_ui_egui::TitleBar { use figcraft_ui_egui::TitleBar; - if cfg!(target_os = "macos") { TitleBar::Inset } else { TitleBar::Custom } + match frame { + craft_window::Frame::Desktop if cfg!(target_os = "macos") => TitleBar::Inset, + // Windows kept FigCraft's own title bar before this change; keep it. + craft_window::Frame::Desktop if cfg!(target_os = "windows") => TitleBar::Custom, + craft_window::Frame::Desktop => TitleBar::Native, + // The app draws the frame (GNOME's Wayland session, or a `FIGCRAFT_TITLEBAR=app` override). + craft_window::Frame::App(_) => TitleBar::Custom, + } } fn window_chrome(viewport: egui::ViewportBuilder, title_bar: figcraft_ui_egui::TitleBar) -> egui::ViewportBuilder { @@ -288,15 +310,55 @@ fn window_chrome(viewport: egui::ViewportBuilder, title_bar: figcraft_ui_egui::T } } -#[cfg(all(test, target_os = "linux"))] -mod linux_window_tests { +#[cfg(test)] +mod title_bar_tests { + use figcraft_ui_egui::TitleBar; + + /// craft-window's app frame (GNOME's Wayland session, or a `FIGCRAFT_TITLEBAR=app` override) + /// becomes FigCraft's custom title bar on every platform, and `window_chrome` then drops the + /// decorations so FigCraft draws its own. #[test] - fn linux_starts_with_the_existing_frameless_title_bar() { - let bar = super::desktop_title_bar(); - assert_eq!(bar, figcraft_ui_egui::TitleBar::Custom); + fn the_app_frame_maps_to_the_custom_title_bar() { + let layout = craft_window::Layout::default(); + let bar = super::title_bar_for(craft_window::Frame::App(layout)); + assert_eq!(bar, TitleBar::Custom); let viewport = super::window_chrome(egui::ViewportBuilder::default(), bar); assert_eq!(viewport.decorations, Some(false)); } + + /// craft-window's desktop frame keeps each platform's existing look: macOS its inset traffic + /// lights, Windows FigCraft's own custom title bar (unchanged), and Linux/BSD the compositor's + /// native frame. The Linux case is the only behaviour change: KDE and the other + /// server-side-decoration compositors now keep their native frame. + #[test] + fn the_desktop_frame_is_mapped_per_platform() { + let bar = super::title_bar_for(craft_window::Frame::Desktop); + if cfg!(target_os = "macos") { + assert_eq!(bar, TitleBar::Inset); + } else if cfg!(target_os = "windows") { + // Windows kept its own title bar before and must keep it now. + assert_eq!(bar, TitleBar::Custom); + let viewport = super::window_chrome(egui::ViewportBuilder::default(), bar); + assert_eq!(viewport.decorations, Some(false)); + } else { + assert_eq!(bar, TitleBar::Native); + let viewport = super::window_chrome(egui::ViewportBuilder::default(), bar); + assert_eq!(viewport.decorations, Some(true)); + } + } + + /// macOS is untouched by this change: its inset title bar with the system traffic lights stays, + /// and `window_chrome` still asks for the full-size content view rather than toggling the + /// window decorations. + #[test] + #[cfg(target_os = "macos")] + fn macos_keeps_its_inset_title_bar() { + let bar = super::desktop_title_bar(); + assert_eq!(bar, TitleBar::Inset); + let viewport = super::window_chrome(egui::ViewportBuilder::default(), bar); + assert_eq!(viewport.fullsize_content_view, Some(true)); + assert_eq!(viewport.title_shown, Some(false)); + } } #[cfg(test)] From be0fcb5795db3bda65428601be9470beec6f3f4e Mon Sep 17 00:00:00 2001 From: kolla <78259478+kollakek1@users.noreply.github.com> Date: Wed, 21 Oct 2026 15:15:14 +0300 Subject: [PATCH 447/817] fix(ui): keep the style picker open while editing a style's colour The colour picker's Window area is keyed by egui as Id::new(Some(title)), but the style picker looked it up as Id::new("color_picker"), so the lookup always missed and any click in the picker counted as an outside click that closed the editor (and the picker with it). Give the window a fixed id and query it through colorpicker::window_id(), with a regression test. --- crates/ui-egui/src/colorpicker.rs | 9 ++++++++ crates/ui-egui/src/style_picker.rs | 2 +- crates/ui-egui/src/style_picker_tests.rs | 28 ++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/colorpicker.rs b/crates/ui-egui/src/colorpicker.rs index d6aad31d7..f6a19f723 100644 --- a/crates/ui-egui/src/colorpicker.rs +++ b/crates/ui-egui/src/colorpicker.rs @@ -435,6 +435,12 @@ fn alpha_slider(ui: &mut Ui, rect: Rect, color: Color) -> Option<(f32, bool)> { slider_knob(ui, rect, color.a, Id::new("cp_alpha")) } +/// The colour picker window's area id. A fixed id (not `Window::new`'s, which egui keys by +/// `Id::new(Some(title))`) so the style picker can tell a click inside the picker from one outside. +pub fn window_id() -> Id { + Id::new("color_picker") +} + pub fn show(app: &mut FigApp, ctx: &egui::Context) { let Some(target) = app.ui.picker.clone() else { return }; // A layer's picker belongs to the selection it was opened for: once that changes, close it @@ -463,6 +469,9 @@ pub fn show(app: &mut FigApp, ctx: &egui::Context) { let mut open = true; let mut close_now = false; egui::Window::new("color_picker") + // A fixed area id so the style picker can tell a click in here from a click outside + // (`Window::new` alone would key the area by `Id::new(Some(title))`). + .id(window_id()) .title_bar(false) .fixed_pos(pos) .fixed_size(vec2(240.0, 0.0)) diff --git a/crates/ui-egui/src/style_picker.rs b/crates/ui-egui/src/style_picker.rs index 29c9c5a94..227130003 100644 --- a/crates/ui-egui/src/style_picker.rs +++ b/crates/ui-egui/src/style_picker.rs @@ -909,7 +909,7 @@ pub fn show(app: &mut FigApp, ctx: &egui::Context) { // Clicks in the colour picker editing this picker's style, or in a menu the editor opened, // keep it open. let picker_rect = - app.ui.picker.as_ref().filter(|t| matches!(t, PickerTarget::Style { .. })).and(ctx.memory(|m| m.area_rect(Id::new("color_picker")))); + app.ui.picker.as_ref().filter(|t| matches!(t, PickerTarget::Style { .. })).and(ctx.memory(|m| m.area_rect(crate::colorpicker::window_id()))); // So do clicks in the variable picker binding one of its fields (Escape closes that first). let variables = crate::variable_ui::picker_rect(ctx); let in_popup = egui::Popup::is_any_open(ctx) || variables.is_some(); diff --git a/crates/ui-egui/src/style_picker_tests.rs b/crates/ui-egui/src/style_picker_tests.rs index becc42ce4..ad2c29710 100644 --- a/crates/ui-egui/src/style_picker_tests.rs +++ b/crates/ui-egui/src/style_picker_tests.rs @@ -164,6 +164,34 @@ fn chars_linked_to_several_styles_show_mixed() { assert_eq!(text_link(&app, &doc, &[t]), None); } +#[test] +fn a_click_in_the_colour_picker_keeps_the_style_editor_open() { + use crate::layers_drag_tests::Ui; + let mut s = Session::new(); + s.execute("style.create", &json!({"type": "paint", "name": "Brand", "value": [{"type": "solid", "color": "#0D99FF"}]})).unwrap(); + let mut u = Ui::new(s); + open_for_selection(&mut u.app, StyleSlot::Fill, Some("Brand")); + for _ in 0..3 { + u.frame(vec![]); + } + let id = u.app.session.doc().unwrap().style("Brand").unwrap().id.clone(); + u.app.ui.picker = Some(crate::colorpicker::PickerTarget::Style { id, index: 0 }); + for _ in 0..3 { + u.frame(vec![]); + } + let cp = u.ctx.memory(|m| m.area_rect(crate::colorpicker::window_id())).expect("colour picker shows"); + let p = cp.center(); + u.button(p, true); + u.button(p, false); + u.frame(vec![]); + assert!(u.app.ui.style_picker.is_some(), "the style editor stays open while the colour picker is used"); + assert!( + matches!(u.app.ui.picker, Some(crate::colorpicker::PickerTarget::Style { .. })), + "the colour picker stays open too: {:?}", + u.app.ui.picker + ); +} + #[test] fn local_style_drops_move_into_the_folder_above() { let st = |id: &str, name: &str| Style { From 12e0cdc147fd646e1c4eea550323de0bf8640494 Mon Sep 17 00:00:00 2001 From: Nicek Date: Wed, 21 Oct 2026 22:18:30 +0800 Subject: [PATCH 448/817] =?UTF-8?q?feat:=20=E4=B8=BA=E5=A1=AB=E5=85=85?= =?UTF-8?q?=E3=80=81=E6=8F=8F=E8=BE=B9=E5=92=8C=E6=95=88=E6=9E=9C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8F=B3=E9=94=AE=E5=A4=8D=E5=88=B6=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 实现了在属性行和分区标题上右键菜单,支持复制粘贴单个填充、描边和效果。新增了相关的命令、测试和国际化文本,完善了剪贴板数据结构以支持这些新功能。 --- crates/engine/src/cmd/edit.rs | 103 +++++++++++++++++++++- crates/engine/src/lib.rs | 8 ++ crates/engine/src/property_copy_tests.rs | 90 +++++++++++++++++++ crates/ui-egui/locales/en.toml | 6 ++ crates/ui-egui/locales/es.toml | 12 +++ crates/ui-egui/locales/zh-Hans.toml | 12 +++ crates/ui-egui/src/lib.rs | 2 + crates/ui-egui/src/panel_remove_tests.rs | 19 ++++ crates/ui-egui/src/property_menu_tests.rs | 101 +++++++++++++++++++++ crates/ui-egui/src/right.rs | 60 +++++++++++-- crates/ui-egui/src/widgets.rs | 18 +++- docs/parity-checklist.md | 4 +- 12 files changed, 425 insertions(+), 10 deletions(-) create mode 100644 crates/engine/src/property_copy_tests.rs create mode 100644 crates/ui-egui/src/property_menu_tests.rs diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index a16fbb386..0791f7e3d 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -229,6 +229,22 @@ pub fn specs() -> Vec { spec!("stroke.remove", "Remove stroke", "{ids?, index}", true, |s, p| paint_list(s, p, false, false)), spec!("fill.set", "Set fill", "{ids?, index?, paint | color, opacity?, visible?, blend?}", true, |s, p| paint_set(s, p, true)), spec!("stroke.set", "Set stroke", "{ids?, index?, paint | color, opacity?, visible?, blend?}", true, |s, p| paint_set(s, p, false)), + spec!("fill.copy", "Copy fill", "{id?, index? (default the top fill)}", false, |s, p| paint_copy(s, p, true)), + spec!("fill.paste", "Paste fill", "{ids?, index? (replace the fill there; without: add one)}", true, |s, p| paint_paste(s, p, true)), + spec!( + "stroke.copy", + "Copy stroke", + "{id?, index? (default the top stroke)} its paint and the stroke's weight, alignment, sides, caps, joins and dashes", + false, + |s, p| paint_copy(s, p, false) + ), + spec!( + "stroke.paste", + "Paste stroke", + "{ids?, index? (replace the stroke there; without: add one)} the copied stroke's settings come with its paint", + true, + |s, p| paint_paste(s, p, false) + ), spec!( "fill.pattern", "Pattern fill", @@ -276,6 +292,8 @@ pub fn specs() -> Vec { } ok() }), + spec!("effect.copy", "Copy effect", "{id?, index? (default the top effect)}", false, effect_copy), + spec!("effect.paste", "Paste effect", "{ids?, index? (replace the effect there; without: add one)}", true, effect_paste), spec!("grid.add", "Add layout grid", "{ids?, grid? {kind: grid|columns|rows, ..}}", true, |s, p| { let g: LayoutGrid = parse("grid.add", p, "grid")?.unwrap_or_default(); for id in req_targets("grid.add", s, p)? { @@ -608,7 +626,7 @@ fn paste_design_layers(s: &mut Session, p: &Value) -> Result { let props = s.clipboard.props.take(); // No open file has id 0. So paste treats this copy as a copy from a different file. s.clipboard = - crate::Clipboard { nodes, images, props, bounds, source_doc: 0, source: Some(doc), source_path: None, copied_components: BTreeSet::new() }; + crate::Clipboard { nodes, images, props, bounds, source_doc: 0, source: Some(doc), source_path: None, ..crate::Clipboard::default() }; let mut out = paste(s, p)?; if !other.issues.is_empty() { out["warnings"] = json!(other.issues); @@ -1386,6 +1404,53 @@ fn paint_set(s: &mut Session, p: &Value, fills: bool) -> Result { ok() } +/// Copy paint `index` (the top one by default) of the first target into the clipboard. A stroke +/// takes its node-wide settings (weight, alignment, sides, caps, joins, dashes) along. +fn paint_copy(s: &mut Session, p: &Value, fills: bool) -> Result { + let cmd = if fills { "fill.copy" } else { "stroke.copy" }; + let id = targets(s, p).first().copied().ok_or_else(|| bad(cmd, "select a layer"))?; + let at = opt_index(cmd, p, "index")?; + let (paint, stroke) = { + let doc = s.doc()?; + let n = doc.get(id)?; + let list = if fills { &n.fills } else { &n.strokes }; + let at = at.unwrap_or(list.len().saturating_sub(1)); + let paint = list.get(at).cloned().ok_or_else(|| bad(cmd, format!("no {} at index {at}", if fills { "fill" } else { "stroke" })))?; + (paint, (!fills).then(|| n.stroke.clone())) + }; + s.clipboard.paint = Some((fills, paint.clone())); + s.clipboard.stroke = stroke; + serde_json::to_value(&paint).map_err(|e| bad(cmd, e.to_string())) +} + +/// Paste the copied paint onto the targets: replacing paint `index` there, or adding one. A +/// stroke's copied settings go onto each target too. +fn paint_paste(s: &mut Session, p: &Value, fills: bool) -> Result { + let cmd = if fills { "fill.paste" } else { "stroke.paste" }; + let Some((copied_fills, paint)) = s.clipboard.paint.clone() else { + return Err(EngineError::Disabled(cmd.into(), "no copied fill or stroke".into())); + }; + if copied_fills != fills { + let what = if fills { "stroke" } else { "fill" }; + return Err(EngineError::Disabled(cmd.into(), format!("the copied paint is a {what}"))); + } + let ids = req_targets(cmd, s, p)?; + let mut q = json!({"ids": ids, "paint": serde_json::to_value(paint).map_err(|e| bad(cmd, e.to_string()))?}); + let out = match opt_index(cmd, p, "index")? { + Some(at) => { + q["index"] = json!(at); + paint_set(s, &q, fills)? + } + None => paint_list(s, &q, fills, true)?, + }; + if let Some(stroke) = s.clipboard.stroke.clone().filter(|_| !fills) { + for id in ids { + s.doc_mut()?.get_mut(id)?.stroke = stroke.clone(); + } + } + Ok(out) +} + fn pattern_fill(s: &mut Session, p: &Value) -> Result { const CMD: &str = "fill.pattern"; let src = req_id(CMD, p, "source")?; @@ -1422,3 +1487,39 @@ fn effect_add(s: &mut Session, p: &Value) -> Result { } ok() } + +/// Copy effect `index` (the top one by default) of the first target into the clipboard. +fn effect_copy(s: &mut Session, p: &Value) -> Result { + const CMD: &str = "effect.copy"; + let id = targets(s, p).first().copied().ok_or_else(|| bad(CMD, "select a layer"))?; + let at = opt_index(CMD, p, "index")?; + let e = { + let doc = s.doc()?; + let list = &doc.get(id)?.effects; + let at = at.unwrap_or(list.len().saturating_sub(1)); + list.get(at).cloned().ok_or_else(|| bad(CMD, format!("no effect at index {at}")))? + }; + s.clipboard.effect = Some(e.clone()); + serde_json::to_value(&e).map_err(|err| bad(CMD, err.to_string())) +} + +/// Paste the copied effect onto the targets: replacing effect `index` there, or adding one. +fn effect_paste(s: &mut Session, p: &Value) -> Result { + const CMD: &str = "effect.paste"; + let Some(e) = s.clipboard.effect.clone() else { + return Err(EngineError::Disabled(CMD.into(), "no copied effect".into())); + }; + let at = opt_index(CMD, p, "index")?; + for id in req_targets(CMD, s, p)? { + let n = s.doc_mut()?.get_mut(id)?; + match at { + Some(i) => { + if let Some(slot) = n.effects.get_mut(i) { + *slot = e.clone(); + } + } + None => n.effects.push(e.clone()), + } + } + ok() +} diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 79e7be0d5..3cb7de220 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -759,6 +759,12 @@ pub struct Clipboard { pub images: std::collections::BTreeMap, /// Copied properties (Copy properties / Paste properties). pub props: Option, + /// A copied fill or stroke row (`fill.copy`, `stroke.copy`): whether it's a fill, and the paint. + pub paint: Option<(bool, figcraft_color::Paint)>, + /// The stroke settings (`weight`, alignment, sides…) copied with a stroke's paint. + pub stroke: Option, + /// A copied effect row (`effect.copy`). + pub effect: Option, /// The page-space bounds of the copied selection. pub bounds: Option, pub source_doc: u64, @@ -1787,6 +1793,8 @@ pub(crate) mod plugins_tests; #[cfg(test)] mod progressive_blur_tests; #[cfg(test)] +mod property_copy_tests; +#[cfg(test)] mod proto_behaviour_tests; #[cfg(test)] mod proto_conditional_tests; diff --git a/crates/engine/src/property_copy_tests.rs b/crates/engine/src/property_copy_tests.rs new file mode 100644 index 000000000..f6cc70d7b --- /dev/null +++ b/crates/engine/src/property_copy_tests.rs @@ -0,0 +1,90 @@ +//! Copying one fill, stroke or effect row (`fill.copy`, `stroke.copy`, `effect.copy`) and pasting +//! it onto other layers (`fill.paste`, `stroke.paste`, `effect.paste`): the Design panel's row +//! menus. + +use figcraft_color::{Color, Paint}; +use figcraft_doc::{Effect, EffectKind, NodeId}; +use serde_json::{Value, json}; + +use crate::Session; + +fn id(v: Value) -> NodeId { + NodeId(v["id"].as_u64().unwrap()) +} + +fn ex(s: &mut Session, cmd: &str, p: Value) -> Value { + s.execute(cmd, &p).unwrap_or_else(|e| panic!("{cmd} {p}: {e}")) +} + +fn rect(s: &mut Session) -> NodeId { + id(ex(s, "shape.rectangle", json!({"x": 0, "y": 0, "width": 10, "height": 10}))) +} + +fn node(s: &Session, id: NodeId) -> figcraft_doc::Node { + s.doc().unwrap().node(id).unwrap().clone() +} + +#[test] +fn a_copied_fill_replaces_a_fill_row_or_adds_one() { + let mut s = Session::new(); + let a = rect(&mut s); + let b = rect(&mut s); + let red = Paint::solid(Color::from_hex("#FF0000").unwrap()); + ex(&mut s, "fill.add", json!({"ids": [a], "paint": red})); + let copied = ex(&mut s, "fill.copy", json!({"id": a, "index": 1})); + assert_eq!(copied["type"], "solid", "the copy reports the paint it took"); + // Onto b's fill row: it replaces that paint. + ex(&mut s, "fill.paste", json!({"ids": [b], "index": 0})); + assert_eq!(node(&s, b).fills, vec![red.clone()]); + // With no row: it adds one on top. + ex(&mut s, "fill.paste", json!({"ids": [b]})); + assert_eq!(node(&s, b).fills, [red.clone(), red]); + // Each paste is one undo step. + ex(&mut s, "edit.undo", json!({})); + assert_eq!(node(&s, b).fills.len(), 1); +} + +#[test] +fn a_copied_stroke_pastes_as_a_stroke_only() { + let mut s = Session::new(); + let a = rect(&mut s); + let b = rect(&mut s); + let blue = Paint::solid(Color::from_hex("#0000FF").unwrap()); + ex(&mut s, "stroke.add", json!({"ids": [a], "paint": blue})); + ex(&mut s, "node.set", json!({"ids": [a], "props": {"strokeWeight": 3.0, "strokeAlign": "outside"}})); + ex(&mut s, "stroke.copy", json!({"id": a, "index": 0})); + ex(&mut s, "stroke.add", json!({"ids": [b]})); + ex(&mut s, "stroke.paste", json!({"ids": [b], "index": 0})); + assert_eq!(node(&s, b).strokes, [blue]); + assert_eq!(node(&s, b).stroke, node(&s, a).stroke, "the weight and alignment come with the paint"); + assert_eq!((node(&s, b).stroke.weight, node(&s, b).stroke.align), (3.0, figcraft_doc::StrokeAlign::Outside)); + // A copied fill doesn't paste as a stroke, and the target keeps its stroke. + ex(&mut s, "fill.copy", json!({"id": a})); + assert!(s.execute("stroke.paste", &json!({"ids": [b]})).is_err()); + assert_eq!(node(&s, b).strokes.len(), 1); + // A layer with no stroke has nothing to copy. + assert!(s.execute("stroke.copy", &json!({"id": b, "index": 1})).is_err()); +} + +#[test] +fn a_copied_effect_replaces_an_effect_row_or_adds_one() { + let mut s = Session::new(); + let a = rect(&mut s); + let b = rect(&mut s); + ex(&mut s, "effect.add", json!({"ids": [a], "effect": {"type": "dropShadow", "radius": 7, "offset": [2, 3]}})); + ex(&mut s, "effect.copy", json!({"id": a, "index": 0})); + let e = node(&s, a).effects[0].clone(); + // Onto b's effect row: it replaces that effect. + ex(&mut s, "effect.add", json!({"ids": [b], "type": "layerBlur"})); + ex(&mut s, "effect.paste", json!({"ids": [b], "index": 0})); + assert_eq!(node(&s, b).effects, vec![e.clone()]); + // With no row: it adds one on top. + ex(&mut s, "effect.paste", json!({"ids": [b]})); + assert_eq!(node(&s, b).effects, [e.clone(), e]); + ex(&mut s, "edit.undo", json!({})); + assert_eq!(node(&s, b).effects.len(), 1); + let Effect { kind: EffectKind::DropShadow(shadow), visible } = node(&s, b).effects[0].clone() else { + panic!("the pasted effect is a drop shadow") + }; + assert_eq!((shadow.radius, shadow.offset, visible), (7.0, (2.0, 3.0), true)); +} diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index ae566fc81..aa9f97b33 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -313,7 +313,10 @@ name = "English" "Copy as PNG" = "Copy as PNG" "Copy as SVG" = "Copy as SVG" "Copy code" = "Copy code" +"Copy effect" = "Copy effect" +"Copy fill" = "Copy fill" "Copy link" = "Copy link" +"Copy stroke" = "Copy stroke" "Copy the {label}" = "Copy the {label}" "Copy {value}" = "Copy {value}" "Corner radius" = "Corner radius" @@ -971,7 +974,10 @@ name = "English" "Pass through" = "Pass through" "Paste a link (https://…)" = "Paste a link (https://…)" "Paste a team library link (a view link)" = "Paste a team library link (a view link)" +"Paste effect" = "Paste effect" +"Paste fill" = "Paste fill" "Paste here" = "Paste here" +"Paste stroke" = "Paste stroke" "Paste to replace" = "Paste to replace" "Pasted design layers; {n} kinds of content were left out" = { one = "Pasted design layers; {n} kind of content was left out", other = "Pasted design layers; {n} kinds of content were left out" } "Pattern" = "Pattern" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 596feda6e..f47ab9650 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -315,7 +315,10 @@ status = "draft — needs native review" "Copy as PNG" = "Copiar como PNG" "Copy as SVG" = "Copiar como SVG" "Copy code" = "Copiar código" +"Copy effect" = "Copiar efecto" +"Copy fill" = "Copiar relleno" "Copy link" = "Copiar enlace" +"Copy stroke" = "Copiar trazo" "Copy the {label}" = "Copiar {label}" "Copy {value}" = "Copiar {value}" "Corner radius" = "Radio de esquina" @@ -972,7 +975,10 @@ status = "draft — needs native review" "Pass through" = "Atravesar" "Paste a link (https://…)" = "Pega un enlace (https://…)" "Paste a team library link (a view link)" = "Pega el enlace de una biblioteca de equipo (de lectura)" +"Paste effect" = "Pegar efecto" +"Paste fill" = "Pegar relleno" "Paste here" = "Pegar aquí" +"Paste stroke" = "Pegar trazo" "Paste to replace" = "Pegar para reemplazar" "Pasted design layers; {n} kinds of content were left out" = { one = "Capas de diseño pegadas; se omitió {n} tipo de contenido", other = "Capas de diseño pegadas; se omitieron {n} tipos de contenido" } "Pattern" = "Patrón" @@ -1894,7 +1900,9 @@ status = "draft — needs native review" "edit.setDefaultProperties" = "Establecer propiedades predeterminadas" "edit.undo" = "Deshacer" "effect.add" = "Añadir efecto" +"effect.copy" = "Copiar efecto" "effect.move" = "Mover efecto" +"effect.paste" = "Pegar efecto" "effect.remove" = "Quitar efecto" "effect.set" = "Establecer efecto" "export.add" = "Añadir ajuste de exportación" @@ -1922,7 +1930,9 @@ status = "draft — needs native review" "file.saveVersion" = "Guardar en el historial de versiones" "file.versionHistory" = "Mostrar historial de versiones" "fill.add" = "Añadir relleno" +"fill.copy" = "Copiar relleno" "fill.move" = "Mover relleno" +"fill.paste" = "Pegar relleno" "fill.pattern" = "Relleno de patrón" "fill.remove" = "Quitar relleno" "fill.set" = "Establecer relleno" @@ -2112,7 +2122,9 @@ status = "draft — needs native review" "shapeBuilder.remove" = "Quitar regiones" "stroke.add" = "Añadir trazo" "stroke.brush" = "Pincel" +"stroke.copy" = "Copiar trazo" "stroke.move" = "Mover trazo" +"stroke.paste" = "Pegar trazo" "stroke.remove" = "Quitar trazo" "stroke.set" = "Establecer trazo" "stroke.widthProfile" = "Perfil de ancho" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index 94c919425..befa96853 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -300,7 +300,10 @@ status = "draft — needs native review" "Copy as PNG" = "复制为 PNG" "Copy as SVG" = "复制为 SVG" "Copy code" = "复制代码" +"Copy effect" = "复制效果" +"Copy fill" = "复制填充" "Copy link" = "复制链接" +"Copy stroke" = "复制描边" "Copy the {label}" = "复制{label}" "Copy {value}" = "复制 {value}" "Corner radius" = "圆角半径" @@ -910,7 +913,10 @@ status = "draft — needs native review" "Pass through" = "穿透" "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; {n} kinds of content were left out" = { other = "已粘贴设计图层;有 {n} 类内容未包含" } "Pattern" = "图案" @@ -1777,7 +1783,9 @@ status = "draft — needs native review" "edit.setDefaultProperties" = "设为默认属性" "edit.undo" = "撤销" "effect.add" = "添加效果" +"effect.copy" = "复制效果" "effect.move" = "移动效果" +"effect.paste" = "粘贴效果" "effect.remove" = "移除效果" "effect.set" = "设置效果" "export.add" = "添加导出设置" @@ -1804,7 +1812,9 @@ status = "draft — needs native review" "file.saveVersion" = "保存到版本历史" "file.versionHistory" = "显示版本历史" "fill.add" = "添加填充" +"fill.copy" = "复制填充" "fill.move" = "移动填充" +"fill.paste" = "粘贴填充" "fill.pattern" = "图案填充" "fill.remove" = "移除填充" "fill.set" = "设置填充" @@ -1989,7 +1999,9 @@ status = "draft — needs native review" "shapeBuilder.remove" = "移除区域" "stroke.add" = "添加描边" "stroke.brush" = "画笔" +"stroke.copy" = "复制描边" "stroke.move" = "移动描边" +"stroke.paste" = "粘贴描边" "stroke.remove" = "移除描边" "stroke.set" = "设置描边" "stroke.widthProfile" = "宽度配置" diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index c93333b38..6dac06a6a 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -187,6 +187,8 @@ mod present_tests; #[cfg(test)] mod present_view_tests; #[cfg(test)] +mod property_menu_tests; +#[cfg(test)] mod proto_editor_tests; #[cfg(test)] mod proto_reorder_tests; diff --git a/crates/ui-egui/src/panel_remove_tests.rs b/crates/ui-egui/src/panel_remove_tests.rs index 3805dca38..bb74ee723 100644 --- a/crates/ui-egui/src/panel_remove_tests.rs +++ b/crates/ui-egui/src/panel_remove_tests.rs @@ -10,6 +10,7 @@ use serde_json::json; use crate::colorpicker::PickerTarget; use crate::layers_drag_tests::Ui; use crate::list_drag::grip_id; +use crate::live_tests::{flat, text_center}; fn id(v: serde_json::Value) -> NodeId { NodeId(v["id"].as_u64().unwrap()) @@ -151,6 +152,24 @@ fn adding_a_fill_or_stroke_opens_the_color_picker() { assert_eq!(u.app.ui.picker, Some(PickerTarget::Paint { fills: false, index: 0, ids: vec![r] })); } +#[test] +fn an_empty_sections_header_adds_its_item_but_a_full_one_only_adds_from_the_plus() { + let mut s = Session::new(); + let r = id(s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 50, "height": 50})).unwrap()); + s.execute("select.set", &json!({"ids": [r]})).unwrap(); + let mut u = Ui::new(s); + // Nothing is stroked yet: clicking anywhere on the Stroke header adds one. + let shapes = flat(&u.frame_output(vec![]).shapes); + click(&mut u, text_center(&shapes, "Stroke")); + assert_eq!(u.app.session.doc().unwrap().node(r).unwrap().strokes.len(), 1); + // It has a stroke now: the header is no longer a button of its own. + u.app.ui.picker = None; + u.frame(vec![]); + let shapes = flat(&u.frame_output(vec![]).shapes); + click(&mut u, text_center(&shapes, "Stroke")); + assert_eq!(u.app.session.doc().unwrap().node(r).unwrap().strokes.len(), 1); +} + #[test] fn adding_a_fill_to_mixed_fills_opens_no_picker() { let mut s = Session::new(); diff --git a/crates/ui-egui/src/property_menu_tests.rs b/crates/ui-egui/src/property_menu_tests.rs new file mode 100644 index 000000000..177c7720f --- /dev/null +++ b/crates/ui-egui/src/property_menu_tests.rs @@ -0,0 +1,101 @@ +//! The Design panel's property row menus: a secondary click on a fill, stroke or effect row +//! copies that one paint or effect, and on another layer's row pastes it there. + +use egui::{Event, Modifiers, PointerButton, Pos2}; +use figcraft_doc::NodeId; +use figcraft_engine::Session; +use serde_json::json; + +use crate::layers_drag_tests::Ui; +use crate::live_tests::{flat, text_center}; + +fn id(v: &serde_json::Value) -> NodeId { + NodeId(v["id"].as_u64().unwrap()) +} + +fn rect(s: &mut Session) -> NodeId { + id(&s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 40, "height": 40})).unwrap()) +} + +/// A click with `button` at `p`, and the frames that follow; what the last frame drew. +fn click(u: &mut Ui, p: Pos2, button: PointerButton) -> Vec { + for _ in 0..5 { + u.frame(vec![Event::PointerMoved(p)]); + } + let mut shapes = Vec::new(); + for pressed in [Some(true), Some(false)].into_iter().chain(std::iter::repeat_n(None, 20)) { + let events = pressed.map(|pressed| Event::PointerButton { pos: p, button, pressed, modifiers: Modifiers::NONE }); + shapes = flat(&u.frame_output(events.into_iter().collect()).shapes); + } + shapes +} + +/// The text a row menu offers, clicked. +fn pick(u: &mut Ui, menu: &[egui::Shape], label: &str) { + click(u, text_center(menu, label), PointerButton::Primary); +} + +#[test] +fn a_fill_row_copies_and_pastes_a_fill() { + let mut s = Session::new(); + let a = rect(&mut s); + let b = rect(&mut s); + s.execute("fill.set", &json!({"ids": [a], "color": "#FF0000"})).unwrap(); + s.execute("fill.set", &json!({"ids": [b], "color": "#0000FF"})).unwrap(); + s.execute("select.set", &json!({"ids": [a]})).unwrap(); + let mut u = Ui::new(s); + let shapes = flat(&u.frame_output(vec![]).shapes); + let menu = click(&mut u, text_center(&shapes, "FF0000"), PointerButton::Secondary); + pick(&mut u, &menu, crate::i18n::tr("Copy fill")); + let copied = u.app.session.clipboard.paint.clone().expect("the fill is on the clipboard"); + assert_eq!(copied.1, u.app.session.doc().unwrap().node(a).unwrap().fills[0]); + // Onto b's fill row: it replaces that fill. + u.app.run("select.set", json!({"ids": [b]})); + let shapes = flat(&u.frame_output(vec![]).shapes); + let menu = click(&mut u, text_center(&shapes, "0000FF"), PointerButton::Secondary); + pick(&mut u, &menu, crate::i18n::tr("Paste fill")); + assert_eq!(u.app.session.doc().unwrap().node(b).unwrap().fills[0].solid_color().unwrap().to_hex(), "FF0000"); +} + +#[test] +fn a_stroke_row_copies_and_pastes_a_stroke() { + let mut s = Session::new(); + let a = rect(&mut s); + let b = rect(&mut s); + s.execute("stroke.add", &json!({"ids": [a], "paint": {"type": "solid", "color": "#FF0000"}})).unwrap(); + s.execute("node.set", &json!({"ids": [a], "props": {"strokeWeight": 3.0}})).unwrap(); + s.execute("stroke.add", &json!({"ids": [b]})).unwrap(); + s.execute("select.set", &json!({"ids": [a]})).unwrap(); + let mut u = Ui::new(s); + let shapes = flat(&u.frame_output(vec![]).shapes); + let menu = click(&mut u, text_center(&shapes, "FF0000"), PointerButton::Secondary); + pick(&mut u, &menu, crate::i18n::tr("Copy stroke")); + u.app.run("select.set", json!({"ids": [b]})); + let shapes = flat(&u.frame_output(vec![]).shapes); + let menu = click(&mut u, text_center(&shapes, "000000"), PointerButton::Secondary); + pick(&mut u, &menu, crate::i18n::tr("Paste stroke")); + let strokes = u.app.session.doc().unwrap().node(b).unwrap().strokes.clone(); + assert_eq!(strokes.len(), 1, "it replaced b's stroke"); + assert_eq!(strokes[0].solid_color().unwrap().to_hex(), "FF0000"); + assert_eq!(u.app.session.doc().unwrap().node(b).unwrap().stroke.weight, 3.0, "the weight came with it"); +} + +#[test] +fn an_effect_row_copies_and_pastes_an_effect() { + let mut s = Session::new(); + let a = rect(&mut s); + let b = rect(&mut s); + s.execute("effect.add", &json!({"ids": [a], "type": "layerBlur"})).unwrap(); + s.execute("effect.add", &json!({"ids": [b], "type": "dropShadow"})).unwrap(); + s.execute("select.set", &json!({"ids": [a]})).unwrap(); + let mut u = Ui::new(s); + let shapes = flat(&u.frame_output(vec![]).shapes); + let menu = click(&mut u, text_center(&shapes, "Layer blur"), PointerButton::Secondary); + pick(&mut u, &menu, crate::i18n::tr("Copy effect")); + u.app.run("select.set", json!({"ids": [b]})); + let shapes = flat(&u.frame_output(vec![]).shapes); + let menu = click(&mut u, text_center(&shapes, "Drop shadow"), PointerButton::Secondary); + pick(&mut u, &menu, crate::i18n::tr("Paste effect")); + let effects = u.app.session.doc().unwrap().node(b).unwrap().effects.clone(); + assert_eq!(effects, u.app.session.doc().unwrap().node(a).unwrap().effects); +} diff --git a/crates/ui-egui/src/right.rs b/crates/ui-egui/src/right.rs index afa884a87..b2babc568 100644 --- a/crates/ui-egui/src/right.rs +++ b/crates/ui-egui/src/right.rs @@ -253,6 +253,15 @@ pub fn context_popup(resp: &egui::Response) -> egui::Popup<'static> { egui::Popup::context_menu(resp).width(MENU_MIN_W).style(menu_style) } +/// A context menu for a property row: a secondary click anywhere over `rect` opens it, even over +/// the row's fields (which would otherwise take the click), like the incumbent's row menus. +fn row_context_menu(ui: &Ui, rect: Rect, id: Id) -> egui::Popup<'static> { + let resp = ui.interact(rect, id, Sense::hover()); + let open = ui.rect_contains_pointer(rect) && ui.input(|i| i.pointer.secondary_clicked()); + let at_pointer = egui::Popup::menu(&resp).width(MENU_MIN_W).style(menu_style).at_pointer_fixed(); + at_pointer.open_memory(open.then_some(egui::SetOpenCommand::Bool(true))) +} + pub fn menu_item(ui: &mut Ui, label: &str, shortcut: &str) -> bool { menu_row(ui, label, shortcut, 0.0, |_, _, _| {}).clicked() } @@ -1098,12 +1107,15 @@ fn paints(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId], fills: let title = if fills { tr("Fill") } else { tr("Stroke") }; let empty = list.as_ref().is_none_or(|l| l.is_empty()); let slot = if fills { StyleSlot::Fill } else { StyleSlot::Stroke }; - if let Some(i) = widgets::section_header( + // The section's right-click menu adds the copied paint (`fill.paste` / `stroke.paste`). + let paste = if fills { tr("Paste fill") } else { tr("Paste stroke") }; + let (clicked, header) = widgets::section_header_resp( ui, title, &[(Icon::Styles, tr("Styles")), (Icon::Plus, if fills { tr("Add fill") } else { tr("Add stroke") })], empty, - ) { + ); + if let Some(i) = clicked { if i == 1 { // The new paint goes on top; open its picker. A mixed selection has no one index to edit. if app.run(if fills { "fill.add" } else { "stroke.add" }, json!({"ids": ids})).is_some() @@ -1115,6 +1127,12 @@ fn paints(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId], fills: style_picker::open(app, ui, &ids, slot); } } + context_popup(&header).show(|ui| { + if app.session.clipboard.paint.as_ref().is_some_and(|(f, _)| *f == fills) && menu_item(ui, paste, "") { + app.run(if fills { "fill.paste" } else { "stroke.paste" }, json!({"ids": ids})); + ui.close(); + } + }); style_picker::chip(app, ui, doc, &ids, slot); match &list { None => widgets::note(ui, tr("Click + to replace mixed content"), t.text_secondary), @@ -1536,7 +1554,7 @@ fn paint_row(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], i: usize, p: &Paint, let t = Tokens::get(ui.ctx()); let ids = ids.to_vec(); let cmd = if fills { "fill.set" } else { "stroke.set" }; - row_rect(ui, 32.0, |ui| { + let r = row_rect(ui, 32.0, |ui| { let w = ui.available_width() - 56.0; let (r, _) = ui.allocate_exact_size(vec2(w, FIELD_H), Sense::hover()); ui.painter().rect_filled(r, CornerRadius::same(5), t.field); @@ -1619,7 +1637,21 @@ fn paint_row(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], i: usize, p: &Paint, None => app.ui.picker = None, } } - }) + }); + let copy = if fills { tr("Copy fill") } else { tr("Copy stroke") }; + let paste = if fills { tr("Paste fill") } else { tr("Paste stroke") }; + let can_paste = app.session.clipboard.paint.as_ref().is_some_and(|(f, _)| *f == fills); + row_context_menu(ui, r, Id::new(("paint_menu", fills, i))).show(|ui| { + if menu_item(ui, copy, "") { + app.run(if fills { "fill.copy" } else { "stroke.copy" }, json!({"ids": ids, "index": i})); + ui.close(); + } + if can_paste && menu_item(ui, paste, "") { + app.run(if fills { "fill.paste" } else { "stroke.paste" }, json!({"ids": ids, "index": i})); + ui.close(); + } + }); + r } /// A paint row's label (also what a drag of it carries): its colour, gradient kind or "Image". @@ -1637,13 +1669,20 @@ fn effects(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { let ids = sel.to_vec(); let list = common(doc, sel, |n| n.effects.clone()); let empty = list.as_ref().is_none_or(|l| l.is_empty()); - if let Some(i) = widgets::section_header(ui, tr("Effects"), &[(Icon::Styles, tr("Styles")), (Icon::Plus, tr("Add effect"))], empty) { + let (clicked, header) = widgets::section_header_resp(ui, tr("Effects"), &[(Icon::Styles, tr("Styles")), (Icon::Plus, tr("Add effect"))], empty); + if let Some(i) = clicked { if i == 1 { app.run("effect.add", json!({"ids": ids, "type": "dropShadow"})); } else { style_picker::open(app, ui, &ids, StyleSlot::Effect); } } + context_popup(&header).show(|ui| { + if app.session.clipboard.effect.is_some() && menu_item(ui, tr("Paste effect"), "") { + app.run("effect.paste", json!({"ids": ids})); + ui.close(); + } + }); style_picker::chip(app, ui, doc, &ids, StyleSlot::Effect); let Some(list) = list else { return }; let mut drag = ListDrag::new(ui, "effects"); @@ -1678,6 +1717,17 @@ fn effects(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { removed = Some(i); } }); + let can_paste = app.session.clipboard.effect.is_some(); + row_context_menu(ui, header, Id::new(("effect_menu", i))).show(|ui| { + if menu_item(ui, tr("Copy effect"), "") { + app.run("effect.copy", json!({"ids": ids, "index": i})); + ui.close(); + } + if can_paste && menu_item(ui, tr("Paste effect"), "") { + app.run("effect.paste", json!({"ids": ids, "index": i})); + ui.close(); + } + }); if open { effect_settings(app, ui, &ids, i, e); } diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index 845dca9df..db83cbe92 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -826,9 +826,19 @@ pub fn disclosure(ui: &mut Ui, label: &str, open: bool) -> bool { /// A section header ("Fill", "Stroke"…) with optional right-side icon buttons; returns which /// button was clicked. `dim` greys the title (empty sections). pub fn section_header(ui: &mut Ui, title: &str, buttons: &[(Icon, &str)], dim: bool) -> Option { + section_header_resp(ui, title, buttons, dim).0 +} + +/// [`section_header`], with the header's own response for a right-click menu. +pub fn section_header_resp(ui: &mut Ui, title: &str, buttons: &[(Icon, &str)], dim: bool) -> (Option, egui::Response) { let t = Tokens::get(ui.ctx()); let w = ui.available_width(); - let (rect, _) = ui.allocate_exact_size(vec2(w, 40.0), Sense::hover()); + let (rect, resp) = ui.allocate_exact_size(vec2(w, 40.0), Sense::click()); + // Only an empty section's header acts as its `+` button; elsewhere it is a right-click target + // alone, so it keeps the normal cursor. + if resp.hovered() && !dim { + ui.ctx().set_cursor_icon(egui::CursorIcon::Default); + } ui.painter().text( pos2(rect.min.x + PAD, rect.center().y), Align2::LEFT_CENTER, @@ -850,7 +860,11 @@ pub fn section_header(ui: &mut Ui, title: &str, buttons: &[(Icon, &str)], dim: b } x -= 24.0; } - out + // An empty section's whole header adds its item, not only its `+` button. + if out.is_none() && dim && resp.clicked() { + out = buttons.iter().position(|(icon, _)| *icon == Icon::Plus); + } + (out, resp) } /// An icon button at `rect` (hover highlight, tooltip); true when clicked. diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index 775a4fcb4..13fda27c1 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -1,8 +1,8 @@ # Parity checklist -> **Generated:** 2026-10-17 by `cargo xtask parity`. Do not edit by hand. +> **Generated:** 2026-10-21 by `cargo xtask parity`. Do not edit by hand. -FigCraft commands registered for the incumbent's main menu and toolbar (561 commands in the engine). +FigCraft commands registered for the incumbent's main menu and toolbar (575 commands in the engine). **212 / 212 menu items (100.0%)** From 12bb6503bd5a4602f6433cf1468c3b903c9bff78 Mon Sep 17 00:00:00 2001 From: Ridzzz0Alam Date: Wed, 21 Oct 2026 17:00:21 +0200 Subject: [PATCH 449/817] M1: readable dropdown rows in the light theme (#972, #955) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Panel dropdowns (prototype device, Preferences, blend modes, versions…) draw their rows with `right::menu_row` on the theme's popup fill, which is white in the light theme. Since 5a4b7c27 those rows painted their labels in `menu_text`, white in both themes because it belongs to the dark menu bar, so the options were invisible until hovered. Rows now take the theme's text (`t.text`, shortcuts `t.text_secondary`) and white only on the green hover highlight, as before that commit. The menu bar, tool flyout and style/variable pickers paint their own rows on `t.menu` and are unchanged. Regression test: a dropdown opened headless in both themes keeps its labels at 4.5:1 and shortcuts at 3:1 against the popup fill. --- crates/ui-egui/src/lib.rs | 2 + crates/ui-egui/src/menu_contrast_tests.rs | 84 +++++++++++++++++++++++ crates/ui-egui/src/right.rs | 6 +- 3 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 crates/ui-egui/src/menu_contrast_tests.rs diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index c93333b38..05bd84cd4 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -151,6 +151,8 @@ mod measure_nudge_tests; #[cfg(test)] mod menu_aim_tests; #[cfg(test)] +mod menu_contrast_tests; +#[cfg(test)] mod menu_input_tests; #[cfg(test)] mod missing_fonts_tests; diff --git a/crates/ui-egui/src/menu_contrast_tests.rs b/crates/ui-egui/src/menu_contrast_tests.rs new file mode 100644 index 000000000..f3a9b1bda --- /dev/null +++ b/crates/ui-egui/src/menu_contrast_tests.rs @@ -0,0 +1,84 @@ +//! Panel dropdowns (the prototype device picker, Preferences, blend modes…) draw on the theme's +//! popup fill, so their rows' text must read on it in both themes (#972): drawn headless. + +use egui::{Color32, Event, Order, PointerButton, Pos2, RawInput, Rect, Shape, pos2, vec2}; + +use crate::right::{menu_check, menu_item, menu_popup}; +use crate::theme::{self, Tokens}; + +fn input(t: &mut f64, events: Vec) -> RawInput { + *t += 1.0 / 60.0; + RawInput { screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0))), time: Some(*t), events, ..Default::default() } +} + +fn press(p: Pos2, pressed: bool) -> Vec { + vec![Event::PointerMoved(p), Event::PointerButton { pos: p, button: PointerButton::Primary, pressed, modifiers: Default::default() }] +} + +fn color(x: Color32) -> figcraft_color::Color { + figcraft_color::Color::new(f32::from(x.r()) / 255.0, f32::from(x.g()) / 255.0, f32::from(x.b()) / 255.0, 1.0) +} + +/// The text painted on the foreground (menu) layers: (text, colour). +fn menu_texts(out: &egui::FullOutput) -> Vec<(String, Color32)> { + fn walk(s: &Shape, out: &mut Vec<(String, Color32)>) { + match s { + Shape::Vec(v) => v.iter().for_each(|s| walk(s, out)), + Shape::Text(t) => out.push((t.galley.text().to_string(), t.fallback_color)), + _ => {} + } + } + let mut texts = Vec::new(); + for c in &out.shapes { + walk(&c.shape, &mut texts); + } + texts +} + +/// Open a dropdown with `tokens` and return its rows' text colours, with the pointer away from them. +fn rows(tokens: Tokens) -> Vec<(String, Color32)> { + let ctx = egui::Context::default(); + theme::apply(&ctx, tokens); + let mut t = 0.0; + let mut frame = |events: Vec| { + let mut out = ctx.run_ui(input(&mut t, events), |ui| { + let (_, resp) = ui.allocate_exact_size(vec2(200.0, 24.0), egui::Sense::click()); + menu_popup(&resp).show(|ui| { + menu_check(ui, true, "iPhone 17 Pro Max", ""); + menu_check(ui, false, "Pixel 9", ""); + menu_item(ui, "Copy", "Cmd+C"); + }); + }); + out.textures_delta.clear(); + out + }; + let at = pos2(12.0, 12.0); + frame(vec![]); + frame(press(at, true)); + frame(press(at, false)); + // Past the popup's fade-in, so the colours are the ones it settles on. + for _ in 0..30 { + frame(vec![Event::PointerMoved(pos2(790.0, 590.0))]); + } + let out = frame(vec![]); + assert!(ctx.memory(|m| m.areas().visible_layer_ids().iter().any(|l| l.order == Order::Foreground)), "the menu opened"); + menu_texts(&out) +} + +#[test] +fn dropdown_rows_read_on_the_popup_in_both_themes() { + for tokens in [Tokens::light(), Tokens::dark()] { + // The popup's own fill (`window_fill`), what the rows are drawn on. + let fill = color(tokens.panel); + let texts = rows(tokens); + let keys = crate::toolbar::pretty_shortcut("Cmd+C"); + // Labels at WCAG AA for text; the dimmer shortcut at least 3:1. + for (label, min) in [("iPhone 17 Pro Max", 4.5), ("Pixel 9", 4.5), ("Copy", 4.5), (keys.as_str(), 3.0)] { + let Some((_, col)) = texts.iter().find(|(s, _)| s.trim() == label || s.ends_with(label)) else { + panic!("{label} painted (dark {}): {texts:?}", tokens.dark) + }; + let ratio = color(*col).contrast(fill); + assert!(ratio >= min, "{label} at {ratio:.2}:1 on the popup (dark {}): {texts:?}", tokens.dark); + } + } +} diff --git a/crates/ui-egui/src/right.rs b/crates/ui-egui/src/right.rs index afa884a87..0f2128988 100644 --- a/crates/ui-egui/src/right.rs +++ b/crates/ui-egui/src/right.rs @@ -286,11 +286,13 @@ pub fn menu_row(ui: &mut Ui, label: &str, shortcut: &str, art_w: f32, art: impl if hovered { ui.painter().rect_filled(r, CornerRadius::same(5), t.menu_hover); } - let col = t.menu_text; + // These menus sit on the theme's popup fill (white in the light theme), not on the dark + // `t.menu` of the menu bar: the theme's text, white only on the green highlight (#972). + let col = if hovered { t.menu_text } else { t.text }; ui.painter().galley(pos2(r.min.x + MENU_PAD, r.center().y - text.size().y / 2.0), text, col); if let Some(k) = keys { let at = pos2(r.max.x - MENU_PAD - k.size().x, r.center().y - k.size().y / 2.0); - ui.painter().galley(at, k, if hovered { t.menu_text } else { t.menu_dim }); + ui.painter().galley(at, k, if hovered { t.menu_text } else { t.text_secondary }); } art(ui.painter(), r, col); resp From f619dca7164a81522718a564443f85469bbb92b1 Mon Sep 17 00:00:00 2001 From: Ridzzz0Alam Date: Wed, 21 Oct 2026 17:41:30 +0200 Subject: [PATCH 450/817] M1: `=` zooms in as `-` zooms out (#973) Plain `-` zoomed out but plain `=` (the `+` key without Shift) did nothing, so a canvas zoomed out with `-` couldn't be zoomed back in the same way; held down, `-` reaches the 2% floor and `=` leaves you there. Ctrl+Shift+= zoomed in while Ctrl+Shift+- did nothing either. Found with a trace of the input on GNOME Wayland: Ctrl+wheel, Ctrl+=, Ctrl+-, Ctrl+Shift+= and `-` all reach the canvas and zoom; `=` and Ctrl+Shift+- arrive too but no binding takes them. `view.zoomIn` gains `=` and `view.zoomOut` gains `Shift+Cmd+-`, pinned in the shortcut parity table; neither key was bound elsewhere and the menus still show Ctrl/Cmd and `+`/`-`. A keymap test checks each zoom-in key has its zoom-out twin on both platforms. --- crates/engine/src/keymap.rs | 6 ++++-- crates/engine/src/keymap_tests.rs | 19 +++++++++++++++++++ crates/engine/src/shortcut_parity_tests.rs | 4 ++-- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/keymap.rs b/crates/engine/src/keymap.rs index c5e3c3346..edc886f1c 100644 --- a/crates/engine/src/keymap.rs +++ b/crates/engine/src/keymap.rs @@ -220,8 +220,10 @@ pub static KEYS: &[Binding] = &[ k(View, "view.prevPage", &["PageUp"]), k(View, "view.nextPage", &["PageDown"]), // Zoom - k(Zoom, "view.zoomIn", &["Cmd+=", "Shift+=", "Shift+Cmd+="]), - k(Zoom, "view.zoomOut", &["Cmd+-", "-", "Shift+-"]), + // Each zoom-in key has its zoom-out twin on the key beside it: `-` alone zooms out, so `=` + // alone (the `+` key without Shift) zooms in (#973). + k(Zoom, "view.zoomIn", &["Cmd+=", "Shift+=", "Shift+Cmd+=", "="]), + k(Zoom, "view.zoomOut", &["Cmd+-", "-", "Shift+-", "Shift+Cmd+-"]), k(Zoom, "view.zoom100", &["Shift+0", "Cmd+0"]), k(Zoom, "view.zoomFit", &["Shift+1"]), k(Zoom, "view.zoomSelection", &["Shift+2"]), diff --git a/crates/engine/src/keymap_tests.rs b/crates/engine/src/keymap_tests.rs index 38775d3b4..f624ecfbb 100644 --- a/crates/engine/src/keymap_tests.rs +++ b/crates/engine/src/keymap_tests.rs @@ -168,6 +168,25 @@ fn display_per_platform() { assert_eq!(primary("polygon.none", mac), None); } +/// Each way of zooming in has its zoom-out twin on the key beside it, as the keys arrive from a US +/// keyboard (#973: `-` alone zoomed out but `=` alone did nothing, so zooming back in was stuck). +#[test] +fn zoom_keys_come_in_pairs() { + let none = Mods::default(); + let shift = mods(true, false, false, false); + let cmd = mods(false, false, true, false); + let shift_cmd = mods(true, false, true, false); + for p in PLATFORMS { + for (zoom_in, zoom_out, m) in [("Equals", "Minus", none), ("Equals", "Minus", cmd), ("Plus", "Minus", shift_cmd), ("Plus", "Minus", shift)] { + assert_eq!(id_for(p, Context::Canvas, zoom_in, m), Some("view.zoomIn"), "{zoom_in} {m:?} on {p:?}"); + assert_eq!(id_for(p, Context::Canvas, zoom_out, m), Some("view.zoomOut"), "{zoom_out} {m:?} on {p:?}"); + } + // The menus still show Cmd/Ctrl and `+`. + assert_eq!(primary("view.zoomIn", p), Some("Cmd+=")); + assert_eq!(primary("view.zoomOut", p), Some("Cmd+-")); + } +} + #[test] fn tool_keys_come_from_the_keymap() { assert_eq!(ToolId::Move.shortcut(), "V"); diff --git a/crates/engine/src/shortcut_parity_tests.rs b/crates/engine/src/shortcut_parity_tests.rs index cf7d5d47b..e690467b6 100644 --- a/crates/engine/src/shortcut_parity_tests.rs +++ b/crates/engine/src/shortcut_parity_tests.rs @@ -162,8 +162,8 @@ static ROWS: &[Row] = &[ doc(Zoom, "Zoom out", &["Cmd+-", "-"], &[], Bound("view.zoomOut"), ""), doc(Zoom, "Zoom to fit", &["Shift+1"], &[], Bound("view.zoomFit"), ""), doc(Zoom, "Zoom to the selection", &["Shift+2"], &[], Bound("view.zoomSelection"), ""), - pin(Zoom, "view.zoomIn", &["Shift+Cmd+="], &[]), - pin(Zoom, "view.zoomOut", &["Shift+-"], &[]), + pin(Zoom, "view.zoomIn", &["Shift+Cmd+=", "="], &[]), + pin(Zoom, "view.zoomOut", &["Shift+-", "Shift+Cmd+-"], &[]), pin(Zoom, "view.zoom100", &["Shift+0", "Cmd+0"], &[]), pin(Zoom, "view.prevFrame", &["Shift+N", "Home"], &[]), pin(Zoom, "view.nextFrame", &["N", "End"], &[]), From 2a3c5b46892a6c930b7947f5bf91d83173826517 Mon Sep 17 00:00:00 2001 From: Nicek Date: Thu, 22 Oct 2026 00:16:44 +0800 Subject: [PATCH 451/817] =?UTF-8?q?feat:=20=E6=94=B9=E8=BF=9B=E5=8F=8C?= =?UTF-8?q?=E5=87=BB=E8=A1=8C=E4=B8=BA=EF=BC=8C=E7=BC=96=E8=BE=91=E5=BD=A2?= =?UTF-8?q?=E7=8A=B6=E7=82=B9=E6=97=B6=E6=9B=B4=E7=AC=A6=E5=90=88=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E4=B9=A0=E6=83=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .trae/rules/git-commit-message.md | 6 ++ .../engine/src/selection_behaviour_tests.rs | 24 +++++ crates/engine/src/tools.rs | 19 +++- crates/ui-egui/src/canvas.rs | 13 ++- .../ui-egui/src/canvas_double_click_tests.rs | 96 +++++++++++++++++++ crates/ui-egui/src/lib.rs | 3 + crates/ui-egui/src/panel_width_tests.rs | 5 +- 7 files changed, 160 insertions(+), 6 deletions(-) create mode 100644 .trae/rules/git-commit-message.md diff --git a/.trae/rules/git-commit-message.md b/.trae/rules/git-commit-message.md new file mode 100644 index 000000000..99f247312 --- /dev/null +++ b/.trae/rules/git-commit-message.md @@ -0,0 +1,6 @@ +--- +alwaysApply: true +scene: git_message +--- + +在此处编写规则,自定义 AI 生成提交信息的风格。 diff --git a/crates/engine/src/selection_behaviour_tests.rs b/crates/engine/src/selection_behaviour_tests.rs index bc961a4a3..a54daf230 100644 --- a/crates/engine/src/selection_behaviour_tests.rs +++ b/crates/engine/src/selection_behaviour_tests.rs @@ -175,6 +175,30 @@ fn double_click_enters_one_level() { assert_eq!(s.ds().unwrap().vector_edit.as_ref().map(|v| v.id), Some(k.r), "double-click on a shape edits its points"); } +#[test] +fn a_double_click_anywhere_on_the_selected_shape_edits_its_points() { + let mut s = Session::new(); + let r = id(&ex(&mut s, "shape.rectangle", json!({"x": 0, "y": 0, "width": 100, "height": 100}))); + ex(&mut s, "node.set", json!({"ids": [r], "props": {"fills": []}})); + ex(&mut s, "stroke.add", json!({"ids": [r]})); + // Selected by its outline; the empty middle is no hit at all (the shape has no fill). + click(&mut s, 0.0, 50.0, NONE); + assert_eq!(s.selection(), vec![r]); + s.pointer(&ev(PointerKind::DoubleClick, 50.0, 50.0, NONE)).unwrap(); + assert_eq!(s.ds().unwrap().vector_edit.as_ref().map(|v| v.id), Some(r), "a double-click on the shape edits its points"); +} + +#[test] +fn a_double_click_on_an_unselected_shape_edits_it_without_a_selecting_click() { + let mut s = Session::new(); + let r = id(&ex(&mut s, "shape.rectangle", json!({"x": 0, "y": 0, "width": 100, "height": 100}))); + ex(&mut s, "select.none", json!({})); + // The press and release of the click that selects it, and the double-click, came in one frame: + // only the double-click reached the tool, with nothing selected. + s.pointer(&ev(PointerKind::DoubleClick, 50.0, 50.0, NONE)).unwrap(); + assert_eq!(s.ds().unwrap().vector_edit.as_ref().map(|v| v.id), Some(r)); +} + #[test] fn marquee_selects_what_it_touches() { let mut s = Session::new(); diff --git a/crates/engine/src/tools.rs b/crates/engine/src/tools.rs index f0115e1f5..187e28d41 100644 --- a/crates/engine/src/tools.rs +++ b/crates/engine/src/tools.rs @@ -1892,7 +1892,17 @@ impl Session { self.tool.overlay.marquee = None; self.cancel_interaction()?; } - let Some(leaf) = self.hit(&doc, page, ev.p(), ev.tol() * 2.0) else { return Ok(()) }; + let hit_here = self.hit(&doc, page, ev.p(), ev.tol() * 2.0); + // A double-click anywhere on the one selected shape edits its points, like Enter: also + // inside a hollow (unfilled) shape, where the hit test finds nothing under the pointer. + if let [id] = sel[..] + && doc.node(id).is_some_and(|n| n.kind.is_shape()) + && doc.world_bounds(id).is_some_and(|b| b.contains(ev.p())) + && hit_here.is_none_or(|h| h == id || doc.is_ancestor(id, h)) + { + return crate::vectoredit::begin_many(self, &[id]); + } + let Some(leaf) = hit_here else { return Ok(()) }; let target = select_target(&doc, leaf, &sel, true); // Text: edit at the click. if doc.node(target).is_some_and(|n| matches!(n.kind, NodeKind::Text(_))) @@ -1910,8 +1920,11 @@ impl Session { return Ok(()); } // Shapes and vectors: enter vector edit mode (every selected shape, the clicked one active). - if doc.node(target).is_some_and(|n| n.kind.is_shape()) && sel.contains(&target) { - let mut ids = crate::vectoredit::enter_targets(&doc, &sel).unwrap_or_default(); + // A shape clicked on its own edits even when the click that selects it and the double-click + // arrived in one frame (a press and a release the canvas took together), so no selection was + // made yet; another layer's shapes are reached one level at a time, as below. + if doc.node(target).is_some_and(|n| n.kind.is_shape()) && (sel.contains(&target) || select_target(&doc, leaf, &sel, false) == target) { + let mut ids = if sel.contains(&target) { crate::vectoredit::enter_targets(&doc, &sel).unwrap_or_default() } else { vec![target] }; ids.retain(|i| *i != target); ids.insert(0, target); return crate::vectoredit::begin_many(self, &ids); diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 46451ae0c..8126e6f3c 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -604,7 +604,11 @@ fn input(app: &mut FigApp, ui: &mut Ui, resp: &egui::Response) -> bool { open_context_menu(app, pos, mods.command); return true; } - if resp.double_clicked() { + // A third quick click is counted as a triple, not a double (a click elsewhere in between still + // leaves its time in the sequence): it means the same here — edit, enter, open — unless a + // vector or text is being edited, where a triple already has its own meaning. + let editing = app.session.ds().is_ok_and(|d| d.vector_edit.is_some() || d.text_edit.is_some()); + if resp.double_clicked() || (resp.triple_clicked() && !editing) { let ev = pointer_event(app, PointerKind::DoubleClick, pos, &mods); if let Err(e) = app.session.pointer(&ev) { app.toast(e.to_string()); @@ -654,6 +658,13 @@ fn input(app: &mut FigApp, ui: &mut Ui, resp: &egui::Response) -> bool { } if let Some(k) = kind { send(app, k, pos, &mods); + // The pointer also let go within this frame (a quick click, or a slow frame): the tools get + // the release too, so the press's gesture ends — a quick click with a shape tool still + // draws and returns to Move, and a double-click right after drawing finds the Move tool. + if matches!(k, PointerKind::Down) && primary_released { + app.canvas.dragging = false; + send(app, PointerKind::Up, pos, &mods); + } } true } diff --git a/crates/ui-egui/src/canvas_double_click_tests.rs b/crates/ui-egui/src/canvas_double_click_tests.rs index 1c89757f4..c47faa741 100644 --- a/crates/ui-egui/src/canvas_double_click_tests.rs +++ b/crates/ui-egui/src/canvas_double_click_tests.rs @@ -2,11 +2,107 @@ //! began is dropped, so the tool is idle once the button is up. use egui::{Event, Modifiers, PointerButton, Pos2}; +use figcraft_doc::NodeId; use figcraft_engine::Session; use serde_json::json; use crate::layers_drag_tests::Ui; +/// One press and release at `p`. +fn click(u: &mut Ui, p: Pos2) { + u.frame(vec![Event::PointerMoved(p)]); + for pressed in [true, false] { + u.frame(vec![Event::PointerButton { pos: p, button: PointerButton::Primary, pressed, modifiers: Modifiers::NONE }]); + } +} + +/// A double-click at `p`. +fn double_click_at(u: &mut Ui, p: Pos2) { + u.frame(vec![Event::PointerMoved(p)]); + for _ in 0..2 { + for pressed in [true, false] { + u.frame(vec![Event::PointerButton { pos: p, button: PointerButton::Primary, pressed, modifiers: Modifiers::NONE }]); + } + } + u.frame(vec![]); +} + +#[test] +fn double_clicking_a_selected_shape_enters_vector_edit_like_enter() { + let mut s = Session::new(); + let r = s.execute("shape.rectangle", &json!({"x": 100, "y": 100, "width": 300, "height": 200})).unwrap(); + let r: NodeId = figcraft_engine::params::id_of(&r["id"]).unwrap(); + s.execute("select.none", &json!({})).unwrap(); + let mut u = Ui::new(s); + let p = u.app.to_screen(250.0, 200.0); + // A click selects it; a double-click right after (three quick clicks) still edits its points. + click(&mut u, p); + assert_eq!(u.app.session.selection(), vec![r]); + double_click_at(&mut u, p); + assert!(u.app.session.ds().unwrap().vector_edit.is_some(), "a double-click enters vector edit"); + // Enter does the same. + u.app.session.execute("vector.edit.end", &json!({})).unwrap(); + u.frame(vec![Event::Key { key: egui::Key::Enter, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::NONE }]); + assert!(u.app.session.ds().unwrap().vector_edit.is_some()); +} + +#[test] +fn a_slower_double_click_still_edits_the_points() { + let mut s = Session::new(); + let r = s.execute("shape.rectangle", &json!({"x": 100, "y": 100, "width": 200, "height": 200})).unwrap(); + let r: NodeId = figcraft_engine::params::id_of(&r["id"]).unwrap(); + s.execute("select.set", &json!({"ids": [r]})).unwrap(); + let mut u = Ui::new(s); + let p = u.app.to_screen(200.0, 200.0); + u.frame(vec![Event::PointerMoved(p)]); + let press = |u: &mut Ui, pressed| { + u.frame(vec![Event::PointerButton { pos: p, button: PointerButton::Primary, pressed, modifiers: Modifiers::NONE }]); + }; + // The first click, then 0.4 s: inside the platform's 0.5 s double-click window, past egui's + // default 0.3 s. + press(&mut u, true); + press(&mut u, false); + for _ in 0..24 { + u.frame(vec![]); + } + press(&mut u, true); + press(&mut u, false); + assert!(u.app.session.ds().unwrap().vector_edit.is_some(), "a double-click the platform takes edits its points"); +} + +#[test] +fn double_clicking_an_unselected_shape_edits_its_points() { + let mut s = Session::new(); + let r = s.execute("shape.rectangle", &json!({"x": 100, "y": 100, "width": 300, "height": 200})).unwrap(); + let r: NodeId = figcraft_engine::params::id_of(&r["id"]).unwrap(); + s.execute("select.none", &json!({})).unwrap(); + let mut u = Ui::new(s); + let p = u.app.to_screen(250.0, 200.0); + // Nothing is selected: the double-click selects the shape and edits its points, like Figma. + double_click_at(&mut u, p); + let ve = u.app.session.ds().unwrap().vector_edit.clone(); + assert_eq!(ve.map(|v| v.id), Some(r)); +} + +#[test] +fn a_click_that_leaves_vector_edit_does_not_keep_the_next_double_click_out() { + let mut s = Session::new(); + let r = s.execute("shape.rectangle", &json!({"x": 100, "y": 100, "width": 300, "height": 200})).unwrap(); + let r: NodeId = figcraft_engine::params::id_of(&r["id"]).unwrap(); + s.execute("select.set", &json!({"ids": [r]})).unwrap(); + let mut u = Ui::new(s); + let shape = u.app.to_screen(250.0, 200.0); + let empty = Pos2::new(u.app.canvas.rect.left() + 30.0, u.app.canvas.rect.bottom() - 30.0); + double_click_at(&mut u, shape); + assert!(u.app.session.ds().unwrap().vector_edit.is_some()); + // One click on empty canvas leaves the edit mode. + click(&mut u, empty); + assert!(u.app.session.ds().unwrap().vector_edit.is_none(), "a click outside leaves vector edit"); + // The next double-click edits the shape again. + double_click_at(&mut u, shape); + assert!(u.app.session.ds().unwrap().vector_edit.is_some(), "a double-click edits it again"); +} + /// Two presses and releases at the bottom left of the canvas, with `modifiers` held. fn double_click(u: &mut Ui, modifiers: Modifiers) { let pos = Pos2::new(u.app.canvas.rect.left() + 30.0, u.app.canvas.rect.bottom() - 30.0); diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 6dac06a6a..e24bbf244 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1374,6 +1374,9 @@ impl FigApp { // Cmd/Ctrl+= / - / 0 zoom the canvas (view.zoomIn, view.zoomOut, view.zoom100): egui's // own keyboard zoom would scale the whole interface on the same keys. ctx.options_mut(|o| o.zoom_with_keyboard = false); + // A double-click's window is the platform's (0.5 s, Windows' default), not egui's + // stricter 0.3 s: a double-click the OS takes must enter a shape's points too. + ctx.memory_mut(|m| m.options.input_options.max_double_click_delay = 0.5); theme::install_fonts(ctx, false, 0); self.fonts_installed = true; } else if figcraft_text::system_fonts_scanned() { diff --git a/crates/ui-egui/src/panel_width_tests.rs b/crates/ui-egui/src/panel_width_tests.rs index a5a84d04e..8c61a3b18 100644 --- a/crates/ui-egui/src/panel_width_tests.rs +++ b/crates/ui-egui/src/panel_width_tests.rs @@ -51,8 +51,9 @@ fn drag(u: &mut Ui, from: Pos2, to: Pos2) { } fn double_click(u: &mut Ui, p: Pos2) { - // Well after any earlier click (a third quick click isn't a double-click). - for _ in 0..40 { + // Well after any earlier click (a third quick click, within twice the platform's 0.5 s + // double-click window, isn't a double-click). + for _ in 0..70 { u.frame(vec![]); } for _ in 0..2 { From e211bf5476c44512bf3238e3698c085267f5da9b Mon Sep 17 00:00:00 2001 From: Ridzzz0Alam Date: Wed, 21 Oct 2026 18:22:16 +0200 Subject: [PATCH 452/817] M1: large .fig files keep their layers and their library links (#981) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A design-system .fig file (54 pages) stopped at 244 248 layers, the rest of its pages skipped, and most of its instances came in as frames "of components that aren't in the file", with the cap note shown twice. - The layer budget follows the compressed canvas at 8 bytes a layer, not 32: design systems are mostly instances, which pack tightly. Files under about 1.6 MB keep the 200 000 floor and the 2 million ceiling stays (measured on synthetic files: about 5.4 KB and 19 µs a layer). - The library copies the pages use (the file's hidden internal canvas) are mapped before the pages: at the cap the pages' last layers are skipped, not the mains their instances link to. The REST stage keeps building pages first (its ids are first-wins) and allows for the wrapper frame of each library copy, the one layer the mapper doesn't count; that layer tripped the REST stage's own cap and repeated the note. - Instances and swap defaults whose main is in the file but past the cap say so instead of "aren't in the file" (en and es catalogs). - The .fig import gives a note the mapper already gave only once. Tests in fig/layer_cap_tests.rs: the budget for a #981-sized canvas, library mains ahead of the pages at the cap, the note for a capped local main, and a whole 210 000-layer file with one cap note and its library links kept. All four fail on the previous code. --- crates/format/src/fig/layer_cap_tests.rs | 117 +++++++++++++++++++++++ crates/format/src/fig/map.rs | 32 ++++++- crates/format/src/fig/mod.rs | 17 +++- crates/format/src/rest/mod.rs | 33 +++++-- crates/ui-egui/locales/en.toml | 2 + crates/ui-egui/locales/es.toml | 2 + 6 files changed, 188 insertions(+), 15 deletions(-) create mode 100644 crates/format/src/fig/layer_cap_tests.rs diff --git a/crates/format/src/fig/layer_cap_tests.rs b/crates/format/src/fig/layer_cap_tests.rs new file mode 100644 index 000000000..6eeb15f4e --- /dev/null +++ b/crates/format/src/fig/layer_cap_tests.rs @@ -0,0 +1,117 @@ +//! Large `.fig` files at the layer cap (#981): the budget a design-system file gets, the library +//! copies its instances need kept ahead of the pages, honest notes for what the cap kept out, and +//! one note for the cap itself. + +use figcraft_doc::{Document, NodeKind}; + +use super::kiwi::{Kv, Schema}; +use super::*; + +type Fields = Vec<(&'static str, Kv<'static>)>; + +fn o(fields: Fields) -> Kv<'static> { + Kv::Object(fields) +} + +fn g(id: u64) -> Kv<'static> { + o(vec![("sessionID", Kv::Uint(1)), ("localID", Kv::Uint(id))]) +} + +fn xy(x: f64, y: f64) -> Kv<'static> { + o(vec![("x", Kv::Float(x as f32)), ("y", Kv::Float(y as f32))]) +} + +/// A layer under `parent`; siblings come in id order. +fn node(id: u64, parent: Option, ty: &'static str, name: &str, more: Fields) -> Kv<'static> { + let mut fields = vec![("guid", g(id)), ("phase", Kv::Enum("CREATED")), ("type", Kv::Enum(ty)), ("name", Kv::Str(name.into()))]; + if let Some(parent) = parent { + fields.push(("parentIndex", o(vec![("guid", g(parent)), ("position", Kv::Str(format!("{id:08}")))]))); + } + fields.extend(more); + o(fields) +} + +fn instance(id: u64, page: u64, main: u64) -> Kv<'static> { + node(id, Some(page), "INSTANCE", "Instance", vec![("symbolData", o(vec![("symbolID", g(main))]))]) +} + +/// A main `id` of `layers` rectangles under `parent`. +fn main(id: u64, parent: u64, name: &str, layers: u64) -> Vec> { + let mut out = vec![node(id, Some(parent), "SYMBOL", name, vec![("size", xy(10.0, 10.0))])]; + out.extend((1..=layers).map(|i| node(id * 10_000 + i, Some(id), "RECTANGLE", "R", vec![("size", xy(1.0, 1.0))]))); + out +} + +/// A page (2) of `count` instances of a main kept on the file's hidden library canvas (3), as a +/// design system's file carries the library components it uses. +fn library_message(count: u64, main_layers: u64) -> Kv<'static> { + let mut nodes = vec![ + node(1, None, "DOCUMENT", "Document", vec![]), + node(2, Some(1), "CANVAS", "Screens", vec![]), + node(3, Some(1), "CANVAS", "Internal", vec![("internalOnly", Kv::Bool(true))]), + ]; + nodes.extend(main(20, 3, "Library main", main_layers)); + nodes.extend((0..count).map(|i| instance(1_000 + i, 2, 20))); + o(vec![("nodeChanges", Kv::Array(nodes))]) +} + +/// The `.fig` import's two stages at layer cap `cap`. +fn import_at(msg: &Kv, cap: usize) -> (Document, Vec) { + let (json, mut warnings, networks) = map::to_rest(msg, "Capped", cap); + let (doc, more) = crate::rest::import_with_networks(&json, &|_: &str| None, networks, cap).unwrap(); + warnings.extend(more); + (doc, warnings) +} + +fn linked_to(doc: &Document, main_name: &str) -> usize { + doc.nodes().filter(|n| matches!(n.kind, NodeKind::Instance { component, .. } if doc.node(component).is_some_and(|c| c.name == main_name))).count() +} + +#[test] +fn a_design_system_sized_canvas_gets_room() { + // The file in #981 stopped at 244 248 layers: a 7.8 MB canvas at 32 bytes a layer. + let reported = 244_248 * 32; + assert!(layer_budget(reported) >= 4 * 244_248, "{}", layer_budget(reported)); + // Small files still can't claim more than the REST import's cap, nor any file the ceiling. + assert_eq!(layer_budget(1 << 20), crate::rest::MAX_NODES); + assert_eq!(layer_budget(usize::MAX), MAX_FIG_NODES); +} + +#[test] +fn library_mains_come_before_the_pages_at_the_cap() { + // 40 instances of an 11-layer library main on a page, with room for 100 layers: mapped after + // the pages, the main found no room and every instance became a frame of "a component that + // isn't in the file". + let (doc, warnings) = import_at(&library_message(40, 10), 100); + assert!(warnings.iter().any(|w| w.contains("more than 100 layers")), "{warnings:?}"); + assert!(!warnings.iter().any(|w| w.contains("aren't in the file")), "{warnings:?}"); + let linked = linked_to(&doc, "Library main"); + assert!(linked >= 5, "{linked} instances linked to the library main: {warnings:?}"); + assert!(doc.nodes().any(|n| n.name == "Library main" && doc.is_remote(n.id))); +} + +#[test] +fn instances_of_a_main_the_cap_kept_out_say_so() { + // The page's instances come before their main: at the cap, the main is skipped though the + // file has it. + let mut nodes = vec![node(1, None, "DOCUMENT", "Document", vec![]), node(2, Some(1), "CANVAS", "Page", vec![])]; + nodes.extend((0..20).map(|i| instance(100 + i, 2, 900))); + nodes.extend(main(900, 2, "Local main", 10)); + let (doc, warnings) = import_at(&o(vec![("nodeChanges", Kv::Array(nodes))]), 60); + assert!(warnings.iter().any(|w| w.starts_with("instances whose component was past the layer limit were imported as frames")), "{warnings:?}"); + assert!(!warnings.iter().any(|w| w.contains("aren't in the file")), "{warnings:?}"); + assert!(!doc.nodes().any(|n| n.name == "Local main")); +} + +#[test] +fn a_whole_file_past_the_cap_keeps_its_library_links_and_says_so_once() { + // A 1 001-layer library main used 210 times: about 210 000 layers in a file far too small to + // lift the cap above the REST import's 200 000. + let file = super::tests::canvas(&Schema::parse(export::SCHEMA).unwrap(), &library_message(210, 1_000)); + assert_eq!(layer_budget(file.len()), crate::rest::MAX_NODES); + let (doc, warnings) = import(&file, "Design system.fig").unwrap(); + let cap: Vec<_> = warnings.iter().filter(|w| w.contains("layers; the rest were skipped")).collect(); + assert_eq!(cap.len(), 1, "{warnings:?}"); + assert!(!warnings.iter().any(|w| w.contains("aren't in the file")), "{warnings:?}"); + assert!(linked_to(&doc, "Library main") >= 190, "{warnings:?}"); +} diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 8e4671511..7eb974daf 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -42,6 +42,14 @@ pub(super) fn to_rest(msg: &Kv, name: &str, max_nodes: usize) -> (Value, Vec= m.max_nodes { + let capped: Vec = m.instance_mains.difference(&m.mapped_mains).map(|id| json!(id)).collect(); + if !capped.is_empty() { + out[crate::rest::FIG_CAPPED_MAINS_FIELD] = Value::Array(capped); + } + } if !m.styles.is_empty() { out["styles"] = Value::Object(std::mem::take(&mut m.styles)); } @@ -389,6 +397,10 @@ struct Mapper<'a> { library_scan_count: usize, warnings: Vec, count: usize, + /// The mains in the file that instances name, and the mains mapped as layers: the difference + /// is what the layer cap kept out. + instance_mains: BTreeSet, + mapped_mains: BTreeSet, /// Most layers produced or scanned, instance expansion included; the one place the cap comes /// from (see [`super::layer_budget`]). max_nodes: usize, @@ -466,6 +478,8 @@ impl<'a> Mapper<'a> { library_scan_count: 0, warnings: Vec::new(), count: 0, + instance_mains: BTreeSet::new(), + mapped_mains: BTreeSet::new(), max_nodes, networks: Vec::new(), network_ids: HashMap::new(), @@ -556,9 +570,8 @@ impl<'a> Mapper<'a> { Some(d) => self.children(d), None => self.nodes.iter().filter(|(_, n)| n.get("type").and_then(Kv::str) == Some("CANVAS")).map(|(id, _)| id.clone()).collect(), }; - let mut out = Vec::new(); let mut internal = Vec::new(); - let mut visible_pages = Vec::new(); + let mut visible = Vec::new(); for p in pages { let Some(&n) = self.nodes.get(&p) else { continue }; if n.get("type").and_then(Kv::str) != Some("CANVAS") { @@ -568,17 +581,20 @@ impl<'a> Mapper<'a> { // The hidden page that holds styles, variables and library copies. if n.get("internalOnly").and_then(Kv::bool) == Some(true) { internal.push((p, n)); - continue; + } else { + visible.push((p, n)); } - visible_pages.push(p.clone()); - out.push(self.page(&p, n)); } + // The library copies the pages use come first: in a file past the layer cap, the pages' + // last layers are skipped rather than the mains every instance of them needs (#981). + let visible_pages: Vec = visible.iter().map(|(p, _)| p.clone()).collect(); let required_mains = self.referenced_component_mains(&visible_pages); for (id, canvas) in internal { if let Some(context) = self.library_context(&id, canvas, &required_mains) { self.library_contexts.push(context); } } + let out: Vec = visible.into_iter().map(|(p, n)| self.page(&p, n)).collect(); if out.is_empty() { self.warn("the file has no pages"); } @@ -879,6 +895,9 @@ impl<'a> Mapper<'a> { self.warn("connector layers import as static frame/vector snapshots with labels when present; live endpoint bindings are not retained"); } self.count += 1; + if own == "SYMBOL" && inst.is_none() { + self.mapped_mains.insert(id.to_string()); + } let mut o = Obj::new(); o.insert("id".into(), json!(rest_id)); // Private provenance for the .fig importer; ordinary REST import ignores it. @@ -1994,6 +2013,9 @@ impl<'a> Mapper<'a> { self.warn("instances of components that aren't in the file show no layers"); return None; } + if !self.instance_mains.contains(&sym) { + self.instance_mains.insert(sym.clone()); + } if outer.is_some_and(|i| i.symbols.contains(&sym)) { return None; } diff --git a/crates/format/src/fig/mod.rs b/crates/format/src/fig/mod.rs index 4c103d088..c04043ae0 100644 --- a/crates/format/src/fig/mod.rs +++ b/crates/format/src/fig/mod.rs @@ -23,6 +23,8 @@ mod export_tests; #[cfg(test)] mod interop_tests; pub mod kiwi; +#[cfg(test)] +mod layer_cap_tests; mod map; mod network; #[cfg(test)] @@ -64,8 +66,11 @@ const MAX_CHUNKS: usize = 16; /// compressed canvas, at least the REST import's cap and at most [`MAX_FIG_NODES`]. Instances /// expand into a layer per layer of their component, and chunks inflate up to [`MAX_CHUNK`], so the /// budget follows what the file takes, not what it unpacks to: a small file can't claim a large -/// count, however it's built; a large one gets room. -const PACKED_BYTES_PER_LAYER: usize = 32; +/// count, however it's built; a large one gets room. Design systems are mostly instances, which +/// pack tightly: a 7.8 MB canvas stopped at 244 248 layers at 32 bytes a layer (#981). At 8, files +/// under about 1.6 MB keep the floor and the ceiling comes at a 16 MB canvas (about 11 GB and 40 s +/// to import 2 million synthetic layers; memory grows with the count, about 5.4 KB a layer). +const PACKED_BYTES_PER_LAYER: usize = 8; const MAX_FIG_NODES: usize = 2_000_000; /// Most layers imported from a `.fig` file whose compressed canvas is `packed` bytes. @@ -108,7 +113,13 @@ pub fn import(bytes: &[u8], name: &str) -> Result<(Document, Vec), Forma drop(msg); let images = |r: &str| archive.image(r).or_else(|| embedded.get(r).cloned()); let (doc, more) = crate::rest::import_with_networks(&json, &images, networks, max_nodes)?; - warnings.extend(more.into_iter().filter_map(map::adapt_warning)); + // Both stages stop at the same cap and say so in the same words: one note (#981). + for w in more.into_iter().filter_map(map::adapt_warning) { + let base = w.rsplit_once(" (×").map_or(w.as_str(), |(b, _)| b); + if !warnings.iter().any(|seen| seen == base) { + warnings.push(w); + } + } Ok((doc, warnings)) } diff --git a/crates/format/src/rest/mod.rs b/crates/format/src/rest/mod.rs index 78279e915..40c091c69 100644 --- a/crates/format/src/rest/mod.rs +++ b/crates/format/src/rest/mod.rs @@ -65,6 +65,8 @@ const MAX_DEPTH: usize = 256; pub(crate) const FIG_SOURCE_FIELD: &str = "_figSource"; /// Hidden .fig library context; accepted only by the `.fig` import ([`import_with_networks`]). pub(crate) const FIG_LIBRARY_CONTEXTS_FIELD: &str = "_figLibraryContexts"; +/// Ids of mains in a `.fig` file that its layer cap kept out; read only by the `.fig` import. +pub(crate) const FIG_CAPPED_MAINS_FIELD: &str = "_figCappedMains"; /// Longest SVG path string read from one geometry entry. const MAX_PATH_BYTES: usize = 4 << 20; /// Most path elements in one vector. @@ -215,6 +217,14 @@ fn import_parts( cx.style_definitions(v); cx.networks = networks; cx.max_nodes = max_nodes; + // The `.fig` mapper already kept the layers, library copies included, within the cap; each + // library copy's wrapper frame is the one layer here it doesn't count (#981). + let contexts = if fig_sources { v.get(FIG_LIBRARY_CONTEXTS_FIELD).and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default() } else { &[] }; + if fig_sources { + cx.capped_mains = + v.get(FIG_CAPPED_MAINS_FIELD).and_then(Value::as_array).into_iter().flatten().filter_map(Value::as_str).map(str::to_owned).collect(); + cx.max_nodes = max_nodes.saturating_add(contexts.len()); + } for e in entries { let Some(root) = e.get("document") else { continue }; match text(root, "type") { @@ -236,11 +246,9 @@ fn import_parts( None => cx.warn("entries without a node type were skipped"), } } - if fig_sources { - for context in v.get(FIG_LIBRARY_CONTEXTS_FIELD).and_then(Value::as_array).into_iter().flatten() { - let store = cx.doc.ensure_library_store(); - cx.build(context, store, Space::default(), None, 0, false); - } + for context in contexts { + let store = cx.doc.ensure_library_store(); + cx.build(context, store, Space::default(), None, 0, false); } // Drop the empty page the new document started with once real pages exist. if let Some(p) = blank @@ -404,6 +412,8 @@ pub(crate) struct Ctx<'a> { networks: Vec>, /// Most layers imported: [`MAX_NODES`], or the `.fig` import's own cap. max_nodes: usize, + /// Mains the `.fig` file has but its layer cap kept out ([`FIG_CAPPED_MAINS_FIELD`]). + capped_mains: BTreeSet, } impl<'a> Ctx<'a> { @@ -432,6 +442,7 @@ impl<'a> Ctx<'a> { var_modes: BTreeMap::new(), networks: Vec::new(), max_nodes: MAX_NODES, + capped_mains: BTreeSet::new(), } } @@ -998,7 +1009,11 @@ impl<'a> Ctx<'a> { fn resolve_swap_defaults(&mut self) { for (owner, name, rest_id) in std::mem::take(&mut self.swap_defaults) { let Some(c) = self.component(&rest_id) else { - self.warn("instance swap properties whose default component isn't in the file were skipped"); + if self.capped_mains.contains(&rest_id) { + self.warn("instance swap properties whose default component was past the layer limit were skipped"); + } else { + self.warn("instance swap properties whose default component isn't in the file were skipped"); + } continue; }; let def = PropDef::InstanceSwap { default: c, preferred: Vec::new() }; @@ -1017,7 +1032,11 @@ impl<'a> Ctx<'a> { let frames: BTreeSet = self.instances.iter().map(|(i, _)| *i).collect(); let mut links: Vec<(NodeId, NodeId, &'a Value)> = Vec::new(); for (inst, j) in std::mem::take(&mut self.instances) { - match text(j, "componentId").and_then(|r| self.component(r)) { + let main = text(j, "componentId"); + match main.and_then(|r| self.component(r)) { + None if main.is_some_and(|r| self.capped_mains.contains(r)) => { + self.warn("instances whose component was past the layer limit were imported as frames"); + } None => self.warn("instances of components that aren't in the file were imported as frames"), Some(c) if self.doc.is_ancestor(c, inst) => self.warn("instances inside their own main component were imported as frames"), Some(c) => links.push((inst, c, j)), diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index ae566fc81..32045d4ef 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -1595,10 +1595,12 @@ name = "English" "image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "image filters are ambiguous because both filter containers are present; filter conversion was skipped" "image filters use FigCraft's approximate renderer" = "image filters use FigCraft's approximate renderer" "instance swap properties whose default component isn't in the file were skipped" = "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" = "instance swap properties whose default component was past the layer limit were skipped" "instances inside their own main component were imported as frames" = "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 show no layers" "instances of components that aren't in the file were imported as frames" = "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 that would nest a component inside itself were imported as frames" +"instances whose component was past the layer limit 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" = "instances without a main component were imported as empty frames" "invalid internal .fig text path data was ignored" = "invalid internal .fig text path data was ignored" "invalid or oversized vector networks import as outlines" = "invalid or oversized vector networks import as outlines" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 596feda6e..c6e77866f 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -1596,10 +1596,12 @@ status = "draft — needs native review" "image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "los filtros de imagen son ambiguos porque están los dos contenedores de filtros; se omitió la conversión de filtros" "image filters use FigCraft's approximate renderer" = "los filtros de imagen usan el renderizado aproximado de FigCraft" "instance swap properties whose default component isn't in the file were skipped" = "se omitieron las propiedades de intercambio de instancia cuyo componente predeterminado no está en el archivo" +"instance swap properties whose default component was past the layer limit were skipped" = "se omitieron las propiedades de intercambio de instancia cuyo componente predeterminado quedó fuera del límite de capas" "instances inside their own main component were imported as frames" = "las instancias dentro de su propio componente principal se importaron como marcos" "instances of components that aren't in the file show no layers" = "las instancias de componentes que no están en el archivo no muestran capas" "instances of components that aren't in the file were imported as frames" = "las instancias de componentes que no están en el archivo se importaron como marcos" "instances that would nest a component inside itself were imported as frames" = "las instancias que anidarían un componente dentro de sí mismo se importaron como marcos" +"instances whose component was past the layer limit were imported as frames" = "las instancias cuyo componente quedó fuera del límite de capas se importaron como marcos" "instances without a main component were imported as empty frames" = "las instancias sin componente principal se importaron como marcos vacíos" "invalid internal .fig text path data was ignored" = "se ignoraron datos internos no válidos de texto en trazado del .fig" "invalid or oversized vector networks import as outlines" = "las redes vectoriales no válidas o demasiado grandes se importan como contornos" From 42bdfcce3494fe78a5a21e986a5f0af37f42f3e4 Mon Sep 17 00:00:00 2001 From: midasdf <205497066+midasdf@users.noreply.github.com> Date: Thu, 22 Oct 2026 01:37:55 +0900 Subject: [PATCH 453/817] M4: CJK kinsoku completed to JIS X 4051 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JIS X 4051's line-start (行頭禁則) and line-end (行末禁則) sets were mostly there — closing punctuation and brackets, small kana, the prolonged sound mark, iteration marks and opening brackets already never start or end a line — but a few categories fell through: - the halfwidth small kana ァ–ッ (U+FF67..U+FF6F) and the halfwidth voicing marks ゙゚ (U+FF9E/U+FF9F) were not line-start prohibited, so a wrapped line could begin with them; - the spacing (semi-)voiced sound marks ゛゜ (U+309B/U+309C) and the kana iteration marks 〱〲〳〴〵 (U+3031..U+3035) likewise; - the halfwidth parentheses ⦅⦆ were missing from the line-end/line-start sets. Add them (ranges in `class`, the two parentheses in the OPEN and CLOSE strings), and pin every JIS category in the behaviour suite: the existing 22 cases stay and 9 join them (halfwidth small kana and small tsu, halfwidth and spacing voicing marks, kana and vertical kana iteration marks, both halfwidth parentheses), plus a wrap case where a halfwidth small kana moves down with its base (キャ) and a case showing a manual newline may still start a line with a prohibited character (禁則 is for automatic wrapping only). `break_opportunities` fails on the old sets at the first new halfwidth small-kana case. Latin wrapping, ideograph breaks and the rest of the behaviour suite are unchanged, and the headline numbers stay as they are. Verified: cargo test -p figcraft-text --lib 92 passed; cargo clippy -p figcraft-text --all-targets -- -D warnings clean; rustfmt clean on the touched files. Docs: docs/target-app-parity.md text behaviour row and ROADMAP progress log, revision history and header. --- ROADMAP.md | 4 +++- crates/text/src/behaviour_tests.rs | 26 ++++++++++++++++++++++++-- crates/text/src/breaks.rs | 15 ++++++++------- docs/target-app-parity.md | 7 ++++--- 4 files changed, 39 insertions(+), 13 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index f43cd015b..9ac090df7 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-22 · **Change:** minor (CJK line breaking: JIS X 4051's line-start and line-end sets completed with the halfwidth small kana, the halfwidth and spacing (semi-)voiced sound marks, the iteration marks 〱–〵 and the halfwidth parentheses, with behaviour cases for each; previous: minor, community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -131,6 +131,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). ## Progress log +- **2026-10-22** · CJK line breaking completes JIS X 4051's kinsoku (M4): the line-start set now also has the halfwidth small kana ァ–ッ and small tsu, the halfwidth (semi-)voiced sound marks ゙゚, the spacing (semi-)voiced sound marks ゛゜, the kana iteration marks 〱–〵 and the halfwidth closing parenthesis ⦆; the line-end set has the halfwidth opening parenthesis ⦅. Text layers, auto layout and the canvas otherwise wrap Japanese as before: ideographs break anywhere and the behaviour suite pins every category plus that a manual newline may still start a line with a prohibited character. Numbers unchanged. - **2026-10-17** · Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. - **2026-10-17** · Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. - **2026-10-17** · Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. @@ -316,6 +317,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-22 | minor | CJK line breaking: JIS X 4051 line-start/line-end sets completed (halfwidth small kana, halfwidth and spacing voiced sound marks, iteration marks 〱–〵, halfwidth parentheses) with behaviour cases; numbers unchanged | | 2026-10-20 | minor | A document dropped on the canvas opens (#916): a `.figcraft`, `.fig` or file JSON dropped on the canvas opens as a file of its own, as on the home screen, in the browser too; it used to add its pages to the file in front. Images and SVG still import at the drop point, File ▸ Import still adds pages, and dragging only documents over the canvas says "Drop to open" (not in the browser, which names no file until the drop). Numbers unchanged | | 2026-10-20 | minor | Duplicating a main component makes an instance (#892): Duplicate and Alt-drag copied a main component as a second main; within its file the copy is now an instance of it, as Copy then Paste already was (a variant duplicated in its set stays a variant). Numbers unchanged. | | 2026-10-20 | minor | Readable disabled and selected text (#890): the dim text colour (disabled buttons, placeholders, hints) is at least 3:1 against panels, fields and selected rows in both themes (it was 2.1:1 in the light theme), a disabled button is grey with that text instead of fading to 40%, and selected text (renaming a page or layer, any text box) takes the theme's readable green on the highlight (1.4:1 in the dark theme before, now 4.2:1 or more); checked with the colour contrast helper (`theme::tests`). Numbers unchanged | diff --git a/crates/text/src/behaviour_tests.rs b/crates/text/src/behaviour_tests.rs index b3cb4884d..3312e69eb 100644 --- a/crates/text/src/behaviour_tests.rs +++ b/crates/text/src/behaviour_tests.rs @@ -268,7 +268,7 @@ fn hangul_comes_from_a_korean_font_when_one_is_installed() { #[test] fn break_opportunities() { // (before, after, may break between, derivation) - let cases: [(char, char, bool, &str); 22] = [ + let cases: [(char, char, bool, &str); 32] = [ ('a', 'b', false, "inside a Latin word: never"), (' ', 'b', true, "after a space"), ('a', ' ', false, "before a space: the space hangs at the line's end"), @@ -291,6 +291,16 @@ fn break_opportunities() { ('。', '日', true, "after a full stop"), ('日', '「', true, "before an opening bracket"), ('\u{3000}', '日', true, "after an ideographic space"), + ('キ', 'ャ', false, "kinsoku: nor a halfwidth small kana"), + ('本', 'ッ', false, "kinsoku: nor the halfwidth small tsu"), + ('キ', '゙', false, "kinsoku: nor the halfwidth voiced sound mark"), + ('キ', '゚', false, "kinsoku: nor the halfwidth semi-voiced sound mark"), + ('本', '゛', false, "kinsoku: nor the spacing voiced sound mark"), + ('本', '゜', false, "kinsoku: nor the spacing semi-voiced sound mark"), + ('本', '〱', false, "kinsoku: nor a kana iteration mark"), + ('本', '〳', false, "kinsoku: nor a vertical kana repeat mark"), + ('本', '⦆', false, "kinsoku: nor a halfwidth closing parenthesis"), + ('⦅', '日', false, "kinsoku: a halfwidth opening parenthesis never ends a line"), ]; for (a, b, want, why) in cases { assert_eq!(break_between(a, b), want, "{a}{b}: {why}"); @@ -304,13 +314,14 @@ fn cjk_lines_wrap_between_ideographs_with_kinsoku() { } // Box width cut right after char `fit` (chars 0..fit fit, the next one doesn't): the first line // and how the second starts. (text, fit, first line, second line starts with, derivation) - let cases: [(&str, usize, &str, &str, &str); 6] = [ + let cases: [(&str, usize, &str, &str, &str); 7] = [ ("一二三四五六", 3, "一二三", "四", "ideographs break anywhere"), ("一二三。四五", 3, "一二", "三。", "。 can't start a line: 三 moves down with it"), ("一二「三」", 3, "一二", "「三", "「 can't end a line: it moves down"), ("日本語abc def", 5, "日本語", "abc", "no break inside a Latin word: before it"), ("abc 日本語です", 6, "abc 日本", "語", "a space or an ideograph is a break"), ("한국어 텍스트입니다", 5, "한국어 텍", "스", "Korean breaks between syllables (documentation silent)"), + ("一二キャッド", 3, "一二", "キャ", "a halfwidth small kana stays off the line start: キ moves down with it"), ]; for (s, fit, first, second, why) in cases { let t = text(s, TextAutoResize::Height); @@ -324,6 +335,17 @@ fn cjk_lines_wrap_between_ideographs_with_kinsoku() { } } +#[test] +fn a_manual_newline_may_start_a_line_with_a_prohibited_character() { + if face().is_none() { + return; + } + // The author's own line breaks are kept: 禁則 only applies to automatic wrapping. + let t = text("き\nっく", TextAutoResize::Height); + let l = layout(&t, None, None); + assert_eq!(line_texts(&t, &l), ["き\n", "っく"], "a manual break is not pushed out by kinsoku"); +} + #[test] fn full_width_space_hangs_and_breaks() { if face().is_none() { diff --git a/crates/text/src/breaks.rs b/crates/text/src/breaks.rs index 3f5458ead..be6db8df1 100644 --- a/crates/text/src/breaks.rs +++ b/crates/text/src/breaks.rs @@ -21,12 +21,13 @@ enum Class { Other, } -/// Opening brackets and quotes (line-end prohibited). -const OPEN: &str = "([{‘“〈《「『【〔〖〘〚〝([{「"; -/// Closing brackets, quotes and punctuation, iteration marks, small kana and the prolonged sound -/// mark (line-start prohibited; the small katakana extensions U+31F0..U+31FF are a range below). -const CLOSE: &str = - ")]},.:;!?’”‥…‼⁇⁈⁉、。々〉》」』】〕〗〙〛〜〞〟〻ぁぃぅぇぉっゃゅょゎゕゖゝゞ゠ァィゥェォッャュョヮヵヶ・ーヽヾ!),.:;?]}。」、・ー"; +/// Opening brackets and quotes (line-end prohibited, JIS X 4051's 行末禁則). +const OPEN: &str = "([{‘“〈《「『【〔〖〘〚〝([{「⦅"; +/// Closing brackets, quotes and punctuation, iteration marks, small kana, the prolonged sound mark +/// and the (semi-)voiced sound marks (line-start prohibited, JIS X 4051's 行頭禁則). Two blocks +/// are ranges in [`class`] instead: the small katakana extensions U+31F0..U+31FF and the halfwidth +/// small kana U+FF67..U+FF6F plus the halfwidth voicing marks U+FF9E/U+FF9F. +const CLOSE: &str = ")]},.:;!?’”‥…‼⁇⁈⁉、。々〉》」』】〕〗〙〛〜〞〟〻ぁぃぅぇぉっゃゅょゎゕゖゝゞ゠ァィゥェォッャュョヮヵヶ・ーヽヾ!),.:;?]}。」、・ー⦆゛゜〱〲〳〴〵"; fn class(c: char) -> Class { if c.is_ascii_alphanumeric() { @@ -35,7 +36,7 @@ fn class(c: char) -> Class { if OPEN.contains(c) { return Class::Open; } - if CLOSE.contains(c) || ('\u{31F0}'..='\u{31FF}').contains(&c) { + if CLOSE.contains(c) || ('\u{31F0}'..='\u{31FF}').contains(&c) || ('\u{FF67}'..='\u{FF6F}').contains(&c) || matches!(c, '\u{FF9E}' | '\u{FF9F}') { return Class::Close; } match c { diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index a1a5bf128..e08da2b17 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # FigCraft parity with Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (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); 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) · **Target:** Figma Design (desktop app 126.10.7, macOS) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-22 · **Change:** minor (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; previous: minor, 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); 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) · **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 @@ -289,8 +289,9 @@ Hours in this narrative are the builders' estimates; the tables above supersede Auto / % / px line heights with the leading split above and below every line, letter spacing in % and px, paragraph spacing and indent (start-aligned text only), resizing and truncation, decorations from the font's metrics; CJK line breaking (between ideographs, kana and Hangul, no - break inside Latin words, kinsoku for closing and opening punctuation, small kana and the - prolonged sound mark); a style's metrics from its own font, not a fallback; carets, Delete and + break inside Latin words, kinsoku to JIS X 4051 for closing and opening punctuation, small kana + (halfwidth too), the prolonged sound mark, the iteration marks, the (semi-)voiced sound marks + and the halfwidth parentheses); a style's metrics from its own font, not a fallback; carets, Delete and 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 From 5e2957a9011d71ff8fc3469830eb28ca17a2d3ad Mon Sep 17 00:00:00 2001 From: Ridzzz0Alam Date: Wed, 21 Oct 2026 19:15:58 +0200 Subject: [PATCH 454/817] M1: Save, Save as and Export arrive as downloads in the browser (#969) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cause: in the web build no file has a path, so Save goes to Save as, and Save as and every Export go through Services::pick_save / pick_folder. WebServices keeps the trait's defaults there, which return no path, so the callback never ran: no download, no message. Only Variables ▸ Export used the platform's downloads (#368). Fix: where services.downloads() is true, those routes run their command without a path and hand the bytes to services.download(): - engine: file.saveAs takes `data: true` and returns the .figcraft file as base64 `data` with its `name`, marking it saved (no path, nothing remembered). Programmatic Save as without either still asks for a path. - ui: FigApp::download decodes a result's `data` and says when nothing arrived; Save as, one-off export (PNG/JPG/WebP/SVG/PDF), .fig export, frames to PDF and multi-layer export (one download per file) use it. Tests: engine save_as_data_hands_back_the_file_and_marks_it_saved; ui-egui web_save_tests (save, export, refused download) with the fake browser Services from variables_export_ui_tests. The UI tests fail without the fix. --- crates/engine/src/cmd/file.rs | 58 +++++++++++++++---- crates/ui-egui/locales/en.toml | 1 + crates/ui-egui/locales/es.toml | 1 + crates/ui-egui/src/dialogs.rs | 15 ++++- crates/ui-egui/src/export_panel.rs | 17 ++++++ crates/ui-egui/src/lib.rs | 22 +++++++ crates/ui-egui/src/menus.rs | 9 +++ .../ui-egui/src/variables_export_ui_tests.rs | 8 +-- crates/ui-egui/src/web_save_tests.rs | 55 ++++++++++++++++++ 9 files changed, 169 insertions(+), 17 deletions(-) create mode 100644 crates/ui-egui/src/web_save_tests.rs diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index 7380711fe..8a75efb71 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -51,7 +51,7 @@ pub fn specs() -> Vec { spec!( "file.saveAs", "Save as", - "{path} (no extension adds .figcraft); a .fig path writes an experimental export copy of the shown document with `warnings`, keeping the native path, unsaved changes and version preview", + "{path | data: true (no path: returns the file as base64 `data` with its `name`, for a download)} (no extension adds .figcraft); a .fig path writes an experimental export copy of the shown document with `warnings`, keeping the native path, unsaved changes and version preview", false, save_as ), @@ -843,37 +843,53 @@ fn color_profile(s: &mut Session, p: &Value) -> Result { pub(crate) fn save_ends_preview(s: &Session, cmd: &str, p: &Value) -> bool { let path = string(p, "path").or_else(|| if cmd == "file.save" { s.docs.get(crate::branches::file_tab(s)).and_then(|ds| ds.path.clone()) } else { None }); - path.is_some_and(|path| ext(&path) != "fig") + path.is_some_and(|path| ext(&path) != "fig") || (cmd == "file.saveAs" && wants_data(p)) +} + +/// `file.saveAs` asked for the file's bytes instead of a path to write (the browser's download). +fn wants_data(p: &Value) -> bool { + p.get("data").and_then(Value::as_bool) == Some(true) } /// Save the file of the active tab (the main file for a branch tab, with its branches), or export /// the active document as an experimental `.fig` copy without changing its native save state. -fn save_to(s: &mut Session, path: String) -> Result { - if ext(&path) == "fig" { +/// Without a path the file comes back as base64 `data` for the caller to deliver (#969). +fn save_to(s: &mut Session, path: Option) -> Result { + if let Some(path) = path.as_deref().filter(|p| ext(p) == "fig") { return export_fig(s, &json!({"path": path})); } let i = crate::branches::file_tab(s); let ds = s.docs.get_mut(i).ok_or(EngineError::NoDocument)?; let mut snapshot = FileSnapshot::of(ds); let follows_path = ds.path.as_deref().map_or(ds.doc.name == "Untitled", |old| ds.doc.name == file_stem(old)); - if follows_path && ds.path.as_deref() != Some(path.as_str()) { - Arc::make_mut(&mut snapshot.doc).name = file_stem(&path); + if let Some(path) = path.as_deref() + && follows_path + && ds.path.as_deref() != Some(path) + { + Arc::make_mut(&mut snapshot.doc).name = file_stem(path); } let bytes = snapshot.encode()?; - write(&path, &bytes)?; + if let Some(path) = &path { + write(path, &bytes)?; + } ds.doc = snapshot.doc; - ds.path = Some(path.clone()); + if path.is_some() { + ds.path.clone_from(&path); + } ds.mark_saved(); ds.revision += 1; - let uid = ds.uid; + let (uid, name) = (ds.uid, format!("{}.figcraft", ds.doc.name)); branch_tabs_saved(s, uid); + let Some(path) = path else { + return Ok(json!({"name": name, "bytes": bytes.len(), "data": base64::engine::general_purpose::STANDARD.encode(&bytes)})); + }; remember(s, &path); Ok(json!({"path": path, "bytes": bytes.len()})) } fn save(s: &mut Session, p: &Value) -> Result { if let Some(path) = string(p, "path") { - return save_to(s, path); + return save_to(s, Some(path)); } match s.docs.get(crate::branches::file_tab(s)).ok_or(EngineError::NoDocument)?.path.clone() { // Earlier builds wrote native data under a .fig name: never overwrite that file with an export. @@ -881,7 +897,7 @@ fn save(s: &mut Session, p: &Value) -> Result { s.request_ui("dialog.saveAs", json!({})); Err(EngineError::Disabled("file.save".into(), "the saved path ends in .fig: choose Save as or pass `path`".into())) } - Some(path) => save_to(s, path), + Some(path) => save_to(s, Some(path)), None => { s.request_ui("dialog.saveAs", json!({})); Err(EngineError::Disabled("file.save".into(), "the file has no path yet: pass `path`".into())) @@ -895,8 +911,9 @@ fn save_as(s: &mut Session, p: &Value) -> Result { if ext(&path).is_empty() { path.push_str(".figcraft"); } - save_to(s, path) + save_to(s, Some(path)) } + None if wants_data(p) => save_to(s, None), None => { s.request_ui("dialog.saveAs", json!({})); Err(EngineError::Disabled("file.saveAs".into(), "pass `path`".into())) @@ -1563,6 +1580,23 @@ mod rest_import_tests { assert_eq!(s.docs.len(), open, "a refused open adds nothing"); } + #[test] + fn save_as_data_hands_back_the_file_and_marks_it_saved() { + // The browser has no paths: Save as returns the file for a download (#969). + let mut s = Session::new(); + s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap(); + assert!(s.execute("file.saveAs", &json!({})).is_err(), "no path and no data: still asks for a path"); + let recent = s.prefs.recent_files.clone(); + let r = s.execute("file.saveAs", &json!({"data": true})).unwrap(); + assert_eq!(r["name"], "Untitled.figcraft"); + assert!(!s.ds().unwrap().is_dirty()); + assert_eq!(s.ds().unwrap().path, None, "still no path to save over"); + assert_eq!(s.prefs.recent_files, recent, "nothing on disk to remember"); + let mut t = Session::new(); + t.execute("file.open", &json!({"data": r["data"], "name": r["name"]})).unwrap(); + assert!(t.doc().unwrap().nodes().any(|n| matches!(n.kind, NodeKind::Rectangle)), "the bytes reopen"); + } + #[test] fn open_and_import_rest_json() { let dir = std::env::temp_dir().join(format!("figcraft-rest-{}", std::process::id())); diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index ae566fc81..3ce0659dc 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -319,6 +319,7 @@ name = "English" "Corner radius" = "Corner radius" "Corner smoothing" = "Corner smoothing" "Couldn't download the variables" = "Couldn't download the variables" +"Couldn't download {name}" = "Couldn't download {name}" "Couldn't reach {server}: showing what this computer remembers." = "Couldn't reach {server}: showing what this computer remembers." "Couldn't read {name}." = "Couldn't read {name}." "Couldn't save automatically: {error}" = "Couldn't save automatically: {error}" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 596feda6e..bd572dbec 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -10,6 +10,7 @@ status = "draft — needs native review" [ui] "Compatibility notes" = "Notas de compatibilidad" "Couldn't download the variables" = "No se pudieron descargar las variables" +"Couldn't download {name}" = "No se pudo descargar {name}" "% of all commits" = "% del total de commits" "(no longer published)" = "(ya no publicado)" diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index bf9f1b299..9695faee6 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -665,7 +665,11 @@ pub(crate) fn file_saved(app: &mut FigApp, result: &Value) { } fn result_file_name(result: &Value) -> String { - result["path"].as_str().and_then(|p| Path::new(p).file_name()).map(|f| f.to_string_lossy().into_owned()).unwrap_or_default() + match result["path"].as_str() { + Some(p) => Path::new(p).file_name().map(|f| f.to_string_lossy().into_owned()).unwrap_or_default(), + // A download (#969). + None => result["name"].as_str().unwrap_or_default().to_owned(), + } } /// The `.fig` result stays an export: native save state is unchanged, and omissions are reported. @@ -681,6 +685,15 @@ pub(crate) fn fig_exported(app: &mut FigApp, result: &Value) { /// Save the whole file as `.fig`; the toast says how much was left out. fn save_fig(app: &mut FigApp, name: &str) { let filename = format!("{name}.fig"); + if app.services.downloads() { + if let Some(mut r) = app.run("file.export", json!({"format": "fig"})) + && app.download(&filename, &r) + { + r["name"] = json!(filename); + fig_exported(app, &r); + } + return; + } app.pick_save(tr("Export"), &filename, &["fig"], |app, p| { if let Some(r) = app.run("file.export", json!({"format": "fig", "path": p.to_string_lossy()})) { fig_exported(app, &r); diff --git a/crates/ui-egui/src/export_panel.rs b/crates/ui-egui/src/export_panel.rs index 8617c35a8..6a4ca8eee 100644 --- a/crates/ui-egui/src/export_panel.rs +++ b/crates/ui-egui/src/export_panel.rs @@ -320,6 +320,15 @@ pub(crate) fn export_layers(app: &mut FigApp, ids: &[NodeId], assets: bool) { [] => {} // The suggested name keeps only the file's own name (a layer's folders apply to folders). [one] => save_one(app, &[one.id], &one.setting, one.file.rsplit('/').next().unwrap_or(&one.file)), + // No folders in the browser: each file arrives as its own download (#969). + _ if app.services.downloads() => { + let Some(r) = app.run("file.exportLayers", json!({"ids": ids, "assets": assets})) else { return }; + let files = r["files"].as_array().map_or(&[][..], Vec::as_slice); + let n = files.iter().filter(|f| app.download(f["name"].as_str().unwrap_or_default(), f)).count(); + if n > 0 { + app.toast(trn("Exported {n} files", n, &[])); + } + } _ => { let ids = ids.to_vec(); app.pick_folder(tr("Export"), move |app, dir| { @@ -337,6 +346,14 @@ pub(crate) fn save_one(app: &mut FigApp, ids: &[NodeId], setting: &ExportSetting let ext = setting.format.ext(); let mut params = setting_params(setting); params["ids"] = json!(ids); + if app.services.downloads() { + if let Some(r) = app.run("file.export", params) + && app.download(file, &r) + { + app.toast(trf("Exported {name}", &[("name", &file)])); + } + return; + } app.pick_save(tr("Export"), file, &[ext], move |app, p| { params["path"] = json!(p.to_string_lossy()); if app.run("file.export", params).is_some() { diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index c93333b38..788bbf4f3 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -223,6 +223,8 @@ mod vector_tail_ui_tests; #[cfg(test)] mod web_clipboard_tests; #[cfg(test)] +mod web_save_tests; +#[cfg(test)] mod windows_qa_tests; #[cfg(test)] mod windows_tests; @@ -1140,6 +1142,14 @@ impl FigApp { } pub fn save_as_dialog(&mut self) { + if self.services.downloads() { + if let Some(r) = self.run("file.saveAs", json!({"data": true})) + && self.download(r["name"].as_str().unwrap_or_default(), &r) + { + dialogs::file_saved(self, &r); + } + return; + } let Ok(name) = self.session.doc().map(|d| d.name.clone()) else { return }; self.pick_save(i18n::tr("Save as"), &format!("{name}.figcraft"), &["figcraft", "fig"], |app, mut p| { if p.extension().is_none_or(|e| e.is_empty()) { @@ -1244,6 +1254,18 @@ impl FigApp { self.start_dialog(|services| services.pick_save(title, name, exts), true, done); } + /// Hand a command result's base64 `data` over as a download named `name`, where the platform + /// saves by downloads rather than save dialogs (the browser, #969). Says so when nothing arrived. + pub(crate) fn download(&mut self, name: &str, result: &Value) -> bool { + use base64::Engine as _; + let bytes = result["data"].as_str().and_then(|d| base64::engine::general_purpose::STANDARD.decode(d).ok()); + if bytes.is_some_and(|b| self.services.download(name, &b)) { + return true; + } + self.toast(i18n::trf("Couldn't download {name}", &[("name", &name)])); + false + } + /// Pick a folder; `done` runs as [`FigApp::pick_open`]'s does. pub fn pick_folder(&mut self, title: &str, done: impl FnOnce(&mut FigApp, PathBuf) + 'static) { self.start_dialog(|services| services.pick_folder(title), true, done); diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 9659c6b33..afa34873f 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -248,6 +248,15 @@ pub fn invoke(app: &mut FigApp, id: &str) { /// Every visible top-level frame of the page as one PDF page each, through a save dialog. fn export_frames_pdf(app: &mut FigApp) { let name = app.session.doc().map(|d| d.name.clone()).unwrap_or_else(|_| "Untitled".into()); + if app.services.downloads() { + let file = format!("{name}.pdf"); + if let Some(r) = app.run("file.exportFramesPdf", json!({})) + && app.download(&file, &r) + { + app.toast(trf("Exported {name}", &[("name", &file)])); + } + return; + } app.pick_save(tr("Export"), &format!("{name}.pdf"), &["pdf"], |app, p| { if app.run("file.exportFramesPdf", json!({"path": p.to_string_lossy()})).is_some() { app.toast(trf("Exported {name}", &[("name", &p.file_name().map(|f| f.to_string_lossy().to_string()).unwrap_or_default())])); diff --git a/crates/ui-egui/src/variables_export_ui_tests.rs b/crates/ui-egui/src/variables_export_ui_tests.rs index 40a843931..ce51a096d 100644 --- a/crates/ui-egui/src/variables_export_ui_tests.rs +++ b/crates/ui-egui/src/variables_export_ui_tests.rs @@ -9,12 +9,12 @@ use serde_json::{Value, json}; use crate::variables_panel::export_dialog; use crate::{FigApp, NoServices, Services}; -type Downloads = Arc)>>>; +pub(crate) type Downloads = Arc)>>>; /// Services that save by downloads and keep them (`deliver` false: the browser refused). -struct Browser { - got: Downloads, - deliver: bool, +pub(crate) struct Browser { + pub(crate) got: Downloads, + pub(crate) deliver: bool, } impl Services for Browser { diff --git a/crates/ui-egui/src/web_save_tests.rs b/crates/ui-egui/src/web_save_tests.rs new file mode 100644 index 000000000..7d1d75d2e --- /dev/null +++ b/crates/ui-egui/src/web_save_tests.rs @@ -0,0 +1,55 @@ +//! Save, Save as and Export where the platform saves by downloads (the browser, which has no save +//! dialogs or paths): the file arrives as a download instead of nothing happening (#969). + +use base64::Engine as _; +use figcraft_doc::{ExportSetting, NodeId}; +use figcraft_engine::Session; +use serde_json::json; + +use crate::FigApp; +use crate::variables_export_ui_tests::{Browser, Downloads}; + +fn browser(deliver: bool) -> (FigApp, Downloads, NodeId) { + let mut s = Session::new(); + let r = s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap(); + let id = serde_json::from_value(r["id"].clone()).unwrap(); + let got = Downloads::default(); + (FigApp::new(s, Box::new(Browser { got: got.clone(), deliver })), got, id) +} + +fn toast(app: &FigApp) -> String { + app.ui.toast.as_ref().map(|t| t.0.clone()).unwrap_or_default() +} + +#[test] +fn save_downloads_the_figcraft_file() { + let (mut app, got, _) = browser(true); + app.save(); + let got = got.lock().unwrap(); + let [(name, bytes)] = got.as_slice() else { panic!("one download, got {}", got.len()) }; + assert_eq!(name, "Untitled.figcraft"); + let mut reopened = Session::new(); + let data = base64::engine::general_purpose::STANDARD.encode(bytes); + reopened.execute("file.open", &json!({"data": data, "name": name})).unwrap(); + assert!(!app.session.ds().unwrap().is_dirty()); + assert_eq!(toast(&app), "Saved Untitled.figcraft"); +} + +#[test] +fn export_downloads_the_exported_file() { + let (mut app, got, id) = browser(true); + crate::export_panel::save_one(&mut app, &[id], &ExportSetting::default(), "Rectangle.png"); + let got = got.lock().unwrap(); + let [(name, bytes)] = got.as_slice() else { panic!("one download, got {}", got.len()) }; + assert_eq!(name, "Rectangle.png"); + assert!(bytes.starts_with(b"\x89PNG")); + assert_eq!(toast(&app), "Exported Rectangle.png"); +} + +#[test] +fn a_refused_download_says_so() { + let (mut app, got, _) = browser(false); + app.save_as_dialog(); + assert_eq!(got.lock().unwrap().len(), 1); + assert_eq!(toast(&app), "Couldn't download Untitled.figcraft"); +} From 28de91d9ae72fc7fbc2199ac5ee2c8be237980d5 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Wed, 21 Oct 2026 13:56:51 -0400 Subject: [PATCH 455/817] Release 0.9.0 Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 42 +++++++++++++++++++++--------------------- Cargo.toml | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e5941f572..459c83200 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1456,7 +1456,7 @@ checksum = "b97b65636e5b9ef369943878ac74335ba1c55c1cb6adbf1e2c293c624248d693" [[package]] name = "figcraft" -version = "0.8.0" +version = "0.9.0" dependencies = [ "arboard", "craft-window", @@ -1482,7 +1482,7 @@ dependencies = [ [[package]] name = "figcraft-cli" -version = "0.8.0" +version = "0.9.0" dependencies = [ "figcraft-doc", "figcraft-engine", @@ -1496,7 +1496,7 @@ dependencies = [ [[package]] name = "figcraft-collab" -version = "0.8.0" +version = "0.9.0" dependencies = [ "base64 0.22.1", "figcraft-color", @@ -1511,7 +1511,7 @@ dependencies = [ [[package]] name = "figcraft-collab-net" -version = "0.8.0" +version = "0.9.0" dependencies = [ "base64 0.22.1", "figcraft-collab", @@ -1534,7 +1534,7 @@ dependencies = [ [[package]] name = "figcraft-color" -version = "0.8.0" +version = "0.9.0" dependencies = [ "kurbo", "serde", @@ -1543,7 +1543,7 @@ dependencies = [ [[package]] name = "figcraft-doc" -version = "0.8.0" +version = "0.9.0" dependencies = [ "figcraft-color", "figcraft-geom", @@ -1555,7 +1555,7 @@ dependencies = [ [[package]] name = "figcraft-engine" -version = "0.8.0" +version = "0.9.0" dependencies = [ "base64 0.22.1", "craft-docpath", @@ -1583,7 +1583,7 @@ dependencies = [ [[package]] name = "figcraft-format" -version = "0.8.0" +version = "0.9.0" dependencies = [ "figcraft-doc", "figcraft-pathops", @@ -1598,7 +1598,7 @@ dependencies = [ [[package]] name = "figcraft-geom" -version = "0.8.0" +version = "0.9.0" dependencies = [ "kurbo", "serde", @@ -1606,7 +1606,7 @@ dependencies = [ [[package]] name = "figcraft-layout" -version = "0.8.0" +version = "0.9.0" dependencies = [ "figcraft-doc", "figcraft-geom", @@ -1614,7 +1614,7 @@ dependencies = [ [[package]] name = "figcraft-mcp" -version = "0.8.0" +version = "0.9.0" dependencies = [ "base64 0.22.1", "figcraft-collab-net", @@ -1630,7 +1630,7 @@ dependencies = [ [[package]] name = "figcraft-pathops" -version = "0.8.0" +version = "0.9.0" dependencies = [ "figcraft-doc", "figcraft-geom", @@ -1639,7 +1639,7 @@ dependencies = [ [[package]] name = "figcraft-pdf" -version = "0.8.0" +version = "0.9.0" dependencies = [ "figcraft-color", "figcraft-doc", @@ -1656,7 +1656,7 @@ dependencies = [ [[package]] name = "figcraft-plugin" -version = "0.8.0" +version = "0.9.0" dependencies = [ "figcraft-color", "serde", @@ -1669,7 +1669,7 @@ dependencies = [ [[package]] name = "figcraft-render" -version = "0.8.0" +version = "0.9.0" dependencies = [ "crc32fast", "figcraft-color", @@ -1687,7 +1687,7 @@ dependencies = [ [[package]] name = "figcraft-server" -version = "0.8.0" +version = "0.9.0" dependencies = [ "crc32fast", "ctrlc", @@ -1711,7 +1711,7 @@ dependencies = [ [[package]] name = "figcraft-svg" -version = "0.8.0" +version = "0.9.0" dependencies = [ "base64 0.22.1", "figcraft-color", @@ -1727,7 +1727,7 @@ dependencies = [ [[package]] name = "figcraft-text" -version = "0.8.0" +version = "0.9.0" dependencies = [ "figcraft-doc", "figcraft-geom", @@ -1741,7 +1741,7 @@ dependencies = [ [[package]] name = "figcraft-ui-egui" -version = "0.8.0" +version = "0.9.0" dependencies = [ "base64 0.22.1", "egui", @@ -1766,7 +1766,7 @@ dependencies = [ [[package]] name = "figcraft-web" -version = "0.8.0" +version = "0.9.0" dependencies = [ "eframe", "egui", @@ -5871,7 +5871,7 @@ checksum = "9440ea3e5aeabb0ac63af70daf835274065238cdd0cec83418f417eae38bacee" [[package]] name = "xtask" -version = "0.8.0" +version = "0.9.0" dependencies = [ "figcraft-engine", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index bb06ba2ca..6cc175465 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ exclude = ["plugins"] # default-members = ["crates/*", "apps/figcraft", "apps/figcraft-cli", "xtask"] [workspace.package] -version = "0.8.0" +version = "0.9.0" edition = "2024" license = "MIT OR Apache-2.0" rust-version = "1.95" From 3146ad2b2f87331f3d3c90bed51ee4fc997e1848 Mon Sep 17 00:00:00 2001 From: Kameron Date: Wed, 21 Oct 2026 11:03:08 -0700 Subject: [PATCH 456/817] node.reparent: index is the layer's final position (#992) `node.reparent {ids, parent, index}` read `index` against the parent's children as they were before the move, so within the same parent moving a layer up one place did nothing and asking for two places moved it one. `index` now counts the parent's children after the move, the way `node.reorder` already does, in the same parent or a new one; several layers still land together in their stacking order. The layers panel was the only caller passing an index other than 0. It drops on a gap between rows counted before the move, so it now subtracts the dragged layers below that gap and drags behave as before. Documents `index` in the command's params and in docs/mcp.md. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/edit.rs | 15 +++++-- crates/engine/src/panels_behaviour_tests.rs | 44 +++++++++++++++++---- crates/ui-egui/src/layers.rs | 6 ++- crates/ui-egui/src/layers_drag_tests.rs | 23 +++++++++++ docs/mcp.md | 6 +++ 5 files changed, 80 insertions(+), 14 deletions(-) diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index a16fbb386..4ec268875 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -216,7 +216,13 @@ pub fn specs() -> Vec { let i = req_id("node.get", p, "id")?; Ok(crate::inspect::node_json(s.doc()?, i, 1)) }), - spec!("node.reparent", "Move layer into", "{ids?, parent, index?}", true, reparent), + spec!( + "node.reparent", + "Move layer into", + "{ids?, parent, index? (final position among parent's children, bottom first; default top)}", + true, + reparent + ), spec!("node.reorder", "Reorder layer", "{id, index}", true, |s, p| { let i = req_id("node.reorder", p, "id")?; let idx = req_num("node.reorder", p, "index")?.max(0.0) as usize; @@ -1302,9 +1308,10 @@ fn reparent(s: &mut Session, p: &Value) -> Result { let index = num(p, "index").map(|i| i.max(0.0) as usize); let doc = s.doc_mut()?; let ids = z_sorted(doc, &roots(doc, &ids)); - // The layers land together under the first sibling at or above `index` that stays put (none: on - // top), wherever they came from. - let above = index.and_then(|at| doc.get(parent).ok()?.children.iter().skip(at).find(|c| !ids.contains(c)).copied()); + // `index` is where the first moved layer ends up among the parent's children (bottom first), + // counted after the move, the way `node.reorder` counts it. The layers land together, keeping + // their order, under the sibling that stays put and ends up just after them (none: on top). + let above = index.and_then(|at| doc.get(parent).ok()?.children.iter().filter(|c| !ids.contains(c)).nth(at).copied()); for i in &ids { // Counted with the layer still in place, as `reparent` expects. let at = above.and_then(|a| doc.node(parent)?.children.iter().position(|c| *c == a)); diff --git a/crates/engine/src/panels_behaviour_tests.rs b/crates/engine/src/panels_behaviour_tests.rs index d299b0df9..9870aa31c 100644 --- a/crates/engine/src/panels_behaviour_tests.rs +++ b/crates/engine/src/panels_behaviour_tests.rs @@ -99,16 +99,18 @@ fn scene(s: &mut Session) -> Scene { #[test] fn dragging_in_the_layers_panel_reorders_by_the_documented_rules() { - // The panel drops layers with `node.reparent {ids, parent, index}`: `index` counts the - // parent's children bottom first, as they are before the move. + // The panel drops layers with `node.reparent {ids, parent, index}`: `index` is where the first + // moved layer ends up among the parent's children, bottom first, counted after the move. // (moved, index in F, F's children after (bottom first), derivation) - let rows: [(&[&str], usize, [&str; 4], &str); 6] = [ - (&["a"], 4, ["b", "c", "d", "a"], "a layer dragged to the top of its parent's list comes to the front"), + let rows: [(&[&str], usize, [&str; 4], &str); 8] = [ + (&["a"], 3, ["b", "c", "d", "a"], "a layer dragged to the top of its parent's list comes to the front"), + (&["a"], 9, ["b", "c", "d", "a"], "an index past the end is the front"), (&["d"], 0, ["d", "a", "b", "c"], "a layer dragged to the bottom of the list goes to the back"), - (&["a"], 2, ["b", "a", "c", "d"], "a layer dropped between two layers lands between them"), - (&["a", "b"], 4, ["c", "d", "a", "b"], "several selected layers move together, keeping their order"), - (&["a", "d"], 2, ["b", "a", "d", "c"], "several layers from apart land together where they are dropped"), - (&["b", "c"], 1, ["a", "b", "c", "d"], "silent: dropping a block of layers onto itself changes nothing (pinned)"), + (&["a"], 1, ["b", "a", "c", "d"], "a layer moved up one place goes up one place (#992)"), + (&["a"], 0, ["a", "b", "c", "d"], "silent: a layer asked to stay where it is stays (pinned)"), + (&["a", "b"], 2, ["c", "d", "a", "b"], "several selected layers move together, keeping their order"), + (&["a", "d"], 1, ["b", "a", "d", "c"], "several layers from apart land together where they are asked to"), + (&["b", "c"], 1, ["a", "b", "c", "d"], "silent: moving a block of layers to where it is changes nothing (pinned)"), ]; for (moved, index, after, why) in rows { let mut s = Session::new(); @@ -172,6 +174,32 @@ fn dragging_into_frames_groups_and_auto_layout() { ); } +#[test] +fn reparent_index_is_the_final_position_in_auto_layout_and_across_parents() { + // #992: `index` is the layer's place among the parent's children after the move. + let mut s = Session::new(); + let row = id(&ex(&mut s, "node.create", json!({"type": "frame", "name": "Row", "props": {"layout": "horizontal"}}))); + let text = |s: &mut Session, t: &str, parent: NodeId| id(&ex(s, "node.create", json!({"type": "text", "name": t, "text": t, "parent": parent}))); + let (first, second, third) = (text(&mut s, "first", row), text(&mut s, "second", row), text(&mut s, "third", row)); + let names = |s: &Session, p: NodeId| kids(s, p).iter().map(|i| name(s, *i)).collect::>(); + ex(&mut s, "node.reparent", json!({"ids": [first], "parent": row, "index": 1})); + assert_eq!(names(&s, row), ["second", "first", "third"], "moved down one place"); + ex(&mut s, "node.reparent", json!({"ids": [first], "parent": row, "index": 2})); + assert_eq!(names(&s, row), ["second", "third", "first"], "moved to the end"); + ex(&mut s, "node.reparent", json!({"ids": [first], "parent": row, "index": 0})); + assert_eq!(names(&s, row), ["first", "second", "third"], "moved to the start"); + let x = |s: &Session, i: NodeId| s.doc().unwrap().node(i).unwrap().transform.as_coeffs()[4]; + assert!(x(&s, first) < x(&s, second) && x(&s, second) < x(&s, third), "the flow follows the new order"); + // Into another parent, `index` means the same thing. + let other = id(&ex(&mut s, "node.create", json!({"type": "frame", "name": "Other", "props": {"layout": "horizontal"}}))); + let (p, q) = (text(&mut s, "p", other), text(&mut s, "q", other)); + ex(&mut s, "node.reparent", json!({"ids": [second], "parent": other, "index": 1})); + assert_eq!(kids(&s, other), [p, second, q], "lands at index 1 of the new parent"); + ex(&mut s, "node.reparent", json!({"ids": [first, third], "parent": other, "index": 3})); + assert_eq!(kids(&s, other), [p, second, q, first, third], "several layers start at index 3, keeping their order"); + assert!(kids(&s, row).is_empty()); +} + #[test] fn renaming_several_layers_by_the_documented_codes() { // Three layers named `names`, bottom to top; (names, params, new names, derivation). diff --git a/crates/ui-egui/src/layers.rs b/crates/ui-egui/src/layers.rs index f172b309e..81d3fbcb7 100644 --- a/crates/ui-egui/src/layers.rs +++ b/crates/ui-egui/src/layers.rs @@ -1075,8 +1075,10 @@ fn layers(app: &mut FigApp, ui: &mut Ui) { // Above in the list = higher z = after the target among siblings. if let Some(parent) = doc.node(target).and_then(|n| n.parent) { let idx = doc.index_in_parent(target).unwrap_or(0); - let index = if z < 0 { idx + 1 } else { idx }; - app.run("node.reparent", json!({"ids": ids, "parent": parent, "index": index})); + let gap = if z < 0 { idx + 1 } else { idx }; + // `index` is the final position: the dragged layers below the gap leave it. + let below = doc.node(parent).map_or(0, |p| p.children.iter().take(gap).filter(|c| ids.contains(c)).count()); + app.run("node.reparent", json!({"ids": ids, "parent": parent, "index": gap - below})); } } } diff --git a/crates/ui-egui/src/layers_drag_tests.rs b/crates/ui-egui/src/layers_drag_tests.rs index 37002f9f4..fb74e155b 100644 --- a/crates/ui-egui/src/layers_drag_tests.rs +++ b/crates/ui-egui/src/layers_drag_tests.rs @@ -165,3 +165,26 @@ fn dropping_layers_on_another_page_moves_them_there() { let doc = u.app.session.doc().unwrap(); assert_eq!(doc.ancestors(rect).last().copied(), Some(p2), "moved to page 2"); } + +#[test] +fn dropping_a_layer_one_place_over_moves_it_one_place() { + // #992: the panel drops on a gap between rows; the layer ends up in that gap. + let mut s = Session::new(); + let rect = + |s: &mut Session, x: i32| id(s.execute("node.create", &json!({"type": "rectangle", "x": x, "y": 0, "width": 10, "height": 10})).unwrap()); + let (a, b, c) = (rect(&mut s, 0), rect(&mut s, 20), rect(&mut s, 40)); + s.execute("select.none", &json!({})).unwrap(); + let page = s.page().unwrap(); + let mut u = Ui::new(s); + let kids = |u: &Ui| u.app.session.doc().unwrap().node(page).unwrap().children.clone(); + // The list shows c, b, a top to bottom: `a` dragged onto the top edge of `b` goes just above it. + let (from, to) = (u.row_at(a), u.row_at(b) - vec2(0.0, 12.0)); + u.drag_to(from, to); + u.button(to, false); + assert_eq!(kids(&u), [b, a, c], "dropped between b and c"); + // And `c` dragged onto the bottom edge of `a` goes just below it. + let (from, to) = (u.row_at(c), u.row_at(a) + vec2(0.0, 12.0)); + u.drag_to(from, to); + u.button(to, false); + assert_eq!(kids(&u), [b, c, a], "dropped between a and b"); +} diff --git a/docs/mcp.md b/docs/mcp.md index dfea95cc2..64ff024e2 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -190,6 +190,12 @@ Or in a project's `.mcp.json`: the CSS `fr` unit: a track never gets less than its content (a fixed-size child bigger than its share keeps it; the other `fr` tracks share the rest). `inspect` reports a grid child's resolved `gridCell`. +- Layer order: `node.reparent {ids?, parent, index?}` moves layers into `parent` (keeping their place + on the canvas, or taking their place in its auto layout flow) and `node.reorder {id, index}` moves + one within its parent. `index` counts the parent's children bottom first (in auto layout, the + first in the flow) and is where the (first) moved layer ends up after the move, in the same parent + or a new one; several layers land together in their stacking order. No `index`, or one past the + end, puts them on top (last in the flow). - **Every menu action is a command** (`list_commands`), and most commands act on `ids` when given, else on the selection. New layers become the selection. - Colours are `"#RRGGBB"` or `"#RRGGBBAA"`. Inside fills and strokes, `color` may also be a hex From 9315e5e014705e5866fa1d74fa8e9b2075a00b1c Mon Sep 17 00:00:00 2001 From: Kameron Date: Wed, 21 Oct 2026 11:19:47 -0700 Subject: [PATCH 457/817] command.batch: named steps ($ref) and slash paths in field A batch step can name itself with "as" and later steps refer to it with {"$ref": "name"}, alongside positional {"$step": n}. "field" now takes a slash path into the result as well as a key, so {"$ref": "copy", "field": "ids/0"} reaches the first id edit.duplicate returned (the convention variable.bind uses for fills/0/color; a leading "/" as in JSON Pointer also works, and a key holding "/" still matches first). Resolution moves to crates/engine/src/batch.rs (BatchStep, BatchScope), shared by command.batch, the CLI script runner, the control channel and the MCP batch tool, which now passes "as" through. Duplicate names fail before any step runs; unknown, same-step or later names, bad paths and out-of-range indexes fail the batch with the step, name and full path. $ref is reserved like $step; nested batches keep their own names. Fixes #994. Co-Authored-By: Claude Opus 5.5 --- apps/figcraft-cli/src/files.rs | 65 ++++++-- crates/engine/src/batch.rs | 192 ++++++++++++++++++++++ crates/engine/src/batch_step_ref_tests.rs | 148 +++++++++++++++++ crates/engine/src/cmd/edit.rs | 9 +- crates/engine/src/collab_live_tests.rs | 6 +- crates/engine/src/lib.rs | 79 +++------ crates/engine/src/tests.rs | 5 + crates/mcp/src/tools.rs | 10 +- crates/mcp/tests/agent_tasks.rs | 29 ++++ docs/cli.md | 14 +- docs/control-protocol.md | 14 +- docs/mcp.md | 52 ++++-- 12 files changed, 516 insertions(+), 107 deletions(-) create mode 100644 crates/engine/src/batch.rs diff --git a/apps/figcraft-cli/src/files.rs b/apps/figcraft-cli/src/files.rs index 462155998..d18e071ac 100644 --- a/apps/figcraft-cli/src/files.rs +++ b/apps/figcraft-cli/src/files.rs @@ -4,7 +4,7 @@ use std::path::Path; use std::process::ExitCode; use figcraft_doc::{Document, ExportFormat, ExportSetting, NodeId, NodeKind, PrintSettings}; -use figcraft_engine::Session; +use figcraft_engine::{BatchScope, BatchStep, Session}; use serde_json::{Value, json}; use crate::{CliError, CliResult}; @@ -309,7 +309,7 @@ pub fn render(file: &str, out: &str, scale: f64, page: Option<&str>) -> CliResul } /// Parse a script: a JSON array of steps, `{"commands": [...]}`, or JSON lines. -pub fn parse_script(text: &str) -> Result, String> { +pub fn parse_script(text: &str) -> Result, String> { let steps: Vec = match serde_json::from_str::(text) { Ok(Value::Array(a)) => a, Ok(Value::Object(o)) if o.contains_key("commands") => { @@ -334,7 +334,8 @@ pub fn parse_script(text: &str) -> Result, String> { Some(p @ Value::Object(_)) => p.clone(), Some(_) => return Err(format!("step {i} ({cmd}): `params` must be an object")), }; - Ok((cmd.to_string(), params)) + let name = figcraft_engine::batch::step_name(i, &s).map_err(|e| e.to_string())?; + Ok(BatchStep { name, ..BatchStep::new(cmd, params) }) }) .collect() } @@ -352,31 +353,30 @@ pub fn run_script(script: &str, input: Option<&str>, out: Option<&str>) -> CliRe None => Session::new(), }; // One undo step and all-or-nothing, the way the same commands behave through `command.batch` - // (MCP, the control channel, plugins): `{"$step": n}` resolves against the steps before it, and - // a step that fails takes the whole script back instead of leaving the earlier steps applied. - // The result lines are held back until the script is through, so none of them reports work that - // was rolled back. - let mut results: Vec = Vec::with_capacity(steps.len()); + // (MCP, the control channel, plugins): `{"$step": n}` and `{"$ref": "name"}` resolve against the + // steps before it, and a step that fails takes the whole script back instead of leaving the + // earlier steps applied. The result lines are held back until the script is through, so none of + // them reports work that was rolled back. + let mut scope = BatchScope::new(&steps).map_err(|e| CliError::Failed(format!("{script}: {e}")))?; let mut failed_at = 0; let outcome = s.grouped(&format!("run {script}"), |s| { - for (i, (cmd, params)) in steps.iter().enumerate() { + for (i, step) in steps.iter().enumerate() { failed_at = i; - let v = s.batch_step(&results, i, cmd, params)?; + s.batch_step(&mut scope, &step.command, &step.params)?; s.ui_requests.clear(); - results.push(v); } Ok(()) }); if let Err(e) = outcome { - let cmd = steps.get(failed_at).map_or("", |(cmd, _)| cmd.as_str()); + let cmd = steps.get(failed_at).map_or("", |step| step.command.as_str()); let i = failed_at; println!("{}", json!({"step": i, "command": cmd, "ok": false, "error": e.to_string(), "rolledBack": true})); eprintln!("error: step {i} ({cmd}) failed: {e}"); eprintln!("the script's document changes were rolled back"); return Ok(ExitCode::from(1)); } - for (i, ((cmd, _), v)) in steps.iter().zip(&results).enumerate() { - println!("{}", json!({"step": i, "command": cmd, "ok": true, "result": v})); + for (i, (step, v)) in steps.iter().zip(scope.results()).enumerate() { + println!("{}", json!({"step": i, "command": step.command, "ok": true, "result": v})); } if let Some(out) = out { let ds = s.ds().map_err(|e| CliError::Failed(e.to_string()))?; @@ -494,6 +494,43 @@ mod tests { std::fs::remove_dir_all(dir).unwrap(); } + /// A script names its steps with `as` and reads paths into their results, like `command.batch`. + #[test] + fn a_script_refers_to_named_steps_and_paths() { + let dir = temp_dir("run-ref"); + let script = dir.join("script.json"); + std::fs::write( + &script, + r#"[ + {"command": "node.create", "as": "card", "params": {"type": "frame", "name": "Card", "x": 0, "y": 0, "width": 200, "height": 100}}, + {"command": "edit.duplicate", "as": "copy", "params": {"ids": [{"$ref": "card"}]}}, + {"command": "node.set", "params": {"ids": [{"$ref": "copy", "field": "ids/0"}], "props": {"name": "Copy"}}} + ]"#, + ) + .unwrap(); + let out = dir.join("out.figcraft"); + run_script(script.to_str().unwrap(), None, Some(out.to_str().unwrap())).unwrap(); + + let mut s = Session::empty(); + s.execute("file.open", &json!({"path": out.to_str().unwrap()})).unwrap(); + let doc = s.doc().unwrap(); + let top = doc.node(s.page().unwrap()).unwrap().children.clone(); + let names: Vec<_> = top.iter().map(|id| doc.node(*id).unwrap().name.clone()).collect(); + assert_eq!(names, ["Card", "Copy"]); + std::fs::remove_dir_all(dir).unwrap(); + } + + /// Two steps with one name fail before anything runs. + #[test] + fn a_script_with_a_name_twice_runs_nothing() { + let dir = temp_dir("run-dup-name"); + let script = dir.join("script.json"); + std::fs::write(&script, r#"[{"command": "select.none", "as": "a"}, {"command": "select.none", "as": "a"}]"#).unwrap(); + let Err(CliError::Failed(e)) = run_script(script.to_str().unwrap(), None, None) else { panic!("a name twice must fail") }; + assert!(e.contains("step 1: `as` \"a\" is already step 0's name"), "{e}"); + std::fs::remove_dir_all(dir).unwrap(); + } + /// A step that fails takes the whole script back: nothing is written, and the failure says so. #[test] fn a_failed_step_leaves_no_output() { diff --git a/crates/engine/src/batch.rs b/crates/engine/src/batch.rs new file mode 100644 index 000000000..5c4550ecb --- /dev/null +++ b/crates/engine/src/batch.rs @@ -0,0 +1,192 @@ +//! Step references in `command.batch`: a step's params can use what an earlier step returned. +//! +//! `{"$step": n}` stands for the `id` in the result of step `n` (zero-based), and `{"$ref": "name"}` +//! for the `id` in the result of the step that called itself `name` with `"as": "name"`. Either +//! takes a `field`, a key of that result or a slash path into it (`ids/0`, `map/3`, `bounds/x`), the +//! way `variable.bind` names `fills/0/color`. The CLI's script runner resolves its steps the same way. + +use std::collections::HashMap; + +use serde_json::{Map, Value}; + +use crate::{Result, bad}; + +/// Deepest params nesting the resolver walks before giving up. +const MAX_DEPTH: usize = 64; + +/// One step of a batch: a command, its params and the name later steps can call it by. +#[derive(Clone, Debug, PartialEq)] +pub struct BatchStep { + pub command: String, + pub params: Value, + /// The step's `as`, for `{"$ref": name}` in later steps. + pub name: Option, +} + +impl BatchStep { + /// A step without a name. + pub fn new(command: impl Into, params: Value) -> Self { + Self { command: command.into(), params, name: None } + } +} + +/// A step's `as` (`step` is its index, for the error): `None` when it has none. +pub fn step_name(step: usize, json: &Value) -> Result> { + match json.get("as") { + None | Some(Value::Null) => Ok(None), + Some(Value::String(name)) if !name.is_empty() => Ok(Some(name.clone())), + Some(_) => Err(bad("command.batch", format!("step {step}: `as` must be a name (a non-empty string)"))), + } +} + +/// The steps of one batch run so far: their results, and which step each `as` name belongs to. +/// A nested `command.batch` step gets its own scope, so its references are to its own steps. +#[derive(Clone, Debug, Default)] +pub struct BatchScope { + names: HashMap, + results: Vec, +} + +impl BatchScope { + /// The scope for running `steps`. Two steps with the same name fail here, before any step runs. + pub fn new(steps: &[BatchStep]) -> Result { + let mut names = HashMap::new(); + for (i, step) in steps.iter().enumerate() { + let Some(name) = &step.name else { continue }; + if let Some(first) = names.insert(name.clone(), i) { + return Err(bad("command.batch", format!("step {i}: `as` \"{name}\" is already step {first}'s name"))); + } + } + Ok(Self { names, results: Vec::with_capacity(steps.len()) }) + } + + /// The results of the steps run so far, in order. + pub fn results(&self) -> &[Value] { + &self.results + } + + pub fn into_results(self) -> Vec { + self.results + } + + /// The index of the step that runs next. + pub fn next_step(&self) -> usize { + self.results.len() + } + + pub(crate) fn push(&mut self, result: Value) { + self.results.push(result); + } + + /// `params` of the next step with every reference in it replaced. + pub(crate) fn resolve(&self, params: &Value) -> Result { + self.resolve_in(params, 0) + } + + fn resolve_in(&self, v: &Value, depth: usize) -> Result { + let step = self.next_step(); + if depth > MAX_DEPTH { + return Err(bad("command.batch", format!("step {step}: params nest deeper than {MAX_DEPTH} levels"))); + } + match v { + Value::Object(o) if o.contains_key("$step") || o.contains_key("$ref") => self.reference(o), + Value::Object(o) => { + let mut out = Map::with_capacity(o.len()); + for (k, x) in o { + out.insert(k.clone(), self.resolve_in(x, depth + 1)?); + } + Ok(Value::Object(out)) + } + Value::Array(a) => a.iter().map(|x| self.resolve_in(x, depth + 1)).collect::>>().map(Value::Array), + _ => Ok(v.clone()), + } + } + + /// The value a `{"$step": n}` or `{"$ref": "name"}` object (with an optional `field`) stands for. + fn reference(&self, o: &Map) -> Result { + let step = self.next_step(); + let fail = |msg: String| bad("command.batch", format!("step {step}: {msg}")); + let key = if o.contains_key("$step") { "$step" } else { "$ref" }; + if let Some(k) = o.keys().find(|k| *k != key && *k != "field") { + return Err(fail(format!("a `{key}` reference takes only `field`, not `{k}`"))); + } + let (n, who) = if key == "$step" { + let n = o.get("$step").and_then(Value::as_u64).ok_or_else(|| fail("`$step` must be a step index (0, 1, …)".into()))?; + let n = usize::try_from(n).ok().filter(|n| *n < step).ok_or_else(|| { + let range = if step == 0 { "there is none before step 0".to_string() } else { format!("0 to {}", step - 1) }; + fail(format!("`$step` {n} must be an earlier step ({range})")) + })?; + (n, format!("step {n}")) + } else { + let name = o.get("$ref").and_then(Value::as_str).ok_or_else(|| fail("`$ref` must be a step name (a string)".into()))?; + let n = *self.names.get(name).ok_or_else(|| fail(format!("`$ref` \"{name}\" names no step ({})", self.known_names())))?; + if n >= step { + return Err(fail(format!("`$ref` \"{name}\" is step {n}, not an earlier step"))); + } + (n, format!("step {n} (\"{name}\")")) + }; + let path = match o.get("field") { + None => "id", + Some(Value::String(f)) => f.as_str(), + Some(_) => return Err(fail("`field` must be a string".into())), + }; + let result = self.results.get(n).ok_or_else(|| fail(format!("{who} has no result")))?; + lookup(result, path).cloned().map_err(|why| fail(format!("{who}'s result has no `{path}`{why}"))) + } + + fn known_names(&self) -> String { + let mut names: Vec<_> = self.names.iter().collect(); + names.sort_by_key(|(_, i)| **i); + if names.is_empty() { + return "no step has an `as` name".into(); + } + let list: Vec<_> = names.iter().map(|(name, i)| format!("\"{name}\" is step {i}")).collect(); + list.join(", ") + } +} + +/// `path` in `v`: a key as written, else a slash path (`ids/0`, `bounds/x`; a leading `/` as in +/// JSON Pointer is allowed). The error is the detail after "has no `path`". +fn lookup<'a>(v: &'a Value, path: &str) -> std::result::Result<&'a Value, String> { + // A key as written first, so a key holding `/` still works as it did before paths. + if let Some(x) = v.get(path) { + return Ok(x); + } + let hint = if path.contains('.') && !path.contains('/') { " (paths use `/`, as in `ids/0`)" } else { "" }; + walk(v, path.strip_prefix('/').unwrap_or(path)).map_err(|why| format!("{why}{hint}")) +} + +fn walk<'a>(v: &'a Value, path: &str) -> std::result::Result<&'a Value, String> { + let mut cur = v; + let mut walked = String::new(); + for seg in path.split('/') { + let here = if walked.is_empty() { "the result".to_string() } else { format!("`{walked}`") }; + cur = match cur { + Value::Object(o) => o.get(seg).ok_or_else(|| if walked.is_empty() { String::new() } else { format!(": {here} has no `{seg}`") })?, + Value::Array(a) => match seg.parse::() { + Ok(i) => a.get(i).ok_or_else(|| { + let items = if a.len() == 1 { "1 item".to_string() } else { format!("{} items", a.len()) }; + format!(": {here} has {items}") + })?, + Err(_) => return Err(format!(": {here} is a list, so `{seg}` must be an index (0, 1, …)")), + }, + _ => return Err(format!(": {here} is {}", kind(cur))), + }; + if !walked.is_empty() { + walked.push('/'); + } + walked.push_str(seg); + } + Ok(cur) +} + +fn kind(v: &Value) -> &'static str { + match v { + Value::Null => "null", + Value::Bool(_) => "a boolean", + Value::Number(_) => "a number", + Value::String(_) => "a string", + Value::Array(_) => "a list", + Value::Object(_) => "an object", + } +} diff --git a/crates/engine/src/batch_step_ref_tests.rs b/crates/engine/src/batch_step_ref_tests.rs index ac69118e8..451a63002 100644 --- a/crates/engine/src/batch_step_ref_tests.rs +++ b/crates/engine/src/batch_step_ref_tests.rs @@ -110,3 +110,151 @@ fn a_nested_batch_refers_to_its_own_steps() { let rect = s.doc().unwrap().node(id(&inner[1])).unwrap().clone(); assert_eq!(rect.parent, Some(id(&inner[0])), "in the nested batch's own first frame, not the outer one"); } + +/// Runs `commands` as a batch and returns the error message, which must be `BadParams`. +fn batch_error(s: &mut Session, commands: serde_json::Value) -> String { + match s.execute("command.batch", &json!({"commands": commands})) { + Err(EngineError::BadParams { msg, .. }) => msg, + other => panic!("expected BadParams, got {other:?}"), + } +} + +#[test] +fn a_named_step_is_referred_to_by_its_name() { + let mut s = Session::new(); + let results = s + .execute( + "command.batch", + &json!({"commands": [ + {"command": "node.create", "as": "card", "params": {"type": "frame", "width": 200, "height": 100}}, + {"command": "node.create", "as": "swatch", "params": {"type": "rectangle", "parent": {"$ref": "card"}, "width": 20, "height": 20}}, + {"command": "node.set", "params": {"ids": [{"$ref": "swatch", "field": "id"}], "props": {"name": "Swatch"}}}, + {"command": "node.create", "params": {"type": "text", "text": "hi", "parent": {"$step": 0}}} + ]}), + ) + .unwrap(); + let (frame, rect, text) = (id(&results[0]), id(&results[1]), id(&results[3])); + let doc = s.doc().unwrap(); + assert_eq!(doc.node(rect).unwrap().parent, Some(frame)); + assert_eq!(doc.node(rect).unwrap().name, "Swatch"); + assert_eq!(doc.node(text).unwrap().parent, Some(frame), "`$step` and `$ref` mix in one batch"); + assert_eq!(s.ds().unwrap().history.undo.len(), 1, "still one undo step"); +} + +/// `edit.duplicate` answers `{"ids": [...]}`: a slash path in `field` takes one of them. +#[test] +fn a_field_path_indexes_into_a_list_in_the_result() { + let mut s = Session::new(); + let results = s + .execute( + "command.batch", + &json!({"commands": [ + {"command": "node.create", "as": "a", "params": {"type": "frame", "name": "A", "width": 10, "height": 10}}, + {"command": "node.create", "as": "b", "params": {"type": "frame", "name": "B", "width": 10, "height": 10}}, + {"command": "edit.duplicate", "as": "copies", "params": {"ids": [{"$ref": "a"}, {"$ref": "b"}]}}, + {"command": "node.set", "params": {"ids": [{"$ref": "copies", "field": "ids/1"}], "props": {"name": "B copy"}}}, + {"command": "node.set", "params": {"ids": [{"$step": 2, "field": "/ids/0"}], "props": {"name": "A copy"}}} + ]}), + ) + .unwrap(); + let copies = results[2]["ids"].as_array().unwrap().clone(); + let doc = s.doc().unwrap(); + assert_eq!(doc.node(crate::params::id_of(&copies[0]).unwrap()).unwrap().name, "A copy", "a leading `/` works too"); + assert_eq!(doc.node(crate::params::id_of(&copies[1]).unwrap()).unwrap().name, "B copy"); +} + +#[test] +fn a_field_path_walks_nested_objects_and_takes_whole_values() { + let mut scope = crate::BatchScope::default(); + scope.push(json!({"ids": [7, 8], "bounds": {"x": 1.5, "corners": [{"r": 4}]}, "a/b": "slash key"})); + let resolved = scope + .resolve(&json!({ + "x": {"$step": 0, "field": "bounds/x"}, + "r": {"$step": 0, "field": "bounds/corners/0/r"}, + "all": {"$step": 0, "field": "ids"}, + "key": {"$step": 0, "field": "a/b"}, + "pointer": {"$step": 0, "field": "/ids"} + })) + .unwrap(); + assert_eq!(resolved, json!({"x": 1.5, "r": 4, "all": [7, 8], "key": "slash key", "pointer": [7, 8]}), "a key holding `/` is still read as a key"); +} + +#[test] +fn bad_names_and_paths_fail_and_roll_back() { + let mut s = Session::new(); + let before = s.doc().unwrap().node(s.page().unwrap()).unwrap().children.len(); + let frame = |name: &str| json!({"command": "node.create", "as": name, "params": {"type": "frame", "width": 10, "height": 10}}); + let dup = json!({"command": "edit.duplicate", "as": "copy", "params": {"ids": [{"$ref": "card"}]}}); + let set = |r: serde_json::Value| json!({"command": "node.set", "params": {"ids": [r], "props": {"name": "x"}}}); + let later = json!({"command": "node.create", "as": "later", "params": {"type": "frame", "width": 10, "height": 10}}); + for (commands, needle) in [ + (json!([frame("card"), frame("card")]), "step 1: `as` \"card\" is already step 0's name"), + (json!([frame("card"), set(json!({"$ref": "nope"}))]), "step 1: `$ref` \"nope\" names no step (\"card\" is step 0)"), + (json!([{"command": "node.create", "params": {"type": "frame"}}, set(json!({"$ref": "nope"}))]), "no step has an `as` name"), + (json!([frame("card"), set(json!({"$ref": "later"})), later]), "step 1: `$ref` \"later\" is step 2, not an earlier step"), + ( + json!([frame("card"), {"command": "node.set", "as": "self", "params": {"ids": [{"$ref": "self"}], "props": {}}}]), + "is step 1, not an earlier step", + ), + (json!([frame("card"), set(json!({"$ref": 0}))]), "`$ref` must be a step name"), + (json!([frame("card"), set(json!({"$ref": "card", "id": 3}))]), "a `$ref` reference takes only `field`, not `id`"), + (json!([frame("card"), set(json!({"$ref": "card", "$step": 0}))]), "a `$step` reference takes only `field`, not `$ref`"), + (json!([frame("card"), {"command": "node.create", "as": "", "params": {}}]), "step 1: `as` must be a name"), + (json!([frame("card"), {"command": "node.create", "as": 3, "params": {}}]), "step 1: `as` must be a name"), + ( + json!([frame("card"), dup.clone(), set(json!({"$ref": "copy", "field": "ids/1"}))]), + "step 2: step 1 (\"copy\")'s result has no `ids/1`: `ids` has 1 item", + ), + (json!([frame("card"), dup.clone(), set(json!({"$ref": "copy", "field": "ids/first"}))]), "`ids` is a list, so `first` must be an index"), + (json!([frame("card"), dup.clone(), set(json!({"$ref": "copy", "field": "ids/0/x"}))]), "has no `ids/0/x`: `ids/0` is a number"), + (json!([frame("card"), dup.clone(), set(json!({"$ref": "copy", "field": "map/0"}))]), "step 1 (\"copy\")'s result has no `map/0`"), + (json!([frame("card"), dup.clone(), set(json!({"$ref": "copy", "field": "ids.0"}))]), "has no `ids.0` (paths use `/`, as in `ids/0`)"), + (json!([frame("card"), set(json!({"$step": 0, "field": "id/0"}))]), "has no `id/0`: `id` is a number"), + ] { + let msg = batch_error(&mut s, commands); + assert!(msg.contains(needle), "{msg:?} should contain {needle:?}"); + assert_eq!(s.doc().unwrap().node(s.page().unwrap()).unwrap().children.len(), before, "rolled back"); + } +} + +#[test] +fn text_that_looks_like_a_named_reference_is_left_alone() { + let mut s = Session::new(); + let text = "{\"$ref\": \"card\"} $ref"; + let results = s.execute("command.batch", &json!({"commands": [{"command": "node.create", "params": {"type": "text", "text": text}}]})).unwrap(); + let n = s.doc().unwrap().node(id(&results[0])).unwrap().clone(); + assert!(matches!(n.kind, figcraft_doc::NodeKind::Text(t) if t.characters == text)); +} + +/// A nested batch has its own names: it can't see the outer batch's, may reuse them, and the +/// outer batch can't see its. +#[test] +fn a_nested_batch_has_its_own_names() { + let mut s = Session::new(); + let frame = |name: &str| json!({"command": "node.create", "as": "frame", "params": {"type": "frame", "name": name, "width": 100, "height": 100}}); + let results = s + .execute( + "command.batch", + &json!({"commands": [ + frame("Outer"), + {"command": "command.batch", "as": "inner", "params": {"commands": [ + frame("Inner"), + {"command": "node.create", "params": {"type": "rectangle", "parent": {"$ref": "frame"}, "width": 10, "height": 10}} + ]}}, + {"command": "node.set", "params": {"ids": [{"$ref": "inner", "field": "1/id"}], "props": {"name": "In inner"}}} + ]}), + ) + .unwrap(); + let inner = &results[1]; + let rect = s.doc().unwrap().node(id(&inner[1])).unwrap().clone(); + assert_eq!(rect.parent, Some(id(&inner[0])), "in the nested batch's own frame, not the outer one"); + assert_eq!(rect.name, "In inner", "a path indexes into a nested batch's result list"); + + let msg = batch_error( + &mut s, + json!([frame("Outer"), {"command": "command.batch", "params": {"commands": [ + {"command": "node.create", "params": {"type": "rectangle", "parent": {"$ref": "frame"}, "width": 10, "height": 10}} + ]}}]), + ); + assert!(msg.contains("`$ref` \"frame\" names no step"), "the outer names aren't visible inside: {msg}"); +} diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index a16fbb386..c033c2cd0 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -8,7 +8,7 @@ use serde_json::{Value, json}; use super::{CommandSpec, ok}; use crate::params::*; -use crate::{EngineError, Result, Session, bad, spec}; +use crate::{BatchStep, EngineError, Result, Session, bad, spec}; pub fn specs() -> Vec { vec![ @@ -336,15 +336,16 @@ pub fn specs() -> Vec { } ok() }), - spec!("command.batch", "Run several commands", "{label?, commands: [{command, params}]} (one undo step)", false, |s, p| { + spec!("command.batch", "Run several commands", "{label?, commands: [{command, params, as?}]} (one undo step)", false, |s, p| { let label = string(p, "label").unwrap_or_else(|| "Batch".into()); - let cmds: Vec<(String, Value)> = match get(p, "commands") { + let cmds: Vec = match get(p, "commands") { Some(Value::Array(a)) => { let mut out = Vec::new(); for (i, c) in a.iter().enumerate() { let cmd = c.get("command").and_then(Value::as_str).ok_or_else(|| bad("command.batch", format!("step {i} has no `command`")))?; - out.push((cmd.to_string(), c.get("params").cloned().unwrap_or(json!({})))); + let params = c.get("params").cloned().unwrap_or(json!({})); + out.push(BatchStep { name: crate::batch::step_name(i, c)?, ..BatchStep::new(cmd, params) }); } out } diff --git a/crates/engine/src/collab_live_tests.rs b/crates/engine/src/collab_live_tests.rs index 5b7593919..d53eeff26 100644 --- a/crates/engine/src/collab_live_tests.rs +++ b/crates/engine/src/collab_live_tests.rs @@ -246,9 +246,9 @@ fn a_group_of_commands_syncs_as_one_step() { let (f, r) = frame_and_rect(room.server.document()); let start = room.server.replica().clone(); let cmds = vec![ - ("node.set".to_string(), json!({"id": r, "props": {"name": "A"}})), - ("node.set".to_string(), json!({"id": f, "props": {"name": "B"}})), - ("shape.rectangle".to_string(), json!({"x": 0, "y": 0, "width": 5, "height": 5})), + crate::BatchStep::new("node.set", json!({"id": r, "props": {"name": "A"}})), + crate::BatchStep::new("node.set", json!({"id": f, "props": {"name": "B"}})), + crate::BatchStep::new("shape.rectangle", json!({"x": 0, "y": 0, "width": 5, "height": 5})), ]; room.s(0).batch("Three", &cmds).unwrap(); room.pump(); diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 79e7be0d5..048c07225 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -13,6 +13,7 @@ pub mod al_keys; pub mod annotations; pub mod arc_handles; pub mod background; +pub mod batch; pub mod booleans; pub mod branches; pub mod catalog; @@ -64,6 +65,7 @@ pub mod tools; pub mod vectoredit; pub mod widgets; +pub use batch::{BatchScope, BatchStep}; pub use cmd::{CommandSpec, all_commands, find_command}; pub use figcraft_collab; pub use figcraft_doc as doc; @@ -115,47 +117,6 @@ pub fn bad(cmd: &str, msg: impl Into) -> EngineError { EngineError::BadParams { cmd: cmd.to_string(), msg: msg.into() } } -/// Deepest params nesting `resolve_step_refs` walks before giving up. -const STEP_REF_MAX_DEPTH: usize = 64; - -/// Replace every `{"$step": n}` / `{"$step": n, "field": "…"}` in `v` with that field (default -/// `id`) of `results[n]`, the result of an earlier batch step. -fn resolve_step_refs(v: &Value, results: &[Value], step: usize, depth: usize) -> Result { - if depth > STEP_REF_MAX_DEPTH { - return Err(bad("command.batch", format!("step {step}: params nest deeper than {STEP_REF_MAX_DEPTH} levels"))); - } - match v { - Value::Object(o) if o.contains_key("$step") => { - if let Some(k) = o.keys().find(|k| *k != "$step" && *k != "field") { - return Err(bad("command.batch", format!("step {step}: a `$step` reference takes only `field`, not `{k}`"))); - } - let n = o - .get("$step") - .and_then(Value::as_u64) - .ok_or_else(|| bad("command.batch", format!("step {step}: `$step` must be a step index (0, 1, …)")))?; - let field = match o.get("field") { - None => "id", - Some(Value::String(f)) => f.as_str(), - Some(_) => return Err(bad("command.batch", format!("step {step}: `field` must be a string"))), - }; - let Some(result) = usize::try_from(n).ok().and_then(|n| results.get(n)) else { - let range = if step == 0 { "there is none before step 0".to_string() } else { format!("0 to {}", step - 1) }; - return Err(bad("command.batch", format!("step {step}: `$step` {n} must be an earlier step ({range})"))); - }; - result.get(field).cloned().ok_or_else(|| bad("command.batch", format!("step {step}: step {n}'s result has no `{field}`"))) - } - Value::Object(o) => { - let mut out = serde_json::Map::with_capacity(o.len()); - for (k, x) in o { - out.insert(k.clone(), resolve_step_refs(x, results, step, depth + 1)?); - } - Ok(Value::Object(out)) - } - Value::Array(a) => a.iter().map(|x| resolve_step_refs(x, results, step, depth + 1)).collect::>>().map(Value::Array), - _ => Ok(v.clone()), - } -} - /// One undo step. #[derive(Clone, Debug)] pub struct HistoryEntry { @@ -1245,28 +1206,30 @@ impl Session { } /// Run several commands as one undo step. A param value `{"$step": n}` is replaced by the `id` - /// in the result of the earlier step `n` (`{"$step": n, "field": "…"}` picks another field), - /// so a step can target a layer that an earlier step of the same batch created. Any object - /// with a `$step` key in a step's params is such a reference, except inside a nested - /// `command.batch` step: its references are to its own steps. - pub fn batch(&mut self, label: &str, cmds: &[(String, Value)]) -> Result> { + /// in the result of the earlier step `n`, and `{"$ref": "name"}` by the `id` in the result of + /// the earlier step whose `as` is `name`; either takes a `field`, a key or slash path (`ids/0`) + /// into that result. So a step can target a layer that an earlier step of the same batch + /// created. Any object with a `$step` or `$ref` key in a step's params is such a reference, + /// except inside a nested `command.batch` step: its references are to its own steps. + pub fn batch(&mut self, label: &str, steps: &[BatchStep]) -> Result> { + let mut scope = BatchScope::new(steps)?; self.grouped(label, |s| { - let mut results: Vec = Vec::with_capacity(cmds.len()); - for (step, (id, p)) in cmds.iter().enumerate() { - let v = s.batch_step(&results, step, id, p)?; - results.push(v); + for step in steps { + s.batch_step(&mut scope, &step.command, &step.params)?; } - Ok(results) + Ok(scope.into_results()) }) } - /// One step of a batch: `{"$step": n}` in `params` resolves against `results` (the results of - /// the steps before it), then the command runs. [`Session::batch`] runs a list of these as one - /// undo step; a caller with its own list — the CLI's script runner — uses this so its steps - /// resolve `$step` the same way, inside its own [`Session::grouped`]. - pub fn batch_step(&mut self, results: &[Value], step: usize, cmd: &str, params: &Value) -> Result { - let p = if cmd == "command.batch" { params.clone() } else { resolve_step_refs(params, results, step, 0)? }; - self.execute(cmd, &p) + /// The next step of a batch: the references in `params` resolve against `scope` (the steps + /// before it), the command runs and its result joins `scope`. [`Session::batch`] runs a list + /// of these as one undo step; a caller with its own list — the CLI's script runner — uses this + /// so its steps resolve references the same way, inside its own [`Session::grouped`]. + pub fn batch_step(&mut self, scope: &mut BatchScope, cmd: &str, params: &Value) -> Result<()> { + let p = if cmd == "command.batch" { params.clone() } else { scope.resolve(params)? }; + let v = self.execute(cmd, &p)?; + scope.push(v); + Ok(()) } /// Run `f` as one undo step called `label`: the commands it executes push no steps of their diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index 646c7c4b0..4b811673a 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -425,6 +425,11 @@ fn every_command_survives_junk_params() { // Rotation origins and placing with a tool as junk. json!({"tool": [1], "x": 1e308, "y": "NaN", "reset": "maybe", "on": {"x": 1}}), json!({"tool": "frame", "x": -1e308, "y": 1e308, "reset": true, "on": "yes"}), + // Batch step names and reference paths as junk. + json!({"commands": [{"command": "select.none", "as": "a"}, {"command": "select.none", "as": [1]}, {"command": "select.none", "as": "a"}]}), + json!({"commands": [{"command": "select.all", "as": "\u{0}"}, {"command": "node.set", "params": {"ids": [ + {"$ref": "\u{0}", "field": "ids/18446744073709551616/x"}, {"$ref": {"x": 1}}, {"$step": 0, "field": "//"}, {"$ref": "\u{0}", "field": "/"}], + "props": {"name": {"$ref": "nope", "field": 5}}}}]}), ]; for spec in all_commands() { if matches!( diff --git a/crates/mcp/src/tools.rs b/crates/mcp/src/tools.rs index 7714da5a3..1e4c887fa 100644 --- a/crates/mcp/src/tools.rs +++ b/crates/mcp/src/tools.rs @@ -128,10 +128,10 @@ pub fn tool_definitions() -> Vec { tool( "batch", "Run commands as one step", - "Run several commands in order as ONE undo step (engine `command.batch`). If any command fails, everything is rolled back and the error names the failing step. Returns an array of the results in order. A later step can use a layer an earlier step created: anywhere in its params, {\"$step\": n} stands for the `id` in step n's result (zero-based; {\"$step\": n, \"field\": \"…\"} picks another field). Example: [{\"command\":\"node.create\",\"params\":{\"type\":\"frame\"}}, {\"command\":\"node.create\",\"params\":{\"type\":\"text\",\"text\":\"Hi\",\"parent\":{\"$step\":0}}}] builds a frame and a text inside it in one call.", + "Run several commands in order as ONE undo step (engine `command.batch`). If any command fails, everything is rolled back and the error names the failing step. Returns an array of the results in order. A later step can use what an earlier step returned: name a step with \"as\": \"card\", then anywhere in a later step's params {\"$ref\": \"card\"} stands for the `id` in its result ({\"$step\": n} does the same by zero-based position). Add \"field\" for another part of the result: a key or a slash path, e.g. {\"$ref\": \"copy\", \"field\": \"ids/0\"} for the first id edit.duplicate returned. Any object with a `$ref` or `$step` key is a reference. Example: [{\"command\":\"node.create\",\"as\":\"card\",\"params\":{\"type\":\"frame\"}}, {\"command\":\"node.create\",\"params\":{\"type\":\"text\",\"text\":\"Hi\",\"parent\":{\"$ref\":\"card\"}}}] builds a frame and a text inside it in one call.", obj( json!({ - "commands": {"type": "array", "minItems": 1, "description": "Steps to run", "items": obj(json!({"command": string("Command id"), "params": {"type": "object"}}), &["command"])}, + "commands": {"type": "array", "minItems": 1, "description": "Steps to run", "items": obj(json!({"command": string("Command id"), "params": {"type": "object"}, "as": string("Name for this step, unique in the batch; later steps use its result with {\"$ref\": name}")}), &["command"])}, "label": string("Undo history label (default \"Batch\")"), }), &["commands"], @@ -497,7 +497,11 @@ fn batch(b: &mut dyn Backend, a: &Map) -> Result Date: Wed, 21 Oct 2026 11:21:24 -0700 Subject: [PATCH 458/817] Let node.set replace a vector's path node.set took no `path`, so redrawing a vector meant deleting and recreating it and losing its id, place in the layer list, paints, styles, bindings and step references. `path` now takes SVG path data for vector layers and replaces the geometry through the same reader node.create uses (path_network, shared with create). width/height in the same call scale it as create does. The path's own box goes at the layer's current origin, so rotation and flips stay; with x/y in the same call it goes at x/y plus the box's offset, which is where create puts it. On several layers, layers that aren't vectors are skipped with a warning, as auto layout keys already are (the skip logic is shared now). A single non-vector is refused, and so is a vector inside an instance: there is no geometry override, so the next sync would undo it. Data that doesn't parse, draws nothing or has non-finite bounds is refused cleanly; create now refuses non-finite bounds too. Tests cover keeping the layer, placement and scaling against create, rotation, undo/redo, invalid data, non-vectors, instances, boolean operands, edit mode, and a junk-path sweep. The engine-wide junk sweep has node.set path entries. Fixes #1001 Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/create.rs | 57 +++-- crates/engine/src/cmd/edit.rs | 57 +++-- crates/engine/src/cmd/props.rs | 39 ++- crates/engine/src/lib.rs | 2 + crates/engine/src/tests.rs | 4 + crates/engine/src/vector_path_set_tests.rs | 263 +++++++++++++++++++++ docs/mcp.md | 11 + 7 files changed, 391 insertions(+), 42 deletions(-) create mode 100644 crates/engine/src/vector_path_set_tests.rs diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index 3a9f6d67f..013b7f56b 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -166,6 +166,42 @@ pub fn parse_path_data(d: &str) -> Option { figcraft_geom::BezPath::from_svg(d).ok() } +/// A vector's geometry made from SVG path data (see [`path_network`]). +pub(crate) struct PathShape { + /// The network, with the path's own box moved to the origin and scaled to the size asked for. + pub network: VectorNetwork, + pub width: f64, + pub height: f64, + /// Where the path's own box starts in its coordinates (unscaled). + pub offset: (f64, f64), +} + +/// The network SVG path data `d` draws, for `node.create` and `node.set`: the path's own box moves +/// to the origin, and `width`/`height` scale it as [`vector_scale`] says. Data that doesn't parse +/// or draws nothing is refused. +pub(crate) fn path_network(cmd: &str, d: &str, width: Option, height: Option) -> Result { + use figcraft_geom::Shape; + let empty = || bad(cmd, "`path` draws nothing: a vector needs a visible line or area"); + let mut path = parse_path_data(d).ok_or_else(|| bad(cmd, "`path` is not valid SVG path data"))?; + let bb = path.bounding_box(); + if !(bb.x0.is_finite() && bb.y0.is_finite() && bb.width().is_finite() && bb.height().is_finite()) { + return Err(bad(cmd, "`path` has coordinates too large to draw")); + } + if bb.width() <= 1e-9 && bb.height() <= 1e-9 { + return Err(empty()); + } + path.apply_affine(figcraft_geom::Affine::translate((-bb.x0, -bb.y0))); + let (sx, sy) = vector_scale(width, height, bb.width(), bb.height(), "a path").map_err(|e| bad(cmd, e))?; + if sx != 1.0 || sy != 1.0 { + path.apply_affine(figcraft_geom::Affine::scale_non_uniform(sx, sy)); + } + let network = VectorNetwork::from_path(&path); + if network.segments.is_empty() { + return Err(empty()); + } + Ok(PathShape { network, width: bb.width() * sx, height: bb.height() * sy, offset: (bb.x0, bb.y0) }) +} + /// How much a vector's path is scaled to take the size asked for: with both sides, each scales /// independently (as resizing a vector does); with one, the other keeps its proportion. A size on /// an axis the geometry has none of is an error unless it is 0 (a line's height), and a size of 0 @@ -228,27 +264,12 @@ pub fn create(s: &mut Session, p: &Value) -> Result { let asked = (num(p, "width"), num(p, "height")); if let NodeKind::Vector { network } = &mut kind { if let Some(d) = string(p, "path") { - let mut path = parse_path_data(&d).ok_or_else(|| bad(cmd, "`path` is not valid SVG path data"))?; - use figcraft_geom::Shape; - let bb = path.bounding_box(); - if bb.width() <= 1e-9 && bb.height() <= 1e-9 { - return Err(bad(cmd, "`path` draws nothing: a vector needs a visible line or area")); - } - path.apply_affine(figcraft_geom::Affine::translate((-bb.x0, -bb.y0))); - let (sx, sy) = vector_scale(asked.0, asked.1, bb.width(), bb.height(), "a path").map_err(|e| bad(cmd, e))?; - if sx != 1.0 || sy != 1.0 { - path.apply_affine(figcraft_geom::Affine::scale_non_uniform(sx, sy)); - } - *network = VectorNetwork::from_path(&path); - if network.segments.is_empty() { - return Err(bad(cmd, "`path` draws nothing: a vector needs a visible line or area")); - } + let shape = path_network(cmd, &d, asked.0, asked.1)?; + *network = shape.network; if boolean(p, "closed") == Some(false) { network.regions.clear(); } - w = bb.width() * sx; - h = bb.height() * sy; - offset = (bb.x0, bb.y0); + (w, h, offset) = (shape.width, shape.height, shape.offset); } else if let Some(Value::Array(pts)) = get(p, "points") { let pts: Vec = pts.iter().filter_map(|v| Some(Point::new(f64_of(v.get(0)?)?, f64_of(v.get(1)?)?))).collect(); if pts.len() < 2 { diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index a16fbb386..422c75eb4 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -4,7 +4,7 @@ use std::collections::{BTreeMap, BTreeSet}; use figcraft_doc::*; use figcraft_geom::Affine; -use serde_json::{Value, json}; +use serde_json::{Map, Value, json}; use super::{CommandSpec, ok}; use crate::params::*; @@ -1159,6 +1159,9 @@ fn find_replace(s: &mut Session, p: &Value) -> Result { Ok(json!({"matches": hits})) } +/// Keys only some layer types take, the test for those layers, and why the others skip them. +type TypedKeys<'a> = (&'a [&'a str], &'a dyn Fn(&Node) -> bool, &'a str); + fn set(s: &mut Session, p: &Value) -> Result { let ids = req_targets("node.set", s, p)?; let props = match get(p, "props") { @@ -1189,34 +1192,44 @@ fn set(s: &mut Session, p: &Value) -> Result { None => Vec::new(), }; let mut warnings = font_style_warnings(&s.ds()?.doc, &ids, &props); - // Auto layout keys go to the layers that can have auto layout; with none among the targets, - // the first refuses them (`props::layout_mut`). + // Type-specific keys go to the layers that take them and are skipped, with a warning, on the + // others: auto layout keys to frame-like layers, `path` to vectors. With none among the targets + // that take them, the first refuses them (`props::layout_mut`, `props::apply`). + let doc = &s.ds()?.doc; let layout_keys: Vec<&str> = props.keys().map(String::as_str).filter(|k| super::props::LAYOUT_KEYS.contains(k)).collect(); - let mut without_layout = props.clone(); - let mut skipped = BTreeSet::new(); - if !layout_keys.is_empty() { - let doc = &s.ds()?.doc; - let frame_like = |i: &NodeId| doc.node(*i).is_some_and(|n| n.kind.is_frame_like()); - if ids.iter().any(frame_like) { - skipped = ids.iter().copied().filter(|i| !frame_like(i)).collect(); - without_layout.retain(|k, _| !layout_keys.contains(&k.as_str())); + let path_keys: Vec<&str> = props.keys().map(String::as_str).filter(|k| *k == "path").collect(); + let frame_like = |n: &Node| n.kind.is_frame_like(); + let vector = |n: &Node| matches!(n.kind, NodeKind::Vector { .. }); + let typed: [TypedKeys; 2] = [ + (&layout_keys, &frame_like, "only frames, components and instances have auto layout"), + (&path_keys, &vector, "only vector layers have a path"), + ]; + let mut skipped: BTreeMap> = BTreeMap::new(); + for (keys, takes, why) in typed { + let takes = |i: &NodeId| doc.node(*i).is_some_and(takes); + if keys.is_empty() || !ids.iter().any(takes) { + continue; } - if !skipped.is_empty() { - let names: Vec = - skipped.iter().take(10).filter_map(|i| doc.node(*i)).map(|n| format!("{} “{}” ({})", n.id, n.name, n.kind.type_name())).collect(); - let more = if skipped.len() > names.len() { format!(" and {} more", skipped.len() - names.len()) } else { String::new() }; - warnings.push(format!( - "{} skipped on {}{more}: only frames, components and instances have auto layout", - layout_keys.iter().map(|k| format!("`{k}`")).collect::>().join(", "), - names.join(", ") - )); + let others: Vec = ids.iter().copied().filter(|i| !takes(i)).collect(); + if others.is_empty() { + continue; } + for i in &others { + skipped.entry(*i).or_insert_with(|| props.clone()).retain(|k, _| !keys.contains(&k.as_str())); + } + let names: Vec = + others.iter().take(10).filter_map(|i| doc.node(*i)).map(|n| format!("{} “{}” ({})", n.id, n.name, n.kind.type_name())).collect(); + let more = if others.len() > names.len() { format!(" and {} more", others.len() - names.len()) } else { String::new() }; + warnings.push(format!( + "{} skipped on {}{more}: {why}", + keys.iter().map(|k| format!("`{k}`")).collect::>().join(", "), + names.join(", ") + )); } let doc = s.doc_mut()?; let before = super::styles::bound_before(doc, &ids); for i in ids { - let props = if skipped.contains(&i) { &without_layout } else { &props }; - super::props::apply("node.set", doc, i, props)?; + super::props::apply("node.set", doc, i, skipped.get(&i).unwrap_or(&props))?; } super::styles::detach_edited(doc, &before); if let Some(o) = pivot { diff --git a/crates/engine/src/cmd/props.rs b/crates/engine/src/cmd/props.rs index f180b53c8..67e228348 100644 --- a/crates/engine/src/cmd/props.rs +++ b/crates/engine/src/cmd/props.rs @@ -26,7 +26,9 @@ fontSize, lineHeight (auto|px|\"150%\"), letterSpacing (px|\"2%\"), textAlign (l textDecorationColor (colour, or auto/null: the text's), textCase (original|upper|lower|title|smallCaps), paragraphSpacing, paragraphIndent, \ listStyle (none|bulleted|numbered; with start/end: the paragraphs those chars touch), indentation (list nesting level 0-8, same range rule), \ listSpacing (px between list items, in place of paragraphSpacing), hangingPunctuation, hangingList (markers outside the box), leadingTrim (vertical trim: none|capHeight), maxLines, features ({tag: bool}, e.g. {\"liga\": false, \"tnum\": true}), \ -fontVariations / variationSettings ({axis: number}, e.g. {\"wght\": 550, \"wdth\": 85}; null = none), pointCount, innerRadius, arcStart, arcSweep, \ +fontVariations / variationSettings ({axis: number}, e.g. {\"wght\": 550, \"wdth\": 85}; null = none), \ +path (a vector's SVG path data: replaces its geometry, keeping the layer, its paints, styles and bindings; width/height in the same call scale it as \ +node.create does; its own box goes at the layer's x/y, or with x/y given, at x + its left edge and y + its top as node.create places it), pointCount, innerRadius, arcStart, arcSweep, \ arcInner, booleanOperation (a boolean group's operation, or an operand's own; null: the group's), operandOperation (a layer in a boolean \ group: how it combines with the operands below it; null: the group's), constrainProportions, description, interactions, overflow, pluginData {k: v}"; @@ -376,7 +378,7 @@ fn set_paints(n: &mut Node, fills: bool, paints: Vec) { /// bindings last so paints set in the same call don't detach them. fn apply_order(k: &str) -> u8 { match k { - "width" | "height" | "w" | "h" => 0, + "path" | "width" | "height" | "w" | "h" => 0, "rotation" => 2, "x" | "y" => 3, "boundVariables" => 4, @@ -389,11 +391,17 @@ pub fn apply(cmd: &str, doc: &mut Document, id: NodeId, props: &Map = props.iter().collect(); keys.sort_by_key(|(k, _)| apply_order(k)); + // Where a new `path` had its own box, for `x`/`y` in the same call (as `node.create` places it). + let mut path_offset = (0.0, 0.0); for (k, v) in keys { let k = k.as_str(); match k { + "path" => path_offset = set_path(cmd, doc, id, v, props)?, + // A new path takes the size asked for as its scale (`set_path`). + "width" | "height" | "w" | "h" if props.contains_key("path") => {} "x" | "y" => { let val = f64_of(v).ok_or_else(|| bad(cmd, format!("`{k}` must be a number")))?; + let val = val + if k == "x" { path_offset.0 } else { path_offset.1 }; // X/Y are the node's own origin (its rotated top-left for rotated nodes), in the // frame it is in (groups have no space of their own). let n = doc.get(id)?; @@ -920,6 +928,33 @@ pub fn apply(cmd: &str, doc: &mut Document, id: NodeId, props: &Map) -> Result<(f64, f64)> { + let d = v.as_str().ok_or_else(|| bad(cmd, "`path` must be SVG path data (a string)"))?; + let n = doc.get(id)?; + if !matches!(n.kind, NodeKind::Vector { .. }) { + return Err(bad(cmd, format!("`path` applies to vector layers, and layer {} “{}” is a {}", n.id, n.name, n.kind.type_name()))); + } + if crate::components::inside_instance(doc, id) { + return Err(bad(cmd, format!("`path`: layer {} “{}” is inside an instance: edit its main component, or detach the instance", n.id, n.name))); + } + let size = |long: &str, short: &str| -> Result> { + props.get(long).or_else(|| props.get(short)).map(|v| f64_of(v).ok_or_else(|| bad(cmd, format!("`{long}` must be a number")))).transpose() + }; + let shape = super::create::path_network(cmd, d, size("width", "w")?, size("height", "h")?)?; + let n = doc.get_mut(id)?; + if let NodeKind::Vector { network } = &mut n.kind { + *network = shape.network; + } + n.width = shape.width; + n.height = shape.height; + Ok(shape.offset) +} + /// The override group a property key belongs to. pub fn override_group(k: &str) -> &'static str { match k { diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 79e7be0d5..bfc7f3c25 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1891,6 +1891,8 @@ mod vector_multi_behaviour_tests; #[cfg(test)] mod vector_offset_tests; #[cfg(test)] +mod vector_path_set_tests; +#[cfg(test)] mod version_preview_tests; #[cfg(test)] mod version_tests; diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index 646c7c4b0..b5cdd7fa8 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -425,6 +425,10 @@ fn every_command_survives_junk_params() { // Rotation origins and placing with a tool as junk. json!({"tool": [1], "x": 1e308, "y": "NaN", "reset": "maybe", "on": {"x": 1}}), json!({"tool": "frame", "x": -1e308, "y": 1e308, "reset": true, "on": "yes"}), + // Vector paths (`node.set {path}`) as junk. (Not a string `path` at the top: file commands + // would write to it.) + json!({"ids": [2, 3], "type": "vector", "path": [5], "width": -1e308, "props": {"path": "M0 0 L1e308 0 L-1e308 1e308", "height": "NaN", "x": 1e308}}), + json!({"id": 2, "type": "vector", "path": {"d": 1}, "props": {"path": "M NaN 0 Z", "width": 1e-308}}), ]; for spec in all_commands() { if matches!( diff --git a/crates/engine/src/vector_path_set_tests.rs b/crates/engine/src/vector_path_set_tests.rs new file mode 100644 index 000000000..7e7148534 --- /dev/null +++ b/crates/engine/src/vector_path_set_tests.rs @@ -0,0 +1,263 @@ +//! `node.set {path}` replaces a vector's geometry and keeps the layer (#1001): its id, name, place in +//! the layer list, paints, effects, styles, bindings and constraints. The path is read as +//! `node.create` reads it (`width`/`height` scale it), its own box goes at the layer's origin (or at +//! `x`/`y` plus the box's offset, as create places it), undo brings the old path back, and data that +//! can't draw, layers that aren't vectors and layers inside an instance are refused. + +use figcraft_doc::{NodeId, NodeKind, VectorNetwork}; +use serde_json::{Value, json}; + +use crate::{EngineError, Session}; + +fn ex(s: &mut Session, cmd: &str, p: Value) -> Value { + s.execute(cmd, &p).unwrap_or_else(|e| panic!("{cmd}: {e}")) +} + +fn id(v: &Value) -> NodeId { + crate::params::id_of(&v["id"]).unwrap() +} + +fn vector(s: &mut Session, p: Value) -> NodeId { + let mut p = p; + p["type"] = json!("vector"); + id(&ex(s, "node.create", p)) +} + +fn net(s: &Session, v: NodeId) -> VectorNetwork { + crate::vectoredit::network(s.doc().unwrap(), v).unwrap().clone() +} + +/// The layer's x, y, width and height as `get_node` reports them. +fn frame(s: &Session, v: NodeId) -> (f64, f64, f64, f64) { + let d = crate::cmd::props::describe(s.doc().unwrap(), v); + let f = |k: &str| d[k].as_f64().unwrap(); + (f("x"), f("y"), f("width"), f("height")) +} + +fn bad_msg(r: crate::Result) -> String { + match r { + Err(EngineError::BadParams { msg, .. }) => msg, + other => panic!("expected BadParams, got {other:?}"), + } +} + +#[test] +fn a_new_path_keeps_the_layer() { + let mut s = Session::new(); + ex(&mut s, "variable.createCollection", json!({"name": "T"})); + ex(&mut s, "variable.create", json!({"collection": "T", "name": "brand", "type": "color", "value": "#FF0000"})); + let below = vector(&mut s, json!({"path": "M0 0 L5 5"})); + let v = vector(&mut s, json!({"name": "Chart line", "path": "M0 0 L10 10", "x": 40, "y": 30})); + let above = vector(&mut s, json!({"path": "M0 0 L5 5"})); + ex( + &mut s, + "node.set", + json!({"id": v, "props": {"stroke": "#00FF00", "strokeWeight": 3, "opacity": 0.5, + "effects": [{"type": "dropShadow", "color": "#00000040", "offset": [0, 2], "radius": 4}], + "constraints": {"horizontal": "right", "vertical": "bottom"}}}), + ); + ex(&mut s, "variable.bind", json!({"ids": [v], "field": "fill", "variable": "brand"})); + let before = s.doc().unwrap().node(v).unwrap().clone(); + + let out = ex(&mut s, "node.set", json!({"ids": [v], "props": {"path": "M0 0 L20 0 L20 8 Z"}})); + assert!(out.get("warnings").is_none(), "{out}"); + let doc = s.doc().unwrap(); + let n = doc.node(v).unwrap(); + assert_eq!((n.id, n.name.as_str()), (v, "Chart line")); + assert_eq!((&n.fills, &n.strokes, &n.stroke, &n.effects), (&before.fills, &before.strokes, &before.stroke, &before.effects)); + assert_eq!((n.opacity, &n.bound, &n.styles, &n.constraints), (before.opacity, &before.bound, &before.styles, &before.constraints)); + assert!(n.bound.contains_key("fill"), "the fill stays bound"); + let page = doc.node(n.parent.unwrap()).unwrap(); + assert_eq!(page.children, [below, v, above], "same place in the layer list"); + // The new geometry, at the layer's origin. + assert_eq!(frame(&s, v), (40.0, 30.0, 20.0, 8.0)); + let net = net(&s, v); + assert_eq!((net.vertices.len(), net.regions.len()), (3, 1), "a closed triangle: {net:?}"); +} + +#[test] +fn width_height_and_x_y_follow_node_create() { + // Each row: props given with the path, and the frame node.set gives a layer at (100, 50). + let rows: [(Value, (f64, f64, f64, f64)); 6] = [ + // The path's own box goes at the layer's origin: its offset (5, 5) doesn't move it. + (json!({}), (100.0, 50.0, 10.0, 20.0)), + // Both sides scale independently; one keeps the proportion. + (json!({"width": 30, "height": 10}), (100.0, 50.0, 30.0, 10.0)), + (json!({"w": 20}), (100.0, 50.0, 20.0, 40.0)), + // With x/y the path's offset is added, as create places it. + (json!({"x": 0, "y": 0}), (5.0, 5.0, 10.0, 20.0)), + (json!({"x": 10, "height": 10}), (15.0, 50.0, 5.0, 10.0)), + (json!({"x": 10, "y": 20, "width": 20, "height": 10}), (15.0, 25.0, 20.0, 10.0)), + ]; + for (extra, want) in rows { + let mut s = Session::new(); + let v = vector(&mut s, json!({"path": "M0 0 L1 1", "x": 100, "y": 50})); + let mut props = json!({"path": "M5 5 L15 5 L15 25 Z"}); + props.as_object_mut().unwrap().extend(extra.as_object().unwrap().clone()); + ex(&mut s, "node.set", json!({"ids": [v], "props": props})); + assert_eq!(frame(&s, v), want, "{extra}"); + // With both x and y, create makes the same layer. (With one, the other axis keeps the + // layer's current place.) + if extra.get("x").is_some() && extra.get("y").is_some() { + let c = vector(&mut s, props.clone()); + assert_eq!(frame(&s, c), want, "create {extra}"); + } + } +} + +#[test] +fn rotation_stays_and_turns_about_the_new_box() { + let mut s = Session::new(); + let v = vector(&mut s, json!({"path": "M0 0 L10 10", "x": 0, "y": 0})); + ex(&mut s, "node.set", json!({"ids": [v], "props": {"rotation": 90}})); + let t = s.doc().unwrap().node(v).unwrap().transform; + ex(&mut s, "node.set", json!({"ids": [v], "props": {"path": "M0 0 L40 0 L40 20 Z"}})); + let n = s.doc().unwrap().node(v).unwrap(); + assert_eq!(n.transform, t, "the layer keeps its origin and rotation"); + assert_eq!((n.width, n.height), (40.0, 20.0)); +} + +#[test] +fn undo_brings_the_old_path_back() { + let mut s = Session::new(); + let v = vector(&mut s, json!({"path": "M0 0 L10 10", "x": 3, "y": 4})); + let (old_net, old_frame) = (net(&s, v), frame(&s, v)); + ex(&mut s, "node.set", json!({"ids": [v], "props": {"path": "M0 0 C10 0 20 10 20 20", "width": 50}})); + let (new_net, new_frame) = (net(&s, v), frame(&s, v)); + assert_ne!(new_net, old_net); + ex(&mut s, "edit.undo", json!({})); + assert_eq!((net(&s, v), frame(&s, v)), (old_net, old_frame)); + ex(&mut s, "edit.redo", json!({})); + assert_eq!((net(&s, v), frame(&s, v)), (new_net, new_frame)); +} + +#[test] +fn data_that_cant_draw_is_refused_and_nothing_changes() { + let mut s = Session::new(); + let v = vector(&mut s, json!({"path": "M0 0 L10 10", "name": "V"})); + let before = s.doc().unwrap().node(v).unwrap().clone(); + for (props, says) in [ + (json!({"path": "not a path"}), "not valid SVG path data"), + (json!({"path": "M0 0 L10"}), "not valid SVG path data"), + (json!({"path": ""}), "draws nothing"), + (json!({"path": "M5 5"}), "draws nothing"), + (json!({"path": "M5 5 L5 5 Z"}), "draws nothing"), + (json!({"path": "M0 0 L1e308 0 L-1e308 0"}), "too large"), + (json!({"path": 5}), "must be SVG path data"), + (json!({"path": null}), "must be SVG path data"), + (json!({"path": "M0 0 L10 10", "width": 0}), "positive"), + (json!({"path": "M0 0 L10 10", "height": -4}), "positive"), + (json!({"path": "M0 0 L10 10", "width": "wide"}), "must be a number"), + // A size on an axis the path has none of. + (json!({"path": "M0 0 L10 0", "height": 5}), "no vertical extent"), + (json!({"path": "M0 0 L10 10", "name": "renamed", "width": -1}), "positive"), + ] { + let msg = bad_msg(s.execute("node.set", &json!({"ids": [v], "props": props}))); + assert!(msg.contains(says), "{props}: {msg}"); + assert_eq!(s.doc().unwrap().node(v).unwrap(), &before, "{props} changed nothing"); + } + // A horizontal line can still be given height 0, as create allows. + ex(&mut s, "node.set", json!({"ids": [v], "props": {"path": "M0 0 L10 0", "height": 0}})); + assert_eq!(frame(&s, v).2, 10.0); +} + +#[test] +fn layers_that_arent_vectors_are_refused_alone_and_skipped_among_vectors() { + let mut s = Session::new(); + let r = id(&ex(&mut s, "node.create", json!({"type": "rectangle", "name": "Box"}))); + let star = id(&ex(&mut s, "node.create", json!({"type": "star"}))); + let msg = bad_msg(s.execute("node.set", &json!({"ids": [r], "props": {"path": "M0 0 L5 5"}}))); + assert!(msg.contains("vector") && msg.contains("Box"), "{msg}"); + assert!(s.execute("node.set", &json!({"ids": [r, star], "props": {"path": "M0 0 L5 5"}})).is_err(), "no vector among them"); + assert!(matches!(s.doc().unwrap().node(r).unwrap().kind, NodeKind::Rectangle)); + + let v = vector(&mut s, json!({"path": "M0 0 L10 10"})); + let out = ex(&mut s, "node.set", json!({"ids": [r, v], "props": {"path": "M0 0 L30 0", "opacity": 0.5}})); + let w = out["warnings"][0].as_str().unwrap(); + assert!(w.contains("`path` skipped on") && w.contains("Box") && w.contains("vector"), "{w}"); + let doc = s.doc().unwrap(); + assert_eq!((doc.node(r).unwrap().width, doc.node(r).unwrap().opacity), (100.0, 0.5), "the rectangle gets the other keys"); + assert_eq!(frame(&s, v).2, 30.0); +} + +#[test] +fn a_vector_inside_an_instance_is_refused_and_its_main_reaches_it() { + let mut s = Session::new(); + let f = id(&ex(&mut s, "node.create", json!({"type": "frame", "width": 50, "height": 50}))); + let v = vector(&mut s, json!({"path": "M0 0 L10 10", "parent": f})); + let comp = id(&ex(&mut s, "component.create", json!({"ids": [f]}))); + let inst = id(&ex(&mut s, "instance.create", json!({"component": comp, "x": 200, "y": 0}))); + let copy = s.doc().unwrap().node(inst).unwrap().children[0]; + assert!(matches!(s.doc().unwrap().node(copy).unwrap().kind, NodeKind::Vector { .. })); + let msg = bad_msg(s.execute("node.set", &json!({"ids": [copy], "props": {"path": "M0 0 L30 0"}}))); + assert!(msg.contains("inside an instance"), "{msg}"); + // The main's vector takes it, and the instance follows. + let main_vector = s.doc().unwrap().node(comp).unwrap().children[0]; + assert_eq!(main_vector, v); + ex(&mut s, "node.set", json!({"ids": [main_vector], "props": {"path": "M0 0 L30 0 L30 12 Z"}})); + assert_eq!(net(&s, copy), net(&s, main_vector)); + assert_eq!((frame(&s, copy).2, frame(&s, copy).3), (30.0, 12.0)); +} + +#[test] +fn a_boolean_operand_takes_a_new_path_and_the_group_follows() { + let mut s = Session::new(); + let a = vector(&mut s, json!({"path": "M0 0 L40 0 L40 40 L0 40 Z"})); + let b = vector(&mut s, json!({"path": "M0 0 L40 0 L40 40 L0 40 Z", "x": 20, "y": 20})); + let g = id(&ex(&mut s, "bool.union", json!({"ids": [a, b]}))); + assert_eq!(s.doc().unwrap().node(b).unwrap().parent, Some(g)); + ex(&mut s, "node.set", json!({"ids": [b], "props": {"path": "M0 0 L100 0 L100 100 L0 100 Z"}})); + let bounds = s.doc().unwrap().world_bounds(g).unwrap(); + assert_eq!((bounds.width(), bounds.height()), (120.0, 120.0), "{bounds:?}"); +} + +#[test] +fn junk_paths_never_panic() { + let long = "M0 0 ".to_string() + &"L1 1 ".repeat(5000); + let junk = [ + json!("M"), + json!("Z"), + json!("M0 0 Z Z Z"), + json!("M NaN 0 L 1 1"), + json!("M inf 0 L 1 1"), + json!("M0 0 L1e308 1e308"), + json!("M-1e308 -1e308 L1e308 1e308"), + json!("M0 0 A 1e308 1e308 0 1 1 10 10"), + json!("M0 0 A 0 0 0 0 0 10 10"), + json!("m0 0 l1 1 h-1e308 v1e308 z"), + json!("M0 0 Q 5 5"), + json!("M0,0L10,10\u{0}"), + json!("\u{1F4A5}"), + json!(long), + json!([1, 2]), + json!({"d": "M0 0 L1 1"}), + json!(true), + ]; + let sizes = [json!(null), json!(1e308), json!(-1e308), json!(1e-308), json!("NaN"), json!([1])]; + let mut s = Session::new(); + let v = vector(&mut s, json!({"path": "M0 0 L10 10"})); + for path in &junk { + for size in &sizes { + for props in [json!({"path": path, "width": size}), json!({"path": path, "height": size, "x": size, "rotation": size})] { + if let Err(EngineError::Internal { msg, .. }) = s.execute("node.set", &json!({"ids": [v], "props": props})) { + panic!("node.set panicked on {props}: {msg}"); + } + let n = s.doc().unwrap().node(v).unwrap(); + assert!(n.width.is_finite() && n.height.is_finite() && n.transform.as_coeffs().iter().all(|c| c.is_finite()), "{props}"); + } + } + } +} + +#[test] +fn a_new_path_while_editing_drops_points_that_are_gone() { + let mut s = Session::new(); + let v = vector(&mut s, json!({"path": "M0 0 L10 0 L10 10 L0 10 Z"})); + ex(&mut s, "vector.edit.begin", json!({"id": v})); + ex(&mut s, "vector.edit.selectAll", json!({})); + ex(&mut s, "node.set", json!({"ids": [v], "props": {"path": "M0 0 L20 0"}})); + let ve = s.ds().unwrap().vector_edit.clone().expect("still editing"); + let n = net(&s, v); + assert!(ve.vertices.iter().all(|i| *i < n.vertices.len()) && ve.segments.iter().all(|i| *i < n.segments.len()), "{ve:?}"); + ex(&mut s, "vector.edit.state", json!({})); +} diff --git a/docs/mcp.md b/docs/mcp.md index dfea95cc2..ac3be60e3 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -448,6 +448,17 @@ its proportion). A path or point set that draws nothing is refused instead of ma 0×0 layer, as is a size on an axis the geometry has none of (except 0, such as a horizontal line's height) and a size of 0 or less on an axis it has, which would flatten it. +`node.set {path}` (or `set_properties`) replaces a vector's geometry with new SVG path data and +keeps the layer: its id, name, place in the layer list, paints, effects, styles, variable bindings +and constraints. The path is read as `vector.create` reads it, and `width`/`height` in the same call +scale it the same way. The path's own box goes at the layer's current x/y (rotation and flips +stay); with `x`/`y` in the same call it goes at `x` + its left edge and `y` + its top, as +`vector.create` places it. Points' own settings (per-point corner radius, caps, joins) go with the +old geometry. On several layers, layers that aren't vectors are skipped with a warning; on a +single one, or when none is a vector, the call is refused (convert shapes with +`vector.edit.begin` or Flatten first). A layer inside an instance is refused too: its geometry +comes from its main component, so edit that or detach the instance. Undo brings the old path back. + Vector edit mode is driven with `run_command` (or `pointer`/`key` for gestures): `vector.edit.begin {id? | ids?}` (default the selection; converts shapes to vectors; several layers are edited at once, the first active; `key` Enter with shapes selected does the same), From 014098b6c95294a92cfbc63cef9577bcb5896668 Mon Sep 17 00:00:00 2001 From: Kameron Date: Wed, 21 Oct 2026 11:27:46 -0700 Subject: [PATCH 459/817] fix(components): a boolean property's default is its bound layers' visibility on the main (#993) component.addProperty {type: "boolean", default: false, layer} hid the bound layer in new instances but left it showing in the main component, so the main didn't show its own default. On the main, a boolean property's value is now the visibility of the layers bound to it: - addProperty, bindProperty {field: "visible"} and editProperty {default} show or hide the main's bound layers to match the default (every variant of a set for editProperty). Without a default, addProperty takes the bound layer's current visibility instead of always `true`. - Showing or hiding a bound layer on the main sets the default, and the property's other bound layers (in every variant) follow. Edits inside instances stay overrides. - Existing instances keep their stored values; documents open as saved (no normalisation on load). Fixes #993 Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/component.rs | 18 ++++-- crates/engine/src/components.rs | 64 ++++++++++++++++++++ crates/engine/src/components_tests.rs | 84 +++++++++++++++++++++++++++ docs/mcp.md | 8 +++ 4 files changed, 170 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/component.rs b/crates/engine/src/cmd/component.rs index 6a5b10124..6b0e3e172 100644 --- a/crates/engine/src/cmd/component.rs +++ b/crates/engine/src/cmd/component.rs @@ -217,14 +217,14 @@ pub fn specs() -> Vec { spec!( "component.addProperty", "Add component property", - "{id? (component, set, or a layer inside a component: it gets bound), name, type: boolean|text|instanceSwap|variant|slot, default?, layer? (node bound to it; a frame for slots), preferred? (instance swap and slot properties: component or set ids offered first)}", + "{id? (component, set, or a layer inside a component: it gets bound), name, type: boolean|text|instanceSwap|variant|slot, default? (boolean: the bound layer's visibility in the main; without it, the layer's current visibility), layer? (node bound to it; a frame for slots), preferred? (instance swap and slot properties: component or set ids offered first)}", true, add_prop ), spec!( "component.editProperty", "Edit component property", - "{id? (component or set), name, newName?, default? (variant properties: that variant takes the top-left place), value? + newValue? (rename a variant value), index? (variant properties: move to this place; the variants' names follow), preferred? (instance swap and slot properties: component or set ids offered first)}", + "{id? (component or set), name, newName?, default? (variant properties: that variant takes the top-left place; boolean: the main's bound layers show or hide to match), value? + newValue? (rename a variant value), index? (variant properties: move to this place; the variants' names follow), preferred? (instance swap and slot properties: component or set ids offered first)}", true, edit_prop ), @@ -1141,7 +1141,8 @@ fn add_prop_for(cmd: &str, s: &mut Session, p: &Value) -> Result { } let layer_node = layer.and_then(|l| doc.node(l)).cloned(); let def = match t.to_ascii_lowercase().as_str() { - "boolean" | "bool" => PropDef::Boolean { default: boolean(p, "default").unwrap_or(true) }, + // Without a default, a bound layer keeps showing as it does: its visibility is the default. + "boolean" | "bool" => PropDef::Boolean { default: boolean(p, "default").or_else(|| layer_node.as_ref().map(|n| n.visible)).unwrap_or(true) }, "text" => PropDef::Text { default: string(p, "default") .or_else(|| layer_node.as_ref().and_then(|n| n.kind.text()).map(|t| t.characters.clone())) @@ -1245,7 +1246,12 @@ fn bind(cmd: &str, doc: &mut Document, layer: NodeId, property: Option<&str>, fi } _ => {} } - doc.get_mut(layer)?.prop_refs.insert(field.to_string(), property.to_string()); + let n = doc.get_mut(layer)?; + n.prop_refs.insert(field.to_string(), property.to_string()); + // On the main, a boolean property's value is the visibility of the layers it controls. + if let PropDef::Boolean { default } = def { + n.visible = *default; + } Ok(()) } @@ -1414,6 +1420,10 @@ fn edit_prop(s: &mut Session, p: &Value) -> Result { rename_prop_refs(doc, *c, &name, Some(nn))?; } } + // The main's bound layers show the new default. + if let PropDef::Boolean { default } = new_def { + set_boolean_default(doc, &comps, new_name.as_deref().unwrap_or(&name), default); + } ok() } diff --git a/crates/engine/src/components.rs b/crates/engine/src/components.rs index 67259d030..98fd85f10 100644 --- a/crates/engine/src/components.rs +++ b/crates/engine/src/components.rs @@ -1110,9 +1110,73 @@ fn geometry_derived(doc: &Document, before: &Document, id: NodeId, group: &str) false } +/// The components sharing the properties of component `c`: the variants of its set, or `c` alone. +pub fn property_owners(doc: &Document, c: NodeId) -> Vec { + match variant_set(doc, c).and_then(|s| doc.node(s)) { + Some(set) => set.children.iter().copied().filter(|v| doc.node(*v).is_some_and(|n| matches!(n.kind, NodeKind::Component { .. }))).collect(), + None => vec![c], + } +} + +/// Make `value` the default of boolean property `name` on components `comps`, showing or hiding +/// their layers bound to it: on a main component, a boolean property's value is the visibility of +/// its layers. Returns the components and layers it changed. +pub fn set_boolean_default(doc: &mut Document, comps: &[NodeId], name: &str, value: bool) -> Vec { + let mut out = Vec::new(); + for &c in comps { + let Some(NodeKind::Component { props, .. }) = doc.node(c).map(|n| &n.kind) else { continue }; + let Some(PropDef::Boolean { default }) = props.get(name) else { continue }; + if *default != value + && let Some(NodeKind::Component { props, .. }) = doc.node_mut(c).map(|n| &mut n.kind) + { + props.insert(name.to_string(), PropDef::Boolean { default: value }); + out.push(c); + } + // The main's own layers (not those of instances nested in it, which follow their mains). + let layers: Vec = doc + .subtree(c) + .into_iter() + .filter(|d| *d != c && !inside_instance(doc, *d)) + .filter(|d| doc.node(*d).is_some_and(|n| n.visible != value && n.prop_refs.get("visible").map(String::as_str) == Some(name))) + .collect(); + for d in layers { + if let Some(n) = doc.node_mut(d) { + n.visible = value; + out.push(d); + } + } + } + out +} + +/// A main component's layer bound to a boolean property was shown or hidden: that is the +/// property's new default, which its other bound layers (in every variant) take too. Returns the +/// components and layers that changed as a result. +fn follow_boolean_defaults(doc: &mut Document, before: &Document, changed: &[NodeId]) -> Vec { + let mut out = Vec::new(); + for &id in changed { + let (Some(n), Some(b)) = (doc.node(id), before.node(id)) else { continue }; + if n.visible == b.visible || inside_instance(doc, id) { + continue; + } + let Some(name) = n.prop_refs.get("visible").cloned() else { continue }; + let visible = n.visible; + let Some(c) = owning_component(doc, id).filter(|c| *c != id) else { continue }; + out.extend(set_boolean_default(doc, &property_owners(doc, c), &name, visible)); + } + out +} + /// After an edit: record overrides inside instances, then rebuild instances whose main changed, /// whose properties or main were switched, or whose overrides were reset. pub fn sync_after_edit(doc: &mut Document, before: &Document, changed: &[NodeId], touched: &BTreeSet) { + let mut changed = changed.to_vec(); + for id in follow_boolean_defaults(doc, before, &changed) { + if !changed.contains(&id) { + changed.push(id); + } + } + let changed = changed.as_slice(); // 0. A slot whose layers were added, removed or reordered holds the instance's own content // from now on; copies of instance layers placed elsewhere stop mirroring their main. for &id in changed { diff --git a/crates/engine/src/components_tests.rs b/crates/engine/src/components_tests.rs index 209560cdb..30254651a 100644 --- a/crates/engine/src/components_tests.rs +++ b/crates/engine/src/components_tests.rs @@ -429,6 +429,90 @@ fn component_properties_apply_to_instances() { healthy(&s); } +/// The default of boolean property `name` on component `c`. +fn bool_default(s: &Session, c: NodeId, name: &str) -> Option { + match &node(s, c).kind { + NodeKind::Component { props, .. } => match props.get(name) { + Some(PropDef::Boolean { default }) => Some(*default), + _ => None, + }, + _ => None, + } +} + +#[test] +fn boolean_property_default_is_the_mains_visibility() { + let mut s = Session::new(); + let (c, bg, title, dot) = card(&mut s); + // #993: a `false` default hides the bound layer in the main, not only in instances. + ex(&mut s, "component.addProperty", json!({"id": c, "name": "Show dot", "type": "boolean", "default": false, "layer": dot})); + assert!(!node(&s, dot).visible); + let i = idv(&ex(&mut s, "instance.create", json!({"component": c, "x": 300, "y": 0}))); + assert!(!node(&s, copy_of(&s, i, dot)).visible); + // Without a default, the property takes the layer's visibility. + ex(&mut s, "node.set", json!({"id": bg, "props": {"visible": false}})); + ex(&mut s, "component.addProperty", json!({"id": c, "name": "Show bg", "type": "boolean", "layer": bg})); + assert_eq!(bool_default(&s, c, "Show bg"), Some(false)); + assert!(!node(&s, bg).visible); + // Binding a layer to an existing property shows it as the default says. + ex(&mut s, "component.bindProperty", json!({"layer": title, "property": "Show dot"})); + assert!(!node(&s, title).visible); + // A new default shows or hides every bound layer of the main; instances keep their values. + ex(&mut s, "instance.setProperties", json!({"ids": [i], "properties": {"Show dot": false}})); + ex(&mut s, "component.editProperty", json!({"id": c, "name": "Show dot", "default": true})); + assert!(node(&s, dot).visible && node(&s, title).visible); + assert!(!node(&s, copy_of(&s, i, dot)).visible, "the instance's own value stays"); + // Renamed with a new default in one go. + ex(&mut s, "component.editProperty", json!({"id": c, "name": "Show dot", "newName": "Dot", "default": false})); + assert!(!node(&s, dot).visible && !node(&s, title).visible); + assert_eq!(bool_default(&s, c, "Dot"), Some(false)); + // Showing a bound layer on the main is the property's new default, for its other layers too. + ex(&mut s, "node.set", json!({"id": dot, "props": {"visible": true}})); + assert_eq!(bool_default(&s, c, "Dot"), Some(true)); + assert!(node(&s, title).visible); + let j = idv(&ex(&mut s, "instance.create", json!({"component": c, "x": 600, "y": 0}))); + assert!(node(&s, copy_of(&s, j, dot)).visible && node(&s, copy_of(&s, j, title)).visible); + assert!(!node(&s, copy_of(&s, i, dot)).visible, "existing instances keep their values"); + // Hiding a layer inside an instance is an override there, not a new default. + let jdot = copy_of(&s, j, dot); + ex(&mut s, "node.set", json!({"id": jdot, "props": {"visible": false}})); + assert_eq!(bool_default(&s, c, "Dot"), Some(true)); + assert!(node(&s, dot).visible); + // Undo puts the default and the layers back together. + s.undo().unwrap(); + s.undo().unwrap(); + s.undo().unwrap(); + assert_eq!(bool_default(&s, c, "Dot"), Some(false)); + assert!(!node(&s, dot).visible && !node(&s, title).visible); + healthy(&s); +} + +#[test] +fn boolean_property_default_follows_across_variants() { + let mut s = Session::new(); + let mut variants = Vec::new(); + let mut labels = Vec::new(); + for (k, state) in ["Default", "Hover"].iter().enumerate() { + let f = + idv(&ex(&mut s, "frame.create", json!({"x": k as f64 * 150.0, "y": 0, "width": 100, "height": 40, "name": format!("State={state}")}))); + labels.push(idv(&ex(&mut s, "text.create", json!({"text": *state, "x": 10, "y": 10, "parent": f, "props": {"name": "Label"}})))); + variants.push(idv(&ex(&mut s, "component.create", json!({"ids": [f]})))); + } + let set = idv(&ex(&mut s, "component.combineVariants", json!({"ids": variants.clone()}))); + ex(&mut s, "component.addProperty", json!({"id": set, "name": "Show label", "type": "boolean", "default": false, "layer": labels[0]})); + ex(&mut s, "component.bindProperty", json!({"layer": labels[1], "property": "Show label"})); + assert!(labels.iter().all(|l| !node(&s, *l).visible)); + ex(&mut s, "component.editProperty", json!({"id": set, "name": "Show label", "default": true})); + assert!(labels.iter().all(|l| node(&s, *l).visible)); + // Hiding the label in one variant is the set's default: the other variant's label follows. + ex(&mut s, "node.set", json!({"id": labels[1], "props": {"visible": false}})); + assert!(variants.iter().all(|v| bool_default(&s, *v, "Show label") == Some(false))); + assert!(!node(&s, labels[0]).visible); + let i = idv(&ex(&mut s, "instance.create", json!({"component": set, "x": 0, "y": 200}))); + assert!(!node(&s, kids(&s, i)[0]).visible); + healthy(&s); +} + #[test] fn push_changes_to_main() { let mut s = Session::new(); diff --git a/docs/mcp.md b/docs/mcp.md index dfea95cc2..3d4127274 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -713,6 +713,14 @@ most when it can't be reached). moves the chosen variant there, `{name, index}` reorders variant properties (the variants' names follow). `component.properties` on a set reports `conflicts`: variants sharing one combination of values. +- **Boolean properties**: on the main component, a boolean property's value is the visibility of + the layers bound to it. `component.addProperty {type: "boolean", default, layer}`, + `component.bindProperty {field: "visible"}` and `component.editProperty {name, default}` show or + hide the main's bound layers to match the default (without `default`, `addProperty` takes the + bound layer's visibility). Showing or hiding a bound layer on the main sets the default, and the + property's other bound layers (in every variant of a set) follow. New instances start from the + default; existing instances keep the values they have. Files open as saved: a main whose bound + layer disagrees with the default stays that way until one of them is edited. - `component.pushChanges {id?}` copies the instance's overrides into its main (from a layer of a nested instance too: always into the outer instance's main). From 09ff20ffd6d01d14fb3ab8c0f5b40f0a4855facf Mon Sep 17 00:00:00 2001 From: Ridzzz0Alam Date: Wed, 21 Oct 2026 20:35:13 +0200 Subject: [PATCH 460/817] M1: several exported layers arrive as one zip in the browser (#969) Cause: in the browser, exporting several layers started one download per file. Chrome holds back every download after the first until the site is allowed automatic downloads, so the other files didn't arrive. Fix: file.exportLayers takes `zip: true` (without `dir`) and returns the files together as one base64 zip `data`, written by a new figcraft_format::zip_files (the workspace's existing zip dependency). The UI asks for it when the platform saves by downloads and hands over one `.zip`. Test: ui-egui several_layers_download_as_one_zip (one download, a zip holding both layers). It fails on the previous commit (two downloads). --- crates/engine/src/cmd/file.rs | 13 +++++++++++-- crates/format/src/lib.rs | 14 ++++++++++++++ crates/ui-egui/src/export_panel.rs | 13 +++++++------ crates/ui-egui/src/web_save_tests.rs | 16 ++++++++++++++++ 4 files changed, 48 insertions(+), 8 deletions(-) diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index 8a75efb71..d50233726 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -65,7 +65,7 @@ pub fn specs() -> Vec { spec!( "file.exportLayers", "Export layers", - "{ids? (default the selection, else every layer on the page with export settings), assets? (true: the Inspect tab's assets in and under them instead: layers with export settings, icons as SVG, images as PNG), dir? (folder to write into; else each file comes back as base64 `data`), bleed? (PDF: points, or with a unit: \"3mm\", \"0.125in\", \"9pt\"), cropMarks?, bleedMarks?, cmyk? (PDF print options): for every PDF instead of each setting's own} every layer once per export setting, named `.` (\"@2x\" when a scaled export has no suffix; repeats get \" 2\"; slashes in a layer name make folders). Returns {files: [{name, id, bytes, path | data}], skipped (layers without settings)}", + "{ids? (default the selection, else every layer on the page with export settings), assets? (true: the Inspect tab's assets in and under them instead: layers with export settings, icons as SVG, images as PNG), dir? (folder to write into; else each file comes back as base64 `data`), zip? (no dir: the files come back together as one base64 zip `data` instead), bleed? (PDF: points, or with a unit: \"3mm\", \"0.125in\", \"9pt\"), cropMarks?, bleedMarks?, cmyk? (PDF print options): for every PDF instead of each setting's own} every layer once per export setting, named `.` (\"@2x\" when a scaled export has no suffix; repeats get \" 2\"; slashes in a layer name make folders). Returns {files: [{name, id, bytes, path | data}], skipped (layers without settings), data? (zip)}", false, export_layers ), @@ -1209,6 +1209,9 @@ fn export_layers(s: &mut Session, p: &Value) -> Result { return Err(EngineError::Disabled(cmd.into(), "no export settings (add one with export.add)".into())); } let dir = string(p, "dir"); + // The browser saves one download at a time: several files go as one zip (#969). + let zip = dir.is_none() && boolean(p, "zip").unwrap_or(false); + let mut members = Vec::new(); // Print options passed here stand in for every PDF setting's own. let print = has_print_param(p).then(|| print_param(cmd, p, PrintSettings::default())).transpose()?; let mut files = Vec::with_capacity(jobs.len()); @@ -1228,12 +1231,18 @@ fn export_layers(s: &mut Session, p: &Value) -> Result { write(&path, &bytes)?; f["path"] = json!(path); } + None if zip => members.push((job.file.as_str(), bytes)), None => f["data"] = json!(base64::engine::general_purpose::STANDARD.encode(&bytes)), } files.push(f); } let with_settings: std::collections::BTreeSet = jobs.iter().map(|j| j.id).collect(); - Ok(json!({"files": files, "skipped": ids.len().saturating_sub(with_settings.len())})) + let mut r = json!({"files": files, "skipped": ids.len().saturating_sub(with_settings.len())}); + if zip { + let archive = figcraft_format::zip_files(members.iter().map(|(n, b)| (*n, b.as_slice()))).map_err(|e| EngineError::Other(e.to_string()))?; + r["data"] = json!(base64::engine::general_purpose::STANDARD.encode(&archive)); + } + Ok(r) } /// A PDF with one page per group of layers (an sRGB document), titled after the file; `area` diff --git a/crates/format/src/lib.rs b/crates/format/src/lib.rs index 9f7e51bc4..d07753237 100644 --- a/crates/format/src/lib.rs +++ b/crates/format/src/lib.rs @@ -343,6 +343,20 @@ pub(crate) fn put( z.write_all(bytes).map_err(io_err) } +/// `files` (name, bytes; a `/` in a name makes a folder) as one zip archive: several exports +/// delivered as a single download (#969). +pub fn zip_files<'a>(files: impl IntoIterator) -> Result, FormatError> { + let mut buf = std::io::Cursor::new(Vec::new()); + { + let mut z = zip::ZipWriter::new(&mut buf); + for (name, bytes) in files { + put(&mut z, name, zip::write::SimpleFileOptions::default(), bytes)?; + } + z.finish().map_err(io_err)?; + } + Ok(buf.into_inner()) +} + /// Add `doc` as a `document.json`-style member, serialized straight into the compressor. fn put_json(z: &mut zip::ZipWriter, name: &str, doc: &Document) -> Result<(), FormatError> { z.start_file(name, json_options()).map_err(io_err)?; diff --git a/crates/ui-egui/src/export_panel.rs b/crates/ui-egui/src/export_panel.rs index 6a4ca8eee..39fc4bd1a 100644 --- a/crates/ui-egui/src/export_panel.rs +++ b/crates/ui-egui/src/export_panel.rs @@ -320,13 +320,14 @@ pub(crate) fn export_layers(app: &mut FigApp, ids: &[NodeId], assets: bool) { [] => {} // The suggested name keeps only the file's own name (a layer's folders apply to folders). [one] => save_one(app, &[one.id], &one.setting, one.file.rsplit('/').next().unwrap_or(&one.file)), - // No folders in the browser: each file arrives as its own download (#969). + // No folders in the browser, and it lets a page start one download at a time: the files + // arrive together as one zip (#969). _ if app.services.downloads() => { - let Some(r) = app.run("file.exportLayers", json!({"ids": ids, "assets": assets})) else { return }; - let files = r["files"].as_array().map_or(&[][..], Vec::as_slice); - let n = files.iter().filter(|f| app.download(f["name"].as_str().unwrap_or_default(), f)).count(); - if n > 0 { - app.toast(trn("Exported {n} files", n, &[])); + let name = format!("{}.zip", app.session.doc().map_or("Export", |d| d.name.as_str())); + if let Some(r) = app.run("file.exportLayers", json!({"ids": ids, "assets": assets, "zip": true})) + && app.download(&name, &r) + { + app.toast(trn("Exported {n} files", r["files"].as_array().map_or(0, Vec::len), &[])); } } _ => { diff --git a/crates/ui-egui/src/web_save_tests.rs b/crates/ui-egui/src/web_save_tests.rs index 7d1d75d2e..5fbb2524b 100644 --- a/crates/ui-egui/src/web_save_tests.rs +++ b/crates/ui-egui/src/web_save_tests.rs @@ -53,3 +53,19 @@ fn a_refused_download_says_so() { assert_eq!(got.lock().unwrap().len(), 1); assert_eq!(toast(&app), "Couldn't download Untitled.figcraft"); } + +#[test] +fn several_layers_download_as_one_zip() { + // The browser lets a page start one download at a time: two downloads lost the second. + let (mut app, got, a) = browser(true); + let r = app.session.execute("shape.rectangle", &json!({"x": 20, "y": 0, "width": 10, "height": 10})).unwrap(); + let b: NodeId = serde_json::from_value(r["id"].clone()).unwrap(); + app.session.execute("export.add", &json!({"ids": [a, b]})).unwrap(); + crate::export_panel::export_layers(&mut app, &[a, b], false); + let got = got.lock().unwrap(); + let [(name, bytes)] = got.as_slice() else { panic!("one download, got {}", got.len()) }; + assert_eq!(name, "Untitled.zip"); + assert!(bytes.starts_with(b"PK\x03\x04")); + assert!(bytes.windows(15).any(|w| w == b"Rectangle 2.png"), "both layers are in the zip"); + assert_eq!(toast(&app), "Exported 2 files"); +} From 40fd169bece498c121535ad03fe3f7baa6df5537 Mon Sep 17 00:00:00 2001 From: vetlucasmartins Date: Wed, 21 Oct 2026 19:38:30 +0100 Subject: [PATCH 461/817] variable.export css: number lengths in px MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A radius exported as `--radius: 12` was invalid where CSS reads it as a length (`border-radius: var(--radius)` ignores a bare number). Number values now carry px unless the layers bound to them, their scopes, or the variables aliasing them make them an opacity or a font weight, which stay bare. The roles come from a small token_roles module. Updates the variables_io_tests expectation for the radius (4 → 4px, 6.5 → 6.5px), and adds a test for a bound radius, a bound opacity and an opacity alias's target. --- crates/engine/src/cmd/variables_io.rs | 13 +++- crates/engine/src/lib.rs | 1 + crates/engine/src/token_roles.rs | 98 +++++++++++++++++++++++++ crates/engine/src/variables_io_tests.rs | 24 +++++- docs/mcp.md | 4 +- 5 files changed, 133 insertions(+), 7 deletions(-) create mode 100644 crates/engine/src/token_roles.rs diff --git a/crates/engine/src/cmd/variables_io.rs b/crates/engine/src/cmd/variables_io.rs index f3b9a820d..0f55ea2c0 100644 --- a/crates/engine/src/cmd/variables_io.rs +++ b/crates/engine/src/cmd/variables_io.rs @@ -18,7 +18,7 @@ pub fn specs() -> Vec { spec!( "variable.export", "Export variables", - "{collections? [ids or names; default every collection of this file, not library copies], format? (json (default): the local variables JSON that variable.import reads | css: custom properties, the default mode on :root and each other mode on [data-=\"\"]), path? (write it there)} → {text}, or {path} when written", + "{collections? [ids or names; default every collection of this file, not library copies], format? (json (default): the local variables JSON that variable.import reads | css: custom properties, the default mode on :root and each other mode on [data-=\"\"]; numbers in px unless layers or scopes use them as opacity or font weight), path? (write it there)} → {text}, or {path} when written", false, export ), @@ -46,7 +46,7 @@ fn export(s: &mut Session, p: &Value) -> Result { let text = match string(p, "format").as_deref().unwrap_or("json") { "json" => serde_json::to_string_pretty(&figcraft_format::rest::export_variables(&doc.variables, &colls)) .map_err(|e| EngineError::Other(e.to_string()))?, - "css" => css(&doc.variables, &colls), + "css" => css(doc, &colls), _ => return Err(bad(cmd, "format: json|css")), }; match string(p, "path") { @@ -66,7 +66,11 @@ fn css_safe(text: &str) -> String { /// Each collection's variables as custom properties (named as generated code names them): the /// default mode's values on `:root`, every other mode's on `[data-=""]`; /// aliases are `var(--name)`. -fn css(vars: &Variables, colls: &[&Collection]) -> String { +fn css(doc: &Document, colls: &[&Collection]) -> String { + let vars = &doc.variables; + // Lengths need a unit where CSS reads them (`border-radius: var(--radius)`); opacity and + // font weight don't. + let roles = crate::token_roles::Roles::new(doc); let mut out = String::new(); for c in colls { let attr = css_var_name(&c.name); @@ -76,7 +80,8 @@ fn css(vars: &Variables, colls: &[&Collection]) -> String { for v in vars.variables.iter().filter(|v| v.collection == c.id) { let value = match v.values.get(&m.id) { Some(VariableValue::Color(col)) => col.to_css(), - Some(VariableValue::Number(x)) => trim_num(*x), + Some(VariableValue::Number(x)) if roles.role(v) == crate::token_roles::NumberRole::Unitless => trim_num(*x), + Some(VariableValue::Number(x)) => format!("{}px", trim_num(*x)), Some(VariableValue::String(t)) => format!("\"{}\"", css_safe(t)), Some(VariableValue::Boolean(b)) => b.to_string(), Some(VariableValue::Alias(a)) => match vars.get(a) { diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 79e7be0d5..b08396950 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -60,6 +60,7 @@ pub mod synthetic_ds; pub mod templates; pub mod textedit; pub mod textpreview; +pub mod token_roles; pub mod tools; pub mod vectoredit; pub mod widgets; diff --git a/crates/engine/src/token_roles.rs b/crates/engine/src/token_roles.rs new file mode 100644 index 000000000..2f6cd41b7 --- /dev/null +++ b/crates/engine/src/token_roles.rs @@ -0,0 +1,98 @@ +//! What a file's number variables measure, so exported tokens carry the right unit: a radius, +//! font size, spacing or other length is in pixels, opacity and font weight are bare numbers. +//! A number's role comes from the layer fields bound to it, else its scopes, and an alias target +//! with no role of its own takes the role of the variables that read it (the target of an opacity +//! alias stays unitless). A number nothing tells about is a length: design tokens mostly are. + +use std::collections::HashMap; + +use figcraft_doc::*; + +use crate::codegen::num; + +/// What a number variable measures. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum NumberRole { + Radius, + FontSize, + Spacing, + /// Another length (stroke, line height, letter spacing, effects): pixels. + Length, + /// Opacity or font weight: no unit. + Unitless, +} + +fn role_of_field(field: &str) -> Option { + Some(match field { + "cornerRadius" | "topLeftRadius" | "topRightRadius" | "bottomRightRadius" | "bottomLeftRadius" => NumberRole::Radius, + "fontSize" => NumberRole::FontSize, + "opacity" | "fontWeight" => NumberRole::Unitless, + f if f == "gap" || f == "counterAxisSpacing" || f.starts_with("padding") || f == "width" || f == "height" => NumberRole::Spacing, + f if f.starts_with("min") || f.starts_with("max") => NumberRole::Spacing, + "strokeWeight" | "lineHeight" | "letterSpacing" | "paragraphSpacing" | "paragraphIndent" => NumberRole::Length, + _ => return None, + }) +} + +fn role_of_scope(scope: &str) -> Option { + Some(match scope { + "CORNER_RADIUS" => NumberRole::Radius, + "FONT_SIZE" => NumberRole::FontSize, + "GAP" | "WIDTH_HEIGHT" => NumberRole::Spacing, + "OPACITY" | "FONT_WEIGHT" => NumberRole::Unitless, + "STROKE_FLOAT" | "EFFECT_FLOAT" | "LINE_HEIGHT" | "LETTER_SPACING" | "PARAGRAPH_SPACING" | "PARAGRAPH_INDENT" => NumberRole::Length, + _ => return None, + }) +} + +/// The roles of a file's number variables, computed once per export. +#[derive(Default)] +pub struct Roles(HashMap); + +impl Roles { + pub fn new(doc: &Document) -> Self { + let vars = &doc.variables.variables; + let mut roles: HashMap = HashMap::new(); + for n in doc.nodes() { + for (field, id) in &n.bound { + if let Some(r) = role_of_field(field) { + roles.entry(id.clone()).or_insert(r); + } + } + } + for v in vars.iter().filter(|v| v.kind == VariableType::Number) { + if let Some(r) = v.scopes.as_ref().and_then(|s| s.iter().find_map(|s| role_of_scope(s))) { + roles.entry(v.id.clone()).or_insert(r); + } + } + // Alias chains are short; a few rounds reach their ends. + for _ in 0..8 { + let mut changed = false; + for v in vars { + let Some(r) = roles.get(&v.id).copied() else { continue }; + for value in v.values.values() { + if let VariableValue::Alias(target) = value + && !roles.contains_key(target) + { + roles.insert(target.clone(), r); + changed = true; + } + } + } + if !changed { + break; + } + } + Roles(roles) + } + + /// What `v` measures; a number nothing tells about is a length. + pub fn role(&self, v: &Variable) -> NumberRole { + self.0.get(&v.id).copied().unwrap_or(NumberRole::Length) + } + + /// A number variable's CSS value: pixels for lengths, bare for opacity and font weight. + pub fn number_css(&self, v: &Variable, x: f64) -> String { + if self.role(v) == NumberRole::Unitless { num(x) } else { format!("{}px", num(x)) } + } +} diff --git a/crates/engine/src/variables_io_tests.rs b/crates/engine/src/variables_io_tests.rs index 3a57d9eac..8d21be614 100644 --- a/crates/engine/src/variables_io_tests.rs +++ b/crates/engine/src/variables_io_tests.rs @@ -214,9 +214,9 @@ fn variables_export_and_import_round_trip() { let css = ex(&mut s, "variable.export", json!({"format": "css", "collections": ["Theme"]}))["text"].as_str().unwrap().to_string(); for want in [ ":root {\n", - " --radius: 4;\n", + " --radius: 4px;\n", "[data-theme=\"Dark\"] {\n", - " --radius: 6.5;\n", + " --radius: 6.5px;\n", " --accent: var(--color-primary);\n", " --label: \"Say hi \";\n", ] { @@ -397,3 +397,23 @@ fn paints_replaced_through_node_set_keep_unchanged_stop_bindings() { assert_eq!(stops(&s, r), ["FFFFFF", "0000FF"]); healthy(&s); } + +#[test] +fn css_export_gives_lengths_a_unit_and_keeps_opacity_bare() { + let mut s = Session::new(); + ex(&mut s, "variable.createCollection", json!({"name": "Brand"})); + ex(&mut s, "variable.create", json!({"collection": "Brand", "name": "card", "type": "number", "value": 12})); + ex(&mut s, "variable.create", json!({"collection": "Brand", "name": "fade", "type": "number", "value": 0.5})); + ex(&mut s, "variable.create", json!({"collection": "Brand", "name": "half", "type": "number", "value": 0.5})); + ex(&mut s, "variable.create", json!({"collection": "Brand", "name": "dim", "type": "number", "value": 1})); + ex(&mut s, "variable.set", json!({"variable": "dim", "value": {"alias": "half"}})); + let f = idv(&ex(&mut s, "frame.create", json!({"x": 0, "y": 0, "width": 100, "height": 100}))); + let g = idv(&ex(&mut s, "frame.create", json!({"x": 200, "y": 0, "width": 100, "height": 100}))); + ex(&mut s, "node.set", json!({"id": f, "props": {"cornerRadius": 12, "opacity": 0.5}})); + ex(&mut s, "variable.bind", json!({"ids": [f], "field": "cornerRadius", "variable": "card"})); + ex(&mut s, "variable.bind", json!({"ids": [f], "field": "opacity", "variable": "fade"})); + ex(&mut s, "variable.bind", json!({"ids": [g], "field": "opacity", "variable": "dim"})); + let css = ex(&mut s, "variable.export", json!({"format": "css"}))["text"].as_str().unwrap_or_default().to_string(); + // A radius is a length; opacity stays a number, also through an alias it reads. + assert!(css.contains("--card: 12px;") && css.contains("--fade: 0.5;") && css.contains("--half: 0.5;"), "{css}"); +} diff --git a/docs/mcp.md b/docs/mcp.md index dfea95cc2..fa16f5b76 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -903,7 +903,9 @@ frame back to Auto, inheriting its parent's mode). The same JSON carries variables between FigCraft files: `variable.export {collections?, format?, path?}` writes this file's collections (default: all but library copies) as a local variables response (`format: "json"`, the default) or as CSS custom properties (`format: "css"`: the default -mode on `:root`, each other mode on `[data-=""]`, aliases as `var(--name)`), and +mode on `:root`, each other mode on `[data-=""]`, aliases as `var(--name)`, numbers +in px unless the layers bound to them, their scopes or the variables aliasing them make them an +opacity or a font weight, so `border-radius: var(--radius)` reads `12px`), and returns `{text}` (or writes `path` and returns `{path}`). `variable.import {variables}` (an object, JSON text or a path; `variableCollections` and `variables` under `meta` or at the top level) reads one back: a collection joins this file's collection of the same name From 196e3432dd558e68cc256f2b39e4173bc1fb38ba Mon Sep 17 00:00:00 2001 From: vetlucasmartins Date: Wed, 21 Oct 2026 19:54:47 +0100 Subject: [PATCH 462/817] data.fill and text.fit: fill copies of a frame from rows of data - data.fill {id, rows, gap?, formats?, dir?, format?, scale?}: repeats a frame once per row in one undo step; each row key names layers in the copy (text, or {text?, fill?, visible?, fit?}). `formats` makes each row once per size (feed, story, square), the copy resized so its auto layout reflows. With `dir`, each copy is exported under a unique file name; a failed export is reported in `errors` and keeps the copies. - text.fit {ids?, maxLines?, minSize?, orphans?}: the largest font size, down to a floor, at which fixed-width text stays within N lines and its box; avoids a one-word last line; `fits` comes from the final text. - Plugins can't call data.fill: it runs other commands inside, past the plugin policy, like command.batch. --- crates/engine/src/cmd/mod.rs | 2 + crates/engine/src/datafill.rs | 171 ++++++++++++++++++++++++++++ crates/engine/src/datafill_tests.rs | 142 +++++++++++++++++++++++ crates/engine/src/lib.rs | 6 + crates/engine/src/plugins.rs | 2 + crates/engine/src/plugins_tests.rs | 1 + crates/engine/src/textfit.rs | 115 +++++++++++++++++++ crates/engine/src/textfit_tests.rs | 104 +++++++++++++++++ crates/ui-egui/locales/es.toml | 2 + crates/ui-egui/locales/pt-BR.toml | 2 + docs/mcp.md | 32 ++++++ 11 files changed, 579 insertions(+) create mode 100644 crates/engine/src/datafill.rs create mode 100644 crates/engine/src/datafill_tests.rs create mode 100644 crates/engine/src/textfit.rs create mode 100644 crates/engine/src/textfit_tests.rs diff --git a/crates/engine/src/cmd/mod.rs b/crates/engine/src/cmd/mod.rs index f011238d9..1d73cc4c6 100644 --- a/crates/engine/src/cmd/mod.rs +++ b/crates/engine/src/cmd/mod.rs @@ -109,6 +109,8 @@ fn registry() -> &'static Registry { list.extend(crate::online::specs()); list.extend(crate::invite_links::specs()); list.extend(crate::templates::specs()); + list.extend(crate::datafill::specs()); + list.extend(crate::textfit::specs()); let mut index = HashMap::new(); for (i, s) in list.iter().enumerate() { if index.insert(s.id, i).is_some() { diff --git a/crates/engine/src/datafill.rs b/crates/engine/src/datafill.rs new file mode 100644 index 000000000..d02269362 --- /dev/null +++ b/crates/engine/src/datafill.rs @@ -0,0 +1,171 @@ +//! `data.fill`: one frame repeated per row of data (a carousel, a set of posts, cards from a +//! list): each copy gets its row's texts, colours and visibility on the layers named by the row's +//! keys, in one undo step, and optionally each copy exported as a file. Agents make a series with +//! one call instead of a duplicate, a lookup and an edit per layer and an export per copy. + +use serde_json::{Value, json}; + +use crate::cmd::CommandSpec; +use crate::params::*; +use crate::{Result, Session, bad, spec}; + +const CMD: &str = "data.fill"; +const MAX_ROWS: usize = 500; + +pub fn specs() -> Vec { + vec![spec!( + "data.fill", + "Fill copies with data", + "{id (the frame to repeat), rows: [{: text | {text?, fill? (#rrggbb), visible?, fit? (true or text.fit's {maxLines?, minSize?, orphans?}: size the text to its box)}, name? (the copy's name)}] (every layer with that name in the copy; up to 500 rows), gap? (between copies, placed in a row to the right; default 100), formats? ([{name?, width, height}]: each row once per size, the copy resized so its auto layout reflows and named -; e.g. feed 1080×1350, story 1080×1920, square 1080×1080), dir? (export each copy there as .), format? (png|jpg|webp|svg|pdf; default png), scale? (default 1)} one undo step → {ids (the copies, in row order), missing (keys no layer is named), files? (paths written, one per copy: same file names get a numbered suffix), errors? ([{id, path, error}] for exports that failed; the copies stay)}", + false, + fill + )] +} + +/// A file name from a layer name: letters, digits, spaces, `-` and `_` kept, the rest `-`. +fn file_name(name: &str) -> String { + let s: String = name.chars().take(80).map(|c| if c.is_alphanumeric() || matches!(c, ' ' | '-' | '_') { c } else { '-' }).collect(); + let s = s.trim().to_string(); + if s.is_empty() { "copy".into() } else { s } +} + +fn fill(s: &mut Session, p: &Value) -> Result { + let src = id(p, "id").ok_or_else(|| bad(CMD, "`id` (the frame to repeat) required"))?; + let rows = match get(p, "rows") { + Some(Value::Array(a)) if a.iter().all(Value::is_object) && a.len() <= MAX_ROWS => a.clone(), + _ => return Err(bad(CMD, "rows: an array of objects (up to 500)")), + }; + let gap = num_or(p, "gap", 100.0); + if !gap.is_finite() { + return Err(bad(CMD, "gap: a number")); + } + let format = string(p, "format").unwrap_or_else(|| "png".into()).to_ascii_lowercase(); + if !["png", "jpg", "webp", "svg", "pdf"].contains(&format.as_str()) { + return Err(bad(CMD, "format: png|jpg|webp|svg|pdf")); + } + let (width, base) = { + let doc = s.doc()?; + let n = doc.node(src).ok_or_else(|| bad(CMD, "no such layer"))?; + (n.width, n.name.clone()) + }; + // `formats`: each row once per size, the copy resized so its auto layout reflows. + let formats: Vec> = match get(p, "formats") { + None | Some(Value::Null) => vec![None], + Some(Value::Array(a)) if !a.is_empty() && a.len() <= 12 => a + .iter() + .map(|f| { + let (w, h) = (f.get("width").and_then(Value::as_f64), f.get("height").and_then(Value::as_f64)); + let name = f.get("name").and_then(Value::as_str).unwrap_or_default().trim().to_string(); + match (w, h) { + (Some(w), Some(h)) if w.is_finite() && h.is_finite() && (1.0..=20_000.0).contains(&w) && (1.0..=20_000.0).contains(&h) => { + Ok(Some((if name.is_empty() { format!("{}x{}", w as i64, h as i64) } else { name }, w, h))) + } + _ => Err(bad(CMD, "formats: [{name?, width, height}] with sizes from 1 to 20000")), + } + }) + .collect::>()?, + Some(_) => return Err(bad(CMD, "formats: [{name?, width, height}] (1 to 12 sizes)")), + }; + let column = formats.iter().flatten().map(|f| f.1).fold(width, f64::max); + let mut missing: Vec = Vec::new(); + let ids = s.grouped("Fill copies with data", |s| { + let mut ids = Vec::with_capacity(rows.len() * formats.len()); + for (i, row) in rows.iter().enumerate() { + let mut dy = 0.0; + for fmt in &formats { + // Rows go right; a row's formats stack downwards. + let dx = (column + gap) * (i as f64 + 1.0); + let dup = s.execute("edit.duplicate", &json!({"ids": [src], "dx": dx, "dy": dy}))?; + let copy = dup["ids"].get(0).and_then(id_of).ok_or_else(|| bad(CMD, "the frame couldn't be duplicated"))?; + let Some(fields) = row.as_object() else { continue }; + let name = fields.get("name").and_then(Value::as_str).map_or_else(|| format!("{base} {}", i + 1), str::to_string); + let name = match fmt { + Some((suffix, w, h)) => { + s.execute("node.set", &json!({"id": copy, "props": {"width": w, "height": h}}))?; + dy += h + gap; + format!("{name}-{suffix}") + } + None => name, + }; + s.execute("node.set", &json!({"id": copy, "props": {"name": name}}))?; + for (key, value) in fields.iter().filter(|(k, _)| k.as_str() != "name") { + let doc = s.doc()?; + let targets: Vec<_> = + doc.subtree(copy).into_iter().filter(|t| *t != copy && doc.node(*t).is_some_and(|n| n.name == *key)).collect(); + if targets.is_empty() { + if !missing.contains(key) { + missing.push(key.clone()); + } + continue; + } + let (text, fill, visible, fit) = match value { + Value::Object(o) => ( + o.get("text").map(text_of), + o.get("fill").and_then(Value::as_str), + o.get("visible").and_then(Value::as_bool), + o.get("fit").cloned().filter(|f| !matches!(f, Value::Bool(false) | Value::Null)), + ), + v => (Some(text_of(v)), None, None, None), + }; + let mut texts = Vec::new(); + for t in targets { + let is_text = s.doc()?.node(t).is_some_and(|n| matches!(n.kind, figcraft_doc::NodeKind::Text(_))); + if let Some(text) = text.as_ref().filter(|_| is_text) { + s.execute("text.set", &json!({"id": t, "characters": text}))?; + } + if is_text { + texts.push(t.0); + } + if let Some(f) = fill { + s.execute("node.set", &json!({"id": t, "props": {"fills": [f]}}))?; + } + if let Some(v) = visible { + s.execute("node.set", &json!({"id": t, "props": {"visible": v}}))?; + } + } + // `fit: true` or `{maxLines?, minSize?, orphans?}`: size the text to its box. + if let Some(f) = fit.filter(|_| !texts.is_empty()) { + let mut params = if f.is_object() { f } else { json!({}) }; + params["ids"] = json!(texts); + s.execute("text.fit", ¶ms)?; + } + } + ids.push((copy, name)); + } + } + Ok(ids) + })?; + let mut out = json!({"ids": ids.iter().map(|(i, _)| i.0).collect::>(), "missing": missing}); + // Exports after the edits landed: a failed edit writes no files. A failed export keeps the + // copies (one undo step removes them) and is reported with the files that were written. + if let Some(dir) = string(p, "dir") { + let (mut files, mut errors, mut used) = (Vec::new(), Vec::new(), Vec::::new()); + for (copy, name) in &ids { + // One file per copy: same or same-looking names get " 2", " 3"… (case-insensitively, + // as macOS and Windows file systems compare names). + let base = file_name(name); + let stem = + (1..).map(|k| if k == 1 { base.clone() } else { format!("{base} {k}") }).find(|n| !used.contains(&n.to_lowercase())).unwrap_or(base); + used.push(stem.to_lowercase()); + let path = std::path::Path::new(&dir).join(format!("{stem}.{format}")).to_string_lossy().to_string(); + match s.execute("file.export", &json!({"ids": [copy.0], "format": format, "scale": num_or(p, "scale", 1.0), "path": path})) { + Ok(_) => files.push(path), + Err(e) => errors.push(json!({"id": copy.0, "path": path, "error": e.to_string()})), + } + } + out["files"] = json!(files); + if !errors.is_empty() { + out["errors"] = json!(errors); + } + } + Ok(out) +} + +/// A cell as text: strings as they are, numbers and booleans as written, null as empty. +fn text_of(v: &Value) -> String { + match v { + Value::String(s) => s.clone(), + Value::Null => String::new(), + v => v.to_string(), + } +} diff --git a/crates/engine/src/datafill_tests.rs b/crates/engine/src/datafill_tests.rs new file mode 100644 index 000000000..bbb5d4b6a --- /dev/null +++ b/crates/engine/src/datafill_tests.rs @@ -0,0 +1,142 @@ +//! `data.fill`: a frame repeated per row with that row's texts, fills and visibility, in one undo +//! step, optionally exported. + +use crate::Session; +use crate::components::tests::{ex, idv}; +use figcraft_doc::*; +use serde_json::json; + +/// A 1080×1350 "Post" with "Title" and "Price" texts and a "Badge" rectangle. Returns the frame. +fn post(s: &mut Session) -> NodeId { + let f = idv(&ex(s, "frame.create", json!({"x": 0, "y": 0, "width": 1080, "height": 1350, "name": "Post"}))); + ex(s, "text.create", json!({"text": "Title", "x": 80, "y": 80, "parent": f, "props": {"name": "Title"}})); + ex(s, "text.create", json!({"text": "R$ 0", "x": 80, "y": 1200, "parent": f, "props": {"name": "Price"}})); + ex(s, "shape.rectangle", json!({"x": 80, "y": 40, "width": 200, "height": 32, "parent": f, "props": {"name": "Badge", "fill": "#3DDC97"}})); + f +} + +fn text(s: &Session, frame: NodeId, name: &str) -> String { + let doc = s.doc().unwrap(); + doc.subtree(frame) + .into_iter() + .filter_map(|i| doc.node(i)) + .find(|n| n.name == name) + .and_then(|n| match &n.kind { + NodeKind::Text(t) => Some(t.characters.clone()), + _ => None, + }) + .unwrap_or_default() +} + +#[test] +fn each_row_fills_a_copy_in_one_undo_step() { + let mut s = Session::new(); + let f = post(&mut s); + let r = ex( + &mut s, + "data.fill", + json!({"id": f, "rows": [ + {"name": "Slide 1", "Title": "Site em 7 dias", "Price": 5500}, + {"name": "Slide 2", "Title": "WhatsApp com IA", "Badge": {"visible": false}}, + {"Title": "Agenda sozinha", "Badge": {"fill": "#7C5CFF"}, "Subtitle": "nope"} + ]}), + ); + let ids: Vec = r["ids"].as_array().unwrap().iter().map(|v| NodeId(v.as_u64().unwrap())).collect(); + assert_eq!(ids.len(), 3); + assert_eq!(r["missing"], json!(["Subtitle"])); + assert_eq!(text(&s, ids[0], "Title"), "Site em 7 dias"); + assert_eq!(text(&s, ids[0], "Price"), "5500"); + assert_eq!(text(&s, ids[2], "Title"), "Agenda sozinha"); + assert_eq!(text(&s, f, "Title"), "Title", "the source frame is untouched"); + let doc = s.doc().unwrap(); + assert_eq!(doc.node(ids[0]).unwrap().name, "Slide 1"); + assert_eq!(doc.node(ids[2]).unwrap().name, "Post 3"); + // Copies sit in a row to the right, 100 apart. + let x = |i: NodeId| doc.node(i).unwrap().transform.as_coeffs()[4]; + assert_eq!((x(ids[0]), x(ids[1])), (1180.0, 2360.0)); + let badge = |i: NodeId| doc.subtree(i).into_iter().filter_map(|k| doc.node(k)).find(|n| n.name == "Badge").cloned().unwrap(); + assert!(!badge(ids[1]).visible && badge(ids[0]).visible); + assert_eq!(badge(ids[2]).fills[0].solid_color().map(|c| c.to_hex()), Some("7C5CFF".into())); + // One undo removes every copy. + ex(&mut s, "edit.undo", json!({})); + assert!(ids.iter().all(|i| !s.doc().unwrap().contains(*i))); +} + +#[test] +fn copies_export_to_a_folder_and_bad_input_is_refused() { + let mut s = Session::new(); + let f = post(&mut s); + let dir = std::env::temp_dir().join(format!("figcraft-datafill-{}", std::process::id())); + std::fs::create_dir_all(&dir).unwrap(); + let r = ex( + &mut s, + "data.fill", + json!({"id": f, "rows": [{"name": "Post/1: hero", "Title": "A"}, {"Title": "B"}], "dir": dir.to_string_lossy(), "scale": 0.25}), + ); + let files: Vec = r["files"].as_array().unwrap().iter().map(|v| v.as_str().unwrap().to_string()).collect(); + assert_eq!(files.len(), 2); + assert!(files[0].ends_with("Post-1- hero.png"), "{files:?}"); + assert!(files.iter().all(|p| std::fs::metadata(p).is_ok_and(|m| m.len() > 0))); + let _ = std::fs::remove_dir_all(&dir); + for bad in [json!({"id": f}), json!({"id": f, "rows": [1, 2]}), json!({"id": f, "rows": [], "format": "gif"}), json!({"id": 999_999, "rows": []})] + { + assert!(s.execute("data.fill", &bad).is_err(), "{bad}"); + } +} + +#[test] +fn each_row_comes_in_every_format() { + let mut s = Session::new(); + let f = idv(&ex(&mut s, "frame.create", json!({"x": 0, "y": 0, "width": 1080, "height": 1350, "name": "Post"}))); + ex(&mut s, "layout.add", json!({"ids": [f], "direction": "vertical"})); + ex(&mut s, "node.set", json!({"id": f, "props": {"sizingV": "fixed", "padding": 80}})); + let t = idv(&ex(&mut s, "text.create", json!({"text": "Título", "x": 0, "y": 0, "parent": f, "props": {"name": "Title", "fontSize": 96}}))); + ex(&mut s, "node.set", json!({"id": t, "props": {"sizingH": "fill", "textAutoResize": "height"}})); + let r = ex( + &mut s, + "data.fill", + json!({"id": f, "formats": [ + {"name": "feed", "width": 1080, "height": 1350}, {"name": "story", "width": 1080, "height": 1920}, {"width": 1080, "height": 1080} + ], "rows": [{"name": "capa", "Title": "Site em 7 dias"}, {"name": "prova", "Title": "Lighthouse 100"}]}), + ); + let ids: Vec = r["ids"].as_array().unwrap().iter().map(|v| NodeId(v.as_u64().unwrap())).collect(); + assert_eq!(ids.len(), 6); + let doc = s.doc().unwrap(); + let names: Vec = ids.iter().map(|i| doc.node(*i).unwrap().name.clone()).collect(); + assert_eq!(names, ["capa-feed", "capa-story", "capa-1080x1080", "prova-feed", "prova-story", "prova-1080x1080"]); + let size = |i: NodeId| (doc.node(i).unwrap().width, doc.node(i).unwrap().height); + assert_eq!(size(ids[1]), (1080.0, 1920.0)); + assert_eq!(size(ids[2]), (1080.0, 1080.0)); + assert_eq!(text(&s, ids[4], "Title"), "Lighthouse 100"); + // Formats of a row stack downwards; rows go right without overlapping. + let at = |i: NodeId| (doc.node(i).unwrap().transform.as_coeffs()[4], doc.node(i).unwrap().transform.as_coeffs()[5]); + assert_eq!(at(ids[0]).0, at(ids[1]).0); + assert!(at(ids[1]).1 >= at(ids[0]).1 + 1350.0); + assert!(at(ids[3]).0 >= at(ids[0]).0 + 1080.0); + for bad in [json!([]), json!([{"width": 0, "height": 10}]), json!("feed")] { + assert!(s.execute("data.fill", &json!({"id": f, "rows": [{}], "formats": bad})).is_err(), "{bad}"); + } +} + +#[test] +fn review_export_names_are_unique_and_failures_are_reported() { + let mut s = Session::new(); + let f = post(&mut s); + let dir = std::env::temp_dir().join(format!("figcraft-datafill-names-{}", std::process::id())); + std::fs::create_dir_all(&dir).unwrap(); + let r = ex( + &mut s, + "data.fill", + json!({"id": f, "rows": [{"name": "Post"}, {"name": "post"}, {"name": "a/b"}, {"name": "a:b"}], "dir": dir.to_string_lossy(), "scale": 0.1}), + ); + let files: Vec = r["files"].as_array().unwrap().iter().map(|v| v.as_str().unwrap().to_string()).collect(); + let lower: std::collections::HashSet = files.iter().map(|f| f.to_lowercase()).collect(); + assert_eq!(lower.len(), 4, "one file per copy: {files:?}"); + assert!(files.iter().all(|p| std::fs::metadata(p).is_ok()), "{files:?}"); + let _ = std::fs::remove_dir_all(&dir); + // A folder that can't be written: the copies stay and every failure is reported. + let r = ex(&mut s, "data.fill", json!({"id": f, "rows": [{"name": "x"}], "dir": "/nonexistent-figcraft-dir/out"})); + assert_eq!(r["ids"].as_array().unwrap().len(), 1); + assert_eq!(r["errors"].as_array().map(Vec::len), Some(1), "{r}"); + assert!(s.doc().unwrap().contains(NodeId(r["ids"][0].as_u64().unwrap()))); +} diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 79e7be0d5..1690d0a94 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -22,6 +22,7 @@ pub mod codegen; pub mod collab; pub mod component_codegen; pub mod components; +pub mod datafill; pub mod dev_resources; pub mod devcompare; pub mod devinspect; @@ -59,6 +60,7 @@ pub mod synthetic; pub mod synthetic_ds; pub mod templates; pub mod textedit; +pub mod textfit; pub mod textpreview; pub mod tools; pub mod vectoredit; @@ -1643,6 +1645,8 @@ mod cursor_tests; #[cfg(test)] mod dark_page_text_tests; #[cfg(test)] +mod datafill_tests; +#[cfg(test)] mod design_paste_tests; #[cfg(test)] mod dev_resources_tests; @@ -1867,6 +1871,8 @@ mod text_style_picker_tests; #[cfg(test)] mod text_tail_tests; #[cfg(test)] +mod textfit_tests; +#[cfg(test)] mod theme_pages_tests; #[cfg(test)] mod tiff_tests; diff --git a/crates/engine/src/plugins.rs b/crates/engine/src/plugins.rs index be997079a..be2222933 100644 --- a/crates/engine/src/plugins.rs +++ b/crates/engine/src/plugins.rs @@ -111,6 +111,8 @@ const DENIED: &[&str] = &[ "edit.redo", "edit.repeat", "command.batch", + // Runs other commands inside (duplicate, edit, export), past this policy, like a batch. + "data.fill", // Network sessions, online files and their recovery copies on disk. "collab.", // Opens files in new windows. diff --git a/crates/engine/src/plugins_tests.rs b/crates/engine/src/plugins_tests.rs index 657b6825f..7ff16cf3a 100644 --- a/crates/engine/src/plugins_tests.rs +++ b/crates/engine/src/plugins_tests.rs @@ -169,6 +169,7 @@ fn files_dialogs_history_and_plugins_are_off_limits() { ("plugin.remove", json!({"id": "org.test.deny"})), ("edit.undo", json!({})), ("command.batch", json!({"commands": [{"command": "file.saveAs", "params": {"path": target}}]})), + ("data.fill", json!({"id": a, "rows": [{}], "dir": dir.to_string_lossy()})), ("variable.export", json!({"format": "css", "path": target})), ("codeConnect.export", json!({"path": target})), ("codeConnect.import", json!({"path": "/etc/passwd"})), diff --git a/crates/engine/src/textfit.rs b/crates/engine/src/textfit.rs new file mode 100644 index 000000000..f0cf3bba9 --- /dev/null +++ b/crates/engine/src/textfit.rs @@ -0,0 +1,115 @@ +//! `text.fit`: text sized to fit its box, for posts and cards whose copy changes (a carousel +//! filled from data, a translated headline). The largest font size, down to a floor, at which the +//! text stays within `maxLines` lines and its box's height; then a last line that is a single word +//! (an orphan) is avoided by shrinking a little more, else by keeping the last two words together +//! with a no-break space. Every style run scales by the same factor, so mixed sizes keep their +//! proportions. + +use figcraft_doc::*; +use serde_json::{Value, json}; + +use crate::cmd::CommandSpec; +use crate::params::*; +use crate::{Result, Session, bad, spec}; + +const CMD: &str = "text.fit"; + +pub fn specs() -> Vec { + vec![spec!( + "text.fit", + "Fit text to its box", + "{ids? (text layers; default the selection), maxLines? (default: no limit but the box height), minSize? (smallest font size, px; default 60% of the current), orphans? (avoid a one-word last line; default true)} needs a fixed width (fixed or auto-height text) → {fitted: [{id, fontSize, lines, fits, orphan}]}", + true, + fit + )] +} + +/// The layout of `t` with every run's font size times `k`, at `width`: (line count, height, +/// words on the last line). +fn measure(t: &TextData, k: f64, width: f64) -> (usize, f64, usize) { + let mut t = t.clone(); + let n = t.char_count(); + t.restyle(0, n, |s| s.font_size = (s.font_size * k).clamp(1.0, 5000.0)); + let l = figcraft_text::layout(&t, Some(width), None); + let last = l.lines.last().map_or(0, |line| { + t.characters.chars().skip(line.char_start).take(line.char_end.saturating_sub(line.char_start)).collect::().split_whitespace().count() + }); + (l.lines.len(), l.height, last) +} + +fn fit(s: &mut Session, p: &Value) -> Result { + let ids = req_targets(CMD, s, p)?; + let max_lines = num(p, "maxLines").filter(|v| v.is_finite() && *v >= 1.0).map(|v| v.min(1000.0) as usize); + let orphans = boolean(p, "orphans").unwrap_or(true); + let mut out = Vec::new(); + let doc = s.doc_mut()?; + for id in ids { + let n = doc.node(id).ok_or_else(|| bad(CMD, format!("no layer {id}")))?; + let NodeKind::Text(t) = &n.kind else { return Err(bad(CMD, format!("{id} is not text"))) }; + if t.auto_resize == TextAutoResize::WidthAndHeight { + return Err(bad(CMD, format!("{id} grows to its text: give it a fixed width (auto height or fixed) first"))); + } + let (width, height_cap) = (n.width, if t.auto_resize == TextAutoResize::None { n.height } else { f64::INFINITY }); + let size = t.style.font_size.max(1.0); + let min = num(p, "minSize").filter(|v| v.is_finite() && *v >= 1.0).unwrap_or(size * 0.6).min(size); + let fits = |m: (usize, f64, usize)| max_lines.is_none_or(|ml| m.0 <= ml) && m.1 <= height_cap + 0.5; + // The largest factor in [min/size, 1] that fits: binary search to a tenth of a pixel. + let (mut lo, mut hi) = (min / size, 1.0); + let k = if fits(measure(t, 1.0, width)) { + 1.0 + } else if !fits(measure(t, lo, width)) { + lo + } else { + for _ in 0..24 { + let mid = (lo + hi) / 2.0; + if fits(measure(t, mid, width)) { + lo = mid + } else { + hi = mid + } + if (hi - lo) * size < 0.1 { + break; + } + } + lo + }; + // Whole-tenth sizes read better in the panel. + let mut k = ((size * k * 10.0).floor() / 10.0) / size; + let mut m = measure(t, k, width); + let mut orphan = orphans && m.0 > 1 && m.2 == 1; + let mut nbsp = false; + if orphan { + // Up to 8% smaller (not below the floor) may pull a word down to the last line. + let mut tries = 0; + while orphan && tries < 8 && size * k * 0.99 >= min { + k *= 0.99; + m = measure(t, k, width); + orphan = m.0 > 1 && m.2 == 1; + tries += 1; + } + if orphan { + nbsp = true; + } + } + let n = doc.get_mut(id)?; + let NodeKind::Text(t) = &mut n.kind else { continue }; + let count = t.char_count(); + t.restyle(0, count, |st| st.font_size = ((st.font_size * k * 10.0).round() / 10.0).clamp(1.0, 5000.0)); + // Same character count, so style runs keep their ranges. + let joined = if nbsp && let Some(i) = t.characters.trim_end().rfind(' ') { + t.characters.replace_range(i..i + 1, "\u{a0}"); + Some(i) + } else { + None + }; + let mut after = measure(t, 1.0, width); + // Keeping the last words together must not break the limit: an orphan is better. + if let Some(i) = joined.filter(|_| !fits(after)) { + t.characters.replace_range(i..i + '\u{a0}'.len_utf8(), " "); + after = measure(t, 1.0, width); + } + // Reported from the final text (rounded sizes, the no-break space), which callers rely on. + out.push(json!({"id": id.0, "fontSize": (t.style.font_size * 10.0).round() / 10.0, "lines": after.0, "fits": fits(after), "orphan": orphans && after.0 > 1 && after.2 == 1})); + } + Ok(json!({"fitted": out})) +} diff --git a/crates/engine/src/textfit_tests.rs b/crates/engine/src/textfit_tests.rs new file mode 100644 index 000000000..8d0a2ee55 --- /dev/null +++ b/crates/engine/src/textfit_tests.rs @@ -0,0 +1,104 @@ +//! `text.fit`: the largest size that fits the box and a line limit, orphans avoided, and +//! data.fill sizing each copy's text. + +use crate::Session; +use crate::components::tests::{ex, idv}; +use figcraft_doc::*; +use serde_json::json; + +/// A fixed-width (auto-height) headline of `width` px at 64px. Returns its id. +fn headline(s: &mut Session, text: &str, width: f64) -> NodeId { + let t = idv(&ex(s, "text.create", json!({"text": text, "x": 0, "y": 0, "props": {"name": "Headline", "fontSize": 64}}))); + ex(s, "node.set", json!({"id": t, "props": {"width": width, "textAutoResize": "height"}})); + t +} + +fn size(s: &Session, id: NodeId) -> f64 { + match &s.doc().unwrap().node(id).unwrap().kind { + NodeKind::Text(t) => t.style.font_size, + _ => 0.0, + } +} + +#[test] +fn text_shrinks_to_its_line_limit_and_no_further() { + let mut s = Session::new(); + let t = headline(&mut s, "Seu site e seu WhatsApp com IA, prontos em 7 dias", 600.0); + let r = ex(&mut s, "text.fit", json!({"ids": [t], "maxLines": 2})); + let f = &r["fitted"][0]; + assert_eq!(f["lines"], 2, "{r}"); + assert!(f["fits"].as_bool().unwrap()); + let fitted = size(&s, t); + assert!((64.0 * 0.6..64.0).contains(&fitted), "{fitted}"); + // The largest that fits: a pixel more breaks the limit. + ex(&mut s, "node.set", json!({"id": t, "props": {"fontSize": fitted + 1.0}})); + let again = ex(&mut s, "text.fit", json!({"ids": [t], "maxLines": 2})); + assert!((again["fitted"][0]["fontSize"].as_f64().unwrap() - fitted).abs() <= 0.2, "{again}"); + // Text that already fits keeps its size; one undo restores the original. + let short = headline(&mut s, "7 dias", 600.0); + ex(&mut s, "text.fit", json!({"ids": [short], "maxLines": 1})); + assert_eq!(size(&s, short), 64.0); + // A floor that can't fit reports it instead of going below (fit never grows text). + ex(&mut s, "node.set", json!({"id": t, "props": {"fontSize": 64}})); + let r = ex(&mut s, "text.fit", json!({"ids": [t], "maxLines": 1, "minSize": 50})); + assert_eq!(r["fitted"][0]["fits"], false); + assert_eq!(size(&s, t), 50.0); + // Text that grows to its content has no box to fit. + let auto = idv(&ex(&mut s, "text.create", json!({"text": "x", "x": 0, "y": 0}))); + assert!(s.execute("text.fit", &json!({"ids": [auto]})).is_err()); +} + +#[test] +fn a_one_word_last_line_is_avoided() { + let mut s = Session::new(); + // At 64px in 520px this breaks with "1s." alone on the last line. + let t = headline(&mut s, "Lighthouse 100, abre em menos de 1s.", 520.0); + let r = ex(&mut s, "text.fit", json!({"ids": [t]})); + assert_eq!(r["fitted"][0]["orphan"], false, "{r}"); + let doc = s.doc().unwrap(); + let NodeKind::Text(tx) = &doc.node(t).unwrap().kind else { panic!() }; + let l = figcraft_text::layout(tx, Some(520.0), None); + let last = l.lines.last().unwrap(); + let words = tx.characters.chars().skip(last.char_start).take(last.char_end - last.char_start).collect::(); + assert!(l.lines.len() == 1 || words.split_whitespace().count() > 1 || words.contains('\u{a0}'), "{words:?}"); +} + +#[test] +fn data_fill_sizes_each_copys_text() { + let mut s = Session::new(); + let f = idv(&ex(&mut s, "frame.create", json!({"x": 0, "y": 0, "width": 1080, "height": 1350, "name": "Post"}))); + let t = idv(&ex(&mut s, "text.create", json!({"text": "Curto", "x": 80, "y": 80, "parent": f, "props": {"name": "Headline", "fontSize": 96}}))); + ex(&mut s, "node.set", json!({"id": t, "props": {"width": 920, "textAutoResize": "height"}})); + let r = ex( + &mut s, + "data.fill", + json!({"id": f, "rows": [ + {"Headline": {"text": "Curto", "fit": {"maxLines": 2}}}, + {"Headline": {"text": "Landing page e atendente de WhatsApp com IA, prontos em sete dias úteis", "fit": {"maxLines": 2}}} + ]}), + ); + let ids: Vec = r["ids"].as_array().unwrap().iter().map(|v| NodeId(v.as_u64().unwrap())).collect(); + let head = |s: &Session, frame: NodeId| s.doc().unwrap().node(frame).unwrap().children[0]; + assert_eq!(size(&s, head(&s, ids[0])), 96.0, "short copy keeps its size"); + assert!(size(&s, head(&s, ids[1])) < 96.0, "long copy shrinks"); + assert_eq!(size(&s, t), 96.0, "the source is untouched"); +} + +#[test] +fn review_fits_is_reported_from_the_final_text() { + let mut s = Session::new(); + for (text, width, lines) in [ + ("Seu site e seu WhatsApp com IA, prontos em 7 dias", 600.0, 2.0), + ("Lighthouse 100, abre em menos de 1s.", 520.0, 2.0), + ("Curto", 300.0, 1.0), + ] { + let t = headline(&mut s, text, width); + let r = ex(&mut s, "text.fit", json!({"ids": [t], "maxLines": lines})); + let f = &r["fitted"][0]; + let doc = s.doc().unwrap(); + let NodeKind::Text(tx) = &doc.node(t).unwrap().kind else { panic!() }; + let real = figcraft_text::layout(tx, Some(width), None).lines.len(); + assert_eq!(f["lines"].as_u64().unwrap() as usize, real, "{r}"); + assert_eq!(f["fits"].as_bool().unwrap(), real as f64 <= lines, "{r}"); + } +} diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 596feda6e..1e6799a92 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -2171,6 +2171,8 @@ status = "draft — needs native review" "text.removeFromPath" = "Quitar texto del trazado" "text.rescanFonts" = "Volver a buscar fuentes instaladas" "text.set" = "Establecer texto" +"data.fill" = "Rellenar copias con datos" +"text.fit" = "Ajustar texto a su caja" "text.setFeatures" = "Funciones OpenType" "text.setVariations" = "Ejes de fuente variable" "text.sizeDown" = "Reducir tamaño de fuente" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index d8f857e0f..9a816e2ca 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -2155,6 +2155,8 @@ status = "draft — needs native review" "text.preview" = "Visualizar alteração de texto" "text.removeFromPath" = "Remover texto do caminho" "text.set" = "Definir texto" +"data.fill" = "Preencher cópias com dados" +"text.fit" = "Ajustar texto à caixa" "text.setFeatures" = "Recursos OpenType" "text.setVariations" = "Eixos de fonte variável" "text.sizeDown" = "Diminuir tamanho da fonte" diff --git a/docs/mcp.md b/docs/mcp.md index dfea95cc2..5af124f9b 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -330,6 +330,38 @@ tips; headless, it only sets the preference. {"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"export","arguments":{"format":"png","path":"dashboard.png"}}} ``` +### Filling copies with data + +`data.fill {id, rows, gap?, dir?, format?, scale?}` repeats a frame once per row (a carousel, a set +of posts, a card per item) in one undo step: each key of a row names layers in the copy, and a +string (or number) sets their text, `{text?, fill?, visible?}` sets more; `name` names the copy +(default " "). Copies go in a row to the right, `gap` apart (default 100). With `dir`, each +copy is exported there as `.` (png by default) after the edits land. Returns `{ids, +missing (keys no layer is named), files?}`. + +Copy that changes length per row can size itself: `{"Headline": {"text": "…", "fit": {"maxLines": 2}}}` runs +`text.fit` on those layers after the text is set. + +`formats: [{name?, width, height}]` makes every row once per size: the copy is resized so its auto layout +reflows, named `-` (default `x`), and placed under the row's previous +format. Text `fit` runs after the resize. Use case: one call turns a 1080×1350 post into feed, story +(1080×1920) and square (1080×1080) files for each slide of a carousel; the frame must be auto layout (fixed- +position children keep their place). + +`text.fit {ids?, maxLines?, minSize?, orphans?}` gives a text layer with a fixed width (auto height or fixed size) +the largest font size, down to `minSize` (default 60% of the current), at which it stays within `maxLines` lines +and its box's height. Every style run scales by the same factor. A one-word last line (an orphan) is avoided by +shrinking up to 8% more, else by keeping the last two words together with a no-break space. Text never grows. +Returns `{fitted: [{id, fontSize, lines, fits, orphan}]}`. Use case: a carousel slide "Lighthouse 100. Loads in under +1s." at 96px broke into three lines with "1s." alone; with `fit: {maxLines: 3}` it is two balanced lines. + +```json +{"command": "data.fill", "params": {"id": 80, "dir": "out/carousel", "scale": 1, "rows": [ + {"name": "01-cover", "Headline": "Your website and AI chat assistant in 7 days", "Badge": {"visible": true}}, + {"name": "02-proof", "Headline": "Lighthouse 100, loads in under a second", "Badge": {"visible": false}} +]}} +``` + ### Sections, handoff and arrow keys `run_command` with `object.wrapInSection {ids?, name?}` (Wrap in new section: layers on the page or From 2118480e7af3c50334bf0b4c599ecb6a3ee010bd Mon Sep 17 00:00:00 2001 From: vetlucasmartins Date: Wed, 21 Oct 2026 20:03:46 +0100 Subject: [PATCH 463/817] Dev Mode: React + Tailwind page code and Tailwind theme export MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - inspect.code {language: "tailwind"}: a layer tree as a React component styled with Tailwind CSS v4 utilities, no stylesheet. Auto layout maps to flex utilities on the spacing scale; fixed-width auto layout frames, text and wide layers become fluid (w-full max-w-[…]); instances are inlined with their overrides, except those connected to code (codeConnect), which are their snippet with one import each; bound variables are theme utilities (bg-accent, rounded-card). - mobile: (same layer names): mobile-first code, desktop classes that differ behind lg:, resets for desktop defaults, padding compared per side; layers only on desktop are hidden below lg, those only on mobile are listed in the header. - variable.export {format: "tailwind"}: @import "tailwindcss" and an @theme block (--color-*, --radius-*, --text-*, --spacing-*, --font-*), names unique per file and shared with page code. Builds on the token roles of the CSS export px fix (#1008). --- crates/engine/src/cmd/variables_io.rs | 24 +- crates/engine/src/codegen.rs | 87 ++++- crates/engine/src/lib.rs | 3 + crates/engine/src/tailwind.rs | 490 ++++++++++++++++++++++++++ crates/engine/src/tailwind_tests.rs | 335 ++++++++++++++++++ docs/mcp.md | 16 + 6 files changed, 934 insertions(+), 21 deletions(-) create mode 100644 crates/engine/src/tailwind.rs create mode 100644 crates/engine/src/tailwind_tests.rs diff --git a/crates/engine/src/cmd/variables_io.rs b/crates/engine/src/cmd/variables_io.rs index 0f55ea2c0..c74c46fe9 100644 --- a/crates/engine/src/cmd/variables_io.rs +++ b/crates/engine/src/cmd/variables_io.rs @@ -18,7 +18,7 @@ pub fn specs() -> Vec { spec!( "variable.export", "Export variables", - "{collections? [ids or names; default every collection of this file, not library copies], format? (json (default): the local variables JSON that variable.import reads | css: custom properties, the default mode on :root and each other mode on [data-=\"\"]; numbers in px unless layers or scopes use them as opacity or font weight), path? (write it there)} → {text}, or {path} when written", + "{collections? [ids or names; default every collection of this file, not library copies], format? (json (default): the local variables JSON that variable.import reads | css: custom properties, the default mode on :root and each other mode on [data-=\"\"]; numbers in px unless layers or scopes use them as opacity or font weight | tailwind: a Tailwind CSS v4 stylesheet, the default mode as an @theme block named the way inspect.code's tailwind utilities read them: --color-*, --radius-*, --text-*, --spacing-*, --font-*, unique per file), path? (write it there)} → {text}, or {path} when written", false, export ), @@ -46,8 +46,9 @@ fn export(s: &mut Session, p: &Value) -> Result { let text = match string(p, "format").as_deref().unwrap_or("json") { "json" => serde_json::to_string_pretty(&figcraft_format::rest::export_variables(&doc.variables, &colls)) .map_err(|e| EngineError::Other(e.to_string()))?, - "css" => css(doc, &colls), - _ => return Err(bad(cmd, "format: json|css")), + "css" => css(doc, &colls, false), + "tailwind" => css(doc, &colls, true), + _ => return Err(bad(cmd, "format: json|css|tailwind")), }; match string(p, "path") { Some(path) => { @@ -66,16 +67,23 @@ fn css_safe(text: &str) -> String { /// Each collection's variables as custom properties (named as generated code names them): the /// default mode's values on `:root`, every other mode's on `[data-=""]`; /// aliases are `var(--name)`. -fn css(doc: &Document, colls: &[&Collection]) -> String { +fn css(doc: &Document, colls: &[&Collection], tailwind: bool) -> String { let vars = &doc.variables; + // Tailwind theme names, unique per file and the same ones page code reads. + let theme = crate::tailwind::Theme::new(doc); + let name = |v: &Variable| if tailwind { theme.name(v) } else { css_var_of(v) }; // Lengths need a unit where CSS reads them (`border-radius: var(--radius)`); opacity and // font weight don't. let roles = crate::token_roles::Roles::new(doc); - let mut out = String::new(); + let mut out = if tailwind { "@import \"tailwindcss\";\n\n".to_string() } else { String::new() }; for c in colls { let attr = css_var_name(&c.name); for (i, m) in c.modes.iter().enumerate() { - let sel = if i == 0 { ":root".to_string() } else { format!("[data-{}=\"{}\"]", attr.trim_start_matches('-'), css_safe(&m.name)) }; + let sel = match i { + 0 if tailwind => "@theme".to_string(), + 0 => ":root".to_string(), + _ => format!("[data-{}=\"{}\"]", attr.trim_start_matches('-'), css_safe(&m.name)), + }; out.push_str(&format!("/* {} · {} */\n{sel} {{\n", css_safe(&c.name), css_safe(&m.name))); for v in vars.variables.iter().filter(|v| v.collection == c.id) { let value = match v.values.get(&m.id) { @@ -85,12 +93,12 @@ fn css(doc: &Document, colls: &[&Collection]) -> String { Some(VariableValue::String(t)) => format!("\"{}\"", css_safe(t)), Some(VariableValue::Boolean(b)) => b.to_string(), Some(VariableValue::Alias(a)) => match vars.get(a) { - Some(t) => format!("var({})", css_var_of(t)), + Some(t) => format!("var({})", name(t)), None => continue, }, None => continue, }; - out.push_str(&format!(" {}: {value};\n", css_var_of(v))); + out.push_str(&format!(" {}: {value};\n", name(v))); } out.push_str("}\n"); } diff --git a/crates/engine/src/codegen.rs b/crates/engine/src/codegen.rs index 0871f886d..8997587ca 100644 --- a/crates/engine/src/codegen.rs +++ b/crates/engine/src/codegen.rs @@ -18,7 +18,7 @@ pub fn specs() -> Vec { vec![spec!( "inspect.code", "Code for layer", - "{id?, language?: css|html|react|leptos|swiftui|compose (default css; html, react and leptos are the whole layer tree; components take their properties as parameters, instances pass their values; a component connected to code (codeConnect.set) gives its import and snippet instead), unit?: px|rem (CSS, HTML, React and Leptos; default px), rootFontSize? (rem: pixels per rem, default 16)} → {code, language, connected}", + "{id?, language?: css|html|react|leptos|tailwind|swiftui|compose (default css; html, react and leptos are the whole layer tree; components take their properties as parameters, instances pass their values; a component connected to code (codeConnect.set) gives its import and snippet instead; tailwind is React with Tailwind CSS v4 utilities for pages: fluid auto layout boxes, instances inlined with their overrides, bound variables as theme utilities), mobile? (tailwind: a mobile frame with the same layer names; the code is mobile first with the desktop layer's classes behind lg:), unit?: px|rem (CSS, HTML, React and Leptos; default px), rootFontSize? (rem: pixels per rem, default 16)} → {code, language, connected}", false, |s, p| { let cmd = "inspect.code"; @@ -40,7 +40,14 @@ pub fn specs() -> Vec { return Err(bad(cmd, "no such layer")); } let connected = crate::code_connect::link(doc, id, lang).is_some(); - let code = code_for(doc, id, lang); + let mobile = match get(p, "mobile") { + None | Some(serde_json::Value::Null) => None, + Some(v) => Some(id_of(v).filter(|m| doc.contains(*m)).ok_or_else(|| bad(cmd, "mobile: the id of a mobile frame"))?), + }; + let code = match (lang, mobile) { + (CodeLang::Tailwind, Some(m)) => crate::tailwind::code(doc, id, Some(m)), + _ => code_for(doc, id, lang), + }; let code = match rem { Some(root) if lang.is_web() => px_to_rem(&code, root), _ => code, @@ -61,18 +68,22 @@ pub enum CodeLang { React, /// A Leptos component (`view!` markup) with its stylesheet. Leptos, + /// A React function component styled with Tailwind CSS v4 utilities (no stylesheet). + Tailwind, SwiftUi, Compose, } impl CodeLang { - pub const ALL: [CodeLang; 6] = [CodeLang::Css, CodeLang::Html, CodeLang::React, CodeLang::Leptos, CodeLang::SwiftUi, CodeLang::Compose]; + pub const ALL: [CodeLang; 7] = + [CodeLang::Css, CodeLang::Html, CodeLang::React, CodeLang::Leptos, CodeLang::Tailwind, CodeLang::SwiftUi, CodeLang::Compose]; pub fn id(self) -> &'static str { match self { CodeLang::Css => "css", CodeLang::Html => "html", CodeLang::React => "react", CodeLang::Leptos => "leptos", + CodeLang::Tailwind => "tailwind", CodeLang::SwiftUi => "swiftui", CodeLang::Compose => "compose", } @@ -83,13 +94,14 @@ impl CodeLang { CodeLang::Html => "HTML + CSS", CodeLang::React => "React", CodeLang::Leptos => "Leptos", + CodeLang::Tailwind => "React + Tailwind", CodeLang::SwiftUi => "SwiftUI", CodeLang::Compose => "Compose", } } /// Languages whose lengths are CSS pixels (they can be shown in rem). pub fn is_web(self) -> bool { - matches!(self, CodeLang::Css | CodeLang::Html | CodeLang::React | CodeLang::Leptos) + matches!(self, CodeLang::Css | CodeLang::Html | CodeLang::React | CodeLang::Leptos | CodeLang::Tailwind) } pub fn from_id(s: &str) -> Option { if s.eq_ignore_ascii_case("tsx") || s.eq_ignore_ascii_case("jsx") { @@ -194,6 +206,7 @@ pub fn code_for(doc: &Document, id: NodeId, lang: CodeLang) -> String { match lang { CodeLang::Css => css(doc, id), CodeLang::Html => html(doc, id), + CodeLang::Tailwind => crate::tailwind::code(doc, id, None), CodeLang::React | CodeLang::Leptos | CodeLang::SwiftUi | CodeLang::Compose => crate::component_codegen::code(doc, id, lang), } } @@ -316,25 +329,32 @@ pub(crate) fn indent(depth: usize) -> String { /// The CSS custom properties generated code uses: name → fallback value, in first-use order. #[derive(Default)] -pub(crate) struct Tokens(pub Vec<(String, String)>); +pub(crate) struct Tokens { + vars: Vec<(String, String)>, + /// Name variables as Tailwind theme variables (`--color-accent`), not by their CSS name. + pub tailwind: bool, + /// The file's theme names (computed on first use). + theme: Option, +} impl Tokens { /// `var(--name, value)`, remembering the variable. - fn var(&mut self, variable: &Variable, value: String) -> String { - let name = css_var_of(variable); + fn var(&mut self, doc: &Document, variable: &Variable, value: String) -> String { + let name = + if self.tailwind { self.theme.get_or_insert_with(|| crate::tailwind::Theme::new(doc)).name(variable) } else { css_var_of(variable) }; let out = format!("var({name}, {value})"); - if !self.0.iter().any(|(n, _)| *n == name) { - self.0.push((name, value)); + if !self.vars.iter().any(|(n, _)| *n == name) { + self.vars.push((name, value)); } out } /// A `:root` rule declaring the variables (empty without any). pub fn root_rule(&self) -> String { - if self.0.is_empty() { + if self.vars.is_empty() { return String::new(); } - let decls: String = self.0.iter().map(|(n, v)| format!(" {n}: {v};\n")).collect(); + let decls: String = self.vars.iter().map(|(n, v)| format!(" {n}: {v};\n")).collect(); format!(":root {{\n{decls}}}\n") } } @@ -365,7 +385,7 @@ pub fn css_var_of(v: &Variable) -> String { /// `value`, or a reference to the variable bound to the first of `fields` that has one. fn tok(doc: &Document, n: &Node, fields: &[&str], value: String, t: &mut Tokens) -> String { match fields.iter().find_map(|f| crate::devinspect::bound_variable(doc, n, f)) { - Some(v) => t.var(v, value), + Some(v) => t.var(doc, v, value), None => value, } } @@ -659,6 +679,14 @@ pub(crate) struct Markup<'c, 'a> { /// Each layer's path in the tree (names with sibling counts), class and declarations, so /// variants can be compared layer by layer. pub rules: Vec<(String, String, String)>, + /// Instances as their own (overridden) layers instead of component calls, except those + /// connected to code (page code). + pub inline: bool, + /// Auto layout frames and text as fluid boxes (`width: 100%` up to their width) for pages. + pub fluid: bool, + /// With `fluid`, other layers at least this share of the root's width are fluid too (a + /// divider, a banner image); smaller ones (icons) keep their size. Default: none. + pub fluid_leaves: f64, } impl<'c, 'a> Markup<'c, 'a> { @@ -673,6 +701,9 @@ impl<'c, 'a> Markup<'c, 'a> { root_class: None, root_attrs: String::new(), rules: Vec::new(), + inline: false, + fluid: false, + fluid_leaves: f64::INFINITY, } } @@ -754,7 +785,10 @@ impl<'c, 'a> Markup<'c, 'a> { } } // Nested instances are calls (component code), in a wrapper that places them when needed. - if self.code() && !root && matches!(n.kind, NodeKind::Instance { .. }) { + // Page code inlines instances, except those connected to code (codeConnect.set): their + // snippet, e.g. a design-system `"}), + ); + let p = idv(&ex(&mut s, "frame.create", json!({"x": 0, "y": 300, "width": 1440, "height": 400, "name": "Landing"}))); + ex(&mut s, "layout.add", json!({"ids": [p], "direction": "vertical"})); + for text in ["Agendar diagnóstico", "Ver exemplos"] { + let i = idv(&ex(&mut s, "instance.create", json!({"component": comp, "x": 0, "y": 0, "parent": p}))); + ex(&mut s, "instance.setProperties", json!({"id": i, "properties": {"Label": text}})); + } + let out = code(&mut s, p, json!({})); + assert_eq!(out.matches("import { Button } from \"@/components/ui/button\";").count(), 1, "{out}"); + assert!(out.contains("`, with each import once at the top. A design + system mapped to shadcn/ui this way exports pages that use the project's own components. Bound variables become theme + utilities (`bg-accent`, `rounded-card`, `text-muted`) that `variable.export {format: "tailwind"}` + declares: `@import "tailwindcss";` and an `@theme` block named by namespace (`--color-*`, + `--radius-*`, `--text-*`, `--spacing-*`, `--font-*`; a number's namespace and unit come from what + layers bind it to), other modes on `[data-=""]`. With `mobile: ` (the + same layer names, mobile layout) the code is mobile first: the mobile frame's classes, the + desktop frame's that differ behind `lg:`, and layers only on desktop `hidden` plus `lg:flex` + (auto layout frames) or `lg:block` (other layers). - **Component code:** `inspect.code {id, language: react|leptos|swiftui|compose}` on a component, a component set or a variant writes the component as a reusable unit: React (TSX) with a props interface, Leptos with a `#[component]` function (`#[prop]` defaults, `view!` markup), SwiftUI From f0e75e183b86b31c16334aea39be2fd9e98768dd Mon Sep 17 00:00:00 2001 From: Ridzzz0Alam Date: Wed, 21 Oct 2026 21:06:59 +0200 Subject: [PATCH 464/817] M1: swap defaults past the layer cap say so (#981) Instance swap defaults that name an in-file main skipped by the layer cap were reported as "isn't in the file": only instance targets fed the capped-mains list. Defaults now feed it too. --- crates/format/src/fig/layer_cap_tests.rs | 21 +++++++++++++++++++++ crates/format/src/fig/map.rs | 21 +++++++++++++-------- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/crates/format/src/fig/layer_cap_tests.rs b/crates/format/src/fig/layer_cap_tests.rs index 6eeb15f4e..2c562ba71 100644 --- a/crates/format/src/fig/layer_cap_tests.rs +++ b/crates/format/src/fig/layer_cap_tests.rs @@ -103,6 +103,27 @@ fn instances_of_a_main_the_cap_kept_out_say_so() { assert!(!doc.nodes().any(|n| n.name == "Local main")); } +#[test] +fn swap_defaults_the_cap_kept_out_say_so() { + // A kept main's instance swap default names a main with no instances, which comes after + // enough layers to be skipped at the cap. + let swap = o(vec![ + ("id", g(70)), + ("name", Kv::Str("Icon".into())), + ("type", Kv::Enum("INSTANCE_SWAP")), + ("initialValue", o(vec![("guidValue", g(900))])), + ]); + let mut nodes = vec![node(1, None, "DOCUMENT", "Document", vec![]), node(2, Some(1), "CANVAS", "Page", vec![])]; + nodes.push(node(50, Some(2), "SYMBOL", "Card", vec![("size", xy(10.0, 10.0)), ("componentPropDefs", Kv::Array(vec![swap]))])); + nodes.extend(main(60, 2, "Filler", 40)); + nodes.extend(main(900, 2, "Icon main", 10)); + let (doc, warnings) = import_at(&o(vec![("nodeChanges", Kv::Array(nodes))]), 30); + assert!(doc.nodes().any(|n| n.name == "Card")); + assert!(!doc.nodes().any(|n| n.name == "Icon main")); + assert!(warnings.iter().any(|w| w.starts_with("instance swap properties whose default component was past the layer limit")), "{warnings:?}"); + assert!(!warnings.iter().any(|w| w.contains("isn't in the file")), "{warnings:?}"); +} + #[test] fn a_whole_file_past_the_cap_keeps_its_library_links_and_says_so_once() { // A 1 001-layer library main used 210 times: about 210 000 layers in a file far too small to diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index 7eb974daf..b18f8a2bf 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -45,7 +45,7 @@ pub(super) fn to_rest(msg: &Kv, name: &str, max_nodes: usize) -> (Value, Vec= m.max_nodes { - let capped: Vec = m.instance_mains.difference(&m.mapped_mains).map(|id| json!(id)).collect(); + let capped: Vec = m.referenced_mains.difference(&m.mapped_mains).map(|id| json!(id)).collect(); if !capped.is_empty() { out[crate::rest::FIG_CAPPED_MAINS_FIELD] = Value::Array(capped); } @@ -397,9 +397,9 @@ struct Mapper<'a> { library_scan_count: usize, warnings: Vec, count: usize, - /// The mains in the file that instances name, and the mains mapped as layers: the difference - /// is what the layer cap kept out. - instance_mains: BTreeSet, + /// The mains in the file that instances or instance swap defaults name, and the mains mapped + /// as layers: the difference is what the layer cap kept out. + referenced_mains: BTreeSet, mapped_mains: BTreeSet, /// Most layers produced or scanned, instance expansion included; the one place the cap comes /// from (see [`super::layer_budget`]). @@ -478,7 +478,7 @@ impl<'a> Mapper<'a> { library_scan_count: 0, warnings: Vec::new(), count: 0, - instance_mains: BTreeSet::new(), + referenced_mains: BTreeSet::new(), mapped_mains: BTreeSet::new(), max_nodes, networks: Vec::new(), @@ -1869,7 +1869,12 @@ impl<'a> Mapper<'a> { "BOOL" => json!({"type": "BOOLEAN", "defaultValue": init.and_then(|i| i.get("boolValue")).and_then(Kv::bool).unwrap_or(true)}), "TEXT" => json!({"type": "TEXT", "defaultValue": init.and_then(prop_text).unwrap_or("")}), "INSTANCE_SWAP" => match init.and_then(|i| i.get("guidValue")).and_then(guid) { - Some(g) => json!({"type": "INSTANCE_SWAP", "defaultValue": g}), + Some(g) => { + if self.nodes.contains_key(&g) { + self.referenced_mains.insert(g.clone()); + } + json!({"type": "INSTANCE_SWAP", "defaultValue": g}) + } None => continue, }, "VARIANT" => json!({"type": "VARIANT"}), @@ -2013,8 +2018,8 @@ impl<'a> Mapper<'a> { self.warn("instances of components that aren't in the file show no layers"); return None; } - if !self.instance_mains.contains(&sym) { - self.instance_mains.insert(sym.clone()); + if !self.referenced_mains.contains(&sym) { + self.referenced_mains.insert(sym.clone()); } if outer.is_some_and(|i| i.symbols.contains(&sym)) { return None; From 0ab000b74b29e2f691b59386f46997107453fc3b Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 21 Oct 2026 15:46:57 -0400 Subject: [PATCH 465/817] ci: add SonarCloud scan via shared reusable workflow Calls storytold/craft-common-actions/.github/workflows/sonarcloud.yml@main with secrets: inherit. Adds SonarCloud badge to README where missing and removes the redundant sonar-project.properties (config now passed by the reusable workflow). --- .github/workflows/sonarcloud.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/sonarcloud.yml diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml new file mode 100644 index 000000000..ecee45a6d --- /dev/null +++ b/.github/workflows/sonarcloud.yml @@ -0,0 +1,20 @@ +name: SonarCloud + +on: + push: + branches: [main] + pull_request: + types: [opened, synchronize, reopened] + +permissions: + contents: read + +concurrency: + group: sonarcloud-${{ github.ref }} + cancel-in-progress: true + +jobs: + sonarcloud: + # Tracked at @main so org-wide CI improvements propagate without PR churn. + uses: storytold/craft-common-actions/.github/workflows/sonarcloud.yml@main + secrets: inherit From 9f2470b5bd132ac0fb889b21fbf8cdb4726b5f2e Mon Sep 17 00:00:00 2001 From: vetlucasmartins Date: Wed, 21 Oct 2026 21:00:02 +0100 Subject: [PATCH 466/817] Tailwind theme names: resolve collisions in linear time Clash detection compared every variable with every other, and suffixes rescanned the taken list, so a file with very many variables made the export quadratic. Counts in a HashMap, taken names in a HashSet and a next suffix per base keep it linear. --- crates/engine/src/tailwind.rs | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/crates/engine/src/tailwind.rs b/crates/engine/src/tailwind.rs index 7f54c8aa8..2a6453e44 100644 --- a/crates/engine/src/tailwind.rs +++ b/crates/engine/src/tailwind.rs @@ -32,14 +32,30 @@ impl Theme { let mut t = Theme { roles, names: HashMap::new() }; // Short names ("accent") where they are unique, the full path ("palette-accent") where two // variables would share one, and a numeric suffix as a last resort. - let short: Vec<(VariableId, String)> = vars.iter().map(|v| (v.id.clone(), t.candidate(v, false))).collect(); - let mut taken: Vec = Vec::new(); - for (v, (id, s)) in vars.iter().zip(&short) { - let clash = short.iter().any(|(o, n)| o != id && n == s); - let base = if clash { t.candidate(v, true) } else { s.clone() }; - let name = (1..).map(|k| if k == 1 { base.clone() } else { format!("{base}-{k}") }).find(|n| !taken.contains(n)).unwrap_or(base); - taken.push(name.clone()); - t.names.insert(id.clone(), name); + let short: Vec = vars.iter().map(|v| t.candidate(v, false)).collect(); + // Linear in the number of variables: counts for clashes, a set of names taken and the next + // suffix per base, so a file with very many variables can't make this quadratic. + let mut count: HashMap<&str, usize> = HashMap::new(); + for n in &short { + *count.entry(n.as_str()).or_default() += 1; + } + let mut taken: std::collections::HashSet = std::collections::HashSet::new(); + let mut next: HashMap = HashMap::new(); + for (v, s) in vars.iter().zip(&short) { + let base = if count.get(s.as_str()).copied().unwrap_or(0) > 1 { t.candidate(v, true) } else { s.clone() }; + let mut name = base.clone(); + if taken.contains(&name) { + let k = next.entry(base.clone()).or_insert(1); + loop { + *k += 1; + name = format!("{base}-{k}"); + if !taken.contains(&name) { + break; + } + } + } + taken.insert(name.clone()); + t.names.insert(v.id.clone(), name); } t } From c1a4f2d954edee6c00a8e2f28decef01b7555682 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 21 Oct 2026 16:00:36 -0400 Subject: [PATCH 467/817] ci: add sonar-project.properties for CI-based analysis Marks the project ineligible for SonarCloud Automatic Analysis, resolving the CI-vs-automatic-analysis conflict so the SonarCloud workflow succeeds. --- sonar-project.properties | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sonar-project.properties diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 000000000..92562d54c --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,2 @@ +sonar.projectKey=storytold_figcraft +sonar.organization=storytold From 5ab748d207724710076998cae295ac002a487bde Mon Sep 17 00:00:00 2001 From: YarilaFox <102650794+YarilaFox@users.noreply.github.com> Date: Wed, 21 Oct 2026 16:14:33 +0500 Subject: [PATCH 468/817] M7: keep interface size menu focus inside popup --- crates/ui-egui/src/dialogs.rs | 32 +++++++++++++++++++++++++++- crates/ui-egui/src/ui_scale_tests.rs | 22 ++++++++++++++----- 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index bf9f1b299..85d8ca150 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -498,12 +498,42 @@ fn interface_size(app: &mut FigApp, ui: &mut egui::Ui, chosen: f64) { let resp = crate::widgets::dropdown(ui, &shown, 120.0, None); crate::a11y::combo(&resp, tr("Interface size"), &shown, crate::a11y::menu_open(&resp)); crate::right::menu_popup(&resp).show(|ui| { + let focused = ui.memory(|memory| memory.focused()); + let step = ui.input(|input| { + if input.key_pressed(egui::Key::ArrowDown) || (input.key_pressed(egui::Key::Tab) && !input.modifiers.shift) { + 1 + } else if input.key_pressed(egui::Key::ArrowUp) || (input.key_pressed(egui::Key::Tab) && input.modifiers.shift) { + -1 + } else { + 0 + } + }); + let mut rows = Vec::with_capacity(crate::ui_scale::SIZES.len()); for size in crate::ui_scale::SIZES { - if crate::right::menu_check(ui, (chosen - size).abs() < 1e-6, &percent(size), "") { + let label = percent(size); + let selected = (chosen - size).abs() < 1e-6; + let row = crate::right::menu_row(ui, &format!("{}{label}", if selected { "✓ " } else { " " }), "", 0.0, |_, _, _| {}); + crate::a11y::menu_item(&row, &label, "", Some(selected)); + if row.has_focus() { + ui.memory_mut(|memory| memory.set_focus_lock_filter(row.id, egui::EventFilter { tab: true, ..Default::default() })); + } + rows.push(row.id); + if row.clicked() { app.run("pref.uiScale", json!({"scale": size})); ui.close(); } } + // Spatial focus can jump to a control behind the popup when the menu overlaps the + // Preferences window. Once an item is focused, walk the menu's own rows instead. + if step != 0 + && let Some(index) = rows.iter().position(|id| Some(*id) == focused) + { + let next = index.saturating_add_signed(step).min(rows.len() - 1); + ui.memory_mut(|memory| { + memory.request_focus(rows[next]); + memory.move_focus(egui::FocusDirection::None); + }); + } }); }); crate::widgets::label( diff --git a/crates/ui-egui/src/ui_scale_tests.rs b/crates/ui-egui/src/ui_scale_tests.rs index 018c963a1..4f2a478b1 100644 --- a/crates/ui-egui/src/ui_scale_tests.rs +++ b/crates/ui-egui/src/ui_scale_tests.rs @@ -157,14 +157,18 @@ fn the_interface_size_menu_works_from_the_keyboard() { use egui::{Event, Key, Modifiers, Popup}; // A key press, then two quiet frames for the focus (and the name a screen reader reads) to settle. - let press = |u: &mut Ui, key: Key| { - u.frame(vec![ - Event::Key { key, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::NONE }, - Event::Key { key, physical_key: None, pressed: false, repeat: false, modifiers: Modifiers::NONE }, - ]); + let press_mod = |u: &mut Ui, key: Key, modifiers: Modifiers| { + u.frame_with( + vec![ + Event::Key { key, physical_key: None, pressed: true, repeat: false, modifiers }, + Event::Key { key, physical_key: None, pressed: false, repeat: false, modifiers }, + ], + modifiers, + ); u.frame(vec![]); u.frame(vec![]); }; + let press = |u: &mut Ui, key: Key| press_mod(u, key, Modifiers::NONE); let open = |u: &mut Ui| { // The Preferences dialog is not modal for the keyboard: Tab crosses the main window first. let mut tabs = 0; @@ -201,6 +205,14 @@ fn the_interface_size_menu_works_from_the_keyboard() { press(&mut u, Key::ArrowDown); } assert_eq!(focused_name(&u.ctx), "125%"); + for expected in ["150%", "175%", "200%", "200%"] { + press(&mut u, Key::Tab); + assert_eq!(focused_name(&u.ctx), expected, "Tab stays in the size menu"); + } + for expected in ["175%", "150%", "125%"] { + press_mod(&mut u, Key::Tab, Modifiers::SHIFT); + assert_eq!(focused_name(&u.ctx), expected, "Shift+Tab stays in the size menu"); + } press(&mut u, Key::Enter); assert_eq!(chosen(&u), json!(1.25)); assert!(!Popup::is_any_open(&u.ctx), "picking a size closes the menu"); From 82b05803b18f6ebfd38e423aabf90b95cc4995f1 Mon Sep 17 00:00:00 2001 From: Ridzzz0Alam Date: Wed, 21 Oct 2026 22:48:51 +0200 Subject: [PATCH 469/817] M1: a refused browser download keeps the unsaved changes (#969) `file.saveAs {data: true}` marked the file saved before the UI handed the bytes to `Services::download`. When the download was refused, the toast said "Couldn't download" but the document was clean, so closing it no longer warned and the edits could be lost. The data result now leaves the save state alone. A new `file.markSaved` (the bookkeeping a native save already did: the file and its branch tabs) runs from `save_as_dialog` only once the download was delivered. It ends a version preview like the other commands that act on the document itself. Tests: the engine save test checks the file stays dirty until `file.markSaved`; `a_refused_download_says_so` checks the document is still dirty. --- crates/engine/src/cmd/file.rs | 39 +++++++++++++++++++--------- crates/engine/src/lib.rs | 3 ++- crates/ui-egui/locales/es.toml | 1 + crates/ui-egui/src/lib.rs | 1 + crates/ui-egui/src/web_save_tests.rs | 1 + 5 files changed, 32 insertions(+), 13 deletions(-) diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index d50233726..aa2ea3405 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -55,6 +55,13 @@ pub fn specs() -> Vec { false, save_as ), + spec!( + "file.markSaved", + "Mark saved", + "{} clears the unsaved changes of the active tab's file and its branch tabs: run it once the file from `file.saveAs {data: true}` was delivered (a refused download keeps them)", + false, + mark_saved + ), spec!( "file.export", "Export", @@ -869,24 +876,30 @@ fn save_to(s: &mut Session, path: Option) -> Result { Arc::make_mut(&mut snapshot.doc).name = file_stem(path); } let bytes = snapshot.encode()?; - if let Some(path) = &path { - write(path, &bytes)?; - } - ds.doc = snapshot.doc; - if path.is_some() { - ds.path.clone_from(&path); - } - ds.mark_saved(); - ds.revision += 1; - let (uid, name) = (ds.uid, format!("{}.figcraft", ds.doc.name)); - branch_tabs_saved(s, uid); let Some(path) = path else { + // The download can still be refused: the caller marks the file saved once it was delivered. + let name = format!("{}.figcraft", ds.doc.name); return Ok(json!({"name": name, "bytes": bytes.len(), "data": base64::engine::general_purpose::STANDARD.encode(&bytes)})); }; + write(&path, &bytes)?; + ds.doc = snapshot.doc; + ds.path = Some(path.clone()); + mark_saved(s, &json!({}))?; remember(s, &path); Ok(json!({"path": path, "bytes": bytes.len()})) } +/// The file of the active tab (with its branch tabs) now matches what was written or delivered. +fn mark_saved(s: &mut Session, _: &Value) -> Result { + let i = crate::branches::file_tab(s); + let ds = s.docs.get_mut(i).ok_or(EngineError::NoDocument)?; + ds.mark_saved(); + ds.revision += 1; + let uid = ds.uid; + branch_tabs_saved(s, uid); + Ok(json!({"saved": true})) +} + fn save(s: &mut Session, p: &Value) -> Result { if let Some(path) = string(p, "path") { return save_to(s, Some(path)); @@ -1590,7 +1603,7 @@ mod rest_import_tests { } #[test] - fn save_as_data_hands_back_the_file_and_marks_it_saved() { + fn save_as_data_hands_back_the_file_and_marks_it_saved_once_delivered() { // The browser has no paths: Save as returns the file for a download (#969). let mut s = Session::new(); s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap(); @@ -1598,6 +1611,8 @@ mod rest_import_tests { let recent = s.prefs.recent_files.clone(); let r = s.execute("file.saveAs", &json!({"data": true})).unwrap(); assert_eq!(r["name"], "Untitled.figcraft"); + assert!(s.ds().unwrap().is_dirty(), "not delivered yet: a refused download must not lose the edits"); + s.execute("file.markSaved", &json!({})).unwrap(); assert!(!s.ds().unwrap().is_dirty()); assert_eq!(s.ds().unwrap().path, None, "still no path to save over"); assert_eq!(s.prefs.recent_files, recent, "nothing on disk to remember"); diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 79e7be0d5..e32d7543e 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -402,7 +402,8 @@ pub const PREVIEW_READ_ONLY: &str = "you're viewing an earlier version: restore /// Commands that first end a version preview: they act on the document itself. Saving does so /// only with a native destination; export copies and pending format choices keep the preview. -const ENDS_PREVIEW: &[&str] = &["file.save", "file.saveAs", "file.close", "file.revert", "file.saveVersion", "file.duplicate", "version.restore"]; +const ENDS_PREVIEW: &[&str] = + &["file.save", "file.saveAs", "file.markSaved", "file.close", "file.revert", "file.saveVersion", "file.duplicate", "version.restore"]; static NEXT_UID: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(1); diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index bd572dbec..25f3f2581 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -1920,6 +1920,7 @@ status = "draft — needs native review" "file.revert" = "Volver a lo guardado" "file.save" = "Guardar" "file.saveAs" = "Guardar como" +"file.markSaved" = "Marcar como guardado" "file.saveVersion" = "Guardar en el historial de versiones" "file.versionHistory" = "Mostrar historial de versiones" "fill.add" = "Añadir relleno" diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 788bbf4f3..0707723d8 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1146,6 +1146,7 @@ impl FigApp { if let Some(r) = self.run("file.saveAs", json!({"data": true})) && self.download(r["name"].as_str().unwrap_or_default(), &r) { + self.run("file.markSaved", json!({})); dialogs::file_saved(self, &r); } return; diff --git a/crates/ui-egui/src/web_save_tests.rs b/crates/ui-egui/src/web_save_tests.rs index 5fbb2524b..4879add12 100644 --- a/crates/ui-egui/src/web_save_tests.rs +++ b/crates/ui-egui/src/web_save_tests.rs @@ -52,6 +52,7 @@ fn a_refused_download_says_so() { app.save_as_dialog(); assert_eq!(got.lock().unwrap().len(), 1); assert_eq!(toast(&app), "Couldn't download Untitled.figcraft"); + assert!(app.session.ds().unwrap().is_dirty(), "no file arrived: closing must still warn about the edits"); } #[test] From 795567f01697460c91dc7bfd1fb53a9d9193da78 Mon Sep 17 00:00:00 2001 From: Muamer Mustafic Date: Wed, 21 Oct 2026 23:37:09 +0200 Subject: [PATCH 470/817] M1: a selected unfilled shape drags from inside its box (#910) Co-authored-by: Cursor --- .../engine/src/selection_behaviour_tests.rs | 30 +++++++++++++++++++ crates/engine/src/tools.rs | 12 +++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/selection_behaviour_tests.rs b/crates/engine/src/selection_behaviour_tests.rs index bc961a4a3..3131e9d05 100644 --- a/crates/engine/src/selection_behaviour_tests.rs +++ b/crates/engine/src/selection_behaviour_tests.rs @@ -324,6 +324,36 @@ fn shift_drag_moves_the_selection() { assert_eq!(s.selection(), vec![k.empty], "Shift let go before the button still takes the layer out"); } +#[test] +fn a_drag_inside_the_selection_box_moves_it_where_nothing_is_hit() { + let mut s = Session::new(); + let k = scene(&mut s); + for i in [k.r, k.c] { + ex(&mut s, "node.set", json!({"ids": [i], "props": {"fills": [], "strokes": ["#000000"], "strokeWeight": 1}})); + } + let at = |s: &Session, i: NodeId| s.doc().unwrap().world_bounds(i).unwrap().origin(); + // (selection before, drag from, selection after, the layers that move by (10, 10), derivation) + let rows: Vec<(Vec, (f64, f64), Vec, Vec, &str)> = vec![ + (vec![k.r], (520.0, 20.0), vec![k.r], vec![k.r], "a selected unfilled shape drags from its inside, not only its stroke"), + (vec![k.c], (40.0, 140.0), vec![k.c], vec![k.c], "the same in a top-level frame, whose background is under the inside"), + (vec![k.r, k.empty], (570.0, 20.0), vec![k.r, k.empty], vec![k.r, k.empty], "a gap inside a multiple selection's box drags them all"), + (vec![], (520.0, 20.0), vec![k.r], vec![], "an unselected unfilled shape is hit on its stroke only: the drag is a marquee, which touches it"), + ]; + for (before, from, after, moved, why) in rows { + let home: Vec = [k.r, k.c, k.empty].iter().map(|i| at(&s, *i)).collect(); + ex(&mut s, "select.set", json!({"ids": before})); + drag(&mut s, from, (from.0 + 10.0, from.1 + 10.0), NONE); + assert_eq!(sorted(s.selection()), sorted(after), "{why}"); + for (i, h) in [k.r, k.c, k.empty].iter().zip(&home) { + let d = if moved.contains(i) { 10.0 } else { 0.0 }; + assert_eq!(at(&s, *i), Point::new(h.x + d, h.y + d), "{why}"); + } + if !moved.is_empty() { + assert!(s.undo().unwrap(), "{why}: one undo step"); + } + } +} + #[test] fn alt_shift_drag_on_a_selected_layer_duplicates_it() { let mut s = Session::new(); diff --git a/crates/engine/src/tools.rs b/crates/engine/src/tools.rs index f0115e1f5..8d296a8b9 100644 --- a/crates/engine/src/tools.rs +++ b/crates/engine/src/tools.rs @@ -1191,11 +1191,21 @@ impl Session { .node(leaf) .is_some_and(|n| n.parent == Some(page) && n.kind.is_frame_like() && !n.children.is_empty() && !crate::widgets::is_widget(n)) }; - let target = label_at(&doc, page, &self.tool.labels, ev.p()).or_else(|| { + let label = label_at(&doc, page, &self.tool.labels, ev.p()); + let target = label.or_else(|| { self.hit(&doc, page, ev.p(), ev.tol() * 2.0) .filter(|leaf| ev.cmd || !board_background(*leaf)) .map(|leaf| select_target(&doc, leaf, &sel, ev.cmd)) }); + // A press inside the selection's box that reaches nothing above it (an unfilled shape's + // inside, or the frame or canvas behind it) drags the selection. + let behind_sel = |t: Option| t.is_none_or(|t| sel.iter().any(|s| *s != t && doc.is_ancestor(t, *s))); + let target = match sel.iter().copied().find(|s| !locked_in(&doc, *s)) { + Some(first) if label.is_none() && !ev.shift && behind_sel(target) && doc.bounds_of(&sel).is_some_and(|b| b.contains(ev.p())) => { + Some(first) + } + _ => target, + }; match target { Some(target) => { // Clicking inside the current selection's box keeps it (drag them all). From 6c0ffe66770fc46e45a91e19de89263a08500f79 Mon Sep 17 00:00:00 2001 From: F3R9 Date: Thu, 22 Oct 2026 00:42:48 +0300 Subject: [PATCH 471/817] M9: make graphics-startup assertions independent of UI language --- ROADMAP.md | 3 ++- apps/figcraft/src/startup_tests.rs | 15 +++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index f43cd015b..f19cc014a 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-22 · **Change:** minor (community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -316,6 +316,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-22 | minor | Startup graphics-error tests assert translated hints rather than English substrings, so desktop recovery tests selecting a different UI language do not make them fail. Runtime behavior and readiness estimates unchanged. | | 2026-10-20 | minor | A document dropped on the canvas opens (#916): a `.figcraft`, `.fig` or file JSON dropped on the canvas opens as a file of its own, as on the home screen, in the browser too; it used to add its pages to the file in front. Images and SVG still import at the drop point, File ▸ Import still adds pages, and dragging only documents over the canvas says "Drop to open" (not in the browser, which names no file until the drop). Numbers unchanged | | 2026-10-20 | minor | Duplicating a main component makes an instance (#892): Duplicate and Alt-drag copied a main component as a second main; within its file the copy is now an instance of it, as Copy then Paste already was (a variant duplicated in its set stays a variant). Numbers unchanged. | | 2026-10-20 | minor | Readable disabled and selected text (#890): the dim text colour (disabled buttons, placeholders, hints) is at least 3:1 against panels, fields and selected rows in both themes (it was 2.1:1 in the light theme), a disabled button is grey with that text instead of fading to 40%, and selected text (renaming a page or layer, any text box) takes the theme's readable green on the highlight (1.4:1 in the dark theme before, now 4.2:1 or more); checked with the colour contrast helper (`theme::tests`). Numbers unchanged | diff --git a/apps/figcraft/src/startup_tests.rs b/apps/figcraft/src/startup_tests.rs index 0c92bd19b..209103099 100644 --- a/apps/figcraft/src/startup_tests.rs +++ b/apps/figcraft/src/startup_tests.rs @@ -2,8 +2,15 @@ //! report it, instead of the app quitting silently (#261). use figcraft_ui_egui::dialogs::window_failed as message; +use figcraft_ui_egui::i18n::tr; const ERROR: &str = "WGPU error: Failed to create surface for any enabled backend: {}"; +const BACKEND_HINT: &str = "WGPU_BACKEND is set and names the graphics API to use; unsetting it lets FigCraft choose."; +const DRIVER_HINT: &str = if cfg!(windows) { + "Updating the graphics driver often helps. To use OpenGL only, start FigCraft from a Command Prompt with:" +} else { + "Updating the graphics driver often helps. WGPU_BACKEND (vulkan, gl, metal) names another graphics API to try." +}; #[test] fn the_message_carries_the_error_and_where_to_report_it() { @@ -15,9 +22,9 @@ fn the_message_carries_the_error_and_where_to_report_it() { #[test] fn without_wgpu_backend_it_suggests_the_driver_and_another_graphics_api() { let text = message(ERROR, false); - assert!(text.contains("graphics driver"), "{text}"); + assert!(text.contains(tr(DRIVER_HINT)), "{text}"); assert!(text.contains("WGPU_BACKEND"), "another graphics API to try: {text}"); - assert!(!text.contains("unsetting"), "{text}"); + assert!(!text.contains(tr(BACKEND_HINT)), "{text}"); } #[cfg(windows)] @@ -30,6 +37,6 @@ fn on_windows_it_shows_how_to_start_with_opengl() { #[test] fn with_wgpu_backend_set_it_suggests_unsetting_it() { let text = message(ERROR, true); - assert!(text.contains("unsetting"), "{text}"); - assert!(!text.contains("graphics driver"), "the chosen backend is the likelier cause: {text}"); + assert!(text.contains(tr(BACKEND_HINT)), "{text}"); + assert!(!text.contains(tr(DRIVER_HINT)), "the chosen backend is the likelier cause: {text}"); } From 84b48bc797557624e670d9b39ea0b85995df1b00 Mon Sep 17 00:00:00 2001 From: Muamer Mustafic Date: Thu, 22 Oct 2026 00:19:13 +0200 Subject: [PATCH 472/817] M1: the drag-from-inside fallback tests the selection's turned box (#910) Co-authored-by: Cursor --- crates/engine/src/selection_behaviour_tests.rs | 13 +++++++++++++ crates/engine/src/tools.rs | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/selection_behaviour_tests.rs b/crates/engine/src/selection_behaviour_tests.rs index 3131e9d05..ef5869b22 100644 --- a/crates/engine/src/selection_behaviour_tests.rs +++ b/crates/engine/src/selection_behaviour_tests.rs @@ -352,6 +352,19 @@ fn a_drag_inside_the_selection_box_moves_it_where_nothing_is_hit() { assert!(s.undo().unwrap(), "{why}: one undo step"); } } + // A turned layer's box is turned with it: the corners of its page-aligned bounds are outside. + ex(&mut s, "node.set", json!({"ids": [k.r], "props": {"rotation": 45}})); + let b = s.doc().unwrap().world_bounds(k.r).unwrap(); + ex(&mut s, "select.set", json!({"ids": [k.r]})); + drag(&mut s, (b.x0 + 2.0, b.y0 + 2.0), (b.x0 + 12.0, b.y0 + 12.0), NONE); + assert_eq!(at(&s, k.r), b.origin(), "a press outside a turned layer's box is a marquee: it doesn't move the layer"); + ex(&mut s, "select.set", json!({"ids": [k.r]})); + let c = b.center(); + drag(&mut s, (c.x, c.y), (c.x + 10.0, c.y + 10.0), NONE); + assert_eq!(s.selection(), vec![k.r], "inside the turned box it drags"); + // Pixel snapping rounds the turned box's origin, so the move is about the pointer's. + let d = at(&s, k.r) - b.origin(); + assert!((d.x - 10.0).abs() < 2.0 && (d.y - 10.0).abs() < 2.0, "it moves with the pointer: {d:?}"); } #[test] diff --git a/crates/engine/src/tools.rs b/crates/engine/src/tools.rs index 8d296a8b9..4e411d287 100644 --- a/crates/engine/src/tools.rs +++ b/crates/engine/src/tools.rs @@ -1201,7 +1201,7 @@ impl Session { // inside, or the frame or canvas behind it) drags the selection. let behind_sel = |t: Option| t.is_none_or(|t| sel.iter().any(|s| *s != t && doc.is_ancestor(t, *s))); let target = match sel.iter().copied().find(|s| !locked_in(&doc, *s)) { - Some(first) if label.is_none() && !ev.shift && behind_sel(target) && doc.bounds_of(&sel).is_some_and(|b| b.contains(ev.p())) => { + Some(first) if label.is_none() && !ev.shift && behind_sel(target) && selection_box(&doc, &sel).is_some_and(|q| in_quad(&q, ev.p())) => { Some(first) } _ => target, From a30f846ee3e08e7b67f020ff048667c88c14d414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 15:13:22 +0200 Subject: [PATCH 473/817] M6: open Sketch files (48+): detection, pages, version cut, wiring .sketch archives (document.json, meta.json, pages/*.json) open through file.open, file.import, drag and drop, the CLI and MCP; files saved by a Sketch older than 48 are refused with a message saying how to convert them. Layers come in the next commits. Co-Authored-By: Claude Opus 5.5 --- crates/engine/Cargo.toml | 1 + crates/engine/src/cmd/file.rs | 14 ++- crates/engine/src/lib.rs | 2 + crates/engine/src/sketch_import_tests.rs | 89 +++++++++++++ crates/engine/src/tests.rs | 3 + crates/format/src/lib.rs | 1 + crates/format/src/rest/mod.rs | 11 ++ crates/format/src/sketch/fixture.rs | 121 ++++++++++++++++++ crates/format/src/sketch/mod.rs | 153 +++++++++++++++++++++++ crates/format/src/sketch/tests.rs | 111 ++++++++++++++++ crates/format/src/sketch/tree.rs | 81 ++++++++++++ crates/ui-egui/src/home_tests.rs | 7 ++ crates/ui-egui/src/lib.rs | 8 +- 13 files changed, 597 insertions(+), 5 deletions(-) create mode 100644 crates/engine/src/sketch_import_tests.rs create mode 100644 crates/format/src/sketch/fixture.rs create mode 100644 crates/format/src/sketch/mod.rs create mode 100644 crates/format/src/sketch/tests.rs create mode 100644 crates/format/src/sketch/tree.rs diff --git a/crates/engine/Cargo.toml b/crates/engine/Cargo.toml index 545d872cc..f55aae78a 100644 --- a/crates/engine/Cargo.toml +++ b/crates/engine/Cargo.toml @@ -31,5 +31,6 @@ regex = { workspace = true } web-time = "1.1.0" [dev-dependencies] +zip = { workspace = true } wat = { workspace = true } image = { workspace = true } diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index 7380711fe..4f8802b71 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -536,6 +536,9 @@ fn load_with( if let Some(r) = load_fig(bytes, &file_stem(name_hint)) { return Ok((r?, true)); } + if let Some(r) = load_sketch(bytes, &file_stem(name_hint)) { + return Ok((r?, true)); + } if let Some(r) = figcraft_format::rest::try_import_with(bytes, variables, images) { let (mut doc, warnings) = r.map_err(|e| EngineError::Other(e.to_string()))?; link_instances(&mut doc); @@ -551,6 +554,15 @@ fn load_with( } } +/// Gives `None` when `bytes` are not a `.sketch` file. Then other readers can try. +fn load_sketch(bytes: &[u8], name: &str) -> Option> { + let r = figcraft_format::sketch::try_import(bytes, name)?; + Some(r.map_err(|e| EngineError::Other(e.to_string())).map(|(mut doc, warnings)| { + link_instances(&mut doc); + figcraft_format::Loaded { issues: warnings, ..doc.into() } + })) +} + /// Gives `None` when `bytes` are not a `.fig` file. Then other readers can try. pub(crate) fn load_fig(bytes: &[u8], name: &str) -> Option> { let r = figcraft_format::fig::try_import(bytes, name)?; @@ -1293,7 +1305,7 @@ fn import(s: &mut Session, p: &Value) -> Result { } Ok(out) } - "figcraft" | "json" | "fig" => { + "figcraft" | "json" | "fig" | "sketch" => { let resolver = path.as_deref().map(rest_images); let images: figcraft_format::rest::ImageResolver = match &resolver { Some(r) => r, diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 79e7be0d5..edb04bf41 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1839,6 +1839,8 @@ mod shapes_behaviour_tests; #[cfg(test)] mod shortcut_parity_tests; #[cfg(test)] +mod sketch_import_tests; +#[cfg(test)] mod slot_tests; #[cfg(test)] mod stroke_style_tests; diff --git a/crates/engine/src/sketch_import_tests.rs b/crates/engine/src/sketch_import_tests.rs new file mode 100644 index 000000000..cb3bf2f1e --- /dev/null +++ b/crates/engine/src/sketch_import_tests.rs @@ -0,0 +1,89 @@ +//! `.sketch` files through the file commands. The importer's own tests (fixtures built in code) +//! are in `figcraft_format::sketch`. + +use std::io::Write; + +use base64::Engine; +use serde_json::{Value, json}; + +use crate::Session; + +/// A minimal `.sketch` zip with one page per `(id, name)`, saved by `app_version`. +fn sketch(app_version: &str, pages: &[(&str, &str)]) -> Vec { + let refs: Vec = pages.iter().map(|(id, _)| json!({"_class": "MSJSONFileReference", "_ref": format!("pages/{id}")})).collect(); + let mut out = Vec::new(); + { + let mut z = zip::ZipWriter::new(std::io::Cursor::new(&mut out)); + let o = zip::write::SimpleFileOptions::default(); + z.start_file("document.json", o).unwrap(); + z.write_all(json!({"_class": "document", "pages": refs}).to_string().as_bytes()).unwrap(); + z.start_file("meta.json", o).unwrap(); + z.write_all(json!({"app": "com.bohemiancoding.sketch3", "appVersion": app_version, "version": 103}).to_string().as_bytes()).unwrap(); + for (id, name) in pages { + z.start_file(format!("pages/{id}.json"), o).unwrap(); + z.write_all(json!({"_class": "page", "do_objectID": id, "name": name, "layers": []}).to_string().as_bytes()).unwrap(); + } + z.finish().unwrap(); + } + out +} + +fn temp(name: &str, bytes: &[u8]) -> (std::path::PathBuf, std::path::PathBuf) { + let dir = std::env::temp_dir().join(format!("figcraft-sketch-test-{}-{name}", std::process::id())); + std::fs::create_dir_all(&dir).unwrap(); + let path = dir.join(name); + std::fs::write(&path, bytes).unwrap(); + (dir, path) +} + +fn page_names(s: &Session) -> Vec { + let doc = s.doc().unwrap(); + doc.pages.iter().map(|p| doc.node(*p).unwrap().name.clone()).collect() +} + +#[test] +fn opened_sketch_files_have_their_pages_and_no_path() { + let (dir, path) = temp("design.sketch", &sketch("50.2", &[("A", "Screens"), ("B", "Symbols")])); + let mut s = Session::new(); + let r = s.execute("file.open", &json!({"path": path.to_string_lossy()})).unwrap(); + assert!(r.get("summary").is_some()); + assert_eq!(page_names(&s), ["Screens", "Symbols"]); + // Never saved over: the document has no path, so Save asks for one. + assert!(s.docs[s.active].path.is_none()); + let _ = std::fs::remove_dir_all(&dir); +} + +#[test] +fn sketch_import_appends_pages() { + let (dir, path) = temp("more.sketch", &sketch("83.2", &[("A", "Imported")])); + let mut s = Session::new(); + s.execute("file.new", &json!({})).unwrap(); + let before = page_names(&s).len(); + s.execute("file.import", &json!({"path": path.to_string_lossy()})).unwrap(); + let names = page_names(&s); + assert_eq!(names.len(), before + 1); + assert_eq!(names.last().unwrap(), "Imported"); + let _ = std::fs::remove_dir_all(&dir); +} + +#[test] +fn sketch_data_opens_with_a_summary() { + let data = base64::engine::general_purpose::STANDARD.encode(sketch("50.2", &[("A", "Page")])); + let mut s = Session::new(); + let r = s.execute("file.open", &json!({"data": data, "name": "x.sketch"})).unwrap(); + assert!(r.get("summary").is_some()); + assert_eq!(page_names(&s), ["Page"]); +} + +#[test] +fn old_and_damaged_sketch_files_fail_cleanly() { + let mut s = Session::new(); + let (dir, path) = temp("old.sketch", &sketch("47.1", &[("A", "P")])); + let e = s.execute("file.open", &json!({"path": path.to_string_lossy()})).unwrap_err().to_string(); + assert!(e.contains("older than 48"), "{e}"); + let mut broken = sketch("50.2", &[("A", "P")]); + broken.truncate(broken.len() / 2); + std::fs::write(&path, &broken).unwrap(); + assert!(s.execute("file.open", &json!({"path": path.to_string_lossy()})).is_err()); + let _ = std::fs::remove_dir_all(&dir); +} diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index 646c7c4b0..eeec9f046 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -416,6 +416,9 @@ fn every_command_survives_junk_params() { // Online files: ids, servers, refreshes, actions and names as junk. json!({"file": [1], "server": 7, "refresh": "maybe", "action": "share", "name": {"x": 1}}), json!({"file": "../x", "server": "wss://\u{0}", "refresh": true, "action": "unshare", "name": 5}), + // Files as base64 data: a damaged `.sketch` (zip magic, then junk) and an old one (SQLite). + json!({"data": "UEsDBBQAAAAIAP////8=", "name": "x.sketch"}), + json!({"data": "U1FMaXRlIGZvcm1hdCAzAA==", "name": "x.sketch", "path": null}), // Selection color slots: malformed indexes, ranges and paints. json!({"targets": [{"id": 2, "fills": true, "index": -1, "range": [0, 1e308]}], "paint": {"type": "solid", "color": "invalid"}}), json!({"targets": [{"id": 2, "fills": "yes", "index": 0, "range": [4, 1]}], "style": 5}), diff --git a/crates/format/src/lib.rs b/crates/format/src/lib.rs index 9f7e51bc4..c61af1839 100644 --- a/crates/format/src/lib.rs +++ b/crates/format/src/lib.rs @@ -20,6 +20,7 @@ pub mod fig; pub mod library; pub mod rest; +pub mod sketch; pub mod thumbnail; pub use library::{is_valid_library_id, read_library, read_library_within}; diff --git a/crates/format/src/rest/mod.rs b/crates/format/src/rest/mod.rs index 78279e915..faaf7bafe 100644 --- a/crates/format/src/rest/mod.rs +++ b/crates/format/src/rest/mod.rs @@ -185,6 +185,17 @@ pub(crate) fn import_with_networks( import_parts(v, None, images, networks, max_nodes, true) } +/// [`import_with_networks`] for imports other than `.fig` (no `.fig` source identities): the +/// `.sketch` import. +pub(crate) fn import_with_networks_plain( + v: &Value, + images: ImageResolver, + networks: Vec>, + max_nodes: usize, +) -> Result<(Document, Vec), FormatError> { + import_parts(v, None, images, networks, max_nodes, false) +} + fn import_parts( v: &Value, variables: Option<&Value>, diff --git a/crates/format/src/sketch/fixture.rs b/crates/format/src/sketch/fixture.rs new file mode 100644 index 000000000..fd3b37ced --- /dev/null +++ b/crates/format/src/sketch/fixture.rs @@ -0,0 +1,121 @@ +//! Synthetic `.sketch` files for the tests: the JSON of a document, its pages and `meta.json`, +//! zipped the way Sketch writes them. Layers are built with small helpers and adjusted with +//! [`with`]. + +use std::io::Write; + +use serde_json::{Value, json}; + +/// A `.sketch` zip: `document.json`, `meta.json` saying `app_version` / `version`, one +/// `pages/.json` per page and any other `files` (images, fonts). +pub(crate) fn sketch_zip(app_version: &str, version: u64, document: Value, pages: &[Value], files: &[(&str, &[u8])]) -> Vec { + let meta = json!({ + "app": "com.bohemiancoding.sketch3", + "appVersion": app_version, + "version": version, + "compatibilityVersion": 99, + "pagesAndArtboards": {}, + }); + raw_zip(&document, &meta, pages, files) +} + +/// A `.sketch` zip with the given `meta.json` as is. +pub(crate) fn raw_zip(document: &Value, meta: &Value, pages: &[Value], files: &[(&str, &[u8])]) -> Vec { + let mut out = Vec::new(); + { + let mut z = zip::ZipWriter::new(std::io::Cursor::new(&mut out)); + let opts = zip::write::SimpleFileOptions::default().compression_method(zip::CompressionMethod::Deflated); + z.start_file("document.json", opts).unwrap(); + z.write_all(document.to_string().as_bytes()).unwrap(); + z.start_file("meta.json", opts).unwrap(); + z.write_all(meta.to_string().as_bytes()).unwrap(); + for p in pages { + let id = p["do_objectID"].as_str().unwrap_or("page"); + z.start_file(format!("pages/{id}.json"), opts).unwrap(); + z.write_all(p.to_string().as_bytes()).unwrap(); + } + for (name, bytes) in files { + z.start_file(*name, opts).unwrap(); + z.write_all(bytes).unwrap(); + } + z.finish().unwrap(); + } + out +} + +/// `document.json` listing `pages` (ids) in order, with empty shared-style containers. +pub(crate) fn document(pages: &[&str]) -> Value { + json!({ + "_class": "document", + "do_objectID": "DOC", + "colorSpace": 1, + "currentPageIndex": 0, + "foreignLayerStyles": [], + "foreignSymbols": [], + "foreignTextStyles": [], + "layerStyles": {"_class": "sharedStyleContainer", "objects": []}, + "layerTextStyles": {"_class": "sharedTextStyleContainer", "objects": []}, + "layerSymbols": {"_class": "symbolContainer", "objects": []}, + "pages": pages.iter().map(|p| json!({ + "_class": "MSJSONFileReference", + "_ref_class": "MSImmutablePage", + "_ref": format!("pages/{p}"), + })).collect::>(), + }) +} + +fn frame(x: f64, y: f64, w: f64, h: f64) -> Value { + json!({"_class": "rect", "constrainProportions": false, "x": x, "y": y, "width": w, "height": h}) +} + +fn layer(class: &str, id: &str, name: &str, x: f64, y: f64, w: f64, h: f64) -> Value { + json!({ + "_class": class, + "do_objectID": id, + "name": name, + "frame": frame(x, y, w, h), + "isVisible": true, + "isLocked": false, + "rotation": 0, + "isFlippedHorizontal": false, + "isFlippedVertical": false, + "resizingConstraint": 63, + "style": {"_class": "style", "fills": [], "borders": [], "shadows": [], "innerShadows": []}, + }) +} + +pub(crate) fn page(id: &str, name: &str, layers: Vec) -> Value { + with(layer("page", id, name, 0.0, 0.0, 0.0, 0.0), "layers", Value::Array(layers)) +} + +#[allow(dead_code)] // used by the layer tree tests +pub(crate) fn artboard(id: &str, name: &str, x: f64, y: f64, w: f64, h: f64, layers: Vec) -> Value { + with(layer("artboard", id, name, x, y, w, h), "layers", Value::Array(layers)) +} + +pub(crate) fn group(id: &str, x: f64, y: f64, w: f64, h: f64, layers: Vec) -> Value { + with(layer("group", id, id, x, y, w, h), "layers", Value::Array(layers)) +} + +/// A rectangle with its four generated corner points. +pub(crate) fn rect(id: &str, x: f64, y: f64, w: f64, h: f64) -> Value { + let pts = [(0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0)].map(|(px, py)| point(px, py)); + let mut l = with(layer("rectangle", id, id, x, y, w, h), "points", Value::Array(pts.to_vec())); + l["isClosed"] = json!(true); + l["fixedRadius"] = json!(0); + l +} + +/// A straight curve point at `(x, y)` in 0–1 of the layer's frame. +pub(crate) fn point(x: f64, y: f64) -> Value { + let p = format!("{{{x}, {y}}}"); + json!({"_class": "curvePoint", "cornerRadius": 0, "curveFrom": p, "curveTo": p, "curveMode": 1, "hasCurveFrom": false, "hasCurveTo": false, "point": p}) +} + +/// `l` with `key` set to `value`. +pub(crate) fn with(mut l: Value, key: &str, value: Value) -> Value { + if let Some(m) = l.as_object_mut() { + m.insert(key.to_string(), value); + } + l +} diff --git a/crates/format/src/sketch/mod.rs b/crates/format/src/sketch/mod.rs new file mode 100644 index 000000000..7334606b9 --- /dev/null +++ b/crates/format/src/sketch/mod.rs @@ -0,0 +1,153 @@ +//! Import of `.sketch` files saved by Sketch 48 or newer (best effort), written from the public +//! description of the format only. +//! +//! A `.sketch` file is a zip archive holding `document.json` (the document: its pages in order, +//! shared styles, swatches and library symbols copied into it), `meta.json` (the app version and +//! format version that saved it), one `pages/.json` per page (the layer tree), `images/` and, +//! in newer files, `fonts/`. Every object carries its kind in `_class`. [`tree`] maps the layers +//! onto the REST API file JSON shape and the REST importer builds the document, so this import +//! shares its mapping, budgets and import report with `.fig` and file JSON imports. Files older +//! than Sketch 48 (a SQLite database before 43, text as binary property lists until 47) are +//! refused with a message saying how to convert them. Anything not understood is skipped with a +//! warning; malformed input never panics. + +#[cfg(test)] +mod fixture; +#[cfg(test)] +mod tests; +mod tree; + +use std::collections::BTreeSet; + +use figcraft_doc::Document; +use serde_json::Value; + +use crate::FormatError; + +/// The oldest Sketch whose files open: from 48 on, text is plain JSON too. +pub const MIN_SKETCH: u32 = 48; +/// The newest `meta.json` format version checked against real files (Sketch 83); newer files +/// open with a warning. +pub const NEWEST_TESTED_VERSION: u64 = 139; +/// What opening a file saved by an older Sketch says. +pub const TOO_OLD: &str = "saved by a Sketch older than 48; open it in a newer Sketch and save it again"; +/// Largest JSON member read (a real page of a few thousand layers takes 33 MB). +const MAX_JSON_MEMBER: u64 = 512 * 1024 * 1024; +/// Largest image member read. +const MAX_IMAGE: u64 = 256 * 1024 * 1024; +/// Most pages read from one file. +const MAX_PAGES: usize = 1000; + +/// Whether `bytes` look like a `.sketch` file: a zip holding `document.json` and `meta.json`, or +/// the SQLite database Sketch wrote before version 43 (so that it gets the "too old" message). +pub fn is_sketch(bytes: &[u8]) -> bool { + bytes.starts_with(b"SQLite format 3\0") + || (bytes.starts_with(b"PK") + && zip::ZipArchive::new(std::io::Cursor::new(bytes)).is_ok_and(|z| { + let names: BTreeSet<&str> = z.file_names().collect(); + names.contains("document.json") && names.contains("meta.json") + })) +} + +/// Import `bytes` when they are a `.sketch` file; `None` when they are something else. +pub fn try_import(bytes: &[u8], name: &str) -> Option), FormatError>> { + is_sketch(bytes).then(|| import(bytes, name)) +} + +/// Build a document from a `.sketch` file. Returns it with the warnings about what was skipped or +/// approximated. `name`: the document name. +pub fn import(bytes: &[u8], name: &str) -> Result<(Document, Vec), FormatError> { + import_within(bytes, name, MAX_JSON_MEMBER) +} + +/// [`import`] reading pages of at most `max_member` bytes of JSON each. +pub(crate) fn import_within(bytes: &[u8], name: &str, max_member: u64) -> Result<(Document, Vec), FormatError> { + if bytes.starts_with(b"SQLite format 3\0") { + return Err(FormatError::Io(TOO_OLD.into())); + } + let archive = Archive::open(bytes, max_member)?; + let max_nodes = crate::fig::layer_budget(bytes.len()); + let map = tree::to_rest(&archive, name); + if map.too_old { + return Err(FormatError::Io(TOO_OLD.into())); + } + let mut warnings = archive.warnings.clone(); + warnings.extend(map.warnings); + let images = |r: &str| archive.image(r); + let (doc, more) = crate::rest::import_with_networks_plain(&map.json, &images, map.networks, max_nodes)?; + warnings.extend(more); + Ok((doc, warnings)) +} + +fn corrupt(msg: impl Into) -> FormatError { + FormatError::Corrupt(format!("Sketch file: {}", msg.into())) +} + +/// The parts of a `.sketch` archive: the pages in document order and the images. +pub(crate) struct Archive<'b> { + /// `(id, page JSON)` in the document's order. + pub pages: Vec<(String, Value)>, + /// Problems met while reading (pages skipped). + pub warnings: Vec, + zip: zip::ZipArchive>, +} + +impl<'b> Archive<'b> { + fn open(bytes: &'b [u8], max_member: u64) -> Result { + let mut z = zip::ZipArchive::new(std::io::Cursor::new(bytes)).map_err(|e| corrupt(e.to_string()))?; + let json = |z: &mut zip::ZipArchive>, member: &str, limit: u64| -> Result { + let data = crate::read_member(z, member, limit)?; + serde_json::from_slice(&data).map_err(|e| corrupt(format!("{member}: {e}"))) + }; + let meta = json(&mut z, "meta.json", MAX_JSON_MEMBER)?; + if !meta.is_object() { + return Err(corrupt("meta.json is not an object")); + } + if app_major(&meta).is_some_and(|v| v < MIN_SKETCH) { + return Err(FormatError::Io(TOO_OLD.into())); + } + let document = json(&mut z, "document.json", MAX_JSON_MEMBER)?; + let mut warnings = Vec::new(); + if meta.get("version").and_then(Value::as_u64).is_some_and(|v| v > NEWEST_TESTED_VERSION) { + warnings.push("the file was saved by a newer Sketch than the import was checked with; some layers may differ".to_string()); + } + let refs = document.get("pages").and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default(); + let mut pages = Vec::new(); + for r in refs.iter().take(MAX_PAGES) { + let Some(id) = r.get("_ref").and_then(Value::as_str).and_then(|s| s.strip_prefix("pages/")).filter(|id| valid_id(id)) else { + warnings.push("pages the document lists without a valid reference were skipped".into()); + continue; + }; + match json(&mut z, &format!("pages/{id}.json"), max_member) { + Ok(page) if page.is_object() => pages.push((id.to_string(), page)), + Ok(_) => warnings.push("pages that aren't JSON objects were skipped".into()), + Err(e) => warnings.push(format!("a page was skipped: {}", e.to_string().trim_start_matches("not a valid FigCraft file: "))), + } + } + if refs.len() > MAX_PAGES { + warnings.push(format!("the file has more than {MAX_PAGES} pages; the rest were skipped")); + } + Ok(Archive { pages, warnings, zip: z }) + } + + /// The bytes of the image a layer references (`images/`). + pub(crate) fn image(&self, r: &str) -> Option> { + let name = r.strip_prefix("images/").unwrap_or(r); + if !valid_id(name.split('.').next().unwrap_or("")) || name.split('.').count() > 2 { + return None; + } + // A clone shares the parsed directory and the bytes; the resolver only has shared access. + let mut z = self.zip.clone(); + crate::read_member(&mut z, &format!("images/{name}"), MAX_IMAGE).ok() + } +} + +/// The major version of the Sketch that saved the file (`meta.json` `appVersion`, "50.2" → 50). +fn app_major(meta: &Value) -> Option { + meta.get("appVersion").and_then(Value::as_str)?.split('.').next()?.trim().parse().ok() +} + +/// Ids name archive members: letters, digits, `-` and `_` only, never a path. +fn valid_id(id: &str) -> bool { + !id.is_empty() && id.len() <= 128 && id.bytes().all(|b| b.is_ascii_alphanumeric() || b == b'-' || b == b'_') +} diff --git a/crates/format/src/sketch/tests.rs b/crates/format/src/sketch/tests.rs new file mode 100644 index 000000000..4fb244008 --- /dev/null +++ b/crates/format/src/sketch/tests.rs @@ -0,0 +1,111 @@ +//! `.sketch` import: detection, the archive, the version cut and pages, on fixtures built in code. + +use serde_json::json; + +use super::fixture::*; +use super::*; + +fn page_names(doc: &Document) -> Vec { + doc.pages.iter().map(|p| doc.node(*p).unwrap().name.clone()).collect() +} + +#[test] +fn detects_sketch_and_not_others() { + let z = sketch_zip("50.2", 103, document(&["P1"]), &[page("P1", "Page 1", vec![])], &[]); + assert!(is_sketch(&z)); + assert!(!is_sketch(b"fig-kiwi....")); + assert!(!is_sketch(b"{}")); + assert!(!is_sketch(b"")); + // A zip that isn't a Sketch file. + let mut other = Vec::new(); + { + use std::io::Write; + let mut w = zip::ZipWriter::new(std::io::Cursor::new(&mut other)); + w.start_file("canvas.fig", zip::write::SimpleFileOptions::default()).unwrap(); + w.write_all(b"x").unwrap(); + w.finish().unwrap(); + } + assert!(!is_sketch(&other)); +} + +#[test] +fn pages_become_pages_in_document_order() { + let z = sketch_zip("50.2", 103, document(&["B", "A"]), &[page("A", "Alpha", vec![]), page("B", "Beta", vec![])], &[]); + let (doc, _) = import(&z, "f").unwrap(); + assert_eq!(page_names(&doc), ["Beta", "Alpha"]); +} + +#[test] +fn older_than_48_is_refused() { + let z = sketch_zip("47.1", 95, document(&["P"]), &[page("P", "P", vec![])], &[]); + let e = import(&z, "f").unwrap_err().to_string(); + assert!(e.contains(TOO_OLD), "{e}"); + let mut sqlite = b"SQLite format 3\0".to_vec(); + sqlite.resize(512, 0); + assert!(is_sketch(&sqlite)); + assert!(import(&sqlite, "f").unwrap_err().to_string().contains(TOO_OLD)); +} + +#[test] +fn archived_text_without_meta_version_is_refused() { + let text = json!({ + "_class": "text", "do_objectID": "T", "name": "T", + "frame": {"_class": "rect", "x": 0, "y": 0, "width": 10, "height": 10}, + "attributedString": {"_class": "MSAttributedString", "archivedAttributedString": {"_archive": "YnBsaXN0MDA="}}, + }); + let z = raw_zip(&document(&["P"]), &json!({"app": "com.bohemiancoding.sketch3"}), &[page("P", "P", vec![text])], &[]); + let e = import(&z, "f").unwrap_err().to_string(); + assert!(e.contains(TOO_OLD), "{e}"); +} + +#[test] +fn newer_than_tested_imports_with_one_warning() { + let z = sketch_zip("2099.1", NEWEST_TESTED_VERSION + 1, document(&["P"]), &[page("P", "P", vec![])], &[]); + let (_, warnings) = import(&z, "f").unwrap(); + assert_eq!(warnings.iter().filter(|w| w.contains("newer Sketch")).count(), 1, "{warnings:?}"); +} + +#[test] +fn junk_never_panics() { + let z = sketch_zip("50.2", 103, document(&["P"]), &[page("P", "P", vec![rect("R", 0.0, 0.0, 10.0, 10.0)])], &[]); + for cut in (0..z.len()).step_by(7) { + let _ = import(&z[..cut], "f"); + } + let mut seed = 0x2545_f491_u32; + for _ in 0..200 { + let mut b = z.clone(); + for _ in 0..8 { + seed ^= seed << 13; + seed ^= seed >> 17; + seed ^= seed << 5; + let i = seed as usize % b.len(); + b[i] = (seed >> 8) as u8; + } + let _ = import(&b, "f"); + } + for doc in [json!([]), json!(null), json!({"pages": 5}), json!({"pages": [{"_ref": 7}, {"_ref": "pages/../../x"}]})] { + let _ = import(&sketch_zip("50.2", 103, doc, &[json!(5), json!({"do_objectID": "Q", "layers": "x"})], &[]), "f"); + } + let _ = import(&raw_zip(&document(&["P"]), &json!("x"), &[], &[]), "f"); +} + +#[test] +fn deep_nesting_does_not_fail_the_file() { + let mut deep = rect("R", 0.0, 0.0, 1.0, 1.0); + for i in 0..300 { + deep = group(&format!("G{i}"), 0.0, 0.0, 1.0, 1.0, vec![deep]); + } + let z = sketch_zip("50.2", 103, document(&["A", "B"]), &[page("A", "Deep", vec![deep]), page("B", "Normal", vec![])], &[]); + let (doc, warnings) = import(&z, "f").unwrap(); + assert!(page_names(&doc).contains(&"Normal".to_string())); + assert!(!warnings.is_empty()); +} + +#[test] +fn members_over_budget_are_skipped() { + let z = sketch_zip("50.2", 103, document(&["A", "B"]), &[page("A", "Big", vec![]), page("B", "Small", vec![])], &[]); + let (doc, warnings) = import_within(&z, "f", 200).unwrap(); + // Each page JSON is larger than 200 bytes: both are skipped, with a warning; nothing panics. + assert!(warnings.iter().any(|w| w.contains("too large")), "{warnings:?}"); + assert!(!page_names(&doc).contains(&"Big".to_string())); +} diff --git a/crates/format/src/sketch/tree.rs b/crates/format/src/sketch/tree.rs new file mode 100644 index 000000000..8b5fc0c84 --- /dev/null +++ b/crates/format/src/sketch/tree.rs @@ -0,0 +1,81 @@ +//! Sketch pages and layers → REST API file JSON nodes. + +use figcraft_doc::VectorNetwork; +use serde_json::{Map as JsonMap, Value, json}; + +use super::Archive; + +/// Deepest layer nesting followed (deeper layers are skipped with a warning). +const MAX_DEPTH: usize = 200; + +/// The REST JSON of a Sketch file, with what the mapping noticed. +pub(crate) struct Map { + pub json: Value, + pub warnings: Vec, + /// Vector networks the JSON references by `vectorNetworkRef`. + pub networks: Vec>, + /// A text layer stored the pre-48 way was met: the file is refused. + pub too_old: bool, +} + +/// The mapping's state while walking the file. +pub(crate) struct Cx { + pub warnings: Vec, + pub networks: Vec>, + pub too_old: bool, +} + +impl Cx { + pub(crate) fn warn(&mut self, msg: impl Into) { + let msg = msg.into(); + if !self.warnings.contains(&msg) { + self.warnings.push(msg); + } + } +} + +/// Map the pages of `archive` to a REST file JSON named `name`. +pub(crate) fn to_rest(archive: &Archive, name: &str) -> Map { + let mut cx = Cx { warnings: Vec::new(), networks: Vec::new(), too_old: false }; + let mut canvases = Vec::new(); + for (id, page) in &archive.pages { + let mut node = JsonMap::new(); + node.insert("type".into(), json!("CANVAS")); + node.insert("id".into(), json!(id)); + node.insert("name".into(), json!(str_field(page, "name").unwrap_or("Page"))); + let kids: Vec = layers(page).iter().filter_map(|l| layer(&mut cx, l, 0)).collect(); + node.insert("children".into(), Value::Array(kids)); + canvases.push(Value::Object(node)); + } + let json = json!({"name": name, "document": {"type": "DOCUMENT", "id": "0:0", "children": canvases}}); + Map { json, warnings: cx.warnings, networks: cx.networks, too_old: cx.too_old } +} + +/// One Sketch layer as a REST node (with its children), or `None` when it is skipped. +pub(crate) fn layer(cx: &mut Cx, l: &Value, depth: usize) -> Option { + if depth > MAX_DEPTH { + cx.warn(format!("layers nested deeper than {MAX_DEPTH} levels were skipped")); + return None; + } + if is_archived_text(l) { + cx.too_old = true; + return None; + } + let class = str_field(l, "_class")?; + cx.warn(format!("Sketch {class} layers are not supported yet and were skipped")); + None +} + +/// A text layer whose string is a binary property list (Sketch 43–47). +fn is_archived_text(l: &Value) -> bool { + l.get("attributedString").is_some_and(|a| a.get("archivedAttributedString").is_some()) +} + +/// The child layers of a page or layer. +pub(crate) fn layers(l: &Value) -> &[Value] { + l.get("layers").and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default() +} + +pub(crate) fn str_field<'v>(v: &'v Value, key: &str) -> Option<&'v str> { + v.get(key).and_then(Value::as_str) +} diff --git a/crates/ui-egui/src/home_tests.rs b/crates/ui-egui/src/home_tests.rs index ebbf6d95e..fc51bfb1e 100644 --- a/crates/ui-egui/src/home_tests.rs +++ b/crates/ui-egui/src/home_tests.rs @@ -900,3 +900,10 @@ fn dropping_an_unsupported_file_on_the_home_screen_opens_nothing() { assert!(u.app.ui.home); assert_eq!(u.app.ui.toast.as_ref().map(|t| t.0.as_str()), Some("Drop a .figcraft, .fig, .json, .svg or image file.")); } + +#[test] +fn sketch_files_open_and_drop_as_documents() { + let p = std::path::Path::new("/tmp/Design.SKETCH"); + assert!(crate::opens(p)); + assert!(crate::is_document(p)); +} diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index c93333b38..75096ffb0 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1201,7 +1201,7 @@ impl FigApp { let exts: &[&str] = if place { &["png", "jpg", "jpeg", "webp", "gif", "tif", "tiff"] } else { - &["svg", "png", "jpg", "jpeg", "webp", "gif", "tif", "tiff", "figcraft", "fig"] + &["svg", "png", "jpg", "jpeg", "webp", "gif", "tif", "tiff", "figcraft", "fig", "sketch"] }; let title = if place { i18n::tr("Place image") } else { i18n::tr("Import") }; self.pick_file(title, exts, true, |app, file| { @@ -1823,17 +1823,17 @@ impl FigApp { } /// The file types File ▸ Open and a drop on the home screen open. -pub(crate) const OPEN_EXTENSIONS: &[&str] = &["figcraft", "fig", "json", "svg", "png", "jpg", "jpeg", "webp", "gif", "tif", "tiff"]; +pub(crate) const OPEN_EXTENSIONS: &[&str] = &["figcraft", "fig", "sketch", "json", "svg", "png", "jpg", "jpeg", "webp", "gif", "tif", "tiff"]; /// Whether `path` names a file type that opens as a document (the extension, in any case). pub(crate) fn opens(path: &Path) -> bool { path.extension().and_then(|e| e.to_str()).is_some_and(|e| OPEN_EXTENSIONS.iter().any(|x| x.eq_ignore_ascii_case(e))) } -/// Whether `path` is a whole document (`.figcraft`, `.fig`, file JSON) rather than an image or SVG: +/// Whether `path` is a whole document (`.figcraft`, `.fig`, `.sketch`, file JSON) rather than an image or SVG: /// dropped on the canvas it opens as a file of its own instead of adding its pages to the open one. pub(crate) fn is_document(path: &Path) -> bool { - path.extension().and_then(|e| e.to_str()).is_some_and(|e| ["figcraft", "fig", "json"].iter().any(|x| x.eq_ignore_ascii_case(e))) + path.extension().and_then(|e| e.to_str()).is_some_and(|e| ["figcraft", "fig", "sketch", "json"].iter().any(|x| x.eq_ignore_ascii_case(e))) } /// Reads the contents of dropped file `name` that has no file on disk to read by path. From 5805cea9b4527201dd1cf5d27833337ed0bbf72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 15:55:59 +0200 Subject: [PATCH 474/817] M6: Sketch import: layer tree, transforms, constraints, basic shapes Artboards (and Sketch 2025 frames) become frames with their background (white by default, as Sketch shows them), groups and graphics groups, rectangles with their corner radii, ovals ellipses, bitmaps rectangles with the image, slices slices. Positions accumulate through groups, rotation and flips keep their direction, resizingConstraint bits become constraints. Not yet mapped layer kinds are listed in the import report. Co-Authored-By: Claude Opus 5.5 --- crates/format/src/sketch/fixture.rs | 1 - crates/format/src/sketch/mod.rs | 4 +- crates/format/src/sketch/tree.rs | 149 +++++++++++++++++++- crates/format/src/sketch/tree_tests.rs | 181 +++++++++++++++++++++++++ 4 files changed, 326 insertions(+), 9 deletions(-) create mode 100644 crates/format/src/sketch/tree_tests.rs diff --git a/crates/format/src/sketch/fixture.rs b/crates/format/src/sketch/fixture.rs index fd3b37ced..231225c9c 100644 --- a/crates/format/src/sketch/fixture.rs +++ b/crates/format/src/sketch/fixture.rs @@ -88,7 +88,6 @@ pub(crate) fn page(id: &str, name: &str, layers: Vec) -> Value { with(layer("page", id, name, 0.0, 0.0, 0.0, 0.0), "layers", Value::Array(layers)) } -#[allow(dead_code)] // used by the layer tree tests pub(crate) fn artboard(id: &str, name: &str, x: f64, y: f64, w: f64, h: f64, layers: Vec) -> Value { with(layer("artboard", id, name, x, y, w, h), "layers", Value::Array(layers)) } diff --git a/crates/format/src/sketch/mod.rs b/crates/format/src/sketch/mod.rs index 7334606b9..a46706dbe 100644 --- a/crates/format/src/sketch/mod.rs +++ b/crates/format/src/sketch/mod.rs @@ -16,6 +16,8 @@ mod fixture; #[cfg(test)] mod tests; mod tree; +#[cfg(test)] +mod tree_tests; use std::collections::BTreeSet; @@ -67,7 +69,7 @@ pub(crate) fn import_within(bytes: &[u8], name: &str, max_member: u64) -> Result } let archive = Archive::open(bytes, max_member)?; let max_nodes = crate::fig::layer_budget(bytes.len()); - let map = tree::to_rest(&archive, name); + let map = tree::to_rest(&archive, name, max_nodes); if map.too_old { return Err(FormatError::Io(TOO_OLD.into())); } diff --git a/crates/format/src/sketch/tree.rs b/crates/format/src/sketch/tree.rs index 8b5fc0c84..59e3d6375 100644 --- a/crates/format/src/sketch/tree.rs +++ b/crates/format/src/sketch/tree.rs @@ -1,12 +1,16 @@ //! Sketch pages and layers → REST API file JSON nodes. use figcraft_doc::VectorNetwork; +use figcraft_doc::geom::{Affine, Rect}; use serde_json::{Map as JsonMap, Value, json}; use super::Archive; /// Deepest layer nesting followed (deeper layers are skipped with a warning). const MAX_DEPTH: usize = 200; +/// Largest size and farthest position kept (the REST importer's own bounds). +const MAX_SIZE: f64 = 1e6; +const MAX_COORD: f64 = 1e7; /// The REST JSON of a Sketch file, with what the mapping noticed. pub(crate) struct Map { @@ -23,6 +27,9 @@ pub(crate) struct Cx { pub warnings: Vec, pub networks: Vec>, pub too_old: bool, + /// Layers mapped so far, and the most the file may give. + pub nodes: usize, + pub max_nodes: usize, } impl Cx { @@ -35,15 +42,15 @@ impl Cx { } /// Map the pages of `archive` to a REST file JSON named `name`. -pub(crate) fn to_rest(archive: &Archive, name: &str) -> Map { - let mut cx = Cx { warnings: Vec::new(), networks: Vec::new(), too_old: false }; +pub(crate) fn to_rest(archive: &Archive, name: &str, max_nodes: usize) -> Map { + let mut cx = Cx { warnings: Vec::new(), networks: Vec::new(), too_old: false, nodes: 0, max_nodes }; let mut canvases = Vec::new(); for (id, page) in &archive.pages { let mut node = JsonMap::new(); node.insert("type".into(), json!("CANVAS")); node.insert("id".into(), json!(id)); node.insert("name".into(), json!(str_field(page, "name").unwrap_or("Page"))); - let kids: Vec = layers(page).iter().filter_map(|l| layer(&mut cx, l, 0)).collect(); + let kids: Vec = layers(page).iter().filter_map(|l| layer(&mut cx, l, Affine::IDENTITY, 0, true)).collect(); node.insert("children".into(), Value::Array(kids)); canvases.push(Value::Object(node)); } @@ -51,8 +58,9 @@ pub(crate) fn to_rest(archive: &Archive, name: &str) -> Map { Map { json, warnings: cx.warnings, networks: cx.networks, too_old: cx.too_old } } -/// One Sketch layer as a REST node (with its children), or `None` when it is skipped. -pub(crate) fn layer(cx: &mut Cx, l: &Value, depth: usize) -> Option { +/// One Sketch layer as a REST node (with its children), or `None` when it is skipped. `parent`: +/// the parent layer's transform to the page; `root`: the layer sits on the page itself. +pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: bool) -> Option { if depth > MAX_DEPTH { cx.warn(format!("layers nested deeper than {MAX_DEPTH} levels were skipped")); return None; @@ -62,8 +70,135 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, depth: usize) -> Option { return None; } let class = str_field(l, "_class")?; - cx.warn(format!("Sketch {class} layers are not supported yet and were skipped")); - None + let ty = match class { + "artboard" | "frame" => "FRAME", + "group" | "graphic" => "GROUP", + "rectangle" | "bitmap" => "RECTANGLE", + "oval" => "ELLIPSE", + "slice" => "SLICE", + other => { + cx.warn(format!("Sketch {} layers are not supported yet and were skipped", clip(other))); + return None; + } + }; + if cx.nodes >= cx.max_nodes { + cx.warn(format!("the file has more than {} layers; the rest were skipped", cx.max_nodes)); + return None; + } + cx.nodes += 1; + let (w, h) = size(l); + let world = parent * local(l, w, h); + let mut node = JsonMap::new(); + node.insert("type".into(), json!(ty)); + if let Some(id) = str_field(l, "do_objectID") { + node.insert("id".into(), json!(id)); + } + node.insert("name".into(), json!(str_field(l, "name").unwrap_or(class))); + node.insert("visible".into(), json!(bool_field(l, "isVisible").unwrap_or(true))); + node.insert("locked".into(), json!(bool_field(l, "isLocked").unwrap_or(false))); + node.insert("size".into(), json!({"x": w, "y": h})); + let rel = parent.inverse() * world; + let [a, b, c, d, e, f] = rel.as_coeffs(); + node.insert("relativeTransform".into(), json!([[a, c, e], [b, d, f]])); + // The page places top-level layers by their transform; deeper ones also say where they end up, + // which tells the importer their transform is relative to their group. + if !root { + let bb = world.transform_rect_bbox(Rect::new(0.0, 0.0, w, h)); + node.insert("absoluteBoundingBox".into(), json!({"x": bb.x0, "y": bb.y0, "width": bb.width(), "height": bb.height()})); + } + node.insert("constraints".into(), constraints(l.get("resizingConstraint").and_then(Value::as_i64).unwrap_or(63))); + match class { + "artboard" | "frame" => { + let clips = if class == "artboard" { true } else { bool_field(l, "clipsContent").unwrap_or(true) }; + node.insert("clipsContent".into(), json!(clips)); + let background = (bool_field(l, "hasBackgroundColor") == Some(true)).then(|| l.get("backgroundColor").and_then(color)).flatten(); + if class == "artboard" || background.is_some() { + let c = background.unwrap_or_else(|| json!({"r": 1.0, "g": 1.0, "b": 1.0, "a": 1.0})); + node.insert("fills".into(), json!([{"type": "SOLID", "color": c}])); + } + } + "rectangle" => corner_radii(l, &mut node), + "bitmap" => match l.get("image").and_then(|i| str_field(i, "_ref")) { + Some(r) => { + let paint = json!({"type": "IMAGE", "scaleMode": "STRETCH", "imageRef": r, "imageTransform": [[1, 0, 0], [0, 1, 0]]}); + node.insert("fills".into(), json!([paint])); + } + None => cx.warn("images stored inside the JSON were skipped"), + }, + _ => {} + } + if matches!(ty, "FRAME" | "GROUP") { + let kids: Vec = layers(l).iter().filter_map(|c| layer(cx, c, world, depth + 1, false)).collect(); + node.insert("children".into(), Value::Array(kids)); + } + Some(Value::Object(node)) +} + +/// A layer's size from its `frame` (finite, not negative, at most [`MAX_SIZE`]). +fn size(l: &Value) -> (f64, f64) { + let f = l.get("frame"); + let n = |k: &str| f.and_then(|f| f.get(k)).and_then(Value::as_f64).filter(|v| v.is_finite()).unwrap_or(0.0).clamp(0.0, MAX_SIZE); + (n("width"), n("height")) +} + +/// A layer's transform within its parent: its frame's position, then its rotation (degrees, +/// counter-clockwise on screen) and flips about its centre. +fn local(l: &Value, w: f64, h: f64) -> Affine { + let f = l.get("frame"); + let n = |k: &str| f.and_then(|f| f.get(k)).and_then(Value::as_f64).filter(|v| v.is_finite()).unwrap_or(0.0).clamp(-MAX_COORD, MAX_COORD); + let rot = l.get("rotation").and_then(Value::as_f64).filter(|v| v.is_finite()).unwrap_or(0.0) % 360.0; + let sx = if bool_field(l, "isFlippedHorizontal") == Some(true) { -1.0 } else { 1.0 }; + let sy = if bool_field(l, "isFlippedVertical") == Some(true) { -1.0 } else { 1.0 }; + Affine::translate((n("x") + w / 2.0, n("y") + h / 2.0)) + * Affine::rotate(-rot.to_radians()) + * Affine::scale_non_uniform(sx, sy) + * Affine::translate((-w / 2.0, -h / 2.0)) +} + +/// REST constraints from Sketch's `resizingConstraint`: six bits, a cleared bit pins that side or +/// fixes that size (right 1, width 2, left 4, bottom 8, height 16, top 32). A layer pinned on +/// neither side keeps its place in proportion (scale) unless its size is fixed (centre). +fn constraints(mask: i64) -> Value { + let pinned = |bit: i64| mask & bit == 0; + let axis = |low: i64, size: i64, high: i64, low_name: &str, high_name: &str, both: &str| match (pinned(low), pinned(high)) { + (true, true) => both.to_string(), + (true, false) => low_name.to_string(), + (false, true) => high_name.to_string(), + (false, false) if pinned(size) => "CENTER".into(), + (false, false) => "SCALE".into(), + }; + json!({ + "horizontal": axis(4, 2, 1, "LEFT", "RIGHT", "LEFT_RIGHT"), + "vertical": axis(32, 16, 8, "TOP", "BOTTOM", "TOP_BOTTOM"), + }) +} + +/// A rectangle's corner radii: per corner from its points (top left, top right, bottom right, +/// bottom left), else its `fixedRadius`. +fn corner_radii(l: &Value, node: &mut JsonMap) { + let radius = |v: Option<&Value>| v.and_then(Value::as_f64).filter(|r| r.is_finite()).map_or(0.0, |r| r.clamp(0.0, MAX_SIZE)); + let pts = l.get("points").and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default(); + let each: Vec = pts.iter().map(|p| radius(p.get("cornerRadius"))).collect(); + if each.len() == 4 && each.iter().any(|r| *r > 0.0) { + node.insert("rectangleCornerRadii".into(), json!(each)); + } else if radius(l.get("fixedRadius")) > 0.0 { + node.insert("cornerRadius".into(), json!(radius(l.get("fixedRadius")))); + } +} + +/// A Sketch colour (`red`, `green`, `blue`, `alpha` in 0–1) as a REST colour. +pub(crate) fn color(c: &Value) -> Option { + let n = |k: &str| c.get(k).and_then(Value::as_f64).filter(|v| v.is_finite()).map(|v| v.clamp(0.0, 1.0)); + Some(json!({"r": n("red")?, "g": n("green")?, "b": n("blue")?, "a": n("alpha").unwrap_or(1.0)})) +} + +pub(crate) fn bool_field(v: &Value, key: &str) -> Option { + v.get(key).and_then(Value::as_bool) +} + +/// At most 64 characters of a name read from the file, for warnings. +fn clip(s: &str) -> String { + s.chars().take(64).collect() } /// A text layer whose string is a binary property list (Sketch 43–47). diff --git a/crates/format/src/sketch/tree_tests.rs b/crates/format/src/sketch/tree_tests.rs new file mode 100644 index 000000000..c9f995588 --- /dev/null +++ b/crates/format/src/sketch/tree_tests.rs @@ -0,0 +1,181 @@ +//! Sketch layers → document layers: kinds, positions, transforms, constraints, visibility. + +use figcraft_doc::color::PaintKind; +use figcraft_doc::{Document, HConstraint, NodeKind, VConstraint}; +use serde_json::{Value, json}; + +use super::fixture::*; +use super::import; + +/// Import one page holding `layers`, with extra archive `files`. +fn open_with(layers: Vec, files: &[(&str, &[u8])]) -> (Document, Vec) { + let z = sketch_zip("50.2", 103, document(&["P"]), &[page("P", "Page", layers)], files); + import(&z, "f").unwrap() +} + +fn open(layers: Vec) -> (Document, Vec) { + open_with(layers, &[]) +} + +fn node<'d>(doc: &'d Document, name: &str) -> &'d figcraft_doc::Node { + doc.nodes().find(|n| n.name == name).unwrap_or_else(|| panic!("no layer named {name}")) +} + +fn solid(doc: &Document, name: &str) -> Option<[f32; 4]> { + node(doc, name).fills.iter().find_map(|p| match &p.kind { + PaintKind::Solid { color } => Some([color.r, color.g, color.b, p.opacity]), + _ => None, + }) +} + +#[test] +fn artboard_is_frame_with_white_fill_unless_background() { + let plain = artboard("A", "Plain", 0.0, 0.0, 100.0, 50.0, vec![]); + let red = with(artboard("B", "Red", 200.0, 0.0, 100.0, 50.0, vec![]), "hasBackgroundColor", json!(true)); + let red = with(red, "backgroundColor", json!({"_class": "color", "red": 1, "green": 0, "blue": 0, "alpha": 1})); + let (doc, _) = open(vec![plain, red]); + assert!(matches!(node(&doc, "Plain").kind, NodeKind::Frame)); + assert!(node(&doc, "Plain").clip); + assert_eq!(solid(&doc, "Plain"), Some([1.0, 1.0, 1.0, 1.0])); + assert_eq!(solid(&doc, "Red"), Some([1.0, 0.0, 0.0, 1.0])); + let b = doc.world_bounds(node(&doc, "Red").id).unwrap(); + assert_eq!((b.x0, b.y0, b.width(), b.height()), (200.0, 0.0, 100.0, 50.0)); +} + +#[test] +fn group_children_positions_accumulate() { + let r = rect("R", 5.0, 5.0, 10.0, 10.0); + let g = group("G", 10.0, 20.0, 15.0, 15.0, vec![r]); + let (doc, _) = open(vec![artboard("A", "Board", 100.0, 100.0, 300.0, 300.0, vec![g])]); + assert!(matches!(node(&doc, "G").kind, NodeKind::Group)); + let b = doc.world_bounds(node(&doc, "R").id).unwrap(); + assert!((b.x0 - 115.0).abs() < 1e-6 && (b.y0 - 125.0).abs() < 1e-6, "{b:?}"); +} + +#[test] +fn rotation_and_flip() { + let rotated = with(rect("Turned", 0.0, 0.0, 40.0, 20.0), "rotation", json!(90)); + let flipped = with(rect("Flipped", 100.0, 0.0, 40.0, 20.0), "isFlippedHorizontal", json!(true)); + let (doc, _) = open(vec![artboard("A", "Board", 0.0, 0.0, 300.0, 300.0, vec![rotated, flipped])]); + let b = doc.world_bounds(node(&doc, "Turned").id).unwrap(); + assert!((b.width() - 20.0).abs() < 1e-6 && (b.height() - 40.0).abs() < 1e-6, "{b:?}"); + assert!((b.center().x - 20.0).abs() < 1e-6 && (b.center().y - 10.0).abs() < 1e-6, "{b:?}"); + // Counter-clockwise on screen: the box's x axis points up. + let t = doc.world_transform(node(&doc, "Turned").id).as_coeffs(); + assert!(t[1] < -0.99, "{t:?}"); + let t = doc.world_transform(node(&doc, "Flipped").id).as_coeffs(); + assert!(t[0] < -0.99, "{t:?}"); + let b = doc.world_bounds(node(&doc, "Flipped").id).unwrap(); + assert!((b.x0 - 100.0).abs() < 1e-6 && (b.width() - 40.0).abs() < 1e-6, "{b:?}"); +} + +#[test] +fn resizing_constraint_bits() { + use HConstraint as H; + use VConstraint as V; + // A cleared bit pins: right 1, width 2, left 4, bottom 8, height 16, top 32. + let cases = [ + (63, H::Scale, V::Scale), + (63 - 4 - 32, H::Left, V::Top), + (63 - 1 - 8, H::Right, V::Bottom), + (63 - 1 - 4, H::LeftRight, V::Scale), + (63 - 8 - 32, H::Scale, V::TopBottom), + (63 - 2 - 16, H::Center, V::Center), + (63 - 1 - 2, H::Right, V::Scale), + (0, H::LeftRight, V::TopBottom), + ]; + let layers: Vec = cases + .iter() + .enumerate() + .map(|(i, (mask, _, _))| with(rect(&format!("R{i}"), 0.0, 0.0, 10.0, 10.0), "resizingConstraint", json!(mask))) + .collect(); + let (doc, _) = open(vec![artboard("A", "Board", 0.0, 0.0, 100.0, 100.0, layers)]); + for (i, (mask, h, v)) in cases.iter().enumerate() { + let c = node(&doc, &format!("R{i}")).constraints; + assert_eq!((c.horizontal, c.vertical), (*h, *v), "mask {mask}"); + } +} + +#[test] +fn hidden_locked_named() { + let r = with(with(rect("Hidden", 0.0, 0.0, 10.0, 10.0), "isVisible", json!(false)), "isLocked", json!(true)); + let (doc, _) = open(vec![artboard("A", "Board", 0.0, 0.0, 100.0, 100.0, vec![r])]); + let n = node(&doc, "Hidden"); + assert!(!n.visible && n.locked); +} + +#[test] +fn bad_numbers_are_sane() { + let mut nan = rect("Junk", 0.0, 0.0, 10.0, 10.0); + nan["frame"]["width"] = json!("NaN"); + nan["frame"]["x"] = json!(1e300); + let mut neg = rect("Negative", 0.0, 0.0, 10.0, 10.0); + neg["frame"]["height"] = json!(-5); + neg["rotation"] = json!("x"); + let mut none = rect("Frameless", 0.0, 0.0, 10.0, 10.0); + none.as_object_mut().unwrap().remove("frame"); + let (doc, _) = open(vec![artboard("A", "Board", 0.0, 0.0, 100.0, 100.0, vec![nan, neg, none])]); + for n in doc.nodes() { + assert!(n.width.is_finite() && n.height.is_finite() && n.width >= 0.0 && n.height >= 0.0, "{}", n.name); + assert!(n.transform.as_coeffs().iter().all(|c| c.is_finite()), "{}", n.name); + } +} + +#[test] +fn rectangle_corner_radii() { + let mut each = rect("Each", 0.0, 0.0, 40.0, 40.0); + for (i, r) in [1, 2, 3, 4].iter().enumerate() { + each["points"][i]["cornerRadius"] = json!(r); + } + let fixed = with(rect("Fixed", 50.0, 0.0, 40.0, 40.0), "fixedRadius", json!(8)); + let (doc, _) = open(vec![artboard("A", "Board", 0.0, 0.0, 100.0, 100.0, vec![each, fixed])]); + assert!(matches!(node(&doc, "Each").kind, NodeKind::Rectangle)); + assert_eq!(node(&doc, "Each").corners.radii, [1.0, 2.0, 3.0, 4.0]); + assert_eq!(node(&doc, "Fixed").corners.radii, [8.0; 4]); +} + +#[test] +fn oval_slice_and_bitmap() { + let mut oval = rect("Round", 0.0, 0.0, 30.0, 20.0); + oval["_class"] = json!("oval"); + let mut slice = rect("Cut", 0.0, 0.0, 30.0, 20.0); + slice["_class"] = json!("slice"); + let mut bitmap = rect("Photo", 0.0, 0.0, 30.0, 20.0); + bitmap["_class"] = json!("bitmap"); + bitmap["image"] = json!({"_class": "MSJSONFileReference", "_ref_class": "MSImageData", "_ref": "images/abc123.png"}); + let png = { + let mut out = Vec::new(); + image::RgbaImage::new(2, 2).write_to(&mut std::io::Cursor::new(&mut out), image::ImageFormat::Png).unwrap(); + out + }; + let (doc, _) = open_with(vec![artboard("A", "Board", 0.0, 0.0, 100.0, 100.0, vec![oval, slice, bitmap])], &[("images/abc123.png", &png)]); + assert!(matches!(node(&doc, "Round").kind, NodeKind::Ellipse { .. })); + assert!(matches!(node(&doc, "Cut").kind, NodeKind::Slice)); + let photo = node(&doc, "Photo"); + assert!(matches!(photo.kind, NodeKind::Rectangle)); + assert!(photo.fills.iter().any(|p| matches!(&p.kind, PaintKind::Image(_)))); + assert_eq!(doc.images.len(), 1); +} + +#[test] +fn unknown_class_is_a_warning() { + let mut odd = rect("Odd", 0.0, 0.0, 10.0, 10.0); + odd["_class"] = json!("MSSomethingNew"); + let (doc, warnings) = open(vec![artboard("A", "Board", 0.0, 0.0, 100.0, 100.0, vec![odd])]); + assert!(doc.nodes().all(|n| n.name != "Odd")); + assert!(warnings.iter().any(|w| w.contains("MSSomethingNew")), "{warnings:?}"); +} + +#[test] +fn sketch_2025_frames_and_graphics() { + let mut frame = artboard("F", "Frame", 0.0, 0.0, 100.0, 100.0, vec![rect("Inside", 0.0, 0.0, 10.0, 10.0)]); + frame["_class"] = json!("frame"); + frame["clipsContent"] = json!(false); + let mut graphic = group("Graphic", 10.0, 10.0, 10.0, 10.0, vec![rect("Leaf", 0.0, 0.0, 10.0, 10.0)]); + graphic["_class"] = json!("graphic"); + frame["layers"].as_array_mut().unwrap().push(graphic); + let (doc, _) = open(vec![frame]); + assert!(matches!(node(&doc, "Frame").kind, NodeKind::Frame)); + assert!(!node(&doc, "Frame").clip); + assert!(matches!(node(&doc, "Graphic").kind, NodeKind::Group)); +} From 72c7eae868e2de5b27f8eaaacfe9d5f0f5b33e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 15:59:59 +0200 Subject: [PATCH 475/817] M6: Sketch import: editable paths, shape groups, booleans, stars, polygons Paths become editable vector networks (handles, per-point corner radius, open and closed, winding rule). A shape group with one shape becomes that shape in the group's place; several combine as boolean operations, mixed operations nesting from the left as Sketch applies them. Stars and polygons stay stars and polygons while their points are the generated ones, edited ones and triangles become vectors. Co-Authored-By: Claude Opus 5.5 --- crates/format/src/sketch/fixture.rs | 14 ++ crates/format/src/sketch/mod.rs | 3 + crates/format/src/sketch/path.rs | 193 +++++++++++++++++++++++++ crates/format/src/sketch/path_tests.rs | 154 ++++++++++++++++++++ crates/format/src/sketch/tree.rs | 69 ++++++--- 5 files changed, 410 insertions(+), 23 deletions(-) create mode 100644 crates/format/src/sketch/path.rs create mode 100644 crates/format/src/sketch/path_tests.rs diff --git a/crates/format/src/sketch/fixture.rs b/crates/format/src/sketch/fixture.rs index 231225c9c..680847675 100644 --- a/crates/format/src/sketch/fixture.rs +++ b/crates/format/src/sketch/fixture.rs @@ -118,3 +118,17 @@ pub(crate) fn with(mut l: Value, key: &str, value: Value) -> Value { } l } + +/// A `shapePath` through `points` (`(x, y)` in 0–1 of its frame), straight segments. +pub(crate) fn shape_path(id: &str, x: f64, y: f64, w: f64, h: f64, points: &[(f64, f64)], closed: bool) -> Value { + let pts: Vec = points.iter().map(|(px, py)| point(*px, *py)).collect(); + let mut l = with(layer("shapePath", id, id, x, y, w, h), "points", Value::Array(pts)); + l["isClosed"] = json!(closed); + l["booleanOperation"] = json!(-1); + l +} + +/// A `shapeGroup` (Sketch 51 and older wrap every shape in one) holding `layers`. +pub(crate) fn shape_group(id: &str, x: f64, y: f64, w: f64, h: f64, layers: Vec) -> Value { + with(layer("shapeGroup", id, id, x, y, w, h), "layers", Value::Array(layers)) +} diff --git a/crates/format/src/sketch/mod.rs b/crates/format/src/sketch/mod.rs index a46706dbe..5d7036223 100644 --- a/crates/format/src/sketch/mod.rs +++ b/crates/format/src/sketch/mod.rs @@ -13,6 +13,9 @@ #[cfg(test)] mod fixture; +mod path; +#[cfg(test)] +mod path_tests; #[cfg(test)] mod tests; mod tree; diff --git a/crates/format/src/sketch/path.rs b/crates/format/src/sketch/path.rs new file mode 100644 index 000000000..a842b2956 --- /dev/null +++ b/crates/format/src/sketch/path.rs @@ -0,0 +1,193 @@ +//! Sketch curve points → vector networks; shape groups → shapes and boolean operations. +//! +//! A path's `points` are `curvePoint`s whose `point`, `curveFrom` (the handle leaving the point) +//! and `curveTo` (the handle arriving at it) are `"{x, y}"` strings in 0–1 of the layer's frame; +//! values outside that range are allowed. Sketch 51 and older wrap every shape in a `shapeGroup` +//! that carries the style; its children combine left to right, each with its own +//! `booleanOperation` (−1 none and 0 union, 1 subtract, 2 intersect, 3 difference). + +use figcraft_doc::geom::{Affine, polygon_points, star_points}; +use figcraft_doc::{Region, Segment, VectorNetwork, Vertex, WindingRule}; +use serde_json::{Map as JsonMap, Value, json}; + +use super::tree::{Cx, base, layer, layers, local, size}; + +/// Most points read from one path. +const MAX_POINTS: usize = 100_000; + +/// What a path layer becomes. +pub(crate) enum Shape { + Vector(VectorNetwork), + Star { count: u32, ratio: f64 }, + Polygon { count: u32 }, +} + +/// `"{x, y}"` → `(x, y)`, both finite. +pub(crate) fn parse_point(s: &str) -> Option<(f64, f64)> { + let inner = s.trim().strip_prefix('{')?.strip_suffix('}')?; + let (x, y) = inner.split_once(',')?; + let n = |t: &str| t.trim().parse::().ok().filter(|v| v.is_finite()); + Some((n(x)?, n(y)?)) +} + +/// The network of a path layer of `w`×`h` (`None` when it has no usable points). +pub(crate) fn network(cx: &mut Cx, l: &Value, w: f64, h: f64) -> Option { + let pts = l.get("points").and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default(); + if pts.len() > MAX_POINTS { + cx.warn(format!("paths with more than {MAX_POINTS} points were cut")); + } + let at = |p: &Value, key: &str| p.get(key).and_then(Value::as_str).and_then(parse_point).map(|(x, y)| (x * w, y * h)); + let mut vertices = Vec::new(); + // Per vertex: its handles (relative to it) when it has them. + let mut handles: Vec<((f64, f64), (f64, f64))> = Vec::new(); + for p in pts.iter().take(MAX_POINTS) { + let Some((x, y)) = at(p, "point") else { + cx.warn("path points that couldn't be read were skipped"); + continue; + }; + let curved = p.get("curveMode").and_then(Value::as_i64).is_some_and(|m| m != 1); + let has = |flag: &str| p.get(flag).and_then(Value::as_bool).unwrap_or(curved); + let handle = |flag: &str, key: &str| if has(flag) { at(p, key).map_or((0.0, 0.0), |(hx, hy)| (hx - x, hy - y)) } else { (0.0, 0.0) }; + handles.push((handle("hasCurveFrom", "curveFrom"), handle("hasCurveTo", "curveTo"))); + let mut v = Vertex::new(x, y); + v.radius = p.get("cornerRadius").and_then(Value::as_f64).filter(|r| r.is_finite()).map_or(0.0, |r| r.clamp(0.0, 1e6)); + vertices.push(v); + } + let n = vertices.len(); + if n == 0 { + return None; + } + let closed = l.get("isClosed").and_then(Value::as_bool).unwrap_or(false) && n > 1; + let count = if closed { n } else { n - 1 }; + let segments: Vec = (0..count) + .map(|i| { + let j = (i + 1) % n; + let ta = handles.get(i).map_or((0.0, 0.0), |h| h.0); + let tb = handles.get(j).map_or((0.0, 0.0), |h| h.1); + Segment { a: i, b: j, ta, tb } + }) + .collect(); + let winding = match l.get("style").and_then(|s| s.get("windingRule")).and_then(Value::as_i64) { + Some(1) => WindingRule::EvenOdd, + _ => WindingRule::NonZero, + }; + let regions = if closed { vec![Region { loops: vec![(0..segments.len()).collect()], winding }] } else { Vec::new() }; + Some(VectorNetwork { vertices, segments, regions }) +} + +/// A path, star, polygon or triangle layer: a star or polygon while its points are still the +/// generated ones (same as FigCraft's, within half a percent), else an editable vector. +pub(crate) fn shape(cx: &mut Cx, l: &Value, w: f64, h: f64) -> Option { + let net = network(cx, l, w, h)?; + let class = l.get("_class").and_then(Value::as_str).unwrap_or(""); + let count = l.get("numberOfPoints").and_then(Value::as_u64).filter(|c| (3..=120).contains(c)).and_then(|c| u32::try_from(c).ok()); + let plain = net.vertices.iter().all(|v| v.radius == 0.0) && net.segments.iter().all(|s| s.ta == (0.0, 0.0) && s.tb == (0.0, 0.0)); + let matches = |pts: Vec| { + let tol = 0.005 * w.max(h) + 1e-6; + pts.len() == net.vertices.len() && pts.iter().zip(&net.vertices).all(|(p, v)| (p.x - v.x).abs() <= tol && (p.y - v.y).abs() <= tol) + }; + match (class, count) { + ("star", Some(count)) if plain => { + let ratio = l.get("radius").and_then(Value::as_f64).filter(|r| r.is_finite() && *r > 0.0).map_or(0.5, |r| r.min(1.0)); + if matches(star_points(w, h, count, ratio)) { + return Some(Shape::Star { count, ratio }); + } + } + ("polygon", Some(count)) if plain && matches(polygon_points(w, h, count)) => return Some(Shape::Polygon { count }), + _ => {} + } + Some(Shape::Vector(net)) +} + +/// Write `shape` into `node` (its type and geometry). +pub(crate) fn put_shape(cx: &mut Cx, shape: Shape, node: &mut JsonMap) { + match shape { + Shape::Vector(net) => { + node.insert("type".into(), json!("VECTOR")); + node.insert("vectorNetworkRef".into(), json!(cx.networks.len())); + cx.networks.push(Some(net)); + } + Shape::Star { count, ratio } => { + node.insert("type".into(), json!("STAR")); + node.insert("pointCount".into(), json!(count)); + node.insert("innerRadius".into(), json!(ratio)); + } + Shape::Polygon { count } => { + node.insert("type".into(), json!("REGULAR_POLYGON")); + node.insert("pointCount".into(), json!(count)); + } + } +} + +/// A `shapeGroup`: its only child carrying the group's place, name and style, or its children +/// combined by boolean operations (mixed operations nest from the left). +pub(crate) fn shape_group(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: bool) -> Option { + let (w, h) = size(l); + let world = parent * local(l, w, h); + let kids = layers(l); + if let [only] = kids { + let mut node = layer(cx, only, world, depth + 1, false)?; + let (cw, ch) = size(only); + let child_world = world * local(only, cw, ch); + let group = base(l, "GROUP", parent, child_world, cw, ch, root); + if let Some(m) = node.as_object_mut() { + for key in ["id", "name", "relativeTransform", "absoluteBoundingBox", "constraints", "locked"] { + match group.get(key) { + Some(v) => m.insert(key.into(), v.clone()), + None => m.remove(key), + }; + } + let visible = group.get("visible").and_then(Value::as_bool).unwrap_or(true) && m.get("visible").and_then(Value::as_bool).unwrap_or(true); + m.insert("visible".into(), json!(visible)); + } + return Some(node); + } + let mut chain: Vec = Vec::new(); + let mut op = "UNION"; + for (i, c) in kids.iter().enumerate() { + let Some(child) = layer(cx, c, world, depth + 2, false) else { continue }; + let this = boolean_op(c); + if i > 0 && this != op && chain.len() > 1 { + let inner = synthetic(l, op, parent, world, w, h, std::mem::take(&mut chain)); + chain.push(inner); + } + if i > 0 { + op = this; + } + chain.push(child); + } + if chain.is_empty() { + return None; + } + let mut node = base(l, "BOOLEAN_OPERATION", parent, world, w, h, root); + node.insert("booleanOperation".into(), json!(op)); + node.insert("children".into(), Value::Array(chain)); + Some(Value::Object(node)) +} + +/// A boolean operation the shape group doesn't have as a layer of its own: placed like the group. +fn synthetic(l: &Value, op: &str, parent: Affine, world: Affine, w: f64, h: f64, children: Vec) -> Value { + let mut node = base(l, "BOOLEAN_OPERATION", parent, world, w, h, false); + node.remove("id"); + let name = match op { + "SUBTRACT" => "Subtract", + "INTERSECT" => "Intersect", + "EXCLUDE" => "Exclude", + _ => "Union", + }; + node.insert("name".into(), json!(name)); + // Placed where the group is: inside it, that's no move at all. + node.insert("relativeTransform".into(), json!([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]])); + node.insert("booleanOperation".into(), json!(op)); + node.insert("children".into(), Value::Array(children)); + Value::Object(node) +} + +fn boolean_op(l: &Value) -> &'static str { + match l.get("booleanOperation").and_then(Value::as_i64) { + Some(1) => "SUBTRACT", + Some(2) => "INTERSECT", + Some(3) => "EXCLUDE", + _ => "UNION", + } +} diff --git a/crates/format/src/sketch/path_tests.rs b/crates/format/src/sketch/path_tests.rs new file mode 100644 index 000000000..8e1528fbf --- /dev/null +++ b/crates/format/src/sketch/path_tests.rs @@ -0,0 +1,154 @@ +//! Sketch paths → editable vector networks; shape groups → shapes and boolean operations; stars +//! and polygons. + +use figcraft_doc::{BoolOp, Document, NodeKind}; +use serde_json::{Value, json}; + +use super::fixture::*; +use super::import; +use super::path::parse_point; + +fn open(layers: Vec) -> Document { + let z = sketch_zip("50.2", 103, document(&["P"]), &[page("P", "Page", vec![artboard("A", "Board", 0.0, 0.0, 400.0, 400.0, layers)])], &[]); + import(&z, "f").unwrap().0 +} + +fn node<'d>(doc: &'d Document, name: &str) -> &'d figcraft_doc::Node { + doc.nodes().find(|n| n.name == name).unwrap_or_else(|| panic!("no layer named {name}")) +} + +fn with_op(mut l: Value, op: i64) -> Value { + l["booleanOperation"] = json!(op); + l +} + +#[test] +fn parse_point_accepts_sketch_strings() { + assert_eq!(parse_point("{0.5, 1}"), Some((0.5, 1.0))); + assert_eq!(parse_point("{-0.25,2e-1}"), Some((-0.25, 0.2))); + assert_eq!(parse_point("{1e400, 0}"), None); + assert_eq!(parse_point("garbage"), None); + assert_eq!(parse_point("{0.1}"), None); + assert_eq!(parse_point(""), None); +} + +#[test] +fn triangle_path_is_editable_vector() { + let tri = shape_path("Tri", 10.0, 10.0, 100.0, 100.0, &[(0.5, 0.0), (1.0, 1.0), (0.0, 1.0)], true); + let open_line = shape_path("Line", 10.0, 200.0, 100.0, 50.0, &[(0.0, 0.0), (1.0, 1.0)], false); + let doc = open(vec![tri, open_line]); + let NodeKind::Vector { network } = &node(&doc, "Tri").kind else { panic!("not a vector") }; + let pts: Vec<(f64, f64)> = network.vertices.iter().map(|v| (v.x, v.y)).collect(); + assert_eq!(pts, [(50.0, 0.0), (100.0, 100.0), (0.0, 100.0)]); + assert_eq!(network.segments.len(), 3); + assert_eq!(network.regions.len(), 1); + let NodeKind::Vector { network } = &node(&doc, "Line").kind else { panic!("not a vector") }; + assert_eq!(network.segments.len(), 1); + assert!(network.regions.is_empty()); +} + +#[test] +fn curve_handles_and_corner_radius_are_kept() { + let mut p = shape_path("Curve", 0.0, 0.0, 100.0, 100.0, &[(0.0, 0.0), (1.0, 0.0)], false); + p["points"][0]["curveMode"] = json!(2); + p["points"][0]["hasCurveFrom"] = json!(true); + p["points"][0]["curveFrom"] = json!("{0.25, 0.5}"); + p["points"][1]["curveMode"] = json!(2); + p["points"][1]["hasCurveTo"] = json!(true); + p["points"][1]["curveTo"] = json!("{0.75, 0.5}"); + p["points"][1]["cornerRadius"] = json!(6); + let doc = open(vec![p]); + let NodeKind::Vector { network } = &node(&doc, "Curve").kind else { panic!("not a vector") }; + let s = network.segments[0]; + assert_eq!((s.ta, s.tb), ((25.0, 50.0), (-25.0, 50.0))); + assert_eq!(network.vertices[1].radius, 6.0); +} + +#[test] +fn single_child_shape_group_collapses() { + let inner = with_op(rect("Inner", 0.0, 0.0, 50.0, 30.0), -1); + let doc = open(vec![shape_group("Button", 20.0, 40.0, 50.0, 30.0, vec![inner])]); + let b = node(&doc, "Button"); + assert!(matches!(b.kind, NodeKind::Rectangle)); + assert!(doc.nodes().all(|n| n.name != "Inner")); + let bb = doc.world_bounds(b.id).unwrap(); + assert_eq!((bb.x0, bb.y0, bb.width(), bb.height()), (20.0, 40.0, 50.0, 30.0)); +} + +#[test] +fn mixed_boolean_ops_chain_left() { + let a = with_op(rect("A", 0.0, 0.0, 50.0, 50.0), -1); + let b = with_op(rect("B", 10.0, 10.0, 20.0, 20.0), 1); + let c = with_op(rect("C", 60.0, 0.0, 20.0, 20.0), 0); + let doc = open(vec![shape_group("Combined", 0.0, 0.0, 80.0, 50.0, vec![a, b, c])]); + let outer = node(&doc, "Combined"); + assert!(matches!(outer.kind, NodeKind::BooleanOp { op: BoolOp::Union })); + let kids: Vec<&figcraft_doc::Node> = outer.children.iter().map(|c| doc.node(*c).unwrap()).collect(); + assert_eq!(kids.len(), 2); + assert!(matches!(kids[0].kind, NodeKind::BooleanOp { op: BoolOp::Subtract })); + assert_eq!(kids[1].name, "C"); + let inner: Vec<&str> = kids[0].children.iter().map(|c| doc.node(*c).unwrap().name.as_str()).collect(); + assert_eq!(inner, ["A", "B"]); + let bb = doc.world_bounds(node(&doc, "B").id).unwrap(); + assert_eq!((bb.x0, bb.y0), (10.0, 10.0)); +} + +#[test] +fn intersect_and_difference_ops() { + let a = with_op(rect("A", 0.0, 0.0, 50.0, 50.0), -1); + let b = with_op(rect("B", 10.0, 10.0, 50.0, 50.0), 2); + let doc = open(vec![shape_group("Both", 0.0, 0.0, 60.0, 60.0, vec![a.clone(), b])]); + assert!(matches!(node(&doc, "Both").kind, NodeKind::BooleanOp { op: BoolOp::Intersect })); + let b = with_op(rect("B", 10.0, 10.0, 50.0, 50.0), 3); + let doc = open(vec![shape_group("Either", 0.0, 0.0, 60.0, 60.0, vec![a, b])]); + assert!(matches!(node(&doc, "Either").kind, NodeKind::BooleanOp { op: BoolOp::Exclude })); +} + +#[test] +fn standalone_shapes_52_plus() { + let doc = open(vec![shape_path("Free", 5.0, 5.0, 10.0, 10.0, &[(0.0, 0.0), (1.0, 0.0), (1.0, 1.0)], true)]); + assert!(matches!(node(&doc, "Free").kind, NodeKind::Vector { .. })); +} + +#[test] +fn star_and_polygon() { + let unit = |pts: Vec, w: f64, h: f64| -> Vec<(f64, f64)> { pts.iter().map(|p| (p.x / w, p.y / h)).collect() }; + let mut star = shape_path("Star", 0.0, 0.0, 100.0, 80.0, &unit(figcraft_doc::geom::star_points(100.0, 80.0, 5, 0.5), 100.0, 80.0), true); + star["_class"] = json!("star"); + star["numberOfPoints"] = json!(5); + star["radius"] = json!(0.5); + let mut poly = shape_path("Hexagon", 0.0, 100.0, 60.0, 60.0, &unit(figcraft_doc::geom::polygon_points(60.0, 60.0, 6), 60.0, 60.0), true); + poly["_class"] = json!("polygon"); + poly["numberOfPoints"] = json!(6); + let mut edited = star.clone(); + edited["do_objectID"] = json!("Edited"); + edited["name"] = json!("Edited"); + edited["points"][2]["point"] = json!("{0.9, 0.9}"); + let mut tri = shape_path("Triangle", 200.0, 0.0, 50.0, 50.0, &[(0.5, 0.0), (1.0, 1.0), (0.0, 1.0)], true); + tri["_class"] = json!("triangle"); + let doc = open(vec![star, poly, edited, tri]); + assert!(matches!(node(&doc, "Star").kind, NodeKind::Star { count: 5, .. })); + if let NodeKind::Star { inner_ratio, .. } = node(&doc, "Star").kind { + assert!((inner_ratio - 0.5).abs() < 1e-9); + } + assert!(matches!(node(&doc, "Hexagon").kind, NodeKind::Polygon { count: 6 })); + assert!(matches!(node(&doc, "Edited").kind, NodeKind::Vector { .. })); + assert!(matches!(node(&doc, "Triangle").kind, NodeKind::Vector { .. })); +} + +#[test] +fn points_outside_unit_are_kept_finite() { + let doc = open(vec![shape_path("Over", 0.0, 0.0, 10.0, 10.0, &[(-0.5, 2.0), (1.0, 0.0), (0.0, 0.0)], true)]); + let NodeKind::Vector { network } = &node(&doc, "Over").kind else { panic!("not a vector") }; + assert!(network.vertices.iter().all(|v| v.x.is_finite() && v.y.is_finite())); + assert_eq!((network.vertices[0].x, network.vertices[0].y), (-5.0, 20.0)); +} + +#[test] +fn even_odd_winding() { + let mut p = shape_path("Holes", 0.0, 0.0, 10.0, 10.0, &[(0.0, 0.0), (1.0, 0.0), (1.0, 1.0)], true); + p["style"]["windingRule"] = json!(1); + let doc = open(vec![p]); + let NodeKind::Vector { network } = &node(&doc, "Holes").kind else { panic!("not a vector") }; + assert_eq!(network.regions[0].winding, figcraft_doc::WindingRule::EvenOdd); +} diff --git a/crates/format/src/sketch/tree.rs b/crates/format/src/sketch/tree.rs index 59e3d6375..89a43010c 100644 --- a/crates/format/src/sketch/tree.rs +++ b/crates/format/src/sketch/tree.rs @@ -70,43 +70,31 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: return None; } let class = str_field(l, "_class")?; + if class == "shapeGroup" { + return count(cx).then(|| super::path::shape_group(cx, l, parent, depth, root)).flatten(); + } let ty = match class { "artboard" | "frame" => "FRAME", "group" | "graphic" => "GROUP", "rectangle" | "bitmap" => "RECTANGLE", "oval" => "ELLIPSE", "slice" => "SLICE", + "shapePath" | "star" | "polygon" | "triangle" => "VECTOR", other => { cx.warn(format!("Sketch {} layers are not supported yet and were skipped", clip(other))); return None; } }; - if cx.nodes >= cx.max_nodes { - cx.warn(format!("the file has more than {} layers; the rest were skipped", cx.max_nodes)); + if !count(cx) { return None; } - cx.nodes += 1; let (w, h) = size(l); let world = parent * local(l, w, h); - let mut node = JsonMap::new(); - node.insert("type".into(), json!(ty)); - if let Some(id) = str_field(l, "do_objectID") { - node.insert("id".into(), json!(id)); + let mut node = base(l, ty, parent, world, w, h, root); + if ty == "VECTOR" { + let shape = super::path::shape(cx, l, w, h)?; + super::path::put_shape(cx, shape, &mut node); } - node.insert("name".into(), json!(str_field(l, "name").unwrap_or(class))); - node.insert("visible".into(), json!(bool_field(l, "isVisible").unwrap_or(true))); - node.insert("locked".into(), json!(bool_field(l, "isLocked").unwrap_or(false))); - node.insert("size".into(), json!({"x": w, "y": h})); - let rel = parent.inverse() * world; - let [a, b, c, d, e, f] = rel.as_coeffs(); - node.insert("relativeTransform".into(), json!([[a, c, e], [b, d, f]])); - // The page places top-level layers by their transform; deeper ones also say where they end up, - // which tells the importer their transform is relative to their group. - if !root { - let bb = world.transform_rect_bbox(Rect::new(0.0, 0.0, w, h)); - node.insert("absoluteBoundingBox".into(), json!({"x": bb.x0, "y": bb.y0, "width": bb.width(), "height": bb.height()})); - } - node.insert("constraints".into(), constraints(l.get("resizingConstraint").and_then(Value::as_i64).unwrap_or(63))); match class { "artboard" | "frame" => { let clips = if class == "artboard" { true } else { bool_field(l, "clipsContent").unwrap_or(true) }; @@ -134,8 +122,43 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: Some(Value::Object(node)) } +/// Count one more layer; false (with a warning) once the file's budget is spent. +fn count(cx: &mut Cx) -> bool { + if cx.nodes >= cx.max_nodes { + cx.warn(format!("the file has more than {} layers; the rest were skipped", cx.max_nodes)); + return false; + } + cx.nodes += 1; + true +} + +/// The properties every REST node of layer `l` has: its type, id, name, visibility, lock, size, +/// place (`world`, relative to `parent`) and constraints. +pub(crate) fn base(l: &Value, ty: &str, parent: Affine, world: Affine, w: f64, h: f64, root: bool) -> JsonMap { + let mut node = JsonMap::new(); + node.insert("type".into(), json!(ty)); + if let Some(id) = str_field(l, "do_objectID") { + node.insert("id".into(), json!(id)); + } + let class = str_field(l, "_class").unwrap_or("Layer"); + node.insert("name".into(), json!(str_field(l, "name").unwrap_or(class))); + node.insert("visible".into(), json!(bool_field(l, "isVisible").unwrap_or(true))); + node.insert("locked".into(), json!(bool_field(l, "isLocked").unwrap_or(false))); + node.insert("size".into(), json!({"x": w, "y": h})); + let [a, b, c, d, e, f] = (parent.inverse() * world).as_coeffs(); + node.insert("relativeTransform".into(), json!([[a, c, e], [b, d, f]])); + // The page places top-level layers by their transform; deeper ones also say where they end up, + // which tells the importer their transform is relative to their group. + if !root { + let bb = world.transform_rect_bbox(Rect::new(0.0, 0.0, w, h)); + node.insert("absoluteBoundingBox".into(), json!({"x": bb.x0, "y": bb.y0, "width": bb.width(), "height": bb.height()})); + } + node.insert("constraints".into(), constraints(l.get("resizingConstraint").and_then(Value::as_i64).unwrap_or(63))); + node +} + /// A layer's size from its `frame` (finite, not negative, at most [`MAX_SIZE`]). -fn size(l: &Value) -> (f64, f64) { +pub(crate) fn size(l: &Value) -> (f64, f64) { let f = l.get("frame"); let n = |k: &str| f.and_then(|f| f.get(k)).and_then(Value::as_f64).filter(|v| v.is_finite()).unwrap_or(0.0).clamp(0.0, MAX_SIZE); (n("width"), n("height")) @@ -143,7 +166,7 @@ fn size(l: &Value) -> (f64, f64) { /// A layer's transform within its parent: its frame's position, then its rotation (degrees, /// counter-clockwise on screen) and flips about its centre. -fn local(l: &Value, w: f64, h: f64) -> Affine { +pub(crate) fn local(l: &Value, w: f64, h: f64) -> Affine { let f = l.get("frame"); let n = |k: &str| f.and_then(|f| f.get(k)).and_then(Value::as_f64).filter(|v| v.is_finite()).unwrap_or(0.0).clamp(-MAX_COORD, MAX_COORD); let rot = l.get("rotation").and_then(Value::as_f64).filter(|v| v.is_finite()).unwrap_or(0.0) % 360.0; From d77d57912bf26408571a1844e7ca8addc244910c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 16:05:02 +0200 Subject: [PATCH 476/817] M6: Sketch import: fills, borders, effects, opacity, masks Solid, gradient (linear, radial with its ellipse, angular) and image pattern fills (tile, fill, stretch, fit); borders as strokes with the first enabled border's width and position, dashes, caps, joins and arrow ends; shadows, inner shadows, layer and background blurs; layer and paint opacity and blend modes; clipping masks, wrapped in a group of their own where Sketch breaks the mask chain; Display P3 documents. Shape groups pass their style to the shape or boolean operation they become. Noise fills, motion and zoom blurs are listed in the import report. Co-Authored-By: Claude Opus 5.5 --- crates/format/src/sketch/fixture.rs | 17 ++ crates/format/src/sketch/mod.rs | 13 +- crates/format/src/sketch/path.rs | 7 + crates/format/src/sketch/style.rs | 265 ++++++++++++++++++++++++ crates/format/src/sketch/style_tests.rs | 235 +++++++++++++++++++++ crates/format/src/sketch/tree.rs | 53 ++++- 6 files changed, 585 insertions(+), 5 deletions(-) create mode 100644 crates/format/src/sketch/style.rs create mode 100644 crates/format/src/sketch/style_tests.rs diff --git a/crates/format/src/sketch/fixture.rs b/crates/format/src/sketch/fixture.rs index 680847675..dc6fefe9c 100644 --- a/crates/format/src/sketch/fixture.rs +++ b/crates/format/src/sketch/fixture.rs @@ -132,3 +132,20 @@ pub(crate) fn shape_path(id: &str, x: f64, y: f64, w: f64, h: f64, points: &[(f6 pub(crate) fn shape_group(id: &str, x: f64, y: f64, w: f64, h: f64, layers: Vec) -> Value { with(layer("shapeGroup", id, id, x, y, w, h), "layers", Value::Array(layers)) } + +/// A Sketch colour. +pub(crate) fn color(r: f64, g: f64, b: f64, a: f64) -> Value { + json!({"_class": "color", "red": r, "green": g, "blue": b, "alpha": a}) +} + +/// An enabled solid fill. +pub(crate) fn solid_fill(r: f64, g: f64, b: f64, a: f64) -> Value { + json!({"_class": "fill", "isEnabled": true, "fillType": 0, "color": color(r, g, b, a), + "contextSettings": {"_class": "graphicsContextSettings", "blendMode": 0, "opacity": 1}}) +} + +/// `l` with `style.` set to `value`. +pub(crate) fn styled(mut l: Value, key: &str, value: Value) -> Value { + l["style"][key] = value; + l +} diff --git a/crates/format/src/sketch/mod.rs b/crates/format/src/sketch/mod.rs index 5d7036223..8ab154d91 100644 --- a/crates/format/src/sketch/mod.rs +++ b/crates/format/src/sketch/mod.rs @@ -16,6 +16,9 @@ mod fixture; mod path; #[cfg(test)] mod path_tests; +mod style; +#[cfg(test)] +mod style_tests; #[cfg(test)] mod tests; mod tree; @@ -79,7 +82,10 @@ pub(crate) fn import_within(bytes: &[u8], name: &str, max_member: u64) -> Result let mut warnings = archive.warnings.clone(); warnings.extend(map.warnings); let images = |r: &str| archive.image(r); - let (doc, more) = crate::rest::import_with_networks_plain(&map.json, &images, map.networks, max_nodes)?; + let (mut doc, more) = crate::rest::import_with_networks_plain(&map.json, &images, map.networks, max_nodes)?; + if archive.document.get("colorSpace").and_then(Value::as_i64) == Some(2) { + doc.color_profile = figcraft_doc::color::ColorProfile::DisplayP3; + } warnings.extend(more); Ok((doc, warnings)) } @@ -88,8 +94,9 @@ fn corrupt(msg: impl Into) -> FormatError { FormatError::Corrupt(format!("Sketch file: {}", msg.into())) } -/// The parts of a `.sketch` archive: the pages in document order and the images. +/// The parts of a `.sketch` archive: the document, the pages in document order and the images. pub(crate) struct Archive<'b> { + pub document: Value, /// `(id, page JSON)` in the document's order. pub pages: Vec<(String, Value)>, /// Problems met while reading (pages skipped). @@ -132,7 +139,7 @@ impl<'b> Archive<'b> { if refs.len() > MAX_PAGES { warnings.push(format!("the file has more than {MAX_PAGES} pages; the rest were skipped")); } - Ok(Archive { pages, warnings, zip: z }) + Ok(Archive { document, pages, warnings, zip: z }) } /// The bytes of the image a layer references (`images/`). diff --git a/crates/format/src/sketch/path.rs b/crates/format/src/sketch/path.rs index a842b2956..47a8f2d34 100644 --- a/crates/format/src/sketch/path.rs +++ b/crates/format/src/sketch/path.rs @@ -139,6 +139,10 @@ pub(crate) fn shape_group(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, } let visible = group.get("visible").and_then(Value::as_bool).unwrap_or(true) && m.get("visible").and_then(Value::as_bool).unwrap_or(true); m.insert("visible".into(), json!(visible)); + if let Some(st) = l.get("style") { + super::style::clear(m); + super::style::apply(cx, st, cw, ch, m); + } } return Some(node); } @@ -162,6 +166,9 @@ pub(crate) fn shape_group(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, let mut node = base(l, "BOOLEAN_OPERATION", parent, world, w, h, root); node.insert("booleanOperation".into(), json!(op)); node.insert("children".into(), Value::Array(chain)); + if let Some(st) = l.get("style") { + super::style::apply(cx, st, w, h, &mut node); + } Some(Value::Object(node)) } diff --git a/crates/format/src/sketch/style.rs b/crates/format/src/sketch/style.rs new file mode 100644 index 000000000..2da1b7a4e --- /dev/null +++ b/crates/format/src/sketch/style.rs @@ -0,0 +1,265 @@ +//! Sketch styles → REST paints, strokes, effects, opacity and blend modes. +//! +//! A layer's `style` lists `fills` and `borders` (each a colour, gradient or, for fills, an image +//! pattern, with its own `contextSettings` opacity and blend mode), `borderOptions` (dashes, caps, +//! joins), `shadows`, `innerShadows`, one `blur` and the layer's own `contextSettings`. Every +//! border has its own thickness and position; FigCraft strokes share one, so the first enabled +//! border's is used. + +use serde_json::{Map as JsonMap, Value, json}; + +use super::path::parse_point; +use super::tree::{Cx, color}; + +/// Most paints or effects read from one list. +const MAX_LIST: usize = 64; + +/// Write the paints, strokes, effects, opacity and blend mode of `style` into `node`, a layer of +/// `w`×`h`. Lists the style doesn't have are left as they are. +pub(crate) fn apply(cx: &mut Cx, style: &Value, w: f64, h: f64, node: &mut JsonMap) { + let fills: Vec = list(style, "fills").iter().filter_map(|f| paint(cx, f, w, h)).collect(); + if !fills.is_empty() { + node.insert("fills".into(), Value::Array(fills)); + } + borders(cx, style, w, h, node); + let effects = effects(cx, style); + if !effects.is_empty() { + node.insert("effects".into(), Value::Array(effects)); + } + if let Some(ctx) = style.get("contextSettings") { + if let Some(o) = num(ctx, "opacity") { + node.insert("opacity".into(), json!(o.clamp(0.0, 1.0))); + } + if let Some(b) = ctx.get("blendMode").and_then(Value::as_i64).filter(|b| *b != 0).and_then(blend) { + node.insert("blendMode".into(), json!(b)); + } + } +} + +/// Remove what [`apply`] writes, so another style can take its place. +pub(crate) fn clear(node: &mut JsonMap) { + for key in [ + "fills", + "strokes", + "strokeWeight", + "strokeAlign", + "strokeDashes", + "strokeCap", + "strokeCapStart", + "strokeCapEnd", + "strokeJoin", + "effects", + "opacity", + "blendMode", + ] { + node.remove(key); + } +} + +/// One fill or border as a REST paint; `None` for kinds FigCraft doesn't have (with a warning). +fn paint(cx: &mut Cx, f: &Value, w: f64, h: f64) -> Option { + let mut p = match f.get("fillType").and_then(Value::as_i64).unwrap_or(0) { + 0 => json!({"type": "SOLID", "color": f.get("color").and_then(color).unwrap_or_else(|| json!({"r": 0.0, "g": 0.0, "b": 0.0, "a": 1.0}))}), + 1 => gradient(f.get("gradient")?, w, h)?, + 4 => { + let Some(r) = f.get("image").and_then(|i| i.get("_ref")).and_then(Value::as_str) else { + cx.warn("image fills stored inside the JSON were skipped"); + return None; + }; + let mut p = json!({"type": "IMAGE", "imageRef": r}); + match f.get("patternFillType").and_then(Value::as_i64).unwrap_or(1) { + 0 => { + p["scaleMode"] = json!("TILE"); + p["scalingFactor"] = json!(num(f, "patternTileScale").filter(|s| *s > 0.0).unwrap_or(1.0)); + } + 2 => { + p["scaleMode"] = json!("STRETCH"); + p["imageTransform"] = json!([[1, 0, 0], [0, 1, 0]]); + } + 3 => p["scaleMode"] = json!("FIT"), + _ => p["scaleMode"] = json!("FILL"), + } + p + } + 5 => { + cx.warn("noise fills were skipped"); + return None; + } + other => { + cx.warn(format!("fills of type {other} were skipped")); + return None; + } + }; + p["visible"] = json!(f.get("isEnabled").and_then(Value::as_bool).unwrap_or(true)); + if let Some(ctx) = f.get("contextSettings") { + if let Some(o) = num(ctx, "opacity") { + p["opacity"] = json!(o.clamp(0.0, 1.0)); + } + if let Some(b) = ctx.get("blendMode").and_then(Value::as_i64).and_then(blend) { + p["blendMode"] = json!(b); + } + } + Some(p) +} + +/// A gradient fill: `from` and `to` in 0–1 of the layer; a radial gradient's `elipseLength` is its +/// width across the main axis as a share of the main axis, measured in pixels. +fn gradient(g: &Value, w: f64, h: f64) -> Option { + let point = |k: &str| g.get(k).and_then(Value::as_str).and_then(parse_point); + let (from, to) = (point("from").unwrap_or((0.5, 0.0)), point("to").unwrap_or((0.5, 1.0))); + let stops: Vec = list(g, "stops") + .iter() + .filter_map(|s| Some(json!({"position": num(s, "position")?.clamp(0.0, 1.0), "color": s.get("color").and_then(color)?}))) + .collect(); + let (ty, handles) = match g.get("gradientType").and_then(Value::as_i64).unwrap_or(0) { + 1 => { + let e = num(g, "elipseLength").filter(|e| *e > 0.0).unwrap_or(1.0); + let (dx, dy) = ((to.0 - from.0) * w, (to.1 - from.1) * h); + let across = if w > 0.0 && h > 0.0 { (from.0 - dy * e / w, from.1 + dx * e / h) } else { from }; + ("GRADIENT_RADIAL", json!([pt(from), pt(to), pt(across)])) + } + 2 => ("GRADIENT_ANGULAR", json!([pt((0.5, 0.5)), pt((0.5, 0.0))])), + _ => ("GRADIENT_LINEAR", json!([pt(from), pt(to)])), + }; + Some(json!({"type": ty, "gradientHandlePositions": handles, "gradientStops": stops})) +} + +fn pt((x, y): (f64, f64)) -> Value { + json!({"x": x, "y": y}) +} + +/// Borders → stroke paints, and the first enabled border's thickness and position. +fn borders(cx: &mut Cx, style: &Value, w: f64, h: f64, node: &mut JsonMap) { + let list = list(style, "borders"); + let strokes: Vec = list.iter().filter_map(|b| paint(cx, b, w, h)).collect(); + if strokes.is_empty() { + return; + } + let enabled: Vec<&Value> = list.iter().filter(|b| b.get("isEnabled").and_then(Value::as_bool).unwrap_or(true)).collect(); + let first = enabled.first().copied().or(list.first()); + let shape = |b: &Value| (num(b, "thickness").unwrap_or(1.0), b.get("position").and_then(Value::as_i64).unwrap_or(0)); + if let Some(b) = first { + let (t, pos) = shape(b); + if enabled.iter().any(|o| shape(o) != (t, pos)) { + cx.warn("layers with several borders of different widths or positions use the first one's"); + } + node.insert("strokeWeight".into(), json!(t.clamp(0.0, 1e6))); + node.insert( + "strokeAlign".into(), + json!(match pos { + 1 => "INSIDE", + 2 => "OUTSIDE", + _ => "CENTER", + }), + ); + } + node.insert("strokes".into(), Value::Array(strokes)); + if let Some(o) = style.get("borderOptions") { + let dashes: Vec = o + .get("dashPattern") + .and_then(Value::as_array) + .map(Vec::as_slice) + .unwrap_or_default() + .iter() + .filter_map(Value::as_f64) + .filter(|d| d.is_finite() && *d >= 0.0) + .take(MAX_LIST) + .collect(); + if !dashes.is_empty() { + node.insert("strokeDashes".into(), json!(dashes)); + } + node.insert( + "strokeCap".into(), + json!(match o.get("lineCapStyle").and_then(Value::as_i64) { + Some(1) => "ROUND", + Some(2) => "SQUARE", + _ => "NONE", + }), + ); + node.insert( + "strokeJoin".into(), + json!(match o.get("lineJoinStyle").and_then(Value::as_i64) { + Some(1) => "ROUND", + Some(2) => "BEVEL", + _ => "MITER", + }), + ); + } + for (key, field) in [("startMarkerType", "strokeCapStart"), ("endMarkerType", "strokeCapEnd")] { + let cap = match style.get(key).and_then(Value::as_i64).unwrap_or(0) { + 0 => continue, + 1 => "LINE_ARROW", + 2 => "TRIANGLE_ARROW", + 5 => "CIRCLE_FILLED", + _ => { + cx.warn("line ends other than arrows and filled circles were drawn without an end"); + continue; + } + }; + node.insert(field.into(), json!(cap)); + } +} + +/// Shadows, inner shadows and the blur as REST effects. +fn effects(cx: &mut Cx, style: &Value) -> Vec { + let mut out = Vec::new(); + for (key, ty) in [("shadows", "DROP_SHADOW"), ("innerShadows", "INNER_SHADOW")] { + for s in list(style, key) { + let mut c = s.get("color").and_then(color).unwrap_or_else(|| json!({"r": 0.0, "g": 0.0, "b": 0.0, "a": 0.5})); + let o = s.get("contextSettings").and_then(|c| num(c, "opacity")).unwrap_or(1.0).clamp(0.0, 1.0); + c["a"] = json!(c["a"].as_f64().unwrap_or(1.0) * o); + out.push(json!({ + "type": ty, + "visible": s.get("isEnabled").and_then(Value::as_bool).unwrap_or(true), + "radius": num(s, "blurRadius").unwrap_or(0.0).clamp(0.0, 1e6), + "spread": num(s, "spread").unwrap_or(0.0), + "offset": {"x": num(s, "offsetX").unwrap_or(0.0), "y": num(s, "offsetY").unwrap_or(0.0)}, + "color": c, + })); + } + } + if let Some(b) = style.get("blur").filter(|b| b.get("isEnabled").and_then(Value::as_bool) == Some(true)) { + let radius = num(b, "radius").unwrap_or(0.0).clamp(0.0, 1e6); + match b.get("type").and_then(Value::as_i64).unwrap_or(0) { + 0 => out.push(json!({"type": "LAYER_BLUR", "visible": true, "radius": radius})), + 3 => out.push(json!({"type": "BACKGROUND_BLUR", "visible": true, "radius": radius})), + _ => cx.warn("motion and zoom blurs were skipped"), + } + } + out.truncate(MAX_LIST); + out +} + +/// Sketch's blend modes (0 normal … 17 plus lighter) by REST name. +fn blend(mode: i64) -> Option<&'static str> { + const MODES: [&str; 18] = [ + "NORMAL", + "DARKEN", + "MULTIPLY", + "COLOR_BURN", + "LIGHTEN", + "SCREEN", + "COLOR_DODGE", + "OVERLAY", + "SOFT_LIGHT", + "HARD_LIGHT", + "DIFFERENCE", + "EXCLUSION", + "HUE", + "SATURATION", + "COLOR", + "LUMINOSITY", + "LINEAR_BURN", + "LINEAR_DODGE", + ]; + MODES.get(usize::try_from(mode).ok()?).copied() +} + +fn list<'v>(v: &'v Value, key: &str) -> &'v [Value] { + let l = v.get(key).and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default(); + l.get(..MAX_LIST).unwrap_or(l) +} + +fn num(v: &Value, key: &str) -> Option { + v.get(key).and_then(Value::as_f64).filter(|x| x.is_finite()) +} diff --git a/crates/format/src/sketch/style_tests.rs b/crates/format/src/sketch/style_tests.rs new file mode 100644 index 000000000..81b9f774e --- /dev/null +++ b/crates/format/src/sketch/style_tests.rs @@ -0,0 +1,235 @@ +//! Sketch styles → paints, strokes, effects, opacity, blend modes and masks. + +use figcraft_doc::color::{BlendMode, ColorProfile, GradientKind, ImageScaleMode, PaintKind}; +use figcraft_doc::{Document, EffectKind, NodeKind, StrokeAlign, StrokeCap, StrokeJoin}; +use serde_json::{Value, json}; + +use super::fixture::*; +use super::import; + +fn open_doc(document_json: Value, layers: Vec, files: &[(&str, &[u8])]) -> (Document, Vec) { + let z = sketch_zip("50.2", 103, document_json, &[page("P", "Page", vec![artboard("A", "Board", 0.0, 0.0, 400.0, 400.0, layers)])], files); + import(&z, "f").unwrap() +} + +fn open(layers: Vec) -> (Document, Vec) { + open_doc(document(&["P"]), layers, &[]) +} + +fn node<'d>(doc: &'d Document, name: &str) -> &'d figcraft_doc::Node { + doc.nodes().find(|n| n.name == name).unwrap_or_else(|| panic!("no layer named {name}")) +} + +fn r(name: &str) -> Value { + rect(name, 0.0, 0.0, 100.0, 50.0) +} + +#[test] +fn solid_and_disabled_fills() { + let mut second = solid_fill(0.0, 0.0, 1.0, 1.0); + second["isEnabled"] = json!(false); + let mut half = solid_fill(1.0, 0.0, 0.0, 1.0); + half["contextSettings"]["opacity"] = json!(0.5); + let (doc, _) = open(vec![styled(r("Two"), "fills", json!([half, second]))]); + let fills = &node(&doc, "Two").fills; + assert_eq!(fills.len(), 2); + assert!(matches!(fills[0].kind, PaintKind::Solid { color } if color.r == 1.0 && color.b == 0.0)); + assert!((fills[0].opacity - 0.5).abs() < 1e-6 && fills[0].visible); + assert!(!fills[1].visible); +} + +#[test] +fn collapsed_shape_group_takes_the_groups_style() { + let inner = with(r("Inner"), "booleanOperation", json!(-1)); + let g = styled(shape_group("Button", 0.0, 0.0, 100.0, 50.0, vec![inner]), "fills", json!([solid_fill(1.0, 0.0, 0.0, 1.0)])); + let (doc, _) = open(vec![g]); + assert!(matches!(node(&doc, "Button").fills[0].kind, PaintKind::Solid { color } if color.r == 1.0 && color.g == 0.0)); +} + +#[test] +fn boolean_shape_group_takes_the_groups_style() { + let a = with(rect("A", 0.0, 0.0, 50.0, 50.0), "booleanOperation", json!(-1)); + let b = with(rect("B", 10.0, 10.0, 20.0, 20.0), "booleanOperation", json!(1)); + let g = styled(shape_group("Ring", 0.0, 0.0, 50.0, 50.0, vec![a, b]), "fills", json!([solid_fill(0.0, 1.0, 0.0, 1.0)])); + let (doc, _) = open(vec![g]); + assert_eq!(node(&doc, "Ring").fills.len(), 1); +} + +#[test] +fn gradients() { + let stops = json!([{"_class": "gradientStop", "position": 0, "color": color(1.0, 0.0, 0.0, 1.0)}, + {"_class": "gradientStop", "position": 1, "color": color(0.0, 0.0, 1.0, 1.0)}]); + let grad = |ty: i64, ellipse: f64| { + json!({"_class": "fill", "isEnabled": true, "fillType": 1, "color": color(0.0, 0.0, 0.0, 1.0), + "gradient": {"_class": "gradient", "gradientType": ty, "from": "{0.5, 0}", "to": "{0.5, 1}", "elipseLength": ellipse, "stops": stops.clone()}}) + }; + let (doc, _) = open(vec![ + styled(r("Linear"), "fills", json!([grad(0, 0.0)])), + styled(r("Radial"), "fills", json!([grad(1, 0.5)])), + styled(r("Angular"), "fills", json!([grad(2, 0.0)])), + ]); + let g = |name: &str| match &node(&doc, name).fills[0].kind { + PaintKind::Gradient(g) => g.clone(), + other => panic!("{name}: {other:?}"), + }; + let lin = g("Linear"); + assert_eq!(lin.kind, GradientKind::Linear); + assert_eq!((lin.from, lin.to), ((0.5, 0.0), (0.5, 1.0))); + assert_eq!(lin.stops.len(), 2); + assert_eq!(lin.stops[1].color.b, 1.0); + assert_eq!(g("Radial").kind, GradientKind::Radial); + assert_eq!(g("Angular").kind, GradientKind::Angular); + // The radial gradient's width handle: half the length, across the main axis (in pixels). + let rad = g("Radial"); + let (dx, dy) = ((rad.width.0 - rad.from.0) * 100.0, (rad.width.1 - rad.from.1) * 50.0); + assert!(((dx * dx + dy * dy).sqrt() - 25.0).abs() < 1e-6, "{rad:?}"); +} + +#[test] +fn pattern_fill_modes() { + let png = { + let mut out = Vec::new(); + image::RgbaImage::new(2, 2).write_to(&mut std::io::Cursor::new(&mut out), image::ImageFormat::Png).unwrap(); + out + }; + let pat = |mode: i64| { + json!({"_class": "fill", "isEnabled": true, "fillType": 4, "patternFillType": mode, "patternTileScale": 1, + "image": {"_class": "MSJSONFileReference", "_ref": "images/p1.png"}}) + }; + let layers = (0..4).map(|m| styled(r(&format!("M{m}")), "fills", json!([pat(m)]))).collect(); + let (doc, _) = open_doc(document(&["P"]), layers, &[("images/p1.png", &png)]); + let mode = |name: &str| match &node(&doc, name).fills[0].kind { + PaintKind::Image(i) => i.scale_mode, + other => panic!("{other:?}"), + }; + assert_eq!(mode("M0"), ImageScaleMode::Tile); + assert_eq!(mode("M1"), ImageScaleMode::Fill); + assert_eq!(mode("M2"), ImageScaleMode::Crop); + assert_eq!(mode("M3"), ImageScaleMode::Fit); + assert_eq!(doc.images.len(), 1); +} + +#[test] +fn noise_fill_warns() { + let noise = json!({"_class": "fill", "isEnabled": true, "fillType": 5, "noiseIntensity": 0.3}); + let (_, warnings) = open(vec![styled(r("Noisy"), "fills", json!([noise]))]); + assert!(warnings.iter().any(|w| w.contains("noise")), "{warnings:?}"); +} + +#[test] +fn borders() { + let border = |pos: i64, t: f64| json!({"_class": "border", "isEnabled": true, "fillType": 0, "color": color(0.0, 0.0, 0.0, 1.0), "position": pos, "thickness": t}); + let opts = json!({"_class": "borderOptions", "isEnabled": true, "dashPattern": [4, 2], "lineCapStyle": 1, "lineJoinStyle": 2}); + let (doc, warnings) = open(vec![ + styled(r("Center"), "borders", json!([border(0, 2.0)])), + styled(styled(r("Inside"), "borders", json!([border(1, 3.0)])), "borderOptions", opts), + styled(r("Outside"), "borders", json!([border(2, 1.0)])), + styled(r("Two"), "borders", json!([border(1, 1.0), border(1, 5.0)])), + ]); + let s = |n: &str| node(&doc, n).stroke.clone(); + assert_eq!((s("Center").align, s("Center").weight), (StrokeAlign::Center, 2.0)); + assert_eq!((s("Inside").align, s("Inside").weight), (StrokeAlign::Inside, 3.0)); + assert_eq!(s("Inside").dashes, vec![4.0, 2.0]); + assert_eq!((s("Inside").cap_start, s("Inside").join), (StrokeCap::Round, StrokeJoin::Bevel)); + assert_eq!(s("Outside").align, StrokeAlign::Outside); + assert_eq!(node(&doc, "Two").strokes.len(), 2); + assert_eq!(s("Two").weight, 1.0); + assert!(warnings.iter().any(|w| w.contains("borders")), "{warnings:?}"); +} + +#[test] +fn shadows_and_blurs() { + let shadow = json!({"_class": "shadow", "isEnabled": true, "blurRadius": 8, "offsetX": 2, "offsetY": 4, "spread": 1, "color": color(0.0, 0.0, 0.0, 0.5), + "contextSettings": {"_class": "graphicsContextSettings", "blendMode": 0, "opacity": 1}}); + let mut off = shadow.clone(); + off["isEnabled"] = json!(false); + let blur = |ty: i64| json!({"_class": "blur", "isEnabled": true, "radius": 6, "type": ty}); + let (doc, warnings) = open(vec![ + styled(styled(r("Shadowed"), "shadows", json!([shadow, off])), "innerShadows", json!([shadow])), + styled(r("Blurred"), "blur", blur(0)), + styled(r("Frosted"), "blur", blur(3)), + styled(r("Moving"), "blur", blur(1)), + ]); + let fx = &node(&doc, "Shadowed").effects; + assert_eq!(fx.len(), 3); + match &fx[0].kind { + EffectKind::DropShadow(s) => assert_eq!((s.offset, s.radius, s.spread, s.color.a), ((2.0, 4.0), 8.0, 1.0, 0.5)), + other => panic!("{other:?}"), + } + assert!(!fx[1].visible); + assert!(matches!(fx[2].kind, EffectKind::InnerShadow(_))); + assert!(matches!(node(&doc, "Blurred").effects[0].kind, EffectKind::LayerBlur(_))); + assert!(matches!(node(&doc, "Frosted").effects[0].kind, EffectKind::BackgroundBlur(_))); + assert!(node(&doc, "Moving").effects.is_empty()); + assert!(warnings.iter().any(|w| w.contains("motion")), "{warnings:?}"); +} + +#[test] +fn opacity_and_blend() { + let modes = [ + BlendMode::Normal, + BlendMode::Darken, + BlendMode::Multiply, + BlendMode::ColorBurn, + BlendMode::Lighten, + BlendMode::Screen, + BlendMode::ColorDodge, + BlendMode::Overlay, + BlendMode::SoftLight, + BlendMode::HardLight, + BlendMode::Difference, + BlendMode::Exclusion, + BlendMode::Hue, + BlendMode::Saturation, + BlendMode::Color, + BlendMode::Luminosity, + BlendMode::PlusDarker, + BlendMode::PlusLighter, + ]; + let layers = (0..modes.len()) + .map(|i| styled(r(&format!("B{i}")), "contextSettings", json!({"_class": "graphicsContextSettings", "opacity": 0.3, "blendMode": i}))) + .collect(); + let (doc, _) = open(layers); + for (i, m) in modes.iter().enumerate() { + let n = node(&doc, &format!("B{i}")); + assert!((n.opacity - 0.3).abs() < 1e-6); + // A normal layer passes through like any other. + if i > 0 { + assert_eq!(n.blend, *m, "mode {i}"); + } + } +} + +#[test] +fn clipping_mask_chain() { + let mask = with(r("Mask"), "hasClippingMask", json!(true)); + let a = r("A"); + let b = with(r("B"), "shouldBreakMaskChain", json!(true)); + let c = r("C"); + let (doc, _) = open(vec![group("G", 0.0, 0.0, 100.0, 50.0, vec![mask, a, b, c])]); + let m = node(&doc, "Mask"); + assert!(m.is_mask); + // The mask and what it clips share a group of their own, so B and C stay unclipped. + let holder = m.parent.unwrap(); + let kids: Vec<&str> = doc.node(holder).unwrap().children.iter().map(|c| doc.node(*c).unwrap().name.as_str()).collect(); + assert_eq!(kids, ["Mask", "A"]); + assert_ne!(node(&doc, "B").parent, Some(holder)); + let bb = doc.world_bounds(node(&doc, "A").id).unwrap(); + assert_eq!((bb.x0, bb.y0), (0.0, 0.0)); +} + +#[test] +fn display_p3_document() { + let mut d = document(&["P"]); + d["colorSpace"] = json!(2); + let (doc, _) = open_doc(d, vec![], &[]); + assert_eq!(doc.color_profile, ColorProfile::DisplayP3); +} + +#[test] +fn style_on_frames_and_text_kinds_untouched() { + // An artboard keeps its background when its style has no fills. + let (doc, _) = open(vec![]); + assert!(matches!(node(&doc, "Board").kind, NodeKind::Frame)); + assert_eq!(node(&doc, "Board").fills.len(), 1); +} diff --git a/crates/format/src/sketch/tree.rs b/crates/format/src/sketch/tree.rs index 89a43010c..303be326a 100644 --- a/crates/format/src/sketch/tree.rs +++ b/crates/format/src/sketch/tree.rs @@ -50,7 +50,7 @@ pub(crate) fn to_rest(archive: &Archive, name: &str, max_nodes: usize) -> Map { node.insert("type".into(), json!("CANVAS")); node.insert("id".into(), json!(id)); node.insert("name".into(), json!(str_field(page, "name").unwrap_or("Page"))); - let kids: Vec = layers(page).iter().filter_map(|l| layer(&mut cx, l, Affine::IDENTITY, 0, true)).collect(); + let kids = children(&mut cx, page, Affine::IDENTITY, (0.0, 0.0), 0, true); node.insert("children".into(), Value::Array(kids)); canvases.push(Value::Object(node)); } @@ -95,6 +95,10 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: let shape = super::path::shape(cx, l, w, h)?; super::path::put_shape(cx, shape, &mut node); } + if bool_field(l, "hasClippingMask") == Some(true) { + node.insert("isMask".into(), json!(true)); + node.insert("maskType".into(), json!(if l.get("clippingMaskMode").and_then(Value::as_i64) == Some(1) { "ALPHA" } else { "VECTOR" })); + } match class { "artboard" | "frame" => { let clips = if class == "artboard" { true } else { bool_field(l, "clipsContent").unwrap_or(true) }; @@ -115,8 +119,11 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: }, _ => {} } + if let Some(st) = l.get("style") { + super::style::apply(cx, st, w, h, &mut node); + } if matches!(ty, "FRAME" | "GROUP") { - let kids: Vec = layers(l).iter().filter_map(|c| layer(cx, c, world, depth + 1, false)).collect(); + let kids = children(cx, l, world, (w, h), depth, false); node.insert("children".into(), Value::Array(kids)); } Some(Value::Object(node)) @@ -224,6 +231,48 @@ fn clip(s: &str) -> String { s.chars().take(64).collect() } +/// The child layers of `l` (placed at `world`, `size`) as REST nodes. A clipping mask clips the +/// layers after it up to one that breaks the chain (or the next mask); when that happens before +/// the end, the mask and what it clips are wrapped in a group of their own, since a FigCraft mask +/// clips everything above it. +pub(crate) fn children(cx: &mut Cx, l: &Value, world: Affine, size: (f64, f64), depth: usize, root: bool) -> Vec { + let built: Vec<(bool, Value)> = layers(l) + .iter() + .filter_map(|c| { + let breaks = bool_field(c, "shouldBreakMaskChain") == Some(true) || bool_field(c, "hasClippingMask") == Some(true); + layer(cx, c, world, depth + 1, root).map(|n| (breaks, n)) + }) + .collect(); + let mut out = Vec::new(); + let mut i = 0; + while let Some((_, n)) = built.get(i) { + let end = if n.get("isMask").and_then(Value::as_bool) == Some(true) { + built.iter().skip(i + 1).position(|(b, _)| *b).map(|k| i + 1 + k) + } else { + None + }; + let Some(end) = end else { + out.push(n.clone()); + i += 1; + continue; + }; + let masked: Vec = built.get(i..end).unwrap_or_default().iter().map(|(_, n)| n.clone()).collect(); + let mut g = JsonMap::new(); + g.insert("type".into(), json!("GROUP")); + g.insert("name".into(), json!("Mask group")); + g.insert("relativeTransform".into(), json!([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]])); + g.insert("size".into(), json!({"x": size.0, "y": size.1})); + if !root { + let bb = world.transform_rect_bbox(Rect::new(0.0, 0.0, size.0, size.1)); + g.insert("absoluteBoundingBox".into(), json!({"x": bb.x0, "y": bb.y0, "width": bb.width(), "height": bb.height()})); + } + g.insert("children".into(), Value::Array(masked)); + out.push(Value::Object(g)); + i = end; + } + out +} + /// A text layer whose string is a binary property list (Sketch 43–47). fn is_archived_text(l: &Value) -> bool { l.get("attributedString").is_some_and(|a| a.get("archivedAttributedString").is_some()) From 8f32e4f504720d7959d98c9299372fe4168aec0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 16:09:08 +0200 Subject: [PATCH 477/817] M6: Sketch import: shape groups that are clipping masks clip Sketch 51 and older files make masks from shape groups; the mask flag was lost when the group became its shape or boolean operation, so a masked map spilled out of its card. Co-Authored-By: Claude Opus 5.5 --- crates/format/src/sketch/path.rs | 2 ++ crates/format/src/sketch/style_tests.rs | 15 +++++++++++++++ crates/format/src/sketch/tree.rs | 13 +++++++++---- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/crates/format/src/sketch/path.rs b/crates/format/src/sketch/path.rs index 47a8f2d34..6ebb1a756 100644 --- a/crates/format/src/sketch/path.rs +++ b/crates/format/src/sketch/path.rs @@ -143,6 +143,7 @@ pub(crate) fn shape_group(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, super::style::clear(m); super::style::apply(cx, st, cw, ch, m); } + super::tree::mask(l, m); } return Some(node); } @@ -166,6 +167,7 @@ pub(crate) fn shape_group(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, let mut node = base(l, "BOOLEAN_OPERATION", parent, world, w, h, root); node.insert("booleanOperation".into(), json!(op)); node.insert("children".into(), Value::Array(chain)); + super::tree::mask(l, &mut node); if let Some(st) = l.get("style") { super::style::apply(cx, st, w, h, &mut node); } diff --git a/crates/format/src/sketch/style_tests.rs b/crates/format/src/sketch/style_tests.rs index 81b9f774e..6bc02bd87 100644 --- a/crates/format/src/sketch/style_tests.rs +++ b/crates/format/src/sketch/style_tests.rs @@ -233,3 +233,18 @@ fn style_on_frames_and_text_kinds_untouched() { assert!(matches!(node(&doc, "Board").kind, NodeKind::Frame)); assert_eq!(node(&doc, "Board").fills.len(), 1); } + +#[test] +fn shape_group_masks_clip() { + // Sketch 51 and older: the mask is a shape group. + let inner = with(r("Outline"), "booleanOperation", json!(-1)); + let mask = with(shape_group("Card", 0.0, 0.0, 100.0, 50.0, vec![inner]), "hasClippingMask", json!(true)); + let a = rect("A", 0.0, 0.0, 300.0, 300.0); + let b = with(r("B"), "shouldBreakMaskChain", json!(true)); + let (doc, _) = open(vec![group("G", 0.0, 0.0, 300.0, 300.0, vec![mask, a, b])]); + let m = node(&doc, "Card"); + assert!(m.is_mask); + let holder = doc.node(m.parent.unwrap()).unwrap(); + let kids: Vec<&str> = holder.children.iter().map(|c| doc.node(*c).unwrap().name.as_str()).collect(); + assert_eq!(kids, ["Card", "A"]); +} diff --git a/crates/format/src/sketch/tree.rs b/crates/format/src/sketch/tree.rs index 303be326a..bfa594558 100644 --- a/crates/format/src/sketch/tree.rs +++ b/crates/format/src/sketch/tree.rs @@ -95,10 +95,7 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: let shape = super::path::shape(cx, l, w, h)?; super::path::put_shape(cx, shape, &mut node); } - if bool_field(l, "hasClippingMask") == Some(true) { - node.insert("isMask".into(), json!(true)); - node.insert("maskType".into(), json!(if l.get("clippingMaskMode").and_then(Value::as_i64) == Some(1) { "ALPHA" } else { "VECTOR" })); - } + mask(l, &mut node); match class { "artboard" | "frame" => { let clips = if class == "artboard" { true } else { bool_field(l, "clipsContent").unwrap_or(true) }; @@ -129,6 +126,14 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: Some(Value::Object(node)) } +/// A clipping mask's flag and kind (outline or alpha). +pub(crate) fn mask(l: &Value, node: &mut JsonMap) { + if bool_field(l, "hasClippingMask") == Some(true) { + node.insert("isMask".into(), json!(true)); + node.insert("maskType".into(), json!(if l.get("clippingMaskMode").and_then(Value::as_i64) == Some(1) { "ALPHA" } else { "VECTOR" })); + } +} + /// Count one more layer; false (with a warning) once the file's budget is spent. fn count(cx: &mut Cx) -> bool { if cx.nodes >= cx.max_nodes { From ff9d966ea679803c9203bb14978e3c2df0808aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 16:18:34 +0200 Subject: [PATCH 478/817] M6: Sketch import: masks that show their own style draw it Sketch draws a clipping mask with its fills, borders and effects under what it clips; a FigCraft mask only clips. A plain copy of such a mask goes underneath it, so a light avatar circle with a white icon in it no longer vanishes on a white artboard. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/sketch_import_tests.rs | 51 +++++++++++++++++++++++- crates/format/src/sketch/style_tests.rs | 35 ++++++++++++++++ crates/format/src/sketch/tree.rs | 26 ++++++++++++ 3 files changed, 110 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/sketch_import_tests.rs b/crates/engine/src/sketch_import_tests.rs index cb3bf2f1e..09959bb60 100644 --- a/crates/engine/src/sketch_import_tests.rs +++ b/crates/engine/src/sketch_import_tests.rs @@ -10,6 +10,11 @@ use crate::Session; /// A minimal `.sketch` zip with one page per `(id, name)`, saved by `app_version`. fn sketch(app_version: &str, pages: &[(&str, &str)]) -> Vec { + sketch_with(app_version, pages, &[]) +} + +/// [`sketch`] with `layers` on the first page. +fn sketch_with(app_version: &str, pages: &[(&str, &str)], layers: &[Value]) -> Vec { let refs: Vec = pages.iter().map(|(id, _)| json!({"_class": "MSJSONFileReference", "_ref": format!("pages/{id}")})).collect(); let mut out = Vec::new(); { @@ -19,9 +24,10 @@ fn sketch(app_version: &str, pages: &[(&str, &str)]) -> Vec { z.write_all(json!({"_class": "document", "pages": refs}).to_string().as_bytes()).unwrap(); z.start_file("meta.json", o).unwrap(); z.write_all(json!({"app": "com.bohemiancoding.sketch3", "appVersion": app_version, "version": 103}).to_string().as_bytes()).unwrap(); - for (id, name) in pages { + for (i, (id, name)) in pages.iter().enumerate() { + let ls = if i == 0 { layers.to_vec() } else { Vec::new() }; z.start_file(format!("pages/{id}.json"), o).unwrap(); - z.write_all(json!({"_class": "page", "do_objectID": id, "name": name, "layers": []}).to_string().as_bytes()).unwrap(); + z.write_all(json!({"_class": "page", "do_objectID": id, "name": name, "layers": ls}).to_string().as_bytes()).unwrap(); } z.finish().unwrap(); } @@ -87,3 +93,44 @@ fn old_and_damaged_sketch_files_fail_cleanly() { assert!(s.execute("file.open", &json!({"path": path.to_string_lossy()})).is_err()); let _ = std::fs::remove_dir_all(&dir); } + +fn shape(class: &str, name: &str, frame: [f64; 4], extra: Value) -> Value { + let mut l = json!({"_class": class, "do_objectID": name, "name": name, "isVisible": true, "resizingConstraint": 63, + "frame": {"x": frame[0], "y": frame[1], "width": frame[2], "height": frame[3]}, "style": {"fills": []}}); + for (k, v) in extra.as_object().unwrap() { + l[k] = v.clone(); + } + l +} + +fn fill(grey: f64) -> Value { + json!({"style": {"fills": [{"isEnabled": true, "fillType": 0, "color": {"red": grey, "green": grey, "blue": grey, "alpha": 1}}]}}) +} + +/// Sketch draws a mask's own fill under what it clips; the clipped layers show inside it. +#[test] +fn sketch_masks_show_their_content() { + let oval = shape("oval", "Ring", [0.0, 0.0, 60.0, 60.0], json!({"booleanOperation": -1, "points": []})); + let mut mask = shape("shapeGroup", "Circle", [0.0, 0.0, 60.0, 60.0], fill(0.8)); + mask["hasClippingMask"] = json!(true); + mask["layers"] = json!([oval]); + let pts = ["{0, 0}", "{1, 0}", "{1, 1}", "{0, 1}"].map(|p| json!({"point": p, "curveFrom": p, "curveTo": p, "curveMode": 1})); + let body = shape("shapePath", "Square", [0.0, 0.0, 20.0, 20.0], json!({"points": pts, "isClosed": true, "booleanOperation": -1})); + let mut content = shape("shapeGroup", "Body", [20.0, 20.0, 20.0, 20.0], fill(0.2)); + content["layers"] = json!([body]); + let icon = shape("group", "Icon", [0.0, 0.0, 60.0, 60.0], json!({"layers": [mask, content]})); + let data = base64::engine::general_purpose::STANDARD.encode(sketch_with("50.2", &[("A", "Page")], &[icon])); + let mut s = Session::new(); + s.execute("file.open", &json!({"data": data, "name": "x.sketch"})).unwrap(); + let doc = s.doc().unwrap(); + let icon = doc.nodes().find(|n| n.name == "Icon").unwrap().id; + let pix = figcraft_render::render_node(doc, icon, 1.0).unwrap(); + let px = |x: u32, y: u32| pix.pixel(x, y).unwrap(); + // The square in the middle, dark grey. + let c = px(30, 30); + assert!(c.alpha() > 200 && c.red() < 100, "content: {c:?}"); + // The mask's own fill around it, light grey; outside the circle nothing. + let m = px(30, 8); + assert!(m.alpha() > 200 && m.red() > 150, "mask fill: {m:?}"); + assert!(px(2, 2).alpha() < 50); +} diff --git a/crates/format/src/sketch/style_tests.rs b/crates/format/src/sketch/style_tests.rs index 6bc02bd87..ee428c881 100644 --- a/crates/format/src/sketch/style_tests.rs +++ b/crates/format/src/sketch/style_tests.rs @@ -248,3 +248,38 @@ fn shape_group_masks_clip() { let kids: Vec<&str> = holder.children.iter().map(|c| doc.node(*c).unwrap().name.as_str()).collect(); assert_eq!(kids, ["Card", "A"]); } + +#[test] +fn masked_icon_keeps_its_geometry() { + let oval = { + let mut o = with(rect("Path", 0.0, 0.0, 67.0, 67.0), "booleanOperation", json!(-1)); + o["_class"] = json!("oval"); + o + }; + let mask = styled( + with(shape_group("Circle", 0.0, 0.0, 67.0, 67.0, vec![oval]), "hasClippingMask", json!(true)), + "fills", + json!([solid_fill(0.9, 0.9, 0.9, 1.0)]), + ); + let p = |id: &str, x: f64, y: f64, w: f64, h: f64, op: i64| { + with(shape_path(id, x, y, w, h, &[(0.0, 0.0), (1.0, 0.0), (1.0, 1.0)], true), "booleanOperation", json!(op)) + }; + let content = styled( + shape_group( + "Body", + 12.0, + 12.0, + 45.0, + 62.0, + vec![p("P1", 9.0, 9.0, 22.0, 22.0, -1), p("P2", 25.0, 15.0, 20.0, 15.0, 0), p("P3", 0.0, 17.0, 31.0, 45.0, 0)], + ), + "fills", + json!([solid_fill(0.5, 0.5, 0.5, 1.0)]), + ); + let (doc, _) = open(vec![group("Icon", 152.0, 20.0, 67.0, 67.0, vec![mask, content])]); + let b = doc.world_bounds(node(&doc, "Circle").id).unwrap(); + assert_eq!((b.x0, b.y0, b.width(), b.height()), (152.0, 20.0, 67.0, 67.0), "mask"); + let b = doc.world_bounds(node(&doc, "Body").id).unwrap(); + assert!((b.x0 - 164.0).abs() < 1e-6 && (b.y0 - 41.0).abs() < 1e-6 && (b.width() - 45.0).abs() < 1e-6, "body {b:?}"); + assert!(matches!(node(&doc, "Circle").kind, NodeKind::Ellipse { .. })); +} diff --git a/crates/format/src/sketch/tree.rs b/crates/format/src/sketch/tree.rs index bfa594558..c59b8c90d 100644 --- a/crates/format/src/sketch/tree.rs +++ b/crates/format/src/sketch/tree.rs @@ -247,6 +247,12 @@ pub(crate) fn children(cx: &mut Cx, l: &Value, world: Affine, size: (f64, f64), let breaks = bool_field(c, "shouldBreakMaskChain") == Some(true) || bool_field(c, "hasClippingMask") == Some(true); layer(cx, c, world, depth + 1, root).map(|n| (breaks, n)) }) + .flat_map(|(breaks, n)| match drawn_mask(&n) { + // Sketch also draws a mask with its own style, under what it clips; a FigCraft mask + // only clips, so a plain copy of it goes underneath. + Some(copy) => vec![(false, copy), (breaks, n)], + None => vec![(breaks, n)], + }) .collect(); let mut out = Vec::new(); let mut i = 0; @@ -278,6 +284,26 @@ pub(crate) fn children(cx: &mut Cx, l: &Value, world: Affine, size: (f64, f64), out } +/// A plain copy of mask `n` when its style shows something (fills, borders or effects). +fn drawn_mask(n: &Value) -> Option { + if n.get("isMask").and_then(Value::as_bool) != Some(true) { + return None; + } + let shows = + |key: &str| n.get(key).and_then(Value::as_array).is_some_and(|l| l.iter().any(|p| p.get("visible").and_then(Value::as_bool) != Some(false))); + if !(shows("fills") || shows("strokes") || shows("effects")) { + return None; + } + let mut copy = n.clone(); + let m = copy.as_object_mut()?; + m.remove("isMask"); + m.remove("maskType"); + m.remove("id"); + let name = m.get("name").and_then(Value::as_str).unwrap_or("Mask").to_string(); + m.insert("name".into(), json!(format!("{name} (drawn)"))); + Some(copy) +} + /// A text layer whose string is a binary property list (Sketch 43–47). fn is_archived_text(l: &Value) -> bool { l.get("attributedString").is_some_and(|a| a.get("archivedAttributedString").is_some()) From a0542e581c57de857fac34ca6c9c21829dcd6d4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 16:23:30 +0200 Subject: [PATCH 479/817] M6: Sketch import: text with styled runs and font names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Text layers keep their string and styled runs (font, size, colour, line height, letter spacing, decorations, text transform; ranges in UTF-16 units, clamped), paragraph alignment and spacing, vertical alignment and how the box sizes. Fonts named by PostScript name become family and style; the engine then matches families to installed ones ignoring spaces (PingFangSC → PingFang SC). Fonts embedded in newer files are named in the import report. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/file.rs | 35 +++++ crates/engine/src/sketch_import_tests.rs | 11 ++ crates/format/src/fig/mod.rs | 2 +- crates/format/src/sketch/fixture.rs | 19 +++ crates/format/src/sketch/mod.rs | 19 +++ crates/format/src/sketch/text.rs | 165 ++++++++++++++++++++ crates/format/src/sketch/text_tests.rs | 188 +++++++++++++++++++++++ crates/format/src/sketch/tree.rs | 4 + 8 files changed, 442 insertions(+), 1 deletion(-) create mode 100644 crates/format/src/sketch/text.rs create mode 100644 crates/format/src/sketch/text_tests.rs diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index 4f8802b71..179f1c063 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -558,11 +558,46 @@ fn load_with( fn load_sketch(bytes: &[u8], name: &str) -> Option> { let r = figcraft_format::sketch::try_import(bytes, name)?; Some(r.map_err(|e| EngineError::Other(e.to_string())).map(|(mut doc, warnings)| { + match_font_families(&mut doc); link_instances(&mut doc); figcraft_format::Loaded { issues: warnings, ..doc.into() } })) } +/// Font families a `.sketch` import guessed from PostScript names ("Ping Fang SC" from +/// "PingFangSC-Semibold") take the installed family's name when they differ only in spaces and +/// case. +fn match_font_families(doc: &mut Document) { + let installed = figcraft_text::fontdb::family_names(); + let mut cache: std::collections::BTreeMap> = std::collections::BTreeMap::new(); + let mut fix = |style: &mut figcraft_doc::TextStyle| { + let found = cache.entry(style.font_family.clone()).or_insert_with(|| installed_family(&style.font_family, &installed)); + if let Some(f) = found { + style.font_family = f.clone(); + } + }; + let ids: Vec = doc.nodes().filter(|n| matches!(n.kind, NodeKind::Text(_))).map(|n| n.id).collect(); + for id in ids { + if let Some(NodeKind::Text(td)) = doc.node_mut(id).map(|n| &mut n.kind) { + fix(&mut td.style); + for r in &mut td.runs { + fix(&mut r.style); + } + } + } +} + +/// The installed family `family` means when it isn't installed under that exact name: the one +/// whose name is the same without spaces, ignoring case. +pub(crate) fn installed_family(family: &str, installed: &[String]) -> Option { + let key = |s: &str| s.chars().filter(|c| !c.is_whitespace()).flat_map(char::to_lowercase).collect::(); + if installed.iter().any(|f| f.eq_ignore_ascii_case(family)) { + return None; + } + let want = key(family); + installed.iter().find(|f| key(f) == want).cloned() +} + /// Gives `None` when `bytes` are not a `.fig` file. Then other readers can try. pub(crate) fn load_fig(bytes: &[u8], name: &str) -> Option> { let r = figcraft_format::fig::try_import(bytes, name)?; diff --git a/crates/engine/src/sketch_import_tests.rs b/crates/engine/src/sketch_import_tests.rs index 09959bb60..ac35cb06e 100644 --- a/crates/engine/src/sketch_import_tests.rs +++ b/crates/engine/src/sketch_import_tests.rs @@ -134,3 +134,14 @@ fn sketch_masks_show_their_content() { assert!(m.alpha() > 200 && m.red() > 150, "mask fill: {m:?}"); assert!(px(2, 2).alpha() < 50); } + +/// Family names guessed from PostScript names find the installed family whatever its spaces. +#[test] +fn sketch_font_families_match_installed_ones() { + let installed = ["PingFang SC".to_string(), "Helvetica Neue".to_string(), "IBM Plex Sans".to_string()]; + let m = |f: &str| crate::cmd::file::installed_family(f, &installed); + assert_eq!(m("Ping Fang SC").as_deref(), Some("PingFang SC")); + assert_eq!(m("Helvetica Neue"), None, "already right"); + assert_eq!(m("IBMPlex Sans").as_deref(), Some("IBM Plex Sans")); + assert_eq!(m("Comic Sans"), None); +} diff --git a/crates/format/src/fig/mod.rs b/crates/format/src/fig/mod.rs index 4c103d088..8932c18af 100644 --- a/crates/format/src/fig/mod.rs +++ b/crates/format/src/fig/mod.rs @@ -115,7 +115,7 @@ pub fn import(bytes: &[u8], name: &str) -> Result<(Document, Vec), Forma /// A font style under the name the format uses: the standard weight names as words ("SemiBold" /// → "Semi Bold", "ExtraBoldItalic" → "Extra Bold Italic", "Regular Italic" → "Italic"). Other /// names stay as they are. -fn style_name(style: &str) -> String { +pub(crate) fn style_name(style: &str) -> String { const WEIGHTS: [&str; 12] = ["Thin", "Extra Light", "Ultra Light", "Light", "Regular", "Medium", "Semi Bold", "Demi Bold", "Bold", "Extra Bold", "Ultra Bold", "Black"]; let compact = |s: &str| s.chars().filter(|c| !matches!(c, ' ' | '-' | '_')).flat_map(char::to_lowercase).collect::(); diff --git a/crates/format/src/sketch/fixture.rs b/crates/format/src/sketch/fixture.rs index dc6fefe9c..a7c5ea73a 100644 --- a/crates/format/src/sketch/fixture.rs +++ b/crates/format/src/sketch/fixture.rs @@ -149,3 +149,22 @@ pub(crate) fn styled(mut l: Value, key: &str, value: Value) -> Value { l["style"][key] = value; l } + +/// A text layer showing `string`, one run per `(location, length, font, size, rgba)`; locations and +/// lengths count UTF-16 code units, as Sketch does. +pub(crate) fn text(id: &str, x: f64, y: f64, w: f64, h: f64, string: &str, runs: &[(usize, usize, &str, f64, [f64; 4])]) -> Value { + let attrs: Vec = runs + .iter() + .map(|(loc, len, font, size, [r, g, b, a])| { + json!({"_class": "stringAttribute", "location": loc, "length": len, "attributes": { + "MSAttributedStringFontAttribute": {"_class": "fontDescriptor", "attributes": {"name": font, "size": size}}, + "MSAttributedStringColorAttribute": color(*r, *g, *b, *a), + "paragraphStyle": {"_class": "paragraphStyle", "alignment": 0}, + }}) + }) + .collect(); + let mut l = layer("text", id, id, x, y, w, h); + l["attributedString"] = json!({"_class": "attributedString", "string": string, "attributes": attrs}); + l["textBehaviour"] = json!(1); + l +} diff --git a/crates/format/src/sketch/mod.rs b/crates/format/src/sketch/mod.rs index 8ab154d91..8859c4a91 100644 --- a/crates/format/src/sketch/mod.rs +++ b/crates/format/src/sketch/mod.rs @@ -21,6 +21,9 @@ mod style; mod style_tests; #[cfg(test)] mod tests; +mod text; +#[cfg(test)] +mod text_tests; mod tree; #[cfg(test)] mod tree_tests; @@ -81,6 +84,9 @@ pub(crate) fn import_within(bytes: &[u8], name: &str, max_member: u64) -> Result } let mut warnings = archive.warnings.clone(); warnings.extend(map.warnings); + if let Some(note) = embedded_fonts(&archive.document) { + warnings.push(note); + } let images = |r: &str| archive.image(r); let (mut doc, more) = crate::rest::import_with_networks_plain(&map.json, &images, map.networks, max_nodes)?; if archive.document.get("colorSpace").and_then(Value::as_i64) == Some(2) { @@ -90,6 +96,19 @@ pub(crate) fn import_within(bytes: &[u8], name: &str, max_member: u64) -> Result Ok((doc, warnings)) } +/// The note about fonts the file carries (Sketch 7x and newer can embed them): FigCraft doesn't +/// use fonts from inside documents, so their text shows in installed fonts. +fn embedded_fonts(document: &Value) -> Option { + let refs = document.get("fontReferences").and_then(Value::as_array)?; + let families: BTreeSet = + refs.iter().filter_map(|r| r.get("fontFamilyName").and_then(Value::as_str)).map(|f| f.chars().take(64).collect()).take(20).collect(); + if families.is_empty() { + return None; + } + let list: Vec<&str> = families.iter().map(String::as_str).collect(); + Some(format!("the file has embedded fonts FigCraft doesn't use ({}); install them to see the text as designed", list.join(", "))) +} + fn corrupt(msg: impl Into) -> FormatError { FormatError::Corrupt(format!("Sketch file: {}", msg.into())) } diff --git a/crates/format/src/sketch/text.rs b/crates/format/src/sketch/text.rs new file mode 100644 index 000000000..edafe30ea --- /dev/null +++ b/crates/format/src/sketch/text.rs @@ -0,0 +1,165 @@ +//! Sketch text layers → REST text nodes. +//! +//! A text layer's `attributedString` holds the `string` and `attributes`: runs given by `location` +//! and `length` in UTF-16 code units (like the REST importer's per-character style ids), each with +//! a font (PostScript name and size), colour, kerning, paragraph style, decorations and text +//! transform. `textBehaviour` sizes the box (0 auto width, 1 fixed width, 2 fixed); the style's +//! `textStyle` gives the vertical alignment. + +use serde_json::{Map as JsonMap, Value, json}; + +use super::tree::{Cx, color}; + +/// Most characters read from one text layer (the REST importer's own limit). +const MAX_CHARS: usize = 1 << 20; +/// Most runs read from one text layer. +const MAX_RUNS: usize = 10_000; + +/// Fill `node` (a TEXT node) from text layer `l`. +pub(crate) fn node(cx: &mut Cx, l: &Value, node: &mut JsonMap) { + let a = l.get("attributedString"); + let string: String = a.and_then(|a| a.get("string")).and_then(Value::as_str).unwrap_or("").chars().take(MAX_CHARS).collect(); + let units = string.encode_utf16().count(); + let runs: &[Value] = a.and_then(|a| a.get("attributes")).and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default(); + if runs.len() > MAX_RUNS { + cx.warn(format!("text with more than {MAX_RUNS} styled runs keeps the first ones")); + } + let fallback = l.get("style").and_then(|s| s.get("textStyle")).and_then(|t| t.get("encodedAttributes")); + let styles: Vec<(usize, usize, Value)> = runs + .iter() + .take(MAX_RUNS) + .filter_map(|r| { + let start = usize::try_from(r.get("location")?.as_u64()?).ok()?.min(units); + let len = usize::try_from(r.get("length")?.as_u64()?).unwrap_or(usize::MAX); + Some((start, start.saturating_add(len).min(units), type_style(cx, r.get("attributes")?))) + }) + .collect(); + let base = styles.first().map(|s| s.2.clone()).or_else(|| fallback.map(|f| type_style(cx, f))).unwrap_or_else(|| type_style(cx, &json!({}))); + let mut style = base.clone(); + let mut fills = None; + if let Some(m) = style.as_object_mut() { + fills = m.remove("fills"); + // Paragraph settings are the first run's. + let paragraph = runs.first().and_then(|r| r.get("attributes")).or(fallback).and_then(|a| a.get("paragraphStyle")); + let align = match paragraph.and_then(|p| p.get("alignment")).and_then(Value::as_i64) { + Some(1) => "RIGHT", + Some(2) => "CENTER", + Some(3) => "JUSTIFIED", + _ => "LEFT", + }; + m.insert("textAlignHorizontal".into(), json!(align)); + if let Some(sp) = paragraph.and_then(|p| p.get("paragraphSpacing")).and_then(Value::as_f64).filter(|v| v.is_finite() && *v > 0.0) { + m.insert("paragraphSpacing".into(), json!(sp.min(1e4))); + } + let vertical = l.get("style").and_then(|s| s.get("textStyle")).and_then(|t| t.get("verticalAlignment")).and_then(Value::as_i64); + m.insert( + "textAlignVertical".into(), + json!(match vertical { + Some(1) => "CENTER", + Some(2) => "BOTTOM", + _ => "TOP", + }), + ); + m.insert( + "textAutoResize".into(), + json!(match l.get("textBehaviour").and_then(Value::as_i64) { + Some(1) => "HEIGHT", + Some(2) => "NONE", + _ => "WIDTH_AND_HEIGHT", + }), + ); + } + node.insert("characters".into(), json!(string)); + node.insert("style".into(), style); + if let Some(f) = fills { + node.insert("fills".into(), f); + } + // Runs that differ from the first: a style id per UTF-16 unit. + let mut ids = vec![0u64; units]; + let mut table = JsonMap::new(); + for (start, end, s) in &styles { + if *s == base { + continue; + } + let id = table.len() as u64 + 1; + table.insert(id.to_string(), s.clone()); + for slot in ids.get_mut(*start..*end).into_iter().flatten() { + *slot = id; + } + } + if !table.is_empty() { + node.insert("characterStyleOverrides".into(), json!(ids)); + node.insert("styleOverrideTable".into(), Value::Object(table)); + } +} + +/// A run's attributes as a REST type style (with its colour as `fills`). +fn type_style(cx: &mut Cx, a: &Value) -> Value { + let font = a.get("MSAttributedStringFontAttribute").and_then(|f| f.get("attributes")); + let ps = font.and_then(|f| f.get("name")).and_then(Value::as_str).unwrap_or(""); + let size = font.and_then(|f| f.get("size")).and_then(Value::as_f64).filter(|s| s.is_finite() && *s > 0.0).unwrap_or(12.0); + let (family, style) = font_name(ps); + if ps.is_empty() { + cx.warn("text without a font uses Helvetica"); + } + let mut s = json!({"fontFamily": family, "fontStyle": style, "fontSize": size.min(10_000.0)}); + let p = a.get("paragraphStyle"); + let line = |k: &str| p.and_then(|p| p.get(k)).and_then(Value::as_f64).filter(|v| v.is_finite() && *v > 0.0); + if let Some(lh) = line("maximumLineHeight").or_else(|| line("minimumLineHeight")) { + s["lineHeightPx"] = json!(lh.min(1e4)); + s["lineHeightUnit"] = json!("PIXELS"); + } + if let Some(k) = a.get("kerning").and_then(Value::as_f64).filter(|k| k.is_finite()) { + s["letterSpacing"] = json!(k); + } + let set = |k: &str| a.get(k).and_then(Value::as_i64).is_some_and(|v| v != 0); + s["textDecoration"] = json!(if set("underlineStyle") { + "UNDERLINE" + } else if set("strikethroughStyle") { + "STRIKETHROUGH" + } else { + "NONE" + }); + s["textCase"] = json!(match a.get("MSAttributedStringTextTransformAttribute").and_then(Value::as_i64) { + Some(1) => "UPPER", + Some(2) => "LOWER", + _ => "ORIGINAL", + }); + let c = a.get("MSAttributedStringColorAttribute").and_then(color).unwrap_or_else(|| json!({"r": 0.0, "g": 0.0, "b": 0.0, "a": 1.0})); + s["fills"] = json!([{"type": "SOLID", "color": c}]); + s +} + +/// Family and style of a font from its PostScript name: "HelveticaNeue-Bold" → ("Helvetica Neue", +/// "Bold"). Words of the family are split at case changes, which can't always match the real name +/// ("PingFangSC" → "Ping Fang SC"); the engine matches families against the installed fonts ignoring +/// spaces. Apple's system fonts take the SF Pro names. +pub(crate) fn font_name(ps: &str) -> (String, String) { + let (family, style) = ps.split_once('-').unwrap_or((ps, "")); + let style = if style.is_empty() { "Regular".to_string() } else { crate::fig::style_name(style) }; + let family = match family { + "" => "Helvetica".to_string(), + ".SFNSText" | ".SFUIText" | "SanFranciscoText" | ".SFProText" => "SF Pro Text".into(), + ".SFNSDisplay" | ".SFUIDisplay" | "SanFranciscoDisplay" | ".SFProDisplay" => "SF Pro Display".into(), + f => words(f.trim_start_matches('.')), + }; + (family, style) +} + +/// "IBMPlexSans" → "IBM Plex Sans": a space before a capital that follows a small letter, and +/// before the last capital of a run of capitals followed by a small letter. +fn words(s: &str) -> String { + let chars: Vec = s.chars().collect(); + let mut out = String::with_capacity(s.len() + 4); + for (i, c) in chars.iter().enumerate() { + let prev = i.checked_sub(1).and_then(|p| chars.get(p)); + let next = chars.get(i + 1); + let split = c.is_uppercase() + && (prev.is_some_and(|p| p.is_lowercase()) || (prev.is_some_and(|p| p.is_uppercase()) && next.is_some_and(|n| n.is_lowercase()))); + if split { + out.push(' '); + } + out.push(*c); + } + out +} diff --git a/crates/format/src/sketch/text_tests.rs b/crates/format/src/sketch/text_tests.rs new file mode 100644 index 000000000..bde9dcefc --- /dev/null +++ b/crates/format/src/sketch/text_tests.rs @@ -0,0 +1,188 @@ +//! Sketch text layers → text with styled runs; font PostScript names → family and style. + +use figcraft_doc::color::PaintKind; +use figcraft_doc::{Document, LetterSpacing, LineHeight, NodeKind, TextAlignH, TextAlignV, TextAutoResize, TextCase, TextData, TextDecoration}; +use serde_json::{Value, json}; + +use super::fixture::*; +use super::import; +use super::text::font_name; + +const BLACK: [f64; 4] = [0.0, 0.0, 0.0, 1.0]; +const RED: [f64; 4] = [1.0, 0.0, 0.0, 1.0]; + +fn open(layers: Vec) -> (Document, Vec) { + let z = sketch_zip("50.2", 103, document(&["P"]), &[page("P", "Page", vec![artboard("A", "Board", 0.0, 0.0, 400.0, 400.0, layers)])], &[]); + import(&z, "f").unwrap() +} + +fn data<'d>(doc: &'d Document, name: &str) -> &'d TextData { + match &doc.nodes().find(|n| n.name == name).unwrap().kind { + NodeKind::Text(td) => td, + other => panic!("{name}: {other:?}"), + } +} + +fn red(fills: &Option>) -> bool { + fills.as_ref().is_some_and(|f| f.iter().any(|p| matches!(p.kind, PaintKind::Solid { color } if color.r == 1.0 && color.g == 0.0))) +} + +#[test] +fn two_runs() { + let t = text("Hi", 0.0, 0.0, 200.0, 20.0, "Hello world", &[(0, 5, "HelveticaNeue-Bold", 16.0, RED), (5, 6, "HelveticaNeue", 12.0, BLACK)]); + let (doc, _) = open(vec![t]); + let td = data(&doc, "Hi"); + assert_eq!(td.characters, "Hello world"); + let style_at = |i: usize| td.runs.iter().find(|r| r.start <= i && i < r.end).map_or(&td.style, |r| &r.style); + let (a, b) = (style_at(0), style_at(7)); + assert_eq!((a.font_family.as_str(), a.font_style.as_str(), a.font_size), ("Helvetica Neue", "Bold", 16.0)); + assert_eq!((b.font_family.as_str(), b.font_style.as_str(), b.font_size), ("Helvetica Neue", "Regular", 12.0)); + let node = doc.nodes().find(|n| n.name == "Hi").unwrap(); + assert!(red(&a.fills) || (red(&Some(node.fills.clone())) && !red(&b.fills))); +} + +#[test] +fn utf16_ranges() { + // "a😀b": the emoji takes two UTF-16 units. + let t = text( + "Emoji", + 0.0, + 0.0, + 200.0, + 20.0, + "a😀b", + &[(0, 1, "Helvetica", 10.0, BLACK), (1, 2, "Helvetica", 20.0, BLACK), (3, 1, "Helvetica", 30.0, BLACK)], + ); + let (doc, _) = open(vec![t]); + let td = data(&doc, "Emoji"); + let size_at = |i: usize| td.runs.iter().find(|r| r.start <= i && i < r.end).map_or(td.style.font_size, |r| r.style.font_size); + assert_eq!((size_at(0), size_at(1), size_at(2)), (10.0, 20.0, 30.0)); + // A range splitting the emoji and one past the end: no panic, the text stays whole. + let t = text( + "Split", + 0.0, + 50.0, + 200.0, + 20.0, + "a😀b", + &[(0, 2, "Helvetica", 10.0, BLACK), (2, 99, "Helvetica", 20.0, BLACK), (500, 3, "Helvetica", 5.0, BLACK)], + ); + let (doc, _) = open(vec![t]); + assert_eq!(data(&doc, "Split").characters, "a😀b"); +} + +#[test] +fn paragraph_and_spacing() { + let mut t = text("Para", 0.0, 0.0, 200.0, 40.0, "Centered", &[(0, 8, "Helvetica", 14.0, BLACK)]); + let a = &mut t["attributedString"]["attributes"][0]["attributes"]; + a["paragraphStyle"] = + json!({"_class": "paragraphStyle", "alignment": 2, "maximumLineHeight": 24, "minimumLineHeight": 24, "paragraphSpacing": 8}); + a["kerning"] = json!(0.5); + let (doc, _) = open(vec![t]); + let td = data(&doc, "Para"); + assert_eq!(td.align_h, TextAlignH::Center); + assert_eq!(td.style.line_height, LineHeight::Pixels(24.0)); + assert_eq!(td.paragraph_spacing, 8.0); + assert_eq!(td.style.letter_spacing, LetterSpacing::Pixels(0.5)); + for (code, want) in [(0, TextAlignH::Left), (1, TextAlignH::Right), (3, TextAlignH::Justified), (4, TextAlignH::Left)] { + let mut t = text("A", 0.0, 0.0, 100.0, 20.0, "x", &[(0, 1, "Helvetica", 14.0, BLACK)]); + t["attributedString"]["attributes"][0]["attributes"]["paragraphStyle"]["alignment"] = json!(code); + let (doc, _) = open(vec![t]); + assert_eq!(data(&doc, "A").align_h, want, "alignment {code}"); + } +} + +#[test] +fn behaviour_and_vertical_alignment() { + let cases = [(0, TextAutoResize::WidthAndHeight), (1, TextAutoResize::Height), (2, TextAutoResize::None)]; + for (b, want) in cases { + let mut t = text("T", 0.0, 0.0, 100.0, 20.0, "x", &[(0, 1, "Helvetica", 14.0, BLACK)]); + t["textBehaviour"] = json!(b); + let (doc, _) = open(vec![t]); + assert_eq!(data(&doc, "T").auto_resize, want, "behaviour {b}"); + } + for (v, want) in [(0, TextAlignV::Top), (1, TextAlignV::Middle), (2, TextAlignV::Bottom)] { + let mut t = text("V", 0.0, 0.0, 100.0, 60.0, "x", &[(0, 1, "Helvetica", 14.0, BLACK)]); + t["textBehaviour"] = json!(2); + t["style"]["textStyle"] = json!({"_class": "textStyle", "verticalAlignment": v, "encodedAttributes": {}}); + let (doc, _) = open(vec![t]); + assert_eq!(data(&doc, "V").align_v, want, "vertical {v}"); + } +} + +#[test] +fn decorations_and_case() { + let mut t = text( + "Deco", + 0.0, + 0.0, + 200.0, + 20.0, + "abcdef", + &[(0, 2, "Helvetica", 14.0, BLACK), (2, 2, "Helvetica", 14.0, BLACK), (4, 2, "Helvetica", 14.0, BLACK)], + ); + t["attributedString"]["attributes"][0]["attributes"]["underlineStyle"] = json!(1); + t["attributedString"]["attributes"][1]["attributes"]["strikethroughStyle"] = json!(1); + t["attributedString"]["attributes"][2]["attributes"]["MSAttributedStringTextTransformAttribute"] = json!(1); + let (doc, _) = open(vec![t]); + let td = data(&doc, "Deco"); + let at = |i: usize| td.runs.iter().find(|r| r.start <= i && i < r.end).map_or(&td.style, |r| &r.style); + assert_eq!(at(0).decoration, TextDecoration::Underline); + assert_eq!(at(2).decoration, TextDecoration::Strikethrough); + assert_eq!(at(4).case, TextCase::Upper); +} + +#[test] +fn text_layer_fill_wins_over_run_colour() { + let t = styled(text("Filled", 0.0, 0.0, 100.0, 20.0, "x", &[(0, 1, "Helvetica", 14.0, BLACK)]), "fills", json!([solid_fill(1.0, 0.0, 0.0, 1.0)])); + let (doc, _) = open(vec![t]); + let n = doc.nodes().find(|n| n.name == "Filled").unwrap(); + assert!(red(&Some(n.fills.clone()))); +} + +#[test] +fn font_names() { + let cases = [ + ("HelveticaNeue-Bold", "Helvetica Neue", "Bold"), + ("HelveticaNeue", "Helvetica Neue", "Regular"), + ("HelveticaNeue-Medium", "Helvetica Neue", "Medium"), + ("PingFangSC-Semibold", "Ping Fang SC", "Semi Bold"), + (".SFNSText", "SF Pro Text", "Regular"), + (".SFNSDisplay-Bold", "SF Pro Display", "Bold"), + ("SanFranciscoText-Semibold", "SF Pro Text", "Semi Bold"), + ("Impact", "Impact", "Regular"), + ("IBMPlexSans-MediumItalic", "IBM Plex Sans", "Medium Italic"), + ("Roboto-Italic", "Roboto", "Italic"), + ("", "Helvetica", "Regular"), + ]; + for (ps, family, style) in cases { + assert_eq!(font_name(ps), (family.to_string(), style.to_string()), "{ps}"); + } +} + +#[test] +fn long_and_odd_text_is_safe() { + let long = "x".repeat(10_000); + let t = text("Long", 0.0, 0.0, 100.0, 20.0, &long, &[(0, usize::MAX >> 1, "Helvetica", 14.0, BLACK)]); + let mut odd = text("Odd", 0.0, 0.0, 100.0, 20.0, "abc", &[(0, 3, "Helvetica", -5.0, BLACK)]); + odd["attributedString"]["attributes"][0]["attributes"]["MSAttributedStringFontAttribute"] = json!("junk"); + let mut empty = text("Empty", 0.0, 0.0, 100.0, 20.0, "", &[]); + empty["attributedString"]["string"] = json!(5); + let (doc, _) = open(vec![t, odd, empty]); + assert_eq!(data(&doc, "Long").characters.len(), 10_000); + assert!(data(&doc, "Odd").style.font_size > 0.0); +} + +#[test] +fn embedded_fonts_are_reported() { + let mut d = document(&["P"]); + d["fontReferences"] = json!([ + {"_class": "fontReference", "fontFamilyName": "IBM Plex Sans", "fontFileName": "IBMPlexSans-Regular.otf", "fontData": {"_ref": "fonts/abc"}}, + {"_class": "fontReference", "fontFamilyName": "IBM Plex Sans", "fontFileName": "IBMPlexSans-Bold.otf", "fontData": {"_ref": "fonts/def"}}, + {"_class": "fontReference", "fontFamilyName": "IBM Plex Mono", "fontData": {"_ref": "fonts/ghi"}}, + ]); + let z = sketch_zip("83.2", 139, d, &[page("P", "Page", vec![])], &[("fonts/abc", b"x")]); + let (_, warnings) = import(&z, "f").unwrap(); + let w = warnings.iter().find(|w| w.contains("embedded")).expect("a note about embedded fonts"); + assert!(w.contains("IBM Plex Mono") && w.contains("IBM Plex Sans"), "{w}"); +} diff --git a/crates/format/src/sketch/tree.rs b/crates/format/src/sketch/tree.rs index c59b8c90d..16382dbe0 100644 --- a/crates/format/src/sketch/tree.rs +++ b/crates/format/src/sketch/tree.rs @@ -80,6 +80,7 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: "oval" => "ELLIPSE", "slice" => "SLICE", "shapePath" | "star" | "polygon" | "triangle" => "VECTOR", + "text" => "TEXT", other => { cx.warn(format!("Sketch {} layers are not supported yet and were skipped", clip(other))); return None; @@ -91,6 +92,9 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: let (w, h) = size(l); let world = parent * local(l, w, h); let mut node = base(l, ty, parent, world, w, h, root); + if ty == "TEXT" { + super::text::node(cx, l, &mut node); + } if ty == "VECTOR" { let shape = super::path::shape(cx, l, w, h)?; super::path::put_shape(cx, shape, &mut node); From 60cc184ab7ebb3b0a23e83c3ea6f2b0d816cddf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 16:28:16 +0200 Subject: [PATCH 480/817] M6: Sketch import: PingFang families keep their own names Co-Authored-By: Claude Opus 5.5 --- crates/format/src/sketch/text.rs | 6 ++++-- crates/format/src/sketch/text_tests.rs | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/format/src/sketch/text.rs b/crates/format/src/sketch/text.rs index edafe30ea..74e7a7318 100644 --- a/crates/format/src/sketch/text.rs +++ b/crates/format/src/sketch/text.rs @@ -132,8 +132,8 @@ fn type_style(cx: &mut Cx, a: &Value) -> Value { /// Family and style of a font from its PostScript name: "HelveticaNeue-Bold" → ("Helvetica Neue", /// "Bold"). Words of the family are split at case changes, which can't always match the real name -/// ("PingFangSC" → "Ping Fang SC"); the engine matches families against the installed fonts ignoring -/// spaces. Apple's system fonts take the SF Pro names. +/// (a CJK family would split as "Ping Fang SC"); the engine matches families against the installed +/// fonts ignoring spaces. Apple's system fonts take the SF Pro names, PingFang its own. pub(crate) fn font_name(ps: &str) -> (String, String) { let (family, style) = ps.split_once('-').unwrap_or((ps, "")); let style = if style.is_empty() { "Regular".to_string() } else { crate::fig::style_name(style) }; @@ -141,6 +141,8 @@ pub(crate) fn font_name(ps: &str) -> (String, String) { "" => "Helvetica".to_string(), ".SFNSText" | ".SFUIText" | "SanFranciscoText" | ".SFProText" => "SF Pro Text".into(), ".SFNSDisplay" | ".SFUIDisplay" | "SanFranciscoDisplay" | ".SFProDisplay" => "SF Pro Display".into(), + // Apple's CJK families whose names don't split at case changes. + "PingFangSC" | "PingFangTC" | "PingFangHK" => format!("PingFang {}", family.get(8..).unwrap_or("")), f => words(f.trim_start_matches('.')), }; (family, style) diff --git a/crates/format/src/sketch/text_tests.rs b/crates/format/src/sketch/text_tests.rs index bde9dcefc..a7ee96b06 100644 --- a/crates/format/src/sketch/text_tests.rs +++ b/crates/format/src/sketch/text_tests.rs @@ -146,7 +146,8 @@ fn font_names() { ("HelveticaNeue-Bold", "Helvetica Neue", "Bold"), ("HelveticaNeue", "Helvetica Neue", "Regular"), ("HelveticaNeue-Medium", "Helvetica Neue", "Medium"), - ("PingFangSC-Semibold", "Ping Fang SC", "Semi Bold"), + ("PingFangSC-Semibold", "PingFang SC", "Semi Bold"), + ("PingFangTC-Regular", "PingFang TC", "Regular"), (".SFNSText", "SF Pro Text", "Regular"), (".SFNSDisplay-Bold", "SF Pro Display", "Bold"), ("SanFranciscoText-Semibold", "SF Pro Text", "Semi Bold"), From 4437d49a7250ddbb312adf435084bcc36c9053e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 16:36:10 +0200 Subject: [PATCH 481/817] M6: Sketch import: symbols as components, instances with overrides Symbol masters become components, also those copied from libraries (on a page of their own); instances carry their master's layers with their overrides applied (text, nested symbol swaps and hiding, images, layer and text styles, nested paths) and resize them by their constraints, so editing a master still updates every instance. A symbol inside itself stops with a note; instances of missing symbols are empty frames. Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 2 + crates/engine/src/sketch_import_tests.rs | 30 +++ crates/format/Cargo.toml | 1 + crates/format/src/sketch/fixture.rs | 18 ++ crates/format/src/sketch/mod.rs | 37 ++- crates/format/src/sketch/symbols.rs | 298 ++++++++++++++++++++++ crates/format/src/sketch/symbols_tests.rs | 165 ++++++++++++ crates/format/src/sketch/tree.rs | 33 ++- 8 files changed, 579 insertions(+), 5 deletions(-) create mode 100644 crates/format/src/sketch/symbols.rs create mode 100644 crates/format/src/sketch/symbols_tests.rs diff --git a/Cargo.lock b/Cargo.lock index 459c83200..0d118fda5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1579,6 +1579,7 @@ dependencies = [ "thiserror 2.0.21", "wat", "web-time", + "zip", ] [[package]] @@ -1586,6 +1587,7 @@ name = "figcraft-format" version = "0.9.0" dependencies = [ "figcraft-doc", + "figcraft-layout", "figcraft-pathops", "flate2", "image", diff --git a/crates/engine/src/sketch_import_tests.rs b/crates/engine/src/sketch_import_tests.rs index ac35cb06e..10a7b9ca4 100644 --- a/crates/engine/src/sketch_import_tests.rs +++ b/crates/engine/src/sketch_import_tests.rs @@ -6,6 +6,8 @@ use std::io::Write; use base64::Engine; use serde_json::{Value, json}; +use figcraft_doc::NodeKind; + use crate::Session; /// A minimal `.sketch` zip with one page per `(id, name)`, saved by `app_version`. @@ -145,3 +147,31 @@ fn sketch_font_families_match_installed_ones() { assert_eq!(m("IBMPlex Sans").as_deref(), Some("IBM Plex Sans")); assert_eq!(m("Comic Sans"), None); } + +/// Editing a master changes its instances, and a resized instance's layout isn't an override. +#[test] +fn sketch_instances_stay_live() { + let tag = shape("rectangle", "Tag", [80.0, 0.0, 20.0, 40.0], json!({"resizingConstraint": 60, "points": []})); + let master = shape("symbolMaster", "Bar", [0.0, 0.0, 100.0, 40.0], json!({"symbolID": "S", "layers": [tag]})); + let inst = shape("symbolInstance", "Wide", [0.0, 100.0, 200.0, 40.0], json!({"symbolID": "S", "overrideValues": []})); + let data = base64::engine::general_purpose::STANDARD.encode(sketch_with("50.2", &[("A", "Page")], &[master, inst])); + let mut s = Session::new(); + s.execute("file.open", &json!({"data": data, "name": "x.sketch"})).unwrap(); + let find = |s: &Session, inst: bool| { + let doc = s.doc().unwrap(); + let root = doc + .nodes() + .find(|n| if inst { matches!(n.kind, NodeKind::Instance { .. }) } else { matches!(n.kind, NodeKind::Component { .. }) }) + .unwrap() + .id; + doc.subtree(root).into_iter().find(|id| doc.node(*id).is_some_and(|n| n.name == "Tag")).unwrap() + }; + let (main_tag, inst_tag) = (find(&s, false), find(&s, true)); + assert!(s.doc().unwrap().node(inst_tag).unwrap().overrides.is_empty(), "{:?}", s.doc().unwrap().node(inst_tag).unwrap().overrides); + s.execute("node.set", &json!({"id": main_tag, "props": {"fill": "#ff0000"}})).unwrap(); + let doc = s.doc().unwrap(); + let fill = &doc.node(inst_tag).unwrap().fills; + assert!(fill.iter().any(|p| matches!(p.kind, figcraft_doc::color::PaintKind::Solid { color } if color.r > 0.99 && color.g < 0.01)), "{fill:?}"); + let b = doc.world_bounds(inst_tag).unwrap(); + assert!((b.x0 - 180.0).abs() < 1e-6, "{b:?}"); +} diff --git a/crates/format/Cargo.toml b/crates/format/Cargo.toml index 3dca39126..80a943e2e 100644 --- a/crates/format/Cargo.toml +++ b/crates/format/Cargo.toml @@ -11,6 +11,7 @@ workspace = true [dependencies] figcraft-doc = { workspace = true } figcraft-pathops = { workspace = true } +figcraft-layout = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } zip = { workspace = true } diff --git a/crates/format/src/sketch/fixture.rs b/crates/format/src/sketch/fixture.rs index a7c5ea73a..ac426f0e4 100644 --- a/crates/format/src/sketch/fixture.rs +++ b/crates/format/src/sketch/fixture.rs @@ -168,3 +168,21 @@ pub(crate) fn text(id: &str, x: f64, y: f64, w: f64, h: f64, string: &str, runs: l["textBehaviour"] = json!(1); l } + +/// A symbol master `symbol_id` holding `layers`. +pub(crate) fn master(id: &str, symbol_id: &str, name: &str, w: f64, h: f64, layers: Vec) -> Value { + let mut l = artboard(id, name, 0.0, 0.0, w, h, layers); + l["_class"] = json!("symbolMaster"); + l["symbolID"] = json!(symbol_id); + l +} + +/// An instance of symbol `symbol_id` with `overrides` (`overrideName`, value). +pub(crate) fn instance(id: &str, symbol_id: &str, x: f64, y: f64, w: f64, h: f64, overrides: &[(&str, Value)]) -> Value { + let mut l = layer("symbolInstance", id, id, x, y, w, h); + l["symbolID"] = json!(symbol_id); + l["scale"] = json!(1); + l["overrideValues"] = + Value::Array(overrides.iter().map(|(name, value)| json!({"_class": "overrideValue", "overrideName": name, "value": value})).collect()); + l +} diff --git a/crates/format/src/sketch/mod.rs b/crates/format/src/sketch/mod.rs index 8859c4a91..b9063a70e 100644 --- a/crates/format/src/sketch/mod.rs +++ b/crates/format/src/sketch/mod.rs @@ -19,6 +19,9 @@ mod path_tests; mod style; #[cfg(test)] mod style_tests; +mod symbols; +#[cfg(test)] +mod symbols_tests; #[cfg(test)] mod tests; mod text; @@ -68,16 +71,26 @@ pub fn try_import(bytes: &[u8], name: &str) -> Option Result<(Document, Vec), FormatError> { - import_within(bytes, name, MAX_JSON_MEMBER) + import_parts(bytes, name, MAX_JSON_MEMBER, crate::fig::layer_budget(bytes.len())) } /// [`import`] reading pages of at most `max_member` bytes of JSON each. +#[cfg(test)] pub(crate) fn import_within(bytes: &[u8], name: &str, max_member: u64) -> Result<(Document, Vec), FormatError> { + import_parts(bytes, name, max_member, crate::fig::layer_budget(bytes.len())) +} + +/// [`import`] with at most `max_nodes` layers. +#[cfg(test)] +pub(crate) fn import_within_nodes(bytes: &[u8], name: &str, max_nodes: usize) -> Result<(Document, Vec), FormatError> { + import_parts(bytes, name, MAX_JSON_MEMBER, max_nodes) +} + +fn import_parts(bytes: &[u8], name: &str, max_member: u64, max_nodes: usize) -> Result<(Document, Vec), FormatError> { if bytes.starts_with(b"SQLite format 3\0") { return Err(FormatError::Io(TOO_OLD.into())); } let archive = Archive::open(bytes, max_member)?; - let max_nodes = crate::fig::layer_budget(bytes.len()); let map = tree::to_rest(&archive, name, max_nodes); if map.too_old { return Err(FormatError::Io(TOO_OLD.into())); @@ -92,6 +105,7 @@ pub(crate) fn import_within(bytes: &[u8], name: &str, max_member: u64) -> Result if archive.document.get("colorSpace").and_then(Value::as_i64) == Some(2) { doc.color_profile = figcraft_doc::color::ColorProfile::DisplayP3; } + fit_instances(&mut doc); warnings.extend(more); Ok((doc, warnings)) } @@ -109,6 +123,25 @@ fn embedded_fonts(document: &Value) -> Option { Some(format!("the file has embedded fonts FigCraft doesn't use ({}); install them to see the text as designed", list.join(", "))) } +/// Instances come in with their master's layers laid out at the master's size; resized ones lay +/// them out for their own size by their constraints, innermost first. +fn fit_instances(doc: &mut Document) { + let mut insts: Vec<(usize, figcraft_doc::NodeId, f64, f64)> = doc + .nodes() + .filter_map(|n| match n.kind { + figcraft_doc::NodeKind::Instance { component, .. } => { + let c = doc.node(component)?; + Some((doc.ancestors(n.id).len(), n.id, c.width, c.height)) + } + _ => None, + }) + .collect(); + insts.sort_by_key(|i| std::cmp::Reverse(i.0)); + for (_, id, w, h) in insts { + figcraft_layout::apply_constraints(doc, id, w, h); + } +} + fn corrupt(msg: impl Into) -> FormatError { FormatError::Corrupt(format!("Sketch file: {}", msg.into())) } diff --git a/crates/format/src/sketch/symbols.rs b/crates/format/src/sketch/symbols.rs new file mode 100644 index 000000000..d6e7165cb --- /dev/null +++ b/crates/format/src/sketch/symbols.rs @@ -0,0 +1,298 @@ +//! Sketch symbols → REST components and instances. +//! +//! A `symbolMaster` (on any page, or copied from a library into `document.foreignSymbols`) is a +//! component; a `symbolInstance` names it by `symbolID`. REST instances carry their layers, so an +//! instance is its master's layers with the instance's `overrideValues` applied, laid out at the +//! master's size (the import then resizes them to the instance by their constraints). An override +//! is named `_`: `path` is the `do_objectID` of a layer of the master, or of +//! nested instances and then a layer of theirs, joined by `/`; properties: `stringValue` (text), +//! `symbolID` (swap a nested instance; empty hides it), `image`, `layerStyle` and `textStyle` +//! (shared style ids). + +use std::collections::BTreeMap; + +use figcraft_doc::geom::Affine; +use serde_json::{Map as JsonMap, Value, json}; + +use super::tree::{Cx, base, bool_field, children, local, size, str_field}; + +/// Most masters read from one file. +const MAX_MASTERS: usize = 100_000; + +/// Every symbol master of a file by `symbolID`, and the library ones no page holds. +#[derive(Default)] +pub(crate) struct Symbols { + masters: BTreeMap, + /// Masters copied from libraries that no page holds (they get a page of their own), with the + /// libraries' names. + pub foreign: Vec, + pub libraries: Vec, +} + +impl Symbols { + /// The masters of `pages` and of the document's library copies. + pub(crate) fn read(document: &Value, pages: &[(String, Value)]) -> Symbols { + let mut s = Symbols::default(); + let mut found = Vec::new(); + for (_, p) in pages { + masters_in(p, &mut found, 0); + } + for m in found { + s.add(m.clone()); + } + for f in document.get("foreignSymbols").and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default() { + let Some(m) = f.get("symbolMaster") else { continue }; + let Some(id) = str_field(m, "symbolID") else { continue }; + if s.masters.contains_key(id) { + continue; + } + if let Some(lib) = str_field(f, "sourceLibraryName") + && !s.libraries.iter().any(|l| l == lib) + { + s.libraries.push(lib.chars().take(64).collect()); + } + s.add(m.clone()); + s.foreign.push(m.clone()); + } + s + } + + fn add(&mut self, m: Value) { + if self.masters.len() >= MAX_MASTERS { + return; + } + if let Some(id) = str_field(&m, "symbolID") { + self.masters.entry(id.to_string()).or_insert(m); + } + } + + fn master(&self, symbol_id: &str) -> Option<&Value> { + self.masters.get(symbol_id) + } +} + +fn masters_in<'v>(l: &'v Value, out: &mut Vec<&'v Value>, depth: usize) { + if depth > 64 { + return; + } + for c in super::tree::layers(l) { + if str_field(c, "_class") == Some("symbolMaster") { + out.push(c); + } else { + masters_in(c, out, depth + 1); + } + } +} + +/// A master's background as REST fills (masters show one only when they have it on). +pub(crate) fn master_fills(m: &Value) -> Option { + if bool_field(m, "hasBackgroundColor") != Some(true) { + return None; + } + let c = m.get("backgroundColor").and_then(super::tree::color)?; + Some(json!([{"type": "SOLID", "color": c}])) +} + +/// A symbol master as a COMPONENT node. +pub(crate) fn component(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: bool) -> Option { + let (w, h) = size(l); + let world = parent * local(l, w, h); + let mut node = base(l, "COMPONENT", parent, world, w, h, root); + node.insert("clipsContent".into(), json!(true)); + if let Some(f) = master_fills(l) { + node.insert("fills".into(), f); + } + let sid = str_field(l, "symbolID").unwrap_or("").to_string(); + cx.chain.push(sid); + let kids = children(cx, l, world, (w, h), depth, false); + cx.chain.pop(); + node.insert("children".into(), Value::Array(kids)); + Some(Value::Object(node)) +} + +/// A symbol instance as an INSTANCE node holding its master's layers with its overrides, or an +/// empty frame when its master isn't in the file. +pub(crate) fn instance(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: bool) -> Option { + let (w, h) = size(l); + let world = parent * local(l, w, h); + let sid = str_field(l, "symbolID").unwrap_or(""); + let Some(m) = cx.symbols.master(sid).cloned() else { + cx.warn("instances of symbols that aren't in the file were imported as empty frames"); + let mut node = base(l, "FRAME", parent, world, w, h, root); + node.insert("children".into(), json!([])); + return Some(Value::Object(node)); + }; + if cx.chain.iter().any(|c| c == sid) { + let name: String = str_field(&m, "name").unwrap_or("").chars().take(64).collect(); + cx.warn(format!("symbol {name} contains itself; the inner copy was left out")); + return None; + } + if l.get("scale").and_then(Value::as_f64).is_some_and(|s| s.is_finite() && (s - 1.0).abs() > 1e-9) { + cx.warn("scaled symbol instances were imported at their size, unscaled"); + } + let mut node = base(l, "INSTANCE", parent, world, w, h, root); + node.insert("componentId".into(), json!(str_field(&m, "do_objectID").unwrap_or(sid))); + node.insert("clipsContent".into(), json!(true)); + if let Some(f) = master_fills(&m) { + node.insert("fills".into(), f); + } + if let Some(st) = l.get("style") { + super::style::apply(cx, st, w, h, &mut node); + } + let overrides = overrides(l); + let mut copy = m; + if let Some(layers) = copy.get_mut("layers").and_then(Value::as_array_mut) { + apply(layers, &overrides, cx.document, 0); + } + let (mw, mh) = size(©); + cx.chain.push(sid.to_string()); + let mut kids = children(cx, ©, world, (mw, mh), depth, false); + cx.chain.pop(); + let prefix = str_field(l, "do_objectID").unwrap_or("I").to_string(); + for k in &mut kids { + prefix_ids(k, &prefix, 0); + } + node.insert("children".into(), Value::Array(kids)); + Some(Value::Object(node)) +} + +/// An instance's overrides by name (`_` → value). +fn overrides(l: &Value) -> BTreeMap { + l.get("overrideValues") + .and_then(Value::as_array) + .map(Vec::as_slice) + .unwrap_or_default() + .iter() + .take(100_000) + .filter_map(|o| Some((str_field(o, "overrideName")?.to_string(), o.get("value")?.clone()))) + .collect() +} + +/// Apply `ov` to the layers of a master's copy: to the layers it names, and passed on to nested +/// instances for the layers inside them (an outer override wins over the nested instance's own). +fn apply(layers: &mut [Value], ov: &BTreeMap, document: &Value, depth: usize) { + if depth > 64 || ov.is_empty() { + return; + } + for l in layers { + let Some(id) = str_field(l, "do_objectID").map(str::to_string) else { continue }; + let get = |prop: &str| ov.get(&format!("{id}_{prop}")); + match str_field(l, "_class") { + Some("symbolInstance") => { + match get("symbolID").map(|v| v.as_str().unwrap_or("")) { + Some("") => l["isVisible"] = json!(false), + Some(other) => l["symbolID"] = json!(other), + None => {} + } + let prefix = format!("{id}/"); + let inner: Vec = ov + .iter() + .filter_map(|(k, v)| k.strip_prefix(&prefix).map(|rest| json!({"_class": "overrideValue", "overrideName": rest, "value": v}))) + .collect(); + if !inner.is_empty() { + let mut own = l.get("overrideValues").and_then(Value::as_array).cloned().unwrap_or_default(); + own.extend(inner); + l["overrideValues"] = Value::Array(own); + } + continue; + } + Some("text") => { + if let Some(s) = get("stringValue").and_then(Value::as_str) { + set_string(l, s); + } + } + Some("bitmap") => { + if let Some(img) = get("image").filter(|v| v.get("_ref").is_some()) { + l["image"] = img.clone(); + } + } + _ => {} + } + for (prop, list) in [("layerStyle", "layerStyles"), ("textStyle", "layerTextStyles")] { + if let Some(style) = get(prop).and_then(Value::as_str).and_then(|sid| shared_style(document, list, sid)) { + l["style"] = style.clone(); + if prop == "textStyle" + && let Some(enc) = style.get("textStyle").and_then(|t| t.get("encodedAttributes")) + && let Some(runs) = l.get_mut("attributedString").and_then(|a| a.get_mut("attributes")).and_then(Value::as_array_mut) + { + for r in runs { + r["attributes"] = enc.clone(); + } + } + } + } + if let Some(kids) = l.get_mut("layers").and_then(Value::as_array_mut) { + apply(kids, ov, document, depth + 1); + } + } +} + +/// A text layer's string replaced, in the style of its first run. +fn set_string(l: &mut Value, s: &str) { + let units = s.encode_utf16().count(); + let first = l.get("attributedString").and_then(|a| a.get("attributes")).and_then(Value::as_array).and_then(|a| a.first()).cloned(); + let Some(a) = l.get_mut("attributedString").and_then(Value::as_object_mut) else { return }; + a.insert("string".into(), json!(s)); + let runs = match first { + Some(mut r) => { + r["location"] = json!(0); + r["length"] = json!(units); + vec![r] + } + None => Vec::new(), + }; + a.insert("attributes".into(), Value::Array(runs)); +} + +/// The style of shared style `id` from the document's `list` (local) or its library copies. +pub(crate) fn shared_style<'v>(document: &'v Value, list: &str, id: &str) -> Option<&'v Value> { + let local = document.get(list).and_then(|c| c.get("objects")).and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default(); + let foreign_key = if list == "layerStyles" { "foreignLayerStyles" } else { "foreignTextStyles" }; + let foreign = document.get(foreign_key).and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default(); + local + .iter() + .find(|s| str_field(s, "do_objectID") == Some(id)) + .or_else(|| foreign.iter().filter_map(|f| f.get("localSharedStyle")).find(|s| str_field(s, "do_objectID") == Some(id))) + .and_then(|s| s.get("value")) +} + +/// Make the ids of an instance's layers its own (`;`): the master's layers keep +/// theirs. +fn prefix_ids(v: &mut Value, prefix: &str, depth: usize) { + if depth > 256 { + return; + } + let Some(m) = v.as_object_mut() else { return }; + if let Some(id) = m.get("id").and_then(Value::as_str).map(str::to_string) { + m.insert("id".into(), json!(format!("{prefix};{id}"))); + } + if let Some(kids) = m.get_mut("children").and_then(Value::as_array_mut) { + for k in kids { + prefix_ids(k, prefix, depth + 1); + } + } +} + +/// Library masters no page holds: a page of their own, side by side. +pub(crate) fn library_page(cx: &mut Cx, masters: &[Value]) -> Value { + let mut x = 0.0; + let mut kids = Vec::new(); + for m in masters { + let mut placed = m.clone(); + let (w, _) = size(m); + if let Some(f) = placed.get_mut("frame").and_then(Value::as_object_mut) { + f.insert("x".into(), json!(x)); + f.insert("y".into(), json!(0.0)); + } + x += w + 100.0; + if let Some(node) = component(cx, &placed, Affine::IDENTITY, 0, true) { + kids.push(node); + } + } + let mut page = JsonMap::new(); + page.insert("type".into(), json!("CANVAS")); + page.insert("id".into(), json!("library-symbols")); + page.insert("name".into(), json!("Library symbols")); + page.insert("children".into(), Value::Array(kids)); + Value::Object(page) +} diff --git a/crates/format/src/sketch/symbols_tests.rs b/crates/format/src/sketch/symbols_tests.rs new file mode 100644 index 000000000..e22043994 --- /dev/null +++ b/crates/format/src/sketch/symbols_tests.rs @@ -0,0 +1,165 @@ +//! Sketch symbols → components and instances with overrides. + +use figcraft_doc::{Document, Node, NodeKind}; +use serde_json::{Value, json}; + +use super::fixture::*; +use super::{import, import_within_nodes}; + +const BLACK: [f64; 4] = [0.0, 0.0, 0.0, 1.0]; + +/// One page with `layers`, one "Symbols" page with `masters`, and `document` changes. +fn open_doc(doc_json: Value, layers: Vec, masters: Vec) -> (Document, Vec) { + let z = sketch_zip("50.2", 103, doc_json, &[page("P", "Page", layers), page("S", "Symbols", masters)], &[]); + import(&z, "f").unwrap() +} + +fn open(layers: Vec, masters: Vec) -> (Document, Vec) { + let mut d = document(&["P", "S"]); + d["do_objectID"] = json!("DOC"); + open_doc(d, layers, masters) +} + +fn named<'d>(doc: &'d Document, name: &str) -> Vec<&'d Node> { + doc.nodes().filter(|n| n.name == name).collect() +} + +fn inside<'d>(doc: &'d Document, root: &Node, name: &str) -> &'d Node { + doc.subtree(root.id).into_iter().filter_map(|id| doc.node(id)).find(|n| n.name == name).unwrap_or_else(|| panic!("no {name}")) +} + +fn chars(n: &Node) -> &str { + match &n.kind { + NodeKind::Text(td) => &td.characters, + other => panic!("{other:?}"), + } +} + +fn instance_of<'d>(doc: &'d Document, name: &str) -> (&'d Node, &'d Node) { + let inst = named(doc, name).into_iter().find(|n| matches!(n.kind, NodeKind::Instance { .. })).unwrap_or_else(|| panic!("no instance {name}")); + let NodeKind::Instance { component, .. } = inst.kind else { panic!("not an instance") }; + (inst, doc.node(component).unwrap()) +} + +fn button() -> Value { + master("M1", "S1", "Button", 100.0, 40.0, vec![text("Label", 10.0, 10.0, 80.0, 20.0, "Go", &[(0, 2, "Helvetica", 14.0, BLACK)])]) +} + +#[test] +fn master_is_component_instance_links() { + let (doc, _) = open(vec![instance("I1", "S1", 0.0, 0.0, 100.0, 40.0, &[])], vec![button()]); + let (inst, main) = instance_of(&doc, "I1"); + assert!(matches!(main.kind, NodeKind::Component { .. })); + assert_eq!(main.name, "Button"); + assert_eq!(chars(inside(&doc, inst, "Label")), "Go"); +} + +#[test] +fn string_override() { + let (doc, _) = open(vec![instance("I1", "S1", 0.0, 0.0, 100.0, 40.0, &[("Label_stringValue", json!("OK"))])], vec![button()]); + let (inst, main) = instance_of(&doc, "I1"); + assert_eq!(chars(inside(&doc, inst, "Label")), "OK"); + assert_eq!(chars(inside(&doc, main, "Label")), "Go"); +} + +#[test] +fn nested_symbol_swap_and_hide() { + let icon_a = master("MA", "SA", "Icon A", 20.0, 20.0, vec![rect("Dot A", 0.0, 0.0, 20.0, 20.0)]); + let icon_b = master("MB", "SB", "Icon B", 20.0, 20.0, vec![rect("Dot B", 0.0, 0.0, 20.0, 20.0)]); + let card = master("MC", "SC", "Card", 100.0, 40.0, vec![instance("N", "SA", 0.0, 0.0, 20.0, 20.0, &[])]); + let swapped = instance("Swapped", "SC", 0.0, 0.0, 100.0, 40.0, &[("N_symbolID", json!("SB"))]); + let hidden = instance("Hidden", "SC", 0.0, 100.0, 100.0, 40.0, &[("N_symbolID", json!(""))]); + let (doc, _) = open(vec![swapped, hidden], vec![icon_a, icon_b, card]); + let (sw, _) = instance_of(&doc, "Swapped"); + assert!(doc.subtree(sw.id).into_iter().filter_map(|i| doc.node(i)).any(|n| n.name == "Dot B")); + assert!(!doc.subtree(sw.id).into_iter().filter_map(|i| doc.node(i)).any(|n| n.name == "Dot A")); + let (hd, _) = instance_of(&doc, "Hidden"); + let nested = doc.node(hd.children[0]).unwrap(); + assert!(!nested.visible); +} + +#[test] +fn nested_path_override() { + let inner = master("MB", "SB", "Badge", 50.0, 20.0, vec![text("Count", 0.0, 0.0, 50.0, 20.0, "1", &[(0, 1, "Helvetica", 12.0, BLACK)])]); + let outer = master("MA", "SA", "Row", 100.0, 20.0, vec![instance("N", "SB", 50.0, 0.0, 50.0, 20.0, &[])]); + let (doc, _) = open(vec![instance("I1", "SA", 0.0, 0.0, 100.0, 20.0, &[("N/Count_stringValue", json!("42"))])], vec![inner, outer]); + let (inst, _) = instance_of(&doc, "I1"); + assert_eq!(chars(inside(&doc, inst, "Count")), "42"); +} + +#[test] +fn image_override() { + let mut bitmap = rect("Photo", 0.0, 0.0, 40.0, 40.0); + bitmap["_class"] = json!("bitmap"); + bitmap["image"] = json!({"_class": "MSJSONFileReference", "_ref": "images/a.png"}); + let m = master("M", "S", "Avatar", 40.0, 40.0, vec![bitmap]); + let png = { + let mut out = Vec::new(); + image::RgbaImage::new(1, 1).write_to(&mut std::io::Cursor::new(&mut out), image::ImageFormat::Png).unwrap(); + out + }; + let mut png2 = Vec::new(); + image::RgbaImage::new(2, 1).write_to(&mut std::io::Cursor::new(&mut png2), image::ImageFormat::Png).unwrap(); + let inst = instance("I1", "S", 0.0, 0.0, 40.0, 40.0, &[("Photo_image", json!({"_class": "MSJSONFileReference", "_ref": "images/b.png"}))]); + let z = sketch_zip( + "50.2", + 103, + document(&["P", "S"]), + &[page("P", "Page", vec![inst]), page("S", "Symbols", vec![m])], + &[("images/a.png", &png), ("images/b.png", &png2)], + ); + let (doc, _) = import(&z, "f").unwrap(); + assert_eq!(doc.images.len(), 2); +} + +#[test] +fn foreign_symbols_are_components() { + let mut d = document(&["P", "S"]); + d["foreignSymbols"] = json!([{"_class": "MSImmutableForeignSymbol", "sourceLibraryName": "Kit", "symbolMaster": button()}]); + let (doc, warnings) = open_doc(d, vec![instance("I1", "S1", 0.0, 0.0, 100.0, 40.0, &[])], vec![]); + let (_, main) = instance_of(&doc, "I1"); + assert_eq!(main.name, "Button"); + let page = doc.pages.iter().copied().find(|p| doc.is_ancestor(*p, main.id)).unwrap(); + assert_eq!(doc.node(page).unwrap().name, "Library symbols"); + assert!(warnings.iter().any(|w| w.contains("Kit")), "{warnings:?}"); +} + +#[test] +fn missing_master_warns() { + let (doc, warnings) = open(vec![instance("Lost", "NOPE", 0.0, 0.0, 30.0, 30.0, &[])], vec![]); + let n = named(&doc, "Lost")[0]; + assert!(matches!(n.kind, NodeKind::Frame)); + assert_eq!((n.width, n.height), (30.0, 30.0)); + assert!(warnings.iter().any(|w| w.contains("symbol")), "{warnings:?}"); +} + +#[test] +fn self_containing_master_stops() { + let a = master("MA", "SA", "Loop A", 50.0, 50.0, vec![instance("Self", "SA", 0.0, 0.0, 10.0, 10.0, &[])]); + let b = master("MB", "SB", "Loop B", 50.0, 50.0, vec![instance("ToC", "SC", 0.0, 0.0, 10.0, 10.0, &[])]); + let c = master("MC", "SC", "Loop C", 50.0, 50.0, vec![instance("ToB", "SB", 0.0, 0.0, 10.0, 10.0, &[])]); + let (_, warnings) = open(vec![instance("I1", "SA", 0.0, 0.0, 50.0, 50.0, &[]), instance("I2", "SB", 100.0, 0.0, 50.0, 50.0, &[])], vec![a, b, c]); + assert!(warnings.iter().any(|w| w.contains("contains itself")), "{warnings:?}"); +} + +#[test] +fn instance_explosion_is_bounded() { + let big = master("M", "S", "Big", 100.0, 100.0, (0..1000).map(|i| rect(&format!("R{i}"), 0.0, 0.0, 1.0, 1.0)).collect()); + let many: Vec = (0..1000).map(|i| instance(&format!("I{i}"), "S", 0.0, 0.0, 100.0, 100.0, &[])).collect(); + let z = sketch_zip("50.2", 103, document(&["P", "S"]), &[page("P", "Page", many), page("S", "Symbols", vec![big])], &[]); + let (doc, warnings) = import_within_nodes(&z, "f", 20_000).unwrap(); + assert!(doc.nodes().count() <= 20_100); + assert!(warnings.iter().any(|w| w.contains("more than")), "{warnings:?}"); +} + +#[test] +fn resized_instance_follows_constraints() { + // Pinned right with a fixed width (bits 1 and 2 cleared). + let pinned = with(rect("Tag", 80.0, 0.0, 20.0, 40.0), "resizingConstraint", json!(60)); + let m = master("M", "S", "Bar", 100.0, 40.0, vec![pinned]); + let (doc, _) = open(vec![instance("Wide", "S", 0.0, 0.0, 200.0, 40.0, &[])], vec![m]); + let (inst, _) = instance_of(&doc, "Wide"); + let tag = inside(&doc, inst, "Tag"); + let b = doc.world_bounds(tag.id).unwrap(); + assert!((b.x0 - 180.0).abs() < 1e-6 && (b.width() - 20.0).abs() < 1e-6, "{b:?}"); +} diff --git a/crates/format/src/sketch/tree.rs b/crates/format/src/sketch/tree.rs index 16382dbe0..11c7a4145 100644 --- a/crates/format/src/sketch/tree.rs +++ b/crates/format/src/sketch/tree.rs @@ -23,7 +23,12 @@ pub(crate) struct Map { } /// The mapping's state while walking the file. -pub(crate) struct Cx { +pub(crate) struct Cx<'a> { + /// `document.json`: shared styles and library copies. + pub document: &'a Value, + pub symbols: super::symbols::Symbols, + /// The symbols being expanded, outermost first (a symbol inside itself stops there). + pub chain: Vec, pub warnings: Vec, pub networks: Vec>, pub too_old: bool, @@ -32,7 +37,7 @@ pub(crate) struct Cx { pub max_nodes: usize, } -impl Cx { +impl Cx<'_> { pub(crate) fn warn(&mut self, msg: impl Into) { let msg = msg.into(); if !self.warnings.contains(&msg) { @@ -43,7 +48,17 @@ impl Cx { /// Map the pages of `archive` to a REST file JSON named `name`. pub(crate) fn to_rest(archive: &Archive, name: &str, max_nodes: usize) -> Map { - let mut cx = Cx { warnings: Vec::new(), networks: Vec::new(), too_old: false, nodes: 0, max_nodes }; + let symbols = super::symbols::Symbols::read(&archive.document, &archive.pages); + let mut cx = Cx { + document: &archive.document, + symbols, + chain: Vec::new(), + warnings: Vec::new(), + networks: Vec::new(), + too_old: false, + nodes: 0, + max_nodes, + }; let mut canvases = Vec::new(); for (id, page) in &archive.pages { let mut node = JsonMap::new(); @@ -54,6 +69,12 @@ pub(crate) fn to_rest(archive: &Archive, name: &str, max_nodes: usize) -> Map { node.insert("children".into(), Value::Array(kids)); canvases.push(Value::Object(node)); } + let foreign = std::mem::take(&mut cx.symbols.foreign); + if !foreign.is_empty() { + canvases.push(super::symbols::library_page(&mut cx, &foreign)); + let libraries = cx.symbols.libraries.join(", "); + cx.warn(format!("symbols from the libraries {libraries} became local components on the page Library symbols")); + } let json = json!({"name": name, "document": {"type": "DOCUMENT", "id": "0:0", "children": canvases}}); Map { json, warnings: cx.warnings, networks: cx.networks, too_old: cx.too_old } } @@ -73,6 +94,12 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: if class == "shapeGroup" { return count(cx).then(|| super::path::shape_group(cx, l, parent, depth, root)).flatten(); } + if class == "symbolMaster" { + return count(cx).then(|| super::symbols::component(cx, l, parent, depth, root)).flatten(); + } + if class == "symbolInstance" { + return count(cx).then(|| super::symbols::instance(cx, l, parent, depth, root)).flatten(); + } let ty = match class { "artboard" | "frame" => "FRAME", "group" | "graphic" => "GROUP", From 4be7017ed1d746707d6a8a64aa36e1e68e3304e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 16:42:22 +0200 Subject: [PATCH 482/817] M6: Sketch import: shared styles and colour variables Shared layer styles become a paint style for their fills, a paint style for their border colours (linked to strokes) and an effect style; shared text styles become text styles (colour stays on the layers); local and library copies alike, unused ones listed too. Layers link to them, keeping their own values where they differ. Color Variables (swatches, also library ones) become colour variables in a Color Variables collection, with fills, borders and text colours bound to them. Co-Authored-By: Claude Opus 5.5 --- crates/format/src/sketch/mod.rs | 3 + crates/format/src/sketch/path.rs | 9 +- crates/format/src/sketch/shared.rs | 134 ++++++++++++++++++++ crates/format/src/sketch/shared_tests.rs | 150 +++++++++++++++++++++++ crates/format/src/sketch/style.rs | 25 +++- crates/format/src/sketch/symbols.rs | 5 +- crates/format/src/sketch/text.rs | 8 +- crates/format/src/sketch/tree.rs | 26 +++- 8 files changed, 345 insertions(+), 15 deletions(-) create mode 100644 crates/format/src/sketch/shared.rs create mode 100644 crates/format/src/sketch/shared_tests.rs diff --git a/crates/format/src/sketch/mod.rs b/crates/format/src/sketch/mod.rs index b9063a70e..db0421f8e 100644 --- a/crates/format/src/sketch/mod.rs +++ b/crates/format/src/sketch/mod.rs @@ -16,6 +16,9 @@ mod fixture; mod path; #[cfg(test)] mod path_tests; +mod shared; +#[cfg(test)] +mod shared_tests; mod style; #[cfg(test)] mod style_tests; diff --git a/crates/format/src/sketch/path.rs b/crates/format/src/sketch/path.rs index 6ebb1a756..0cce6e084 100644 --- a/crates/format/src/sketch/path.rs +++ b/crates/format/src/sketch/path.rs @@ -139,9 +139,10 @@ pub(crate) fn shape_group(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, } let visible = group.get("visible").and_then(Value::as_bool).unwrap_or(true) && m.get("visible").and_then(Value::as_bool).unwrap_or(true); m.insert("visible".into(), json!(visible)); - if let Some(st) = l.get("style") { + if l.get("style").is_some() { super::style::clear(m); - super::style::apply(cx, st, cw, ch, m); + m.remove("styles"); + super::tree::styles(cx, l, cw, ch, m); } super::tree::mask(l, m); } @@ -168,9 +169,7 @@ pub(crate) fn shape_group(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, node.insert("booleanOperation".into(), json!(op)); node.insert("children".into(), Value::Array(chain)); super::tree::mask(l, &mut node); - if let Some(st) = l.get("style") { - super::style::apply(cx, st, w, h, &mut node); - } + super::tree::styles(cx, l, w, h, &mut node); Some(Value::Object(node)) } diff --git a/crates/format/src/sketch/shared.rs b/crates/format/src/sketch/shared.rs new file mode 100644 index 000000000..104a1931f --- /dev/null +++ b/crates/format/src/sketch/shared.rs @@ -0,0 +1,134 @@ +//! Sketch shared styles and swatches → REST style definitions and colour variables. +//! +//! A Sketch layer style holds fills, borders and effects together; FigCraft styles hold one kind +//! each, so a layer style becomes up to three styles named after it: its fills (a paint style), +//! its border colours (a paint style for strokes; widths stay on the layers) and its effects. A +//! text style becomes a text style; its colour stays on the layers, as FigCraft text styles carry +//! none. Layers link to them by `style.sharedObjectID`. Swatches (Color Variables, Sketch 69+) +//! become colour variables in one collection; colours name theirs by `swatchID`. + +use std::collections::BTreeMap; + +use serde_json::{Map as JsonMap, Value, json}; + +use super::tree::{Cx, color, str_field}; + +/// Most shared styles or swatches read from one file. +const MAX_SHARED: usize = 20_000; +/// The collection swatches become variables in. +const COLLECTION: &str = "sketch-color-variables"; +const MODE: &str = "default"; + +/// A file's shared styles and swatches. +#[derive(Default)] +pub(crate) struct Shared { + /// `(id, name, style)` of layer styles, then text styles. + layer: Vec<(String, String, Value)>, + text: Vec<(String, String, Value)>, + swatches: BTreeMap, +} + +impl Shared { + pub(crate) fn read(document: &Value) -> Shared { + let mut s = Shared::default(); + let objects = + |key: &str| -> Vec { document.get(key).and_then(|c| c.get("objects")).and_then(Value::as_array).cloned().unwrap_or_default() }; + let foreign = |key: &str, inner: &str| -> Vec { + document.get(key).and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default().iter().filter_map(|f| f.get(inner).cloned()).collect() + }; + let entry = |o: &Value| { + Some(( + str_field(o, "do_objectID")?.to_string(), + str_field(o, "name").unwrap_or("Style").chars().take(200).collect(), + o.get("value")?.clone(), + )) + }; + for o in objects("layerStyles").iter().chain(&foreign("foreignLayerStyles", "localSharedStyle")).take(MAX_SHARED) { + s.layer.extend(entry(o)); + } + for o in objects("layerTextStyles").iter().chain(&foreign("foreignTextStyles", "localSharedStyle")).take(MAX_SHARED) { + s.text.extend(entry(o)); + } + let foreign_swatches = [foreign("foreignSwatches", "localSwatch"), foreign("foreignSwatches", "localSharedSwatch")].concat(); + for o in objects("sharedSwatches").iter().chain(&foreign_swatches).take(MAX_SHARED) { + if let Some((id, name, value)) = entry(o) + && let Some(c) = color(&value) + { + s.swatches.entry(id).or_insert((name, c)); + } + } + s + } + + pub(crate) fn has_swatch(&self, id: &str) -> bool { + self.swatches.contains_key(id) + } + + /// The REST `styleDefinitions` of every shared style. + pub(crate) fn definitions(cx: &mut Cx) -> Vec { + let layer = cx.shared.layer.clone(); + let text = cx.shared.text.clone(); + let mut out = Vec::new(); + for (id, name, style) in &layer { + let fills = super::style::fills(cx, style, 100.0, 100.0); + if !fills.is_empty() { + out.push(json!({"id": format!("{id}:fill"), "name": name, "styleType": "FILL", "node": {"fills": fills}})); + } + let strokes = super::style::border_paints(cx, style, 100.0, 100.0); + if !strokes.is_empty() { + out.push(json!({"id": format!("{id}:stroke"), "name": format!("{name} border"), "styleType": "FILL", "node": {"fills": strokes}})); + } + let effects = super::style::effects(cx, style); + if !effects.is_empty() { + out.push(json!({"id": format!("{id}:effect"), "name": name, "styleType": "EFFECT", "node": {"effects": effects}})); + } + } + for (id, name, style) in &text { + let Some(enc) = style.get("textStyle").and_then(|t| t.get("encodedAttributes")) else { continue }; + let mut ts = super::text::type_style(cx, enc); + if let Some(m) = ts.as_object_mut() { + m.remove("fills"); + } + out.push(json!({"id": id, "name": name, "styleType": "TEXT", "node": {"type": "TEXT", "characters": "", "style": ts}})); + } + out + } + + /// Link `node` (layer `l`) to the styles made from its shared style. + pub(crate) fn link(&self, cx_defs: &[String], l: &Value, node: &mut JsonMap) { + let Some(sid) = l.get("style").and_then(|s| str_field(s, "sharedObjectID")) else { return }; + let mut refs = JsonMap::new(); + let is_text = str_field(l, "_class") == Some("text"); + if is_text && self.text.iter().any(|(id, _, _)| id == sid) { + refs.insert("text".into(), json!(sid)); + } else if self.layer.iter().any(|(id, _, _)| id == sid) { + for slot in ["fill", "stroke", "effect"] { + let id = format!("{sid}:{slot}"); + if cx_defs.contains(&id) { + refs.insert(slot.into(), json!(id)); + } + } + } + if !refs.is_empty() { + node.insert("styles".into(), Value::Object(refs)); + } + } + + /// The REST `variableCollections` and `variables` for the swatches (none without swatches). + pub(crate) fn variables(&self) -> Option<(Value, Value)> { + if self.swatches.is_empty() { + return None; + } + let ids: Vec<&String> = self.swatches.keys().collect(); + let collections = json!({COLLECTION: {"id": COLLECTION, "name": "Color Variables", "modes": [{"modeId": MODE, "name": "Default"}], + "defaultModeId": MODE, "variableIds": ids}}); + let vars: JsonMap = self + .swatches + .iter() + .map(|(id, (name, c))| { + (id.clone(), json!({"id": id, "name": name, "resolvedType": "COLOR", "variableCollectionId": COLLECTION, "valuesByMode": {MODE: c}})) + }) + .collect(); + Some((collections, Value::Object(vars))) + } +} diff --git a/crates/format/src/sketch/shared_tests.rs b/crates/format/src/sketch/shared_tests.rs new file mode 100644 index 000000000..571a6d2ea --- /dev/null +++ b/crates/format/src/sketch/shared_tests.rs @@ -0,0 +1,150 @@ +//! Sketch shared styles → FigCraft styles; Color Variables (swatches) → colour variables. + +use figcraft_doc::color::PaintKind; +use figcraft_doc::{Document, Node, StyleKind}; +use serde_json::{Value, json}; + +use super::fixture::*; +use super::import; + +const BLACK: [f64; 4] = [0.0, 0.0, 0.0, 1.0]; + +fn open(doc_json: Value, layers: Vec) -> (Document, Vec) { + let z = sketch_zip("83.2", 139, doc_json, &[page("P", "Page", vec![artboard("A", "Board", 0.0, 0.0, 400.0, 400.0, layers)])], &[]); + import(&z, "f").unwrap() +} + +fn node<'d>(doc: &'d Document, name: &str) -> &'d Node { + doc.nodes().find(|n| n.name == name).unwrap_or_else(|| panic!("no {name}")) +} + +fn style<'d>(doc: &'d Document, id: &str) -> &'d figcraft_doc::Style { + doc.styles.iter().find(|s| s.id == id).unwrap_or_else(|| panic!("no style {id}: {:?}", doc.styles.iter().map(|s| &s.id).collect::>())) +} + +fn card_style() -> Value { + json!({"_class": "style", "fills": [solid_fill(0.0, 0.0, 1.0, 1.0)], "borders": [], + "shadows": [{"_class": "shadow", "isEnabled": true, "blurRadius": 4, "offsetX": 0, "offsetY": 2, "spread": 0, "color": color(0.0, 0.0, 0.0, 0.3)}], + "innerShadows": []}) +} + +fn with_shared(d: &mut Value, layer_styles: Vec, text_styles: Vec) { + d["layerStyles"]["objects"] = Value::Array(layer_styles); + d["layerTextStyles"]["objects"] = Value::Array(text_styles); +} + +fn shared(id: &str, name: &str, value: Value) -> Value { + json!({"_class": "sharedStyle", "do_objectID": id, "name": name, "value": value}) +} + +fn linked(mut l: Value, style: Value, shared_id: &str) -> Value { + l["style"] = style; + l["style"]["sharedObjectID"] = json!(shared_id); + l +} + +#[test] +fn layer_style_splits() { + let mut d = document(&["P"]); + with_shared(&mut d, vec![shared("CARD", "Card", card_style())], vec![]); + let (doc, _) = open(d, vec![linked(rect("R", 0.0, 0.0, 50.0, 50.0), card_style(), "CARD")]); + let n = node(&doc, "R"); + let fill = n.styles.fill.clone().expect("fill style linked"); + let effect = n.styles.effect.clone().expect("effect style linked"); + assert_eq!(style(&doc, &fill).name, "Card"); + assert!(matches!(style(&doc, &fill).kind, StyleKind::Paint { .. })); + assert!(matches!(style(&doc, &effect).kind, StyleKind::Effect { .. })); + assert_eq!(style(&doc, &effect).name, "Card"); +} + +#[test] +fn layer_style_borders_become_a_stroke_style() { + let mut st = card_style(); + st["borders"] = + json!([{"_class": "border", "isEnabled": true, "fillType": 0, "color": color(1.0, 0.0, 0.0, 1.0), "position": 1, "thickness": 2}]); + let mut d = document(&["P"]); + with_shared(&mut d, vec![shared("CARD", "Card", st.clone())], vec![]); + let (doc, _) = open(d, vec![linked(rect("R", 0.0, 0.0, 50.0, 50.0), st, "CARD")]); + let stroke = node(&doc, "R").styles.stroke.clone().expect("stroke style linked"); + assert!(style(&doc, &stroke).name.starts_with("Card")); +} + +#[test] +fn unused_shared_styles_are_listed() { + let mut d = document(&["P"]); + with_shared(&mut d, vec![shared("CARD", "Card", card_style())], vec![]); + let (doc, _) = open(d, vec![]); + assert!(doc.styles.iter().any(|s| s.name == "Card")); +} + +#[test] +fn text_style_links() { + let enc = json!({"MSAttributedStringFontAttribute": {"_class": "fontDescriptor", "attributes": {"name": "Helvetica-Bold", "size": 32}}, + "MSAttributedStringColorAttribute": color(1.0, 0.0, 0.0, 1.0), + "paragraphStyle": {"_class": "paragraphStyle", "alignment": 0, "maximumLineHeight": 40, "minimumLineHeight": 40}}); + let st = json!({"_class": "style", "textStyle": {"_class": "textStyle", "encodedAttributes": enc, "verticalAlignment": 0}}); + let mut d = document(&["P"]); + with_shared(&mut d, vec![], vec![shared("H1", "Heading/H1", st.clone())]); + let t = linked(text("Title", 0.0, 0.0, 200.0, 40.0, "Hello", &[(0, 5, "Helvetica-Bold", 32.0, [1.0, 0.0, 0.0, 1.0])]), st, "H1"); + let (doc, _) = open(d, vec![t]); + let n = node(&doc, "Title"); + let sid = n.styles.text.clone().expect("text style linked"); + let s = style(&doc, &sid); + assert_eq!(s.name, "Heading/H1"); + let StyleKind::Text { style: ts } = &s.kind else { panic!("not a text style") }; + assert_eq!((ts.font_family.as_str(), ts.font_style.as_str(), ts.font_size), ("Helvetica", "Bold", 32.0)); + assert!(n.fills.iter().any(|p| matches!(p.kind, PaintKind::Solid { color } if color.r == 1.0 && color.g == 0.0))); +} + +#[test] +fn locally_changed_style_keeps_link() { + let mut local = card_style(); + local["fills"] = json!([solid_fill(0.0, 1.0, 0.0, 1.0)]); + let mut d = document(&["P"]); + with_shared(&mut d, vec![shared("CARD", "Card", card_style())], vec![]); + let (doc, _) = open(d, vec![linked(rect("R", 0.0, 0.0, 50.0, 50.0), local, "CARD")]); + let n = node(&doc, "R"); + assert!(n.styles.fill.is_some()); + assert!(matches!(n.fills[0].kind, PaintKind::Solid { color } if color.g == 1.0 && color.b == 0.0)); +} + +#[test] +fn foreign_styles_too() { + let mut d = document(&["P"]); + d["foreignLayerStyles"] = json!([{"_class": "MSImmutableForeignLayerStyle", "sourceLibraryName": "Kit", "localSharedStyle": shared("FCARD", "Kit card", card_style())}]); + let (doc, _) = open(d, vec![linked(rect("R", 0.0, 0.0, 50.0, 50.0), card_style(), "FCARD")]); + assert_eq!(style(&doc, node(&doc, "R").styles.fill.as_deref().unwrap()).name, "Kit card"); +} + +#[test] +fn swatches_are_color_variables() { + let mut d = document(&["P"]); + d["sharedSwatches"] = json!({"_class": "swatchContainer", "objects": [{"_class": "swatch", "do_objectID": "SW1", "name": "Brand/Blue", "value": color(0.06, 0.38, 1.0, 1.0)}]}); + d["foreignSwatches"] = json!([{"_class": "MSImmutableForeignSwatch", "sourceLibraryName": "Kit", "localSwatch": {"_class": "swatch", "do_objectID": "SW2", "name": "Kit/Red", "value": color(1.0, 0.0, 0.0, 1.0)}}]); + let mut fill = solid_fill(0.06, 0.38, 1.0, 1.0); + fill["color"]["swatchID"] = json!("SW1"); + let mut fill2 = solid_fill(1.0, 0.0, 0.0, 1.0); + fill2["color"]["swatchID"] = json!("SW2"); + let (doc, _) = open( + d, + vec![styled(rect("R", 0.0, 0.0, 50.0, 50.0), "fills", json!([fill])), styled(rect("S", 0.0, 0.0, 50.0, 50.0), "fills", json!([fill2]))], + ); + let coll = doc.variables.collections.iter().find(|c| c.name == "Color Variables").expect("collection"); + let var = doc.variables.variables.iter().find(|v| v.name == "Brand/Blue").expect("variable"); + assert_eq!(var.collection, coll.id); + assert!(doc.variables.variables.iter().any(|v| v.name == "Kit/Red")); + assert_eq!(node(&doc, "R").bound.get("fill"), Some(&var.id)); + assert!(node(&doc, "S").bound.contains_key("fill")); +} + +#[test] +fn unknown_shared_ids_are_ignored() { + let (doc, _) = open(document(&["P"]), vec![linked(rect("R", 0.0, 0.0, 50.0, 50.0), card_style(), "NOPE")]); + let n = node(&doc, "R"); + assert!(n.styles.fill.is_none()); + let mut f = solid_fill(0.0, 0.0, 0.0, 1.0); + f["color"]["swatchID"] = json!("NOPE"); + let (doc, _) = + open(document(&["P"]), vec![styled(text("T", 0.0, 0.0, 10.0, 10.0, "x", &[(0, 1, "Helvetica", 9.0, BLACK)]), "fills", json!([f]))]); + assert!(node(&doc, "T").bound.is_empty()); +} diff --git a/crates/format/src/sketch/style.rs b/crates/format/src/sketch/style.rs index 2da1b7a4e..de2529aac 100644 --- a/crates/format/src/sketch/style.rs +++ b/crates/format/src/sketch/style.rs @@ -17,7 +17,7 @@ const MAX_LIST: usize = 64; /// Write the paints, strokes, effects, opacity and blend mode of `style` into `node`, a layer of /// `w`×`h`. Lists the style doesn't have are left as they are. pub(crate) fn apply(cx: &mut Cx, style: &Value, w: f64, h: f64, node: &mut JsonMap) { - let fills: Vec = list(style, "fills").iter().filter_map(|f| paint(cx, f, w, h)).collect(); + let fills = fills(cx, style, w, h); if !fills.is_empty() { node.insert("fills".into(), Value::Array(fills)); } @@ -36,6 +36,16 @@ pub(crate) fn apply(cx: &mut Cx, style: &Value, w: f64, h: f64, node: &mut JsonM } } +/// A style's fills as REST paints. +pub(crate) fn fills(cx: &mut Cx, style: &Value, w: f64, h: f64) -> Vec { + list(style, "fills").iter().filter_map(|f| paint(cx, f, w, h)).collect() +} + +/// A style's borders as REST paints. +pub(crate) fn border_paints(cx: &mut Cx, style: &Value, w: f64, h: f64) -> Vec { + list(style, "borders").iter().filter_map(|b| paint(cx, b, w, h)).collect() +} + /// Remove what [`apply`] writes, so another style can take its place. pub(crate) fn clear(node: &mut JsonMap) { for key in [ @@ -91,6 +101,9 @@ fn paint(cx: &mut Cx, f: &Value, w: f64, h: f64) -> Option { } }; p["visible"] = json!(f.get("isEnabled").and_then(Value::as_bool).unwrap_or(true)); + if let Some(var) = swatch(cx, f.get("color")) { + p["boundVariables"] = var; + } if let Some(ctx) = f.get("contextSettings") { if let Some(o) = num(ctx, "opacity") { p["opacity"] = json!(o.clamp(0.0, 1.0)); @@ -131,7 +144,7 @@ fn pt((x, y): (f64, f64)) -> Value { /// Borders → stroke paints, and the first enabled border's thickness and position. fn borders(cx: &mut Cx, style: &Value, w: f64, h: f64, node: &mut JsonMap) { let list = list(style, "borders"); - let strokes: Vec = list.iter().filter_map(|b| paint(cx, b, w, h)).collect(); + let strokes = border_paints(cx, style, w, h); if strokes.is_empty() { return; } @@ -201,7 +214,7 @@ fn borders(cx: &mut Cx, style: &Value, w: f64, h: f64, node: &mut JsonMap Vec { +pub(crate) fn effects(cx: &mut Cx, style: &Value) -> Vec { let mut out = Vec::new(); for (key, ty) in [("shadows", "DROP_SHADOW"), ("innerShadows", "INNER_SHADOW")] { for s in list(style, key) { @@ -230,6 +243,12 @@ fn effects(cx: &mut Cx, style: &Value) -> Vec { out } +/// The variable binding of a colour that names a swatch the file has (`{color: alias}`). +pub(crate) fn swatch(cx: &Cx, c: Option<&Value>) -> Option { + let id = c?.get("swatchID").and_then(Value::as_str).filter(|id| cx.shared.has_swatch(id))?; + Some(json!({"color": {"type": "VARIABLE_ALIAS", "id": id}})) +} + /// Sketch's blend modes (0 normal … 17 plus lighter) by REST name. fn blend(mode: i64) -> Option<&'static str> { const MODES: [&str; 18] = [ diff --git a/crates/format/src/sketch/symbols.rs b/crates/format/src/sketch/symbols.rs index d6e7165cb..15079702c 100644 --- a/crates/format/src/sketch/symbols.rs +++ b/crates/format/src/sketch/symbols.rs @@ -209,8 +209,11 @@ fn apply(layers: &mut [Value], ov: &BTreeMap, document: &Value, d _ => {} } for (prop, list) in [("layerStyle", "layerStyles"), ("textStyle", "layerTextStyles")] { - if let Some(style) = get(prop).and_then(Value::as_str).and_then(|sid| shared_style(document, list, sid)) { + let sid = get(prop).and_then(Value::as_str); + if let Some((sid, style)) = sid.and_then(|sid| Some((sid, shared_style(document, list, sid)?))) { l["style"] = style.clone(); + // The layer now uses that shared style: it links to it. + l["style"]["sharedObjectID"] = json!(sid); if prop == "textStyle" && let Some(enc) = style.get("textStyle").and_then(|t| t.get("encodedAttributes")) && let Some(runs) = l.get_mut("attributedString").and_then(|a| a.get_mut("attributes")).and_then(Value::as_array_mut) diff --git a/crates/format/src/sketch/text.rs b/crates/format/src/sketch/text.rs index 74e7a7318..3cdb2afc4 100644 --- a/crates/format/src/sketch/text.rs +++ b/crates/format/src/sketch/text.rs @@ -94,7 +94,7 @@ pub(crate) fn node(cx: &mut Cx, l: &Value, node: &mut JsonMap) { } /// A run's attributes as a REST type style (with its colour as `fills`). -fn type_style(cx: &mut Cx, a: &Value) -> Value { +pub(crate) fn type_style(cx: &mut Cx, a: &Value) -> Value { let font = a.get("MSAttributedStringFontAttribute").and_then(|f| f.get("attributes")); let ps = font.and_then(|f| f.get("name")).and_then(Value::as_str).unwrap_or(""); let size = font.and_then(|f| f.get("size")).and_then(Value::as_f64).filter(|s| s.is_finite() && *s > 0.0).unwrap_or(12.0); @@ -126,7 +126,11 @@ fn type_style(cx: &mut Cx, a: &Value) -> Value { _ => "ORIGINAL", }); let c = a.get("MSAttributedStringColorAttribute").and_then(color).unwrap_or_else(|| json!({"r": 0.0, "g": 0.0, "b": 0.0, "a": 1.0})); - s["fills"] = json!([{"type": "SOLID", "color": c}]); + let mut paint = json!({"type": "SOLID", "color": c}); + if let Some(var) = super::style::swatch(cx, a.get("MSAttributedStringColorAttribute")) { + paint["boundVariables"] = var; + } + s["fills"] = json!([paint]); s } diff --git a/crates/format/src/sketch/tree.rs b/crates/format/src/sketch/tree.rs index 11c7a4145..481eec708 100644 --- a/crates/format/src/sketch/tree.rs +++ b/crates/format/src/sketch/tree.rs @@ -27,6 +27,9 @@ pub(crate) struct Cx<'a> { /// `document.json`: shared styles and library copies. pub document: &'a Value, pub symbols: super::symbols::Symbols, + pub shared: super::shared::Shared, + /// Ids of the styles made from the shared styles. + pub style_defs: Vec, /// The symbols being expanded, outermost first (a symbol inside itself stops there). pub chain: Vec, pub warnings: Vec, @@ -49,9 +52,12 @@ impl Cx<'_> { /// Map the pages of `archive` to a REST file JSON named `name`. pub(crate) fn to_rest(archive: &Archive, name: &str, max_nodes: usize) -> Map { let symbols = super::symbols::Symbols::read(&archive.document, &archive.pages); + let shared = super::shared::Shared::read(&archive.document); let mut cx = Cx { document: &archive.document, symbols, + shared, + style_defs: Vec::new(), chain: Vec::new(), warnings: Vec::new(), networks: Vec::new(), @@ -59,6 +65,8 @@ pub(crate) fn to_rest(archive: &Archive, name: &str, max_nodes: usize) -> Map { nodes: 0, max_nodes, }; + let defs = super::shared::Shared::definitions(&mut cx); + cx.style_defs = defs.iter().filter_map(|d| d.get("id").and_then(Value::as_str).map(str::to_string)).collect(); let mut canvases = Vec::new(); for (id, page) in &archive.pages { let mut node = JsonMap::new(); @@ -75,7 +83,11 @@ pub(crate) fn to_rest(archive: &Archive, name: &str, max_nodes: usize) -> Map { let libraries = cx.symbols.libraries.join(", "); cx.warn(format!("symbols from the libraries {libraries} became local components on the page Library symbols")); } - let json = json!({"name": name, "document": {"type": "DOCUMENT", "id": "0:0", "children": canvases}}); + let mut json = json!({"name": name, "document": {"type": "DOCUMENT", "id": "0:0", "children": canvases}, "styleDefinitions": defs}); + if let Some((collections, variables)) = cx.shared.variables() { + json["variableCollections"] = collections; + json["variables"] = variables; + } Map { json, warnings: cx.warnings, networks: cx.networks, too_old: cx.too_old } } @@ -147,9 +159,7 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: }, _ => {} } - if let Some(st) = l.get("style") { - super::style::apply(cx, st, w, h, &mut node); - } + styles(cx, l, w, h, &mut node); if matches!(ty, "FRAME" | "GROUP") { let kids = children(cx, l, world, (w, h), depth, false); node.insert("children".into(), Value::Array(kids)); @@ -157,6 +167,14 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: Some(Value::Object(node)) } +/// Layer `l`'s style into `node`, and its links to the styles made from its shared style. +pub(crate) fn styles(cx: &mut Cx, l: &Value, w: f64, h: f64, node: &mut JsonMap) { + if let Some(st) = l.get("style") { + super::style::apply(cx, st, w, h, node); + } + cx.shared.link(&cx.style_defs, l, node); +} + /// A clipping mask's flag and kind (outline or alpha). pub(crate) fn mask(l: &Value, node: &mut JsonMap) { if bool_field(l, "hasClippingMask") == Some(true) { From 31698164acacf2348a70beea39e8a2d5cf9b97cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 16:46:21 +0200 Subject: [PATCH 483/817] M6: Sketch import: prototype links, export settings, layout grids Layers linked to artboards navigate there on click (back links go back, slide animations slide), hotspots become transparent frames with their link, flow-home artboards start a flow; export options become export settings (scale, width or height, suffix); artboard layout and square grids become layout grids, which instances show like their masters. Smart Layout, stacks and locked overrides are noted once per file. Co-Authored-By: Claude Opus 5.5 --- crates/format/src/sketch/mod.rs | 3 + crates/format/src/sketch/path.rs | 2 + crates/format/src/sketch/proto.rs | 117 ++++++++++++++++++++++ crates/format/src/sketch/proto_tests.rs | 125 ++++++++++++++++++++++++ crates/format/src/sketch/symbols.rs | 4 + crates/format/src/sketch/tree.rs | 20 ++++ 6 files changed, 271 insertions(+) create mode 100644 crates/format/src/sketch/proto.rs create mode 100644 crates/format/src/sketch/proto_tests.rs diff --git a/crates/format/src/sketch/mod.rs b/crates/format/src/sketch/mod.rs index db0421f8e..3132e6585 100644 --- a/crates/format/src/sketch/mod.rs +++ b/crates/format/src/sketch/mod.rs @@ -16,6 +16,9 @@ mod fixture; mod path; #[cfg(test)] mod path_tests; +mod proto; +#[cfg(test)] +mod proto_tests; mod shared; #[cfg(test)] mod shared_tests; diff --git a/crates/format/src/sketch/path.rs b/crates/format/src/sketch/path.rs index 0cce6e084..8fbe84cd2 100644 --- a/crates/format/src/sketch/path.rs +++ b/crates/format/src/sketch/path.rs @@ -143,6 +143,7 @@ pub(crate) fn shape_group(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, super::style::clear(m); m.remove("styles"); super::tree::styles(cx, l, cw, ch, m); + super::tree::extras(cx, l, ch, m); } super::tree::mask(l, m); } @@ -170,6 +171,7 @@ pub(crate) fn shape_group(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, node.insert("children".into(), Value::Array(chain)); super::tree::mask(l, &mut node); super::tree::styles(cx, l, w, h, &mut node); + super::tree::extras(cx, l, h, &mut node); Some(Value::Object(node)) } diff --git a/crates/format/src/sketch/proto.rs b/crates/format/src/sketch/proto.rs new file mode 100644 index 000000000..afa6df485 --- /dev/null +++ b/crates/format/src/sketch/proto.rs @@ -0,0 +1,117 @@ +//! Sketch prototype links, hotspots, export options and layout grids → REST. +//! +//! A layer's `flow` links it to an artboard (`destinationArtboardID`, or `back`) with an +//! `animationType` (0 none, 1–4 slide from the right, left, bottom, top); hotspots are layers that +//! only carry a link; `isFlowHome` marks an artboard where a prototype starts. + +use serde_json::{Map as JsonMap, Value, json}; + +use super::tree::{Cx, bool_field, str_field}; + +/// Most export settings read from one layer. +const MAX_EXPORTS: usize = 64; + +/// The click interaction of layer `l`'s `flow`, if it has one. +pub(crate) fn interactions(l: &Value, node: &mut JsonMap) { + let Some(flow) = l.get("flow") else { return }; + let Some(dest) = str_field(flow, "destinationArtboardID").filter(|d| !d.is_empty()) else { return }; + let action = if dest == "back" { + json!({"type": "BACK"}) + } else { + let direction = match flow.get("animationType").and_then(Value::as_i64) { + Some(1) => Some("LEFT"), + Some(2) => Some("RIGHT"), + Some(3) => Some("TOP"), + Some(4) => Some("BOTTOM"), + _ => None, + }; + let transition = + direction.map_or(Value::Null, |d| json!({"type": "SLIDE_IN", "direction": d, "duration": 0.3, "easing": {"type": "EASE_IN_AND_OUT"}})); + json!({"type": "NODE", "destinationId": dest, "navigation": "NAVIGATE", "transition": transition}) + }; + node.insert("interactions".into(), json!([{"trigger": {"type": "ON_CLICK"}, "actions": [action]}])); +} + +/// The artboards of a page marked as where a prototype starts, as REST `flowStartingPoints`. +pub(crate) fn starting_points(page: &Value) -> Vec { + super::tree::layers(page) + .iter() + .filter(|a| bool_field(a, "isFlowHome") == Some(true)) + .filter_map(|a| Some(json!({"nodeId": str_field(a, "do_objectID")?, "name": str_field(a, "name").unwrap_or("Flow")}))) + .collect() +} + +/// Layer `l`'s export options as REST `exportSettings`. +pub(crate) fn export_settings(cx: &mut Cx, l: &Value, node: &mut JsonMap) { + let formats = l.get("exportOptions").and_then(|o| o.get("exportFormats")).and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default(); + let mut out = Vec::new(); + for f in formats.iter().take(MAX_EXPORTS) { + let format = match str_field(f, "fileFormat").unwrap_or("png").to_ascii_lowercase().as_str() { + "png" => "PNG", + "jpg" | "jpeg" => "JPG", + "svg" => "SVG", + "pdf" => "PDF", + "webp" => "WEBP", + _ => { + cx.warn("export settings in formats FigCraft doesn't export (TIFF, EPS, HEIC) were skipped"); + continue; + } + }; + let num = |k: &str| f.get(k).and_then(Value::as_f64).filter(|v| v.is_finite() && *v > 0.0); + let constraint = match (f.get("visibleScaleType").and_then(Value::as_i64), num("absoluteSize")) { + (Some(1), Some(s)) => json!({"type": "WIDTH", "value": s.min(16_384.0)}), + (Some(2), Some(s)) => json!({"type": "HEIGHT", "value": s.min(16_384.0)}), + _ => json!({"type": "SCALE", "value": num("scale").unwrap_or(1.0).min(64.0)}), + }; + let name: String = str_field(f, "name").unwrap_or("").chars().take(200).collect(); + if f.get("namingScheme").and_then(Value::as_i64) == Some(1) && !name.is_empty() { + cx.warn("export names Sketch puts before the layer name come after it"); + } + out.push(json!({"format": format, "suffix": name, "constraint": constraint})); + } + if !out.is_empty() { + node.insert("exportSettings".into(), Value::Array(out)); + } +} + +/// An artboard's layout grid (columns, rows) and square grid as REST `layoutGrids`. +pub(crate) fn layout_grids(l: &Value, h: f64, node: &mut JsonMap) { + let mut out = Vec::new(); + if let Some(g) = l.get("layout").filter(|g| bool_field(g, "isEnabled") != Some(false)) { + let num = |k: &str| g.get(k).and_then(Value::as_f64).filter(|v| v.is_finite() && *v >= 0.0); + if bool_field(g, "drawVertical") != Some(false) + && let (Some(count), Some(width)) = (num("numberOfColumns"), num("columnWidth")) + { + out.push(json!({"pattern": "COLUMNS", "alignment": "MIN", "count": count.min(1000.0), "sectionSize": width.min(1e5), + "gutterSize": num("gutterWidth").unwrap_or(0.0).min(1e5), "offset": num("horizontalOffset").unwrap_or(0.0).min(1e5), "visible": true})); + } + if bool_field(g, "drawHorizontal") == Some(true) { + let gutter = num("gutterHeight").unwrap_or(0.0).min(1e5); + let section = (gutter * num("rowHeightMultiplication").unwrap_or(1.0)).min(1e5); + if section > 0.0 { + let count = (h / (section + gutter)).floor().clamp(1.0, 1000.0); + out.push(json!({"pattern": "ROWS", "alignment": "MIN", "count": count, "sectionSize": section, "gutterSize": gutter, "offset": 0, "visible": true})); + } + } + } + if let Some(g) = l.get("grid").filter(|g| bool_field(g, "isEnabled") != Some(false)) + && let Some(size) = g.get("gridSize").and_then(Value::as_f64).filter(|v| v.is_finite() && *v > 0.0) + { + out.push(json!({"pattern": "GRID", "sectionSize": size.min(1e5), "visible": true})); + } + if !out.is_empty() { + node.insert("layoutGrids".into(), Value::Array(out)); + } +} + +/// Notes about what the layer has that FigCraft keeps only as laid out: Smart Layout and Stacks, +/// and overrides a master locks. +pub(crate) fn notes(cx: &mut Cx, l: &Value) { + if l.get("groupLayout").and_then(|g| str_field(g, "_class")).is_some_and(|c| c != "MSImmutableFreeformGroupLayout") { + cx.warn("Smart Layout and stacks were imported as laid out; they don't resize with their content"); + } + let locked = l.get("overrideProperties").and_then(Value::as_array).is_some_and(|p| p.iter().any(|o| bool_field(o, "canOverride") == Some(false))); + if locked { + cx.warn("overrides Sketch symbols locked can be changed in FigCraft"); + } +} diff --git a/crates/format/src/sketch/proto_tests.rs b/crates/format/src/sketch/proto_tests.rs new file mode 100644 index 000000000..be9b835dd --- /dev/null +++ b/crates/format/src/sketch/proto_tests.rs @@ -0,0 +1,125 @@ +//! Sketch prototype links, hotspots, export options, layout grids, smart layout and locked +//! overrides. + +use figcraft_doc::{Document, ExportFormat, Node, NodeKind}; +use serde_json::{Value, json}; + +use super::fixture::*; +use super::import; + +fn open(layers: Vec) -> (Document, Vec) { + let z = sketch_zip("50.2", 103, document(&["P"]), &[page("P", "Page", layers)], &[]); + import(&z, "f").unwrap() +} + +fn node<'d>(doc: &'d Document, name: &str) -> &'d Node { + doc.nodes().find(|n| n.name == name).unwrap_or_else(|| panic!("no {name}")) +} + +fn screens(button: Value) -> Vec { + vec![artboard("A1", "Home", 0.0, 0.0, 100.0, 100.0, vec![button]), artboard("A2", "Detail", 200.0, 0.0, 100.0, 100.0, vec![])] +} + +#[test] +fn flow_navigates() { + let b = with( + rect("Go", 0.0, 0.0, 20.0, 20.0), + "flow", + json!({"_class": "MSImmutableFlowConnection", "destinationArtboardID": "A2", "animationType": 1}), + ); + let (doc, _) = open(screens(b)); + let go = node(&doc, "Go"); + assert_eq!(go.interactions.len(), 1, "{:?}", go.interactions); + let detail = node(&doc, "Detail").id; + let text = format!("{:?}", go.interactions[0]); + assert!(text.contains(&format!("{detail:?}")), "{text}"); +} + +#[test] +fn flow_back() { + let b = with( + rect("Back", 0.0, 0.0, 20.0, 20.0), + "flow", + json!({"_class": "MSImmutableFlowConnection", "destinationArtboardID": "back", "animationType": 0}), + ); + let (doc, _) = open(screens(b)); + let text = format!("{:?}", node(&doc, "Back").interactions); + assert!(text.contains("Back"), "{text}"); +} + +#[test] +fn hotspot_is_transparent_frame_with_interaction() { + let mut h = with( + rect("Hot", 0.0, 0.0, 20.0, 20.0), + "flow", + json!({"_class": "MSImmutableFlowConnection", "destinationArtboardID": "A2", "animationType": 0}), + ); + h["_class"] = json!("MSImmutableHotspotLayer"); + let (doc, _) = open(screens(h)); + let n = node(&doc, "Hot"); + assert!(matches!(n.kind, NodeKind::Frame)); + assert!(n.fills.is_empty()); + assert_eq!(n.interactions.len(), 1); +} + +#[test] +fn flow_home_is_starting_point() { + let mut home = artboard("A1", "Home", 0.0, 0.0, 100.0, 100.0, vec![]); + home["isFlowHome"] = json!(true); + let (doc, _) = open(vec![home]); + let page = doc.node(doc.pages[0]).unwrap(); + let NodeKind::Page { flows, .. } = &page.kind else { panic!("not a page") }; + assert_eq!(flows.len(), 1); + assert_eq!(flows[0].start, node(&doc, "Home").id); +} + +#[test] +fn export_options() { + let mut r = rect("Icon", 0.0, 0.0, 20.0, 20.0); + r["exportOptions"] = json!({"_class": "exportOptions", "exportFormats": [ + {"_class": "exportFormat", "fileFormat": "png", "scale": 2, "name": "@2x", "namingScheme": 0, "absoluteSize": 0, "visibleScaleType": 0}, + {"_class": "exportFormat", "fileFormat": "svg", "scale": 1, "name": "", "namingScheme": 0, "absoluteSize": 0, "visibleScaleType": 0}, + {"_class": "exportFormat", "fileFormat": "png", "scale": 1, "name": "", "namingScheme": 0, "absoluteSize": 64, "visibleScaleType": 1}, + ]}); + let (doc, _) = open(vec![artboard("A", "Board", 0.0, 0.0, 100.0, 100.0, vec![r])]); + let e = &node(&doc, "Icon").exports; + assert_eq!(e.len(), 3); + assert_eq!(e[0].format, ExportFormat::Png); + assert_eq!(e[0].suffix, "@2x"); + assert_eq!(e[1].format, ExportFormat::Svg); + let text = format!("{:?}", e[2]); + assert!(text.contains("64"), "{text}"); +} + +#[test] +fn layout_and_square_grids() { + let mut a = artboard("A", "Board", 0.0, 0.0, 1200.0, 800.0, vec![]); + a["layout"] = json!({"_class": "layoutGrid", "isEnabled": true, "columnWidth": 84, "gutterWidth": 16, "horizontalOffset": 24, "numberOfColumns": 12, + "totalWidth": 1152, "guttersOutside": false, "drawVertical": true, "drawHorizontal": false, "gutterHeight": 8, "rowHeightMultiplication": 3}); + a["grid"] = json!({"_class": "simpleGrid", "isEnabled": true, "gridSize": 8, "thickGridTimes": 0}); + let (doc, _) = open(vec![a]); + let grids = format!("{:?}", node(&doc, "Board").grids); + assert_eq!(node(&doc, "Board").grids.len(), 2, "{grids}"); + assert!(grids.contains("12") && grids.contains("16"), "{grids}"); +} + +#[test] +fn smart_layout_warns_once() { + let g = |id: &str| { + with( + group(id, 0.0, 0.0, 10.0, 10.0, vec![rect(&format!("{id}r"), 0.0, 0.0, 10.0, 10.0)]), + "groupLayout", + json!({"_class": "MSImmutableInferredGroupLayout", "axis": 0}), + ) + }; + let (_, warnings) = open(vec![artboard("A", "Board", 0.0, 0.0, 100.0, 100.0, vec![g("G1"), g("G2"), g("G3")])]); + assert_eq!(warnings.iter().filter(|w| w.contains("Smart Layout")).count(), 1, "{warnings:?}"); +} + +#[test] +fn locked_overrides_are_noted() { + let mut m = master("M", "S", "Locked", 50.0, 20.0, vec![text("L", 0.0, 0.0, 50.0, 20.0, "x", &[(0, 1, "Helvetica", 9.0, [0.0, 0.0, 0.0, 1.0])])]); + m["overrideProperties"] = json!([{"_class": "MSImmutableOverrideProperty", "overrideName": "L_stringValue", "canOverride": false}]); + let (_, warnings) = open(vec![m]); + assert!(warnings.iter().any(|w| w.contains("locked")), "{warnings:?}"); +} diff --git a/crates/format/src/sketch/symbols.rs b/crates/format/src/sketch/symbols.rs index 15079702c..d25a6b566 100644 --- a/crates/format/src/sketch/symbols.rs +++ b/crates/format/src/sketch/symbols.rs @@ -102,6 +102,7 @@ pub(crate) fn component(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, ro if let Some(f) = master_fills(l) { node.insert("fills".into(), f); } + super::tree::extras(cx, l, h, &mut node); let sid = str_field(l, "symbolID").unwrap_or("").to_string(); cx.chain.push(sid); let kids = children(cx, l, world, (w, h), depth, false); @@ -139,6 +140,9 @@ pub(crate) fn instance(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, roo if let Some(st) = l.get("style") { super::style::apply(cx, st, w, h, &mut node); } + super::tree::extras(cx, l, h, &mut node); + // An instance shows its master's grids (else they'd differ, and count as an override). + super::proto::layout_grids(&m, h, &mut node); let overrides = overrides(l); let mut copy = m; if let Some(layers) = copy.get_mut("layers").and_then(Value::as_array_mut) { diff --git a/crates/format/src/sketch/tree.rs b/crates/format/src/sketch/tree.rs index 481eec708..d63afa0ff 100644 --- a/crates/format/src/sketch/tree.rs +++ b/crates/format/src/sketch/tree.rs @@ -75,6 +75,10 @@ pub(crate) fn to_rest(archive: &Archive, name: &str, max_nodes: usize) -> Map { node.insert("name".into(), json!(str_field(page, "name").unwrap_or("Page"))); let kids = children(&mut cx, page, Affine::IDENTITY, (0.0, 0.0), 0, true); node.insert("children".into(), Value::Array(kids)); + let starts = super::proto::starting_points(page); + if !starts.is_empty() { + node.insert("flowStartingPoints".into(), Value::Array(starts)); + } canvases.push(Value::Object(node)); } let foreign = std::mem::take(&mut cx.symbols.foreign); @@ -120,6 +124,7 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: "slice" => "SLICE", "shapePath" | "star" | "polygon" | "triangle" => "VECTOR", "text" => "TEXT", + "MSImmutableHotspotLayer" | "hotspot" => "FRAME", other => { cx.warn(format!("Sketch {} layers are not supported yet and were skipped", clip(other))); return None; @@ -160,6 +165,11 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: _ => {} } styles(cx, l, w, h, &mut node); + extras(cx, l, h, &mut node); + if class == "MSImmutableHotspotLayer" || class == "hotspot" { + node.insert("clipsContent".into(), json!(false)); + node.remove("fills"); + } if matches!(ty, "FRAME" | "GROUP") { let kids = children(cx, l, world, (w, h), depth, false); node.insert("children".into(), Value::Array(kids)); @@ -175,6 +185,16 @@ pub(crate) fn styles(cx: &mut Cx, l: &Value, w: f64, h: f64, node: &mut JsonMap< cx.shared.link(&cx.style_defs, l, node); } +/// Layer `l`'s prototype link, export settings, layout grids (frames) and notes. +pub(crate) fn extras(cx: &mut Cx, l: &Value, h: f64, node: &mut JsonMap) { + super::proto::interactions(l, node); + super::proto::export_settings(cx, l, node); + if matches!(node.get("type").and_then(Value::as_str), Some("FRAME" | "COMPONENT" | "INSTANCE")) { + super::proto::layout_grids(l, h, node); + } + super::proto::notes(cx, l); +} + /// A clipping mask's flag and kind (outline or alpha). pub(crate) fn mask(l: &Value, node: &mut JsonMap) { if bool_field(l, "hasClippingMask") == Some(true) { From 233c8e97083dd80d598484740a2d0e6d0827d9f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 17:02:03 +0200 Subject: [PATCH 484/817] M6: Sketch import: local corpus check and docs FIGCRAFT_SKETCH_SAMPLES runs every .sketch file of a folder through file.open (opens with linked instances and finite geometry, or is refused as too old). File format parity gains a .sketch row; CLI, MCP, roadmap and ROADMAP mention the import. Co-Authored-By: Claude Opus 5.5 --- ROADMAP.md | 3 +- crates/engine/src/sketch_import_tests.rs | 44 ++++++++++++++++++++++++ docs/cli.md | 3 +- docs/file-format-parity.md | 4 ++- docs/mcp.md | 2 +- docs/roadmap.md | 5 +-- 6 files changed, 55 insertions(+), 6 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index f43cd015b..3f57ed576 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-21 · **Change:** minor (`.sketch` import, best effort (Sketch 48 and newer); community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -316,6 +316,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-21 | minor | Best-effort `.sketch` import (Sketch 48 and newer): open, import, drop, CLI and MCP; symbols become live components and instances, shared styles and Color Variables come across ([file-format-parity](docs/file-format-parity.md)). Headline numbers unchanged | | 2026-10-20 | minor | A document dropped on the canvas opens (#916): a `.figcraft`, `.fig` or file JSON dropped on the canvas opens as a file of its own, as on the home screen, in the browser too; it used to add its pages to the file in front. Images and SVG still import at the drop point, File ▸ Import still adds pages, and dragging only documents over the canvas says "Drop to open" (not in the browser, which names no file until the drop). Numbers unchanged | | 2026-10-20 | minor | Duplicating a main component makes an instance (#892): Duplicate and Alt-drag copied a main component as a second main; within its file the copy is now an instance of it, as Copy then Paste already was (a variant duplicated in its set stays a variant). Numbers unchanged. | | 2026-10-20 | minor | Readable disabled and selected text (#890): the dim text colour (disabled buttons, placeholders, hints) is at least 3:1 against panels, fields and selected rows in both themes (it was 2.1:1 in the light theme), a disabled button is grey with that text instead of fading to 40%, and selected text (renaming a page or layer, any text box) takes the theme's readable green on the highlight (1.4:1 in the dark theme before, now 4.2:1 or more); checked with the colour contrast helper (`theme::tests`). Numbers unchanged | diff --git a/crates/engine/src/sketch_import_tests.rs b/crates/engine/src/sketch_import_tests.rs index 10a7b9ca4..c1ac6a599 100644 --- a/crates/engine/src/sketch_import_tests.rs +++ b/crates/engine/src/sketch_import_tests.rs @@ -175,3 +175,47 @@ fn sketch_instances_stay_live() { let b = doc.world_bounds(inst_tag).unwrap(); assert!((b.x0 - 180.0).abs() < 1e-6, "{b:?}"); } + +/// Local only (`FIGCRAFT_SKETCH_SAMPLES` names a folder of `.sketch` files): each opens (Sketch 48 +/// and newer) with its instances linked and finite geometry, or is refused as too old. +#[test] +fn local_sketch_samples_open() { + let Ok(dir) = std::env::var("FIGCRAFT_SKETCH_SAMPLES") else { return }; + let mut files: Vec = std::fs::read_dir(&dir).unwrap().filter_map(|e| e.ok().map(|e| e.path())).collect(); + files.retain(|p| p.extension().is_some_and(|e| e.eq_ignore_ascii_case("sketch"))); + files.sort(); + assert!(!files.is_empty(), "no .sketch files in {dir}"); + for path in files { + let started = std::time::Instant::now(); + let mut s = Session::new(); + match s.execute("file.open", &json!({"path": path.to_string_lossy()})) { + Err(e) => { + let e = e.to_string(); + assert!(e.contains("older than 48"), "{}: {e}", path.display()); + eprintln!("{}: refused as too old", path.display()); + } + Ok(r) => { + let doc = s.doc().unwrap(); + let (mut layers, mut instances, mut unlinked) = (0, 0, 0); + for n in doc.nodes() { + layers += 1; + assert!( + n.width.is_finite() && n.height.is_finite() && n.transform.as_coeffs().iter().all(|c| c.is_finite()), + "{}: {}", + path.display(), + n.name + ); + if let NodeKind::Instance { component, .. } = n.kind { + instances += 1; + if !doc.contains(component) { + unlinked += 1; + } + } + } + assert_eq!(unlinked, 0, "{}", path.display()); + let notes = r.get("warnings").and_then(|w| w.as_array()).map_or(0, Vec::len); + eprintln!("{}: {layers} layers, {instances} instances, {notes} notes, {:?}", path.display(), started.elapsed()); + } + } + } +} diff --git a/docs/cli.md b/docs/cli.md index 699b6ba27..bf783d11a 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -36,7 +36,8 @@ layers}]` with `--json`); their text renders in a fallback font. Every subcommand that reads a file also takes the public REST API file JSON (the response of `GET /v1/files/:key` or of its nodes endpoint, written to a `.json` file): it is imported on the fly. Image fills come from `images/.png` (or `.jpg`, …) next to the JSON when present, else a -grey placeholder. `.fig` files are read the same way (best effort, images from the file itself); +grey placeholder. `.fig` files are read the same way (best effort, images from the file itself), and +so are `.sketch` files saved by Sketch 48 or newer; `info` lists what wasn't imported as `note:` lines. ```text diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index adf0b0f2c..ed2d31577 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (REST import keeps slot layers and instances' slot content (#792); REST import reads grid track sizes (#465); `.fig` import fidelity from the community batches, budgets for large files, the import report, a `.fig` copy from Save as, paste from another design app; instance layers' size and resizing and Hug on import (#731, #732); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-21 · **Change:** minor (`.sketch` import, best effort, Sketch 48 and newer; REST import keeps slot layers and instances' slot content (#792); REST import reads grid track sizes (#465); `.fig` import fidelity from the community batches, budgets for large files, the import report, a `.fig` copy from Save as, paste from another design app; instance layers' size and resizing and Hug on import (#731, #732); SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source) · **Target:** Figma Design (desktop app 126.10.7) Every format Figma reads or writes, with FigCraft's support. Sources: `Info.plist` of `/Applications/Figma.app` (document types only; nothing inside the bundle's code was read), Figma's @@ -18,6 +18,7 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| | `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included; a flow that records no primary-axis sizing hugs on that axis, an instance that records no auto layout has its main's), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Since 2026-10-17 (community batches #727, #728): an instance's own identity and the cached library components a file carries, overrides applied by key and order, local text values and instance overrides over a shared text style, grid track sizes (fixed, content-sized, fill), slot content, labels of connectors saved with their drawn path (a static snapshot; the ends aren't live), skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, editable text on a path, image adjustments and images carried in the message. Budgets come from the file's own size (one value per compressed byte, 20M–128M, lower ceilings on 32-bit targets; the layer cap follows), so a 15.4 MB synthetic file with 300,000 layers opens whole; the file's bytes stay out of the command journal; an import report lists what was left out or changed once the file opens. Not read: elbowed or curved connectors without a saved path (drawn straight) and labels of connectors without a saved snapshot, table cells beyond their own layers, filled areas with their own fills, variables bound to fields the editor can't bind, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs` and the per-feature `*_tests.rs` beside them, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | +| `.sketch` (Sketch 48 and newer) | — (Figma's own Sketch import runs in its web app) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards (and Sketch 2025 frames) as frames with their background, groups, rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape or as boolean operations (mixed operations nested from the left), bitmaps, slices, hotspots; transforms (rotation, flips), resizing constraints; fills (solid, gradients, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (a mask that shows its own style draws a copy under itself, as Sketch does; broken mask chains wrapped); text with styled runs (UTF-16 ranges), paragraph and vertical alignment, box sizing, fonts from PostScript names matched to installed families; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), resized by their constraints and still live; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids. Warnings: noise fills, motion and zoom blurs, embedded fonts (not used), Smart Layout and stacks (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (80,000 layers open in ~4 s, debug build); Sketch 2025 files on fixtures only | 5–10 (Smart Layout as auto layout, real Sketch 2025 files) | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | | REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout (sizing modes left out read as hug, as documented; grid track sizes from `gridColumnsSizing` / `gridRowsSizing`: px, fr, auto, `minmax(0, 1fr)`, `repeat()`), constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, slots (`SLOT` layers bound to their slot property; an instance's slot keeps its content as the instance's own unless its property value is the main's default content; slot limits and preferred components are warnings), styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings, image adjustments (the same tint sign as `.fig`); the import report after opening; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | @@ -165,6 +166,7 @@ each. | Date | Change | Summary | |---|---|---| +| 2026-10-21 | minor | `.sketch` import (best effort): files saved by Sketch 48 and newer open and import like `.fig` files (open, import, drop, CLI, MCP), mapped onto the REST importer: layers, paths, shape groups and booleans, styles and effects, masks, text, symbols with overrides (live instances), shared styles, Color Variables, prototype links, export settings and grids; older files are refused with a message. Checked on fixtures and locally on one real Sketch 50 file and the IBM Carbon Design Kit (Sketch 47, 68, 83). Numbers unchanged | | 2026-10-18 | minor | REST file JSON import keeps `SLOT` layers (#792): they were dropped with everything placed in them, which emptied every instance's slot. A slot in a main component becomes a slot frame bound to its `SLOT` property (the one it references, else the one named like it, else the only one left), and an instance's slot holds the instance's own content, kept across syncs, moves of the mains and saving, unless the instance's property value is the main's default content (without values, a slot that holds layers keeps them). Instances in slot content link to their own mains. Slot content limits, preferred-only and preferred components are warnings. Synthetic files only. Numbers unchanged | | 2026-10-17 | minor | REST file JSON import reads grid track sizes from the CSS track strings `gridColumnsSizing` / `gridRowsSizing` (fixed px, fill fr, hug `auto`, `minmax(0, 1fr)`, `repeat()`; other tracks stay equal) (#465). Numbers unchanged | | 2026-10-17 | minor | The community batches #727 and #728 in the `.fig` row: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments (also REST), images in the message; budgets from the file's size; the journal keeps no file bytes; the import report. Not read cut to what's left. A `.fig` copy from Save as. Pasted content: layers copied from another design app, best effort (tested only with clipboard HTML made from our own export), and images under Wayland (not run there). All on synthetic files: summary and hours unchanged | diff --git a/docs/mcp.md b/docs/mcp.md index dfea95cc2..a56fbd95e 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -303,7 +303,7 @@ Or in a project's `.mcp.json`: | `select {ids}` | Replace the selection (`[]` deselects). | | `export {ids, format, scale \| size, path?, bleed?, cropMarks?, bleedMarks?, cmyk?, contentsOnly?, includeBoundingBox?, svgOutlineText?, svgIdAttribute?, svgSimplifyStroke?}` | png, jpg, svg, webp, pdf, or `fig`: the whole file as `.fig`, experimental (see Exporting `.fig` files below); `size` is `2x`, `512w` or `512h`. 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); `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. 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. 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?}` / `save_file {path?}` | Open `.figcraft`, `.json` (FigCraft JSON or REST API file JSON with its variables, see below), `.fig` (best effort, see below), `.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 just gives its `index`) and the document's `document` outline. | +| `open_file {path, variables?}` / `save_file {path?}` | Open `.figcraft`, `.json` (FigCraft JSON or REST API file JSON with its variables, see below), `.fig` (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 just gives its `index`) and the document's `document` outline. | | `undo` / `redo` | Step through history. | | `pointer {kind, x, y, to?, steps?, tool?, shift, alt, cmd, pressure?, pressureTo?}` | Mouse gestures in page coordinates with the current tool: `click`, `double`, `drag`, `down`, `move`, `up`, `hover`. A dragged layer drops into the frame or auto layout slot under the pointer, except one inside a group, a boolean group or an instance (outside its slots), which only moves. `pressure` (0–1) is pen pressure; a drag goes from `pressure` to `pressureTo` (see Brushes and pen pressure). | | `key {key, shift, alt, cmd}` | A shortcut or key as if typed on the canvas (every default shortcut, tool keys, Escape, Delete, arrows, number keys for opacity, arrows that pan the view when nothing is selected; while editing text, the text shortcuts and then text editing keys). Keys are names like `A`, `0`, `Enter`, `ArrowLeft`, `=`, `/`, or egui's (`Plus`, `Questionmark`); `cmd` is Cmd on macOS and Ctrl elsewhere. | diff --git a/docs/roadmap.md b/docs/roadmap.md index 8d63a4692..fcca75531 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # FigCraft roadmap: milestones and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community batch #753: Selection colors, smart-selection spacing, a Present tab; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; community fixes from #478 up and a control-channel fix (#589); recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading, SVG import budgets, Leptos code, full screen, server snapshots, owner-only preferences, ruzstd 0.9.1, layer cycle repair, batch rollback, Direct3D 12 on Windows, plugin metering; vector edit mode regions: hover hatch, selection and drag; repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` import, best effort; 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 ~79%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-21 · **Change:** minor (`.sketch` import, best effort; community batch #753: Selection colors, smart-selection spacing, a Present tab; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; community fixes from #478 up and a control-channel fix (#589); recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading, SVG import budgets, Leptos code, full screen, server snapshots, owner-only preferences, ruzstd 0.9.1, layer cycle repair, batch rollback, Direct3D 12 on Windows, plugin metering; vector edit mode regions: hover hatch, selection and drag; repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` import, best effort; 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 ~79%) · **Target:** Figma Design (desktop app 126.10.7) Forward-looking plan. Where FigCraft stands today: [`ROADMAP.md`](../ROADMAP.md) and [`target-app-parity.md`](target-app-parity.md); the full ranked list: [`gaps.md`](gaps.md). Hours @@ -53,7 +53,7 @@ blockers. | M3 Components & styles depth | ~78% (extended collections, variables import/export, gradient stop and variant bindings landed 2026-10-11) | real libraries, component playground | 7–14 | | M4 Vector & text depth | ~80% (live booleans, arc fields, shape builder on strokes, boolean hit testing on the result, one-sided widths, text on a path, pattern fills, brushes and pen pressure landed 2026-10-11; vector edit mode regions 2026-10-13) | spell check, Figma Draw multi-edit | 7–18 | | M5 Prototype & present | ~85% | media, controllers on macOS/Linux/FreeBSD, separate window | 2–5 | -| M6 Interop & Dev Mode | ~65% (code connect, Dev Mode plugins and best-effort `.fig` import landed 2026-10-11) | `.fig` import's tail, video/HEIC (animated GIFs and TIFF landed 2026-10-11), CMYK intent | 15–30 | +| M6 Interop & Dev Mode | ~65% (code connect, Dev Mode plugins and best-effort `.fig` import landed 2026-10-11; best-effort `.sketch` import 2026-10-21) | `.fig` import's tail, video/HEIC (animated GIFs and TIFF landed 2026-10-11), CMYK intent | 15–30 | | M7 Release & fidelity (signed builds, look & feel, shortcuts) | builds done; fidelity pass started | tool-by-tool pass | 40–60 | | M8 Hardening & performance (bench, retained canvas, accessibility, idle) | ~60% | real-file corpus, platform QA, GPU canvas, screen readers | 60–110 | | M9 Real-time collaboration | core done (#103: ids, change sets, server ordering, convergence); live sessions (WebSocket transport with limits and reconnect, hosting from the app, invite links, document sync between apps, cursors, selections, avatars, follow, `collab.*` commands); per-user undo, rejection handling, offline queue and resuming after a reconnect; styles, variables, collections, modes and comments created in a session get ids from their creator's space; others' text carets and selections on the canvas; the browser client (joins desktop-hosted sessions); `figcraft://` links open the app and join (Windows registers per user; macOS and Linux packages declare the scheme); the standalone `figcraft-server` (persistence with compaction, restarts that lose nothing confirmed, publishing from the app, share links to edit or view, revocable); team libraries kept on the server and enabled by a share link, with usage counts, and swapping a library; `wss://` from the desktop app, server releases and a deployment guide | accounts, teams | 45–90 | @@ -73,6 +73,7 @@ blockers. | Date | Change | Summary | |---|---|---| +| 2026-10-21 | minor | M6: best-effort `.sketch` import (Sketch 48 and newer), see [file-format-parity](file-format-parity.md). Percentages unchanged | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | From 6640498195c07107c1b4c38a5ef2c9d4effe42a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 17:22:07 +0200 Subject: [PATCH 485/817] M6: Sketch import: hostile files can't panic, run out of memory or hang From the branch review: overrides that point at junk (shared styles that aren't objects, text runs that aren't) no longer panic; symbol expansion spends a work budget (JSON copied, overrides handed on to nested instances, grouped once by their first path segment), so small files can't expand into gigabytes; far path points stay in range; notes are capped and de-duplicated with a set; shared styles are looked up by index; a styled second mask's drawn copy isn't clipped by the first; JSON members are refused past 100 times their packed size or 2 GB in all, and an unreadable document.json keeps the pages. Co-Authored-By: Claude Opus 5.5 --- crates/format/src/sketch/mod.rs | 56 ++++++++-- crates/format/src/sketch/path.rs | 6 +- crates/format/src/sketch/path_tests.rs | 13 +++ crates/format/src/sketch/shared.rs | 27 ++++- crates/format/src/sketch/style_tests.rs | 12 ++ crates/format/src/sketch/symbols.rs | 127 +++++++++++++++------- crates/format/src/sketch/symbols_tests.rs | 54 +++++++++ crates/format/src/sketch/tree.rs | 54 +++++++-- crates/format/src/sketch/tree_tests.rs | 52 +++++++++ 9 files changed, 337 insertions(+), 64 deletions(-) diff --git a/crates/format/src/sketch/mod.rs b/crates/format/src/sketch/mod.rs index 3132e6585..3c64b4094 100644 --- a/crates/format/src/sketch/mod.rs +++ b/crates/format/src/sketch/mod.rs @@ -40,7 +40,7 @@ mod tree_tests; use std::collections::BTreeSet; use figcraft_doc::Document; -use serde_json::Value; +use serde_json::{Value, json}; use crate::FormatError; @@ -53,6 +53,15 @@ pub const NEWEST_TESTED_VERSION: u64 = 139; pub const TOO_OLD: &str = "saved by a Sketch older than 48; open it in a newer Sketch and save it again"; /// Largest JSON member read (a real page of a few thousand layers takes 33 MB). const MAX_JSON_MEMBER: u64 = 512 * 1024 * 1024; +/// Most bytes JSON members may unpack to, per compressed byte (real files pack 5–20 times; a +/// zero-filled array a thousand times), with a floor for small members. +const MAX_JSON_RATIO: u64 = 100; +const MIN_JSON_ALLOWANCE: u64 = 16 * 1024 * 1024; +/// Most JSON read from one file in all. +#[cfg(not(target_pointer_width = "32"))] +const MAX_JSON_TOTAL: u64 = 2 * 1024 * 1024 * 1024; +#[cfg(target_pointer_width = "32")] +const MAX_JSON_TOTAL: u64 = 512 * 1024 * 1024; /// Largest image member read. const MAX_IMAGE: u64 = 256 * 1024 * 1024; /// Most pages read from one file. @@ -165,22 +174,36 @@ pub(crate) struct Archive<'b> { impl<'b> Archive<'b> { fn open(bytes: &'b [u8], max_member: u64) -> Result { let mut z = zip::ZipArchive::new(std::io::Cursor::new(bytes)).map_err(|e| corrupt(e.to_string()))?; - let json = |z: &mut zip::ZipArchive>, member: &str, limit: u64| -> Result { - let data = crate::read_member(z, member, limit)?; - serde_json::from_slice(&data).map_err(|e| corrupt(format!("{member}: {e}"))) - }; - let meta = json(&mut z, "meta.json", MAX_JSON_MEMBER)?; + let mut total = 0u64; + let meta = json_member(&mut z, "meta.json", MAX_JSON_MEMBER, &mut total)?; if !meta.is_object() { return Err(corrupt("meta.json is not an object")); } if app_major(&meta).is_some_and(|v| v < MIN_SKETCH) { return Err(FormatError::Io(TOO_OLD.into())); } - let document = json(&mut z, "document.json", MAX_JSON_MEMBER)?; let mut warnings = Vec::new(); if meta.get("version").and_then(Value::as_u64).is_some_and(|v| v > NEWEST_TESTED_VERSION) { warnings.push("the file was saved by a newer Sketch than the import was checked with; some layers may differ".to_string()); } + // A document.json that can't be read (nested too deep, damaged) loses its shared styles and + // library copies, not the pages: they are then taken in archive order. + let document = match json_member(&mut z, "document.json", MAX_JSON_MEMBER, &mut total) { + Ok(d) if d.is_object() => d, + other => { + let why = other.err().map_or_else(|| "not an object".to_string(), |e| e.to_string()); + warnings.push(format!( + "the document's shared styles and library symbols were skipped: {}", + why.trim_start_matches("not a valid FigCraft file: ") + )); + let pages: Vec = z + .file_names() + .filter_map(|n| n.strip_prefix("pages/")?.strip_suffix(".json")) + .map(|id| json!({"_ref": format!("pages/{id}")})) + .collect(); + json!({"pages": pages}) + } + }; let refs = document.get("pages").and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default(); let mut pages = Vec::new(); for r in refs.iter().take(MAX_PAGES) { @@ -188,7 +211,7 @@ impl<'b> Archive<'b> { warnings.push("pages the document lists without a valid reference were skipped".into()); continue; }; - match json(&mut z, &format!("pages/{id}.json"), max_member) { + match json_member(&mut z, &format!("pages/{id}.json"), max_member, &mut total) { Ok(page) if page.is_object() => pages.push((id.to_string(), page)), Ok(_) => warnings.push("pages that aren't JSON objects were skipped".into()), Err(e) => warnings.push(format!("a page was skipped: {}", e.to_string().trim_start_matches("not a valid FigCraft file: "))), @@ -212,6 +235,23 @@ impl<'b> Archive<'b> { } } +/// JSON member `name`, refused before unpacking when it would be larger than `limit`, than +/// [`MAX_JSON_RATIO`] times what it takes in the archive (past a floor), or than what is left of +/// the file's [`MAX_JSON_TOTAL`] (`total`: read so far). +fn json_member(z: &mut zip::ZipArchive>, name: &str, limit: u64, total: &mut u64) -> Result { + let (size, packed) = { + let f = z.by_name(name).map_err(|e| corrupt(format!("{name}: {e}")))?; + (f.size(), f.compressed_size()) + }; + let allowed = limit.min(packed.saturating_mul(MAX_JSON_RATIO).max(MIN_JSON_ALLOWANCE)).min(MAX_JSON_TOTAL.saturating_sub(*total)); + if size > allowed { + return Err(corrupt(format!("{name} is too large"))); + } + let data = crate::read_member(z, name, allowed)?; + *total += data.len() as u64; + serde_json::from_slice(&data).map_err(|e| corrupt(format!("{name}: {e}"))) +} + /// The major version of the Sketch that saved the file (`meta.json` `appVersion`, "50.2" → 50). fn app_major(meta: &Value) -> Option { meta.get("appVersion").and_then(Value::as_str)?.split('.').next()?.trim().parse().ok() diff --git a/crates/format/src/sketch/path.rs b/crates/format/src/sketch/path.rs index 8fbe84cd2..30a9f2569 100644 --- a/crates/format/src/sketch/path.rs +++ b/crates/format/src/sketch/path.rs @@ -12,6 +12,8 @@ use serde_json::{Map as JsonMap, Value, json}; use super::tree::{Cx, base, layer, layers, local, size}; +/// Farthest a point or handle may be from its layer (the REST importer's own range). +const MAX_COORD: f64 = 1e7; /// Most points read from one path. const MAX_POINTS: usize = 100_000; @@ -36,7 +38,9 @@ pub(crate) fn network(cx: &mut Cx, l: &Value, w: f64, h: f64) -> Option MAX_POINTS { cx.warn(format!("paths with more than {MAX_POINTS} points were cut")); } - let at = |p: &Value, key: &str| p.get(key).and_then(Value::as_str).and_then(parse_point).map(|(x, y)| (x * w, y * h)); + // Far points stay within the importer's coordinate range (a product could overflow). + let fit = |v: f64| if v.is_finite() { v.clamp(-MAX_COORD, MAX_COORD) } else { 0.0 }; + let at = |p: &Value, key: &str| p.get(key).and_then(Value::as_str).and_then(parse_point).map(|(x, y)| (fit(x * w), fit(y * h))); let mut vertices = Vec::new(); // Per vertex: its handles (relative to it) when it has them. let mut handles: Vec<((f64, f64), (f64, f64))> = Vec::new(); diff --git a/crates/format/src/sketch/path_tests.rs b/crates/format/src/sketch/path_tests.rs index 8e1528fbf..fb03d74cc 100644 --- a/crates/format/src/sketch/path_tests.rs +++ b/crates/format/src/sketch/path_tests.rs @@ -152,3 +152,16 @@ fn even_odd_winding() { let NodeKind::Vector { network } = &node(&doc, "Holes").kind else { panic!("not a vector") }; assert_eq!(network.regions[0].winding, figcraft_doc::WindingRule::EvenOdd); } + +#[test] +fn huge_points_stay_finite() { + let mut p = shape_path("Huge", 0.0, 0.0, 1e6, 1e6, &[(0.0, 0.0), (1.0, 0.0), (1.0, 1.0)], true); + p["points"][1]["point"] = json!("{1e308, 0}"); + p["points"][1]["curveMode"] = json!(2); + p["points"][1]["curveFrom"] = json!("{-1e308, 1e308}"); + let doc = open(vec![p]); + if let NodeKind::Vector { network } = &node(&doc, "Huge").kind { + assert!(network.vertices.iter().all(|v| v.x.is_finite() && v.y.is_finite())); + assert!(network.segments.iter().all(|s| [s.ta.0, s.ta.1, s.tb.0, s.tb.1].iter().all(|c| c.is_finite()))); + } +} diff --git a/crates/format/src/sketch/shared.rs b/crates/format/src/sketch/shared.rs index 104a1931f..ee1221486 100644 --- a/crates/format/src/sketch/shared.rs +++ b/crates/format/src/sketch/shared.rs @@ -7,7 +7,7 @@ //! none. Layers link to them by `style.sharedObjectID`. Swatches (Color Variables, Sketch 69+) //! become colour variables in one collection; colours name theirs by `swatchID`. -use std::collections::BTreeMap; +use std::collections::{BTreeMap, BTreeSet}; use serde_json::{Map as JsonMap, Value, json}; @@ -25,6 +25,9 @@ pub(crate) struct Shared { /// `(id, name, style)` of layer styles, then text styles. layer: Vec<(String, String, Value)>, text: Vec<(String, String, Value)>, + /// Positions in `layer` and `text` by id. + layer_index: BTreeMap, + text_index: BTreeMap, swatches: BTreeMap, } @@ -44,10 +47,16 @@ impl Shared { )) }; for o in objects("layerStyles").iter().chain(&foreign("foreignLayerStyles", "localSharedStyle")).take(MAX_SHARED) { - s.layer.extend(entry(o)); + if let Some(e) = entry(o).filter(|e| !s.layer_index.contains_key(&e.0)) { + s.layer_index.insert(e.0.clone(), s.layer.len()); + s.layer.push(e); + } } for o in objects("layerTextStyles").iter().chain(&foreign("foreignTextStyles", "localSharedStyle")).take(MAX_SHARED) { - s.text.extend(entry(o)); + if let Some(e) = entry(o).filter(|e| !s.text_index.contains_key(&e.0)) { + s.text_index.insert(e.0.clone(), s.text.len()); + s.text.push(e); + } } let foreign_swatches = [foreign("foreignSwatches", "localSwatch"), foreign("foreignSwatches", "localSharedSwatch")].concat(); for o in objects("sharedSwatches").iter().chain(&foreign_swatches).take(MAX_SHARED) { @@ -60,6 +69,12 @@ impl Shared { s } + /// The style of shared text (`text`) or layer style `id`. + pub(crate) fn style(&self, text: bool, id: &str) -> Option<&Value> { + let (index, list) = if text { (&self.text_index, &self.text) } else { (&self.layer_index, &self.layer) }; + list.get(*index.get(id)?).map(|e| &e.2) + } + pub(crate) fn has_swatch(&self, id: &str) -> bool { self.swatches.contains_key(id) } @@ -95,13 +110,13 @@ impl Shared { } /// Link `node` (layer `l`) to the styles made from its shared style. - pub(crate) fn link(&self, cx_defs: &[String], l: &Value, node: &mut JsonMap) { + pub(crate) fn link(&self, cx_defs: &BTreeSet, l: &Value, node: &mut JsonMap) { let Some(sid) = l.get("style").and_then(|s| str_field(s, "sharedObjectID")) else { return }; let mut refs = JsonMap::new(); let is_text = str_field(l, "_class") == Some("text"); - if is_text && self.text.iter().any(|(id, _, _)| id == sid) { + if is_text && self.text_index.contains_key(sid) { refs.insert("text".into(), json!(sid)); - } else if self.layer.iter().any(|(id, _, _)| id == sid) { + } else if self.layer_index.contains_key(sid) { for slot in ["fill", "stroke", "effect"] { let id = format!("{sid}:{slot}"); if cx_defs.contains(&id) { diff --git a/crates/format/src/sketch/style_tests.rs b/crates/format/src/sketch/style_tests.rs index ee428c881..b1b2801b5 100644 --- a/crates/format/src/sketch/style_tests.rs +++ b/crates/format/src/sketch/style_tests.rs @@ -283,3 +283,15 @@ fn masked_icon_keeps_its_geometry() { assert!((b.x0 - 164.0).abs() < 1e-6 && (b.y0 - 41.0).abs() < 1e-6 && (b.width() - 45.0).abs() < 1e-6, "body {b:?}"); assert!(matches!(node(&doc, "Circle").kind, NodeKind::Ellipse { .. })); } + +#[test] +fn two_styled_masks_each_draw() { + let fill = json!([solid_fill(0.5, 0.5, 0.5, 1.0)]); + let m1 = styled(with(r("Mask1"), "hasClippingMask", json!(true)), "fills", fill.clone()); + let m2 = styled(with(rect("Mask2", 200.0, 0.0, 100.0, 50.0), "hasClippingMask", json!(true)), "fills", fill); + let (doc, _) = open(vec![group("G", 0.0, 0.0, 300.0, 50.0, vec![m1, r("A"), m2, rect("B", 200.0, 0.0, 10.0, 10.0)])]); + // The drawn copy of the second mask isn't inside the first mask's group. + let copy = doc.nodes().find(|n| n.name == "Mask2 (drawn)").unwrap(); + let first_group = node(&doc, "Mask1").parent.unwrap(); + assert_ne!(copy.parent, Some(first_group)); +} diff --git a/crates/format/src/sketch/symbols.rs b/crates/format/src/sketch/symbols.rs index d25a6b566..b87b71381 100644 --- a/crates/format/src/sketch/symbols.rs +++ b/crates/format/src/sketch/symbols.rs @@ -14,8 +14,11 @@ use std::collections::BTreeMap; use figcraft_doc::geom::Affine; use serde_json::{Map as JsonMap, Value, json}; +use super::shared::Shared; use super::tree::{Cx, base, bool_field, children, local, size, str_field}; +/// Work units an override handed on to a nested instance costs (the JSON values it adds). +const OVERRIDE_COST: u64 = 8; /// Most masters read from one file. const MAX_MASTERS: usize = 100_000; @@ -23,6 +26,8 @@ const MAX_MASTERS: usize = 100_000; #[derive(Default)] pub(crate) struct Symbols { masters: BTreeMap, + /// What expanding each master costs (see [`weight`]). + weights: BTreeMap, /// Masters copied from libraries that no page holds (they get a page of their own), with the /// libraries' names. pub foreign: Vec, @@ -61,8 +66,11 @@ impl Symbols { if self.masters.len() >= MAX_MASTERS { return; } - if let Some(id) = str_field(&m, "symbolID") { - self.masters.entry(id.to_string()).or_insert(m); + if let Some(id) = str_field(&m, "symbolID") + && !self.masters.contains_key(id) + { + self.weights.insert(id.to_string(), weight(&m, 0)); + self.masters.insert(id.to_string(), m); } } @@ -71,6 +79,19 @@ impl Symbols { } } +/// What copying and mapping `v` costs, in work units: one per JSON value, one per 8 bytes of text. +fn weight(v: &Value, depth: usize) -> u64 { + if depth > 256 { + return 1; + } + match v { + Value::String(s) => 1 + s.len() as u64 / 8, + Value::Array(a) => 1 + a.iter().map(|x| weight(x, depth + 1)).sum::(), + Value::Object(o) => 1 + o.iter().map(|(k, x)| k.len() as u64 / 8 + weight(x, depth + 1)).sum::(), + _ => 1, + } +} + fn masters_in<'v>(l: &'v Value, out: &mut Vec<&'v Value>, depth: usize) { if depth > 64 { return; @@ -117,6 +138,12 @@ pub(crate) fn instance(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, roo let (w, h) = size(l); let world = parent * local(l, w, h); let sid = str_field(l, "symbolID").unwrap_or(""); + let cost = cx.symbols.weights.get(sid).copied().unwrap_or(0); + if cx.symbols.master(sid).is_some() && !cx.spend(cost) { + let mut node = base(l, "FRAME", parent, world, w, h, root); + node.insert("children".into(), json!([])); + return Some(Value::Object(node)); + } let Some(m) = cx.symbols.master(sid).cloned() else { cx.warn("instances of symbols that aren't in the file were imported as empty frames"); let mut node = base(l, "FRAME", parent, world, w, h, root); @@ -144,9 +171,17 @@ pub(crate) fn instance(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, roo // An instance shows its master's grids (else they'd differ, and count as an override). super::proto::layout_grids(&m, h, &mut node); let overrides = overrides(l); + let nested = nested(&overrides); let mut copy = m; + let mut budget = cx.work_left(); if let Some(layers) = copy.get_mut("layers").and_then(Value::as_array_mut) { - apply(layers, &overrides, cx.document, 0); + apply(layers, &overrides, &nested, &cx.shared, 0, &mut budget); + } + let used = cx.work_left().saturating_sub(budget); + cx.spend(used); + if budget == 0 { + // The budget ran out handing overrides on: noted. + cx.spend(1); } let (mw, mh) = size(©); cx.chain.push(sid.to_string()); @@ -172,9 +207,30 @@ fn overrides(l: &Value) -> BTreeMap { .collect() } +/// The overrides of layers inside nested instances, by the nested instance's id: `X/rest_prop` → +/// `X` → [(`rest_prop`, value)]. +fn nested(ov: &BTreeMap) -> BTreeMap<&str, Vec<(&str, &Value)>> { + let mut out: BTreeMap<&str, Vec<(&str, &Value)>> = BTreeMap::new(); + for (k, v) in ov { + if let Some((first, rest)) = k.split_once('/') { + out.entry(first).or_default().push((rest, v)); + } + } + out +} + /// Apply `ov` to the layers of a master's copy: to the layers it names, and passed on to nested /// instances for the layers inside them (an outer override wins over the nested instance's own). -fn apply(layers: &mut [Value], ov: &BTreeMap, document: &Value, depth: usize) { +/// Each override handed to a nested instance costs [`OVERRIDE_COST`] units of `budget`; once it is spent, the +/// rest aren't handed on. +fn apply( + layers: &mut [Value], + ov: &BTreeMap, + nested: &BTreeMap<&str, Vec<(&str, &Value)>>, + shared: &Shared, + depth: usize, + budget: &mut u64, +) { if depth > 64 || ov.is_empty() { return; } @@ -188,14 +244,12 @@ fn apply(layers: &mut [Value], ov: &BTreeMap, document: &Value, d Some(other) => l["symbolID"] = json!(other), None => {} } - let prefix = format!("{id}/"); - let inner: Vec = ov - .iter() - .filter_map(|(k, v)| k.strip_prefix(&prefix).map(|rest| json!({"_class": "overrideValue", "overrideName": rest, "value": v}))) - .collect(); - if !inner.is_empty() { + let inner = nested.get(id.as_str()).map(Vec::as_slice).unwrap_or_default(); + let take = usize::try_from(*budget / OVERRIDE_COST).unwrap_or(usize::MAX).min(inner.len()); + *budget -= take as u64 * OVERRIDE_COST; + if take > 0 { let mut own = l.get("overrideValues").and_then(Value::as_array).cloned().unwrap_or_default(); - own.extend(inner); + own.extend(inner.iter().take(take).map(|(rest, v)| json!({"_class": "overrideValue", "overrideName": rest, "value": v}))); l["overrideValues"] = Value::Array(own); } continue; @@ -212,24 +266,29 @@ fn apply(layers: &mut [Value], ov: &BTreeMap, document: &Value, d } _ => {} } - for (prop, list) in [("layerStyle", "layerStyles"), ("textStyle", "layerTextStyles")] { + for (prop, text) in [("layerStyle", false), ("textStyle", true)] { let sid = get(prop).and_then(Value::as_str); - if let Some((sid, style)) = sid.and_then(|sid| Some((sid, shared_style(document, list, sid)?))) { - l["style"] = style.clone(); + // Shared styles that aren't objects are junk: left alone. + let Some((sid, style)) = sid.and_then(|sid| Some((sid, shared.style(text, sid).filter(|s| s.is_object())?))) else { continue }; + let mut style = style.clone(); + if let Some(m) = style.as_object_mut() { // The layer now uses that shared style: it links to it. - l["style"]["sharedObjectID"] = json!(sid); - if prop == "textStyle" - && let Some(enc) = style.get("textStyle").and_then(|t| t.get("encodedAttributes")) - && let Some(runs) = l.get_mut("attributedString").and_then(|a| a.get_mut("attributes")).and_then(Value::as_array_mut) - { - for r in runs { - r["attributes"] = enc.clone(); - } + m.insert("sharedObjectID".into(), json!(sid)); + } + if text + && let Some(enc) = style.get("textStyle").and_then(|t| t.get("encodedAttributes")) + && let Some(runs) = l.get_mut("attributedString").and_then(|a| a.get_mut("attributes")).and_then(Value::as_array_mut) + { + for r in runs.iter_mut().filter_map(Value::as_object_mut) { + r.insert("attributes".into(), enc.clone()); } } + if let Some(m) = l.as_object_mut() { + m.insert("style".into(), style); + } } if let Some(kids) = l.get_mut("layers").and_then(Value::as_array_mut) { - apply(kids, ov, document, depth + 1); + apply(kids, ov, nested, shared, depth + 1, budget); } } } @@ -241,28 +300,16 @@ fn set_string(l: &mut Value, s: &str) { let Some(a) = l.get_mut("attributedString").and_then(Value::as_object_mut) else { return }; a.insert("string".into(), json!(s)); let runs = match first { - Some(mut r) => { - r["location"] = json!(0); - r["length"] = json!(units); - vec![r] + Some(Value::Object(mut r)) => { + r.insert("location".into(), json!(0)); + r.insert("length".into(), json!(units)); + vec![Value::Object(r)] } - None => Vec::new(), + _ => Vec::new(), }; a.insert("attributes".into(), Value::Array(runs)); } -/// The style of shared style `id` from the document's `list` (local) or its library copies. -pub(crate) fn shared_style<'v>(document: &'v Value, list: &str, id: &str) -> Option<&'v Value> { - let local = document.get(list).and_then(|c| c.get("objects")).and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default(); - let foreign_key = if list == "layerStyles" { "foreignLayerStyles" } else { "foreignTextStyles" }; - let foreign = document.get(foreign_key).and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default(); - local - .iter() - .find(|s| str_field(s, "do_objectID") == Some(id)) - .or_else(|| foreign.iter().filter_map(|f| f.get("localSharedStyle")).find(|s| str_field(s, "do_objectID") == Some(id))) - .and_then(|s| s.get("value")) -} - /// Make the ids of an instance's layers its own (`;`): the master's layers keep /// theirs. fn prefix_ids(v: &mut Value, prefix: &str, depth: usize) { diff --git a/crates/format/src/sketch/symbols_tests.rs b/crates/format/src/sketch/symbols_tests.rs index e22043994..4c98ebe2d 100644 --- a/crates/format/src/sketch/symbols_tests.rs +++ b/crates/format/src/sketch/symbols_tests.rs @@ -163,3 +163,57 @@ fn resized_instance_follows_constraints() { let b = doc.world_bounds(tag.id).unwrap(); assert!((b.x0 - 180.0).abs() < 1e-6 && (b.width() - 20.0).abs() < 1e-6, "{b:?}"); } + +/// Overrides pointing at junk (a shared style that isn't an object, text runs that aren't) never +/// panic. +#[test] +fn override_application_survives_junk() { + let mut d = document(&["P", "S"]); + d["layerStyles"]["objects"] = json!([{"_class": "sharedStyle", "do_objectID": "S1", "name": "Junk", "value": 5}]); + d["layerTextStyles"]["objects"] = + json!([{"_class": "sharedStyle", "do_objectID": "T1", "name": "Junk text", "value": {"textStyle": {"encodedAttributes": {}}}}]); + let mut t = text("Label", 0.0, 0.0, 50.0, 20.0, "x", &[(0, 1, "Helvetica", 9.0, BLACK)]); + t["attributedString"]["attributes"] = json!([5, "x", null]); + let m = master("M", "S", "Junk master", 50.0, 20.0, vec![rect("C", 0.0, 0.0, 10.0, 10.0), t]); + let inst = instance( + "I1", + "S", + 0.0, + 0.0, + 50.0, + 20.0, + &[("C_layerStyle", json!("S1")), ("Label_textStyle", json!("T1")), ("Label_stringValue", json!("y"))], + ); + let z = sketch_zip("50.2", 103, d, &[page("P", "Page", vec![inst]), page("S", "Symbols", vec![m])], &[]); + assert!(import(&z, "f").is_ok()); +} + +/// A huge master expanded by many instances stops at the file's work budget. +#[test] +fn expansion_work_is_bounded() { + let long = "x".repeat(200_000); + let m = master("M", "S", "Heavy", 50.0, 20.0, vec![text("Long", 0.0, 0.0, 50.0, 20.0, &long, &[(0, 200_000, "Helvetica", 9.0, BLACK)])]); + let many: Vec = (0..3000).map(|i| instance(&format!("I{i}"), "S", 0.0, 0.0, 50.0, 20.0, &[])).collect(); + let z = sketch_zip("50.2", 103, document(&["P", "S"]), &[page("P", "Page", many), page("S", "Symbols", vec![m])], &[]); + let (_, warnings) = import(&z, "f").unwrap(); + assert!(warnings.iter().any(|w| w.contains("expand")), "{warnings:?}"); +} + +/// Outer overrides fanned out to many nested instances stop at the work budget. +#[test] +fn override_fan_out_is_bounded() { + let inner = master("MB", "SB", "Cell", 10.0, 10.0, vec![text("T", 0.0, 0.0, 10.0, 10.0, "1", &[(0, 1, "Helvetica", 9.0, BLACK)])]); + let cells: Vec = (0..3000).map(|_| instance("X", "SB", 0.0, 0.0, 10.0, 10.0, &[])).collect(); + let grid = master("MA", "SA", "Grid", 100.0, 100.0, cells); + let overrides: Vec<(String, Value)> = (0..3000).map(|i| (format!("X/N{i}_stringValue"), json!("v"))).collect(); + let refs: Vec<(&str, Value)> = overrides.iter().map(|(k, v)| (k.as_str(), v.clone())).collect(); + let z = sketch_zip( + "50.2", + 103, + document(&["P", "S"]), + &[page("P", "Page", vec![instance("I", "SA", 0.0, 0.0, 100.0, 100.0, &refs)]), page("S", "Symbols", vec![inner, grid])], + &[], + ); + let (_, warnings) = import(&z, "f").unwrap(); + assert!(warnings.iter().any(|w| w.contains("expand")), "{warnings:?}"); +} diff --git a/crates/format/src/sketch/tree.rs b/crates/format/src/sketch/tree.rs index d63afa0ff..c1bf04328 100644 --- a/crates/format/src/sketch/tree.rs +++ b/crates/format/src/sketch/tree.rs @@ -6,6 +6,16 @@ use serde_json::{Map as JsonMap, Value, json}; use super::Archive; +/// Most distinct notes kept. +const MAX_NOTES: usize = 200; +/// Work units symbol expansion may spend on one file (one per JSON value copied, see +/// `symbols::weight`): about three times what the largest design kit checked spends (21M, with +/// 2 GB at its peak), well below what runs out of memory; less on 32-bit targets (the web), where +/// such a kit keeps its first instances and notes the rest. +#[cfg(not(target_pointer_width = "32"))] +const MAX_WORK: u64 = 60_000_000; +#[cfg(target_pointer_width = "32")] +const MAX_WORK: u64 = 15_000_000; /// Deepest layer nesting followed (deeper layers are skipped with a warning). const MAX_DEPTH: usize = 200; /// Largest size and farthest position kept (the REST importer's own bounds). @@ -23,13 +33,16 @@ pub(crate) struct Map { } /// The mapping's state while walking the file. -pub(crate) struct Cx<'a> { - /// `document.json`: shared styles and library copies. - pub document: &'a Value, +pub(crate) struct Cx { pub symbols: super::symbols::Symbols, pub shared: super::shared::Shared, /// Ids of the styles made from the shared styles. - pub style_defs: Vec, + pub style_defs: std::collections::BTreeSet, + /// Work spent expanding symbols, and the most the file may take (see `symbols::weight`). + pub work: u64, + pub max_work: u64, + /// Notes given so far (each once). + pub seen: std::collections::BTreeSet, /// The symbols being expanded, outermost first (a symbol inside itself stops there). pub chain: Vec, pub warnings: Vec, @@ -40,13 +53,33 @@ pub(crate) struct Cx<'a> { pub max_nodes: usize, } -impl Cx<'_> { +impl Cx { pub(crate) fn warn(&mut self, msg: impl Into) { let msg = msg.into(); - if !self.warnings.contains(&msg) { + if self.seen.len() > MAX_NOTES || !self.seen.insert(msg.clone()) { + return; + } + if self.seen.len() > MAX_NOTES { + self.warnings.push("more notes were left out".into()); + } else { self.warnings.push(msg); } } + + /// Spend `n` units of the work budget; false (with a note, once) when it would run out. + pub(crate) fn spend(&mut self, n: u64) -> bool { + if self.work.saturating_add(n) > self.max_work { + self.work = self.max_work; + self.warn("the file's symbols expand to more than the import handles; the instances past that were imported as empty frames"); + return false; + } + self.work += n; + true + } + + pub(crate) fn work_left(&self) -> u64 { + self.max_work.saturating_sub(self.work) + } } /// Map the pages of `archive` to a REST file JSON named `name`. @@ -54,10 +87,12 @@ pub(crate) fn to_rest(archive: &Archive, name: &str, max_nodes: usize) -> Map { let symbols = super::symbols::Symbols::read(&archive.document, &archive.pages); let shared = super::shared::Shared::read(&archive.document); let mut cx = Cx { - document: &archive.document, symbols, shared, - style_defs: Vec::new(), + style_defs: std::collections::BTreeSet::new(), + work: 0, + max_work: MAX_WORK, + seen: std::collections::BTreeSet::new(), chain: Vec::new(), warnings: Vec::new(), networks: Vec::new(), @@ -319,7 +354,8 @@ pub(crate) fn children(cx: &mut Cx, l: &Value, world: Affine, size: (f64, f64), .flat_map(|(breaks, n)| match drawn_mask(&n) { // Sketch also draws a mask with its own style, under what it clips; a FigCraft mask // only clips, so a plain copy of it goes underneath. - Some(copy) => vec![(false, copy), (breaks, n)], + // The copy ends an earlier mask's chain as the mask itself would. + Some(copy) => vec![(breaks, copy), (breaks, n)], None => vec![(breaks, n)], }) .collect(); diff --git a/crates/format/src/sketch/tree_tests.rs b/crates/format/src/sketch/tree_tests.rs index c9f995588..91aeba3a8 100644 --- a/crates/format/src/sketch/tree_tests.rs +++ b/crates/format/src/sketch/tree_tests.rs @@ -179,3 +179,55 @@ fn sketch_2025_frames_and_graphics() { assert!(!node(&doc, "Frame").clip); assert!(matches!(node(&doc, "Graphic").kind, NodeKind::Group)); } + +#[test] +fn many_distinct_warnings_are_capped() { + let layers: Vec = (0..5000) + .map(|i| { + let mut l = rect(&format!("R{i}"), 0.0, 0.0, 1.0, 1.0); + l["_class"] = json!(format!("MSOdd{i}")); + l + }) + .collect(); + let (_, warnings) = open(vec![artboard("A", "Board", 0.0, 0.0, 100.0, 100.0, layers)]); + assert!(warnings.len() <= 250, "{}", warnings.len()); +} + +#[test] +fn bomb_pages_are_skipped() { + // 64 MB of `[0,0,…]` packs into a few hundred kilobytes. + let bomb = format!("{{\"_class\":\"page\",\"do_objectID\":\"B\",\"name\":\"Bomb\",\"layers\":[],\"junk\":[{}0]}}", "0,".repeat(32 * 1024 * 1024)); + let mut out = Vec::new(); + { + use std::io::Write; + let mut z = zip::ZipWriter::new(std::io::Cursor::new(&mut out)); + let o = zip::write::SimpleFileOptions::default().compression_method(zip::CompressionMethod::Deflated); + z.start_file("document.json", o).unwrap(); + z.write_all(document(&["B", "P"]).to_string().as_bytes()).unwrap(); + z.start_file("meta.json", o).unwrap(); + z.write_all(json!({"app": "com.bohemiancoding.sketch3", "appVersion": "50.2", "version": 103}).to_string().as_bytes()).unwrap(); + z.start_file("pages/B.json", o).unwrap(); + z.write_all(bomb.as_bytes()).unwrap(); + z.start_file("pages/P.json", o).unwrap(); + z.write_all(page("P", "Fine", vec![]).to_string().as_bytes()).unwrap(); + z.finish().unwrap(); + } + let (doc, warnings) = import(&out, "f").unwrap(); + let names: Vec = doc.pages.iter().map(|p| doc.node(*p).unwrap().name.clone()).collect(); + assert!(!names.contains(&"Bomb".to_string()) && names.contains(&"Fine".to_string()), "{names:?}"); + assert!(warnings.iter().any(|w| w.contains("too large")), "{warnings:?}"); +} + +#[test] +fn deep_document_json_still_opens_the_pages() { + let mut deep = json!({"_class": "symbolMaster"}); + for _ in 0..150 { + deep = json!({"_class": "group", "layers": [deep]}); + } + let mut d = document(&["P"]); + d["foreignSymbols"] = json!([{"symbolMaster": deep}]); + let z = sketch_zip("50.2", 103, d, &[page("P", "Kept", vec![])], &[]); + let (doc, warnings) = import(&z, "f").unwrap(); + assert!(doc.pages.iter().any(|p| doc.node(*p).unwrap().name == "Kept")); + assert!(!warnings.is_empty()); +} From 5b9e18317d25736cf89523ce0505c41ccfd3da1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 18:05:36 +0200 Subject: [PATCH 486/817] M6: Sketch import: match Sketch's own rendering Compared artboard by artboard with Sketch's renders of a real Sketch 50 file (sketchtool, black-box). Shape groups whose children have no operation are one compound path filled by the group's winding rule (read from the layer), not a union: rings, map streets and icons keep their holes. Filled open paths close, as Sketch fills them. Flips apply after rotation. Text with a fixed line height sits where Sketch's line spacing behaviour puts it. Edited ovals and rectangles keep their points. Bitmap colour adjustments become image filters. scale 0 means unscaled. A local test compares sample files with sketchtool's renders. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/sketch_import_tests.rs | 85 +++++++++ crates/format/src/sketch/path.rs | 199 +++++++++++++++++----- crates/format/src/sketch/path_tests.rs | 68 ++++++++ crates/format/src/sketch/style.rs | 15 ++ crates/format/src/sketch/style_tests.rs | 19 +++ crates/format/src/sketch/symbols.rs | 3 +- crates/format/src/sketch/symbols_tests.rs | 9 + crates/format/src/sketch/text.rs | 23 +++ crates/format/src/sketch/text_tests.rs | 20 +++ crates/format/src/sketch/tree.rs | 23 ++- crates/format/src/sketch/tree_tests.rs | 25 +++ docs/file-format-parity.md | 2 +- 12 files changed, 446 insertions(+), 45 deletions(-) diff --git a/crates/engine/src/sketch_import_tests.rs b/crates/engine/src/sketch_import_tests.rs index c1ac6a599..cee351b88 100644 --- a/crates/engine/src/sketch_import_tests.rs +++ b/crates/engine/src/sketch_import_tests.rs @@ -219,3 +219,88 @@ fn local_sketch_samples_open() { } } } + +/// Local only (`FIGCRAFT_SKETCH_SAMPLES` and `FIGCRAFT_SKETCHTOOL`, the path of Sketch's +/// `sketchtool`): every artboard of each sample (Sketch 48 and newer) drawn by FigCraft is compared +/// with Sketch's own export of it. Prints the share of pixels that differ per artboard (a channel +/// off by more than 40, on white); fails past 10% (a broken artboard, not antialiasing or fonts). +#[test] +fn local_sketch_samples_match_sketch() { + let (Ok(dir), Ok(tool)) = (std::env::var("FIGCRAFT_SKETCH_SAMPLES"), std::env::var("FIGCRAFT_SKETCHTOOL")) else { return }; + // Text draws in the fonts Sketch uses only once the system fonts are known. + figcraft_text::fontdb::scan_system_fonts(); + let mut files: Vec = std::fs::read_dir(&dir).unwrap().filter_map(|e| e.ok().map(|e| e.path())).collect(); + files.retain(|p| p.extension().is_some_and(|e| e.eq_ignore_ascii_case("sketch"))); + files.sort(); + let mut worst: Vec<(f64, String)> = Vec::new(); + for path in files { + let mut s = Session::new(); + if s.execute("file.open", &json!({"path": path.to_string_lossy()})).is_err() { + continue; + } + let out = std::env::temp_dir().join(format!("figcraft-sketch-ref-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&out); + let status = std::process::Command::new(&tool) + .args(["export", "artboards"]) + .arg(&path) + .arg(format!("--output={}", out.display())) + .args(["--formats=png", "--scales=1", "--use-id-for-name=YES", "--include-symbols=NO"]) + .output() + .unwrap(); + assert!(status.status.success(), "sketchtool failed on {}", path.display()); + // Artboards by page and order, from the file itself. + let archive = zip::ZipArchive::new(std::fs::File::open(&path).unwrap()).unwrap(); + let mut archive = archive; + let mut read = |name: &str| -> Value { + let mut s = String::new(); + std::io::Read::read_to_string(&mut archive.by_name(name).unwrap(), &mut s).unwrap(); + serde_json::from_str(&s).unwrap() + }; + let document = read("document.json"); + let doc = s.doc().unwrap(); + let refs: Vec = document["pages"].as_array().unwrap().iter().map(|r| r["_ref"].as_str().unwrap().to_string()).collect(); + for (page_ref, page_id) in refs.iter().zip(doc.pages.iter()) { + let page = read(&format!("{page_ref}.json")); + let boards: Vec = page["layers"] + .as_array() + .unwrap() + .iter() + .filter(|l| l["_class"] == "artboard") + .map(|l| l["do_objectID"].as_str().unwrap().to_string()) + .collect(); + let frames: Vec = + doc.node(*page_id).unwrap().children.iter().copied().filter(|c| matches!(doc.node(*c).unwrap().kind, NodeKind::Frame)).collect(); + assert_eq!(boards.len(), frames.len(), "{}: artboards of {page_ref}", path.display()); + for (id, frame) in boards.iter().zip(frames) { + let Ok(reference) = image::open(out.join(format!("{id}.png"))) else { continue }; + let reference = reference.to_rgba8(); + let ours = figcraft_render::render_node(doc, frame, 1.0).unwrap(); + let (w, h) = (reference.width().min(ours.width()), reference.height().min(ours.height())); + let ours_rgba = figcraft_render::to_rgba8(&ours); + // Both on white, straight alpha. + let on_white = |c: &[u8], i: usize| { + let a = f64::from(c[3]) / 255.0; + f64::from(c[i]) * a + 255.0 * (1.0 - a) + }; + let mut bad = 0u64; + for y in 0..h { + for x in 0..w { + let r = reference.get_pixel(x, y).0; + let at = ((y * ours.width() + x) * 4) as usize; + let Some(o) = ours_rgba.get(at..at + 4) else { continue }; + if (0..3).any(|i| (on_white(&r, i) - on_white(o, i)).abs() > 40.0) { + bad += 1; + } + } + } + let share = bad as f64 * 100.0 / (f64::from(w) * f64::from(h)).max(1.0); + let name = doc.node(frame).unwrap().name.clone(); + eprintln!("{share:6.2}% {} {name}", path.file_name().unwrap().to_string_lossy()); + worst.push((share, format!("{}: {name}", path.display()))); + } + } + let _ = std::fs::remove_dir_all(&out); + } + worst.sort_by(|a, b| b.0.total_cmp(&a.0)); + assert!(worst.first().is_none_or(|w| w.0 < 10.0), "{worst:?}"); +} diff --git a/crates/format/src/sketch/path.rs b/crates/format/src/sketch/path.rs index 30a9f2569..149b48701 100644 --- a/crates/format/src/sketch/path.rs +++ b/crates/format/src/sketch/path.rs @@ -4,7 +4,10 @@ //! and `curveTo` (the handle arriving at it) are `"{x, y}"` strings in 0–1 of the layer's frame; //! values outside that range are allowed. Sketch 51 and older wrap every shape in a `shapeGroup` //! that carries the style; its children combine left to right, each with its own -//! `booleanOperation` (−1 none and 0 union, 1 subtract, 2 intersect, 3 difference). +//! `booleanOperation` (0 union, 1 subtract, 2 intersect, 3 difference). Children with −1 (none) +//! don't combine: they join the path before them into one compound path, filled by the winding +//! rule (`windingRule` on the layer, 1 even-odd: inner paths are holes). Sketch fills an open path +//! as if it were closed. use figcraft_doc::geom::{Affine, polygon_points, star_points}; use figcraft_doc::{Region, Segment, VectorNetwork, Vertex, WindingRule}; @@ -32,8 +35,26 @@ pub(crate) fn parse_point(s: &str) -> Option<(f64, f64)> { Some((n(x)?, n(y)?)) } -/// The network of a path layer of `w`×`h` (`None` when it has no usable points). -pub(crate) fn network(cx: &mut Cx, l: &Value, w: f64, h: f64) -> Option { +/// A layer's winding rule: on the layer (Sketch 51 and older), else in its style. +pub(crate) fn winding(l: &Value) -> WindingRule { + let rule = l.get("windingRule").or_else(|| l.get("style").and_then(|s| s.get("windingRule"))); + match rule.and_then(Value::as_i64) { + Some(1) => WindingRule::EvenOdd, + _ => WindingRule::NonZero, + } +} + +/// Whether a style shows any fill or border. +fn shows(style: Option<&Value>, key: &str) -> bool { + style + .and_then(|s| s.get(key)) + .and_then(Value::as_array) + .is_some_and(|l| l.iter().any(|f| f.get("isEnabled").and_then(Value::as_bool) != Some(false))) +} + +/// The network of a path layer of `w`×`h` (`None` when it has no usable points). `fill_open`: an +/// open path gets a closing segment and a fill region, as Sketch fills it. +pub(crate) fn network(cx: &mut Cx, l: &Value, w: f64, h: f64, fill_open: bool) -> Option { let pts = l.get("points").and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default(); if pts.len() > MAX_POINTS { cx.warn(format!("paths with more than {MAX_POINTS} points were cut")); @@ -61,20 +82,20 @@ pub(crate) fn network(cx: &mut Cx, l: &Value, w: f64, h: f64) -> Option 1; + let open = !l.get("isClosed").and_then(Value::as_bool).unwrap_or(false); + let closed = n > 1 && (!open || (fill_open && n > 2)); let count = if closed { n } else { n - 1 }; let segments: Vec = (0..count) .map(|i| { let j = (i + 1) % n; - let ta = handles.get(i).map_or((0.0, 0.0), |h| h.0); - let tb = handles.get(j).map_or((0.0, 0.0), |h| h.1); + // The edge that closes an open path for its fill is straight. + let closing = open && j == 0; + let ta = if closing { (0.0, 0.0) } else { handles.get(i).map_or((0.0, 0.0), |h| h.0) }; + let tb = if closing { (0.0, 0.0) } else { handles.get(j).map_or((0.0, 0.0), |h| h.1) }; Segment { a: i, b: j, ta, tb } }) .collect(); - let winding = match l.get("style").and_then(|s| s.get("windingRule")).and_then(Value::as_i64) { - Some(1) => WindingRule::EvenOdd, - _ => WindingRule::NonZero, - }; + let winding = winding(l); let regions = if closed { vec![Region { loops: vec![(0..segments.len()).collect()], winding }] } else { Vec::new() }; Some(VectorNetwork { vertices, segments, regions }) } @@ -82,7 +103,14 @@ pub(crate) fn network(cx: &mut Cx, l: &Value, w: f64, h: f64) -> Option Option { - let net = network(cx, l, w, h)?; + // Inside a shape group the group's fill decides; a shape of its own, its style. + let style = l.get("style"); + let filled = cx.operand_fill.unwrap_or_else(|| shows(style, "fills")); + let open = !l.get("isClosed").and_then(Value::as_bool).unwrap_or(false); + if open && filled && (shows(style, "borders") || cx.operand_border) { + cx.warn("open paths with both a fill and a border were closed; the border runs along the closing edge too"); + } + let net = network(cx, l, w, h, filled)?; let class = l.get("_class").and_then(Value::as_str).unwrap_or(""); let count = l.get("numberOfPoints").and_then(Value::as_u64).filter(|c| (3..=120).contains(c)).and_then(|c| u32::try_from(c).ok()); let plain = net.vertices.iter().all(|v| v.radius == 0.0) && net.segments.iter().all(|s| s.ta == (0.0, 0.0) && s.tb == (0.0, 0.0)); @@ -123,41 +151,98 @@ pub(crate) fn put_shape(cx: &mut Cx, shape: Shape, node: &mut JsonMap Option { let (w, h) = size(l); let world = parent * local(l, w, h); let kids = layers(l); - if let [only] = kids { - let mut node = layer(cx, only, world, depth + 1, false)?; - let (cw, ch) = size(only); - let child_world = world * local(only, cw, ch); - let group = base(l, "GROUP", parent, child_world, cw, ch, root); - if let Some(m) = node.as_object_mut() { - for key in ["id", "name", "relativeTransform", "absoluteBoundingBox", "constraints", "locked"] { - match group.get(key) { - Some(v) => m.insert(key.into(), v.clone()), - None => m.remove(key), - }; - } - let visible = group.get("visible").and_then(Value::as_bool).unwrap_or(true) && m.get("visible").and_then(Value::as_bool).unwrap_or(true); - m.insert("visible".into(), json!(visible)); - if l.get("style").is_some() { - super::style::clear(m); - m.remove("styles"); - super::tree::styles(cx, l, cw, ch, m); - super::tree::extras(cx, l, ch, m); - } - super::tree::mask(l, m); + let saved = (cx.operand_fill, cx.operand_border); + cx.operand_border = shows(l.get("style"), "borders"); + let out = if let [only] = kids { + cx.operand_fill = Some(shows(l.get("style"), "fills")); + single(cx, l, only, parent, world, depth, root) + } else { + // Operands of a boolean operation (or a compound path) give area: open ones close. + cx.operand_fill = Some(true); + combined(cx, l, kids, parent, world, (w, h), depth, root) + }; + (cx.operand_fill, cx.operand_border) = saved; + out +} + +/// A shape group of one shape: that shape in the group's place, with its name and style. +fn single(cx: &mut Cx, l: &Value, only: &Value, parent: Affine, world: Affine, depth: usize, root: bool) -> Option { + let mut node = layer(cx, only, world, depth + 1, false)?; + let (cw, ch) = size(only); + let child_world = world * local(only, cw, ch); + let group = base(l, "GROUP", parent, child_world, cw, ch, root); + if let Some(m) = node.as_object_mut() { + for key in ["id", "name", "relativeTransform", "absoluteBoundingBox", "constraints", "locked"] { + match group.get(key) { + Some(v) => m.insert(key.into(), v.clone()), + None => m.remove(key), + }; } - return Some(node); + let visible = group.get("visible").and_then(Value::as_bool).unwrap_or(true) && m.get("visible").and_then(Value::as_bool).unwrap_or(true); + m.insert("visible".into(), json!(visible)); + if l.get("style").is_some() { + super::style::clear(m); + m.remove("styles"); + super::tree::styles(cx, l, cw, ch, m); + super::tree::extras(cx, l, ch, m); + } + super::tree::mask(l, m); + } + Some(node) +} + +/// A shape group of several shapes: one compound path, or boolean operations over runs. +fn combined(cx: &mut Cx, l: &Value, kids: &[Value], parent: Affine, world: Affine, (w, h): (f64, f64), depth: usize, root: bool) -> Option { + // Runs: a child with an operation starts one, children without (−1) join it. + let mut runs: Vec> = Vec::new(); + for (i, c) in kids.iter().enumerate() { + match runs.last_mut() { + Some(run) if i > 0 && c.get("booleanOperation").and_then(Value::as_i64).unwrap_or(-1) < 0 => run.push(c), + _ => runs.push(vec![c]), + } + } + let winding = winding(l); + if let [run] = runs.as_slice() + && let Some(net) = compound(cx, run, winding) + { + // No operations at all: the group is one path. + let mut node = base(l, "VECTOR", parent, world, w, h, root); + node.insert("vectorNetworkRef".into(), json!(cx.networks.len())); + cx.networks.push(Some(net)); + super::tree::mask(l, &mut node); + super::tree::styles(cx, l, w, h, &mut node); + super::tree::extras(cx, l, h, &mut node); + return Some(Value::Object(node)); } let mut chain: Vec = Vec::new(); let mut op = "UNION"; - for (i, c) in kids.iter().enumerate() { - let Some(child) = layer(cx, c, world, depth + 2, false) else { continue }; - let this = boolean_op(c); + for (i, run) in runs.iter().enumerate() { + let operands: Vec = match run.as_slice() { + [one] => layer(cx, one, world, depth + 2, false).into_iter().collect(), + more => match compound(cx, more, winding) { + Some(net) => { + let mut node = base(more.first().copied().unwrap_or(l), "VECTOR", world, world, w, h, false); + node.remove("id"); + node.insert("vectorNetworkRef".into(), json!(cx.networks.len())); + cx.networks.push(Some(net)); + vec![Value::Object(node)] + } + // Not all paths: each one an operand of its own. + None => more.iter().filter_map(|c| layer(cx, c, world, depth + 2, false)).collect(), + }, + }; + if operands.is_empty() { + continue; + } + let this = run.first().map_or("UNION", |c| boolean_op(c)); if i > 0 && this != op && chain.len() > 1 { let inner = synthetic(l, op, parent, world, w, h, std::mem::take(&mut chain)); chain.push(inner); @@ -165,7 +250,7 @@ pub(crate) fn shape_group(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, if i > 0 { op = this; } - chain.push(child); + chain.extend(operands); } if chain.is_empty() { return None; @@ -179,6 +264,42 @@ pub(crate) fn shape_group(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, Some(Value::Object(node)) } +/// The paths `run` as one network in their group's space, filled by `winding`; `None` when one of +/// them isn't a path (a group, text, …). +fn compound(cx: &mut Cx, run: &[&Value], winding: WindingRule) -> Option { + const PATHS: [&str; 6] = ["shapePath", "rectangle", "oval", "star", "polygon", "triangle"]; + if run.iter().any(|c| !c.get("_class").and_then(Value::as_str).is_some_and(|k| PATHS.contains(&k))) { + return None; + } + let mut out = VectorNetwork::default(); + let mut loops = Vec::new(); + for c in run { + let (cw, ch) = size(c); + let Some(net) = network(cx, c, cw, ch, true) else { continue }; + let xf = local(c, cw, ch); + let [a, b, cc, d, _, _] = xf.as_coeffs(); + let lin = |(x, y): (f64, f64)| (a * x + cc * y, b * x + d * y); + let (v0, s0) = (out.vertices.len(), out.segments.len()); + for v in net.vertices { + let p = xf * figcraft_doc::geom::Point::new(v.x, v.y); + out.vertices.push(Vertex { x: p.x, y: p.y, ..v }); + } + for sg in net.segments { + out.segments.push(Segment { a: sg.a + v0, b: sg.b + v0, ta: lin(sg.ta), tb: lin(sg.tb) }); + } + for r in net.regions { + loops.extend(r.loops.into_iter().map(|lp| lp.into_iter().map(|i| i + s0).collect::>())); + } + } + if out.vertices.is_empty() { + return None; + } + if !loops.is_empty() { + out.regions.push(Region { loops, winding }); + } + Some(out) +} + /// A boolean operation the shape group doesn't have as a layer of its own: placed like the group. fn synthetic(l: &Value, op: &str, parent: Affine, world: Affine, w: f64, h: f64, children: Vec) -> Value { let mut node = base(l, "BOOLEAN_OPERATION", parent, world, w, h, false); diff --git a/crates/format/src/sketch/path_tests.rs b/crates/format/src/sketch/path_tests.rs index fb03d74cc..70ad95275 100644 --- a/crates/format/src/sketch/path_tests.rs +++ b/crates/format/src/sketch/path_tests.rs @@ -165,3 +165,71 @@ fn huge_points_stay_finite() { assert!(network.segments.iter().all(|s| [s.ta.0, s.ta.1, s.tb.0, s.tb.1].iter().all(|c| c.is_finite()))); } } + +/// Sketch 51 and older: a shape group whose children have no operation (−1) is one compound path, +/// filled by the group's winding rule (stored on the layer itself). +#[test] +fn compound_shape_group_has_holes() { + let outer = with_op(rect("Outer", 0.0, 0.0, 100.0, 100.0), -1); + let inner = with_op(rect("Inner", 25.0, 25.0, 50.0, 50.0), -1); + let mut g = shape_group("Ring", 10.0, 10.0, 100.0, 100.0, vec![outer, inner]); + g["windingRule"] = json!(1); + let doc = open(vec![g]); + let n = node(&doc, "Ring"); + let NodeKind::Vector { network } = &n.kind else { panic!("not one vector: {:?}", n.kind) }; + assert_eq!(network.regions.len(), 1); + assert_eq!(network.regions[0].loops.len(), 2); + assert_eq!(network.regions[0].winding, figcraft_doc::WindingRule::EvenOdd); + let b = doc.world_bounds(n.id).unwrap(); + assert_eq!((b.x0, b.y0, b.width(), b.height()), (10.0, 10.0, 100.0, 100.0)); +} + +#[test] +fn compound_runs_are_boolean_operands() { + let a = with_op(rect("A", 0.0, 0.0, 50.0, 50.0), -1); + let b = with_op(rect("B", 60.0, 0.0, 20.0, 20.0), -1); + let c = with_op(rect("C", 10.0, 10.0, 10.0, 10.0), 1); + let doc = open(vec![shape_group("Mixed", 0.0, 0.0, 80.0, 50.0, vec![a, b, c])]); + let n = node(&doc, "Mixed"); + assert!(matches!(n.kind, NodeKind::BooleanOp { op: BoolOp::Subtract }), "{:?}", n.kind); + let first = doc.node(n.children[0]).unwrap(); + let NodeKind::Vector { network } = &first.kind else { panic!("first operand isn't the compound path") }; + assert_eq!(network.regions[0].loops.len(), 2); +} + +#[test] +fn layer_winding_rule_counts() { + let mut p = shape_path("Wound", 0.0, 0.0, 10.0, 10.0, &[(0.0, 0.0), (1.0, 0.0), (1.0, 1.0)], true); + p["windingRule"] = json!(1); + let doc = open(vec![p]); + let NodeKind::Vector { network } = &node(&doc, "Wound").kind else { panic!("not a vector") }; + assert_eq!(network.regions[0].winding, figcraft_doc::WindingRule::EvenOdd); +} + +/// Sketch fills an open path as if it were closed. +#[test] +fn filled_open_paths_are_closed() { + let open_path = shape_path("Lid", 0.0, 0.0, 40.0, 20.0, &[(0.0, 1.0), (0.5, 0.0), (1.0, 1.0)], false); + let filled = styled(shape_group("Filled", 0.0, 0.0, 40.0, 20.0, vec![open_path.clone()]), "fills", json!([solid_fill(0.0, 0.0, 0.0, 1.0)])); + let stroked = styled( + shape_group("Stroked", 0.0, 50.0, 40.0, 20.0, vec![open_path]), + "borders", + json!([{"_class": "border", "isEnabled": true, "fillType": 0, "color": color(0.0, 0.0, 0.0, 1.0), "position": 0, "thickness": 1}]), + ); + let doc = open(vec![filled, stroked]); + let NodeKind::Vector { network } = &node(&doc, "Filled").kind else { panic!("not a vector") }; + assert_eq!(network.regions.len(), 1); + assert_eq!(network.segments.len(), 3); + let NodeKind::Vector { network } = &node(&doc, "Stroked").kind else { panic!("not a vector") }; + assert!(network.regions.is_empty()); + assert_eq!(network.segments.len(), 2); +} + +#[test] +fn open_operands_of_booleans_are_closed() { + let a = with_op(rect("A", 0.0, 0.0, 50.0, 50.0), -1); + let b = with_op(shape_path("Snout", 40.0, 10.0, 30.0, 20.0, &[(0.0, 0.0), (1.0, 0.5), (0.0, 1.0)], false), 0); + let doc = open(vec![styled(shape_group("Head", 0.0, 0.0, 70.0, 50.0, vec![a, b]), "fills", json!([solid_fill(0.0, 0.0, 0.0, 1.0)]))]); + let NodeKind::Vector { network } = &node(&doc, "Snout").kind else { panic!("not a vector") }; + assert_eq!(network.regions.len(), 1); +} diff --git a/crates/format/src/sketch/style.rs b/crates/format/src/sketch/style.rs index de2529aac..f13515a6f 100644 --- a/crates/format/src/sketch/style.rs +++ b/crates/format/src/sketch/style.rs @@ -243,6 +243,21 @@ pub(crate) fn effects(cx: &mut Cx, style: &Value) -> Vec { out } +/// A bitmap's colour adjustments (`colorControls`: saturation and contrast 0–2 with 1 neutral, +/// brightness −1–1, hue in radians) as REST image filters; hue has no filter (a note). +pub(crate) fn color_controls(cx: &mut Cx, style: Option<&Value>) -> Option { + let c = style?.get("colorControls").filter(|c| c.get("isEnabled").and_then(Value::as_bool) == Some(true))?; + let get = |k: &str, neutral: f64| num(c, k).unwrap_or(neutral); + if get("hue", 0.0).abs() > 1e-6 { + cx.warn("hue changes of bitmaps were skipped"); + } + Some(json!({ + "saturation": (get("saturation", 1.0) - 1.0).clamp(-1.0, 1.0), + "contrast": (get("contrast", 1.0) - 1.0).clamp(-1.0, 1.0), + "exposure": get("brightness", 0.0).clamp(-1.0, 1.0), + })) +} + /// The variable binding of a colour that names a swatch the file has (`{color: alias}`). pub(crate) fn swatch(cx: &Cx, c: Option<&Value>) -> Option { let id = c?.get("swatchID").and_then(Value::as_str).filter(|id| cx.shared.has_swatch(id))?; diff --git a/crates/format/src/sketch/style_tests.rs b/crates/format/src/sketch/style_tests.rs index b1b2801b5..242b0478b 100644 --- a/crates/format/src/sketch/style_tests.rs +++ b/crates/format/src/sketch/style_tests.rs @@ -295,3 +295,22 @@ fn two_styled_masks_each_draw() { let first_group = node(&doc, "Mask1").parent.unwrap(); assert_ne!(copy.parent, Some(first_group)); } + +#[test] +fn bitmap_color_controls_become_filters() { + let png = { + let mut out = Vec::new(); + image::RgbaImage::new(2, 2).write_to(&mut std::io::Cursor::new(&mut out), image::ImageFormat::Png).unwrap(); + out + }; + let mut bitmap = r("Photo"); + bitmap["_class"] = json!("bitmap"); + bitmap["image"] = json!({"_class": "MSJSONFileReference", "_ref": "images/a.png"}); + bitmap["style"]["colorControls"] = + json!({"_class": "colorControls", "isEnabled": true, "brightness": 0, "contrast": 1, "hue": 0.5, "saturation": 0}); + let (doc, warnings) = open_doc(document(&["P"]), vec![bitmap], &[("images/a.png", &png)]); + let PaintKind::Image(img) = &node(&doc, "Photo").fills[0].kind else { panic!("no image") }; + assert_eq!(img.filters.saturation, -1.0); + assert_eq!(img.filters.contrast, 0.0); + assert!(warnings.iter().any(|w| w.contains("hue")), "{warnings:?}"); +} diff --git a/crates/format/src/sketch/symbols.rs b/crates/format/src/sketch/symbols.rs index b87b71381..cabc2fd49 100644 --- a/crates/format/src/sketch/symbols.rs +++ b/crates/format/src/sketch/symbols.rs @@ -155,7 +155,8 @@ pub(crate) fn instance(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, roo cx.warn(format!("symbol {name} contains itself; the inner copy was left out")); return None; } - if l.get("scale").and_then(Value::as_f64).is_some_and(|s| s.is_finite() && (s - 1.0).abs() > 1e-9) { + // Sketch 50 stores "not scaled" as 0. + if l.get("scale").and_then(Value::as_f64).is_some_and(|s| s.is_finite() && s != 0.0 && (s - 1.0).abs() > 1e-9) { cx.warn("scaled symbol instances were imported at their size, unscaled"); } let mut node = base(l, "INSTANCE", parent, world, w, h, root); diff --git a/crates/format/src/sketch/symbols_tests.rs b/crates/format/src/sketch/symbols_tests.rs index 4c98ebe2d..64c7ae7ff 100644 --- a/crates/format/src/sketch/symbols_tests.rs +++ b/crates/format/src/sketch/symbols_tests.rs @@ -217,3 +217,12 @@ fn override_fan_out_is_bounded() { let (_, warnings) = import(&z, "f").unwrap(); assert!(warnings.iter().any(|w| w.contains("expand")), "{warnings:?}"); } + +/// Sketch 50 stores "not scaled" as `scale: 0`. +#[test] +fn scale_zero_is_unscaled() { + let mut i = instance("I1", "S1", 0.0, 0.0, 100.0, 40.0, &[]); + i["scale"] = json!(0); + let (_, warnings) = open(vec![i], vec![button()]); + assert!(!warnings.iter().any(|w| w.contains("scaled")), "{warnings:?}"); +} diff --git a/crates/format/src/sketch/text.rs b/crates/format/src/sketch/text.rs index 3cdb2afc4..14357cfc9 100644 --- a/crates/format/src/sketch/text.rs +++ b/crates/format/src/sketch/text.rs @@ -93,6 +93,29 @@ pub(crate) fn node(cx: &mut Cx, l: &Value, node: &mut JsonMap) { } } +/// How far a text layer moves so its lines sit where Sketch draws them. With a fixed line height, +/// Sketch puts a line's extra height (line height − the font's own, taken as 1.2 × its size) above +/// the text (`lineSpacingBehaviour` 0) or below it (1); FigCraft, like Sketch's default (2), puts +/// half on each side. Every line gets the same extra, so the whole layer moves. +pub(crate) fn baseline_shift(l: &Value) -> f64 { + let first = l + .get("attributedString") + .and_then(|a| a.get("attributes")) + .and_then(Value::as_array) + .and_then(|r| r.first()) + .and_then(|r| r.get("attributes")); + let Some(a) = first else { return 0.0 }; + let size = a.get("MSAttributedStringFontAttribute").and_then(|f| f.get("attributes")).and_then(|f| f.get("size")).and_then(Value::as_f64); + let line = a.get("paragraphStyle").and_then(|p| p.get("maximumLineHeight").or_else(|| p.get("minimumLineHeight"))).and_then(Value::as_f64); + let (Some(size), Some(line)) = (size.filter(|s| s.is_finite() && *s > 0.0), line.filter(|v| v.is_finite() && *v > 0.0)) else { return 0.0 }; + let extra = (line - size * 1.2).clamp(-1e4, 1e4); + match l.get("lineSpacingBehaviour").and_then(Value::as_i64) { + Some(0) => extra / 2.0, + Some(1) => -extra / 2.0, + _ => 0.0, + } +} + /// A run's attributes as a REST type style (with its colour as `fills`). pub(crate) fn type_style(cx: &mut Cx, a: &Value) -> Value { let font = a.get("MSAttributedStringFontAttribute").and_then(|f| f.get("attributes")); diff --git a/crates/format/src/sketch/text_tests.rs b/crates/format/src/sketch/text_tests.rs index a7ee96b06..f6b967383 100644 --- a/crates/format/src/sketch/text_tests.rs +++ b/crates/format/src/sketch/text_tests.rs @@ -187,3 +187,23 @@ fn embedded_fonts_are_reported() { let w = warnings.iter().find(|w| w.contains("embedded")).expect("a note about embedded fonts"); assert!(w.contains("IBM Plex Mono") && w.contains("IBM Plex Sans"), "{w}"); } + +/// Where Sketch puts a line's extra height: above the text (`lineSpacingBehaviour` 0), below it +/// (1) or around it (2, like FigCraft); the text layer moves by the difference. +#[test] +fn line_spacing_behaviour_moves_text() { + let mk = |name: &str, beh: i64| { + let mut t = text(name, 0.0, 100.0, 100.0, 30.0, "Hg", &[(0, 2, "Helvetica", 14.0, BLACK)]); + t["lineSpacingBehaviour"] = json!(beh); + let a = &mut t["attributedString"]["attributes"][0]["attributes"]["paragraphStyle"]; + a["maximumLineHeight"] = json!(30); + a["minimumLineHeight"] = json!(30); + t + }; + let (doc, _) = open(vec![mk("B0", 0), mk("B1", 1), mk("B2", 2)]); + let y = |n: &str| doc.world_transform(doc.nodes().find(|x| x.name == n).unwrap().id).as_coeffs()[5]; + // Extra height: 30 − 14 × 1.2 = 13.2; half of it either way. + assert!((y("B2") - 100.0).abs() < 1e-6, "{}", y("B2")); + assert!((y("B0") - 106.6).abs() < 1e-6, "{}", y("B0")); + assert!((y("B1") - 93.4).abs() < 1e-6, "{}", y("B1")); +} diff --git a/crates/format/src/sketch/tree.rs b/crates/format/src/sketch/tree.rs index c1bf04328..6642eb9f1 100644 --- a/crates/format/src/sketch/tree.rs +++ b/crates/format/src/sketch/tree.rs @@ -43,6 +43,10 @@ pub(crate) struct Cx { pub max_work: u64, /// Notes given so far (each once). pub seen: std::collections::BTreeSet, + /// Inside a shape group: whether its shapes are filled (open ones then close) and whether the + /// group has a border. Outside one: `None` / false (a shape's own style decides). + pub operand_fill: Option, + pub operand_border: bool, /// The symbols being expanded, outermost first (a symbol inside itself stops there). pub chain: Vec, pub warnings: Vec, @@ -93,6 +97,8 @@ pub(crate) fn to_rest(archive: &Archive, name: &str, max_nodes: usize) -> Map { work: 0, max_work: MAX_WORK, seen: std::collections::BTreeSet::new(), + operand_fill: None, + operand_border: false, chain: Vec::new(), warnings: Vec::new(), networks: Vec::new(), @@ -154,6 +160,8 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: let ty = match class { "artboard" | "frame" => "FRAME", "group" | "graphic" => "GROUP", + // Shapes whose points were moved are paths. + "rectangle" | "oval" if bool_field(l, "edited") == Some(true) => "VECTOR", "rectangle" | "bitmap" => "RECTANGLE", "oval" => "ELLIPSE", "slice" => "SLICE", @@ -169,7 +177,10 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: return None; } let (w, h) = size(l); - let world = parent * local(l, w, h); + let mut world = parent * local(l, w, h); + if ty == "TEXT" { + world *= Affine::translate((0.0, super::text::baseline_shift(l))); + } let mut node = base(l, ty, parent, world, w, h, root); if ty == "TEXT" { super::text::node(cx, l, &mut node); @@ -192,7 +203,10 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: "rectangle" => corner_radii(l, &mut node), "bitmap" => match l.get("image").and_then(|i| str_field(i, "_ref")) { Some(r) => { - let paint = json!({"type": "IMAGE", "scaleMode": "STRETCH", "imageRef": r, "imageTransform": [[1, 0, 0], [0, 1, 0]]}); + let mut paint = json!({"type": "IMAGE", "scaleMode": "STRETCH", "imageRef": r, "imageTransform": [[1, 0, 0], [0, 1, 0]]}); + if let Some(f) = super::style::color_controls(cx, l.get("style")) { + paint["filters"] = f; + } node.insert("fills".into(), json!([paint])); } None => cx.warn("images stored inside the JSON were skipped"), @@ -281,7 +295,8 @@ pub(crate) fn size(l: &Value) -> (f64, f64) { } /// A layer's transform within its parent: its frame's position, then its rotation (degrees, -/// counter-clockwise on screen) and flips about its centre. +/// counter-clockwise on screen) and flips about its centre. Sketch flips on screen, after rotating +/// (a quarter-turned layer flipped left to right mirrors its own up and down). pub(crate) fn local(l: &Value, w: f64, h: f64) -> Affine { let f = l.get("frame"); let n = |k: &str| f.and_then(|f| f.get(k)).and_then(Value::as_f64).filter(|v| v.is_finite()).unwrap_or(0.0).clamp(-MAX_COORD, MAX_COORD); @@ -289,8 +304,8 @@ pub(crate) fn local(l: &Value, w: f64, h: f64) -> Affine { let sx = if bool_field(l, "isFlippedHorizontal") == Some(true) { -1.0 } else { 1.0 }; let sy = if bool_field(l, "isFlippedVertical") == Some(true) { -1.0 } else { 1.0 }; Affine::translate((n("x") + w / 2.0, n("y") + h / 2.0)) - * Affine::rotate(-rot.to_radians()) * Affine::scale_non_uniform(sx, sy) + * Affine::rotate(-rot.to_radians()) * Affine::translate((-w / 2.0, -h / 2.0)) } diff --git a/crates/format/src/sketch/tree_tests.rs b/crates/format/src/sketch/tree_tests.rs index 91aeba3a8..4b0ab5113 100644 --- a/crates/format/src/sketch/tree_tests.rs +++ b/crates/format/src/sketch/tree_tests.rs @@ -231,3 +231,28 @@ fn deep_document_json_still_opens_the_pages() { assert!(doc.pages.iter().any(|p| doc.node(*p).unwrap().name == "Kept")); assert!(!warnings.is_empty()); } + +/// Sketch flips a rotated layer on screen, after rotating it. +#[test] +fn flip_applies_after_rotation() { + let r = with(with(rect("Turned", 0.0, 0.0, 40.0, 20.0), "rotation", json!(90)), "isFlippedHorizontal", json!(true)); + let (doc, _) = open(vec![artboard("A", "Board", 0.0, 0.0, 300.0, 300.0, vec![r])]); + let t = doc.world_transform(node(&doc, "Turned").id).as_coeffs(); + // Rotated a quarter turn counter-clockwise (x → up, y → right), then mirrored left to right. + assert!(t[0].abs() < 1e-9 && (t[1] + 1.0).abs() < 1e-9 && (t[2] + 1.0).abs() < 1e-9 && t[3].abs() < 1e-9, "{t:?}"); +} + +#[test] +fn edited_shapes_keep_their_points() { + let mut drop = rect("Drop", 0.0, 0.0, 20.0, 30.0); + drop["_class"] = json!("oval"); + drop["edited"] = json!(true); + drop["points"] = json!([point(0.5, 0.0), point(1.0, 0.7), point(0.5, 1.0), point(0.0, 0.7)]); + let mut box_ = rect("Slanted", 50.0, 0.0, 20.0, 20.0); + box_["edited"] = json!(true); + box_["points"][1]["point"] = json!("{1, 0.3}"); + let (doc, _) = open(vec![artboard("A", "Board", 0.0, 0.0, 300.0, 300.0, vec![drop, box_])]); + let NodeKind::Vector { network } = &node(&doc, "Drop").kind else { panic!("not a vector") }; + assert_eq!((network.vertices[0].x, network.vertices[0].y), (10.0, 0.0)); + assert!(matches!(node(&doc, "Slanted").kind, NodeKind::Vector { .. })); +} diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index ed2d31577..508cd12a3 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -18,7 +18,7 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| | `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included; a flow that records no primary-axis sizing hugs on that axis, an instance that records no auto layout has its main's), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Since 2026-10-17 (community batches #727, #728): an instance's own identity and the cached library components a file carries, overrides applied by key and order, local text values and instance overrides over a shared text style, grid track sizes (fixed, content-sized, fill), slot content, labels of connectors saved with their drawn path (a static snapshot; the ends aren't live), skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, editable text on a path, image adjustments and images carried in the message. Budgets come from the file's own size (one value per compressed byte, 20M–128M, lower ceilings on 32-bit targets; the layer cap follows), so a 15.4 MB synthetic file with 300,000 layers opens whole; the file's bytes stay out of the command journal; an import report lists what was left out or changed once the file opens. Not read: elbowed or curved connectors without a saved path (drawn straight) and labels of connectors without a saved snapshot, table cells beyond their own layers, filled areas with their own fills, variables bound to fields the editor can't bind, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs` and the per-feature `*_tests.rs` beside them, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | -| `.sketch` (Sketch 48 and newer) | — (Figma's own Sketch import runs in its web app) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards (and Sketch 2025 frames) as frames with their background, groups, rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape or as boolean operations (mixed operations nested from the left), bitmaps, slices, hotspots; transforms (rotation, flips), resizing constraints; fills (solid, gradients, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (a mask that shows its own style draws a copy under itself, as Sketch does; broken mask chains wrapped); text with styled runs (UTF-16 ranges), paragraph and vertical alignment, box sizing, fonts from PostScript names matched to installed families; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), resized by their constraints and still live; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids. Warnings: noise fills, motion and zoom blurs, embedded fonts (not used), Smart Layout and stacks (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (80,000 layers open in ~4 s, debug build); Sketch 2025 files on fixtures only | 5–10 (Smart Layout as auto layout, real Sketch 2025 files) | +| `.sketch` (Sketch 48 and newer) | — (Figma's own Sketch import runs in its web app) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards (and Sketch 2025 frames) as frames with their background, groups, rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (a mask that shows its own style draws a copy under itself, as Sketch does; broken mask chains wrapped); text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts from PostScript names matched to installed families; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), resized by their constraints and still live; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids. Warnings: noise fills, motion and zoom blurs, embedded fonts (not used), Smart Layout and stacks (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (70,000 layers open in ~3 s, debug build); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 70 in at most 4.4%; Sketch 2025 files on fixtures only | 5–10 (Smart Layout as auto layout, real Sketch 2025 files) | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | | REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout (sizing modes left out read as hug, as documented; grid track sizes from `gridColumnsSizing` / `gridRowsSizing`: px, fr, auto, `minmax(0, 1fr)`, `repeat()`), constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, slots (`SLOT` layers bound to their slot property; an instance's slot keeps its content as the instance's own unless its property value is the main's default content; slot limits and preferred components are warnings), styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings, image adjustments (the same tint sign as `.fig`); the import report after opening; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | From ad78ee94c383e1f86ea6ca689879a3a6be88359f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 21:55:34 +0200 Subject: [PATCH 487/817] M6: Sketch import: instances, artboards and Apple fonts like Sketch Compared with Sketch's renders of a Sketch 64 file. Resized instances lay out their layers the way Sketch does (measured: pins share the change in proportion, a fixed size keeps its centre's share, and files before format 110 just scale); masters' backgrounds show in instances only when Sketch includes them; swaps to a missing symbol keep the original; artboards don't draw a style they carry. Apple's system fonts are found under the names designs use (SF Pro, SF UI Text and Display, SF Compact), the optical size follows the text size for named styles too, and imported text keeps the platform's trak tracking as letter spacing. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/file.rs | 39 ++++++++ crates/engine/src/sketch_import_tests.rs | 26 ++++- crates/format/src/sketch/mod.rs | 25 +---- crates/format/src/sketch/symbols.rs | 75 +++++++++++++-- crates/format/src/sketch/symbols_tests.rs | 79 ++++++++++++++- crates/format/src/sketch/text.rs | 2 + crates/format/src/sketch/text_tests.rs | 4 + crates/format/src/sketch/tree.rs | 10 ++ crates/format/src/sketch/tree_tests.rs | 18 +++- crates/text/src/fontdb.rs | 112 ++++++++++++++++++++-- crates/text/src/fontdb_tests.rs | 61 ++++++++++++ docs/file-format-parity.md | 2 +- 12 files changed, 413 insertions(+), 40 deletions(-) diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index 179f1c063..c6f892c16 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -558,7 +558,11 @@ fn load_with( fn load_sketch(bytes: &[u8], name: &str) -> Option> { let r = figcraft_format::sketch::try_import(bytes, name)?; Some(r.map_err(|e| EngineError::Other(e.to_string())).map(|(mut doc, warnings)| { + // Both read the installed fonts: the system's must be known first (the desktop app scans + // them in the background; this waits for that scan). + figcraft_text::fontdb::scan_system_fonts(); match_font_families(&mut doc); + platform_tracking(&mut doc); link_instances(&mut doc); figcraft_format::Loaded { issues: warnings, ..doc.into() } })) @@ -587,6 +591,41 @@ fn match_font_families(doc: &mut Document) { } } +/// Sketch draws text with the tracking a font's `trak` table gives at its size (Apple's text engine +/// adds it; FigCraft's, like Figma's, doesn't): the imported text keeps it as letter spacing, so +/// lines measure and break as they did there. +fn platform_tracking(doc: &mut Document) { + let mut cache: std::collections::BTreeMap<(String, String), Option>> = + std::collections::BTreeMap::new(); + let mut face = |style: &figcraft_doc::TextStyle| { + cache + .entry((style.font_family.clone(), style.font_style.clone())) + .or_insert_with(|| { + figcraft_text::fontdb::has_family(&style.font_family) + .then(|| figcraft_text::fontdb::find_face(&style.font_family, &style.font_style)) + .flatten() + }) + .clone() + }; + let mut track = |style: &mut figcraft_doc::TextStyle| { + let Some(f) = face(style) else { return }; + let t = f.tracking(style.font_size); + if t != 0.0 && t.is_finite() { + let px = style.letter_spacing.resolve(style.font_size); + style.letter_spacing = figcraft_doc::LetterSpacing::Pixels(px + t); + } + }; + let ids: Vec = doc.nodes().filter(|n| matches!(n.kind, NodeKind::Text(_))).map(|n| n.id).collect(); + for id in ids { + if let Some(NodeKind::Text(td)) = doc.node_mut(id).map(|n| &mut n.kind) { + track(&mut td.style); + for r in &mut td.runs { + track(&mut r.style); + } + } + } +} + /// The installed family `family` means when it isn't installed under that exact name: the one /// whose name is the same without spaces, ignoring case. pub(crate) fn installed_family(family: &str, installed: &[String]) -> Option { diff --git a/crates/engine/src/sketch_import_tests.rs b/crates/engine/src/sketch_import_tests.rs index cee351b88..d78db77c5 100644 --- a/crates/engine/src/sketch_import_tests.rs +++ b/crates/engine/src/sketch_import_tests.rs @@ -25,7 +25,9 @@ fn sketch_with(app_version: &str, pages: &[(&str, &str)], layers: &[Value]) -> V z.start_file("document.json", o).unwrap(); z.write_all(json!({"_class": "document", "pages": refs}).to_string().as_bytes()).unwrap(); z.start_file("meta.json", o).unwrap(); - z.write_all(json!({"app": "com.bohemiancoding.sketch3", "appVersion": app_version, "version": 103}).to_string().as_bytes()).unwrap(); + // The format version that Sketch writes (103 for 50; 110 and up from 52). + let version = if app_version.split('.').next().and_then(|v| v.parse::().ok()).is_some_and(|v| v >= 52) { 125 } else { 103 }; + z.write_all(json!({"app": "com.bohemiancoding.sketch3", "appVersion": app_version, "version": version}).to_string().as_bytes()).unwrap(); for (i, (id, name)) in pages.iter().enumerate() { let ls = if i == 0 { layers.to_vec() } else { Vec::new() }; z.start_file(format!("pages/{id}.json"), o).unwrap(); @@ -154,7 +156,7 @@ fn sketch_instances_stay_live() { let tag = shape("rectangle", "Tag", [80.0, 0.0, 20.0, 40.0], json!({"resizingConstraint": 60, "points": []})); let master = shape("symbolMaster", "Bar", [0.0, 0.0, 100.0, 40.0], json!({"symbolID": "S", "layers": [tag]})); let inst = shape("symbolInstance", "Wide", [0.0, 100.0, 200.0, 40.0], json!({"symbolID": "S", "overrideValues": []})); - let data = base64::engine::general_purpose::STANDARD.encode(sketch_with("50.2", &[("A", "Page")], &[master, inst])); + let data = base64::engine::general_purpose::STANDARD.encode(sketch_with("64", &[("A", "Page")], &[master, inst])); let mut s = Session::new(); s.execute("file.open", &json!({"data": data, "name": "x.sketch"})).unwrap(); let find = |s: &Session, inst: bool| { @@ -304,3 +306,23 @@ fn local_sketch_samples_match_sketch() { worst.sort_by(|a, b| b.0.total_cmp(&a.0)); assert!(worst.first().is_none_or(|w| w.0 < 10.0), "{worst:?}"); } + +/// Sketch draws Apple's fonts with the tracking their `trak` table gives at each size (the +/// platform does it on its own); the imported text carries it as letter spacing (macOS only). +#[test] +fn sketch_text_keeps_the_platform_tracking() { + if !std::path::Path::new("/System/Library/Fonts/SFNS.ttf").exists() { + return; + } + figcraft_text::fontdb::scan_system_fonts(); + let font = json!({"name": "SFUIText-Regular", "size": 13}); + let run = json!({"location": 0, "length": 2, "attributes": {"MSAttributedStringFontAttribute": {"attributes": font}}}); + let t = shape("text", "Label", [0.0, 0.0, 100.0, 20.0], json!({"attributedString": {"string": "Hi", "attributes": [run]}, "textBehaviour": 0})); + let data = base64::engine::general_purpose::STANDARD.encode(sketch_with("64", &[("A", "Page")], &[t])); + let mut s = Session::new(); + s.execute("file.open", &json!({"data": data, "name": "x.sketch"})).unwrap(); + let doc = s.doc().unwrap(); + let NodeKind::Text(td) = &doc.nodes().find(|n| n.name == "Label").unwrap().kind else { panic!("not text") }; + let ls = td.style.letter_spacing.resolve(13.0); + assert!((ls - (-12.0 * 13.0 / 2048.0)).abs() < 1e-6, "{ls}"); +} diff --git a/crates/format/src/sketch/mod.rs b/crates/format/src/sketch/mod.rs index 3c64b4094..576dbe062 100644 --- a/crates/format/src/sketch/mod.rs +++ b/crates/format/src/sketch/mod.rs @@ -120,7 +120,6 @@ fn import_parts(bytes: &[u8], name: &str, max_member: u64, max_nodes: usize) -> if archive.document.get("colorSpace").and_then(Value::as_i64) == Some(2) { doc.color_profile = figcraft_doc::color::ColorProfile::DisplayP3; } - fit_instances(&mut doc); warnings.extend(more); Ok((doc, warnings)) } @@ -138,25 +137,6 @@ fn embedded_fonts(document: &Value) -> Option { Some(format!("the file has embedded fonts FigCraft doesn't use ({}); install them to see the text as designed", list.join(", "))) } -/// Instances come in with their master's layers laid out at the master's size; resized ones lay -/// them out for their own size by their constraints, innermost first. -fn fit_instances(doc: &mut Document) { - let mut insts: Vec<(usize, figcraft_doc::NodeId, f64, f64)> = doc - .nodes() - .filter_map(|n| match n.kind { - figcraft_doc::NodeKind::Instance { component, .. } => { - let c = doc.node(component)?; - Some((doc.ancestors(n.id).len(), n.id, c.width, c.height)) - } - _ => None, - }) - .collect(); - insts.sort_by_key(|i| std::cmp::Reverse(i.0)); - for (_, id, w, h) in insts { - figcraft_layout::apply_constraints(doc, id, w, h); - } -} - fn corrupt(msg: impl Into) -> FormatError { FormatError::Corrupt(format!("Sketch file: {}", msg.into())) } @@ -164,6 +144,8 @@ fn corrupt(msg: impl Into) -> FormatError { /// The parts of a `.sketch` archive: the document, the pages in document order and the images. pub(crate) struct Archive<'b> { pub document: Value, + /// `meta.json`'s format version (0 when missing). + pub version: u64, /// `(id, page JSON)` in the document's order. pub pages: Vec<(String, Value)>, /// Problems met while reading (pages skipped). @@ -220,7 +202,8 @@ impl<'b> Archive<'b> { if refs.len() > MAX_PAGES { warnings.push(format!("the file has more than {MAX_PAGES} pages; the rest were skipped")); } - Ok(Archive { document, pages, warnings, zip: z }) + let version = meta.get("version").and_then(Value::as_u64).unwrap_or(0); + Ok(Archive { document, version, pages, warnings, zip: z }) } /// The bytes of the image a layer references (`images/`). diff --git a/crates/format/src/sketch/symbols.rs b/crates/format/src/sketch/symbols.rs index cabc2fd49..1292c0254 100644 --- a/crates/format/src/sketch/symbols.rs +++ b/crates/format/src/sketch/symbols.rs @@ -162,7 +162,10 @@ pub(crate) fn instance(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, roo let mut node = base(l, "INSTANCE", parent, world, w, h, root); node.insert("componentId".into(), json!(str_field(&m, "do_objectID").unwrap_or(sid))); node.insert("clipsContent".into(), json!(true)); - if let Some(f) = master_fills(&m) { + // Instances show the master's background only when it says so. + if bool_field(&m, "includeBackgroundColorInInstance") == Some(true) + && let Some(f) = master_fills(&m) + { node.insert("fills".into(), f); } if let Some(st) = l.get("style") { @@ -176,7 +179,7 @@ pub(crate) fn instance(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, roo let mut copy = m; let mut budget = cx.work_left(); if let Some(layers) = copy.get_mut("layers").and_then(Value::as_array_mut) { - apply(layers, &overrides, &nested, &cx.shared, 0, &mut budget); + apply(layers, &overrides, &nested, &cx.shared, &cx.symbols, 0, &mut budget); } let used = cx.work_left().saturating_sub(budget); cx.spend(used); @@ -184,9 +187,15 @@ pub(crate) fn instance(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, roo // The budget ran out handing overrides on: noted. cx.spend(1); } + // The master's layers laid out for the instance's size, as Sketch does it. let (mw, mh) = size(©); + if ((mw - w).abs() > 1e-9 || (mh - h).abs() > 1e-9) + && let Some(layers) = copy.get_mut("layers").and_then(Value::as_array_mut) + { + resize(layers, (mw, mh), (w, h), cx.legacy_resize, 0); + } cx.chain.push(sid.to_string()); - let mut kids = children(cx, ©, world, (mw, mh), depth, false); + let mut kids = children(cx, ©, world, (w, h), depth, false); cx.chain.pop(); let prefix = str_field(l, "do_objectID").unwrap_or("I").to_string(); for k in &mut kids { @@ -196,6 +205,58 @@ pub(crate) fn instance(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, roo Some(Value::Object(node)) } +/// Lay `layers` (the children of a box of `old` size) out for the box at `new` size, the way Sketch +/// resizes a symbol instance's layers: groups pass the change on to their own layers. Files older +/// than format 110 scale everything; newer ones follow each layer's `resizingConstraint`. +fn resize(layers: &mut [Value], old: (f64, f64), new: (f64, f64), legacy: bool, depth: usize) { + if depth > 64 { + return; + } + for l in layers { + let mask = if legacy { 63 } else { l.get("resizingConstraint").and_then(Value::as_i64).unwrap_or(63) }; + let Some(f) = l.get_mut("frame").and_then(Value::as_object_mut) else { continue }; + let n = |k: &str| f.get(k).and_then(Value::as_f64).filter(|v| v.is_finite()).unwrap_or(0.0); + let (x, y, w, h) = (n("x"), n("y"), n("width").max(0.0), n("height").max(0.0)); + // A cleared bit pins: right 1, width 2, left 4, bottom 8, height 16, top 32. + let pinned = |bit: i64| mask & bit == 0; + let (nx, nw) = resize_axis(x, w, old.0, new.0, (pinned(4), pinned(2), pinned(1))); + let (ny, nh) = resize_axis(y, h, old.1, new.1, (pinned(32), pinned(16), pinned(8))); + for (k, v) in [("x", nx), ("y", ny), ("width", nw), ("height", nh)] { + f.insert(k.into(), json!(v)); + } + if let Some(kids) = l.get_mut("layers").and_then(Value::as_array_mut) { + resize(kids, (w, h), (nw, nh), legacy, depth + 1); + } + } +} + +/// One axis of [`resize`]: a layer at `pos` of `size` in a parent going from `old` to `new`, with +/// its start, size and end pinned or not. Nothing pinned (or everything): it scales. One side +/// pinned: the size and the free side share the change, in proportion to their lengths. Only the +/// size fixed: its centre scales. Both sides pinned: the size takes the change. +fn resize_axis(pos: f64, size: f64, old: f64, new: f64, (start, fixed, end): (bool, bool, bool)) -> (f64, f64) { + if old <= 1e-9 || !new.is_finite() { + return (pos, size); + } + let k = new / old; + let d = new - old; + let far = old - pos - size; + let share = |part: f64, other: f64| if part + other > 1e-9 { d * part / (part + other) } else { d }; + let (p, s) = match (start, fixed, end) { + (true, false, false) => (pos, size + share(size, far)), + (false, false, true) => { + let s = size + share(size, pos); + (new - far - s, s) + } + (false, true, false) => ((pos + size / 2.0) * k - size / 2.0, size), + (true, false, true) => (pos, size + d), + (true, true, false) => (pos, size), + (false, true, true) => (new - far - size, size), + _ => (pos * k, size * k), + }; + (if p.is_finite() { p } else { pos }, if s.is_finite() { s.max(0.0) } else { size }) +} + /// An instance's overrides by name (`_` → value). fn overrides(l: &Value) -> BTreeMap { l.get("overrideValues") @@ -229,6 +290,7 @@ fn apply( ov: &BTreeMap, nested: &BTreeMap<&str, Vec<(&str, &Value)>>, shared: &Shared, + symbols: &Symbols, depth: usize, budget: &mut u64, ) { @@ -242,8 +304,9 @@ fn apply( Some("symbolInstance") => { match get("symbolID").map(|v| v.as_str().unwrap_or("")) { Some("") => l["isVisible"] = json!(false), - Some(other) => l["symbolID"] = json!(other), - None => {} + // A swap to a symbol the file doesn't have keeps the original, as in Sketch. + Some(other) if symbols.master(other).is_some() => l["symbolID"] = json!(other), + _ => {} } let inner = nested.get(id.as_str()).map(Vec::as_slice).unwrap_or_default(); let take = usize::try_from(*budget / OVERRIDE_COST).unwrap_or(usize::MAX).min(inner.len()); @@ -289,7 +352,7 @@ fn apply( } } if let Some(kids) = l.get_mut("layers").and_then(Value::as_array_mut) { - apply(kids, ov, nested, shared, depth + 1, budget); + apply(kids, ov, nested, shared, symbols, depth + 1, budget); } } } diff --git a/crates/format/src/sketch/symbols_tests.rs b/crates/format/src/sketch/symbols_tests.rs index 64c7ae7ff..7c2d73db4 100644 --- a/crates/format/src/sketch/symbols_tests.rs +++ b/crates/format/src/sketch/symbols_tests.rs @@ -14,6 +14,12 @@ fn open_doc(doc_json: Value, layers: Vec, masters: Vec) -> (Docume import(&z, "f").unwrap() } +/// [`open`] for a file saved by another Sketch. +fn open_version(app: &str, version: u64, layers: Vec, masters: Vec) -> (Document, Vec) { + let z = sketch_zip(app, version, document(&["P", "S"]), &[page("P", "Page", layers), page("S", "Symbols", masters)], &[]); + import(&z, "f").unwrap() +} + fn open(layers: Vec, masters: Vec) -> (Document, Vec) { let mut d = document(&["P", "S"]); d["do_objectID"] = json!("DOC"); @@ -154,10 +160,10 @@ fn instance_explosion_is_bounded() { #[test] fn resized_instance_follows_constraints() { - // Pinned right with a fixed width (bits 1 and 2 cleared). + // Pinned right with a fixed width (bits 1 and 2 cleared); a Sketch 64 file. let pinned = with(rect("Tag", 80.0, 0.0, 20.0, 40.0), "resizingConstraint", json!(60)); let m = master("M", "S", "Bar", 100.0, 40.0, vec![pinned]); - let (doc, _) = open(vec![instance("Wide", "S", 0.0, 0.0, 200.0, 40.0, &[])], vec![m]); + let (doc, _) = open_version("64", 125, vec![instance("Wide", "S", 0.0, 0.0, 200.0, 40.0, &[])], vec![m]); let (inst, _) = instance_of(&doc, "Wide"); let tag = inside(&doc, inst, "Tag"); let b = doc.world_bounds(tag.id).unwrap(); @@ -226,3 +232,72 @@ fn scale_zero_is_unscaled() { let (_, warnings) = open(vec![i], vec![button()]); assert!(!warnings.iter().any(|w| w.contains("scaled")), "{warnings:?}"); } + +/// A master's background shows in its instances only when Sketch says so. +#[test] +fn master_background_in_instances_only_when_included() { + let bg = |id: &str, sid: &str, include: bool| { + let mut m = master(id, sid, id, 20.0, 20.0, vec![]); + m["hasBackgroundColor"] = json!(true); + m["backgroundColor"] = json!({"_class": "color", "red": 0, "green": 0, "blue": 0, "alpha": 1}); + m["includeBackgroundColorInInstance"] = json!(include); + m + }; + let (doc, _) = open( + vec![instance("Hidden", "SH", 0.0, 0.0, 20.0, 20.0, &[]), instance("Shown", "SS", 50.0, 0.0, 20.0, 20.0, &[])], + vec![bg("MH", "SH", false), bg("MS", "SS", true)], + ); + let (hidden, main) = instance_of(&doc, "Hidden"); + assert!(hidden.fills.is_empty(), "{:?}", hidden.fills); + assert_eq!(main.fills.len(), 1, "the master shows its background"); + assert_eq!(instance_of(&doc, "Shown").0.fills.len(), 1); +} + +/// How Sketch lays out a resized instance's layers, measured on its renders: a master of 200×100 +/// with a 100×40 rectangle at (20, 30), shown at 320×60. +#[test] +fn resized_instances_lay_out_like_sketch() { + let case = |mask: i64, version: u64| { + let r = with(rect("R", 20.0, 30.0, 100.0, 40.0), "resizingConstraint", json!(mask)); + let m = master("M", "S", "Box", 200.0, 100.0, vec![r]); + let (doc, _) = open_version("64", version, vec![instance("I", "S", 0.0, 0.0, 320.0, 60.0, &[])], vec![m]); + let (inst, _) = instance_of(&doc, "I"); + let b = doc.world_bounds(inside(&doc, inst, "R").id).unwrap(); + (b.x0, b.y0, b.width(), b.height()) + }; + let near = |a: (f64, f64, f64, f64), b: (f64, f64, f64, f64)| { + (a.0 - b.0).abs() < 0.5 && (a.1 - b.1).abs() < 0.5 && (a.2 - b.2).abs() < 0.5 && (a.3 - b.3).abs() < 0.5 + }; + // Sketch 52 and newer (format 110+). + for (mask, want) in [ + (63, (32.0, 18.0, 160.0, 24.0)), + (59, (20.0, 18.0, 166.67, 24.0)), + (62, (40.0, 18.0, 200.0, 24.0)), + (61, (62.0, 18.0, 100.0, 24.0)), + (58, (20.0, 18.0, 220.0, 24.0)), + (57, (20.0, 18.0, 100.0, 24.0)), + (60, (140.0, 18.0, 100.0, 24.0)), + (54, (40.0, 12.86, 200.0, 17.14)), + (0, (32.0, 18.0, 160.0, 24.0)), + (47, (32.0, 10.0, 160.0, 40.0)), + ] { + let got = case(mask, 125); + assert!(near(got, want), "mask {mask}: {got:?} vs {want:?}"); + } + // Older files: everything scales. + for mask in [59, 62, 61, 0] { + let got = case(mask, 103); + assert!(near(got, (32.0, 18.0, 160.0, 24.0)), "legacy mask {mask}: {got:?}"); + } +} + +/// A nested swap to a symbol the file doesn't have keeps the original, as Sketch shows it. +#[test] +fn swap_to_a_missing_symbol_keeps_the_original() { + let icon = master("MA", "SA", "Icon A", 20.0, 20.0, vec![rect("Dot A", 0.0, 0.0, 20.0, 20.0)]); + let card = master("MC", "SC", "Card", 100.0, 40.0, vec![instance("N", "SA", 0.0, 0.0, 20.0, 20.0, &[])]); + let (doc, warnings) = open(vec![instance("I", "SC", 0.0, 0.0, 100.0, 40.0, &[("N_symbolID", json!("GONE"))])], vec![icon, card]); + let (inst, _) = instance_of(&doc, "I"); + assert!(doc.subtree(inst.id).into_iter().filter_map(|i| doc.node(i)).any(|n| n.name == "Dot A")); + assert!(!warnings.iter().any(|w| w.contains("empty frames")), "{warnings:?}"); +} diff --git a/crates/format/src/sketch/text.rs b/crates/format/src/sketch/text.rs index 14357cfc9..e1f0c2633 100644 --- a/crates/format/src/sketch/text.rs +++ b/crates/format/src/sketch/text.rs @@ -170,6 +170,8 @@ pub(crate) fn font_name(ps: &str) -> (String, String) { ".SFNSDisplay" | ".SFUIDisplay" | "SanFranciscoDisplay" | ".SFProDisplay" => "SF Pro Display".into(), // Apple's CJK families whose names don't split at case changes. "PingFangSC" | "PingFangTC" | "PingFangHK" => format!("PingFang {}", family.get(8..).unwrap_or("")), + // Apple's SF families: "SF" and then words ("SFUIText" → "SF UI Text"). + f if f.starts_with("SF") && f.chars().nth(2).is_some_and(char::is_uppercase) => format!("SF {}", words(f.get(2..).unwrap_or(""))), f => words(f.trim_start_matches('.')), }; (family, style) diff --git a/crates/format/src/sketch/text_tests.rs b/crates/format/src/sketch/text_tests.rs index f6b967383..41b86f685 100644 --- a/crates/format/src/sketch/text_tests.rs +++ b/crates/format/src/sketch/text_tests.rs @@ -152,6 +152,10 @@ fn font_names() { (".SFNSDisplay-Bold", "SF Pro Display", "Bold"), ("SanFranciscoText-Semibold", "SF Pro Text", "Semi Bold"), ("Impact", "Impact", "Regular"), + ("SFUIText-Semibold", "SF UI Text", "Semi Bold"), + ("SFUIDisplay-Regular", "SF UI Display", "Regular"), + ("SFCompactDisplay-Semibold", "SF Compact Display", "Semi Bold"), + ("SFProText-Bold", "SF Pro Text", "Bold"), ("IBMPlexSans-MediumItalic", "IBM Plex Sans", "Medium Italic"), ("Roboto-Italic", "Roboto", "Italic"), ("", "Helvetica", "Regular"), diff --git a/crates/format/src/sketch/tree.rs b/crates/format/src/sketch/tree.rs index 6642eb9f1..9a5bfaa33 100644 --- a/crates/format/src/sketch/tree.rs +++ b/crates/format/src/sketch/tree.rs @@ -47,6 +47,9 @@ pub(crate) struct Cx { /// group has a border. Outside one: `None` / false (a shape's own style decides). pub operand_fill: Option, pub operand_border: bool, + /// The file is older than format 110 (Sketch 52): Sketch scales a resized instance's layers + /// instead of following their pins. + pub legacy_resize: bool, /// The symbols being expanded, outermost first (a symbol inside itself stops there). pub chain: Vec, pub warnings: Vec, @@ -99,6 +102,7 @@ pub(crate) fn to_rest(archive: &Archive, name: &str, max_nodes: usize) -> Map { seen: std::collections::BTreeSet::new(), operand_fill: None, operand_border: false, + legacy_resize: archive.version > 0 && archive.version < 110, chain: Vec::new(), warnings: Vec::new(), networks: Vec::new(), @@ -228,6 +232,10 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: /// Layer `l`'s style into `node`, and its links to the styles made from its shared style. pub(crate) fn styles(cx: &mut Cx, l: &Value, w: f64, h: f64, node: &mut JsonMap) { + // An artboard shows its background colour only; Sketch doesn't draw a style it carries. + if str_field(l, "_class") == Some("artboard") { + return; + } if let Some(st) = l.get("style") { super::style::apply(cx, st, w, h, node); } @@ -315,6 +323,8 @@ pub(crate) fn local(l: &Value, w: f64, h: f64) -> Affine { fn constraints(mask: i64) -> Value { let pinned = |bit: i64| mask & bit == 0; let axis = |low: i64, size: i64, high: i64, low_name: &str, high_name: &str, both: &str| match (pinned(low), pinned(high)) { + // Both sides and the size pinned can't all hold: Sketch scales such a layer. + (true, true) if pinned(size) => "SCALE".into(), (true, true) => both.to_string(), (true, false) => low_name.to_string(), (false, true) => high_name.to_string(), diff --git a/crates/format/src/sketch/tree_tests.rs b/crates/format/src/sketch/tree_tests.rs index 4b0ab5113..5399a3df5 100644 --- a/crates/format/src/sketch/tree_tests.rs +++ b/crates/format/src/sketch/tree_tests.rs @@ -82,7 +82,8 @@ fn resizing_constraint_bits() { (63 - 8 - 32, H::Scale, V::TopBottom), (63 - 2 - 16, H::Center, V::Center), (63 - 1 - 2, H::Right, V::Scale), - (0, H::LeftRight, V::TopBottom), + // Everything pinned is over-constrained: Sketch scales it. + (0, H::Scale, V::Scale), ]; let layers: Vec = cases .iter() @@ -256,3 +257,18 @@ fn edited_shapes_keep_their_points() { assert_eq!((network.vertices[0].x, network.vertices[0].y), (10.0, 0.0)); assert!(matches!(node(&doc, "Slanted").kind, NodeKind::Vector { .. })); } + +/// Sketch draws an artboard's background colour only; a style it may carry (borders, shadows) isn't +/// drawn. Sketch 2025 frames do draw theirs. +#[test] +fn artboards_ignore_their_style() { + let border = json!([{"_class": "border", "isEnabled": true, "fillType": 0, "color": {"_class": "color", "red": 0, "green": 0, "blue": 0, "alpha": 1}, "position": 2, "thickness": 1}]); + let mut a = artboard("A", "Board", 0.0, 0.0, 100.0, 100.0, vec![]); + a["style"]["borders"] = border.clone(); + let mut f = artboard("F", "Frame", 200.0, 0.0, 100.0, 100.0, vec![]); + f["_class"] = json!("frame"); + f["style"]["borders"] = border; + let (doc, _) = open(vec![a, f]); + assert!(node(&doc, "Board").strokes.is_empty()); + assert_eq!(node(&doc, "Frame").strokes.len(), 1); +} diff --git a/crates/text/src/fontdb.rs b/crates/text/src/fontdb.rs index 604f3eee5..22ca4b84b 100644 --- a/crates/text/src/fontdb.rs +++ b/crates/text/src/fontdb.rs @@ -106,6 +106,8 @@ pub struct Face { /// Variation axes (empty for static fonts) and named instances. pub axes: Vec, pub instances: Vec, + /// The `trak` table's normal track: (size in points, tracking in font units), by size. + track: Vec<(f64, f64)>, charmap: HashMap, outlines: Mutex>>, advances: Mutex>, @@ -123,6 +125,29 @@ impl std::fmt::Debug for Face { } impl Face { + /// The tracking the font's `trak` table gives text of `size` (pixels per glyph; 0 without a + /// table): Apple's platform text engine adds it on its own, FigCraft's doesn't. + pub fn tracking(&self, size: f64) -> f64 { + let (Some(first), Some(last)) = (self.track.first(), self.track.last()) else { return 0.0 }; + if !size.is_finite() || self.upem <= 0.0 { + return 0.0; + } + let units = if size <= first.0 { + first.1 + } else if size >= last.0 { + last.1 + } else { + self.track + .windows(2) + .find_map(|w| match w { + [a, b] if size >= a.0 && size <= b.0 && b.0 > a.0 => Some(a.1 + (b.1 - a.1) * (size - a.0) / (b.0 - a.0)), + _ => None, + }) + .unwrap_or(0.0) + }; + units * size / self.upem + } + pub fn from_bytes(bytes: FontBytes, index: u32, family_override: Option<&str>, style_override: Option<&str>) -> Option { let data = bytes.data(); let f = skrifa::FontRef::from_index(data, index).ok()?; @@ -147,6 +172,7 @@ impl Face { let charmap: HashMap = f.charmap().mappings().map(|(c, g)| (c, g.to_u32())).collect(); let (axes, instances) = variation_info(&f); let has_table = |tag: &[u8; 4]| f.data_for_tag(skrifa::Tag::new(tag)).is_some(); + let track = f.data_for_tag(skrifa::Tag::new(b"trak")).map(|t| normal_track(t.as_bytes())).unwrap_or_default(); let bitmap_strikes = has_table(b"sbix") || has_table(b"CBDT") || has_table(b"EBDT"); let colr = has_table(b"COLR"); let under = m.underline.map(|d| (f64::from(d.offset), f64::from(d.thickness))).unwrap_or((-upem * 0.1, upem * 0.06)); @@ -173,6 +199,7 @@ impl Face { strike_pos: strike, shaper, gsub_features, + track, axes, instances, charmap, @@ -287,6 +314,12 @@ impl Face { for (slot, c) in v.iter_mut().zip(&inst.coords) { *slot = *c; } + // The optical size follows the text size for a named style too, as on the platforms. + for (slot, a) in v.iter_mut().zip(&self.axes) { + if a.tag == "opsz" && style.font_size.is_finite() { + *slot = style.font_size; + } + } } else { let own_style = norm_style(&self.style) == norm_style(&style.font_style); let italic = style.font_style.to_ascii_lowercase().contains("italic") && !self.italic; @@ -398,6 +431,31 @@ fn name_string(f: &skrifa::FontRef, id: StringId) -> Option { (!s.is_empty()).then_some(s) } +/// The normal (0) horizontal track of a `trak` table: (size, tracking in font units) by size. Empty +/// when the table is missing, damaged or has no normal track. +fn normal_track(t: &[u8]) -> Vec<(f64, f64)> { + let u16_at = |o: usize| t.get(o..o + 2).map(|b| u16::from_be_bytes([b[0], b[1]])); + let i16_at = |o: usize| t.get(o..o + 2).map(|b| i16::from_be_bytes([b[0], b[1]])); + let fixed_at = |o: usize| t.get(o..o + 4).map(|b| f64::from(i32::from_be_bytes([b[0], b[1], b[2], b[3]])) / 65536.0); + let Some(horiz) = u16_at(6).map(usize::from).filter(|o| *o > 0) else { return Vec::new() }; + let (Some(tracks), Some(sizes)) = (u16_at(horiz).map(usize::from), u16_at(horiz + 2).map(usize::from)) else { return Vec::new() }; + let Some(size_table) = t.get(horiz + 4..horiz + 8).map(|b| u32::from_be_bytes([b[0], b[1], b[2], b[3]]) as usize) else { return Vec::new() }; + let sizes = sizes.min(256); + for k in 0..tracks.min(64) { + let entry = horiz + 8 + k * 8; + if fixed_at(entry) != Some(0.0) { + continue; + } + let Some(values) = u16_at(entry + 6).map(usize::from) else { return Vec::new() }; + let out: Vec<(f64, f64)> = (0..sizes) + .filter_map(|i| Some((fixed_at(size_table + i * 4)?, f64::from(i16_at(values + i * 2)?)))) + .filter(|(s, _)| s.is_finite()) + .collect(); + return if out.windows(2).all(|w| w[0].0 < w[1].0) { out } else { Vec::new() }; + } + Vec::new() +} + /// (family, style) preferring the typographic names. fn names(f: &skrifa::FontRef) -> (Option, Option) { let family = name_string(f, StringId::TYPOGRAPHIC_FAMILY_NAME).or_else(|| name_string(f, StringId::FAMILY_NAME)); @@ -528,7 +586,7 @@ impl FontDb { /// Style names of a family, by weight then italic. pub fn styles(&mut self, family: &str) -> Vec { self.load_family(family, None); - let Some((_, idx)) = self.families.get(&family.to_lowercase()) else { return vec![] }; + let Some((_, idx)) = self.families.get(&self.key(family)) else { return vec![] }; // (weight, italic, order in the font, name): named instances keep the font's order. let mut v: Vec<(u16, bool, usize, String)> = Vec::new(); for f in idx.iter().filter_map(|i| self.faces.get(*i)) { @@ -549,15 +607,31 @@ impl FontDb { v.into_iter().map(|x| x.3).collect() } - pub fn has_family(&self, family: &str) -> bool { + /// The key `family` is known under: itself, or for a name designs use for Apple's system font + /// (SF Pro, SF UI Text, …) the system font when no font of that name is installed. + pub fn key(&self, family: &str) -> String { let k = family.to_lowercase(); + let known = |k: &str| self.families.contains_key(k) || self.pending.contains_key(k); + if known(&k) { + return k; + } + match apple_alias(&k) { + Some(target) if known(target) => target.to_string(), + _ => k, + } + } + + pub fn has_family(&self, family: &str) -> bool { + let k = self.key(family); self.families.contains_key(&k) || self.pending.contains_key(&k) } /// Read a system family's faces from disk; with `only`, just the face nearest that style (the /// rest stay pending). fn load_family(&mut self, family: &str, only: Option<&str>) { - let key = family.to_lowercase(); + let key = self.key(family); + // Faces load under the family name the scan gave them (a hidden family's public name). + let display = self.pending.get(&key).map(|(d, _)| d.clone()); let entries = match only { None => match self.pending.remove(&key) { Some((_, entries)) => entries, @@ -591,7 +665,7 @@ impl FontDb { Err(_) => continue, }, }; - if let Some(face) = Face::from_bytes(FontBytes::Shared(bytes), e.index, None, Some(&e.style)) { + if let Some(face) = Face::from_bytes(FontBytes::Shared(bytes), e.index, display.as_deref(), Some(&e.style)) { self.add(face); self.loaded_files.insert((e.path, e.index)); } @@ -608,7 +682,7 @@ impl FontDb { /// `style`: a fallback for missing characters needs one face, not every file of a CJK family /// (10–20 MB each). The family's other faces load when it is used by name. pub fn find_one(&mut self, family: &str, style: &str) -> Option> { - if !self.families.contains_key(&family.to_lowercase()) { + if !self.families.contains_key(&self.key(family)) { self.load_family(family, Some(style)); } self.best(family, style) @@ -616,7 +690,7 @@ impl FontDb { /// The loaded face of `family` nearest `style`. fn best(&self, family: &str, style: &str) -> Option> { - let (_, idx) = self.families.get(&family.to_lowercase())?; + let (_, idx) = self.families.get(&self.key(family))?; let faces: Vec<&Arc> = idx.iter().filter_map(|i| self.faces.get(*i)).collect(); let want = norm_style(style); if let Some(f) = faces.iter().find(|f| norm_style(&f.style) == want).or_else(|| faces.iter().find(|f| f.instance(style).is_some())) { @@ -884,12 +958,36 @@ fn faces_in(bytes: &[u8]) -> Vec<(u32, String, String)> { .any(|t| f.data_for_tag(skrifa::Tag::new(t)).is_some()) .then_some(())?; let (family, style) = names(&f); - let family = family.filter(|f| !f.starts_with('.'))?; + let family = public_family(&family?)?; Some((i, family, style.unwrap_or_else(|| "Regular".into()))) }) .collect() } +/// The name a font's family is offered under: its own, a public name for Apple's hidden system +/// families that designs use (`.SF Compact` → SF Compact), none for other hidden (`.`) families. +fn public_family(family: &str) -> Option { + let Some(hidden) = family.strip_prefix('.') else { return Some(family.to_string()) }; + match hidden { + "SF Compact" | "SF Compact Rounded" => Some(hidden.to_string()), + "SF NS Rounded" => Some("SF Pro Rounded".into()), + _ => None, + } +} + +/// The family Apple's system fonts are installed under, for the names designs use for them +/// (lowercase): SF Pro and SF UI are the variable `SFNS.ttf` ("System Font"), its text and display +/// cuts its optical sizes. +fn apple_alias(key: &str) -> Option<&'static str> { + Some(match key.trim_start_matches('.') { + "sf pro" | "sf pro text" | "sf pro display" | "sf ui text" | "sf ui display" | "sf ns" | "sf ns text" | "sf ns display" | "san francisco" => { + "system font" + } + "sf compact text" | "sf compact display" => "sf compact", + _ => return None, + }) +} + /// Convenience: find a face with the global db. pub fn find_face(family: &str, style: &str) -> Option> { let mut db = db().write().unwrap_or_else(std::sync::PoisonError::into_inner); diff --git a/crates/text/src/fontdb_tests.rs b/crates/text/src/fontdb_tests.rs index f2456d28b..0b83e1d3f 100644 --- a/crates/text/src/fontdb_tests.rs +++ b/crates/text/src/fontdb_tests.rs @@ -263,3 +263,64 @@ fn font_bytes_load_into_the_db() { assert_eq!(db().read().unwrap().face_count(), faces); } } + +/// Apple's system font answers to the names designs use for it (SF Pro, SF UI Text, …), unless a +/// font of that name is installed. +#[test] +fn apple_system_font_names_find_the_system_font() { + let mut db = FontDb::default(); + db.pending.insert( + "system font".into(), + ("System Font".into(), vec![Pending { path: "no-such-dir/SFNS.ttf".into(), index: 0, style: "Regular".into() }]), + ); + for name in ["SF Pro", "SF Pro Text", "SF Pro Display", "SF UI Text", "SF UI Display", ".SF NS Text", "San Francisco"] { + assert!(db.has_family(name), "{name}"); + } + assert!(!db.has_family("SF Mono")); + db.pending.insert("sf pro".into(), ("SF Pro".into(), Vec::new())); + assert_eq!(db.key("SF Pro"), "sf pro", "an installed SF Pro is itself"); + assert_eq!(db.key("SF UI Text"), "system font"); +} + +#[test] +fn hidden_apple_families_take_public_names() { + assert_eq!(public_family(".SF Compact").as_deref(), Some("SF Compact")); + assert_eq!(public_family(".SF Compact Rounded").as_deref(), Some("SF Compact Rounded")); + assert_eq!(public_family(".SF NS Rounded").as_deref(), Some("SF Pro Rounded")); + assert_eq!(public_family(".Keyboard"), None); + assert_eq!(public_family("Inter").as_deref(), Some("Inter")); +} + +/// Like the platforms, a variable font's optical size follows the text size, also for a named +/// style (macOS only: the system font is the one variable font with an optical size axis at hand). +#[test] +fn optical_size_follows_the_text_size() { + let Ok(bytes) = std::fs::read("/System/Library/Fonts/SFNS.ttf") else { return }; + let face = Face::from_bytes(FontBytes::Shared(std::sync::Arc::new(bytes)), 0, None, None).unwrap(); + let opsz = face.axes.iter().position(|a| a.tag == "opsz").unwrap(); + let at = |size: f64| { + let style = + figcraft_doc::TextStyle { font_family: "System Font".into(), font_style: "Semibold".into(), font_size: size, ..Default::default() }; + face.axis_values(&style)[opsz] + }; + assert_eq!(at(12.0), 17.0); + assert_eq!(at(40.0), 40.0); +} + +/// The tracking a font's `trak` table gives at a size (Apple's fonts carry one; the platform text +/// engine applies it on its own), in pixels, interpolated between the sizes the table lists. +#[test] +fn trak_tracking_by_size() { + let Ok(bytes) = std::fs::read("/System/Library/Fonts/SFNS.ttf") else { return }; + let face = Face::from_bytes(FontBytes::Shared(std::sync::Arc::new(bytes)), 0, None, None).unwrap(); + // Track 0 of SF: −12 units at 13 pt, 0 at 12 pt, −40 at 16 pt (2048 units per em). + assert!((face.tracking(13.0) - (-12.0 * 13.0 / 2048.0)).abs() < 1e-9, "{}", face.tracking(13.0)); + assert!(face.tracking(12.0).abs() < 1e-9); + assert!((face.tracking(12.5) - (-6.0 * 12.5 / 2048.0)).abs() < 1e-9); + // Past the table's ends: its last values. + assert!(face.tracking(500.0).is_finite()); + let plain = crate::fontdb::db().write().unwrap().default_face(); + if let Some(f) = plain.filter(|f| f.family != "System Font") { + let _ = f.tracking(12.0); + } +} diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 508cd12a3..8759a3597 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -18,7 +18,7 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| | `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included; a flow that records no primary-axis sizing hugs on that axis, an instance that records no auto layout has its main's), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Since 2026-10-17 (community batches #727, #728): an instance's own identity and the cached library components a file carries, overrides applied by key and order, local text values and instance overrides over a shared text style, grid track sizes (fixed, content-sized, fill), slot content, labels of connectors saved with their drawn path (a static snapshot; the ends aren't live), skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, editable text on a path, image adjustments and images carried in the message. Budgets come from the file's own size (one value per compressed byte, 20M–128M, lower ceilings on 32-bit targets; the layer cap follows), so a 15.4 MB synthetic file with 300,000 layers opens whole; the file's bytes stay out of the command journal; an import report lists what was left out or changed once the file opens. Not read: elbowed or curved connectors without a saved path (drawn straight) and labels of connectors without a saved snapshot, table cells beyond their own layers, filled areas with their own fills, variables bound to fields the editor can't bind, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs` and the per-feature `*_tests.rs` beside them, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | -| `.sketch` (Sketch 48 and newer) | — (Figma's own Sketch import runs in its web app) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards (and Sketch 2025 frames) as frames with their background, groups, rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (a mask that shows its own style draws a copy under itself, as Sketch does; broken mask chains wrapped); text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts from PostScript names matched to installed families; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), resized by their constraints and still live; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids. Warnings: noise fills, motion and zoom blurs, embedded fonts (not used), Smart Layout and stacks (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (70,000 layers open in ~3 s, debug build); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 70 in at most 4.4%; Sketch 2025 files on fixtures only | 5–10 (Smart Layout as auto layout, real Sketch 2025 files) | +| `.sketch` (Sketch 48 and newer) | — (Figma's own Sketch import runs in its web app) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards (and Sketch 2025 frames) as frames with their background, groups, rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (a mask that shows its own style draws a copy under itself, as Sketch does; broken mask chains wrapped); text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts from PostScript names matched to installed families; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), laid out for their size the way Sketch does it (proportional sharing per pins from format 110, scaling before) and still live; master backgrounds in instances only where Sketch shows them; Apple's system fonts found under the names designs use, with the platform's tracking kept as letter spacing; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids. Warnings: noise fills, motion and zoom blurs, embedded fonts (not used), Smart Layout and stacks (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (70,000 layers open in ~3 s, debug build); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 70 in at most 4.4%; Sketch 2025 files on fixtures only | 5–10 (Smart Layout as auto layout, real Sketch 2025 files) | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | | REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout (sizing modes left out read as hug, as documented; grid track sizes from `gridColumnsSizing` / `gridRowsSizing`: px, fr, auto, `minmax(0, 1fr)`, `repeat()`), constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, slots (`SLOT` layers bound to their slot property; an instance's slot keeps its content as the instance's own unless its property value is the main's default content; slot limits and preferred components are warnings), styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings, image adjustments (the same tint sign as `.fig`); the import report after opening; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | From c639cc2b76de3e5e81daaaccab281298efea8190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 22:51:11 +0200 Subject: [PATCH 488/817] M6: Sketch import: Sketch 2025 frames, stacks, tints and corners Groups as frames and graphics, stacks as auto layout (instances laid out by their stack), corners and per-side borders from the style, pins and sizing, tints (layeringType, fillColor overrides), text colour and visibility overrides, blur lists (progressive, glass), inner shadows in the shadow list, angular gradients starting on the right, text sizing, and texts an override changed measured again on open. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/file.rs | 39 +++ crates/engine/src/sketch_import_tests.rs | 75 +++++ crates/format/src/sketch/fixture.rs | 18 ++ crates/format/src/sketch/frames_tests.rs | 385 +++++++++++++++++++++++ crates/format/src/sketch/mod.rs | 3 + crates/format/src/sketch/path.rs | 59 ++++ crates/format/src/sketch/proto.rs | 7 +- crates/format/src/sketch/stack.rs | 99 ++++++ crates/format/src/sketch/style.rs | 140 ++++++++- crates/format/src/sketch/style_tests.rs | 8 +- crates/format/src/sketch/symbols.rs | 115 ++++++- crates/format/src/sketch/text.rs | 19 +- crates/format/src/sketch/tree.rs | 107 ++++++- docs/file-format-parity.md | 4 +- 14 files changed, 1044 insertions(+), 34 deletions(-) create mode 100644 crates/format/src/sketch/frames_tests.rs create mode 100644 crates/format/src/sketch/stack.rs diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index c6f892c16..5de7e0fd9 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -564,10 +564,49 @@ fn load_sketch(bytes: &[u8], name: &str) -> Option = doc + .nodes() + .filter(|n| match (&n.kind, n.source.and_then(|s| doc.node(s)).map(|s| &s.kind)) { + (NodeKind::Text(t), Some(NodeKind::Text(main))) => t.characters != main.characters, + _ => false, + }) + .map(|n| n.id) + .collect(); + let m = crate::measure::TextMeasure; + // Instances of a stack at another size than their main: the stack at their size, innermost first. + let mut resized: Vec<(usize, NodeId)> = doc + .nodes() + .filter(|n| n.layout.is_some()) + .filter(|n| match &n.kind { + NodeKind::Instance { component, .. } => { + doc.node(*component).is_some_and(|c| (c.width - n.width).abs() > 1e-6 || (c.height - n.height).abs() > 1e-6) + } + _ => false, + }) + .map(|n| (doc.ancestors(n.id).len(), n.id)) + .collect(); + resized.sort_by_key(|r| std::cmp::Reverse(r.0)); + for (_, id) in resized { + figcraft_layout::layout_frame(doc, id, &m); + } + for id in changed { + if let Some((w, h)) = doc.node(id).and_then(figcraft_text::auto_size) { + figcraft_layout::set_size(doc, id, w, h); + } + figcraft_layout::layout_up(doc, id, &m); + } +} + /// Font families a `.sketch` import guessed from PostScript names ("Ping Fang SC" from /// "PingFangSC-Semibold") take the installed family's name when they differ only in spaces and /// case. diff --git a/crates/engine/src/sketch_import_tests.rs b/crates/engine/src/sketch_import_tests.rs index d78db77c5..5dc4b31ab 100644 --- a/crates/engine/src/sketch_import_tests.rs +++ b/crates/engine/src/sketch_import_tests.rs @@ -326,3 +326,78 @@ fn sketch_text_keeps_the_platform_tracking() { let ls = td.style.letter_spacing.resolve(13.0); assert!((ls - (-12.0 * 13.0 / 2048.0)).abs() < 1e-6, "{ls}"); } + +/// A text an override changed is measured again, and the stack around it re-flows: a hugging chip +/// grows to its new label. +#[test] +fn sketch_overridden_text_reflows_its_stack() { + let font = json!({"name": "Helvetica", "size": 12}); + let run = json!({"location": 0, "length": 2, "attributes": {"MSAttributedStringFontAttribute": {"attributes": font}}}); + let label = shape( + "text", + "Label", + [20.0, 4.0, 14.0, 16.0], + json!({"attributedString": {"string": "Go", "attributes": [run]}, "horizontalSizing": 1, "verticalSizing": 1}), + ); + let dot = shape("oval", "Dot", [8.0, 9.0, 6.0, 6.0], json!({"points": []})); + let layout = json!({"_class": "MSImmutableFlexGroupLayout", "flexDirection": 0, "justifyContent": 0, "alignItems": 1, "allGuttersGap": 6, "stackingOrder": 0}); + let master = shape( + "symbolMaster", + "Chip", + [0.0, 0.0, 44.0, 24.0], + json!({"symbolID": "S", "groupBehavior": 1, "groupLayout": layout, "horizontalSizing": 1, "verticalSizing": 1, + "leftPadding": 8, "rightPadding": 10, "topPadding": 4, "bottomPadding": 4, "layers": [label, dot]}), + ); + let ov = json!([{"_class": "overrideValue", "overrideName": "Label_stringValue", "value": "A much longer label here"}]); + let inst = shape( + "symbolInstance", + "Long", + [0.0, 100.0, 160.0, 24.0], + json!({"symbolID": "S", "overrideValues": ov, "horizontalSizing": 1, "verticalSizing": 1}), + ); + let data = base64::engine::general_purpose::STANDARD.encode(sketch_with("2026.3.1", &[("A", "Page")], &[master, inst])); + let mut s = Session::new(); + s.execute("file.open", &json!({"data": data, "name": "x.sketch"})).unwrap(); + let doc = s.doc().unwrap(); + let inst = doc.nodes().find(|n| n.name == "Long").unwrap().id; + let label = doc.subtree(inst).into_iter().find(|id| doc.node(*id).is_some_and(|n| n.name == "Label")).unwrap(); + let dot = doc.subtree(inst).into_iter().find(|id| doc.node(*id).is_some_and(|n| n.name == "Dot")).unwrap(); + let (i, l, d) = (doc.world_bounds(inst).unwrap(), doc.world_bounds(label).unwrap(), doc.world_bounds(dot).unwrap()); + assert!(l.x1 - l.x0 > 60.0, "the label was measured: {l:?}"); + assert!((d.x0 - i.x0 - 8.0).abs() < 0.5, "the dot after the padding: {d:?} in {i:?}"); + assert!((l.x0 - d.x1 - 6.0).abs() < 0.5, "the label after the gap: {l:?}"); + assert!((i.x1 - l.x1 - 10.0).abs() < 0.5, "the chip hugs: {i:?} {l:?}"); +} + +/// An instance sized apart from its master lays its master's stack out at its own size: a wide +/// button keeps its label and icon together in the middle. +#[test] +fn sketch_resized_stack_instances_reflow() { + let a = shape("rectangle", "A", [22.0, 12.0, 40.0, 20.0], json!({"points": []})); + let b = shape("rectangle", "B", [70.0, 12.0, 20.0, 20.0], json!({"points": []})); + let layout = json!({"_class": "MSImmutableFlexGroupLayout", "flexDirection": 0, "justifyContent": 1, "alignItems": 1, "allGuttersGap": 8, "stackingOrder": 0}); + let master = shape( + "symbolMaster", + "Button", + [0.0, 0.0, 112.0, 44.0], + json!({"symbolID": "S", "groupBehavior": 1, "groupLayout": layout, "horizontalSizing": 1, "verticalSizing": 1, + "leftPadding": 22, "rightPadding": 22, "topPadding": 12, "bottomPadding": 12, "layers": [b, a]}), + ); + let inst = shape( + "symbolInstance", + "Wide", + [0.0, 100.0, 342.0, 44.0], + json!({"symbolID": "S", "overrideValues": [], "horizontalSizing": 0, "verticalSizing": 1}), + ); + let data = base64::engine::general_purpose::STANDARD.encode(sketch_with("2026.3.1", &[("A", "Page")], &[master, inst])); + let mut s = Session::new(); + s.execute("file.open", &json!({"data": data, "name": "x.sketch"})).unwrap(); + let doc = s.doc().unwrap(); + let inst = doc.nodes().find(|n| n.name == "Wide").unwrap().id; + let at = |name: &str| doc.world_bounds(doc.subtree(inst).into_iter().find(|id| doc.node(*id).is_some_and(|n| n.name == name)).unwrap()).unwrap(); + let (a, b) = (at("A"), at("B")); + // 40 + 8 + 20 = 68 wide, centred in 342: from 137. + assert!((a.x0 - 137.0).abs() < 0.5, "{a:?}"); + assert!((b.x0 - a.x1 - 8.0).abs() < 0.5, "{a:?} {b:?}"); + assert!((doc.world_bounds(inst).unwrap().x1 - 342.0).abs() < 1e-6); +} diff --git a/crates/format/src/sketch/fixture.rs b/crates/format/src/sketch/fixture.rs index ac426f0e4..19d23eca4 100644 --- a/crates/format/src/sketch/fixture.rs +++ b/crates/format/src/sketch/fixture.rs @@ -186,3 +186,21 @@ pub(crate) fn instance(id: &str, symbol_id: &str, x: f64, y: f64, w: f64, h: f64 Value::Array(overrides.iter().map(|(name, value)| json!({"_class": "overrideValue", "overrideName": name, "value": value})).collect()); l } + +/// A Sketch 2025+ frame (a group that behaves as a frame) holding `layers`. +pub(crate) fn frame_group(id: &str, x: f64, y: f64, w: f64, h: f64, layers: Vec) -> Value { + let mut l = group(id, x, y, w, h, layers); + l["groupBehavior"] = json!(1); + l["clippingBehavior"] = json!(0); + l +} + +/// `l` as a stack (Sketch 2025+): `direction` 0 row, 1 column. +pub(crate) fn stack(mut l: Value, direction: i64, justify: i64, align: i64, gap: f64, padding: [f64; 4]) -> Value { + l["groupLayout"] = json!({"_class": "MSImmutableFlexGroupLayout", "flexDirection": direction, "justifyContent": justify, "alignItems": align, + "allGuttersGap": gap, "crossAxisGutterGap": 0, "wrappingEnabled": false, "alignContent": 0, "stackingOrder": 0, "bordersAffectLayout": false}); + for (k, v) in ["leftPadding", "topPadding", "rightPadding", "bottomPadding"].iter().zip(padding) { + l[*k] = json!(v); + } + l +} diff --git a/crates/format/src/sketch/frames_tests.rs b/crates/format/src/sketch/frames_tests.rs new file mode 100644 index 000000000..aadc4b5f4 --- /dev/null +++ b/crates/format/src/sketch/frames_tests.rs @@ -0,0 +1,385 @@ +//! Sketch 2025 and newer: frames and graphics (groups with a `groupBehavior`), stacks, corners in +//! the style, pins and sizing, border sides. + +use figcraft_doc::{Document, LayoutMode, Node, NodeKind}; +use serde_json::{Value, json}; + +use super::fixture::*; +use super::import; + +fn open(layers: Vec) -> (Document, Vec) { + let z = sketch_zip("2026.3.1", 196, document(&["P"]), &[page("P", "Page", layers)], &[]); + import(&z, "f").unwrap() +} + +fn node<'d>(doc: &'d Document, name: &str) -> &'d Node { + doc.nodes().find(|n| n.name == name).unwrap_or_else(|| panic!("no {name}")) +} + +#[test] +fn frames_graphics_and_clipping() { + let mut clip_none = frame_group("Loose", 0.0, 0.0, 50.0, 50.0, vec![]); + clip_none["clippingBehavior"] = json!(2); + let mut graphic = frame_group("Icon", 100.0, 0.0, 24.0, 24.0, vec![]); + graphic["groupBehavior"] = json!(2); + let mut plain = group("Plain", 200.0, 0.0, 10.0, 10.0, vec![rect("Inside", 0.0, 0.0, 10.0, 10.0)]); + plain["groupBehavior"] = json!(0); + let mut filled = frame_group("Filled", 300.0, 0.0, 50.0, 50.0, vec![]); + filled["style"]["fills"] = json!([solid_fill(1.0, 0.0, 0.0, 1.0)]); + let (doc, _) = open(vec![frame_group("Screen", 0.0, 100.0, 390.0, 844.0, vec![]), clip_none, graphic, plain, filled]); + assert!(matches!(node(&doc, "Screen").kind, NodeKind::Frame) && node(&doc, "Screen").clip); + assert!(!node(&doc, "Loose").clip); + assert!(matches!(node(&doc, "Icon").kind, NodeKind::Frame) && node(&doc, "Icon").clip); + assert!(matches!(node(&doc, "Plain").kind, NodeKind::Group)); + assert_eq!(node(&doc, "Filled").fills.len(), 1); + // Frames show what their style says: no white background of their own. + assert!(node(&doc, "Screen").fills.is_empty()); +} + +#[test] +fn corners_from_the_style() { + let mut a = rect("Each", 0.0, 0.0, 40.0, 40.0); + a["style"]["corners"] = + json!({"_class": "MSImmutableStyleCorners", "radii": [1, 2, 3, 4], "style": 0, "smoothing": 0.6, "prefersConcentric": false}); + let mut b = rect("Smooth", 50.0, 0.0, 40.0, 40.0); + b["style"]["corners"] = json!({"_class": "MSImmutableStyleCorners", "radii": [12], "style": 1, "smoothing": 0.6, "prefersConcentric": false}); + let mut f = frame_group("Card", 100.0, 0.0, 100.0, 100.0, vec![]); + f["style"]["corners"] = json!({"_class": "MSImmutableStyleCorners", "radii": [16, 16, 16, 16], "style": 0, "smoothing": 0.6}); + let (doc, _) = open(vec![a, b, f]); + assert_eq!(node(&doc, "Each").corners.radii, [1.0, 2.0, 3.0, 4.0]); + assert_eq!(node(&doc, "Smooth").corners.radii, [12.0; 4]); + assert!((node(&doc, "Smooth").corners.smoothing - 0.6).abs() < 1e-9); + assert_eq!(node(&doc, "Each").corners.smoothing, 0.0); + assert_eq!(node(&doc, "Card").corners.radii, [16.0; 4]); +} + +#[test] +fn stacks_become_auto_layout() { + // A row: Sketch lists the first item last (on top); justify evenly, centred, gap 8. + let a = rect("First", 0.0, 0.0, 20.0, 20.0); + let b = with(rect("Second", 0.0, 0.0, 30.0, 10.0), "horizontalSizing", json!(2)); + let mut free = rect("Free", 0.0, 0.0, 5.0, 5.0); + free["flexItem"] = json!({"_class": "MSImmutableFlexItem", "ignoreLayout": true, "alignSelf": 5, "preserveSpaceWhenHidden": false}); + let mut row = stack(frame_group("Row", 0.0, 0.0, 200.0, 40.0, vec![free, b, a]), 0, 5, 1, 8.0, [4.0, 6.0, 10.0, 2.0]); + row["horizontalSizing"] = json!(0); + row["verticalSizing"] = json!(1); + let col = stack(frame_group("Column", 0.0, 100.0, 100.0, 100.0, vec![rect("One", 0.0, 0.0, 10.0, 10.0)]), 1, 3, 3, 0.0, [0.0; 4]); + let (doc, _) = open(vec![row, col]); + let r = node(&doc, "Row"); + let l = r.layout.as_ref().expect("auto layout"); + assert_eq!(l.mode, LayoutMode::Horizontal); + assert_eq!(l.gap, 8.0); + assert_eq!(l.padding, [6.0, 10.0, 2.0, 4.0], "top, right, bottom, left"); + assert!(l.reverse_z, "the first item is on top, as in Sketch"); + let text = format!("{l:?}"); + assert!(text.contains("SpaceEvenly") || text.contains("Evenly"), "{text}"); + let order: Vec<&str> = r.children.iter().map(|c| doc.node(*c).unwrap().name.as_str()).collect(); + assert_eq!(order, ["First", "Second", "Free"], "flow order is the reverse of Sketch's list"); + assert!(node(&doc, "Free").child_layout.absolute); + assert_eq!(node(&doc, "Second").child_layout.sizing_h, figcraft_doc::Sizing::Fill); + assert_eq!(r.child_layout.sizing_v, figcraft_doc::Sizing::Hug); + let c = node(&doc, "Column").layout.as_ref().unwrap(); + assert_eq!(c.mode, LayoutMode::Vertical); + assert!(format!("{c:?}").contains("SpaceBetween"), "{c:?}"); +} + +/// A frame resized as an instance's layer follows its pins and sizing (Sketch 2025+ keep them in +/// `horizontalPins`/`horizontalSizing`, `resizingConstraint` stays 63). +#[test] +fn pins_and_sizing_resize_instances() { + let mut r = rect("R", 20.0, 30.0, 100.0, 40.0); + r["horizontalPins"] = json!(1); // left + r["horizontalSizing"] = json!(0); // fixed + r["verticalPins"] = json!(0); + r["verticalSizing"] = json!(3); // relative + let mut m = master("M", "S", "Box", 200.0, 100.0, vec![r]); + m["groupBehavior"] = json!(1); + let (doc, _) = { + let z = sketch_zip( + "2026.3.1", + 196, + document(&["P", "S"]), + &[page("P", "Page", vec![instance("I", "S", 0.0, 0.0, 320.0, 60.0, &[])]), page("S", "Symbols", vec![m])], + &[], + ); + import(&z, "f").unwrap() + }; + let inst = doc.nodes().find(|n| n.name == "I").unwrap(); + let r = doc.subtree(inst.id).into_iter().filter_map(|i| doc.node(i)).find(|n| n.name == "R").unwrap(); + let b = doc.world_bounds(r.id).unwrap(); + assert!((b.x0 - 20.0).abs() < 0.5 && (b.width() - 100.0).abs() < 0.5, "{b:?}"); + assert!((b.y0 - 18.0).abs() < 0.5 && (b.height() - 24.0).abs() < 0.5, "{b:?}"); +} + +#[test] +fn graphics_scale_their_layers() { + let mut r = rect("R", 20.0, 30.0, 100.0, 40.0); + r["horizontalPins"] = json!(5); + r["horizontalSizing"] = json!(0); + let mut m = master("M", "S", "Glyph", 200.0, 100.0, vec![r]); + m["groupBehavior"] = json!(2); + let z = sketch_zip( + "2026.3.1", + 196, + document(&["P", "S"]), + &[page("P", "Page", vec![instance("I", "S", 0.0, 0.0, 400.0, 200.0, &[])]), page("S", "Symbols", vec![m])], + &[], + ); + let (doc, _) = import(&z, "f").unwrap(); + let inst = doc.nodes().find(|n| n.name == "I").unwrap(); + let r = doc.subtree(inst.id).into_iter().filter_map(|i| doc.node(i)).find(|n| n.name == "R").unwrap(); + let b = doc.world_bounds(r.id).unwrap(); + assert!((b.x0 - 40.0).abs() < 0.5 && (b.width() - 200.0).abs() < 0.5, "{b:?}"); +} + +#[test] +fn border_sides() { + let r = styled( + rect("Sided", 0.0, 0.0, 40.0, 40.0), + "borders", + json!([{"_class": "border", "isEnabled": true, "fillType": 0, "color": color(0.0, 0.0, 0.0, 1.0), "position": 1, "thickness": 8, + "sides": {"_class": "MSImmutableStyleBorderSides", "leftInset": 7, "rightInset": 7, "topInset": 0, "bottomInset": 5}}]), + ); + // A side is as thick as the border less its inset. + let (doc, _) = open(vec![r]); + assert_eq!(node(&doc, "Sided").stroke.sides, Some([8.0, 1.0, 3.0, 1.0])); +} + +#[test] +fn swatches_bind_solid_fills_only() { + let mut d = document(&["P"]); + d["sharedSwatches"] = json!({"_class": "swatchContainer", "objects": [{"_class": "swatch", "do_objectID": "SW", "name": "Brand", "value": color(0.0, 0.0, 1.0, 1.0)}]}); + let mut g = json!({"_class": "fill", "isEnabled": true, "fillType": 1, "color": color(0.0, 0.0, 1.0, 1.0), + "gradient": {"_class": "gradient", "gradientType": 0, "from": "{0.5, 0}", "to": "{0.5, 1}", "stops": [ + {"_class": "gradientStop", "position": 0, "color": color(1.0, 0.0, 0.0, 1.0)}, {"_class": "gradientStop", "position": 1, "color": color(0.0, 0.0, 1.0, 1.0)}]}}); + g["color"]["swatchID"] = json!("SW"); + let z = sketch_zip("2026.3.1", 196, d, &[page("P", "Page", vec![styled(rect("G", 0.0, 0.0, 10.0, 10.0), "fills", json!([g]))])], &[]); + let (_, warnings) = import(&z, "f").unwrap(); + assert!(!warnings.iter().any(|w| w.contains("not supported")), "{warnings:?}"); +} + +/// Sketch 2025+ masters keep their background, corners and stack in their style and layout, and +/// their instances show the same. +#[test] +fn masters_and_instances_keep_frame_styles_and_stacks() { + let mut m = master("M", "S", "Button", 120.0, 44.0, vec![rect("Icon", 0.0, 0.0, 20.0, 20.0), rect("Label", 0.0, 0.0, 60.0, 20.0)]); + m["groupBehavior"] = json!(1); + m["clippingBehavior"] = json!(2); + m["style"]["fills"] = json!([solid_fill(0.0, 0.0, 1.0, 1.0)]); + m["style"]["corners"] = json!({"_class": "MSImmutableStyleCorners", "radii": [8], "style": 1, "smoothing": 0.6}); + let m = stack(m, 0, 1, 1, 10.0, [16.0, 12.0, 16.0, 12.0]); + let z = sketch_zip( + "2026.3.1", + 196, + document(&["P", "S"]), + &[page("P", "Page", vec![instance("I", "S", 0.0, 0.0, 120.0, 44.0, &[])]), page("S", "Symbols", vec![m])], + &[], + ); + let (doc, _) = import(&z, "f").unwrap(); + let main = doc.nodes().find(|n| matches!(n.kind, NodeKind::Component { .. })).unwrap(); + let inst = doc.nodes().find(|n| matches!(n.kind, NodeKind::Instance { .. })).unwrap(); + for n in [main, inst] { + assert_eq!(n.fills.len(), 1, "{}", n.name); + assert_eq!(n.corners.radii, [8.0; 4], "{}", n.name); + assert!(n.layout.is_some(), "{}", n.name); + assert!(!n.clip, "{}", n.name); + let order: Vec<&str> = n.children.iter().map(|c| doc.node(*c).unwrap().name.as_str()).collect(); + assert_eq!(order, ["Label", "Icon"], "{}", n.name); + } +} + +fn solid_of(n: &Node) -> Option<[f32; 3]> { + n.fills.iter().find_map(|p| match &p.kind { + figcraft_doc::color::PaintKind::Solid { color } => Some([color.r, color.g, color.b]), + _ => None, + }) +} + +fn open_symbols(layers: Vec, masters: Vec) -> Document { + let z = sketch_zip("2026.3.1", 196, document(&["P", "S"]), &[page("P", "Page", layers), page("S", "Symbols", masters)], &[]); + import(&z, "f").unwrap().0 +} + +fn in_instance<'d>(doc: &'d Document, inst: &str, name: &str) -> &'d Node { + let i = doc.nodes().find(|n| n.name == inst && matches!(n.kind, NodeKind::Instance { .. })).unwrap_or_else(|| panic!("no {inst}")); + doc.subtree(i.id).into_iter().filter_map(|id| doc.node(id)).find(|n| n.name == name).unwrap_or_else(|| panic!("no {name} in {inst}")) +} + +/// A graphic's fill tints its layers (it's no background); an instance's fill, or a `fillColor` +/// override, tints the instance's layers. +#[test] +fn fills_of_graphics_and_instances_are_tints() { + let glyph = styled(rect("Glyph", 0.0, 0.0, 24.0, 24.0), "fills", json!([solid_fill(0.0, 0.0, 0.0, 1.0)])); + let mut icon = master("MI", "SI", "Icon", 24.0, 24.0, vec![glyph]); + icon["groupBehavior"] = json!(2); + let mut tint = solid_fill(1.0, 0.0, 0.0, 1.0); + tint["layeringType"] = json!(1); + icon["style"]["fills"] = json!([tint]); + let nested = instance("N", "SI", 0.0, 0.0, 24.0, 24.0, &[]); + let mut button = master("MB", "SB", "Button", 100.0, 40.0, vec![nested]); + button["groupBehavior"] = json!(1); + let own = instance("Own", "SI", 0.0, 0.0, 24.0, 24.0, &[("Own_fillColor", color(0.0, 0.0, 1.0, 1.0))]); + let via = instance("Via", "SB", 0.0, 100.0, 100.0, 40.0, &[("N_fillColor", color(0.0, 1.0, 0.0, 1.0))]); + let doc = open_symbols(vec![own, via], vec![icon, button]); + let main = doc.nodes().find(|n| n.name == "Icon" && matches!(n.kind, NodeKind::Component { .. })).unwrap(); + assert!(main.fills.is_empty(), "a graphic's fill isn't its background"); + let in_main = doc.subtree(main.id).into_iter().filter_map(|i| doc.node(i)).find(|n| n.name == "Glyph").unwrap(); + assert_eq!(solid_of(in_main), Some([1.0, 0.0, 0.0])); + assert_eq!(solid_of(in_instance(&doc, "Own", "Glyph")), Some([0.0, 0.0, 1.0])); + assert!(doc.nodes().find(|n| n.name == "Own").unwrap().fills.is_empty()); + assert_eq!(solid_of(in_instance(&doc, "Via", "Glyph")), Some([0.0, 1.0, 0.0])); +} + +#[test] +fn text_color_overrides() { + let label = text("Label", 0.0, 0.0, 80.0, 20.0, "Go", &[(0, 2, "Helvetica", 14.0, [0.0, 0.0, 0.0, 1.0])]); + let m = master("M", "S", "Button", 100.0, 40.0, vec![label]); + let doc = open_symbols(vec![instance("I", "S", 0.0, 0.0, 100.0, 40.0, &[("Label_textColor", color(1.0, 0.0, 0.0, 1.0))])], vec![m]); + let n = in_instance(&doc, "I", "Label"); + let red = |p: &figcraft_doc::color::Paint| matches!(p.kind, figcraft_doc::color::PaintKind::Solid { color } if color.r == 1.0 && color.g == 0.0); + let NodeKind::Text(td) = &n.kind else { panic!("not text") }; + assert!(n.fills.iter().any(red) || td.style.fills.as_ref().is_some_and(|f| f.iter().any(red)), "{:?} {:?}", n.fills, td.style.fills); +} + +#[test] +fn blurs_list() { + let blur = |ty: i64, r: f64| json!({"_class": "blur", "isEnabled": true, "type": ty, "radius": r, "center": "{0.5, 0.5}", "motionAngle": 25}); + let g = styled(rect("Glow", 0.0, 0.0, 40.0, 40.0), "blurs", json!([blur(0, 90.0)])); + let m = styled(rect("Comet", 50.0, 0.0, 40.0, 4.0), "blurs", json!([blur(1, 6.0)])); + let b = styled(rect("Glass", 100.0, 0.0, 40.0, 40.0), "blurs", json!([blur(3, 10.0)])); + let (doc, warnings) = open(vec![g, m, b]); + assert!(matches!(node(&doc, "Glow").effects[0].kind, figcraft_doc::EffectKind::LayerBlur(_))); + assert!(matches!(node(&doc, "Glass").effects[0].kind, figcraft_doc::EffectKind::BackgroundBlur(_))); + assert!(matches!(node(&doc, "Comet").effects[0].kind, figcraft_doc::EffectKind::LayerBlur(_)), "motion blur drawn as a layer blur"); + assert!(warnings.iter().any(|w| w.contains("motion")), "{warnings:?}"); +} + +#[test] +fn text_sizing_2025() { + let mut fixed = text("Fixed", 0.0, 0.0, 100.0, 40.0, "Wraps here", &[(0, 10, "Helvetica", 14.0, [0.0, 0.0, 0.0, 1.0])]); + fixed.as_object_mut().unwrap().remove("textBehaviour"); + fixed["horizontalSizing"] = json!(0); + fixed["verticalSizing"] = json!(1); + let mut fit = text("Fit", 0.0, 50.0, 100.0, 20.0, "Grows", &[(0, 5, "Helvetica", 14.0, [0.0, 0.0, 0.0, 1.0])]); + fit.as_object_mut().unwrap().remove("textBehaviour"); + fit["horizontalSizing"] = json!(1); + fit["verticalSizing"] = json!(1); + let (doc, _) = open(vec![fixed, fit]); + let auto = |n: &str| match &node(&doc, n).kind { + NodeKind::Text(td) => td.auto_resize, + _ => panic!("not text"), + }; + assert_eq!(auto("Fixed"), figcraft_doc::TextAutoResize::Height); + assert_eq!(auto("Fit"), figcraft_doc::TextAutoResize::WidthAndHeight); +} + +#[test] +fn stacks_are_no_smart_layout_note() { + let (_, warnings) = open(vec![stack(frame_group("Row", 0.0, 0.0, 100.0, 40.0, vec![rect("A", 0.0, 0.0, 10.0, 10.0)]), 0, 0, 0, 0.0, [0.0; 4])]); + assert!(!warnings.iter().any(|w| w.contains("Smart Layout")), "{warnings:?}"); +} + +/// Sketch 2025+: a fill with `layeringType` 1 is a tint (of a frame or master too), 0 a background. +#[test] +fn layering_type_decides_tint_or_background() { + let dot = styled(rect("Dot", 0.0, 0.0, 10.0, 10.0), "fills", json!([solid_fill(0.0, 0.0, 0.0, 1.0)])); + let mut tint = solid_fill(0.0, 0.0, 1.0, 1.0); + tint["layeringType"] = json!(1); + let mut bar = master("MB", "SB", "Bar", 100.0, 20.0, vec![dot]); + bar["groupBehavior"] = json!(1); + bar["style"]["fills"] = json!([tint]); + let mut bg = solid_fill(1.0, 0.0, 0.0, 1.0); + bg["layeringType"] = json!(0); + let mut btn = master("MC", "SC", "Btn", 100.0, 20.0, vec![]); + btn["groupBehavior"] = json!(1); + btn["style"]["fills"] = json!([bg]); + let doc = open_symbols(vec![instance("B", "SB", 0.0, 0.0, 100.0, 20.0, &[]), instance("C", "SC", 0.0, 50.0, 100.0, 20.0, &[])], vec![bar, btn]); + let b = doc.nodes().find(|n| n.name == "B").unwrap(); + assert!(b.fills.is_empty(), "a tint isn't a background"); + assert_eq!(solid_of(in_instance(&doc, "B", "Dot")), Some([0.0, 0.0, 1.0])); + assert_eq!(solid_of(doc.nodes().find(|n| n.name == "C").unwrap()), Some([1.0, 0.0, 0.0])); +} + +#[test] +fn inner_shadows_in_the_shadow_list() { + let mut sh = + json!({"_class": "shadow", "isEnabled": true, "blurRadius": 4, "offsetX": 0, "offsetY": 2, "spread": 0, "color": color(0.0, 0.0, 0.0, 0.5)}); + sh["isInnerShadow"] = json!(true); + let (doc, _) = open(vec![styled(rect("Inset", 0.0, 0.0, 40.0, 40.0), "shadows", json!([sh]))]); + assert!(matches!(node(&doc, "Inset").effects[0].kind, figcraft_doc::EffectKind::InnerShadow(_))); +} + +#[test] +fn visibility_overrides() { + let m = master("M", "S", "Input", 100.0, 40.0, vec![rect("Label", 0.0, 0.0, 50.0, 10.0)]); + let doc = open_symbols(vec![instance("I", "S", 0.0, 0.0, 100.0, 40.0, &[("Label_isVisible", json!("0"))])], vec![m]); + assert!(!in_instance(&doc, "I", "Label").visible); +} + +/// An instance that fits its content hugs it even when its master has a fixed size. +#[test] +fn instance_sizing_is_its_own() { + let m = stack(master("M", "S", "Chip", 60.0, 24.0, vec![rect("A", 0.0, 0.0, 20.0, 20.0)]), 0, 0, 1, 0.0, [0.0; 4]); + let mut i = instance("I", "S", 0.0, 0.0, 60.0, 24.0, &[]); + i["horizontalSizing"] = json!(1); + let doc = open_symbols(vec![i], vec![m]); + let n = doc.nodes().find(|n| n.name == "I").unwrap(); + assert_eq!(n.layout.as_ref().map(|_| format!("{:?}", n.child_layout.sizing_h)), Some("Hug".to_string())); +} + +/// A tint keeps each layer's own opacity. +#[test] +fn tints_keep_opacity() { + let faint = styled(rect("Faint", 0.0, 0.0, 10.0, 10.0), "fills", json!([solid_fill(0.0, 0.0, 0.0, 0.25)])); + let mut g = group("Tinted", 0.0, 0.0, 10.0, 10.0, vec![faint]); + let mut tint = solid_fill(1.0, 0.0, 0.0, 1.0); + tint["layeringType"] = json!(1); + g["groupBehavior"] = json!(0); + g["style"] = json!({"_class": "style", "fills": [tint]}); + let (doc, _) = open(vec![g]); + let f = &node(&doc, "Faint").fills[0]; + let figcraft_doc::color::PaintKind::Solid { color } = &f.kind else { panic!("not solid") }; + assert_eq!((color.r, color.g), (1.0, 0.0)); + assert!((color.a * f.opacity - 0.25).abs() < 1e-3, "{color:?} {}", f.opacity); + assert!(node(&doc, "Tinted").fills.is_empty()); +} + +#[test] +fn glass_and_progressive_blurs() { + let glass = json!({"_class": "blur", "isEnabled": true, "type": 4, "radius": 10, "distortion": 0.6, "depth": 0.7, "center": "{0.5, 0.5}"}); + let prog = json!({"_class": "blur", "isEnabled": true, "type": 3, "radius": 24, "isProgressive": true, "center": "{0.5, 0.5}", + "gradient": {"_class": "gradient", "gradientType": 0, "from": "{0.5, 0}", "to": "{0.5, 1}", "stops": [ + {"_class": "gradientStop", "position": 0, "color": color(0.0, 0.0, 0.0, 1.0)}, {"_class": "gradientStop", "position": 1, "color": color(0.0, 0.0, 0.0, 0.0)}]}}); + let (doc, warnings) = open(vec![ + styled(rect("Glass", 0.0, 0.0, 40.0, 40.0), "blurs", json!([glass])), + styled(rect("Prog", 50.0, 0.0, 40.0, 40.0), "blurs", json!([prog])), + ]); + assert!(matches!(node(&doc, "Glass").effects[0].kind, figcraft_doc::EffectKind::Glass(_)), "{warnings:?}"); + let figcraft_doc::EffectKind::BackgroundBlur(b) = &node(&doc, "Prog").effects[0].kind else { panic!("not a background blur") }; + assert_eq!(b.blur_type, figcraft_doc::BlurType::Progressive); + assert_eq!((b.start_radius, b.radius), (24.0, 0.0)); +} + +/// Angled (2), inside-square (3) and inside-arc (4) corners make the rectangle a path of that outline. +#[test] +fn cut_corners_become_paths() { + let cut = |name: &str, style: i64| { + let mut r = rect(name, 0.0, 0.0, 100.0, 80.0); + r["style"]["corners"] = json!({"_class": "MSImmutableStyleCorners", "radii": [10], "style": style, "smoothing": 0.6}); + r + }; + let (doc, _) = open(vec![cut("Angled", 2), cut("Square", 3), cut("Arc", 4)]); + let net = |n: &str| match &node(&doc, n).kind { + NodeKind::Vector { network } => network.clone(), + other => panic!("{n}: {other:?}"), + }; + let a = net("Angled"); + assert_eq!(a.vertices.len(), 8); + assert!(a.vertices.iter().any(|v| (v.x, v.y) == (0.0, 10.0)) && a.vertices.iter().any(|v| (v.x, v.y) == (10.0, 0.0))); + let s = net("Square"); + assert_eq!(s.vertices.len(), 12); + assert!(s.vertices.iter().any(|v| (v.x, v.y) == (10.0, 10.0)) && s.vertices.iter().any(|v| (v.x, v.y) == (90.0, 70.0))); + let arc = net("Arc"); + assert_eq!(arc.vertices.len(), 8); + assert!(arc.segments.iter().any(|g| g.ta != (0.0, 0.0)), "the corners are arcs"); +} diff --git a/crates/format/src/sketch/mod.rs b/crates/format/src/sketch/mod.rs index 576dbe062..8d8a465e1 100644 --- a/crates/format/src/sketch/mod.rs +++ b/crates/format/src/sketch/mod.rs @@ -13,6 +13,8 @@ #[cfg(test)] mod fixture; +#[cfg(test)] +mod frames_tests; mod path; #[cfg(test)] mod path_tests; @@ -22,6 +24,7 @@ mod proto_tests; mod shared; #[cfg(test)] mod shared_tests; +mod stack; mod style; #[cfg(test)] mod style_tests; diff --git a/crates/format/src/sketch/path.rs b/crates/format/src/sketch/path.rs index 149b48701..24ceca15f 100644 --- a/crates/format/src/sketch/path.rs +++ b/crates/format/src/sketch/path.rs @@ -100,6 +100,65 @@ pub(crate) fn network(cx: &mut Cx, l: &Value, w: f64, h: f64, fill_open: bool) - Some(VectorNetwork { vertices, segments, regions }) } +/// Rectangle `l` with angled (corner style 2), inside-square (3) or inside-arc (4) corners in its +/// style (Sketch 2025 and newer) as an edited rectangle whose points draw that outline, the +/// corners' `radii` (top left, top right, bottom right, bottom left; repeating) being how far +/// each cut reaches along both edges. `None` for any other layer. +pub(crate) fn cut_corners(l: &Value) -> Option { + if l.get("_class").and_then(Value::as_str) != Some("rectangle") || l.get("edited").and_then(Value::as_bool) == Some(true) { + return None; + } + let c = l.get("style")?.get("corners")?; + let style = c.get("style").and_then(Value::as_i64).filter(|s| (2..=4).contains(s))?; + let radii: Vec = c.get("radii")?.as_array()?.iter().filter_map(Value::as_f64).filter(|r| r.is_finite()).take(4).collect(); + if radii.iter().all(|r| *r <= 0.0) { + return None; + } + let (w, h) = size(l); + if w <= 0.0 || h <= 0.0 { + return None; + } + // Arc handles: a quarter circle's. + const K: f64 = 0.552_284_749_8; + let fmt = |(x, y): (f64, f64)| format!("{{{}, {}}}", x / w, y / h); + let curve = |p: (f64, f64), from: Option<(f64, f64)>, to: Option<(f64, f64)>| { + json!({"_class": "curvePoint", "cornerRadius": 0, "point": fmt(p), "curveMode": if from.or(to).is_some() { 4 } else { 1 }, + "hasCurveFrom": from.is_some(), "hasCurveTo": to.is_some(), "curveFrom": fmt(from.unwrap_or(p)), "curveTo": fmt(to.unwrap_or(p))}) + }; + // Corners clockwise from the top left, each with the directions to the edge before and after. + let corners = [ + ((0.0, 0.0), (0.0, 1.0), (1.0, 0.0)), + ((w, 0.0), (-1.0, 0.0), (0.0, 1.0)), + ((w, h), (0.0, -1.0), (-1.0, 0.0)), + ((0.0, h), (1.0, 0.0), (0.0, -1.0)), + ]; + let mut points = Vec::new(); + for (i, ((cx, cy), (px, py), (nx, ny))) in corners.into_iter().enumerate() { + let r = radii.get(i % radii.len()).copied().unwrap_or(0.0).clamp(0.0, w.min(h) / 2.0); + if r <= 0.0 { + points.push(curve((cx, cy), None, None)); + continue; + } + let a = (cx + r * px, cy + r * py); + let b = (cx + r * nx, cy + r * ny); + match style { + 2 => points.extend([curve(a, None, None), curve(b, None, None)]), + 3 => points.extend([curve(a, None, None), curve((cx + r * (px + nx), cy + r * (py + ny)), None, None), curve(b, None, None)]), + // A quarter circle about the corner, bulging into the shape. + _ => points + .extend([curve(a, Some((a.0 + K * r * nx, a.1 + K * r * ny)), None), curve(b, None, Some((b.0 + K * r * px, b.1 + K * r * py)))]), + } + } + let mut out = l.clone(); + out["edited"] = json!(true); + out["isClosed"] = json!(true); + out["points"] = Value::Array(points); + if let Some(st) = out.get_mut("style").and_then(Value::as_object_mut) { + st.remove("corners"); + } + Some(out) +} + /// A path, star, polygon or triangle layer: a star or polygon while its points are still the /// generated ones (same as FigCraft's, within half a percent), else an editable vector. pub(crate) fn shape(cx: &mut Cx, l: &Value, w: f64, h: f64) -> Option { diff --git a/crates/format/src/sketch/proto.rs b/crates/format/src/sketch/proto.rs index afa6df485..1a08d2687 100644 --- a/crates/format/src/sketch/proto.rs +++ b/crates/format/src/sketch/proto.rs @@ -104,11 +104,12 @@ pub(crate) fn layout_grids(l: &Value, h: f64, node: &mut JsonMap) } } -/// Notes about what the layer has that FigCraft keeps only as laid out: Smart Layout and Stacks, +/// Notes about what the layer has that FigCraft keeps only as laid out: Smart Layout, /// and overrides a master locks. pub(crate) fn notes(cx: &mut Cx, l: &Value) { - if l.get("groupLayout").and_then(|g| str_field(g, "_class")).is_some_and(|c| c != "MSImmutableFreeformGroupLayout") { - cx.warn("Smart Layout and stacks were imported as laid out; they don't resize with their content"); + // Stacks become auto layout; the older Smart Layout doesn't. + if l.get("groupLayout").and_then(|g| str_field(g, "_class")) == Some("MSImmutableInferredGroupLayout") { + cx.warn("Smart Layout was imported as laid out; it doesn't resize with its content"); } let locked = l.get("overrideProperties").and_then(Value::as_array).is_some_and(|p| p.iter().any(|o| bool_field(o, "canOverride") == Some(false))); if locked { diff --git a/crates/format/src/sketch/stack.rs b/crates/format/src/sketch/stack.rs new file mode 100644 index 000000000..a6b2ddb23 --- /dev/null +++ b/crates/format/src/sketch/stack.rs @@ -0,0 +1,99 @@ +//! Sketch 2025+ stacks (`groupLayout` `MSImmutableFlexGroupLayout`) → REST auto layout. +//! +//! The enums follow the order Sketch's plugin API documents them in (checked against files): +//! direction row, column; justify start, center, end, between, around, evenly; align items start, +//! center, end, stretch, none; stacking order first on top, last on top. Sizing (`horizontalSizing`, +//! `verticalSizing`) is fixed, fit (hug), fill, relative. Sketch lists a stack's first item last +//! (on top in the layer list), so the flow order is the reverse of its `layers`. + +use serde_json::{Map as JsonMap, Value, json}; + +/// Whether `l` is a stack. +pub(crate) fn is_stack(l: &Value) -> bool { + l.get("groupLayout").and_then(|g| g.get("_class")).and_then(Value::as_str) == Some("MSImmutableFlexGroupLayout") +} + +/// Make `node` (the REST node of frame `l`, its children already built in Sketch's order) an auto +/// layout frame when `l` is a stack. +pub(crate) fn apply(l: &Value, node: &mut JsonMap) { + if !is_stack(l) || !matches!(node.get("type").and_then(Value::as_str), Some("FRAME" | "COMPONENT" | "INSTANCE")) { + return; + } + let Some(g) = l.get("groupLayout") else { return }; + let int = |k: &str| g.get(k).and_then(Value::as_i64).unwrap_or(0); + let num = |v: &Value, k: &str| v.get(k).and_then(Value::as_f64).filter(|x| x.is_finite()).unwrap_or(0.0).clamp(0.0, 1e5); + let row = int("flexDirection") == 0; + node.insert("layoutMode".into(), json!(if row { "HORIZONTAL" } else { "VERTICAL" })); + node.insert("itemSpacing".into(), json!(num(g, "allGuttersGap"))); + node.insert( + "primaryAxisAlignItems".into(), + json!(match int("justifyContent") { + 1 => "CENTER", + 2 => "MAX", + 3 => "SPACE_BETWEEN", + 4 => "SPACE_AROUND", + 5 => "SPACE_EVENLY", + _ => "MIN", + }), + ); + let stretch = int("alignItems") == 3; + node.insert( + "counterAxisAlignItems".into(), + json!(match int("alignItems") { + 1 => "CENTER", + 2 => "MAX", + _ => "MIN", + }), + ); + if g.get("wrappingEnabled").and_then(Value::as_bool) == Some(true) { + node.insert("layoutWrap".into(), json!("WRAP")); + node.insert("counterAxisSpacing".into(), json!(num(g, "crossAxisGutterGap"))); + } + for (k, rest) in + [("leftPadding", "paddingLeft"), ("topPadding", "paddingTop"), ("rightPadding", "paddingRight"), ("bottomPadding", "paddingBottom")] + { + node.insert(rest.into(), json!(num(l, k))); + } + node.insert("itemReverseZIndex".into(), json!(int("stackingOrder") == 0)); + node.insert("strokesIncludedInLayout".into(), json!(g.get("bordersAffectLayout").and_then(Value::as_bool) == Some(true))); + // The stack's own sizing: fit hugs its content. + let (main, cross) = if row { ("horizontalSizing", "verticalSizing") } else { ("verticalSizing", "horizontalSizing") }; + let mode = |k: &str| if l.get(k).and_then(Value::as_i64) == Some(1) { "AUTO" } else { "FIXED" }; + node.insert("primaryAxisSizingMode".into(), json!(mode(main))); + node.insert("counterAxisSizingMode".into(), json!(mode(cross))); + // Items: flow order, sizing, absolute ones. + let sources: Vec<&Value> = super::tree::layers(l).iter().collect(); + if let Some(kids) = node.get_mut("children").and_then(Value::as_array_mut) { + // Children were built one per source layer, skipped ones aside: match them by id. + for kid in kids.iter_mut() { + let id = kid.get("id").and_then(Value::as_str).map(str::to_string); + let Some(src) = sources.iter().find(|s| id.is_some() && s.get("do_objectID").and_then(Value::as_str) == id.as_deref()) else { continue }; + let Some(m) = kid.as_object_mut() else { continue }; + item(src, m, row, stretch); + } + kids.reverse(); + } +} + +/// An item's place in its stack: absolute, or sized fixed, hugging or filling. +fn item(src: &Value, m: &mut JsonMap, row: bool, stretch: bool) { + if src.get("flexItem").and_then(|f| f.get("ignoreLayout")).and_then(Value::as_bool) == Some(true) { + m.insert("layoutPositioning".into(), json!("ABSOLUTE")); + return; + } + let sizing = |k: &str| match src.get(k).and_then(Value::as_i64) { + Some(1) => "HUG", + Some(2) => "FILL", + _ => "FIXED", + }; + let (h, v) = (sizing("horizontalSizing"), sizing("verticalSizing")); + m.insert("layoutSizingHorizontal".into(), json!(h)); + m.insert("layoutSizingVertical".into(), json!(v)); + let (main, cross) = if row { (h, v) } else { (v, h) }; + if main == "FILL" { + m.insert("layoutGrow".into(), json!(1)); + } + if cross == "FILL" || stretch { + m.insert("layoutAlign".into(), json!("STRETCH")); + } +} diff --git a/crates/format/src/sketch/style.rs b/crates/format/src/sketch/style.rs index f13515a6f..133206736 100644 --- a/crates/format/src/sketch/style.rs +++ b/crates/format/src/sketch/style.rs @@ -38,7 +38,8 @@ pub(crate) fn apply(cx: &mut Cx, style: &Value, w: f64, h: f64, node: &mut JsonM /// A style's fills as REST paints. pub(crate) fn fills(cx: &mut Cx, style: &Value, w: f64, h: f64) -> Vec { - list(style, "fills").iter().filter_map(|f| paint(cx, f, w, h)).collect() + // Tints (`layeringType` 1) colour the layers inside; they aren't paints of the layer. + list(style, "fills").iter().filter(|f| f.get("layeringType").and_then(Value::as_i64) != Some(1)).filter_map(|f| paint(cx, f, w, h)).collect() } /// A style's borders as REST paints. @@ -101,7 +102,10 @@ fn paint(cx: &mut Cx, f: &Value, w: f64, h: f64) -> Option { } }; p["visible"] = json!(f.get("isEnabled").and_then(Value::as_bool).unwrap_or(true)); - if let Some(var) = swatch(cx, f.get("color")) { + // A colour variable binds a plain colour (a gradient's or image's `color` is unused). + if f.get("fillType").and_then(Value::as_i64).unwrap_or(0) == 0 + && let Some(var) = swatch(cx, f.get("color")) + { p["boundVariables"] = var; } if let Some(ctx) = f.get("contextSettings") { @@ -131,7 +135,8 @@ fn gradient(g: &Value, w: f64, h: f64) -> Option { let across = if w > 0.0 && h > 0.0 { (from.0 - dy * e / w, from.1 + dx * e / h) } else { from }; ("GRADIENT_RADIAL", json!([pt(from), pt(to), pt(across)])) } - 2 => ("GRADIENT_ANGULAR", json!([pt((0.5, 0.5)), pt((0.5, 0.0))])), + // Sketch starts on the right and turns clockwise; from/to don't change it. + 2 => ("GRADIENT_ANGULAR", json!([pt((0.5, 0.5)), pt((1.0, 0.5)), pt((0.5, 1.0))])), _ => ("GRADIENT_LINEAR", json!([pt(from), pt(to)])), }; Some(json!({"type": ty, "gradientHandlePositions": handles, "gradientStops": stops})) @@ -167,6 +172,18 @@ fn borders(cx: &mut Cx, style: &Value, w: f64, h: f64, node: &mut JsonMap = o .get("dashPattern") @@ -218,6 +235,8 @@ pub(crate) fn effects(cx: &mut Cx, style: &Value) -> Vec { let mut out = Vec::new(); for (key, ty) in [("shadows", "DROP_SHADOW"), ("innerShadows", "INNER_SHADOW")] { for s in list(style, key) { + // Sketch 2025 and newer keep inner shadows in the one list, marked. + let ty = if s.get("isInnerShadow").and_then(Value::as_bool) == Some(true) { "INNER_SHADOW" } else { ty }; let mut c = s.get("color").and_then(color).unwrap_or_else(|| json!({"r": 0.0, "g": 0.0, "b": 0.0, "a": 0.5})); let o = s.get("contextSettings").and_then(|c| num(c, "opacity")).unwrap_or(1.0).clamp(0.0, 1.0); c["a"] = json!(c["a"].as_f64().unwrap_or(1.0) * o); @@ -231,18 +250,54 @@ pub(crate) fn effects(cx: &mut Cx, style: &Value) -> Vec { })); } } - if let Some(b) = style.get("blur").filter(|b| b.get("isEnabled").and_then(Value::as_bool) == Some(true)) { + // One `blur` (older files) or a list of `blurs` (Sketch 2025 and newer). + let one = style.get("blur").into_iter(); + let many = style.get("blurs").and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default().iter().take(MAX_LIST); + for b in one.chain(many).filter(|b| b.get("isEnabled").and_then(Value::as_bool) == Some(true)) { let radius = num(b, "radius").unwrap_or(0.0).clamp(0.0, 1e6); match b.get("type").and_then(Value::as_i64).unwrap_or(0) { 0 => out.push(json!({"type": "LAYER_BLUR", "visible": true, "radius": radius})), - 3 => out.push(json!({"type": "BACKGROUND_BLUR", "visible": true, "radius": radius})), - _ => cx.warn("motion and zoom blurs were skipped"), + 3 => out.push(background_blur(b, radius)), + 4 => out.push(json!({ + "type": "GLASS", + "visible": true, + "radius": radius, + "refraction": num(b, "distortion").unwrap_or(0.5).clamp(0.0, 1.0), + "depth": num(b, "depth").unwrap_or(0.5).clamp(0.0, 1.0), + })), + _ => { + // Motion and zoom blurs: a plain blur of half the radius softens about as much. + cx.warn("motion and zoom blurs were drawn as plain blurs"); + out.push(json!({"type": "LAYER_BLUR", "visible": true, "radius": radius / 2.0})); + } } } out.truncate(MAX_LIST); out } +/// A background blur; a progressive one (`isProgressive`) ramps along its gradient, whose stops' +/// opacity scales the radius at each end. +fn background_blur(b: &Value, radius: f64) -> Value { + let g = b.get("gradient").filter(|_| b.get("isProgressive").and_then(Value::as_bool) == Some(true)); + let Some(g) = g else { return json!({"type": "BACKGROUND_BLUR", "visible": true, "radius": radius}) }; + let stops = g.get("stops").and_then(Value::as_array).map(Vec::as_slice).unwrap_or_default(); + let at = |s: Option<&Value>| s.and_then(|s| s.get("color")).and_then(|c| num(c, "alpha")).unwrap_or(1.0).clamp(0.0, 1.0) * radius; + let end = |k: &str, d: (f64, f64)| { + let (x, y) = g.get(k).and_then(Value::as_str).and_then(super::path::parse_point).unwrap_or(d); + json!({"x": x.clamp(-1e3, 1e3), "y": y.clamp(-1e3, 1e3)}) + }; + json!({ + "type": "BACKGROUND_BLUR", + "visible": true, + "blurType": "PROGRESSIVE", + "startRadius": at(stops.first()), + "radius": at(stops.last()), + "startOffset": end("from", (0.5, 0.0)), + "endOffset": end("to", (0.5, 1.0)), + }) +} + /// A bitmap's colour adjustments (`colorControls`: saturation and contrast 0–2 with 1 neutral, /// brightness −1–1, hue in radians) as REST image filters; hue has no filter (a note). pub(crate) fn color_controls(cx: &mut Cx, style: Option<&Value>) -> Option { @@ -264,6 +319,79 @@ pub(crate) fn swatch(cx: &Cx, c: Option<&Value>) -> Option { Some(json!({"color": {"type": "VARIABLE_ALIAS", "id": id}})) } +/// The tint a style gives the layers inside: its first enabled plain fill with `layeringType` 1 +/// (Sketch 2025 and newer), or with no `layeringType` when `legacy` (older files: a group's or +/// instance's fill was its tint). Sketch draws a tint as the colour of everything inside. +pub(crate) fn tint_of(style: Option<&Value>, legacy: bool) -> Option { + let fills = style?.get("fills")?.as_array()?; + let f = fills.iter().filter(|f| f.get("isEnabled").and_then(Value::as_bool) != Some(false)).find(|f| { + match f.get("layeringType").and_then(Value::as_i64) { + Some(t) => t == 1, + None => legacy, + } + })?; + (f.get("fillType").and_then(Value::as_i64).unwrap_or(0) == 0).then(|| f.get("color").cloned()).flatten() +} + +/// Recolour `layers` (Sketch JSON) with tint `color`: every enabled fill and border takes it, +/// text takes it, nested instances take it as their own tint. Opacity stays as it was. +pub(crate) fn tint_layers(layers: &mut [Value], color: &Value, depth: usize) { + if depth > 64 { + return; + } + for l in layers { + if let Some(st) = l.get_mut("style").and_then(Value::as_object_mut) { + for key in ["fills", "borders"] { + for p in st.get_mut(key).and_then(Value::as_array_mut).into_iter().flatten() { + if let Some(m) = p.as_object_mut() + && m.get("isEnabled").and_then(Value::as_bool) != Some(false) + && !matches!(m.get("fillType").and_then(Value::as_i64), Some(4)) + { + let c = tinted(m.get("color"), color); + m.insert("fillType".into(), json!(0)); + m.insert("color".into(), c); + } + } + } + if let Some(enc) = st.get_mut("textStyle").and_then(|t| t.get_mut("encodedAttributes")).and_then(Value::as_object_mut) { + let c = tinted(enc.get("MSAttributedStringColorAttribute"), color); + enc.insert("MSAttributedStringColorAttribute".into(), c); + } + } + if let Some(runs) = l.get_mut("attributedString").and_then(|a| a.get_mut("attributes")).and_then(Value::as_array_mut) { + for r in runs.iter_mut().filter_map(|r| r.get_mut("attributes")).filter_map(Value::as_object_mut) { + let c = tinted(r.get("MSAttributedStringColorAttribute"), color); + r.insert("MSAttributedStringColorAttribute".into(), c); + } + } + if l.get("_class").and_then(Value::as_str) == Some("symbolInstance") { + set_tint(l, color); + } + if let Some(kids) = l.get_mut("layers").and_then(Value::as_array_mut) { + tint_layers(kids, color, depth + 1); + } + } +} + +/// Colour `old` (Sketch JSON) tinted with `tint`: the tint's colour, with both opacities. +fn tinted(old: Option<&Value>, tint: &Value) -> Value { + let alpha = |c: Option<&Value>| c.and_then(|c| num(c, "alpha")).unwrap_or(1.0).clamp(0.0, 1.0); + let mut c = tint.clone(); + c["alpha"] = json!(alpha(Some(tint)) * alpha(old)); + c +} + +/// Give layer `l` (Sketch JSON) tint `color`: as its one fill. +pub(crate) fn set_tint(l: &mut Value, color: &Value) { + let fill = json!({"_class": "fill", "isEnabled": true, "fillType": 0, "color": color}); + if let Some(m) = l.as_object_mut() { + let st = m.entry("style").or_insert_with(|| json!({"_class": "style"})); + if let Some(st) = st.as_object_mut() { + st.insert("fills".into(), json!([fill])); + } + } +} + /// Sketch's blend modes (0 normal … 17 plus lighter) by REST name. fn blend(mode: i64) -> Option<&'static str> { const MODES: [&str; 18] = [ diff --git a/crates/format/src/sketch/style_tests.rs b/crates/format/src/sketch/style_tests.rs index 242b0478b..b5d24bdf8 100644 --- a/crates/format/src/sketch/style_tests.rs +++ b/crates/format/src/sketch/style_tests.rs @@ -78,7 +78,10 @@ fn gradients() { assert_eq!(lin.stops.len(), 2); assert_eq!(lin.stops[1].color.b, 1.0); assert_eq!(g("Radial").kind, GradientKind::Radial); - assert_eq!(g("Angular").kind, GradientKind::Angular); + // Sketch starts an angular gradient on the right and turns clockwise, whatever its from/to. + let ang = g("Angular"); + assert_eq!(ang.kind, GradientKind::Angular); + assert_eq!((ang.from, ang.to, ang.width), ((0.5, 0.5), (1.0, 0.5), (0.5, 1.0))); // The radial gradient's width handle: half the length, across the main axis (in pixels). let rad = g("Radial"); let (dx, dy) = ((rad.width.0 - rad.from.0) * 100.0, (rad.width.1 - rad.from.1) * 50.0); @@ -160,7 +163,8 @@ fn shadows_and_blurs() { assert!(matches!(fx[2].kind, EffectKind::InnerShadow(_))); assert!(matches!(node(&doc, "Blurred").effects[0].kind, EffectKind::LayerBlur(_))); assert!(matches!(node(&doc, "Frosted").effects[0].kind, EffectKind::BackgroundBlur(_))); - assert!(node(&doc, "Moving").effects.is_empty()); + // Motion blur: drawn as a plain blur of half the radius. + assert!(matches!(node(&doc, "Moving").effects[0].kind, EffectKind::LayerBlur(_))); assert!(warnings.iter().any(|w| w.contains("motion")), "{warnings:?}"); } diff --git a/crates/format/src/sketch/symbols.rs b/crates/format/src/sketch/symbols.rs index 1292c0254..06a39f680 100644 --- a/crates/format/src/sketch/symbols.rs +++ b/crates/format/src/sketch/symbols.rs @@ -114,21 +114,49 @@ pub(crate) fn master_fills(m: &Value) -> Option { Some(json!([{"type": "SOLID", "color": c}])) } +/// What a master shows as a frame (its instances the same): clipping, and in Sketch 2025 and newer +/// its style (fills, borders, effects) and corners. +fn frame_look(cx: &mut Cx, m: &Value, w: f64, h: f64, node: &mut JsonMap) { + // `clippingBehavior` 2 doesn't clip. + node.insert("clipsContent".into(), json!(m.get("clippingBehavior").and_then(Value::as_i64) != Some(2))); + if m.get("groupBehavior").is_some() + && let Some(st) = m.get("style") + { + // Tint fills aren't painted (see `style::fills`). + super::style::apply(cx, st, w, h, node); + } + super::tree::style_corners(m, node); +} + /// A symbol master as a COMPONENT node. pub(crate) fn component(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: bool) -> Option { let (w, h) = size(l); let world = parent * local(l, w, h); let mut node = base(l, "COMPONENT", parent, world, w, h, root); - node.insert("clipsContent".into(), json!(true)); + frame_look(cx, l, w, h, &mut node); if let Some(f) = master_fills(l) { node.insert("fills".into(), f); } super::tree::extras(cx, l, h, &mut node); let sid = str_field(l, "symbolID").unwrap_or("").to_string(); + // A graphic's fill tints its layers. + let tinted; + let l = match super::style::tint_of(l.get("style"), false) { + Some(t) => { + let mut c = l.clone(); + if let Some(kids) = c.get_mut("layers").and_then(Value::as_array_mut) { + super::style::tint_layers(kids, &t, 0); + } + tinted = c; + &tinted + } + _ => l, + }; cx.chain.push(sid); let kids = children(cx, l, world, (w, h), depth, false); cx.chain.pop(); node.insert("children".into(), Value::Array(kids)); + super::stack::apply(l, &mut node); Some(Value::Object(node)) } @@ -161,15 +189,20 @@ pub(crate) fn instance(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, roo } let mut node = base(l, "INSTANCE", parent, world, w, h, root); node.insert("componentId".into(), json!(str_field(&m, "do_objectID").unwrap_or(sid))); - node.insert("clipsContent".into(), json!(true)); + frame_look(cx, &m, w, h, &mut node); // Instances show the master's background only when it says so. if bool_field(&m, "includeBackgroundColorInInstance") == Some(true) && let Some(f) = master_fills(&m) { node.insert("fills".into(), f); } + // An instance's fill is a tint for its layers, not a paint of its own. if let Some(st) = l.get("style") { - super::style::apply(cx, st, w, h, &mut node); + let mut st = st.clone(); + if let Some(o) = st.as_object_mut() { + o.remove("fills"); + } + super::style::apply(cx, &st, w, h, &mut node); } super::tree::extras(cx, l, h, &mut node); // An instance shows its master's grids (else they'd differ, and count as an override). @@ -187,21 +220,45 @@ pub(crate) fn instance(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, roo // The budget ran out handing overrides on: noted. cx.spend(1); } - // The master's layers laid out for the instance's size, as Sketch does it. - let (mw, mh) = size(©); - if ((mw - w).abs() > 1e-9 || (mh - h).abs() > 1e-9) + // The tint: the instance's own (a colour override on it, or its fill), else a graphic master's. + let own = str_field(l, "do_objectID").map(|id| format!("{id}_fillColor")); + let tint = own + .and_then(|k| overrides.get(&k).filter(|c| c.is_object()).cloned()) + .or_else(|| super::style::tint_of(l.get("style"), true)) + .or_else(|| super::style::tint_of(copy.get("style"), false)); + if let Some(t) = tint && let Some(layers) = copy.get_mut("layers").and_then(Value::as_array_mut) { - resize(layers, (mw, mh), (w, h), cx.legacy_resize, 0); + super::style::tint_layers(layers, &t, 0); + } + // The master's layers laid out for the instance's size, as Sketch does it. + let (mw, mh) = size(©); + // A graphic's layers resize in proportion, whatever their pins. + let graphic = copy.get("groupBehavior").and_then(Value::as_i64) == Some(2); + // A stack's layers are placed by its auto layout (when the file is opened), not by their pins. + let stacked = !graphic && super::stack::is_stack(©); + if ((mw - w).abs() > 1e-9 || (mh - h).abs() > 1e-9) + && !stacked + && let Some(layers) = copy.get_mut("layers").and_then(Value::as_array_mut) + { + resize(layers, (mw, mh), (w, h), cx.legacy_resize || graphic, 0); } cx.chain.push(sid.to_string()); let mut kids = children(cx, ©, world, (w, h), depth, false); cx.chain.pop(); + node.insert("children".into(), Value::Array(std::mem::take(&mut kids))); + // The master's stack lays the instance out too (matched by the master's layer ids), sized as + // the instance says. + for k in ["horizontalSizing", "verticalSizing"] { + if let Some(v) = l.get(k) { + copy[k] = v.clone(); + } + } + super::stack::apply(©, &mut node); let prefix = str_field(l, "do_objectID").unwrap_or("I").to_string(); - for k in &mut kids { + for k in node.get_mut("children").and_then(Value::as_array_mut).into_iter().flatten() { prefix_ids(k, &prefix, 0); } - node.insert("children".into(), Value::Array(kids)); Some(Value::Object(node)) } @@ -213,7 +270,7 @@ fn resize(layers: &mut [Value], old: (f64, f64), new: (f64, f64), legacy: bool, return; } for l in layers { - let mask = if legacy { 63 } else { l.get("resizingConstraint").and_then(Value::as_i64).unwrap_or(63) }; + let mask = if legacy { 63 } else { super::tree::pin_mask(l) }; let Some(f) = l.get_mut("frame").and_then(Value::as_object_mut) else { continue }; let n = |k: &str| f.get(k).and_then(Value::as_f64).filter(|v| v.is_finite()).unwrap_or(0.0); let (x, y, w, h) = (n("x"), n("y"), n("width").max(0.0), n("height").max(0.0)); @@ -224,8 +281,10 @@ fn resize(layers: &mut [Value], old: (f64, f64), new: (f64, f64), legacy: bool, for (k, v) in [("x", nx), ("y", ny), ("width", nw), ("height", nh)] { f.insert(k.into(), json!(v)); } + // A graphic's layers resize in proportion, whatever their pins. + let graphic = l.get("groupBehavior").and_then(Value::as_i64) == Some(2); if let Some(kids) = l.get_mut("layers").and_then(Value::as_array_mut) { - resize(kids, (w, h), (nw, nh), legacy, depth + 1); + resize(kids, (w, h), (nw, nh), legacy || graphic, depth + 1); } } } @@ -316,19 +375,46 @@ fn apply( own.extend(inner.iter().take(take).map(|(rest, v)| json!({"_class": "overrideValue", "overrideName": rest, "value": v}))); l["overrideValues"] = Value::Array(own); } + if let Some(v) = get("isVisible") { + l["isVisible"] = json!(visible(v)); + } + // A colour override on an instance is its tint. + if let Some(c) = get("fillColor").filter(|c| c.is_object()) { + super::style::set_tint(l, c); + } continue; } Some("text") => { + if let Some(v) = get("isVisible") { + l["isVisible"] = json!(visible(v)); + } if let Some(s) = get("stringValue").and_then(Value::as_str) { set_string(l, s); } + if let Some(c) = get("textColor").filter(|c| c.is_object()) { + super::style::tint_layers(std::slice::from_mut(l), c, 0); + } } Some("bitmap") => { + if let Some(v) = get("isVisible") { + l["isVisible"] = json!(visible(v)); + } if let Some(img) = get("image").filter(|v| v.get("_ref").is_some()) { l["image"] = img.clone(); } } - _ => {} + _ => { + if let Some(v) = get("isVisible") { + l["isVisible"] = json!(visible(v)); + } + // A colour override on a shape or group: its first fill's colour. + if let Some(c) = get("fillColor").filter(|c| c.is_object()) + && let Some(f) = l.get_mut("style").and_then(|s| s.get_mut("fills")).and_then(Value::as_array_mut).and_then(|f| f.first_mut()) + { + f["fillType"] = json!(0); + f["color"] = c.clone(); + } + } } for (prop, text) in [("layerStyle", false), ("textStyle", true)] { let sid = get(prop).and_then(Value::as_str); @@ -357,6 +443,11 @@ fn apply( } } +/// A visibility override's value: "0", 0 or false hide. +fn visible(v: &Value) -> bool { + !matches!(v, Value::Bool(false)) && v.as_str() != Some("0") && v.as_i64() != Some(0) +} + /// A text layer's string replaced, in the style of its first run. fn set_string(l: &mut Value, s: &str) { let units = s.encode_utf16().count(); diff --git a/crates/format/src/sketch/text.rs b/crates/format/src/sketch/text.rs index e1f0c2633..0dd8d596b 100644 --- a/crates/format/src/sketch/text.rs +++ b/crates/format/src/sketch/text.rs @@ -60,14 +60,17 @@ pub(crate) fn node(cx: &mut Cx, l: &Value, node: &mut JsonMap) { _ => "TOP", }), ); - m.insert( - "textAutoResize".into(), - json!(match l.get("textBehaviour").and_then(Value::as_i64) { - Some(1) => "HEIGHT", - Some(2) => "NONE", - _ => "WIDTH_AND_HEIGHT", - }), - ); + // Sketch 2025 and newer size text by `horizontalSizing`/`verticalSizing` (1 fits). + let fits = |k: &str| l.get(k).and_then(Value::as_i64) == Some(1); + let resize = match l.get("textBehaviour").and_then(Value::as_i64) { + Some(1) => "HEIGHT", + Some(2) => "NONE", + Some(_) => "WIDTH_AND_HEIGHT", + None if l.get("horizontalSizing").is_none() || fits("horizontalSizing") => "WIDTH_AND_HEIGHT", + None if fits("verticalSizing") => "HEIGHT", + None => "NONE", + }; + m.insert("textAutoResize".into(), json!(resize)); } node.insert("characters".into(), json!(string)); node.insert("style".into(), style); diff --git a/crates/format/src/sketch/tree.rs b/crates/format/src/sketch/tree.rs index 9a5bfaa33..3d6a48d33 100644 --- a/crates/format/src/sketch/tree.rs +++ b/crates/format/src/sketch/tree.rs @@ -151,6 +151,15 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: cx.too_old = true; return None; } + // A rectangle with angled or inside corners is a path of that outline. + let outlined; + let l = match super::path::cut_corners(l) { + Some(p) => { + outlined = p; + &outlined + } + None => l, + }; let class = str_field(l, "_class")?; if class == "shapeGroup" { return count(cx).then(|| super::path::shape_group(cx, l, parent, depth, root)).flatten(); @@ -163,6 +172,8 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: } let ty = match class { "artboard" | "frame" => "FRAME", + // Sketch 2025 and newer: a group that behaves as a frame (1) or a graphic (2), or clips. + "group" if is_frame(l) => "FRAME", "group" | "graphic" => "GROUP", // Shapes whose points were moved are paths. "rectangle" | "oval" if bool_field(l, "edited") == Some(true) => "VECTOR", @@ -204,6 +215,10 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: node.insert("fills".into(), json!([{"type": "SOLID", "color": c}])); } } + "group" if ty == "FRAME" => { + // `clippingBehavior`: 0 the default (frames clip), 1 clip, 2 don't. + node.insert("clipsContent".into(), json!(l.get("clippingBehavior").and_then(Value::as_i64) != Some(2))); + } "rectangle" => corner_radii(l, &mut node), "bitmap" => match l.get("image").and_then(|i| str_field(i, "_ref")) { Some(r) => { @@ -219,17 +234,80 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: } styles(cx, l, w, h, &mut node); extras(cx, l, h, &mut node); + style_corners(l, &mut node); if class == "MSImmutableHotspotLayer" || class == "hotspot" { node.insert("clipsContent".into(), json!(false)); node.remove("fills"); } + // A group's or graphic's fill tints its layers (a frame's is its background). + let tinted; + let gb = l.get("groupBehavior").and_then(Value::as_i64); + let l = match (class, super::style::tint_of(l.get("style"), gb != Some(1))) { + ("group", Some(t)) => { + // A plain group's legacy fill is all tint; a frame keeps its background fills. + if gb != Some(1) { + node.remove("fills"); + } + let mut c = l.clone(); + if let Some(kids) = c.get_mut("layers").and_then(Value::as_array_mut) { + super::style::tint_layers(kids, &t, 0); + } + tinted = c; + &tinted + } + _ => l, + }; if matches!(ty, "FRAME" | "GROUP") { let kids = children(cx, l, world, (w, h), depth, false); node.insert("children".into(), Value::Array(kids)); + super::stack::apply(l, &mut node); } Some(Value::Object(node)) } +/// A Sketch 2025+ group that is a frame: it behaves as a frame or a graphic, or clips. +pub(crate) fn is_frame(l: &Value) -> bool { + matches!(l.get("groupBehavior").and_then(Value::as_i64), Some(1 | 2)) || l.get("clippingBehavior").and_then(Value::as_i64) == Some(1) +} + +/// Corners kept in the style (Sketch 2025+: one radius for all, or one per corner from the top +/// left, clockwise) on shapes and frames that have corners; smooth corners keep their smoothing. +pub(crate) fn style_corners(l: &Value, node: &mut JsonMap) { + let Some(c) = l.get("style").and_then(|s| s.get("corners")) else { return }; + if !matches!(node.get("type").and_then(Value::as_str), Some("RECTANGLE" | "FRAME" | "COMPONENT" | "INSTANCE")) { + return; + } + let radii: Vec = c + .get("radii") + .and_then(Value::as_array) + .map(Vec::as_slice) + .unwrap_or_default() + .iter() + .filter_map(Value::as_f64) + .filter(|r| r.is_finite()) + .map(|r| r.clamp(0.0, MAX_SIZE)) + .take(4) + .collect(); + match radii.as_slice() { + [] => return, + [r] => { + node.insert("cornerRadius".into(), json!(r)); + node.remove("rectangleCornerRadii"); + } + more => { + // Values repeat to fill the four corners. + let all: Vec = (0..4).map(|i| more.get(i % more.len()).copied().unwrap_or(0.0)).collect(); + node.insert("rectangleCornerRadii".into(), json!(all)); + } + } + // Style 1 is smooth: its smoothing applies. + if c.get("style").and_then(Value::as_i64) == Some(1) + && let Some(sm) = c.get("smoothing").and_then(Value::as_f64).filter(|v| v.is_finite()) + { + node.insert("cornerSmoothing".into(), json!(sm.clamp(0.0, 1.0))); + } +} + /// Layer `l`'s style into `node`, and its links to the styles made from its shared style. pub(crate) fn styles(cx: &mut Cx, l: &Value, w: f64, h: f64, node: &mut JsonMap) { // An artboard shows its background colour only; Sketch doesn't draw a style it carries. @@ -291,7 +369,7 @@ pub(crate) fn base(l: &Value, ty: &str, parent: Affine, world: Affine, w: f64, h let bb = world.transform_rect_bbox(Rect::new(0.0, 0.0, w, h)); node.insert("absoluteBoundingBox".into(), json!({"x": bb.x0, "y": bb.y0, "width": bb.width(), "height": bb.height()})); } - node.insert("constraints".into(), constraints(l.get("resizingConstraint").and_then(Value::as_i64).unwrap_or(63))); + node.insert("constraints".into(), constraints(pin_mask(l))); node } @@ -317,6 +395,33 @@ pub(crate) fn local(l: &Value, w: f64, h: f64) -> Affine { * Affine::translate((-w / 2.0, -h / 2.0)) } +/// A layer's pins as a `resizingConstraint` mask. Sketch 2025 and newer keep them in +/// `horizontalPins`/`verticalPins` (bits: 1 the start, 4 the end) and `horizontalSizing`/ +/// `verticalSizing` (fixed and fit keep the size; fill and relative don't), with +/// `resizingConstraint` left at 63. +pub(crate) fn pin_mask(l: &Value) -> i64 { + if l.get("horizontalPins").is_none() && l.get("horizontalSizing").is_none() { + return l.get("resizingConstraint").and_then(Value::as_i64).unwrap_or(63); + } + let int = |k: &str| l.get(k).and_then(Value::as_i64).unwrap_or(0); + let fixed = |k: &str| matches!(int(k), 0 | 1); + let mut mask = 63; + // A cleared bit pins: right 1, width 2, left 4, bottom 8, height 16, top 32. + for (on, bit) in [ + (int("horizontalPins") & 1 != 0, 4), + (int("horizontalPins") & 4 != 0, 1), + (fixed("horizontalSizing"), 2), + (int("verticalPins") & 1 != 0, 32), + (int("verticalPins") & 4 != 0, 8), + (fixed("verticalSizing"), 16), + ] { + if on { + mask &= !bit; + } + } + mask +} + /// REST constraints from Sketch's `resizingConstraint`: six bits, a cleared bit pins that side or /// fixes that size (right 1, width 2, left 4, bottom 8, height 16, top 32). A layer pinned on /// neither side keeps its place in proportion (scale) unless its size is fixed (centre). diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 8759a3597..4d7b92edd 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -18,7 +18,7 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| | `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included; a flow that records no primary-axis sizing hugs on that axis, an instance that records no auto layout has its main's), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Since 2026-10-17 (community batches #727, #728): an instance's own identity and the cached library components a file carries, overrides applied by key and order, local text values and instance overrides over a shared text style, grid track sizes (fixed, content-sized, fill), slot content, labels of connectors saved with their drawn path (a static snapshot; the ends aren't live), skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, editable text on a path, image adjustments and images carried in the message. Budgets come from the file's own size (one value per compressed byte, 20M–128M, lower ceilings on 32-bit targets; the layer cap follows), so a 15.4 MB synthetic file with 300,000 layers opens whole; the file's bytes stay out of the command journal; an import report lists what was left out or changed once the file opens. Not read: elbowed or curved connectors without a saved path (drawn straight) and labels of connectors without a saved snapshot, table cells beyond their own layers, filled areas with their own fills, variables bound to fields the editor can't bind, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs` and the per-feature `*_tests.rs` beside them, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | -| `.sketch` (Sketch 48 and newer) | — (Figma's own Sketch import runs in its web app) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards (and Sketch 2025 frames) as frames with their background, groups, rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (a mask that shows its own style draws a copy under itself, as Sketch does; broken mask chains wrapped); text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts from PostScript names matched to installed families; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), laid out for their size the way Sketch does it (proportional sharing per pins from format 110, scaling before) and still live; master backgrounds in instances only where Sketch shows them; Apple's system fonts found under the names designs use, with the platform's tracking kept as letter spacing; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids. Warnings: noise fills, motion and zoom blurs, embedded fonts (not used), Smart Layout and stacks (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (70,000 layers open in ~3 s, debug build); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 70 in at most 4.4%; Sketch 2025 files on fixtures only | 5–10 (Smart Layout as auto layout, real Sketch 2025 files) | +| `.sketch` (Sketch 48 and newer) | — (Figma's own Sketch import runs in its web app) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards as frames with their background, groups; Sketch 2025 and newer: frames (clipping or not) with their style, graphics, stacks as auto layout (direction, gap, alignment, padding, wrap, hug/fill sizing, items ignoring the stack), corners in the style (rounded, smooth with its smoothing; angled, inside square and inside arc as paths), pins and sizing, per-side borders, lists of blurs (progressive background blurs, glass), inner shadows in the shadow list, tints (a graphic's, group's or instance's fill colouring its layers, and colour overrides), text colour and visibility overrides, text sized by its sizing; rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (a mask that shows its own style draws a copy under itself, as Sketch does; broken mask chains wrapped); text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts from PostScript names matched to installed families; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), laid out for their size the way Sketch does it (proportional sharing per pins from format 110, scaling before) and still live; master backgrounds in instances only where Sketch shows them; Apple's system fonts found under the names designs use, with the platform's tracking kept as letter spacing; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids. Instances of a stack laid out at their size and texts an override changed measured again on open. Warnings: noise fills, motion and zoom blurs (drawn as plain blurs), embedded fonts (not used), Smart Layout (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (70,000 layers open in ~3 s, debug build); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 70 in at most 4.4%, a Sketch 64 file's 65 artboards 2.1% on average, a Sketch 2026 showcase file's 16 frames 1.2% on average (at most 3.2%) | 5–10 (Smart Layout as auto layout, progressive layer opacity, motion and zoom blurs) | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | | REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout (sizing modes left out read as hug, as documented; grid track sizes from `gridColumnsSizing` / `gridRowsSizing`: px, fr, auto, `minmax(0, 1fr)`, `repeat()`), constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, slots (`SLOT` layers bound to their slot property; an instance's slot keeps its content as the instance's own unless its property value is the main's default content; slot limits and preferred components are warnings), styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings, image adjustments (the same tint sign as `.fig`); the import report after opening; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | @@ -166,7 +166,7 @@ each. | Date | Change | Summary | |---|---|---| -| 2026-10-21 | minor | `.sketch` import (best effort): files saved by Sketch 48 and newer open and import like `.fig` files (open, import, drop, CLI, MCP), mapped onto the REST importer: layers, paths, shape groups and booleans, styles and effects, masks, text, symbols with overrides (live instances), shared styles, Color Variables, prototype links, export settings and grids; older files are refused with a message. Checked on fixtures and locally on one real Sketch 50 file and the IBM Carbon Design Kit (Sketch 47, 68, 83). Numbers unchanged | +| 2026-10-21 | minor | `.sketch` import (best effort): files saved by Sketch 48 and newer open and import like `.fig` files (open, import, drop, CLI, MCP), mapped onto the REST importer: layers, paths, shape groups and booleans, styles and effects, masks, text, symbols with overrides (live instances), shared styles, Color Variables, prototype links, export settings and grids; older files are refused with a message. Sketch 2025 and newer: frames, graphics, stacks as auto layout, corners, pins and sizing, tints, per-side borders, blur lists. Checked on fixtures and locally on real Sketch 50, 64 and 2026 files and the IBM Carbon Design Kit (Sketch 47, 68, 83). Numbers unchanged | | 2026-10-18 | minor | REST file JSON import keeps `SLOT` layers (#792): they were dropped with everything placed in them, which emptied every instance's slot. A slot in a main component becomes a slot frame bound to its `SLOT` property (the one it references, else the one named like it, else the only one left), and an instance's slot holds the instance's own content, kept across syncs, moves of the mains and saving, unless the instance's property value is the main's default content (without values, a slot that holds layers keeps them). Instances in slot content link to their own mains. Slot content limits, preferred-only and preferred components are warnings. Synthetic files only. Numbers unchanged | | 2026-10-17 | minor | REST file JSON import reads grid track sizes from the CSS track strings `gridColumnsSizing` / `gridRowsSizing` (fixed px, fill fr, hug `auto`, `minmax(0, 1fr)`, `repeat()`; other tracks stay equal) (#465). Numbers unchanged | | 2026-10-17 | minor | The community batches #727 and #728 in the `.fig` row: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments (also REST), images in the message; budgets from the file's size; the journal keeps no file bytes; the import report. Not read cut to what's left. A `.fig` copy from Save as. Pasted content: layers copied from another design app, best effort (tested only with clipboard HTML made from our own export), and images under Wayland (not run there). All on synthetic files: summary and hours unchanged | From 41ff790d779d4755df693aa8c9a14d4054b25940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 22:58:19 +0200 Subject: [PATCH 489/817] M6: Sketch import: variable font axes; no false embedded-font note Sketch keys a font's variation axes by the tag read as a number; they map onto the text style's variations (a fontVariations key in the REST mapping). Font references without font data only name the fonts a document uses and no longer raise the embedded-font note. Co-Authored-By: Claude Opus 5.5 --- crates/format/src/rest/text.rs | 9 +++++++++ crates/format/src/sketch/mod.rs | 15 +++++++++++---- crates/format/src/sketch/text.rs | 20 ++++++++++++++++++++ crates/format/src/sketch/text_tests.rs | 24 ++++++++++++++++++++++++ docs/file-format-parity.md | 2 +- 5 files changed, 65 insertions(+), 5 deletions(-) diff --git a/crates/format/src/rest/text.rs b/crates/format/src/rest/text.rs index 367677a6f..99ceb5002 100644 --- a/crates/format/src/rest/text.rs +++ b/crates/format/src/rest/text.rs @@ -102,6 +102,15 @@ fn type_style(cx: &mut Ctx, s: &Value, base: &TextStyle) -> TextStyle { let weight = num(s, "fontWeight").map_or_else(|| t.weight(), |w| w.clamp(1.0, 1000.0) as u16); t.font_style = style_name(weight, flag(s, "italic").unwrap_or_else(|| t.italic())); } + // Variable font axes, `{tag: value}` (FigCraft's own key; the Sketch importer writes it). + if let Some(axes) = s.get("fontVariations").and_then(Value::as_object) { + t.variations = axes + .iter() + .take(64) + .filter(|(k, _)| k.len() == 4 && k.is_ascii()) + .filter_map(|(k, v)| Some((k.clone(), v.as_f64().filter(|x| x.is_finite())?.clamp(-1e5, 1e5)))) + .collect(); + } if let Some(size) = num(s, "fontSize").filter(|x| *x > 0.0) { t.font_size = size.clamp(0.5, 10_000.0); } diff --git a/crates/format/src/sketch/mod.rs b/crates/format/src/sketch/mod.rs index 8d8a465e1..15df9d221 100644 --- a/crates/format/src/sketch/mod.rs +++ b/crates/format/src/sketch/mod.rs @@ -127,12 +127,19 @@ fn import_parts(bytes: &[u8], name: &str, max_member: u64, max_nodes: usize) -> Ok((doc, warnings)) } -/// The note about fonts the file carries (Sketch 7x and newer can embed them): FigCraft doesn't -/// use fonts from inside documents, so their text shows in installed fonts. +/// The note about fonts the file carries (Sketch 7x and newer can embed them, as `fontReferences` +/// with `fontData`): FigCraft doesn't use fonts from inside documents, so their text shows in +/// installed fonts. fn embedded_fonts(document: &Value) -> Option { let refs = document.get("fontReferences").and_then(Value::as_array)?; - let families: BTreeSet = - refs.iter().filter_map(|r| r.get("fontFamilyName").and_then(Value::as_str)).map(|f| f.chars().take(64).collect()).take(20).collect(); + // A reference without font data only names a font the document uses. + let families: BTreeSet = refs + .iter() + .filter(|r| r.get("fontData").is_some()) + .filter_map(|r| r.get("fontFamilyName").and_then(Value::as_str)) + .map(|f| f.chars().take(64).collect()) + .take(20) + .collect(); if families.is_empty() { return None; } diff --git a/crates/format/src/sketch/text.rs b/crates/format/src/sketch/text.rs index 0dd8d596b..766927906 100644 --- a/crates/format/src/sketch/text.rs +++ b/crates/format/src/sketch/text.rs @@ -129,6 +129,9 @@ pub(crate) fn type_style(cx: &mut Cx, a: &Value) -> Value { cx.warn("text without a font uses Helvetica"); } let mut s = json!({"fontFamily": family, "fontStyle": style, "fontSize": size.min(10_000.0)}); + if let Some(v) = font.and_then(|f| f.get("variation")).and_then(variations) { + s["fontVariations"] = v; + } let p = a.get("paragraphStyle"); let line = |k: &str| p.and_then(|p| p.get(k)).and_then(Value::as_f64).filter(|v| v.is_finite() && *v > 0.0); if let Some(lh) = line("maximumLineHeight").or_else(|| line("minimumLineHeight")) { @@ -160,6 +163,23 @@ pub(crate) fn type_style(cx: &mut Cx, a: &Value) -> Value { s } +/// A font's `variation` (axis values keyed by the axis tag read as a big-endian number, as Apple's +/// text engine keys them: 2003265652 is `wght`) as `{tag: value}`; `None` when it has none. +fn variations(v: &Value) -> Option { + let axes: JsonMap = v + .as_object()? + .iter() + .take(64) + .filter_map(|(k, val)| { + let tag = u32::try_from(k.parse::().ok()?).ok()?.to_be_bytes(); + let tag = std::str::from_utf8(&tag).ok().filter(|t| t.chars().all(|c| c.is_ascii_graphic()))?.to_string(); + let val = val.as_f64().filter(|x| x.is_finite())?; + Some((tag, json!(val.clamp(-1e5, 1e5)))) + }) + .collect(); + (!axes.is_empty()).then_some(Value::Object(axes)) +} + /// Family and style of a font from its PostScript name: "HelveticaNeue-Bold" → ("Helvetica Neue", /// "Bold"). Words of the family are split at case changes, which can't always match the real name /// (a CJK family would split as "Ping Fang SC"); the engine matches families against the installed diff --git a/crates/format/src/sketch/text_tests.rs b/crates/format/src/sketch/text_tests.rs index 41b86f685..53ca52357 100644 --- a/crates/format/src/sketch/text_tests.rs +++ b/crates/format/src/sketch/text_tests.rs @@ -211,3 +211,27 @@ fn line_spacing_behaviour_moves_text() { assert!((y("B0") - 106.6).abs() < 1e-6, "{}", y("B0")); assert!((y("B1") - 93.4).abs() < 1e-6, "{}", y("B1")); } + +/// A variable font's axes (Sketch keys them by the tag as a number: 2003265652 is `wght`). +#[test] +fn font_variations() { + let mut t = text("Wide", 0.0, 0.0, 200.0, 50.0, "Orbit", &[(0, 5, "Skia", 40.0, BLACK)]); + t["attributedString"]["attributes"][0]["attributes"]["MSAttributedStringFontAttribute"]["attributes"]["variation"] = + json!({"2003265652": 3, "2003072104": 0.65, "junk": 1, "1": "x"}); + let (doc, _) = open(vec![t]); + let v = &data(&doc, "Wide").style.variations; + assert_eq!(v.get("wght"), Some(&3.0)); + assert_eq!(v.get("wdth"), Some(&0.65)); + assert_eq!(v.len(), 2, "{v:?}"); +} + +/// Font references without font data are only the fonts the document uses: no note. +#[test] +fn font_references_without_data_are_no_embedded_fonts() { + let mut d = document(&["P"]); + d["fontReferences"] = + json!([{"_class": "fontReference", "fontFamilyName": "Skia", "fontFileName": "Skia.ttf", "postscriptNames": ["Skia-Regular"]}]); + let z = sketch_zip("2026.3.1", 196, d, &[page("P", "Page", vec![])], &[]); + let (_, warnings) = import(&z, "f").unwrap(); + assert!(!warnings.iter().any(|w| w.contains("embedded")), "{warnings:?}"); +} diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 4d7b92edd..998b60917 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -18,7 +18,7 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| | `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included; a flow that records no primary-axis sizing hugs on that axis, an instance that records no auto layout has its main's), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Since 2026-10-17 (community batches #727, #728): an instance's own identity and the cached library components a file carries, overrides applied by key and order, local text values and instance overrides over a shared text style, grid track sizes (fixed, content-sized, fill), slot content, labels of connectors saved with their drawn path (a static snapshot; the ends aren't live), skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, editable text on a path, image adjustments and images carried in the message. Budgets come from the file's own size (one value per compressed byte, 20M–128M, lower ceilings on 32-bit targets; the layer cap follows), so a 15.4 MB synthetic file with 300,000 layers opens whole; the file's bytes stay out of the command journal; an import report lists what was left out or changed once the file opens. Not read: elbowed or curved connectors without a saved path (drawn straight) and labels of connectors without a saved snapshot, table cells beyond their own layers, filled areas with their own fills, variables bound to fields the editor can't bind, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs` and the per-feature `*_tests.rs` beside them, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | -| `.sketch` (Sketch 48 and newer) | — (Figma's own Sketch import runs in its web app) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards as frames with their background, groups; Sketch 2025 and newer: frames (clipping or not) with their style, graphics, stacks as auto layout (direction, gap, alignment, padding, wrap, hug/fill sizing, items ignoring the stack), corners in the style (rounded, smooth with its smoothing; angled, inside square and inside arc as paths), pins and sizing, per-side borders, lists of blurs (progressive background blurs, glass), inner shadows in the shadow list, tints (a graphic's, group's or instance's fill colouring its layers, and colour overrides), text colour and visibility overrides, text sized by its sizing; rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (a mask that shows its own style draws a copy under itself, as Sketch does; broken mask chains wrapped); text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts from PostScript names matched to installed families; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), laid out for their size the way Sketch does it (proportional sharing per pins from format 110, scaling before) and still live; master backgrounds in instances only where Sketch shows them; Apple's system fonts found under the names designs use, with the platform's tracking kept as letter spacing; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids. Instances of a stack laid out at their size and texts an override changed measured again on open. Warnings: noise fills, motion and zoom blurs (drawn as plain blurs), embedded fonts (not used), Smart Layout (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (70,000 layers open in ~3 s, debug build); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 70 in at most 4.4%, a Sketch 64 file's 65 artboards 2.1% on average, a Sketch 2026 showcase file's 16 frames 1.2% on average (at most 3.2%) | 5–10 (Smart Layout as auto layout, progressive layer opacity, motion and zoom blurs) | +| `.sketch` (Sketch 48 and newer) | — (Figma's own Sketch import runs in its web app) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards as frames with their background, groups; Sketch 2025 and newer: frames (clipping or not) with their style, graphics, stacks as auto layout (direction, gap, alignment, padding, wrap, hug/fill sizing, items ignoring the stack), corners in the style (rounded, smooth with its smoothing; angled, inside square and inside arc as paths), pins and sizing, per-side borders, lists of blurs (progressive background blurs, glass), inner shadows in the shadow list, tints (a graphic's, group's or instance's fill colouring its layers, and colour overrides), text colour and visibility overrides, text sized by its sizing; rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (a mask that shows its own style draws a copy under itself, as Sketch does; broken mask chains wrapped); text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts from PostScript names matched to installed families, variable font axes; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), laid out for their size the way Sketch does it (proportional sharing per pins from format 110, scaling before) and still live; master backgrounds in instances only where Sketch shows them; Apple's system fonts found under the names designs use, with the platform's tracking kept as letter spacing; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids. Instances of a stack laid out at their size and texts an override changed measured again on open. Warnings: noise fills, motion and zoom blurs (drawn as plain blurs), fonts embedded with their data (not used), Smart Layout (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (70,000 layers open in ~3 s, debug build); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 70 in at most 4.4%, a Sketch 64 file's 65 artboards 2.1% on average, a Sketch 2026 showcase file's 16 frames 1.2% on average (at most 3.2%) | 5–10 (Smart Layout as auto layout, progressive layer opacity, motion and zoom blurs) | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | | REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout (sizing modes left out read as hug, as documented; grid track sizes from `gridColumnsSizing` / `gridRowsSizing`: px, fr, auto, `minmax(0, 1fr)`, `repeat()`), constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, slots (`SLOT` layers bound to their slot property; an instance's slot keeps its content as the instance's own unless its property value is the main's default content; slot limits and preferred components are warnings), styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings, image adjustments (the same tint sign as `.fig`); the import report after opening; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | From f02557e8f9af96ebda90a44e94d428a1d8e823e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 23:26:27 +0200 Subject: [PATCH 490/817] M6: Sketch import: fonts by PostScript name, Sketch's natural line The font database knows each face's PostScript name; the Sketch import finds the installed face a file's font names (CourierNewPSMT is Courier New Regular) and reads the family from the name only when it isn't installed. Text without a fixed line height takes the line Sketch draws: ascent and descent rounded to whole pixels, the line gap left out, a fifth more for classic Mac fonts, the baseline where Sketch puts it (measured on sketchtool renders of 80 fonts). Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/file.rs | 81 ++++++++++++++++++++++-- crates/engine/src/sketch_import_tests.rs | 40 ++++++++++++ crates/format/src/sketch/mod.rs | 32 ++++++++-- crates/format/src/sketch/text.rs | 19 +++++- crates/format/src/sketch/text_tests.rs | 15 +++++ crates/format/src/sketch/tree.rs | 7 +- crates/text/src/fontdb.rs | 38 +++++++++-- crates/text/src/fontdb_tests.rs | 31 ++++++++- docs/file-format-parity.md | 2 +- 9 files changed, 244 insertions(+), 21 deletions(-) diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index 5de7e0fd9..8db15ceea 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -556,13 +556,18 @@ fn load_with( /// Gives `None` when `bytes` are not a `.sketch` file. Then other readers can try. fn load_sketch(bytes: &[u8], name: &str) -> Option> { - let r = figcraft_format::sketch::try_import(bytes, name)?; + if !figcraft_format::sketch::is_sketch(bytes) { + return None; + } + // The import and what follows read the installed fonts: the system's must be known first (the + // desktop app scans them in the background; this waits for that scan). + figcraft_text::fontdb::scan_system_fonts(); + let fonts: figcraft_format::sketch::FontLookup = Box::new(figcraft_text::fontdb::postscript_face); + let r = figcraft_format::sketch::try_import_with_fonts(bytes, name, Some(fonts))?; Some(r.map_err(|e| EngineError::Other(e.to_string())).map(|(mut doc, warnings)| { - // Both read the installed fonts: the system's must be known first (the desktop app scans - // them in the background; this waits for that scan). - figcraft_text::fontdb::scan_system_fonts(); match_font_families(&mut doc); platform_tracking(&mut doc); + sketch_line_heights(&mut doc); link_instances(&mut doc); reflow_overridden_text(&mut doc); figcraft_format::Loaded { issues: warnings, ..doc.into() } @@ -665,6 +670,74 @@ fn platform_tracking(doc: &mut Document) { } } +/// Families Sketch (Apple's text system) gives a fifth more than their ascent and descent as their +/// natural line: classic Mac fonts, found on `sketchtool` renders. Other fonts show none of this. +const TALL_LINE_FAMILIES: [&str; 11] = + ["Academy Engraved LET", "Courier", "Helvetica", "Hoefler Text", "Palatino", "Sathu", "Silom", "Skia", "Times", "Webdings", "Zapf Dingbats"]; + +/// Sketch's natural line for a font of `ascent` and `descent` in `upem` units at `size` px: its +/// height in px and how far down the text moves so its baseline sits where Sketch puts it. Sketch +/// rounds the ascent and descent to whole pixels each and leaves the font's line gap out (a fifth +/// more for [`TALL_LINE_FAMILIES`]), with the baseline above the rounded descent; FigCraft centres +/// the font's own ascent and descent in the line. `(0, 0)` without metrics. +pub(crate) fn sketch_line(ascent: f64, descent: f64, upem: f64, family: &str, size: f64) -> (f64, f64) { + let k = size / upem; + let (a, d) = (ascent * k, descent * k); + if !(a.is_finite() && d.is_finite()) || a + d <= 0.0 { + return (0.0, 0.0); + } + let natural = a.round() + d.round(); + let line = if TALL_LINE_FAMILIES.iter().any(|f| f.eq_ignore_ascii_case(family)) { (natural * 1.2).round() } else { natural }; + let sketch_baseline = line - d.round(); + let figcraft_baseline = (line - (a + d)) / 2.0 + a; + (line, sketch_baseline - figcraft_baseline) +} + +/// Text without a fixed line height takes the line Sketch drew it with (FigCraft's natural line, +/// like Figma's, counts the font's line gap and centres the font in it; Sketch's doesn't), as a +/// share of its size so it still follows the size, and moves to Sketch's baseline. Shared text +/// styles take the line too. +fn sketch_line_heights(doc: &mut Document) { + // Per family and style: the face's ascent, descent and units per em. + type Metrics = Option<(f64, f64, f64)>; + let mut cache: std::collections::BTreeMap<(String, String), Metrics> = std::collections::BTreeMap::new(); + let mut set = |style: &mut TextStyle| -> f64 { + if style.line_height != LineHeight::Auto || !style.font_size.is_finite() || style.font_size <= 0.0 { + return 0.0; + } + let m = *cache.entry((style.font_family.clone(), style.font_style.clone())).or_insert_with(|| { + figcraft_text::fontdb::has_family(&style.font_family) + .then(|| figcraft_text::fontdb::find_face(&style.font_family, &style.font_style)) + .flatten() + .map(|f| (f.ascent, f.descent, f.upem)) + }); + let Some((a, d, upem)) = m else { return 0.0 }; + let (line, down) = sketch_line(a, d, upem, &style.font_family, style.font_size); + if line > 0.0 { + style.line_height = LineHeight::Percent(line / style.font_size * 100.0); + } + down + }; + let ids: Vec = doc.nodes().filter(|n| matches!(n.kind, NodeKind::Text(_))).map(|n| n.id).collect(); + for id in ids { + let Some(n) = doc.node_mut(id) else { continue }; + let NodeKind::Text(td) = &mut n.kind else { continue }; + let down = set(&mut td.style); + for r in &mut td.runs { + set(&mut r.style); + } + // Down in the layer's own frame (a rotated text moves along its own axis). + if down.is_finite() && down != 0.0 { + n.transform *= figcraft_doc::geom::Affine::translate((0.0, down)); + } + } + for st in &mut doc.styles { + if let StyleKind::Text { style } = &mut st.kind { + set(style); + } + } +} + /// The installed family `family` means when it isn't installed under that exact name: the one /// whose name is the same without spaces, ignoring case. pub(crate) fn installed_family(family: &str, installed: &[String]) -> Option { diff --git a/crates/engine/src/sketch_import_tests.rs b/crates/engine/src/sketch_import_tests.rs index 5dc4b31ab..36b200a5a 100644 --- a/crates/engine/src/sketch_import_tests.rs +++ b/crates/engine/src/sketch_import_tests.rs @@ -401,3 +401,43 @@ fn sketch_resized_stack_instances_reflow() { assert!((b.x0 - a.x1 - 8.0).abs() < 0.5, "{a:?} {b:?}"); assert!((doc.world_bounds(inst).unwrap().x1 - 342.0).abs() < 1e-6); } + +/// Sketch's natural line: the font's ascent and descent each rounded to whole pixels, without its +/// line gap, the baseline at the rounded ascent; the classic Mac fonts get a fifth more, all of it +/// above the text. +#[test] +fn sketch_natural_line_rule() { + use crate::cmd::file::sketch_line; + // Helvetica Neue Medium (975 + 217 of 1000, a gap of 29 left out) at 17 px: 16.575 → 17 and + // 3.689 → 4, a line of 21 with the baseline at 17. FigCraft puts the baseline at + // (21 − 20.264) / 2 + 16.575 = 16.943, so the text moves down 0.057. + let (line, down) = sketch_line(975.0, 217.0, 1000.0, "Helvetica Neue", 17.0); + assert!((line - 21.0).abs() < 1e-9 && (down - 0.057).abs() < 1e-9, "{line} {down}"); + // Helvetica at 100 px: 77 + 23 and a fifth more, 120, all of it above: the baseline at 97 + // where FigCraft centres it at 87. + let (line, down) = sketch_line(1577.0, 471.0, 2048.0, "helvetica", 100.0); + assert!((line - 120.0).abs() < 1e-9 && (down - 10.0).abs() < 0.05, "{line} {down}"); + assert_eq!(sketch_line(0.0, 0.0, 0.0, "X", 12.0), (0.0, 0.0), "no metrics, no change"); + assert_eq!(sketch_line(900.0, 200.0, 1000.0, "X", f64::NAN), (0.0, 0.0)); +} + +/// Text without a fixed line height gets Sketch's natural line as a share of its size, in the +/// layer and in shared text styles. +#[test] +fn sketch_text_gets_sketchs_natural_line() { + if !std::path::Path::new("/System/Library/Fonts/HelveticaNeue.ttc").exists() { + return; + } + figcraft_text::fontdb::scan_system_fonts(); + let font = json!({"name": "HelveticaNeue", "size": 100}); + let run = json!({"location": 0, "length": 2, "attributes": {"MSAttributedStringFontAttribute": {"attributes": font}}}); + let t = shape("text", "Label", [0.0, 0.0, 200.0, 120.0], json!({"attributedString": {"string": "Hi", "attributes": [run]}, "textBehaviour": 0})); + let data = base64::engine::general_purpose::STANDARD.encode(sketch_with("64", &[("A", "Page")], &[t])); + let mut s = Session::new(); + s.execute("file.open", &json!({"data": data, "name": "x.sketch"})).unwrap(); + let doc = s.doc().unwrap(); + let NodeKind::Text(td) = &doc.nodes().find(|n| n.name == "Label").unwrap().kind else { panic!("not text") }; + // 95.2 → 95 and 21.3 → 21: 116 px, as a share of the size. + let figcraft_doc::LineHeight::Percent(p) = td.style.line_height else { panic!("{:?}", td.style.line_height) }; + assert!((p - 116.0).abs() < 1e-9, "{p}"); +} diff --git a/crates/format/src/sketch/mod.rs b/crates/format/src/sketch/mod.rs index 15df9d221..18332afdd 100644 --- a/crates/format/src/sketch/mod.rs +++ b/crates/format/src/sketch/mod.rs @@ -81,35 +81,55 @@ pub fn is_sketch(bytes: &[u8]) -> bool { })) } +/// Finds the installed face a PostScript name belongs to: its family and style. +pub type FontLookup = Box Option<(String, String)>>; + /// Import `bytes` when they are a `.sketch` file; `None` when they are something else. pub fn try_import(bytes: &[u8], name: &str) -> Option), FormatError>> { - is_sketch(bytes).then(|| import(bytes, name)) + try_import_with_fonts(bytes, name, None) +} + +/// [`try_import`] with `fonts` finding the installed faces the file's fonts (PostScript names) +/// belong to; families of fonts it doesn't find are read from their names. +pub fn try_import_with_fonts(bytes: &[u8], name: &str, fonts: Option) -> Option), FormatError>> { + is_sketch(bytes).then(|| import_with_fonts(bytes, name, fonts)) } /// Build a document from a `.sketch` file. Returns it with the warnings about what was skipped or /// approximated. `name`: the document name. pub fn import(bytes: &[u8], name: &str) -> Result<(Document, Vec), FormatError> { - import_parts(bytes, name, MAX_JSON_MEMBER, crate::fig::layer_budget(bytes.len())) + import_with_fonts(bytes, name, None) +} + +/// [`import`] with a font lookup (see [`try_import_with_fonts`]). +pub fn import_with_fonts(bytes: &[u8], name: &str, fonts: Option) -> Result<(Document, Vec), FormatError> { + import_parts(bytes, name, MAX_JSON_MEMBER, crate::fig::layer_budget(bytes.len()), fonts) } /// [`import`] reading pages of at most `max_member` bytes of JSON each. #[cfg(test)] pub(crate) fn import_within(bytes: &[u8], name: &str, max_member: u64) -> Result<(Document, Vec), FormatError> { - import_parts(bytes, name, max_member, crate::fig::layer_budget(bytes.len())) + import_parts(bytes, name, max_member, crate::fig::layer_budget(bytes.len()), None) } /// [`import`] with at most `max_nodes` layers. #[cfg(test)] pub(crate) fn import_within_nodes(bytes: &[u8], name: &str, max_nodes: usize) -> Result<(Document, Vec), FormatError> { - import_parts(bytes, name, MAX_JSON_MEMBER, max_nodes) + import_parts(bytes, name, MAX_JSON_MEMBER, max_nodes, None) } -fn import_parts(bytes: &[u8], name: &str, max_member: u64, max_nodes: usize) -> Result<(Document, Vec), FormatError> { +fn import_parts( + bytes: &[u8], + name: &str, + max_member: u64, + max_nodes: usize, + fonts: Option, +) -> Result<(Document, Vec), FormatError> { if bytes.starts_with(b"SQLite format 3\0") { return Err(FormatError::Io(TOO_OLD.into())); } let archive = Archive::open(bytes, max_member)?; - let map = tree::to_rest(&archive, name, max_nodes); + let map = tree::to_rest(&archive, name, max_nodes, fonts); if map.too_old { return Err(FormatError::Io(TOO_OLD.into())); } diff --git a/crates/format/src/sketch/text.rs b/crates/format/src/sketch/text.rs index 766927906..027de6602 100644 --- a/crates/format/src/sketch/text.rs +++ b/crates/format/src/sketch/text.rs @@ -124,7 +124,7 @@ pub(crate) fn type_style(cx: &mut Cx, a: &Value) -> Value { let font = a.get("MSAttributedStringFontAttribute").and_then(|f| f.get("attributes")); let ps = font.and_then(|f| f.get("name")).and_then(Value::as_str).unwrap_or(""); let size = font.and_then(|f| f.get("size")).and_then(Value::as_f64).filter(|s| s.is_finite() && *s > 0.0).unwrap_or(12.0); - let (family, style) = font_name(ps); + let (family, style) = installed(cx, ps).unwrap_or_else(|| font_name(ps)); if ps.is_empty() { cx.warn("text without a font uses Helvetica"); } @@ -180,6 +180,23 @@ fn variations(v: &Value) -> Option { (!axes.is_empty()).then_some(Value::Object(axes)) } +/// The installed family and style of PostScript name `ps`, when the import has a font lookup and +/// the font is installed. +fn installed(cx: &mut Cx, ps: &str) -> Option<(String, String)> { + if ps.is_empty() { + return None; + } + if let Some(found) = cx.font_cache.get(ps) { + return found.clone(); + } + let found = cx.fonts.as_ref().and_then(|f| f(ps)); + // A file names a few hundred fonts at most; junk ones don't grow the cache past that. + if cx.font_cache.len() < 4096 { + cx.font_cache.insert(ps.to_string(), found.clone()); + } + found +} + /// Family and style of a font from its PostScript name: "HelveticaNeue-Bold" → ("Helvetica Neue", /// "Bold"). Words of the family are split at case changes, which can't always match the real name /// (a CJK family would split as "Ping Fang SC"); the engine matches families against the installed diff --git a/crates/format/src/sketch/text_tests.rs b/crates/format/src/sketch/text_tests.rs index 53ca52357..8adef1ea3 100644 --- a/crates/format/src/sketch/text_tests.rs +++ b/crates/format/src/sketch/text_tests.rs @@ -235,3 +235,18 @@ fn font_references_without_data_are_no_embedded_fonts() { let (_, warnings) = import(&z, "f").unwrap(); assert!(!warnings.iter().any(|w| w.contains("embedded")), "{warnings:?}"); } + +/// With a font lookup, a PostScript name gives the installed family and style it belongs to (the +/// name alone can't always tell: "CourierNewPSMT" is Courier New Regular); without one, or for a +/// font that isn't installed, the family is read from the name. +#[test] +fn postscript_names_find_installed_fonts() { + let mk = |name: &str, ps: &str| text(name, 0.0, 0.0, 100.0, 20.0, "Hi", &[(0, 2, ps, 14.0, BLACK)]); + let z = sketch_zip("83.2", 139, document(&["P"]), &[page("P", "Page", vec![mk("A", "CourierNewPSMT"), mk("B", "BrandSans-Bold")])], &[]); + let lookup: crate::sketch::FontLookup = Box::new(|ps: &str| (ps == "CourierNewPSMT").then(|| ("Courier New".to_string(), "Regular".to_string()))); + let (doc, _) = crate::sketch::import_with_fonts(&z, "f", Some(lookup)).unwrap(); + assert_eq!((data(&doc, "A").style.font_family.as_str(), data(&doc, "A").style.font_style.as_str()), ("Courier New", "Regular")); + assert_eq!(data(&doc, "B").style.font_family, "Brand Sans"); + let (doc, _) = import(&z, "f").unwrap(); + assert_eq!(data(&doc, "A").style.font_family, "Courier New PSMT"); +} diff --git a/crates/format/src/sketch/tree.rs b/crates/format/src/sketch/tree.rs index 3d6a48d33..e651463d1 100644 --- a/crates/format/src/sketch/tree.rs +++ b/crates/format/src/sketch/tree.rs @@ -58,6 +58,9 @@ pub(crate) struct Cx { /// Layers mapped so far, and the most the file may give. pub nodes: usize, pub max_nodes: usize, + /// Finds installed faces by PostScript name, and what it found (or didn't) so far. + pub fonts: Option, + pub font_cache: std::collections::BTreeMap>, } impl Cx { @@ -90,7 +93,7 @@ impl Cx { } /// Map the pages of `archive` to a REST file JSON named `name`. -pub(crate) fn to_rest(archive: &Archive, name: &str, max_nodes: usize) -> Map { +pub(crate) fn to_rest(archive: &Archive, name: &str, max_nodes: usize, fonts: Option) -> Map { let symbols = super::symbols::Symbols::read(&archive.document, &archive.pages); let shared = super::shared::Shared::read(&archive.document); let mut cx = Cx { @@ -109,6 +112,8 @@ pub(crate) fn to_rest(archive: &Archive, name: &str, max_nodes: usize) -> Map { too_old: false, nodes: 0, max_nodes, + fonts, + font_cache: std::collections::BTreeMap::new(), }; let defs = super::shared::Shared::definitions(&mut cx); cx.style_defs = defs.iter().filter_map(|d| d.get("id").and_then(Value::as_str).map(str::to_string)).collect(); diff --git a/crates/text/src/fontdb.rs b/crates/text/src/fontdb.rs index 22ca4b84b..34d76b12e 100644 --- a/crates/text/src/fontdb.rs +++ b/crates/text/src/fontdb.rs @@ -86,6 +86,8 @@ pub struct Face { pub id: u32, pub family: String, pub style: String, + /// The face's PostScript name ("HelveticaNeue-Bold"). + pub postscript: Option, pub weight: u16, pub italic: bool, pub bytes: FontBytes, @@ -185,6 +187,7 @@ impl Face { id: NEXT_FACE.fetch_add(1, Ordering::Relaxed), italic: !matches!(attrs.style, skrifa::attribute::Style::Normal) || style.to_ascii_lowercase().contains("italic"), weight, + postscript: name_string(&f, StringId::POSTSCRIPT_NAME), family, style, index, @@ -493,6 +496,8 @@ struct Pending { path: std::path::PathBuf, index: u32, style: String, + /// The face's PostScript name. + postscript: Option, } #[derive(Default)] @@ -570,6 +575,16 @@ impl FontDb { (0..count).filter_map(|i| Face::from_bytes(FontBytes::Shared(shared.clone()), i, None, None)).map(|f| self.add(f)).collect() } + /// The family and style of the face whose PostScript name is `ps` (ignoring case), loaded or + /// only scanned. + pub fn postscript_face(&self, ps: &str) -> Option<(String, String)> { + let is = |p: &Option| p.as_deref().is_some_and(|p| p.eq_ignore_ascii_case(ps)); + if let Some(f) = self.faces.iter().find(|f| is(&f.postscript)) { + return Some((f.family.clone(), f.style.clone())); + } + self.pending.values().find_map(|(display, entries)| entries.iter().find(|e| is(&e.postscript)).map(|e| (display.clone(), e.style.clone()))) + } + /// Family display names, sorted (loaded and known system families). pub fn families(&self) -> Vec { let mut v: Vec = self.families.values().map(|(d, _)| d.clone()).collect(); @@ -897,8 +912,13 @@ fn scan_dir(dir: &std::path::Path, depth: usize, out: &mut BTreeMap Option> { Some(buf) } -/// (index, family, style) of each face in a font file: outline fonts and colour fonts (Apple Color +/// (index, family, style, PostScript name) of each face in a font file: outline fonts and colour fonts (Apple Color /// Emoji draws most emoji from `sbix`, Noto Color Emoji has no outlines at all). -fn faces_in(bytes: &[u8]) -> Vec<(u32, String, String)> { +fn faces_in(bytes: &[u8]) -> Vec<(u32, String, String, Option)> { let count = match FileRef::new(bytes) { Ok(FileRef::Collection(c)) => c.len(), Ok(FileRef::Font(_)) => 1, @@ -959,7 +979,7 @@ fn faces_in(bytes: &[u8]) -> Vec<(u32, String, String)> { .then_some(())?; let (family, style) = names(&f); let family = public_family(&family?)?; - Some((i, family, style.unwrap_or_else(|| "Regular".into()))) + Some((i, family, style.unwrap_or_else(|| "Regular".into()), name_string(&f, StringId::POSTSCRIPT_NAME))) }) .collect() } @@ -989,6 +1009,14 @@ fn apple_alias(key: &str) -> Option<&'static str> { } /// Convenience: find a face with the global db. +/// The family and style of the installed face whose PostScript name is `ps`. +pub fn postscript_face(ps: &str) -> Option<(String, String)> { + if ps.is_empty() { + return None; + } + db().read().unwrap_or_else(std::sync::PoisonError::into_inner).postscript_face(ps) +} + pub fn find_face(family: &str, style: &str) -> Option> { let mut db = db().write().unwrap_or_else(std::sync::PoisonError::into_inner); db.find(family, style).or_else(|| db.default_face()) diff --git a/crates/text/src/fontdb_tests.rs b/crates/text/src/fontdb_tests.rs index 0b83e1d3f..5ff1e2e6f 100644 --- a/crates/text/src/fontdb_tests.rs +++ b/crates/text/src/fontdb_tests.rs @@ -2,7 +2,8 @@ use super::*; fn pending(styles: &[&str]) -> FontDb { let mut db = FontDb::default(); - let entries = styles.iter().map(|s| Pending { path: format!("no-such-dir/{s}.ttf").into(), index: 0, style: (*s).into() }).collect(); + let entries = + styles.iter().map(|s| Pending { path: format!("no-such-dir/{s}.ttf").into(), index: 0, style: (*s).into(), postscript: None }).collect(); db.pending.insert("cjk ui".into(), ("CJK UI".into(), entries)); db } @@ -221,7 +222,7 @@ fn user_font_dirs_preserve_non_utf8_paths() { /// A rescan offers new families and the styles installed since, and never a file twice. #[test] fn a_rescan_offers_fonts_installed_since() { - let entry = |s: &str| Pending { path: format!("no-such-dir/{s}.ttf").into(), index: 0, style: s.into() }; + let entry = |s: &str| Pending { path: format!("no-such-dir/{s}.ttf").into(), index: 0, style: s.into(), postscript: None }; let mut db = pending(&["Regular"]); let found = |fams: &[(&str, &[&str])]| -> BTreeMap)> { fams.iter().map(|(f, styles)| (f.to_lowercase(), ((*f).to_string(), styles.iter().map(|s| entry(s)).collect()))).collect() @@ -271,7 +272,7 @@ fn apple_system_font_names_find_the_system_font() { let mut db = FontDb::default(); db.pending.insert( "system font".into(), - ("System Font".into(), vec![Pending { path: "no-such-dir/SFNS.ttf".into(), index: 0, style: "Regular".into() }]), + ("System Font".into(), vec![Pending { path: "no-such-dir/SFNS.ttf".into(), index: 0, style: "Regular".into(), postscript: None }]), ); for name in ["SF Pro", "SF Pro Text", "SF Pro Display", "SF UI Text", "SF UI Display", ".SF NS Text", "San Francisco"] { assert!(db.has_family(name), "{name}"); @@ -324,3 +325,27 @@ fn trak_tracking_by_size() { let _ = f.tracking(12.0); } } + +/// A face is found by its PostScript name (ignoring case), loaded or only scanned: the family and +/// style it is offered under. +#[test] +fn faces_by_postscript_name() { + let mut db = FontDb::default(); + db.pending.insert( + "brand sans".into(), + ( + "Brand Sans".into(), + vec![Pending { path: "no-such-dir/b.ttf".into(), index: 0, style: "Bold".into(), postscript: Some("BrandSans-Bold".into()) }], + ), + ); + assert_eq!(db.postscript_face("brandsans-bold"), Some(("Brand Sans".to_string(), "Bold".to_string()))); + assert_eq!(db.postscript_face("BrandSans-Light"), None); + if let Some(f) = CRAFT_FONTS.first() + && let Some(face) = Face::from_bytes(FontBytes::Static(f.bytes), 0, Some(f.family), Some(f.style)) + && let Some(ps) = face.postscript.clone() + { + db.add(face); + assert_eq!(db.postscript_face(&ps), Some((f.family.to_string(), f.style.to_string()))); + } + assert!(postscript_face("").is_none()); +} diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 998b60917..d1038576d 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -18,7 +18,7 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| | `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included; a flow that records no primary-axis sizing hugs on that axis, an instance that records no auto layout has its main's), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Since 2026-10-17 (community batches #727, #728): an instance's own identity and the cached library components a file carries, overrides applied by key and order, local text values and instance overrides over a shared text style, grid track sizes (fixed, content-sized, fill), slot content, labels of connectors saved with their drawn path (a static snapshot; the ends aren't live), skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, editable text on a path, image adjustments and images carried in the message. Budgets come from the file's own size (one value per compressed byte, 20M–128M, lower ceilings on 32-bit targets; the layer cap follows), so a 15.4 MB synthetic file with 300,000 layers opens whole; the file's bytes stay out of the command journal; an import report lists what was left out or changed once the file opens. Not read: elbowed or curved connectors without a saved path (drawn straight) and labels of connectors without a saved snapshot, table cells beyond their own layers, filled areas with their own fills, variables bound to fields the editor can't bind, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs` and the per-feature `*_tests.rs` beside them, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | -| `.sketch` (Sketch 48 and newer) | — (Figma's own Sketch import runs in its web app) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards as frames with their background, groups; Sketch 2025 and newer: frames (clipping or not) with their style, graphics, stacks as auto layout (direction, gap, alignment, padding, wrap, hug/fill sizing, items ignoring the stack), corners in the style (rounded, smooth with its smoothing; angled, inside square and inside arc as paths), pins and sizing, per-side borders, lists of blurs (progressive background blurs, glass), inner shadows in the shadow list, tints (a graphic's, group's or instance's fill colouring its layers, and colour overrides), text colour and visibility overrides, text sized by its sizing; rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (a mask that shows its own style draws a copy under itself, as Sketch does; broken mask chains wrapped); text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts from PostScript names matched to installed families, variable font axes; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), laid out for their size the way Sketch does it (proportional sharing per pins from format 110, scaling before) and still live; master backgrounds in instances only where Sketch shows them; Apple's system fonts found under the names designs use, with the platform's tracking kept as letter spacing; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids. Instances of a stack laid out at their size and texts an override changed measured again on open. Warnings: noise fills, motion and zoom blurs (drawn as plain blurs), fonts embedded with their data (not used), Smart Layout (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (70,000 layers open in ~3 s, debug build); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 70 in at most 4.4%, a Sketch 64 file's 65 artboards 2.1% on average, a Sketch 2026 showcase file's 16 frames 1.2% on average (at most 3.2%) | 5–10 (Smart Layout as auto layout, progressive layer opacity, motion and zoom blurs) | +| `.sketch` (Sketch 48 and newer) | — (Figma's own Sketch import runs in its web app) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards as frames with their background, groups; Sketch 2025 and newer: frames (clipping or not) with their style, graphics, stacks as auto layout (direction, gap, alignment, padding, wrap, hug/fill sizing, items ignoring the stack), corners in the style (rounded, smooth with its smoothing; angled, inside square and inside arc as paths), pins and sizing, per-side borders, lists of blurs (progressive background blurs, glass), inner shadows in the shadow list, tints (a graphic's, group's or instance's fill colouring its layers, and colour overrides), text colour and visibility overrides, text sized by its sizing; rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (a mask that shows its own style draws a copy under itself, as Sketch does; broken mask chains wrapped); text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts found by their PostScript names among the installed ones (else the family read from the name), variable font axes, Sketch's natural line (ascent and descent rounded, no line gap, a fifth more for classic Mac fonts) for text without a fixed line height; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), laid out for their size the way Sketch does it (proportional sharing per pins from format 110, scaling before) and still live; master backgrounds in instances only where Sketch shows them; Apple's system fonts found under the names designs use, with the platform's tracking kept as letter spacing; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids. Instances of a stack laid out at their size and texts an override changed measured again on open. Warnings: noise fills, motion and zoom blurs (drawn as plain blurs), fonts embedded with their data (not used), Smart Layout (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (70,000 layers open in ~3 s, debug build); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 70 in at most 4.4%, a Sketch 64 file's 65 artboards 2.1% on average, a Sketch 2026 showcase file's 16 frames 1.2% on average (at most 3.2%) | 5–10 (Smart Layout as auto layout, progressive layer opacity, motion and zoom blurs) | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | | REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout (sizing modes left out read as hug, as documented; grid track sizes from `gridColumnsSizing` / `gridRowsSizing`: px, fr, auto, `minmax(0, 1fr)`, `repeat()`), constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, slots (`SLOT` layers bound to their slot property; an instance's slot keeps its content as the instance's own unless its property value is the main's default content; slot limits and preferred components are warnings), styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings, image adjustments (the same tint sign as `.fig`); the import report after opening; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | From a8bade1446063e2ffefe9194bb622af98642b49b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 23:37:28 +0200 Subject: [PATCH 491/817] M6: Sketch import: alpha masks, Fade, linear gradient geometry Alpha masks only mask (no drawn copy of their fill); a progressive opacity (Fade) becomes an alpha mask of its gradient over the layer; linear gradients run square in pixels as Sketch draws them. Co-Authored-By: Claude Opus 5.5 --- crates/format/src/sketch/style.rs | 7 +++- crates/format/src/sketch/style_tests.rs | 46 +++++++++++++++++++++++++ crates/format/src/sketch/tree.rs | 45 ++++++++++++++++++++++-- docs/file-format-parity.md | 2 +- 4 files changed, 95 insertions(+), 5 deletions(-) diff --git a/crates/format/src/sketch/style.rs b/crates/format/src/sketch/style.rs index 133206736..45c739e63 100644 --- a/crates/format/src/sketch/style.rs +++ b/crates/format/src/sketch/style.rs @@ -137,7 +137,12 @@ fn gradient(g: &Value, w: f64, h: f64) -> Option { } // Sketch starts on the right and turns clockwise; from/to don't change it. 2 => ("GRADIENT_ANGULAR", json!([pt((0.5, 0.5)), pt((1.0, 0.5)), pt((0.5, 1.0))])), - _ => ("GRADIENT_LINEAR", json!([pt(from), pt(to)])), + // Square to the line in pixels, as Sketch draws it (FigCraft's default is square in 0–1). + _ => { + let (dx, dy) = ((to.0 - from.0) * w, (to.1 - from.1) * h); + let across = if w > 0.0 && h > 0.0 { (from.0 - dy / w, from.1 + dx / h) } else { (from.0 - (to.1 - from.1), from.1 + (to.0 - from.0)) }; + ("GRADIENT_LINEAR", json!([pt(from), pt(to), pt(across)])) + } }; Some(json!({"type": ty, "gradientHandlePositions": handles, "gradientStops": stops})) } diff --git a/crates/format/src/sketch/style_tests.rs b/crates/format/src/sketch/style_tests.rs index b5d24bdf8..e553ab6ba 100644 --- a/crates/format/src/sketch/style_tests.rs +++ b/crates/format/src/sketch/style_tests.rs @@ -318,3 +318,49 @@ fn bitmap_color_controls_become_filters() { assert_eq!(img.filters.contrast, 0.0); assert!(warnings.iter().any(|w| w.contains("hue")), "{warnings:?}"); } + +/// An alpha mask (`clippingMaskMode` 1) only masks: Sketch doesn't draw its fill under the content. +#[test] +fn alpha_masks_draw_no_copy() { + let fill = json!([solid_fill(0.0, 0.0, 0.0, 1.0)]); + let m = styled(with(with(r("Fade"), "hasClippingMask", json!(true)), "clippingMaskMode", json!(1)), "fills", fill); + let (doc, _) = open(vec![group("G", 0.0, 0.0, 100.0, 50.0, vec![m, r("Photo")])]); + assert!(!doc.nodes().any(|n| n.name == "Fade (drawn)")); + assert_eq!(node(&doc, "Fade").mask_type, figcraft_doc::MaskType::Alpha); +} + +/// A progressive opacity (Fade: `contextSettings.isProgressive` with a gradient) becomes an alpha +/// mask of that gradient over the layer, in a group in the layer's place. +#[test] +fn fades_become_alpha_masks() { + let fade = json!({"_class": "graphicsContextSettings", "blendMode": 0, "opacity": 1, "isProgressive": true, + "gradient": {"_class": "gradient", "gradientType": 0, "from": "{0.5, 0}", "to": "{0.5, 1}", "stops": [ + {"_class": "gradientStop", "position": 0, "color": color(0.0, 0.0, 0.0, 1.0)}, {"_class": "gradientStop", "position": 1, "color": color(0.0, 0.0, 0.0, 0.0)}]}}); + let l = styled(rect("Photo", 30.0, 40.0, 100.0, 50.0), "contextSettings", fade); + let (doc, _) = open(vec![group("G", 0.0, 0.0, 200.0, 200.0, vec![l])]); + // The group takes the layer's name too. + let photo = doc.nodes().find(|n| n.name == "Photo" && matches!(n.kind, NodeKind::Rectangle)).unwrap(); + let wrap = doc.node(photo.parent.unwrap()).unwrap(); + assert_eq!(wrap.name, "Photo"); + assert!(matches!(wrap.kind, NodeKind::Group), "{:?}", wrap.kind); + let mask = doc.node(wrap.children[0]).unwrap(); + assert!(mask.is_mask && mask.mask_type == figcraft_doc::MaskType::Alpha); + assert!(matches!(mask.fills[0].kind, PaintKind::Gradient(_))); + assert_eq!(doc.world_bounds(mask.id), doc.world_bounds(photo.id)); + let b = doc.world_bounds(photo.id).unwrap(); + assert_eq!((b.x0, b.y0, b.width(), b.height()), (30.0, 40.0, 100.0, 50.0)); +} + +/// Sketch's linear gradients run square in pixels: on a 200×100 layer, from the top left to the +/// bottom right, the stripes are at right angles to that line in pixels, not in the layer's 0–1. +#[test] +fn linear_gradients_are_square_in_pixels() { + let g = json!({"_class": "fill", "isEnabled": true, "fillType": 1, "color": color(0.0, 0.0, 0.0, 1.0), + "gradient": {"_class": "gradient", "gradientType": 0, "from": "{0, 0}", "to": "{1, 1}", "stops": [ + {"_class": "gradientStop", "position": 0, "color": color(0.0, 0.0, 0.0, 1.0)}, {"_class": "gradientStop", "position": 1, "color": color(1.0, 1.0, 1.0, 1.0)}]}}); + let (doc, _) = open(vec![styled(rect("Wide", 0.0, 0.0, 200.0, 100.0), "fills", json!([g]))]); + let PaintKind::Gradient(g) = &node(&doc, "Wide").fills[0].kind else { panic!("not a gradient") }; + // The line runs (200, 100) in pixels; square to it, (−100, 200), is (−0.5, 2) in 0–1. + let (wx, wy) = ((g.width.0 - g.from.0) * 200.0, (g.width.1 - g.from.1) * 100.0); + assert!((wx * 200.0 + wy * 100.0).abs() < 1e-6, "{g:?}"); +} diff --git a/crates/format/src/sketch/tree.rs b/crates/format/src/sketch/tree.rs index e651463d1..841b4daf9 100644 --- a/crates/format/src/sketch/tree.rs +++ b/crates/format/src/sketch/tree.rs @@ -267,7 +267,45 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: node.insert("children".into(), Value::Array(kids)); super::stack::apply(l, &mut node); } - Some(Value::Object(node)) + Some(fade(cx, l, node, world, w, h)) +} + +/// Layer `node` with a progressive opacity (Fade: the style's `contextSettings` with +/// `isProgressive` and a gradient whose stops' opacity is the layer's) as a group in its place +/// holding an alpha mask of that gradient over it; FigCraft has no progressive opacity. Other +/// layers as they are. +fn fade(cx: &mut Cx, l: &Value, node: JsonMap, world: Affine, w: f64, h: f64) -> Value { + let ctx = l.get("style").and_then(|s| s.get("contextSettings")); + let gradient = ctx.filter(|c| c.get("isProgressive").and_then(Value::as_bool) == Some(true)).and_then(|c| c.get("gradient")); + let Some(gradient) = gradient else { return Value::Object(node) }; + let fill = json!({"_class": "fill", "isEnabled": true, "fillType": 1, "gradient": gradient}); + let fills = super::style::fills(cx, &json!({"fills": [fill]}), w, h); + if fills.is_empty() { + return Value::Object(node); + } + let id = str_field(l, "do_objectID").unwrap_or("layer"); + let identity = json!([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]); + let bb = world.transform_rect_bbox(Rect::new(0.0, 0.0, w, h)); + let abs = json!({"x": bb.x0, "y": bb.y0, "width": bb.width(), "height": bb.height()}); + let mut inner = node.clone(); + let mut group = JsonMap::new(); + for k in ["relativeTransform", "absoluteBoundingBox", "constraints", "visible", "locked"] { + if let Some(v) = node.get(k) { + group.insert(k.into(), v.clone()); + } + } + group.insert("type".into(), json!("GROUP")); + group.insert("id".into(), json!(format!("{id}-fade"))); + group.insert("name".into(), node.get("name").cloned().unwrap_or_else(|| json!("Fade"))); + group.insert("size".into(), json!({"x": w, "y": h})); + group.insert("absoluteBoundingBox".into(), abs.clone()); + inner.insert("relativeTransform".into(), identity.clone()); + inner.insert("absoluteBoundingBox".into(), abs.clone()); + inner.insert("visible".into(), json!(true)); + let mask = json!({"type": "RECTANGLE", "id": format!("{id}-fade-mask"), "name": "Fade", "visible": true, "size": {"x": w, "y": h}, + "relativeTransform": identity, "absoluteBoundingBox": abs, "fills": fills, "isMask": true, "maskType": "ALPHA"}); + group.insert("children".into(), json!([mask, Value::Object(inner)])); + Value::Object(group) } /// A Sketch 2025+ group that is a frame: it behaves as a frame or a graphic, or clips. @@ -524,9 +562,10 @@ pub(crate) fn children(cx: &mut Cx, l: &Value, world: Affine, size: (f64, f64), out } -/// A plain copy of mask `n` when its style shows something (fills, borders or effects). +/// A plain copy of outline mask `n` when its style shows something (fills, borders or effects). +/// An alpha mask only masks. fn drawn_mask(n: &Value) -> Option { - if n.get("isMask").and_then(Value::as_bool) != Some(true) { + if n.get("isMask").and_then(Value::as_bool) != Some(true) || n.get("maskType").and_then(Value::as_str) == Some("ALPHA") { return None; } let shows = diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index d1038576d..38d94c511 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -18,7 +18,7 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| | `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included; a flow that records no primary-axis sizing hugs on that axis, an instance that records no auto layout has its main's), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Since 2026-10-17 (community batches #727, #728): an instance's own identity and the cached library components a file carries, overrides applied by key and order, local text values and instance overrides over a shared text style, grid track sizes (fixed, content-sized, fill), slot content, labels of connectors saved with their drawn path (a static snapshot; the ends aren't live), skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, editable text on a path, image adjustments and images carried in the message. Budgets come from the file's own size (one value per compressed byte, 20M–128M, lower ceilings on 32-bit targets; the layer cap follows), so a 15.4 MB synthetic file with 300,000 layers opens whole; the file's bytes stay out of the command journal; an import report lists what was left out or changed once the file opens. Not read: elbowed or curved connectors without a saved path (drawn straight) and labels of connectors without a saved snapshot, table cells beyond their own layers, filled areas with their own fills, variables bound to fields the editor can't bind, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs` and the per-feature `*_tests.rs` beside them, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | -| `.sketch` (Sketch 48 and newer) | — (Figma's own Sketch import runs in its web app) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards as frames with their background, groups; Sketch 2025 and newer: frames (clipping or not) with their style, graphics, stacks as auto layout (direction, gap, alignment, padding, wrap, hug/fill sizing, items ignoring the stack), corners in the style (rounded, smooth with its smoothing; angled, inside square and inside arc as paths), pins and sizing, per-side borders, lists of blurs (progressive background blurs, glass), inner shadows in the shadow list, tints (a graphic's, group's or instance's fill colouring its layers, and colour overrides), text colour and visibility overrides, text sized by its sizing; rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (a mask that shows its own style draws a copy under itself, as Sketch does; broken mask chains wrapped); text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts found by their PostScript names among the installed ones (else the family read from the name), variable font axes, Sketch's natural line (ascent and descent rounded, no line gap, a fifth more for classic Mac fonts) for text without a fixed line height; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), laid out for their size the way Sketch does it (proportional sharing per pins from format 110, scaling before) and still live; master backgrounds in instances only where Sketch shows them; Apple's system fonts found under the names designs use, with the platform's tracking kept as letter spacing; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids. Instances of a stack laid out at their size and texts an override changed measured again on open. Warnings: noise fills, motion and zoom blurs (drawn as plain blurs), fonts embedded with their data (not used), Smart Layout (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (70,000 layers open in ~3 s, debug build); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 70 in at most 4.4%, a Sketch 64 file's 65 artboards 2.1% on average, a Sketch 2026 showcase file's 16 frames 1.2% on average (at most 3.2%) | 5–10 (Smart Layout as auto layout, progressive layer opacity, motion and zoom blurs) | +| `.sketch` (Sketch 48 and newer) | — (Figma's own Sketch import runs in its web app) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards as frames with their background, groups; Sketch 2025 and newer: frames (clipping or not) with their style, graphics, stacks as auto layout (direction, gap, alignment, padding, wrap, hug/fill sizing, items ignoring the stack), corners in the style (rounded, smooth with its smoothing; angled, inside square and inside arc as paths), pins and sizing, per-side borders, lists of blurs (progressive background blurs, glass), inner shadows in the shadow list, tints (a graphic's, group's or instance's fill colouring its layers, and colour overrides), text colour and visibility overrides, text sized by its sizing; rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients with Sketch's geometry, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (an outline mask that shows its own style draws a copy under itself, as Sketch does; alpha masks only mask; broken mask chains wrapped), progressive opacity (Fade) as an alpha mask of its gradient; text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts found by their PostScript names among the installed ones (else the family read from the name), variable font axes, Sketch's natural line (ascent and descent rounded, no line gap, a fifth more for classic Mac fonts) for text without a fixed line height; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), laid out for their size the way Sketch does it (proportional sharing per pins from format 110, scaling before) and still live; master backgrounds in instances only where Sketch shows them; Apple's system fonts found under the names designs use, with the platform's tracking kept as letter spacing; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids. Instances of a stack laid out at their size and texts an override changed measured again on open. Warnings: noise fills, motion and zoom blurs (drawn as plain blurs), fonts embedded with their data (not used), Smart Layout (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (70,000 layers open in ~3 s, debug build); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (0.8% on average) (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 70 in at most 4.4%, a Sketch 64 file's 65 artboards 2.1% on average, a Sketch 2026 showcase file's 16 frames 0.9% on average (at most 1.9%) | 5–10 (Smart Layout as auto layout, motion and zoom blurs, several borders of different widths) | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | | REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout (sizing modes left out read as hug, as documented; grid track sizes from `gridColumnsSizing` / `gridRowsSizing`: px, fr, auto, `minmax(0, 1fr)`, `repeat()`), constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, slots (`SLOT` layers bound to their slot property; an instance's slot keeps its content as the instance's own unless its property value is the main's default content; slot limits and preferred components are warnings), styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings, image adjustments (the same tint sign as `.fig`); the import report after opening; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | From de0650e3f7d0a44b79d40bc89bc074c412b047ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 23:48:19 +0200 Subject: [PATCH 492/817] M6: Sketch import: layout grids come in hidden Sketch draws an artboard's layout and square grids only while its layout view is on; they now import hidden (still there, shown with the eye in the Layout grid section). Co-Authored-By: Claude Opus 5.5 --- crates/format/src/sketch/proto.rs | 9 +++++---- crates/format/src/sketch/proto_tests.rs | 2 ++ docs/file-format-parity.md | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/format/src/sketch/proto.rs b/crates/format/src/sketch/proto.rs index 1a08d2687..8574ab34c 100644 --- a/crates/format/src/sketch/proto.rs +++ b/crates/format/src/sketch/proto.rs @@ -74,7 +74,8 @@ pub(crate) fn export_settings(cx: &mut Cx, l: &Value, node: &mut JsonMap) { let mut out = Vec::new(); if let Some(g) = l.get("layout").filter(|g| bool_field(g, "isEnabled") != Some(false)) { @@ -83,21 +84,21 @@ pub(crate) fn layout_grids(l: &Value, h: f64, node: &mut JsonMap) && let (Some(count), Some(width)) = (num("numberOfColumns"), num("columnWidth")) { out.push(json!({"pattern": "COLUMNS", "alignment": "MIN", "count": count.min(1000.0), "sectionSize": width.min(1e5), - "gutterSize": num("gutterWidth").unwrap_or(0.0).min(1e5), "offset": num("horizontalOffset").unwrap_or(0.0).min(1e5), "visible": true})); + "gutterSize": num("gutterWidth").unwrap_or(0.0).min(1e5), "offset": num("horizontalOffset").unwrap_or(0.0).min(1e5), "visible": false})); } if bool_field(g, "drawHorizontal") == Some(true) { let gutter = num("gutterHeight").unwrap_or(0.0).min(1e5); let section = (gutter * num("rowHeightMultiplication").unwrap_or(1.0)).min(1e5); if section > 0.0 { let count = (h / (section + gutter)).floor().clamp(1.0, 1000.0); - out.push(json!({"pattern": "ROWS", "alignment": "MIN", "count": count, "sectionSize": section, "gutterSize": gutter, "offset": 0, "visible": true})); + out.push(json!({"pattern": "ROWS", "alignment": "MIN", "count": count, "sectionSize": section, "gutterSize": gutter, "offset": 0, "visible": false})); } } } if let Some(g) = l.get("grid").filter(|g| bool_field(g, "isEnabled") != Some(false)) && let Some(size) = g.get("gridSize").and_then(Value::as_f64).filter(|v| v.is_finite() && *v > 0.0) { - out.push(json!({"pattern": "GRID", "sectionSize": size.min(1e5), "visible": true})); + out.push(json!({"pattern": "GRID", "sectionSize": size.min(1e5), "visible": false})); } if !out.is_empty() { node.insert("layoutGrids".into(), Value::Array(out)); diff --git a/crates/format/src/sketch/proto_tests.rs b/crates/format/src/sketch/proto_tests.rs index be9b835dd..facef17a8 100644 --- a/crates/format/src/sketch/proto_tests.rs +++ b/crates/format/src/sketch/proto_tests.rs @@ -101,6 +101,8 @@ fn layout_and_square_grids() { let grids = format!("{:?}", node(&doc, "Board").grids); assert_eq!(node(&doc, "Board").grids.len(), 2, "{grids}"); assert!(grids.contains("12") && grids.contains("16"), "{grids}"); + // Hidden, as Sketch shows them only when its layout view is on. + assert!(node(&doc, "Board").grids.iter().all(|g| !g.visible), "{grids}"); } #[test] diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 38d94c511..76d7437a0 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -18,7 +18,7 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| | `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included; a flow that records no primary-axis sizing hugs on that axis, an instance that records no auto layout has its main's), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Since 2026-10-17 (community batches #727, #728): an instance's own identity and the cached library components a file carries, overrides applied by key and order, local text values and instance overrides over a shared text style, grid track sizes (fixed, content-sized, fill), slot content, labels of connectors saved with their drawn path (a static snapshot; the ends aren't live), skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, editable text on a path, image adjustments and images carried in the message. Budgets come from the file's own size (one value per compressed byte, 20M–128M, lower ceilings on 32-bit targets; the layer cap follows), so a 15.4 MB synthetic file with 300,000 layers opens whole; the file's bytes stay out of the command journal; an import report lists what was left out or changed once the file opens. Not read: elbowed or curved connectors without a saved path (drawn straight) and labels of connectors without a saved snapshot, table cells beyond their own layers, filled areas with their own fills, variables bound to fields the editor can't bind, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs` and the per-feature `*_tests.rs` beside them, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | -| `.sketch` (Sketch 48 and newer) | — (Figma's own Sketch import runs in its web app) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards as frames with their background, groups; Sketch 2025 and newer: frames (clipping or not) with their style, graphics, stacks as auto layout (direction, gap, alignment, padding, wrap, hug/fill sizing, items ignoring the stack), corners in the style (rounded, smooth with its smoothing; angled, inside square and inside arc as paths), pins and sizing, per-side borders, lists of blurs (progressive background blurs, glass), inner shadows in the shadow list, tints (a graphic's, group's or instance's fill colouring its layers, and colour overrides), text colour and visibility overrides, text sized by its sizing; rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients with Sketch's geometry, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (an outline mask that shows its own style draws a copy under itself, as Sketch does; alpha masks only mask; broken mask chains wrapped), progressive opacity (Fade) as an alpha mask of its gradient; text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts found by their PostScript names among the installed ones (else the family read from the name), variable font axes, Sketch's natural line (ascent and descent rounded, no line gap, a fifth more for classic Mac fonts) for text without a fixed line height; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), laid out for their size the way Sketch does it (proportional sharing per pins from format 110, scaling before) and still live; master backgrounds in instances only where Sketch shows them; Apple's system fonts found under the names designs use, with the platform's tracking kept as letter spacing; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids. Instances of a stack laid out at their size and texts an override changed measured again on open. Warnings: noise fills, motion and zoom blurs (drawn as plain blurs), fonts embedded with their data (not used), Smart Layout (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (70,000 layers open in ~3 s, debug build); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (0.8% on average) (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 70 in at most 4.4%, a Sketch 64 file's 65 artboards 2.1% on average, a Sketch 2026 showcase file's 16 frames 0.9% on average (at most 1.9%) | 5–10 (Smart Layout as auto layout, motion and zoom blurs, several borders of different widths) | +| `.sketch` (Sketch 48 and newer) | — (Figma's own Sketch import runs in its web app) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards as frames with their background, groups; Sketch 2025 and newer: frames (clipping or not) with their style, graphics, stacks as auto layout (direction, gap, alignment, padding, wrap, hug/fill sizing, items ignoring the stack), corners in the style (rounded, smooth with its smoothing; angled, inside square and inside arc as paths), pins and sizing, per-side borders, lists of blurs (progressive background blurs, glass), inner shadows in the shadow list, tints (a graphic's, group's or instance's fill colouring its layers, and colour overrides), text colour and visibility overrides, text sized by its sizing; rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients with Sketch's geometry, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (an outline mask that shows its own style draws a copy under itself, as Sketch does; alpha masks only mask; broken mask chains wrapped), progressive opacity (Fade) as an alpha mask of its gradient; text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts found by their PostScript names among the installed ones (else the family read from the name), variable font axes, Sketch's natural line (ascent and descent rounded, no line gap, a fifth more for classic Mac fonts) for text without a fixed line height; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), laid out for their size the way Sketch does it (proportional sharing per pins from format 110, scaling before) and still live; master backgrounds in instances only where Sketch shows them; Apple's system fonts found under the names designs use, with the platform's tracking kept as letter spacing; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids (hidden, as Sketch shows them only in its layout view). Instances of a stack laid out at their size and texts an override changed measured again on open. Warnings: noise fills, motion and zoom blurs (drawn as plain blurs), fonts embedded with their data (not used), Smart Layout (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (70,000 layers open in ~3 s, debug build); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (0.8% on average) (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 70 in at most 4.4%, a Sketch 64 file's 65 artboards 2.1% on average, a Sketch 2026 showcase file's 16 frames 0.9% on average (at most 1.9%) | 5–10 (Smart Layout as auto layout, motion and zoom blurs, several borders of different widths) | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | | REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout (sizing modes left out read as hug, as documented; grid track sizes from `gridColumnsSizing` / `gridRowsSizing`: px, fr, auto, `minmax(0, 1fr)`, `repeat()`), constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, slots (`SLOT` layers bound to their slot property; an instance's slot keeps its content as the instance's own unless its property value is the main's default content; slot limits and preferred components are warnings), styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings, image adjustments (the same tint sign as `.fig`); the import report after opening; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | From 5f5b8021270abdbf2652affb1d0965f0c971f1c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 23:49:57 +0200 Subject: [PATCH 493/817] M6: Sketch import: roadmap and parity rows Co-Authored-By: Claude Opus 5.5 --- ROADMAP.md | 2 +- docs/target-app-parity.md | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 3f57ed576..0a7b50423 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -316,7 +316,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| -| 2026-10-21 | minor | Best-effort `.sketch` import (Sketch 48 and newer): open, import, drop, CLI and MCP; symbols become live components and instances, shared styles and Color Variables come across ([file-format-parity](docs/file-format-parity.md)). Headline numbers unchanged | +| 2026-10-21 | minor | Best-effort `.sketch` import (Sketch 48 and newer): open, import, drop, CLI and MCP; symbols become live components and instances, shared styles and Color Variables come across, Sketch 2025 frames, stacks (as auto layout) and tints too, text placed as Sketch places it; checked on three real files against Sketch's own renders ([file-format-parity](docs/file-format-parity.md)). Headline numbers unchanged | | 2026-10-20 | minor | A document dropped on the canvas opens (#916): a `.figcraft`, `.fig` or file JSON dropped on the canvas opens as a file of its own, as on the home screen, in the browser too; it used to add its pages to the file in front. Images and SVG still import at the drop point, File ▸ Import still adds pages, and dragging only documents over the canvas says "Drop to open" (not in the browser, which names no file until the drop). Numbers unchanged | | 2026-10-20 | minor | Duplicating a main component makes an instance (#892): Duplicate and Alt-drag copied a main component as a second main; within its file the copy is now an instance of it, as Copy then Paste already was (a variant duplicated in its set stays a variant). Numbers unchanged. | | 2026-10-20 | minor | Readable disabled and selected text (#890): the dim text colour (disabled buttons, placeholders, hints) is at least 3:1 against panels, fields and selected rows in both themes (it was 2.1:1 in the light theme), a disabled button is grey with that text instead of fading to 40%, and selected text (renaming a page or layer, any text box) takes the theme's readable green on the highlight (1.4:1 in the dark theme before, now 4.2:1 or more); checked with the colour contrast helper (`theme::tests`). Numbers unchanged | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index a1a5bf128..6ab02ade1 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # FigCraft parity with Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (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); 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) · **Target:** Figma Design (desktop app 126.10.7, macOS) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-21 · **Change:** minor (`.sketch` import, best effort, numbers unchanged; 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); 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) · **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 @@ -124,7 +124,7 @@ Breadth: does it exist. Ready: depth, correctness and fidelity for real projects |---|---|---|---|---|---| | Features (depth) | 35 | 63% | 28–67 (areas 1–13, 15, 16, 20) | The table above; core editor ~72% | this file | | UI/UX fidelity | 15 | 58% | 40–60 | Look & feel compared side by side with UI3 (~65% by the builders); tool-by-tool interaction (modifiers while dragging, hover states, popovers) not yet compared (a cursor for every tool and modifier, number fields and panel widths built from the documentation, not compared); accessibility names and keyboard navigation landed | [ui-parity](ui-parity.md) | -| File formats | 12 | 60% | 5–10 | `.fig` read, best effort, with editable vector networks and (2026-10-17) more fidelity, budgets for large files and an import report (tested on generated fixtures, not real files); layers copied from another design app paste the same way (tested only with clipboard HTML made from our own export), `.fig` write experimental (round trips through our own importer; written files open and draw in other software); REST JSON import, SVG in/out, PNG/JPG/WebP/PDF export solid, with a behaviour suite from the documentation | [file-format-parity](file-format-parity.md) | +| File formats | 12 | 60% | 5–10 | `.sketch` read (Sketch 48 and newer, best effort; 2026-10-21): live symbols, shared styles, Sketch 2025 frames and stacks, checked on three real files against Sketch's own renders (0.8–2% of pixels differ on average); `.fig` read, best effort, with editable vector networks and (2026-10-17) more fidelity, budgets for large files and an import report (tested on generated fixtures, not real files); layers copied from another design app paste the same way (tested only with clipboard HTML made from our own export), `.fig` write experimental (round trips through our own importer; written files open and draw in other software); REST JSON import, SVG in/out, PNG/JPG/WebP/PDF export solid, with a behaviour suite from the documentation | [file-format-parity](file-format-parity.md) | | Collaboration | 10 | 13% | 52–104 | Local comments, version history and branches with review and merge; the multiplayer core (sync model, server ordering, client reconciliation, convergence tests) landed in #103, and live sessions (preview) co-edit a file hosted by a desktop app or kept on a self-hosted `figcraft-server` with edit and view links, joined from the app or the browser, with cursor chat and spotlight (`docs/collab-protocol.md`) | [collaboration-parity](collaboration-parity.md) | | Stability | 8 | 55% | 20–40 | Never-crash lints, command guard with rollback, recovery copies, 963 tests incl. junk-parameter sweeps and a seeded retained-render walk; but two days old, one release (v0.2.0), no field reports, QA mostly on macOS | [gaps](gaps.md) | | Performance | 6 | 60% | 30–60 | `cargo xtask bench`: 50k-layer page ~8 ms zoomed out, 10k-layer edits ~0.2 ms, 2,000-instance design system edits 4–64 ms; CPU (tiny-skia) canvas where Figma renders on the GPU; nothing timed against Figma on the same file | [hardware-parity](hardware-parity.md) | @@ -639,6 +639,7 @@ Carried over from the ROADMAP's "Shipped so far" (2026-10-10). The test count th | Date | Change | Summary | |---|---|---| | 2026-10-20 | minor | Layer data reads back (#879): `node.get` (the command, the control method and MCP `get_node`) and `document.inspect` report a layer's or page's `pluginData` as `{key: value}` when it has any, so a tool that keeps state in a file with `node.set {props: {pluginData}}` can read it on its next run (`plugin_data_tests`). Numbers unchanged | +| 2026-10-21 | minor | `.sketch` import (best effort, Sketch 48 and newer) in the file formats dimension: pages, layers, styles, live symbols with overrides, shared styles and Color Variables, prototype links, Sketch 2025 frames, stacks as auto layout and tints, text placed as Sketch places it; checked on three real files (Sketch 50, 64 and 2026) against Sketch's own renders. Numbers unchanged: Figma has no `.sketch` reader in its desktop app, so the file-exchange discounts (Figma users' files) don't move | | 2026-10-17 | minor | Menu breadth re-run with `cargo xtask parity`: 212 / 212 (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Rows for the 2026-10-17 landings: import/export (area 14) and the file formats dimension name the `.fig` import's new fidelity (instance identity, overrides by key, text style precedence, grid tracks, slots, connector labels, per-point joins, text on a path, image adjustments, list start numbers, vertical trim), budgets from the file's size, the import report, a `.fig` copy from Save as and paste from another design app; the localization evidence takes the re-measured catalog counts (2,272 entries, drafts at 95–99%, Indonesian and Czech drafts, Swedish and Turkish catalogs); the Automation line adds control requests answered while the window is minimised (#720); batch #753's Selection colors, smart-selection spacing, Present tab and auto layout on empty frames are in ui-parity, prototyping-parity and auto-layout-parity. Numbers unchanged: every `.fig` and paste change is checked on synthetic files or clipboard HTML made from our own export, and real files are what gap 1's blocker and the file-exchange discounts wait for; the UI changes (menus, the Actions palette, editor fixes) are not compared side by side, so UI/UX stays at 58%; the localization grade and hours stay (Indonesian's draft is offset by the drafts' new gaps) | | 2026-10-17 | minor | Automation roots (M8, #715, #481): `figcraft-cli mcp --automation-read-root DIR --automation-write-root DIR` (each repeatable, existing folders) and the desktop app with the same flags confine every file a command reads to the read and write roots and every file it writes to the write roots; paths are resolved (links followed, `..`, Windows `\\?\` and UNC paths, case) and compared by whole folder names, anything else is an ordinary error. The engine reaches the file system through one module (enforced by `crates/engine/clippy.toml`), and a sweep runs every command with paths outside the roots. `--attach` refuses the flags (the app confines itself); `ui.screenshot` and `ui.render` return PNG data without a `path`, so the attached MCP server writes no temporary files. Numbers unchanged. | | 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | From 79894cfad22723b40a7520f619a2e8419d67f20e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 23:54:25 +0200 Subject: [PATCH 494/817] M6: Sketch import: junk tints and colour overrides can't panic A tint or fill that isn't a JSON object is left alone instead of being indexed. A structural fuzz replaces each value of a rich file with values of other types and imports every variant. Co-Authored-By: Claude Opus 5.5 --- crates/format/src/sketch/frames_tests.rs | 14 +++++ crates/format/src/sketch/style.rs | 6 +- crates/format/src/sketch/symbols.rs | 11 +++- crates/format/src/sketch/tests.rs | 75 ++++++++++++++++++++++++ 4 files changed, 101 insertions(+), 5 deletions(-) diff --git a/crates/format/src/sketch/frames_tests.rs b/crates/format/src/sketch/frames_tests.rs index aadc4b5f4..2ae2b62d1 100644 --- a/crates/format/src/sketch/frames_tests.rs +++ b/crates/format/src/sketch/frames_tests.rs @@ -383,3 +383,17 @@ fn cut_corners_become_paths() { assert_eq!(arc.vertices.len(), 8); assert!(arc.segments.iter().any(|g| g.ta != (0.0, 0.0)), "the corners are arcs"); } + +/// Tints and colour overrides that aren't colours, and fills that aren't objects, are junk: left +/// alone, never a panic. +#[test] +fn junk_tints_and_colour_overrides() { + let child = styled(rect("Child", 0.0, 0.0, 10.0, 10.0), "fills", json!([solid_fill(0.0, 0.0, 0.0, 1.0)])); + let mut g = group("G", 0.0, 0.0, 10.0, 10.0, vec![child.clone()]); + g["style"] = json!({"_class": "style", "fills": [{"_class": "fill", "isEnabled": true, "fillType": 0, "layeringType": 1, "color": 5}]}); + let (_, _) = open(vec![g]); + let mut odd = rect("L", 0.0, 0.0, 10.0, 10.0); + odd["style"]["fills"] = json!([true]); + let m = master("M", "S", "Odd", 10.0, 10.0, vec![odd]); + let _ = open_symbols(vec![instance("I", "S", 0.0, 0.0, 10.0, 10.0, &[("L_fillColor", color(1.0, 0.0, 0.0, 1.0))])], vec![m]); +} diff --git a/crates/format/src/sketch/style.rs b/crates/format/src/sketch/style.rs index 45c739e63..5e4768036 100644 --- a/crates/format/src/sketch/style.rs +++ b/crates/format/src/sketch/style.rs @@ -335,7 +335,7 @@ pub(crate) fn tint_of(style: Option<&Value>, legacy: bool) -> Option { None => legacy, } })?; - (f.get("fillType").and_then(Value::as_i64).unwrap_or(0) == 0).then(|| f.get("color").cloned()).flatten() + (f.get("fillType").and_then(Value::as_i64).unwrap_or(0) == 0).then(|| f.get("color").filter(|c| c.is_object()).cloned()).flatten() } /// Recolour `layers` (Sketch JSON) with tint `color`: every enabled fill and border takes it, @@ -382,7 +382,9 @@ pub(crate) fn tint_layers(layers: &mut [Value], color: &Value, depth: usize) { fn tinted(old: Option<&Value>, tint: &Value) -> Value { let alpha = |c: Option<&Value>| c.and_then(|c| num(c, "alpha")).unwrap_or(1.0).clamp(0.0, 1.0); let mut c = tint.clone(); - c["alpha"] = json!(alpha(Some(tint)) * alpha(old)); + if let Some(m) = c.as_object_mut() { + m.insert("alpha".into(), json!(alpha(Some(tint)) * alpha(old))); + } c } diff --git a/crates/format/src/sketch/symbols.rs b/crates/format/src/sketch/symbols.rs index 06a39f680..f3cd26c43 100644 --- a/crates/format/src/sketch/symbols.rs +++ b/crates/format/src/sketch/symbols.rs @@ -409,10 +409,15 @@ fn apply( } // A colour override on a shape or group: its first fill's colour. if let Some(c) = get("fillColor").filter(|c| c.is_object()) - && let Some(f) = l.get_mut("style").and_then(|s| s.get_mut("fills")).and_then(Value::as_array_mut).and_then(|f| f.first_mut()) + && let Some(f) = l + .get_mut("style") + .and_then(|s| s.get_mut("fills")) + .and_then(Value::as_array_mut) + .and_then(|f| f.first_mut()) + .and_then(Value::as_object_mut) { - f["fillType"] = json!(0); - f["color"] = c.clone(); + f.insert("fillType".into(), json!(0)); + f.insert("color".into(), c.clone()); } } } diff --git a/crates/format/src/sketch/tests.rs b/crates/format/src/sketch/tests.rs index 4fb244008..8ed302315 100644 --- a/crates/format/src/sketch/tests.rs +++ b/crates/format/src/sketch/tests.rs @@ -89,6 +89,81 @@ fn junk_never_panics() { let _ = import(&raw_zip(&document(&["P"]), &json!("x"), &[], &[]), "f"); } +/// A file using most of what the importer reads (Sketch 2025 frames and stacks, tints, symbols +/// with overrides, text, paths, gradients, masks, fades, grids) with each of its values in turn +/// replaced by a value of another type: every import ends without a panic. +#[test] +fn junk_values_never_panic() { + let text_layer = text("T", 0.0, 0.0, 80.0, 20.0, "Go", &[(0, 2, "Helvetica", 14.0, [0.0, 0.0, 0.0, 1.0])]); + let dot = styled(rect("Dot", 0.0, 0.0, 10.0, 10.0), "fills", json!([solid_fill(0.0, 0.0, 0.0, 1.0)])); + let mut tint = solid_fill(1.0, 0.0, 0.0, 1.0); + tint["layeringType"] = json!(1); + let mut icon = master("MI", "SI", "Icon", 24.0, 24.0, vec![dot.clone()]); + icon["groupBehavior"] = json!(2); + icon["style"]["fills"] = json!([tint]); + let mut chip = stack(master("MC", "SC", "Chip", 60.0, 24.0, vec![text_layer.clone(), instance("N", "SI", 0.0, 0.0, 24.0, 24.0, &[])]), 0, 1, 1, 6.0, [8.0, 4.0, 10.0, 4.0]); + chip["style"]["corners"] = json!({"_class": "MSImmutableStyleCorners", "radii": [12], "style": 2, "smoothing": 0.6}); + let over = [("T_stringValue", json!("Longer")), ("N_fillColor", color(0.0, 1.0, 0.0, 1.0)), ("T_textColor", color(0.0, 0.0, 1.0, 1.0)), ("N_isVisible", json!("0"))]; + let inst = instance("I", "SC", 0.0, 100.0, 200.0, 24.0, &over); + let grad = json!({"_class": "fill", "isEnabled": true, "fillType": 1, "color": color(0.0, 0.0, 0.0, 1.0), + "gradient": {"_class": "gradient", "gradientType": 0, "from": "{0, 0}", "to": "{1, 1}", "stops": [ + {"_class": "gradientStop", "position": 0, "color": color(0.0, 0.0, 0.0, 1.0)}, {"_class": "gradientStop", "position": 1, "color": color(1.0, 1.0, 1.0, 0.0)}]}}); + let mut faded = styled(rect("Faded", 0.0, 0.0, 30.0, 30.0), "fills", json!([grad.clone()])); + faded["style"]["contextSettings"] = json!({"_class": "graphicsContextSettings", "opacity": 1, "isProgressive": true, "gradient": grad["gradient"].clone()}); + let mask = with(with(styled(rect("Mask", 0.0, 0.0, 30.0, 30.0), "fills", json!([grad])), "hasClippingMask", json!(true)), "clippingMaskMode", json!(1)); + let path = shape_path("P", 0.0, 0.0, 20.0, 20.0, &[(0.0, 0.0), (1.0, 0.0), (0.5, 1.0)], true); + let mut g = group("G", 0.0, 0.0, 100.0, 100.0, vec![mask, faded, path, dot, text_layer]); + g["style"] = json!({"_class": "style", "fills": [tint_fill()]}); + let mut frame = stack(frame_group("F", 0.0, 0.0, 300.0, 300.0, vec![g, inst]), 1, 0, 3, 8.0, [0.0; 4]); + frame["layout"] = json!({"_class": "layoutGrid", "isEnabled": true, "columnWidth": 20, "gutterWidth": 10, "numberOfColumns": 4, "drawVertical": true}); + let pages = [page("P", "Page", vec![frame]), page("S", "Symbols", vec![icon, chip])]; + // Every value's path, with each junk value in turn (a deterministic sample keeps it quick). + fn paths(v: &serde_json::Value, at: &mut Vec, out: &mut Vec>) { + out.push(at.clone()); + match v { + serde_json::Value::Object(m) => { + for (k, c) in m { + at.push(k.clone()); + paths(c, at, out); + at.pop(); + } + } + serde_json::Value::Array(a) => { + for (i, c) in a.iter().enumerate() { + at.push(i.to_string()); + paths(c, at, out); + at.pop(); + } + } + _ => {} + } + } + let junk = [json!(null), json!(5), json!(-1e300), json!("x"), json!(true), json!([]), json!({}), json!([1, "a"])]; + for (pi, p) in pages.iter().enumerate() { + let mut all = Vec::new(); + paths(p, &mut Vec::new(), &mut all); + for (n, at) in all.iter().enumerate().skip(1) { + let mut changed = pages.clone(); + let mut v = &mut changed[pi]; + for k in at { + v = match v { + serde_json::Value::Object(m) => m.get_mut(k).unwrap(), + serde_json::Value::Array(a) => &mut a[k.parse::().unwrap()], + _ => unreachable!(), + }; + } + *v = junk[n % junk.len()].clone(); + let _ = import(&sketch_zip("2026.3.1", 196, document(&["P", "S"]), &changed, &[]), "f"); + } + } +} + +fn tint_fill() -> serde_json::Value { + let mut f = solid_fill(0.0, 0.0, 1.0, 1.0); + f["layeringType"] = json!(1); + f +} + #[test] fn deep_nesting_does_not_fail_the_file() { let mut deep = rect("R", 0.0, 0.0, 1.0, 1.0); From 40c7cb302917d10e61023369a092dd6863a96c63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Wed, 21 Oct 2026 23:57:20 +0200 Subject: [PATCH 495/817] M6: Sketch import: tint copies and handed overrides count as work Tinting copies a group's or master's layers; the copy is charged to the import's work budget (past it, tints are skipped with a note). An override handed to a nested instance costs its value's size, so deep chains of large overrides can't be copied without end. Co-Authored-By: Claude Opus 5.5 --- crates/format/src/sketch/frames_tests.rs | 29 ++++++++++++++++++++++++ crates/format/src/sketch/symbols.rs | 20 +++++++++++----- crates/format/src/sketch/tree.rs | 21 +++++++++++++++-- 3 files changed, 62 insertions(+), 8 deletions(-) diff --git a/crates/format/src/sketch/frames_tests.rs b/crates/format/src/sketch/frames_tests.rs index 2ae2b62d1..429a884bb 100644 --- a/crates/format/src/sketch/frames_tests.rs +++ b/crates/format/src/sketch/frames_tests.rs @@ -397,3 +397,32 @@ fn junk_tints_and_colour_overrides() { let m = master("M", "S", "Odd", 10.0, 10.0, vec![odd]); let _ = open_symbols(vec![instance("I", "S", 0.0, 0.0, 10.0, 10.0, &[("L_fillColor", color(1.0, 0.0, 0.0, 1.0))])], vec![m]); } + +/// Tinting copies a group's layers: the copies count against the import's work budget, so nested +/// tinted groups of large layers can't make the import copy without end; past the budget, tints +/// are skipped with a note. +#[test] +fn nested_tints_are_budgeted() { + // Text that doesn't compress, so the page stays within the archive's size checks. + let mut seed = 0x2545_f491_u32; + let big: String = (0..1_000_000) + .map(|_| { + seed ^= seed << 13; + seed ^= seed >> 17; + seed ^= seed << 5; + char::from(b'a' + (seed % 26) as u8) + }) + .collect(); + let mut l = styled(rect("Leaf", 0.0, 0.0, 10.0, 10.0), "fills", json!([solid_fill(0.0, 0.0, 0.0, 1.0)])); + for i in 0..35 { + let mut pad = rect(&big, 0.0, 0.0, 1.0, 1.0); + pad["do_objectID"] = json!(format!("pad{i}")); + let mut g = group(&format!("G{i}"), 0.0, 0.0, 10.0, 10.0, vec![l, pad]); + let mut t = solid_fill(1.0, 0.0, 0.0, 1.0); + t["layeringType"] = json!(1); + g["style"] = json!({"_class": "style", "fills": [t]}); + l = g; + } + let (_, warnings) = open(vec![l]); + assert!(warnings.iter().any(|w| w.contains("tint")), "{warnings:?}"); +} diff --git a/crates/format/src/sketch/symbols.rs b/crates/format/src/sketch/symbols.rs index f3cd26c43..dd8062827 100644 --- a/crates/format/src/sketch/symbols.rs +++ b/crates/format/src/sketch/symbols.rs @@ -80,7 +80,7 @@ impl Symbols { } /// What copying and mapping `v` costs, in work units: one per JSON value, one per 8 bytes of text. -fn weight(v: &Value, depth: usize) -> u64 { +pub(crate) fn weight(v: &Value, depth: usize) -> u64 { if depth > 256 { return 1; } @@ -141,7 +141,7 @@ pub(crate) fn component(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, ro let sid = str_field(l, "symbolID").unwrap_or("").to_string(); // A graphic's fill tints its layers. let tinted; - let l = match super::style::tint_of(l.get("style"), false) { + let l = match super::style::tint_of(l.get("style"), false).filter(|_| super::tree::spend_on_tint(cx, l)) { Some(t) => { let mut c = l.clone(); if let Some(kids) = c.get_mut("layers").and_then(Value::as_array_mut) { @@ -342,8 +342,8 @@ fn nested(ov: &BTreeMap) -> BTreeMap<&str, Vec<(&str, &Value)>> { /// Apply `ov` to the layers of a master's copy: to the layers it names, and passed on to nested /// instances for the layers inside them (an outer override wins over the nested instance's own). -/// Each override handed to a nested instance costs [`OVERRIDE_COST`] units of `budget`; once it is spent, the -/// rest aren't handed on. +/// Each override handed to a nested instance costs [`OVERRIDE_COST`] units of `budget` plus its +/// value's [`weight`]; once it is spent, the rest aren't handed on. fn apply( layers: &mut [Value], ov: &BTreeMap, @@ -368,8 +368,16 @@ fn apply( _ => {} } let inner = nested.get(id.as_str()).map(Vec::as_slice).unwrap_or_default(); - let take = usize::try_from(*budget / OVERRIDE_COST).unwrap_or(usize::MAX).min(inner.len()); - *budget -= take as u64 * OVERRIDE_COST; + // Each costs its copy's size: deep chains of large overrides use up the budget. + let mut take = 0; + for (_, v) in inner { + let cost = OVERRIDE_COST + weight(v, 0); + if cost > *budget { + break; + } + *budget -= cost; + take += 1; + } if take > 0 { let mut own = l.get("overrideValues").and_then(Value::as_array).cloned().unwrap_or_default(); own.extend(inner.iter().take(take).map(|(rest, v)| json!({"_class": "overrideValue", "overrideName": rest, "value": v}))); diff --git a/crates/format/src/sketch/tree.rs b/crates/format/src/sketch/tree.rs index 841b4daf9..cccf3934a 100644 --- a/crates/format/src/sketch/tree.rs +++ b/crates/format/src/sketch/tree.rs @@ -87,11 +87,27 @@ impl Cx { true } + /// Spend `n` units of the work budget on tinting; false (with a note, once) when it would run + /// out. + pub(crate) fn spend_on_tint(&mut self, n: u64) -> bool { + if self.work.saturating_add(n) > self.max_work { + self.warn("tints past what the import handles were skipped; those layers keep their own colours"); + return false; + } + self.work += n; + true + } + pub(crate) fn work_left(&self) -> u64 { self.max_work.saturating_sub(self.work) } } +/// Charge the copy tinting layer `l` makes against the work budget: whether it may be tinted. +pub(crate) fn spend_on_tint(cx: &mut Cx, l: &Value) -> bool { + cx.spend_on_tint(super::symbols::weight(l, 0)) +} + /// Map the pages of `archive` to a REST file JSON named `name`. pub(crate) fn to_rest(archive: &Archive, name: &str, max_nodes: usize, fonts: Option) -> Map { let symbols = super::symbols::Symbols::read(&archive.document, &archive.pages); @@ -247,8 +263,9 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: // A group's or graphic's fill tints its layers (a frame's is its background). let tinted; let gb = l.get("groupBehavior").and_then(Value::as_i64); - let l = match (class, super::style::tint_of(l.get("style"), gb != Some(1))) { - ("group", Some(t)) => { + let tint = if class == "group" { super::style::tint_of(l.get("style"), gb != Some(1)) } else { None }; + let l = match tint.filter(|_| spend_on_tint(cx, l)) { + Some(t) => { // A plain group's legacy fill is all tint; a frame keeps its background fills. if gb != Some(1) { node.remove("fills"); From 3e92904cba325f9a451f96aa54401a0f66d0400a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Thu, 22 Oct 2026 00:03:30 +0200 Subject: [PATCH 496/817] M6: Sketch import: review fixes Texts an auto layout places keep the layout's position (the next layout pass would take the baseline move back). A faded layer's group takes the layer's id, so stacks, links and overrides still find it; faded masks stay masks. figcraft-format no longer depends on figcraft-layout. Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 1 - crates/engine/src/cmd/file.rs | 5 +++- crates/engine/src/sketch_import_tests.rs | 35 ++++++++++++++++++++++++ crates/format/Cargo.toml | 1 - crates/format/src/sketch/frames_tests.rs | 15 ++++++++++ crates/format/src/sketch/tests.rs | 27 ++++++++++++++---- crates/format/src/sketch/tree.rs | 13 +++++---- 7 files changed, 83 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d118fda5..32e7be595 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1587,7 +1587,6 @@ name = "figcraft-format" version = "0.9.0" dependencies = [ "figcraft-doc", - "figcraft-layout", "figcraft-pathops", "flate2", "image", diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index 8db15ceea..8f7da8243 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -720,6 +720,9 @@ fn sketch_line_heights(doc: &mut Document) { }; let ids: Vec = doc.nodes().filter(|n| matches!(n.kind, NodeKind::Text(_))).map(|n| n.id).collect(); for id in ids { + // An auto layout places its texts itself (its next pass would take a move back). + let laid_out = + doc.node(id).is_some_and(|n| !n.child_layout.absolute && n.parent.and_then(|p| doc.node(p)).is_some_and(|p| p.layout.is_some())); let Some(n) = doc.node_mut(id) else { continue }; let NodeKind::Text(td) = &mut n.kind else { continue }; let down = set(&mut td.style); @@ -727,7 +730,7 @@ fn sketch_line_heights(doc: &mut Document) { set(&mut r.style); } // Down in the layer's own frame (a rotated text moves along its own axis). - if down.is_finite() && down != 0.0 { + if !laid_out && down.is_finite() && down != 0.0 { n.transform *= figcraft_doc::geom::Affine::translate((0.0, down)); } } diff --git a/crates/engine/src/sketch_import_tests.rs b/crates/engine/src/sketch_import_tests.rs index 36b200a5a..292cd019c 100644 --- a/crates/engine/src/sketch_import_tests.rs +++ b/crates/engine/src/sketch_import_tests.rs @@ -441,3 +441,38 @@ fn sketch_text_gets_sketchs_natural_line() { let figcraft_doc::LineHeight::Percent(p) = td.style.line_height else { panic!("{:?}", td.style.line_height) }; assert!((p - 116.0).abs() < 1e-9, "{p}"); } + +/// A text an auto layout places isn't moved to Sketch's baseline (the next layout pass would take +/// the move back): laying the stack out again leaves it where the import put it. +#[test] +fn sketch_text_in_a_stack_stays_put() { + if !std::path::Path::new("/System/Library/Fonts/Helvetica.ttc").exists() { + return; + } + figcraft_text::fontdb::scan_system_fonts(); + let font = json!({"name": "Helvetica", "size": 40}); + let run = json!({"location": 0, "length": 2, "attributes": {"MSAttributedStringFontAttribute": {"attributes": font}}}); + let label = shape( + "text", + "Label", + [10.0, 10.0, 50.0, 48.0], + json!({"attributedString": {"string": "Hi", "attributes": [run]}, "horizontalSizing": 1, "verticalSizing": 1}), + ); + let layout = json!({"_class": "MSImmutableFlexGroupLayout", "flexDirection": 1, "justifyContent": 0, "alignItems": 0, "allGuttersGap": 0, "stackingOrder": 0}); + let stack = shape( + "group", + "Stack", + [0.0, 0.0, 200.0, 68.0], + json!({"groupBehavior": 1, "groupLayout": layout, "leftPadding": 10, "topPadding": 10, "rightPadding": 10, "bottomPadding": 10, "layers": [label]}), + ); + let data = base64::engine::general_purpose::STANDARD.encode(sketch_with("2026.3.1", &[("A", "Page")], &[stack])); + let mut s = Session::new(); + s.execute("file.open", &json!({"data": data, "name": "x.sketch"})).unwrap(); + let mut doc = s.doc().unwrap().clone(); + let stack = doc.nodes().find(|n| n.name == "Stack").unwrap().id; + let label = doc.nodes().find(|n| n.name == "Label").unwrap().id; + let before = doc.world_bounds(label).unwrap(); + figcraft_layout::layout_frame(&mut doc, stack, &crate::measure::TextMeasure); + let after = doc.world_bounds(label).unwrap(); + assert!((before.y0 - after.y0).abs() < 1e-6, "{before:?} → {after:?}"); +} diff --git a/crates/format/Cargo.toml b/crates/format/Cargo.toml index 80a943e2e..3dca39126 100644 --- a/crates/format/Cargo.toml +++ b/crates/format/Cargo.toml @@ -11,7 +11,6 @@ workspace = true [dependencies] figcraft-doc = { workspace = true } figcraft-pathops = { workspace = true } -figcraft-layout = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } zip = { workspace = true } diff --git a/crates/format/src/sketch/frames_tests.rs b/crates/format/src/sketch/frames_tests.rs index 429a884bb..5a5cefca5 100644 --- a/crates/format/src/sketch/frames_tests.rs +++ b/crates/format/src/sketch/frames_tests.rs @@ -426,3 +426,18 @@ fn nested_tints_are_budgeted() { let (_, warnings) = open(vec![l]); assert!(warnings.iter().any(|w| w.contains("tint")), "{warnings:?}"); } + +/// A faded layer in a stack keeps its place in the stack: the group the fade makes takes the +/// layer's id, and with it its sizing. +#[test] +fn faded_stack_items_keep_their_sizing() { + let fade = json!({"_class": "graphicsContextSettings", "opacity": 1, "isProgressive": true, + "gradient": {"_class": "gradient", "gradientType": 0, "from": "{0.5, 0}", "to": "{0.5, 1}", "stops": [ + {"_class": "gradientStop", "position": 0, "color": color(0.0, 0.0, 0.0, 1.0)}, {"_class": "gradientStop", "position": 1, "color": color(0.0, 0.0, 0.0, 0.0)}]}}); + let mut item = styled(rect("Item", 0.0, 0.0, 50.0, 20.0), "contextSettings", fade); + item["horizontalSizing"] = json!(2); + let (doc, _) = open(vec![stack(frame_group("Row", 0.0, 0.0, 200.0, 20.0, vec![item]), 0, 0, 0, 0.0, [0.0; 4])]); + let row = node(&doc, "Row"); + let wrap = doc.node(row.children[0]).unwrap(); + assert_eq!(format!("{:?}", wrap.child_layout.sizing_h), "Fill", "{:?}", wrap.child_layout); +} diff --git a/crates/format/src/sketch/tests.rs b/crates/format/src/sketch/tests.rs index 8ed302315..b4368de12 100644 --- a/crates/format/src/sketch/tests.rs +++ b/crates/format/src/sketch/tests.rs @@ -101,21 +101,36 @@ fn junk_values_never_panic() { let mut icon = master("MI", "SI", "Icon", 24.0, 24.0, vec![dot.clone()]); icon["groupBehavior"] = json!(2); icon["style"]["fills"] = json!([tint]); - let mut chip = stack(master("MC", "SC", "Chip", 60.0, 24.0, vec![text_layer.clone(), instance("N", "SI", 0.0, 0.0, 24.0, 24.0, &[])]), 0, 1, 1, 6.0, [8.0, 4.0, 10.0, 4.0]); + let mut chip = stack( + master("MC", "SC", "Chip", 60.0, 24.0, vec![text_layer.clone(), instance("N", "SI", 0.0, 0.0, 24.0, 24.0, &[])]), + 0, + 1, + 1, + 6.0, + [8.0, 4.0, 10.0, 4.0], + ); chip["style"]["corners"] = json!({"_class": "MSImmutableStyleCorners", "radii": [12], "style": 2, "smoothing": 0.6}); - let over = [("T_stringValue", json!("Longer")), ("N_fillColor", color(0.0, 1.0, 0.0, 1.0)), ("T_textColor", color(0.0, 0.0, 1.0, 1.0)), ("N_isVisible", json!("0"))]; + let over = [ + ("T_stringValue", json!("Longer")), + ("N_fillColor", color(0.0, 1.0, 0.0, 1.0)), + ("T_textColor", color(0.0, 0.0, 1.0, 1.0)), + ("N_isVisible", json!("0")), + ]; let inst = instance("I", "SC", 0.0, 100.0, 200.0, 24.0, &over); let grad = json!({"_class": "fill", "isEnabled": true, "fillType": 1, "color": color(0.0, 0.0, 0.0, 1.0), "gradient": {"_class": "gradient", "gradientType": 0, "from": "{0, 0}", "to": "{1, 1}", "stops": [ {"_class": "gradientStop", "position": 0, "color": color(0.0, 0.0, 0.0, 1.0)}, {"_class": "gradientStop", "position": 1, "color": color(1.0, 1.0, 1.0, 0.0)}]}}); let mut faded = styled(rect("Faded", 0.0, 0.0, 30.0, 30.0), "fills", json!([grad.clone()])); - faded["style"]["contextSettings"] = json!({"_class": "graphicsContextSettings", "opacity": 1, "isProgressive": true, "gradient": grad["gradient"].clone()}); - let mask = with(with(styled(rect("Mask", 0.0, 0.0, 30.0, 30.0), "fills", json!([grad])), "hasClippingMask", json!(true)), "clippingMaskMode", json!(1)); + faded["style"]["contextSettings"] = + json!({"_class": "graphicsContextSettings", "opacity": 1, "isProgressive": true, "gradient": grad["gradient"].clone()}); + let mask = + with(with(styled(rect("Mask", 0.0, 0.0, 30.0, 30.0), "fills", json!([grad])), "hasClippingMask", json!(true)), "clippingMaskMode", json!(1)); let path = shape_path("P", 0.0, 0.0, 20.0, 20.0, &[(0.0, 0.0), (1.0, 0.0), (0.5, 1.0)], true); let mut g = group("G", 0.0, 0.0, 100.0, 100.0, vec![mask, faded, path, dot, text_layer]); g["style"] = json!({"_class": "style", "fills": [tint_fill()]}); let mut frame = stack(frame_group("F", 0.0, 0.0, 300.0, 300.0, vec![g, inst]), 1, 0, 3, 8.0, [0.0; 4]); - frame["layout"] = json!({"_class": "layoutGrid", "isEnabled": true, "columnWidth": 20, "gutterWidth": 10, "numberOfColumns": 4, "drawVertical": true}); + frame["layout"] = + json!({"_class": "layoutGrid", "isEnabled": true, "columnWidth": 20, "gutterWidth": 10, "numberOfColumns": 4, "drawVertical": true}); let pages = [page("P", "Page", vec![frame]), page("S", "Symbols", vec![icon, chip])]; // Every value's path, with each junk value in turn (a deterministic sample keeps it quick). fn paths(v: &serde_json::Value, at: &mut Vec, out: &mut Vec>) { @@ -149,7 +164,7 @@ fn junk_values_never_panic() { v = match v { serde_json::Value::Object(m) => m.get_mut(k).unwrap(), serde_json::Value::Array(a) => &mut a[k.parse::().unwrap()], - _ => unreachable!(), + _ => panic!("a path only runs through objects and arrays"), }; } *v = junk[n % junk.len()].clone(); diff --git a/crates/format/src/sketch/tree.rs b/crates/format/src/sketch/tree.rs index cccf3934a..8bad4c6c7 100644 --- a/crates/format/src/sketch/tree.rs +++ b/crates/format/src/sketch/tree.rs @@ -294,7 +294,8 @@ pub(crate) fn layer(cx: &mut Cx, l: &Value, parent: Affine, depth: usize, root: fn fade(cx: &mut Cx, l: &Value, node: JsonMap, world: Affine, w: f64, h: f64) -> Value { let ctx = l.get("style").and_then(|s| s.get("contextSettings")); let gradient = ctx.filter(|c| c.get("isProgressive").and_then(Value::as_bool) == Some(true)).and_then(|c| c.get("gradient")); - let Some(gradient) = gradient else { return Value::Object(node) }; + // A mask stays as it is: its group would stop masking the layers above it. + let Some(gradient) = gradient.filter(|_| node.get("isMask").and_then(Value::as_bool) != Some(true)) else { return Value::Object(node) }; let fill = json!({"_class": "fill", "isEnabled": true, "fillType": 1, "gradient": gradient}); let fills = super::style::fills(cx, &json!({"fills": [fill]}), w, h); if fills.is_empty() { @@ -304,18 +305,20 @@ fn fade(cx: &mut Cx, l: &Value, node: JsonMap, world: Affine, w: let identity = json!([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]); let bb = world.transform_rect_bbox(Rect::new(0.0, 0.0, w, h)); let abs = json!({"x": bb.x0, "y": bb.y0, "width": bb.width(), "height": bb.height()}); - let mut inner = node.clone(); + // The group takes the layer's id (stacks, links and overrides find it), the layer a new one. + let mut inner = node; let mut group = JsonMap::new(); for k in ["relativeTransform", "absoluteBoundingBox", "constraints", "visible", "locked"] { - if let Some(v) = node.get(k) { + if let Some(v) = inner.get(k) { group.insert(k.into(), v.clone()); } } group.insert("type".into(), json!("GROUP")); - group.insert("id".into(), json!(format!("{id}-fade"))); - group.insert("name".into(), node.get("name").cloned().unwrap_or_else(|| json!("Fade"))); + group.insert("id".into(), json!(id)); + group.insert("name".into(), inner.get("name").cloned().unwrap_or_else(|| json!("Fade"))); group.insert("size".into(), json!({"x": w, "y": h})); group.insert("absoluteBoundingBox".into(), abs.clone()); + inner.insert("id".into(), json!(format!("{id}-faded"))); inner.insert("relativeTransform".into(), identity.clone()); inner.insert("absoluteBoundingBox".into(), abs.clone()); inner.insert("visible".into(), json!(true)); From 054d53900f9bc7a89a5e4c2c0f5ddf6de6ff9a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Thu, 22 Oct 2026 00:21:16 +0200 Subject: [PATCH 497/817] M6: Sketch import: note embedded fonts as waiting for .figcraft font support Co-Authored-By: Claude Opus 5.5 --- crates/format/src/sketch/mod.rs | 3 ++- docs/file-format-parity.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/format/src/sketch/mod.rs b/crates/format/src/sketch/mod.rs index 18332afdd..985541b16 100644 --- a/crates/format/src/sketch/mod.rs +++ b/crates/format/src/sketch/mod.rs @@ -149,7 +149,8 @@ fn import_parts( /// The note about fonts the file carries (Sketch 7x and newer can embed them, as `fontReferences` /// with `fontData`): FigCraft doesn't use fonts from inside documents, so their text shows in -/// installed fonts. +/// installed fonts. To do once `.figcraft` documents can carry fonts (loading them only for the +/// session would lose them on the first save and reopen). fn embedded_fonts(document: &Value) -> Option { let refs = document.get("fontReferences").and_then(Value::as_array)?; // A reference without font data only names a font the document uses. diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 76d7437a0..203a015e7 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -18,7 +18,7 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| | `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included; a flow that records no primary-axis sizing hugs on that axis, an instance that records no auto layout has its main's), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Since 2026-10-17 (community batches #727, #728): an instance's own identity and the cached library components a file carries, overrides applied by key and order, local text values and instance overrides over a shared text style, grid track sizes (fixed, content-sized, fill), slot content, labels of connectors saved with their drawn path (a static snapshot; the ends aren't live), skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, editable text on a path, image adjustments and images carried in the message. Budgets come from the file's own size (one value per compressed byte, 20M–128M, lower ceilings on 32-bit targets; the layer cap follows), so a 15.4 MB synthetic file with 300,000 layers opens whole; the file's bytes stay out of the command journal; an import report lists what was left out or changed once the file opens. Not read: elbowed or curved connectors without a saved path (drawn straight) and labels of connectors without a saved snapshot, table cells beyond their own layers, filled areas with their own fills, variables bound to fields the editor can't bind, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs` and the per-feature `*_tests.rs` beside them, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | -| `.sketch` (Sketch 48 and newer) | — (Figma's own Sketch import runs in its web app) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards as frames with their background, groups; Sketch 2025 and newer: frames (clipping or not) with their style, graphics, stacks as auto layout (direction, gap, alignment, padding, wrap, hug/fill sizing, items ignoring the stack), corners in the style (rounded, smooth with its smoothing; angled, inside square and inside arc as paths), pins and sizing, per-side borders, lists of blurs (progressive background blurs, glass), inner shadows in the shadow list, tints (a graphic's, group's or instance's fill colouring its layers, and colour overrides), text colour and visibility overrides, text sized by its sizing; rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients with Sketch's geometry, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (an outline mask that shows its own style draws a copy under itself, as Sketch does; alpha masks only mask; broken mask chains wrapped), progressive opacity (Fade) as an alpha mask of its gradient; text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts found by their PostScript names among the installed ones (else the family read from the name), variable font axes, Sketch's natural line (ascent and descent rounded, no line gap, a fifth more for classic Mac fonts) for text without a fixed line height; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), laid out for their size the way Sketch does it (proportional sharing per pins from format 110, scaling before) and still live; master backgrounds in instances only where Sketch shows them; Apple's system fonts found under the names designs use, with the platform's tracking kept as letter spacing; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids (hidden, as Sketch shows them only in its layout view). Instances of a stack laid out at their size and texts an override changed measured again on open. Warnings: noise fills, motion and zoom blurs (drawn as plain blurs), fonts embedded with their data (not used), Smart Layout (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (70,000 layers open in ~3 s, debug build); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (0.8% on average) (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 70 in at most 4.4%, a Sketch 64 file's 65 artboards 2.1% on average, a Sketch 2026 showcase file's 16 frames 0.9% on average (at most 1.9%) | 5–10 (Smart Layout as auto layout, motion and zoom blurs, several borders of different widths) | +| `.sketch` (Sketch 48 and newer) | — (Figma's own Sketch import runs in its web app) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards as frames with their background, groups; Sketch 2025 and newer: frames (clipping or not) with their style, graphics, stacks as auto layout (direction, gap, alignment, padding, wrap, hug/fill sizing, items ignoring the stack), corners in the style (rounded, smooth with its smoothing; angled, inside square and inside arc as paths), pins and sizing, per-side borders, lists of blurs (progressive background blurs, glass), inner shadows in the shadow list, tints (a graphic's, group's or instance's fill colouring its layers, and colour overrides), text colour and visibility overrides, text sized by its sizing; rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients with Sketch's geometry, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (an outline mask that shows its own style draws a copy under itself, as Sketch does; alpha masks only mask; broken mask chains wrapped), progressive opacity (Fade) as an alpha mask of its gradient; text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts found by their PostScript names among the installed ones (else the family read from the name), variable font axes, Sketch's natural line (ascent and descent rounded, no line gap, a fifth more for classic Mac fonts) for text without a fixed line height; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), laid out for their size the way Sketch does it (proportional sharing per pins from format 110, scaling before) and still live; master backgrounds in instances only where Sketch shows them; Apple's system fonts found under the names designs use, with the platform's tracking kept as letter spacing; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids (hidden, as Sketch shows them only in its layout view). Instances of a stack laid out at their size and texts an override changed measured again on open. Warnings: noise fills, motion and zoom blurs (drawn as plain blurs), fonts embedded with their data (not used), Smart Layout (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (70,000 layers open in ~3 s, debug build); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (0.8% on average) (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 70 in at most 4.4%, a Sketch 64 file's 65 artboards 2.1% on average, a Sketch 2026 showcase file's 16 frames 0.9% on average (at most 1.9%) | 5–10 (Smart Layout as auto layout, motion and zoom blurs, several borders of different widths; fonts embedded in the file once `.figcraft` documents can carry fonts: until then they would only last the session) | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | | REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout (sizing modes left out read as hug, as documented; grid track sizes from `gridColumnsSizing` / `gridRowsSizing`: px, fr, auto, `minmax(0, 1fr)`, `repeat()`), constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, slots (`SLOT` layers bound to their slot property; an instance's slot keeps its content as the instance's own unless its property value is the main's default content; slot limits and preferred components are warnings), styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings, image adjustments (the same tint sign as `.fig`); the import report after opening; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | From 03c53243051723466b1eb34b8e6a72330a52f5c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Thu, 22 Oct 2026 00:22:34 +0200 Subject: [PATCH 498/817] M6: Sketch import: count it in the parity assessment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Figma imports Sketch files from its file browser (desktop app too); the area table hadn't listed it. Import/export breadth 86% → 87%, file formats 60% → 61%; headline numbers unchanged after rounding. Co-Authored-By: Claude Opus 5.5 --- docs/file-format-parity.md | 2 +- docs/target-app-parity.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 203a015e7..11867d881 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -18,7 +18,7 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| | `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included; a flow that records no primary-axis sizing hugs on that axis, an instance that records no auto layout has its main's), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Since 2026-10-17 (community batches #727, #728): an instance's own identity and the cached library components a file carries, overrides applied by key and order, local text values and instance overrides over a shared text style, grid track sizes (fixed, content-sized, fill), slot content, labels of connectors saved with their drawn path (a static snapshot; the ends aren't live), skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, editable text on a path, image adjustments and images carried in the message. Budgets come from the file's own size (one value per compressed byte, 20M–128M, lower ceilings on 32-bit targets; the layer cap follows), so a 15.4 MB synthetic file with 300,000 layers opens whole; the file's bytes stay out of the command journal; an import report lists what was left out or changed once the file opens. Not read: elbowed or curved connectors without a saved path (drawn straight) and labels of connectors without a saved snapshot, table cells beyond their own layers, filled areas with their own fills, variables bound to fields the editor can't bind, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs` and the per-feature `*_tests.rs` beside them, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | -| `.sketch` (Sketch 48 and newer) | — (Figma's own Sketch import runs in its web app) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards as frames with their background, groups; Sketch 2025 and newer: frames (clipping or not) with their style, graphics, stacks as auto layout (direction, gap, alignment, padding, wrap, hug/fill sizing, items ignoring the stack), corners in the style (rounded, smooth with its smoothing; angled, inside square and inside arc as paths), pins and sizing, per-side borders, lists of blurs (progressive background blurs, glass), inner shadows in the shadow list, tints (a graphic's, group's or instance's fill colouring its layers, and colour overrides), text colour and visibility overrides, text sized by its sizing; rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients with Sketch's geometry, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (an outline mask that shows its own style draws a copy under itself, as Sketch does; alpha masks only mask; broken mask chains wrapped), progressive opacity (Fade) as an alpha mask of its gradient; text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts found by their PostScript names among the installed ones (else the family read from the name), variable font axes, Sketch's natural line (ascent and descent rounded, no line gap, a fifth more for classic Mac fonts) for text without a fixed line height; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), laid out for their size the way Sketch does it (proportional sharing per pins from format 110, scaling before) and still live; master backgrounds in instances only where Sketch shows them; Apple's system fonts found under the names designs use, with the platform's tracking kept as letter spacing; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids (hidden, as Sketch shows them only in its layout view). Instances of a stack laid out at their size and texts an override changed measured again on open. Warnings: noise fills, motion and zoom blurs (drawn as plain blurs), fonts embedded with their data (not used), Smart Layout (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (70,000 layers open in ~3 s, debug build); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (0.8% on average) (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 70 in at most 4.4%, a Sketch 64 file's 65 artboards 2.1% on average, a Sketch 2026 showcase file's 16 frames 0.9% on average (at most 1.9%) | 5–10 (Smart Layout as auto layout, motion and zoom blurs, several borders of different widths; fonts embedded in the file once `.figcraft` documents can carry fonts: until then they would only last the session) | +| `.sketch` (Sketch 48 and newer) | import (file browser ▸ Import or drop, desktop app too; converted to a Figma file, symbols as components; per the help center) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards as frames with their background, groups; Sketch 2025 and newer: frames (clipping or not) with their style, graphics, stacks as auto layout (direction, gap, alignment, padding, wrap, hug/fill sizing, items ignoring the stack), corners in the style (rounded, smooth with its smoothing; angled, inside square and inside arc as paths), pins and sizing, per-side borders, lists of blurs (progressive background blurs, glass), inner shadows in the shadow list, tints (a graphic's, group's or instance's fill colouring its layers, and colour overrides), text colour and visibility overrides, text sized by its sizing; rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients with Sketch's geometry, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (an outline mask that shows its own style draws a copy under itself, as Sketch does; alpha masks only mask; broken mask chains wrapped), progressive opacity (Fade) as an alpha mask of its gradient; text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts found by their PostScript names among the installed ones (else the family read from the name), variable font axes, Sketch's natural line (ascent and descent rounded, no line gap, a fifth more for classic Mac fonts) for text without a fixed line height; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), laid out for their size the way Sketch does it (proportional sharing per pins from format 110, scaling before) and still live; master backgrounds in instances only where Sketch shows them; Apple's system fonts found under the names designs use, with the platform's tracking kept as letter spacing; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids (hidden, as Sketch shows them only in its layout view). Instances of a stack laid out at their size and texts an override changed measured again on open. Warnings: noise fills, motion and zoom blurs (drawn as plain blurs), fonts embedded with their data (not used), Smart Layout (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (70,000 layers open in ~3 s, debug build); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (0.8% on average) (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 70 in at most 4.4%, a Sketch 64 file's 65 artboards 2.1% on average, a Sketch 2026 showcase file's 16 frames 0.9% on average (at most 1.9%) | 5–10 (Smart Layout as auto layout, motion and zoom blurs, several borders of different widths; fonts embedded in the file once `.figcraft` documents can carry fonts: until then they would only last the session) | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | | REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout (sizing modes left out read as hug, as documented; grid track sizes from `gridColumnsSizing` / `gridRowsSizing`: px, fr, auto, `minmax(0, 1fr)`, `repeat()`), constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, slots (`SLOT` layers bound to their slot property; an instance's slot keeps its content as the instance's own unless its property value is the main's default content; slot limits and preferred components are warnings), styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings, image adjustments (the same tint sign as `.fig`); the import report after opening; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 6ab02ade1..8bc953f07 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # FigCraft parity with Figma -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-21 · **Change:** minor (`.sketch` import, best effort, numbers unchanged; 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); 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) · **Target:** Figma Design (desktop app 126.10.7, macOS) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-21 · **Change:** minor (`.sketch` import, best effort: import/export breadth 86% → 87%, file formats 60% → 61%, headline numbers unchanged; 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); 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) · **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 @@ -107,7 +107,7 @@ Breadth: does it exist. Ready: depth, correctness and fidelity for real projects | 11 | Components & variants | 9 | 96% | 72% | Real (not synthetic) libraries, `.fig` libraries (a component playground for variant, boolean and text properties, a behaviour suite from the documentation, overrides of padding, gap, grids, exports and interactions, refused geometry overrides, variant-switch and Assets-swap override rules, top-left default variant landed) ([components-parity](components-parity.md)) | 4–9 | | 12 | Styles & variables | 5 | 95% | 76% | Real-library QA (variables inside styles, behaviour suite from the documentation, style folders and order, mode order, code syntax, extended collections with their tail (new library variables as updates, chains through libraries) and variables import/export landed) ([components-parity](components-parity.md)) | 2–4 | | 13 | Prototyping | 6 | 92% | 74% | Video triggers and media actions, controllers on macOS, Linux and FreeBSD, real prototype QA (behaviour suite from the documentation, delays on mouse triggers, manual overlay offsets, key combinations, controller buttons on key/gamepad triggers (Windows and the browser), widgets reacting in prototypes, interactive components playing their variants, drag-driven animations, physical springs landed) ([prototyping-parity](prototyping-parity.md)) | 2–5 | -| 14 | Import/export | 6 | 86% | 58% | `.fig` import's tail (best-effort import, editable vector networks, stand-ins for non-design layers and variable prototype actions landed, then (2026-10-17) grid tracks, slots, labels of connectors saved with their path, per-point joins, text on a path, image adjustments, budgets for large files, an import report and paste from another design app; all on synthetic files, no real-file checks yet), checking the rest of the experimental `.fig` export (landed; written files open and draw in other software) on effects, images, prototypes and real files, HEIC/video import, CMYK output intent ([file-format-parity](file-format-parity.md)) | 5–10 | +| 14 | Import/export | 6 | 87% | 58% | `.fig` import's tail (best-effort import, editable vector networks, stand-ins for non-design layers and variable prototype actions landed, then (2026-10-17) grid tracks, slots, labels of connectors saved with their path, per-point joins, text on a path, image adjustments, budgets for large files, an import report and paste from another design app; all on synthetic files, no real-file checks yet), checking the rest of the experimental `.fig` export (landed; written files open and draw in other software) on effects, images, prototypes and real files, HEIC/video import, CMYK output intent ([file-format-parity](file-format-parity.md)) | 5–10 | | 15 | Dev Mode / inspect | 2 | 96% | 72% | Import lines for connected instances inside generated layer trees; an editor extension is left to the MCP server (inspect behaviour suite with colour formats, rem and icon and image assets, code connect, plugins in Dev Mode and dev resources links landed) ([dev-mode-parity](dev-mode-parity.md)) | 0–1 | | 16 | Comments, versions, find, misc | 3 | 87% | 63% | Comments are local only; comparing two versions; branches in live sessions; text runs and other lists besides fills, strokes and effects merge whole (branches with review and merge, their own version history and per-item list merges, and a comments and version history behaviour suite from the documentation landed) | 1–3 | | 17 | Multiplayer & sharing | 8 | 17% | 5% | Core landed (`crates/collab`: ids, change sets, server ordering, convergence tested); live sessions (preview): WebSocket transport, hosting from the desktop app, joining from the app or the browser, invite links that open the app, cursors, selections and follow, cursor chat and spotlight, per-person undo, offline resume; a self-hosted `figcraft-server` with persistence and share links to edit or view, which can be open to the public (owner tokens, limits per address, expiry, moderation). Left: accounts and teams, audio ([collaboration-parity](collaboration-parity.md)) | 42–84 | @@ -124,7 +124,7 @@ Breadth: does it exist. Ready: depth, correctness and fidelity for real projects |---|---|---|---|---|---| | Features (depth) | 35 | 63% | 28–67 (areas 1–13, 15, 16, 20) | The table above; core editor ~72% | this file | | UI/UX fidelity | 15 | 58% | 40–60 | Look & feel compared side by side with UI3 (~65% by the builders); tool-by-tool interaction (modifiers while dragging, hover states, popovers) not yet compared (a cursor for every tool and modifier, number fields and panel widths built from the documentation, not compared); accessibility names and keyboard navigation landed | [ui-parity](ui-parity.md) | -| File formats | 12 | 60% | 5–10 | `.sketch` read (Sketch 48 and newer, best effort; 2026-10-21): live symbols, shared styles, Sketch 2025 frames and stacks, checked on three real files against Sketch's own renders (0.8–2% of pixels differ on average); `.fig` read, best effort, with editable vector networks and (2026-10-17) more fidelity, budgets for large files and an import report (tested on generated fixtures, not real files); layers copied from another design app paste the same way (tested only with clipboard HTML made from our own export), `.fig` write experimental (round trips through our own importer; written files open and draw in other software); REST JSON import, SVG in/out, PNG/JPG/WebP/PDF export solid, with a behaviour suite from the documentation | [file-format-parity](file-format-parity.md) | +| File formats | 12 | 61% | 5–10 | `.sketch` read (Sketch 48 and newer, best effort; 2026-10-21): live symbols, shared styles, Sketch 2025 frames and stacks, checked on three real files against Sketch's own renders (0.8–2% of pixels differ on average); `.fig` read, best effort, with editable vector networks and (2026-10-17) more fidelity, budgets for large files and an import report (tested on generated fixtures, not real files); layers copied from another design app paste the same way (tested only with clipboard HTML made from our own export), `.fig` write experimental (round trips through our own importer; written files open and draw in other software); REST JSON import, SVG in/out, PNG/JPG/WebP/PDF export solid, with a behaviour suite from the documentation | [file-format-parity](file-format-parity.md) | | Collaboration | 10 | 13% | 52–104 | Local comments, version history and branches with review and merge; the multiplayer core (sync model, server ordering, client reconciliation, convergence tests) landed in #103, and live sessions (preview) co-edit a file hosted by a desktop app or kept on a self-hosted `figcraft-server` with edit and view links, joined from the app or the browser, with cursor chat and spotlight (`docs/collab-protocol.md`) | [collaboration-parity](collaboration-parity.md) | | Stability | 8 | 55% | 20–40 | Never-crash lints, command guard with rollback, recovery copies, 963 tests incl. junk-parameter sweeps and a seeded retained-render walk; but two days old, one release (v0.2.0), no field reports, QA mostly on macOS | [gaps](gaps.md) | | Performance | 6 | 60% | 30–60 | `cargo xtask bench`: 50k-layer page ~8 ms zoomed out, 10k-layer edits ~0.2 ms, 2,000-instance design system edits 4–64 ms; CPU (tiny-skia) canvas where Figma renders on the GPU; nothing timed against Figma on the same file | [hardware-parity](hardware-parity.md) | @@ -639,7 +639,7 @@ Carried over from the ROADMAP's "Shipped so far" (2026-10-10). The test count th | Date | Change | Summary | |---|---|---| | 2026-10-20 | minor | Layer data reads back (#879): `node.get` (the command, the control method and MCP `get_node`) and `document.inspect` report a layer's or page's `pluginData` as `{key: value}` when it has any, so a tool that keeps state in a file with `node.set {props: {pluginData}}` can read it on its next run (`plugin_data_tests`). Numbers unchanged | -| 2026-10-21 | minor | `.sketch` import (best effort, Sketch 48 and newer) in the file formats dimension: pages, layers, styles, live symbols with overrides, shared styles and Color Variables, prototype links, Sketch 2025 frames, stacks as auto layout and tints, text placed as Sketch places it; checked on three real files (Sketch 50, 64 and 2026) against Sketch's own renders. Numbers unchanged: Figma has no `.sketch` reader in its desktop app, so the file-exchange discounts (Figma users' files) don't move | +| 2026-10-21 | minor | `.sketch` import (best effort, Sketch 48 and newer), a feature Figma has (its file browser imports Sketch files, desktop app included, per the help center) that the area table hadn't listed: pages, layers, styles, live symbols with overrides, shared styles and Color Variables, prototype links, Sketch 2025 frames, stacks as auto layout and tints, text placed as Sketch places it; checked on three real files (Sketch 50, 64 and 2026) against Sketch's own renders. Import/export breadth 86% → 87% (ready stays 58%: best effort, three files), file formats 60% → 61%; feature breadth (~85%), ready for real work (~53%) and the audience numbers unchanged after rounding | | 2026-10-17 | minor | Menu breadth re-run with `cargo xtask parity`: 212 / 212 (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Rows for the 2026-10-17 landings: import/export (area 14) and the file formats dimension name the `.fig` import's new fidelity (instance identity, overrides by key, text style precedence, grid tracks, slots, connector labels, per-point joins, text on a path, image adjustments, list start numbers, vertical trim), budgets from the file's size, the import report, a `.fig` copy from Save as and paste from another design app; the localization evidence takes the re-measured catalog counts (2,272 entries, drafts at 95–99%, Indonesian and Czech drafts, Swedish and Turkish catalogs); the Automation line adds control requests answered while the window is minimised (#720); batch #753's Selection colors, smart-selection spacing, Present tab and auto layout on empty frames are in ui-parity, prototyping-parity and auto-layout-parity. Numbers unchanged: every `.fig` and paste change is checked on synthetic files or clipboard HTML made from our own export, and real files are what gap 1's blocker and the file-exchange discounts wait for; the UI changes (menus, the Actions palette, editor fixes) are not compared side by side, so UI/UX stays at 58%; the localization grade and hours stay (Indonesian's draft is offset by the drafts' new gaps) | | 2026-10-17 | minor | Automation roots (M8, #715, #481): `figcraft-cli mcp --automation-read-root DIR --automation-write-root DIR` (each repeatable, existing folders) and the desktop app with the same flags confine every file a command reads to the read and write roots and every file it writes to the write roots; paths are resolved (links followed, `..`, Windows `\\?\` and UNC paths, case) and compared by whole folder names, anything else is an ordinary error. The engine reaches the file system through one module (enforced by `crates/engine/clippy.toml`), and a sweep runs every command with paths outside the roots. `--attach` refuses the flags (the app confines itself); `ui.screenshot` and `ui.render` return PNG data without a `path`, so the attached MCP server writes no temporary files. Numbers unchanged. | | 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | From cb7966556ccc54cd47caaaacced815c8b275b885 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 21 Oct 2026 19:36:11 -0400 Subject: [PATCH 499/817] security: enforce HTTPS on curl downloads (SonarCloud S6506) (#1016) Add --proto '=https' to curl invocations so redirects cannot downgrade to plaintext HTTP. Resolves SonarCloud S6506 (shell/docker/githubactions). --- packaging/linux/package.sh | 2 +- packaging/server/install.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packaging/linux/package.sh b/packaging/linux/package.sh index 20da2f764..d38dc0bcf 100755 --- a/packaging/linux/package.sh +++ b/packaging/linux/package.sh @@ -121,7 +121,7 @@ if has appimage; then if [ -z "$TOOL" ]; then TOOL="$CARGO_TARGET_DIR/appimagetool-$ARCH.AppImage" if [ ! -x "$TOOL" ]; then - curl -fsSL -o "$TOOL" "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$ARCH.AppImage" + curl --proto '=https' -fsSL -o "$TOOL" "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$ARCH.AppImage" chmod +x "$TOOL" fi fi diff --git a/packaging/server/install.sh b/packaging/server/install.sh index 11c489a32..826c2bb4d 100755 --- a/packaging/server/install.sh +++ b/packaging/server/install.sh @@ -147,7 +147,7 @@ FILES="$HERE" # where the units and the Caddyfile come from from_release() { # download and check the release archive; sets NEW_BIN and FILES local version="$VERSION" name dir if [ -z "$version" ]; then - version="$(curl -fsSL "https://api.github.com/repos/$REPO/releases/latest" | sed -n 's/.*"tag_name": *"v\([^"]*\)".*/\1/p' | head -n 1)" || return 1 + version="$(curl --proto '=https' -fsSL "https://api.github.com/repos/$REPO/releases/latest" | sed -n 's/.*"tag_name": *"v\([^"]*\)".*/\1/p' | head -n 1)" || return 1 [ -n "$version" ] || return 1 fi name="figcraft-server-$version-linux-$ARCH" @@ -155,8 +155,8 @@ from_release() { # download and check the release archive; sets NEW_BIN and FILE rm -rf "$dir" mkdir -p "$dir" say "Downloading $name" - curl -fsSL -o "$dir/$name.tar.gz" "https://github.com/$REPO/releases/download/v$version/$name.tar.gz" || return 1 - curl -fsSL -o "$dir/SHA256SUMS.txt" "https://github.com/$REPO/releases/download/v$version/SHA256SUMS.txt" || return 1 + curl --proto '=https' -fsSL -o "$dir/$name.tar.gz" "https://github.com/$REPO/releases/download/v$version/$name.tar.gz" || return 1 + curl --proto '=https' -fsSL -o "$dir/SHA256SUMS.txt" "https://github.com/$REPO/releases/download/v$version/SHA256SUMS.txt" || return 1 (cd "$dir" && grep " $name.tar.gz\$" SHA256SUMS.txt | sha256sum -c --quiet -) || die "the download doesn't match SHA256SUMS.txt" tar -C "$dir" -xzf "$dir/$name.tar.gz" NEW_BIN="$dir/$name/figcraft-server" From a86897dc919b8ae7fb0142fe7e0034c10715f7d9 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 21 Oct 2026 19:36:23 -0400 Subject: [PATCH 500/817] ci: pin GitHub Actions to full commit SHA (SonarCloud githubactions:S7637) (#1015) Pin third-party actions to full-length commit SHAs (with version comments) instead of mutable tags/branches to prevent supply-chain tampering via retagged releases. Resolves SonarCloud rule githubactions:S7637. --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9700a8e91..3dfa31d9b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,12 +42,12 @@ jobs: libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev \ libgl1-mesa-dev libgtk-3-dev - - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable with: components: clippy, rustfmt # Only main saves caches; PRs restore main's, so PR caches don't evict main's. - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: save-if: ${{ github.ref == 'refs/heads/main' }} cache-on-failure: true @@ -75,10 +75,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable with: targets: wasm32-unknown-unknown - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: key: wasm32 save-if: ${{ github.ref == 'refs/heads/main' }} From 3d41302f2359dc900efe723e68da474d3685f6be Mon Sep 17 00:00:00 2001 From: vxMacDev <77440838+vxMacDev@users.noreply.github.com> Date: Wed, 21 Oct 2026 19:47:01 -0500 Subject: [PATCH 501/817] =?UTF-8?q?fix(engine):=20show=20the=20Pen's=20Shi?= =?UTF-8?q?ft=2045=C2=B0=20step=20in=20its=20preview=20line=20(#970)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A Shift-click with the Pen already put the next point at a 45° step from the last one, but the line drawn to the pointer while moving ignored Shift and followed the pointer, so holding Shift looked like it did nothing. The line now ends where the click will put the point. Both use one helper, at_45_degrees. --- crates/engine/src/pen_overlay_tests.rs | 21 +++++++++++++++++++++ crates/engine/src/tools.rs | 13 ++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/pen_overlay_tests.rs b/crates/engine/src/pen_overlay_tests.rs index 7e0064d2b..7f6dba3c5 100644 --- a/crates/engine/src/pen_overlay_tests.rs +++ b/crates/engine/src/pen_overlay_tests.rs @@ -63,3 +63,24 @@ fn finishing_the_path_clears_its_handles_and_band() { let ov = &s.tool.overlay; assert!(ov.pen.is_empty() && ov.pen_handles.is_empty() && ov.rubber.is_none() && ov.rubber_handle.is_none()); } + +#[test] +fn shift_keeps_the_band_and_the_next_point_at_45_degree_steps() { + // #970: with Shift the band shows where the point will land, at a 45° step from the last + // anchor (the same length as the pointer is away), not under the pointer. + let mut s = Session::new(); + s.set_tool(ToolId::Pen); + at(&mut s, PointerKind::Down, 100.0, 100.0); + at(&mut s, PointerKind::Up, 100.0, 100.0); + let shifted = |kind, x, y| PointerEvent { shift: true, ..PointerEvent::at(kind, x, y, 1.0) }; + s.pointer(&shifted(PointerKind::Hover, 300.0, 120.0)).unwrap(); + let [x0, y0, x1, y1] = s.tool.overlay.rubber.unwrap(); + assert_eq!([x0, y0, y1], [100.0, 100.0, 100.0], "level with the last anchor"); + assert!((x1 - (100.0 + 200f64.hypot(20.0))).abs() < 1e-9, "{x1}"); + s.pointer(&shifted(PointerKind::Down, 300.0, 120.0)).unwrap(); + s.pointer(&shifted(PointerKind::Up, 300.0, 120.0)).unwrap(); + s.pointer(&shifted(PointerKind::Hover, 400.0, 230.0)).unwrap(); + let [x0, y0, x1, y1] = s.tool.overlay.rubber.unwrap(); + assert_eq!(y0, 100.0, "the point landed on the band"); + assert!((x1 - x0 - (y1 - y0)).abs() < 1e-9, "45° down to the right: {:?}", [x0, y0, x1, y1]); +} diff --git a/crates/engine/src/tools.rs b/crates/engine/src/tools.rs index f0115e1f5..d8fd43e78 100644 --- a/crates/engine/src/tools.rs +++ b/crates/engine/src/tools.rs @@ -413,6 +413,13 @@ pub(crate) enum Gesture { }, } +/// Where Shift puts the Pen's next point: as far from `last` as `p` is, at the nearest 45° step. +fn at_45_degrees(last: Point, p: Point) -> Point { + let v = p - last; + let ang = (v.atan2() / (std::f64::consts::PI / 4.0)).round() * std::f64::consts::PI / 4.0; + last + Vec2::from_angle(ang) * v.hypot() +} + /// The handles a pen path shows while it is drawn ([`Overlay::pen_handles`]): the last anchor's in /// and out handles and the one before's out handle, those that aren't zero. fn pen_handles(points: &[(Point, Vec2, Vec2)]) -> Vec<[f64; 4]> { @@ -1085,6 +1092,8 @@ impl Session { guides = g; self.tool.overlay.cursor = Cursor::Pen(self.pen_cursor(&doc, &sel, to, ev.zoom)); if let Some((last, _, out)) = self.tool.pen.as_ref().and_then(|pen| pen.points.last()) { + // With Shift the band ends where a click puts the point (#970). + let to = if ev.shift { at_45_degrees(*last, to) } else { to }; self.tool.overlay.rubber = Some([last.x, last.y, to.x, to.y]); self.tool.overlay.rubber_handle = (out.hypot() > 0.0).then_some([last.x + out.x, last.y + out.y]); } @@ -2094,9 +2103,7 @@ impl Session { if ev.shift && let Some((last, _, _)) = pen.points.last() { - let v = p - *last; - let ang = (v.atan2() / (std::f64::consts::PI / 4.0)).round() * std::f64::consts::PI / 4.0; - p = *last + Vec2::from_angle(ang) * v.hypot(); + p = at_45_degrees(*last, p); } pen.points.push((p, Vec2::ZERO, Vec2::ZERO)); self.tool.gesture = Gesture::PenDrag { anchor: p }; From fa53463dddf01cf63654086cf4c6dd8aee47db7d Mon Sep 17 00:00:00 2001 From: Nicek Date: Thu, 22 Oct 2026 11:01:42 +0800 Subject: [PATCH 502/817] =?UTF-8?q?feat:=20=E4=B8=BA=E7=9F=A2=E9=87=8F?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=B7=BB=E5=8A=A0=E7=BA=BF=E6=AE=B5=E4=B8=AD?= =?UTF-8?q?=E7=82=B9=E6=B7=BB=E5=8A=A0=E7=82=B9=E7=9A=84=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E5=92=8C=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/engine/src/cursor_tests.rs | 3 +- crates/engine/src/tools.rs | 13 ++++ crates/engine/src/vector_behaviour_tests.rs | 4 +- crates/engine/src/vectoredit/pointer.rs | 36 ++++++++++- crates/engine/src/vectoredit/tests.rs | 66 ++++++++++++++++++++- crates/ui-egui/src/canvas.rs | 26 ++++++-- 6 files changed, 139 insertions(+), 9 deletions(-) diff --git a/crates/engine/src/cursor_tests.rs b/crates/engine/src/cursor_tests.rs index 7a9e06216..8d8f245e4 100644 --- a/crates/engine/src/cursor_tests.rs +++ b/crates/engine/src/cursor_tests.rs @@ -270,13 +270,14 @@ fn vector_edit_mode_shows_each_tool_and_modifier() { let mut s = Session::new(); let path = id(&ex(&mut s, "vector.create", json!({"points": [[100, 100], [300, 100], [300, 300]], "closed": false}))); ex(&mut s, "vector.edit.begin", json!({"id": path})); - let (point, segment, empty) = ((300.0, 100.0), (200.0, 100.0), (200.0, 250.0)); + let (point, segment, midpoint, empty) = ((300.0, 100.0), (150.0, 100.0), (200.0, 100.0), (200.0, 250.0)); use Cursor::*; // (vector tool, modifiers, where, cursor, why) type Row = (&'static str, Mods, (f64, f64), Cursor, &'static str); let rows: Vec = vec![ ("move", NONE, point, Default, "the arrow over a point"), ("move", NONE, segment, Default, "the arrow over a segment"), + ("move", NONE, midpoint, Pen(PenCursor::Add), "the arrow over a segment's midpoint: adds a point there"), ("move", NONE, empty, Default, "the arrow elsewhere"), ("move", ALT, segment, Pen(PenCursor::Add), "Alt over a segment adds a point there"), ("move", ALT, point, Default, "Alt over a point adds nothing"), diff --git a/crates/engine/src/tools.rs b/crates/engine/src/tools.rs index 187e28d41..e35b054ea 100644 --- a/crates/engine/src/tools.rs +++ b/crates/engine/src/tools.rs @@ -285,6 +285,9 @@ pub struct Overlay { pub vector_hover: Option, /// The edited layer `vector_hover` is on (several layers can be in edit mode). pub vector_hover_on: Option, + /// Vector edit mode: the point a press on the outline would add (the pen's ghost anchor where + /// it is over a segment, or the midpoint of the segment under the Move tool). + pub vector_add: Option, /// Vector edit mode, Variable width tool: the width point, handle or path under the pointer. pub width_hover: Option, pub lasso: Vec<[f64; 2]>, @@ -309,6 +312,16 @@ pub struct Overlay { pub shape: Option, } +/// A point a press would add to the edited vector's outline: page position, whether it is a +/// segment's midpoint (the Move tool) rather than the pen's place on its segment, and whether the +/// pointer is on it (a press adds it; otherwise it just shows where one would go). +#[derive(Clone, Copy, Debug, PartialEq, Serialize)] +pub struct VectorAdd { + pub at: [f64; 2], + pub midpoint: bool, + pub on: bool, +} + /// The Scale tool's live readout while dragging a handle. #[derive(Clone, Copy, Debug, PartialEq, Serialize)] pub struct ScaleHint { diff --git a/crates/engine/src/vector_behaviour_tests.rs b/crates/engine/src/vector_behaviour_tests.rs index fb734085b..230d29981 100644 --- a/crates/engine/src/vector_behaviour_tests.rs +++ b/crates/engine/src/vector_behaviour_tests.rs @@ -236,7 +236,7 @@ fn selecting_points_and_segments() { match what { "click tl" => click(&mut s, (0.0, 0.0), m), "click tr" => click(&mut s, (100.0, 0.0), m), - "click top" => click(&mut s, (50.0, 0.0), m), + "click top" => click(&mut s, (30.0, 0.0), m), "marquee top" => drag(&mut s, (-20.0, -20.0), (110.0, 10.0), m), _ => { ex(&mut s, "vector.edit.tool", json!({"tool": "lasso"})); @@ -310,7 +310,7 @@ fn deleting_points_vs_delete_and_heal() { // Deleting a selected segment keeps its points when others use them. let mut s = Session::new(); let id = square(&mut s, true); - click(&mut s, (50.0, 0.0), NONE); + click(&mut s, (30.0, 0.0), NONE); key(&mut s, "Delete", false); let n = net(&s, id); assert_eq!((n.vertices.len(), n.segments.len()), (4, 3), "deleting a segment leaves its points"); diff --git a/crates/engine/src/vectoredit/pointer.rs b/crates/engine/src/vectoredit/pointer.rs index 6667a2096..1684bf260 100644 --- a/crates/engine/src/vectoredit/pointer.rs +++ b/crates/engine/src/vectoredit/pointer.rs @@ -114,6 +114,16 @@ pub(crate) struct PointSnap { /// Eraser brush radius in screen pixels. const ERASER_PX: f64 = 8.0; +/// A segment's midpoint is a point a press adds when the pointer is this close (screen pixels). +const MIDPOINT_PX: f64 = 6.0; + +/// The page point at `t` (0..1) along segment `seg` of vector `id`. +fn segment_point(doc: &Document, id: NodeId, seg: usize, t: f64) -> Option { + use figcraft_geom::kurbo::ParamCurve; + let c = network(doc, id)?.cubic(seg)?; + Some(doc.world_transform(id) * c.eval(t.clamp(0.0, 1.0))) +} + fn erase_all(net: &mut VectorNetwork, stamps: &[Point], radius: f64) -> bool { stamps.iter().fold(false, |acc, c| ops::erase(net, *c, radius) | acc) } @@ -337,9 +347,22 @@ impl Session { let shown = if width_tool { None } else { h.map(|h| (ve.id, h)).or_else(|| hit_any(&doc, ve, ev.p(), tol)) }; // A pen click on empty canvas lands where it snaps. let pen_at = if ve.tool == VTool::Pen && h.is_none() && !ev.shift { Some(self.snap_pen(ev, Some(ve.id), &[])?) } else { None }; + // A point a press on the outline would add: the pen's place under its pointer on a segment + // (its ghost anchor), or the midpoint of the segment under the Move tool. + let add = match (ve.tool, h) { + (VTool::Pen, Some(VHit::Segment { seg, t })) => { + segment_point(&doc, ve.id, seg, t).map(|at| crate::tools::VectorAdd { at: [at.x, at.y], midpoint: false, on: true }) + } + (VTool::Move, Some(VHit::Segment { seg, .. })) if !ev.cmd && !ev.alt => segment_point(&doc, ve.id, seg, 0.5).map(|at| { + let on = (at - ev.p()).hypot() * ev.zoom.max(1e-6) <= MIDPOINT_PX; + crate::tools::VectorAdd { at: [at.x, at.y], midpoint: true, on } + }), + _ => None, + }; let ov = &mut self.tool.overlay; ov.vector_hover = shown.map(|x| x.1); ov.vector_hover_on = shown.map(|x| x.0); + ov.vector_add = add; ov.width_hover = None; ov.face.clear(); ov.rubber = None; @@ -351,6 +374,8 @@ impl Session { (VTool::Move, Some(_)) if ev.cmd => Cursor::Pen(PenCursor::Bend), (VTool::Move, _) if ev.cmd => Cursor::Crosshair, (VTool::Move, Some(VHit::Segment { .. })) if ev.alt => Cursor::Pen(PenCursor::Add), + // On a segment's midpoint the arrow turns into the pen: a press adds a point there. + (VTool::Move, Some(VHit::Segment { .. })) if add.is_some_and(|a| a.on) => Cursor::Pen(PenCursor::Add), (VTool::Move, _) => Cursor::Default, (VTool::Pen, Some(VHit::Vertex { .. })) => Cursor::Pen(PenCursor::Close), (VTool::Pen, Some(VHit::Segment { .. })) => Cursor::Pen(PenCursor::Add), @@ -370,11 +395,13 @@ impl Session { { self.tool.overlay.cursor = crate::tools::handle_cursor(&b.corners(), handle); self.tool.overlay.vector_hover = None; + self.tool.overlay.vector_add = None; } else if shown.is_none_or(|(on, h)| on == ve.id && !matches!(h, VHit::Handle { .. })) { region = Self::region_under(&doc, ve, h, ev); if region.is_some() { self.tool.overlay.vector_hover = None; self.tool.overlay.vector_hover_on = None; + self.tool.overlay.vector_add = None; } } } @@ -510,6 +537,7 @@ impl Session { }; let h = hit(&doc, ve, ev.p(), tol); self.tool.overlay.vector_hover = None; + self.tool.overlay.vector_add = None; self.tool.overlay.face.clear(); self.tool.overlay.guides.clear(); let tool = if ev.cmd && ve.tool == VTool::Move { VTool::Bend } else { ve.tool }; @@ -626,8 +654,14 @@ impl Session { self.vgesture(g); } Some(VHit::Segment { seg, t }) => { - if ev.alt { + // A press on the midpoint the hover showed adds a point exactly there; Alt adds + // one anywhere else on the segment. + let midpoint = !ev.alt + && !ev.shift + && segment_point(&doc, id, seg, 0.5).is_some_and(|m| (m - ev.p()).hypot() * ev.zoom.max(1e-6) <= MIDPOINT_PX); + if ev.alt || midpoint { // Add a point on the segment and drag it. + let t = if midpoint { 0.5 } else { t }; self.begin_interaction("Add point")?; let mut v = None; self.preview(|doc, _| { diff --git a/crates/engine/src/vectoredit/tests.rs b/crates/engine/src/vectoredit/tests.rs index 0eba28e3d..ff3c4cfa2 100644 --- a/crates/engine/src/vectoredit/tests.rs +++ b/crates/engine/src/vectoredit/tests.rs @@ -171,7 +171,7 @@ fn lasso_marquee_and_segment_selection() { assert!(s.tool.overlay.lasso.is_empty()); // Move tool: clicking a segment selects it; shift adds another. ex(&mut s, "vector.edit.tool", json!({"tool": "move"})); - click(&mut s, 50.0, 100.0); + click(&mut s, 30.0, 100.0); assert_eq!(ve(&s).segments.len(), 1); assert!(ve(&s).vertices.is_empty()); let mut sh = ev(PointerKind::Down, 0.0, 50.0); @@ -371,3 +371,67 @@ fn eraser_strokes_cut_paths_in_one_step() { assert!(key(&mut s, "E", true, false, false).unwrap()); assert_eq!(ve(&s).tool, VTool::Eraser); } + +#[test] +fn a_segment_shows_its_midpoint_and_a_press_adds_a_point_there() { + let mut s = Session::new(); + let id = rect(&mut s); + // Near the top edge but off its midpoint: the hint shows where the point would go, but the + // pointer is not on it, so the arrow stays. + s.pointer(&ev(PointerKind::Hover, 30.0, 0.0)).unwrap(); + let add = s.tool.overlay.vector_add.expect("the segment's midpoint"); + assert!(add.midpoint && !add.on, "{add:?}"); + assert!((add.at[0] - 50.0).abs() < 1e-9 && add.at[1].abs() < 1e-9, "{add:?}"); + assert_eq!(s.tool.overlay.cursor, crate::tools::Cursor::Default); + // On the midpoint: the pen cursor, and a press adds a point there and selects it. + s.pointer(&ev(PointerKind::Hover, 50.0, 0.0)).unwrap(); + assert!(s.tool.overlay.vector_add.is_some_and(|a| a.on), "the pointer is on the midpoint"); + assert_eq!(s.tool.overlay.cursor, crate::tools::Cursor::Pen(crate::tools::PenCursor::Add)); + click(&mut s, 50.0, 0.0); + let n = net(&s, id); + assert_eq!(n.vertices.len(), 5, "a point was added: {n:?}"); + assert_eq!(ve(&s).vertices, vec![vertex_at(&n, 50.0, 0.0)], "the new point is selected"); +} + +#[test] +fn adding_a_midpoint_keeps_new_midpoints_coming_on_each_half() { + let mut s = Session::new(); + let id = rect(&mut s); + click(&mut s, 50.0, 0.0); + assert_eq!(net(&s, id).vertices.len(), 5); + // The left half has its own midpoint, shown and added the same way. + s.pointer(&ev(PointerKind::Hover, 25.0, 0.0)).unwrap(); + let add = s.tool.overlay.vector_add.expect("the new half's midpoint"); + assert!(add.midpoint && add.on && (add.at[0] - 25.0).abs() < 1e-9, "{add:?}"); + click(&mut s, 25.0, 0.0); + let n = net(&s, id); + assert_eq!(n.vertices.len(), 6, "{n:?}"); + assert_eq!(ve(&s).vertices, vec![vertex_at(&n, 25.0, 0.0)]); + // And on it goes: a quarter of the way along. + s.pointer(&ev(PointerKind::Hover, 12.5, 0.0)).unwrap(); + let add = s.tool.overlay.vector_add.expect("another midpoint"); + assert!((add.at[0] - 12.5).abs() < 1e-9, "{add:?}"); +} + +#[test] +fn a_press_away_from_the_midpoint_selects_the_segment() { + let mut s = Session::new(); + let id = rect(&mut s); + click(&mut s, 30.0, 0.0); + assert_eq!(net(&s, id).vertices.len(), 4, "no point is added off the midpoint"); + assert_eq!(ve(&s).segments.len(), 1, "the segment is selected instead"); +} + +#[test] +fn the_pen_shows_its_ghost_anchor_on_the_segment_under_it() { + let mut s = Session::new(); + let id = rect(&mut s); + ex(&mut s, "vector.edit.tool", json!({"tool": "pen"})); + s.pointer(&ev(PointerKind::Hover, 80.0, 0.0)).unwrap(); + let add = s.tool.overlay.vector_add.expect("the ghost anchor"); + assert!(!add.midpoint && add.on, "{add:?}"); + assert!((add.at[0] - 80.0).abs() < 1e-3 && add.at[1].abs() < 1e-3, "{add:?}"); + click(&mut s, 80.0, 0.0); + assert_eq!(net(&s, id).vertices.len(), 5, "the press added the point"); + assert_eq!(ve(&s).anchor, None, "the click ended the pen's path"); +} diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 8126e6f3c..841c95e82 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -1021,10 +1021,10 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ let hover_on = |id| ov.vector_hover.filter(|_| ov.vector_hover_on.unwrap_or(ve.id) == id); for part in &ve.others { if let Some(po) = figcraft_engine::vectoredit::overlay(&doc, &ve.view(part)) { - vector_overlay(app, painter, &po, !width_tool, hover_on(part.id), false); + vector_overlay(app, painter, &po, !width_tool, hover_on(part.id), false, None); } } - vector_overlay(app, painter, &o, !width_tool, hover_on(ve.id), true); + vector_overlay(app, painter, &o, !width_tool, hover_on(ve.id), true, ov.vector_add); if width_tool { width_overlay(app, painter, &doc, &ve, zoom); } else if let Some(c) = app.session.vector_edit_box() { @@ -1327,8 +1327,9 @@ fn bezier_handle(painter: &egui::Painter, v: Pos2, e: Pos2, r: f32, fill: Color3 painter.circle_stroke(e, r, stroke(accent(painter), 1.0)); } -/// Vector edit mode: a layer's segments, handles and points (`points`) with its `hover`ed part, and -/// for the `active` layer the closed area under the paint bucket and the pen's rubber band. +/// Vector edit mode: a layer's segments, handles and points (`points`) with its `hover`ed part, the +/// `add` point a press would put on the outline, and for the `active` layer the closed area under +/// the paint bucket and the pen's rubber band. fn vector_overlay( app: &FigApp, painter: &egui::Painter, @@ -1336,6 +1337,7 @@ fn vector_overlay( points: bool, hover: Option, active: bool, + add: Option, ) { use figcraft_engine::vectoredit::VHit; let ov = &app.session.tool.overlay; @@ -1383,6 +1385,22 @@ fn vector_overlay( painter.circle_stroke(p, 7.5, stroke(accent(painter), 1.0)); } } + // The point a press would add to the outline: the pen's ghost anchor where it is over a + // segment, or a segment's midpoint under the Move tool (which grows and fills once the pointer + // is on it, when a press adds it). + if let Some(a) = add { + let p = app.to_screen(a.at[0], a.at[1]); + let col = accent(painter); + if a.midpoint { + let (r, fill) = if a.on { (5.5, col) } else { (3.5, Color32::from_white_alpha(190)) }; + painter.circle_filled(p, r, fill); + painter.circle_stroke(p, r, stroke(if a.on { Color32::WHITE } else { col.gamma_multiply(0.7) }, 1.2)); + } else { + let r = Rect::from_center_size(p, vec2(7.0, 7.0)); + painter.rect_filled(r, CornerRadius::same(5), Color32::from_white_alpha(160)); + painter.rect_stroke(r, CornerRadius::same(5), stroke(col.gamma_multiply(0.8), 1.0), StrokeKind::Inside); + } + } if let Some([x0, y0, x1, y1]) = ov.rubber.filter(|_| active) { painter.add(Shape::dashed_line(&[app.to_screen(x0, y0), app.to_screen(x1, y1)], stroke(accent(painter), 1.0), 4.0, 3.0)); } From 6bb1f3a456e8c22b9d7414631ccdfdd23b8680aa Mon Sep 17 00:00:00 2001 From: Nicek Date: Thu, 22 Oct 2026 12:03:19 +0800 Subject: [PATCH 503/817] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0=E7=9F=A2?= =?UTF-8?q?=E9=87=8F=E7=BC=96=E8=BE=91=E6=A8=A1=E5=BC=8F=E4=B8=8B=E7=9A=84?= =?UTF-8?q?=E5=89=AA=E5=88=87=E5=91=BD=E4=BB=A4=E9=80=BB=E8=BE=91=E5=B9=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在矢量编辑模式中,剪切命令会处理选中的顶点并自动修复路径,而非直接删除整个图层。新增了专门的cut函数处理该逻辑,同时添加了vector_keys_tests测试文件,覆盖了不同场景下的剪切行为,包括Windows系统的Shift+Delete映射、选中顶点时的剪切、无选中项时的剪切以及非编辑模式下的剪切。 --- crates/ui-egui/src/lib.rs | 2 + crates/ui-egui/src/shortcuts.rs | 17 +++++- crates/ui-egui/src/vector_keys_tests.rs | 70 +++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 crates/ui-egui/src/vector_keys_tests.rs diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index e24bbf244..846bfa920 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -219,6 +219,8 @@ mod variables_rename_tests; #[cfg(test)] mod variants_discovery_tests; #[cfg(test)] +mod vector_keys_tests; +#[cfg(test)] mod vector_panel_tests; #[cfg(test)] mod vector_tail_ui_tests; diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index c86cfdf16..30267cc78 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -125,7 +125,7 @@ pub fn handle(app: &mut FigApp, ctx: &Context, typing: bool, swallowed: Swallowe for ev in &events { match ev { Event::Copy => crate::menus::invoke(app, "edit.copy"), - Event::Cut => crate::menus::invoke(app, "edit.cut"), + Event::Cut => cut(app), Event::Paste(text) if !swallowed.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) => @@ -137,6 +137,21 @@ pub fn handle(app: &mut FigApp, ctx: &Context, typing: bool, swallowed: Swallowe } } +/// 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) { + let Some(ve) = app.session.ds().ok().and_then(|d| d.vector_edit.clone()) else { + crate::menus::invoke(app, "edit.cut"); + return; + }; + if !ve.vertices.is_empty() { + app.run("vector.deleteHeal", json!({})); + } else if !ve.segments.is_empty() { + app.run("vector.edit.delete", json!({})); + } +} + /// The command Cmd/Ctrl+V runs with `m` held too: `edit.paste`, `edit.pasteOver` (Shift), /// `edit.pasteProperties` (Alt), or `None` for a chord nothing is bound to. The keymap decides, /// whether the key press arrived (browser) or only a paste event and the release (desktop). diff --git a/crates/ui-egui/src/vector_keys_tests.rs b/crates/ui-egui/src/vector_keys_tests.rs new file mode 100644 index 000000000..eb99742a1 --- /dev/null +++ b/crates/ui-egui/src/vector_keys_tests.rs @@ -0,0 +1,70 @@ +//! Keys in vector edit mode that the window's key handling twists: Windows sends Shift+Delete +//! (delete the points and heal the path) as a cut command and no key at all, so the canvas must +//! heal the selected points rather than cut the layer. + +use egui::{Event, Modifiers}; +use figcraft_doc::NodeId; +use figcraft_engine::Session; +use serde_json::json; + +use crate::layers_drag_tests::Ui; + +fn id(v: serde_json::Value) -> NodeId { + NodeId(v["id"].as_u64().unwrap()) +} + +fn net(u: &Ui, path: NodeId) -> figcraft_doc::VectorNetwork { + let doc = u.app.session.doc().unwrap(); + figcraft_engine::vectoredit::network(doc, path).unwrap().clone() +} + +/// A three-point open path A-B-C in edit mode, B selected. +fn abc(u: &mut Ui) -> NodeId { + let path = id(u.app.session.execute("vector.create", &json!({"points": [[100, 100], [200, 100], [300, 100]], "closed": false})).unwrap()); + u.app.session.execute("vector.edit.begin", &json!({"id": path})).unwrap(); + u.app.session.execute("vector.edit.select", &json!({"vertices": [1]})).unwrap(); + path +} + +#[test] +fn shift_delete_in_vector_edit_mode_heals_the_point_instead_of_cutting_the_layer() { + let mut u = Ui::new(Session::new()); + let path = abc(&mut u); + // Windows: egui-winit turns Shift+Delete into a cut command, with no key event. + u.frame_with(vec![Event::Cut], Modifiers::SHIFT); + assert!(u.app.session.doc().unwrap().node(path).is_some(), "the layer stays"); + let n = net(&u, path); + assert_eq!(n.vertices.len(), 2, "the point is gone: {n:?}"); + assert_eq!(n.segments.len(), 1, "A and C are joined"); + let (a, b) = (n.vertices.first().map(|v| v.x).unwrap_or_default(), n.vertices.get(1).map(|v| v.x).unwrap_or_default()); + assert!(b - a == 200.0 && n.vertices.iter().all(|v| v.y == 0.0), "it runs straight from A to C: {n:?}"); +} + +#[test] +fn a_cut_command_in_edit_mode_takes_the_selected_points_not_the_layer() { + let mut u = Ui::new(Session::new()); + let path = abc(&mut u); + u.frame_with(vec![Event::Cut], Modifiers::COMMAND); + assert!(u.app.session.doc().unwrap().node(path).is_some(), "Ctrl+X on points keeps the layer"); + assert_eq!(net(&u, path).vertices.len(), 2, "it takes the selected point"); +} + +#[test] +fn a_cut_command_in_edit_mode_with_nothing_selected_keeps_the_layer() { + let mut u = Ui::new(Session::new()); + let path = abc(&mut u); + u.app.session.execute("vector.edit.select", &json!({"vertices": []})).unwrap(); + u.frame_with(vec![Event::Cut], Modifiers::SHIFT); + assert!(u.app.session.doc().unwrap().node(path).is_some(), "nothing selected: nothing goes"); + assert_eq!(net(&u, path).vertices.len(), 3); +} + +#[test] +fn a_cut_command_outside_edit_mode_cuts_the_layer() { + let mut s = Session::new(); + let path = id(s.execute("vector.create", &json!({"points": [[100, 100], [200, 100], [300, 100]], "closed": false})).unwrap()); + s.execute("select.set", &json!({"ids": [path]})).unwrap(); + let mut u = Ui::new(s); + u.frame_with(vec![Event::Cut], Modifiers::SHIFT); + assert!(u.app.session.doc().unwrap().node(path).is_none(), "outside edit mode the selected layer is cut"); +} From e3bf9b7270336831f0193e260a8bb0fcabdcfbd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=E1=BB=91ng=20Huy=20S=C6=A1n?= Date: Thu, 22 Oct 2026 11:33:34 +0700 Subject: [PATCH 504/817] i18n: add Vietnamese (vi) interface localization --- README.md | 2 +- ROADMAP.md | 4 +- crates/engine/src/cmd/view.rs | 2 +- crates/ui-egui/locales/vi.toml | 2367 ++++++++++++++++++++++++++++++ crates/ui-egui/src/cjk.rs | 2 +- crates/ui-egui/src/i18n.rs | 4 +- crates/ui-egui/src/i18n_tests.rs | 8 +- docs/localization-parity.md | 12 +- docs/mcp.md | 2 +- docs/translating.md | 14 +- 10 files changed, 2395 insertions(+), 22 deletions(-) create mode 100644 crates/ui-egui/locales/vi.toml diff --git a/README.md b/README.md index 63bc739bf..41bca26d6 100644 --- a/README.md +++ b/README.md @@ -230,7 +230,7 @@ The desktop app also offers a loopback-only control channel (`figcraft --control - **Its own renderer:** tiny-skia on every core for the canvas and exports, with layer blending, effects and masks; booleans from linesweeper, geometry from kurbo, text from skrifa and HarfRust. - **Runs in the browser:** the whole engine and UI compile to WebAssembly. - **Accessible:** screen readers get names, roles, values and states for the tools, layer rows, fields, dropdowns, tabs and menus (AccessKit on desktop), F6 moves the keyboard between the toolbar, layers, canvas and properties (Tab within them, Escape back to the canvas), the system's reduce-motion setting is honoured, and panel text meets WCAG AA contrast in both themes. -- **Languages:** English, Russian and Turkish (reviewed by native speakers), and Spanish, French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Czech, Indonesian and Georgian drafts, picked in Preferences or taken from the system or browser and switched live; adding a language is one catalog file ([`docs/translating.md`](docs/translating.md)). +- **Languages:** English, Russian and Turkish (reviewed by native speakers), and Spanish, French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Czech, Indonesian, Georgian and Vietnamese drafts, picked in Preferences or taken from the system or browser and switched live; adding a language is one catalog file ([`docs/translating.md`](docs/translating.md)). - **Plugins:** sandboxed WebAssembly plugins (a metered, pure-Rust interpreter with a memory cap and no file or network access, in the browser too) that act through the same commands, each run one undo step, within the permissions their manifest asks for. A Rust SDK and three example plugins are in [`plugins/`](plugins); see [`docs/plugins.md`](docs/plugins.md). - **Live sessions (preview):** share the open file from the app (Share ▸ Start sharing: online through a server, or on your local network), give the others the short join code it shows (or the invite link), and edit it together: everyone's changes sync live, with cursors, selections, avatars and follow, and undo takes back only your own changes. Others join from the desktop app (invite links open it) or from the browser build. See [`docs/collab-protocol.md`](docs/collab-protocol.md). - **A server of your own (preview):** `figcraft-server` keeps a team's files, publishes them from the app (File ▸ Publish to server…, or Share ▸ Online with your server in Preferences) and hands out share links and join codes that let people edit or only view; files survive restarts and apps reconnect where they were. No accounts yet: links are the access. Releases ship it for Linux, and the desktop app joins over `wss://`; [hosting it on a rented Linux server](docs/server.md#deploy-on-a-linux-server) takes a systemd unit and Caddy or nginx (or Docker). See [`docs/server.md`](docs/server.md). diff --git a/ROADMAP.md b/ROADMAP.md index f43cd015b..b1ec92159 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -109,11 +109,11 @@ native speakers' reviews of the six language drafts need people. | Japanese | ja | 99% | draft (needs native review) | | German | de | 96% | draft (needs native review) | | Korean | ko | 95% | draft (needs native review) | -| Vietnamese | vi | 0% | none | +| Vietnamese | vi | 100% | draft (needs native review) | Percentages measured 2026-10-17 over 2,272 entries (strings added since a draft show English). Also shipped: Russian (`ru`, 99%, reviewed by VanTan), Swedish (`sv`, 99.6%, command labels since 2026-10-17; native review welcome), Turkish (`tr`, 99%) and Czech (`cs`, 99%, draft). Figma ships English, Japanese, Korean, French, German, Spanish and Portuguese (Brazil); FigCraft has the localization layer, English and Spanish (Spain and Latin America), -French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese and Indonesian drafts (Preferences ▸ +French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Vietnamese drafts (Preferences ▸ Language; Traditional Chinese has no catalog; CJK UI text uses an installed CJK font, loaded only when needed; adding a language: [`docs/translating.md`](docs/translating.md)). Document text in any script (bidi, Arabic shaping, diff --git a/crates/engine/src/cmd/view.rs b/crates/engine/src/cmd/view.rs index 0592046eb..b4ce92b9b 100644 --- a/crates/engine/src/cmd/view.rs +++ b/crates/engine/src/cmd/view.rs @@ -427,7 +427,7 @@ pub fn specs() -> Vec { spec!( "pref.language", "Interface language", - "{language: system|en|cs|ru|es|es-419|fr|de|pt-BR|ja|ka|ko|zh-Hans|…; else English}", + "{language: system|en|cs|ru|es|es-419|fr|de|pt-BR|ja|ka|ko|vi|zh-Hans|…; else English}", false, |s, p| { let lang = req_string("pref.language", p, "language")?; diff --git a/crates/ui-egui/locales/vi.toml b/crates/ui-egui/locales/vi.toml new file mode 100644 index 000000000..6493508ba --- /dev/null +++ b/crates/ui-egui/locales/vi.toml @@ -0,0 +1,2367 @@ +# FigCraft interface strings: Vietnamese. +# +# Draft — needs native review: machine-drafted from the English catalog. Brand names, keyboard +# glyphs and {placeholders} stay as they are. Vietnamese nouns do not inflect for number, so plural +# entries give only `other`. See docs/translating.md. + +[meta] +name = "Tiếng Việt" +status = "draft — needs native review" + +[ui] +"% of all commits" = "% tổng số commit" +"(no longer published)" = "(không còn được xuất bản)" +"({n} warnings: some entries were skipped)" = { other = "({n} cảnh báo: một số mục đã bị bỏ qua)" } +"+ Create variable" = "+ Tạo biến" +".fig (experimental)" = ".fig (thử nghiệm)" +"1…9, 0" = "1…9, 0" +"@{login}: {prs} PRs, {commits} commits, +{added} / −{deleted} lines (Δ {delta}), +{bin_added} / −{bin_deleted} binary assets, {first} – {last}" = "@{login}: {prs} PR, {commits} commit, +{added} / −{deleted} dòng (Δ {delta}), +{bin_added} / −{bin_deleted} tài nguyên nhị phân, {first} – {last}" +"A .figcraft file with this name already exists. Choose its full name to confirm replacement." = "Đã tồn tại tệp .figcraft có tên này. Hãy chọn tên đầy đủ của tệp để xác nhận thay thế." +"A collection of this file with these modes and variables: override their values per mode and add variables of its own" = "Một bộ sưu tập của tệp này với các chế độ và biến sau: ghi đè giá trị theo từng chế độ và thêm các biến riêng" +"A layer on its own aligns to its frame: select more layers, or one in a frame" = "Một lớp riêng lẻ sẽ căn chỉnh theo khung của nó: hãy chọn thêm lớp, hoặc chọn một lớp bên trong khung" +"A responsive product page: hero, features, figures, a quote and a footer" = "Trang sản phẩm đáp ứng: phần mở đầu, tính năng, số liệu, trích dẫn và chân trang" +"A spring plays until it settles: its mass, stiffness and damping set how long" = "Chuyển động lò xo chạy cho đến khi ổn định: khối lượng, độ cứng và độ giảm chấn quyết định thời lượng" +"A title, an agenda, a big figure, a chart and a closing slide" = "Tiêu đề, chương trình, số liệu lớn, biểu đồ và trang kết thúc" +"A to Z" = "A đến Z" +"About" = "Giới thiệu" +"About FigCraft" = "Giới thiệu về FigCraft" +"About this server" = "Giới thiệu về máy chủ này" +"Action" = "Hành động" +"Actions" = "Hành động" +"Actions for {name}" = "Hành động cho {name}" +"Actions…" = "Hành động…" +"Active" = "Đang hoạt động" +"Actual size (100%)" = "Kích thước thực (100%)" +"Add a category" = "Thêm danh mục" +"Add a comment" = "Thêm bình luận" +"Add a description" = "Thêm mô tả" +"Add a frame (F) or a shape (R) to get started" = "Thêm khung (F) hoặc hình dạng (R) để bắt đầu" +"Add a layer or component to tile first" = "Hãy thêm một lớp hoặc thành phần để lặp ô trước" +"Add a note for developers" = "Thêm ghi chú cho nhà phát triển" +"Add action" = "Thêm hành động" +"Add actions for when no condition holds" = "Thêm hành động khi không có điều kiện nào thỏa mãn" +"Add an annotation for developers" = "Thêm chú thích cho nhà phát triển" +"Add another condition" = "Thêm điều kiện khác" +"Add auto layout" = "Thêm bố cục tự động" +"Add background behind overlay" = "Thêm nền phía sau lớp phủ" +"Add content to this slot" = "Thêm nội dung vào ô chứa này" +"Add dev resource" = "Thêm tài nguyên dev" +"Add effect" = "Thêm hiệu ứng" +"Add export setting" = "Thêm thiết lập xuất" +"Add fill" = "Thêm màu tô" +"Add interaction" = "Thêm tương tác" +"Add layout grid" = "Thêm lưới bố cục" +"Add library" = "Thêm thư viện" +"Add library file…" = "Thêm tệp thư viện…" +"Add max height" = "Thêm chiều cao tối đa" +"Add max width" = "Thêm chiều rộng tối đa" +"Add min height" = "Thêm chiều cao tối thiểu" +"Add min width" = "Thêm chiều rộng tối thiểu" +"Add mode" = "Thêm chế độ" +"Add new page" = "Thêm trang mới" +"Add or update collections from a variables JSON" = "Thêm hoặc cập nhật bộ sưu tập từ JSON biến" +"Add properties to make instances configurable" = "Thêm thuộc tính để có thể cấu hình các bản thể" +"Add reaction" = "Thêm biểu cảm" +"Add starting point" = "Thêm điểm bắt đầu" +"Add stroke" = "Thêm nét" +"Add variant" = "Thêm biến thể" +"Add variant with a new value" = "Thêm biến thể với giá trị mới" +"Added" = "Đã thêm" +"Added the library \"{name}\"" = "Đã thêm thư viện \"{name}\"" +"Adding to {name}" = "Đang thêm vào {name}" +"Adjust" = "Điều chỉnh" +"Adjustment presets" = "Thiết lập sẵn điều chỉnh" +"Advanced" = "Nâng cao" +"Advanced stroke" = "Nét nâng cao" +"After delay" = "Sau khoảng trễ" +"After delay {ms}ms" = "Sau khoảng trễ {ms}ms" +"Align" = "Căn chỉnh" +"Align bottom" = "Căn dưới" +"Align center" = "Căn giữa" +"Align horizontal centers" = "Căn tâm ngang" +"Align left" = "Căn trái" +"Align middle" = "Căn giữa dọc" +"Align right" = "Căn phải" +"Align text baselines" = "Căn theo đường cơ sở văn bản" +"Align top" = "Căn trên" +"Align vertical centers" = "Căn tâm dọc" +"Alignment" = "Căn chỉnh" +"All" = "Tất cả" +"All categories" = "Tất cả danh mục" +"All comments" = "Tất cả bình luận" +"All components" = "Tất cả thành phần" +"All fonts" = "Tất cả phông chữ" +"All supported properties" = "Tất cả thuộc tính được hỗ trợ" +"All the fonts this file uses are installed" = "Tất cả phông chữ tệp này sử dụng đều đã được cài đặt" +"All variables" = "Tất cả biến" +"Alpha" = "Alpha" +"Alphabetical" = "Theo bảng chữ cái" +"Alt+drag" = "Alt+kéo" +"An analytics screen on a grid: figures, charts drawn from vectors and a table" = "Màn hình phân tích trên lưới: số liệu, biểu đồ vẽ bằng vector và bảng dữ liệu" +"An invite link that opens FigCraft and joins" = "Liên kết mời giúp mở FigCraft và tham gia ngay" +"Anchor" = "Điểm neo" +"Android" = "Android" +"Angular" = "Góc" +"Animation" = "Hoạt ảnh" +"Annotations" = "Chú thích" +"Annotations shown on the canvas" = "Chú thích hiển thị trên vùng vẽ" +"Another server, or one that needs its key. The usual server is set in Preferences." = "Một máy chủ khác, hoặc máy chủ cần khóa truy cập. Máy chủ thường dùng được đặt trong Tùy chọn." +"Any status" = "Mọi trạng thái" +"Anyone on your network with this code can edit the file, while this app stays open." = "Bất kỳ ai trong mạng của bạn có mã này đều có thể chỉnh sửa tệp trong khi ứng dụng này đang mở." +"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." = "Bất kỳ ai có liên kết chỉnh sửa đều có thể thay đổi tệp; liên kết xem chỉ cho phép xem. Các liên kết chứa mã bí mật: hãy chia sẻ cẩn thận như mật khẩu. `figcraft-server links` dùng để tạo thêm và thu hồi liên kết." +"Anyone with this code can edit the file." = "Bất kỳ ai có mã này đều có thể chỉnh sửa tệp." +"Anyone with this code can look at the file, not change it." = "Bất kỳ ai có mã này đều có thể xem tệp nhưng không thể chỉnh sửa." +"Appearance" = "Giao diện" +"Apply a component property" = "Áp dụng thuộc tính thành phần" +"Apply variable" = "Áp dụng biến" +"Apply variable to text" = "Áp dụng biến cho văn bản" +"Apply variable to visibility" = "Áp dụng biến cho hiển thị" +"Apps" = "Ứng dụng" +"Apr" = "Thg 4" +"Arc" = "Cung" +"Arc ratio" = "Tỷ lệ cung" +"Arc start" = "Điểm đầu cung" +"Arc sweep" = "Góc quét cung" +"Archive" = "Lưu trữ" +"Archived" = "Đã lưu trữ" +"Arrange" = "Sắp xếp" +"Arrow" = "Mũi tên" +"As typed" = "Như đã nhập" +"Asking the server…" = "Đang hỏi máy chủ…" +"Assets" = "Tài nguyên" +"Aug" = "Thg 8" +"Auto" = "Tự động" +"Auto (space around)" = "Tự động (cách đều xung quanh)" +"Auto (space between)" = "Tự động (cách đều giữa các mục)" +"Auto (space evenly)" = "Tự động (cách đều bằng nhau)" +"Auto ({mode})" = "Tự động ({mode})" +"Auto columns" = "Cột tự động" +"Auto gap" = "Khoảng hở tự động" +"Auto height" = "Chiều cao tự động" +"Auto layout" = "Bố cục tự động" +"Auto rows" = "Hàng tự động" +"Auto width" = "Chiều rộng tự động" +"Back" = "Quay lại" +"Back to Ready for dev" = "Quay lại Sẵn sàng cho dev" +"Back to Ready for dev: the next change compares with how it is now" = "Quay lại Sẵn sàng cho dev: thay đổi tiếp theo sẽ so sánh với trạng thái hiện tại" +"Back to assets" = "Quay lại tài nguyên" +"Back to current" = "Quay lại hiện tại" +"Back to styles" = "Quay lại các kiểu" +"Back to the FigCraft server" = "Quay lại máy chủ FigCraft" +"Back to the canvas from a focused region" = "Quay lại vùng vẽ từ vùng đang giữ tiêu điểm" +"Back to the current version" = "Quay lại phiên bản hiện tại" +"Back to the font's value" = "Quay lại giá trị của phông chữ" +"Back to the values the font style implies" = "Quay lại các giá trị mặc định của kiểu phông chữ" +"Background" = "Nền" +"Background blur" = "Làm mờ nền" +"Basics" = "Cơ bản" +"Before" = "Trước" +"Bend" = "Uốn cong" +"Bevel" = "Vát cạnh" +"Binary assets added" = "Tài nguyên nhị phân đã thêm" +"Binary assets removed" = "Tài nguyên nhị phân đã xóa" +"Black & white" = "Đen trắng" +"Bleed" = "Vùng tràn lề" +"Bleed marks" = "Dấu tràn lề" +"Bleed marks need a bleed" = "Dấu tràn lề cần có vùng tràn lề" +"Blend" = "Hòa trộn" +"Blend mode" = "Chế độ hòa trộn" +"Blue" = "Xanh lam" +"Blur" = "Làm mờ" +"Boolean" = "Boolean" +"Boolean groups" = "Nhóm boolean" +"Both directions" = "Cả hai hướng" +"Bottom" = "Dưới" +"Bottom left radius" = "Bán kính góc dưới trái" +"Bottom padding" = "Đệm dưới" +"Bottom right radius" = "Bán kính góc dưới phải" +"Bound to {name}. Click to detach the variable." = "Đã gắn với {name}. Nhấp để tách biến." +"Branch" = "Nhánh" +"Branch archived" = "Đã lưu trữ nhánh" +"Branch merged" = "Đã hợp nhất nhánh" +"Branch name" = "Tên nhánh" +"Branch of {file}" = "Nhánh của {file}" +"Branch of {file} · merged or archived" = "Nhánh của {file} · đã hợp nhất hoặc lưu trữ" +"Branch updated from main" = "Đã cập nhật nhánh từ nhánh chính" +"Branch {name}" = "Nhánh {name}" +"Branches" = "Các nhánh" +"Bring forward" = "Đưa tiến một lớp" +"Bring the main file's changes into the branch" = "Đưa các thay đổi của tệp chính vào nhánh" +"Bring to front" = "Đưa lên trên cùng" +"Bristle" = "Lông cọ" +"Browse" = "Duyệt" +"Brush" = "Cọ vẽ" +"Brush rotation jitter" = "Độ ngẫu nhiên góc xoay cọ" +"Brush scatter" = "Độ phân tán cọ" +"Brush size jitter" = "Độ ngẫu nhiên cỡ cọ" +"Brush spacing" = "Khoảng cách nét cọ" +"Bulleted list" = "Danh sách dấu đầu dòng" +"C or Shift+C" = "C hoặc Shift+C" +"C or ⇧C" = "C hoặc ⇧C" +"CMYK colour" = "Màu CMYK" +"CSS custom properties…" = "Thuộc tính tùy chỉnh CSS…" +"Can edit" = "Có thể chỉnh sửa" +"Can view" = "Có thể xem" +"Can't read this library: {e}" = "Không thể đọc thư viện này: {e}" +"Cancel" = "Hủy" +"Canvas" = "Vùng vẽ" +"Canvas stacking" = "Thứ tự xếp chồng trên vùng vẽ" +"Cap height to baseline" = "Chiều cao chữ hoa đến đường cơ sở" +"Case" = "Chữ hoa/thường" +"Case-sensitive forms" = "Dạng ký tự theo chữ hoa/thường" +"Categories" = "Danh mục" +"Center" = "Giữa" +"Change alias" = "Đổi bí danh" +"Change resolved" = "Đã giải quyết thay đổi" +"Change style" = "Đổi kiểu" +"Change to" = "Đổi thành" +"Change to needs a layer inside a variant" = "Đổi thành cần một lớp nằm trong biến thể" +"Changed" = "Đã thay đổi" +"Changed on both sides: keep one" = "Đã thay đổi ở cả hai phía: hãy giữ một bên" +"Changes on main" = "Thay đổi trên nhánh chính" +"Changes on the branch" = "Thay đổi trên nhánh" +"Changes unknown" = "Không rõ thay đổi" +"Checking the fonts installed on this computer…" = "Đang kiểm tra các phông chữ cài đặt trên máy tính này…" +"Checking the server…" = "Đang kiểm tra máy chủ…" +"Choose React, Leptos, SwiftUI or Compose above to connect this component to its code." = "Hãy chọn React, Leptos, SwiftUI hoặc Compose ở trên để kết nối thành phần này với mã nguồn." +"Choose another profile to change it." = "Hãy chọn hồ sơ khác để thay đổi." +"Choose collection" = "Chọn bộ sưu tập" +"Choose image" = "Chọn hình ảnh" +"Choose mode" = "Chọn chế độ" +"Choose variable" = "Chọn biến" +"Circle" = "Hình tròn" +"Clear from this list" = "Xóa khỏi danh sách này" +"Clear recent" = "Xóa danh sách gần đây" +"Click + to replace mixed content" = "Nhấp + để thay thế nội dung hỗn hợp" +"Click anywhere on the canvas to leave one." = "Nhấp vào bất kỳ đâu trên vùng vẽ để lại bình luận." +"Click or drag to merge · {alt} removes" = "Nhấp hoặc kéo để hợp nhất · {alt} để xóa" +"Click or drag to remove · {alt} merges" = "Nhấp hoặc kéo để xóa · {alt} để hợp nhất" +"Click to record a key" = "Nhấp để ghi nhận phím" +"Clip content" = "Cắt nội dung tràn khung" +"Clip to shape" = "Cắt theo hình dạng" +"Close" = "Đóng" +"Close overlay" = "Đóng lớp phủ" +"Close preview" = "Đóng xem trước" +"Close tab" = "Đóng thẻ" +"Close version history" = "Đóng lịch sử phiên bản" +"Close when clicking outside" = "Đóng khi nhấp ra ngoài" +"Close without saving" = "Đóng không lưu" +"Code" = "Mã" +"Code or invite link" = "Mã hoặc liên kết mời" +"Code syntax" = "Cú pháp mã" +"Collapse" = "Thu gọn" +"Collapse panel" = "Thu gọn bảng" +"Collection" = "Bộ sưu tập" +"Collections" = "Bộ sưu tập" +"Color" = "Màu" +"Color burn" = "Đốt màu" +"Color dodge" = "Làm sáng màu" +"Color format" = "Định dạng màu" +"Color profile" = "Hồ sơ màu" +"Color profile: {name}" = "Hồ sơ màu: {name}" +"Color styles" = "Kiểu màu" +"Color values in this file are in this color space." = "Các giá trị màu trong tệp này thuộc không gian màu này." +"Color variables" = "Biến màu" +"Colour" = "Màu" +"Colour and text styles, Light and Dark variables, buttons, inputs and cards" = "Kiểu màu và văn bản, biến Sáng và Tối, nút bấm, ô nhập liệu và thẻ" +"Column" = "Cột" +"Column gap" = "Khoảng hở cột" +"Column sizes" = "Kích thước cột" +"Column span" = "Số cột gộp" +"Columns" = "Các cột" +"Columns {count}" = "Cột {count}" +"Comment" = "Bình luận" +"Comments" = "Bình luận" +"Commits" = "Commit" +"Company" = "Công ty" +"Compare changes" = "So sánh thay đổi" +"Compatibility notes" = "Ghi chú tương thích" +"Completed" = "Đã hoàn thành" +"Component" = "Thành phần" +"Component name" = "Tên thành phần" +"Component property" = "Thuộc tính thành phần" +"Component set" = "Bộ thành phần" +"Component sets" = "Các bộ thành phần" +"Components" = "Các thành phần" +"Conditional" = "Điều kiện" +"Confetti" = "Hoa giấy" +"Conflicts" = "Xung đột" +"Connect to code" = "Kết nối với mã" +"Connected" = "Đã kết nối" +"Connected to code: {from}" = "Đã kết nối với mã: {from}" +"Connection lost, reconnecting (attempt {attempt})…" = "Mất kết nối, đang kết nối lại (lần thử {attempt})…" +"Constrain proportions" = "Giữ tỷ lệ" +"Constraints" = "Ràng buộc" +"Content" = "Nội dung" +"Contents hidden" = "Đã ẩn nội dung" +"Contents only" = "Chỉ nội dung" +"Contextual alternates" = "Ký tự thay thế theo ngữ cảnh" +"Contrast" = "Độ tương phản" +"Contributors" = "Người đóng góp" +"Contributors: {people} · Commits: {commits}" = "Người đóng góp: {people} · Commit: {commits}" +"Controller" = "Tay cầm điều khiển" +"Convert to frame" = "Chuyển thành khung" +"Convert to section" = "Chuyển thành phần" +"Cool" = "Lạnh" +"Copied as CSS" = "Đã sao chép dưới dạng CSS" +"Copied as PNG" = "Đã sao chép dưới dạng PNG" +"Copied as SVG" = "Đã sao chép dưới dạng SVG" +"Copied as text" = "Đã sao chép dưới dạng văn bản" +"Copied {value}" = "Đã sao chép {value}" +"Copy" = "Sao chép" +"Copy as" = "Sao chép dưới dạng" +"Copy as CSS" = "Sao chép dưới dạng CSS" +"Copy as PNG" = "Sao chép dưới dạng PNG" +"Copy as SVG" = "Sao chép dưới dạng SVG" +"Copy code" = "Sao chép mã" +"Copy link" = "Sao chép liên kết" +"Copy the {label}" = "Sao chép {label}" +"Copy {value}" = "Sao chép {value}" +"Corner radius" = "Bán kính góc" +"Corner smoothing" = "Làm mượt góc" +"Couldn't download the variables" = "Không thể tải xuống các biến" +"Couldn't reach {server}: showing what this computer remembers." = "Không thể kết nối tới {server}: đang hiển thị dữ liệu máy tính này ghi nhớ." +"Couldn't read {name}." = "Không thể đọc {name}." +"Couldn't save automatically: {error}" = "Không thể tự động lưu: {error}" +"Count" = "Số lượng" +"Create" = "Tạo" +"Create a variable collection first" = "Hãy tạo bộ sưu tập biến trước" +"Create a variable first" = "Hãy tạo biến trước" +"Create alias" = "Tạo bí danh" +"Create branch" = "Tạo nhánh" +"Create collection" = "Tạo bộ sưu tập" +"Create component" = "Tạo thành phần" +"Create component property" = "Tạo thuộc tính thành phần" +"Create components, styles or variables to publish them as a library." = "Hãy tạo các thành phần, kiểu hoặc biến để xuất bản thành thư viện." +"Create property…" = "Tạo thuộc tính…" +"Create style" = "Tạo kiểu" +"Create style from the selected text" = "Tạo kiểu từ văn bản đã chọn" +"Created" = "Đã tạo" +"Crop" = "Cắt xén" +"Crop marks" = "Dấu xén" +"Ctrl+arrows" = "Ctrl+mũi tên" +"Ctrl+click" = "Ctrl+nhấp" +"Ctrl+scroll" = "Ctrl+cuộn" +"Current name" = "Tên hiện tại" +"Current version" = "Phiên bản hiện tại" +"Cursor chat" = "Trò chuyện con trỏ" +"Custom" = "Tùy chỉnh" +"Custom size" = "Kích thước tùy chỉnh" +"Cut" = "Cắt" +"Dark" = "Tối" +"Darken" = "Làm tối" +"Dash" = "Nét đứt" +"Dashboard" = "Bảng điều khiển" +"Date created" = "Ngày tạo" +"Dec" = "Thg 12" +"Decoration" = "Trang trí chữ" +"Decoration style" = "Kiểu trang trí chữ" +"Deep select" = "Chọn sâu" +"Default" = "Mặc định" +"Default content" = "Nội dung mặc định" +"Default value (the top-left variant)" = "Giá trị mặc định (biến thể ở góc trên trái)" +"Delay" = "Độ trễ" +"Delete" = "Xóa" +"Delete category (its annotations stay)" = "Xóa danh mục (các chú thích vẫn được giữ lại)" +"Delete collection" = "Xóa bộ sưu tập" +"Delete group" = "Xóa nhóm" +"Delete mode" = "Xóa chế độ" +"Delete page" = "Xóa trang" +"Delete preset" = "Xóa thiết lập sẵn" +"Delete property" = "Xóa thuộc tính" +"Delete the style (layers keep their values)" = "Xóa kiểu (các lớp vẫn giữ nguyên giá trị)" +"Delete thread" = "Xóa luồng bình luận" +"Delete variable" = "Xóa biến" +"Delete “{name}”? This can't be undone." = "Xóa “{name}”? Thao tác này không thể hoàn tác." +"Density" = "Mật độ" +"Depth" = "Độ sâu" +"Describe how and when to use this component" = "Mô tả cách thức và thời điểm sử dụng thành phần này" +"Describe what changed" = "Mô tả những gì đã thay đổi" +"Description" = "Mô tả" +"Description (optional)" = "Mô tả (tùy chọn)" +"Design" = "Thiết kế" +"Design system starter" = "Bộ khởi đầu hệ thống thiết kế" +"Desktop" = "Máy tính" +"Destination" = "Đích" +"Detach alias" = "Tách bí danh" +"Detach instance" = "Tách bản thể" +"Detach property" = "Tách thuộc tính" +"Detach style" = "Tách kiểu" +"Detach styles" = "Tách các kiểu" +"Detach variable" = "Tách biến" +"Details" = "Chi tiết" +"Dev Mode" = "Dev Mode" +"Dev resources" = "Tài nguyên dev" +"Development" = "Phát triển" +"Device" = "Thiết bị" +"Device at 100%" = "Thiết bị ở mức 100%" +"Diamond" = "Hình thoi" +"Difference" = "Khác biệt" +"Dimensions" = "Kích thước" +"Direction" = "Hướng" +"Disconnect from code" = "Ngắt kết nối mã" +"Dispersion" = "Tán sắc" +"Display name" = "Tên hiển thị" +"Dissolve" = "Hòa tan" +"Distribute and tidy" = "Phân bổ và sắp xếp gọn" +"Distribute horizontal spacing" = "Phân bổ đều khoảng cách ngang" +"Distribute vertical spacing" = "Phân bổ đều khoảng cách dọc" +"Divider" = "Đường phân cách" +"Don't truncate" = "Không cắt bớt" +"Done" = "Xong" +"Done editing" = "Hoàn tất chỉnh sửa" +"Dots" = "Chấm" +"Dotted" = "Chấm tròn" +"Down" = "Xuống" +"Drafts" = "Bản nháp" +"Drag the stroke to add a width point" = "Kéo nét để thêm điểm độ rộng" +"Draw" = "Vẽ" +"Draw a frame" = "Vẽ khung" +"Drawing tools" = "Công cụ vẽ" +"Drop a .figcraft, .fig, .json, .svg or image file." = "Thả tệp .figcraft, .fig, .json, .svg hoặc hình ảnh vào đây." +"Drop shadow" = "Đổ bóng" +"Drop to import" = "Thả để nhập" +"Drop to open" = "Thả để mở" +"Dual-licensed MIT OR Apache-2.0. Made by the ArtCraft team and community." = "Cấp phép kép MIT HOẶC Apache-2.0. Được phát triển bởi đội ngũ và cộng đồng ArtCraft." +"Duo" = "Hai tông" +"Duplicate" = "Nhân bản" +"Duplicate by dragging" = "Nhân bản bằng cách kéo" +"Duplicate mode" = "Nhân bản chế độ" +"Duplicate page" = "Nhân bản trang" +"Edit" = "Chỉnh sửa" +"Edit as an expression" = "Chỉnh sửa dưới dạng biểu thức" +"Edit colour" = "Chỉnh sửa màu" +"Edit comment" = "Chỉnh sửa bình luận" +"Edit dev resource" = "Chỉnh sửa tài nguyên dev" +"Edit link" = "Liên kết chỉnh sửa" +"Edit link copied" = "Đã sao chép liên kết chỉnh sửa" +"Edit style" = "Chỉnh sửa kiểu" +"Edit variable" = "Chỉnh sửa biến" +"Edit with the builder" = "Chỉnh sửa bằng bộ dựng" +"Edited {when}" = "Đã chỉnh sửa {when}" +"Effect settings" = "Thiết lập hiệu ứng" +"Effect styles" = "Kiểu hiệu ứng" +"Effects" = "Hiệu ứng" +"Ellipse" = "Hình elip" +"Ellipses" = "Hình elip" +"Else" = "Ngược lại" +"Else if" = "Hoặc nếu" +"Embedded profile" = "Hồ sơ nhúng sẵn" +"Empty" = "Trống" +"End" = "Cuối" +"End point" = "Điểm cuối" +"Ends the session; everyone keeps their copy" = "Kết thúc phiên; mọi người vẫn giữ bản sao của mình" +"Enter" = "Enter" +"Enter the address of a figcraft-server and press Browse to see the plugins it offers." = "Nhập địa chỉ figcraft-server và nhấn Duyệt để xem các plugin mà máy chủ cung cấp." +"Enter to save · Esc to cancel" = "Enter để lưu · Esc để hủy" +"Eraser" = "Cục tẩy" +"Esc" = "Esc" +"Essential" = "Thiết yếu" +"Every conflict has a choice." = "Mọi xung đột đều đã có lựa chọn." +"Every top-level frame already starts a flow" = "Mọi khung cấp cao nhất đều đã là điểm bắt đầu luồng" +"Exact opacity (4 then 5: 45%)" = "Độ mờ chính xác (nhấn 4 rồi 5: 45%)" +"Exclude" = "Loại trừ" +"Excluded" = "Đã loại trừ" +"Excluded from layout" = "Đã loại trừ khỏi bố cục" +"Excludes" = "Phép loại trừ" +"Exclusion" = "Loại trừ" +"Exit focus view (Esc)" = "Thoát chế độ xem tập trung (Esc)" +"Expand" = "Mở rộng" +"Export" = "Xuất" +"Export all" = "Xuất tất cả" +"Export frames and layers as PNG, JPG, SVG or PDF" = "Xuất các khung và lớp dưới dạng PNG, JPG, SVG hoặc PDF" +"Export page as PNG" = "Xuất trang dưới dạng PNG" +"Export settings" = "Thiết lập xuất" +"Export variables" = "Xuất các biến" +"Export {name}" = "Xuất {name}" +"Export {n} layers" = { other = "Xuất {n} lớp" } +"Exported {file}" = "Đã xuất {file}" +"Exported {name}" = "Đã xuất {name}" +"Exported {name}; {n} kinds of content were left out" = { other = "Đã xuất {name}; {n} loại nội dung đã bị lược bỏ" } +"Exported {n} files" = { other = "Đã xuất {n} tệp" } +"Export…" = "Xuất…" +"Expose properties to instances" = "Hiển thị thuộc tính từ các bản thể lồng nhau" +"Exposure" = "Phơi sáng" +"Expression" = "Biểu thức" +"Extend collection" = "Mở rộng bộ sưu tập" +"Extends \"{name}\": overridden values are marked" = "Mở rộng \"{name}\": các giá trị ghi đè được đánh dấu" +"Eye" = "Mắt" +"F" = "F" +"Fade" = "Mờ dần" +"False" = "Sai" +"Feb" = "Thg 2" +"Fetching from the server…" = "Đang tải từ máy chủ…" +"FigCraft couldn't open its window: {error}" = "FigCraft không thể mở cửa sổ: {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 chưa hỗ trợ mọi tính năng của các tệp này. Các ghi chú dưới đây liệt kê những gì đã được lược bỏ hoặc thay đổi trong bản sao đã nhập; tệp gốc không bị thay đổi." +"File" = "Tệp" +"File name" = "Tên tệp" +"File not found" = "Không tìm thấy tệp" +"File published" = "Đã xuất bản tệp" +"Files aren't end-to-end encrypted: the server's operator can read them." = "Các tệp không được mã hóa đầu cuối: người vận hành máy chủ có thể đọc được chúng." +"Files nobody opens for {n} days are deleted." = { other = "Các tệp không ai mở trong {n} ngày sẽ bị xóa." } +"Fill" = "Màu tô" +"Fill (fr)" = "Lấp đầy (fr)" +"Fill container" = "Lấp đầy khung chứa" +"Fill window" = "Lấp đầy cửa sổ" +"Fills" = "Màu tô" +"Fill|sizing" = "Lấp đầy" +"Filter and sort" = "Lọc và sắp xếp" +"Find" = "Tìm" +"Find and replace" = "Tìm và thay thế" +"Find layers" = "Tìm lớp" +"First" = "Đầu tiên" +"First commit" = "Commit đầu tiên" +"First on top" = "Mục đầu ở trên cùng" +"Fit" = "Vừa khít" +"Fit device to window" = "Vừa thiết bị với cửa sổ" +"Fit to contents" = "Vừa khít nội dung" +"Fit to window" = "Vừa khít cửa sổ" +"Fit width" = "Vừa chiều rộng" +"Fixed" = "Cố định" +"Fixed gap" = "Khoảng hở cố định" +"Fixed size" = "Kích thước cố định" +"Flatten" = "Làm phẳng" +"Flip" = "Lật" +"Flip horizontal" = "Lật ngang" +"Flip text to the other side" = "Lật văn bản sang phía bên kia" +"Flip vertical" = "Lật dọc" +"Flip width profile" = "Lật biên dạng độ rộng" +"Flow starting point" = "Điểm bắt đầu luồng" +"Flow starting points" = "Các điểm bắt đầu luồng" +"Flows" = "Các luồng" +"Focus view" = "Chế độ xem tập trung" +"Fold autosaves" = "Gộp các bản tự động lưu" +"Folder: click to collapse" = "Thư mục: nhấp để thu gọn" +"Folder: click to expand" = "Thư mục: nhấp để mở rộng" +"Follow" = "Theo dõi" +"Follow {name}" = "Theo dõi {name}" +"Following" = "Đang theo dõi" +"Following {name} · {key} to stop" = "Đang theo dõi {name} · {key} để dừng" +"Font" = "Phông chữ" +"Font not installed" = "Phông chữ chưa được cài đặt" +"Font size" = "Cỡ chữ" +"Font style" = "Kiểu phông chữ" +"Forget on this computer" = "Quên trên máy tính này" +"Four screens of a trail app with components and a prototype flow" = "Bốn màn hình ứng dụng đường mòn với các thành phần và luồng nguyên mẫu" +"Fractions" = "Phân số" +"Frame" = "Khung" +"Frame selection" = "Đóng khung vùng chọn" +"Frame tools" = "Công cụ khung" +"Frames" = "Các khung" +"From the library \"{name}\": read-only" = "Từ thư viện \"{name}\": chỉ đọc" +"From {name}" = "Từ {name}" +"From {server}" = "Từ {server}" +"Frost" = "Độ mờ sương" +"Gap" = "Khoảng hở" +"Gap between columns" = "Khoảng hở giữa các cột" +"Gap between items" = "Khoảng hở giữa các mục" +"Gap between rows" = "Khoảng hở giữa các hàng" +"Getting started" = "Bắt đầu" +"Give the address of a server open to the public, or a server's address with its key (`figcraft-server key` prints it)." = "Nhập địa chỉ của một máy chủ công khai, hoặc địa chỉ máy chủ kèm theo khóa (`figcraft-server key` sẽ in khóa đó)." +"Glass" = "Kính" +"Go to main component" = "Đi tới thành phần chính" +"Go to {name}" = "Đi tới {name}" +"Grab bag" = "Tổng hợp" +"Gradient" = "Chuyển sắc" +"Gray" = "Xám" +"Green" = "Xanh lá" +"Greyscale components and two example screens to sketch a flow with" = "Các thành phần thang độ xám và hai màn hình mẫu để phác thảo luồng" +"Grid" = "Lưới" +"Grid ({size})" = "Lưới ({size})" +"Grid styles" = "Kiểu lưới" +"Grid {size}" = "Lưới {size}" +"Group" = "Nhóm" +"Group selection" = "Nhóm vùng chọn" +"Groups" = "Các nhóm" +"Gutter" = "Rãnh cột" +"Hand tool" = "Công cụ bàn tay" +"Hanging list" = "Danh sách nhô đầu dòng" +"Hanging punctuation" = "Dấu câu treo ngoài lề" +"Hard light" = "Ánh sáng gắt" +"Height" = "Chiều cao" +"Help" = "Trợ giúp" +"Help and resources" = "Trợ giúp và tài nguyên" +"Help page" = "Trang trợ giúp" +"Here: {names}" = "Tại đây: {names}" +"Hidden" = "Đã ẩn" +"Hide contents" = "Ẩn nội dung" +"Hide from publishing" = "Ẩn khi xuất bản" +"Hide section contents" = "Ẩn nội dung phần" +"Hide these tips (Getting started in the Help menu shows them again)" = "Ẩn các mẹo này (chọn Bắt đầu trong trình đơn Trợ giúp để hiện lại)" +"Hide when publishing" = "Ẩn khi xuất bản" +"Highlight layers on hover" = "Làm nổi bật lớp khi di chuột qua" +"Highlights" = "Vùng sáng" +"Hold Alt" = "Giữ Alt" +"Hold Alt+Z" = "Giữ Alt+Z" +"Hold Ctrl" = "Giữ Ctrl" +"Hold Z" = "Giữ Z" +"Hold ⌃ or ⌘" = "Giữ ⌃ hoặc ⌘" +"Hold ⌥" = "Giữ ⌥" +"Hold ⌥Z" = "Giữ ⌥Z" +"Home" = "Trang chủ" +"Horizontal" = "Ngang" +"Horizontal align" = "Căn ngang" +"Horizontal hex" = "Lục giác ngang" +"Horizontal padding" = "Đệm ngang" +"Horizontal spacing" = "Khoảng cách ngang" +"Hosted by {operator}" = "Được vận hành bởi {operator}" +"Hover a layer to see its properties" = "Di chuột qua một lớp để xem thuộc tính" +"Hover other layers to measure the distance" = "Di chuột qua các lớp khác để đo khoảng cách" +"Hue" = "Sắc độ" +"Hug" = "Ôm khít" +"Hug contents" = "Ôm khít nội dung" +"Icon components on a 24 px grid with keylines and a size preview" = "Các thành phần biểu tượng trên lưới 24 px có đường định chuẩn và khung xem trước kích thước" +"Icon set starter" = "Bộ khởi đầu biểu tượng" +"If" = "Nếu" +"If it keeps happening, please report it at {link} with this message." = "Nếu lỗi vẫn tiếp diễn, vui lòng báo cáo tại {link} kèm theo thông báo này." +"If {condition}" = "Nếu {condition}" +"Ignore auto layout (absolute position)" = "Bỏ qua bố cục tự động (vị trí tuyệt đối)" +"Image" = "Hình ảnh" +"Images" = "Hình ảnh" +"Import" = "Nhập" +"Import path" = "Đường dẫn nhập" +"Import plugin from manifest" = "Nhập plugin từ tệp kê khai" +"Import plugin from manifest…" = "Nhập plugin từ tệp kê khai…" +"Import report" = "Báo cáo nhập" +"Import variables" = "Nhập các biến" +"Imported document" = "Tài liệu đã nhập" +"Imported {name}" = "Đã nhập {name}" +"Imported {n} new variables, updated {updated}" = { other = "Đã nhập {n} biến mới, cập nhật {updated}" } +"Import…" = "Nhập…" +"In an instance, this comes from the main component" = "Trong bản thể, giá trị này được lấy từ thành phần chính" +"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)." = "Trên trình duyệt, bạn có thể tham gia các phiên do ứng dụng máy tính chủ trì và các tệp trên máy chủ FigCraft. Trang mở qua https chỉ kết nối tới máy tính khác qua liên kết wss:// (máy chủ có TLS)." +"Include bounding box" = "Bao gồm khung giới hạn" +"Include id attribute" = "Bao gồm thuộc tính id" +"Included" = "Đã bao gồm" +"Included in layout" = "Được tính trong bố cục" +"Individual corners" = "Từng góc riêng" +"Individual padding" = "Đệm từng cạnh" +"Individual strokes" = "Nét từng cạnh" +"Ink" = "Mực" +"Inner shadow" = "Bóng trong" +"Inside" = "Bên trong" +"Inspect" = "Kiểm tra" +"Inspect the layer under the pointer: size, colours, typography" = "Kiểm tra lớp dưới con trỏ: kích thước, màu sắc, kiểu chữ" +"Install" = "Cài đặt" +"Install plugin" = "Cài đặt plugin" +"Installed" = "Đã cài đặt" +"Installed {name}" = "Đã cài đặt {name}" +"Installing…" = "Đang cài đặt…" +"Instance" = "Bản thể" +"Instance properties" = "Thuộc tính bản thể" +"Instance swap" = "Hoán đổi bản thể" +"Instance swap (no other component)" = "Hoán đổi bản thể (không có thành phần khác)" +"Instances" = "Các bản thể" +"Instant" = "Tức thì" +"Intensity" = "Cường độ" +"Interaction" = "Tương tác" +"Interactions" = "Các tương tác" +"Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Thiết kế giao diện và tạo nguyên mẫu. Công cụ thiết kế miễn phí, mã nguồn mở, được viết mới hoàn toàn bằng Rust, thuộc bộ ứng dụng sáng tạo ArtCraft." +"Interface size" = "Kích thước giao diện" +"Intersect" = "Giao nhau" +"Intersects" = "Phép giao" +"Invalid color" = "Màu không hợp lệ" +"Invite link" = "Liên kết mời" +"Invite link copied" = "Đã sao chép liên kết mời" +"It asks permission to:" = "Plugin yêu cầu quyền:" +"Jan" = "Thg 1" +"Join" = "Tham gia" +"Join code copied" = "Đã sao chép mã tham gia" +"Join code or invite link" = "Mã tham gia hoặc liên kết mời" +"Join live session" = "Tham gia phiên trực tiếp" +"Join us on Discord" = "Tham gia Discord cùng chúng tôi" +"Join with a code" = "Tham gia bằng mã" +"Joined" = "Đã tham gia" +"Joined {file}" = "Đã tham gia {file}" +"Joining…" = "Đang tham gia…" +"Join|stroke" = "Khớp nối" +"Jul" = "Thg 7" +"Jun" = "Thg 6" +"Just now" = "Vừa xong" +"Justify" = "Căn đều" +"Keep appearance" = "Giữ nguyên diện mạo" +"Keep appearance converts every color value to {profile} so colors look the same. Keep values leaves the numbers as they are, so colors shift." = "Giữ nguyên diện mạo sẽ chuyển đổi mọi giá trị màu sang {profile} để màu sắc hiển thị như cũ. Giữ nguyên giá trị sẽ giữ nguyên các con số nên màu sắc sẽ thay đổi." +"Keep tool selected after use" = "Giữ công cụ được chọn sau khi dùng" +"Keep values" = "Giữ nguyên giá trị" +"Key/Gamepad" = "Phím/Tay cầm" +"Key/Gamepad {key}" = "Phím/Tay cầm {key}" +"Keyboard shortcuts" = "Phím tắt" +"Kits" = "Bộ công cụ" +"Landing page" = "Trang đích" +"Language" = "Ngôn ngữ" +"Lasso" = "Dây quây" +"Last" = "Cuối cùng" +"Last change: {note}" = "Thay đổi gần nhất: {note}" +"Last commit" = "Commit cuối cùng" +"Last modified" = "Sửa đổi lần cuối" +"Last on top" = "Mục cuối ở trên cùng" +"Layer blur" = "Làm mờ lớp" +"Layer name" = "Tên lớp" +"Layers" = "Các lớp" +"Layers in an instance take their position from the main component" = "Các lớp trong bản thể lấy vị trí từ thành phần chính" +"Layout" = "Bố cục" +"Layout grid" = "Lưới bố cục" +"Layout grid settings" = "Thiết lập lưới bố cục" +"Layout grids" = "Lưới bố cục" +"Leave session" = "Rời phiên" +"Leaves" = "Lá cây" +"Left" = "Trái" +"Left & right" = "Trái & phải" +"Left padding" = "Đệm trái" +"Left side" = "Cạnh trái" +"Left side width" = "Độ rộng cạnh trái" +"Letter case" = "Kiểu chữ hoa/thường" +"Letter spacing" = "Khoảng cách chữ" +"Libraries" = "Thư viện" +"Libraries in this file" = "Thư viện trong tệp này" +"Library updates available" = "Có bản cập nhật thư viện" +"Library: click to collapse" = "Thư viện: nhấp để thu gọn" +"Library: click to expand" = "Thư viện: nhấp để mở rộng" +"Library: its variables are read-only here; edit them in the library file and publish it" = "Thư viện: các biến của thư viện chỉ đọc tại đây; hãy chỉnh sửa chúng trong tệp thư viện rồi xuất bản" +"Light" = "Sáng" +"Lighten" = "Làm sáng" +"Light|glass" = "Ánh sáng" +"Line" = "Đường thẳng" +"Line arrow" = "Mũi tên nét mảnh" +"Line delta" = "Chênh lệch dòng" +"Line height" = "Chiều cao dòng" +"Linear" = "Tuyến tính" +"Lines" = "Đường thẳng" +"Lines +/−" = "Dòng +/−" +"Lines added" = "Dòng đã thêm" +"Lines deleted" = "Dòng đã xóa" +"Link" = "Liên kết" +"Link copied" = "Đã sao chép liên kết" +"Link docs, code or tickets for developers." = "Liên kết tài liệu, mã nguồn hoặc thẻ công việc cho nhà phát triển." +"Link frames on the Prototype tab, then present the flow" = "Liên kết các khung trong thẻ Nguyên mẫu, sau đó trình chiếu luồng" +"Link this component to its code component: instances then show your real snippet with their values." = "Liên kết thành phần này với thành phần mã nguồn: các bản thể sẽ hiển thị đoạn mã thực kèm theo giá trị của chúng." +"List spacing" = "Khoảng cách mục danh sách" +"List style" = "Kiểu danh sách" +"Live session" = "Phiên trực tiếp" +"Live · {people}" = "Trực tiếp · {people}" +"Local components" = "Thành phần cục bộ" +"Local network" = "Mạng cục bộ" +"Local styles" = "Kiểu cục bộ" +"Local variables" = "Biến cục bộ" +"Lock/Unlock" = "Khóa/Mở khóa" +"Locked" = "Đã khóa" +"Lowercase" = "Chữ thường" +"Luminance" = "Độ chói" +"Luminosity" = "Độ sáng" +"Main" = "Chính" +"Main component deleted" = "Thành phần chính đã bị xóa" +"Main menu" = "Trình đơn chính" +"Make a component" = "Tạo thành phần" +"Make slot" = "Tạo ô chứa" +"Mar" = "Thg 3" +"Margin" = "Lề" +"Mark all as read" = "Đánh dấu tất cả là đã đọc" +"Mark as resolved" = "Đánh dấu là đã giải quyết" +"Mark as unread" = "Đánh dấu là chưa đọc" +"Mark as unresolved" = "Đánh dấu là chưa giải quyết" +"Mask" = "Mặt nạ" +"Mass · Stiffness · Damping" = "Khối lượng · Độ cứng · Độ giảm chấn" +"Match (empty: the whole name)" = "Khớp (để trống: toàn bộ tên)" +"Max H" = "Cao tối đa" +"Max W" = "Rộng tối đa" +"Max lines" = "Số dòng tối đa" +"Maximize" = "Phóng to cực đại" +"May" = "Tháng 5" +"Measure to the selection" = "Đo khoảng cách tới vùng chọn" +"Merge into main" = "Hợp nhất vào nhánh chính" +"Merge regions" = "Hợp nhất các vùng" +"Merge the branch into the main file (one undo step) and archive it" = "Hợp nhất nhánh vào tệp chính (một bước hoàn tác) và lưu trữ nhánh" +"Merged" = "Đã hợp nhất" +"Merged PRs" = "PR đã hợp nhất" +"Min H" = "Cao tối thiểu" +"Min W" = "Rộng tối thiểu" +"Minimize" = "Thu nhỏ" +"Mirror angle" = "Đối xứng góc" +"Mirror angle and length" = "Đối xứng góc và độ dài" +"Mirroring" = "Đối xứng tay nắm" +"Missing" = "Thiếu" +"Missing fonts" = "Phông chữ bị thiếu" +"Missing layer" = "Lớp bị thiếu" +"Missing style" = "Kiểu bị thiếu" +"Missing variable" = "Biến bị thiếu" +"Miter" = "Góc nhọn" +"Miter angle" = "Góc vát nhọn" +"Mixed" = "Hỗn hợp" +"Mixed fonts" = "Nhiều phông chữ" +"Mixed interactions: click + to replace them" = "Tương tác hỗn hợp: nhấp + để thay thế" +"Mobile app" = "Ứng dụng di động" +"Mode" = "Chế độ" +"Model" = "Mô hình" +"Models" = "Mô hình AI" +"Mono" = "Đơn sắc" +"More" = "Thêm" +"More instance actions" = "Thêm hành động cho bản thể" +"Mouse down" = "Nhấn chuột xuống" +"Mouse enter" = "Đưa chuột vào" +"Mouse leave" = "Đưa chuột ra" +"Mouse up" = "Nhả chuột" +"Move" = "Di chuyển" +"Move along the toolbar or the layer rows" = "Di chuyển dọc thanh công cụ hoặc các hàng lớp" +"Move column left" = "Chuyển cột sang trái" +"Move column right" = "Chuyển cột sang phải" +"Move down" = "Di chuyển xuống" +"Move in" = "Di chuyển vào" +"Move out" = "Di chuyển ra" +"Move tools" = "Công cụ di chuyển" +"Move up" = "Di chuyển lên" +"Moved to {name}" = "Đã chuyển sang {name}" +"Multi" = "Đa sắc" +"Multiply" = "Nhân" +"Muted" = "Trầm" +"Name" = "Tên" +"Name (A–Z)" = "Tên (A–Z)" +"Named instance" = "Bản thể có tên" +"Navigate to" = "Điều hướng đến" +"Nested instance" = "Bản thể lồng nhau" +"New design file" = "Tệp thiết kế mới" +"Newest first" = "Mới nhất trước" +"Next frame" = "Khung tiếp theo" +"Next or previous control in the focused region" = "Điều khiển tiếp theo hoặc trước đó trong vùng đang giữ tiêu điểm" +"Next ready for dev" = "Mục Sẵn sàng cho dev tiếp theo" +"Next size option" = "Tùy chọn kích thước tiếp theo" +"No assets: no export settings, icons or images. Add export settings in the Design tab." = "Không có tài nguyên: chưa có thiết lập xuất, biểu tượng hay hình ảnh. Hãy thêm thiết lập xuất trong thẻ Thiết kế." +"No boolean variables fit here." = "Không có biến boolean nào phù hợp tại đây." +"No boolean variables yet. Create them in Local variables." = "Chưa có biến boolean nào. Hãy tạo trong mục Biến cục bộ." +"No branches. A branch is a copy of the file to try changes in, then review and merge." = "Chưa có nhánh nào. Nhánh là bản sao của tệp để thử nghiệm thay đổi, sau đó xem xét và hợp nhất." +"No category" = "Không có danh mục" +"No changes" = "Không có thay đổi" +"No color styles" = "Không có kiểu màu" +"No colour variables fit here." = "Không có biến màu nào phù hợp tại đây." +"No colour variables yet. Create them in Local variables." = "Chưa có biến màu nào. Hãy tạo trong mục Biến cục bộ." +"No comments yet" = "Chưa có bình luận nào" +"No compatibility warnings reported" = "Không có cảnh báo tương thích nào" +"No components yet. Select layers and press {keys}." = "Chưa có thành phần nào. Hãy chọn các lớp và nhấn {keys}." +"No conflicts." = "Không có xung đột." +"No contributor data was built into this copy." = "Bản sao này không có dữ liệu người đóng góp." +"No device" = "Không có thiết bị" +"No files or templates match your search" = "Không có tệp hoặc mẫu nào khớp với tìm kiếm của bạn" +"No fonts match" = "Không có phông chữ nào khớp" +"No join code here (the server is older than join codes, or this address can't be put in one): share the link instead." = "Không có mã tham gia tại đây (máy chủ cũ hơn tính năng mã tham gia, hoặc địa chỉ này không thể tạo mã): hãy chia sẻ liên kết thay thế." +"No layer changes to show." = "Không có thay đổi lớp nào để hiển thị." +"No libraries yet. Add a .figcraft file that was published as a library, or paste a team library's link." = "Chưa có thư viện nào. Hãy thêm tệp .figcraft đã xuất bản làm thư viện, hoặc dán liên kết thư viện nhóm." +"No list" = "Không tạo danh sách" +"No matching comments" = "Không có bình luận phù hợp" +"No matching components" = "Không có thành phần phù hợp" +"No matching layers" = "Không có lớp phù hợp" +"No matching styles" = "Không có kiểu phù hợp" +"No matching variables" = "Không có biến phù hợp" +"No mirroring" = "Không đối xứng" +"No model credits were built into this copy." = "Bản sao này không có thông tin ghi nhận mô hình." +"No number variables fit here." = "Không có biến số nào phù hợp tại đây." +"No number variables yet. Create them in Local variables." = "Chưa có biến số nào. Hãy tạo trong mục Biến cục bộ." +"No other pages" = "Không có trang nào khác" +"No paints" = "Không có màu tô" +"No plugins on {server}." = "Không có plugin nào trên {server}." +"No plugins yet. Import a development plugin from its figcraft-plugin.json." = "Chưa có plugin nào. Hãy nhập một plugin phát triển từ tệp figcraft-plugin.json." +"No preferred components" = "Chưa có thành phần ưu tiên" +"No preset" = "Không có thiết lập sẵn" +"No saved versions yet. Save a version to mark a point in your work you can come back to." = "Chưa có phiên bản đã lưu nào. Hãy lưu một phiên bản để đánh dấu mốc công việc có thể quay lại sau." +"No scrolling" = "Không cuộn" +"No shortcuts match" = "Không có phím tắt nào khớp" +"No status" = "Không có trạng thái" +"No string variables fit here." = "Không có biến chuỗi nào phù hợp tại đây." +"No string variables yet. Create them in Local variables." = "Chưa có biến chuỗi nào. Hãy tạo trong mục Biến cục bộ." +"No styles yet." = "Chưa có kiểu nào." +"No styles yet. Click + to create one from the selection." = "Chưa có kiểu nào. Nhấp + để tạo kiểu từ vùng chọn." +"No templates match your search" = "Không có mẫu nào khớp với tìm kiếm của bạn" +"No text styles yet. Click + to create one from the selected text." = "Chưa có kiểu văn bản nào. Nhấp + để tạo kiểu từ văn bản đã chọn." +"No variables fit here." = "Không có biến nào phù hợp tại đây." +"No variables yet. Create them in Local variables." = "Chưa có biến nào. Hãy tạo trong mục Biến cục bộ." +"Nobody else is here yet" = "Chưa có ai khác ở đây" +"Noise" = "Nhiễu" +"None" = "Không có" +"None." = "Không có." +"Normal" = "Bình thường" +"Not bound" = "Chưa gắn biến" +"Not in a live session" = "Không ở trong phiên trực tiếp" +"Not in this font" = "Không có trong phông chữ này" +"Not properties, kept as written: {names}" = "Không phải thuộc tính, được giữ nguyên như đã viết: {names}" +"Not read yet" = "Chưa đọc" +"Not shared" = "Chưa chia sẻ" +"Note {n}" = "Ghi chú {n}" +"Nothing changed since this was marked ready for dev." = "Chưa có gì thay đổi kể từ khi được đánh dấu sẵn sàng cho dev." +"Nothing here yet. Set a frame's status to list it." = "Chưa có gì ở đây. Hãy đặt trạng thái cho một khung để hiển thị tại đây." +"Nothing online yet. Use Share on a file to put it online and it is listed here." = "Chưa có tệp trực tuyến nào. Hãy dùng nút Chia sẻ trên một tệp để đưa lên trực tuyến và tệp sẽ xuất hiện tại đây." +"Nothing to export" = "Không có gì để xuất" +"Nov" = "Thg 11" +"Now" = "Bây giờ" +"Nudge (Shift: big nudge)" = "Dịch nhẹ (Shift: dịch bước lớn)" +"Nudge amount" = "Mức dịch chuyển nhẹ" +"Number" = "Số" +"Number ↑" = "Số ↑" +"Number ↓" = "Số ↓" +"Numbered list" = "Danh sách đánh số" +"Object" = "Đối tượng" +"Oct" = "Thg 10" +"Off" = "Tắt" +"Offered first when filling the slot (any content is allowed)" = "Được đề xuất đầu tiên khi thêm vào ô chứa (cho phép mọi nội dung)" +"Offered first when swapping the instance (any component is allowed)" = "Được đề xuất đầu tiên khi hoán đổi bản thể (cho phép mọi thành phần)" +"Offset" = "Độ lệch" +"Oldest first" = "Cũ nhất trước" +"On click" = "Khi nhấp" +"On drag" = "Khi kéo" +"On this page" = "Trên trang này" +"One announcement in five common sizes: square, portrait, story, link and banner" = "Một thông báo với năm kích thước phổ biến: vuông, dọc, story, liên kết và biểu ngữ" +"Online" = "Trực tuyến" +"Online files" = "Tệp trực tuyến" +"Online sharing is off: files are shared on the local network only." = "Chia sẻ trực tuyến đang tắt: tệp chỉ được chia sẻ trong mạng cục bộ." +"Only the first changed layers are listed." = "Chỉ liệt kê những lớp thay đổi đầu tiên." +"Only the first {n} changed layers are listed." = "Chỉ liệt kê {n} lớp thay đổi đầu tiên." +"Only your threads" = "Chỉ luồng của bạn" +"Opacity" = "Độ mờ" +"Opacity & blend" = "Độ mờ & hòa trộn" +"Opacity 10%…90%, 0: 100%" = "Độ mờ 10%…90%, 0: 100%" +"Open" = "Mở" +"Open .figcraft, .svg or images" = "Mở tệp .figcraft, .svg hoặc hình ảnh" +"Open branch" = "Mở nhánh" +"Open file" = "Mở tệp" +"Open files" = "Các tệp đang mở" +"Open in focus view" = "Mở trong chế độ xem tập trung" +"Open in new window" = "Mở trong cửa sổ mới" +"Open invite links in FigCraft" = "Mở liên kết mời trong FigCraft" +"Open link" = "Mở liên kết" +"Open link {url}" = "Mở liên kết {url}" +"Open overlay" = "Mở lớp phủ" +"Open prototype preview" = "Mở xem trước nguyên mẫu" +"Open variables ({count})" = "Mở các biến ({count})" +"Opened as a new document" = "Đã mở dưới dạng tài liệu mới" +"Opened “{name}” in a new tab" = "Đã mở “{name}” trong thẻ mới" +"Opening the file…" = "Đang mở tệp…" +"Opening {n} files as new files" = { other = "Đang mở {n} tệp dưới dạng tệp mới" } +"Open|comments" = "Đang mở" +"Options" = "Tùy chọn" +"Orange" = "Cam" +"Order" = "Thứ tự" +"Other" = "Khác" +"Other apps may not open every .fig file exported here." = "Các ứng dụng khác có thể không mở được mọi tệp .fig xuất từ đây." +"Others lose access and keep their copy; the file stays on the server for you" = "Những người khác sẽ mất quyền truy cập và giữ lại bản sao của họ; tệp vẫn còn trên máy chủ cho bạn" +"Others type this under Share ▸ Join with a code" = "Người khác nhập mã này tại mục Chia sẻ ▸ Tham gia bằng mã" +"Outline stroke" = "Chuyển nét thành đường viền" +"Outline text" = "Chuyển văn bản thành đường viền" +"Outlines" = "Đường viền nét" +"Outside" = "Bên ngoài" +"Overflow" = "Nội dung tràn" +"Overlay" = "Lớp phủ" +"Overlay position" = "Vị trí lớp phủ" +"Overridden here (the collection it extends has another value)" = "Đã ghi đè tại đây (bộ sưu tập gốc có giá trị khác)" +"Overrides" = "Ghi đè" +"Owner token" = "Mã thông báo chủ sở hữu" +"Owner token copied" = "Đã sao chép mã thông báo chủ sở hữu" +"PDF print options" = "Tùy chọn in PDF" +"PDF print settings" = "Thiết lập in PDF" +"Padding" = "Đệm" +"Page" = "Trang" +"Page deleted" = "Đã xóa trang" +"Pages" = "Các trang" +"Pages added to the document" = "Các trang đã được thêm vào tài liệu" +"Pages: {pages}" = "Trang: {pages}" +"Paint bucket" = "Thùng sơn" +"Pan the canvas" = "Di chuyển vùng vẽ" +"Pan with nothing selected (Shift: farther)" = "Di chuyển vùng vẽ khi không chọn gì (Shift: xa hơn)" +"Panels" = "Bảng" +"Paper" = "Giấy" +"Paragraph indent" = "Thụt lề đoạn văn" +"Paragraph indent applies to left-aligned text" = "Thụt lề đoạn văn áp dụng cho văn bản căn trái" +"Paragraph spacing" = "Khoảng cách đoạn văn" +"Pass through" = "Xuyên qua" +"Paste a link (https://…)" = "Dán một liên kết (https://…)" +"Paste a team library link (a view link)" = "Dán liên kết thư viện nhóm (liên kết xem)" +"Paste here" = "Dán vào đây" +"Paste to replace" = "Dán để thay thế" +"Pasted design layers; {n} kinds of content were left out" = { other = "Đã dán các lớp thiết kế; {n} loại nội dung đã bị lược bỏ" } +"Pattern" = "Họa tiết" +"Pattern alignment" = "Căn chỉnh họa tiết" +"Pattern scale" = "Tỷ lệ họa tiết" +"Pattern source" = "Nguồn họa tiết" +"Pen" = "Bút" +"Pencil" = "Bút chì" +"People in this file" = "Những người trong tệp này" +"People join from anywhere with a code. The file is kept on {server} while you share it." = "Mọi người có thể tham gia từ bất kỳ đâu bằng mã. Tệp được lưu trên {server} trong khi bạn chia sẻ." +"People on your network join with a code. Nothing goes through a server." = "Mọi người trong mạng của bạn tham gia bằng mã. Không có dữ liệu nào đi qua máy chủ." +"Phone" = "Điện thoại" +"Pick color" = "Chọn màu" +"Pick color (I)" = "Chọn màu (I)" +"Pick one font family first" = "Hãy chọn một họ phông chữ trước" +"Pick the Frame tool, then drag on the canvas or choose a device size" = "Chọn công cụ Khung, sau đó kéo trên vùng vẽ hoặc chọn kích thước thiết bị" +"Pin a property" = "Ghim thuộc tính" +"Pinch" = "Bóp nhọn" +"Pixel grid" = "Lưới pixel" +"Pixel preview 1x" = "Xem trước pixel 1x" +"Pixel preview 2x" = "Xem trước pixel 2x" +"Place a shape or frame (its tool chosen)" = "Đặt hình dạng hoặc khung (khi đã chọn công cụ tương ứng)" +"Place automatically" = "Đặt tự động" +"Place image" = "Đặt hình ảnh" +"Placed on the current page" = "Đã đặt trên trang hiện tại" +"Playground" = "Sân thử nghiệm" +"Plugin" = "Plugin" +"Plugins" = "Plugin" +"Plugins & widgets" = "Plugin & tiện ích" +"Plugins run in FigCraft's sandbox, without files, network or clock. Install only plugins you trust." = "Plugin chạy trong môi trường cô lập của FigCraft, không truy cập tệp, mạng hay đồng hồ. Chỉ cài đặt những plugin bạn tin tưởng." +"Plus darker" = "Cộng tối hơn" +"Plus lighter" = "Cộng sáng hơn" +"Point" = "Điểm" +"Points" = "Các điểm" +"Polygon" = "Đa giác" +"Polygons" = "Đa giác" +"Port" = "Cổng" +"Position" = "Vị trí" +"Post" = "Đăng" +"Preferences" = "Tùy chọn" +"Preferred" = "Ưu tiên" +"Present" = "Trình chiếu" +"Present or preview" = "Trình chiếu hoặc xem trước" +"Present this flow" = "Trình chiếu luồng này" +"Presentation" = "Thuyết trình" +"Presentation slides" = "Trang trình chiếu" +"Presenting: comments" = "Khi trình chiếu: bình luận" +"Presenting: cycle the size options" = "Khi trình chiếu: chuyển đổi tùy chọn kích thước" +"Presenting: full screen" = "Khi trình chiếu: toàn màn hình" +"Presenting: next frame" = "Khi trình chiếu: khung tiếp theo" +"Presenting: previous frame" = "Khi trình chiếu: khung trước" +"Presenting: restart" = "Khi trình chiếu: bắt đầu lại" +"Preserve scroll position" = "Giữ nguyên vị trí cuộn" +"Presets" = "Thiết lập sẵn" +"Press a key…" = "Nhấn một phím…" +"Preview" = "Xem trước" +"Preview this flow" = "Xem trước luồng này" +"Preview this frame" = "Xem trước khung này" +"Previous frame" = "Khung trước" +"Previous ready for dev" = "Mục Sẵn sàng cho dev trước đó" +"Progressive" = "Lũy tiến" +"Properties" = "Thuộc tính" +"Prototype" = "Nguyên mẫu" +"Prototype preview" = "Xem trước nguyên mẫu" +"Prototype settings" = "Thiết lập nguyên mẫu" +"Publish" = "Xuất bản" +"Publish changes" = "Xuất bản thay đổi" +"Publish to another server…" = "Xuất bản lên máy chủ khác…" +"Publish to server" = "Xuất bản lên máy chủ" +"Published version {v}" = "Đã xuất bản phiên bản {v}" +"Published version {v} to the server" = "Đã xuất bản phiên bản {v} lên máy chủ" +"Published version {v}: save the file so other files can use it" = "Đã xuất bản phiên bản {v}: hãy lưu tệp để các tệp khác có thể sử dụng" +"Published · {people}" = "Đã xuất bản · {people}" +"Publishing to a server needs the desktop app; in the browser you can join a server's files" = "Cần ứng dụng máy tính để xuất bản lên máy chủ; trên trình duyệt bạn có thể tham gia các tệp trên máy chủ" +"Publishing with the server's key." = "Đang xuất bản bằng khóa của máy chủ." +"Publishing…" = "Đang xuất bản…" +"Push" = "Đẩy" +"Push changes to main component" = "Đẩy thay đổi lên thành phần chính" +"Put text on path" = "Đặt văn bản lên đường dẫn" +"R" = "R" +"Radial" = "Hướng tâm" +"Radius" = "Bán kính" +"Ratio" = "Tỷ lệ" +"Reading the library…" = "Đang đọc thư viện…" +"Ready for dev" = "Sẵn sàng cho dev" +"Real name" = "Tên thật" +"Recent" = "Gần đây" +"Recent files" = "Tệp gần đây" +"Recents" = "Gần đây" +"Recovered {n} unsaved files after the app quit unexpectedly: save them to keep them" = { other = "Đã khôi phục {n} tệp chưa lưu sau khi ứng dụng thoát đột ngột: hãy lưu lại để giữ chúng" } +"Rectangle" = "Hình chữ nhật" +"Rectangles" = "Hình chữ nhật" +"Red" = "Đỏ" +"Reduce motion" = "Giảm chuyển động" +"Refraction" = "Khúc xạ" +"Regular expression" = "Biểu thức chính quy" +"Relative to your system's display scaling (100% is the system's own size). Document zoom is separate." = "Tương ứng với tỷ lệ hiển thị của hệ thống (100% là kích thước chuẩn của hệ thống). Mức thu phóng tài liệu là riêng biệt." +"Remove" = "Xóa" +"Remove all" = "Xóa tất cả" +"Remove annotation" = "Xóa chú thích" +"Remove auto layout" = "Xóa bố cục tự động" +"Remove dev resource" = "Xóa tài nguyên dev" +"Remove export setting" = "Xóa thiết lập xuất" +"Remove from recents" = "Xóa khỏi danh sách gần đây" +"Remove from server" = "Xóa khỏi máy chủ" +"Remove from server…" = "Xóa khỏi máy chủ…" +"Remove guide" = "Xóa đường gióng" +"Remove interaction" = "Xóa tương tác" +"Remove library from this file" = "Xóa thư viện khỏi tệp này" +"Remove min and max" = "Xóa giới hạn tối thiểu và tối đa" +"Remove min and max height" = "Xóa chiều cao tối thiểu và tối đa" +"Remove min and max width" = "Xóa chiều rộng tối thiểu và tối đa" +"Remove regions" = "Xóa các vùng" +"Remove slot" = "Xóa ô chứa" +"Remove starting point" = "Xóa điểm bắt đầu" +"Remove stop" = "Xóa điểm dừng màu" +"Remove text from path" = "Gỡ văn bản khỏi đường dẫn" +"Remove the else and its actions" = "Xóa nhánh ngược lại và các hành động của nó" +"Remove this condition and its actions" = "Xóa điều kiện này và các hành động của nó" +"Remove this file from the server? It can't be shared or opened from there again. Your copy stays open here." = "Xóa tệp này khỏi máy chủ? Tệp sẽ không thể chia sẻ hay mở lại từ đó nữa. Bản sao của bạn vẫn mở tại đây." +"Remove {name} from session" = "Xóa {name} khỏi phiên" +"Remove {name} from {server}?" = "Xóa {name} khỏi {server}?" +"Removed" = "Đã xóa" +"Removed from the server" = "Đã xóa khỏi máy chủ" +"Removed since it was marked" = "Đã bị xóa kể từ khi đánh dấu" +"Rename" = "Đổi tên" +"Rename duplicated layers" = "Đổi tên các lớp nhân bản" +"Rename folder" = "Đổi tên thư mục" +"Rename group" = "Đổi tên nhóm" +"Rename layers" = "Đổi tên các lớp" +"Rename mode" = "Đổi tên chế độ" +"Rename on the server" = "Đổi tên trên máy chủ" +"Rename on the server…" = "Đổi tên trên máy chủ…" +"Rename page" = "Đổi tên trang" +"Rename to" = "Đổi tên thành" +"Reorder selection" = "Sắp xếp lại vùng chọn" +"Replace all" = "Thay thế tất cả" +"Replace mixed export settings" = "Thay thế thiết lập xuất hỗn hợp" +"Replace with" = "Thay thế bằng" +"Replace with a new interaction" = "Thay thế bằng tương tác mới" +"Reply" = "Trả lời" +"Report" = "Báo cáo" +"Report this file…" = "Báo cáo tệp này…" +"Reset" = "Đặt lại" +"Reset adjustments" = "Đặt lại điều chỉnh" +"Reset all changes" = "Đặt lại mọi thay đổi" +"Reset all overrides on this layer" = "Đặt lại mọi ghi đè trên lớp này" +"Reset overrides" = "Đặt lại ghi đè" +"Reset slot" = "Đặt lại ô chứa" +"Reset this override" = "Đặt lại ghi đè này" +"Reset to style" = "Đặt lại theo kiểu" +"Reset to the inherited value" = "Đặt lại về giá trị kế thừa" +"Resize by the nudge amount" = "Đổi kích thước theo mức dịch chuyển nhẹ" +"Resize frames to the device's screen (or the window without a device): their constraints and auto layout respond" = "Đổi kích thước khung theo màn hình thiết bị (hoặc cửa sổ nếu không có thiết bị): các ràng buộc và bố cục tự động sẽ tự điều chỉnh" +"Resize to fit" = "Đổi kích thước vừa khít" +"Resizing" = "Đổi kích thước" +"Resolve" = "Giải quyết" +"Resolve change" = "Giải quyết thay đổi" +"Resolved" = "Đã giải quyết" +"Resources" = "Tài nguyên" +"Responsive" = "Đáp ứng" +"Restart" = "Bắt đầu lại" +"Restore" = "Khôi phục" +"Restore main component" = "Khôi phục thành phần chính" +"Restore this version" = "Khôi phục phiên bản này" +"Restored “{name}”" = "Đã khôi phục “{name}”" +"Reverse the order" = "Đảo ngược thứ tự" +"Reversed triangle" = "Tam giác ngược" +"Review and merge" = "Xem xét và hợp nhất" +"Ribbon" = "Dải ruy băng" +"Right" = "Phải" +"Right padding" = "Đệm phải" +"Right side" = "Cạnh phải" +"Right side width" = "Độ rộng cạnh phải" +"Rotate 90°" = "Xoay 90°" +"Rotate 90° right" = "Xoay 90° sang phải" +"Rotate to landscape" = "Xoay sang chiều ngang" +"Rotate to portrait" = "Xoay sang chiều dọc" +"Rotation" = "Góc xoay" +"Rotation jitter" = "Độ ngẫu nhiên góc xoay" +"Round" = "Tròn" +"Rounded" = "Bo tròn" +"Row" = "Hàng" +"Row gap" = "Khoảng hở hàng" +"Row sizes" = "Kích thước hàng" +"Row span" = "Số hàng gộp" +"Rows" = "Các hàng" +"Rows {count}" = "Hàng {count}" +"Rulers" = "Thước" +"Run" = "Chạy" +"Run {label}" = "Chạy {label}" +"SHA-256: {sha}…" = "SHA-256: {sha}…" +"Same as layer" = "Giống như lớp" +"Saturation" = "Độ bão hòa" +"Save" = "Lưu" +"Save as" = "Lưu thành" +"Save as preset…" = "Lưu thành thiết lập sẵn…" +"Save files automatically" = "Tự động lưu tệp" +"Save version {key}" = "Lưu phiên bản {key}" +"Saved" = "Đã lưu" +"Saved {name}" = "Đã lưu {name}" +"Say something" = "Nhập nội dung trò chuyện" +"Scale" = "Tỷ lệ" +"Scatter" = "Phân tán" +"Scoping: where pickers offer it" = "Phạm vi: nơi biến xuất hiện trong bộ chọn" +"Screen" = "Màn lọc" +"Scroll behavior" = "Hành vi cuộn" +"Scroll to" = "Cuộn tới" +"Scroll to layer" = "Cuộn tới lớp" +"Scroll with parent" = "Cuộn theo lớp cha" +"Search" = "Tìm kiếm" +"Search actions, layers and tools" = "Tìm kiếm hành động, lớp và công cụ" +"Search assets" = "Tìm tài nguyên" +"Search comments" = "Tìm bình luận" +"Search files and templates" = "Tìm tệp và mẫu" +"Search fonts" = "Tìm phông chữ" +"Search layers" = "Tìm lớp" +"Search pages" = "Tìm trang" +"Search plugins" = "Tìm plugin" +"Search results" = "Kết quả tìm kiếm" +"Search shortcuts" = "Tìm phím tắt" +"Search templates" = "Tìm mẫu" +"Section" = "Phần" +"Section color" = "Màu phần" +"Sections" = "Các phần" +"See all templates" = "Xem tất cả mẫu" +"Select a frame and add a starting point to present it as a flow." = "Hãy chọn một khung và thêm điểm bắt đầu để trình chiếu thành một luồng." +"Select a frame to preview it" = "Chọn một khung để xem trước" +"Select a layer to see its properties and code" = "Chọn một lớp để xem thuộc tính và mã nguồn" +"Select all" = "Chọn tất cả" +"Select all with same" = "Chọn tất cả có cùng" +"Select layer" = "Chọn lớp" +"Select layers and they space themselves as their content changes" = "Chọn các lớp để chúng tự động giãn cách khi nội dung thay đổi" +"Select layers to apply the style to" = "Chọn các lớp để áp dụng kiểu" +"Select layers with this color" = "Chọn các lớp có màu này" +"Select overlapping shapes" = "Chọn các hình chồng lên nhau" +"Select points to edit their position, radius and mirroring" = "Chọn các điểm để chỉnh sửa vị trí, bán kính và đối xứng tay nắm" +"Select slot" = "Chọn ô chứa" +"Selection" = "Vùng chọn" +"Selection box, {w} by {h} at {x}, {y}: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Khung chọn, {w} × {h} tại {x}, {y}: phím mũi tên để di chuyển, Shift+mũi tên hoặc {cmd}+mũi tên để đổi kích thước, Enter để chọn, Escape để hủy" +"Selection box: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "Khung chọn: phím mũi tên để di chuyển, Shift+mũi tên hoặc {cmd}+mũi tên để đổi kích thước, Enter để chọn, Escape để hủy" +"Selection colors" = "Màu của vùng chọn" +"Send backward" = "Đưa lùi một lớp" +"Send report" = "Gửi báo cáo" +"Send to back" = "Đưa xuống dưới cùng" +"Sep" = "Thg 9" +"Server address" = "Địa chỉ máy chủ" +"Server address (ws://host:47900/)" = "Địa chỉ máy chủ (ws://host:47900/)" +"Server for online sharing" = "Máy chủ chia sẻ trực tuyến" +"Set as default" = "Đặt làm mặc định" +"Set variable" = "Đặt biến" +"Set variable mode" = "Đặt chế độ biến" +"Set variable {name}" = "Đặt biến {name}" +"Set {name} to {value}" = "Đặt {name} thành {value}" +"Shadows" = "Vùng tối" +"Shape" = "Hình dạng" +"Shape builder" = "Tạo hình" +"Shape tools" = "Công cụ hình dạng" +"Share" = "Chia sẻ" +"Share this file" = "Chia sẻ tệp này" +"Share with a code" = "Chia sẻ bằng mã" +"Share: live session, export" = "Chia sẻ: phiên trực tiếp, xuất tệp" +"Shared" = "Đã chia sẻ" +"Shared: copy its code from the file's menu" = "Đã chia sẻ: sao chép mã từ trình đơn của tệp" +"Sharing a file needs the desktop app; here you can join one." = "Cần ứng dụng máy tính để chia sẻ tệp; tại đây bạn có thể tham gia một phiên." +"Sharing on the local network (online sharing is off: no server is set in Preferences)." = "Đang chia sẻ trên mạng cục bộ (chia sẻ trực tuyến đang tắt: chưa đặt máy chủ trong Tùy chọn)." +"Sharing on your network · {people}" = "Đang chia sẻ trên mạng của bạn · {people}" +"Sharing online · {people}" = "Đang chia sẻ trực tuyến · {people}" +"Sharing stopped: the file stays on the server, open only to you" = "Đã dừng chia sẻ: tệp vẫn còn trên máy chủ và chỉ mình bạn mở được" +"Show" = "Hiện" +"Show all templates" = "Hiện tất cả mẫu" +"Show as grid" = "Hiện dạng lưới" +"Show as list" = "Hiện dạng danh sách" +"Show autosaves" = "Hiện các bản tự động lưu" +"Show behind transparent areas" = "Hiện phía sau vùng trong suốt" +"Show comments (Shift+C)" = "Hiện bình luận (Shift+C)" +"Show device frame" = "Hiện khung thiết bị" +"Show dimensions on objects" = "Hiện kích thước trên đối tượng" +"Show hotspot hints" = "Hiện gợi ý vùng tương tác" +"Show in Explorer" = "Hiện trong Explorer" +"Show in Finder" = "Hiện trong Finder" +"Show in folder" = "Hiện trong thư mục" +"Show only this on the canvas" = "Chỉ hiện mục này trên vùng vẽ" +"Show open" = "Hiện mục đang mở" +"Show section contents" = "Hiện nội dung phần" +"Show this layer" = "Hiện lớp này" +"Show usage" = "Hiện nơi sử dụng" +"Show/Hide" = "Hiện/Ẩn" +"Show/Hide UI" = "Hiện/Ẩn giao diện" +"Side by side" = "Cạnh nhau" +"Sidebar" = "Thanh bên" +"Simplify stroke" = "Đơn giản hóa nét" +"Size" = "Kích thước" +"Size jitter" = "Độ ngẫu nhiên kích thước" +"Skip ink" = "Chừa nét chữ dưới" +"Slashed zero" = "Số 0 gạch chéo" +"Slice" = "Lát cắt" +"Slices" = "Các lát cắt" +"Slide in" = "Trượt vào" +"Slide out" = "Trượt ra" +"Slot" = "Ô chứa" +"Slot content" = "Nội dung ô chứa" +"Small capitals" = "Chữ hoa nhỏ" +"Small caps" = "Chữ hoa nhỏ" +"Smart animate" = "Hoạt ảnh thông minh" +"Snap to pixel grid" = "Bắt dính vào lưới pixel" +"Social and slides" = "Mạng xã hội và trang chiếu" +"Social media" = "Mạng xã hội" +"Social post sizes" = "Kích thước bài đăng mạng xã hội" +"Soft light" = "Ánh sáng dịu" +"Solid" = "Đặc" +"Some variants have the same property values: give each one a unique combination" = "Một số biến thể có cùng giá trị thuộc tính: hãy đặt cho mỗi biến thể một tổ hợp duy nhất" +"Sort" = "Sắp xếp" +"Sort by" = "Sắp xếp theo" +"Sort by date" = "Sắp xếp theo ngày" +"Sort by page" = "Sắp xếp theo trang" +"Sort by {column}" = "Sắp xếp theo {column}" +"Space around" = "Cách đều xung quanh" +"Space between" = "Cách đều giữa các mục" +"Space drag" = "Space kéo" +"Space evenly" = "Cách đều bằng nhau" +"Space+drag" = "Space+kéo" +"Spacing" = "Khoảng cách" +"Spam, stolen work, abuse…" = "Thư rác, đánh cắp tác phẩm, lạm dụng…" +"Splay" = "Xòe tia" +"Spotlight me" = "Chiếu tâm điểm vào tôi" +"Spread" = "Độ lan" +"Square" = "Hình vuông" +"Standard" = "Tiêu chuẩn" +"Standard ligatures" = "Chữ ghép tiêu chuẩn" +"Star" = "Ngôi sao" +"Stars" = "Các ngôi sao" +"Start" = "Bắt đầu" +"Start ascending from / stop descending at" = "Bắt đầu tăng dần từ / dừng giảm dần tại" +"Start from a blank canvas" = "Bắt đầu từ vùng vẽ trống" +"Start from a template" = "Bắt đầu từ một mẫu" +"Start on path" = "Điểm bắt đầu trên đường dẫn" +"Start on the Home screen" = "Khởi động tại màn hình Trang chủ" +"Start point" = "Điểm đầu" +"Start sharing" = "Bắt đầu chia sẻ" +"Start sharing with the Share button, then pass on the code it gives" = "Bắt đầu chia sẻ bằng nút Chia sẻ, sau đó gửi mã nhận được cho người khác" +"Starting to share…" = "Đang bắt đầu chia sẻ…" +"Status" = "Trạng thái" +"Sticky" = "Ghim cố định khi cuộn" +"Stop" = "Dừng" +"Stop following {name}" = "Dừng theo dõi {name}" +"Stop session" = "Dừng phiên" +"Stop sharing" = "Dừng chia sẻ" +"Stop spotlighting" = "Dừng chiếu tâm điểm" +"Stop {n} {hex}" = "Điểm dừng {n} {hex}" +"Stretch" = "Kéo giãn" +"Strikethrough" = "Gạch ngang chữ" +"String" = "Chuỗi" +"Stroke" = "Nét" +"Stroke style" = "Kiểu nét" +"Stroke weight" = "Độ dày nét" +"Strokes" = "Các nét" +"Style" = "Kiểu" +"Styles" = "Các kiểu" +"Stylistic set 1" = "Bộ kiểu chữ 1" +"Stylistic set 2" = "Bộ kiểu chữ 2" +"Stylistic set 3" = "Bộ kiểu chữ 3" +"Stylistic set 4" = "Bộ kiểu chữ 4" +"Stylistic set 5" = "Bộ kiểu chữ 5" +"Subtract" = "Trừ" +"Subtracts" = "Phép trừ" +"Suffix" = "Hậu tố" +"Suspend snapping while dragging" = "Tạm ngừng bắt dính khi đang kéo" +"Swap instance" = "Hoán đổi bản thể" +"Swap library: use another library's assets of the same names" = "Hoán đổi thư viện: dùng tài nguyên cùng tên từ một thư viện khác" +"Swap orientation" = "Đổi chiều ngang/dọc" +"Swap overlay" = "Hoán đổi lớp phủ" +"Swap to {name}" = "Hoán đổi sang {name}" +"Swap width and height" = "Đổi chiều rộng và chiều cao" +"Swapped instance" = "Bản thể đã hoán đổi" +"Swapped {n} assets" = { other = "Đã hoán đổi {n} tài nguyên" } +"Swapped {n} assets; {missed} had no match and still use the old library" = { other = "Đã hoán đổi {n} tài nguyên; {missed} mục không khớp và vẫn dùng thư viện cũ" } +"Sweep" = "Góc quét" +"System" = "Hệ thống" +"Tab / Shift+Tab" = "Tab / Shift+Tab" +"Table" = "Bảng" +"Tablet" = "Máy tính bảng" +"Tabular numbers" = "Chữ số thẳng cột" +"Take the values from the first selected layer" = "Lấy giá trị từ lớp được chọn đầu tiên" +"Taper" = "Thuôn nhọn" +"Taper both ends" = "Thuôn nhọn cả hai đầu" +"Tell the server's operator what is wrong with it" = "Cho người vận hành máy chủ biết vấn đề của tệp này" +"Temperature" = "Nhiệt độ màu" +"Template" = "Mẫu" +"Templates" = "Các mẫu" +"Terms" = "Điều khoản" +"Text" = "Văn bản" +"Text align" = "Căn chỉnh văn bản" +"Text content" = "Nội dung văn bản" +"Text style" = "Kiểu văn bản" +"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 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." +"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." = "Tệp sẽ bị xóa khỏi máy chủ: không ai có thể mở hoặc tham gia tệp từ đó nữa, và thao tác này không thể hoàn tác. Các bản sao đang mở vẫn được giữ lại ở máy người dùng." +"The file now holds another library" = "Tệp hiện chứa một thư viện khác" +"The file now holds another library (\"{name}\")" = "Tệp hiện chứa một thư viện khác (\"{name}\")" +"The files you shared or published online from this computer. They stay on their server until you remove them." = "Các tệp bạn đã chia sẻ hoặc xuất bản trực tuyến từ máy tính này. Chúng sẽ được lưu trên máy chủ cho đến khi bạn xóa." +"The link carries the session's secret: share it only with people you invite." = "Liên kết chứa khóa bí mật của phiên: chỉ chia sẻ với những người bạn mời." +"The name in your online files and on the server. The document inside keeps its own name." = "Tên hiển thị trong danh sách tệp trực tuyến của bạn và trên máy chủ. Tài liệu bên trong vẫn giữ tên riêng của nó." +"The selection uses several text styles: click to apply one" = "Vùng chọn đang dùng nhiều kiểu văn bản: nhấp để áp dụng một kiểu" +"The server deletes this file if nobody opens it before {date}." = "Máy chủ sẽ xóa tệp này nếu không ai mở trước {date}." +"The whole file" = "Toàn bộ tệp" +"The window is too small for {size}%, so the interface is drawn at {drawn}%. Make the window larger to use {size}%." = "Cửa sổ quá nhỏ cho mức {size}%, nên giao diện được hiển thị ở mức {drawn}%. Hãy phóng rộng cửa sổ để dùng mức {size}%." +"Theme" = "Giao diện" +"There's no destination for that action" = "Không có đích đến cho hành động đó" +"Thickness" = "Độ dày" +"This branch can't be reviewed: {e}" = "Không thể xem xét nhánh này: {e}" +"This branch was merged or archived." = "Nhánh này đã được hợp nhất hoặc lưu trữ." +"This computer only" = "Chỉ máy tính này" +"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." = "Máy tính này ghi nhớ mã thông báo chủ sở hữu để bạn có thể quản lý tệp từ danh sách Trực tuyến ở màn hình Trang chủ. Hãy sao chép mã này nếu muốn quản lý tệp từ nơi khác: đây là mật khẩu của tệp và sẽ không hiển thị lại." +"This condition is edited as an expression" = "Điều kiện này được chỉnh sửa dưới dạng biểu thức" +"This file" = "Tệp này" +"This file has unsaved changes" = "Tệp này có thay đổi chưa lưu" +"This file is on {server}, open only to you. Share it to let others in with a new code." = "Tệp này đang ở trên {server} và chỉ mình bạn mở được. Hãy chia sẻ để người khác tham gia bằng mã mới." +"This file is too large to join here (up to {mb} MB)" = "Tệp này quá lớn để tham gia tại đây (tối đa {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." = "Tệp này sử dụng phông chữ chưa được cài đặt trên máy tính này. Văn bản sẽ hiển thị bằng phông chữ dự phòng cho đến khi bạn cài đặt chúng." +"This frame is new on the branch." = "Khung này là mới trên nhánh." +"This frame isn't on the branch." = "Khung này không có trên nhánh." +"This server is open to the public: no key needed." = "Máy chủ này mở công khai: không cần khóa." +"This server needs its key: add ?key=… to the address (`figcraft-server key` prints it on the server's machine)." = "Máy chủ này yêu cầu khóa: hãy thêm ?key=… vào địa chỉ (`figcraft-server key` sẽ in khóa trên máy chủ)." +"This server takes files only with its key: see Advanced." = "Máy chủ này chỉ nhận tệp khi có khóa: xem phần Nâng cao." +"Tidy up" = "Sắp xếp gọn" +"Tile" = "Lặp ô" +"Tile type" = "Kiểu lặp ô" +"Tint" = "Sắc thái" +"Title" = "Tiêu đề" +"Title case" = "Viết hoa đầu từ" +"To share this library with your team, publish the file to a server (Share ▸ Publish to server…), then publish the library there." = "Để chia sẻ thư viện này với nhóm của bạn, hãy xuất bản tệp lên máy chủ (Chia sẻ ▸ Xuất bản lên máy chủ…), sau đó xuất bản thư viện tại đó." +"Toggle" = "Bật/tắt" +"Toggle light/dark theme" = "Chuyển đổi giao diện sáng/tối" +"Toggle visibility" = "Bật/tắt hiển thị" +"Tools" = "Công cụ" +"Top" = "Trên" +"Top & bottom" = "Trên & dưới" +"Top left radius" = "Bán kính góc trên trái" +"Top padding" = "Đệm trên" +"Top right radius" = "Bán kính góc trên phải" +"Transform" = "Biến đổi" +"Triangle arrow" = "Mũi tên tam giác" +"Trigger" = "Kích hoạt" +"True" = "Đúng" +"Truncate text" = "Cắt bớt văn bản" +"Truncate with an ellipsis" = "Cắt bớt bằng dấu ba chấm" +"Try again" = "Thử lại" +"Try another search or filter." = "Hãy thử từ khóa hoặc bộ lọc khác." +"Try another search, or browse templates." = "Hãy thử tìm kiếm khác, hoặc duyệt các mẫu." +"Try another word, or look at every kind." = "Hãy thử từ khác, hoặc xem tất cả các loại." +"Turn a layer into a component, reuse it, and change every copy at once" = "Biến một lớp thành thành phần, tái sử dụng và cập nhật mọi bản sao cùng lúc" +"Two digits" = "Hai chữ số" +"Type" = "Loại" +"Type settings" = "Thiết lập kiểu chữ" +"Type the join code you were given, or paste an invite link." = "Nhập mã tham gia bạn được cấp, hoặc dán liên kết mời." +"Typography" = "Kiểu chữ" +"Underline" = "Gạch chân" +"Undo takes back only your own changes; what others changed since stays." = "Hoàn tác chỉ quay lại các thay đổi của riêng bạn; những gì người khác đã thay đổi vẫn giữ nguyên." +"Ungroup" = "Bỏ nhóm" +"Uniform" = "Đồng đều" +"Union" = "Hợp" +"Unions" = "Phép hợp" +"Unknown — treated as sRGB" = "Không rõ — được xử lý như sRGB" +"Unread" = "Chưa đọc" +"Unresolve" = "Mở lại bình luận" +"Unsaved changes" = "Thay đổi chưa lưu" +"Unsaved changes in {names}. Close the window and lose them?" = "Có thay đổi chưa lưu trong {names}. Đóng cửa sổ và hủy bỏ các thay đổi này?" +"Unsaved changes: save first ({save}), or close the tab with {alt}-click to discard" = "Có thay đổi chưa lưu: hãy lưu trước ({save}), hoặc giữ {alt} khi nhấp đóng thẻ để hủy bỏ" +"Unsaved changes: save first, or close again with {key} to discard" = "Có thay đổi chưa lưu: hãy lưu trước, hoặc đóng lại lần nữa bằng {key} để hủy bỏ" +"Up" = "Lên" +"Update" = "Cập nhật" +"Update from main" = "Cập nhật từ nhánh chính" +"Update from selection" = "Cập nhật từ vùng chọn" +"Update plugin" = "Cập nhật plugin" +"Updated {components} and {styles}" = "Đã cập nhật {components} và {styles}" +"Updated {name}" = "Đã cập nhật {name}" +"Updating the graphics driver often helps. To use OpenGL only, start FigCraft from a Command Prompt with:" = "Việc cập nhật trình điều khiển đồ họa thường sẽ khắc phục được lỗi. Để chỉ sử dụng OpenGL, hãy khởi chạy FigCraft từ Command Prompt bằng:" +"Updating the graphics driver often helps. WGPU_BACKEND (vulkan, gl, metal) names another graphics API to try." = "Việc cập nhật trình điều khiển đồ họa thường sẽ khắc phục được lỗi. Biến WGPU_BACKEND (vulkan, gl, metal) cho phép thử một API đồ họa khác." +"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." = "Tải tệp này lên máy chủ FigCraft và giữ thẻ này đồng bộ với máy chủ. Bạn sẽ nhận được một liên kết chỉnh sửa và một liên kết xem." +"Uppercase" = "Chữ hoa" +"Use a fixed value" = "Dùng giá trị cố định" +"Use an expression, e.g. count + 1" = "Dùng biểu thức, ví dụ: count + 1" +"Use as mask" = "Dùng làm mặt nạ" +"Use auto layout" = "Dùng bố cục tự động" +"Use number keys for opacity" = "Dùng phím số để chỉnh độ mờ" +"Use the .figcraft or .fig extension." = "Hãy dùng phần mở rộng .figcraft hoặc .fig." +"Use the layer's fill" = "Dùng màu tô của lớp" +"Use your browser's zoom to change the interface size." = "Hãy dùng tính năng thu phóng của trình duyệt để thay đổi kích thước giao diện." +"Used in {files} · {instances}" = "Được dùng trong {files} · {instances}" +"Username" = "Tên người dùng" +"Uses variables: each layer shows them in its own mode" = "Có sử dụng biến: mỗi lớp hiển thị giá trị theo chế độ riêng của lớp đó" +"Value" = "Giá trị" +"Variable" = "Biến" +"Variable collections" = "Bộ sưu tập biến" +"Variable modes" = "Chế độ biến" +"Variable width" = "Độ rộng biến thiên" +"Variables" = "Các biến" +"Variables JSON…" = "JSON biến…" +"Variables store reusable values (colours, numbers, strings, booleans) with modes such as Light and Dark." = "Biến lưu trữ các giá trị tái sử dụng (màu sắc, số, chuỗi, boolean) theo các chế độ như Sáng và Tối." +"Variant" = "Biến thể" +"Vector" = "Vector" +"Vectors" = "Vector" +"Version" = "Phiên bản" +"Version history" = "Lịch sử phiên bản" +"Version {version}" = "Phiên bản {version}" +"Version {v} · {components} · {styles} · {variables}" = "Phiên bản {v} · {components} · {styles} · {variables}" +"Vertical" = "Dọc" +"Vertical align" = "Căn dọc" +"Vertical hex" = "Lục giác dọc" +"Vertical padding" = "Đệm dọc" +"Vertical spacing" = "Khoảng cách dọc" +"Vertical trim" = "Cắt gọn khoảng đệm dọc" +"View" = "Xem" +"View link" = "Liên kết xem" +"View link copied" = "Đã sao chép liên kết xem" +"View only" = "Chỉ xem" +"View only: you see every change as it happens but can't edit. Leave to keep a copy you can edit." = "Chỉ xem: bạn thấy mọi thay đổi theo thời gian thực nhưng không thể chỉnh sửa. Hãy rời phiên để giữ lại một bản sao có thể chỉnh sửa." +"Viewing “{name}”" = "Đang xem “{name}”" +"Violet" = "Tím" +"Visibility" = "Hiển thị" +"Visible" = "Hiển thị" +"Vivid" = "Rực rỡ" +"WGPU_BACKEND is set and names the graphics API to use; unsetting it lets FigCraft choose." = "Biến WGPU_BACKEND đang được đặt để chỉ định API đồ họa; hãy bỏ đặt biến này để FigCraft tự chọn." +"Warm" = "Ấm" +"Watch" = "Đồng hồ" +"Wavy" = "Lượn sóng" +"Web" = "Web" +"WebSocket URL" = "URL WebSocket" +"WebSocket URL copied" = "Đã sao chép URL WebSocket" +"Websites" = "Trang web" +"Wedge" = "Hình nêm" +"Weight" = "Độ dày" +"What changed since it was marked ready for dev" = "Những thay đổi kể từ khi được đánh dấu sẵn sàng cho dev" +"What is wrong with this file? The server's operator gets your report." = "Tệp này có vấn đề gì? Người vận hành máy chủ sẽ nhận được báo cáo của bạn." +"What it's for" = "Mục đích sử dụng" +"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." = "Không rõ trạng thái trước khi thay đổi: khung đã thay đổi trước khi FigCraft lưu bản sao của các khung sẵn sàng cho dev. Hãy giải quyết thay đổi (hoặc đánh dấu sẵn sàng lại) để so sánh từ nay về sau." +"What you try here changes this preview and the code below, not the file" = "Những gì bạn thử tại đây chỉ làm thay đổi bản xem trước này và đoạn mã bên dưới, không thay đổi tệp" +"While hovering" = "Khi di chuột qua" +"While pressing" = "Khi nhấn giữ" +"White" = "Trắng" +"Who runs it, its terms and how long it keeps files" = "Đơn vị vận hành, điều khoản và thời gian lưu giữ tệp" +"Why it changed" = "Lý do thay đổi" +"Widget" = "Tiện ích" +"Widgets" = "Các tiện ích" +"Width" = "Chiều rộng" +"Width point" = "Điểm độ rộng" +"Width profile" = "Biên dạng độ rộng" +"Wireframe kit" = "Bộ khung dây (Wireframe)" +"With the layers' export settings" = "Theo thiết lập xuất của các lớp" +"Wrap" = "Ngắt dòng" +"Wrap in new section" = "Bọc trong phần mới" +"Yellow" = "Vàng" +"Yesterday" = "Hôm qua" +"You" = "Bạn" +"You'll get the shared file as a new tab and edit it together." = "Bạn sẽ nhận được tệp chia sẻ trong một thẻ mới và cùng nhau chỉnh sửa." +"You're spotlighting: everyone follows your view" = "Bạn đang chiếu tâm điểm: mọi người đang theo dõi khung nhìn của bạn" +"Your copy of the file stays open" = "Bản sao tệp của bạn vẫn mở" +"Your copy stays open; the file stays on the server" = "Bản sao của bạn vẫn mở; tệp vẫn được lưu trên máy chủ" +"Your name" = "Tên của bạn" +"Your name in comments" = "Tên của bạn trong bình luận" +"Your system asks for reduced motion: animations stay off." = "Hệ thống của bạn yêu cầu giảm chuyển động: các hoạt ảnh sẽ được tắt." +"Z" = "Z" +"Z to A" = "Z đến A" +"Zoom" = "Thu phóng" +"Zoom around the pointer" = "Thu phóng quanh con trỏ" +"Zoom device to fill window" = "Thu phóng thiết bị lấp đầy cửa sổ" +"Zoom in" = "Phóng to" +"Zoom out" = "Thu nhỏ" +"Zoom to 100%" = "Thu phóng về 100%" +"Zoom to 200%" = "Thu phóng về 200%" +"Zoom to 50%" = "Thu phóng về 50%" +"Zoom to fit" = "Thu phóng vừa khít" +"Zoom to selection" = "Thu phóng vừa vùng chọn" +"Zoom tool: click to zoom in, drag an area" = "Công cụ thu phóng: nhấp để phóng to, kéo chọn vùng" +"Zoom tool: zoom out" = "Công cụ thu phóng: thu nhỏ" +"and {n} more" = { other = "và {n} mục nữa" } +"bleed marks" = "dấu tràn lề" +"by {author}" = "bởi {author}" +"call any command its access allows" = "gọi bất kỳ lệnh nào mà quyền truy cập cho phép" +"call only: {commands}" = "chỉ gọi: {commands}" +"can edit the document" = "có thể chỉnh sửa tài liệu" +"conditional prototype actions nested too deeply were skipped" = "đã bỏ qua các hành động nguyên mẫu có điều kiện lồng quá sâu" +"conditional prototype actions with conditions that can't be evaluated were skipped" = "đã bỏ qua các hành động nguyên mẫu có điều kiện không thể tính giá trị" +"connector label background was skipped: style data is missing" = "đã bỏ qua nền nhãn đường nối: thiếu dữ liệu kiểu" +"connector label was skipped: background bounds are invalid" = "đã bỏ qua nhãn đường nối: khung giới hạn nền không hợp lệ" +"connector label was skipped: background transform is invalid" = "đã bỏ qua nhãn đường nối: phép biến đổi nền không hợp lệ" +"connector label was skipped: composed text transform is invalid" = "đã bỏ qua nhãn đường nối: phép biến đổi văn bản tổng hợp không hợp lệ" +"connector label was skipped: derived background bounds are missing" = "đã bỏ qua nhãn đường nối: thiếu khung giới hạn nền suy dẫn" +"connector label was skipped: derived text bounds are missing" = "đã bỏ qua nhãn đường nối: thiếu khung giới hạn văn bản suy dẫn" +"connector label was skipped: text bounds are invalid" = "đã bỏ qua nhãn đường nối: khung giới hạn văn bản không hợp lệ" +"connector label was skipped: text style data is missing" = "đã bỏ qua nhãn đường nối: thiếu dữ liệu kiểu văn bản" +"connector label was skipped: text transform is invalid" = "đã bỏ qua nhãn đường nối: phép biến đổi văn bản không hợp lệ" +"connector labels were skipped" = "đã bỏ qua các nhãn đường nối" +"connector layers import as static frame/vector snapshots with labels when present; live endpoint bindings are not retained" = "các lớp đường nối được nhập dưới dạng khung/vector tĩnh kèm theo nhãn nếu có; liên kết động ở hai đầu mút không được giữ lại" +"connector snapshot vector data is missing; connector was left empty" = "thiếu dữ liệu vector tĩnh của đường nối; đường nối được để trống" +"connectors whose ends can't be placed are empty" = "các đường nối không thể đặt hai đầu mút sẽ được để trống" +"crop marks" = "dấu xén" +"damaged vector geometry was skipped" = "đã bỏ qua hình học vector bị hỏng" +"damaged vector networks import as outlines" = "mạng vector bị hỏng được nhập dưới dạng đường viền" +"development: {path}" = "phát triển: {path}" +"document children other than pages were skipped" = "đã bỏ qua các mục con của tài liệu không phải là trang" +"duplicate grid track sizing entries use equal tracks" = "các mục kích thước dải lưới trùng lặp sẽ dùng kích thước dải bằng nhau" +"e.g. count + 1" = "ví dụ: count + 1" +"e.g. count >= 3 and not done" = "ví dụ: count >= 3 and not done" +"elbowed and curved connectors without a saved path import as straight lines" = "các đường nối gấp khúc và cong không có đường dẫn đã lưu được nhập thành đường thẳng" +"entries without a node type were skipped" = "đã bỏ qua các mục không có loại nút" +"figcraft:// links from a browser, chat or email open this app and join the session." = "Liên kết figcraft:// từ trình duyệt, ứng dụng trò chuyện hoặc email sẽ mở ứng dụng này và tham gia phiên." +"filled areas of a vector with their own fill use the layer's fill" = "các vùng tô riêng trong một vector sẽ dùng màu tô của lớp" +"from {server}" = "từ {server}" +"gamepad triggers without exactly one known controller button were skipped" = "đã bỏ qua các kích hoạt tay cầm không có đúng một nút điều khiển đã biết" +"grid track list exceeds 1000 entries; the tracks use the default equal sizing" = "danh sách dải lưới vượt quá 1000 mục; các dải sẽ dùng kích thước đều nhau mặc định" +"grid track sizing is unsupported or malformed; affected tracks use equal sizing" = "kích thước dải lưới không được hỗ trợ hoặc sai định dạng; các dải bị ảnh hưởng sẽ dùng kích thước đều nhau" +"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "danh sách kích thước dải lưới vượt quá 1000 mục; các dải sẽ dùng kích thước đều nhau mặc định" +"hidden" = "đã ẩn" +"iOS" = "iOS" +"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "bộ lọc hình ảnh không rõ ràng do có cả hai vùng chứa bộ lọc; đã bỏ qua chuyển đổi bộ lọc" +"image filters use FigCraft's approximate renderer" = "bộ lọc hình ảnh sử dụng bộ kết xuất xấp xỉ của FigCraft" +"instance swap properties whose default component isn't in the file were skipped" = "đã bỏ qua các thuộc tính hoán đổi bản thể có thành phần mặc định không nằm trong tệp" +"instances inside their own main component were imported as frames" = "các bản thể nằm bên trong chính thành phần chính của chúng đã được nhập thành khung" +"instances of components that aren't in the file show no layers" = "các bản thể của thành phần không có trong tệp sẽ không hiển thị lớp nào" +"instances of components that aren't in the file were imported as frames" = "các bản thể của thành phần không có trong tệp đã được nhập thành khung" +"instances that would nest a component inside itself were imported as frames" = "các bản thể gây lồng thành phần vào chính nó đã được nhập thành khung" +"instances without a main component were imported as empty frames" = "các bản thể không có thành phần chính đã được nhập thành khung trống" +"invalid internal .fig text path data was ignored" = "đã bỏ qua dữ liệu đường dẫn văn bản .fig nội bộ không hợp lệ" +"invalid or oversized vector networks import as outlines" = "mạng vector không hợp lệ hoặc quá lớn được nhập dưới dạng đường viền" +"invalid or oversized vector path data was skipped" = "đã bỏ qua dữ liệu đường dẫn vector không hợp lệ hoặc quá lớn" +"just now" = "vừa xong" +"key triggers without a supported key were skipped" = "đã bỏ qua các kích hoạt phím không có phím được hỗ trợ" +"key up triggers import as key presses" = "kích hoạt nhả phím được nhập thành nhấn phím" +"layers without a position were placed at their parent's origin" = "các lớp không có vị trí đã được đặt tại gốc tọa độ của lớp cha" +"layers without a type were skipped" = "đã bỏ qua các lớp không có loại" +"legacy image filter container is unsupported; filter conversion was skipped" = "vùng chứa bộ lọc hình ảnh kiểu cũ không được hỗ trợ; đã bỏ qua chuyển đổi bộ lọc" +"locked" = "đã khóa" +"malformed image filters container was skipped" = "đã bỏ qua vùng chứa bộ lọc hình ảnh bị lỗi định dạng" +"malformed image paintFilter container was skipped" = "đã bỏ qua vùng chứa paintFilter hình ảnh bị lỗi định dạng" +"malformed slot content assignment was skipped" = "đã bỏ qua phép gán nội dung ô chứa bị lỗi định dạng" +"no bleed" = "không tràn lề" +"nobody else here yet" = "chưa có ai khác ở đây" +"non-default slot settings are not represented and were skipped" = "các thiết lập ô chứa không mặc định không được biểu diễn và đã bị bỏ qua" +"now" = "bây giờ" +"only in a text style or variable" = "chỉ trong kiểu văn bản hoặc biến" +"or" = "hoặc" +"point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "khớp nối nét tại điểm được giữ lại; nét đứt hoặc nét có độ rộng biến thiên sẽ kết xuất theo khớp nối của lớp" +"preferred slot component keys cannot be resolved to file nodes and were skipped" = "không thể phân giải khóa thành phần ưu tiên của ô chứa thành nút trong tệp nên đã bỏ qua" +"prototype actions of unknown types were skipped" = "đã bỏ qua các hành động nguyên mẫu thuộc loại không xác định" +"prototype actions without a destination in the file were skipped" = "đã bỏ qua các hành động nguyên mẫu không có đích đến trong tệp" +"prototype expressions on variables that aren't in the variables JSON were skipped" = "đã bỏ qua các biểu thức nguyên mẫu dùng biến không có trong JSON biến" +"prototype expressions with unsupported functions were skipped" = "đã bỏ qua các biểu thức nguyên mẫu có hàm không được hỗ trợ" +"prototype interactions without supported actions were skipped" = "đã bỏ qua các tương tác nguyên mẫu không có hành động được hỗ trợ" +"prototype navigations of unknown types were skipped" = "đã bỏ qua các điều hướng nguyên mẫu thuộc loại không xác định" +"prototype transitions of unknown types play instantly" = "các chuyển cảnh nguyên mẫu thuộc loại không xác định sẽ phát tức thì" +"prototype triggers of unknown types were skipped" = "đã bỏ qua các kích hoạt nguyên mẫu thuộc loại không xác định" +"put a widget on the canvas" = "đặt một tiện ích lên vùng vẽ" +"read and edit the document" = "đọc và chỉnh sửa tài liệu" +"read the document" = "đọc tài liệu" +"reads the document" = "đọc tài liệu" +"set-variable actions on variables that aren't in the variables JSON were skipped" = "đã bỏ qua các hành động đặt biến trên biến không có trong JSON biến" +"set-variable actions with values that can't be evaluated were skipped" = "đã bỏ qua các hành động đặt biến có giá trị không thể tính toán" +"set-variable actions with values that don't fit the variable were skipped" = "đã bỏ qua các hành động đặt biến có giá trị không khớp kiểu biến" +"set-variable actions without a value were skipped" = "đã bỏ qua các hành động đặt biến không có giá trị" +"set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "đã bỏ qua các hành động đặt chế độ biến trên bộ sưu tập hoặc chế độ không có trong JSON biến" +"slot content assignment target is missing or is not slot content" = "đích gán nội dung ô chứa bị thiếu hoặc không phải là nội dung ô chứa" +"slot content assignment uses the empty GUID sentinel and was skipped" = "phép gán nội dung ô chứa dùng GUID rỗng nên đã bị bỏ qua" +"slot layers without a matching slot property were imported as frames" = "các lớp ô chứa không có thuộc tính ô chứa tương ứng đã được nhập thành khung" +"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "một số điểm vector tham chiếu đến thiết lập điểm bị thiếu trong tệp; chúng sẽ dùng khớp nối của lớp và góc thường" +"some vector segments refer to style settings missing from the file; they use the layer's stroke" = "một số đoạn vector tham chiếu đến thiết lập kiểu bị thiếu trong tệp; chúng sẽ dùng nét của lớp" +"stale or invalid grid track sizing entries were ignored" = "đã bỏ qua các mục kích thước dải lưới cũ hoặc không hợp lệ" +"stars and polygons without point counts or geometry use the default point count" = "ngôi sao và đa giác không có số đỉnh hoặc hình học sẽ dùng số đỉnh mặc định" +"style settings of some vector segments aren't supported; those segments use the layer's stroke" = "thiết lập kiểu của một số đoạn vector không được hỗ trợ; các đoạn đó sẽ dùng nét của lớp" +"text path underline or strikethrough decoration is not rendered" = "không kết xuất gạch chân hoặc gạch ngang chữ đối với văn bản trên đường dẫn" +"text style overrides refer to missing table entries" = "các ghi đè kiểu văn bản tham chiếu đến mục bảng bị thiếu" +"the file has no pages" = "tệp không có trang nào" +"the plugin" = "plugin" +"the variables JSON has no `variableCollections` (expected the local variables response) and was ignored" = "JSON biến không có `variableCollections` (cần phản hồi biến cục bộ) nên đã bị bỏ qua" +"this session only" = "chỉ trong phiên này" +"unknown component property types were skipped" = "đã bỏ qua các loại thuộc tính thành phần không xác định" +"variable aliases to variables that aren't in the variables JSON (or of another type) were skipped" = "đã bỏ qua các bí danh biến trỏ tới biến không có trong JSON biến (hoặc khác kiểu)" +"variable bindings to properties the layer doesn't have were skipped" = "đã bỏ qua các gắn kết biến vào thuộc tính mà lớp không có" +"variable bindings to variables that aren't in the variables JSON (library variables) were skipped" = "đã bỏ qua các gắn kết biến trỏ tới biến không có trong JSON biến (biến thư viện)" +"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)" = "đã bỏ qua các gắn kết biến: JSON tệp không có định nghĩa biến (hãy truyền JSON biến cục bộ vào `variables`, hoặc nhúng `meta` của nó cạnh JSON tệp)" +"variable bindings whose variable type doesn't fit the property were skipped" = "đã bỏ qua các gắn kết biến có kiểu biến không phù hợp với thuộc tính" +"variable collections without modes were skipped" = "đã bỏ qua các bộ sưu tập biến không có chế độ" +"variable mode lookups in prototype expressions that aren't a variable and one of its modes were skipped" = "đã bỏ qua các tra cứu chế độ biến trong biểu thức nguyên mẫu không phải là một biến và một chế độ của nó" +"variable modes of collections that aren't in the file were skipped" = "đã bỏ qua các chế độ biến của bộ sưu tập không có trong tệp" +"variable modes of collections that aren't in the variables JSON were skipped" = "đã bỏ qua các chế độ biến của bộ sưu tập không có trong JSON biến" +"variable values that don't match their type (or composed colours) were skipped" = "đã bỏ qua các giá trị biến không khớp kiểu (hoặc màu tổng hợp)" +"variables of unknown types were skipped" = "đã bỏ qua các biến thuộc kiểu không xác định" +"variables whose collection isn't in the variables JSON were skipped" = "đã bỏ qua các biến có bộ sưu tập không nằm trong JSON biến" +"variables without readable values were skipped" = "đã bỏ qua các biến không có giá trị đọc được" +"vector points with unknown stroke joins use the layer join" = "các điểm vector có khớp nối nét không xác định sẽ dùng khớp nối của lớp" +"vectors without geometry are empty" = "các vector không có dữ liệu hình học sẽ để trống" +"vectors without geometry are empty (export the file JSON with geometry=paths)" = "các vector không có dữ liệu hình học sẽ để trống (hãy xuất JSON tệp với geometry=paths)" +"very long text was cut to 1,048,576 characters" = "văn bản quá dài đã được cắt còn 1.048.576 ký tự" +"very long vector paths were skipped" = "đã bỏ qua các đường dẫn vector quá dài" +"video actions are not supported and were skipped" = "hành động video không được hỗ trợ và đã bị bỏ qua" +"video triggers are not supported and were skipped" = "kích hoạt video không được hỗ trợ và đã bị bỏ qua" +"yesterday" = "hôm qua" +"{instances} in {files}" = "{instances} trong {files}" +"{language}: draft translation, waiting for a native speaker's review." = "{language}: bản dịch nháp, đang chờ người bản ngữ hiệu đính." +"{length} bleed" = "tràn lề {length}" +"{month} {day}, {year}" = "{day} {month}, {year}" +"{name}\nClick to apply to the selection" = "{name}\nNhấp để áp dụng cho vùng chọ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}\nKéo vào vùng vẽ, hoặc nhấp để đặt ở giữa khung nhìn.\nGiữ Alt (Option) khi thả vào một bản thể để hoán đổi." +"{name} (from {library})" = "{name} (từ {library})" +"{name} (you)" = "{name} (bạn)" +"{name} ({layers} layers)" = "{name} ({layers} lớp)" +"{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}, mặc định {default}. Nhấp đúp vào thanh trượt để quay lại giá trị của kiểu; nhấn Escape khi đang kéo để hủy." +"{name} cleared from the list" = "Đã xóa {name} khỏi danh sách" +"{name} from {path}" = "{name} từ {path}" +"{name} is forgotten on this computer; the file stays on {server}" = "Đã quên {name} trên máy tính này; tệp vẫn còn trên {server}" +"{name} is on the server." = "{name} đang ở trên máy chủ." +"{name} is spotlighting" = "{name} đang chiếu tâm điểm" +"{name} is too large to open in the browser (over 512 MB)." = "{name} quá lớn để mở trong trình duyệt (trên 512 MB)." +"{name} was removed from the server" = "Đã xóa {name} khỏi máy chủ" +"{name} · deleted on main" = "{name} · đã xóa trên nhánh chính" +"{name} · deleted on the branch" = "{name} · đã xóa trên nhánh" +"{name} · not published" = "{name} · chưa xuất bản" +"{name} · on a server" = "{name} · trên máy chủ" +"{name} · published version {v}" = "{name} · đã xuất bản phiên bản {v}" +"{name} · version {v} on the server" = "{name} · phiên bản {v} trên máy chủ" +"{name}, in a live session" = "{name}, trong phiên trực tiếp" +"{name}, online, open only to you" = "{name}, trực tuyến, chỉ mình bạn mở được" +"{name}, {kind}, {w} by {h}, selected" = "{name}, {kind}, {w} × {h}, đã chọn" +"{n} added" = { other = "{n} đã thêm" } +"{n} autosave versions" = { other = "{n} phiên bản tự động lưu" } +"{n} changed" = { other = "{n} đã thay đổi" } +"{n} columns" = { other = "{n} cột" } +"{n} components" = { other = "{n} thành phần" } +"{n} components and styles have newer versions" = { other = "{n} thành phần và kiểu có phiên bản mới hơn" } +"{n} conflicts to resolve" = { other = "{n} xung đột cần giải quyết" } +"{n} days ago" = { other = "{n} ngày trước" } +"{n} files" = { other = "{n} tệp" } +"{n} hours ago" = { other = "{n} giờ trước" } +"{n} instances" = { other = "{n} bản thể" } +"{n} layers" = { other = "{n} lớp" } +"{n} layers as one file" = { other = "{n} lớp thành một tệp" } +"{n} layers selected" = { other = "Đã chọn {n} lớp" } +"{n} layers · {parts}" = { other = "{n} lớp · {parts}" } +"{n} matches" = { other = "{n} kết quả khớp" } +"{n} minutes ago" = { other = "{n} phút trước" } +"{n} months ago" = { other = "{n} tháng trước" } +"{n} more notes omitted from this report" = { other = "{n} ghi chú khác đã được lược bớt khỏi báo cáo này" } +"{n} of {total}" = "{n} / {total}" +"{n} people joined" = { other = "{n} người đã tham gia" } +"{n} preferred components" = { other = "{n} thành phần ưu tiên" } +"{n} ready" = { other = "{n} sẵn sàng" } +"{n} removed" = { other = "{n} đã xóa" } +"{n} replies" = { other = "{n} phản hồi" } +"{n} rows" = { other = "{n} hàng" } +"{n} styles" = { other = "{n} kiểu" } +"{n} text layers" = { other = "{n} lớp văn bản" } +"{n} variables" = { other = "{n} biến" } +"{n} weeks ago" = { other = "{n} tuần trước" } +"{n} years ago" = { other = "{n} năm trước" } +"{n}d" = "{n}ng" +"{n}h" = "{n}g" +"{n}m" = "{n}ph" +"{n}w" = "{n}t" +"{page}, nothing selected" = "{page}, chưa chọn gì" +"{percent}%" = "{percent}%" +"{profile} (current)" = "{profile} (hiện tại)" +"{property} is its value; {property ? \"a\" : \"b\"} picks a string. Other {…} stays as written." = "{property} là giá trị thuộc tính; {property ? \"a\" : \"b\"} chọn một chuỗi. Các {…} khác được giữ nguyên như đã viết." +"{server} can't say what became of your files (it is older than this app)." = "{server} không thể cho biết trạng thái các tệp của bạn (máy chủ cũ hơn ứng dụng này)." +"{server} · No longer on the server" = "{server} · Không còn trên máy chủ" +"{server} · {shared} · Opened {date}" = "{server} · {shared} · Đã mở {date}" +"{tool} hold {key}" = "{tool} giữ {key}" +"{value} isn't a colour" = "{value} không phải là một màu" +"{when} · edited" = "{when} · đã chỉnh sửa" +"←" = "←" +"← ↑ → ↓" = "← ↑ → ↓" +"← → ↑ ↓" = "← → ↑ ↓" +"→, Space or N" = "→, Space hoặc N" +"↵" = "↵" +"⇥ / ⇧⇥" = "⇥ / ⇧⇥" +"⌘ arrows" = "⌘ mũi tên" +"⌘ click" = "⌘ nhấp" +"⌘ scroll" = "⌘ cuộn" +"⌥ drag" = "⌥ kéo" + +[commands] +"align.bottom" = "Căn dưới" +"align.hcenter" = "Căn tâm ngang" +"align.left" = "Căn trái" +"align.right" = "Căn phải" +"align.top" = "Căn trên" +"align.vcenter" = "Căn tâm dọc" +"annotation.add" = "Thêm chú thích" +"annotation.addCategory" = "Thêm danh mục chú thích" +"annotation.categories" = "Danh mục chú thích" +"annotation.edit" = "Chỉnh sửa chú thích" +"annotation.editCategory" = "Chỉnh sửa danh mục chú thích" +"annotation.list" = "Danh sách chú thích" +"annotation.remove" = "Xóa chú thích" +"annotation.removeCategory" = "Xóa danh mục chú thích" +"app.actions" = "Hành động" +"app.preferences" = "Tùy chọn" +"arrange.back" = "Đưa xuống dưới cùng" +"arrange.backward" = "Đưa lùi một lớp" +"arrange.forward" = "Đưa tiến một lớp" +"arrange.front" = "Đưa lên trên cùng" +"arrange.packH" = "Xếp sát ngang" +"arrange.packV" = "Xếp sát dọc" +"arrange.reorder" = "Sắp xếp lại vùng chọn" +"arrange.roundToPixels" = "Làm tròn theo pixel" +"arrange.spacing" = "Khoảng cách" +"arrange.tidy" = "Sắp xếp gọn" +"bool.exclude" = "Loại trừ vùng chọn" +"bool.flatten" = "Làm phẳng nhóm boolean" +"bool.intersect" = "Giao vùng chọn" +"bool.subtract" = "Trừ vùng chọn" +"bool.union" = "Hợp vùng chọn" +"branch.archive" = "Lưu trữ nhánh" +"branch.create" = "Tạo nhánh" +"branch.list" = "Danh sách nhánh" +"branch.merge" = "Hợp nhất nhánh" +"branch.open" = "Mở nhánh" +"branch.review" = "Xem xét nhánh" +"branch.updateFromMain" = "Cập nhật từ nhánh chính" +"codeConnect.export" = "Xuất kết nối mã" +"codeConnect.import" = "Nhập kết nối mã" +"codeConnect.remove" = "Ngắt kết nối mã" +"codeConnect.set" = "Kết nối với mã" +"collab.cursor" = "Hiện con trỏ tại" +"collab.cursorChat" = "Trò chuyện con trỏ" +"collab.diff" = "Hiện thay đổi đồng bộ" +"collab.files" = "Tệp trực tuyến của bạn" +"collab.follow" = "Theo dõi" +"collab.forgetFile" = "Quên tệp trực tuyến" +"collab.host" = "Bắt đầu phiên trực tiếp" +"collab.join" = "Tham gia phiên trực tiếp" +"collab.leave" = "Rời phiên trực tiếp" +"collab.manageFile" = "Quản lý tệp đã xuất bản" +"collab.openFile" = "Mở tệp trực tuyến" +"collab.peers" = "Những người trong tệp này" +"collab.publish" = "Xuất bản lên máy chủ" +"collab.recoverFile" = "Khôi phục tệp trực tuyến" +"collab.registerLinks" = "Mở liên kết mời trong FigCraft" +"collab.removePerson" = "Xóa khỏi phiên" +"collab.report" = "Báo cáo tệp cho người vận hành máy chủ" +"collab.serverInfo" = "Thông tin máy chủ" +"collab.share" = "Chia sẻ bằng mã tham gia" +"collab.spotlight" = "Chiếu tâm điểm vào tôi" +"collab.stop" = "Dừng phiên trực tiếp" +"command.batch" = "Chạy nhiều lệnh" +"comment.add" = "Thêm bình luận" +"comment.delete" = "Xóa bình luận" +"comment.edit" = "Chỉnh sửa bình luận" +"comment.link" = "Sao chép liên kết đến bình luận" +"comment.list" = "Danh sách bình luận" +"comment.markRead" = "Đánh dấu bình luận đã đọc" +"comment.move" = "Di chuyển bình luận" +"comment.next" = "Bình luận tiếp theo" +"comment.open" = "Mở bình luận" +"comment.people" = "Người trong bình luận" +"comment.react" = "Thả cảm xúc cho bình luận" +"comment.reply" = "Trả lời bình luận" +"comment.resolve" = "Giải quyết bình luận" +"comment.zoom" = "Thu phóng đến bình luận" +"component.addProperty" = "Thêm thuộc tính thành phần" +"component.addVariant" = "Thêm biến thể" +"component.bindProperty" = "Gắn lớp vào thuộc tính" +"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.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" +"component.exposeInstance" = "Hiển thị bản thể lồng nhau" +"component.goToMain" = "Đi tới thành phần chính" +"component.hideWhenPublishing" = "Ẩn khi xuất bản" +"component.list" = "Danh sách thành phần" +"component.makeSlot" = "Tạo ô chứa" +"component.playground" = "Sân thử nghiệm thành phần" +"component.properties" = "Thuộc tính thành phần" +"component.pushChanges" = "Đẩy thay đổi lên thành phần chính" +"component.removeSlot" = "Xóa ô chứa" +"component.resetInstance" = "Đặt lại mọi thay đổi" +"component.resetOverride" = "Đặt lại ghi đè" +"component.restoreMain" = "Khôi phục thành phần chính" +"dev.compare" = "So sánh thay đổi" +"dev.focus" = "Chế độ xem tập trung" +"dev.resolveChange" = "Giải quyết thay đổi" +"dev.unfocus" = "Thoát chế độ xem tập trung" +"devResource.add" = "Thêm tài nguyên dev" +"devResource.edit" = "Chỉnh sửa tài nguyên dev" +"devResource.list" = "Danh sách tài nguyên dev" +"devResource.remove" = "Xóa tài nguyên dev" +"distribute.horizontal" = "Phân bổ đều khoảng cách ngang" +"distribute.vertical" = "Phân bổ đều khoảng cách dọc" +"doc.home" = "Trang chủ" +"doc.list" = "Danh sách tài liệu" +"doc.nextTab" = "Thẻ tiếp theo" +"doc.previousTab" = "Thẻ trước" +"doc.switch" = "Chuyển tài liệu" +"edit.copy" = "Sao chép" +"edit.copyAsCss" = "Sao chép dưới dạng CSS" +"edit.copyAsPng" = "Sao chép dưới dạng PNG" +"edit.copyAsSvg" = "Sao chép dưới dạng SVG" +"edit.copyAsText" = "Sao chép dưới dạng văn bản" +"edit.copyLink" = "Sao chép liên kết đến vùng chọn" +"edit.copyProperties" = "Sao chép thuộc tính" +"edit.cut" = "Cắt" +"edit.delete" = "Xóa" +"edit.duplicate" = "Nhân bản" +"edit.findReplace" = "Tìm và thay thế" +"edit.paste" = "Dán" +"edit.pasteDesignLayers" = "Dán các lớp thiết kế" +"edit.pasteOver" = "Dán đè lên vùng chọn" +"edit.pasteProperties" = "Dán thuộc tính" +"edit.pasteReplace" = "Dán để thay thế" +"edit.pickColor" = "Chọn màu" +"edit.redo" = "Làm lại" +"edit.repeat" = "Lặp lại lệnh cuối" +"edit.setDefaultProperties" = "Đặt thuộc tính mặc định" +"edit.undo" = "Hoàn tác" +"effect.add" = "Thêm hiệu ứng" +"effect.move" = "Di chuyển hiệu ứng" +"effect.remove" = "Xóa hiệu ứng" +"effect.set" = "Đặt hiệu ứng" +"export.add" = "Thêm thiết lập xuất" +"export.remove" = "Xóa thiết lập xuất" +"export.update" = "Chỉnh sửa thiết lập xuất" +"file.close" = "Đóng thẻ" +"file.colorProfile" = "Hồ sơ màu" +"file.duplicate" = "Nhân bản tệp" +"file.export" = "Xuất" +"file.exportFramesPdf" = "Xuất các khung ra PDF" +"file.exportLayers" = "Xuất các lớp" +"file.exportSvg" = "Xuất vùng chọn ra SVG" +"file.import" = "Nhập" +"file.moveTab" = "Di chuyển thẻ" +"file.new" = "Tệp thiết kế mới" +"file.newFromTemplate" = "Mới từ mẫu" +"file.open" = "Mở" +"file.openRecent" = "Mở tệp gần đây" +"file.placeImage" = "Đặt hình ảnh" +"file.recover" = "Khôi phục tệp" +"file.rename" = "Đổi tên tệp" +"file.revert" = "Hoàn nguyên về bản đã lưu" +"file.save" = "Lưu" +"file.saveAs" = "Lưu thành" +"file.saveVersion" = "Lưu vào lịch sử phiên bản" +"file.versionHistory" = "Hiện lịch sử phiên bản" +"fill.add" = "Thêm màu tô" +"fill.move" = "Di chuyển màu tô" +"fill.pattern" = "Tô họa tiết" +"fill.remove" = "Xóa màu tô" +"fill.set" = "Đặt màu tô" +"frame.create" = "Tạo khung" +"frame.presets" = "Danh sách kích thước khung dựng sẵn" +"frame.swapOrientation" = "Đổi chiều ngang/dọc" +"grid.add" = "Thêm lưới bố cục" +"grid.move" = "Di chuyển lưới bố cục" +"grid.remove" = "Xóa lưới bố cục" +"guide.add" = "Thêm đường gióng" +"guide.clear" = "Xóa mọi đường gióng" +"guide.move" = "Di chuyển đường gióng" +"guide.remove" = "Xóa đường gióng" +"guide.select" = "Chọn đường gióng" +"help.about" = "Giới thiệu về FigCraft" +"help.gettingStarted" = "Bắt đầu" +"help.page" = "Trang trợ giúp" +"help.shortcuts" = "Phím tắt" +"image.adjust" = "Điều chỉnh hình ảnh" +"image.deletePreset" = "Xóa thiết lập sẵn hình ảnh" +"image.place" = "Đặt hình ảnh" +"image.presets" = "Thiết lập sẵn hình ảnh" +"image.savePreset" = "Lưu thiết lập sẵn hình ảnh" +"inspect.assets" = "Kiểm tra tài nguyên" +"inspect.code" = "Mã cho lớp" +"inspect.componentCode" = "Mã thành phần" +"inspect.properties" = "Kiểm tra thuộc tính" +"inspect.readyForDev" = "Sẵn sàng cho dev" +"instance.create" = "Tạo bản thể" +"instance.exposed" = "Các bản thể lồng nhau được hiển thị" +"instance.place" = "Đặt bản thể" +"instance.resetSlot" = "Đặt lại ô chứa" +"instance.setProperties" = "Đặt thuộc tính bản thể" +"instance.slotInsert" = "Chèn vào ô chứa" +"instance.swap" = "Hoán đổi bản thể" +"instance.swapAt" = "Hoán đổi bản thể tại điểm" +"layers.collapseAll" = "Thu gọn các lớp" +"layout.add" = "Thêm bố cục tự động" +"layout.remove" = "Xóa bố cục tự động" +"layout.setTrack" = "Đặt kích thước dải lưới" +"layout.suggest" = "Gợi ý bố cục tự động" +"libraries.open" = "Thư viện" +"libraries.publish" = "Xuất bản thư viện…" +"library.acceptUpdates" = "Chấp nhận cập nhật thư viện" +"library.add" = "Thêm thư viện" +"library.aliasVariable" = "Tạo bí danh biến thư viện" +"library.applyStyle" = "Áp dụng kiểu thư viện" +"library.bindVariable" = "Gắn biến thư viện" +"library.extendCollection" = "Mở rộng bộ sưu tập thư viện" +"library.import" = "Nhập thành phần thư viện" +"library.importVariable" = "Nhập biến thư viện" +"library.list" = "Danh sách thư viện" +"library.place" = "Đặt thành phần thư viện" +"library.publish" = "Xuất bản thư viện" +"library.publishToServer" = "Xuất bản thư viện lên máy chủ" +"library.remove" = "Xóa thư viện" +"library.setVariableMode" = "Đặt chế độ biến thư viện" +"library.swap" = "Hoán đổi thư viện" +"library.swapAt" = "Hoán đổi bản thể sang thành phần thư viện" +"library.updates" = "Cập nhật thư viện" +"library.usage" = "Mức sử dụng thư viện" +"measure.distances" = "Đo khoảng cách" +"measure.padding" = "Đo khoảng đệm bố cục tự động" +"node.create" = "Tạo lớp" +"node.get" = "Lấy lớp" +"node.reorder" = "Sắp xếp lại lớp" +"node.reparent" = "Di chuyển lớp vào trong" +"node.set" = "Đặt thuộc tính" +"object.batchRename" = "Đổi tên hàng loạt" +"object.convertToFrame" = "Chuyển thành khung" +"object.convertToGroup" = "Chuyển thành nhóm" +"object.convertToSection" = "Chuyển thành phần" +"object.flipH" = "Lật ngang" +"object.flipV" = "Lật dọc" +"object.frameSelection" = "Đóng khung vùng chọn" +"object.group" = "Nhóm vùng chọn" +"object.hideOthers" = "Ẩn các lớp khác" +"object.mask" = "Dùng làm mặt nạ" +"object.moveToPage" = "Di chuyển sang trang" +"object.opacityKeys" = "Độ mờ từ phím số" +"object.rasterize" = "Điểm ảnh hóa vùng chọn" +"object.releaseMask" = "Bỏ mặt nạ" +"object.removeFill" = "Xóa màu tô" +"object.removeFrame" = "Bỏ khung" +"object.removeStroke" = "Xóa nét" +"object.rename" = "Đổi tên" +"object.resizeToFit" = "Đổi kích thước vừa khít" +"object.rotate180" = "Xoay 180°" +"object.rotateLeft" = "Xoay 90° sang trái" +"object.rotateRight" = "Xoay 90° sang phải" +"object.setThumbnail" = "Đặt làm ảnh thu nhỏ" +"object.swapFillStroke" = "Đổi chỗ màu tô và nét" +"object.toggleLock" = "Khóa/Mở khóa vùng chọn" +"object.toggleVisible" = "Hiện/Ẩn vùng chọn" +"object.ungroup" = "Bỏ nhóm vùng chọn" +"object.wrapInSection" = "Bọc trong phần mới" +"page.add" = "Thêm trang" +"page.delete" = "Xóa trang" +"page.duplicate" = "Nhân bản trang" +"page.list" = "Danh sách trang" +"page.move" = "Di chuyển trang" +"page.rename" = "Đổi tên trang" +"page.select" = "Đi tới trang" +"page.setBackground" = "Màu nền trang" +"paint.documentColors" = "Màu trong tài liệu" +"plugin.close" = "Đóng bảng plugin" +"plugin.directory.install" = "Cài đặt plugin từ thư mục" +"plugin.directory.list" = "Duyệt thư mục plugin" +"plugin.directory.publish" = "Xuất bản plugin lên thư mục" +"plugin.directory.unpublish" = "Gỡ xuất bản plugin khỏi thư mục" +"plugin.event" = "Dùng điều khiển bảng plugin" +"plugin.import" = "Nhập plugin từ tệp kê khai…" +"plugin.list" = "Danh sách plugin" +"plugin.remove" = "Gỡ plugin" +"plugin.run" = "Chạy plugin" +"plugin.ui" = "Bảng plugin" +"plugins.manage" = "Quản lý plugin…" +"plugins.runLast" = "Chạy plugin vừa dùng" +"pref.autoSave" = "Tự động lưu tệp" +"pref.highlightHover" = "Làm nổi bật lớp khi di chuột qua" +"pref.keepTool" = "Giữ công cụ được chọn sau khi dùng" +"pref.language" = "Ngôn ngữ giao diện" +"pref.nudge" = "Mức dịch chuyển nhẹ" +"pref.numberKeysOpacity" = "Dùng phím số để chỉnh độ mờ" +"pref.publishServer" = "Máy chủ chia sẻ trực tuyến" +"pref.reduceMotion" = "Giảm chuyển động" +"pref.renameDuplicates" = "Đổi tên các lớp nhân bản" +"pref.showDimensions" = "Hiện kích thước trên đối tượng" +"pref.startOnHome" = "Khởi động tại màn hình Trang chủ" +"pref.uiScale" = "Kích thước giao diện" +"pref.userName" = "Tên của bạn trong bình luận" +"proto.action.add" = "Thêm hành động nguyên mẫu" +"proto.action.move" = "Sắp xếp lại hành động nguyên mẫu" +"proto.action.remove" = "Xóa hành động nguyên mẫu" +"proto.action.set" = "Chỉnh sửa hành động nguyên mẫu" +"proto.closePreview" = "Đóng xem trước nguyên mẫu" +"proto.conditional.addBlock" = "Thêm nhánh else if / else" +"proto.conditional.removeBlock" = "Xóa nhánh if / else if / else" +"proto.conditional.setCondition" = "Chỉnh sửa điều kiện" +"proto.evaluate" = "Tính biểu thức nguyên mẫu" +"proto.flow.add" = "Thêm điểm bắt đầu luồng" +"proto.flow.remove" = "Xóa luồng" +"proto.flow.rename" = "Đổi tên luồng" +"proto.interaction.add" = "Thêm tương tác" +"proto.interaction.clear" = "Xóa mọi tương tác" +"proto.interaction.remove" = "Xóa tương tác" +"proto.interaction.set" = "Chỉnh sửa tương tác" +"proto.present" = "Trình chiếu" +"proto.presentOptions" = "Tùy chọn trình chiếu" +"proto.preview" = "Mở xem trước nguyên mẫu" +"proto.settings" = "Thiết lập nguyên mẫu" +"section.toggleContents" = "Ẩn/Hiện nội dung phần" +"select.add" = "Thêm vào vùng chọn" +"select.all" = "Chọn tất cả" +"select.area" = "Chọn vùng" +"select.byName" = "Chọn lớp theo tên" +"select.children" = "Chọn các lớp con" +"select.inverse" = "Đảo ngược vùng chọn" +"select.layersAt" = "Các lớp tại một điểm" +"select.matching" = "Chọn các lớp tương ứng" +"select.next" = "Chọn lớp đồng cấp tiếp theo" +"select.none" = "Bỏ chọn tất cả" +"select.parent" = "Chọn lớp cha" +"select.previous" = "Chọn lớp đồng cấp trước đó" +"select.remove" = "Bỏ khỏi vùng chọn" +"select.sameEffect" = "Chọn cùng hiệu ứng" +"select.sameFill" = "Chọn cùng màu tô" +"select.sameFont" = "Chọn cùng phông chữ" +"select.sameInstance" = "Chọn cùng bản thể" +"select.sameProperties" = "Chọn cùng thuộc tính" +"select.sameStroke" = "Chọn cùng nét" +"select.sameText" = "Chọn cùng thuộc tính văn bản" +"select.set" = "Chọn" +"selection.applyColorStyle" = "Áp dụng kiểu màu cho vùng chọn" +"selection.colors" = "Màu của vùng chọn" +"selection.selectColor" = "Chọn các lớp có màu này" +"selection.setPaint" = "Đổi màu vùng chọn" +"shape.arrow" = "Mũi tên" +"shape.ellipse" = "Hình elip" +"shape.line" = "Đường thẳng" +"shape.polygon" = "Đa giác" +"shape.rectangle" = "Hình chữ nhật" +"shape.star" = "Ngôi sao" +"shapeBuilder.merge" = "Hợp nhất các vùng" +"shapeBuilder.mode" = "Chế độ tạo hình" +"shapeBuilder.regions" = "Các vùng tạo hình" +"shapeBuilder.remove" = "Xóa các vùng" +"stroke.add" = "Thêm nét" +"stroke.brush" = "Cọ vẽ" +"stroke.move" = "Di chuyển nét" +"stroke.remove" = "Xóa nét" +"stroke.set" = "Đặt nét" +"stroke.widthProfile" = "Biên dạng độ rộng" +"style.apply" = "Áp dụng kiểu" +"style.bind" = "Gắn biến trong kiểu" +"style.create" = "Tạo kiểu" +"style.delete" = "Xóa kiểu" +"style.detach" = "Tách kiểu" +"style.duplicate" = "Nhân bản kiểu" +"style.list" = "Danh sách kiểu" +"style.move" = "Di chuyển kiểu" +"style.renameFolder" = "Đổi tên thư mục kiểu" +"style.update" = "Chỉnh sửa kiểu" +"template.list" = "Danh sách mẫu" +"text.alignCenter" = "Căn giữa" +"text.alignJustify" = "Căn đều" +"text.alignLeft" = "Căn trái" +"text.alignRight" = "Căn phải" +"text.bold" = "Đậm" +"text.bulletList" = "Danh sách dấu đầu dòng" +"text.case" = "Kiểu chữ hoa/thường" +"text.caseLower" = "Chữ thường" +"text.caseOriginal" = "Giữ nguyên chữ hoa/thường" +"text.caseSmallCaps" = "Chữ hoa nhỏ" +"text.caseTitle" = "Viết hoa đầu từ" +"text.caseUpper" = "Chữ hoa" +"text.create" = "Văn bản" +"text.decoration" = "Trang trí chữ" +"text.edit.begin" = "Chỉnh sửa văn bản" +"text.edit.caret" = "Đặt con trỏ văn bản" +"text.edit.end" = "Dừng chỉnh sửa văn bản" +"text.edit.insert" = "Nhập văn bản" +"text.edit.key" = "Phím văn bản" +"text.edit.preedit" = "Soạn văn bản (IME)" +"text.edit.selectLine" = "Chọn dòng" +"text.edit.selectWord" = "Chọn từ" +"text.edit.selection" = "Vùng chọn văn bản" +"text.endPreview" = "Kết thúc xem trước văn bản" +"text.fonts" = "Danh sách phông chữ" +"text.italic" = "Nghiêng" +"text.lineHeightDown" = "Giảm chiều cao dòng" +"text.lineHeightUp" = "Tăng chiều cao dòng" +"text.link" = "Tạo liên kết" +"text.listIndent" = "Thụt lề danh sách" +"text.listOutdent" = "Nhô lề danh sách" +"text.listStyle" = "Kiểu danh sách" +"text.loadFont" = "Tải tệp phông chữ" +"text.maxLines" = "Số dòng tối đa" +"text.missingFonts" = "Phông chữ bị thiếu" +"text.numberList" = "Danh sách đánh số" +"text.onPath" = "Văn bản trên đường dẫn" +"text.paragraphIndent" = "Thụt lề đoạn văn" +"text.paragraphSpacing" = "Khoảng cách đoạn văn" +"text.pathOptions" = "Tùy chọn đường dẫn văn bản" +"text.preview" = "Xem trước thay đổi văn bản" +"text.refit" = "Khớp lại văn bản theo phông chữ" +"text.removeFromPath" = "Gỡ văn bản khỏi đường dẫn" +"text.rescanFonts" = "Quét lại phông chữ đã cài đặt" +"text.set" = "Đặt văn bản" +"text.setFeatures" = "Tính năng OpenType" +"text.setVariations" = "Trục phông chữ biến thiên" +"text.sizeDown" = "Giảm cỡ chữ" +"text.sizeUp" = "Tăng cỡ chữ" +"text.strikethrough" = "Gạch ngang chữ" +"text.style" = "Định kiểu đoạn văn bản" +"text.trackingDown" = "Giảm khoảng cách chữ" +"text.trackingUp" = "Tăng khoảng cách chữ" +"text.underline" = "Gạch chân" +"text.weightDown" = "Giảm độ đậm chữ" +"text.weightUp" = "Tăng độ đậm chữ" +"tool.arrow" = "Mũi tên" +"tool.comment" = "Bình luận" +"tool.ellipse" = "Hình elip" +"tool.frame" = "Khung" +"tool.hand" = "Bàn tay" +"tool.line" = "Đường thẳng" +"tool.move" = "Di chuyển" +"tool.pen" = "Bút" +"tool.pencil" = "Bút chì" +"tool.pencilBrush" = "Cọ bút chì" +"tool.place" = "Đặt bằng công cụ" +"tool.polygon" = "Đa giác" +"tool.rectangle" = "Hình chữ nhật" +"tool.scale" = "Tỷ lệ" +"tool.scaleAnchor" = "Điểm neo tỷ lệ" +"tool.section" = "Phần" +"tool.set" = "Chọn công cụ" +"tool.shapeBuilder" = "Tạo hình" +"tool.slice" = "Lát cắt" +"tool.star" = "Ngôi sao" +"tool.text" = "Văn bản" +"transform.move" = "Di chuyển" +"transform.moveTo" = "Di chuyển tới" +"transform.nudge" = "Dịch chuyển nhẹ" +"transform.nudgeSize" = "Đổi kích thước theo bước dịch nhẹ" +"transform.resize" = "Đổi kích thước" +"transform.rotate" = "Xoay" +"transform.rotationOrigin" = "Di chuyển tâm xoay" +"transform.scale" = "Tỷ lệ" +"transform.setRotationOrigin" = "Đặt tâm xoay" +"variable.addMode" = "Thêm chế độ" +"variable.bind" = "Gắn biến" +"variable.create" = "Tạo biến" +"variable.createCollection" = "Tạo bộ sưu tập biến" +"variable.delete" = "Xóa biến" +"variable.deleteCollection" = "Xóa bộ sưu tập" +"variable.duplicate" = "Nhân bản biến" +"variable.export" = "Xuất các biến" +"variable.import" = "Nhập các biến" +"variable.list" = "Danh sách biến" +"variable.moveMode" = "Di chuyển chế độ" +"variable.removeMode" = "Xóa chế độ" +"variable.renameCollection" = "Đổi tên bộ sưu tập" +"variable.renameMode" = "Đổi tên chế độ" +"variable.resetOverride" = "Đặt lại ghi đè biến" +"variable.set" = "Đặt giá trị biến" +"variable.setMode" = "Đặt chế độ biến" +"variable.update" = "Chỉnh sửa biến" +"vector.create" = "Vector" +"vector.deleteHeal" = "Xóa và nối liền vùng chọn" +"vector.edit.addVertex" = "Thêm điểm" +"vector.edit.begin" = "Chỉnh sửa vector" +"vector.edit.bend" = "Uốn đoạn" +"vector.edit.bounds" = "Khung giới hạn các điểm đã chọn" +"vector.edit.connect" = "Nối các điểm" +"vector.edit.cornerRadius" = "Bán kính góc của điểm" +"vector.edit.cut" = "Cắt đường dẫn" +"vector.edit.delete" = "Xóa các điểm" +"vector.edit.end" = "Hoàn tất chỉnh sửa" +"vector.edit.erase" = "Tẩy xóa" +"vector.edit.lasso" = "Chọn bằng dây quây" +"vector.edit.mirroring" = "Đối xứng tay nắm" +"vector.edit.moveHandles" = "Di chuyển tay nắm" +"vector.edit.moveVertices" = "Di chuyển các điểm" +"vector.edit.nudge" = "Dịch nhẹ các điểm" +"vector.edit.paint" = "Thùng sơn" +"vector.edit.pen" = "Điểm bút" +"vector.edit.penEnd" = "Kết thúc đường dẫn bút" +"vector.edit.position" = "Vị trí điểm" +"vector.edit.resize" = "Đổi kích thước các điểm" +"vector.edit.rotate" = "Xoay các điểm" +"vector.edit.select" = "Chọn các điểm" +"vector.edit.selectAll" = "Chọn tất cả các điểm" +"vector.edit.setHandle" = "Đặt tay nắm" +"vector.edit.smooth" = "Làm mượt hoặc làm nhọn điểm" +"vector.edit.state" = "Trạng thái chỉnh sửa vector" +"vector.edit.strokeCap" = "Đầu mút nét tại điểm" +"vector.edit.strokeJoin" = "Khớp nối nét tại điểm" +"vector.edit.tool" = "Công cụ chỉnh sửa vector" +"vector.edit.transform" = "Biến đổi các điểm" +"vector.edit.widthPoint" = "Điểm độ rộng" +"vector.flatten" = "Làm phẳng" +"vector.join" = "Nối vùng chọn" +"vector.offset" = "Đường dẫn lệch" +"vector.outlineStroke" = "Chuyển nét thành đường viền" +"vector.reverse" = "Đảo chiều đường dẫn" +"vector.simplify" = "Đơn giản hóa vector" +"vector.smoothJoin" = "Nối mượt vùng chọn" +"version.autosave" = "Phiên bản tự động lưu" +"version.delete" = "Xóa phiên bản" +"version.duplicate" = "Nhân bản phiên bản" +"version.exitPreview" = "Quay lại phiên bản hiện tại" +"version.list" = "Danh sách phiên bản" +"version.preview" = "Xem phiên bản" +"version.rename" = "Đổi tên phiên bản" +"version.restore" = "Khôi phục phiên bản" +"view.assets" = "Bảng Tài nguyên" +"view.comments" = "Bình luận" +"view.contextMenu" = "Hiện trình đơn ngữ cảnh" +"view.design" = "Bảng Thiết kế" +"view.designPrototype" = "Chuyển đổi giữa Thiết kế và Nguyên mẫu" +"view.devMode" = "Dev Mode" +"view.frameOutlines" = "Đường viền khung" +"view.fullscreen" = "Toàn màn hình" +"view.get" = "Lấy khung nhìn" +"view.layers" = "Bảng Các lớp" +"view.layoutGrids" = "Lưới bố cục" +"view.leftSidebar" = "Hiện/Ẩn thanh bên trái" +"view.maskOutlines" = "Đường viền mặt nạ" +"view.multiplayerCursors" = "Con trỏ nhiều người dùng" +"view.nextFrame" = "Thu phóng đến khung tiếp theo" +"view.nextPage" = "Trang tiếp theo" +"view.nextRegion" = "Chuyển tiêu điểm sang vùng tiếp theo" +"view.outlines" = "Đường viền nét" +"view.outlinesHiddenLayers" = "Bao gồm các lớp ẩn trong đường viền nét" +"view.outlinesObjectBounds" = "Bao gồm khung giới hạn đối tượng trong đường viền nét" +"view.outlinesSelection" = "Đường viền nét cho vùng chọn" +"view.pan" = "Di chuyển khung nhìn" +"view.panelWidths" = "Đặt lại độ rộng bảng" +"view.pixelGrid" = "Lưới pixel" +"view.pixelPreview" = "Xem trước pixel" +"view.prevFrame" = "Thu phóng đến khung trước" +"view.prevPage" = "Trang trước" +"view.previousRegion" = "Chuyển tiêu điểm về vùng trước" +"view.proofSrgb" = "Kiểm thử mềm sRGB" +"view.prototype" = "Bảng Nguyên mẫu" +"view.rulers" = "Thước" +"view.set" = "Đặt khung nhìn" +"view.slices" = "Lát cắt" +"view.snapGeometry" = "Bắt dính vào hình học" +"view.snapObjects" = "Bắt dính vào đối tượng" +"view.snapPixel" = "Bắt dính vào lưới pixel" +"view.themeDark" = "Giao diện tối" +"view.themeLight" = "Giao diện sáng" +"view.themeSystem" = "Theo giao diện hệ thống" +"view.toggleUi" = "Hiện/Ẩn giao diện" +"view.zoom100" = "Thu phóng về 100%" +"view.zoom200" = "Thu phóng về 200%" +"view.zoom50" = "Thu phóng về 50%" +"view.zoomAt" = "Công cụ thu phóng" +"view.zoomFit" = "Thu phóng vừa khít" +"view.zoomIn" = "Phóng to" +"view.zoomOut" = "Thu nhỏ" +"view.zoomSelection" = "Thu phóng vừa vùng chọn" +"widget.click" = "Nhấp tiện ích" +"widget.insert" = "Chèn tiện ích" +"widget.list" = "Danh sách tiện ích" +"window.focus" = "Đưa cửa sổ lên trước" +"window.new" = "Cửa sổ mới" + +[menu] +"bool.exclude" = "Loại trừ" +"bool.flatten" = "Làm phẳng" +"bool.intersect" = "Giao nhau" +"bool.subtract" = "Trừ" +"bool.union" = "Hợp" +"file.duplicate" = "Nhân bản" +"file.import" = "Nhập từ tệp…" +"file.rename" = "Đổi tên" +"libraries.open" = "Mở thư viện" +"select.sameEffect" = "Hiệu ứng" +"select.sameFill" = "Màu tô" +"select.sameFont" = "Phông chữ" +"select.sameInstance" = "Bản thể" +"select.sameProperties" = "Thuộc tính" +"select.sameStroke" = "Nét" +"select.sameText" = "Thuộc tính văn bản" +"text.alignCenter" = "Căn giữa văn bản" +"text.alignJustify" = "Căn đều văn bản" +"text.alignLeft" = "Căn trái văn bản" +"text.alignRight" = "Căn phải văn bản" +"view.assets" = "Tài nguyên" +"view.design" = "Thiết kế" +"view.layers" = "Các lớp" +"view.outlines" = "Hiện đường viền nét" +"view.outlinesHiddenLayers" = "Bao gồm các lớp ẩn" +"view.outlinesObjectBounds" = "Bao gồm khung giới hạn đối tượng" +"view.outlinesSelection" = "Hiện đường viền nét cho vùng chọn" +"view.prototype" = "Nguyên mẫu" +"view.themeDark" = "Tối" +"view.themeLight" = "Sáng" +"view.themeSystem" = "Theo hệ thống" diff --git a/crates/ui-egui/src/cjk.rs b/crates/ui-egui/src/cjk.rs index 35323efe7..88f5e516b 100644 --- a/crates/ui-egui/src/cjk.rs +++ b/crates/ui-egui/src/cjk.rs @@ -157,7 +157,7 @@ mod tests { assert_eq!(language("zh-Hans"), HAN); assert_eq!(language("bn"), BENGALI); assert_eq!(language("fr"), 0); - assert!(["en", "es", "es-419", "fr", "de", "pt-BR", "tr", "id"].iter().all(|c| can_show(c))); + assert!(["en", "es", "es-419", "fr", "de", "pt-BR", "tr", "id", "vi"].iter().all(|c| can_show(c))); } #[test] diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs index 9faff0016..871f66cf3 100644 --- a/crates/ui-egui/src/i18n.rs +++ b/crates/ui-egui/src/i18n.rs @@ -176,7 +176,7 @@ fn plural(code: &str, n: usize) -> Plural { "ru" if n % 10 == 1 && n % 100 != 11 => Plural::One, "ru" | "pl" if (2..=4).contains(&(n % 10)) && !(12..=14).contains(&(n % 100)) => Plural::Few, "ru" | "pl" => Plural::Many, - "ja" | "ko" | "zh-Hans" => Plural::Other, + "ja" | "ko" | "zh-Hans" | "vi" => Plural::Other, "fr" | "pt-BR" if n <= 1 => Plural::One, _ if n == 1 => Plural::One, _ => Plural::Other, @@ -187,7 +187,7 @@ fn plural(code: &str, n: usize) -> Plural { // "other" wording. Czech supplies separate few forms; Russian and Polish supply few/many forms. /// Whether count `n` takes the "one" form: 0 and 1 in French and Brazilian Portuguese, never in -/// Japanese, Korean and Chinese (no plural forms: always "other"), 1 elsewhere (CLDR's integer rules). +/// Japanese, Korean, Chinese and Vietnamese (no plural forms: always "other"), 1 elsewhere (CLDR's integer rules). #[cfg(test)] fn plural_one(lang: usize, n: usize) -> bool { plural(LANGS.get(lang).map_or("en", |l| l.code), n) == Plural::One diff --git a/crates/ui-egui/src/i18n_tests.rs b/crates/ui-egui/src/i18n_tests.rs index 046212c16..85b006ff2 100644 --- a/crates/ui-egui/src/i18n_tests.rs +++ b/crates/ui-egui/src/i18n_tests.rs @@ -349,6 +349,7 @@ fn system_languages_pick_the_first_one_with_a_catalog() { assert_eq!(code("system", Some("pt-BR")), "pt-BR"); assert_eq!(code("system", Some("tr_TR.UTF-8")), "tr"); assert_eq!(code("system", Some("id_ID.UTF-8")), "id"); + assert_eq!(code("system", Some("vi_VN.UTF-8")), "vi"); // Portugal's Portuguese and a bare "pt" read the Brazilian catalog. assert_eq!(code("system", Some("pt-PT")), "pt-BR"); assert_eq!(code("pt", None), "pt-BR"); @@ -417,12 +418,15 @@ fn french_and_portuguese_count_zero_as_singular() { } #[test] -fn japanese_korean_and_chinese_have_no_plural_forms() { +fn japanese_korean_chinese_and_vietnamese_have_no_plural_forms() { let code = |pref: &str, system: Option<&str>| LANGS[resolve(pref, system)].code; assert_eq!(code("system", Some("ja-JP")), "ja"); assert_eq!(code("system", Some("ko_KR.UTF-8")), "ko"); + assert_eq!(code("system", Some("vi-VN")), "vi"); assert_eq!(code("system", Some("ja,en-US")), "ja"); - for code in ["ja", "ko", "zh-Hans"] { + assert_eq!(LANGS[resolve("vi", None)].name, "Tiếng Việt"); + assert!(LANGS[resolve("vi", None)].draft); + for code in ["ja", "ko", "zh-Hans", "vi"] { let lang = LANGS.iter().position(|l| l.code == code).unwrap(); assert!(!plural_one(lang, 0) && !plural_one(lang, 1) && !plural_one(lang, 2), "{code}"); let ones: Vec<_> = LANGS[lang].ui.iter().filter(|(_, t)| matches!(t, Text::Plural { one: Some(_), .. })).map(|(k, _)| k).collect(); diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 50fcd4ec3..05596fa39 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -4,7 +4,7 @@ FigCraft's interface has a localization layer with an English catalog, a Russian catalog reviewed by a native speaker, and Spanish (with a Latin American overlay), French, German, Brazilian -Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Czech drafts (machine-drafted, +Portuguese, Japanese, Korean, Simplified Chinese, Indonesian, Vietnamese and Czech drafts (machine-drafted, waiting for native speakers' review), plus Swedish and Turkish catalogs. This page lists the twelve key languages of the craftrules standard, then the other languages Figma ships. How to add a language: [`translating.md`](translating.md). @@ -32,7 +32,7 @@ supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no v channel stay English. Accessibility names come from the same strings. - **Language preference:** Preferences ▸ Language (System, then each catalog by its own name: English, Čeština, Deutsch, Español, Español (Latinoamérica), Français, Bahasa Indonesia, 日本語, - 한국어, Português (Brasil), Русский, Svenska, Türkçe, 简体中文), applied at once without a + 한국어, Português (Brasil), Русский, Svenska, Türkçe, Tiếng Việt, 简体中文), applied at once without a restart; System takes the first of the OS's preferred languages that has a catalog (on Windows only the first preferred language counts, since that list also holds the languages added for a keyboard; macOS AppleLanguages, `LANGUAGE` then the locale variables on Linux and BSD; a regional @@ -53,7 +53,7 @@ supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no v - **Not yet localized:** messages the engine writes (errors, a few toasts, Dev Mode property values such as "inside"), number formatting (decimal points stay `.`), and decimal plural rules (`trn` takes integers: Czech uses one/few/other and Russian one/few/many; French and Brazilian - Portuguese take the singular for 0 as well; Japanese, Korean and Chinese have one form; + Portuguese take the singular for 0 as well; Japanese, Korean, Chinese and Vietnamese have one form; CLDR's "many" for millions in French, Spanish and Portuguese reads as the plural). - **Script support in documents:** Unicode bidi with Arabic shaping and mirrored brackets in text layers; right-to-left list markers and indents; right-to-left names in the layers panel, tabs @@ -96,7 +96,7 @@ supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no v | Japanese | ja | 2,254 / 2,272 (99.2%, draft) | yes | CJK text and IME in documents; UI text in an installed Japanese face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | | German | de | 2,176 / 2,272 (95.8%, draft) | yes | Latin; long words elide in narrow fields | no | draft | 1–2 (after native review) | | Korean | ko | 2,166 / 2,272 (95.3%, draft) | yes | Hangul text and IME in documents; UI text in an installed Korean face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | -| Vietnamese | vi | 0 (0%) | no | Latin with stacked diacritics | no | none | 3–5 | +| Vietnamese | vi | 2,352 / 2,352 (100%, draft) | yes | Latin with stacked diacritics | no | draft | 1–2 (after native review) | Other languages (measured 2026-10-17): Russian (`ru`) 2,244 / 2,272 (98.8%), reviewed and approved by VanTan, one/few/many integer plurals; Swedish (`sv`) 2,264 (99.6%), its command labels and menu @@ -113,8 +113,8 @@ right-to-left mirroring of the panels is in Arabic's hours. Total: **29–51 h** every string adds). Priority: native reviews of the drafts and the es-419 overlay (every one of Figma's languages -and variants has one, plus Simplified Chinese, Indonesian and Czech, which Figma doesn't ship), then -Hindi, Vietnamese and Arabic. Traditional Chinese is not planned (no catalog; its users see English). +and variants has one, plus Simplified Chinese, Indonesian, Vietnamese and Czech, which Figma doesn't ship), then +Hindi and Arabic. Traditional Chinese is not planned (no catalog; its users see English). ## Revision history diff --git a/docs/mcp.md b/docs/mcp.md index dfea95cc2..d8fb52a7e 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -436,7 +436,7 @@ on; `key` resolves keys the way the canvas does. Commands behind keys: - `pref.startOnHome {on?}`: the desktop app starts on the Home screen instead of in a new file (off by default; files named on the command line still open, and `--control` starts in a new file anyway, so control callers have a document). -- `pref.language {language: system|en|cs|ru|es|es-419|fr|de|pt-BR|ja|ka|ko|sv|zh-Hans|…}`: the app's interface language, applied live ("system": +- `pref.language {language: system|en|cs|ru|es|es-419|fr|de|pt-BR|ja|ka|ko|sv|vi|zh-Hans|…}`: the app's interface language, applied live ("system": the OS or browser language; a language without a catalog shows English). Command ids, labels and every result stay English. diff --git a/docs/translating.md b/docs/translating.md index eaa59755b..73ee51366 100644 --- a/docs/translating.md +++ b/docs/translating.md @@ -17,7 +17,7 @@ Simplified. The catalogs: English (`en`, the source), and Spanish (`es`, with the Latin American overlay `es-419`), French (`fr`), German (`de`), Dutch (`nl`), Brazilian Portuguese (`pt-BR`), Japanese (`ja`), Korean (`ko`), Simplified Chinese (`zh-Hans`), Czech (`cs`), Indonesian (`id`), Finnish -(`fi`), Polish (`pl`) and Bengali (`bn`), machine-drafted and waiting for native speakers' review. Georgian +(`fi`), Polish (`pl`), Bengali (`bn`) and Vietnamese (`vi`), machine-drafted and waiting for native speakers' review. Georgian (`ka`) was written with AI assistance and reviewed by a native speaker, and stays a draft until a maintainer changes its status. Russian (`ru`, Русский) was reviewed and approved by VanTan; its catalog keeps Frame, Dev Mode and Smart animate as familiar @@ -61,7 +61,9 @@ formal Anda (never kamu), keeps established design terms in English (frame, laye instance, auto layout, plugin, file) and keeps a noun unchanged after a count, so its plural entries give only `other`. Georgian has no letter case (never write Mtavruli for capitals), uses verbal nouns for commands (გვერდის დამატება) and keeps a noun singular after a numeral, so counts read -"შრე: {n}" and its plural entries give the same text for `one` and `other`. +"შრე: {n}" and its plural entries give the same text for `one` and `other`. Vietnamese uses concise +imperatives for buttons and menu items (Lưu, Xóa) and keeps a noun unchanged after a count, so its +plural entries give only `other`. CJK text needs a CJK font, which egui and Inter lack: the desktop app adds an installed one when something on screen needs it (see `crates/ui-egui/src/cjk.rs`). The web build has no system fonts, @@ -80,8 +82,8 @@ picker leaves Georgian out. A new CJK or other non-Latin language also needs its set `[meta] name` and `status = "draft — needs native review"`. 2. Translate every value; keep the keys. Keep `{placeholders}` exactly, "…" where English has it, brand names and keyboard glyphs. English labels of commands: `figcraft-cli commands`. -3. Plurals: give `one` only if the language has a singular form (Japanese, Korean and Chinese give - only `other`). `other` is required; `one`, `few` and `many` are optional. `trn` picks `one` for +3. Plurals: give `one` only if the language has a singular form (Japanese, Korean, Chinese and + Vietnamese give only `other`). `other` is required; `one`, `few` and `many` are optional. `trn` picks `one` for 1 (also 0 in French and Brazilian Portuguese). Russian uses `one` for 1, 21, 31… except 11; `few` for 2–4, 22–24… except 12–14; and `many` for the other integers, including 0. Keep `{n}` in all Russian forms. Add new rules to `plural` in @@ -94,8 +96,8 @@ picker leaves Georgian out. A new CJK or other non-Latin language also needs its 4. To require full coverage, add the code to `COMPLETE` in [`crates/ui-egui/src/i18n_tests.rs`](../crates/ui-egui/src/i18n_tests.rs). Every later PR that adds a string then has to translate it into each complete language, so only Spanish is there: - French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Czech, Indonesian and - Georgian are registered as drafts, Russian and Turkish are reviewed but not required, and a string added + French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Czech, Indonesian, + Georgian and Vietnamese are registered as drafts, Russian and Turkish are reviewed but not required, and a string added later shows English in them until it is translated. To list what a draft lacks, add its code to `COMPLETE` locally and run the check. 5. Run the check and look at the panels in the app (longer words must fit the right panel): From d3a1538614ee897ce408b9b70fffb681e425e496 Mon Sep 17 00:00:00 2001 From: Nicek Date: Thu, 22 Oct 2026 13:00:27 +0800 Subject: [PATCH 505/817] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=9F=A2?= =?UTF-8?q?=E9=87=8F=E7=BC=96=E8=BE=91=E6=A8=A1=E5=BC=8F=E4=B8=8B=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E7=A9=BA=E7=94=BB=E5=B8=83=E7=9A=84=E8=A1=8C=E4=B8=BA?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/engine/src/vector_behaviour_tests.rs | 4 ++- .../src/vector_multi_behaviour_tests.rs | 7 +++-- crates/engine/src/vectoredit/pointer.rs | 8 ++++-- crates/ui-egui/src/canvas.rs | 17 +++++++++--- .../ui-egui/src/canvas_double_click_tests.rs | 26 ++++++++++++++++--- docs/ui-parity.md | 3 ++- 6 files changed, 53 insertions(+), 12 deletions(-) diff --git a/crates/engine/src/vector_behaviour_tests.rs b/crates/engine/src/vector_behaviour_tests.rs index 230d29981..60cf960e3 100644 --- a/crates/engine/src/vector_behaviour_tests.rs +++ b/crates/engine/src/vector_behaviour_tests.rs @@ -94,7 +94,8 @@ fn entering_and_leaving_vector_edit_mode() { ("Enter", false, "Enter leaves edit mode"), ("Escape", false, "Escape leaves edit mode"), ("Escape with an open pen path", true, "Escape first ends the pen's path and stays in edit mode"), - ("click outside", false, "silent: a click away from the shape leaves edit mode (pinned)"), + ("click outside", true, "silent: a click away from the shape only clears the points (pinned)"), + ("double-click outside", false, "a double-click away from the shape leaves edit mode"), ]; for (how, after, why) in rows { let mut s = Session::new(); @@ -113,6 +114,7 @@ fn entering_and_leaving_vector_edit_mode() { key(&mut s, "Escape", false); assert!(editing(&s).is_some_and(|e| e.anchor.is_none()), "{why}: the path ended"); } + "double-click outside" => s.pointer(&ev(PointerKind::DoubleClick, (600.0, 600.0), NONE)).unwrap(), _ => click(&mut s, (600.0, 600.0), NONE), } assert_eq!(editing(&s).is_some(), after, "{why}"); diff --git a/crates/engine/src/vector_multi_behaviour_tests.rs b/crates/engine/src/vector_multi_behaviour_tests.rs index 1d2075b1e..28559a48a 100644 --- a/crates/engine/src/vector_multi_behaviour_tests.rs +++ b/crates/engine/src/vector_multi_behaviour_tests.rs @@ -203,13 +203,16 @@ fn editing_several_vectors_at_once() { assert_eq!((net(&s, a).vertices.len(), net(&s, b).vertices.len()), (5, 4), "silent: the pen adds to the active layer (pinned)"); ex(&mut s, "vector.edit.penEnd", json!({})); ex(&mut s, "vector.edit.tool", json!({"tool": "move"})); - // A click on empty canvas inside an edited layer's area keeps edit mode; far away it ends. + // A click on empty canvas inside an edited layer's area keeps edit mode; so does one far + // away, which only clears the points (a double-click or Escape leaves). click(&mut s, (250.0, 50.0), NONE); assert!(editing(&s).is_some(), "a click inside an edited layer clears the points and stays"); let st = ex(&mut s, "vector.edit.state", json!({})); assert_eq!(st["layers"].as_array().map(Vec::len), Some(2), "the state lists every edited layer"); click(&mut s, (900.0, 900.0), NONE); - assert!(editing(&s).is_none(), "a click away from every edited layer leaves edit mode"); + assert!(editing(&s).is_some(), "a click away from every edited layer keeps edit mode"); + s.pointer(&ev(PointerKind::DoubleClick, (900.0, 900.0), NONE)).unwrap(); + assert!(editing(&s).is_none(), "a double-click away from every edited layer leaves edit mode"); } #[test] diff --git a/crates/engine/src/vectoredit/pointer.rs b/crates/engine/src/vectoredit/pointer.rs index 1684bf260..4bf8477c0 100644 --- a/crates/engine/src/vectoredit/pointer.rs +++ b/crates/engine/src/vectoredit/pointer.rs @@ -695,10 +695,14 @@ impl Session { } } None => { - // Outside every edited layer (and not shift): leave edit mode. + // A press on another layer (and not shift) leaves edit mode, so the normal tool + // takes it; empty canvas only clears the points and starts a marquee (a + // double-click or Escape leaves edit mode). let inside = ve.parts().iter().any(|p| doc.world_render_bounds(p.id).is_some_and(|b| b.inflate(tol * 4.0, tol * 4.0).contains(ev.p()))); - if !inside && !ev.shift { + let page = self.ds()?.page; + let other = !inside && self.hit(&doc, page, ev.p(), tol * 2.0).is_some(); + if other && !ev.shift { super::end(self)?; return Ok(false); } diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 841c95e82..fe9a03447 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -606,9 +606,20 @@ fn input(app: &mut FigApp, ui: &mut Ui, resp: &egui::Response) -> bool { } // A third quick click is counted as a triple, not a double (a click elsewhere in between still // leaves its time in the sequence): it means the same here — edit, enter, open — unless a - // vector or text is being edited, where a triple already has its own meaning. - let editing = app.session.ds().is_ok_and(|d| d.vector_edit.is_some() || d.text_edit.is_some()); - if resp.double_clicked() || (resp.triple_clicked() && !editing) { + // vector or text is being edited, where a triple already has its own meaning. A triple on + // empty canvas still means a double in vector edit mode: the double-click that entered edit + // mode counts on, so leaving it right away would otherwise take a fourth click or a pause. + let ds = app.session.ds().ok(); + let editing = ds.is_some_and(|d| d.vector_edit.is_some() || d.text_edit.is_some()); + let empty_canvas = ds.is_some_and(|d| { + let Some(ve) = d.vector_edit.as_ref().filter(|v| v.anchor.is_none() && d.text_edit.is_none()) else { + return false; + }; + let p = app.to_page(pos); + let tol = 6.0 / d.view.zoom.max(1e-6); + ve.parts().iter().all(|part| d.doc.world_render_bounds(part.id).is_none_or(|b| !b.inflate(tol * 4.0, tol * 4.0).contains(p))) + }); + if resp.double_clicked() || (resp.triple_clicked() && (!editing || empty_canvas)) { let ev = pointer_event(app, PointerKind::DoubleClick, pos, &mods); if let Err(e) = app.session.pointer(&ev) { app.toast(e.to_string()); diff --git a/crates/ui-egui/src/canvas_double_click_tests.rs b/crates/ui-egui/src/canvas_double_click_tests.rs index c47faa741..72f91b760 100644 --- a/crates/ui-egui/src/canvas_double_click_tests.rs +++ b/crates/ui-egui/src/canvas_double_click_tests.rs @@ -85,7 +85,23 @@ fn double_clicking_an_unselected_shape_edits_its_points() { } #[test] -fn a_click_that_leaves_vector_edit_does_not_keep_the_next_double_click_out() { +fn a_double_click_on_empty_canvas_right_after_entering_leaves_vector_edit() { + let mut s = Session::new(); + let r = s.execute("shape.rectangle", &json!({"x": 100, "y": 100, "width": 300, "height": 200})).unwrap(); + let r: NodeId = figcraft_engine::params::id_of(&r["id"]).unwrap(); + s.execute("select.none", &json!({})).unwrap(); + let mut u = Ui::new(s); + let shape = u.app.to_screen(250.0, 200.0); + let empty = Pos2::new(u.app.canvas.rect.left() + 30.0, u.app.canvas.rect.bottom() - 30.0); + // The double-click that enters edit mode, then straight away one on empty canvas. + double_click_at(&mut u, shape); + assert_eq!(u.app.session.ds().unwrap().vector_edit.as_ref().map(|v| v.id), Some(r)); + double_click_at(&mut u, empty); + assert!(u.app.session.ds().unwrap().vector_edit.is_none(), "a double-click on empty canvas leaves vector edit at once"); +} + +#[test] +fn a_click_on_empty_canvas_keeps_vector_edit_until_a_double_click() { let mut s = Session::new(); let r = s.execute("shape.rectangle", &json!({"x": 100, "y": 100, "width": 300, "height": 200})).unwrap(); let r: NodeId = figcraft_engine::params::id_of(&r["id"]).unwrap(); @@ -95,9 +111,13 @@ fn a_click_that_leaves_vector_edit_does_not_keep_the_next_double_click_out() { let empty = Pos2::new(u.app.canvas.rect.left() + 30.0, u.app.canvas.rect.bottom() - 30.0); double_click_at(&mut u, shape); assert!(u.app.session.ds().unwrap().vector_edit.is_some()); - // One click on empty canvas leaves the edit mode. + // One click on empty canvas only clears the points: edit mode stays. click(&mut u, empty); - assert!(u.app.session.ds().unwrap().vector_edit.is_none(), "a click outside leaves vector edit"); + assert!(u.app.session.ds().unwrap().vector_edit.is_some(), "a click on empty canvas keeps vector edit"); + // A double-click on empty canvas leaves it, the earlier click and the counts from entering + // included. + double_click_at(&mut u, empty); + assert!(u.app.session.ds().unwrap().vector_edit.is_none(), "a double-click on empty canvas leaves vector edit"); // The next double-click edits the shape again. double_click_at(&mut u, shape); assert!(u.app.session.ds().unwrap().vector_edit.is_some(), "a double-click edits it again"); diff --git a/docs/ui-parity.md b/docs/ui-parity.md index d87103f07..2355de894 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -82,7 +82,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 or Enter 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`) | -| 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); 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`). Not yet: the transform box around points of several layers; 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); 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 click on empty canvas only clears the points and starts a marquee (edit mode stays; a double-click or Escape leaves it), while a click on another layer leaves it and selects that layer. Not yet: the transform box around points of several layers; 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 | | | Text: point, auto height, fixed; caret, words, lines, IME | done | the font picker previews a family on the canvas while hovered (no undo step; Escape restores, #653); 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; 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 | @@ -172,6 +172,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| +| 2026-10-22 | minor | Vector edit mode stays on a click on empty canvas: with the Move tool it only clears the points and starts a marquee, and a double-click (or Escape) leaves it; a click on another layer still leaves it and selects that layer. A double-click on empty canvas leaves it even straight after the one that entered edit mode (the platform counts those clicks on, so the last one arrives as a triple; on empty canvas a triple means a double here, while triples on the vector keep their own meaning) (`vector_behaviour_tests`, `canvas_double_click_tests`). Checked in the app on Windows with real mouse clicks over the control channel | | 2026-10-20 | minor | Readable disabled and selected text (#890): the dim text colour (disabled buttons, placeholders, hints) is at least 3:1 against panels, fields and selected rows in both themes (it was 2.1:1 in the light theme), a disabled button is grey with that text instead of fading to 40%, and selected text (renaming a page or layer, any text box) takes the theme's readable green on the highlight (1.4:1 in the dark theme before, now 4.2:1 or more); checked with the colour contrast helper (`theme::tests`). Numbers unchanged | | 2026-10-20 | minor | Measuring while nudging (#894): with Alt held over another layer, the arrows nudge the selection (Shift: the big step) and the distances follow every nudge (Alt+arrows used to do nothing); while measuring, the selection's handles and size label hide and both layers keep their outlines (`measure_nudge_tests`). Numbers unchanged | | 2026-10-18 | minor | A rename (layers double-click, F2, File ▸ Rename, a page) selects the whole name in the frame its field first draws, so the first key replaces the name instead of being appended. Checked in the app on Windows over the control channel | From 80b9b491092bc21d8dae7d7251c9db0bafbd415e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=E1=BB=91ng=20Huy=20S=C6=A1n?= Date: Thu, 22 Oct 2026 12:02:08 +0700 Subject: [PATCH 506/817] docs(i18n): reconcile catalog entry counts to 2,352 in localization-parity.md --- docs/localization-parity.md | 40 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 05596fa39..86c091785 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -1,6 +1,6 @@ # Localization parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (macOS finds its downloadable CJK system fonts (#406); string counts re-measured: 2,272 entries, the drafts at 95–99%; Swedish command labels and menu wordings; Russian, Swedish, Turkish, Czech and Indonesian listed; a duplicated paragraph removed; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-22 · **Change:** minor (Vietnamese draft catalog; string counts re-measured: 2,352 entries; macOS finds its downloadable CJK system fonts (#406); Swedish command labels and menu wordings; Russian, Swedish, Turkish, Czech and Indonesian listed; a duplicated paragraph removed; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog) · **Target:** Figma Design (desktop app 126.10.7) FigCraft's interface has a localization layer with an English catalog, a Russian catalog reviewed by a native speaker, and Spanish (with a Latin American overlay), French, German, Brazilian @@ -18,16 +18,16 @@ browser's page translation. The `.lproj` folders in `/Applications/Figma.app` (6 Electron/Chromium locale packs, not Figma's own UI languages. Text *content* in any script is supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no vertical text. -## What FigCraft has (measured 2026-10-17, from source) +## What FigCraft has (measured 2026-10-22, from source) - **Layer:** one TOML catalog per language in `crates/ui-egui/locales/`, baked into the binary by the UI crate's build script (desktop and web; nothing read at run time). Keys are the English text (`tr("Fill")`, `trf` for `{named}` placeholders, `trn` for counts with one/few/many/other plural forms), so a missing translation shows English, never a raw key. One English text that needs two translations takes a context (`"Fill|sizing"`). -- **Strings:** 1,680 UI keys in `en.toml` (41 with plural forms; ~110 are labels from engine and - document data, such as tool names, blend modes and Dev Mode properties) plus 561 command labels - and 31 menu wordings by command id: 2,272 entries (counted against `en.toml` and the complete +- **Strings:** 1,747 UI keys in `en.toml` (42 with plural forms; ~110 are labels from engine and + document data, such as tool names, blend modes and Dev Mode properties) plus 574 command labels + and 31 menu wordings by command id: 2,352 entries (counted against `en.toml` and the complete Spanish catalog's command and menu tables). Command ids, the CLI, MCP and the control channel stay English. Accessibility names come from the same strings. - **Language preference:** Preferences ▸ Language (System, then each catalog by its own name: @@ -48,8 +48,8 @@ supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no v lacks, keys no code uses, unknown command ids, placeholders that differ from English, overlay entries that read as in their base language and, for complete languages (Spanish), anything untranslated. The other catalogs are not held to it: a string added later shows English there - until someone translates it. Every draft translated every string on 2026-10-12; by 2026-10-17 - the strings added since left them at 95–99% (table below). + until someone translates it. Every draft translated every string on 2026-10-12; by 2026-10-22 + the strings added since left them at 94–99% (table below). - **Not yet localized:** messages the engine writes (errors, a few toasts, Dev Mode property values such as "inside"), number formatting (decimal points stay `.`), and decimal plural rules (`trn` takes integers: Czech uses one/few/other and Russian one/few/many; French and Brazilian @@ -85,23 +85,23 @@ supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no v | Language | Code | UI strings translated | Dialogs / tooltips / help | Script support | Native review | Status | Hours to full | |---|---|---|---|---|---|---|---| -| English | en | 2,272 / 2,272 (100%, source) | yes | Latin | yes (source) | full | 0 | -| Simplified Chinese (Mandarin) | zh-Hans | 2,166 / 2,272 (95.3%, draft) | yes | CJK text and IME in documents; UI text in an installed Chinese face, ahead of Japanese ones (web: the `FIGCRAFT_EMBED_CJK` build); no Traditional Chinese catalog (zh-TW, zh-HK read English) | no | draft | 1–2 (after native review) | -| Spanish | es, es-419 | 2,272 / 2,272 (100%, draft); es-419 overlays 101 Latin American wordings (draft) | yes | Latin | no | draft | 0–1 (after native review) | +| English | en | 2,352 / 2,352 (100%, source) | yes | Latin | yes (source) | full | 0 | +| Simplified Chinese (Mandarin) | zh-Hans | 2,216 / 2,352 (94.2%, draft) | yes | CJK text and IME in documents; UI text in an installed Chinese face, ahead of Japanese ones (web: the `FIGCRAFT_EMBED_CJK` build); no Traditional Chinese catalog (zh-TW, zh-HK read English) | no | draft | 1–2 (after native review) | +| Spanish | es, es-419 | 2,352 / 2,352 (100%, draft); es-419 overlays 104 Latin American wordings (draft) | yes | Latin | no | draft | 0–1 (after native review) | | Hindi | hi | 0 (0%) | no | Devanagari shaping works in documents; UI font fallback to check | no | none | 4–7 | | Arabic | ar | 0 (0%) | no | Bidi, shaping and RTL names work; the UI does not mirror | no | none | 9–15 | -| French | fr | 2,167 / 2,272 (95.4%, draft) | yes | Latin | no | draft | 1–2 (after native review) | -| Portuguese | pt-BR | 2,167 / 2,272 (95.4%, draft) | yes | Latin | no | draft | 1–2 (after native review) | -| Indonesian | id | 2,244 / 2,272 (98.8%, draft) | yes | Latin | no | draft | 1–2 (after native review) | -| Japanese | ja | 2,254 / 2,272 (99.2%, draft) | yes | CJK text and IME in documents; UI text in an installed Japanese face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | -| German | de | 2,176 / 2,272 (95.8%, draft) | yes | Latin; long words elide in narrow fields | no | draft | 1–2 (after native review) | -| Korean | ko | 2,166 / 2,272 (95.3%, draft) | yes | Hangul text and IME in documents; UI text in an installed Korean face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | +| French | fr | 2,328 / 2,352 (99.0%, draft) | yes | Latin | no | draft | 1–2 (after native review) | +| Portuguese | pt-BR | 2,331 / 2,352 (99.1%, draft) | yes | Latin | no | draft | 1–2 (after native review) | +| Indonesian | id | 2,292 / 2,352 (97.4%, draft) | yes | Latin | no | draft | 1–2 (after native review) | +| Japanese | ja | 2,304 / 2,352 (98.0%, draft) | yes | CJK text and IME in documents; UI text in an installed Japanese face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | +| German | de | 2,226 / 2,352 (94.6%, draft) | yes | Latin; long words elide in narrow fields | no | draft | 1–2 (after native review) | +| Korean | ko | 2,216 / 2,352 (94.2%, draft) | yes | Hangul text and IME in documents; UI text in an installed Korean face (web: the `FIGCRAFT_EMBED_CJK` build) | no | draft | 1–2 (after native review) | | Vietnamese | vi | 2,352 / 2,352 (100%, draft) | yes | Latin with stacked diacritics | no | draft | 1–2 (after native review) | -Other languages (measured 2026-10-17): Russian (`ru`) 2,244 / 2,272 (98.8%), reviewed and approved -by VanTan, one/few/many integer plurals; Swedish (`sv`) 2,264 (99.6%), its command labels and menu -wordings added 2026-10-17 (#599), native review welcome; Turkish (`tr`) 2,243 (98.7%), whose header -says it was machine-drafted and reviewed by a native speaker; Czech (`cs`) 2,244 (98.8%), a draft +Other languages (measured 2026-10-22): Russian (`ru`) 2,352 / 2,352 (100%), reviewed and approved +by VanTan, one/few/many integer plurals; Swedish (`sv`) 2,314 / 2,352 (98.4%), its command labels and menu +wordings added 2026-10-17 (#599), native review welcome; Turkish (`tr`) 2,291 / 2,352 (97.4%), whose header +says it was machine-drafted and reviewed by a native speaker; Czech (`cs`) 2,292 / 2,352 (97.4%), a draft with one/few/other plurals. Figma ships none beyond the eight above. The layer is done. Per-language hours above are agent hours for a catalog of ~1,800 entries From aa5cc840e5b4b9a346e5721b90a280e4b17ff26c Mon Sep 17 00:00:00 2001 From: Muamer Mustafic Date: Thu, 22 Oct 2026 07:46:23 +0200 Subject: [PATCH 507/817] M1: re-run CI (#910) From 90004dc7cd1cb1ccaad971af75b81f72bbbcab62 Mon Sep 17 00:00:00 2001 From: Nicek Date: Thu, 22 Oct 2026 13:52:06 +0800 Subject: [PATCH 508/817] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=A4=9A?= =?UTF-8?q?=E9=80=89=E7=9F=A2=E9=87=8F=E7=82=B9=E6=97=B6=E5=8F=98=E6=8D=A2?= =?UTF-8?q?=E6=A1=86=E7=9A=84=E4=BA=A4=E4=BA=92=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了多选矢量点时,变换框角点会误判为可拖动的点的问题,同时更新了相关注释和测试用例,确保未被点占据的角点和边缘仍可用于缩放操作。 --- crates/engine/src/vectoredit/transform.rs | 8 ++- .../engine/src/vectoredit/transform_tests.rs | 55 +++++++++++++------ crates/ui-egui/src/canvas.rs | 4 +- docs/ui-parity.md | 2 +- 4 files changed, 48 insertions(+), 21 deletions(-) diff --git a/crates/engine/src/vectoredit/transform.rs b/crates/engine/src/vectoredit/transform.rs index 1d5f27a6a..8ec9826aa 100644 --- a/crates/engine/src/vectoredit/transform.rs +++ b/crates/engine/src/vectoredit/transform.rs @@ -85,14 +85,16 @@ pub enum BoxHit { } /// The box's part under page point `p` when it wins over `h`, the network's part there: Bezier -/// handles come first, then the box's corners, points, the box's edges, segments, the rotation -/// zones, and the inside of the box last. Edges along an axis without extent are left out. +/// handles come first, then points, the box's corners, its edges, segments and the rotation zones, +/// and the inside of the box last. A point under a corner or an edge is dragged with the others +/// (the box draws no handles of its own), so it keeps the box off. Edges along an axis without +/// extent are left out. pub fn box_hit(doc: &Document, ve: &VectorEdit, h: Option, p: Point, zoom: f64) -> Option { let b = shown_box(doc, ve)?; match handle_at_corners(&b.corners(), p, zoom, false) { Some(handle) => { let wins = match (handle, h) { - (_, Some(VHit::Handle { .. })) => false, + (_, Some(VHit::Handle { .. } | VHit::Vertex { .. })) => false, (Handle::Corner(_), _) => true, (Handle::Edge(e), None | Some(VHit::Segment { .. })) => { if e % 2 == 0 { diff --git a/crates/engine/src/vectoredit/transform_tests.rs b/crates/engine/src/vectoredit/transform_tests.rs index d69baf52f..c608c3aa8 100644 --- a/crates/engine/src/vectoredit/transform_tests.rs +++ b/crates/engine/src/vectoredit/transform_tests.rs @@ -7,6 +7,7 @@ use super::tests::{click, drag, ev, ex, net, pt, rect, ve, vertex_at}; use super::transform::{BoxHit, box_hit, shown_box}; use super::*; use crate::EngineError; +use crate::params::id_of; use crate::tools::{Handle, PointerKind, ToolId}; /// Page position of point `v` of vector `id`. @@ -47,13 +48,15 @@ fn the_box_shows_for_two_or_more_points_with_the_move_tool() { let b = shown_box(s.doc().unwrap(), &ve(&s)).unwrap(); assert_eq!((b.width, b.height, b.points.len()), (100.0, 100.0, 4)); assert!(near(b.corners()[2], pt(100.0, 100.0))); - // Corners win over the points under them, points over edges, edges over segments. + // A point under a corner is dragged with the others, not scaled (the box draws no handles of + // its own), so it keeps the box off; corners and edges clear of points still scale, and edges + // win over segments. let doc = s.doc().unwrap().clone(); let at = |x, y| { let h = hit(&doc, &ve(&s), pt(x, y), 6.0); box_hit(&doc, &ve(&s), h, pt(x, y), 1.0) }; - assert_eq!(at(100.0, 100.0), Some(BoxHit::Handle(Handle::Corner(2)))); + assert_eq!(at(100.0, 100.0), None, "a point under the corner: a drag moves the points"); assert_eq!(at(100.0, 50.0), Some(BoxHit::Handle(Handle::Edge(1)))); assert_eq!(at(110.0, -10.0), Some(BoxHit::Handle(Handle::Rotate(1)))); assert_eq!(at(40.0, 60.0), Some(BoxHit::Inside)); @@ -64,27 +67,47 @@ fn the_box_shows_for_two_or_more_points_with_the_move_tool() { } #[test] -fn corners_scale_points_in_one_undo_step() { +fn corners_clear_of_points_scale_them_in_one_undo_step() { let mut s = Session::new(); - let id = rect(&mut s); + // An L of three points: the box's bottom-right corner (50, 50) has no point under it. + let id = id_of(&ex(&mut s, "vector.create", json!({"points": [[0, 0], [50, 0], [0, 50]], "closed": false}))["id"]).unwrap(); + ex(&mut s, "vector.edit.begin", json!({"id": id})); select_all(&mut s); - drag(&mut s, (100.0, 100.0), (150.0, 120.0)); - let b = s.doc().unwrap().world_bounds(id).unwrap(); - assert_eq!((b.x0, b.y0, b.x1, b.y1), (0.0, 0.0, 150.0, 120.0)); - assert_eq!(ve(&s).vertices.len(), 4, "the points stay selected"); + drag(&mut s, (50.0, 50.0), (150.0, 120.0)); + assert!(near(page_pt(&s, id, 1), pt(150.0, 0.0)) && near(page_pt(&s, id, 2), pt(0.0, 120.0)), "{:?}", page_pt(&s, id, 1)); + assert_eq!(ve(&s).vertices.len(), 3, "the points stay selected"); s.undo().unwrap(); - let b = s.doc().unwrap().world_bounds(id).unwrap(); - assert_eq!((b.width(), b.height()), (100.0, 100.0), "one undo step"); + assert!(near(page_pt(&s, id, 1), pt(50.0, 0.0)), "one undo step"); // Shift keeps proportions; Alt scales from the centre. select_all(&mut s); - drag_with(&mut s, (100.0, 100.0), (150.0, 110.0), true, false); - let b = s.doc().unwrap().world_bounds(id).unwrap(); - assert_eq!((b.x0, b.y0, b.x1, b.y1), (0.0, 0.0, 150.0, 150.0)); + drag_with(&mut s, (50.0, 50.0), (150.0, 110.0), true, false); + assert!(near(page_pt(&s, id, 1), pt(150.0, 0.0)) && near(page_pt(&s, id, 2), pt(0.0, 150.0)), "{:?}", page_pt(&s, id, 2)); s.undo().unwrap(); select_all(&mut s); - drag_with(&mut s, (100.0, 100.0), (110.0, 120.0), false, true); - let b = s.doc().unwrap().world_bounds(id).unwrap(); - assert_eq!((b.x0, b.y0, b.x1, b.y1), (-10.0, -20.0, 110.0, 120.0)); + drag_with(&mut s, (50.0, 50.0), (60.0, 70.0), false, true); + assert!( + near(page_pt(&s, id, 0), pt(-10.0, -20.0)) && near(page_pt(&s, id, 1), pt(60.0, -20.0)) && near(page_pt(&s, id, 2), pt(-10.0, 70.0)), + "{:?}", + page_pt(&s, id, 2) + ); +} + +#[test] +fn dragging_one_of_several_selected_points_moves_them_all_freely() { + let mut s = Session::new(); + let id = rect(&mut s); + let n = net(&s, id); + let (a, b) = (vertex_at(&n, 0.0, 0.0), vertex_at(&n, 100.0, 0.0)); + // Two points on one side: their box is a flat line, and the press is on a corner of it. + ex(&mut s, "vector.edit.select", json!({"vertices": [a, b]})); + drag(&mut s, (100.0, 0.0), (130.0, 40.0)); + assert!( + near(page_pt(&s, id, a), pt(30.0, 40.0)) && near(page_pt(&s, id, b), pt(130.0, 40.0)), + "{:?} {:?}", + page_pt(&s, id, a), + page_pt(&s, id, b) + ); + assert_eq!(ve(&s).vertices.len(), 2, "both stay selected"); } #[test] diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index fe9a03447..e6dbc3c8c 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -1039,8 +1039,10 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [ if width_tool { width_overlay(app, painter, &doc, &ve, zoom); } else if let Some(c) = app.session.vector_edit_box() { + // The box around several selected points draws no corner handles: they would read as + // points. Its corners and edges still scale the points when dragged. let label = format!("{} × {}", fmt((c[1] - c[0]).hypot()), fmt((c[3] - c[0]).hypot())); - size_label = transform_box(app, painter, c.map(|p| app.to_screen(p.x, p.y)), accent(painter), true, 4, Some(label)); + size_label = transform_box(app, painter, c.map(|p| app.to_screen(p.x, p.y)), accent(painter), true, 0, Some(label)); } } // Selection. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 2355de894..5421cd68a 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -82,7 +82,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 or Enter 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`) | -| 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); 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 click on empty canvas only clears the points and starts a marquee (edit mode stays; a double-click or Escape leaves it), while a click on another layer leaves it and selects that layer. Not yet: the transform box around points of several layers; 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); 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 click on empty canvas only clears the points and starts a marquee (edit mode stays; a double-click or Escape leaves it), while a click on another layer leaves it and selects that layer. The box around several selected points draws its outline and size only, without corner squares (they would read as points); a press on any selected point, corners included, drags them all freely, while its corners and edges clear of points still scale by drag. Not yet: the transform box around points of several layers; 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 | | | Text: point, auto height, fixed; caret, words, lines, IME | done | the font picker previews a family on the canvas while hovered (no undo step; Escape restores, #653); 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; 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 | From b13e5c4ff3dee91fcff37607ed9348d5024f1a74 Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Thu, 22 Oct 2026 09:00:37 +0200 Subject: [PATCH 509/817] M7: doc comments on the font scan's folders and scan_dir (#298) --- crates/text/src/fontdb.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/text/src/fontdb.rs b/crates/text/src/fontdb.rs index edfe5b604..32d34679a 100644 --- a/crates/text/src/fontdb.rs +++ b/crates/text/src/fontdb.rs @@ -731,6 +731,7 @@ impl FontDb { } } +/// The folders this platform keeps installed and activated fonts in, walked by the font scan. fn system_font_dirs() -> Vec { #[allow(unused_mut)] let mut v: Vec = Vec::new(); @@ -794,6 +795,9 @@ fn unix_user_font_dirs(home: Option, data_home: Option)>) { if depth > 6 { return; From 7cb4168e13dca45817b31c4ab26d892dd82d8612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindr=CC=8Cich=20S=CC=8Cars=CC=8Con?= Date: Thu, 22 Oct 2026 09:03:17 +0200 Subject: [PATCH 510/817] M6: Sketch import: fixes from the PR review - --no-system-fonts holds for .sketch imports too: the CLI opts the process out, so the import's font matching doesn't scan. - Shared text styles get the installed family and platform tracking their linked layers get. - Each text run writes its letter spacing, line height and font axes, neutral when it has none, instead of taking the first run's. - The unsupported-drop hint and its catalogs list .sketch. - A test sends damaged .sketch data through file.open and file.import. - Stack items are matched to their source layers through a map. - Docs: .sketch is a convert input; the Carbon kit's Sketch 47 edition is refused (the 68 and 83 ones open). Co-Authored-By: Claude Opus 5.5 --- apps/figcraft-cli/src/main.rs | 3 ++ apps/figcraft-cli/tests/fonts.rs | 26 +++++++++++++ crates/engine/src/cmd/file.rs | 11 ++++++ crates/engine/src/sketch_import_tests.rs | 49 +++++++++++++++++++++++- crates/engine/src/tests.rs | 13 +++++++ crates/format/src/sketch/stack.rs | 11 ++++-- crates/format/src/sketch/text.rs | 12 +++--- crates/format/src/sketch/text_tests.rs | 21 ++++++++++ crates/text/src/fontdb.rs | 13 ++++++- crates/text/src/lib.rs | 4 +- crates/ui-egui/locales/bn.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/ka.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/src/home.rs | 2 +- crates/ui-egui/src/home_tests.rs | 2 +- docs/cli.md | 2 +- docs/file-format-parity.md | 4 +- 26 files changed, 166 insertions(+), 31 deletions(-) diff --git a/apps/figcraft-cli/src/main.rs b/apps/figcraft-cli/src/main.rs index badc5bc30..fb96cd851 100644 --- a/apps/figcraft-cli/src/main.rs +++ b/apps/figcraft-cli/src/main.rs @@ -108,6 +108,9 @@ fn run(argv: &[String]) -> CliResult { // Text lays out with the installed fonts, like the desktop app, so headless renders and // auto layout sizes match what users see. figcraft_text::scan_system_fonts_on_demand(); + } else { + // Nothing scans them then, not even a `.sketch` import matching its fonts. + figcraft_text::opt_out_of_system_fonts(); } let Some((cmd, rest)) = argv.split_first() else { return Err(CliError::Usage("missing subcommand".into())) }; match cmd.as_str() { diff --git a/apps/figcraft-cli/tests/fonts.rs b/apps/figcraft-cli/tests/fonts.rs index ef5c638fa..e01dac10e 100644 --- a/apps/figcraft-cli/tests/fonts.rs +++ b/apps/figcraft-cli/tests/fonts.rs @@ -67,3 +67,29 @@ fn info_lists_the_fonts_a_file_uses_that_are_missing() { let shown = String::from_utf8_lossy(&out.stdout); assert!(shown.contains("missing font \"FigCraft Missing CLI\": 2 text layers"), "{shown}"); } + +/// A synthetic `.sketch` file: one page with one Helvetica text. +const SKETCH: &str = "UEsDBBQAAAAIAOFFVl2B8d55RwAAAFcAAAANAAAAZG9jdW1lbnQuanNvbqtWik/OSSwuVrJSUErJTy7NTc0rUdJRUCpITE8FCUZXIynwDfYK9vdzy8xJDUpNSy1KzUtOBamNL0pNA0mD9egHKNXG1gIAUEsDBBQAAAAIAOFFVl0B3thgPQAAAEkAAAAJAAAAbWV0YS5qc29uq1ZKLChQslJQSs7P1UvKz0jNzUzMS85PycxL1yvOTi1JzjBW0lEAKQpLLSrOzM8DqTUzAYmVwQUMjUxrAVBLAwQUAAAACADhRVZdo5nc2bkAAABnAQAADAAAAHBhZ2VzL1AuanNvbm1PQQrCMBD8StmzB1voxZsgUg+CUG8iJU3XNhITaVZtLf27SWylFEPIzgyzs5sOMi6ZMbAK4M5KhEUAhc50fkVOu42TD05T7IaeDB7JWqxd16mbJBA29CfhOE3w5FJ/WQeNfZdWaYf6EgVVFseOVCjKiiwL495SRlSL/EFYpBao0geYEUIiYGoatpOaMxJaDfkSVekHRHNvB/t0PZuw1Yp+mvfMWsZfJSifSIIzt4IRbyeGUW/P2d0PUEsBAhQDFAAAAAgA4UVWXYHx3nlHAAAAVwAAAA0AAAAAAAAAAAAAAIABAAAAAGRvY3VtZW50Lmpzb25QSwECFAMUAAAACADhRVZdAd7YYD0AAABJAAAACQAAAAAAAAAAAAAAgAFyAAAAbWV0YS5qc29uUEsBAhQDFAAAAAgA4UVWXaOZ3Nm5AAAAZwEAAAwAAAAAAAAAAAAAAIAB1gAAAHBhZ2VzL1AuanNvblBLBQYAAAAAAwADAKwAAAC5AQAAAAA="; + +/// Opening a `.sketch` file (whose import matches fonts against the installed ones) keeps to +/// `--no-system-fonts` too: the run still knows only the built-in families. +#[test] +fn sketch_imports_keep_to_no_system_fonts() { + let d = std::env::temp_dir().join(format!("figcraft-cli-fonts-sketch-{}", std::process::id())); + std::fs::create_dir_all(&d).unwrap(); + let script = d.join("open.json"); + let steps = json!([{"command": "file.open", "params": {"data": SKETCH, "name": "x.sketch"}}, {"command": "text.fonts"}]); + std::fs::write(&script, steps.to_string()).unwrap(); + let out = Command::new(env!("CARGO_BIN_EXE_figcraft-cli")) + .arg("run") + .arg(&script) + .arg("--no-system-fonts") + .env_remove("FIGCRAFT_NO_SYSTEM_FONTS") + .output() + .unwrap(); + assert!(out.status.success(), "{}", String::from_utf8_lossy(&out.stderr)); + let lines: Vec = String::from_utf8_lossy(&out.stdout).lines().map(|l| serde_json::from_str(l).unwrap()).collect(); + assert_eq!(lines[0]["ok"], json!(true), "{lines:?}"); + let fonts: Vec = serde_json::from_value(lines[1]["result"].clone()).unwrap(); + assert_eq!(fonts, families(&["--no-system-fonts"], false), "the import didn't scan the system fonts"); +} diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index 8f7da8243..8bbdc7359 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -633,6 +633,12 @@ fn match_font_families(doc: &mut Document) { } } } + // Shared text styles too, so they stay like the layers linked to them. + for st in &mut doc.styles { + if let StyleKind::Text { style } = &mut st.kind { + fix(style); + } + } } /// Sketch draws text with the tracking a font's `trak` table gives at its size (Apple's text engine @@ -668,6 +674,11 @@ fn platform_tracking(doc: &mut Document) { } } } + for st in &mut doc.styles { + if let StyleKind::Text { style } = &mut st.kind { + track(style); + } + } } /// Families Sketch (Apple's text system) gives a fifth more than their ascent and descent as their diff --git a/crates/engine/src/sketch_import_tests.rs b/crates/engine/src/sketch_import_tests.rs index 292cd019c..7ecdd4673 100644 --- a/crates/engine/src/sketch_import_tests.rs +++ b/crates/engine/src/sketch_import_tests.rs @@ -17,13 +17,22 @@ fn sketch(app_version: &str, pages: &[(&str, &str)]) -> Vec { /// [`sketch`] with `layers` on the first page. fn sketch_with(app_version: &str, pages: &[(&str, &str)], layers: &[Value]) -> Vec { + sketch_with_doc(app_version, pages, layers, json!({})) +} + +/// [`sketch_with`] with the fields of `extra` added to `document.json` (shared styles…). +fn sketch_with_doc(app_version: &str, pages: &[(&str, &str)], layers: &[Value], extra: Value) -> Vec { let refs: Vec = pages.iter().map(|(id, _)| json!({"_class": "MSJSONFileReference", "_ref": format!("pages/{id}")})).collect(); + let mut document = json!({"_class": "document", "pages": refs}); + for (k, v) in extra.as_object().into_iter().flatten() { + document[k] = v.clone(); + } let mut out = Vec::new(); { let mut z = zip::ZipWriter::new(std::io::Cursor::new(&mut out)); let o = zip::write::SimpleFileOptions::default(); z.start_file("document.json", o).unwrap(); - z.write_all(json!({"_class": "document", "pages": refs}).to_string().as_bytes()).unwrap(); + z.write_all(document.to_string().as_bytes()).unwrap(); z.start_file("meta.json", o).unwrap(); // The format version that Sketch writes (103 for 50; 110 and up from 52). let version = if app_version.split('.').next().and_then(|v| v.parse::().ok()).is_some_and(|v| v >= 52) { 125 } else { 103 }; @@ -476,3 +485,41 @@ fn sketch_text_in_a_stack_stays_put() { let after = doc.world_bounds(label).unwrap(); assert!((before.y0 - after.y0).abs() < 1e-6, "{before:?} → {after:?}"); } + +/// Shared text styles get what their linked layers get on import: the installed family's name and +/// the platform's tracking (a layer and its style stay alike). +#[test] +fn sketch_shared_text_styles_match_their_layers() { + if !std::path::Path::new("/System/Library/Fonts/SFNS.ttf").exists() { + return; + } + figcraft_text::fontdb::scan_system_fonts(); + let attrs = json!({"MSAttributedStringFontAttribute": {"attributes": {"name": "SFUIText-Regular", "size": 13}}}); + let style = json!({"_class": "style", "textStyle": {"_class": "textStyle", "encodedAttributes": attrs.clone()}}); + let shared = json!({"_class": "sharedStyle", "do_objectID": "TS", "name": "Body", "value": style.clone()}); + let run = json!({"location": 0, "length": 2, "attributes": attrs}); + let mut linked = style; + linked["sharedObjectID"] = json!("TS"); + let t = shape( + "text", + "Label", + [0.0, 0.0, 100.0, 20.0], + json!({"attributedString": {"string": "Hi", "attributes": [run]}, "textBehaviour": 0, "style": linked}), + ); + let extra = json!({"layerTextStyles": {"_class": "sharedTextStyleContainer", "objects": [shared]}}); + let data = base64::engine::general_purpose::STANDARD.encode(sketch_with_doc("64", &[("A", "Page")], &[t], extra)); + let mut s = Session::new(); + s.execute("file.open", &json!({"data": data, "name": "x.sketch"})).unwrap(); + let doc = s.doc().unwrap(); + let NodeKind::Text(td) = &doc.nodes().find(|n| n.name == "Label").unwrap().kind else { panic!("not text") }; + let st = doc + .styles + .iter() + .find_map(|st| match &st.kind { + figcraft_doc::StyleKind::Text { style } if st.name == "Body" => Some(style.clone()), + _ => None, + }) + .unwrap(); + assert_eq!(st.font_family, td.style.font_family); + assert_eq!(st.letter_spacing.resolve(13.0), td.style.letter_spacing.resolve(13.0), "{st:?}"); +} diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index eeec9f046..6cf598a0f 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -633,3 +633,16 @@ fn find_replace_changing_only_the_case_replaces_every_occurrence() { assert_eq!(s.doc().unwrap().node(t).unwrap().kind.text().unwrap().characters, "FigCraft and FigCraft, FigCraft"); assert_eq!(s.doc().unwrap().node(f).unwrap().name, "FigCraft / FigCraft"); } + +/// Damaged and too-old `.sketch` data sent to the file commands (which the junk sweep skips) fail +/// with an ordinary error, not a caught panic. +#[test] +fn damaged_sketch_data_fails_without_panicking() { + for data in ["UEsDBBQAAAAIAP////8=", "U1FMaXRlIGZvcm1hdCAzAA=="] { + for cmd in ["file.open", "file.import"] { + let mut s = sess(); + let r = s.execute(cmd, &json!({"data": data, "name": "x.sketch"})); + assert!(matches!(r, Err(ref e) if !matches!(e, EngineError::Internal { .. })), "{cmd}: {r:?}"); + } + } +} diff --git a/crates/format/src/sketch/stack.rs b/crates/format/src/sketch/stack.rs index a6b2ddb23..89f67ca86 100644 --- a/crates/format/src/sketch/stack.rs +++ b/crates/format/src/sketch/stack.rs @@ -62,12 +62,17 @@ pub(crate) fn apply(l: &Value, node: &mut JsonMap) { node.insert("primaryAxisSizingMode".into(), json!(mode(main))); node.insert("counterAxisSizingMode".into(), json!(mode(cross))); // Items: flow order, sizing, absolute ones. - let sources: Vec<&Value> = super::tree::layers(l).iter().collect(); + // Source layers by id (the first of a repeated id). + let mut sources: std::collections::BTreeMap<&str, &Value> = std::collections::BTreeMap::new(); + for src in super::tree::layers(l) { + if let Some(id) = src.get("do_objectID").and_then(Value::as_str) { + sources.entry(id).or_insert(src); + } + } if let Some(kids) = node.get_mut("children").and_then(Value::as_array_mut) { // Children were built one per source layer, skipped ones aside: match them by id. for kid in kids.iter_mut() { - let id = kid.get("id").and_then(Value::as_str).map(str::to_string); - let Some(src) = sources.iter().find(|s| id.is_some() && s.get("do_objectID").and_then(Value::as_str) == id.as_deref()) else { continue }; + let Some(src) = kid.get("id").and_then(Value::as_str).and_then(|id| sources.get(id).copied()) else { continue }; let Some(m) = kid.as_object_mut() else { continue }; item(src, m, row, stretch); } diff --git a/crates/format/src/sketch/text.rs b/crates/format/src/sketch/text.rs index 027de6602..74cfa21c9 100644 --- a/crates/format/src/sketch/text.rs +++ b/crates/format/src/sketch/text.rs @@ -129,18 +129,18 @@ pub(crate) fn type_style(cx: &mut Cx, a: &Value) -> Value { cx.warn("text without a font uses Helvetica"); } let mut s = json!({"fontFamily": family, "fontStyle": style, "fontSize": size.min(10_000.0)}); - if let Some(v) = font.and_then(|f| f.get("variation")).and_then(variations) { - s["fontVariations"] = v; - } + // Every field is written, neutral when the run has none: a run's style starts from the text's + // (its first run's), and an unwritten field would keep that one's value. + s["fontVariations"] = font.and_then(|f| f.get("variation")).and_then(variations).unwrap_or_else(|| json!({})); let p = a.get("paragraphStyle"); let line = |k: &str| p.and_then(|p| p.get(k)).and_then(Value::as_f64).filter(|v| v.is_finite() && *v > 0.0); if let Some(lh) = line("maximumLineHeight").or_else(|| line("minimumLineHeight")) { s["lineHeightPx"] = json!(lh.min(1e4)); s["lineHeightUnit"] = json!("PIXELS"); + } else { + s["lineHeightUnit"] = json!("INTRINSIC_%"); } - if let Some(k) = a.get("kerning").and_then(Value::as_f64).filter(|k| k.is_finite()) { - s["letterSpacing"] = json!(k); - } + s["letterSpacing"] = json!(a.get("kerning").and_then(Value::as_f64).filter(|k| k.is_finite()).unwrap_or(0.0).clamp(-1e4, 1e4)); let set = |k: &str| a.get(k).and_then(Value::as_i64).is_some_and(|v| v != 0); s["textDecoration"] = json!(if set("underlineStyle") { "UNDERLINE" diff --git a/crates/format/src/sketch/text_tests.rs b/crates/format/src/sketch/text_tests.rs index 8adef1ea3..0e8a4a279 100644 --- a/crates/format/src/sketch/text_tests.rs +++ b/crates/format/src/sketch/text_tests.rs @@ -250,3 +250,24 @@ fn postscript_names_find_installed_fonts() { let (doc, _) = import(&z, "f").unwrap(); assert_eq!(data(&doc, "A").style.font_family, "Courier New PSMT"); } + +/// A run without kerning, a fixed line height or font axes has none: it doesn't take the first +/// run's (the text's base style) as its own. +#[test] +fn later_runs_dont_inherit_the_first_runs_settings() { + let mut t = text("Mixed", 0.0, 0.0, 200.0, 40.0, "AaBb", &[(0, 2, "Skia", 20.0, BLACK), (2, 2, "Helvetica", 14.0, BLACK)]); + let first = &mut t["attributedString"]["attributes"][0]["attributes"]; + first["kerning"] = json!(2); + first["paragraphStyle"]["minimumLineHeight"] = json!(24); + first["paragraphStyle"]["maximumLineHeight"] = json!(24); + first["MSAttributedStringFontAttribute"]["attributes"]["variation"] = json!({"2003265652": 3}); + let (doc, _) = open(vec![t]); + let td = data(&doc, "Mixed"); + let at = |i: usize| td.runs.iter().find(|r| r.start <= i && i < r.end).map_or(&td.style, |r| &r.style); + assert_eq!(at(0).letter_spacing.resolve(20.0), 2.0); + let second = at(2); + assert_eq!(second.font_family, "Helvetica"); + assert_eq!(second.letter_spacing.resolve(14.0), 0.0, "{second:?}"); + assert_eq!(second.line_height, figcraft_doc::LineHeight::Auto, "{second:?}"); + assert!(second.variations.is_empty(), "{second:?}"); +} diff --git a/crates/text/src/fontdb.rs b/crates/text/src/fontdb.rs index 34d76b12e..b004d7e1a 100644 --- a/crates/text/src/fontdb.rs +++ b/crates/text/src/fontdb.rs @@ -526,6 +526,8 @@ pub struct Rescan { static DB: OnceLock> = OnceLock::new(); /// Set by [`scan_system_fonts_on_demand`]. static ON_DEMAND: AtomicBool = AtomicBool::new(false); +/// Set by [`opt_out_of_system_fonts`]. +static OPTED_OUT: AtomicBool = AtomicBool::new(false); /// Done once per process: concurrent callers wait for the one scan. static SCANNED: OnceLock<()> = OnceLock::new(); /// Directory walks done (at most one). @@ -1111,10 +1113,17 @@ pub fn load_font_bytes(bytes: Vec) -> Vec { families } -/// `FIGCRAFT_NO_SYSTEM_FONTS` is set (and not `0`): renders use only the embedded fonts. +/// `FIGCRAFT_NO_SYSTEM_FONTS` is set (and not `0`), or the process opted out +/// ([`opt_out_of_system_fonts`]): renders use only the embedded fonts. #[cfg(not(target_arch = "wasm32"))] fn system_fonts_opted_out() -> bool { - std::env::var_os("FIGCRAFT_NO_SYSTEM_FONTS").is_some_and(|v| !v.is_empty() && v != "0") + OPTED_OUT.load(Ordering::Relaxed) || std::env::var_os("FIGCRAFT_NO_SYSTEM_FONTS").is_some_and(|v| !v.is_empty() && v != "0") +} + +/// Use only the embedded fonts for the rest of the process, as `FIGCRAFT_NO_SYSTEM_FONTS` does +/// (headless runs with `--no-system-fonts`): no call scans the system fonts after this. +pub fn opt_out_of_system_fonts() { + OPTED_OUT.store(true, Ordering::Relaxed); } /// Every font text can use is known: the system fonts were indexed, or there are none to index diff --git a/crates/text/src/lib.rs b/crates/text/src/lib.rs index 50cd28dd5..1663ab13c 100644 --- a/crates/text/src/lib.rs +++ b/crates/text/src/lib.rs @@ -17,8 +17,8 @@ pub use breaks::grapheme_step; pub use color::{ColorBitmap, ColorInk, ColorLayer}; pub use fontdb::{ Axis, CRAFT_FONTS, Coords, Face, FontDb, NamedInstance, Rescan, axis_label, db, face_with_char, family_names, family_styles, find_face, - has_family, installed_fonts_known, load_font_bytes, no_coords, rescan_system_fonts, scan_system_fonts, scan_system_fonts_on_demand, - system_fonts_scanned, + has_family, installed_fonts_known, load_font_bytes, no_coords, opt_out_of_system_fonts, rescan_system_fonts, scan_system_fonts, + scan_system_fonts_on_demand, system_fonts_scanned, }; pub use layout::{Decoration, Glyph, Line, TextLayout, layout}; pub use onpath::OnPath; diff --git a/crates/ui-egui/locales/bn.toml b/crates/ui-egui/locales/bn.toml index adedc983a..eb3a88db4 100644 --- a/crates/ui-egui/locales/bn.toml +++ b/crates/ui-egui/locales/bn.toml @@ -416,7 +416,7 @@ status = "draft — needs native review" "Draw" = "আঁকুন" "Draw a frame" = "একটি ফ্রেম আঁকুন" "Drawing tools" = "অঙ্কন টুলস" -"Drop a .figcraft, .fig, .json, .svg or image file." = "একটি .figcraft, .fig, .json, .svg বা ছবির ফাইল ড্রপ করুন।" +"Drop a .figcraft, .fig, .sketch, .json, .svg or image file." = "একটি .figcraft, .fig, .sketch, .json, .svg বা ছবির ফাইল ড্রপ করুন।" "Drop to import" = "ইম্পোর্ট করতে ড্রপ করুন" "Drop to open" = "খুলতে ড্রপ করুন" "Drop shadow" = "ড্রপ শ্যাডো" diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index f61464b8f..04d1af62a 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -397,7 +397,7 @@ status = "draft — needs native review" "Drag the stroke to add a width point" = "Ziehen Sie an der Kontur, um einen Breitenpunkt hinzuzufügen" "Draw" = "Zeichnen" "Drawing tools" = "Zeichenwerkzeuge" -"Drop a .figcraft, .fig, .json, .svg or image file." = "Legen Sie eine .figcraft-, .fig-, .json-, .svg- oder Bilddatei ab." +"Drop a .figcraft, .fig, .sketch, .json, .svg or image file." = "Legen Sie eine .figcraft-, .fig-, .sketch-, .json-, .svg- oder Bilddatei ab." "Drop to import" = "Zum Importieren ablegen" "Drop to open" = "Zum Öffnen ablegen" "Drop shadow" = "Schlagschatten" diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index ae566fc81..1180bf41a 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -417,7 +417,7 @@ name = "English" "Draw" = "Draw" "Draw a frame" = "Draw a frame" "Drawing tools" = "Drawing tools" -"Drop a .figcraft, .fig, .json, .svg or image file." = "Drop a .figcraft, .fig, .json, .svg or image file." +"Drop a .figcraft, .fig, .sketch, .json, .svg or image file." = "Drop a .figcraft, .fig, .sketch, .json, .svg or image file." "Drop to import" = "Drop to import" "Drop to open" = "Drop to open" "Drop shadow" = "Drop shadow" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 596feda6e..7ed208b03 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -418,7 +418,7 @@ status = "draft — needs native review" "Draw" = "Dibujar" "Draw a frame" = "Dibuja un marco" "Drawing tools" = "Herramientas de dibujo" -"Drop a .figcraft, .fig, .json, .svg or image file." = "Suelta un archivo .figcraft, .fig, .json, .svg o de imagen." +"Drop a .figcraft, .fig, .sketch, .json, .svg or image file." = "Suelta un archivo .figcraft, .fig, .sketch, .json, .svg o de imagen." "Drop to import" = "Suelta para importar" "Drop to open" = "Suelta para abrir" "Drop shadow" = "Sombra paralela" diff --git a/crates/ui-egui/locales/fi.toml b/crates/ui-egui/locales/fi.toml index 205a9d294..3102fbf4d 100644 --- a/crates/ui-egui/locales/fi.toml +++ b/crates/ui-egui/locales/fi.toml @@ -418,7 +418,7 @@ status = "draft — needs native review" "Draw" = "Piirrä" "Draw a frame" = "Piirrä kehys" "Drawing tools" = "Piirtotyökalut" -"Drop a .figcraft, .fig, .json, .svg or image file." = "Pudota .figcraft-, .fig-, .json-, .svg- tai kuvatiedosto." +"Drop a .figcraft, .fig, .sketch, .json, .svg or image file." = "Pudota .figcraft-, .fig-, .sketch-, .json-, .svg- tai kuvatiedosto." "Drop shadow" = "Heittovarjo" "Drop to import" = "Tuo pudottamalla" "Drop to open" = "Avaa pudottamalla" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index b038b3356..0cc872139 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -415,7 +415,7 @@ status = "draft — needs native review" "Draw" = "Dessin" "Draw a frame" = "Tracer un cadre" "Drawing tools" = "Outils de dessin" -"Drop a .figcraft, .fig, .json, .svg or image file." = "Déposez un fichier .figcraft, .fig, .json, .svg ou une image." +"Drop a .figcraft, .fig, .sketch, .json, .svg or image file." = "Déposez un fichier .figcraft, .fig, .sketch, .json, .svg ou une image." "Drop shadow" = "Ombre portée" "Drop to import" = "Déposer pour importer" "Drop to open" = "Déposer pour ouvrir" diff --git a/crates/ui-egui/locales/ka.toml b/crates/ui-egui/locales/ka.toml index 5b73b4fbc..20b4bce67 100644 --- a/crates/ui-egui/locales/ka.toml +++ b/crates/ui-egui/locales/ka.toml @@ -418,7 +418,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Draw" = "ხატვა" "Draw a frame" = "დახატეთ ჩარჩო" "Drawing tools" = "ხატვის ხელსაწყოები" -"Drop a .figcraft, .fig, .json, .svg or image file." = "ჩააგდეთ .figcraft, .fig, .json, .svg ან გამოსახულების ფაილი." +"Drop a .figcraft, .fig, .sketch, .json, .svg or image file." = "ჩააგდეთ .figcraft, .fig, .sketch, .json, .svg ან გამოსახულების ფაილი." "Drop to import" = "ჩააგდეთ იმპორტისთვის" "Drop to open" = "ჩააგდეთ გასახსნელად" "Drop shadow" = "ჩრდილი" diff --git a/crates/ui-egui/locales/nl.toml b/crates/ui-egui/locales/nl.toml index 54851043f..6d276911a 100644 --- a/crates/ui-egui/locales/nl.toml +++ b/crates/ui-egui/locales/nl.toml @@ -418,7 +418,7 @@ status = "draft — needs native review" "Draw" = "Tekenen" "Draw a frame" = "Teken een frame" "Drawing tools" = "Tekengereedschap" -"Drop a .figcraft, .fig, .json, .svg or image file." = "Laat een .figcraft-, .fig-, .json-, .svg- of afbeeldingsbestand los." +"Drop a .figcraft, .fig, .sketch, .json, .svg or image file." = "Laat een .figcraft-, .fig-, .sketch-, .json-, .svg- of afbeeldingsbestand los." "Drop shadow" = "Slagschaduw" "Drop to import" = "Loslaten om te importeren" "Drop to open" = "Loslaten om te openen" diff --git a/crates/ui-egui/locales/pl.toml b/crates/ui-egui/locales/pl.toml index 23f7dee8e..0453ee7bc 100644 --- a/crates/ui-egui/locales/pl.toml +++ b/crates/ui-egui/locales/pl.toml @@ -415,7 +415,7 @@ status = "draft — needs native review" "Draw" = "Rysuj" "Draw a frame" = "Narysuj ramkę" "Drawing tools" = "Narzędzia rysowania" -"Drop a .figcraft, .fig, .json, .svg or image file." = "Upuść plik .figcraft, .fig, .json, .svg lub plik obrazu." +"Drop a .figcraft, .fig, .sketch, .json, .svg or image file." = "Upuść plik .figcraft, .fig, .sketch, .json, .svg lub plik obrazu." "Drop to import" = "Upuść, aby zaimportować" "Drop to open" = "Upuść, aby otworzyć" "Drop shadow" = "Cień" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index d8f857e0f..424a43372 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -1662,7 +1662,7 @@ status = "draft — needs native review" "Dec" = "dez." "Design system starter" = "Ponto de partida para sistema de design" "Draw a frame" = "Desenhe um quadro" -"Drop a .figcraft, .fig, .json, .svg or image file." = "Solte um arquivo .figcraft, .fig, .json, .svg ou uma imagem." +"Drop a .figcraft, .fig, .sketch, .json, .svg or image file." = "Solte um arquivo .figcraft, .fig, .sketch, .json, .svg ou uma imagem." "Drop to import" = "Solte para importar" "Drop to open" = "Solte para abrir" "Edited {when}" = "Editado {when}" diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 6e173a925..2d5169a0a 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -417,7 +417,7 @@ name = "Русский" "Draw" = "Рисование" "Draw a frame" = "Нарисовать Frame" "Drawing tools" = "Инструменты рисования" -"Drop a .figcraft, .fig, .json, .svg or image file." = "Перетащите файл .figcraft, .fig, .json, .svg или изображение." +"Drop a .figcraft, .fig, .sketch, .json, .svg or image file." = "Перетащите файл .figcraft, .fig, .sketch, .json, .svg или изображение." "Drop shadow" = "Внешняя тень" "Drop to import" = "Отпустите, чтобы импортировать" "Drop to open" = "Отпустите, чтобы открыть" diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index d86779e02..2f8f3d95b 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -412,7 +412,7 @@ name = "Svenska" "Draw" = "Rita" "Draw a frame" = "Rita en ram" "Drawing tools" = "Ritverktyg" -"Drop a .figcraft, .fig, .json, .svg or image file." = "Släpp en .figcraft-, .fig-, .json- eller .svg-fil eller en bildfil." +"Drop a .figcraft, .fig, .sketch, .json, .svg or image file." = "Släpp en .figcraft-, .fig-, .sketch-, .json- eller .svg-fil eller en bildfil." "Drop to import" = "Släpp för att importera" "Drop to open" = "Släpp för att öppna" "Drop shadow" = "Släppskugga" diff --git a/crates/ui-egui/src/home.rs b/crates/ui-egui/src/home.rs index b532d9a7e..664ca1591 100644 --- a/crates/ui-egui/src/home.rs +++ b/crates/ui-egui/src/home.rs @@ -181,7 +181,7 @@ fn dropped(app: &mut FigApp, ctx: &egui::Context) { let files = ctx.input(|i| i.raw.dropped_files.clone()); for f in files { if !crate::opens(f.path()) { - app.toast(tr("Drop a .figcraft, .fig, .json, .svg or image file.")); + app.toast(tr("Drop a .figcraft, .fig, .sketch, .json, .svg or image file.")); continue; } crate::pending_open::open_dropped(app, &f); diff --git a/crates/ui-egui/src/home_tests.rs b/crates/ui-egui/src/home_tests.rs index fc51bfb1e..71225db4b 100644 --- a/crates/ui-egui/src/home_tests.rs +++ b/crates/ui-egui/src/home_tests.rs @@ -898,7 +898,7 @@ fn dropping_an_unsupported_file_on_the_home_screen_opens_nothing() { drop_file(&mut u, &path); assert!(u.app.session.docs.is_empty()); assert!(u.app.ui.home); - assert_eq!(u.app.ui.toast.as_ref().map(|t| t.0.as_str()), Some("Drop a .figcraft, .fig, .json, .svg or image file.")); + assert_eq!(u.app.ui.toast.as_ref().map(|t| t.0.as_str()), Some("Drop a .figcraft, .fig, .sketch, .json, .svg or image file.")); } #[test] diff --git a/docs/cli.md b/docs/cli.md index bf783d11a..84f4617fb 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -87,7 +87,7 @@ figcraft-cli export app.figcraft -o handoff.fig ### `convert ` -By extension. Inputs: `.figcraft`, `.json` (FigCraft or REST API file JSON), `.fig` (best effort), `.svg` (an editable frame: groups, +By extension. Inputs: `.figcraft`, `.json` (FigCraft or REST API file JSON), `.fig` (best effort), `.sketch` (Sketch 48 or newer, best effort), `.svg` (an editable frame: groups, shapes, text, gradients, masks and effects; `info` lists what it left out as `note:` lines), `.png/.jpg/.webp/.gif/.tif/.bmp` (an image layer). Outputs: `.figcraft`, `.json` (FigCraft JSON, pretty-printed), `.svg`, `.png/.jpg/.webp` (the current page rendered at 1x with its background), `.pdf` (the current page's diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 11867d881..5fb7532c6 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -18,7 +18,7 @@ and prototype interactions are still unchecked there. | Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours | |---|---|---|---|---|---| | `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included; a flow that records no primary-axis sizing hugs on that axis, an instance that records no auto layout has its main's), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Since 2026-10-17 (community batches #727, #728): an instance's own identity and the cached library components a file carries, overrides applied by key and order, local text values and instance overrides over a shared text style, grid track sizes (fixed, content-sized, fill), slot content, labels of connectors saved with their drawn path (a static snapshot; the ends aren't live), skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, editable text on a path, image adjustments and images carried in the message. Budgets come from the file's own size (one value per compressed byte, 20M–128M, lower ceilings on 32-bit targets; the layer cap follows), so a 15.4 MB synthetic file with 300,000 layers opens whole; the file's bytes stay out of the command journal; an import report lists what was left out or changed once the file opens. Not read: elbowed or curved connectors without a saved path (drawn straight) and labels of connectors without a saved snapshot, table cells beyond their own layers, filled areas with their own fills, variables bound to fields the editor can't bind, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs` and the per-feature `*_tests.rs` beside them, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 | -| `.sketch` (Sketch 48 and newer) | import (file browser ▸ Import or drop, desktop app too; converted to a Figma file, symbols as components; per the help center) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards as frames with their background, groups; Sketch 2025 and newer: frames (clipping or not) with their style, graphics, stacks as auto layout (direction, gap, alignment, padding, wrap, hug/fill sizing, items ignoring the stack), corners in the style (rounded, smooth with its smoothing; angled, inside square and inside arc as paths), pins and sizing, per-side borders, lists of blurs (progressive background blurs, glass), inner shadows in the shadow list, tints (a graphic's, group's or instance's fill colouring its layers, and colour overrides), text colour and visibility overrides, text sized by its sizing; rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients with Sketch's geometry, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (an outline mask that shows its own style draws a copy under itself, as Sketch does; alpha masks only mask; broken mask chains wrapped), progressive opacity (Fade) as an alpha mask of its gradient; text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts found by their PostScript names among the installed ones (else the family read from the name), variable font axes, Sketch's natural line (ascent and descent rounded, no line gap, a fifth more for classic Mac fonts) for text without a fixed line height; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), laid out for their size the way Sketch does it (proportional sharing per pins from format 110, scaling before) and still live; master backgrounds in instances only where Sketch shows them; Apple's system fonts found under the names designs use, with the platform's tracking kept as letter spacing; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids (hidden, as Sketch shows them only in its layout view). Instances of a stack laid out at their size and texts an override changed measured again on open. Warnings: noise fills, motion and zoom blurs (drawn as plain blurs), fonts embedded with their data (not used), Smart Layout (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 47, 68 and 83 (70,000 layers open in ~3 s, debug build); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (0.8% on average) (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 70 in at most 4.4%, a Sketch 64 file's 65 artboards 2.1% on average, a Sketch 2026 showcase file's 16 frames 0.9% on average (at most 1.9%) | 5–10 (Smart Layout as auto layout, motion and zoom blurs, several borders of different widths; fonts embedded in the file once `.figcraft` documents can carry fonts: until then they would only last the session) | +| `.sketch` (Sketch 48 and newer) | import (file browser ▸ Import or drop, desktop app too; converted to a Figma file, symbols as components; per the help center) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards as frames with their background, groups; Sketch 2025 and newer: frames (clipping or not) with their style, graphics, stacks as auto layout (direction, gap, alignment, padding, wrap, hug/fill sizing, items ignoring the stack), corners in the style (rounded, smooth with its smoothing; angled, inside square and inside arc as paths), pins and sizing, per-side borders, lists of blurs (progressive background blurs, glass), inner shadows in the shadow list, tints (a graphic's, group's or instance's fill colouring its layers, and colour overrides), text colour and visibility overrides, text sized by its sizing; rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients with Sketch's geometry, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (an outline mask that shows its own style draws a copy under itself, as Sketch does; alpha masks only mask; broken mask chains wrapped), progressive opacity (Fade) as an alpha mask of its gradient; text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts found by their PostScript names among the installed ones (else the family read from the name), variable font axes, Sketch's natural line (ascent and descent rounded, no line gap, a fifth more for classic Mac fonts) for text without a fixed line height; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), laid out for their size the way Sketch does it (proportional sharing per pins from format 110, scaling before) and still live; master backgrounds in instances only where Sketch shows them; Apple's system fonts found under the names designs use, with the platform's tracking kept as letter spacing; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids (hidden, as Sketch shows them only in its layout view). Instances of a stack laid out at their size and texts an override changed measured again on open. Warnings: noise fills, motion and zoom blurs (drawn as plain blurs), fonts embedded with their data (not used), Smart Layout (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 68 and 83 (70,000 layers open in ~3 s, debug build; its edition saved by Sketch 47 is refused, as it should be); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (0.8% on average) (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 69 1.1% on average and at most 4.4% (text in IBM Plex, which the file embeds and FigCraft doesn't use yet), a Sketch 64 file's 65 artboards 2.1% on average, a Sketch 2026 showcase file's 16 frames 0.9% on average (at most 1.9%) | 5–10 (Smart Layout as auto layout, motion and zoom blurs, several borders of different widths; fonts embedded in the file once `.figcraft` documents can carry fonts: until then they would only last the session) | | `.jam` (FigJam), `.deck` (Slides) | native to other Figma products | no | no | out of scope | — | | REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout (sizing modes left out read as hug, as documented; grid track sizes from `gridColumnsSizing` / `gridRowsSizing`: px, fr, auto, `minmax(0, 1fr)`, `repeat()`), constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, slots (`SLOT` layers bound to their slot property; an instance's slot keeps its content as the instance's own unless its property value is the main's default content; slot limits and preferred components are warnings), styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings, image adjustments (the same tint sign as `.fig`); the import report after opening; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — | | `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`) | — | @@ -166,7 +166,7 @@ each. | Date | Change | Summary | |---|---|---| -| 2026-10-21 | minor | `.sketch` import (best effort): files saved by Sketch 48 and newer open and import like `.fig` files (open, import, drop, CLI, MCP), mapped onto the REST importer: layers, paths, shape groups and booleans, styles and effects, masks, text, symbols with overrides (live instances), shared styles, Color Variables, prototype links, export settings and grids; older files are refused with a message. Sketch 2025 and newer: frames, graphics, stacks as auto layout, corners, pins and sizing, tints, per-side borders, blur lists. Checked on fixtures and locally on real Sketch 50, 64 and 2026 files and the IBM Carbon Design Kit (Sketch 47, 68, 83). Numbers unchanged | +| 2026-10-21 | minor | `.sketch` import (best effort): files saved by Sketch 48 and newer open and import like `.fig` files (open, import, drop, CLI, MCP), mapped onto the REST importer: layers, paths, shape groups and booleans, styles and effects, masks, text, symbols with overrides (live instances), shared styles, Color Variables, prototype links, export settings and grids; older files are refused with a message. Sketch 2025 and newer: frames, graphics, stacks as auto layout, corners, pins and sizing, tints, per-side borders, blur lists. Checked on fixtures and locally on real Sketch 50, 64 and 2026 files and the IBM Carbon Design Kit (Sketch 68 and 83 open; the Sketch 47 edition is refused). Numbers unchanged | | 2026-10-18 | minor | REST file JSON import keeps `SLOT` layers (#792): they were dropped with everything placed in them, which emptied every instance's slot. A slot in a main component becomes a slot frame bound to its `SLOT` property (the one it references, else the one named like it, else the only one left), and an instance's slot holds the instance's own content, kept across syncs, moves of the mains and saving, unless the instance's property value is the main's default content (without values, a slot that holds layers keeps them). Instances in slot content link to their own mains. Slot content limits, preferred-only and preferred components are warnings. Synthetic files only. Numbers unchanged | | 2026-10-17 | minor | REST file JSON import reads grid track sizes from the CSS track strings `gridColumnsSizing` / `gridRowsSizing` (fixed px, fill fr, hug `auto`, `minmax(0, 1fr)`, `repeat()`; other tracks stay equal) (#465). Numbers unchanged | | 2026-10-17 | minor | The community batches #727 and #728 in the `.fig` row: instance identity and cached library components, overrides by key, text style precedence, grid track sizes, slot content, labels of connectors saved with their path, skip ink, paragraph options, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments (also REST), images in the message; budgets from the file's size; the journal keeps no file bytes; the import report. Not read cut to what's left. A `.fig` copy from Save as. Pasted content: layers copied from another design app, best effort (tested only with clipboard HTML made from our own export), and images under Wayland (not run there). All on synthetic files: summary and hours unchanged | From 4b71d2c69e717b789156476fe8de43c040598d0b Mon Sep 17 00:00:00 2001 From: Muamer Mustafic Date: Thu, 22 Oct 2026 09:13:19 +0200 Subject: [PATCH 511/817] M1: individual corner fields sit at their corners, each with its own icon (#1002) Co-authored-by: Cursor --- crates/ui-egui/src/corner_individual_tests.rs | 75 +++++++++++++++++++ crates/ui-egui/src/icons.rs | 24 +++++- crates/ui-egui/src/lib.rs | 2 + crates/ui-egui/src/right.rs | 62 +++++++-------- 4 files changed, 125 insertions(+), 38 deletions(-) create mode 100644 crates/ui-egui/src/corner_individual_tests.rs diff --git a/crates/ui-egui/src/corner_individual_tests.rs b/crates/ui-egui/src/corner_individual_tests.rs new file mode 100644 index 000000000..5a36f0738 --- /dev/null +++ b/crates/ui-egui/src/corner_individual_tests.rs @@ -0,0 +1,75 @@ +//! Individual corners in the Design panel, driven headless: the four corner fields sit where +//! their corners are (top left, top right / bottom left, bottom right) and each sets its own. + +use egui::accesskit::Role; +use egui::{Event, Id, Key, Modifiers, Pos2, Rect, pos2}; +use figcraft_doc::NodeId; +use figcraft_engine::Session; +use serde_json::json; + +use crate::layers_drag_tests::Ui; + +/// A rectangle rounded only on its left corners (top left and bottom left 30), selected. +fn scene() -> (Ui, NodeId) { + let mut s = Session::new(); + let r = NodeId(s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 200, "height": 120})).unwrap()["id"].as_u64().unwrap()); + s.execute("node.set", &json!({"ids": [r], "props": {"topLeftRadius": 30, "bottomLeftRadius": 30}})).unwrap(); + s.execute("select.set", &json!({"ids": [r]})).unwrap(); + (Ui::new(s), r) +} + +/// The rectangle's radii as `[top left, top right, bottom right, bottom left]`. +fn radii(u: &Ui, r: NodeId) -> [f64; 4] { + u.app.session.doc().unwrap().node(r).unwrap().corners.radii +} + +/// A full press-and-release at `p`, then settling one frame. +fn click(u: &mut Ui, p: Pos2) { + u.button(p, true); + u.button(p, false); + u.frame(vec![]); +} + +/// A press-and-release of Enter, committing the focused number field. +fn enter(u: &mut Ui) { + u.frame(vec![ + Event::Key { key: Key::Enter, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::NONE }, + Event::Key { key: Key::Enter, physical_key: None, pressed: false, repeat: false, modifiers: Modifiers::NONE }, + ]); +} + +/// The middle of the toggle button named `label`, found in the AccessKit tree. +fn named_button(u: &mut Ui, label: &str) -> Pos2 { + u.ctx.enable_accesskit(); + u.frame(vec![]); + let out = u.frame_output(vec![]); + let nodes = out.platform_output.accesskit_update.expect("an AccessKit update").nodes; + let n = nodes.iter().map(|(_, n)| n).find(|n| n.role() == Role::Button && n.label() == Some(label)).expect(label); + let b = n.bounds().expect("bounds"); + pos2(((b.x0 + b.x1) / 2.0) as f32, ((b.y0 + b.y1) / 2.0) as f32) +} + +/// Corner field `k` (an index into the radii). +fn field(u: &Ui, k: usize) -> Rect { + u.ctx.read_response(Id::new(("corner", k)).with("field")).expect("corner field shows").rect +} + +/// The fields sit at their corners, and typing in the bottom right one sets only that corner in a +/// single undo step (#1002: the bottom row showed bottom right on the left). +#[test] +fn corner_fields_sit_at_their_corners_and_set_their_own() { + let (mut u, r) = scene(); + let t = named_button(&mut u, "Individual corners"); + click(&mut u, t); + let (tl, tr, br, bl) = (field(&u, 0).center(), field(&u, 1).center(), field(&u, 2).center(), field(&u, 3).center()); + assert!(tl.x < tr.x && (tl.y - tr.y).abs() < 1.0, "top row: top left, then top right"); + assert!(bl.x < br.x && (bl.y - br.y).abs() < 1.0, "bottom row: bottom left, then bottom right"); + assert!(bl.y > tl.y && (bl.x - tl.x).abs() < 1.0, "bottom left sits under top left"); + let history = u.app.session.undo_depth().0; + click(&mut u, br); + u.frame(vec![Event::Text("12".into())]); + enter(&mut u); + u.frame(vec![]); + assert_eq!(radii(&u, r), [30.0, 0.0, 12.0, 30.0]); + assert_eq!(u.app.session.undo_depth().0, history + 1); +} diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs index 5eb7d2092..10dc4c836 100644 --- a/crates/ui-egui/src/icons.rs +++ b/crates/ui-egui/src/icons.rs @@ -83,6 +83,11 @@ icons! { FlipH, FlipV, CornerRadius, + /// Individual corners: the rounded corner each field sets. + CornerTopLeft, + CornerTopRight, + CornerBottomRight, + CornerBottomLeft, Angle, IndependentCorners, /// Individual padding: a frame with one inward tick per side, each set alone. @@ -708,7 +713,10 @@ fn draw(p: &P, icon: Icon) { p.poly(&[(3.5, 5.5), (12.5, 5.5), (12.5, 1.5)], true); p.fill(&[(3.0, 9.0), (13.0, 9.0), (13.0, 14.0)]); } - CornerRadius => p.corner(2.5, 2.5, 1.0, 1.0, 11.5, 6.0), + CornerRadius | CornerTopLeft => p.corner(2.5, 2.5, 1.0, 1.0, 11.5, 6.0), + CornerTopRight => p.corner(13.5, 2.5, -1.0, 1.0, 11.5, 6.0), + CornerBottomRight => p.corner(13.5, 13.5, -1.0, -1.0, 11.5, 6.0), + CornerBottomLeft => p.corner(2.5, 13.5, 1.0, -1.0, 11.5, 6.0), Angle => { // Two rays from a vertex, the arc between them marking the angle (all unhinted, so // the arc meets the rays at every size). @@ -1323,4 +1331,18 @@ mod tests { let inside = (0..h.len()).all(|i| side(i) >= 0.0) || (0..h.len()).all(|i| side(i) <= 0.0); assert!(inside, "the handle covers the blade's base at {base:?}"); } + + /// Each corner's icon shows its own corner: no two of the four draw alike. + #[test] + fn corner_icons_differ() { + let drawn: Vec = [Icon::CornerTopLeft, Icon::CornerTopRight, Icon::CornerBottomRight, Icon::CornerBottomLeft] + .iter() + .map(|&icon| format!("{:?}", shapes_at_32(icon))) + .collect(); + for (i, a) in drawn.iter().enumerate() { + for b in &drawn[i + 1..] { + assert_ne!(a, b); + } + } + } } diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index c93333b38..59f614b4f 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -93,6 +93,8 @@ mod comments_tests; #[cfg(test)] mod component_props_reorder_tests; #[cfg(test)] +mod corner_individual_tests; +#[cfg(test)] mod cursors_tests; #[cfg(test)] mod design_paste_tests; diff --git a/crates/ui-egui/src/right.rs b/crates/ui-egui/src/right.rs index afa884a87..7d21e45f8 100644 --- a/crates/ui-egui/src/right.rs +++ b/crates/ui-egui/src/right.rs @@ -879,44 +879,32 @@ fn appearance(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { }); if indep_ok && ui.data(|d| d.get_temp::(Id::new("indep_corners"))).unwrap_or(false) { let radii = common(doc, sel, |n| n.corners.radii); - let keys = [ - ("topLeftRadius", tr("Top left radius")), - ("topRightRadius", tr("Top right radius")), - ("bottomRightRadius", tr("Bottom right radius")), - ("bottomLeftRadius", tr("Bottom left radius")), + // `k` indexes `radii` ([top left, top right, bottom right, bottom left]); the fields sit + // where their corners are: top left, top right / bottom left, bottom right. + let corners = [ + ("topLeftRadius", tr("Top left radius"), Icon::CornerTopLeft, 0), + ("topRightRadius", tr("Top right radius"), Icon::CornerTopRight, 1), + ("bottomLeftRadius", tr("Bottom left radius"), Icon::CornerBottomLeft, 3), + ("bottomRightRadius", tr("Bottom right radius"), Icon::CornerBottomRight, 2), ]; - row(ui, 32.0, |ui| { - for (k, (key, name)) in keys.iter().enumerate().take(2) { - let e = crate::variable_ui::number_field( - app, - ui, - &ids, - key, - Id::new(("corner", k)), - Lead::Icon(Icon::CornerRadius, name), - radii.map(|r| r[k]), - "", - col, - ); - app.field(&ids, key, e, |v| json!(v.max(0.0))); - } - }); - row(ui, 32.0, |ui| { - for (k, (key, name)) in keys.iter().enumerate().skip(2) { - let e = crate::variable_ui::number_field( - app, - ui, - &ids, - key, - Id::new(("corner", k)), - Lead::Icon(Icon::CornerRadius, name), - radii.map(|r| r[k]), - "", - col, - ); - app.field(&ids, key, e, |v| json!(v.max(0.0))); - } - }); + for pair in corners.chunks(2) { + row(ui, 32.0, |ui| { + for (key, name, icon, k) in pair { + let e = crate::variable_ui::number_field( + app, + ui, + &ids, + key, + Id::new(("corner", *k)), + Lead::Icon(*icon, name), + radii.map(|r| r[*k]), + "", + col, + ); + app.field(&ids, key, e, |v| json!(v.max(0.0))); + } + }); + } let sm = common(doc, sel, |n| (n.corners.smoothing * 100.0).round()); widgets::sublabels(ui, tr("Corner smoothing"), None); row(ui, 32.0, |ui| { From e6067549bcfee77c9a58292b70ef4d2fb62aae77 Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Thu, 22 Oct 2026 09:21:24 +0200 Subject: [PATCH 512/817] M7: Type settings keeps its width with long labels (#1029) --- ROADMAP.md | 1 + crates/ui-egui/src/lib.rs | 3 ++ crates/ui-egui/src/type_settings_tests.rs | 29 ++++++++++++++ crates/ui-egui/src/typography.rs | 46 +++++++++++------------ 4 files changed, 54 insertions(+), 25 deletions(-) create mode 100644 crates/ui-egui/src/type_settings_tests.rs diff --git a/ROADMAP.md b/ROADMAP.md index f43cd015b..e6f3f52bc 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -316,6 +316,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-22 | minor | Type settings keeps its width (#1029): in languages whose labels run past the 110 px label column (French "Retrait de paragraphe", "Espacement de liste"), the List spacing, Paragraph indent, Max lines and decoration rows were wider than the popover, which then widened every frame while open. Those fields now take the width left after their label; English is unchanged. Regression test in `type_settings_tests`. Numbers unchanged. | | 2026-10-20 | minor | A document dropped on the canvas opens (#916): a `.figcraft`, `.fig` or file JSON dropped on the canvas opens as a file of its own, as on the home screen, in the browser too; it used to add its pages to the file in front. Images and SVG still import at the drop point, File ▸ Import still adds pages, and dragging only documents over the canvas says "Drop to open" (not in the browser, which names no file until the drop). Numbers unchanged | | 2026-10-20 | minor | Duplicating a main component makes an instance (#892): Duplicate and Alt-drag copied a main component as a second main; within its file the copy is now an instance of it, as Copy then Paste already was (a variant duplicated in its set stays a variant). Numbers unchanged. | | 2026-10-20 | minor | Readable disabled and selected text (#890): the dim text colour (disabled buttons, placeholders, hints) is at least 3:1 against panels, fields and selected rows in both themes (it was 2.1:1 in the light theme), a disabled button is grey with that text instead of fading to 40%, and selected text (renaming a page or layer, any text box) takes the theme's readable green on the highlight (1.4:1 in the dark theme before, now 4.2:1 or more); checked with the colour contrast helper (`theme::tests`). Numbers unchanged | diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index c93333b38..69c21bead 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1877,5 +1877,8 @@ pub(crate) fn drop_overlay(ctx: &egui::Context, rect: egui::Rect, label: &str) { #[cfg(test)] mod selection_spacing_tests; +#[cfg(test)] +mod type_settings_tests; + #[cfg(test)] mod typography_scrub_tests; diff --git a/crates/ui-egui/src/type_settings_tests.rs b/crates/ui-egui/src/type_settings_tests.rs new file mode 100644 index 000000000..675abfa08 --- /dev/null +++ b/crates/ui-egui/src/type_settings_tests.rs @@ -0,0 +1,29 @@ +//! Regression for #1029: a Type settings row whose label is wider than its column (French "Retrait +//! de paragraphe") stays inside the popover, which otherwise widened a little every frame. +use egui::{Area, Id, Pos2, RawInput, Rect, vec2}; + +#[test] +fn a_long_label_does_not_widen_the_type_settings_popover() { + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx, false, 0); + let id = Id::new("ty_row_test"); + let mut widths = Vec::new(); + for i in 0..30 { + let raw = + RawInput { screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(1200.0, 900.0))), time: Some(i as f64 / 60.0), ..Default::default() }; + ctx.run_ui(raw, |ui| { + // As `egui::Popup::width` shows it: a default width the area grows past to fit. + Area::new(id).fixed_pos(Pos2::ZERO).default_width(264.0).show(ui.ctx(), |ui| { + for label in ["List spacing", "Retrait de paragraphe, plus long que la colonne"] { + crate::typography::field_row(ui, label, |ui, fw| ui.allocate_exact_size(vec2(fw, 20.0), egui::Sense::hover())); + } + }); + }) + .textures_delta + .clear(); + widths.push(ctx.memory(|m| m.area_rect(id)).expect("the area is shown").width()); + } + let (first, last) = (widths[1], widths[widths.len() - 1]); + assert!((last - first).abs() < 0.01, "the row widens the popover every frame: {first} → {last}"); + assert!((last - 264.0).abs() < 0.01, "{last}"); +} diff --git a/crates/ui-egui/src/typography.rs b/crates/ui-egui/src/typography.rs index 06185d0cd..eefe7c9b1 100644 --- a/crates/ui-egui/src/typography.rs +++ b/crates/ui-egui/src/typography.rs @@ -468,17 +468,15 @@ fn type_settings( // Indent applies to start-aligned text only; elsewhere the field stays visible but off. let start_aligned = common(doc, ids, |n| n.kind.text().map(|t| t.align_h != TextAlignH::Center && t.align_h != TextAlignH::Justified)).flatten(); - ui.horizontal(|ui| { - ui.add_enabled_ui(start_aligned != Some(false), |ui| { - ui.add_sized(vec2(110.0, FIELD_H), egui::Label::new(egui::RichText::new(tr("Paragraph indent")).font(regular(11.0)).color(t.text))); - let field = widgets::number_field(ui, Id::new("ty_indent"), Lead::None, indent, "", w - 118.0, 1.0); - if let Some(FieldEdit::Set(v) | FieldEdit::Scrub(v, true)) = field { - app.set_props(ids, json!({"paragraphIndent": v.clamp(0.0, 10_000.0)})); - } - }) - .response - .on_disabled_hover_text(tr("Paragraph indent applies to left-aligned text")); - }); + ui.add_enabled_ui(start_aligned != Some(false), |ui| { + let field = + field_row(ui, tr("Paragraph indent"), |ui, fw| widgets::number_field(ui, Id::new("ty_indent"), Lead::None, indent, "", fw, 1.0)); + if let Some(FieldEdit::Set(v) | FieldEdit::Scrub(v, true)) = field { + app.set_props(ids, json!({"paragraphIndent": v.clamp(0.0, 10_000.0)})); + } + }) + .response + .on_disabled_hover_text(tr("Paragraph indent applies to left-aligned text")); ui.add_space(4.0); for (key, label) in [("hangingPunctuation", tr("Hanging punctuation")), ("hangingList", tr("Hanging list"))] { let all_on = ids.iter().all(|i| { @@ -508,16 +506,13 @@ fn type_settings( if resize == Some(TextAutoResize::Truncate) { let max = common(doc, ids, |n| n.kind.text().map(|t| t.max_lines)).flatten(); ui.add_space(4.0); - ui.horizontal(|ui| { - ui.add_sized(vec2(110.0, FIELD_H), egui::Label::new(egui::RichText::new(tr("Max lines")).font(regular(11.0)).color(t.text))); - let shown = max.map(f64::from).filter(|m| *m > 0.0); - let empty = if max.is_some() { tr("Auto") } else { tr(MIXED) }; - if let Some(FieldEdit::Set(v) | FieldEdit::Scrub(v, true)) = - widgets::number_field_or(ui, Id::new("ty_maxlines"), shown, empty, w - 118.0, 1.0) - { - app.run("text.maxLines", json!({"ids": ids, "lines": v.round().clamp(0.0, 10_000.0)})); - } - }); + let shown = max.map(f64::from).filter(|m| *m > 0.0); + let empty = if max.is_some() { tr("Auto") } else { tr(MIXED) }; + if let Some(FieldEdit::Set(v) | FieldEdit::Scrub(v, true)) = + field_row(ui, tr("Max lines"), |ui, fw| widgets::number_field_or(ui, Id::new("ty_maxlines"), shown, empty, fw, 1.0)) + { + app.run("text.maxLines", json!({"ids": ids, "lines": v.round().clamp(0.0, 10_000.0)})); + } } } else if let (2, Some(face)) = (tab, &vf) { variable_axes(app, ui, ids, styles, face); @@ -542,13 +537,14 @@ fn type_settings( } } -/// A Type settings row: a label, then `add` with the rest of the width. -fn field_row(ui: &mut Ui, label: &str, add: impl FnOnce(&mut Ui, f32) -> R) -> R { +/// A Type settings row: a label, then `add` with the rest of the width. A label wider than its +/// column (French, say) narrows the field rather than the row outgrowing the popover, which then +/// widened every frame (#1029). +pub(crate) fn field_row(ui: &mut Ui, label: &str, add: impl FnOnce(&mut Ui, f32) -> R) -> R { let t = Tokens::get(ui.ctx()); - let w = ui.available_width(); ui.horizontal(|ui| { ui.add_sized(vec2(110.0, FIELD_H), egui::Label::new(egui::RichText::new(label).font(regular(11.0)).color(t.text))); - add(ui, w - 118.0) + add(ui, ui.available_width()) }) .inner } From 8ee0218d1964f66ca42b5cb07cd60ce27c32c3c9 Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Thu, 22 Oct 2026 09:33:12 +0200 Subject: [PATCH 513/817] M3: a variant switch takes the new variant's resizing unless the instance set its own Switching an instance to another variant copied the old root's sizing and min/max back over the new variant's on the rebuild, so an instance switched from a hugging variant to a fixed-width one whose children fill kept hugging at the old width. The next edit then turned those children Fixed, as a child can't fill an axis its parent hugs. Resizing still equal to the old variant's was never the instance's own, so on a sibling-variant switch it now follows the new variant; sizing or min/max the instance set itself stays. --- crates/engine/src/components.rs | 22 +++++++ .../engine/src/components_behaviour_tests.rs | 58 +++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/crates/engine/src/components.rs b/crates/engine/src/components.rs index 67259d030..191a6a7c8 100644 --- a/crates/engine/src/components.rs +++ b/crates/engine/src/components.rs @@ -335,6 +335,27 @@ fn carry_overrides(from: &Node, to: &mut Node, what: Carry) { } } +/// An instance switched from variant `was` to `new`: its resizing (sizing and min / max per axis) +/// that is still `was`'s follows `new`; what the instance set itself stays in `own`. +fn follow_variant_resizing(own: &mut ChildLayout, was: &ChildLayout, new: &ChildLayout) { + if own.sizing_h == was.sizing_h { + own.sizing_h = new.sizing_h; + } + if own.sizing_v == was.sizing_v { + own.sizing_v = new.sizing_v; + } + for (o, w, n) in [ + (&mut own.min_w, was.min_w, new.min_w), + (&mut own.max_w, was.max_w, new.max_w), + (&mut own.min_h, was.min_h, new.min_h), + (&mut own.max_h, was.max_h, new.max_h), + ] { + if *o == w { + *o = n; + } + } +} + /// Copy the values of property group `g` of `from` onto `to`, with the variables bound to them. pub(crate) fn copy_group(from: &Node, to: &mut Node, g: &str) { if from.bound.iter().chain(to.bound.iter()).any(|(k, _)| binding_group(k) == Some(g)) { @@ -779,6 +800,7 @@ fn sync_instance_depth(doc: &mut Document, inst: NodeId, depth: usize, spare: BT if let Some(prev) = root.source.and_then(|p| doc.node(p)).filter(|p| sibling_variants(doc, p.id, component)) { let differs = diff_groups(prev, &comp); root.overrides.retain(|g| g == "name" || !differs.contains(&g.as_str())); + follow_variant_resizing(&mut fresh.child_layout, &prev.child_layout, &comp.child_layout); } carry_overrides(&root, &mut fresh, Carry::Root); if let Some(r) = doc.node_mut(inst) { diff --git a/crates/engine/src/components_behaviour_tests.rs b/crates/engine/src/components_behaviour_tests.rs index 7a5c1f90a..a95e1268c 100644 --- a/crates/engine/src/components_behaviour_tests.rs +++ b/crates/engine/src/components_behaviour_tests.rs @@ -657,6 +657,64 @@ fn switching_variants_keeps_overrides_where_the_variants_agreed() { healthy(&s); } +/// A "Layout" set: Row (horizontal, hugging, a 40 wide "A") and Stacked (vertical, fixed 300 wide, +/// "A" filling it). Returns (set, row, stacked). +fn layout_set(s: &mut Session) -> (NodeId, NodeId, NodeId) { + let mut variants = Vec::new(); + for (k, (name, props, child)) in [ + ("Layout=Row", json!({"layout": "horizontal", "gap": 8, "sizingH": "hug", "sizingV": "hug", "fills": []}), json!({})), + ( + "Layout=Stacked", + json!({"layout": "vertical", "gap": 8, "sizingH": "fixed", "width": 300, "sizingV": "hug", "fills": []}), + json!({"sizingH": "fill"}), + ), + ] + .into_iter() + .enumerate() + { + let c = idv(&ex(s, "node.create", json!({"type": "component", "name": name, "x": k as f64 * 400.0, "props": props}))); + ex(s, "node.create", json!({"type": "rectangle", "parent": c, "name": "A", "width": 40, "height": 20, "props": child})); + variants.push(c); + } + let set = idv(&ex(s, "component.combineVariants", json!({"ids": variants.clone()}))); + (set, variants[0], variants[1]) +} + +#[test] +fn switching_variants_takes_the_new_variants_resizing_unless_the_instance_set_its_own() { + let mut s = Session::new(); + let (set, row, stacked) = layout_set(&mut s); + let i = idv(&ex(&mut s, "instance.create", json!({"component": set, "x": 0, "y": 200}))); + assert_eq!(component_of(&s, i), row); + ex(&mut s, "instance.setProperties", json!({"ids": [i], "properties": {"Layout": "Stacked"}})); + assert_eq!(component_of(&s, i), stacked); + let direct = idv(&ex(&mut s, "instance.create", json!({"component": stacked, "x": 0, "y": 400}))); + let (n, d) = (node(&s, i), node(&s, direct)); + assert_eq!(n.child_layout.sizing_h, Sizing::Fixed, "Row's Hug was never the instance's own: it takes Stacked's Fixed"); + assert_eq!((n.width, n.child_layout.sizing_h), (d.width, d.child_layout.sizing_h), "the same as an instance made from Stacked"); + let a = layer(&s, i, "A").unwrap(); + assert_eq!((node(&s, a).child_layout.sizing_h, node(&s, a).width), (Sizing::Fill, 300.0), "A fills the 300 wide instance"); + // Filling an auto layout parent afterwards leaves A filling, with nothing turned into an override. + let col = idv(&ex( + &mut s, + "node.create", + json!({"type": "frame", "name": "Column", "x": 600, "y": 0, "width": 500, "props": {"layout": "vertical", "sizingH": "fixed", "sizingV": "hug", "fills": []}}), + )); + ex(&mut s, "node.reparent", json!({"ids": [i], "parent": col})); + ex(&mut s, "node.set", json!({"ids": [i], "props": {"sizingH": "fill"}})); + let a = layer(&s, i, "A").unwrap(); + assert_eq!(node(&s, a).child_layout.sizing_h, Sizing::Fill, "A still fills"); + assert!(!node(&s, a).overrides.contains("resizing"), "A's resizing is still the main's"); + assert_eq!(node(&s, a).width, node(&s, i).width); + // Resizing the instance set itself stays across a switch. + let own = idv(&ex(&mut s, "instance.create", json!({"component": set, "x": 0, "y": 600}))); + ex(&mut s, "node.set", json!({"ids": [own], "props": {"minWidth": 120}})); + ex(&mut s, "instance.setProperties", json!({"ids": [own], "properties": {"Layout": "Stacked"}})); + assert_eq!(node(&s, own).child_layout.min_w, Some(120.0), "its own min width stays"); + assert_eq!(node(&s, own).child_layout.sizing_h, Sizing::Fixed, "its sizing, still Row's, follows Stacked"); + healthy(&s); +} + #[test] fn variant_combinations_order_default_and_conflicts() { let mut s = Session::new(); From 857762e65c174a4afb36756d24eff4bf617c2ff5 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Thu, 22 Oct 2026 07:36:21 +0000 Subject: [PATCH 514/817] Treat U+2007 FIGURE SPACE as non-breaking in line breaking Found while testing crates/text/src/breaks.rs:42 Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/text/src/breaks.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/text/src/breaks.rs b/crates/text/src/breaks.rs index 3f5458ead..8012de335 100644 --- a/crates/text/src/breaks.rs +++ b/crates/text/src/breaks.rs @@ -39,7 +39,7 @@ fn class(c: char) -> Class { return Class::Close; } match c { - ' ' | '\t' | '\u{3000}' | '\u{2002}'..='\u{200B}' => Class::Space, + ' ' | '\t' | '\u{3000}' | '\u{2002}'..='\u{2006}' | '\u{2008}'..='\u{200B}' => Class::Space, '-' | '/' | '\u{2010}' | '\u{2013}' | '\u{2014}' => Class::Hyphen, '\u{2E80}'..='\u{2FFF}' | '\u{3003}'..='\u{33FF}' @@ -98,3 +98,15 @@ pub fn grapheme_step(text: &str, index: usize, forward: bool) -> usize { } at.min(index) } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn figure_space_is_non_breaking() { + assert!(!break_between('\u{2007}', '0')); + assert!(!break_between('1', '\u{2007}')); + assert!(!is_space('\u{2007}')); + } +} From 0449edf64582a065220b8028670ca41c5c069e2b Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Thu, 22 Oct 2026 09:37:35 +0200 Subject: [PATCH 515/817] M8: save-format tests keep their temp folders apart SaveFiles named each test's folder after the process id and the clock in nanoseconds. The tests run in parallel and the macOS clock counts microseconds, so two of them often got the same folder and one failed with AlreadyExists (14 of 30 runs here). A counter now keeps the names apart. --- crates/engine/src/save_format_tests.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/save_format_tests.rs b/crates/engine/src/save_format_tests.rs index d635808eb..fc4ca7750 100644 --- a/crates/engine/src/save_format_tests.rs +++ b/crates/engine/src/save_format_tests.rs @@ -15,8 +15,12 @@ struct SaveFiles { impl SaveFiles { fn new() -> Self { + // Tests run in parallel and the clock can read the same for two of them (macOS counts + // microseconds), so a counter keeps their folders apart. + static NEXT: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0); + let n = NEXT.fetch_add(1, std::sync::atomic::Ordering::Relaxed); let stamp = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_nanos(); - let dir = std::env::temp_dir().join(format!("figcraft-save-formats-{}-{stamp}", std::process::id())); + let dir = std::env::temp_dir().join(format!("figcraft-save-formats-{}-{stamp}-{n}", std::process::id())); std::fs::create_dir(&dir).unwrap(); Self { dir, files: Vec::new() } } From a713897d876da6a7bbef2c48c950f8e33aff77dc Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Thu, 22 Oct 2026 09:54:27 +0200 Subject: [PATCH 516/817] M6: SVG import fills open subpaths the way SVG does SVG fills every subpath as if it were closed; the import filled only subpaths that close themselves (a z, or an end within 1e-6 of the start). Logos exported from PDF round relative coordinates to three decimals, so their outlines end about 0.001 short of where they started and most of their letters came in empty. A filled path now has its open subpaths closed before it becomes a vector network: an end within 1/1000 of the path's size snaps onto the start, any other open subpath of two or more segments gets a closing segment. Stroke-only paths are unchanged. A filled and stroked path with a really open subpath becomes a fill layer (closed) under a stroke layer (open), so the stroke stays open as SVG draws it. --- crates/svg/src/import/mod.rs | 100 +++++++++++++++++++--- crates/svg/tests/corpus.rs | 18 ++++ crates/svg/tests/corpus/open_subpaths.svg | 18 ++++ 3 files changed, 124 insertions(+), 12 deletions(-) create mode 100644 crates/svg/tests/corpus/open_subpaths.svg diff --git a/crates/svg/src/import/mod.rs b/crates/svg/src/import/mod.rs index fdae71560..521146fb1 100644 --- a/crates/svg/src/import/mod.rs +++ b/crates/svg/src/import/mod.rs @@ -377,15 +377,38 @@ fn path(cx: &mut Ctx, p: &usvg::Path, parent: NodeId, base: Affine) { return; } path.apply_affine(Affine::translate((-bb.x0, -bb.y0))); - let mut network = VectorNetwork::from_path(&path); let rule = if fill.is_some_and(|f| f.rule() == usvg::FillRule::EvenOdd) { WindingRule::EvenOdd } else { WindingRule::NonZero }; - for r in &mut network.regions { - r.winding = rule; + let vector = |path: &BezPath, filled: bool| { + let mut network = VectorNetwork::from_path(path); + for r in &mut network.regions { + r.winding = rule; + } + if !filled { + network.regions.clear(); + } + NodeKind::Vector { network } + }; + let at = Affine::translate((bb.x0, bb.y0)); + // Fill closes every subpath; a stroke only those that close themselves. A filled + // and stroked path with a really open subpath becomes a fill layer and a stroke layer. + let tol = CLOSE_TOLERANCE * bb.width().max(bb.height()); + let (snapped, closed) = (closed_for_fill(&path, tol, false), closed_for_fill(&path, tol, true)); + if let (Some(_), Some(_)) = (fill, stroke) + && snapped != closed + { + let fill_only = + Node::new(cx.doc.alloc_id(), vector(&closed, true), format!("{} fill", layer_name(p.id(), "Vector")), bb.width(), bb.height()); + let stroke_only = Node::new(cx.doc.alloc_id(), vector(&snapped, false), layer_name(p.id(), "Vector"), bb.width(), bb.height()); + let mut layers = [paint_path(cx, p, fill_only, at, world, true, false), paint_path(cx, p, stroke_only, at, world, false, true)]; + if p.paint_order() == usvg::PaintOrder::StrokeAndFill { + layers.reverse(); + } + for n in layers { + cx.add(n, parent); + } + return; } - if fill.is_none() { - network.regions.clear(); - } - (NodeKind::Vector { network }, Affine::translate((bb.x0, bb.y0)), bb.width(), bb.height(), 0.0) + (vector(if fill.is_some() { &closed } else { &path }, fill.is_some()), at, bb.width(), bb.height(), 0.0) } }; let fallback = match kind { @@ -395,12 +418,18 @@ fn path(cx: &mut Ctx, p: &usvg::Path, parent: NodeId, base: Affine) { _ => "Vector", }; let mut n = Node::new(cx.doc.alloc_id(), kind, layer_name(p.id(), fallback), w, h); - n.transform = transform; n.corners.radii = [radius; 4]; - let target = Target { to_node: transform.inverse() * world, size: (w, h) }; - n.fills = fill.and_then(|f| paint::paint(cx, f.paint(), f.opacity().get(), target)).into_iter().collect(); + let n = paint_path(cx, p, n, transform, world, true, true); + cx.add(n, parent); +} + +/// Layer `n` of path `p` placed at `transform`, with the path's fill and / or stroke. +fn paint_path(cx: &mut Ctx, p: &usvg::Path, mut n: Node, transform: Affine, world: Affine, with_fill: bool, with_stroke: bool) -> Node { + n.transform = transform; + let target = Target { to_node: transform.inverse() * world, size: (n.width, n.height) }; + n.fills = p.fill().filter(|_| with_fill).and_then(|f| paint::paint(cx, f.paint(), f.opacity().get(), target)).into_iter().collect(); n.strokes.clear(); - if let Some(s) = stroke { + if let Some(s) = p.stroke().filter(|_| with_stroke) { n.strokes = paint::paint(cx, s.paint(), s.opacity().get(), target).into_iter().collect(); n.stroke = stroke_props(s, length_scale(world)); // A stroke painted under the fill shows only its outer half. @@ -409,7 +438,54 @@ fn path(cx: &mut Ctx, p: &usvg::Path, parent: NodeId, base: Affine) { n.stroke.weight /= 2.0; } } - cx.add(n, parent); + n +} + +/// How far (as a share of the path's larger side) a subpath may end from its start and still be +/// closed onto it: exporters that round coordinates leave closed outlines this far apart. +const CLOSE_TOLERANCE: f64 = 1e-3; + +/// `path` with the subpaths that end within `tol` of their start closed onto it and, with `all` +/// (SVG fills every subpath as if closed), every other subpath of two or more segments closed +/// with a straight segment. +fn closed_for_fill(path: &BezPath, tol: f64, all: bool) -> BezPath { + use figcraft_geom::kurbo::PathEl; + let mut out = BezPath::new(); + let mut sub: Vec = Vec::new(); + let flush = |sub: &mut Vec, out: &mut BezPath| { + let start = match sub.first() { + Some(PathEl::MoveTo(p)) => *p, + _ => { + sub.clear(); + return; + } + }; + let open = !matches!(sub.last(), Some(PathEl::ClosePath)); + let segments = sub.len() - 1; + if open && segments >= 2 { + let near = sub.last().and_then(|e| e.end_point()).is_some_and(|end| (end - start).hypot() <= tol); + if near && let Some(last) = sub.last_mut() { + match last { + PathEl::LineTo(p) | PathEl::QuadTo(_, p) | PathEl::CurveTo(_, _, p) => *p = start, + PathEl::MoveTo(_) | PathEl::ClosePath => {} + } + } + if near || all { + sub.push(PathEl::ClosePath); + } + } + for e in sub.drain(..) { + out.push(e); + } + }; + for e in path.elements() { + if matches!(e, PathEl::MoveTo(_)) { + flush(&mut sub, &mut out); + } + sub.push(*e); + } + flush(&mut sub, &mut out); + out } /// A recognised primitive placed by `world`: its kind, transform, size and corner radius. `None` diff --git a/crates/svg/tests/corpus.rs b/crates/svg/tests/corpus.rs index 35f6f9f45..ac0c38ddb 100644 --- a/crates/svg/tests/corpus.rs +++ b/crates/svg/tests/corpus.rs @@ -243,6 +243,24 @@ fn groups_keep_their_ids_and_transforms_bake_into_shapes() { assert_eq!(layer(&d, f, "d").kind.type_name(), "VECTOR"); } +#[test] +fn fills_close_open_subpaths() { + let (d, f) = imported("open_subpaths"); + let loops = |n: &figcraft_doc::Node| match &n.kind { + NodeKind::Vector { network } => network.regions.iter().map(|r| r.loops.len()).sum::(), + _ => 0, + }; + // One filled layer: all four subpaths are fill loops, the 0.001 gap and the triangle included. + let filled = layer(&d, f, "filled"); + assert_eq!((filled.kind.type_name(), loops(filled), filled.strokes.len()), ("VECTOR", 4, 0)); + // Filled and stroked with an open triangle: a fill layer under the stroke, which stays open. + let (fill, stroke) = (layer(&d, f, "stroked fill"), layer(&d, f, "stroked")); + assert_eq!((loops(fill), fill.fills.len(), fill.strokes.len()), (2, 1, 0)); + assert_eq!((loops(stroke), stroke.fills.len(), stroke.strokes.len()), (0, 0, 1)); + let order: Vec<&str> = d.node(f).unwrap().children.iter().filter_map(|c| d.node(*c)).map(|n| n.name.as_str()).collect(); + assert_eq!(order, ["filled", "stroked fill", "stroked"], "the fill paints first, as SVG paints fill then stroke"); +} + #[test] fn basic_shapes_stay_rectangles_ellipses_and_lines() { let (d, f) = imported("primitives"); diff --git a/crates/svg/tests/corpus/open_subpaths.svg b/crates/svg/tests/corpus/open_subpaths.svg new file mode 100644 index 000000000..2d944942d --- /dev/null +++ b/crates/svg/tests/corpus/open_subpaths.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + From 85010e491afbb1fd1cbbd94281e7e8a92884015f Mon Sep 17 00:00:00 2001 From: RealtaNua Date: Wed, 21 Oct 2026 09:52:50 +0700 Subject: [PATCH 517/817] M7: missing fonts: follow each font variable's aliases once (#752) A file whose font family variables alias each other in several modes made the missing-fonts walk branch in every mode, billions of steps before the depth limit stopped it, freezing the app on open and `figcraft-cli info`. The walk now visits each variable once. Co-Authored-By: Claude Opus 5.5 (1M context) --- crates/engine/src/fonts.rs | 12 ++++++++---- crates/engine/src/fonts_tests.rs | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/fonts.rs b/crates/engine/src/fonts.rs index 672d4f2ca..bdda411cb 100644 --- a/crates/engine/src/fonts.rs +++ b/crates/engine/src/fonts.rs @@ -64,16 +64,20 @@ pub fn missing(doc: &Document) -> Vec { used.into_values().filter(|(family, _)| !figcraft_text::has_family(family)).map(|(family, layers)| Missing { family, layers }).collect() } -/// Every string value of variable `id` in any mode, following aliases (at most 32 deep). +/// Every string value of variable `id` in any mode, following aliases (each variable once). fn string_values(vars: &Variables, id: &str) -> Vec { let mut out = Vec::new(); - let mut todo = vec![(id.to_string(), 0)]; - while let Some((id, depth)) = todo.pop() { + let mut seen = BTreeSet::new(); + let mut todo = vec![id.to_string()]; + while let Some(id) = todo.pop() { + if !seen.insert(id.clone()) { + continue; + } let Some(var) = vars.get(&id) else { continue }; for v in var.values.values() { match v { VariableValue::String(s) => out.push(s.clone()), - VariableValue::Alias(a) if depth < 32 => todo.push((a.clone(), depth + 1)), + VariableValue::Alias(a) => todo.push(a.clone()), _ => {} } } diff --git a/crates/engine/src/fonts_tests.rs b/crates/engine/src/fonts_tests.rs index 0fe6dcb3f..5df9a8540 100644 --- a/crates/engine/src/fonts_tests.rs +++ b/crates/engine/src/fonts_tests.rs @@ -119,6 +119,25 @@ fn blank_families_and_aliases_are_handled() { assert_eq!(families(&mut s), vec![("FigCraft Missing F".to_string(), 1), ("FigCraft Missing G".to_string(), 1)]); } +/// Aliases in several modes are followed once per variable: a chain that branches in every mode +/// would otherwise grow to billions of steps (a file can hold one). +#[test] +fn branching_alias_chains_are_walked_once_per_variable() { + let mut s = Session::new(); + s.execute("variable.createCollection", &json!({"name": "Type"})).unwrap(); + for i in 0..32 { + s.execute("variable.create", &json!({"collection": "Type", "name": format!("V{i}"), "type": "string", "value": "x"})).unwrap(); + } + let doc = s.doc_mut().unwrap(); + let ids: Vec = doc.variables.variables.iter().map(|v| v.id.clone()).collect(); + for (i, var) in doc.variables.variables.iter_mut().enumerate() { + let next = ids.get(i + 1).cloned().unwrap_or_else(|| "FigCraft Missing H".into()); + let leaf = |v: String| if i + 1 < ids.len() { VariableValue::Alias(v) } else { VariableValue::String(v) }; + var.values = [("m1".to_string(), leaf(next.clone())), ("m2".to_string(), leaf(next))].into(); + } + assert_eq!(string_values(&doc.variables, &ids[0]), vec!["FigCraft Missing H", "FigCraft Missing H"]); +} + #[test] fn needs_an_open_document() { let mut s = Session::empty(); From e8c47428741292340a41ca9394b31fd02536cedc Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Thu, 22 Oct 2026 10:27:34 +0200 Subject: [PATCH 518/817] M6: the open-subpath fixture covers stroke-first paint order A third row in open_subpaths.svg: a filled and stroked path that is only 0.001 short stays one layer, and an open triangle with paint-order="stroke" puts its stroke layer under its fill layer. --- crates/svg/tests/corpus.rs | 5 ++++- crates/svg/tests/corpus/open_subpaths.svg | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/crates/svg/tests/corpus.rs b/crates/svg/tests/corpus.rs index ac0c38ddb..24803c40e 100644 --- a/crates/svg/tests/corpus.rs +++ b/crates/svg/tests/corpus.rs @@ -257,8 +257,11 @@ fn fills_close_open_subpaths() { let (fill, stroke) = (layer(&d, f, "stroked fill"), layer(&d, f, "stroked")); assert_eq!((loops(fill), fill.fills.len(), fill.strokes.len()), (2, 1, 0)); assert_eq!((loops(stroke), stroke.fills.len(), stroke.strokes.len()), (0, 0, 1)); + // Only near-closed ends: one layer, closed, stroke and all. + let near = layer(&d, f, "near"); + assert_eq!((loops(near), near.fills.len(), near.strokes.len()), (1, 1, 1)); let order: Vec<&str> = d.node(f).unwrap().children.iter().filter_map(|c| d.node(*c)).map(|n| n.name.as_str()).collect(); - assert_eq!(order, ["filled", "stroked fill", "stroked"], "the fill paints first, as SVG paints fill then stroke"); + assert_eq!(order, ["filled", "stroked fill", "stroked", "near", "under", "under fill"], "paint order: fill then stroke, or the stroke first"); } #[test] diff --git a/crates/svg/tests/corpus/open_subpaths.svg b/crates/svg/tests/corpus/open_subpaths.svg index 2d944942d..daed50b7d 100644 --- a/crates/svg/tests/corpus/open_subpaths.svg +++ b/crates/svg/tests/corpus/open_subpaths.svg @@ -1,10 +1,14 @@ - + + stroked: 0.001 short (closed, stroke and all); an open triangle (stroked open). Third row, + filled and stroked: only 0.001 short (one layer); an open triangle with its stroke under + the fill. --> + + @@ -15,4 +19,10 @@ + + + + + + From 79e722d3407b65ebc16ba7030e3bf979b6ae3ee1 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Thu, 22 Oct 2026 08:56:12 +0000 Subject: [PATCH 519/817] Keep literal true/false distinct from variables named true/false Found while testing crates/doc/src/proto_expr_parse.rs:462 (variable lookup before the true/false literals at :466) with crates/doc/src/proto_expr.rs:151/186 (display writes the literal as bare `true` and var_ref writes such a variable bare) Co-Authored-By: Claude Opus 5.5 --- crates/doc/src/proto_expr_parse.rs | 13 ++++++++----- crates/doc/src/proto_expr_parse_tests.rs | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/crates/doc/src/proto_expr_parse.rs b/crates/doc/src/proto_expr_parse.rs index 5214a2d60..54615ee04 100644 --- a/crates/doc/src/proto_expr_parse.rs +++ b/crates/doc/src/proto_expr_parse.rs @@ -459,16 +459,19 @@ impl Parser<'_> { if self.at_keyword("mode") && self.next_after(4) == Some('(') { return self.mode_of(); } - if let Some((id, n)) = self.variable_here() { - self.i += n; - return self.in_mode(id); - } + let var = self.variable_here(); + // A bare `true`/`false` is the literal, also when a variable has that name (it reads + // as `{true}`); longer names that start with it ("true value") stay variables. for (word, v) in [("true", true), ("false", false)] { - if self.at_keyword(word) { + if self.at_keyword(word) && var.as_ref().is_none_or(|(_, n)| *n <= word.len()) { self.i += word.len(); return Ok(Expr::Value(VariableValue::Boolean(v))); } } + if let Some((id, n)) = var { + self.i += n; + return self.in_mode(id); + } let word: String = self.s.iter().skip(self.i).take_while(|c| ident(**c)).collect(); if word.is_empty() { Err(self.err(format!("Unexpected {c}"))) } else { Err(self.err(format!("No variable `{word}`"))) } } diff --git a/crates/doc/src/proto_expr_parse_tests.rs b/crates/doc/src/proto_expr_parse_tests.rs index e106121d8..8d4c1e1ac 100644 --- a/crates/doc/src/proto_expr_parse_tests.rs +++ b/crates/doc/src/proto_expr_parse_tests.rs @@ -195,3 +195,25 @@ fn names_that_look_like_literals_read_back_as_variables() { assert_eq!(parse("1"), n(1.0)); assert_eq!(parse("\"q\""), Expr::Value(VariableValue::String("q".into()))); } + +#[test] +fn literal_true_false_survive_variables_named_true_false() { + use ExprOp::*; + let lit = |x: bool| Expr::Value(VariableValue::Boolean(x)); + for name in ["true", "false", "TRUE"] { + let mut v = vars(); + if let Some(var) = v.variables.iter_mut().find(|x| x.id == "b") { + var.name = name.into(); + } + for e in [ + Expr::op(Equals, vec![Expr::var("b"), lit(true)]), + Expr::op(Equals, vec![Expr::var("b"), lit(false)]), + Expr::op(Not, vec![lit(false)]), + Expr::var("b"), + ] { + let shown = e.display(&v); + assert_eq!(Expr::parse(&shown, &v), Ok(e.clone()), "{name:?} shown as {shown:?}"); + } + assert_eq!(Expr::parse(&format!("{{{name}}}"), &v), Ok(Expr::var("b"))); + } +} From 24a5855cab91135c20cfc8904c4925c87629c92d Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Thu, 22 Oct 2026 09:27:59 +0200 Subject: [PATCH 520/817] M3: style links given in a call apply after its values apply_order gave fillStyle, strokeStyle, effectStyle, gridStyle and textStyle the rank of plain values, so the JSON map's byte order decided: fills, strokes, effects, grids, layoutGrids and variationSettings sort after their link and overrode it (node.set then unlinked the style; node.create kept a link its values contradicted). Style links now apply after the values and x/y, just before boundVariables. A deviation set in a later call still unlinks. --- crates/engine/src/cmd/props.rs | 8 ++- crates/engine/src/styles_behaviour_tests.rs | 67 +++++++++++++++++++++ docs/mcp.md | 8 ++- 3 files changed, 77 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/cmd/props.rs b/crates/engine/src/cmd/props.rs index f180b53c8..015bcc5a6 100644 --- a/crates/engine/src/cmd/props.rs +++ b/crates/engine/src/cmd/props.rs @@ -372,14 +372,16 @@ fn set_paints(n: &mut Node, fills: bool, paints: Vec) { } } -/// The order [`apply`] takes keys in: geometry first so rotation applies to the final size, variable -/// bindings last so paints set in the same call don't detach them. +/// The order [`apply`] takes keys in: geometry first so rotation applies to the final size, style +/// links after the values so a link wins over values its style sets, variable bindings last so +/// paints set in the same call don't detach them. fn apply_order(k: &str) -> u8 { match k { "width" | "height" | "w" | "h" => 0, "rotation" => 2, "x" | "y" => 3, - "boundVariables" => 4, + "fillStyle" | "strokeStyle" | "effectStyle" | "textStyle" | "gridStyle" => 4, + "boundVariables" => 5, _ => 1, } } diff --git a/crates/engine/src/styles_behaviour_tests.rs b/crates/engine/src/styles_behaviour_tests.rs index ff7af50b9..de9da5a5d 100644 --- a/crates/engine/src/styles_behaviour_tests.rs +++ b/crates/engine/src/styles_behaviour_tests.rs @@ -80,6 +80,20 @@ fn link(s: &Session, n: NodeId, kind: &str) -> Option { } } +/// The key linking a style of `kind` (a paint style links fills). +fn style_key(kind: &str) -> String { + if kind == "paint" { "fillStyle".into() } else { format!("{kind}Style") } +} + +/// `node.create` params for an unselected layer that takes `kind` styles, with `props`. +fn new_layer(kind: &str, props: Value) -> Value { + if kind == "text" { + json!({"type": "text", "text": "Hej", "select": false, "props": props}) + } else { + json!({"type": "frame", "select": false, "props": props}) + } +} + #[test] fn a_style_holds_the_whole_property_and_links_its_source() { // Documented: colour styles can hold several fills (gradients, images); effect styles combine @@ -234,6 +248,59 @@ fn editing_a_styled_property_detaches_that_style_only() { let _ = st; } +#[test] +fn a_style_link_wins_over_values_in_the_same_call() { + // Docs silent on one call setting both (a linked layer shows its style's values; editing one + // detaches it); pinned: the link wins whatever the keys are called, on node.create and + // node.set, and a deviation set in a later call unlinks as before. + let mut s = Session::new(); + let rows = styled(&mut s); + let pairs: [(&str, &str, Value); 12] = [ + ("paint", "fill", json!("#123456")), + ("paint", "fills", json!(["#123456"])), + ("stroke", "stroke", json!("#123456")), + ("stroke", "strokes", json!(["#123456"])), + ("effect", "effects", json!([])), + ("grid", "grids", json!([])), + ("grid", "layoutGrids", json!([])), + ("text", "fontStyle", json!("Bold")), + ("text", "lineHeight", json!(40)), + ("text", "textDecoration", json!("underline")), + ("text", "letterSpacing", json!(5)), + ("text", "variationSettings", json!({"wght": 700})), + ]; + for (kind, key, value) in pairs { + let (source, st, _) = rows.iter().find(|r| r.2 == kind).unwrap().clone(); + let link_key = style_key(kind); + let props = json!({key: value.clone(), link_key.as_str(): st.clone()}); + let made = id(run(&mut s, "node.create", new_layer(kind, props.clone()))); + let set = if kind == "text" { text(&mut s, 400.0) } else { rect(&mut s, 400.0) }; + run(&mut s, "node.set", json!({"id": set, "props": props})); + for (how, layer) in [("node.create", made), ("node.set", set)] { + assert_eq!(link(&s, layer, kind).as_deref(), Some(st.as_str()), "{how} `{key}` + `{link_key}`: linked"); + assert_eq!(shown(&s, layer, kind), shown(&s, source, kind), "{how} `{key}` + `{link_key}`: the style's values"); + } + run(&mut s, "node.set", json!({"id": set, "props": {key: value}})); + assert_eq!(link(&s, set, kind), None, "`{key}` in a later call unlinks"); + assert_ne!(shown(&s, set, kind), shown(&s, source, kind), "`{key}` in a later call applies"); + } +} + +#[test] +fn a_style_link_leaves_values_its_style_does_not_set() { + // Docs silent; pinned: alignment given beside a text style applies, on node.create and node.set. + let mut s = Session::new(); + let st = styled(&mut s).into_iter().find(|r| r.2 == "text").unwrap().1; + let props = json!({"textStyle": st, "textAlign": "center"}); + let made = id(run(&mut s, "node.create", new_layer("text", props.clone()))); + let set = text(&mut s, 400.0); + run(&mut s, "node.set", json!({"id": set, "props": props})); + for (how, layer) in [("node.create", made), ("node.set", set)] { + assert_eq!(link(&s, layer, "text").as_deref(), Some(st.as_str()), "{how}: linked"); + assert_eq!(node(&s, layer).kind.text().unwrap().align_h, figcraft_doc::TextAlignH::Center, "{how}: `textAlign` applies"); + } +} + #[test] fn applying_a_style_replaces_variables_bound_to_that_property() { // Documented: applying a style sets the property to the style's values. Docs silent on bound diff --git a/docs/mcp.md b/docs/mcp.md index dfea95cc2..0e774d136 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -267,9 +267,11 @@ Or in a project's `.mcp.json`: - **Styles stay true to their layers**: editing a styled fill, stroke, effect or layout grid list (`node.set`, `fill.set`, `fill.add`, a bound variable…) unlinks that style (`styles.fill` etc. go `null`), so a later `style.update` doesn't overwrite the edit; `style.apply` replaces variables - bound to what the style sets; a text style goes on text layers only. Names are trimmed per `/` - folder part. `style.move {styles, before?, folder?}` reorders (and with `folder`, renames into it), - `style.duplicate {style}` adds " copy" right below, `style.renameFolder {folder, name}`. + bound to what the style sets; a text style goes on text layers only. In one call, a style link + (`fillStyle`, `textStyle`…) wins over values it sets; set a deviation in a later call, which + unlinks it. Names are trimmed per `/` folder part. `style.move {styles, before?, folder?}` + reorders (and with `folder`, renames into it), `style.duplicate {style}` adds " copy" right + below, `style.renameFolder {folder, name}`. - **Variables**: `variable.bind` refuses a variable of a type the field doesn't take (a colour on `width`); scopes only filter pickers. `variable.delete` / `variable.deleteCollection` unbind the layers using them (they keep their last value) and give aliases to them their values. An From 93c0bb9ce225b191f4993114ab821c6091195863 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Thu, 22 Oct 2026 09:20:19 +0000 Subject: [PATCH 521/817] =?UTF-8?q?Keep=20`not=20`=20from=20reading?= =?UTF-8?q?=20back=20as=20a=20variable=20named=20"not=20=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found while testing crates/doc/src/proto_expr.rs:172 (display writes `not {x}` with a bare var_ref) with crates/doc/src/proto_expr_parse.rs:262 (not() checks variable names before the `not` keyword) Co-Authored-By: Claude Opus 5.5 --- crates/doc/src/proto_expr.rs | 7 ++++++- crates/doc/src/proto_expr_parse_tests.rs | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/crates/doc/src/proto_expr.rs b/crates/doc/src/proto_expr.rs index f4404dc7e..d5441b283 100644 --- a/crates/doc/src/proto_expr.rs +++ b/crates/doc/src/proto_expr.rs @@ -169,7 +169,12 @@ impl Expr { }) .collect(); match (op, parts.as_slice()) { - (ExprOp::Not, [x]) => format!("not {x}"), + // `not done` reads as a variable named "not done" if there is one: then + // `not (done)`. + (ExprOp::Not, [x]) => { + let bare = format!("not {x}"); + if x.starts_with('(') || Expr::parse(&bare, vars).is_ok_and(|e| e == *self) { bare } else { format!("not ({x})") } + } (ExprOp::Negate, [x]) => format!("-{x}"), _ => parts.join(&format!(" {} ", op.symbol())), } diff --git a/crates/doc/src/proto_expr_parse_tests.rs b/crates/doc/src/proto_expr_parse_tests.rs index e106121d8..e2d4592a4 100644 --- a/crates/doc/src/proto_expr_parse_tests.rs +++ b/crates/doc/src/proto_expr_parse_tests.rs @@ -195,3 +195,27 @@ fn names_that_look_like_literals_read_back_as_variables() { assert_eq!(parse("1"), n(1.0)); assert_eq!(parse("\"q\""), Expr::Value(VariableValue::String("q".into()))); } + +#[test] +fn not_of_a_variable_reads_back_when_a_name_starts_with_not() { + use ExprOp::*; + let mut v = vars(); + let b = v.variables.iter().find(|x| x.id == "b").unwrap().clone(); + for (id, name) in [("done", "done"), ("nd", "not done")] { + let mut x = b.clone(); + x.id = id.into(); + x.name = name.into(); + v.variables.push(x); + } + let not_done = Expr::op(Not, vec![Expr::var("done")]); + for e in [ + not_done.clone(), + Expr::op(And, vec![Expr::var("b"), not_done.clone()]), + Expr::op(Equals, vec![not_done.clone(), Expr::Value(VariableValue::Boolean(true))]), + Expr::op(Not, vec![not_done.clone()]), + ] { + let shown = e.display(&v); + assert_eq!(Expr::parse(&shown, &v), Ok(e.clone()), "shown as {shown:?}"); + } + assert_eq!(Expr::op(Not, vec![Expr::var("b")]).display(&vars()), "not b-name", "plain names stay bare"); +} From 6db58d32cb17ff18e4f1e32613ab5df4955e942c Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Thu, 22 Oct 2026 09:57:31 +0200 Subject: [PATCH 522/817] M4: individual stroke weights follow the corner radius like CSS borders stroke_area used rect_side_strokes only for square corners; a rounded rect-like layer with individual weights fell through to a uniform ring at stroke.weight (canvas, SVG, PDF, shadows, shape builder, outline stroke). pathops::rounded_side_strokes now draws them as CSS does: the outer edge is the rounded rect (the fill outline for inside strokes), the inner edge is inset by each side's weight with elliptical corners max(0, R - weight), so border-l-4 rounded-r-lg is a straight bar and a weight that differs across a rounded corner tapers through it. Center and outside grow the outer box and each non-zero radius by half or all of the weight (CSS has only inside). The inner edge runs against the outer one, so the ring is a ring under non-zero too; where it could leave the outer edge (radii shrunk to fit a narrow inner box, smoothed outer corners) it is cut out instead. --- crates/pathops/src/lib.rs | 90 ++++++++++++++ .../pathops/src/rounded_side_strokes_tests.rs | 114 ++++++++++++++++++ crates/render/src/draw.rs | 8 +- crates/render/src/tests.rs | 21 ++++ crates/svg/src/tests.rs | 20 +++ 5 files changed, 251 insertions(+), 2 deletions(-) create mode 100644 crates/pathops/src/rounded_side_strokes_tests.rs diff --git a/crates/pathops/src/lib.rs b/crates/pathops/src/lib.rs index fb9cfcfec..ca2ee0b6b 100644 --- a/crates/pathops/src/lib.rs +++ b/crates/pathops/src/lib.rs @@ -13,6 +13,8 @@ mod brush_tests; mod ops_tests; mod points; #[cfg(test)] +mod rounded_side_strokes_tests; +#[cfg(test)] mod sides_tests; pub mod width; #[cfg(test)] @@ -451,6 +453,94 @@ pub fn rect_side_strokes(w: f64, h: f64, sides: [f64; 4], align: StrokeAlign) -> p } +/// Per-side stroke of a rectangle with corner radii `[tl, tr, br, bl]`, like CSS borders: the outer +/// edge is the rounded rectangle (center and outside grow its box by half or all of each side's +/// weight, and each non-zero radius with it); the inner edge is inset by each side's weight, with +/// elliptical corners `max(0, R − weight)` across and down (square where either is 0). An even-odd +/// ring whose inner edge runs against the outer one, so it is a ring under non-zero too. +pub fn rounded_side_strokes(w: f64, h: f64, radii: [f64; 4], smoothing: f64, sides: [f64; 4], align: StrokeAlign) -> BezPath { + let [t, r, b, l] = sides.map(non_negative); + if t + r + b + l <= 0.0 { + return BezPath::new(); + } + let f = match align { + StrokeAlign::Inside => 0.0, + StrokeAlign::Center => 0.5, + StrokeAlign::Outside => 1.0, + }; + // Clamped like the fill: at most half the shorter side. + let max_r = non_negative(w.min(h)) / 2.0; + let radii = radii.map(|v| non_negative(v).min(max_r)); + // Each corner's radius with the weights across and down it, clockwise from the top-left. + let corners = [(radii[0], l, t), (radii[1], r, t), (radii[2], r, b), (radii[3], l, b)]; + let outer = if align == StrokeAlign::Inside { + figcraft_geom::rounded_rect(w, h, radii, smoothing) + } else { + let grown = corners.map(|(rr, x, y)| if rr > 0.0 { (rr + x * f, rr + y * f) } else { (0.0, 0.0) }); + elliptical_rect(figcraft_geom::Rect::new(-l * f, -t * f, w + r * f, h + b * f), grown) + }; + let k = 1.0 - f; + let inner = figcraft_geom::Rect::new(l * k, t * k, w - r * k, h - b * k); + if inner.width() <= 0.0 || inner.height() <= 0.0 { + return outer; + } + let (inset, fit) = fit_corners(inner, corners.map(|(rr, x, y)| ((rr - x * k).max(0.0), (rr - y * k).max(0.0)))); + // The hole's corners sit on the outer ones, inside them, unless they were shrunk to fit or the + // outer ones are smoothed: then it may leave the outer edge. + ring(outer, &elliptical_rect(inner, inset), fit < 1.0 || (align == StrokeAlign::Inside && smoothing > 0.0)) +} + +fn non_negative(v: f64) -> f64 { + if v.is_finite() { v.max(0.0) } else { 0.0 } +} + +/// `outer` with `hole` taken out: cut out of it when the hole may leave it, else as an even-odd +/// ring whose hole runs against it. +fn ring(outer: BezPath, hole: &BezPath, cut: bool) -> BezPath { + if cut && let Ok(p) = boolean_step(&outer, hole, BoolOp::Subtract) { + return p; + } + let mut p = outer; + p.extend(hole.reverse_subpaths().elements().iter().copied()); + p +} + +/// Corner radii `(rx, ry)` for the inner box `inner`, square where either is 0, all shrunk by one +/// factor (returned too) where two on an edge add up to more than it, as CSS shrinks radii. +fn fit_corners(inner: figcraft_geom::Rect, corners: [(f64, f64); 4]) -> ([(f64, f64); 4], f64) { + let c = corners.map(|(rx, ry)| if rx > 0.0 && ry > 0.0 { (rx, ry) } else { (0.0, 0.0) }); + let [tl, tr, br, bl] = c; + let edges = [(inner.width(), tl.0 + tr.0), (inner.width(), bl.0 + br.0), (inner.height(), tl.1 + bl.1), (inner.height(), tr.1 + br.1)]; + let fit = edges.iter().filter(|(_, sum)| *sum > 0.0).fold(1.0_f64, |m, (len, sum)| m.min(len / sum)); + (c.map(|(rx, ry)| (rx * fit, ry * fit)), fit) +} + +/// Rectangle `r` with an `(rx, ry)` quarter ellipse at each corner `[tl, tr, br, bl]`, drawn like +/// `figcraft_geom::rounded_rect` (circular corners come out the same). +fn elliptical_rect(r: figcraft_geom::Rect, [tl, tr, br, bl]: [(f64, f64); 4]) -> BezPath { + use std::f64::consts::{FRAC_PI_2, PI}; + // Each corner, the direction of its ellipse centre from it, and the angle its quarter starts at. + let quarters = [ + (Point::new(r.x1, r.y0), (-1.0, 1.0), tr, -FRAC_PI_2), + (Point::new(r.x1, r.y1), (-1.0, -1.0), br, 0.0), + (Point::new(r.x0, r.y1), (1.0, -1.0), bl, FRAC_PI_2), + (Point::new(r.x0, r.y0), (1.0, 1.0), tl, PI), + ]; + let mut p = BezPath::new(); + p.move_to((r.x0 + tl.0, r.y0)); + for (corner, (sx, sy), (rx, ry), start) in quarters { + if rx > 0.0 && ry > 0.0 { + let c = Point::new(corner.x + sx * rx, corner.y + sy * ry); + p.line_to((c.x + rx * start.cos(), c.y + ry * start.sin())); + kurbo::Arc::new(c, (rx, ry), start, FRAC_PI_2, 0.0).to_cubic_beziers(0.01, |a, b, e| p.curve_to(a, b, e)); + } else { + p.line_to(corner); + } + } + p.close_path(); + p +} + #[cfg(test)] mod tests { use super::*; diff --git a/crates/pathops/src/rounded_side_strokes_tests.rs b/crates/pathops/src/rounded_side_strokes_tests.rs new file mode 100644 index 000000000..ee0e82811 --- /dev/null +++ b/crates/pathops/src/rounded_side_strokes_tests.rs @@ -0,0 +1,114 @@ +//! Per-side stroke weights on rounded rectangles, drawn like CSS borders: square corners, a bar +//! along a rounded edge, tapers through corners, alignments, inner corners that no longer fit, +//! smoothing and degenerate weights. + +use figcraft_doc::StrokeAlign; +use figcraft_geom::kurbo::{BezPath, Point, Shape}; +use figcraft_geom::rounded_rect; + +use crate::{rect_side_strokes, rounded_side_strokes}; + +const W: f64 = 120.0; +const H: f64 = 60.0; + +/// The area of a ring whose hole runs against its outer edge. +fn area(p: &BezPath) -> f64 { + p.area().abs() +} + +fn painted(p: &BezPath, x: f64, y: f64) -> bool { + p.winding(Point::new(x, y)) % 2 != 0 +} + +#[test] +fn square_corners_paint_what_rect_side_strokes_paints() { + for align in [StrokeAlign::Inside, StrokeAlign::Center, StrokeAlign::Outside] { + let sides = [1.0, 2.0, 3.0, 4.0]; + let a = area(&rounded_side_strokes(W, H, [0.0; 4], 0.0, sides, align)); + assert!((a - area(&rect_side_strokes(W, H, sides, align))).abs() < 1e-6, "{align:?}: {a}"); + } +} + +/// `border-l-4 rounded-r-lg`. +#[test] +fn a_left_border_on_a_right_rounded_box_is_a_straight_bar() { + let bar = rounded_side_strokes(W, H, [0.0, 8.0, 8.0, 0.0], 0.0, [0.0, 0.0, 0.0, 4.0], StrokeAlign::Inside); + assert!((area(&bar) - 4.0 * H).abs() < 1e-6, "{}", area(&bar)); + assert!(painted(&bar, 2.0, 30.0)); + for (x, y) in [(119.9, 30.0), (117.0, 1.0), (60.0, 0.1), (60.0, 59.9), (4.1, 30.0)] { + assert!(!painted(&bar, x, y), "({x}, {y})"); + } +} + +#[test] +fn one_weight_on_every_side_is_the_uniform_ring() { + let ring = rounded_side_strokes(W, H, [8.0; 4], 0.0, [2.0; 4], StrokeAlign::Inside); + let want = area(&rounded_rect(W, H, [8.0; 4], 0.0)) - area(&rounded_rect(W - 4.0, H - 4.0, [6.0; 4], 0.0)); + assert!((area(&ring) - want).abs() < 1e-6, "{} vs {want}", area(&ring)); + assert_eq!(ring.winding(Point::new(60.0, 30.0)), 0, "a hole under non-zero too"); +} + +#[test] +fn center_and_outside_grow_the_box_and_its_corners() { + for (align, out, inset) in [(StrokeAlign::Center, 1.0, 1.0), (StrokeAlign::Outside, 2.0, 0.0)] { + let a = area(&rounded_side_strokes(W, H, [8.0; 4], 0.0, [2.0; 4], align)); + let outer = area(&rounded_rect(W + 2.0 * out, H + 2.0 * out, [8.0 + out; 4], 0.0)); + let hole = area(&rounded_rect(W - 2.0 * inset, H - 2.0 * inset, [8.0 - inset; 4], 0.0)); + assert!((a - (outer - hole)).abs() < 1e-6, "{align:?}: {a} vs {}", outer - hole); + } +} + +/// 8 × 7 inner ellipses at the bottom corners. +#[test] +fn a_bottom_border_tapers_into_the_bottom_corners() { + let bottom = rounded_side_strokes(W, H, [8.0; 4], 0.0, [0.0, 0.0, 1.0, 0.0], StrokeAlign::Inside); + assert!(painted(&bottom, 60.0, 59.5) && painted(&bottom, 8.0, 59.5) && painted(&bottom, 112.0, 59.5)); + for (x, y) in [(60.0, 0.5), (0.5, 30.0), (0.5, 52.0), (119.5, 52.0), (4.0, 4.0)] { + assert!(!painted(&bottom, x, y), "({x}, {y})"); + } +} + +#[test] +fn a_weight_past_the_radius_leaves_square_inner_corners() { + let top = rounded_side_strokes(W, H, [8.0; 4], 0.0, [10.0, 0.0, 0.0, 2.0], StrokeAlign::Inside); + assert!(!painted(&top, 2.2, 10.2) && !painted(&top, 119.8, 10.2)); + assert!(painted(&top, 60.0, 9.8) && painted(&top, 1.8, 30.0)); +} + +/// A weight past `w − R` leaves inner corners wider than the inner box: they shrink to fit, so the +/// hole stays inside the outer edge, across or down. +#[test] +fn inner_corners_shrink_to_fit_a_narrow_inner_box() { + let wide = rounded_side_strokes(20.0, 20.0, [10.0; 4], 0.0, [0.0, 0.0, 0.0, 12.0], StrokeAlign::Inside); + assert!(painted(&wide, 6.0, 10.0) && !painted(&wide, 16.0, 10.0)); + assert!(!painted(&wide, 17.5, 3.0) && !painted(&wide, 17.5, 17.0), "nothing past the outer edge"); + let tall = rounded_side_strokes(20.0, 20.0, [10.0; 4], 0.0, [12.0, 0.0, 0.0, 0.0], StrokeAlign::Inside); + assert!(painted(&tall, 10.0, 6.0) && !painted(&tall, 10.0, 16.0)); + assert!(!painted(&tall, 3.0, 17.5) && !painted(&tall, 17.0, 17.5), "nothing past the outer edge"); + let pill = rounded_side_strokes(30.0, 20.0, [10.0; 4], 0.0, [0.0, 0.0, 0.0, 25.0], StrokeAlign::Inside); + assert!(painted(&pill, 12.0, 10.0) && !painted(&pill, 27.0, 10.0)); + assert!(!painted(&pill, 24.0, 0.5) && !painted(&pill, 24.0, 19.5), "nothing past the outer edge"); +} + +#[test] +fn smoothed_corners_keep_the_stroke_inside_the_fill() { + let smooth = rounded_side_strokes(W, H, [16.0; 4], 0.6, [0.0, 0.0, 2.0, 0.0], StrokeAlign::Inside); + let fill = rounded_rect(W, H, [16.0; 4], 0.6); + let grid = (0..1200).flat_map(|i| (0..600).map(move |j| Point::new(f64::from(i) * 0.1 + 0.05, f64::from(j) * 0.1 + 0.05))); + let stray = grid.filter(|pt| painted(&smooth, pt.x, pt.y) && (pt.y < H / 2.0 || fill.winding(*pt) == 0)); + assert_eq!(stray.count(), 0, "painted outside the fill or along the top"); + assert!(painted(&smooth, 60.0, 59.5)); +} + +#[test] +fn weights_wider_than_the_box_leave_the_outer_edge() { + let full = rounded_side_strokes(20.0, 10.0, [4.0; 4], 0.0, [6.0; 4], StrokeAlign::Inside); + assert!((area(&full) - area(&rounded_rect(20.0, 10.0, [4.0; 4], 0.0))).abs() < 1e-6); +} + +#[test] +fn no_weight_paints_nothing() { + assert!(rounded_side_strokes(W, H, [8.0; 4], 0.0, [0.0; 4], StrokeAlign::Inside).elements().is_empty()); + let junk = [f64::NAN, -4.0, f64::INFINITY, 0.0]; + assert!(rounded_side_strokes(W, H, [8.0; 4], 0.0, junk, StrokeAlign::Inside).elements().is_empty()); +} diff --git a/crates/render/src/draw.rs b/crates/render/src/draw.rs index 63b382202..3718df26a 100644 --- a/crates/render/src/draw.rs +++ b/crates/render/src/draw.rs @@ -162,9 +162,13 @@ pub fn stroke_area(n: &Node, path: &BezPath, closed: bool) -> Arc { // Per-side strokes on rectangles/frames. if let Some(sides) = props.sides && matches!(n.kind, NodeKind::Rectangle | NodeKind::Frame | NodeKind::Component { .. } | NodeKind::Instance { .. }) - && n.corners.uniform() == Some(0.0) { - return Arc::new(figcraft_pathops::rect_side_strokes(n.width, n.height, sides, props.align)); + let c = &n.corners; + return Arc::new(if c.uniform() == Some(0.0) { + figcraft_pathops::rect_side_strokes(n.width, n.height, sides, props.align) + } else { + figcraft_pathops::rounded_side_strokes(n.width, n.height, c.radii, c.smoothing, sides, props.align) + }); } // Rect/ellipse inside/outside strokes without booleans: an even-odd ring of two outlines. if props.dashes.is_empty() && props.profile().is_none() && props.brush.is_none() && closed && props.align != StrokeAlign::Center { diff --git a/crates/render/src/tests.rs b/crates/render/src/tests.rs index 554881536..a5a598316 100644 --- a/crates/render/src/tests.rs +++ b/crates/render/src/tests.rs @@ -129,6 +129,27 @@ fn strokes_align() { assert_eq!(px(&pix, 30, 8)[0], 0xF5); } +#[test] +fn side_strokes_follow_rounded_corners() { + // border-l-4 rounded-r-lg: a straight 4 px bar on the left, nothing on the other edges. + let mut d = figcraft_doc::Document::new("t"); + let p = d.first_page().unwrap(); + let f = d.create(p, NodeKind::Frame, "F", 10.0, 10.0, 120.0, 60.0).unwrap(); + let n = d.get_mut(f).unwrap(); + n.fills = vec![Paint::solid(Color::WHITE)]; + n.corners.radii = [0.0, 8.0, 8.0, 0.0]; + n.strokes = vec![Paint::solid(Color::BLACK)]; + n.stroke.align = StrokeAlign::Inside; + n.stroke.sides = Some([0.0, 0.0, 0.0, 4.0]); + let pix = render_view(&d, p, &view(150, 80), &Options::default()).unwrap(); + for x in 10..14 { + assert_eq!(px(&pix, x, 40), [0, 0, 0, 255], "x {x}"); + } + for (x, y) in [(14, 40), (129, 40), (126, 12), (126, 67), (70, 10), (70, 69)] { + assert_eq!(px(&pix, x, y), [255, 255, 255, 255], "({x}, {y})"); + } +} + #[test] fn mask_clips_siblings() { let mut d = figcraft_doc::Document::new("t"); diff --git a/crates/svg/src/tests.rs b/crates/svg/src/tests.rs index 8dece77f4..fa8877c16 100644 --- a/crates/svg/src/tests.rs +++ b/crates/svg/src/tests.rs @@ -135,6 +135,26 @@ fn title_case_does_not_restart_words_across_fill_runs_in_live_text() { assert!(svg.contains(">He") && svg.contains(">l") && svg.contains(">lo"), "{svg}"); } +#[test] +fn side_strokes_on_rounded_corners_export_as_their_area() { + // border-l-4 rounded-r-lg: the stroke path is the 4 px bar (60 px tall), drawn even-odd. + use figcraft_geom::Shape; + let mut d = Document::new("t"); + let p = d.first_page().unwrap(); + let f = d.create(p, NodeKind::Frame, "F", 0.0, 0.0, 120.0, 60.0).unwrap(); + let n = d.get_mut(f).unwrap(); + n.corners.radii = [0.0, 8.0, 8.0, 0.0]; + n.strokes = vec![Paint::solid(Color::from_hex("FF0000").unwrap())]; + n.stroke.align = figcraft_doc::StrokeAlign::Inside; + n.stroke.sides = Some([0.0, 0.0, 0.0, 4.0]); + let svg = export_svg(&d, &[f], &SvgOptions::default()).unwrap(); + let stroke = svg.split(" Date: Thu, 22 Oct 2026 10:12:37 +0200 Subject: [PATCH 523/817] M3: a swapped nested instance keeps its outer main's overrides A Button main's override on its icon instance's glyph (a red fill) was lost when an instance swapped the icon: the outer rebuild re-copies the glyph from the main's layer with no overrides of its own, so the nested rebuild matched it by name and carried nothing. Before that rebuild, each old layer of the swapped instance now takes the overrides held along the source chain it had before this rebuild, through layers inside instances in the mains that place the swapped instance. Geometry, slot content and groups the layer overrides itself are left out. Matched by name, the values carry onto the new main's layer as the instance's own: inherited at the swap, frozen after, and back to the icon main's value on reset. An icon main's own overrides stay with it. --- crates/engine/src/components.rs | 72 ++++++++- crates/engine/src/nested_override_tests.rs | 176 +++++++++++++++++++++ docs/mcp.md | 4 +- 3 files changed, 249 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/components.rs b/crates/engine/src/components.rs index 67259d030..a91b81295 100644 --- a/crates/engine/src/components.rs +++ b/crates/engine/src/components.rs @@ -830,9 +830,10 @@ fn sync_instance_depth(doc: &mut Document, inst: NodeId, depth: usize, spare: BT } // Nested instances showing another main than the main's copy (swapped): rebuild from it, // with the old layers below them this rebuild didn't reuse. - let unused: BTreeMap> = old.into_iter().filter(|(i, _)| !used.contains(i) && !doc.contains(*i)).collect(); + let unused: BTreeMap> = + old.iter().filter(|(i, _)| !used.contains(*i) && !doc.contains(**i)).map(|(i, x)| (*i, x.clone())).collect(); for n in nested { - let below: BTreeMap> = unused + let mut below: BTreeMap> = unused .iter() .filter(|(_, x)| { let mut cur = x.parent; @@ -847,10 +848,77 @@ fn sync_instance_depth(doc: &mut Document, inst: NodeId, depth: usize, spare: BT }) .map(|(i, x)| (*i, x.clone())) .collect(); + take_placing_overrides(doc, n, &old, &mut below); sync_instance_depth(doc, n, depth + 1, below); } } +/// Before swapped nested instance `n` is rebuilt from its new main: each of its old layers (the +/// copies just made of the outer main's, and `below`) takes the overrides held along the source +/// chain it had before this rebuild (`before`), through layers inside instances in the mains that +/// place `n`. Matched by name, they carry onto the new main's layers as the instance's own, so a +/// swap takes what the outer main set once: later rebuilds find layers mirroring the new main. +/// Geometry and slot content follow the new main; groups the layer overrides itself keep its value. +fn take_placing_overrides( + doc: &mut Document, + n: NodeId, + before: &BTreeMap>, + below: &mut BTreeMap>, +) { + let placing = placing_mains(doc, n); + for id in doc.subtree(n).into_iter().filter(|i| *i != n) { + let held = before.get(&id).map(|b| held_along(doc, b, &placing)).unwrap_or_default(); + if let Some(layer) = doc.node_mut(id) { + take(layer, &held); + } + } + for layer in below.values_mut() { + let held = held_along(doc, layer, &placing); + if !held.is_empty() { + take(std::sync::Arc::make_mut(layer), &held); + } + } +} + +/// The mains placing nested instance `n`: those of the layers it mirrors, outward. +fn placing_mains(doc: &Document, n: NodeId) -> BTreeSet { + let mut out = BTreeSet::new(); + let mut cur = doc.node(n).and_then(|x| x.source); + for _ in 0..=MAX_DEPTH { + let Some(s) = cur.and_then(|c| doc.node(c)).filter(|s| !matches!(s.kind, NodeKind::Component { .. })) else { break }; + out.extend(owning_component(doc, s.id)); + cur = s.source; + } + out +} + +/// The overrides but geometry and slot content held along `layer`'s source chain while it runs +/// through layers inside instances in `placing` mains, each with the nearest layer holding it. +fn held_along(doc: &Document, layer: &Node, placing: &BTreeSet) -> BTreeMap> { + let mut out = BTreeMap::new(); + let mut cur = layer.source; + for _ in 0..=MAX_DEPTH { + let Some(s) = cur.and_then(|c| doc.node_arc(c)) else { break }; + if !inside_instance(doc, s.id) || !owning_component(doc, s.id).is_some_and(|m| placing.contains(&m)) { + break; + } + for g in s.overrides.iter().filter(|g| !matches!(g.as_str(), "size" | "position" | SLOT)) { + out.entry(g.clone()).or_insert_with(|| s.clone()); + } + cur = s.source; + } + out +} + +/// Give `layer` the `held` groups it has no override of its own for. +fn take(layer: &mut Node, held: &BTreeMap>) { + for (g, from) in held { + if layer.overrides.insert(g.clone()) { + copy_group(from, layer, g); + } + } +} + /// Whether main components `a` and `b` are two variants of one set. fn sibling_variants(doc: &Document, a: NodeId, b: NodeId) -> bool { a != b && variant_set(doc, a).is_some_and(|s| variant_set(doc, b) == Some(s)) diff --git a/crates/engine/src/nested_override_tests.rs b/crates/engine/src/nested_override_tests.rs index f684a693b..0d61edf7e 100644 --- a/crates/engine/src/nested_override_tests.rs +++ b/crates/engine/src/nested_override_tests.rs @@ -198,3 +198,179 @@ fn copied_instances_keep_their_overrides() { assert!(node(&s, t).source.is_none() && node(&s, t).overrides.is_empty()); healthy(&s); } + +/// `button()` with the main's copy of the icon's Shape filled red, and an instance-swap property +/// `Icon` on the nested icon: (icon, shape, button, nested). +fn button_with_icon_override(s: &mut Session) -> (NodeId, NodeId, NodeId, NodeId) { + let (icon_main, shape, button, nested) = button(s); + let main_shape = copy_of(s, nested, shape); + ex(s, "node.set", json!({"id": main_shape, "props": {"fill": "#ff0000"}})); + ex(s, "component.addProperty", json!({"id": button, "name": "Icon", "type": "instanceSwap", "default": icon_main, "layer": nested})); + (icon_main, shape, button, nested) +} + +/// Swap instance `i`'s icon to `to` by its instance-swap property `Icon`. +fn swap_icon(s: &mut Session, i: NodeId, to: NodeId) { + ex(s, "instance.setProperties", json!({"ids": [i], "properties": {"Icon": to}})); + healthy(s); +} + +#[test] +fn a_main_override_carries_onto_a_swapped_nested_instance() { + // Documented: overrides survive a swap when layer names match, and a swapped icon takes the + // colour the main component set (forum thread with staff replies). Rows: by the instance-swap + // property and by instance.swap, onto a matching and an unmatched name. The main's size + // override is geometry and stays out; the instance's own override wins over the main's. + let mut s = Session::new(); + let (_icon, shape, button, nested) = button_with_icon_override(&mut s); + let main_shape = copy_of(&s, nested, shape); + ex(&mut s, "node.set", json!({"id": main_shape, "props": {"width": 10}})); + let other = icon(&mut s, 200.0, "Other", "Shape"); + let unmatched = icon(&mut s, 300.0, "Unmatched", "Glyph"); + for (by_property, to, want) in [(true, other, "FF0000"), (false, other, "FF0000"), (true, unmatched, "111111"), (false, unmatched, "111111")] { + let i = idv(&ex(&mut s, "instance.create", json!({"component": button, "x": 300, "y": 400}))); + if by_property { + swap_icon(&mut s, i, to); + } else { + let inested = copy_of(&s, i, nested); + ex(&mut s, "instance.swap", json!({"ids": [inested], "component": to})); + healthy(&s); + } + let glyph = kids(&s, copy_of(&s, i, nested))[0]; + assert_eq!(fill(&s, glyph), want, "by property {by_property}, to {to}"); + assert_eq!(node(&s, glyph).width, 20.0, "the main's size override stays out"); + } + let i = idv(&ex(&mut s, "instance.create", json!({"component": button, "x": 300, "y": 600}))); + let glyph = kids(&s, copy_of(&s, i, nested))[0]; + ex(&mut s, "node.set", json!({"id": glyph, "props": {"fill": "#0000ff"}})); + swap_icon(&mut s, i, other); + assert_eq!(fill(&s, kids(&s, copy_of(&s, i, nested))[0]), "0000FF", "the instance's own override wins"); +} + +#[test] +fn a_main_override_carries_onto_a_swap_one_level_deeper() { + // As above for a Button instance inside a Toolbar main, swapped in a Toolbar instance. + let mut s = Session::new(); + let (_icon, _shape, button, nested) = button_with_icon_override(&mut s); + let other = icon(&mut s, 200.0, "Other", "Shape"); + let bar = idv(&ex(&mut s, "frame.create", json!({"x": 0, "y": 600, "width": 300, "height": 60, "name": "Toolbar"}))); + let inner = idv(&ex(&mut s, "instance.create", json!({"component": button, "x": 10, "y": 10, "parent": bar}))); + let toolbar = idv(&ex(&mut s, "component.create", json!({"ids": [bar]}))); + let t = idv(&ex(&mut s, "instance.create", json!({"component": toolbar, "x": 0, "y": 800}))); + let icon_in_t = copy_of(&s, t, copy_of(&s, inner, nested)); + ex(&mut s, "instance.swap", json!({"ids": [icon_in_t], "component": other})); + healthy(&s); + assert_eq!(fill(&s, kids(&s, icon_in_t)[0]), "FF0000"); +} + +#[test] +fn a_swapped_nested_instance_keeps_the_main_override_it_took() { + // Documented (staff reply): later edits of the main's icon colour don't reach instances that + // swapped, and do reach the rest. Undo and redo follow; resetting the override shows the icon + // main's own fill. + let mut s = Session::new(); + let (_icon, shape, button, nested) = button_with_icon_override(&mut s); + let other = icon(&mut s, 200.0, "Other", "Shape"); + let swapped = idv(&ex(&mut s, "instance.create", json!({"component": button, "x": 300, "y": 400}))); + let kept = idv(&ex(&mut s, "instance.create", json!({"component": button, "x": 300, "y": 500}))); + swap_icon(&mut s, swapped, other); + let glyph = |s: &Session, i: NodeId| fill(s, kids(s, copy_of(s, i, nested))[0]); + let main_shape = copy_of(&s, nested, shape); + ex(&mut s, "node.set", json!({"id": main_shape, "props": {"fill": "#00ff00"}})); + healthy(&s); + assert_eq!((glyph(&s, swapped), glyph(&s, kept)), ("FF0000".into(), "00FF00".into())); + s.undo().unwrap(); + assert_eq!((glyph(&s, swapped), glyph(&s, kept)), ("FF0000".into(), "FF0000".into())); + s.redo().unwrap(); + assert_eq!((glyph(&s, swapped), glyph(&s, kept)), ("FF0000".into(), "00FF00".into())); + let swapped_glyph = kids(&s, copy_of(&s, swapped, nested))[0]; + ex(&mut s, "component.resetOverride", json!({"id": swapped_glyph, "group": "fills"})); + healthy(&s); + assert_eq!(glyph(&s, swapped), "111111"); +} + +#[test] +fn a_swapped_in_icon_keeps_its_own_overrides_to_itself() { + // Docs silent; pinned: what an icon main overrides inside itself stays that main's. After a + // swap to it, its edits still reach the instance; a second swap doesn't carry them on. + let mut s = Session::new(); + let (_icon, _shape, button, nested) = button_with_icon_override(&mut s); + let dot = icon(&mut s, 200.0, "Dot", "Shape"); + let with_dot = |s: &mut Session, x: f64, name: &str, fill: Option<&str>| { + let f = idv(&ex(s, "frame.create", json!({"x": x, "y": 300, "width": 24, "height": 24, "name": name}))); + let d = idv(&ex(s, "instance.create", json!({"component": dot, "x": 0, "y": 0, "parent": f}))); + if let Some(c) = fill { + let shape = kids(s, d)[0]; + ex(s, "node.set", json!({"id": shape, "props": {"fill": c}})); + } + (idv(&ex(s, "component.create", json!({"ids": [f]}))), d) + }; + let (other2, dot2) = with_dot(&mut s, 300.0, "Other2", Some("#0000ff")); + let (other3, _) = with_dot(&mut s, 400.0, "Other3", None); + let i = idv(&ex(&mut s, "instance.create", json!({"component": button, "x": 300, "y": 400}))); + swap_icon(&mut s, i, other2); + let shape_in = |s: &Session| kids(s, kids(s, copy_of(s, i, nested))[0])[0]; + assert_eq!(fill(&s, shape_in(&s)), "0000FF"); + let shape2 = kids(&s, dot2)[0]; + ex(&mut s, "node.set", json!({"id": shape2, "props": {"fill": "#00ffff"}})); + healthy(&s); + assert_eq!(fill(&s, shape_in(&s)), "00FFFF", "Other2's own edit reaches it"); + swap_icon(&mut s, i, other3); + assert_eq!(fill(&s, shape_in(&s)), "111111", "Other2's override doesn't carry onto Other3"); +} + +#[test] +fn a_swapped_out_icons_own_overrides_stay_with_it() { + // Docs silent; pinned: what the Button's default icon main overrides inside itself isn't the + // Button main's to carry. Icon A colours its Base's Shape green; swapping to icon B, also built + // on Base, shows Base's own fill. + let mut s = Session::new(); + let base = icon(&mut s, 0.0, "Base", "Shape"); + let on_base = |s: &mut Session, x: f64, name: &str| { + let f = idv(&ex(s, "frame.create", json!({"x": x, "y": 500, "width": 24, "height": 24, "name": name}))); + let b = idv(&ex(s, "instance.create", json!({"component": base, "x": 0, "y": 0, "parent": f}))); + (idv(&ex(s, "component.create", json!({"ids": [f]}))), b) + }; + let (a, a_base) = on_base(&mut s, 100.0, "A"); + let (b, _) = on_base(&mut s, 200.0, "B"); + let a_shape = kids(&s, a_base)[0]; + ex(&mut s, "node.set", json!({"id": a_shape, "props": {"fill": "#00ff00"}})); + let f = idv(&ex(&mut s, "frame.create", json!({"x": 0, "y": 700, "width": 40, "height": 40, "name": "Button"}))); + let nested = idv(&ex(&mut s, "instance.create", json!({"component": a, "x": 4, "y": 4, "parent": f}))); + let button = idv(&ex(&mut s, "component.create", json!({"ids": [f]}))); + ex(&mut s, "component.addProperty", json!({"id": button, "name": "Icon", "type": "instanceSwap", "default": a, "layer": nested})); + let i = idv(&ex(&mut s, "instance.create", json!({"component": button, "x": 0, "y": 800}))); + swap_icon(&mut s, i, b); + let shape = kids(&s, kids(&s, copy_of(&s, i, nested))[0])[0]; + assert_eq!(fill(&s, shape), "111111"); + assert!(node(&s, shape).overrides.is_empty()); +} + +#[test] +fn a_slot_the_main_filled_shows_the_swapped_in_mains_content() { + // Docs silent on slot content across a swap; pinned: a Chip the Panel main put in its card's + // slot doesn't carry onto the swapped-in card, which shows its own default content. + let mut s = Session::new(); + let card = |s: &mut Session, x: f64, name: &str| { + let f = idv(&ex(s, "frame.create", json!({"x": x, "y": 0, "width": 100, "height": 60, "name": name}))); + let content = idv(&ex(s, "frame.create", json!({"x": 0, "y": 0, "width": 100, "height": 60, "parent": f, "name": "Content"}))); + ex(s, "shape.rectangle", json!({"x": 0, "y": 0, "width": 40, "height": 20, "parent": content, "props": {"name": format!("{name} default")}})); + let c = idv(&ex(s, "component.create", json!({"ids": [f]}))); + ex(s, "component.makeSlot", json!({"id": content})); + c + }; + let (a, b) = (card(&mut s, 0.0, "A"), card(&mut s, 200.0, "B")); + let chip = icon(&mut s, 400.0, "Chip", "Dot"); + let f = idv(&ex(&mut s, "frame.create", json!({"x": 0, "y": 400, "width": 200, "height": 100, "name": "Panel"}))); + let nested = idv(&ex(&mut s, "instance.create", json!({"component": a, "x": 0, "y": 0, "parent": f}))); + let panel = idv(&ex(&mut s, "component.create", json!({"ids": [f]}))); + ex(&mut s, "instance.slotInsert", json!({"id": nested, "slot": "Content", "component": chip, "replace": true})); + ex(&mut s, "component.addProperty", json!({"id": panel, "name": "Card", "type": "instanceSwap", "default": a, "layer": nested})); + let i = idv(&ex(&mut s, "instance.create", json!({"component": panel, "x": 0, "y": 700}))); + ex(&mut s, "instance.setProperties", json!({"ids": [i], "properties": {"Card": b}})); + healthy(&s); + let content = kids(&s, copy_of(&s, i, nested))[0]; + let names: Vec = kids(&s, content).into_iter().map(|k| node(&s, k).name.clone()).collect(); + assert_eq!(names, ["B default"]); + assert!(!node(&s, content).overrides.contains(SLOT)); +} diff --git a/docs/mcp.md b/docs/mcp.md index dfea95cc2..485bfe48e 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -720,7 +720,9 @@ most when it can't be reached). - `instance.swap {ids?, component}` shows another component in the instances (overrides on layers with matching names stay; property values with the same names too). Nested instances can be - swapped on their own (an override of the instance they're in). + swapped on their own (an override of the instance they're in); a swapped nested instance keeps + what its outer main overrode on matching layers as its own, so later edits of those in the main + don't reach it. - `instance.swapAt {component, x, y}` swaps the instance at a page point: of the instances under it (innermost first), the first showing a variant of the same component set, else the innermost (never one inside the dropped component); only text layers keep their overrides. The Assets From 73a8bb83d67df3505a1e97eabcea0d71b8e3ce0d Mon Sep 17 00:00:00 2001 From: AganzeFelicite Date: Thu, 22 Oct 2026 12:24:24 +0200 Subject: [PATCH 524/817] M7: test Type settings' width through the whole app in Georgian and French (#1029) --- .../tests/type_settings_long_labels.rs | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 crates/ui-egui/tests/type_settings_long_labels.rs diff --git a/crates/ui-egui/tests/type_settings_long_labels.rs b/crates/ui-egui/tests/type_settings_long_labels.rs new file mode 100644 index 000000000..8410e3cfb --- /dev/null +++ b/crates/ui-egui/tests/type_settings_long_labels.rs @@ -0,0 +1,44 @@ +//! #1029, through the whole app: in a language whose labels run past Type settings' label column, +//! the popover keeps its width while it stays open. French does with Inter (release builds, the +//! report); Georgian does with egui's own fonts too (CI, which builds without craft-fonts). Its own +//! test binary, since the UI language is one setting for the whole process. +#![allow(clippy::unwrap_used)] + +use egui::{Id, Popup, Pos2, RawInput, Rect, vec2}; +use figcraft_engine::Session; +use figcraft_ui_egui::{FigApp, NoServices}; +use serde_json::json; + +/// The Type settings popover's width over the frames it is open, the UI in `language`. +fn widths(language: &str) -> Vec { + let mut s = Session::new(); + s.execute("pref.language", &json!({"language": language})).unwrap(); + // Truncating text also shows Max lines. + let text = s.execute("text.create", &json!({"text": "Type", "props": {"textAutoResize": "truncate"}})).unwrap()["id"].clone(); + s.execute("select.set", &json!({"ids": [text]})).unwrap(); + let ctx = egui::Context::default(); + let mut app = FigApp::new(s, Box::new(NoServices)); + let open = Id::new("ty_settings_open"); + let mut widths = Vec::new(); + for i in 0..40 { + if i == 3 { + Popup::open_id(&ctx, open); + } + let raw = + RawInput { screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(1440.0, 900.0))), time: Some(i as f64 / 60.0), ..Default::default() }; + ctx.run_ui(raw, |ui| app.ui(ui)).textures_delta.clear(); + widths.extend(ctx.memory(|m| m.area_rect(open)).map(|r| r.width())); + } + widths +} + +#[test] +fn type_settings_keeps_its_width_with_labels_longer_than_their_column() { + for language in ["ka", "fr"] { + let w = widths(language); + assert!(w.len() > 30, "{language}: Type settings is open ({} frames)", w.len()); + assert_ne!(figcraft_ui_egui::i18n::tr("Paragraph indent"), "Paragraph indent", "{language} is shown"); + let (first, last) = (w[1], w[w.len() - 1]); + assert!((last - first).abs() < 0.01, "{language}: Type settings widens every frame: {first} → {last}"); + } +} From ce8a224c9e7c5bd7725abec202c707903e42cb76 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Thu, 22 Oct 2026 17:57:45 +0700 Subject: [PATCH 525/817] README: the app icon above the title --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 63bc739bf..ebbf7fa03 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,10 @@

+

+ FigCraft icon: an engraved chameleon on a mint-green tile +

+

FigCraft

From 785dc437fada6c3ebe127f7a8e31109543764360 Mon Sep 17 00:00:00 2001 From: Nicek Date: Thu, 22 Oct 2026 19:11:39 +0800 Subject: [PATCH 526/817] =?UTF-8?q?fix(vectoredit):=20=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E7=BB=93=E6=9D=9F=E6=97=B6=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E6=97=A0=E4=BB=BB=E4=BD=95=E7=BA=BF=E6=AE=B5=E7=9A=84=E7=A9=BA?= =?UTF-8?q?=E5=9B=BE=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增空图层检测函数,在结束矢量编辑模式时自动删除没有任何线段的图层,避免留下空图层或空框。同时更新相关测试用例和文档,确保该行为符合预期。 --- crates/engine/src/vectoredit.rs | 19 +++++++++++++++ crates/engine/src/vectoredit/tests.rs | 35 +++++++++++++++++++++++++++ docs/ui-parity.md | 3 ++- 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/vectoredit.rs b/crates/engine/src/vectoredit.rs index a3fbf803b..22755c4d3 100644 --- a/crates/engine/src/vectoredit.rs +++ b/crates/engine/src/vectoredit.rs @@ -539,9 +539,28 @@ pub fn begin_many(s: &mut Session, ids: &[NodeId]) -> Result<()> { /// At most this many layers are edited at once. const MAX_EDITED: usize = 500; +/// The edited layers left without a single segment: they draw nothing (isolated points included), +/// so their layer would only leave an empty box behind. +fn empty_layers(doc: &Document, ids: &[NodeId]) -> Vec { + ids.iter().copied().filter(|id| network(doc, *id).is_some_and(|n| n.segments.is_empty())).collect() +} + +/// Leave edit mode. Layers whose every point was deleted go with it (the undo step that deleted +/// the last points brings them back). pub fn end(s: &mut Session) -> Result<()> { + let empty = { + let ds = s.ds()?; + ds.vector_edit.as_ref().map(|ve| empty_layers(&ds.doc, &ve.parts().iter().map(|p| p.id).collect::>())).unwrap_or_default() + }; + if !empty.is_empty() { + let doc = s.doc_mut()?; + for id in &empty { + let _ = doc.remove(*id); + } + } let ds = s.ds_mut()?; ds.vector_edit = None; + ds.selection.retain(|id| !empty.contains(id)); ds.revision += 1; s.tool.overlay = Default::default(); Ok(()) diff --git a/crates/engine/src/vectoredit/tests.rs b/crates/engine/src/vectoredit/tests.rs index ff3c4cfa2..07ebd56f7 100644 --- a/crates/engine/src/vectoredit/tests.rs +++ b/crates/engine/src/vectoredit/tests.rs @@ -310,6 +310,41 @@ fn a_point_dropped_on_another_merges_into_it() { assert_eq!((n.vertices.len(), n.segments.len()), (2, 1), "still a line: {n:?}"); } +#[test] +fn deleting_every_point_takes_the_layer_with_the_edit_mode() { + // Delete: no point is left at all. + let mut s = Session::new(); + let id = rect(&mut s); + ex(&mut s, "vector.edit.selectAll", json!({})); + ex(&mut s, "vector.edit.delete", json!({})); + assert!(net(&s, id).vertices.is_empty() && net(&s, id).segments.is_empty(), "no point left"); + assert!(s.doc().unwrap().node(id).is_some(), "the layer stays while editing"); + ex(&mut s, "vector.edit.end", json!({})); + assert!(s.doc().unwrap().node(id).is_none(), "it goes with edit mode instead of leaving an empty box"); + assert!(s.selection().is_empty()); + // The step that deleted the last points brings the shape back. + s.undo().unwrap(); + assert_eq!(net(&s, id).vertices.len(), 4); + // Shift+Delete (heal): the last point is left on its own with no segment, drawing nothing either. + let mut s = Session::new(); + let id = rect(&mut s); + ex(&mut s, "vector.edit.selectAll", json!({})); + ex(&mut s, "vector.deleteHeal", json!({})); + assert!(net(&s, id).segments.is_empty(), "nothing draws: {:?}", net(&s, id)); + ex(&mut s, "vector.edit.end", json!({})); + assert!(s.doc().unwrap().node(id).is_none(), "an unconnected point left behind doesn't keep the layer"); + // Escape ends edit mode the same way, for every layer edited along that is left empty. + let mut s = Session::new(); + let a = crate::params::id_of(&ex(&mut s, "shape.rectangle", json!({"x": 0, "y": 0, "width": 100, "height": 100}))["id"]).unwrap(); + let b = crate::params::id_of(&ex(&mut s, "shape.rectangle", json!({"x": 200, "y": 0, "width": 50, "height": 50}))["id"]).unwrap(); + ex(&mut s, "vector.edit.begin", json!({"ids": [a, b]})); + ex(&mut s, "vector.edit.selectAll", json!({})); + ex(&mut s, "vector.edit.delete", json!({})); + s.escape().unwrap(); + assert!(s.ds().unwrap().vector_edit.is_none()); + assert!(s.doc().unwrap().node(a).is_none() && s.doc().unwrap().node(b).is_none()); +} + #[test] fn undo_back_past_the_conversion_leaves_edit_mode() { let mut s = Session::new(); diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 5421cd68a..e2e2318a7 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -82,7 +82,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 or Enter 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`) | -| 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); 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 click on empty canvas only clears the points and starts a marquee (edit mode stays; a double-click or Escape leaves it), while a click on another layer leaves it and selects that layer. The box around several selected points draws its outline and size only, without corner squares (they would read as points); a press on any selected point, corners included, drags them all freely, while its corners and edges clear of points still scale by drag. Not yet: the transform box around points of several layers; 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); 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; a layer left with no point at all goes when edit mode ends (no empty layer or box behind); 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 click on empty canvas only clears the points and starts a marquee (edit mode stays; a double-click or Escape leaves it), while a click on another layer leaves it and selects that layer. The box around several selected points draws its outline and size only, without corner squares (they would read as points); a press on any selected point, corners included, drags them all freely, while its corners and edges clear of points still scale by drag. Not yet: the transform box around points of several layers; 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 | | | Text: point, auto height, fixed; caret, words, lines, IME | done | the font picker previews a family on the canvas while hovered (no undo step; Escape restores, #653); 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; 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 | @@ -172,6 +172,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| +| 2026-10-22 | minor | A layer whose every point was deleted goes when edit mode ends (Escape, Enter, a double-click or a click on another layer), instead of staying as an empty layer with the old box; the undo step that deleted the last points brings the shape back (`vectoredit::tests`) | | 2026-10-22 | minor | Vector edit mode stays on a click on empty canvas: with the Move tool it only clears the points and starts a marquee, and a double-click (or Escape) leaves it; a click on another layer still leaves it and selects that layer. A double-click on empty canvas leaves it even straight after the one that entered edit mode (the platform counts those clicks on, so the last one arrives as a triple; on empty canvas a triple means a double here, while triples on the vector keep their own meaning) (`vector_behaviour_tests`, `canvas_double_click_tests`). Checked in the app on Windows with real mouse clicks over the control channel | | 2026-10-20 | minor | Readable disabled and selected text (#890): the dim text colour (disabled buttons, placeholders, hints) is at least 3:1 against panels, fields and selected rows in both themes (it was 2.1:1 in the light theme), a disabled button is grey with that text instead of fading to 40%, and selected text (renaming a page or layer, any text box) takes the theme's readable green on the highlight (1.4:1 in the dark theme before, now 4.2:1 or more); checked with the colour contrast helper (`theme::tests`). Numbers unchanged | | 2026-10-20 | minor | Measuring while nudging (#894): with Alt held over another layer, the arrows nudge the selection (Shift: the big step) and the distances follow every nudge (Alt+arrows used to do nothing); while measuring, the selection's handles and size label hide and both layers keep their outlines (`measure_nudge_tests`). Numbers unchanged | From 0e3876e6d6ce0f81ad71047d681fb62f69ce36f4 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 21 Oct 2026 07:52:34 -0400 Subject: [PATCH 527/817] Use chrono for UTC/calendar conversion instead of hand-rolled copies Replaces the two hand-rolled Howard Hinnant days-from-civil copies with chrono as a workspace dependency: - crates/collab/src/message.rs: utc_date (YYYY-MM-DD HH:MM UTC) - crates/ui-egui/src/home_recents.rs: date (Mon D, YYYY, UTC; keeps the translated month names and trf formatting) Output is unchanged. Neither function had a test, so each gains one pinning the exact strings the old code produced (leap days included). chrono uses only std, so wasm stays safe. AGENTS.md/CLAUDE.md now say time goes through chrono. Follow-up to storytold/cadcraft#1785 --- AGENTS.md | 1 + CLAUDE.md | 1 + Cargo.lock | 11 +++++++++++ Cargo.toml | 2 ++ crates/collab/Cargo.toml | 1 + crates/collab/src/message.rs | 31 +++++++++++++++++------------- crates/ui-egui/Cargo.toml | 1 + crates/ui-egui/src/home_recents.rs | 28 +++++++++++++++++---------- 8 files changed, 53 insertions(+), 23 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 708da805c..51157976a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -81,6 +81,7 @@ code. L6 depends on egui/eframe/rfd/winit. **The UI crate is swappable.** - **The UI is thin**: panels read engine state and act through `app.run(id, params)` / `app.set_props(ids, props)`. Colours come from `theme::Tokens`. +- **Time goes through `chrono`** (workspace dependency). Never hand-roll UTC/calendar conversion (days-to-date algorithms, leap-year math); a crate owns only its output format string. - **Rust only** (no handwritten JS/TS). **Never break wasm** (`cargo xtask wasm`). ### Quality gates (before every commit) diff --git a/CLAUDE.md b/CLAUDE.md index 708da805c..51157976a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -81,6 +81,7 @@ code. L6 depends on egui/eframe/rfd/winit. **The UI crate is swappable.** - **The UI is thin**: panels read engine state and act through `app.run(id, params)` / `app.set_props(ids, props)`. Colours come from `theme::Tokens`. +- **Time goes through `chrono`** (workspace dependency). Never hand-roll UTC/calendar conversion (days-to-date algorithms, leap-year math); a crate owns only its output format string. - **Rust only** (no handwritten JS/TS). **Never break wasm** (`cargo xtask wasm`). ### Quality gates (before every commit) diff --git a/Cargo.lock b/Cargo.lock index 459c83200..d2052d222 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -742,6 +742,15 @@ dependencies = [ "rand_core 0.10.1", ] +[[package]] +name = "chrono" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" +dependencies = [ + "num-traits", +] + [[package]] name = "clipboard-win" version = "5.4.1" @@ -1499,6 +1508,7 @@ name = "figcraft-collab" version = "0.9.0" dependencies = [ "base64 0.22.1", + "chrono", "figcraft-color", "figcraft-doc", "figcraft-geom", @@ -1744,6 +1754,7 @@ name = "figcraft-ui-egui" version = "0.9.0" dependencies = [ "base64 0.22.1", + "chrono", "egui", "egui_extras", "figcraft-color", diff --git a/Cargo.toml b/Cargo.toml index 6cc175465..7bc0b082f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,6 +45,8 @@ serde = { version = "1", features = ["derive", "rc"] } serde_json = { version = "1", features = ["float_roundtrip"] } regex = "1.13" log = "0.4" +# All date/time conversion goes through chrono (no hand-rolled calendar code; AGENTS.md). +chrono = { version = "0.4.45", default-features = false, features = ["std"] } proptest = "1" imbl = { version = "7", features = ["serde"] } postcard = { version = "1", default-features = false, features = ["alloc"] } diff --git a/crates/collab/Cargo.toml b/crates/collab/Cargo.toml index 89a796873..ed85201dc 100644 --- a/crates/collab/Cargo.toml +++ b/crates/collab/Cargo.toml @@ -13,6 +13,7 @@ figcraft-doc = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } thiserror = { workspace = true } +chrono = { workspace = true } imbl = { workspace = true } base64 = { workspace = true } postcard = { workspace = true } diff --git a/crates/collab/src/message.rs b/crates/collab/src/message.rs index d035042b2..71e694616 100644 --- a/crates/collab/src/message.rs +++ b/crates/collab/src/message.rs @@ -699,19 +699,8 @@ pub enum ServerMsg { /// `YYYY-MM-DD HH:MM UTC` for seconds since 1970 (how servers and apps show the times in these /// messages). pub fn utc_date(secs: u64) -> String { - let days = i64::try_from(secs / 86_400).unwrap_or(0); - let (h, m) = ((secs % 86_400) / 3600, (secs % 3600) / 60); - // Days to a civil date (proleptic Gregorian). - let z = days + 719_468; - let era = z.div_euclid(146_097); - let doe = z.rem_euclid(146_097); - let yoe = (doe - doe / 1460 + doe / 36_524 - doe / 146_096) / 365; - let doy = doe - (365 * yoe + yoe / 4 - yoe / 100); - let mp = (5 * doy + 2) / 153; - let d = doy - (153 * mp + 2) / 5 + 1; - let mo = if mp < 10 { mp + 3 } else { mp - 9 }; - let y = yoe + era * 400 + i64::from(mo <= 2); - format!("{y:04}-{mo:02}-{d:02} {h:02}:{m:02} UTC") + let t = i64::try_from(secs).ok().and_then(|s| chrono::DateTime::from_timestamp(s, 0)).unwrap_or_default(); + t.format("%Y-%m-%d %H:%M UTC").to_string() } /// The binary form of `msg`: [`WIRE_VERSION`], then postcard. @@ -752,3 +741,19 @@ pub fn decode_json(text: &str, max_bytes: usize) -> Result< } serde_json::from_str(text).map_err(|e| Error::Decode(e.to_string())) } + +#[cfg(test)] +mod tests { + use super::*; + + /// `utc_date` keeps the exact `YYYY-MM-DD HH:MM UTC` output the hand-rolled civil-from-days + /// code produced (leap days and all). + #[test] + fn utc_date_formats_seconds_since_1970() { + assert_eq!(utc_date(0), "1970-01-01 00:00 UTC"); + assert_eq!(utc_date(1_000_000), "1970-01-12 13:46 UTC"); + assert_eq!(utc_date(951_782_400), "2000-02-29 00:00 UTC"); + assert_eq!(utc_date(1_709_164_800), "2024-02-29 00:00 UTC"); + assert_eq!(utc_date(1_791_208_980), "2026-10-05 14:03 UTC"); + } +} diff --git a/crates/ui-egui/Cargo.toml b/crates/ui-egui/Cargo.toml index 65a3592d8..09cd22263 100644 --- a/crates/ui-egui/Cargo.toml +++ b/crates/ui-egui/Cargo.toml @@ -22,6 +22,7 @@ egui = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } log = { workspace = true } +chrono = { workspace = true } base64 = { workspace = true } image = { workspace = true } egui_extras = { workspace = true } diff --git a/crates/ui-egui/src/home_recents.rs b/crates/ui-egui/src/home_recents.rs index 81d682406..dcfd1aa2b 100644 --- a/crates/ui-egui/src/home_recents.rs +++ b/crates/ui-egui/src/home_recents.rs @@ -10,6 +10,7 @@ use std::collections::HashMap; use std::path::Path; +use chrono::Datelike; use egui::{Align2, Color32, CornerRadius, Id, Key, Rect, Response, Sense, Stroke, StrokeKind, Ui, pos2, vec2}; use figcraft_engine::Prefs; use figcraft_format::thumbnail::{FileKind, Preview}; @@ -202,16 +203,8 @@ const MONTHS: [&str; 12] = [ /// `secs` since 1970 as a date in UTC: "Mar 4, 2026". fn date(secs: u64) -> String { - // Days to a civil date (Howard Hinnant's days_from_civil, inverted). - let z = i64::try_from(secs / 86_400).unwrap_or(0) + 719_468; - let era = z.div_euclid(146_097); - let doe = z.rem_euclid(146_097); - let yoe = (doe - doe / 1460 + doe / 36_524 - doe / 146_096) / 365; - let doy = doe - (365 * yoe + yoe / 4 - yoe / 100); - let mp = (5 * doy + 2) / 153; - let day = doy - (153 * mp + 2) / 5 + 1; - let month = if mp < 10 { mp + 3 } else { mp - 9 }; - let year = yoe + era * 400 + i64::from(month <= 2); + let dt = i64::try_from(secs).ok().and_then(|s| chrono::DateTime::from_timestamp(s, 0)).unwrap_or_default().naive_utc(); + let (year, month, day) = (i64::from(dt.year()), i64::from(dt.month()), i64::from(dt.day())); let name = usize::try_from(month - 1).ok().and_then(|m| MONTHS.get(m)).map_or("", |m| tr(m)); trf("{month} {day}, {year}", &[("month", &name), ("day", &day), ("year", &year)]) } @@ -965,3 +958,18 @@ fn list(ui: &mut Ui, t: &Tokens, recents: &mut Recents, files: &[Shown], now: u6 arrows(ui, recents, files, 0, 1); action } + +#[cfg(test)] +mod tests { + use super::*; + + /// `date` keeps the exact "Mon D, YYYY" (UTC) output the hand-rolled days-from-civil code + /// produced. With no catalog loaded the month and format strings pass through in English. + #[test] + fn date_formats_seconds_since_1970_in_utc() { + assert_eq!(date(0), "Jan 1, 1970"); + assert_eq!(date(951_782_400), "Feb 29, 2000"); + assert_eq!(date(1_709_164_800), "Feb 29, 2024"); + assert_eq!(date(1_741_046_400), "Mar 4, 2025"); + } +} From 630e0dd4034e41058863696a3579ecfe8abf37ae Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 21 Oct 2026 09:11:43 -0400 Subject: [PATCH 528/817] Keep 5-digit years unprefixed in utc_date chrono's %Y writes a '+' before years past 9999, whereas the old hand-rolled {y:04} did not. utc_date now writes the year with {:04} to keep the exact old output. from_timestamp already reads a clock past chrono's range as the epoch rather than panicking. Tests cover the 5-digit-year and out-of-range cases. --- crates/collab/src/message.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/collab/src/message.rs b/crates/collab/src/message.rs index 71e694616..fb14924a4 100644 --- a/crates/collab/src/message.rs +++ b/crates/collab/src/message.rs @@ -697,10 +697,12 @@ pub enum ServerMsg { } /// `YYYY-MM-DD HH:MM UTC` for seconds since 1970 (how servers and apps show the times in these -/// messages). +/// messages). A time past the last date chrono can represent (year 262143) reads as the epoch. pub fn utc_date(secs: u64) -> String { + use chrono::Datelike; let t = i64::try_from(secs).ok().and_then(|s| chrono::DateTime::from_timestamp(s, 0)).unwrap_or_default(); - t.format("%Y-%m-%d %H:%M UTC").to_string() + // `{:04}` rather than `%Y`, which writes a `+` before years past 9999 (the old `{y:04}` did not). + format!("{:04}-{}", t.year(), t.format("%m-%d %H:%M UTC")) } /// The binary form of `msg`: [`WIRE_VERSION`], then postcard. @@ -755,5 +757,9 @@ mod tests { assert_eq!(utc_date(951_782_400), "2000-02-29 00:00 UTC"); assert_eq!(utc_date(1_709_164_800), "2024-02-29 00:00 UTC"); assert_eq!(utc_date(1_791_208_980), "2026-10-05 14:03 UTC"); + // A year past 9999 keeps the plain zero-padded year (no `+`), as the old `{y:04}` did. + assert_eq!(utc_date(253_402_300_800), "10000-01-01 00:00 UTC"); + // Past chrono's range reads as the epoch instead of panicking. + assert_eq!(utc_date(u64::MAX), "1970-01-01 00:00 UTC"); } } From e3169e5a61401d4981ddbd43c10a5cc9a32c2ace Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 21 Oct 2026 17:18:14 -0400 Subject: [PATCH 529/817] collab/ui-egui: keep old UTC output past chrono's year range MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `utc_date` (collab) and `date` (ui-egui) took `u64` seconds, which the old hand-rolled civil-from-days code converted for the whole `u64` range. The chrono rewrite used `from_timestamp(..).unwrap_or_default()`, so any instant past chrono's own year limit (262143) silently became the epoch — changing existing output. `u64::MAX` seconds, for example, used to read `584554051223-11-09 07:00 UTC` / `Nov 9, 584554051223`, not 1970. Fix: add a `utc_parts(days, sod, nanos)` helper per crate that moves the instant into chrono's range by whole 400-year Gregorian cycles (146_097 days), lets chrono do the month/day/time, and restores the real year afterwards. chrono stays the only calendar logic; the cycle count just shifts the year, and every `u64` day count fits in `i64` so the conversion is always exact (no epoch fallback). Split seconds with `u64` arithmetic first to avoid the `i64` seconds overflow near `u64::MAX`, matching the old code. Tests now pin the old output instead of the epoch: - collab utc_date(u64::MAX) == "584554051223-11-09 07:00 UTC" (and utc_date(253_402_300_800) == "10000-01-01 00:00 UTC", already pinned) - ui-egui date(253_402_300_800) == "Jan 1, 10000" date(u64::MAX) == "Nov 9, 584554051223" --- crates/collab/src/message.rs | 43 ++++++++++++++++++++++++------ crates/ui-egui/src/home_recents.rs | 37 ++++++++++++++++++++++--- 2 files changed, 69 insertions(+), 11 deletions(-) diff --git a/crates/collab/src/message.rs b/crates/collab/src/message.rs index fb14924a4..4fda776af 100644 --- a/crates/collab/src/message.rs +++ b/crates/collab/src/message.rs @@ -696,13 +696,38 @@ pub enum ServerMsg { }, } -/// `YYYY-MM-DD HH:MM UTC` for seconds since 1970 (how servers and apps show the times in these -/// messages). A time past the last date chrono can represent (year 262143) reads as the epoch. -pub fn utc_date(secs: u64) -> String { +/// (days since 1970-01-01, seconds-of-day, nanos) → (proleptic Gregorian year, the same wall-clock +/// instant moved into chrono's range by whole 400-year cycles). The calendar repeats every 400 +/// years (146_097 days), so month, day and time of day come from chrono and only the year is +/// carried, which keeps the result exact for any `i64` day count. This is not hand-rolled calendar +/// math: chrono still does the date, the cycle count just shifts the year. +fn utc_parts(days: i64, sod: u32, nanos: u32) -> (i64, chrono::NaiveDateTime) { use chrono::Datelike; - let t = i64::try_from(secs).ok().and_then(|s| chrono::DateTime::from_timestamp(s, 0)).unwrap_or_default(); - // `{:04}` rather than `%Y`, which writes a `+` before years past 9999 (the old `{y:04}` did not). - format!("{:04}-{}", t.year(), t.format("%m-%d %H:%M UTC")) + let (cycles, rest) = (days.div_euclid(146_097), days.rem_euclid(146_097)); + // `rest + 719_163` (1970-01-01 is CE day 719_163) is always a valid CE day, and `sod` < 86_400. + let date = i32::try_from(rest + 719_163).ok().and_then(chrono::NaiveDate::from_num_days_from_ce_opt); + let time = chrono::NaiveTime::from_num_seconds_from_midnight_opt(sod.min(86_399), nanos.min(999_999_999)); + match (date, time) { + (Some(d), Some(t)) => { + let y = i128::from(d.year()) + i128::from(cycles) * 400; + (i64::try_from(y).unwrap_or(if y < 0 { i64::MIN } else { i64::MAX }), d.and_time(t)) + } + _ => (1970, chrono::NaiveDateTime::default()), // unreachable + } +} + +/// `YYYY-MM-DD HH:MM UTC` for seconds since 1970 (how servers and apps show the times in these +/// messages). Years past chrono's own range (262143) keep converting: the instant is moved into +/// range by whole 400-year cycles and the real year restored, so every `u64` reads as the date the +/// old hand-rolled conversion produced (e.g. `u64::MAX` → `584554051223-11-09 07:00 UTC`). +pub fn utc_date(secs: u64) -> String { + // The day count of any `u64` seconds fits in `i64` (`u64::MAX / 86_400` ≈ 2.1e14), and the + // seconds-of-day is < 86_400, so the conversion is always exact (no epoch fallback). Splitting + // with `u64` arithmetic (as the old code did) avoids the `i64` seconds overflow near `u64::MAX`. + let (days, sod) = (i64::try_from(secs / 86_400).unwrap_or(i64::MAX), (secs % 86_400) as u32); + let (y, t) = utc_parts(days, sod, 0); + // `{y:04}` rather than `%Y`, which writes a `+` before years past 9999 (the old code did not). + format!("{y:04}-{}", t.format("%m-%d %H:%M UTC")) } /// The binary form of `msg`: [`WIRE_VERSION`], then postcard. @@ -759,7 +784,9 @@ mod tests { assert_eq!(utc_date(1_791_208_980), "2026-10-05 14:03 UTC"); // A year past 9999 keeps the plain zero-padded year (no `+`), as the old `{y:04}` did. assert_eq!(utc_date(253_402_300_800), "10000-01-01 00:00 UTC"); - // Past chrono's range reads as the epoch instead of panicking. - assert_eq!(utc_date(u64::MAX), "1970-01-01 00:00 UTC"); + // Past chrono's own year range (262143) the instant is moved into range by whole 400-year + // cycles and the real year restored, so it keeps the old hand-rolled output instead of + // falling back to the epoch. + assert_eq!(utc_date(u64::MAX), "584554051223-11-09 07:00 UTC"); } } diff --git a/crates/ui-egui/src/home_recents.rs b/crates/ui-egui/src/home_recents.rs index dcfd1aa2b..ca50d78f6 100644 --- a/crates/ui-egui/src/home_recents.rs +++ b/crates/ui-egui/src/home_recents.rs @@ -201,10 +201,35 @@ const MONTHS: [&str; 12] = [ tr_noop("Dec"), ]; -/// `secs` since 1970 as a date in UTC: "Mar 4, 2026". +/// (days since 1970-01-01, seconds-of-day, nanos) → (proleptic Gregorian year, the same wall-clock +/// instant moved into chrono's range by whole 400-year cycles). The calendar repeats every 400 +/// years (146_097 days), so month, day and time of day come from chrono and only the year is +/// carried, which keeps the result exact for any `i64` day count. This is not hand-rolled calendar +/// math: chrono still does the date, the cycle count just shifts the year. +fn utc_parts(days: i64, sod: u32, nanos: u32) -> (i64, chrono::NaiveDateTime) { + let (cycles, rest) = (days.div_euclid(146_097), days.rem_euclid(146_097)); + // `rest + 719_163` (1970-01-01 is CE day 719_163) is always a valid CE day, and `sod` < 86_400. + let date = i32::try_from(rest + 719_163).ok().and_then(chrono::NaiveDate::from_num_days_from_ce_opt); + let time = chrono::NaiveTime::from_num_seconds_from_midnight_opt(sod.min(86_399), nanos.min(999_999_999)); + match (date, time) { + (Some(d), Some(t)) => { + let y = i128::from(d.year()) + i128::from(cycles) * 400; + (i64::try_from(y).unwrap_or(if y < 0 { i64::MIN } else { i64::MAX }), d.and_time(t)) + } + _ => (1970, chrono::NaiveDateTime::default()), // unreachable + } +} + +/// `secs` since 1970 as a date in UTC: "Mar 4, 2026". Years past chrono's own range (262143) keep +/// converting: the instant is moved into range by whole 400-year cycles and the real year restored, +/// so every `u64` reads as the date the old hand-rolled conversion produced. fn date(secs: u64) -> String { - let dt = i64::try_from(secs).ok().and_then(|s| chrono::DateTime::from_timestamp(s, 0)).unwrap_or_default().naive_utc(); - let (year, month, day) = (i64::from(dt.year()), i64::from(dt.month()), i64::from(dt.day())); + // The day count of any `u64` seconds fits in `i64` (`u64::MAX / 86_400` ≈ 2.1e14), so the + // conversion is always exact (no epoch fallback). Splitting with `u64` arithmetic (as the old + // code did) avoids the `i64` seconds overflow near `u64::MAX`. + let (days, sod) = (i64::try_from(secs / 86_400).unwrap_or(i64::MAX), (secs % 86_400) as u32); + let (year, dt) = utc_parts(days, sod, 0); + let (month, day) = (i64::from(dt.month()), i64::from(dt.day())); let name = usize::try_from(month - 1).ok().and_then(|m| MONTHS.get(m)).map_or("", |m| tr(m)); trf("{month} {day}, {year}", &[("month", &name), ("day", &day), ("year", &year)]) } @@ -971,5 +996,11 @@ mod tests { assert_eq!(date(951_782_400), "Feb 29, 2000"); assert_eq!(date(1_709_164_800), "Feb 29, 2024"); assert_eq!(date(1_741_046_400), "Mar 4, 2025"); + // A year past chrono's own `NaiveDate` range (262143): the instant is moved into range by + // whole 400-year cycles and the real year restored. + assert_eq!(date(253_402_300_800), "Jan 1, 10000"); + // Past chrono's year range, `u64::MAX` keeps the old hand-rolled output instead of falling + // back to the epoch. + assert_eq!(date(u64::MAX), "Nov 9, 584554051223"); } } From a0e937918c0f3923570a68933924ba44f0af6fef Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 21 Oct 2026 18:29:17 -0400 Subject: [PATCH 530/817] Name the 400-year range extension as the one exception to the time rule The rule said never to hand-roll calendar math, but the range fix (shifting by whole 400-year Gregorian cycles so dates past chrono's year range keep their old output) is cycle arithmetic, so the rule and the code disagreed. The rule now names that exception: the library still computes month, day and time, and only whole cycles are carried in the year. --- AGENTS.md | 2 +- CLAUDE.md | 2 +- Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 51157976a..80c55db55 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -81,7 +81,7 @@ code. L6 depends on egui/eframe/rfd/winit. **The UI crate is swappable.** - **The UI is thin**: panels read engine state and act through `app.run(id, params)` / `app.set_props(ids, props)`. Colours come from `theme::Tokens`. -- **Time goes through `chrono`** (workspace dependency). Never hand-roll UTC/calendar conversion (days-to-date algorithms, leap-year math); a crate owns only its output format string. +- **Time goes through `chrono`** (workspace dependency). Never hand-roll UTC/calendar conversion (days-to-date algorithms, leap-year math); a crate owns only its output format string. The one exception is range extension: past the years chrono can represent, shift the date by whole 400-year Gregorian cycles (146,097 days, after which the calendar repeats), let chrono compute the month, day and time, and add the cycles back to the year. - **Rust only** (no handwritten JS/TS). **Never break wasm** (`cargo xtask wasm`). ### Quality gates (before every commit) diff --git a/CLAUDE.md b/CLAUDE.md index 51157976a..80c55db55 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -81,7 +81,7 @@ code. L6 depends on egui/eframe/rfd/winit. **The UI crate is swappable.** - **The UI is thin**: panels read engine state and act through `app.run(id, params)` / `app.set_props(ids, props)`. Colours come from `theme::Tokens`. -- **Time goes through `chrono`** (workspace dependency). Never hand-roll UTC/calendar conversion (days-to-date algorithms, leap-year math); a crate owns only its output format string. +- **Time goes through `chrono`** (workspace dependency). Never hand-roll UTC/calendar conversion (days-to-date algorithms, leap-year math); a crate owns only its output format string. The one exception is range extension: past the years chrono can represent, shift the date by whole 400-year Gregorian cycles (146,097 days, after which the calendar repeats), let chrono compute the month, day and time, and add the cycles back to the year. - **Rust only** (no handwritten JS/TS). **Never break wasm** (`cargo xtask wasm`). ### Quality gates (before every commit) diff --git a/Cargo.toml b/Cargo.toml index 7bc0b082f..b6fb2704f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ serde = { version = "1", features = ["derive", "rc"] } serde_json = { version = "1", features = ["float_roundtrip"] } regex = "1.13" log = "0.4" -# All date/time conversion goes through chrono (no hand-rolled calendar code; AGENTS.md). +# All date/time conversion goes through chrono (no hand-rolled calendar code beyond the 400-year range extension; AGENTS.md). chrono = { version = "0.4.45", default-features = false, features = ["std"] } proptest = "1" imbl = { version = "7", features = ["serde"] } From 9ec80bf2c2b6ad8eb34c2fec374ccab4a8219e0d Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 21 Oct 2026 19:07:03 -0400 Subject: [PATCH 531/817] Say the library computes month and day; time-of-day is plain arithmetic Narrows the range-extension wording: the date library computes the calendar fields, and splitting seconds into hours, minutes and seconds is ordinary arithmetic, which is what the code does. --- AGENTS.md | 2 +- CLAUDE.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 80c55db55..b2384311a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -81,7 +81,7 @@ code. L6 depends on egui/eframe/rfd/winit. **The UI crate is swappable.** - **The UI is thin**: panels read engine state and act through `app.run(id, params)` / `app.set_props(ids, props)`. Colours come from `theme::Tokens`. -- **Time goes through `chrono`** (workspace dependency). Never hand-roll UTC/calendar conversion (days-to-date algorithms, leap-year math); a crate owns only its output format string. The one exception is range extension: past the years chrono can represent, shift the date by whole 400-year Gregorian cycles (146,097 days, after which the calendar repeats), let chrono compute the month, day and time, and add the cycles back to the year. +- **Time goes through `chrono`** (workspace dependency). Never hand-roll UTC/calendar conversion (days-to-date algorithms, leap-year math); a crate owns only its output format string. The one exception is range extension: past the years chrono can represent, shift the date by whole 400-year Gregorian cycles (146,097 days, after which the calendar repeats), let chrono compute the month and day, and add the cycles back to the year (splitting seconds into hours, minutes and seconds is plain arithmetic). - **Rust only** (no handwritten JS/TS). **Never break wasm** (`cargo xtask wasm`). ### Quality gates (before every commit) diff --git a/CLAUDE.md b/CLAUDE.md index 80c55db55..b2384311a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -81,7 +81,7 @@ code. L6 depends on egui/eframe/rfd/winit. **The UI crate is swappable.** - **The UI is thin**: panels read engine state and act through `app.run(id, params)` / `app.set_props(ids, props)`. Colours come from `theme::Tokens`. -- **Time goes through `chrono`** (workspace dependency). Never hand-roll UTC/calendar conversion (days-to-date algorithms, leap-year math); a crate owns only its output format string. The one exception is range extension: past the years chrono can represent, shift the date by whole 400-year Gregorian cycles (146,097 days, after which the calendar repeats), let chrono compute the month, day and time, and add the cycles back to the year. +- **Time goes through `chrono`** (workspace dependency). Never hand-roll UTC/calendar conversion (days-to-date algorithms, leap-year math); a crate owns only its output format string. The one exception is range extension: past the years chrono can represent, shift the date by whole 400-year Gregorian cycles (146,097 days, after which the calendar repeats), let chrono compute the month and day, and add the cycles back to the year (splitting seconds into hours, minutes and seconds is plain arithmetic). - **Rust only** (no handwritten JS/TS). **Never break wasm** (`cargo xtask wasm`). ### Quality gates (before every commit) From 6394e96005ff4dbc8649045a979c32fe1fa4da93 Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Thu, 22 Oct 2026 10:41:53 +0200 Subject: [PATCH 532/817] M3: a variable mode set on a layer inside an instance is an override A variable mode chosen on a layer inside an instance (the icon inside a Close button, recoloured through an icon colour collection) wasn't an override group. A full rebuild of the instance starts each layer over from its main and carries only override groups, so the mode fell back to the main's. Library import always rebuilds, as do main edits such as a new auto layout direction, so a modal's recoloured close icon came into other files in its default colour. "modes" is now an override group: setting a mode inside an instance records it, rebuilds carry it, rebasing a nested instance finds it, the component panel lists it, and resetting it brings back the main's mode. A top-level instance's own modes stay its own and record no override, like its resizing. --- crates/engine/src/cmd/component.rs | 2 +- crates/engine/src/components.rs | 27 ++++++---- .../src/components_rebase_source_tests.rs | 14 ++++++ crates/engine/src/instance_modes_tests.rs | 49 +++++++++++++++++++ crates/engine/src/library_variables_tests.rs | 36 ++++++++++++++ crates/ui-egui/src/component_panel.rs | 1 + 6 files changed, 119 insertions(+), 10 deletions(-) diff --git a/crates/engine/src/cmd/component.rs b/crates/engine/src/cmd/component.rs index 6a5b10124..01914640a 100644 --- a/crates/engine/src/cmd/component.rs +++ b/crates/engine/src/cmd/component.rs @@ -165,7 +165,7 @@ pub fn specs() -> Vec { spec!( "component.resetOverride", "Reset override", - "{id?, group? (fills|strokes|effects|opacity|visible|name|corners|characters|textStyle|padding|gap|alignment|grids|exports|interactions|size|position|component|props|slot; all when omitted)}", + "{id?, group? (fills|strokes|effects|opacity|visible|name|corners|characters|textStyle|padding|gap|alignment|grids|exports|interactions|size|position|modes|component|props|slot; all when omitted)}", true, reset_override ), diff --git a/crates/engine/src/components.rs b/crates/engine/src/components.rs index 67259d030..f011625d7 100644 --- a/crates/engine/src/components.rs +++ b/crates/engine/src/components.rs @@ -12,9 +12,10 @@ //! `characters`, `textStyle` (font, size, spacing, resizing, …), `padding`, `gap` and `alignment` //! (of auto layout: its direction and other settings are the main's), `grids`, `exports`, //! `interactions`, `size` and `resizing` (hug, fill or fixed, with min and max sizes) of layers -//! inside an instance, `component` (a swapped nested instance), `props` (property values of a -//! nested instance) and `slot` (a slot holding the instance's own content). An instance's own -//! export settings, interactions and resizing are its own, like its place. `position` +//! inside an instance, `modes` (the variable modes a layer inside an instance chooses), +//! `component` (a swapped nested instance), `props` (property values of a nested instance) and +//! `slot` (a slot holding the instance's own content). An instance's own export settings, +//! interactions, resizing and variable modes are its own, like its place. `position` //! overrides of layers inside an instance are still read and kept, but new ones are refused //! ([`check_override_edit`]): those layers take their place and constraints from the main. //! @@ -60,6 +61,7 @@ pub const OVERRIDE_GROUPS: &[&str] = &[ "size", "resizing", "position", + "modes", "component", "props", SLOT, @@ -415,6 +417,7 @@ pub(crate) fn copy_group(from: &Node, to: &mut Node, g: &str) { (b.sizing_h, b.sizing_v, b.min_w, b.max_w, b.min_h, b.max_h) = (a.sizing_h, a.sizing_v, a.min_w, a.max_w, a.min_h, a.max_h); } "position" => to.transform = from.transform, + "modes" => to.var_modes = from.var_modes.clone(), "component" => { if let (NodeKind::Instance { component: a, .. }, NodeKind::Instance { component: b, .. }) = (&from.kind, &mut to.kind) { *b = *a; @@ -1049,6 +1052,9 @@ pub fn diff_groups(a: &Node, b: &Node) -> Vec<&'static str> { if a.interactions != b.interactions { out.push("interactions"); } + if a.var_modes != b.var_modes { + out.push("modes"); + } if let (NodeKind::Instance { component: x, props: px }, NodeKind::Instance { component: y, props: py }) = (&a.kind, &b.kind) { if x != y { out.push("component"); @@ -1146,10 +1152,10 @@ pub fn sync_after_edit(doc: &mut Document, before: &Document, changed: &[NodeId] } let raw = diff_groups(b, n); let mut groups = raw.clone(); - // An instance's own place, resizing, export settings and interactions are its own, not - // overrides. + // An instance's own place, resizing, export settings, interactions and variable modes are + // its own, not overrides. if top_root { - groups.retain(|g| !matches!(*g, "component" | "props" | "position" | "resizing" | "exports" | "interactions")); + groups.retain(|g| !matches!(*g, "component" | "props" | "position" | "resizing" | "exports" | "interactions" | "modes")); } if groups.iter().any(|g| matches!(*g, "size" | "position")) { groups.retain(|g| !matches!(*g, "size" | "position") || !geometry_derived(doc, before, id, g)); @@ -1969,7 +1975,7 @@ pub fn rebase_instance(doc: &mut Document, inst: NodeId) { let mut groups: Vec = value_groups(m, n) .into_iter() .filter(|g| !matches!(g.as_str(), "name" | "exports" | "interactions") && !from_variables.contains(&g.as_str())) - .filter(|g| placed_source.is_some() || g != "resizing") + .filter(|g| placed_source.is_some() || !matches!(g.as_str(), "resizing" | "modes")) .collect(); let named = if placed_source.is_some() { n.name != m.name } else { n.name != default_instance_name(doc, component) }; if named { @@ -1993,8 +1999,11 @@ pub fn rebase_instance(doc: &mut Document, inst: NodeId) { } if let Some(n) = doc.node_mut(inst) { n.source = root_base; - // A top-level instance's resizing is its own (a nested one's overrides its main layer's). - n.overrides.retain(|g| !matches!(g.as_str(), "component" | "props" | "position") && (placed_source.is_some() || g != "resizing")); + // A top-level instance's resizing and modes are its own (a nested one's override its main + // layer's). + n.overrides.retain(|g| { + !matches!(g.as_str(), "component" | "props" | "position") && (placed_source.is_some() || !matches!(g.as_str(), "resizing" | "modes")) + }); n.overrides.extend(root_groups); } } diff --git a/crates/engine/src/components_rebase_source_tests.rs b/crates/engine/src/components_rebase_source_tests.rs index b272b82fd..94eae71f8 100644 --- a/crates/engine/src/components_rebase_source_tests.rs +++ b/crates/engine/src/components_rebase_source_tests.rs @@ -201,6 +201,20 @@ fn rebase_detached_nested_uses_own_main_and_keeps_inherited_geometry() { assert_eq!(s.doc.node(s.base).unwrap().transform.translation().x, 2.0); } +#[test] +fn rebase_marks_a_nested_roots_own_mode_but_not_a_top_level_instances() { + let mut s = scene(); + let modes = BTreeMap::from([("Tone".to_string(), "B".to_string())]); + s.doc.node_mut(s.nested).unwrap().var_modes = modes.clone(); + both(&mut s); + assert!(s.doc.node(s.nested).unwrap().overrides.contains("modes"), "its slot in Outer sets no mode"); + let page = s.doc.first_page().unwrap(); + let detached = mirror(&mut s.doc, s.nested, page); + rebase_instance(&mut s.doc, detached); + let n = s.doc.node(detached).unwrap(); + assert_eq!((&n.var_modes, n.overrides.contains("modes")), (&modes, false), "a top-level instance's modes are its own"); +} + #[test] fn rebase_does_not_preserve_existing_foreign_or_stale_sources() { let mut s = scene(); diff --git a/crates/engine/src/instance_modes_tests.rs b/crates/engine/src/instance_modes_tests.rs index 79007622d..0836048f1 100644 --- a/crates/engine/src/instance_modes_tests.rs +++ b/crates/engine/src/instance_modes_tests.rs @@ -126,3 +126,52 @@ fn detaching_keeps_the_mode_it_took_from_its_main() { assert_eq!(fill(&s, i), "0000FF", "the detached frame keeps mode B"); assert_eq!(s.doc().unwrap().node(i).unwrap().var_modes.len(), 1); } + +/// A "Button" holding an instance of a swatch "Icon" on mode A, and a "Modal" holding a Button +/// instance whose icon copy was set to mode B: (the Button main, its icon layer, the copy in Modal). +fn modal(s: &mut Session) -> (NodeId, NodeId, NodeId) { + tone(s); + let icon = swatch(s, "Icon", None); + let frame = id(run(s, "frame.create", json!({"x": 100, "y": 0, "width": 60, "height": 40, "name": "Button"}))); + let button_icon = id(run(s, "instance.create", json!({"component": icon, "x": 10, "y": 10, "parent": frame}))); + set_mode(s, button_icon, json!("A")); + let button = id(run(s, "component.create", json!({"ids": [frame]}))); + let outer = id(run(s, "frame.create", json!({"x": 300, "y": 0, "width": 200, "height": 100, "name": "Modal"}))); + let close = id(run(s, "instance.create", json!({"component": button, "x": 10, "y": 10, "parent": outer}))); + let nested = s.doc().unwrap().node(close).unwrap().children[0]; + set_mode(s, nested, json!("B")); + run(s, "component.create", json!({"ids": [outer]})); + (button, button_icon, nested) +} + +#[test] +fn a_mode_set_on_a_layer_inside_an_instance_is_an_override() { + let mut s = Session::new(); + let (button, button_icon, nested) = modal(&mut s); + assert_eq!(fill(&s, nested), "0000FF"); + // An edit the copies can't take as they are rebuilds the Button instance. + run(&mut s, "node.set", json!({"ids": [button], "layout": "horizontal"})); + assert_eq!(fill(&s, nested), "0000FF", "a rebuild keeps the mode set on the copy"); + // The main's layer choosing another mode doesn't reach it either. + set_mode(&mut s, button_icon, json!("B")); + set_mode(&mut s, button_icon, Value::Null); + assert_eq!(fill(&s, nested), "0000FF"); + run(&mut s, "component.resetOverride", json!({"id": nested, "group": "modes"})); + assert_eq!(fill(&s, nested), "FF0000", "reset: the main's layer is on Auto (mode A)"); + assert!(s.doc().unwrap().node(nested).unwrap().var_modes.is_empty()); +} + +#[test] +fn a_mode_set_on_an_icon_inside_a_placed_instance_survives_main_edits() { + let mut s = Session::new(); + let (button, _, _) = modal(&mut s); + // A Button placed on the page, its icon recoloured through the icon's mode. + let placed = instance(&mut s, button); + let icon = s.doc().unwrap().node(placed).unwrap().children[0]; + set_mode(&mut s, icon, json!("B")); + assert!(s.doc().unwrap().node(icon).unwrap().overrides.contains("modes"), "it shows as an override"); + run(&mut s, "node.set", json!({"ids": [button], "layout": "vertical"})); + assert_eq!(fill(&s, icon), "0000FF", "a rebuild of the Button keeps it"); + run(&mut s, "component.resetInstance", json!({"ids": [placed]})); + assert_eq!(fill(&s, icon), "FF0000", "reset all brings back the main's mode"); +} diff --git a/crates/engine/src/library_variables_tests.rs b/crates/engine/src/library_variables_tests.rs index 4fc778a7d..7104164b3 100644 --- a/crates/engine/src/library_variables_tests.rs +++ b/crates/engine/src/library_variables_tests.rs @@ -344,3 +344,39 @@ fn library_style_bindings_ignore_unrelated_local_variables() { healthy(&s); let _ = std::fs::remove_dir_all(&d); } + +#[test] +fn modes_set_inside_nested_instances_come_along() { + let d = dir("nested-modes"); + let lib_path = path_str(&d.join("kit.figcraft")); + let mut lib = Session::new(); + theme(&mut lib); + let f = idv(&ex(&mut lib, "frame.create", json!({"x": 0, "y": 0, "width": 20, "height": 20, "name": "Icon"}))); + ex(&mut lib, "variable.bind", json!({"ids": [f], "field": "fill", "variable": "primary"})); + let icon = idv(&ex(&mut lib, "component.create", json!({"ids": [f]}))); + let b = idv(&ex(&mut lib, "frame.create", json!({"x": 100, "y": 0, "width": 60, "height": 40, "name": "Button"}))); + ex(&mut lib, "instance.create", json!({"component": icon, "x": 10, "y": 10, "parent": b})); + let button = idv(&ex(&mut lib, "component.create", json!({"ids": [b]}))); + let m = idv(&ex(&mut lib, "frame.create", json!({"x": 300, "y": 0, "width": 200, "height": 100, "name": "Modal"}))); + let close = idv(&ex(&mut lib, "instance.create", json!({"component": button, "x": 10, "y": 10, "parent": m}))); + let nested = lib.doc().unwrap().node(close).unwrap().children[0]; + ex(&mut lib, "variable.setMode", json!({"ids": [nested], "collection": "Theme", "mode": "Dark"})); + ex(&mut lib, "component.create", json!({"ids": [m]})); + let lid = publish_to(&mut lib, &lib_path); + + let mut s = Session::new(); + ex(&mut s, "library.add", json!({"path": lib_path})); + let inst = idv(&ex(&mut s, "library.place", json!({"library": lid, "component": "Modal", "x": 0, "y": 0}))); + let copy = |s: &Session| { + let doc = s.doc().unwrap(); + doc.node(doc.node(inst).unwrap().children[0]).unwrap().children[0] + }; + assert_eq!(fill(&s, copy(&s)), "FFFFFF", "the Dark mode set on the nested icon comes along"); + // An update that rebuilds the Button copies keeps it too. + ex(&mut lib, "node.set", json!({"ids": [button], "layout": "horizontal"})); + republish(&mut lib); + ex(&mut s, "library.acceptUpdates", json!({})); + assert_eq!(fill(&s, copy(&s)), "FFFFFF"); + healthy(&s); + let _ = std::fs::remove_dir_all(&d); +} diff --git a/crates/ui-egui/src/component_panel.rs b/crates/ui-egui/src/component_panel.rs index 2b2573c78..4db613aba 100644 --- a/crates/ui-egui/src/component_panel.rs +++ b/crates/ui-egui/src/component_panel.rs @@ -521,6 +521,7 @@ fn group_label(g: &str) -> String { "grids" => tr("Layout grids"), "exports" => tr("Export settings"), "interactions" => tr("Interactions"), + "modes" => tr("Variable modes"), "size" => tr("Size"), "resizing" => tr("Resizing"), "position" => tr("Position"), From f1c206509f89c5a4d26c98f2b8219fcc0640d6fd Mon Sep 17 00:00:00 2001 From: MortenHusted Date: Thu, 22 Oct 2026 13:41:51 +0200 Subject: [PATCH 533/817] M3: files from before the modes override keep the modes set inside their instances A file or library saved before "modes" was an override group has a mode chosen on a layer inside an instance without its marker, so the next rebuild or library import still put the main's mode back. Copies follow their main layer's modes when the main changes them, so a layer inside an instance on other modes chose them itself. mark_layer_modes marks those when a file opens and when a published library is read from a file or a server. Layers on their main's modes and top-level instances stay unmarked. --- crates/engine/src/components.rs | 17 ++++++ crates/engine/src/instance_modes_tests.rs | 19 +++++++ crates/engine/src/lib.rs | 1 + crates/engine/src/library.rs | 9 ++- crates/engine/src/library_server.rs | 2 +- crates/engine/src/library_variables_tests.rs | 60 ++++++++++++++------ 6 files changed, 90 insertions(+), 18 deletions(-) diff --git a/crates/engine/src/components.rs b/crates/engine/src/components.rs index f011625d7..c0612bcd6 100644 --- a/crates/engine/src/components.rs +++ b/crates/engine/src/components.rs @@ -116,6 +116,23 @@ pub fn inside_instance(doc: &Document, id: NodeId) -> bool { enclosing_instance(doc, id).is_some() } +/// Mark the `modes` override on layers inside instances whose variable modes differ from their +/// main layer's, for files from before `modes` was an override group. Copies follow their main +/// layer's modes, so a layer on other modes chose them itself. +pub fn mark_layer_modes(doc: &mut Document) { + let chose: Vec = doc + .nodes() + .filter(|n| !n.overrides.contains("modes") && n.source.and_then(|s| doc.node(s)).is_some_and(|m| m.var_modes != n.var_modes)) + .map(|n| n.id) + .filter(|id| inside_instance(doc, *id)) + .collect(); + for id in chose { + if let Some(n) = doc.node_mut(id) { + n.overrides.insert("modes".into()); + } + } +} + /// The slot property frame `id` stands for (its name and preferred components): a frame bound to /// a slot property of its component, or an instance's copy of one (followed through its sources). pub fn slot_def(doc: &Document, id: NodeId) -> Option<(&str, &[NodeId])> { diff --git a/crates/engine/src/instance_modes_tests.rs b/crates/engine/src/instance_modes_tests.rs index 0836048f1..43de3ca47 100644 --- a/crates/engine/src/instance_modes_tests.rs +++ b/crates/engine/src/instance_modes_tests.rs @@ -175,3 +175,22 @@ fn a_mode_set_on_an_icon_inside_a_placed_instance_survives_main_edits() { run(&mut s, "component.resetInstance", json!({"ids": [placed]})); assert_eq!(fill(&s, icon), "FF0000", "reset all brings back the main's mode"); } + +#[test] +fn a_file_from_before_modes_were_overrides_keeps_the_modes_chosen_inside_its_instances() { + let mut s = Session::new(); + let (button, _, nested) = modal(&mut s); + // Saved before `modes` was an override group: the copy has its mode but no marker. + s.doc_mut().unwrap().node_mut(nested).unwrap().overrides.remove("modes"); + let path = std::env::temp_dir().join(format!("figcraft-instance-modes-{}.figcraft", std::process::id())); + let p = path.to_string_lossy().into_owned(); + run(&mut s, "file.saveAs", json!({"path": p})); + let mut s = Session::new(); + run(&mut s, "file.open", json!({"path": p})); + let _ = std::fs::remove_file(&path); + let doc = s.doc().unwrap(); + assert!(doc.node(nested).unwrap().overrides.contains("modes"), "opening it marks the mode the copy chose"); + assert!(doc.nodes().filter(|n| n.id != nested).all(|n| !n.overrides.contains("modes")), "layers on their main's modes stay unmarked"); + run(&mut s, "node.set", json!({"ids": [button], "layout": "horizontal"})); + assert_eq!(fill(&s, nested), "0000FF", "a rebuild keeps it"); +} diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 79e7be0d5..d878d6aba 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -413,6 +413,7 @@ impl DocState { } doc.link_layer_text_styles(); cmd::styles::apply_paint_bindings_on_load(&mut doc); + components::mark_layer_modes(&mut doc); // Initial import settlement belongs to the saved baseline, not the user's first edit. let page = doc.current_page.filter(|p| doc.pages.contains(p)).or_else(|| doc.first_page()).unwrap_or(NodeId(0)); let doc = Arc::new(doc); diff --git a/crates/engine/src/library.rs b/crates/engine/src/library.rs index 268635619..9740182cd 100644 --- a/crates/engine/src/library.rs +++ b/crates/engine/src/library.rs @@ -553,11 +553,18 @@ fn stat(_path: &str) -> std::result::Result { Err(NO_FILES.into()) } +/// A library read from a file or a server, with the modes chosen inside its instances marked when +/// it was published before they were overrides ([`crate::components::mark_layer_modes`]). +pub(crate) fn settled(mut lib: PublishedLibrary) -> PublishedLibrary { + crate::components::mark_layer_modes(Arc::make_mut(&mut lib.doc)); + lib +} + #[cfg(not(target_arch = "wasm32"))] fn read_file(path: &str) -> std::result::Result { let f = crate::file_access::open(path).map_err(|e| e.to_string())?; match figcraft_format::read_library(std::io::BufReader::new(f)) { - Ok(Some(lib)) => Ok(lib), + Ok(Some(lib)) => Ok(settled(lib)), Ok(None) => Err(format!("{path} has no published library: open it and publish it first (Libraries ▸ Publish library…)")), Err(e) => Err(format!("{path}: {e}")), } diff --git a/crates/engine/src/library_server.rs b/crates/engine/src/library_server.rs index 99d5f29af..10852b5fd 100644 --- a/crates/engine/src/library_server.rs +++ b/crates/engine/src/library_server.rs @@ -53,7 +53,7 @@ pub fn archive(lib: &PublishedLibrary) -> Result> { /// The library in an archive from a server (untrusted: read with the library file's limits). pub fn read_archive(bytes: &[u8]) -> std::result::Result { match figcraft_format::read_library(Cursor::new(bytes)) { - Ok(Some(lib)) => Ok(lib), + Ok(Some(lib)) => Ok(crate::library::settled(lib)), Ok(None) => Err("the server sent a file without a library".into()), Err(e) => Err(format!("the server sent a library that can't be read ({e})")), } diff --git a/crates/engine/src/library_variables_tests.rs b/crates/engine/src/library_variables_tests.rs index 7104164b3..b4a4171a4 100644 --- a/crates/engine/src/library_variables_tests.rs +++ b/crates/engine/src/library_variables_tests.rs @@ -345,32 +345,42 @@ fn library_style_bindings_ignore_unrelated_local_variables() { let _ = std::fs::remove_dir_all(&d); } +/// A library "Modal" holding a Button instance whose icon copy is on mode Dark: (the Button main, +/// the icon copy in Modal). +fn nested_mode_kit(lib: &mut Session) -> (NodeId, NodeId) { + theme(lib); + let f = idv(&ex(lib, "frame.create", json!({"x": 0, "y": 0, "width": 20, "height": 20, "name": "Icon"}))); + ex(lib, "variable.bind", json!({"ids": [f], "field": "fill", "variable": "primary"})); + let icon = idv(&ex(lib, "component.create", json!({"ids": [f]}))); + let b = idv(&ex(lib, "frame.create", json!({"x": 100, "y": 0, "width": 60, "height": 40, "name": "Button"}))); + ex(lib, "instance.create", json!({"component": icon, "x": 10, "y": 10, "parent": b})); + let button = idv(&ex(lib, "component.create", json!({"ids": [b]}))); + let m = idv(&ex(lib, "frame.create", json!({"x": 300, "y": 0, "width": 200, "height": 100, "name": "Modal"}))); + let close = idv(&ex(lib, "instance.create", json!({"component": button, "x": 10, "y": 10, "parent": m}))); + let nested = lib.doc().unwrap().node(close).unwrap().children[0]; + ex(lib, "variable.setMode", json!({"ids": [nested], "collection": "Theme", "mode": "Dark"})); + ex(lib, "component.create", json!({"ids": [m]})); + (button, nested) +} + +/// The icon inside the Button inside library Modal instance `inst`. +fn modal_icon(s: &Session, inst: NodeId) -> NodeId { + let doc = s.doc().unwrap(); + doc.node(doc.node(inst).unwrap().children[0]).unwrap().children[0] +} + #[test] fn modes_set_inside_nested_instances_come_along() { let d = dir("nested-modes"); let lib_path = path_str(&d.join("kit.figcraft")); let mut lib = Session::new(); - theme(&mut lib); - let f = idv(&ex(&mut lib, "frame.create", json!({"x": 0, "y": 0, "width": 20, "height": 20, "name": "Icon"}))); - ex(&mut lib, "variable.bind", json!({"ids": [f], "field": "fill", "variable": "primary"})); - let icon = idv(&ex(&mut lib, "component.create", json!({"ids": [f]}))); - let b = idv(&ex(&mut lib, "frame.create", json!({"x": 100, "y": 0, "width": 60, "height": 40, "name": "Button"}))); - ex(&mut lib, "instance.create", json!({"component": icon, "x": 10, "y": 10, "parent": b})); - let button = idv(&ex(&mut lib, "component.create", json!({"ids": [b]}))); - let m = idv(&ex(&mut lib, "frame.create", json!({"x": 300, "y": 0, "width": 200, "height": 100, "name": "Modal"}))); - let close = idv(&ex(&mut lib, "instance.create", json!({"component": button, "x": 10, "y": 10, "parent": m}))); - let nested = lib.doc().unwrap().node(close).unwrap().children[0]; - ex(&mut lib, "variable.setMode", json!({"ids": [nested], "collection": "Theme", "mode": "Dark"})); - ex(&mut lib, "component.create", json!({"ids": [m]})); + let (button, _) = nested_mode_kit(&mut lib); let lid = publish_to(&mut lib, &lib_path); let mut s = Session::new(); ex(&mut s, "library.add", json!({"path": lib_path})); let inst = idv(&ex(&mut s, "library.place", json!({"library": lid, "component": "Modal", "x": 0, "y": 0}))); - let copy = |s: &Session| { - let doc = s.doc().unwrap(); - doc.node(doc.node(inst).unwrap().children[0]).unwrap().children[0] - }; + let copy = |s: &Session| modal_icon(s, inst); assert_eq!(fill(&s, copy(&s)), "FFFFFF", "the Dark mode set on the nested icon comes along"); // An update that rebuilds the Button copies keeps it too. ex(&mut lib, "node.set", json!({"ids": [button], "layout": "horizontal"})); @@ -380,3 +390,21 @@ fn modes_set_inside_nested_instances_come_along() { healthy(&s); let _ = std::fs::remove_dir_all(&d); } + +#[test] +fn a_library_published_before_modes_were_overrides_keeps_the_modes_set_inside_nested_instances() { + let d = dir("nested-modes-old"); + let lib_path = path_str(&d.join("kit.figcraft")); + let mut lib = Session::new(); + let (_, nested) = nested_mode_kit(&mut lib); + // Published before `modes` was an override group: the copy has its mode but no marker. + lib.doc_mut().unwrap().node_mut(nested).unwrap().overrides.remove("modes"); + let lid = publish_to(&mut lib, &lib_path); + + let mut s = Session::new(); + ex(&mut s, "library.add", json!({"path": lib_path})); + let inst = idv(&ex(&mut s, "library.place", json!({"library": lid, "component": "Modal", "x": 0, "y": 0}))); + assert_eq!(fill(&s, modal_icon(&s, inst)), "FFFFFF", "the Dark mode comes along"); + healthy(&s); + let _ = std::fs::remove_dir_all(&d); +} From 37921f48ceeb19466cf7fe656f8f553a36ec542c Mon Sep 17 00:00:00 2001 From: Nicek Date: Thu, 22 Oct 2026 19:51:25 +0800 Subject: [PATCH 534/817] =?UTF-8?q?feat(inspect):=20=E4=B8=BA=E8=B5=84?= =?UTF-8?q?=E4=BA=A7=E5=88=97=E8=A1=A8=E6=B7=BB=E5=8A=A0=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E4=B8=8B=E6=8B=89=E8=8F=9C=E5=8D=95=E5=92=8C?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E7=BC=A9=E7=95=A5=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/ui-egui/locales/en.toml | 1 + crates/ui-egui/locales/es.toml | 1 + crates/ui-egui/locales/zh-Hans.toml | 1 + crates/ui-egui/src/dev_mode_tests.rs | 25 +++++++ crates/ui-egui/src/right.rs | 104 +++++++++++++++++++++------ docs/dev-mode-parity.md | 5 +- 6 files changed, 115 insertions(+), 22 deletions(-) diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index aa9f97b33..f9fa64374 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -544,6 +544,7 @@ name = "English" "Font size" = "Font size" "Font style" = "Font style" "Forget on this computer" = "Forget on this computer" +"Format" = "Format" "Four screens of a trail app with components and a prototype flow" = "Four screens of a trail app with components and a prototype flow" "Fractions" = "Fractions" "Frame" = "Frame" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index f47ab9650..fd36f60f0 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -545,6 +545,7 @@ status = "draft — needs native review" "Font size" = "Tamaño de fuente" "Font style" = "Estilo de fuente" "Forget on this computer" = "Olvidar en este ordenador" +"Format" = "Formato" "Four screens of a trail app with components and a prototype flow" = "Cuatro pantallas de una app de senderos con componentes y un flujo de prototipo" "Fractions" = "Fracciones" "Frame" = "Marco" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index befa96853..ce1c6d654 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -517,6 +517,7 @@ status = "draft — needs native review" "Font size" = "字号" "Font style" = "字体样式" "Forget on this computer" = "在这台电脑上忘记" +"Format" = "格式" "Fractions" = "分数" "Frame" = "画框" "Frame selection" = "为所选项添加画框" diff --git a/crates/ui-egui/src/dev_mode_tests.rs b/crates/ui-egui/src/dev_mode_tests.rs index 941f1b2c5..9c62f8c9c 100644 --- a/crates/ui-egui/src/dev_mode_tests.rs +++ b/crates/ui-egui/src/dev_mode_tests.rs @@ -80,3 +80,28 @@ fn annotation_filter_and_categories_panel() { assert_eq!(CategoryFilter::parse(&doc, "none"), Some(CategoryFilter::Uncategorized)); assert_eq!(CategoryFilter::parse(&doc, "nope"), None); } + +#[test] +fn the_assets_list_shows_a_slice_with_a_preview_name_and_export_format() { + let mut s = Session::new(); + let f = id(&s.execute("frame.create", &json!({"x": 0, "y": 0, "width": 200, "height": 200, "name": "Login"})).unwrap()); + s.execute("shape.rectangle", &json!({"x": 20, "y": 20, "width": 80, "height": 40, "parent": f, "props": {"fill": "#FF0000"}})).unwrap(); + // A slice with one export setting: its own format is what the row offers first. + let slice = id(&s.execute("node.create", &json!({"type": "slice", "x": 10, "y": 10, "width": 100, "height": 60, "name": "Avatar"})).unwrap()); + s.execute("export.add", &json!({"ids": [slice], "setting": {"format": "webp", "size": "2x"}})).unwrap(); + s.execute("select.set", &json!({"ids": [slice]})).unwrap(); + let mut u = crate::layers_drag_tests::Ui::new(s); + u.app.ui.right_tab = crate::RightTab::Inspect; + u.ctx.enable_accesskit(); + let out = u.frame_output(vec![]); + let nodes: Vec = + out.platform_output.accesskit_update.expect("an AccessKit update").nodes.into_iter().map(|(_, n)| n).collect(); + let find = |role: egui::accesskit::Role, label: &str| { + nodes.iter().find(|n| n.role() == role && n.label() == Some(label)).unwrap_or_else(|| panic!("no {role:?} named {label:?}")) + }; + // The row exports by a click, and the format under the name is a dropdown. + find(egui::accesskit::Role::Button, "Export Avatar"); + let fmt = find(egui::accesskit::Role::ComboBox, "Format"); + assert_eq!(fmt.value(), Some("WebP")); + assert_eq!(fmt.is_expanded(), Some(false)); +} diff --git a/crates/ui-egui/src/right.rs b/crates/ui-egui/src/right.rs index b2babc568..60aade818 100644 --- a/crates/ui-egui/src/right.rs +++ b/crates/ui-egui/src/right.rs @@ -2251,9 +2251,23 @@ pub(crate) fn prop_row(app: &mut FigApp, ui: &mut Ui, p: &figcraft_engine::devin } } -/// The selection's assets (layers with export settings, icons, images): click one to export it, -/// or export them all. -fn inspect_assets(app: &mut FigApp, ui: &mut Ui, assets: &[figcraft_engine::devinspect::Asset]) { +/// The thumbnails and chosen export formats of the Inspect tab's assets, kept between frames and +/// dropped when the document changes. +#[derive(Clone, Default)] +struct AssetUi { + revision: u64, + thumbs: std::collections::HashMap>, + formats: std::collections::HashMap, +} + +/// An asset row's height and its preview's side. +const ASSET_ROW_H: f32 = 56.0; +const ASSET_THUMB: f32 = 40.0; + +/// The selection's assets (layers with export settings, icons, images) as a list of a preview, a +/// name and a format: click one to export it in that format, or export them all with their own +/// export settings. +fn inspect_assets(app: &mut FigApp, ui: &mut Ui, doc: &Document, assets: &[figcraft_engine::devinspect::Asset]) { let t = Tokens::get(ui.ctx()); widgets::separator(ui); let export_all = [(Icon::Export, tr("Export all"))]; @@ -2262,30 +2276,80 @@ fn inspect_assets(app: &mut FigApp, ui: &mut Ui, assets: &[figcraft_engine::devi widgets::note(ui, tr("No assets: no export settings, icons or images. Add export settings in the Design tab."), t.text_secondary); return; } - let mut export: Option> = all.then(|| assets.iter().map(|a| a.id).collect()); + let mut export_all_ids: Option> = all.then(|| assets.iter().map(|a| a.id).collect()); + let mut export_one: Option<(NodeId, ExportSetting, String)> = None; + let revision = app.session.ds().map(|d| d.revision).unwrap_or(0); + let cache_id = Id::new("inspect_asset_ui"); + let mut state: AssetUi = ui.data(|d| d.get_temp(cache_id)).unwrap_or_default(); + if state.revision != revision { + state.revision = revision; + state.thumbs.clear(); + state.formats.clear(); + } + let px = ASSET_THUMB * ui.ctx().pixels_per_point(); for a in assets { - let (r, resp) = ui.allocate_exact_size(vec2(ui.available_width(), 26.0), Sense::click()); + let (r, resp) = ui.allocate_exact_size(vec2(ui.available_width(), ASSET_ROW_H), Sense::click()); let resp = resp.tip(trf("Export {name}", &[("name", &a.name)])); if resp.hovered() { - ui.painter().rect_filled(r.shrink2(vec2(8.0, 0.0)), CornerRadius::same(5), t.hover); + ui.painter().rect_filled(r.shrink2(vec2(8.0, 1.0)), CornerRadius::same(6), t.hover); icons::paint(ui.painter(), Rect::from_center_size(pos2(r.max.x - PAD - 6.0, r.center().y), vec2(12.0, 12.0)), Icon::Export, t.icon); } - let name_r = Rect::from_min_max(pos2(r.min.x + PAD, r.min.y), pos2(r.min.x + 96.0 - 4.0, r.max.y)); - ui.painter().with_clip_rect(name_r).text(pos2(name_r.min.x, r.center().y), Align2::LEFT_CENTER, &a.name, regular(11.0), t.text); - let fmt_r = Rect::from_min_max(pos2(r.min.x + 96.0, r.min.y), pos2(r.max.x - PAD - 16.0, r.max.y)); - ui.painter().with_clip_rect(fmt_r).text( - pos2(fmt_r.min.x, r.center().y), - Align2::LEFT_CENTER, - a.exports.join(", "), - regular(11.0), - t.text_secondary, - ); - if resp.clicked() { - export = Some(vec![a.id]); + // The preview, as exporting it paints it (a slice shows the page under it). + let thumb = Rect::from_min_size(pos2(r.min.x + PAD, r.center().y - ASSET_THUMB / 2.0), vec2(ASSET_THUMB, ASSET_THUMB)); + ui.painter().rect_filled(thumb, CornerRadius::same(4), t.field); + let tex = state.thumbs.entry(a.id).or_insert_with(|| crate::assets_panel::thumbnail(ui.ctx(), doc, a.id, px)).clone(); + if let Some(tex) = tex { + let size = tex.size_vec2(); + let inner = thumb.shrink(3.0); + // Never past 1:1 physical pixels, so small assets stay crisp. + let k = (inner.width() / size.x).min(inner.height() / size.y).min(1.0 / ui.ctx().pixels_per_point()).max(0.0); + let img = Rect::from_center_size(thumb.center(), size * k); + ui.painter().with_clip_rect(inner).image(tex.id(), img, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE); + } + ui.painter().rect_stroke(thumb, CornerRadius::same(4), Stroke::new(1.0, t.border), egui::StrokeKind::Inside); + // The name, and the format to export it as (its first export setting's, until chosen). + let x = thumb.max.x + 10.0; + let name_r = Rect::from_min_max(pos2(x, r.min.y + 5.0), pos2(r.max.x - PAD, r.min.y + 27.0)); + let name = widgets::elide(ui, &a.name, name_r.width()); + ui.painter().with_clip_rect(name_r).text(pos2(name_r.min.x, name_r.center().y), Align2::LEFT_CENTER, &name, regular(11.0), t.text); + let idx = state + .formats + .get(&a.id) + .copied() + .filter(|i| *i < ExportFormat::ALL.len()) + .unwrap_or_else(|| ExportFormat::ALL.iter().position(|f| Some(*f) == a.settings.first().map(|s| s.format)).unwrap_or(0)); + let fmt = ExportFormat::ALL[idx]; + let btn = Rect::from_min_size(pos2(x, r.min.y + 31.0), vec2(74.0, 20.0)); + let btn_resp = ui.interact(btn, Id::new(("inspect_asset_format", a.id)), Sense::click()); + a11y::combo(&btn_resp, tr("Format"), fmt.label(), a11y::menu_open(&btn_resp)); + if btn_resp.hovered() { + ui.painter().rect_filled(btn, CornerRadius::same(5), t.field); + ui.painter().rect_stroke(btn, CornerRadius::same(5), Stroke::new(1.0, t.field_hover_border), egui::StrokeKind::Inside); + } else { + ui.painter().rect_filled(btn, CornerRadius::same(5), t.field); + } + ui.painter().text(pos2(btn.min.x + 8.0, btn.center().y), Align2::LEFT_CENTER, fmt.label(), regular(11.0), t.text); + icons::paint(ui.painter(), Rect::from_center_size(pos2(btn.max.x - 9.0, btn.center().y), vec2(10.0, 10.0)), Icon::Chevron, t.icon_secondary); + menu_popup(&btn_resp).show(|ui| { + for (i, f) in ExportFormat::ALL.iter().enumerate() { + if menu_item(ui, f.label(), "") { + state.formats.insert(a.id, i); + ui.close(); + } + } + }); + if resp.clicked() && !btn_resp.hovered() { + let mut setting = a.settings.first().cloned().unwrap_or_default(); + setting.format = fmt; + let file = format!("{}{}.{}", a.name.rsplit('/').next().unwrap_or(&a.name), setting.file_suffix(), fmt.ext()); + export_one = Some((a.id, setting, file)); } } - if let Some(ids) = export { + ui.data_mut(|d| d.insert_temp(cache_id, state)); + if let Some(ids) = export_all_ids.take() { crate::export_panel::export_layers(app, &ids, true); + } else if let Some((id, setting, file)) = export_one { + crate::export_panel::save_one(app, &[id], &setting, &file); } ui.add_space(4.0); } @@ -2329,7 +2393,7 @@ fn inspect(app: &mut FigApp, ui: &mut Ui) { for s in figcraft_engine::devinspect::properties_with(&doc, first, fmt) { inspect_section(app, ui, &s); } - inspect_assets(app, ui, &figcraft_engine::devinspect::assets(&doc, &sel)); + inspect_assets(app, ui, &doc, &figcraft_engine::devinspect::assets(&doc, &sel)); use figcraft_engine::codegen::CodeLang; let lang_id = Id::new("inspect_lang"); let lang = ui.data(|d| d.get_temp::(lang_id)).and_then(|i| CodeLang::ALL.get(i).copied()).unwrap_or_default(); diff --git a/docs/dev-mode-parity.md b/docs/dev-mode-parity.md index cba5e81df..7d08f90a6 100644 --- a/docs/dev-mode-parity.md +++ b/docs/dev-mode-parity.md @@ -1,6 +1,6 @@ # Dev Mode parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-12 · **Change:** minor (dev resources links; inspect behaviour suite and fixes: colour formats, rem, blend, positions from the frame, CSS for rotation, gradients and text, icons and images as assets; code connect and Dev Mode plugins) · **Target:** Figma Design Dev Mode (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-22 · **Change:** minor (the assets list shows a preview, the name and an export format per asset) · **Target:** Figma Design Dev Mode (desktop app 126.10.7) **Breadth ~96%, ready ~72% (estimated).** The inspect surface is broad, components connect to the code components of a repository and layers carry dev resources links; left: import lines @@ -11,7 +11,7 @@ inside generated layer trees. Remaining: 0–1 h. | Dev Mode toggle (Shift+D), Inspect panel | done | | | Properties with their styles and variables; redlines on hover | done | positions from the frame around the layer (groups aren't frames), rotation, radius (CSS corner order), opacity, blend; colours in hex, RGB, CSS, HSL or HSB (`inspect.properties {colorFormat}`, the Inspect tab's Color format) | | Code: CSS, iOS (SwiftUI), Android (Compose) | done | plus HTML, React and Leptos (ours; Leptos: `#[component]` functions with `#[prop]` defaults, variant enums and `view!` markup); components take properties as parameters, instances are calls; CSS in px or rem (`inspect.code {unit, rootFontSize}`), with rotation, blend modes, gradient directions and kinds (linear, radial, conic), text alignment, case and decoration | -| Assets list with export | done | layers with export settings, icons (small, vector shapes only: SVG) and images (PNG); the icon rule is ours | +| Assets list with export | done | layers with export settings, icons (small, vector shapes only: SVG) and images (PNG) as a list of a preview, the name and a format to pick (its first export setting's until changed); a click exports the asset in that format, "Export all" uses each layer's own export settings; the icon rule is ours | | Annotations: pinned properties, categories, coloured callouts, filter | done | | | Ready for dev list, statuses, "Changed" after edits | done | | | Focus view (one frame, previous / next) | done | | @@ -25,6 +25,7 @@ inside generated layer trees. Remaining: 0–1 h. | Date | Change | Summary | |---|---|---| +| 2026-10-22 | minor | The Inspect tab's assets are a list of a thumbnail, the name and a format dropdown, instead of a name with a text summary: a slice shows the page content under it (as its export does), the format starts from the asset's first export setting and picking another exports that asset in it; "Export all" is unchanged (`dev_mode_tests::the_assets_list_shows_a_slice_with_a_preview_name_and_export_format`) | | 2026-10-12 | minor | Dev resources (gap 16): links for developers (a URL and a name) on any layer: `devResource.add` / `edit` / `remove` / `list`, undoable, saved and synced; an instance also lists its main component's (and that component's set's) links read-only with where they come from, and layers inside an instance show their main layer's; URLs are checked as web links (http or https, a host, no spaces, at most 2,048 characters) and never fetched (a link added without a name is named after its URL), opened only when clicked; the Inspect tab lists, adds, edits and removes them; `get_node` and `inspect_document` return them as `devResources`. The editor extension stays out of scope (the MCP server serves agents and editors). Dev Mode breadth 93% → 96%, ready 70% → 72%, 1–3 h → 0–1 h; feature breadth (~82%) and ready for real work (~51%) unchanged at this rounding; full parity ~304–593 h → ~303–591 h | | 2026-10-11 | minor | Export and inspect behaviour suite written from the public documentation (139 cases in 19 tests; 47 failed before the fixes) and its fixes: an export covers what the layer paints, so a drop shadow adds room only where it falls, strokes on boxes and ellipses reach their real width (they added up to four times as much), hidden layers take no room and a mask group exports the mask's area; a slice exports everything under it; slashes in layer names export into folders; Copy as PNG copies the whole selection. Added: the export settings' contents only and include bounding box, and for SVG outline text (off writes ``), unique id attributes and simplified strokes (stroke attributes where exact); Inspect colour formats (hex, RGB, CSS, HSL, HSB), CSS in rem, a Blend row, positions measured from the frame around a layer (groups aren't frames), CSS for rotation, blend modes, gradient directions and kinds, text alignment, case and decoration; icons and images in the asset list (`file.exportLayers {assets}`). Dev Mode breadth 90% → 93%, ready 64% → 70%, hours unchanged (1–3, dev resources); feature breadth and ready for real work unchanged at this rounding | | 2026-10-11 | minor | Code connect and Dev Mode plugins (gap 16): a component or set links to its code component per language (import path, name, a template with `{property}` and `{property ? "a" : "b"}` placeholders); `inspect.code`, `inspect.componentCode` and the Inspect panel show that snippet with the instance's values (also inside generated layer trees), edited in Connect to code with a live preview; links are saved, synced and undoable, and travel as `figcraft.connect.json` (`codeConnect.export` / `codeConnect.import`). Plugins that only read run from the Inspect tab. Dev Mode breadth 80% → 90%, ready 62% → 64%, 4–8 h → 1–3 h; feature breadth (~79%) and ready for real work (~47%) unchanged; full parity ~380–725 h → ~375–720 h | From 7e28d58b3fddcda543e6386d4abd3218e280c946 Mon Sep 17 00:00:00 2001 From: Nicek Date: Thu, 22 Oct 2026 20:36:45 +0800 Subject: [PATCH 535/817] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=20ArkUI=20?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E5=92=8C=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加 ArkUI 作为新的代码语言支持,包括: - 代码生成:支持生成 ArkTS 组件代码,包括 `@Component` 结构体、`@Prop` 参数、`@BuilderParam` 构建器等 - 代码连接:支持将组件连接到 ArkTS 代码,包括导入路径和模板配置 - 测试:添加 ArkUI 相关测试用例,验证代码生成和连接功能的正确性 - 更新文档:更新开发模式 parity 文档、文件格式一致性文档等,添加 ArkUI 相关说明 - 更新国际化:在所有支持的语言中添加 ArkUI 选项提示 --- crates/engine/src/code_connect.rs | 15 +- crates/engine/src/code_connect_tests.rs | 12 +- crates/engine/src/codegen.rs | 270 ++++++++++++++++++- crates/engine/src/component_codegen.rs | 126 +++++++-- crates/engine/src/component_codegen_tests.rs | 36 +++ crates/engine/src/playground.rs | 4 +- crates/ui-egui/locales/bn.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/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/tr.toml | 2 +- crates/ui-egui/locales/zh-Hans.toml | 2 +- crates/ui-egui/src/dev_mode.rs | 2 +- docs/dev-mode-parity.md | 7 +- docs/file-format-parity.md | 2 +- docs/gaps.md | 2 +- docs/mcp.md | 15 +- docs/target-app-parity.md | 2 +- 30 files changed, 464 insertions(+), 65 deletions(-) diff --git a/crates/engine/src/code_connect.rs b/crates/engine/src/code_connect.rs index 463406368..d63f49788 100644 --- a/crates/engine/src/code_connect.rs +++ b/crates/engine/src/code_connect.rs @@ -37,7 +37,7 @@ const MAX_WARNINGS: usize = 50; /// The languages a component can be connected in. pub fn language(s: &str) -> Option { - CodeLang::from_id(s).filter(|l| matches!(l, CodeLang::React | CodeLang::Leptos | CodeLang::SwiftUi | CodeLang::Compose)) + CodeLang::from_id(s).filter(|l| matches!(l, CodeLang::React | CodeLang::Leptos | CodeLang::SwiftUi | CodeLang::Compose | CodeLang::ArkUi)) } /// The layer `id`'s links are stored on: its component set, else its component (an instance's @@ -64,7 +64,7 @@ pub fn import_line(link: &CodeLink, lang: CodeLang) -> String { let path = &link.import_path; match lang { _ if path.is_empty() => String::new(), - CodeLang::React => format!("import {{ {} }} from {};", link.name.split('.').next().unwrap_or_default(), js_string(path)), + CodeLang::React | CodeLang::ArkUi => format!("import {{ {} }} from {};", link.name.split('.').next().unwrap_or_default(), js_string(path)), CodeLang::Leptos => format!("use {path}::{};", link.name.split('.').next().unwrap_or_default()), _ => format!("import {path}"), } @@ -175,6 +175,7 @@ fn expr(doc: &Document, c: &Component, p: &Param, v: &Value, lang: CodeLang) -> (Some(l), CodeLang::React) => format!("<{} />", l.name), (Some(l), CodeLang::Leptos) => format!("|| view! {{ <{} /> }}", l.name), (Some(l), CodeLang::SwiftUi) => format!("{}()", l.name), + (Some(l), CodeLang::ArkUi) => format!("() => {{ {}() }}", l.name), (Some(l), _) => format!("{{ {}() }}", l.name), (None, _) => value_expr(doc, c, p, v, lang), } @@ -222,6 +223,7 @@ fn default_template(c: &Component, lang: CodeLang, name: &str) -> String { format!("<{name}{} />", params.iter().map(|p| format!(" {}={{{p}}}", crate::component_codegen::rust_ident(p))).collect::()) } CodeLang::SwiftUi => format!("{name}({})", params.iter().map(|p| format!("{p}: {{{p}}}")).collect::>().join(", ")), + CodeLang::ArkUi => format!("{name}({{ {} }})", params.iter().map(|p| format!("{p}: {{{p}}}")).collect::>().join(", ")), _ => format!("{name}({})", params.iter().map(|p| format!("{p} = {{{p}}}")).collect::>().join(", ")), } } @@ -239,13 +241,14 @@ pub fn check(c: &Component, link: &CodeLink, lang: CodeLang) -> std::result::Res } let path = &link.import_path; let path_ok = match lang { - CodeLang::React => !path.chars().any(|ch| ch.is_control() || ch == '"' || ch == '\\'), + CodeLang::React | CodeLang::ArkUi => !path.chars().any(|ch| ch.is_control() || ch == '"' || ch == '\\'), CodeLang::Leptos => path.chars().all(|ch| ch.is_ascii_alphanumeric() || ch == '_' || ch == ':'), _ => path.chars().all(|ch| ch.is_ascii_alphanumeric() || ch == '_' || ch == '.'), }; if path.chars().count() > MAX_IMPORT || !path_ok { return Err(match lang { CodeLang::React => format!("importPath: a module path without quotes, up to {MAX_IMPORT} characters"), + CodeLang::ArkUi => format!("importPath: a module path without quotes, up to {MAX_IMPORT} characters"), CodeLang::Leptos => format!("importPath: a Rust module path (letters, digits, _ and ::), up to {MAX_IMPORT} characters"), _ => format!("importPath: a module or package name (letters, digits, _ and .), up to {MAX_IMPORT} characters"), }); @@ -282,7 +285,7 @@ fn text(cmd: &str, p: &Value, key: &str) -> Result> { /// The `language` parameter (default React). fn lang_param(cmd: &str, p: &Value) -> Result { match text(cmd, p, "language")? { - Some(l) => language(&l).ok_or_else(|| bad(cmd, "language: react|leptos|swiftui|compose")), + Some(l) => language(&l).ok_or_else(|| bad(cmd, "language: react|leptos|swiftui|compose|arkui")), None => Ok(CodeLang::React), } } @@ -312,7 +315,7 @@ pub fn specs() -> Vec { spec!( "codeConnect.set", "Connect to code", - "{id? (component, set or instance; default the selection), language?: react|leptos|swiftui|compose (default react), importPath?, name? (default the generated name), template? (default a call passing every property)} links the component (its set, for a variant) to its code component; fields left out keep their current value. Placeholders: {property} (its name or parameter name) and {property ? \"a\" : \"b\"}; other {…} stay as written → {component, language, code (the snippet for the layer), unknown (placeholder names that aren't properties)}", + "{id? (component, set or instance; default the selection), language?: react|leptos|swiftui|compose|arkui (default react), importPath?, name? (default the generated name), template? (default a call passing every property)} links the component (its set, for a variant) to its code component; fields left out keep their current value. Placeholders: {property} (its name or parameter name) and {property ? \"a\" : \"b\"}; other {…} stay as written → {component, language, code (the snippet for the layer), unknown (placeholder names that aren't properties)}", true, |s, p| { let cmd = "codeConnect.set"; @@ -427,7 +430,7 @@ fn import(s: &mut Session, p: &Value) -> Result { let (Some(component), Some(lang), Some(name), Some(template)) = (field("component"), field("language").and_then(language), field("name"), e.get("template").and_then(Value::as_str)) else { - warnings.push(format!("link {}: needs component, language (react|leptos|swiftui|compose), name and template strings", i + 1)); + warnings.push(format!("link {}: needs component, language (react|leptos|swiftui|compose|arkui), name and template strings", i + 1)); continue; }; let link = CodeLink { diff --git a/crates/engine/src/code_connect_tests.rs b/crates/engine/src/code_connect_tests.rs index 9d657d5f1..6cdd8e675 100644 --- a/crates/engine/src/code_connect_tests.rs +++ b/crates/engine/src/code_connect_tests.rs @@ -72,6 +72,16 @@ fn connected_instances_show_the_real_snippet() { json!({"id": c, "language": "leptos", "importPath": "crate::ui", "template": ""}), ); assert_eq!(code(&mut s, i, "leptos"), "use crate::ui::Card;\n\n\n"); + // ArkUI: an ArkTS import and an object-literal call. + ex( + &mut s, + "codeConnect.set", + json!({"id": c, "language": "arkui", "importPath": "@acme/arkui", "template": "Card({ title: {title}, dotted: {Show dot} })"}), + ); + assert_eq!(code(&mut s, i, "arkui"), "import { Card } from \"@acme/arkui\";\n\nCard({ title: \"Say \\\"hi\\\"\", dotted: false })\n"); + let v = ex(&mut s, "inspect.componentCode", json!({"id": i, "language": "arkui"})); + assert_eq!(v["usage"], "Card({ title: \"Say \\\"hi\\\"\", dotted: false })\n"); + assert_eq!(v["connected"]["import"], "import { Card } from \"@acme/arkui\";"); assert!(s.execute("codeConnect.set", &json!({"id": c, "language": "leptos", "importPath": "crate/ui"})).is_err(), "a Rust path"); ex(&mut s, "codeConnect.remove", json!({"id": c, "language": "leptos"})); // inspect.componentCode: the snippet as the usage, and the link. @@ -105,7 +115,7 @@ fn connected_instances_show_the_real_snippet() { assert!(code(&mut s, i, "swiftui").starts_with("import AcmeUI")); ex(&mut s, "edit.undo", json!({})); assert!(code(&mut s, i, "react").starts_with("import { Card }")); - assert_eq!(ex(&mut s, "codeConnect.remove", json!({"id": c}))["removed"], 2); + assert_eq!(ex(&mut s, "codeConnect.remove", json!({"id": c}))["removed"], 3); assert!(s.execute("codeConnect.remove", &json!({"id": c})).is_err(), "nothing left"); } diff --git a/crates/engine/src/codegen.rs b/crates/engine/src/codegen.rs index 0871f886d..efca85d4a 100644 --- a/crates/engine/src/codegen.rs +++ b/crates/engine/src/codegen.rs @@ -1,9 +1,9 @@ //! Code for a layer, as shown by the Inspect panel and returned by `inspect.code`: CSS for the -//! layer itself, HTML or React for its subtree, and SwiftUI or Jetpack Compose (stacks for auto -//! layout, absolute offsets otherwise). Components become components whose properties are -//! parameters and instances become calls passing their values (see [`crate::component_codegen`]); -//! variables bound to a layer become CSS custom properties. The output is a starting point, not a -//! pixel-exact translation. +//! layer itself, HTML or React for its subtree, and SwiftUI, Jetpack Compose or ArkUI (HarmonyOS; +//! stacks for auto layout, absolute offsets otherwise). Components become components whose +//! properties are parameters and instances become calls passing their values (see +//! [`crate::component_codegen`]); variables bound to a layer become CSS custom properties. The +//! output is a starting point, not a pixel-exact translation. use figcraft_color::{Color, PaintKind}; use figcraft_doc::*; @@ -18,13 +18,13 @@ pub fn specs() -> Vec { vec![spec!( "inspect.code", "Code for layer", - "{id?, language?: css|html|react|leptos|swiftui|compose (default css; html, react and leptos are the whole layer tree; components take their properties as parameters, instances pass their values; a component connected to code (codeConnect.set) gives its import and snippet instead), unit?: px|rem (CSS, HTML, React and Leptos; default px), rootFontSize? (rem: pixels per rem, default 16)} → {code, language, connected}", + "{id?, language?: css|html|react|leptos|swiftui|compose|arkui (default css; html, react and leptos are the whole layer tree; components take their properties as parameters, instances pass their values; a component connected to code (codeConnect.set) gives its import and snippet instead), unit?: px|rem (CSS, HTML, React and Leptos; default px), rootFontSize? (rem: pixels per rem, default 16)} → {code, language, connected}", false, |s, p| { let cmd = "inspect.code"; let id = targets(s, p).first().copied().ok_or_else(|| bad(cmd, "select a layer"))?; let lang = match string(p, "language") { - Some(l) => CodeLang::from_id(&l).ok_or_else(|| bad(cmd, "language: css|html|react|leptos|swiftui|compose"))?, + Some(l) => CodeLang::from_id(&l).ok_or_else(|| bad(cmd, "language: css|html|react|leptos|swiftui|compose|arkui"))?, None => CodeLang::Css, }; let rem = match string(p, "unit").map(|u| u.to_ascii_lowercase()).as_deref() { @@ -63,10 +63,13 @@ pub enum CodeLang { Leptos, SwiftUi, Compose, + /// HarmonyOS ArkUI: an ArkTS struct (`@Component`, `build`). + ArkUi, } impl CodeLang { - pub const ALL: [CodeLang; 6] = [CodeLang::Css, CodeLang::Html, CodeLang::React, CodeLang::Leptos, CodeLang::SwiftUi, CodeLang::Compose]; + pub const ALL: [CodeLang; 7] = + [CodeLang::Css, CodeLang::Html, CodeLang::React, CodeLang::Leptos, CodeLang::SwiftUi, CodeLang::Compose, CodeLang::ArkUi]; pub fn id(self) -> &'static str { match self { CodeLang::Css => "css", @@ -75,6 +78,7 @@ impl CodeLang { CodeLang::Leptos => "leptos", CodeLang::SwiftUi => "swiftui", CodeLang::Compose => "compose", + CodeLang::ArkUi => "arkui", } } pub fn label(self) -> &'static str { @@ -85,6 +89,7 @@ impl CodeLang { CodeLang::Leptos => "Leptos", CodeLang::SwiftUi => "SwiftUI", CodeLang::Compose => "Compose", + CodeLang::ArkUi => "ArkUI", } } /// Languages whose lengths are CSS pixels (they can be shown in rem). @@ -95,6 +100,9 @@ impl CodeLang { if s.eq_ignore_ascii_case("tsx") || s.eq_ignore_ascii_case("jsx") { return Some(CodeLang::React); } + if s.eq_ignore_ascii_case("arkts") { + return Some(CodeLang::ArkUi); + } CodeLang::ALL.into_iter().find(|l| l.id().eq_ignore_ascii_case(s) || l.label().eq_ignore_ascii_case(s)) } } @@ -194,7 +202,7 @@ pub fn code_for(doc: &Document, id: NodeId, lang: CodeLang) -> String { match lang { CodeLang::Css => css(doc, id), CodeLang::Html => html(doc, id), - CodeLang::React | CodeLang::Leptos | CodeLang::SwiftUi | CodeLang::Compose => crate::component_codegen::code(doc, id, lang), + CodeLang::React | CodeLang::Leptos | CodeLang::SwiftUi | CodeLang::Compose | CodeLang::ArkUi => crate::component_codegen::code(doc, id, lang), } } @@ -1135,6 +1143,218 @@ fn compose_layer(ctx: &Ctx, n: &Node, depth: usize, out: &mut String) { } } +// ------------------------------------------------------------------ ArkUI (ArkTS) + +/// A colour as ArkUI writes it: `'#RRGGBB'`, or `'#AARRGGBB'` with transparency. +fn ark_color(c: Color) -> String { + let [r, g, b, a] = c.to_rgba8(); + if a == 255 { format!("'#{r:02X}{g:02X}{b:02X}'") } else { format!("'#{a:02X}{r:02X}{g:02X}{b:02X}'") } +} + +/// A layer's corner radii as `.borderRadius(...)` (uniform or per corner). +fn ark_radius(n: &Node, mods: &mut Vec) { + if let Some(r) = n.corners.uniform() { + if r > 0.0 { + mods.push(format!(".borderRadius({})", num(r))); + } + } else if n.corners.radii.iter().any(|r| *r > 0.0) { + let [tl, tr, br, bl] = n.corners.radii; + mods.push(format!(".borderRadius({{ topLeft: {}, topRight: {}, bottomRight: {}, bottomLeft: {} }})", num(tl), num(tr), num(br), num(bl))); + } +} + +/// ArkUI for a layer and its subtree at `depth`; `extra` attributes go last (a free child's +/// position). A layer a boolean parameter shows sits in an `if`. +pub(crate) fn arkui(ctx: &Ctx, id: NodeId, depth: usize, out: &mut String, extra: &[String]) { + let Some(n) = ctx.doc.node(id) else { return }; + if id != ctx.root + && let Some(p) = ctx.param(n, "visible") + { + let pad = indent(depth); + out.push_str(&format!("{pad}if (this.{}) {{\n", p.ident)); + arkui_layer(ctx, n, depth + 1, out, extra); + out.push_str(&format!("{pad}}}\n")); + return; + } + arkui_layer(ctx, n, depth, out, extra); +} + +fn arkui_layer(ctx: &Ctx, n: &Node, depth: usize, out: &mut String, extra: &[String]) { + let doc = ctx.doc; + let pad = indent(depth); + if ctx.too_deep(depth) { + out.push_str(&format!("{pad}// {} …\n", one_line(&n.name))); + return; + } + // Nested instances are calls; an instance swap parameter is a builder. + let call = match ctx.param(n, "mainComponent").filter(|_| n.id != ctx.root) { + Some(p) => Some(format!("{pad}this.{}()\n", p.ident)), + None => ctx.call(n, CodeLang::ArkUi, depth), + }; + if let Some(call) = call { + out.push_str(&call); + for m in extra { + out.push_str(&format!("{pad} {m}\n")); + } + return; + } + let mut mods: Vec = Vec::new(); + match &n.kind { + NodeKind::Text(t) => { + let text = ctx.param(n, "characters").map_or_else(|| literal(&t.characters, false), |p| format!("this.{}", p.ident)); + out.push_str(&format!("{pad}Text({text})\n")); + let s = &t.style; + mods.push(format!(".fontSize({})", num(s.font_size))); + mods.push(format!(".fontWeight({})", s.weight().clamp(100, 900))); + mods.push(format!(".fontFamily({})", literal(&s.font_family, false))); + if s.italic() { + mods.push(".fontStyle(FontStyle.Italic)".into()); + } + if let Some(c) = first_fill(n) { + mods.push(format!(".fontColor({})", ark_color(c))); + } + match s.line_height { + LineHeight::Pixels(v) => mods.push(format!(".lineHeight({})", num(v))), + LineHeight::Percent(p) => mods.push(format!(".lineHeight('{}%')", num(p))), + LineHeight::Auto => {} + } + match s.letter_spacing { + LetterSpacing::Pixels(v) if v != 0.0 => mods.push(format!(".letterSpacing({})", num(v))), + LetterSpacing::Percent(p) if p != 0.0 => mods.push(format!(".letterSpacing('{}%')", num(p))), + _ => {} + } + match t.align_h { + TextAlignH::Left => {} + TextAlignH::Center => mods.push(".textAlign(TextAlign.Center)".into()), + TextAlignH::Right => mods.push(".textAlign(TextAlign.End)".into()), + TextAlignH::Justified => mods.push(".textAlign(TextAlign.JUSTIFY)".into()), + } + match s.case { + TextCase::Upper => mods.push(".textCase(TextCase.UpperCase)".into()), + TextCase::Lower => mods.push(".textCase(TextCase.LowerCase)".into()), + _ => {} + } + match s.decoration { + TextDecoration::Underline => mods.push(".decoration({ type: TextDecorationType.Underline })".into()), + TextDecoration::Strikethrough => mods.push(".decoration({ type: TextDecorationType.LineThrough })".into()), + TextDecoration::None => {} + } + } + NodeKind::Ellipse { .. } => { + out.push_str(&format!("{pad}Ellipse({{ width: {}, height: {} }})\n", num(n.width), num(n.height))); + if let Some(c) = first_fill(n) { + mods.push(format!(".fill({})", ark_color(c))); + } + if let Some(c) = stroke_color(n) { + mods.push(format!(".stroke({})", ark_color(c))); + mods.push(format!(".strokeWidth({})", num(n.stroke.weight))); + } + } + NodeKind::Rectangle => { + out.push_str(&format!("{pad}Column()\n")); + if let Some(c) = first_fill(n) { + mods.push(format!(".backgroundColor({})", ark_color(c))); + } + ark_radius(n, &mut mods); + mods.push(format!(".width({})", num(n.width))); + mods.push(format!(".height({})", num(n.height))); + } + k if k.is_frame_like() || matches!(k, NodeKind::Group) => { + let open = match n.layout.as_ref().map(|l| (l.mode, l)) { + Some((LayoutMode::Vertical, l)) => format!("Column({{ space: {} }})", num(l.gap)), + Some((_, l)) => format!("Row({{ space: {} }})", num(l.gap)), + None => "Stack({ alignContent: Alignment.TopStart })".to_string(), + }; + out.push_str(&format!("{pad}{open} {{\n")); + match ctx.param(n, "slot") { + // A slot shows the instance's content, or else the main's (its default builder). + Some(p) => out.push_str(&format!("{pad} this.{}()\n", p.ident)), + None => { + for c in ctx.kids(n) { + // Free children sit at their position inside a Stack. + let pos: Vec = match doc.node(c).filter(|_| n.layout.is_none()) { + Some(cn) => { + let [_, _, _, _, x, y] = cn.transform.as_coeffs(); + vec![format!(".position({{ x: {}, y: {} }})", num(x), num(y))] + } + None => Vec::new(), + }; + arkui(ctx, c, depth + 1, out, &pos); + } + } + } + out.push_str(&format!("{pad}}}\n")); + if let Some(l) = &n.layout { + let [t, r, b, lft] = l.padding; + if [t, r, b, lft].iter().any(|v| *v > 0.0) { + mods.push(format!(".padding({{ top: {}, right: {}, bottom: {}, left: {} }})", num(t), num(r), num(b), num(lft))); + } + let justify = match l.main_align { + MainAlign::Min => None, + MainAlign::Center => Some("FlexAlign.Center"), + MainAlign::Max => Some("FlexAlign.End"), + MainAlign::SpaceBetween => Some("FlexAlign.SpaceBetween"), + MainAlign::SpaceAround => Some("FlexAlign.SpaceAround"), + MainAlign::SpaceEvenly => Some("FlexAlign.SpaceEvenly"), + }; + if let Some(j) = justify { + mods.push(format!(".justifyContent({j})")); + } + let cross = match l.cross_align { + CrossAlign::Min => None, + CrossAlign::Center => Some("Center"), + CrossAlign::Max => Some(if l.mode == LayoutMode::Vertical { "End" } else { "Bottom" }), + CrossAlign::Baseline => None, + }; + if let Some(c) = cross { + let ty = if l.mode == LayoutMode::Vertical { "HorizontalAlign" } else { "VerticalAlign" }; + mods.push(format!(".alignItems({ty}.{c})")); + } + } + mods.push(format!(".width({})", num(n.width))); + mods.push(format!(".height({})", num(n.height))); + if let Some(c) = first_fill(n) { + mods.push(format!(".backgroundColor({})", ark_color(c))); + } + if radius(n) > 0.0 { + mods.push(".clip(true)".into()); + } + ark_radius(n, &mut mods); + } + _ => { + out.push_str(&format!("{pad}// {}: export as an image asset\n{pad}Image($r('app.media.asset'))\n", n.kind.label())); + mods.push(format!(".width({})", num(n.width))); + mods.push(format!(".height({})", num(n.height))); + } + } + // Ellipses take their stroke as a shape attribute (above). + if !matches!(n.kind, NodeKind::Ellipse { .. }) + && let Some(c) = stroke_color(n) + { + mods.push(format!(".border({{ width: {}, color: {} }})", num(n.stroke.weight), ark_color(c))); + } + if let Some(s) = drop_shadow(n) { + mods.push(format!( + ".shadow({{ radius: {}, color: {}, offsetX: {}, offsetY: {} }})", + num(s.radius / 2.0), + ark_color(s.color), + num(s.offset.0), + num(s.offset.1) + )); + } + if n.opacity < 1.0 { + mods.push(format!(".opacity({})", num(f64::from(n.opacity)))); + } + let rot = figcraft_geom::rotation_degrees(n.transform); + if rot.abs() > 0.01 && rot.is_finite() { + mods.push(format!(".rotate({{ angle: {} }})", num(-rot))); + } + mods.extend(extra.iter().cloned()); + for m in mods { + out.push_str(&format!("{pad} {m}\n")); + } +} + #[cfg(test)] mod tests { use super::*; @@ -1174,6 +1394,33 @@ mod tests { assert!(s.execute("inspect.code", &json!({"id": f, "language": "cobol"})).is_err()); } + #[test] + fn arkui_for_an_auto_layout_card() { + let mut s = Session::new(); + let f = card(&mut s); + let doc = s.doc().unwrap(); + let ark = code_for(doc, f, CodeLang::ArkUi); + for want in [ + "Row({ space: ", + "Text(\"Say \\\"hi\\\" $5\\nnow\")", + ".fontSize(", + ".fontWeight(", + "Ellipse({ width: 24, height: 24 })", + ".backgroundColor('#FFFFFF')", + ".borderRadius(12)", + ".width(", + ".height(100)", + ".clip(true)", + ] { + assert!(ark.contains(want), "ArkUI has {want:?}:\n{ark}"); + } + // Through the command, and "arkts" reads as ArkUI too. + let v = s.execute("inspect.code", &json!({"id": f, "language": "arkui"})).unwrap(); + assert_eq!(v["code"].as_str().unwrap(), ark); + assert_eq!(v["language"], "arkui"); + assert_eq!(s.execute("inspect.code", &json!({"id": f, "language": "arkts"})).unwrap()["language"], "arkui"); + } + #[test] fn free_children_get_offsets_and_deep_trees_are_capped() { let mut s = Session::new(); @@ -1189,6 +1436,9 @@ mod tests { assert!(sw.contains("…"), "depth capped"); let kt = code_for(doc, root, CodeLang::Compose); assert!(kt.contains("Modifier.offset(7.dp, 9.dp)")); + let ark = code_for(doc, root, CodeLang::ArkUi); + assert!(ark.contains(".position({ x: 7, y: 9 })"), "{ark}"); + assert!(ark.contains("…"), "depth capped"); assert!(code_for(doc, NodeId(999_999), CodeLang::Css).is_empty()); } @@ -1204,7 +1454,7 @@ mod tests { .unwrap(); } let doc = s.doc().unwrap(); - for lang in [CodeLang::SwiftUi, CodeLang::Compose] { + for lang in [CodeLang::SwiftUi, CodeLang::Compose, CodeLang::ArkUi] { let code = code_for(doc, root, lang); assert!(code.contains("// deep evil() more() …\n"), "{code}"); for line in code.lines() { diff --git a/crates/engine/src/component_codegen.rs b/crates/engine/src/component_codegen.rs index 1416b15f9..c52693c5d 100644 --- a/crates/engine/src/component_codegen.rs +++ b/crates/engine/src/component_codegen.rs @@ -1,16 +1,17 @@ -//! Component code: a component (or component set) becomes a React, Leptos, SwiftUI or Jetpack -//! Compose component whose properties are its parameters (a variant property → a union or enum, boolean → -//! a flag showing the layers bound to it, text → a string, instance swap → a view parameter, slot → -//! optional content), and an instance becomes a call passing the values it sets. Variants of a set -//! share one definition (the set's default variant); in React and Leptos their differences become CSS -//! rules on `data-*` attributes. Returned by `inspect.componentCode` and used by `inspect.code`. A component -//! connected to code (see [`crate::code_connect`]) shows its real snippet instead. +//! Component code: a component (or component set) becomes a React, Leptos, SwiftUI, Jetpack +//! Compose or ArkUI component whose properties are its parameters (a variant property → a union or +//! enum, boolean → a flag showing the layers bound to it, text → a string, instance swap → a view +//! parameter, slot → optional content), and an instance becomes a call passing the values it sets. +//! Variants of a set share one definition (the set's default variant); in React and Leptos their +//! differences become CSS rules on `data-*` attributes. Returned by `inspect.componentCode` and +//! used by `inspect.code`. A component connected to code (see [`crate::code_connect`]) shows its +//! real snippet instead. use figcraft_doc::*; use serde_json::{Value, json}; use crate::cmd::CommandSpec; -use crate::codegen::{CodeLang, Ctx, Markup, class_name, compose, indent, literal, swift}; +use crate::codegen::{CodeLang, Ctx, Markup, arkui, class_name, compose, indent, literal, swift}; use crate::components::{prop_default_value, slot_edited, slots_of, variant_options, variant_props, variant_set}; use crate::params::*; use crate::{bad, spec}; @@ -67,14 +68,14 @@ pub fn specs() -> Vec { vec![spec!( "inspect.componentCode", "Component code", - "{id? (component, set or instance; default the selection), language?: react|leptos|swiftui|compose (default react)} → {component, name, set, properties: [{name, param, type, default, value? (instances)}], definition, usage? (instances; the connected snippet when the component is connected to code), connected: {importPath, name, template, import, code} | null}", + "{id? (component, set or instance; default the selection), language?: react|leptos|swiftui|compose|arkui (default react)} → {component, name, set, properties: [{name, param, type, default, value? (instances)}], definition, usage? (instances; the connected snippet when the component is connected to code), connected: {importPath, name, template, import, code} | null}", false, |s, p| { let cmd = "inspect.componentCode"; let id = targets(s, p).first().copied().ok_or_else(|| bad(cmd, "select a component or instance"))?; let lang = match string(p, "language").map(|l| CodeLang::from_id(&l)) { - Some(Some(l @ (CodeLang::React | CodeLang::Leptos | CodeLang::SwiftUi | CodeLang::Compose))) => l, - Some(_) => return Err(bad(cmd, "language: react|leptos|swiftui|compose")), + Some(Some(l @ (CodeLang::React | CodeLang::Leptos | CodeLang::SwiftUi | CodeLang::Compose | CodeLang::ArkUi))) => l, + Some(_) => return Err(bad(cmd, "language: react|leptos|swiftui|compose|arkui")), None => CodeLang::React, }; let doc = s.doc()?; @@ -107,9 +108,9 @@ pub fn specs() -> Vec { )] } -/// Code for any layer in React, Leptos, SwiftUI or Compose: an instance's call and its component's -/// definition, a component's (or set's) definition, or the layer tree (React and Leptos wrap it -/// in a function component). +/// Code for any layer in React, Leptos, SwiftUI, Compose or ArkUI: an instance's call and its +/// component's definition, a component's (or set's) definition, or the layer tree (React and +/// Leptos wrap it in a function component). pub fn code(doc: &Document, id: NodeId, lang: CodeLang) -> String { let Some(n) = doc.node(id) else { return String::new() }; if let Some(code) = crate::code_connect::link(doc, id, lang).and_then(|l| crate::code_connect::connected_code(doc, id, lang, l)) { @@ -129,6 +130,11 @@ pub fn code(doc: &Document, id: NodeId, lang: CodeLang) -> String { swift(&Ctx::new(doc, id), id, 0, &mut out, &[]); out } + CodeLang::ArkUi => { + let mut out = String::new(); + arkui(&Ctx::new(doc, id), id, 0, &mut out, &[]); + out + } _ => { let mut out = String::new(); compose(&Ctx::new(doc, id), id, 0, &mut out); @@ -289,7 +295,7 @@ const RESERVED: &[&str] = &[ "yield", ]; -/// Types the generated SwiftUI and Compose code names: a variant enum may not shadow them. +/// Types the generated SwiftUI, Compose and ArkUI code names: a variant enum may not shadow them. const TYPES: &[&str] = &[ "Alignment", "AnyView", @@ -298,6 +304,7 @@ const TYPES: &[&str] = &[ "Boolean", "Box", "CaseIterable", + "Circle", "CircleShape", "Color", "Column", @@ -306,21 +313,30 @@ const TYPES: &[&str] = &[ "EdgeInsets", "Ellipse", "EmptyView", + "FlexAlign", "Font", + "FontStyle", "FontWeight", "Group", "HStack", + "HorizontalAlign", "Image", "Modifier", + "Rect", "RectangleShape", "RoundedCornerShape", "RoundedRectangle", "Row", "Shape", + "Stack", "String", "Text", + "TextAlign", + "TextCase", + "TextDecorationType", "Unit", "VStack", + "VerticalAlign", "View", "ZStack", ]; @@ -482,6 +498,9 @@ pub(crate) fn value_expr(doc: &Document, c: &Component, p: &Param, value: &Value (Some(t), CodeLang::Leptos) => format!("|| view! {{ <{} /> }}", rust_type(&t)), (None, CodeLang::Leptos) => "|| ()".into(), (Some(t), CodeLang::SwiftUi) => format!("AnyView({t}())"), + // ArkUI takes a builder: `@BuilderParam` is a `() => void`. + (Some(t), CodeLang::ArkUi) => format!("() => {{ {t}() }}"), + (None, CodeLang::ArkUi) => "() => {}".into(), (Some(t), _) => format!("{{ {t}() }}"), (None, CodeLang::React) => "null".into(), (None, CodeLang::SwiftUi) => "AnyView(EmptyView())".into(), @@ -561,6 +580,11 @@ pub fn usage(doc: &Document, id: NodeId, lang: CodeLang, depth: usize) -> Option format!("{pad}<{t}{attrs} />\n") } CodeLang::SwiftUi => format!("{pad}{t}({})\n", args.iter().map(|(n, e, _)| format!("{n}: {e}")).collect::>().join(", ")), + CodeLang::ArkUi => { + let list = args.iter().map(|(n, e, _)| format!("{n}: {e}")).collect::>().join(", "); + // ArkTS calls take an object literal, or nothing at all. + if list.is_empty() { format!("{pad}{t}()\n") } else { format!("{pad}{t}({{ {list} }})\n") } + } _ => format!("{pad}{t}({})\n", args.iter().map(|(n, e, _)| format!("{n} = {e}")).collect::>().join(", ")), }) } @@ -593,6 +617,13 @@ fn slot_content(doc: &Document, slot: NodeId, lang: CodeLang, depth: usize) -> S } format!("AnyView(Group {{\n{out}{}}})", indent(depth + 1)) } + CodeLang::ArkUi => { + let mut out = String::new(); + for k in kids { + arkui(&ctx, k, depth + 2, &mut out, &[]); + } + format!("() => {{\n{out}{}}}", indent(depth + 1)) + } _ => { let mut out = String::new(); for k in kids { @@ -611,6 +642,7 @@ pub fn definition(doc: &Document, c: &Component, lang: CodeLang) -> String { CodeLang::SwiftUi => swift_definition(doc, c), CodeLang::Compose => compose_definition(doc, c), CodeLang::Leptos => leptos(doc, c), + CodeLang::ArkUi => arkui_definition(doc, c), _ => react(doc, c), } } @@ -807,3 +839,67 @@ fn compose_definition(doc: &Document, c: &Component) -> String { out.push_str("}\n"); out } + +/// An ArkUI (`@Component`) struct: variant enums, `@Prop` parameters, a default builder for each +/// instance swap and slot, and the `build` body. +fn arkui_definition(doc: &Document, c: &Component) -> String { + let ctx = Ctx { doc, root: c.comp, comp: Some(c), base: 1 }; + let mut out = String::new(); + for p in &c.params { + if let ParamKind::Variant(opts) = &p.kind { + out.push_str(&format!("enum {} {{ {} }}\n\n", enum_name(c, p, false), cases(opts, false).join(", "))); + } + } + // A default builder per instance swap or slot, named apart from every parameter. + let mut used: Vec = c.params.iter().map(|p| p.ident.clone()).collect(); + let mut builders: Vec<(String, String)> = Vec::new(); + for p in &c.params { + if !matches!(p.kind, ParamKind::InstanceSwap | ParamKind::Slot) { + continue; + } + let base = format!("default{}Builder", capitalized(&p.ident)); + let name = (1..).map(|k| if k == 1 { base.clone() } else { format!("{base}{k}") }).find(|n| !used.contains(n)).unwrap_or(base); + used.push(name.clone()); + builders.push((p.ident.clone(), name)); + } + out.push_str("@Component\nexport struct "); + out.push_str(&c.type_name); + out.push_str(" {\n"); + for p in &c.params { + match &p.kind { + ParamKind::Variant(_) => { + out.push_str(&format!(" @Prop {}: {} = {}\n", p.ident, enum_name(c, p, false), value_expr(doc, c, p, &p.default, CodeLang::ArkUi))) + } + ParamKind::Boolean => out.push_str(&format!(" @Prop {}: boolean = {}\n", p.ident, p.default.as_bool().unwrap_or(false))), + ParamKind::Text => out.push_str(&format!(" @Prop {}: string = {}\n", p.ident, value_expr(doc, c, p, &p.default, CodeLang::ArkUi))), + ParamKind::InstanceSwap | ParamKind::Slot => { + let name = builders.iter().find(|(ident, _)| *ident == p.ident).map_or("", |(_, name)| name.as_str()); + out.push_str(&format!(" @BuilderParam {}: () => void = this.{name}\n", p.ident)); + } + } + } + for (ident, name) in &builders { + let Some(p) = c.params.iter().find(|p| p.ident == *ident) else { continue }; + out.push_str(&format!("\n @Builder\n {name}() {{\n")); + match &p.kind { + ParamKind::InstanceSwap => { + if let Some(t) = id_of(&p.default).and_then(|i| component_type(doc, i)) { + out.push_str(&format!(" {t}()\n")); + } + } + ParamKind::Slot => { + let layer = slots_of(doc, c.comp).into_iter().find(|(_, slot)| slot == &p.prop).map(|(layer, _)| layer); + let kids = layer.and_then(|l| doc.node(l)).map(|n| ctx.kids(n)).unwrap_or_default(); + for k in kids { + arkui(&ctx, k, 2, &mut out, &[]); + } + } + _ => {} + } + out.push_str(" }\n"); + } + out.push_str("\n build() {\n"); + arkui(&ctx, c.comp, 2, &mut out, &[]); + out.push_str(" }\n}\n"); + out +} diff --git a/crates/engine/src/component_codegen_tests.rs b/crates/engine/src/component_codegen_tests.rs index 4cd3d7760..dc2797244 100644 --- a/crates/engine/src/component_codegen_tests.rs +++ b/crates/engine/src/component_codegen_tests.rs @@ -71,6 +71,17 @@ fn components_take_their_properties_as_parameters() { for want in ["@Composable\nfun Card(", " showDot: Boolean = true,", " title: String = \"Hello\",", "if (showDot) {", "text = title,"] { assert!(kt.contains(want), "Compose has {want:?}:\n{kt}"); } + let ark = code(&mut s, c, "arkui"); + for want in [ + "@Component\nexport struct Card {", + " @Prop showDot: boolean = true", + " @Prop title: string = \"Hello\"", + " build() {", + " if (this.showDot) {", + "Text(this.title)", + ] { + assert!(ark.contains(want), "ArkUI has {want:?}:\n{ark}"); + } let leptos = code(&mut s, c, "leptos"); for want in [ "use leptos::prelude::*;\n\n#[component]\npub fn Card(\n", @@ -117,12 +128,14 @@ fn instances_are_calls_passing_the_values_they_set() { assert!(react.contains("export function Card({")); assert_eq!(component_code(&mut s, i, "swiftui")["usage"], "Card(showDot: false, title: \"Buy\")\n"); assert_eq!(component_code(&mut s, i, "compose")["usage"], "Card(showDot = false, title = \"Buy\")\n"); + assert_eq!(component_code(&mut s, i, "arkui")["usage"], "Card({ showDot: false, title: \"Buy\" })\n"); assert_eq!(component_code(&mut s, i, "leptos")["usage"], "\n"); // Text that needs escaping is an expression in JSX and escaped per language. ex(&mut s, "instance.setProperties", json!({"ids": [i], "properties": {"Title": "Say \"hi\" $5\nnow"}})); assert_eq!(component_code(&mut s, i, "react")["usage"], "\n"); assert_eq!(component_code(&mut s, i, "swiftui")["usage"], "Card(showDot: false, title: \"Say \\\"hi\\\" $5\\nnow\")\n"); assert_eq!(component_code(&mut s, i, "compose")["usage"], "Card(showDot = false, title = \"Say \\\"hi\\\" \\$5\\nnow\")\n"); + assert_eq!(component_code(&mut s, i, "arkui")["usage"], "Card({ showDot: false, title: \"Say \\\"hi\\\" $5\\nnow\" })\n"); assert_eq!(component_code(&mut s, i, "leptos")["usage"], "\n"); } @@ -173,6 +186,9 @@ fn variant_sets_share_one_definition() { let kt = code(&mut s, set, "compose"); assert!(kt.contains("enum class ButtonState { Default, Hover }"), "{kt}"); assert!(kt.contains(" state: ButtonState = ButtonState.Default,"), "{kt}"); + let ark = code(&mut s, set, "arkui"); + assert!(ark.contains("enum ButtonState { Default, Hover }"), "{ark}"); + assert!(ark.contains(" @Prop state: ButtonState = ButtonState.Default"), "{ark}"); let leptos = code(&mut s, set, "leptos"); for want in [ "#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]\npub enum ButtonState {\n #[default]\n Default,\n Hover,\n}", @@ -189,6 +205,7 @@ fn variant_sets_share_one_definition() { assert_eq!(component_code(&mut s, i, "react")["usage"], "

ArtCraft
Made by the
ArtCraft team and community. From 31d6566f3b02d915a16ecb559ac028193a3833d4 Mon Sep 17 00:00:00 2001 From: leandrodslv <205958219+leandrodslv@users.noreply.github.com> Date: Sun, 18 Oct 2026 14:27:54 +0200 Subject: [PATCH 271/817] i18n(fr): land the native-speaker wording fixes from the draft review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #783 completed the French catalog to every current string, superseding the translations added in #681. This keeps only the ~50 UI strings and 8 command labels whose wording a native French speaker corrected during that review (keyboard focus, "Off" as "Désactivé", blend modes, stroke join, spotlight, the no-break space before : ; ? !…), applied on top of #783. The draft status is unchanged. Co-Authored-By: Claude Sonnet 5 --- crates/ui-egui/locales/fr.toml | 116 ++++++++++++++++----------------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 5edf1a624..ec080d67e 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -148,7 +148,7 @@ status = "draft — needs native review" "Back to assets" = "Retour aux ressources" "Back to current" = "Revenir à l’actuelle" "Back to styles" = "Retour aux styles" -"Back to the canvas from a focused region" = "Revenir au canevas depuis une région active" +"Back to the canvas from a focused region" = "Revenir au canevas depuis une région qui a le focus" "Back to the current version" = "Revenir à la version actuelle" "Back to the values the font style implies" = "Revenir aux valeurs du style de police" "Background" = "Arrière-plan" @@ -184,7 +184,7 @@ status = "draft — needs native review" "Branch {name}" = "Branche {name}" "Branches" = "Branches" "Bring forward" = "Avancer" -"Bring the main file's changes into the branch" = "Apporte dans la branche les modifications du fichier principal" +"Bring the main file's changes into the branch" = "Apporter dans la branche les modifications du fichier principal" "Bring to front" = "Mettre au premier plan" "Bristle" = "Soies" "Browse" = "Parcourir" @@ -252,8 +252,8 @@ status = "draft — needs native review" "Collection" = "Collection" "Collections" = "Collections" "Color" = "Couleur" -"Color burn" = "Brûlage de couleur" -"Color dodge" = "Éclaircissement de couleur" +"Color burn" = "Densité couleur +" +"Color dodge" = "Densité couleur −" "Color format" = "Format de couleur" "Color profile" = "Profil colorimétrique" "Color styles" = "Styles de couleur" @@ -317,8 +317,8 @@ status = "draft — needs native review" "Corner radius" = "Rayon d’angle" "Corner smoothing" = "Lissage des angles" "Couldn't download the variables" = "Impossible de télécharger les variables" -"Couldn't reach {server}: showing what this computer remembers." = "Impossible de joindre {server} : affichage de ce dont cet ordinateur se souvient." -"Couldn't save automatically: {error}" = "Impossible d’enregistrer automatiquement : {error}" +"Couldn't reach {server}: showing what this computer remembers." = "Impossible de joindre {server} : affichage de ce dont cet ordinateur se souvient." +"Couldn't save automatically: {error}" = "Impossible d’enregistrer automatiquement : {error}" "Count" = "Nombre" "Create" = "Créer" "Create a variable collection first" = "Créez d’abord une collection de variables" @@ -446,14 +446,14 @@ status = "draft — needs native review" "Empty" = "Vide" "End" = "Fin" "End point" = "Point final" -"Ends the session; everyone keeps their copy" = "Met fin à la session ; chacun conserve sa copie" +"Ends the session; everyone keeps their copy" = "Met fin à la session ; chacun conserve sa copie" "Enter" = "Entrée" "Enter the address of a figcraft-server and press Browse to see the plugins it offers." = "Saisissez l’adresse d’un figcraft-server et appuyez sur Parcourir pour voir les plugins qu’il propose." "Enter to save · Esc to cancel" = "Entrée pour enregistrer · Échap pour annuler" "Eraser" = "Gomme" "Esc" = "Échap" "Essential" = "Essentiels" -"Every conflict has a choice." = "Chaque conflit a un choix." +"Every conflict has a choice." = "Un choix est fait pour chaque conflit." "Every top-level frame already starts a flow" = "Chaque cadre de premier niveau démarre déjà un flux" "Exact opacity (4 then 5: 45%)" = "Opacité exacte (4 puis 5 : 45 %)" "Exclude" = "Exclure" @@ -471,9 +471,9 @@ status = "draft — needs native review" "Export variables" = "Exporter les variables" "Export {name}" = "Exporter {name}" "Export {n} layers" = { one = "Exporter {n} calque", other = "Exporter {n} calques" } -"Exported {file}" = "Exporté : {file}" +"Exported {file}" = "{file} exporté" "Exported {name}" = "{name} exporté" -"Exported {name}; {n} kinds of content were left out" = { one = "{name} exporté ; {n} type de contenu a été omis", other = "{name} exporté ; {n} types de contenu ont été omis" } +"Exported {name}; {n} kinds of content were left out" = { one = "{name} exporté ; {n} type de contenu a été omis", other = "{name} exporté ; {n} types de contenu ont été omis" } "Exported {n} files" = { one = "{n} fichier exporté", other = "{n} fichiers exportés" } "Export…" = "Exporter…" "Expose properties to instances" = "Exposer les propriétés aux instances" @@ -493,7 +493,7 @@ status = "draft — needs native review" "File name" = "Nom du fichier" "File not found" = "Fichier introuvable" "File published" = "Fichier publié" -"Files aren't end-to-end encrypted: the server's operator can read them." = "Les fichiers ne sont pas chiffrés de bout en bout : l’opérateur du serveur peut les lire." +"Files aren't end-to-end encrypted: the server's operator can read them." = "Les fichiers ne sont pas chiffrés de bout en bout : l’opérateur du serveur peut les lire." "Files nobody opens for {n} days are deleted." = { one = "Les fichiers que personne n’ouvre pendant {n} jour sont supprimés.", other = "Les fichiers que personne n’ouvre pendant {n} jours sont supprimés." } "Fill" = "Remplissage" "Fill (fr)" = "Remplir (fr)" @@ -571,14 +571,14 @@ status = "draft — needs native review" "Groups" = "Groupes" "Gutter" = "Gouttière" "Hand tool" = "Outil Main" -"Hanging list" = "Liste en retrait" +"Hanging list" = "Liste à retrait suspendu" "Hanging punctuation" = "Ponctuation en débord" "Hard light" = "Lumière dure" "Height" = "Hauteur" "Help" = "Aide" "Help and resources" = "Aide et ressources" "Help page" = "Page d’aide" -"Here: {names}" = "Présents : {names}" +"Here: {names}" = "Présents : {names}" "Hidden" = "Masqué" "Hide contents" = "Masquer le contenu" "Hide from publishing" = "Exclure de la publication" @@ -668,7 +668,7 @@ status = "draft — needs native review" "Joined" = "Connecté" "Joined {file}" = "Connecté à {file}" "Joining…" = "Connexion…" -"Join|stroke" = "Jointure" +"Join|stroke" = "Jonction" "Jul" = "juil." "Jun" = "juin" "Just now" = "À l’instant" @@ -693,7 +693,7 @@ status = "draft — needs native review" "Layer name" = "Nom du calque" "Layers" = "Calques" "Layers in an instance take their position from the main component" = "Les calques d’une instance prennent leur position du composant principal" -"Layout" = "Disposition" +"Layout" = "Mise en page" "Layout grid" = "Grille de mise en page" "Layout grid settings" = "Réglages de la grille de mise en page" "Layout grids" = "Grilles de mise en page" @@ -761,9 +761,9 @@ status = "draft — needs native review" "Maximize" = "Agrandir" "May" = "mai" "Measure to the selection" = "Mesurer jusqu’à la sélection" -"Merge into main" = "Fusionner dans le principal" +"Merge into main" = "Fusionner dans le fichier principal" "Merge regions" = "Fusionner les régions" -"Merge the branch into the main file (one undo step) and archive it" = "Fusionne la branche dans le fichier principal (une seule étape d’annulation) et l’archive" +"Merge the branch into the main file (one undo step) and archive it" = "Fusionner la branche dans le fichier principal (une seule étape d’annulation) et l’archiver" "Merged" = "Fusionnée" "Merged PRs" = "PR fusionnées" "Min H" = "H min." @@ -784,7 +784,7 @@ status = "draft — needs native review" "Mobile app" = "Application mobile" "Mode" = "Mode" "Model" = "Modèle" -"Models" = "Modèles" +"Models" = "Modèles d’IA" "Mono" = "Mono" "More" = "Plus" "More instance actions" = "Autres actions d’instance" @@ -797,8 +797,8 @@ status = "draft — needs native review" "Move column left" = "Déplacer la colonne à gauche" "Move column right" = "Déplacer la colonne à droite" "Move down" = "Descendre" -"Move in" = "Entrée" -"Move out" = "Sortie" +"Move in" = "Déplacer vers l’intérieur" +"Move out" = "Déplacer vers l’extérieur" "Move tools" = "Outils de déplacement" "Move up" = "Monter" "Moved to {name}" = "Déplacé vers {name}" @@ -813,7 +813,7 @@ status = "draft — needs native review" "New design file" = "Nouveau fichier de design" "Newest first" = "Plus récent d’abord" "Next frame" = "Cadre suivant" -"Next or previous control in the focused region" = "Contrôle suivant ou précédent dans la région active" +"Next or previous control in the focused region" = "Contrôle suivant ou précédent dans la région qui a le focus" "Next ready for dev" = "Prêt pour le dev suivant" "Next size option" = "Option de taille suivante" "No assets: no export settings, icons or images. Add export settings in the Design tab." = "Aucune ressource : ni réglage d’exportation, ni icône, ni image. Ajoutez des réglages d’exportation dans l’onglet Design." @@ -832,7 +832,7 @@ status = "draft — needs native review" "No contributor data was built into this copy." = "Cette copie ne contient aucune donnée de contributeurs." "No device" = "Aucun appareil" "No fonts match" = "Aucune police ne correspond" -"No join code here (the server is older than join codes, or this address can't be put in one): share the link instead." = "Pas de code d’accès ici (le serveur est antérieur aux codes d’accès, ou cette adresse ne tient pas dans un code) : partagez plutôt le lien." +"No join code here (the server is older than join codes, or this address can't be put in one): share the link instead." = "Pas de code d’accès ici (le serveur est antérieur aux codes d’accès, ou cette adresse ne tient pas dans un code) : partagez plutôt le lien." "No layer changes to show." = "Aucune modification de calque à afficher." "No libraries yet. Add a .figcraft file that was published as a library, or paste a team library's link." = "Aucune bibliothèque pour l’instant. Ajoutez un fichier .figcraft publié en tant que bibliothèque, ou collez le lien d’une bibliothèque d’équipe." "No list" = "Aucune liste" @@ -846,7 +846,7 @@ status = "draft — needs native review" "No number variables fit here." = "Aucune variable numérique ne convient ici." "No number variables yet. Create them in Local variables." = "Aucune variable numérique pour l’instant. Créez-en dans Variables locales." "No other pages" = "Aucune autre page" -"No paints" = "Aucune peinture" +"No paints" = "Aucun remplissage" "No plugins on {server}." = "Aucun plugin sur {server}." "No plugins yet. Import a development plugin from its figcraft-plugin.json." = "Aucun plugin pour l’instant. Importez un plugin en développement depuis son figcraft-plugin.json." "No preferred components" = "Aucun composant préféré" @@ -889,7 +889,7 @@ status = "draft — needs native review" "Numbered list" = "Liste numérotée" "Object" = "Objet" "Oct" = "oct." -"Off" = "Non" +"Off" = "Désactivé" "Offered first when filling the slot (any content is allowed)" = "Proposés en premier pour remplir l’emplacement (tout contenu est autorisé)" "Offered first when swapping the instance (any component is allowed)" = "Proposés en premier pour permuter l’instance (tout composant est autorisé)" "Offset" = "Décalage" @@ -900,7 +900,7 @@ status = "draft — needs native review" "One announcement in five common sizes: square, portrait, story, link and banner" = "Une annonce en cinq formats courants : carré, portrait, story, lien et bannière" "Online" = "En ligne" "Online files" = "Fichiers en ligne" -"Online sharing is off: files are shared on the local network only." = "Le partage en ligne est désactivé : les fichiers ne sont partagés que sur le réseau local." +"Online sharing is off: files are shared on the local network only." = "Le partage en ligne est désactivé : les fichiers ne sont partagés que sur le réseau local." "Only the first changed layers are listed." = "Seuls les premiers calques modifiés sont listés." "Only the first {n} changed layers are listed." = "Seuls les {n} premiers calques modifiés sont listés." "Only your threads" = "Vos fils uniquement" @@ -930,7 +930,7 @@ status = "draft — needs native review" "Order" = "Ordre" "Other" = "Autre" "Other apps may not open every .fig file exported here." = "D’autres applications risquent de ne pas ouvrir tous les fichiers .fig exportés ici." -"Others lose access and keep their copy; the file stays on the server for you" = "Les autres perdent l’accès et conservent leur copie ; le fichier reste sur le serveur pour vous" +"Others lose access and keep their copy; the file stays on the server for you" = "Les autres perdent l’accès et conservent leur copie ; le fichier reste sur le serveur pour vous" "Others type this under Share ▸ Join with a code" = "Les autres le saisissent dans Partager ▸ Rejoindre avec un code" "Outline stroke" = "Convertir le contour en tracé" "Outline text" = "Convertir le texte en tracés" @@ -973,7 +973,7 @@ status = "draft — needs native review" "Pen" = "Plume" "Pencil" = "Crayon" "People in this file" = "Personnes dans ce fichier" -"People join from anywhere with a code. The file is kept on {server} while you share it." = "On vous rejoint de partout avec un code. Le fichier est conservé sur {server} tant que vous le partagez." +"People join from anywhere with a code. The file is kept on {server} while you share it." = "Les personnes vous rejoignent de partout avec un code. Le fichier est conservé sur {server} tant que vous le partagez." "People on your network join with a code. Nothing goes through a server." = "Les personnes de votre réseau vous rejoignent avec un code. Rien ne passe par un serveur." "Phone" = "Téléphone" "Pick color" = "Prélever une couleur" @@ -1047,7 +1047,7 @@ status = "draft — needs native review" "Ratio" = "Rapport" "Reading the library…" = "Lecture de la bibliothèque…" "Ready for dev" = "Prêt pour le dev" -"Real name" = "Vrai nom" +"Real name" = "Nom réel" "Recent" = "Récents" "Recent files" = "Fichiers récents" "Recents" = "Récents" @@ -1080,9 +1080,9 @@ status = "draft — needs native review" "Remove text from path" = "Retirer le texte du tracé" "Remove the else and its actions" = "Retirer le « sinon » et ses actions" "Remove this condition and its actions" = "Retirer cette condition et ses actions" -"Remove this file from the server? It can't be shared or opened from there again. Your copy stays open here." = "Retirer ce fichier du serveur ? Il ne pourra plus être partagé ni ouvert depuis celui-ci. Votre copie reste ouverte ici." +"Remove this file from the server? It can't be shared or opened from there again. Your copy stays open here." = "Retirer ce fichier du serveur ? Il ne pourra plus être partagé ni ouvert depuis ce serveur. Votre copie reste ouverte ici." "Remove {name} from session" = "Retirer {name} de la session" -"Remove {name} from {server}?" = "Retirer {name} de {server} ?" +"Remove {name} from {server}?" = "Retirer {name} de {server} ?" "Removed" = "Supprimé" "Removed from the server" = "Retiré du serveur" "Removed since it was marked" = "Supprimé depuis le marquage" @@ -1113,7 +1113,7 @@ status = "draft — needs native review" "Reset to style" = "Revenir au style" "Reset to the inherited value" = "Revenir à la valeur héritée" "Resize by the nudge amount" = "Redimensionner du pas de décalage" -"Resize frames to the device's screen (or the window without a device): their constraints and auto layout respond" = "Redimensionne les cadres à l’écran de l’appareil (ou à la fenêtre sans appareil) : leurs contraintes et leur mise en page auto s’adaptent" +"Resize frames to the device's screen (or the window without a device): their constraints and auto layout respond" = "Redimensionner les cadres à l’écran de l’appareil (ou à la fenêtre sans appareil) : leurs contraintes et leur mise en page auto s’adaptent" "Resize to fit" = "Redimensionner au contenu" "Resizing" = "Redimensionnement" "Resolve" = "Résoudre" @@ -1186,7 +1186,7 @@ status = "draft — needs native review" "Select a frame to preview it" = "Sélectionnez un cadre pour le prévisualiser" "Select a layer to see its properties and code" = "Sélectionnez un calque pour voir ses propriétés et son code" "Select all" = "Tout sélectionner" -"Select all with same" = "Sélectionner tout ce qui a le même" +"Select all with same" = "Sélectionner par propriété commune" "Select layer" = "Sélectionner le calque" "Select layers and they space themselves as their content changes" = "Sélectionnez des calques et leur espacement s’ajuste quand leur contenu change" "Select layers to apply the style to" = "Sélectionnez les calques auxquels appliquer le style" @@ -1219,12 +1219,12 @@ status = "draft — needs native review" "Share with a code" = "Partager avec un code" "Share: live session, export" = "Partager : session en direct, exportation" "Shared" = "Partagé" -"Shared: copy its code from the file's menu" = "Partagé : copiez son code depuis le menu du fichier" -"Sharing a file needs the desktop app; here you can join one." = "Le partage d’un fichier nécessite l’application de bureau ; ici, vous pouvez en rejoindre un." -"Sharing on the local network (online sharing is off: no server is set in Preferences)." = "Partage sur le réseau local (le partage en ligne est désactivé : aucun serveur n’est défini dans les Préférences)." +"Shared: copy its code from the file's menu" = "Partagé : copiez son code depuis le menu du fichier" +"Sharing a file needs the desktop app; here you can join one." = "Le partage d’un fichier nécessite l’application de bureau ; ici, vous pouvez en rejoindre un." +"Sharing on the local network (online sharing is off: no server is set in Preferences)." = "Partage sur le réseau local (le partage en ligne est désactivé : aucun serveur n’est défini dans les Préférences)." "Sharing on your network · {people}" = "Partage sur votre réseau · {people}" "Sharing online · {people}" = "Partage en ligne · {people}" -"Sharing stopped: the file stays on the server, open only to you" = "Partage arrêté : le fichier reste sur le serveur, accessible à vous seul" +"Sharing stopped: the file stays on the server, open only to you" = "Partage arrêté : le fichier reste sur le serveur, accessible à vous seul" "Show" = "Afficher" "Show all templates" = "Afficher tous les modèles" "Show as grid" = "Afficher en grille" @@ -1281,7 +1281,7 @@ status = "draft — needs native review" "Spacing" = "Espacement" "Spam, stolen work, abuse…" = "Spam, travail volé, abus…" "Splay" = "Évasement" -"Spotlight me" = "Me mettre sous les projecteurs" +"Spotlight me" = "Faire suivre ma vue" "Spread" = "Étendue" "Square" = "Carré" "Standard" = "Standard" @@ -1303,7 +1303,7 @@ status = "draft — needs native review" "Stop following {name}" = "Ne plus suivre {name}" "Stop session" = "Arrêter la session" "Stop sharing" = "Arrêter le partage" -"Stop spotlighting" = "Quitter les projecteurs" +"Stop spotlighting" = "Arrêter de faire suivre ma vue" "Stop {n} {hex}" = "Arrêt {n} {hex}" "Stretch" = "Étirer" "Strikethrough" = "Barré" @@ -1357,7 +1357,7 @@ status = "draft — needs native review" "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é." -"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." = "Le fichier est supprimé du serveur : plus personne ne pourra l’ouvrir ni le rejoindre depuis celui-ci, et c’est irréversible. Les copies ouvertes restent à ceux qui les ont." +"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." = "Le fichier est supprimé du serveur : plus personne ne pourra l’ouvrir ni le rejoindre depuis ce serveur, et c’est irréversible. Les copies ouvertes restent à ceux qui les ont." "The file now holds another library" = "Le fichier contient désormais une autre bibliothèque" "The file now holds another library (\"{name}\")" = "Le fichier contient désormais une autre bibliothèque (« {name} »)" "The files you shared or published online from this computer. They stay on their server until you remove them." = "Les fichiers que vous avez partagés ou publiés en ligne depuis cet ordinateur. Ils restent sur leur serveur jusqu’à ce que vous les retiriez." @@ -1372,16 +1372,16 @@ status = "draft — needs native review" "This branch can't be reviewed: {e}" = "Impossible de relire cette branche : {e}" "This branch was merged or archived." = "Cette branche a été fusionnée ou archivée." "This computer only" = "Cet ordinateur uniquement" -"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." = "Cet ordinateur mémorise le jeton de propriétaire : le fichier se gère depuis la liste En ligne de l’écran d’accueil. Copiez-le pour gérer le fichier depuis un autre endroit : c’est un mot de passe pour ce fichier et il ne sera plus affiché." +"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." = "Cet ordinateur mémorise le jeton de propriétaire : le fichier se gère depuis la liste En ligne de l’écran d’accueil. Copiez-le pour gérer le fichier depuis un autre endroit : c’est un mot de passe pour ce fichier et il ne sera plus affiché." "This condition is edited as an expression" = "Cette condition se modifie en tant qu’expression" "This file" = "Ce fichier" "This file has unsaved changes" = "Ce fichier contient des modifications non enregistrées" "This file is on {server}, open only to you. Share it to let others in with a new code." = "Ce fichier est sur {server}, accessible à vous seul. Partagez-le pour laisser entrer d’autres personnes avec un nouveau code." "This frame is new on the branch." = "Ce cadre est nouveau dans la branche." "This frame isn't on the branch." = "Ce cadre n’est pas dans la branche." -"This server is open to the public: no key needed." = "Ce serveur est ouvert au public : aucune clé nécessaire." -"This server needs its key: add ?key=… to the address (`figcraft-server key` prints it on the server's machine)." = "Ce serveur exige sa clé : ajoutez ?key=… à l’adresse (`figcraft-server key` l’affiche sur la machine du serveur)." -"This server takes files only with its key: see Advanced." = "Ce serveur n’accepte les fichiers qu’avec sa clé : voir Avancé." +"This server is open to the public: no key needed." = "Ce serveur est ouvert au public : aucune clé nécessaire." +"This server needs its key: add ?key=… to the address (`figcraft-server key` prints it on the server's machine)." = "Ce serveur exige sa clé : ajoutez ?key=… à l’adresse (`figcraft-server key` l’affiche sur la machine du serveur)." +"This server takes files only with its key: see Advanced." = "Ce serveur n’accepte les fichiers qu’avec sa clé : voir Avancé." "Tidy up" = "Ranger" "Tile" = "Mosaïque" "Tile type" = "Type de mosaïque" @@ -1427,7 +1427,7 @@ status = "draft — needs native review" "Unsaved changes: save first, or close again with {key} to discard" = "Modifications non enregistrées : enregistrez d’abord ou fermez à nouveau avec {key} pour les abandonner" "Up" = "Haut" "Update" = "Mettre à jour" -"Update from main" = "Mettre à jour depuis le principal" +"Update from main" = "Mettre à jour depuis le fichier principal" "Update from selection" = "Mettre à jour depuis la sélection" "Update plugin" = "Mettre à jour le plugin" "Updated {components} and {styles}" = "{components} et {styles} mis à jour" @@ -1488,7 +1488,7 @@ status = "draft — needs native review" "Wedge" = "Coin" "Weight" = "Graisse" "What changed since it was marked ready for dev" = "Ce qui a changé depuis le marquage prêt pour le dev" -"What is wrong with this file? The server's operator gets your report." = "Qu’est-ce qui ne va pas avec ce fichier ? L’opérateur du serveur reçoit votre signalement." +"What is wrong with this file? The server's operator gets your report." = "Qu’est-ce qui ne va pas avec ce fichier ? L’opérateur du serveur reçoit votre signalement." "What it's for" = "À quoi il sert" "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." = "L’état d’origine de cette modification est inconnu : elle date d’avant que FigCraft ne conserve une copie des cadres prêts pour le dev. Résolvez la modification (ou marquez-la à nouveau comme prête) pour comparer à partir de maintenant." "What you try here changes this preview and the code below, not the file" = "Ce que vous essayez ici change cet aperçu et le code ci-dessous, pas le fichier" @@ -1510,9 +1510,9 @@ status = "draft — needs native review" "Yesterday" = "Hier" "You" = "Vous" "You'll get the shared file as a new tab and edit it together." = "Vous recevrez le fichier partagé dans un nouvel onglet et le modifierez ensemble." -"You're spotlighting: everyone follows your view" = "Vous êtes sous les projecteurs : tout le monde suit votre vue" +"You're spotlighting: everyone follows your view" = "Vous faites suivre votre vue : tout le monde vous suit" "Your copy of the file stays open" = "Votre copie du fichier reste ouverte" -"Your copy stays open; the file stays on the server" = "Votre copie reste ouverte ; le fichier reste sur le serveur" +"Your copy stays open; the file stays on the server" = "Votre copie reste ouverte ; le fichier reste sur le serveur" "Your name" = "Votre nom" "Your name in comments" = "Votre nom dans les commentaires" "Your system asks for reduced motion: animations stay off." = "Votre système demande de réduire les animations : elles restent désactivées." @@ -1662,11 +1662,11 @@ status = "draft — needs native review" "{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}, par défaut {default}. Double-cliquez sur le curseur pour revenir à la valeur du style ; Échap pendant le glissement annule." "{name} cleared from the list" = "{name} effacé de la liste" "{name} from {path}" = "{name} depuis {path}" -"{name} is forgotten on this computer; the file stays on {server}" = "{name} est oublié sur cet ordinateur ; le fichier reste sur {server}" +"{name} is forgotten on this computer; the file stays on {server}" = "{name} est oublié sur cet ordinateur ; le fichier reste sur {server}" "{name} is on the server." = "{name} est sur le serveur." -"{name} is spotlighting" = "{name} est sous les projecteurs" +"{name} is spotlighting" = "{name} fait suivre sa vue" "{name} was removed from the server" = "{name} a été retiré du serveur" -"{name} · deleted on main" = "{name} · supprimé dans le principal" +"{name} · deleted on main" = "{name} · supprimé dans le fichier principal" "{name} · deleted on the branch" = "{name} · supprimé dans la branche" "{name} · not published" = "{name} · non publié" "{name} · on a server" = "{name} · sur un serveur" @@ -1766,7 +1766,7 @@ status = "draft — needs native review" "branch.merge" = "Fusionner la branche" "branch.open" = "Ouvrir la branche" "branch.review" = "Relire la branche" -"branch.updateFromMain" = "Mettre à jour depuis le principal" +"branch.updateFromMain" = "Mettre à jour depuis le fichier principal" "codeConnect.export" = "Exporter les liaisons au code" "codeConnect.import" = "Importer les liaisons au code" "codeConnect.remove" = "Délier du code" @@ -1790,7 +1790,7 @@ status = "draft — needs native review" "collab.report" = "Signaler le fichier à l’opérateur du serveur" "collab.serverInfo" = "Informations sur le serveur" "collab.share" = "Partager avec un code d’accès" -"collab.spotlight" = "Me mettre sous les projecteurs" +"collab.spotlight" = "Faire suivre ma vue" "collab.stop" = "Arrêter la session en direct" "command.batch" = "Exécuter plusieurs commandes" "comment.add" = "Ajouter un commentaire" @@ -2051,10 +2051,10 @@ status = "draft — needs native review" "select.inverse" = "Inverser la sélection" "select.layersAt" = "Calques en un point" "select.matching" = "Sélectionner les calques correspondants" -"select.next" = "Sélectionner l’élément suivant" +"select.next" = "Sélectionner l’élément suivant du même niveau" "select.none" = "Tout désélectionner" "select.parent" = "Sélectionner le parent" -"select.previous" = "Sélectionner l’élément précédent" +"select.previous" = "Sélectionner l’élément précédent du même niveau" "select.remove" = "Retirer de la sélection" "select.sameEffect" = "Sélectionner le même effet" "select.sameFill" = "Sélectionner le même remplissage" @@ -2141,7 +2141,7 @@ status = "draft — needs native review" "text.sizeDown" = "Réduire la taille de police" "text.sizeUp" = "Augmenter la taille de police" "text.strikethrough" = "Barré" -"text.style" = "Styler une plage de texte" +"text.style" = "Appliquer un style à une plage de texte" "text.trackingDown" = "Réduire l’interlettrage" "text.trackingUp" = "Augmenter l’interlettrage" "text.underline" = "Souligné" @@ -2224,7 +2224,7 @@ status = "draft — needs native review" "vector.edit.smooth" = "Lisser ou rendre anguleux les points" "vector.edit.state" = "État de la modification vectorielle" "vector.edit.strokeCap" = "Extrémité du contour au point" -"vector.edit.strokeJoin" = "Jointure du contour au point" +"vector.edit.strokeJoin" = "Jonction du contour au point" "vector.edit.tool" = "Outil de modification vectorielle" "vector.edit.transform" = "Transformer les points" "vector.edit.widthPoint" = "Point de largeur" @@ -2258,7 +2258,7 @@ status = "draft — needs native review" "view.multiplayerCursors" = "Curseurs des autres participants" "view.nextFrame" = "Zoomer sur le cadre suivant" "view.nextPage" = "Page suivante" -"view.nextRegion" = "Activer la région suivante" +"view.nextRegion" = "Placer le focus sur la région suivante" "view.outlines" = "Contours" "view.outlinesHiddenLayers" = "Inclure les calques masqués dans les contours" "view.outlinesObjectBounds" = "Inclure les limites des objets dans les contours" @@ -2269,7 +2269,7 @@ status = "draft — needs native review" "view.pixelPreview" = "Aperçu des pixels" "view.prevFrame" = "Zoomer sur le cadre précédent" "view.prevPage" = "Page précédente" -"view.previousRegion" = "Activer la région précédente" +"view.previousRegion" = "Placer le focus sur la région précédente" "view.proofSrgb" = "Épreuve écran sRGB" "view.fullscreen" = "Plein écran" "view.prototype" = "Panneau Prototype" From 4223031c5c287da7187409fa68bdc1f0eaa8d1e6 Mon Sep 17 00:00:00 2001 From: leandrodslv <205958219+leandrodslv@users.noreply.github.com> Date: Sun, 18 Oct 2026 14:28:13 +0200 Subject: [PATCH 272/817] docs(contributors): credit leandrodslv by the name on their GitHub profile Co-Authored-By: Claude Sonnet 5 --- contributors/people.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contributors/people.toml b/contributors/people.toml index 8b14373eb..5bdf59833 100644 --- a/contributors/people.toml +++ b/contributors/people.toml @@ -56,3 +56,6 @@ sync_github_name = true [people.pechnikov2026-star] sync_github_name = true + +[people.leandrodslv] +sync_github_name = true From 2c3ea03c2ec488a9f2b144cb7dedfb7220a8a7a1 Mon Sep 17 00:00:00 2001 From: leandrodslv <205958219+leandrodslv@users.noreply.github.com> Date: Sat, 17 Oct 2026 11:44:44 +0200 Subject: [PATCH 273/817] feat(ui): add the interface size preference (#540) Preferences > Interface size and the `pref.uiScale` command make the whole interface larger or smaller. Auto keeps the system's display scale; a fixed size from 75 % to 300 % is absolute (100 % is one screen pixel per point on every system). The size is held back while the window is too small for it. Strings are added in en, es and fr; the control protocol, MCP, UI parity and roadmap docs are updated. Co-Authored-By: Claude Sonnet 5.5 --- ROADMAP.md | 1 + crates/engine/src/a11y_keys_tests.rs | 50 +++++++++++ crates/engine/src/cmd/view.rs | 18 ++++ crates/engine/src/lib.rs | 22 +++++ crates/ui-egui/locales/en.toml | 6 ++ crates/ui-egui/locales/es.toml | 7 ++ crates/ui-egui/locales/fr.toml | 7 ++ crates/ui-egui/src/dialogs.rs | 48 ++++++++++ crates/ui-egui/src/lib.rs | 23 +++++ crates/ui-egui/src/ui_scale.rs | 127 +++++++++++++++++++++++++++ crates/ui-egui/src/ui_scale_tests.rs | 75 ++++++++++++++++ docs/control-protocol.md | 4 +- docs/mcp.md | 6 ++ docs/ui-parity.md | 2 + 14 files changed, 395 insertions(+), 1 deletion(-) create mode 100644 crates/ui-egui/src/ui_scale.rs create mode 100644 crates/ui-egui/src/ui_scale_tests.rs diff --git a/ROADMAP.md b/ROADMAP.md index 8a587286d..e5ed24d65 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -319,6 +319,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | +| 2026-10-17 | minor | Interface size (#540): Preferences ▸ Interface size and `pref.uiScale` make the whole interface larger or smaller. Auto keeps the system's display scale (its entry shows the size it draws at); a fixed size from 75 % to 300 % is absolute, so 100 % is one screen pixel per point on every system. A window too small for a fixed size draws a smaller one until it is larger (the choice is kept); the browser keeps its own zoom. Cmd/Ctrl +/-/0 still zoom the canvas only. Numbers unchanged. | | 2026-10-17 | minor | Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. | | 2026-10-17 | minor | Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. | | 2026-10-16 | minor | Community fixes from #478 up (batches #591, #598, #602; 69 PRs) and a control-channel fix: a line that isn't JSON now ends a `--control` connection, so a web page can't drive the app through a browser request (#589). Highlights: page copies keep navigation, flows, prototype settings and guides; Find and Replace keeps line endings and case-insensitive matches; text hyperlinks survive import and export; recent colours record only what was picked; MCP screenshots respect `maxSize`; Swedish catalog (UI strings), Czech plurals; bounded canvas overscan while panning; Korean fallback at the run's weight; many vector-edit, guide, page and .fig round-trip fixes. Numbers unchanged | diff --git a/crates/engine/src/a11y_keys_tests.rs b/crates/engine/src/a11y_keys_tests.rs index 6687886cd..72507df5f 100644 --- a/crates/engine/src/a11y_keys_tests.rs +++ b/crates/engine/src/a11y_keys_tests.rs @@ -55,3 +55,53 @@ fn reduce_motion_is_a_preference_that_persists() { let old: crate::Prefs = serde_json::from_value(json!({"theme": "dark"})).unwrap(); assert!(!old.reduce_motion); } + +#[test] +fn interface_size_is_auto_until_chosen_and_a_chosen_size_is_absolute_and_persists() { + let mut s = Session::new(); + assert_eq!(s.prefs.ui_scale, None); + assert_eq!(s.execute("pref.uiScale", &json!({})).unwrap()["scale"], "auto"); + // A fixed size: 1.0 is one screen pixel per point, so the number is not multiplied by the system's scale. + assert_eq!(s.execute("pref.uiScale", &json!({"scale": 1.25})).unwrap()["scale"], 1.25); + assert_eq!(s.prefs.ui_scale, Some(1.25)); + // Reading changes nothing; "auto" goes back to the system's scale. + assert_eq!(s.execute("pref.uiScale", &json!({})).unwrap()["scale"], 1.25); + assert_eq!(s.execute("pref.uiScale", &json!({"scale": "Auto"})).unwrap()["scale"], "auto"); + assert_eq!(s.prefs.ui_scale, None); + // Nothing to undo: the document didn't change. + assert!(!s.ds().map(|d| d.is_dirty()).unwrap_or(false)); + // Saved with the other preferences. + s.prefs.ui_scale = Some(2.5); + let v = serde_json::to_value(&s.prefs).unwrap(); + assert_eq!(v["ui_scale"], 2.5); + let back: crate::Prefs = serde_json::from_value(v).unwrap(); + assert_eq!(back.ui_scale, Some(2.5)); +} + +#[test] +fn interface_size_stops_at_the_ends_and_junk_never_changes_it() { + let mut s = Session::new(); + assert_eq!(s.execute("pref.uiScale", &json!({"scale": 0.01})).unwrap()["scale"], crate::UI_SCALE_MIN); + assert_eq!(s.execute("pref.uiScale", &json!({"scale": -4})).unwrap()["scale"], crate::UI_SCALE_MIN); + assert_eq!(s.execute("pref.uiScale", &json!({"scale": 1e308})).unwrap()["scale"], crate::UI_SCALE_MAX); + // The size is a factor (1.25), not a percentage: 125 is far past the end and stops there. + assert_eq!(s.execute("pref.uiScale", &json!({"scale": 125})).unwrap()["scale"], crate::UI_SCALE_MAX); + s.prefs.ui_scale = Some(1.5); + for junk in [json!({"scale": "NaN"}), json!({"scale": "big"}), json!({"scale": [1]}), json!({"scale": {"x": 1}})] { + assert!(s.execute("pref.uiScale", &junk).is_err(), "{junk}"); + assert_eq!(s.prefs.ui_scale, Some(1.5), "{junk}"); + } +} + +#[test] +fn a_settings_file_without_or_with_a_wrong_interface_size_reads_as_auto_and_keeps_the_rest() { + let old: crate::Prefs = serde_json::from_value(json!({"theme": "dark"})).unwrap(); + assert_eq!(old.ui_scale, None); + for bad in [json!("big"), json!(null), json!([2]), json!(true)] { + let p: crate::Prefs = serde_json::from_value(json!({"theme": "dark", "ui_scale": bad})).unwrap(); + assert_eq!((p.ui_scale, p.theme.as_str()), (None, "dark"), "{bad}"); + } + // A number out of range is clamped rather than refused. + let p: crate::Prefs = serde_json::from_value(json!({"ui_scale": 99, "theme": "dark"})).unwrap(); + assert_eq!((p.ui_scale, p.theme.as_str()), (Some(crate::UI_SCALE_MAX), "dark")); +} diff --git a/crates/engine/src/cmd/view.rs b/crates/engine/src/cmd/view.rs index 69b938e91..9b929118a 100644 --- a/crates/engine/src/cmd/view.rs +++ b/crates/engine/src/cmd/view.rs @@ -370,6 +370,24 @@ pub fn specs() -> Vec { spec!("pref.showDimensions", "Show dimensions on objects", "{on?}", false, |s, p| pref(s, p, |x| &mut x.show_dimensions)), spec!("pref.numberKeysOpacity", "Use number keys for opacity", "{on?}", false, |s, p| pref(s, p, |x| &mut x.number_keys_opacity)), spec!("pref.reduceMotion", "Reduce motion", "{on?}", false, |s, p| pref(s, p, |x| &mut x.reduce_motion)), + spec!( + "pref.uiScale", + "Interface size", + "{scale?: \"auto\" or a fixed size from 0.75 to 3, 1 being one screen pixel per point whatever scale the system reports, so 1.25 is 125 %, not 125 (outside the range it stops at the nearest end; omit: just read it)} → {scale: \"auto\" or the size}: how large the whole interface is drawn; auto keeps the system's scale; the canvas zoom is separate", + false, + |s, p| { + match get(p, "scale") { + None => {} + Some(Value::String(v)) if v.trim().eq_ignore_ascii_case("auto") => s.prefs.ui_scale = None, + Some(_) => { + let scale = req_num("pref.uiScale", p, "scale")?; + s.prefs.ui_scale = + Some(crate::clamp_ui_scale(scale).ok_or_else(|| bad("pref.uiScale", "`scale` must be a finite number or \"auto\""))?); + } + } + Ok(json!({"scale": s.prefs.ui_scale.map_or(json!("auto"), |v| json!(v))})) + } + ), spec!("pref.autoSave", "Save files automatically", "{on?}", false, |s, p| pref(s, p, |x| &mut x.auto_save)), spec!("pref.nudge", "Nudge amount", "{small?, big?}", false, |s, p| { s.prefs.nudge_small = num(p, "small").unwrap_or(s.prefs.nudge_small).clamp(0.01, 1000.0); diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 312c2e878..c8010399e 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -603,6 +603,22 @@ impl DocState { } } +/// The smallest and largest fixed interface size: 1.0 is one screen pixel per point, whatever scale +/// the system reports. +pub const UI_SCALE_MIN: f64 = 0.75; +pub const UI_SCALE_MAX: f64 = 3.0; + +/// `scale` kept between [`UI_SCALE_MIN`] and [`UI_SCALE_MAX`]; not a finite number: `None` (Auto). +pub fn clamp_ui_scale(scale: f64) -> Option { + scale.is_finite().then(|| scale.clamp(UI_SCALE_MIN, UI_SCALE_MAX)) +} + +/// Reads the saved interface size. Anything but a number reads as Auto and a number out of range is +/// clamped, so a settings file edited by hand never costs the other preferences. +fn read_ui_scale<'de, D: serde::Deserializer<'de>>(d: D) -> std::result::Result, D::Error> { + Ok(Value::deserialize(d)?.as_f64().and_then(clamp_ui_scale)) +} + /// App-wide preferences that commands read (nudge amounts, behaviours). #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(default)] @@ -630,6 +646,11 @@ pub struct Prefs { /// Reduce motion: the interface's own animations are off (the system's setting turns them off /// too). Prototype transitions still play. pub reduce_motion: bool, + /// How large the whole interface is drawn. `None` is Auto: the scale the system reports. A + /// number is a fixed size, 1.0 being one screen pixel per point, so it ignores the system's + /// scale (kept between [`UI_SCALE_MIN`] and [`UI_SCALE_MAX`]). The canvas zoom is separate. + #[serde(deserialize_with = "read_ui_scale")] + pub ui_scale: Option, /// Files that have a path are saved by themselves a few seconds after they change (the app's /// timer; off: only File ▸ Save writes them). pub auto_save: bool, @@ -698,6 +719,7 @@ impl Default for Prefs { language: "system".into(), user_name: cmd::comment::DEFAULT_AUTHOR.into(), reduce_motion: false, + ui_scale: None, auto_save: false, invite_links: None, plugins: Vec::new(), diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 17f6b4c5f..b16d95509 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -134,7 +134,9 @@ name = "English" "Auto (space between)" = "Auto (space between)" "Auto (space evenly)" = "Auto (space evenly)" "Auto ({mode})" = "Auto ({mode})" +"Auto ({percent}%)" = "Auto ({percent}%)" "Auto columns" = "Auto columns" +"Auto follows your system's display scaling; the other sizes ignore it. Document zoom is separate." = "Auto follows your system's display scaling; the other sizes ignore it. Document zoom is separate." "Auto gap" = "Auto gap" "Auto height" = "Auto height" "Auto layout" = "Auto layout" @@ -653,6 +655,7 @@ name = "English" "Interaction" = "Interaction" "Interactions" = "Interactions" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." +"Interface size" = "Interface size" "Intersect" = "Intersect" "Intersects" = "Intersects" "Invalid color" = "Invalid color" @@ -1371,6 +1374,7 @@ name = "English" "The selection uses several text styles: click to apply one" = "The selection uses several text styles: click to apply one" "The server deletes this file if nobody opens it before {date}." = "The server deletes this file if nobody opens it before {date}." "The whole file" = "The whole file" +"The window is too small for {size}%, so the interface is drawn at {drawn}%. Make the window larger to use {size}%." = "The window is too small for {size}%, so the interface is drawn at {drawn}%. Make the window larger to use {size}%." "Theme" = "Theme" "There's no destination for that action" = "There's no destination for that action" "Thickness" = "Thickness" @@ -1450,6 +1454,7 @@ name = "English" "Use number keys for opacity" = "Use number keys for opacity" "Use the .figcraft or .fig extension." = "Use the .figcraft or .fig extension." "Use the layer's fill" = "Use the layer's fill" +"Use your browser's zoom to change the interface size." = "Use your browser's zoom to change the interface size." "Used in {files} · {instances}" = "Used in {files} · {instances}" "Username" = "Username" "Value" = "Value" @@ -1720,6 +1725,7 @@ name = "English" "{n}m" = "{n}m" "{n}w" = "{n}w" "{page}, nothing selected" = "{page}, nothing selected" +"{percent}%" = "{percent}%" "{profile} (current)" = "{profile} (current)" "{property} is its value; {property ? \"a\" : \"b\"} picks a string. Other {…} stays as written." = "{property} is its value; {property ? \"a\" : \"b\"} picks a string. Other {…} stays as written." "{server} can't say what became of your files (it is older than this app)." = "{server} can't say what became of your files (it is older than this app)." diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index d054e2223..61ec88733 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -8,6 +8,8 @@ name = "Español" status = "draft — needs native review" [ui] +"Auto ({percent}%)" = "Auto ({percent}%)" +"Auto follows your system's display scaling; the other sizes ignore it. Document zoom is separate." = "Auto sigue el escalado de pantalla del sistema; los demás tamaños lo ignoran. El zoom del documento es independiente." "Compatibility notes" = "Notas de compatibilidad" "Couldn't download the variables" = "No se pudieron descargar las variables" @@ -654,6 +656,7 @@ status = "draft — needs native review" "Interaction" = "Interacción" "Interactions" = "Interacciones" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Diseño de interfaces y prototipos. Una herramienta de diseño gratuita y de código abierto, de implementación independiente (clean-room), escrita desde cero en Rust, parte de las Crafting Apps de ArtCraft." +"Interface size" = "Tamaño de la interfaz" "Intersect" = "Intersecar" "Intersects" = "Intersecciones" "Invalid color" = "Color no válido" @@ -1372,6 +1375,7 @@ status = "draft — needs native review" "The selection uses several text styles: click to apply one" = "La selección usa varios estilos de texto: haz clic para aplicar uno" "The server deletes this file if nobody opens it before {date}." = "El servidor elimina este archivo si nadie lo abre antes del {date}." "The whole file" = "El archivo completo" +"The window is too small for {size}%, so the interface is drawn at {drawn}%. Make the window larger to use {size}%." = "La ventana es demasiado pequeña para {size}%, así que la interfaz se dibuja al {drawn}%. Agranda la ventana para usar {size}%." "Theme" = "Tema" "There's no destination for that action" = "No hay destino para esa acción" "Thickness" = "Grosor" @@ -1451,6 +1455,7 @@ status = "draft — needs native review" "Use number keys for opacity" = "Usar teclas numéricas para la opacidad" "Use the .figcraft or .fig extension." = "Usa la extensión .figcraft o .fig." "Use the layer's fill" = "Usar el relleno de la capa" +"Use your browser's zoom to change the interface size." = "Usa el zoom del navegador para cambiar el tamaño de la interfaz." "Used in {files} · {instances}" = "Usado en {files} · {instances}" "Username" = "Usuario" "Value" = "Valor" @@ -1721,6 +1726,7 @@ status = "draft — needs native review" "{n}m" = "{n} min" "{n}w" = "{n} sem" "{page}, nothing selected" = "{page}, nada seleccionado" +"{percent}%" = "{percent}%" "{profile} (current)" = "{profile} (actual)" "{property} is its value; {property ? \"a\" : \"b\"} picks a string. Other {…} stays as written." = "{property} es su valor; {property ? \"a\" : \"b\"} elige un texto. Cualquier otro {…} se queda tal cual." "{server} can't say what became of your files (it is older than this app)." = "{server} no puede decir qué fue de tus archivos (es anterior a esta aplicación)." @@ -2032,6 +2038,7 @@ status = "draft — needs native review" "pref.reduceMotion" = "Reducir movimiento" "pref.renameDuplicates" = "Renombrar capas duplicadas" "pref.showDimensions" = "Mostrar dimensiones en los objetos" +"pref.uiScale" = "Tamaño de la interfaz" "pref.userName" = "Tu nombre en los comentarios" "proto.action.add" = "Añadir acción de prototipo" "proto.action.move" = "Reordenar acción de prototipo" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 5edf1a624..ff88477fa 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -134,7 +134,9 @@ status = "draft — needs native review" "Auto (space between)" = "Auto (espace entre)" "Auto (space evenly)" = "Auto (espace égal)" "Auto ({mode})" = "Auto ({mode})" +"Auto ({percent}%)" = "Auto ({percent} %)" "Auto columns" = "Colonnes auto" +"Auto follows your system's display scaling; the other sizes ignore it. Document zoom is separate." = "Auto suit la mise à l’échelle d’affichage de votre système ; les autres tailles l’ignorent. Le zoom du document est distinct." "Auto gap" = "Espacement auto" "Auto height" = "Hauteur auto" "Auto layout" = "Mise en page auto" @@ -652,6 +654,7 @@ status = "draft — needs native review" "Interaction" = "Interaction" "Interactions" = "Interactions" "Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "Design d’interfaces et prototypage. Un outil de design libre et gratuit, développé en salle blanche (clean-room) et écrit de zéro en Rust, membre des Crafting Apps d’ArtCraft." +"Interface size" = "Taille de l’interface" "Intersect" = "Intersection" "Intersects" = "Intersections" "Invalid color" = "Couleur non valide" @@ -1366,6 +1369,7 @@ status = "draft — needs native review" "The selection uses several text styles: click to apply one" = "La sélection utilise plusieurs styles de texte : cliquez pour en appliquer un" "The server deletes this file if nobody opens it before {date}." = "Le serveur supprime ce fichier si personne ne l’ouvre avant le {date}." "The whole file" = "Le fichier entier" +"The window is too small for {size}%, so the interface is drawn at {drawn}%. Make the window larger to use {size}%." = "La fenêtre est trop petite pour {size} %, l’interface est donc affichée à {drawn} %. Agrandissez la fenêtre pour utiliser {size} %." "Theme" = "Thème" "There's no destination for that action" = "Cette action n’a pas de destination" "Thickness" = "Épaisseur" @@ -1443,6 +1447,7 @@ status = "draft — needs native review" "Use number keys for opacity" = "Utiliser les touches numériques pour l’opacité" "Use the .figcraft or .fig extension." = "Utilisez l’extension .figcraft ou .fig." "Use the layer's fill" = "Utiliser le remplissage du calque" +"Use your browser's zoom to change the interface size." = "Utilisez le zoom de votre navigateur pour modifier la taille de l’interface." "Used in {files} · {instances}" = "Utilisé dans {files} · {instances}" "Username" = "Nom d’utilisateur" "Uses variables: each layer shows them in its own mode" = "Utilise des variables : chaque calque les affiche dans son propre mode" @@ -1710,6 +1715,7 @@ status = "draft — needs native review" "{n}m" = "{n} min" "{n}w" = "{n} sem." "{page}, nothing selected" = "{page}, aucune sélection" +"{percent}%" = "{percent} %" "{profile} (current)" = "{profile} (actuel)" "{property} is its value; {property ? \"a\" : \"b\"} picks a string. Other {…} stays as written." = "{property} donne sa valeur ; {property ? \"a\" : \"b\"} choisit un texte. Tout autre {…} reste tel quel." "{server} can't say what became of your files (it is older than this app)." = "{server} ne peut pas dire ce que sont devenus vos fichiers (il est plus ancien que cette application)." @@ -2021,6 +2027,7 @@ status = "draft — needs native review" "pref.reduceMotion" = "Réduire les animations" "pref.renameDuplicates" = "Renommer les calques dupliqués" "pref.showDimensions" = "Afficher les dimensions sur les objets" +"pref.uiScale" = "Taille de l’interface" "pref.userName" = "Votre nom dans les commentaires" "proto.action.add" = "Ajouter une action de prototype" "proto.action.move" = "Réordonner l’action de prototype" diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 448501abf..7527969ea 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -273,6 +273,8 @@ pub fn show(app: &mut FigApp, ctx: &Context) { } }); ui.add_space(8.0); + interface_size(app, ui, prefs.ui_scale); + ui.add_space(8.0); ui.horizontal(|ui| { ui.label(tr("Theme")); for (l, c) in [(tr_noop("Light"), "view.themeLight"), (tr_noop("Dark"), "view.themeDark"), (tr_noop("System"), "view.themeSystem")] { @@ -475,6 +477,52 @@ pub(crate) fn batch_rename_params(b: &BatchRenameUi) -> serde_json::Value { /// Rename layers: Match, Rename to with buttons for the current name and numbers, where numbers /// start, a preview of the first new names, then one `object.batchRename`. +/// Preferences ▸ Interface size: Auto (the system's scale) or a fixed size, as a drop-down that +/// takes effect at once, with what each means written out. The browser has its own zoom, so there +/// the row only says so. +fn interface_size(app: &mut FigApp, ui: &mut egui::Ui, chosen: Option) { + let t = Tokens::get(ui.ctx()); + if cfg!(target_arch = "wasm32") { + ui.label(tr("Interface size")); + crate::widgets::label(ui, tr("Use your browser's zoom to change the interface size."), t.text_secondary); + return; + } + let percent = |scale: f32| crate::ui_scale::percent(scale); + let auto = trf("Auto ({percent}%)", &[("percent", &percent(app.ui.ui_native))]); + let fixed = |size: f64| trf("{percent}%", &[("percent", &percent(size as f32))]); + let shown = chosen.map_or_else(|| auto.clone(), fixed); + ui.horizontal(|ui| { + ui.label(tr("Interface size")); + let resp = crate::widgets::dropdown(ui, &shown, 120.0, None); + crate::a11y::combo(&resp, tr("Interface size"), &shown, crate::a11y::menu_open(&resp)); + crate::right::menu_popup(&resp).show(|ui| { + if crate::right::menu_check(ui, chosen.is_none(), &auto, "") { + app.run("pref.uiScale", json!({"scale": "auto"})); + ui.close(); + } + for size in crate::ui_scale::SIZES { + if crate::right::menu_check(ui, chosen == Some(size), &fixed(size), "") { + app.run("pref.uiScale", json!({"scale": size})); + ui.close(); + } + } + }); + }); + crate::widgets::label( + ui, + tr("Auto follows your system's display scaling; the other sizes ignore it. Document zoom is separate."), + t.text_secondary, + ); + // Said in words, not only by the menu's value: the window is too small for the size chosen. + if let Some(size) = chosen.filter(|_| app.ui.ui_scale.limited) { + let note = trf( + "The window is too small for {size}%, so the interface is drawn at {drawn}%. Make the window larger to use {size}%.", + &[("size", &percent(size as f32)), ("drawn", &percent(app.ui.ui_scale.drawn))], + ); + crate::widgets::label(ui, ¬e, t.text_secondary); + } +} + fn batch_rename_dialog(app: &mut FigApp, ctx: &Context) { let Some(mut b) = app.ui.batch_rename.clone() else { return }; let t = Tokens::get(ctx); diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 450317b43..f329c5212 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -61,6 +61,7 @@ pub mod tabs; pub mod theme; pub mod toolbar; pub mod typography; +pub mod ui_scale; pub mod variable_ui; pub mod variables_panel; pub mod vector_panel; @@ -204,6 +205,8 @@ mod text_enter_tests; #[cfg(test)] mod titlebar_tests; #[cfg(test)] +mod ui_scale_tests; +#[cfg(test)] mod variables_export_ui_tests; #[cfg(test)] mod variables_rename_tests; @@ -459,6 +462,11 @@ pub struct UiState { pub menu_input: Option, /// File ▸ Rename: the file name in the left panel starts its inline rename on the next frame. pub rename_file: bool, + /// What the interface size drew last frame: the system's scale (what Auto shows) and whether + /// the window held a fixed size back. Set by [`FigApp::logic`] for the main window. + pub ui_scale: ui_scale::Plan, + /// The system's scale of the main window, as of the last frame. + pub ui_native: f32, pub shortcuts_panel: bool, /// The Keyboard shortcuts panel's tab and search text. pub shortcuts_tab: figcraft_engine::keymap::Group, @@ -612,6 +620,8 @@ impl Default for UiState { preferences: false, menu_input: None, rename_file: false, + ui_scale: ui_scale::plan(None, None, None), + ui_native: 1.0, shortcuts_panel: false, shortcuts_tab: figcraft_engine::keymap::Group::Essential, shortcuts_query: String::new(), @@ -1261,6 +1271,17 @@ impl FigApp { theme::install_fonts(ctx, true, cjk); } } + // egui's zoom is for the whole app, so only the main window sets it (a window on another + // screen has its own system scale). The browser keeps its own zoom: Auto there. + if ctx.viewport_id() == egui::ViewportId::ROOT { + let native = ctx.native_pixels_per_point(); + let window_px = ctx.content_rect().size() * ctx.pixels_per_point(); + let fixed = if cfg!(target_arch = "wasm32") { None } else { self.session.prefs.ui_scale }; + let plan = ui_scale::plan(fixed, native, Some((window_px.x, window_px.y))); + ctx.set_zoom_factor(plan.zoom); + self.ui.ui_scale = plan; + self.ui.ui_native = native.filter(|n| n.is_finite() && *n > 0.0).unwrap_or(1.0); + } let dark = match self.session.prefs.theme.as_str() { "dark" => true, // The active visuals were set by us last frame (possibly for a manual theme). @@ -1679,6 +1700,8 @@ impl FigApp { "importReport": self.ui.import_report.as_ref().map(import_report::Report::inspect), }); state["homeSearch"] = json!(self.ui.home_view.file_query); + // Set apart from the literal above, which is at the macro recursion limit. + state["uiScale"] = json!({"choice": self.session.prefs.ui_scale.map_or(json!("auto"), |v| json!(v)), "drawn": self.ui.ui_scale.drawn, "limited": self.ui.ui_scale.limited}); state["pendingOpens"] = json!(self.ui.pending_opens.len()); state["missingFonts"] = json!(self.ui.missing_fonts.as_ref().map(missing_fonts::Shown::inspect)); state diff --git a/crates/ui-egui/src/ui_scale.rs b/crates/ui-egui/src/ui_scale.rs new file mode 100644 index 000000000..91d790ccb --- /dev/null +++ b/crates/ui-egui/src/ui_scale.rs @@ -0,0 +1,127 @@ +//! The interface size (Preferences ▸ Interface size, `pref.uiScale`): how the saved choice becomes +//! egui's zoom factor. +//! +//! egui draws at `pixels_per_point = zoom factor × the system's scale`. Auto leaves the zoom at 1 so +//! the system's scale rules. A fixed size is absolute: 100 % is one screen pixel per point on every +//! system, so the zoom is the size divided by the system's scale (a Retina Mac at 2× needs 0.5 to +//! show 100 %). A fixed size is held back while the window is too small to lay the interface out at +//! it; the saved choice never changes. + +/// The smallest window, in points, the interface is laid out for: the main window's minimum size. +pub const FIT_POINTS: (f32, f32) = (800.0, 500.0); + +/// The zoom factors egui's own settings window allows. +const ZOOM_RANGE: (f32, f32) = (0.1, 10.0); + +/// What to give egui for a saved choice on this screen and window. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct Plan { + /// For `Context::set_zoom_factor`. + pub zoom: f32, + /// Physical pixels per point once drawn (the zoom times the system's scale). + pub drawn: f32, + /// A fixed size was chosen but the window is too small for it, so a smaller one is drawn. + pub limited: bool, +} + +/// The plan for `choice` (`None`: Auto), the system's scale `native` and the window's size in +/// physical pixels `window_px`. An unknown, zero or not finite value reads as no information: a +/// system scale of 1 and a window of any size. +pub fn plan(choice: Option, native: Option, window_px: Option<(f32, f32)>) -> Plan { + let native = native.filter(|n| n.is_finite() && *n > 0.0).unwrap_or(1.0); + let Some(want) = choice.map(|c| c as f32).filter(|c| c.is_finite() && *c > 0.0) else { + return Plan { zoom: 1.0, drawn: native, limited: false }; + }; + let fit = + window_px.filter(|(w, h)| w.is_finite() && h.is_finite() && *w > 0.0 && *h > 0.0).map(|(w, h)| (w / FIT_POINTS.0).min(h / FIT_POINTS.1)); + // Never below 1 (or the size asked, when that is smaller): a tiny window doesn't shrink the interface further. + let target = match fit { + Some(fit) if want > fit => fit.max(want.min(1.0)), + _ => want, + }; + let zoom = (target / native).clamp(ZOOM_RANGE.0, ZOOM_RANGE.1); + let drawn = zoom * native; + Plan { zoom, drawn, limited: drawn < want - 0.005 } +} + +/// A size as the percentage Preferences shows (1.25 → 125). +pub fn percent(scale: f32) -> u32 { + (scale * 100.0).round().clamp(0.0, 100_000.0) as u32 +} + +/// The fixed sizes Preferences offers, after Auto. +pub const SIZES: [f64; 7] = [0.75, 1.0, 1.25, 1.5, 2.0, 2.5, 3.0]; + +#[cfg(test)] +mod tests { + use super::*; + + const BIG: Option<(f32, f32)> = Some((5000.0, 3000.0)); + + #[test] + fn auto_keeps_the_systems_scale_on_every_screen() { + for native in [1.0, 1.25, 1.5, 1.75, 2.0, 3.0] { + let p = plan(None, Some(native), BIG); + assert_eq!((p.zoom, p.drawn, p.limited), (1.0, native, false), "{native}"); + } + } + + #[test] + fn a_fixed_size_is_the_same_size_whatever_the_systems_scale() { + // Windows 100/125/150/175 %, Retina 2×, a bare X11 window manager's guessed 2×, a 3× screen. + for native in [1.0, 1.25, 1.5, 1.75, 2.0, 3.0] { + for size in SIZES { + let p = plan(Some(size), Some(native), BIG); + assert!((p.drawn - size as f32).abs() < 1e-5, "{size} on {native}: drawn {}", p.drawn); + assert!(!p.limited, "{size} on {native}"); + } + } + // 100 % on a 2× screen really is half the Auto size: the zoom is 0.5. + assert_eq!(plan(Some(1.0), Some(2.0), BIG).zoom, 0.5); + } + + #[test] + fn a_missing_or_unusable_scale_reads_as_1_and_never_gives_egui_a_bad_zoom() { + for native in [None, Some(0.0), Some(-2.0), Some(f32::NAN), Some(f32::INFINITY)] { + for choice in [None, Some(1.5), Some(f64::NAN), Some(f64::INFINITY), Some(-1.0), Some(0.0), Some(1e300)] { + let p = plan(choice, native, Some((f32::NAN, 0.0))); + assert!(p.zoom.is_finite() && (ZOOM_RANGE.0..=ZOOM_RANGE.1).contains(&p.zoom), "{choice:?} {native:?}: {p:?}"); + assert!(p.drawn.is_finite() && p.drawn > 0.0, "{choice:?} {native:?}: {p:?}"); + } + } + // A choice that isn't a usable number is Auto. + assert_eq!(plan(Some(f64::NAN), Some(2.0), BIG), plan(None, Some(2.0), BIG)); + } + + #[test] + fn a_small_window_holds_a_big_size_back_without_going_below_100() { + // The minimum window on a Retina Mac: 800 × 500 points is 1600 × 1000 pixels. + let min = Some((1600.0, 1000.0)); + let p = plan(Some(3.0), Some(2.0), min); + assert_eq!((p.drawn, p.limited), (2.0, true)); + assert!(!plan(Some(2.0), Some(2.0), min).limited); + // The same window on a 1× screen: 800 × 500 pixels hold only 100 %. + let p = plan(Some(2.0), Some(1.0), Some((800.0, 500.0))); + assert_eq!((p.drawn, p.limited), (1.0, true)); + // A window smaller than the minimum (a tiling window manager): never below 100 %, and never + // below a smaller size the person chose. + assert_eq!(plan(Some(2.0), Some(1.0), Some((400.0, 250.0))).drawn, 1.0); + let p = plan(Some(0.75), Some(1.0), Some((400.0, 250.0))); + assert_eq!((p.drawn, p.limited), (0.75, false)); + } + + #[test] + fn the_limit_does_not_depend_on_the_zoom_so_it_cannot_flicker() { + // The window's size in pixels is the same whatever zoom is drawn now, so the plan for it is too. + let px = Some((1700.0, 1100.0)); + let a = plan(Some(2.5), Some(2.0), px); + let b = plan(Some(2.5), Some(2.0), px); + assert_eq!(a, b); + } + + #[test] + fn percentages_round_like_the_menu_shows_them() { + assert_eq!([percent(0.75), percent(1.0), percent(1.25), percent(2.0), percent(1.7999)], [75, 100, 125, 200, 180]); + assert_eq!([percent(f32::NAN), percent(-1.0)], [0, 0]); + } +} diff --git a/crates/ui-egui/src/ui_scale_tests.rs b/crates/ui-egui/src/ui_scale_tests.rs new file mode 100644 index 000000000..cda3dd1ad --- /dev/null +++ b/crates/ui-egui/src/ui_scale_tests.rs @@ -0,0 +1,75 @@ +//! The interface size, driven through egui headless on screens of different system scales: Auto +//! leaves the system's scale alone, a fixed size comes out the same on every screen, and the +//! Preferences drop-down tells a screen reader its name and value. +//! +//! The test window's size is fixed in points, so it grows with the zoom here; the limit for a small +//! window is tested on its own in `ui_scale::tests`, and the sizes below stay inside it. + +use egui::accesskit::Role; +use egui::{RawInput, ViewportId, ViewportInfo}; +use figcraft_engine::Session; +use serde_json::json; + +use crate::layers_drag_tests::Ui; + +/// One frame on a screen whose system scale is `native` (a real window reports it every frame). +fn frame_at(u: &mut Ui, native: f32) -> egui::FullOutput { + let mut raw = RawInput::default(); + raw.viewports.insert(ViewportId::ROOT, ViewportInfo { native_pixels_per_point: Some(native), ..Default::default() }); + u.frame_raw(raw) +} + +/// Frames on that screen, enough for a new zoom to take effect. +fn settle(u: &mut Ui, native: f32) { + for _ in 0..4 { + frame_at(u, native); + } +} + +const SCREENS: [f32; 5] = [1.0, 1.25, 1.5, 2.0, 3.0]; + +#[test] +fn auto_leaves_the_systems_scale_and_the_menu_can_say_what_it_is() { + for native in SCREENS { + let mut u = Ui::new(Session::new()); + settle(&mut u, native); + assert_eq!(u.ctx.zoom_factor(), 1.0, "{native}"); + assert_eq!(u.ctx.pixels_per_point(), native, "{native}"); + assert_eq!(u.app.ui.ui_native, native, "what Auto shows in the menu: {native}"); + } +} + +#[test] +fn a_fixed_size_draws_the_same_on_every_screen_and_auto_brings_the_systems_scale_back() { + for native in SCREENS { + let mut u = Ui::new(Session::new()); + for size in [0.75_f64, 1.0, 1.5] { + assert!(u.app.run("pref.uiScale", json!({"scale": size})).is_some()); + settle(&mut u, native); + let drawn = u.ctx.pixels_per_point(); + assert!((drawn - size as f32).abs() < 1e-4, "{size} on a {native}× screen drew at {drawn}"); + assert!(!u.app.ui.ui_scale.limited, "{size} on {native}"); + } + assert!(u.app.run("pref.uiScale", json!({"scale": "auto"})).is_some()); + settle(&mut u, native); + assert_eq!((u.ctx.zoom_factor(), u.ctx.pixels_per_point()), (1.0, native), "{native}"); + } +} + +#[test] +fn the_interface_size_menu_has_a_name_a_value_and_a_state_for_a_screen_reader() { + let mut u = Ui::new(Session::new()); + u.app.ui.preferences = true; + u.ctx.enable_accesskit(); + let combo = |u: &mut Ui| { + settle(u, 2.0); + let out = frame_at(u, 2.0); + let nodes: Vec<_> = out.platform_output.accesskit_update.expect("an AccessKit update").nodes.into_iter().map(|(_, n)| n).collect(); + let n = nodes.iter().find(|n| n.role() == Role::ComboBox && n.label() == Some("Interface size")).expect("an Interface size menu"); + (n.value().map(str::to_owned), n.is_expanded()) + }; + // Auto says the size it draws at: a 2× screen is 200 %. + assert_eq!(combo(&mut u), (Some("Auto (200%)".to_owned()), Some(false))); + u.app.run("pref.uiScale", json!({"scale": 1.25})); + assert_eq!(combo(&mut u), (Some("125%".to_owned()), Some(false))); +} diff --git a/docs/control-protocol.md b/docs/control-protocol.md index 3ae9d287b..a807fe658 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -169,7 +169,9 @@ instance, a dragged axis slider; see `text.preview` in [mcp.md](mcp.md)). `canvas` or `properties`), whether `keyboard` mode is on (F6 or Tab moved the focus since the last pointer press, so the focus ring shows) and the name of the `control` with the keyboard (what a screen reader announces; empty when nothing has it). `reduceMotion` is true when the preference or -the system's accessibility setting turns the interface's animations off. `live` is the live +the system's accessibility setting turns the interface's animations off. `uiScale` is the interface +size: the `choice` (`"auto"` or a fixed size, `pref.uiScale`), what is `drawn` (physical pixels per +point) and whether the window is too small for the choice (`limited`, so `drawn` is smaller). `live` is the live session of the window's active file as the window shows it (sessions are per file: another tab shows its own, or `status: "off"`): `session` (its id, null when the file isn't in one), `sessions` (how many the app has running), `status`, `role`, the number of `peers`, who you `follow`, the diff --git a/docs/mcp.md b/docs/mcp.md index c5ffe99f5..42a6222db 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -417,6 +417,12 @@ on; `key` resolves keys the way the canvas does. Commands behind keys: nested layers), Escape or a click drops it. - `pref.reduceMotion {on?}`: reduced motion (the interface's own animations off; the system's accessibility setting turns it on too). Prototype transitions still play. +- `pref.uiScale {scale?}`: how large the whole interface is drawn. `scale` is `"auto"` (the system's + display scale, the default) or a fixed size from 0.75 to 3 where 1 is one screen pixel per point + whatever scale the system reports, so a 2× screen needs 2 to match Auto. 1.25 means 125 %, not 125 + (outside the range it stops at the nearest end). Omit `scale` to read it. The canvas zoom is separate. + A window too small for a fixed size draws a smaller one until it is larger; the choice is kept. + In the browser the interface always follows the browser's zoom. - `pref.autoSave {on?}`: files that have a path save themselves a few seconds after they change (off by default; the desktop app's timer does it, so scripts still call `file.save`). - `pref.language {language: system|en|cs|ru|es|es-419|fr|de|pt-BR|ja|ko|zh-Hans|…}`: the app's interface language, applied live ("system": diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 766284f1d..c935e0094 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -165,6 +165,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Keyboard navigation: F6 regions, Tab within, focus ring | done | | | Layers panel from the keyboard: arrows, F2 / Cmd+R rename (the row gets the keyboard back), Shift+F10 context menu; 10k-layer lists | done | revealing a layer, expanding, collapsing and arrow keys timed in `cargo xtask bench` | | Reduced motion | done | system setting or preference | +| Interface size (Preferences ▸ Interface size, `pref.uiScale`) | done on desktop | Auto (the system's scale) or a fixed size from 75 % to 300 %, where 100 % is one screen pixel per point on every system; held back while the window is too small for it; the browser keeps its own zoom | | WCAG AA contrast of secondary and accent text | done | | | Tested with VoiceOver, NVDA, Narrator, Orca | missing | human QA | @@ -176,6 +177,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | 2026-10-17 | minor | Escape or Enter while the pen draws ends the path and keeps its vector in edit mode with the pen, so the next path is drawn into the same layer (unconnected); another Escape leaves edit mode (#760). Entering edit mode on a layer that already is a vector no longer records an empty undo step. Numbers unchanged | | 2026-10-17 | minor | Text layers keep the platform IME on for every frame of an edit, not only frames with input (an idle frame turned it off and macOS dropped each composition, #747); the candidate window opens at the caret instead of the canvas corner; keys pressed while composing go to the IME | | 2026-10-17 | minor | The community batches #733, #735, #736, #729 and #753: submenus open after a short hover, keep their place along a safe triangle and reopen closed (main and context menus); the Actions palette's tabs, ranked search, keyboard highlight and recents; menu items that need a value ask for it, File ▸ Rename edits in place; Shift+I and Resources open Assets; a draggable Pages/Layers divider; Shift-drag moves the selection; a double-click near a thin stroke, merging dropped points and Flatten keeping open paths in vector editing; live font preview and the selection highlight after line breaks; the colour picker on a new fill or stroke; Paste over and Paste properties from the keyboard; Selection colors (partial: no library styles or variables there) and smart-selection spacing fields and canvas handles (partial: no reorder rings), both also checked by their author on macOS; the keyboard shortcuts panel closes on the home screen; Adwaita window controls on Wayland compositors without server decorations (checked by its author on GNOME; KDE not run). Checked in the app on Windows (submenus by their author), not side by side with Figma. Summary and hours unchanged | +| 2026-10-17 | minor | Interface size preference (#540): Preferences ▸ Interface size and `pref.uiScale`, Auto or a fixed size from 75 % to 300 %, absolute (100 % is one screen pixel per point whatever the system's scale) | | 2026-10-15 | minor | Hex fields take CSS colour names (`red` → `FF0000`): fills, strokes, effects, grids, variables, backgrounds and the colour picker | | 2026-10-15 | minor | Typography: drag the line-height, letter-spacing and paragraph-spacing icons to scrub their values; shared numeric-field rates, resize cursor and one Undo step per gesture (#373). | | 2026-10-15 | minor | A click or Tab into a one-line field selects all of its text (hex, inline, name, search and dialog fields); the first click into a fill's hex takes the keyboard | From a6659dcdfc52d36f265058faeec5ba010574b685 Mon Sep 17 00:00:00 2001 From: leandrodslv <205958219+leandrodslv@users.noreply.github.com> Date: Sat, 17 Oct 2026 11:55:19 +0200 Subject: [PATCH 274/817] test(ui): sweep every window size, system scale and interface size Draws the interface the way a real window does (a fixed number of physical pixels, its size in points being that divided by the scale drawn now) over 10 window sizes, 6 system scales and every interface size. Guards the rule a fixed size promises: above 100 % the window still holds the smallest layout, the panels leave room for a canvas, and the size settles without flicker. Co-Authored-By: Claude Sonnet 5.5 --- crates/ui-egui/src/ui_scale_tests.rs | 82 ++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/crates/ui-egui/src/ui_scale_tests.rs b/crates/ui-egui/src/ui_scale_tests.rs index cda3dd1ad..74f1f676c 100644 --- a/crates/ui-egui/src/ui_scale_tests.rs +++ b/crates/ui-egui/src/ui_scale_tests.rs @@ -73,3 +73,85 @@ fn the_interface_size_menu_has_a_name_a_value_and_a_state_for_a_screen_reader() u.app.run("pref.uiScale", json!({"scale": 1.25})); assert_eq!(combo(&mut u), (Some("125%".to_owned()), Some(false))); } + +/// Every window size, system scale and interface size, drawn the way a real window is: the window is +/// a fixed number of physical pixels, and its size in points is that divided by the scale drawn now +/// (egui-winit does the same each frame), so a bigger size shrinks the window in points. +/// +/// What a fixed size promises: whatever it draws at above 100 %, the window still holds the smallest +/// layout the interface is made for (`ui_scale::FIT_POINTS`), and the panels leave room for a canvas. +#[test] +fn every_window_size_system_scale_and_interface_size_lays_out_inside_the_window() { + use crate::ui_scale::{FIT_POINTS, SIZES}; + use crate::{FigApp, NoServices}; + use egui::{Pos2, Rect, vec2}; + + // Window sizes in points: the main window's minimum, common laptop and desktop screens up to 5K, + // and a short wide strip. + let windows: [(f32, f32); 10] = [ + (800.0, 500.0), + (1024.0, 640.0), + (1280.0, 720.0), + (1366.0, 768.0), + (1440.0, 900.0), + (1920.0, 1080.0), + (2560.0, 1440.0), + (3840.0, 2160.0), + (5120.0, 2880.0), + (2560.0, 520.0), + ]; + let mut choices: Vec> = vec![None]; + choices.extend(SIZES.iter().map(|s| Some(*s))); + + for native in [1.0_f32, 1.25, 1.5, 1.75, 2.0, 3.0] { + for (w, h) in windows { + let px = vec2(w * native, h * native); + for choice in &choices { + let case = format!("{w}x{h} pt at {native}x, {choice:?}"); + let mut app = FigApp::new(Session::new(), Box::new(NoServices)); + let scale = choice.map_or(json!("auto"), |c| json!(c)); + assert!(app.run("pref.uiScale", json!({"scale": scale})).is_some(), "{case}"); + let ctx = egui::Context::default(); + let mut time = 0.0; + let mut seen = Vec::new(); + for _ in 0..8 { + time += 1.0 / 60.0; + let ppp = ctx.pixels_per_point(); + let mut raw = RawInput { screen_rect: Some(Rect::from_min_size(Pos2::ZERO, px / ppp)), time: Some(time), ..Default::default() }; + raw.viewports.insert(ViewportId::ROOT, ViewportInfo { native_pixels_per_point: Some(native), ..Default::default() }); + let mut out = ctx.run_ui(raw, |ui| app.ui(ui)); + out.textures_delta.clear(); + seen.push((ctx.pixels_per_point(), ctx.content_rect().size())); + } + // It settles within a few frames and then stays put: no flicker between two sizes. + let (ppp, content) = seen[seen.len() - 1]; + assert_eq!(seen[seen.len() - 2].0, ppp, "{case}: still changing"); + assert!(ppp.is_finite() && ppp > 0.0 && content.x.is_finite() && content.y.is_finite(), "{case}: {ppp} {content:?}"); + let plan = app.ui.ui_scale; + assert!((ppp - plan.drawn).abs() < 1e-3, "{case}: egui draws at {ppp}, the plan said {}", plan.drawn); + match choice { + None => assert!((ppp - native).abs() < 1e-3 && !plan.limited, "{case}: Auto must keep the system's scale"), + Some(want) => { + let want = *want as f32; + assert_eq!(plan.limited, ppp < want - 0.005, "{case}: limited flag"); + // Above 100 % the window holds the smallest layout; at or below it there is nothing more to give up. + if ppp > 1.001 { + assert!( + content.x >= FIT_POINTS.0 - 0.5 && content.y >= FIT_POINTS.1 - 0.5, + "{case}: window is {content:?} points at {ppp}" + ); + } + // It never draws bigger than asked, and only a window too small for it draws smaller. + assert!(ppp <= want + 1e-3, "{case}"); + if !plan.limited { + assert!((ppp - want).abs() < 1e-3, "{case}"); + } + } + } + let panels = &app.inspect()["panels"]; + let side = panels["left"].as_f64().unwrap_or(0.0) + panels["right"].as_f64().unwrap_or(0.0); + assert!(side < f64::from(content.x) - 100.0, "{case}: the panels ({side} pt) leave no canvas in {content:?}"); + } + } + } +} From 4d9d12ea13c2c01ef3f2fe9358bcb7fa8d856965 Mon Sep 17 00:00:00 2001 From: leandrodslv <205958219+leandrodslv@users.noreply.github.com> Date: Sat, 17 Oct 2026 12:14:19 +0200 Subject: [PATCH 275/817] fix(ui): let escape close an open menu before its dialog Escape closed the whole Preferences dialog even while a menu was open over it. That held while Preferences had no menu of its own; the Interface size menu is the first, so one Escape threw away the dialog with the menu. Dialog keys now leave Escape to an open menu, and the next Escape closes the dialog as before. Adds a keyboard test of the Interface size menu: Tab reaches it, Enter opens it, the arrows move through the sizes, Enter picks one and closes the menu, and Escape closes only the menu. Co-Authored-By: Claude Sonnet 5.5 --- crates/ui-egui/src/dialogs.rs | 6 ++- crates/ui-egui/src/ui_scale_tests.rs | 63 ++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 7527969ea..3fb2c2d4f 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -143,8 +143,12 @@ fn about_body(ui: &mut egui::Ui, t: &Tokens) { } /// Escape closes the topmost simple dialog (one without menus of its own), before the canvas's -/// shortcuts see it (it doesn't deselect), like a system dialog: from one of its fields too. +/// shortcuts see it (it doesn't deselect), like a system dialog: from one of its fields too. A menu +/// open over the dialog (Preferences ▸ Interface size) takes the first Escape and closes alone. pub fn keys(app: &mut FigApp, ctx: &Context) { + if egui::Popup::is_any_open(ctx) { + return; + } let u = &mut app.ui; let open = u.color_profile.is_some() || u.menu_input.is_some() diff --git a/crates/ui-egui/src/ui_scale_tests.rs b/crates/ui-egui/src/ui_scale_tests.rs index 74f1f676c..189552e7e 100644 --- a/crates/ui-egui/src/ui_scale_tests.rs +++ b/crates/ui-egui/src/ui_scale_tests.rs @@ -155,3 +155,66 @@ fn every_window_size_system_scale_and_interface_size_lays_out_inside_the_window( } } } + +/// The interface size is reachable and changeable without a pointer: Tab reaches the menu, Enter +/// opens it, the arrows and Tab move through its entries, Enter picks one and closes the menu, and +/// Escape closes it alone, without changing anything and without closing Preferences (a second +/// Escape does). +#[test] +fn the_interface_size_menu_works_from_the_keyboard() { + use crate::a11y::focused_name; + use egui::{Event, Key, Modifiers, Popup}; + + // A key press, then two quiet frames for the focus (and the name a screen reader reads) to settle. + let press = |u: &mut Ui, key: Key| { + u.frame(vec![ + Event::Key { key, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::NONE }, + Event::Key { key, physical_key: None, pressed: false, repeat: false, modifiers: Modifiers::NONE }, + ]); + u.frame(vec![]); + u.frame(vec![]); + }; + let open = |u: &mut Ui| { + // The Preferences dialog is not modal for the keyboard: Tab crosses the main window first. + let mut tabs = 0; + while focused_name(&u.ctx) != "Interface size" { + assert!(tabs < 140, "Tab never reaches the Interface size menu (focus: {:?})", focused_name(&u.ctx)); + press(u, Key::Tab); + tabs += 1; + } + press(u, Key::Enter); + assert!(Popup::is_any_open(&u.ctx), "Enter opens the menu"); + }; + let chosen = |u: &Ui| u.app.inspect()["uiScale"]["choice"].clone(); + + let mut u = Ui::new(Session::new()); + u.app.ui.preferences = true; + u.ctx.enable_accesskit(); + settle(&mut u, 1.0); + assert_eq!(chosen(&u), json!("auto")); + + // Escape closes the menu and nothing else: the size is unchanged and Preferences stays open. + open(&mut u); + press(&mut u, Key::Escape); + u.frame(vec![]); + assert!(!Popup::is_any_open(&u.ctx)); + assert!(u.app.ui.preferences, "the first Escape closes the menu only"); + assert_eq!(chosen(&u), json!("auto")); + + // The arrows enter the menu on Auto (which says the size it draws at) and go down through the + // sizes (75, 100, 125); Enter picks the one that has the keyboard and closes the menu. + open(&mut u); + press(&mut u, Key::ArrowDown); + assert_eq!(focused_name(&u.ctx), "Auto (100%)"); + for _ in 0..3 { + press(&mut u, Key::ArrowDown); + } + assert_eq!(focused_name(&u.ctx), "125%"); + press(&mut u, Key::Enter); + assert_eq!(chosen(&u), json!(1.25)); + assert!(!Popup::is_any_open(&u.ctx), "picking a size closes the menu"); + assert!(u.app.ui.preferences, "picking a size leaves Preferences open"); + // With no menu open, Escape closes Preferences as before. + press(&mut u, Key::Escape); + assert!(!u.app.ui.preferences); +} From 32bc822451abde10ca038cb95473817fc55d7417 Mon Sep 17 00:00:00 2001 From: Lucas Date: Sun, 18 Oct 2026 14:45:19 +0200 Subject: [PATCH 276/817] fix(i18n): Restrict Polish plural One to n == 1 per CLDR rules Polish integer plural rules use Plural::One strictly for n == 1, while higher counts ending in 1 (e.g. 21, 101) use Plural::Many. Also adds unit tests for Polish integer plural coverage. Co-Authored-By: Antigravity --- crates/ui-egui/src/i18n.rs | 3 ++- crates/ui-egui/src/i18n_tests.rs | 23 ++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs index 51e4c37b6..4a7ef81ce 100644 --- a/crates/ui-egui/src/i18n.rs +++ b/crates/ui-egui/src/i18n.rs @@ -171,7 +171,8 @@ fn plural(code: &str, n: usize) -> Plural { "cs" if n == 1 => Plural::One, "cs" if (2..=4).contains(&n) => Plural::Few, "cs" => Plural::Other, - "ru" | "pl" if n % 10 == 1 && n % 100 != 11 => Plural::One, + "pl" if n == 1 => Plural::One, + "ru" if n % 10 == 1 && n % 100 != 11 => Plural::One, "ru" | "pl" if (2..=4).contains(&(n % 10)) && !(12..=14).contains(&(n % 100)) => Plural::Few, "ru" | "pl" => Plural::Many, "ja" | "ko" | "zh-Hans" => Plural::Other, diff --git a/crates/ui-egui/src/i18n_tests.rs b/crates/ui-egui/src/i18n_tests.rs index d4d81d7b9..738be97bd 100644 --- a/crates/ui-egui/src/i18n_tests.rs +++ b/crates/ui-egui/src/i18n_tests.rs @@ -400,7 +400,7 @@ fn french_and_portuguese_count_zero_as_singular() { for code in ["fr", "pt-BR"] { assert!(one(code, 0) && one(code, 1) && !one(code, 2), "{code}"); } - for code in ["en", "es", "de", "cs"] { + for code in ["en", "es", "de", "cs", "pl"] { for n in [0, 1, 2, 3, 4, 5, 21] { assert_eq!(one(code, n), n == 1, "{code}: {n}"); } @@ -493,6 +493,27 @@ fn russian_language_tags_and_integer_plurals() { } } +#[test] +fn polish_integer_plurals() { + let pl = LANGS.iter().position(|l| l.code == "pl").unwrap(); + assert_eq!(LANGS[pl].name, "Polski"); + assert_eq!(plural("pl", 1), Plural::One); + assert_eq!(fill(counted(pl, "{n} layers", 1), &[("n", &1)]), "1 warstwa"); + for n in [2, 3, 4, 22, 23, 24, 102, 104, 1_002] { + assert_eq!(plural("pl", n), Plural::Few, "{n}"); + assert_eq!(fill(counted(pl, "{n} layers", n), &[("n", &n)]), format!("{n} warstwy")); + } + for n in [0, 5, 10, 11, 12, 13, 14, 19, 20, 21, 25, 31, 100, 101, 111, 112, 114, 1_000_000] { + assert_eq!(plural("pl", n), Plural::Many, "{n}"); + assert_eq!(fill(counted(pl, "{n} layers", n), &[("n", &n)]), format!("{n} warstw")); + } + for (key, text) in LANGS[pl].ui { + if let Text::Plural { one, few, many, .. } = text { + assert!(one.is_some() && few.is_some() && many.is_some(), "{key}: missing Polish plural forms"); + } + } +} + #[test] fn plural_fallback_uses_the_language_of_its_catalog() { let la = LANGS.iter().position(|l| l.code == "es-419").unwrap(); From a3e9af917d96c28a21cb606236768c975836bfcc Mon Sep 17 00:00:00 2001 From: Al Rifat Sabbir <150162343+alrifatsabbir@users.noreply.github.com> Date: Sun, 18 Oct 2026 19:08:34 +0600 Subject: [PATCH 277/817] Add Bengali UI Translation Add Bengali translation (bn.toml) --- crates/ui-egui/locales/bn.toml | 1744 ++++++++++++++++++++++++++++++++ 1 file changed, 1744 insertions(+) create mode 100644 crates/ui-egui/locales/bn.toml diff --git a/crates/ui-egui/locales/bn.toml b/crates/ui-egui/locales/bn.toml new file mode 100644 index 000000000..7cf7dcb92 --- /dev/null +++ b/crates/ui-egui/locales/bn.toml @@ -0,0 +1,1744 @@ +# FigCraft interface strings: English, the source language. +# +# Keys are the English text as the code writes it (`tr("…")`, `trf`, `trn`, `tr_noop`); values are +# the same text, except plural entries ({ one, other }). Command labels come from the engine. +# `cargo test -p figcraft-ui-egui i18n` lists missing and unused keys. See docs/translating.md. + +[meta] +name = "বাংলা" +status = "draft — needs native review" +[meta] +name = "বাংলা" +status = "draft — needs native review" + +[ui] +"% of all commits" = "% of all commits" +"(no longer published)" = "(প্রকাশিত নয়)" +"({n} warnings: some entries were skipped)" = { one = "({n}টি সতর্কতা: কিছু এন্ট্রি বাদ দেওয়া হয়েছে)", other = "({n}টি সতর্কতা: কিছু এন্ট্রি বাদ দেওয়া হয়েছে)" } +"+ Create variable" = "+ ভেরিয়েবল তৈরি করুন" +".fig (experimental)" = ".fig (পরীক্ষামূলক)" +"1…9, 0" = "১…৯, ০" +"@{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 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 ফাইল ইতিমধ্যে বিদ্যমান। প্রতিস্থাপন নিশ্চিত করতে এর সম্পূর্ণ নাম বেছে নিন।" +"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" = "একটি স্প্রিং স্থির হওয়া পর্যন্ত চলে: এর ভর, দৃঢ়তা (stiffness) এবং ড্যাম্পিং নির্ধারণ করে কতক্ষণ চলবে" +"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%)" = "প্রকৃত আকার (১০০%)" +"Add a category" = "একটি বিভাগ যোগ করুন" +"Add a comment" = "একটি মন্তব্য যোগ করুন" +"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 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 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 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 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 বিলম্বের পর" +"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 supported properties" = "সমর্থিত সব প্রপার্টি" +"All the fonts this file uses are installed" = "এই ফাইলে ব্যবহৃত সব ফন্ট ইনস্টল করা আছে" +"All variables" = "সব ভেরিয়েবল" +"Alpha" = "আলফা" +"Alphabetical" = "বর্ণানুক্রমিক" +"Alt+drag" = "Alt+ড্র্যাগ" +"An analytics screen on a grid: figures, charts drawn from vectors and a table" = "গ্রিডের উপর একটি অ্যানালিটিক্স স্ক্রিন: ফিগার, ভেক্টর থেকে আঁকা চার্ট এবং একটি টেবিল" +"An invite link that opens FigCraft and joins" = "একটি আমন্ত্রণ লিংক যা FigCraft খুলে যুক্ত হয়" +"Anchor" = "অ্যাঙ্কর" +"Android" = "অ্যান্ড্রয়েড" +"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 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." = "এই কোড জানা যেকোনো ব্যক্তি ফাইলটি দেখতে পারবেন, পরিবর্তন করতে পারবেন না।" +"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" = "তীর" +"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" = "অটো প্রস্থ" +"Back to the FigCraft server" = "FigCraft সার্ভারে ফিরে যান" +"Back to the font's value" = "ফন্টের মানে ফিরে যান" +"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 canvas from a focused region" = "ফোকাসড অঞ্চল থেকে ক্যানভাসে ফিরে যান" +"Back to the current version" = "বর্তমান সংস্করণে ফিরে যান" +"Back to the values the font style implies" = "ফন্ট স্টাইল নির্দেশিত মানে ফিরে যান" +"Background" = "ব্যাকগ্রাউন্ড" +"Background blur" = "ব্যাকগ্রাউন্ড ব্লার" +"Basics" = "মৌলিক বিষয়" +"Before" = "আগে" +"Bend" = "বাঁক" +"Bevel" = "বেভেল" +"Binary assets added" = "বাইনারি অ্যাসেট যোগ করা হয়েছে" +"Binary assets removed" = "বাইনারি অ্যাসেট সরানো হয়েছে" +"Black & white" = "কালো ও সাদা" +"Bleed" = "ব্লিড" +"Bleed marks" = "ব্লিড মার্ক" +"Bleed marks need a bleed" = "ব্লিড মার্কের জন্য ব্লিড প্রয়োজন" +"Blend" = "ব্লেন্ড" +"Blend mode" = "ব্লেন্ড মোড" +"Blue" = "নীল" +"Blur" = "ব্লার" +"Boolean" = "বুলিয়ান" +"Boolean groups" = "বুলিয়ান গ্রুপ" +"Both directions" = "উভয় দিক" +"Bottom" = "নিচে" +"Bottom left radius" = "নিচের বাম ব্যাসার্ধ" +"Bottom right radius" = "নিচের ডান ব্যাসার্ধ" +"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" = "ব্রাঞ্চসমূহ" +"Bound to {name}. Click to detach the variable." = "{name}-এর সাথে আবদ্ধ। ভেরিয়েবলটি বিচ্ছিন্ন করতে ক্লিক করুন।" +"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 রঙ" +"Can view" = "দেখতে পারেন" +"Checking the fonts installed on this computer…" = "এই কম্পিউটারে ইনস্টল করা ফন্টগুলো চেক করা হচ্ছে..." +"Checking the server…" = "সার্ভার চেক করা হচ্ছে..." +"Clear from this list" = "এই তালিকা থেকে মুছে ফেলুন" +"Code or invite link" = "কোড বা আমন্ত্রণ লিংক" +"Color profile: {name}" = "কালার প্রোফাইল: {name}" +"Colour and text styles, Light and Dark variables, buttons, inputs and cards" = "রঙ ও টেক্সট স্টাইল, লাইট এবং ডার্ক ভেরিয়েবল, বোতাম, ইনপুট এবং কার্ড" +"Convert to frame" = "ফ্রেম রূপান্তর করুন" +"Convert to section" = "সেকশনে রূপান্তর করুন" +"CSS custom properties…" = "CSS কাস্টম প্রপার্টি..." +"Can edit" = "এডিট করতে পারেন" +"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" = "উভয় দিকেই পরিবর্তিত হয়েছে: একটি রাখুন" +"Changes on main" = "প্রধান (main)-এ পরিবর্তন" +"Changes on the branch" = "ব্রাঞ্চে পরিবর্তন" +"Changes unknown" = "পরিবর্তন অজ্ঞাত" +"Choose React, Leptos, SwiftUI or Compose above to connect this component to its code." = "এই কম্পোনেন্টটিকে কোডের সাথে যুক্ত করতে উপরে React, Leptos, SwiftUI বা Compose বেছে নিন।" +"Choose another profile to change it." = "পরিবর্তন করতে অন্য একটি প্রোফাইল বেছে নিন।" +"Choose collection" = "সংগ্রহ (collection) বেছে নিন" +"Choose image" = "ছবি বেছে নিন" +"Choose mode" = "মোড বেছে নিন" +"Choose variable" = "ভেরিয়েবল বেছে নিন" +"Circle" = "বৃত্ত" +"Clear recent" = "সাম্প্রতিকগুলো মুছে ফেলুন" +"Click + to replace mixed content" = "মিশ্র কন্টেন্ট প্রতিস্থাপন করতে + এ ক্লিক করুন" +"Click anywhere on the canvas to leave one." = "একটি রাখতে ক্যানভাসের যেকোনো জায়গায় ক্লিক করুন।" +"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" = "বাইরে ক্লিক করলে বন্ধ করুন" +"Close without saving" = "সেভ না করেই বন্ধ করুন" +"Code" = "কোড" +"Code syntax" = "কোড সিনট্যাক্স" +"Collapse" = "সংকুচিত করুন" +"Collapse panel" = "প্যানেল সংকুচিত করুন" +"Collection" = "সংগ্রহ" +"Collections" = "সংগ্রহসমূহ" +"Color" = "রঙ" +"Color burn" = "কালার বার্ন" +"Color dodge" = "কালার ডজ" +"Color format" = "কালার ফরম্যাট" +"Color profile" = "কালার প্রোফাইল" +"Color styles" = "কালার স্টাইল" +"Color values in this file are in this color space." = "এই ফাইলের রঙের মানগুলো এই কালার স্পেসে রয়েছে।" +"Color variables" = "কালার ভেরিয়েবল" +"Colour" = "রঙ" +"Column" = "কলাম" +"Column gap" = "কলাম গ্যাপ" +"Column sizes" = "কলামের আকার" +"Column span" = "কলাম স্প্যান" +"Columns" = "কলামসমূহ" +"Columns {count}" = "কলাম {count}" +"Comment" = "মন্তব্য" +"Comments" = "মন্তব্যসমূহ" +"Commits" = "কমিটসমূহ" +"Company" = "কোম্পানি" +"Compare changes" = "পরিবর্তন তুলনা করুন" +"Compatibility notes" = "সঙ্গতি নোট (Compatibility notes)" +"Completed" = "সম্পন্ন" +"Component" = "কম্পোনেন্ট" +"Component name" = "কম্পোনেন্টের নাম" +"Component property" = "কম্পোনেন্ট প্রপার্টি" +"Component set" = "কম্পোনেন্ট সেট" +"Component sets" = "কম্পোনেন্ট সেটসমূহ" +"Components" = "কম্পোনেন্টস" +"Conditional" = "শর্তসাপেক্ষ" +"Confetti" = "কনফেটি" +"Conflicts" = "দ্বন্দ্ব (Conflicts)" +"Connect to code" = "কোডের সাথে সংযুক্ত করুন" +"Connected" = "সংযুক্ত" +"Connected to code: {from}" = "কোডের সাথে সংযুক্ত: {from}" +"Connection lost, reconnecting (attempt {attempt})…" = "সংযোগ বিচ্ছিন্ন হয়েছে, পুনরায় সংযোগ স্থাপন করা হচ্ছে (চেষ্টা {attempt})..." +"Constrain proportions" = "অনুপাত ঠিক রাখুন" +"Constraints" = "সীমাবদ্ধতা (Constraints)" +"Content" = "কন্টেন্ট" +"Contents hidden" = "কন্টেন্ট লুকানো আছে" +"Contents only" = "শুধু কন্টেন্ট" +"Contextual alternates" = "প্রসঙ্গভিত্তিক বিকল্প" +"Contrast" = "কনট্রাস্ট (Contrast)" +"Contributors" = "অবদানকারীগণ" +"Contributors: {people} · Commits: {commits}" = "অবদানকারী: {people} · কমিট: {commits}" +"Controller" = "কন্ট্রোলার" +"Cool" = "কুল" +"Copied as CSS" = "CSS হিসেবে কপি করা হয়েছে" +"Copied as PNG" = "PNG হিসেবে কপি করা হয়েছে" +"Copied as SVG" = "SVG হিসেবে কপি করা হয়েছে" +"Copied as text" = "টেক্সট হিসেবে কপি করা হয়েছে" +"Copied {value}" = "{value} কপি করা হয়েছে" +"Copy" = "কপি করুন" +"Copy as" = "যেভাবে কপি করবেন" +"Copy as CSS" = "CSS হিসেবে কপি করুন" +"Copy as PNG" = "PNG হিসেবে কপি করুন" +"Copy as SVG" = "SVG হিসেবে কপি করুন" +"Copy code" = "কোড কপি করুন" +"Copy link" = "লিংক কপি করুন" +"Copy the {label}" = "{label} কপি করুন" +"Copy {value}" = "{value} কপি করুন" +"Corner radius" = "কোণার ব্যাসার্ধ (Corner radius)" +"Corner smoothing" = "কোণা মসৃণকরণ" +"Couldn't download the variables" = "ভেরিয়েবলগুলো ডাউনলোড করা যায়নি" +"Couldn't reach {server}: showing what this computer remembers." = "{server}-এ পৌঁছানো যায়নি: এই কম্পিউটার যা মনে রেখেছে তা দেখানো হচ্ছে।" +"Couldn't save automatically: {error}" = "স্বয়ংক্রিয়ভাবে সেভ করা যায়নি: {error}" +"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 property…" = "প্রপার্টি তৈরি করুন..." +"Create style" = "স্টাইল তৈরি করুন" +"Create style from the selected text" = "নির্বাচিত টেক্সট থেকে স্টাইল তৈরি করুন" +"Created" = "তৈরি করা হয়েছে" +"Crop" = "ক্রপ" +"Crop marks" = "ক্রপ মার্ক" +"Ctrl+arrows" = "Ctrl+অ্যারো" +"Ctrl+click" = "Ctrl+ক্লিক" +"Ctrl+scroll" = "Ctrl+স্ক্রল" +"Current name" = "বর্তমান নাম" +"Current version" = "বর্তমান সংস্করণ" +"Cursor chat" = "কার্সার চ্যাট" +"Custom" = "কাস্টম" +"Custom size" = "কাস্টম আকার" +"Cut" = "কাট করুন" +"Dark" = "ডার্ক" +"Darken" = "ডার্কেন" +"Dash" = "ড্যাশ" +"Dashboard" = "ড্যাশবোর্ড" +"Date created" = "তৈরির তারিখ" +"Dec" = "ডিসেম্বর" +"Decoration style" = "সজ্জা স্টাইল (Decoration style)" +"Decoration" = "সজ্জা" +"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 the style (layers keep their values)" = "স্টাইল ডিলিট করুন (লেয়ারগুলো তাদের মান ধরে রাখবে)" +"Delete thread" = "থ্রেড ডিলিট করুন" +"Delete variable" = "ভেরিয়েবল ডিলিট করুন" +"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 system starter" = "ডিজাইন সিস্টেম স্টার্টার" +"Desktop" = "ডেস্কটপ" +"Destination" = "গন্তব্য" +"Detach alias" = "অ্যালিয়াস বিচ্ছিন্ন করুন" +"Detach instance" = "ইনস্ট্যান্স বিচ্ছিন্ন করুন" +"Detach property" = "প্রপার্টি বিচ্ছিন্ন করুন" +"Detach style" = "স্টাইল বিচ্ছিন্ন করুন" +"Detach styles" = "স্টাইলগুলো বিচ্ছিন্ন করুন" +"Detach variable" = "ভেরিয়েবল বিচ্ছিন্ন করুন" +"Details" = "বিস্তারিত" +"Dev Mode" = "ডেভ মোড" +"Dev resources" = "ডেভ রিসোর্স" +"Development" = "ডেভেলপমেন্ট" +"Device" = "ডিভাইস" +"Device at 100%" = "১০০%-এ ডিভাইস" +"Diamond" = "ডায়মন্ড" +"Difference" = "পার্থক্য" +"Dimensions" = "মাত্রা (Dimensions)" +"Direction" = "দিক" +"Disconnect from code" = "কোড থেকে সংযোগ বিচ্ছিন্ন করুন" +"Dispersion" = "বিচ্ছুরণ" +"Display name" = "প্রদর্শিত নাম" +"Dissolve" = "ডিসলভ" +"Distribute and tidy" = "বণ্টন ও পরিপাটি করুন" +"Distribute horizontal spacing" = "অনুভূমিক ব্যবধান বিতরণ করুন" +"Distribute vertical spacing" = "উল্লম্ব ব্যবধান বিতরণ করুন" +"Divider" = "ডিভাইডার" +"Don't truncate" = "ট্রাঙ্কেট করবেন না" +"Done" = "সম্পন্ন" +"Done editing" = "সম্পাদনা শেষ" +"Dots" = "বিন্দুসমূহ" +"Dotted" = "ডটেড" +"Down" = "নিচে" +"Drafts" = "ড্রাফট" +"Drag the stroke to add a width point" = "প্রস্থ বিন্দু যোগ করতে স্ট্রোকে ড্র্যাগ করুন" +"Draw" = "আঁকুন" +"Draw a frame" = "একটি ফ্রেম আঁকুন" +"Drawing tools" = "অঙ্কন টুলস" +"Drop a .figcraft, .fig, .json, .svg or image file." = "একটি .figcraft, .fig, .json, .svg বা ছবির ফাইল ড্রপ করুন।" +"Drop to import" = "ইম্পোর্ট করতে ড্রপ করুন" +"Drop to open" = "খুলতে ড্রপ করুন" +"Drop shadow" = "ড্রপ শ্যাডো" +"Dual-licensed MIT OR Apache-2.0. Made by the ArtCraft team and community." = "ডুয়াল-লাইসেন্সকৃত MIT বা Apache-2.0। ArtCraft টিম এবং কমিউনিটি দ্বারা তৈরি।" +"Duo" = "ডুও" +"Duplicate" = "প্রতিলিপি তৈরি করুন (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 style" = "স্টাইল এডিট করুন" +"Edit variable" = "ভেরিয়েবল এডিট করুন" +"Edit with the builder" = "বিল্ডার দিয়ে এডিট করুন" +"Edited {when}" = "{when} এডিট করা হয়েছে" +"Effect settings" = "ইফেক্ট সেটিংস" +"Effect styles" = "ইফেক্ট স্টাইল" +"Effects" = "ইফেক্টসমূহ" +"Ellipse" = "উপবৃত্ত" +"Ellipses" = "উপবৃত্তসমূহ" +"Else" = "অন্যথায় (Else)" +"Else if" = "অন্যথায় যদি (Else if)" +"Embedded profile" = "এমবেডেড প্রোফাইল" +"Empty" = "খালি" +"End" = "শেষ" +"End point" = "শেষ বিন্দু" +"Ends the session; everyone keeps their copy" = "সেশন শেষ করে; সবাই তাদের কপি নিজের কাছে রাখে" +"Enter" = "এন্টার" +"Enter the address of a figcraft-server and press Browse to see the plugins it offers." = "একটি figcraft-সার্ভারের ঠিকানা দিন এবং এটি যে প্লাগইনগুলো অফার করে তা দেখতে ব্রাউজ টিপুন।" +"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" = "প্রতিটি শীর্ষ-স্তরের ফ্রেম ইতিমধ্যে একটি ফ্লো শুরু করে" +"Exact opacity (4 then 5: 45%)" = "সঠিক অস্বচ্ছতা (4 তারপর 5: 45%)" +"Exclude" = "বাদ দিন" +"Excluded" = "বাদ দেওয়া হয়েছে" +"Excluded from layout" = "লেআউট থেকে বাদ দেওয়া হয়েছে" +"Excludes" = "বাদ দেয়" +"Exclusion" = "এক্সক্লুশন" +"Exit focus view (Esc)" = "ফোকাস ভিউ থেকে বের হন (Esc)" +"Expand" = "প্রসারিত করুন" +"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 left out" = { one = "{name} এক্সপোর্ট করা হয়েছে; {n} ধরনের কন্টেন্ট বাদ দেওয়া হয়েছে", other = "{name} এক্সপোর্ট করা হয়েছে; {n} ধরনের কন্টেন্ট বাদ দেওয়া হয়েছে" } +"Exported {n} files" = { 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" = "মিথ্যা (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 এখনো এই ফাইলগুলোর সব ফিচার সমর্থন করে না। নোটগুলোতে ইম্পোর্ট করা কপিতে যা বাদ দেওয়া হয়েছে বা পরিবর্তন করা হয়েছে তার তালিকা রয়েছে; মূল ফাইলটি অপরিবর্তিত রয়েছে।" +"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)" +"Fixed gap" = "নির্দিষ্ট গ্যাপ" +"Fixed size" = "নির্দিষ্ট আকার" +"Flatten" = "ফ্ল্যাট করুন" +"Flip" = "উল্টান (Flip)" +"Flip horizontal" = "অনুভূমিকভাবে উল্টান" +"Flip text to the other side" = "টেক্সট অন্য পাশে উল্টান" +"Flip vertical" = "উল্লম্বভাবে উল্টান" +"Flip width profile" = "প্রস্থ প্রোফাইল উল্টান" +"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" = "এই কম্পিউটার থেকে মুছে ফেলুন" +"Four screens of a trail app with components and a prototype flow" = "কম্পোনেন্ট এবং প্রোটোটাইপ ফ্লো সহ ট্রেইল অ্যাপের চারটি স্ক্রিন" +"Fractions" = "ভগ্নাংশ" +"Frame" = "ফ্রেম" +"Frame selection" = "ফ্রেম নির্বাচন" +"Frame tools" = "ফ্রেম টুলস" +"Frames" = "ফ্রেমসমূহ" +"From the library \"{name}\": read-only" = "\"{name}\" লাইব্রেরি থেকে: শুধুমাত্র পড়ার উপযোগী (read-only)" +"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" = "গ্রেডিয়েন্ট" +"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" = "হার্ড লাইট" +"Height" = "উচ্চতা" +"Help" = "সহায়তা" +"Help and resources" = "সহায়তা ও রিসোর্স" +"Help page" = "সহায়তা পেজ" +"Here: {names}" = "এখানে: {names}" +"Hidden" = "লুকানো" +"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" = "হোভারে লেয়ার হাইলাইট করুন" +"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" = "হিউ (Hue)" +"Hug" = "হাগ" +"Hug contents" = "কন্টেন্ট অনুযায়ী হাগ করুন" +"Icon components on a 24 px grid with keylines and a size preview" = "কিলিন এবং সাইজ প্রিভিউ সহ ২৪ পিক্সেল গ্রিডে আইকন কম্পোনেন্ট" +"Icon set starter" = "আইকন সেট স্টার্টার" +"If it keeps happening, please report it at {link} with this message." = "যদি এটি বারবার ঘটতে থাকে, তবে অনুগ্রহ করে এই বার্তা সহ {link}-এ রিপোর্ট করুন।" +"If" = "যদি (If)" +"If {condition}" = "যদি {condition}" +"Ignore auto layout (absolute position)" = "অটো লেআউট উপেক্ষা করুন (অ্যাবসোলিউট পজিশন)" +"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 strokes" = "পৃথক স্ট্রোক" +"Ink" = "কালি (Ink)" +"Inner shadow" = "ইনার শ্যাডো" +"Inside" = "ভিতরে" +"Inspect" = "ইন্সপেক্ট" +"Inspect the layer under the pointer: size, colours, typography" = "পয়েন্টারের নিচের লেয়ারটি ইন্সপেক্ট করুন: আকার, রঙ, টাইপোগ্রাফি" +"Install plugin" = "প্লাগইন ইনস্টল করুন" +"Install" = "ইনস্টল করুন" +"Installed {name}" = "{name} ইনস্টল করা হয়েছে" +"Installed" = "ইনস্টল করা হয়েছে" +"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-এর অংশ।" +"Intersect" = "ছেদ (Intersect)" +"Intersects" = "ছেদ করে" +"Invalid color" = "অবৈধ রঙ" +"Invite link" = "আমন্ত্রণ লিংক" +"Invite link copied" = "আমন্ত্রণ লিংক কপি করা হয়েছে" +"It asks permission to:" = "এটি অনুমতি চায়:" +"Jan" = "জানুয়ারি" +"Join" = "যুক্ত হোন" +"Join code copied" = "যুক্তি কোড (Join code) কপি করা হয়েছে" +"Join code or invite link" = "যুক্ত হওয়ার কোড বা আমন্ত্রণ লিংক" +"Join live session" = "লাইভ সেশনে যুক্ত হোন" +"Join us on Discord" = "ডিসকর্ডে আমাদের সাথে যুক্ত হোন" +"Join with a code" = "কোড দিয়ে যুক্ত হোন" +"Joined" = "যুক্ত হয়েছেন" +"Joined {file}" = "{file}-এ যুক্ত হয়েছেন" +"Joining…" = "যুক্ত হওয়া হচ্ছে..." +"Join|stroke" = "জয়েন" +"Jul" = "জুলাই" +"Jun" = "জুন" +"Just now" = "এইমাত্র" +"Justify" = "উভয়মুখী সারিবদ্ধকরণ (Justify)" +"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" = "ত্যাগ করে" +"Left" = "বামে" +"Left & right" = "বাম ও ডান" +"Left side" = "বাম পাশ" +"Left side width" = "বাম পাশের প্রস্থ" +"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 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" = "উজ্জ্বলতা (Luminosity)" +"Main" = "প্রধান" +"Main component deleted" = "প্রধান কম্পোনেন্ট ডিলিট করা হয়েছে" +"Main menu" = "প্রধান মেনু" +"Make a component" = "একটি কম্পোনেন্ট তৈরি করুন" +"Make slot" = "স্লট তৈরি করুন" +"Mar" = "মার্চ" +"Margin" = "মার্জিন" +"Mark all as read" = "সব পঠিত হিসেবে চিহ্নিত করুন" +"Mark as resolved" = "সমাধানকৃত হিসেবে চিহ্নিত করুন" +"Mark as unread" = "অপঠিত হিসেবে চিহ্নিত করুন" +"Mark as unresolved" = "অমীমাংসিত হিসেবে চিহ্নিত করুন" +"Mask" = "মাস্ক" +"Mass · Stiffness · Damping" = "ভর · দৃঢ়তা · ড্যাম্পিং" +"Match (empty: the whole name)" = "মেলবন্ধন (খালি: সম্পূর্ণ নাম)" +"Max H" = "সর্বোচ্চ উচ্চতা" +"Max W" = "সর্বোচ্চ প্রস্থ" +"Max lines" = "সর্বোচ্চ লাইন" +"Maximize" = "বড় করুন" +"May" = "মে" +"Measure to the selection" = "নির্বাচন পর্যন্ত পরিমাপ করুন" +"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" = "ছোট করুন" +"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 along the toolbar or the layer rows" = "টুলবার বা লেয়ার সারির বরাবর সরান" +"Move" = "সরান" +"Move column left" = "কলাম বামে সরান" +"Move column right" = "কলাম ডানে সরান" +"Move down" = "নিচে সরান" +"Move in" = "ভিতরে সরান" +"Move out" = "বাইরে সরান" +"Move tools" = "সরানোর টুলস" +"Move up" = "উপরে সরান" +"Moved to {name}" = "{name}-এ সরানো হয়েছে" +"Multi" = "মাল্টি" +"Multiply" = "মাল্টিপ্লাই" +"Muted" = "মিউটেড" +"Name" = "নাম" +"Name (A–Z)" = "নাম (A–Z)" +"Named instance" = "নামকৃত ইনস্ট্যান্স" +"Navigate to" = "এতে যান" +"Nested instance" = "নেস্টেড ইনস্ট্যান্স" +"New design file" = "নতুন ডিজাইন ফাইল" +"Newest first" = "সবচেয়ে নতুন প্রথমে" +"Next or previous control in the focused region" = "ফোকাসড অঞ্চলের পরবর্তী বা পূর্ববর্তী কন্ট্রোল" +"Next frame" = "পরবর্তী ফ্রেম" +"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." = "এখনো কোনো বুলিয়ান ভেরিয়েবল নেই। স্থানীয় ভেরিয়েবলে (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 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 fonts match" = "কোনো ফন্ট মেলে না" +"No files or templates match your search" = "আপনার অনুসন্ধানের সাথে কোনো ফাইল বা টেমপ্লেট মেলে না" +"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." = "এখনো কোনো ভেরিয়েবল নেই। স্থানীয় ভেরিয়েবলে এগুলো তৈরি করুন।" +"Nobody else is here yet" = "এখানে আর কেউ নেই" +"Noise" = "নয়েজ" +"None" = "কিছুই না" +"None." = "কিছুই না।" +"Normal" = "স্বাভাবিক" +"Not bound" = "আবদ্ধ নয়" +"Not in a live session" = "লাইভ সেশনে নেই" +"Not in this font" = "এই ফন্টে নেই" +"Not properties, kept as written: {names}" = "প্রপার্টি নয়, যেমনটি লেখা হয়েছে তেমনি রাখা হয়েছে: {names}" +"Not read yet" = "এখনো পড়া হয়নি" +"Not shared" = "শেয়ার করা হয়নি" +"Note {n}" = "নোট {n}" +"Nothing changed since this was marked ready for dev." = "এটি ডেভের জন্য প্রস্তুত হিসেবে চিহ্নিত করার পর থেকে কিছু পরিবর্তিত হয়নি।" +"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" = "এক্সপোর্ট করার মতো কিছু নেই" +"Nov" = "নভেম্বর" +"Now" = "এখন" +"Nudge (Shift: big nudge)" = "নাজ (Shift: বড় নাজ)" +"Nudge amount" = "নাজ পরিমাণ" +"Number" = "নম্বর" +"Number ↑" = "নম্বর ↑" +"Number ↓" = "নম্বর ↓" +"Numbered list" = "সাংখ্যিক তালিকা" +"Object" = "অবজেক্ট" +"Oct" = "অক্টোবর" +"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." = "অনলাইন শেয়ারিং বন্ধ আছে: ফাইলগুলো শুধুমাত্র স্থানীয় নেটওয়ার্কে শেয়ার করা হচ্ছে।" +"Only the first changed layers are listed." = "শুধুমাত্র প্রথম পরিবর্তিত লেয়ারগুলো তালিকাভুক্ত করা হয়েছে।" +"Only the first {n} changed layers are listed." = "শুধুমাত্র প্রথম {n}টি পরিবর্তিত লেয়ার তালিকাভুক্ত করা হয়েছে।" +"Only your threads" = "শুধুমাত্র আপনার থ্রেড" +"Opacity" = "অস্বচ্ছতা (Opacity)" +"Opacity & blend" = "অস্বচ্ছতা ও ব্লেন্ড" +"Opacity 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 window" = "নতুন উইন্ডোতে খুলুন" +"Open invite links in FigCraft" = "FigCraft-এ আমন্ত্রণ লিংক খুলুন" +"Open link" = "লিংক খুলুন" +"Open link {url}" = "লিংক খুলুন {url}" +"Open overlay" = "ওভারলে খুলুন" +"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 apps may not open every .fig file exported here." = "অন্যান্য অ্যাপ এখানে এক্সপোর্ট করা প্রতিটি .fig ফাইল নাও খুলতে পারে।" +"Other" = "অন্যান্য" +"Others lose access and keep their copy; the file stays on the server for you" = "অন্যরা অ্যাক্সেস হারায় এবং তাদের কপি নিজের কাছে রাখে; ফাইলটি আপনার জন্য সার্ভারেই থেকে যায়" +"Others type this under Share ▸ Join with a code" = "অন্যরা '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" = "পেজ" +"Pages" = "পেজসমূহ" +"Pages added to the document" = "ডকুমেন্টে পেজ যোগ করা হয়েছে" +"Placed on the current page" = "বর্তমান পেজে রাখা হয়েছে" +"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" = "প্যারাগ্রাফ ব্যবধান" +"Pass through" = "পাস থ্রু" +"Paste a link (https://…)" = "একটি লিংক পেস্ট করুন (https://…)" +"Paste a team library link (a view link)" = "একটি টিম লাইব্রেরি লিংক পেস্ট করুন (ভিউ লিংক)" +"Paste here" = "এখানে পেস্ট করুন" +"Paste to replace" = "প্রতিস্থাপন করতে পেস্ট করুন" +"Pasted design layers; {n} kinds of content were left out" = { one = "ডিজাইন লেয়ার পেস্ট করা হয়েছে; {n} ধরনের কন্টেন্ট বাদ দেওয়া হয়েছে", other = "ডিজাইন লেয়ার পেস্ট করা হয়েছে; {n} ধরনের কন্টেন্ট বাদ দেওয়া হয়েছে" } +"Pattern" = "প্যাটার্ন" +"Pattern alignment" = "প্যাটার্ন সারিবদ্ধকরণ" +"Pattern scale" = "প্যাটার্ন স্কেল" +"Pattern source" = "প্যাটার্ন উৎস" +"Pen" = "কলম" +"Pencil" = "পেন্সিল" +"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 the Frame tool, then drag on the canvas or choose a device size" = "ফ্রেম টুল বেছে নিন, এরপর ক্যানভাসে ড্র্যাগ করুন অথবা একটি ডিভাইসের আকার বেছে নিন" +"Pin a property" = "একটি প্রপার্টি পিন করুন" +"Pinch" = "পিন্চ" +"Pixel grid" = "পিক্সেল গ্রিড" +"Pixel preview 1x" = "পিক্সেল প্রিভিউ 1x" +"Pixel preview 2x" = "পিক্সেল প্রিভিউ 2x" +"Place a shape or frame (its tool chosen)" = "একটি শেপ বা ফ্রেম রাখুন (এর টুল নির্বাচিত)" +"Place automatically" = "স্বয়ংক্রিয়ভাবে রাখুন" +"Place image" = "ছবি রাখুন" +"Plugin" = "প্লাগইন" +"Plugins run in FigCraft's sandbox, without files, network or clock. Install only plugins you trust." = "প্লাগইনগুলো ফাইল, নেটওয়ার্ক বা ঘড়ি ছাড়া FigCraft-এর স্যান্ডবক্সে চলে। শুধুমাত্র বিশ্বস্ত প্লাগইন ইনস্টল করুন।" +"Plugins" = "প্লাগইনসমূহ" +"Plugins & widgets" = "প্লাগইন ও উইজেট" +"Plus darker" = "প্লাস অন্ধকার" +"Plus lighter" = "প্লাস হালকা" +"Point" = "বিন্দু" +"Points" = "বিন্দুসমূহ" +"Polygon" = "বহুভুজ" +"Polygons" = "বহুভুজসমূহ" +"Port" = "পোর্ট" +"Position" = "অবস্থান" +"Post" = "পোস্ট" +"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…" = "একটি কি টিপুন..." +"Playground" = "প্লেগ্রাউন্ড" +"Preview" = "প্রিভিউ" +"Preview this flow" = "এই ফ্লো প্রিভিউ করুন" +"Preview this frame" = "এই ফ্রেম প্রিভিউ করুন" +"Previous frame" = "পূর্ববর্তী ফ্রেম" +"Previous ready for dev" = "ডেভের জন্য পূর্ববর্তী প্রস্তুত" +"Progressive" = "প্রোগ্রেসিভ" +"Properties" = "প্রপার্টিজ" +"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 to a server needs the desktop app; in the browser you can join a server's files" = "সার্ভারে প্রকাশ করতে ডেস্কটপ অ্যাপ প্রয়োজন; ব্রাউজারে আপনি সার্ভারের ফাইলে যুক্ত হতে পারবেন" +"Publishing with the server's key." = "সার্ভারের কী দিয়ে প্রকাশ করা হচ্ছে।" +"Publishing…" = "প্রকাশ করা হচ্ছে..." +"Push" = "পুশ" +"Push changes to main component" = "প্রধান কম্পোনেন্টে পরিবর্তন পুশ করুন" +"Put text on path" = "পাথে টেক্সট রাখুন" +"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" = "রেগুলার এক্সপ্রেশন" +"Remove" = "সরান" +"Remove all" = "সব সরান" +"Remove annotation" = "অ্যানোটেশন সরান" +"Remove auto layout" = "অটো লেআউট সরান" +"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 min and max" = "সর্বনিম্ন এবং সর্বোচ্চ সরান" +"Remove min and max height" = "সর্বনিম্ন এবং সর্বোচ্চ উচ্চতা সরান" +"Remove min and max width" = "সর্বনিম্ন এবং সর্বোচ্চ প্রস্থ সরান" +"Remove regions" = "অঞ্চলগুলো সরান" +"Remove slot" = "স্লট সরান" +"Remove starting point" = "শুরু করার বিন্দু সরান" +"Remove stop" = "স্টপ সরান" +"Remove text from path" = "পাথ থেকে টেক্সট সরান" +"Remove the else and its actions" = "else এবং এর অ্যাকশনগুলো সরান" +"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}?" = "{server} থেকে {name}-কে সরাবেন?" +"Removed" = "সরে গেছে" +"Removed from the server" = "সার্ভার থেকে সরানো হয়েছে" +"Removed since it was marked" = "চিহ্নিত করার পর থেকে সরানো হয়েছে" +"Rename" = "নাম পরিবর্তন করুন" +"Rename duplicated layers" = "ডুপ্লিকেট করা লেয়ারের নাম পরিবর্তন করুন" +"Rename folder" = "ফোল্ডারের নাম পরিবর্তন করুন" +"Rename group" = "গ্রুপের নাম পরিবর্তন করুন" +"Rename layers" = "লেয়ারের নাম পরিবর্তন করুন" +"Rename mode" = "মোডের নাম পরিবর্তন করুন" +"Rename on the server" = "সার্ভারে নাম পরিবর্তন করুন" +"Rename on the server…" = "সার্ভারে নাম পরিবর্তন করুন..." +"Rename page" = "পেজের নাম পরিবর্তন করুন" +"Rename to" = "নাম পরিবর্তন করে রাখুন" +"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 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" = "সমাধান করা হয়েছে" +"Resources" = "রিসোর্সসমূহ" +"Responsive" = "রেসপনসিভ" +"Restart" = "পুনরায় শুরু করুন" +"Restore" = "পুনরুদ্ধার করুন" +"Restore main component" = "প্রধান কম্পোনেন্ট পুনরুদ্ধার করুন" +"Restore this version" = "এই সংস্করণ পুনরুদ্ধার করুন" +"Restored “{name}”" = "“{name}” পুনরুদ্ধার করা হয়েছে" +"Reverse the order" = "ক্রম উল্টে দিন" +"Reversed triangle" = "উল্টানো ত্রিভুজ" +"Review and merge" = "পর্যালোচনা ও মার্জ করুন" +"Ribbon" = "রিবন" +"Right" = "ডানে" +"Right side" = "ডান পাশ" +"Right side width" = "ডান পাশের প্রস্থ" +"Rotate 90°" = "৯০° ঘোরান" +"Rotate 90° right" = "ডানে ৯০° ঘোরান" +"Rotate to landscape" = "ল্যান্ডস্কেপে ঘোরান" +"Rotate to portrait" = "পোর্ট্রেটে ঘোরান" +"Rotation" = "ঘূর্ণন" +"Rotation jitter" = "ঘূর্ণন জিটার" +"Round" = "গোল" +"Rounded" = "গোল করা" +"Row" = "সারি" +"Row gap" = "সারির গ্যাপ" +"Row sizes" = "সারির আকার" +"Row span" = "সারি স্প্যান" +"Rows" = "সারিগুলো" +"Rows {count}" = "সারি {count}" +"Rulers" = "রুলার" +"Run" = "চালান" +"Run {label}" = "চালান {label}" +"Save files automatically" = "স্বয়ংক্রিয়ভাবে ফাইল সেভ করুন" +"Search templates" = "টেমপ্লেট খুঁজুন" +"See all templates" = "সব টেমপ্লেট দেখুন" +"Select layers and they space themselves as their content changes" = "লেয়ার নির্বাচন করুন এবং তাদের কন্টেন্ট পরিবর্তিত হওয়ার সাথে সাথে তারা নিজেদের মধ্যে দূরত্ব বজায় রাখবে" +"SHA-256: {sha}…" = "SHA-256: {sha}…" +"Same as layer" = "লেয়ারের মতোই" +"Saturation" = "স্যাচুরেশন" +"Save" = "সেভ করুন" +"Save as" = "এভাবে সেভ করুন" +"Save as preset…" = "প্রিসেট হিসেবে সেভ করুন..." +"Save version {key}" = "সংস্করণ সেভ করুন {key}" +"Saved" = "সেভ করা হয়েছে" +"Saved {name}" = "সেভ করা হয়েছে {name}" +"Say something" = "কিছু বলুন" +"Scale" = "স্কেল" +"Scatter" = "স্ক্যাটার" +"Scoping: where pickers offer it" = "স্কোপিং: যেখানে পিকার এটি অফার করে" +"Screen" = "স্ক্রিন" +"Scroll behavior" = "স্ক্রোল আচরণ" +"Scroll to" = "স্ক্রোল করে যান" +"Scroll to layer" = "লেয়ারে স্ক্রোল করুন" +"Scroll with parent" = "প্যারেন্টের সাথে স্ক্রোল করুন" +"Search plugins" = "প্লাগইন খুঁজুন" +"Search" = "অনুসন্ধান" +"Search actions, layers and tools" = "অ্যাকশন, লেয়ার এবং টুল খুঁজুন" +"Search assets" = "অ্যাসেট খুঁজুন" +"Search comments" = "মন্তব্য খুঁজুন" +"Search files and templates" = "ফাইল এবং টেমপ্লেট খুঁজুন" +"Search results" = "অনুসন্ধানের ফলাফল" +"Search fonts" = "ফন্ট খুঁজুন" +"Search layers" = "লেয়ার খুঁজুন" +"Search shortcuts" = "শর্টকাট খুঁজুন" +"Section" = "সেকশন" +"Section color" = "সেকশনের রঙ" +"Sections" = "সেকশনসমূহ" +"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 to apply the style to" = "স্টাইল প্রয়োগ করার জন্য লেয়ার নির্বাচন করুন" +"Select layers with this color" = "এই রঙের লেয়ারগুলো নির্বাচন করুন" +"Select overlapping shapes" = "overlapping শেপগুলো নির্বাচন করুন" +"Select points to edit their position, radius and mirroring" = "অবস্থান, ব্যাসার্ধ এবং মিররিং এডিট করতে পয়েন্ট নির্বাচন করুন" +"Select slot" = "স্লট নির্বাচন করুন" +"Selection colors" = "নির্বাচনের রঙ" +"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+arrows বা {cmd}+arrows দিয়ে আকার পরিবর্তন করা যায়, Enter দিয়ে নির্বাচন হয়, Escape দিয়ে বাতিল হয়" +"Selection box: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "নির্বাচন বাক্স: অ্যারো কি দিয়ে সরানো যায়, Shift+arrows বা {cmd}+arrows দিয়ে আকার পরিবর্তন করা যায়, Enter দিয়ে নির্বাচন হয়, Escape দিয়ে বাতিল হয়" +"Send backward" = "পেছনে পাঠান" +"Send report" = "রিপোর্ট পাঠান" +"Send to back" = "সবার পেছনে পাঠান" +"Sep" = "সেপ্টেম্বর" +"Server address (ws://host:47900/)" = "সার্ভার ঠিকানা (ws://host:47900/)" +"Server address" = "সার্ভারের ঠিকানা" +"Server for online sharing" = "অনলাইন শেয়ারিংয়ের সার্ভার" +"Set as default" = "ডিফল্ট হিসেবে সেট করুন" +"Set variable" = "ভেরিয়েবল সেট করুন" +"Set variable mode" = "ভেরিয়েবল মোড সেট করুন" +"Set variable {name}" = "ভেরিয়েবল সেট করুন {name}" +"Set {name} to {value}" = "{name}-এর মান {value} সেট করুন" +"Shadows" = "ছায়াসমূহ (Shadows)" +"Shape" = "শেপ" +"Shape builder" = "শেপ বিল্ডার" +"Shape tools" = "শেপ টুলস" +"Share" = "শেয়ার" +"Share this file" = "এই ফাইলটি শেয়ার করুন" +"Share with a code" = "কোড দিয়ে শেয়ার করুন" +"Share: live session, export" = "শেয়ার: লাইভ সেশন, এক্সপোর্ট" +"Shared" = "শেয়ার করা হয়েছে" +"Shared: copy its code from the file's menu" = "শেয়ার করা হয়েছে: ফাইলের মেনু থেকে এর কোড কপি করুন" +"Sharing a file needs the desktop app; here you can join one." = "ফাইল শেয়ার করতে ডেস্কটপ অ্যাপ প্রয়োজন; এখানে আপনি একটিতে যুক্ত হতে পারবেন।" +"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 as grid" = "গ্রিড হিসেবে দেখান" +"Show as list" = "তালিকা হিসেবে দেখান" +"Show autosaves" = "স্বয়ংক্রিয় সেভ দেখান" +"Show behind transparent areas" = "স্বচ্ছ এলাকার পেছনে দেখান" +"Show comments (Shift+C)" = "মন্তব্য দেখান (Shift+C)" +"Show device frame" = "ডিভাইস ফ্রেম দেখান" +"Show dimensions on objects" = "অবজেক্টে মাত্রা (dimensions) দেখান" +"Show hotspot hints" = "হটস্পট ইঙ্গিত দেখান" +"Show in Explorer" = "এক্সপ্লোরারে দেখান" +"Show in 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" = "স্লট কন্টেন্ট" +"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" = "কিছু ভ্যারিয়েন্টের প্রপার্টি মান একই: প্রতিটিকে একটি অনন্য কম্বিনেশন দিন" +"Sort" = "সাজান" +"Sort by" = "যেভাবে সাজাবেন" +"Sort by date" = "তারিখ অনুযায়ী সাজান" +"Sort by page" = "পেজ অনুযায়ী সাজান" +"Sort by {column}" = "{column} অনুযায়ী সাজান" +"Space around" = "চারপাশে স্পেস" +"Space between" = "মাঝখানে স্পেস" +"Space drag" = "স্পেস ড্র্যাগ" +"Space evenly" = "সমানভাবে স্পেস" +"Space+drag" = "Space+ড্র্যাগ" +"Spacing" = "ব্যবধান" +"Spam, stolen work, abuse…" = "স্প্যাম, চুরি করা কাজ, অপব্যবহার..." +"Splay" = "সপ্লে" +"Spotlight me" = "আমাকে স্পটলাইট করুন" +"Spread" = "স্প্রেড" +"Square" = "বর্গক্ষেত্র" +"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 point" = "শুরুর বিন্দু" +"Start sharing" = "শেয়ার করা শুরু করুন" +"Start sharing with the Share button, then pass on the code it gives" = "শেয়ার বোতাম দিয়ে শেয়ার করা শুরু করুন, তারপর এটি যে কোড দেয় তা দিন" +"Starting to share…" = "শেয়ার করা শুরু হচ্ছে..." +"Status" = "স্ট্যাটাস" +"Sticky" = "স্টিকি" +"Stop" = "থামুন" +"Stop following {name}" = "{name}-কে অনুসরণ করা বন্ধ করুন" +"Stop session" = "সেশন বন্ধ করুন" +"Stop sharing" = "শেয়ার করা বন্ধ করুন" +"Stop spotlighting" = "স্পটলাইটিং বন্ধ করুন" +"Stop {n} {hex}" = "স্টপ {n} {hex}" +"Stretch" = "টেনে বড় করা (Stretch)" +"Strikethrough" = "স্ট্রাইকথ্রু" +"String" = "স্ট্রিং" +"Stroke" = "স্ট্রোক" +"Stroke style" = "স্ট্রোক স্টাইল" +"Stroke weight" = "স্ট্রোকের ওজন" +"Strokes" = "স্ট্রোকসমূহ" +"Style" = "স্টাইল" +"Styles" = "স্টাইলসমূহ" +"Stylistic set 1" = "স্টাইলিস্টিক সেট ১" +"Stylistic set 2" = "স্টাইলিস্টিক সেট ২" +"Stylistic set 3" = "স্টাইলিস্টিক সেট ৩" +"Stylistic set 4" = "স্টাইলিস্টিক সেট ৪" +"Stylistic set 5" = "স্টাইলিস্টিক সেট ৫" +"Subtract" = "বিয়োগ করুন" +"Subtracts" = "বিয়োগ করে" +"Suffix" = "সাফিক্স" +"Suspend snapping while dragging" = "ড্র্যাগ করার সময় স্ন্যাপিং স্থগিত রাখুন" +"Swap instance" = "ইনস্ট্যান্স সোয়াপ করুন" +"Swap library: use another library's assets of the same names" = "লাইব্রেরি সোয়াপ করুন: একই নামের অন্য লাইব্রেরির অ্যাসেট ব্যবহার করুন" +"Swap orientation" = "ভিত্তিক বিন্যাস (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" +"Table" = "টেবিল" +"Tablet" = "ট্যাবলেট" +"Tabular numbers" = "টাবুলার সংখ্যা" +"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 style" = "টেক্সট স্টাইল" +"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 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" = "সম্পূর্ণ ফাইল" +"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 has unsaved changes" = "এই ফাইলে সেভ করা হয়নি এমন পরিবর্তন রয়েছে" +"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 is on {server}, open only to you. Share it to let others in with a new code." = "এই ফাইলটি {server}-এ আছে, শুধুমাত্র আপনার জন্য খোলা। নতুন কোড দিয়ে অন্যদের প্রবেশ করাতে এটি শেয়ার করুন।" +"This frame is new on the branch." = "এই ফ্রেমটি ব্রাঞ্চে নতুন।" +"This frame isn't on the branch." = "এই ফ্রেমটি ব্রাঞ্চে নেই।" +"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." = "এই সার্ভার শুধুমাত্র এর কী সহ ফাইল নেয়: উন্নত (Advanced) দেখুন।" +"Tidy up" = "পরিপাটি করুন" +"Tile" = "টাইল" +"Tile type" = "টাইল টাইপ" +"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." = "আপনার টিমের সাথে এই লাইব্রেরি শেয়ার করতে, ফাইলটি একটি সার্ভারে প্রকাশ করুন (Share ▸ Publish to server…), এরপর সেখানে লাইব্রেরি প্রকাশ করুন।" +"Toggle" = "টগল" +"Toggle light/dark theme" = "লাইট/ডার্ক থিম টগল করুন" +"Toggle visibility" = "দৃশ্যমানতা টগল করুন" +"Tools" = "টুলস" +"Top" = "উপরে" +"Top & bottom" = "উপরে ও নিচে" +"Top left radius" = "ওপরের বাম ব্যাসার্ধ" +"Top right radius" = "ওপরের ডান ব্যাসার্ধ" +"Transform" = "ট্রান্সফর্ম" +"Triangle arrow" = "ত্রিভুজ তীর" +"Trigger" = "ট্রিগার" +"True" = "সত্য (True)" +"Truncate text" = "টেক্সট ট্রাঙ্কেট করুন" +"Truncate with an ellipsis" = "উপবৃত্ত (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)" +"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}. Close the window and lose them?" = "{names}-এ সংরক্ষিত হয়নি এমন পরিবর্তন রয়েছে। উইন্ডোটি বন্ধ করলে কি সেগুলো হারিয়ে যাবে?" +"Unsaved changes: save first ({save}), or close the tab with {alt}-click to discard" = "সংরক্ষিত হয়নি এমন পরিবর্তন: প্রথমে সেভ করুন ({save}), অথবা বাতিল করতে {alt}-ক্লিক করে ট্যাব বন্ধ করুন" +"Unsaved changes: save first, or close again with {key} to discard" = "সংরক্ষিত হয়নি এমন পরিবর্তন: প্রথমে সেভ করুন, অথবা বাতিল করতে {key} দিয়ে আবার বন্ধ করুন" +"Up" = "উপরে" +"Update plugin" = "প্লাগইন আপডেট করুন" +"Update" = "আপডেট" +"Update from main" = "প্রধান (main) থেকে আপডেট করুন" +"Update from selection" = "নির্বাচন থেকে আপডেট করুন" +"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 ব্যবহার করতে, কমান্ড প্রম্পট থেকে FigCraft শুরু করুন:" +"Updating the graphics driver often helps. WGPU_BACKEND (vulkan, gl, metal) names another graphics API to try." = "গ্রাফিক্স ড্রাইভার আপডেট করা প্রায়ই সহায়ক হয়। WGPU_BACKEND (vulkan, gl, metal) চেষ্টা করার জন্য অন্য একটি গ্রাফিক্স API এর নাম বলে।" +"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 number keys for opacity" = "অস্বচ্ছতার জন্য নম্বর কি ব্যবহার করুন" +"Use the .figcraft or .fig extension." = ".figcraft বা .fig এক্সটেনশন ব্যবহার করুন।" +"Use the layer's fill" = "লেয়ারের ফিল ব্যবহার করুন" +"Used in {files} · {instances}" = "{files} · {instances}-এ ব্যবহৃত" +"Username" = "ব্যবহারকারী নাম" +"Value" = "মান" +"Uses variables: each layer shows them in its own mode" = "ভেরিয়েবল ব্যবহার করে: প্রতিটি লেয়ার তাদের নিজস্ব মোডে সেগুলো দেখায়" +"Variable" = "ভেরিয়েবল" +"Variable collections" = "ভেরিয়েবল সংগ্রহসমূহ" +"Variable modes" = "ভেরিয়েবল মোড" +"Variable width" = "পরিবর্তনশীল প্রস্থ (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" = "ভিভিড" +"WGPU_BACKEND is set and names the graphics API to use; unsetting it lets FigCraft choose." = "WGPU_BACKEND সেট করা আছে এবং ব্যবহারের জন্য গ্রাফিক্স API-এর নাম দেয়; এটি আনসেট করলে FigCraft কে বেছে নিতে দেয়।" +"Warm" = "উষ্ণ" +"Watch" = "ওয়াচ" +"Wavy" = "ঢেউ খেলানো" +"Web" = "ওয়েব" +"Websites" = "ওয়েবসাইটসমূহ" +"WebSocket URL" = "WebSocket URL" +"WebSocket URL copied" = "WebSocket URL কপি করা হয়েছে" +"Wedge" = "ওয়েজ" +"Weight" = "ওজন" +"What you try here changes this preview and the code below, not the file" = "আপনি এখানে যা চেষ্টা করেন তা ফাইলটিকে নয়, কেবল এই প্রিভিউ এবং নিচের কোডটিকে পরিবর্তন করে" +"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 ডেভের জন্য প্রস্তুত ফ্রেমের একটি কপি রাখার আগেই এটি পরিবর্তিত হয়েছে। এখন থেকে তুলনা করতে পরিবর্তনটি সমাধান করুন (বা এটি আবার প্রস্তুত হিসেবে চিহ্নিত করুন)।" +"While hovering" = "হোভার করার সময়" +"While pressing" = "চেপে ধরে রাখার সময়" +"White" = "সাদা" +"Who runs it, its terms and how long it keeps files" = "এটি কে পরিচালনা করে, এর শর্তাবলী এবং এটি কতদিন ফাইল রাখে" +"Why it changed" = "কেন এটি পরিবর্তিত হয়েছে" +"Widget" = "উইজেট" +"Widgets" = "উইজেটসমূহ" +"Width" = "প্রস্থ" +"Width point" = "প্রস্থ বিন্দু" +"Width profile" = "প্রস্থ প্রোফাইল" +"Wireframe kit" = "ওয়্যারফ্রেম কিট" +"With the layers' export settings" = "লেয়ারের এক্সপোর্ট সেটিংস সহ" +"Wrap" = "র‍্যাপ" +"Wrap in new section" = "নতুন সেকশনে র‍্যাপ করুন" +"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 name in comments" = "মন্তব্যে আপনার নাম" +"Your system asks for reduced motion: animations stay off." = "আপনার সিস্টেম কম মোশনের অনুরোধ জানায়: অ্যানিমেশন বন্ধ থাকে।" +"Z" = "Z" +"Z to A" = "Z থেকে A" +"Zoom" = "জুম" +"Zoom around the pointer" = "পয়েন্টারের চারপাশে জুম করুন" +"Zoom device to fill window" = "উইন্ডো পূর্ণ করতে ডিভাইস জুম করুন" +"Zoom in" = "জুম ইন" +"Zoom out" = "জুম আউট" +"Zoom to 100%" = "১০০%-এ জুম করুন" +"Zoom to 200%" = "২০০%-এ জুম করুন" +"Zoom to 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" = "ডকুমেন্ট এডিট করতে পারেন" +"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 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 import as straight lines" = "সংরক্ষিত পাথ ছাড়া এলবো এবং কার্ভড কানেক্টর সরল রেখা হিসেবে ইম্পোর্ট হয়" +"entries without a node type were skipped" = "নোটের ধরন ছাড়া এন্ট্রিগুলো বাদ দেওয়া হয়েছে" +"figcraft:// links from a browser, chat or email open this app and join the session." = "ব্রাউজার, চ্যাট বা ইমেল থেকে figcraft:// লিংকগুলো এই অ্যাপ খুলে সেশনে যুক্ত হয়।" +"filled areas of a vector with their own fill use the layer's fill" = "ভেক্টরের নিজস্ব ফিলযুক্ত পূর্ণ এলাকাগুলো লেয়ারের ফিল ব্যবহার করে" +"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" = "গ্রিড ট্র্যাক তালিকা ১০০০ এন্ট্রি অতিক্রম করেছে; ট্র্যাকগুলো ডিফল্ট সমান সাইজিং ব্যবহার করে" +"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" = "গ্রিড ট্র্যাক সাইজিং তালিকা ১০০০ এন্ট্রি অতিক্রম করেছে; ট্র্যাকগুলো ডিফল্ট সমান সাইজিং ব্যবহার করে" +"hidden" = "লুকানো" +"iOS" = "iOS" +"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" = "ইনস্ট্যান্স সোয়াপ প্রপার্টি যার ডিফল্ট কম্পোনেন্ট ফাইলে নেই তা বাদ দেওয়া হয়েছে" +"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 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" = "অবৈধ বা অতিরিক্ত বড় ভেক্টর পাথ ডেটা বাদ দেওয়া হয়েছে" +"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" = "লিগ্যাসি ইমেজ ফিল্টার কন্টেইনার অসমর্থিত; ফিল্টার রূপান্তর বাদ দেওয়া হয়েছে" +"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" = "অ-ডিফল্ট স্লট সেটিংস উপস্থাপিত হয়নি এবং বাদ দেওয়া হয়েছে" +"now" = "এখন" +"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" = "ভেরিয়েবল 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" = "ভেরিয়েবল JSON-এ নেই এমন ভেরিয়েবলের উপর set-variable অ্যাকশন বাদ দেওয়া হয়েছে" +"set-variable actions with values that can't be evaluated were skipped" = "মূল্যায়ন করা যায় না এমন মানযুক্ত set-variable অ্যাকশন বাদ দেওয়া হয়েছে" +"set-variable actions with values that don't fit the variable were skipped" = "ভেরিয়েবলের সাথে মেলে না এমন মানযুক্ত set-variable অ্যাকশন বাদ দেওয়া হয়েছে" +"set-variable actions without a value were skipped" = "মান ছাড়া set-variable অ্যাকশন বাদ দেওয়া হয়েছে" +"set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "ভেরিয়েবল JSON-এ নেই এমন সংগ্রহ বা মোডের উপর set-variable-mode অ্যাকশন বাদ দেওয়া হয়েছে" +"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" = "ভেরিয়েবল 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" = "ভেরিয়েবল 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" = "ভেরিয়েবল 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-এ কোনো ভেরিয়েবল সংজ্ঞা নেই (স্থানীয় ভেরিয়েবল JSON কে `variables` হিসেবে পাস করুন, অথবা ফাইল JSON এর পাশে এর `meta` এমবেড করুন)" +"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" = "ভেরিয়েবল JSON-এ নেই এমন সংগ্রহের ভেরিয়েবল মোড বাদ দেওয়া হয়েছে" +"variable values that don't match their type (or composed colours) were skipped" = "তাদের ধরনের সাথে মেলে না এমন ভেরিয়েবল মান বাদ দেওয়া হয়েছে" +"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" = "অজানা স্ট্রোক জয়েন্টযুক্ত ভেক্টর পয়েন্ট লেয়ার জয়েন্ট ব্যবহার করে" +"vectors without geometry are empty" = "জিওমেট্রি ছাড়া ভেক্টর খালি" +"vectors without geometry are empty (export the file JSON with geometry=paths)" = "জিওমেট্রি ছাড়া ভেক্টর খালি (geometry=paths সহ ফাইল JSON এক্সপোর্ট করুন)" +"very long text was cut to 1,048,576 characters" = "খুব দীর্ঘ টেক্সট কেটে ১,০৪৮,৫৭৬ অক্ষরে ছোট করা হয়েছে" +"very long vector paths were skipped" = "খুব দীর্ঘ ভেক্টর পাথ বাদ দেওয়া হয়েছে" +"video actions are not supported and were skipped" = "ভিডিও অ্যাকশন সমর্থিত নয় এবং বাদ দেওয়া হয়েছে" +"video triggers are not supported and were skipped" = "ভিডিও ট্রিগার সমর্থিত নয় এবং বাদ দেওয়া হয়েছে" +"yesterday" = "গতকাল" +"{instances} in {files}" = "{files}-এ {instances}টি ইনস্ট্যান্স" +"{language}: draft translation, waiting for a native speaker's review." = "{language}: ড্রাফট অনুবাদ, স্থানীয় ভাষাভাষীর পর্যালোচনার অপেক্ষায়।" +"{length} bleed" = "{length} ব্লিড" +"{month} {day}, {year}" = "{day} {month}, {year}" +"{name} cleared from the list" = "তালিকা থেকে {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}\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} from {path}" = "{path} থেকে {name}" +"{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}, 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} files" = { one = "{n}টি ফাইল", other = "{n}টি ফাইল" } +"{n} hours ago" = { 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} 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} weeks ago" = { one = "{n} সপ্তাহ আগে", other = "{n} সপ্তাহ আগে" } +"{n} years ago" = { one = "{n} বছর আগে", other = "{n} বছর আগে" } +"{n}d" = "{n}d" +"{n}h" = "{n}h" +"{n}m" = "{n}m" +"{n}w" = "{n}w" +"{page}, nothing selected" = "{page}, কিছু নির্বাচিত নেই" +"{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}" +"{value} isn't a colour" = "{value} কোনো রঙ নয়" +"{when} · edited" = "{when} · এডিট করা হয়েছে" +"← ↑ → ↓" = "← ↑ → ↓" +"← → ↑ ↓" = "← → ↑ ↓" +"←" = "←" +"→, Space or N" = "→, স্পেস বা N" +"↵" = "↵" +"⇥ / ⇧⇥" = "⇥ / ⇧⇥" +"⌘ arrows" = "⌘ অ্যারো" +"⌘ click" = "⌘ ক্লিক" +"⌘ scroll" = "⌘ স্ক্রল" +"⌥ drag" = "⌥ ড্র্যাগ" From 4506f49ad4297ec96576989fa80b39a2464f0b61 Mon Sep 17 00:00:00 2001 From: Muamer Mustafic Date: Sun, 18 Oct 2026 15:21:28 +0200 Subject: [PATCH 278/817] M3: removing auto layout drops its gap and padding bindings (#810) layout.remove and node.set {layout: null|"none"} now drop the bindings of auto layout fields (gap, crossGap, padding...), as frame-to-section already did for some of them (it now drops all of them). Re-applying a binding no longer creates an auto layout on a frame without one: the binding waits for the next auto layout. Closes #810 Co-authored-by: Cursor --- crates/engine/src/cmd/props.rs | 16 +++++++++-- crates/engine/src/cmd/structure.rs | 6 ++-- crates/engine/src/cmd/styles.rs | 5 ++++ .../engine/src/variables_behaviour_tests.rs | 28 +++++++++++++++++++ 4 files changed, 51 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/props.rs b/crates/engine/src/cmd/props.rs index 8a1f4e1cd..d802e02fa 100644 --- a/crates/engine/src/cmd/props.rs +++ b/crates/engine/src/cmd/props.rs @@ -297,6 +297,12 @@ pub const LAYOUT_KEYS: &[&str] = &[ "gridRowTracks", ]; +/// Drop the bindings of auto layout fields (gap, padding…): they go with the auto layout, or +/// re-applying them would bring it back. +pub fn drop_layout_bindings(n: &mut Node) { + n.bound.retain(|k, _| !LAYOUT_KEYS.contains(&k.as_str())); +} + /// The auto layout of a frame-like node, created when it has none yet. Other nodes can't hold an /// auto layout: an auto layout key on them is refused, not stored where nothing reads it /// (`node.set` on several layers skips them instead, see `edit::set`). @@ -486,8 +492,14 @@ pub fn apply(cmd: &str, doc: &mut Document, id: NodeId, props: &Map n.layout = None, - Value::String(s) if s.eq_ignore_ascii_case("none") => n.layout = None, + Value::Null => { + n.layout = None; + drop_layout_bindings(n); + } + Value::String(s) if s.eq_ignore_ascii_case("none") => { + n.layout = None; + drop_layout_bindings(n); + } Value::String(s) => { let mode = match s.to_ascii_lowercase().as_str() { "horizontal" | "row" => LayoutMode::Horizontal, diff --git a/crates/engine/src/cmd/structure.rs b/crates/engine/src/cmd/structure.rs index 75ddac3d8..0f29069db 100644 --- a/crates/engine/src/cmd/structure.rs +++ b/crates/engine/src/cmd/structure.rs @@ -71,7 +71,9 @@ pub fn specs() -> Vec { // Hugging needs auto layout and the children that filled have nothing to fill: both // become fixed (the frame keeps filling its own auto layout parent). let doc = s.doc_mut()?; - doc.get_mut(i)?.layout = None; + let n = doc.get_mut(i)?; + n.layout = None; + super::props::drop_layout_bindings(n); figcraft_layout::coherent_sizing(doc, i); } ok() @@ -285,7 +287,7 @@ fn convert_to_section(s: &mut Session, p: &Value) -> Result { n.grids.clear(); n.guides.clear(); n.styles.grid = None; - n.bound.retain(|k, _| !k.starts_with("padding") && !matches!(k.as_str(), "gap" | "counterAxisSpacing")); + super::props::drop_layout_bindings(n); let kids = n.children.clone(); for k in kids { // Out of the flow there is nothing to fill or to be absolute against. diff --git a/crates/engine/src/cmd/styles.rs b/crates/engine/src/cmd/styles.rs index adeb22506..649ee033b 100644 --- a/crates/engine/src/cmd/styles.rs +++ b/crates/engine/src/cmd/styles.rs @@ -1021,6 +1021,7 @@ fn apply_bindings_matching(doc: &mut Document, only: Option<&std::collections::B let modes = doc.modes_for(id); let Some(n) = doc.node(id) else { continue }; let binds = n.bound.clone(); + let has_layout = n.layout.is_some(); let mut sets = serde_json::Map::new(); let mut effect_sets: Vec<(usize, String, VariableValue)> = Vec::new(); let mut paint_sets: Vec<(bool, usize, Option, Color)> = Vec::new(); @@ -1030,6 +1031,10 @@ fn apply_bindings_matching(doc: &mut Document, only: Option<&std::collections::B if !include(&field) { continue; } + // A binding never creates an auto layout: without one it waits for the next. + if !has_layout && super::props::LAYOUT_KEYS.contains(&field.as_str()) { + continue; + } let Some(val) = doc.variables.resolve(&var, &modes) else { continue }; // One list item's value: a paint's colour, an effect's or a layout grid's field. if let Some((list, i, prop)) = list_binding(&field) { diff --git a/crates/engine/src/variables_behaviour_tests.rs b/crates/engine/src/variables_behaviour_tests.rs index 5a868a637..c5912959e 100644 --- a/crates/engine/src/variables_behaviour_tests.rs +++ b/crates/engine/src/variables_behaviour_tests.rs @@ -279,6 +279,34 @@ fn bindings_by_field_and_type() { } } +#[test] +fn auto_layout_bindings_go_with_the_auto_layout() { + // Docs silent; pinned (#810): removing a frame's auto layout drops its gap and padding bindings, + // and a binding never brings an auto layout back. One made without auto layout waits for it. + let mut s = Session::new(); + run(&mut s, "variable.createCollection", json!({"name": "C"})); + run(&mut s, "variable.create", json!({"collection": "C", "name": "g", "type": "number", "value": 12})); + let removals = + [("layout.remove", json!({})), ("node.set", json!({"props": {"layout": null}})), ("node.set", json!({"props": {"layout": "none"}}))]; + for (cmd, mut p) in removals { + let f = frame(&mut s, None); + run(&mut s, "layout.add", json!({"ids": [f]})); + for field in ["gap", "crossGap", "paddingTop"] { + run(&mut s, "variable.bind", json!({"ids": [f], "field": field, "variable": "g"})); + } + p["ids"] = json!([f]); + run(&mut s, cmd, p.clone()); + let n = node(&s, f); + assert!(n.layout.is_none(), "{cmd} {p}: auto layout stays removed"); + assert!(n.bound.is_empty(), "{cmd} {p}: layout bindings dropped"); + } + let f = frame(&mut s, None); + run(&mut s, "variable.bind", json!({"ids": [f], "field": "gap", "variable": "g"})); + assert!(node(&s, f).layout.is_none(), "binding gap adds no auto layout"); + run(&mut s, "layout.add", json!({"ids": [f]})); + assert_eq!(node(&s, f).layout.map(|l| l.gap), Some(12.0), "the waiting binding applies to the new auto layout"); +} + #[test] fn deleting_a_bound_variable_keeps_the_last_value() { // Documented: deleting a variable unbinds what used it, which keeps showing its last value. From bbf0d62863a4a82ef14b8efe48fa4c0fa0b7e226 Mon Sep 17 00:00:00 2001 From: Al Rifat Sabbir <150162343+alrifatsabbir@users.noreply.github.com> Date: Sun, 18 Oct 2026 19:43:17 +0600 Subject: [PATCH 279/817] Update Bengali translations in bn.toml Reviewed and updated bugs. --- crates/ui-egui/locales/bn.toml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/crates/ui-egui/locales/bn.toml b/crates/ui-egui/locales/bn.toml index 7cf7dcb92..adedc983a 100644 --- a/crates/ui-egui/locales/bn.toml +++ b/crates/ui-egui/locales/bn.toml @@ -1,18 +1,15 @@ -# FigCraft interface strings: English, the source language. +# FigCraft interface strings: বাংলা, ইংরেজি থেকে অনূদিত। # -# Keys are the English text as the code writes it (`tr("…")`, `trf`, `trn`, `tr_noop`); values are -# the same text, except plural entries ({ one, other }). Command labels come from the engine. -# `cargo test -p figcraft-ui-egui i18n` lists missing and unused keys. See docs/translating.md. +# কীগুলো কোডে ব্যবহৃত ইংরেজি টেক্সট (`tr("…")`, `trf`, `trn`, `tr_noop`); মানগুলো অনূদিত, +# বহুবচন এন্ট্রি ({ one, other }) ছাড়া। কমান্ডের লেবেল ইঞ্জিন থেকে আসে। +# `cargo test -p figcraft-ui-egui i18n` অনুপস্থিত ও অব্যবহৃত কী তালিকাভুক্ত করে। docs/translating.md দেখুন। -[meta] -name = "বাংলা" -status = "draft — needs native review" [meta] name = "বাংলা" status = "draft — needs native review" [ui] -"% of all commits" = "% of all commits" +"% of all commits" = "সমস্ত কমিটের শতাংশ" "(no longer published)" = "(প্রকাশিত নয়)" "({n} warnings: some entries were skipped)" = { one = "({n}টি সতর্কতা: কিছু এন্ট্রি বাদ দেওয়া হয়েছে)", other = "({n}টি সতর্কতা: কিছু এন্ট্রি বাদ দেওয়া হয়েছে)" } "+ Create variable" = "+ ভেরিয়েবল তৈরি করুন" From b778ba17cd89b10ec2a309ebcdc69ef06f9db918 Mon Sep 17 00:00:00 2001 From: Muamer Mustafic Date: Sun, 18 Oct 2026 16:08:12 +0200 Subject: [PATCH 280/817] M1: copying text layers puts their text on the clipboard (#808) edit.copy and edit.cut mirror a selection made only of text layers to the system clipboard as plain text, one layer per line, instead of SVG. Other selections stay SVG; pasting back into FigCraft still pastes the copied layers. Closes #808 Co-authored-by: Cursor --- crates/ui-egui/src/menus.rs | 18 +++++++++++++----- crates/ui-egui/src/web_clipboard_tests.rs | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index e32f50c88..d34b609b5 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -206,12 +206,13 @@ pub fn invoke(app: &mut FigApp, id: &str) { "collab.publish" => crate::live::open_publish(app), "edit.copy" | "edit.cut" => { let ids = app.session.selection(); - // SVG for other apps, taken before a cut removes the layers. - let svg = app.session.doc().ok().and_then(|d| figcraft_svg_export(d, &ids)); + // 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))); app.run(id, json!({})); - // Mirror to the system clipboard (SVG text, else a marker) and remember it, so a later - // paste knows whether the clipboard still holds our layers. - let text = svg.unwrap_or_else(|| format!("figcraft://clipboard/{}", ids.len())); + // 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. + let text = mirror.unwrap_or_else(|| format!("figcraft://clipboard/{}", ids.len())); app.services.clipboard_set_text(&text); app.ui.last_copy = Some(text); } @@ -239,6 +240,13 @@ fn export_frames_pdf(app: &mut FigApp) { }); } +/// The text of a selection made only of text layers, one layer per line (None for any other +/// selection, or when there is no text). +fn text_layers_text(doc: &figcraft_doc::Document, ids: &[figcraft_doc::NodeId]) -> Option { + let texts: Option> = ids.iter().map(|i| doc.node(*i).and_then(|n| n.kind.text()).map(|t| t.characters.as_str())).collect(); + texts.map(|t| t.join("\n")).filter(|t| !t.is_empty()) +} + fn figcraft_svg_export(doc: &figcraft_doc::Document, ids: &[figcraft_doc::NodeId]) -> Option { let bytes = figcraft_engine::cmd::file::export_bytes(doc, ids, figcraft_doc::ExportFormat::Svg, 1.0).ok()?; String::from_utf8(bytes).ok() diff --git a/crates/ui-egui/src/web_clipboard_tests.rs b/crates/ui-egui/src/web_clipboard_tests.rs index 26389ff48..bda57373b 100644 --- a/crates/ui-egui/src/web_clipboard_tests.rs +++ b/crates/ui-egui/src/web_clipboard_tests.rs @@ -141,6 +141,24 @@ fn text_copied_elsewhere_after_our_copy_still_pastes_as_text() { assert_eq!(p.count(text), 1, "newer text from elsewhere becomes a text layer"); } +#[test] +fn copying_text_layers_puts_their_text_on_the_clipboard() { + // #808: other apps get a text layer's text, not its SVG; FigCraft still pastes the layers. + let mut p = Page::new(); + let a = p.app.session.execute("text.create", &json!({"text": "Hello", "x": 0, "y": 200})).unwrap(); + let b = p.app.session.execute("text.create", &json!({"text": "World", "x": 0, "y": 300})).unwrap(); + p.app.session.execute("select.set", &json!({"ids": [a["id"], b["id"]]})).unwrap(); + p.frame(vec![]); + p.copy(); + assert_eq!(p.clipboard, "Hello\nWorld", "one line per text layer"); + p.paste(); + assert_eq!(p.count(text), 4, "the copied text layers were pasted, not one layer of their text"); + let r = p.app.session.doc().unwrap().nodes().find(|n| rect(&n.kind)).map(|n| n.id.0).unwrap(); + p.app.session.execute("select.set", &json!({"ids": [r, a["id"]]})).unwrap(); + p.copy(); + assert!(p.clipboard.contains(" Date: Sun, 18 Oct 2026 17:11:59 +0200 Subject: [PATCH 281/817] fix(plugin): keep the plugin directory's wire format; refuse oversized save_file data - PluginEntry no longer carries save_file: postcard is positional and existing messages keep their fields (docs/collab-protocol.md), so mixed app/server versions keep reading the directory. Manage plugins still shows "can save files". - save_file checks the data length before reading it and refuses with status 1 and the reason, as documented, instead of failing the run with a limit error. Co-Authored-By: Claude Opus 5.5 --- apps/figcraft-server/src/directory.rs | 1 - crates/collab/src/message.rs | 2 -- crates/engine/src/plugin_directory.rs | 2 +- crates/plugin/src/sandbox.rs | 11 +++++++++++ crates/plugin/src/save_file_tests.rs | 10 ++++++---- crates/ui-egui/locales/de.toml | 1 - crates/ui-egui/locales/en.toml | 1 - crates/ui-egui/locales/es.toml | 1 - crates/ui-egui/src/plugins_ui.rs | 3 --- docs/plugins.md | 4 ++-- 10 files changed, 20 insertions(+), 16 deletions(-) diff --git a/apps/figcraft-server/src/directory.rs b/apps/figcraft-server/src/directory.rs index cdf183649..0443c0f49 100644 --- a/apps/figcraft-server/src/directory.rs +++ b/apps/figcraft-server/src/directory.rs @@ -245,7 +245,6 @@ impl Directory { }, commands: m.permissions.commands.clone(), widget: m.widget, - save_file: m.permissions.save_file, bytes: bytes.len() as u64, sha256: sha.clone(), published: now(), diff --git a/crates/collab/src/message.rs b/crates/collab/src/message.rs index 734e4076a..d035042b2 100644 --- a/crates/collab/src/message.rs +++ b/crates/collab/src/message.rs @@ -537,8 +537,6 @@ pub struct PluginEntry { pub commands: Vec, /// It draws a widget. pub widget: bool, - /// It may offer files to save (`permissions.saveFile`). - pub save_file: bool, /// The bundle's size in bytes and its SHA-256 (hex). pub bytes: u64, pub sha256: String, diff --git a/crates/engine/src/plugin_directory.rs b/crates/engine/src/plugin_directory.rs index 1d33178f3..2f721feae 100644 --- a/crates/engine/src/plugin_directory.rs +++ b/crates/engine/src/plugin_directory.rs @@ -288,7 +288,7 @@ pub fn specs() -> Vec { spec!( "plugin.directory.list", "Browse plugin directory", - "{server? (ws://host:port/; default: the one browsed last), query?} → {server, plugins: [{id, name, version, description, author, api, access, commands, widget, save_file, bytes, sha256, published, versions, installed, update}]}", + "{server? (ws://host:port/; default: the one browsed last), query?} → {server, plugins: [{id, name, version, description, author, api, access, commands, widget, bytes, sha256, published, versions, installed, update}]}", false, list ), diff --git a/crates/plugin/src/sandbox.rs b/crates/plugin/src/sandbox.rs index 59d661187..c7337dcab 100644 --- a/crates/plugin/src/sandbox.rs +++ b/crates/plugin/src/sandbox.rs @@ -195,6 +195,12 @@ struct State { } impl State { + /// Make `message` the reply and return status 1 (refused). + fn refuse(&mut self, message: String) -> i32 { + self.set_reply(message.into_bytes()); + 1 + } + /// Make `bytes` the reply; returns its length. fn set_reply(&mut self, bytes: Vec) -> i32 { let max = self.limits.max_message; @@ -595,6 +601,11 @@ fn linker(engine: &Engine) -> Result, PluginError> { charge(&mut c)?; let name = read_str(&mut c, np, nl)?; let mime = read_str(&mut c, mp, ml)?; + // Too much data is a refusal the plugin can handle, not a limit that fails the run. + let (len, max) = (dl as u32 as usize, c.data().limits.max_message); + if len > max { + return Ok(c.data_mut().refuse(format!("a file to save is limited to {max} bytes, this one has {len}"))); + } let data = read_bytes(&mut c, dp, dl)?; Err(ask(&mut c, Request::SaveFile(name, mime, data))) }) diff --git a/crates/plugin/src/save_file_tests.rs b/crates/plugin/src/save_file_tests.rs index 34241bb73..7915323f5 100644 --- a/crates/plugin/src/save_file_tests.rs +++ b/crates/plugin/src/save_file_tests.rs @@ -98,12 +98,14 @@ fn a_host_without_saving_refuses_by_default() { } #[test] -fn too_much_data_is_a_limit_error_and_bad_utf8_a_trap() { - let limits = Limits { max_message: 4, ..Limits::default() }; - let wasm = module("a.txt", "text/plain", b"12345", &call("a.txt", "text/plain", b"12345")); +fn too_much_data_is_refused_and_bad_utf8_a_trap() { + let limits = Limits { max_message: 64, ..Limits::default() }; + let data = [b'x'; 65]; + let wasm = module("a.txt", "text/plain", &data, &call("a.txt", "text/plain", &data)); let mut host = Saves::default(); + // Status 1 with the reason, which the module passes on as its own failure. let err = Instance::new(&wasm, &limits).unwrap().call("{}", &mut host).unwrap_err(); - assert!(matches!(err, PluginError::Limit(_)), "{err:?}"); + assert_eq!(err, PluginError::Failed("a file to save is limited to 64 bytes, this one has 65".into())); assert!(host.0.is_empty()); // The name points at a lone 0xff byte: not UTF-8. diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index 08aa5c1af..03de53af5 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -1533,7 +1533,6 @@ status = "draft — needs native review" "read and edit the document" = "das Dokument lesen und bearbeiten" "read the document" = "das Dokument lesen" "reads the document" = "liest das Dokument" -"save files you choose" = "Dateien an einem von Ihnen gewählten Ort speichern" "set-variable actions on variables that aren't in the variables JSON were skipped" = "Aktionen „Variable festlegen“ für Variablen, die nicht im Variablen-JSON sind, wurden übersprungen" "set-variable actions with values that can't be evaluated were skipped" = "Aktionen „Variable festlegen“ mit nicht auswertbaren Werten wurden übersprungen" "set-variable actions with values that don't fit the variable were skipped" = "Aktionen „Variable festlegen“ mit Werten, die nicht zur Variable passen, wurden übersprungen" diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 58890934c..8a31028e7 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -1621,7 +1621,6 @@ name = "English" "read and edit the document" = "read and edit the document" "read the document" = "read the document" "reads the document" = "reads the document" -"save files you choose" = "save files you choose" "set-variable actions on variables that aren't in the variables JSON were skipped" = "set-variable actions on variables that aren't in the variables JSON were skipped" "set-variable actions with values that can't be evaluated were skipped" = "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 with values that don't fit the variable were skipped" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 1f92bf911..08e47492c 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -1622,7 +1622,6 @@ status = "draft — needs native review" "read and edit the document" = "leer y editar el documento" "read the document" = "leer el documento" "reads the document" = "lee el documento" -"save files you choose" = "guardar archivos donde tú elijas" "set-variable actions on variables that aren't in the variables JSON were skipped" = "se omitieron las acciones «Establecer variable» sobre variables que no están en el JSON de variables" "set-variable actions with values that can't be evaluated were skipped" = "se omitieron las acciones «Establecer variable» con valores que no se pueden evaluar" "set-variable actions with values that don't fit the variable were skipped" = "se omitieron las acciones «Establecer variable» con valores que no encajan con la variable" diff --git a/crates/ui-egui/src/plugins_ui.rs b/crates/ui-egui/src/plugins_ui.rs index 919fd4845..7933fa7b5 100644 --- a/crates/ui-egui/src/plugins_ui.rs +++ b/crates/ui-egui/src/plugins_ui.rs @@ -477,9 +477,6 @@ fn confirm_window(app: &mut FigApp, ctx: &Context, t: &Tokens) { if e.widget { asks.push(tr("put a widget on the canvas").to_string()); } - if e.save_file { - asks.push(tr("save files you choose").to_string()); - } for a in asks { ui.add(egui::Label::new(RichText::new(format!("• {a}")).font(regular(11.0)).color(t.text)).wrap()); } diff --git a/docs/plugins.md b/docs/plugins.md index ed4b99270..a14dd7a44 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -135,7 +135,7 @@ plugins: import them in the script. | `widget.insert` | `{plugin, x?, y?, fuel?}` | Puts widget plugin `plugin`'s widget on the current page, its top-left at `x`, `y` (default: centred in the view), and selects it; the plugin draws it. One undo step. Returns `{id, plugin, state, targets, output, logs, calls, fuel}`: `targets` are the names of its clickable parts. | | `widget.click` | `{id, target, fuel?}` | Clicks part `target` of widget `id` (or of the widget a layer `id` is in), as a click on the canvas would: the plugin is called back and redraws it. One undo step; returns like `widget.insert`. | | `widget.list` | `{}` | `{widgets: [{id, plugin, name, page, state, targets}]}`: every widget in the file. | -| `plugin.directory.list` | `{server?, query?}` | The plugin directory at `server` (`ws://host:port/`; default: the one browsed last): `{server, plugins: [{id, name, version, description, author, api, access, commands, widget, save_file, bytes, sha256, published, versions, installed, update}]}`, the latest version of each plugin whose id, name, description or author contains `query`. `installed` is the installed version (or null), `update` whether the listed one is newer. | +| `plugin.directory.list` | `{server?, query?}` | The plugin directory at `server` (`ws://host:port/`; default: the one browsed last): `{server, plugins: [{id, name, version, description, author, api, access, commands, widget, bytes, sha256, published, versions, installed, update}]}`, the latest version of each plugin whose id, name, description or author contains `query`. `installed` is the installed version (or null), `update` whether the listed one is newer. | | `plugin.directory.install` | `{id, version?, confirm, server?, sha256?}` | Downloads version `version` (default: the latest) and installs it, or updates the installed one. `confirm` must be `true` (installing runs the plugin's code: show its permissions first); without it nothing is downloaded. The download must match the SHA-256 the directory lists (and `sha256`, the one shown, when given). Returns `{installed, name, version, permissions, sha256, path, source, replaced}`. | | `plugin.directory.publish` | `{path \| plugin, server}` | Publishes a plugin folder (or its `figcraft-plugin.json`), or an installed plugin, as a new version. `server` carries the server's key: `ws://host:port/?key=…`. Returns `{published, server}`. | | `plugin.directory.unpublish` | `{id, version?, server}` | Removes one version (default: every version) from the directory; needs the key. Returns `{id, removed}`. | @@ -225,7 +225,7 @@ plugin directory requests (`plugin.directory.*` says so). Import plugins with `p | `author` | Optional: who made it, as you type it (64 characters at most); plugin directories show it. | | `main` | Required. The module, a `.wasm` path relative to the manifest, inside its folder. | | `api` | The plugin API version the plugin was written for: `1` (the default), `2` (panels and settings), `3` (widgets) or `4` (saving files). A manifest asking for a newer one than FigCraft runs is refused, so a plugin that needs panels, widgets or `saveFile` fails clearly on an older FigCraft. | -| `permissions.saveFile` | API 4: `true` lets the plugin offer a file to save (an exporter's output). FigCraft asks the user where it goes with its own Save dialog (a download in the browser); the plugin never gets a path. The install confirmation lists it. | +| `permissions.saveFile` | API 4: `true` lets the plugin offer a file to save (an exporter's output). FigCraft asks the user where it goes with its own Save dialog (a download in the browser); the plugin never gets a path. Manage plugins lists it ("can save files"); a plugin directory's entries don't carry it, so their wire format stays as it is. | | `widget` | API 3: `true` when the plugin draws a widget (it's listed in Plugins ▸ Widgets). | | `permissions.access` | `read` (the default): commands that leave the document as it is; such plugins also run from Dev Mode's Inspect tab. `write`: edits too. | | `permissions.commands` | Optional allowlist: exact command ids or prefixes ending in `*` (`node.*`). Empty: any command the access allows. | From 972e228f41b895d6b7e40dcbac981e65107111a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20Valentin=20N=C3=A9meth?= <61153253+attisvalentin@users.noreply.github.com> Date: Sun, 18 Oct 2026 17:13:49 +0200 Subject: [PATCH 282/817] M4: text.rescanFonts and text.loadFont: fonts installed while the app runs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The system fonts are indexed once per process, so a font installed while FigCraft (or `figcraft-cli mcp`) runs stayed missing until a restart. - text.rescanFonts walks the font folders again and offers the families installed since (loaded families keep their faces) → {added} - text.loadFont {path | data} adds a font file without installing it → {families} - both clear the layout cache so text lays out again in the new face Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/create.rs | 4 +-- crates/engine/src/cmd/text.rs | 30 ++++++++++++++++++ crates/engine/src/tests.rs | 19 ++++++++++++ crates/engine/src/textedit.rs | 3 +- crates/text/src/fontdb.rs | 54 +++++++++++++++++++++++++++++++++ crates/text/src/fontdb_tests.rs | 31 +++++++++++++++++++ crates/text/src/lib.rs | 2 +- docs/mcp.md | 4 ++- 8 files changed, 142 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index 3a9f6d67f..65c526e4b 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -363,12 +363,12 @@ fn free_spot(s: &Session, w: f64, h: f64) -> Result<(f64, f64)> { } #[cfg(not(target_arch = "wasm32"))] -fn read_path(path: &str) -> Result> { +pub(super) fn read_path(path: &str) -> Result> { crate::file_access::read(path) } #[cfg(target_arch = "wasm32")] -fn read_path(path: &str) -> Result> { +pub(super) fn read_path(path: &str) -> Result> { Err(crate::EngineError::Other(format!("{path}: files can't be read in the browser"))) } diff --git a/crates/engine/src/cmd/text.rs b/crates/engine/src/cmd/text.rs index 3b861895a..129c8ead1 100644 --- a/crates/engine/src/cmd/text.rs +++ b/crates/engine/src/cmd/text.rs @@ -474,5 +474,35 @@ pub fn specs() -> Vec { }) } ), + spec!( + "text.rescanFonts", + "Rescan installed fonts", + "{} walks the system font folders again, for fonts installed while the app runs → {added: [families that were unknown]}", + false, + |_, _| Ok(json!({"added": figcraft_text::rescan_system_fonts()})) + ), + spec!( + "text.loadFont", + "Load font file", + "{path | data (base64)} adds a font file (.ttf, .otf, .ttc, .otc; every face of a collection) to this session's fonts without installing it → {families}", + false, + |_, p| { + let cmd = "text.loadFont"; + let bytes = if let Some(b64) = string(p, "data") { + use base64::Engine as _; + let b64 = b64.split_once(',').map(|(_, d)| d.to_string()).unwrap_or(b64); + base64::engine::general_purpose::STANDARD.decode(b64.trim()).map_err(|e| bad(cmd, format!("`data`: {e}")))? + } else if let Some(path) = string(p, "path") { + super::create::read_path(&path)? + } else { + return Err(bad(cmd, "pass `path` or `data` (base64)")); + }; + let families = figcraft_text::load_font_bytes(bytes); + if families.is_empty() { + return Err(bad(cmd, "not a font file")); + } + Ok(json!({"families": families})) + } + ), ] } diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index d8ebfc9e6..7cfa320b7 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -434,6 +434,8 @@ fn every_command_survives_junk_params() { | "file.placeImage" | "image.place" | "file.revert" + // Takes no params and walks the font folders: one walk per junk is slow. + | "text.rescanFonts" ) { continue; } @@ -624,3 +626,20 @@ fn find_replace_changing_only_the_case_replaces_every_occurrence() { assert_eq!(s.doc().unwrap().node(t).unwrap().kind.text().unwrap().characters, "FigCraft and FigCraft, FigCraft"); assert_eq!(s.doc().unwrap().node(f).unwrap().name, "FigCraft / FigCraft"); } + +#[test] +fn fonts_load_from_files_and_rescans_report_new_families() { + let mut s = sess(); + assert!(s.execute("text.loadFont", &json!({})).is_err()); + assert!(s.execute("text.loadFont", &json!({"data": "bm90IGEgZm9udA=="})).is_err(), "not a font file"); + assert!(s.execute("text.loadFont", &json!({"data": "%%%"})).is_err()); + assert!(s.execute("text.loadFont", &json!({"path": "no-such-dir/x.ttf"})).is_err()); + if let Some(f) = figcraft_text::CRAFT_FONTS.first() { + use base64::Engine as _; + let data = base64::engine::general_purpose::STANDARD.encode(f.bytes); + let r = s.execute("text.loadFont", &json!({"data": data})).unwrap(); + assert_eq!(r["families"].as_array().map(Vec::len), Some(1)); + } + let r = s.execute("text.rescanFonts", &json!({})).unwrap(); + assert!(r["added"].is_array()); +} diff --git a/crates/engine/src/textedit.rs b/crates/engine/src/textedit.rs index 76b353a00..38d6a1996 100644 --- a/crates/engine/src/textedit.rs +++ b/crates/engine/src/textedit.rs @@ -793,7 +793,8 @@ mod tests { json!({"variations": {"wght": "heavy", "toolong": 1}, "text": "\u{0}\u{7}", "cursor": 1e300}), json!({"variations": {"wght": 1e300, "opsz": -1e300}, "replace": "yes", "text": "日本語", "cursor": -1}), ]; - for spec in crate::cmd::all_commands().iter().filter(|c| c.id.starts_with("text.")) { + // `text.rescanFonts` takes no params and walks the font folders: one walk per junk is slow. + for spec in crate::cmd::all_commands().iter().filter(|c| c.id.starts_with("text.") && c.id != "text.rescanFonts") { for j in &junk { let (mut s, id) = setup("Hi there\nyou"); begin(&mut s, id, Some(2), false).unwrap(); diff --git a/crates/text/src/fontdb.rs b/crates/text/src/fontdb.rs index f9eda2c6d..aa5777b5e 100644 --- a/crates/text/src/fontdb.rs +++ b/crates/text/src/fontdb.rs @@ -670,6 +670,23 @@ impl FontDb { self.faces.len() } + /// Offer the families of a later walk of the font folders: new families become pending, and a + /// family not loaded yet takes the walk's files (styles installed since). Loaded families keep + /// their faces. Returns the display names of the families that were unknown. + fn merge_rescan(&mut self, found: BTreeMap)>) -> Vec { + let mut added = Vec::new(); + for (k, v) in found { + if self.families.contains_key(&k) { + continue; + } + if !self.pending.contains_key(&k) { + added.push(v.0.clone()); + } + self.pending.insert(k, v); + } + added + } + /// Index the system font directories (desktop only): family names are read now, faces loaded /// when first used. Safe to call more than once. pub fn scan_system(&mut self) { @@ -887,6 +904,43 @@ pub fn scan_system_fonts() { }); } +/// Walk the system font folders again, for fonts installed while the app runs (the first scan is +/// once per process). Returns the families that were unknown before. Before the first scan this +/// is that scan; a no-op on the web or with `FIGCRAFT_NO_SYSTEM_FONTS` set. +pub fn rescan_system_fonts() -> Vec { + #[cfg(not(target_arch = "wasm32"))] + if !system_fonts_opted_out() { + if SCANNED.get().is_none() { + let before: std::collections::BTreeSet = + raw_db().read().unwrap_or_else(std::sync::PoisonError::into_inner).families().into_iter().collect(); + scan_system_fonts(); + return family_names().into_iter().filter(|f| !before.contains(f)).collect(); + } + let mut found: BTreeMap)> = BTreeMap::new(); + for dir in system_font_dirs() { + scan_dir(&dir, 0, &mut found); + } + let added = raw_db().write().unwrap_or_else(std::sync::PoisonError::into_inner).merge_rescan(found); + if !added.is_empty() { + crate::clear_layout_cache(); + } + return added; + } + Vec::new() +} + +/// Load font file bytes (every face of a collection) into the global db, for a font that isn't +/// installed. Returns the families of the faces added (none: not a font file). +pub fn load_font_bytes(bytes: Vec) -> Vec { + let faces = db().write().unwrap_or_else(std::sync::PoisonError::into_inner).add_bytes(bytes); + if !faces.is_empty() { + crate::clear_layout_cache(); + } + let mut families: Vec = faces.iter().map(|f| f.family.clone()).collect(); + families.dedup(); + families +} + /// `FIGCRAFT_NO_SYSTEM_FONTS` is set (and not `0`): renders use only the embedded fonts. #[cfg(not(target_arch = "wasm32"))] fn system_fonts_opted_out() -> bool { diff --git a/crates/text/src/fontdb_tests.rs b/crates/text/src/fontdb_tests.rs index 96ce78426..3574fdfba 100644 --- a/crates/text/src/fontdb_tests.rs +++ b/crates/text/src/fontdb_tests.rs @@ -217,3 +217,34 @@ fn user_font_dirs_preserve_non_utf8_paths() { assert_eq!(dirs[0].as_os_str().as_bytes(), b"/home/\xff/.fonts"); assert_eq!(dirs[1].as_os_str().as_bytes(), b"/data/\xfe/fonts"); } + +#[test] +fn a_rescan_offers_fonts_installed_since() { + let entry = |s: &str| Pending { path: format!("no-such-dir/{s}.ttf").into(), index: 0, style: s.into() }; + let mut db = pending(&["Regular"]); + let found = |fams: &[(&str, &[&str])]| -> BTreeMap)> { + fams.iter().map(|(f, styles)| (f.to_lowercase(), ((*f).to_string(), styles.iter().map(|s| entry(s)).collect()))).collect() + }; + // A new family is reported and offered; a pending one takes the walk's files (a new style). + let added = db.merge_rescan(found(&[("CJK UI", &["Regular", "Bold"]), ("Brand Sans", &["Regular"])])); + assert_eq!(added, ["Brand Sans"]); + assert!(db.has_family("brand sans")); + assert_eq!(left(&db), ["Regular", "Bold"]); + // A loaded family keeps its faces and isn't reported again. + db.families.insert("brand sans".into(), ("Brand Sans".into(), Vec::new())); + db.pending.remove("brand sans"); + assert!(db.merge_rescan(found(&[("Brand Sans", &["Regular"])])).is_empty()); + assert!(!db.pending.contains_key("brand sans")); +} + +#[test] +fn font_bytes_load_into_the_db() { + assert!(load_font_bytes(b"not a font".to_vec()).is_empty()); + assert!(load_font_bytes(Vec::new()).is_empty()); + // With the embedded fonts (absent on CI builds without craft-fonts): a file's family is added. + if let Some(f) = CRAFT_FONTS.first() { + let families = load_font_bytes(f.bytes.to_vec()); + assert_eq!(families.len(), 1); + assert!(families.iter().all(|f| has_family(f))); + } +} diff --git a/crates/text/src/lib.rs b/crates/text/src/lib.rs index 683350f61..e107593e3 100644 --- a/crates/text/src/lib.rs +++ b/crates/text/src/lib.rs @@ -17,7 +17,7 @@ pub use breaks::grapheme_step; pub use color::{ColorBitmap, ColorInk, ColorLayer}; pub use fontdb::{ Axis, CRAFT_FONTS, Coords, Face, FontDb, NamedInstance, axis_label, db, face_with_char, family_names, family_styles, find_face, has_family, - installed_fonts_known, no_coords, scan_system_fonts, scan_system_fonts_on_demand, system_fonts_scanned, + installed_fonts_known, load_font_bytes, no_coords, rescan_system_fonts, scan_system_fonts, scan_system_fonts_on_demand, system_fonts_scanned, }; pub use layout::{Decoration, Glyph, Line, TextLayout, layout}; pub use onpath::OnPath; diff --git a/docs/mcp.md b/docs/mcp.md index c5ffe99f5..787f0c82c 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -234,7 +234,9 @@ Or in a project's `.mcp.json`: `text.setVariations {variations, replace?}` merges instead. `text.fonts {family, style?, axes: true}` lists a font's axes and named instances (named instances are also valid `fontStyle` values). `text.missingFonts` lists the families the document names that aren't installed - (`{families: [{family, layers}]}`); their text draws in a fallback font. + (`{families: [{family, layers}]}`); their text draws in a fallback font. Fonts are indexed once + per process: after installing one, `text.rescanFonts` picks it up (`{added: [families]}`), and + `text.loadFont {path | data (base64)}` adds a font file without installing it (`{families}`). OpenType features: `features {"liga": false, "tnum": true}`. Decorations: `textDecorationStyle` (`solid`, `dotted`, `wavy`), `textDecorationThickness` and `textDecorationOffset` (`auto`, px, or `"10%"` of the font size; the offset runs from the baseline From ba4c502ada1809c3a27a7795a312d0303528e0c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20Valentin=20N=C3=A9meth?= <61153253+attisvalentin@users.noreply.github.com> Date: Sun, 18 Oct 2026 17:35:31 +0200 Subject: [PATCH 283/817] M4: text.refit: auto-sizing text measures its box again once its font is there MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A text box keeps the size it was measured at, so text laid out while its family was missing kept the fallback font's box after the font arrived (a hugging chip clipped its label). - text.refit {ids?} measures auto-sizing text again (whole document by default) → {refitted} - text.rescanFonts and text.loadFont refit the open document's text in the families they add, as one undo step Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/text.rs | 19 +++++--- crates/engine/src/fonts.rs | 77 +++++++++++++++++++++++++++----- crates/engine/src/fonts_tests.rs | 63 ++++++++++++++++++++++++++ docs/mcp.md | 3 ++ 4 files changed, 145 insertions(+), 17 deletions(-) diff --git a/crates/engine/src/cmd/text.rs b/crates/engine/src/cmd/text.rs index 129c8ead1..fbc413344 100644 --- a/crates/engine/src/cmd/text.rs +++ b/crates/engine/src/cmd/text.rs @@ -477,16 +477,20 @@ pub fn specs() -> Vec { spec!( "text.rescanFonts", "Rescan installed fonts", - "{} walks the system font folders again, for fonts installed while the app runs → {added: [families that were unknown]}", - false, - |_, _| Ok(json!({"added": figcraft_text::rescan_system_fonts()})) + "{} walks the system font folders again, for fonts installed while the app runs; the open document's auto-sizing text in those families fits them (text.refit) → {added: [families that were unknown], refitted: [ids]}", + true, + |s, _| { + let added = figcraft_text::rescan_system_fonts(); + let refitted = crate::fonts::refit_open(s, None, Some(&added)); + Ok(json!({"added": added, "refitted": refitted})) + } ), spec!( "text.loadFont", "Load font file", - "{path | data (base64)} adds a font file (.ttf, .otf, .ttc, .otc; every face of a collection) to this session's fonts without installing it → {families}", - false, - |_, p| { + "{path | data (base64)} adds a font file (.ttf, .otf, .ttc, .otc; every face of a collection) to this session's fonts without installing it; the open document's auto-sizing text in its families fits it (text.refit) → {families, refitted: [ids]}", + true, + |s, p| { let cmd = "text.loadFont"; let bytes = if let Some(b64) = string(p, "data") { use base64::Engine as _; @@ -501,7 +505,8 @@ pub fn specs() -> Vec { if families.is_empty() { return Err(bad(cmd, "not a font file")); } - Ok(json!({"families": families})) + let refitted = crate::fonts::refit_open(s, None, Some(&families)); + Ok(json!({"families": families, "refitted": refitted})) } ), ] diff --git a/crates/engine/src/fonts.rs b/crates/engine/src/fonts.rs index 3548124d5..42cc8a569 100644 --- a/crates/engine/src/fonts.rs +++ b/crates/engine/src/fonts.rs @@ -1,13 +1,15 @@ //! Fonts a document names that this machine doesn't have (#752): text layers, their styled //! ranges, text styles and the string variables bound to a font family. Text in such a family -//! is drawn in a fallback font, so the user is told which ones are missing. +//! is drawn in a fallback font, so the user is told which ones are missing. Once such a font is +//! there, [`refit`] lets auto-sizing text measure its box in it again. -use std::collections::BTreeMap; +use std::collections::{BTreeMap, BTreeSet}; -use figcraft_doc::{Document, NodeKind, StyleKind, VariableValue, Variables}; +use figcraft_doc::{Document, NodeId, NodeKind, StyleKind, VariableValue, Variables}; use serde_json::{Value, json}; use crate::cmd::CommandSpec; +use crate::params::{get, req_targets}; use crate::{Result, Session, spec}; /// A family the document names that no installed or built-in font provides. @@ -79,6 +81,52 @@ fn string_values(vars: &Variables, id: &str) -> Vec { out } +/// Auto-sizing text layers measure their boxes again: a box measured while its family was missing +/// (in a fallback font) follows the real face once that's installed or loaded. Only layers under +/// `under` (every layer: `None`) that use one of `families` (any family: `None`). Returns the +/// layers whose size changed. +pub fn refit(doc: &mut Document, under: Option<&[NodeId]>, families: Option<&[String]>) -> Vec { + let want: Option> = families.map(|f| f.iter().map(|x| x.trim().to_lowercase()).collect()); + let scope: Option> = under.map(|ids| ids.iter().flat_map(|i| doc.subtree(*i)).collect()); + let ids: Vec = doc + .nodes() + .filter(|n| scope.as_ref().is_none_or(|s| s.contains(&n.id))) + .filter(|n| { + let NodeKind::Text(t) = &n.kind else { return false }; + let uses = |w: &BTreeSet| { + w.contains(&t.style.font_family.trim().to_lowercase()) + || t.spans().iter().any(|(_, _, st)| w.contains(&st.font_family.trim().to_lowercase())) + }; + want.as_ref().is_none_or(uses) + && figcraft_text::auto_size(n).is_some_and(|(w, h)| (w - n.width).abs() > 1e-6 || (h - n.height).abs() > 1e-6) + }) + .map(|n| n.id) + .collect(); + if !ids.is_empty() { + let before = doc.clone(); + doc.mark_dirty(ids.iter().copied()); + crate::normalize(doc, &before); + } + ids +} + +/// [`refit`] in the open document, if there is one. +pub(crate) fn refit_open(s: &mut Session, under: Option<&[NodeId]>, families: Option<&[String]>) -> Vec { + match s.doc_mut() { + Ok(doc) => refit(doc, under, families), + Err(_) => Vec::new(), + } +} + +fn refit_text(s: &mut Session, p: &Value) -> Result { + let under = match get(p, "ids") { + Some(Value::Array(_)) => Some(req_targets("text.refit", s, p)?), + _ => None, + }; + s.doc()?; + Ok(json!({"refitted": refit_open(s, under.as_deref(), None)})) +} + fn missing_fonts(s: &mut Session, _: &Value) -> Result { let families: Vec = missing(s.doc()?).into_iter().map(|m| json!({"family": m.family, "layers": m.layers})).collect(); s.request_ui("dialog.missingFonts", json!({})); @@ -86,13 +134,22 @@ fn missing_fonts(s: &mut Session, _: &Value) -> Result { } pub fn specs() -> Vec { - vec![spec!( - "text.missingFonts", - "Missing fonts", - "{} fonts the open document names that aren't installed (text layers, styled ranges, text styles, font family variables); the app shows them → {families: [{family, layers}]}", - false, - missing_fonts - )] + vec![ + spec!( + "text.missingFonts", + "Missing fonts", + "{} fonts the open document names that aren't installed (text layers, styled ranges, text styles, font family variables); the app shows them → {families: [{family, layers}]}", + false, + missing_fonts + ), + spec!( + "text.refit", + "Fit text to fonts", + "{ids? (these layers and the text in them; default: the whole document)} auto-sizing text measures its box again, e.g. a box measured in a fallback font while its family was missing → {refitted: [ids whose size changed]}", + true, + refit_text + ), + ] } #[cfg(test)] diff --git a/crates/engine/src/fonts_tests.rs b/crates/engine/src/fonts_tests.rs index a6e2d213f..c947773d2 100644 --- a/crates/engine/src/fonts_tests.rs +++ b/crates/engine/src/fonts_tests.rs @@ -124,3 +124,66 @@ fn needs_an_open_document() { let mut s = Session::empty(); assert!(s.execute("text.missingFonts", &json!({})).is_err()); } + +/// Make `id`'s box stale, as if it was measured in another font: `dw` wider than its content. +fn stale(s: &mut Session, id: figcraft_doc::NodeId, dw: f64) -> f64 { + let doc = s.doc_mut().unwrap(); + let n = doc.get_mut(id).unwrap(); + let want = figcraft_text::auto_size(n).unwrap().0; + n.width = want + dw; + doc.take_dirty(); + want +} + +fn width(s: &Session, id: figcraft_doc::NodeId) -> f64 { + s.doc().unwrap().node(id).unwrap().width +} + +fn refitted(r: &Value) -> Vec { + r["refitted"].as_array().unwrap().iter().map(|v| v.as_u64().unwrap()).collect() +} + +#[test] +fn refit_measures_stale_text_boxes_again() { + let mut s = Session::new(); + let a = text(&mut s, "FigCraft Refit A"); + let b = text(&mut s, "FigCraft Refit B"); + let fixed = text(&mut s, "FigCraft Refit A"); + if let NodeKind::Text(t) = &mut s.doc_mut().unwrap().get_mut(fixed).unwrap().kind { + t.auto_resize = figcraft_doc::TextAutoResize::None; + } + s.execute("select.none", &json!({})).unwrap(); + let want_a = stale(&mut s, a, -30.0); + let want_b = stale(&mut s, b, 25.0); + s.doc_mut().unwrap().get_mut(fixed).unwrap().width = 7.0; + s.doc_mut().unwrap().take_dirty(); + // Only the families asked for. + let only_a = super::refit(s.doc_mut().unwrap(), None, Some(&["figcraft refit a".to_string()])); + assert_eq!(only_a, vec![a]); + assert_eq!(width(&s, a), want_a); + assert_eq!(width(&s, b), want_b + 25.0); + // Only the layers asked for, then everything; a fixed box keeps its size. + stale(&mut s, a, 12.0); + assert!(refitted(&s.execute("text.refit", &json!({"ids": [b]})).unwrap()) == vec![b.0]); + assert_eq!((width(&s, a), width(&s, b)), (want_a + 12.0, want_b)); + assert!(refitted(&s.execute("text.refit", &json!({})).unwrap()) == vec![a.0]); + assert_eq!(width(&s, a), want_a); + assert_eq!(width(&s, fixed), 7.0); + // Nothing stale: nothing changes. + assert!(refitted(&s.execute("text.refit", &json!({})).unwrap()).is_empty()); + assert!(s.execute("text.refit", &json!({"ids": ["nope"]})).is_err()); + assert!(Session::empty().execute("text.refit", &json!({})).is_err()); +} + +#[test] +fn refit_reaches_text_in_instances() { + let mut s = Session::new(); + let t = text(&mut s, "FigCraft Refit C"); + let comp = id_of(&s.execute("component.create", &json!({"ids": [t]})).unwrap()["id"]).unwrap(); + let inst = id_of(&s.execute("instance.create", &json!({"component": comp, "x": 300, "y": 0})).unwrap()["id"]).unwrap(); + let copy = s.doc().unwrap().node(inst).unwrap().children[0]; + let want = stale(&mut s, copy, -20.0); + let r = s.execute("text.refit", &json!({"ids": [inst]})).unwrap(); + assert_eq!(refitted(&r), vec![copy.0]); + assert_eq!(width(&s, copy), want); +} diff --git a/docs/mcp.md b/docs/mcp.md index 787f0c82c..63ff7dd0b 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -237,6 +237,9 @@ Or in a project's `.mcp.json`: (`{families: [{family, layers}]}`); their text draws in a fallback font. Fonts are indexed once per process: after installing one, `text.rescanFonts` picks it up (`{added: [families]}`), and `text.loadFont {path | data (base64)}` adds a font file without installing it (`{families}`). + Text boxes keep the size they were measured at: both refit the open document's auto-sizing text + in the new families (`refitted: [ids]`), and `text.refit {ids?}` does it for any text, e.g. a + file saved while its fonts were missing. OpenType features: `features {"liga": false, "tnum": true}`. Decorations: `textDecorationStyle` (`solid`, `dotted`, `wavy`), `textDecorationThickness` and `textDecorationOffset` (`auto`, px, or `"10%"` of the font size; the offset runs from the baseline From 33c0f94cc8b5475d38c866a38fcbdc8eb774340f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20Valentin=20N=C3=A9meth?= <61153253+attisvalentin@users.noreply.github.com> Date: Sun, 18 Oct 2026 18:46:20 +0200 Subject: [PATCH 284/817] M4: font review fixes: new styles of loaded families, ids checks, repeat loads - text.rescanFonts offers a loaded family the files it hasn't read (styles installed since) and refits every family that gained faces; `added` still lists only the families that were unknown - text.refit refuses an `ids` that isn't a list instead of refitting the whole document - text.loadFont with a file already loaded returns its families without keeping its bytes or adding its faces again - doc comments on the functions this change touches Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/create.rs | 2 + crates/engine/src/cmd/text.rs | 8 ++-- crates/engine/src/fonts.rs | 7 ++- crates/engine/src/fonts_tests.rs | 8 ++++ crates/engine/src/tests.rs | 2 + crates/engine/src/textedit.rs | 1 + crates/text/src/fontdb.rs | 80 +++++++++++++++++++++++--------- crates/text/src/fontdb_tests.rs | 27 ++++++++--- crates/text/src/lib.rs | 5 +- 9 files changed, 105 insertions(+), 35 deletions(-) diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index 65c526e4b..6ec7d4e59 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -362,11 +362,13 @@ fn free_spot(s: &Session, w: f64, h: f64) -> Result<(f64, f64)> { }) } +/// The bytes of the file at `path`, within the session's allowed file roots. #[cfg(not(target_arch = "wasm32"))] pub(super) fn read_path(path: &str) -> Result> { crate::file_access::read(path) } +/// The browser has no files to read: always an error. #[cfg(target_arch = "wasm32")] pub(super) fn read_path(path: &str) -> Result> { Err(crate::EngineError::Other(format!("{path}: files can't be read in the browser"))) diff --git a/crates/engine/src/cmd/text.rs b/crates/engine/src/cmd/text.rs index fbc413344..0f0f003de 100644 --- a/crates/engine/src/cmd/text.rs +++ b/crates/engine/src/cmd/text.rs @@ -477,12 +477,12 @@ pub fn specs() -> Vec { spec!( "text.rescanFonts", "Rescan installed fonts", - "{} walks the system font folders again, for fonts installed while the app runs; the open document's auto-sizing text in those families fits them (text.refit) → {added: [families that were unknown], refitted: [ids]}", + "{} walks the system font folders again, for fonts installed while the app runs; the open document's auto-sizing text in the families that gained faces (new ones, or styles installed since) fits them (text.refit) → {added: [families that were unknown], refitted: [ids]}", true, |s, _| { - let added = figcraft_text::rescan_system_fonts(); - let refitted = crate::fonts::refit_open(s, None, Some(&added)); - Ok(json!({"added": added, "refitted": refitted})) + let rescan = figcraft_text::rescan_system_fonts(); + let refitted = crate::fonts::refit_open(s, None, Some(&rescan.changed)); + Ok(json!({"added": rescan.added, "refitted": refitted})) } ), spec!( diff --git a/crates/engine/src/fonts.rs b/crates/engine/src/fonts.rs index 42cc8a569..672d4f2ca 100644 --- a/crates/engine/src/fonts.rs +++ b/crates/engine/src/fonts.rs @@ -118,10 +118,12 @@ pub(crate) fn refit_open(s: &mut Session, under: Option<&[NodeId]>, families: Op } } +/// `text.refit`: the layers `ids` names (an `ids` that isn't a list of layers is refused), else the +/// whole document. fn refit_text(s: &mut Session, p: &Value) -> Result { let under = match get(p, "ids") { - Some(Value::Array(_)) => Some(req_targets("text.refit", s, p)?), - _ => None, + None | Some(Value::Null) => None, + Some(_) => Some(req_targets("text.refit", s, p)?), }; s.doc()?; Ok(json!({"refitted": refit_open(s, under.as_deref(), None)})) @@ -133,6 +135,7 @@ fn missing_fonts(s: &mut Session, _: &Value) -> Result { Ok(json!({"families": families})) } +/// The font commands: `text.missingFonts` and `text.refit`. pub fn specs() -> Vec { vec![ spec!( diff --git a/crates/engine/src/fonts_tests.rs b/crates/engine/src/fonts_tests.rs index c947773d2..463fb9046 100644 --- a/crates/engine/src/fonts_tests.rs +++ b/crates/engine/src/fonts_tests.rs @@ -135,14 +135,17 @@ fn stale(s: &mut Session, id: figcraft_doc::NodeId, dw: f64) -> f64 { want } +/// The width of layer `id`. fn width(s: &Session, id: figcraft_doc::NodeId) -> f64 { s.doc().unwrap().node(id).unwrap().width } +/// The ids a refit reports. fn refitted(r: &Value) -> Vec { r["refitted"].as_array().unwrap().iter().map(|v| v.as_u64().unwrap()).collect() } +/// Stale boxes fit their text again, by family, by layer or everywhere; fixed boxes keep theirs. #[test] fn refit_measures_stale_text_boxes_again() { let mut s = Session::new(); @@ -172,9 +175,14 @@ fn refit_measures_stale_text_boxes_again() { // Nothing stale: nothing changes. assert!(refitted(&s.execute("text.refit", &json!({})).unwrap()).is_empty()); assert!(s.execute("text.refit", &json!({"ids": ["nope"]})).is_err()); + // An `ids` that isn't a list is refused, not taken as the whole document. + stale(&mut s, a, 9.0); + assert!(s.execute("text.refit", &json!({"ids": a.0.to_string()})).is_err()); + assert_eq!(width(&s, a), want_a + 9.0); assert!(Session::empty().execute("text.refit", &json!({})).is_err()); } +/// Text inside an instance is refitted too. #[test] fn refit_reaches_text_in_instances() { let mut s = Session::new(); diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index 7cfa320b7..ad3b6aa33 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -376,6 +376,7 @@ fn pointer_draw_move_resize() { assert_eq!(s.selection(), vec![r]); } +/// No command panics on junk parameters. #[test] fn every_command_survives_junk_params() { // A junk-parameter sweep: no command may panic (guard turns panics into Internal errors, @@ -627,6 +628,7 @@ fn find_replace_changing_only_the_case_replaces_every_occurrence() { assert_eq!(s.doc().unwrap().node(f).unwrap().name, "FigCraft / FigCraft"); } +/// `text.loadFont` refuses what isn't a font file; `text.rescanFonts` reports what it added. #[test] fn fonts_load_from_files_and_rescans_report_new_families() { let mut s = sess(); diff --git a/crates/engine/src/textedit.rs b/crates/engine/src/textedit.rs index 38d6a1996..902ba1494 100644 --- a/crates/engine/src/textedit.rs +++ b/crates/engine/src/textedit.rs @@ -782,6 +782,7 @@ mod tests { assert!(r.is_null() || r["axes"].is_array()); } + /// No text command panics on junk parameters while a text is being edited. #[test] fn text_commands_survive_junk_while_editing() { let junk = [ diff --git a/crates/text/src/fontdb.rs b/crates/text/src/fontdb.rs index aa5777b5e..814d3a2f7 100644 --- a/crates/text/src/fontdb.rs +++ b/crates/text/src/fontdb.rs @@ -444,9 +444,22 @@ pub struct FontDb { families: BTreeMap)>, /// System faces known by name but not loaded (lower-case family → entries). pending: BTreeMap)>, + /// System faces read from disk (file, face index), so a rescan only offers new ones. + 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>, system_scanned: bool, } +/// What a later walk of the font folders found ([`rescan_system_fonts`]). +#[derive(Clone, Debug, Default, PartialEq, Eq)] +pub struct Rescan { + /// Families that were unknown before. + pub added: Vec, + /// Every family that gained faces: the new ones and those with styles installed since. + pub changed: Vec, +} + static DB: OnceLock> = OnceLock::new(); /// Set by [`scan_system_fonts_on_demand`]. static ON_DEMAND: AtomicBool = AtomicBool::new(false); @@ -580,6 +593,7 @@ impl FontDb { }; if let Some(face) = Face::from_bytes(FontBytes::Shared(bytes), e.index, None, Some(&e.style)) { self.add(face); + self.loaded_files.insert((e.path, e.index)); } } } @@ -670,21 +684,33 @@ impl FontDb { self.faces.len() } - /// Offer the families of a later walk of the font folders: new families become pending, and a - /// family not loaded yet takes the walk's files (styles installed since). Loaded families keep - /// their faces. Returns the display names of the families that were unknown. - fn merge_rescan(&mut self, found: BTreeMap)>) -> Vec { - let mut added = Vec::new(); - for (k, v) in found { + /// Offer the families of a later walk of the font folders: new families become pending, a + /// family not loaded yet takes the walk's files, and a loaded family keeps its faces and gets + /// the files it hasn't read (styles installed since) as pending, read when it is next used. + fn merge_rescan(&mut self, found: BTreeMap)>) -> Rescan { + let mut out = Rescan::default(); + for (k, (display, entries)) in found { if self.families.contains_key(&k) { + let waiting = self.pending.get(&k).map(|(_, v)| v.clone()).unwrap_or_default(); + let new: Vec = entries + .into_iter() + .filter(|e| { + !self.loaded_files.contains(&(e.path.clone(), e.index)) && !waiting.iter().any(|w| w.path == e.path && w.index == e.index) + }) + .collect(); + if !new.is_empty() { + out.changed.push(display.clone()); + self.pending.entry(k).or_insert_with(|| (display, Vec::new())).1.extend(new); + } continue; } if !self.pending.contains_key(&k) { - added.push(v.0.clone()); + out.added.push(display.clone()); } - self.pending.insert(k, v); + out.changed.push(display.clone()); + self.pending.insert(k, (display, entries)); } - added + out } /// Index the system font directories (desktop only): family names are read now, faces loaded @@ -905,39 +931,51 @@ pub fn scan_system_fonts() { } /// Walk the system font folders again, for fonts installed while the app runs (the first scan is -/// once per process). Returns the families that were unknown before. Before the first scan this -/// is that scan; a no-op on the web or with `FIGCRAFT_NO_SYSTEM_FONTS` set. -pub fn rescan_system_fonts() -> Vec { +/// once per process): the families that were unknown before, and every family that gained faces. +/// Before the first scan this is that scan; a no-op on the web or with `FIGCRAFT_NO_SYSTEM_FONTS`. +pub fn rescan_system_fonts() -> Rescan { #[cfg(not(target_arch = "wasm32"))] if !system_fonts_opted_out() { if SCANNED.get().is_none() { let before: std::collections::BTreeSet = raw_db().read().unwrap_or_else(std::sync::PoisonError::into_inner).families().into_iter().collect(); scan_system_fonts(); - return family_names().into_iter().filter(|f| !before.contains(f)).collect(); + let added: Vec = family_names().into_iter().filter(|f| !before.contains(f)).collect(); + return Rescan { changed: added.clone(), added }; } let mut found: BTreeMap)> = BTreeMap::new(); for dir in system_font_dirs() { scan_dir(&dir, 0, &mut found); } - let added = raw_db().write().unwrap_or_else(std::sync::PoisonError::into_inner).merge_rescan(found); - if !added.is_empty() { + let rescan = raw_db().write().unwrap_or_else(std::sync::PoisonError::into_inner).merge_rescan(found); + if !rescan.changed.is_empty() { crate::clear_layout_cache(); } - return added; + return rescan; } - Vec::new() + Rescan::default() } /// Load font file bytes (every face of a collection) into the global db, for a font that isn't -/// installed. Returns the families of the faces added (none: not a font file). +/// installed. Returns the families of its faces (none: not a font file); the same file again +/// returns them without adding its faces twice. pub fn load_font_bytes(bytes: Vec) -> Vec { - let faces = db().write().unwrap_or_else(std::sync::PoisonError::into_inner).add_bytes(bytes); - if !faces.is_empty() { - crate::clear_layout_cache(); + use std::hash::{Hash, Hasher}; + let mut h = std::collections::hash_map::DefaultHasher::new(); + bytes.hash(&mut h); + let key = (h.finish(), bytes.len()); + let mut db = db().write().unwrap_or_else(std::sync::PoisonError::into_inner); + if let Some(families) = db.loaded_bytes.get(&key) { + return families.clone(); } + let faces = db.add_bytes(bytes); let mut families: Vec = faces.iter().map(|f| f.family.clone()).collect(); families.dedup(); + if !families.is_empty() { + db.loaded_bytes.insert(key, families.clone()); + drop(db); + crate::clear_layout_cache(); + } families } diff --git a/crates/text/src/fontdb_tests.rs b/crates/text/src/fontdb_tests.rs index 3574fdfba..f2456d28b 100644 --- a/crates/text/src/fontdb_tests.rs +++ b/crates/text/src/fontdb_tests.rs @@ -218,6 +218,7 @@ fn user_font_dirs_preserve_non_utf8_paths() { assert_eq!(dirs[1].as_os_str().as_bytes(), b"/data/\xfe/fonts"); } +/// A rescan offers new families and the styles installed since, and never a file twice. #[test] fn a_rescan_offers_fonts_installed_since() { let entry = |s: &str| Pending { path: format!("no-such-dir/{s}.ttf").into(), index: 0, style: s.into() }; @@ -225,26 +226,40 @@ fn a_rescan_offers_fonts_installed_since() { let found = |fams: &[(&str, &[&str])]| -> BTreeMap)> { fams.iter().map(|(f, styles)| (f.to_lowercase(), ((*f).to_string(), styles.iter().map(|s| entry(s)).collect()))).collect() }; - // A new family is reported and offered; a pending one takes the walk's files (a new style). - let added = db.merge_rescan(found(&[("CJK UI", &["Regular", "Bold"]), ("Brand Sans", &["Regular"])])); - assert_eq!(added, ["Brand Sans"]); + // A new family is added; a pending one takes the walk's files (a new style); both changed. + let r = db.merge_rescan(found(&[("CJK UI", &["Regular", "Bold"]), ("Brand Sans", &["Regular"])])); + assert_eq!(r.added, ["Brand Sans"]); + assert_eq!(r.changed, ["Brand Sans", "CJK UI"]); assert!(db.has_family("brand sans")); assert_eq!(left(&db), ["Regular", "Bold"]); - // A loaded family keeps its faces and isn't reported again. + // A loaded family keeps its faces and gets only the files it hasn't read, once. db.families.insert("brand sans".into(), ("Brand Sans".into(), Vec::new())); db.pending.remove("brand sans"); - assert!(db.merge_rescan(found(&[("Brand Sans", &["Regular"])])).is_empty()); + db.loaded_files.insert(("no-such-dir/Regular.ttf".into(), 0)); + let same = db.merge_rescan(found(&[("Brand Sans", &["Regular"])])); + assert_eq!(same, Rescan::default()); assert!(!db.pending.contains_key("brand sans")); + let bold = db.merge_rescan(found(&[("Brand Sans", &["Regular", "Black"])])); + assert_eq!((bold.added.len(), bold.changed), (0, vec!["Brand Sans".to_string()])); + let waiting = |db: &FontDb| db.pending.get("brand sans").map(|(_, v)| v.iter().map(|e| e.style.clone()).collect::>()).unwrap_or_default(); + assert_eq!(waiting(&db), ["Black"]); + assert_eq!(db.merge_rescan(found(&[("Brand Sans", &["Regular", "Black"])])), Rescan::default()); + assert_eq!(waiting(&db), ["Black"]); } +/// Font file bytes add their faces once; junk adds nothing. #[test] fn font_bytes_load_into_the_db() { assert!(load_font_bytes(b"not a font".to_vec()).is_empty()); assert!(load_font_bytes(Vec::new()).is_empty()); - // With the embedded fonts (absent on CI builds without craft-fonts): a file's family is added. + // With the embedded fonts (absent on CI builds without craft-fonts): a file's family is added, + // and loading the same file again returns it without adding its faces twice. if let Some(f) = CRAFT_FONTS.first() { let families = load_font_bytes(f.bytes.to_vec()); assert_eq!(families.len(), 1); assert!(families.iter().all(|f| has_family(f))); + let faces = db().read().unwrap().face_count(); + assert_eq!(load_font_bytes(f.bytes.to_vec()), families); + assert_eq!(db().read().unwrap().face_count(), faces); } } diff --git a/crates/text/src/lib.rs b/crates/text/src/lib.rs index e107593e3..667ab7317 100644 --- a/crates/text/src/lib.rs +++ b/crates/text/src/lib.rs @@ -16,8 +16,9 @@ mod onpath; pub use breaks::grapheme_step; pub use color::{ColorBitmap, ColorInk, ColorLayer}; pub use fontdb::{ - Axis, CRAFT_FONTS, Coords, Face, FontDb, NamedInstance, axis_label, db, face_with_char, family_names, family_styles, find_face, has_family, - installed_fonts_known, load_font_bytes, no_coords, rescan_system_fonts, scan_system_fonts, scan_system_fonts_on_demand, system_fonts_scanned, + Axis, CRAFT_FONTS, Coords, Face, FontDb, NamedInstance, Rescan, axis_label, db, face_with_char, family_names, family_styles, find_face, + has_family, installed_fonts_known, load_font_bytes, no_coords, rescan_system_fonts, scan_system_fonts, scan_system_fonts_on_demand, + system_fonts_scanned, }; pub use layout::{Decoration, Glyph, Line, TextLayout, layout}; pub use onpath::OnPath; From f03fc476c87d3900015ae5aac155e10c1cab2664 Mon Sep 17 00:00:00 2001 From: slyim <125447219+slyim@users.noreply.github.com> Date: Sun, 18 Oct 2026 19:59:56 +0300 Subject: [PATCH 285/817] M4: toolbar marks share one size and stroke weight; a simpler Slice icon (#737, #738, #739) Every mark in the bottom toolbar is now painted in one 18-point box. The mode switcher drew its marks in a 14-point box, so Draw, Prototype and Inspect read smaller than the tools. The flyout carets move from a 10-point box, whose stroke rounded to one physical pixel thinner than the row's, to a 14-point box that rounds to the same width at 1x, 1.5x and 2x. Frame and Text are inset by a unit: their long pixel-hinted strokes read heavier than the anti-aliased outlines beside them. Slice is a knife (a slim blade and a solid handle), one silhouette instead of a box crossed by a diagonal. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/icons.rs | 26 ++++++++------ crates/ui-egui/src/toolbar.rs | 66 ++++++++++++++++++++++++++++++++--- 2 files changed, 77 insertions(+), 15 deletions(-) diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs index fa4fb66ea..1a2b72a38 100644 --- a/crates/ui-egui/src/icons.rs +++ b/crates/ui-egui/src/icons.rs @@ -446,18 +446,21 @@ fn draw(p: &P, icon: Icon) { p.path(&h, false); } Frame => { - p.line(5.5, 2.0, 5.5, 14.0); - p.line(10.5, 2.0, 10.5, 14.0); - p.line(2.0, 5.5, 14.0, 5.5); - p.line(2.0, 10.5, 14.0, 10.5); + // Inset a unit from the box: four long hinted strokes read heavier than the + // anti-aliased outlines beside them at full size (#737). + p.line(5.5, 3.0, 5.5, 13.0); + p.line(10.5, 3.0, 10.5, 13.0); + p.line(3.0, 5.5, 13.0, 5.5); + p.line(3.0, 10.5, 13.0, 10.5); } Section | Section2 => { p.rect(2.5, 5.5, 13.5, 13.5, 1.0); p.fill_rect(2.0, 2.0, 9.0, 6.0, 1.0); } Slice => { - p.rect(2.5, 2.5, 13.5, 13.5, 0.0); - p.line(2.5, 13.5, 13.5, 2.5); + // A knife, one silhouette (#739): a slim blade to the top right, a solid handle. + p.poly(&[(13.5, 2.5), (5.0, 8.0), (8.0, 11.0)], true); + p.fill(&capsule((2.8, 13.2), (5.4, 10.6), 1.3)); } Bend => { // A curve with a smooth point and its handle line. @@ -523,11 +526,12 @@ fn draw(p: &P, icon: Icon) { p.line(9.0, 4.5, 11.5, 7.0); } Text => { - p.line(2.0, 3.5, 13.0, 3.5); - p.line(7.5, 3.0, 7.5, 13.0); - p.line(2.5, 3.0, 2.5, 6.0); - p.line(12.5, 3.0, 12.5, 6.0); - p.line(5.0, 12.5, 10.0, 12.5); + // Inset like the Frame mark, so its long strokes don't outweigh the outlines (#737). + p.line(3.0, 3.5, 12.0, 3.5); + p.line(7.5, 3.0, 7.5, 12.5); + p.line(3.5, 3.0, 3.5, 5.5); + p.line(11.5, 3.0, 11.5, 5.5); + p.line(5.5, 12.5, 9.5, 12.5); } Comment => { let mut b: Vec<(f32, f32)> = arc_pts(8.5, 7.5, 5.0, 2.75, TAU + 1.95).collect(); diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index 6da9badb6..aad447085 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -11,6 +11,18 @@ use crate::i18n::{tr, tr_noop, trf}; use crate::icons::{self, Icon}; use crate::theme::{ACCENT, Tokens, regular}; +/// Every mark in the toolbar row is painted in a box this size, so they share one optical size +/// and one stroke width (#737, #738). +const GLYPH: f32 = 18.0; +/// The flyout carets: smaller than the marks, but on a box whose stroke rounds to the same width +/// as theirs at 1×, 1.5× and 2× (a 10-point box drew them one physical pixel thinner). +const CARET: f32 = 14.0; + +/// `GLYPH`'s box centred in `r`. +fn glyph_rect(r: Rect) -> Rect { + Rect::from_center_size(r.center(), vec2(GLYPH, GLYPH)) +} + struct Group { key: &'static str, /// The flyout button's name for screen readers. @@ -121,7 +133,7 @@ fn main_toolbar(app: &mut FigApp, ui: &mut Ui, canvas: Rect, t: &Tokens) { if cresp.hovered() { ui.painter().rect_filled(cr, CornerRadius::same(4), t.hover); } - icons::paint(ui.painter(), Rect::from_center_size(cr.center(), vec2(10.0, 10.0)), Icon::Chevron, t.icon_secondary); + icons::paint(ui.painter(), Rect::from_center_size(cr.center(), vec2(CARET, CARET)), Icon::Chevron, t.icon_secondary); if cresp.clicked() { app.ui.tool_flyout = if app.ui.tool_flyout == Some(g.key) { None } else { Some(g.key) }; } @@ -149,7 +161,7 @@ fn main_toolbar(app: &mut FigApp, ui: &mut Ui, canvas: Rect, t: &Tokens) { } else if resp.hovered() { ui.painter().rect_filled(r, CornerRadius::same(5), t.hover); } - icons::paint(ui.painter(), r.shrink(7.0), icon, if actions_open { Color32::WHITE } else { t.icon }); + icons::paint(ui.painter(), glyph_rect(r), icon, if actions_open { Color32::WHITE } else { t.icon }); if resp.clicked() { if id == "actions" { crate::menus::toggle_palette(&mut app.ui); @@ -181,7 +193,7 @@ fn main_toolbar(app: &mut FigApp, ui: &mut Ui, canvas: Rect, t: &Tokens) { } else if resp.hovered() { ui.painter().rect_filled(r, CornerRadius::same(6), t.hover); } - icons::paint(ui.painter(), r.shrink(9.0), *icon, if i == active { t.accent_text } else { t.icon_secondary }); + icons::paint(ui.painter(), glyph_rect(r), *icon, if i == active { t.accent_text } else { t.icon_secondary }); if resp.clicked() { match i { 0 => { @@ -379,7 +391,7 @@ fn tool_cell(ui: &mut Ui, t: &Tokens, r: Rect, id: impl egui::AsIdSalt, icon: Ic Color32::TRANSPARENT }; ui.painter().rect_filled(r, CornerRadius::same(5), bg); - icons::paint(ui.painter(), r.shrink(7.0), icon, if active { Color32::WHITE } else { t.icon }); + icons::paint(ui.painter(), glyph_rect(r), icon, if active { Color32::WHITE } else { t.icon }); resp } @@ -452,3 +464,49 @@ fn flyout_id(key: &str) -> egui::Id { pub fn pretty_shortcut(s: &str) -> String { figcraft_engine::keymap::display(s, crate::shortcuts::platform()) } + +#[cfg(test)] +mod tests { + use super::*; + use egui::Shape; + + /// The stroke widths `icon` paints with in a `size` box at `ppp` pixels per point. + fn widths(ppp: f32, icon: Icon, size: f32) -> Vec { + let ctx = egui::Context::default(); + let input = || { + let mut i = egui::RawInput::default(); + i.viewports.entry(egui::ViewportId::ROOT).or_default().native_pixels_per_point = Some(ppp); + i + }; + ctx.run_ui(input(), |_| {}).textures_delta.clear(); + let mut out = + ctx.run_ui(input(), |ui| icons::paint(ui.painter(), Rect::from_center_size(pos2(50.0, 50.0), vec2(size, size)), icon, Color32::WHITE)); + out.textures_delta.clear(); + assert_eq!(ctx.pixels_per_point(), ppp); + let mut w: Vec = out + .shapes + .iter() + .filter_map(|c| match &c.shape { + Shape::LineSegment { stroke, .. } => Some(stroke.width), + Shape::Path(p) => Some(p.stroke.width), + Shape::Rect(r) => Some(r.stroke.width), + _ => None, + }) + .filter(|w| *w > 0.0) + .collect(); + w.dedup(); + w + } + + /// The flyout carets and the marks beside them draw with one stroke width (#737), and the + /// mode switcher's marks are the tool marks' size (#738). + #[test] + fn toolbar_marks_share_one_stroke_width() { + for ppp in [1.0, 1.5, 2.0] { + let mark = widths(ppp, Icon::Rectangle, GLYPH); + assert_eq!(mark.len(), 1, "one width at {ppp}×: {mark:?}"); + assert_eq!(widths(ppp, Icon::Chevron, CARET), mark, "caret at {ppp}×"); + assert_eq!(widths(ppp, Icon::Code, GLYPH), mark, "mode mark at {ppp}×"); + } + } +} From bc10bb190dde26bfd8ea5f1bbd1f392d36b0cc51 Mon Sep 17 00:00:00 2001 From: Ahmed5Emad Date: Sun, 18 Oct 2026 20:03:43 +0300 Subject: [PATCH 286/817] M2: individual padding in the Layout panel The Spacing row's toggle opens per-side Top/Right/Bottom/Left fields in a 2x2 grid in place of the H/V fields, each bound to its own padding key with one undo step; shut H/V fields show both values ("16,54") when the sides disagree instead of "Mixed". Original code-drawn side icons, English and Spanish strings (padding_individual_tests). --- ROADMAP.md | 4 +- crates/engine/src/cmd/layout.rs | 28 ++++++ crates/ui-egui/locales/en.toml | 5 + crates/ui-egui/locales/es.toml | 5 + crates/ui-egui/src/icons.rs | 43 ++++++++- crates/ui-egui/src/layout_panel.rs | 92 +++++++++++++++---- crates/ui-egui/src/lib.rs | 2 + .../ui-egui/src/padding_individual_tests.rs | 75 +++++++++++++++ docs/auto-layout-parity.md | 3 +- 9 files changed, 235 insertions(+), 22 deletions(-) create mode 100644 crates/ui-egui/src/padding_individual_tests.rs diff --git a/ROADMAP.md b/ROADMAP.md index 8a587286d..b00408dc7 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (community batch #753: Selection colors, smart-selection spacing, a Present tab; language table re-measured from the catalogs; community fixes from #524 up (55 PRs: `.fig` import fidelity, paste from other apps, the Actions palette, editor fixes, server limits) and a boolean-op crash guard; number variables in the text content picker (#629); frames and sections convert into each other (#719); bounded canvas pan overscan; community fixes from #478 up and a control-channel fix (#589); bounded canvas pan overscan; Typography spacing icons support scrubbing (#373); font scans skip named pipes; system theme on first run; recent files as cards with thumbnails on the home screen; community fixes: lost images reported on loading (#207), SVG import budgets (#190), Leptos code (#223), full screen (#227), server snapshots readable again (#188), owner-only preferences (#200), ruzstd 0.9.1 (#182), layer cycle repair (#205), batch rollback, Direct3D 12 on Windows, plugin metering (#192); vector edit mode regions: hover hatch, selection and drag; SVG/PDF exports refuse over-depth documents (#208); bounded MCP/control framing, connections and queues (#201); plugin log limits (#191); live-session revert guard (#198); attached MCP no longer replays after a lost reply (#194); repeat command recursion fix; the Layout panel's constrain-proportions link scales the other side, #220; 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; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; starter templates, a Templates tab and Getting started tips on the home screen; your online files; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; 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; Windows QA pass with eight fixes; 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%) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (individual padding in the Layout panel, M2) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -131,6 +131,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). ## Progress log +- **2026-10-18** · Individual padding in the Layout panel (M2): the Spacing row's toggle opens per-side Top/Right/Bottom/Left fields in a 2×2 grid in place of the H/V fields, each bound to its own padding key with one undo step; shut H/V fields show both values ("16,54") when the sides disagree instead of "Mixed". Original code-drawn side icons, English and Spanish strings. Numbers unchanged. - **2026-10-17** · Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. - **2026-10-17** · Number variables on text content (M3, #629): the Typography section's variable picker also lists number variables for a text layer's content, as the engine already accepted (the text shows the number, e.g. 42.5, and follows the variable). Other text fields keep their own types. Numbers unchanged. - **2026-10-17** · Frames and sections convert into each other (M1, #719): `object.convertToSection` turns a frame on the page or in a section into a section in place (same box, name, fill and layers, which stay where they are; what only a frame has goes: auto layout, clipping, layout grids, guides, scrolling), and `object.convertToFrame` now also turns a section into a frame that keeps its fill and doesn't clip, so the look stays. Nested frames, instances, main components and sections holding sections are refused with the reason; one undo step each. Both are in the canvas context menu (Convert to section / Convert to frame) and in Spanish. Numbers unchanged. @@ -316,6 +317,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-18 | minor | Individual padding in the Layout panel (M2): the Spacing row's toggle opens per-side Top/Right/Bottom/Left fields in a 2×2 grid in place of the H/V fields, each bound to its own padding key with one undo step; shut H/V fields show both values ("16,54") when the sides disagree instead of "Mixed". Original code-drawn side icons, English and Spanish strings. Numbers unchanged. | | 2026-10-17 | minor | Community batch #753 (10 PRs): Selection colors for mixed selections (#403); smart-selection spacing fields and canvas handles (#402); a Present tab with device and scale controls (#537); adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys to frames only and warns about font styles a family lacks (#603); canvas images on whole device pixels (#359); Adwaita window controls on Wayland without server decorations (#592, not run on GNOME or KDE by the maintainers); the keyboard shortcuts panel closes on the home screen (#548); macOS paste modifiers in tests (#750); credits column tests (#347). `cargo xtask parity` re-run: 212 / 212 menu items (100%; the catalog gained View ▸ Full screen with #227 on 2026-10-14), 561 commands. Language table re-measured from the catalogs (2,272 entries): the drafts read 95–99% (strings added since 2026-10-12 show English), Indonesian has a draft (99%; it read none), and Russian, Swedish (its command labels from #599), Turkish and Czech are listed with their counts. Per-area parity rows for the day's landings in `docs/gaps.md`, `target-app-parity.md` and the area docs. Numbers unchanged | | 2026-10-17 | minor | Control channel while the window is minimised (M8, #720): a minimised or covered window answers every request that acts on the app's state (edits, `ui.inspect`, `ui.pointer`, `ui.key`, `ui.type`, `ui.set`, `app.quit`…) without drawing, and what needs a drawn frame (`ui.screenshot`, `ui.input`, `window.new`) is an error at once; before, those waited up to 60 s and held up every later request on the connection (an attached agent's `inspect_ui` or window screenshot stalled until the window came back). Measured on Windows 11, minimised: requests ~100 ms each (eframe wakes a minimised window at most ten times a second; ~2 ms on screen), a window screenshot fails in ~100 ms instead of 60 s, idle CPU 0. Numbers unchanged. | | 2026-10-17 | minor | Community fixes from #524 up (batches #727, #728, #733, #735, #736 and #729; 55 PRs) and a crash guard. `.fig` import: explicit instance identity, overrides by key, text style precedence, grid track sizes, slot content, connector labels, skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, text on a path, image adjustments and embedded images; large files open within budgets from the file's own size; an import report after opening; imported bytes stay out of the command journal. Files and paste: save a copy as `.fig`; Cmd/Ctrl+V pastes images copied in other apps and layers copied from another design app (`edit.pasteDesignLayers`); paste over and paste properties; clipboard reads on Linux and the BSDs time out after 2 s. Editor: live font preview on hover; Shift+I and Resources open Assets; Shift-drag moves the selection; thin strokes take a nearby double-click; dropped points merge; Flatten keeps open paths; the Actions palette gets tabs, ranked search, a keyboard highlight and recents; the colour picker opens on a new fill or stroke; text strokes follow their alignment; selection highlights after line breaks; a draggable pages/layers divider; variant properties reorder by drag; submenus keep their hover with a safe triangle; menu actions that need a value ask for it; File ▸ Rename edits the name in place. Engine: bad paint indexes, non-finite geometry and pages in copy/cut are refused; a param naming a layer says so when it isn't one; a CLI script is one undo step and resolves `$step`. Server and collaboration: message limits follow `max_file_mb` (client capped at 1 GiB); a damaged generation field no longer drops flushed edits; the web build joins a session from a `#join=` link. Also Swedish command labels, Nix CI through the shared workflow, paint bounds once per render, and a guard that turns a panic inside the boolean-op library into bad input (the stroke draws unclipped). Numbers unchanged. | diff --git a/crates/engine/src/cmd/layout.rs b/crates/engine/src/cmd/layout.rs index 5643ac706..b545e52d2 100644 --- a/crates/engine/src/cmd/layout.rs +++ b/crates/engine/src/cmd/layout.rs @@ -149,6 +149,34 @@ mod tests { assert!(s.execute("node.set", &json!({"id": b, "props": {"absolute": "maybe"}})).is_err()); } + #[test] + fn each_side_padding_sets_its_side_alone() { + let mut s = Session::new(); + let (f, _, _) = al_frame(&mut s); + // One side at a time: the other three stay 0 ([top, right, bottom, left]). + for (key, v, want) in [ + ("paddingTop", 8.0, [8.0, 0.0, 0.0, 0.0]), + ("paddingRight", 12.0, [0.0, 12.0, 0.0, 0.0]), + ("paddingBottom", 16.0, [0.0, 0.0, 16.0, 0.0]), + ("paddingLeft", 20.0, [0.0, 0.0, 0.0, 20.0]), + ] { + ex(&mut s, "node.set", json!({"id": f, "props": {"padding": 0}})); + ex(&mut s, "node.set", json!({"id": f, "props": {key: v}})); + assert_eq!(node(&s, f).layout.as_ref().unwrap().padding, want, "{key}"); + } + // The [t, r, b, l] array and the axis pairs agree with the four sides. + ex(&mut s, "node.set", json!({"id": f, "props": {"padding": [8, 12, 16, 20]}})); + assert_eq!(node(&s, f).layout.as_ref().unwrap().padding, [8.0, 12.0, 16.0, 20.0]); + ex(&mut s, "node.set", json!({"id": f, "props": {"paddingHorizontal": 4}})); + assert_eq!(node(&s, f).layout.as_ref().unwrap().padding, [8.0, 4.0, 16.0, 4.0]); + ex(&mut s, "node.set", json!({"id": f, "props": {"paddingVertical": 2}})); + assert_eq!(node(&s, f).layout.as_ref().unwrap().padding, [2.0, 4.0, 2.0, 4.0]); + // Negatives clamp to 0; junk is refused. + ex(&mut s, "node.set", json!({"id": f, "props": {"paddingTop": -5}})); + assert_eq!(node(&s, f).layout.as_ref().unwrap().padding[0], 0.0); + assert!(s.execute("node.set", &json!({"id": f, "props": {"paddingLeft": "wide"}})).is_err()); + } + #[test] fn baseline_alignment_lines_up_text() { let mut s = Session::new(); diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 17f6b4c5f..d5d28eeb3 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -172,6 +172,7 @@ name = "English" "Both directions" = "Both directions" "Bottom" = "Bottom" "Bottom left radius" = "Bottom left radius" +"Bottom padding" = "Bottom padding" "Bottom right radius" = "Bottom right radius" "Branch" = "Branch" "Branch archived" = "Branch archived" @@ -632,6 +633,7 @@ name = "English" "Included" = "Included" "Included in layout" = "Included in layout" "Individual corners" = "Individual corners" +"Individual padding" = "Individual padding" "Individual strokes" = "Individual strokes" "Ink" = "Ink" "Inner shadow" = "Inner shadow" @@ -702,6 +704,7 @@ name = "English" "Leaves" = "Leaves" "Left" = "Left" "Left & right" = "Left & right" +"Left padding" = "Left padding" "Left side" = "Left side" "Left side width" = "Left side width" "Letter case" = "Letter case" @@ -1134,6 +1137,7 @@ name = "English" "Review and merge" = "Review and merge" "Ribbon" = "Ribbon" "Right" = "Right" +"Right padding" = "Right padding" "Right side" = "Right side" "Right side width" = "Right side width" "Rotate 90°" = "Rotate 90°" @@ -1402,6 +1406,7 @@ name = "English" "Top" = "Top" "Top & bottom" = "Top & bottom" "Top left radius" = "Top left radius" +"Top padding" = "Top padding" "Top right radius" = "Top right radius" "Transform" = "Transform" "Triangle arrow" = "Triangle arrow" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index d054e2223..85f035215 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -175,6 +175,7 @@ status = "draft — needs native review" "Both directions" = "Ambas direcciones" "Bottom" = "Abajo" "Bottom left radius" = "Radio inferior izquierdo" +"Bottom padding" = "Margen interno inferior" "Bottom right radius" = "Radio inferior derecho" "Branch" = "Rama" "Branch archived" = "Rama archivada" @@ -633,6 +634,7 @@ status = "draft — needs native review" "Included" = "Incluidos" "Included in layout" = "Incluidos en el diseño" "Individual corners" = "Esquinas individuales" +"Individual padding" = "Margen interno individual" "Individual strokes" = "Trazos individuales" "Ink" = "Tinta" "Inner shadow" = "Sombra interior" @@ -703,6 +705,7 @@ status = "draft — needs native review" "Leaves" = "Hojas" "Left" = "Izquierda" "Left & right" = "Izquierda y derecha" +"Left padding" = "Margen interno izquierdo" "Left side" = "Lado izquierdo" "Left side width" = "Ancho del lado izquierdo" "Letter case" = "Mayúsculas y minúsculas" @@ -1135,6 +1138,7 @@ status = "draft — needs native review" "Review and merge" = "Revisar y fusionar" "Ribbon" = "Cinta" "Right" = "Derecha" +"Right padding" = "Margen interno derecho" "Right side" = "Lado derecho" "Right side width" = "Ancho del lado derecho" "Rotate 90°" = "Girar 90°" @@ -1403,6 +1407,7 @@ status = "draft — needs native review" "Top" = "Arriba" "Top & bottom" = "Arriba y abajo" "Top left radius" = "Radio superior izquierdo" +"Top padding" = "Margen interno superior" "Top right radius" = "Radio superior derecho" "Transform" = "Transformar" "Triangle arrow" = "Flecha triangular" diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs index fa4fb66ea..f4f2f31ba 100644 --- a/crates/ui-egui/src/icons.rs +++ b/crates/ui-egui/src/icons.rs @@ -85,6 +85,8 @@ icons! { CornerRadius, Angle, IndependentCorners, + /// Individual padding: a frame with one inward tick per side, each set alone. + IndependentPadding, LinkOn, LinkOff, LayoutH, @@ -139,6 +141,11 @@ icons! { Fixed, PaddingH, PaddingV, + /// Individual padding sides: a frame with the controlled side filled. + PaddingTop, + PaddingRight, + PaddingBottom, + PaddingLeft, Gap, Reset, Detach, @@ -706,6 +713,14 @@ fn draw(p: &P, icon: Icon) { p.corner(x, y, dx, dy, 4.0, 2.0); } } + IndependentPadding => { + // A frame outline with one inward tick per side: each side's padding, set alone. + p.rect(2.5, 2.5, 13.5, 13.5, 2.0); + p.line(8.0, 2.5, 8.0, 5.0); + p.line(13.5, 8.0, 11.0, 8.0); + p.line(8.0, 13.5, 8.0, 11.0); + p.line(2.5, 8.0, 5.0, 8.0); + } LinkOn | Link => { p.path(&capsule((4.0, 12.0), (6.5, 9.5), 2.4), true); p.path(&capsule((9.5, 6.5), (12.0, 4.0), 2.4), true); @@ -923,12 +938,32 @@ fn draw(p: &P, icon: Icon) { p.line(3.0, 7.5, 13.0, 7.5); } PaddingH => { - p.rect(2.5, 3.5, 13.5, 12.5, 1.0); - p.fill_rect(5.0, 6.0, 11.0, 10.0, 0.0); + // The horizontal axis: bars across the top and bottom in their frame. + p.rect(2.5, 2.5, 13.5, 13.5, 1.0); + p.fill_rect(2.5, 2.5, 13.5, 5.5, 1.0); + p.fill_rect(2.5, 10.5, 13.5, 13.5, 1.0); } PaddingV => { - p.rect(3.5, 2.5, 12.5, 13.5, 1.0); - p.fill_rect(6.0, 5.0, 10.0, 11.0, 0.0); + // The vertical axis: bars down the left and right in their frame. + p.rect(2.5, 2.5, 13.5, 13.5, 1.0); + p.fill_rect(2.5, 2.5, 5.5, 13.5, 1.0); + p.fill_rect(10.5, 2.5, 13.5, 13.5, 1.0); + } + PaddingTop => { + p.rect(2.5, 2.5, 13.5, 13.5, 1.0); + p.fill_rect(2.5, 2.5, 13.5, 5.5, 1.0); + } + PaddingRight => { + p.rect(2.5, 2.5, 13.5, 13.5, 1.0); + p.fill_rect(10.5, 2.5, 13.5, 13.5, 1.0); + } + PaddingBottom => { + p.rect(2.5, 2.5, 13.5, 13.5, 1.0); + p.fill_rect(2.5, 10.5, 13.5, 13.5, 1.0); + } + PaddingLeft => { + p.rect(2.5, 2.5, 13.5, 13.5, 1.0); + p.fill_rect(2.5, 2.5, 5.5, 13.5, 1.0); } Online => { p.circle(8.0, 8.0, 5.5); diff --git a/crates/ui-egui/src/layout_panel.rs b/crates/ui-egui/src/layout_panel.rs index 11d303693..72d44b9af 100644 --- a/crates/ui-egui/src/layout_panel.rs +++ b/crates/ui-egui/src/layout_panel.rs @@ -4,7 +4,7 @@ //! alignment in its cell, and clip content. Everything goes through `node.set` props or `layout.*` //! commands. -use egui::{Align2, CornerRadius, Id, Rect, Sense, Stroke, StrokeKind, Ui, pos2, vec2}; +use egui::{Align, Align2, CornerRadius, Id, Layout, Rect, Sense, Stroke, StrokeKind, Ui, pos2, vec2}; use figcraft_doc::*; use serde_json::json; @@ -404,31 +404,91 @@ fn alignment(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], l: &AutoLayout) { fn spacing(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], l: &AutoLayout) { let col = widgets::col_width(ui.available_width()); let [pt, pr, pb, pl] = l.padding; + let open = ui.data(|d| d.get_temp::(Id::new("indep_padding"))).unwrap_or(false); + if open { + // Each side on its own, like Figma's individual padding: a 2x2 grid of sides with + // the toggle at its right, replacing the H/V row while open. Every measure copies + // a plain row: 32px rows, the panel's own inter-row gap, 8px between the fields. + let gap = ui.spacing().item_spacing.y; + let total = 32.0 * 2.0 + gap; + let fields_w = col * 2.0 + 8.0; + let top = ("paddingTop", tr("Top padding"), Icon::PaddingTop, pt, 0); + let right = ("paddingRight", tr("Right padding"), Icon::PaddingRight, pr, 1); + let bottom = ("paddingBottom", tr("Bottom padding"), Icon::PaddingBottom, pb, 2); + let left = ("paddingLeft", tr("Left padding"), Icon::PaddingLeft, pl, 3); + block(ui, total, 0.0, |ui| { + ui.allocate_ui_with_layout(vec2(fields_w, total), Layout::top_down(Align::LEFT), |ui| { + ui.spacing_mut().item_spacing.y = 0.0; + // The horizontal pair (left, right) on the left, the vertical pair on the right. + for (r, pair) in [[&left, &top], [&right, &bottom]].iter().enumerate() { + if r > 0 { + ui.add_space(gap); + } + ui.allocate_ui_with_layout(vec2(fields_w, 32.0), Layout::left_to_right(Align::Center), |ui| { + ui.spacing_mut().item_spacing.x = 8.0; + for (key, name, icon, v, k) in pair.iter() { + let e = crate::variable_ui::number_field( + app, + ui, + ids, + key, + Id::new(("padding", *k)), + Lead::Icon(*icon, name), + Some(*v), + "", + col, + ); + app.field(ids, key, e, |v| json!(v.max(0.0))); + } + }); + } + }); + // The toggle keeps the shut row's rect: full-height strip, button 4px + // down, centred in the top 32px exactly like the shut row. + ui.allocate_ui_with_layout(vec2(24.0, total), Layout::top_down(Align::Center), |ui| { + ui.add_space(4.0); + if icons::button(ui, Icon::IndependentPadding, 24.0, true, tr("Individual padding")).clicked() { + ui.data_mut(|d| d.insert_temp(Id::new("indep_padding"), false)); + } + }); + }); + return; + } row(ui, 32.0, |ui| { - let e = crate::variable_ui::number_field( - app, - ui, - ids, - "paddingHorizontal", - Id::new("al_padh"), - Lead::Icon(Icon::PaddingH, tr("Horizontal padding")), - (pl == pr).then_some(pl), - "", - col, - ); - app.field(ids, "paddingHorizontal", e, |v| json!(v.max(0.0))); - let e = crate::variable_ui::number_field( + // Sides that disagree show both values ("16,54") instead of "Mixed". + let v_pair = format!("{},{}", widgets::fmt_num(pt), widgets::fmt_num(pb)); + let v_empty = if pt == pb { tr("Mixed") } else { v_pair.as_str() }; + let e = crate::variable_ui::number_field_or( app, ui, ids, "paddingVertical", Id::new("al_padv"), - Lead::Icon(Icon::PaddingV, tr("Vertical padding")), (pt == pb).then_some(pt), - "", col, + v_empty, + Lead::Icon(Icon::PaddingV, tr("Vertical padding")), + "", ); app.field(ids, "paddingVertical", e, |v| json!(v.max(0.0))); + let h_pair = format!("{},{}", widgets::fmt_num(pl), widgets::fmt_num(pr)); + let h_empty = if pl == pr { tr("Mixed") } else { h_pair.as_str() }; + let e = crate::variable_ui::number_field_or( + app, + ui, + ids, + "paddingHorizontal", + Id::new("al_padh"), + (pl == pr).then_some(pl), + col, + h_empty, + Lead::Icon(Icon::PaddingH, tr("Horizontal padding")), + "", + ); + app.field(ids, "paddingHorizontal", e, |v| json!(v.max(0.0))); + if icons::button(ui, Icon::IndependentPadding, 24.0, false, tr("Individual padding")).clicked() { + ui.data_mut(|d| d.insert_temp(Id::new("indep_padding"), true)); + } }); if l.mode != LayoutMode::Grid && l.wrap { // Wrapped rows (horizontal) or columns (vertical): the gap between them. diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 450317b43..47c6d960e 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -156,6 +156,8 @@ mod online_tests; #[cfg(test)] mod open_issues_tests; #[cfg(test)] +mod padding_individual_tests; +#[cfg(test)] mod palette_tests; #[cfg(test)] mod panel_remove_tests; diff --git a/crates/ui-egui/src/padding_individual_tests.rs b/crates/ui-egui/src/padding_individual_tests.rs new file mode 100644 index 000000000..e6397033e --- /dev/null +++ b/crates/ui-egui/src/padding_individual_tests.rs @@ -0,0 +1,75 @@ +//! Individual padding in the Design panel, driven headless: the four side fields only +//! appear once the toggle opens, and typing in one sets that side alone. + +use egui::accesskit::Role; +use egui::{Event, Id, Key, Modifiers, Pos2, pos2}; +use figcraft_doc::NodeId; +use figcraft_engine::Session; +use serde_json::json; + +use crate::layers_drag_tests::Ui; + +/// An auto layout frame with uniform padding 10, selected. +fn scene() -> (Ui, NodeId) { + let mut s = Session::new(); + let f = + NodeId( + s.execute("frame.create", &json!({"x": 0, "y": 0, "width": 300, "height": 200, "props": {"layout": "horizontal", "padding": 10}})) + .unwrap()["id"] + .as_u64() + .unwrap(), + ); + s.execute("select.set", &json!({"ids": [f]})).unwrap(); + (Ui::new(s), f) +} + +fn padding(u: &Ui, f: NodeId) -> [f64; 4] { + u.app.session.doc().unwrap().node(f).unwrap().layout.clone().unwrap().padding +} + +fn click(u: &mut Ui, p: Pos2) { + u.button(p, true); + u.button(p, false); + u.frame(vec![]); +} + +fn enter(u: &mut Ui) { + u.frame(vec![ + Event::Key { key: Key::Enter, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::NONE }, + Event::Key { key: Key::Enter, physical_key: None, pressed: false, repeat: false, modifiers: Modifiers::NONE }, + ]); +} + +/// The middle of the toggle button named `label`, found in the AccessKit tree. +fn named_button(u: &mut Ui, label: &str) -> Pos2 { + u.ctx.enable_accesskit(); + u.frame(vec![]); + let out = u.frame_output(vec![]); + let nodes = out.platform_output.accesskit_update.expect("an AccessKit update").nodes; + let n = nodes.iter().map(|(_, n)| n).find(|n| n.role() == Role::Button && n.label() == Some(label)).expect(label); + let b = n.bounds().expect("bounds"); + pos2(((b.x0 + b.x1) / 2.0) as f32, ((b.y0 + b.y1) / 2.0) as f32) +} + +#[test] +fn side_fields_show_only_once_the_toggle_opens_and_set_one_side() { + let (mut u, f) = scene(); + assert_eq!(padding(&u, f), [10.0; 4]); + // Shut: no per-side fields. + assert!(u.ctx.read_response(Id::new(("padding", 0)).with("field")).is_none(), "top field hidden until toggled"); + // Click the toggle: the four sides appear. + let t = named_button(&mut u, "Individual padding"); + click(&mut u, t); + let top = u.ctx.read_response(Id::new(("padding", 0)).with("field")).expect("top field shows").rect.center(); + assert!(u.ctx.read_response(Id::new(("padding", 3)).with("field")).is_some(), "left field shows"); + // Typing in the top field sets only the top, in one undo step. + let history = u.app.session.undo_depth().0; + click(&mut u, top); + u.frame(vec![Event::Text("8".into())]); + enter(&mut u); + u.frame(vec![]); + assert_eq!(padding(&u, f), [8.0, 10.0, 10.0, 10.0]); + assert_eq!(u.app.session.undo_depth().0, history + 1); + u.app.run("edit.undo", json!({})); + assert_eq!(padding(&u, f), [10.0; 4]); +} diff --git a/docs/auto-layout-parity.md b/docs/auto-layout-parity.md index ea2cc54f5..5342135a3 100644 --- a/docs/auto-layout-parity.md +++ b/docs/auto-layout-parity.md @@ -64,7 +64,7 @@ Status: **pass** (a case in the suite holds), **fixed** (the suite found a diver | Nested hug/fill settling in one pass (three levels, wrapping fill text, grid rows) | done | | | 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) | +| 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); the Layout panel's Spacing row opens per-side padding fields (Top/Right/Bottom/Left) behind a toggle | | Drag to reorder (wrap-aware, by row or column), into grid cells, across nested frames | done | `al_drag_tests.rs` | | 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 | | @@ -77,6 +77,7 @@ Status: **pass** (a case in the suite holds), **fixed** (the suite found a diver | Date | Change | Summary | |---|---|---| +| 2026-10-18 | minor | Individual padding in the Layout panel (M2): the Spacing row's toggle opens per-side Top/Right/Bottom/Left fields in a 2×2 grid in place of the H/V fields, each bound to its own padding key with one undo step; shut H/V fields show both values ("16,54") when the sides disagree instead of "Mixed". Original code-drawn side icons, English and Spanish strings (`padding_individual_tests`). Numbers unchanged | | 2026-10-17 | minor | Community batch #753: adding auto layout to an empty frame keeps its size, Fixed, while a frame with content hugs it (#369); `node.set` applies auto layout keys to the frames among its targets and warns about the others, and a font style the family lacks warns with the nearest face (#603). Checked over MCP. Numbers unchanged | | 2026-10-13 | minor | Auto layout, on-canvas handles of automatic gaps (M2): the handle between spread rows or columns (and between items with an auto gap) shows the distance the layout gives the gap instead of the stored value, and dragging it makes the gap a fixed one from there, as typing a gap in the panel does; one undo step (`gap_handle_tests`). Before, the drag changed a value that had no effect. The documentation is silent on dragging an automatic gap. Numbers unchanged. | | 2026-10-13 | minor | Auto layout, wrapped-line alignment (M2): a wrapping layout's lines (rows of a horizontal one, columns of a vertical one) are packed where the cross alignment says (start, centre, end; before, they always sat at the start), stretch when every child fills across the flow, or take the free space between them (`contentAlign: spaceBetween`, the Design panel's Row/Column gap mode, the alignment pad lighting the whole cross axis). Read from REST JSON and `.fig`, written to `.fig`, `align-content` in CSS, an instance override with the other alignment settings. 13 hand-computed layout cases and command tests. Numbers unchanged. | From 7558ac0444277ae61fb9b3da603a6745c798f720 Mon Sep 17 00:00:00 2001 From: slyim <125447219+slyim@users.noreply.github.com> Date: Sun, 18 Oct 2026 20:06:21 +0300 Subject: [PATCH 287/817] #826: doc comments for draw and main_toolbar Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/icons.rs | 1 + crates/ui-egui/src/toolbar.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs index 1a2b72a38..758a57ea2 100644 --- a/crates/ui-egui/src/icons.rs +++ b/crates/ui-egui/src/icons.rs @@ -421,6 +421,7 @@ pub fn paint(painter: &Painter, rect: Rect, icon: Icon, color: Color32) { draw(&p, icon); } +/// Draw `icon` on the 16-unit grid through `p`, which maps grid units to the target box. fn draw(p: &P, icon: Icon) { use Icon::*; match icon { diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index aad447085..de5993b4a 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -94,6 +94,8 @@ pub(crate) fn main_width() -> f32 { GROUPS.len() as f32 * (cell + gap) + gap * 10.0 + 2.0 * (cell + gap) + 16.0 + 4.0 * 34.0 + 24.0 } +/// The main toolbar pill: the tool groups with their flyouts, Resources and Actions, then the +/// Draw · Design · Prototype · Inspect mode switcher. fn main_toolbar(app: &mut FigApp, ui: &mut Ui, canvas: Rect, t: &Tokens) { let (cell, gap) = (32.0, 4.0); let width = main_width(); From 7a5bd57611ade8faffe20131db2cc7e463b583dc Mon Sep 17 00:00:00 2001 From: slyim <125447219+slyim@users.noreply.github.com> Date: Sun, 18 Oct 2026 20:11:38 +0300 Subject: [PATCH 288/817] #826: the Slice handle overlaps the blade's base so the knife joins at every size Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/icons.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs index 758a57ea2..35adef116 100644 --- a/crates/ui-egui/src/icons.rs +++ b/crates/ui-egui/src/icons.rs @@ -459,9 +459,11 @@ fn draw(p: &P, icon: Icon) { p.fill_rect(2.0, 2.0, 9.0, 6.0, 1.0); } Slice => { - // A knife, one silhouette (#739): a slim blade to the top right, a solid handle. + // A knife, one silhouette (#739): a slim blade to the top right, outlined like the + // rest of the row, and a solid handle whose end overlaps the blade's base so the two + // join at every size. p.poly(&[(13.5, 2.5), (5.0, 8.0), (8.0, 11.0)], true); - p.fill(&capsule((2.8, 13.2), (5.4, 10.6), 1.3)); + p.fill(&capsule((2.8, 13.2), (5.9, 10.1), 1.3)); } Bend => { // A curve with a smooth point and its handle line. From aec3a22fdfa764b431fa0caa24f9c980456e5cb6 Mon Sep 17 00:00:00 2001 From: Ahmed5Emad Date: Sun, 18 Oct 2026 20:24:12 +0300 Subject: [PATCH 289/817] M2: shut padding pair fields edit their own axis The closed Spacing row paired each icon with the other axis: the side-bars field wrote top/bottom and the top/bottom-bars field wrote left/right. The H field now binds paddingHorizontal (left+right) and the V field paddingVertical (top+bottom); the PaddingH/PaddingV paintings were swapped to match so every icon is pixel-identical. (shut_pair_fields_edit_their_own_axis). --- crates/ui-egui/src/icons.rs | 14 ++++---- crates/ui-egui/src/layout_panel.rs | 30 ++++++++--------- .../ui-egui/src/padding_individual_tests.rs | 32 +++++++++++++++++++ 3 files changed, 54 insertions(+), 22 deletions(-) diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs index f4f2f31ba..d9cb32ccb 100644 --- a/crates/ui-egui/src/icons.rs +++ b/crates/ui-egui/src/icons.rs @@ -938,17 +938,17 @@ fn draw(p: &P, icon: Icon) { p.line(3.0, 7.5, 13.0, 7.5); } PaddingH => { - // The horizontal axis: bars across the top and bottom in their frame. - p.rect(2.5, 2.5, 13.5, 13.5, 1.0); - p.fill_rect(2.5, 2.5, 13.5, 5.5, 1.0); - p.fill_rect(2.5, 10.5, 13.5, 13.5, 1.0); - } - PaddingV => { - // The vertical axis: bars down the left and right in their frame. + // Horizontal padding: bars down the padded left and right sides in their frame. p.rect(2.5, 2.5, 13.5, 13.5, 1.0); p.fill_rect(2.5, 2.5, 5.5, 13.5, 1.0); p.fill_rect(10.5, 2.5, 13.5, 13.5, 1.0); } + PaddingV => { + // Vertical padding: bars across the padded top and bottom in their frame. + p.rect(2.5, 2.5, 13.5, 13.5, 1.0); + p.fill_rect(2.5, 2.5, 13.5, 5.5, 1.0); + p.fill_rect(2.5, 10.5, 13.5, 13.5, 1.0); + } PaddingTop => { p.rect(2.5, 2.5, 13.5, 13.5, 1.0); p.fill_rect(2.5, 2.5, 13.5, 5.5, 1.0); diff --git a/crates/ui-egui/src/layout_panel.rs b/crates/ui-egui/src/layout_panel.rs index 72d44b9af..9f69c6c4c 100644 --- a/crates/ui-egui/src/layout_panel.rs +++ b/crates/ui-egui/src/layout_panel.rs @@ -456,21 +456,6 @@ fn spacing(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], l: &AutoLayout) { } row(ui, 32.0, |ui| { // Sides that disagree show both values ("16,54") instead of "Mixed". - let v_pair = format!("{},{}", widgets::fmt_num(pt), widgets::fmt_num(pb)); - let v_empty = if pt == pb { tr("Mixed") } else { v_pair.as_str() }; - let e = crate::variable_ui::number_field_or( - app, - ui, - ids, - "paddingVertical", - Id::new("al_padv"), - (pt == pb).then_some(pt), - col, - v_empty, - Lead::Icon(Icon::PaddingV, tr("Vertical padding")), - "", - ); - app.field(ids, "paddingVertical", e, |v| json!(v.max(0.0))); let h_pair = format!("{},{}", widgets::fmt_num(pl), widgets::fmt_num(pr)); let h_empty = if pl == pr { tr("Mixed") } else { h_pair.as_str() }; let e = crate::variable_ui::number_field_or( @@ -486,6 +471,21 @@ fn spacing(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], l: &AutoLayout) { "", ); app.field(ids, "paddingHorizontal", e, |v| json!(v.max(0.0))); + let v_pair = format!("{},{}", widgets::fmt_num(pt), widgets::fmt_num(pb)); + let v_empty = if pt == pb { tr("Mixed") } else { v_pair.as_str() }; + let e = crate::variable_ui::number_field_or( + app, + ui, + ids, + "paddingVertical", + Id::new("al_padv"), + (pt == pb).then_some(pt), + col, + v_empty, + Lead::Icon(Icon::PaddingV, tr("Vertical padding")), + "", + ); + app.field(ids, "paddingVertical", e, |v| json!(v.max(0.0))); if icons::button(ui, Icon::IndependentPadding, 24.0, false, tr("Individual padding")).clicked() { ui.data_mut(|d| d.insert_temp(Id::new("indep_padding"), true)); } diff --git a/crates/ui-egui/src/padding_individual_tests.rs b/crates/ui-egui/src/padding_individual_tests.rs index e6397033e..8fdb31925 100644 --- a/crates/ui-egui/src/padding_individual_tests.rs +++ b/crates/ui-egui/src/padding_individual_tests.rs @@ -73,3 +73,35 @@ fn side_fields_show_only_once_the_toggle_opens_and_set_one_side() { u.app.run("edit.undo", json!({})); assert_eq!(padding(&u, f), [10.0; 4]); } + +/// The middle of the shut pair field with accessible name `label`. +fn named_field(u: &mut Ui, label: &str) -> Pos2 { + u.ctx.enable_accesskit(); + u.frame(vec![]); + let out = u.frame_output(vec![]); + let nodes = out.platform_output.accesskit_update.expect("an AccessKit update").nodes; + let n = nodes.iter().map(|(_, n)| n).find(|n| n.role() != Role::Button && n.label() == Some(label)).expect(label); + let b = n.bounds().expect("bounds"); + pos2(((b.x0 + b.x1) / 2.0) as f32, ((b.y0 + b.y1) / 2.0) as f32) +} + +/// The shut pair fields edit their own axis: horizontal touches left and right +/// only, vertical touches top and bottom only. +#[test] +fn shut_pair_fields_edit_their_own_axis() { + let (mut u, f) = scene(); + u.app.run("node.set", json!({"ids": [f], "props": {"paddingLeft": 16.0, "paddingRight": 54.0}})); + assert_eq!(padding(&u, f), [10.0, 54.0, 10.0, 16.0]); + let h = named_field(&mut u, "Horizontal padding"); + click(&mut u, h); + u.frame(vec![Event::Text("20".into())]); + enter(&mut u); + u.frame(vec![]); + assert_eq!(padding(&u, f), [10.0, 20.0, 10.0, 20.0]); + let v = named_field(&mut u, "Vertical padding"); + click(&mut u, v); + u.frame(vec![Event::Text("7".into())]); + enter(&mut u); + u.frame(vec![]); + assert_eq!(padding(&u, f), [7.0, 20.0, 7.0, 20.0]); +} From 72990373c4c89e582bafaae14a6b75c8287fcda2 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Sun, 18 Oct 2026 19:27:45 +0200 Subject: [PATCH 290/817] Keep multiline layer names inside the SwiftUI/Compose too-deep comment Found while testing crates/engine/src/codegen.rs:865 (swift_layer) and :1038 (compose_layer) Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/engine/src/codegen.rs | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/codegen.rs b/crates/engine/src/codegen.rs index 6dd806462..9741e4700 100644 --- a/crates/engine/src/codegen.rs +++ b/crates/engine/src/codegen.rs @@ -858,11 +858,16 @@ pub(crate) fn swift(ctx: &Ctx, id: NodeId, depth: usize, out: &mut String, extra swift_layer(ctx, n, depth, out, extra); } +/// A layer name safe for a single-line `//` comment: line breaks become spaces. +fn one_line(name: &str) -> String { + name.replace(['\n', '\r', '\u{85}', '\u{2028}', '\u{2029}'], " ") +} + fn swift_layer(ctx: &Ctx, n: &Node, depth: usize, out: &mut String, extra: &[String]) { let doc = ctx.doc; let pad = indent(depth); if ctx.too_deep(depth) { - out.push_str(&format!("{pad}// {} …\n", n.name)); + out.push_str(&format!("{pad}// {} …\n", one_line(&n.name))); return; } // Nested instances are calls; an instance swap parameter is a view. @@ -1035,7 +1040,7 @@ fn compose_layer(ctx: &Ctx, n: &Node, depth: usize, out: &mut String) { let doc = ctx.doc; let pad = indent(depth); if ctx.too_deep(depth) { - out.push_str(&format!("{pad}// {} …\n", n.name)); + out.push_str(&format!("{pad}// {} …\n", one_line(&n.name))); return; } // Nested instances are calls; an instance swap parameter is a composable. @@ -1168,4 +1173,26 @@ mod tests { assert!(kt.contains("Modifier.offset(7.dp, 9.dp)")); assert!(code_for(doc, NodeId(999_999), CodeLang::Css).is_empty()); } + + #[test] + fn too_deep_placeholder_keeps_a_multiline_layer_name_in_the_comment() { + let mut s = Session::new(); + let name = "deep\nevil()\r\u{2028}more()"; + let mut parent = id_of(&s.execute("frame.create", &json!({"x": 0, "y": 0, "width": 50, "height": 50, "name": name})).unwrap()["id"]).unwrap(); + let root = parent; + for _ in 0..16 { + parent = + id_of(&s.execute("frame.create", &json!({"x": 1, "y": 1, "width": 40, "height": 40, "parent": parent, "name": name})).unwrap()["id"]) + .unwrap(); + } + let doc = s.doc().unwrap(); + for lang in [CodeLang::SwiftUi, CodeLang::Compose] { + let code = code_for(doc, root, lang); + assert!(code.contains("// deep evil() more() …\n"), "{code}"); + for line in code.lines() { + let t = line.trim_start(); + assert!(!t.starts_with("evil()") && !t.starts_with("more()"), "layer name leaked as code:\n{code}"); + } + } + } } From 309bac6185ee13d109836a48608680cfb6087298 Mon Sep 17 00:00:00 2001 From: Muamer Mustafic Date: Sun, 18 Oct 2026 19:32:46 +0200 Subject: [PATCH 291/817] =?UTF-8?q?M7:=20the=20web=20build=20opens=20files?= =?UTF-8?q?:=20File=20=E2=96=B8=20Open,=20Import=20and=20dropped=20files?= =?UTF-8?q?=20(#759)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit File ▸ Open, Import and Place image did nothing in the browser (the pickers return a path, which a browser never has) and dropped files were ignored (eframe hands their contents over asynchronously). - Services::pick_open_contents: a platform can pick a file's name and contents; the web build uses an . Open and Import pass them to file.open / file.import as data + name. - A dropped file without a path waits behind the opening card until its contents are read (bytes_async on wasm), or says it couldn't be read. - Canvas drops still import, as on the desktop. Closes #759. Co-authored-by: Cursor --- apps/figcraft-web/Cargo.toml | 2 +- apps/figcraft-web/src/web.rs | 56 +++++++++- crates/ui-egui/locales/en.toml | 1 + crates/ui-egui/locales/es.toml | 1 + crates/ui-egui/src/async_dialog_tests.rs | 40 +++++++- crates/ui-egui/src/canvas.rs | 12 +-- crates/ui-egui/src/home.rs | 13 +-- crates/ui-egui/src/home_tests.rs | 62 +++++++++++ crates/ui-egui/src/import_report_tests.rs | 1 + crates/ui-egui/src/lib.rs | 120 ++++++++++++++++------ crates/ui-egui/src/pending_open.rs | 53 ++++++++-- docs/hardware-parity.md | 5 +- 12 files changed, 302 insertions(+), 64 deletions(-) diff --git a/apps/figcraft-web/Cargo.toml b/apps/figcraft-web/Cargo.toml index 2f1a8190f..ffd44f3bc 100644 --- a/apps/figcraft-web/Cargo.toml +++ b/apps/figcraft-web/Cargo.toml @@ -26,4 +26,4 @@ eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] } wasm-bindgen = "0.2" js-sys = "0.3" wasm-bindgen-futures = "0.4" -web-sys = { version = "0.3", features = ["Window", "Document", "Element", "HtmlCanvasElement", "HtmlElement", "HtmlAnchorElement", "Node", "Blob", "BlobPropertyBag", "Url", "Location", "MediaQueryList", "Navigator", "Gamepad", "GamepadButton", "GamepadMappingType"] } +web-sys = { version = "0.3", features = ["Window", "Document", "Element", "HtmlCanvasElement", "HtmlElement", "HtmlAnchorElement", "Node", "Blob", "BlobPropertyBag", "File", "FileList", "HtmlInputElement", "EventTarget", "Url", "Location", "MediaQueryList", "Navigator", "Gamepad", "GamepadButton", "GamepadMappingType"] } diff --git a/apps/figcraft-web/src/web.rs b/apps/figcraft-web/src/web.rs index 292136212..015112527 100644 --- a/apps/figcraft-web/src/web.rs +++ b/apps/figcraft-web/src/web.rs @@ -1,7 +1,7 @@ //! The browser shell: web `Services` and the eframe web runner. use figcraft_engine::Session; -use figcraft_ui_egui::{FigApp, Services}; +use figcraft_ui_egui::{ContentsFuture, FigApp, Services}; use wasm_bindgen::JsCast as _; const CANVAS_ID: &str = "figcraft_canvas"; @@ -75,9 +75,10 @@ impl eframe::App for WebShell { } } -/// Browser services. Open dialogs return nothing for now (the trait's defaults); files are saved -/// as downloads. Copies go to the system clipboard through egui's output; pastes arrive as paste -/// events with their text (a page can't read the clipboard when it likes). +/// Browser services. Files are opened and imported through the browser's file picker, which hands +/// over their contents (pickers that need a path return nothing, the trait's defaults); files are +/// saved as downloads. Copies go to the system clipboard through egui's output; pastes arrive as +/// paste events with their text (a page can't read the clipboard when it likes). struct WebServices { /// `prefers-reduced-motion: reduce` (it follows the setting while the page is open). reduce_motion: Option, @@ -85,6 +86,16 @@ struct WebServices { } impl Services for WebServices { + /// An `` taking `exts`, clicked; its file is read once picked. + fn pick_open_contents(&mut self, _title: &str, exts: &[&str]) -> Option { + let accept = exts.iter().map(|e| format!(".{e}")).collect::>().join(","); + Some(Box::pin(async move { + pick_file(&accept).await.unwrap_or_else(|e| { + log::error!("couldn't open a file: {e:?}"); + None + }) + })) + } fn downloads(&self) -> bool { true } @@ -136,6 +147,43 @@ impl Services for WebServices { } } +/// The largest file read from the picker (browsers read at most 4 GiB into one buffer). +const MAX_PICKED_BYTES: f64 = u32::MAX as f64; + +/// The file picked in the browser's file picker (`accept`: the extensions it offers), with its +/// name; `None` when the picker is cancelled. +async fn pick_file(accept: &str) -> Result)>, wasm_bindgen::JsValue> { + let window = web_sys::window().ok_or("no window")?; + let document = window.document().ok_or("no document")?; + let body = document.body().ok_or("no body")?; + let input: web_sys::HtmlInputElement = document.create_element("input")?.dyn_into()?; + input.set_type("file"); + input.set_accept(accept); + input.set_hidden(true); + // Some browsers (older Safari) open the picker only for an input in the page. + body.append_child(&input)?; + // Settles on `change` (a file was picked) or `cancel` (the picker was closed without one). + let mut settle = |resolve: js_sys::Function, _reject: js_sys::Function| { + let done = wasm_bindgen::closure::Closure::once_into_js(move || { + let _ = resolve.call0(&wasm_bindgen::JsValue::NULL); + }); + let _ = input.add_event_listener_with_callback("change", done.unchecked_ref()); + let _ = input.add_event_listener_with_callback("cancel", done.unchecked_ref()); + }; + let closed = js_sys::Promise::new(&mut settle); + input.click(); + let result = wasm_bindgen_futures::JsFuture::from(closed).await; + let file = input.files().and_then(|files| files.get(0)); + input.remove(); + result?; + let Some(file) = file else { return Ok(None) }; + if file.size() > MAX_PICKED_BYTES { + return Err(format!("{} is too large to read in the browser", file.name()).into()); + } + let buffer = wasm_bindgen_futures::JsFuture::from(file.array_buffer()).await?; + Ok(Some((file.name(), js_sys::Uint8Array::new(&buffer).to_vec()))) +} + fn download(name: &str, bytes: &[u8]) -> Result<(), wasm_bindgen::JsValue> { let window = web_sys::window().ok_or("no window")?; let document = window.document().ok_or("no document")?; diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 17f6b4c5f..5d5b18563 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -319,6 +319,7 @@ name = "English" "Corner smoothing" = "Corner smoothing" "Couldn't download the variables" = "Couldn't download the variables" "Couldn't reach {server}: showing what this computer remembers." = "Couldn't reach {server}: showing what this computer remembers." +"Couldn't read {name}." = "Couldn't read {name}." "Couldn't save automatically: {error}" = "Couldn't save automatically: {error}" "Count" = "Count" "Create" = "Create" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index d054e2223..56b6d29c2 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -320,6 +320,7 @@ status = "draft — needs native review" "Corner radius" = "Radio de esquina" "Corner smoothing" = "Suavizado de esquinas" "Couldn't reach {server}: showing what this computer remembers." = "No se pudo contactar con {server}: se muestra lo que este ordenador recuerda." +"Couldn't read {name}." = "No se pudo leer {name}." "Couldn't save automatically: {error}" = "No se pudo guardar automáticamente: {error}" "Count" = "Número" "Create" = "Crear" diff --git a/crates/ui-egui/src/async_dialog_tests.rs b/crates/ui-egui/src/async_dialog_tests.rs index 26808fe5d..ad5dcfbc8 100644 --- a/crates/ui-egui/src/async_dialog_tests.rs +++ b/crates/ui-egui/src/async_dialog_tests.rs @@ -2,7 +2,7 @@ use std::path::PathBuf; use figcraft_engine::Session; -use crate::{DialogFuture, FigApp, Services}; +use crate::{ContentsFuture, DialogFuture, FigApp, Services}; struct OpenFile(PathBuf); @@ -79,6 +79,44 @@ fn save_as_saves_the_file_it_was_opened_for_after_another_tab_comes_to_the_front let _ = std::fs::remove_dir_all(dir); } +/// The browser: the picker hands over a file's name and contents, never a path. +struct Contents(&'static str, Vec); + +impl Services for Contents { + fn pick_open(&mut self, _title: &str, _exts: &[&str]) -> DialogFuture { + panic!("a platform that picks contents is never asked for a path") + } + fn pick_open_contents(&mut self, _title: &str, _exts: &[&str]) -> Option { + Some(Box::pin(std::future::ready(Some((self.0.to_string(), self.1.clone()))))) + } +} + +#[test] +fn open_dialog_opens_picked_contents_as_a_new_unsaved_document() { + let bytes = figcraft_format::save_bytes(&figcraft_doc::Document::new("Picked"), None).unwrap(); + let mut app = FigApp::new(Session::empty(), Box::new(Contents("Picked.figcraft", bytes))); + app.ui.home = true; + app.open_dialog(); + assert!(app.session.docs.is_empty(), "opening waits for the picker result"); + app.poll_dialog(&egui::Context::default()); + assert_eq!(app.session.docs.len(), 1); + assert_eq!(app.session.docs[0].path, None, "no path to save over"); + assert_eq!(app.session.docs[0].doc.name, "Picked"); + assert!(!app.ui.home, "and the editor shows it"); +} + +#[test] +fn import_dialog_imports_picked_contents_into_the_file_in_front() { + let svg = br#""#.to_vec(); + let mut app = FigApp::new(Session::new(), Box::new(Contents("Logo.svg", svg))); + let rectangles = |app: &FigApp| app.session.doc().unwrap().nodes().filter(|n| matches!(n.kind, figcraft_doc::NodeKind::Rectangle)).count(); + assert_eq!(rectangles(&app), 0); + app.import_dialog(false); + app.poll_dialog(&egui::Context::default()); + assert_eq!(app.session.docs.len(), 1, "imported, not opened"); + assert_eq!(rectangles(&app), 1, "the SVG's content"); +} + #[test] fn a_dialog_whose_file_closed_meanwhile_does_nothing() { let (mut app, dir, path) = two_files("closed"); diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 9e0c1d797..ce003f66c 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -507,21 +507,17 @@ fn input(app: &mut FigApp, ui: &mut Ui, resp: &egui::Response) -> bool { let path = f.path().to_path_buf(); let pt = hover_pos.map(|h| app.to_page(h)).unwrap_or_default(); let name = path.file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_else(|| "dropped.png".into()); - let params = if path.exists() { - json!({"path": path.to_string_lossy(), "x": pt.x, "y": pt.y}) - } else if let Some(bytes) = crate::dropped_bytes(&f) { - use base64::Engine as _; - let b64 = base64::engine::general_purpose::STANDARD.encode(&bytes); - json!({"data": b64, "name": name, "x": pt.x, "y": pt.y}) + let (params, read) = if path.exists() { + (json!({"path": path.to_string_lossy(), "x": pt.x, "y": pt.y}), None) } else { - continue; + (json!({"name": name, "x": pt.x, "y": pt.y}), Some(crate::dropped_bytes(&f))) }; let Some(target) = app.session.ds().ok().map(|doc| crate::pending_open::ImportTarget { uid: doc.uid, page: doc.page, name: doc.doc.name.clone() }) else { continue; }; - app.ui.pending_opens.push(crate::pending_open::PendingOpen { label: name, params, command: "file.import", target: Some(target) }); + app.ui.pending_opens.push(crate::pending_open::PendingOpen { label: name, params, command: "file.import", target: Some(target), read }); } let Some(pos) = hover_pos.filter(|p| app.canvas.rect.contains(*p)) else { // A drag released off the canvas, or off the window, ends where the pointer was last seen. diff --git a/crates/ui-egui/src/home.rs b/crates/ui-egui/src/home.rs index 236e27861..0d372d1bd 100644 --- a/crates/ui-egui/src/home.rs +++ b/crates/ui-egui/src/home.rs @@ -187,16 +187,9 @@ fn dropped(app: &mut FigApp, ctx: &egui::Context) { } // `opens` saw an extension, so there is a file name to tell the format by. let name = path.file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_default(); - let params = if path.exists() { - json!({"path": path.to_string_lossy()}) - } else if let Some(bytes) = crate::dropped_bytes(&f) { - use base64::Engine as _; - let data = base64::engine::general_purpose::STANDARD.encode(&bytes); - json!({"data": data, "name": name}) - } else { - continue; - }; - app.ui.pending_opens.push(crate::pending_open::PendingOpen { label: name, params, command: "file.open", target: None }); + let (params, read) = + if path.exists() { (json!({"path": path.to_string_lossy()}), None) } else { (json!({"name": name}), Some(crate::dropped_bytes(&f))) }; + app.ui.pending_opens.push(crate::pending_open::PendingOpen { label: name, params, command: "file.open", target: None, read }); } } diff --git a/crates/ui-egui/src/home_tests.rs b/crates/ui-egui/src/home_tests.rs index c493a0a1d..ea812ea09 100644 --- a/crates/ui-egui/src/home_tests.rs +++ b/crates/ui-egui/src/home_tests.rs @@ -573,6 +573,68 @@ fn dropping_a_file_without_one_on_disk_opens_it_as_a_new_unsaved_document() { assert!(!path.exists(), "nothing is written"); } +/// A drop whose contents arrive later, as every drop in the browser does: `None` until `arrived` +/// holds them. +fn later(arrived: &std::rc::Rc>>>>) -> crate::ReadFuture { + let arrived = arrived.clone(); + Box::pin(std::future::poll_fn(move |_| match arrived.borrow_mut().take() { + Some(bytes) => std::task::Poll::Ready(bytes), + None => std::task::Poll::Pending, + })) +} + +#[test] +fn a_dropped_file_whose_contents_arrive_later_opens_once_they_do() { + let svg = br#""#.to_vec(); + let arrived = std::rc::Rc::new(std::cell::RefCell::new(None)); + let mut u = first_run(); + u.app.ui.home = true; + u.app.ui.pending_opens.push(crate::pending_open::PendingOpen { + label: "Browser drop.svg".into(), + params: json!({"name": "Browser drop.svg"}), + command: "file.open", + target: None, + read: Some(later(&arrived)), + }); + // egui lays a new card out invisibly on its first frame. + u.frame(vec![]); + for _ in 0..5 { + let s = flat(&u.frame_output(vec![]).shapes); + assert!(has_text(&s, "Browser drop.svg"), "the card shows while the contents are read"); + } + assert!(u.app.session.docs.is_empty(), "nothing opens before the contents arrive"); + *arrived.borrow_mut() = Some(Some(svg)); + for _ in 0..3 { + u.frame(vec![]); + } + assert!(u.app.ui.pending_opens.is_empty()); + assert_eq!(u.app.ui.last_error, None); + assert_eq!(u.app.session.docs.len(), 1, "the contents open"); + assert_eq!(u.app.session.docs[0].path, None); + assert!(u.app.session.docs[0].doc.nodes().any(|n| matches!(n.kind, figcraft_doc::NodeKind::Rectangle)), "the SVG's content"); + assert!(!u.app.ui.home); +} + +#[test] +fn a_dropped_file_that_cannot_be_read_says_so_and_opens_nothing() { + let arrived = std::rc::Rc::new(std::cell::RefCell::new(Some(None))); + let mut u = first_run(); + u.app.ui.home = true; + u.app.ui.pending_opens.push(crate::pending_open::PendingOpen { + label: "Unreadable.figcraft".into(), + params: json!({"name": "Unreadable.figcraft"}), + command: "file.open", + target: None, + read: Some(later(&arrived)), + }); + for _ in 0..3 { + u.frame(vec![]); + } + assert!(u.app.ui.pending_opens.is_empty()); + assert!(u.app.session.docs.is_empty()); + assert_eq!(u.app.ui.last_error.as_deref(), Some("Couldn't read Unreadable.figcraft.")); +} + #[test] fn dropping_a_native_file_on_the_home_screen_opens_it() { let dir = Temp::new(); diff --git a/crates/ui-egui/src/import_report_tests.rs b/crates/ui-egui/src/import_report_tests.rs index a24115823..8c10c7f3e 100644 --- a/crates/ui-egui/src/import_report_tests.rs +++ b/crates/ui-egui/src/import_report_tests.rs @@ -177,6 +177,7 @@ fn a_dropped_file_shows_its_report_once_it_opens() { params: json!({"path": path.to_string_lossy()}), command: "file.open", target: None, + read: None, }); for _ in 0..6 { u.frame(vec![]); diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 450317b43..026228dc3 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -236,6 +236,11 @@ pub trait Services { fn pick_open(&mut self, _title: &str, _exts: &[&str]) -> DialogFuture { Box::pin(std::future::ready(None)) } + /// Pick a file and read it, where the platform hands over a file's name and contents rather + /// than a path to it (the browser). `None`: the platform picks paths ([`Services::pick_open`]). + fn pick_open_contents(&mut self, _title: &str, _exts: &[&str]) -> Option { + None + } fn pick_save(&mut self, _title: &str, _name: &str, _exts: &[&str]) -> DialogFuture { Box::pin(std::future::ready(None)) } @@ -290,14 +295,38 @@ pub trait Services { } pub type DialogFuture = Pin>>>; -type DialogDone = Box; +/// A picked file's name and contents ([`Services::pick_open_contents`]). +pub type ContentsFuture = Pin)>>>>; +/// A dropped file's contents, read once they arrive (`None`: they couldn't be read). +pub type ReadFuture = Pin>>>>; +type PickFuture = Pin>>>; +type DialogDone = Box; + +/// What a dialog picked: a path, or a file's name and contents where there are no paths. +enum Picked { + Path(PathBuf), + Contents(String, Vec), +} + +impl Picked { + /// The file as `file.open` and `file.import` take it. + fn file_params(self) -> Value { + match self { + Picked::Path(p) => json!({"path": p.to_string_lossy()}), + Picked::Contents(name, bytes) => { + use base64::Engine as _; + json!({"data": base64::engine::general_purpose::STANDARD.encode(&bytes), "name": name}) + } + } + } +} /// A native dialog in flight. The app keeps working while it is open, so its result goes to the /// file and window it was opened for, not to whichever is in front when it closes. struct PendingDialog { - future: DialogFuture, - /// The path picked, kept until the window that holds `doc` draws. - path: Option, + future: PickFuture, + /// What was picked, kept until the window that holds `doc` draws. + picked: Option, done: DialogDone, /// The file it acts on (`None`: none, such as Open). doc: Option, @@ -1099,16 +1128,11 @@ impl FigApp { pub fn open_dialog(&mut self) { // Opening needs no file in front: it goes ahead even if that file closed meanwhile. - self.start_dialog( - |services| services.pick_open(i18n::tr("Open"), OPEN_EXTENSIONS), - false, - |app, p| { - let ps = p.to_string_lossy().to_string(); - if app.run_user("file.open", json!({"path": ps})).is_some() { - app.ui.home = false; - } - }, - ); + self.pick_file(i18n::tr("Open"), OPEN_EXTENSIONS, false, |app, file| { + if app.run_user("file.open", file).is_some() { + app.ui.home = false; + } + }); } pub fn import_dialog(&mut self, place: bool) { @@ -1118,12 +1142,30 @@ impl FigApp { &["svg", "png", "jpg", "jpeg", "webp", "gif", "tif", "tiff", "figcraft", "fig"] }; let title = if place { i18n::tr("Place image") } else { i18n::tr("Import") }; - self.pick_open(title, exts, move |app, p| { - let ps = p.to_string_lossy().to_string(); - app.run_user("file.import", json!({"path": ps})); + self.pick_file(title, exts, true, |app, file| { + app.run_user("file.import", file); }); } + /// Pick a file to open or import; `done` gets it as `file.open` and `file.import` take it (a + /// path, or the name and contents where the platform has no paths). `pin`: as + /// [`FigApp::pick_open`]'s file in front. + fn pick_file(&mut self, title: &str, exts: &[&str], pin: bool, done: impl FnOnce(&mut FigApp, Value) + 'static) { + self.start_pick( + |services| -> PickFuture { + match services.pick_open_contents(title, exts) { + Some(read) => Box::pin(async move { read.await.map(|(name, bytes)| Picked::Contents(name, bytes)) }), + None => { + let pick = services.pick_open(title, exts); + Box::pin(async move { pick.await.map(Picked::Path) }) + } + } + }, + pin, + move |app, picked| done(app, picked.file_params()), + ); + } + /// Pick a file to open. `done` runs with the file in front now back in front (and not at all /// if that file closed meanwhile). pub fn pick_open(&mut self, title: &str, exts: &[&str], done: impl FnOnce(&mut FigApp, PathBuf) + 'static) { @@ -1142,12 +1184,28 @@ impl FigApp { /// Open a native dialog from the window drawing now, for the file in front (`pin`). fn start_dialog(&mut self, start: impl FnOnce(&mut dyn Services) -> DialogFuture, pin: bool, done: impl FnOnce(&mut FigApp, PathBuf) + 'static) { + self.start_pick( + |services| -> PickFuture { + let pick = start(services); + Box::pin(async move { pick.await.map(Picked::Path) }) + }, + pin, + move |app, picked| { + if let Picked::Path(p) = picked { + done(app, p); + } + }, + ); + } + + /// [`FigApp::start_dialog`] for any kind of pick. + fn start_pick(&mut self, start: impl FnOnce(&mut dyn Services) -> PickFuture, pin: bool, done: impl FnOnce(&mut FigApp, Picked) + 'static) { if self.pending_dialog.is_some() { return; } let doc = if pin { self.session.ds().ok().filter(|d| self.shows(d.uid)).map(|d| d.uid) } else { None }; let future = start(self.services.as_mut()); - self.pending_dialog = Some(PendingDialog { future, path: None, done: Box::new(done), doc, window: self.windows.current }); + self.pending_dialog = Some(PendingDialog { future, picked: None, done: Box::new(done), doc, window: self.windows.current }); if let Some(ctx) = &self.ui_context { ctx.request_repaint(); } @@ -1157,12 +1215,12 @@ impl FigApp { /// that file in front; then the tab in front before comes back (unless the dialog opened a file). fn poll_dialog(&mut self, ctx: &egui::Context) { let Some(d) = &mut self.pending_dialog else { return }; - if d.path.is_none() { + if d.picked.is_none() { let waker = Waker::from(Arc::new(RepaintWaker(ctx.clone()))); - let Poll::Ready(path) = d.future.as_mut().poll(&mut TaskContext::from_waker(&waker)) else { return }; - d.path = path; + let Poll::Ready(picked) = d.future.as_mut().poll(&mut TaskContext::from_waker(&waker)) else { return }; + d.picked = picked; } - let (doc, origin, picked) = (d.doc, d.window, d.path.is_some()); + let (doc, origin, picked) = (d.doc, d.window, d.picked.is_some()); let index = doc.map(|u| self.session.docs.iter().position(|ds| ds.uid == u)); // Cancelled, or its file closed meanwhile. if !picked || index == Some(None) { @@ -1178,12 +1236,12 @@ impl FigApp { ctx.request_repaint_of(windows::viewport(window)); return; } - let Some(PendingDialog { path: Some(path), done, .. }) = self.pending_dialog.take() else { return }; + let Some(PendingDialog { picked: Some(picked), done, .. }) = self.pending_dialog.take() else { return }; let before = self.session.ds().ok().map(|d| d.uid); if let Some(Some(i)) = index { self.session.active = i; } - done(self, path); + done(self, picked); if doc.is_some() && self.session.ds().ok().map(|d| d.uid) == doc && let Some(i) = before.and_then(|u| self.session.docs.iter().position(|d| d.uid == u)) @@ -1693,17 +1751,17 @@ pub(crate) fn opens(path: &Path) -> bool { path.extension().and_then(|e| e.to_str()).is_some_and(|e| OPEN_EXTENSIONS.iter().any(|x| x.eq_ignore_ascii_case(e))) } -/// The contents of a dropped file that has no file on disk to read by path. +/// Reads the contents of a dropped file that has no file on disk to read by path. #[cfg(not(target_arch = "wasm32"))] -pub(crate) fn dropped_bytes(f: &egui::DroppedFileHandle) -> Option> { - f.bytes().ok() +pub(crate) fn dropped_bytes(f: &egui::DroppedFileHandle) -> ReadFuture { + Box::pin(std::future::ready(f.bytes().ok())) } -/// The contents of a dropped file that has no file on disk to read by path. +/// Reads the contents of a dropped file; the browser hands them over asynchronously. #[cfg(target_arch = "wasm32")] -pub(crate) fn dropped_bytes(_f: &egui::DroppedFileHandle) -> Option> { - // Browser drops arrive asynchronously; not supported yet. - None +pub(crate) fn dropped_bytes(f: &egui::DroppedFileHandle) -> ReadFuture { + let f = f.clone(); + Box::pin(async move { f.bytes_async().await.ok() }) } /// While files are dragged over the window: a tinted, outlined `rect` with `label` in its middle, diff --git a/crates/ui-egui/src/pending_open.rs b/crates/ui-egui/src/pending_open.rs index 9d19b9420..ef798eca9 100644 --- a/crates/ui-egui/src/pending_open.rs +++ b/crates/ui-egui/src/pending_open.rs @@ -1,13 +1,17 @@ //! Files dropped on the home screen or the canvas open a frame later, behind a card that says what //! is happening: opening a large `.fig` blocks the UI thread for a while, and the card is on screen -//! before it does (rather than a window that freezes without a word). +//! before it does (rather than a window that freezes without a word). A file with no path to read +//! (every drop in the browser) waits behind the card until its contents arrive. + +use std::sync::Arc; +use std::task::{Context as TaskContext, Poll, Waker}; use figcraft_doc::NodeId; -use serde_json::Value; +use serde_json::{Value, json}; -use crate::FigApp; use crate::i18n::{tr, trf, trn}; use crate::theme::{Tokens, semibold}; +use crate::{FigApp, ReadFuture, RepaintWaker}; /// A dropped file waiting to be opened (`file.open`, a document of its own) or imported /// (`file.import`, into the current document). @@ -18,6 +22,8 @@ pub struct PendingOpen { pub command: &'static str, /// Canvas imports stay with the document and page that received the drop. pub target: Option, + /// The file's contents still on their way; they go into `params` as `data` once read. + pub read: Option, } pub struct ImportTarget { @@ -74,15 +80,48 @@ fn cancel(app: &mut FigApp, message: String) { /// frame, so the second one is the first the window shows. const FRAMES_BEFORE_OPENING: u8 = 2; -/// The card while files wait, then (once it has been on screen) open them. Called before the import -/// report, so a report for these files shows after them. +/// Polls the contents still being read: those that arrived go into their file's parameters, files +/// that couldn't be read are dropped with a message. Whether any are still on their way. +fn read_contents(app: &mut FigApp, ctx: &egui::Context) -> bool { + let waker = Waker::from(Arc::new(RepaintWaker(ctx.clone()))); + let mut cx = TaskContext::from_waker(&waker); + let mut reading = false; + let mut unread = Vec::new(); + app.ui.pending_opens.retain_mut(|pending| { + let Some(read) = pending.read.as_mut() else { return true }; + match read.as_mut().poll(&mut cx) { + Poll::Pending => { + reading = true; + true + } + Poll::Ready(Some(bytes)) => { + use base64::Engine as _; + pending.params["data"] = json!(base64::engine::general_purpose::STANDARD.encode(&bytes)); + pending.read = None; + true + } + Poll::Ready(None) => { + unread.push(pending.label.clone()); + false + } + } + }); + for name in unread { + cancel(app, trf("Couldn't read {name}.", &[("name", &name)])); + } + reading +} + +/// The card while files wait, then (once it has been on screen and their contents are read) open +/// them. Called before the import report, so a report for these files shows after them. pub fn pending_opens(app: &mut FigApp, ctx: &egui::Context) { + let reading = read_contents(app, ctx); if app.ui.pending_opens.is_empty() { app.ui.pending_open_frames = 0; return; } ctx.request_repaint(); - if app.ui.pending_open_frames >= FRAMES_BEFORE_OPENING { + if app.ui.pending_open_frames >= FRAMES_BEFORE_OPENING && !reading { app.ui.pending_open_frames = 0; for pending in std::mem::take(&mut app.ui.pending_opens) { let command = pending.command; @@ -92,7 +131,7 @@ pub fn pending_opens(app: &mut FigApp, ctx: &egui::Context) { } return; } - app.ui.pending_open_frames += 1; + app.ui.pending_open_frames = app.ui.pending_open_frames.saturating_add(1); let title = match app.ui.pending_opens.first().map(|p| p.command) { Some("file.import") => { let name = app diff --git a/docs/hardware-parity.md b/docs/hardware-parity.md index df8229818..bc0de68dc 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-10-18 · **Change:** minor (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; 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) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (the web build opens files: File ▸ Open, Import and Place image through the browser's file picker, dropped files read (#759); 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; 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) · **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 @@ -43,13 +43,14 @@ Nothing has been timed against Figma on the same document (needs `.fig` import). | Windows x64 / arm64 | desktop app | `.msi` and portable zip for x64, x86 and arm64 | built in CI; Windows: QA pass done 2026-10-11, findings in PR | | Linux | none (browser only) | AppImage, `.deb`, `.rpm`, Flatpak, tarball, x86_64 and aarch64; riscv64 tarball | CI tests run here. Clipboard (also the BSDs): reads run on a helper thread that gives up after 2 s, and images copied in other apps paste under Wayland through the data-control protocol (#693). Under Wayland the app can't tell its window is minimised, so control requests that need a drawn frame may still wait there (#720). None of this run on a Linux desktop here. On a Wayland compositor without server-side decorations (GNOME) the window gets winit's Adwaita controls (#592: checked by its author in a GNOME Wayland session; KDE not run) | | FreeBSD | none | tarball | | -| Web | primary (figma.com) | `figcraft-web` (WASM, WebGPU/WebGL2), web zip | no accessibility tree; file access through the browser; copy and paste through the system clipboard (copies written from the copy event, pastes read from the paste event; no pasting images from other apps) | +| Web | primary (figma.com) | `figcraft-web` (WASM, WebGPU/WebGL2), web zip | no accessibility tree; file access through the browser: File ▸ Open, Import and Place image use its file picker, dropped files are read (a drop on the home screen opens, a drop on the canvas imports, as on the desktop), saving and exports are downloads; pickers for libraries, variables, plugin manifests and image fills still need a path and do nothing there; copy and paste through the system clipboard (copies written from the copy event, pastes read from the paste event; no pasting images from other apps) | | iOS / Android | apps: view, comment, mirror prototypes | none (the web build is not touch-first) | 20–40 h for a viewer | ## Revision history | Date | Change | Summary | |---|---|---| +| 2026-10-18 | minor | Opening files in the web build (#759): File ▸ Open, Import and Place image did nothing there (the pickers return a path, which a browser never has) and dropped files were ignored (eframe hands their contents over asynchronously). A platform can now pick a file's name and contents (`Services::pick_open_contents`; the browser's ``), which `file.open` and `file.import` take as `data` and `name`, and a dropped file without a path waits behind the opening card until its contents arrive, or says it couldn't be read (`async_dialog_tests`, `home_tests`; the browser half built for wasm, not run in a browser). Numbers unchanged | | 2026-10-18 | minor | macOS quit crash (#781): on Macs with a Touch Bar the app could crash as it quit (an exception in AppKit's Touch Bar support while the window's content view, which the accessibility adapter subclasses, was torn down). Quitting now keeps everything (preferences, this run's recovery copies, live sessions ended) and then ends the process before that teardown. Quit from the menu bar ends the app without the unsaved-changes question, so unsaved files' recovery copies now stay and reopen at the next start instead of being removed. Numbers unchanged | | 2026-10-17 | minor | Linux row: clipboard reads on Linux and the BSDs time out after 2 s on a helper thread, images copied in other apps paste under Wayland (arboard's data-control feature, #693), a minimised window can't be detected under Wayland, so frame-only control requests may still wait there (#720), and Wayland compositors without server-side decorations give the window Adwaita controls (#592, checked by its author on GNOME, not by the maintainers; KDE not run); compiled in CI, not run on a Linux desktop. HiDPI row: native-density canvas images placed on whole device pixels (#359, geometry tests; not judged by eye). Numbers unchanged | | 2026-10-14 | minor | Copy and paste in the browser: the web build never wrote to the system clipboard, so Cmd+V after Cmd+C pasted whatever text the clipboard held before (as a text layer) instead of the copied layers. Copies (layers, Copy as SVG/CSS/text/PNG, links) now go out through egui's output, which eframe writes during the copy event (`web_clipboard_tests`). Numbers unchanged. | From 54458cfb20b3e8f9164dbcd065b669891a204c3b Mon Sep 17 00:00:00 2001 From: slyim <125447219+slyim@users.noreply.github.com> Date: Sun, 18 Oct 2026 20:52:39 +0300 Subject: [PATCH 292/817] #826: tests for the inset Frame and Text marks and the connected Slice knife frame_and_text_marks_are_inset fails if either mark reaches the box edge again; slice_is_one_connected_knife fails if the handle stops short of the blade's base or the icon goes back to separate marks. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/icons.rs | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs index 35adef116..3ef6b3726 100644 --- a/crates/ui-egui/src/icons.rs +++ b/crates/ui-egui/src/icons.rs @@ -1233,4 +1233,59 @@ mod tests { assert!(!rotation.is_empty() && !radius.is_empty(), "both draw an icon"); assert_ne!(rotation, radius); } + + /// The shapes `icon` paints in a 32-point box at the origin: two points per grid unit. + fn shapes_at_32(icon: Icon) -> Vec { + let ctx = egui::Context::default(); + let mut out = + ctx.run_ui(egui::RawInput::default(), |ui| paint(ui.painter(), Rect::from_min_size(Pos2::ZERO, Vec2::splat(32.0)), icon, Color32::WHITE)); + out.textures_delta.clear(); + out.shapes.into_iter().map(|c| c.shape).collect() + } + + /// Frame and Text stay a grid unit inside the box, so their long hinted strokes don't + /// outweigh the outlines beside them in the toolbar (#737). + #[test] + fn frame_and_text_marks_are_inset() { + for icon in [Icon::Frame, Icon::Text] { + let pts: Vec = shapes_at_32(icon) + .iter() + .flat_map(|s| match s { + Shape::LineSegment { points, .. } => points.to_vec(), + other => panic!("{icon:?} draws straight strokes only: {other:?}"), + }) + .collect(); + assert!(!pts.is_empty()); + for p in pts { + // Grid units 3..13, two points each. + assert!((6.0..=26.0).contains(&p.x) && (6.0..=26.0).contains(&p.y), "{icon:?} reaches {p:?}"); + } + } + } + + /// Slice is one knife (#739): an outlined blade and a solid handle that covers the middle of + /// the blade's base, so the two read as one mark rather than separate pieces. + #[test] + fn slice_is_one_connected_knife() { + let shapes = shapes_at_32(Icon::Slice); + let paths: Vec<_> = shapes + .iter() + .map(|s| match s { + Shape::Path(p) => p, + other => panic!("Slice draws paths only: {other:?}"), + }) + .collect(); + let blade = paths.iter().find(|p| p.closed && p.fill == Color32::TRANSPARENT).expect("an outlined blade"); + let handle = paths.iter().find(|p| p.fill != Color32::TRANSPARENT).expect("a solid handle"); + assert_eq!((paths.len(), blade.points.len()), (2, 3), "a blade and a handle, nothing else"); + // The blade's base runs between its second and third points; the handle is convex. + let base = blade.points[1] + (blade.points[2] - blade.points[1]) / 2.0; + let h = &handle.points; + let side = |i: usize| { + let (a, b) = (h[i], h[(i + 1) % h.len()]); + (b - a).x * (base - a).y - (b - a).y * (base - a).x + }; + let inside = (0..h.len()).all(|i| side(i) >= 0.0) || (0..h.len()).all(|i| side(i) <= 0.0); + assert!(inside, "the handle covers the blade's base at {base:?}"); + } } From 02e8f644fde722ee647228cbacc9c090dab9a09b Mon Sep 17 00:00:00 2001 From: Ahmed5Emad Date: Sun, 18 Oct 2026 21:02:22 +0300 Subject: [PATCH 293/817] M2: doc comments for the padding diff's functions --- crates/engine/src/cmd/layout.rs | 1 + crates/ui-egui/src/layout_panel.rs | 2 ++ crates/ui-egui/src/padding_individual_tests.rs | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/crates/engine/src/cmd/layout.rs b/crates/engine/src/cmd/layout.rs index b545e52d2..da1301ec0 100644 --- a/crates/engine/src/cmd/layout.rs +++ b/crates/engine/src/cmd/layout.rs @@ -149,6 +149,7 @@ mod tests { assert!(s.execute("node.set", &json!({"id": b, "props": {"absolute": "maybe"}})).is_err()); } + /// Each side key writes its own padding slot and leaves the other three alone. #[test] fn each_side_padding_sets_its_side_alone() { let mut s = Session::new(); diff --git a/crates/ui-egui/src/layout_panel.rs b/crates/ui-egui/src/layout_panel.rs index 9f69c6c4c..6c8d66935 100644 --- a/crates/ui-egui/src/layout_panel.rs +++ b/crates/ui-egui/src/layout_panel.rs @@ -401,6 +401,8 @@ fn alignment(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], l: &AutoLayout) { } } +/// The Spacing row: gap fields, then the H/V padding pair (or the 2x2 per-side +/// grid while the individual-padding toggle is open). fn spacing(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], l: &AutoLayout) { let col = widgets::col_width(ui.available_width()); let [pt, pr, pb, pl] = l.padding; diff --git a/crates/ui-egui/src/padding_individual_tests.rs b/crates/ui-egui/src/padding_individual_tests.rs index 8fdb31925..28a207bc8 100644 --- a/crates/ui-egui/src/padding_individual_tests.rs +++ b/crates/ui-egui/src/padding_individual_tests.rs @@ -23,16 +23,19 @@ fn scene() -> (Ui, NodeId) { (Ui::new(s), f) } +/// The frame's padding as `[top, right, bottom, left]`. fn padding(u: &Ui, f: NodeId) -> [f64; 4] { u.app.session.doc().unwrap().node(f).unwrap().layout.clone().unwrap().padding } +/// A full press-and-release at `p`, then settling one frame. fn click(u: &mut Ui, p: Pos2) { u.button(p, true); u.button(p, false); u.frame(vec![]); } +/// A press-and-release of Enter, committing the focused number field. fn enter(u: &mut Ui) { u.frame(vec![ Event::Key { key: Key::Enter, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::NONE }, @@ -51,6 +54,8 @@ fn named_button(u: &mut Ui, label: &str) -> Pos2 { pos2(((b.x0 + b.x1) / 2.0) as f32, ((b.y0 + b.y1) / 2.0) as f32) } +/// The side fields stay hidden until the toggle opens, then typing in one sets +/// that side alone in a single undo step. #[test] fn side_fields_show_only_once_the_toggle_opens_and_set_one_side() { let (mut u, f) = scene(); From c3cb8c3e0eca767a5e8cc59940c835695e0a78e6 Mon Sep 17 00:00:00 2001 From: Hamza Date: Sun, 18 Oct 2026 23:48:54 +0500 Subject: [PATCH 294/817] cli: confine info, export, convert, render and run to automation roots `figcraft-cli mcp` takes `--automation-read-root` / `--automation-write-root` to confine the files an agent's commands touch, but the file subcommands took neither: `figcraft-cli run script.json --out /anywhere/x.figcraft` read and wrote as the user who started it. The README invites agent use, and a script or agent driving `run`, `export` or `convert` had no way to say which folders it may reach (#833). `info`, `export`, `convert`, `render` and `run` take the same two flags, with the same semantics: repeatable, the folders must exist, reads inside a read or write root, writes only inside a write root, everything else refused -- so giving no write root denies writing altogether. Without the flags they behave as before. The flags would have been decorative on their own: `figcraft_engine` enforces roots through `file_access`, which the engine's own loads already go through, but the CLI wrote its output with `std::fs` and read its script the same way. Those three calls now go through `file_access` too, so the confinement reaches the files the CLI itself touches. --- apps/figcraft-cli/src/files.rs | 11 ++++-- apps/figcraft-cli/src/main.rs | 54 ++++++++++++++++++++------- apps/figcraft-cli/tests/cli.rs | 67 ++++++++++++++++++++++++++++++++++ docs/cli.md | 22 +++++++++++ 4 files changed, 136 insertions(+), 18 deletions(-) diff --git a/apps/figcraft-cli/src/files.rs b/apps/figcraft-cli/src/files.rs index 65b19ee46..9dc357b1b 100644 --- a/apps/figcraft-cli/src/files.rs +++ b/apps/figcraft-cli/src/files.rs @@ -29,11 +29,13 @@ fn image_format(e: &str) -> Option { } } +/// Writes through [`figcraft_engine::file_access`], so a run given automation roots can only +/// write inside a write root (#833). Unconfined it writes as before. fn write(path: &str, bytes: &[u8]) -> CliResult<()> { if let Some(dir) = Path::new(path).parent().filter(|d| !d.as_os_str().is_empty()) { - std::fs::create_dir_all(dir).map_err(|e| CliError::Failed(format!("{}: {e}", dir.display())))?; + figcraft_engine::file_access::create_dir_all(dir).map_err(|e| CliError::Failed(e.to_string()))?; } - std::fs::write(path, bytes).map_err(|e| CliError::Failed(format!("{path}: {e}"))) + figcraft_engine::file_access::write(path, bytes).map_err(|e| CliError::Failed(e.to_string())) } fn page_named(doc: &Document, name: Option<&str>) -> CliResult { @@ -244,7 +246,7 @@ pub fn export(file: &str, out: &str, t: &Target) -> CliResult { println!("{out}"); return Ok(ExitCode::SUCCESS); } - std::fs::create_dir_all(out).map_err(|e| CliError::Failed(format!("{out}: {e}")))?; + figcraft_engine::file_access::create_dir_all(out).map_err(|e| CliError::Failed(e.to_string()))?; let ids = match target { Some(t) => vec![t], None => { @@ -329,7 +331,8 @@ pub fn parse_script(text: &str) -> Result, String> { } pub fn run_script(script: &str, input: Option<&str>, out: Option<&str>) -> CliResult { - let text = std::fs::read_to_string(script).map_err(|e| CliError::Failed(format!("{script}: {e}")))?; + let bytes = figcraft_engine::file_access::read(script).map_err(|e| CliError::Failed(e.to_string()))?; + let text = String::from_utf8(bytes).map_err(|_| CliError::Failed(format!("{script}: not UTF-8")))?; let steps = parse_script(&text).map_err(|e| CliError::Failed(format!("{script}: {e}")))?; let mut s = match input { Some(path) => { diff --git a/apps/figcraft-cli/src/main.rs b/apps/figcraft-cli/src/main.rs index 281d79ddc..d9f757d0f 100644 --- a/apps/figcraft-cli/src/main.rs +++ b/apps/figcraft-cli/src/main.rs @@ -22,6 +22,7 @@ USAGE: figcraft-cli convert figcraft-cli render -o [--scale N] [--page NAME] figcraft-cli run [--in ] [--out ] + (info, export, convert, render and run also take --automation-read-root DIR / --automation-write-root DIR) figcraft-cli commands [--json] [--filter TEXT] figcraft-cli mcp [--attach PORT] [--automation-read-root DIR]... [--automation-write-root DIR]... figcraft-cli plugin publish --server ws://host:port/[?key=KEY] @@ -42,12 +43,34 @@ crop and bleed marks, CMYK colour). `run` executes a JSON array (or JSON lines) `plugin publish` sends a plugin folder (figcraft-plugin.json, its module, an optional assets/ folder) to a figcraft-server's plugin directory as a new version; the server's key comes from the address or the FIGCRAFT_SERVER_KEY environment variable (which keeps it out of the shell history). -`mcp --automation-read-root DIR` / `--automation-write-root DIR` (each may be repeated; the folders -must exist) confine the files the agent's commands touch: reads only inside a read or write root, -writes only inside a write root, everything else refused. A running app confines itself: start it -with `figcraft --control PORT` and the same flags (`--attach` refuses them). +`--automation-read-root DIR` / `--automation-write-root DIR` (each may be repeated; the folders +must exist) confine the files a subcommand touches: reads only inside a read or write root, writes +only inside a write root, everything else refused -- so giving no write root denies writing +altogether. They are taken by `mcp`, to confine the agent's commands, and by `info`, `export`, +`convert`, `render` and `run`, to confine that one run; without them a subcommand reads and writes +as the user who started it, as before. A running app confines itself: start it with +`figcraft --control PORT` and the same flags (`--attach` refuses them). See docs/cli.md and docs/mcp.md."; +/// The automation roots a file subcommand was given, if any. Omitting both leaves the run +/// unconfined, as before; giving either confines every file the subcommand touches (#833). +const ROOT_FLAGS: [&str; 2] = ["automation-read-root", "automation-write-root"]; + +fn roots_of(a: &Args) -> CliResult>> { + let (read, write) = (a.values("automation-read-root"), a.values("automation-write-root")); + if read.is_empty() && write.is_empty() { + return Ok(None); + } + let roots = figcraft_engine::file_access::Roots::new(read, write).map_err(CliError::Failed)?; + Ok(Some(std::sync::Arc::new(roots))) +} + +/// Runs `f` confined to the roots `a` carries. +fn confined(a: &Args, f: impl FnOnce() -> CliResult) -> CliResult { + let roots = roots_of(a)?; + figcraft_engine::file_access::confined(roots.as_ref(), f) +} + fn main() -> ExitCode { let argv: Vec = std::env::args().skip(1).collect(); match run(&argv) { @@ -98,35 +121,38 @@ fn run(argv: &[String]) -> CliResult { Ok(ExitCode::SUCCESS) } "info" => { - let a = Args::parse(rest, &[], &["json"])?; + let a = Args::parse(rest, &ROOT_FLAGS, &["json"])?; let file = a.one_positional("info ")?; - files::info(&file, a.flag("json")) + confined(&a, || files::info(&file, a.flag("json"))) } "export" => { - let a = Args::parse(rest, &["format", "scale", "page", "node", "o", "out", "bleed"], &["crop-marks", "bleed-marks", "cmyk"])?; + let valued = [&["format", "scale", "page", "node", "o", "out", "bleed"][..], &ROOT_FLAGS[..]].concat(); + let a = Args::parse(rest, &valued, &["crop-marks", "bleed-marks", "cmyk"])?; let file = a.one_positional("export -o ")?; let out = a.value("o").or_else(|| a.value("out")).ok_or_else(|| CliError::Usage("export needs -o ".into()))?; let target = files::Target { format: a.value("format"), scale: a.scale()?, page: a.value("page"), node: a.value("node"), print: a.print()? }; - files::export(&file, &out, &target) + confined(&a, || files::export(&file, &out, &target)) } "convert" => { - let a = Args::parse(rest, &[], &[])?; + let a = Args::parse(rest, &ROOT_FLAGS, &[])?; match a.positional.as_slice() { - [i, o] => files::convert(i, o), + [i, o] => confined(&a, || files::convert(i, o)), _ => Err(CliError::Usage("convert ".into())), } } "render" => { - let a = Args::parse(rest, &["o", "out", "scale", "page"], &[])?; + let valued = [&["o", "out", "scale", "page"][..], &ROOT_FLAGS[..]].concat(); + let a = Args::parse(rest, &valued, &[])?; let file = a.one_positional("render -o ")?; let out = a.value("o").or_else(|| a.value("out")).ok_or_else(|| CliError::Usage("render needs -o ".into()))?; - files::render(&file, &out, a.scale()?, a.value("page").as_deref()) + confined(&a, || files::render(&file, &out, a.scale()?, a.value("page").as_deref())) } "run" => { - let a = Args::parse(rest, &["in", "out"], &[])?; + let valued = [&["in", "out"][..], &ROOT_FLAGS[..]].concat(); + let a = Args::parse(rest, &valued, &[])?; let script = a.one_positional("run ")?; - files::run_script(&script, a.value("in").as_deref(), a.value("out").as_deref()) + confined(&a, || files::run_script(&script, a.value("in").as_deref(), a.value("out").as_deref())) } "commands" => { let a = Args::parse(rest, &["filter"], &["json"])?; diff --git a/apps/figcraft-cli/tests/cli.rs b/apps/figcraft-cli/tests/cli.rs index 7eaf051f5..399e57bbd 100644 --- a/apps/figcraft-cli/tests/cli.rs +++ b/apps/figcraft-cli/tests/cli.rs @@ -172,3 +172,70 @@ fn commands_json_lists_everything() { let v: serde_json::Value = serde_json::from_slice(&out.stdout).unwrap(); assert!(v.as_array().unwrap().len() > 200); } + +/// The automation roots confine the file subcommands too, not just `mcp` (#833): a read outside a +/// root, and a write outside a write root, are refused and leave no file behind. Without the flags +/// the same commands behave as they always did. +#[test] +fn file_subcommands_are_confined_to_automation_roots() { + let d = tmp("file-roots"); + let _ = std::fs::remove_dir_all(&d); + for sub in ["in", "out"] { + std::fs::create_dir_all(d.join(sub)).unwrap(); + } + let p = |rel: &str| d.join(rel).to_string_lossy().into_owned(); + let out_of = |o: &std::process::Output| String::from_utf8_lossy(&o.stderr).into_owned(); + + // A document to work on, made unconfined. + std::fs::write(d.join("in/make.json"), br#"[{"command":"shape.rectangle","params":{"x":0,"y":0,"width":40,"height":20}}]"#).unwrap(); + let made = bin().args(["run", &p("in/make.json"), "--out", &p("in/doc.figcraft")]).output().unwrap(); + assert!(made.status.success(), "{}", out_of(&made)); + + // Inside the roots: renders as usual. + let ok = bin() + .args(["render", &p("in/doc.figcraft"), "-o", &p("out/ok.png"), "--automation-read-root", &p("in"), "--automation-write-root", &p("out")]) + .output() + .unwrap(); + assert!(ok.status.success(), "{}", out_of(&ok)); + assert!(d.join("out/ok.png").is_file()); + + // A write outside the write root is refused, and nothing is written. + let escaped = d.join("escaped.png"); + let refused = bin() + .args([ + "render", + &p("in/doc.figcraft"), + "-o", + &escaped.to_string_lossy(), + "--automation-read-root", + &p("in"), + "--automation-write-root", + &p("out"), + ]) + .output() + .unwrap(); + assert!(!refused.status.success()); + assert!(out_of(&refused).contains("may be written"), "{}", out_of(&refused)); + assert!(!escaped.exists(), "the refused render wrote a file anyway"); + + // No write root at all: writing is refused outright, reading still works. + let no_write = bin().args(["render", &p("in/doc.figcraft"), "-o", &p("out/no.png"), "--automation-read-root", &p("in")]).output().unwrap(); + assert!(!no_write.status.success()); + assert!(out_of(&no_write).contains("no folder may be written"), "{}", out_of(&no_write)); + + // A read outside every root is refused: `info` on the document with only `out` readable. + let read_refused = bin().args(["info", &p("in/doc.figcraft"), "--automation-read-root", &p("out")]).output().unwrap(); + assert!(!read_refused.status.success()); + assert!(out_of(&read_refused).contains("may be read"), "{}", out_of(&read_refused)); + + // `convert` and `run` take them as well, and a root that is not a folder is refused. + let missing = bin().args(["convert", &p("in/doc.figcraft"), &p("out/c.svg"), "--automation-read-root", &p("missing")]).output().unwrap(); + assert!(!missing.status.success()); + assert!(out_of(&missing).contains("automation-read-root"), "{}", out_of(&missing)); + + // Unconfined, the same render still writes wherever it is told. + let plain = bin().args(["render", &p("in/doc.figcraft"), "-o", &escaped.to_string_lossy()]).output().unwrap(); + assert!(plain.status.success(), "{}", out_of(&plain)); + assert!(escaped.is_file()); + let _ = std::fs::remove_dir_all(&d); +} diff --git a/docs/cli.md b/docs/cli.md index 7af73fd60..699b6ba27 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -153,6 +153,28 @@ figcraft-cli run start.json --out dashboard.figcraft figcraft-cli export dashboard.figcraft -o dashboard.png ``` +### Confining a run: `--automation-read-root DIR` / `--automation-write-root DIR` + +`info`, `export`, `convert`, `render` and `run` take these two flags, with the same meaning they +have on [`mcp`](#mcp---attach-port---automation-read-root-dir---automation-write-root-dir): each is +repeatable, each folder must exist, and together they confine every file that subcommand touches. +Reads are allowed inside a read or write root, writes only inside a write root, and everything else +is refused — so a run given only a read root cannot write at all. Without either flag a subcommand +reads and writes as the user who started it. + +```sh +# Renders in/doc.figcraft to out/ok.png and can touch nothing else. +figcraft-cli render in/doc.figcraft -o out/ok.png \ + --automation-read-root in --automation-write-root out + +figcraft-cli render in/doc.figcraft -o ./escaped.png \ + --automation-read-root in --automation-write-root out +# error: automation path rejected: . is outside the folders that may be written: …/out +``` + +This is for driving the CLI from a script or an agent that should not reach the rest of the disk; +the flags leave the output identical when nothing strays outside the roots. + ### `commands [--json] [--filter TEXT]` Every command with its label, shortcut, undoable flag (`*`) and parameter docs; `--json` for From 7fcb193f2a7e4b094c44acb2526044c7c70e1992 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 18 Oct 2026 15:10:42 -0400 Subject: [PATCH 295/817] ci: configure Dependabot for Cargo and GitHub Actions (#825) * ci: configure Dependabot for Cargo and GitHub Actions * ci: add Cargo update entry for /plugins workspace in Dependabot * ci: consolidate Cargo Dependabot directories in figcraft --- .github/dependabot.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..d39962e1c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,32 @@ +version: 2 +updates: + # Maintain Rust / Cargo dependencies + - package-ecosystem: "cargo" + directories: + - "/" + - "/plugins" + schedule: + interval: "daily" + time: "06:00" + timezone: "America/New_York" + # Consolidate updates into a single PR rather than one PR per crate + groups: + cargo-dependencies: + patterns: + - "*" + commit-message: + prefix: "chore(deps)" + + # Maintain GitHub Actions workflows + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + time: "06:00" + timezone: "America/New_York" + groups: + actions: + patterns: + - "*" + commit-message: + prefix: "ci(deps)" From 39f30d63c843314acdc262866f9d0488ce679ef1 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Sun, 18 Oct 2026 21:27:31 +0200 Subject: [PATCH 296/817] Refuse empty mode lists and blank names in variable.createCollection Found while testing crates/engine/src/cmd/styles.rs:119-124 Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/engine/src/cmd/styles.rs | 22 ++++++++++++++----- .../engine/src/variables_behaviour_tests.rs | 21 ++++++++++++++++++ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/cmd/styles.rs b/crates/engine/src/cmd/styles.rs index adeb22506..1578912ad 100644 --- a/crates/engine/src/cmd/styles.rs +++ b/crates/engine/src/cmd/styles.rs @@ -110,16 +110,26 @@ pub fn specs() -> Vec { )) }), spec!("variable.createCollection", "Create variable collection", "{name, modes? [names]}", true, |s, p| { - let name = req_string("variable.createCollection", p, "name")?; - let doc = s.doc_mut()?; - if doc.variables.collections.iter().any(|c| c.name == name) { - return Err(bad("variable.createCollection", format!("a collection named `{name}` already exists"))); + let cmd = "variable.createCollection"; + let name = req_string(cmd, p, "name")?.trim().to_string(); + if name.is_empty() { + return Err(bad(cmd, "name can't be empty")); } - let id = doc.new_collection_id(); let modes: Vec = match get(p, "modes") { - Some(Value::Array(a)) => a.iter().filter_map(|m| m.as_str().map(str::to_string)).collect(), + Some(Value::Array(a)) => a.iter().filter_map(|m| m.as_str().map(|m| m.trim().to_string())).collect(), _ => vec!["Mode 1".into()], }; + if modes.is_empty() { + return Err(bad(cmd, "a collection needs at least one mode")); + } + if modes.iter().any(String::is_empty) { + return Err(bad(cmd, "mode names can't be empty")); + } + let doc = s.doc_mut()?; + if doc.variables.collections.iter().any(|c| c.name == name) { + return Err(bad(cmd, format!("a collection named `{name}` already exists"))); + } + let id = doc.new_collection_id(); let modes = modes.into_iter().enumerate().map(|(i, m)| Mode { id: format!("{id}/mode{}", i + 1), name: m }).collect(); doc.variables.collections.push(Collection { id: id.clone(), name, modes, extends: None }); Ok(json!({"id": id})) diff --git a/crates/engine/src/variables_behaviour_tests.rs b/crates/engine/src/variables_behaviour_tests.rs index 5a868a637..5562dac7d 100644 --- a/crates/engine/src/variables_behaviour_tests.rs +++ b/crates/engine/src/variables_behaviour_tests.rs @@ -365,3 +365,24 @@ fn number_variables_are_pixels_and_edits_are_one_undo_step() { s.undo().unwrap(); assert_eq!(lh(&s), LineHeight::Pixels(20.0), "the value and the bound layer go back together"); } + +#[test] +fn create_collection_keeps_at_least_one_named_mode() { + // A collection keeps at least one mode (removeMode) and mode names can't be empty (renameMode), + // so createCollection refuses an empty mode list, blank mode names and a blank collection name. + let mut s = Session::new(); + for p in [ + json!({"name": "C", "modes": []}), + json!({"name": "C", "modes": [1]}), + json!({"name": "C", "modes": ["", " "]}), + json!({"name": "C", "modes": ["A", " "]}), + json!({"name": " "}), + json!({"name": ""}), + ] { + assert!(s.execute("variable.createCollection", &p).is_err(), "{p} should be refused"); + } + assert!(s.doc().unwrap().variables.collections.is_empty(), "a refused call creates nothing"); + run(&mut s, "variable.createCollection", json!({"name": "C", "modes": [" Light ", "Dark"]})); + let names: Vec = s.doc().unwrap().variables.collections[0].modes.iter().map(|m| m.name.clone()).collect(); + assert_eq!(names, ["Light", "Dark"]); +} From 35cc685e90e42bce8ce30a049c13bd8985dd6bf9 Mon Sep 17 00:00:00 2001 From: Hamza Date: Mon, 19 Oct 2026 00:52:40 +0500 Subject: [PATCH 297/817] cli: an unconfined write still follows a symbolic link Routing the CLI's writes through `file_access` changed what happens when the output path is a symbolic link. `file_access::write` stages the bytes and renames them into place, and a rename replaces the link with a regular file, where `std::fs::write` followed it and wrote to its target. A render to a link reported success while the target kept its old contents. Unconfined writes go back to `std::fs::write`. Confined ones keep the staged write, which is right there: `Roots::check` resolves the path first and has already refused a link leading out of the root, so the write lands on the resolved target inside it. --- apps/figcraft-cli/src/files.rs | 15 ++++++++++++--- apps/figcraft-cli/tests/cli.rs | 28 ++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/apps/figcraft-cli/src/files.rs b/apps/figcraft-cli/src/files.rs index 9dc357b1b..462155998 100644 --- a/apps/figcraft-cli/src/files.rs +++ b/apps/figcraft-cli/src/files.rs @@ -29,13 +29,22 @@ fn image_format(e: &str) -> Option { } } -/// Writes through [`figcraft_engine::file_access`], so a run given automation roots can only -/// write inside a write root (#833). Unconfined it writes as before. +/// Writes through [`figcraft_engine::file_access`] when automation roots are in force, so a +/// confined run can only write inside a write root (#833). +/// +/// Unconfined it writes with `std::fs::write`, as it always did. `file_access::write` stages the +/// bytes and renames them into place, which **replaces** a symbolic link at `path` instead of +/// writing through it to its target -- a change of behaviour for anyone whose output path is a +/// link, and nothing to do with confinement. Inside a root the staged write is the right one: +/// `Roots::check` has already refused a link that leads out of the root. fn write(path: &str, bytes: &[u8]) -> CliResult<()> { if let Some(dir) = Path::new(path).parent().filter(|d| !d.as_os_str().is_empty()) { figcraft_engine::file_access::create_dir_all(dir).map_err(|e| CliError::Failed(e.to_string()))?; } - figcraft_engine::file_access::write(path, bytes).map_err(|e| CliError::Failed(e.to_string())) + if figcraft_engine::file_access::current().is_some() { + return figcraft_engine::file_access::write(path, bytes).map_err(|e| CliError::Failed(e.to_string())); + } + std::fs::write(path, bytes).map_err(|e| CliError::Failed(format!("{path}: {e}"))) } fn page_named(doc: &Document, name: Option<&str>) -> CliResult { diff --git a/apps/figcraft-cli/tests/cli.rs b/apps/figcraft-cli/tests/cli.rs index 399e57bbd..eb42b8d88 100644 --- a/apps/figcraft-cli/tests/cli.rs +++ b/apps/figcraft-cli/tests/cli.rs @@ -239,3 +239,31 @@ fn file_subcommands_are_confined_to_automation_roots() { assert!(escaped.is_file()); let _ = std::fs::remove_dir_all(&d); } + +/// An output path that is a symbolic link is written through, to its target, as `std::fs::write` +/// always did. Routing the CLI's writes through `file_access` for #833 would otherwise have +/// replaced the link with a regular file, because that write stages the bytes and renames them +/// into place. +#[cfg(unix)] +#[test] +fn an_unconfined_write_follows_a_symbolic_link() { + let d = tmp("symlink-out"); + let _ = std::fs::remove_dir_all(&d); + std::fs::create_dir_all(d.join("real")).unwrap(); + let p = |rel: &str| d.join(rel).to_string_lossy().into_owned(); + std::fs::write(d.join("in.json"), br#"[{"command":"shape.rectangle","params":{"x":0,"y":0,"width":40,"height":20}}]"#).unwrap(); + let made = bin().args(["run", &p("in.json"), "--out", &p("doc.figcraft")]).output().unwrap(); + assert!(made.status.success(), "{}", String::from_utf8_lossy(&made.stderr)); + + let target = d.join("real/target.png"); + std::fs::write(&target, b"placeholder").unwrap(); + let link = d.join("link.png"); + std::os::unix::fs::symlink(&target, &link).unwrap(); + + let out = bin().args(["render", &p("doc.figcraft"), "-o", &link.to_string_lossy()]).output().unwrap(); + assert!(out.status.success(), "{}", String::from_utf8_lossy(&out.stderr)); + assert!(std::fs::symlink_metadata(&link).unwrap().file_type().is_symlink(), "the link is still a link"); + let written = std::fs::read(&target).unwrap(); + assert!(written.starts_with(b"\x89PNG"), "the target holds the render, not the placeholder"); + let _ = std::fs::remove_dir_all(&d); +} From 98a156118384416998a3aa62c92d6a8794e9f4d0 Mon Sep 17 00:00:00 2001 From: Al Rifat Sabbir <150162343+alrifatsabbir@users.noreply.github.com> Date: Mon, 19 Oct 2026 03:04:00 +0600 Subject: [PATCH 298/817] Update supported languages in translating.md Added Bengali to the list of supported languages and clarified the status of Russian and Turkish translations. --- docs/translating.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/translating.md b/docs/translating.md index d8addcbc7..4a6ff0d91 100644 --- a/docs/translating.md +++ b/docs/translating.md @@ -16,8 +16,8 @@ Simplified. The catalogs: English (`en`, the source), and Spanish (`es`, with the Latin American overlay `es-419`), French (`fr`), German (`de`), Dutch (`nl`), Brazilian Portuguese (`pt-BR`), Japanese -(`ja`), Korean (`ko`), Simplified Chinese (`zh-Hans`), Czech (`cs`), Indonesian (`id`) and Finnish -(`fi`), machine-drafted and waiting for native speakers' review. Russian (`ru`, Русский) was +(`ja`), Korean (`ko`), Simplified Chinese (`zh-Hans`), Czech (`cs`), Indonesian (`id`), Finnish +(`fi`) and Bengali (`bn`), machine-drafted and waiting for native speakers' review. Russian (`ru`, Русский) was reviewed and approved by VanTan; its catalog keeps Frame, Dev Mode 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. From 0a3f2341a81e1bb08ef51334bccc0a0429f02747 Mon Sep 17 00:00:00 2001 From: Al Rifat Sabbir <150162343+alrifatsabbir@users.noreply.github.com> Date: Mon, 19 Oct 2026 03:10:55 +0600 Subject: [PATCH 299/817] Add support for Bengali text in the UI Updated cjk.rs --- crates/ui-egui/src/cjk.rs | 41 +++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/crates/ui-egui/src/cjk.rs b/crates/ui-egui/src/cjk.rs index fd3ecf8cb..dd195dcf2 100644 --- a/crates/ui-egui/src/cjk.rs +++ b/crates/ui-egui/src/cjk.rs @@ -1,8 +1,8 @@ -//! Chinese, Japanese and Korean text in the UI. egui's own fonts and Inter have no CJK glyphs, so +//! Chinese, Japanese, Korean and Bengali text in the UI. egui's own fonts and Inter have no CJK or non-Latin glyphs, so //! the UI adds a face per script it needs: the UI language's, the scripts in the open file's names //! and comments, the language picker's and typed text. Desktop finds them among the installed //! fonts (the system font scan), only once one is needed, so English users load none; the web -//! build has only the CJK faces built in from craft-fonts (`FIGCRAFT_EMBED_CJK`), else none. +//! build has only the CJK and non-Latin faces built in from craft-fonts (`FIGCRAFT_EMBED_CJK`), else none. use std::sync::Arc; @@ -12,7 +12,15 @@ pub const KANA: u8 = 1; pub const HANGUL: u8 = 2; /// Han characters (and CJK punctuation and full-width forms). pub const HAN: u8 = 4; +pub const BENGALI: u8 = 8; +const BENGALI_FONTS: &[&str] = &[ + "Noto Sans Bengali", + "Nirmala UI", + "Bangla Sangam MN", + "Kalpurush", + "SolaimanLipi", +]; /// Japanese faces, the built-in one first: Windows, macOS, then Linux names. const JAPANESE: &[&str] = &[ "BIZ UDPGothic", @@ -46,24 +54,26 @@ const CHINESE: &[&str] = &[ "Droid Sans Fallback", ]; -/// The CJK scripts in `s`. +/// The CJK and Bengali scripts in `s`. pub fn scripts(s: &str) -> u8 { s.chars().fold(0, |m, c| { m | match u32::from(c) { 0x3040..=0x30FF | 0x31F0..=0x31FF | 0xFF66..=0xFF9F => KANA, 0x1100..=0x11FF | 0x3130..=0x318F | 0xA960..=0xA97F | 0xAC00..=0xD7FF | 0xFFA0..=0xFFDC => HANGUL, 0x3000..=0x303F | 0x3400..=0x4DBF | 0x4E00..=0x9FFF | 0xF900..=0xFAFF | 0xFF01..=0xFF65 | 0x20000..=0x3FFFF => HAN, + 0x0980..=0x09FF => BENGALI, _ => 0, } }) } -/// The CJK scripts a UI language (a catalog code) is written in. +/// The scripts a UI language (a catalog code) is written in. pub fn language(code: &str) -> u8 { match code.split('-').next() { Some("ja") => KANA | HAN, Some("ko") => HANGUL, Some("zh") => HAN, + Some("bn") => BENGALI, _ => 0, } } @@ -75,7 +85,9 @@ pub fn can_show(code: &str) -> bool { let need = language(code); need == 0 || !cfg!(target_arch = "wasm32") - || samples(need, 0).iter().all(|(c, _)| figcraft_text::face_with_char(*c, &["BIZ UDPGothic", "Noto Sans CJK SC"]).is_some()) + || samples(need, 0).iter().all(|(c, families)| { + figcraft_text::face_with_char(*c, families).is_some() + }) } /// A character standing for each script in `need`, with the families to look for it in, the UI @@ -89,10 +101,21 @@ fn samples(need: u8, ui: u8) -> Vec<(char, Vec<&'static str>)> { (false, HANGUL) => ('漢', [KOREAN, JAPANESE, CHINESE].concat()), (false, _) => ('漢', [JAPANESE, KOREAN, CHINESE].concat()), }; - let mut v = vec![(KANA, ('あ', JAPANESE.to_vec())), (HAN, han), (HANGUL, ('한', KOREAN.to_vec()))]; + let mut v = vec![ + (KANA, ('あ', JAPANESE.to_vec())), + (HAN, han), + (HANGUL, ('한', KOREAN.to_vec())), + (BENGALI, ('অ', BENGALI_FONTS.to_vec())), + ]; match ui { HANGUL => v.reverse(), HAN => v.swap(0, 1), + BENGALI => { + if let Some(pos) = v.iter().position(|(bit, _)| *bit == BENGALI) { + let item = v.remove(pos); + v.insert(0, item); + } + } _ => {} } v.into_iter().filter(|(bit, _)| need & bit != 0).map(|(_, s)| s).collect() @@ -124,11 +147,13 @@ mod tests { assert_eq!(scripts("ボタン"), KANA); assert_eq!(scripts("버튼"), HANGUL); assert_eq!(scripts("按钮"), HAN); + assert_eq!(scripts("বাংলা"), BENGALI); assert_eq!(scripts("日本語のレイヤー(1)"), KANA | HAN); assert_eq!(language("ja"), KANA | HAN); assert_eq!(language("ko"), HANGUL); assert_eq!(language("zh-Hant"), HAN); assert_eq!(language("zh-Hans"), HAN); + assert_eq!(language("bn"), BENGALI); assert_eq!(language("fr"), 0); assert!(["en", "es", "es-419", "fr", "de", "pt-BR", "tr", "id"].iter().all(|c| can_show(c))); } @@ -137,7 +162,7 @@ mod tests { fn the_ui_language_script_comes_first() { let order = |need, ui| samples(need, ui).into_iter().map(|(c, _)| c).collect::(); let first_face = |need, ui| samples(need, ui).first().and_then(|(_, f)| f.first()).copied(); - assert_eq!(order(KANA | HAN | HANGUL, 0), "あ漢한"); + assert_eq!(order(KANA | HAN | HANGUL | BENGALI, 0), "あ漢한অ"); assert_eq!(order(KANA | HAN | HANGUL, KANA | HAN), "あ漢한"); assert_eq!(order(KANA | HAN | HANGUL, HANGUL), "한漢あ"); assert_eq!(order(HANGUL, 0), "한"); @@ -150,6 +175,6 @@ mod tests { assert_eq!(order(KANA | HAN, language("zh-Hans")), "们あ"); assert!(["Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC"].iter().all(|f| samples(HAN, HAN)[0].1[..4].contains(f))); assert!(faces(0, "en", &|_| false).is_empty()); - assert!(faces(KANA | HANGUL | HAN, "ja", &|_| true).is_empty(), "nothing is looked up for scripts the UI draws"); + assert!(faces(KANA | HANGUL | HAN | BENGALI, "ja", &|_| true).is_empty(), "nothing is looked up for scripts the UI draws"); } } From 23d0d9e49e692e42ded69f90c84962c842fb1e41 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Sun, 18 Oct 2026 21:14:08 +0000 Subject: [PATCH 300/817] Accept --control=PORT like --control PORT Fixes #837 Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- apps/figcraft/src/args.rs | 6 +++--- apps/figcraft/src/args_tests.rs | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/figcraft/src/args.rs b/apps/figcraft/src/args.rs index 3b4136d99..7e9562e99 100644 --- a/apps/figcraft/src/args.rs +++ b/apps/figcraft/src/args.rs @@ -7,7 +7,7 @@ /// What the app was started with. #[derive(Debug, Default, PartialEq, Eq)] pub struct Args { - /// `--control `: the JSON-lines control server. + /// `--control ` (or `--control=`): the JSON-lines control server. pub control: Option, pub files: Vec, /// The last invite link given. @@ -63,8 +63,8 @@ pub fn parse(args: &[String]) -> Args { }; if let Some(roots) = roots { roots.push(inline.or_else(|| it.next().cloned()).unwrap_or_default()); - } else if a == "--control" { - out.control = it.next().and_then(|p| p.parse().ok()); + } else if flag == "--control" { + out.control = inline.or_else(|| it.next().cloned()).and_then(|p| p.parse().ok()); } else if is_invite(a) { out.join = Some(a.clone()); } else if let Some(path) = file_url_path(a) { diff --git a/apps/figcraft/src/args_tests.rs b/apps/figcraft/src/args_tests.rs index 2ae29b3c8..3b880209b 100644 --- a/apps/figcraft/src/args_tests.rs +++ b/apps/figcraft/src/args_tests.rs @@ -16,6 +16,14 @@ fn files_and_the_control_port() { assert_eq!(parse(&args(&["--control", "nope"])).control, None); } +#[test] +fn the_control_port_accepts_the_equals_form() { + let a = parse(&args(&["--control=7980", "a.figcraft"])); + assert_eq!(a, Args { control: Some(7980), files: args(&["a.figcraft"]), ..Args::default() }); + // A bad port is ignored, not taken as a file. + assert_eq!(parse(&args(&["--control=nope"])), Args::default()); +} + #[test] fn automation_roots_repeat_and_are_never_files() { let a = parse(&args(&["--automation-read-root", "in", "--automation-write-root=out", "--automation-read-root=more", "a.figcraft"])); From a0d1162976fac1e4a8b8fd49a3948e9d6bad6f40 Mon Sep 17 00:00:00 2001 From: skylar taylor-barrick Date: Sun, 18 Oct 2026 15:20:15 -0600 Subject: [PATCH 301/817] Desktop: refuse unknown command-line options instead of ignoring them (#836) (#844) A mistyped or unsupported flag (e.g. --automation-write-roots) used to be dropped silently, so the app started unconfined. It now exits 2 with 'unknown option', like a bad automation root. A bare -- ends the options. Adds a desktop control-channel test that file.save / file.saveAs outside the write root are refused and create nothing, while saves inside succeed, and documents that the root flags arrived in 0.7.0 (0.6.0 ignores them). --- apps/figcraft/src/args.rs | 14 ++++++++++++-- apps/figcraft/src/args_tests.rs | 15 ++++++++++++++- apps/figcraft/src/main.rs | 9 ++++++++- crates/ui-egui/src/control_roots_tests.rs | 18 ++++++++++++++++++ docs/control-protocol.md | 5 ++++- 5 files changed, 56 insertions(+), 5 deletions(-) diff --git a/apps/figcraft/src/args.rs b/apps/figcraft/src/args.rs index 3b4136d99..11798f5b7 100644 --- a/apps/figcraft/src/args.rs +++ b/apps/figcraft/src/args.rs @@ -2,7 +2,9 @@ //! [--automation-write-root

4~X<{4-ShH4S{YfDa+)8$50lf zI*^WYat7|K4y!y;N*4o}rE`P-rp8=mPBsk7pm38KB54qFl23N*FdH@uJrZ}`qjLwV z7CsFewbMzi%W(B*W^|sIk%dk3OB68_?+78qW{Po^>h0^-b58xG$7n_#tHOe|@Y2)O zU=W~Rc{SyA!4ySS(Dqq)ySW%t*759TxVjQtWQcVyy`0WjU*j#|<^V2zw%i1j@jKf+ z(#=4V2HIq2E0bufn(zP3kvnJ`DFjHz1yf{!n?{G;pyvL4o~ zuQ7_TA`U1#;mq$5z#)dlx@eLIA+%nP25w17X=E@|boPD&j5ikCTuehEI04fynHso> zP1Aws3Riv)R4Kuv!b_Yp=P3d(S`=18!!mQiCf1Tebb6p4K3N1gyeI6Mo&m&sEG4ys zU=y|mnF`0UvJmpO{hEnFnXZCiz46ikRZSz!kA>hWU3zz{yyXWbVMj#p5(|mOxLscU z`8NUXxnRErxH-e*|V68JpIq%hvtStme)lPaWAx5jl0o+vw@UvR@FY(Z{>*iqha>Y#}t4S@ho@b#LuxY6A3 zO#ulzSjmCq7?@6HRWuu~`@n$<0ChV2vY#w?9cZ#xP!u&ULzbBB21ui4C6M~zdpsjV zzd`&wuBnMRD&h%_Gik~EV zK2-=Rt`CJ+gKf6}zp+{IF7aS#DkZ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{IL3dg=HDp(BS}CeHG1yt^&rsZXD=!zJzr z=~i8?%{$SjLIbD)%O!jmILL7B6vZBZ?NEvZPniSRaJREw1DpuJDF*P7T+~XFL@~=s&ZscucdJf4$5cM;I?{fb-hS` zx?x}uL&C`O9OyiYJcnZ8*{I5fI4vuMXA)=2Gp+&ba=cgM3e&E%`pHy|Bj&JOfORRr zP-wGnMowHl&SANgykvF)?+S$Qy!{FQ8(e5Q4b0Or`I&XFEQ5B1@`8irezy>MOqp|Z zGQt}K1O;obleHm;-g*Ib{ize!XyDuGA5O#FfG?^bl(}CdKKl6{)L$L)4MEQwg*+q! zc;IlM=BL^GZ4$vf2c>w~NvdhOdGZm&$3B92(X|#d68G#dOor?N10x(ze_rl8conq_ z0M78H1ZcTj)nV#;fdv^ob?ykt(vyVEceO3alA`z7=mk4cQmhp6%}FO$VX}d{!}@6D z_VTXyJ8*x%;8*5ct;afO>!5;-ecI<+g6Oz>ufFGK0ASSy{{FhlauJ(O@0;Q=oxowcl+_U47bVo}1P0J3 z(4$x1Mmh+Jf)Rq-gw2IffU!s}R{6qcj3GK>B1#UWW$k{Cg&K#q@&j(QQ96Uw|;tVb~07^Q3}%nm z5+5JW_;pPR^4x`;irk-eF4K~!Qq8xytEf$Xur;k7Oj(d(OqC5s;`sHlM=W8_nD})s z$II8Eydrma29M!dlQ|c0{LyHEpR!AS_=m4PTD|+%)44DoJspq4wsU69*AD2fyC9J{ zx8wqWNpBkl4L<{o zF;nOE9us&H`BnTG7siUTa&G6?LE5VM18Y7g^JKi">"# + ) +} + +fn names(s: &Session, ids: &[NodeId]) -> Vec { + let doc = s.doc().unwrap(); + ids.iter().map(|i| doc.node(*i).unwrap().name.clone()).collect() +} + +#[test] +fn buffer_is_found_in_the_html() { + let file = copied_file(); + assert_eq!(figma_clipboard_buffer(&clipboard_html(&file)), Some(file)); + assert_eq!(figma_clipboard_buffer("

;!41v7M9eqnF|3dagaT~ zovgZp@EsZPOX(oN>Ag;$cfVE^XGBDEhVf6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al 0 HcmV?d00001 diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 6de538e7a..ee5093bee 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-10-14 · **Change:** minor (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) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-14 · **Change:** minor (native-density canvas textures aligned to device pixels; 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) · **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,6 +92,7 @@ interaction feel not yet compared. | Item | Status | Notes | |---|---|---| | Pan/zoom: wheel, pinch, Space-drag, Shift+0/1/2, Cmd+0, `+`/`-` | done | Shift-wheel pans sideways, pinch and the zoom tool keep the point under the pointer; zoom steps, limits (2%–25,600%) and frame order pinned where the documentation is silent (`view_behaviour_tests`) | +| Canvas texture sharpness | done (ours) | At native render density the canvas image starts on whole device pixels, avoiding extra linear-filter blending after fractional zoom or pan and at fractional display scales. Placement changes by at most half a device pixel; document geometry and overlays keep their coordinates. Stale zoom renders and pixel preview retain their existing projection (`canvas_image_rect_tests`). This does not establish text-rendering parity with Figma. | | Rulers and guides (drag out, move, remove; rotated frames; frame guides) | done | guides belong to the page or a top-level frame (a frame moved into another keeps its guides but they stop applying); a click selects one for Delete, the arrows or the context menu's Remove guide; Alt-drag drops a copy; Alt while dragging measures to the layers in the frame it crosses; ruler numbering checked by eye only | | Frame labels (rotated, right-to-left), size badge | done | | | Outline mode | done | Outlines, outlines for the selection, mask outlines, frame outlines; shapes are clicked on their outlines, reaching layers behind; View ▸ Outlines ▸ Include hidden layers (`view.outlinesHiddenLayers`) outlines hidden layers too and Include object bounds (`view.outlinesObjectBounds`) draws the box of every layer whose outline isn't its box (groups, text, ellipses, vectors); what either draws can be clicked there (a hidden layer on its outline, a group on its box) and nothing else can; both are view settings like the other outline flags (per file, off in a new one, checked in the menu); the lines are light on a dark page (`outline_options_tests`). The main menu now shows a check mark beside every View toggle that is on | @@ -164,6 +165,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| +| 2026-10-14 | minor | Align native-density canvas image placement to the device-pixel grid, avoiding interpolation blur at fractional zoom, pan and display scaling. No readiness score change. | | 2026-10-14 | minor | Home screen recent files as cards with thumbnails on their page colour, a sortable table view, selection, keyboard and a context menu | | 2026-10-13 | minor | Vector edit mode regions: with the Move tool the filled area under the pointer is hatched with "/" lines in the selection colour (about 1.4 px), clipped by the area's own fill rule so holes stay clear, and the hatch goes when the pointer is 3.5 px from a point or 2 px from a segment (screen pixels at any zoom); the spacing follows octave folding, fitted to measurements at several zoom levels (8 px at every power-of-two zoom, the gap growing with the zoom and stepping back at √2 · 2ⁿ), anchored to the vector so it doesn't slide when panning, one continuous pattern across selected areas; a click selects an area with its points (they move with it but keep the unselected look), Shift adds an area or takes a selected one out, a press on a selected area drags everything selected, drags show no hover hatch, a click on an empty spot (such as a hole) clears the areas and stays in edit mode, the last area listed wins where areas overlap, only filled vectors have areas; `vector.edit.select {regions}` and `vector.edit.state` report them (`regions_tests`, `vector_regions_tests`) | | 2026-10-13 | minor | Home screen: a Templates tab (eight starter templates as cards with thumbnails, search and a kind filter; click or Enter opens a new document) replaces the Community placeholder, the Drafts placeholder is removed, Recents offers four templates while there are no recent files and shows a Getting started card (closable; Help ▸ Getting started brings it back), File ▸ New from template…, and a first run opens on the home screen | From 39d0f2d87262f96a409679c1d9bbdf163eb869e1 Mon Sep 17 00:00:00 2001 From: Skyfuller1303 Date: Thu, 15 Oct 2026 00:15:01 +0200 Subject: [PATCH 003/817] M7: show windowed text and sidebar sharpness close-ups --- docs/images/shot-windowed-canvas-after-en.png | Bin 261324 -> 120841 bytes .../images/shot-windowed-canvas-before-en.png | Bin 305165 -> 186314 bytes docs/images/shot-windowed-layers-after-en.png | Bin 0 -> 11407 bytes .../images/shot-windowed-layers-before-en.png | Bin 0 -> 13237 bytes docs/images/shot-windowed-text-after-en.png | Bin 0 -> 19446 bytes docs/images/shot-windowed-text-before-en.png | Bin 0 -> 30082 bytes 6 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 docs/images/shot-windowed-layers-after-en.png create mode 100644 docs/images/shot-windowed-layers-before-en.png create mode 100644 docs/images/shot-windowed-text-after-en.png create mode 100644 docs/images/shot-windowed-text-before-en.png diff --git a/docs/images/shot-windowed-canvas-after-en.png b/docs/images/shot-windowed-canvas-after-en.png index 4805d0e7513f89d2a4966234aa0c74f4ef9315e2..0a05703a4b6506d9725f7466b36288e3c7fcc47b 100644 GIT binary patch literal 120841 zcmb4rbzD??*Zmo4Mu8!fZbSqGRFF<7F$ig-EJ{i#0by_eK|m}JL|VF3O1cD8L_$JP zT9FQsQ0li2_j=!Z-}kTIe4al@!A}rjf zbYi;Y)1;=tt6!~6={dQ%x%v6|+1c4SIXU_H>CT$y{e1~9DJyg7D;P}EjDq*!YaJaO z+bn*3S3l}Shm7p#nwjmr1GD(oE0zuh0KWi(Ie0MBwmmWW@#BkJx5-zX-KVl*r zdgfPD3_NWj`|}C-+wRGB zyGg8O{lb|uk>!;C{-HIlr>Ez_3lqPot^-6o_Fo?x**n$}#T8%q@0&zImi^*PUYJ~c z&4Lg_d{$@e=Xw99g%UcInN%o$a;S zH?QSao_Gh$4wwo1w%l@&V>ca`SalH^ra85vKz#cm*C=21`ow8Bx25vy-vx9M-!I;A z>?`Pr)PeCtVl;pK`n9#au@Kr=Z2z&jt4lw(hqt~n*H~;Yij$LbLYVT;FlW)rb$1)c zo6UEmG>+60mzo!9cM@H>TGE>Z4;`}qc47V3FUdU0suz0gj0_^Qxqh2VEwH*{l?yfI zmX>#EebxrOj0-KdmRh(1mYSH}NOTtmOfAiD^;;@*AK4(vW;^wS6Xn>=A|xcI{g2JI zJ7p-Xmh@TruJjmZo=xys7*Yrb*a_JFb$e9Z>FQN}`je-^9X{z@(d4J!^S)(tbo7YR zK=EPo((~ol$OE1#-jrRT`*Z6U*U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