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.
* M3: a dragged layer stays under the layers drawn above it (#3051)
* M3: note the drag sprite keeps the stacking order in the parity docs (#3051)
* M3: a layer moved under one drawn above it waits clear of it until the in-order render shows (#3051)
The ending sprite was frozen where the layers had just moved, over the layer
above, and drawn there until the render of the page in order arrived. It now
stays at its last place clear of that layer.
* M3: what draws above a dragged layer follows its parent's stacking order (#3051)
An auto layout frame whose first child paints on top draws its children in
reverse, so the layers above a dragged child are the ones before it there.
No shortcut bound in the keymap fired on macOS when it was injected
with ui.input and used Cmd. The control channel built the event's
modifiers as {ctrl: command} for `cmd`, so a Cmd shortcut arrived with
Ctrl held too, and keymap::same_mods compares modifiers exactly on Mac:
no Cmd binding matched, and edit.copyAsPng ran without its toast. The
clipboard fence test has been red on macOS, deterministically; Linux
passes on the loose comparison, so a run of the suite there cannot
catch it.
Synthetic events now carry what a real keyboard event holds on the
platform: `cmd` is mac_cmd and command on macOS, ctrl and command
elsewhere, and on macOS `ctrl` is the separate Control key. That is the
rule ui.key documents; ui.input's entry now states it too. The hold
branch (ModifiersChanged) uses the same synthesis.
Test: shortcuts_tests::every_shortcuts_keys_sent_as_control_input_reach_it_on_each_platform
sends every binding's own keys through the synthesis for each platform
by name, so a Linux run catches it too; it fails without the fix.
clipboard_fence_tests::a_synthetic_copy_shortcut_leaves_the_system_clipboard_alone
passes on macOS.
* 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>
The contributor's stroke settings popover, ported onto main's split right
panel (panels/right/stroke.rs) and its newer settings (custom dashes, the dash
cap, stretch and scatter brushes):
- The stroke row's dots button opens the settings in the shared popover beside
the Design panel, under Basic / Brush tabs; the width profile shows on both.
- Each setting is a label and a 120-pt control (widgets::setting_row); the width
profile and brush dropdowns draw their shape across the field
(widgets::dropdown_art), the name on hover.
- A selection whose stroke settings differ reads Mixed in the style row.
- The popover follows the auto layout popover: it keeps the document and
selection it opened for, and closes when either changes or when no frame
draws its button (the stroke removed, mixed stroke lists, another tab). The
Motion inspector draws the same row, so it stays open there.
- Escape in a field ends that edit and marks the Escape spent
(a11y::spend_escape), so every popover closes only on the next press.
Tests: stroke_settings_tests (the contributor's, plus Motion mode, Escape
keeping the selection, both tabs and a press on the labels), dash_pattern_tests
open the popover.
Co-authored-by: 叶林橦 <108113065+yelintong@users.noreply.github.com>
* 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)
`apps/figcraft` keeps the same desktop behaviour but splits its launch into
a library (`figcraft::run`) and a shim `main.rs` that calls it. The window,
arguments, services and the run loop move into `lib.rs` unchanged; the only
additions are the dependency split that keeps today's desktop features (rfd,
arboard, accesskit, clipboard, wayland, x11) on desktop, and the Android
entry. Android has no command line, so its launch is the default one: no
control server, no automation roots, no files to open and no invite links,
and the home screen shows. rfd and arboard have no backend for the target (they
do not compile there), so the native file dialogs answer cancelled and the
system clipboard beyond egui's text is desktop only. Android's NativeActivity
entry point (a later step) opens the same app through
`figcraft::run_android`, which hands eframe the activity handle.
This is the groundwork for another host opening the same app; it changes no
desktop code path.
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.
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.
* M3: a selected variant lists the set's boolean, text and instance swap properties (#3020)
One variant of a component set selected showed only its variant
properties, so a boolean added to the set looked missing until an
instance was selected. The Current variant section now also lists the
set's other properties with their defaults; they are still edited on
the set (#2346).
* M3, #3020: read a variant's listed defaults with their property's name and leave out slots
* 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.
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.
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.
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.
- 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.
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.
* 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)
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).