2387 Commits

Author SHA1 Message Date
BFlat be807756e4 Merge pull request #3073 from denisg0mes/publish-refusal-current-names
M3: a publish refusal names a renamed asset by its current name
2026-12-06 06:50:10 +07:00
bflatastic 6bfbd9ccf4 M3: a publish refusal gives each left-out asset's id beside its name
A name can be shared, or read as a style or collection id, so listing it
in include or exclude could select another asset. The id selects only it.
2026-12-06 02:11:22 +07:00
Denis Gomes 694e7b478a M3: a publish refusal names a renamed asset by its current name
A publish refused for leaving out assets the last version offered (#3039)
named them as that version's manifest did. A component renamed since
then was named by its old name, which `include` and `exclude` don't
resolve (they look names up in the file), so following the refusal's
advice failed. The refusal now names them as the file has them.

Tests: library::tests::a_refusal_names_a_renamed_asset_by_its_current_name.
2026-12-05 13:46:06 -05:00
bflatastic 20c6a64f99 M12: the board widget double-click test no longer skips without fonts 2026-12-06 01:03:32 +07:00
bflatastic b624462bab M12: plugin widgets on boards
Nothing refused widgets on boards, but nothing checked or said so: the
board toolbar's Actions palette (its Widgets section and Plugins &
widgets tab) and Plugins > Widgets already insert them through
widget.insert. A widget placed on a board takes clicks with the board's
Move tool, a double-click types in its fields, and its state survives
save and reload with the file still a board.

The boards-parity row moves from missing to done; gap 24, the plugins
guide and the area-22 row in target-app-parity follow.

