Commit Graph

2569 Commits

Author SHA1 Message Date
bflatastic d0a7b8d48e Merge main into #1392 2026-12-02 01:33:20 +07:00
BFlat 069dcbf0c0 Merge pull request #2871 from storytold/cp/pr-1624-62
M4: keyframe animation - timeline, inspector and easing (#1624)
2026-12-02 01:24:31 +07:00
BFlat 386aada760 M6: Automation path refusals say what a relative path was taken as; docs: attached copies stay off the system clipboard (#2524) (#2870)
An automation path refusal says what a relative path was taken as (it is made absolute against the working folder of the process that runs the command: the attached app's when attached), for every refusal including those inside a root. docs/mcp.md: how relative paths resolve when attached, and that an attached agent's copies use FigCraft's own clipboard, never the system clipboard. Part of #2524 (points 2 and 6).
2026-12-02 01:13:24 +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
bflatastic 47bdb06dd1 M4: keyframe animation on current main
- Delta snapshots: an instance whose motion differs from its source is sent as
  a full record, so catch-up no longer replaces it with the source's motion.
- motion.timeline refuses an id that is not a page.
- request_render's new preview argument in the zoom preview test; the Motion
  preview takes no drag sprite, since it already draws every layer.
- Node size budget raised by the 48 B of the inline motion field.
- Parity checklist regenerated (697 commands); architecture count updated.
2026-12-01 23:30:29 +07:00
叶林橦 60ce9c8e76 feat(motion): keyframe animation - timeline, inspector and easing
Implements the Motion panel: the document model (clips, tracks, keyframes, easing, smart animate), 11 engine commands (motion.keyframe, keyframeMove, keyframeDelete, keyframeEase, clip, clipUpdate, clipDelete, track, replace, timeline, animation.transitionPoses), and the timeline, inspector and easing panel that drive them.

Review gate: Prototype keeps its own entry in the mode switcher and Animation is a fifth entry beside it; the preview is evaluated for the renderer only, so the session's document is never replaced and a canvas gesture writes the document; every inspector, easing and clip edit opens an interaction first (begin_interaction) and drops itself when the document refuses it. cargo fmt and clippy -D warnings pass, body_rows/apply are split, parameter docs are list-form, and ROADMAP/parity/architecture are updated (634 ids).

Review fixes: a page copies its timeline settings and takes them with it when deleted; reading timeline settings clamps them, so a collaborator's entry cannot hang the ruler; motion.keyframe rejects a value of the wrong shape before writing; a reparented smart-animate pair is rewritten into its new parent's space; the preview cache key carries the document uid; the mode setup lives in motion::set_open, shared by the toolbar and ui.set {motion}; stretching a zero-width layer span keeps the motion instead of panicking; the timeline header's tooltips go through tr().
2026-12-01 23:30:27 +07:00
BFlat 6f03b78759 M8: Duplicate's repeated move turns with the copies, so a moved and turned copy repeats round a ring (#2862) (#2867) 2026-12-01 22:33:46 +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 5b0dc94b03 Merge pull request #2141 from TrevorBrown-dev/fix/paste-relink-2022
Paste from Figma: instances link to mains pasted earlier (#2022)
2026-12-01 21:28:19 +07:00
BFlat 526cd13078 Merge pull request #2860 from storytold/fix/2853-blended-shadow-drag
M8: a layer whose own shadow blends by another mode keeps the old drag path (#2853)
2026-12-01 21:04:22 +07:00
bflatastic 428ebb70a5 Agent panel: ask before plugins, libraries and the share server; fmt
- The Ask gate missed `plugins.*` (runLast runs a plugin) and `libraries.*`
  (only `plugin.`/`library.` were matched), and `pref.publishServer`, which
  changes where shared files are sent.
- The Auto mode's doc said the automation roots confine file access; a
  window opened normally has none, so say when they apply.
- rustfmt the same-layer exceptions in xtask/src/layers.rs.
2026-12-01 20:55:56 +07:00
BFlat 5d93db5398 Merge pull request #2863 from storytold/fix/2777-unclipped-frame-spread
M3: a frame that doesn't clip its content ignores its drop shadows' spread (#2777)
2026-12-01 20:53:15 +07:00
bflatastic d0a8d4551a Merge main into #2141
# Conflicts:
#	docs/file-format-parity.md
2026-12-01 20:39:08 +07:00
bflatastic 8987135cd7 M6: a main matched by library key pairs its layers by name path, and its pasted instances resync to the main this file has (#2141 review) 2026-12-01 20:33:47 +07:00
BFlat 0a21b02e15 Merge pull request #2861 from storytold/feat/2540-presenter-touch
M5: presenter touch: a tap clicks a hotspot, a finger doesn't hover, a pinch does nothing (#2540)
2026-12-01 20:32:39 +07:00
bflatastic 99785ec487 M8: a pass-through layer's child with a blended shadow keeps the old drag path too (#2853)
A child's Multiply shadow draws through a pass-through frame onto what lies beneath it,
which the sprite's transparent surface doesn't hold.
2026-12-01 20:23:54 +07:00
bflatastic c5ea22df9f M8: a layer whose own shadow blends by another mode keeps the old drag path (#2853)
A multiply (or other non-Normal) drop or inner shadow blends with what lies beneath the layer.
The sprite is rendered on a transparent surface, so the shadow would look different while dragging.
2026-12-01 20:17:01 +07:00
Mochamad Aufa 51124d3bd5 Agent panel: address review findings
Streaming
- Bound SSE line and event sizes; read the stream on its own thread so
  Stop returns at once, even while the endpoint is silent.
- Report a stream that ends before its completion marker
  (finish_reason/[DONE], message_stop) as interrupted.
- Anthropic: use the start block's input only when no argument fragments
  follow (the `{}` placeholder no longer corrupts streamed arguments).

Agent loop
- Don't run tool calls from an answer cut off at the output limit.
- On Stop, give every pending tool call a result so the history stays valid.
- Send no images to a text-only model, from earlier turns included.
- Trim old images regardless of text length, then long old text.
- Ask before file commands nested in batch / command.batch.

MCP endpoint and CLI agents
- Bound header reads; check Stop before any tool, and again after Allow.
- Codex: exec options before `resume`, so resumed turns keep read-only.
- Remove staged images after the run; keep Stop working after stdout closes.

Design system and skills
- One command.batch for page, tokens and guidelines (one undo step,
  all-or-nothing), pinned to the file the call started in.
- Match the page name exactly; update variables by id.
- Never overwrite another skill that maps to the same file name.

Chat panel
- No clipboard read on control-channel paste.
- Removing a connection keeps the active one; model lists go only to the
  connection that asked.
- Queue waits after a failed turn and stays with its file/conversation.
- Try again resends the original images and hidden instructions.
- New chat during a turn waits for it to finish.
- Undo answer is withheld when the person edited during the turn.
- Layers panel: cover the Agent tab in the left panel title match.

Docs: name the same-layer exceptions the layer check allows.
2026-12-01 20:06:37 +07:00
bflatastic c2885051cb Merge main into #2141
Resolves conflicts with the .fig reader moving to craft-fig and craft-figma-rest: the paste-only identity import goes through the budgeted importer, a main's library key is added to its mapped source in FigCraft's map pass (the shared mapper no longer has it), and load_fig is test-only now that the paste reads through load_fig_pasted.
2026-12-01 20:05:17 +07:00
BFlat adcb55d679 Merge pull request #2857 from storytold/fix/2853-glass-drag
M8: a layer with effects drags smoothly: glass and background blur are rendered again for where they are, off the canvas render (#2853)
2026-12-01 19:56:43 +07:00
bflatastic 1daffc8bd3 M3: a frame that doesn't clip its content ignores its drop shadows' spread (#2777)
A frame, component, component set or instance with Clip content off now draws its
drop shadows as its outline is, only moved by their offset: no ring for a positive
spread, no shrinking for a negative one. A rectangle or a clipping frame still grows
and shrinks them, and turning Clip content back on brings the spread back (the
stored value is unchanged).

The canvas, PNG/JPG/WebP, PDF and SVG exports agree, and the paint and export
bounds leave no room for the ignored spread. Inner shadows keep their spread.
2026-12-01 19:44:48 +07:00
bflatastic 72fe0e9661 Presenter: a tap clicks a hotspot, a finger doesn't hover, a pinch does nothing (#2540)
In the full-window presenter (and the preview pane, which shares the player) touch
now acts as touch:
- A tap is a click: its release counts where the finger lifted, although a touch
  screen takes the pointer away in the same frame.
- A finger has no hover: Mouse enter, Mouse leave and While hovering don't fire from
  it, so they can no longer swallow the tap. A press that comes from nowhere (no
  pointer position before it, no move to it) counts as a finger even before its
  touch event arrives, as a browser sends them. A mouse moving hands hover back.
- A swipe scrolls a scrolling frame, or fires an On drag trigger, as a mouse drag
  does; a small wobble is still a tap.
- A second finger cancels the press: a pinch neither drags, scrolls nor taps, and a
  scroll it interrupts springs back inside its range.

The control channel's ui.input takes {touch: [x, y], phase, finger?}, sent as a
touch screen sends it, so this can be driven without a touch screen.
2026-12-01 19:35:22 +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
bflatastic 5085e438d4 Merge main: build the live glass backdrop on #2858's drag sprite, keeping its dark-section rule 2026-12-01 19:22:06 +07:00
BFlat c41d890156 Merge pull request #2656 from storytold/fix/2435-text-style-overrides
M4: a text run keeps its text style under local changes (#2435)
2026-12-01 19:02:36 +07:00
BFlat 500e13be65 M8: a layer with effects of its own, a glass included, drags as a sprite with its outline (#2853) (#2858) 2026-12-01 18:57:26 +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 5875ca5522 fix(doc,engine,render): unreadable lazy images aren't equal, share save prep, video bytes after rebase (#1313)
- ImageData equality: two lazy images that both fail to load no longer compare equal; equal
  content-hash keys compare without reading either store (as the PR describes).
- save_to and encode_at share FileSnapshot::prepared instead of duplicating the doc prep.
- render: video players read lazy bytes through ImageData::bytes (new on main since the PR).
- docs/file-format-parity.md: revision row for #1313.
2026-12-01 18:32:42 +07:00
bflatastic a76aba9278 M8: a layer with effects drags smoothly: its own effects move in the drag sprite, and glass or a background blur is rendered again for where it is on a thread of its own (#2853)
A dragged layer with any effect on it used to give up the drag sprite, so every pointer
move asked the canvas for a new render (about 20 ms each for a 600 x 360 glass pane over
stripes in a debug build here; 48 ms per move in the release glass bench at 200 %), and the
layer stuttered behind the pointer.

- The sprite now takes layers with effects of their own (drop and inner shadows, blurs,
  noise, texture, glass): render_area draws them as the page does.
- A background blur or glass in the sprite reads what lies under it where the layer is now:
  figcraft_render::render_area_moved draws the layers where they started but reads their
  backdrop at the drag's shift. A thread of the sprite's own renders it for the latest shift
  and hands the image back; the sprite keeps moving with the outline every frame and shows
  the newest render. The canvas renders nothing until the drop.
- The glass shading loop runs its rows in parallel outside a parallel render (exports and
  the sprite), as blurs already do; bands of a canvas render stay on their own thread.
2026-12-01 17:15:47 +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
bflatastic c53a3b06d2 Merge origin/main into fix/2435-text-style-overrides 2026-12-01 16:48:45 +07:00
BFlat 1984628a9e Merge pull request #2848 from storytold/fix/936-cjk-ui-size
M10: Chinese, Japanese and Korean interface text draws a pixel larger so it no longer reads faint
2026-12-01 15:40:29 +07:00
BFlat 0bb1183a8f Merge pull request #2846 from storytold/fix/2837-dark-sections
M1: sections draw in dark tones of their colour while the interface is dark
2026-12-01 15:27:28 +07:00
BFlat f9bc1c45a7 Merge pull request #2838 from storytold/feat/2325-tidy-sweep
Auto layout: tidy sweep commands round spacing and return stray absolute layers to the flow
2026-12-01 15:12:04 +07:00
BFlat 261a0cb71d Merge pull request #2841 from storytold/feat/2237-code-gutter
M12: boards: code blocks number their lines in a gutter
2026-12-01 15:09:24 +07:00
bflatastic a395d05128 M10: Chinese, Japanese and Korean interface text draws a pixel larger so it no longer reads faint
At the interface's 11 px, ideographs pack many strokes into the same em as a Latin letter and
the default system faces (Microsoft YaHei UI on Windows) have no medium weight, so the strokes
read thin, most of all dark on light. The CJK fallback faces of the interface now draw one
twelfth larger (11 px text: 12 px ideographs); Latin text and the canvas keep their sizes.

Fixes #936
2026-12-01 15:05:58 +07:00
BFlat b2c09d6e36 Merge pull request #2844 from storytold/feat/1592-preview-window
M5: Prototype preview opens in a window of its own for another screen
2026-12-01 14:53:53 +07:00
BFlat 50d62b8e55 Merge pull request #2843 from storytold/feat/2781-autolayout-grid
M2: Add auto layout gives layers in rows and columns a grid
2026-12-01 14:48:40 +07:00
bflatastic 142ed2d1fd M1: sections draw in dark tones of their colour while the interface is dark (#2837)
On a dark interface the canvas draws white sections, the section colour presets and the default
section border in dark tones instead of bright light blocks, and the Section color swatches show
those tones. A custom colour draws as it is. The stored colour stays, so the light theme, exports,
thumbnails and the file are unchanged; switching the theme redraws the canvas.
2026-12-01 14:47:26 +07:00
BFlat 3678bfb402 Merge pull request #2842 from storytold/feat/1013-video-fills
M6: video fills: MP4 and MOV videos fill layers and play in the presenter
2026-12-01 14:43:09 +07:00
BFlat 0bdc1eb40e Merge pull request #2829 from storytold/fix/1560-right-click-locked
M5: a right-click on a locked layer picks it, so the menu's Lock/Unlock unlocks it
2026-12-01 14:37:53 +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 30c4650392 M12: boards: code blocks number their lines in a gutter (#2237, part)
The padding left of a code block's code now holds its line numbers, right-
aligned in the code's font and level with it; a wrapped line takes one number
and its other rows stay blank. The normalize pass that keeps a block's height
and plain code keeps them after every edit, resize and undo, and keeps them
behind the code among the block's layers, so typing always finds the code.
2026-12-01 14:22:10 +07:00
bflatastic 456a67978e Auto layout: tidy sweep commands round spacing and put stray absolute layers back in the flow (#2325)
layout.fixSweep rounds the gap, the gap between lines and the padding of
the auto layout frames in the given layers (and inside them) to whole
pixels, then runs layout.detachAbsolutes, which takes visible absolute
layers back into the flow when the flow would leave them where they are
(within half a pixel). One undo step, no layer changes parent, instance
contents and variable-bound spacing are left alone, and a second run
changes nothing and records no step. Both return the ids they changed.
2026-12-01 14:22:02 +07:00
bflatastic fc64d38284 Prototype preview: open it in a window of its own for another screen (#1592)
The preview pane's bar gets a pop-out button next to Close. It moves the
preview into an OS window of its own (same size as the pane), where the
same prototype keeps playing and follows edits and the selection live,
so it can sit on a second screen. The button there, or closing that
window, puts the preview back over the canvas.

`proto.preview {window: true}` opens it straight in its window, and
`ui.set {previewWindow}` / `ui.inspect` `previewWindow` move it and read
it over the control channel. The browser build (one window) and a
running screen reader (other windows have no accessibility tree yet)
keep the pane over the canvas, without the button.
2026-12-01 14:20:08 +07:00
BFlat 83404f2567 Merge pull request #2833 from storytold/feat/2642-mind-outline
M12: a mind map's outline beside the canvas, to edit and reorder its topics
2026-12-01 14:16:41 +07:00
BFlat 14bd07d6ce Merge pull request #2825 from storytold/feat/2642-org-chart-outline
M12: a mind map turns into a top-down org chart
2026-12-01 14:06:09 +07:00
BFlat b32d083427 Merge pull request #2831 from storytold/feat/2752-docked-plugin-panels
M11: plugin panels can dock in the sidebar (#2752, part 1)
2026-12-01 14:00:56 +07:00