510 Commits

Author SHA1 Message Date
BFlat a751a4045f Windows: full screen from a maximised window covers the taskbar's strip (#2943)
* Windows: full screen from a maximised window covers the taskbar's strip (#2941)

* Run CI again
2026-12-03 01:56:46 +07:00
BFlat c7546e9e0e M6: Open and import Adobe XD (.xd) files, best effort (#2077) (#2912)
* M6: Open and import Adobe XD (.xd) files, best effort (#2077)

The archive's artboards, pasteboard layers, groups, rectangles, circles,
lines and paths, solid, linear-gradient and image fills, strokes, opacity,
drop shadows and blurs, clip paths and text with styled ranges are mapped
onto the REST importer, as the .sketch import is. Point text is measured
so its first baseline and aligned edge stay where the file put them.
File > Open, Import, drop, CLI and MCP take .xd files, in the browser too.

* M6: XD import: clip paths take only shapes, one style range keeps its decoration, groups refit after point text (#2077)

From review: a clip path holding a group clipped by itself recursed without end;
a single style range covering a whole text dropped its underline or strikethrough;
groups kept the bounds of the guessed text size after the point text was measured.
2026-12-02 10:16:44 +07:00
BFlat 28ddd45a20 M9: figcraft-server keeps a workspace for the team: publish without the key, straight to the team list (#2119, part) (#2906)
With team_publish = true beside team_files = "edit" (refused with
open_publish), everyone who reaches the server publishes from the app or the
browser with its plain address. The file is on the team list (Home > Online)
for everyone at once, until it is removed, so nobody keeps share links or
tokens to find it again. Such files never expire; whoever published one gets
its owner token, so their app renames, removes or shares it from Home >
Online as on a public server.

The server reports open: true with no idle time, so the existing Publish and
Share flows work unchanged and apps of any version publish there; no message
changed. meta.json marks the file `team`, which counts as shared for the
list, its team link and admission, and which the idle sweep skips.
2026-12-02 08:31:12 +07:00
BFlat 92e3622177 M9: figcraft-server checks its own health in a container, and runs with Docker Compose (#2044, part) (#2903)
figcraft-server healthcheck asks the server on the listen address for /healthz (exit 0 on 200, 1 otherwise), and the distroless image declares it as its HEALTHCHECK. packaging/server/docker-compose.yml builds the image and takes its FIGCRAFT_SERVER_* settings from a .env file beside it, with trusted_proxy defaulting to Docker's address range and the port on loopback. docs/server.md covers the subcommand, Compose, and running behind a platform proxy that ends TLS. Part of #2044.
2026-12-02 08:27:23 +07:00
Jeremy 49cb9b93b8 perf(recovery): cancel in-flight recovery writes off the UI thread (#2890)
* perf(recovery): cancel in-flight recovery writes off the UI thread

* fix(recovery): wait for a cancelled write's cleanup before copying again

The cleanup of a cancelled write removes {uid}.figcraft and {uid}.online,
the same files a new write of that document creates. A document edited
again before that cleanup ended could lose its new copy. Cleanups are
now tracked by document, and a new copy waits for its cleanup (an
emergency save waits on it instead of skipping).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(recovery): keep a cancelled write tracked if its cleanup can't start; drain on quit

- If the recovery-cleanup thread can't start, the cancelled writer is no
  longer detached: its handle and paths stay reachable and that rare case
  waits for it, so it can't remove a later copy of the document.
- Quitting without asking waits for cancelled writes' cleanup before the
  emergency copies, so a saved or closed document's copy can't survive the
  exit and reopen at the next start.
- The replace test holds the writer on a channel instead of sleeping, and
  checks the replacement waits for the cleanup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
2026-12-01 19:54:58 -05:00
BFlat 9087f616d3 perf: eliminate UI-thread freezes on save, recovery and MCP render (#2887) (#2896)
* perf: eliminate UI-thread freezes on save, recovery, MCP render, and Local Share

* Background save runs file.save's own checks, one save at a time

- file.save and the background save share one prepare/write/commit path:
  branch tabs are synced first, unknown params, another tab holding the file
  and the overwrite check refuse as file.save does, and a save under a new
  name leaves the tab saved.
- One save at a time: an MCP file.save waits for the save in flight and
  Save chosen again saves once more after it; a panicking worker ends the
  save with an error instead of blocking every later one.
- The worker writes under the roots the frame ran in (an agent's shortcut).
- Only Save in the menu and its shortcut write in the background; other
  callers (library publish) still save before they go on.
- Recovery: a new copy of a document waits for its dropped copy's cleanup,
  which would otherwise remove it.

* Saving again saves the tab it was chosen in; ui.render draws the selection

- Save chosen while a save is written is kept per tab and runs for that tab
  once the write is committed, not for whichever tab is in front by then.
- ui.render on a worker picks its layers as file.export does (the ids given,
  else the selection, else the page): file.export's choice is now one
  engine function, export_ids, used by both.

* Save chosen again keeps the file access roots it was chosen under

A Save queued behind the save in flight remembers the roots of the frame
that chose it (an agent's shortcut) and runs inside them, not the app's.

* Recheck the file right before a save replaces it; recovery cleanup survives a failed spawn

- A save remembers its own file's state on disk when its checks passed and
  refuses to replace it if another app changed it while the new file was
  written (the background save can take a while).
- A dropped recovery copy's cleanup is a guard: if its helper thread can't
  start, it runs on the calling thread instead of leaving the copy behind.

* A revert or a discarding close stops a background save from replacing the file

A background save holds a gate while it replaces the file; file.revert and
file.close (once it is closing) shut the gates of the tab's saves first, so a
save still being written no longer puts back the edits the tab went back on.
A save replacing the file at that moment finishes before the revert reads it.

---------

Co-authored-by: Jeremy <jeremy8776@googlemail.com>
2026-12-02 07:15:44 +07:00
BFlat 890e149acb M10: on GNOME the title bar's window buttons follow the desktop's layout and look (#2277) (#2883)
FigCraft draws its own title bar on GNOME, but it dropped the window-button
layout the shared window crate reads and always drew Windows' square
minimize, maximize and close at the right. The bar now keeps that layout
(UiState::captions): the buttons sit at the left or right end as the
desktop's button-layout says (Close alone by default), as round buttons on
a faint disc, placed by craft-ui's CaptionPlan. Windows keeps its buttons;
KDE and other desktops that draw their own frame are unchanged.
2026-12-02 05:58:28 +07:00
bflatastic d0a7b8d48e Merge main into #1392 2026-12-02 01:33:20 +07:00
bflatastic 2364f27f93 M1: an unreadable saved file keeps a retryable refresh failure (#1388)
A missing, moved or access-denied file now reports once and is retried on the
30 s deadline, instead of clearing the failure silently; recovery clears it.
2026-12-02 00:54:32 +07:00
bflatastic ff0082043c Merge main into #1392
Port the saved-file refresh onto main's split modules: stamps in automation/file_access,
refresh beside file.open's reload in cmd/file/open, save conflict checks in cmd/file/save.
A refresh also keeps the tab's page views and fit-to-content state. Adds the file.refresh
label to the ar, bs, he, ta and zh-Hant catalogs.
2026-12-02 00:45:32 +07:00
BFlat e77d0db2fe Merge pull request #2828 from mad-af/feat/agent-panel
feat(agent): a built-in Agent tab that designs on the open canvas (part of #1379)
2026-12-01 22:23:32 +07:00
BFlat 73cd44a5ee Merge pull request #2687 from brytoncooper/perf/lazy-images-1313
perf(format,doc,engine): load .figcraft images lazily with bounded LRU and streaming save (#1313)
2026-12-01 19:29:45 +07:00
BFlat 82ca49f3e5 Merge pull request #2537 from tchezery/fix/macos-window-tiling
fix(app): register native macOS Window menu so window tiling shortcuts work
2026-12-01 19:06:53 +07:00
BFlat 9995cdbb97 Merge pull request #2855 from pgaultier/server-trusted-proxy-range
M9: a server behind a container platform's proxy trusts its whole address range (#2854)
2026-12-01 18:55:06 +07:00
bflatastic f4ef76aa72 Merge main into perf/lazy-images-1313
Resolves conflicts in crates/engine/src/lib.rs (keep both test modules) and
crates/penpot/src/export.rs (keep main's orientation check on lazily loaded bytes).
2026-12-01 18:32:41 +07:00
bflatastic 455a5a5722 figcraft-server: --help and --version answer even when an environment setting is invalid 2026-12-01 17:52:58 +07:00
Philippe Gaultier 2dadb3fd33 M9: figcraft-server takes every setting from a FIGCRAFT_SERVER_* environment variable too (#2044, part)
On a container platform the settings file is part of the image, so giving a server its public
address or its proxy meant building an image of its own. Each key of the settings file can now
also come from FIGCRAFT_SERVER_ and the key in capitals (public_url is FIGCRAFT_SERVER_PUBLIC_URL,
max_file_mb is FIGCRAFT_SERVER_MAX_FILE_MB). The variables override the file and flags override
them; an empty variable counts as unset, and a value that doesn't fit its key stops the server
with an error naming the variable. The prefix is FIGCRAFT_SERVER_ rather than FIGCRAFT_, as with
FIGCRAFT_CONTROL_*, so the server's settings never meet the app's own variables. The list of keys
names every field of the settings, so a new key that isn't given its variable doesn't compile.

Part of #2044.
2026-12-01 10:53:54 +01:00
Philippe Gaultier 363a7a257e M9: a server behind a container platform's proxy trusts its whole address range (#2854)
trusted_proxy took one IP address, compared for equality with the connection's peer. Behind the
nginx of a Docker Swarm overlay network (CapRover and other Swarm-based platforms) the proxy's
address changes when its container is recreated, so from then on X-Forwarded-For was silently
ignored and every client counted as the proxy's one address. trusted_proxy now also takes a range
(10.0.0.0/8, fd00::/8), checked against the connection's peer; one address keeps working as before,
so existing settings are unchanged.

Fixes #2854
2026-12-01 10:53:53 +01:00
BFlat f60d2f2060 Merge pull request #2835 from storytold/fix/1915-window-blur
Windows: a restored window is as sharp as a maximized one
2026-12-01 14:46:01 +07:00
BFlat 0916f9f65c Merge pull request #2839 from storytold/feat/2384-fidelity-diff
figcraft-cli diff: compare what two files hold so a round trip can be checked in CI
2026-12-01 14:29:59 +07:00
Mochamad Aufa 1c76c815de Merge remote-tracking branch 'upstream/main' into feat/agent-panel
# Conflicts:
#	crates/ui-egui/Cargo.toml
#	crates/ui-egui/locales/en.toml
#	crates/ui-egui/src/app.rs
#	crates/ui-egui/src/control.rs
#	crates/ui-egui/src/panels/layers.rs
#	crates/ui-egui/src/state.rs
2026-12-01 14:29:52 +07:00
bflatastic 6e2a2971ab Windows: a restored window is as sharp as a maximized one
Direct3D 12 now presents through a composition visual instead of a swap
chain on the window. FigCraft draws its own window frame on Windows, and
while the window is not maximized its client area is a pixel shorter than
the surface the app draws; the window swap chain stretched the picture to
fit, which blurred all text and hairlines. The visual shows it pixel for
pixel. WGPU_DX12_PRESENTATION_SYSTEM still overrides the choice.
2026-12-01 13:50:54 +07:00
bflatastic fd9546a177 figcraft-cli diff: compare what two files hold, so a round trip can be checked in CI (#2384)
`figcraft-cli diff A B [--json]` counts layers by type, fills, strokes,
effects, layout grids, auto layout frames, export settings, prototype
interactions and flows, variable bindings, style links, styles by kind,
variables, collections, modes, images and comments in both files and
prints the counts that differ. It exits 1 when one differs, so a job
can run `convert in.fig out.fig` and `diff in.fig out.fig` and fail on
anything the save dropped. Takes the automation roots like `info`.
2026-12-01 13:49:02 +07:00
BFlat 945be43c36 Merge pull request #2818 from storytold/fix/2774-frame-cost
M1: Windows: a GPU without a Direct3D 12 driver draws with OpenGL again, not on the processor (#2774)
2026-12-01 13:47:19 +07:00
BFlat 0f706b9753 Merge pull request #2827 from storytold/feat/2502-allow-server-publish
M9: a confined headless MCP session can publish to its allowed server (#2502)
2026-12-01 13:06:17 +07:00
bflatastic 2fcb112db8 Test the WARP restart path (#2774)
The start-up plan takes the platform and environment as parameters (Plan::new),
finish takes the restart as a function (finish_with), and the restart command is
built apart from its start (restart_command), so the Windows WARP path runs in
tests on every system. opened returns the error the window's creation ends with.
2026-12-01 12:59:53 +07:00
bflatastic d6b5e477e0 Windows: a GPU without a Direct3D 12 driver draws with OpenGL again, not on the processor
On a machine whose GPU has no Direct3D 12 driver, Direct3D 12 offers only
its software adapter (WARP), which draws on the processor. Since #2264
FigCraft started on Direct3D 12 alone, so these machines drew every frame
on the CPU: all cores busy and the app lagging (#2774). A window that
opens on WARP now starts the app again with OpenGL offered beside
Direct3D 12, as 0.18.0 did, so the GPU's OpenGL driver draws. Machines
with a Direct3D 12 GPU start as before.
2026-12-01 12:59:51 +07:00
bflatastic 5e5288dbfb M9: a confined headless MCP session can publish to its allowed server (#2502)
--automation-allow-server already let a confined headless session join
files on a named server. collab.publish and collab.share (online) now
reach that same server too, matched the way joins are (parsed scheme,
host, port and path prefix); the server key stays in the publish
address, never in the allowlist. Other servers, hosting, team libraries
and plugin directories stay refused.
2026-12-01 12:30:20 +07:00
bflatastic c07e10801d Linux: a touchpad pinch zooms the canvas under Wayland
The winit fork's pin moves to 0dfcec0, which reads the Wayland
compositor's pinch gestures; egui turns them into the zoom events the
canvas already reads. craft-libs moves with it to d45308b, the first main
commit with both that winit (and its Alt-code handling, so a Windows Alt
code still types its character once) and the image-dimension header the
format crate uses. X11 and XWayland still report no pinch.
2026-12-01 12:14:34 +07:00
BFlat 904dd709f3 Merge pull request #2810 from storytold/feat/2434-team-library-links
M9: a team library can be added by its file's team-list link, with no token in the document
2026-12-01 11:34:35 +07:00
BFlat c9ffcc72c1 Merge pull request #2806 from storytold/feat/2036-rebind-shortcuts
Keyboard shortcuts: change a command's keys in the panel and with pref.shortcut
2026-12-01 11:13:59 +07:00
bflatastic b270a04abb M8: a team library can be added by its file's team-list link, with no token in the document (#2434)
`library.add {path}` now takes `figcraft://join?…&file=…&team=1`, the token-free link a server's
team list hands out. Each fetch and report asks the server for the file's team link first (as a join
from the team list does) and opens the library with it, on the desktop and in the browser build. The
document keeps the link as given, so a file using a server library no longer carries a share token.
A join code is still refused as a library link.
2026-12-01 10:47:08 +07:00
BFlat cfbf83c158 Merge pull request #2802 from storytold/feat/2539-present-entry
M5: the browser build presents a prototype file from its own site, view only, from a link
2026-12-01 10:34:40 +07:00
bflatastic 82f2d2464e Keyboard shortcuts panel: change a command's keys (#2036)
A row of the panel records a new key for its command (a search lists
commands without one so they can get one), asks before taking another
command's key, and resets one command or all. pref.shortcut and
pref.shortcutsReset do the same for automation; the keys are kept in the
preferences and the keymap uses them everywhere.
2026-12-01 10:26:04 +07:00
bflatastic c206c523b8 M5: the browser build presents a prototype file from its own site, view only, from a link (#2539)
Opening the web build at `index.html#present=<file>&start=<frame>` now downloads that file
from the page's own site, opens it and presents its prototype full-window with no editor
behind it. A static folder of the web build and its `.figcraft` files becomes a set of
prototype links.

- Only a file on the page's own origin over HTTP(S) is fetched (same-origin mode, so a
  redirect to another site fails); the 512 MB browser limit applies before and after reading.
- The presenter is view only: no Close, Escape and Cmd/Ctrl+W do nothing, no tab bar, no
  comments, no device or responsive choice. Scale, hotspot hints, Inspect, restart and
  stepping between frames stay.
- `start` is a frame id; a frame the file lacks starts where Present starts, with a message.
- A file that can't be fetched or opened, or has nothing to present, leaves a note saying why.
- Ignored in host mode; the files the last page kept are left for the editor.
2026-12-01 09:56:28 +07:00
bflatastic df9832f32f M9: a page hosting the browser build can ask to publish the open file to its own server (#2786)
A page that hosts the browser build (`?host=parent` or `data-host="page"`) now sends
`figcraft:publish {name?}` to put the open file on the server it names in
`<meta name="figcraft-server">`. The app opens File > Publish to server... for that file,
addressed to the page's server and named as asked; the user still presses Publish. The page
then hears `figcraft:published {file, name, edit, view}`, or `{error}` when the page names no
server, no file is open, a request still waits, the user closed the dialog ("cancelled"), the
publish failed, or the user sent it to another server. A server in the message is never used.

The two messages are FigCraft's own (the shared host contract has none for a server); they go
over the transport craft-web-host connected, with the same origin and source checks.
2026-12-01 09:08:29 +07:00
BFlat e65a878f34 Merge pull request #2793 from storytold/fix/2782-maximize-taskbar
Windows: a maximised window leaves the taskbar visible
2026-12-01 07:22:54 +07:00
bflatastic 1c94c20d24 Windows: a maximised window leaves the taskbar visible (#2782)
With the caption stripped, Windows maximises the custom-title-bar window over the
whole monitor, so it covered the taskbar like full screen. The per-frame frame step
now moves a maximised window with a sizing border into its monitor's work area
(one pixel short when the taskbar auto-hides); full screen keeps the monitor.
2026-12-01 05:14:53 +07:00
bflatastic af7dc53a0d Windows: the title-bar frame step visits only the UI thread's windows (#2778)
The custom title bar's per-frame step enumerated every top-level window on
the desktop (EnumWindows) and read each one's process id, to find the app's
own winit windows. winit creates all of them on the event-loop thread, which
runs the step, so EnumThreadWindows for the current thread finds the same
windows. A sampling profile with Shift held put the old sweep at about 6-7%
of the UI thread's busy samples; the thread sweep is about 1%.
2026-12-01 04:38:55 +07:00
bflatastic c69230975b mcp: the client configurations in the guide pass both automation roots (#2783)
Since 0.19 plain figcraft-cli mcp without the ArtCraft Launcher's switch needs both roots (rule 18), but the Claude Desktop and .mcp.json snippets still passed only ["mcp"], so a client set up from them stopped at start. The snippets now pass both roots, the guide says what a pre-0.19 configuration shows and how to fix it, and a test runs every documented configuration through the CLI's argument parsing and MCP plan with the switch off.
2026-12-01 03:13:17 +07:00
Bryton Cooper 3587c37513 perf(format,doc,engine): load .figcraft images lazily with bounded LRU and streaming save (#1313) 2026-11-30 07:39:12 -07:00
tchezery 89dda8df6b Merge remote-tracking branch 'upstream/main' into fix/macos-window-tiling
# Conflicts:
#	apps/figcraft/src/main.rs
2026-11-30 11:28:22 -03:00
Mochamad Aufa 7799bf2e03 feat(agent): a full-height Agent panel with one-click connections and canvas context
- The Agent is its own left-sidebar tab, holding only the chat: messages,
  grouped tool steps, approval cards and a pinned composer.
- Connections: subscriptions through the installed Claude Code, Codex or
  OpenCode CLI (tools served over a loopback MCP endpoint with a bearer
  token), or an API key that is checked by listing models and picks a
  default model; the rest sits under Advanced.
- Canvas context: the selection shows as chips and goes with the message;
  "Ask agent..." and quick actions in the layer menu and Cmd+Shift+M.
- Reference images from the clipboard, a drop, or a render of the selection.
- Message controls: copy, edit the last request, try again, a queue while a
  turn runs, and a per-file chat history.
2026-11-30 18:57:24 +07:00
Codex 88b4924467 Align browser host and API with the shared metadata revision 2026-11-30 03:45:01 +01:00
Codex 91babf5c02 Resolve dependency pins against the current application manifest 2026-11-30 02:26:07 +01:00
BFlat d5f3eb7e44 fix(nightly): a profile root inside a portable stable copy is refused again (#2768)
A Nightly started with --profile-root pointed into a portable stable FigCraft copy, or its settings folder, is refused before anything is made there (ProfileError::ForbiddenRootOverlap). #2751 moved the fence onto craft-nightly, which only checks the portable marker beside the running Nightly. Restores the two tests from before #2751.
2026-11-30 08:14:25 +07:00
Codex 07a6d7b446 Include reviewed TIFF metadata bounds 2026-11-30 00:04:47 +01:00
Codex e5071fffe2 Update shared libraries for compressed browser data and optional codecs 2026-11-29 23:28:51 +01:00
Dylan M. Taylor 01b2e48034 feat(nightly): wire craft-nightly for self-isolated direct launch (#2751)
* feat(nightly): wire craft-nightly for self-isolated direct launch

* fix(nightly): answer bare version queries before profile resolution

* test(nightly): cover launcher delimiter, spec, and launch_profile helpers

* test(nightly): retain FigCraft startup and persistence coverage

* test(nightly): keep previous write-probe files intact
2026-11-29 15:29:37 -05:00
Dylan M. Taylor baba38de22 Merge main and align newly added craft-control dependency 2026-11-29 12:14:42 -05:00