Tests: board_widgets_tests (widget_input_tests' manifest and note
helpers are now pub(crate) so the board tests reuse the note widget;
no test there changed).
2026-12-06 00:37:25 +07:00
BFlat 1514849c00 M4: Copy as SVG gets a shortcut, Alt+Shift+Cmd/Ctrl+C (#3062) (#3064) 2026-12-06 00:36:17 +07:00
BFlat 5e455cedcb M4: hovering a colour style or variable in the style picker previews it on the canvas (#3043) (#3054) 2026-12-05 22:18:07 +07:00
BFlat 61c47b93b7 Merge pull request #3039 from denisg0mes/publish-keeps-offered-assets
M3: a publish no longer stops offering what its include leaves out
2026-12-05 22:13:26 +07:00
BFlat 19ad2b6dce M2: a frame's resized edge snaps to the layers in it (#3047) (#3053)
* M2: a frame's resized edge snaps to the layers in it (#3047)

* M2: a resized frame snaps only to the layers its edges leave in place (#3047)

A layer whose constraint carries it with the dragged edge, and a layer auto layout places, no longer offers its starting position as a snap target; nor does a turned or flipped frame.
2026-12-05 22:11:47 +07:00
Ridwan 2f5e81b088 M3: Variable edits only re-resolve affected layers (#3027) (#3038)
* M3: a variable edit resolves only the layers that can read it differently (#3027)

Every variable edit resolved every bound layer of the file again:
binding_scope returned "all" whenever the variables changed. Dragging in a
variable's colour picker edits it each frame, so a large file froze for
seconds per drag.

An edit now resolves the layers bound to the variables that can read
differently (added, removed or changed ones, and those aliasing,
calculating from or extending them), directly or through a style. A
change to a collection (its modes) still resolves every bound layer.

With the reporter's variables and 3,000 bound layers (debug build), one
variable.set went from about 45 ms to about 7 ms.

Tests: variable_edit_scope_tests (the revalued set fails without the fix;
layers bound to the variable and its alias follow it).

* M3: a bound layer's bound children resolve again after it resizes them (#3027)

* M3: bound sizes alone bring in the layers inside, resolved parents first (#3027)

* M3: a layer in scope with any bound size brings in the bound layers inside (#3027)

---------

Co-authored-by: bflatastic <bombayapirat@gmail.com>
2026-12-05 22:08:50 +07:00
Ridwan 23cb380453 M4: Cmd/Ctrl+V into a tall frame lands in view (#3035) (#3037)
* M4: Cmd/Ctrl+V into a tall frame lands in view (#3035)

Paste with a frame selected put layers that couldn't keep their place in
it in the frame's middle. In a tall frame scrolled to its end, that
middle was thousands of pixels off screen, so the paste seemed not to
happen.

They now land in the middle of the part of the frame in view, kept
inside the frame. A frame with none of it in view still takes them in
its middle, as before.

Test: design_paste_tests::paste_into_a_tall_frame_scrolled_to_its_end_lands_in_view
fails without the fix.

* M4: a paste into a frame stays in view, in a turned frame's middle, and centred when larger (#3035)

* M4: a straight line in view keeps its place when pasted into a frame (#3035)

* M4: a copy only touching the view's edge moves into view (#3035)

* M4: a copy larger than the frame centres on the frame on that axis (#3035)
2026-12-05 21:18:32 +07:00
bflatastic 1e837cb7a8 Merge remote-tracking branch 'origin/main' into pr/3039-562
# Conflicts:
#	docs/components-parity.md
2026-12-05 21:17:09 +07:00
BFlat 68ff2453fd fix(engine): the template build-time budget isn't checked under coverage instrumentation (#2938) (#2940)
* fix(engine): the template build-time budget isn't checked under coverage instrumentation (#2938)

* fix(engine): keep a looser template build budget under coverage instead of skipping it (#2938)
2026-12-05 20:40:05 +07:00
BFlat f56cb1b508 M7: a window that quits keeps the recent files another window added since it started (#3029) (#3033)
* M7: a window that quits keeps the recent files another window added since it started (#3029)

* M7: the recent files merge test runs without the interface (#3029)
2026-12-05 17:37:09 +07:00
Denis Gomes 02075f777b M3: a publish no longer stops offering what its include leaves out
library.publish took `include` as everything the library offers. An
agent that published the one component it had changed (include: [925],
cart-line) stopped offering the other 20 components, all 9 styles and
both variable collections of the design system, with no warning, and
the next default publish kept that choice. Pasting one of those
components into another file then made a new component instead of an
instance from the library.

A publish whose `include` leaves out a component, style or collection
the last version offered, still publishable and not hidden by a . or _
name, is now refused, naming them, unless `exclude` names them: listing
them keeps them offered, excluding them withdraws them. Withdrawing
stays possible, but has to be said.

The publish form passes its checkboxes as `include`, so it now sends the
assets the last version offered that are unchecked as `exclude`.

Making `include` add to the last offering instead was rejected: the
form and existing callers use it as the exact list, and a withdrawal by
unchecking would no longer work.

Tests: library::tests::an_include_that_leaves_out_offered_assets_is_refused,
publish_withdraw_tests::unchecking_an_offered_style_publishes_without_it;
publishing_collections_hides_and_versions_variables now names the
collection it withdraws.
2026-12-04 19:20:32 -05:00
BFlat a751ae968d M3: deleting a file's variables reaches library copies bound to them (#3030) (#3032)
A file imported from Figma keeps library components' mains on its hidden
library page, bound to the file's own variables. Deleting such a variable,
its collection or a mode also drops those bindings, which the read-only
check refused as an edit of a library copy, so the variables couldn't be
removed. Those three deletions may now drop the copies' references; every
other edit of a library copy or a library variable stays refused.
2026-12-05 00:26:59 +07:00
BFlat 113ad665e3 fix(pages): deleting the open page keeps the pages list where it was (#3022) (#3023)
* fix(pages): deleting the open page opens the one next to it, so the pages list stays put (#3022)

* test(pages): the open page gives way to its neighbour past dividers (#3022)
2026-12-04 23:39:39 +07:00
BFlat d650c5f32d Merge pull request #2928 from storytold/feat/290-1025-feature-request-figcraft-fe
M7: files record the fonts their text uses, so another computer can tell the same face from another version (#1025)
2026-12-04 18:42:47 +07:00
BFlat 6d18f50c14 Merge pull request #3014 from storytold/fix/3002-keep-waiting-saves
M1: Edit in PhotoCraft never writes over a file holding a save not taken in yet (#3002)
2026-12-04 18:34:53 +07:00
BFlat dd8bad312e M5: Unlock all unlocks every locked layer on the page in one step (#3012) (#3013)
* M5: Unlock all unlocks every locked layer on the page in one step (#3012)

* M5: a lock changed inside an instance is an override and survives its rebuild (#3012)

Unlock all (and Lock/Unlock) cleared `locked` on layers inside instances, but
lock changes weren't recorded as overrides, so the next rebuild from a main
that stays locked on another page locked the layer again. `locked` is now an
override group (shown as Locked, resettable); an instance's own lock stays its
own and isn't one.
2026-12-04 17:59:56 +07:00
bflatastic 0826220a87 M1: Edit in PhotoCraft keeps a waiting save under any spelling of its path (#3002) 2026-12-04 17:57:14 +07:00
bflatastic 1e9af88457 M1: Edit in PhotoCraft never writes over a file holding a save not taken in yet (#3002) 2026-12-04 17:44:54 +07:00
bflatastic 001c050ace fix(fonts): weight bindings keep each layer's slant, records match in any case, auto-save warns (#1025)
From review: the binding cache key left out whether the style is italic, so
two layers sharing a weight binding but slanted differently resolved to the
same style and one of them went unrecorded. A record spelt with other
non-ASCII capitals than its text wasn't found and was dropped on save. An
auto-save never said when the font record may be incomplete; it now shows
the same notice a Save does.
2026-12-04 17:26:23 +07:00
BFlat e8c3c32a93 Merge pull request #3011 from storytold/fix/2865-fig-glass-placed-size
M6: .fig glass on expanded copies and placed nested sizes that survive main edits (#2865 follow-up)
2026-12-04 17:12:35 +07:00
bflatastic 878ac94171 fix(fonts): a host-confirmed save also says when the font record may be incomplete (#1025)
document_stored, which reports a save a page host confirmed later, showed
only "Saved {name}". It now reports through file_saved with the snapshot's
font warning (FileSnapshot::with_font_warning), like other saves.
2026-12-04 16:34:35 +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
bflatastic fef5c2e8ce M1: Edit in PhotoCraft clears a waiting save a failed batch wrote over, and says what an explicit path does to it (#3002) 2026-12-04 16:18:11 +07:00
bflatastic e53b62b8e7 M1: Edit in PhotoCraft takes a waiting save in once an undo tells its fill apart, and never takes a failed batch's own write as a save (#3002) 2026-12-04 16:04:24 +07:00
bflatastic b752b4d94e M6: a placed nested size answers main edits as a user's size does 2026-12-04 15:59:48 +07:00
bflatastic 73b3c8c32f M6: a placed nested size stays when its main passes through it 2026-12-04 15:59:47 +07:00
bflatastic 31e8d7ab9a M6: a size an enclosing component placed is not recorded as the user's size override 2026-12-04 15:59:32 +07:00
bflatastic fe487a9a31 M6: a size kept on one axis does not stop the other following later main edits 2026-12-04 15:59:32 +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 808de15dc2 M3: a scaled instance's own frosts past the cap survive its rebuild
The rebuild scales a scaled instance back to its main's scale and again,
and scale_node caps glass frost: a 0.75 instance or slot content with a
frost of 90 came back at 75. The frosts the way back would cap, on slot
content and on layers overriding their effects, are noted first and set
back where the rebuild kept them: slot content put back, an effects
override kept. Where switching variants drops the override, the other
variant's frost shows.

The library tests write into a temp folder they made themselves, so
removing it after removes nothing else.
2026-12-04 15:10:45 +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 8cb6f74fd3 M12: session restore: a branch that is gone doesn't leave its file open as an extra tab 2026-12-04 12:31:21 +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 37ce1f24ab Comments: say that the You alias lets old pins drag, which comment.move never restricted 2026-12-04 11:12:23 +07:00