Commit Graph
2213 Commits
Author SHA1 Message Date
Oleksii Sukholita fc5c045c0e M1: Cmd/Ctrl + double-click edits the layer under an unfilled nested frame or instance
A double-click found the layer under the pointer with the plain hit test even with Cmd/Ctrl
held. Over an unfilled device chrome overlay it picked the overlay, so it never edited the text
or the shape under it. In Figma's web app, measured with synthetic files, Cmd + double-click
reaches that layer as a Cmd-click does and edits it at once: text editing for a text, vector edit
mode for a shape. A plain double-click still picks the overlay there, as in Figma.

`cmd_double_click_edits_the_layer_under_an_unfilled_instance` fails without the change. The
device chrome scene the two tests share is one helper now.
2026-11-21 14:37:18 +01:00
Oleksii Sukholita 7fdb996062 M1: Cmd/Ctrl-click reaches the layers under an unfilled nested frame or instance
With Cmd/Ctrl held, a frame, component or instance nested in another layer caught the pick
across its whole box. An unfilled overlay, such as a device chrome instance (a status bar and a
home indicator over a screen), took every deep click and hover inside it, so the screen's own
layers could not be picked through it. In Figma's web app, measured with synthetic files, such
a layer counts only where it has a visible fill (a hidden or 0% fill and its stroke don't), and
the pick reaches the layer under it, or the top-level frame when nothing else is there.

`HitOpts::deep` makes the hit test do that for a press, a hover, the shape builder's pick and a
right-click with Cmd/Ctrl held. Boards (top-level frames and frames directly in a section) keep
their box, and a plain click is unchanged.

`cmd_click_reaches_through_an_unfilled_nested_frame` fails without the change.
2026-11-21 14:11:55 +01:00
f7acb637f0 M6: restore full JPEG export chroma (#2521)
* M6: restore full JPEG export chroma

* M6: check the JPEG matte away from the painted edge

* docs: keep the parity header's change level and describe the JPG chroma fix

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

---------

Co-authored-by: FredApps <FredApps@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 21:28:36 +07:00
Denis Gomes 435d85b8a4 M1: Crop mode crops by the layer's sides in auto layout, up to the image, and never runs with vector edit
In crop mode (Object > Crop image) the layer's sides and corners crop its
image through the Cmd/Ctrl resize: the canvas sends Cmd/Ctrl while crop
mode is on. Several things went wrong around that.

Auto layout. The Cmd/Ctrl crop left out any layer with auto layout on it
or an ancestor (#703), because the layout could recompute the box after
the drag and a crop worked out for the dragged size would stretch. An
image in an auto layout column was resized and squashed instead. The
exclusion is gone: the crop is worked out for the dragged box in the
preview and, once the layout has run, again from the snapshot for the
size it left (crop_to_the_laid_out_box). A resize already makes the
dragged axes Fixed; the layout may still move the layer, and the picture
moves with it, unstretched. Where the layout makes the layer longer than
it was dragged (a minimum width after the left side was dragged in), the
crop slides back along the image rather than past its edge.

Past the image. A side could be dragged beyond the image's edge, leaving
an empty strip inside the layer. While the box isn't flipped, its sides
now stop at the image's box (or where they started, if that was further
out: a Fit image is smaller than its layer). The box is drawn back towards
where it started, both ends of an axis by the same fraction, so an Alt
resize stays centred, and with Shift both axes by the same fraction, so
the ratio holds. A drag past the opposite side still flips as any resize
does (command_crop_keeps_image_placement_in_the_layers_axes pins that).

Ratio. A layer whose proportions are locked kept its ratio in crop mode
too, so dragging a side moved the opposite axis; the crop window now
ignores the lock and Shift keeps the ratio. The image's own corner
handles were the other way round from a resize: in proportion by
default, free with Shift. They now scale freely, in proportion with
Shift.

Vector edit. A double-click on the image enters vector edit mode, and
Object > Crop image could be chosen while vector edit was on, so both ran
at once. The injected Cmd/Ctrl then turned a drag of the layer's side
into the Bend tool (a curved edge), and a dragged top segment showed the
selected points' box, "804 x 0". Now image.crop ends vector edit, crop
mode ends when vector edit starts, the canvas injects Cmd/Ctrl only while
no points are being edited, and a double- or triple-click in crop mode
stays in crop mode. When the second press of that double-click began a
resize on a side of the layer, its release ends the resize.

command_resize_leaves_fills_when_text_or_auto_layout_recomputes_the_box
pinned the auto layout exclusion; its text case stays as
command_resize_leaves_a_texts_fills.
2026-11-19 16:41:09 -05:00
Denis Gomes a28dca47b5 M1: A curved layer's outline bends smoothly
The hover and selection outline of an ellipse, a vector or a rounded
corner is the layer's path flattened into lines on screen. The lines
could be 0.5 pt from the curve, which made the outline of a 65 by 50
ellipse turn by up to 22 degrees at each point at 100%, and showed its
straight pieces at every zoom. The fill, drawn by the renderer, stayed
smooth under it.

The flattening tolerance is now 0.02 pt on screen for a path with up to
200 curved segments, so the outline stays within a fiftieth of a point
of the curve. Above that it grows with the count, up to the old 0.5 pt
at 5,000 curves. The hover outline is flattened every frame and the
selection outline every frame the view moves, and egui tessellates
every point each frame: at a flat 0.02 pt a vector of 5,000 curves had
about 4.7 times the points and took about 5 to 9 ms more per frame in a
release build (perf_tests harness, frame plus tessellation). Caching
the flattened points alone would not have helped much, since the
tessellation runs every frame anyway.

The test checks how far the outline strays from the curve, which is
what the tolerance controls. The sharpest turn per step depends on how
large the curve is on screen, so a fixed angle was close to the edge.
2026-11-19 16:36:58 -05:00
Denis Gomes 406bbf7aba M4: Text pasted while editing keeps its formatting; Shift+Cmd/Ctrl+V matches the style
Text copied or cut while editing reached the clipboard as plain
characters, and a paste inserted them in the style at the caret, so the
copied font, size, colour and text style were lost. A whole text layer
copied with Cmd/Ctrl+C and pasted into another text's edit lost them the
same way. Shift+Cmd/Ctrl+V and Alt+Cmd/Ctrl+V while editing did nothing
useful: on the desktop egui-winit sends those chords as keys, and no text
binding took them.

A copy or cut while editing now also keeps the selection's style runs
(textedit::selected_rich_text), and a copy of text layers keeps theirs
(textedit::layers_rich_text, joined with line breaks as the clipboard's
text is). A run coloured by its layer's fill carries that fill, since a
run without fills of its own takes the fill of whatever layer it lands
in. A paste whose text is still that copied text inserts it with those
runs (textedit::insert_rich); a run linked to a text style the file
doesn't have keeps its look and drops the link, and fills equal to the
destination layer's are left to the layer. The copy also carries the
data of the images the runs' fills use, and the paste adds it where the
file lacks that key, as a layer paste does, so an image fill resolves in
another file. Text from another app pastes as before.

Shift+Cmd/Ctrl+V while editing, and Alt+Cmd/Ctrl+V, read the clipboard's
text and insert it plain, in the style at the caret; in the browser,
where the chord also brings a paste event, the event is used and the key
only marks the chord as handled, and the chord on that key, not the
modifiers held when the event is read, picks the plain paste. Shift
alone is another paste key (Shift+Insert) and keeps the formatting.
Outside text editing Shift+Cmd/Ctrl+V is still Paste over selection and
Alt+Cmd/Ctrl+V Paste properties.
2026-11-19 16:25:37 -05:00
Denis Gomes 167ce234bc M3: Library styles show in the style pickers without the Assets tab, with a source menu
Enabled libraries were read from disk only by the Assets panel
(refresh_libraries ran from its show). After a file with enabled
libraries was opened, the Design panel's style pickers found none in
the cache, and a library's text styles weren't offered ("No text styles
yet") until the Assets tab had been opened once.

refresh_libraries now runs from the app's background tick, whichever
tab shows, and reads a local library not read yet at once instead of
waiting out the 2 s throttle. A library the read refuses (too large, or
not on this computer) is never cached, so the tick remembers the paths
it last tried and tries those again only after the throttle; otherwise
it would read again every frame. The periodic repaint that picks up a
library changed on disk stays with the Assets panel, so an idle window
isn't woken every 2 s; the panel's doc comment now describes that
repaint.

The style picker gets Figma's source menu under the search field when
the file has enabled libraries: All libraries (the default, the list as
before), This file, or one library, kept while the picker is open. A
library that goes away falls back to All libraries.
2026-11-19 16:18:29 -05:00
Denis Gomes b0569e2723 M3: Layers: the eye and padlock stay in view, and a name takes at most 400 pt
A text layer named after a paragraph made the list over 1000 pt wide (#1904
widens it to the widest name). The eye and padlock sat at the row's far end,
so hiding a layer meant scrolling sideways to find them.

The eye and padlock now sit at the right edge of the list's view. While they
show (hover, a hidden or locked layer, or a row a held sweep has taken in),
the name is clipped before them instead of drawn beneath. Scrolling sideways
still reveals the rest of a long name, as #1904 asked.

On a row as wide as the view nothing moves: the row is already inset 8 pt
from the view's edge, so the eye stays at 262 to 282 pt (mirrored 1158 to
1178 pt), as on main. On a row nested so deep that the buttons at the view's
edge would cover its disclosure triangle, icon or name start, they stay
after the name start, at the row's end, so the triangle still takes clicks.

NAME_ROOM drops from 1200 to 400 pt. It stops a name of thousands of
characters (#1650) from making the list that wide, and 400 pt still holds a
variant name like "Size=small, Type=primary, State=default, Icon=leading,
Width=full" in full. The "W" name in the measuring test is 25 letters, and
the test checks that it is wider than the panel leaves a name and well under
the cap, so it holds with and without craft-fonts.

Tests: the_eye_of_a_long_named_layer_sits_at_the_panels_edge_and_is_clickable,
a_paragraph_named_text_layer_widens_the_list_no_more_than_the_name_cap,
the_eye_of_an_ordinary_row_stays_where_it_was (passes on main too),
a_swept_long_named_row_keeps_its_name_clipped_before_the_eye and
the_disclosure_triangle_of_a_deeply_nested_row_is_not_under_the_padlock.
2026-11-19 16:16:19 -05:00
Denis Gomes 0d7eeac29d M2: A locked-ratio child filling one axis of auto layout keeps its proportions
A photo filling the width of a row (Fill container across, a fixed
height, its image cropped to the layer) was squashed when it went into
a row with a different amount of room: pasted next to a 516 pt column
instead of an 804 pt one it became 1092 by 969.15 instead of 804 by
969.15, and the cropped image stretched with it. Locking the aspect
ratio didn't help, because auto layout never read constrain_proportions.

flow_items now records the cross-per-main ratio of a child whose aspect
ratio is locked, which fills exactly one axis and is fixed on the other
(text excluded, and rotated layers too: layout reads a turned layer's
bounding box, whose ratio isn't the layer's own). Wherever the layout
sizes such a child on its filled axis (resize_fill_main_item, the
single-line cross fill before the lines are measured, and the stretch
across a hugging line), the fixed side follows at that ratio, within
its min and max; a filled side of zero leaves the fixed side as it is
rather than shrink the layer to nothing. Without the lock the fixed
side stays fixed, as before. Wrapping lines and grids are unchanged.

Figma never squashes a pasted image, lock or not. So a pasted layer
whose image is cropped to it (the one image mode that stretches with the
layer; Fill and Fit refit the image), landing in an auto layout frame
where it fills one axis and is fixed on the other, gets its aspect
ratio locked, and the layout above keeps its proportions. That includes
the instance a main component copied in its own file pastes as. Other
pasted layers keep their lock as copied.
2026-11-19 16:09:48 -05:00
Denis Gomes 97e9ada42a M1: Shift with a double-click goes deeper and keeps the rest of the selection
A double-click selects a level deeper, and it replaced the selection
with that one layer whatever the modifiers. With a layer in one artboard
selected, a Shift double-click on a neighbouring artboard left only the
neighbour's layer selected, so layers nested in different artboards
couldn't be selected together, as Figma allows.

With Shift (and not Cmd/Ctrl) the double-click keeps the rest of the
selection: the selected layer it goes into is replaced by the layer a
level below, and nothing else changes. Where nothing is selected on that
branch, it goes one level into the layer beside the selection: the one
just inside the deepest layer the branch shares with a selected layer,
or the layer a click would select when that is deeper. Starting from the
click target alone picked a layer that holds the selected one when both
sit in the same artboard (a row of a list beside the selected row's
label), and the selection collapsed to it.

The double-click's own two clicks have already toggled that layer in and
out with Shift by then, so the press handler keeps the selection from
before each of the last two presses, and the double-click works from the
older one.

It uses those selections only when both presses were made with the Move
or Scale tool where the double-click lands, and each double-click uses
them once. Otherwise (both presses arrived in one frame with the
double-click, or the clicks were made with the Hand) it works from the
current selection, so a selection made since earlier presses stays.
2026-11-19 16:02:29 -05:00
Denis Gomes 0f54b38f42 M3: A variable created with a group shown goes into that group
With a group selected in the Local variables window, + Create variable
named the new variable after its type alone ("Number"), so it went to
the collection's top level. The table, showing the group, didn't show
it; only All variables did. In Figma it's made in the group shown.
Duplicate already kept the group (the copy is "space/sm copy").

The new variable's name now starts with the group shown. Its name opens
for editing right away, and the row's field edited the whole name while
the row shows only the last part, so typing a name over the new grouped
variable would have moved it straight back out of the group. The field
now edits the part shown and keeps the group; the Edit variable window
still edits the whole name, which is where a variable moves between
groups by typing.

A name typed there with nothing but slashes and spaces is ignored, as an
empty one is: under the group it would clean up to the group's own name
and drop the variable out of it. Creating a collection clears the group
shown, as picking another collection does, so its first variable isn't
named after a group of the collection shown before.
2026-11-19 15:51:49 -05:00
Denis Gomes 6c590e4e89 M3: Several selected instances show and set the properties they share
With two or more instances selected the Design panel showed no instance
properties, so changing a variant or a property meant selecting each
instance in turn. instance.setProperties already took several ids.

The panel now shows the variant, boolean, text and instance-swap
properties the selected instances share, matched by name and type. A
variant property lists only the values every one of their sets has, so
the command can't be refused for one of them. Where the values differ
the row reads Mixed (a dropdown's label, the text field's placeholder,
the checkbox's third state), and a value chosen there is set on every
selected instance in one step. A selection with any layer that isn't an
instance shows none of this. Slots are filled one instance at a time,
so their rows show only for one.

A single instance goes through the same code with one id. One
difference: a single instance's slot property whose slot can't be
found now shows no row, where it showed a label with nothing beside it.
swap_dropdown takes `mixed` to label such a row.

A text field that reads Mixed changes nothing when committed empty: the
field reports its text on every Enter or focus loss, edited or not, so
an empty commit there can't be told from a click in and out.
2026-11-19 15:41:56 -05:00
Denis Gomes 807d78b86d M3: A binding the main layer doesn't have stays an override when instances are relinked
Linking imported instances to their mains (and detaching an outer
instance, or restoring a main) finds overrides by comparing each layer
with its main layer, and compared values only. A layer bound to a
variable its main layer doesn't bind, resolving to the main's colour,
therefore wasn't an override. The next copy or edit of the main reset it
to the main's unbound paint: in a file using a library, a button's icon
lost the colour variable the library's button gave it, while the label
next to it, whose main binds the variable, kept it.

rebase_instance now adds the groups whose bindings differ from the main
layer's (diff::rebound_groups), as record_overrides already did for a
binding made in an instance. record_overrides no longer clears such an
override when an edit sets the value back to the main's (hiding and
showing the fill). Bindings are compared by what they bind, so `fill`
and `fills/0/color` are one binding.
2026-11-19 15:29:16 -05:00
Denis Gomes 85de85d569 M3: Paste with a variant's set selected adds the copied variants to it
Copying a variant and pasting with that variant, a layer in it or its set
selected pasted an instance on the page: the set was not a place paste
could put layers, and a copied main component pastes as an instance of
it. Copied variants of one set now paste into that set as new variants
(deep copies, like Duplicate makes), under the copied variants where they
are now and below the lowest variant with a gap of 20 as Add variant
places one, and the set grows to hold them.

Only a plain edit.paste with the copied variants' own set, or a layer in
it, selected does this: paste decides it and passes it to paste_into's
worker, which also checks the target is that set. Inferring it from the
parent being a component set made copies of the mains for every other
paste into a set too. Those keep making instances: a variant pasted with
another set selected, a main that is no variant pasted with a set
selected, Paste over and Paste to replace on a sibling variant, and an
explicit parent, even the variant's own set. Each has a test.

copying_a_variant_pastes_an_instance_but_copying_its_set_keeps_the_components
now pastes with nothing selected for its instance case.
2026-11-19 15:27:42 -05:00
Denis Gomes c8d2b2c7c1 M8: a zoom in is measured from the image on screen, a preview included
The zoom-in rule compared each request with the last full render, but
the canvas replaces its image with every preview it is handed. A zoom out
that showed its preview and was reversed before refining was measured from
the obsolete full image: after a 1x render, a 0.25x preview (0.0625 pixels
per unit) and a 2x request, the 2x preview was suppressed although the
screen held an image eight times less dense, and the late preview too.

Renders now records the image it hands over: a preview, a full render and,
in the browser, a full render shown while it is drawn again (Refined::Shown).
The watchdog's late preview is followed by its request's refined image,
which the render thread records, so it needs no record of its own.

previews_cover_the_view_for_any_zoom_and_density asked for previews in a
row with nothing refined between, so a preview inside the one before at its
zoom is now rightly suppressed; it restores its full render before each.

Reported by FredApps in review.
2026-11-19 15:12:53 -05:00
Denis Gomes ee405acecc M8: a zoom in keeps the image on screen until the sharp one is ready
When renders from scratch take longer than about a frame, every new zoom
got a coarse preview first (#312), with a quarter of the pixels each way.
After a zoom out that is right: the old image, re-projected, covers a small
part of the view. After a zoom in it covers all of it, and enlarged up to
4x it is at least as sharp as the preview. During a pinch or a held zoom
each step also dropped its refined image as soon as the next step's request
came, so the canvas stayed coarse until the zoom stopped.

Now a zoom in to at most PREVIEW_FACTOR times the image last shown, inside
the area that image covers, gets no preview, up front or from the watchdog:
the image on screen stands in until the refined one comes. Zoom outs, other
pages and files, larger zoom ins and zooms to an area the image doesn't
cover still get previews. The browser's banded renders take the same rule,
measured from the last image finished rather than one still being drawn.

The previews' doc comments in render_worker.rs and zoom_preview_tests.rs
still say "a new zoom"; they now hold for zoom outs and large zoom ins.

Measured in the app on a page of 11 000 layers and 237 images (M4 Max),
39 zoom steps from 10% to 200%, read through `ui.inspect`: before, 5 of
them showed a preview; with this change none did, each showed the refined
image, and full renders at those zooms took 5-14 ms.
2026-11-19 15:12:53 -05:00
Denis Gomes 26860bd367 M1: A drag on a section's background, or an artboard's in it, draws a marquee
The background of a top-level frame with layers already acted like the
canvas: a press there starts a marquee inside it. A section and the
frames in it got none of that, so a drag anywhere in a section with
artboards picked up the section (or the artboard) and moved it, and
nothing in it could be marked out with the pointer.

- An unselected section with layers, and a frame with layers directly
  in a section, now act like a top-level frame's background: a click
  deselects, a drag draws a marquee. A section still moves by its name
  label, or by its body once selected.
- A marquee started in a section selects among the section's layers as
  one started on the page does among the page's (artboards it encloses
  whole, else the layers it touches inside them); one started in an
  artboard in a section selects inside that artboard.
- With Cmd/Ctrl held, a drag from such a background draws the deep
  marquee instead of moving the frame or section, selecting the nested
  layers it touches. This holds when the artboard or section is
  selected too: with Cmd/Ctrl its background counts as background, and
  the press doesn't fall back to dragging the selection. A Cmd/Ctrl
  click there without a drag still selects the frame or section, and
  without Cmd/Ctrl a selected section or artboard still drags by its
  body.

The comment above board_background ("unless the frame is selected")
still describes the press without Cmd/Ctrl.

Tests: section_marquee_tests.
2026-11-19 15:11:18 -05:00
Denis Gomes ead7e5b390 M5: A clicked layer row leaves the arrow keys to the canvas
A click on a row in the Layers panel gave the arrow keys to the rows:
Up and Down walked the list and Left and Right opened and closed rows. A
layer picked there couldn't be nudged, nor moved one place up or down its
vertical auto layout frame, which is how designers reorder a column. In
Figma a layer picked in the Layers panel moves with the arrows (the
locked-layer rule measured on 2026-11-10 is that a locked one doesn't).

The arrows now nudge after a row click, as on the canvas. Walking the
rows with the arrows stays for the keyboard: F6 into the Layers panel
puts the keyboard on the selected row (a11y::layer_row), which was
already a path of its own. layers_focus still records the click, so
Shift+F10 after it opens the menu at the row. The row-walking tests now
reach the rows by F6, and the perf bench does the same.
2026-11-19 15:10:38 -05:00
Denis Gomes 20a49eb586 M8: in vector edit mode, deleting a point selects the next one on its path
Deleting a selected point (Delete or Backspace, or Shift+Delete to
heal) cleared the selection, so removing several points along a path
meant clicking each one before every Delete.

Before the points go, each one's follower is found by walking its path
forward (segment a to b) past the points being deleted, or backward when
the path ends there. After the deletion those followers are found again
by position, as the deleted points already were, and become the
selection of their layer, so Delete pressed again goes on along the
path. A cut (vector_clipboard) still leaves nothing selected.
2026-11-19 15:10:30 -05:00
Denis Gomes b1692e44b7 M1: Centred auto-width text grows and shrinks about its middle
Typing in a centre-aligned auto-width text kept its left edge, so the
text crept to the right as it was edited instead of staying centred.
Right-aligned auto-width text already kept its right edge (#1477); the
same rule now keeps the middle of centred text in place, half of the
width change going to each side, also when the text is rotated. It
applies as #1477's does: only when the text was centred auto-width text
before the edit, and not where an auto layout flow places it.

Tests: text_behaviour_tests (centred and left-aligned auto-width text).
2026-11-19 15:10:26 -05:00
Denis Gomes 730ea76413 M1: Frame selection makes a frame without a fill
Alt+Cmd/Ctrl+G wrapped the selection in a new frame with the white fill
a drawn frame gets, which covered the page behind the framed layers. The
frame made around a selection now has no fill;
a frame drawn with the Frame tool keeps its white fill.

Test: frames_behaviour_tests (frame selection).
2026-11-19 15:10:11 -05:00
Denis Gomes 77bd448d41 M4: The eyedropper colours a stroke-only layer's stroke and shows its colour
Three changes to picking a colour with the eyedropper (I, Ctrl+C on macOS):

- A selected layer with a visible stroke and no visible fill takes the
  colour on its stroke. It used to get a new fill over what the outline
  shows. Other layers take it on their fill as before, and a mixed
  selection changes in one undo step.
- With a colour picker open on a fill or a stroke, the shortcut samples
  for that picker, as its own eyedropper button does, instead of filling
  the selection and closing the picker.
- Beside the pointer, a swatch shows the colour under it, read from the
  canvas image already on screen: the canvas keeps the last image it
  uploaded (one canvas-sized buffer) instead of rendering the document
  again on every pointer move.

Tests: eyedropper_stroke_tests, colorpicker_eyedropper_tests.
2026-11-19 15:08:50 -05:00
Denis Gomes d6cef43353 M5: At 100% a presented frame reaches the window's edges
The presenter kept its 32 pt padding at Actual size (100%) as well as at
Fit. A frame made at the window's size then had 64 pt less room than its
own width and height and panned both ways. In Figma a frame shown at
100% reaches the edges and only what is bigger than the window pans.

Actual size now takes the whole area; Fit keeps the padding and still
never goes above 100%. Frames smaller than the window stay centred, and
a frame bigger than the window starts centred across at its top as
before, now from the window's edge. The doc comment on layout() says
so.

Test: a_frame_the_size_of_the_window_shows_at_100_percent_without_panning
(a 1440x820 frame in the 1440x820 presenter; with the padding it panned
64 pt each way). presenter_scales_by_its_options_and_pans_what_overflows
now expects the 100% pan range without the padding.
2026-11-19 15:08:48 -05:00
B-uchi f8bc54cd44 M8: screen sizes join the design context and read only what is a mark
- `inspect.designContext` returns the target's responsive context under `responsive`, and names
  the missing breakpoints only when nothing was stated.
- `responsive.set` marks frames and sections only, as the Inspect section shows; a component or
  instance is refused. `group: null` goes back to the frame's name, and emptying the field in the
  Inspect tab sends it.
- A stored viewport that isn't mobile, tablet or desktop is ignored, and an empty or over-long
  group reads as none (`node.set {pluginData}` can write anything there).
- The walk for rules counts each layer once and stops at its cap without collecting a whole
  subtree first, so overlapping targets don't use it up; `near` is searched by binary search.
- `responsive.rule` refuses a page before making the category, as `annotation.add` does.
- Developer Mode makes responsive edits, like its annotations (`dev_mode_allows`).
- The Inspect tab keeps a rule's draft per document and keeps it when the rule is refused.
- Status line, row and revision row in docs/dev-mode-parity.md.
2026-11-19 03:07:40 +01:00
B-uchi a61c2b33f6 M8: a frame can say which screen size it is and carry rules for other sizes
A design file has no breakpoints, so an agent implementing a frame can only guess how it should
respond. The designer can now say it outright: `responsive.set` marks frames as the mobile, tablet
or desktop version of a design (layer data, so the file format is unchanged), and
`responsive.rule` adds a note to the Responsive annotation category, made if the file lacks it.
`responsive.list` returns what was stated about the given layers, the layers above them and those
inside them, and never infers anything from names or sizes. The Inspect tab gets a Screen sizes
section for frames.

Explicit targets are checked rather than falling back to the selection, a rule keeps to the
limits `annotation.add` has (note length, annotations per layer, number of categories), and the
result says `truncated` when there were too many layers to read every rule.
2026-11-19 02:28:40 +01:00
B-uchi d243347fd0 M8: Code Connect keeps a connect file it can't read, and maps values as it checks them
- Export refuses to write over a connect file it can't read (not JSON, not an object, or over
  4 MB) instead of replacing it with this design's links alone.
- Import skips an entry whose `values` is malformed, with a warning, instead of replacing the
  component's link with one that maps nothing.
- `{Property ? "a" : "b"}` reads the design's value, so mapping Off to `inactive` doesn't make the
  condition true.
- A `values` key that is only a parameter name (`state` for State) is reported as unknown, since
  the mapping is read by property name and it would do nothing.
2026-11-19 01:54:56 +01:00
B-uchi dbccabce41 M8: design context gives Code Connect links as the connect file does
`inspect.designContext` wrote a component's links through `camel`, which renames keys at every
depth, so a mapped design value such as `extra_large` came out as `extraLarge`. Its components and
the code it gives each connected layer now use Code Connect's own link JSON: value names stay as
written, and the code carries the link's `source` and `notes`. Export also sorts its links once,
after merging the file's other links.
2026-11-19 01:54:50 +01:00
B-uchi d23c8b6456 M8: Code Connect for agents
A link can say where the code component lives (`source`, a path inside the
repository), what a property's design values are called in code (`values`:
{"State": {"Hover": "hovered"}} renders `hovered`; a value without an entry
keeps its design name) and `notes`, through codeConnect.set, the connect file
and Inspect ▸ Connect to code (a Source file field and a row per variant
value). The fields are skipped when empty, so existing files and exports don't
change.

codeConnect.list and the MCP tool component_mappings say which code
component each design component is: import line, name, ready snippet,
properties and variants, and with a repository root whether each source file
is there. sync_mappings imports or exports a repository's connect file.
codeConnect.export {path} keeps the file's other top-level keys and the links
of components this design doesn't have, so several designs can share one file.
2026-11-19 01:39:29 +01:00
BFlat a80ca002a4 Merge pull request #2480 from storytold/feat/text-position-2338
M4: Type settings ▸ Details ▸ Position sets superscript or subscript (#2338)
2026-11-19 07:22:50 +07:00
B-uchi d09c82010d M8: asset handoff for code projects
file.exportAssets and the MCP tool export_assets write a design's images and
vectors into a folder: images as the bytes the file holds, never re-encoded,
vectors through the SVG export, and layers with export settings by those
settings. Each file says whether it is original, vector or rendered. Files are
named by the first 16 hex digits of their SHA-256, so one asset has one file
used by every layer listed and exporting again writes nothing. What a layer
does to an image that isn't in its bytes (filters, crop, rotation, opacity) is
listed, as is why an asset couldn't be handed over. Writes go through
file_access, so automation roots confine them.
2026-11-19 01:13:51 +01:00
BFlat 6cc578cede Merge pull request #1810 from SoldierPePe/i18n/rtl-panel-rows
M10: panel rows and the layers list mirror in a right-to-left UI
2026-11-19 07:12:03 +07:00
bflatastic 891b632996 M4: Type settings ▸ Details ▸ Position sets superscript or subscript (#2338)
The engine draws superscript and subscript (#1868), but nothing in the
interface set them. Details now starts with Position: None, Superscript
or Subscript for the selected text layers, through text.setFeatures
(choosing one clears the other), showing the layers' current position
and none when they differ. Raising a range of characters on its own
needs per-run features and is left for later.
2026-11-19 06:57:54 +07:00
bflatastic fbeea11c4c M1: Shift with the Pencil draws a straight line at 45° steps (#2447)
Shift did nothing with the Pencil: the stroke stayed freehand, while the
Line tool and the Pen keep theirs to 45° steps. pencil_add, shared by the
drag and the release, now keeps one straight segment from where the
stroke started to the pointer at the nearest 45° step while Shift is
held (the Marker and Highlighter too); a Shift-click without a move still
draws nothing.
2026-11-19 06:30:36 +07:00
SoldierPePe aa9991f1cf M10: panel rows and the layers list mirror in a right-to-left UI
In a right-to-left UI language the rows inside the panels run from the
right as well: the shared Design panel row (right::block), section
headers, tight_end, sub-labels, checkboxes, radios, disclosures and the
selection header, and the layers and pages lists (indent, disclosure,
icon and name from the right, eye and padlock on the left). Names and
rename fields align to their start.

Hand-placed layouts stay written left to right and are mirrored inside
their row with widgets::flip_x / flip_rect, so an English window takes
the same code path unchanged. Inside a control nothing turns round.

A layers list made wider than the panel by a long name (#1904)
mirrors across its whole width, so it starts scrolled to its right
end, where its rows start (stick_to_right, with a scroll state per
direction so a language switch doesn't leave it at the left end).

The Assets panel, version history, Dev Mode's layouts, the colour
picker, the toolbar, the tab bar and the home screen stay left to right.

Gap 5 had two copies of its "Missing" paragraph, left by merges: one
now.
2026-11-19 02:22:01 +03:00
bflatastic fb21b3c389 M6: svg import drops the scanners craft-svg replaced, so main builds and passes fmt again (#2468)
#2468 moved SVG import onto craft_svg::tree::parse, which runs the size,
entity, attribute and nesting checks itself, but left FigCraft's own
scanners (too_wide, too_deep, nesting) and import/budget.rs unused and
import.rs unformatted: main failed cargo fmt, clippy -D warnings and the
svg tests, which still passed budget::Limits to import_within.

The dead code goes; budget_tests use craft-svg's tree::Limits (bytes,
embedded_bytes, embedded_depth) and its error texts, and hostile_tests
check attribute width with craft_svg::guard::too_wide at the default
limits and the nesting refusal at craft-svg's 256 levels.
2026-11-19 06:00:08 +07:00
BFlat f8b1dc7373 Merge pull request #2444 from B-uchi/pr/design-context
M8: design context for AI agents
2026-11-19 05:51:53 +07:00
BFlat 202b748083 Merge pull request #2465 from storytold/fix/component-name-header-2347
M3: the Design panel's header names the selected component or set (#2347)
2026-11-19 04:21:09 +07:00
BFlat 322bf16c8e Merge pull request #2463 from storytold/fix/library-style-hops-2414
M3: a library's style that reaches a file through another library stays bound (#2414)
2026-11-19 04:19:30 +07:00
BFlat f2696e0dbf Merge pull request #2464 from storytold/fix/rest-binding-warnings-2441
M6: REST import reports node-level paint and effect bindings only when something is lost (#2441)
2026-11-19 04:05:50 +07:00
bflatastic e1b96dc5c8 M3: the Design panel's header names the selected component or set (#2347) 2026-11-19 03:59:15 +07:00
bflatastic 0e5070d6cf M3: a library's style that reaches a file through another library stays bound (#2414)
Publishing keeps the variables its styles bind and where its copies of other libraries' assets came
from; importing files such a copy under that library when the file links it.
2026-11-19 03:54:44 +07:00
BFlat f51606ca4e Merge pull request #2462 from storytold/fix/variant-own-value-2349
M3: a selected variant's property dropdown shows and sets its own value (#2349)
2026-11-19 03:50:51 +07:00
bflatastic a88580470b M6: REST import reports node-level paint and effect bindings only when something is lost (#2441) 2026-11-19 03:42:03 +07:00
BFlat 964e7da7ec Merge pull request #2460 from storytold/fix/fixed-in-window-2430
M5: a fixed header stays in the window to the end of the page without a device (#2430)
2026-11-19 03:39:27 +07:00
bflatastic 116094a6db M3: a selected variant's property dropdown shows and sets its own value (#2349)
It showed the set's default, and choosing a value set the default, so the variants swapped places.
2026-11-19 03:16:35 +07:00
BFlat 024fba5bd2 Merge pull request #2454 from storytold/fix/outline-text-2405
M4: Outline stroke on a text without a stroke outlines its glyphs (#2405)
2026-11-19 03:15:26 +07:00
bflatastic 48c9d3fb14 M5: a fixed header stays in the window to the end of the page without a device (#2430)
Without a device, a frame taller than the window scrolled its content and then panned whole, taking
fixed and sticky layers off the top. A frame with them now takes the window as its screen.
2026-11-19 03:14:39 +07:00
BFlat 2a936671b2 Merge pull request #2455 from storytold/carry/2104
M8: dragging near the canvas edge pans the view, as in Figma (#2015)
2026-11-19 03:13:15 +07:00
Mex ceea6da487 Merge branch 'main' into patch-6 2026-11-18 21:12:24 +01:00
B-uchi 8dffbf87a1 M8: design context keeps its assets to the layers returned and says when a join stops
From review: the asset list follows the layers placed in the tree, so a
smaller tree (maxNodes, or the MCP tool's retry for maxBytes) means a smaller
list, and `truncated.assetsLeftOut` counts the rest; following aliases reports
`truncated.variables` when it stops at its budget with variables still to
read; and a font is checked with figcraft_text::has_family by its trimmed name,
as the missing-fonts list does, so a family stored with outer spaces isn't
taken for installed. A regression test for each fails without its fix.
2026-11-18 20:59:19 +01:00