From 920aafb8052d47bcfe5d34f69243047170a1ce66 Mon Sep 17 00:00:00 2001 From: BFlat Date: Sat, 31 Oct 2026 06:32:59 +0700 Subject: [PATCH] M1: the colour picker's Image tab has a placeholder, a preview and takes a dropped file (#1682) (#1713) Choosing Image shows a checkered placeholder and Upload from computer instead of a dialog at once; an image paint shows its asset preview. A file dropped on the open picker replaces the image, keeping the fill mode, crop, position and adjustments (image.replace, one undo step; paths capped as image.place's). The browser's file picker reaches the tab too. Also fixes a race in library_detach_tests. --- ROADMAP.md | 3 +- .../src/library_detach_tests.rs | 9 +- crates/engine/src/cmd/create.rs | 23 +- crates/engine/src/cmd/image.rs | 44 ++- crates/engine/src/image_crop_tests.rs | 50 +++ crates/engine/src/session/exec.rs | 2 +- crates/ui-egui/locales/en.toml | 2 + crates/ui-egui/src/app/files.rs | 2 +- crates/ui-egui/src/canvas.rs | 5 +- crates/ui-egui/src/canvas/input.rs | 16 +- crates/ui-egui/src/pending_open.rs | 2 +- crates/ui-egui/src/widgets/colorpicker.rs | 149 +++++++-- .../src/widgets/colorpicker_image_tests.rs | 286 ++++++++++++++++++ docs/mcp.md | 3 + docs/roadmap.md | 3 +- docs/ui-parity.md | 4 +- 16 files changed, 562 insertions(+), 41 deletions(-) create mode 100644 crates/ui-egui/src/widgets/colorpicker_image_tests.rs diff --git a/ROADMAP.md b/ROADMAP.md index 539246ba..ee062bf7 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents) -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-30 · **Change:** minor (the Frame tool's Phone presets have the iPhone 17 family (#1691); Show in folder works in the Flatpak build and selects the file on Linux (#1701); a dashed line starts and ends with a half-length dash, on the canvas and in exports; the Pages, Layers and Assets search fields keep their text in the middle of the field (#1703); a board connector's path can be reshaped by dragging its path handles (#1710); boards have 16 more shapes (arrows, polygons, star, plus and flowchart symbols), in pickers that lay them out in a grid; library analytics count insertions and show insertions and detachments over the past 30 days, 90 days or year; a stroke's Custom style takes a dash pattern of any length as a comma-separated list (#1681); a control request can set its own timeout, up to 10 minutes (`timeoutMs`; `figcraft-cli mcp --attach PORT --timeout SECONDS`) (#1696); gap 6: a widget opens its plugin's panel (plugin API 5), whose callbacks redraw it; the keyboard's Menu key opens the context menu, as Shift+F10 does; an Open link action can open in place of the prototype, with "Open in new tab" off (gap 15); a collection of this file can be extended (Extend collection on its row, `variable.extendCollection`), its extension following its edits at once, and extended collections extend again in the file; the eyedropper with Cmd/Ctrl+Shift makes a colour style or variable of what it picks; a live session's welcome sends the document compressed to clients that read it, about seven times smaller (#1665); a control request that times out says truthfully whether it was dropped or is still running and will take effect, and only screenshots and input blame the window (#1673); a board keeps earlier votes' results, listed newest first in Results and deleted one at a time; the object a stamp will stick to is outlined while the stamp tool is over it or a stamp is dragged over it, and board objects take no drops (gap 24); a server can list the files shared from it now for everyone who reaches it, Home ▸ Online shows them and their links carry no secret (`team_files`, part of #742); team library analytics count detached instances per component and file (gap 10); skipping the Open link notice by command is saved with the preferences at once (gap 15); a selected connector's bar on a board sets its start and end points, solid or dashed, its weight and any colour (#1596); cells copied from a spreadsheet paste onto a board as a table; a long layer name stays on one line in the Export button and the Dev Mode header, ending with an ellipsis, and no longer covers the Design panel (#1650); with hundreds of layers selected, the Design panel and the selection overlays stop going over the whole selection on every frame, so dragging 648 layers averages about 1.1 ms of UI per frame (#1571); plugin panels show pictures: an `image` control, base64 within 256 KB and 4,096 px a side, named by its label (gap 6); `.fig` connector labels without a saved snapshot are kept, centred on their line (gap 1); a drag moving many layers re-runs only what sits around them, not each layer's bindings, sizing, text and instance checks, on every move (#1571); damaged font tracking table offsets are checked instead of wrapping on 32-bit targets, and font indexing makes its existing offset bounds explicit (#1125); Bosnian (`bs`) draft catalog; text style dedupe is O(spans) via a last-two cache and fingerprint buckets (#1102); pasted layers whose image the clipboard lacks are named and show a placeholder that reads as missing (#1646); paint-style colours on layers pasted from another design app keep their style instead of turning black (#1638); progress docs cleaned of what merges left twice: rows merged into one, repeated status items removed, and `cargo xtask docs` (in `ci`) fails on a repeated table row or status item; a name typed for a variable or collection finds the one with that exact id before one named like it, and stored mode ids, font family variables and the panels' labels read exact ids (#1613); plugin widgets have hover styles: a layer's `hover` fill, stroke, opacity or text colour shows while the pointer is over it (gap 6); `.fig` elbowed and curved connectors without a saved path are routed like board connectors instead of drawn straight (gap 1); every file a command reads whole by path is a regular file within a cap that fits it: documents 16 GiB, placed images 256 MiB, CLI scripts 1 GiB; `figcraft-cli connect publish` publishes a code repository's code connect mappings to a design file (gap 16); while a drag only moves a large selection, its outlines, box, slots, spacing and Design panel values are worked out once and shifted, not rebuilt on every move (#1571); Shift+Cmd/Ctrl+Enter on a selected board shape adds the next shape already joined to it, and goes on typing (#1597); an imported or pasted file finds an installed family under the other names its fonts give it, and with other case and spacing, instead of reporting it missing (#1292); a development example generates figcraft-cli's shell completions and man pages from its clap definitions (part of #1396); `.fig` ZIP image reads share a total byte budget and count skipped images in the import warnings (#1076); German terminology corrections (M10): gradient stops, OpenType stylistic sets and the Home-screen preference; a component set's property rows fit the 240 px right panel: variant values wrap two to a line there and every + and − stays in view; the server key is checked by comparing SHA-256 hashes of the presented and the kept key, as the deployment guide says (#1130); opening a file contacts no team library server it names until you check it (#1097); a hostile server can no longer grow a client's memory with made-up people, and a session remembers a bounded number of deleted layer ids (#1121); `doc.list` gives AI agents and plugins the open files' names, not their paths (#1117); with a large selection, frames where nothing changed reuse the selection's outlines, box and slots and the Design panel's instance and position values instead of working them out again (#1571); team libraries and plugins larger than the 16 MiB download burst can be downloaded again, more slowly (#1089); a batch keeps one undo snapshot, not one per step (#1099); files nested 256 levels deep import on the browser's 1 MB stack (#1101); SVG and PDF exports count pattern sources and the renders they embed from the layer's depth, so one cap bounds a whole export (#1082); an explicit variables file path (`variable.import`, the `variables` of `file.open` and `file.import`) is refused past 256 MiB or when it isn't a regular file, as the sibling `variables.json` already was (part of #1114); joining and leaving a file nobody is editing reads and writes nothing on the server: it stays loaded a minute after everyone leaves (#1074); opening a `.figcraft` file unpacks at most 6 GiB in all (2 GiB in the browser), every area together (#1079); hovering the canvas hit-tests once per pointer move, not on every frame, and moving an auto layout frame no longer lays out its contents again on every move (#1571); `.fig` instance expansion no longer walks variable nodes for every instance or copies every outer override row into each nested instance (#1077); `comment.people` lists names that were only @mentioned, and `comment.next` and `comment.prompt` carry the mentions too (#1415); grid auto-placement looks for free cells a 64-bit word at a time and skips what blocks it, with the same placements (#1083); with the pen out, Enter or a double-click ends the path and edits the vector with the Move tool instead of drawing on (#1430); a recovery copy made while a version is previewed holds the file, not the version shown; a FigJam `.jam` file opens as a board (#1342); the Actions palette offers only commands that run from it, and no second row reading like a menu item: Place image opens the file dialog (#1574); share links can comment: a third access level beside edit and view, whose holder sees the file live and adds, replies to, reacts to and resolves comments but can't change the design; Preferences ▸ Scroll wheel zoom: a mouse wheel zooms the canvas about the pointer and Cmd/Ctrl+wheel scrolls (#1390); `comment.list {mentions}` lists only the threads that @mention a name (#1415); in the browser an internal error that stops the page keeps its unsaved files, which open again on reload (#1123); boolean operations refuse input past their caps, and a boolean group past them draws without its result (#1104); figcraft-cli parses its arguments with clap, following RFC-0012 (#1396); the selection and hover outlines of rounded rectangles and frames follow their corners (#1506); component properties keep the order they were made in when one is renamed, and Make slot asks for the slot's name first (#1536, #1537); the browser build publishes files to a server, so Share ▸ Online and Publish to server work there (#917); the browser build uses the fonts installed on the computer once asked, each read when text uses it (#1051); SVG import reads `color()` and `color-mix()` colours, with a note and a grey for those it can't (#1550); the portable Windows zip keeps its settings, recovery copies and plugins in `config\` beside the executable, starting with an installed copy's preferences; the window starts on other graphics when its first ones fail before the first frame: Direct3D 12 compiles with FXC and no device compiles wgpu's indirect-validation shaders, then Vulkan, OpenGL and lower requirements on the power-saving GPU (#965, #1438); Thai, Lao, Khmer and Burmese lines break between words (#1219); an AI agent attached over MCP shows where it works (#1416); a manual overlay's position can be dragged on the canvas (#405); one name for live sessions and comments: Preferences ▸ Your name, in the Join dialog too, kept in the browser, and a rename shows at once in the sessions you are in (#1380); requests that change a server's files have a budget per address, the server key's too, and join codes are found by their hash (#1075); the Join dialog shows a join from the click until its file is ready, with Cancel, and a failed join with Try again (#1381); SVG import draws each pattern tile once per scale, within the layer budget (#1080); Vietnamese letters typed with combining marks (decomposed) take one font that has every mark, instead of missing-glyph boxes beside the letter (#1478); comment.list reports each message's @mentions (#1415); mask groups draw only over the area they can paint, and nested isolated layers share one memory budget (#1061); components can't contain their own instances, directly or through other components; `edit.duplicate` returns an id map with `map: true` (#995); the batches kept for reconnecting apps are bounded in bytes by default, and `figcraft-server` takes `max_log_mb` (#1069); MCP and control calls name their document (#998); sibling placement in live sessions searches instead of counting (#1065); an AI agent attached over MCP comments under its own name, with an Agent label (#1414); the instance-swap menus have a search field (#1338); a refused batch's fixes take time linear in the batch (#1063); the connector tool shows the connector it will make while dragging, ends snapping to attach points (#1387); large images on the canvas draw from a smaller copy, so two 16k images no longer lag (#1483); a file's JPEG thumbnail can't crash the home screen (#1491's progressive JPEG check, now shared); `.fig` import: library text styles linked by asset key, and override rows restating a nested level (#1234); `.fig` import keeps the file's saved line breaks while the text and its box are unedited (#1236); Download a missing free font from the Missing fonts window (`font.download`, #754); the web build's wasm back under its 24 MiB gate (#1472); shadows of images with transparent pixels follow their alpha (#1289); Crop image: Object ▸ Crop image, the right-click menu and the image fill row enter crop mode (`image.crop`, #1464); offline Penpot 2.x import/export (#1143); optional batch continue-on-error with per-step outcomes (#1386); the Design panel's sections on one grid (#858); FigJam outer shape outlines and sticky body fallback beside author text (#1341, #1397); images placed at their own size, 2x screenshots in points (#1360); the toolbar on one 32 pt grid, without its Resources button (#1210); M4: zero-length round-capped dashes draw dots; dash expansion uses the existing safety budget; extracted from #1143; Arabic draft catalog; scaled instances keep their scale when their main is rebuilt (#922); .fig embedded images are copied once per blob, not once per hash (#1059); page ruler guides survive save and reopen (#1476); colour picker LCH and OKLCH models; non-ASCII layer names transliterate in code export (#1235); branches in live sessions and branch history entries, gap 17; plugin widgets take text input and a property menu (plugin API 4); boards: templates and tables; boards: a shared timer and voting sessions; boards: the dot grid, connector ends dragged to re-attach, curved connectors; Installed weights of an embedded font family (#1246); `.sketch` import, best effort (Sketch 48 and newer); CJK line breaking: JIS X 4051's line-start and line-end sets completed with the halfwidth small kana, the halfwidth and spacing (semi-)voiced sound marks, the iteration marks 〱–〵 and the halfwidth parentheses, with behaviour cases for each; Adobe Fonts found on macOS (#298); egui 0.37 hidden-capture deadline contract; Dev Mode measurements kept on the canvas and a read-only layers panel; boards: a board area row and progress entry; community fixes in #507, #510, #529 and #530: auto-save, a text box by dragging, batch step references, removing someone from a live session, Russian and Turkish catalogs reviewed, Czech and Indonesian drafts, the Japanese draft completed, zoom previews, the web clipboard, Alt-drag snapping and Cmd+D repeat, recovery copies, crash and rollback fixes, colour emoji, `.fig` import fixes; earlier changes are in the revision history below) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-30 · **Change:** minor (the colour picker's Image tab shows a placeholder and Upload from computer, an asset preview, and a file dropped on it replaces the image, keeping the fill mode, crop and position (#1682); the Frame tool's Phone presets have the iPhone 17 family (#1691); Show in folder works in the Flatpak build and selects the file on Linux (#1701); a dashed line starts and ends with a half-length dash, on the canvas and in exports; the Pages, Layers and Assets search fields keep their text in the middle of the field (#1703); a board connector's path can be reshaped by dragging its path handles (#1710); boards have 16 more shapes (arrows, polygons, star, plus and flowchart symbols), in pickers that lay them out in a grid; library analytics count insertions and show insertions and detachments over the past 30 days, 90 days or year; a stroke's Custom style takes a dash pattern of any length as a comma-separated list (#1681); a control request can set its own timeout, up to 10 minutes (`timeoutMs`; `figcraft-cli mcp --attach PORT --timeout SECONDS`) (#1696); gap 6: a widget opens its plugin's panel (plugin API 5), whose callbacks redraw it; the keyboard's Menu key opens the context menu, as Shift+F10 does; an Open link action can open in place of the prototype, with "Open in new tab" off (gap 15); a collection of this file can be extended (Extend collection on its row, `variable.extendCollection`), its extension following its edits at once, and extended collections extend again in the file; the eyedropper with Cmd/Ctrl+Shift makes a colour style or variable of what it picks; a live session's welcome sends the document compressed to clients that read it, about seven times smaller (#1665); a control request that times out says truthfully whether it was dropped or is still running and will take effect, and only screenshots and input blame the window (#1673); a board keeps earlier votes' results, listed newest first in Results and deleted one at a time; the object a stamp will stick to is outlined while the stamp tool is over it or a stamp is dragged over it, and board objects take no drops (gap 24); a server can list the files shared from it now for everyone who reaches it, Home ▸ Online shows them and their links carry no secret (`team_files`, part of #742); team library analytics count detached instances per component and file (gap 10); skipping the Open link notice by command is saved with the preferences at once (gap 15); a selected connector's bar on a board sets its start and end points, solid or dashed, its weight and any colour (#1596); cells copied from a spreadsheet paste onto a board as a table; a long layer name stays on one line in the Export button and the Dev Mode header, ending with an ellipsis, and no longer covers the Design panel (#1650); with hundreds of layers selected, the Design panel and the selection overlays stop going over the whole selection on every frame, so dragging 648 layers averages about 1.1 ms of UI per frame (#1571); plugin panels show pictures: an `image` control, base64 within 256 KB and 4,096 px a side, named by its label (gap 6); `.fig` connector labels without a saved snapshot are kept, centred on their line (gap 1); a drag moving many layers re-runs only what sits around them, not each layer's bindings, sizing, text and instance checks, on every move (#1571); damaged font tracking table offsets are checked instead of wrapping on 32-bit targets, and font indexing makes its existing offset bounds explicit (#1125); Bosnian (`bs`) draft catalog; text style dedupe is O(spans) via a last-two cache and fingerprint buckets (#1102); pasted layers whose image the clipboard lacks are named and show a placeholder that reads as missing (#1646); paint-style colours on layers pasted from another design app keep their style instead of turning black (#1638); progress docs cleaned of what merges left twice: rows merged into one, repeated status items removed, and `cargo xtask docs` (in `ci`) fails on a repeated table row or status item; a name typed for a variable or collection finds the one with that exact id before one named like it, and stored mode ids, font family variables and the panels' labels read exact ids (#1613); plugin widgets have hover styles: a layer's `hover` fill, stroke, opacity or text colour shows while the pointer is over it (gap 6); `.fig` elbowed and curved connectors without a saved path are routed like board connectors instead of drawn straight (gap 1); every file a command reads whole by path is a regular file within a cap that fits it: documents 16 GiB, placed images 256 MiB, CLI scripts 1 GiB; `figcraft-cli connect publish` publishes a code repository's code connect mappings to a design file (gap 16); while a drag only moves a large selection, its outlines, box, slots, spacing and Design panel values are worked out once and shifted, not rebuilt on every move (#1571); Shift+Cmd/Ctrl+Enter on a selected board shape adds the next shape already joined to it, and goes on typing (#1597); an imported or pasted file finds an installed family under the other names its fonts give it, and with other case and spacing, instead of reporting it missing (#1292); a development example generates figcraft-cli's shell completions and man pages from its clap definitions (part of #1396); `.fig` ZIP image reads share a total byte budget and count skipped images in the import warnings (#1076); German terminology corrections (M10): gradient stops, OpenType stylistic sets and the Home-screen preference; a component set's property rows fit the 240 px right panel: variant values wrap two to a line there and every + and − stays in view; the server key is checked by comparing SHA-256 hashes of the presented and the kept key, as the deployment guide says (#1130); opening a file contacts no team library server it names until you check it (#1097); a hostile server can no longer grow a client's memory with made-up people, and a session remembers a bounded number of deleted layer ids (#1121); `doc.list` gives AI agents and plugins the open files' names, not their paths (#1117); with a large selection, frames where nothing changed reuse the selection's outlines, box and slots and the Design panel's instance and position values instead of working them out again (#1571); team libraries and plugins larger than the 16 MiB download burst can be downloaded again, more slowly (#1089); a batch keeps one undo snapshot, not one per step (#1099); files nested 256 levels deep import on the browser's 1 MB stack (#1101); SVG and PDF exports count pattern sources and the renders they embed from the layer's depth, so one cap bounds a whole export (#1082); an explicit variables file path (`variable.import`, the `variables` of `file.open` and `file.import`) is refused past 256 MiB or when it isn't a regular file, as the sibling `variables.json` already was (part of #1114); joining and leaving a file nobody is editing reads and writes nothing on the server: it stays loaded a minute after everyone leaves (#1074); opening a `.figcraft` file unpacks at most 6 GiB in all (2 GiB in the browser), every area together (#1079); hovering the canvas hit-tests once per pointer move, not on every frame, and moving an auto layout frame no longer lays out its contents again on every move (#1571); `.fig` instance expansion no longer walks variable nodes for every instance or copies every outer override row into each nested instance (#1077); `comment.people` lists names that were only @mentioned, and `comment.next` and `comment.prompt` carry the mentions too (#1415); grid auto-placement looks for free cells a 64-bit word at a time and skips what blocks it, with the same placements (#1083); with the pen out, Enter or a double-click ends the path and edits the vector with the Move tool instead of drawing on (#1430); a recovery copy made while a version is previewed holds the file, not the version shown; a FigJam `.jam` file opens as a board (#1342); the Actions palette offers only commands that run from it, and no second row reading like a menu item: Place image opens the file dialog (#1574); share links can comment: a third access level beside edit and view, whose holder sees the file live and adds, replies to, reacts to and resolves comments but can't change the design; Preferences ▸ Scroll wheel zoom: a mouse wheel zooms the canvas about the pointer and Cmd/Ctrl+wheel scrolls (#1390); `comment.list {mentions}` lists only the threads that @mention a name (#1415); in the browser an internal error that stops the page keeps its unsaved files, which open again on reload (#1123); boolean operations refuse input past their caps, and a boolean group past them draws without its result (#1104); figcraft-cli parses its arguments with clap, following RFC-0012 (#1396); the selection and hover outlines of rounded rectangles and frames follow their corners (#1506); component properties keep the order they were made in when one is renamed, and Make slot asks for the slot's name first (#1536, #1537); the browser build publishes files to a server, so Share ▸ Online and Publish to server work there (#917); the browser build uses the fonts installed on the computer once asked, each read when text uses it (#1051); SVG import reads `color()` and `color-mix()` colours, with a note and a grey for those it can't (#1550); the portable Windows zip keeps its settings, recovery copies and plugins in `config\` beside the executable, starting with an installed copy's preferences; the window starts on other graphics when its first ones fail before the first frame: Direct3D 12 compiles with FXC and no device compiles wgpu's indirect-validation shaders, then Vulkan, OpenGL and lower requirements on the power-saving GPU (#965, #1438); Thai, Lao, Khmer and Burmese lines break between words (#1219); an AI agent attached over MCP shows where it works (#1416); a manual overlay's position can be dragged on the canvas (#405); one name for live sessions and comments: Preferences ▸ Your name, in the Join dialog too, kept in the browser, and a rename shows at once in the sessions you are in (#1380); requests that change a server's files have a budget per address, the server key's too, and join codes are found by their hash (#1075); the Join dialog shows a join from the click until its file is ready, with Cancel, and a failed join with Try again (#1381); SVG import draws each pattern tile once per scale, within the layer budget (#1080); Vietnamese letters typed with combining marks (decomposed) take one font that has every mark, instead of missing-glyph boxes beside the letter (#1478); comment.list reports each message's @mentions (#1415); mask groups draw only over the area they can paint, and nested isolated layers share one memory budget (#1061); components can't contain their own instances, directly or through other components; `edit.duplicate` returns an id map with `map: true` (#995); the batches kept for reconnecting apps are bounded in bytes by default, and `figcraft-server` takes `max_log_mb` (#1069); MCP and control calls name their document (#998); sibling placement in live sessions searches instead of counting (#1065); an AI agent attached over MCP comments under its own name, with an Agent label (#1414); the instance-swap menus have a search field (#1338); a refused batch's fixes take time linear in the batch (#1063); the connector tool shows the connector it will make while dragging, ends snapping to attach points (#1387); large images on the canvas draw from a smaller copy, so two 16k images no longer lag (#1483); a file's JPEG thumbnail can't crash the home screen (#1491's progressive JPEG check, now shared); `.fig` import: library text styles linked by asset key, and override rows restating a nested level (#1234); `.fig` import keeps the file's saved line breaks while the text and its box are unedited (#1236); Download a missing free font from the Missing fonts window (`font.download`, #754); the web build's wasm back under its 24 MiB gate (#1472); shadows of images with transparent pixels follow their alpha (#1289); Crop image: Object ▸ Crop image, the right-click menu and the image fill row enter crop mode (`image.crop`, #1464); offline Penpot 2.x import/export (#1143); optional batch continue-on-error with per-step outcomes (#1386); the Design panel's sections on one grid (#858); FigJam outer shape outlines and sticky body fallback beside author text (#1341, #1397); images placed at their own size, 2x screenshots in points (#1360); the toolbar on one 32 pt grid, without its Resources button (#1210); M4: zero-length round-capped dashes draw dots; dash expansion uses the existing safety budget; extracted from #1143; Arabic draft catalog; scaled instances keep their scale when their main is rebuilt (#922); .fig embedded images are copied once per blob, not once per hash (#1059); page ruler guides survive save and reopen (#1476); colour picker LCH and OKLCH models; non-ASCII layer names transliterate in code export (#1235); branches in live sessions and branch history entries, gap 17; plugin widgets take text input and a property menu (plugin API 4); boards: templates and tables; boards: a shared timer and voting sessions; boards: the dot grid, connector ends dragged to re-attach, curved connectors; Installed weights of an embedded font family (#1246); `.sketch` import, best effort (Sketch 48 and newer); CJK line breaking: JIS X 4051's line-start and line-end sets completed with the halfwidth small kana, the halfwidth and spacing (semi-)voiced sound marks, the iteration marks 〱–〵 and the halfwidth parentheses, with behaviour cases for each; Adobe Fonts found on macOS (#298); egui 0.37 hidden-capture deadline contract; Dev Mode measurements kept on the canvas and a read-only layers panel; boards: a board area row and progress entry; community fixes in #507, #510, #529 and #530: auto-save, a text box by dragging, batch step references, removing someone from a live session, Russian and Turkish catalogs reviewed, Czech and Indonesian drafts, the Japanese draft completed, zoom previews, the web clipboard, Alt-drag snapping and Cmd+D repeat, recovery copies, crash and rollback fixes, colour emoji, `.fig` import fixes; earlier changes are in the revision history below) · **Target:** Figma Design (desktop app 126.10.7) FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow, native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through @@ -358,6 +358,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md). | Date | Change | Summary | |---|---|---| +| 2026-10-31 | minor | M1, #1682: as the help center describes the colour picker, choosing Image no longer opens a file dialog at once: the tab shows a checkered placeholder and Upload from computer until there is a file. An image paint shows its asset preview with the same button. A file dropped on the open picker replaces the image and keeps the fill mode, crop, position and adjustments; on the placeholder it becomes the paint's image, filling the layer. While a file is dragged the picker says it takes it instead of the window saying Drop to import. New command `image.replace {ids?, target?, index?, data | path}`, through the same size cap and decoder as `image.place`; one undo step. Dropped files in the browser arrive as `data`. A native window or a browser doesn't say where a dragged file is, so a drop with no known position goes to the open picker, and one known to be over the canvas imports as before. Left: the Fill and Stroke swatches in the Design panel don't take a drop, since their place can't be told during a drag; pasting into the picker isn't documented and isn't added. Tests: `colorpicker_image_tests`, `image_crop_tests::replacing_an_image_keeps_its_fill_mode_crop_and_adjustments`. Numbers unchanged | | 2026-10-31 | minor | M1, #1691: the Frame tool's Phone presets stopped at the iPhone 16 family, while the prototype device list already had the iPhone 17, 17 Pro, 17 Pro Max and Air. All four are presets now, at the same sizes (402×874, 402×874, 440×956, 420×912), and `frame.create {preset}` takes them. A test keeps every preset named like a prototype device at that device's size. Test: `frame_tests::presets_keep_the_sizes_of_the_prototype_devices`. Numbers unchanged | | 2026-10-31 | patch | M8, #1701: Show in folder on Linux asks the desktop portal to show the file (`OpenDirectory`), selected, and opens its folder with `xdg-open` only without a portal. In the Flatpak build, a file picked through the portal lives in a document folder that the portal reads as the document itself, so the old call offered to open the file ("No Apps Available"). | | 2026-10-31 | patch | M4: an open dashed line starts and ends with a half-length dash, with a whole number of patterns fitted to it (dashes and gaps scaled together), for Dash and Custom patterns, on the canvas, in PNG, PDF and SVG (`stroke-dashoffset`) and in Outline stroke. Closed paths are unchanged. An imported SVG's open dashed line follows the same rule. | diff --git a/apps/figcraft-server/src/library_detach_tests.rs b/apps/figcraft-server/src/library_detach_tests.rs index ed0e7084..f6dd91f0 100644 --- a/apps/figcraft-server/src/library_detach_tests.rs +++ b/apps/figcraft-server/src/library_detach_tests.rs @@ -26,7 +26,7 @@ fn id(v: &Value) -> NodeId { /// `a`'s analytics of its file's library once `done` holds for them (the reports arrive from /// another app's background requests). -fn usage_when(a: &mut Session, done: impl Fn(&Value) -> bool) -> Value { +fn usage_when(a: &mut Session, mut done: impl FnMut(&Value) -> bool) -> Value { let start = Instant::now(); loop { let u = ex(a, "library.usage", json!({})); @@ -73,8 +73,11 @@ fn detaches_are_reported_and_counted_beside_instances() { // Detaching the other one too: no instances left, still listed with its detaches. ex(&mut b, "component.detach", json!({"ids": [one]})); - b.refresh_server_libraries(); - let u = usage_when(&mut a, |u| u["detached"] == 2 && u["instances"] == 0); + // Again each time: a check asked for while the last one still runs is dropped. + let u = usage_when(&mut a, |u| { + b.refresh_server_libraries(); + u["detached"] == 2 && u["instances"] == 0 + }); assert_eq!(u["instances"], 0, "{u}"); assert_eq!((u["components"][0]["name"].clone(), u["components"][0]["detached"].clone()), (json!("Button"), json!(2)), "{u}"); server.stop(); diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index d2b1ae78..ba14ce54 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -425,6 +425,19 @@ fn read_path(path: &str) -> Result> { Err(crate::EngineError::Other(format!("{path}: files can't be read in the browser"))) } +/// The image `cmd` was given: `data` (base64) or a `path`, whose size is capped. +pub(super) fn image_bytes(cmd: &str, p: &Value) -> Result> { + if let Some(b64) = string(p, "data") { + use base64::Engine as _; + let b64 = b64.split_once(',').map(|(_, d)| d.to_string()).unwrap_or(b64); + base64::engine::general_purpose::STANDARD.decode(b64.trim()).map_err(|e| bad(cmd, format!("`data`: {e}"))) + } else if let Some(path) = string(p, "path") { + read_path(&path) + } else { + Err(bad(cmd, "pass `data` (base64) or `path`")) + } +} + /// Layers that can show an image inside their own outline. pub fn accepts_image_fill(kind: &NodeKind) -> bool { kind.is_shape() || kind.is_frame_like() || matches!(kind, NodeKind::Text(_) | NodeKind::BooleanOp { .. }) @@ -447,15 +460,7 @@ pub fn place_image(s: &mut Session, p: &Value) -> Result { return Err(bad(cmd, "`target` must be a layer that can have a fill")); } } - let bytes = if let Some(b64) = string(p, "data") { - use base64::Engine as _; - let b64 = b64.split_once(',').map(|(_, d)| d.to_string()).unwrap_or(b64); - base64::engine::general_purpose::STANDARD.decode(b64.trim()).map_err(|e| bad(cmd, format!("`data`: {e}")))? - } else if let Some(path) = string(p, "path") { - read_path(&path)? - } else { - return Err(bad(cmd, "pass `data` (base64) or `path`")); - }; + let bytes = image_bytes(cmd, p)?; let mode = match string(p, "mode").unwrap_or_default().to_ascii_lowercase().as_str() { "fit" => ImageScaleMode::Fit, "crop" => ImageScaleMode::Crop, diff --git a/crates/engine/src/cmd/image.rs b/crates/engine/src/cmd/image.rs index cefd723b..a7f6f917 100644 --- a/crates/engine/src/cmd/image.rs +++ b/crates/engine/src/cmd/image.rs @@ -1,6 +1,6 @@ //! Image paints: adjustment presets, built in and saved in the file, and Crop image. -use figcraft_color::{ImageFilters, ImageScaleMode, PaintKind}; +use figcraft_color::{ImageFilters, ImageScaleMode, Paint, PaintKind}; use figcraft_doc::{Document, ImagePreset, Node}; use serde_json::{Value, json}; @@ -17,6 +17,13 @@ pub fn specs() -> Vec { true, adjust ), + spec!( + "image.replace", + "Replace image", + "{ids?, target? (fill|stroke, default fill), index? (default each layer's top image paint), data (base64) | path} puts the image in the paint, keeping its fill mode, crop, position and adjustments; a paint at `index` that isn't an image becomes one, filling the layer; returns {image, width, height, changed}", + true, + replace + ), spec!( "image.savePreset", "Save image preset", @@ -142,6 +149,41 @@ fn adjust(s: &mut Session, p: &Value) -> Result { Ok(json!({"changed": changed})) } +fn replace(s: &mut Session, p: &Value) -> Result { + let cmd = "image.replace"; + let ids = req_targets(cmd, s, p)?; + let stroke = strokes(cmd, p)?; + let index = match get(p, "index") { + None | Some(Value::Null) => None, + Some(_) => Some(req_index(cmd, p, "index")?), + }; + let bytes = super::create::image_bytes(cmd, p)?; + let doc = s.doc_mut()?; + let (image, width, height) = figcraft_format::add_image(doc, bytes).map_err(|e| bad(cmd, e.to_string()))?; + let mut changed = 0; + for id in ids { + let n = doc.get_mut(id)?; + let list = if stroke { &mut n.strokes } else { &mut n.fills }; + let at = index.or_else(|| list.iter().rposition(|x| matches!(x.kind, PaintKind::Image(_)))); + let Some(paint) = at.and_then(|i| list.get_mut(i)) else { continue }; + match &mut paint.kind { + PaintKind::Image(img) => img.image.clone_from(&image), + kind => *kind = Paint::image(image.clone(), ImageScaleMode::Fill).kind, + } + // Like any paint edit, the layer leaves its paint style. + if stroke { + n.styles.stroke = None; + } else { + n.styles.fill = None; + } + changed += 1; + } + if changed == 0 { + return Err(bad(cmd, if index.is_some() { "no paint at that index" } else { "the layers have no image paints" })); + } + Ok(json!({"image": image, "width": width, "height": height, "changed": changed})) +} + /// The index of a layer's top visible image fill (fills paint bottom to top). pub fn top_image_fill(n: &Node) -> Option { n.fills.iter().rposition(|f| f.visible && matches!(f.kind, PaintKind::Image(_))) diff --git a/crates/engine/src/image_crop_tests.rs b/crates/engine/src/image_crop_tests.rs index c7403dfb..7d054988 100644 --- a/crates/engine/src/image_crop_tests.rs +++ b/crates/engine/src/image_crop_tests.rs @@ -108,3 +108,53 @@ fn crop_image_is_refused_without_one_image_layer() { assert_eq!(s.doc().unwrap(), &doc, "nothing changes"); assert!(s.ui_requests.is_empty(), "no crop mode"); } + +/// `image.replace`: the image changes and everything set on the paint stays; a paint that isn't an +/// image becomes one; one undo step. Bytes that aren't an image are refused and nothing changes. +#[test] +fn replacing_an_image_keeps_its_fill_mode_crop_and_adjustments() { + let mut s = Session::new(); + let layer = image_layer(&mut s); + ex(&mut s, "image.crop", json!({"ids": [layer]})); + ex(&mut s, "image.adjust", json!({"ids": [layer], "filters": {"contrast": 0.25}})); + let image_of = |s: &Session| match &fills(s, layer)[0].kind { + PaintKind::Image(i) => i.clone(), + other => panic!("not an image: {other:?}"), + }; + let before = image_of(&s); + let png = |r: u8| { + let image = image::RgbaImage::from_pixel(10, 10, image::Rgba([r, 0, 0, 255])); + let mut bytes = std::io::Cursor::new(Vec::new()); + image.write_to(&mut bytes, image::ImageFormat::Png).unwrap(); + base64::engine::general_purpose::STANDARD.encode(bytes.into_inner()) + }; + let r = ex(&mut s, "image.replace", json!({"ids": [layer], "data": png(1)})); + assert_eq!((r["changed"].clone(), r["width"].clone()), (json!(1), json!(10)), "{r}"); + let after = image_of(&s); + assert_ne!(after.image, before.image); + assert_eq!(r["image"], json!(after.image)); + assert_eq!((after.scale_mode, after.crop, after.filters), (ImageScaleMode::Crop, before.crop, before.filters)); + assert!(s.doc().unwrap().images.contains_key(&after.image)); + s.undo().unwrap(); + assert_eq!(image_of(&s).image, before.image, "one undo step"); + + // A solid paint at `index` becomes an image filling the layer; a stroke by `target`. + let solid = crate::params::id_of( + &ex(&mut s, "shape.rectangle", json!({"x": 0, "y": 300, "width": 40, "height": 40, "props": {"fill": "#ff0000"}}))["id"], + ) + .unwrap(); + assert!(s.execute("image.replace", &json!({"ids": [solid], "data": png(2)})).is_err(), "no image paint to replace"); + ex(&mut s, "image.replace", json!({"ids": [solid], "index": 0, "data": png(2)})); + assert!(matches!(&fills(&s, solid)[0].kind, PaintKind::Image(i) if i.scale_mode == ImageScaleMode::Fill)); + ex(&mut s, "node.set", json!({"ids": [solid], "props": {"stroke": "#000000"}})); + ex(&mut s, "image.replace", json!({"ids": [solid], "target": "stroke", "index": 0, "data": png(3)})); + assert!(matches!(s.doc().unwrap().node(solid).unwrap().strokes[0].kind, PaintKind::Image(_))); + + // Refused: nothing that decodes, no paint there, neither data nor path. + let junk = base64::engine::general_purpose::STANDARD.encode(b"not an image"); + let now = fills(&s, solid); + assert!(s.execute("image.replace", &json!({"ids": [solid], "index": 0, "data": junk})).is_err()); + assert!(s.execute("image.replace", &json!({"ids": [solid], "index": 9, "data": png(4)})).is_err()); + assert!(s.execute("image.replace", &json!({"ids": [solid], "index": 0})).is_err()); + assert_eq!(fills(&s, solid), now); +} diff --git a/crates/engine/src/session/exec.rs b/crates/engine/src/session/exec.rs index 097f44c7..73f2d7d1 100644 --- a/crates/engine/src/session/exec.rs +++ b/crates/engine/src/session/exec.rs @@ -6,7 +6,7 @@ use super::{ /// Whether a command, or a batch wrapping one, imports a file passed as Base64 `data`. fn command_carries_import_bytes(id: &str, params: &Value) -> bool { match id { - "file.import" => params::get(params, "data").is_some(), + "file.import" | "image.replace" => params::get(params, "data").is_some(), "command.batch" => params.get("commands").and_then(Value::as_array).is_some_and(|commands| { commands.iter().any(|c| { c.get("command").and_then(Value::as_str).zip(c.get("params")).is_some_and(|(id, params)| command_carries_import_bytes(id, params)) diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 860280dd..a20beb20 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -481,6 +481,7 @@ name = "English" "Drop to import" = "Drop to import" "Drop to open" = "Drop to open" "Drop shadow" = "Drop shadow" +"Drop to use this image" = "Drop to use this image" "Dual-licensed MIT OR Apache-2.0. Made by the ArtCraft team and community." = "Dual-licensed MIT OR Apache-2.0. Made by the ArtCraft team and community." "Duo" = "Duo" "Duplicate" = "Duplicate" @@ -1320,6 +1321,7 @@ name = "English" "This server doesn't count insertions" = "This server doesn't count insertions" "Someone who left" = "Someone who left" "Take the results off the board; they stay in the file" = "Take the results off the board; they stay in the file" +"Upload from computer" = "Upload from computer" "Use fonts installed on this computer…" = "Use fonts installed on this computer…" "Search layers" = "Search layers" "Search pages" = "Search pages" diff --git a/crates/ui-egui/src/app/files.rs b/crates/ui-egui/src/app/files.rs index 41f8cc85..3351329f 100644 --- a/crates/ui-egui/src/app/files.rs +++ b/crates/ui-egui/src/app/files.rs @@ -86,7 +86,7 @@ impl FigApp { /// Pick a file to open or import; `done` gets it as `file.open` and `file.import` take it (a /// path, or the name and contents where the platform has no paths). `pin`: as /// [`FigApp::pick_open`]'s file in front. - fn pick_file(&mut self, title: &str, exts: &[&str], pin: bool, done: impl FnOnce(&mut FigApp, Value) + 'static) { + pub(crate) fn pick_file(&mut self, title: &str, exts: &[&str], pin: bool, done: impl FnOnce(&mut FigApp, Value) + 'static) { self.start_pick( |services| -> PickFuture { match services.pick_open_contents(title, exts) { diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 55a1ef33..5ccfe5d4 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -223,7 +223,10 @@ pub fn show(app: &mut FigApp, ui: &mut Ui, worker: &mut Worker) { } else { tr("Drop to import") }; - crate::drop_overlay(&ctx, ctx.content_rect(), label); + match crate::colorpicker::image_drop_target(app, &ctx).filter(|_| !documents && app.ui.right_tab != crate::RightTab::Inspect) { + Some((rect, _)) => crate::drop_overlay(&ctx, rect, tr("Drop to use this image")), + None => crate::drop_overlay(&ctx, ctx.content_rect(), label), + } crate::guides::end_released(&ctx); crate::live::track_pointer(app, &ctx); app.sync_preedit(); diff --git a/crates/ui-egui/src/canvas/input.rs b/crates/ui-egui/src/canvas/input.rs index 72a0e17a..5aa05416 100644 --- a/crates/ui-egui/src/canvas/input.rs +++ b/crates/ui-egui/src/canvas/input.rs @@ -106,6 +106,8 @@ pub(crate) fn swap_wheel(wheel: egui::Vec2, zoom: f32, shift: bool, speed: f32) fn import_dropped(app: &mut FigApp, ctx: &egui::Context, hover_pos: Option) { let dropped = ctx.input(|i| i.raw.dropped_files.clone()); let mut refused = false; + // The first image goes to the colour picker that shows an image; the rest to the canvas. + let mut well = crate::colorpicker::image_drop_target(app, ctx).map(|(_, params)| params); for f in dropped { let path = f.path().to_path_buf(); if crate::is_document(&path) { @@ -118,17 +120,23 @@ fn import_dropped(app: &mut FigApp, ctx: &egui::Context, hover_pos: Option ("image.replace", params), + None => ("file.import", json!({"name": name, "x": pt.x, "y": pt.y})), + }; + let read = if path.exists() { + params["path"] = json!(path.to_string_lossy()); + params.as_object_mut().map(|o| o.remove("name")); + None } else { - (json!({"name": name, "x": pt.x, "y": pt.y}), Some(crate::dropped_bytes(&f, &name))) + Some(crate::dropped_bytes(&f, &name)) }; let Some(target) = app.session.ds().ok().map(|doc| crate::pending_open::ImportTarget { uid: doc.uid, page: doc.page, name: doc.doc.name.clone() }) else { continue; }; - app.ui.pending_opens.push(crate::pending_open::PendingOpen { label: name, params, command: "file.import", target: Some(target), read }); + app.ui.pending_opens.push(crate::pending_open::PendingOpen { label: name, params, command, target: Some(target), read }); } } diff --git a/crates/ui-egui/src/pending_open.rs b/crates/ui-egui/src/pending_open.rs index c6ade598..3e1f3d17 100644 --- a/crates/ui-egui/src/pending_open.rs +++ b/crates/ui-egui/src/pending_open.rs @@ -160,7 +160,7 @@ pub fn pending_opens(app: &mut FigApp, ctx: &egui::Context) { } app.ui.pending_open_frames = app.ui.pending_open_frames.saturating_add(1); let title = match app.ui.pending_opens.first().map(|p| p.command) { - Some("file.import") => { + Some("file.import" | "image.replace") => { let name = app .ui .pending_opens diff --git a/crates/ui-egui/src/widgets/colorpicker.rs b/crates/ui-egui/src/widgets/colorpicker.rs index 1f2b577d..5fbcc7b4 100644 --- a/crates/ui-egui/src/widgets/colorpicker.rs +++ b/crates/ui-egui/src/widgets/colorpicker.rs @@ -551,6 +551,116 @@ fn alpha_slider(ui: &mut Ui, rect: Rect, color: Color) -> Option<(f32, bool)> { slider_knob(ui, rect, color.a, Id::unique("cp_alpha")) } +/// The image files the picker offers. +const IMAGE_FILES: [&str; 7] = ["png", "jpg", "jpeg", "webp", "gif", "tif", "tiff"]; + +fn image_pending_id() -> Id { + Id::unique("cp_image_pending") +} + +/// Whether the Image tab of `target` shows its placeholder: chosen, with no file yet. +fn image_pending(ctx: &egui::Context, target: &PickerTarget) -> bool { + ctx.data(|d| d.get_temp::(image_pending_id())).is_some_and(|k| k == format!("{target:?}")) +} + +/// Show the Image tab's placeholder for `target`, or (`None`) for nothing. +fn set_image_pending(ctx: &egui::Context, target: Option<&PickerTarget>) { + ctx.data_mut(|d| { + d.remove::(image_pending_id()); + if let Some(t) = target { + d.insert_temp(image_pending_id(), format!("{t:?}")); + } + }); +} + +/// `image.replace`'s parameters for layers' paint `index`. +fn image_params(fills: bool, index: usize, ids: &[NodeId]) -> serde_json::Value { + json!({"ids": ids, "target": if fills { "fill" } else { "stroke" }, "index": index}) +} + +/// Where a file dragged over the window would become the open picker's image, and the parameters +/// that does it: the picker, while it shows layers' image paint or the Image tab's placeholder. A +/// platform doesn't say where a dragged file is until it can: an unknown position is the picker's. +pub(crate) fn image_drop_target(app: &FigApp, ctx: &egui::Context) -> Option<(Rect, serde_json::Value)> { + let target = app.ui.picker.as_ref()?; + let PickerTarget::Paint { fills, index, ids } = target else { return None }; + if !image_pending(ctx, target) && !matches!(current_paint(app, target)?.kind, PaintKind::Image(_)) { + return None; + } + let rect = ctx.memory(|m| m.area_rect(window_id()))?; + ctx.input(|i| i.pointer.hover_pos()).is_none_or(|p| rect.contains(p)).then(|| (rect, image_params(*fills, *index, ids))) +} + +/// The bytes of a picked `file`: its `path`, or its base64 `data` where there are no paths. +fn picked_bytes(file: &serde_json::Value) -> Option> { + use base64::Engine as _; + match file["path"].as_str() { + Some(path) => figcraft_engine::file_access::read_capped(path, figcraft_doc::ImageData::MAX_BYTES).ok(), + None => base64::engine::general_purpose::STANDARD.decode(file["data"].as_str()?).ok(), + } +} + +/// Ask for an image file for `target`: layers' paints keep their fill mode, crop and position. +fn upload_image(app: &mut FigApp, target: &PickerTarget) { + let target = target.clone(); + app.pick_file(tr("Choose image"), &IMAGE_FILES, true, move |app, file| { + if let PickerTarget::Paint { fills, index, ids } = &target { + let mut params = image_params(*fills, *index, ids); + for key in ["path", "data"] { + if let Some(v) = file.get(key) { + params[key] = v.clone(); + } + } + app.run("image.replace", params); + return; + } + let Some(bytes) = picked_bytes(&file) else { return }; + let Some(hash) = app.session.doc_mut().ok().and_then(|d| figcraft_format_add(d, bytes)) else { return }; + if let Some(mut paint) = current_paint(app, &target) { + paint.kind = Paint::image(hash, ImageScaleMode::Fill).kind; + write(app, &target, &paint, false); + } + }); +} + +/// The image `hash` as a texture at most `side` pixels across, kept while it stays the one shown. +fn image_texture(app: &FigApp, ctx: &egui::Context, hash: &str, side: f64) -> Option { + let id = Id::unique("cp_image_texture"); + if let Some((_, tex)) = ctx.data(|d| d.get_temp::<(String, egui::TextureHandle)>(id)).filter(|(h, _)| h == hash) { + return Some(tex); + } + let doc = app.session.doc().ok()?; + let pix = figcraft_render::images::shown(hash, doc.images.get(hash), &ImageFilters::default(), doc.color_profile, side)?; + let tex = ctx.load_texture("cp-image", crate::render_worker::screen_image(&pix, doc.color_profile), egui::TextureOptions::LINEAR); + ctx.data_mut(|d| d.insert_temp(id, (hash.to_string(), tex.clone()))); + Some(tex) +} + +/// The asset preview: the paint's image, or checkers until there is one, and the upload button. A +/// file dropped on it takes the image's place (`image_drop_target`). +fn image_well(app: &mut FigApp, ui: &mut Ui, target: &PickerTarget, paint: &Paint, t: &Tokens) { + let w = ui.available_width(); + let (r, _) = ui.allocate_exact_size(vec2(w, 120.0), Sense::hover()); + let frame = r.shrink2(vec2(16.0, 0.0)); + widgets::checker(&ui.painter().with_clip_rect(frame), frame, 8.0); + let ppp = f64::from(ui.ctx().pixels_per_point()); + if let PaintKind::Image(img) = &paint.kind + && let Some(tex) = image_texture(app, ui.ctx(), &img.image, f64::from(frame.width()) * ppp) + { + let [tw, th] = tex.size().map(|v| v.max(1) as f32); + let k = (frame.width() / tw).min(frame.height() / th); + let shown = Rect::from_center_size(frame.center(), vec2(tw * k, th * k)); + ui.painter().image(tex.id(), shown, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE); + } + ui.painter().rect_stroke(frame, CornerRadius::same(4), Stroke::new(1.0, t.border), StrokeKind::Inside); + ui.horizontal(|ui| { + ui.add_space(16.0); + if widgets::button(ui, tr("Upload from computer"), false, true).clicked() { + upload_image(app, target); + } + }); +} + /// The row of paint kinds (solid, gradients, image, pattern) with `paint`'s kind selected. fn paint_type_row(ui: &mut Ui, app: &mut FigApp, target: &PickerTarget, paint: &mut Paint) { let kinds = [ @@ -563,6 +673,7 @@ fn paint_type_row(ui: &mut Ui, app: &mut FigApp, target: &PickerTarget, paint: & (Icon::ViewGrid, tr("Pattern")), ]; let active = match &paint.kind { + _ if image_pending(ui.ctx(), target) => 5, PaintKind::Solid { .. } => 0, PaintKind::Gradient(g) => match g.kind { GradientKind::Linear => 1, @@ -577,22 +688,12 @@ fn paint_type_row(ui: &mut Ui, app: &mut FigApp, target: &PickerTarget, paint: & ui.add_space(12.0); if let Some(i) = widgets::segmented(ui, &kinds, Some(active), 30.0) { let base = paint.preview_color(); - let mut image_pending = false; + let choosing = i == 5; + set_image_pending(ui.ctx(), choosing.then_some(target).filter(|_| !matches!(paint.kind, PaintKind::Image(_)))); paint.kind = match i { 0 => PaintKind::Solid { color: base.with_alpha(1.0) }, - 5 => { - image_pending = true; - let target = target.clone(); - app.pick_open(tr("Choose image"), &["png", "jpg", "jpeg", "webp", "gif", "tif", "tiff"], move |app, p| { - let Ok(bytes) = figcraft_engine::file_access::read_capped(&p, figcraft_doc::ImageData::MAX_BYTES) else { return }; - let Some(hash) = app.session.doc_mut().ok().and_then(|d| figcraft_format_add(d, bytes)) else { return }; - if let Some(mut paint) = current_paint(app, &target) { - paint.kind = Paint::image(hash, ImageScaleMode::Fill).kind; - write(app, &target, &paint, false); - } - }); - paint.kind.clone() - } + // Nothing changes until there is a file: the tab shows the placeholder. + 5 => paint.kind.clone(), 6 => match pattern_sources(app, target).first() { Some((id, _)) => Paint::pattern(id.0).kind, None => { @@ -610,7 +711,7 @@ fn paint_type_row(ui: &mut Ui, app: &mut FigApp, target: &PickerTarget, paint: & } } }; - if !image_pending { + if !choosing { write(app, target, paint, false); } } @@ -901,14 +1002,23 @@ pub fn show(app: &mut FigApp, ctx: &egui::Context) { blend_row(ui, app, &target, &mut paint); } // Gradient stops. + let is_image = matches!(paint.kind, PaintKind::Image(_)); + if is_image { + set_image_pending(ui.ctx(), None); + } + // Until a file is chosen the Image tab shows its placeholder, not the paint it will replace. + let placeholder = image_pending(ui.ctx(), &target); let mut edit_color: Option = match &paint.kind { - PaintKind::Solid { color } => Some(color.with_alpha(color.a * paint.opacity)), + PaintKind::Solid { color } if !placeholder => Some(color.with_alpha(color.a * paint.opacity)), _ => None, }; let sel_stop_id = stop_id(); - if let PaintKind::Gradient(g) = paint.kind.clone() { + if let (PaintKind::Gradient(g), false) = (paint.kind.clone(), placeholder) { edit_color = gradient_controls(app, ui, &target, &mut paint, g, &t, sel_stop_id); } + if is_image || placeholder { + image_well(app, ui, &target, &paint, &t); + } if let PaintKind::Image(img) = paint.kind.clone() { image_controls(app, ui, &target, &mut paint, img, &t); } @@ -1019,6 +1129,7 @@ pub fn show(app: &mut FigApp, ctx: &egui::Context) { ui.add_space(12.0); }); if closed { + set_image_pending(ctx, None); close(app); } else if app.ui.picker.is_some() { // Kept only while the picker is open: a body that closed it (the eyedropper) doesn't leave @@ -1437,3 +1548,7 @@ mod tests { assert_eq!(u.app.session.recent_colors, vec![c]); } } + +#[cfg(test)] +#[path = "colorpicker_image_tests.rs"] +mod image_tests; diff --git a/crates/ui-egui/src/widgets/colorpicker_image_tests.rs b/crates/ui-egui/src/widgets/colorpicker_image_tests.rs new file mode 100644 index 00000000..539a69fc --- /dev/null +++ b/crates/ui-egui/src/widgets/colorpicker_image_tests.rs @@ -0,0 +1,286 @@ +//! The colour picker's image well (#1682), as the help center describes it: choosing Image shows a +//! checkered placeholder and Upload from computer rather than a file dialog at once, and a file +//! dropped on the picker replaces the image, keeping the fill mode, crop and position. + +use std::path::{Path, PathBuf}; +use std::sync::Arc; +use std::sync::atomic::{AtomicUsize, Ordering}; + +use base64::Engine as _; +use egui::{Event, Pos2, RawInput}; +use figcraft_color::{ImageScaleMode, PaintKind}; +use figcraft_doc::NodeId; +use figcraft_engine::Session; +use serde_json::json; + +use super::{PickerTarget, set_image_pending, window_id}; +use crate::layers_drag_tests::Ui; +use crate::live_tests::{flat, has_text, text_center}; +use crate::services::{ContentsFuture, DialogFuture}; + +fn png(r: u8) -> Vec { + let image = image::RgbaImage::from_pixel(8, 4, image::Rgba([r, 0, 0, 255])); + let mut bytes = std::io::Cursor::new(Vec::new()); + image.write_to(&mut bytes, image::ImageFormat::Png).unwrap(); + bytes.into_inner() +} + +/// A dropped file whose contents arrive from memory, as in the browser (no file at its path). +#[derive(Debug)] +struct Dropped(std::path::PathBuf, Vec); + +impl egui::DroppedFile for Dropped { + fn path(&self) -> &Path { + &self.0 + } + + fn bytes(&self) -> Result, String> { + Ok(self.1.clone()) + } +} + +/// A rectangle with an image fill in Fit mode, or a solid one. +fn layer(with_image: bool) -> (Ui, NodeId) { + let mut s = Session::new(); + let r = s.execute("shape.rectangle", &json!({"x": 100, "y": 100, "width": 80, "height": 80, "props": {"fill": "#00ff00"}})).unwrap(); + let id = crate::present_tests::id(&r); + if with_image { + let data = base64::engine::general_purpose::STANDARD.encode(png(1)); + s.execute("image.place", &json!({"data": data, "target": id, "mode": "fit"})).unwrap(); + } + (Ui::new(s), id) +} + +fn open_picker(u: &mut Ui, id: NodeId, index: usize) -> PickerTarget { + let target = PickerTarget::Paint { fills: true, index, ids: vec![id] }; + u.app.ui.picker = Some(target.clone()); + for _ in 0..4 { + u.frame(vec![]); + } + target +} + +/// Drop a PNG with the pointer at `at` (`None`: the platform doesn't say), and let it go through. +fn drop_png(u: &mut Ui, at: Option, bytes: Vec) { + let events: Vec = at.map_or(vec![Event::PointerGone], |p| vec![Event::PointerMoved(p)]); + u.frame_raw(RawInput { events: events.clone(), ..Default::default() }); + let file = Arc::new(Dropped(Path::new("figcraft-picker-drop").join("new.png"), bytes)) as egui::DroppedFileHandle; + u.frame_raw(RawInput { events, dropped_files: vec![file], ..Default::default() }); + for _ in 0..6 { + u.frame(vec![]); + } +} + +fn top_image(u: &Ui, id: NodeId, index: usize) -> figcraft_color::ImagePaint { + let paint = u.app.session.doc().unwrap().node(id).unwrap().fills[index].clone(); + let PaintKind::Image(img) = paint.kind else { panic!("not an image: {paint:?}") }; + img +} + +fn layers(u: &Ui) -> usize { + u.app.session.doc().unwrap().node(u.app.session.page().unwrap()).unwrap().children.len() +} + +#[test] +fn a_file_dropped_on_the_picker_replaces_the_image_and_keeps_its_settings() { + let (mut u, id) = layer(true); + let target = open_picker(&mut u, id, 1); + let before = top_image(&u, id, 1); + assert_eq!(before.scale_mode, ImageScaleMode::Fit); + assert!(has_text(&flat(&u.frame_output(vec![]).shapes), "Upload from computer")); + // Where the file is isn't known during the drag: the picker says it takes it. + let hovered = vec![egui::HoveredFile { path: Some("new.png".into()), mime: String::new() }]; + let out = u.frame_raw(RawInput { events: vec![Event::PointerGone], hovered_files: hovered, ..Default::default() }); + assert!(has_text(&flat(&out.shapes), "Drop to use this image")); + assert!(!has_text(&flat(&out.shapes), "Drop to import")); + + let count = layers(&u); + drop_png(&mut u, None, png(2)); + let after = top_image(&u, id, 1); + assert_ne!(after.image, before.image, "a new image"); + assert_eq!(after.scale_mode, ImageScaleMode::Fit, "the fill mode stays"); + assert_eq!(layers(&u), count, "no new layer"); + assert_eq!(u.app.ui.picker, Some(target), "the picker stays open"); + u.app.session.undo().unwrap(); + assert_eq!(top_image(&u, id, 1).image, before.image, "one undo step"); +} + +#[test] +fn choosing_image_shows_the_placeholder_until_a_file_arrives() { + let (mut u, id) = layer(false); + let target = open_picker(&mut u, id, 0); + assert!(!has_text(&flat(&u.frame_output(vec![]).shapes), "Upload from computer"), "a solid paint has no well"); + let fills = |u: &Ui| u.app.session.doc().unwrap().node(id).unwrap().fills.clone(); + let before = fills(&u); + // The Image tab, as its click does: nothing changes yet, and no dialog opens. + set_image_pending(&u.ctx, Some(&target)); + assert!(has_text(&flat(&u.frame_output(vec![]).shapes), "Upload from computer")); + assert_eq!(fills(&u), before); + // A drop fills the placeholder: an image filling the layer, and the placeholder is done. + drop_png(&mut u, None, png(3)); + assert_eq!(top_image(&u, id, 0).scale_mode, ImageScaleMode::Fill); + u.frame(vec![]); + assert!(!super::image_pending(&u.ctx, &target)); +} + +#[test] +fn a_drop_goes_to_the_canvas_when_the_picker_shows_no_image_or_the_pointer_is_elsewhere() { + // A solid paint's picker takes nothing. + let (mut u, id) = layer(false); + open_picker(&mut u, id, 0); + let count = layers(&u); + drop_png(&mut u, None, png(4)); + assert_eq!(layers(&u), count + 1, "imported to the canvas"); + // Over the canvas, with the picker elsewhere: the canvas too. + let (mut u, id) = layer(true); + open_picker(&mut u, id, 1); + let before = top_image(&u, id, 1).image; + let count = layers(&u); + let picker = u.ctx.memory(|m| m.area_rect(window_id())).unwrap(); + let canvas = u.app.canvas.rect; + let at = Pos2::new(canvas.min.x + 20.0, canvas.min.y + 20.0); + assert!(!picker.contains(at)); + drop_png(&mut u, Some(at), png(5)); + assert_eq!(layers(&u), count + 1); + assert_eq!(top_image(&u, id, 1).image, before); +} + +/// What the platform's picker does with Upload from computer, counting the times it is asked. +struct Picker { + asked: Arc, + /// The browser: a name and contents; the desktop: a path. `None`: cancelled. + file: Option<(PathBuf, Vec)>, + browser: bool, +} + +impl crate::Services for Picker { + fn pick_open(&mut self, _title: &str, exts: &[&str]) -> DialogFuture { + assert!(!self.browser, "a platform that picks contents is never asked for a path"); + assert!(exts.contains(&"png"), "{exts:?}"); + self.asked.fetch_add(1, Ordering::SeqCst); + let path = self.file.as_ref().map(|f| f.0.clone()); + Box::pin(std::future::ready(path)) + } + + fn pick_open_contents(&mut self, _title: &str, exts: &[&str]) -> Option { + if !self.browser { + return None; + } + assert!(exts.contains(&"png"), "{exts:?}"); + self.asked.fetch_add(1, Ordering::SeqCst); + let file = self.file.as_ref().map(|(p, bytes)| Ok((p.to_string_lossy().into_owned(), bytes.clone()))); + Some(Box::pin(std::future::ready(file))) + } +} + +/// Put the picker in `u` that answers with `bytes` (`None`: cancelled), as the desktop or the +/// browser does; returns how many times it has been asked. +fn fake_picker(u: &mut Ui, bytes: Option>, browser: bool, dir: &Path) -> Arc { + let asked = Arc::new(AtomicUsize::new(0)); + let file = bytes.map(|b| { + let path = dir.join("picked.png"); + std::fs::write(&path, &b).unwrap(); + (path, b) + }); + u.app.services = Box::new(Picker { asked: asked.clone(), file, browser }); + asked +} + +fn press(u: &mut Ui, at: Pos2) { + u.frame(vec![Event::PointerMoved(at)]); + u.frame(vec![Event::PointerMoved(at)]); + for pressed in [true, false] { + u.frame(vec![Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::NONE }]); + } + for _ in 0..4 { + u.frame(vec![]); + } +} + +/// Click the picker's Image tab: the sixth of its 30 wide cells, under the title. +fn click_image_tab(u: &mut Ui) { + let picker = u.ctx.memory(|m| m.area_rect(window_id())).unwrap(); + press(u, picker.min + egui::vec2(177.0, 52.0)); +} + +fn click_upload(u: &mut Ui) { + let at = text_center(&flat(&u.frame_output(vec![]).shapes), "Upload from computer"); + press(u, at); +} + +fn temp_dir(name: &str) -> PathBuf { + let dir = std::env::temp_dir().join(format!("figcraft-upload-{}-{name}", std::process::id())); + std::fs::create_dir_all(&dir).unwrap(); + dir +} + +/// The Image tab opens nothing; its button asks the platform, and the file becomes the paint. +#[test] +fn upload_from_computer_fills_the_placeholder_on_the_desktop_and_in_the_browser() { + for browser in [false, true] { + let dir = temp_dir(&format!("placeholder-{browser}")); + let (mut u, id) = layer(false); + open_picker(&mut u, id, 0); + let asked = fake_picker(&mut u, Some(png(6)), browser, &dir); + click_image_tab(&mut u); + assert_eq!(asked.load(Ordering::SeqCst), 0, "the tab opens no dialog"); + click_upload(&mut u); + assert_eq!(asked.load(Ordering::SeqCst), 1, "the button asks the platform once"); + assert_eq!(top_image(&u, id, 0).scale_mode, ImageScaleMode::Fill, "browser: {browser}"); + assert!(u.app.ui.last_error.is_none(), "{:?}", u.app.ui.last_error); + let _ = std::fs::remove_dir_all(&dir); + } +} + +/// Upload on an existing image replaces it and keeps its fill mode and crop, one undo step. +#[test] +fn upload_from_computer_replaces_an_image_keeping_its_fill_mode_and_crop() { + for browser in [false, true] { + let dir = temp_dir(&format!("replace-{browser}")); + let (mut u, id) = layer(true); + u.app.session.execute("image.crop", &json!({"ids": [id], "index": 1})).unwrap(); + let target = PickerTarget::Paint { fills: true, index: 1, ids: vec![id] }; + u.app.ui.picker = Some(target); + for _ in 0..4 { + u.frame(vec![]); + } + let before = top_image(&u, id, 1); + assert_eq!(before.scale_mode, ImageScaleMode::Crop); + let (asked, steps) = (fake_picker(&mut u, Some(png(7)), browser, &dir), u.app.session.undo_depth().0); + click_upload(&mut u); + assert_eq!(asked.load(Ordering::SeqCst), 1); + let after = top_image(&u, id, 1); + assert_ne!(after.image, before.image, "browser: {browser}"); + assert_eq!((after.scale_mode, after.crop), (ImageScaleMode::Crop, before.crop)); + assert_eq!(u.app.session.undo_depth().0, steps + 1, "one undo step"); + let _ = std::fs::remove_dir_all(&dir); + } +} + +/// Cancelling the picker changes nothing: no paint, no undo step, and the placeholder stays. +#[test] +fn cancelling_the_upload_changes_nothing() { + let dir = temp_dir("cancel"); + for browser in [false, true] { + let (mut u, id) = layer(false); + open_picker(&mut u, id, 0); + let asked = fake_picker(&mut u, None, browser, &dir); + let fills = |u: &Ui| u.app.session.doc().unwrap().node(id).unwrap().fills.clone(); + let (before, steps) = (fills(&u), u.app.session.undo_depth()); + click_image_tab(&mut u); + click_upload(&mut u); + assert_eq!(asked.load(Ordering::SeqCst), 1); + assert_eq!(fills(&u), before, "browser: {browser}"); + assert_eq!(u.app.session.undo_depth(), steps); + assert!(has_text(&flat(&u.frame_output(vec![]).shapes), "Upload from computer"), "the placeholder stays"); + + let (mut u, id) = layer(true); + open_picker(&mut u, id, 1); + fake_picker(&mut u, None, browser, &dir); + let (before, steps) = (top_image(&u, id, 1), u.app.session.undo_depth()); + click_upload(&mut u); + assert_eq!(top_image(&u, id, 1), before); + assert_eq!(u.app.session.undo_depth(), steps); + } + let _ = std::fs::remove_dir_all(&dir); +} diff --git a/docs/mcp.md b/docs/mcp.md index d1b16ec8..e190e2f8 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -263,6 +263,9 @@ Or in a project's `.mcp.json`: tint, highlights, shadows; each -1..1). `image.adjust {ids?, target?: fill|stroke, index?, preset?, filters?}` applies a built-in preset (`vivid`, `muted`, `warm`, `cool`, `blackAndWhite`, `fade`, `reset`) or one saved in the file, with any `filters` values on top. + `image.replace {ids?, target?: fill|stroke, index?, data | path}` puts another image in a paint + (by default each layer's top image paint), keeping its fill mode, crop, position and adjustments; + a paint at `index` that isn't an image becomes one, filling the layer. `image.savePreset {name, filters?}` saves the current (or given) adjustments in the file, `image.deletePreset {name}` removes one and `image.presets` lists both kinds. `image.crop {ids?, index?}` (one layer) switches its top visible image fill (or fill `index`) to diff --git a/docs/roadmap.md b/docs/roadmap.md index f5943a4d..219e3615 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # FigCraft roadmap: milestones and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-30 · **Change:** minor (the Frame tool's Phone presets have the iPhone 17 family (#1691); Show in folder works in the Flatpak build and selects the file on Linux (#1701); a dashed line starts and ends with a half-length dash, on the canvas and in exports; the Pages, Layers and Assets search fields keep their text in the middle of the field (#1703); a board connector's path can be reshaped by dragging its path handles (#1710); boards have 16 more shapes (arrows, polygons, star, plus and flowchart symbols), in pickers that lay them out in a grid; library analytics count insertions and show insertions and detachments over the past 30 days, 90 days or year; a stroke's Custom style takes a dash pattern of any length as a comma-separated list (#1681); a control request can set its own timeout, up to 10 minutes (`timeoutMs`; `figcraft-cli mcp --attach PORT --timeout SECONDS`) (#1696); gap 6: a widget opens its plugin's panel (plugin API 5), whose callbacks redraw it; the keyboard's Menu key opens the context menu, as Shift+F10 does; an Open link action can open in place of the prototype, with "Open in new tab" off (gap 15); a collection of this file can be extended (Extend collection on its row, `variable.extendCollection`), its extension following its edits at once, and extended collections extend again in the file; the eyedropper with Cmd/Ctrl+Shift makes a colour style or variable of what it picks; a live session's welcome sends the document compressed to clients that read it, about seven times smaller (#1665); a control request that times out says truthfully whether it was dropped or is still running and will take effect, and only screenshots and input blame the window (#1673); a board keeps earlier votes' results, listed newest first in Results and deleted one at a time; a server can list the files shared from it now for everyone who reaches it, Home ▸ Online shows them and their links carry no secret (`team_files`, part of #742); a selected connector's bar on a board sets its start and end points, solid or dashed, its weight and any colour (#1596); cells copied from a spreadsheet paste onto a board as a table; a long layer name stays on one line in the Export button and the Dev Mode header, ending with an ellipsis, and no longer covers the Design panel (#1650); with hundreds of layers selected, the Design panel and the selection overlays stop going over the whole selection on every frame, so dragging 648 layers averages about 1.1 ms of UI per frame (#1571); plugin panels show pictures: an `image` control, base64 within 256 KB and 4,096 px a side, named by its label (gap 6); a drag moving many layers re-runs only what sits around them, not each layer's bindings, sizing, text and instance checks, on every move (#1571); damaged font tracking table offsets are checked instead of wrapping on 32-bit targets, and font indexing makes its existing offset bounds explicit (#1125); pasted layers whose image the clipboard lacks are named and show a placeholder that reads as missing (#1646); paint-style colours on layers pasted from another design app keep their style instead of turning black (#1638); Shift+Cmd/Ctrl+Enter on a selected board shape adds the next shape already joined to it, and goes on typing (#1597); a name typed for a variable or collection finds the one with that exact id before one named like it, and stored mode ids, font family variables and the panels' labels read exact ids (#1613); plugin widgets have hover styles: a layer's `hover` fill, stroke, opacity or text colour shows while the pointer is over it (gap 6); every file a command reads whole by path is a regular file within a cap that fits it: documents 16 GiB, placed images 256 MiB, CLI scripts 1 GiB; compact layer trees with fields and outline (M0.9, part of #996); while a drag only moves a large selection, its outlines, box, slots, spacing and Design panel values are worked out once and shifted, not rebuilt on every move (#1571); an imported or pasted file finds an installed family under the other names its fonts give it, and with other case and spacing, instead of reporting it missing (#1292); a panic in a grouped closure outside any command rolls the group back like a failed group: documents, selection, undo and redo, history limit and journal as before (#1085); a development example generates figcraft-cli's shell completions and man pages from its clap definitions (part of #1396); `.fig` ZIP image reads share a total byte budget and count skipped images in the import warnings (#1076); stored variable and collection references keep their identity when another object is named like their id (follow-up to #1542); a component set's property rows fit the 240 px right panel: variant values wrap two to a line there and every + and − stays in view; the server key is checked by comparing SHA-256 hashes of the presented and the kept key, as the deployment guide says (#1130); opening a file contacts no team library server it names until you check it (#1097); a hostile server can no longer grow a client's memory with made-up people, and a session remembers a bounded number of deleted layer ids (#1121); `doc.list` gives AI agents and plugins the open files' names, not their paths (#1117); with a large selection, frames where nothing changed reuse the selection's outlines, box and slots and the Design panel's instance and position values instead of working them out again (#1571); team libraries and plugins larger than the 16 MiB download burst can be downloaded again, more slowly (#1089); a batch keeps one undo snapshot, not one per step (#1099); files nested 256 levels deep import on the browser's 1 MB stack (#1101); SVG and PDF exports count pattern sources and the renders they embed from the layer's depth, so one cap bounds a whole export (#1082); an explicit variables file path (`variable.import`, the `variables` of `file.open` and `file.import`) is refused past 256 MiB or when it isn't a regular file, as the sibling `variables.json` already was (part of #1114); joining and leaving a file nobody is editing reads and writes nothing on the server: it stays loaded a minute after everyone leaves (#1074); opening a `.figcraft` file unpacks at most 6 GiB in all (2 GiB in the browser), every area together (#1079); hovering the canvas hit-tests once per pointer move, not on every frame, and moving an auto layout frame no longer lays out its contents again on every move (#1571); `.fig` instance expansion no longer walks variable nodes for every instance or copies every outer override row into each nested instance (#1077); `comment.people` lists names that were only @mentioned, and `comment.next` and `comment.prompt` carry the mentions too (#1415); grid auto-placement looks for free cells a 64-bit word at a time and skips what blocks it, with the same placements (#1083); with the pen out, Enter or a double-click ends the path and edits the vector with the Move tool instead of drawing on (#1430); a recovery copy made while a version is previewed holds the file, not the version shown; a FigJam `.jam` file opens as a board (#1342); the Actions palette offers only commands that run from it, and no second row reading like a menu item: Place image opens the file dialog (#1574); share links can comment: a third access level beside edit and view, whose holder sees the file live and adds, replies to, reacts to and resolves comments but can't change the design; Preferences ▸ Scroll wheel zoom: a mouse wheel zooms the canvas about the pointer and Cmd/Ctrl+wheel scrolls (#1390); `comment.list {mentions}` lists only the threads that @mention a name (#1415); in the browser an internal error that stops the page keeps its unsaved files, which open again on reload (#1123); boolean operations refuse input past their caps, and a boolean group past them draws without its result (#1104); figcraft-cli parses its arguments with clap, following RFC-0012 (#1396); the selection and hover outlines of rounded rectangles and frames follow their corners (#1506); component properties keep the order they were made in when one is renamed, and Make slot asks for the slot's name first (#1536, #1537); the browser build publishes files to a server, so Share ▸ Online and Publish to server work there (#917); the browser build uses the fonts installed on the computer once asked, each read when text uses it (#1051); SVG import reads `color()` and `color-mix()` colours, with a note and a grey for those it can't (#1550); the portable Windows zip keeps its settings, recovery copies and plugins in `config\` beside the executable, starting with an installed copy's preferences; the window starts on other graphics when its first ones fail before the first frame: Direct3D 12 compiles with FXC and no device compiles wgpu's indirect-validation shaders, then Vulkan, OpenGL and lower requirements on the power-saving GPU (#965, #1438); Thai, Lao, Khmer and Burmese lines break between words (#1219); an AI agent attached over MCP shows where it works (#1416); a manual overlay's position can be dragged on the canvas (#405); one name for live sessions and comments: Preferences ▸ Your name, in the Join dialog too, kept in the browser, and a rename shows at once in the sessions you are in (#1380); requests that change a server's files have a budget per address, the server key's too, and join codes are found by their hash (#1075); the Join dialog shows a join from the click until its file is ready, with Cancel, and a failed join with Try again (#1381); SVG import draws each pattern tile once per scale, within the layer budget (#1080); Vietnamese letters typed with combining marks (decomposed) take one font that has every mark, instead of missing-glyph boxes beside the letter (#1478); comment.list reports each message's @mentions (#1415); M8: mask groups draw only over the area they can paint, and nested isolated layers share one memory budget (#1061); M2: components can't contain their own instances, directly or through others; `edit.duplicate` returns an id map with `map: true` (#995); the batches kept for reconnecting apps are bounded in bytes by default, and `figcraft-server` takes `max_log_mb` (#1069); MCP and control calls name their document (#998); sibling placement in live sessions searches instead of counting (#1065); an AI agent attached over MCP comments under its own name, with an Agent label (#1414); the instance-swap menus have a search field (#1338); a refused batch's fixes take time linear in the batch (#1063); the connector tool shows the connector it will make while dragging, ends snapping to attach points (#1387); large images on the canvas draw from a smaller copy, so two 16k images no longer lag (#1483); a file's JPEG thumbnail can't crash the home screen (#1491's progressive JPEG check, now shared); `.fig` import: library text styles linked by asset key, and override rows restating a nested level (#1234); `.fig` import keeps the file's saved line breaks while the text and its box are unedited (#1236); Download a missing free font from the Missing fonts window (`font.download`, #754); the web build's wasm back under its 24 MiB gate (#1472); shadows of images with transparent pixels follow their alpha (#1289); Crop image: Object ▸ Crop image, the right-click menu and the image fill row enter crop mode (`image.crop`, #1464); M0.9: optional batch continue-on-error with per-step outcomes (#1386); Alt pressed during a drag duplicates (#1385); variables in paint props (M3, #1000); finding layers without selecting them (M0.9, part of #996); the attached MCP server reads the app's replies with a 512 MiB bound (#1113); a failed batch keeps the undo steps it undid (#1410); Arabic draft catalog; Android Vector Drawable export; a selected unfilled shape drags over a filled layer below it (#1370); text truncation fills the last line, survives resizing, and auto height takes Max lines (#1375, #1376, #1377); M11 widget fields and property menus; M12 Boards: timer and voting; Installed weights of an embedded font family (#1246); `.sketch` import, best effort; Adobe Fonts found on macOS (#298); M12 Boards; community fixes in #507, #510, #529 and #530: auto-save, a text box by dragging, batch step references, removing someone from a live session, Russian and Turkish catalogs reviewed, Czech and Indonesian drafts, the Japanese draft completed, zoom previews, the web clipboard, Alt-drag snapping and Cmd+D repeat, recovery copies, crash and rollback fixes, colour emoji, `.fig` import fixes; earlier changes are in the revision history below) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-30 · **Change:** minor (the colour picker's Image tab shows a placeholder and Upload from computer, an asset preview, and a file dropped on it replaces the image, keeping the fill mode, crop and position (#1682); the Frame tool's Phone presets have the iPhone 17 family (#1691); Show in folder works in the Flatpak build and selects the file on Linux (#1701); a dashed line starts and ends with a half-length dash, on the canvas and in exports; the Pages, Layers and Assets search fields keep their text in the middle of the field (#1703); a board connector's path can be reshaped by dragging its path handles (#1710); boards have 16 more shapes (arrows, polygons, star, plus and flowchart symbols), in pickers that lay them out in a grid; library analytics count insertions and show insertions and detachments over the past 30 days, 90 days or year; a stroke's Custom style takes a dash pattern of any length as a comma-separated list (#1681); a control request can set its own timeout, up to 10 minutes (`timeoutMs`; `figcraft-cli mcp --attach PORT --timeout SECONDS`) (#1696); gap 6: a widget opens its plugin's panel (plugin API 5), whose callbacks redraw it; the keyboard's Menu key opens the context menu, as Shift+F10 does; an Open link action can open in place of the prototype, with "Open in new tab" off (gap 15); a collection of this file can be extended (Extend collection on its row, `variable.extendCollection`), its extension following its edits at once, and extended collections extend again in the file; the eyedropper with Cmd/Ctrl+Shift makes a colour style or variable of what it picks; a live session's welcome sends the document compressed to clients that read it, about seven times smaller (#1665); a control request that times out says truthfully whether it was dropped or is still running and will take effect, and only screenshots and input blame the window (#1673); a board keeps earlier votes' results, listed newest first in Results and deleted one at a time; a server can list the files shared from it now for everyone who reaches it, Home ▸ Online shows them and their links carry no secret (`team_files`, part of #742); a selected connector's bar on a board sets its start and end points, solid or dashed, its weight and any colour (#1596); cells copied from a spreadsheet paste onto a board as a table; a long layer name stays on one line in the Export button and the Dev Mode header, ending with an ellipsis, and no longer covers the Design panel (#1650); with hundreds of layers selected, the Design panel and the selection overlays stop going over the whole selection on every frame, so dragging 648 layers averages about 1.1 ms of UI per frame (#1571); plugin panels show pictures: an `image` control, base64 within 256 KB and 4,096 px a side, named by its label (gap 6); a drag moving many layers re-runs only what sits around them, not each layer's bindings, sizing, text and instance checks, on every move (#1571); damaged font tracking table offsets are checked instead of wrapping on 32-bit targets, and font indexing makes its existing offset bounds explicit (#1125); pasted layers whose image the clipboard lacks are named and show a placeholder that reads as missing (#1646); paint-style colours on layers pasted from another design app keep their style instead of turning black (#1638); Shift+Cmd/Ctrl+Enter on a selected board shape adds the next shape already joined to it, and goes on typing (#1597); a name typed for a variable or collection finds the one with that exact id before one named like it, and stored mode ids, font family variables and the panels' labels read exact ids (#1613); plugin widgets have hover styles: a layer's `hover` fill, stroke, opacity or text colour shows while the pointer is over it (gap 6); every file a command reads whole by path is a regular file within a cap that fits it: documents 16 GiB, placed images 256 MiB, CLI scripts 1 GiB; compact layer trees with fields and outline (M0.9, part of #996); while a drag only moves a large selection, its outlines, box, slots, spacing and Design panel values are worked out once and shifted, not rebuilt on every move (#1571); an imported or pasted file finds an installed family under the other names its fonts give it, and with other case and spacing, instead of reporting it missing (#1292); a panic in a grouped closure outside any command rolls the group back like a failed group: documents, selection, undo and redo, history limit and journal as before (#1085); a development example generates figcraft-cli's shell completions and man pages from its clap definitions (part of #1396); `.fig` ZIP image reads share a total byte budget and count skipped images in the import warnings (#1076); stored variable and collection references keep their identity when another object is named like their id (follow-up to #1542); a component set's property rows fit the 240 px right panel: variant values wrap two to a line there and every + and − stays in view; the server key is checked by comparing SHA-256 hashes of the presented and the kept key, as the deployment guide says (#1130); opening a file contacts no team library server it names until you check it (#1097); a hostile server can no longer grow a client's memory with made-up people, and a session remembers a bounded number of deleted layer ids (#1121); `doc.list` gives AI agents and plugins the open files' names, not their paths (#1117); with a large selection, frames where nothing changed reuse the selection's outlines, box and slots and the Design panel's instance and position values instead of working them out again (#1571); team libraries and plugins larger than the 16 MiB download burst can be downloaded again, more slowly (#1089); a batch keeps one undo snapshot, not one per step (#1099); files nested 256 levels deep import on the browser's 1 MB stack (#1101); SVG and PDF exports count pattern sources and the renders they embed from the layer's depth, so one cap bounds a whole export (#1082); an explicit variables file path (`variable.import`, the `variables` of `file.open` and `file.import`) is refused past 256 MiB or when it isn't a regular file, as the sibling `variables.json` already was (part of #1114); joining and leaving a file nobody is editing reads and writes nothing on the server: it stays loaded a minute after everyone leaves (#1074); opening a `.figcraft` file unpacks at most 6 GiB in all (2 GiB in the browser), every area together (#1079); hovering the canvas hit-tests once per pointer move, not on every frame, and moving an auto layout frame no longer lays out its contents again on every move (#1571); `.fig` instance expansion no longer walks variable nodes for every instance or copies every outer override row into each nested instance (#1077); `comment.people` lists names that were only @mentioned, and `comment.next` and `comment.prompt` carry the mentions too (#1415); grid auto-placement looks for free cells a 64-bit word at a time and skips what blocks it, with the same placements (#1083); with the pen out, Enter or a double-click ends the path and edits the vector with the Move tool instead of drawing on (#1430); a recovery copy made while a version is previewed holds the file, not the version shown; a FigJam `.jam` file opens as a board (#1342); the Actions palette offers only commands that run from it, and no second row reading like a menu item: Place image opens the file dialog (#1574); share links can comment: a third access level beside edit and view, whose holder sees the file live and adds, replies to, reacts to and resolves comments but can't change the design; Preferences ▸ Scroll wheel zoom: a mouse wheel zooms the canvas about the pointer and Cmd/Ctrl+wheel scrolls (#1390); `comment.list {mentions}` lists only the threads that @mention a name (#1415); in the browser an internal error that stops the page keeps its unsaved files, which open again on reload (#1123); boolean operations refuse input past their caps, and a boolean group past them draws without its result (#1104); figcraft-cli parses its arguments with clap, following RFC-0012 (#1396); the selection and hover outlines of rounded rectangles and frames follow their corners (#1506); component properties keep the order they were made in when one is renamed, and Make slot asks for the slot's name first (#1536, #1537); the browser build publishes files to a server, so Share ▸ Online and Publish to server work there (#917); the browser build uses the fonts installed on the computer once asked, each read when text uses it (#1051); SVG import reads `color()` and `color-mix()` colours, with a note and a grey for those it can't (#1550); the portable Windows zip keeps its settings, recovery copies and plugins in `config\` beside the executable, starting with an installed copy's preferences; the window starts on other graphics when its first ones fail before the first frame: Direct3D 12 compiles with FXC and no device compiles wgpu's indirect-validation shaders, then Vulkan, OpenGL and lower requirements on the power-saving GPU (#965, #1438); Thai, Lao, Khmer and Burmese lines break between words (#1219); an AI agent attached over MCP shows where it works (#1416); a manual overlay's position can be dragged on the canvas (#405); one name for live sessions and comments: Preferences ▸ Your name, in the Join dialog too, kept in the browser, and a rename shows at once in the sessions you are in (#1380); requests that change a server's files have a budget per address, the server key's too, and join codes are found by their hash (#1075); the Join dialog shows a join from the click until its file is ready, with Cancel, and a failed join with Try again (#1381); SVG import draws each pattern tile once per scale, within the layer budget (#1080); Vietnamese letters typed with combining marks (decomposed) take one font that has every mark, instead of missing-glyph boxes beside the letter (#1478); comment.list reports each message's @mentions (#1415); M8: mask groups draw only over the area they can paint, and nested isolated layers share one memory budget (#1061); M2: components can't contain their own instances, directly or through others; `edit.duplicate` returns an id map with `map: true` (#995); the batches kept for reconnecting apps are bounded in bytes by default, and `figcraft-server` takes `max_log_mb` (#1069); MCP and control calls name their document (#998); sibling placement in live sessions searches instead of counting (#1065); an AI agent attached over MCP comments under its own name, with an Agent label (#1414); the instance-swap menus have a search field (#1338); a refused batch's fixes take time linear in the batch (#1063); the connector tool shows the connector it will make while dragging, ends snapping to attach points (#1387); large images on the canvas draw from a smaller copy, so two 16k images no longer lag (#1483); a file's JPEG thumbnail can't crash the home screen (#1491's progressive JPEG check, now shared); `.fig` import: library text styles linked by asset key, and override rows restating a nested level (#1234); `.fig` import keeps the file's saved line breaks while the text and its box are unedited (#1236); Download a missing free font from the Missing fonts window (`font.download`, #754); the web build's wasm back under its 24 MiB gate (#1472); shadows of images with transparent pixels follow their alpha (#1289); Crop image: Object ▸ Crop image, the right-click menu and the image fill row enter crop mode (`image.crop`, #1464); M0.9: optional batch continue-on-error with per-step outcomes (#1386); Alt pressed during a drag duplicates (#1385); variables in paint props (M3, #1000); finding layers without selecting them (M0.9, part of #996); the attached MCP server reads the app's replies with a 512 MiB bound (#1113); a failed batch keeps the undo steps it undid (#1410); Arabic draft catalog; Android Vector Drawable export; a selected unfilled shape drags over a filled layer below it (#1370); text truncation fills the last line, survives resizing, and auto height takes Max lines (#1375, #1376, #1377); M11 widget fields and property menus; M12 Boards: timer and voting; Installed weights of an embedded font family (#1246); `.sketch` import, best effort; Adobe Fonts found on macOS (#298); M12 Boards; community fixes in #507, #510, #529 and #530: auto-save, a text box by dragging, batch step references, removing someone from a live session, Russian and Turkish catalogs reviewed, Czech and Indonesian drafts, the Japanese draft completed, zoom previews, the web clipboard, Alt-drag snapping and Cmd+D repeat, recovery copies, crash and rollback fixes, colour emoji, `.fig` import fixes; earlier changes are in the revision history below) · **Target:** Figma Design (desktop app 126.10.7) Forward-looking plan. Where FigCraft stands today: [`ROADMAP.md`](../ROADMAP.md) and [`target-app-parity.md`](target-app-parity.md); the full ranked list: [`gaps.md`](gaps.md). Hours @@ -75,6 +75,7 @@ blockers. | Date | Change | Summary | |---|---|---| +| 2026-10-31 | minor | M1, #1682: as the help center describes the colour picker, choosing Image no longer opens a file dialog at once: the tab shows a checkered placeholder and Upload from computer until there is a file. An image paint shows its asset preview with the same button. A file dropped on the open picker replaces the image and keeps the fill mode, crop, position and adjustments; on the placeholder it becomes the paint's image, filling the layer. While a file is dragged the picker says it takes it instead of the window saying Drop to import. New command `image.replace {ids?, target?, index?, data | path}`, through the same size cap and decoder as `image.place`; one undo step. Dropped files in the browser arrive as `data`. A native window or a browser doesn't say where a dragged file is, so a drop with no known position goes to the open picker, and one known to be over the canvas imports as before. Left: the Fill and Stroke swatches in the Design panel don't take a drop, since their place can't be told during a drag; pasting into the picker isn't documented and isn't added. Tests: `colorpicker_image_tests`, `image_crop_tests::replacing_an_image_keeps_its_fill_mode_crop_and_adjustments`. Numbers unchanged | | 2026-10-31 | minor | M1, #1691: the Frame tool's Phone presets stopped at the iPhone 16 family, while the prototype device list already had the iPhone 17, 17 Pro, 17 Pro Max and Air. All four are presets now, at the same sizes (402×874, 402×874, 440×956, 420×912), and `frame.create {preset}` takes them. A test keeps every preset named like a prototype device at that device's size. Test: `frame_tests::presets_keep_the_sizes_of_the_prototype_devices`. Numbers unchanged | | 2026-10-31 | patch | M8, #1701: Show in folder on Linux asks the desktop portal to show the file (`OpenDirectory`), selected, and opens its folder with `xdg-open` only without a portal. In the Flatpak build, a file picked through the portal lives in a document folder that the portal reads as the document itself, so the old call offered to open the file ("No Apps Available"). | | 2026-10-31 | patch | M4: an open dashed line starts and ends with a half-length dash, with a whole number of patterns fitted to it (dashes and gaps scaled together), for Dash and Custom patterns, on the canvas, in PNG, PDF and SVG (`stroke-dashoffset`) and in Outline stroke. Closed paths are unchanged. An imported SVG's open dashed line follows the same rule. | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 5dfd5411..0286fd37 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,6 @@ # UI and interaction parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-30 · **Change:** minor (the keyboard's Menu key opens the context menu, as Shift+F10 does; the eyedropper with Cmd/Ctrl+Shift makes a colour style or variable of what it picks; sidebar number and text fields keep their text vertically centered when focused, including typography spacing; with the pen out, Enter or a double-click ends the path and edits the vector with the Move tool instead of drawing on (#1430); the Actions palette offers only commands that run from it, and no second row reading like a menu item: Place image opens the file dialog (#1574); Preferences ▸ Scroll wheel zoom: a mouse wheel zooms the canvas about the pointer and Cmd/Ctrl+wheel scrolls (#1390); boolean operations refuse input past their caps, and a boolean group past them draws without its result (#1104); the selection and hover outlines of rounded rectangles and frames follow their corners (#1506); colour picker review fixes for text undo, fitted sidebars, moving controls and gradient variables; Corner smoothing: an original icon and the shared number-field drag gesture, preserving fractional baselines; guides snap to layers when dragged; Crop image: Object ▸ Crop image, the right-click menu and the image fill row enter crop mode (`image.crop`, #1464); the Design panel's sections on one grid — 16 / 8 margins, 88 + 8 + 88 + 8 + 24 columns, 24 pt rows, 4 pt between a row's buttons (#858); the toolbar on one 32 pt grid, without its Resources button (#1210); colour picker LCH and OKLCH models; an XML (Android Vector Drawable) export format; Context menus: the Menu key reaches egui 0.37 but is unbound (row done → partial); the Text on a path tool; board tool keys pinned; community fixes: the text box by dragging, the font picker keys, the pen path on leaving Design, a still canvas in vector edit mode, a scrolling pages list, colour emoji, readable new text in frames, system theme on first run; the Small caps sample in Type settings drawn from capitals; recent files as cards; vector edit mode: hovering, hatching, selecting and dragging filled regions; home screen: Templates tab, first-run templates and Getting started tips; number fields: scrub rates, arrow steps, arithmetic with brackets, relative edits of mixed values; outline mode's hidden layers and object bounds; Hide when publishing; cursors per tool and modifier; panel widths; dark pages for files made in the dark theme; drag threshold and double-clicks into text in groups; rotation origin on Alt+R and placing with Enter: no documented shortcut missing; keyboard shortcut parity suite and bindings; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and the vector edit tail; canvas navigation, guides and grids behaviour suite and fixes; shapes and vector behaviour suite and fixes; paint and effects behaviour suite and fixes; frames, groups, sections and masks behaviour suite and fixes; layers panel keyboard: F2 rename, Shift+F10 context menu, F8 box selection; selection and transform behaviour suite and fixes; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; boolean hit testing on the result, group drags, frame outlines and slices; outlines for the selection, mask outlines; arc fields, live boolean editing, shape builder on strokes, one-sided widths; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; a rename selects the whole name, so typing replaces it; Escape or Enter after a pen path stays on the same vector (#760); IME composition kept on through idle frames of a text edit, candidates at the caret (#747); Selection colors for mixed selections and smart-selection spacing (#753); submenus with a hover delay and a safe triangle; the Actions palette's tabs, ranked search, highlight and recents; menu items that ask for a value; editor fixes from the community batches) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-30 · **Change:** minor (the colour picker's Image tab shows a placeholder and Upload from computer, an asset preview, and a file dropped on it replaces the image, keeping the fill mode, crop and position (#1682); the keyboard's Menu key opens the context menu, as Shift+F10 does; the eyedropper with Cmd/Ctrl+Shift makes a colour style or variable of what it picks; sidebar number and text fields keep their text vertically centered when focused, including typography spacing; with the pen out, Enter or a double-click ends the path and edits the vector with the Move tool instead of drawing on (#1430); the Actions palette offers only commands that run from it, and no second row reading like a menu item: Place image opens the file dialog (#1574); Preferences ▸ Scroll wheel zoom: a mouse wheel zooms the canvas about the pointer and Cmd/Ctrl+wheel scrolls (#1390); boolean operations refuse input past their caps, and a boolean group past them draws without its result (#1104); the selection and hover outlines of rounded rectangles and frames follow their corners (#1506); colour picker review fixes for text undo, fitted sidebars, moving controls and gradient variables; Corner smoothing: an original icon and the shared number-field drag gesture, preserving fractional baselines; guides snap to layers when dragged; Crop image: Object ▸ Crop image, the right-click menu and the image fill row enter crop mode (`image.crop`, #1464); the Design panel's sections on one grid — 16 / 8 margins, 88 + 8 + 88 + 8 + 24 columns, 24 pt rows, 4 pt between a row's buttons (#858); the toolbar on one 32 pt grid, without its Resources button (#1210); colour picker LCH and OKLCH models; an XML (Android Vector Drawable) export format; Context menus: the Menu key reaches egui 0.37 but is unbound (row done → partial); the Text on a path tool; board tool keys pinned; community fixes: the text box by dragging, the font picker keys, the pen path on leaving Design, a still canvas in vector edit mode, a scrolling pages list, colour emoji, readable new text in frames, system theme on first run; the Small caps sample in Type settings drawn from capitals; recent files as cards; vector edit mode: hovering, hatching, selecting and dragging filled regions; home screen: Templates tab, first-run templates and Getting started tips; number fields: scrub rates, arrow steps, arithmetic with brackets, relative edits of mixed values; outline mode's hidden layers and object bounds; Hide when publishing; cursors per tool and modifier; panel widths; dark pages for files made in the dark theme; drag threshold and double-clicks into text in groups; rotation origin on Alt+R and placing with Enter: no documented shortcut missing; keyboard shortcut parity suite and bindings; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and the vector edit tail; canvas navigation, guides and grids behaviour suite and fixes; shapes and vector behaviour suite and fixes; paint and effects behaviour suite and fixes; frames, groups, sections and masks behaviour suite and fixes; layers panel keyboard: F2 rename, Shift+F10 context menu, F8 box selection; selection and transform behaviour suite and fixes; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; boolean hit testing on the result, group drags, frame outlines and slices; outlines for the selection, mask outlines; arc fields, live boolean editing, shape builder on strokes, one-sided widths; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; a rename selects the whole name, so typing replaces it; Escape or Enter after a pen path stays on the same vector (#760); IME composition kept on through idle frames of a text edit, candidates at the caret (#747); Selection colors for mixed selections and smart-selection spacing (#753); submenus with a hover delay and a safe triangle; the Actions palette's tabs, ranked search, highlight and recents; menu items that ask for a value; editor fixes from the community batches) · **Target:** Figma Design UI3 (desktop app 126.10.7) Fine canvas control is what Figma users feel first: handles, snapping, nudging, modifier keys, drag behaviour, numeric precision. This checklist covers the tools, gestures and panels. Status: @@ -31,6 +31,7 @@ interaction feel not yet compared. | Fields select their text on focus | done | Number and text values keep their vertical position when their editor gains focus (including typography spacing; `sidebar_field_text_stays_in_place_on_focus`). a click or Tab into a one-line field selects all of its text, so typing replaces the value: hex and colour fields, number fields, inline fields (a fill's hex, variable values, renames), names, search boxes and dialog fields; a drag from the press selects only what it covers; multi-line fields (descriptions, comments) keep the caret where clicked. The first click into an inline field (a fill's hex) now takes the keyboard; it took a second click. A rename (double-click, F2, File ▸ Rename, a page) selects the whole name before its field first draws, so a key typed in that same frame replaces the name; it was appended (`widgets::select_all_on_focus`, `select_all_tests`, `layers_rename_tests`) | | Colour picker models | done | Hex, RGB, HSL, HSB, LCH, OKLCH and CSS; LCH and OKLCH keep lightness and hue when a colour leaves sRGB (chroma comes down); the values typed stay while the colour is theirs (a hue typed on a grey, a chroma sRGB can't hold); CSS reads `lch()` and `oklch()` with any hue unit and `none` (`figcraft_color::{Lch, Oklch}`). Values are the stored channels read as sRGB | | Colour picker placement and dismissal | done | Opens 8 pt beside the sidebar at the opening control, lifted to fit the screen; outside presses (including the sidebar), Escape and X close it. Reopening resets a dragged position; eyedropper sampling keeps it open. | +| Colour picker image well | partial | the Image tab shows a checkered placeholder and Upload from computer until there is a file (no dialog at once); an image paint shows its asset preview; a file dropped on the open picker replaces the image, keeping the fill mode, crop, position and adjustments (`image.replace`). Layers' fills and strokes only (text ranges, styles and selection colours keep Upload). The Fill and Stroke swatches take no drop: a dragged file's position isn't known, so a drop with none goes to the open picker | | Colour picker on a new fill or stroke | done | + opens the picker on the new paint when the selection shares one paint list; on a mixed selection + adds a paint to each layer and no picker opens (#404) | | Blend mode menus: the layer's (Design panel) and each paint's (colour picker) | done | Pass through and Normal are distinct (Normal isolates a group's or frame's children); paints have no pass-through; plus darker drawn exactly on the canvas | @@ -175,6 +176,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| +| 2026-10-31 | minor | M1, #1682: as the help center describes the colour picker, choosing Image no longer opens a file dialog at once: the tab shows a checkered placeholder and Upload from computer until there is a file. An image paint shows its asset preview with the same button. A file dropped on the open picker replaces the image and keeps the fill mode, crop, position and adjustments; on the placeholder it becomes the paint's image, filling the layer. While a file is dragged the picker says it takes it instead of the window saying Drop to import. New command `image.replace {ids?, target?, index?, data | path}`, through the same size cap and decoder as `image.place`; one undo step. Dropped files in the browser arrive as `data`. A native window or a browser doesn't say where a dragged file is, so a drop with no known position goes to the open picker, and one known to be over the canvas imports as before. Left: the Fill and Stroke swatches in the Design panel don't take a drop, since their place can't be told during a drag; pasting into the picker isn't documented and isn't added. Tests: `colorpicker_image_tests`, `image_crop_tests::replacing_an_image_keeps_its_fill_mode_crop_and_adjustments`. Numbers unchanged | | 2026-10-30 | minor | Gap 4: the keyboard's Menu key opens the context menu, as Shift+F10 does (at the focused layer row or below the canvas selection, with the keyboard in the menu). egui already reported the key; FigCraft's keymap had no name or binding for it. `view.contextMenu` now takes `Menu` too, and the Context menus row is done (`layers_keyboard_tests`). Stale rows corrected: smart-selection spacing has had reorder rings since the "M1: smart-selection drag reordering" landing (the row is still partial: irregular grids and several marked layers aren't covered), and gap 4 and the parity summary quoted shortcut counts from before the last bindings (now 128 bound, none missing, 57 undocumented pinned, as `shortcut_parity_tests` counts). | | 2026-10-30 | minor | M4, gap 4: the eyedropper with Cmd/Ctrl+Shift held makes a colour style or variable of the colour it picks, as the reference app's eyedropper does, instead of filling the selection. It asks the UI for a Create from color window (`dialog.createFromColor`; the control channel never opens it). The window shows the colour and offers Style or Variable, a name (the next free "Color n") and, for a variable, a collection: the file's first, or a new one made with it in the same undo step. Create runs `style.create` or `variable.create`. Tests: `eyedropper_create_tests`, `sampled_color_tests`. | | 2026-10-30 | minor | M1: sidebar number and text fields keep their text vertically centered when focused, including typography spacing. Editors use the full 24 pt field height instead of adding a 4 pt top inset to an editor already at least 24 pt tall. Regression: `field_tests::sidebar_field_text_stays_in_place_on_focus` compares painted text positions before and after focus. Readiness estimates unchanged. |