A .figcraft, .fig or file JSON dropped on the canvas ran file.import,
which added its pages to the file in front. It now opens as a file of
its own, as on the home screen, in the browser too. Images and SVG
still import at the drop point; File > Import still adds pages.
- pending_open::open_dropped queues a dropped file as file.open; the
home screen and the canvas share it.
- Dragging only documents over the canvas says "Drop to open" (not in
the browser, which names no file until the drop).
- The tab-switch import test drops an SVG: it pinned where an import
lands, using a .figcraft only as a file to import.
MCP stdio is newline-delimited JSON, so one tool result is one message
and has to fit the client's read buffer whole; there is no streaming of
part of one. The TypeScript SDK's stdio transport defaults to 10 MiB and
hosts rarely raise it, so a document whose tree went past that killed
the server: the client stopped reading, the pipe broke, and every later
call in the session failed.
The tree is now reported at the deepest depth that fits, found by
bisection, with a `truncated` object giving the depth asked for, the
depth used, both sizes, the limit and a pointer to get_node for reading
one subtree deeply. `maxBytes` lets a caller that knows its own buffer
say so; the default is 8 MiB, leaving the envelope 2 MiB of the usual
10.
The size is measured as the transport sends it -- pretty-printed and
then escaped inside the text block, which adds about a tenth (342,136
bytes of tree became 379,954 on the wire in the fixture). A kilobyte is
reserved for the marker itself, which is added after the measurement.
A limit below even the shallowest tree still answers, at depth 0, with
the marker saying so: there is nothing smaller to send, and an error
would leave the caller with nothing at all.
The tool description now says that each level of depth multiplies the
response and points at get_node, which the report notes would have been
enough on its own to avoid the crash.
Fixes#912.
Found while testing crates/color/src/lib.rs:165 (also :173)
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A component set took its name from the first variant's name up to the first '/' or '=',
so variants named "State=Default, Size=Small" made a set called "State". The set now
takes the path before the last '/' ("Button/State=Hover" -> "Button",
"Icons/Arrow/Dir=Up" -> "Icons/Arrow"), keeps a plain name as is ("Button"), and
otherwise gets the next numbered default ("Component 1"), as a new component does.
- right.rs: drop the unused ACCENT import (main removed it); keep the grid
constants CAPTION_PT/TEXT_PT/TITLE_PT our branch added.
- typography.rs: keep our TEXT_PT size, adopt main's accent_text token rename.
- widgets.rs: keep our TEXT_PT size for the button label; the disabled colour is
now main's text_tertiary from the match, so the old dim() closure is dropped.
- ui-parity.md: keep our row and main's two (#890, #894) changelog rows.
The picker draws on the shared popover, so it closes the way the popover does: the X,
Escape, and a press outside it.
- A press on the canvas closes it; presses in the panel beside it keep it, since a
swatch, a style chip or a field there switches the colour it edits.
- The control that opened it is held out of that closing and its rect is refreshed every
frame, so pressing the same swatch again reaches its own toggle — after the panel
scrolls too (the bug #730 had, in the picker's hands).
- Escape closes it before the binding deselects the layer, and not while one of its own
dropdowns is open.
Tests: a press on the canvas closes it, the same swatch closes it again (panel_remove_tests).
Every section lays its rows out on the same grid: the panel is 240 pt, its content
16 pt in from the left and 8 pt from the right, two 88 pt columns at that width with
8 pt gutters and a 24 pt column for the buttons at a row's end (the columns are flex,
so they share a wider panel); rows are 24 pt in a 32 pt track, captions 10 pt under
them, labels and values 12 pt, the selection's type above them 14 pt. A row's two
buttons (eye, minus) are one group on the row's right edge, 24 pt each and 4 pt apart.
Two things put the right margins out before: block() inset every row by PAD on both
sides (16/16 instead of 16/8), and the panel's frame carried a 1 pt stroke (egui counts
a frame's stroke as its margin), which took a point off each side of the 240 pt panel.
The edge is drawn inside the panel now.
The paint, effect and layout grid rows reserve the whole button group before their
field (8 + 24 + 4 + 24 = 60), so the group lands on the panel's 8 pt margin; the export
preview frame takes the same 16 / 8. Every row that had its own width now asks the
grid: the stroke's align and weight fields split what the row leaves (74 + 8 + 74 with
two buttons, 88 + 8 + 88 with one), the type panel's size field and the full-width
dropdowns take the row's own width, and the Inspect tab's rows end at the 8 pt margin.
The fields' label inset is 8 (was 12) so "Intensity" fits its column whole beside its
value; the glass field's width in field_tests follows the wider column.
Tests: cargo test -p figcraft-ui-egui (549 passed).
Clicking a colour swatch opens the picker; clicking the same one again closes
it (another swatch switches the picker to its paint). The page background, the
text range, the paint rows, the effect rows and the selection colours all
toggle.
The pickers' review fixes on top: the colour picker keeps its popover only
while it is open (a body that closed it left a stale dragged place for the next
picker to inherit); the style picker resets its retained popover when a new
picker opens and on its early-close paths; and Escape belongs to the nested
colour picker first, so closing it doesn't take the style picker down with it.
Opening the style picker, the layout settings or the stroke settings closes the
colour picker instead of leaving it lingering beside them.
`Popover` is the one card detached panels draw on: a header 40 points high
with the title 16 in from its left edge and a 24-point X 8 in from its right,
a hairline under it, the theme's popup shadow, and one slot. Its measurements
are our own — the colour picker's header, which it now uses — not another
product's.
The colour picker and the style picker move onto it in this commit; each keeps
only its own body. The style picker keeps its dark surface through
`Surface::Menu`, and its tools row (view, detach, create) now starts the slot,
under the shared title.
Closing is the widget's now: the X, Escape, and a press outside it — except in
the rects the caller holds out (the button that opened it, a popover it opened
in turn), so that button's own click can toggle it shut instead of the press
closing it and the release opening it again (the bug #730 has). The colour
picker keeps its old habit of staying open while the panel beside it is used.
Tests: press-and-release for the X, for a press on the opener (open) and for a
press elsewhere (closed), plus Escape, the opening rule, the lift and the drag.
The chrome detached panels share, in one place: a 240 pt card with a 40 pt header —
the title 16 in from its left edge, a 24 pt X 8 in from its right — a hairline under
the header and the theme's popup shadow, around one slot:
let mut p = Popover::new("my_popover", tr("Title"));
let closed = p.show(ctx, Open::Anchor(pos), Hold::default(), |ui| { /* the slot */ });
The measurements are the ones the colour picker's header already used, which this widget
now draws; the card is as wide as the picker was. The shadow is the theme's
(`visuals.popup_shadow`), so the dark theme gets its own.
Closing is the widget's: the X, Escape, and a press outside it — except in the rects the
caller holds out (`Hold { rects, escape }`: the button that opened it, a popover it opened
in turn), so that button's own click can toggle it shut instead of the press closing it
and the release opening it again (the bug the fill-rule panel has). Press-and-release
tests pin all of it.
It opens against an anchor (its right edge on the anchor, top on it, lifted when that
would run off the screen's bottom) or at a point; the header drags it.
Six headless tests: the header's geometry, the opening rule, the lift, the drag, the X,
Escape, and the press-and-release of a press on the opener (open) and elsewhere (closed).
The warning still said fixed and content-sized tracks were written as equal
tracks, which the export no longer does. It now reports only the tracks whose
size the format can't hold, and only for the tracks an exported grid has.
Co-authored-by: xiaou61 <113765024+xiaou61@users.noreply.github.com>
The import has read `gridColumnsSizing` / `gridRowsSizing` since #630, but the
export wrote only equal tracks and warned about it, so a grid with a fixed
column beside two weighted ones came back equal after a save and reload.
Write the sizing map next to the order map, keyed by the same track ids: fixed
px, fractional fill and content-sized tracks keep their sizes. A track the
format has no name for (negative or out-of-range size, or a document track the
frame doesn't list) keeps its id and reads back equal, with the existing
warning.
Co-authored-by: xiaou61 <113765024+xiaou61@users.noreply.github.com>
Duplicate and Alt-drag copied a main component as a second main. Within
its file the copy is now an instance of it (components::copy_in_file,
shared by edit.duplicate and the Alt-drag copy), as Copy then Paste
already was. A variant duplicated in its set stays a new variant.
Layer data written with node.set {props: {pluginData}} was saved but no
command read it back. node.get (the command, the control method and MCP
get_node) and document.inspect now report pluginData as {key: value}
when a layer or page has any, so a tool keeping state in a file can
read it on its next run. Widget keys are included: the plugin rules
only stop plugins writing them, and widget.list already reports that
state.
Alt+arrows were left out of the nudge keys, so with Alt held to measure
the arrows did nothing and the distances never changed. The arrows now
nudge with Alt held too (Shift: the big step); the hover measurement is
recomputed every frame, so the labels follow each nudge. While measuring
to another layer the selection's handles and size label hide; both
layers keep their outlines.
The dim text token (disabled buttons, placeholders, hints) was 2.1:1 on
the light theme's panels; disabled buttons also faded to 40% opacity,
and selected text was drawn in the dark green, 1.4:1 on the dark
theme's selection highlight. The dim text token is now at least 3:1
against panels, fields and selected rows in both themes while staying
dimmer than secondary text, a disabled button is grey with that text,
and selected text takes the theme's readable green. A test checks the
ratios with the colour contrast helper.
Presentation tabs now take at most half the free strip while file tabs share it.
They shrink to the minimum tab width first, then the rest go into an overflow
menu, so they never reach the new-tab button, theme toggle or window buttons.
The close X has its own hit rect next to the tab body and is registered every
frame, so a click on it can no longer select the tab instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up. The closed-owner test now picks a device and switches
Responsive in the presenter and checks that the file in front keeps its
prototype settings, so removing either `live` guard in present::show fails
it. The present harness gets frame_output for the AccessKit tree. The new
tab functions get doc comments.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main plays a presentation in a single "Present" tab. Now each page of a
file gets its own tab, named "file - page", and the name follows
renames. Play on a page that has a tab shows that tab as it was; from
another start frame it starts again. A tab keeps its own copy of the
prototype: it plays on after its file closes, and a saved file opened
again gets its tabs back. A tab whose file is closed or not in front
never reads or changes the file in front (device, responsive,
comments). Escape or the tab's X closes that tab and goes back to its
file, or Home.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>