Commit Graph

2744 Commits

Author SHA1 Message Date
bflatastic 5019f1447a docs: regenerate the parity checklist after rebasing onto main (#1025) 2026-12-04 16:49:36 +07:00
bflatastic 642d811685 fix(fonts): a save warns when its font record may be incomplete (#1025)
When text is bound to font variables in more mode combinations than are
checked, file.save and file.saveAs return a warnings entry, and the app's
Saved toast says some fonts may be missing from the file's font record.
2026-12-04 16:34:35 +07:00
bflatastic d4ddf6a59b fix(fonts): try every realistic mode combination and say when a file has too many (#1025)
Font bindings are resolved in up to 4,096 mode combinations (64 modes in
each of two collections), once per distinct set of bindings. Past that,
text.usedFonts reports complete: false and saving keeps the file's other
font records instead of dropping ones that may still be used.
2026-12-04 16:34:35 +07:00
bflatastic 6fddc32748 fix(fonts): record the family and style bound font variables give in each mode (#1025)
A layer or text style bound to fontFamily, fontStyle or fontWeight
variables is resolved in each combination of the modes those variables
read, so text.usedFonts and the saved record name the pair each mode
draws in, not every family with the current style.
2026-12-04 16:34:24 +07:00
bflatastic 9d1761d438 fix(fonts): show other installed versions on open, record bound families, no exact match on missing fields (#1025)
- Opening a file shows the Missing fonts window when a font is installed in
  another version than the file recorded, not only when one is missing.
- A family bound to fontFamily through a variable is used, recorded and
  listed by text.usedFonts in every mode, in its layer's or text style's style.
- A PostScript name or version the file recorded that the face here lacks
  counts as another version, not an exact match.
2026-12-04 16:34:14 +07:00
bflatastic b0f8256854 M7: files record the fonts their text uses, so another computer can tell the same face from another version (#1025)
Saving a .figcraft file now writes, for each family and style its text uses
(layers, styled ranges, text styles), the face it was set in (PostScript name
and version) and the font store source it downloads from. A font the saving
computer lacks keeps what the file had, and fonts no text uses are dropped.
Older files without the record open as before.

text.usedFonts compares the record with the fonts here (exact, otherVersion,
installed when nothing was recorded, missing), and the Missing fonts window
lists fonts installed in another version than the file was saved with.
2026-12-04 16:34:13 +07:00
BFlat 2d565add72 Merge pull request #3009 from storytold/fix/3002-edit-image-fill-links
M1: Edit in PhotoCraft waits instead of guessing a fill, keeps links on refused writes and failed batches (#3002)
2026-12-04 15:51:51 +07:00
BFlat 38b57952ae Merge pull request #3008 from denisg0mes/variant-switch-keeps-scale
M3: a scaled instance keeps its scale in another variant
2026-12-04 15:48:09 +07:00
bflatastic b640b17c17 M1: Edit in PhotoCraft waits instead of guessing a fill, keeps links on refused writes and failed batches (#3002) 2026-12-04 15:07:25 +07:00
BFlat 78be671f1c M1: Edit in PhotoCraft opens an image fill's file there, and each save updates the fill (#3002) (#3007)
* M1: Edit in PhotoCraft opens an image fill's file there, and each save updates the fill (#3002)

* M1: Edit in PhotoCraft finds its fill by the whole paint, so two fills of one image keep their own saves (#3002)

* M1: Edit in PhotoCraft never guesses a fill, keeps a missing file's link and writes to a folder of the user's own (#3002)
2026-12-04 15:01:02 +07:00
bflatastic a48c095ad7 Merge remote-tracking branch 'origin/main' into feat/session-restore 2026-12-04 12:37:10 +07:00
bflatastic a9e660dade M12: session restore: merge main and port onto its reopening of files
Main now reopens the files open at quit (reopen.rs), keeps per-page views
(file_views.rs) and has Preferences > Start on the Home screen. The session
restore from this branch now builds on those:

- Start on the Home screen is the preference (pref.restoreSession is gone);
  the Home screen then offers Restore last session.
- Preferences from before sessions were kept fall back to reopen_files.
- A tab's page and view go through DocState::show_views.
- Windows keep a Geometry (place, size, maximized, full screen) and a
  restored slot; window.list reports rect, maximized, fullscreen, monitor.
- The Dev Mode import lines and branch history entries are dropped: main
  has both already (dev/code_connect.rs, sharing/branches.rs).

Gate: fmt, clippy -D warnings, workspace tests (local font-environment
failures only), layers, assets, docs, wasm. Checked in the desktop app
(two windows restored in place, crash guard and Restore last session,
missing file message, --fresh) and headless (figcraft-cli run).
2026-12-04 12:27:18 +07:00
BFlat 9882b8e409 Merge pull request #3004 from denisg0mes/alt-deletes-points-and-breaks-handles
M8: in vector edit mode Alt on a point deletes it; handles show what a drag moves
2026-12-04 12:25:45 +07:00
BFlat 7fbb5bf7ff Merge pull request #2247 from johanneswilm/system-account-user-name
Your name: a desktop start takes the operating system account's name instead of "You"
2026-12-04 12:08:58 +07:00
bflatastic 01c62a022e Merge remote-tracking branch 'origin/main' into pr/3004-488
# Conflicts:
#	docs/ui-parity.md
2026-12-04 11:38:10 +07:00
Denis Gomes ebf7046235 M3: a scaled instance follows its main at its scale
A scaled instance whose main changed, in its file or through a library
update, showed a layer the main gained at the main's scale (a 20 x 2 bar
in an 18 x 18 icon from a 24 x 24 set), and a layer the main resized kept
its old size: its scaled size is an override.

Every rebuild of a scaled instance, not only a switch to another main,
now takes it back to its main's scale, drops the overrides that only the
scale made (sizes, places, stroke weights and corner radii equal to the
main layer's in the document before the edit), rebuilds and scales again.
The scale is judged in the document before the edit, where the layers
still match the old main.

The patch that carries a main's values to copies without a rebuild gives
up on geometry, strokes, corners and effects for a copy in an instance
scaled in the document before the edit, so the rebuild takes them at the
instance's scale. An instance resized to the main's proportions with its
layers at their own size is not scaled and keeps the patch
(components_scale_tests checks that deep main edits stay patched).

Tests: variant_scale_tests::a_scaled_instance_follows_its_main_at_its_scale
(a library update and an edit in the file, with and without a stored
factor: a resized bar and a new one, both at 0.75).
2026-12-03 23:32:01 -05:00
Denis Gomes fde6117064 M3: a scaled instance keeps its scale in another variant
An instance scaled with the Scale tool (an 18 x 18 icon from a 24 x 24
set) lost its scale when it switched to another variant or was swapped to
another main: the box kept its size, but the new main's layers showed at
the main's scale and ran out of it. The scale lives in the instance's
layers as overrides (#922), which the other main's layers don't have.

The rebuild after a switch (sync_instance_from, whose `before` shows the
instance had another main) now takes a scaled instance back to its main's
scale, rebuilds it, slot content included, and scales it again about its
top-left corner with scale_node, as the Scale tool does, so every layer
shows at the instance's scale and its scale_factor stays. Doing it in the
command instead was refused: a rebuild there reads as layers added inside
the instance.

An instance whose factor stayed 1 while its layers are scaled (a file
from Figma, or one scaled before instances kept a factor: the icons in
the website file) is read by its layers: when its box and every layer
share one factor against the old main's layers, that is the scale it
keeps. A box resized with its layers at their own size shares none and
shows the other variant unscaled, as before.

Tests: variant_scale_tests (another variant and back, with undo; a swap;
a library set; no factor stored; a resize that is no scale).
2026-12-03 23:31:50 -05:00
bflatastic 6175a952af Merge remote-tracking branch 'origin/main' into pr/3004-488
# Conflicts:
#	docs/ui-parity.md
2026-12-04 10:51:59 +07:00
bflatastic 029ca65719 Merge main into double-click-crops-image 2026-12-04 10:45:29 +07:00
bflatastic 34c9836d06 Several selected handles show the filled cursor, even with Alt
A Move-tool press on one of several selected handles drags them all, so
the outlined "this handle alone" cursor was wrong there. The press and
the cursor now share pressed_handles to decide what a press drags.
2026-12-04 10:41:52 +07:00
BFlat 827d93569c Merge pull request #3005 from denisg0mes/pen-shift-15-degrees
M1: Shift keeps the Pen's segments to 15° steps
2026-12-04 10:37:20 +07:00
BFlat 3831387e1b Merge pull request #3006 from storytold/fix/3000-variables-sort-follow-up
M3, #3000 follow-up: sorting collections leaves library copies in place; value sort reads values once per change
2026-12-04 10:36:13 +07:00
bflatastic 90cd686674 A handle on a point without mirroring shows the outlined cursor
set_handle moves the handle alone when its point keeps no mirroring (as
after an Alt drag) or has no handle across it, so the filled cursor no
longer promises the opposite handle follows there.
2026-12-04 10:35:24 +07:00
BFlat 569b04080b Merge pull request #2998 from denisg0mes/duplicate-variant-beside
M3: a "+" under a selected variant adds a copy beside it to name
2026-12-04 10:27:08 +07:00
BFlat bf6dd656bd Merge pull request #2999 from storytold/feat/473-2996-avif-image-files-not-suppor
M6: AVIF images open, import, place and drop (#2996)
2026-12-04 10:18:08 +07:00
bflatastic 468553ef56 Comments: the You alias only keeps old threads in Mine; changes go by the signed name 2026-12-04 09:36:24 +07:00
bflatastic 9413d57509 Comments: only a profile that signed as You owns You messages; @You reports you after the rename 2026-12-04 09:36:24 +07:00
bflatastic d1d14e7560 Merge main into system-account-user-name 2026-12-04 09:36:24 +07:00
bflatastic 099a625fb8 Merge remote-tracking branch 'origin/main' into pr/2998-480
# Conflicts:
#	docs/components-parity.md
2026-12-04 09:35:09 +07:00
bflatastic 73b7cc844c M3, #3000 follow-up: docs for sorting collections around library copies 2026-12-04 09:33:48 +07:00
Denis Gomes 41e12cef8a M1: a double-click on an image layer crops it with its fill open in the picker
A double-click on a selected image layer edited the rectangle's points, so
cropping its image took Object > Crop image or the crop button on its fill
row, and the image fill's menu then closed. A double-click on the one
selected shape with an image fill now switches its top visible image fill
to Crop, keeping the picture where it was (image.crop), and opens that fill
in the colour picker. The Crop paint's handles show on the canvas beside it
(the image drags, its corners scale it, the layer's edges crop it), and the
picker's Fill / Fit / Crop / Tile menu, rotation and adjustments are at
hand. image.crop takes picker: true for the same; without it, it still
enters crop mode and closes the picker. A shape without an image still
edits its points.

Tests: image_crop_tests (a double-click on an image, and on a plain shape),
image_double_click_tests.
2026-12-03 21:27:43 -05:00
Denis Gomes 97d4829443 M8: in vector edit mode Alt on a point deletes it; handles show what a drag moves
In vector edit mode Alt did nothing on a point, and a Bezier handle showed
the plain arrow whether a drag would move the handle across its point too
or, with Alt, this handle alone. Now, with the Move tool or a pen not
drawing a path, Alt on a point shows the pen with a minus and a click
deletes the point, its neighbours joined as Shift+Delete does
(vector.deleteHeal), in one undo step. On a handle the cursor is a filled
triangle, and the handle across the point follows a drag on one line with
it as before; with Alt it is an outlined triangle and the drag moves this
handle alone, as Alt already did. The pen does the same on a handle,
where a press used to add a point instead; a path being drawn goes on
from its last point afterwards.

The cursor table's row for Alt on a point said it added nothing; it now
says it deletes, and the pen gains the same row.

New cursors: PenCursor::Delete and Cursor::Handle { one }, named
pen-delete, handle and handle-one for ui.inspect.

Tests: canvas::vectoredit::alt_tests (3), vector_handle_cursor_tests,
cursor_tests::vector_edit_mode_shows_each_tool_and_modifier,
cursors_tests::every_engine_cursor_has_a_system_cursor_or_a_glyph.
2026-12-03 21:27:43 -05:00
Denis Gomes 47aff0b2fb M1: Shift keeps the Pen's segments to 15° steps
Shift kept the Pen's next segment to 45° steps, two directions in a
quarter turn, where Figma's Pen offers six: 15° steps (measured in Figma
on 2026-12-03). The Pen now snaps to 15° steps with Shift, from its last
point while drawing a path and from the open end in vector edit mode; the
band shows where the point lands. In vector edit mode the band followed
the pointer with Shift held while the click went to the step, so Shift
looked as if it did nothing there; it now ends where the click lands,
worked out in the layer as the click is. at_45_degrees becomes
at_angle_step with the step given, and PEN_STEP holds the Pen's.

The Line tool and the Pencil keep 45° until their steps are measured.

Tests: pen_overlay_tests (the band and the next point at 15° steps, the
pen in vector edit mode, and its band there).
2026-12-03 21:27:43 -05:00
BFlat 9c3eab52fc M3: the Local variables window sorts its table from a dropdown and its column headers (#3000) (#3001)
A dropdown beside the search field picks Custom order, Name or a mode's
values, A to Z or Z to A; a click on the Name or a mode's header sorts by
it and a second click turns it round, with an arrow. It is a view: the
stored order the pickers and exports follow stays, and Move up / Move
down are off while the table is sorted.

The Collections header and a collection's Sort A to Z / Z to A sort this
file's collections, not their variables: new command
`variable.sortCollections {descending?}`, one undo step.
2026-12-04 09:09:57 +07:00
bflatastic 47f60ba5f8 M6: AVIF images open, import, place and drop (#2996)
A dropped or placed .avif was refused as an unsupported image. craft-image-codecs' avif-decode
feature (craft-video's pure-Rust AV1 decoder) is turned on in format and render, the file pickers
and open lists take .avif, and an AVIF's container rotation, mirror and crop apply as for HEIF.
The browser build refuses AVIF with the desktop-app message.
2026-12-04 08:36:39 +07:00
BFlat 3a04f974b2 M6: an opened .fig keeps the size it saved for auto-size text until that text changes (#2934) (#2992)
* M6: an opened .fig keeps the size it saved for auto-size text until that text changes (#2934)

An opened .fig showed auto-size text at the size the file saved, but the
first edit anywhere measured it again in the fonts at hand, so with another
version of a font the text and the auto layout around it moved.

Auto-width and auto-height text now keep the file's size (TextData::saved_size)
while the text and its layout settings are as saved and, for auto height, the
box keeps its width, as saved line breaks (#1519) do.

* Docs: the saved text size also drops on a size setting edit; the width check is auto height's (#2934)
2026-12-04 07:32:20 +07:00
BFlat 72c2807fbf Text: setting a font family that isn't installed warns and says where to get it (#2935) (#2990)
create_node and set_properties keep a fontFamily that isn't installed but now warn that it draws in a fallback font, naming the next step: font.download when the font store has it and downloads are on, asking the user to allow downloads when they're off, or that no source has it. Fixes #2935.
2026-12-04 07:07:33 +07:00
BFlat 1de3ac58a4 M1, #614: Text ▸ Replace math with result turns typed math into its value (#2993)
* M1, #614: Text ▸ Replace math with result turns typed math into its value

Each selected text layer, or text inside a selected frame, whose text is
an expression becomes its value in one undo step (`text.calculate`):
arithmetic with brackets, comparisons, joined text, and number or string
variables read in the layer's modes. It reuses the prototype expression
reader, so nothing runs as a script. Text that isn't math stays as it was
and is listed in `skipped`, and the app says how many layers it left; with
none that is math the command is refused.

* M1, #614: Replace math with result keeps editing when refused, reaches each layer once

A refusal no longer ends text editing, a frame selected with a layer
inside it reaches that layer once, and the message for skipped layers
takes the singular for one.
2026-12-04 07:07:05 +07:00
BFlat e5d48101a1 M9: figcraft-server files add publishes a .figcraft file as the operator (#2994) (#2995) 2026-12-04 07:01:22 +07:00
Denis Gomes f3b7aa4333 M3: a "+" under a selected variant adds a copy beside it to name
Adding a variant took the set selected and Add variant in the Design panel,
and the new variant went under the set as "VariantN", away from the one it
copied. A selected variant now has a "+" under it on the canvas, below its
size label. It adds a copy beside the variant, named after its first value
with " copy" (" copy 2" and on while that is taken), selects it and opens
that value for typing in the Current variant section, selected so typing
replaces it. Enter or a click elsewhere renames the variant; Escape keeps
the copy's name.

Beside means next in the set's order, which an auto layout set lays out
there; in a set without one, 20 px to the variant's right when no variant
is in the way, else under the set as before. component.addVariant takes
beside: true for the same copy.

Tests: assets::components::tests (a variant duplicated beside, and in an
auto layout set), variant_add_tests (the + and the field, Escape).
2026-12-03 18:21:01 -05:00
BFlat bafdf62ca9 fix(render): a frame that doesn't clip its content strokes under its children (#2931) (#2991)
A frame painted its strokes over its children whether it clipped them or
not, so a child laid across its edge (an outlined text field's floating
label) had the border cut through it. A frame that doesn't clip its
content now strokes before its children, on the canvas and in the SVG,
PDF and Vector Drawable exports; a clipping frame still strokes over
them.
2026-12-04 01:47:04 +07:00
Mark Bartalos d9021d2130 M6: .fig export keeps glass settings and a Mode variant binding
A round trip dropped a pane's light, refraction and bevel, and baked a Light/Dark Mode binding as the current variant. Export writes those fields, and a stretched nested instance keeps its size.
2026-12-04 00:30:37 +07:00
Mark Bartalos 1f47c5e7ee M6: a library copy keeps a glass pane stretched past its variant
Opening the file as a library rebuilds each nested instance from its variant, so a tab bar's glass snapped from the bar's width back to the variant's own size. A size the component authored stays; a plain instance still follows its main.
2026-12-04 00:30:36 +07:00
Mark Bartalos 9bb258df5e M6: a .fig kit's Mode binding switches variants and keeps a stretched size
A Light/Dark Mode variant bound with RESOLVE_VARIANT stayed on the light variant, and a glass pane the bar had stretched collapsed to the variant's own size on the switch. Glass light and refraction come across too.
2026-12-04 00:30:36 +07:00
BFlat dcc25625bc M6: .fig export writes no size overrides on a scaled instance (#2936) (#2987) 2026-12-04 00:29:55 +07:00
bflatastic c5cf03ae5c M12: session restore: online tabs keep their saved order as they arrive; branch tabs come back 2026-12-03 23:41:01 +07:00
BFlat 858d75df63 Merge pull request #2983 from FredApps/web-size/panic-locations
Web size: no panic file:line and three more wasm-opt passes, 0.3 MB under the gate (#2720)
2026-12-03 23:12:58 +07:00
BFlat 8bc5db1f83 Merge pull request #2939 from storytold/docs/online-terms-14-days
Docs: files on the default server are kept 14 days unopened, not 30
2026-12-03 23:07:43 +07:00
bflatastic 46abe9602a Web size: deployable web builds go through package.sh, a plain trunk build is over the gate (#2720) 2026-12-03 22:23:28 +07:00
Terra854 b2b6bdd480 M4: keep bundled font metrics ahead of installed versions (#2888) (#2901) 2026-12-03 15:40:23 +01:00