From 12d36a9913593b25edd89f250a12fe7f7690ab6a Mon Sep 17 00:00:00 2001 From: BFlat Date: Sat, 31 Oct 2026 03:56:43 +0700 Subject: [PATCH] M4: a stroke's Custom style takes a dash pattern as a comma-separated list (#1681) (#1712) --- ROADMAP.md | 3 +- crates/ui-egui/locales/ar.toml | 2 + crates/ui-egui/locales/bn.toml | 2 + crates/ui-egui/locales/bs.toml | 2 + crates/ui-egui/locales/cs.toml | 2 + crates/ui-egui/locales/de.toml | 2 + crates/ui-egui/locales/en.toml | 2 + crates/ui-egui/locales/es.toml | 2 + crates/ui-egui/locales/fi.toml | 2 + crates/ui-egui/locales/fr.toml | 2 + crates/ui-egui/locales/id.toml | 2 + crates/ui-egui/locales/it.toml | 2 + crates/ui-egui/locales/ja.toml | 2 + crates/ui-egui/locales/ka.toml | 2 + crates/ui-egui/locales/ko.toml | 2 + crates/ui-egui/locales/nl.toml | 2 + crates/ui-egui/locales/pl.toml | 2 + crates/ui-egui/locales/pt-BR.toml | 2 + crates/ui-egui/locales/ru.toml | 2 + crates/ui-egui/locales/sv.toml | 2 + crates/ui-egui/locales/th.toml | 2 + crates/ui-egui/locales/tr.toml | 2 + crates/ui-egui/locales/vi.toml | 2 + crates/ui-egui/locales/zh-Hans.toml | 2 + crates/ui-egui/src/dash_pattern_tests.rs | 130 ++++++++++++++++++---- crates/ui-egui/src/panels/right/stroke.rs | 114 +++++++++++++------ docs/roadmap.md | 3 +- 27 files changed, 242 insertions(+), 54 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index eb9e326d..26ad4839 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 (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 (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 | M4, #1681: Stroke style has Custom beside Solid and Dash, with a Dashes field that takes the whole pattern as `dash, gap, dash, gap…`. A pattern longer than a pair shows there instead of in Dash and Gap, so an imported one can be read and edited whole. No phase or centre on corners, which the reference has no setting for. | | 2026-10-31 | minor | M8, #1696: the control channel waited a fixed 60 s for every request, so a client that knowingly sent a big `batch` could only split it, while the same script ran headless without a limit. A request can now carry `timeoutMs` beside `id` and `method` (whole milliseconds, at most 600,000); without it the wait stays 60 s, and an app from before this ignores the field. `figcraft-cli mcp --attach PORT --timeout SECONDS` (1–600) sends it with every request and reads the app's answers that much longer. A timeout's message says how long the request waited. Tests: `control_server_tests`, `backend_tests::a_raised_timeout_is_asked_for_on_each_request`, `args`. Numbers unchanged | | 2026-10-30 | minor | M11, gap 6: a widget can open its plugin's panel, as a Figma widget's click handler shows a plugin window (plugin API 5). A widget callback's `ui_show` (click, field edit or menu item) opens the plugin's one panel and keeps the module loaded; each panel callback gets the widget's id and current state as well as the panel's event and values, and its `widget_render` redraws the widget in the same undo step. A widget removed meanwhile isn't redrawn (the callback rolls back, the panel stays); an API 3 or 4 plugin's `ui_show` from a widget still opens nothing; a presented prototype opens no panel. The Counter example (API 5) gets Set count… in its menu: a panel whose Set button redraws it with the count entered. Tests: `widget_panel_tests` (engine), the Counter's unit test. 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). | diff --git a/crates/ui-egui/locales/ar.toml b/crates/ui-egui/locales/ar.toml index 5311ddb7..79039062 100644 --- a/crates/ui-egui/locales/ar.toml +++ b/crates/ui-egui/locales/ar.toml @@ -392,6 +392,8 @@ status = "draft — needs native review" "Dark" = "داكن" "Darken" = "تعتيم" "Dash" = "شرطة" +"Dashes" = "الشرطات" +"Dashes take numbers separated by commas" = "تقبل الشرطات أرقامًا مفصولة بفواصل" "Dashboard" = "لوحة المعلومات" "Date created" = "تاريخ الإنشاء" "Dec" = "ديسمبر" diff --git a/crates/ui-egui/locales/bn.toml b/crates/ui-egui/locales/bn.toml index 8bb06531..8548f560 100644 --- a/crates/ui-egui/locales/bn.toml +++ b/crates/ui-egui/locales/bn.toml @@ -372,6 +372,8 @@ status = "draft — needs native review" "Dark" = "ডার্ক" "Darken" = "ডার্কেন" "Dash" = "ড্যাশ" +"Dashes" = "ড্যাশগুলো" +"Dashes take numbers separated by commas" = "ড্যাশগুলো কমা দিয়ে আলাদা করা সংখ্যা হবে" "Dashboard" = "ড্যাশবোর্ড" "Date created" = "তৈরির তারিখ" "Dec" = "ডিসেম্বর" diff --git a/crates/ui-egui/locales/bs.toml b/crates/ui-egui/locales/bs.toml index 7ddaaa7b..13b49623 100644 --- a/crates/ui-egui/locales/bs.toml +++ b/crates/ui-egui/locales/bs.toml @@ -395,6 +395,8 @@ status = "draft — needs native review" "Dark" = "Tamna" "Darken" = "Zatamni" "Dash" = "Crtica" +"Dashes" = "Crtice" +"Dashes take numbers separated by commas" = "Crtice su brojevi odvojeni zarezima" "Dashboard" = "Kontrolna tabla" "Date created" = "Datum kreiranja" "Dec" = "dec." diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml index dae88a8c..2fe4a9fd 100644 --- a/crates/ui-egui/locales/cs.toml +++ b/crates/ui-egui/locales/cs.toml @@ -362,6 +362,8 @@ status = "draft — needs native review" "Dark" = "Tmavý" "Darken" = "Ztmavit" "Dash" = "Čárkování" +"Dashes" = "Čárkování" +"Dashes take numbers separated by commas" = "Čárkování zadejte jako čísla oddělená čárkami" "Dashboard" = "Přehled" "Date created" = "Datum vytvoření" "Dec" = "prosince" diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index 761dffe0..30e66c78 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -362,6 +362,8 @@ status = "draft — needs native review" "Dark" = "Dunkel" "Darken" = "Abdunkeln" "Dash" = "Gestrichelt" +"Dashes" = "Striche" +"Dashes take numbers separated by commas" = "Striche sind Zahlen, durch Kommas getrennt" "Decoration style" = "Linienstil" "Decoration" = "Auszeichnung" "Deep select" = "Tiefe Auswahl" diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 75111fcd..4b60d494 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -397,6 +397,8 @@ name = "English" "Dark" = "Dark" "Darken" = "Darken" "Dash" = "Dash" +"Dashes" = "Dashes" +"Dashes take numbers separated by commas" = "Dashes take numbers separated by commas" "Dashboard" = "Dashboard" "Date created" = "Date created" "Dec" = "Dec" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 2a00bc97..fad1220f 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -396,6 +396,8 @@ status = "draft — needs native review" "Dark" = "Oscuro" "Darken" = "Oscurecer" "Dash" = "Discontinuo" +"Dashes" = "Guiones" +"Dashes take numbers separated by commas" = "Los guiones son números separados por comas" "Dashboard" = "Panel de control" "Date created" = "Fecha de creación" "Dec" = "dic" diff --git a/crates/ui-egui/locales/fi.toml b/crates/ui-egui/locales/fi.toml index 9fc9df15..c4afe61f 100644 --- a/crates/ui-egui/locales/fi.toml +++ b/crates/ui-egui/locales/fi.toml @@ -396,6 +396,8 @@ status = "draft — needs native review" "Dark" = "Tumma" "Darken" = "Tummenna" "Dash" = "Katkoviiva" +"Dashes" = "Katkoviivat" +"Dashes take numbers separated by commas" = "Anna katkoviivat pilkuilla erotettuina lukuina" "Dashboard" = "Koontinäkymä" "Date created" = "Luontipäivä" "Dec" = "jouluk." diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 76e160c7..58295a2f 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -372,6 +372,8 @@ status = "draft — needs native review" "Dark" = "Sombre" "Darken" = "Assombrir" "Dash" = "Tirets" +"Dashes" = "Tirets" +"Dashes take numbers separated by commas" = "Les tirets sont des nombres séparés par des virgules" "Dashboard" = "Tableau de bord" "Date created" = "Date de création" "Dec" = "déc." diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml index 0ee15d77..224e37d5 100644 --- a/crates/ui-egui/locales/id.toml +++ b/crates/ui-egui/locales/id.toml @@ -377,6 +377,8 @@ status = "draft — needs native review" "Dark" = "Gelap" "Darken" = "Gelapkan" "Dash" = "Putus-putus" +"Dashes" = "Garis putus" +"Dashes take numbers separated by commas" = "Garis putus berupa angka yang dipisahkan koma" "Dashboard" = "Dasbor" "Date created" = "Tanggal dibuat" "Dec" = "Des" diff --git a/crates/ui-egui/locales/it.toml b/crates/ui-egui/locales/it.toml index 09cfd61a..ecdfd0c1 100644 --- a/crates/ui-egui/locales/it.toml +++ b/crates/ui-egui/locales/it.toml @@ -356,6 +356,8 @@ status = "draft — needs native review" "Dark" = "Scuro" "Darken" = "Scurisci" "Dash" = "Tratteggio" +"Dashes" = "Trattini" +"Dashes take numbers separated by commas" = "I trattini sono numeri separati da virgole" "Dashboard" = "Dashboard" "Date created" = "Data di creazione" "Dec" = "dic" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index 87783a47..7bca1563 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -370,6 +370,8 @@ status = "draft — needs native review" "Dark" = "ダーク" "Darken" = "比較(暗)" "Dash" = "破線" +"Dashes" = "ダッシュ" +"Dashes take numbers separated by commas" = "ダッシュはカンマ区切りの数値で入力します" "Dashboard" = "ダッシュボード" "Date created" = "作成日" "Dec" = "12月" diff --git a/crates/ui-egui/locales/ka.toml b/crates/ui-egui/locales/ka.toml index df6a0a13..ebec3a90 100644 --- a/crates/ui-egui/locales/ka.toml +++ b/crates/ui-egui/locales/ka.toml @@ -377,6 +377,8 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Dark" = "ბნელი" "Darken" = "ჩამუქება" "Dash" = "ტირე" +"Dashes" = "ტირეები" +"Dashes take numbers separated by commas" = "ტირეები მძიმით გამოყოფილი რიცხვებია" "Dashboard" = "სამართავი დაფა" "Date created" = "შექმნის თარიღი" "Dec" = "დეკ" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index 506291eb..75037d0c 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -358,6 +358,8 @@ status = "draft — needs native review" "Dark" = "다크" "Darken" = "어둡게 하기" "Dash" = "대시" +"Dashes" = "대시" +"Dashes take numbers separated by commas" = "대시는 쉼표로 구분한 숫자로 입력하세요" "Decoration style" = "장식 스타일" "Decoration" = "장식" "Deep select" = "깊은 선택" diff --git a/crates/ui-egui/locales/nl.toml b/crates/ui-egui/locales/nl.toml index 6efe600c..b1b3a004 100644 --- a/crates/ui-egui/locales/nl.toml +++ b/crates/ui-egui/locales/nl.toml @@ -374,6 +374,8 @@ status = "draft — needs native review" "Dark" = "Donker" "Darken" = "Darken" "Dash" = "Streep" +"Dashes" = "Streepjes" +"Dashes take numbers separated by commas" = "Streepjes zijn getallen gescheiden door komma's" "Dashboard" = "Dashboard" "Date created" = "Aanmaakdatum" "Dec" = "dec." diff --git a/crates/ui-egui/locales/pl.toml b/crates/ui-egui/locales/pl.toml index 84f61176..c0de5a28 100644 --- a/crates/ui-egui/locales/pl.toml +++ b/crates/ui-egui/locales/pl.toml @@ -373,6 +373,8 @@ name = "Polski" "Dark" = "Ciemny" "Darken" = "Ciemniej" "Dash" = "Kreska" +"Dashes" = "Kreski" +"Dashes take numbers separated by commas" = "Kreski to liczby oddzielone przecinkami" "Dashboard" = "Pulpit" "Date created" = "Data utworzenia" "Dec" = "Gru" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index 83f24202..2ee40fe3 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -357,6 +357,8 @@ status = "draft — needs native review" "Dark" = "Escuro" "Darken" = "Escurecer" "Dash" = "Tracejado" +"Dashes" = "Traços" +"Dashes take numbers separated by commas" = "Os traços são números separados por vírgulas" "Decoration style" = "Estilo da decoração" "Decoration" = "Decoração" "Deep select" = "Seleção profunda" diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 5c7806c1..5f71d4e2 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -373,6 +373,8 @@ name = "Русский" "Dark" = "Тёмная" "Darken" = "Затемнение" "Dash" = "Штрих" +"Dashes" = "Штрихи" +"Dashes take numbers separated by commas" = "Штрихи задаются числами через запятую" "Dashboard" = "Панель аналитики" "Date created" = "Дата создания" "Dec" = "дек." diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index 56254a79..6a95c18e 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -393,6 +393,8 @@ name = "Svenska" "Dark" = "Mörk" "Darken" = "Mörkare" "Dash" = "Streck" +"Dashes" = "Streck" +"Dashes take numbers separated by commas" = "Streck anges som tal åtskilda med kommatecken" "Dashboard" = "Instrumentpanel" "Date created" = "Skapandedatum" "Dec" = "Dec" diff --git a/crates/ui-egui/locales/th.toml b/crates/ui-egui/locales/th.toml index d53db652..b7fb34e2 100644 --- a/crates/ui-egui/locales/th.toml +++ b/crates/ui-egui/locales/th.toml @@ -371,6 +371,8 @@ status = "draft — needs native review" "Dark" = "มืด" "Darken" = "Darken" "Dash" = "เส้นประ" +"Dashes" = "เส้นประ" +"Dashes take numbers separated by commas" = "ใส่เส้นประเป็นตัวเลขคั่นด้วยจุลภาค" "Dashboard" = "แดชบอร์ด" "Date created" = "วันที่สร้าง" "Dec" = "ธ.ค." diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml index c3970a83..5a133739 100644 --- a/crates/ui-egui/locales/tr.toml +++ b/crates/ui-egui/locales/tr.toml @@ -366,6 +366,8 @@ name = "Türkçe" "Dark" = "Koyu" "Darken" = "Koyulaştır" "Dash" = "Kesik çizgi" +"Dashes" = "Kesik çizgiler" +"Dashes take numbers separated by commas" = "Kesik çizgiler virgülle ayrılmış sayılardır" "Dashboard" = "Pano" "Date created" = "Oluşturulma tarihi" "Dec" = "Ara" diff --git a/crates/ui-egui/locales/vi.toml b/crates/ui-egui/locales/vi.toml index 34cfec1a..6002a88f 100644 --- a/crates/ui-egui/locales/vi.toml +++ b/crates/ui-egui/locales/vi.toml @@ -357,6 +357,8 @@ status = "draft — needs native review" "Dark" = "Tối" "Darken" = "Làm tối" "Dash" = "Nét đứt" +"Dashes" = "Các nét đứt" +"Dashes take numbers separated by commas" = "Nét đứt là các số cách nhau bằng dấu phẩy" "Dashboard" = "Bảng điều khiển" "Date created" = "Ngày tạo" "Dec" = "Thg 12" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index 624d130a..7ab9fe07 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -362,6 +362,8 @@ status = "draft — needs native review" "Dark" = "深色" "Darken" = "变暗" "Dash" = "虚线" +"Dashes" = "虚线" +"Dashes take numbers separated by commas" = "虚线为以逗号分隔的数字" "Decoration style" = "装饰线样式" "Decoration" = "装饰线" "Deep select" = "深度选择" diff --git a/crates/ui-egui/src/dash_pattern_tests.rs b/crates/ui-egui/src/dash_pattern_tests.rs index 4244148f..aa640f9e 100644 --- a/crates/ui-egui/src/dash_pattern_tests.rs +++ b/crates/ui-egui/src/dash_pattern_tests.rs @@ -1,11 +1,13 @@ -//! The stroke settings' Dash and Gap fields edit the first pair of a dash pattern and keep the -//! rest of it (#1681): an imported `[4, 2, 1, 2]` used to collapse to `[dash, gap]` on the first edit. +//! The stroke settings' dash pattern: Dash and Gap edit a pair, and the Custom style's Dashes field +//! takes the whole pattern as `dash, gap, dash, gap…` (#1681). A longer pattern shows there, so an +//! imported `[4, 2, 1, 2]` stays whole. use egui::{Event, Id, Key, Modifiers}; use figcraft_doc::NodeId; use figcraft_engine::Session; use serde_json::json; +use crate::export_preview_tests::{click, labelled}; use crate::layers_drag_tests::Ui; /// A selected rectangle with a stroke dashed `dashes`, its advanced stroke settings shown. @@ -24,9 +26,14 @@ fn dashes(u: &Ui, r: NodeId) -> Vec { u.app.session.doc().unwrap().node(r).unwrap().stroke.dashes.clone() } -/// Type `text` into the number field `id` and press Enter. -fn type_into(u: &mut Ui, id: &str, text: &str) { - let at = u.ctx.read_response(Id::unique(id).with("field")).unwrap_or_else(|| panic!("{id} shows")).rect.center(); +/// Whether the field `id` (with `part`) showed in the last frame. +fn shows(u: &Ui, id: &str, part: &str) -> bool { + u.ctx.read_response(Id::unique(id).with(part)).is_some() +} + +/// Click the field `id` (at `part`), type `text` and press Enter. +fn type_in(u: &mut Ui, id: &str, part: &str, text: &str) { + let at = u.ctx.read_response(Id::unique(id).with(part)).unwrap_or_else(|| panic!("{id} shows")).rect.center(); u.button(at, true); u.button(at, false); u.frame(vec![]); @@ -38,13 +45,103 @@ fn type_into(u: &mut Ui, id: &str, text: &str) { u.frame(vec![]); } +/// Type `text` into the number field `id` and press Enter. +fn type_into(u: &mut Ui, id: &str, text: &str) { + type_in(u, id, "field", text); +} + +/// Type `text` into the Dashes field and press Enter. +fn type_list(u: &mut Ui, text: &str) { + type_in(u, "stroke_dashes", "click", text); +} + +/// Open the Stroke style menu (showing `shown`) and pick `item`. +fn pick_style(u: &mut Ui, shown: &str, item: &str) { + let at = |u: &mut Ui, text: &str, last: bool| { + let all: Vec<_> = labelled(u).into_iter().filter(|(t, _)| t == text).map(|x| x.1).collect(); + // The menu draws over the panel; in the panel the menu's button comes before its fields. + *(if last { all.last() } else { all.first() }).unwrap_or_else(|| panic!("no {text:?}")) + }; + let button = at(u, shown, false); + click(u, button); + let choice = at(u, item, true); + click(u, choice); + u.frame(vec![]); +} + +fn toast(u: &Ui) -> String { + u.app.ui.toast.as_ref().map(|t| t.0.clone()).unwrap_or_default() +} + #[test] -fn editing_the_dash_or_gap_keeps_the_rest_of_the_pattern() { +fn a_longer_pattern_shows_as_a_list_and_stays_whole() { let (mut u, r) = scene(json!([4, 2, 1, 2])); - type_into(&mut u, "stroke_dash", "6"); - assert_eq!(dashes(&u, r), [6.0, 2.0, 1.0, 2.0]); - type_into(&mut u, "stroke_gap", "3"); - assert_eq!(dashes(&u, r), [6.0, 3.0, 1.0, 2.0]); + assert!(shows(&u, "stroke_dashes", "click") && !shows(&u, "stroke_dash", "field"), "Custom, not Dash and Gap"); + assert!(labelled(&mut u).iter().any(|(t, _)| t == "4, 2, 1, 2")); + assert_eq!(dashes(&u, r), [4.0, 2.0, 1.0, 2.0], "showing it changes nothing"); + // The reference's own example: dashes and gaps of any length, as many as you like. + type_list(&mut u, "10, 20, 10, 20, 80, 20, 10, 100"); + assert_eq!(dashes(&u, r), [10.0, 20.0, 10.0, 20.0, 80.0, 20.0, 10.0, 100.0]); + // Spaces don't matter, and an odd count is kept as typed (it draws repeated). + type_list(&mut u, "4,2 , 1.5,"); + assert_eq!(dashes(&u, r), [4.0, 2.0, 1.5]); + assert!(labelled(&mut u).iter().any(|(t, _)| t == "4, 2, 1.5")); +} + +#[test] +fn only_numbers_go_in_the_list() { + let (mut u, r) = scene(json!([4, 2, 1, 2])); + for bad in ["4, x", "-1, 2", "inf", ",", " "] { + u.app.ui.toast = None; + type_list(&mut u, bad); + assert_eq!(dashes(&u, r), [4.0, 2.0, 1.0, 2.0], "{bad:?} changes nothing"); + assert_eq!(toast(&u), "Dashes take numbers separated by commas", "{bad:?} says why"); + } + // Leaving the text as it was isn't an edit. + u.app.ui.toast = None; + type_list(&mut u, "4, 2, 1, 2"); + assert_eq!(toast(&u), ""); +} + +/// Custom on a plain pair keeps the pattern and shows it as a list, and stays that way after a +/// list of one pair is typed; Dash goes back to the fields with the first pair of the list. +#[test] +fn the_style_menu_moves_between_the_fields_and_the_list() { + let (mut u, r) = scene(json!([6, 3])); + assert!(shows(&u, "stroke_dash", "field") && !shows(&u, "stroke_dashes", "click")); + pick_style(&mut u, "Dash", "Custom"); + assert!(shows(&u, "stroke_dashes", "click") && !shows(&u, "stroke_dash", "field")); + assert_eq!(dashes(&u, r), [6.0, 3.0], "choosing it changes nothing"); + type_list(&mut u, "5, 5"); + assert_eq!(dashes(&u, r), [5.0, 5.0]); + assert!(shows(&u, "stroke_dashes", "click"), "still the list"); + type_list(&mut u, "8, 2, 1, 2"); + pick_style(&mut u, "Custom", "Dash"); + assert_eq!(dashes(&u, r), [8.0, 2.0], "the first dash and gap"); + assert!(shows(&u, "stroke_dash", "field") && !shows(&u, "stroke_dashes", "click")); + pick_style(&mut u, "Dash", "Solid"); + assert_eq!(dashes(&u, r), Vec::::new()); + // From Solid, a list starts from the same pair Dash does: four stroke widths. + pick_style(&mut u, "Solid", "Custom"); + assert_eq!(dashes(&u, r), [8.0, 8.0]); + assert!(shows(&u, "stroke_dashes", "click")); +} + +/// Custom chosen for one layer doesn't follow the selection to another. +#[test] +fn a_chosen_list_belongs_to_its_selection() { + let (mut u, r) = scene(json!([6, 3])); + pick_style(&mut u, "Dash", "Custom"); + let other = NodeId(u.app.run("shape.rectangle", json!({"x": 300, "y": 0, "width": 50, "height": 50})).unwrap()["id"].as_u64().unwrap()); + u.app.run("node.set", json!({"ids": [other], "props": {"strokes": ["#000000"], "dashes": [6, 3]}})); + u.app.run("select.set", json!({"ids": [other]})); + u.frame(vec![]); + u.frame(vec![]); + assert!(shows(&u, "stroke_dash", "field"), "a pair shows as Dash and Gap"); + u.app.run("select.set", json!({"ids": [r]})); + u.frame(vec![]); + u.frame(vec![]); + assert!(shows(&u, "stroke_dashes", "click"), "back on the first layer, the list"); } #[test] @@ -52,15 +149,6 @@ fn a_single_value_pattern_is_the_dash_and_the_gap() { let (mut u, r) = scene(json!([5])); type_into(&mut u, "stroke_gap", "2"); assert_eq!(dashes(&u, r), [5.0, 2.0]); -} - -/// An odd-length pattern draws twice over (`[4, 2, 1]` is `[4, 2, 1, 4, 2, 1]`): editing its Dash -/// writes the repeat out, so only the first dash changes and every gap stays as drawn. -#[test] -fn an_odd_length_pattern_keeps_its_repeat() { - let (mut u, r) = scene(json!([4, 2, 1])); - type_into(&mut u, "stroke_dash", "6"); - assert_eq!(dashes(&u, r), [6.0, 2.0, 1.0, 4.0, 2.0, 1.0]); - type_into(&mut u, "stroke_gap", "3"); - assert_eq!(dashes(&u, r), [6.0, 3.0, 1.0, 4.0, 2.0, 1.0]); + type_into(&mut u, "stroke_dash", "7"); + assert_eq!(dashes(&u, r), [7.0, 2.0]); } diff --git a/crates/ui-egui/src/panels/right/stroke.rs b/crates/ui-egui/src/panels/right/stroke.rs index e4c4c8ae..14d7e79b 100644 --- a/crates/ui-egui/src/panels/right/stroke.rs +++ b/crates/ui-egui/src/panels/right/stroke.rs @@ -187,11 +187,9 @@ fn brush_row(app: &mut FigApp, ui: &mut Ui, ids: &[NodeId], brush: Option