diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 9700a8e9..1968076f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,9 +1,7 @@
-# CI for pull requests and main: format, clippy, tests, dependency layering, asset attribution and
-# the wasm32 check (the same gates as `cargo xtask ci`). Linux only: macOS is built and tested only
-# by release.yml (the org's macOS runners are kept for releases; craftrules release/playbook.md),
-# and Windows/FreeBSD packaging have their own workflows.
name: CI
+# Quality gates for every push to main and every pull request (`cargo xtask ci`), through the
+# suite's shared gate workflow in craft-common-actions.
on:
push:
branches: [main]
@@ -13,76 +11,21 @@ on:
permissions:
contents: read
-env:
- CARGO_TERM_COLOR: always
- CARGO_INCREMENTAL: 0
- RUST_BACKTRACE: 1
- # Debug and test builds keep line tables (file:line in panic backtraces) but drop the rest of the
- # debug info: faster codegen and links, and a smaller target dir.
- CARGO_PROFILE_DEV_DEBUG: line-tables-only
-
-# A newer push to a PR branch cancels its older run. Runs on main are never cancelled, so every
-# main state that gets a run is checked to the end.
+# A newer push to a PR branch cancels its older run; every push to main runs to the end.
concurrency:
- group: ci-${{ github.ref }}
+ group: ci-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
- test:
- timeout-minutes: 35
- name: test (ubuntu-latest)
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v7
-
- - name: Install Linux system dependencies (egui/winit/rfd)
- run: |
- sudo apt-get update
- sudo apt-get install -y --no-install-recommends \
- libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev \
- libgl1-mesa-dev libgtk-3-dev
-
- - uses: dtolnay/rust-toolchain@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
- with:
- save-if: ${{ github.ref == 'refs/heads/main' }}
- cache-on-failure: true
-
- - name: Format
- run: cargo fmt --all -- --check
-
- - name: Clippy
- run: cargo clippy --workspace --all-targets --locked -- -D warnings
-
- # Without craft-fonts (the optional CRAFT_FONTS_DIR input, which .cargo/config.toml points at
- # a sibling checkout that CI doesn't have): everything must build and pass without it.
- - name: Test
- run: cargo test --workspace --locked
-
- - name: Dependency layering
- run: cargo run --locked -q -p xtask -- layers
-
- - name: Asset attribution
- run: cargo run --locked -q -p xtask -- assets
-
- wasm:
- timeout-minutes: 30
- name: wasm32 check
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v7
- - uses: dtolnay/rust-toolchain@stable
- with:
- targets: wasm32-unknown-unknown
- - uses: Swatinem/rust-cache@v2
- with:
- key: wasm32
- save-if: ${{ github.ref == 'refs/heads/main' }}
- cache-on-failure: true
- # The engine, the UI crate and apps/figcraft-web must keep compiling for the browser.
- - name: Check wasm-safe crates
- run: cargo run --locked -q -p xtask -- wasm
+ gate:
+ # Tracks @main so suite-wide CI fixes reach every app without a PR in each repository.
+ uses: storytold/craft-common-actions/.github/workflows/gate.yml@main
+ with:
+ # The craft-fonts commit release.yml builds with. Needs fonts/latin-manifest.txt (Inter):
+ # crates/text/build.rs fails a build that requires craft-fonts 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
+ packages: >-
+ libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev
+ libgtk-3-dev
diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml
index ff15bfbc..3b03a99c 100644
--- a/.github/workflows/freebsd.yml
+++ b/.github/workflows/freebsd.yml
@@ -4,12 +4,10 @@
# before it can fail a release. Nothing is uploaded and no secrets are used.
name: FreeBSD
-# The VM build takes one to several hours, so it runs nightly on main rather than on every push
-# or dependency change: a drifted dependency still shows up within a day. PRs that change the
-# FreeBSD packaging itself still run it.
+# The VM build is slow, so it runs nightly on main and on pushes to `release`, not on every pull
+# request: a drifted dependency still shows up within a day, and always before a release ships.
+# PRs that change the FreeBSD workflow or packaging itself still run it.
on:
- schedule:
- - cron: "17 2 * * *"
push:
branches: [release]
pull_request:
@@ -17,6 +15,8 @@ on:
- .github/workflows/freebsd.yml
- packaging/freebsd/**
- packaging/env.sh
+ schedule:
+ - cron: "17 2 * * *"
workflow_dispatch:
concurrency:
diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml
new file mode 100644
index 00000000..e78fe1ea
--- /dev/null
+++ b/.github/workflows/sonarcloud.yml
@@ -0,0 +1,21 @@
+name: SonarCloud
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ types: [opened, synchronize, reopened]
+
+permissions:
+ contents: read
+
+concurrency:
+ group: sonarcloud-${{ github.ref }}
+ # A push to main is the run that publishes coverage; superseded runs there would never finish.
+ cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
+
+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
diff --git a/AGENTS.md b/AGENTS.md
index 708da805..b2384311 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. 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 708da805..b2384311 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. 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/Cargo.lock b/Cargo.lock
index 459c8320..27cb0d4e 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"
@@ -1456,7 +1465,7 @@ checksum = "b97b65636e5b9ef369943878ac74335ba1c55c1cb6adbf1e2c293c624248d693"
[[package]]
name = "figcraft"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"arboard",
"craft-window",
@@ -1482,7 +1491,7 @@ dependencies = [
[[package]]
name = "figcraft-cli"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"figcraft-doc",
"figcraft-engine",
@@ -1496,9 +1505,10 @@ dependencies = [
[[package]]
name = "figcraft-collab"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"base64 0.22.1",
+ "chrono",
"figcraft-color",
"figcraft-doc",
"figcraft-geom",
@@ -1511,7 +1521,7 @@ dependencies = [
[[package]]
name = "figcraft-collab-net"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"base64 0.22.1",
"figcraft-collab",
@@ -1534,7 +1544,7 @@ dependencies = [
[[package]]
name = "figcraft-color"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"kurbo",
"serde",
@@ -1543,7 +1553,7 @@ dependencies = [
[[package]]
name = "figcraft-doc"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"figcraft-color",
"figcraft-geom",
@@ -1555,7 +1565,7 @@ dependencies = [
[[package]]
name = "figcraft-engine"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"base64 0.22.1",
"craft-docpath",
@@ -1583,7 +1593,7 @@ dependencies = [
[[package]]
name = "figcraft-format"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"figcraft-doc",
"figcraft-pathops",
@@ -1598,7 +1608,7 @@ dependencies = [
[[package]]
name = "figcraft-geom"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"kurbo",
"serde",
@@ -1606,7 +1616,7 @@ dependencies = [
[[package]]
name = "figcraft-layout"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"figcraft-doc",
"figcraft-geom",
@@ -1614,7 +1624,7 @@ dependencies = [
[[package]]
name = "figcraft-mcp"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"base64 0.22.1",
"figcraft-collab-net",
@@ -1630,7 +1640,7 @@ dependencies = [
[[package]]
name = "figcraft-pathops"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"figcraft-doc",
"figcraft-geom",
@@ -1639,7 +1649,7 @@ dependencies = [
[[package]]
name = "figcraft-pdf"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"figcraft-color",
"figcraft-doc",
@@ -1656,7 +1666,7 @@ dependencies = [
[[package]]
name = "figcraft-plugin"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"figcraft-color",
"serde",
@@ -1669,7 +1679,7 @@ dependencies = [
[[package]]
name = "figcraft-render"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"crc32fast",
"figcraft-color",
@@ -1687,7 +1697,7 @@ dependencies = [
[[package]]
name = "figcraft-server"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"crc32fast",
"ctrlc",
@@ -1711,7 +1721,7 @@ dependencies = [
[[package]]
name = "figcraft-svg"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"base64 0.22.1",
"figcraft-color",
@@ -1727,7 +1737,7 @@ dependencies = [
[[package]]
name = "figcraft-text"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"figcraft-doc",
"figcraft-geom",
@@ -1741,9 +1751,10 @@ dependencies = [
[[package]]
name = "figcraft-ui-egui"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"base64 0.22.1",
+ "chrono",
"egui",
"egui_extras",
"figcraft-color",
@@ -1766,7 +1777,7 @@ dependencies = [
[[package]]
name = "figcraft-web"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"eframe",
"egui",
@@ -5871,7 +5882,7 @@ checksum = "9440ea3e5aeabb0ac63af70daf835274065238cdd0cec83418f417eae38bacee"
[[package]]
name = "xtask"
-version = "0.9.0"
+version = "0.10.0"
dependencies = [
"figcraft-engine",
"serde_json",
diff --git a/Cargo.toml b/Cargo.toml
index 6cc17546..90297f29 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.9.0"
+version = "0.10.0"
edition = "2024"
license = "MIT OR Apache-2.0"
rust-version = "1.95"
@@ -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 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"] }
postcard = { version = "1", default-features = false, features = ["alloc"] }
@@ -101,11 +103,15 @@ todo = "deny"
unimplemented = "deny"
unreachable = "deny"
-[profile.dev.package."*"]
-opt-level = 2
-
+# Workspace crates keep file:line in panic backtraces; dependencies carry no debug info. Both make
+# the test build faster and the target dir smaller.
[profile.dev]
opt-level = 1
+debug = "line-tables-only"
+
+[profile.dev.package."*"]
+opt-level = 2
+debug = false
[profile.release]
lto = "thin"
diff --git a/README.md b/README.md
index 63bc739b..ebbf7fa0 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,10 @@
+
+
+
+
FigCraft
diff --git a/ROADMAP.md b/ROADMAP.md
index f43cd015..6d5de4ad 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-24 · **Change:** minor (boards: a board area row and progress entry; community fixes in #507, #510, #529 and #530: auto-save, a text box by dragging, batch step references, removing someone from a live session, Russian and Turkish catalogs reviewed, Czech and Indonesian drafts, the Japanese draft completed, zoom previews, the web clipboard, Alt-drag snapping and Cmd+D repeat, recovery copies, crash and rollback fixes, colour emoji, `.fig` import fixes; earlier changes are in the revision history below) · **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
@@ -50,7 +50,7 @@ against real Figma documents. Ready-for-real-work is ~53%, inside alpha's ~40–
~75% **and** reliable `.fig` import: the `.fig` import's tail (5–10 h), a real-file corpus with measured
fidelity (15–30 h), the interaction pass (25–40 h of the 40–60), core depth to ~80% (40–75 h),
basic multiplayer on the landed core (30–55 h), stability and platform QA (20–40 h), a partial GPU path (15–30 h);
-native speakers' reviews of the six language drafts need people.
+native speakers' reviews of the nine language drafts need people.
## By dimension
@@ -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; Russian and Turkish reviewed by native speakers; Spanish with a Latin American overlay, French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Czech 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) |
@@ -86,13 +86,14 @@ native speakers' reviews of the six language drafts need people.
| Styles & variables | 95% | 76% | 2–4 | [components-parity](docs/components-parity.md) |
| Prototyping | 92% | 74% | 2–5 | [prototyping-parity](docs/prototyping-parity.md) |
| Import/export | 86% | 58% | 5–10 | [file-format-parity](docs/file-format-parity.md) |
-| Dev Mode / inspect | 96% | 72% | 0–1 | [dev-mode-parity](docs/dev-mode-parity.md) |
+| Dev Mode / inspect | 97% | 76% | 2–4 | [dev-mode-parity](docs/dev-mode-parity.md) |
| Comments, versions, misc | 87% | 63% | 1–3 | [collaboration-parity](docs/collaboration-parity.md) |
| Multiplayer & sharing | 17% | 5% | 42–84 | [collaboration-parity](docs/collaboration-parity.md) |
| Plugins & widgets | 60% | 35% | 8–26 | [plugins](docs/plugins.md) |
| Team libraries | 70% | 40% | 4–8 | [components-parity](docs/components-parity.md) |
| Figma Draw extras | 88% | 60% | 1–3 | [gaps](docs/gaps.md) |
| AI features | 0% | 0% | 30–60 | [gaps](docs/gaps.md) |
+| Boards (whiteboarding; not in the weighted numbers) | ~35% | ~20% | 30–60 | [boards-parity](docs/boards-parity.md) |
## Languages
@@ -126,14 +127,24 @@ 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 (with es-419), fr, de, pt-BR, ja, ko, zh-Hans, id and cs drafts (people), the entries added since each catalog was written, then Hindi, Vietnamese and Arabic ([localization-parity](docs/localization-parity.md)).
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
+- **2026-10-24** · Boards (M12): File ▸ New board makes a board, a file kind of its own saved in `.figcraft` and carried to people joining a live session. Sticky notes (8 colours, text that shrinks as the note grows, the author's name, Shift+Cmd/Ctrl+Enter for the next one), shapes with text (7 outlines), connectors that re-route when what they join moves (computed in the engine's normalize pass, so local edits, undo and others' edits agree), marker, highlighter and eraser, stamps with the placer's name on hover; a board toolbar, a contextual bar over the selection and the Design panel hidden until asked for; prototyping and Dev Mode refuse on boards. Design files and boards have their own marks (a pen nib, a note) on tabs, the home screen and the Open files list. Checked in the app, with two app instances in one live session, and through MCP; the web build compiles ([boards-parity](docs/boards-parity.md)).
+- **2026-10-15** · Auto-save (M1, #305): Preferences ▸ Save files automatically (`pref.autoSave`, off by default, desktop only) saves each open file that has a path 3 s after its last change, never during a gesture, a live text preview or while a version is shown; the file is encoded off the UI thread, a failed save says why and is tried again a minute later. Numbers unchanged.
+- **2026-10-15** · A text box by dragging (M1, #363): a drag with the Text tool makes a fixed-size text box the size of the drag; a click still makes auto-width text. Numbers unchanged.
+- **2026-10-15** · Batch step references (M0.9, #400): a `command.batch` step can use the id an earlier step made (`{"$step": n}`, a reserved key), so a nested tree takes one call and one undo step. Numbers unchanged.
+- **2026-10-15** · Removing someone from a live session (M9, #338): the host or the file's owner removes a person from the avatar's menu or with `collab.removePerson`; they keep their copy and can't rejoin while the session runs. Numbers unchanged.
+- **2026-10-15** · Languages (M10, #257, #263, #469, #477, #288): Russian (one/few/many plurals) and Turkish catalogs reviewed by native speakers, Czech and Indonesian drafts, the Japanese draft completed; Preferences ▸ Language lists 12 languages and Latin American Spanish. Numbers unchanged.
+- **2026-10-15** · Zoom previews (M8, #312): when renders from scratch are slow, a new zoom shows the whole view coarsely first, then refines it. Numbers unchanged.
+- **2026-10-15** · Web clipboard (M1, #375): copy and paste in the browser go through the system clipboard. Numbers unchanged.
+- **2026-10-15** · Alt-drag copies snap to their original and Duplicate (Cmd+D) repeats the last copy's offset (M1, #283). 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.
+- **2026-10-15** · Dev Mode tail (M6, gap 16): generated layer trees start with the import lines of the connected components they call, once each per language; Compare changes takes any saved version as the before; a behaviour suite made the Dev Mode canvas inspect-only (no moving, resizing, drawing or editing; menus and shortcuts refuse design edits with a note), added Changed to the ready list and refused statuses on layers inside frames; read-only plugins show their panels from the Inspect tab. Dev Mode 97% / 76%.
- **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.
@@ -316,6 +327,56 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md).
| Date | Change | Summary |
|---|---|---|
+| 2026-10-24 | minor | Boards (M12): a file kind of its own (`file.newBoard`, saved in `.figcraft`, carried to live-session joiners) with sticky notes, shapes with text, connectors that re-route when what they join moves (an engine recompute, the same for local edits, undo and others' edits), marker, highlighter and eraser, stamps with the placer's name, a board toolbar and a contextual bar; prototyping and Dev Mode refuse on boards; design files and boards have their own marks on tabs and file rows. Boards row added outside the weighted numbers; headline numbers unchanged at this rounding |
+| 2026-10-15 | minor | Auto-save (#305, #296): Preferences ▸ Save files automatically (`pref.autoSave`, off by default; desktop only, the browser has no files to save to) saves each open file that has a path 3 s after its last change, so steady editing doesn't save every few seconds, and never during a gesture, a live text preview or while a version is shown. The file is encoded on a thread of its own and written as of that moment (edits made meanwhile stay unsaved); a failed save says why in a toast and is tried again a minute later, and version history checkpoints keep coming with it on. Numbers unchanged |
+| 2026-10-15 | minor | A text box by dragging (#363, #360): a drag with the Text tool makes a fixed-size text box the size of the drag (at least one line tall); a click, or a drag shorter than the drag threshold, still makes auto-width text. Numbers unchanged |
+| 2026-10-15 | minor | Batch step references (#400): inside `command.batch` (MCP `batch`), `{"$step": n}` anywhere in a step's params stands for the `id` step n returned (`{"$step": n, "field": …}` for another field; `$step` is a reserved key), so a frame with its children takes one batch and one undo step; a malformed reference fails the batch, which rolls back, and a nested batch keeps references to its own steps. Numbers unchanged |
+| 2026-10-15 | minor | Removing someone from a live session (#338): right-click a person's avatar ▸ Remove *name* from session, or `collab.removePerson {client}`, when you host the session or own the file on a server; the session ends for them (they keep their copy), the code or link they hold no longer gets them back in while it runs, and everyone else stays. Numbers unchanged |
+| 2026-10-15 | minor | Pages list (#272, #258): a long pages list scrolls in its own area, so the layers below stay in view; page and layer drops count only inside the list's visible rows. Numbers unchanged |
+| 2026-10-15 | minor | Variables export in the browser (#368): Export… ▸ Variables JSON / CSS custom properties did nothing in the web build and now arrives as a download; importing there still needs a file picker. Numbers unchanged |
+| 2026-10-15 | minor | Font picker keys (#352, #345): Up and Down step through the font families from the current one, keeping the highlight in view and previewing it on the canvas; Enter applies it, Escape leaves the text as it was. Numbers unchanged |
+| 2026-10-15 | minor | Leaving Design ends the pen path (#308, #307): switching to Prototype or Inspect while the Pen draws ends the path and goes back to Move (pressing Design again keeps drawing), and a click on the toolbar no longer reaches the canvas under it. Numbers unchanged |
+| 2026-10-15 | minor | Vector edit mode keeps the canvas still (#322): the edit mode hints in the Design panel wrap, so entering edit mode and picking a region no longer shift the canvas by about 25 points in the middle of the click (which dragged the region picked). Numbers unchanged |
+| 2026-10-15 | minor | Drop shadows under a background blur (#317, #255): a layer with both casts its shadows from what it paints (a translucent fill casts a lighter shadow than an opaque one) and reads the backdrop only after drawing them, so a shadow shown behind transparent areas is seen through the blur. Numbers unchanged |
+| 2026-10-15 | minor | When the window can't open (#306, #261): Windows release builds have no console, so a graphics failure at start quit without a word; the error is now logged and shown in a message box in the interface language, with what to try (unset `WGPU_BACKEND`, update the driver, OpenGL) and where to report it, skipped with `--control`. Numbers unchanged |
+| 2026-10-15 | minor | Crashes on Windows (#271, #314, #337; #224 and two more): a text field focused before it was drawn aborted the screen-reader layer; double-clicking a page, creating a variable collection and renaming a style folder no longer close the app. Numbers unchanged |
+| 2026-10-15 | minor | Deeply nested layers (#330, #210): one depth guard (256) on the three recursive layout paths, so a deep file can't run the layout out of stack. Numbers unchanged |
+| 2026-10-15 | minor | Image memory budgets (#326; #203, #189): decoded images and a file's images have budgets; the decode cache evicts its least recently used entries. Numbers unchanged |
+| 2026-10-15 | minor | macOS file dialogs (#253, #250) no longer re-enter the event loop; a dialog's result goes to the file and window it was opened for, and dialogs are parented to the main window. Numbers unchanged |
+| 2026-10-15 | minor | Recovery copies (#297, #303, #331, #336; #202, #185, #187): a copy counts only after its write succeeds and a failed one is retried; saves and closes wait for the write in flight; copies keep version history and branches; a recovered copy stays until this run has its own. Numbers unchanged |
+| 2026-10-15 | minor | Text edits (#280, #278) no longer roll back earlier changes; a drag released off the canvas ends at the pointer's last canvas position. Numbers unchanged |
+| 2026-10-15 | minor | Rollback (#282, #301; #196): a failed command rolls back during a drag or other gesture too; a failed batch keeps the redo steps. Numbers unchanged |
+| 2026-10-15 | minor | Atomic save and export (#284): staging files are uniquely named and created exclusively, so a file or link already at the old fixed staging name is never written through, and two writers of one file no longer share one. Numbers unchanged |
+| 2026-10-15 | minor | Alt-drag copies (#283) snap to their original, and Duplicate (Cmd+D) then repeats the last copy's offset. Numbers unchanged |
+| 2026-10-15 | minor | The pen (#277) shows its Bezier handles while a point is dragged out. Numbers unchanged |
+| 2026-10-15 | minor | Corner handles (#293, #292): a press on a corner handle resizes instead of picking the corner-radius handle. Numbers unchanged |
+| 2026-10-15 | minor | New text (#372, #362) takes a readable colour from the frame it is drawn in, not only the page (text drawn in a white frame on a dark page was white). Numbers unchanged |
+| 2026-10-15 | minor | Outline stroke (#386) works on every selected layer. Numbers unchanged |
+| 2026-10-15 | minor | Send to back (#444) counts per parent when the selection spans frames. Numbers unchanged |
+| 2026-10-15 | minor | Align buttons (#276) are off when the selection has nothing to align to. Numbers unchanged |
+| 2026-10-15 | minor | Gradient type icons (#275) show their gradient. Numbers unchanged |
+| 2026-10-15 | minor | Corner resize cursors (#388) stay diagonal at any proportions; the text selection highlight (#390) stays inside the box on the last line. Numbers unchanged |
+| 2026-10-15 | minor | New pages (#311, #295) take the current page's background; the theme still decides a new file's page. Numbers unchanged |
+| 2026-10-15 | minor | A slice's export preview (#265) shows the content under it. Numbers unchanged |
+| 2026-10-15 | minor | SVG export (#327, #325) keeps a nested frame's fill and stroke inside its parent's clip. Numbers unchanged |
+| 2026-10-15 | minor | Home screen (#318, #324): recent files notice files deleted while it is open; a long path no longer draws over the file name. Numbers unchanged |
+| 2026-10-15 | minor | The Small caps sample in Type settings (#355) draws from capitals, no longer a box where the UI font lacks the small-capital letter. Numbers unchanged |
+| 2026-10-15 | minor | Web clipboard (#375): copy and paste in the browser go through the system clipboard, so a paste after a copy brings the copied layers instead of whatever text the clipboard held. Numbers unchanged |
+| 2026-10-15 | minor | Zoom previews (#312): when renders from scratch are slow, a new zoom first shows the whole view coarsely instead of the page colour, then the refined image; images of another file or page never show. Numbers unchanged |
+| 2026-10-15 | minor | Hidden windows (#313, #332; #269): a minimised or covered window answers control and MCP requests (commands, inspection, `ui.render`) at once, each window on its own; screenshots and input still wait for it to be on screen. Numbers unchanged |
+| 2026-10-15 | minor | Server (#340, #302): a compaction cut short closes the file instead of confirming lost edits (#183); each team library version is kept in its own file (#206). Numbers unchanged |
+| 2026-10-15 | minor | Counters (#343, #344, #353; #309): collab sequence numbers, layer name counters and opacity digits can't overflow. Numbers unchanged |
+| 2026-10-15 | minor | Commands refuse bad indexes and ids (#475, #384, #310): `page.select` and `doc.switch`, `effect.set` and `export.update` / `export.remove`, `page.move` with a non-page id. Numbers unchanged |
+| 2026-10-15 | minor | Find and replace (#358, #361) changes every occurrence, case-insensitively, also when the replacement contains the search text. Numbers unchanged |
+| 2026-10-15 | minor | The gradient shorthand (#254, #252) is read by the engine, so the CLI, control channel and MCP share it. Numbers unchanged |
+| 2026-10-15 | minor | .fig import (#279, #281): resized instances lay out their layers by their constraints (#266); explicit variable modes whose collection is named by its asset key, as library collections are, come across (#267). Numbers unchanged |
+| 2026-10-15 | minor | Colour emoji (#300, #268) draw from their own colour tables (sbix and CBDT/EBDT bitmap strikes, COLR v0 layers), a colour face tried first; COLR v1 still draws outlines. Numbers unchanged |
+| 2026-10-15 | minor | macOS (#290, #289): `.figcraft` files open from Finder, Open With and the Dock. Numbers unchanged |
+| 2026-10-15 | minor | Windows (#294, #291): the first preferred language alone picks the UI language. Numbers unchanged |
+| 2026-10-15 | minor | Unix font discovery (#474) follows `XDG_DATA_HOME`. Numbers unchanged |
+| 2026-10-15 | minor | Linux packaging (#346, #328): the window id matches the desktop entry (FreeBSD keeps its class); the RPM requires glibc 2.35. Numbers unchanged |
+| 2026-10-15 | minor | Tests (#472, #471, #339): the rename shortcut test, the hanging punctuation test and the font-scanning tests no longer depend on the platform, font or test order. Numbers unchanged |
+| 2026-10-15 | minor | Languages (#257, #263, #469, #477, #288): Russian (with one/few/many plural forms) and Turkish catalogs, reviewed by native speakers; Czech and Indonesian drafts; the Japanese draft completed. 2,177 entries now (1,587 UI strings, 559 command labels, 31 menu wordings); strings added since a catalog was written read English there. Localization 39% and 29–51 h unchanged at this rounding (Indonesian is now a draft, while the five older drafts lack 88 newer entries) |
| 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 |
@@ -331,6 +392,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md).
| 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. |
| 2026-10-15 | minor | Canvas retains a bounded margin while panning so newly exposed strips can reuse the previous render. Numbers unchanged. |
+| 2026-10-15 | minor | Dev Mode tail (M6, gap 16): import lines for connected components inside generated layer trees (definitions, slots and swapped-in instances too); `dev.compare {version}` and the compare view's Compare with menu compare with any saved version; behaviour suite (5 tests; 4 failed before the fixes): an inspect-only Dev Mode canvas with menus, shortcuts, nudges, opacity keys and paste refusing design edits, toolbar drawing tools returning to the design, Changed in the ready list (`inspect.readyForDev {status: changed}`), statuses only on sections and top-level frames; read-only plugins' panels from the Inspect tab. Dev Mode 96%/72% → 97%/76%, 0–1 h → 2–4 h (measurements kept on the canvas and a read-only layers panel counted as missing); header totals not recomputed |
| 2026-10-15 | minor | Typography spacing icons scrub with the shared number-field gesture, modifier rates and one Undo step per drag (#373). Units and selected-character targeting are preserved. Numbers unchanged. |
| 2026-10-14 | minor | System theme on first run (M7): preferences without a theme default to System; the first frame reads the OS appearance directly, including when returning from a manual theme. Saved Light/Dark choices stay explicit; unavailable OS appearance falls back to Light. Numbers 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. |
diff --git a/apps/figcraft-cli/tests/cli.rs b/apps/figcraft-cli/tests/it/cli.rs
similarity index 99%
rename from apps/figcraft-cli/tests/cli.rs
rename to apps/figcraft-cli/tests/it/cli.rs
index eb42b8d8..4af73d69 100644
--- a/apps/figcraft-cli/tests/cli.rs
+++ b/apps/figcraft-cli/tests/it/cli.rs
@@ -1,5 +1,4 @@
//! The binary end to end.
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
use std::io::Write;
use std::process::{Command, Stdio};
diff --git a/apps/figcraft-cli/tests/export_depth.rs b/apps/figcraft-cli/tests/it/export_depth.rs
similarity index 97%
rename from apps/figcraft-cli/tests/export_depth.rs
rename to apps/figcraft-cli/tests/it/export_depth.rs
index d8b3ef36..37350c1e 100644
--- a/apps/figcraft-cli/tests/export_depth.rs
+++ b/apps/figcraft-cli/tests/it/export_depth.rs
@@ -1,5 +1,4 @@
//! Depth refusal through the actual CLI, including its exit status and destination writes.
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
use figcraft_doc::color::{Color, Paint};
use figcraft_doc::{Document, NodeKind};
diff --git a/apps/figcraft-cli/tests/fonts.rs b/apps/figcraft-cli/tests/it/fonts.rs
similarity index 98%
rename from apps/figcraft-cli/tests/fonts.rs
rename to apps/figcraft-cli/tests/it/fonts.rs
index ef5c638f..a48056bd 100644
--- a/apps/figcraft-cli/tests/fonts.rs
+++ b/apps/figcraft-cli/tests/it/fonts.rs
@@ -1,6 +1,5 @@
//! Headless runs lay text out with the installed fonts, like the desktop app, unless
//! `--no-system-fonts` or `FIGCRAFT_NO_SYSTEM_FONTS=1` opts out.
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
use std::process::Command;
diff --git a/apps/figcraft-cli/tests/it/main.rs b/apps/figcraft-cli/tests/it/main.rs
new file mode 100644
index 00000000..ae4b0488
--- /dev/null
+++ b/apps/figcraft-cli/tests/it/main.rs
@@ -0,0 +1,12 @@
+//! The crate's integration tests, built as one test binary.
+
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod cli;
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod export_depth;
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod fonts;
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod pdf;
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod pdf_print;
diff --git a/apps/figcraft-cli/tests/pdf.rs b/apps/figcraft-cli/tests/it/pdf.rs
similarity index 97%
rename from apps/figcraft-cli/tests/pdf.rs
rename to apps/figcraft-cli/tests/it/pdf.rs
index 28d5ca6c..185d5b60 100644
--- a/apps/figcraft-cli/tests/pdf.rs
+++ b/apps/figcraft-cli/tests/it/pdf.rs
@@ -1,5 +1,4 @@
//! `figcraft-cli export --format pdf` and `convert … .pdf` end to end.
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
use std::process::Command;
diff --git a/apps/figcraft-cli/tests/pdf_print.rs b/apps/figcraft-cli/tests/it/pdf_print.rs
similarity index 97%
rename from apps/figcraft-cli/tests/pdf_print.rs
rename to apps/figcraft-cli/tests/it/pdf_print.rs
index b2ce3c9a..f12725ed 100644
--- a/apps/figcraft-cli/tests/pdf_print.rs
+++ b/apps/figcraft-cli/tests/it/pdf_print.rs
@@ -1,5 +1,4 @@
//! `figcraft-cli export` with PDF print options: bleed, marks, CMYK; bad lengths are usage errors.
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
use std::process::Command;
diff --git a/apps/figcraft-server/src/server_tests.rs b/apps/figcraft-server/src/server_tests.rs
index 153bb5ab..f60150da 100644
--- a/apps/figcraft-server/src/server_tests.rs
+++ b/apps/figcraft-server/src/server_tests.rs
@@ -261,7 +261,9 @@ fn fuzzed_frames_dont_hurt_the_server() {
break;
}
}
- let _ = ws.read();
+ // read() returns Result, not a lock guard; the fuzz loop ends here on purpose and
+ // the close frame from the server is not interesting.
+ let _ = ws.read(); // NOSONAR
}
// Still serving, the file intact.
let mut b = join(&p.edit, "Bo");
diff --git a/apps/figcraft-server/tests/header_recovery.rs b/apps/figcraft-server/tests/it/header_recovery.rs
similarity index 98%
rename from apps/figcraft-server/tests/header_recovery.rs
rename to apps/figcraft-server/tests/it/header_recovery.rs
index d728908d..bb0be1d0 100644
--- a/apps/figcraft-server/tests/header_recovery.rs
+++ b/apps/figcraft-server/tests/it/header_recovery.rs
@@ -2,7 +2,6 @@
//! 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};
diff --git a/apps/figcraft-server/tests/it/main.rs b/apps/figcraft-server/tests/it/main.rs
new file mode 100644
index 00000000..3027ed99
--- /dev/null
+++ b/apps/figcraft-server/tests/it/main.rs
@@ -0,0 +1,5 @@
+//! The crate's integration tests, built as one test binary.
+
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod header_recovery;
+mod problem_retention;
diff --git a/apps/figcraft-server/tests/problem_retention.rs b/apps/figcraft-server/tests/it/problem_retention.rs
similarity index 100%
rename from apps/figcraft-server/tests/problem_retention.rs
rename to apps/figcraft-server/tests/it/problem_retention.rs
diff --git a/crates/collab-net/src/code_tests.rs b/crates/collab-net/src/code_tests.rs
index 4880242f..7fe766ec 100644
--- a/crates/collab-net/src/code_tests.rs
+++ b/crates/collab-net/src/code_tests.rs
@@ -141,7 +141,9 @@ fn old_server() -> (Endpoint, std::thread::JoinHandle<()>) {
let t = std::thread::spawn(move || {
for stream in listener.incoming().take(2).flatten() {
let Ok(mut ws) = tungstenite::accept(stream) else { continue };
- let _ = ws.read();
+ // read() returns Result, not a lock guard; this test server deliberately
+ // ignores whatever the client sent first.
+ let _ = ws.read(); // NOSONAR
let refused = ServerMsg::Refused { reason: "that message couldn't be read".into() };
let _ = ws.send(Message::Binary(Bytes::from(message::encode(&refused).unwrap())));
let _ = ws.close(None);
diff --git a/crates/collab/Cargo.toml b/crates/collab/Cargo.toml
index 89a79687..ed85201d 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/board_sync_tests.rs b/crates/collab/src/board_sync_tests.rs
new file mode 100644
index 00000000..3dbff8bb
--- /dev/null
+++ b/crates/collab/src/board_sync_tests.rs
@@ -0,0 +1,45 @@
+//! Boards sync: the file kind reaches joiners in their snapshot, and a layer's board metadata (a
+//! connector's ends, a sticky's author) syncs as one property, through both encodings.
+
+use figcraft_doc::{BoardItem, Connector, Document, End, FileKind, NodeKind, Routing, Side};
+
+use crate::change::{Change, DocProp, Prop};
+use crate::replica::{Mode, Replica};
+use crate::{diff, message};
+
+#[test]
+fn a_boards_kind_and_its_objects_metadata_sync() {
+ let mut doc = Document::new("Board");
+ doc.kind = FileKind::Board;
+ let page = doc.first_page().unwrap();
+ let a = doc.create(page, NodeKind::Frame, "Sticky", 0.0, 0.0, 200.0, 200.0).unwrap();
+ doc.node_mut(a).unwrap().board = Some(BoardItem::Sticky { author: "Ada".into() });
+ let host = Replica::new(doc);
+ // A joiner's copy, built from the snapshot, is a board with the sticky's metadata.
+ let snap = host.snapshot().unwrap();
+ assert!(snap.iter().any(|c| matches!(c, Change::SetDoc { prop: DocProp::Kind, .. })));
+ let joiner = Replica::from_snapshot(&snap).unwrap();
+ assert_eq!(joiner.document().kind, FileKind::Board);
+ assert_eq!(joiner.document().node(a).unwrap().board, host.document().node(a).unwrap().board);
+ // Re-attaching a connector's end is one property write, the same after the wire.
+ let mut edited = host.document().clone();
+ let c = edited.create(page, NodeKind::Vector { network: Default::default() }, "Connector", 0.0, 0.0, 1.0, 1.0).unwrap();
+ edited.node_mut(c).unwrap().board = Some(BoardItem::Connector(Connector {
+ from: End::Node { node: a, side: Side::Auto },
+ to: End::Point { x: 5.0, y: 5.0 },
+ routing: Routing::Elbow,
+ }));
+ let mut r = host.clone();
+ r.apply(&diff(&host, &edited).unwrap().changes, Mode::Strict).unwrap();
+ let mut moved = r.document().clone();
+ moved.node_mut(c).unwrap().board = Some(BoardItem::Connector(Connector {
+ from: End::Node { node: a, side: Side::Top },
+ to: End::Point { x: 9.0, y: 1.0 },
+ routing: Routing::Straight,
+ }));
+ let d = diff(&r, &moved).unwrap();
+ assert!(matches!(d.changes.as_slice(), [Change::Set { prop: Prop::Board, .. }]), "{:?}", d.changes);
+ let wire: Vec = message::decode(&message::encode(&d.changes).unwrap(), usize::MAX).unwrap();
+ r.apply(&wire, Mode::Strict).unwrap();
+ assert_eq!(r.document(), &moved);
+}
diff --git a/crates/collab/src/change.rs b/crates/collab/src/change.rs
index 0608ba67..57bb9cf2 100644
--- a/crates/collab/src/change.rs
+++ b/crates/collab/src/change.rs
@@ -181,6 +181,7 @@ node_props! {
Annotations => annotations,
CodeLinks => code_links,
DevResources => dev_resources,
+ Board => board,
}
/// A document-level property. Lists of entries with ids (styles, comments, variable collections,
@@ -219,6 +220,8 @@ pub enum DocProp {
Variables,
/// Variable ids in order.
VariableOrder,
+ /// A design file or a board.
+ Kind,
}
/// A document-level entry, by id.
diff --git a/crates/collab/src/docprops.rs b/crates/collab/src/docprops.rs
index 535c333e..9b35e05d 100644
--- a/crates/collab/src/docprops.rs
+++ b/crates/collab/src/docprops.rs
@@ -213,6 +213,7 @@ doc_scalars! {
ImagePresets => image_presets,
AnnotationCategories => annotation_categories,
Libraries => libraries,
+ Kind => kind,
}
/// Keyed maps (no order): changed and added entries are put, missing ones removed.
diff --git a/crates/collab/src/lib.rs b/crates/collab/src/lib.rs
index 2c693bc4..fa271f35 100644
--- a/crates/collab/src/lib.rs
+++ b/crates/collab/src/lib.rs
@@ -123,6 +123,8 @@ impl Recompute for NoRecompute {
fn recompute(&self, _: &mut Document, _: &Document, _: &BTreeSet) {}
}
+#[cfg(test)]
+mod board_sync_tests;
#[cfg(test)]
mod client_tests;
#[cfg(test)]
diff --git a/crates/collab/src/message.rs b/crates/collab/src/message.rs
index d035042b..4fda776a 100644
--- a/crates/collab/src/message.rs
+++ b/crates/collab/src/message.rs
@@ -696,22 +696,38 @@ pub enum ServerMsg {
},
}
+/// (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 (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).
+/// 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 {
- 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")
+ // 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.
@@ -752,3 +768,25 @@ 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");
+ // 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 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/doc/src/board.rs b/crates/doc/src/board.rs
new file mode 100644
index 00000000..28ed0c1d
--- /dev/null
+++ b/crates/doc/src/board.rs
@@ -0,0 +1,433 @@
+//! Boards: a file kind for whiteboarding, and the small piece of metadata board objects carry.
+//!
+//! Board objects are ordinary nodes (frames, vectors, text) with a [`BoardItem`] on them, so
+//! rendering, hit testing, undo, saving, export, copy and paste and live sessions treat them like
+//! any other layer. The metadata says what the object is for: which text a sticky note fits, what
+//! a connector joins, who placed a stamp.
+
+use figcraft_color::Color;
+use figcraft_geom::kurbo::{Ellipse, RoundedRect};
+use figcraft_geom::{BezPath, Point, Rect, Shape};
+use serde::{Deserialize, Serialize};
+
+use crate::NodeId;
+
+/// What a file is for: designing screens, or a board to think together on.
+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub enum FileKind {
+ #[default]
+ Design,
+ Board,
+}
+
+impl FileKind {
+ pub fn is_design(&self) -> bool {
+ *self == FileKind::Design
+ }
+ pub fn id(self) -> &'static str {
+ match self {
+ FileKind::Design => "design",
+ FileKind::Board => "board",
+ }
+ }
+}
+
+/// What a board object is.
+#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
+#[serde(tag = "type", rename_all = "camelCase")]
+pub enum BoardItem {
+ /// A sticky note: a frame whose first text layer is the note (its size shrinks as the note
+ /// grows) and, below it, who wrote it.
+ Sticky {
+ #[serde(default, skip_serializing_if = "String::is_empty")]
+ author: String,
+ },
+ /// A shape with text: a frame holding the outline (a vector) and a centred text.
+ Shape { shape: BoardShape },
+ /// A line between two objects or points (a vector, re-routed when they move).
+ Connector(Connector),
+ /// The label in the middle of connector `connector` (a frame holding its text).
+ Label { connector: NodeId },
+ /// A stamp, and who placed it.
+ Stamp {
+ stamp: Stamp,
+ #[serde(default, skip_serializing_if = "String::is_empty")]
+ author: String,
+ },
+ /// A marker or highlighter stroke (what the eraser takes).
+ Ink,
+}
+
+impl BoardItem {
+ /// Objects selected and moved as a whole: a click on their text or outline picks them, and
+ /// they never take other layers in.
+ pub fn is_atom(&self) -> bool {
+ matches!(self, BoardItem::Sticky { .. } | BoardItem::Shape { .. } | BoardItem::Label { .. } | BoardItem::Stamp { .. })
+ }
+
+ /// Objects whose first text layer is their text (a double-click or Enter edits it).
+ pub fn has_text(&self) -> bool {
+ matches!(self, BoardItem::Sticky { .. } | BoardItem::Shape { .. } | BoardItem::Label { .. })
+ }
+
+ /// Who made it (stickies and stamps; empty when unknown).
+ pub fn author(&self) -> &str {
+ match self {
+ BoardItem::Sticky { author } | BoardItem::Stamp { author, .. } => author,
+ _ => "",
+ }
+ }
+
+ /// Point the layers this object refers to (a connector's ends, a label's connector) at their
+ /// copies in `map`; the others stay.
+ pub fn remap(&mut self, map: &std::collections::BTreeMap) {
+ match self {
+ BoardItem::Connector(c) => {
+ for end in [&mut c.from, &mut c.to] {
+ if let End::Node { node, .. } = end
+ && let Some(m) = map.get(node)
+ {
+ *node = *m;
+ }
+ }
+ }
+ BoardItem::Label { connector } => {
+ if let Some(m) = map.get(connector) {
+ *connector = *m;
+ }
+ }
+ _ => {}
+ }
+ }
+
+ pub fn kind_id(&self) -> &'static str {
+ match self {
+ BoardItem::Sticky { .. } => "sticky",
+ BoardItem::Shape { .. } => "shape",
+ BoardItem::Connector(_) => "connector",
+ BoardItem::Label { .. } => "label",
+ BoardItem::Stamp { .. } => "stamp",
+ BoardItem::Ink => "ink",
+ }
+ }
+}
+
+/// The colours stickies, shapes and connectors come in: soft tints that dark text reads on.
+pub const BOARD_COLORS: [(&str, Color); 8] = [
+ ("yellow", Color::from_rgb8_const(0xFF, 0xE7, 0x8A)),
+ ("orange", Color::from_rgb8_const(0xFF, 0xC9, 0x94)),
+ ("red", Color::from_rgb8_const(0xFF, 0xAE, 0xA6)),
+ ("pink", Color::from_rgb8_const(0xF7, 0xB9, 0xDA)),
+ ("violet", Color::from_rgb8_const(0xD4, 0xC2, 0xFC)),
+ ("blue", Color::from_rgb8_const(0xAC, 0xD3, 0xFA)),
+ ("green", Color::from_rgb8_const(0xC2, 0xE8, 0xA6)),
+ ("gray", Color::from_rgb8_const(0xE3, 0xE1, 0xDD)),
+];
+
+/// A board colour by name ("yellow") or as hex ("#FFE78A").
+pub fn board_color(s: &str) -> Option {
+ let s = s.trim();
+ BOARD_COLORS.iter().find(|(n, _)| n.eq_ignore_ascii_case(s)).map(|(_, c)| *c).or_else(|| Color::from_hex(s))
+}
+
+/// The page colour boards start with: a warm light grey the colours stand out on.
+pub const BOARD_PAGE: Color = Color::from_rgb8_const(0xF4, 0xF3, 0xF0);
+
+/// The outlines shapes with text come in.
+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub enum BoardShape {
+ #[default]
+ Rectangle,
+ RoundedRectangle,
+ Ellipse,
+ Diamond,
+ Triangle,
+ SpeechBubble,
+ Chevron,
+}
+
+impl BoardShape {
+ pub const ALL: [BoardShape; 7] = [
+ BoardShape::Rectangle,
+ BoardShape::RoundedRectangle,
+ BoardShape::Ellipse,
+ BoardShape::Diamond,
+ BoardShape::Triangle,
+ BoardShape::SpeechBubble,
+ BoardShape::Chevron,
+ ];
+
+ pub fn id(self) -> &'static str {
+ match self {
+ BoardShape::Rectangle => "rectangle",
+ BoardShape::RoundedRectangle => "roundedRectangle",
+ BoardShape::Ellipse => "ellipse",
+ BoardShape::Diamond => "diamond",
+ BoardShape::Triangle => "triangle",
+ BoardShape::SpeechBubble => "speechBubble",
+ BoardShape::Chevron => "chevron",
+ }
+ }
+
+ pub fn from_id(s: &str) -> Option {
+ BoardShape::ALL.into_iter().find(|b| b.id().eq_ignore_ascii_case(s))
+ }
+
+ pub fn label(self) -> &'static str {
+ match self {
+ BoardShape::Rectangle => "Rectangle",
+ BoardShape::RoundedRectangle => "Rounded rectangle",
+ BoardShape::Ellipse => "Ellipse",
+ BoardShape::Diamond => "Diamond",
+ BoardShape::Triangle => "Triangle",
+ BoardShape::SpeechBubble => "Speech bubble",
+ BoardShape::Chevron => "Chevron",
+ }
+ }
+
+ /// The outline in a `w` × `h` box at the origin.
+ pub fn path(self, w: f64, h: f64) -> BezPath {
+ let poly = |pts: &[(f64, f64)]| {
+ let mut p = BezPath::new();
+ for (i, (x, y)) in pts.iter().enumerate() {
+ let q = Point::new(x * w, y * h);
+ if i == 0 { p.move_to(q) } else { p.line_to(q) }
+ }
+ p.close_path();
+ p
+ };
+ let r = w.min(h);
+ match self {
+ BoardShape::Rectangle => Rect::new(0.0, 0.0, w, h).to_path(0.1),
+ BoardShape::RoundedRectangle => RoundedRect::new(0.0, 0.0, w, h, r * 0.16).to_path(0.1),
+ BoardShape::Ellipse => Ellipse::from_rect(Rect::new(0.0, 0.0, w, h)).to_path(0.1),
+ BoardShape::Diamond => poly(&[(0.5, 0.0), (1.0, 0.5), (0.5, 1.0), (0.0, 0.5)]),
+ BoardShape::Triangle => poly(&[(0.5, 0.0), (1.0, 1.0), (0.0, 1.0)]),
+ BoardShape::Chevron => poly(&[(0.0, 0.0), (0.72, 0.0), (1.0, 0.5), (0.72, 1.0), (0.0, 1.0), (0.28, 0.5)]),
+ BoardShape::SpeechBubble => {
+ // A rounded body over the bottom fifth, with a tail down to the left.
+ let (b, c) = (h * 0.8, r * 0.14);
+ let mut p = BezPath::new();
+ p.move_to((c, 0.0));
+ p.line_to((w - c, 0.0));
+ p.quad_to((w, 0.0), (w, c));
+ p.line_to((w, b - c));
+ p.quad_to((w, b), (w - c, b));
+ p.line_to((w * 0.42, b));
+ p.line_to((w * 0.18, h));
+ p.line_to((w * 0.24, b));
+ p.line_to((c, b));
+ p.quad_to((0.0, b), (0.0, b - c));
+ p.line_to((0.0, c));
+ p.quad_to((0.0, 0.0), (c, 0.0));
+ p.close_path();
+ p
+ }
+ }
+ }
+
+ /// Where the text goes, as insets of the box (top, right, bottom, left, in fractions of its
+ /// size): inside the outline's widest part.
+ pub fn text_insets(self) -> [f64; 4] {
+ match self {
+ BoardShape::Rectangle | BoardShape::RoundedRectangle => [0.08, 0.08, 0.08, 0.08],
+ BoardShape::Ellipse => [0.16, 0.16, 0.16, 0.16],
+ BoardShape::Diamond => [0.25, 0.25, 0.25, 0.25],
+ BoardShape::Triangle => [0.45, 0.22, 0.06, 0.22],
+ BoardShape::SpeechBubble => [0.08, 0.08, 0.28, 0.08],
+ BoardShape::Chevron => [0.12, 0.3, 0.12, 0.3],
+ }
+ }
+}
+
+/// The stamps: round badges with a mark.
+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub enum Stamp {
+ #[default]
+ ThumbsUp,
+ Heart,
+ PlusOne,
+ Star,
+ Question,
+ Check,
+}
+
+/// One part of a stamp's mark: SVG path data on the badge's 40-unit box, filled or stroked.
+pub struct MarkPart {
+ pub d: &'static str,
+ pub filled: bool,
+}
+
+/// A stamp badge's size.
+pub const STAMP_SIZE: f64 = 40.0;
+
+impl Stamp {
+ pub const ALL: [Stamp; 6] = [Stamp::ThumbsUp, Stamp::Heart, Stamp::PlusOne, Stamp::Star, Stamp::Question, Stamp::Check];
+
+ pub fn id(self) -> &'static str {
+ match self {
+ Stamp::ThumbsUp => "thumbsUp",
+ Stamp::Heart => "heart",
+ Stamp::PlusOne => "plusOne",
+ Stamp::Star => "star",
+ Stamp::Question => "question",
+ Stamp::Check => "check",
+ }
+ }
+
+ pub fn from_id(s: &str) -> Option {
+ Stamp::ALL.into_iter().find(|b| b.id().eq_ignore_ascii_case(s))
+ }
+
+ pub fn label(self) -> &'static str {
+ match self {
+ Stamp::ThumbsUp => "Thumbs up",
+ Stamp::Heart => "Heart",
+ Stamp::PlusOne => "Plus one",
+ Stamp::Star => "Star",
+ Stamp::Question => "Question",
+ Stamp::Check => "Check",
+ }
+ }
+
+ /// The badge's colour (the mark is white on it).
+ pub fn color(self) -> Color {
+ match self {
+ Stamp::ThumbsUp => Color::from_rgb8_const(0x3B, 0x82, 0xE8),
+ Stamp::Heart => Color::from_rgb8_const(0xE5, 0x48, 0x5F),
+ Stamp::PlusOne => Color::from_rgb8_const(0x2E, 0xA0, 0x63),
+ Stamp::Star => Color::from_rgb8_const(0xEE, 0x9B, 0x1A),
+ Stamp::Question => Color::from_rgb8_const(0x84, 0x5E, 0xD8),
+ Stamp::Check => Color::from_rgb8_const(0x14, 0x96, 0x8C),
+ }
+ }
+
+ /// The mark, drawn for FigCraft from lines, arcs and simple outlines.
+ pub fn mark(self) -> &'static [MarkPart] {
+ match self {
+ // A cuff and a raised hand with its thumb up.
+ Stamp::ThumbsUp => &[
+ MarkPart { d: "M10.5 19 H15 V29 H10.5 Z", filled: true },
+ MarkPart {
+ d: "M16.5 19 L20.6 11.4 C21.6 9.8 24.6 10.6 24.2 13 L23.4 17 H28.2 C29.8 17 30.9 18.5 30.4 20 L28.4 27.3 C28 28.4 27.1 29 25.9 29 H16.5 Z",
+ filled: true,
+ },
+ ],
+ // Two round lobes meeting in a point.
+ Stamp::Heart => &[MarkPart {
+ d: "M20 29.5 C12.5 24.5 9.5 20.6 10.4 16.4 C11.3 12.2 16.8 11.2 20 15.4 C23.2 11.2 28.7 12.2 29.6 16.4 C30.5 20.6 27.5 24.5 20 29.5 Z",
+ filled: true,
+ }],
+ Stamp::PlusOne => &[MarkPart { d: "M10 20 H20 M15 15 V25", filled: false }, MarkPart { d: "M24.5 15 L27.5 12.5 V27.5", filled: false }],
+ Stamp::Star => &[MarkPart {
+ d: "M20 10.5 L22.8 16.7 L29.5 17.4 L24.5 21.9 L25.9 28.6 L20 25.2 L14.1 28.6 L15.5 21.9 L10.5 17.4 L17.2 16.7 Z",
+ filled: true,
+ }],
+ Stamp::Question => &[
+ MarkPart { d: "M15.6 16.2 C15.6 10.6 24.4 10.6 24.4 16 C24.4 19.6 20 19.9 20 23.6", filled: false },
+ MarkPart { d: "M18.2 28 A1.8 1.8 0 1 0 21.8 28 A1.8 1.8 0 1 0 18.2 28 Z", filled: true },
+ ],
+ Stamp::Check => &[MarkPart { d: "M12.5 20.5 L18 26 L28 14.5", filled: false }],
+ }
+ }
+}
+
+/// How a connector runs between its ends.
+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub enum Routing {
+ #[default]
+ Straight,
+ /// Right angles only: out of each end along its side's normal, turning once or twice.
+ Elbow,
+}
+
+impl Routing {
+ pub fn id(self) -> &'static str {
+ match self {
+ Routing::Straight => "straight",
+ Routing::Elbow => "elbow",
+ }
+ }
+ pub fn from_id(s: &str) -> Option {
+ [Routing::Straight, Routing::Elbow].into_iter().find(|r| r.id().eq_ignore_ascii_case(s))
+ }
+}
+
+/// The side of an object a connector end is attached to (at its middle).
+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub enum Side {
+ /// The side facing the other end.
+ #[default]
+ Auto,
+ Top,
+ Right,
+ Bottom,
+ Left,
+}
+
+impl Side {
+ pub fn from_id(s: &str) -> Option {
+ Some(match s.to_ascii_lowercase().as_str() {
+ "auto" => Side::Auto,
+ "top" => Side::Top,
+ "right" => Side::Right,
+ "bottom" => Side::Bottom,
+ "left" => Side::Left,
+ _ => return None,
+ })
+ }
+
+ /// The side's middle on `b`.
+ pub fn point(self, b: Rect) -> Point {
+ let c = b.center();
+ match self {
+ Side::Top => Point::new(c.x, b.y0),
+ Side::Right => Point::new(b.x1, c.y),
+ Side::Bottom => Point::new(c.x, b.y1),
+ Side::Left => Point::new(b.x0, c.y),
+ Side::Auto => c,
+ }
+ }
+
+ pub fn horizontal(self) -> bool {
+ matches!(self, Side::Left | Side::Right)
+ }
+}
+
+/// One end of a connector: attached to a layer, or a free point on the page.
+#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum End {
+ Node {
+ node: NodeId,
+ #[serde(default)]
+ side: Side,
+ },
+ Point {
+ x: f64,
+ y: f64,
+ },
+}
+
+impl End {
+ pub fn node(&self) -> Option {
+ match self {
+ End::Node { node, .. } => Some(*node),
+ End::Point { .. } => None,
+ }
+ }
+}
+
+/// What a connector joins and how it runs (its arrowheads are its stroke's caps).
+#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
+pub struct Connector {
+ pub from: End,
+ pub to: End,
+ #[serde(default)]
+ pub routing: Routing,
+}
diff --git a/crates/doc/src/geometry.rs b/crates/doc/src/geometry.rs
index 2a7b42a6..d0ed4f2b 100644
--- a/crates/doc/src/geometry.rs
+++ b/crates/doc/src/geometry.rs
@@ -255,6 +255,18 @@ pub fn select_target(doc: &Document, leaf: NodeId, context: &[NodeId], deep: boo
if deep {
return leaf;
}
+ let target = level_target(doc, leaf, context);
+ // A board object is picked whole (a sticky, not its text), unless a layer inside it is selected.
+ let mut chain = doc.ancestors(target);
+ chain.reverse();
+ chain.push(target);
+ chain
+ .into_iter()
+ .find(|c| doc.node(*c).is_some_and(Node::is_board_atom) && !context.iter().any(|s| s != c && doc.is_ancestor(*c, *s)))
+ .unwrap_or(target)
+}
+
+fn level_target(doc: &Document, leaf: NodeId, context: &[NodeId]) -> NodeId {
// Chain from the page's child down to the leaf.
let mut chain: Vec = doc.ancestors(leaf);
chain.reverse();
diff --git a/crates/doc/src/lib.rs b/crates/doc/src/lib.rs
index d131b2f0..3097181c 100644
--- a/crates/doc/src/lib.rs
+++ b/crates/doc/src/lib.rs
@@ -8,6 +8,7 @@
//! live in higher crates.
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
+pub mod board;
pub mod colors;
pub mod comments;
pub mod geometry;
@@ -23,6 +24,7 @@ pub mod vector;
pub mod vector_faces;
pub mod vector_regions;
+pub use board::*;
pub use colors::*;
pub use comments::*;
pub use figcraft_color as color;
@@ -157,6 +159,9 @@ pub struct ImageData {
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Document {
pub name: String,
+ /// A design file or a board (files from before boards are design files).
+ #[serde(default, skip_serializing_if = "FileKind::is_design")]
+ pub kind: FileKind,
/// Page ids in order.
pub pages: Vec,
nodes: imbl::OrdMap>,
@@ -221,6 +226,7 @@ impl Document {
pub fn without_pages(name: impl Into) -> Self {
Self {
name: name.into(),
+ kind: FileKind::Design,
pages: Vec::new(),
nodes: imbl::OrdMap::new(),
dirty: Dirty::default(),
@@ -835,6 +841,10 @@ impl Document {
{
*component = *m;
}
+ // A connector (or label) copied with what it joins joins the copies.
+ if let Some(b) = c.board.as_mut() {
+ b.remap(map);
+ }
// A pattern tiling a layer of the copy tiles the copy's layer.
for p in c.fills.iter_mut().chain(c.strokes.iter_mut()) {
if let figcraft_color::PaintKind::Pattern(pt) = &mut p.kind
diff --git a/crates/doc/src/node.rs b/crates/doc/src/node.rs
index 00f7d559..649d5e56 100644
--- a/crates/doc/src/node.rs
+++ b/crates/doc/src/node.rs
@@ -518,6 +518,9 @@ pub struct Node {
/// Dev resources: links for developers (docs, code, tickets…), in the order they were added.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub dev_resources: Vec,
+ /// On a board: what this object is (a sticky note, a connector, a stamp…).
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub board: Option,
}
pub(crate) fn yes() -> bool {
@@ -628,6 +631,7 @@ impl Node {
annotations: Vec::new(),
code_links: Vec::new(),
dev_resources: Vec::new(),
+ board: None,
}
}
@@ -653,6 +657,11 @@ impl Node {
matches!(self.kind, NodeKind::Page { .. })
}
+ /// A board object selected and moved as a whole (a sticky, a shape with text, a stamp…).
+ pub fn is_board_atom(&self) -> bool {
+ self.board.as_ref().is_some_and(crate::BoardItem::is_atom)
+ }
+
/// A section whose contents are hidden: only its name and outline show; its children are
/// skipped when rendering and hit testing.
pub fn hides_contents(&self) -> bool {
diff --git a/crates/engine/src/annotations_tests.rs b/crates/engine/src/annotations_tests.rs
index 7fc7376f..00065049 100644
--- a/crates/engine/src/annotations_tests.rs
+++ b/crates/engine/src/annotations_tests.rs
@@ -171,7 +171,7 @@ fn ready_for_dev_lists_frames_by_status() {
};
let ready = ex(&mut s, "inspect.readyForDev", json!({}));
assert_eq!(names(&ready), vec!["Login", "Onboarding", "Profile"], "every page, page and layer order");
- assert_eq!(ready["items"][0], json!({"id": a.0, "name": "Login", "page": page.0, "status": "readyForDev"}));
+ assert_eq!(ready["items"][0], json!({"id": a.0, "name": "Login", "page": page.0, "status": "readyForDev", "changed": false}));
assert_eq!(names(&ex(&mut s, "inspect.readyForDev", json!({"status": "completed"}))), vec!["Signup"]);
assert_eq!(names(&ex(&mut s, "inspect.readyForDev", json!({"status": "any", "page": page}))), vec!["Login", "Signup", "Onboarding"]);
assert!(s.execute("inspect.readyForDev", &json!({"status": "none"})).is_err());
diff --git a/crates/engine/src/board.rs b/crates/engine/src/board.rs
new file mode 100644
index 00000000..317b0889
--- /dev/null
+++ b/crates/engine/src/board.rs
@@ -0,0 +1,1307 @@
+//! Boards: files for thinking together, with sticky notes, shapes with text, connectors, ink and
+//! stamps. Board objects are ordinary layers with a [`BoardItem`] on them; [`settle_text`] and
+//! [`settle_routes`] keep what follows from it (a sticky's text size, a shape's text room,
+//! connectors' routes and their labels) up to date in the normalize pass, so local edits, undo and
+//! live-session edits from others all end in the same geometry.
+
+use std::collections::{BTreeMap, BTreeSet};
+
+use figcraft_color::{BlendMode, Color, Paint};
+use figcraft_doc::{
+ AutoLayout, BOARD_COLORS, BoardItem, BoardShape, Connector, Constraints, CrossAlign, DocError, Document, Effect, EffectKind, End, FileKind,
+ HConstraint, LayoutMode, MainAlign, Node, NodeId, NodeKind, Routing, STAMP_SIZE, Shadow, Side, Sizing, Stamp, StrokeAlign, StrokeCap, StrokeJoin,
+ TextAlignH, TextAutoResize, TextData, VConstraint, VectorNetwork, board_color,
+};
+use figcraft_geom::{Affine, Point, Rect};
+use serde_json::{Value, json};
+
+use crate::cmd::CommandSpec;
+use crate::params::{boolean, color_of, get, id, id_of, num, num_or, opt_id, req_num, req_string, req_targets, string};
+use crate::tools::{Gesture, PointerEvent, ToolId};
+use crate::{EngineError, Result, Session, bad, spec, textedit};
+
+/// Why a board command refuses on a design file.
+pub const NEEDS_BOARD: &str = "this is for boards: make one with File ▸ New board";
+/// Why prototyping and Dev Mode refuse on a board.
+pub const NOT_ON_BOARDS: &str = "boards have no prototypes or Dev Mode: use a design file for those";
+
+/// A sticky note's side (it grows taller for long notes).
+pub const STICKY: f64 = 200.0;
+const STICKY_PAD: f64 = 16.0;
+/// The room between a sticky and the next one made beside it.
+const STICKY_GAP: f64 = 24.0;
+/// A new shape's size.
+const SHAPE: f64 = 160.0;
+/// Text on board objects, and the author line under a sticky's note.
+const INK: Color = Color::from_rgb8_const(0x1E, 0x1E, 0x1E);
+const AUTHOR_INK: Color = Color::from_rgb8_const(0x5C, 0x5A, 0x55);
+/// Connectors' default colour and weight.
+const LINE: Color = Color::from_rgb8_const(0x3A, 0x39, 0x36);
+const LINE_WEIGHT: f64 = 2.0;
+/// Marker and highlighter strokes: (weight, opacity).
+const MARKER: (f64, f32) = (4.0, 1.0);
+const HIGHLIGHTER: (f64, f32) = (20.0, 0.45);
+/// How far the eraser reaches around the pointer (screen pixels).
+const ERASER_PX: f64 = 8.0;
+/// The text sizes the contextual bar offers.
+pub const TEXT_SIZES: [(&str, f64); 4] = [("S", 12.0), ("M", 16.0), ("L", 24.0), ("XL", 36.0)];
+
+/// The board tools' choices: the colour new stickies get, the shape and stamp the tools place,
+/// how new connectors run and the marker's and highlighter's colours.
+#[derive(Clone, Debug)]
+pub struct BoardTool {
+ pub sticky: Color,
+ pub shape: BoardShape,
+ pub stamp: Stamp,
+ pub routing: Routing,
+ pub marker: Color,
+ pub highlighter: Color,
+}
+
+impl Default for BoardTool {
+ fn default() -> Self {
+ let first = BOARD_COLORS.first().map_or(Color::WHITE, |c| c.1);
+ Self {
+ sticky: first,
+ shape: BoardShape::Rectangle,
+ stamp: Stamp::ThumbsUp,
+ routing: Routing::Elbow,
+ marker: INK,
+ highlighter: Color::from_rgb8_const(0xFF, 0xD2, 0x1F),
+ }
+ }
+}
+
+pub fn specs() -> Vec {
+ vec![
+ spec!(
+ "board.sticky",
+ "Sticky note",
+ "{x, y (its top-left, in the parent), text?, color? (yellow|orange|red|pink|violet|blue|green|gray or hex; default the sticky tool's), author? (a name, or false for none; default yours), parent?} → {id, text}",
+ true,
+ sticky_cmd
+ ),
+ spec!(
+ "board.nextSticky",
+ "Next sticky note",
+ "{id? (a sticky; default the selected or edited one), side?: right|below|left|above (default right), edit? (start typing in it; default false)} → {id, text} a sticky of the same colour beside it",
+ true,
+ next_sticky
+ ),
+ spec!(
+ "board.shape",
+ "Shape with text",
+ "{shape: rectangle|roundedRectangle|ellipse|diamond|triangle|speechBubble|chevron, x, y, width?, height? (default 160), text?, color?, parent?} → {id, text}",
+ true,
+ shape_cmd
+ ),
+ spec!(
+ "board.connector",
+ "Connector",
+ "{from, to (each a layer id or {x, y} on the page), fromSide?, toSide? (auto|top|right|bottom|left), style?: straight|elbow, startCap?, endCap? (none|lineArrow|triangleArrow|circleFilled|diamondFilled…; default an arrow at the end), label?} → {id, label?} a line that follows the layers it joins",
+ true,
+ connector_cmd
+ ),
+ spec!("board.label", "Connector label", "{id (a connector; default the selection), text (empty removes it)} → {id, label}", true, label_cmd),
+ spec!(
+ "board.stamp",
+ "Stamp",
+ "{x, y (its centre on the page), stamp: thumbsUp|heart|plusOne|star|question|check} → {id} a badge with your name on hover",
+ true,
+ stamp_cmd
+ ),
+ spec!(
+ "board.ink",
+ "Marker stroke",
+ "{path (SVG path data on the page) | points [[x,y],..], highlighter? (wide and see-through), color?, select? (default true)} → {id}",
+ true,
+ ink_cmd
+ ),
+ spec!(
+ "board.setColor",
+ "Board color",
+ "{ids?, color (a board colour name or hex)} stickies and shapes take it as their fill, connectors and ink as their line",
+ true,
+ set_color
+ ),
+ spec!(
+ "board.setStyle",
+ "Board style",
+ "{ids?, shape? (shapes with text), fontSize? (their text), style?: straight|elbow, startCap?, endCap? (connectors)}",
+ true,
+ set_style
+ ),
+ spec!("tool.sticky", "Sticky note", "{color?} (a click places a sticky and starts typing in it)", false, |s, p| {
+ if let Some(c) = color_param("tool.sticky", p)? {
+ s.tool.board.sticky = c;
+ }
+ board_tool(s, ToolId::Sticky)
+ }),
+ spec!("tool.shape", "Shapes", "{shape?} (a click places a shape with text)", false, |s, p| {
+ if let Some(v) = string(p, "shape") {
+ s.tool.board.shape = shape_of("tool.shape", &v)?;
+ }
+ board_tool(s, ToolId::BoardShape)
+ }),
+ spec!("tool.connector", "Connector", "{style?: straight|elbow} (drag from one object to another)", false, |s, p| {
+ if let Some(v) = string(p, "style") {
+ s.tool.board.routing = routing_of("tool.connector", &v)?;
+ }
+ board_tool(s, ToolId::Connector)
+ }),
+ spec!("tool.marker", "Marker", "{color?}", false, |s, p| {
+ if let Some(c) = color_param("tool.marker", p)? {
+ s.tool.board.marker = c;
+ }
+ board_tool(s, ToolId::Marker)
+ }),
+ spec!("tool.highlighter", "Highlighter", "{color?}", false, |s, p| {
+ if let Some(c) = color_param("tool.highlighter", p)? {
+ s.tool.board.highlighter = c;
+ }
+ board_tool(s, ToolId::Highlighter)
+ }),
+ spec!("tool.eraser", "Eraser", "{} (drag over marker and highlighter strokes to remove them)", false, |s, _| board_tool(s, ToolId::Eraser)),
+ spec!("tool.stamp", "Stamp", "{stamp?} (a click places the stamp)", false, |s, p| {
+ if let Some(v) = string(p, "stamp") {
+ s.tool.board.stamp = stamp_of("tool.stamp", &v)?;
+ }
+ board_tool(s, ToolId::Stamp)
+ }),
+ ]
+}
+
+pub fn is_board(doc: &Document) -> bool {
+ doc.kind == FileKind::Board
+}
+
+/// Refuse `cmd` unless the active file is a board.
+pub(crate) fn require(s: &Session, cmd: &str) -> Result<()> {
+ if s.doc().is_ok_and(is_board) { Ok(()) } else { Err(EngineError::Disabled(cmd.into(), NEEDS_BOARD.into())) }
+}
+
+/// Prototyping and Dev Mode: not on boards.
+fn design_only(cmd: &str) -> bool {
+ cmd.starts_with("proto.") || cmd.starts_with("dev.") || matches!(cmd, "view.prototype" | "view.designPrototype" | "view.devMode")
+}
+
+/// Refuse `cmd` on a board when it is prototyping or Dev Mode.
+pub(crate) fn refuse_on_board(s: &Session, cmd: &str) -> Result<()> {
+ if design_only(cmd) && s.doc().is_ok_and(is_board) { Err(EngineError::Disabled(cmd.into(), NOT_ON_BOARDS.into())) } else { Ok(()) }
+}
+
+fn board_tool(s: &mut Session, t: ToolId) -> Result {
+ require(s, &format!("tool.{}", t.id()))?;
+ crate::cmd::view::tool(s, t)
+}
+
+fn shape_of(cmd: &str, v: &str) -> Result {
+ BoardShape::from_id(v)
+ .ok_or_else(|| bad(cmd, format!("unknown shape `{v}` (rectangle|roundedRectangle|ellipse|diamond|triangle|speechBubble|chevron)")))
+}
+
+fn stamp_of(cmd: &str, v: &str) -> Result {
+ Stamp::from_id(v).ok_or_else(|| bad(cmd, format!("unknown stamp `{v}` (thumbsUp|heart|plusOne|star|question|check)")))
+}
+
+fn routing_of(cmd: &str, v: &str) -> Result {
+ Routing::from_id(v).ok_or_else(|| bad(cmd, format!("`style` is straight or elbow, not `{v}`")))
+}
+
+fn cap_of(cmd: &str, p: &Value, key: &str) -> Result> {
+ match get(p, key) {
+ None | Some(Value::Null) => Ok(None),
+ Some(v) => crate::cmd::props::enum_of::(v).map(Some).ok_or_else(|| bad(cmd, format!("`{key}`: unknown cap"))),
+ }
+}
+
+/// `color`: a board colour's name, or any colour.
+fn color_param(cmd: &str, p: &Value) -> Result> {
+ match get(p, "color") {
+ None | Some(Value::Null) => Ok(None),
+ Some(Value::String(s)) if board_color(s).is_some() => Ok(board_color(s)),
+ Some(v) => color_of(v).map(Some).ok_or_else(|| bad(cmd, "`color` is a board colour (yellow, blue…) or a colour such as #FFE78A")),
+ }
+}
+
+/// The deeper shade of a board colour lines are drawn in (light tints are too faint as lines).
+fn line_shade(c: Color) -> Color {
+ let palette = BOARD_COLORS.iter().any(|(_, b)| *b == c);
+ if palette { Color::new(c.r * 0.55, c.g * 0.55, c.b * 0.55, c.a) } else { c }
+}
+
+/// Your name on what you make: the name from Preferences, else the one a live session gave you
+/// (none for the default name outside a session).
+fn author(s: &Session) -> String {
+ let name = crate::live::display_name(&s.prefs);
+ if name.is_empty() { s.live().info.as_ref().map(|i| i.name.clone()).unwrap_or_default() } else { name }
+}
+
+/// The parent a command places into, and that parent's page-to-local transform.
+fn parent_of(cmd: &str, s: &Session, p: &Value) -> Result {
+ let page = s.page()?;
+ let parent = opt_id(cmd, p, "parent")?.unwrap_or(page);
+ let doc = s.doc()?;
+ let n = doc.get(parent)?;
+ let takes = n.is_page() || matches!(n.kind, NodeKind::Section { .. }) || (n.kind.is_frame_like() && !n.is_board_atom());
+ if !takes {
+ return Err(bad(cmd, "`parent` is the page, a section or a frame"));
+ }
+ Ok(parent)
+}
+
+/// A new layer at the top of `parent`, at `at` in it, made by `f`.
+fn add(
+ doc: &mut Document,
+ parent: NodeId,
+ kind: NodeKind,
+ name: &str,
+ at: (f64, f64),
+ size: (f64, f64),
+ f: impl FnOnce(&mut Node),
+) -> Result {
+ let id = doc.alloc_id();
+ let mut n = Node::new(id, kind, name, size.0, size.1);
+ n.transform = Affine::translate(at);
+ f(&mut n);
+ doc.insert(n, parent, None)?;
+ Ok(id)
+}
+
+/// A soft shadow under stickies and stamps.
+fn soft_shadow() -> Effect {
+ Effect {
+ kind: EffectKind::DropShadow(Shadow { color: Color::new(0.0, 0.0, 0.0, 0.16), offset: (0.0, 2.0), radius: 6.0, ..Shadow::default() }),
+ visible: true,
+ }
+}
+
+/// A text layer filling its frame's width (the frame's auto layout places it).
+fn add_text(doc: &mut Document, parent: NodeId, text: &str, size: f64, color: Color, align: TextAlignH, width: f64) -> Result {
+ let first: String = text.lines().next().unwrap_or("").chars().take(64).collect();
+ let name = if first.trim().is_empty() { "Text" } else { first.as_str() };
+ let mut td = TextData {
+ characters: crate::cmd::props::normalize_line_endings(text),
+ auto_resize: TextAutoResize::Height,
+ align_h: align,
+ ..TextData::default()
+ };
+ td.style.font_size = size;
+ let id = add(doc, parent, NodeKind::Text(td), name, (0.0, 0.0), (width.max(1.0), size * 1.4), |n| {
+ n.fills = vec![Paint::solid(color)];
+ n.child_layout.sizing_h = Sizing::Fill;
+ })?;
+ if let Some(n) = doc.node(id)
+ && let Some((w, h)) = figcraft_text::auto_size(n)
+ && let Some(n) = doc.node_mut(id)
+ {
+ (n.width, n.height) = (w, h);
+ }
+ Ok(id)
+}
+
+/// The text size a sticky's note gets: smaller the more it holds (by characters and lines, so
+/// every copy of the file picks the same size whatever fonts it has).
+pub fn sticky_font_size(text: &str) -> f64 {
+ let weight = text.chars().count() + 24 * text.matches('\n').count();
+ match weight {
+ 0..=24 => 24.0,
+ 25..=64 => 20.0,
+ 65..=140 => 16.0,
+ 141..=280 => 13.0,
+ _ => 11.0,
+ }
+}
+
+/// A sticky note's layers: the frame, the note and (when known) its author.
+fn make_sticky(doc: &mut Document, parent: NodeId, at: (f64, f64), text: &str, color: Color, author: &str) -> Result<(NodeId, NodeId)> {
+ let id = add(doc, parent, NodeKind::Frame, "Sticky", at, (STICKY, STICKY), |n| {
+ n.fills = vec![Paint::solid(color)];
+ n.corners.radii = [2.0; 4];
+ n.effects = vec![soft_shadow()];
+ n.clip = false;
+ n.layout = Some(AutoLayout {
+ mode: LayoutMode::Vertical,
+ gap: 8.0,
+ padding: [STICKY_PAD; 4],
+ main_align: MainAlign::SpaceBetween,
+ ..AutoLayout::default()
+ });
+ n.child_layout.sizing_v = Sizing::Hug;
+ n.child_layout.min_h = Some(STICKY);
+ n.board = Some(BoardItem::Sticky { author: author.to_string() });
+ })?;
+ let inner = STICKY - 2.0 * STICKY_PAD;
+ let note = add_text(doc, id, text, sticky_font_size(text), INK, TextAlignH::Left, inner)?;
+ if !author.is_empty() {
+ let a = add_text(doc, id, author, 10.0, AUTHOR_INK, TextAlignH::Left, inner)?;
+ if let Some(n) = doc.node_mut(a) {
+ n.name = "Author".into();
+ }
+ }
+ Ok((id, note))
+}
+
+fn sticky_cmd(s: &mut Session, p: &Value) -> Result {
+ let cmd = "board.sticky";
+ require(s, cmd)?;
+ let color = color_param(cmd, p)?.unwrap_or(s.tool.board.sticky);
+ let author = match get(p, "author") {
+ Some(Value::String(a)) => a.trim().chars().filter(|c| !c.is_control()).take(64).collect(),
+ Some(Value::Bool(false)) => String::new(),
+ _ => author(s),
+ };
+ let parent = parent_of(cmd, s, p)?;
+ let text = string(p, "text").unwrap_or_default();
+ let at = (num_or(p, "x", 0.0), num_or(p, "y", 0.0));
+ let (id, note) = make_sticky(s.doc_mut()?, parent, at, &text, color, &author)?;
+ s.set_selection(vec![id]);
+ Ok(json!({"id": id, "text": note}))
+}
+
+/// The first text layer inside board object `id` (its note or label).
+pub fn text_of(doc: &Document, id: NodeId) -> Option {
+ let n = doc.node(id)?;
+ n.board.as_ref().filter(|b| b.has_text())?;
+ n.children.iter().copied().find(|c| doc.node(*c).is_some_and(|k| matches!(k.kind, NodeKind::Text(_))))
+}
+
+/// The board object whose text `text` is, if any.
+pub fn owner_of_text(doc: &Document, text: NodeId) -> Option {
+ let p = doc.node(text)?.parent?;
+ (text_of(doc, p) == Some(text)).then_some(p)
+}
+
+/// Start typing in board object `id`'s text (all of it selected). False when it has none.
+pub fn edit_text(s: &mut Session, id: NodeId) -> Result {
+ let Some(t) = s.doc().ok().and_then(|d| text_of(d, id)) else { return Ok(false) };
+ textedit::begin(s, t, None, false)?;
+ textedit::key(s, "SelectAll", false, false, false)?;
+ Ok(true)
+}
+
+fn next_sticky(s: &mut Session, p: &Value) -> Result {
+ let cmd = "board.nextSticky";
+ require(s, cmd)?;
+ let editing = s.ds()?.text_edit.as_ref().map(|t| t.id);
+ let doc = s.doc()?;
+ let from = id(p, "id")
+ .or_else(|| editing.and_then(|t| owner_of_text(doc, t)))
+ .or_else(|| s.selection().first().copied().map(|i| owner_of_text(doc, i).unwrap_or(i)))
+ .ok_or_else(|| EngineError::Disabled(cmd.into(), "select a sticky first".into()))?;
+ let n = doc.get(from)?;
+ if !matches!(n.board, Some(BoardItem::Sticky { .. })) {
+ return Err(bad(cmd, "that isn't a sticky"));
+ }
+ let color = n.fills.iter().find_map(Paint::solid_color).unwrap_or(s.tool.board.sticky);
+ let parent = n.parent.ok_or_else(|| bad(cmd, "that sticky has no parent"))?;
+ let at = n.transform.translation();
+ let (dx, dy) = match string(p, "side").as_deref().unwrap_or("right") {
+ "right" => (n.width + STICKY_GAP, 0.0),
+ "left" => (-(STICKY + STICKY_GAP), 0.0),
+ "below" => (0.0, n.height + STICKY_GAP),
+ "above" => (0.0, -(STICKY + STICKY_GAP)),
+ other => return Err(bad(cmd, format!("`side` is right, below, left or above, not `{other}`"))),
+ };
+ let author = author(s);
+ if editing.is_some() {
+ textedit::end(s)?;
+ }
+ let (id, note) = make_sticky(s.doc_mut()?, parent, (at.x + dx, at.y + dy), "", color, &author)?;
+ s.set_selection(vec![id]);
+ if boolean(p, "edit") == Some(true) {
+ // Typing goes on in the new sticky once this step is recorded.
+ s.request_ui("board.editText", json!({"id": id}));
+ }
+ Ok(json!({"id": id, "text": note}))
+}
+
+/// A shape with text's layers: the frame, its outline and its text.
+fn make_shape(
+ doc: &mut Document,
+ parent: NodeId,
+ at: (f64, f64),
+ size: (f64, f64),
+ shape: BoardShape,
+ text: &str,
+ color: Color,
+) -> Result<(NodeId, NodeId)> {
+ let (w, h) = size;
+ let id = add(doc, parent, NodeKind::Frame, shape.label(), at, size, |n| {
+ n.fills.clear();
+ n.clip = false;
+ n.layout = Some(AutoLayout {
+ mode: LayoutMode::Vertical,
+ padding: shape_padding(shape, w, h),
+ main_align: MainAlign::Center,
+ cross_align: CrossAlign::Center,
+ ..AutoLayout::default()
+ });
+ n.board = Some(BoardItem::Shape { shape });
+ })?;
+ add(doc, id, NodeKind::Vector { network: VectorNetwork::from_path(&shape.path(w, h)) }, "Outline", (0.0, 0.0), size, |n| {
+ n.fills = vec![Paint::solid(color)];
+ n.strokes = vec![Paint::solid(line_shade(color))];
+ n.stroke.weight = 1.5;
+ n.stroke.align = StrokeAlign::Inside;
+ n.child_layout.absolute = true;
+ n.constraints = Constraints { horizontal: HConstraint::Scale, vertical: VConstraint::Scale };
+ })?;
+ let [_, r, _, l] = shape_padding(shape, w, h);
+ let label = add_text(doc, id, text, 16.0, INK, TextAlignH::Center, (w - l - r).max(1.0))?;
+ Ok((id, label))
+}
+
+fn shape_padding(shape: BoardShape, w: f64, h: f64) -> [f64; 4] {
+ let [t, r, b, l] = shape.text_insets();
+ [t * h, r * w, b * h, l * w]
+}
+
+fn shape_cmd(s: &mut Session, p: &Value) -> Result {
+ let cmd = "board.shape";
+ require(s, cmd)?;
+ let shape = match string(p, "shape") {
+ Some(v) => shape_of(cmd, &v)?,
+ None => s.tool.board.shape,
+ };
+ let size = |k| {
+ num(p, k)
+ .map_or(Ok(SHAPE), |v| if (1.0..=100_000.0).contains(&v) { Ok(v) } else { Err(bad(cmd, format!("`{k}` is a size from 1 to 100000"))) })
+ };
+ let (w, h) = (size("width")?, size("height")?);
+ let color = color_param(cmd, p)?.unwrap_or(s.tool.board.sticky);
+ let parent = parent_of(cmd, s, p)?;
+ let text = string(p, "text").unwrap_or_default();
+ let at = (num_or(p, "x", 0.0), num_or(p, "y", 0.0));
+ let (id, label) = make_shape(s.doc_mut()?, parent, at, (w, h), shape, &text, color)?;
+ s.set_selection(vec![id]);
+ Ok(json!({"id": id, "text": label}))
+}
+
+fn stamp_cmd(s: &mut Session, p: &Value) -> Result {
+ let cmd = "board.stamp";
+ require(s, cmd)?;
+ let stamp = match string(p, "stamp") {
+ Some(v) => stamp_of(cmd, &v)?,
+ None => s.tool.board.stamp,
+ };
+ let (x, y) = (req_num(cmd, p, "x")?, req_num(cmd, p, "y")?);
+ let author = author(s);
+ let page = s.page()?;
+ let half = STAMP_SIZE / 2.0;
+ let doc = s.doc_mut()?;
+ let id = add(doc, page, NodeKind::Frame, stamp.label(), (x - half, y - half), (STAMP_SIZE, STAMP_SIZE), |n| {
+ n.fills = vec![Paint::solid(stamp.color())];
+ n.corners.radii = [half; 4];
+ n.effects = vec![soft_shadow()];
+ n.clip = false;
+ n.board = Some(BoardItem::Stamp { stamp, author });
+ })?;
+ for part in stamp.mark() {
+ let path = figcraft_geom::BezPath::from_svg(part.d).map_err(|e| EngineError::Other(format!("stamp mark: {e}")))?;
+ add(doc, id, NodeKind::Vector { network: VectorNetwork::from_path(&path) }, "Mark", (0.0, 0.0), (STAMP_SIZE, STAMP_SIZE), |n| {
+ if part.filled {
+ n.fills = vec![Paint::solid(Color::WHITE)];
+ } else {
+ n.fills.clear();
+ n.strokes = vec![Paint::solid(Color::WHITE)];
+ n.stroke.weight = 3.0;
+ (n.stroke.cap_start, n.stroke.cap_end) = (StrokeCap::Round, StrokeCap::Round);
+ n.stroke.join = StrokeJoin::Round;
+ n.stroke.align = StrokeAlign::Center;
+ }
+ })?;
+ }
+ s.set_selection(vec![id]);
+ Ok(json!({"id": id}))
+}
+
+fn ink_cmd(s: &mut Session, p: &Value) -> Result {
+ let cmd = "board.ink";
+ require(s, cmd)?;
+ let high = boolean(p, "highlighter").unwrap_or(false);
+ let color = color_param(cmd, p)?.unwrap_or(if high { s.tool.board.highlighter } else { s.tool.board.marker });
+ let (weight, opacity) = if high { HIGHLIGHTER } else { MARKER };
+ if get(p, "path").is_none() && get(p, "points").is_none() {
+ return Err(bad(cmd, "`path` or `points` is required"));
+ }
+ let page = s.page()?;
+ let select = boolean(p, "select").unwrap_or(true);
+ let mut q = json!({"type": "vector", "parent": page, "closed": false, "select": select, "name": if high { "Highlight" } else { "Ink" }, "props": {
+ "fills": [], "strokes": [color.to_css_hex()], "strokeWeight": weight, "strokeCap": "round", "strokeJoin": "round", "strokeAlign": "center",
+ }});
+ for k in ["path", "points"] {
+ if let (Some(v), Some(o)) = (get(p, k), q.as_object_mut()) {
+ o.insert(k.into(), v.clone());
+ }
+ }
+ let made = crate::cmd::create::create(s, &q)?;
+ let id = made.get("id").and_then(id_of).ok_or_else(|| EngineError::Other("no stroke made".into()))?;
+ let n = s.doc_mut()?.get_mut(id)?;
+ n.opacity = opacity;
+ if high {
+ n.blend = BlendMode::Multiply;
+ }
+ n.board = Some(BoardItem::Ink);
+ Ok(json!({"id": id}))
+}
+
+/// One connector end from the params: a layer on this page, or a point.
+fn end_param(cmd: &str, s: &Session, p: &Value, key: &str, side_key: &str) -> Result {
+ let side = match string(p, side_key) {
+ Some(v) => Side::from_id(&v).ok_or_else(|| bad(cmd, format!("`{side_key}` is auto, top, right, bottom or left")))?,
+ None => Side::Auto,
+ };
+ match get(p, key) {
+ Some(Value::Object(o)) if o.contains_key("x") => {
+ let (x, y) = (num(&Value::Object(o.clone()), "x"), num(&Value::Object(o.clone()), "y"));
+ match (x, y) {
+ (Some(x), Some(y)) if x.is_finite() && y.is_finite() => Ok(End::Point { x, y }),
+ _ => Err(bad(cmd, format!("`{key}` needs finite x and y"))),
+ }
+ }
+ Some(v) => {
+ let node = id_of(v).ok_or_else(|| bad(cmd, format!("`{key}` is a layer id or {{x, y}}")))?;
+ let doc = s.doc()?;
+ let n = doc.get(node)?;
+ if n.is_page() || doc.page_of(node) != Some(s.page()?) {
+ return Err(bad(cmd, format!("`{key}` must be a layer on this page")));
+ }
+ if matches!(n.board, Some(BoardItem::Connector(_))) {
+ return Err(bad(cmd, format!("`{key}` can't be another connector")));
+ }
+ Ok(End::Node { node, side })
+ }
+ None => Err(bad(cmd, format!("`{key}` is required"))),
+ }
+}
+
+fn connector_cmd(s: &mut Session, p: &Value) -> Result {
+ let cmd = "board.connector";
+ require(s, cmd)?;
+ let from = end_param(cmd, s, p, "from", "fromSide")?;
+ let to = end_param(cmd, s, p, "to", "toSide")?;
+ if from.node().is_some() && from.node() == to.node() {
+ return Err(bad(cmd, "connect two different layers"));
+ }
+ let routing = match string(p, "style") {
+ Some(v) => routing_of(cmd, &v)?,
+ None => s.tool.board.routing,
+ };
+ let start = cap_of(cmd, p, "startCap")?.unwrap_or(StrokeCap::None);
+ let end = cap_of(cmd, p, "endCap")?.unwrap_or(StrokeCap::TriangleArrow);
+ let c = Connector { from, to, routing };
+ let page = s.page()?;
+ let doc = s.doc_mut()?;
+ let pts = route(doc, &c).ok_or_else(|| bad(cmd, "the ends can't be placed"))?;
+ if pts.windows(2).all(|w| w.first() == w.get(1)) {
+ return Err(bad(cmd, "the ends are in the same place"));
+ }
+ let id = add(doc, page, NodeKind::Vector { network: VectorNetwork::default() }, "Connector", (0.0, 0.0), (0.0, 0.0), |n| {
+ n.fills.clear();
+ n.strokes = vec![Paint::solid(LINE)];
+ n.stroke.weight = LINE_WEIGHT;
+ n.stroke.join = StrokeJoin::Round;
+ n.stroke.cap_start = start;
+ n.stroke.cap_end = end;
+ n.board = Some(BoardItem::Connector(c));
+ })?;
+ place_route(doc, id, &pts);
+ let mut out = json!({"id": id});
+ if let Some(text) = string(p, "label").filter(|t| !t.trim().is_empty()) {
+ out["label"] = json!(set_label(doc, id, &text)?);
+ }
+ s.set_selection(vec![id]);
+ Ok(out)
+}
+
+/// The label of connector `id`, if it has one.
+pub fn label_of(doc: &Document, id: NodeId) -> Option {
+ let parent = doc.node(id)?.parent?;
+ doc.node(parent)?.children.iter().copied().find(|c| doc.node(*c).is_some_and(|n| n.board == Some(BoardItem::Label { connector: id })))
+}
+
+/// Give connector `id` the label `text` (empty removes it); the label's id.
+fn set_label(doc: &mut Document, id: NodeId, text: &str) -> Result> {
+ let existing = label_of(doc, id);
+ if text.trim().is_empty() {
+ if let Some(l) = existing {
+ doc.remove(l)?;
+ }
+ return Ok(None);
+ }
+ if let Some(l) = existing {
+ if let Some(t) = text_of(doc, l)
+ && let Some(NodeKind::Text(td)) = doc.node_mut(t).map(|n| &mut n.kind)
+ {
+ let len = td.char_count();
+ td.replace_range(0, len, text);
+ }
+ return Ok(Some(l));
+ }
+ let parent = doc.node(id).and_then(|n| n.parent).ok_or(DocError::NoNode(id))?;
+ let l = add(doc, parent, NodeKind::Frame, "Label", (0.0, 0.0), (40.0, 24.0), |n| {
+ n.fills = vec![Paint::solid(Color::WHITE)];
+ n.corners.radii = [4.0; 4];
+ n.clip = false;
+ n.layout = Some(AutoLayout { padding: [3.0, 6.0, 3.0, 6.0], ..AutoLayout::default() });
+ n.child_layout.sizing_h = Sizing::Hug;
+ n.child_layout.sizing_v = Sizing::Hug;
+ n.board = Some(BoardItem::Label { connector: id });
+ })?;
+ let t = add_text(doc, l, text, 12.0, INK, TextAlignH::Center, 40.0)?;
+ if let Some(n) = doc.node_mut(t)
+ && let NodeKind::Text(td) = &mut n.kind
+ {
+ // The label hugs its text: one line per paragraph.
+ td.auto_resize = TextAutoResize::WidthAndHeight;
+ n.child_layout.sizing_h = Sizing::Hug;
+ }
+ Ok(Some(l))
+}
+
+fn label_cmd(s: &mut Session, p: &Value) -> Result {
+ let cmd = "board.label";
+ require(s, cmd)?;
+ let id = req_targets(cmd, s, p)?.first().copied().ok_or_else(|| bad(cmd, "select a connector"))?;
+ let doc = s.doc()?;
+ let id = match doc.node(id).and_then(|n| n.board.clone()) {
+ Some(BoardItem::Connector(_)) => id,
+ Some(BoardItem::Label { connector }) => connector,
+ _ => return Err(bad(cmd, "that isn't a connector")),
+ };
+ let text = req_string(cmd, p, "text")?;
+ let label = set_label(s.doc_mut()?, id, &text)?;
+ Ok(json!({"id": id, "label": label}))
+}
+
+/// The board objects among `ids`, each with its item (a label counts as its connector's text).
+fn items(doc: &Document, ids: &[NodeId]) -> Vec<(NodeId, BoardItem)> {
+ ids.iter().filter_map(|i| doc.node(*i).and_then(|n| n.board.clone()).map(|b| (*i, b))).collect()
+}
+
+fn set_color(s: &mut Session, p: &Value) -> Result {
+ let cmd = "board.setColor";
+ require(s, cmd)?;
+ let ids = req_targets(cmd, s, p)?;
+ let color = color_param(cmd, p)?.ok_or_else(|| bad(cmd, "`color` is required"))?;
+ let doc = s.doc_mut()?;
+ let mut changed = Vec::new();
+ for (id, item) in items(doc, &ids) {
+ match item {
+ BoardItem::Sticky { .. } => doc.get_mut(id)?.fills = vec![Paint::solid(color)],
+ BoardItem::Shape { .. } => {
+ let Some(outline) = doc.get(id)?.children.first().copied() else { continue };
+ let n = doc.get_mut(outline)?;
+ n.fills = vec![Paint::solid(color)];
+ n.strokes = vec![Paint::solid(line_shade(color))];
+ }
+ BoardItem::Connector(_) | BoardItem::Ink => doc.get_mut(id)?.strokes = vec![Paint::solid(line_shade(color))],
+ BoardItem::Label { .. } | BoardItem::Stamp { .. } => continue,
+ }
+ changed.push(id);
+ }
+ if changed.is_empty() {
+ return Err(bad(cmd, "select stickies, shapes, connectors or ink"));
+ }
+ Ok(json!({"ids": changed}))
+}
+
+/// What `board.setStyle` changes (each `None` leaves it).
+struct Restyle {
+ shape: Option,
+ routing: Option,
+ size: Option,
+ start: Option,
+ end: Option,
+}
+
+impl Restyle {
+ fn of(cmd: &str, p: &Value) -> Result {
+ let size = num(p, "fontSize")
+ .map(|v| if v.is_finite() && (1.0..=1000.0).contains(&v) { Ok(v) } else { Err(bad(cmd, "`fontSize` is from 1 to 1000")) })
+ .transpose()?;
+ Ok(Restyle {
+ shape: string(p, "shape").map(|v| shape_of(cmd, &v)).transpose()?,
+ routing: string(p, "style").map(|v| routing_of(cmd, &v)).transpose()?,
+ size,
+ start: cap_of(cmd, p, "startCap")?,
+ end: cap_of(cmd, p, "endCap")?,
+ })
+ }
+
+ /// Restyle board object `id` (`item`); whether anything about it changed.
+ fn apply(&self, doc: &mut Document, id: NodeId, item: BoardItem) -> Result {
+ let changed = match item {
+ BoardItem::Shape { shape } => match self.shape.filter(|n| *n != shape) {
+ Some(new) => {
+ reshape(doc, id, new)?;
+ true
+ }
+ None => false,
+ },
+ BoardItem::Connector(c) => self.restyle_connector(doc, id, c)?,
+ _ => false,
+ };
+ // Text sizes: shapes' and labels' text (stickies size theirs to fit).
+ let sized = match (self.size, &item) {
+ (Some(size), BoardItem::Shape { .. } | BoardItem::Label { .. }) => resize_text(doc, id, size),
+ _ => false,
+ };
+ Ok(changed || sized)
+ }
+
+ fn restyle_connector(&self, doc: &mut Document, id: NodeId, mut c: Connector) -> Result {
+ let n = doc.get_mut(id)?;
+ if let Some(r) = self.routing {
+ c.routing = r;
+ n.board = Some(BoardItem::Connector(c));
+ }
+ if let Some(cap) = self.start {
+ n.stroke.cap_start = cap;
+ }
+ if let Some(cap) = self.end {
+ n.stroke.cap_end = cap;
+ }
+ Ok(self.routing.is_some() || self.start.is_some() || self.end.is_some())
+ }
+}
+
+/// Shape with text `id` takes outline `new` (its text room too).
+fn reshape(doc: &mut Document, id: NodeId, new: BoardShape) -> Result<()> {
+ let n = doc.get_mut(id)?;
+ n.board = Some(BoardItem::Shape { shape: new });
+ n.name = new.label().into();
+ let (w, h) = (n.width, n.height);
+ if let Some(l) = n.layout.as_mut() {
+ l.padding = shape_padding(new, w, h);
+ }
+ if let Some(o) = doc.get(id)?.children.first().copied()
+ && let Some(on) = doc.node_mut(o)
+ {
+ on.kind = NodeKind::Vector { network: VectorNetwork::from_path(&new.path(w, h)) };
+ (on.width, on.height, on.transform) = (w, h, Affine::IDENTITY);
+ }
+ Ok(())
+}
+
+/// Board object `id`'s text at `size`; whether it has text.
+fn resize_text(doc: &mut Document, id: NodeId, size: f64) -> bool {
+ let Some(t) = text_of(doc, id) else { return false };
+ if let Some(NodeKind::Text(td)) = doc.node_mut(t).map(|n| &mut n.kind) {
+ set_font_size(td, size);
+ return true;
+ }
+ false
+}
+
+fn set_style(s: &mut Session, p: &Value) -> Result {
+ let cmd = "board.setStyle";
+ require(s, cmd)?;
+ let ids = req_targets(cmd, s, p)?;
+ let restyle = Restyle::of(cmd, p)?;
+ let doc = s.doc_mut()?;
+ let mut changed = Vec::new();
+ for (id, item) in items(doc, &ids) {
+ if restyle.apply(doc, id, item)? {
+ changed.push(id);
+ }
+ }
+ if changed.is_empty() {
+ return Err(bad(cmd, "nothing selected takes these (shapes with text, connectors, labels)"));
+ }
+ Ok(json!({"ids": changed}))
+}
+
+fn set_font_size(td: &mut TextData, size: f64) {
+ td.style.font_size = size;
+ for r in &mut td.runs {
+ r.style.font_size = size;
+ }
+}
+
+/// Each layer of `sources` (copied one by one, in order, as `copies`) and its copy: the whole
+/// subtrees pair up when they have the same shape (an instance made of a main component may not;
+/// then only the roots do).
+pub(crate) fn copy_map(doc: &Document, sources: &[NodeId], copies: &[NodeId]) -> BTreeMap {
+ let mut map = BTreeMap::new();
+ for (s, c) in sources.iter().zip(copies) {
+ let (a, b) = (doc.subtree(*s), doc.subtree(*c));
+ if a.len() == b.len() {
+ map.extend(a.into_iter().zip(b));
+ } else {
+ map.insert(*s, *c);
+ }
+ }
+ map
+}
+
+/// The connectors and labels among copied layers, as `(copy, the original's board item)`, from the
+/// originals in `doc` (`map`: original → copy).
+pub(crate) fn copied_items(doc: &Document, map: &BTreeMap) -> Vec<(NodeId, BoardItem)> {
+ map.iter().filter_map(|(o, c)| doc.node(*o).and_then(|n| n.board.clone()).map(|b| (*c, b))).collect()
+}
+
+/// After a copy (`map`: each copied original → its copy; `originals`: the copies' items as the
+/// originals had them), copied connectors join the copies of what they joined and labels follow
+/// the copies of their connectors. From another file (`foreign`), what wasn't copied isn't here: a
+/// connector's end there stays where it is drawn, as a point, and a label without its connector
+/// goes.
+pub(crate) fn rejoin(doc: &mut Document, originals: &[(NodeId, BoardItem)], map: &BTreeMap, foreign: bool) {
+ for (copy, item) in originals {
+ let mut item = item.clone();
+ let copied = |n: NodeId| map.contains_key(&n);
+ match &mut item {
+ BoardItem::Connector(c) if foreign => {
+ let ends = ends_now(doc, *copy);
+ for (end, at) in [(&mut c.from, ends.map(|e| e.0)), (&mut c.to, ends.map(|e| e.1))] {
+ if let (End::Node { node, .. }, Some(p)) = (*end, at)
+ && !copied(node)
+ {
+ *end = End::Point { x: p.x, y: p.y };
+ }
+ }
+ }
+ BoardItem::Label { connector } if foreign && !copied(*connector) => {
+ let _ = doc.remove(*copy);
+ continue;
+ }
+ BoardItem::Connector(_) | BoardItem::Label { .. } => {}
+ _ => continue,
+ }
+ item.remap(map);
+ if let Some(n) = doc.node_mut(*copy) {
+ n.board = Some(item);
+ }
+ }
+}
+
+// ---------------------------------------------------------------------------------------------
+// Derived data (the normalize pass).
+
+/// Before text is measured: a sticky's note takes the size its length calls for, and a resized
+/// shape keeps its text inside its outline.
+pub(crate) fn settle_text(doc: &mut Document, before: &Document, touched: &BTreeSet) {
+ if !is_board(doc) {
+ return;
+ }
+ for &id in touched {
+ let Some(n) = doc.node(id) else { continue };
+ if let Some(owner) =
+ owner_of_text(doc, id).or(Some(id)).filter(|o| doc.node(*o).is_some_and(|k| matches!(k.board, Some(BoardItem::Sticky { .. }))))
+ && let Some(t) = text_of(doc, owner)
+ && let Some(NodeKind::Text(td)) = doc.node(t).map(|k| &k.kind)
+ {
+ let size = sticky_font_size(&td.characters);
+ let off = td.style.font_size != size || td.runs.iter().any(|r| r.style.font_size != size);
+ if off && let Some(NodeKind::Text(td)) = doc.node_mut(t).map(|k| &mut k.kind) {
+ set_font_size(td, size);
+ }
+ continue;
+ }
+ if let Some(BoardItem::Shape { shape }) = n.board
+ && before.node(id).is_none_or(|b| (b.width, b.height) != (n.width, n.height))
+ {
+ let pad = shape_padding(shape, n.width, n.height);
+ if n.layout.as_ref().is_some_and(|l| l.padding != pad)
+ && let Some(l) = doc.node_mut(id).and_then(|k| k.layout.as_mut())
+ {
+ l.padding = pad;
+ }
+ }
+ }
+}
+
+/// After layout: connectors run between their ends again (an end whose layer is gone stays where
+/// it was), one moved on its own takes its free ends along, and labels sit at their middles. Only
+/// the connectors and labels an edit can have moved are looked at: touched themselves, or with a
+/// touched (or gone) end, connector or layer around them.
+pub(crate) fn settle_routes(doc: &mut Document, before: &Document, touched: &BTreeSet) {
+ if !is_board(doc) || touched.is_empty() {
+ return;
+ }
+ let hit = |doc: &Document, id: NodeId| touched.contains(&id) || doc.ancestors(id).iter().any(|a| touched.contains(a));
+ let (mut connectors, mut labels) = (Vec::new(), Vec::new());
+ for n in doc.nodes() {
+ match &n.board {
+ Some(BoardItem::Connector(c)) => {
+ let ends = [c.from.node(), c.to.node()].into_iter().flatten();
+ if hit(doc, n.id) || ends.into_iter().any(|e| !doc.contains(e) || hit(doc, e)) {
+ connectors.push((n.id, *c));
+ }
+ }
+ Some(BoardItem::Label { connector }) => labels.push((n.id, *connector)),
+ _ => {}
+ }
+ }
+ let rerouted: BTreeSet = connectors.iter().map(|(id, _)| *id).collect();
+ for (id, mut c) in connectors {
+ let changed = detach_gone_ends(doc, id, &mut c) | carry_free_ends(doc, before, touched, id, &mut c);
+ if changed && let Some(n) = doc.node_mut(id) {
+ n.board = Some(BoardItem::Connector(c));
+ }
+ if let Some(pts) = route(doc, &c) {
+ place_route(doc, id, &pts);
+ }
+ }
+ for (label, connector) in labels {
+ if rerouted.contains(&connector) || touched.contains(&connector) || hit(doc, label) {
+ place_label(doc, label, connector);
+ }
+ }
+}
+
+/// The ends of connector `id` (as `c`) whose layer is gone or on another page stay where they are
+/// drawn, as points. Whether any did.
+fn detach_gone_ends(doc: &Document, id: NodeId, c: &mut Connector) -> bool {
+ let (page, ends) = (doc.page_of(id), ends_now(doc, id));
+ let mut detached = false;
+ for (end, at) in [(&mut c.from, ends.map(|e| e.0)), (&mut c.to, ends.map(|e| e.1))] {
+ if let (End::Node { node, .. }, Some(p)) = (*end, at)
+ && (!doc.contains(node) || doc.page_of(node) != page)
+ {
+ *end = End::Point { x: p.x, y: p.y };
+ detached = true;
+ }
+ }
+ detached
+}
+
+/// Connector `id` (as `c`) moved by itself (a drag, a nudge: its place changed but not what it
+/// joins): its free ends move with it. Whether they did.
+fn carry_free_ends(doc: &Document, before: &Document, touched: &BTreeSet, id: NodeId, c: &mut Connector) -> bool {
+ let (Some(b), Some(n)) = (before.node(id), doc.node(id)) else { return false };
+ if !touched.contains(&id) || b.transform == n.transform || b.board != n.board {
+ return false;
+ }
+ let Some(expected) = route(doc, c).and_then(|pts| figcraft_geom::points_bounds(pts.iter().copied())).map(|b| b.origin()) else { return false };
+ let d = (doc.world_transform(id) * Point::ZERO) - expected;
+ if d.hypot() <= 1e-9 {
+ return false;
+ }
+ let mut moved = false;
+ for end in [&mut c.from, &mut c.to] {
+ if let End::Point { x, y } = end {
+ (*x, *y) = (*x + d.x, *y + d.y);
+ moved = true;
+ }
+ }
+ moved
+}
+
+/// Label `label` at the middle of connector `connector`; gone with it when it is gone.
+fn place_label(doc: &mut Document, label: NodeId, connector: NodeId) {
+ let Some(mid) = doc.node(connector).and_then(|_| route_mid(doc, connector)) else {
+ let _ = doc.remove(label);
+ return;
+ };
+ let Some(n) = doc.node(label) else { return };
+ let pw = n.parent.map_or(Affine::IDENTITY, |p| doc.world_transform(p));
+ let local = pw.inverse() * mid;
+ let t = Affine::translate((local.x - n.width / 2.0, local.y - n.height / 2.0));
+ if n.transform != t
+ && let Some(n) = doc.node_mut(label)
+ {
+ n.transform = t;
+ }
+}
+
+/// Connector `id`'s first and last points on the page as it is drawn now.
+fn ends_now(doc: &Document, id: NodeId) -> Option<(Point, Point)> {
+ let NodeKind::Vector { network } = &doc.node(id)?.kind else { return None };
+ let w = doc.world_transform(id);
+ Some((w * network.vertices.first()?.point(), w * network.vertices.last()?.point()))
+}
+
+/// The middle of connector `id`'s route by length, on the page.
+fn route_mid(doc: &Document, id: NodeId) -> Option {
+ let NodeKind::Vector { network } = &doc.node(id)?.kind else { return None };
+ let w = doc.world_transform(id);
+ let pts: Vec = network.vertices.iter().map(|v| w * v.point()).collect();
+ let total: f64 = pts.windows(2).map(|s| (s[1] - s[0]).hypot()).sum();
+ let mut left = total / 2.0;
+ for s in pts.windows(2) {
+ let (a, b) = (s[0], s[1]);
+ let l = (b - a).hypot();
+ if l >= left && l > 0.0 {
+ return Some(a.lerp(b, left / l));
+ }
+ left -= l;
+ }
+ pts.first().copied()
+}
+
+/// Write the route `pts` (page points) into connector `id`: its box, place and path. Untouched
+/// when it already runs there, so a connector that didn't move isn't an edit.
+fn place_route(doc: &mut Document, id: NodeId, pts: &[Point]) {
+ let Some(n) = doc.node(id) else { return };
+ let pw = n.parent.map_or(Affine::IDENTITY, |p| doc.world_transform(p));
+ let inv = pw.inverse();
+ let local: Vec = pts.iter().map(|p| inv * *p).collect();
+ let Some(b) = figcraft_geom::points_bounds(local.iter().copied()) else { return };
+ if !(b.x0.is_finite() && b.y0.is_finite() && b.x1.is_finite() && b.y1.is_finite()) {
+ return;
+ }
+ let rel: Vec = local.iter().map(|p| Point::new(p.x - b.x0, p.y - b.y0)).collect();
+ let network = VectorNetwork::from_points(&rel, false);
+ let t = Affine::translate((b.x0, b.y0));
+ let same =
+ n.transform == t && n.width == b.width() && n.height == b.height() && matches!(&n.kind, NodeKind::Vector { network: old } if *old == network);
+ if same {
+ return;
+ }
+ if let Some(n) = doc.node_mut(id) {
+ n.kind = NodeKind::Vector { network };
+ n.transform = t;
+ (n.width, n.height) = (b.width(), b.height());
+ }
+}
+
+/// The page points connector `c` runs through: from the middle of the side of each attached layer
+/// facing the other end (or the side it names), straight or in right angles.
+pub fn route(doc: &Document, c: &Connector) -> Option> {
+ let bounds = |e: &End| e.node().and_then(|n| doc.world_bounds(n));
+ let centre = |e: &End, b: Option| match e {
+ End::Point { x, y } => Some(Point::new(*x, *y)),
+ End::Node { .. } => b.map(|b| b.center()),
+ };
+ let (fb, tb) = (bounds(&c.from), bounds(&c.to));
+ let (fc, tc) = (centre(&c.from, fb)?, centre(&c.to, tb)?);
+ let (p0, h0) = attach(&c.from, fb, tc)?;
+ let (p1, h1) = attach(&c.to, tb, fc)?;
+ let mut pts = match c.routing {
+ Routing::Straight => vec![p0, p1],
+ Routing::Elbow => elbow(p0, h0, p1, h1),
+ };
+ pts.dedup();
+ // A turn that doesn't turn (the ends in line) is no point of the route.
+ let in_line = |i: usize, b: &Point| match (i.checked_sub(1).and_then(|j| pts.get(j)), pts.get(i + 1)) {
+ (Some(a), Some(c)) => (a.x == b.x && b.x == c.x) || (a.y == b.y && b.y == c.y),
+ _ => false,
+ };
+ let pts: Vec = pts.iter().enumerate().filter(|(i, b)| !in_line(*i, b)).map(|(_, b)| *b).collect();
+ pts.iter().all(|p| p.x.is_finite() && p.y.is_finite()).then_some(pts)
+}
+
+/// Where end `e` attaches (its point, or the middle of its layer's side facing `other`) and
+/// whether that side faces sideways (`None`: a free point).
+fn attach(e: &End, b: Option, other: Point) -> Option<(Point, Option)> {
+ match e {
+ End::Point { x, y } => Some((Point::new(*x, *y), None)),
+ End::Node { side, .. } => {
+ let b = b?;
+ let side = match side {
+ Side::Auto => {
+ let d = other - b.center();
+ // Compare against the box's proportions: a wide box takes the sides more.
+ if d.x.abs() * b.height().max(1e-9) >= d.y.abs() * b.width().max(1e-9) {
+ if d.x >= 0.0 { Side::Right } else { Side::Left }
+ } else if d.y >= 0.0 {
+ Side::Bottom
+ } else {
+ Side::Top
+ }
+ }
+ s => *s,
+ };
+ Some((side.point(b), Some(side.horizontal())))
+ }
+ }
+}
+
+/// A right-angled route from `p0` to `p1`, leaving and arriving along the sides' normals
+/// (`h`: sideways; a free end follows the other).
+fn elbow(p0: Point, h0: Option, p1: Point, h1: Option) -> Vec {
+ let h0 = h0.or(h1).unwrap_or((p1.x - p0.x).abs() >= (p1.y - p0.y).abs());
+ let h1 = h1.unwrap_or(h0);
+ match (h0, h1) {
+ (true, true) => {
+ let mx = (p0.x + p1.x) / 2.0;
+ vec![p0, Point::new(mx, p0.y), Point::new(mx, p1.y), p1]
+ }
+ (false, false) => {
+ let my = (p0.y + p1.y) / 2.0;
+ vec![p0, Point::new(p0.x, my), Point::new(p1.x, my), p1]
+ }
+ (true, false) => vec![p0, Point::new(p1.x, p0.y), p1],
+ (false, true) => vec![p0, Point::new(p0.x, p1.y), p1],
+ }
+}
+
+// ---------------------------------------------------------------------------------------------
+// The board tools.
+
+impl Session {
+ /// A press with a board tool: place a sticky, shape or stamp, start a connector or a stroke,
+ /// or start erasing.
+ pub(crate) fn board_down(&mut self, ev: &PointerEvent) -> Result<()> {
+ // A board tool kept while a design file came to the front: back to Move for this press.
+ if !is_board(self.doc()?) {
+ self.tool.tool = ToolId::Move;
+ return self.pointer(ev);
+ }
+ // A sticky still being typed in ends first, so the next object is an undo step of its own.
+ if self.ds()?.text_edit.is_some() {
+ crate::textedit::end(self)?;
+ }
+ match self.tool.tool {
+ ToolId::Sticky => {
+ let half = STICKY / 2.0;
+ let r = self.execute("board.sticky", &json!({"x": ev.x - half, "y": ev.y - half}))?;
+ self.board_placed();
+ if let Some(id) = r.get("id").and_then(id_of) {
+ edit_text(self, id)?;
+ }
+ Ok(())
+ }
+ ToolId::BoardShape => {
+ let half = SHAPE / 2.0;
+ self.execute("board.shape", &json!({"x": ev.x - half, "y": ev.y - half}))?;
+ self.board_placed();
+ Ok(())
+ }
+ ToolId::Stamp => {
+ // Stamps go on one after another: the tool stays.
+ self.execute("board.stamp", &json!({"x": ev.x, "y": ev.y}))?;
+ Ok(())
+ }
+ ToolId::Marker | ToolId::Highlighter => {
+ self.tool.gesture = Gesture::Pencil { points: vec![ev.p()], pressure: vec![ev.pressure] };
+ Ok(())
+ }
+ ToolId::Connector => {
+ let from = self.end_at(ev);
+ self.tool.gesture = Gesture::Connect { from, start: ev.p() };
+ Ok(())
+ }
+ ToolId::Eraser => {
+ self.begin_interaction("Erase")?;
+ self.tool.gesture = Gesture::Erase { gone: Vec::new() };
+ self.erase_at(ev)
+ }
+ _ => Ok(()),
+ }
+ }
+
+ /// After placing an object: back to the Move tool unless tools stay on.
+ fn board_placed(&mut self) {
+ if !self.prefs.keep_tool {
+ self.set_tool(ToolId::Move);
+ }
+ }
+
+ /// What a connector end at the pointer attaches to: the object there, or the point.
+ fn end_at(&self, ev: &PointerEvent) -> End {
+ let hit = (|| {
+ let doc = self.doc().ok()?;
+ let leaf = self.hit(doc, self.page().ok()?, ev.p(), 2.0 / ev.zoom.max(1e-6))?;
+ let t = figcraft_doc::geometry::select_target(doc, leaf, &[], false);
+ let n = doc.node(t)?;
+ (!matches!(n.board, Some(BoardItem::Connector(_)) | Some(BoardItem::Label { .. }) | Some(BoardItem::Ink))).then_some(t)
+ })();
+ match hit {
+ Some(node) => End::Node { node, side: Side::Auto },
+ None => End::Point { x: ev.x, y: ev.y },
+ }
+ }
+
+ pub(crate) fn connect_drag(&mut self, ev: &PointerEvent, from: End, start: Point) {
+ let a = match from {
+ End::Point { x, y } => Point::new(x, y),
+ End::Node { .. } => start,
+ };
+ self.tool.overlay.rubber = Some([a.x, a.y, ev.x, ev.y]);
+ self.tool.overlay.drop_target = from.node();
+ self.tool.gesture = Gesture::Connect { from, start };
+ if let Ok(ds) = self.ds_mut() {
+ ds.revision += 1;
+ }
+ }
+
+ pub(crate) fn connect_up(&mut self, ev: &PointerEvent, from: End, start: Point) -> Result<()> {
+ self.tool.overlay.rubber = None;
+ self.tool.overlay.drop_target = None;
+ // A click, not a drag: nothing to join.
+ if (ev.p() - start).hypot() * ev.zoom.max(1e-6) < 4.0 {
+ return Ok(());
+ }
+ let to = self.end_at(ev);
+ if to.node().is_some() && to.node() == from.node() {
+ return Ok(());
+ }
+ let json_end = |e: End| match e {
+ End::Node { node, .. } => json!(node),
+ End::Point { x, y } => json!({"x": x, "y": y}),
+ };
+ let style = self.tool.board.routing.id();
+ self.execute("board.connector", &json!({"from": json_end(from), "to": json_end(to), "style": style}))?;
+ self.board_placed();
+ Ok(())
+ }
+
+ /// The eraser at the pointer: the marker and highlighter strokes it touches go (until the
+ /// gesture ends, which is one undo step).
+ pub(crate) fn erase_at(&mut self, ev: &PointerEvent) -> Result<()> {
+ let Gesture::Erase { mut gone } = std::mem::take(&mut self.tool.gesture) else { return Ok(()) };
+ let tol = ERASER_PX / ev.zoom.max(1e-6);
+ self.tool.overlay.brush = Some([ev.x, ev.y, tol]);
+ let (doc, page) = (self.doc()?.clone(), self.page()?);
+ if let Some(hit) =
+ doc.hit_test(page, ev.p(), tol, None).filter(|h| doc.node(*h).is_some_and(|n| n.board == Some(BoardItem::Ink)) && !gone.contains(h))
+ {
+ gone.push(hit);
+ let ids = gone.clone();
+ self.preview(|d, sel| {
+ for i in &ids {
+ let _ = d.remove(*i);
+ }
+ sel.retain(|s| !ids.contains(s));
+ Ok(())
+ })?;
+ }
+ self.tool.gesture = Gesture::Erase { gone };
+ if let Ok(ds) = self.ds_mut() {
+ ds.revision += 1;
+ }
+ Ok(())
+ }
+
+ pub(crate) fn erase_up(&mut self) -> Result<()> {
+ self.tool.overlay.brush = None;
+ self.commit_interaction()
+ }
+
+ /// A finished marker or highlighter stroke (page points).
+ pub(crate) fn ink_finish(&mut self, path: &str) -> Result<()> {
+ let high = self.tool.tool == ToolId::Highlighter;
+ self.execute("board.ink", &json!({"path": path, "highlighter": high, "select": false}))?;
+ // Strokes come one after another: the selection stays as it was.
+ Ok(())
+ }
+}
+
+impl Session {
+ /// A double-click with the Move tool on a board object: type in its text (a connector gets a
+ /// label to type in). True when it was one.
+ pub(crate) fn board_double_click(&mut self, doc: &Document, leaf: NodeId, sel: &[NodeId]) -> Result {
+ let whole = figcraft_doc::geometry::select_target(doc, leaf, sel, false);
+ let editing = self.ds()?.text_edit.as_ref().is_some_and(|te| owner_of_text(doc, te.id) == Some(whole));
+ let Some(item) = doc.node(whole).and_then(|n| n.board.clone()).filter(|_| !editing) else { return Ok(false) };
+ self.tool.gesture = Gesture::None;
+ self.cancel_interaction()?;
+ match item {
+ BoardItem::Connector(_) => {
+ let label = match label_of(doc, whole) {
+ Some(l) => l,
+ None => {
+ let r = self.execute("board.label", &json!({"id": whole, "text": "Label"}))?;
+ r.get("label").and_then(id_of).ok_or_else(|| EngineError::Other("no label made".into()))?
+ }
+ };
+ edit_text(self, label)
+ }
+ b if b.has_text() => edit_text(self, whole),
+ _ => Ok(false),
+ }
+ }
+}
diff --git a/crates/engine/src/board_tests.rs b/crates/engine/src/board_tests.rs
new file mode 100644
index 00000000..5b8cbbf9
--- /dev/null
+++ b/crates/engine/src/board_tests.rs
@@ -0,0 +1,363 @@
+//! Boards: the file kind, sticky notes, shapes with text, connectors that follow what they join
+//! (locally, through undo and in live sessions), stamps, ink and the eraser, and refusals.
+
+use figcraft_doc::{
+ BOARD_PAGE, BoardItem, BoardShape, Connector, End, FileKind, Node, NodeId, NodeKind, Routing, Side, Stamp, StrokeCap, board_color,
+};
+use figcraft_geom::Point;
+use serde_json::{Value, json};
+
+use crate::board::{route, sticky_font_size};
+use crate::collab_live_tests::Room;
+use crate::tools::{PointerEvent, PointerKind, ToolId};
+use crate::{EngineError, Session};
+
+pub(crate) fn board() -> Session {
+ let mut s = Session::new();
+ s.execute("file.newBoard", &json!({"name": "Ideas"})).unwrap();
+ s
+}
+
+pub(crate) fn id(v: &Value, key: &str) -> NodeId {
+ v[key].as_u64().map(NodeId).unwrap_or_else(|| panic!("no {key} in {v}"))
+}
+
+pub(crate) fn node(s: &Session, id: NodeId) -> Node {
+ s.doc().unwrap().node(id).unwrap().clone()
+}
+
+pub(crate) fn connector(s: &Session, id: NodeId) -> Connector {
+ match node(s, id).board {
+ Some(BoardItem::Connector(c)) => c,
+ other => panic!("not a connector: {other:?}"),
+ }
+}
+
+/// Connector `id`'s points on the page.
+pub(crate) fn drawn(s: &Session, id: NodeId) -> Vec {
+ let doc = s.doc().unwrap();
+ let NodeKind::Vector { network } = &doc.node(id).unwrap().kind else { panic!("not a vector") };
+ let w = doc.world_transform(id);
+ network.vertices.iter().map(|v| w * v.point()).collect()
+}
+
+pub(crate) fn near(a: Point, b: Point) -> bool {
+ (a - b).hypot() < 1e-6
+}
+
+#[test]
+fn a_board_is_a_kind_of_file_that_saves_and_reopens() {
+ let s = board();
+ let doc = s.doc().unwrap();
+ assert_eq!(doc.kind, FileKind::Board);
+ assert!(matches!(doc.node(doc.pages[0]).unwrap().kind, NodeKind::Page { background, .. } if background == BOARD_PAGE));
+ let (back, _) = figcraft_format::from_json(&figcraft_format::to_json(doc).unwrap().to_string()).unwrap();
+ assert_eq!(back.kind, FileKind::Board);
+ // Files from before boards (no kind) are design files, and design files don't write one.
+ let mut d = Session::new();
+ d.execute("file.new", &json!({})).unwrap();
+ let json = figcraft_format::to_json(d.doc().unwrap()).unwrap();
+ assert!(json.get("kind").is_none());
+ assert_eq!(figcraft_format::from_json(&json.to_string()).unwrap().0.kind, FileKind::Design);
+ assert_eq!(crate::inspect::document(&s, 0, false)["kind"], "board", "inspect shows the kind");
+}
+
+#[test]
+fn board_commands_refuse_on_design_files_and_prototyping_refuses_on_boards() {
+ let mut d = Session::new();
+ d.execute("file.new", &json!({})).unwrap();
+ for (cmd, p) in [("board.sticky", json!({"x": 0, "y": 0})), ("tool.sticky", json!({})), ("tool.set", json!({"tool": "marker"}))] {
+ assert!(matches!(d.execute(cmd, &p), Err(EngineError::Disabled(..))), "{cmd} on a design file");
+ }
+ let mut s = board();
+ for cmd in ["view.devMode", "view.prototype", "proto.present", "proto.flow.add", "dev.focus"] {
+ let e = s.execute(cmd, &json!({})).unwrap_err();
+ assert!(e.to_string().contains("boards have no prototypes"), "{cmd}: {e}");
+ }
+}
+
+#[test]
+fn a_sticky_is_a_square_frame_whose_note_shrinks_as_it_grows() {
+ let mut s = board();
+ s.prefs.user_name = "Ada".into();
+ let r = s.execute("board.sticky", &json!({"x": 10, "y": 20, "text": "Hi", "color": "blue"})).unwrap();
+ let (st, note) = (id(&r, "id"), id(&r, "text"));
+ let n = node(&s, st);
+ assert!(n.is_board_atom() && matches!(&n.board, Some(BoardItem::Sticky { author }) if author == "Ada"));
+ assert_eq!((n.width, n.height), (200.0, 200.0));
+ assert_eq!(n.fills[0].solid_color(), board_color("blue"));
+ assert!(n.layout.is_some() && !n.effects.is_empty());
+ assert_eq!(n.children.len(), 2, "the note and its author");
+ assert_eq!(node(&s, note).kind.text().unwrap().style.font_size, 24.0);
+ // A click on the note picks the sticky whole.
+ let doc = s.doc().unwrap();
+ assert_eq!(figcraft_doc::geometry::select_target(doc, note, &[], false), st);
+ // A long note takes a smaller size; a very long one grows the sticky past its square.
+ let long = "word ".repeat(120);
+ s.execute("node.set", &json!({"id": note, "props": {"characters": long}})).unwrap();
+ assert_eq!(node(&s, note).kind.text().unwrap().style.font_size, sticky_font_size(&long));
+ assert!(sticky_font_size(&long) < 16.0);
+ assert!(node(&s, st).width == 200.0 && node(&s, st).height >= 200.0);
+ // Undo puts the short note and its size back.
+ s.execute("edit.undo", &json!({})).unwrap();
+ assert_eq!(node(&s, note).kind.text().unwrap().style.font_size, 24.0);
+}
+
+#[test]
+fn next_sticky_goes_beside_in_the_same_colour_and_emptied_notes_stay() {
+ let mut s = board();
+ let a = id(&s.execute("board.sticky", &json!({"x": 0, "y": 0, "color": "pink"})).unwrap(), "id");
+ let r = s.execute("board.nextSticky", &json!({})).unwrap();
+ let b = id(&r, "id");
+ let (na, nb) = (node(&s, a), node(&s, b));
+ assert_eq!(nb.transform.translation().x, na.width + 24.0);
+ assert_eq!(nb.fills, na.fills);
+ assert_eq!(s.selection(), vec![b]);
+ // Typing in it and emptying it again keeps its note; ending selects the sticky.
+ let note = id(&r, "text");
+ crate::board::edit_text(&mut s, b).unwrap();
+ crate::textedit::insert(&mut s, "x").unwrap();
+ crate::textedit::key(&mut s, "Backspace", false, false, false).unwrap();
+ crate::textedit::end(&mut s).unwrap();
+ assert!(s.doc().unwrap().contains(note));
+ assert_eq!(s.selection(), vec![b]);
+}
+
+#[test]
+fn shapes_carry_text_and_change_outline() {
+ let mut s = board();
+ let r = s.execute("board.shape", &json!({"shape": "diamond", "x": 0, "y": 0, "text": "Decide", "color": "green"})).unwrap();
+ let sh = id(&r, "id");
+ let n = node(&s, sh);
+ assert_eq!(n.board, Some(BoardItem::Shape { shape: BoardShape::Diamond }));
+ assert_eq!(n.children.len(), 2);
+ assert!(matches!(node(&s, n.children[0]).kind, NodeKind::Vector { .. }));
+ s.execute("board.setStyle", &json!({"ids": [sh], "shape": "speechBubble", "fontSize": 24})).unwrap();
+ assert_eq!(node(&s, sh).board, Some(BoardItem::Shape { shape: BoardShape::SpeechBubble }));
+ assert_eq!(node(&s, id(&r, "text")).kind.text().unwrap().style.font_size, 24.0);
+ s.execute("board.setColor", &json!({"ids": [sh], "color": "#FF0000"})).unwrap();
+ assert_eq!(node(&s, n.children[0]).fills[0].solid_color().map(|c| c.to_hex()), Some("FF0000".into()));
+ assert!(s.execute("board.shape", &json!({"shape": "blob", "x": 0, "y": 0})).is_err());
+}
+
+#[test]
+fn connectors_follow_what_they_join_and_undo_with_it() {
+ let mut s = board();
+ let a = id(&s.execute("board.sticky", &json!({"x": 0, "y": 0})).unwrap(), "id");
+ let b = id(&s.execute("board.sticky", &json!({"x": 400, "y": 0})).unwrap(), "id");
+ let c = id(&s.execute("board.connector", &json!({"from": a, "to": b, "style": "straight", "label": "then"})).unwrap(), "id");
+ let pts = drawn(&s, c);
+ assert!(near(pts[0], Point::new(200.0, 100.0)) && near(pts[1], Point::new(400.0, 100.0)), "{pts:?}");
+ assert_eq!(node(&s, c).stroke.cap_end, StrokeCap::TriangleArrow);
+ // Its label sits at the middle.
+ let label = crate::board::label_of(s.doc().unwrap(), c).unwrap();
+ let lb = s.doc().unwrap().world_bounds(label).unwrap();
+ assert!(near(lb.center(), Point::new(300.0, 100.0)), "{lb:?}");
+ // Move one end: the connector re-routes (elbow now, out of the facing sides).
+ s.execute("board.setStyle", &json!({"ids": [c], "style": "elbow"})).unwrap();
+ s.execute("transform.move", &json!({"ids": [b], "dx": 0, "dy": 300})).unwrap();
+ let pts = drawn(&s, c);
+ assert!(near(pts[0], Point::new(200.0, 100.0)) && near(*pts.last().unwrap(), Point::new(400.0, 400.0)), "{pts:?}");
+ assert!(pts.windows(2).all(|w| w[0].x == w[1].x || w[0].y == w[1].y), "right angles: {pts:?}");
+ // Undo takes the move back and the route with it.
+ s.execute("edit.undo", &json!({})).unwrap();
+ assert!(near(*drawn(&s, c).last().unwrap(), Point::new(400.0, 100.0)));
+ // A deleted end stays where it was, as a point.
+ s.execute("edit.delete", &json!({"ids": [b]})).unwrap();
+ assert!(matches!(connector(&s, c).to, End::Point { .. }));
+ assert!(near(*drawn(&s, c).last().unwrap(), Point::new(400.0, 100.0)));
+ // A connector moved on its own takes its free end along; the attached one stays.
+ s.execute("transform.move", &json!({"ids": [c], "dx": 0, "dy": 50})).unwrap();
+ assert!(matches!(connector(&s, c).to, End::Point { x, y } if x == 400.0 && y == 150.0), "{:?}", connector(&s, c));
+ assert!(near(drawn(&s, c)[0], Point::new(200.0, 100.0)));
+ // Deleting the connector takes its label.
+ s.execute("edit.delete", &json!({"ids": [c]})).unwrap();
+ assert!(!s.doc().unwrap().contains(label));
+ assert!(s.execute("board.connector", &json!({"from": a, "to": a})).is_err());
+}
+
+#[test]
+fn routes_are_the_same_for_the_same_document() {
+ let mut s = board();
+ let a = id(&s.execute("board.shape", &json!({"x": 0, "y": 0})).unwrap(), "id");
+ let c = Connector { from: End::Node { node: a, side: Side::Bottom }, to: End::Point { x: 300.0, y: 500.0 }, routing: Routing::Elbow };
+ let doc = s.doc().unwrap();
+ let r = route(doc, &c).unwrap();
+ assert_eq!(r, route(&doc.clone(), &c).unwrap());
+ // Down out of the bottom, across halfway, down into the point.
+ assert_eq!(r, vec![Point::new(80.0, 160.0), Point::new(80.0, 330.0), Point::new(300.0, 330.0), Point::new(300.0, 500.0)]);
+}
+
+#[test]
+fn stamps_and_ink_and_the_eraser() {
+ let mut s = board();
+ s.prefs.user_name = "Grace".into();
+ let st = id(&s.execute("board.stamp", &json!({"x": 100, "y": 100, "stamp": "heart"})).unwrap(), "id");
+ let n = node(&s, st);
+ assert_eq!(n.board, Some(BoardItem::Stamp { stamp: Stamp::Heart, author: "Grace".into() }));
+ assert_eq!(s.doc().unwrap().world_bounds(st).unwrap().center(), Point::new(100.0, 100.0));
+ assert!(!n.children.is_empty());
+ // Marker and highlighter strokes through the tools; the eraser takes what it touches.
+ let draw = |s: &mut Session, tool: &str, y: f64| {
+ s.execute("tool.set", &json!({"tool": tool})).unwrap();
+ for (k, x) in [(PointerKind::Down, 0.0), (PointerKind::Move, 50.0), (PointerKind::Move, 100.0), (PointerKind::Up, 150.0)] {
+ s.pointer(&PointerEvent::at(k, x, y, 1.0)).unwrap();
+ }
+ };
+ draw(&mut s, "marker", 300.0);
+ draw(&mut s, "highlighter", 400.0);
+ let inks: Vec = s.doc().unwrap().nodes().filter(|n| n.board == Some(BoardItem::Ink)).cloned().collect();
+ assert_eq!(inks.len(), 2);
+ assert!(inks.iter().any(|n| n.opacity < 1.0 && n.stroke.weight > 10.0), "a highlighter stroke");
+ let undo = s.undo_depth().0;
+ s.execute("tool.eraser", &json!({})).unwrap();
+ for (k, x) in [(PointerKind::Down, 20.0), (PointerKind::Move, 60.0), (PointerKind::Up, 80.0)] {
+ s.pointer(&PointerEvent::at(k, x, 300.0, 1.0)).unwrap();
+ }
+ assert_eq!(s.doc().unwrap().nodes().filter(|n| n.board == Some(BoardItem::Ink)).count(), 1, "the marker stroke is gone");
+ assert_eq!(s.undo_depth().0, undo + 1, "one step");
+ assert_eq!(s.tool.tool, ToolId::Eraser);
+}
+
+#[test]
+fn the_sticky_and_connector_tools() {
+ let mut s = board();
+ s.execute("tool.sticky", &json!({"color": "orange"})).unwrap();
+ s.pointer(&PointerEvent::at(PointerKind::Down, 100.0, 100.0, 1.0)).unwrap();
+ s.pointer(&PointerEvent::at(PointerKind::Up, 100.0, 100.0, 1.0)).unwrap();
+ let te = s.ds().unwrap().text_edit.clone().expect("typing in the new sticky");
+ let a = crate::board::owner_of_text(s.doc().unwrap(), te.id).unwrap();
+ assert_eq!(node(&s, a).fills[0].solid_color(), board_color("orange"));
+ crate::textedit::insert(&mut s, "First").unwrap();
+ crate::textedit::end(&mut s).unwrap();
+ let b = id(&s.execute("board.sticky", &json!({"x": 500, "y": 0})).unwrap(), "id");
+ s.execute("tool.connector", &json!({})).unwrap();
+ s.pointer(&PointerEvent::at(PointerKind::Down, 100.0, 100.0, 1.0)).unwrap();
+ s.pointer(&PointerEvent::at(PointerKind::Move, 300.0, 100.0, 1.0)).unwrap();
+ s.pointer(&PointerEvent::at(PointerKind::Up, 600.0, 100.0, 1.0)).unwrap();
+ let c = s.doc().unwrap().nodes().find(|n| matches!(n.board, Some(BoardItem::Connector(_)))).map(|n| n.id).unwrap();
+ let k = connector(&s, c);
+ assert_eq!((k.from.node(), k.to.node()), (Some(a), Some(b)));
+}
+
+#[test]
+fn boards_sync_in_live_sessions() {
+ let mut s = board();
+ let a = id(&s.execute("board.sticky", &json!({"x": 0, "y": 0, "text": "A"})).unwrap(), "id");
+ let mut room = Room::new(s.doc().unwrap().clone(), 2, 7);
+ assert_eq!(room.s(1).doc().unwrap().kind, FileKind::Board, "joiners get a board");
+ let b = id(&room.s(1).execute("board.sticky", &json!({"x": 400, "y": 0, "text": "B"})).unwrap(), "id");
+ room.settle();
+ let c = id(&room.s(0).execute("board.connector", &json!({"from": a, "to": b})).unwrap(), "id");
+ room.s(1).execute("board.stamp", &json!({"x": 50, "y": 50, "stamp": "star"})).unwrap();
+ room.settle();
+ room.check();
+ // Person 1 moves the sticky person 0 connected: both see the connector follow it.
+ room.s(1).execute("transform.move", &json!({"ids": [b], "dx": 0, "dy": 250})).unwrap();
+ room.s(0).execute("board.setColor", &json!({"ids": [a], "color": "violet"})).unwrap();
+ room.settle();
+ room.check();
+ let doc = room.server.document();
+ let NodeKind::Vector { network } = &doc.node(c).unwrap().kind else { panic!("not a vector") };
+ let end = doc.world_transform(c) * network.vertices.last().unwrap().point();
+ assert_eq!(end, Point::new(400.0, 350.0), "to the moved sticky's facing side");
+ assert_eq!(doc.node(a).unwrap().fills[0].solid_color(), board_color("violet"));
+}
+
+#[test]
+fn board_commands_survive_junk() {
+ let junk = [
+ json!({}),
+ json!(null),
+ json!([1]),
+ json!({"x": "NaN", "y": 1e308, "text": 5, "color": [1], "author": {"x": 1}, "parent": "p"}),
+ json!({"x": -1e308, "y": 0, "color": "neon", "shape": 7, "width": -5, "height": 1e308, "stamp": "skull"}),
+ json!({"from": {"x": "a"}, "to": 99_999, "fromSide": "inside", "style": 3, "startCap": "spike", "endCap": 7, "label": [1]}),
+ json!({"from": {"x": 1e308, "y": -1e308}, "to": {"x": 0, "y": 0}, "style": "elbow", "label": "\u{0}"}),
+ json!({"ids": ["x", -1, 99_999], "color": "#GGG", "fontSize": -1, "side": "up", "edit": "yes"}),
+ json!({"id": 2, "text": "", "path": "M0 0 L", "points": [[1]], "highlighter": "yes"}),
+ json!({"path": "M0 0 L 1e308 1e308", "points": [[0, 0], [1e308, 1]]}),
+ ];
+ let ids: Vec<&str> = crate::cmd::all_commands()
+ .iter()
+ .map(|c| c.id)
+ .filter(|i| {
+ i.starts_with("board.")
+ || ["tool.sticky", "tool.shape", "tool.connector", "tool.marker", "tool.highlighter", "tool.eraser", "tool.stamp", "file.newBoard"]
+ .contains(i)
+ })
+ .collect();
+ assert!(ids.len() >= 17, "{ids:?}");
+ for cmd in ids {
+ for j in &junk {
+ let mut s = board();
+ let a = s.execute("board.sticky", &json!({"x": 0, "y": 0})).unwrap()["id"].clone();
+ let b = s.execute("board.shape", &json!({"x": 300, "y": 0})).unwrap()["id"].clone();
+ let _ = s.execute("board.connector", &json!({"from": a, "to": b, "label": "x"}));
+ if let Err(EngineError::Internal { cmd, msg }) = s.execute(cmd, j) {
+ panic!("{cmd} panicked on {j}: {msg}");
+ }
+ }
+ }
+ // Every other command on a board with objects on it.
+ for spec in crate::cmd::all_commands() {
+ if spec.id.starts_with("file.") && spec.id != "file.newBoard" || spec.id == "text.rescanFonts" || spec.id == "image.place" {
+ continue;
+ }
+ for j in &junk[..3] {
+ let mut s = board();
+ let a = s.execute("board.sticky", &json!({"x": 0, "y": 0})).unwrap()["id"].clone();
+ let b = s.execute("board.stamp", &json!({"x": 300, "y": 0})).unwrap()["id"].clone();
+ let _ = s.execute("board.connector", &json!({"from": a, "to": b}));
+ if let Err(EngineError::Internal { cmd, msg }) = s.execute(spec.id, j) {
+ panic!("{cmd} panicked on {j}: {msg}");
+ }
+ }
+ }
+}
+
+#[test]
+fn a_press_on_a_stickys_background_picks_and_drags_it() {
+ let mut s = board();
+ let a = id(&s.execute("board.sticky", &json!({"x": 0, "y": 0, "text": "Hi"})).unwrap(), "id");
+ let b = id(&s.execute("board.sticky", &json!({"x": 400, "y": 0})).unwrap(), "id");
+ let c = id(&s.execute("board.connector", &json!({"from": a, "to": b})).unwrap(), "id");
+ s.execute("select.none", &json!({})).unwrap();
+ // Below the note, on the sticky's own fill (a top-level frame's background is the canvas).
+ s.pointer(&PointerEvent::at(PointerKind::Down, 100.0, 150.0, 1.0)).unwrap();
+ s.pointer(&PointerEvent::at(PointerKind::Move, 100.0, 250.0, 1.0)).unwrap();
+ s.pointer(&PointerEvent::at(PointerKind::Move, 100.0, 450.0, 1.0)).unwrap();
+ s.pointer(&PointerEvent::at(PointerKind::Up, 100.0, 450.0, 1.0)).unwrap();
+ assert_eq!(s.selection(), vec![a]);
+ assert_eq!(node(&s, a).transform.translation().y, 300.0);
+ assert!(near(drawn(&s, c)[0], Point::new(200.0, 400.0)), "the connector followed the drag: {:?}", drawn(&s, c));
+}
+
+#[test]
+fn a_copy_of_joined_objects_joins_the_copies() {
+ let mut s = board();
+ let a = id(&s.execute("board.sticky", &json!({"x": 0, "y": 0})).unwrap(), "id");
+ let b = id(&s.execute("board.sticky", &json!({"x": 400, "y": 0})).unwrap(), "id");
+ let c = id(&s.execute("board.connector", &json!({"from": a, "to": b, "label": "x"})).unwrap(), "id");
+ let label = crate::board::label_of(s.doc().unwrap(), c).unwrap();
+ s.execute("edit.duplicate", &json!({"ids": [a, b, c, label]})).unwrap();
+ let copies = s.selection();
+ assert_eq!(copies.len(), 4, "{copies:?}");
+ let k = copies.iter().find_map(|i| match node(&s, *i).board {
+ Some(BoardItem::Connector(k)) => Some(k),
+ _ => None,
+ });
+ let k = k.unwrap();
+ assert!(copies.contains(&k.from.node().unwrap()) && copies.contains(&k.to.node().unwrap()), "{k:?} {copies:?}");
+ // Copy and paste too.
+ s.execute("select.set", &json!({"ids": [a, b, c]})).unwrap();
+ s.execute("edit.copy", &json!({})).unwrap();
+ s.execute("edit.paste", &json!({})).unwrap();
+ let pasted = s.selection();
+ let k = pasted.iter().find_map(|i| match node(&s, *i).board {
+ Some(BoardItem::Connector(k)) => Some(k),
+ _ => None,
+ });
+ let k = k.unwrap();
+ assert!(pasted.contains(&k.from.node().unwrap()) && pasted.contains(&k.to.node().unwrap()), "{k:?} {pasted:?}");
+}
diff --git a/crates/engine/src/board_tools_tests.rs b/crates/engine/src/board_tools_tests.rs
new file mode 100644
index 00000000..4109adda
--- /dev/null
+++ b/crates/engine/src/board_tools_tests.rs
@@ -0,0 +1,277 @@
+//! Boards, continued: copies and pastes (within a file and from another), routes with named sides
+//! and free points, connectors inside moving sections, styles and labels with their refusals, and
+//! the shape, stamp, highlighter and connector tools with double-clicks.
+
+use figcraft_doc::{BoardItem, BoardShape, End, NodeId, Side, Stamp, StrokeCap, board_color};
+use figcraft_geom::Point;
+use serde_json::json;
+
+use crate::Session;
+use crate::board::route;
+use crate::board_tests::{board, connector, drawn, id, near, node};
+use crate::tools::{PointerEvent, PointerKind, ToolId};
+
+/// The connector among `ids`, if any.
+fn connector_in(s: &Session, ids: &[NodeId]) -> Option {
+ let doc = s.doc().ok()?;
+ ids.iter().find_map(|i| match &doc.node(*i)?.board {
+ Some(BoardItem::Connector(k)) => Some(*k),
+ _ => None,
+ })
+}
+
+#[test]
+fn pasting_into_another_board_detaches_what_was_left_behind() {
+ let mut s = board();
+ let a = id(&s.execute("board.sticky", &json!({"x": 0, "y": 0})).unwrap(), "id");
+ let b = id(&s.execute("board.sticky", &json!({"x": 400, "y": 0})).unwrap(), "id");
+ let r = s.execute("board.connector", &json!({"from": a, "to": b, "style": "straight", "label": "x"})).unwrap();
+ let (c, label) = (id(&r, "id"), id(&r, "label"));
+ let first = s.active;
+ // A second board whose own ids are the same small numbers as the first's.
+ let second = s.execute("file.newBoard", &json!({})).unwrap()["index"].clone();
+ for x in [0, 300, 600, 900] {
+ s.execute("board.sticky", &json!({"x": x, "y": 500})).unwrap();
+ }
+ let others: Vec = s.doc().unwrap().nodes().map(|n| n.id).collect();
+ s.execute("doc.switch", &json!({"index": first})).unwrap();
+ s.execute("select.set", &json!({"ids": [a, c, label]})).unwrap();
+ s.execute("edit.copy", &json!({})).unwrap();
+ s.execute("doc.switch", &json!({"index": second})).unwrap();
+ s.execute("edit.paste", &json!({})).unwrap();
+ let doc = s.doc().unwrap();
+ let pasted = doc.nodes().find(|n| matches!(n.board, Some(BoardItem::Connector(_))) && !others.contains(&n.id)).unwrap().clone();
+ let k = connector(&s, pasted.id);
+ let from = k.from.node().unwrap();
+ assert!(!others.contains(&from) && matches!(doc.node(from).unwrap().board, Some(BoardItem::Sticky { .. })), "joins the pasted sticky");
+ let to = drawn(&s, pasted.id).last().copied().unwrap();
+ assert!(matches!(k.to, End::Point { x, y } if near(Point::new(x, y), to)), "the end left behind stays where it is drawn: {k:?}");
+ let pasted_label = crate::board::label_of(doc, pasted.id).expect("the label came with its connector");
+ assert!(!others.contains(&pasted_label));
+ // A label copied without its connector doesn't come.
+ s.execute("doc.switch", &json!({"index": first})).unwrap();
+ s.execute("select.set", &json!({"ids": [label]})).unwrap();
+ s.execute("edit.copy", &json!({})).unwrap();
+ s.execute("doc.switch", &json!({"index": second})).unwrap();
+ let labels = |s: &Session| s.doc().unwrap().nodes().filter(|n| matches!(n.board, Some(BoardItem::Label { .. }))).count();
+ let before = labels(&s);
+ s.execute("edit.paste", &json!({})).unwrap();
+ assert_eq!(labels(&s), before);
+ // Within its own file, a connector pasted alone stays joined to the same layers.
+ s.execute("doc.switch", &json!({"index": first})).unwrap();
+ s.execute("select.set", &json!({"ids": [c]})).unwrap();
+ s.execute("edit.copy", &json!({})).unwrap();
+ s.execute("edit.paste", &json!({})).unwrap();
+ let k = connector_in(&s, &s.selection()).unwrap();
+ assert_eq!((k.from.node(), k.to.node()), (Some(a), Some(b)));
+}
+
+#[test]
+fn duplicating_and_alt_dragging_keep_connections_inside_copied_sections() {
+ let mut s = board();
+ let sec = id(&s.execute("node.create", &json!({"type": "section", "x": -50, "y": -50, "width": 400, "height": 400})).unwrap(), "id");
+ let a = id(&s.execute("board.sticky", &json!({"x": 50, "y": 50, "parent": sec})).unwrap(), "id");
+ let b = id(&s.execute("board.sticky", &json!({"x": 600, "y": 0})).unwrap(), "id");
+ let c = id(&s.execute("board.connector", &json!({"from": a, "to": b})).unwrap(), "id");
+ s.execute("edit.duplicate", &json!({"ids": [sec, c]})).unwrap();
+ let copies = s.selection();
+ let from = connector_in(&s, &copies).unwrap().from.node().unwrap();
+ let doc = s.doc().unwrap();
+ assert!(from != a && copies.iter().any(|r| doc.is_ancestor(*r, from)), "the copy joins the sticky inside the copied section");
+ // Alt-drag copies the same way.
+ s.execute("select.set", &json!({"ids": [b, c]})).unwrap();
+ let press = |k, x| PointerEvent { alt: true, ..PointerEvent::at(k, x, 100.0, 1.0) };
+ for (k, x) in [(PointerKind::Down, 700.0), (PointerKind::Move, 760.0), (PointerKind::Move, 800.0), (PointerKind::Up, 800.0)] {
+ s.pointer(&press(k, x)).unwrap();
+ }
+ let copies = s.selection();
+ assert_eq!(copies.len(), 2);
+ let k = connector_in(&s, &copies).unwrap();
+ assert!(copies.contains(&k.to.node().unwrap()), "{k:?}");
+}
+
+#[test]
+fn routes_take_named_sides_and_free_points() {
+ let mut s = board();
+ let a = id(&s.execute("board.shape", &json!({"x": 0, "y": 0, "width": 100, "height": 100})).unwrap(), "id");
+ let b = id(&s.execute("board.shape", &json!({"x": 300, "y": 300, "width": 100, "height": 100})).unwrap(), "id");
+ let doc = s.doc().unwrap();
+ let elbow = |from, to| route(doc, &figcraft_doc::Connector { from, to, routing: figcraft_doc::Routing::Elbow }).unwrap();
+ let side = |n, side| End::Node { node: n, side };
+ let p = |x, y| End::Point { x, y };
+ let pt = Point::new;
+ // Side to side: out, across halfway, in.
+ assert_eq!(elbow(side(a, Side::Right), side(b, Side::Left)), vec![pt(100.0, 50.0), pt(200.0, 50.0), pt(200.0, 350.0), pt(300.0, 350.0)]);
+ // A side and a top or bottom: one turn.
+ assert_eq!(elbow(side(a, Side::Right), side(b, Side::Top)), vec![pt(100.0, 50.0), pt(350.0, 50.0), pt(350.0, 300.0)]);
+ assert_eq!(elbow(side(a, Side::Bottom), side(b, Side::Left)), vec![pt(50.0, 100.0), pt(50.0, 350.0), pt(300.0, 350.0)]);
+ // Two free points: the longer way first; in a line, no turns.
+ assert_eq!(elbow(p(0.0, 0.0), p(100.0, 40.0)), vec![pt(0.0, 0.0), pt(50.0, 0.0), pt(50.0, 40.0), pt(100.0, 40.0)]);
+ assert_eq!(elbow(p(0.0, 0.0), p(100.0, 0.0)), vec![pt(0.0, 0.0), pt(100.0, 0.0)]);
+ // An automatic side faces the other end.
+ let straight = route(doc, &figcraft_doc::Connector { from: side(a, Side::Auto), to: p(50.0, 500.0), routing: figcraft_doc::Routing::Straight });
+ assert_eq!(straight.unwrap(), vec![pt(50.0, 100.0), pt(50.0, 500.0)]);
+ assert_eq!(Side::from_id("TOP"), Some(Side::Top));
+ assert_eq!(Side::from_id("inside"), None);
+ // The same place twice is refused, as are a side that doesn't exist and a point without numbers.
+ assert!(s.execute("board.connector", &json!({"from": {"x": 5, "y": 5}, "to": {"x": 5, "y": 5}})).is_err());
+ assert!(s.execute("board.connector", &json!({"from": a, "to": b, "fromSide": "inside"})).is_err());
+ assert!(s.execute("board.connector", &json!({"from": a, "to": {"x": "a"}})).is_err());
+ assert!(s.execute("board.connector", &json!({"from": a})).is_err());
+}
+
+#[test]
+fn a_connector_follows_a_layer_whose_section_moves_and_ignores_unrelated_edits() {
+ let mut s = board();
+ let sec = id(&s.execute("node.create", &json!({"type": "section", "x": 0, "y": 0, "width": 300, "height": 300})).unwrap(), "id");
+ let a = id(&s.execute("board.sticky", &json!({"x": 50, "y": 50, "parent": sec})).unwrap(), "id");
+ let b = id(&s.execute("board.stamp", &json!({"x": 800, "y": 150})).unwrap(), "id");
+ let c = id(&s.execute("board.connector", &json!({"from": a, "to": b, "style": "straight"})).unwrap(), "id");
+ assert!(near(drawn(&s, c)[0], Point::new(250.0, 150.0)));
+ // Only the section is edited; the sticky inside it moves with it, and so does the connector.
+ s.execute("transform.move", &json!({"ids": [sec], "dx": 0, "dy": 100})).unwrap();
+ assert!(near(drawn(&s, c)[0], Point::new(250.0, 250.0)), "{:?}", drawn(&s, c));
+ // An edit that touches neither end leaves the connector as it was.
+ let before = s.doc().unwrap().node_arc(c).cloned().unwrap();
+ s.execute("board.sticky", &json!({"x": 0, "y": 900})).unwrap();
+ assert!(std::sync::Arc::ptr_eq(&before, s.doc().unwrap().node_arc(c).unwrap()));
+}
+
+#[test]
+fn styles_labels_and_their_refusals() {
+ let mut s = board();
+ let a = id(&s.execute("board.sticky", &json!({"x": 0, "y": 0, "author": false})).unwrap(), "id");
+ assert_eq!(node(&s, a).children.len(), 1, "no author line");
+ let b = id(&s.execute("board.sticky", &json!({"x": 400, "y": 0, "author": " Lin "})).unwrap(), "id");
+ assert!(matches!(node(&s, b).board, Some(BoardItem::Sticky { ref author }) if author == "Lin"));
+ let c = id(&s.execute("board.connector", &json!({"from": a, "to": b, "startCap": "circleFilled", "endCap": "none"})).unwrap(), "id");
+ assert_eq!((node(&s, c).stroke.cap_start, node(&s, c).stroke.cap_end), (StrokeCap::CircleFilled, StrokeCap::None));
+ // Labels: set, change, size, remove; named by the label itself too.
+ let l = id(&s.execute("board.label", &json!({"id": c, "text": "first"})).unwrap(), "label");
+ assert_eq!(id(&s.execute("board.label", &json!({"id": l, "text": "second"})).unwrap(), "label"), l, "the same label, new text");
+ let text = crate::board::text_of(s.doc().unwrap(), l).unwrap();
+ assert_eq!(node(&s, text).kind.text().unwrap().characters, "second");
+ s.execute("board.setStyle", &json!({"ids": [l], "fontSize": 36})).unwrap();
+ assert_eq!(node(&s, text).kind.text().unwrap().style.font_size, 36.0);
+ assert!(s.execute("board.label", &json!({"id": c, "text": ""})).unwrap()["label"].is_null());
+ assert!(!s.doc().unwrap().contains(l));
+ // What doesn't take a style or colour says so.
+ assert!(s.execute("board.setStyle", &json!({"ids": [a], "fontSize": 30})).is_err(), "stickies size their own text");
+ assert!(s.execute("board.setStyle", &json!({"ids": [c], "fontSize": 0})).is_err());
+ let st = id(&s.execute("board.stamp", &json!({"x": 0, "y": 0, "stamp": "check"})).unwrap(), "id");
+ assert!(s.execute("board.setColor", &json!({"ids": [st], "color": "blue"})).is_err());
+ assert!(s.execute("board.setColor", &json!({"ids": [a]})).is_err());
+ assert!(s.execute("board.label", &json!({"id": a, "text": "x"})).is_err());
+ // A palette colour on a line draws in its deeper shade; a hex colour as given.
+ s.execute("board.setColor", &json!({"ids": [c], "color": "blue"})).unwrap();
+ assert!(node(&s, c).strokes[0].solid_color().is_some() && node(&s, c).strokes[0].solid_color() != board_color("blue"));
+ s.execute("board.setColor", &json!({"ids": [c], "color": "#123456"})).unwrap();
+ assert_eq!(node(&s, c).strokes[0].solid_color().map(|c| c.to_hex()), Some("123456".into()));
+ // Next stickies on each side, and refusals.
+ for (side, dx, dy) in [("below", 0.0, 224.0), ("left", -224.0, 0.0), ("above", 0.0, -224.0)] {
+ let n = id(&s.execute("board.nextSticky", &json!({"id": a, "side": side})).unwrap(), "id");
+ let t = node(&s, n).transform.translation();
+ assert_eq!((t.x, t.y), (dx, dy), "{side}");
+ }
+ assert!(s.execute("board.nextSticky", &json!({"id": a, "side": "diagonal"})).is_err());
+ assert!(s.execute("board.nextSticky", &json!({"id": c})).is_err());
+ assert!(s.execute("board.ink", &json!({})).is_err());
+ assert!(s.execute("board.sticky", &json!({"x": 0, "y": 0, "parent": c})).is_err(), "a connector holds no layers");
+}
+
+#[test]
+fn the_shape_stamp_highlighter_and_connector_tools_and_double_clicks() {
+ let mut s = board();
+ let click = |s: &mut Session, x, y| {
+ s.pointer(&PointerEvent::at(PointerKind::Down, x, y, 1.0)).unwrap();
+ s.pointer(&PointerEvent::at(PointerKind::Up, x, y, 1.0)).unwrap();
+ };
+ s.execute("tool.shape", &json!({"shape": "roundedRectangle"})).unwrap();
+ click(&mut s, 100.0, 100.0);
+ let sh = s.selection()[0];
+ assert_eq!(node(&s, sh).board, Some(BoardItem::Shape { shape: BoardShape::RoundedRectangle }));
+ assert_eq!(s.tool.tool, ToolId::Move, "back to Move after placing");
+ s.execute("tool.stamp", &json!({"stamp": "question"})).unwrap();
+ click(&mut s, 400.0, 100.0);
+ click(&mut s, 450.0, 100.0);
+ let stamps = s.doc().unwrap().nodes().filter(|n| matches!(n.board, Some(BoardItem::Stamp { stamp: Stamp::Question, .. }))).count();
+ assert_eq!(stamps, 2);
+ assert_eq!(s.tool.tool, ToolId::Stamp, "stamps go on one after another");
+ assert!(s.execute("tool.stamp", &json!({"stamp": "skull"})).is_err());
+ s.execute("tool.highlighter", &json!({"color": "pink"})).unwrap();
+ assert_eq!(Some(s.tool.board.highlighter), board_color("pink"));
+ s.execute("tool.marker", &json!({"color": "#336699"})).unwrap();
+ assert_eq!(s.tool.board.marker.to_hex(), "336699");
+ // A connector drag that is only a click, or from an object to itself, makes nothing.
+ s.execute("tool.connector", &json!({"style": "straight"})).unwrap();
+ click(&mut s, 100.0, 100.0);
+ s.pointer(&PointerEvent::at(PointerKind::Down, 60.0, 120.0, 1.0)).unwrap();
+ s.pointer(&PointerEvent::at(PointerKind::Move, 100.0, 140.0, 1.0)).unwrap();
+ assert!(s.tool.overlay.rubber.is_some(), "the rubber band shows while dragging");
+ s.pointer(&PointerEvent::at(PointerKind::Up, 100.0, 140.0, 1.0)).unwrap();
+ assert!(!s.doc().unwrap().nodes().any(|n| matches!(n.board, Some(BoardItem::Connector(_)))));
+ // From the shape out to empty canvas: a connector to a free point.
+ s.pointer(&PointerEvent::at(PointerKind::Down, 80.0, 140.0, 1.0)).unwrap();
+ s.pointer(&PointerEvent::at(PointerKind::Up, 80.0, 600.0, 1.0)).unwrap();
+ let c = s.doc().unwrap().nodes().find(|n| matches!(n.board, Some(BoardItem::Connector(_)))).map(|n| n.id).unwrap();
+ assert!(matches!(connector(&s, c).to, End::Point { .. }));
+ // Double-clicks: on the shape its text, on the connector a new label, both typed into.
+ s.execute("tool.move", &json!({})).unwrap();
+ s.execute("select.none", &json!({})).unwrap();
+ s.pointer(&PointerEvent::at(PointerKind::DoubleClick, 80.0, 140.0, 1.0)).unwrap();
+ let te = s.ds().unwrap().text_edit.clone().expect("typing in the shape");
+ assert_eq!(crate::board::owner_of_text(s.doc().unwrap(), te.id), Some(sh));
+ crate::textedit::end(&mut s).unwrap();
+ let line = drawn(&s, c);
+ let m = line[0].midpoint(line[1]);
+ s.pointer(&PointerEvent::at(PointerKind::DoubleClick, m.x, m.y, 1.0)).unwrap();
+ let label = crate::board::label_of(s.doc().unwrap(), c).expect("a label was added");
+ let te = s.ds().unwrap().text_edit.clone().expect("typing in the label");
+ assert_eq!(crate::board::owner_of_text(s.doc().unwrap(), te.id), Some(label));
+}
+
+#[test]
+fn an_ink_stroke_ends_where_the_button_comes_up() {
+ let mut s = board();
+ s.execute("tool.marker", &json!({})).unwrap();
+ // Down and up with no move between: the stroke still runs from the press to the release.
+ s.pointer(&PointerEvent::at(PointerKind::Down, 0.0, 0.0, 1.0)).unwrap();
+ s.pointer(&PointerEvent::at(PointerKind::Up, 150.0, 0.0, 1.0)).unwrap();
+ let doc = s.doc().unwrap();
+ let ink = doc.nodes().find(|n| matches!(n.board, Some(BoardItem::Ink))).map(|n| n.id).expect("a stroke");
+ let b = doc.world_bounds(ink).unwrap();
+ assert!(b.x0.abs() < 6.0 && (b.x1 - 150.0).abs() < 6.0, "from 0 to 150 (stroke width aside): {b:?}");
+}
+
+#[test]
+fn a_second_sticky_ends_the_first_ones_typing_and_undoes_alone() {
+ let mut s = board();
+ s.execute("tool.sticky", &json!({})).unwrap();
+ s.prefs.keep_tool = true;
+ s.pointer(&PointerEvent::at(PointerKind::Down, 100.0, 100.0, 1.0)).unwrap();
+ s.pointer(&PointerEvent::at(PointerKind::Up, 100.0, 100.0, 1.0)).unwrap();
+ let text = s.ds().unwrap().text_edit.as_ref().expect("typing in the new sticky").id;
+ crate::textedit::insert(&mut s, "first note").unwrap();
+ s.pointer(&PointerEvent::at(PointerKind::Down, 500.0, 100.0, 1.0)).unwrap();
+ s.pointer(&PointerEvent::at(PointerKind::Up, 500.0, 100.0, 1.0)).unwrap();
+ let stickies = |s: &Session| s.doc().unwrap().nodes().filter(|n| matches!(n.board, Some(BoardItem::Sticky { .. }))).count();
+ let typed = |s: &Session| s.doc().unwrap().node(text).unwrap().kind.text().unwrap().characters.clone();
+ assert_eq!(stickies(&s), 2);
+ crate::textedit::end(&mut s).unwrap();
+ s.undo().unwrap();
+ assert_eq!(stickies(&s), 1, "the second sticky is its own undo step");
+ assert_eq!(typed(&s), "first note", "the first sticky keeps what was typed in it");
+}
+
+#[test]
+fn a_board_tool_left_on_presses_as_move_in_a_design_file() {
+ let mut s = board();
+ s.execute("tool.sticky", &json!({})).unwrap();
+ s.execute("file.new", &json!({})).unwrap();
+ let r = id(&s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 100, "height": 100})).unwrap(), "id");
+ s.execute("select.none", &json!({})).unwrap();
+ s.pointer(&PointerEvent::at(PointerKind::Down, 50.0, 50.0, 1.0)).unwrap();
+ s.pointer(&PointerEvent::at(PointerKind::Up, 50.0, 50.0, 1.0)).unwrap();
+ assert_eq!(s.tool.tool, ToolId::Move);
+ assert_eq!(s.selection(), vec![r], "the press selected as Move does");
+}
diff --git a/crates/engine/src/catalog.rs b/crates/engine/src/catalog.rs
index 4b6cd3fc..5180b340 100644
--- a/crates/engine/src/catalog.rs
+++ b/crates/engine/src/catalog.rs
@@ -21,8 +21,9 @@ pub const SEP: &str = "-";
pub static MENU: &[MenuItem] = &[
// File
m!("File", "New design file", "file.new"),
- // FigCraft's own: starter templates (not counted by `parity`, like the other items of its own
- // listed in `OWN`).
+ m!("File", "New board", "file.newBoard"),
+ // FigCraft's own: boards and starter templates (not counted by `parity`, like the other items
+ // of its own listed in `OWN`).
m!("File", "New from template…", "file.newFromTemplate"),
m!("File", "New window", "window.new"),
m!("File", "Open…", "file.open"),
@@ -289,7 +290,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; 3] = ["file.newFromTemplate", "help.gettingStarted", "text.missingFonts"];
+const OWN: [&str; 4] = ["file.newFromTemplate", "file.newBoard", "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/create.rs b/crates/engine/src/cmd/create.rs
index 3a9f6d67..33c611a9 100644
--- a/crates/engine/src/cmd/create.rs
+++ b/crates/engine/src/cmd/create.rs
@@ -111,7 +111,8 @@ pub fn frame_at(doc: &Document, page: NodeId, pt: Point, exclude: &[NodeId]) ->
return None;
}
let n = doc.node(id)?;
- if !n.visible || n.locked {
+ // Board objects (stickies, shapes with text) never take layers in.
+ if !n.visible || n.locked || n.is_board_atom() {
return None;
}
let is_container = n.kind.is_frame_like() || matches!(n.kind, NodeKind::Section { .. });
diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs
index a16fbb38..2225133b 100644
--- a/crates/engine/src/cmd/edit.rs
+++ b/crates/engine/src/cmd/edit.rs
@@ -494,6 +494,9 @@ fn duplicate(s: &mut Session, p: &Value) -> Result
{
}
out.push(nid);
}
+ // Board connectors copied with what they join join the copies.
+ let map = crate::board::copy_map(doc, &ids, &out);
+ crate::board::rejoin(doc, &crate::board::copied_items(doc, &map), &map, false);
s.set_selection(out.clone());
s.ds_mut()?.last_duplicate = Some(Duplicated { sources: ids, copies: out.clone() });
Ok(json!({"ids": out}))
@@ -675,6 +678,10 @@ pub fn paste_into(s: &mut Session, parent: NodeId, at: Option<(f64, f64)>) -> Re
out.push(doc.paste_nodes(&nodes, &map, *root, into, None)?);
all.extend(map);
}
+ // Board connectors pasted with what they join join the pasted copies.
+ let originals: Vec<(NodeId, figcraft_doc::BoardItem)> =
+ clip.nodes.iter().flat_map(|(_, nodes)| nodes).filter_map(|n| Some((*all.get(&n.id)?, n.board.clone()?))).collect();
+ crate::board::rejoin(doc, &originals, &all, !copy_local);
if let Some(src) = foreign {
crate::library::adopt_pasted(doc, src, clip.source_path.as_deref(), &all)?;
}
@@ -691,7 +698,10 @@ fn paste(s: &mut Session, p: &Value) -> Result {
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| {
+ sel.len() == 1
+ && doc.node(*i).is_some_and(|n| n.kind.is_frame_like() && !matches!(n.kind, NodeKind::Instance { .. }) && !n.is_board_atom())
+ })
.filter(|i| !copy_local || !s.clipboard.copied_components.iter().any(|root| doc.is_ancestor(*root, *i)))
});
let parent = target.unwrap_or(page);
diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs
index 7380711f..d8ad924d 100644
--- a/crates/engine/src/cmd/file.rs
+++ b/crates/engine/src/cmd/file.rs
@@ -11,22 +11,34 @@ use super::{CommandSpec, ok};
use crate::params::*;
use crate::{DocState, EngineError, Result, Session, bad, spec};
+/// A new file of `kind` in a tab of its own.
+fn new_file(s: &mut Session, p: &Value, kind: FileKind) -> Result {
+ let name = string(p, "name").unwrap_or_else(|| if kind == FileKind::Board { "Untitled board" } else { "Untitled" }.into());
+ let mut doc = Document::new(name);
+ doc.kind = kind;
+ // A property of the page from here on: a later change of theme leaves it alone. Boards are
+ // light whatever the theme.
+ let background = if kind == FileKind::Board { BOARD_PAGE } else { s.new_page_background() };
+ for page in doc.pages.clone() {
+ if let Some(NodeKind::Page { background: b, .. }) = doc.node_mut(page).map(|n| &mut n.kind) {
+ *b = background;
+ }
+ }
+ s.docs.push(DocState::new(doc, None));
+ s.active = s.docs.len() - 1;
+ Ok(json!({"index": s.active, "kind": kind.id()}))
+}
+
pub fn specs() -> Vec {
vec![
- spec!("file.new", "New design file", "{name?}", false, |s, p| {
- let name = string(p, "name").unwrap_or_else(|| "Untitled".into());
- let mut doc = Document::new(name);
- // A property of the page from here on: a later change of theme leaves it alone.
- let background = s.new_page_background();
- for page in doc.pages.clone() {
- if let Some(NodeKind::Page { background: b, .. }) = doc.node_mut(page).map(|n| &mut n.kind) {
- *b = background;
- }
- }
- s.docs.push(DocState::new(doc, None));
- s.active = s.docs.len() - 1;
- Ok(json!({"index": s.active}))
- }),
+ spec!("file.new", "New design file", "{name?}", false, |s, p| new_file(s, p, FileKind::Design)),
+ spec!(
+ "file.newBoard",
+ "New board",
+ "{name?} a board: sticky notes, shapes with text, connectors, marker and stamps on a light page",
+ false,
+ |s, p| new_file(s, p, FileKind::Board)
+ ),
spec!(
"file.open",
"Open",
@@ -366,7 +378,7 @@ fn version_index(cmd: &str, ds: &DocState, p: &Value) -> Result {
if i < ds.versions.len() { Ok(i) } else { Err(bad(cmd, format!("no version at index {i}"))) }
}
-fn read_version(v: &Version) -> Result> {
+pub(crate) fn read_version(v: &Version) -> Result> {
v.document().map_err(|e| EngineError::Other(format!("version “{}” can't be read: {e}", v.name)))
}
diff --git a/crates/engine/src/cmd/mod.rs b/crates/engine/src/cmd/mod.rs
index f011238d..60d08963 100644
--- a/crates/engine/src/cmd/mod.rs
+++ b/crates/engine/src/cmd/mod.rs
@@ -109,6 +109,7 @@ fn registry() -> &'static Registry {
list.extend(crate::online::specs());
list.extend(crate::invite_links::specs());
list.extend(crate::templates::specs());
+ list.extend(crate::board::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/cmd/props.rs b/crates/engine/src/cmd/props.rs
index f180b53c..3ed0f9b0 100644
--- a/crates/engine/src/cmd/props.rs
+++ b/crates/engine/src/cmd/props.rs
@@ -533,8 +533,12 @@ pub fn apply(cmd: &str, doc: &mut Document, id: NodeId, props: &Map Vec {
spec!(
"dev.compare",
"Compare changes",
- "{id? (default the first selected layer), show? (open the compare view in the app)} → {id, name, changed, snapshot, added, removed, modified, truncated, changes: [{id, name, type, change: added|removed|changed, depth, layers, properties?: [{section, property, before, after, text}]}]} what changed in a ready-for-dev frame or section since it was marked (`snapshot` is false when that isn't known: a file from before snapshots were kept)",
+ "{id? (default the first selected layer), version? (a version id from version.list: compare with that saved version instead; any top-level frame or section), show? (open the compare view in the app)} → {id, name, changed, snapshot, added, removed, modified, truncated, version: {id, name, time} | null, changes: [{id, name, type, change: added|removed|changed, depth, layers, properties?: [{section, property, before, after, text}]}]} what changed in a ready-for-dev frame or section since it was marked, or since the version (`snapshot` is false when that isn't known: a file from before snapshots were kept)",
false,
compare
),
@@ -104,14 +104,30 @@ fn resolve_change(s: &mut Session, p: &Value) -> Result {
fn compare(s: &mut Session, p: &Value) -> Result {
let cmd = "dev.compare";
let id = targets(s, p).first().copied().ok_or_else(|| bad(cmd, "select a frame or section or pass `id`"))?;
- let doc = s.doc()?;
+ let version = match get(p, "version") {
+ None | Some(Value::Null) => None,
+ Some(Value::String(v)) => Some(v.clone()),
+ Some(_) => return Err(bad(cmd, "version: a version id (version.list)")),
+ };
+ let ds = s.ds()?;
+ let doc = &ds.doc;
let n = doc.node(id).ok_or_else(|| bad(cmd, "no such layer"))?;
- if !has_status(doc, id) || n.dev_status != DevStatus::ReadyForDev {
- return Err(bad(cmd, "compare a frame or section marked ready for dev"));
+ if !has_status(doc, id) {
+ return Err(bad(cmd, "compare a top-level frame or a section"));
}
- let v = serde_json::to_value(crate::devcompare::compare(doc, id)).unwrap_or(Value::Null);
+ let (cmp, against) = match &version {
+ Some(v) => {
+ let ver = ds.versions.iter().find(|x| x.id == *v).ok_or_else(|| bad(cmd, format!("no version `{v}`")))?;
+ let before = crate::cmd::file::read_version(ver)?;
+ (crate::devcompare::compare_with(&before, doc, id), json!({"id": ver.id, "name": ver.name, "time": ver.time}))
+ }
+ None if n.dev_status != DevStatus::ReadyForDev => return Err(bad(cmd, "compare a frame or section marked ready for dev, or pass `version`")),
+ None => (crate::devcompare::compare(doc, id), Value::Null),
+ };
+ let mut v = serde_json::to_value(cmp).unwrap_or(Value::Null);
+ v["version"] = against;
if boolean(p, "show") == Some(true) {
- s.request_ui("view.devCompare", json!({"id": id}));
+ s.request_ui("view.devCompare", json!({"id": id, "version": version}));
}
Ok(v)
}
diff --git a/crates/engine/src/cmd/view.rs b/crates/engine/src/cmd/view.rs
index 0592046e..0905284c 100644
--- a/crates/engine/src/cmd/view.rs
+++ b/crates/engine/src/cmd/view.rs
@@ -200,7 +200,7 @@ fn pref(s: &mut Session, p: &Value, f: fn(&mut crate::Prefs) -> &mut bool) -> Re
Ok(json!({"on": *slot}))
}
-fn tool(s: &mut Session, t: ToolId) -> Result {
+pub(crate) fn tool(s: &mut Session, t: ToolId) -> Result {
// A file you can't edit now (view only, or on its way to a server): moving around only.
if let Some(why) = s.active_read_only().filter(|_| !matches!(t, ToolId::Move | ToolId::Hand)) {
return Err(EngineError::Disabled(format!("tool.{}", t.id()), why.into()));
@@ -465,11 +465,14 @@ pub fn specs() -> Vec {
spec!(
"tool.set",
"Choose tool",
- "{tool: move|scale|hand|frame|section|slice|rectangle|line|arrow|ellipse|polygon|star|pen|pencil|text|comment|shapeBuilder}",
+ "{tool: move|scale|hand|frame|section|slice|rectangle|line|arrow|ellipse|polygon|star|pen|pencil|text|comment|shapeBuilder | on boards: sticky|shape|connector|marker|highlighter|eraser|stamp}",
false,
|s, p| {
let t = req_string("tool.set", p, "tool")?;
let t = ToolId::from_id(&t).ok_or_else(|| bad("tool.set", format!("unknown tool `{t}`")))?;
+ if t.on_boards() {
+ crate::board::require(s, &format!("tool.{}", t.id()))?;
+ }
tool(s, t)
}
),
diff --git a/crates/engine/src/code_connect.rs b/crates/engine/src/code_connect.rs
index 46340636..08b3af02 100644
--- a/crates/engine/src/code_connect.rs
+++ b/crates/engine/src/code_connect.rs
@@ -14,9 +14,9 @@ use figcraft_doc::*;
use serde_json::{Value, json};
use crate::cmd::CommandSpec;
-use crate::codegen::CodeLang;
+use crate::codegen::{CodeLang, Ctx};
use crate::component_codegen::{Component, Param, ParamKind, describe, instance_values, js_string, main_of, value_expr};
-use crate::components::variant_set;
+use crate::components::{slots_of, variant_set};
use crate::params::*;
use crate::{EngineError, Result, Session, bad, spec};
@@ -70,14 +70,106 @@ pub fn import_line(link: &CodeLink, lang: CodeLang) -> String {
}
}
-/// Layer `id`'s code with `link`: the import line and the snippet (an instance's values, else the
-/// defaults). `None` when `id` isn't a component, set or instance.
+/// Layer `id`'s code with `link`: the import lines (its own and those of connected components its
+/// instance swaps place) and the snippet (an instance's values, else the defaults). `None` when
+/// `id` isn't a component, set or instance.
pub fn connected_code(doc: &Document, id: NodeId, lang: CodeLang, link: &CodeLink) -> Option {
let c = main_of(doc, id).and_then(|m| describe(doc, m))?;
let values = instance_values(doc, id, &c).unwrap_or_else(|| c.params.iter().map(|p| (p.prop.clone(), p.default.clone())).collect());
- let snippet = render(doc, &c, &values, link, lang, "");
- let import = import_line(link, lang);
- Some(if import.is_empty() { snippet } else { format!("{import}\n\n{snippet}") })
+ let mut imports = Vec::new();
+ snippet_imports(doc, &c, &values, link, lang, &mut imports);
+ Some(with_imports(&imports, render(doc, &c, &values, link, lang, "")))
+}
+
+/// `code` with `imports` at the top: joined to the import block it starts with, else apart.
+pub fn with_imports(imports: &[String], code: String) -> String {
+ match imports.join("\n") {
+ i if i.is_empty() => code,
+ i if code.starts_with("import ") || code.starts_with("use ") => format!("{i}\n{code}"),
+ i => format!("{i}\n\n{code}"),
+ }
+}
+
+/// Adds `line` to `out` unless it's empty or already there.
+fn add(out: &mut Vec, line: String) {
+ if !line.is_empty() && !out.contains(&line) {
+ out.push(line);
+ }
+}
+
+/// The import lines a connected snippet needs: its own and those of the connected components its
+/// instance swaps place (the ones its template shows).
+fn snippet_imports(doc: &Document, c: &Component, values: &[(String, Value)], link: &CodeLink, lang: CodeLang, out: &mut Vec) {
+ add(out, import_line(link, lang));
+ for piece in pieces(&link.template) {
+ if let Piece::Value { name, .. } = piece
+ && let Some((p, v)) = find(c, values, name)
+ && p.kind == ParamKind::InstanceSwap
+ && let Some(l) = id_of(v).and_then(|i| self::link(doc, i, lang))
+ {
+ add(out, import_line(l, lang));
+ }
+ }
+}
+
+/// The import lines of the connected components the generated code of layer `id` calls
+/// (instances in its tree, in a component's definition and in the slots an instance fills), once
+/// each in tree order. A connected `id` shows its snippet ([`connected_code`]) instead.
+pub fn tree_imports(doc: &Document, id: NodeId, lang: CodeLang) -> Vec {
+ let mut out = Vec::new();
+ let Some(n) = doc.node(id) else { return out };
+ let c = main_of(doc, id).and_then(|m| describe(doc, m));
+ match (&n.kind, &c) {
+ // Its call (the slots it fills), then its component's definition.
+ (NodeKind::Instance { .. }, Some(c)) => {
+ call_imports(doc, id, lang, 0, &mut out);
+ tree(&Ctx { doc, root: c.comp, comp: Some(c), base: 0 }, c.comp, lang, 0, &mut out);
+ }
+ (NodeKind::Component { .. } | NodeKind::ComponentSet { .. }, Some(c)) => {
+ tree(&Ctx { doc, root: c.comp, comp: Some(c), base: 0 }, c.comp, lang, 0, &mut out)
+ }
+ _ => tree(&Ctx::new(doc, id), id, lang, 0, &mut out),
+ }
+ out
+}
+
+/// Imports under layer `id` as the code walk sees it: its visible children, instances as calls
+/// (one an instance swap parameter places is that parameter). shortcut: the depth cap counts from
+/// the tree's root, not from each slot's; align them if a deep slot tree shows a stray import.
+fn tree(ctx: &Ctx, id: NodeId, lang: CodeLang, depth: usize, out: &mut Vec) {
+ let Some(n) = ctx.doc.node(id) else { return };
+ if ctx.too_deep(depth) {
+ return;
+ }
+ for k in ctx.kids(n) {
+ let Some(kn) = ctx.doc.node(k) else { continue };
+ let call = matches!(kn.kind, NodeKind::Instance { .. }) && main_of(ctx.doc, k).is_some();
+ match (call, ctx.param(kn, "mainComponent")) {
+ (true, Some(_)) => {}
+ (true, None) => call_imports(ctx.doc, k, lang, depth + 1, out),
+ (false, _) => tree(ctx, k, lang, depth + 1, out),
+ }
+ }
+}
+
+/// The imports instance `id` placed as a call brings: a connected one's snippet's, else those of
+/// the content it puts in its slots.
+fn call_imports(doc: &Document, id: NodeId, lang: CodeLang, depth: usize, out: &mut Vec) {
+ let Some(c) = main_of(doc, id).and_then(|m| describe(doc, m)) else { return };
+ let Some(values) = instance_values(doc, id, &c) else { return };
+ if let Some(l) = link(doc, id, lang) {
+ return snippet_imports(doc, &c, &values, l, lang, out);
+ }
+ let slots = slots_of(doc, id);
+ for (p, (_, v)) in c.params.iter().zip(&values) {
+ if p.kind == ParamKind::Slot
+ && v.as_bool() == Some(true)
+ && let Some((slot, _)) = slots.iter().find(|(_, name)| *name == p.prop)
+ {
+ // The same depth base as the slot's generated content, so its connected children count.
+ tree(&Ctx { doc, root: *slot, comp: None, base: depth }, *slot, lang, depth + 1, out);
+ }
+ }
}
// ------------------------------------------------------------------ templates
@@ -180,14 +272,17 @@ fn expr(doc: &Document, c: &Component, p: &Param, v: &Value, lang: CodeLang) ->
}
}
+/// Template `t` as pieces. One that doesn't parse, or that skipped `check` (a hand-edited file)
+/// and is far too long, stays as written: parsing rescans after each literal brace.
+fn pieces(t: &str) -> Vec> {
+ let checkable = t.len() <= MAX_TEMPLATE * 4;
+ checkable.then(|| parse(t).ok()).flatten().unwrap_or_else(|| vec![Piece::Text(t)])
+}
+
/// `link`'s template with `values` (one per parameter of `c`), every line prefixed by `pad`.
pub(crate) fn render(doc: &Document, c: &Component, values: &[(String, Value)], link: &CodeLink, lang: CodeLang, pad: &str) -> String {
- // A template that skipped `check` (a hand-edited file) and is far too long stays as written:
- // parsing rescans after each literal brace.
- let checkable = link.template.len() <= MAX_TEMPLATE * 4;
- let pieces = checkable.then(|| parse(&link.template).ok()).flatten().unwrap_or_else(|| vec![Piece::Text(&link.template)]);
let mut out = String::new();
- for piece in pieces {
+ for piece in pieces(&link.template) {
match piece {
Piece::Text(t) => out.push_str(t),
Piece::Value { name, inner } => match find(c, values, name) {
diff --git a/crates/engine/src/codegen.rs b/crates/engine/src/codegen.rs
index 0871f886..7ed81b30 100644
--- a/crates/engine/src/codegen.rs
+++ b/crates/engine/src/codegen.rs
@@ -231,7 +231,7 @@ impl<'a> Ctx<'a> {
.collect()
}
- fn too_deep(&self, depth: usize) -> bool {
+ pub(crate) fn too_deep(&self, depth: usize) -> bool {
depth > self.base + MAX_DEPTH
}
diff --git a/crates/engine/src/component_codegen.rs b/crates/engine/src/component_codegen.rs
index 1416b15f..a8217be1 100644
--- a/crates/engine/src/component_codegen.rs
+++ b/crates/engine/src/component_codegen.rs
@@ -109,14 +109,14 @@ 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).
+/// in a function component), with the imports of the connected components it calls at the top.
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)) {
return code;
}
let comp = main_of(doc, id).and_then(|m| describe(doc, m));
- match (&n.kind, comp) {
+ let code = match (&n.kind, comp) {
(NodeKind::Instance { .. }, Some(c)) => format!("{}\n{}", usage(doc, id, lang, 0).unwrap_or_default(), definition(doc, &c, lang)),
(NodeKind::Component { .. } | NodeKind::ComponentSet { .. }, Some(c)) => definition(doc, &c, lang),
_ => match lang {
@@ -135,7 +135,8 @@ pub fn code(doc: &Document, id: NodeId, lang: CodeLang) -> String {
out
}
},
- }
+ };
+ crate::code_connect::with_imports(&crate::code_connect::tree_imports(doc, id, lang), code)
}
fn is_component(doc: &Document, id: NodeId) -> bool {
@@ -521,8 +522,7 @@ pub fn usage(doc: &Document, id: NodeId, lang: CodeLang, depth: usize) -> Option
let c = main_of(doc, id).and_then(|m| describe(doc, m))?;
let values = instance_values(doc, id, &c)?;
let pad = if lang == CodeLang::React { " ".repeat(depth) } else { indent(depth) };
- // A connected component: its real snippet. shortcut: inside a layer tree it brings no import
- // line; collect them at the top of the tree's code when people ask for it.
+ // A connected component: its real snippet (its import is at the top of the code: `code`).
if let Some(link) = crate::code_connect::link(doc, id, lang) {
return Some(crate::code_connect::render(doc, &c, &values, link, lang, &pad));
}
diff --git a/crates/engine/src/devcompare.rs b/crates/engine/src/devcompare.rs
index 58cf9aa8..ef40a2fb 100644
--- a/crates/engine/src/devcompare.rs
+++ b/crates/engine/src/devcompare.rs
@@ -1,6 +1,7 @@
//! Dev Mode "Compare changes": what changed in a ready-for-dev frame or section since it was
-//! marked. The document keeps a snapshot of the layer from just before its first change
-//! ([`figcraft_doc::handoff`]); this compares it with the layer as it is now, layer by layer
+//! marked, or in any frame or section since a saved version. The document keeps a snapshot of a
+//! ready-for-dev layer from just before its first change ([`figcraft_doc::handoff`]); this compares
+//! it (or the layer in the version) with the layer as it is now, layer by layer
//! (matched by id): layers added and removed, and for the others their properties formatted the
//! way Inspect shows them (`width 120 → 136`, `fill #FF0000 → #E03030`).
@@ -93,20 +94,25 @@ pub struct Comparison {
pub truncated: bool,
}
-/// The changes to layer `id` since it was marked ready for dev (empty when it hasn't changed).
-pub fn compare(doc: &Document, id: NodeId) -> Comparison {
- let n = doc.node(id);
- let mut out = Comparison {
+/// Nothing compared yet for layer `id` of `doc` (`snapshot` false: the before isn't known).
+pub fn empty(doc: &Document, id: NodeId) -> Comparison {
+ Comparison {
id,
- name: n.map(|n| n.name.clone()).unwrap_or_default(),
- changed: n.is_some_and(|n| n.dev_status == DevStatus::ReadyForDev && n.dev_changed),
+ name: doc.node(id).map(|n| n.name.clone()).unwrap_or_default(),
+ changed: false,
snapshot: false,
changes: Vec::new(),
added: 0,
removed: 0,
modified: 0,
truncated: false,
- };
+ }
+}
+
+/// The changes to layer `id` since it was marked ready for dev (empty when it hasn't changed).
+pub fn compare(doc: &Document, id: NodeId) -> Comparison {
+ let mut out = empty(doc, id);
+ out.changed = doc.node(id).is_some_and(|n| n.dev_status == DevStatus::ReadyForDev && n.dev_changed);
if !out.changed {
return out;
}
@@ -117,6 +123,21 @@ pub fn compare(doc: &Document, id: NodeId) -> Comparison {
out
}
+/// The changes to layer `id` of `now` since `before` (a saved version of the same file: layers
+/// match by id). A layer the version doesn't have was added as a whole.
+pub fn compare_with(before: &Document, now: &Document, id: NodeId) -> Comparison {
+ let mut out = empty(now, id);
+ out.snapshot = true;
+ let mut w = Walk { before, now, now_ids: bounded_set(now, id), before_ids: bounded_set(before, id), out: &mut out };
+ if before.contains(id) {
+ w.layer(id, 0);
+ } else {
+ w.whole(now, id, 0, ChangeKind::Added);
+ }
+ out.changed = !out.changes.is_empty();
+ out
+}
+
/// The before and after documents of layer `id` (the snapshot's copy and the document), for
/// rendering the two side by side.
pub fn before_doc(doc: &Document, id: NodeId) -> Option {
@@ -127,17 +148,7 @@ pub fn before_doc(doc: &Document, id: NodeId) -> Option {
/// Every layer that changed between two versions of a whole document, page by page (pages added
/// or removed as a whole), for reviewing a branch.
pub fn compare_docs(before: &Document, now: &Document) -> Comparison {
- let mut out = Comparison {
- id: NodeId(0),
- name: now.name.clone(),
- changed: false,
- snapshot: true,
- changes: Vec::new(),
- added: 0,
- removed: 0,
- modified: 0,
- truncated: false,
- };
+ let mut out = Comparison { name: now.name.clone(), snapshot: true, ..empty(now, NodeId(0)) };
let mut w = Walk { before, now, now_ids: now.ids().collect(), before_ids: before.ids().collect(), out: &mut out };
for p in &now.pages {
if before.contains(*p) {
diff --git a/crates/engine/src/devfocus_tests.rs b/crates/engine/src/devfocus_tests.rs
index 1607ce56..0801746d 100644
--- a/crates/engine/src/devfocus_tests.rs
+++ b/crates/engine/src/devfocus_tests.rs
@@ -99,8 +99,9 @@ fn nested_frames_stay_out_of_the_ready_list_and_its_navigation() {
let mut s = Session::new();
let screen = frame(&mut s, 0.0, "Screen");
let card = idv(&ex(&mut s, "frame.create", json!({"parent": screen, "width": 100, "height": 50, "name": "Card"})));
- // A status a nested frame already stores (an older file, or set through node.set) is ignored.
- ex(&mut s, "node.set", json!({"id": card, "props": {"devStatus": "readyForDev"}}));
+ // node.set refuses a status on a nested frame, and one an older file already stores is ignored.
+ assert!(s.execute("node.set", &json!({"id": card, "props": {"devStatus": "readyForDev"}})).is_err());
+ s.doc_mut().unwrap().node_mut(card).unwrap().dev_status = DevStatus::ReadyForDev;
assert_eq!(ex(&mut s, "inspect.readyForDev", json!({"status": "any"}))["items"], json!([]));
assert!(s.execute("dev.focus", &json!({"direction": "next"})).is_err(), "nothing is ready");
ex(&mut s, "node.set", json!({"id": screen, "props": {"devStatus": "readyForDev"}}));
diff --git a/crates/engine/src/devinspect.rs b/crates/engine/src/devinspect.rs
index fe400989..16f4bbdc 100644
--- a/crates/engine/src/devinspect.rs
+++ b/crates/engine/src/devinspect.rs
@@ -214,6 +214,21 @@ pub struct DevItem {
pub name: String,
pub page: NodeId,
pub status: DevStatus,
+ /// Ready for dev and changed since it was marked.
+ pub changed: bool,
+}
+
+/// Whether Dev Mode runs command `id` from the menus and shortcuts: commands that don't edit the
+/// document, and Dev Mode's own edits (annotations, statuses, dev resources, code connections,
+/// comments). Choosing a tool other than moving around and commenting is refused too, and so is
+/// Revert to saved, which isn't an undo step but throws the design's unsaved edits away.
+pub fn dev_mode_allows(id: &str) -> bool {
+ const OWN: [&str; 5] = ["annotation.", "dev.", "devResource.", "codeConnect.", "comment."];
+ match id.strip_prefix("tool.") {
+ Some(t) => matches!(t, "move" | "hand" | "comment"),
+ None if id == "file.revert" => false,
+ None => OWN.iter().any(|p| id.starts_with(p)) || crate::cmd::find_command(id).is_none_or(|c| !c.history),
+ }
}
/// Most items listed.
@@ -244,7 +259,8 @@ pub fn dev_items(doc: &Document, status: Option, page: Option
}
let Some(n) = doc.node(id) else { continue };
if !n.dev_status.is_none() && status.is_none_or(|s| s == n.dev_status) && has_status(doc, id) {
- out.push(DevItem { id, name: n.name.clone(), page: pg, status: n.dev_status });
+ let changed = n.dev_status == DevStatus::ReadyForDev && n.dev_changed;
+ out.push(DevItem { id, name: n.name.clone(), page: pg, status: n.dev_status, changed });
}
stack.extend(n.children.iter().rev().copied());
}
@@ -257,18 +273,21 @@ pub fn specs() -> Vec {
spec!(
"inspect.readyForDev",
"Ready for dev",
- "{status?: readyForDev|completed|any (default readyForDev), page? (page id; default every page)} → {items: [{id, name, page, status}]} frames and sections by handoff status (set it with `node.set {devStatus}`)",
+ "{status?: readyForDev|changed|completed|any (default readyForDev; changed: ready for dev and changed since marked), page? (page id; default every page)} → {items: [{id, name, page, status, changed}]} frames and sections by handoff status (set it with `node.set {devStatus}`)",
false,
|s, p| {
let cmd = "inspect.readyForDev";
- let status = match string(p, "status").as_deref() {
+ let wanted = string(p, "status");
+ let changed_only = wanted.as_deref().is_some_and(|v| v.eq_ignore_ascii_case("changed"));
+ let status = match wanted.as_deref() {
None => Some(DevStatus::ReadyForDev),
+ _ if changed_only => Some(DevStatus::ReadyForDev),
Some(v) if v.eq_ignore_ascii_case("any") || v.eq_ignore_ascii_case("all") => None,
Some(v) => Some(
DevStatus::ALL
.into_iter()
.find(|d| !d.is_none() && d.id().eq_ignore_ascii_case(v))
- .ok_or_else(|| crate::bad(cmd, "status: readyForDev|completed|any"))?,
+ .ok_or_else(|| crate::bad(cmd, "status: readyForDev|changed|completed|any"))?,
),
};
let doc = s.doc()?;
@@ -276,7 +295,9 @@ pub fn specs() -> Vec {
Some(v) => Some(id_of(v).filter(|pg| doc.pages.contains(pg)).ok_or_else(|| crate::bad(cmd, "page: a page id"))?),
None => None,
};
- Ok(json!({"items": serde_json::to_value(dev_items(doc, status, page)).unwrap_or(Value::Null)}))
+ let mut items = dev_items(doc, status, page);
+ items.retain(|i| i.changed || !changed_only);
+ Ok(json!({"items": serde_json::to_value(items).unwrap_or(Value::Null)}))
}
),
spec!(
diff --git a/crates/engine/src/devinspect_tests.rs b/crates/engine/src/devinspect_tests.rs
index be25e02c..5ee590cc 100644
--- a/crates/engine/src/devinspect_tests.rs
+++ b/crates/engine/src/devinspect_tests.rs
@@ -79,7 +79,7 @@ fn redlines_measure_on_hover_without_alt() {
s.tool.overlay.guides.len()
};
assert_eq!(hover(&mut s), 0, "plain hover doesn't measure");
- s.tool.redlines = true;
+ s.tool.dev_mode = true;
assert!(hover(&mut s) > 0, "Inspect measures on hover");
}
diff --git a/crates/engine/src/devmode_behaviour_tests.rs b/crates/engine/src/devmode_behaviour_tests.rs
new file mode 100644
index 00000000..3d85fdb1
--- /dev/null
+++ b/crates/engine/src/devmode_behaviour_tests.rs
@@ -0,0 +1,224 @@
+//! Dev Mode behaviour suite, written from the public documentation of handoff tools (in our own
+//! words): the canvas inspects and never edits, what the menus and shortcuts may run there, the
+//! list of what's ready for development, statuses (ready, changed, completed) and the focus view.
+
+use crate::Session;
+use crate::components::tests::{ex, idv};
+use crate::devinspect::dev_mode_allows;
+use crate::tools::{PointerEvent, PointerKind, ToolId};
+use figcraft_doc::{DevStatus, NodeId};
+use serde_json::{Value, json};
+
+fn ev(kind: PointerKind, x: f64, y: f64) -> PointerEvent {
+ PointerEvent::at(kind, x, y, 1.0)
+}
+
+fn drag(s: &mut Session, from: (f64, f64), to: (f64, f64)) {
+ s.pointer(&ev(PointerKind::Down, from.0, from.1)).unwrap();
+ for k in 1..=4 {
+ let t = f64::from(k) / 4.0;
+ s.pointer(&ev(PointerKind::Move, from.0 + (to.0 - from.0) * t, from.1 + (to.1 - from.1) * t)).unwrap();
+ }
+ s.pointer(&ev(PointerKind::Up, to.0, to.1)).unwrap();
+}
+
+fn frame(s: &mut Session, x: f64, name: &str) -> NodeId {
+ idv(&ex(s, "frame.create", json!({"x": x, "y": 0, "width": 200, "height": 200, "name": name})))
+}
+
+fn rect(s: &mut Session, parent: NodeId, x: f64) -> NodeId {
+ idv(&ex(s, "shape.rectangle", json!({"x": x, "y": 20, "width": 40, "height": 40, "parent": parent})))
+}
+
+fn names(v: &Value) -> Vec {
+ v["items"].as_array().map(|a| a.iter().filter_map(|i| i["name"].as_str().map(String::from)).collect()).unwrap_or_default()
+}
+
+fn status(s: &mut Session, ids: &[NodeId], st: &str) {
+ ex(s, "node.set", json!({"ids": ids, "props": {"devStatus": st}}));
+}
+
+#[test]
+fn the_dev_mode_canvas_selects_and_pans_but_never_edits() {
+ let mut s = Session::new();
+ let f = frame(&mut s, 0.0, "Screen");
+ let r = rect(&mut s, f, 20.0);
+ let t = idv(&ex(&mut s, "text.create", json!({"text": "Hello", "x": 100, "y": 120, "parent": f})));
+ s.tool.dev_mode = true;
+ let before = s.doc().unwrap().clone();
+ let steps = s.undo_labels(100).len();
+ // A press selects; dragging it moves nothing.
+ drag(&mut s, (40.0, 40.0), (140.0, 90.0));
+ assert_eq!(s.selection(), vec![r]);
+ // Nor do its resize handles.
+ drag(&mut s, (60.0, 60.0), (120.0, 120.0));
+ // Drawing tools only select there.
+ for tool in [ToolId::Rectangle, ToolId::Frame, ToolId::Text, ToolId::Pen, ToolId::Pencil, ToolId::Scale] {
+ s.set_tool(tool);
+ drag(&mut s, (300.0, 300.0), (360.0, 360.0));
+ }
+ s.set_tool(ToolId::Move);
+ // A double-click on text doesn't start typing; on a frame's layer it selects into it.
+ ex(&mut s, "select.set", json!({"ids": [t]}));
+ s.pointer(&ev(PointerKind::DoubleClick, 110.0, 128.0)).unwrap();
+ assert!(s.ds().unwrap().text_edit.is_none(), "no text editing");
+ ex(&mut s, "select.set", json!({"ids": [r]}));
+ s.pointer(&ev(PointerKind::DoubleClick, 40.0, 40.0)).unwrap();
+ assert!(s.ds().unwrap().vector_edit.is_none(), "no vector editing");
+ assert!(*s.doc().unwrap() == before, "the design is untouched");
+ assert_eq!(s.undo_labels(100).len(), steps, "nothing to undo");
+ // Keys that edit with a tool (a selected guide's Delete) go to the commands instead.
+ assert!(!s.tool_key("Delete", false, false, false).unwrap());
+ // The hand still pans; comments still start.
+ s.set_tool(ToolId::Hand);
+ let cx = s.ds().unwrap().view.cx;
+ s.pointer(&ev(PointerKind::Down, 500.0, 500.0)).unwrap();
+ s.pointer(&PointerEvent { sx: 550.0, ..ev(PointerKind::Move, 500.0, 500.0) }).unwrap();
+ s.pointer(&ev(PointerKind::Up, 500.0, 500.0)).unwrap();
+ assert_ne!(s.ds().unwrap().view.cx, cx, "panned");
+ s.set_tool(ToolId::Comment);
+ s.pointer(&ev(PointerKind::Down, 500.0, 500.0)).unwrap();
+ assert!(s.ui_requests.iter().any(|u| u.kind == "comment.new"));
+ // Back in the design: the same drag moves.
+ s.tool.dev_mode = false;
+ s.set_tool(ToolId::Move);
+ drag(&mut s, (40.0, 40.0), (140.0, 90.0));
+ assert!(s.doc().unwrap().node(r).is_some_and(|n| n.transform.as_coeffs()[4] > 100.0), "moved");
+}
+
+#[test]
+fn dev_mode_runs_its_own_edits_and_refuses_design_edits_from_menus_and_shortcuts() {
+ for id in [
+ "annotation.add",
+ "annotation.edit",
+ "dev.resolveChange",
+ "dev.focus",
+ "devResource.add",
+ "codeConnect.set",
+ "comment.add",
+ "edit.undo",
+ "edit.redo",
+ "edit.copy",
+ "edit.copyAsCss",
+ "select.all",
+ "view.zoomIn",
+ "view.devMode",
+ "file.export",
+ "file.save",
+ "tool.move",
+ "tool.hand",
+ "tool.comment",
+ "inspect.code",
+ ] {
+ assert!(dev_mode_allows(id), "{id} runs in Dev Mode");
+ }
+ for id in [
+ "edit.delete",
+ "edit.paste",
+ "edit.cut",
+ "edit.duplicate",
+ "transform.nudge",
+ "object.group",
+ "tool.rectangle",
+ "tool.text",
+ "tool.place",
+ "file.import",
+ "file.revert",
+ ] {
+ assert!(!dev_mode_allows(id), "{id} edits the design");
+ }
+}
+
+#[test]
+fn the_ready_list_shows_frames_and_sections_with_a_status_across_pages() {
+ let mut s = Session::new();
+ let a = frame(&mut s, 0.0, "Login");
+ let b = frame(&mut s, 300.0, "Signup");
+ let nested = idv(&ex(&mut s, "frame.create", json!({"x": 10, "y": 10, "width": 50, "height": 50, "parent": a, "name": "Card"})));
+ status(&mut s, &[a], "readyForDev");
+ status(&mut s, &[b], "completed");
+ // A layer inside a frame takes no status of its own (its frame's covers it).
+ assert!(s.execute("node.set", &json!({"id": nested, "props": {"devStatus": "readyForDev"}})).is_err());
+ assert!(s.execute("node.set", &json!({"ids": [a, nested], "props": {"devStatus": "completed"}})).is_err(), "all or nothing");
+ assert_eq!(s.doc().unwrap().node(a).map(|n| n.dev_status), Some(DevStatus::ReadyForDev));
+ // Clearing one is always fine.
+ ex(&mut s, "node.set", json!({"id": nested, "props": {"devStatus": null}}));
+ let pg2 = idv(&ex(&mut s, "page.add", json!({"name": "Settings"})));
+ ex(&mut s, "page.select", json!({"id": pg2}));
+ let c = frame(&mut s, 0.0, "Profile");
+ status(&mut s, &[c], "readyForDev");
+ assert_eq!(names(&ex(&mut s, "inspect.readyForDev", json!({}))), vec!["Login", "Profile"]);
+ assert_eq!(names(&ex(&mut s, "inspect.readyForDev", json!({"status": "completed"}))), vec!["Signup"]);
+ assert_eq!(names(&ex(&mut s, "inspect.readyForDev", json!({"status": "any"}))), vec!["Login", "Signup", "Profile"]);
+ // Statuses are undoable.
+ s.undo().unwrap();
+ assert_eq!(names(&ex(&mut s, "inspect.readyForDev", json!({}))), vec!["Login"]);
+}
+
+#[test]
+fn ready_frames_edited_after_marking_show_as_changed_until_resolved_or_completed() {
+ let mut s = Session::new();
+ let a = frame(&mut s, 0.0, "Login");
+ let b = frame(&mut s, 300.0, "Signup");
+ let r = rect(&mut s, a, 20.0);
+ let outside = idv(&ex(&mut s, "shape.rectangle", json!({"x": 900, "y": 0, "width": 10, "height": 10})));
+ status(&mut s, &[a, b], "readyForDev");
+ let changed = |s: &mut Session| names(&ex(s, "inspect.readyForDev", json!({"status": "changed"})));
+ assert!(changed(&mut s).is_empty(), "marking isn't a change");
+ // Edits elsewhere don't count; an edit inside does.
+ ex(&mut s, "node.set", json!({"id": outside, "props": {"width": 30}}));
+ assert!(changed(&mut s).is_empty());
+ ex(&mut s, "node.set", json!({"id": r, "props": {"width": 60}}));
+ assert_eq!(changed(&mut s), vec!["Login"]);
+ let items = ex(&mut s, "inspect.readyForDev", json!({}));
+ assert_eq!(items["items"][0]["changed"], true, "the list says which changed: {items}");
+ assert_eq!(items["items"][1]["changed"], false);
+ // Still ready for dev (the status itself stays).
+ assert_eq!(names(&items), vec!["Login", "Signup"]);
+ // Resolving goes back to plain ready; so does marking it again, or completing it.
+ ex(&mut s, "dev.resolveChange", json!({"ids": [a]}));
+ assert!(changed(&mut s).is_empty());
+ ex(&mut s, "node.set", json!({"id": r, "props": {"width": 70}}));
+ status(&mut s, &[a], "completed");
+ assert!(changed(&mut s).is_empty());
+ let all = ex(&mut s, "inspect.readyForDev", json!({"status": "any"}));
+ assert_eq!(all["items"][0]["changed"], false, "a completed frame isn't changed: {all}");
+ // Completed frames don't turn changed when edited.
+ ex(&mut s, "node.set", json!({"id": r, "props": {"width": 80}}));
+ assert!(!s.doc().unwrap().node(a).unwrap().dev_changed);
+}
+
+#[test]
+fn the_focus_view_steps_through_what_is_ready_and_skips_completed_frames() {
+ let mut s = Session::new();
+ let a = frame(&mut s, 0.0, "Login");
+ let b = frame(&mut s, 300.0, "Signup");
+ let c = frame(&mut s, 600.0, "Profile");
+ let r = rect(&mut s, c, 620.0);
+ status(&mut s, &[a, c], "readyForDev");
+ status(&mut s, &[b], "completed");
+ ex(&mut s, "node.set", json!({"id": r, "props": {"width": 60}}));
+ let step = |s: &mut Session, d: &str| ex(s, "dev.focus", json!({"direction": d}));
+ let v = ex(&mut s, "dev.focus", json!({"id": a}));
+ assert_eq!((v["index"].clone(), v["count"].clone()), (json!(0), json!(2)));
+ assert_eq!(step(&mut s, "next")["id"], json!(c), "completed ones are skipped, changed ones aren't");
+ assert_eq!(step(&mut s, "previous")["id"], json!(a));
+ // Any top-level frame opens in it, even one that's completed.
+ assert_eq!(ex(&mut s, "dev.focus", json!({"id": b}))["index"], json!(null));
+}
+
+#[test]
+fn a_drag_under_way_when_dev_mode_starts_moves_nothing() {
+ let mut s = Session::new();
+ let f = frame(&mut s, 0.0, "Screen");
+ let r = rect(&mut s, f, 20.0);
+ ex(&mut s, "select.set", json!({"ids": [r]}));
+ let before = s.doc().unwrap().world_bounds(r);
+ s.pointer(&ev(PointerKind::Down, 40.0, 40.0)).unwrap();
+ s.pointer(&ev(PointerKind::Move, 90.0, 40.0)).unwrap();
+ s.drop_gesture().unwrap();
+ s.tool.dev_mode = true;
+ s.pointer(&ev(PointerKind::Move, 120.0, 40.0)).unwrap();
+ s.pointer(&ev(PointerKind::Up, 120.0, 40.0)).unwrap();
+ assert_eq!(s.doc().unwrap().world_bounds(r), before, "the drag was dropped, not committed");
+}
diff --git a/crates/engine/src/devmode_tail_tests.rs b/crates/engine/src/devmode_tail_tests.rs
new file mode 100644
index 00000000..b8f1b019
--- /dev/null
+++ b/crates/engine/src/devmode_tail_tests.rs
@@ -0,0 +1,163 @@
+//! Dev Mode, the tail: import lines for the connected components a layer tree calls.
+
+use crate::Session;
+use crate::components::tests::{ex, idv};
+use figcraft_doc::NodeId;
+use serde_json::json;
+
+fn code(s: &mut Session, id: NodeId, lang: &str) -> String {
+ ex(s, "inspect.code", json!({"id": id, "language": lang}))["code"].as_str().unwrap_or_default().to_string()
+}
+
+/// A component named `name` (an empty frame) at `x`.
+fn component(s: &mut Session, name: &str, x: f64) -> NodeId {
+ let f = idv(&ex(s, "frame.create", json!({"x": x, "y": 1000, "width": 40, "height": 20, "name": name})));
+ idv(&ex(s, "component.create", json!({"ids": [f]})))
+}
+
+fn instance(s: &mut Session, c: NodeId, parent: NodeId) -> NodeId {
+ idv(&ex(s, "instance.create", json!({"component": c, "x": 0, "y": 0, "parent": parent})))
+}
+
+fn frame(s: &mut Session, name: &str, parent: Option) -> NodeId {
+ idv(&ex(s, "frame.create", json!({"x": 0, "y": 0, "width": 400, "height": 300, "name": name, "parent": parent})))
+}
+
+fn count(code: &str, line: &str) -> usize {
+ code.lines().filter(|l| *l == line).count()
+}
+
+#[test]
+fn layer_trees_import_the_connected_components_they_call_once_at_the_top() {
+ let mut s = Session::new();
+ let badge = component(&mut s, "Badge", 0.0);
+ let button = component(&mut s, "Button", 100.0);
+ let toast = component(&mut s, "Toast", 200.0);
+ let divider = component(&mut s, "Divider", 300.0);
+ for (lang, path) in [("react", "@acme/ui"), ("swiftui", "AcmeUI"), ("leptos", "crate::ui"), ("compose", "com.acme.ui.Badge")] {
+ ex(&mut s, "codeConnect.set", json!({"id": badge, "language": lang, "importPath": path}));
+ }
+ ex(&mut s, "codeConnect.set", json!({"id": button, "importPath": "@acme/buttons"}));
+ ex(&mut s, "codeConnect.set", json!({"id": toast, "importPath": "@acme/toast"}));
+ let screen = frame(&mut s, "Screen", None);
+ let row = frame(&mut s, "Row", Some(screen));
+ for (c, parent) in [(badge, screen), (button, screen), (badge, screen), (divider, screen), (badge, row)] {
+ instance(&mut s, c, parent);
+ }
+ let hidden = instance(&mut s, toast, row);
+ ex(&mut s, "node.set", json!({"id": hidden, "props": {"visible": false}}));
+
+ let react = code(&mut s, screen, "react");
+ assert!(react.starts_with("import { Badge } from \"@acme/ui\";\nimport { Button } from \"@acme/buttons\";\nimport \"./"), "{react}");
+ assert_eq!(count(&react, "import { Badge } from \"@acme/ui\";"), 1, "once each: {react}");
+ assert!(!react.contains("@acme/toast"), "hidden layers aren't in the code: {react}");
+ let swift = code(&mut s, screen, "swiftui");
+ assert!(swift.starts_with("import AcmeUI\n\n") && count(&swift, "import AcmeUI") == 1, "per language: {swift}");
+ assert!(!swift.contains("acme/buttons"), "{swift}");
+ let leptos = code(&mut s, screen, "leptos");
+ assert!(leptos.starts_with("use crate::ui::Badge;\nuse leptos::prelude::*;\n"), "joined to the code's own imports: {leptos}");
+ assert!(code(&mut s, screen, "compose").starts_with("import com.acme.ui.Badge\n\n"));
+ assert!(!code(&mut s, screen, "css").contains("import"), "CSS has no imports");
+ // The Inspect panel shows inspect.code's text (the same function).
+ let doc = s.doc().unwrap();
+ assert_eq!(crate::codegen::code_for(doc, screen, crate::codegen::CodeLang::React), react);
+
+ // A connected layer itself: its import and snippet, unchanged.
+ assert_eq!(code(&mut s, badge, "react"), "import { Badge } from \"@acme/ui\";\n\n \n");
+
+ // A component's definition, and an instance of it (its call, then the definition).
+ let card_frame = frame(&mut s, "Card", None);
+ instance(&mut s, badge, card_frame);
+ let card = idv(&ex(&mut s, "component.create", json!({"ids": [card_frame]})));
+ assert!(
+ code(&mut s, card, "react").starts_with("import { Badge } from \"@acme/ui\";\nimport \"./card.css\";"),
+ "{}",
+ code(&mut s, card, "react")
+ );
+ let page = frame(&mut s, "Page", None);
+ let card_i = instance(&mut s, card, page);
+ assert!(code(&mut s, card_i, "react").starts_with("import { Badge } from \"@acme/ui\";\n\n "), "{}", code(&mut s, card_i, "react"));
+ assert!(code(&mut s, page, "react").starts_with("import \"./"), "an unconnected call's insides aren't in the code");
+}
+
+#[test]
+fn slots_and_instance_swaps_bring_their_connected_imports() {
+ let mut s = Session::new();
+ let badge = component(&mut s, "Badge", 0.0);
+ ex(&mut s, "codeConnect.set", json!({"id": badge, "importPath": "@acme/ui"}));
+ // A panel whose slot an instance fills with a badge.
+ let f = frame(&mut s, "Panel", None);
+ let content = frame(&mut s, "Content", Some(f));
+ let panel = idv(&ex(&mut s, "component.create", json!({"ids": [f]})));
+ ex(&mut s, "component.makeSlot", json!({"id": content}));
+ let screen = frame(&mut s, "Screen", None);
+ let p = instance(&mut s, panel, screen);
+ assert!(!code(&mut s, screen, "react").contains("@acme/ui"), "an empty slot");
+ ex(&mut s, "instance.slotInsert", json!({"id": p, "slot": "Content", "component": badge, "replace": true}));
+ assert!(code(&mut s, screen, "react").starts_with("import { Badge } from \"@acme/ui\";\n"), "{}", code(&mut s, screen, "react"));
+ assert!(code(&mut s, p, "react").starts_with("import { Badge } from \"@acme/ui\";\n\n "}));
+ let c = instance(&mut s, chip, screen);
+ ex(&mut s, "instance.setProperties", json!({"ids": [c], "properties": {"Icon": badge}}));
+ assert_eq!(code(&mut s, c, "react"), "import { Chip } from \"@acme/chip\";\nimport { Badge } from \"@acme/ui\";\n\n } />\n");
+ let tree = code(&mut s, screen, "react");
+ assert!(tree.starts_with("import { Badge } from \"@acme/ui\";\nimport { Chip } from \"@acme/chip\";\nimport \"./"), "{tree}");
+ // An unconnected swap target brings nothing; the default (Heart) isn't connected.
+ ex(&mut s, "instance.setProperties", json!({"ids": [c], "properties": {"Icon": heart}}));
+ assert_eq!(code(&mut s, c, "react"), "import { Chip } from \"@acme/chip\";\n\n } />\n");
+}
+
+#[test]
+fn compare_changes_takes_any_saved_version_as_the_before() {
+ let mut s = Session::new();
+ let screen = frame(&mut s, "Screen", None);
+ let button =
+ idv(&ex(&mut s, "shape.rectangle", json!({"x": 20, "y": 20, "width": 120, "height": 40, "parent": screen, "props": {"name": "Button"}})));
+ let old = idv(&ex(&mut s, "shape.ellipse", json!({"x": 200, "y": 20, "width": 20, "height": 20, "parent": screen, "props": {"name": "Dot"}})));
+ let v1 = ex(&mut s, "file.saveVersion", json!({"name": "Kickoff"}))["id"].as_str().unwrap().to_string();
+ ex(&mut s, "node.set", json!({"id": button, "props": {"width": 136}}));
+ ex(&mut s, "edit.delete", json!({"ids": [old]}));
+ let added = idv(&ex(&mut s, "text.create", json!({"text": "Hi", "x": 20, "y": 100, "parent": screen, "props": {"name": "Note"}})));
+ let v2 = ex(&mut s, "file.saveVersion", json!({"name": "Review"}))["id"].as_str().unwrap().to_string();
+ ex(&mut s, "node.set", json!({"id": button, "props": {"width": 150}}));
+
+ // Any frame, ready for dev or not.
+ let c = ex(&mut s, "dev.compare", json!({"id": screen, "version": v1}));
+ assert_eq!(c["version"]["name"], "Kickoff");
+ assert_eq!(
+ (c["changed"].as_bool(), c["added"].as_u64(), c["removed"].as_u64(), c["modified"].as_u64()),
+ (Some(true), Some(1), Some(1), Some(1)),
+ "{c}"
+ );
+ let change =
+ |c: &serde_json::Value, id: NodeId| c["changes"].as_array().unwrap().iter().find(|l| l["id"] == json!(id)).cloned().unwrap_or_default();
+ assert_eq!(change(&c, button)["properties"][0]["text"], "width 120 → 150");
+ assert_eq!(change(&c, old)["change"], "removed");
+ assert_eq!(change(&c, added)["change"], "added");
+ // A later version: only what changed since then.
+ let c = ex(&mut s, "dev.compare", json!({"id": screen, "version": v2}));
+ assert_eq!(c["changes"].as_array().map(Vec::len), Some(1), "{c}");
+ assert_eq!(change(&c, button)["properties"][0]["text"], "width 136 → 150");
+ // A frame the version doesn't have was added as a whole.
+ let fresh = frame(&mut s, "Settings", None);
+ let c = ex(&mut s, "dev.compare", json!({"id": fresh, "version": v1}));
+ assert_eq!(c["changes"][0]["change"], "added");
+ // The snapshot from when it was marked stays the default, for ready-for-dev layers only.
+ assert!(s.execute("dev.compare", &json!({"id": screen})).is_err(), "not ready for dev");
+ ex(&mut s, "node.set", json!({"id": screen, "props": {"devStatus": "readyForDev"}}));
+ let c = ex(&mut s, "dev.compare", json!({"id": screen}));
+ assert_eq!((c["changed"].as_bool(), c["version"].is_null()), (Some(false), true), "{c}");
+ for bad in [json!({"id": screen, "version": "nope"}), json!({"id": screen, "version": 5}), json!({"id": button, "version": v1})] {
+ assert!(s.execute("dev.compare", &bad).is_err(), "{bad}");
+ }
+ // The app opens on the version asked for.
+ ex(&mut s, "dev.compare", json!({"id": screen, "version": v2, "show": true}));
+ assert!(s.ui_requests.iter().any(|u| u.kind == "view.devCompare" && u.data["version"] == json!(v2)));
+}
diff --git a/crates/engine/src/inspect.rs b/crates/engine/src/inspect.rs
index a6973f01..d30f5f51 100644
--- a/crates/engine/src/inspect.rs
+++ b/crates/engine/src/inspect.rs
@@ -135,6 +135,9 @@ pub fn node_json(doc: &Document, id: NodeId, depth: usize) -> Value {
if !n.exports.is_empty() {
o.insert("exports".into(), serde_json::to_value(&n.exports).unwrap_or(Value::Null));
}
+ if let Some(b) = &n.board {
+ o.insert("board".into(), serde_json::to_value(b).unwrap_or(Value::Null));
+ }
if !n.annotations.is_empty() {
o.insert("annotations".into(), serde_json::to_value(&n.annotations).unwrap_or(Value::Null));
}
@@ -312,6 +315,7 @@ pub fn document(s: &Session, depth: usize, all_pages: bool) -> Value {
doc.pages.iter().map(|p| if all_pages || *p == ds.page { node_json(doc, *p, depth) } else { node_json(doc, *p, 0) }).collect();
json!({
"name": doc.name,
+ "kind": doc.kind.id(),
"path": ds.path,
"dirty": ds.is_dirty(),
"currentPage": ds.page,
diff --git a/crates/engine/src/keymap.rs b/crates/engine/src/keymap.rs
index c5e3c334..1ffad5e2 100644
--- a/crates/engine/src/keymap.rs
+++ b/crates/engine/src/keymap.rs
@@ -193,6 +193,15 @@ pub static KEYS: &[Binding] = &[
k(Tools, "tool.text", &["T"]),
k(Tools, "tool.comment", &["C"]),
k(Tools, "tool.shapeBuilder", &["Shift+M"]),
+ // Board tools (on boards only), on keys nothing else uses.
+ k(Tools, "tool.sticky", &["Q"]),
+ k(Tools, "tool.shape", &["B"]),
+ k(Tools, "tool.connector", &["X"]),
+ k(Tools, "tool.marker", &["M"]),
+ k(Tools, "tool.highlighter", &["U"]),
+ k(Tools, "tool.eraser", &["E"]),
+ k(Tools, "tool.stamp", &["W"]),
+ k(Tools, "board.nextSticky", &["Shift+Cmd+Enter"]).label("Board: a new sticky beside the selected one").both(),
// View
// The documentation gives both keys for the pixel grid in different places.
k(View, "view.pixelGrid", &["Shift+'", "Cmd+'"]),
diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs
index b0839695..007b25d9 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 board;
pub mod booleans;
pub mod branches;
pub mod catalog;
@@ -937,6 +938,7 @@ impl Session {
/// as it was.
pub fn execute(&mut self, id: &str, params: &Value) -> Result {
let spec = find_command(id).ok_or_else(|| EngineError::UnknownCommand(id.to_string()))?;
+ board::refuse_on_board(self, id)?;
// Revert replaces the document's uid: refuse before ending previews or syncing branches.
if id == "file.revert" && self.live().doc_uid.is_some() {
return Err(EngineError::Disabled(id.into(), "leave the live session before reverting to the saved file".into()));
@@ -1395,7 +1397,9 @@ pub fn normalize(doc: &mut Document, before: &Document) {
figcraft_layout::coherent_sizing(doc, id);
}
touched.extend(doc.take_dirty());
- // 1. Text auto-size.
+ // 1. Text auto-size (a sticky's note first takes the size its length calls for).
+ board::settle_text(doc, before, &touched);
+ touched.extend(doc.take_dirty());
for id in live(doc, &touched) {
let Some(n) = doc.node(id) else { continue };
if let Some((w, h)) = figcraft_text::auto_size(n)
@@ -1476,6 +1480,9 @@ pub fn normalize(doc: &mut Document, before: &Document) {
}
}
touched.extend(doc.take_dirty());
+ // 4b. Board connectors follow the layers they join; their labels sit at their middles.
+ board::settle_routes(doc, before, &touched);
+ touched.extend(doc.take_dirty());
// 5. Ready-for-dev layers whose contents changed show "Changed".
mark_dev_changes(doc, before, &touched);
doc.take_dirty();
@@ -1608,6 +1615,10 @@ mod batch_step_ref_tests;
#[cfg(test)]
mod binding_lists_tests;
#[cfg(test)]
+mod board_tests;
+#[cfg(test)]
+mod board_tools_tests;
+#[cfg(test)]
mod booleans_tests;
#[cfg(test)]
mod bound_alpha_tests;
@@ -1654,6 +1665,10 @@ mod devfocus_tests;
#[cfg(test)]
mod devinspect_tests;
#[cfg(test)]
+mod devmode_behaviour_tests;
+#[cfg(test)]
+mod devmode_tail_tests;
+#[cfg(test)]
mod doc_urls_tests;
#[cfg(test)]
mod double_click_tests;
diff --git a/crates/engine/src/shortcut_parity_tests.rs b/crates/engine/src/shortcut_parity_tests.rs
index cf7d5d47..c0d7e65e 100644
--- a/crates/engine/src/shortcut_parity_tests.rs
+++ b/crates/engine/src/shortcut_parity_tests.rs
@@ -120,6 +120,15 @@ static ROWS: &[Row] = &[
pin(Tools, "tool.slice", &["S"], &[]),
pin(Tools, "file.placeImage", &["Shift+Cmd+K"], &[]),
pin(Tools, "tool.shapeBuilder", &["Shift+M"], &[]),
+ // Board tools (boards only), on keys no design-file shortcut uses.
+ pin(Tools, "tool.sticky", &["Q"], &[]),
+ pin(Tools, "tool.shape", &["B"], &[]),
+ pin(Tools, "tool.connector", &["X"], &[]),
+ pin(Tools, "tool.marker", &["M"], &[]),
+ pin(Tools, "tool.highlighter", &["U"], &[]),
+ pin(Tools, "tool.eraser", &["E"], &[]),
+ pin(Tools, "tool.stamp", &["W"], &[]),
+ pin(Tools, "board.nextSticky", &["Shift+Cmd+Enter"], &[]),
// Vector edit mode
doc(Selection, "Edit the selected shape's points", &["Enter"], &[], Bound("select.children"), "Enter on a shape edits it; on a frame or group it selects the children"),
doc(Shape, "Vector edit: move", &["V"], &[], VectorTool(VTool::Move), ""),
@@ -398,7 +407,7 @@ fn counts_match_the_docs() {
let reserved = documented.iter().filter(|r| !r.reserved.is_empty()).count();
let pinned = ROWS.len() - documented.len();
// docs/ui-parity.md quotes these.
- assert_eq!((documented.len(), bound, moved, missing, reserved, pinned), (129, 128, 1, 0, 2, 49));
+ assert_eq!((documented.len(), bound, moved, missing, reserved, pinned), (129, 128, 1, 0, 2, 57));
}
#[test]
diff --git a/crates/engine/src/text_behaviour_tests.rs b/crates/engine/src/text_behaviour_tests.rs
index 84315f1f..b9a76fbc 100644
--- a/crates/engine/src/text_behaviour_tests.rs
+++ b/crates/engine/src/text_behaviour_tests.rs
@@ -177,20 +177,19 @@ fn vertical_trim_through_node_set() {
#[test]
fn paragraph_indent_only_moves_left_aligned_text() {
+ figcraft_text::scan_system_fonts();
let mut s = Session::new();
let t = text(&mut s, "Indented paragraph", json!({"fontSize": 20, "paragraphIndent": 30}));
let first_x = |s: &Session| {
let (l, _) = figcraft_text::layout_node(s.doc().unwrap().node(t).unwrap()).unwrap();
- (l.glyphs.first().map_or(0.0, |g| g.x), l.width)
+ (l.glyphs.first().map(|g| g.x), l.width)
};
- let (x, w) = first_x(&s);
- if w <= 0.0 {
- return;
- }
+ // Without any font there are no glyphs, but the indent alone still gives the box a width.
+ let (Some(x), w) = first_x(&s) else { return };
assert!((x - 30.0).abs() < 1e-6, "left: indented");
s.execute("node.set", &json!({"id": t, "props": {"textAlign": "center"}})).unwrap();
let (x, w2) = first_x(&s);
- assert!((w2 - (w - 30.0)).abs() < 1e-6 && x.abs() < 1e-6, "centered auto-width text: no indent, the box shrinks by it");
+ assert!((w2 - (w - 30.0)).abs() < 1e-6 && x.is_some_and(|x| x.abs() < 1e-6), "centered auto-width text: no indent, the box shrinks by it");
}
/// A new text made with the Text tool by a press at `from`, a drag to `to` and a release, holding
diff --git a/crates/engine/src/textedit.rs b/crates/engine/src/textedit.rs
index 902ba149..85ea535b 100644
--- a/crates/engine/src/textedit.rs
+++ b/crates/engine/src/textedit.rs
@@ -32,7 +32,9 @@ pub fn begin(s: &mut Session, id: NodeId, caret: Option, created: bool) -
pub fn end(s: &mut Session) -> Result<()> {
let Some(te) = s.ds()?.text_edit.clone() else { return Ok(()) };
s.ds_mut()?.text_edit = None;
- let empty = text_of(s, te.id).map(|t| t.characters.trim().is_empty()).unwrap_or(false);
+ // A board object's text (a sticky's note) stays when emptied; the object is selected again.
+ let owner = s.doc().ok().and_then(|d| crate::board::owner_of_text(d, te.id));
+ let empty = owner.is_none() && text_of(s, te.id).map(|t| t.characters.trim().is_empty()).unwrap_or(false);
if empty {
let doc = s.doc_mut()?;
let _ = doc.remove(te.id);
@@ -50,6 +52,9 @@ pub fn end(s: &mut Session) -> Result<()> {
}
s.commit_interaction()?;
let ds = s.ds_mut()?;
+ if let Some(o) = owner {
+ ds.selection = vec![o];
+ }
ds.revision += 1;
Ok(())
}
diff --git a/crates/engine/src/tools.rs b/crates/engine/src/tools.rs
index f0115e1f..4b7b2abf 100644
--- a/crates/engine/src/tools.rs
+++ b/crates/engine/src/tools.rs
@@ -39,10 +39,18 @@ pub enum ToolId {
Comment,
Eyedropper,
ShapeBuilder,
+ // Board tools.
+ Sticky,
+ BoardShape,
+ Connector,
+ Marker,
+ Highlighter,
+ Eraser,
+ Stamp,
}
impl ToolId {
- pub const ALL: [ToolId; 18] = [
+ pub const ALL: [ToolId; 25] = [
ToolId::Move,
ToolId::Scale,
ToolId::Hand,
@@ -61,6 +69,13 @@ impl ToolId {
ToolId::Comment,
ToolId::Eyedropper,
ToolId::ShapeBuilder,
+ ToolId::Sticky,
+ ToolId::BoardShape,
+ ToolId::Connector,
+ ToolId::Marker,
+ ToolId::Highlighter,
+ ToolId::Eraser,
+ ToolId::Stamp,
];
pub fn id(self) -> &'static str {
match self {
@@ -82,6 +97,13 @@ impl ToolId {
ToolId::Comment => "comment",
ToolId::Eyedropper => "eyedropper",
ToolId::ShapeBuilder => "shapeBuilder",
+ ToolId::Sticky => "sticky",
+ ToolId::BoardShape => "shape",
+ ToolId::Connector => "connector",
+ ToolId::Marker => "marker",
+ ToolId::Highlighter => "highlighter",
+ ToolId::Eraser => "eraser",
+ ToolId::Stamp => "stamp",
}
}
pub fn from_id(s: &str) -> Option {
@@ -107,8 +129,23 @@ impl ToolId {
ToolId::Comment => "Comment",
ToolId::Eyedropper => "Pick color",
ToolId::ShapeBuilder => "Shape builder",
+ ToolId::Sticky => "Sticky note",
+ ToolId::BoardShape => "Shapes",
+ ToolId::Connector => "Connector",
+ ToolId::Marker => "Marker",
+ ToolId::Highlighter => "Highlighter",
+ ToolId::Eraser => "Eraser",
+ ToolId::Stamp => "Stamp",
}
}
+
+ /// The tools of a board's toolbar (a design file's toolbar has the others).
+ pub fn on_boards(self) -> bool {
+ matches!(
+ self,
+ ToolId::Sticky | ToolId::BoardShape | ToolId::Connector | ToolId::Marker | ToolId::Highlighter | ToolId::Eraser | ToolId::Stamp
+ )
+ }
/// The tool's key (from [`crate::keymap`]; empty when it has none).
pub fn shortcut(self) -> &'static str {
let id = self.id();
@@ -404,6 +441,15 @@ pub(crate) enum Gesture {
},
/// Dragging the rotation origin handle (see [`crate::rotation_origin`]).
Origin,
+ /// The connector tool: dragging from `from` (pressed at `start`).
+ Connect {
+ from: figcraft_doc::End,
+ start: Point,
+ },
+ /// The eraser: the strokes it took so far.
+ Erase {
+ gone: Vec,
+ },
/// Shape builder: regions collected so far (handled in `shapebuilder`).
ShapeBuild {
picked: Vec,
@@ -447,8 +493,10 @@ pub struct ToolState {
/// removes; Alt merges).
pub shape_builder: Option>,
pub builder_remove: bool,
- /// Show distances from the selection on hover without holding Alt (Dev mode inspection).
- pub redlines: bool,
+ /// Dev Mode: the canvas inspects. Hovering shows distances from the selection without Alt, and
+ /// presses select, pan and comment but never edit the design (no moving, resizing, drawing,
+ /// or editing text or vectors).
+ pub dev_mode: bool,
/// Pen snap targets, kept while hovering (see `vectoredit::point_snap`).
pub(crate) pen_targets: Option,
/// The Scale tool's anchor: column and row (0 start, 1 middle, 2 end) of the point of the
@@ -462,6 +510,8 @@ pub struct ToolState {
pub labels: Vec<(NodeId, [Point; 4])>,
/// The brush the Pencil draws with (`tool.pencilBrush`; `None`: a plain stroke).
pub pencil_brush: Option,
+ /// The board tools' colours and choices.
+ pub board: crate::board::BoardTool,
}
/// Pen pressure along drawn samples as width profile points `[t, scale]`: `t` by length, at most
@@ -940,6 +990,21 @@ impl Session {
}
}
+ /// The tool pointer events go to: in Dev Mode every tool but the hand and comments selects.
+ fn acting_tool(&self) -> ToolId {
+ match self.tool.tool {
+ t if self.tool.dev_mode && !matches!(t, ToolId::Hand | ToolId::Comment) => ToolId::Move,
+ t => t,
+ }
+ }
+
+ /// Drop the gesture under way (a drag, a resize, a shape being drawn), restoring the document
+ /// as Escape does; the UI calls it when Dev Mode starts, where nothing may move.
+ pub fn drop_gesture(&mut self) -> Result<()> {
+ self.tool.gesture = Gesture::None;
+ self.cancel_interaction()
+ }
+
/// Feed one pointer event to the current tool.
pub fn pointer(&mut self, ev: &PointerEvent) -> Result<()> {
// A held button sends the same move every frame: running the gesture again would only
@@ -952,11 +1017,12 @@ impl Session {
}
self.tool.last_move = Some(ev.clone());
}
- let tool = self.tool.tool;
- if matches!(tool, ToolId::Move | ToolId::Scale) && self.origin_pointer(ev)? {
+ let tool = self.acting_tool();
+ let edits = matches!(tool, ToolId::Move | ToolId::Scale) && !self.tool.dev_mode;
+ if edits && self.origin_pointer(ev)? {
return Ok(());
}
- if matches!(tool, ToolId::Move | ToolId::Scale) && self.ds().is_ok_and(|d| d.vector_edit.is_some()) && self.vector_pointer(ev)? {
+ if edits && self.ds().is_ok_and(|d| d.vector_edit.is_some()) && self.vector_pointer(ev)? {
return Ok(());
}
if tool == ToolId::ShapeBuilder {
@@ -987,6 +1053,7 @@ impl Session {
Ok(())
}
ToolId::Eyedropper => self.eyedrop(ev),
+ t if t.on_boards() => self.board_down(ev),
t if t.draws_shape() => self.draw_down(ev),
_ => Ok(()),
},
@@ -1016,7 +1083,7 @@ impl Session {
}
fn hover(&mut self, ev: &PointerEvent) -> Result<()> {
- let tool = self.tool.tool;
+ let tool = self.acting_tool();
let ds = self.ds()?;
let (doc, sel, page) = (ds.doc.clone(), ds.selection.clone(), ds.page);
let mut cursor = tool.cursor();
@@ -1045,7 +1112,7 @@ impl Session {
if matches!(tool, ToolId::Move | ToolId::Scale) && on_edited {
cursor = Cursor::Text;
} else if matches!(tool, ToolId::Move | ToolId::Scale) && arc_hover.is_none() && shape_hover.is_none() {
- if let Some(h) = handle_at(&doc, &sel, ev.p(), ev.zoom) {
+ if let Some(h) = handle_at(&doc, &sel, ev.p(), ev.zoom).filter(|_| !self.tool.dev_mode) {
cursor = resize_cursor(&doc, &sel, h);
} else {
let leaf = self.hit(&doc, page, ev.p(), ev.tol() * 2.0);
@@ -1054,10 +1121,10 @@ impl Session {
}
hover = label_at(&doc, page, &self.tool.labels, ev.p()).or_else(|| leaf.map(|leaf| select_target(&doc, leaf, &sel, ev.cmd)));
// Alt over a selected layer: a drag from here duplicates it.
- if ev.alt && tool == ToolId::Move && hover.is_some_and(|h| sel.contains(&h) && !locked_in(&doc, h)) {
+ if ev.alt && !self.tool.dev_mode && tool == ToolId::Move && hover.is_some_and(|h| sel.contains(&h) && !locked_in(&doc, h)) {
cursor = Cursor::Copy;
}
- if ev.alt || self.tool.redlines {
+ if ev.alt || self.tool.dev_mode {
use crate::distance::{Hover, guide_at, hover_lines, padding_frame, parent_of};
// Shift+Alt over an auto layout frame: its padding and gaps. Otherwise from the
// selection to a ruler guide, the hovered layer or (over empty canvas) the parent.
@@ -1138,6 +1205,7 @@ impl Session {
textedit::end(self)?;
}
// Handles first: a selected ellipse's arc handles (drawn over the box), then the box's.
+ let edits = !self.tool.dev_mode;
if self.arc_handles_shown()
&& let Some((id, handle)) = crate::arc_handles::hit(&doc, &sel, ev.p(), ev.zoom)
&& let Some(arc) = crate::arc_handles::arc_of(&doc, id)
@@ -1157,7 +1225,7 @@ impl Session {
self.tool.overlay.shape = shape_hint(&doc, id, handle, ev.zoom);
return Ok(());
}
- if let Some(h) = handle_at(&doc, &sel, ev.p(), ev.zoom) {
+ if let Some(h) = handle_at(&doc, &sel, ev.p(), ev.zoom).filter(|_| edits) {
let ids = roots(&doc, &sel);
if let Handle::Rotate(_) = h {
let Some(b) = selection_box(&doc, &ids) else { return Ok(()) };
@@ -1184,12 +1252,13 @@ impl Session {
}
// A frame's name label picks the frame itself. The background of a top-level frame with
// layers in it is like the canvas (a press starts a marquee inside it) unless the frame is
- // selected; an empty frame (or a widget) is picked and dragged.
+ // selected; an empty frame (or a widget, or a board object such as a sticky) is picked and
+ // dragged.
let board_background = |leaf: NodeId| {
!sel.contains(&leaf)
- && doc
- .node(leaf)
- .is_some_and(|n| n.parent == Some(page) && n.kind.is_frame_like() && !n.children.is_empty() && !crate::widgets::is_widget(n))
+ && doc.node(leaf).is_some_and(|n| {
+ n.parent == Some(page) && n.kind.is_frame_like() && !n.children.is_empty() && !crate::widgets::is_widget(n) && !n.is_board_atom()
+ })
};
let target = label_at(&doc, page, &self.tool.labels, ev.p()).or_else(|| {
self.hit(&doc, page, ev.p(), ev.tol() * 2.0)
@@ -1216,6 +1285,13 @@ impl Session {
vec![target]
};
self.set_selection(new_sel.clone());
+ // Dev Mode only selects (Shift-click still deselects): nothing moves.
+ if !edits {
+ if deselect.is_some() {
+ self.set_selection(without_target());
+ }
+ 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 new_sel.is_empty() || doc.node(target).is_some_and(|n| n.locked) || ids.is_empty() {
@@ -1302,6 +1378,9 @@ impl Session {
let idx = doc.index_in_parent(*i).map(|x| x + 1);
copies.push(crate::components::copy_in_file(doc, *i, parent, idx)?);
}
+ // Connectors copied with what they join join the copies.
+ let map = crate::board::copy_map(doc, &ids, &copies);
+ crate::board::rejoin(doc, &crate::board::copied_items(doc, &map), &map, false);
moving = copies;
*sel = moving.clone();
}
@@ -1466,6 +1545,15 @@ impl Session {
Ok(())
}
Gesture::Vector(_) | Gesture::ShapeBuild { .. } | Gesture::Origin => Ok(()),
+ Gesture::Connect { from, start } => {
+ let (from, start) = (*from, *start);
+ self.connect_drag(ev, from, start);
+ return Ok(());
+ }
+ Gesture::Erase { gone } => {
+ self.tool.gesture = Gesture::Erase { gone: gone.clone() };
+ return self.erase_at(ev);
+ }
Gesture::PenDrag { anchor } => {
// A click's wobble pulls out no handle.
let out = if within_slop(ev, *anchor) { Vec2::ZERO } else { ev.p() - *anchor };
@@ -1842,10 +1930,17 @@ impl Session {
self.tool.tool = t;
}
}
- Gesture::Pencil { points, pressure } => {
+ Gesture::Pencil { mut points, mut pressure } => {
self.tool.overlay.pen.clear();
+ // The stroke ends where the button came up, even without a move to get there.
+ if points.last().is_none_or(|l| (*l - ev.p()).hypot() > 0.5 / ev.zoom.max(1e-6)) {
+ points.push(ev.p());
+ pressure.push(ev.pressure);
+ }
self.pencil_finish(&points, &pressure)?;
}
+ Gesture::Connect { from, start } => self.connect_up(ev, from, start)?,
+ Gesture::Erase { .. } => self.erase_up()?,
Gesture::TextSelect { .. } | Gesture::TextBox { .. } | Gesture::Marquee { .. } | Gesture::None => {}
Gesture::PenDrag { .. } | Gesture::ShapeBuild { .. } | Gesture::Origin => {}
Gesture::Vector(_) => self.commit_interaction()?,
@@ -1862,9 +1957,11 @@ impl Session {
if self.tool.tool == ToolId::Pen {
return self.pen_finish();
}
+ let edits = !self.tool.dev_mode;
// 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)
+ if edits
+ && 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())
{
@@ -1877,7 +1974,8 @@ impl Session {
return Ok(());
}
// Quick clicks on a widget's clickable part are clicks, one by one.
- if matches!(self.tool.tool, ToolId::Move | ToolId::Scale)
+ if edits
+ && matches!(self.tool.tool, ToolId::Move | ToolId::Scale)
&& !(ev.shift || ev.cmd || ev.alt)
&& self.hit(&doc, page, ev.p(), ev.tol() * 2.0).and_then(|hit| crate::widgets::target_at(&doc, hit, ev.p())).is_some()
{
@@ -1893,9 +1991,13 @@ impl Session {
self.cancel_interaction()?;
}
let Some(leaf) = self.hit(&doc, page, ev.p(), ev.tol() * 2.0) else { return Ok(()) };
+ if matches!(self.tool.tool, ToolId::Move | ToolId::Scale) && self.board_double_click(&doc, leaf, &sel)? {
+ 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(_)))
+ if edits
+ && doc.node(target).is_some_and(|n| matches!(n.kind, NodeKind::Text(_)))
&& (sel.contains(&target) || select_target(&doc, leaf, &sel, false) == target)
{
// Entering a text selects all of it; in the text being edited, the word.
@@ -1910,7 +2012,7 @@ 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) {
+ if edits && 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();
ids.retain(|i| *i != target);
ids.insert(0, target);
@@ -2238,6 +2340,9 @@ impl Session {
}
let fitted = figcraft_geom::kurbo::simplify::simplify_bezpath(poly.iter(), 0.75, &Default::default());
let d = fitted.to_svg();
+ if matches!(self.tool.tool, ToolId::Marker | ToolId::Highlighter) {
+ return self.ink_finish(&d);
+ }
let page = self.page()?;
let parent = frame_at(self.doc()?, page, points.first().copied().unwrap_or_default(), &[]).unwrap_or(page);
let pw = self.doc()?.world_transform(parent);
@@ -2263,6 +2368,10 @@ impl Session {
/// Keys the current mode handles before menu shortcuts (vector edit mode's tools and point
/// keys, Enter to finish the shape builder). Returns whether the key was used.
pub fn tool_key(&mut self, name: &str, shift: bool, alt: bool, cmd: bool) -> Result {
+ // Dev Mode edits nothing: keys go to the commands (which it refuses in the app).
+ if self.tool.dev_mode {
+ return Ok(false);
+ }
if self.ds().is_ok_and(|d| d.vector_edit.is_some()) {
return crate::vectoredit::key(self, name, shift, alt, cmd);
}
@@ -2404,6 +2513,7 @@ impl Session {
fn arc_handles_shown(&self) -> bool {
let arc_drag = matches!(self.tool.gesture, Gesture::Arc { .. } | Gesture::Shape { .. });
self.tool.tool == ToolId::Move
+ && !self.tool.dev_mode
&& (arc_drag || !self.tool.busy())
&& self.ds().is_ok_and(|ds| ds.vector_edit.is_none() && ds.text_edit.is_none())
}
diff --git a/crates/engine/tests/empty_text_box_undo.rs b/crates/engine/tests/it/empty_text_box_undo.rs
similarity index 96%
rename from crates/engine/tests/empty_text_box_undo.rs
rename to crates/engine/tests/it/empty_text_box_undo.rs
index ec73b83a..0a302ac2 100644
--- a/crates/engine/tests/empty_text_box_undo.rs
+++ b/crates/engine/tests/it/empty_text_box_undo.rs
@@ -1,5 +1,3 @@
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
-
use figcraft_engine::{
Session,
doc::NodeKind,
diff --git a/crates/engine/tests/library_style_acceptance.rs b/crates/engine/tests/it/library_style_acceptance.rs
similarity index 97%
rename from crates/engine/tests/library_style_acceptance.rs
rename to crates/engine/tests/it/library_style_acceptance.rs
index 233ddc8b..07940132 100644
--- a/crates/engine/tests/library_style_acceptance.rs
+++ b/crates/engine/tests/it/library_style_acceptance.rs
@@ -1,5 +1,4 @@
//! Accepting a library update that changes only a paint style refreshes the layers linked to it.
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::disallowed_methods)]
use figcraft_doc::{NodeId, StyleKind};
use figcraft_engine::Session;
diff --git a/crates/engine/tests/list_indent_response.rs b/crates/engine/tests/it/list_indent_response.rs
similarity index 97%
rename from crates/engine/tests/list_indent_response.rs
rename to crates/engine/tests/it/list_indent_response.rs
index 1dae8754..e6d47956 100644
--- a/crates/engine/tests/list_indent_response.rs
+++ b/crates/engine/tests/it/list_indent_response.rs
@@ -1,5 +1,4 @@
//! `text.listIndent` / `text.listOutdent` report `changed` only when the document changed.
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
use figcraft_engine::{
Session,
diff --git a/crates/engine/tests/it/main.rs b/crates/engine/tests/it/main.rs
new file mode 100644
index 00000000..a97e3434
--- /dev/null
+++ b/crates/engine/tests/it/main.rs
@@ -0,0 +1,14 @@
+//! The crate's integration tests, built as one test binary.
+
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod empty_text_box_undo;
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::disallowed_methods)]
+mod library_style_acceptance;
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod list_indent_response;
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod scope_reset;
+#[allow(clippy::unwrap_used)]
+mod selection_colors;
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod shape_builder_response;
diff --git a/crates/engine/tests/scope_reset.rs b/crates/engine/tests/it/scope_reset.rs
similarity index 95%
rename from crates/engine/tests/scope_reset.rs
rename to crates/engine/tests/it/scope_reset.rs
index 6d875d12..1838e8a9 100644
--- a/crates/engine/tests/scope_reset.rs
+++ b/crates/engine/tests/it/scope_reset.rs
@@ -1,5 +1,3 @@
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
-
use figcraft_engine::Session;
use serde_json::json;
diff --git a/crates/engine/tests/selection_colors.rs b/crates/engine/tests/it/selection_colors.rs
similarity index 99%
rename from crates/engine/tests/selection_colors.rs
rename to crates/engine/tests/it/selection_colors.rs
index e13f9f59..4e559d27 100644
--- a/crates/engine/tests/selection_colors.rs
+++ b/crates/engine/tests/it/selection_colors.rs
@@ -1,5 +1,3 @@
-#![allow(clippy::unwrap_used)]
-
use figcraft_color::Paint;
use figcraft_doc::NodeId;
use figcraft_engine::{
diff --git a/crates/engine/tests/shape_builder_response.rs b/crates/engine/tests/it/shape_builder_response.rs
similarity index 95%
rename from crates/engine/tests/shape_builder_response.rs
rename to crates/engine/tests/it/shape_builder_response.rs
index e1426823..6187e556 100644
--- a/crates/engine/tests/shape_builder_response.rs
+++ b/crates/engine/tests/it/shape_builder_response.rs
@@ -1,4 +1,3 @@
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
use figcraft_engine::Session;
use serde_json::{Value, json};
diff --git a/crates/format/src/thumbnail.rs b/crates/format/src/thumbnail.rs
index a5e7e2b3..76ebcf4e 100644
--- a/crates/format/src/thumbnail.rs
+++ b/crates/format/src/thumbnail.rs
@@ -109,6 +109,8 @@ pub fn file_thumbnail(path: &Path, fit: u32) -> Option {
pub struct Preview {
pub page: Option<[f32; 4]>,
pub picture: Option,
+ /// A design file or a board (`.fig` files and images: design).
+ pub kind: figcraft_doc::FileKind,
}
/// The [`Preview`] of the file at `path`, its picture at most `fit` pixels on its longer side.
@@ -119,7 +121,7 @@ pub fn file_preview(path: &Path, fit: u32) -> Preview {
let Ok(file) = std::fs::File::open(path) else { return Preview::default() };
archive_preview(std::io::BufReader::new(file), fit)
}
- FileKind::Image => Preview { page: None, picture: file_thumbnail(path, fit) },
+ FileKind::Image => Preview { picture: file_thumbnail(path, fit), ..Preview::default() },
FileKind::Svg | FileKind::Other => Preview::default(),
}
}
@@ -129,31 +131,33 @@ pub fn file_preview(path: &Path, fit: u32) -> Preview {
pub fn archive_preview(archive: R, fit: u32) -> Preview {
let Ok(mut z) = zip::ZipArchive::new(archive) else { return Preview::default() };
let picture = crate::read_member(&mut z, "thumbnail.png", MAX_THUMBNAIL_BYTES).ok().and_then(|png| decode_thumbnail(&png, fit));
- let page = if z.file_names().any(|n| n == "document.json") {
- crate::read_member(&mut z, "document.json", MAX_DOCUMENT_BYTES).ok().and_then(|json| figcraft_page(&json))
+ let (page, kind) = if z.file_names().any(|n| n == "document.json") {
+ crate::read_member(&mut z, "document.json", MAX_DOCUMENT_BYTES).ok().map(|json| figcraft_page(&json)).unwrap_or_default()
} else {
- crate::read_member(&mut z, "meta.json", MAX_META_BYTES).ok().and_then(|json| fig_page(&json))
+ (crate::read_member(&mut z, "meta.json", MAX_META_BYTES).ok().and_then(|json| fig_page(&json)), figcraft_doc::FileKind::Design)
};
- Preview { page, picture }
+ Preview { page, picture, kind }
}
-/// The first page's background in a `.figcraft` `document.json`.
-fn figcraft_page(json: &[u8]) -> Option<[f32; 4]> {
+/// The first page's background in a `.figcraft` `document.json`, and the file's kind.
+fn figcraft_page(json: &[u8]) -> (Option<[f32; 4]>, figcraft_doc::FileKind) {
#[derive(serde::Deserialize)]
struct Head {
#[serde(default)]
pages: Vec,
#[serde(default)]
nodes: std::collections::BTreeMap,
+ #[serde(default)]
+ kind: figcraft_doc::FileKind,
}
#[derive(serde::Deserialize)]
struct Node {
#[serde(default)]
background: Option,
}
- let head: Head = serde_json::from_slice(json).ok()?;
- let first = head.pages.first()?;
- rgba(head.nodes.get(&first.to_string())?.background.as_ref()?)
+ let Ok(head) = serde_json::from_slice::(json) else { return (None, figcraft_doc::FileKind::Design) };
+ let page = head.pages.first().and_then(|first| head.nodes.get(&first.to_string())).and_then(|n| n.background.as_ref()).and_then(rgba);
+ (page, head.kind)
}
/// The canvas colour a `.fig` file's `meta.json` gives (`client_meta.background_color`).
diff --git a/crates/format/src/thumbnail_tests.rs b/crates/format/src/thumbnail_tests.rs
index 864c0f24..eeaeaba5 100644
--- a/crates/format/src/thumbnail_tests.rs
+++ b/crates/format/src/thumbnail_tests.rs
@@ -148,7 +148,12 @@ fn previews_carry_the_first_pages_colour() {
assert!(p.picture.is_some());
// A file with nothing on it: its colour, no picture.
let bytes = crate::save_bytes(&doc_on([0.9, 0.9, 0.9]), None).unwrap();
- assert_eq!(archive_preview(Cursor::new(&bytes), 640), Preview { page: Some([0.9, 0.9, 0.9, 1.0]), picture: None });
+ assert_eq!(archive_preview(Cursor::new(&bytes), 640), Preview { page: Some([0.9, 0.9, 0.9, 1.0]), picture: None, kind: Default::default() });
+ // A board says so (the home screen marks it).
+ let mut board = doc_on([0.9, 0.9, 0.9]);
+ board.kind = figcraft_doc::FileKind::Board;
+ let bytes = crate::save_bytes(&board, None).unwrap();
+ assert_eq!(archive_preview(Cursor::new(&bytes), 640).kind, figcraft_doc::FileKind::Board);
// Damaged or odd metadata: no colour, never a panic.
for meta in [&b"{"[..], b"{\"client_meta\":{\"background_color\":{\"r\":\"x\",\"g\":0,\"b\":0}}}", b"[]", b"{\"client_meta\":7}"] {
assert_eq!(archive_preview(Cursor::new(zip(&[("meta.json", meta)])), 640).page, None, "{}", String::from_utf8_lossy(meta));
diff --git a/crates/format/tests/distributed_alignment.rs b/crates/format/tests/it/distributed_alignment.rs
similarity index 100%
rename from crates/format/tests/distributed_alignment.rs
rename to crates/format/tests/it/distributed_alignment.rs
diff --git a/crates/format/tests/import_link_contract.rs b/crates/format/tests/it/import_link_contract.rs
similarity index 100%
rename from crates/format/tests/import_link_contract.rs
rename to crates/format/tests/it/import_link_contract.rs
diff --git a/crates/format/tests/it/main.rs b/crates/format/tests/it/main.rs
new file mode 100644
index 00000000..6286e8db
--- /dev/null
+++ b/crates/format/tests/it/main.rs
@@ -0,0 +1,5 @@
+//! The crate's integration tests, built as one test binary.
+
+mod distributed_alignment;
+mod import_link_contract;
+mod range_hyperlink_round_trip;
diff --git a/crates/format/tests/range_hyperlink_round_trip.rs b/crates/format/tests/it/range_hyperlink_round_trip.rs
similarity index 100%
rename from crates/format/tests/range_hyperlink_round_trip.rs
rename to crates/format/tests/it/range_hyperlink_round_trip.rs
diff --git a/crates/mcp/tests/agent_tasks.rs b/crates/mcp/tests/it/agent_tasks.rs
similarity index 99%
rename from crates/mcp/tests/agent_tasks.rs
rename to crates/mcp/tests/it/agent_tasks.rs
index b35f3e7f..b83fc3b8 100644
--- a/crates/mcp/tests/agent_tasks.rs
+++ b/crates/mcp/tests/it/agent_tasks.rs
@@ -1,8 +1,7 @@
//! End-to-end agent tasks: an in-process MCP client completes realistic design tasks only through
//! MCP tool calls, and checks every result through inspect_document / get_node like an agent would.
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
-mod common;
+use crate::common;
use common::{Client, approx, png_dims};
use serde_json::{Value, json};
diff --git a/crates/mcp/tests/attached.rs b/crates/mcp/tests/it/attached.rs
similarity index 99%
rename from crates/mcp/tests/attached.rs
rename to crates/mcp/tests/it/attached.rs
index 69194604..f1343dd2 100644
--- a/crates/mcp/tests/attached.rs
+++ b/crates/mcp/tests/it/attached.rs
@@ -1,6 +1,5 @@
//! The attached backend against a fake app: a loopback control server answering with a headless
//! session, speaking the desktop app's JSON-lines protocol.
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
use std::io::{BufRead, BufReader, Write};
use std::net::TcpListener;
diff --git a/crates/mcp/tests/automation_roots.rs b/crates/mcp/tests/it/automation_roots.rs
similarity index 98%
rename from crates/mcp/tests/automation_roots.rs
rename to crates/mcp/tests/it/automation_roots.rs
index ced1e145..aa8e1b24 100644
--- a/crates/mcp/tests/automation_roots.rs
+++ b/crates/mcp/tests/it/automation_roots.rs
@@ -1,6 +1,5 @@
//! `--automation-read-root` / `--automation-write-root` over MCP (#715): a tool call reads only
//! inside the read and write roots and writes only inside the write roots.
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::disallowed_methods)]
use std::path::PathBuf;
diff --git a/crates/mcp/tests/common/mod.rs b/crates/mcp/tests/it/common/mod.rs
similarity index 97%
rename from crates/mcp/tests/common/mod.rs
rename to crates/mcp/tests/it/common/mod.rs
index be4dcea2..51e74865 100644
--- a/crates/mcp/tests/common/mod.rs
+++ b/crates/mcp/tests/it/common/mod.rs
@@ -1,5 +1,4 @@
//! An in-process MCP client: feeds JSON-RPC lines to `Server::handle_line`.
-#![allow(dead_code, clippy::unwrap_used, clippy::expect_used, clippy::panic)]
use figcraft_mcp::Server;
use serde_json::{Value, json};
diff --git a/crates/mcp/tests/export_hidden_roots.rs b/crates/mcp/tests/it/export_hidden_roots.rs
similarity index 96%
rename from crates/mcp/tests/export_hidden_roots.rs
rename to crates/mcp/tests/it/export_hidden_roots.rs
index ded6f731..0a3b8de4 100644
--- a/crates/mcp/tests/export_hidden_roots.rs
+++ b/crates/mcp/tests/it/export_hidden_roots.rs
@@ -1,7 +1,6 @@
//! Hidden top-level layers in an export take no room in the image (issue #447).
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
-mod common;
+use crate::common;
use common::{Client, png_dims};
use serde_json::{Value, json};
diff --git a/crates/mcp/tests/garbage.rs b/crates/mcp/tests/it/garbage.rs
similarity index 98%
rename from crates/mcp/tests/garbage.rs
rename to crates/mcp/tests/it/garbage.rs
index 262934c7..5d9e237e 100644
--- a/crates/mcp/tests/garbage.rs
+++ b/crates/mcp/tests/it/garbage.rs
@@ -1,5 +1,4 @@
//! Fuzz-ish: no input line may crash the server or leave it unable to answer.
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
use figcraft_mcp::{Server, TOOL_NAMES};
use proptest::prelude::*;
diff --git a/crates/mcp/tests/it/main.rs b/crates/mcp/tests/it/main.rs
new file mode 100644
index 00000000..b5e3d89d
--- /dev/null
+++ b/crates/mcp/tests/it/main.rs
@@ -0,0 +1,18 @@
+//! The crate's integration tests, built as one test binary.
+
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod agent_tasks;
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod attached;
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::disallowed_methods)]
+mod automation_roots;
+#[allow(dead_code, clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod common;
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod export_hidden_roots;
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod garbage;
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod protocol;
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod screenshot_pixel_limit;
diff --git a/crates/mcp/tests/protocol.rs b/crates/mcp/tests/it/protocol.rs
similarity index 99%
rename from crates/mcp/tests/protocol.rs
rename to crates/mcp/tests/it/protocol.rs
index 6e943a1e..617790f4 100644
--- a/crates/mcp/tests/protocol.rs
+++ b/crates/mcp/tests/it/protocol.rs
@@ -1,7 +1,6 @@
//! JSON-RPC / MCP protocol behaviour.
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
-mod common;
+use crate::common;
use common::Client;
use figcraft_mcp::{PROTOCOL_VERSION, Server, TOOL_NAMES};
diff --git a/crates/mcp/tests/screenshot_pixel_limit.rs b/crates/mcp/tests/it/screenshot_pixel_limit.rs
similarity index 96%
rename from crates/mcp/tests/screenshot_pixel_limit.rs
rename to crates/mcp/tests/it/screenshot_pixel_limit.rs
index 095992ff..e575f1d5 100644
--- a/crates/mcp/tests/screenshot_pixel_limit.rs
+++ b/crates/mcp/tests/it/screenshot_pixel_limit.rs
@@ -1,6 +1,5 @@
//! `screenshot` with `ids` must honour `maxSize` for the rendered paint area (shadows, overflow).
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
-mod common;
+use crate::common;
use common::{Client, png_dims};
use serde_json::{Value, json};
diff --git a/crates/ui-egui/Cargo.toml b/crates/ui-egui/Cargo.toml
index 65a3592d..09cd2226 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/locales/bn.toml b/crates/ui-egui/locales/bn.toml
index adedc983..3e2ce652 100644
--- a/crates/ui-egui/locales/bn.toml
+++ b/crates/ui-egui/locales/bn.toml
@@ -126,6 +126,7 @@ status = "draft — needs native review"
"Archived" = "আর্কাইভ করা হয়েছে"
"Arrange" = "সাজান"
"Arrow" = "তীর"
+"Arrow at the end" = "শেষে তীর"
"As typed" = "যেমনটি টাইপ করা হয়েছে"
"Asking the server…" = "সার্ভারকে জিজ্ঞাসা করা হচ্ছে..."
"Assets" = "অ্যাসেট"
@@ -199,12 +200,15 @@ status = "draft — needs native review"
"C or ⇧C" = "C বা ⇧C"
"CMYK colour" = "CMYK রঙ"
"Can view" = "দেখতে পারেন"
+"Check" = "টিক"
"Checking the fonts installed on this computer…" = "এই কম্পিউটারে ইনস্টল করা ফন্টগুলো চেক করা হচ্ছে..."
"Checking the server…" = "সার্ভার চেক করা হচ্ছে..."
+"Chevron" = "শেভরন"
"Clear from this list" = "এই তালিকা থেকে মুছে ফেলুন"
"Code or invite link" = "কোড বা আমন্ত্রণ লিংক"
"Color profile: {name}" = "কালার প্রোফাইল: {name}"
"Colour and text styles, Light and Dark variables, buttons, inputs and cards" = "রঙ ও টেক্সট স্টাইল, লাইট এবং ডার্ক ভেরিয়েবল, বোতাম, ইনপুট এবং কার্ড"
+"Connector" = "সংযোগকারী"
"Convert to frame" = "ফ্রেম রূপান্তর করুন"
"Convert to section" = "সেকশনে রূপান্তর করুন"
"CSS custom properties…" = "CSS কাস্টম প্রপার্টি..."
@@ -378,6 +382,7 @@ status = "draft — needs native review"
"Description" = "বিবরণ"
"Description (optional)" = "বিবরণ (ঐচ্ছিক)"
"Design" = "ডিজাইন"
+"Design panel" = "ডিজাইন প্যানেল"
"Design system starter" = "ডিজাইন সিস্টেম স্টার্টার"
"Desktop" = "ডেস্কটপ"
"Destination" = "গন্তব্য"
@@ -440,6 +445,7 @@ status = "draft — needs native review"
"Effect settings" = "ইফেক্ট সেটিংস"
"Effect styles" = "ইফেক্ট স্টাইল"
"Effects" = "ইফেক্টসমূহ"
+"Elbow" = "কোণযুক্ত"
"Ellipse" = "উপবৃত্ত"
"Ellipses" = "উপবৃত্তসমূহ"
"Else" = "অন্যথায় (Else)"
@@ -576,6 +582,7 @@ status = "draft — needs native review"
"Hanging list" = "হ্যাংগিং তালিকা"
"Hanging punctuation" = "হ্যাংগিং বিরামচিহ্ন"
"Hard light" = "হার্ড লাইট"
+"Heart" = "হৃদয়"
"Height" = "উচ্চতা"
"Help" = "সহায়তা"
"Help and resources" = "সহায়তা ও রিসোর্স"
@@ -588,6 +595,7 @@ status = "draft — needs native review"
"Hide these tips (Getting started in the Help menu shows them again)" = "এই টিপসগুলো লুকান (সহায়তা মেনুর 'শুরু করা' অপশনটি এগুলো আবার দেখাবে)"
"Hide when publishing" = "প্রকাশ করার সময় লুকান"
"Highlight layers on hover" = "হোভারে লেয়ার হাইলাইট করুন"
+"Highlighter" = "হাইলাইটার"
"Highlights" = "হাইলাইটস"
"Hold Alt" = "Alt চেপে ধরে রাখুন"
"Hold Alt+Z" = "Alt+Z চেপে ধরে রাখুন"
@@ -754,6 +762,7 @@ status = "draft — needs native review"
"Mark as resolved" = "সমাধানকৃত হিসেবে চিহ্নিত করুন"
"Mark as unread" = "অপঠিত হিসেবে চিহ্নিত করুন"
"Mark as unresolved" = "অমীমাংসিত হিসেবে চিহ্নিত করুন"
+"Marker" = "মার্কার"
"Mask" = "মাস্ক"
"Mass · Stiffness · Damping" = "ভর · দৃঢ়তা · ড্যাম্পিং"
"Match (empty: the whole name)" = "মেলবন্ধন (খালি: সম্পূর্ণ নাম)"
@@ -813,6 +822,7 @@ status = "draft — needs native review"
"Named instance" = "নামকৃত ইনস্ট্যান্স"
"Navigate to" = "এতে যান"
"Nested instance" = "নেস্টেড ইনস্ট্যান্স"
+"New board" = "নতুন বোর্ড"
"New design file" = "নতুন ডিজাইন ফাইল"
"Newest first" = "সবচেয়ে নতুন প্রথমে"
"Next or previous control in the focused region" = "ফোকাসড অঞ্চলের পরবর্তী বা পূর্ববর্তী কন্ট্রোল"
@@ -953,6 +963,7 @@ status = "draft — needs native review"
"Page" = "পেজ"
"Pages" = "পেজসমূহ"
"Pages added to the document" = "ডকুমেন্টে পেজ যোগ করা হয়েছে"
+"Pink" = "গোলাপি"
"Placed on the current page" = "বর্তমান পেজে রাখা হয়েছে"
"Pages: {pages}" = "পেজসমূহ: {pages}"
"Paint bucket" = "পেইন্ট বালতি"
@@ -997,6 +1008,7 @@ status = "draft — needs native review"
"Plugins & widgets" = "প্লাগইন ও উইজেট"
"Plus darker" = "প্লাস অন্ধকার"
"Plus lighter" = "প্লাস হালকা"
+"Plus one" = "প্লাস ওয়ান"
"Point" = "বিন্দু"
"Points" = "বিন্দুসমূহ"
"Polygon" = "বহুভুজ"
@@ -1045,6 +1057,7 @@ status = "draft — needs native review"
"Push" = "পুশ"
"Push changes to main component" = "প্রধান কম্পোনেন্টে পরিবর্তন পুশ করুন"
"Put text on path" = "পাথে টেক্সট রাখুন"
+"Question" = "প্রশ্ন"
"R" = "R"
"Radial" = "রেডিয়াল"
"Radius" = "ব্যাসার্ধ"
@@ -1145,6 +1158,7 @@ status = "draft — needs native review"
"Rotation jitter" = "ঘূর্ণন জিটার"
"Round" = "গোল"
"Rounded" = "গোল করা"
+"Rounded rectangle" = "গোলাকার আয়তক্ষেত্র"
"Row" = "সারি"
"Row gap" = "সারির গ্যাপ"
"Row sizes" = "সারির আকার"
@@ -1220,6 +1234,7 @@ status = "draft — needs native review"
"Shape" = "শেপ"
"Shape builder" = "শেপ বিল্ডার"
"Shape tools" = "শেপ টুলস"
+"Shapes" = "আকৃতি"
"Share" = "শেয়ার"
"Share this file" = "এই ফাইলটি শেয়ার করুন"
"Share with a code" = "কোড দিয়ে শেয়ার করুন"
@@ -1286,10 +1301,13 @@ status = "draft — needs native review"
"Space+drag" = "Space+ড্র্যাগ"
"Spacing" = "ব্যবধান"
"Spam, stolen work, abuse…" = "স্প্যাম, চুরি করা কাজ, অপব্যবহার..."
+"Speech bubble" = "কথার বুদবুদ"
"Splay" = "সপ্লে"
"Spotlight me" = "আমাকে স্পটলাইট করুন"
"Spread" = "স্প্রেড"
"Square" = "বর্গক্ষেত্র"
+"Stamp" = "স্ট্যাম্প"
+"Stamps" = "স্ট্যাম্পগুলি"
"Standard" = "স্ট্যান্ডার্ড"
"Standard ligatures" = "স্ট্যান্ডার্ড লিগেচার"
"Star" = "তারকা"
@@ -1305,12 +1323,16 @@ status = "draft — needs native review"
"Starting to share…" = "শেয়ার করা শুরু হচ্ছে..."
"Status" = "স্ট্যাটাস"
"Sticky" = "স্টিকি"
+"Sticky note" = "স্টিকি নোট"
+"Sticky note colors" = "স্টিকি নোটের রং"
+"Sticky notes, shapes and connectors" = "স্টিকি নোট, আকৃতি ও সংযোগকারী"
"Stop" = "থামুন"
"Stop following {name}" = "{name}-কে অনুসরণ করা বন্ধ করুন"
"Stop session" = "সেশন বন্ধ করুন"
"Stop sharing" = "শেয়ার করা বন্ধ করুন"
"Stop spotlighting" = "স্পটলাইটিং বন্ধ করুন"
"Stop {n} {hex}" = "স্টপ {n} {hex}"
+"Straight" = "সোজা"
"Stretch" = "টেনে বড় করা (Stretch)"
"Strikethrough" = "স্ট্রাইকথ্রু"
"String" = "স্ট্রিং"
@@ -1355,6 +1377,7 @@ status = "draft — needs native review"
"Text" = "টেক্সট"
"Text align" = "টেক্সট সারিবদ্ধকরণ"
"Text content" = "টেক্সট কন্টেন্ট"
+"Text size" = "লেখার আকার"
"Text style" = "টেক্সট স্টাইল"
"Text styles" = "টেক্সট স্টাইলসমূহ"
"Texts" = "টেক্সটসমূহ"
@@ -1389,6 +1412,7 @@ status = "draft — needs native review"
"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) দেখুন।"
+"Thumbs up" = "বুড়ো আঙুল উঁচু"
"Tidy up" = "পরিপাটি করুন"
"Tile" = "টাইল"
"Tile type" = "টাইল টাইপ"
@@ -1405,6 +1429,7 @@ status = "draft — needs native review"
"Top left radius" = "ওপরের বাম ব্যাসার্ধ"
"Top right radius" = "ওপরের ডান ব্যাসার্ধ"
"Transform" = "ট্রান্সফর্ম"
+"Triangle" = "ত্রিভুজ"
"Triangle arrow" = "ত্রিভুজ তীর"
"Trigger" = "ট্রিগার"
"True" = "সত্য (True)"
@@ -1739,3 +1764,23 @@ status = "draft — needs native review"
"⌘ click" = "⌘ ক্লিক"
"⌘ scroll" = "⌘ স্ক্রল"
"⌥ drag" = "⌥ ড্র্যাগ"
+
+
+[commands]
+"board.connector" = "সংযোগকারী"
+"board.ink" = "মার্কারের টান"
+"board.label" = "সংযোগকারীর লেবেল"
+"board.nextSticky" = "পরের স্টিকি নোট"
+"board.setColor" = "বোর্ডের রং"
+"board.setStyle" = "বোর্ডের শৈলী"
+"board.shape" = "লেখাসহ আকৃতি"
+"board.stamp" = "স্ট্যাম্প"
+"board.sticky" = "স্টিকি নোট"
+"file.newBoard" = "নতুন বোর্ড"
+"tool.connector" = "সংযোগকারী"
+"tool.eraser" = "ইরেজার"
+"tool.highlighter" = "হাইলাইটার"
+"tool.marker" = "মার্কার"
+"tool.shape" = "আকৃতি"
+"tool.stamp" = "স্ট্যাম্প"
+"tool.sticky" = "স্টিকি নোট"
diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml
index eea0e8dc..6544b7b8 100644
--- a/crates/ui-egui/locales/cs.toml
+++ b/crates/ui-egui/locales/cs.toml
@@ -120,6 +120,7 @@ status = "draft — needs native review"
"Archived" = "Archivováno"
"Arrange" = "Uspořádat"
"Arrow" = "Šipka"
+"Arrow at the end" = "Šipka na konci"
"As typed" = "Podle zadání"
"Asking the server…" = "Dotazování serveru…"
"Assets" = "Zdroje"
@@ -193,7 +194,9 @@ status = "draft — needs native review"
"C or ⇧C" = "C nebo ⇧C"
"CMYK colour" = "Barva CMYK"
"Can view" = "Může prohlížet"
+"Check" = "Fajfka"
"Checking the server…" = "Kontrola serveru…"
+"Chevron" = "Lomená šipka"
"Clear from this list" = "Vymazat z tohoto seznamu"
"Code or invite link" = "Kód nebo odkaz s pozvánkou"
"Color profile: {name}" = "Barevný profil: {name}"
@@ -282,6 +285,7 @@ status = "draft — needs native review"
"Connected" = "Připojeno"
"Connected to code: {from}" = "Propojeno s kódem: {from}"
"Connection lost, reconnecting (attempt {attempt})…" = "Spojení ztraceno, opětovné připojování (pokus {attempt})…"
+"Connector" = "Spojnice"
"Constrain proportions" = "Zachovat poměr stran"
"Constraints" = "Omezení"
"Content" = "Obsah"
@@ -368,6 +372,7 @@ status = "draft — needs native review"
"Description" = "Popis"
"Description (optional)" = "Popis (nepovinný)"
"Design" = "Návrh"
+"Design panel" = "Panel návrhu"
"Design system starter" = "Základ design systému"
"Desktop" = "Počítač"
"Destination" = "Cíl"
@@ -427,6 +432,7 @@ status = "draft — needs native review"
"Effect settings" = "Nastavení efektu"
"Effect styles" = "Styly efektů"
"Effects" = "Efekty"
+"Elbow" = "Lomená"
"Ellipse" = "Elipsa"
"Ellipses" = "Elipsy"
"Else" = "Jinak"
@@ -562,6 +568,7 @@ status = "draft — needs native review"
"Hanging list" = "Předsazený seznam"
"Hanging punctuation" = "Předsazená interpunkce"
"Hard light" = "Tvrdé světlo"
+"Heart" = "Srdce"
"Height" = "Výška"
"Help" = "Nápověda"
"Help and resources" = "Nápověda a zdroje"
@@ -574,6 +581,7 @@ status = "draft — needs native review"
"Hide these tips (Getting started in the Help menu shows them again)" = "Skrýt tyto tipy (znovu je zobrazíte volbou Začínáme v nabídce Nápověda)"
"Hide when publishing" = "Skrýt při publikování"
"Highlight layers on hover" = "Zvýraznit vrstvy pod ukazatelem"
+"Highlighter" = "Zvýrazňovač"
"Highlights" = "Světla"
"Hold Alt" = "Podržte Alt"
"Hold Alt+Z" = "Podržte Alt+Z"
@@ -739,6 +747,7 @@ status = "draft — needs native review"
"Mark as resolved" = "Označit jako vyřešené"
"Mark as unread" = "Označit jako nepřečtené"
"Mark as unresolved" = "Označit jako nevyřešené"
+"Marker" = "Fix"
"Mask" = "Maska"
"Mass · Stiffness · Damping" = "Hmotnost · Tuhost · Tlumení"
"Match (empty: the whole name)" = "Hledaný text (prázdné: celý název)"
@@ -797,6 +806,7 @@ status = "draft — needs native review"
"Named instance" = "Pojmenovaná instance"
"Navigate to" = "Přejít na"
"Nested instance" = "Vnořená instance"
+"New board" = "Nová tabule"
"New design file" = "Nový soubor návrhu"
"Newest first" = "Od nejnovějších"
"Next frame" = "Další rámec"
@@ -933,6 +943,7 @@ status = "draft — needs native review"
"Page deleted" = "Stránka smazána"
"Pages" = "Stránky"
"Pages added to the document" = "Stránky přidány do dokumentu"
+"Pink" = "Růžová"
"Placed on the current page" = "Umístěno na aktuální stránku"
"Pages: {pages}" = "Stránky: {pages}"
"Paint bucket" = "Plechovka barvy"
@@ -975,6 +986,7 @@ status = "draft — needs native review"
"Plugins" = "Pluginy"
"Plus darker" = "Sčítání se ztmavením"
"Plus lighter" = "Sčítání se zesvětlením"
+"Plus one" = "Plus jedna"
"Point" = "Bod"
"Points" = "Body"
"Polygon" = "Mnohoúhelník"
@@ -1023,6 +1035,7 @@ status = "draft — needs native review"
"Push" = "Vytlačení"
"Push changes to main component" = "Přenést změny do hlavní komponenty"
"Put text on path" = "Umístit text na cestu"
+"Question" = "Otázka"
"R" = "R"
"Radial" = "Kruhový"
"Radius" = "Poloměr"
@@ -1122,6 +1135,7 @@ status = "draft — needs native review"
"Rotation jitter" = "Náhodná odchylka natočení"
"Round" = "Kulatý"
"Rounded" = "Zaoblený"
+"Rounded rectangle" = "Zaoblený obdélník"
"Row" = "Řádek"
"Row gap" = "Mezera mezi řádky"
"Row sizes" = "Velikosti řádků"
@@ -1194,6 +1208,7 @@ status = "draft — needs native review"
"Shape" = "Tvar"
"Shape builder" = "Tvorba tvarů"
"Shape tools" = "Nástroje tvarů"
+"Shapes" = "Tvary"
"Share" = "Sdílet"
"Share this file" = "Sdílet tento soubor"
"Share with a code" = "Sdílet pomocí kódu"
@@ -1260,10 +1275,13 @@ status = "draft — needs native review"
"Space+drag" = "Mezerník+tažení"
"Spacing" = "Rozestupy"
"Spam, stolen work, abuse…" = "Spam, odcizená práce, zneužití…"
+"Speech bubble" = "Bublina"
"Splay" = "Rozevření"
"Spotlight me" = "Sdílet můj pohled"
"Spread" = "Rozšíření"
"Square" = "Čtverec"
+"Stamp" = "Razítko"
+"Stamps" = "Razítka"
"Standard" = "Standardní"
"Standard ligatures" = "Standardní ligatury"
"Star" = "Hvězda"
@@ -1279,12 +1297,16 @@ status = "draft — needs native review"
"Starting to share…" = "Zahajování sdílení…"
"Status" = "Stav"
"Sticky" = "Přichycené"
+"Sticky note" = "Lepicí poznámka"
+"Sticky note colors" = "Barvy lepicích poznámek"
+"Sticky notes, shapes and connectors" = "Lepicí poznámky, tvary a spojnice"
"Stop" = "Zastavit"
"Stop following {name}" = "Přestat sledovat: {name}"
"Stop session" = "Ukončit relaci"
"Stop sharing" = "Zastavit sdílení"
"Stop spotlighting" = "Ukončit sdílení pohledu"
"Stop {n} {hex}" = "Zarážka {n} {hex}"
+"Straight" = "Rovná"
"Stretch" = "Roztáhnout"
"Strikethrough" = "Přeškrtnutí"
"String" = "Textový řetězec"
@@ -1329,6 +1351,7 @@ status = "draft — needs native review"
"Text" = "Text"
"Text align" = "Zarovnání textu"
"Text content" = "Textový obsah"
+"Text size" = "Velikost textu"
"Text style" = "Textový styl"
"Text styles" = "Textové styly"
"Texts" = "Texty"
@@ -1359,6 +1382,7 @@ status = "draft — needs native review"
"This server is open to the public: no key needed." = "Tento server je veřejný: klíč není potřeba."
"This server needs its key: add ?key=… to the address (`figcraft-server key` prints it on the server's machine)." = "Tento server vyžaduje klíč: přidejte do adresy ?key=… (příkaz `figcraft-server key` ho vypíše na počítači serveru)."
"This server takes files only with its key: see Advanced." = "Tento server přijímá soubory pouze s klíčem: viz Pokročilé."
+"Thumbs up" = "Palec nahoru"
"Tidy up" = "Uspořádat"
"Tile" = "Dlaždice"
"Tile type" = "Typ dlaždic"
@@ -1375,6 +1399,7 @@ status = "draft — needs native review"
"Top left radius" = "Poloměr levého horního rohu"
"Top right radius" = "Poloměr pravého horního rohu"
"Transform" = "Transformace"
+"Triangle" = "Trojúhelník"
"Triangle arrow" = "Trojúhelníková šipka"
"Trigger" = "Spouštěč"
"True" = "Pravda"
@@ -1729,6 +1754,15 @@ status = "draft — needs native review"
"arrange.roundToPixels" = "Zaokrouhlit na pixely"
"arrange.spacing" = "Rozestupy"
"arrange.tidy" = "Uspořádat"
+"board.connector" = "Spojnice"
+"board.ink" = "Tah fixem"
+"board.label" = "Popisek spojnice"
+"board.nextSticky" = "Další lepicí poznámka"
+"board.setColor" = "Barva na tabuli"
+"board.setStyle" = "Styl na tabuli"
+"board.shape" = "Tvar s textem"
+"board.stamp" = "Razítko"
+"board.sticky" = "Lepicí poznámka"
"bool.exclude" = "Vyloučit výběr"
"bool.flatten" = "Sloučit booleovskou skupinu do vektoru"
"bool.intersect" = "Průnik výběru"
@@ -1854,6 +1888,7 @@ status = "draft — needs native review"
"file.import" = "Importovat"
"file.moveTab" = "Přesunout kartu"
"file.new" = "Nový soubor návrhu"
+"file.newBoard" = "Nová tabule"
"file.newFromTemplate" = "Nový ze šablony"
"file.open" = "Otevřít"
"file.openRecent" = "Otevřít nedávné"
@@ -2120,10 +2155,14 @@ status = "draft — needs native review"
"text.weightUp" = "Zvětšit tloušťku písma"
"tool.arrow" = "Šipka"
"tool.comment" = "Komentář"
+"tool.connector" = "Spojnice"
"tool.ellipse" = "Elipsa"
+"tool.eraser" = "Guma"
"tool.frame" = "Rámec"
"tool.hand" = "Ruka"
+"tool.highlighter" = "Zvýrazňovač"
"tool.line" = "Čára"
+"tool.marker" = "Fix"
"tool.move" = "Přesunout"
"tool.pen" = "Pero"
"tool.pencil" = "Tužka"
@@ -2135,9 +2174,12 @@ status = "draft — needs native review"
"tool.scaleAnchor" = "Kotva měřítka"
"tool.section" = "Sekce"
"tool.set" = "Vybrat nástroj"
+"tool.shape" = "Tvary"
"tool.shapeBuilder" = "Tvorba tvarů"
"tool.slice" = "Výřez"
+"tool.stamp" = "Razítko"
"tool.star" = "Hvězda"
+"tool.sticky" = "Lepicí poznámka"
"tool.text" = "Text"
"transform.move" = "Přesunout"
"transform.moveTo" = "Přesunout na"
diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml
index f61464b8..b8cf80ef 100644
--- a/crates/ui-egui/locales/de.toml
+++ b/crates/ui-egui/locales/de.toml
@@ -118,6 +118,7 @@ status = "draft — needs native review"
"Archived" = "Archiviert"
"Arrange" = "Anordnen"
"Arrow" = "Pfeil"
+"Arrow at the end" = "Pfeil am Ende"
"As typed" = "Wie eingegeben"
"Asking the server…" = "Server wird gefragt…"
"Assets" = "Assets"
@@ -189,7 +190,9 @@ status = "draft — needs native review"
"C or ⇧C" = "C oder ⇧C"
"CMYK colour" = "CMYK-Farbe"
"Can view" = "Kann ansehen"
+"Check" = "Häkchen"
"Checking the server…" = "Server wird geprüft…"
+"Chevron" = "Chevron"
"Clear from this list" = "Aus dieser Liste entfernen"
"Code or invite link" = "Code oder Einladungslink"
"Color profile: {name}" = "Farbprofil: {name}"
@@ -262,6 +265,7 @@ status = "draft — needs native review"
"Commits" = "Commits"
"Company" = "Unternehmen"
"Compare changes" = "Änderungen vergleichen"
+"Compare with" = "Vergleichen mit"
"Compatibility notes" = "Hinweise zur Kompatibilität"
"Completed" = "Abgeschlossen"
"Component" = "Komponente"
@@ -277,6 +281,7 @@ status = "draft — needs native review"
"Connected" = "Verbunden"
"Connected to code: {from}" = "Mit Code verbunden: {from}"
"Connection lost, reconnecting (attempt {attempt})…" = "Verbindung verloren, neuer Versuch ({attempt})…"
+"Connector" = "Verbinder"
"Constrain proportions" = "Proportionen beibehalten"
"Constraints" = "Constraints"
"Content" = "Inhalt"
@@ -361,6 +366,7 @@ status = "draft — needs native review"
"Description" = "Beschreibung"
"Description (optional)" = "Beschreibung (optional)"
"Design" = "Design"
+"Design panel" = "Design-Bereich"
"Desktop" = "Desktop"
"Destination" = "Ziel"
"Detach alias" = "Alias lösen"
@@ -371,6 +377,7 @@ status = "draft — needs native review"
"Detach variable" = "Variable lösen"
"Details" = "Details"
"Dev Mode" = "Entwicklermodus"
+"Dev Mode only inspects: switch to Design (Shift+D) to edit" = "Der Entwicklermodus prüft nur: Wechseln Sie zu Design (Shift+D), um zu bearbeiten"
"Dev resources" = "Entwicklerressourcen"
"Development" = "Entwicklung"
"Device" = "Gerät"
@@ -420,6 +427,7 @@ status = "draft — needs native review"
"Effect settings" = "Effekteinstellungen"
"Effect styles" = "Effektstile"
"Effects" = "Effekte"
+"Elbow" = "Gewinkelt"
"Ellipse" = "Ellipse"
"Ellipses" = "Ellipsen"
"Else" = "Sonst"
@@ -550,6 +558,7 @@ status = "draft — needs native review"
"Hanging list" = "Hängende Liste"
"Hanging punctuation" = "Hängende Interpunktion"
"Hard light" = "Hartes Licht"
+"Heart" = "Herz"
"Height" = "Höhe"
"Help" = "Hilfe"
"Help and resources" = "Hilfe und Ressourcen"
@@ -560,6 +569,7 @@ status = "draft — needs native review"
"Hide from publishing" = "Nicht veröffentlichen"
"Hide section contents" = "Abschnittsinhalt ausblenden"
"Highlight layers on hover" = "Ebenen beim Überfahren hervorheben"
+"Highlighter" = "Textmarker"
"Highlights" = "Lichter"
"Hold Alt" = "Alt gedrückt halten"
"Hold Alt+Z" = "Alt+Z gedrückt halten"
@@ -715,6 +725,7 @@ status = "draft — needs native review"
"Mark as resolved" = "Als erledigt markieren"
"Mark as unread" = "Als ungelesen markieren"
"Mark as unresolved" = "Als nicht erledigt markieren"
+"Marker" = "Marker"
"Mask" = "Maske"
"Mass · Stiffness · Damping" = "Masse · Steifigkeit · Dämpfung"
"Match (empty: the whole name)" = "Übereinstimmung (leer: der ganze Name)"
@@ -771,6 +782,7 @@ status = "draft — needs native review"
"Named instance" = "Benannte Instanz"
"Navigate to" = "Navigieren zu"
"Nested instance" = "Verschachtelte Instanz"
+"New board" = "Neues Whiteboard"
"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"
@@ -833,6 +845,7 @@ status = "draft — needs native review"
"Not read yet" = "Noch nicht gelesen"
"Not shared" = "Nicht geteilt"
"Note {n}" = "Notiz {n}"
+"Nothing changed since this version." = "Seit dieser Version hat sich nichts geändert."
"Nothing changed since this was marked ready for dev." = "Seit der Markierung als bereit für die Entwicklung hat sich nichts geändert."
"Nothing here yet. Set a frame's status to list it." = "Noch nichts hier. Legen Sie den Status eines Rahmens fest, um ihn aufzulisten."
"Nothing online yet. Use Share on a file to put it online and it is listed here." = "Noch nichts online. Stellen Sie eine Datei über „Teilen“ online, dann erscheint sie hier."
@@ -902,6 +915,7 @@ status = "draft — needs native review"
"Page deleted" = "Seite gelöscht"
"Pages" = "Seiten"
"Pages added to the document" = "Seiten zum Dokument hinzugefügt"
+"Pink" = "Rosa"
"Placed on the current page" = "Auf der aktuellen Seite platziert"
"Pages: {pages}" = "Seiten: {pages}"
"Paint bucket" = "Farbeimer"
@@ -943,6 +957,7 @@ status = "draft — needs native review"
"Plugins run in FigCraft's sandbox, without files, network or clock. Install only plugins you trust." = "Plugins laufen in der Sandbox von FigCraft, ohne Dateien, Netzwerk oder Uhr. Installieren Sie nur Plugins, denen Sie vertrauen."
"Plus darker" = "Plus dunkler"
"Plus lighter" = "Plus heller"
+"Plus one" = "Plus eins"
"Point" = "Punkt"
"Points" = "Punkte"
"Polygon" = "Polygon"
@@ -989,6 +1004,7 @@ status = "draft — needs native review"
"Push" = "Schieben"
"Push changes to main component" = "Änderungen an Hauptkomponente übertragen"
"Put text on path" = "Text auf Pfad setzen"
+"Question" = "Frage"
"R" = "R"
"Radial" = "Radial"
"Radius" = "Radius"
@@ -1033,6 +1049,7 @@ status = "draft — needs native review"
"Removed" = "Entfernt"
"Removed from the server" = "Vom Server entfernt"
"Removed since it was marked" = "Seit der Markierung entfernt"
+"Removed since this version" = "Seit dieser Version entfernt"
"Rename" = "Umbenennen"
"Rename duplicated layers" = "Duplizierte Ebenen umbenennen"
"Rename folder" = "Ordner umbenennen"
@@ -1088,6 +1105,7 @@ status = "draft — needs native review"
"Rotation jitter" = "Drehungsschwankung"
"Round" = "Rund"
"Rounded" = "Abgerundet"
+"Rounded rectangle" = "Abgerundetes Rechteck"
"Row" = "Zeile"
"Row gap" = "Zeilenabstand"
"Row sizes" = "Zeilengrößen"
@@ -1157,6 +1175,7 @@ status = "draft — needs native review"
"Shape" = "Form"
"Shape builder" = "Formerstellung"
"Shape tools" = "Formwerkzeuge"
+"Shapes" = "Formen"
"Share" = "Teilen"
"Share this file" = "Diese Datei teilen"
"Share: live session, export" = "Teilen: Live-Sitzung, Export"
@@ -1214,10 +1233,13 @@ status = "draft — needs native review"
"Space+drag" = "Leertaste+Ziehen"
"Spacing" = "Abstand"
"Spam, stolen work, abuse…" = "Spam, gestohlene Arbeit, Missbrauch…"
+"Speech bubble" = "Sprechblase"
"Splay" = "Spreizung"
"Spotlight me" = "Spotlight auf mich"
"Spread" = "Ausbreitung"
"Square" = "Quadrat"
+"Stamp" = "Stempel"
+"Stamps" = "Stempel"
"Standard" = "Standard"
"Standard ligatures" = "Standardligaturen"
"Star" = "Stern"
@@ -1232,12 +1254,16 @@ status = "draft — needs native review"
"Starting to share…" = "Teilen wird gestartet…"
"Status" = "Status"
"Sticky" = "Fixiert"
+"Sticky note" = "Haftnotiz"
+"Sticky note colors" = "Haftnotizfarben"
+"Sticky notes, shapes and connectors" = "Haftnotizen, Formen und Verbinder"
"Stop" = "Beenden"
"Stop following {name}" = "{name} nicht mehr folgen"
"Stop session" = "Sitzung beenden"
"Stop sharing" = "Teilen beenden"
"Stop spotlighting" = "Spotlight beenden"
"Stop {n} {hex}" = "Farbunterbrechung {n} {hex}"
+"Straight" = "Gerade"
"Stretch" = "Strecken"
"Strikethrough" = "Durchgestrichen"
"String" = "Zeichenfolge"
@@ -1281,6 +1307,7 @@ status = "draft — needs native review"
"Text" = "Text"
"Text align" = "Textausrichtung"
"Text content" = "Textinhalt"
+"Text size" = "Textgröße"
"Text style" = "Textstil"
"Text styles" = "Textstile"
"Texts" = "Texte"
@@ -1314,6 +1341,9 @@ status = "draft — needs native review"
"This server is open to the public: no key needed." = "Dieser Server ist öffentlich zugänglich: kein Schlüssel nötig."
"This server needs its key: add ?key=… to the address (`figcraft-server key` prints it on the server's machine)." = "Dieser Server braucht seinen Schlüssel: Fügen Sie der Adresse ?key=… hinzu (`figcraft-server key` gibt ihn auf dem Rechner des Servers aus)."
"This server takes files only with its key: see Advanced." = "Dieser Server nimmt Dateien nur mit seinem Schlüssel an: siehe Erweitert."
+"Thumbs up" = "Daumen hoch"
+"This version can't be read." = "Diese Version kann nicht gelesen werden."
+"This version doesn't have it: all of it is new." = "Diese Version enthält es nicht: alles daran ist neu."
"Tidy up" = "Aufräumen"
"Tile" = "Kachel"
"Tile type" = "Kacheltyp"
@@ -1330,6 +1360,7 @@ status = "draft — needs native review"
"Top left radius" = "Radius oben links"
"Top right radius" = "Radius oben rechts"
"Transform" = "Transformieren"
+"Triangle" = "Dreieck"
"Triangle arrow" = "Dreieckspfeil"
"Trigger" = "Auslöser"
"True" = "Wahr"
@@ -1415,10 +1446,12 @@ status = "draft — needs native review"
"WebSocket URL copied" = "WebSocket-URL kopiert"
"Wedge" = "Keil"
"Weight" = "Stärke"
+"What changed since a saved version" = "Was sich seit einer gespeicherten Version geändert hat"
"What changed since it was marked ready for dev" = "Was sich seit der Markierung als bereit für die Entwicklung geändert hat"
"What is wrong with this file? The server's operator gets your report." = "Was stimmt mit dieser Datei nicht? Der Betreiber des Servers erhält Ihre Meldung."
"What it's for" = "Wofür sie gedacht ist"
"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." = "Der Ausgangsstand dieser Änderung ist unbekannt: Sie erfolgte, bevor FigCraft Kopien von Rahmen mit dem Status „Bereit für Entwicklung“ aufbewahrte. Erledigen Sie die Änderung (oder markieren Sie den Rahmen erneut als bereit), um ab jetzt zu vergleichen."
+"When marked ready" = "Beim Markieren als bereit"
"While hovering" = "Beim Überfahren"
"While pressing" = "Beim Drücken"
"White" = "Weiß"
@@ -1677,6 +1710,15 @@ status = "draft — needs native review"
"arrange.roundToPixels" = "Auf Pixel runden"
"arrange.spacing" = "Abstand"
"arrange.tidy" = "Aufräumen"
+"board.connector" = "Verbinder"
+"board.ink" = "Markerstrich"
+"board.label" = "Verbinderbeschriftung"
+"board.nextSticky" = "Nächste Haftnotiz"
+"board.setColor" = "Whiteboard-Farbe"
+"board.setStyle" = "Whiteboard-Stil"
+"board.shape" = "Form mit Text"
+"board.stamp" = "Stempel"
+"board.sticky" = "Haftnotiz"
"bool.exclude" = "Auswahl ausschließen"
"bool.flatten" = "Boolesche Gruppe zusammenfügen"
"bool.intersect" = "Schnittmenge der Auswahl"
@@ -1801,6 +1843,7 @@ status = "draft — needs native review"
"file.import" = "Importieren"
"file.moveTab" = "Tab verschieben"
"file.new" = "Neue Designdatei"
+"file.newBoard" = "Neues Whiteboard"
"file.open" = "Öffnen"
"file.openRecent" = "Zuletzt verwendete öffnen"
"file.placeImage" = "Bild platzieren"
@@ -2064,10 +2107,14 @@ status = "draft — needs native review"
"text.weightUp" = "Schriftstärke erhöhen"
"tool.arrow" = "Pfeil"
"tool.comment" = "Kommentar"
+"tool.connector" = "Verbinder"
"tool.ellipse" = "Ellipse"
+"tool.eraser" = "Radiergummi"
"tool.frame" = "Rahmen"
"tool.hand" = "Hand"
+"tool.highlighter" = "Textmarker"
"tool.line" = "Linie"
+"tool.marker" = "Marker"
"tool.move" = "Verschieben"
"tool.pen" = "Zeichenstift"
"tool.pencil" = "Bleistift"
@@ -2079,9 +2126,12 @@ status = "draft — needs native review"
"tool.scaleAnchor" = "Skalierungsanker"
"tool.section" = "Abschnitt"
"tool.set" = "Werkzeug wählen"
+"tool.shape" = "Formen"
"tool.shapeBuilder" = "Formerstellung"
"tool.slice" = "Slice"
+"tool.stamp" = "Stempel"
"tool.star" = "Stern"
+"tool.sticky" = "Haftnotiz"
"tool.text" = "Text"
"transform.move" = "Verschieben"
"transform.moveTo" = "Verschieben nach"
diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml
index ae566fc8..2f302eff 100644
--- a/crates/ui-egui/locales/en.toml
+++ b/crates/ui-egui/locales/en.toml
@@ -125,6 +125,7 @@ name = "English"
"Archived" = "Archived"
"Arrange" = "Arrange"
"Arrow" = "Arrow"
+"Arrow at the end" = "Arrow at the end"
"As typed" = "As typed"
"Asking the server…" = "Asking the server…"
"Assets" = "Assets"
@@ -199,12 +200,15 @@ name = "English"
"C or ⇧C" = "C or ⇧C"
"CMYK colour" = "CMYK colour"
"Can view" = "Can view"
+"Check" = "Check"
"Checking the fonts installed on this computer…" = "Checking the fonts installed on this computer…"
"Checking the server…" = "Checking the server…"
+"Chevron" = "Chevron"
"Clear from this list" = "Clear from this list"
"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"
+"Connector" = "Connector"
"Convert to frame" = "Convert to frame"
"Convert to section" = "Convert to section"
"CSS custom properties…" = "CSS custom properties…"
@@ -276,6 +280,7 @@ name = "English"
"Commits" = "Commits"
"Company" = "Company"
"Compare changes" = "Compare changes"
+"Compare with" = "Compare with"
"Compatibility notes" = "Compatibility notes"
"Completed" = "Completed"
"Component" = "Component"
@@ -379,6 +384,7 @@ name = "English"
"Description" = "Description"
"Description (optional)" = "Description (optional)"
"Design" = "Design"
+"Design panel" = "Design panel"
"Design system starter" = "Design system starter"
"Desktop" = "Desktop"
"Destination" = "Destination"
@@ -390,6 +396,7 @@ name = "English"
"Detach variable" = "Detach variable"
"Details" = "Details"
"Dev Mode" = "Dev Mode"
+"Dev Mode only inspects: switch to Design (Shift+D) to edit" = "Dev Mode only inspects: switch to Design (Shift+D) to edit"
"Dev resources" = "Dev resources"
"Development" = "Development"
"Device" = "Device"
@@ -441,6 +448,7 @@ name = "English"
"Effect settings" = "Effect settings"
"Effect styles" = "Effect styles"
"Effects" = "Effects"
+"Elbow" = "Elbow"
"Ellipse" = "Ellipse"
"Ellipses" = "Ellipses"
"Else" = "Else"
@@ -577,6 +585,7 @@ name = "English"
"Hanging list" = "Hanging list"
"Hanging punctuation" = "Hanging punctuation"
"Hard light" = "Hard light"
+"Heart" = "Heart"
"Height" = "Height"
"Help" = "Help"
"Help and resources" = "Help and resources"
@@ -589,6 +598,7 @@ name = "English"
"Hide these tips (Getting started in the Help menu shows them again)" = "Hide these tips (Getting started in the Help menu shows them again)"
"Hide when publishing" = "Hide when publishing"
"Highlight layers on hover" = "Highlight layers on hover"
+"Highlighter" = "Highlighter"
"Highlights" = "Highlights"
"Hold Alt" = "Hold Alt"
"Hold Alt+Z" = "Hold Alt+Z"
@@ -758,6 +768,7 @@ name = "English"
"Mark as resolved" = "Mark as resolved"
"Mark as unread" = "Mark as unread"
"Mark as unresolved" = "Mark as unresolved"
+"Marker" = "Marker"
"Mask" = "Mask"
"Mass · Stiffness · Damping" = "Mass · Stiffness · Damping"
"Match (empty: the whole name)" = "Match (empty: the whole name)"
@@ -817,6 +828,7 @@ name = "English"
"Named instance" = "Named instance"
"Navigate to" = "Navigate to"
"Nested instance" = "Nested instance"
+"New board" = "New board"
"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"
@@ -883,6 +895,7 @@ name = "English"
"Not read yet" = "Not read yet"
"Not shared" = "Not shared"
"Note {n}" = "Note {n}"
+"Nothing changed since this version." = "Nothing changed since this version."
"Nothing changed since this was marked ready for dev." = "Nothing changed since this was marked ready for dev."
"Nothing here yet. Set a frame's status to list it." = "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 online yet. Use Share on a file to put it online and it is listed here."
@@ -958,6 +971,7 @@ name = "English"
"Page deleted" = "Page deleted"
"Pages" = "Pages"
"Pages added to the document" = "Pages added to the document"
+"Pink" = "Pink"
"Placed on the current page" = "Placed on the current page"
"Pages: {pages}" = "Pages: {pages}"
"Paint bucket" = "Paint bucket"
@@ -1002,6 +1016,7 @@ name = "English"
"Plugins & widgets" = "Plugins & widgets"
"Plus darker" = "Plus darker"
"Plus lighter" = "Plus lighter"
+"Plus one" = "Plus one"
"Point" = "Point"
"Points" = "Points"
"Polygon" = "Polygon"
@@ -1050,6 +1065,7 @@ name = "English"
"Push" = "Push"
"Push changes to main component" = "Push changes to main component"
"Put text on path" = "Put text on path"
+"Question" = "Question"
"R" = "R"
"Radial" = "Radial"
"Radius" = "Radius"
@@ -1096,6 +1112,7 @@ name = "English"
"Removed" = "Removed"
"Removed from the server" = "Removed from the server"
"Removed since it was marked" = "Removed since it was marked"
+"Removed since this version" = "Removed since this version"
"Rename" = "Rename"
"Rename duplicated layers" = "Rename duplicated layers"
"Rename folder" = "Rename folder"
@@ -1153,6 +1170,7 @@ name = "English"
"Rotation jitter" = "Rotation jitter"
"Round" = "Round"
"Rounded" = "Rounded"
+"Rounded rectangle" = "Rounded rectangle"
"Row" = "Row"
"Row gap" = "Row gap"
"Row sizes" = "Row sizes"
@@ -1229,6 +1247,7 @@ name = "English"
"Shape" = "Shape"
"Shape builder" = "Shape builder"
"Shape tools" = "Shape tools"
+"Shapes" = "Shapes"
"Share" = "Share"
"Share this file" = "Share this file"
"Share with a code" = "Share with a code"
@@ -1295,10 +1314,13 @@ name = "English"
"Space+drag" = "Space+drag"
"Spacing" = "Spacing"
"Spam, stolen work, abuse…" = "Spam, stolen work, abuse…"
+"Speech bubble" = "Speech bubble"
"Splay" = "Splay"
"Spotlight me" = "Spotlight me"
"Spread" = "Spread"
"Square" = "Square"
+"Stamp" = "Stamp"
+"Stamps" = "Stamps"
"Standard" = "Standard"
"Standard ligatures" = "Standard ligatures"
"Star" = "Star"
@@ -1315,12 +1337,16 @@ name = "English"
"Starting to share…" = "Starting to share…"
"Status" = "Status"
"Sticky" = "Sticky"
+"Sticky note" = "Sticky note"
+"Sticky note colors" = "Sticky note colors"
+"Sticky notes, shapes and connectors" = "Sticky notes, shapes and connectors"
"Stop" = "Stop"
"Stop following {name}" = "Stop following {name}"
"Stop session" = "Stop session"
"Stop sharing" = "Stop sharing"
"Stop spotlighting" = "Stop spotlighting"
"Stop {n} {hex}" = "Stop {n} {hex}"
+"Straight" = "Straight"
"Stretch" = "Stretch"
"Strikethrough" = "Strikethrough"
"String" = "String"
@@ -1365,6 +1391,7 @@ name = "English"
"Text" = "Text"
"Text align" = "Text align"
"Text content" = "Text content"
+"Text size" = "Text size"
"Text style" = "Text style"
"Text styles" = "Text styles"
"Texts" = "Texts"
@@ -1401,6 +1428,9 @@ name = "English"
"This server is open to the public: no key needed." = "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)." = "This server needs its key: add ?key=… to the address (`figcraft-server key` prints it on the server's machine)."
"This server takes files only with its key: see Advanced." = "This server takes files only with its key: see Advanced."
+"Thumbs up" = "Thumbs up"
+"This version can't be read." = "This version can't be read."
+"This version doesn't have it: all of it is new." = "This version doesn't have it: all of it is new."
"Tidy up" = "Tidy up"
"Tile" = "Tile"
"Tile type" = "Tile type"
@@ -1418,6 +1448,7 @@ name = "English"
"Top padding" = "Top padding"
"Top right radius" = "Top right radius"
"Transform" = "Transform"
+"Triangle" = "Triangle"
"Triangle arrow" = "Triangle arrow"
"Trigger" = "Trigger"
"True" = "True"
@@ -1509,11 +1540,13 @@ name = "English"
"WebSocket URL copied" = "WebSocket URL copied"
"Wedge" = "Wedge"
"Weight" = "Weight"
+"What changed since a saved version" = "What changed since a saved version"
"What you try here changes this preview and the code below, not the file" = "What you try here changes this preview and the code below, not the file"
"What changed since it was marked ready for dev" = "What changed since it was marked ready for dev"
"What is wrong with this file? The server's operator gets your report." = "What is wrong with this file? The server's operator gets your report."
"What it's for" = "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." = "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."
+"When marked ready" = "When marked ready"
"While hovering" = "While hovering"
"While pressing" = "While pressing"
"White" = "White"
diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml
index 596feda6..3f4263da 100644
--- a/crates/ui-egui/locales/es.toml
+++ b/crates/ui-egui/locales/es.toml
@@ -8,7 +8,11 @@ name = "Español"
status = "draft — needs native review"
[ui]
+"Arrow at the end" = "Flecha al final"
+"Check" = "Visto"
+"Chevron" = "Cheurón"
"Compatibility notes" = "Notas de compatibilidad"
+"Connector" = "Conector"
"Couldn't download the variables" = "No se pudieron descargar las variables"
"% of all commits" = "% del total de commits"
@@ -277,6 +281,7 @@ status = "draft — needs native review"
"Commits" = "Commits"
"Company" = "Empresa"
"Compare changes" = "Comparar cambios"
+"Compare with" = "Comparar con"
"Completed" = "Completado"
"Component" = "Componente"
"Component name" = "Nombre del componente"
@@ -380,6 +385,7 @@ status = "draft — needs native review"
"Description" = "Descripción"
"Description (optional)" = "Descripción (opcional)"
"Design" = "Diseño"
+"Design panel" = "Panel de diseño"
"Design system starter" = "Base de sistema de diseño"
"Desktop" = "Escritorio"
"Destination" = "Destino"
@@ -391,6 +397,7 @@ status = "draft — needs native review"
"Detach variable" = "Separar variable"
"Details" = "Detalles"
"Dev Mode" = "Modo desarrollo"
+"Dev Mode only inspects: switch to Design (Shift+D) to edit" = "El modo desarrollo solo inspecciona: cambia a Diseño (Shift+D) para editar"
"Dev resources" = "Recursos de desarrollo"
"Development" = "Desarrollo"
"Device" = "Dispositivo"
@@ -442,6 +449,7 @@ status = "draft — needs native review"
"Effect settings" = "Ajustes del efecto"
"Effect styles" = "Estilos de efecto"
"Effects" = "Efectos"
+"Elbow" = "En ángulo"
"Ellipse" = "Elipse"
"Ellipses" = "Elipses"
"Else" = "Si no"
@@ -578,6 +586,7 @@ status = "draft — needs native review"
"Hanging list" = "Lista colgante"
"Hanging punctuation" = "Puntuación colgante"
"Hard light" = "Luz fuerte"
+"Heart" = "Corazón"
"Height" = "Alto"
"Help" = "Ayuda"
"Help and resources" = "Ayuda y recursos"
@@ -590,6 +599,7 @@ status = "draft — needs native review"
"Hide these tips (Getting started in the Help menu shows them again)" = "Ocultar estos consejos (Primeros pasos en el menú Ayuda los vuelve a mostrar)"
"Hide when publishing" = "Ocultar al publicar"
"Highlight layers on hover" = "Resaltar capas al pasar el cursor"
+"Highlighter" = "Resaltador"
"Highlights" = "Luces"
"Hold Alt" = "Mantén Alt"
"Hold Alt+Z" = "Mantén Alt+Z"
@@ -759,6 +769,7 @@ status = "draft — needs native review"
"Mark as resolved" = "Marcar como resuelto"
"Mark as unread" = "Marcar como no leído"
"Mark as unresolved" = "Marcar como no resuelto"
+"Marker" = "Rotulador"
"Mask" = "Máscara"
"Mass · Stiffness · Damping" = "Masa · Rigidez · Amortiguación"
"Match (empty: the whole name)" = "Coincidencia (vacío: el nombre entero)"
@@ -818,6 +829,7 @@ status = "draft — needs native review"
"Named instance" = "Instancia con nombre"
"Navigate to" = "Navegar a"
"Nested instance" = "Instancia anidada"
+"New board" = "Nueva pizarra"
"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"
@@ -884,6 +896,7 @@ status = "draft — needs native review"
"Not read yet" = "Aún no leída"
"Not shared" = "Sin compartir"
"Note {n}" = "Nota {n}"
+"Nothing changed since this version." = "Nada cambió desde esta versión."
"Nothing changed since this was marked ready for dev." = "Nada cambió desde que se marcó como listo para desarrollo."
"Nothing here yet. Set a frame's status to list it." = "Aún no hay nada. Asigna un estado a un marco para verlo aquí."
"Nothing online yet. Use Share on a file to put it online and it is listed here." = "Aún no hay nada en línea. Usa Compartir en un archivo para ponerlo en línea y aparecerá aquí."
@@ -959,6 +972,7 @@ status = "draft — needs native review"
"Page deleted" = "Página eliminada"
"Pages" = "Páginas"
"Pages added to the document" = "Páginas añadidas al documento"
+"Pink" = "Rosa"
"Placed on the current page" = "Colocado en la página actual"
"Pages: {pages}" = "Páginas: {pages}"
"Paint bucket" = "Bote de pintura"
@@ -1003,6 +1017,7 @@ status = "draft — needs native review"
"Plugins & widgets" = "Plugins y widgets"
"Plus darker" = "Más oscuro"
"Plus lighter" = "Más claro"
+"Plus one" = "Más uno"
"Point" = "Punto"
"Points" = "Puntos"
"Polygon" = "Polígono"
@@ -1051,6 +1066,7 @@ status = "draft — needs native review"
"Push" = "Empujar"
"Push changes to main component" = "Enviar cambios al componente principal"
"Put text on path" = "Poner texto en trazado"
+"Question" = "Pregunta"
"R" = "R"
"Radial" = "Radial"
"Radius" = "Radio"
@@ -1097,6 +1113,7 @@ status = "draft — needs native review"
"Removed" = "Eliminado"
"Removed from the server" = "Quitado del servidor"
"Removed since it was marked" = "Eliminada desde que se marcó"
+"Removed since this version" = "Eliminado desde esta versión"
"Rename" = "Cambiar nombre"
"Rename duplicated layers" = "Renombrar capas duplicadas"
"Rename folder" = "Cambiar nombre de la carpeta"
@@ -1154,6 +1171,7 @@ status = "draft — needs native review"
"Rotation jitter" = "Variación de rotación"
"Round" = "Redondo"
"Rounded" = "Redondeado"
+"Rounded rectangle" = "Rectángulo redondeado"
"Row" = "Fila"
"Row gap" = "Espacio entre filas"
"Row sizes" = "Tamaños de fila"
@@ -1230,6 +1248,7 @@ status = "draft — needs native review"
"Shape" = "Forma"
"Shape builder" = "Generador de formas"
"Shape tools" = "Herramientas de forma"
+"Shapes" = "Formas"
"Share" = "Compartir"
"Share this file" = "Compartir este archivo"
"Share with a code" = "Comparte con un código"
@@ -1296,10 +1315,13 @@ status = "draft — needs native review"
"Space+drag" = "Espacio+arrastrar"
"Spacing" = "Espaciado"
"Spam, stolen work, abuse…" = "Spam, obra robada, abuso…"
+"Speech bubble" = "Bocadillo"
"Splay" = "Apertura"
"Spotlight me" = "Ponerme en el foco"
"Spread" = "Extensión"
"Square" = "Cuadrado"
+"Stamp" = "Sello"
+"Stamps" = "Sellos"
"Standard" = "Estándar"
"Standard ligatures" = "Ligaduras estándar"
"Star" = "Estrella"
@@ -1316,12 +1338,16 @@ status = "draft — needs native review"
"Starting to share…" = "Empezando a compartir…"
"Status" = "Estado"
"Sticky" = "Adherido"
+"Sticky note" = "Nota adhesiva"
+"Sticky note colors" = "Colores de las notas adhesivas"
+"Sticky notes, shapes and connectors" = "Notas adhesivas, formas y conectores"
"Stop" = "Parar"
"Stop following {name}" = "Dejar de seguir a {name}"
"Stop session" = "Detener sesión"
"Stop sharing" = "Dejar de compartir"
"Stop spotlighting" = "Salir del foco"
"Stop {n} {hex}" = "Parada {n} {hex}"
+"Straight" = "Recto"
"Stretch" = "Estirar"
"Strikethrough" = "Tachado"
"String" = "Cadena"
@@ -1366,6 +1392,7 @@ status = "draft — needs native review"
"Text" = "Texto"
"Text align" = "Alineación del texto"
"Text content" = "Contenido de texto"
+"Text size" = "Tamaño del texto"
"Text style" = "Estilo de texto"
"Text styles" = "Estilos de texto"
"Texts" = "Textos"
@@ -1402,6 +1429,9 @@ status = "draft — needs native review"
"This server is open to the public: no key needed." = "Este servidor está abierto al público: no hace falta clave."
"This server needs its key: add ?key=… to the address (`figcraft-server key` prints it on the server's machine)." = "Este servidor necesita su clave: añade ?key=… a la dirección (`figcraft-server key` la muestra en el equipo del servidor)."
"This server takes files only with its key: see Advanced." = "Este servidor solo acepta archivos con su clave: mira Avanzado."
+"Thumbs up" = "Pulgar arriba"
+"This version can't be read." = "No se puede leer esta versión."
+"This version doesn't have it: all of it is new." = "Esta versión no lo tiene: todo es nuevo."
"Tidy up" = "Ordenar"
"Tile" = "Mosaico"
"Tile type" = "Tipo de mosaico"
@@ -1419,6 +1449,7 @@ status = "draft — needs native review"
"Top padding" = "Margen interno superior"
"Top right radius" = "Radio superior derecho"
"Transform" = "Transformar"
+"Triangle" = "Triángulo"
"Triangle arrow" = "Flecha triangular"
"Trigger" = "Desencadenante"
"True" = "Verdadero"
@@ -1510,11 +1541,13 @@ status = "draft — needs native review"
"WebSocket URL copied" = "URL de WebSocket copiada"
"Wedge" = "Cuña"
"Weight" = "Grosor"
+"What changed since a saved version" = "Qué cambió desde una versión guardada"
"What you try here changes this preview and the code below, not the file" = "Lo que pruebes aquí cambia esta vista previa y el código de abajo, no el archivo"
"What changed since it was marked ready for dev" = "Qué cambió desde que se marcó como listo para desarrollo"
"What is wrong with this file? The server's operator gets your report." = "¿Qué tiene de malo este archivo? El operador del servidor recibirá tu denuncia."
"What it's for" = "Para qué sirve"
"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." = "No se sabe desde qué cambió: cambió antes de que FigCraft guardara copias de los marcos listos para desarrollo. Resuelve el cambio (o vuelve a marcarlo como listo) para comparar a partir de ahora."
+"When marked ready" = "Al marcarlo como listo"
"While hovering" = "Mientras se pasa el puntero"
"While pressing" = "Mientras se presiona"
"White" = "Blanco"
@@ -1784,6 +1817,15 @@ status = "draft — needs native review"
"arrange.roundToPixels" = "Redondear a píxeles"
"arrange.spacing" = "Espaciado"
"arrange.tidy" = "Ordenar"
+"board.connector" = "Conector"
+"board.ink" = "Trazo de rotulador"
+"board.label" = "Etiqueta del conector"
+"board.nextSticky" = "Siguiente nota adhesiva"
+"board.setColor" = "Color en la pizarra"
+"board.setStyle" = "Estilo en la pizarra"
+"board.shape" = "Forma con texto"
+"board.stamp" = "Sello"
+"board.sticky" = "Nota adhesiva"
"bool.exclude" = "Excluir selección"
"bool.flatten" = "Acoplar booleana"
"bool.intersect" = "Intersecar selección"
@@ -1910,6 +1952,7 @@ status = "draft — needs native review"
"file.import" = "Importar"
"file.moveTab" = "Mover pestaña"
"file.new" = "Nuevo archivo de diseño"
+"file.newBoard" = "Nueva pizarra"
"file.newFromTemplate" = "Nuevo desde plantilla"
"file.open" = "Abrir"
"file.openRecent" = "Abrir reciente"
@@ -2184,10 +2227,14 @@ status = "draft — needs native review"
"text.weightUp" = "Aumentar peso de fuente"
"tool.arrow" = "Flecha"
"tool.comment" = "Comentario"
+"tool.connector" = "Conector"
"tool.ellipse" = "Elipse"
+"tool.eraser" = "Borrador"
"tool.frame" = "Marco"
"tool.hand" = "Mano"
+"tool.highlighter" = "Resaltador"
"tool.line" = "Línea"
+"tool.marker" = "Rotulador"
"tool.move" = "Mover"
"tool.pen" = "Pluma"
"tool.pencil" = "Lápiz"
@@ -2199,9 +2246,12 @@ status = "draft — needs native review"
"tool.scaleAnchor" = "Ancla de escala"
"tool.section" = "Sección"
"tool.set" = "Elegir herramienta"
+"tool.shape" = "Formas"
"tool.shapeBuilder" = "Generador de formas"
"tool.slice" = "Sector"
+"tool.stamp" = "Sello"
"tool.star" = "Estrella"
+"tool.sticky" = "Nota adhesiva"
"tool.text" = "Texto"
"transform.move" = "Mover"
"transform.moveTo" = "Mover a"
diff --git a/crates/ui-egui/locales/fi.toml b/crates/ui-egui/locales/fi.toml
index 205a9d29..8b1b8743 100644
--- a/crates/ui-egui/locales/fi.toml
+++ b/crates/ui-egui/locales/fi.toml
@@ -127,6 +127,7 @@ status = "draft — needs native review"
"Archived" = "Arkistoitu"
"Arrange" = "Järjestä"
"Arrow" = "Nuoli"
+"Arrow at the end" = "Nuoli loppuun"
"As typed" = "Kirjoitetussa muodossa"
"Asking the server…" = "Kysytään palvelimelta…"
"Assets" = "Resurssit"
@@ -221,8 +222,10 @@ status = "draft — needs native review"
"Changes on main" = "Päähaaran muutokset"
"Changes on the branch" = "Haaran muutokset"
"Changes unknown" = "Muutokset tuntemattomia"
+"Check" = "Valintamerkki"
"Checking the fonts installed on this computer…" = "Tarkistetaan tämän tietokoneen asennettuja fontteja…"
"Checking the server…" = "Tarkistetaan palvelinta…"
+"Chevron" = "Kulmanuoli"
"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"
@@ -290,6 +293,7 @@ status = "draft — needs native review"
"Connected" = "Yhdistetty"
"Connected to code: {from}" = "Yhdistetty koodiin: {from}"
"Connection lost, reconnecting (attempt {attempt})…" = "Yhteys katkesi, yhdistetään uudelleen (yritys {attempt})…"
+"Connector" = "Yhdistin"
"Constrain proportions" = "Säilytä mittasuhteet"
"Constraints" = "Rajoitteet"
"Content" = "Sisältö"
@@ -380,6 +384,7 @@ status = "draft — needs native review"
"Description" = "Kuvaus"
"Description (optional)" = "Kuvaus (valinnainen)"
"Design" = "Suunnittelu"
+"Design panel" = "Suunnittelupaneeli"
"Design system starter" = "Muotoilujärjestelmän aloituspohja"
"Desktop" = "Työpöytä"
"Destination" = "Kohde"
@@ -442,6 +447,7 @@ status = "draft — needs native review"
"Effect settings" = "Tehosteen asetukset"
"Effect styles" = "Tehostetyylit"
"Effects" = "Tehosteet"
+"Elbow" = "Kulmikas"
"Ellipse" = "Ellipsi"
"Ellipses" = "Ellipsit"
"Else" = "Muuten"
@@ -578,6 +584,7 @@ status = "draft — needs native review"
"Hanging list" = "Riippuva luettelo"
"Hanging punctuation" = "Välimerkkien ulonnus"
"Hard light" = "Kova valo"
+"Heart" = "Sydän"
"Height" = "Korkeus"
"Help" = "Ohje"
"Help and resources" = "Ohje ja resurssit"
@@ -590,6 +597,7 @@ status = "draft — needs native review"
"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"
+"Highlighter" = "Korostuskynä"
"Highlights" = "Huippuvalot"
"Hold Alt" = "Pidä Alt painettuna"
"Hold Alt+Z" = "Pidä Alt+Z painettuna"
@@ -756,6 +764,7 @@ status = "draft — needs native review"
"Mark as resolved" = "Merkitse ratkaistuksi"
"Mark as unread" = "Merkitse lukemattomaksi"
"Mark as unresolved" = "Merkitse ratkaisemattomaksi"
+"Marker" = "Tussi"
"Mask" = "Maski"
"Mass · Stiffness · Damping" = "Massa · jäykkyys · vaimennus"
"Match (empty: the whole name)" = "Etsittävä (tyhjä: koko nimi)"
@@ -815,6 +824,7 @@ status = "draft — needs native review"
"Named instance" = "Nimetty ilmentymä"
"Navigate to" = "Siirry kohteeseen"
"Nested instance" = "Sisäkkäinen ilmentymä"
+"New board" = "Uusi taulu"
"New design file" = "Uusi suunnittelutiedosto"
"Newest first" = "Uusimmat ensin"
"Next frame" = "Seuraava kehys"
@@ -987,6 +997,7 @@ status = "draft — needs native review"
"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"
+"Pink" = "Vaaleanpunainen"
"Pixel grid" = "Pikseliruudukko"
"Pixel preview 1x" = "Pikseliesikatselu 1x"
"Pixel preview 2x" = "Pikseliesikatselu 2x"
@@ -1001,6 +1012,7 @@ status = "draft — needs native review"
"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"
+"Plus one" = "Plus yksi"
"Point" = "Piste"
"Points" = "Pisteet"
"Polygon" = "Monikulmio"
@@ -1048,6 +1060,7 @@ status = "draft — needs native review"
"Push" = "Työntö"
"Push changes to main component" = "Siirrä muutokset pääkomponenttiin"
"Put text on path" = "Sijoita teksti polulle"
+"Question" = "Kysymys"
"R" = "R"
"Radial" = "Säteittäinen"
"Radius" = "Säde"
@@ -1148,6 +1161,7 @@ status = "draft — needs native review"
"Rotation jitter" = "Kierron vaihtelu"
"Round" = "Pyöreä"
"Rounded" = "Pyöristetty"
+"Rounded rectangle" = "Pyöristetty suorakulmio"
"Row" = "Rivi"
"Row gap" = "Rivien väli"
"Row sizes" = "Rivien koot"
@@ -1223,6 +1237,7 @@ status = "draft — needs native review"
"Shape" = "Muoto"
"Shape builder" = "Muodonrakennin"
"Shape tools" = "Muototyökalut"
+"Shapes" = "Muodot"
"Share" = "Jaa"
"Share this file" = "Jaa tämä tiedosto"
"Share with a code" = "Jaa koodilla"
@@ -1289,10 +1304,13 @@ status = "draft — needs native review"
"Space+drag" = "Space+drag"
"Spacing" = "Välistys"
"Spam, stolen work, abuse…" = "Roskaposti, varastettu työ, väärinkäyttö…"
+"Speech bubble" = "Puhekupla"
"Splay" = "Harotus"
"Spotlight me" = "Nosta minut esiin"
"Spread" = "Leviäminen"
"Square" = "Neliö"
+"Stamp" = "Leima"
+"Stamps" = "Leimat"
"Standard" = "Vakio"
"Standard ligatures" = "Tavalliset ligatuurit"
"Star" = "Tähti"
@@ -1309,12 +1327,16 @@ status = "draft — needs native review"
"Starting to share…" = "Aloitetaan jakamista…"
"Status" = "Tila"
"Sticky" = "Kiinnittyvä"
+"Sticky note" = "Muistilappu"
+"Sticky note colors" = "Muistilappujen värit"
+"Sticky notes, shapes and connectors" = "Muistilaput, muodot ja yhdistimet"
"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}"
+"Straight" = "Suora"
"Stretch" = "Venytys"
"Strikethrough" = "Yliviivaus"
"String" = "Merkkijono"
@@ -1359,6 +1381,7 @@ status = "draft — needs native review"
"Text" = "Teksti"
"Text align" = "Tekstin tasaus"
"Text content" = "Tekstisisältö"
+"Text size" = "Tekstin koko"
"Text style" = "Tekstityyli"
"Text styles" = "Tekstityylit"
"Texts" = "Tekstit"
@@ -1393,6 +1416,7 @@ status = "draft — needs native review"
"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."
+"Thumbs up" = "Peukku ylös"
"Tidy up" = "Järjestä tasavälein"
"Tile" = "Laatoitus"
"Tile type" = "Laatan tyyppi"
@@ -1409,6 +1433,7 @@ status = "draft — needs native review"
"Top left radius" = "Vasemman yläkulman säde"
"Top right radius" = "Oikean yläkulman säde"
"Transform" = "Muunna"
+"Triangle" = "Kolmio"
"Triangle arrow" = "Kolmionuoli"
"Trigger" = "Laukaisin"
"True" = "Tosi"
@@ -1771,6 +1796,15 @@ status = "draft — needs native review"
"arrange.roundToPixels" = "Pyöristä pikseleihin"
"arrange.spacing" = "Välistys"
"arrange.tidy" = "Järjestä tasavälein"
+"board.connector" = "Yhdistin"
+"board.ink" = "Tussiviiva"
+"board.label" = "Yhdistimen nimiö"
+"board.nextSticky" = "Seuraava muistilappu"
+"board.setColor" = "Taulun väri"
+"board.setStyle" = "Taulun tyyli"
+"board.shape" = "Muoto ja teksti"
+"board.stamp" = "Leima"
+"board.sticky" = "Muistilappu"
"bool.exclude" = "Sulje valinnan päällekkäinen alue pois"
"bool.flatten" = "Yhdistä Boolen muoto vektoriksi"
"bool.intersect" = "Leikkaa valinnan yhteinen alue"
@@ -1897,6 +1931,7 @@ status = "draft — needs native review"
"file.import" = "Tuo"
"file.moveTab" = "Siirrä välilehti"
"file.new" = "Uusi suunnittelutiedosto"
+"file.newBoard" = "Uusi taulu"
"file.newFromTemplate" = "Uusi mallista"
"file.open" = "Avaa"
"file.openRecent" = "Avaa viimeksi avattu"
@@ -2171,10 +2206,14 @@ status = "draft — needs native review"
"text.weightUp" = "Lisää fontin paksuutta"
"tool.arrow" = "Nuoli"
"tool.comment" = "Kommentti"
+"tool.connector" = "Yhdistin"
"tool.ellipse" = "Ellipsi"
+"tool.eraser" = "Pyyhekumi"
"tool.frame" = "Kehys"
"tool.hand" = "Käsi"
+"tool.highlighter" = "Korostuskynä"
"tool.line" = "Viiva"
+"tool.marker" = "Tussi"
"tool.move" = "Siirrä"
"tool.pen" = "Kynä"
"tool.pencil" = "Lyijykynä"
@@ -2186,9 +2225,12 @@ status = "draft — needs native review"
"tool.scaleAnchor" = "Skaalauksen ankkuri"
"tool.section" = "Osio"
"tool.set" = "Valitse työkalu"
+"tool.shape" = "Muodot"
"tool.shapeBuilder" = "Muodonrakennin"
"tool.slice" = "Viipale"
+"tool.stamp" = "Leima"
"tool.star" = "Tähti"
+"tool.sticky" = "Muistilappu"
"tool.text" = "Teksti"
"transform.move" = "Siirrä"
"transform.moveTo" = "Siirrä kohteeseen"
diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml
index b038b335..5616dca1 100644
--- a/crates/ui-egui/locales/fr.toml
+++ b/crates/ui-egui/locales/fr.toml
@@ -125,6 +125,7 @@ status = "draft — needs native review"
"Archived" = "Archivée"
"Arrange" = "Disposer"
"Arrow" = "Flèche"
+"Arrow at the end" = "Flèche à la fin"
"As typed" = "Tel que saisi"
"Asking the server…" = "Interrogation du serveur…"
"Assets" = "Ressources"
@@ -198,7 +199,9 @@ status = "draft — needs native review"
"C or ⇧C" = "C ou ⇧C"
"CMYK colour" = "Couleur CMJN"
"Can view" = "Peut consulter"
+"Check" = "Coche"
"Checking the server…" = "Vérification auprès du serveur…"
+"Chevron" = "Chevron"
"Clear from this list" = "Effacer de cette liste"
"Code or invite link" = "Code ou lien d’invitation"
"Color profile: {name}" = "Profil colorimétrique : {name}"
@@ -272,6 +275,7 @@ status = "draft — needs native review"
"Commits" = "Commits"
"Company" = "Entreprise"
"Compare changes" = "Comparer les modifications"
+"Compare with" = "Comparer avec"
"Compatibility notes" = "Notes de compatibilité"
"Completed" = "Terminé"
"Component" = "Composant"
@@ -287,6 +291,7 @@ status = "draft — needs native review"
"Connected" = "Connecté"
"Connected to code: {from}" = "Relié au code : {from}"
"Connection lost, reconnecting (attempt {attempt})…" = "Connexion perdue, reconnexion (tentative {attempt})…"
+"Connector" = "Connecteur"
"Constrain proportions" = "Conserver les proportions"
"Constraints" = "Contraintes"
"Content" = "Contenu"
@@ -377,6 +382,7 @@ status = "draft — needs native review"
"Description" = "Description"
"Description (optional)" = "Description (facultative)"
"Design" = "Design"
+"Design panel" = "Panneau Design"
"Design system starter" = "Base de système de design"
"Desktop" = "Ordinateur"
"Destination" = "Destination"
@@ -388,6 +394,7 @@ status = "draft — needs native review"
"Detach variable" = "Détacher la variable"
"Details" = "Détails"
"Dev Mode" = "Mode Dev"
+"Dev Mode only inspects: switch to Design (Shift+D) to edit" = "Le mode Dev sert seulement à inspecter : passez en Design (Shift+D) pour modifier"
"Dev resources" = "Ressources de développement"
"Development" = "Développement"
"Device" = "Appareil"
@@ -439,6 +446,7 @@ status = "draft — needs native review"
"Effect settings" = "Réglages de l’effet"
"Effect styles" = "Styles d’effet"
"Effects" = "Effets"
+"Elbow" = "Coudé"
"Ellipse" = "Ellipse"
"Ellipses" = "Ellipses"
"Else" = "Sinon"
@@ -575,6 +583,7 @@ status = "draft — needs native review"
"Hanging list" = "Liste en retrait"
"Hanging punctuation" = "Ponctuation en débord"
"Hard light" = "Lumière dure"
+"Heart" = "Cœur"
"Height" = "Hauteur"
"Help" = "Aide"
"Help and resources" = "Aide et ressources"
@@ -587,6 +596,7 @@ status = "draft — needs native review"
"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"
+"Highlighter" = "Surligneur"
"Highlights" = "Hautes lumières"
"Hold Alt" = "Maintenir Alt"
"Hold Alt+Z" = "Maintenir Alt+Z"
@@ -754,6 +764,7 @@ status = "draft — needs native review"
"Mark as resolved" = "Marquer comme résolu"
"Mark as unread" = "Marquer comme non lu"
"Mark as unresolved" = "Marquer comme non résolu"
+"Marker" = "Marqueur"
"Mask" = "Masque"
"Mass · Stiffness · Damping" = "Masse · Rigidité · Amortissement"
"Match (empty: the whole name)" = "Correspondance (vide : le nom entier)"
@@ -812,6 +823,7 @@ status = "draft — needs native review"
"Named instance" = "Instance nommée"
"Navigate to" = "Naviguer vers"
"Nested instance" = "Instance imbriquée"
+"New board" = "Nouveau tableau blanc"
"New design file" = "Nouveau fichier de design"
"Newest first" = "Plus récent d’abord"
"Next frame" = "Cadre suivant"
@@ -877,6 +889,7 @@ status = "draft — needs native review"
"Not read yet" = "Pas encore lu"
"Not shared" = "Non partagé"
"Note {n}" = "Note {n}"
+"Nothing changed since this version." = "Rien n’a changé depuis cette version."
"Nothing changed since this was marked ready for dev." = "Rien n’a changé depuis que ceci a été marqué prêt pour le dev."
"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."
@@ -953,6 +966,7 @@ status = "draft — needs native review"
"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"
+"Pink" = "Rose"
"Placed on the current page" = "Placé sur la page actuelle"
"Pages: {pages}" = "Pages : {pages}"
"Paint bucket" = "Pot de peinture"
@@ -997,6 +1011,7 @@ status = "draft — needs native review"
"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"
+"Plus one" = "Plus un"
"Point" = "Point"
"Points" = "Points"
"Polygon" = "Polygone"
@@ -1044,6 +1059,7 @@ status = "draft — needs native review"
"Push" = "Pousser"
"Push changes to main component" = "Transmettre les modifications au composant principal"
"Put text on path" = "Placer le texte sur un tracé"
+"Question" = "Question"
"R" = "R"
"Radial" = "Radial"
"Radius" = "Rayon"
@@ -1090,6 +1106,7 @@ status = "draft — needs native review"
"Removed" = "Supprimé"
"Removed from the server" = "Retiré du serveur"
"Removed since it was marked" = "Supprimé depuis le marquage"
+"Removed since this version" = "Supprimé depuis cette version"
"Rename" = "Renommer"
"Rename duplicated layers" = "Renommer les calques dupliqués"
"Rename folder" = "Renommer le dossier"
@@ -1145,6 +1162,7 @@ status = "draft — needs native review"
"Rotation jitter" = "Variation de rotation"
"Round" = "Arrondi"
"Rounded" = "Arrondi"
+"Rounded rectangle" = "Rectangle arrondi"
"Row" = "Ligne"
"Row gap" = "Espacement des lignes"
"Row sizes" = "Tailles des lignes"
@@ -1218,6 +1236,7 @@ status = "draft — needs native review"
"Shape" = "Forme"
"Shape builder" = "Générateur de formes"
"Shape tools" = "Outils de forme"
+"Shapes" = "Formes"
"Share" = "Partager"
"Share this file" = "Partager ce fichier"
"Share with a code" = "Partager avec un code"
@@ -1284,10 +1303,13 @@ status = "draft — needs native review"
"Space+drag" = "Espace+glisser"
"Spacing" = "Espacement"
"Spam, stolen work, abuse…" = "Spam, travail volé, abus…"
+"Speech bubble" = "Bulle"
"Splay" = "Évasement"
"Spotlight me" = "Me mettre sous les projecteurs"
"Spread" = "Étendue"
"Square" = "Carré"
+"Stamp" = "Tampon"
+"Stamps" = "Tampons"
"Standard" = "Standard"
"Standard ligatures" = "Ligatures standard"
"Star" = "Étoile"
@@ -1304,12 +1326,16 @@ status = "draft — needs native review"
"Starting to share…" = "Démarrage du partage…"
"Status" = "Statut"
"Sticky" = "Collant"
+"Sticky note" = "Note autocollante"
+"Sticky note colors" = "Couleurs des notes autocollantes"
+"Sticky notes, shapes and connectors" = "Notes autocollantes, formes et connecteurs"
"Stop" = "Arrêter"
"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 {n} {hex}" = "Arrêt {n} {hex}"
+"Straight" = "Droit"
"Stretch" = "Étirer"
"Strikethrough" = "Barré"
"String" = "Chaîne"
@@ -1354,6 +1380,7 @@ status = "draft — needs native review"
"Text" = "Texte"
"Text align" = "Alignement du texte"
"Text content" = "Contenu du texte"
+"Text size" = "Taille du texte"
"Text style" = "Style de texte"
"Text styles" = "Styles de texte"
"Texts" = "Textes"
@@ -1388,6 +1415,9 @@ status = "draft — needs native review"
"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é."
+"Thumbs up" = "Pouce levé"
+"This version can't be read." = "Cette version est illisible."
+"This version doesn't have it: all of it is new." = "Cette version ne le contient pas : tout est nouveau."
"Tidy up" = "Ranger"
"Tile" = "Mosaïque"
"Tile type" = "Type de mosaïque"
@@ -1404,6 +1434,7 @@ status = "draft — needs native review"
"Top left radius" = "Rayon supérieur gauche"
"Top right radius" = "Rayon supérieur droit"
"Transform" = "Transformer"
+"Triangle" = "Triangle"
"Triangle arrow" = "Flèche triangulaire"
"Trigger" = "Déclencheur"
"True" = "Vrai"
@@ -1494,10 +1525,12 @@ status = "draft — needs native review"
"Websites" = "Sites web"
"Wedge" = "Coin"
"Weight" = "Graisse"
+"What changed since a saved version" = "Ce qui a changé depuis une version enregistrée"
"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."
+"When marked ready" = "Au marquage prêt"
"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"
@@ -1764,6 +1797,15 @@ status = "draft — needs native review"
"arrange.roundToPixels" = "Arrondir aux pixels"
"arrange.spacing" = "Espacement"
"arrange.tidy" = "Ranger"
+"board.connector" = "Connecteur"
+"board.ink" = "Trait de marqueur"
+"board.label" = "Libellé du connecteur"
+"board.nextSticky" = "Note autocollante suivante"
+"board.setColor" = "Couleur du tableau"
+"board.setStyle" = "Style du tableau"
+"board.shape" = "Forme avec texte"
+"board.stamp" = "Tampon"
+"board.sticky" = "Note autocollante"
"bool.exclude" = "Exclure la sélection"
"bool.flatten" = "Aplatir le booléen"
"bool.intersect" = "Intersection de la sélection"
@@ -1890,6 +1932,7 @@ status = "draft — needs native review"
"file.import" = "Importer"
"file.moveTab" = "Déplacer l’onglet"
"file.new" = "Nouveau fichier de design"
+"file.newBoard" = "Nouveau tableau blanc"
"file.newFromTemplate" = "Nouveau à partir d’un modèle"
"file.open" = "Ouvrir"
"file.openRecent" = "Ouvrir un fichier récent"
@@ -2161,10 +2204,14 @@ status = "draft — needs native review"
"text.weightUp" = "Augmenter la graisse"
"tool.arrow" = "Flèche"
"tool.comment" = "Commentaire"
+"tool.connector" = "Connecteur"
"tool.ellipse" = "Ellipse"
+"tool.eraser" = "Gomme"
"tool.frame" = "Cadre"
"tool.hand" = "Main"
+"tool.highlighter" = "Surligneur"
"tool.line" = "Ligne"
+"tool.marker" = "Marqueur"
"tool.move" = "Déplacer"
"tool.pen" = "Plume"
"tool.pencil" = "Crayon"
@@ -2176,9 +2223,12 @@ status = "draft — needs native review"
"tool.scaleAnchor" = "Ancre de mise à l’échelle"
"tool.section" = "Section"
"tool.set" = "Choisir un outil"
+"tool.shape" = "Formes"
"tool.shapeBuilder" = "Générateur de formes"
"tool.slice" = "Tranche"
+"tool.stamp" = "Tampon"
"tool.star" = "Étoile"
+"tool.sticky" = "Note autocollante"
"tool.text" = "Texte"
"transform.move" = "Déplacer"
"transform.moveTo" = "Déplacer vers"
diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml
index f21e1ca3..bf5fe82e 100644
--- a/crates/ui-egui/locales/id.toml
+++ b/crates/ui-egui/locales/id.toml
@@ -124,6 +124,7 @@ status = "draft — needs native review"
"Archived" = "Diarsipkan"
"Arrange" = "Susun"
"Arrow" = "Panah"
+"Arrow at the end" = "Panah di ujung"
"As typed" = "Sesuai ketikan"
"Asking the server…" = "Menghubungi server…"
"Assets" = "Aset"
@@ -197,7 +198,9 @@ status = "draft — needs native review"
"C or ⇧C" = "C atau ⇧C"
"CMYK colour" = "Warna CMYK"
"Can view" = "Dapat melihat"
+"Check" = "Centang"
"Checking the server…" = "Memeriksa server…"
+"Chevron" = "Chevron"
"Clear from this list" = "Hapus dari daftar ini"
"Code or invite link" = "Kode atau link undangan"
"Color profile: {name}" = "Profil warna: {name}"
@@ -286,6 +289,7 @@ status = "draft — needs native review"
"Connected" = "Terhubung"
"Connected to code: {from}" = "Terhubung ke kode: {from}"
"Connection lost, reconnecting (attempt {attempt})…" = "Koneksi terputus, menghubungkan ulang (percobaan {attempt})…"
+"Connector" = "Konektor"
"Constrain proportions" = "Kunci proporsi"
"Constraints" = "Batasan"
"Content" = "Konten"
@@ -372,6 +376,7 @@ status = "draft — needs native review"
"Description" = "Deskripsi"
"Description (optional)" = "Deskripsi (opsional)"
"Design" = "Desain"
+"Design panel" = "Panel desain"
"Design system starter" = "Dasar sistem desain"
"Desktop" = "Desktop"
"Destination" = "Tujuan"
@@ -431,6 +436,7 @@ status = "draft — needs native review"
"Effect settings" = "Pengaturan efek"
"Effect styles" = "Gaya efek"
"Effects" = "Efek"
+"Elbow" = "Siku"
"Ellipse" = "Elips"
"Ellipses" = "Elips"
"Else" = "Jika tidak"
@@ -566,6 +572,7 @@ status = "draft — needs native review"
"Hanging list" = "Daftar menggantung"
"Hanging punctuation" = "Tanda baca menggantung"
"Hard light" = "Hard light"
+"Heart" = "Hati"
"Height" = "Tinggi"
"Help" = "Bantuan"
"Help and resources" = "Bantuan dan sumber daya"
@@ -578,6 +585,7 @@ status = "draft — needs native review"
"Hide these tips (Getting started in the Help menu shows them again)" = "Sembunyikan tips ini (tampilkan lagi lewat Memulai di menu Bantuan)"
"Hide when publishing" = "Sembunyikan saat dipublikasikan"
"Highlight layers on hover" = "Sorot layer saat hover"
+"Highlighter" = "Stabilo"
"Highlights" = "Sorotan"
"Hold Alt" = "Tahan Alt"
"Hold Alt+Z" = "Tahan Alt+Z"
@@ -743,6 +751,7 @@ status = "draft — needs native review"
"Mark as resolved" = "Tandai selesai"
"Mark as unread" = "Tandai belum dibaca"
"Mark as unresolved" = "Tandai belum selesai"
+"Marker" = "Spidol"
"Mask" = "Mask"
"Mass · Stiffness · Damping" = "Massa · Kekakuan · Redaman"
"Match (empty: the whole name)" = "Cocokkan (kosong: seluruh nama)"
@@ -801,6 +810,7 @@ status = "draft — needs native review"
"Named instance" = "Instance bernama"
"Navigate to" = "Navigasi ke"
"Nested instance" = "Instance bersarang"
+"New board" = "Papan baru"
"New design file" = "File desain baru"
"Newest first" = "Terbaru dulu"
"Next frame" = "Frame berikutnya"
@@ -937,6 +947,7 @@ status = "draft — needs native review"
"Page deleted" = "Halaman dihapus"
"Pages" = "Halaman"
"Pages added to the document" = "Halaman ditambahkan ke dokumen"
+"Pink" = "Merah muda"
"Placed on the current page" = "Ditempatkan di halaman saat ini"
"Pages: {pages}" = "Halaman: {pages}"
"Paint bucket" = "Ember cat"
@@ -979,6 +990,7 @@ status = "draft — needs native review"
"Plugins" = "Plugin"
"Plus darker" = "Plus darker"
"Plus lighter" = "Plus lighter"
+"Plus one" = "Plus satu"
"Point" = "Titik"
"Points" = "Titik"
"Polygon" = "Poligon"
@@ -1027,6 +1039,7 @@ status = "draft — needs native review"
"Push" = "Dorong"
"Push changes to main component" = "Terapkan perubahan ke main component"
"Put text on path" = "Tempatkan teks di path"
+"Question" = "Pertanyaan"
"R" = "R"
"Radial" = "Radial"
"Radius" = "Radius"
@@ -1126,6 +1139,7 @@ status = "draft — needs native review"
"Rotation jitter" = "Variasi rotasi"
"Round" = "Bulat"
"Rounded" = "Membulat"
+"Rounded rectangle" = "Persegi panjang membulat"
"Row" = "Baris"
"Row gap" = "Jarak baris"
"Row sizes" = "Ukuran baris"
@@ -1198,6 +1212,7 @@ status = "draft — needs native review"
"Shape" = "Bentuk"
"Shape builder" = "Shape builder"
"Shape tools" = "Alat bentuk"
+"Shapes" = "Bentuk"
"Share" = "Bagikan"
"Share this file" = "Bagikan file ini"
"Share with a code" = "Bagikan dengan kode"
@@ -1264,10 +1279,13 @@ status = "draft — needs native review"
"Space+drag" = "Space+seret"
"Spacing" = "Spasi"
"Spam, stolen work, abuse…" = "Spam, karya curian, penyalahgunaan…"
+"Speech bubble" = "Balon kata"
"Splay" = "Bukaan"
"Spotlight me" = "Sorot saya"
"Spread" = "Sebaran"
"Square" = "Persegi"
+"Stamp" = "Stempel"
+"Stamps" = "Stempel"
"Standard" = "Standar"
"Standard ligatures" = "Ligatur standar"
"Star" = "Bintang"
@@ -1283,12 +1301,16 @@ status = "draft — needs native review"
"Starting to share…" = "Memulai berbagi…"
"Status" = "Status"
"Sticky" = "Menempel"
+"Sticky note" = "Catatan tempel"
+"Sticky note colors" = "Warna catatan tempel"
+"Sticky notes, shapes and connectors" = "Catatan tempel, bentuk, dan konektor"
"Stop" = "Hentikan"
"Stop following {name}" = "Berhenti mengikuti {name}"
"Stop session" = "Hentikan sesi"
"Stop sharing" = "Berhenti berbagi"
"Stop spotlighting" = "Hentikan sorotan"
"Stop {n} {hex}" = "Titik {n} {hex}"
+"Straight" = "Lurus"
"Stretch" = "Regangkan"
"Strikethrough" = "Coret"
"String" = "String"
@@ -1333,6 +1355,7 @@ status = "draft — needs native review"
"Text" = "Teks"
"Text align" = "Perataan teks"
"Text content" = "Konten teks"
+"Text size" = "Ukuran teks"
"Text style" = "Gaya teks"
"Text styles" = "Gaya teks"
"Texts" = "Teks"
@@ -1363,6 +1386,7 @@ status = "draft — needs native review"
"This server is open to the public: no key needed." = "Server ini terbuka untuk publik: tidak perlu kunci."
"This server needs its key: add ?key=… to the address (`figcraft-server key` prints it on the server's machine)." = "Server ini memerlukan kuncinya: tambahkan ?key=… ke alamat (`figcraft-server key` menampilkannya di mesin server)."
"This server takes files only with its key: see Advanced." = "Server ini hanya menerima file dengan kuncinya: lihat Lanjutan."
+"Thumbs up" = "Jempol"
"Tidy up" = "Rapikan"
"Tile" = "Ubin"
"Tile type" = "Jenis ubin"
@@ -1379,6 +1403,7 @@ status = "draft — needs native review"
"Top left radius" = "Radius kiri atas"
"Top right radius" = "Radius kanan atas"
"Transform" = "Transformasi"
+"Triangle" = "Segitiga"
"Triangle arrow" = "Panah segitiga"
"Trigger" = "Pemicu"
"True" = "Benar"
@@ -1733,6 +1758,15 @@ status = "draft — needs native review"
"arrange.roundToPixels" = "Bulatkan ke piksel"
"arrange.spacing" = "Spasi"
"arrange.tidy" = "Rapikan"
+"board.connector" = "Konektor"
+"board.ink" = "Goresan spidol"
+"board.label" = "Label konektor"
+"board.nextSticky" = "Catatan tempel berikutnya"
+"board.setColor" = "Warna papan"
+"board.setStyle" = "Gaya papan"
+"board.shape" = "Bentuk dengan teks"
+"board.stamp" = "Stempel"
+"board.sticky" = "Catatan tempel"
"bool.exclude" = "Kecualikan pilihan"
"bool.flatten" = "Satukan boolean"
"bool.intersect" = "Iriskan pilihan"
@@ -1858,6 +1892,7 @@ status = "draft — needs native review"
"file.import" = "Impor"
"file.moveTab" = "Pindahkan tab"
"file.new" = "File desain baru"
+"file.newBoard" = "Papan baru"
"file.newFromTemplate" = "Baru dari templat"
"file.open" = "Buka"
"file.openRecent" = "Buka terbaru"
@@ -2124,10 +2159,14 @@ status = "draft — needs native review"
"text.weightUp" = "Tambah ketebalan font"
"tool.arrow" = "Panah"
"tool.comment" = "Komentar"
+"tool.connector" = "Konektor"
"tool.ellipse" = "Elips"
+"tool.eraser" = "Penghapus"
"tool.frame" = "Frame"
"tool.hand" = "Tangan"
+"tool.highlighter" = "Stabilo"
"tool.line" = "Garis"
+"tool.marker" = "Spidol"
"tool.move" = "Pindahkan"
"tool.pen" = "Pena"
"tool.pencil" = "Pensil"
@@ -2139,9 +2178,12 @@ status = "draft — needs native review"
"tool.scaleAnchor" = "Titik acuan skala"
"tool.section" = "Section"
"tool.set" = "Pilih alat"
+"tool.shape" = "Bentuk"
"tool.shapeBuilder" = "Shape builder"
"tool.slice" = "Slice"
+"tool.stamp" = "Stempel"
"tool.star" = "Bintang"
+"tool.sticky" = "Catatan tempel"
"tool.text" = "Teks"
"transform.move" = "Pindahkan"
"transform.moveTo" = "Pindahkan ke"
diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml
index c42790f3..a6ffa01f 100644
--- a/crates/ui-egui/locales/ja.toml
+++ b/crates/ui-egui/locales/ja.toml
@@ -126,6 +126,7 @@ status = "draft — needs native review"
"Archived" = "アーカイブ済み"
"Arrange" = "配置"
"Arrow" = "矢印"
+"Arrow at the end" = "末端に矢印"
"As typed" = "入力どおり"
"Asking the server…" = "サーバーに問い合わせ中…"
"Assets" = "アセット"
@@ -199,7 +200,9 @@ status = "draft — needs native review"
"C or ⇧C" = "C または ⇧C"
"CMYK colour" = "CMYK カラー"
"Can view" = "閲覧可"
+"Check" = "チェック"
"Checking the server…" = "サーバーを確認中…"
+"Chevron" = "シェブロン"
"Clear from this list" = "このリストから消去"
"Code or invite link" = "コードまたは招待リンク"
"Color profile: {name}" = "カラープロファイル:{name}"
@@ -273,6 +276,7 @@ status = "draft — needs native review"
"Commits" = "コミット"
"Company" = "会社"
"Compare changes" = "変更を比較"
+"Compare with" = "比較対象"
"Compatibility notes" = "互換性に関する注記"
"Completed" = "完了"
"Component" = "コンポーネント"
@@ -288,6 +292,7 @@ status = "draft — needs native review"
"Connected" = "接続済み"
"Connected to code: {from}" = "コードに接続済み:{from}"
"Connection lost, reconnecting (attempt {attempt})…" = "接続が切断。再接続中({attempt} 回目)…"
+"Connector" = "コネクタ"
"Constrain proportions" = "縦横比を固定"
"Constraints" = "制約"
"Content" = "コンテンツ"
@@ -375,6 +380,7 @@ status = "draft — needs native review"
"Description" = "説明"
"Description (optional)" = "説明(任意)"
"Design" = "デザイン"
+"Design panel" = "デザインパネル"
"Design system starter" = "デザインシステムの雛形"
"Desktop" = "デスクトップ"
"Destination" = "遷移先"
@@ -386,6 +392,7 @@ status = "draft — needs native review"
"Detach variable" = "変数を切り離す"
"Details" = "詳細"
"Dev Mode" = "開発モード"
+"Dev Mode only inspects: switch to Design (Shift+D) to edit" = "開発モードは検査専用です。編集するにはデザイン (Shift+D) に切り替えてください"
"Dev resources" = "開発リソース"
"Development" = "開発"
"Device" = "デバイス"
@@ -434,6 +441,7 @@ status = "draft — needs native review"
"Effect settings" = "エフェクトの設定"
"Effect styles" = "エフェクトスタイル"
"Effects" = "エフェクト"
+"Elbow" = "直角"
"Ellipse" = "楕円"
"Ellipses" = "楕円"
"Else" = "それ以外"
@@ -570,6 +578,7 @@ status = "draft — needs native review"
"Hanging list" = "ぶら下げリスト"
"Hanging punctuation" = "ぶら下げ句読点"
"Hard light" = "ハードライト"
+"Heart" = "ハート"
"Height" = "高さ"
"Help" = "ヘルプ"
"Help and resources" = "ヘルプとリソース"
@@ -582,6 +591,7 @@ status = "draft — needs native review"
"Hide these tips (Getting started in the Help menu shows them again)" = "ヒントを非表示(ヘルプメニューの「使い始めるには」で再表示)"
"Hide when publishing" = "公開時に非表示"
"Highlight layers on hover" = "ホバー時にレイヤーをハイライト"
+"Highlighter" = "蛍光ペン"
"Highlights" = "ハイライト"
"Hold Alt" = "Alt を押したまま"
"Hold Alt+Z" = "Alt+Z を押したまま"
@@ -748,6 +758,7 @@ status = "draft — needs native review"
"Mark as resolved" = "解決済みにする"
"Mark as unread" = "未読にする"
"Mark as unresolved" = "未解決にする"
+"Marker" = "マーカー"
"Mask" = "マスク"
"Mass · Stiffness · Damping" = "質量 · 剛性 · 減衰"
"Match (empty: the whole name)" = "一致(空欄:名前全体)"
@@ -806,6 +817,7 @@ status = "draft — needs native review"
"Named instance" = "名前付きインスタンス"
"Navigate to" = "移動先"
"Nested instance" = "ネストされたインスタンス"
+"New board" = "新規ボード"
"New design file" = "新規デザインファイル"
"Newest first" = "新しい順"
"Next frame" = "次のフレーム"
@@ -870,6 +882,7 @@ status = "draft — needs native review"
"Not read yet" = "未読"
"Not shared" = "共有していない"
"Note {n}" = "メモ {n}"
+"Nothing changed since this version." = "このバージョンから変更なし。"
"Nothing changed since this was marked ready for dev." = "開発準備完了にしてから変更なし。"
"Nothing here yet. Set a frame's status to list it." = "まだ何もない。フレームのステータスを設定すると一覧に表示される。"
"Nothing online yet. Use Share on a file to put it online and it is listed here." = "オンラインのファイルはまだない。ファイルの「共有」からオンラインにすると、ここに表示される。"
@@ -942,6 +955,7 @@ status = "draft — needs native review"
"Page deleted" = "ページは削除済み"
"Pages" = "ページ"
"Pages added to the document" = "ページをドキュメントに追加した"
+"Pink" = "ピンク"
"Placed on the current page" = "現在のページに配置した"
"Pages: {pages}" = "ページ:{pages}"
"Paint bucket" = "塗りつぶし"
@@ -985,6 +999,7 @@ status = "draft — needs native review"
"Plugins run in FigCraft's sandbox, without files, network or clock. Install only plugins you trust." = "プラグインは FigCraft のサンドボックス内で、ファイル、ネットワーク、時計なしで実行される。信頼できるプラグインのみをインストールすること。"
"Plus darker" = "プラス(暗)"
"Plus lighter" = "プラス(明)"
+"Plus one" = "プラスワン"
"Point" = "ポイント"
"Points" = "ポイント"
"Polygon" = "多角形"
@@ -1032,6 +1047,7 @@ status = "draft — needs native review"
"Push" = "プッシュ"
"Push changes to main component" = "変更をメインコンポーネントにプッシュ"
"Put text on path" = "テキストをパスに沿わせる"
+"Question" = "質問"
"R" = "R"
"Radial" = "放射状"
"Radius" = "半径"
@@ -1077,6 +1093,7 @@ status = "draft — needs native review"
"Removed" = "削除"
"Removed from the server" = "サーバーから削除済み"
"Removed since it was marked" = "マーク後に削除"
+"Removed since this version" = "このバージョン以降に削除"
"Rename" = "名前を変更"
"Rename duplicated layers" = "複製したレイヤーの名前を変更"
"Rename folder" = "フォルダー名を変更"
@@ -1132,6 +1149,7 @@ status = "draft — needs native review"
"Rotation jitter" = "回転のばらつき"
"Round" = "丸型"
"Rounded" = "丸型"
+"Rounded rectangle" = "角丸長方形"
"Row" = "行"
"Row gap" = "行の間隔"
"Row sizes" = "行のサイズ"
@@ -1205,6 +1223,7 @@ status = "draft — needs native review"
"Shape" = "シェイプ"
"Shape builder" = "シェイプビルダー"
"Shape tools" = "シェイプツール"
+"Shapes" = "シェイプ"
"Share" = "共有"
"Share this file" = "このファイルを共有"
"Share with a code" = "コードで共有"
@@ -1271,10 +1290,13 @@ status = "draft — needs native review"
"Space+drag" = "Space+ドラッグ"
"Spacing" = "間隔"
"Spam, stolen work, abuse…" = "スパム、盗用、迷惑行為…"
+"Speech bubble" = "吹き出し"
"Splay" = "広がり"
"Spotlight me" = "自分をスポットライト"
"Spread" = "スプレッド"
"Square" = "正方形"
+"Stamp" = "スタンプ"
+"Stamps" = "スタンプ"
"Standard" = "標準"
"Standard ligatures" = "標準合字"
"Star" = "星"
@@ -1291,12 +1313,16 @@ status = "draft — needs native review"
"Starting to share…" = "共有を開始中…"
"Status" = "ステータス"
"Sticky" = "固定"
+"Sticky note" = "付箋"
+"Sticky note colors" = "付箋の色"
+"Sticky notes, shapes and connectors" = "付箋、シェイプ、コネクタ"
"Stop" = "停止"
"Stop following {name}" = "{name} のフォローを停止"
"Stop session" = "セッションを停止"
"Stop sharing" = "共有を停止"
"Stop spotlighting" = "スポットライトを停止"
"Stop {n} {hex}" = "分岐点 {n} {hex}"
+"Straight" = "直線"
"Stretch" = "伸縮"
"Strikethrough" = "取り消し線"
"String" = "文字列"
@@ -1341,6 +1367,7 @@ status = "draft — needs native review"
"Text" = "テキスト"
"Text align" = "テキストの配置"
"Text content" = "テキストの内容"
+"Text size" = "テキストサイズ"
"Text style" = "テキストスタイル"
"Text styles" = "テキストスタイル"
"Texts" = "テキスト"
@@ -1371,6 +1398,9 @@ status = "draft — needs native review"
"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." = "このサーバーはキーがないとファイルを受け付けない:「詳細設定」を参照。"
+"Thumbs up" = "いいね"
+"This version can't be read." = "このバージョンを読み込めません。"
+"This version doesn't have it: all of it is new." = "このバージョンにはありません。すべて新規です。"
"Tidy up" = "整列"
"Tile" = "タイル"
"Tile type" = "タイルの種類"
@@ -1387,6 +1417,7 @@ status = "draft — needs native review"
"Top left radius" = "左上の半径"
"Top right radius" = "右上の半径"
"Transform" = "変形"
+"Triangle" = "三角形"
"Triangle arrow" = "三角矢印"
"Trigger" = "トリガー"
"True" = "true"
@@ -1476,11 +1507,13 @@ status = "draft — needs native review"
"Websites" = "Webサイト"
"Wedge" = "くさび"
"Weight" = "太さ"
+"What changed since a saved version" = "保存したバージョンからの変更"
"What changed since it was marked ready for dev" = "開発準備完了にしてからの変更内容"
"What is wrong with this file? The server's operator gets your report." = "このファイルの何が問題ですか? 報告はサーバーの運営者に届く。"
"What it's for" = "用途"
"What this changed from isn't known: it changed before FigCraft kept a copy of ready-for-dev frames. Resolve the change (or mark it ready again) to compare from now on." = "変更前の状態は不明:FigCraft が開発準備完了フレームのコピーを保存するようになる前に変更された。変更を解決する(または再度準備完了にする)と、今後はそこから比較する。"
"What you try here changes this preview and the code below, not the file" = "ここでの操作はプレビューと下のコードに反映。ファイルは変更されない"
+"When marked ready" = "準備完了にした時点"
"While hovering" = "ホバー中"
"While pressing" = "押している間"
"White" = "白"
@@ -1744,6 +1777,15 @@ status = "draft — needs native review"
"arrange.roundToPixels" = "ピクセルに丸める"
"arrange.spacing" = "間隔"
"arrange.tidy" = "整列"
+"board.connector" = "コネクタ"
+"board.ink" = "マーカーの線"
+"board.label" = "コネクタのラベル"
+"board.nextSticky" = "次の付箋"
+"board.setColor" = "ボードの色"
+"board.setStyle" = "ボードのスタイル"
+"board.shape" = "テキスト付きシェイプ"
+"board.stamp" = "スタンプ"
+"board.sticky" = "付箋"
"bool.exclude" = "選択範囲を除外"
"bool.flatten" = "ブーリアンを平坦化"
"bool.intersect" = "選択範囲を交差"
@@ -1870,6 +1912,7 @@ status = "draft — needs native review"
"file.import" = "インポート"
"file.moveTab" = "タブを移動"
"file.new" = "新規デザインファイル"
+"file.newBoard" = "新規ボード"
"file.newFromTemplate" = "テンプレートから新規作成"
"file.open" = "開く"
"file.openRecent" = "最近使ったファイルを開く"
@@ -2139,10 +2182,14 @@ status = "draft — needs native review"
"text.weightUp" = "フォントの太さを太く"
"tool.arrow" = "矢印"
"tool.comment" = "コメント"
+"tool.connector" = "コネクタ"
"tool.ellipse" = "楕円"
+"tool.eraser" = "消しゴム"
"tool.frame" = "フレーム"
"tool.hand" = "手のひら"
+"tool.highlighter" = "蛍光ペン"
"tool.line" = "線"
+"tool.marker" = "マーカー"
"tool.move" = "移動"
"tool.pen" = "ペン"
"tool.pencil" = "鉛筆"
@@ -2154,9 +2201,12 @@ status = "draft — needs native review"
"tool.scaleAnchor" = "拡大縮小の基準点"
"tool.section" = "セクション"
"tool.set" = "ツールを選択"
+"tool.shape" = "シェイプ"
"tool.shapeBuilder" = "シェイプビルダー"
"tool.slice" = "スライス"
+"tool.stamp" = "スタンプ"
"tool.star" = "星"
+"tool.sticky" = "付箋"
"tool.text" = "テキスト"
"transform.move" = "移動"
"transform.moveTo" = "指定位置へ移動"
diff --git a/crates/ui-egui/locales/ka.toml b/crates/ui-egui/locales/ka.toml
index 5b73b4fb..ffbc8444 100644
--- a/crates/ui-egui/locales/ka.toml
+++ b/crates/ui-egui/locales/ka.toml
@@ -128,6 +128,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"Archived" = "დაარქივებულია"
"Arrange" = "დალაგება"
"Arrow" = "ისარი"
+"Arrow at the end" = "ისარი ბოლოში"
"As typed" = "როგორც აიკრიფა"
"Asking the server…" = "სერვერთან მოთხოვნა…"
"Assets" = "რესურსები"
@@ -201,12 +202,15 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"C or ⇧C" = "C ან ⇧C"
"CMYK colour" = "CMYK ფერი"
"Can view" = "შეუძლია ნახვა"
+"Check" = "ნიშნული"
"Checking the fonts installed on this computer…" = "ამ კომპიუტერზე დაინსტალირებული შრიფტების შემოწმება…"
"Checking the server…" = "სერვერის შემოწმება…"
+"Chevron" = "შევრონი"
"Clear from this list" = "ამ სიიდან ამოღება"
"Code or invite link" = "კოდი ან მოსაწვევი ბმული"
"Color profile: {name}" = "ფერის პროფილი: {name}"
"Colour and text styles, Light and Dark variables, buttons, inputs and cards" = "ფერისა და ტექსტის სტილები, ღია და მუქი ცვლადები, ღილაკები, შეყვანის ველები და ბარათები"
+"Connector" = "შემაერთებელი"
"Convert to frame" = "ჩარჩოდ გარდაქმნა"
"Convert to section" = "სექციად გარდაქმნა"
"CSS custom properties…" = "CSS-ის მორგებული თვისებები…"
@@ -380,6 +384,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"Description" = "აღწერა"
"Description (optional)" = "აღწერა (არასავალდებულო)"
"Design" = "დიზაინი"
+"Design panel" = "დიზაინის პანელი"
"Design system starter" = "დიზაინ-სისტემის საწყისი ნაკრები"
"Desktop" = "დესკტოპი"
"Destination" = "დანიშნულება"
@@ -442,6 +447,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"Effect settings" = "ეფექტის პარამეტრები"
"Effect styles" = "ეფექტის სტილები"
"Effects" = "ეფექტები"
+"Elbow" = "კუთხოვანი"
"Ellipse" = "ელიფსი"
"Ellipses" = "ელიფსები"
"Else" = "სხვა შემთხვევაში"
@@ -578,6 +584,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"Hanging list" = "გამოწეული სია"
"Hanging punctuation" = "გამოწეული პუნქტუაცია"
"Hard light" = "მკვეთრი სინათლე"
+"Heart" = "გული"
"Height" = "სიმაღლე"
"Help" = "დახმარება"
"Help and resources" = "დახმარება და რესურსები"
@@ -590,6 +597,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"Hide these tips (Getting started in the Help menu shows them again)" = "ამ რჩევების დამალვა („პირველი ნაბიჯები“ დახმარების მენიუში ისევ აჩვენებს მათ)"
"Hide when publishing" = "გამოქვეყნებისას დამალვა"
"Highlight layers on hover" = "შრეების გამოკვეთა მაჩვენებლის მიტანისას"
+"Highlighter" = "ხაზგასმის მარკერი"
"Highlights" = "ღია ტონები"
"Hold Alt" = "Alt-ის დაჭერა"
"Hold Alt+Z" = "Alt+Z-ის დაჭერა"
@@ -756,6 +764,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"Mark as resolved" = "გადაწყვეტილად მარკირება"
"Mark as unread" = "წაუკითხავად მარკირება"
"Mark as unresolved" = "გადაუწყვეტლად მარკირება"
+"Marker" = "მარკერი"
"Mask" = "ნიღაბი"
"Mass · Stiffness · Damping" = "მასა · სიხისტე · მილევა"
"Match (empty: the whole name)" = "დამთხვევა (ცარიელი: მთელი სახელი)"
@@ -815,6 +824,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"Named instance" = "დასახელებული ინსტანსი"
"Navigate to" = "გადასვლა"
"Nested instance" = "ჩადგმული ინსტანსი"
+"New board" = "ახალი დაფა"
"New design file" = "ახალი დიზაინის ფაილი"
"Newest first" = "ჯერ უახლესი"
"Next or previous control in the focused region" = "ფოკუსირებულ არეში შემდეგი ან წინა მართვის ელემენტი"
@@ -955,6 +965,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"Page" = "გვერდი"
"Pages" = "გვერდები"
"Pages added to the document" = "გვერდები დაემატა დოკუმენტს"
+"Pink" = "ვარდისფერი"
"Placed on the current page" = "განთავსდა მიმდინარე გვერდზე"
"Pages: {pages}" = "გვერდი: {pages}"
"Paint bucket" = "საღებავის ვედრო"
@@ -999,6 +1010,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"Plugins & widgets" = "პლაგინები და ვიჯეტები"
"Plus darker" = "პლუს მუქი"
"Plus lighter" = "პლუს ღია"
+"Plus one" = "პლუს ერთი"
"Point" = "წერტილი"
"Points" = "წერტილები"
"Polygon" = "მრავალკუთხედი"
@@ -1047,6 +1059,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"Push" = "ბიძგი"
"Push changes to main component" = "ცვლილებების მთავარ კომპონენტში გადაგზავნა"
"Put text on path" = "ტექსტის ტრაექტორიაზე განთავსება"
+"Question" = "კითხვა"
"R" = "R"
"Radial" = "რადიალური"
"Radius" = "რადიუსი"
@@ -1147,6 +1160,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"Rotation jitter" = "შემობრუნების ცვალებადობა"
"Round" = "მომრგვალებული"
"Rounded" = "მომრგვალებული"
+"Rounded rectangle" = "მომრგვალებული მართკუთხედი"
"Row" = "სტრიქონი"
"Row gap" = "სტრიქონებს შორის შუალედი"
"Row sizes" = "სტრიქონების ზომები"
@@ -1222,6 +1236,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"Shape" = "ფიგურა"
"Shape builder" = "ფიგურების კონსტრუქტორი"
"Shape tools" = "ფიგურის ხელსაწყოები"
+"Shapes" = "ფიგურები"
"Share" = "გაზიარება"
"Share this file" = "ამ ფაილის გაზიარება"
"Share with a code" = "კოდით გაზიარება"
@@ -1288,10 +1303,13 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"Space+drag" = "Space+გადათრევა"
"Spacing" = "ინტერვალი"
"Spam, stolen work, abuse…" = "სპამი, მოპარული ნამუშევარი, შეურაცხყოფა…"
+"Speech bubble" = "სიტყვის ბუშტი"
"Splay" = "გაშლილობა"
"Spotlight me" = "ჩემი ხედის ჩვენება ყველასთვის"
"Spread" = "გაფართოება"
"Square" = "კვადრატი"
+"Stamp" = "შტამპი"
+"Stamps" = "შტამპები"
"Standard" = "სტანდარტული"
"Standard ligatures" = "სტანდარტული ლიგატურები"
"Star" = "ვარსკვლავი"
@@ -1307,12 +1325,16 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"Starting to share…" = "გაზიარების დაწყება…"
"Status" = "სტატუსი"
"Sticky" = "მიმაგრებული"
+"Sticky note" = "სტიკერი"
+"Sticky note colors" = "სტიკერების ფერები"
+"Sticky notes, shapes and connectors" = "სტიკერები, ფიგურები და შემაერთებლები"
"Stop" = "შეწყვეტა"
"Stop following {name}" = "{name}-ის მიყოლის შეწყვეტა"
"Stop session" = "სესიის შეწყვეტა"
"Stop sharing" = "გაზიარების შეწყვეტა"
"Stop spotlighting" = "ჩემი ხედის ჩვენების შეწყვეტა"
"Stop {n} {hex}" = "გადასვლის წერტილი {n} {hex}"
+"Straight" = "სწორი"
"Stretch" = "გაწელვა"
"Strikethrough" = "გადახაზული"
"String" = "ტექსტი"
@@ -1357,6 +1379,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"Text" = "ტექსტი"
"Text align" = "ტექსტის სწორება"
"Text content" = "ტექსტის შიგთავსი"
+"Text size" = "ტექსტის ზომა"
"Text style" = "ტექსტის სტილი"
"Text styles" = "ტექსტის სტილები"
"Texts" = "ტექსტები"
@@ -1391,6 +1414,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"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." = "ეს სერვერი ფაილებს მხოლოდ გასაღებით იღებს: იხილეთ „დამატებითი“."
+"Thumbs up" = "ცერი ზემოთ"
"Tidy up" = "მოწესრიგება"
"Tile" = "ფილებად"
"Tile type" = "ფილის ტიპი"
@@ -1407,6 +1431,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"Top left radius" = "ზედა მარცხენა რადიუსი"
"Top right radius" = "ზედა მარჯვენა რადიუსი"
"Transform" = "გარდაქმნა"
+"Triangle" = "სამკუთხედი"
"Triangle arrow" = "სამკუთხა ისარი"
"Trigger" = "გამშვები"
"True" = "ჭეშმარიტი"
@@ -1768,6 +1793,15 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"arrange.roundToPixels" = "პიქსელებამდე დამრგვალება"
"arrange.spacing" = "ინტერვალი"
"arrange.tidy" = "მოწესრიგება"
+"board.connector" = "შემაერთებელი"
+"board.ink" = "მარკერის შტრიხი"
+"board.label" = "შემაერთებლის წარწერა"
+"board.nextSticky" = "შემდეგი სტიკერი"
+"board.setColor" = "დაფის ფერი"
+"board.setStyle" = "დაფის სტილი"
+"board.shape" = "ფიგურა ტექსტით"
+"board.stamp" = "შტამპი"
+"board.sticky" = "სტიკერი"
"bool.exclude" = "მონიშნულის გამორიცხვა"
"bool.flatten" = "ლოგიკური ოპერაციის გაბრტყელება"
"bool.intersect" = "მონიშნულის გადაკვეთა"
@@ -1893,6 +1927,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"file.exportSvg" = "მონიშნულის SVG-ად ექსპორტირება"
"file.import" = "იმპორტი"
"file.new" = "ახალი დიზაინის ფაილი"
+"file.newBoard" = "ახალი დაფა"
"file.newFromTemplate" = "შაბლონიდან შექმნა"
"file.open" = "გახსნა"
"file.openRecent" = "ბოლოს გახსნილი ფაილების გახსნა"
@@ -2163,10 +2198,14 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"text.weightUp" = "შრიფტის სისქის გაზრდა"
"tool.arrow" = "ისარი"
"tool.comment" = "კომენტარი"
+"tool.connector" = "შემაერთებელი"
"tool.ellipse" = "ელიფსი"
+"tool.eraser" = "საშლელი"
"tool.frame" = "ჩარჩო"
"tool.hand" = "ხელი"
+"tool.highlighter" = "ხაზგასმის მარკერი"
"tool.line" = "ხაზი"
+"tool.marker" = "მარკერი"
"tool.move" = "გადაადგილება"
"tool.pen" = "კალამი"
"tool.pencil" = "ფანქარი"
@@ -2178,9 +2217,12 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"tool.scaleAnchor" = "მასშტაბირების საყრდენი წერტილი"
"tool.section" = "სექცია"
"tool.set" = "ხელსაწყოს არჩევა"
+"tool.shape" = "ფიგურები"
"tool.shapeBuilder" = "ფიგურების კონსტრუქტორი"
"tool.slice" = "ნაჭერი"
+"tool.stamp" = "შტამპი"
"tool.star" = "ვარსკვლავი"
+"tool.sticky" = "სტიკერი"
"tool.text" = "ტექსტი"
"transform.move" = "გადაადგილება"
"transform.moveTo" = "გადატანა"
diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml
index b33b36b9..2192e29b 100644
--- a/crates/ui-egui/locales/ko.toml
+++ b/crates/ui-egui/locales/ko.toml
@@ -118,6 +118,7 @@ status = "draft — needs native review"
"Archived" = "보관됨"
"Arrange" = "배치"
"Arrow" = "화살표"
+"Arrow at the end" = "끝에 화살표"
"As typed" = "입력한 대로"
"Asking the server…" = "서버에 확인하는 중…"
"Assets" = "에셋"
@@ -189,7 +190,9 @@ status = "draft — needs native review"
"C or ⇧C" = "C 또는 ⇧C"
"CMYK colour" = "CMYK 색상"
"Can view" = "보기 가능"
+"Check" = "체크"
"Checking the server…" = "서버 확인 중…"
+"Chevron" = "셰브런"
"Clear from this list" = "이 목록에서 지우기"
"Code or invite link" = "코드 또는 초대 링크"
"Color profile: {name}" = "색상 프로필: {name}"
@@ -262,6 +265,7 @@ status = "draft — needs native review"
"Commits" = "커밋"
"Company" = "회사"
"Compare changes" = "변경 사항 비교"
+"Compare with" = "비교 대상"
"Compatibility notes" = "호환성 참고 사항"
"Completed" = "완료됨"
"Component" = "컴포넌트"
@@ -277,6 +281,7 @@ status = "draft — needs native review"
"Connected" = "연결됨"
"Connected to code: {from}" = "코드에 연결됨: {from}"
"Connection lost, reconnecting (attempt {attempt})…" = "연결이 끊어짐. 다시 연결하는 중({attempt}번째 시도)…"
+"Connector" = "커넥터"
"Constrain proportions" = "비율 고정"
"Constraints" = "제약"
"Content" = "콘텐츠"
@@ -360,6 +365,7 @@ status = "draft — needs native review"
"Description" = "설명"
"Description (optional)" = "설명(선택 사항)"
"Design" = "디자인"
+"Design panel" = "디자인 패널"
"Desktop" = "데스크톱"
"Destination" = "대상"
"Detach alias" = "별칭 분리"
@@ -370,6 +376,7 @@ status = "draft — needs native review"
"Detach variable" = "변수 분리"
"Details" = "세부 정보"
"Dev Mode" = "개발 모드"
+"Dev Mode only inspects: switch to Design (Shift+D) to edit" = "개발 모드는 검사 전용입니다. 편집하려면 디자인(Shift+D)으로 전환하세요"
"Dev resources" = "개발 리소스"
"Development" = "개발"
"Device" = "기기"
@@ -416,6 +423,7 @@ status = "draft — needs native review"
"Effect settings" = "효과 설정"
"Effect styles" = "효과 스타일"
"Effects" = "효과"
+"Elbow" = "꺾은선"
"Ellipse" = "타원"
"Ellipses" = "타원"
"Else" = "그 외"
@@ -546,6 +554,7 @@ status = "draft — needs native review"
"Hanging list" = "내어쓰기 목록"
"Hanging punctuation" = "문장 부호 내어쓰기"
"Hard light" = "하드 라이트"
+"Heart" = "하트"
"Height" = "높이"
"Help" = "도움말"
"Help and resources" = "도움말 및 리소스"
@@ -556,6 +565,7 @@ status = "draft — needs native review"
"Hide from publishing" = "게시에서 숨기기"
"Hide section contents" = "섹션 콘텐츠 숨기기"
"Highlight layers on hover" = "마우스를 올리면 레이어 강조"
+"Highlighter" = "형광펜"
"Highlights" = "밝은 영역"
"Hold Alt" = "Alt 누른 채로"
"Hold Alt+Z" = "Alt+Z 누른 채로"
@@ -711,6 +721,7 @@ status = "draft — needs native review"
"Mark as resolved" = "해결됨으로 표시"
"Mark as unread" = "읽지 않음으로 표시"
"Mark as unresolved" = "미해결로 표시"
+"Marker" = "마커"
"Mask" = "마스크"
"Mass · Stiffness · Damping" = "질량 · 강성 · 감쇠"
"Match (empty: the whole name)" = "일치(비우면 이름 전체)"
@@ -767,6 +778,7 @@ status = "draft — needs native review"
"Named instance" = "명명된 인스턴스"
"Navigate to" = "이동 대상"
"Nested instance" = "중첩된 인스턴스"
+"New board" = "새 보드"
"New design file" = "새 디자인 파일"
"Next frame" = "다음 프레임"
"Next or previous control in the focused region" = "포커스된 영역의 다음 또는 이전 컨트롤"
@@ -829,6 +841,7 @@ status = "draft — needs native review"
"Not read yet" = "아직 읽지 않음"
"Not shared" = "공유 안 함"
"Note {n}" = "메모 {n}"
+"Nothing changed since this version." = "이 버전 이후 변경된 내용 없음."
"Nothing changed since this was marked ready for dev." = "개발 준비 완료로 표시된 뒤 변경된 내용 없음."
"Nothing here yet. Set a frame's status to list it." = "아직 아무것도 없음. 프레임의 상태를 설정하면 목록에 표시됨."
"Nothing online yet. Use Share on a file to put it online and it is listed here." = "아직 온라인에 올린 파일이 없음. 파일에서 공유를 사용해 온라인에 올리면 여기에 표시됨."
@@ -896,6 +909,7 @@ status = "draft — needs native review"
"Page deleted" = "페이지가 삭제됨"
"Pages" = "페이지"
"Pages added to the document" = "문서에 페이지 추가됨"
+"Pink" = "분홍"
"Placed on the current page" = "현재 페이지에 배치됨"
"Pages: {pages}" = "페이지: {pages}"
"Paint bucket" = "페인트 통"
@@ -937,6 +951,7 @@ status = "draft — needs native review"
"Plugins run in FigCraft's sandbox, without files, network or clock. Install only plugins you trust." = "플러그인은 FigCraft 샌드박스에서 파일, 네트워크, 시계 없이 실행됨. 신뢰할 수 있는 플러그인만 설치하세요."
"Plus darker" = "더 어둡게"
"Plus lighter" = "더 밝게"
+"Plus one" = "플러스 원"
"Point" = "점"
"Points" = "점"
"Polygon" = "다각형"
@@ -983,6 +998,7 @@ status = "draft — needs native review"
"Push" = "밀어내기"
"Push changes to main component" = "변경 사항을 메인 컴포넌트에 푸시"
"Put text on path" = "텍스트를 패스에 배치"
+"Question" = "질문"
"R" = "R"
"Radial" = "방사형"
"Radius" = "반경"
@@ -1027,6 +1043,7 @@ status = "draft — needs native review"
"Removed" = "제거됨"
"Removed from the server" = "서버에서 제거됨"
"Removed since it was marked" = "표시된 뒤 제거됨"
+"Removed since this version" = "이 버전 이후 삭제됨"
"Rename" = "이름 바꾸기"
"Rename duplicated layers" = "복제한 레이어 이름 바꾸기"
"Rename folder" = "폴더 이름 바꾸기"
@@ -1082,6 +1099,7 @@ status = "draft — needs native review"
"Rotation jitter" = "회전 지터"
"Round" = "둥글게"
"Rounded" = "둥근"
+"Rounded rectangle" = "둥근 사각형"
"Row" = "행"
"Row gap" = "행 간격"
"Row sizes" = "행 크기"
@@ -1151,6 +1169,7 @@ status = "draft — needs native review"
"Shape" = "도형"
"Shape builder" = "도형 빌더"
"Shape tools" = "도형 도구"
+"Shapes" = "도형"
"Share" = "공유"
"Share this file" = "이 파일 공유"
"Share: live session, export" = "공유: 라이브 세션, 내보내기"
@@ -1208,10 +1227,13 @@ status = "draft — needs native review"
"Space+drag" = "Space+드래그"
"Spacing" = "간격"
"Spam, stolen work, abuse…" = "스팸, 도용, 악용…"
+"Speech bubble" = "말풍선"
"Splay" = "펼침"
"Spotlight me" = "나를 스포트라이트"
"Spread" = "확산"
"Square" = "정사각형"
+"Stamp" = "스탬프"
+"Stamps" = "스탬프"
"Standard" = "표준"
"Standard ligatures" = "표준 합자"
"Star" = "별"
@@ -1226,12 +1248,16 @@ status = "draft — needs native review"
"Starting to share…" = "공유를 시작하는 중…"
"Status" = "상태"
"Sticky" = "고정"
+"Sticky note" = "스티커 메모"
+"Sticky note colors" = "스티커 메모 색상"
+"Sticky notes, shapes and connectors" = "스티커 메모, 도형, 커넥터"
"Stop" = "중지"
"Stop following {name}" = "{name} 따라가기 중지"
"Stop session" = "세션 중지"
"Stop sharing" = "공유 중지"
"Stop spotlighting" = "스포트라이트 중지"
"Stop {n} {hex}" = "정지점 {n} {hex}"
+"Straight" = "직선"
"Stretch" = "늘이기"
"Strikethrough" = "취소선"
"String" = "문자열"
@@ -1275,6 +1301,7 @@ status = "draft — needs native review"
"Text" = "텍스트"
"Text align" = "텍스트 정렬"
"Text content" = "텍스트 내용"
+"Text size" = "텍스트 크기"
"Text style" = "텍스트 스타일"
"Text styles" = "텍스트 스타일"
"Texts" = "텍스트"
@@ -1305,6 +1332,9 @@ status = "draft — needs native review"
"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." = "이 서버는 키가 있어야만 파일을 받음: 고급을 참고하세요."
+"Thumbs up" = "좋아요"
+"This version can't be read." = "이 버전을 읽을 수 없습니다."
+"This version doesn't have it: all of it is new." = "이 버전에는 없습니다. 모두 새 항목입니다."
"Tidy up" = "정돈"
"Tile" = "타일"
"Tile type" = "타일 유형"
@@ -1321,6 +1351,7 @@ status = "draft — needs native review"
"Top left radius" = "왼쪽 위 반경"
"Top right radius" = "오른쪽 위 반경"
"Transform" = "변형"
+"Triangle" = "삼각형"
"Triangle arrow" = "삼각 화살표"
"Trigger" = "트리거"
"True" = "참"
@@ -1406,10 +1437,12 @@ status = "draft — needs native review"
"WebSocket URL copied" = "WebSocket URL 복사됨"
"Wedge" = "쐐기"
"Weight" = "굵기"
+"What changed since a saved version" = "저장된 버전 이후 변경된 내용"
"What changed since it was marked ready for dev" = "개발 준비 완료로 표시된 뒤 변경된 내용"
"What is wrong with this file? The server's operator gets your report." = "이 파일에 어떤 문제가 있나요? 신고는 서버 운영자에게 전달됨."
"What it's for" = "용도"
"What this changed from isn't known: it changed before FigCraft kept a copy of ready-for-dev frames. Resolve the change (or mark it ready again) to compare from now on." = "무엇에서 바뀌었는지 알 수 없음: FigCraft가 개발 준비 완료 프레임의 사본을 보관하기 전에 변경됨. 변경을 해결(또는 다시 준비 완료로 표시)하면 이후부터 비교함."
+"When marked ready" = "준비 완료로 표시한 시점"
"While hovering" = "마우스를 올린 동안"
"While pressing" = "누르는 동안"
"White" = "흰색"
@@ -1668,6 +1701,15 @@ status = "draft — needs native review"
"arrange.roundToPixels" = "픽셀에 맞춰 반올림"
"arrange.spacing" = "간격"
"arrange.tidy" = "정돈"
+"board.connector" = "커넥터"
+"board.ink" = "마커 획"
+"board.label" = "커넥터 레이블"
+"board.nextSticky" = "다음 스티커 메모"
+"board.setColor" = "보드 색상"
+"board.setStyle" = "보드 스타일"
+"board.shape" = "텍스트가 있는 도형"
+"board.stamp" = "스탬프"
+"board.sticky" = "스티커 메모"
"bool.exclude" = "선택 항목 제외"
"bool.flatten" = "불리언 평면화"
"bool.intersect" = "선택 항목 교차"
@@ -1792,6 +1834,7 @@ status = "draft — needs native review"
"file.import" = "가져오기"
"file.moveTab" = "탭 이동"
"file.new" = "새 디자인 파일"
+"file.newBoard" = "새 보드"
"file.open" = "열기"
"file.openRecent" = "최근 파일 열기"
"file.placeImage" = "이미지 배치"
@@ -2055,10 +2098,14 @@ status = "draft — needs native review"
"text.weightUp" = "글꼴 굵기 늘리기"
"tool.arrow" = "화살표"
"tool.comment" = "댓글"
+"tool.connector" = "커넥터"
"tool.ellipse" = "타원"
+"tool.eraser" = "지우개"
"tool.frame" = "프레임"
"tool.hand" = "손"
+"tool.highlighter" = "형광펜"
"tool.line" = "선"
+"tool.marker" = "마커"
"tool.move" = "이동"
"tool.pen" = "펜"
"tool.pencil" = "연필"
@@ -2070,9 +2117,12 @@ status = "draft — needs native review"
"tool.scaleAnchor" = "배율 기준점"
"tool.section" = "섹션"
"tool.set" = "도구 선택"
+"tool.shape" = "도형"
"tool.shapeBuilder" = "도형 빌더"
"tool.slice" = "슬라이스"
+"tool.stamp" = "스탬프"
"tool.star" = "별"
+"tool.sticky" = "스티커 메모"
"tool.text" = "텍스트"
"transform.move" = "이동"
"transform.moveTo" = "위치로 이동"
diff --git a/crates/ui-egui/locales/nl.toml b/crates/ui-egui/locales/nl.toml
index 54851043..2b301b39 100644
--- a/crates/ui-egui/locales/nl.toml
+++ b/crates/ui-egui/locales/nl.toml
@@ -127,6 +127,7 @@ status = "draft — needs native review"
"Archived" = "Gearchiveerd"
"Arrange" = "Schikken"
"Arrow" = "Pijl"
+"Arrow at the end" = "Pijl aan het eind"
"As typed" = "Zoals getypt"
"Asking the server…" = "Bezig met vragen aan de server…"
"Assets" = "Assets"
@@ -221,8 +222,10 @@ status = "draft — needs native review"
"Changes on main" = "Wijzigingen op main"
"Changes on the branch" = "Wijzigingen op de branch"
"Changes unknown" = "Onbekende wijzigingen"
+"Check" = "Vinkje"
"Checking the fonts installed on this computer…" = "De lettertypen op deze computer worden gecontroleerd…"
"Checking the server…" = "Server controleren…"
+"Chevron" = "Punthaak"
"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"
@@ -290,6 +293,7 @@ status = "draft — needs native review"
"Connected" = "Verbonden"
"Connected to code: {from}" = "Verbonden met code: {from}"
"Connection lost, reconnecting (attempt {attempt})…" = "Verbinding verbroken, opnieuw verbinden (poging {attempt})…"
+"Connector" = "Verbinding"
"Constrain proportions" = "Verhoudingen vergrendelen"
"Constraints" = "Constraints"
"Content" = "Inhoud"
@@ -380,6 +384,7 @@ status = "draft — needs native review"
"Description" = "Beschrijving"
"Description (optional)" = "Beschrijving (optioneel)"
"Design" = "Design"
+"Design panel" = "Ontwerppaneel"
"Design system starter" = "Designsysteem-starter"
"Desktop" = "Desktop"
"Destination" = "Bestemming"
@@ -442,6 +447,7 @@ status = "draft — needs native review"
"Effect settings" = "Effectinstellingen"
"Effect styles" = "Effectstijlen"
"Effects" = "Effecten"
+"Elbow" = "Haaks"
"Ellipse" = "Ellips"
"Ellipses" = "Ellipsen"
"Else" = "Anders"
@@ -578,6 +584,7 @@ status = "draft — needs native review"
"Hanging list" = "Lijst met hangende inspringing"
"Hanging punctuation" = "Uithangende leestekens"
"Hard light" = "Hard light"
+"Heart" = "Hart"
"Height" = "Hoogte"
"Help" = "Help"
"Help and resources" = "Help en bronnen"
@@ -590,6 +597,7 @@ status = "draft — needs native review"
"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"
+"Highlighter" = "Markeerstift"
"Highlights" = "Hooglichten"
"Hold Alt" = "Houd Alt ingedrukt"
"Hold Alt+Z" = "Houd Alt+Z ingedrukt"
@@ -756,6 +764,7 @@ status = "draft — needs native review"
"Mark as resolved" = "Markeren als opgelost"
"Mark as unread" = "Markeren als ongelezen"
"Mark as unresolved" = "Markeren als onopgelost"
+"Marker" = "Stift"
"Mask" = "Masker"
"Mass · Stiffness · Damping" = "Massa · Stijfheid · Demping"
"Match (empty: the whole name)" = "Overeenkomst (leeg: de hele naam)"
@@ -815,6 +824,7 @@ status = "draft — needs native review"
"Named instance" = "Benoemde instance"
"Navigate to" = "Ga naar"
"Nested instance" = "Geneste instance"
+"New board" = "Nieuw whiteboard"
"New design file" = "Nieuw ontwerpbestand"
"Newest first" = "Nieuwste eerst"
"Next frame" = "Volgend frame"
@@ -987,6 +997,7 @@ status = "draft — needs native review"
"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"
+"Pink" = "Roze"
"Pixel grid" = "Pixelraster"
"Pixel preview 1x" = "Pixelvoorvertoning 1x"
"Pixel preview 2x" = "Pixelvoorvertoning 2x"
@@ -1001,6 +1012,7 @@ status = "draft — needs native review"
"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"
+"Plus one" = "Plus één"
"Point" = "Punt"
"Points" = "Punten"
"Polygon" = "Veelhoek"
@@ -1048,6 +1060,7 @@ status = "draft — needs native review"
"Push" = "Pushen"
"Push changes to main component" = "Wijzigingen naar hoofdcomponent doorvoeren"
"Put text on path" = "Tekst op pad plaatsen"
+"Question" = "Vraag"
"R" = "R"
"Radial" = "Radiaal"
"Radius" = "Radius"
@@ -1148,6 +1161,7 @@ status = "draft — needs native review"
"Rotation jitter" = "Verspreide rotatie"
"Round" = "Rond"
"Rounded" = "Rounded"
+"Rounded rectangle" = "Afgeronde rechthoek"
"Row" = "Rij"
"Row gap" = "Rijafstand"
"Row sizes" = "Rijgroottes"
@@ -1223,6 +1237,7 @@ status = "draft — needs native review"
"Shape" = "Vorm"
"Shape builder" = "Shape builder"
"Shape tools" = "Vormgereedschap"
+"Shapes" = "Vormen"
"Share" = "Delen"
"Share this file" = "Dit bestand delen"
"Share with a code" = "Delen met een code"
@@ -1289,10 +1304,13 @@ status = "draft — needs native review"
"Space+drag" = "Space+drag"
"Spacing" = "Afstand"
"Spam, stolen work, abuse…" = "Spam, gestolen werk, misbruik…"
+"Speech bubble" = "Tekstballon"
"Splay" = "Splay"
"Spotlight me" = "Spotlight mij"
"Spread" = "Spread"
"Square" = "Vierkant"
+"Stamp" = "Stempel"
+"Stamps" = "Stempels"
"Standard" = "Standaard"
"Standard ligatures" = "Standaardligaturen"
"Star" = "Ster"
@@ -1309,12 +1327,16 @@ status = "draft — needs native review"
"Starting to share…" = "Bezig met delen…"
"Status" = "Status"
"Sticky" = "Sticky"
+"Sticky note" = "Plakbriefje"
+"Sticky note colors" = "Kleuren van plakbriefjes"
+"Sticky notes, shapes and connectors" = "Plakbriefjes, vormen en verbindingen"
"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}"
+"Straight" = "Recht"
"Stretch" = "Uitrekken"
"Strikethrough" = "Doorstrepen"
"String" = "Tekenreeks"
@@ -1359,6 +1381,7 @@ status = "draft — needs native review"
"Text" = "Tekst"
"Text align" = "Tekstuitlijning"
"Text content" = "Tekstinhoud"
+"Text size" = "Tekstgrootte"
"Text style" = "Tekststijl"
"Text styles" = "Tekststijlen"
"Texts" = "Teksten"
@@ -1393,6 +1416,7 @@ status = "draft — needs native review"
"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."
+"Thumbs up" = "Duim omhoog"
"Tidy up" = "Opruimen"
"Tile" = "Tegelen"
"Tile type" = "Tegeltype"
@@ -1409,6 +1433,7 @@ status = "draft — needs native review"
"Top left radius" = "Radius linksboven"
"Top right radius" = "Hoekradius rechtsboven"
"Transform" = "Transformeren"
+"Triangle" = "Driehoek"
"Triangle arrow" = "Driehoekspijl"
"Trigger" = "Trigger"
"True" = "Waar"
@@ -1770,6 +1795,15 @@ status = "draft — needs native review"
"arrange.roundToPixels" = "Afronden op pixels"
"arrange.spacing" = "Afstand"
"arrange.tidy" = "Opruimen"
+"board.connector" = "Verbinding"
+"board.ink" = "Stiftlijn"
+"board.label" = "Label van verbinding"
+"board.nextSticky" = "Volgend plakbriefje"
+"board.setColor" = "Whiteboardkleur"
+"board.setStyle" = "Whiteboardstijl"
+"board.shape" = "Vorm met tekst"
+"board.stamp" = "Stempel"
+"board.sticky" = "Plakbriefje"
"bool.exclude" = "Exclude toepassen op selectie"
"bool.flatten" = "Boolean afvlakken"
"bool.intersect" = "Intersect toepassen op selectie"
@@ -1896,6 +1930,7 @@ status = "draft — needs native review"
"file.import" = "Importeren"
"file.moveTab" = "Tabblad verplaatsen"
"file.new" = "Nieuw ontwerpbestand"
+"file.newBoard" = "Nieuw whiteboard"
"file.newFromTemplate" = "Nieuw vanuit sjabloon"
"file.open" = "Openen"
"file.openRecent" = "Onlangs geopende bestanden"
@@ -2166,10 +2201,14 @@ status = "draft — needs native review"
"text.weightUp" = "Letterdikte vergroten"
"tool.arrow" = "Pijl"
"tool.comment" = "Reactie"
+"tool.connector" = "Verbinding"
"tool.ellipse" = "Ellips"
+"tool.eraser" = "Gum"
"tool.frame" = "Frame"
"tool.hand" = "Hand"
+"tool.highlighter" = "Markeerstift"
"tool.line" = "Lijn"
+"tool.marker" = "Stift"
"tool.move" = "Verplaatsen"
"tool.pen" = "Pen"
"tool.pencil" = "Potlood"
@@ -2181,9 +2220,12 @@ status = "draft — needs native review"
"tool.scaleAnchor" = "Schaalanker"
"tool.section" = "Sectie"
"tool.set" = "Gereedschap kiezen"
+"tool.shape" = "Vormen"
"tool.shapeBuilder" = "Shape builder"
"tool.slice" = "Slice"
+"tool.stamp" = "Stempel"
"tool.star" = "Ster"
+"tool.sticky" = "Plakbriefje"
"tool.text" = "Tekst"
"transform.move" = "Verplaatsen"
"transform.moveTo" = "Verplaatsen naar"
diff --git a/crates/ui-egui/locales/pl.toml b/crates/ui-egui/locales/pl.toml
index 23f7dee8..51c59f9e 100644
--- a/crates/ui-egui/locales/pl.toml
+++ b/crates/ui-egui/locales/pl.toml
@@ -124,6 +124,7 @@ status = "draft — needs native review"
"Archived" = "Zarchiwizowano"
"Arrange" = "Ułóż"
"Arrow" = "Strzałka"
+"Arrow at the end" = "Strzałka na końcu"
"As typed" = "Zgodnie z wpisanym"
"Asking the server…" = "Odpytywanie serwera…"
"Assets" = "Zasoby"
@@ -197,12 +198,15 @@ status = "draft — needs native review"
"C or ⇧C" = "C lub ⇧C"
"CMYK colour" = "Kolor CMYK"
"Can view" = "Może przeglądać"
+"Check" = "Ptaszek"
"Checking the fonts installed on this computer…" = "Sprawdzanie czcionek zainstalowanych na tym komputerze…"
"Checking the server…" = "Sprawdzanie serwera…"
+"Chevron" = "Szewron"
"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"
+"Connector" = "Łącznik"
"Convert to frame" = "Konwertuj na ramkę"
"Convert to section" = "Konwertuj na sekcję"
"CSS custom properties…" = "Właściwości niestandardowe CSS…"
@@ -377,6 +381,7 @@ status = "draft — needs native review"
"Description" = "Opis"
"Description (optional)" = "Opis (opcjonalnie)"
"Design" = "Projektowanie"
+"Design panel" = "Panel projektu"
"Design system starter" = "Pakiet startowy systemu projektowego (Design System)"
"Desktop" = "Pulpit"
"Destination" = "Miejsce docelowe"
@@ -439,6 +444,7 @@ status = "draft — needs native review"
"Effect settings" = "Ustawienia efektów"
"Effect styles" = "Style efektów"
"Effects" = "Efekty"
+"Elbow" = "Łamany"
"Ellipse" = "Elipsa"
"Ellipses" = "Elipsy"
"Else" = "W przeciwnym razie"
@@ -575,6 +581,7 @@ status = "draft — needs native review"
"Hanging list" = "Lista z wysunięciem"
"Hanging punctuation" = "Wiszące znaki interpunkcyjne"
"Hard light" = "Mocne światło"
+"Heart" = "Serce"
"Height" = "Wysokość"
"Help" = "Pomoc"
"Help and resources" = "Pomoc i zasoby"
@@ -587,6 +594,7 @@ status = "draft — needs native review"
"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"
+"Highlighter" = "Zakreślacz"
"Highlights" = "Światła"
"Hold Alt" = "Przytrzymaj Alt"
"Hold Alt+Z" = "Przytrzymaj Alt+Z"
@@ -753,6 +761,7 @@ status = "draft — needs native review"
"Mark as resolved" = "Oznacz jako rozwiązane"
"Mark as unread" = "Oznacz jako nieprzeczytane"
"Mark as unresolved" = "Oznacz jako nierozwiązane"
+"Marker" = "Marker"
"Mask" = "Maska"
"Mass · Stiffness · Damping" = "Masa · Sztywność · Tłumienie"
"Match (empty: the whole name)" = "Dopasowanie (puste: cała nazwa)"
@@ -812,6 +821,7 @@ status = "draft — needs native review"
"Named instance" = "Nazwana instancja"
"Navigate to" = "Przejdź do"
"Nested instance" = "Zagnieżdżona instancja"
+"New board" = "Nowa tablica"
"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"
@@ -952,6 +962,7 @@ status = "draft — needs native review"
"Page" = "Strona"
"Pages" = "Strony"
"Pages added to the document" = "Strony dodane do dokumentu"
+"Pink" = "Różowy"
"Placed on the current page" = "Umieszczono na bieżącej stronie"
"Pages: {pages}" = "Strony: {pages}"
"Paint bucket" = "Wiadro z farbą"
@@ -996,6 +1007,7 @@ status = "draft — needs native review"
"Plugins & widgets" = "Wtyczki i widżety"
"Plus darker" = "Plus ciemniejszy"
"Plus lighter" = "Plus jaśniejszy"
+"Plus one" = "Plus jeden"
"Point" = "Punkt"
"Points" = "Punkty"
"Polygon" = "Wielokąt"
@@ -1044,6 +1056,7 @@ status = "draft — needs native review"
"Push" = "Wypychanie"
"Push changes to main component" = "Wypchnij zmiany do głównego komponentu"
"Put text on path" = "Umieść tekst na ścieżce"
+"Question" = "Pytanie"
"R" = "R"
"Radial" = "Promienisty"
"Radius" = "Promień"
@@ -1144,6 +1157,7 @@ status = "draft — needs native review"
"Rotation jitter" = "Drżenie obrotu (jitter)"
"Round" = "Okrągłe"
"Rounded" = "Zaokrąglone"
+"Rounded rectangle" = "Zaokrąglony prostokąt"
"Row" = "Wiersz"
"Row gap" = "Odstęp między wierszami"
"Row sizes" = "Rozmiary wierszy"
@@ -1219,6 +1233,7 @@ status = "draft — needs native review"
"Shape" = "Kształt"
"Shape builder" = "Kreator kształtów"
"Shape tools" = "Narzędzia kształtów"
+"Shapes" = "Kształty"
"Share" = "Udostępnij"
"Share this file" = "Udostępnij ten plik"
"Share with a code" = "Udostępnij za pomocą kodu"
@@ -1285,10 +1300,13 @@ status = "draft — needs native review"
"Space+drag" = "Spacja+przeciągnięcie"
"Spacing" = "Odstępy"
"Spam, stolen work, abuse…" = "Spam, plagiat, naruszenie zasad…"
+"Speech bubble" = "Dymek"
"Splay" = "Rozszerzenie"
"Spotlight me" = "Wyróżnij mój widok (Spotlight me)"
"Spread" = "Rozszerzenie"
"Square" = "Kwadratowe"
+"Stamp" = "Pieczątka"
+"Stamps" = "Pieczątki"
"Standard" = "Standardowy"
"Standard ligatures" = "Ligatury standardowe"
"Star" = "Gwiazda"
@@ -1304,12 +1322,16 @@ status = "draft — needs native review"
"Starting to share…" = "Rozpoczynanie udostępniania…"
"Status" = "Stan"
"Sticky" = "Przyklejony (sticky)"
+"Sticky note" = "Karteczka"
+"Sticky note colors" = "Kolory karteczek"
+"Sticky notes, shapes and connectors" = "Karteczki, kształty i łączniki"
"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}"
+"Straight" = "Prosty"
"Stretch" = "Rozciągnięcie"
"Strikethrough" = "Przekreślenie"
"String" = "Tekst (string)"
@@ -1354,6 +1376,7 @@ status = "draft — needs native review"
"Text" = "Tekst"
"Text align" = "Wyrównanie tekstu"
"Text content" = "Zawartość tekstu"
+"Text size" = "Rozmiar tekstu"
"Text style" = "Styl tekstu"
"Text styles" = "Style tekstu"
"Texts" = "Teksty"
@@ -1388,6 +1411,7 @@ status = "draft — needs native review"
"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."
+"Thumbs up" = "Kciuk w górę"
"Tidy up" = "Uporządkuj"
"Tile" = "Sąsiadująco"
"Tile type" = "Typ kafelka"
@@ -1404,6 +1428,7 @@ status = "draft — needs native review"
"Top left radius" = "Promień górnego lewego narożnika"
"Top right radius" = "Promień górnego prawego narożnika"
"Transform" = "Przekształć"
+"Triangle" = "Trójkąt"
"Triangle arrow" = "Strzałka trójkątna"
"Trigger" = "Wyzwalacz"
"True" = "Prawda"
@@ -1766,6 +1791,15 @@ status = "draft — needs native review"
"arrange.roundToPixels" = "Zaokrąglij do pikseli"
"arrange.spacing" = "Odstępy"
"arrange.tidy" = "Uporządkuj"
+"board.connector" = "Łącznik"
+"board.ink" = "Pociągnięcie markera"
+"board.label" = "Etykieta łącznika"
+"board.nextSticky" = "Następna karteczka"
+"board.setColor" = "Kolor na tablicy"
+"board.setStyle" = "Styl na tablicy"
+"board.shape" = "Kształt z tekstem"
+"board.stamp" = "Pieczątka"
+"board.sticky" = "Karteczka"
"bool.exclude" = "Wyklucz zaznaczenie"
"bool.flatten" = "Spłaszcz operację logiczną"
"bool.intersect" = "Część wspólna zaznaczenia"
@@ -1891,6 +1925,7 @@ status = "draft — needs native review"
"file.exportSvg" = "Eksportuj zaznaczenie jako SVG"
"file.import" = "Importuj z pliku…"
"file.new" = "Nowy plik projektu"
+"file.newBoard" = "Nowa tablica"
"file.newFromTemplate" = "Nowy z szablonu"
"file.open" = "Otwórz…"
"file.openRecent" = "Otwórz ostatnie"
@@ -2161,10 +2196,14 @@ status = "draft — needs native review"
"text.weightUp" = "Zwiększ grubość czcionki"
"tool.arrow" = "Strzałka"
"tool.comment" = "Komentarz"
+"tool.connector" = "Łącznik"
"tool.ellipse" = "Elipsa"
+"tool.eraser" = "Gumka"
"tool.frame" = "Ramka"
"tool.hand" = "Rączka"
+"tool.highlighter" = "Zakreślacz"
"tool.line" = "Linia"
+"tool.marker" = "Marker"
"tool.move" = "Wskaźnik"
"tool.pen" = "Pióro"
"tool.pencil" = "Ołówek"
@@ -2176,9 +2215,12 @@ status = "draft — needs native review"
"tool.scaleAnchor" = "Punkt zaczepienia skalowania"
"tool.section" = "Sekcja"
"tool.set" = "Wybierz narzędzie"
+"tool.shape" = "Kształty"
"tool.shapeBuilder" = "Generator kształtów"
"tool.slice" = "Plaster"
+"tool.stamp" = "Pieczątka"
"tool.star" = "Gwiazda"
+"tool.sticky" = "Karteczka"
"tool.text" = "Tekst"
"transform.move" = "Przenieś"
"transform.moveTo" = "Przenieś do"
diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml
index d8f857e0..ed841775 100644
--- a/crates/ui-egui/locales/pt-BR.toml
+++ b/crates/ui-egui/locales/pt-BR.toml
@@ -116,6 +116,7 @@ status = "draft — needs native review"
"Archived" = "Arquivada"
"Arrange" = "Organizar"
"Arrow" = "Seta"
+"Arrow at the end" = "Seta no final"
"As typed" = "Como digitado"
"Asking the server…" = "Consultando o servidor…"
"Assets" = "Recursos"
@@ -187,7 +188,9 @@ status = "draft — needs native review"
"C or ⇧C" = "C ou ⇧C"
"CMYK colour" = "Cor CMYK"
"Can view" = "Pode visualizar"
+"Check" = "Visto"
"Checking the server…" = "Verificando o servidor…"
+"Chevron" = "Divisa"
"Clear from this list" = "Limpar desta lista"
"Code or invite link" = "Código ou link de convite"
"Color profile: {name}" = "Perfil de cor: {name}"
@@ -260,6 +263,7 @@ status = "draft — needs native review"
"Commits" = "Commits"
"Company" = "Empresa"
"Compare changes" = "Comparar alterações"
+"Compare with" = "Comparar com"
"Compatibility notes" = "Notas de compatibilidade"
"Completed" = "Concluído"
"Component" = "Componente"
@@ -275,6 +279,7 @@ status = "draft — needs native review"
"Connected" = "Conectado"
"Connected to code: {from}" = "Conectado ao código: {from}"
"Connection lost, reconnecting (attempt {attempt})…" = "Conexão perdida, reconectando (tentativa {attempt})…"
+"Connector" = "Conector"
"Constrain proportions" = "Manter proporções"
"Constraints" = "Restrições"
"Content" = "Conteúdo"
@@ -359,6 +364,7 @@ status = "draft — needs native review"
"Description" = "Descrição"
"Description (optional)" = "Descrição (opcional)"
"Design" = "Design"
+"Design panel" = "Painel de design"
"Desktop" = "Desktop"
"Destination" = "Destino"
"Detach alias" = "Desvincular alias"
@@ -369,6 +375,7 @@ status = "draft — needs native review"
"Detach variable" = "Desvincular variável"
"Details" = "Detalhes"
"Dev Mode" = "Modo Dev"
+"Dev Mode only inspects: switch to Design (Shift+D) to edit" = "O modo Dev só inspeciona: mude para Design (Shift+D) para editar"
"Dev resources" = "Recursos de desenvolvimento"
"Development" = "Desenvolvimento"
"Device" = "Dispositivo"
@@ -415,6 +422,7 @@ status = "draft — needs native review"
"Effect settings" = "Configurações do efeito"
"Effect styles" = "Estilos de efeito"
"Effects" = "Efeitos"
+"Elbow" = "Em ângulo"
"Ellipse" = "Elipse"
"Ellipses" = "Elipses"
"Else" = "Senão"
@@ -545,6 +553,7 @@ status = "draft — needs native review"
"Hanging list" = "Lista com recuo deslocado"
"Hanging punctuation" = "Pontuação pendente"
"Hard light" = "Luz forte"
+"Heart" = "Coração"
"Height" = "Altura"
"Help" = "Ajuda"
"Help and resources" = "Ajuda e recursos"
@@ -555,6 +564,7 @@ status = "draft — needs native review"
"Hide from publishing" = "Não publicar"
"Hide section contents" = "Ocultar conteúdo da seção"
"Highlight layers on hover" = "Destacar camadas ao passar o cursor"
+"Highlighter" = "Marca-texto"
"Highlights" = "Realces"
"Hold Alt" = "Segure Alt"
"Hold Alt+Z" = "Segure Alt+Z"
@@ -710,6 +720,7 @@ status = "draft — needs native review"
"Mark as resolved" = "Marcar como resolvido"
"Mark as unread" = "Marcar como não lido"
"Mark as unresolved" = "Marcar como não resolvido"
+"Marker" = "Marcador"
"Mask" = "Máscara"
"Mass · Stiffness · Damping" = "Massa · Rigidez · Amortecimento"
"Match (empty: the whole name)" = "Correspondência (vazio: o nome inteiro)"
@@ -766,6 +777,7 @@ status = "draft — needs native review"
"Named instance" = "Instância nomeada"
"Navigate to" = "Navegar para"
"Nested instance" = "Instância aninhada"
+"New board" = "Novo quadro"
"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"
@@ -828,6 +840,7 @@ status = "draft — needs native review"
"Not read yet" = "Ainda não lido"
"Not shared" = "Não compartilhado"
"Note {n}" = "Nota {n}"
+"Nothing changed since this version." = "Nada mudou desde esta versão."
"Nothing changed since this was marked ready for dev." = "Nada mudou desde que isto foi marcado como pronto para dev."
"Nothing here yet. Set a frame's status to list it." = "Ainda não há nada aqui. Defina o status de um quadro para listá-lo."
"Nothing online yet. Use Share on a file to put it online and it is listed here." = "Nada online ainda. Use Compartilhar em um arquivo para colocá-lo online e ele aparecerá aqui."
@@ -895,6 +908,7 @@ status = "draft — needs native review"
"Page deleted" = "Página excluída"
"Pages" = "Páginas"
"Pages added to the document" = "Páginas adicionadas ao documento"
+"Pink" = "Rosa"
"Placed on the current page" = "Colocado na página atual"
"Pages: {pages}" = "Páginas: {pages}"
"Paint bucket" = "Balde de tinta"
@@ -936,6 +950,7 @@ status = "draft — needs native review"
"Plugins run in FigCraft's sandbox, without files, network or clock. Install only plugins you trust." = "Os plugins são executados na sandbox do FigCraft, sem arquivos, rede nem relógio. Instale apenas plugins em que você confia."
"Plus darker" = "Mais escuro"
"Plus lighter" = "Mais claro"
+"Plus one" = "Mais um"
"Point" = "Ponto"
"Points" = "Pontos"
"Polygon" = "Polígono"
@@ -982,6 +997,7 @@ status = "draft — needs native review"
"Push" = "Empurrar"
"Push changes to main component" = "Enviar alterações ao componente principal"
"Put text on path" = "Colocar texto no caminho"
+"Question" = "Pergunta"
"R" = "R"
"Radial" = "Radial"
"Radius" = "Raio"
@@ -1026,6 +1042,7 @@ status = "draft — needs native review"
"Removed" = "Removido"
"Removed from the server" = "Removido do servidor"
"Removed since it was marked" = "Removido desde a marcação"
+"Removed since this version" = "Removido desde esta versão"
"Rename" = "Renomear"
"Rename duplicated layers" = "Renomear camadas duplicadas"
"Rename folder" = "Renomear pasta"
@@ -1081,6 +1098,7 @@ status = "draft — needs native review"
"Rotation jitter" = "Variação de rotação"
"Round" = "Arredondado"
"Rounded" = "Arredondado"
+"Rounded rectangle" = "Retângulo arredondado"
"Row" = "Linha"
"Row gap" = "Espaço entre linhas"
"Row sizes" = "Tamanhos de linha"
@@ -1150,6 +1168,7 @@ status = "draft — needs native review"
"Shape" = "Forma"
"Shape builder" = "Construtor de formas"
"Shape tools" = "Ferramentas de forma"
+"Shapes" = "Formas"
"Share" = "Compartilhar"
"Share this file" = "Compartilhar este arquivo"
"Share: live session, export" = "Compartilhar: sessão ao vivo, exportar"
@@ -1207,10 +1226,13 @@ status = "draft — needs native review"
"Space+drag" = "Espaço+arrastar"
"Spacing" = "Espaçamento"
"Spam, stolen work, abuse…" = "Spam, trabalho roubado, abuso…"
+"Speech bubble" = "Balão de fala"
"Splay" = "Abertura"
"Spotlight me" = "Colocar o foco em mim"
"Spread" = "Expansão"
"Square" = "Quadrado"
+"Stamp" = "Carimbo"
+"Stamps" = "Carimbos"
"Standard" = "Padrão"
"Standard ligatures" = "Ligaduras padrão"
"Star" = "Estrela"
@@ -1225,12 +1247,16 @@ status = "draft — needs native review"
"Starting to share…" = "Começando a compartilhar…"
"Status" = "Status"
"Sticky" = "Fixado"
+"Sticky note" = "Nota adesiva"
+"Sticky note colors" = "Cores das notas adesivas"
+"Sticky notes, shapes and connectors" = "Notas adesivas, formas e conectores"
"Stop" = "Parar"
"Stop following {name}" = "Parar de seguir {name}"
"Stop session" = "Encerrar sessão"
"Stop sharing" = "Parar de compartilhar"
"Stop spotlighting" = "Remover o foco"
"Stop {n} {hex}" = "Parada {n} {hex}"
+"Straight" = "Reto"
"Stretch" = "Esticar"
"Strikethrough" = "Tachado"
"String" = "String"
@@ -1274,6 +1300,7 @@ status = "draft — needs native review"
"Text" = "Texto"
"Text align" = "Alinhamento do texto"
"Text content" = "Conteúdo do texto"
+"Text size" = "Tamanho do texto"
"Text style" = "Estilo de texto"
"Text styles" = "Estilos de texto"
"Texts" = "Textos"
@@ -1304,6 +1331,9 @@ status = "draft — needs native review"
"This server is open to the public: no key needed." = "Este servidor é aberto ao público: não precisa de chave."
"This server needs its key: add ?key=… to the address (`figcraft-server key` prints it on the server's machine)." = "Este servidor precisa da própria chave: adicione ?key=… ao endereço (`figcraft-server key` a mostra na máquina do servidor)."
"This server takes files only with its key: see Advanced." = "Este servidor só aceita arquivos com a própria chave: veja Avançado."
+"Thumbs up" = "Joinha"
+"This version can't be read." = "Não é possível ler esta versão."
+"This version doesn't have it: all of it is new." = "Esta versão não o tem: tudo é novo."
"Tidy up" = "Organizar"
"Tile" = "Mosaico"
"Tile type" = "Tipo de mosaico"
@@ -1320,6 +1350,7 @@ status = "draft — needs native review"
"Top left radius" = "Raio superior esquerdo"
"Top right radius" = "Raio superior direito"
"Transform" = "Transformar"
+"Triangle" = "Triângulo"
"Triangle arrow" = "Seta triangular"
"Trigger" = "Gatilho"
"True" = "Verdadeiro"
@@ -1405,10 +1436,12 @@ status = "draft — needs native review"
"WebSocket URL copied" = "URL do WebSocket copiada"
"Wedge" = "Cunha"
"Weight" = "Espessura"
+"What changed since a saved version" = "O que mudou desde uma versão salva"
"What changed since it was marked ready for dev" = "O que mudou desde que foi marcado como pronto para dev"
"What is wrong with this file? The server's operator gets your report." = "O que há de errado com este arquivo? O operador do servidor recebe a sua denúncia."
"What it's for" = "Para que serve"
"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." = "Não se sabe de onde esta alteração partiu: ela ocorreu antes de o FigCraft guardar cópias dos quadros prontos para dev. Resolva a alteração (ou marque-o como pronto de novo) para comparar daqui em diante."
+"When marked ready" = "Ao marcar como pronto"
"While hovering" = "Enquanto passa o cursor"
"While pressing" = "Enquanto pressiona"
"White" = "Branco"
@@ -1781,6 +1814,15 @@ status = "draft — needs native review"
"arrange.roundToPixels" = "Arredondar para pixels"
"arrange.spacing" = "Espaçamento"
"arrange.tidy" = "Organizar"
+"board.connector" = "Conector"
+"board.ink" = "Traço de marcador"
+"board.label" = "Rótulo do conector"
+"board.nextSticky" = "Próxima nota adesiva"
+"board.setColor" = "Cor no quadro"
+"board.setStyle" = "Estilo no quadro"
+"board.shape" = "Forma com texto"
+"board.stamp" = "Carimbo"
+"board.sticky" = "Nota adesiva"
"bool.exclude" = "Excluir sobreposição da seleção"
"bool.flatten" = "Nivelar booleano"
"bool.intersect" = "Interseção da seleção"
@@ -1905,6 +1947,7 @@ status = "draft — needs native review"
"file.import" = "Importar"
"file.moveTab" = "Mover aba"
"file.new" = "Novo arquivo de design"
+"file.newBoard" = "Novo quadro"
"file.open" = "Abrir"
"file.openRecent" = "Abrir recente"
"file.placeImage" = "Inserir imagem"
@@ -2168,10 +2211,14 @@ status = "draft — needs native review"
"text.weightUp" = "Aumentar peso da fonte"
"tool.arrow" = "Seta"
"tool.comment" = "Comentário"
+"tool.connector" = "Conector"
"tool.ellipse" = "Elipse"
+"tool.eraser" = "Borracha"
"tool.frame" = "Quadro"
"tool.hand" = "Mão"
+"tool.highlighter" = "Marca-texto"
"tool.line" = "Linha"
+"tool.marker" = "Marcador"
"tool.move" = "Mover"
"tool.pen" = "Caneta"
"tool.pencil" = "Lápis"
@@ -2183,9 +2230,12 @@ status = "draft — needs native review"
"tool.scaleAnchor" = "Âncora de escala"
"tool.section" = "Seção"
"tool.set" = "Escolher ferramenta"
+"tool.shape" = "Formas"
"tool.shapeBuilder" = "Construtor de formas"
"tool.slice" = "Fatia"
+"tool.stamp" = "Carimbo"
"tool.star" = "Estrela"
+"tool.sticky" = "Nota adesiva"
"tool.text" = "Texto"
"transform.move" = "Mover"
"transform.moveTo" = "Mover para"
diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml
index 6e173a92..38cfaa4e 100644
--- a/crates/ui-egui/locales/ru.toml
+++ b/crates/ui-egui/locales/ru.toml
@@ -125,6 +125,7 @@ name = "Русский"
"Archived" = "В архиве"
"Arrange" = "Упорядочить"
"Arrow" = "Стрелка"
+"Arrow at the end" = "Стрелка на конце"
"As typed" = "Как введено"
"Asking the server…" = "Запрос к серверу…"
"Assets" = "Ресурсы"
@@ -199,8 +200,10 @@ name = "Русский"
"C or ⇧C" = "C или ⇧C"
"CMYK colour" = "Цвет CMYK"
"Can view" = "Может просматривать"
+"Check" = "Галочка"
"Checking the fonts installed on this computer…" = "Проверка шрифтов, установленных на этом компьютере…"
"Checking the server…" = "Проверка сервера…"
+"Chevron" = "Шеврон"
"Clear from this list" = "Убрать из этого списка"
"Code or invite link" = "Код или ссылка приглашения"
"Color profile: {name}" = "Цветовой профиль: {name}"
@@ -289,6 +292,7 @@ name = "Русский"
"Connected" = "Подключено"
"Connected to code: {from}" = "Связано с кодом: {from}"
"Connection lost, reconnecting (attempt {attempt})…" = "Соединение потеряно, переподключение (попытка {attempt})…"
+"Connector" = "Соединитель"
"Constrain proportions" = "Сохранять пропорции"
"Constraints" = "Ограничения"
"Content" = "Содержимое"
@@ -379,6 +383,7 @@ name = "Русский"
"Description" = "Описание"
"Description (optional)" = "Описание (необязательно)"
"Design" = "Дизайн"
+"Design panel" = "Панель дизайна"
"Design system starter" = "Основа дизайн-системы"
"Desktop" = "Компьютер"
"Destination" = "Назначение"
@@ -441,6 +446,7 @@ name = "Русский"
"Effect settings" = "Настройки эффекта"
"Effect styles" = "Стили эффектов"
"Effects" = "Эффекты"
+"Elbow" = "Ломаная"
"Ellipse" = "Эллипс"
"Ellipses" = "Эллипсы"
"Else" = "Иначе"
@@ -577,6 +583,7 @@ name = "Русский"
"Hanging list" = "Выступающий список"
"Hanging punctuation" = "Висячая пунктуация"
"Hard light" = "Жёсткий свет"
+"Heart" = "Сердце"
"Height" = "Высота"
"Help" = "Справка"
"Help and resources" = "Справка и ресурсы"
@@ -589,6 +596,7 @@ name = "Русский"
"Hide these tips (Getting started in the Help menu shows them again)" = "Скрыть подсказки (их можно вернуть через «Начало работы» в меню справки)"
"Hide when publishing" = "Скрывать при публикации"
"Highlight layers on hover" = "Подсвечивать слои при наведении"
+"Highlighter" = "Текстовыделитель"
"Highlights" = "Света"
"Hold Alt" = "Удерживайте Alt"
"Hold Alt+Z" = "Удерживайте Alt+Z"
@@ -758,6 +766,7 @@ name = "Русский"
"Mark as resolved" = "Отметить как решённое"
"Mark as unread" = "Отметить как непрочитанное"
"Mark as unresolved" = "Отметить как нерешённое"
+"Marker" = "Маркер"
"Mask" = "Маска"
"Mass · Stiffness · Damping" = "Масса · Жёсткость · Демпфирование"
"Match (empty: the whole name)" = "Совпадение (пусто: всё имя)"
@@ -817,6 +826,7 @@ name = "Русский"
"Named instance" = "Именованный экземпляр"
"Navigate to" = "Перейти к"
"Nested instance" = "Вложенный экземпляр"
+"New board" = "Новая доска"
"New design file" = "Новый файл дизайна"
"Newest first" = "Сначала новые"
"Next frame" = "Следующий Frame"
@@ -958,6 +968,7 @@ name = "Русский"
"Page deleted" = "Страница удалена"
"Pages" = "Страницы"
"Pages added to the document" = "Страницы добавлены в документ"
+"Pink" = "Розовый"
"Placed on the current page" = "Размещено на текущей странице"
"Pages: {pages}" = "Страницы: {pages}"
"Paint bucket" = "Заливка области"
@@ -1002,6 +1013,7 @@ name = "Русский"
"Plugins" = "Плагины"
"Plus darker" = "Линейное затемнение"
"Plus lighter" = "Линейное осветление"
+"Plus one" = "Плюс один"
"Point" = "Точка"
"Points" = "Точки"
"Polygon" = "Многоугольник"
@@ -1050,6 +1062,7 @@ name = "Русский"
"Push" = "Вытеснение"
"Push changes to main component" = "Перенести изменения в основной компонент"
"Put text on path" = "Разместить текст на пути"
+"Question" = "Вопрос"
"R" = "R"
"Radial" = "Радиальный"
"Radius" = "Радиус"
@@ -1153,6 +1166,7 @@ name = "Русский"
"Rotation jitter" = "Колебание угла"
"Round" = "Круглое"
"Rounded" = "Скруглённый"
+"Rounded rectangle" = "Скруглённый прямоугольник"
"Row" = "Строка"
"Row gap" = "Интервал между строками"
"Row sizes" = "Размеры строк"
@@ -1229,6 +1243,7 @@ name = "Русский"
"Shape" = "Фигура"
"Shape builder" = "Конструктор фигур"
"Shape tools" = "Инструменты фигур"
+"Shapes" = "Фигуры"
"Share" = "Поделиться"
"Share this file" = "Поделиться файлом"
"Share with a code" = "Поделиться по коду"
@@ -1295,10 +1310,13 @@ name = "Русский"
"Space+drag" = "Пробел+перетаскивание"
"Spacing" = "Интервал"
"Spam, stolen work, abuse…" = "Спам, украденные работы, оскорбления…"
+"Speech bubble" = "Выноска"
"Splay" = "Расхождение"
"Spotlight me" = "Показывать мой экран всем"
"Spread" = "Размах"
"Square" = "Квадрат"
+"Stamp" = "Штамп"
+"Stamps" = "Штампы"
"Standard" = "Стандартный"
"Standard ligatures" = "Стандартные лигатуры"
"Star" = "Звезда"
@@ -1315,12 +1333,16 @@ name = "Русский"
"Starting to share…" = "Включение общего доступа…"
"Status" = "Статус"
"Sticky" = "Закреплённый"
+"Sticky note" = "Стикер"
+"Sticky note colors" = "Цвета стикеров"
+"Sticky notes, shapes and connectors" = "Стикеры, фигуры и соединители"
"Stop" = "Остановить"
"Stop following {name}" = "Перестать следить за {name}"
"Stop session" = "Завершить сессию"
"Stop sharing" = "Остановить общий доступ"
"Stop spotlighting" = "Прекратить показ всем"
"Stop {n} {hex}" = "Точка {n} {hex}"
+"Straight" = "Прямая"
"Stretch" = "Растянуть"
"Strikethrough" = "Зачёркивание"
"String" = "Строка"
@@ -1365,6 +1387,7 @@ name = "Русский"
"Text" = "Текст"
"Text align" = "Выравнивание текста"
"Text content" = "Содержимое текста"
+"Text size" = "Размер текста"
"Text style" = "Текстовый стиль"
"Text styles" = "Текстовые стили"
"Texts" = "Тексты"
@@ -1401,6 +1424,7 @@ name = "Русский"
"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." = "Сервер принимает файлы только с ключом: см. «Дополнительно»."
+"Thumbs up" = "Палец вверх"
"Tidy up" = "Упорядочить"
"Tile" = "Повторение"
"Tile type" = "Тип повторения"
@@ -1418,6 +1442,7 @@ name = "Русский"
"Top padding" = "Верхний внутренний отступ"
"Top right radius" = "Радиус верхнего правого угла"
"Transform" = "Трансформация"
+"Triangle" = "Треугольник"
"Triangle arrow" = "Треугольная стрелка"
"Trigger" = "Триггер"
"True" = "Истина"
@@ -1783,6 +1808,15 @@ name = "Русский"
"arrange.roundToPixels" = "Округлить до пикселей"
"arrange.spacing" = "Интервал"
"arrange.tidy" = "Упорядочить"
+"board.connector" = "Соединитель"
+"board.ink" = "Штрих маркера"
+"board.label" = "Подпись соединителя"
+"board.nextSticky" = "Следующий стикер"
+"board.setColor" = "Цвет на доске"
+"board.setStyle" = "Стиль на доске"
+"board.shape" = "Фигура с текстом"
+"board.stamp" = "Штамп"
+"board.sticky" = "Стикер"
"bool.exclude" = "Исключить выделение"
"bool.flatten" = "Свести булеву группу"
"bool.intersect" = "Пересечь выделение"
@@ -1909,6 +1943,7 @@ name = "Русский"
"file.import" = "Импорт"
"file.moveTab" = "Переместить вкладку"
"file.new" = "Новый файл дизайна"
+"file.newBoard" = "Новая доска"
"file.newFromTemplate" = "Создать из шаблона"
"file.open" = "Открыть"
"file.openRecent" = "Открыть недавние"
@@ -2183,10 +2218,14 @@ name = "Русский"
"text.weightUp" = "Увеличить толщину шрифта"
"tool.arrow" = "Стрелка"
"tool.comment" = "Комментарий"
+"tool.connector" = "Соединитель"
"tool.ellipse" = "Эллипс"
+"tool.eraser" = "Ластик"
"tool.frame" = "Frame"
"tool.hand" = "Рука"
+"tool.highlighter" = "Текстовыделитель"
"tool.line" = "Линия"
+"tool.marker" = "Маркер"
"tool.move" = "Перемещение"
"tool.pen" = "Перо"
"tool.pencil" = "Карандаш"
@@ -2198,9 +2237,12 @@ name = "Русский"
"tool.scaleAnchor" = "Центр масштабирования"
"tool.section" = "Секция"
"tool.set" = "Выбрать инструмент"
+"tool.shape" = "Фигуры"
"tool.shapeBuilder" = "Конструктор фигур"
"tool.slice" = "Срез"
+"tool.stamp" = "Штамп"
"tool.star" = "Звезда"
+"tool.sticky" = "Стикер"
"tool.text" = "Текст"
"transform.move" = "Перемещение"
"transform.moveTo" = "Переместить в"
diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml
index d86779e0..a5f4d4ba 100644
--- a/crates/ui-egui/locales/sv.toml
+++ b/crates/ui-egui/locales/sv.toml
@@ -124,6 +124,7 @@ name = "Svenska"
"Archived" = "Arkiverad"
"Arrange" = "Ordna"
"Arrow" = "Pil"
+"Arrow at the end" = "Pil i slutet"
"As typed" = "Som inskrivet"
"Asking the server…" = "Frågar servern…"
"Assets" = "Tillgångar"
@@ -197,7 +198,9 @@ name = "Svenska"
"C or ⇧C" = "C eller ⇧C"
"CMYK colour" = "CMYK-färg"
"Can view" = "Kan visa"
+"Check" = "Bock"
"Checking the server…" = "Kontrollerar servern…"
+"Chevron" = "Vinkel"
"Clear from this list" = "Ta bort från listan"
"Code or invite link" = "Kod eller inbjudningslänk"
"Color profile: {name}" = "Färgprofil: {name}"
@@ -286,6 +289,7 @@ name = "Svenska"
"Connected" = "Kopplad"
"Connected to code: {from}" = "Kopplad till kod: {from}"
"Connection lost, reconnecting (attempt {attempt})…" = "Anslutningen bröts, återansluter (försök {attempt})…"
+"Connector" = "Koppling"
"Constrain proportions" = "Behåll proportioner"
"Constraints" = "Begränsningar"
"Content" = "Innehåll"
@@ -374,6 +378,7 @@ name = "Svenska"
"Description" = "Beskrivning"
"Description (optional)" = "Beskrivning (valfritt)"
"Design" = "Design"
+"Design panel" = "Designpanel"
"Design system starter" = "Startmall för designsystem"
"Desktop" = "Skrivbord"
"Destination" = "Mål"
@@ -436,6 +441,7 @@ name = "Svenska"
"Effect settings" = "Effektinställningar"
"Effect styles" = "Effektstilar"
"Effects" = "Effekter"
+"Elbow" = "Vinklad"
"Ellipse" = "Ellips"
"Ellipses" = "Ellipser"
"Else" = "Annars"
@@ -572,6 +578,7 @@ name = "Svenska"
"Hanging list" = "Hängande lista"
"Hanging punctuation" = "Hängande skiljetecken"
"Hard light" = "Hårt ljus"
+"Heart" = "Hjärta"
"Height" = "Höjd"
"Help" = "Hjälp"
"Help and resources" = "Hjälp och resurser"
@@ -584,6 +591,7 @@ name = "Svenska"
"Hide these tips (Getting started in the Help menu shows them again)" = "Dölj de här tipsen (Kom igång i Hjälp-menyn visar dem igen)"
"Hide when publishing" = "Dölj vid publicering"
"Highlight layers on hover" = "Framhäv lager vid hovring"
+"Highlighter" = "Överstrykningspenna"
"Highlights" = "Högdagrar"
"Hold Alt" = "Håll ned Alt"
"Hold Alt+Z" = "Håll ned Alt+Z"
@@ -750,6 +758,7 @@ name = "Svenska"
"Mark as resolved" = "Märk som löst"
"Mark as unread" = "Märk som oläst"
"Mark as unresolved" = "Märk som olöst"
+"Marker" = "Märkpenna"
"Mask" = "Mask"
"Mass · Stiffness · Damping" = "Massa · Styvhet · Dämpning"
"Match (empty: the whole name)" = "Matcha (tomt: hela namnet)"
@@ -808,6 +817,7 @@ name = "Svenska"
"Named instance" = "Namngiven instans"
"Navigate to" = "Navigera till"
"Nested instance" = "Kapslad instans"
+"New board" = "Ny whiteboard"
"New design file" = "Ny designfil"
"Newest first" = "Nyaste först"
"Next frame" = "Nästa ram"
@@ -946,6 +956,7 @@ name = "Svenska"
"Page deleted" = "Sidan har raderats"
"Pages" = "Sidor"
"Pages added to the document" = "Sidor tillagda i dokumentet"
+"Pink" = "Rosa"
"Placed on the current page" = "Placerat på den aktuella sidan"
"Pages: {pages}" = "Sidor: {pages}"
"Paint bucket" = "Färghink"
@@ -988,6 +999,7 @@ name = "Svenska"
"Plugins" = "Plugin-program"
"Plus darker" = "Plus mörkare"
"Plus lighter" = "Plus ljusare"
+"Plus one" = "Plus ett"
"Point" = "Punkt"
"Points" = "Punkter"
"Polygon" = "Polygon"
@@ -1036,6 +1048,7 @@ name = "Svenska"
"Push" = "Skjut"
"Push changes to main component" = "Skicka ändringar till huvudkomponenten"
"Put text on path" = "Placera text på bana"
+"Question" = "Fråga"
"R" = "R"
"Radial" = "Radiell"
"Radius" = "Radie"
@@ -1136,6 +1149,7 @@ name = "Svenska"
"Rotation jitter" = "Rotationsdarr"
"Round" = "Rund"
"Rounded" = "Rundad"
+"Rounded rectangle" = "Rundad rektangel"
"Row" = "Rad"
"Row gap" = "Radmellanrum"
"Row sizes" = "Radstorlekar"
@@ -1209,6 +1223,7 @@ name = "Svenska"
"Shape" = "Form"
"Shape builder" = "Formbyggare"
"Shape tools" = "Formverktyg"
+"Shapes" = "Former"
"Share" = "Dela"
"Share this file" = "Dela den här filen"
"Share with a code" = "Dela med en kod"
@@ -1275,10 +1290,13 @@ name = "Svenska"
"Space+drag" = "Blanksteg+dra"
"Spacing" = "Avstånd"
"Spam, stolen work, abuse…" = "Skräppost, stulet material, kränkningar…"
+"Speech bubble" = "Pratbubbla"
"Splay" = "Utbredning"
"Spotlight me" = "Rikta strålkastaren mot mig"
"Spread" = "Spridning"
"Square" = "Kvadrat"
+"Stamp" = "Stämpel"
+"Stamps" = "Stämplar"
"Standard" = "Standard"
"Standard ligatures" = "Standardligaturer"
"Star" = "Stjärna"
@@ -1295,12 +1313,16 @@ name = "Svenska"
"Starting to share…" = "Börjar dela…"
"Status" = "Status"
"Sticky" = "Fast"
+"Sticky note" = "Lapp"
+"Sticky note colors" = "Lappfärger"
+"Sticky notes, shapes and connectors" = "Lappar, former och kopplingar"
"Stop" = "Stoppa"
"Stop following {name}" = "Sluta följa {name}"
"Stop session" = "Avsluta session"
"Stop sharing" = "Sluta dela"
"Stop spotlighting" = "Sluta använda strålkastaren"
"Stop {n} {hex}" = "Stopp {n} {hex}"
+"Straight" = "Rak"
"Stretch" = "Sträck"
"Strikethrough" = "Genomstruken"
"String" = "Sträng"
@@ -1345,6 +1367,7 @@ name = "Svenska"
"Text" = "Text"
"Text align" = "Textjustering"
"Text content" = "Textinnehåll"
+"Text size" = "Textstorlek"
"Text style" = "Textstil"
"Text styles" = "Textstilar"
"Texts" = "Texter"
@@ -1378,6 +1401,7 @@ name = "Svenska"
"This server is open to the public: no key needed." = "Servern är öppen för alla: ingen nyckel behövs."
"This server needs its key: add ?key=… to the address (`figcraft-server key` prints it on the server's machine)." = "Servern kräver sin nyckel: lägg till ?key=… i adressen (`figcraft-server key` skriver ut den på serverns dator)."
"This server takes files only with its key: see Advanced." = "Servern tar bara emot filer med sin nyckel: se Avancerat."
+"Thumbs up" = "Tummen upp"
"Tidy up" = "Snygga till"
"Tile" = "Sida vid sida"
"Tile type" = "Upprepningstyp"
@@ -1394,6 +1418,7 @@ name = "Svenska"
"Top left radius" = "Radie uppe till vänster"
"Top right radius" = "Radie uppe till höger"
"Transform" = "Transformera"
+"Triangle" = "Triangel"
"Triangle arrow" = "Triangelpil"
"Trigger" = "Utlösare"
"True" = "Sant"
@@ -1752,6 +1777,15 @@ name = "Svenska"
"arrange.roundToPixels" = "Avrunda till pixlar"
"arrange.spacing" = "Avstånd"
"arrange.tidy" = "Snygga till"
+"board.connector" = "Koppling"
+"board.ink" = "Märkpennsdrag"
+"board.label" = "Kopplingsetikett"
+"board.nextSticky" = "Nästa lapp"
+"board.setColor" = "Whiteboardfärg"
+"board.setStyle" = "Whiteboardstil"
+"board.shape" = "Form med text"
+"board.stamp" = "Stämpel"
+"board.sticky" = "Lapp"
"bool.exclude" = "Uteslut markering"
"bool.flatten" = "Platta till boolesk form"
"bool.intersect" = "Skärning av markering"
@@ -1878,6 +1912,7 @@ name = "Svenska"
"file.import" = "Importera"
"file.moveTab" = "Flytta flik"
"file.new" = "Nytt"
+"file.newBoard" = "Ny whiteboard"
"file.newFromTemplate" = "Nytt från mall"
"file.open" = "Öppna"
"file.openRecent" = "Öppna senaste"
@@ -2147,10 +2182,14 @@ name = "Svenska"
"text.weightUp" = "Öka teckenvikten"
"tool.arrow" = "Pil"
"tool.comment" = "Kommentar"
+"tool.connector" = "Koppling"
"tool.ellipse" = "Ellips"
+"tool.eraser" = "Suddgummi"
"tool.frame" = "Ram"
"tool.hand" = "Hand"
+"tool.highlighter" = "Överstrykningspenna"
"tool.line" = "Linje"
+"tool.marker" = "Märkpenna"
"tool.move" = "Flytta"
"tool.pen" = "Penna"
"tool.pencil" = "Blyertspenna"
@@ -2162,9 +2201,12 @@ name = "Svenska"
"tool.scaleAnchor" = "Skalningsankare"
"tool.section" = "Avsnitt"
"tool.set" = "Välj verktyg"
+"tool.shape" = "Former"
"tool.shapeBuilder" = "Formbyggare"
"tool.slice" = "Skiva"
+"tool.stamp" = "Stämpel"
"tool.star" = "Stjärna"
+"tool.sticky" = "Lapp"
"tool.text" = "Text"
"transform.move" = "Flytta"
"transform.moveTo" = "Flytta till"
diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml
index bd8bb7c9..aa3207a5 100644
--- a/crates/ui-egui/locales/tr.toml
+++ b/crates/ui-egui/locales/tr.toml
@@ -124,6 +124,7 @@ name = "Türkçe"
"Archived" = "Arşivlendi"
"Arrange" = "Konumlandır"
"Arrow" = "Ok"
+"Arrow at the end" = "Sonda ok"
"As typed" = "Yazıldığı gibi"
"Asking the server…" = "Sunucuya soruluyor…"
"Assets" = "Varlıklar"
@@ -197,7 +198,9 @@ name = "Türkçe"
"C or ⇧C" = "C veya ⇧C"
"CMYK colour" = "CMYK rengi"
"Can view" = "Görüntüleyebilir"
+"Check" = "Onay"
"Checking the server…" = "Sunucu denetleniyor…"
+"Chevron" = "Şerit ok"
"Clear from this list" = "Bu listeden kaldır"
"Code or invite link" = "Kod veya davet bağlantısı"
"Color profile: {name}" = "Renk profili: {name}"
@@ -286,6 +289,7 @@ name = "Türkçe"
"Connected" = "Bağlandı"
"Connected to code: {from}" = "Koda bağlı: {from}"
"Connection lost, reconnecting (attempt {attempt})…" = "Bağlantı koptu, yeniden bağlanılıyor (deneme {attempt})…"
+"Connector" = "Bağlayıcı"
"Constrain proportions" = "Oranları koru"
"Constraints" = "Kısıtlamalar"
"Content" = "İçerik"
@@ -372,6 +376,7 @@ name = "Türkçe"
"Description" = "Açıklama"
"Description (optional)" = "Açıklama (isteğe bağlı)"
"Design" = "Tasarım"
+"Design panel" = "Tasarım paneli"
"Design system starter" = "Tasarım sistemi başlangıç seti"
"Desktop" = "Masaüstü"
"Destination" = "Hedef"
@@ -431,6 +436,7 @@ name = "Türkçe"
"Effect settings" = "Efekt ayarları"
"Effect styles" = "Efekt stilleri"
"Effects" = "Efektler"
+"Elbow" = "Dirsekli"
"Ellipse" = "Elips"
"Ellipses" = "Elipsler"
"Else" = "Değilse"
@@ -566,6 +572,7 @@ name = "Türkçe"
"Hanging list" = "Asılı liste"
"Hanging punctuation" = "Asılı noktalama"
"Hard light" = "Sert ışık"
+"Heart" = "Kalp"
"Height" = "Yükseklik"
"Help" = "Yardım"
"Help and resources" = "Yardım ve kaynaklar"
@@ -578,6 +585,7 @@ name = "Türkçe"
"Hide these tips (Getting started in the Help menu shows them again)" = "Bu ipuçlarını gizle (Yardım menüsündeki Başlarken onları yeniden gösterir)"
"Hide when publishing" = "Yayımlarken gizle"
"Highlight layers on hover" = "Üzerine gelince katmanları vurgula"
+"Highlighter" = "Fosforlu kalem"
"Highlights" = "Açık tonlar"
"Hold Alt" = "Alt tuşunu basılı tutun"
"Hold Alt+Z" = "Alt+Z tuşlarını basılı tutun"
@@ -743,6 +751,7 @@ name = "Türkçe"
"Mark as resolved" = "Çözüldü olarak işaretle"
"Mark as unread" = "Okunmadı olarak işaretle"
"Mark as unresolved" = "Çözülmedi olarak işaretle"
+"Marker" = "Keçeli kalem"
"Mask" = "Maske"
"Mass · Stiffness · Damping" = "Kütle · Sertlik · Sönüm"
"Match (empty: the whole name)" = "Eşleşme (boş: adın tamamı)"
@@ -801,6 +810,7 @@ name = "Türkçe"
"Named instance" = "Adlandırılmış örnek"
"Navigate to" = "Şuraya git"
"Nested instance" = "İç içe örnek"
+"New board" = "Yeni pano"
"New design file" = "Yeni tasarım dosyası"
"Newest first" = "Önce en yeni"
"Next frame" = "Sonraki çerçeve"
@@ -937,6 +947,7 @@ name = "Türkçe"
"Page deleted" = "Sayfa silindi"
"Pages" = "Sayfalar"
"Pages added to the document" = "Sayfalar belgeye eklendi"
+"Pink" = "Pembe"
"Placed on the current page" = "Geçerli sayfaya yerleştirildi"
"Pages: {pages}" = "Sayfalar: {pages}"
"Paint bucket" = "Boya kovası"
@@ -979,6 +990,7 @@ name = "Türkçe"
"Plugins" = "Eklentiler"
"Plus darker" = "Artı koyu"
"Plus lighter" = "Artı açık"
+"Plus one" = "Artı bir"
"Point" = "Nokta"
"Points" = "Noktalar"
"Polygon" = "Çokgen"
@@ -1027,6 +1039,7 @@ name = "Türkçe"
"Push" = "İt"
"Push changes to main component" = "Değişiklikleri ana bileşene gönder"
"Put text on path" = "Metni yola yerleştir"
+"Question" = "Soru"
"R" = "R"
"Radial" = "Dairesel"
"Radius" = "Yarıçap"
@@ -1126,6 +1139,7 @@ name = "Türkçe"
"Rotation jitter" = "Döndürme titreşimi"
"Round" = "Yuvarlak"
"Rounded" = "Yuvarlatılmış"
+"Rounded rectangle" = "Yuvarlatılmış dikdörtgen"
"Row" = "Satır"
"Row gap" = "Satır aralığı"
"Row sizes" = "Satır boyutları"
@@ -1198,6 +1212,7 @@ name = "Türkçe"
"Shape" = "Şekil"
"Shape builder" = "Şekil oluşturucu"
"Shape tools" = "Şekil araçları"
+"Shapes" = "Şekiller"
"Share" = "Paylaş"
"Share this file" = "Bu dosyayı paylaş"
"Share with a code" = "Kodla paylaş"
@@ -1264,10 +1279,13 @@ name = "Türkçe"
"Space+drag" = "Boşluk+sürükle"
"Spacing" = "Aralık"
"Spam, stolen work, abuse…" = "İstenmeyen içerik, çalıntı iş, kötüye kullanım…"
+"Speech bubble" = "Konuşma balonu"
"Splay" = "Açılma"
"Spotlight me" = "Beni öne çıkar"
"Spread" = "Yayılma"
"Square" = "Kare"
+"Stamp" = "Damga"
+"Stamps" = "Damgalar"
"Standard" = "Standart"
"Standard ligatures" = "Standart bitişik harfler"
"Star" = "Yıldız"
@@ -1283,12 +1301,16 @@ name = "Türkçe"
"Starting to share…" = "Paylaşım başlatılıyor…"
"Status" = "Durum"
"Sticky" = "Yapışkan"
+"Sticky note" = "Yapışkan not"
+"Sticky note colors" = "Yapışkan not renkleri"
+"Sticky notes, shapes and connectors" = "Yapışkan notlar, şekiller ve bağlayıcılar"
"Stop" = "Durdur"
"Stop following {name}" = "{name} takibini bırak"
"Stop session" = "Oturumu durdur"
"Stop sharing" = "Paylaşmayı durdur"
"Stop spotlighting" = "Öne çıkarmayı durdur"
"Stop {n} {hex}" = "Durak {n} {hex}"
+"Straight" = "Düz"
"Stretch" = "Uzat"
"Strikethrough" = "Üstü çizili"
"String" = "Metin"
@@ -1333,6 +1355,7 @@ name = "Türkçe"
"Text" = "Metin"
"Text align" = "Metin hizalaması"
"Text content" = "Metin içeriği"
+"Text size" = "Metin boyutu"
"Text style" = "Metin stili"
"Text styles" = "Metin stilleri"
"Texts" = "Metinler"
@@ -1363,6 +1386,7 @@ name = "Türkçe"
"This server is open to the public: no key needed." = "Bu sunucu herkese açık: anahtar gerekmez."
"This server needs its key: add ?key=… to the address (`figcraft-server key` prints it on the server's machine)." = "Bu sunucu anahtarını istiyor: adrese ?key=… ekleyin (`figcraft-server key` anahtarı sunucunun makinesinde yazdırır)."
"This server takes files only with its key: see Advanced." = "Bu sunucu dosyaları yalnızca anahtarıyla kabul ediyor: Gelişmiş'e bakın."
+"Thumbs up" = "Başparmak yukarı"
"Tidy up" = "Toparla"
"Tile" = "Döşe"
"Tile type" = "Döşeme türü"
@@ -1379,6 +1403,7 @@ name = "Türkçe"
"Top left radius" = "Sol üst yarıçap"
"Top right radius" = "Sağ üst yarıçap"
"Transform" = "Dönüştür"
+"Triangle" = "Üçgen"
"Triangle arrow" = "Üçgen ok"
"Trigger" = "Tetikleyici"
"True" = "Doğru"
@@ -1733,6 +1758,15 @@ name = "Türkçe"
"arrange.roundToPixels" = "Piksellere yuvarla"
"arrange.spacing" = "Aralık"
"arrange.tidy" = "Toparla"
+"board.connector" = "Bağlayıcı"
+"board.ink" = "Keçeli kalem çizgisi"
+"board.label" = "Bağlayıcı etiketi"
+"board.nextSticky" = "Sonraki yapışkan not"
+"board.setColor" = "Pano rengi"
+"board.setStyle" = "Pano stili"
+"board.shape" = "Metinli şekil"
+"board.stamp" = "Damga"
+"board.sticky" = "Yapışkan not"
"bool.exclude" = "Seçimi hariç tut"
"bool.flatten" = "Boolean'ı düzleştir"
"bool.intersect" = "Seçimi kesiştir"
@@ -1858,6 +1892,7 @@ name = "Türkçe"
"file.import" = "İçe aktar"
"file.moveTab" = "Sekmeyi taşı"
"file.new" = "Yeni tasarım dosyası"
+"file.newBoard" = "Yeni pano"
"file.newFromTemplate" = "Şablondan yeni"
"file.open" = "Aç"
"file.openRecent" = "Son kullanılanı aç"
@@ -2124,10 +2159,14 @@ name = "Türkçe"
"text.weightUp" = "Yazı tipi kalınlığını artır"
"tool.arrow" = "Ok"
"tool.comment" = "Yorum"
+"tool.connector" = "Bağlayıcı"
"tool.ellipse" = "Elips"
+"tool.eraser" = "Silgi"
"tool.frame" = "Çerçeve"
"tool.hand" = "El"
+"tool.highlighter" = "Fosforlu kalem"
"tool.line" = "Çizgi"
+"tool.marker" = "Keçeli kalem"
"tool.move" = "Taşı"
"tool.pen" = "Kalem"
"tool.pencil" = "Kurşun kalem"
@@ -2139,9 +2178,12 @@ name = "Türkçe"
"tool.scaleAnchor" = "Ölçekleme bağlantı noktası"
"tool.section" = "Bölüm"
"tool.set" = "Araç seç"
+"tool.shape" = "Şekiller"
"tool.shapeBuilder" = "Şekil oluşturucu"
"tool.slice" = "Dilim"
+"tool.stamp" = "Damga"
"tool.star" = "Yıldız"
+"tool.sticky" = "Yapışkan not"
"tool.text" = "Metin"
"transform.move" = "Taşı"
"transform.moveTo" = "Şuraya taşı"
diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml
index 94c91942..3d56e7a3 100644
--- a/crates/ui-egui/locales/zh-Hans.toml
+++ b/crates/ui-egui/locales/zh-Hans.toml
@@ -119,6 +119,7 @@ status = "draft — needs native review"
"Archived" = "已归档"
"Arrange" = "排列"
"Arrow" = "箭头"
+"Arrow at the end" = "末端箭头"
"As typed" = "原样"
"Asking the server…" = "正在询问服务器…"
"Assets" = "资源"
@@ -190,7 +191,9 @@ status = "draft — needs native review"
"C or ⇧C" = "C 或 ⇧C"
"CMYK colour" = "CMYK 颜色"
"Can view" = "可查看"
+"Check" = "对勾"
"Checking the server…" = "正在检查服务器…"
+"Chevron" = "箭头形"
"Clear from this list" = "从此列表中清除"
"Code or invite link" = "代码或邀请链接"
"Color profile: {name}" = "颜色配置文件:{name}"
@@ -263,6 +266,7 @@ status = "draft — needs native review"
"Commits" = "提交"
"Company" = "公司"
"Compare changes" = "比较更改"
+"Compare with" = "比较对象"
"Compatibility notes" = "兼容性说明"
"Completed" = "已完成"
"Component" = "组件"
@@ -278,6 +282,7 @@ status = "draft — needs native review"
"Connected" = "已连接"
"Connected to code: {from}" = "已关联代码:{from}"
"Connection lost, reconnecting (attempt {attempt})…" = "连接已断开,正在重新连接(第 {attempt} 次尝试)…"
+"Connector" = "连接线"
"Constrain proportions" = "锁定比例"
"Constraints" = "约束"
"Content" = "内容"
@@ -361,6 +366,7 @@ status = "draft — needs native review"
"Description" = "描述"
"Description (optional)" = "描述(可选)"
"Design" = "设计"
+"Design panel" = "设计面板"
"Desktop" = "桌面"
"Destination" = "目标"
"Detach alias" = "分离别名"
@@ -371,6 +377,7 @@ status = "draft — needs native review"
"Detach variable" = "分离变量"
"Details" = "详细"
"Dev Mode" = "开发模式"
+"Dev Mode only inspects: switch to Design (Shift+D) to edit" = "开发模式仅用于检查:切换到设计 (Shift+D) 进行编辑"
"Dev resources" = "开发资源"
"Development" = "开发"
"Device" = "设备"
@@ -417,6 +424,7 @@ status = "draft — needs native review"
"Effect settings" = "效果设置"
"Effect styles" = "效果样式"
"Effects" = "效果"
+"Elbow" = "折线"
"Ellipse" = "椭圆"
"Ellipses" = "椭圆"
"Else" = "否则"
@@ -547,6 +555,7 @@ status = "draft — needs native review"
"Hanging list" = "悬挂列表"
"Hanging punctuation" = "标点悬挂"
"Hard light" = "强光"
+"Heart" = "爱心"
"Height" = "高度"
"Help" = "帮助"
"Help and resources" = "帮助和资源"
@@ -557,6 +566,7 @@ status = "draft — needs native review"
"Hide from publishing" = "发布时隐藏"
"Hide section contents" = "隐藏分区内容"
"Highlight layers on hover" = "悬停时高亮图层"
+"Highlighter" = "荧光笔"
"Highlights" = "高光"
"Hold Alt" = "按住 Alt"
"Hold Alt+Z" = "按住 Alt+Z"
@@ -712,6 +722,7 @@ status = "draft — needs native review"
"Mark as resolved" = "标为已解决"
"Mark as unread" = "标为未读"
"Mark as unresolved" = "标为未解决"
+"Marker" = "马克笔"
"Mask" = "蒙版"
"Mass · Stiffness · Damping" = "质量 · 刚度 · 阻尼"
"Match (empty: the whole name)" = "匹配(留空:整个名称)"
@@ -768,6 +779,7 @@ status = "draft — needs native review"
"Named instance" = "具名实例"
"Navigate to" = "导航到"
"Nested instance" = "嵌套实例"
+"New board" = "新建白板"
"New design file" = "新建设计文件"
"Next frame" = "下一个画框"
"Next or previous control in the focused region" = "聚焦区域中的下一个或上一个控件"
@@ -830,6 +842,7 @@ status = "draft — needs native review"
"Not read yet" = "尚未读取"
"Not shared" = "未分享"
"Note {n}" = "备注 {n}"
+"Nothing changed since this version." = "自此版本以来没有任何更改。"
"Nothing changed since this was marked ready for dev." = "自标记为可供开发以来没有任何更改。"
"Nothing here yet. Set a frame's status to list it." = "这里还没有内容。设置画框的状态即可将其列出。"
"Nothing online yet. Use Share on a file to put it online and it is listed here." = "还没有在线文件。对文件使用“分享”将其放到网上后,它会列在这里。"
@@ -897,6 +910,7 @@ status = "draft — needs native review"
"Page deleted" = "页面已删除"
"Pages" = "页面"
"Pages added to the document" = "页面已添加到文档"
+"Pink" = "粉色"
"Placed on the current page" = "已放置在当前页面"
"Pages: {pages}" = "页面:{pages}"
"Paint bucket" = "油漆桶"
@@ -938,6 +952,7 @@ status = "draft — needs native review"
"Plugins run in FigCraft's sandbox, without files, network or clock. Install only plugins you trust." = "插件在 FigCraft 的沙盒中运行,无法使用文件、网络或时钟。请只安装你信任的插件。"
"Plus darker" = "加深"
"Plus lighter" = "增亮"
+"Plus one" = "加一"
"Point" = "点"
"Points" = "点数"
"Polygon" = "多边形"
@@ -984,6 +999,7 @@ status = "draft — needs native review"
"Push" = "推入"
"Push changes to main component" = "将更改推送到主组件"
"Put text on path" = "将文本放到路径上"
+"Question" = "问号"
"R" = "R"
"Radial" = "径向"
"Radius" = "半径"
@@ -1028,6 +1044,7 @@ status = "draft — needs native review"
"Removed" = "已删除"
"Removed from the server" = "已从服务器移除"
"Removed since it was marked" = "标记后已删除"
+"Removed since this version" = "自此版本以来已移除"
"Rename" = "重命名"
"Rename duplicated layers" = "重命名副本图层"
"Rename folder" = "重命名文件夹"
@@ -1083,6 +1100,7 @@ status = "draft — needs native review"
"Rotation jitter" = "旋转抖动"
"Round" = "圆形"
"Rounded" = "圆润"
+"Rounded rectangle" = "圆角矩形"
"Row" = "行"
"Row gap" = "行间距"
"Row sizes" = "行高"
@@ -1152,6 +1170,7 @@ status = "draft — needs native review"
"Shape" = "形状"
"Shape builder" = "形状生成器"
"Shape tools" = "形状工具"
+"Shapes" = "形状"
"Share" = "分享"
"Share this file" = "分享此文件"
"Share: live session, export" = "分享:实时会话、导出"
@@ -1209,10 +1228,13 @@ status = "draft — needs native review"
"Space+drag" = "空格+拖动"
"Spacing" = "间距"
"Spam, stolen work, abuse…" = "垃圾信息、盗用作品、滥用…"
+"Speech bubble" = "对话气泡"
"Splay" = "张开"
"Spotlight me" = "聚焦于我"
"Spread" = "扩展"
"Square" = "方形"
+"Stamp" = "印章"
+"Stamps" = "印章"
"Standard" = "标准"
"Standard ligatures" = "标准连字"
"Star" = "星形"
@@ -1227,12 +1249,16 @@ status = "draft — needs native review"
"Starting to share…" = "正在开始分享…"
"Status" = "状态"
"Sticky" = "粘性"
+"Sticky note" = "便利贴"
+"Sticky note colors" = "便利贴颜色"
+"Sticky notes, shapes and connectors" = "便利贴、形状和连接线"
"Stop" = "停止"
"Stop following {name}" = "停止跟随 {name}"
"Stop session" = "停止会话"
"Stop sharing" = "停止分享"
"Stop spotlighting" = "停止聚焦"
"Stop {n} {hex}" = "色标 {n} {hex}"
+"Straight" = "直线"
"Stretch" = "拉伸"
"Strikethrough" = "删除线"
"String" = "字符串"
@@ -1276,6 +1302,7 @@ status = "draft — needs native review"
"Text" = "文本"
"Text align" = "文本对齐"
"Text content" = "文本内容"
+"Text size" = "文字大小"
"Text style" = "文本样式"
"Text styles" = "文本样式"
"Texts" = "文本"
@@ -1306,6 +1333,9 @@ status = "draft — needs native review"
"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." = "此服务器只接受带密钥的文件:请查看“高级”。"
+"Thumbs up" = "点赞"
+"This version can't be read." = "无法读取此版本。"
+"This version doesn't have it: all of it is new." = "此版本中没有它:全部是新的。"
"Tidy up" = "整理"
"Tile" = "平铺"
"Tile type" = "平铺类型"
@@ -1322,6 +1352,7 @@ status = "draft — needs native review"
"Top left radius" = "左上圆角"
"Top right radius" = "右上圆角"
"Transform" = "变换"
+"Triangle" = "三角形"
"Triangle arrow" = "三角箭头"
"Trigger" = "触发器"
"True" = "真"
@@ -1407,10 +1438,12 @@ status = "draft — needs native review"
"WebSocket URL copied" = "已复制 WebSocket URL"
"Wedge" = "楔形"
"Weight" = "粗细"
+"What changed since a saved version" = "自已保存版本以来的更改"
"What changed since it was marked ready for dev" = "自标记为可供开发以来的更改"
"What is wrong with this file? The server's operator gets your report." = "此文件有什么问题?你的举报会发送给服务器的运营者。"
"What it's for" = "用途"
"What this changed from isn't known: it changed before FigCraft kept a copy of ready-for-dev frames. Resolve the change (or mark it ready again) to compare from now on." = "无法得知更改前的状态:它在 FigCraft 开始保存可供开发画框的副本之前就已更改。请解决此更改(或重新标记为可供开发),以便今后进行比较。"
+"When marked ready" = "标记为就绪时"
"While hovering" = "悬停时"
"While pressing" = "按住时"
"White" = "白"
@@ -1669,6 +1702,15 @@ status = "draft — needs native review"
"arrange.roundToPixels" = "取整到像素"
"arrange.spacing" = "间距"
"arrange.tidy" = "整理"
+"board.connector" = "连接线"
+"board.ink" = "马克笔笔画"
+"board.label" = "连接线标签"
+"board.nextSticky" = "下一张便利贴"
+"board.setColor" = "白板颜色"
+"board.setStyle" = "白板样式"
+"board.shape" = "带文字的形状"
+"board.stamp" = "印章"
+"board.sticky" = "便利贴"
"bool.exclude" = "排除所选项"
"bool.flatten" = "拼合布尔组"
"bool.intersect" = "所选项相交"
@@ -1793,6 +1835,7 @@ status = "draft — needs native review"
"file.import" = "导入"
"file.moveTab" = "移动标签页"
"file.new" = "新建设计文件"
+"file.newBoard" = "新建白板"
"file.open" = "打开"
"file.openRecent" = "打开最近的文件"
"file.placeImage" = "置入图片"
@@ -2056,10 +2099,14 @@ status = "draft — needs native review"
"text.weightUp" = "增大字重"
"tool.arrow" = "箭头"
"tool.comment" = "评论"
+"tool.connector" = "连接线"
"tool.ellipse" = "椭圆"
+"tool.eraser" = "橡皮擦"
"tool.frame" = "画框"
"tool.hand" = "抓手"
+"tool.highlighter" = "荧光笔"
"tool.line" = "直线"
+"tool.marker" = "马克笔"
"tool.move" = "移动"
"tool.pen" = "钢笔"
"tool.pencil" = "铅笔"
@@ -2071,9 +2118,12 @@ status = "draft — needs native review"
"tool.scaleAnchor" = "缩放锚点"
"tool.section" = "分区"
"tool.set" = "选择工具"
+"tool.shape" = "形状"
"tool.shapeBuilder" = "形状生成器"
"tool.slice" = "切片"
+"tool.stamp" = "印章"
"tool.star" = "星形"
+"tool.sticky" = "便利贴"
"tool.text" = "文本"
"transform.move" = "移动"
"transform.moveTo" = "移动到"
diff --git a/crates/ui-egui/src/board_bar.rs b/crates/ui-egui/src/board_bar.rs
new file mode 100644
index 00000000..c312ddb9
--- /dev/null
+++ b/crates/ui-egui/src/board_bar.rs
@@ -0,0 +1,294 @@
+//! Boards in the UI: the small bar floating over a board's selection (colour, shape, text size,
+//! connector style; boards hide the Design panel until asked for), and the swatches it and the
+//! board tools' flyouts share.
+
+use egui::{Color32, CornerRadius, Pos2, Rect, Sense, Stroke, StrokeKind, Ui, pos2, vec2};
+use figcraft_doc::{BOARD_COLORS, BoardItem, BoardShape, NodeKind, Routing, Stamp, StrokeCap};
+use figcraft_engine::board::{BoardTool, TEXT_SIZES};
+use serde_json::{Value, json};
+
+use crate::FigApp;
+use crate::a11y;
+use crate::i18n::{tr, tr_noop};
+use crate::icons::{self, Icon};
+use crate::theme::{Tokens, semibold};
+use crate::toolbar::Options;
+
+/// What a swatch shows.
+pub(crate) enum Mark {
+ Color(figcraft_color::Color),
+ Shape(BoardShape),
+ Stamp(Stamp),
+}
+
+/// One choice of a board tool's flyout: its name, the tool's params, whether it is the tool's now.
+pub(crate) struct Choice {
+ pub label: &'static str,
+ pub params: Value,
+ pub on: bool,
+ pub mark: Mark,
+}
+
+/// The choices a board tool's flyout offers.
+pub(crate) fn choices(options: Options, board: &BoardTool) -> Vec {
+ match options {
+ Options::Colors => BOARD_COLORS
+ .iter()
+ .map(|(n, c)| Choice { label: color_label(n), params: json!({"color": n}), on: board.sticky == *c, mark: Mark::Color(*c) })
+ .collect(),
+ Options::Shapes => BoardShape::ALL
+ .iter()
+ .map(|b| Choice { label: b.label(), params: json!({"shape": b.id()}), on: board.shape == *b, mark: Mark::Shape(*b) })
+ .collect(),
+ Options::Stamps => Stamp::ALL
+ .iter()
+ .map(|b| Choice { label: b.label(), params: json!({"stamp": b.id()}), on: board.stamp == *b, mark: Mark::Stamp(*b) })
+ .collect(),
+ Options::None => Vec::new(),
+ }
+}
+
+/// A board colour's name as the UI says it.
+fn color_label(name: &str) -> &'static str {
+ match name {
+ "yellow" => tr_noop("Yellow"),
+ "orange" => tr_noop("Orange"),
+ "red" => tr_noop("Red"),
+ "pink" => tr_noop("Pink"),
+ "violet" => tr_noop("Violet"),
+ "blue" => tr_noop("Blue"),
+ "green" => tr_noop("Green"),
+ _ => tr_noop("Gray"),
+ }
+}
+
+/// Paint `mark` in `r`: a colour chip, a shape's outline in `ink`, or a stamp badge.
+pub(crate) fn paint_choice(p: &egui::Painter, r: Rect, mark: &Mark, ink: Color32) {
+ match mark {
+ Mark::Color(c) => {
+ p.rect_filled(r, CornerRadius::same(4), c32(*c));
+ p.rect_stroke(r, CornerRadius::same(4), Stroke::new(1.0, Color32::from_black_alpha(40)), StrokeKind::Inside);
+ }
+ Mark::Shape(s) => {
+ let path = s.path(14.0, 14.0);
+ let path = figcraft_geom::Affine::translate((1.0, 1.0)) * path;
+ icons::paint_outlines(p, r, 16.0, &[(&path, false)], ink, 1.2);
+ }
+ Mark::Stamp(s) => {
+ p.circle_filled(r.center(), r.width().min(r.height()) / 2.0, c32(s.color()));
+ let parts: Vec<(figcraft_geom::BezPath, bool)> =
+ s.mark().iter().filter_map(|m| figcraft_geom::BezPath::from_svg(m.d).ok().map(|b| (b, m.filled))).collect();
+ let refs: Vec<(&figcraft_geom::BezPath, bool)> = parts.iter().map(|(b, f)| (b, *f)).collect();
+ icons::paint_outlines(p, r, figcraft_doc::STAMP_SIZE, &refs, Color32::WHITE, 3.0);
+ }
+ }
+}
+
+fn c32(c: figcraft_color::Color) -> Color32 {
+ let [r, g, b, a] = c.to_rgba8();
+ Color32::from_rgba_unmultiplied(r, g, b, a)
+}
+
+/// What the selection has that the bar can change.
+#[derive(Default)]
+struct Has {
+ color: bool,
+ shape: Option,
+ text: bool,
+ connector: Option<(Routing, bool)>,
+}
+
+/// What the selected board objects take from the bar (layers that aren't board objects, a section
+/// say, are left out); `None` when none takes anything.
+fn has(app: &FigApp) -> Option {
+ let ds = app.session.ds().ok()?;
+ let mut h = Has::default();
+ for n in ds.selection.iter().filter_map(|id| ds.doc.node(*id)) {
+ match &n.board {
+ Some(BoardItem::Sticky { .. } | BoardItem::Ink) => h.color = true,
+ Some(BoardItem::Shape { shape }) => {
+ h.color = true;
+ h.text = true;
+ h.shape = Some(*shape);
+ }
+ Some(BoardItem::Connector(c)) => {
+ h.color = true;
+ h.connector = Some((c.routing, n.stroke.cap_end != StrokeCap::None));
+ }
+ Some(BoardItem::Label { .. }) => h.text = true,
+ Some(BoardItem::Stamp { .. }) | None => {}
+ }
+ }
+ (h.color || h.text || h.connector.is_some()).then_some(h)
+}
+
+const CELL: f32 = 28.0;
+const SWATCH: f32 = 20.0;
+const GAP: f32 = 4.0;
+/// The room each part takes after its controls (the divider and the gap around it).
+const PART_END: f32 = 8.0;
+
+impl Has {
+ /// The bar's width for these parts.
+ fn width(&self) -> f32 {
+ let mut w = 8.0;
+ if self.color {
+ w += BOARD_COLORS.len() as f32 * (SWATCH + GAP) + PART_END;
+ }
+ if self.shape.is_some() {
+ w += CELL + 12.0 + GAP + PART_END;
+ }
+ if self.text {
+ w += TEXT_SIZES.len() as f32 * (CELL + 2.0) + PART_END;
+ }
+ if self.connector.is_some() {
+ w += 3.0 * (CELL + 2.0) + PART_END;
+ }
+ w
+ }
+}
+
+/// Where a bar `size` big goes for the selection's screen box `sel`: centred above it, below it
+/// when there is no room above, inside the canvas.
+pub(crate) fn place(sel: Rect, size: egui::Vec2, canvas: Rect) -> Pos2 {
+ let w = size.x;
+ let cx = sel.center().x.clamp(canvas.min.x + w / 2.0 + 8.0, (canvas.max.x - w / 2.0 - 8.0).max(canvas.min.x + w / 2.0 + 8.0));
+ let above = sel.min.y - 14.0 - size.y;
+ let y = if above > canvas.min.y + 8.0 { above } else { (sel.max.y + 14.0).min(canvas.max.y - size.y - 80.0) };
+ pos2(cx - w / 2.0, y)
+}
+
+/// The bar above a board's selection, while nothing is being dragged and the file can be edited.
+pub fn show(app: &mut FigApp, ctx: &egui::Context) {
+ let editable = app.session.active_read_only().is_none();
+ if app.session.tool.busy() || !editable || !app.session.doc().is_ok_and(figcraft_engine::board::is_board) {
+ return;
+ }
+ let Some(h) = has(app) else { return };
+ let Some(b) = app.session.ds().ok().and_then(|ds| ds.doc.bounds_of(&ds.selection)) else { return };
+ let sel = Rect::from_two_pos(app.to_screen(b.x0, b.y0), app.to_screen(b.x1, b.y1));
+ let size = vec2(h.width(), 40.0);
+ let at = place(sel, size, app.canvas.rect);
+ let t = Tokens::get(ctx);
+ egui::Area::new(egui::Id::new("board_bar")).fixed_pos(at).order(egui::Order::Middle).show(ctx, |ui| {
+ let (rect, _) = ui.allocate_exact_size(size, Sense::click());
+ a11y::container_bounds(ui, rect);
+ let p = ui.painter();
+ p.rect_filled(rect.expand(2.0).translate(vec2(0.0, 1.0)), CornerRadius::same(12), Color32::from_black_alpha(18));
+ p.rect_filled(rect, CornerRadius::same(10), t.panel);
+ p.rect_stroke(rect, CornerRadius::same(10), Stroke::new(1.0, t.border), StrokeKind::Inside);
+ let cy = rect.center().y;
+ let mut x = rect.min.x + 8.0;
+ if h.color {
+ x = color_part(app, ui, x, cy, &t);
+ }
+ if let Some(shape) = h.shape {
+ x = shape_part(app, ui, shape, pos2(x, cy), &t);
+ }
+ if h.text {
+ x = size_part(app, ui, x, cy, &t);
+ }
+ if let Some((routing, arrow)) = h.connector {
+ line_part(app, ui, (routing, arrow), pos2(x, cy), &t);
+ }
+ });
+}
+
+/// The board colours from `x` (`board.setColor`); where the next part starts.
+fn color_part(app: &mut FigApp, ui: &mut Ui, mut x: f32, cy: f32, t: &Tokens) -> f32 {
+ for (i, (name, c)) in BOARD_COLORS.iter().enumerate() {
+ let r = Rect::from_center_size(pos2(x + SWATCH / 2.0, cy), vec2(SWATCH, SWATCH));
+ let resp = ui.interact(r, ui.id().with(("bb_color", i)), Sense::click()).on_hover_text(tr(color_label(name)));
+ a11y::button(&resp, tr(color_label(name)));
+ if resp.hovered() {
+ ui.painter().rect_filled(r.expand(2.0), CornerRadius::same(6), t.hover);
+ }
+ paint_choice(ui.painter(), r, &Mark::Color(*c), t.icon);
+ if resp.clicked() {
+ app.run("board.setColor", json!({"color": name}));
+ }
+ x += SWATCH + GAP;
+ }
+ divider(ui, t, x, cy)
+}
+
+/// The shape menu at `at` (its left edge and middle), showing `shape`; where the next part starts.
+fn shape_part(app: &mut FigApp, ui: &mut Ui, shape: BoardShape, at: Pos2, t: &Tokens) -> f32 {
+ let r = Rect::from_min_size(pos2(at.x, at.y - CELL / 2.0), vec2(CELL + 12.0, CELL));
+ let resp = ui.interact(r, ui.id().with("bb_shape"), Sense::click()).on_hover_text(tr("Shape"));
+ a11y::menu_button(&resp, tr("Shape"), a11y::menu_open(&resp));
+ if resp.hovered() {
+ ui.painter().rect_filled(r, CornerRadius::same(5), t.hover);
+ }
+ paint_choice(ui.painter(), Rect::from_center_size(pos2(r.min.x + CELL / 2.0, at.y), vec2(18.0, 18.0)), &Mark::Shape(shape), t.icon);
+ icons::paint(ui.painter(), Rect::from_center_size(pos2(r.max.x - 7.0, at.y), vec2(12.0, 12.0)), Icon::Chevron, t.icon_secondary);
+ crate::right::menu_popup(&resp).show(|ui| {
+ for b in BoardShape::ALL {
+ let art = |p: &egui::Painter, row: Rect, ink: Color32| {
+ paint_choice(p, Rect::from_center_size(pos2(row.max.x - 16.0, row.center().y), vec2(16.0, 16.0)), &Mark::Shape(b), ink)
+ };
+ if crate::right::menu_item_with(ui, tr(b.label()), "", 24.0, art) {
+ app.run("board.setStyle", json!({"shape": b.id()}));
+ ui.close();
+ }
+ }
+ });
+ divider(ui, t, at.x + CELL + 12.0 + GAP, at.y)
+}
+
+/// The text sizes from `x` (`board.setStyle {fontSize}`); where the next part starts.
+fn size_part(app: &mut FigApp, ui: &mut Ui, mut x: f32, cy: f32, t: &Tokens) -> f32 {
+ for (label, size) in TEXT_SIZES {
+ let r = Rect::from_center_size(pos2(x + CELL / 2.0, cy), vec2(CELL, CELL));
+ let resp = ui.interact(r, ui.id().with(("bb_size", label)), Sense::click()).on_hover_text(tr("Text size"));
+ a11y::button(&resp, &format!("{} {label}", tr("Text size")));
+ if resp.hovered() {
+ ui.painter().rect_filled(r, CornerRadius::same(5), t.hover);
+ }
+ ui.painter().text(r.center(), egui::Align2::CENTER_CENTER, label, semibold(11.0), t.text);
+ if resp.clicked() {
+ app.run("board.setStyle", json!({"fontSize": size}));
+ }
+ x += CELL + 2.0;
+ }
+ divider(ui, t, x, cy)
+}
+
+/// A connector's routing (straight, elbow) and end arrow at `at`, as they are now (`line`).
+fn line_part(app: &mut FigApp, ui: &mut Ui, line: (Routing, bool), at: Pos2, t: &Tokens) {
+ let (routing, arrow) = line;
+ let cells = [
+ (Icon::Line, tr("Straight"), routing == Routing::Straight, json!({"style": "straight"})),
+ (Icon::Connector, tr("Elbow"), routing == Routing::Elbow, json!({"style": "elbow"})),
+ (Icon::Arrow, tr("Arrow at the end"), arrow, json!({"endCap": if arrow { "none" } else { "triangleArrow" }})),
+ ];
+ let mut x = at.x;
+ for (i, (icon, tip, on, params)) in cells.into_iter().enumerate() {
+ let r = Rect::from_center_size(pos2(x + CELL / 2.0, at.y), vec2(CELL, CELL));
+ if crate::toolbar::tool_cell(ui, t, r, ("bb_line", i), icon, on, tip).clicked() {
+ app.run("board.setStyle", params);
+ }
+ x += CELL + 2.0;
+ }
+}
+
+/// A thin separator after `x`; where the next part starts.
+fn divider(ui: &Ui, t: &Tokens, x: f32, cy: f32) -> f32 {
+ ui.painter().line_segment([pos2(x + 2.0, cy - 10.0), pos2(x + 2.0, cy + 10.0)], Stroke::new(1.0, t.border));
+ x + 8.0
+}
+
+/// The name of the person who placed the stamp under the pointer, beside it.
+pub fn stamp_author(app: &FigApp, painter: &egui::Painter, pointer: Option) {
+ let (Some(at), Ok(ds)) = (pointer, app.session.ds()) else { return };
+ let Some(n) = ds.hover.and_then(|h| ds.doc.node(h)) else { return };
+ let Some(BoardItem::Stamp { author, .. }) = &n.board else { return };
+ if author.is_empty() || !matches!(n.kind, NodeKind::Frame) {
+ return;
+ }
+ let t = Tokens::get(painter.ctx());
+ let galley = painter.layout_no_wrap(author.clone(), semibold(11.0), t.text);
+ let r = Rect::from_min_size(at + vec2(14.0, 14.0), galley.size() + vec2(12.0, 6.0));
+ painter.rect_filled(r, CornerRadius::same(4), t.menu);
+ painter.galley(r.min + vec2(6.0, 3.0), galley, t.menu_text);
+}
diff --git a/crates/ui-egui/src/board_ui_tests.rs b/crates/ui-egui/src/board_ui_tests.rs
new file mode 100644
index 00000000..4ffb3cf4
--- /dev/null
+++ b/crates/ui-egui/src/board_ui_tests.rs
@@ -0,0 +1,212 @@
+//! Boards in the UI, drawn headless: the board toolbar (its flyouts pick a tool with a colour, a
+//! shape or a stamp; the Design panel's button), the right panel hidden until asked for, the bar
+//! over the selection (colours, shapes, text sizes, connector style, also with layers that aren't
+//! board objects selected, never on a file you can only view), the home screen's New board card,
+//! and the marks design files and boards get.
+
+use egui::{Event, Modifiers, PointerButton, Pos2, Rect, pos2};
+use figcraft_doc::{BoardItem, BoardShape, FileKind, NodeId, Routing, Stamp, StrokeCap, board_color};
+use figcraft_engine::Session;
+use figcraft_engine::tools::ToolId;
+use serde_json::{Value, json};
+
+use crate::layers_drag_tests::Ui;
+use crate::live_tests::{flat, has_text, text_center};
+
+fn click(u: &mut Ui, p: Pos2) {
+ for pressed in [true, false] {
+ u.frame(vec![Event::PointerMoved(p), Event::PointerButton { pos: p, button: PointerButton::Primary, pressed, modifiers: Modifiers::NONE }]);
+ }
+ u.frame(vec![]);
+}
+
+fn id(v: &Value) -> NodeId {
+ NodeId(v["id"].as_u64().unwrap())
+}
+
+/// The app on a new board.
+fn board() -> Ui {
+ let mut s = Session::new();
+ s.execute("file.newBoard", &json!({})).unwrap();
+ let mut u = Ui::new(s);
+ u.frame(vec![]);
+ u
+}
+
+/// The board toolbar pill on screen.
+fn pill(u: &Ui) -> Rect {
+ crate::toolbar::pill_rect(u.app.canvas.rect, crate::toolbar::bar_width(&u.app))
+}
+
+/// The left edge of board toolbar group `i` (button 32 wide, a 10-wide caret after the groups with
+/// flyouts, 4 between): move, ink, sticky, shapes, connector, text, section, stamp, comment.
+fn group_x(u: &Ui, i: usize) -> f32 {
+ const WIDTHS: [f32; 9] = [46.0, 46.0, 46.0, 46.0, 36.0, 36.0, 36.0, 46.0, 36.0];
+ pill(u).min.x + 8.0 + WIDTHS.iter().take(i).sum::()
+}
+
+/// Open group `i`'s flyout from its caret and click option `n` in it (a row of 32-wide cells, 4
+/// apart, 8 in from the flyout's edge, the flyout's bottom 8 above the pill).
+fn pick_option(u: &mut Ui, i: usize, n: usize) {
+ let caret = pos2(group_x(u, i) + 37.0, pill(u).center().y);
+ click(u, caret);
+ let at = pos2(group_x(u, i) + 8.0 + n as f32 * 36.0 + 16.0, pill(u).min.y - 8.0 - 24.0);
+ click(u, at);
+}
+
+/// Whether the bar over the selection showed in the last frame.
+fn bar_shown(ctx: &egui::Context) -> bool {
+ ctx.memory(|m| m.areas().visible_last_frame(&egui::LayerId::new(egui::Order::Middle, egui::Id::new("board_bar"))))
+}
+
+/// The bar over the selection, when it shows.
+fn bar(u: &Ui) -> Option {
+ bar_shown(&u.ctx).then(|| u.ctx.memory(|m| m.area_rect(egui::Id::new("board_bar")))).flatten()
+}
+
+#[test]
+fn the_board_toolbar_picks_tools_with_their_colours_shapes_and_stamps() {
+ let mut u = board();
+ pick_option(&mut u, 2, 5);
+ assert_eq!(u.app.session.tool.tool, ToolId::Sticky);
+ assert_eq!(Some(u.app.session.tool.board.sticky), board_color("blue"));
+ pick_option(&mut u, 3, 3);
+ assert_eq!((u.app.session.tool.tool, u.app.session.tool.board.shape), (ToolId::BoardShape, BoardShape::Diamond));
+ pick_option(&mut u, 7, 1);
+ assert_eq!((u.app.session.tool.tool, u.app.session.tool.board.stamp), (ToolId::Stamp, Stamp::Heart));
+ // The connector's button picks it; the ink group's flyout lists the marker's siblings.
+ let connector = pos2(group_x(&u, 4) + 16.0, pill(&u).center().y);
+ click(&mut u, connector);
+ assert_eq!(u.app.session.tool.tool, ToolId::Connector);
+ let ink_caret = pos2(group_x(&u, 1) + 37.0, pill(&u).center().y);
+ click(&mut u, ink_caret);
+ assert_eq!(u.app.ui.tool_flyout, Some("ink"));
+}
+
+#[test]
+fn a_boards_design_panel_opens_when_asked_for_and_prototyping_is_not_offered() {
+ let mut u = board();
+ u.app.ui.right_tab = crate::RightTab::Prototype;
+ u.frame(vec![]);
+ assert_eq!(u.app.ui.right_tab, crate::RightTab::Design, "boards have no Prototype tab");
+ let canvas = u.app.canvas.rect;
+ assert!(canvas.max.x > 1400.0, "no right panel: the canvas reaches the window's edge ({canvas:?})");
+ // The Design panel's button at the pill's right end.
+ let p = pill(&u);
+ click(&mut u, pos2(p.max.x - 8.0 - 16.0, p.center().y));
+ assert!(u.app.ui.board_panel);
+ u.frame(vec![]);
+ assert!(u.app.canvas.rect.max.x < canvas.max.x - 200.0, "the panel takes its room");
+ // On a design file the panel shows whatever was asked for a board.
+ u.app.run("file.new", json!({}));
+ u.app.run("view.design", json!({}));
+ u.frame(vec![]);
+ assert!(u.app.ui.board_panel, "view.design on a design file doesn't toggle the board's panel");
+}
+
+#[test]
+fn the_selection_bar_recolours_reshapes_and_restyles() {
+ let mut u = board();
+ let shape = id(&u.app.session.execute("board.shape", &json!({"x": 0, "y": 0, "shape": "rectangle", "text": "Hi"})).unwrap());
+ let section = id(&u.app.session.execute("node.create", &json!({"type": "section", "x": 0, "y": 400, "width": 200, "height": 200})).unwrap());
+ // A section selected with it (no board object) leaves the bar for the shape.
+ u.app.session.execute("select.set", &json!({"ids": [shape, section]})).unwrap();
+ u.frame(vec![]);
+ u.frame(vec![]);
+ let r = bar(&u).expect("the bar shows");
+ let cy = r.center().y;
+ // Swatch 5 (blue): 8 in, 24 apart, 20 wide.
+ click(&mut u, pos2(r.min.x + 8.0 + 5.0 * 24.0 + 10.0, cy));
+ let outline = u.app.session.doc().unwrap().node(shape).unwrap().children[0];
+ assert_eq!(u.app.session.doc().unwrap().node(outline).unwrap().fills[0].solid_color(), board_color("blue"));
+ // Text size L: after the colours (208) and the shape menu (52), the third of the 30-wide cells.
+ let r = bar(&u).unwrap();
+ click(&mut u, pos2(r.min.x + 208.0 + 52.0 + 2.0 * 30.0 + 14.0, cy));
+ let text = figcraft_engine::board::text_of(u.app.session.doc().unwrap(), shape).unwrap();
+ assert_eq!(u.app.session.doc().unwrap().node(text).unwrap().kind.text().unwrap().style.font_size, 24.0);
+ // The shape menu lists the outlines.
+ let r = bar(&u).unwrap();
+ click(&mut u, pos2(r.min.x + 208.0 + 20.0, cy));
+ let shapes = flat(&u.frame_output(vec![]).shapes);
+ click(&mut u, text_center(&shapes, "Ellipse"));
+ assert_eq!(u.app.session.doc().unwrap().node(shape).unwrap().board, Some(BoardItem::Shape { shape: BoardShape::Ellipse }));
+}
+
+#[test]
+fn the_selection_bar_sets_a_connectors_style_and_offers_nothing_for_a_stamp() {
+ let mut u = board();
+ let a = u.app.session.execute("board.sticky", &json!({"x": 0, "y": 0})).unwrap()["id"].clone();
+ let b = u.app.session.execute("board.sticky", &json!({"x": 400, "y": 300})).unwrap()["id"].clone();
+ let c = id(&u.app.session.execute("board.connector", &json!({"from": a, "to": b, "style": "elbow"})).unwrap());
+ u.frame(vec![]);
+ u.frame(vec![]);
+ let r = bar(&u).expect("the bar shows for a connector");
+ let cy = r.center().y;
+ // After the colours (208): Straight, Elbow, the end's arrow, 30 apart.
+ click(&mut u, pos2(r.min.x + 208.0 + 14.0, cy));
+ let routing = |u: &Ui| match &u.app.session.doc().unwrap().node(c).unwrap().board {
+ Some(BoardItem::Connector(k)) => k.routing,
+ _ => panic!("not a connector"),
+ };
+ assert_eq!(routing(&u), Routing::Straight);
+ let r = bar(&u).unwrap();
+ click(&mut u, pos2(r.min.x + 208.0 + 60.0 + 14.0, cy));
+ assert_eq!(u.app.session.doc().unwrap().node(c).unwrap().stroke.cap_end, StrokeCap::None);
+ // Nothing is offered while a stamp alone is selected: it takes neither colour nor style.
+ let st = id(&u.app.session.execute("board.stamp", &json!({"x": 900, "y": 0, "stamp": "star"})).unwrap());
+ u.app.session.execute("select.set", &json!({"ids": [st]})).unwrap();
+ u.frame(vec![]);
+ u.frame(vec![]);
+ assert!(bar(&u).is_none());
+}
+
+#[test]
+fn a_board_you_only_view_offers_no_bar() {
+ let (mut h, _) = crate::live_tests::Harness::new();
+ h.app.session.execute("file.newBoard", &json!({})).unwrap();
+ let st = id(&h.app.session.execute("board.sticky", &json!({"x": 0, "y": 0})).unwrap());
+ h.frames(2);
+ assert!(bar_shown(&h.ctx), "the bar shows for the selected sticky");
+ crate::live_server_tests::joined(&mut h, figcraft_engine::live::Access::View);
+ h.app.session.execute("select.set", &json!({"ids": [st]})).unwrap();
+ h.frames(2);
+ assert!(h.app.session.active_read_only().is_some());
+ assert!(!bar_shown(&h.ctx), "view only: nothing to edit");
+}
+
+#[test]
+fn the_home_screen_makes_boards_and_marks_files_by_kind() {
+ let mut u = Ui::new(Session::empty());
+ let shapes = flat(&u.frame_output(vec![]).shapes);
+ click(&mut u, text_center(&shapes, "New board"));
+ assert_eq!(u.app.session.doc().unwrap().kind, FileKind::Board);
+ assert_eq!(crate::icons::file_mark(FileKind::Board), crate::icons::Icon::Board);
+ assert_eq!(crate::icons::file_mark(FileKind::Design), crate::icons::Icon::PenNib);
+}
+
+#[test]
+fn a_stamp_shows_who_placed_it_on_hover() {
+ let mut s = Session::new();
+ s.prefs.user_name = "Grace".into();
+ s.execute("file.newBoard", &json!({})).unwrap();
+ s.execute("board.stamp", &json!({"x": 100, "y": 100, "stamp": "check"})).unwrap();
+ s.execute("select.none", &json!({})).unwrap();
+ let mut u = Ui::new(s);
+ let at = u.app.to_screen(100.0, 100.0);
+ u.frame(vec![Event::PointerMoved(at)]);
+ u.frame(vec![Event::PointerMoved(at + egui::vec2(1.0, 0.0))]);
+ let shapes = flat(&u.frame_output(vec![Event::PointerMoved(at + egui::vec2(1.0, 1.0))]).shapes);
+ assert!(has_text(&shapes, "Grace"), "the placer's name beside the pointer");
+}
+
+#[test]
+fn the_next_sticky_from_the_keyboard_goes_on_typing() {
+ let mut u = board();
+ u.app.run("board.sticky", json!({"x": 0, "y": 0}));
+ // Shift+Cmd/Ctrl+Enter runs it from the menu layer, asking to type in the new one.
+ crate::menus::invoke(&mut u.app, "board.nextSticky");
+ let doc = u.app.session.doc().unwrap();
+ let te = u.app.session.ds().unwrap().text_edit.clone().expect("typing in the new sticky");
+ let owner = figcraft_engine::board::owner_of_text(doc, te.id).unwrap();
+ assert_eq!(doc.node(owner).unwrap().transform.translation().x, 224.0);
+}
diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs
index 46451ae0..0b13f5a8 100644
--- a/crates/ui-egui/src/canvas.rs
+++ b/crates/ui-egui/src/canvas.rs
@@ -256,6 +256,8 @@ pub fn show(app: &mut FigApp, ui: &mut Ui, worker: &mut Worker) {
}
crate::dev_mode::draw(app, &painter);
crate::handles::draw(app, &painter);
+ crate::board_bar::stamp_author(app, &painter, ctx.input(|i| i.pointer.hover_pos()).filter(|p| rect.contains(*p)));
+ crate::board_bar::show(app, &ctx);
crate::selection_spacing::draw(app, &painter);
crate::comments::draw(app, &painter);
crate::live_text::draw(app, &painter);
@@ -939,7 +941,8 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [
}
}
// The focus view's bar names its frame.
- let labelled = focus.is_none() && (n.kind.is_frame_like() || matches!(n.kind, NodeKind::Section { .. }));
+ // Board objects (stickies, shapes with text, stamps) are frames without a name label.
+ let labelled = focus.is_none() && (n.kind.is_frame_like() || matches!(n.kind, NodeKind::Section { .. })) && !n.is_board_atom();
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))));
}
@@ -1044,8 +1047,9 @@ fn overlays(app: &FigApp, painter: &egui::Painter, t: &Tokens) -> Vec<(NodeId, [
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 measuring || sel.iter().any(|i| figcraft_engine::tools::locked_in(&doc, *i)) {
+ // Locked layers (selected in the layers panel) can't be resized, nor anything in Dev
+ // Mode: no handles either.
+ let handles = if measuring || app.session.tool.dev_mode || sel.iter().any(|i| figcraft_engine::tools::locked_in(&doc, *i)) {
0
} else if is_line {
2
diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rs
index 2d35609a..4daea00b 100644
--- a/crates/ui-egui/src/control.rs
+++ b/crates/ui-egui/src/control.rs
@@ -633,12 +633,16 @@ pub fn handle(app: &mut FigApp, ctx: &Context, method: &str, p: &Value) -> Resul
if let Some(v) = p.get("exportPreview").and_then(Value::as_bool) {
app.ui.export_thumb = v;
}
- // Dev Mode's compare view: a ready-for-dev frame or section opens it, null closes it;
+ // Dev Mode's compare view: a frame or section opens it, null closes it; `devCompareVersion`
+ // the saved version it compares with (null: when it was marked ready for dev),
// `devCompareMode` is sideBySide or overlay, `devCompareSplit` the overlay slider (0–1).
if let Some(v) = p.get("devCompare") {
- app.ui.dev.compare = figcraft_engine::params::id_of(v).map(crate::dev_compare::CompareView::new);
+ app.ui.dev.compare = figcraft_engine::params::id_of(v).map(|id| crate::dev_compare::CompareView::new(id, None));
}
if let Some(c) = app.ui.dev.compare.as_mut() {
+ if let Some(v) = p.get("devCompareVersion") {
+ c.version = v.as_str().map(str::to_string);
+ }
match p.get("devCompareMode").and_then(Value::as_str) {
Some("overlay") => c.mode = crate::dev_compare::Mode::Overlay,
Some("sideBySide") => c.mode = crate::dev_compare::Mode::SideBySide,
diff --git a/crates/ui-egui/src/dev_compare.rs b/crates/ui-egui/src/dev_compare.rs
index 2e21eb54..0fd57aa7 100644
--- a/crates/ui-egui/src/dev_compare.rs
+++ b/crates/ui-egui/src/dev_compare.rs
@@ -1,12 +1,13 @@
-//! Dev Mode's compare view: a ready-for-dev frame or section as it was when it was marked next to
-//! how it is now (side by side, or one over the other with a slider), the changed layers outlined,
-//! and the list of what changed (`dev.compare`). Rendered once per document version. The branch
-//! review ([`crate::branch_ui`]) shows two versions with the same pieces.
+//! Dev Mode's compare view: a frame or section as it was when it was marked ready for dev, or in
+//! a saved version picked at the bottom, next to how it is now (side by side, or one over the
+//! other with a slider), the changed layers outlined, and the list of what changed
+//! (`dev.compare`). Rendered once per document version. The branch review ([`crate::branch_ui`])
+//! shows two versions with the same pieces.
use std::sync::Arc;
use egui::{Align2, Color32, CornerRadius, Id, Rect, Sense, Stroke, StrokeKind, Ui, pos2, vec2};
-use figcraft_doc::{Document, NodeId};
+use figcraft_doc::{DevStatus, Document, NodeId};
use figcraft_engine::devcompare::{self, ChangeKind, Comparison, LayerChange};
use serde_json::json;
@@ -38,25 +39,41 @@ pub struct CompareView {
pub mode: Mode,
/// Where the overlay slider is (0 = all new, 1 = all old).
pub split: f32,
+ /// The saved version compared with (its id); `None`: the snapshot from when it was marked
+ /// ready for dev.
+ pub version: Option,
/// The change row under the pointer (its layer is highlighted).
hovered: Option,
cache: Option,
}
impl CompareView {
- pub fn new(id: NodeId) -> Self {
- Self { id, mode: Mode::default(), split: 0.5, hovered: None, cache: None }
+ pub fn new(id: NodeId, version: Option) -> Self {
+ Self { id, mode: Mode::default(), split: 0.5, version, hovered: None, cache: None }
+ }
+
+ /// The view `dev.compare {show}` (or `ui.set`) asks for: `data` holds the layer's `id` and the
+ /// `version` to compare with.
+ pub fn requested(data: &serde_json::Value) -> Option {
+ let id = data.get("id").and_then(figcraft_engine::params::id_of)?;
+ Some(Self::new(id, data.get("version").and_then(serde_json::Value::as_str).map(str::to_string)))
}
}
-/// What the view shows, built for one version of the document.
+/// What the view shows, built for one version of the document and one "before".
struct Cached {
doc: Arc,
+ version: Option,
+ /// The version's document (read once per version picked).
+ version_doc: Option>,
cmp: Comparison,
before: Option,
after: Option,
}
+/// A saved version as the picker lists it: (id, name, when).
+type VersionRow = (String, String, u64);
+
/// One version rendered: its texture, the page area it shows and where each listed layer is.
pub(crate) struct Shot {
tex: egui::TextureHandle,
@@ -129,15 +146,33 @@ pub fn show(app: &mut FigApp, ctx: &egui::Context) {
let Some(mut view) = app.ui.dev.compare.take() else { return };
let Ok(ds) = app.session.ds() else { return };
let doc = ds.doc.clone();
- if doc.node(view.id).is_none() {
+ let Some(node) = doc.node(view.id) else { return };
+ let ready = node.dev_status == DevStatus::ReadyForDev;
+ // Newest first; a version deleted meanwhile falls back to the ready-for-dev snapshot (or the
+ // newest version, for a layer that isn't ready for dev).
+ let versions: Vec = ds.versions.iter().rev().map(|v| (v.id.clone(), v.name.clone(), v.time)).collect();
+ if view.version.as_ref().is_some_and(|v| !versions.iter().any(|(id, ..)| id == v)) || (!ready && view.version.is_none()) {
+ view.version = if ready { None } else { versions.first().map(|(id, ..)| id.clone()) };
+ }
+ if view.version.is_none() && !ready {
return;
}
- if view.cache.as_ref().is_none_or(|c| !Arc::ptr_eq(&c.doc, &doc)) {
- let cmp = devcompare::compare(&doc, view.id);
- let before = devcompare::before_doc(&doc, view.id).and_then(|b| Shot::of_changes(ctx, &b, view.id, &cmp.changes, true));
+ if view.cache.as_ref().is_none_or(|c| !Arc::ptr_eq(&c.doc, &doc) || c.version != view.version) {
+ let kept = view.cache.take().filter(|c| c.version == view.version).and_then(|c| c.version_doc);
+ let version_doc = match &view.version {
+ Some(v) => kept.or_else(|| ds.versions.iter().find(|x| x.id == *v).and_then(|x| x.document().ok())),
+ None => None,
+ };
+ let (cmp, before) = match &version_doc {
+ Some(b) => (devcompare::compare_with(b, &doc, view.id), Some(b.clone())),
+ None if view.version.is_some() => (devcompare::empty(&doc, view.id), None),
+ None => (devcompare::compare(&doc, view.id), devcompare::before_doc(&doc, view.id).map(Arc::new)),
+ };
+ let before = before.and_then(|b| Shot::of_changes(ctx, &b, view.id, &cmp.changes, true));
let after = Shot::of_changes(ctx, &doc, view.id, &cmp.changes, false);
- view.cache = Some(Cached { doc: doc.clone(), cmp, before, after });
+ view.cache = Some(Cached { doc: doc.clone(), version: view.version.clone(), version_doc, cmp, before, after });
}
+ let version_name = view.version.as_ref().and_then(|v| versions.iter().find(|(id, ..)| id == v)).map(|(_, name, _)| name.clone());
let t = Tokens::get(ctx);
let screen = ctx.content_rect();
let size = vec2(1120.0_f32.min(screen.width() - 64.0).max(560.0), 700.0_f32.min(screen.height() - 96.0).max(320.0));
@@ -162,27 +197,16 @@ pub fn show(app: &mut FigApp, ctx: &egui::Context) {
ui.horizontal_top(|ui| {
let images_w = size.x - LIST_W - 1.0;
let (r, _) = ui.allocate_exact_size(vec2(images_w, body_h), Sense::hover());
- if !cache.cmp.snapshot {
- let msg = if cache.cmp.changed {
- tr(
- "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.",
- )
- } else {
- tr("Nothing changed since this was marked ready for dev.")
- };
- message(ui, &t, r, msg);
- } else if let (Some(before), Some(after)) = (&cache.before, &cache.after) {
- images(ui, &t, r, [(before, tr("Before")), (after, tr("Now"))], view.mode, &mut view.split, view.hovered);
- }
+ compared(ui, r, cache, version_name.as_deref(), view.mode, &mut view.split, view.hovered);
let (line, _) = ui.allocate_exact_size(vec2(1.0, body_h), Sense::hover());
ui.painter().rect_filled(line, CornerRadius::ZERO, t.border);
ui.allocate_ui_with_layout(vec2(LIST_W, body_h), top_down, |ui| {
- if let Some(a) = list(ui, &t, &cache.cmp, &mut view.hovered) {
+ if let Some(a) = list(ui, &t, &cache.cmp, view.version.is_some(), &mut view.hovered) {
action = Some(a);
}
});
});
- if let Some(a) = footer(ui, &t, &cache.cmp) {
+ if let Some(a) = footer(ui, &t, &cache.cmp, ready, &versions, view.version.as_deref()) {
action = Some(a);
}
});
@@ -197,6 +221,7 @@ pub fn show(app: &mut FigApp, ctx: &egui::Context) {
}
}
Some(Action::Close) => open = false,
+ Some(Action::Against(v)) => view.version = v,
None => {}
}
if open {
@@ -204,10 +229,37 @@ pub fn show(app: &mut FigApp, ctx: &egui::Context) {
}
}
+/// The images area: before and after, or a note saying why there is nothing to show.
+/// `version_name`: the saved version compared with (`None`: the ready-for-dev snapshot).
+fn compared(ui: &mut Ui, r: Rect, cache: &Cached, version_name: Option<&str>, mode: Mode, split: &mut f32, hovered: Option) {
+ let t = &Tokens::get(ui.ctx());
+ let against = version_name.is_some();
+ if !cache.cmp.snapshot {
+ let msg = if against {
+ tr("This version can't be read.")
+ } else if cache.cmp.changed {
+ tr(
+ "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.",
+ )
+ } else {
+ tr("Nothing changed since this was marked ready for dev.")
+ };
+ message(ui, t, r, msg);
+ } else if !cache.cmp.changed && against {
+ message(ui, t, r, tr("Nothing changed since this version."));
+ } else if let (Some(before), Some(after)) = (&cache.before, &cache.after) {
+ images(ui, t, r, [(before, version_name.unwrap_or(tr("Before"))), (after, tr("Now"))], mode, split, hovered);
+ } else if against {
+ message(ui, t, r, tr("This version doesn't have it: all of it is new."));
+ }
+}
+
enum Action {
Select(NodeId),
Resolve,
Close,
+ /// Compare with this saved version (`None`: the snapshot from when it was marked ready).
+ Against(Option),
}
/// The title row: `title` and `name`, the side by side / overlay switch and the close button.
@@ -325,7 +377,7 @@ fn pane(p: &egui::Painter, t: &Tokens, place: Place, shot: &Shot, hovered: Optio
}
/// The changed layers with their property changes; a click on a layer selects it.
-fn list(ui: &mut Ui, t: &Tokens, cmp: &Comparison, hovered: &mut Option) -> Option {
+fn list(ui: &mut Ui, t: &Tokens, cmp: &Comparison, from_version: bool, hovered: &mut Option) -> Option {
let mut out = None;
let summary = if !cmp.snapshot {
tr("Changes unknown").to_string()
@@ -345,7 +397,11 @@ fn list(ui: &mut Ui, t: &Tokens, cmp: &Comparison, hovered: &mut Option)
egui::ScrollArea::vertical().id_salt("compare_list").auto_shrink([false, false]).show(ui, |ui| {
ui.spacing_mut().item_spacing = vec2(0.0, 0.0);
for c in &cmp.changes {
- let tip = if c.change == ChangeKind::Removed { tr("Removed since it was marked") } else { tr("Select layer") };
+ let tip = match (c.change, from_version) {
+ (ChangeKind::Removed, false) => tr("Removed since it was marked"),
+ (ChangeKind::Removed, true) => tr("Removed since this version"),
+ _ => tr("Select layer"),
+ };
let resp = change_row(ui, t, c.change, &c.name, c.depth, c.layers, false, tip);
if resp.hovered() {
now_hovered = Some(c.id);
@@ -419,17 +475,42 @@ pub(crate) fn property_lines<'a>(ui: &mut Ui, t: &Tokens, depth: usize, lines: i
}
}
-fn footer(ui: &mut Ui, t: &Tokens, cmp: &Comparison) -> Option {
+/// Resolve and Close, and left of them what it compares with: the snapshot from when it was
+/// marked ready for dev (`ready`) or one of the saved `versions` (`version`, the one picked).
+fn footer(ui: &mut Ui, t: &Tokens, cmp: &Comparison, ready: bool, versions: &[VersionRow], version: Option<&str>) -> Option {
let (r, _) = ui.allocate_exact_size(vec2(ui.available_width(), BAR_H + 1.0), Sense::hover());
ui.painter().rect_filled(Rect::from_min_size(r.min, vec2(r.width(), 1.0)), CornerRadius::ZERO, t.border);
let mut out = None;
let inner = Rect::from_min_max(pos2(r.min.x + 16.0, r.min.y + 1.0), pos2(r.max.x - 16.0, r.max.y));
+ ui.scope_builder(egui::UiBuilder::new().max_rect(inner).layout(egui::Layout::left_to_right(egui::Align::Center)), |ui| {
+ ui.spacing_mut().item_spacing.x = 8.0;
+ if !versions.is_empty() {
+ widgets::label(ui, tr("Compare with"), t.text_secondary);
+ let picked = version.and_then(|v| versions.iter().find(|(id, ..)| id == v));
+ let label = picked.map_or_else(|| tr("When marked ready").to_string(), |(_, name, _)| name.clone());
+ let resp = widgets::dropdown(ui, &label, 220.0, Some(Icon::Clock));
+ crate::right::menu_popup(&resp).show(|ui| {
+ if ready && crate::right::menu_check(ui, version.is_none(), tr("When marked ready"), "") {
+ out = Some(Action::Against(None));
+ ui.close();
+ }
+ for (id, name, time) in versions {
+ if crate::right::menu_check(ui, version == Some(id.as_str()), name, &crate::comments::ago_long(*time)) {
+ out = Some(Action::Against(Some(id.clone())));
+ ui.close();
+ }
+ }
+ });
+ }
+ });
ui.scope_builder(egui::UiBuilder::new().max_rect(inner).layout(egui::Layout::right_to_left(egui::Align::Center)), |ui| {
ui.spacing_mut().item_spacing.x = 8.0;
- let resolve = widgets::button(ui, tr("Resolve change"), true, cmp.changed)
- .on_hover_text(tr("Back to Ready for dev: the next change compares with how it is now"));
- if resolve.clicked() {
- out = Some(Action::Resolve);
+ if version.is_none() {
+ let resolve = widgets::button(ui, tr("Resolve change"), true, cmp.changed)
+ .on_hover_text(tr("Back to Ready for dev: the next change compares with how it is now"));
+ if resolve.clicked() {
+ out = Some(Action::Resolve);
+ }
}
if widgets::button(ui, tr("Close"), false, true).clicked() {
out = Some(Action::Close);
diff --git a/crates/ui-egui/src/dev_mode.rs b/crates/ui-egui/src/dev_mode.rs
index 0b429820..1b21ded2 100644
--- a/crates/ui-egui/src/dev_mode.rs
+++ b/crates/ui-egui/src/dev_mode.rs
@@ -29,8 +29,12 @@ const CALLOUT_W: f32 = 220.0;
const CALLOUT_GAP: f32 = 24.0;
/// The status filters of the ready-for-dev list.
-const FILTERS: [(Option, &str); 3] =
- [(Some(DevStatus::ReadyForDev), tr_noop("Ready for dev")), (Some(DevStatus::Completed), tr_noop("Completed")), (None, tr_noop("Any status"))];
+const FILTERS: [(Option, bool, &str); 4] = [
+ (Some(DevStatus::ReadyForDev), false, tr_noop("Ready for dev")),
+ (Some(DevStatus::ReadyForDev), true, tr_noop("Changed")),
+ (Some(DevStatus::Completed), false, tr_noop("Completed")),
+ (None, false, tr_noop("Any status")),
+];
/// Which annotations the canvas shows.
#[derive(Clone, Debug, Default, PartialEq, Eq)]
@@ -500,18 +504,18 @@ pub fn status(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) {
row(ui, 32.0, |ui| crate::section_panel::status_dropdown(app, ui, doc, sel, w));
if let [id] = sel {
let changed = doc.node(*id).is_some_and(|n| n.dev_status == DevStatus::ReadyForDev && n.dev_changed);
- let focused = app.session.ds().ok().and_then(figcraft_engine::DocState::focused) == Some(*id);
+ let ds = app.session.ds().ok();
+ let focused = ds.and_then(figcraft_engine::DocState::focused) == Some(*id);
+ // Unchanged since it was marked (or not ready for dev): compared with the newest saved version.
+ let newest = ds.and_then(|d| d.versions.last()).map(|v| v.id.clone()).filter(|_| !changed);
row(ui, 32.0, |ui| {
ui.spacing_mut().item_spacing.x = 8.0;
if !focused && widgets::button(ui, tr("Focus view"), false, true).on_hover_text(tr("Show only this on the canvas")).clicked() {
app.run("dev.focus", json!({"id": id}));
}
- if changed
- && widgets::button(ui, tr("Compare changes"), true, true)
- .on_hover_text(tr("What changed since it was marked ready for dev"))
- .clicked()
- {
- app.run("dev.compare", json!({"id": id, "show": true}));
+ let tip = if changed { tr("What changed since it was marked ready for dev") } else { tr("What changed since a saved version") };
+ if (changed || newest.is_some()) && widgets::button(ui, tr("Compare changes"), changed, true).on_hover_text(tip).clicked() {
+ app.run("dev.compare", json!({"id": id, "version": newest, "show": true}));
}
});
}
@@ -819,7 +823,9 @@ pub fn ready_list(app: &mut FigApp, ui: &mut Ui) {
let filter = app.ui.dev.filter.min(FILTERS.len() - 1);
let key = (ds.uid, ds.revision, filter);
if app.ui.dev.ready_key != Some(key) {
- app.ui.dev.ready = devinspect::dev_items(&ds.doc, FILTERS.get(filter).and_then(|f| f.0), None);
+ let (status, changed_only) = FILTERS.get(filter).map_or((None, false), |f| (f.0, f.1));
+ app.ui.dev.ready = devinspect::dev_items(&ds.doc, status, None);
+ app.ui.dev.ready.retain(|i| i.changed || !changed_only);
app.ui.dev.ready_key = Some(key);
}
let doc = ds.doc.clone();
@@ -827,9 +833,9 @@ pub fn ready_list(app: &mut FigApp, ui: &mut Ui) {
widgets::section_header(ui, tr("Ready for dev"), &[], app.ui.dev.ready.is_empty());
let w = ui.available_width() - PAD * 2.0;
row(ui, 32.0, |ui| {
- let resp = widgets::dropdown(ui, FILTERS.get(filter).map_or("", |f| tr(f.1)), w, Some(Icon::Code));
+ let resp = widgets::dropdown(ui, FILTERS.get(filter).map_or("", |f| tr(f.2)), w, Some(Icon::Code));
menu_popup(&resp).show(|ui| {
- for (i, (_, label)) in FILTERS.iter().enumerate() {
+ for (i, (_, _, label)) in FILTERS.iter().enumerate() {
if menu_check(ui, i == filter, tr(label), "") {
app.ui.dev.filter = i;
ui.close();
@@ -848,15 +854,21 @@ pub fn ready_list(app: &mut FigApp, ui: &mut Ui) {
if resp.hovered() {
ui.painter().rect_filled(r.shrink2(vec2(8.0, 0.0)), CornerRadius::same(5), t.hover);
}
- let dot = if item.status == DevStatus::ReadyForDev { t.success } else { t.text_tertiary };
+ // The status colours the canvas badges use; a changed one also says so after its name.
+ let n = doc.node(item.id);
+ let dot = n.and_then(crate::canvas::status_label).map_or(t.text_tertiary, |(_, c)| c);
ui.painter().circle_filled(pos2(r.min.x + PAD + 4.0, r.center().y), 4.0, dot);
let page = doc.node(item.page).map(|p| p.name.clone()).unwrap_or_default();
let page_w = ui.painter().layout_no_wrap(page.clone(), regular(10.0), t.text_secondary).size().x.min(90.0);
let page_r = Rect::from_min_max(pos2(r.max.x - PAD - page_w, r.min.y), pos2(r.max.x - PAD, r.max.y));
ui.painter().with_clip_rect(page_r).text(page_r.right_center(), Align2::RIGHT_CENTER, page, regular(10.0), t.text_secondary);
let name_r = Rect::from_min_max(pos2(r.min.x + PAD + 14.0, r.min.y), pos2(page_r.min.x - 8.0, r.max.y));
- let name = widgets::elide(ui, &item.name, name_r.width());
- ui.painter().text(name_r.left_center(), Align2::LEFT_CENTER, name, regular(11.0), t.text);
+ // Room for the "Changed" badge (about 60 points) after the name.
+ let name = widgets::elide(ui, &item.name, name_r.width() - if item.changed { 64.0 } else { 0.0 });
+ let name_end = ui.painter().text(name_r.left_center(), Align2::LEFT_CENTER, name, regular(11.0), t.text).max.x;
+ if let Some(n) = n.filter(|_| item.changed) {
+ crate::canvas::status_badge(&ui.painter().with_clip_rect(name_r), n, pos2(name_end + 6.0, r.center().y));
+ }
// Hovered: a button to open it in the focus view, over the page name.
let focus_r = Rect::from_center_size(pos2(r.max.x - PAD - 10.0, r.center().y), vec2(22.0, 22.0));
let over_focus = ui.rect_contains_pointer(focus_r);
diff --git a/crates/ui-egui/src/devmode_tail_tests.rs b/crates/ui-egui/src/devmode_tail_tests.rs
new file mode 100644
index 00000000..7008e9e5
--- /dev/null
+++ b/crates/ui-egui/src/devmode_tail_tests.rs
@@ -0,0 +1,110 @@
+//! Dev Mode in the UI, the tail: the compare view compares with a saved version picked at its
+//! bottom, and falls back when that version goes away.
+
+use figcraft_engine::Session;
+use serde_json::json;
+
+use crate::dev_compare::CompareView;
+use crate::present_tests::{Ui, id};
+
+#[test]
+fn compare_view_compares_with_a_saved_version() {
+ let mut s = Session::new();
+ let f = id(&s.execute("frame.create", &json!({"x": 0, "y": 0, "width": 300, "height": 400, "name": "Login"})).unwrap());
+ let r = id(&s.execute("shape.rectangle", &json!({"x": 20, "y": 300, "width": 120, "height": 40, "parent": f})).unwrap());
+ let mut u = Ui::new(s);
+ u.app.ui.right_tab = crate::RightTab::Inspect;
+ u.frame(vec![]);
+ // Neither ready for dev nor any version: nothing to compare with, the view doesn't stay.
+ u.app.ui.dev.compare = Some(CompareView::new(f, None));
+ u.frames(2, Vec::new);
+ assert!(u.app.ui.dev.compare.is_none());
+ let v = u.run("file.saveVersion", json!({"name": "Kickoff"}));
+ let v = v["id"].as_str().unwrap().to_string();
+ u.run("node.set", json!({"id": r, "props": {"width": 160}}));
+ u.run("dev.compare", json!({"id": f, "version": v, "show": true}));
+ u.frames(2, Vec::new);
+ assert_eq!(u.app.inspect()["devCompare"]["version"], json!(v));
+ // Opened without one, a layer that isn't ready compares with the newest version.
+ u.app.ui.dev.compare = Some(CompareView::new(f, None));
+ u.frames(2, Vec::new);
+ assert_eq!(u.app.inspect()["devCompare"]["version"], json!(v));
+ // Ready for dev: the snapshot from when it was marked is there too, and a deleted version
+ // falls back to it.
+ u.run("node.set", json!({"id": f, "props": {"devStatus": "readyForDev"}}));
+ u.run("node.set", json!({"id": r, "props": {"height": 48}}));
+ u.run("version.delete", json!({"id": v}));
+ u.frames(2, Vec::new);
+ assert_eq!(u.app.inspect()["devCompare"]["version"], json!(null));
+ assert!(u.app.ui.dev.compare.is_some());
+}
+
+#[test]
+fn dev_mode_keys_refuse_design_edits_and_say_why() {
+ let mut s = Session::new();
+ let f = id(&s.execute("frame.create", &json!({"x": 0, "y": 0, "width": 300, "height": 400, "name": "Login"})).unwrap());
+ let r = id(&s.execute("shape.rectangle", &json!({"x": 20, "y": 30, "width": 120, "height": 40, "parent": f})).unwrap());
+ s.execute("select.set", &json!({"ids": [r]})).unwrap();
+ let mut u = Ui::new(s);
+ u.app.ui.right_tab = crate::RightTab::Inspect;
+ u.frame(vec![]);
+ let at = egui::pos2(700.0, 450.0);
+ let x = |u: &Ui| u.app.session.doc().unwrap().node(r).map(|n| n.transform.as_coeffs()[4]);
+ for key in [egui::Key::Delete, egui::Key::ArrowRight, egui::Key::Num5, egui::Key::R] {
+ u.key(at, key);
+ }
+ assert!(u.app.session.doc().unwrap().contains(r), "not deleted");
+ assert_eq!(x(&u), Some(20.0), "not nudged");
+ assert_eq!(u.app.session.doc().unwrap().node(r).map(|n| n.opacity), Some(1.0), "opacity kept");
+ assert_eq!(u.app.session.tool.tool, figcraft_engine::tools::ToolId::Move, "no drawing tool");
+ assert!(u.app.ui.toast.as_ref().is_some_and(|(m, _)| m.contains("Shift+D")));
+ // In the design the same keys edit.
+ u.app.ui.right_tab = crate::RightTab::Design;
+ u.frame(vec![]);
+ u.key(at, egui::Key::ArrowRight);
+ assert_eq!(x(&u), Some(21.0));
+}
+
+#[test]
+fn read_only_plugins_run_from_the_inspect_tab_show_their_panel() {
+ use base64::Engine as _;
+ let wasm = base64::engine::general_purpose::STANDARD.encode(crate::plugin_panel_tests::panel_module());
+ let manifest = json!({"id": "org.test.inspect", "name": "Inspect panel", "main": "p.wasm", "api": 2, "permissions": {"access": "read"}});
+ let mut s = Session::new();
+ s.execute("plugin.import", &json!({"manifest": manifest, "wasm": wasm})).unwrap();
+ let mut u = Ui::new(s);
+ u.app.ui.right_tab = crate::RightTab::Inspect;
+ u.frame(vec![]);
+ // What the Inspect tab's Plugins row runs.
+ crate::plugins_ui::start(&mut u.app, "org.test.inspect", "run");
+ u.frame(vec![]);
+ assert_eq!(u.app.session.plugins.panels.len(), 1, "its panel shows");
+ // Its callbacks only read: the button that would draw is refused and the design stays.
+ let layers = |u: &Ui| u.app.session.doc().unwrap().ids().count();
+ let before = layers(&u);
+ assert!(u.app.session.execute("plugin.event", &json!({"id": "org.test.inspect", "control": "go"})).is_err());
+ assert_eq!(layers(&u), before);
+}
+
+/// A clipboard holding only text.
+struct TextClip(String);
+
+impl crate::Services for TextClip {
+ fn clipboard_get_text(&mut self) -> Option {
+ Some(self.0.clone())
+ }
+}
+
+#[test]
+fn dev_mode_pastes_only_a_comments_link() {
+ let mut s = Session::new();
+ let c = s.execute("comment.add", &json!({"x": 10, "y": 10, "text": "Check the spacing"})).unwrap()["id"].as_u64().unwrap();
+ let layers = |app: &crate::FigApp| app.session.doc().unwrap().node(app.session.page().unwrap()).unwrap().children.len();
+ let mut app = crate::FigApp::new(s, Box::new(TextClip("Pasted words".into())));
+ app.ui.right_tab = crate::RightTab::Inspect;
+ crate::menus::paste(&mut app, None, None);
+ assert_eq!(layers(&app), 0, "text doesn't paste into the design in Dev Mode");
+ app.services = Box::new(TextClip(format!("figcraft://comment/{c}")));
+ crate::menus::paste(&mut app, None, None);
+ assert_eq!(app.ui.comments.open, Some(c), "the link opens its thread");
+}
diff --git a/crates/ui-egui/src/home.rs b/crates/ui-egui/src/home.rs
index b532d9a7..326a3b14 100644
--- a/crates/ui-egui/src/home.rs
+++ b/crates/ui-egui/src/home.rs
@@ -321,13 +321,14 @@ fn action_card(ui: &mut Ui, t: &Tokens, icon: Icon, title: &str, sub: &str) -> b
fn recents(app: &mut FigApp, ui: &mut Ui, t: &Tokens) {
heading(ui, t, tr("Recents"));
- let (mut new_file, mut open) = (false, false);
- ui.horizontal(|ui| {
- new_file = action_card(ui, t, Icon::Plus, tr("New design file"), tr("Start from a blank canvas"));
+ let (mut new_file, mut new_board, mut open) = (false, false, false);
+ ui.horizontal_wrapped(|ui| {
+ new_file = action_card(ui, t, Icon::PenNib, tr("New design file"), tr("Start from a blank canvas"));
+ new_board = action_card(ui, t, Icon::Board, tr("New board"), tr("Sticky notes, shapes and connectors"));
open = action_card(ui, t, Icon::Page, tr("Open file"), tr("Open .figcraft, .svg or images"));
});
- if new_file {
- app.run("file.new", json!({}));
+ if new_file || new_board {
+ app.run(if new_board { "file.newBoard" } else { "file.new" }, json!({}));
app.ui.home = false;
}
if open {
@@ -376,8 +377,14 @@ fn open_files(app: &mut FigApp, ui: &mut Ui, t: &Tokens, query: &str) -> usize {
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 };
+ let row = FileRow {
+ mark: Some((icons::file_mark(d.doc.kind), 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);
}
diff --git a/crates/ui-egui/src/home_recents.rs b/crates/ui-egui/src/home_recents.rs
index 81d68240..2d39c6fe 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};
@@ -200,18 +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 {
- // 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);
+ // 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)])
}
@@ -234,6 +252,8 @@ pub struct Shown {
pub name: String,
/// `None` until the file has been looked at.
pub stat: Option,
+ /// A design file or a board (design until its picture has been read).
+ pub kind: figcraft_doc::FileKind,
}
impl Shown {
@@ -241,7 +261,7 @@ impl Shown {
// Shown without its extension, like a document's name; the full path is the tooltip.
let p = Path::new(path);
let name = p.file_stem().or_else(|| p.file_name()).map_or_else(|| path.to_string(), |f| f.to_string_lossy().into_owned());
- Shown { path: path.to_string(), name, stat }
+ Shown { path: path.to_string(), name, stat, kind: figcraft_doc::FileKind::Design }
}
fn date(&self, key: SortKey) -> Option {
@@ -293,6 +313,7 @@ struct Ready {
modified: Option,
page: Option,
texture: Option,
+ kind: figcraft_doc::FileKind,
/// When it came in (for its fade).
arrived: f64,
}
@@ -461,7 +482,7 @@ impl Recents {
let page = preview.page.map(|[r, g, b, a]| crate::theme::c32(figcraft_color::Color { r, g, b, a }));
// A changed file's new picture shows at once; a first one fades in.
let arrived = if k.shown.is_some() { f64::NEG_INFINITY } else { time };
- k.shown = Some(Ready { modified, page, texture, arrived });
+ k.shown = Some(Ready { modified, page, texture, kind: preview.kind, arrived });
k.wanted = None;
}
}
@@ -501,7 +522,13 @@ impl Recents {
/// The files as listed, with what is known about them.
fn shown(&self, paths: &[String]) -> Vec {
- paths.iter().map(|p| Shown::new(p, self.files.get(p).and_then(|k| k.stat))).collect()
+ paths
+ .iter()
+ .map(|p| {
+ let k = self.files.get(p);
+ Shown { kind: k.and_then(|k| k.shown.as_ref()).map_or_else(Default::default, |r| r.kind), ..Shown::new(p, k.and_then(|k| k.stat)) }
+ })
+ .collect()
}
/// For `ui.inspect`: each file listed, whether it is there and whether its picture is in.
@@ -733,13 +760,13 @@ 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) {
+/// The square file-type mark before a name (a design file's pen nib, a board's note).
+fn file_icon(ui: &Ui, t: &Tokens, center: egui::Pos2, file: &Shown) {
let r = Rect::from_center_size(center, vec2(16.0, 16.0));
- match FileKind::of(Path::new(path)) {
+ match FileKind::of(Path::new(&file.path)) {
FileKind::FigCraft | FileKind::Fig => {
ui.painter().rect_filled(r, CornerRadius::same(4), t.accent);
- icons::paint(ui.painter(), r.shrink(3.0), Icon::Logo, t.accent_on);
+ icons::paint(ui.painter(), r.shrink(3.0), icons::file_mark(file.kind), t.accent_on);
}
kind => {
ui.painter().rect_filled(r, CornerRadius::same(4), t.field);
@@ -849,7 +876,7 @@ fn card(
}
p.line_segment([pos2(rect.min.x, area.max.y + 0.5), pos2(rect.max.x, area.max.y + 0.5)], Stroke::new(1.0, t.border));
let y = area.max.y + 1.0 + FOOTER_H / 2.0;
- file_icon(ui, t, pos2(rect.min.x + 24.0, y), &file.path);
+ file_icon(ui, t, pos2(rect.min.x + 24.0, y), file);
let (x, w) = (rect.min.x + 44.0, rect.width() - 56.0);
let name = widgets::elide_font(ui, &file.name, w, semibold(12.5));
p.text(pos2(x, y - 8.0), Align2::LEFT_CENTER, name, semibold(12.5), t.text);
@@ -917,6 +944,8 @@ fn list(ui: &mut Ui, t: &Tokens, recents: &mut Recents, files: &[Shown], now: u6
if !ui.is_rect_visible(r) {
continue;
}
+ // The row's mark says what kind of file it is: read it like a card's picture.
+ recents.picture(&file.path, true, ui.input(|i| i.time));
let selected = recents.selected.as_deref() == Some(file.path.as_str());
let p = ui.painter();
if selected {
@@ -927,7 +956,7 @@ fn list(ui: &mut Ui, t: &Tokens, recents: &mut Recents, files: &[Shown], now: u6
if resp.has_focus() && !selected {
p.rect_stroke(r, CornerRadius::same(5), Stroke::new(2.0, t.focus), StrokeKind::Inside);
}
- file_icon(ui, t, pos2(r.min.x + 20.0, r.center().y), &file.path);
+ file_icon(ui, t, pos2(r.min.x + 20.0, r.center().y), file);
let name_w = date_x(1) - 52.0;
p.text(
pos2(r.min.x + 40.0, r.center().y),
@@ -965,3 +994,24 @@ 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");
+ // 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");
+ }
+}
diff --git a/crates/ui-egui/src/home_recents_tests.rs b/crates/ui-egui/src/home_recents_tests.rs
index e49866ab..d01e5222 100644
--- a/crates/ui-egui/src/home_recents_tests.rs
+++ b/crates/ui-egui/src/home_recents_tests.rs
@@ -74,7 +74,7 @@ fn columns_follow_the_width() {
fn shown(path: &str, modified: Option, created: Option) -> Shown {
let stat = Some(Stat { exists: modified.is_some(), modified, created });
- Shown { path: path.into(), name: Path::new(path).file_stem().unwrap().to_string_lossy().into(), stat }
+ Shown { path: path.into(), name: Path::new(path).file_stem().unwrap().to_string_lossy().into(), stat, kind: Default::default() }
}
#[test]
diff --git a/crates/ui-egui/src/i18n_tests.rs b/crates/ui-egui/src/i18n_tests.rs
index 046212c1..fa7da946 100644
--- a/crates/ui-egui/src/i18n_tests.rs
+++ b/crates/ui-egui/src/i18n_tests.rs
@@ -1,13 +1,11 @@
//! The catalog checks: every key the code looks up is in the English catalog, no catalog has keys
-//! the code doesn't use, placeholders match English, and complete languages translate everything.
+//! the code doesn't use, and placeholders match English. A missing translation reads English and
+//! fails nothing: [`missing_translations_report`] lists them (`cargo xtask i18n-report`).
use std::collections::BTreeSet;
use super::*;
-/// Languages that must translate every UI string and command label.
-const COMPLETE: &[&str] = &["es"];
-
/// 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 {
@@ -132,6 +130,9 @@ fn dynamic_labels() -> Vec<&'static str> {
use figcraft_engine::keymap::{GESTURES, Group};
let mut v: Vec<&'static str> = figcraft_engine::ToolId::ALL.iter().map(|t| t.label()).collect();
v.extend(figcraft_engine::vectoredit::VTool::ALL.iter().map(|t| t.label()));
+ // Board shapes and stamps (the board tools' flyouts and the contextual bar).
+ v.extend(figcraft_doc::BoardShape::ALL.iter().map(|b| b.label()));
+ v.extend(figcraft_doc::Stamp::ALL.iter().map(|b| b.label()));
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);
@@ -274,14 +275,19 @@ fn english_text_is_its_key_except_plurals() {
assert!(english().commands.is_empty() && english().menu.is_empty(), "English command labels come from the engine");
}
-#[test]
-fn catalogs_have_known_keys_and_matching_placeholders() {
- let en = english();
- let ids: BTreeSet<&str> = figcraft_engine::all_commands()
+/// The ids `[commands]` entries translate: every command and every main-menu item.
+fn command_ids() -> BTreeSet<&'static str> {
+ figcraft_engine::all_commands()
.iter()
.map(|c| c.id)
.chain(figcraft_engine::catalog::MENU.iter().map(|m| m.id).filter(|id| !id.is_empty()))
- .collect();
+ .collect()
+}
+
+#[test]
+fn catalogs_have_known_keys_and_matching_placeholders() {
+ let en = english();
+ let ids = command_ids();
for lang in LANGS {
assert!(!lang.name.is_empty(), "{}: [meta] name is missing", lang.code);
for (k, t) in lang.ui {
@@ -302,13 +308,29 @@ fn catalogs_have_known_keys_and_matching_placeholders() {
for (id, _) in lang.menu {
assert!(menu_worded_differently().contains(id), "{}: [menu] {id:?} reads like the command; [commands] covers it", lang.code);
}
- if COMPLETE.contains(&lang.code) {
- let missing: Vec<_> = en.ui.iter().filter(|(k, _)| find(lang.ui, k).is_none()).map(|(k, _)| k).collect();
- assert!(missing.is_empty(), "{}: untranslated: {missing:?}", lang.code);
- let missing: Vec<_> = ids.iter().filter(|id| find(lang.commands, id).is_none()).collect();
- assert!(missing.is_empty(), "{}: untranslated commands: {missing:?}", lang.code);
- let missing: Vec<_> = menu_worded_differently().into_iter().filter(|id| find(lang.menu, id).is_none()).collect();
- assert!(missing.is_empty(), "{}: menu items worded unlike their command, missing from [menu]: {missing:?}", lang.code);
+ }
+}
+
+/// What each language lacks: UI strings, command labels and menu wordings that read as in English
+/// because neither its catalog nor the one it overlays has them. It prints them and always passes.
+#[test]
+fn missing_translations_report() {
+ let ids = command_ids();
+ let worded = menu_worded_differently();
+ for (i, lang) in LANGS.iter().enumerate().filter(|(_, l)| l.code != "en") {
+ let own = || chain(i).filter(|l| l.code != "en");
+ let ui: Vec<_> = english().ui.iter().map(|(k, _)| *k).filter(|k| own().all(|l| find(l.ui, k).is_none())).collect();
+ let commands: Vec<_> = ids.iter().filter(|id| own().all(|l| find(l.commands, id).is_none())).collect();
+ let menu: Vec<_> = worded.iter().filter(|id| own().all(|l| find(l.menu, id).is_none())).collect();
+ println!("{}: {} UI strings, {} command labels, {} menu wordings missing", lang.code, ui.len(), commands.len(), menu.len());
+ for k in ui {
+ println!(" {k:?}");
+ }
+ for id in commands {
+ println!(" [commands] {id}");
+ }
+ for id in menu {
+ println!(" [menu] {id}");
}
}
}
@@ -344,8 +366,6 @@ fn system_languages_pick_the_first_one_with_a_catalog() {
assert_eq!(code("system", Some("cs_CZ.UTF-8")), "cs");
assert_eq!(code("system", Some("cs-CZ,en-US")), "cs");
assert_eq!(code("cs", None), "cs");
- assert_eq!(LANGS[resolve("cs", None)].name, "Čeština");
- assert!(LANGS[resolve("cs", None)].draft);
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");
@@ -368,8 +388,6 @@ fn swedish_is_picked_for_swedish_locales() {
assert_eq!(code("system", Some(tag)), "sv", "{tag}");
}
let sv = LANGS.iter().position(|l| l.code == "sv").unwrap();
- assert_eq!(LANGS[sv].name, "Svenska");
- assert!(!LANGS[sv].draft);
assert!(!plural_one(sv, 0) && plural_one(sv, 1) && !plural_one(sv, 2));
}
@@ -387,10 +405,11 @@ fn latin_american_spanish_overlays_spanish() {
assert_eq!(LANGS[la].parent, es);
assert!(es < la, "the picker lists Español first");
// Its own wording, else Spanish's, else English's.
- assert!(matches!(lookup(la, "Add fill"), Some(Text::Plain("Agregar relleno"))));
- assert!(matches!(lookup(la, "Fill"), Some(Text::Plain("Relleno"))));
+ for (k, _) in LANGS[es].ui.iter().filter(|(k, _)| find(LANGS[la].ui, k).is_none()) {
+ assert!(lookup(la, k).is_some_and(|t| std::ptr::eq(t, find(LANGS[es].ui, k).unwrap())), "{k:?}");
+ }
let undo = |i: usize| chain(i).find_map(|l| find(l.commands, "edit.undo")).map(forms);
- assert!(undo(es).is_some() && undo(la) == undo(es), "command labels fall back too");
+ assert_eq!(undo(la), undo(es), "command labels fall back too");
// An overlay lists only what differs from the catalog under it.
for lang in LANGS.iter().filter(|l| l.parent != 0) {
let under = &LANGS[lang.parent];
@@ -431,19 +450,11 @@ fn japanese_korean_and_chinese_have_no_plural_forms() {
}
#[test]
-fn georgian_is_a_draft_with_count_neutral_plurals() {
+fn georgian_is_picked_for_georgian_locales() {
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),
@@ -477,7 +488,6 @@ fn chinese_reads_simplified_and_traditional_has_no_catalog() {
assert_eq!(code(tag, None), "en", "{tag}");
}
assert_eq!(code("system", Some("zh-TW,ja-JP")), "ja");
- assert_eq!(LANGS[resolve("zh-Hans", None)].name, "简体中文");
}
#[test]
@@ -491,28 +501,18 @@ fn the_key_scanner_reads_rust_literals() {
#[test]
fn czech_integer_plurals() {
- let cs = LANGS.iter().position(|l| l.code == "cs").unwrap();
assert_eq!(plural("cs", 1), Plural::One);
- assert_eq!(fill(counted(cs, "{n} layers", 1), &[("n", &1)]), "1 vrstva");
for n in [2, 3, 4] {
assert_eq!(plural("cs", n), Plural::Few, "{n}");
- assert_eq!(fill(counted(cs, "{n} layers", n), &[("n", &n)]), format!("{n} vrstvy"));
}
for n in [0, 5, 11, 12, 21, 22, 100, 1_000_000] {
assert_eq!(plural("cs", n), Plural::Other, "{n}");
- assert_eq!(fill(counted(cs, "{n} layers", n), &[("n", &n)]), format!("{n} vrstev"));
- }
- for (key, text) in LANGS[cs].ui {
- if let Text::Plural { one, few, .. } = text {
- assert!(one.is_some() && few.is_some(), "{key}: missing Czech plural forms");
- }
}
}
#[test]
fn russian_language_tags_and_integer_plurals() {
let ru = LANGS.iter().position(|l| l.code == "ru").unwrap();
- assert_eq!(LANGS[ru].name, "Русский");
for tag in ["ru", "ru-RU", "ru_RU.UTF-8", "RU", "ru-BY", "ru-Cyrl-RU"] {
assert_eq!(resolve(tag, None), ru, "{tag}");
assert_eq!(resolve("system", Some(tag)), ru, "{tag}");
@@ -520,49 +520,34 @@ fn russian_language_tags_and_integer_plurals() {
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} слой"));
}
for n in [2, 3, 4, 22, 23, 24, 102, 104, 1_002] {
assert_eq!(plural("ru", n), Plural::Few, "{n}");
- assert_eq!(fill(counted(ru, "{n} layers", n), &[("n", &n)]), format!("{n} слоя"));
}
for n in [0, 5, 10, 11, 12, 13, 14, 19, 20, 25, 100, 111, 112, 114, 1_000_000] {
assert_eq!(plural("ru", n), Plural::Many, "{n}");
- assert_eq!(fill(counted(ru, "{n} layers", n), &[("n", &n)]), format!("{n} слоёв"));
- }
- for (key, text) in LANGS[ru].ui {
- if let Text::Plural { one, few, many, .. } = text {
- assert!(one.is_some() && few.is_some() && many.is_some(), "{key}: missing Russian plural forms");
- }
}
}
#[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() {
+ // A plural es-419 doesn't overlay reads Spanish's entry under Spanish's rule.
+ let es = LANGS.iter().position(|l| l.code == "es").unwrap();
let la = LANGS.iter().position(|l| l.code == "es-419").unwrap();
- assert_eq!(counted(la, "{n} layers", 1), "{n} capa");
- assert_eq!(counted(la, "{n} layers", 21), "{n} capas");
+ for n in [1, 21] {
+ assert_eq!(counted(la, "{n} layers", n), counted(es, "{n} layers", n), "{n}");
+ }
// Unsupported optional categories use other; existing one/other languages are unchanged.
for code in ["en", "es", "de"] {
for n in [0, 2, 11, 21, 1_000_000] {
diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs
index 5eb7d209..c7b10388 100644
--- a/crates/ui-egui/src/icons.rs
+++ b/crates/ui-egui/src/icons.rs
@@ -193,6 +193,17 @@ icons! {
LiveShared,
/// A file of yours on a server that only you get into: a point inside a closed ring.
LivePrivate,
+ /// A design file: a pen nib leaning to the left, its grip filled.
+ PenNib,
+ /// A board file (and the sticky note tool): a note with its bottom corner folded up.
+ Board,
+ /// Board tools: a chisel-tipped marker; a broad highlighter over its band; a connector
+ /// between two boxes; shapes (a square behind a circle); a stamp (a badge with a check).
+ Marker,
+ Highlighter,
+ Connector,
+ Shapes,
+ Stamp,
}
/// Points along a circular arc from angle `a0` to `a1` (radians, y down: increasing is clockwise).
@@ -1118,6 +1129,49 @@ fn draw(p: &P, icon: Icon) {
p.line(8.0, 6.0, 8.0, 9.5);
p.dot(8.0, 11.5, 0.9);
}
+ PenNib => {
+ // Drawn pointing down, then leant 35° to the left about the middle.
+ let (sin, cos) = (0.61f32, 0.79f32);
+ let at = |x: f32, y: f32| (8.0 + x * cos - y * sin, 8.0 + x * sin + y * cos);
+ let nib: Vec<(f32, f32)> = [(0.0, 6.5), (3.4, 1.0), (2.4, -2.5), (-2.4, -2.5), (-3.4, 1.0)].iter().map(|&(x, y)| at(x, y)).collect();
+ p.path(&nib, true);
+ let (a, b) = (at(0.0, 6.5), at(0.0, 2.0));
+ p.path(&[a, b], false);
+ let (dx, dy) = at(0.0, 0.6);
+ p.dot(dx, dy, 1.0);
+ let grip: Vec<(f32, f32)> = [(-2.4, -3.4), (2.4, -3.4), (2.4, -5.6), (-2.4, -5.6)].iter().map(|&(x, y)| at(x, y)).collect();
+ p.fill(&grip);
+ }
+ Board => {
+ p.poly(&[(2.5, 2.5), (13.5, 2.5), (13.5, 9.5), (9.5, 13.5), (2.5, 13.5)], true);
+ p.fill(&[(9.5, 13.5), (9.5, 9.5), (13.5, 9.5)]);
+ p.line(5.0, 6.5, 11.0, 6.5);
+ p.line(5.0, 9.5, 8.0, 9.5);
+ }
+ Marker => {
+ p.poly(&[(3.0, 13.0), (3.0, 10.5), (10.0, 3.5), (12.5, 6.0), (5.5, 13.0)], true);
+ p.line(8.5, 5.0, 11.0, 7.5);
+ p.fill(&[(2.0, 14.0), (2.0, 11.5), (4.5, 14.0)]);
+ }
+ Highlighter => {
+ p.poly(&[(4.0, 10.0), (10.5, 3.5), (13.5, 6.5), (7.0, 13.0)], true);
+ p.poly(&[(4.0, 10.0), (2.5, 12.5), (4.5, 12.5), (7.0, 13.0)], false);
+ p.fill_rect(1.0, 14.0, 15.0, 15.5, 0.0);
+ }
+ Connector => {
+ p.rect(1.5, 1.5, 6.5, 6.5, 1.0);
+ p.rect(9.5, 9.5, 14.5, 14.5, 1.0);
+ p.poly(&[(6.5, 4.0), (12.0, 4.0), (12.0, 9.0)], false);
+ p.head((12.0, 9.0), FRAC_PI_2, 2.4);
+ }
+ Shapes => {
+ p.rect(1.5, 5.5, 9.5, 13.5, 1.0);
+ p.circle(10.5, 5.5, 4.0);
+ }
+ Stamp => {
+ p.circle(8.0, 8.0, 6.0);
+ p.poly(&[(5.0, 8.3), (7.2, 10.5), (11.0, 6.0)], false);
+ }
Logo => {
// FigCraft's own mark: the curled tail of the chameleon on the app icon. One bold
// stroke: a shaft along the bottom, then three half turns, each tighter than the last.
@@ -1162,6 +1216,46 @@ pub fn button(ui: &mut egui::Ui, icon: Icon, size: f32, active: bool, tooltip: &
resp
}
+/// The mark of a file of `kind` on tabs and file rows: a pen nib for design files, a sticky note
+/// for boards.
+pub fn file_mark(kind: figcraft_doc::FileKind) -> Icon {
+ match kind {
+ figcraft_doc::FileKind::Design => Icon::PenNib,
+ figcraft_doc::FileKind::Board => Icon::Board,
+ }
+}
+
+/// SVG path data outlines on a `size`-unit box, painted into `rect`: each part filled, or
+/// stroked `width` box units wide. Board shapes and stamp marks are drawn this way in the UI from
+/// the same outlines the canvas has.
+pub fn paint_outlines(painter: &Painter, rect: Rect, size: f64, parts: &[(&figcraft_geom::BezPath, bool)], color: Color32, width: f32) {
+ let s = rect.width().min(rect.height()) / size as f32;
+ let px = 1.0 / painter.ctx().pixels_per_point();
+ let o = rect.center() - Vec2::splat(size as f32 * s / 2.0);
+ let p = P { painter, o, s, px, stroke: Stroke::new((width * s).max(px), color), color };
+ for (path, filled) in parts {
+ let mut sub: Vec<(f32, f32)> = Vec::new();
+ let flush = |sub: &mut Vec<(f32, f32)>, closed: bool| {
+ if sub.len() >= 2 {
+ if *filled { p.fill(sub) } else { p.path(sub, closed) }
+ }
+ sub.clear();
+ };
+ let mut closed = false;
+ figcraft_geom::kurbo::flatten(path.iter(), 0.25, |el| match el {
+ figcraft_geom::kurbo::PathEl::MoveTo(q) => {
+ flush(&mut sub, closed);
+ closed = false;
+ sub.push((q.x as f32, q.y as f32));
+ }
+ figcraft_geom::kurbo::PathEl::LineTo(q) => sub.push((q.x as f32, q.y as f32)),
+ figcraft_geom::kurbo::PathEl::ClosePath => closed = true,
+ _ => {}
+ });
+ flush(&mut sub, closed);
+ }
+}
+
/// Every icon at the sizes the UI uses, labelled: for reviewing the set (`ui.set {iconGallery}`).
pub fn gallery(ctx: &egui::Context) {
let t = crate::theme::Tokens::get(ctx);
diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs
index c93333b3..11fc307a 100644
--- a/crates/ui-egui/src/lib.rs
+++ b/crates/ui-egui/src/lib.rs
@@ -8,6 +8,7 @@
pub mod a11y;
pub mod assets_panel;
pub mod bidi;
+pub mod board_bar;
pub mod branch_ui;
pub mod canvas;
pub mod cjk;
@@ -69,6 +70,8 @@ pub mod versions;
pub mod widgets;
pub mod windows;
+#[cfg(test)]
+mod board_ui_tests;
#[cfg(test)]
mod theme_startup_tests;
@@ -99,6 +102,8 @@ mod design_paste_tests;
#[cfg(test)]
mod dev_mode_tests;
#[cfg(test)]
+mod devmode_tail_tests;
+#[cfg(test)]
mod duplicate_paint_tests;
#[cfg(test)]
mod export_preview_tests;
@@ -469,15 +474,16 @@ pub const PANEL_DEFAULT: f32 = 240.0;
pub const CANVAS_MIN: f32 = 160.0;
/// The widths the side panels are drawn at in `avail` points (the window less the icon rail), from
-/// the widths asked for (`left`: none while it is closed): each within its limits, and narrower
-/// in a small window so the canvas keeps [`CANVAS_MIN`] (the right panel gives way last).
-pub fn fit_panels(avail: f32, left: Option, right: f32) -> (f32, f32) {
+/// the widths asked for (none while a panel is closed, which takes no room): each within its
+/// limits, and narrower in a small window so the canvas keeps [`CANVAS_MIN`] (the right panel
+/// gives way last).
+pub fn fit_panels(avail: f32, left: Option, right: Option) -> (f32, f32) {
let fit = |w: f32, range: &std::ops::RangeInclusive, room: f32| {
let w = if w.is_finite() { w } else { PANEL_DEFAULT };
w.clamp(*range.start(), room.clamp(*range.start(), *range.end()))
};
let left_min = left.map_or(0.0, |_| *LEFT_PANEL.start());
- let right = fit(right, &RIGHT_PANEL, avail - left_min - CANVAS_MIN);
+ let right = right.map_or(0.0, |r| fit(r, &RIGHT_PANEL, avail - left_min - CANVAS_MIN));
(left.map_or(0.0, |l| fit(l, &LEFT_PANEL, avail - right - CANVAS_MIN)), right)
}
@@ -577,6 +583,8 @@ pub struct UiState {
pub dark: bool,
pub follow_system: bool,
pub tool_flyout: Option<&'static str>,
+ /// On a board: the Design panel is shown (boards hide it until asked for).
+ pub board_panel: bool,
pub last_error: Option,
/// Files dropped on the home screen or the canvas, opened once their card has been on screen
/// ([`pending_open::pending_opens`]), and the frames it has been drawn.
@@ -716,6 +724,7 @@ impl Default for UiState {
dark: false,
follow_system: false,
tool_flyout: None,
+ board_panel: false,
last_error: None,
pending_opens: Vec::new(),
pending_open_frames: 0,
@@ -937,6 +946,22 @@ impl FigApp {
}
}
+ /// Dev Mode (the Inspect tab): the canvas measures on hover without Alt and edits nothing;
+ /// entering it ends editing text or vectors.
+ fn sync_dev_mode(&mut self) {
+ let dev = self.ui.right_tab == RightTab::Inspect;
+ if dev && !self.session.tool.dev_mode {
+ let _ = self.session.drop_gesture();
+ let editing = self.session.ds().map(|d| (d.text_edit.is_some(), d.vector_edit.is_some())).unwrap_or_default();
+ for (on, cmd) in [(editing.0, "text.edit.end"), (editing.1, "vector.edit.end")] {
+ if on {
+ self.run(cmd, json!({}));
+ }
+ }
+ }
+ self.session.tool.dev_mode = dev;
+ }
+
/// Leaving Design ends a pen path as Escape does and goes back to Move: Prototype and Inspect
/// don't draw (#307). Checked as the frame starts (the control channel) and after the panels
/// and shortcuts (the mode switcher, the tabs, Shift+E/Shift+D), before the canvas sees more.
@@ -981,7 +1006,15 @@ impl FigApp {
"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" if self.session.doc().is_ok_and(figcraft_engine::board::is_board) => self.ui.board_panel = !self.ui.board_panel,
"panel.design" => self.ui.right_tab = RightTab::Design,
+ "board.editText" => {
+ if let Some(id) = r.data.get("id").and_then(figcraft_engine::params::id_of)
+ && let Err(e) = figcraft_engine::board::edit_text(&mut self.session, id)
+ {
+ self.toast(e.to_string());
+ }
+ }
"panel.prototype" => self.ui.right_tab = RightTab::Prototype,
"panel.designPrototype" => {
self.ui.right_tab = if self.ui.right_tab == RightTab::Prototype { RightTab::Design } else { RightTab::Prototype };
@@ -1009,7 +1042,7 @@ impl FigApp {
}
"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);
+ self.ui.dev.compare = dev_compare::CompareView::requested(&r.data);
}
"panel.libraries" => {
self.ui.left_tab = LeftTab::Assets;
@@ -1550,6 +1583,16 @@ impl FigApp {
}
}
+ /// Whether the right panel shows: never with the UI `hidden`; always on a design file; on a
+ /// board, which has no prototypes or Dev Mode (its tab stays Design), only when asked for.
+ fn right_panel_shown(&mut self, hidden: bool) -> bool {
+ let board = self.session.doc().is_ok_and(figcraft_engine::board::is_board);
+ if board {
+ self.ui.right_tab = RightTab::Design;
+ }
+ !hidden && (!board || self.ui.board_panel)
+ }
+
/// One frame of the window drawing now.
pub(crate) fn frame(&mut self, ui: &mut egui::Ui) {
let ctx = ui.ctx().clone();
@@ -1575,8 +1618,7 @@ impl FigApp {
}
theme::set_doc_profile(&ctx, self.session.doc().map_or(figcraft_color::ColorProfile::Srgb, |d| d.color_profile));
widgets::set_nudge(&ctx, self.session.prefs.nudge_small, self.session.prefs.nudge_big);
- // The Inspect tab measures on hover without Alt.
- self.session.tool.redlines = self.ui.right_tab == RightTab::Inspect;
+ self.sync_dev_mode();
self.end_pen_outside_design();
tabs::tab_bar(self, ui);
if self.ui.present.is_some() {
@@ -1602,6 +1644,7 @@ impl FigApp {
return;
}
let hidden = self.session.ds().map(|d| d.view.ui_hidden).unwrap_or(false);
+ let right_open = self.right_panel_shown(hidden);
if !hidden {
egui::Panel::left("left_rail")
.exact_size(56.0)
@@ -1614,7 +1657,7 @@ impl FigApp {
}
// The panels are as wide as asked, less in a window too small for them and the canvas.
let left_open = !hidden && !self.ui.left_collapsed;
- let (left_w, right_w) = fit_panels(ui.available_width(), left_open.then_some(self.ui.left_width), self.ui.right_width);
+ let (left_w, right_w) = fit_panels(ui.available_width(), left_open.then_some(self.ui.left_width), right_open.then_some(self.ui.right_width));
let rows = ui.available_rect_before_wrap().y_range();
let mut edges: Vec<(&str, f32, f32, f32)> = Vec::new();
if left_open {
@@ -1633,7 +1676,7 @@ impl FigApp {
layers::left_panel(self, ui)
});
}
- if !hidden {
+ if right_open {
edges.push(("right", ui.available_rect_before_wrap().max.x - right_w, right_w, -1.0));
egui::Panel::right("right_panel")
.resizable(false)
@@ -1772,7 +1815,7 @@ impl FigApp {
"variables": self.ui.variables.is_some(),
"versionHistory": self.ui.versions.open,
"branchReview": self.ui.branch_review.as_ref().map(|r| json!({"id": r.id, "picks": r.picks, "mode": if r.mode == dev_compare::Mode::Overlay { "overlay" } else { "sideBySide" }})),
- "devCompare": self.ui.dev.compare.as_ref().map(|c| json!({"id": c.id, "mode": if c.mode == dev_compare::Mode::Overlay { "overlay" } else { "sideBySide" }, "split": c.split})),
+ "devCompare": self.ui.dev.compare.as_ref().map(|c| json!({"id": c.id, "mode": if c.mode == dev_compare::Mode::Overlay { "overlay" } else { "sideBySide" }, "split": c.split, "version": c.version})),
"devFocus": self.session.ds().ok().and_then(figcraft_engine::DocState::focused),
"annotationFilter": self.ui.dev.categories.id(),
"colorProfileDialog": self.ui.color_profile.map(|p| p.id()),
diff --git a/crates/ui-egui/src/live_server_tests.rs b/crates/ui-egui/src/live_server_tests.rs
index 9c2cb22c..4a92edf0 100644
--- a/crates/ui-egui/src/live_server_tests.rs
+++ b/crates/ui-egui/src/live_server_tests.rs
@@ -25,7 +25,7 @@ fn focused(h: &Harness, id: &str) -> bool {
}
/// Joined through a server's link with `access`: the welcome and the document (a new tab).
-fn joined(h: &mut Harness, access: Access) {
+pub(crate) fn joined(h: &mut Harness, access: Access) {
h.app.session.execute("collab.join", &json!({"link": "figcraft://join?host=127.0.0.1:47900&file=f&token=AbCdEfGhIjKlMnOpQrStUv"})).unwrap();
let mut server = Server::new(h.app.session.doc().unwrap().clone(), "", Limits::default());
let ClientMsg::Hello(me) = Client::hello("f", "", "Ada", "") else { panic!("no hello") };
diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs
index 9659c6b3..c48fa401 100644
--- a/crates/ui-egui/src/menus.rs
+++ b/crates/ui-egui/src/menus.rs
@@ -35,9 +35,13 @@ pub const UI_COMMANDS: &[&str] = &[
/// `event_text` is the text the platform handed over with the paste event (the browser has no
/// other way to read it). `at`: the page point to paste at (Paste here); `None` pastes in the
/// middle of the view.
+/// In Dev Mode only a comment's link pastes (it opens the thread); everything else would edit.
pub fn paste(app: &mut FigApp, event_text: Option<&str>, at: Option<(f64, f64)>) {
// 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 dev_mode_refuses(app, "edit.paste") {
+ return;
+ }
let mut params = json!({"html": html});
if let Some((x, y)) = at {
params["x"] = json!(x);
@@ -58,6 +62,9 @@ pub fn paste(app: &mut FigApp, event_text: Option<&str>, at: Option<(f64, f64)>)
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) {
+ if dev_mode_refuses(app, "edit.paste") {
+ return;
+ }
use base64::Engine as _;
let b64 = base64::engine::general_purpose::STANDARD.encode(png);
// Centred in the view; Paste here puts its top-left at the point, as it does layers.
@@ -67,20 +74,28 @@ pub fn paste(app: &mut FigApp, event_text: Option<&str>, at: Option<(f64, f64)>)
}
// Text from elsewhere when it's newer than our copy, or when we have nothing to paste.
if let Some(text) = sys_text.filter(|_| app.ui.last_copy.is_some() || app.session.clipboard.nodes.is_empty()) {
- // A comment's link opens its thread.
- if text.trim().starts_with("figcraft://comment/") {
- app.run("comment.open", json!({"link": text.trim()}));
- } 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_user("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;
+ return paste_text(app, &text, (cx, cy), at.is_none());
}
}
- app.run("edit.paste", at.map_or(json!({}), |(x, y)| json!({"x": x, "y": y})));
+ if !dev_mode_refuses(app, "edit.paste") {
+ app.run("edit.paste", at.map_or(json!({}), |(x, y)| json!({"x": x, "y": y})));
+ }
+}
+
+/// Paste text from another app at `(cx, cy)` (`center`: centred there): a comment's link opens its
+/// thread, SVG imports, anything else becomes a text layer.
+fn paste_text(app: &mut FigApp, text: &str, (cx, cy): (f64, f64), center: bool) {
+ if text.trim().starts_with("figcraft://comment/") {
+ app.run("comment.open", json!({"link": text.trim()}));
+ } else if dev_mode_refuses(app, "edit.paste") {
+ // Dev Mode: the note says why nothing was pasted.
+ } 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_user("file.import", json!({"data": b64, "name": "Pasted SVG.svg", "x": cx, "y": cy, "center": center}));
+ } else {
+ app.run("text.create", json!({"text": text, "x": cx, "y": cy}));
+ }
}
/// The system clipboard's image as PNG bytes, with its size.
@@ -92,6 +107,18 @@ fn clipboard_png(app: &mut FigApp) -> Option<(Vec, u32, u32)> {
Some((out.into_inner(), w, h))
}
+/// Dev Mode (the Inspect tab) refuses command `id` from the menus, shortcuts and clipboard: it
+/// edits the design ([`figcraft_engine::devinspect::dev_mode_allows`]). Says so when it does.
+/// shortcut: the layers panel (rename, reorder, hide, lock) and files dropped on the canvas still
+/// edit in Dev Mode; route them through here if people trip over it.
+pub fn dev_mode_refuses(app: &mut FigApp, id: &str) -> bool {
+ let refused = app.ui.right_tab == crate::RightTab::Inspect && !figcraft_engine::devinspect::dev_mode_allows(id);
+ if refused {
+ app.toast(tr("Dev Mode only inspects: switch to Design (Shift+D) to edit"));
+ }
+ refused
+}
+
/// The Actions palette's tab.
#[derive(Clone, Copy, PartialEq, Eq, Default)]
pub enum PaletteTab {
@@ -115,6 +142,9 @@ pub fn record_recent(app: &mut FigApp, key: &str) {
/// 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) {
+ if dev_mode_refuses(app, id) {
+ return;
+ }
match id {
// Edit ▸ Delete (and the Delete binding) with an interaction open in the Prototype tab
// removes that interaction, not the layer (#767).
@@ -133,6 +163,10 @@ pub fn invoke(app: &mut FigApp, id: &str) {
app.run(id, json!({}));
}
"file.open" => app.open_dialog(),
+ // From the keyboard or a menu, typing goes on in the new sticky.
+ "board.nextSticky" => {
+ app.run(id, json!({"edit": true}));
+ }
"plugin.import" => crate::plugins_ui::import_dialog(app),
"file.import" => app.import_dialog(false),
"file.placeImage" => app.import_dialog(true),
@@ -1032,7 +1066,7 @@ fn palette(app: &mut FigApp, ctx: &egui::Context) {
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 bar_w = crate::toolbar::bar_width(app);
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;
diff --git a/crates/ui-egui/src/panel_width_tests.rs b/crates/ui-egui/src/panel_width_tests.rs
index a5a84d04..882a97a7 100644
--- a/crates/ui-egui/src/panel_width_tests.rs
+++ b/crates/ui-egui/src/panel_width_tests.rs
@@ -67,16 +67,17 @@ fn panels_fit_the_window() {
let (l0, l1, r0, r1) = (*LEFT_PANEL.start(), *LEFT_PANEL.end(), *RIGHT_PANEL.start(), *RIGHT_PANEL.end());
// (room beside the icon rail, left asked (none: closed), right asked) → (left, right) drawn
let rows = [
- ((1384.0, Some(240.0), 240.0), (240.0, 240.0), "as asked in a wide window"),
- ((1384.0, Some(100.0), 100.0), (l0, r0), "never narrower than their least"),
- ((1384.0, Some(900.0), 900.0), (l1, r1), "never wider than their most"),
- ((1384.0, None, 300.0), (0.0, 300.0), "the left panel closed"),
- ((744.0, Some(240.0), 240.0), (240.0, 240.0), "the smallest window with the default widths"),
- ((744.0, Some(480.0), 480.0), (l0, 744.0 - l0 - CANVAS_MIN), "the smallest window: the left panel gives way first, then the right"),
- ((744.0, Some(480.0), 240.0), (744.0 - 240.0 - CANVAS_MIN, 240.0), "the left panel gives the canvas its room"),
- ((744.0, None, 480.0), (0.0, 480.0), "with the left panel closed the right one has room"),
- ((300.0, Some(240.0), 240.0), (l0, r0), "a window smaller than any layout: the least widths"),
- ((1384.0, Some(f32::NAN), f32::INFINITY), (PANEL_DEFAULT, PANEL_DEFAULT), "junk widths: the default"),
+ ((1384.0, Some(240.0), Some(240.0)), (240.0, 240.0), "as asked in a wide window"),
+ ((1384.0, Some(100.0), Some(100.0)), (l0, r0), "never narrower than their least"),
+ ((1384.0, Some(900.0), Some(900.0)), (l1, r1), "never wider than their most"),
+ ((1384.0, None, Some(300.0)), (0.0, 300.0), "the left panel closed"),
+ ((744.0, Some(240.0), Some(240.0)), (240.0, 240.0), "the smallest window with the default widths"),
+ ((744.0, Some(480.0), Some(480.0)), (l0, 744.0 - l0 - CANVAS_MIN), "the smallest window: the left panel gives way first, then the right"),
+ ((744.0, Some(480.0), Some(240.0)), (744.0 - 240.0 - CANVAS_MIN, 240.0), "the left panel gives the canvas its room"),
+ ((744.0, None, Some(480.0)), (0.0, 480.0), "with the left panel closed the right one has room"),
+ ((300.0, Some(240.0), Some(240.0)), (l0, r0), "a window smaller than any layout: the least widths"),
+ ((1384.0, Some(f32::NAN), Some(f32::INFINITY)), (PANEL_DEFAULT, PANEL_DEFAULT), "junk widths: the default"),
+ ((744.0, Some(480.0), None), (480.0, 0.0), "the right panel closed (a board's): the left one keeps its width"),
];
for ((avail, left, right), want, why) in rows {
assert_eq!(fit_panels(avail, left, right), want, "{why}");
@@ -85,7 +86,7 @@ fn panels_fit_the_window() {
for avail in [744.0, 900.0, 1384.0] {
for left in [None, Some(l0), Some(300.0), Some(l1)] {
for right in [r0, 333.0, r1] {
- let (l, r) = fit_panels(avail, left, right);
+ let (l, r) = fit_panels(avail, left, Some(right));
assert!(avail - l - r >= CANVAS_MIN, "{avail} {left:?} {right}: canvas {}", avail - l - r);
}
}
diff --git a/crates/ui-egui/src/plugin_panel_tests.rs b/crates/ui-egui/src/plugin_panel_tests.rs
index f154c629..e4bc6d4f 100644
--- a/crates/ui-egui/src/plugin_panel_tests.rs
+++ b/crates/ui-egui/src/plugin_panel_tests.rs
@@ -13,7 +13,7 @@ use crate::layers_drag_tests::Ui;
/// A plugin whose first call shows a panel with every kind of control and whose later calls (the
/// panel's events) make a rectangle.
-fn panel_module() -> Vec {
+pub(crate) fn panel_module() -> Vec {
let spec = json!({"title": "Test panel", "controls": [
{"type": "note", "label": "Hello from the plugin"},
{"type": "number", "name": "size", "label": "Size", "value": 10},
diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs
index c86cfdf1..38b8f0dc 100644
--- a/crates/ui-egui/src/shortcuts.rs
+++ b/crates/ui-egui/src/shortcuts.rs
@@ -210,6 +210,8 @@ pub fn swallowed_paste(app: &mut FigApp, ctx: &Context) -> Swallowed {
/// 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) {
+ // Dev Mode places and edits nothing: Enter selects children.
+ let dev = app.ui.right_tab == crate::RightTab::Inspect;
match id {
"select.none" => {
if let Some(ctx) = &app.ui_context
@@ -226,10 +228,10 @@ pub fn run_binding(app: &mut FigApp, id: &str) {
let _ = app.session.pen_finish();
}
// 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() => {
+ "select.children" if !dev && app.session.tool.tool.draws_shape() => {
app.run("tool.place", json!({}));
}
- "select.children" if enter_text(app) => {}
+ "select.children" if !dev && enter_text(app) => {}
_ => crate::menus::invoke(app, id),
}
}
@@ -291,6 +293,8 @@ fn key_event(app: &mut FigApp, key: Key, physical: Option, m: Modifiers, re
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 crate::menus::dev_mode_refuses(app, "transform.nudge") {
+ // Dev Mode: said so, nothing moves.
} else if m.command {
// Cmd/Ctrl+arrows resize: right/down grow, left/up shrink.
app.run("transform.nudgeSize", json!({"dw": dx, "dh": dy, "big": m.shift}));
@@ -387,6 +391,9 @@ pub fn opacity_digit(app: &mut FigApp, key: Key, now: f64) -> bool {
if !app.session.prefs.number_keys_opacity || app.session.selection().is_empty() {
return false;
}
+ if crate::menus::dev_mode_refuses(app, "object.opacityKeys") {
+ return true;
+ }
let first = app.ui.opacity_digit.take().filter(|(_, t)| now - t <= OPACITY_CHAIN_SECS).map(|(d, _)| d);
let digits = match first {
Some(f) => format!("{f}{d}"),
@@ -413,6 +420,15 @@ fn enter_text(app: &mut FigApp) -> bool {
return false;
}
let Some(id) = sel.first().copied() else { return false };
+ // A board object (a sticky, a shape with text, a label): type in its text.
+ match figcraft_engine::board::edit_text(&mut app.session, id) {
+ Ok(true) => return true,
+ Ok(false) => {}
+ Err(e) => {
+ app.toast(e.to_string());
+ return true;
+ }
+ }
let kind = app.session.doc().ok().and_then(|d| d.node(id)).map(|n| (matches!(n.kind, figcraft_doc::NodeKind::Text(_)), n.kind.is_shape()));
match kind {
Some((true, _)) => {
diff --git a/crates/ui-egui/src/tabs.rs b/crates/ui-egui/src/tabs.rs
index c10edcfd..3a4e9ecb 100644
--- a/crates/ui-egui/src/tabs.rs
+++ b/crates/ui-egui/src/tabs.rs
@@ -212,7 +212,7 @@ pub fn tab_bar(app: &mut FigApp, ui: &mut Ui) {
icons::paint(
&painter,
Rect::from_center_size(pos2(paint_r.min.x + 18.0, paint_r.center().y), vec2(14.0, 14.0)),
- Icon::Logo,
+ icons::file_mark(d.doc.kind),
crate::theme::ACCENT.linear_multiply(progress),
);
// The unsaved-changes dot follows the name on screen, whichever way the name reads.
diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs
index d92cdf06..b95575b8 100644
--- a/crates/ui-egui/src/toolbar.rs
+++ b/crates/ui-egui/src/toolbar.rs
@@ -28,23 +28,35 @@ struct Group {
/// The flyout button's name for screen readers.
name: &'static str,
tools: &'static [(ToolId, Icon)],
+ /// What a one-tool group's flyout offers instead of tools (boards: colours, shapes, stamps).
+ options: Options,
+}
+
+/// The choices a board tool's flyout shows.
+#[derive(Clone, Copy, PartialEq, Eq)]
+pub(crate) enum Options {
+ None,
+ Colors,
+ Shapes,
+ Stamps,
+}
+
+impl Group {
+ const fn tools(key: &'static str, name: &'static str, tools: &'static [(ToolId, Icon)]) -> Group {
+ Group { key, name, tools, options: Options::None }
+ }
+ fn has_flyout(&self) -> bool {
+ self.tools.len() > 1 || self.options != Options::None
+ }
}
const GROUPS: &[Group] = &[
- Group {
- key: "move",
- name: tr_noop("Move tools"),
- tools: &[(ToolId::Move, Icon::Move), (ToolId::Hand, Icon::Hand), (ToolId::Scale, Icon::Scale)],
- },
- Group {
- key: "frame",
- name: tr_noop("Frame tools"),
- tools: &[(ToolId::Frame, Icon::Frame), (ToolId::Section, Icon::Section), (ToolId::Slice, Icon::Slice)],
- },
- Group {
- key: "shape",
- name: tr_noop("Shape tools"),
- tools: &[
+ Group::tools("move", tr_noop("Move tools"), &[(ToolId::Move, Icon::Move), (ToolId::Hand, Icon::Hand), (ToolId::Scale, Icon::Scale)]),
+ Group::tools("frame", tr_noop("Frame tools"), &[(ToolId::Frame, Icon::Frame), (ToolId::Section, Icon::Section), (ToolId::Slice, Icon::Slice)]),
+ Group::tools(
+ "shape",
+ tr_noop("Shape tools"),
+ &[
(ToolId::Rectangle, Icon::Rectangle),
(ToolId::Line, Icon::Line),
(ToolId::Arrow, Icon::Arrow),
@@ -52,14 +64,31 @@ const GROUPS: &[Group] = &[
(ToolId::Polygon, Icon::Polygon),
(ToolId::Star, Icon::Star),
],
- },
- Group {
- key: "pen",
- name: tr_noop("Drawing tools"),
- tools: &[(ToolId::Pen, Icon::Pen), (ToolId::Pencil, Icon::Pencil), (ToolId::ShapeBuilder, Icon::ShapeBuilder)],
- },
- Group { key: "text", name: tr_noop("Text"), tools: &[(ToolId::Text, Icon::Text)] },
- Group { key: "comment", name: tr_noop("Comment"), tools: &[(ToolId::Comment, Icon::Comment)] },
+ ),
+ Group::tools(
+ "pen",
+ tr_noop("Drawing tools"),
+ &[(ToolId::Pen, Icon::Pen), (ToolId::Pencil, Icon::Pencil), (ToolId::ShapeBuilder, Icon::ShapeBuilder)],
+ ),
+ Group::tools("text", tr_noop("Text"), &[(ToolId::Text, Icon::Text)]),
+ Group::tools("comment", tr_noop("Comment"), &[(ToolId::Comment, Icon::Comment)]),
+];
+
+/// A board's toolbar: moving around, ink, stickies, shapes, connectors, text, sections, stamps.
+const BOARD_GROUPS: &[Group] = &[
+ Group::tools("bmove", tr_noop("Move tools"), &[(ToolId::Move, Icon::Move), (ToolId::Hand, Icon::Hand)]),
+ Group::tools(
+ "ink",
+ tr_noop("Drawing tools"),
+ &[(ToolId::Marker, Icon::Marker), (ToolId::Highlighter, Icon::Highlighter), (ToolId::Eraser, Icon::Eraser)],
+ ),
+ Group { key: "sticky", name: tr_noop("Sticky note colors"), tools: &[(ToolId::Sticky, Icon::Board)], options: Options::Colors },
+ Group { key: "bshape", name: tr_noop("Shapes"), tools: &[(ToolId::BoardShape, Icon::Shapes)], options: Options::Shapes },
+ Group::tools("connector", tr_noop("Connector"), &[(ToolId::Connector, Icon::Connector)]),
+ Group::tools("text", tr_noop("Text"), &[(ToolId::Text, Icon::Text)]),
+ Group::tools("section", tr_noop("Section"), &[(ToolId::Section, Icon::Section)]),
+ Group { key: "stamp", name: tr_noop("Stamps"), tools: &[(ToolId::Stamp, Icon::Stamp)], options: Options::Stamps },
+ Group::tools("comment", tr_noop("Comment"), &[(ToolId::Comment, Icon::Comment)]),
];
fn remembered(ui: &Ui, key: &str, default: ToolId) -> ToolId {
@@ -85,73 +114,120 @@ pub fn show(app: &mut FigApp, ui: &mut Ui) {
builder_toolbar(app, ui);
return;
}
- main_toolbar(app, ui, canvas, &t);
+ let board = app.session.doc().is_ok_and(figcraft_engine::board::is_board);
+ main_toolbar(app, ui, canvas, &t, board);
}
-/// 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
+/// The main toolbar pill's width for the active file: the Actions palette matches it so the two
+/// read as one bar.
+pub(crate) fn bar_width(app: &FigApp) -> f32 {
+ let board = app.session.doc().is_ok_and(figcraft_engine::board::is_board);
+ main_width(if board { BOARD_GROUPS } else { GROUPS }, board)
+}
+
+/// The main toolbar pill's width: the tool groups with their flyout carets, Resources and
+/// Actions, and the mode switcher (boards: the Design panel's button instead).
+fn main_width(groups: &[Group], board: bool) -> f32 {
+ let (cell, gap) = (TOOL_CELL, 4.0);
+ let carets = groups.iter().filter(|g| g.has_flyout()).count() as f32 * 10.0;
+ let end = if board { cell + 16.0 } else { 4.0 * 34.0 + 24.0 };
+ groups.len() as f32 * (cell + gap) + carets + 2.0 * (cell + gap) + 16.0 + end
}
/// 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();
- 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;
+/// Draw · Design · Prototype · Inspect mode switcher (on a board, the Design panel's button).
+fn main_toolbar(app: &mut FigApp, ui: &mut Ui, canvas: Rect, t: &Tokens, board: bool) {
+ let groups = if board { BOARD_GROUPS } else { GROUPS };
+ let rect = pill(ui, &mut app.ui.nav, canvas, main_width(groups, board), t);
let cy = rect.center().y;
- for g in GROUPS {
- let in_group = g.tools.iter().any(|(tid, _)| *tid == current);
- 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())));
- if in_group {
- a11y::prefer(&mut app.ui.nav, Region::Toolbar, resp.id);
+ let mut x = rect.min.x + 8.0;
+ for g in groups {
+ x = group_cell(app, ui, g, pos2(x, cy), rect.min.y, t);
+ }
+ x = side_buttons(app, ui, x, cy, t);
+ divider(ui, t, x, cy);
+ x += 8.0;
+ if board {
+ // Boards have no prototypes or Dev Mode; the Design panel is hidden until asked for.
+ let r = Rect::from_center_size(pos2(x + TOOL_CELL / 2.0, cy), vec2(TOOL_CELL, TOOL_CELL));
+ let tip = crate::shortcuts::tip(tr("Design panel"), "view.design");
+ if tool_cell(ui, t, r, "board_panel", Icon::Panels, app.ui.board_panel, tip).clicked() {
+ app.run("view.design", json!({}));
}
- if resp.clicked() {
- // Enter (a keyboard click) on the shape or frame tool already chosen places one; the
- // canvas takes the keyboard.
- if in_group && shown.draws_shape() && ui.input(|i| i.key_pressed(egui::Key::Enter)) {
- app.run("tool.place", json!({}));
- app.ui.nav.go(Region::Canvas);
- } else {
- app.run("tool.set", json!({"tool": shown.id()}));
- }
- }
- x += cell;
- // Flyout chevron.
- if g.tools.len() > 1 {
- let cr = Rect::from_center_size(pos2(x + 5.0, cy), vec2(10.0, cell));
- let cresp = ui.interact(cr, ui.id().with(("flyout", g.key)), Sense::click());
- let open = app.ui.tool_flyout == Some(g.key);
- a11y::menu_button(&cresp, tr(g.name), open);
- if open {
- a11y::popup(&mut app.ui.nav, cresp.id, flyout_id(g.key));
- }
- if cresp.hovered() {
- ui.painter().rect_filled(cr, CornerRadius::same(4), t.hover);
- }
- 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) };
- }
- x += 10.0;
- }
- x += gap;
- if app.ui.tool_flyout == Some(g.key) {
- flyout(app, ui, g, pos2(r.min.x, rect.min.y - 8.0));
+ } else {
+ mode_switcher(app, ui, x, cy, t);
+ }
+ help_button(app, ui, canvas, t);
+}
+
+/// A toolbar button's size.
+const TOOL_CELL: f32 = 32.0;
+
+/// Tool group `g` at `at` (its left edge, the pill's middle): the shown tool's button, its flyout
+/// caret and, while open, its flyout above the pill (whose top is `top`). Where the next starts.
+fn group_cell(app: &mut FigApp, ui: &mut Ui, g: &Group, at: egui::Pos2, top: f32, t: &Tokens) -> f32 {
+ let current = app.session.tool.tool;
+ let in_group = g.tools.iter().any(|(tid, _)| *tid == current);
+ 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(at.x + TOOL_CELL / 2.0, at.y), vec2(TOOL_CELL, TOOL_CELL));
+ 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);
+ }
+ if resp.clicked() {
+ // Enter (a keyboard click) on the shape or frame tool already chosen places one; the
+ // canvas takes the keyboard.
+ // In Dev Mode the tool goes through `choose`, which returns to the design first.
+ if in_group && shown.draws_shape() && app.ui.right_tab != crate::RightTab::Inspect && ui.input(|i| i.key_pressed(egui::Key::Enter)) {
+ app.run("tool.place", json!({}));
+ app.ui.nav.go(Region::Canvas);
+ } else {
+ choose(app, shown);
}
}
- // Resources (components, plugins) opens the Assets panel; Actions palette.
+ let mut x = at.x + TOOL_CELL;
+ if g.has_flyout() {
+ flyout_caret(app, ui, g, pos2(x, at.y), t);
+ x += 10.0;
+ }
+ if app.ui.tool_flyout == Some(g.key) {
+ if g.options == Options::None {
+ flyout(app, ui, g, pos2(r.min.x, top - 8.0));
+ } else {
+ options_flyout(app, ui, g, pos2(r.min.x, top - 8.0));
+ }
+ }
+ x + 4.0
+}
+
+/// The caret after group `g`'s button (at `at`, its left edge and middle): opens or closes its
+/// flyout.
+fn flyout_caret(app: &mut FigApp, ui: &mut Ui, g: &Group, at: egui::Pos2, t: &Tokens) {
+ let cr = Rect::from_center_size(pos2(at.x + 5.0, at.y), vec2(10.0, TOOL_CELL));
+ let cresp = ui.interact(cr, ui.id().with(("flyout", g.key)), Sense::click());
+ let open = app.ui.tool_flyout == Some(g.key);
+ a11y::menu_button(&cresp, tr(g.name), open);
+ if open {
+ a11y::popup(&mut app.ui.nav, cresp.id, flyout_id(g.key));
+ }
+ if cresp.hovered() {
+ ui.painter().rect_filled(cr, CornerRadius::same(4), t.hover);
+ }
+ 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 open { None } else { Some(g.key) };
+ }
+}
+
+/// Resources (components, plugins: the Assets panel) and the Actions palette's button, from `x`.
+/// Where the next part starts.
+fn side_buttons(app: &mut FigApp, ui: &mut Ui, mut x: f32, cy: f32, t: &Tokens) -> f32 {
for (icon, tip, id) in [
(Icon::Assets, crate::shortcuts::key_tip(tr("Resources"), "Shift+I"), "resources"),
(Icon::Actions, crate::shortcuts::tip(tr("Actions"), "app.actions"), "actions"),
] {
- let r = Rect::from_center_size(pos2(x + cell / 2.0, cy), vec2(cell, cell));
+ let r = Rect::from_center_size(pos2(x + TOOL_CELL / 2.0, cy), vec2(TOOL_CELL, TOOL_CELL));
let resp = ui.interact(r, ui.id().with(id), Sense::click()).tip(tip);
if id == "actions" {
app.ui.actions_rect = Some(r);
@@ -171,11 +247,13 @@ fn main_toolbar(app: &mut FigApp, ui: &mut Ui, canvas: Rect, t: &Tokens) {
app.run("view.assets", json!({}));
}
}
- x += cell + 4.0;
+ x += TOOL_CELL + 4.0;
}
- divider(ui, t, x, cy);
- x += 8.0;
- // Mode switcher: Draw · Design · Prototype · Inspect (code).
+ x
+}
+
+/// The mode switcher from `x`: Draw · Design · Prototype · Inspect (code).
+fn mode_switcher(app: &mut FigApp, ui: &mut Ui, x: f32, cy: f32, t: &Tokens) {
let modes = [(Icon::Pencil, tr("Draw")), (Icon::Frame, tr("Design")), (Icon::Prototype, tr("Prototype")), (Icon::Code, tr("Inspect"))];
let active = match app.ui.right_tab {
crate::RightTab::Design if app.session.tool.tool == ToolId::Pencil => 0,
@@ -197,23 +275,31 @@ fn main_toolbar(app: &mut FigApp, ui: &mut Ui, canvas: Rect, t: &Tokens) {
}
icons::paint(ui.painter(), glyph_rect(r), *icon, if i == active { t.accent_text } else { t.icon_secondary });
if resp.clicked() {
- match i {
- 0 => {
- app.ui.right_tab = crate::RightTab::Design;
- app.run("tool.set", json!({"tool": "pencil"}));
- }
- 1 => {
- app.ui.right_tab = crate::RightTab::Design;
- if app.session.tool.tool == ToolId::Pencil {
- app.run("tool.set", json!({"tool": "move"}));
- }
- }
- 2 => app.ui.right_tab = crate::RightTab::Prototype,
- _ => app.ui.right_tab = crate::RightTab::Inspect,
- }
+ pick_mode(app, i);
}
}
- // Floating help button at the bottom right of the canvas.
+}
+
+/// Mode `i` of the switcher chosen.
+fn pick_mode(app: &mut FigApp, i: usize) {
+ match i {
+ 0 => {
+ app.ui.right_tab = crate::RightTab::Design;
+ app.run("tool.set", json!({"tool": "pencil"}));
+ }
+ 1 => {
+ app.ui.right_tab = crate::RightTab::Design;
+ if app.session.tool.tool == ToolId::Pencil {
+ app.run("tool.set", json!({"tool": "move"}));
+ }
+ }
+ 2 => app.ui.right_tab = crate::RightTab::Prototype,
+ _ => app.ui.right_tab = crate::RightTab::Inspect,
+ }
+}
+
+/// The floating help button at the bottom right of the canvas.
+fn help_button(app: &mut FigApp, ui: &mut Ui, canvas: Rect, t: &Tokens) {
let hr = Rect::from_center_size(pos2(canvas.max.x - 32.0, canvas.max.y - 32.0), vec2(32.0, 32.0));
let hresp = ui.interact(hr, ui.id().with("help"), Sense::click()).tip(tr("Help and resources"));
ui.painter().circle_filled(hr.center() + vec2(0.0, 1.0), 17.0, Color32::from_black_alpha(20));
@@ -380,7 +466,7 @@ fn pill(ui: &Ui, nav: &mut Nav, canvas: Rect, width: f32, t: &Tokens) -> Rect {
}
/// A square tool button: accent when active, tinted on hover; `tip` is its tooltip and name.
-fn tool_cell(ui: &mut Ui, t: &Tokens, r: Rect, id: impl egui::AsIdSalt, icon: Icon, active: bool, tip: &str) -> egui::Response {
+pub(crate) fn tool_cell(ui: &mut Ui, t: &Tokens, r: Rect, id: impl egui::AsIdSalt, icon: Icon, active: bool, tip: &str) -> egui::Response {
let resp = ui.interact(r, ui.id().with(id), Sense::click()).on_hover_ui(|ui| {
ui.label(tip);
});
@@ -414,6 +500,41 @@ fn done_button(ui: &mut Ui, t: &Tokens, x: f32, cy: f32, tip: &str) -> bool {
resp.clicked()
}
+/// A board tool's flyout: the colours, shapes or stamps it places, in a row. A pick chooses the
+/// tool with it.
+fn options_flyout(app: &mut FigApp, ui: &mut Ui, g: &Group, bottom_left: egui::Pos2) {
+ let t = Tokens::get(ui.ctx());
+ let Some(&(tool, _)) = g.tools.first() else { return };
+ let items = crate::board_bar::choices(g.options, &app.session.tool.board);
+ let (cell, pad) = (32.0, 8.0);
+ let size = vec2(items.len() as f32 * (cell + 4.0) - 4.0 + 2.0 * pad, cell + 2.0 * pad);
+ let mut chosen = None;
+ egui::Area::new(flyout_id(g.key)).fixed_pos(pos2(bottom_left.x, bottom_left.y - size.y)).order(egui::Order::Foreground).show(ui.ctx(), |ui| {
+ let (rect, _) = ui.allocate_exact_size(size, Sense::hover());
+ ui.painter().rect_filled(rect, CornerRadius::same(13), t.menu);
+ for (i, c) in items.iter().enumerate() {
+ let r = Rect::from_min_size(pos2(rect.min.x + pad + i as f32 * (cell + 4.0), rect.min.y + pad), vec2(cell, cell));
+ let resp = ui.interact(r, ui.id().with(("opt", g.key, i)), Sense::click()).on_hover_text(tr(c.label));
+ a11y::menu_item(&resp, tr(c.label), "", Some(c.on));
+ a11y::own_focus(&resp);
+ if c.on || resp.hovered() || resp.has_focus() {
+ ui.painter().rect_filled(r, CornerRadius::same(5), t.menu_hover);
+ }
+ crate::board_bar::paint_choice(ui.painter(), r.shrink(5.0), &c.mark, t.menu_text);
+ if resp.clicked() {
+ chosen = Some(c.params.clone());
+ }
+ }
+ });
+ if ui.input(|i| i.key_pressed(egui::Key::Escape)) {
+ app.ui.tool_flyout = None;
+ }
+ if let Some(params) = chosen {
+ app.run(&format!("tool.{}", tool.id()), params);
+ app.ui.tool_flyout = None;
+ }
+}
+
fn flyout(app: &mut FigApp, ui: &mut Ui, g: &Group, bottom_left: egui::Pos2) {
let t = Tokens::get(ui.ctx());
let item_h = 32.0;
@@ -452,11 +573,20 @@ fn flyout(app: &mut FigApp, ui: &mut Ui, g: &Group, bottom_left: egui::Pos2) {
if let Some(i) = ToolId::ALL.iter().position(|x| *x == tid) {
ui.data_mut(|d| d.insert_temp(egui::Id::new(("tb_last", g.key)), i as u8));
}
- app.run("tool.set", json!({"tool": tid.id()}));
+ choose(app, tid);
app.ui.tool_flyout = None;
}
}
+/// Choose `tool` from the toolbar. Dev Mode only inspects: a tool that edits leaves it for the
+/// design.
+fn choose(app: &mut FigApp, tool: ToolId) {
+ if app.ui.right_tab == crate::RightTab::Inspect && !matches!(tool, ToolId::Move | ToolId::Hand | ToolId::Comment) {
+ app.ui.right_tab = crate::RightTab::Design;
+ }
+ app.run("tool.set", json!({"tool": tool.id()}));
+}
+
/// A tool group's flyout (an egui area).
fn flyout_id(key: &str) -> egui::Id {
egui::Id::new(("flyout_area", key))
diff --git a/crates/ui-egui/tests/canvas_pan_release.rs b/crates/ui-egui/tests/it/canvas_pan_release.rs
similarity index 98%
rename from crates/ui-egui/tests/canvas_pan_release.rs
rename to crates/ui-egui/tests/it/canvas_pan_release.rs
index c54d20dc..cd1a6e1c 100644
--- a/crates/ui-egui/tests/canvas_pan_release.rs
+++ b/crates/ui-egui/tests/it/canvas_pan_release.rs
@@ -1,6 +1,5 @@
//! A canvas pan (middle button or Space + primary) ends when its button is released, even when the
//! release happens over a panel: returning to the canvas with no button held must not move the view.
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
use egui::{Event, Key, PointerButton, Pos2, RawInput, Rect, vec2};
use figcraft_engine::Session;
diff --git a/crates/ui-egui/tests/comment_open_other_page.rs b/crates/ui-egui/tests/it/comment_open_other_page.rs
similarity index 100%
rename from crates/ui-egui/tests/comment_open_other_page.rs
rename to crates/ui-egui/tests/it/comment_open_other_page.rs
diff --git a/crates/ui-egui/tests/file_menu_pdf.rs b/crates/ui-egui/tests/it/file_menu_pdf.rs
similarity index 97%
rename from crates/ui-egui/tests/file_menu_pdf.rs
rename to crates/ui-egui/tests/it/file_menu_pdf.rs
index 30b847b7..812529e0 100644
--- a/crates/ui-egui/tests/file_menu_pdf.rs
+++ b/crates/ui-egui/tests/it/file_menu_pdf.rs
@@ -1,6 +1,5 @@
//! File > Export frames to PDF: the menu asks where to save and writes the frames' PDF there,
//! one visible top-level frame per page.
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
use std::path::PathBuf;
diff --git a/crates/ui-egui/tests/guide_label_narrow.rs b/crates/ui-egui/tests/it/guide_label_narrow.rs
similarity index 97%
rename from crates/ui-egui/tests/guide_label_narrow.rs
rename to crates/ui-egui/tests/it/guide_label_narrow.rs
index 6c4276ad..464fbfed 100644
--- a/crates/ui-egui/tests/guide_label_narrow.rs
+++ b/crates/ui-egui/tests/it/guide_label_narrow.rs
@@ -1,5 +1,3 @@
-#![allow(clippy::unwrap_used)]
-
use egui::{Pos2, RawInput, Rect, Vec2, vec2};
use figcraft_engine::Session;
use figcraft_ui_egui::{FigApp, NoServices};
diff --git a/crates/ui-egui/tests/it/main.rs b/crates/ui-egui/tests/it/main.rs
new file mode 100644
index 00000000..007f450d
--- /dev/null
+++ b/crates/ui-egui/tests/it/main.rs
@@ -0,0 +1,11 @@
+//! The crate's integration tests, built as one test binary.
+
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod canvas_pan_release;
+mod comment_open_other_page;
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod file_menu_pdf;
+#[allow(clippy::unwrap_used)]
+mod guide_label_narrow;
+#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
+mod recent_file_names;
diff --git a/crates/ui-egui/tests/recent_file_names.rs b/crates/ui-egui/tests/it/recent_file_names.rs
similarity index 97%
rename from crates/ui-egui/tests/recent_file_names.rs
rename to crates/ui-egui/tests/it/recent_file_names.rs
index 461d0c73..41e37ec2 100644
--- a/crates/ui-egui/tests/recent_file_names.rs
+++ b/crates/ui-egui/tests/it/recent_file_names.rs
@@ -1,5 +1,4 @@
//! Recent file rows keep their full accessible name.
-#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
use egui::{Context, Id, Pos2, RawInput, Rect, accesskit::Role, vec2};
use figcraft_engine::Session;
diff --git a/docs/boards-parity.md b/docs/boards-parity.md
new file mode 100644
index 00000000..b6928dd7
--- /dev/null
+++ b/docs/boards-parity.md
@@ -0,0 +1,61 @@
+# Boards parity
+
+> **Last reviewed:** 2026-10-24 · **Last updated:** 2026-10-24 · **Change:** major (created: board files, the first slice of the whiteboard workflow) · **Target:** the incumbent's whiteboard product (behaviour from its public help centre)
+
+**Breadth ~35%, ready ~20% (estimated, erring low).** A board is a FigCraft file of its own kind
+(`file.newBoard`) with sticky notes, shapes with text, connectors that follow what they join,
+marker, highlighter and eraser, stamps, text and sections, edited together in the existing live
+sessions. The facilitation tools (timer, voting, widgets), templates, tables, mind maps and the
+rest of the tail are missing. Remaining: ~30–60 h. Tracked as area 22 of
+[`target-app-parity.md`](target-app-parity.md) (not in its weighted sum: the target there is the
+design product). The work item is gap 24 in [`gaps.md`](gaps.md).
+
+## How boards are built
+
+Board objects are ordinary layers with a small `board` field on the node (`figcraft_doc::BoardItem`),
+so rendering, hit testing, undo, saving, SVG/PNG/PDF export, copy and paste and live sessions work
+on them unchanged. The file kind (`Document.kind`) is saved in `.figcraft` and reaches people who
+join a live session in their snapshot. What follows from the metadata (a sticky's text size, a
+shape's text room, connector routes and their labels) is recomputed in the engine's normalize pass,
+deterministically from the document, so local edits, undo and edits from others in a live session
+all end with the same geometry.
+
+## Features
+
+| Feature | Status | Notes |
+|---|---|---|
+| Board files: File ▸ New board, the home screen's New board card, a light page | done | `file.newBoard`; the kind shows in `inspect_document`, tabs and file rows (a note mark; design files a pen nib) |
+| Board toolbar at the bottom | done | Move/Hand, Marker/Highlighter/Eraser, Sticky (colour flyout), Shapes (flyout), Connector, Text, Section, Stamp (flyout), Comment, Resources, Actions, the Design panel's button |
+| Design panel hidden by default; a contextual bar above the selection | done | colour, shape, text size (S/M/L/XL), connector straight/elbow and its arrow; the Design panel opens with its button or View ▸ Design panel |
+| Prototyping and Dev Mode refuse on boards | done | `proto.*`, `dev.*`, `view.prototype`, `view.devMode` say why |
+| Sticky notes | done | a square frame (200 wide, growing taller through auto layout), 8 soft colours, a soft shadow, the note's text size shrinking as it grows (24 → 11, by characters and lines), the author's name at the bottom; a click places one and starts typing; Enter or a double-click edits; Shift+Cmd/Ctrl+Enter adds the next one beside it |
+| Sticky options: hide the author, change size presets, sticky stacks | partial | `board.sticky {author: false}`; no size presets or stacks |
+| Shapes with text | done | rectangle, rounded rectangle, ellipse, diamond, triangle, speech bubble, chevron; text centred and wrapping inside the outline; shape type and text size from the contextual bar |
+| Shape auto-fit to its text, more shapes (cylinder, cross, star…), shape libraries | missing | |
+| Connectors | done | from a layer's side (the facing one, or one named) to another layer or a free point, straight or elbow, arrowheads (the stroke's caps), a label in the middle (double-click to add); re-routed when either end moves or resizes; a deleted end stays where it was |
+| Curved connectors, connector waypoints, dragging an end to re-attach | missing | ends are attached when drawn or through `board.connector` |
+| Quick-create handles (drag out a connected copy) | missing | |
+| Marker and highlighter | done | the Pencil's stroke fitting with board presets: marker opaque, highlighter wide, see-through and multiplying |
+| Eraser | done | drag over marker and highlighter strokes to remove them, one undo step |
+| Pen colours and widths in the toolbar | partial | `tool.marker {color}`, `tool.highlighter {color}`; colour changes on a selected stroke from the contextual bar |
+| Stamps | done | thumbs up, heart, plus one, star, question, check: round badges drawn as vectors, the placer's name on hover |
+| Stamps sticking to the object they land on, the stamp wheel, emotes, stickers | missing | |
+| Text and sections | done | the existing Text tool and sections |
+| Live sessions: cursors, selections, cursor chat, spotlight | done | the existing sessions; board objects, connectors following moved objects, colours and stamps sync both ways (checked with two app instances) |
+| Timer and music | missing | |
+| Voting sessions | missing | |
+| Board widgets | missing | design-file widgets exist (`crates/engine/src/widgets.rs`), not wired to boards |
+| Templates (retrospective, brainstorm, flow chart…) | missing | |
+| Tables | missing | |
+| Mind maps | missing | |
+| Washi tape, code blocks, image cropping on boards | missing | images can be placed as in design files |
+| Audio and huddles | missing | |
+| AI features (summaries, sorting stickies, generating boards) | missing | |
+| Dot grid on the page | missing | the canvas grid is drawn over the render; a dot grid needs a render pass under the layers |
+| `.jam` import and export | missing | see [`file-format-parity.md`](file-format-parity.md) |
+
+## Revision history
+
+| Date | Change | Summary |
+|---|---|---|
+| 2026-10-24 | major | Created with board files (M12): sticky notes, shapes with text, connectors, ink and eraser, stamps, the board toolbar and contextual bar, live-session sync |
diff --git a/docs/control-protocol.md b/docs/control-protocol.md
index c9ae5331..3941bd8a 100644
--- a/docs/control-protocol.md
+++ b/docs/control-protocol.md
@@ -256,7 +256,7 @@ 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?, 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?}`
+### `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?, devCompareVersion?}`
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
@@ -293,13 +293,14 @@ closes it), `commentDraft` (`{x, y}`: start a new comment there), `commentFilter
text, focused with the cursor at its end: an `@` there shows the mention picker), `commentEdit` (a
message index of the open thread to edit, 0 for the first; `null` stops), `presentComments` (bool:
the presenter shows the presented frame's comments, also Shift+C there). Dev Mode: `devCompare` (a
-ready-for-dev frame or section id opens the Compare changes view, like `dev.compare {id, show:
-true}`; `null` closes it) with `devCompareMode` (`sideBySide|overlay`) and `devCompareSplit` (the
+frame or section id opens the Compare changes view, like `dev.compare {id, show:
+true}`; `null` closes it) with `devCompareVersion` (a version id to compare with; `null`: when it
+was marked ready for dev), `devCompareMode` (`sideBySide|overlay`) and `devCompareSplit` (the
overlay slider, 0–1), `annotationFilter` (`all`, `none` for uncategorised, or a category id or name:
the annotations the canvas shows). `resetFrameStats` (true: start `framesDrawn` and
`repaintCauses` over). Returns `ui.inspect` (which reports `stylePicker`,
`stylePickerView`, `comments`: `open`, `draft`, `filter`, `sort`, `search`, `editing` and the
-`mentions` the picker offers, `devCompare` (`{id, mode, split}` or `null`), `devFocus` (the frame the
+`mentions` the picker offers, `devCompare` (`{id, mode, split, version}` or `null`), `devFocus` (the frame the
focus view shows, or `null`) and `annotationFilter`).
### `ui.screenshot {path?}`
diff --git a/docs/dev-mode-parity.md b/docs/dev-mode-parity.md
index cba5e81d..bf3cc737 100644
--- a/docs/dev-mode-parity.md
+++ b/docs/dev-mode-parity.md
@@ -1,23 +1,26 @@
# 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-15 · **Last updated:** 2026-10-15 · **Change:** minor (import lines in generated layer trees; compare with any saved version; Dev Mode behaviour suite: an inspect-only canvas, Changed in the ready list, statuses only on frames and sections; plugin panels from the Inspect tab) · **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
-inside generated layer trees. Remaining: 0–1 h.
+**Breadth ~97%, ready ~76% (estimated).** The inspect surface is broad, components connect
+to the code components of a repository (with their imports, also inside generated layer trees),
+changes compare with any saved version and the canvas only inspects in Dev Mode. Left: measurements
+kept on the canvas, a read-only layers panel in Dev Mode, publishing mappings from the code
+repository. Remaining: 2–4 h.
| Feature | Status | Notes |
|---|---|---|
-| Dev Mode toggle (Shift+D), Inspect panel | done | |
+| Dev Mode toggle (Shift+D), Inspect panel | done | the canvas only inspects: presses select, pan and comment but never move, resize, draw or edit text and vectors; menus and shortcuts refuse design edits with a note (Dev Mode's annotations, statuses, dev resources, code connections and comments still work); a drawing tool chosen in the toolbar goes back to the design. The layers panel and dropped files still edit (ours to tighten) |
| 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 |
| Annotations: pinned properties, categories, coloured callouts, filter | done | |
-| Ready for dev list, statuses, "Changed" after edits | done | |
+| Ready for dev list, statuses, "Changed" after edits | done | the list filters Ready for dev, Changed, Completed or any, and badges changed ones (`inspect.readyForDev {status: changed}`, `changed` per item); only sections and frames at the top of a page or section take a status (others are refused) |
| Focus view (one frame, previous / next) | done | |
-| Compare changes (before/after side by side or overlaid, property diffs) | done | only against the snapshot taken when a frame was marked ready; not against any named version |
-| Code connect (map components to repository code) | done | per language (React, Leptos, SwiftUI, Compose): import path, name and a template with `{property}` and `{property ? "a" : "b"}` placeholders; instances (also inside generated layer trees) show the snippet with their values; edited in the Inspect panel with a live preview; `figcraft.connect.json` export/import. Inside a generated layer tree, connected instances' imports aren't collected |
-| Plugins in Dev Mode (Jira, GitHub, etc.) | partial | FigCraft's own WASM plugins that only read run from the Inspect tab; no plugin UI at run time, no third-party integrations |
+| Compare changes (before/after side by side or overlaid, property diffs) | done | against the snapshot taken when a frame was first changed after it was marked ready, or any saved version (`dev.compare {version}`; the view's Compare with menu); a frame that isn't ready for dev compares with versions |
+| Code connect (map components to repository code) | done | per language (React, Leptos, SwiftUI, Compose): import path, name and a template with `{property}` and `{property ? "a" : "b"}` placeholders; instances (also inside generated layer trees) show the snippet with their values; edited in the Inspect panel with a live preview; `figcraft.connect.json` export/import; generated layer trees bring the import lines of the connected components they call (also in definitions, slots and swapped-in instances) once each at the top, per language. No CLI publishing mappings from the code repository |
+| Plugins in Dev Mode (Jira, GitHub, etc.) | partial | FigCraft's own WASM plugins that only read run from the Inspect tab, with their panels (callbacks can only read); no third-party integrations |
+| Measurements (redlines on hover, Alt in the design) | partial | distances between the selection and the hovered layer, its parent or a guide, auto layout padding and gaps (Shift+Alt); measurements kept on the canvas for others aren't there |
| VS Code extension | out of scope | FigCraft's MCP server and control channel already serve design data, code and connected snippets to agents and editors |
| Dev resources links on layers | done | a URL and a name per link on any layer (`devResource.*`, saved, synced, undoable); instances list their main component's (and its set's) read-only; URLs checked as http/https and never fetched (no page titles: a link without a name is named after its URL); the Inspect tab lists, adds, edits and removes them; `get_node` returns them |
@@ -25,6 +28,7 @@ inside generated layer trees. Remaining: 0–1 h.
| Date | Change | Summary |
|---|---|---|
+| 2026-10-15 | minor | Dev Mode tail (gap 16): generated layer trees (React, Leptos, SwiftUI, Compose) start with the import lines of the connected components they call, once each, also those in a component's definition, in slots an instance fills and placed by a connected template's instance swaps; Compare changes takes any saved version as the before (`dev.compare {version}`, the view's Compare with menu; frames that aren't ready for dev compare with versions). Behaviour suite (5 tests; 4 failed before the fixes): the Dev Mode canvas only inspects (no moving, resizing, drawing, text or vector editing; menus, shortcuts, nudges, opacity keys and paste refuse design edits with a note; toolbar drawing tools go back to the design), the ready list filters and badges Changed items, statuses are refused on layers inside frames. Read-only plugins run from the Inspect tab show their panels (the runtime's panels, reused). Breadth 96% → 97% (measurements kept on the canvas and the read-only layers panel counted as missing), ready 72% → 76%, 0–1 h → 2–4 h |
| 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 |
diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md
index adf0b0f2..a0ccd076 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-24 · **Change:** minor (`.figcraft` carries the file kind (boards; `.fig` import: resized instances and variable modes by asset key; atomic saves; auto-save; SVG export clip of nested frames; 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; 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,9 +18,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. 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 | — |
+| `.jam` (whiteboards), `.deck` (Slides) | native to other Figma products | no | no | `.jam`: not read or written (boards are FigCraft files, see [boards-parity](boards-parity.md)); `.deck` 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`) | — |
+| `.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`); saves write a unique staging file and rename it into place (#284); optional auto-save of files with a path (`pref.autoSave`, #305); `kind: "board"` marks a board (left out for design files, so files from before boards are design files; the home screen reads it for the file's mark); board objects keep their `board` metadata on the layer | — |
| 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) |
## Import (place / paste / drop)
@@ -51,7 +51,7 @@ export limit, not a native document nesting limit.
|---|---|---|---|---|
| PNG | yes, scales/suffixes | yes | export settings per layer, presets (`2x`, `512w`, `512h`), preview, "Export N layers"; contents only (off: every layer showing in the area) and include bounding box (the layer's own box); slashes in layer names export into folders. The exported area is what the layer paints: shadows towards their offset, outside and centre strokes, unclipped children, a mask group's mask, nothing for hidden layers; slices export everything under them; sides round up to whole pixels | — |
| JPG | yes | yes | white where transparent; fixed quality (90) | — |
-| SVG | yes (outline text option, ids) | yes | alpha/luminance masks kept; noise, texture, progressive and background blur, glass embedded as images; outline text (off: `` with one `` per line, one style per layer), unique id attributes from layer names, explicit depth-limit refusal, simplified strokes (stroke attributes for centred strokes and for inside and outside strokes on boxes and ellipses) | — |
+| SVG | yes (outline text option, ids) | yes | alpha/luminance masks kept; noise, texture, progressive and background blur, glass embedded as images; outline text (off: `` with one `` per line, one style per layer), unique id attributes from layer names, explicit depth-limit refusal, nested frames clipped by their parent's clip (#327), simplified strokes (stroke attributes for centred strokes and for inside and outside strokes on boxes and ellipses) | — |
| PDF | yes | yes | one page per frame, real selectable text in subset fonts, links, vectors and gradients as vectors, effects as images; bleed, crop/bleed marks, page boxes, naive CMYK; checked by rendering the PDF back against PNG exports; explicit depth-limit refusal | CMYK output intent 2–4 |
| WebP | — | yes (ours) | | — |
| Copy as CSS / SVG / PNG / text / link | yes | yes | Copy as PNG: the whole selection at 2x | — |
@@ -165,6 +165,8 @@ each.
| Date | Change | Summary |
|---|---|---|
+| 2026-10-24 | minor | Boards (M12): `.figcraft` saves the file kind (`kind: "board"`, absent for design files) and each board object's `board` metadata; the `.jam` row points at boards |
+| 2026-10-15 | minor | `.fig` import (#279, #281; #266, #267): resized instances lay out their layers by their constraints, and explicit variable modes whose collection is named by its asset key come across (before, they were dropped and bound layers resolved in the default mode); fixture-tested, real files still owed. `.figcraft`: atomic saves and exports through unique staging files (#284), optional auto-save (#305). SVG export keeps a nested frame's fill and stroke inside its parent's clip (#327). 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/gaps.md b/docs/gaps.md
index 9b1a770c..531a230a 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-24 · **Change:** minor (gap 24: boards and their tail; Dev Mode tail: import lines in layer trees, compare with versions, an inspect-only canvas; gap 5: reviewed Turkish, Czech and Indonesian drafts, the Japanese draft completed; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail; the 2026-10-17 landings: `.fig` import fidelity, budgets for large files, the import report, a `.fig` copy from Save as and 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 and Turkish, 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) |
@@ -29,7 +29,7 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe
| 13 | Vector tail: none left (boolean hit testing on the result landed 2026-10-11) | Feature | — | [target-app-parity](target-app-parity.md) |
| 14 | Variables: extended collections checked on real libraries (the tail landed 2026-10-12) | Feature | 0–1 | [components-parity](components-parity.md) |
| 15 | Prototyping: media triggers and actions; controllers on macOS, Linux and FreeBSD (controller buttons on key/gamepad triggers, widgets in prototypes landed) | Feature | 2–5 | [prototyping-parity](prototyping-parity.md) |
-| 16 | Dev Mode: import lines inside generated layer trees; the editor extension is left to the MCP server (code connect, Dev Mode plugins and dev resources landed) | Feature | 0–1 | [dev-mode-parity](dev-mode-parity.md) |
+| 16 | Dev Mode: measurements kept on the canvas, a read-only layers panel, publishing mappings from the code repository; the editor extension is left to the MCP server (import lines, compare with versions and an inspect-only canvas landed 2026-10-15) | Feature | 2–4 | [dev-mode-parity](dev-mode-parity.md) |
| 17 | Branching: branches in live sessions, lists other than fills, strokes and effects merged whole (a branch's own version history and per-item list merges landed 2026-10-12) | Feature | 1–2 | [collaboration-parity](collaboration-parity.md) |
| 18 | Display P3 on screen: blocked upstream (egui-wgpu picks an 8-bit sRGB surface); gamut warning and soft-proof sRGB landed, as did several windows | Hardware | 4–8 | [hardware-parity](hardware-parity.md) |
| 19 | AI features | AI | 30–60 | [target-app-parity](target-app-parity.md) |
@@ -37,6 +37,7 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe
| 21 | Menu items without a command: none left (landed 2026-10-11) | Feature | — | [parity-checklist](parity-checklist.md) |
| 22 | Screen readers never run; browser has no accessibility tree | UI/UX | 4–8 | [ui-parity](ui-parity.md) |
| 23 | CMYK output intent for print PDFs | File format | 2–4 | [file-format-parity](file-format-parity.md) |
+| 24 | Boards: the whiteboard tail (timer, voting, widgets, templates, tables, mind maps…) | Feature | 30–60 | [boards-parity](boards-parity.md) |
## Entries
@@ -178,7 +179,7 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe
- **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
+### 5. Localization: English, reviewed Russian and Turkish, 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
overlay, the strings added since each catalog was drafted (1–5% of each), Hindi, Arabic and
@@ -371,11 +372,22 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe
host, no spaces, capped) and never fetched: a link added without a name is named after its URL,
and a link opens only when clicked. The Inspect tab lists, adds, edits and removes them;
`get_node` / `inspect_document` return them as `devResources`.
-- **Missing:** import lines for connected instances inside a
- generated layer tree (only the selected layer's own import is shown); publishing mappings from
- the code repository with a CLI. An editor extension is out of scope: the MCP server already
- serves design data, code and the connected snippets to agents and editors.
-- **Estimate:** 0–1 h.
+- **Landed (2026-10-15):** generated layer trees (React, Leptos, SwiftUI, Compose) start with the
+ import lines of the connected components they call, once each, also those in a component's
+ definition, in the slots an instance fills and placed by a connected template's instance swaps.
+ Compare changes takes any saved version as the before (`dev.compare {version}`; the view's
+ Compare with menu), for any top-level frame or section. A Dev Mode behaviour suite: the canvas
+ only inspects (presses select, pan and comment; no moving, resizing, drawing, text or vector
+ editing), the menus, shortcuts, nudges, opacity keys and paste refuse design edits with a note
+ while Dev Mode's own edits still run, drawing tools from the toolbar return to the design; the
+ ready list filters and badges Changed items (`inspect.readyForDev {status: changed}`); statuses
+ are refused on layers inside frames. Read-only plugins run from the Inspect tab show their
+ panels.
+- **Missing:** measurements kept on the canvas for others (only hover redlines); the layers panel
+ and files dropped on the canvas still edit in Dev Mode; publishing mappings from the code
+ repository with a CLI. An editor extension is out of scope: the MCP server already serves design
+ data, code and the connected snippets to agents and editors.
+- **Estimate:** 2–4 h.
### 17. Branching and merging
- **Landed (2026-10-11):** branches of a file (`branch.*`): File ▸ Create branch… (or the Branches
@@ -440,12 +452,27 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe
repository (licensing).
- **Estimate:** 2–4 h once an openly licensed profile is found.
+### 24. Boards: the whiteboard tail
+- **Landed (2026-10-24, M12):** board files (`file.newBoard`) with sticky notes, shapes with text,
+ connectors that re-route when what they join moves, marker, highlighter and eraser, stamps, text
+ and sections; a board toolbar and a contextual bar; live sessions sync it all.
+- **Missing:** timer and music, voting sessions, board widgets, templates, tables, mind maps, washi
+ tape, code blocks, audio and huddles, quick-create handles, curved connectors and waypoints,
+ stamps sticking to the objects they land on, a dot grid, `.jam` files
+ ([`boards-parity.md`](boards-parity.md)).
+- **User impact:** boards cover a brainstorm or a flow sketch; facilitated workshops need the
+ timer, voting and templates.
+- **Estimate:** 30–60 h.
+
## Revision history
| Date | Change | Summary |
|---|---|---|
+| 2026-10-24 | minor | Boards (M12): a file kind of its own (`file.newBoard`, saved in `.figcraft`, carried to live-session joiners) with sticky notes, shapes with text, connectors that re-route when what they join moves (an engine recompute, the same for local edits, undo and others' edits), marker, highlighter and eraser, stamps with the placer's name, a board toolbar and a contextual bar; prototyping and Dev Mode refuse on boards; design files and boards have their own marks on tabs and file rows. New gap 24 (the board tail, 30–60 h); the ranking above it is unchanged |
+| 2026-10-15 | minor | Gap 5: Turkish reviewed by a native speaker (#263), Czech (#469) and Indonesian (#477) drafts, the Japanese draft caught up (#288); Indonesian is no longer missing; counts re-measured (2,177 entries) and corrected: only Spanish is held to completeness, Russian included. Estimate unchanged at this rounding |
| 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-15 | minor | Gap 16: import lines inside generated layer trees, compare with any saved version, an inspect-only Dev Mode canvas (menus and shortcuts refuse design edits), Changed in the ready list, statuses only on sections and top-level frames, read-only plugins' panels from the Inspect tab. Left: measurements kept on the canvas, a read-only layers panel, publishing mappings with a CLI; 0–1 h → 2–4 h |
| 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 |
| 2026-10-12 | minor | Gap 2: your online files landed (the app records the files it put on a server with their owner tokens, Home ▸ Online lists them and opens them again as their owner, with sharing, rename, removal and forget from the list; one request per server tells which are still there; tabs mark files in a live session). What is left is unchanged: accounts, teams and per-person permissions, shared comments and versions. Hours unchanged |
diff --git a/docs/hardware-parity.md b/docs/hardware-parity.md
index df822981..f5be7263 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 (zoom previews; hidden windows answer control requests; macOS file opening, the Windows start-up message, Linux packaging; copy and paste in the browser; Windows QA pass; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; pen pressure for the Pencil and brushes on Windows and from browser styluses; macOS: quitting ends the process once everything is kept, avoiding the Touch Bar teardown crash (#781); Linux and BSD clipboard: images under Wayland, reads time out; minimised windows under Wayland; window controls on Wayland without server decorations; canvas textures on device pixels; 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
@@ -12,13 +12,13 @@ since 2025). FigCraft renders the canvas on the CPU and presents it through wgpu
| Feature | Figma | FigCraft (macOS / Windows / Linux / web) | Hours |
|---|---|---|---|
-| 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 |
+| 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; when renders from scratch are slow, a new zoom shows the whole view coarsely first, then refines it (#312); 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); 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 |
-| Several windows / multi-monitor | yes (a window per file; presenter in its own window) | desktop: File ▸ New window, a tab's Open in new window or a tab dragged off the strip; each window has its own tabs, panels and canvas, draws only when it needs to and asks about unsaved changes when it closes. Only the main window has a screen-reader tree (eframe 0.36), so files stay tabs while a screen reader runs; positions aren't restored at the next start; the presenter stays inside its window; one window in the browser | 1–2 |
+| Several windows / multi-monitor | yes (a window per file; presenter in its own window) | desktop: File ▸ New window, a tab's Open in new window or a tab dragged off the strip; each window has its own tabs, panels and canvas, draws only when it needs to and asks about unsaved changes when it closes; a minimised or covered window still answers control and MCP requests, while screenshots and input fail at once until it is on screen (#313, #332, #720). Only the main window has a screen-reader tree (eframe 0.36), so files stay tabs while a screen reader runs; positions aren't restored at the next start; the presenter stays inside its window; one window in the browser | 1–2 |
| Screen readers | partial | AccessKit tree on desktop (names, roles, states), never tested with a real screen reader; none in the browser | 4–8 + human QA |
| Keyboard layouts (non-US) | yes | keymap uses logical keys; not checked on AZERTY/QWERTZ/JIS | 1–2 |
@@ -50,6 +50,7 @@ Nothing has been timed against Figma on the same document (needs `.fig` import).
| Date | Change | Summary |
|---|---|---|
+| 2026-10-15 | minor | Community fixes (#290, #306, #312, #313, #328, #332, #346, #474): coarse zoom previews when renders from scratch are slow; a minimised or covered window answers control and MCP requests (screenshots and input fail at once while it is hidden); `.figcraft` files open from Finder on macOS; a message box when the window can't open on Windows; on Linux the window id matches the desktop entry, the RPM requires glibc 2.35 and user fonts under `XDG_DATA_HOME` are found. 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. |
diff --git a/docs/localization-parity.md b/docs/localization-parity.md
index 50fcd4ec..aa4cbb52 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-23 · **Change:** minor (a missing translation fails no check: `cargo xtask i18n-report` lists them; Russian and Turkish catalogs reviewed by native speakers, Russian one/few/many plurals; Czech and Indonesian drafts; the Japanese draft completed; counts re-measured; Windows UI language from the first preferred language; draft catalogs catch up: every draft translates every string again; Simplified Chinese 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
@@ -37,7 +37,8 @@ supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no v
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
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,
+ other Latin American and US Spanish tags to es-419; regional ru, tr, cs and id tags (ru-RU,
+ tr-TR, cs-CZ, id-ID) to their catalogs; 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.
@@ -45,11 +46,11 @@ supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no v
(`es-419.toml` over `es.toml`); its UI strings, command labels and menu wordings read the
overlay, then the base language, then English.
- **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 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).
+ lacks, keys no code uses, unknown command ids, placeholders that differ from English and overlay
+ entries that read as in their base language. No language is held to full coverage: a string
+ added later shows English until someone translates it, and `cargo xtask i18n-report` (part of
+ `cargo xtask ci`) lists what each language lacks. 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
@@ -63,7 +64,8 @@ supported by both apps (CJK, Arabic and Devanagari shaping, IME); Figma has no v
- **Script support in the UI:** menus widen to their longest label; dropdowns, the two-column
labels of the right panel and the home screen's cards keep a long translation on one line with an
ellipsis and show it in full on hover (checked in German, the longest); no mirrored
- (right-to-left) layout of panels. CJK translations are shorter than English; the same ellipsis
+ (right-to-left) layout of panels. Cyrillic, Turkish and Czech letters draw from the UI fonts
+ (no font added; Russian checked in screenshots). CJK translations are shorter than English; the same ellipsis
and tooltip cover the few that don't fit (the sizing dropdowns).
- **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,
@@ -120,6 +122,8 @@ Hindi, Vietnamese and Arabic. Traditional Chinese is not planned (no catalog; it
| Date | Change | Summary |
|---|---|---|
+| 2026-10-23 | minor | A missing translation fails no check: Spanish is no longer held to full coverage, and the tests of one language's wording, names and plural forms are gone (the plural rules and language-tag tests stay). `cargo xtask i18n-report`, run by `cargo xtask ci`, lists each language's missing UI strings, command labels and menu wordings. Grade unchanged |
+| 2026-10-15 | minor | Community catalogs (#257, #263, #469, #477, #288): Russian (`ru`, Русский, reviewed and approved by VanTan) and Turkish (`tr`, Türkçe, reviewed by a native speaker), Czech (`cs`, Čeština) and Indonesian (`id`, Bahasa Indonesia) drafts, and the Japanese draft caught up; Preferences ▸ Language lists them and System maps their regional tags. Catalogs may give few and many plural forms; Russian picks one, few or many by its integer rule (11–14 take many), the catalog supplying the text choosing the rule. Only Spanish is held to completeness. Counts re-measured: 1,587 UI keys (38 plural), 559 command labels and 31 menu wordings, 2,177 entries; Spanish 100%, Japanese 2,176, Czech and Indonesian 2,166, Russian and Turkish 2,165, the five older drafts 2,088–2,089 (95%). Localization 39% and 29–51 h unchanged at this rounding |
| 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/mcp.md b/docs/mcp.md
index fa16f5b7..cf7f0420 100644
--- a/docs/mcp.md
+++ b/docs/mcp.md
@@ -330,6 +330,53 @@ tips; headless, it only sets the preference.
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"export","arguments":{"format":"png","path":"dashboard.png"}}}
```
+### Boards
+
+A board is a file of its own kind for thinking together: `file.newBoard {name?}` opens one (its
+page is light; `inspect_document` says `kind: "board"`). Board objects are ordinary layers with a
+`board` entry `get_node` shows (`{type: sticky|shape|connector|label|stamp|ink, …}`), so the usual
+commands move, resize, recolour, copy, delete and undo them. On a design file the board commands
+refuse; on a board `proto.*`, `dev.*`, `view.prototype` and `view.devMode` refuse. Each of these is
+one undo step and returns the ids it made:
+
+- `board.sticky {x, y, text?, color?, author?, parent?}` → `{id, text}`: a sticky note (a square
+ frame whose height grows with its note; its text size shrinks as the note gets longer). `color`
+ is a board colour (`yellow orange red pink violet blue green gray`) or a hex colour; `author`
+ defaults to your name (`pref.userName`, or the one a live session gave you; `false` for none).
+- `board.nextSticky {id?, side?: right|below|left|above, edit?}` → `{id, text}`: a sticky of the
+ same colour beside the selected (or edited) one; with `edit: true` the app goes on typing in it
+ (`Shift+Cmd/Ctrl+Enter` in the app does both).
+- `board.shape {shape, x, y, width?, height?, text?, color?, parent?}` → `{id, text}`: a shape with centred,
+ wrapping text: `rectangle roundedRectangle ellipse diamond triangle speechBubble chevron`.
+- `board.connector {from, to, fromSide?, toSide?, style?: straight|elbow, startCap?, endCap?, label?}`
+ → `{id, label?}`: `from`/`to` are layer ids or `{x, y}` page points; sides are `auto` (the side
+ facing the other end) or `top right bottom left`; caps are stroke caps (default an arrow at the
+ end). The connector re-routes itself whenever what it joins moves or resizes, also when someone
+ else in a live session moves it; a deleted end stays where it was as a point. `board.label {id,
+ text}` sets its label (empty removes it).
+- `board.stamp {x, y, stamp: thumbsUp|heart|plusOne|star|question|check}` → `{id}`: a round badge
+ centred there, with your name on it for hover.
+- `board.ink {path | points, highlighter?, color?, select? (default true)}` → `{id}`: a marker (or
+ wide, see-through highlighter) stroke.
+- `board.setColor {ids?, color}`: stickies and shapes take it as their fill, connectors and ink as
+ their line. `board.setStyle {ids?, shape?, fontSize?, style?, startCap?, endCap?}`: a shape's
+ outline and text size, a connector's routing and arrowheads.
+- Tools for `pointer`: `tool.sticky {color?}`, `tool.shape {shape?}`, `tool.connector {style?}`
+ (drag from one object to another), `tool.marker {color?}`, `tool.highlighter {color?}`,
+ `tool.eraser` (drag over strokes), `tool.stamp {stamp?}`; Text and Section are the usual tools.
+
+```json
+{"command": "file.newBoard", "params": {"name": "Retro"}}
+{"command": "board.sticky", "params": {"x": 0, "y": 0, "text": "Went well", "color": "green"}}
+{"command": "board.sticky", "params": {"x": 240, "y": 0, "text": "To improve", "color": "pink"}}
+{"command": "board.connector", "params": {"from": 2, "to": 4, "style": "elbow", "label": "leads to"}}
+{"command": "board.stamp", "params": {"x": 200, "y": 0, "stamp": "plusOne"}}
+```
+
+`from` and `to` are the `id`s the two `board.sticky` calls returned (here `{"id": 2, "text": 3}` and
+`{"id": 4, "text": 5}` in a new board without an author name; a sticky with its author's name takes
+one more id). In a `batch`, step references (`{"from": {"$step": 1}, "to": {"$step": 2}}`, the `id`s steps 1 and 2 returned) avoid counting.
+
### Sections, handoff and arrow keys
`run_command` with `object.wrapInSection {ids?, name?}` (Wrap in new section: layers on the page or
@@ -364,6 +411,10 @@ on; `key` resolves keys the way the canvas does. Commands behind keys:
- `view.designPrototype` (`Shift+E`), `view.devMode` (`Shift+D`) and `view.leftSidebar`
(`Shift+Cmd+\`) switch the right panel's tab or hide the left sidebar in the app (no-ops headless).
- `doc.nextTab` / `doc.previousTab` (`Ctrl+Tab` / `Ctrl+Shift+Tab`): the next or previous open file.
+- Board tools (boards only): `tool.sticky` (`Q`), `tool.shape` (`B`), `tool.connector` (`X`),
+ `tool.marker` (`M`), `tool.highlighter` (`U`), `tool.eraser` (`E`), `tool.stamp` (`W`), and
+ `board.nextSticky` (`Shift+Cmd/Ctrl+Enter`, also while typing in a sticky). Keys no design-file
+ shortcut uses; on a design file they refuse.
- `view.pan {dx, dy, big?}`: the arrow keys with nothing selected (`key ArrowRight` does the same)
pan the view by 20 screen pixels a step, 200 with `big` (Shift).
- `view.multiplayerCursors {on?}` (`Alt+Cmd+\`): show or hide others' cursors in a live session.
@@ -1304,7 +1355,9 @@ permissions: without it nothing is downloaded); `plugin.directory.publish {path
strings, any other `{…}` stays as written (`unknown` lists placeholder names that aren't
properties). Then `inspect.code` on an instance or the component returns the import line and the
snippet instead of generated code (`connected: true`), connected instances inside a generated
- layer tree are their snippet, and `inspect.componentCode` returns `connected: {importPath, name,
+ layer tree (also in a component's definition, in the content an instance puts in its slots, and
+ the components a connected template's instance swaps place) are their snippet with their import
+ lines once each at the top of the code, per language, and `inspect.componentCode` returns `connected: {importPath, name,
template, import, code}` with the snippet as `usage`. Example: template `{label} ` with import path
`@acme/ui` gives `import { Button } from "@acme/ui";` then `{"Buy
@@ -1317,7 +1370,8 @@ permissions: without it nothing is downloaded); `plugin.directory.publish {path
warning). `get_node` lists a component's links as `codeLinks`. In the app, the Inspect tab's
Connect to code section edits them in the Code section's language, with a live preview and a
Connected badge. An editor extension isn't needed: agents and editors read the same snippets
- through this server. Plugins whose manifest asks only for `read` also run from the Inspect tab.
+ through this server. Plugins whose manifest asks only for `read` also run from the Inspect tab,
+ with their panels (`plugin.ui`); their callbacks can only read.
- **Dev resources:** links for developers (docs, code, tickets) on any layer, each a URL and a
name. `devResource.add {id?, url, name?}` → `{id, index}` (no name: the URL without its scheme,
`www.` and a trailing slash; no page title is looked up), `devResource.edit {id?, index, url?,
@@ -1356,17 +1410,23 @@ permissions: without it nothing is downloaded); `plugin.directory.publish {path
tab filters the callouts by category and edits the categories (colour, name, delete, add); each
note has a category menu.
- **Ready for dev:** frames at the top of a page or section, and sections, carry a handoff status
- (`node.set {devStatus: none|readyForDev|completed}`). `inspect.readyForDev {status?:
- readyForDev|completed|any, page?}` lists them across pages (or on one page) in page and layer
- order: `{items: [{id, name, page, status}]}`. The Inspect tab sets the status of the selected
- frames and, with nothing selected, lists them with a status filter (click one to go to it, or its
- focus button to open it in the focus view).
+ (`node.set {devStatus: none|readyForDev|completed}`; other layers are refused a status).
+ `inspect.readyForDev {status?: readyForDev|changed|completed|any, page?}` lists them across pages
+ (or on one page) in page and layer order: `{items: [{id, name, page, status, changed}]}`
+ (`changed`: ready for dev and edited since). The Inspect tab sets the status of the selected
+ frames and, with nothing selected, lists them with a status filter (Ready for dev, Changed,
+ Completed, Any status; changed ones carry a Changed badge; click one to go to it, or its focus
+ button to open it in the focus view). In the app's Dev Mode the canvas only inspects: presses
+ select (and pan, and comment), never move, resize, draw or edit text and vectors, and the menus
+ and shortcuts refuse commands that edit the design (Dev Mode's own annotations, statuses, dev
+ resources, code connections and comments still work); choosing a drawing tool in the toolbar
+ goes back to the design. Commands sent over MCP or the control channel aren't affected.
- **Compare changes:** when a layer marked Ready for dev first changes (it turns "Changed"), the
file keeps a copy of it and everything in it as it was just before that edit (saved in the
`.figcraft` file only while there is a change; resolving the change, marking it again, another
status or deleting it drops the copy, so the next change compares with that state).
- `dev.compare {id?, show?}` → `{id, name, changed, snapshot, added, removed, modified, truncated,
- changes: [{id, name, type, change: added|removed|changed, depth, layers, properties?: [{section,
+ `dev.compare {id?, version?, show?}` → `{id, name, changed, snapshot, added, removed, modified,
+ truncated, version: {id, name, time} | null, changes: [{id, name, type, change: added|removed|changed, depth, layers, properties?: [{section,
property, before, after, text}]}]}`: layers matched by id, added and removed ones listed as a
whole (`layers` counts what's inside), changed ones with their properties formatted like Inspect
(`width 120 → 136`, `fill #FF0000 → #E03030`, `text “Welcome” → “Hello”`, `parent Badge → Screen`,
@@ -1374,7 +1434,11 @@ permissions: without it nothing is downloaded); `plugin.directory.publish {path
opacity, visibility, name), nested layers and instance contents included. `snapshot: false` means
the frame changed before copies were kept (an older file). `show: true` opens the compare view in
the app: before and now side by side (or overlaid with a slider), changed layers outlined (added
- green, changed orange, removed red), the list of changes and Resolve change.
+ green, changed orange, removed red), the list of changes and Resolve change. With `version` (an id
+ from `version.list`) any top-level frame or section, ready for dev or not, is compared with that
+ saved version instead (a layer the version doesn't have was added as a whole); the compare view
+ picks it at the bottom (Compare with: When marked ready, or a version; a frame that isn't ready
+ for dev compares with the newest version), and `ui.set {devCompareVersion}` sets it.
- **Focus view:** `dev.focus {id? | direction: next|previous}` → `{id, name, page, index, count}`
shows one top-level frame or section alone on the canvas (fitted, selected, other layers neither
drawn nor hit), switching page when needed; `direction` steps through the ready-for-dev frames
@@ -1677,7 +1741,7 @@ other key next to `$step` fails the whole batch, which is rolled back. Only an o
value too) is read as a reference. A step that is itself a `command.batch` is passed on as written,
so the references in its steps are to its own steps, not the outer batch's.
-The end-to-end tests in `crates/mcp/tests/agent_tasks.rs` are worked examples of realistic tasks
+The end-to-end tests in `crates/mcp/tests/it/agent_tasks.rs` are worked examples of realistic tasks
(auto layout, a card built in one batch with step references, components and overrides, gradients
and shadows, paint styles, Light/Dark variables, align/distribute/group, boolean subtract + flatten,
export, undo/redo, drawing with tools).
diff --git a/docs/roadmap.md b/docs/roadmap.md
index 8d63a469..8e093ac9 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-24 · **Change:** minor (M12 Boards; community fixes in #507, #510, #529 and #530: auto-save, a text box by dragging, batch step references, removing someone from a live session, Russian and Turkish catalogs reviewed, Czech and Indonesian drafts, the Japanese draft completed, zoom previews, the web clipboard, Alt-drag snapping and Cmd+D repeat, recovery copies, crash and rollback fixes, colour emoji, `.fig` import fixes; earlier changes are in the revision history below) · **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
@@ -16,8 +16,9 @@ are one Opus 5.5 agent; most milestones split across 4–6 agents on disjoint cr
3. **Tool-by-tool interaction pass** against the running Figma ([`ui-parity.md`](ui-parity.md)):
40–60 h, parallel by tool.
4. **Languages** on the landed localization layer: native reviews of the es, fr, de, pt-BR, ja,
- ko and zh-Hans drafts and the es-419 overlay (people), then the other key languages: 3–7 h per language
- plus native review.
+ ko, zh-Hans, id and cs drafts and the es-419 overlay (people; Russian and Turkish are reviewed),
+ the entries added since each catalog was written, then the other key languages (Hindi,
+ Vietnamese, Arabic): 3–7 h per language plus native review.
5. **Multiplayer M9**: accounts and teams on top of the live sessions and the standalone server (the WebSocket transport, hosting from the app, invite links that open the app, document sync, live cursors, selections, text carets, avatars and follow, per-user undo, reconnect with offline edits, collision-free ids for styles, variables, collections and comments, joining from the browser, and `figcraft-server` with persistence, publishing from the app and share links to edit or view landed), per [`collab-protocol.md`](collab-protocol.md) and [`server.md`](server.md): 45–90 h.
## Alpha gate
@@ -57,9 +58,10 @@ blockers.
| 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 |
-| M10 Localization (new) | not started | layer + 11 languages | 60–100 |
+| M10 Localization | ~39%: the layer, English, Russian and Turkish reviewed by native speakers; Spanish (with a Latin American overlay), French, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, Indonesian and Czech drafts | native reviews, Hindi, Vietnamese, Arabic (with mirrored panels), engine messages and number formatting ([localization-parity](localization-parity.md)) | 29–51 |
| M11 Plugins | runtime, API, menu, manager and SDK done (#101); plugin panels and settings (ABI v2); widgets (API 3), panels side by side, colour picker on plugin fields; a plugin directory on `figcraft-server` (publish, browse, install, update) | a public catalogue, publisher accounts and signatures, the directory in the browser, richer widget events; Figma plugin compatibility is an owner decision | 8–26 |
-| M12 AI features (new, owner decision) | not started | local models | 30–60 |
+| M12 Boards (new) | first slice landed (2026-10-24): board files, sticky notes, shapes with text, connectors that follow, marker, highlighter, eraser, stamps, board toolbar and contextual bar, live sessions | timer, voting, widgets, templates, tables, mind maps ([boards-parity](boards-parity.md)) | 30–60 |
+| M13 AI features (new, owner decision) | not started | local models | 30–60 |
## Next, after the current focus
@@ -73,6 +75,56 @@ blockers.
| Date | Change | Summary |
|---|---|---|
+| 2026-10-24 | minor | Boards (M12): a file kind of its own (`file.newBoard`, saved in `.figcraft`, carried to live-session joiners) with sticky notes, shapes with text, connectors that re-route when what they join moves (an engine recompute, the same for local edits, undo and others' edits), marker, highlighter and eraser, stamps with the placer's name, a board toolbar and a contextual bar; prototyping and Dev Mode refuse on boards; design files and boards have their own marks on tabs and file rows. Milestone M12 Boards added; AI features move to M13 |
+| 2026-10-15 | minor | Auto-save (#305, #296): Preferences ▸ Save files automatically (`pref.autoSave`, off by default; desktop only, the browser has no files to save to) saves each open file that has a path 3 s after its last change, so steady editing doesn't save every few seconds, and never during a gesture, a live text preview or while a version is shown. The file is encoded on a thread of its own and written as of that moment (edits made meanwhile stay unsaved); a failed save says why in a toast and is tried again a minute later, and version history checkpoints keep coming with it on. Numbers unchanged |
+| 2026-10-15 | minor | A text box by dragging (#363, #360): a drag with the Text tool makes a fixed-size text box the size of the drag (at least one line tall); a click, or a drag shorter than the drag threshold, still makes auto-width text. Numbers unchanged |
+| 2026-10-15 | minor | Batch step references (#400): inside `command.batch` (MCP `batch`), `{"$step": n}` anywhere in a step's params stands for the `id` step n returned (`{"$step": n, "field": …}` for another field; `$step` is a reserved key), so a frame with its children takes one batch and one undo step; a malformed reference fails the batch, which rolls back, and a nested batch keeps references to its own steps. Numbers unchanged |
+| 2026-10-15 | minor | Removing someone from a live session (#338): right-click a person's avatar ▸ Remove *name* from session, or `collab.removePerson {client}`, when you host the session or own the file on a server; the session ends for them (they keep their copy), the code or link they hold no longer gets them back in while it runs, and everyone else stays. Numbers unchanged |
+| 2026-10-15 | minor | Pages list (#272, #258): a long pages list scrolls in its own area, so the layers below stay in view; page and layer drops count only inside the list's visible rows. Numbers unchanged |
+| 2026-10-15 | minor | Variables export in the browser (#368): Export… ▸ Variables JSON / CSS custom properties did nothing in the web build and now arrives as a download; importing there still needs a file picker. Numbers unchanged |
+| 2026-10-15 | minor | Font picker keys (#352, #345): Up and Down step through the font families from the current one, keeping the highlight in view and previewing it on the canvas; Enter applies it, Escape leaves the text as it was. Numbers unchanged |
+| 2026-10-15 | minor | Leaving Design ends the pen path (#308, #307): switching to Prototype or Inspect while the Pen draws ends the path and goes back to Move (pressing Design again keeps drawing), and a click on the toolbar no longer reaches the canvas under it. Numbers unchanged |
+| 2026-10-15 | minor | Vector edit mode keeps the canvas still (#322): the edit mode hints in the Design panel wrap, so entering edit mode and picking a region no longer shift the canvas by about 25 points in the middle of the click (which dragged the region picked). Numbers unchanged |
+| 2026-10-15 | minor | Drop shadows under a background blur (#317, #255): a layer with both casts its shadows from what it paints (a translucent fill casts a lighter shadow than an opaque one) and reads the backdrop only after drawing them, so a shadow shown behind transparent areas is seen through the blur. Numbers unchanged |
+| 2026-10-15 | minor | When the window can't open (#306, #261): Windows release builds have no console, so a graphics failure at start quit without a word; the error is now logged and shown in a message box in the interface language, with what to try (unset `WGPU_BACKEND`, update the driver, OpenGL) and where to report it, skipped with `--control`. Numbers unchanged |
+| 2026-10-15 | minor | Crashes on Windows (#271, #314, #337; #224 and two more): a text field focused before it was drawn aborted the screen-reader layer; double-clicking a page, creating a variable collection and renaming a style folder no longer close the app. Numbers unchanged |
+| 2026-10-15 | minor | Deeply nested layers (#330, #210): one depth guard (256) on the three recursive layout paths, so a deep file can't run the layout out of stack. Numbers unchanged |
+| 2026-10-15 | minor | Image memory budgets (#326; #203, #189): decoded images and a file's images have budgets; the decode cache evicts its least recently used entries. Numbers unchanged |
+| 2026-10-15 | minor | macOS file dialogs (#253, #250) no longer re-enter the event loop; a dialog's result goes to the file and window it was opened for, and dialogs are parented to the main window. Numbers unchanged |
+| 2026-10-15 | minor | Recovery copies (#297, #303, #331, #336; #202, #185, #187): a copy counts only after its write succeeds and a failed one is retried; saves and closes wait for the write in flight; copies keep version history and branches; a recovered copy stays until this run has its own. Numbers unchanged |
+| 2026-10-15 | minor | Text edits (#280, #278) no longer roll back earlier changes; a drag released off the canvas ends at the pointer's last canvas position. Numbers unchanged |
+| 2026-10-15 | minor | Rollback (#282, #301; #196): a failed command rolls back during a drag or other gesture too; a failed batch keeps the redo steps. Numbers unchanged |
+| 2026-10-15 | minor | Atomic save and export (#284): staging files are uniquely named and created exclusively, so a file or link already at the old fixed staging name is never written through, and two writers of one file no longer share one. Numbers unchanged |
+| 2026-10-15 | minor | Alt-drag copies (#283) snap to their original, and Duplicate (Cmd+D) then repeats the last copy's offset. Numbers unchanged |
+| 2026-10-15 | minor | The pen (#277) shows its Bezier handles while a point is dragged out. Numbers unchanged |
+| 2026-10-15 | minor | Corner handles (#293, #292): a press on a corner handle resizes instead of picking the corner-radius handle. Numbers unchanged |
+| 2026-10-15 | minor | New text (#372, #362) takes a readable colour from the frame it is drawn in, not only the page (text drawn in a white frame on a dark page was white). Numbers unchanged |
+| 2026-10-15 | minor | Outline stroke (#386) works on every selected layer. Numbers unchanged |
+| 2026-10-15 | minor | Send to back (#444) counts per parent when the selection spans frames. Numbers unchanged |
+| 2026-10-15 | minor | Align buttons (#276) are off when the selection has nothing to align to. Numbers unchanged |
+| 2026-10-15 | minor | Gradient type icons (#275) show their gradient. Numbers unchanged |
+| 2026-10-15 | minor | Corner resize cursors (#388) stay diagonal at any proportions; the text selection highlight (#390) stays inside the box on the last line. Numbers unchanged |
+| 2026-10-15 | minor | New pages (#311, #295) take the current page's background; the theme still decides a new file's page. Numbers unchanged |
+| 2026-10-15 | minor | A slice's export preview (#265) shows the content under it. Numbers unchanged |
+| 2026-10-15 | minor | SVG export (#327, #325) keeps a nested frame's fill and stroke inside its parent's clip. Numbers unchanged |
+| 2026-10-15 | minor | Home screen (#318, #324): recent files notice files deleted while it is open; a long path no longer draws over the file name. Numbers unchanged |
+| 2026-10-15 | minor | System theme on first run (#262): the first frame follows the system theme, and going back to System from a manual theme works. Numbers unchanged |
+| 2026-10-15 | minor | Web clipboard (#375): copy and paste in the browser go through the system clipboard, so a paste after a copy brings the copied layers instead of whatever text the clipboard held. Numbers unchanged |
+| 2026-10-15 | minor | Zoom previews (#312): when renders from scratch are slow, a new zoom first shows the whole view coarsely instead of the page colour, then the refined image; images of another file or page never show. Numbers unchanged |
+| 2026-10-15 | minor | Hidden windows (#313, #332; #269): a minimised or covered window answers control and MCP requests (commands, inspection, `ui.render`) at once, each window on its own; screenshots and input still wait for it to be on screen. Numbers unchanged |
+| 2026-10-15 | minor | Server (#340, #302): a compaction cut short closes the file instead of confirming lost edits (#183); each team library version is kept in its own file (#206). Numbers unchanged |
+| 2026-10-15 | minor | Counters (#343, #344, #353; #309): collab sequence numbers, layer name counters and opacity digits can't overflow. Numbers unchanged |
+| 2026-10-15 | minor | Commands refuse bad indexes and ids (#475, #384, #310): `page.select` and `doc.switch`, `effect.set` and `export.update` / `export.remove`, `page.move` with a non-page id. Numbers unchanged |
+| 2026-10-15 | minor | Find and replace (#358, #361) changes every occurrence, case-insensitively, also when the replacement contains the search text. Numbers unchanged |
+| 2026-10-15 | minor | The gradient shorthand (#254, #252) is read by the engine, so the CLI, control channel and MCP share it. Numbers unchanged |
+| 2026-10-15 | minor | .fig import (#279, #281): resized instances lay out their layers by their constraints (#266); explicit variable modes whose collection is named by its asset key, as library collections are, come across (#267). Numbers unchanged |
+| 2026-10-15 | minor | Colour emoji (#300, #268) draw from their own colour tables (sbix and CBDT/EBDT bitmap strikes, COLR v0 layers), a colour face tried first; COLR v1 still draws outlines. Numbers unchanged |
+| 2026-10-15 | minor | macOS (#290, #289): `.figcraft` files open from Finder, Open With and the Dock. Numbers unchanged |
+| 2026-10-15 | minor | Windows (#294, #291): the first preferred language alone picks the UI language. Numbers unchanged |
+| 2026-10-15 | minor | Unix font discovery (#474) follows `XDG_DATA_HOME`. Numbers unchanged |
+| 2026-10-15 | minor | Linux packaging (#346, #328): the window id matches the desktop entry (FreeBSD keeps its class); the RPM requires glibc 2.35. Numbers unchanged |
+| 2026-10-15 | minor | Tests (#472, #471, #339): the rename shortcut test, the hanging punctuation test and the font-scanning tests no longer depend on the platform, font or test order. Numbers unchanged |
+| 2026-10-15 | minor | Languages (#257, #263, #469, #477, #288): Russian (with one/few/many plural forms) and Turkish catalogs, reviewed by native speakers; Czech and Indonesian drafts; the Japanese draft completed. 2,177 entries now (1,587 UI strings, 559 command labels, 31 menu wordings); strings added since a catalog was written read English there. Localization 39% and 29–51 h unchanged at this rounding (Indonesian is now a draft, while the five older drafts lack 88 newer entries) |
| 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/target-app-parity.md b/docs/target-app-parity.md
index a1a5bf12..62bea024 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-24 · **Change:** minor (boards: area 22 (weight 0, outside the weighted sum; Turkish reviewed, Czech and Indonesian drafts, the Japanese draft completed; reviewed Russian catalog and integer plurals; vector edit mode regions: hover hatch, selection and drag; plugin log byte/count limits (#191); core editor leftovers: component playground, auto gap handles, variables inside styles, inner shadows and background blur on groups, command-made text readable on dark pages, a one-step frame/group convert, delays on mouse triggers and manual overlay offsets, wrapped-line alignment; starter templates, a Templates tab and Getting started tips on the home screen: essentials ~57% → ~59%; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages, numbers unchanged but menu breadth 211/211; text box sizes measured against documents re-saved by other software: whole-pixel line heights, advances on a 1024-per-em grid, letter spacing between glyphs only, numbers unchanged; .fig export checked by opening written files in other software, numbers unchanged; a public figcraft-server: open hosting, owner tokens, per-address limits, idle expiry, moderation, install.sh; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; headline percentages recomputed from the area table: feature breadth ~84%, core ~94%, mainstream ~50%; text lists, hanging punctuation and decoration styles; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; shapes and vector behaviour suite and fixes; paint and effects behaviour suite and fixes; frames, groups, sections and masks behaviour suite and fixes; styles and variables behaviour suite and fixes; prototyping behaviour suite and fixes; components behaviour suite and fixes; embedded image colour profiles; layers panel keyboard: F2 rename, Shift+F10 context menu, keyboard box selection, 10k-layer QA; per-side stroke weight variables; text behaviour suite: CJK line breaking, metrics, vertical trim; selection and transform behaviour suite and fixes; `.fig` import, best effort; auto layout behaviour suite and fixes; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings; feature breadth ~80%; ready ~49%; last major: full re-measure against Figma desktop 126.10.7; rows for the community batches: Selection colors, smart-selection spacing and a Present tab (#753), `.fig` import fidelity, paste from another design app, a `.fig` copy from Save as; control requests while the window is minimised (#720); catalog counts re-measured; automation roots (#715); number variables in the text content picker (#629); frames and sections convert into each other (#719); 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
@@ -9,7 +9,7 @@ summarizes it; [`gaps.md`](gaps.md) is the ranked work list; the measured menu c
[`hardware-parity.md`](hardware-parity.md), [`localization-parity.md`](localization-parity.md),
[`auto-layout-parity.md`](auto-layout-parity.md), [`components-parity.md`](components-parity.md),
[`prototyping-parity.md`](prototyping-parity.md), [`dev-mode-parity.md`](dev-mode-parity.md),
-[`collaboration-parity.md`](collaboration-parity.md).
+[`collaboration-parity.md`](collaboration-parity.md), [`boards-parity.md`](boards-parity.md).
## Headline
@@ -84,8 +84,10 @@ Weights are the share of a typical product designer's working time in Figma Desi
so they can be argued with. Areas 1–16 keep the original rubric's weights (they sum to 94, not the 100 the rubric claimed);
areas 17–21 are added (sum 19) because Figma users depend on them. Percentages below divide by the
total, 113.
-Out of scope as separate products: FigJam, Figma Slides, Sites, Make, Buzz, Weave (the `.jam` and
-`.deck` document kinds belong to them).
+Out of scope as separate products: Figma Slides, Sites, Make, Buzz, Weave (the `.deck` document
+kind belongs to them). Whiteboarding is covered by FigCraft's boards (area 22, weight 0: a separate
+workflow, tracked here but not in the weighted sum; [`boards-parity.md`](boards-parity.md)); the
+`.jam` document kind is not read or written.
## By feature area
@@ -115,6 +117,7 @@ Breadth: does it exist. Ready: depth, correctness and fidelity for real projects
| 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 |
+| 22 | Boards (whiteboarding) | 0 | ~35% | ~20% | Board files with sticky notes, shapes with text, connectors that follow what they join, marker, highlighter and eraser, stamps, text and sections, in live sessions (M12); missing: timer, voting, board widgets, templates, tables, mind maps, washi tape, audio, quick-create handles, stamps sticking to objects, `.jam` files ([boards-parity](boards-parity.md)). Not in the weighted sum | 30–60 |
| | **Weighted (÷113)** | 113 | **~85%** | **~63%** | | **117–255** |
| | Core editor only (1–16, ÷94) | 94 | ~94% | ~72% | | 32–74 |
@@ -638,6 +641,8 @@ Carried over from the ROADMAP's "Shipped so far" (2026-10-10). The test count th
| Date | Change | Summary |
|---|---|---|
+| 2026-10-24 | minor | Boards (M12): a file kind of its own (`file.newBoard`, saved in `.figcraft`, carried to live-session joiners) with sticky notes, shapes with text, connectors that re-route when what they join moves (an engine recompute, the same for local edits, undo and others' edits), marker, highlighter and eraser, stamps with the placer's name, a board toolbar and a contextual bar; prototyping and Dev Mode refuse on boards; design files and boards have their own marks on tabs and file rows. Area 22 added at weight 0 (breadth ~35%, ready ~20%); headline numbers unchanged (the weighted sum leaves area 22 out) |
+| 2026-10-15 | minor | Localization (#263, #469, #477, #288): Turkish reviewed by a native speaker, Czech and Indonesian drafts, the Japanese draft caught up; coverage re-measured (2,177 entries; the five older drafts at 95%). Localization 39% and 29–51 h unchanged at this rounding (see [localization-parity](localization-parity.md)) |
| 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. |
diff --git a/docs/translating.md b/docs/translating.md
index eaa59755..9dfca60c 100644
--- a/docs/translating.md
+++ b/docs/translating.md
@@ -91,13 +91,9 @@ picker leaves Georgian out. A new CJK or other non-Latin language also needs its
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:
- 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.
+4. A string added later shows English in every language until someone translates it; a missing
+ translation never fails a check or a build. `cargo xtask i18n-report` lists what each language
+ lacks (UI strings, command labels, menu wordings), and `cargo xtask ci` prints the same list.
5. Run the check and look at the panels in the app (longer words must fit the right panel):
cargo test -p figcraft-ui-egui i18n
@@ -106,9 +102,9 @@ picker leaves Georgian out. A new CJK or other non-Latin language also needs its
with "…" and show it in full on hover; elsewhere, look for clipped or wrapped text.
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; a reviewed catalog stays a draft until a maintainer approves it (its `status` says which).
+code uses, unknown command ids and placeholders that don't match English. Machine-drafted catalogs
+stay marked as drafts until a native speaker has reviewed them; a reviewed catalog stays a draft
+until a maintainer approves it (its `status` says which).
## Adding strings in code
@@ -116,11 +112,11 @@ Wrap every string a user sees or a screen reader hears: `tr` for plain text, `tr
placeholders, `trn` for counts, `tr_noop` for literals in `const` tables that are looked up later
with `tr(label)`. The key must be a string literal as the first argument (the check reads the
source). Don't wrap ids, command ids, JSON, log messages, file extensions or document content. Then
-add the key to `en.toml` and to each complete language (Spanish and Russian); the drafts may follow later.
+add the key to `en.toml`; translations may follow later.
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.
+note goes into `en.toml`. Notes built with `format!` show in English.
diff --git a/docs/ui-parity.md b/docs/ui-parity.md
index d87103f0..980889ec 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-24 · **Change:** minor (board tool keys pinned; community fixes: the text box by dragging, the font picker keys, the pen path on leaving Design, a still canvas in vector edit mode, a scrolling pages list, colour emoji, readable new text in frames, system theme on first run; the Small caps sample in Type settings drawn from capitals; recent files as cards; vector edit mode: hovering, hatching, selecting and dragging filled regions; home screen: Templates tab, first-run templates and Getting started tips; number fields: scrub rates, arrow steps, arithmetic with brackets, relative edits of mixed values; outline mode's hidden layers and object bounds; Hide when publishing; cursors per tool and modifier; panel widths; dark pages for files made in the dark theme; drag threshold and double-clicks into text in groups; rotation origin on Alt+R and placing with Enter: no documented shortcut missing; keyboard shortcut parity suite and bindings; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and the vector edit tail; canvas navigation, guides and grids behaviour suite and fixes; shapes and vector behaviour suite and fixes; paint and effects behaviour suite and fixes; frames, groups, sections and masks behaviour suite and fixes; layers panel keyboard: F2 rename, Shift+F10 context menu, F8 box selection; selection and transform behaviour suite and fixes; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; boolean hit testing on the result, group drags, frame outlines and slices; outlines for the selection, mask outlines; arc fields, live boolean editing, shape builder on strokes, one-sided widths; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; 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; 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:
@@ -41,7 +41,7 @@ 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 | the line between Pages and Layers drags to size the pages list, kept in the preferences (`layers_behaviour_tests`) |
+| 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; a long list scrolls in its own area and a page dropped outside the visible list stays put (#272) (`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 |
@@ -81,11 +81,11 @@ 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`); 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 |
+| 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`); switching from Design to Prototype or Inspect ends the path and returns to Move (#308) |
+| Vector edit mode: bend, paint bucket, lasso, cut, eraser, transform box, point snapping, mirroring | done | a double-click a few pixels off a thin stroke enters edit mode (#646); entering edit mode and picking a region keep the canvas still (#322); a point dropped on another point merges with it, and dropping one end of an open path on the other closes it (a 2-point line's end just moves, #401); Flatten keeps open paths open (#377); paint bucket drags across areas; cut drags divide a shape into layers; delete and heal follows the curve; rounded points are drawn; Shift-click deselects a point at a corner of the box (`vector_behaviour_tests`); several vectors edited at once, Shift-click handles to drag them together, a cap and join per point, rounded points beside curves (`vector_multi_behaviour_tests`); filled regions with the Move tool: the area under the pointer is hatched ("/" lines in the selection colour, clipped by the area's own fill rule, holes left out, gone 3.5 px from a point or 2 px from a segment at any zoom), the line spacing follows octave folding (fitted to measurements at several zoom levels: 8 px at every power-of-two zoom, growing with the zoom and stepping back at √2 · 2ⁿ) and stays fixed to the shape when panning; a click selects the area and its points (moved with it but drawn unselected), Shift adds or removes an area, a press on a selected area drags the whole selection, no hover hatch during drags, a click on an empty spot (a hole) clears it and stays in edit mode; `vector.edit.select {regions}` (`regions_tests`, `vector_regions_tests`). 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 |
+| 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) and Up/Down step through it (#352); a selection highlight after a line break starts at that line's start and an empty last line shows its mark (#665); carets step over whole emoji and accented letters; colour emoji draw from their colour tables (#300); IME composition replayed in tests as macOS sends it, not yet checked on a Mac (#747); CJK words by script run (no dictionary); vertical trim in Type settings; no spell check |
| 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 |
@@ -129,7 +129,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look
| Bound on other keys (documented conflict) | 1 | Run last plugin: the documentation also gives Ctrl+Alt+P to pixel preview on Windows; the plugin takes Ctrl+Alt+Shift+P there |
| Missing | 0 | moving the rotation origin (Alt+R, `transform.rotationOrigin`) and placing an object with Enter after choosing its tool (`tool.place`) were the last two |
| Documented keys a platform keeps | 2 | Ctrl+Space (Windows/Linux keyboard box selection) switches some CJK input methods; F6 goes to a browser's address bar in the web build |
-| Undocumented bindings pinned | 49 | of which Cmd/Ctrl+W, Cmd/Ctrl+N and Ctrl+Tab are taken by browsers (web build) and Ctrl+Alt+T / Ctrl+Alt+L by some Linux desktops |
+| Undocumented bindings pinned | 57 | of which Cmd/Ctrl+W, Cmd/Ctrl+N and Ctrl+Tab are taken by browsers (web build) and Ctrl+Alt+T / Ctrl+Alt+L by some Linux desktops |
- **Newly bound:** A for the Frame tool, Shift+' for the pixel grid (Cmd+' kept: the articles
disagree), Alt+Cmd+\ / Ctrl+Alt+\ for others' cursors (`view.multiplayerCursors`, new), Ctrl+F6
@@ -172,6 +172,8 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look
| Date | Change | Summary |
|---|---|---|
+| 2026-10-24 | minor | Boards (M12): eight board bindings pinned (tool keys Q sticky, B shapes, X connector, M marker, U highlighter, E eraser, W stamp, and Shift+Cmd/Ctrl+Enter for the next sticky; boards only, on keys no design-file shortcut uses): 49 → 57 pinned |
+| 2026-10-15 | minor | Community fixes (#262, #272, #277, #300, #308, #311, #322, #352, #363, #372, #390): first runs follow the system theme; new text is readable on the frame it is drawn in; a long pages list scrolls on its own and new pages take the current page's colour; the pen shows its handles while dragging a point out and ends its path when you leave Design; vector edit mode keeps the canvas still; a drag with the Text tool makes a fixed-size box; colour emoji; the selection highlight on the last line; Up and Down in the font picker with a live preview. 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 | 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 |
diff --git a/packaging/check-app-specific.sh b/packaging/check-app-specific.sh
index ebf23c0b..e9b03946 100644
--- a/packaging/check-app-specific.sh
+++ b/packaging/check-app-specific.sh
@@ -6,7 +6,7 @@ cd "$(dirname "${BASH_SOURCE[0]}")/.."
bash packaging/server/install-test.sh
if grep -rniE 'photoshop|psd|photocraft|vectorcraft|illustrator|adobe|figma' packaging/ .github/ \
--exclude=packaging-lint.yml --exclude=check-app-specific.sh; then
- echo "::error::package metadata mentions another product (see above)"
+ echo "::error::package metadata mentions another product (see above)" >&2
exit 1
fi
diff --git a/packaging/env.sh b/packaging/env.sh
index b68406a0..eb6547c9 100644
--- a/packaging/env.sh
+++ b/packaging/env.sh
@@ -24,10 +24,11 @@ workspace_version() {
/^\[/ { in_pkg = ($0 == "[workspace.package]") ; next }
in_pkg && $1 == "version" { gsub(/[" ]/, "", $3); print $3; exit }
' "$ROOT/Cargo.toml"
+ return $?
}
VERSION="${FIGCRAFT_VERSION:-$(workspace_version)}"
-if [ -z "$VERSION" ]; then
+if [[ -z "$VERSION" ]]; then
echo "error: could not read [workspace.package] version from $ROOT/Cargo.toml" >&2
exit 1
fi
@@ -37,7 +38,7 @@ DIST="${DIST:-$ROOT/dist/release}"
mkdir -p "$DIST"
export DIST
-if [ -z "${FIGCRAFT_BUILD_SHA:-}" ]; then
+if [[ -z "${FIGCRAFT_BUILD_SHA:-}" ]]; then
FIGCRAFT_BUILD_SHA="$(git -C "$ROOT" rev-parse HEAD 2>/dev/null || true)"
fi
export FIGCRAFT_BUILD_SHA
@@ -47,7 +48,7 @@ export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-$ROOT/target}"
# The headless CLI ships next to the app once apps/figcraft-cli exists.
BINS=(figcraft)
HAS_CLI=0
-if [ -f "$ROOT/apps/figcraft-cli/Cargo.toml" ]; then
+if [[ -f "$ROOT/apps/figcraft-cli/Cargo.toml" ]]; then
BINS+=(figcraft-cli)
HAS_CLI=1
fi
@@ -58,7 +59,8 @@ unset _bin
# The binary used for a `--version` smoke test: the CLI when shipped, else the app (which answers
# --version before opening a window).
smoke_bin() {
- if [ "$HAS_CLI" = 1 ]; then echo figcraft-cli; else echo figcraft; fi
+ if [[ "$HAS_CLI" = 1 ]]; then echo figcraft-cli; else echo figcraft; fi
+ return 0
}
# Emit a GitHub Actions warning (plain stderr outside Actions).
@@ -68,31 +70,33 @@ retry() {
local attempt
for attempt in 1 2 3 4 5; do
"$@" && return 0
- [ "$attempt" = 5 ] || { echo "retrying ($attempt/5): $*" >&2; sleep 15; }
+ [[ "$attempt" = 5 ]] || { echo "retrying ($attempt/5): $*" >&2; sleep 15; }
done
return 1
}
warn() {
- if [ -n "${GITHUB_ACTIONS:-}" ]; then echo "::warning::$*"; else echo "warning: $*" >&2; fi
+ if [[ -n "${GITHUB_ACTIONS:-}" ]]; then echo "::warning::$*"; else echo "warning: $*" >&2; fi
+ return 0
}
# Copy licence and readme files that exist into a package directory.
copy_docs() {
local dest="$1" f
for f in README.md LICENSE LICENSE-MIT LICENSE-APACHE NOTICE COPYRIGHT; do
- if [ -f "$ROOT/$f" ]; then cp "$ROOT/$f" "$dest/"; fi
+ if [[ -f "$ROOT/$f" ]]; then cp "$ROOT/$f" "$dest/"; fi
done
copy_font_licences "$dest"
+ return $?
}
# Builds made with craft-fonts (CRAFT_FONTS_DIR, all official releases) embed its fonts, which
# are OFL-1.1: ship each font's licence as OFL-.txt. No-op without CRAFT_FONTS_DIR.
copy_font_licences() {
local dest="$1" lic fam
- [ -n "${CRAFT_FONTS_DIR:-}" ] || return 0
+ [[ -n "${CRAFT_FONTS_DIR:-}" ]] || return 0
for lic in "$CRAFT_FONTS_DIR"/fonts/*/OFL.txt; do
- [ -f "$lic" ] || continue
+ [[ -f "$lic" ]] || continue
fam="$(basename "$(dirname "$lic")")"
cp "$lic" "$dest/OFL-$fam.txt"
done
@@ -100,5 +104,7 @@ copy_font_licences() {
# Portable SHA-256 of a file (prints just the hash).
sha256() {
- if command -v sha256sum >/dev/null; then sha256sum "$1" | cut -d' ' -f1; else shasum -a 256 "$1" | cut -d' ' -f1; fi
+ local file="$1"
+ if command -v sha256sum >/dev/null; then sha256sum "$file" | cut -d' ' -f1; else shasum -a 256 "$file" | cut -d' ' -f1; fi
+ return $?
}
diff --git a/packaging/freebsd/package.sh b/packaging/freebsd/package.sh
index bb9a7799..e11a58a0 100755
--- a/packaging/freebsd/package.sh
+++ b/packaging/freebsd/package.sh
@@ -21,7 +21,7 @@ APP_ID=ai.storyteller.figcraft
SKIP_BUILD=0
DRY_RUN=0
-while [ $# -gt 0 ]; do
+while [[ $# -gt 0 ]]; do
case "$1" in
--skip-build) SKIP_BUILD=1; shift ;;
--dry-run) DRY_RUN=1; SKIP_BUILD=1; shift ;;
@@ -37,7 +37,7 @@ case "$MACHINE" in
arm64 | aarch64) ARCH=aarch64 ;;
*) echo "unsupported architecture $MACHINE" >&2; exit 2 ;;
esac
-if [ "$DRY_RUN" = 0 ] && [ "$(uname -s)" != FreeBSD ]; then
+if [[ "$DRY_RUN" = 0 ]] && [[ "$(uname -s)" != FreeBSD ]]; then
echo "error: build on FreeBSD (or pass --dry-run to check the tree layout)" >&2
exit 2
fi
@@ -47,7 +47,7 @@ echo "==> FigCraft $VERSION for FreeBSD $ARCH"
# The release VM has 12 GB; full parallelism on the biggest crates runs it out of memory.
export CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-4}"
-if [ "$SKIP_BUILD" = 0 ]; then
+if [[ "$SKIP_BUILD" = 0 ]]; then
(cd "$ROOT" && cargo build --release --locked "${CARGO_PKGS[@]}")
fi
WORK="$CARGO_TARGET_DIR/freebsd-package"
@@ -57,7 +57,7 @@ mkdir -p "$WORK"
BIN="$CARGO_TARGET_DIR/release"
OUT_DIR="$DIST"
-if [ "$DRY_RUN" = 1 ]; then
+if [[ "$DRY_RUN" = 1 ]]; then
# Stub binaries, and the tarball stays in the work dir so dist/ only ever holds real builds.
BIN="$WORK/stub-bin"
OUT_DIR="$WORK"
@@ -86,12 +86,12 @@ sed -e "s/@VERSION@/$VERSION/g" -e "s/@DATE@/$FIGCRAFT_BUILD_DATE/g" \
"$LINUX/$APP_ID.metainfo.xml.in" >"$STAGE/share/metainfo/$APP_ID.metainfo.xml"
cp -R "$ROOT/assets/app-icon/hicolor" "$STAGE/share/icons/"
copy_docs "$STAGE/share/doc/figcraft"
-if [ -f "$ROOT/ATTRIBUTION.md" ]; then install -m 644 "$ROOT/ATTRIBUTION.md" "$STAGE/share/doc/figcraft/"; fi
+if [[ -f "$ROOT/ATTRIBUTION.md" ]]; then install -m 644 "$ROOT/ATTRIBUTION.md" "$STAGE/share/doc/figcraft/"; fi
for f in "${BINS[@]/#/bin/}" "share/applications/$APP_ID.desktop" \
"share/icons/hicolor/256x256/apps/$APP_ID.png" \
share/doc/figcraft/LICENSE-MIT share/doc/figcraft/LICENSE-APACHE; do
- if [ ! -e "$STAGE/$f" ]; then echo "error: $f is missing from the package" >&2; exit 1; fi
+ if [[ ! -e "$STAGE/$f" ]]; then echo "error: $f is missing from the package" >&2; exit 1; fi
done
# ---- .tar.gz ------------------------------------------------------------------------------------
@@ -100,7 +100,7 @@ tar -C "$WORK" -czf "$OUT_DIR/$BASENAME.tar.gz" "$BASENAME"
echo "wrote $OUT_DIR/$BASENAME.tar.gz"
"$STAGE/bin/$(smoke_bin)" --version
-if [ "$DRY_RUN" = 1 ]; then
+if [[ "$DRY_RUN" = 1 ]]; then
echo "==> dry run: tarball contents"
tar -tzvf "$OUT_DIR/$BASENAME.tar.gz"
fi
diff --git a/packaging/linux/apprun-test.sh b/packaging/linux/apprun-test.sh
index c6d98da0..75625480 100755
--- a/packaging/linux/apprun-test.sh
+++ b/packaging/linux/apprun-test.sh
@@ -37,10 +37,10 @@ fail() {
# 1. Launch works and passes arguments through.
out="$("$APPDIR/AppRun" open file.png)" || fail "AppRun exited non-zero"
-[ "$out" = "stub: open file.png" ] || fail "arguments not forwarded: $out"
+[[ "$out" = "stub: open file.png" ]] || fail "arguments not forwarded: $out"
DESKTOP="$XDG_DATA_HOME/applications/$APP_ID.desktop"
-[ -f "$DESKTOP" ] || fail "desktop entry not installed"
+[[ -f "$DESKTOP" ]] || fail "desktop entry not installed"
# 2. Exec rewritten to the AppImage (quoted, spaces intact), TryExec dropped,
# everything else preserved from the packaged entry.
@@ -55,15 +55,15 @@ fi
# 3. Icons landed under the name the .desktop entry references.
for f in "16x16/apps/$APP_ID.png" "256x256/apps/$APP_ID.png" "scalable/apps/$APP_ID.svg"; do
- [ -f "$XDG_DATA_HOME/icons/hicolor/$f" ] || fail "icon missing: $f"
+ [[ -f "$XDG_DATA_HOME/icons/hicolor/$f" ]] || fail "icon missing: $f"
done
# 4. Idempotent: a second launch must not rewrite anything (inode unchanged).
before="$(stat -c %i "$DESKTOP")"
out="$("$APPDIR/AppRun")" || fail "second launch exited non-zero"
-[ "$out" = "stub: " ] || fail "second launch output: $out"
+[[ "$out" = "stub: " ]] || fail "second launch output: $out"
after="$(stat -c %i "$DESKTOP")"
-[ "$before" = "$after" ] || fail "desktop entry rewritten although unchanged"
+[[ "$before" = "$after" ]] || fail "desktop entry rewritten although unchanged"
# 5. Moving the AppImage refreshes Exec.
mv "$APPIMAGE" "$TMP/moved.AppImage"
@@ -74,40 +74,40 @@ grep -Fxq "Exec=\"$(readlink -f "$APPIMAGE")\" %U" "$DESKTOP" || fail "Exec not
# 6. Opt-out installs nothing.
rm -rf "$XDG_DATA_HOME"
FIGCRAFT_NO_DESKTOP_INTEGRATION=1 "$APPDIR/AppRun" >/dev/null || fail "opt-out launch exited non-zero"
-[ ! -e "$XDG_DATA_HOME" ] || fail "opt-out still integrated"
+[[ ! -e "$XDG_DATA_HOME" ]] || fail "opt-out still integrated"
# 7. An unwritable data dir never blocks the launch.
mkdir -p "$TMP/ro" && chmod a-w "$TMP/ro"
out="$(XDG_DATA_HOME="$TMP/ro/data" "$APPDIR/AppRun" out.txt)" || fail "launch blocked by unwritable data dir"
-[ "$out" = "stub: out.txt" ] || fail "stub not run against unwritable data dir: $out"
+[[ "$out" = "stub: out.txt" ]] || fail "stub not run against unwritable data dir: $out"
chmod u+w "$TMP/ro"
# 8. No $APPIMAGE (extracted AppDir): launch only, nothing installed.
rm -rf "$XDG_DATA_HOME"
env -u APPIMAGE "$APPDIR/AppRun" >/dev/null || fail "extracted-AppDir launch exited non-zero"
-[ ! -e "$XDG_DATA_HOME" ] || fail "integrated without $APPIMAGE"
+[[ ! -e "$XDG_DATA_HOME" ]] || fail "integrated without $APPIMAGE"
# 9. A path that would need Exec escaping (here a `$`): launch only, nothing installed.
rm -rf "$XDG_DATA_HOME"
odd="$TMP/odd\$(id).AppImage"
: >"$odd"
out="$(APPIMAGE="$odd" "$APPDIR/AppRun" x)" || fail "launch with an odd path exited non-zero"
-[ "$out" = "stub: x" ] || fail "odd path: $out"
-[ ! -e "$XDG_DATA_HOME" ] || fail "integrated an AppImage path that needs escaping"
+[[ "$out" = "stub: x" ]] || fail "odd path: $out"
+[[ ! -e "$XDG_DATA_HOME" ]] || fail "integrated an AppImage path that needs escaping"
# 10. `cli ` runs figcraft-cli with the remaining arguments and integrates nothing.
rm -rf "$XDG_DATA_HOME"
out="$("$APPDIR/AppRun" cli mcp --attach 7979 2>&1)" && fail "cli ran without figcraft-cli in the AppDir"
-[ "$out" = "figcraft: this AppImage was built without figcraft-cli" ] || fail "missing cli: $out"
+[[ "$out" = "figcraft: this AppImage was built without figcraft-cli" ]] || fail "missing cli: $out"
printf '#!/bin/sh\necho "cli stub: $*"\n' >"$APPDIR/usr/bin/figcraft-cli"
chmod +x "$APPDIR/usr/bin/figcraft-cli"
out="$("$APPDIR/AppRun" cli mcp --attach 7979)" || fail "cli launch exited non-zero"
-[ "$out" = "cli stub: mcp --attach 7979" ] || fail "cli arguments not forwarded: $out"
+[[ "$out" = "cli stub: mcp --attach 7979" ]] || fail "cli arguments not forwarded: $out"
out="$("$APPDIR/AppRun" cli)" || fail "bare cli launch exited non-zero"
-[ "$out" = "cli stub: " ] || fail "bare cli output: $out"
-[ ! -e "$XDG_DATA_HOME" ] || fail "cli launch integrated the desktop"
+[[ "$out" = "cli stub: " ]] || fail "bare cli output: $out"
+[[ ! -e "$XDG_DATA_HOME" ]] || fail "cli launch integrated the desktop"
# Only the first argument selects the CLI.
out="$("$APPDIR/AppRun" file.figcraft cli)" || fail "app launch with a later cli argument exited non-zero"
-[ "$out" = "stub: file.figcraft cli" ] || fail "later cli argument hijacked the launch: $out"
+[[ "$out" = "stub: file.figcraft cli" ]] || fail "later cli argument hijacked the launch: $out"
echo "AppRun desktop integration ok"
diff --git a/packaging/linux/flatpak-bundle.sh b/packaging/linux/flatpak-bundle.sh
index 127c3af9..b3353b38 100755
--- a/packaging/linux/flatpak-bundle.sh
+++ b/packaging/linux/flatpak-bundle.sh
@@ -22,7 +22,7 @@ FLATHUB=https://dl.flathub.org/repo/flathub.flatpakrepo
TEST=1
TARBALL=""
-while [ $# -gt 0 ]; do
+while [[ $# -gt 0 ]]; do
case "$1" in
--no-test) TEST=0; shift ;;
-h | --help) sed -n '2,14p' "$0"; exit 0 ;;
@@ -39,7 +39,7 @@ case "$ARCH" in
esac
BASENAME="figcraft-$VERSION-linux-$ARCH"
TARBALL="${TARBALL:-$DIST/$BASENAME.tar.gz}"
-[ -f "$TARBALL" ] || { echo "error: $TARBALL not found (run packaging/linux/package.sh --formats tar first)" >&2; exit 1; }
+[[ -f "$TARBALL" ]] || { echo "error: $TARBALL not found (run packaging/linux/package.sh --formats tar first)" >&2; exit 1; }
for tool in flatpak flatpak-builder; do
command -v "$tool" >/dev/null || { echo "error: $tool not found (apt install flatpak flatpak-builder librsvg2-common)" >&2; exit 1; }
done
@@ -50,7 +50,7 @@ WORK="$CARGO_TARGET_DIR/flatpak-bundle"
rm -rf "$WORK"
mkdir -p "$WORK/stage"
tar -xzf "$TARBALL" -C "$WORK/stage" --strip-components=1
-[ -x "$WORK/stage/bin/figcraft" ] || { echo "error: $TARBALL has no bin/figcraft" >&2; exit 1; }
+[[ -x "$WORK/stage/bin/figcraft" ]] || { echo "error: $TARBALL has no bin/figcraft" >&2; exit 1; }
cp "$HERE/flatpak/$APP_ID.bundle.yml" "$WORK/$APP_ID.yml"
flatpak remote-add --user --if-not-exists flathub "$FLATHUB"
@@ -63,10 +63,10 @@ OUT="$DIST/$BASENAME.flatpak"
flatpak build-bundle --runtime-repo="$FLATHUB" "$WORK/repo" "$OUT" "$APP_ID" stable
echo "wrote $OUT"
-if [ "$TEST" = 1 ]; then
+if [[ "$TEST" = 1 ]]; then
flatpak install --user -y --noninteractive --reinstall "$OUT"
flatpak info --user "$APP_ID"
- if [ -x "$WORK/stage/bin/figcraft-cli" ]; then smoke=figcraft-cli; else smoke=figcraft; fi
+ if [[ -x "$WORK/stage/bin/figcraft-cli" ]]; then smoke=figcraft-cli; else smoke=figcraft; fi
flatpak run --command="$smoke" "$APP_ID" --version
flatpak run --command=sh "$APP_ID" -c 'ls /app/share/applications /app/share/metainfo /app/share/mime/packages /app/share/icons/hicolor/256x256/apps'
fi
diff --git a/packaging/linux/package.sh b/packaging/linux/package.sh
index 20da2f76..a3ea29b1 100755
--- a/packaging/linux/package.sh
+++ b/packaging/linux/package.sh
@@ -27,7 +27,7 @@ APP_ID=ai.storyteller.figcraft
SKIP_BUILD=0
FORMATS="appimage deb rpm tar"
-while [ $# -gt 0 ]; do
+while [[ $# -gt 0 ]]; do
case "$1" in
--skip-build) SKIP_BUILD=1; shift ;;
--formats) FORMATS="$2"; shift 2 ;;
@@ -48,7 +48,7 @@ BASENAME="figcraft-$VERSION-linux-$ARCH"
echo "==> FigCraft $VERSION for Linux $ARCH ($FORMATS; ${BINS[*]})"
-if [ "$SKIP_BUILD" = 0 ]; then
+if [[ "$SKIP_BUILD" = 0 ]]; then
(cd "$ROOT" && cargo build --release --locked "${CARGO_PKGS[@]}" ${CROSS_TARGET:+--target "$CROSS_TARGET"})
fi
BIN="$CARGO_TARGET_DIR/${CROSS_TARGET:+$CROSS_TARGET/}release"
@@ -78,7 +78,7 @@ if command -v appstreamcli >/dev/null; then
appstreamcli validate --no-net --explain "$STAGE/usr/share/metainfo/$APP_ID.metainfo.xml"
fi
-has() { case " $FORMATS " in *" $1 "*) return 0 ;; *) return 1 ;; esac; }
+has() { local format="$1"; case " $FORMATS " in *" $format "*) return 0 ;; *) return 1 ;; esac; }
# ---- .tar.gz ------------------------------------------------------------------------------------
if has tar; then
@@ -96,7 +96,7 @@ if has deb || has rpm; then
# nfpm expands env vars in fields like `version` and `arch`, but not in `contents[].src`.
# Without the CLI, drop its `#cli` lines.
cli_filter='/#cli$/d'
- [ "$HAS_CLI" = 1 ] && cli_filter='s/ #cli$//'
+ [[ "$HAS_CLI" = 1 ]] && cli_filter='s/ #cli$//'
sed -e "s|\${STAGE}|$STAGE|g" -e "$cli_filter" "$HERE/nfpm.yaml" >"$WORK/nfpm.yaml"
for fmt in deb rpm; do
if has "$fmt"; then (cd "$ROOT" && nfpm package -f "$WORK/nfpm.yaml" -p "$fmt" -t "$DIST/$BASENAME.$fmt"); fi
@@ -105,6 +105,23 @@ fi
# ---- AppImage -----------------------------------------------------------------------------------
if has appimage; then
+ APPIMAGETOOL_VERSION=1.9.1
+ case "$ARCH" in
+ x86_64) APPIMAGETOOL_SHA256=ed4ce84f0d9caff66f50bcca6ff6f35aae54ce8135408b3fa33abfc3cb384eb0 ;;
+ aarch64) APPIMAGETOOL_SHA256=f0837e7448a0c1e4e650a93bb3e85802546e60654ef287576f46c71c126a9158 ;;
+ *) APPIMAGETOOL_SHA256='' ;;
+ esac
+ # appimagetool otherwise fetches the unpinned type2-runtime `continuous` build and embeds it.
+ APPIMAGE_RUNTIME_VERSION=20251108
+ case "$ARCH" in
+ x86_64) APPIMAGE_RUNTIME_SHA256=2fca8b443c92510f1483a883f60061ad09b46b978b2631c807cd873a47ec260d ;;
+ aarch64) APPIMAGE_RUNTIME_SHA256=00cbdfcf917cc6c0ff6d3347d59e0ca1f7f45a6df1a428a0d6d8a78664d87444 ;;
+ *) APPIMAGE_RUNTIME_SHA256='' ;;
+ esac
+ if [[ -z "$APPIMAGE_RUNTIME_SHA256" ]]; then
+ echo "no pinned AppImage runtime for $ARCH; build the AppImage on x86_64 or aarch64" >&2
+ exit 2
+ fi
APPDIR="$WORK/FigCraft.AppDir"
cp -R "$STAGE" "$APPDIR"
mv "$APPDIR/usr/share/doc" "$WORK/doc-unused"
@@ -118,18 +135,37 @@ if has appimage; then
ln -s "$APP_ID.png" "$APPDIR/.DirIcon"
TOOL="${APPIMAGETOOL:-$(command -v appimagetool || true)}"
- 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"
- chmod +x "$TOOL"
+ if [[ -z "$TOOL" ]]; then
+ if [[ -z "$APPIMAGETOOL_SHA256" ]]; then
+ echo "no pinned appimagetool for $ARCH; set APPIMAGETOOL or put appimagetool on PATH" >&2
+ exit 2
fi
+ TOOL="$CARGO_TARGET_DIR/appimagetool-$APPIMAGETOOL_VERSION-$ARCH.AppImage"
+ if [[ ! -x "$TOOL" ]]; then
+ download="$TOOL.download"
+ curl --proto '=https' -fsSL -o "$download" \
+ "https://github.com/AppImage/appimagetool/releases/download/$APPIMAGETOOL_VERSION/appimagetool-$ARCH.AppImage"
+ printf '%s %s\n' "$APPIMAGETOOL_SHA256" "$download" | sha256sum -c -
+ chmod 755 "$download"
+ mv "$download" "$TOOL"
+ fi
+ printf '%s %s\n' "$APPIMAGETOOL_SHA256" "$TOOL" | sha256sum -c -
fi
+ RUNTIME="$CARGO_TARGET_DIR/appimage-runtime-$APPIMAGE_RUNTIME_VERSION-$ARCH"
+ if [[ ! -f "$RUNTIME" ]]; then
+ download="$RUNTIME.download"
+ curl --proto '=https' -fsSL -o "$download" \
+ "https://github.com/AppImage/type2-runtime/releases/download/$APPIMAGE_RUNTIME_VERSION/runtime-$ARCH"
+ printf '%s %s\n' "$APPIMAGE_RUNTIME_SHA256" "$download" | sha256sum -c -
+ mv "$download" "$RUNTIME"
+ fi
+ printf '%s %s\n' "$APPIMAGE_RUNTIME_SHA256" "$RUNTIME" | sha256sum -c -
# Absolute, because appimagetool runs in $DIST below (CARGO_TARGET_DIR or APPIMAGETOOL may be
# relative, e.g. target/agent-).
OUT="$(cd "$DIST" && pwd)/$BASENAME.AppImage"
APPDIR="$(cd "$APPDIR" && pwd)"
TOOL="$(cd "$(dirname "$TOOL")" && pwd)/$(basename "$TOOL")"
+ RUNTIME="$(cd "$(dirname "$RUNTIME")" && pwd)/$(basename "$RUNTIME")"
# A .zsync left by an earlier run would hide a missing zsyncmake and describe another file.
rm -f "$OUT.zsync"
# Update information: AppImageUpdate, AppImageLauncher and the like read it from the
@@ -141,18 +177,18 @@ if has appimage; then
# Extract-and-run: works without FUSE (containers, CI). The output embeds the static runtime,
# so users don't need libfuse2 either. With zsyncmake on the host (CI installs the zsync
# package) appimagetool also writes the .zsync, into its working directory, hence the cd.
- (cd "$DIST" && ARCH="$ARCH" APPIMAGE_EXTRACT_AND_RUN=1 "$TOOL" --no-appstream -u "$UPDATE_INFO" "$APPDIR" "$OUT")
+ (cd "$DIST" && ARCH="$ARCH" APPIMAGE_EXTRACT_AND_RUN=1 "$TOOL" --no-appstream --runtime-file "$RUNTIME" -u "$UPDATE_INFO" "$APPDIR" "$OUT")
echo "wrote $OUT"
- if [ -s "$OUT.zsync" ]; then
+ if [[ -s "$OUT.zsync" ]]; then
echo "wrote $OUT.zsync"
else
warn "zsyncmake not found, so $OUT.zsync was not written; AppImage delta updates need it"
fi
fi
-if [ -z "${CROSS_TARGET:-}" ]; then
+if [[ -z "${CROSS_TARGET:-}" ]]; then
"$STAGE/usr/bin/$(smoke_bin)" --version
-elif [ -n "${EMULATOR:-}" ]; then
+elif [[ -n "${EMULATOR:-}" ]]; then
"$EMULATOR" "$STAGE/usr/bin/$(smoke_bin)" --version
fi
echo "==> done"
diff --git a/packaging/macos/import-cert.sh b/packaging/macos/import-cert.sh
index 1150163e..77611537 100755
--- a/packaging/macos/import-cert.sh
+++ b/packaging/macos/import-cert.sh
@@ -12,7 +12,7 @@ umask 077
# shellcheck source=../env.sh
. "$(dirname "${BASH_SOURCE[0]}")/../env.sh"
-if [ -z "${APPLE_CERTIFICATE:-}" ]; then
+if [[ -z "${APPLE_CERTIFICATE:-}" ]]; then
warn "APPLE_CERTIFICATE is not set: macOS builds will be ad-hoc signed and not notarized"
exit 0
fi
@@ -36,13 +36,13 @@ security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KC_PASS"
security list-keychains -d user -s "$KEYCHAIN" $(security list-keychains -d user | tr -d '"')
IDENTITY="$(security find-identity -v -p codesigning "$KEYCHAIN" | awk '/Developer ID Application/ { print $2; exit }')"
-if [ -z "$IDENTITY" ]; then
+if [[ -z "$IDENTITY" ]]; then
security find-identity -v -p codesigning "$KEYCHAIN" >&2
echo "error: no 'Developer ID Application' identity in APPLE_CERTIFICATE" >&2
exit 1
fi
echo "Imported signing identity $IDENTITY"
-if [ -n "${GITHUB_ENV:-}" ]; then
+if [[ -n "${GITHUB_ENV:-}" ]]; then
{ echo "MACOS_SIGN_IDENTITY=$IDENTITY"; echo "MACOS_KEYCHAIN=$KEYCHAIN"; } >>"$GITHUB_ENV"
else
echo "MACOS_SIGN_IDENTITY=$IDENTITY"
diff --git a/packaging/macos/package.sh b/packaging/macos/package.sh
index 87abe94c..7407af7b 100755
--- a/packaging/macos/package.sh
+++ b/packaging/macos/package.sh
@@ -19,7 +19,7 @@ HERE="$ROOT/packaging/macos"
ARCH=universal
SKIP_BUILD=0
-while [ $# -gt 0 ]; do
+while [[ $# -gt 0 ]]; do
case "$1" in
--arch) ARCH="$2"; shift 2 ;;
--skip-build) SKIP_BUILD=1; shift ;;
@@ -44,9 +44,9 @@ DMG="$DIST/figcraft-$VERSION-macos-$ARCH.dmg"
CLI_ZIP="$DIST/figcraft-cli-$VERSION-macos-$ARCH.zip"
NOTARIZE=0
-if [ "$IDENTITY" = "-" ]; then
+if [[ "$IDENTITY" = "-" ]]; then
warn "macOS: ad-hoc signing (no MACOS_SIGN_IDENTITY); artifacts are not notarized"
-elif [ -n "${APPLE_ID:-}" ] && [ -n "${APPLE_PASSWORD:-}" ] && [ -n "${APPLE_TEAM_ID:-}" ]; then
+elif [[ -n "${APPLE_ID:-}" ]] && [[ -n "${APPLE_PASSWORD:-}" ]] && [[ -n "${APPLE_TEAM_ID:-}" ]]; then
NOTARIZE=1
else
warn "macOS: APPLE_ID / APPLE_PASSWORD / APPLE_TEAM_ID incomplete; signed but not notarized"
@@ -55,7 +55,7 @@ fi
echo "==> FigCraft $VERSION for macOS ($ARCH; ${BINS[*]}), identity: $IDENTITY, notarize: $NOTARIZE"
# ---- build -------------------------------------------------------------------------------------
-if [ "$SKIP_BUILD" = 0 ]; then
+if [[ "$SKIP_BUILD" = 0 ]]; then
args=()
for t in "${TARGETS[@]}"; do args+=(--target "$t"); done
(cd "$ROOT" && cargo build --release --locked "${CARGO_PKGS[@]}" "${args[@]}")
@@ -74,9 +74,9 @@ done
sign() {
# Hardened runtime + secure timestamp for a real identity; ad-hoc can't be timestamped.
local ts=(--timestamp)
- [ "$IDENTITY" = "-" ] && ts=(--timestamp=none)
+ [[ "$IDENTITY" = "-" ]] && ts=(--timestamp=none)
local kc=()
- [ -n "${MACOS_KEYCHAIN:-}" ] && kc=(--keychain "$MACOS_KEYCHAIN")
+ [[ -n "${MACOS_KEYCHAIN:-}" ]] && kc=(--keychain "$MACOS_KEYCHAIN")
codesign --force --sign "$IDENTITY" ${kc[@]+"${kc[@]}"} "${ts[@]}" "$@"
}
@@ -88,8 +88,8 @@ notarize() {
echo "$out"
id="$(printf '%s' "$out" | plutil -extract id raw -o - - 2>/dev/null || true)"
status="$(printf '%s' "$out" | plutil -extract status raw -o - - 2>/dev/null || true)"
- if [ "$status" != "Accepted" ]; then
- if [ -n "$id" ]; then
+ if [[ "$status" != "Accepted" ]]; then
+ if [[ -n "$id" ]]; then
xcrun notarytool log "$id" --apple-id "$APPLE_ID" --password "$APPLE_PASSWORD" --team-id "$APPLE_TEAM_ID" || true
fi
echo "error: notarization of $(basename "$file") failed (status: ${status:-unknown})" >&2
@@ -116,7 +116,7 @@ mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
cp "$WORK/bin/figcraft" "$APP/Contents/MacOS/FigCraft"
cp "$WORK/FigCraft.icns" "$APP/Contents/Resources/FigCraft.icns"
# Licences of the embedded craft-fonts fonts (only when built with CRAFT_FONTS_DIR).
-if [ -n "${CRAFT_FONTS_DIR:-}" ]; then
+if [[ -n "${CRAFT_FONTS_DIR:-}" ]]; then
mkdir -p "$APP/Contents/Resources/Licenses"
copy_font_licences "$APP/Contents/Resources/Licenses"
fi
@@ -132,7 +132,7 @@ sign --options runtime --entitlements "$HERE/entitlements.plist" "$APP/Contents/
sign --options runtime --entitlements "$HERE/entitlements.plist" "$APP"
codesign --verify --strict --deep --verbose=2 "$APP"
-if [ "$NOTARIZE" = 1 ]; then
+if [[ "$NOTARIZE" = 1 ]]; then
ditto -c -k --keepParent "$APP" "$WORK/FigCraft-notarize.zip"
notarize "$WORK/FigCraft-notarize.zip"
retry xcrun stapler staple "$APP"
@@ -154,7 +154,7 @@ hdiutil convert "$WORK/raw.dmg" -format UDZO -imagekey zlib-level=9 -o "$DMG"
rm -f "$WORK/raw.dmg"
sign "$DMG"
codesign --verify --strict --verbose=2 "$DMG"
-if [ "$NOTARIZE" = 1 ]; then
+if [[ "$NOTARIZE" = 1 ]]; then
notarize "$DMG"
retry xcrun stapler staple "$DMG"
retry xcrun stapler validate "$DMG"
@@ -162,7 +162,7 @@ if [ "$NOTARIZE" = 1 ]; then
fi
# ---- CLI ---------------------------------------------------------------------------------------
-if [ "$HAS_CLI" = 1 ]; then
+if [[ "$HAS_CLI" = 1 ]]; then
echo "==> building $CLI_ZIP"
CLI_DIR="$WORK/figcraft-cli-$VERSION-macos-$ARCH"
mkdir -p "$CLI_DIR"
@@ -176,7 +176,7 @@ if [ "$HAS_CLI" = 1 ]; then
ditto -c -k --keepParent "$CLI_DIR" "$CLI_ZIP"
# notarytool accepts a zip of the bare binary. A bare Mach-O can't carry a stapled ticket, so
# Gatekeeper looks the notarization up online when a quarantined copy first runs.
- if [ "$NOTARIZE" = 1 ]; then notarize "$CLI_ZIP"; fi
+ if [[ "$NOTARIZE" = 1 ]]; then notarize "$CLI_ZIP"; fi
"$WORK/bin/figcraft-cli" --version
else
warn "apps/figcraft-cli is not in this workspace: no CLI zip"
diff --git a/packaging/macos/verify.sh b/packaging/macos/verify.sh
index 6080cf87..071629cb 100755
--- a/packaging/macos/verify.sh
+++ b/packaging/macos/verify.sh
@@ -23,7 +23,7 @@ set -euo pipefail
. "$(dirname "${BASH_SOURCE[0]}")/../env.sh"
ARCH=universal
-while [ $# -gt 0 ]; do
+while [[ $# -gt 0 ]]; do
case "$1" in
--arch) ARCH="$2"; shift 2 ;;
-h | --help) sed -n '2,20p' "$0"; exit 0 ;;
@@ -41,13 +41,13 @@ DMG="$DIST/figcraft-$VERSION-macos-$ARCH.dmg"
CLI_ZIP="$DIST/figcraft-cli-$VERSION-macos-$ARCH.zip"
IDENTITY="${MACOS_SIGN_IDENTITY:--}"
STRICT=0
-if [ "$IDENTITY" != "-" ] && [ -n "${APPLE_ID:-}" ] && [ -n "${APPLE_PASSWORD:-}" ] && [ -n "${APPLE_TEAM_ID:-}" ]; then
+if [[ "$IDENTITY" != "-" ]] && [[ -n "${APPLE_ID:-}" ]] && [[ -n "${APPLE_PASSWORD:-}" ]] && [[ -n "${APPLE_TEAM_ID:-}" ]]; then
STRICT=1
fi
FAILED=0
fail() {
- if [ "$STRICT" = 1 ]; then
+ if [[ "$STRICT" = 1 ]]; then
echo "error: $*" >&2
FAILED=1
else
@@ -58,22 +58,22 @@ fail() {
# spctl's online ticket lookup can lag a few seconds behind notarytool's "Accepted".
assess() {
local out attempt tries=1
- [ "$STRICT" = 1 ] && tries=5
+ [[ "$STRICT" = 1 ]] && tries=5
for attempt in $(seq "$tries"); do
if out="$(spctl "$@" 2>&1)"; then
printf '%s\n' "$out"
return 0
fi
- [ "$attempt" = "$tries" ] || sleep 10
+ [[ "$attempt" = "$tries" ]] || sleep 10
done
printf '%s\n' "$out"
return 1
}
FILES=("$DMG")
-if [ "$HAS_CLI" = 1 ]; then FILES+=("$CLI_ZIP"); fi
+if [[ "$HAS_CLI" = 1 ]]; then FILES+=("$CLI_ZIP"); fi
for f in "${FILES[@]}"; do
- if [ ! -f "$f" ]; then
+ if [[ ! -f "$f" ]]; then
echo "error: missing $f" >&2
exit 1
fi
@@ -83,11 +83,11 @@ WORK="$(mktemp -d "${RUNNER_TEMP:-${TMPDIR:-/tmp}}/figcraft-verify.XXXXXX")"
trap 'rm -rf "$WORK"' EXIT
# ---- CLI zip (when apps/figcraft-cli exists) ----------------------------------------------------
-if [ "$HAS_CLI" = 1 ]; then
+if [[ "$HAS_CLI" = 1 ]]; then
echo "==> $(basename "$CLI_ZIP")"
ditto -x -k "$CLI_ZIP" "$WORK/cli"
CLI="$WORK/cli/figcraft-cli-$VERSION-macos-$ARCH/figcraft-cli"
- if [ ! -x "$CLI" ]; then
+ if [[ ! -x "$CLI" ]]; then
echo "error: $(basename "$CLI_ZIP") has no executable figcraft-cli-$VERSION-macos-$ARCH/figcraft-cli" >&2
exit 1
fi
@@ -111,7 +111,7 @@ if [ "$HAS_CLI" = 1 ]; then
|| fail "figcraft-cli is not signed with a Developer ID Application identity"
printf '%s\n' "$details" | grep -q '^Timestamp=' \
|| fail "figcraft-cli signature has no secure timestamp"
- if [ -n "${APPLE_TEAM_ID:-}" ]; then
+ if [[ -n "${APPLE_TEAM_ID:-}" ]]; then
printf '%s\n' "$details" | grep -qx "TeamIdentifier=$APPLE_TEAM_ID" \
|| fail "figcraft-cli is signed by a different team"
fi
@@ -129,25 +129,25 @@ fi
# ---- DMG ---------------------------------------------------------------------------------------
echo "==> $(basename "$DMG")"
codesign --verify --strict --verbose=2 "$DMG"
-if [ "$STRICT" = 1 ]; then
+if [[ "$STRICT" = 1 ]]; then
retry xcrun stapler validate "$DMG" || fail "no notarization ticket stapled to the DMG"
assess --assess --type open --context context:primary-signature -vv "$DMG" \
|| fail "Gatekeeper rejects the DMG"
fi
-if [ "$FAILED" != 0 ]; then
+if [[ "$FAILED" != 0 ]]; then
echo "error: macOS artifacts failed verification" >&2
exit 1
fi
-if [ "$STRICT" = 1 ]; then
+if [[ "$STRICT" = 1 ]]; then
result="signed (Developer ID, hardened runtime), notarized; DMG stapled"
else
result="signature intact; Developer ID and notarization not required (no signing secrets)"
fi
echo "==> verified: $result"
-if [ -n "${GITHUB_STEP_SUMMARY:-}" ]; then
+if [[ -n "${GITHUB_STEP_SUMMARY:-}" ]]; then
names="\`$(basename "$DMG")\`"
- if [ "$HAS_CLI" = 1 ]; then names="$names, \`$(basename "$CLI_ZIP")\`"; fi
+ if [[ "$HAS_CLI" = 1 ]]; then names="$names, \`$(basename "$CLI_ZIP")\`"; fi
echo "- macOS $names: $result" >>"$GITHUB_STEP_SUMMARY"
fi
diff --git a/packaging/server/install-test.sh b/packaging/server/install-test.sh
index 303d08de..2ebe5176 100755
--- a/packaging/server/install-test.sh
+++ b/packaging/server/install-test.sh
@@ -10,7 +10,7 @@ WORK="$(mktemp -d)"
trap 'rm -rf "$WORK"' EXIT
FAILED=0
-main() { bash "$HERE/install.sh" --caddy-main "$1" ops@example.com; }
+main() { local caddyfile="$1"; bash "$HERE/install.sh" --caddy-main "$caddyfile" ops@example.com; }
fail() { printf 'FAIL: %s\n' "$*" >&2; FAILED=1; }
# Missing: ours.
@@ -28,7 +28,7 @@ printf 'shop.example.com {\n\treverse_proxy 127.0.0.1:8080\n}\n' >"$WORK/theirs"
cp "$WORK/theirs" "$WORK/run1"
main "$WORK/run1" >"$WORK/run2"
grep -q 'shop.example.com' "$WORK/run2" || fail "the operator's site is kept"
-[ "$(grep -c 'import figcraft-server.caddy' "$WORK/run2")" = 1 ] || fail "one import line is added"
+[[ "$(grep -c 'import figcraft-server.caddy' "$WORK/run2")" = 1 ]] || fail "one import line is added"
main "$WORK/run2" >"$WORK/run3"
cmp -s "$WORK/run2" "$WORK/run3" || fail "running again leaves a Caddyfile with other sites as it is"
main "$WORK/run3" >"$WORK/run4"
@@ -39,5 +39,5 @@ main "$WORK/none" >"$WORK/ours1"
main "$WORK/ours1" >"$WORK/ours2"
cmp -s "$WORK/ours1" "$WORK/ours2" || fail "our own Caddyfile stays the same"
-if [ "$FAILED" = 0 ]; then echo "install.sh Caddyfile handling: ok"; fi
+if [[ "$FAILED" = 0 ]]; then echo "install.sh Caddyfile handling: ok"; fi
exit "$FAILED"
diff --git a/packaging/server/install.sh b/packaging/server/install.sh
index 11c489a3..94acd578 100755
--- a/packaging/server/install.sh
+++ b/packaging/server/install.sh
@@ -41,7 +41,7 @@ SERVICE=figcraft-server
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# The source tree this script sits in (packaging/server/ of a copy or checkout), if any.
LOCAL_SRC=""
-if [ -f "$HERE/../../Cargo.toml" ] && [ -d "$HERE/../../apps/figcraft-server" ]; then
+if [[ -f "$HERE/../../Cargo.toml" ]] && [[ -d "$HERE/../../apps/figcraft-server" ]]; then
LOCAL_SRC="$(cd "$HERE/../.." && pwd)"
fi
@@ -64,9 +64,9 @@ MARK="# figcraft-server (install.sh)"
caddy_main() { # caddy_main FILE EMAIL: the main Caddyfile to install, on stdout
local file="$1" email="$2"
- if [ -f "$file" ] && grep -qE '^[[:space:]]*import[[:space:]]+figcraft-server\.caddy[[:space:]]*$' "$file"; then
+ if [[ -f "$file" ]] && grep -qE '^[[:space:]]*import[[:space:]]+figcraft-server\.caddy[[:space:]]*$' "$file"; then
cat "$file" # it imports our site already: kept exactly as it is
- elif [ ! -f "$file" ] || ! grep -qvE '^[[:space:]]*(#|$|:80|\{|\}|root|file_server)' "$file"; then
+ elif [[ ! -f "$file" ]] || ! grep -qvE '^[[:space:]]*(#|$|:80|\{|\}|root|file_server)' "$file"; then
# Missing, or only the example site the package ships: ours, with the certificate email.
printf '%s\n{\n\temail %s\n}\n\nimport figcraft-server.caddy\n' "$MARK" "$email"
else
@@ -76,7 +76,7 @@ caddy_main() { # caddy_main FILE EMAIL: the main Caddyfile to install, on stdout
fi
}
-while [ $# -gt 0 ]; do
+while [[ $# -gt 0 ]]; do
case "$1" in
# For tests (packaging/server/install-test.sh): print the Caddyfile this script would write.
--caddy-main) caddy_main "${2:-}" "${3:-}"; exit 0 ;;
@@ -95,7 +95,7 @@ while [ $# -gt 0 ]; do
esac
done
-[ "$(id -u)" -eq 0 ] || die "run it as root (sudo ./install.sh ...)"
+[[ "$(id -u)" -eq 0 ]] || die "run it as root (sudo ./install.sh ...)"
# shellcheck source=/dev/null
. /etc/os-release
case " ${ID:-} ${ID_LIKE:-} " in
@@ -104,9 +104,9 @@ case " ${ID:-} ${ID_LIKE:-} " in
esac
ask() { # ask VAR "question" FLAG: read an answer from the terminal when the value wasn't given
- local var="$1" question="$2" answer
- if [ -z "${!var}" ]; then
- [ -t 0 ] || die "give $3 (no terminal to ask on)"
+ local var="$1" question="$2" flag="$3" answer
+ if [[ -z "${!var}" ]]; then
+ [[ -t 0 ]] || die "give $flag (no terminal to ask on)"
read -r -p "$question " answer
printf -v "$var" '%s' "$answer"
fi
@@ -115,6 +115,7 @@ ask HOST "DNS name people will use (e.g. figcraft.example.com):" "--host"
ask EMAIL "Email for Let's Encrypt and the abuse contact shown to users:" "--email"
case "$HOST" in
"" | *[!A-Za-z0-9.-]* | .* | *. ) die "--host must be a DNS name like figcraft.example.com" ;;
+ *) ;;
esac
case "$EMAIL" in
*@*.*) ;;
@@ -126,6 +127,7 @@ case "$TERMS" in
esac
case "$EMAIL$TERMS" in
*[[:space:]\"\\]*) die "--email and --terms can't contain spaces, quotes or backslashes" ;;
+ *) ;;
esac
export DEBIAN_FRONTEND=noninteractive
@@ -138,6 +140,7 @@ ARCH="$(uname -m)"
case "$ARCH" in
amd64) ARCH=x86_64 ;;
arm64) ARCH=aarch64 ;;
+ *) ;; # already a release name (x86_64, aarch64)
esac
# --- The binary -----------------------------------------------------------------------------
@@ -146,17 +149,17 @@ 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
- [ -n "$version" ] || return 1
+ if [[ -z "$version" ]]; then
+ 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"
dir="$WORK/release"
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"
@@ -165,7 +168,7 @@ from_release() { # download and check the release archive; sets NEW_BIN and FILE
SWAP=""
cleanup() {
- if [ -n "$SWAP" ]; then
+ if [[ -n "$SWAP" ]]; then
swapoff "$SWAP" 2>/dev/null || true
rm -f "$SWAP"
fi
@@ -174,7 +177,7 @@ trap cleanup EXIT
as_builder() { # run a command as the unprivileged build user, with its own toolchain
local jobs=()
- if [ -n "${CARGO_BUILD_JOBS:-}" ]; then jobs=("CARGO_BUILD_JOBS=$CARGO_BUILD_JOBS"); fi
+ if [[ -n "${CARGO_BUILD_JOBS:-}" ]]; then jobs=("CARGO_BUILD_JOBS=$CARGO_BUILD_JOBS"); fi
runuser -u "$BUILDER" -- env HOME="$BUILD" RUSTUP_HOME="$BUILD/rustup" CARGO_HOME="$BUILD/cargo" \
CARGO_TARGET_DIR="$BUILD/target" "${jobs[@]}" "$@"
}
@@ -184,27 +187,27 @@ from_source() { # build the source tree around this script, else a fresh clone;
apt-get install -y -qq build-essential git pkg-config >/dev/null
id -u "$BUILDER" >/dev/null 2>&1 || useradd --system --home-dir "$BUILD" --shell /usr/sbin/nologin "$BUILDER"
install -d -o "$BUILDER" -g "$BUILDER" -m 755 "$BUILD"
- if [ ! -x "$BUILD/cargo/bin/cargo" ]; then
+ if [[ ! -x "$BUILD/cargo/bin/cargo" ]]; then
as_builder sh -c "curl --proto '=https' --tlsv1.2 -fsSL https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable --no-modify-path" >/dev/null
else
as_builder "$BUILD/cargo/bin/rustup" update stable >/dev/null
fi
# The source root installs files from is root's own (the copy beside this script, or root's
# clone); the build user only ever builds a copy of it.
- if [ -n "$LOCAL_SRC" ]; then
+ if [[ -n "$LOCAL_SRC" ]]; then
src="$LOCAL_SRC"
say "Building the source in $LOCAL_SRC: this takes a while"
else
src="$WORK/src"
- if [ -d "$src/.git" ]; then
+ if [[ -d "$src/.git" ]]; then
git -C "$src" fetch --quiet --tags origin
else
git clone --quiet "https://github.com/$REPO" "$src" ||
die "can't clone $REPO (a private repository: copy the source to this machine and run its packaging/server/install.sh)"
fi
- if [ -z "$ref" ]; then
- if [ -n "$VERSION" ]; then ref="v$VERSION"; else ref="$(git -C "$src" tag --list 'v*' --sort=-v:refname | head -n 1)"; fi
- [ -n "$ref" ] || ref=main
+ if [[ -z "$ref" ]]; then
+ if [[ -n "$VERSION" ]]; then ref="v$VERSION"; else ref="$(git -C "$src" tag --list 'v*' --sort=-v:refname | head -n 1)"; fi
+ [[ -n "$ref" ]] || ref=main
fi
say "Building $ref from a clone: this takes a while"
# A branch as it is upstream now, or a tag.
@@ -216,7 +219,7 @@ from_source() { # build the source tree around this script, else a fresh clone;
tar -C "$src" --exclude=./target --exclude=./plugins/target --exclude=./.git -cf - . | as_builder tar -C "$copy" -xf -
# The compiler needs about 2 GB: add a temporary swap file on smaller machines.
mem_kb="$(awk '/^MemTotal:/ {print $2}' /proc/meminfo)"
- if [ "$mem_kb" -lt 2000000 ] && [ -z "$(swapon --show --noheadings)" ]; then
+ if [[ "$mem_kb" -lt 2000000 ]] && [[ -z "$(swapon --show --noheadings)" ]]; then
SWAP="$WORK/swapfile"
say "Adding a temporary 2 GB swap file for the build"
fallocate -l 2G "$SWAP" 2>/dev/null || dd if=/dev/zero of="$SWAP" bs=1M count=2048 status=none
@@ -237,19 +240,19 @@ from_source() { # build the source tree around this script, else a fresh clone;
FILES="$src/packaging/server"
}
-if [ -x "$HERE/figcraft-server" ] && [ "$FROM_SOURCE" = false ]; then
+if [[ -x "$HERE/figcraft-server" ]] && [[ "$FROM_SOURCE" = false ]]; then
NEW_BIN="$HERE/figcraft-server" # run from an unpacked release archive
-elif [ -n "$LOCAL_SRC" ] && [ -z "$VERSION" ]; then
+elif [[ -n "$LOCAL_SRC" ]] && [[ -z "$VERSION" ]]; then
from_source # the source copied to (or checked out on) this machine, as it is
-elif [ "$FROM_SOURCE" = true ] || ! from_release; then
- [ "$FROM_SOURCE" = true ] || say "No release archive for linux-$ARCH: building from source instead"
+elif [[ "$FROM_SOURCE" = true ]] || ! from_release; then
+ [[ "$FROM_SOURCE" = true ]] || say "No release archive for linux-$ARCH: building from source instead"
from_source
fi
-[ -x "$NEW_BIN" ] || die "no figcraft-server binary to install"
+[[ -x "$NEW_BIN" ]] || die "no figcraft-server binary to install"
# The units and the Caddyfile beside this script when it has them (a checkout or an archive).
-[ -f "$HERE/figcraft-backup.timer" ] && FILES="$HERE"
+[[ -f "$HERE/figcraft-backup.timer" ]] && FILES="$HERE"
for f in figcraft-server.service Caddyfile figcraft-backup.service figcraft-backup.timer; do
- [ -f "$FILES/$f" ] || die "$FILES/$f is missing"
+ [[ -f "$FILES/$f" ]] || die "$FILES/$f is missing"
done
# The server's own account runs the binary, from here on too (root never runs what was built).
@@ -267,7 +270,7 @@ fi
# --- Data and settings ----------------------------------------------------------------------
install -d -o figcraft -g figcraft -m 700 "$DATA"
install -d -m 755 "$CONFIG_DIR"
-if [ ! -f "$CONFIG" ]; then
+if [[ ! -f "$CONFIG" ]]; then
say "Writing $CONFIG"
{
printf '# figcraft-server settings (docs/server.md, "Configuration"). install.sh never overwrites this file.\n'
@@ -303,8 +306,9 @@ as_server "$BIN" --config "$CONFIG" check >/dev/null ||
die "$CONFIG isn't right for this figcraft-server (see above; a release older than open hosting needs --from-source)"
install_file() { # install_file SOURCE TARGET MODE: true when it changed
- if cmp -s "$1" "$2"; then return 1; fi
- install -m "$3" "$1" "$2"
+ local source="$1" target="$2" mode="$3"
+ if cmp -s "$source" "$target"; then return 1; fi
+ install -m "$mode" "$source" "$target"
}
# --- systemd --------------------------------------------------------------------------------
@@ -312,16 +316,16 @@ UNITS=false
install_file "$FILES/figcraft-server.service" /etc/systemd/system/figcraft-server.service 644 && UNITS=true
install_file "$FILES/figcraft-backup.service" /etc/systemd/system/figcraft-backup.service 644 && UNITS=true
install_file "$FILES/figcraft-backup.timer" /etc/systemd/system/figcraft-backup.timer 644 && UNITS=true
-if [ "$UNITS" = true ]; then
+if [[ "$UNITS" = true ]]; then
systemctl daemon-reload
CHANGED=true
fi
systemctl enable --quiet "$SERVICE"
-if [ "$CHANGED" = true ] || ! systemctl is-active --quiet "$SERVICE"; then
+if [[ "$CHANGED" = true ]] || ! systemctl is-active --quiet "$SERVICE"; then
say "Starting figcraft-server"
systemctl restart "$SERVICE"
fi
-if [ "$BACKUPS" = true ]; then
+if [[ "$BACKUPS" = true ]]; then
systemctl enable --now --quiet figcraft-backup.timer
fi
@@ -339,15 +343,15 @@ MAIN="$(mktemp)"
caddy_main "$CADDYFILE" "$EMAIL" >"$MAIN"
CADDY_CHANGED=false
for f in "$CADDYFILE" "$SITE_FILE"; do
- if [ -f "$f" ]; then cp -p "$f" "$f.before-figcraft"; else rm -f "$f.before-figcraft"; fi
+ if [[ -f "$f" ]]; then cp -p "$f" "$f.before-figcraft"; else rm -f "$f.before-figcraft"; fi
done
install_file "$SITE" "$SITE_FILE" 644 && CADDY_CHANGED=true
install_file "$MAIN" "$CADDYFILE" 644 && CADDY_CHANGED=true
rm -f "$SITE" "$MAIN"
-if [ "$CADDY_CHANGED" = true ]; then
+if [[ "$CADDY_CHANGED" = true ]]; then
if ! caddy validate --config "$CADDYFILE" --adapter caddyfile >/dev/null 2>&1; then
for f in "$CADDYFILE" "$SITE_FILE"; do
- if [ -f "$f.before-figcraft" ]; then cp -p "$f.before-figcraft" "$f"; else rm -f "$f"; fi
+ if [[ -f "$f.before-figcraft" ]]; then cp -p "$f.before-figcraft" "$f"; else rm -f "$f"; fi
done
die "Caddy doesn't accept the new configuration (the old one is back; see: caddy validate --config $CADDYFILE)"
fi
@@ -356,10 +360,10 @@ fi
systemctl enable --now --quiet caddy
# --- Firewall -------------------------------------------------------------------------------
-if [ "$FIREWALL" = true ]; then
+if [[ "$FIREWALL" = true ]]; then
# The ports sshd really listens on (sudo doesn't pass SSH_CONNECTION on).
SSH_PORTS="$(sshd -T 2>/dev/null | awk '/^port / {print $2}' | sort -u)"
- [ -n "$SSH_PORTS" ] || SSH_PORTS=22
+ [[ -n "$SSH_PORTS" ]] || SSH_PORTS=22
say "Firewall: SSH ($(echo "$SSH_PORTS" | tr '\n' ' ' | sed 's/ $//')), 80 and 443"
for p in $SSH_PORTS; do ufw allow "$p/tcp" >/dev/null; done
ufw allow 80/tcp >/dev/null
@@ -370,12 +374,12 @@ if [ "$FIREWALL" = true ]; then
# Other services reachable from outside would be cut off by enabling ufw.
OTHERS=""
for a in $(ss -Hltn | awk '{print $4}'); do
- case "$a" in 127.* | "[::1]:"* | ::1:*) continue ;; esac
+ case "$a" in 127.* | "[::1]:"* | ::1:*) continue ;; *) ;; esac
port="${a##*:}"
case " $(echo "$SSH_PORTS" | tr '\n' ' ') 80 443 " in *" $port "*) continue ;; esac
OTHERS="$OTHERS $port"
done
- if [ -n "$OTHERS" ] && [ "$FIREWALL_ANYWAY" = false ]; then
+ if [[ -n "$OTHERS" ]] && [[ "$FIREWALL_ANYWAY" = false ]]; then
warn "other services listen on port(s)$OTHERS: ufw was not enabled (rules added; allow those ports, then 'ufw enable', or run again with --firewall-anyway)"
else
ufw --force enable >/dev/null
@@ -395,7 +399,7 @@ cat < Publish to server..., address wss://$HOST/
- $(if [ "$OPEN" = true ]; then echo "(open to the public: no key needed; each file gets an owner token)"; else echo "(with the key: $ADMIN key)"; fi)
+ $(if [[ "$OPEN" = true ]]; then echo "(open to the public: no key needed; each file gets an owner token)"; else echo "(with the key: $ADMIN key)"; fi)
Check: curl https://$HOST/healthz (once DNS points here and Caddy has its certificate)
Logs: journalctl -u $SERVICE -f
diff --git a/packaging/server/package.sh b/packaging/server/package.sh
index 7d2f9c54..5f306327 100755
--- a/packaging/server/package.sh
+++ b/packaging/server/package.sh
@@ -25,11 +25,12 @@ ARCH="$(uname -m)"
case "$ARCH" in
arm64) ARCH=aarch64 ;;
amd64) ARCH=x86_64 ;;
+ *) ;; # already a release name (x86_64, aarch64)
esac
NAME="figcraft-server-$VERSION-$OS-$ARCH"
echo "==> figcraft-server $VERSION for $OS $ARCH"
-if [ "$SKIP_BUILD" = 0 ]; then
+if [[ "$SKIP_BUILD" = 0 ]]; then
(cd "$ROOT" && cargo build --release --locked -p figcraft-server)
fi
WORK="$CARGO_TARGET_DIR/server-package"
diff --git a/packaging/web/package.sh b/packaging/web/package.sh
index 0e45c515..f9ee34a7 100755
--- a/packaging/web/package.sh
+++ b/packaging/web/package.sh
@@ -11,13 +11,13 @@ set -euo pipefail
. "$(dirname "${BASH_SOURCE[0]}")/../env.sh"
HERE="$ROOT/packaging/web"
-if [ "${1:-}" != "--skip-build" ]; then
+if [[ "${1:-}" != "--skip-build" ]]; then
command -v trunk >/dev/null || { echo "error: trunk not found (cargo install trunk --locked)" >&2; exit 1; }
(cd "$ROOT/apps/figcraft-web" && trunk build --release)
fi
SITE="$ROOT/dist/web"
-[ -f "$SITE/index.html" ] || { echo "error: $SITE/index.html missing; run without --skip-build" >&2; exit 1; }
+[[ -f "$SITE/index.html" ]] || { echo "error: $SITE/index.html missing; run without --skip-build" >&2; exit 1; }
# Paths must be relative so the site works under any prefix (public_url = "./" in Trunk.toml).
if grep -Eq '(src|href)="/[^/]' "$SITE/index.html"; then
echo "error: $SITE/index.html has root-absolute URLs; it would break when served from a sub-path" >&2
@@ -30,16 +30,16 @@ fi
MAX_WASM_BYTES="${FIGCRAFT_WASM_MAX_BYTES:-25165824}" # 24 MiB
WASM_COUNT=0
for wasm in "$SITE"/*.wasm; do
- [ -f "$wasm" ] || continue
+ [[ -f "$wasm" ]] || continue
WASM_COUNT=$((WASM_COUNT + 1))
size=$(wc -c <"$wasm" | tr -d ' ')
echo "$(basename "$wasm"): $size bytes ($((size / 1048576)) MiB; limit $MAX_WASM_BYTES)"
- if [ "$size" -gt "$MAX_WASM_BYTES" ]; then
+ if [[ "$size" -gt "$MAX_WASM_BYTES" ]]; then
echo "error: $(basename "$wasm") is $size bytes, over the $MAX_WASM_BYTES-byte limit (Cloudflare's per-file cap is 25 MiB)" >&2
exit 1
fi
done
-[ "$WASM_COUNT" -gt 0 ] || { echo "error: no .wasm in $SITE" >&2; exit 1; }
+[[ "$WASM_COUNT" -gt 0 ]] || { echo "error: no .wasm in $SITE" >&2; exit 1; }
NAME="figcraft-web-$VERSION"
WORK="$CARGO_TARGET_DIR/web-package"
diff --git a/packaging/windows/sign.ps1 b/packaging/windows/sign.ps1
index 3d94747a..795ef067 100644
--- a/packaging/windows/sign.ps1
+++ b/packaging/windows/sign.ps1
@@ -56,8 +56,8 @@ if (-not $haveCert -and -not $haveAzure) {
$script:SignTool = Find-SignTool
$common = @('sign', '/v', '/fd', 'SHA256', '/td', 'SHA256', '/d', 'FigCraft', '/du', 'https://github.com/storytold/figcraft')
-$tmp = Join-Path ([IO.Path]::GetTempPath()) "figcraft-sign-$PID"
-New-Item -ItemType Directory -Force -Path $tmp | Out-Null
+$tmp = Join-Path ([IO.Path]::GetTempPath()) "figcraft-sign-$([IO.Path]::GetRandomFileName())"
+New-Item -ItemType Directory -Path $tmp | Out-Null
try {
if ($haveCert) {
@@ -73,8 +73,15 @@ try {
Write-Output "Signing with Azure Trusted Signing ($env:AZURE_SIGNING_ACCOUNT / $env:AZURE_CERT_PROFILE): $($Files -join ', ')"
# The dlib authenticates with DefaultAzureCredential, which reads AZURE_TENANT_ID,
# AZURE_CLIENT_ID and AZURE_CLIENT_SECRET from the environment.
+ $trustedSigningVersion = '1.0.95'
+ $trustedSigningSha256 = '3bfcf1e0a3cb42af1692f0a8ed45c15de070c2de86f28a59b2795d904d8a920f'
$pkg = Join-Path $tmp 'trusted-signing.zip'
- Invoke-WebRequest -Uri 'https://www.nuget.org/api/v2/package/Microsoft.Trusted.Signing.Client' -OutFile $pkg
+ $uri = "https://api.nuget.org/v3-flatcontainer/microsoft.trusted.signing.client/$trustedSigningVersion/microsoft.trusted.signing.client.$trustedSigningVersion.nupkg"
+ Invoke-WebRequest -Uri $uri -OutFile $pkg
+ $actualHash = (Get-FileHash -Path $pkg -Algorithm SHA256).Hash.ToLowerInvariant()
+ if ($actualHash -ne $trustedSigningSha256) {
+ throw "Microsoft.Trusted.Signing.Client $trustedSigningVersion checksum mismatch"
+ }
Expand-Archive -Path $pkg -DestinationPath (Join-Path $tmp 'client') -Force
$dlib = Get-ChildItem -Path (Join-Path $tmp 'client') -Recurse -Filter Azure.CodeSigning.Dlib.dll |
Where-Object { $_.FullName -match '\\x64\\' } | Select-Object -First 1
diff --git a/sonar-project.properties b/sonar-project.properties
new file mode 100644
index 00000000..92562d54
--- /dev/null
+++ b/sonar-project.properties
@@ -0,0 +1,2 @@
+sonar.projectKey=storytold_figcraft
+sonar.organization=storytold
diff --git a/xtask/src/main.rs b/xtask/src/main.rs
index e3f00e8b..6c09c921 100644
--- a/xtask/src/main.rs
+++ b/xtask/src/main.rs
@@ -1,6 +1,9 @@
//! Project tasks: `cargo xtask `.
//!
-//! - `ci` fmt check, clippy -D warnings, tests, layers, assets, wasm check
+//! - `ci` fmt check, clippy -D warnings, tests, the translation report, layers, assets, wasm check
+//! - `test` the workspace tests (nextest when installed) and doctests
+//! - `i18n-report` the UI strings, command labels and menu wordings each language lacks (never fails
+//! on them: a missing translation reads English)
//! - `layers` crate dependency layering check
//! - `assets` every file under assets/ and docs/ has a row in ATTRIBUTION.md
//! - `parity` menu-catalog coverage → docs/parity-checklist.md
@@ -16,7 +19,7 @@
mod icon;
mod layers;
-use std::process::{Command, ExitCode};
+use std::process::{Command, ExitCode, Stdio};
fn run(cmd: &mut Command) -> bool {
eprintln!("$ {cmd:?}");
@@ -36,6 +39,8 @@ fn main() -> ExitCode {
let task = args.first().map(String::as_str).unwrap_or("help");
let ok = match task {
"ci" => ci(),
+ "test" => test(),
+ "i18n-report" => i18n_report(),
"layers" => layers::check(&root()),
"assets" => assets(),
"parity" => parity(),
@@ -45,7 +50,7 @@ fn main() -> ExitCode {
"plugins" => plugins(),
"bench" => bench(args.get(1).map_or("1000,10000,50000", String::as_str)),
_ => {
- eprintln!("tasks: ci, layers, assets, parity, version [set X.Y.Z], icon, wasm, plugins, bench [SIZES]");
+ eprintln!("tasks: ci, test, i18n-report, layers, assets, parity, version [set X.Y.Z], icon, wasm, plugins, bench [SIZES]");
task == "help"
}
};
@@ -54,16 +59,38 @@ fn main() -> ExitCode {
fn ci() -> bool {
run(cargo().args(["fmt", "--all", "--check"]))
- && run(cargo().args(["clippy", "--workspace", "--all-targets", "--", "-D", "warnings"]))
- && run(cargo().args(["test", "--workspace"]))
+ && run(cargo().args(["clippy", "--workspace", "--all-targets", "--keep-going", "--", "-D", "warnings"]))
+ && test()
+ && i18n_report()
&& layers::check(&root())
&& assets()
&& wasm()
}
+/// Unit and integration tests with nextest when it is installed (`cargo install cargo-nextest`),
+/// else with `cargo test`; then the doctests, which nextest does not run. Examples are not built:
+/// clippy's `--all-targets` already checks them.
+fn test() -> bool {
+ let nextest = cargo().args(["nextest", "--version"]).stdout(Stdio::null()).stderr(Stdio::null()).status().is_ok_and(|s| s.success());
+ let units = if nextest {
+ run(cargo().args(["nextest", "run", "--workspace", "--lib", "--bins", "--tests"]))
+ } else {
+ eprintln!("xtask: cargo-nextest not installed; running unit and integration tests with `cargo test`");
+ run(cargo().args(["test", "--workspace", "--lib", "--bins", "--tests"]))
+ };
+ units && run(cargo().args(["test", "--workspace", "--doc"]))
+}
+
+/// Prints what each language's catalog lacks, from the test that lists it. `--workspace --lib`
+/// reuses the binaries `test` built.
+fn i18n_report() -> bool {
+ run(cargo().args(["test", "-q", "--workspace", "--lib", "--", "--exact", "i18n::tests::missing_translations_report", "--nocapture"]))
+}
+
fn wasm() -> bool {
run(cargo().args([
"check",
+ "--keep-going",
"--target",
"wasm32-unknown-unknown",
"-p",