From 1c7fc27b42a1a8438c868b704dc45eb933b8f6f9 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 24 Nov 2026 22:18:13 -0800 Subject: [PATCH 001/105] Scripts: app.selectTool picks a tool app.selectTool(name) takes a tool's id (pen), its label (Pen Tool) or a tool name in the form scripts pass, returns true, and makes that tool the current tool when the run ends without an error. The tool chosen last in a run counts, and a run that fails leaves the tool as it was. An unknown name throws, a name that is not a string throws a TypeError, and a name over 4,096 bytes throws a RangeError. Docs: docs/mcp.md, docs/target-app-parity.md. --- crates/engine/src/script/dom.rs | 77 ++++++++++++++++++++++++++- crates/engine/src/script/mod.rs | 8 +++ crates/engine/src/tests/script_dom.rs | 29 ++++++++++ docs/mcp.md | 8 ++- docs/target-app-parity.md | 2 +- 5 files changed, 121 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/script/dom.rs b/crates/engine/src/script/dom.rs index cb901014b5..a3456e8590 100644 --- a/crates/engine/src/script/dom.rs +++ b/crates/engine/src/script/dom.rs @@ -25,6 +25,9 @@ //! - `app.activeDocument` with no document open throws `No active document`. //! - Assigning `Document.selection` takes one object, a list of them, `null` or `[]`; every object //! must be one of that document's that can be selected, or nothing changes. +//! - `app.selectTool(name)` takes a tool's id, its label, or a name of the list cited at +//! [`TOOL_NAME_PREFIX`], and the tool becomes the current tool when the run ends without an +//! error. A run that fails leaves the tool as it was. //! - Members the help pages list that are not here yet throw an error that says so. use std::cell::{Cell, RefCell}; @@ -88,7 +91,8 @@ const ARTBOARD_COORDS: &str = "CoordinateSystem.ARTBOARDCOORDINATESYSTEM"; /// What the object model keeps for one run: its coordinate system, the lists of page items and the /// answers of which objects are on a locked artboard for the last [`ITEM_LISTS`] documents read, /// each kept while its document is unchanged, whether a call's own savepoint ([`atomically`]) is -/// open, and the settings of each `DocumentPreset` the run made. +/// open, the settings of each `DocumentPreset` the run made, and the tool `app.selectTool` chose +/// last. #[derive(Default)] pub(super) struct State { coords: Cell, @@ -96,6 +100,7 @@ pub(super) struct State { locked: RefCell>, saving: Cell, presets: RefCell>>, + tool: Cell>, } impl State { @@ -103,6 +108,12 @@ impl State { pub(super) fn saving(&self) -> bool { self.saving.get() } + + /// The id of the tool `app.selectTool` chose last in the run, which becomes the current tool + /// when the run ends without an error. + pub(super) fn chosen_tool(&self) -> Option<&'static str> { + self.tool.get() + } } /// Runs `f`, whose commands are kept together or put back together: when `f` fails, every @@ -732,6 +743,69 @@ fn app_is_open(h: &Host, a: &[Data]) -> Answer { Ok(Data::Bool(open)) } +/// The start of the tool names that scripts pass to `app.selectTool`, as the list at +/// gives them. +const TOOL_NAME_PREFIX: &str = "Adobe "; // brand-ok: the start of the tool names scripts pass + +/// The names on that list, without [`TOOL_NAME_PREFIX`], whose words differ from the label of the +/// VectorCraft tool they choose, with that tool's id. Names whose words are a VectorCraft tool's +/// label (`Pen Tool`) choose that tool without a row here. The pairs are VectorCraft's own. +const TOOL_NAMES: &[(&str, &str)] = &[ + ("Select Tool", "selection"), + ("Direct Select Tool", "directSelection"), + ("Direct Object Select Tool", "groupSelection"), + ("Direct Lasso Tool", "lasso"), + ("Path Type Tool", "typeOnPath"), + ("Vertical Path Type Tool", "verticalTypeOnPath"), + ("Line Tool", "lineSegment"), + ("Shape Construction Regular Polygon Tool", "polygon"), + ("Shape Construction Star Tool", "star"), + ("Shape Construction Spiral Tool", "spiral"), + ("Brush Tool", "paintbrush"), + ("Freehand Tool", "pencil"), + ("Freehand Smooth Tool", "smooth"), + ("Freehand Erase Tool", "pathEraser"), + ("Corner Join Tool", "join"), + ("Knife Tool", "knife"), + ("New Twirl Tool", "twirl"), + ("Cyrstallize Tool", "crystallize"), + ("Planar Paintbucket Tool", "livePaintBucket"), + ("Planar Face Select Tool", "livePaintSelection"), + ("Mesh Editing Tool", "mesh"), + ("Gradient Vector Tool", "gradient"), + ("Crop Tool", "artboard"), + ("Slice Select Tool", "sliceSelection"), + ("Scroll Tool", "hand"), + ("Page Tool", "printTiling"), +]; + +/// The id of the tool `name` names: a tool's id (`pen`), its label (`Pen Tool`), or a name of the +/// list [`TOOL_NAME_PREFIX`] cites. +fn tool_named(name: &str) -> Option<&'static str> { + let tools = || vectorcraft_tools::catalog::all_tools(); + if let Some(t) = tools().find(|t| t.id == name || t.label == name) { + return Some(t.id); + } + let rest = name.strip_prefix(TOOL_NAME_PREFIX)?; + if let Some((_, id)) = TOOL_NAMES.iter().find(|(n, _)| *n == rest) { + return vectorcraft_tools::tool_info(id).map(|t| t.id); + } + tools().find(|t| t.label == rest).map(|t| t.id) +} + +/// `app.selectTool(name)`: chooses the tool `name` names ([`tool_named`]) and gives `true`. The +/// tool becomes the current tool when the run ends without an error, as a choice on the toolbar +/// does; the tool chosen last in a run is the one that counts. A name no tool has throws. +fn app_select_tool(h: &Host, a: &[Data]) -> Answer { + let Data::String(name) = arg(a, 1) else { return Err(HostError::Type("selectTool needs a tool name, as a string".into())) }; + if name.len() > MAX_TEXT_BYTES { + return Err(HostError::Range("the tool name is too long".into())); + } + let id = tool_named(name).ok_or_else(|| HostError::Error(format!("No tool is named \"{name}\"")))?; + h.dom.tool.set(Some(id)); + Ok(Data::Bool(true)) +} + // ---- Documents ---- fn docs_length(h: &Host, _: &[Data]) -> Answer { @@ -1948,6 +2022,7 @@ pub(super) fn install(realm: &mut Realm, link: &Link) -> std::result::Result<(), ("selection", get(l, app_selection)), ("coordinateSystem", property(l, app_coords, app_set_coords)), ("getIsFileOpen", method(l, app_is_open)), + ("selectTool", method(l, app_select_tool)), ]); application.push(later(l, "Application", "beep")); let preset = { diff --git a/crates/engine/src/script/mod.rs b/crates/engine/src/script/mod.rs index affacab584..dc4bd20008 100644 --- a/crates/engine/src/script/mod.rs +++ b/crates/engine/src/script/mod.rs @@ -2291,7 +2291,15 @@ impl Session { }); host.more_written(&mut report); close_run(self, host, &mut report, console::Ending::Finished); + let tool = host.dom.chosen_tool(); self.end_job(job, false); + // The tool `app.selectTool` chose last becomes the current tool, as a choice on the + // toolbar makes it; the run's changes are kept when the tool cannot be chosen. + if let Some(id) = tool + && let Err(e) = self.select_tool(id, self.last_view) + { + report["toolError"] = json!(e.to_string()); + } self.script_report = Some(report.clone()); Ok(report) } diff --git a/crates/engine/src/tests/script_dom.rs b/crates/engine/src/tests/script_dom.rs index 60e3a71521..a0c6e8afbc 100644 --- a/crates/engine/src/tests/script_dom.rs +++ b/crates/engine/src/tests/script_dom.rs @@ -1314,6 +1314,35 @@ fn prototype_changes_cannot_forge_a_page_item() { assert_eq!(s.active().unwrap().doc.node(a).unwrap().name, None); } +#[test] +fn select_tool_makes_the_named_tool_current_when_the_run_ends() { + let (mut s, _, _) = doc(); + assert_eq!(s.tool_id(), "selection"); + // A tool's id, its label and a name in the form scripts pass all choose it; the last one counts. + assert_eq!(log(&mut s, "vc.log(app.selectTool('pen'));"), vec![json!(true)]); + assert_eq!(s.tool_id(), "pen"); + log(&mut s, "app.selectTool('Rectangle Tool');"); + assert_eq!(s.tool_id(), "rectangle"); + log(&mut s, "app.selectTool('Adobe Ellipse Tool'); app.selectTool('Adobe Direct Select Tool');"); + assert_eq!(s.tool_id(), "directSelection"); + log(&mut s, "app.selectTool('Adobe Select Tool');"); + assert_eq!(s.tool_id(), "selection"); + // An unknown name throws, a caught error chooses nothing, and a run that fails leaves the tool. + assert!(failure(&mut s, "app.selectTool('No Such Tool');").contains("No tool is named \"No Such Tool\"")); + assert!(failure(&mut s, "app.selectTool('Adobe ');").contains("No tool is named")); + let out = log(&mut s, "try { app.selectTool('pencil tool'); } catch (e) { vc.log(e.message); }"); + assert_eq!(out, vec![json!("No tool is named \"pencil tool\"")]); + assert!(failure(&mut s, "app.selectTool('pen'); throw new Error('stop');").contains("stop")); + let out = log(&mut s, "try { app.selectTool(5); } catch (e) { vc.log(e.name); }"); + assert_eq!(out, vec![json!("TypeError")]); + assert!(failure(&mut s, "app.selectTool(new Array(5000).join('a'));").contains("too long")); + assert_eq!(s.tool_id(), "selection"); + // With no document open the tool is chosen too. + let mut empty = Session::new(); + log(&mut empty, "app.selectTool('Adobe Freehand Tool');"); + assert_eq!(empty.tool_id(), "pencil"); +} + #[test] fn unsupported_members_say_so() { let (mut s, _, _) = doc(); diff --git a/docs/mcp.md b/docs/mcp.md index 4685f408d7..5b4d5b342b 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2622,7 +2622,13 @@ app through the global object `vc`, and writes to the Script Console and runs ot - `vc.log(value)` adds a value to the report and a line to the Script Console. - `app` is the application object the help page https://ai-scripting.docsforadobe.dev/jsobjref/Application/ describes: `app.documents`, `app.activeDocument` (assigning an open document makes it the active one), - `app.selection`, `app.coordinateSystem` and `app.getIsFileOpen(path)`. `app.documents` + `app.selection`, `app.coordinateSystem`, `app.getIsFileOpen(path)` and `app.selectTool(name)`. `selectTool` + (https://community.adobe.com/questions-652/what-s-new-in-illustrator-scripting-cc2020-769942) takes a tool's id + (`pen`), its label (`Pen Tool`) or a tool name in the form that thread lists, returns `true`, and makes the tool it + names the current tool when the run ends without an error; the tool chosen last in a run is the one that counts, + and a run that fails leaves the tool as it was. A name no tool has throws `No tool is named ""`, a name that + is not a string throws a `TypeError`, and a name of more than 4,096 bytes throws a `RangeError`. Which tool each + name in that thread chooses is VectorCraft's own reading; names with no VectorCraft tool throw. `app.documents` (https://ai-scripting.docsforadobe.dev/jsobjref/Documents/) has `length`, `[i]`, `index(key)`, `getByName(name)` and `add(colorSpace?, width?, height?, numArtBoards?, artboardLayout?, artboardSpacing?, artboardRowsOrCols?)`, which runs `file.new` (`artboardRowsOrCols` is the number of rows for `GridByCol` and `RLGridByCol`, and of diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 3b252b56a6..607fd49b5e 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1024,7 +1024,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Synthetic input validates complete gestures before queue mutation: at most 256 drag steps, 16 clicks and 1,024 pending events; up to 64 control requests per frame, with later requests retained for the next frame (#1709). - The control server writes each reply through a 64 KiB buffer. On Windows 11 it sends the 17 MB `document.inspect` reply of a document with 50,000 objects on one layer to a client over loopback in 0.09 s instead of 34 s. - Scripts: File › Scripts › Other Script… and `script.run` run a JavaScript file against the open documents as one transaction with one undo step for each changed document. A failed or stopped run puts every document back. `crates/engine/src/tests/script_run.rs`. - - Scripts: the global `app` gives the open documents, new documents from a startup preset and a `DocumentPreset`, the active document, each document's selection and its page items with their names, notes, visibility, lock, opacity, position, size, bounds and stacking order, and moves and copies them into or beside other objects, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/Application/, https://ai-scripting.docsforadobe.dev/jsobjref/Documents/, https://ai-scripting.docsforadobe.dev/jsobjref/DocumentPreset/, https://ai-scripting.docsforadobe.dev/jsobjref/Document/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItems/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItem/ and https://ai-scripting.docsforadobe.dev/jsobjref/GroupItem/ describe them; each change runs a command inside the run's transaction (`docs/mcp.md`). Layers, paths, type and the other classes are not there yet. `crates/engine/src/tests/script_dom.rs`. + - Scripts: the global `app` gives the open documents, new documents from a startup preset and a `DocumentPreset`, the active document, each document's selection and its page items with their names, notes, visibility, lock, opacity, position, size, bounds and stacking order, and moves and copies them into or beside other objects, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/Application/, https://ai-scripting.docsforadobe.dev/jsobjref/Documents/, https://ai-scripting.docsforadobe.dev/jsobjref/DocumentPreset/, https://ai-scripting.docsforadobe.dev/jsobjref/Document/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItems/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItem/ and https://ai-scripting.docsforadobe.dev/jsobjref/GroupItem/ describe them; each change runs a command inside the run's transaction (`docs/mcp.md`). `app.selectTool(name)` makes the named tool the current tool when the run ends (https://community.adobe.com/questions-652/what-s-new-in-illustrator-scripting-cc2020-769942). Layers, paths, type and the other classes are not there yet. `crates/engine/src/tests/script_dom.rs`. - Scripts: Window › Script Console shows each run's `$.write` and `$.writeln` output, `vc.log` entries, uncaught error with the script's name, line and column, and a report of its time, host calls and slowest commands, keeping at most 2,048 lines and counting the lines it dropped. `script.run`'s report carries the same data, and `script.console`, `script.console.clear` and `ui.copyScriptConsole` read, clear and copy it. `crates/engine/src/tests/script_console.rs`. - Scripts: the status bar translates its own words around a failed run's error and the app's own error messages, and shows text the script threw itself (a value, an error it made, or an error whose name or message it changed) as it is, even when that text reads like one of the app's messages. `script.run`'s report gives `messageOrigin` (`script` or `built-in`), and the advice about objects other applications give their scripts follows only the app's own reference errors. VectorCraft's own rule. `crates/js/src/interp_tests.rs`, `crates/engine/src/tests/script_run.rs`, `crates/ui-egui/src/chrome/tests.rs`. - Scripts: the `$` object has the other members the Dollar object page lists (https://extendscript.docsforadobe.dev/extendscript-tools-features/dollar-object/), from `$.about()` to `$.version`, and scripts have the global `localize(object, ...values)` (https://extendscript.docsforadobe.dev/extendscript-tools-features/localizing-extendscript-strings/), `toSource(value)` and `Object.prototype.toSource()`. Each run starts with the interface's locale, and what a script changes in `$` lasts only for that run. `crates/engine/src/tests/script_dollar.rs`, `crates/js/src/extension_tests.rs`. From 24d91e2acf564c5124618e7357e6f0abe202fa19 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 24 Nov 2026 22:31:57 -0800 Subject: [PATCH 002/105] Script checker: app.selectTool counts as the document model, not a feature only the reference app has --- crates/scriptcheck/src/catalog.rs | 2 +- crates/scriptcheck/src/tests.rs | 2 +- docs/mcp.md | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/scriptcheck/src/catalog.rs b/crates/scriptcheck/src/catalog.rs index 0045c764f2..c1203504ca 100644 --- a/crates/scriptcheck/src/catalog.rs +++ b/crates/scriptcheck/src/catalog.rs @@ -181,7 +181,7 @@ features! { ScriptuiDrawing "scriptui.drawing" Dialogs, ScriptuiPalette "scriptui.palette" HostOnly, ScriptuiWindow "scriptui.window" Dialogs, - SelectTool "selectTool" HostOnly, + SelectTool "selectTool" Dom, Socket "socket" HostOnly, UnitValue "unitValue" Language, Xml "xml" HostOnly, diff --git a/crates/scriptcheck/src/tests.rs b/crates/scriptcheck/src/tests.rs index 6985791fe1..2d57f40f94 100644 --- a/crates/scriptcheck/src/tests.rs +++ b/crates/scriptcheck/src/tests.rs @@ -1521,7 +1521,7 @@ fn declarations_past_a_limit_hold_from_where_they_stand() { fn application_methods_are_features_not_members() { let r = report("app.executeMenuCommand('acmecopyall');\napp.selectTool('acme');\n"); assert!(r.members.is_empty(), "{:?}", r.members); - assert_eq!(r.needs, [Need::MenuCommands, Need::HostOnly]); + assert_eq!(r.needs, [Need::Dom, Need::MenuCommands]); } #[test] diff --git a/docs/mcp.md b/docs/mcp.md index 350d017c4f..6902e16314 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2563,9 +2563,9 @@ control character, in the first 8 KiB) or `tooLarge` (over 8 MiB). For a script, - `needs` lists what the script needs from the app that runs it: `language` (the script language's own objects and directives, such as `$`, `alert`, `UnitValue`, `#target` and `#targetengine`), `dom` (the reference app's - document model), `files`, `menuCommands`, `dialogs`, and `hostOnly` (features only the reference app has: - palettes, BridgeTalk, sockets, native code, XMP, the XML object and E4X, operator overloading, reflection, actions - and `selectTool`). + document model, `app.selectTool` included), `files`, `menuCommands`, `dialogs`, and `hostOnly` (features only the + reference app has: palettes, BridgeTalk, sockets, native code, XMP, the XML object and E4X, operator overloading, + reflection and actions). - `directives` lists the `#include`, `#includepath`, `#script`, `#strict`, `#target` and `#targetengine` lines, and `targets` splits each `#target` line's application specifier into `app`, `instance`, `version` and `locale`. A directive is read where it starts a line, written `#name` or `//@name`. From 7f7effc8fbd8695a9ba30e649a14b7fc687ffe1a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 24 Nov 2026 23:59:51 -0800 Subject: [PATCH 003/105] Scripts: New Document profiles are read without following a link, and review fixes - A New Document profile is opened without following a link (O_NOFOLLOW on Unix, FILE_FLAG_OPEN_REPARSE_POINT on Windows), and its kind and bytes are read from that open file. A link put in the profile's place after the plain-file check is refused instead of read. - Page item and layer handles go stale when their document is reverted. - controlBounds holds the control points of the object's paths. - PageItems.toString() throws Stale document for a collection kept from an earlier run. - Assigning an object the opacity it reports runs no command, except on a graph mark or label whose graph keeps another opacity. - An object-model edit and the steps that restore the selection, layer and active document succeed or fail together. - hasOwnProperty and propertyIsEnumerable stop at an unavailable member that hides one of a parent class. - Assigning a name that a non-extensible host object inherits no longer looks the name up with the object's indexer. - The Application prototype inventory lists selectTool. - docs/mcp.md names the Stale document error, and the parity line says the tool changes only when the run ends without an error. --- crates/engine/Cargo.toml | 7 +- crates/engine/src/cmd/newdoc.rs | 6 +- crates/engine/src/script/dom.rs | 80 +++++++++++++++---- crates/engine/src/store.rs | 46 +++++++++++ crates/engine/src/tests/script_dom.rs | 77 ++++++++++++++++-- crates/engine/src/tests/store.rs | 18 +++++ .../tests/it/script_host_vs_scriptcheck.rs | 2 +- crates/js/src/host_classes.rs | 14 +++- crates/js/src/host_tests.rs | 19 +++++ crates/js/src/interp.rs | 13 +-- docs/mcp.md | 7 +- docs/target-app-parity.md | 2 +- 12 files changed, 252 insertions(+), 39 deletions(-) diff --git a/crates/engine/Cargo.toml b/crates/engine/Cargo.toml index 7e6028b045..bb8277a9ab 100644 --- a/crates/engine/Cargo.toml +++ b/crates/engine/Cargo.toml @@ -70,10 +70,11 @@ serde_json = { workspace = true } thiserror = { workspace = true } log = { workspace = true } -# Whether a recovery area folder is this account's own (`FolderStore::own_area`). Already in -# Cargo.lock (tempfile, ui-egui), so this adds no new crate. +# Whether a recovery area folder is this account's own (`FolderStore::own_area`), and opening a +# file without following a link (`store::read_capped_plain`). Already in Cargo.lock (tempfile, +# ui-egui), so this adds no new crate. [target.'cfg(unix)'.dependencies] -rustix = { workspace = true, features = ["std", "process"] } +rustix = { workspace = true, features = ["std", "process", "fs"] } # Whether a recovery area's lock file is still the one that was opened (`FolderStore::still_named`), # and whether two paths a script names are one file (`script::files`). Already in Cargo.lock diff --git a/crates/engine/src/cmd/newdoc.rs b/crates/engine/src/cmd/newdoc.rs index 8272f7d8cb..47dd425555 100644 --- a/crates/engine/src/cmd/newdoc.rs +++ b/crates/engine/src/cmd/newdoc.rs @@ -1017,11 +1017,13 @@ impl Session { match std::fs::symlink_metadata(&path) { Err(e) if e.kind() == std::io::ErrorKind::NotFound => return Ok(None), // A link is refused: the script's gate does not check where it leads. - Ok(m) if !m.file_type().is_file() => return Err("not a plain file".to_string()), + Ok(m) if !m.file_type().is_file() => return Err(crate::store::NOT_PLAIN.to_string()), _ => {} } crate::file_access::check_read(&file).map_err(denied)?; - crate::store::read_capped(&path, MAX_PROFILE_BYTES).map(Some) + // Read without following a link, so a link put in the file's place since the check + // above is refused too. + crate::store::read_capped_plain(&path, MAX_PROFILE_BYTES).map(Some) })?; let Some(bytes) = read else { return Ok(None) }; // The color profiles the file carries are installed where missing, as opening it installs diff --git a/crates/engine/src/script/dom.rs b/crates/engine/src/script/dom.rs index 1f4d8de478..ca7bc3ba77 100644 --- a/crates/engine/src/script/dom.rs +++ b/crates/engine/src/script/dom.rs @@ -367,6 +367,14 @@ fn find_doc(h: &Host, run: f64, uid: f64) -> Option { s.documents().iter().position(|d| d.uid == uid).map(|index| Doc { index, uid }) } +/// [`find_doc`] for the handle of an object in a document: none as well when the document was +/// reverted since the handle was made, as its objects were read again from its file. +fn find_doc_of_object(h: &Host, run: f64, uid: f64, reverts: f64) -> Option { + let doc = find_doc(h, run, uid)?; + let s = h.session.borrow(); + (whole(reverts) == Some(s.documents()[doc.index].reverts)).then_some(doc) +} + /// The document `d` names: a `Document` or a `PageItems` object. fn doc_of(h: &Host, d: &Data, class: &str) -> std::result::Result { let Some(handle) = handle_of(d, class) else { return Err(HostError::Type(format!("this is not a {class}"))) }; @@ -379,8 +387,8 @@ fn doc_of(h: &Host, d: &Data, class: &str) -> std::result::Result std::result::Result { let Some(handle) = handle_of(d, "PageItem") else { return Err(HostError::Type("this is not a page item".into())) }; - let [run, uid, high, low] = handle.as_slice() else { return Err(HostError::Type("this is not a page item".into())) }; - let doc = find_doc(h, *run, *uid).ok_or_else(|| HostError::Error(STALE_ITEM.into()))?; + let [run, uid, reverts, high, low] = handle.as_slice() else { return Err(HostError::Type("this is not a page item".into())) }; + let doc = find_doc_of_object(h, *run, *uid, *reverts).ok_or_else(|| HostError::Error(STALE_ITEM.into()))?; let id = id_of(*high, *low).ok_or_else(|| HostError::Error(STALE_ITEM.into()))?; let s = h.session.borrow(); let st = &s.documents()[doc.index]; @@ -418,8 +426,8 @@ fn doc_ref(h: &Host, uid: u64) -> Data { fn item_ref(h: &Host, st: &DocState, id: NodeId) -> Data { match st.doc.node(id) { Some(n) => match typename(n) { - Some(t) => host_ref(t, &[float(h.run), float(st.uid), id_parts(id)[0], id_parts(id)[1]]), - None => host_ref("Layer", &[float(h.run), float(st.uid), id_parts(id)[0], id_parts(id)[1]]), + Some(t) => host_ref(t, &[float(h.run), float(st.uid), float(st.reverts), id_parts(id)[0], id_parts(id)[1]]), + None => host_ref("Layer", &[float(h.run), float(st.uid), float(st.reverts), id_parts(id)[0], id_parts(id)[1]]), }, None => Data::Null, } @@ -653,12 +661,24 @@ fn restore_layer(h: &Host, uid: u64, layer: Option, rows: &[NodeId]) -> /// commands changed it (commands given ids select them first), direct-selected anchors, segments, /// ruler guides, slices, the key, a Layers panel target and an object chosen inside a dynamic /// symbol instance or an Objects on Path group included, less the objects that are now deleted, -/// hidden or locked. +/// hidden or locked. `f`'s commands and the steps that put things back succeed or fail together +/// ([`atomically`]): when putting back the selection, the layer or the active document fails, `f`'s +/// changes are undone as well. fn on_doc( h: &Host, uid: u64, keep_selection: bool, f: impl FnOnce(&Host) -> std::result::Result, +) -> std::result::Result { + atomically(h, |h| on_doc_steps(h, uid, keep_selection, f)) +} + +/// The steps of [`on_doc`]. +fn on_doc_steps( + h: &Host, + uid: u64, + keep_selection: bool, + f: impl FnOnce(&Host) -> std::result::Result, ) -> std::result::Result { let (index, active, before, layer) = { let s = h.session.borrow(); @@ -1452,6 +1472,11 @@ fn items_typename(h: &Host, a: &[Data]) -> Answer { Ok(text("PageItems")) } +fn items_to_string(h: &Host, a: &[Data]) -> Answer { + items_doc(h, a)?; + Ok(text("[PageItems]")) +} + fn items_parent(h: &Host, a: &[Data]) -> Answer { let doc = items_doc(h, a)?; Ok(doc_ref(h, doc.uid)) @@ -1654,9 +1679,9 @@ fn item_set_opacity(h: &Host, a: &[Data]) -> Answer { if !(0.0..=100.0).contains(&v) { return Err(HostError::Range("opacity must be from 0 to 100".into())); } - // A value the getter reports for the item's opacity sends the opacity it has, and - // `object.setProps` finds the no-op itself: an opacity a graph mark or label already has still - // replaces the one the graph keeps for its series or kind. + // A value the getter reports for the item's opacity runs no command, unless the item is a graph + // mark or label whose graph keeps another opacity for its series or kind: then the opacity the + // item has is sent, and replaces the one the graph keeps. // The opacity the item already has may be assigned while its layer is hidden or locked, unless // it would still replace the opacity a graph keeps for the item's series or kind. let item = this_item(h, a)?; @@ -1671,7 +1696,7 @@ fn item_set_opacity(h: &Host, a: &[Data]) -> Answer { if now.is_none() || keeps_other { refuse_in_closed_layer(h, item)?; } - set_props(h, a, |_| false, json!({"opacity": now.unwrap_or(v)})) + set_props(h, a, |_| now.is_some() && !keeps_other, json!({"opacity": now.unwrap_or(v)})) } fn item_selected(h: &Host, a: &[Data]) -> Answer { @@ -1717,6 +1742,31 @@ fn item_visible(h: &Host, a: &[Data]) -> Answer { bounds(h, a, true) } +/// `controlBounds`: the visible bounds, grown to hold the control points of the item's paths. +fn item_control(h: &Host, a: &[Data]) -> Answer { + let item = this_item(h, a)?; + let (r, f) = with_doc(h, item.doc, |_, st| { + let control = st.doc.node(item.id).and_then(control_points_box); + Ok::<_, HostError>((vectorcraft_geom::union_opt(st.doc.bounds_of(&[item.id], true), control), frame(st)?)) + })?; + match r { + Some(r) => Ok(f.bounds(h.dom.coords.get(), r)), + None => Ok(Data::Array(vec![num(0.0), num(0.0), num(0.0), num(0.0)])), + } +} + +/// The box of the control points of the paths in `n`, the visible members of its groups and +/// compound paths included; none for other art. +fn control_points_box(n: &crate::doc::Node) -> Option { + match &n.kind { + NodeKind::Path { path, .. } => path.control_bounds(), + NodeKind::Group { .. } | NodeKind::Compound { .. } => { + n.children()?.iter().filter(|c| c.visible).fold(None, |acc, c| vectorcraft_geom::union_opt(acc, control_points_box(c))) + } + _ => None, + } +} + fn item_position(h: &Host, a: &[Data]) -> Answer { let item = this_item(h, a)?; match item_rect(h, item, false)? { @@ -1895,13 +1945,13 @@ fn destination(h: &Host, item: Item, target: &Data, how: &Data) -> std::result:: let how = placement_of(how)?; let beside = matches!(how, Placement::Above | Placement::Below); let handle = handle_of(target, "PageItem").or_else(|| handle_of(target, "Layer")); - let Some(&[run, uid, high, low]) = handle.as_deref() else { + let Some(&[run, uid, reverts, high, low]) = handle.as_deref() else { if handle_of(target, "Document").is_some() { return Err(HostError::Error("a document as the relative object is not available yet".into())); } return Err(HostError::Type("the relative object must be a page item or a layer".into())); }; - let doc = find_doc(h, run, uid).ok_or_else(|| HostError::Error(STALE_ITEM.into()))?; + let doc = find_doc_of_object(h, run, uid, reverts).ok_or_else(|| HostError::Error(STALE_ITEM.into()))?; if doc.uid != item.doc.uid { return Err(HostError::Error(CROSS_DOCUMENT.into())); } @@ -2069,8 +2119,8 @@ fn item_z_order(h: &Host, a: &[Data]) -> Answer { fn layer_name(h: &Host, a: &[Data]) -> Answer { let Some(handle) = handle_of(arg(a, 0), "Layer") else { return Err(HostError::Type("this is not a Layer".into())) }; - let [run, uid, high, low] = handle.as_slice() else { return Err(HostError::Type("this is not a Layer".into())) }; - let doc = find_doc(h, *run, *uid).ok_or_else(|| HostError::Error(STALE_DOCUMENT.into()))?; + let [run, uid, reverts, high, low] = handle.as_slice() else { return Err(HostError::Type("this is not a Layer".into())) }; + let doc = find_doc_of_object(h, *run, *uid, *reverts).ok_or_else(|| HostError::Error(STALE_DOCUMENT.into()))?; let id = id_of(*high, *low).unwrap_or(NodeId(u64::MAX)); with_doc(h, doc, |_, st| st.doc.node(id).map(|n| text(n.name.clone().unwrap_or_default())).ok_or_else(|| HostError::Error(STALE_ITEM.into()))) } @@ -2223,7 +2273,7 @@ pub(super) fn install(realm: &mut Realm, link: &Link) -> std::result::Result<(), ("index", method(l, items_index)), ("getByName", method(l, items_by_name)), ("removeAll", method(l, items_remove_all)), - ("toString", class_text("PageItems")), + ("toString", method(l, items_to_string)), ]), Some(function(l, items_at)), )); @@ -2243,7 +2293,7 @@ pub(super) fn install(realm: &mut Realm, link: &Link) -> std::result::Result<(), ("height", property(l, item_height, item_set_height)), ("geometricBounds", get(l, item_geometric)), ("visibleBounds", get(l, item_visible)), - ("controlBounds", get(l, item_visible)), + ("controlBounds", get(l, item_control)), ("editable", get(l, item_editable)), ("zOrderPosition", get(l, item_z_order_position)), ("duplicate", method(l, item_duplicate)), diff --git a/crates/engine/src/store.rs b/crates/engine/src/store.rs index 7afab7426d..703597dc45 100644 --- a/crates/engine/src/store.rs +++ b/crates/engine/src/store.rs @@ -187,6 +187,52 @@ fn read_past_cap(path: &Path, max: u64) -> std::io::Result> { Ok(bytes) } +/// What [`read_capped_plain`] tells a path that is not a plain file. +pub(crate) const NOT_PLAIN: &str = "not a plain file"; + +/// The content of `path` when it is a plain file of at most `max` bytes. The file is opened without +/// following a link at `path` (on Windows a junction or other reparse point is opened itself), and +/// its kind and bytes are read from that open file, so a link put at `path` after an earlier check +/// is refused with [`NOT_PLAIN`] rather than read. +pub(crate) fn read_capped_plain(path: &Path, max: u64) -> Result, String> { + let file = open_no_link(path).map_err(|e| match std::fs::symlink_metadata(path) { + Ok(m) if !m.file_type().is_file() || reparse_point(&m) => NOT_PLAIN.to_string(), + _ => e.to_string(), + })?; + let m = file.metadata().map_err(|e| e.to_string())?; + if !m.file_type().is_file() || reparse_point(&m) { + return Err(NOT_PLAIN.to_string()); + } + let mut bytes = vec![]; + file.take(max + 1).read_to_end(&mut bytes).map_err(|e| e.to_string())?; + if bytes.len() as u64 > max { + return Err(too_large(max)); + } + Ok(bytes) +} + +/// `path` opened for reading, without following a link there. A pipe put in its place does not hold +/// the open up. +#[cfg(unix)] +fn open_no_link(path: &Path) -> std::io::Result { + use std::os::unix::fs::OpenOptionsExt; + let flags = rustix::fs::OFlags::NOFOLLOW | rustix::fs::OFlags::NONBLOCK; + std::fs::OpenOptions::new().read(true).custom_flags(flags.bits() as i32).open(path) +} + +/// `path` opened for reading; a link or junction there is opened itself, not its target. +#[cfg(windows)] +fn open_no_link(path: &Path) -> std::io::Result { + use std::os::windows::fs::OpenOptionsExt; + const FILE_FLAG_OPEN_REPARSE_POINT: u32 = 0x0020_0000; + std::fs::OpenOptions::new().read(true).custom_flags(FILE_FLAG_OPEN_REPARSE_POINT).open(path) +} + +#[cfg(not(any(unix, windows)))] +fn open_no_link(path: &Path) -> std::io::Result { + std::fs::File::open(path) +} + /// What a file over its cap is told (a detail after the file's name, in the log or an error). fn too_large(max: u64) -> String { format!("larger than {max} bytes") diff --git a/crates/engine/src/tests/script_dom.rs b/crates/engine/src/tests/script_dom.rs index 4deef14b04..516992c07e 100644 --- a/crates/engine/src/tests/script_dom.rs +++ b/crates/engine/src/tests/script_dom.rs @@ -155,6 +155,27 @@ fn page_item_size_setters_on_a_rotated_object_give_the_page_aligned_size() { assert_eq!(format!("{:?}", s.active().unwrap().doc.node(b)), other, "the other object stays as it was"); } +/// `controlBounds` holds a curve's handles, which reach past the curve; for a rectangle it is the +/// visible bounds. +#[test] +fn control_bounds_hold_the_handles_of_a_curve() { + let (mut s, _, _) = doc(); + s.execute("path.create", &json!({"d": "M100 200 C100 100 200 100 200 200"})).unwrap(); + let out = log( + &mut s, + "var p = app.activeDocument.pageItems, c = p[0], r = p[1];\ + function h(b) { return b[1] - b[3]; }\ + vc.log([h(c.visibleBounds), h(c.controlBounds), c.controlBounds[0] <= c.visibleBounds[0]]);\ + vc.log(String(r.controlBounds) === String(r.visibleBounds));", + ); + let heights = out[0].as_array().unwrap(); + let (visible, control) = (heights[0].as_f64().unwrap(), heights[1].as_f64().unwrap()); + // The curve rises 75 pt and its handles 100 pt; half the stroke's weight reaches above the curve. + assert!(control - visible > 20.0 && control - visible <= 25.0 + 1e-6, "{out:?}"); + assert_eq!(heights[2], json!(true), "{out:?}"); + assert_eq!(out[1], json!(true), "{out:?}"); +} + #[test] fn convert_coordinate_pair_is_inverse_and_y_up() { let mut s = Session::new(); @@ -270,6 +291,7 @@ fn assigning_the_reported_opacity_changes_nothing() { assert_eq!(out, vec![json!(33.3333)]); assert_eq!(s.active().unwrap().doc.node(a).unwrap().opacity, before); assert_eq!(undo_steps(&s), steps); + assert_eq!(s.script_report().unwrap()["slowestCommands"], json!([]), "the assignment runs no command"); // A value close to the reported one but not equal to it is still applied. s.execute("object.setProps", &json!({"id": a.0, "opacity": 50})).unwrap(); let (before, steps) = (s.active().unwrap().doc.node(a).unwrap().opacity, undo_steps(&s)); @@ -285,6 +307,14 @@ fn selection_assignment_is_atomic_across_invalid_items() { let e = failure(&mut s, "var p = app.activeDocument.pageItems; app.activeDocument.selection = [p[0], p[1]];"); assert!(e.contains("Cannot select PathItem"), "{e}"); assert!(s.active().unwrap().selection.objects.is_empty()); + // With the valid item first and the error caught, the run sees the selection unchanged. + let out = log( + &mut s, + "var d = app.activeDocument, p = d.pageItems; try { d.selection = [p[1], p[0]]; vc.log('assigned'); }\ + catch (e) { vc.log(String(e).indexOf('Cannot select PathItem') >= 0); } vc.log(d.selection.length);", + ); + assert_eq!(out, vec![json!(true), json!(0)]); + assert!(s.active().unwrap().selection.objects.is_empty()); s.execute("object.setProps", &json!({"ids": [b.0], "locked": false})).unwrap(); let out = log( &mut s, @@ -680,9 +710,13 @@ fn a_listed_preset_keeps_more_rows_than_artboards() { fn stale_documents_throw_on_every_member() { let (mut s, _, _) = doc(); run(&mut s, "#targetengine keep\nvar d = app.activeDocument, p = d.pageItems, l = p[0].parent;").unwrap(); - for (member, message) in - [("d.typename", "Stale document"), ("d.parent", "Stale document"), ("p.typename", "Stale document"), ("l.typename", "Stale")] - { + for (member, message) in [ + ("d.typename", "Stale document"), + ("d.parent", "Stale document"), + ("p.typename", "Stale document"), + ("p.toString()", "Stale document"), + ("l.typename", "Stale"), + ] { let e = failure(&mut s, &format!("#targetengine keep\n{member};")); assert!(e.contains(message), "{member}: {e}"); } @@ -1192,6 +1226,27 @@ fn wrappers_go_stale_after_delete_and_undo() { assert!(e.contains("Stale page item"), "{e}"); } +/// Reverting a document reads its objects again from its file, so the page items and layers taken +/// before the revert are stale, even where the file has an object under the same id. +#[test] +fn page_items_and_layers_go_stale_when_their_document_is_reverted() { + let (mut s, _, _) = doc(); + let path = std::env::temp_dir().join(format!("vc-dom-revert-{}.{}", std::process::id(), vectorcraft_format::EXTENSION)); + s.execute("document.save", &json!({"path": path.to_string_lossy()})).unwrap(); + for (taken, read, message) in [("p[0]", "i.name", "Stale page item"), ("p[0].parent", "i.typename", "Stale")] { + let source = format!("var p = app.activeDocument.pageItems, i = {taken}; p[1].name = 'x'; vc.run('file.revert', {{}}); {read};"); + let e = failure(&mut s, &source); + assert!(e.contains(message), "{taken}: {e}"); + } + let out = log( + &mut s, + "app.activeDocument.pageItems[1].name = 'x'; vc.run('file.revert', {}); var p = app.activeDocument.pageItems;\ + vc.log([p.length, p[0].typename, p[1].name]);", + ); + assert_eq!(out, vec![json!([2, "PathItem", ""])]); + let _ = std::fs::remove_file(path); +} + #[test] fn remove_all_refuses_locked_art_before_deleting_anything() { let (mut s, a, b) = doc(); @@ -1199,6 +1254,14 @@ fn remove_all_refuses_locked_art_before_deleting_anything() { let e = failure(&mut s, "app.activeDocument.pageItems.removeAll();"); assert!(e.contains(&b.0.to_string()), "{e}"); assert_eq!(s.active().unwrap().doc.layers[0].children().unwrap().len(), 2); + // With the error caught, the run that goes on still has both objects. + let out = log( + &mut s, + "var p = app.activeDocument.pageItems; try { p.removeAll(); vc.log('removed'); }\ + catch (e) { vc.log(String(e).indexOf('cannot delete hidden or locked objects') >= 0); } vc.log(p.length);", + ); + assert_eq!(out, vec![json!(true), json!(2)]); + assert_eq!(s.active().unwrap().doc.layers[0].children().unwrap().len(), 2); s.execute("object.setProps", &json!({"ids": [b.0], "locked": false})).unwrap(); // A locked object inside an unlocked group stops it too. s.execute("select.set", &json!({"ids": [a.0, b.0]})).unwrap(); @@ -1345,8 +1408,9 @@ fn get_is_file_open_cannot_probe_outside_script_scope() { let (mut s, _, _) = doc(); let path = std::env::temp_dir().join(format!("vc-dom-open-{}.svg", std::process::id())); s.execute("document.save", &json!({"path": path.to_string_lossy()})).unwrap(); - let p = path.to_string_lossy().replace('\\', "\\\\"); - let query = format!("vc.log(app.getIsFileOpen('{p}')); vc.log(app.getIsFileOpen('{p}.other'));"); + let p = path.to_string_lossy(); + let (saved, other) = (json!(p), json!(format!("{p}.other"))); + let query = format!("vc.log(app.getIsFileOpen({saved})); vc.log(app.getIsFileOpen({other}));"); let out = log(&mut s, &query); assert_eq!(out, vec![json!(true), json!(false)]); // Read roots that leave out the document's file: the same path does not count. @@ -1652,6 +1716,9 @@ fn a_collection_read_with_a_name_gives_the_named_object() { vc.log(m);", ); assert_eq!(out, vec![json!([true, "n", true, false, true]), json!([true, true, false]), json!(["Not found", "Not found"])]); + // A name the collection inherits is not looked up as an object's name when it is assigned. + let out = log(&mut s, "Object.prototype.tag = 1; var p = app.activeDocument.pageItems; p.tag = 2; vc.log(p.tag);"); + assert_eq!(out, vec![json!(1)]); } /// `opacity`, `hidden`, `locked` and the position and size setters on an object in a hidden or diff --git a/crates/engine/src/tests/store.rs b/crates/engine/src/tests/store.rs index 21967473bb..dfc603dc59 100644 --- a/crates/engine/src/tests/store.rs +++ b/crates/engine/src/tests/store.rs @@ -157,6 +157,24 @@ fn a_write_reads_the_file_it_replaces_only_one_byte_past_the_new_length() { assert!(holds(&[][..], &[])); } +#[cfg(unix)] +#[test] +fn a_plain_capped_read_refuses_a_link_and_reads_a_plain_file() { + use crate::store::{NOT_PLAIN, read_capped_plain}; + let root = fresh_dir("plain-read"); + let target = root.join("target.bin"); + std::fs::write(&target, b"outside").unwrap(); + let link = root.join("profile.vectorcraft"); + std::os::unix::fs::symlink(&target, &link).unwrap(); + assert_eq!(read_capped_plain(&link, 100), Err(NOT_PLAIN.to_string())); + let folder = root.join("folder"); + std::fs::create_dir(&folder).unwrap(); + assert_eq!(read_capped_plain(&folder, 100), Err(NOT_PLAIN.to_string())); + assert_eq!(read_capped_plain(&target, 100), Ok(b"outside".to_vec())); + assert_eq!(read_capped_plain(&target, 7), Ok(b"outside".to_vec())); + assert!(read_capped_plain(&target, 6).is_err()); +} + #[test] fn a_saved_preset_replaces_an_oversized_file_in_its_place() { let root = fresh_dir("oversized-put"); diff --git a/crates/engine/tests/it/script_host_vs_scriptcheck.rs b/crates/engine/tests/it/script_host_vs_scriptcheck.rs index 4368ce29b7..aacf3017d5 100644 --- a/crates/engine/tests/it/script_host_vs_scriptcheck.rs +++ b/crates/engine/tests/it/script_host_vs_scriptcheck.rs @@ -83,7 +83,7 @@ const INSIDE: &[(&str, &str)] = &[ ( "Application.prototype.", "activeDocument activeDocument= beep beep= constructor coordinateSystem coordinateSystem= documents getIsFileOpen \ - selection selection= toString typename", + selection selection= selectTool toString typename", ), ("DocumentPreset.", "prototype"), ( diff --git a/crates/js/src/host_classes.rs b/crates/js/src/host_classes.rs index 206f781ef3..a25e0e531a 100644 --- a/crates/js/src/host_classes.rs +++ b/crates/js/src/host_classes.rs @@ -91,6 +91,9 @@ pub(crate) struct Entry { parent: Option, /// The names of the members `hasOwnProperty` reports: every member but the unavailable ones. own: Rc>, + /// The names of the unavailable members, which hide a member of the same name that a parent + /// class has. + unavailable: Rc>, } impl Entry { @@ -143,7 +146,8 @@ pub fn host_ref_parts(d: &Data) -> Option<(&str, Vec)> { impl Interp { /// Whether `k` is a member that `hasOwnProperty` reports on `id`: `id` is an object of a host - /// class, and `k` names an available member of that class or of a class it descends from. + /// class, and `k` names an available member of the nearest class that declares `k`, that class + /// or one it descends from. pub(crate) fn is_host_member(&self, id: ObjId, k: &[u16]) -> JsResult { let Class::Host(h) = &self.object(id)?.class else { return Ok(false) }; let mut class = Some(h.class); @@ -152,6 +156,9 @@ impl Interp { if e.own.contains(k) { return Ok(true); } + if e.unavailable.contains(k) { + return Ok(false); + } class = e.parent; } Ok(false) @@ -307,7 +314,7 @@ fn install_class(i: &mut Interp, class: HostClass) -> JsResult<()> { let r = fill_class(i, proto, &class); i.temp_roots.truncate(mark); let ctor = r?; - let members = class.members.iter().filter(|(_, m)| !matches!(m, HostMember::Unavailable(_))).map(|(name, _)| key(name)).collect(); + let (unavailable, members): (Vec<_>, Vec<_>) = class.members.iter().partition(|(_, m)| matches!(m, HostMember::Unavailable(_))); i.host_classes.push(Entry { name: class.name.as_str().into(), proto, @@ -315,7 +322,8 @@ fn install_class(i: &mut Interp, class: HostClass) -> JsResult<()> { index: class.index, family, parent: parent_class, - own: Rc::new(members), + own: Rc::new(members.into_iter().map(|(name, _)| key(name)).collect()), + unavailable: Rc::new(unavailable.into_iter().map(|(name, _)| key(name)).collect()), }); let global = i.global; i.define(global, key(&class.name), Prop::Data { value: Value::Object(ctor), flags: crate::heap::HIDDEN }) diff --git a/crates/js/src/host_tests.rs b/crates/js/src/host_tests.rs index ba0e005ce0..ce695b7e06 100644 --- a/crates/js/src/host_tests.rs +++ b/crates/js/src/host_tests.rs @@ -717,6 +717,25 @@ fn objects_of_a_host_class_report_its_available_members_as_their_own() { ); } +#[test] +fn an_unavailable_member_hides_the_member_its_parent_class_has() { + let mut r = realm(1_000_000); + let value: HostFunction = Rc::new(|_| Ok(Data::Number(1.0))); + let missing: HostFunction = Rc::new(|_| Err(HostError::Error("not here yet".into()))); + let class = |name: &str, parent: Option<&str>, member: HostMember| HostClass { + name: name.into(), + parent: parent.map(Into::into), + members: vec![("size".to_string(), member)], + index: None, + construct: None, + }; + let classes = vec![class("Base", None, HostMember::Get(value)), class("Leaf", Some("Base"), HostMember::Unavailable(missing))]; + let objects = vec![("it".into(), host_ref("Leaf", &[1.0])), ("base".into(), host_ref("Base", &[2.0]))]; + r.define_host_classes(classes, objects).unwrap(); + r.start("[it.hasOwnProperty('size'), it.propertyIsEnumerable('size'), base.hasOwnProperty('size')].join()").unwrap(); + assert_eq!(finish(&mut r, 1_000_000).0.unwrap(), JsValue::String("false,false,true".into())); +} + #[test] fn a_converted_function_reads_each_argument_as_its_list_says() { let mut r = realm(1_000_000); diff --git a/crates/js/src/interp.rs b/crates/js/src/interp.rs index f7cb2896a2..f10f0e9566 100644 --- a/crates/js/src/interp.rs +++ b/crates/js/src/interp.rs @@ -1859,16 +1859,17 @@ impl Interp { None => {} } let proto = self.object(id)?.proto; - match proto.map(|p| self.find_property(p, &k)).transpose()?.flatten() { + let inherited = match proto.map(|p| self.find_property(p, &k)).transpose()?.flatten() { Some(Prop::Accessor { set: Some(s), .. }) => return self.call(&Value::Object(s), &Value::Object(id), &[v]).map(drop), Some(Prop::Accessor { set: None, .. }) => return self.reject(throw, &k, "it has only a getter"), Some(Prop::Data { flags, .. }) if flags & WRITABLE == 0 => return self.reject(throw, &k, "it is read-only"), - _ => {} - } + found => found.is_some(), + }; if !self.object(id)?.extensible { - // A name that an object of a host class with an indexer lacks is read with the indexer - // first, so assigning it throws what reading it throws. - if array_index(&k).is_none() + // A name that an object of a host class with an indexer lacks, on it and its prototypes, + // is read with the indexer first, so assigning it throws what reading it throws. + if !inherited + && array_index(&k).is_none() && let Some(f) = self.host_indexer(id)? { self.host_index(&f, id, Self::indexer_key(&k), false)?; diff --git a/docs/mcp.md b/docs/mcp.md index 6902e16314..e221d601d1 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2709,7 +2709,7 @@ app through the global object `vc`, and writes to the Script Console and runs ot or removes only that object, as `select.add` and `select.toggle` do, and the other objects stay selected as they were), `opacity` (0 to 100), `position`, `left`, `top`, `width`, `height`, `geometricBounds`, `visibleBounds`, `controlBounds` (the - visible bounds), `editable` (false for an object that is hidden or locked, in a hidden or locked layer or group, + visible bounds, grown to hold the control points of the object's paths), `editable` (false for an object that is hidden or locked, in a hidden or locked layer or group, or on a locked artboard), `zOrderPosition`, `duplicate(relativeObject?, insertionLocation?)`, `move(relativeObject, insertionLocation?)`, `remove()` and `zOrder(method)` (https://ai-scripting.docsforadobe.dev/jsobjref/GroupItem/). `move` runs `node.move`, and `duplicate` runs @@ -2761,8 +2761,9 @@ app through the global object `vc`, and writes to the Script Console and runs ot for kinds the help pages give no class. Each change runs a command and joins the run's one undo step for each changed document. A value that changes nothing runs no command, and a change to another document leaves the active tab as it was. A command that selects the objects it changes leaves the current layer and the highlighted Layers - panel rows as they were before the change. A bad value throws an error and changes nothing. An object that was - deleted, or that a named engine kept from an earlier run, throws `Stale page item`. `remove()` on an object that + panel rows as they were before the change. A bad value throws an error and changes nothing. A page item that was + deleted, or that a named engine kept from an earlier run, throws `Stale page item`, and a document or a page item + collection that a named engine kept from an earlier run throws `Stale document`. `remove()` on an object that is hidden or locked, is inside a hidden or locked layer or group, or is a group that holds one, and `removeAll()` when any object is, throw `cannot delete hidden or locked objects` and delete nothing. `remove()` on an object on a locked artboard, and `removeAll()` when any object is on one, throw `cannot delete objects on a locked artboard` diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 7d6ec78683..db38ae94f7 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1033,7 +1033,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Synthetic input validates complete gestures before queue mutation: at most 256 drag steps, 16 clicks and 1,024 pending events; up to 64 control requests per frame, with later requests retained for the next frame (#1709). - The control server writes each reply through a 64 KiB buffer. On Windows 11 it sends the 17 MB `document.inspect` reply of a document with 50,000 objects on one layer to a client over loopback in 0.09 s instead of 34 s. - Scripts: File › Scripts › Other Script… and `script.run` run a JavaScript file against the open documents as one transaction with one undo step for each changed document. A failed or stopped run puts every document back. `crates/engine/src/tests/script_run.rs`. - - Scripts: the global `app` gives the open documents, new documents from a startup preset and a `DocumentPreset`, the active document, each document's selection and its page items with their names, notes, visibility, lock, opacity, position, size, bounds and stacking order, and moves and copies them into or beside other objects, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/Application/, https://ai-scripting.docsforadobe.dev/jsobjref/Documents/, https://ai-scripting.docsforadobe.dev/jsobjref/DocumentPreset/, https://ai-scripting.docsforadobe.dev/jsobjref/Document/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItems/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItem/ and https://ai-scripting.docsforadobe.dev/jsobjref/GroupItem/ describe them; each change runs a command inside the run's transaction (`docs/mcp.md`). A script can check a member with `hasOwnProperty`, and can read a collection by name and name `activeDocument`, `documents` and `selection` without `app.` (https://ai-scripting.docsforadobe.dev/scriptingJavascript/objectReferences/). `app.selectTool(name)` makes the named tool the current tool when the run ends (https://community.adobe.com/questions-652/what-s-new-in-illustrator-scripting-cc2020-769942). Layers, paths, type and the other classes are not there yet. `crates/engine/src/tests/script_dom.rs`. + - Scripts: the global `app` gives the open documents, new documents from a startup preset and a `DocumentPreset`, the active document, each document's selection and its page items with their names, notes, visibility, lock, opacity, position, size, bounds and stacking order, and moves and copies them into or beside other objects, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/Application/, https://ai-scripting.docsforadobe.dev/jsobjref/Documents/, https://ai-scripting.docsforadobe.dev/jsobjref/DocumentPreset/, https://ai-scripting.docsforadobe.dev/jsobjref/Document/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItems/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItem/ and https://ai-scripting.docsforadobe.dev/jsobjref/GroupItem/ describe them; each change runs a command inside the run's transaction (`docs/mcp.md`). A script can check a member with `hasOwnProperty`, and can read a collection by name and name `activeDocument`, `documents` and `selection` without `app.` (https://ai-scripting.docsforadobe.dev/scriptingJavascript/objectReferences/). `app.selectTool(name)` makes the named tool the current tool when the run ends without an error (https://community.adobe.com/questions-652/what-s-new-in-illustrator-scripting-cc2020-769942). Layers, paths, type and the other classes are not there yet. `crates/engine/src/tests/script_dom.rs`. - Scripts: Window › Script Console shows each run's `$.write` and `$.writeln` output, `vc.log` entries, uncaught error with the script's name, line and column, and a report of its time, host calls and slowest commands, keeping at most 2,048 lines and counting the lines it dropped. `script.run`'s report carries the same data, and `script.console`, `script.console.clear` and `ui.copyScriptConsole` read, clear and copy it. `crates/engine/src/tests/script_console.rs`. - Scripts: the status bar translates its own words around a failed run's error and the app's own error messages, and shows text the script threw itself (a value, an error it made, or an error whose name or message it changed) as it is, even when that text reads like one of the app's messages. `script.run`'s report gives `messageOrigin` (`script` or `built-in`), and the advice about objects other applications give their scripts follows only the app's own reference errors. VectorCraft's own rule. `crates/js/src/interp_tests.rs`, `crates/engine/src/tests/script_run.rs`, `crates/ui-egui/src/chrome/tests.rs`. - Scripts: the `$` object has the other members the Dollar object page lists (https://extendscript.docsforadobe.dev/extendscript-tools-features/dollar-object/), from `$.about()` to `$.version`, and scripts have the global `localize(object, ...values)` (https://extendscript.docsforadobe.dev/extendscript-tools-features/localizing-extendscript-strings/), `toSource(value)` and `Object.prototype.toSource()`. Each run starts with the interface's locale, and what a script changes in `$` lasts only for that run. `crates/engine/src/tests/script_dollar.rs`, `crates/js/src/extension_tests.rs`. From 4021d27d5a9d71269baf7107e4d8e92a8e3015eb Mon Sep 17 00:00:00 2001 From: yoriswind Date: Thu, 26 Nov 2026 11:27:37 -0800 Subject: [PATCH 004/105] Format the native layer appearance regressions --- crates/ui-egui/src/panels/layers/tests.rs | 31 +++++++++++++++-------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/crates/ui-egui/src/panels/layers/tests.rs b/crates/ui-egui/src/panels/layers/tests.rs index 6ca4cefe9c..29ea72202a 100644 --- a/crates/ui-egui/src/panels/layers/tests.rs +++ b/crates/ui-egui/src/panels/layers/tests.rs @@ -797,10 +797,13 @@ fn appearance_diamond(shape: &egui::Shape) -> Option<(egui::Pos2, f32, f32)> { fn target_marks_painted(panel: &mut crate::tests::panel_harness::Panel, name: &str) -> Vec<(f32, bool, f32)> { let center = panel.rect(name).center(); let (shapes, _) = panel.paint_at(1.0); - let ink = shapes.iter().find_map(|shape| match shape { - egui::Shape::Circle(circle) if circle.center.distance(center) < 0.01 && (circle.radius - 5.0).abs() < 1e-4 => Some(circle.stroke.color), - _ => None, - }).expect("the cell's outer target ring"); + let ink = shapes + .iter() + .find_map(|shape| match shape { + egui::Shape::Circle(circle) if circle.center.distance(center) < 0.01 && (circle.radius - 5.0).abs() < 1e-4 => Some(circle.stroke.color), + _ => None, + }) + .expect("the cell's outer target ring"); for shape in &shapes { if appearance_diamond(shape).is_some_and(|(at, _, _)| at.distance(center) < 0.01) && let egui::Shape::Path(path) = shape @@ -809,11 +812,17 @@ fn target_marks_painted(panel: &mut crate::tests::panel_harness::Panel, name: &s assert_eq!(path.stroke.kind, egui::StrokeKind::Middle, "the diamond's stroke is centered on its outline"); } } - let mut marks: Vec<_> = shapes.iter().filter_map(|shape| match shape { - egui::Shape::Circle(circle) if circle.center.distance(center) < 0.01 && circle.radius < 5.0 - && circle.fill == egui::Color32::TRANSPARENT => Some((circle.radius, false, circle.stroke.width)), - shape => appearance_diamond(shape).filter(|(at, _, _)| at.distance(center) < 0.01).map(|(_, r, width)| (r, true, width)), - }).collect(); + let mut marks: Vec<_> = shapes + .iter() + .filter_map(|shape| match shape { + egui::Shape::Circle(circle) + if circle.center.distance(center) < 0.01 && circle.radius < 5.0 && circle.fill == egui::Color32::TRANSPARENT => + { + Some((circle.radius, false, circle.stroke.width)) + } + shape => appearance_diamond(shape).filter(|(at, _, _)| at.distance(center) < 0.01).map(|(_, r, width)| (r, true, width)), + }) + .collect(); marks.sort_by(|a, b| a.0.total_cmp(&b.0)); marks } @@ -845,7 +854,9 @@ fn a_targeted_circle_with_an_appearance_shows_both_ring_and_dot() { assert!((alone.0 - 2.5).abs() < 1e-4); let looks = [&neither, &targeted, &styled, &both]; for (i, x) in looks.iter().enumerate() { - for y in &looks[i + 1..] { assert_ne!(x, y, "all four actual cell looks differ"); } + for y in &looks[i + 1..] { + assert_ne!(x, y, "all four actual cell looks differ"); + } } } From f26086c58b2f0bf08ccfa2fe9cb8acc4c3a861c5 Mon Sep 17 00:00:00 2001 From: yoriswind Date: Thu, 26 Nov 2026 12:30:14 -0800 Subject: [PATCH 005/105] Describe the hollow diamond in current Layers feature rows --- docs/roadmap.md | 2 +- docs/target-app-parity.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/roadmap.md b/docs/roadmap.md index f8ada20777..b4f19e07a8 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -188,7 +188,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | # | Milestone | Status | Est. remaining, one agent (h) | |---|---|---|---| | M0 | Skeleton + vertical slice | ✅ done | — | -| M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (a targeted Layers item with an appearance of its own shows its inner ring around a smaller appearance dot (#8711); path and compound-path interior selection follows enabled fill rows (#6625); a marquee leaves locked or hidden guide paths out inside groups, as clicks do (#8538); hidden-fill and no-fill stroke cap/join CPU regressions passed; document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them); Layers own appearance has a hollow diamond and tooltip distinct from targeting/selection (#8710), retaining Hassan1305's #8757 ring-visibility fix; validation pending | 4–6 | +| M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (a targeted Layers item with an appearance of its own shows its inner ring around a smaller hollow diamond (#8711); path and compound-path interior selection follows enabled fill rows (#6625); a marquee leaves locked or hidden guide paths out inside groups, as clicks do (#8538); hidden-fill and no-fill stroke cap/join CPU regressions passed; document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them); Layers own appearance has a hollow diamond and tooltip distinct from targeting/selection (#8710), retaining Hassan1305's #8757 ring-visibility fix; validation pending | 4–6 | | M2 | Drawing tools + smart guides | ✅ mostly done (Eraser preserves fill outside fixed and varied tip sweeps and Alt-drag marquees on fill-only open paths and keeps their compound holes; clipping masks retain surviving contours or empty geometry in the same node; ordinary Group/Layer paints and evaluated gradient placements are preserved when the stored paint reproduces their appearance; hidden Rasterize and Along/Across stroke rows do not block visible gradients; replacement-art effects, plug-ins/Rasterize, along/across-stroke gradients and placements that cannot be reproduced keep their existing fitting; stroked open paths retain main behavior (#6582); #3380 deletion creates independent selected path pieces and keeps bounds-fitted gradients in place; endpoint highlighting remains open; Polygon/Star exact-size count persistence, with repeated-drag, tool-switch and Cancel regression coverage; Curvature point markers without direction handles (#1236, in part); Direct Selection segment click/Delete preserves neighboring edges, #1278; Flare, Reshape, Live Corners widget dragging and per-corner radii and kinds landed, on any path's corners; Shaper rough-shape recognition and orientation steps, the remaining Pen modifier nuances; Shaper Groups with editable sources and separate fill/stroke edits landed; custom ruler origin with drag preview, active-artboard reset, relative X/Y fields and native round-trip (#1212); construction widget/refinements pending); a shape just drawn moves by its centre point and turns from the zone outside a corner with its tool still active (#5477); Tangent and straight-segment perpendicular snapping use saved Smart Guides Geometric Guides preferences and Control bar quick access (#2537), including the existing Snap to Glyph and Alignment Guides toggles (#6164); no View submenu; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123); Scissors hover and cuts use the Pen's path/align/intersect/anchor snaps, with Alt Add Anchor and cut endpoint selection retained (#6470); Scissors previews the current anchor or curve cut point (#8655) | 12–18 | | M3 | Paint & appearance (swatches, color, gradient, stroke, appearance, transparency, styles) | ✅ done (M3.7–M3.98): swatches, groups, libraries, tints, Lab spots and Registration; Eyedropper copies transformed character dimensions (#6404) and styles highlighted text only (atomic transparency rejection); Eyedropper reads visible locked and outside-isolation sources (#1251); Color Picker, Color panel (its spectrum grows with a resized panel, #8005), Color Guide, Color Themes, Edit Colors and Recolor Artwork (screen-bounded Edit chip list, #3416; native Lab entry and swatch libraries in the picker, Assign-row menus, #8031/#4028; Recolor with Preset asks whether to limit the colors to a swatch library first); gradients that follow every transform, the annotator, linked stops, freeform gradients, focal points, gradients on strokes and Expand; visible strokes when paint is added to inherited None/zero-width art (#1253); stroke geometry, arrowheads, dashes fitted to corners, stroke on type, width profiles and the Width tool (Shift-double-click enables adjoining adjustment in Width Point Edit; finite-arithmetic follow-up regressions and full CI passed ([Validation evidence](target-app-parity.md#evidence-what-ships-today-by-area))), Scale Strokes and preview bounds; Appearance targeting, container appearance, target circles, Expand Appearance; knockout, isolation, blend accuracy, CMYK blending, overprint, Attributes, masks and clipping, Flatten Transparency; graphic styles, links and libraries; CSS library export preserves fractional linear and radial gradient stop positions. Left: freeform gradients in SVG/PDF, mixed spot/process gradients in SVG and PDF gradients mixing a spot color with RGB or Lab stops export as stops or process colors; PDF export writes dithered gradient fills with spot stops, and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, as images in process colors; confirm the Scale Strokes & Effects default; Recolor model selection is available through the engine and MCP only (#2520); the dialog retains its existing controls; Library panels' lists (swatch, Color Book, brush, symbol and graphic style libraries) fill a taller panel above its footer (#2992; scores and estimates unchanged); Graphic Styles list fills a taller panel above its footer (#2992; scores and estimates unchanged); Swatches list fills a taller panel above its footer (#1638; `the_list_fills_a_tall_panel_above_its_footer`; scores and estimates unchanged); | 4–8 | | M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths (#8128; estimates unchanged); Production Preflight checks fonts, overflow, links and image resolution with clickable findings and automatic rechecking (VectorCraft addition; estimates unchanged); PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; a `TJ` over more than 65 lines (the 64 its fill pass finished, kept back, and the open one) stays a filled object and a stroked one for each part (#8543; estimates unchanged); PDF import: type filled and stroked after a page of type filled only (more than 64 lines) comes in as one filled and stroked type object again, with or without a path between, and a `TJ` over more lines than are kept with a glyph kept as an outline still stays a filled object and a stroked one for each part (#8549 follow-up; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index e0c7ac9998..c763d8e4b6 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -796,7 +796,7 @@ since 2026-10-01. - **Ctrl/Cmd-click and Shift-click on Layers panel target circles (#8639):** the target circles follow the same modifier rules as the row names, as the help page describes for selecting objects in the Layers panel: Shift for adjacent objects, Ctrl or Command for non-adjacent ones ([Move objects to different layers](https://helpx.adobe.com/illustrator/desktop/manage-layers/create-and-organize-layers/move-objects-to-different-layers.html)). Ctrl/Cmd-click adds the item (a layer: its art) to the selection or takes it out, which Shift-click did before (#913); Shift-click selects the art of every row from the last circle clicked (else the targeted row) to this one, and Shift+Ctrl/Cmd-click adds it (`layer.target {range, add?}`). Hidden or locked art and art outside the isolated group in the range is left out, and nothing stays targeted. Regression tests: `clicking_a_target_circle_targets_the_layer` and `shift_clicking_a_target_circle_selects_a_range_of_rows` in `crates/ui-egui/src/panels/layers/tests.rs`. - **Shift-click in the Layers panel's selection column selects the art of a range of rows:** after a selection square is clicked, Shift-clicking another selects the art of every row listed from the last square clicked to this one, down or up and across sublayers and groups, and Shift+Ctrl/Cmd-click adds that art to the selection (`layer.selectAll {range, add?}`). Hidden and locked rows and art outside the isolated group are left out, and a range does not move where the next Shift-click starts. Ctrl/Cmd-click adds one row's art or takes it out, and so does Shift-click before any square was clicked. The panel menu's Select Art of Highlighted Rows (`layer.selectHighlighted`) selects the art of the highlighted rows by the same rules. These are VectorCraft's own rules. Regression tests: `shift_clicking_a_selection_square_selects_the_art_of_a_range_of_rows` and `shift_clicking_the_first_selection_square_adds_or_removes_one_row` in `crates/ui-egui/src/panels/layers/tests.rs`, `the_selection_column_selects_the_art_of_a_range_of_rows` and `select_highlighted_selects_the_art_of_the_highlighted_rows` in `crates/engine/src/tests/layers.rs`. - **Layers added to the selection from their target circles show as targeted (#8646):** with several items picked from their circles (nothing targeted), a layer or sublayer's circle shows its inner ring while all of its visible, unlocked art is selected, as an object's circle does while the object is selected. A layer is never selected itself, only its art, so its circle used to keep a single ring. Regression test: `a_layer_added_from_its_target_circle_shows_as_targeted` in `crates/ui-egui/src/panels/layers/tests.rs`. -- **A targeted item with an appearance of its own shows both marks (#8711):** its target circle keeps the inner ring of a targeted item, with the appearance dot drawn smaller inside it and a gap between them, so not targeted, targeted, with an appearance and both look different, as the target icons in [Appearance attributes](https://helpx.adobe.com/illustrator/using/appearance-attributes.html) do. The dot used to cover the ring. Regression test: `a_targeted_circle_with_an_appearance_shows_both_ring_and_dot` in `crates/ui-egui/src/panels/layers/tests.rs`. +- **A targeted item with an appearance of its own shows both marks (#8711):** its target circle keeps the inner ring of a targeted item, with the hollow diamond drawn smaller inside it and a gap between them, so not targeted, targeted, with an appearance and both look different, as the target icons in [Appearance attributes](https://helpx.adobe.com/illustrator/using/appearance-attributes.html) do. The dot used to cover the ring. Regression test: `a_targeted_circle_with_an_appearance_shows_both_ring_and_dot` in `crates/ui-egui/src/panels/layers/tests.rs`. - **Selection passes through raster effects:** clicks with the Selection, Direct Selection and Group Selection tools (Group Selection's repeated click included), the Selection tool's pointer and marquee, Direct Selection's marquee, pointer and anchor highlight, and Group Selection's marquee (E for enclosed objects included) leave out the area that a drop shadow, a glow, a blur or another raster effect paints beyond an object. A click on a shadow selects the object under it, or nothing over an empty canvas, a repeated Group Selection click there adds the groups of the object under it, and a press on the shadow of a selected object does not move it ([the help page](https://helpx.adobe.com/illustrator/using/selecting-objects.html)). Over a shadow, Direct Selection highlights only the anchors of the object under it, and Group Selection keeps its own pointer and highlights no anchor, as it does everywhere (VectorCraft's own rule). No setting changes this. This covers paths, groups, type, symbol instances and images. Regression tests: `crates/engine/src/tests/select_effects.rs`. - **Symbol instances are selected where their art draws past their box:** a click or a marquee selects a symbol instance where a clipping path in its art, moved or reshaped by its live geometry effects, shows the art past the instance's box, as it selects a group of the same art; a click also selects it where a stroke in its art paints past the box ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-objects/select-objects/select-objects.html)). The rest is VectorCraft's own rule: inside the box the instance is selected as before; in Outline view and below a layer whose Preview is off only the box counts; hidden art and the area a raster effect paints are left out. This covers instances in groups, nested in other symbols' art, moved and scaled. Regression tests: `a_symbol_instance_is_hit_where_a_moved_clipping_path_in_its_art_shows_the_art` and `a_symbol_instance_is_hit_on_the_stroke_of_its_art_past_its_box` in `crates/doc/src/hit/tests.rs`. - **Selection follows geometry effects:** a click or a marquee with the selection tools selects a path or compound path where its live geometry effects (Transform, Offset Path, Roughen, Zig Zag and the other effects that reshape a path, on the object or on its fills and strokes) draw it, the copies a Transform effect makes included, and not where its own geometry no longer paints. The members of a group or layer whose own geometry effects move or reshape them are selected where they are drawn, at the depth each tool selects, and a locked member there lets the click through to what is below and is listed there in the Unlock submenu. A group's own fills and strokes are clicked where they paint its members, and a clipping path inside such a group is taken on its drawn outline before the art it clips. A compound path keeps its holes, Object Selection by Path Only takes the drawn outline and not its fill, and stacking order is kept. The selection tools select objects by clicking or by a marquee ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-objects/select-objects/select-objects.html)), and the effects leave the art they reshape editable ([the help page](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/apply-and-modify-effects.html)); where clicks land on the reshaped art is VectorCraft's own rule. In Outline view clicks and marquees use the plain paths, and in a layer with Preview off they take outlines only. The area a raster effect paints is still left out. Regression tests: `a_*_shifted_art_*`, `a_click_hits_a_paths_copy_and_evaluates_its_art_once_until_it_changes`, `a_groups_own_effect_moves_where_its_members_are_hit`, `a_layers_own_effect_moves_where_its_art_is_hit`, `a_preview_off_sublayer_of_an_effected_layer_is_clicked_in_outline`, `a_painted_group_around_an_effected_symbols_instance_is_hit_where_its_art_is_drawn`, `an_intertwine_group_in_a_layers_drawn_art_is_hit_in_its_woven_order`, `a_click_in_a_plain_group_evaluates_only_its_member_with_effects`, `a_clip_groups_own_effect_moves_where_its_mask_outline_is_hit`, `an_isolated_clip_group_with_its_own_effect_is_marqueed_by_its_members_own_geometry` and `a_clip_groups_art_is_hit_when_its_drawn_art_holds_only_the_clipping_path` in `crates/doc/src/hit/tests.rs`, and `a_click_and_a_marquee_select_art_where_its_transform_effect_draws_it`, `a_click_selects_a_group_where_its_own_fill_paints_a_moved_member`, `a_marquee_takes_an_inner_groups_own_fill_inside_a_painted_group` and `a_marquee_takes_a_groups_own_fill_inside_a_painted_layer` in `crates/engine/src/tests/select_effects.rs`. From 07378009102db84ab7221fa2f6742047088675d2 Mon Sep 17 00:00:00 2001 From: yoriswind Date: Thu, 26 Nov 2026 12:55:01 -0800 Subject: [PATCH 006/105] test: assert Layers target button pressed state --- crates/ui-egui/src/panels/layers/tests.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/panels/layers/tests.rs b/crates/ui-egui/src/panels/layers/tests.rs index 29ea72202a..205a9d0f74 100644 --- a/crates/ui-egui/src/panels/layers/tests.rs +++ b/crates/ui-egui/src/panels/layers/tests.rs @@ -882,7 +882,7 @@ fn appearance_marker_names_its_state_and_keeps_targeting_actions() { let active = "Target appearance: targeted, additional appearance or transparency"; assert_eq!(panel.description("Target A").as_deref(), Some(idle)); assert_eq!(panel.description("Target B").as_deref(), Some("Target appearance: not targeted, basic appearance")); - assert!(!panel.selected("Target A")); + assert_eq!(panel.toggled("Target A"), Some(craft::behavior::Mixed::Same(false))); let before = { let app = panel.app(); (app.session.active().unwrap().selection.clone(), undo_len(&app)) @@ -899,11 +899,11 @@ fn appearance_marker_names_its_state_and_keeps_targeting_actions() { panel.click("Target A"); assert_eq!(targeted(&panel.app()), (Some(a), vec![a])); assert_eq!(panel.description("Target A").as_deref(), Some(active)); - assert!(panel.selected("Target A")); + assert_eq!(panel.toggled("Target A"), Some(craft::behavior::Mixed::Same(true))); panel.click("Target B"); assert_eq!(panel.description("Target A").as_deref(), Some(idle)); assert_eq!(panel.description("Target B").as_deref(), Some("Target appearance: targeted, basic appearance")); - assert!(panel.selected("Target B")); + assert_eq!(panel.toggled("Target B"), Some(craft::behavior::Mixed::Same(true))); assert!(target_marks_painted(&mut panel, "Target A").iter().any(|m| m.1), "the appearance stays after targeting other art"); } From d48ea9a3c06ebdf5d2b567cc255483066ece432a Mon Sep 17 00:00:00 2001 From: yoriswind Date: Thu, 26 Nov 2026 13:03:54 -0800 Subject: [PATCH 007/105] Remove the unused test selection helper --- crates/ui-egui/src/tests/panel_harness.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/crates/ui-egui/src/tests/panel_harness.rs b/crates/ui-egui/src/tests/panel_harness.rs index 7251c04291..b596f3a1c8 100644 --- a/crates/ui-egui/src/tests/panel_harness.rs +++ b/crates/ui-egui/src/tests/panel_harness.rs @@ -378,11 +378,6 @@ impl Panel { tree.keys().into_iter().any(|key| tree.value_of(key).is_some_and(&matches)) } - /// Whether the control named `name` reports selected state. - pub(crate) fn selected(&self, name: &str) -> bool { - self.fixture.tree().selected_of(self.look(name).node).unwrap_or(false) - } - /// The toggle state of the control named `name`. // PLAN: assumed the facade re-exports the behavior crate's `Mixed` as `craft::behavior::Mixed`. pub(crate) fn toggled(&self, name: &str) -> Option> { From 53c57248adb0c1c926a3a677978c7eac0b21c5d1 Mon Sep 17 00:00:00 2001 From: yoriswind Date: Thu, 26 Nov 2026 15:02:33 -0800 Subject: [PATCH 008/105] Use the current stroke paint API in Properties --- crates/ui-egui/src/panels/properties/appearance_section.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/panels/properties/appearance_section.rs b/crates/ui-egui/src/panels/properties/appearance_section.rs index cd71a0f035..e2ae112143 100644 --- a/crates/ui-egui/src/panels/properties/appearance_section.rs +++ b/crates/ui-egui/src/panels/properties/appearance_section.rs @@ -102,7 +102,7 @@ fn effect_delete(app: &mut VectorcraftApp, ui: &mut Ui, id: NodeId, effects: &[( /// active Appearance row in `PropertiesUi::edited_profiled`. False while the Type tool edits text or /// the Live Paint Bucket is active, when the list edits the stroke the panel shows. fn edited_strokes_profiled(app: &mut VectorcraftApp) -> bool { - if panels::character::text_editing(app).is_some() || app.session.bucket_paints() { + if panels::character::text_editing(app).is_some() || app.session.tool_paints(true) { return false; } let Some(st) = app.session.active() else { return false }; From eb1407217f2e3c72fe66587ba21bbc1f0a019505 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Thu, 19 Nov 2026 17:05:55 +0000 Subject: [PATCH 009/105] feat: Object > Step and Repeat for print-and-cut sheets Grid or fill-sheet layout with per-axis gaps measured on a chosen cut path, optional 180-degree alternation of columns or rows, scriptable as object.stepAndRepeat. --- crates/engine/src/cmd.rs | 2 + crates/engine/src/cmd/plugin_call/reviewed.rs | 1 + crates/engine/src/cmd/stepandrepeat.rs | 214 ++++++++++++++++++ crates/engine/src/cmd/stepandrepeat/tests.rs | 132 +++++++++++ crates/ui-egui/src/dialogs.rs | 1 + crates/ui-egui/src/dialogs/object_dialogs.rs | 6 +- .../src/dialogs/rearrange_artboards.rs | 2 +- crates/ui-egui/src/dialogs/step_repeat.rs | 147 ++++++++++++ crates/ui-egui/src/menus/tree.rs | 1 + 9 files changed, 504 insertions(+), 2 deletions(-) create mode 100644 crates/engine/src/cmd/stepandrepeat.rs create mode 100644 crates/engine/src/cmd/stepandrepeat/tests.rs create mode 100644 crates/ui-egui/src/dialogs/step_repeat.rs diff --git a/crates/engine/src/cmd.rs b/crates/engine/src/cmd.rs index 009fc4efd8..17132f9b5a 100644 --- a/crates/engine/src/cmd.rs +++ b/crates/engine/src/cmd.rs @@ -109,6 +109,7 @@ mod textedit; pub use textedit::effective_kerning; mod retype; +mod stepandrepeat; pub mod textstyles; pub(crate) mod textwrap; pub(crate) mod threads; @@ -325,6 +326,7 @@ pub fn command_specs() -> &'static [CommandSpec] { v.extend(layerpanel::specs()); v.extend(draw2::specs()); v.extend(xform::specs()); + v.extend(stepandrepeat::specs()); v.extend(effectcmd::specs()); v.extend(bevels::specs()); v.extend(wireframe::specs()); diff --git a/crates/engine/src/cmd/plugin_call/reviewed.rs b/crates/engine/src/cmd/plugin_call/reviewed.rs index 612cf436b7..b4ffedbd77 100644 --- a/crates/engine/src/cmd/plugin_call/reviewed.rs +++ b/crates/engine/src/cmd/plugin_call/reviewed.rs @@ -415,6 +415,7 @@ pub(super) const ALLOWED: &[&str] = &[ "object.textWrap.release", "object.transform", "object.transformAgain", + "object.stepAndRepeat", "object.transformEach", "object.ungroup", "object.unlockAll", diff --git a/crates/engine/src/cmd/stepandrepeat.rs b/crates/engine/src/cmd/stepandrepeat.rs new file mode 100644 index 0000000000..cc66e04a69 --- /dev/null +++ b/crates/engine/src/cmd/stepandrepeat.rs @@ -0,0 +1,214 @@ +//! Object › Step and Repeat: lays out copies of the selection on a grid or fills a sheet, for +//! print-and-cut work (stickers, labels). + +use serde_json::{Value, json}; +use vectorcraft_geom::{Rect, Vec2, rotate_deg}; + +use super::edit::{copy_above, selected_roots}; +use super::object::group_nodes; +use super::{Affine, CommandSpec, NodeId, Result, Session, bad, check_numbers, check_switches, cmd, has_selection, switch_or}; +use crate::EngineError; +use vectorcraft_doc::Scaling; + +const CMD: &str = "object.stepAndRepeat"; +const MAX_CELLS: usize = 10_000; +const EPS: f64 = 1e-9; + +pub fn specs() -> Vec { + vec![cmd!( + "object.stepAndRepeat", + "Step and Repeat…", + ["Object", "Transform"], + None, + "{rows?: n (default 1), columns?: n (default 1), fill?: bool (rows and columns are as many as fit the sheet, ignoring `rows` and `columns`; the first copy goes to the sheet's top-left corner plus `margin`), sheet?: {x, y, width, height} (pt; default the artboard that holds the selection's center, else the first), margin?: pt (fill only, default 0), gap?: pt (between neighbors, both axes), gapX?: pt, gapY?: pt (default `gap`, default 0; measured between the bounds of `cutPath`, else of the selection, not between centers), cutPath?: id (a selected object whose geometric bounds measure the spacing and the 180° turn; default the selection), rotate?: \"none\"|\"columns\"|\"rows\" (turn every other column or row by 180° about its cell's center; default none), patterns?: bool} copy the selection into a grid of cells, left to right and top to bottom, the first cell being the selection itself (moved to the sheet's corner with fill); a selection of several objects is grouped first, so that a cut contour stays with its artwork in every copy; one undo step; the copies are selected → {ids: [id…], rows, columns, count}", + has_selection, + step_and_repeat + )] +} + +/// Which cells of the grid are turned by 180°. +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +pub enum Alternate { + None, + Columns, + Rows, +} + +/// One cell of a layout: its place in the grid, the offset of its top-left corner from the first +/// cell's, and whether its copy is turned by 180° about the cell's center. +#[derive(Clone, Copy, PartialEq, Debug)] +pub struct Cell { + pub row: usize, + pub col: usize, + pub dx: f64, + pub dy: f64, + pub turned: bool, +} + +/// How many items of `size` with `gap` between them fit in `room` (all at least 0). +pub fn fit_count(room: f64, size: f64, gap: f64) -> usize { + if !(room.is_finite() && size.is_finite() && gap.is_finite()) || size <= 0.0 || room < size - EPS { + return 0; + } + (((room + gap) / (size + gap)) + EPS).floor().max(0.0) as usize +} + +/// The `(rows, columns)` of items `w` × `h` with gaps `gx`, `gy` that fit a sheet `sw` × `sh` +/// inside `margin` on every side. +pub fn fill_counts(sw: f64, sh: f64, margin: f64, w: f64, h: f64, gx: f64, gy: f64) -> (usize, usize) { + let m = margin.max(0.0); + (fit_count(sh - 2.0 * m, h, gy), fit_count(sw - 2.0 * m, w, gx)) +} + +/// The cells of a `rows` × `cols` grid of items `w` × `h` with gaps `gx` between columns and `gy` +/// between rows, in reading order. +pub fn layout(w: f64, h: f64, gx: f64, gy: f64, rows: usize, cols: usize, alt: Alternate) -> Vec { + (0..rows) + .flat_map(|row| (0..cols).map(move |col| (row, col))) + .map(|(row, col)| Cell { + row, + col, + dx: col as f64 * (w + gx), + dy: row as f64 * (h + gy), + turned: match alt { + Alternate::None => false, + Alternate::Columns => col % 2 == 1, + Alternate::Rows => row % 2 == 1, + }, + }) + .collect() +} + +fn count_param(p: &Value, key: &str) -> Result { + match p.get(key).filter(|v| !v.is_null()) { + None => Ok(1), + Some(v) => v + .as_u64() + .filter(|n| (1..=MAX_CELLS as u64).contains(n)) + .map(|n| n as usize) + .ok_or_else(|| bad(CMD, format!("`{key}` must be a whole number from 1 to {MAX_CELLS}"))), + } +} + +fn sheet_param(p: &Value) -> Result> { + let Some(v) = p.get("sheet").filter(|v| !v.is_null()) else { return Ok(None) }; + let n = |k: &str| v.get(k).and_then(Value::as_f64).filter(|x| x.is_finite()).ok_or_else(|| bad(CMD, format!("`sheet.{k}` must be a number"))); + let (x, y, w, h) = (n("x")?, n("y")?, n("width")?, n("height")?); + if w <= 0.0 || h <= 0.0 { + return Err(bad(CMD, "`sheet` needs a positive width and height")); + } + Ok(Some(Rect::new(x, y, x + w, y + h))) +} + +fn step_and_repeat(s: &mut Session, p: &Value) -> Result { + check_numbers(p, &["gap", "gapX", "gapY", "margin"], CMD)?; + check_switches(p, &["patterns"], CMD)?; + let fill = switch_or(p, "fill", false, CMD)?; + let alt = match p.get("rotate").filter(|v| !v.is_null()) { + None => Alternate::None, + Some(v) => match v.as_str() { + Some("none") => Alternate::None, + Some("columns") => Alternate::Columns, + Some("rows") => Alternate::Rows, + _ => return Err(bad(CMD, "`rotate` must be \"none\", \"columns\" or \"rows\"")), + }, + }; + let gap = super::f64_or(p, "gap", 0.0); + let (gx, gy) = (super::f64_or(p, "gapX", gap), super::f64_or(p, "gapY", gap)); + let margin = super::f64_or(p, "margin", 0.0); + if !(gx.is_finite() && gy.is_finite() && margin.is_finite()) { + return Err(bad(CMD, "gaps and margin must be finite")); + } + let (rows, cols) = (count_param(p, "rows")?, count_param(p, "columns")?); + let sheet = sheet_param(p)?; + let mut roots = selected_roots(s)?; + if roots.is_empty() { + return Err(EngineError::Other("nothing selected".into())); + } + let d = &s.doc()?.doc; + let cut = match p.get("cutPath").filter(|v| !v.is_null()) { + None => None, + Some(v) => { + let id = NodeId(v.as_u64().ok_or_else(|| bad(CMD, "`cutPath` must be an object id"))?); + let held = roots.iter().filter_map(|r| d.node(*r)).any(|n| { + let mut found = false; + n.walk(&mut |c| found |= c.id == id); + found + }); + if !held { + return Err(bad(CMD, "`cutPath` must be part of the selection")); + } + Some(id) + } + }; + let measured = cut.map_or_else(|| roots.clone(), |id| vec![id]); + let b = d.bounds_of(&measured, false); + let b = b.ok_or_else(|| EngineError::Other("the selection has no bounds".into()))?; + let (w, h) = (b.width(), b.height()); + if !(w.is_finite() && h.is_finite()) || w <= 0.0 || h <= 0.0 { + return Err(EngineError::Other("the selection has no area to repeat".into())); + } + let anchor = if fill { + let sheet = sheet.or_else(|| { + let c = b.center(); + d.artboards.iter().find(|a| a.rect.contains(c)).or_else(|| d.artboards.first()).map(|a| a.rect) + }); + let sheet = sheet.ok_or_else(|| EngineError::Other("no sheet to fill".into()))?; + Some((sheet, margin.max(0.0))) + } else { + None + }; + let (rows, cols) = match anchor { + Some((sh, m)) => fill_counts(sh.width(), sh.height(), m, w, h, gx, gy), + None => (rows, cols), + }; + if rows == 0 || cols == 0 { + return Err(EngineError::Other("the selection does not fit the sheet".into())); + } + if rows.saturating_mul(cols) > MAX_CELLS { + return Err(bad(CMD, format!("more than {MAX_CELLS} copies"))); + } + let origin = anchor.map_or(Vec2::ZERO, |(sh, m)| Vec2::new(sh.x0 + m - b.x0, sh.y0 + m - b.y0)); + let cells = layout(w, h, gx, gy, rows, cols, alt); + let center = b.center().to_vec2(); + let place = |c: &Cell| -> Affine { + let t = Affine::translate(origin + Vec2::new(c.dx, c.dy)); + if c.turned { t * Affine::translate(center) * rotate_deg(180.0) * Affine::translate(-center) } else { t } + }; + let sc = Scaling { patterns: super::object::transform_patterns(s, p, &roots)?, ..Scaling::default() }; + let ids = s.edit("Step and Repeat", |d, sel| { + if roots.len() > 1 { + roots = vec![group_nodes(d, &roots)?]; + } + let mut copied: Vec = vec![]; + let mut first = Affine::IDENTITY; + for c in &cells { + let m = place(c); + if c.row == 0 && c.col == 0 { + first = m; + continue; + } + let copies = copy_above(d, &roots, |_, _, n| { + n.transform(m, sc); + super::object::keep_pixel_aligned(n, sc); + })?; + copied.extend(copies); + } + if first != Affine::IDENTITY { + for id in &roots { + if let Some(n) = d.node_mut(*id) { + n.transform(first, sc); + super::object::keep_pixel_aligned(n, sc); + } + } + } + let mut out: Vec = roots.clone(); + out.extend(copied); + sel.set(out.iter().copied()); + Ok(out) + })?; + Ok(json!({ "ids": ids.iter().map(|i| i.0).collect::>(), "rows": rows, "columns": cols, "count": ids.len() })) +} + +#[cfg(test)] +mod tests; diff --git a/crates/engine/src/cmd/stepandrepeat/tests.rs b/crates/engine/src/cmd/stepandrepeat/tests.rs new file mode 100644 index 0000000000..e2addab74b --- /dev/null +++ b/crates/engine/src/cmd/stepandrepeat/tests.rs @@ -0,0 +1,132 @@ +use serde_json::json; + +use super::*; + +const A4: (f64, f64) = (210.0, 297.0); + +#[test] +fn fills_a4_with_50_by_30_items_and_3_gap() { + assert_eq!(fill_counts(A4.0, A4.1, 0.0, 50.0, 30.0, 3.0, 3.0), (9, 4)); + assert_eq!(fill_counts(A4.0, A4.1, 5.0, 50.0, 30.0, 3.0, 3.0), (8, 3)); + assert_eq!(fill_counts(40.0, 297.0, 0.0, 50.0, 30.0, 3.0, 3.0), (9, 0)); +} + +#[test] +fn layout_places_cells_at_the_pitch_and_alternates_rotation() { + let c = layout(50.0, 30.0, 3.0, 3.0, 9, 4, Alternate::Columns); + assert_eq!(c.len(), 36); + let at = |r: usize, k: usize| c[r * 4 + k]; + assert_eq!((at(0, 0).dx, at(0, 0).dy), (0.0, 0.0)); + assert_eq!((at(2, 3).dx, at(2, 3).dy), (159.0, 66.0)); + assert_eq!(c.iter().filter(|c| c.turned).count(), 18); + assert!(at(4, 1).turned && at(4, 3).turned && !at(4, 0).turned && !at(4, 2).turned); + let rows = layout(50.0, 30.0, 3.0, 3.0, 3, 2, Alternate::Rows); + assert_eq!(rows.iter().map(|c| c.turned).collect::>(), [false, false, true, true, false, false]); + assert!(layout(50.0, 30.0, 3.0, 3.0, 3, 2, Alternate::None).iter().all(|c| !c.turned)); +} + +fn setup() -> (Session, u64) { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 210, "height": 297})).unwrap(); + let id = s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 50, "height": 30})).unwrap()["id"].as_u64().unwrap(); + (s, id) +} + +fn bounds(s: &Session, id: u64) -> (f64, f64, f64, f64) { + let b = s.doc().unwrap().doc.node(NodeId(id)).unwrap().geometric_bounds().unwrap(); + (b.x0, b.y0, b.x1, b.y1) +} + +fn undo_steps(s: &Session) -> usize { + s.doc().unwrap().history.undo.len() +} + +#[test] +fn creates_the_grid_in_one_undo_step_and_undoes_cleanly() { + let (mut s, _) = setup(); + let (before, steps) = (s.doc().unwrap().doc.clone(), undo_steps(&s)); + let r = s.execute(CMD, &json!({"rows": 2, "columns": 3, "gap": 3})).unwrap(); + assert_eq!((r["count"].clone(), r["rows"].clone(), r["columns"].clone()), (json!(6), json!(2), json!(3))); + assert_eq!(undo_steps(&s), steps + 1); + let ids: Vec = r["ids"].as_array().unwrap().iter().map(|i| i.as_u64().unwrap()).collect(); + assert_eq!(bounds(&s, ids[0]), (0.0, 0.0, 50.0, 30.0)); + assert_eq!(bounds(&s, ids[4]), (53.0, 33.0, 103.0, 63.0)); + assert_eq!(bounds(&s, ids[5]), (106.0, 33.0, 156.0, 63.0)); + s.execute("edit.undo", &json!({})).unwrap(); + assert_eq!(undo_steps(&s), steps); + let d = &s.doc().unwrap().doc; + assert_eq!(d.artboards.len(), before.artboards.len()); + assert!(d.node(NodeId(ids[0])).is_some()); + assert!(ids[1..].iter().all(|i| d.node(NodeId(*i)).is_none())); +} + +#[test] +fn fill_sheet_with_margin_moves_the_first_copy_to_the_corner() { + let (mut s, _) = setup(); + let r = s.execute(CMD, &json!({"fill": true, "gap": 3, "margin": 0})).unwrap(); + assert_eq!((r["rows"].clone(), r["columns"].clone(), r["count"].clone()), (json!(9), json!(4), json!(36))); + let (mut s, _) = setup(); + let r = s.execute(CMD, &json!({"fill": true, "gap": 3, "margin": 5})).unwrap(); + assert_eq!(r["count"], json!(24)); + let first = r["ids"][0].as_u64().unwrap(); + assert_eq!(bounds(&s, first), (5.0, 5.0, 55.0, 35.0)); +} + +#[test] +fn fill_places_every_cell_from_the_original_when_it_starts_away_from_the_margin() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 210, "height": 297})).unwrap(); + s.execute("shape.rectangle", &json!({"x": 20, "y": 40, "width": 50, "height": 30})).unwrap(); + let r = s.execute(CMD, &json!({"fill": true, "gap": 3, "margin": 5, "rotate": "columns"})).unwrap(); + let ids: Vec = r["ids"].as_array().unwrap().iter().map(|i| i.as_u64().unwrap()).collect(); + assert_eq!((r["rows"].clone(), r["columns"].clone()), (json!(8), json!(3))); + assert_eq!(bounds(&s, ids[0]), (5.0, 5.0, 55.0, 35.0)); + assert_eq!(bounds(&s, ids[1]), (58.0, 5.0, 108.0, 35.0)); + assert_eq!(bounds(&s, ids[2]), (111.0, 5.0, 161.0, 35.0)); + assert_eq!(bounds(&s, ids[3]), (5.0, 38.0, 55.0, 68.0)); +} + +#[test] +fn alternate_columns_turn_by_180_degrees_about_the_cell_center() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 210, "height": 297})).unwrap(); + let id = s.execute("shape.polygon", &json!({"cx": 25, "cy": 15, "radius": 10, "sides": 3})).unwrap()["id"].as_u64().unwrap(); + let b0 = bounds(&s, id); + let r = s.execute(CMD, &json!({"rows": 1, "columns": 2, "gap": 4, "rotate": "columns"})).unwrap(); + let ids: Vec = r["ids"].as_array().unwrap().iter().map(|i| i.as_u64().unwrap()).collect(); + let (w, b1) = (b0.2 - b0.0, bounds(&s, ids[1])); + assert!((b1.0 - (b0.0 + w + 4.0)).abs() < 1e-6 && ((b1.2 - b1.0) - w).abs() < 1e-6); + assert!((b1.1 - b0.1).abs() < 1e-6 && (b1.3 - b0.3).abs() < 1e-6); + let tri = |s: &Session, id: u64| format!("{:?}", s.doc().unwrap().doc.node(NodeId(id)).unwrap().kind); + assert_ne!(tri(&s, ids[0]), tri(&s, ids[1])); +} + +#[test] +fn a_cut_contour_stays_grouped_with_its_artwork_in_every_copy() { + let (mut s, art) = setup(); + let cut = s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 50, "height": 30})).unwrap()["id"].as_u64().unwrap(); + s.execute("select.set", &json!({"ids": [art, cut]})).unwrap(); + let r = s.execute(CMD, &json!({"rows": 1, "columns": 3, "gap": 2, "cutPath": cut})).unwrap(); + assert_eq!(r["count"], json!(3)); + let d = &s.doc().unwrap().doc; + for id in r["ids"].as_array().unwrap() { + let n = d.node(NodeId(id.as_u64().unwrap())).unwrap(); + assert!(matches!(n.kind, vectorcraft_doc::NodeKind::Group { .. })); + let mut paths = 0; + n.walk(&mut |c| paths += usize::from(matches!(c.kind, vectorcraft_doc::NodeKind::Path { .. }))); + assert_eq!(paths, 2); + } +} + +#[test] +fn rejects_bad_params_and_a_selection_that_does_not_fit() { + let (mut s, _) = setup(); + assert!(s.execute(CMD, &json!({"rows": 0})).is_err()); + assert!(s.execute(CMD, &json!({"rows": 1000, "columns": 1000})).is_err()); + assert!(s.execute(CMD, &json!({"rotate": "diagonal"})).is_err()); + assert!(s.execute(CMD, &json!({"cutPath": 999999})).is_err()); + assert!(s.execute(CMD, &json!({"fill": true, "sheet": {"x": 0, "y": 0, "width": 40, "height": 40}})).is_err()); + let mut e = Session::new(); + e.execute("file.new", &json!({"width": 100, "height": 100})).unwrap(); + assert!(e.execute(CMD, &json!({})).is_err()); +} diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 0e5e2100ba..8046049528 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -146,6 +146,7 @@ pub mod shortcut_import; pub(crate) mod simplify_slider; pub mod slices; pub mod smart_punctuation; +pub mod step_repeat; pub(crate) mod smooth_slider; pub mod spot_colors; pub mod svg_filter; diff --git a/crates/ui-egui/src/dialogs/object_dialogs.rs b/crates/ui-egui/src/dialogs/object_dialogs.rs index df0c1be3ed..ee26844185 100644 --- a/crates/ui-egui/src/dialogs/object_dialogs.rs +++ b/crates/ui-egui/src/dialogs/object_dialogs.rs @@ -4,7 +4,7 @@ use super::path_ops::PathOp; use super::simplify_slider::StripKind; use super::{ blend_options, dimension, flare_options, graph_data, graph_design, graph_type, indexed_color, live_paint_gaps, object_mosaic, option_form, - path_ops, perspective_grid, perspective_presets, saved_names, shapes, simplify_slider, slices, smooth_slider, transform, transform_each, + path_ops, perspective_grid, perspective_presets, saved_names, shapes, simplify_slider, slices, smooth_slider, step_repeat, transform, transform_each, width_point, }; use crate::VectorcraftApp; @@ -16,6 +16,8 @@ pub(crate) struct ObjectDialogs { pub transform: Option, /// The open Transform Each dialog's preview record. pub each: Option, + /// The open Step and Repeat dialog's preview record. + pub step: Option, /// The open Average, Average & Join, Offset Path and Simplify dialogs' preview records. pub path: Vec, /// The open Split Into Grid dialog's record. @@ -47,6 +49,7 @@ pub(crate) fn pump(app: &mut VectorcraftApp, ctx: &egui::Context) { sync(app); transform::pump(app, ctx); transform_each::pump(app, ctx); + step_repeat::pump(app, ctx); path_ops::pump(app, ctx); shapes::pump(app, ctx); flare_options::pump(app, ctx); @@ -75,6 +78,7 @@ pub(crate) fn open_from_menu(app: &mut VectorcraftApp, id: &str) -> bool { } match id { "object.transformEach" => transform_each::open(app), + step_repeat::CMD => step_repeat::open(app), "path.average" => path_ops::open(app, PathOp::Average), "path.averageJoin" => path_ops::open(app, PathOp::AverageJoin), "object.path.offsetPath" => path_ops::open(app, PathOp::OffsetPath), diff --git a/crates/ui-egui/src/dialogs/rearrange_artboards.rs b/crates/ui-egui/src/dialogs/rearrange_artboards.rs index 3926501a05..d567dd3363 100644 --- a/crates/ui-egui/src/dialogs/rearrange_artboards.rs +++ b/crates/ui-egui/src/dialogs/rearrange_artboards.rs @@ -110,7 +110,7 @@ impl RearrangeValues { } /// The length unit a document unit shows as. -fn length_kind(unit: Unit) -> UnitKind { +pub(super) fn length_kind(unit: Unit) -> UnitKind { match unit { Unit::Picas => UnitKind::Picas, Unit::Inches => UnitKind::Inches, diff --git a/crates/ui-egui/src/dialogs/step_repeat.rs b/crates/ui-egui/src/dialogs/step_repeat.rs new file mode 100644 index 0000000000..442c25da18 --- /dev/null +++ b/crates/ui-egui/src/dialogs/step_repeat.rs @@ -0,0 +1,147 @@ +//! Object → Step and Repeat: copies of the selection on a grid or filling a sheet, with the gaps +//! between the cut paths, every other column or row turned by 180° (`object.stepAndRepeat`), +//! previewed live on the canvas. +//! +//! Fields: `rows`, `columns`, `gapX`, `gapY` (pt), `margin` (pt), `fill` (as many as fit the +//! artboard), `rotate` (`none`, `columns` or `rows`), `cutPath` (an object of the selection, or +//! empty for the selection itself). + +use craft::ui::contract::Bind; +use craft::ui::dialog::DialogId; +use craft::ui::patterns::form_dialogs::{DialogFields, FieldValue, HostedParamDialog, Param, ParamDialog, ParamKind, ParamResult}; +use craft::ui::runtime::env::{Label, LengthUnits, UnitKind}; +use serde_json::{Map, Value, json}; + +use super::host::{HeldOptions, open_held_with}; +use super::preview::LivePreview; +use crate::VectorcraftApp; + +pub(crate) const CMD: &str = "object.stepAndRepeat"; + +pub(crate) struct Open { + pub id: DialogId, + pub preview: LivePreview, +} + +fn cut_options(app: &VectorcraftApp) -> Vec<(String, Label)> { + let mut out = vec![(String::new(), Label::from(tl!("Selection")))]; + let Some(st) = app.session.active() else { return out }; + let single = st.selection.objects.len() == 1; + for id in &st.selection.objects { + let Some(n) = st.doc.node(*id) else { continue }; + out.push((id.0.to_string(), Label::from(n.display_name()))); + if single { + for c in &n.children { + out.push((c.id.0.to_string(), Label::from(c.display_name()))); + } + } + } + out +} + +fn rows(lengths: LengthUnits, cuts: Vec<(String, Label)>) -> Vec { + let len = |key: &str, label: &'static str| Param::number(key, label, 0.0, 1.0, 2).length(lengths.clone()); + vec![ + Param::new("rows", tl!("Rows"), ParamKind::int(Some(1), Some(500), 2)).enabled_when("fill", false), + Param::new("columns", tl!("Columns"), ParamKind::int(Some(1), Some(500), 2)).enabled_when("fill", false), + len("gapX", tl!("Horizontal Gap")), + len("gapY", tl!("Vertical Gap")), + Param::new("cutPath", tl!("Cut Path"), ParamKind::choice(cuts, Some(String::new()))), + Param::new("fill", tl!("Fill the Artboard"), ParamKind::bool(false)), + len("margin", tl!("Margin")).enabled_when("fill", true), + Param::new( + "rotate", + tl!("Rotate 180°"), + ParamKind::choice( + vec![ + ("none".into(), Label::from(tl!("None"))), + ("columns".into(), Label::from(tl!("Every Other Column"))), + ("rows".into(), Label::from(tl!("Every Other Row"))), + ], + Some("none".into()), + ), + ), + ] +} + +pub fn fields() -> DialogFields { + DialogFields::from_pairs([ + ("rows", FieldValue::Int(2)), + ("columns", FieldValue::Int(2)), + ("gapX", FieldValue::Number(12.0)), + ("gapY", FieldValue::Number(12.0)), + ("margin", FieldValue::Number(0.0)), + ("fill", FieldValue::Bool(false)), + ("cutPath", FieldValue::Text(String::new())), + ("rotate", FieldValue::Text("none".into())), + ]) +} + +fn count(f: &DialogFields, key: &str) -> u64 { + f.int(key).or_else(|| f.number(key).map(|n| n as i64)).unwrap_or(1).max(1) as u64 +} + +fn params(f: &DialogFields) -> Value { + let mut p = Map::new(); + p.insert("rows".into(), json!(count(f, "rows"))); + p.insert("columns".into(), json!(count(f, "columns"))); + for k in ["gapX", "gapY", "margin"] { + p.insert(k.into(), json!(f.number(k).unwrap_or(0.0))); + } + p.insert("fill".into(), json!(f.bool("fill").unwrap_or(false))); + p.insert("rotate".into(), json!(f.text("rotate").unwrap_or("none"))); + if let Some(id) = f.text("cutPath").and_then(|t| t.parse::().ok()) { + p.insert("cutPath".into(), json!(id)); + } + Value::Object(p) +} + +pub(crate) fn open(app: &mut VectorcraftApp) -> Result { + let ctx = app.ui_ctx.clone().ok_or("no window")?; + let lengths = LengthUnits::new(UnitKind::Points, super::rearrange_artboards::length_kind(app.session.general_unit()), 72.0); + let lengths = crate::fields::bare_points(lengths, app.session.prefs.numbers_without_units_are_points); + let cuts = cut_options(app); + let dialog = HostedParamDialog::command(&ctx, CMD, fields(), move |fields| { + ParamDialog::command(CMD, tl!("Step and Repeat"), rows(lengths.clone(), cuts.clone())).previews(true).values(Bind::bound(fields)) + }); + let ok = |app: &mut VectorcraftApp, result: &ParamResult| { + let mut open = app.object_dialogs.step.take().ok_or("the dialog is closed")?; + let done = std::mem::take(&mut open.preview).commit(app, CMD, params(&result.fields)); + if done.is_err() { + app.object_dialogs.step = Some(open); + } + done.map(|_| ()) + }; + let cancel: Box = Box::new(|app| { + if let Some(open) = app.object_dialogs.step.take() { + open.preview.cancel(app); + } + }); + let id = open_held_with(app, dialog, ok, HeldOptions { cancel: Some(cancel), ..Default::default() }).ok_or("no window")?; + app.object_dialogs.step = Some(Open { id, preview: LivePreview::default() }); + Ok(Value::Null) +} + +pub(crate) fn pump(app: &mut VectorcraftApp, _ctx: &egui::Context) { + let Some(mut open) = app.object_dialogs.step.take() else { return }; + let shown = app.dialogs().and_then(|host| { + host.with(|h| h.get_by_id::(open.id).map(|d| (d.is_previewing(), params(d.fields())))) + }); + if let Some((on, p)) = shown { + let _ = open.preview.run(app, on, "Step and Repeat", CMD, &p); + } + app.object_dialogs.step = Some(open); +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn cut_path_is_sent_only_when_one_is_chosen() { + let mut f = fields(); + assert!(params(&f).get("cutPath").is_none()); + f.set("cutPath", FieldValue::Text("42".into())); + assert_eq!(params(&f)["cutPath"], json!(42)); + } +} diff --git a/crates/ui-egui/src/menus/tree.rs b/crates/ui-egui/src/menus/tree.rs index b2757b3cbd..c8f67c81d7 100644 --- a/crates/ui-egui/src/menus/tree.rs +++ b/crates/ui-egui/src/menus/tree.rs @@ -847,6 +847,7 @@ pub(super) fn transform_items() -> Vec { c("Shear…", "object.shear"), Sep, c("Transform Each…", "object.transformEach"), + c("Step and Repeat…", "object.stepAndRepeat"), Sep, c("Reset Bounding Box", "object.resetBoundingBox"), cp("Rotate Bounding Box…", "object.rotateBoundingBox", json!({"angle": 0})), From 9ddc0aef3aa42c553a61c57755ee2c5cbcb6dc79 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Wed, 25 Nov 2026 00:36:42 +0000 Subject: [PATCH 010/105] fix: step and repeat dialog on the hosted form, cut path choice, sorted review list --- crates/engine/src/cmd/plugin_call/reviewed.rs | 2 +- crates/ui-egui/src/dialogs.rs | 2 +- crates/ui-egui/src/dialogs/object_dialogs.rs | 4 ++-- crates/ui-egui/src/dialogs/step_repeat.rs | 17 ++++++++++------- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/crates/engine/src/cmd/plugin_call/reviewed.rs b/crates/engine/src/cmd/plugin_call/reviewed.rs index b4ffedbd77..cd7d1db8ae 100644 --- a/crates/engine/src/cmd/plugin_call/reviewed.rs +++ b/crates/engine/src/cmd/plugin_call/reviewed.rs @@ -405,6 +405,7 @@ pub(super) const ALLOWED: &[&str] = &[ "object.slice.release", "object.slice.select", "object.slice.setRect", + "object.stepAndRepeat", "object.tag.add", "object.tag.remove", "object.tag.removeAll", @@ -415,7 +416,6 @@ pub(super) const ALLOWED: &[&str] = &[ "object.textWrap.release", "object.transform", "object.transformAgain", - "object.stepAndRepeat", "object.transformEach", "object.ungroup", "object.unlockAll", diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 8046049528..eee24e9a47 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -146,9 +146,9 @@ pub mod shortcut_import; pub(crate) mod simplify_slider; pub mod slices; pub mod smart_punctuation; -pub mod step_repeat; pub(crate) mod smooth_slider; pub mod spot_colors; +pub mod step_repeat; pub mod svg_filter; pub(crate) mod svg_options; pub mod swatch_conflict; diff --git a/crates/ui-egui/src/dialogs/object_dialogs.rs b/crates/ui-egui/src/dialogs/object_dialogs.rs index ee26844185..4ef12e9828 100644 --- a/crates/ui-egui/src/dialogs/object_dialogs.rs +++ b/crates/ui-egui/src/dialogs/object_dialogs.rs @@ -4,8 +4,8 @@ use super::path_ops::PathOp; use super::simplify_slider::StripKind; use super::{ blend_options, dimension, flare_options, graph_data, graph_design, graph_type, indexed_color, live_paint_gaps, object_mosaic, option_form, - path_ops, perspective_grid, perspective_presets, saved_names, shapes, simplify_slider, slices, smooth_slider, step_repeat, transform, transform_each, - width_point, + path_ops, perspective_grid, perspective_presets, saved_names, shapes, simplify_slider, slices, smooth_slider, step_repeat, transform, + transform_each, width_point, }; use crate::VectorcraftApp; diff --git a/crates/ui-egui/src/dialogs/step_repeat.rs b/crates/ui-egui/src/dialogs/step_repeat.rs index 442c25da18..8828f2e172 100644 --- a/crates/ui-egui/src/dialogs/step_repeat.rs +++ b/crates/ui-egui/src/dialogs/step_repeat.rs @@ -31,7 +31,7 @@ fn cut_options(app: &VectorcraftApp) -> Vec<(String, Label)> { let Some(n) = st.doc.node(*id) else { continue }; out.push((id.0.to_string(), Label::from(n.display_name()))); if single { - for c in &n.children { + for c in n.children().into_iter().flatten() { out.push((c.id.0.to_string(), Label::from(c.display_name()))); } } @@ -40,7 +40,7 @@ fn cut_options(app: &VectorcraftApp) -> Vec<(String, Label)> { } fn rows(lengths: LengthUnits, cuts: Vec<(String, Label)>) -> Vec { - let len = |key: &str, label: &'static str| Param::number(key, label, 0.0, 1.0, 2).length(lengths.clone()); + let len = |key: &str, label: &'static str| Param::number(key, label, 0.0, 1.0, 2).length(lengths); vec![ Param::new("rows", tl!("Rows"), ParamKind::int(Some(1), Some(500), 2)).enabled_when("fill", false), Param::new("columns", tl!("Columns"), ParamKind::int(Some(1), Some(500), 2)).enabled_when("fill", false), @@ -96,13 +96,17 @@ fn params(f: &DialogFields) -> Value { Value::Object(p) } -pub(crate) fn open(app: &mut VectorcraftApp) -> Result { +pub(crate) fn open(app: &mut VectorcraftApp) { + let _ = try_open(app); +} + +fn try_open(app: &mut VectorcraftApp) -> Result { let ctx = app.ui_ctx.clone().ok_or("no window")?; let lengths = LengthUnits::new(UnitKind::Points, super::rearrange_artboards::length_kind(app.session.general_unit()), 72.0); let lengths = crate::fields::bare_points(lengths, app.session.prefs.numbers_without_units_are_points); let cuts = cut_options(app); let dialog = HostedParamDialog::command(&ctx, CMD, fields(), move |fields| { - ParamDialog::command(CMD, tl!("Step and Repeat"), rows(lengths.clone(), cuts.clone())).previews(true).values(Bind::bound(fields)) + ParamDialog::command(CMD, tl!("Step and Repeat"), rows(lengths, cuts.clone())).previews(true).values(Bind::bound(fields)) }); let ok = |app: &mut VectorcraftApp, result: &ParamResult| { let mut open = app.object_dialogs.step.take().ok_or("the dialog is closed")?; @@ -124,9 +128,8 @@ pub(crate) fn open(app: &mut VectorcraftApp) -> Result { pub(crate) fn pump(app: &mut VectorcraftApp, _ctx: &egui::Context) { let Some(mut open) = app.object_dialogs.step.take() else { return }; - let shown = app.dialogs().and_then(|host| { - host.with(|h| h.get_by_id::(open.id).map(|d| (d.is_previewing(), params(d.fields())))) - }); + let shown = + app.dialogs().and_then(|host| host.with(|h| h.get_by_id::(open.id).map(|d| (d.is_previewing(), params(d.fields()))))); if let Some((on, p)) = shown { let _ = open.preview.run(app, on, "Step and Repeat", CMD, &p); } From 8074d6fbc0cad89db688107aaebb94ea42cde631 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Wed, 25 Nov 2026 06:31:58 +0000 Subject: [PATCH 011/105] fix: say which way Step and Repeat rotate turns --- crates/engine/src/cmd/stepandrepeat.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/stepandrepeat.rs b/crates/engine/src/cmd/stepandrepeat.rs index cc66e04a69..7109d6a766 100644 --- a/crates/engine/src/cmd/stepandrepeat.rs +++ b/crates/engine/src/cmd/stepandrepeat.rs @@ -20,7 +20,7 @@ pub fn specs() -> Vec { "Step and Repeat…", ["Object", "Transform"], None, - "{rows?: n (default 1), columns?: n (default 1), fill?: bool (rows and columns are as many as fit the sheet, ignoring `rows` and `columns`; the first copy goes to the sheet's top-left corner plus `margin`), sheet?: {x, y, width, height} (pt; default the artboard that holds the selection's center, else the first), margin?: pt (fill only, default 0), gap?: pt (between neighbors, both axes), gapX?: pt, gapY?: pt (default `gap`, default 0; measured between the bounds of `cutPath`, else of the selection, not between centers), cutPath?: id (a selected object whose geometric bounds measure the spacing and the 180° turn; default the selection), rotate?: \"none\"|\"columns\"|\"rows\" (turn every other column or row by 180° about its cell's center; default none), patterns?: bool} copy the selection into a grid of cells, left to right and top to bottom, the first cell being the selection itself (moved to the sheet's corner with fill); a selection of several objects is grouped first, so that a cut contour stays with its artwork in every copy; one undo step; the copies are selected → {ids: [id…], rows, columns, count}", + "{rows?: n (default 1), columns?: n (default 1), fill?: bool (rows and columns are as many as fit the sheet, ignoring `rows` and `columns`; the first copy goes to the sheet's top-left corner plus `margin`), sheet?: {x, y, width, height} (pt; default the artboard that holds the selection's center, else the first), margin?: pt (fill only, default 0), gap?: pt (between neighbors, both axes), gapX?: pt, gapY?: pt (default `gap`, default 0; measured between the bounds of `cutPath`, else of the selection, not between centers), cutPath?: id (a selected object whose geometric bounds measure the spacing and the 180° turn; default the selection), rotate?: \"none\"|\"columns\"|\"rows\" (turn every other column or row by 180° about its cell's center, the same clockwise or counter-clockwise; default none), patterns?: bool} copy the selection into a grid of cells, left to right and top to bottom, the first cell being the selection itself (moved to the sheet's corner with fill); a selection of several objects is grouped first, so that a cut contour stays with its artwork in every copy; one undo step; the copies are selected → {ids: [id…], rows, columns, count}", has_selection, step_and_repeat )] From e5cb0d8dcaec63230fe2d50e528e8600612eea97 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Wed, 25 Nov 2026 19:09:38 +0000 Subject: [PATCH 012/105] fix: name the Step and Repeat cut object param cutId --- crates/engine/src/cmd/stepandrepeat.rs | 8 ++++---- crates/engine/src/cmd/stepandrepeat/tests.rs | 4 ++-- crates/ui-egui/src/dialogs/step_repeat.rs | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/crates/engine/src/cmd/stepandrepeat.rs b/crates/engine/src/cmd/stepandrepeat.rs index 7109d6a766..b83ebbb28a 100644 --- a/crates/engine/src/cmd/stepandrepeat.rs +++ b/crates/engine/src/cmd/stepandrepeat.rs @@ -20,7 +20,7 @@ pub fn specs() -> Vec { "Step and Repeat…", ["Object", "Transform"], None, - "{rows?: n (default 1), columns?: n (default 1), fill?: bool (rows and columns are as many as fit the sheet, ignoring `rows` and `columns`; the first copy goes to the sheet's top-left corner plus `margin`), sheet?: {x, y, width, height} (pt; default the artboard that holds the selection's center, else the first), margin?: pt (fill only, default 0), gap?: pt (between neighbors, both axes), gapX?: pt, gapY?: pt (default `gap`, default 0; measured between the bounds of `cutPath`, else of the selection, not between centers), cutPath?: id (a selected object whose geometric bounds measure the spacing and the 180° turn; default the selection), rotate?: \"none\"|\"columns\"|\"rows\" (turn every other column or row by 180° about its cell's center, the same clockwise or counter-clockwise; default none), patterns?: bool} copy the selection into a grid of cells, left to right and top to bottom, the first cell being the selection itself (moved to the sheet's corner with fill); a selection of several objects is grouped first, so that a cut contour stays with its artwork in every copy; one undo step; the copies are selected → {ids: [id…], rows, columns, count}", + "{rows?: n (default 1), columns?: n (default 1), fill?: bool (rows and columns are as many as fit the sheet, ignoring `rows` and `columns`; the first copy goes to the sheet's top-left corner plus `margin`), sheet?: {x, y, width, height} (pt; default the artboard that holds the selection's center, else the first), margin?: pt (fill only, default 0), gap?: pt (between neighbors, both axes), gapX?: pt, gapY?: pt (default `gap`, default 0; measured between the bounds of `cutId`, else of the selection, not between centers), cutId?: id (a selected object whose geometric bounds measure the spacing and the 180° turn; default the selection), rotate?: \"none\"|\"columns\"|\"rows\" (turn every other column or row by 180° about its cell's center, the same clockwise or counter-clockwise; default none), patterns?: bool} copy the selection into a grid of cells, left to right and top to bottom, the first cell being the selection itself (moved to the sheet's corner with fill); a selection of several objects is grouped first, so that a cut contour stays with its artwork in every copy; one undo step; the copies are selected → {ids: [id…], rows, columns, count}", has_selection, step_and_repeat )] @@ -126,17 +126,17 @@ fn step_and_repeat(s: &mut Session, p: &Value) -> Result { return Err(EngineError::Other("nothing selected".into())); } let d = &s.doc()?.doc; - let cut = match p.get("cutPath").filter(|v| !v.is_null()) { + let cut = match p.get("cutId").filter(|v| !v.is_null()) { None => None, Some(v) => { - let id = NodeId(v.as_u64().ok_or_else(|| bad(CMD, "`cutPath` must be an object id"))?); + let id = NodeId(v.as_u64().ok_or_else(|| bad(CMD, "`cutId` must be an object id"))?); let held = roots.iter().filter_map(|r| d.node(*r)).any(|n| { let mut found = false; n.walk(&mut |c| found |= c.id == id); found }); if !held { - return Err(bad(CMD, "`cutPath` must be part of the selection")); + return Err(bad(CMD, "`cutId` must be part of the selection")); } Some(id) } diff --git a/crates/engine/src/cmd/stepandrepeat/tests.rs b/crates/engine/src/cmd/stepandrepeat/tests.rs index e2addab74b..73948bd664 100644 --- a/crates/engine/src/cmd/stepandrepeat/tests.rs +++ b/crates/engine/src/cmd/stepandrepeat/tests.rs @@ -106,7 +106,7 @@ fn a_cut_contour_stays_grouped_with_its_artwork_in_every_copy() { let (mut s, art) = setup(); let cut = s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 50, "height": 30})).unwrap()["id"].as_u64().unwrap(); s.execute("select.set", &json!({"ids": [art, cut]})).unwrap(); - let r = s.execute(CMD, &json!({"rows": 1, "columns": 3, "gap": 2, "cutPath": cut})).unwrap(); + let r = s.execute(CMD, &json!({"rows": 1, "columns": 3, "gap": 2, "cutId": cut})).unwrap(); assert_eq!(r["count"], json!(3)); let d = &s.doc().unwrap().doc; for id in r["ids"].as_array().unwrap() { @@ -124,7 +124,7 @@ fn rejects_bad_params_and_a_selection_that_does_not_fit() { assert!(s.execute(CMD, &json!({"rows": 0})).is_err()); assert!(s.execute(CMD, &json!({"rows": 1000, "columns": 1000})).is_err()); assert!(s.execute(CMD, &json!({"rotate": "diagonal"})).is_err()); - assert!(s.execute(CMD, &json!({"cutPath": 999999})).is_err()); + assert!(s.execute(CMD, &json!({"cutId": 999999})).is_err()); assert!(s.execute(CMD, &json!({"fill": true, "sheet": {"x": 0, "y": 0, "width": 40, "height": 40}})).is_err()); let mut e = Session::new(); e.execute("file.new", &json!({"width": 100, "height": 100})).unwrap(); diff --git a/crates/ui-egui/src/dialogs/step_repeat.rs b/crates/ui-egui/src/dialogs/step_repeat.rs index 8828f2e172..b057d1b320 100644 --- a/crates/ui-egui/src/dialogs/step_repeat.rs +++ b/crates/ui-egui/src/dialogs/step_repeat.rs @@ -3,7 +3,7 @@ //! previewed live on the canvas. //! //! Fields: `rows`, `columns`, `gapX`, `gapY` (pt), `margin` (pt), `fill` (as many as fit the -//! artboard), `rotate` (`none`, `columns` or `rows`), `cutPath` (an object of the selection, or +//! artboard), `rotate` (`none`, `columns` or `rows`), `cutId` (an object of the selection, or //! empty for the selection itself). use craft::ui::contract::Bind; @@ -46,7 +46,7 @@ fn rows(lengths: LengthUnits, cuts: Vec<(String, Label)>) -> Vec { Param::new("columns", tl!("Columns"), ParamKind::int(Some(1), Some(500), 2)).enabled_when("fill", false), len("gapX", tl!("Horizontal Gap")), len("gapY", tl!("Vertical Gap")), - Param::new("cutPath", tl!("Cut Path"), ParamKind::choice(cuts, Some(String::new()))), + Param::new("cutId", tl!("Cut Path"), ParamKind::choice(cuts, Some(String::new()))), Param::new("fill", tl!("Fill the Artboard"), ParamKind::bool(false)), len("margin", tl!("Margin")).enabled_when("fill", true), Param::new( @@ -72,7 +72,7 @@ pub fn fields() -> DialogFields { ("gapY", FieldValue::Number(12.0)), ("margin", FieldValue::Number(0.0)), ("fill", FieldValue::Bool(false)), - ("cutPath", FieldValue::Text(String::new())), + ("cutId", FieldValue::Text(String::new())), ("rotate", FieldValue::Text("none".into())), ]) } @@ -90,8 +90,8 @@ fn params(f: &DialogFields) -> Value { } p.insert("fill".into(), json!(f.bool("fill").unwrap_or(false))); p.insert("rotate".into(), json!(f.text("rotate").unwrap_or("none"))); - if let Some(id) = f.text("cutPath").and_then(|t| t.parse::().ok()) { - p.insert("cutPath".into(), json!(id)); + if let Some(id) = f.text("cutId").and_then(|t| t.parse::().ok()) { + p.insert("cutId".into(), json!(id)); } Value::Object(p) } @@ -143,8 +143,8 @@ mod tests { #[test] fn cut_path_is_sent_only_when_one_is_chosen() { let mut f = fields(); - assert!(params(&f).get("cutPath").is_none()); - f.set("cutPath", FieldValue::Text("42".into())); - assert_eq!(params(&f)["cutPath"], json!(42)); + assert!(params(&f).get("cutId").is_none()); + f.set("cutId", FieldValue::Text("42".into())); + assert_eq!(params(&f)["cutId"], json!(42)); } } From 7583602d8fae63e99e714ceb256ba6c25267d106 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Sun, 29 Nov 2026 03:12:39 +0000 Subject: [PATCH 013/105] fix: step and repeat ignores counts when filling, keeps exact spacing, lists nested cut objects --- crates/engine/src/cmd/stepandrepeat.rs | 6 ++-- crates/engine/src/cmd/stepandrepeat/tests.rs | 18 ++++++++++ crates/ui-egui/src/dialogs/step_repeat.rs | 38 ++++++++++++++------ 3 files changed, 48 insertions(+), 14 deletions(-) diff --git a/crates/engine/src/cmd/stepandrepeat.rs b/crates/engine/src/cmd/stepandrepeat.rs index b83ebbb28a..27ee3504c9 100644 --- a/crates/engine/src/cmd/stepandrepeat.rs +++ b/crates/engine/src/cmd/stepandrepeat.rs @@ -20,7 +20,7 @@ pub fn specs() -> Vec { "Step and Repeat…", ["Object", "Transform"], None, - "{rows?: n (default 1), columns?: n (default 1), fill?: bool (rows and columns are as many as fit the sheet, ignoring `rows` and `columns`; the first copy goes to the sheet's top-left corner plus `margin`), sheet?: {x, y, width, height} (pt; default the artboard that holds the selection's center, else the first), margin?: pt (fill only, default 0), gap?: pt (between neighbors, both axes), gapX?: pt, gapY?: pt (default `gap`, default 0; measured between the bounds of `cutId`, else of the selection, not between centers), cutId?: id (a selected object whose geometric bounds measure the spacing and the 180° turn; default the selection), rotate?: \"none\"|\"columns\"|\"rows\" (turn every other column or row by 180° about its cell's center, the same clockwise or counter-clockwise; default none), patterns?: bool} copy the selection into a grid of cells, left to right and top to bottom, the first cell being the selection itself (moved to the sheet's corner with fill); a selection of several objects is grouped first, so that a cut contour stays with its artwork in every copy; one undo step; the copies are selected → {ids: [id…], rows, columns, count}", + "{rows?: n (default 1), columns?: n (default 1), fill?: bool (rows and columns are as many as fit the sheet, ignoring `rows` and `columns`; the first copy goes to the sheet's top-left corner plus `margin`), sheet?: {x, y, width, height} (pt; default the artboard that holds the selection's center, else the first), margin?: pt (fill only, default 0), gap?: pt (between neighbors, both axes), gapX?: pt, gapY?: pt (default `gap`, default 0; measured between the bounds of `cutId`, else of the selection, not between centers), cutId?: id (a selected object whose geometric bounds measure the spacing and the 180° turn; default the selection), rotate?: \"none\"|\"columns\"|\"rows\" (turn every other column or row by 180° about its cell's center, the same clockwise or counter-clockwise; default none), patterns?: bool} copy the selection into a grid of cells, left to right and top to bottom, the first cell being the selection itself (moved to the sheet's corner with fill); spacing is exact: copies are not snapped to the pixel grid; a selection of several objects is grouped first, so that a cut contour stays with its artwork in every copy; one undo step; the copies are selected → {ids: [id…], rows, columns, count}", has_selection, step_and_repeat )] @@ -119,7 +119,7 @@ fn step_and_repeat(s: &mut Session, p: &Value) -> Result { if !(gx.is_finite() && gy.is_finite() && margin.is_finite()) { return Err(bad(CMD, "gaps and margin must be finite")); } - let (rows, cols) = (count_param(p, "rows")?, count_param(p, "columns")?); + let (rows, cols) = if fill { (1, 1) } else { (count_param(p, "rows")?, count_param(p, "columns")?) }; let sheet = sheet_param(p)?; let mut roots = selected_roots(s)?; if roots.is_empty() { @@ -190,7 +190,6 @@ fn step_and_repeat(s: &mut Session, p: &Value) -> Result { } let copies = copy_above(d, &roots, |_, _, n| { n.transform(m, sc); - super::object::keep_pixel_aligned(n, sc); })?; copied.extend(copies); } @@ -198,7 +197,6 @@ fn step_and_repeat(s: &mut Session, p: &Value) -> Result { for id in &roots { if let Some(n) = d.node_mut(*id) { n.transform(first, sc); - super::object::keep_pixel_aligned(n, sc); } } } diff --git a/crates/engine/src/cmd/stepandrepeat/tests.rs b/crates/engine/src/cmd/stepandrepeat/tests.rs index 73948bd664..dcf5009ca5 100644 --- a/crates/engine/src/cmd/stepandrepeat/tests.rs +++ b/crates/engine/src/cmd/stepandrepeat/tests.rs @@ -130,3 +130,21 @@ fn rejects_bad_params_and_a_selection_that_does_not_fit() { e.execute("file.new", &json!({"width": 100, "height": 100})).unwrap(); assert!(e.execute(CMD, &json!({})).is_err()); } + +#[test] +fn fill_ignores_explicit_counts() { + let (mut s, _) = setup(); + let r = s.execute(CMD, &json!({"fill": true, "rows": 0, "columns": 0, "gap": 3})).unwrap(); + assert_eq!((r["rows"].clone(), r["columns"].clone()), (json!(9), json!(4))); + assert!(s.execute(CMD, &json!({"rows": 0})).is_err()); +} + +#[test] +fn a_pixel_aligned_copy_keeps_the_requested_fractional_gap() { + let (mut s, id) = setup(); + s.execute("object.setPixelAligned", &json!({"ids": [id], "on": true})).unwrap(); + let r = s.execute(CMD, &json!({"rows": 1, "columns": 3, "gapX": 0.5})).unwrap(); + let ids: Vec = r["ids"].as_array().unwrap().iter().map(|i| i.as_u64().unwrap()).collect(); + assert_eq!(bounds(&s, ids[1]).0, 50.5); + assert_eq!(bounds(&s, ids[2]).0, 101.0); +} diff --git a/crates/ui-egui/src/dialogs/step_repeat.rs b/crates/ui-egui/src/dialogs/step_repeat.rs index b057d1b320..927b344d8d 100644 --- a/crates/ui-egui/src/dialogs/step_repeat.rs +++ b/crates/ui-egui/src/dialogs/step_repeat.rs @@ -23,18 +23,20 @@ pub(crate) struct Open { pub preview: LivePreview, } +fn cut_ids(doc: &vectorcraft_doc::Document, selected: &[vectorcraft_doc::NodeId]) -> Vec<(u64, String)> { + let mut out = vec![]; + for id in selected { + if let Some(n) = doc.node(*id) { + n.walk(&mut |c| out.push((c.id.0, c.display_name()))); + } + } + out +} + fn cut_options(app: &VectorcraftApp) -> Vec<(String, Label)> { let mut out = vec![(String::new(), Label::from(tl!("Selection")))]; - let Some(st) = app.session.active() else { return out }; - let single = st.selection.objects.len() == 1; - for id in &st.selection.objects { - let Some(n) = st.doc.node(*id) else { continue }; - out.push((id.0.to_string(), Label::from(n.display_name()))); - if single { - for c in n.children().into_iter().flatten() { - out.push((c.id.0.to_string(), Label::from(c.display_name()))); - } - } + if let Some(st) = app.session.active() { + out.extend(cut_ids(&st.doc, &st.selection.objects).into_iter().map(|(id, name)| (id.to_string(), Label::from(name)))); } out } @@ -147,4 +149,20 @@ mod tests { f.set("cutId", FieldValue::Text("42".into())); assert_eq!(params(&f)["cutId"], json!(42)); } + + #[test] + fn cut_choices_reach_objects_nested_in_groups() { + let mut s = vectorcraft_engine::Session::new(); + s.execute("file.new", &json!({"width": 100, "height": 100})).unwrap(); + let a = s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap()["id"].as_u64().unwrap(); + let b = s.execute("shape.rectangle", &json!({"x": 20, "y": 0, "width": 10, "height": 10})).unwrap()["id"].as_u64().unwrap(); + s.execute("select.set", &json!({"ids": [a, b]})).unwrap(); + let inner = s.execute("object.group", &json!({})).unwrap()["id"].as_u64().unwrap(); + let c = s.execute("shape.rectangle", &json!({"x": 40, "y": 0, "width": 10, "height": 10})).unwrap()["id"].as_u64().unwrap(); + s.execute("select.set", &json!({"ids": [inner, c]})).unwrap(); + let outer = s.execute("object.group", &json!({})).unwrap()["id"].as_u64().unwrap(); + let doc = &s.doc().unwrap().doc; + let ids: Vec = cut_ids(doc, &[vectorcraft_doc::NodeId(outer)]).into_iter().map(|(i, _)| i).collect(); + assert!([outer, inner, a, b, c].iter().all(|i| ids.contains(i))); + } } From 7f821d39de46511df638852f1c089963d8e076eb Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Sun, 29 Nov 2026 06:00:33 +0000 Subject: [PATCH 014/105] test: cover fractional gaps with pixel-aligned objects, document the contract --- crates/engine/src/cmd/stepandrepeat.rs | 4 +++- crates/engine/src/cmd/stepandrepeat/tests.rs | 21 +++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/crates/engine/src/cmd/stepandrepeat.rs b/crates/engine/src/cmd/stepandrepeat.rs index 27ee3504c9..620f64a9a7 100644 --- a/crates/engine/src/cmd/stepandrepeat.rs +++ b/crates/engine/src/cmd/stepandrepeat.rs @@ -20,7 +20,7 @@ pub fn specs() -> Vec { "Step and Repeat…", ["Object", "Transform"], None, - "{rows?: n (default 1), columns?: n (default 1), fill?: bool (rows and columns are as many as fit the sheet, ignoring `rows` and `columns`; the first copy goes to the sheet's top-left corner plus `margin`), sheet?: {x, y, width, height} (pt; default the artboard that holds the selection's center, else the first), margin?: pt (fill only, default 0), gap?: pt (between neighbors, both axes), gapX?: pt, gapY?: pt (default `gap`, default 0; measured between the bounds of `cutId`, else of the selection, not between centers), cutId?: id (a selected object whose geometric bounds measure the spacing and the 180° turn; default the selection), rotate?: \"none\"|\"columns\"|\"rows\" (turn every other column or row by 180° about its cell's center, the same clockwise or counter-clockwise; default none), patterns?: bool} copy the selection into a grid of cells, left to right and top to bottom, the first cell being the selection itself (moved to the sheet's corner with fill); spacing is exact: copies are not snapped to the pixel grid; a selection of several objects is grouped first, so that a cut contour stays with its artwork in every copy; one undo step; the copies are selected → {ids: [id…], rows, columns, count}", + "{rows?: n (default 1), columns?: n (default 1), fill?: bool (rows and columns are as many as fit the sheet, ignoring `rows` and `columns`; the first copy goes to the sheet's top-left corner plus `margin`), sheet?: {x, y, width, height} (pt; default the artboard that holds the selection's center, else the first), margin?: pt (fill only, default 0), gap?: pt (between neighbors, both axes), gapX?: pt, gapY?: pt (default `gap`, default 0; measured between the bounds of `cutId`, else of the selection, not between centers), cutId?: id (a selected object whose geometric bounds measure the spacing and the 180° turn; default the selection), rotate?: \"none\"|\"columns\"|\"rows\" (turn every other column or row by 180° about its cell's center, the same clockwise or counter-clockwise; default none), patterns?: bool} copy the selection into a grid of cells, left to right and top to bottom, the first cell being the selection itself (moved to the sheet's corner with fill); copies of pixel-aligned objects stay on the pixel grid, so a fractional gap between them is rounded to it, and gaps of other objects are exact; a selection of several objects is grouped first, so that a cut contour stays with its artwork in every copy; one undo step; the copies are selected → {ids: [id…], rows, columns, count}", has_selection, step_and_repeat )] @@ -190,6 +190,7 @@ fn step_and_repeat(s: &mut Session, p: &Value) -> Result { } let copies = copy_above(d, &roots, |_, _, n| { n.transform(m, sc); + super::object::keep_pixel_aligned(n, sc); })?; copied.extend(copies); } @@ -197,6 +198,7 @@ fn step_and_repeat(s: &mut Session, p: &Value) -> Result { for id in &roots { if let Some(n) = d.node_mut(*id) { n.transform(first, sc); + super::object::keep_pixel_aligned(n, sc); } } } diff --git a/crates/engine/src/cmd/stepandrepeat/tests.rs b/crates/engine/src/cmd/stepandrepeat/tests.rs index dcf5009ca5..c25953d598 100644 --- a/crates/engine/src/cmd/stepandrepeat/tests.rs +++ b/crates/engine/src/cmd/stepandrepeat/tests.rs @@ -140,11 +140,18 @@ fn fill_ignores_explicit_counts() { } #[test] -fn a_pixel_aligned_copy_keeps_the_requested_fractional_gap() { - let (mut s, id) = setup(); - s.execute("object.setPixelAligned", &json!({"ids": [id], "on": true})).unwrap(); - let r = s.execute(CMD, &json!({"rows": 1, "columns": 3, "gapX": 0.5})).unwrap(); - let ids: Vec = r["ids"].as_array().unwrap().iter().map(|i| i.as_u64().unwrap()).collect(); - assert_eq!(bounds(&s, ids[1]).0, 50.5); - assert_eq!(bounds(&s, ids[2]).0, 101.0); +fn fractional_gaps_are_exact_except_for_pixel_aligned_objects_which_stay_on_the_grid() { + let gap = |aligned: bool| { + let (mut s, id) = setup(); + if aligned { + s.execute("object.setPixelAligned", &json!({"ids": [id], "on": true})).unwrap(); + } + let r = s.execute(CMD, &json!({"rows": 1, "columns": 2, "gapX": 0.5})).unwrap(); + let ids: Vec = r["ids"].as_array().unwrap().iter().map(|i| i.as_u64().unwrap()).collect(); + let (a, c) = (bounds(&s, ids[0]), bounds(&s, ids[1])); + (c.0 - a.2, c.0 - a.0) + }; + assert!((gap(false).0 - 0.5).abs() < 1e-9); + let pitch = gap(true).1; + assert!((pitch - pitch.round()).abs() < 1e-9); } From c77fd87964946795ae9c20f3a7711a3eca7006ef Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 01:29:38 -0800 Subject: [PATCH 015/105] Brushes: Brush Options and Apply Brush that change nothing add no undo step brush.options with params and a newName that leave the brush as it is stored the library again, raised the document revision and added an Undo step; only the Brush Options dialog skipped an unchanged OK. save_library now returns without an edit when the library it is given equals the document's and nothing is renamed, as brush.move already does. brush.apply of the brush the strokes and the current brush already have runs through edit_if_changed and records nothing. --- crates/engine/src/cmd/brushsym.rs | 4 +- crates/engine/src/cmd/brushsym/brushes.rs | 10 +++- crates/engine/src/tests/brushsym.rs | 56 +++++++++++++++++++++++ docs/mcp.md | 4 +- 4 files changed, 69 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/cmd/brushsym.rs b/crates/engine/src/cmd/brushsym.rs index 3828d67d0c..2de3ddfcfe 100644 --- a/crates/engine/src/cmd/brushsym.rs +++ b/crates/engine/src/cmd/brushsym.rs @@ -98,7 +98,7 @@ pub fn specs() -> Vec { "Apply Brush", [], None, - "{name, ids?|id?} apply a brush to the strokes of the selected paths (adds a stroke if missing) and make it current → {ids}", + "{name, ids?|id?} apply a brush to the strokes of the selected paths (adds a stroke if missing) and make it current; when the strokes already have it and it is already current, nothing changes and no undo step is recorded → {ids}", has_doc, brush_apply ), @@ -170,7 +170,7 @@ pub fn specs() -> Vec { "Brush Options…", [], None, - "{name, params?: {…fields to change (brush.get shows them; values outside their ranges are clamped). calligraphic: angle −180..180° (counter-clockwise from level), roundness 0..100%, size 0..1296 pt, variation: [angle°, roundness%, size pt], modes: [fixed|random|pressure|tilt|bearing|rotation|stylusWheel for angle, roundness, size] (pressure goes from value − variation at the lightest pen pressure to value + variation at the heaviest; tilt from value − variation with the pen lying flat to value + variation with it upright; bearing and rotation add variation × the pen's bearing (which way it leans, counter-clockwise from leaning right) or its barrel's counter-clockwise rotation over 180°; stylusWheel from value − variation at one end of an airbrush pen's finger wheel to value + variation at the other; the angle turns on past ±180°). scatter: size [a, b] 1..10000%, spacing [a, b] 1..10000%, scatter [a, b] −1000..1000%, rotation [a, b] −180..180° (counter-clockwise), modes: [fixed|random|pressure|tilt|bearing|rotation|stylusWheel for size, spacing, scatter, rotation] (fixed: a; random: between a and b; pressure: a at the lightest pen pressure to b at the heaviest; tilt: a with the pen lying flat to b upright; bearing and rotation: a at −180° to b at 180°; stylusWheel: a at one end of an airbrush pen's finger wheel to b at the other), rotation_relative_to_path, hue_jitter 0..180° (each copy turns the hue of its solid colors, after the colorization, by its own amount up to this far either way, the same on every redraw; colors without a hue stay; 0: off), saturation_jitter 0..100% (each copy moves the saturation of its solid colors, after the colorization and the hue jitter, by its own amount up to this many points either way, keeping their hue and brightness, the same on every redraw; colors without a hue stay; 0: off), brightness_jitter 0..100% (each copy moves the brightness of its solid colors, after the colorization and the hue and saturation jitter, by its own amount up to this many points either way, keeping their hue and saturation, the same on every redraw; white, black and grays move too; 0: off). art: width 1..1000%, width_mode: null (fixed)|pressure|tilt|bearing|rotation|stylusWheel, width_max 1..1000% (pressure: width at the lightest pen pressure to width_max at the heaviest; tilt: width with the pen lying flat to width_max upright; bearing and rotation: width at −180° to width_max at 180°; stylusWheel: width at one end of the finger wheel to width_max at the other; half way on a stroke drawn without that input), scale: {mode: proportional|stretch|betweenGuides, start, end: 0..1 of the art length}, direction: leftToRight|rightToLeft|topToBottom|bottomToTop, flip_along, flip_across, overlap. pattern: scale 1..10000%, scale_mode: null (fixed)|pressure|tilt|bearing|rotation|stylusWheel, scale_max 1..10000% (the tiles go from scale to scale_max over the same pen ranges as an art brush's width; half way on a stroke drawn without that input; each tile's height follows the stroke, its length and the gap after it take the scale at its middle, and a corner tile takes the scale at its corner), spacing 0..10000%, fit: stretch|addSpace|approximate, flip_along, flip_across, outer_corner and inner_corner: corner tile art (drawn as the corner that joins a side tile on its right to one below it) or null, outer_source and inner_source: what that kind of corner draws without its art: none|autoCentered|autoBetween|autoSliced|autoOverlap (a tile made from the side tile), or null (the other kind of corner's art); side_tile, outer_corner_tile, inner_corner_tile, start_tile, end_tile: a document pattern name, original, or none (side refuses none); corner tiles also take autoCentered|autoBetween|autoSliced|autoOverlap. Each tile also accepts {pattern: name} to select a swatch whose name is a reserved choice. scatter, art and pattern: colorization: {method: none|tints|tintsAndShades|hueShift, key: colour (hueShift: the art colour that becomes the stroke colour; without a key: the solid color the art's fills and strokes use most, black when they use none)}; colorization and the art brush's scale change only the fields given}, newName? (trimmed; blank: the name is kept; a new bristle brush name has at most 31 characters, and a longer name the brush has is kept)} edit a brush definition (strokes using it update) → {name}", + "{name, params?: {…fields to change (brush.get shows them; values outside their ranges are clamped). calligraphic: angle −180..180° (counter-clockwise from level), roundness 0..100%, size 0..1296 pt, variation: [angle°, roundness%, size pt], modes: [fixed|random|pressure|tilt|bearing|rotation|stylusWheel for angle, roundness, size] (pressure goes from value − variation at the lightest pen pressure to value + variation at the heaviest; tilt from value − variation with the pen lying flat to value + variation with it upright; bearing and rotation add variation × the pen's bearing (which way it leans, counter-clockwise from leaning right) or its barrel's counter-clockwise rotation over 180°; stylusWheel from value − variation at one end of an airbrush pen's finger wheel to value + variation at the other; the angle turns on past ±180°). scatter: size [a, b] 1..10000%, spacing [a, b] 1..10000%, scatter [a, b] −1000..1000%, rotation [a, b] −180..180° (counter-clockwise), modes: [fixed|random|pressure|tilt|bearing|rotation|stylusWheel for size, spacing, scatter, rotation] (fixed: a; random: between a and b; pressure: a at the lightest pen pressure to b at the heaviest; tilt: a with the pen lying flat to b upright; bearing and rotation: a at −180° to b at 180°; stylusWheel: a at one end of an airbrush pen's finger wheel to b at the other), rotation_relative_to_path, hue_jitter 0..180° (each copy turns the hue of its solid colors, after the colorization, by its own amount up to this far either way, the same on every redraw; colors without a hue stay; 0: off), saturation_jitter 0..100% (each copy moves the saturation of its solid colors, after the colorization and the hue jitter, by its own amount up to this many points either way, keeping their hue and brightness, the same on every redraw; colors without a hue stay; 0: off), brightness_jitter 0..100% (each copy moves the brightness of its solid colors, after the colorization and the hue and saturation jitter, by its own amount up to this many points either way, keeping their hue and saturation, the same on every redraw; white, black and grays move too; 0: off). art: width 1..1000%, width_mode: null (fixed)|pressure|tilt|bearing|rotation|stylusWheel, width_max 1..1000% (pressure: width at the lightest pen pressure to width_max at the heaviest; tilt: width with the pen lying flat to width_max upright; bearing and rotation: width at −180° to width_max at 180°; stylusWheel: width at one end of the finger wheel to width_max at the other; half way on a stroke drawn without that input), scale: {mode: proportional|stretch|betweenGuides, start, end: 0..1 of the art length}, direction: leftToRight|rightToLeft|topToBottom|bottomToTop, flip_along, flip_across, overlap. pattern: scale 1..10000%, scale_mode: null (fixed)|pressure|tilt|bearing|rotation|stylusWheel, scale_max 1..10000% (the tiles go from scale to scale_max over the same pen ranges as an art brush's width; half way on a stroke drawn without that input; each tile's height follows the stroke, its length and the gap after it take the scale at its middle, and a corner tile takes the scale at its corner), spacing 0..10000%, fit: stretch|addSpace|approximate, flip_along, flip_across, outer_corner and inner_corner: corner tile art (drawn as the corner that joins a side tile on its right to one below it) or null, outer_source and inner_source: what that kind of corner draws without its art: none|autoCentered|autoBetween|autoSliced|autoOverlap (a tile made from the side tile), or null (the other kind of corner's art); side_tile, outer_corner_tile, inner_corner_tile, start_tile, end_tile: a document pattern name, original, or none (side refuses none); corner tiles also take autoCentered|autoBetween|autoSliced|autoOverlap. Each tile also accepts {pattern: name} to select a swatch whose name is a reserved choice. scatter, art and pattern: colorization: {method: none|tints|tintsAndShades|hueShift, key: colour (hueShift: the art colour that becomes the stroke colour; without a key: the solid color the art's fills and strokes use most, black when they use none)}; colorization and the art brush's scale change only the fields given}, newName? (trimmed; blank: the name is kept; a new bristle brush name has at most 31 characters, and a longer name the brush has is kept)} edit a brush definition (strokes using it update); params and a newName that leave the brush as it is change nothing and record no undo step → {name}", has_doc, brush_options ), diff --git a/crates/engine/src/cmd/brushsym/brushes.rs b/crates/engine/src/cmd/brushsym/brushes.rs index af71b2dae9..18eb440f3a 100644 --- a/crates/engine/src/cmd/brushsym/brushes.rs +++ b/crates/engine/src/cmd/brushsym/brushes.rs @@ -80,10 +80,11 @@ pub(super) fn brush_apply(s: &mut Session, p: &Value) -> Result { } let ids = brush_targets(&s.doc()?.doc, &roots(s, p)?); let stroke = stroke_paint(s); - s.edit("Apply Brush", |d, _| { + crate::cmd::colorcmds::edit_if_changed(s, "Apply Brush", |before, d| { d.unknown.insert(brush::CURRENT_KEY.into(), json!(name)); apply_brush(d, &ids, &name, &stroke); - Ok(()) + let changed = brush::current(before).as_deref() != Some(name.as_str()) || ids.iter().any(|id| before.node(*id) != d.node(*id)); + Ok(((), changed)) })?; Ok(json!({ "ids": ids_json(&ids) })) } @@ -213,7 +214,12 @@ fn rename_brush_strokes(d: &mut Document, lib: &mut [Brush], from: &str, to: Opt } } +/// Stores `lib` and applies `renames` as one undo step named `label`. A `lib` equal to the +/// document's library, with no renames, leaves the document and its undo history as they are. fn save_library(s: &mut Session, label: &str, mut lib: Vec, renames: &[(String, Option)]) -> Result<()> { + if renames.is_empty() && lib == brush::library(&s.doc()?.doc) { + return Ok(()); + } s.edit(label, |d, _| { for (from, to) in renames { rename_brush_strokes(d, &mut lib, from, to.as_deref()); diff --git a/crates/engine/src/tests/brushsym.rs b/crates/engine/src/tests/brushsym.rs index 032e3ddb8c..86074c2a6b 100644 --- a/crates/engine/src/tests/brushsym.rs +++ b/crates/engine/src/tests/brushsym.rs @@ -913,6 +913,62 @@ fn brush_options_rename_duplicate_and_delete_update_strokes() { assert!(s.execute("brush.delete", &json!({"name": "5 pt. Round"})).is_err()); } +/// `brush.options` that leaves the brush as it is changes neither the document nor its revision, +/// and records no undo step, whether the library is stored or still the defaults. +#[test] +fn brush_options_that_change_nothing_record_no_undo_step() { + let mut s = session(); + let state = |s: &Session| { + let st = s.doc().unwrap(); + (st.doc.clone(), st.revision, st.history.undo.len()) + }; + let before = state(&s); + s.execute("brush.options", &json!({"name": "Arrow", "params": {}})).unwrap(); + assert_eq!(state(&s), before, "unchanged options of a default library change nothing"); + s.execute("brush.options", &json!({"name": "Arrow", "params": {"width": 110.25}})).unwrap(); + assert_eq!(undo_steps(&s), before.2 + 1, "a changed option is one undo step"); + let before = state(&s); + for p in [ + json!({"name": "Arrow"}), + json!({"name": "Arrow", "params": {}}), + json!({"name": "Arrow", "params": {"width": 110.25}}), + json!({"name": "Arrow", "newName": " Arrow "}), + json!({"name": "Arrow", "newName": ""}), + ] { + assert_eq!(s.execute("brush.options", &p).unwrap()["name"], "Arrow"); + assert_eq!(state(&s), before, "{p} changes nothing"); + } + s.execute("brush.options", &json!({"name": "Arrow", "newName": "Arrow 2"})).unwrap(); + assert_eq!(undo_steps(&s), before.2 + 1, "a rename is one undo step"); +} + +/// `brush.apply` of the brush that the strokes and the current brush already have changes neither +/// the document nor its revision, and records no undo step. +#[test] +fn brush_apply_that_changes_nothing_records_no_undo_step() { + let mut s = session(); + let a = rect(&mut s, 10.0, 10.0, 50.0, 50.0); + let state = |s: &Session| { + let st = s.doc().unwrap(); + (st.doc.clone(), st.revision, st.history.undo.len()) + }; + let before = state(&s); + s.execute("brush.apply", &json!({"name": "Charcoal", "ids": [a.0]})).unwrap(); + assert_eq!(undo_steps(&s), before.2 + 1); + let before = state(&s); + s.execute("brush.apply", &json!({"name": "Charcoal", "ids": [a.0]})).unwrap(); + assert_eq!(state(&s), before, "applying the brush again changes nothing"); + s.execute("brush.setCurrent", &json!({"name": "Arrow"})).unwrap(); + s.execute("brush.apply", &json!({"name": "Charcoal", "ids": [a.0]})).unwrap(); + assert_eq!(undo_steps(&s), before.2 + 1, "making the brush current again is one undo step"); + assert_eq!(s.execute("brush.list", &json!({})).unwrap()["current"], "Charcoal"); + let b = rect(&mut s, 80.0, 10.0, 50.0, 50.0); + let steps = undo_steps(&s); + s.execute("brush.apply", &json!({"name": "Charcoal", "ids": [a.0, b.0]})).unwrap(); + assert_eq!((brush_of(&s, a).as_deref(), brush_of(&s, b).as_deref()), (Some("Charcoal"), Some("Charcoal"))); + assert_eq!(undo_steps(&s), steps + 1, "a new stroke to paint is one undo step"); +} + /// A document whose brushes repeat a name opens with the later brush numbered: strokes of the name /// keep the first brush, and renaming or deleting one brush leaves the other and its strokes alone. #[test] diff --git a/docs/mcp.md b/docs/mcp.md index d698534089..b22bc55ef5 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5179,7 +5179,9 @@ already walks Image Trace. Short agent entry points: `brush.new` or `brush.options` without a `key` takes the color that the art's fills and strokes use most (on a tie, the one found first), or black when they use no solid color. `brush.options` changes only the fields of `colorization` and of an art brush's `scale` that `params` gives, so `{colorization: {method: "hueShift"}}` keeps a - Hue Shift brush's key. A scatter brush's `hue_jitter` (0 to 180 degrees, VectorCraft's own range; 0, the + Hue Shift brush's key. A `brush.options` whose `params` and `newName` leave the brush as it is, and a + `brush.apply` whose strokes already have the brush while it is already current, do not change the document or + its revision and record no undo step. A scatter brush's `hue_jitter` (0 to 180 degrees, VectorCraft's own range; 0, the default, leaves every copy's colors as the colorization gives them) turns the hue of each copy's solid fills and strokes, its type's characters included, by that copy's own amount between minus and plus that many degrees. The turn comes after the colorization: with None it turns the art's own colors, with Tints and Tints and Shades the From 2fa64c33a2bc5f4207c5a015f797af6ec0903db7 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 06:17:06 -0800 Subject: [PATCH 016/105] Tests: the six slowest interface tests run in a fraction of the time - Menu entries and Help search look up every shortcut in one keymap read. While a shortcut change waits for the next frame, each lookup cloned the whole keymap, so a Help search after shortcuts.set took about 4 s in a debug build. - The Insert Menu Item test and the Alt chord test make a new app for each item in one shared window. The Alt chord test releases each chord after its checks. - The palette test picks into one app per case while a pick changes nothing, and compares the tool's state as well. - The 3D row test reopens the dialog in one window for each row. --- crates/ui-egui/src/dialogs/revolve/tests.rs | 22 ++++++++--- crates/ui-egui/src/menus/entries.rs | 28 +++++++++---- crates/ui-egui/src/menus/tests.rs | 2 +- crates/ui-egui/src/palette.rs | 35 ++++++++++++----- .../ui-egui/src/panels/actions/tests_edits.rs | 4 +- .../src/panels/actions/tests_support.rs | 17 ++++++-- crates/ui-egui/src/panels/discover.rs | 10 ++++- crates/ui-egui/src/shortcuts/tests.rs | 39 +++++++++++++++---- crates/ui-egui/src/testing.rs | 15 ++++++- 9 files changed, 132 insertions(+), 40 deletions(-) diff --git a/crates/ui-egui/src/dialogs/revolve/tests.rs b/crates/ui-egui/src/dialogs/revolve/tests.rs index ceb96018f7..f48f65b38d 100644 --- a/crates/ui-egui/src/dialogs/revolve/tests.rs +++ b/crates/ui-egui/src/dialogs/revolve/tests.rs @@ -114,22 +114,32 @@ fn rows() -> Vec<(&'static str, &'static str, &'static str, Value)> { #[test] fn a_3d_row_sets_its_param_previews_and_applies_in_one_step() { + // One window serves every row: Cancel, and OK followed by Undo, leave the drawing as the dialog found it, and each + // row opens the dialog again over it. + let mut shown: Option = None; for (effect, page, key, value) in rows() { let name = format!("{effect}.{key}"); for confirm in [false, true] { - let mut h = drawn(SQUARE, effect); - let before = source(&h); + let p = json!({"effect": effect, "item": null}); + let h = match shown.as_mut() { + Some(h) => { + reopen(h, p); + h + } + None => shown.insert(opened(app_with(SQUARE), p)), + }; + let before = source(h); h.set("__page", json!(page)); h.set(key, value.clone()); - assert!(same(&stored(&h, effect)[key], &value), "{name}: the preview follows the row"); + assert!(same(&stored(h, effect)[key], &value), "{name}: the preview follows the row"); if confirm { h.ok(); - assert!(same(&stored(&h, effect)[key], &value), "{name}: OK keeps it"); - undo(&h); + assert!(same(&stored(h, effect)[key], &value), "{name}: OK keeps it"); + undo(h); } else { h.cancel(); } - assert_eq!(doc(&h), before, "{name}: {}", if confirm { "one undo step" } else { "Cancel restores" }); + assert_eq!(doc(h), before, "{name}: {}", if confirm { "one undo step" } else { "Cancel restores" }); } } } diff --git a/crates/ui-egui/src/menus/entries.rs b/crates/ui-egui/src/menus/entries.rs index 69722bd1ae..66353c55be 100644 --- a/crates/ui-egui/src/menus/entries.rs +++ b/crates/ui-egui/src/menus/entries.rs @@ -1,7 +1,9 @@ +use craft::keymap::{Chord, CommandRef}; + use super::context::context_items; -use super::labels::{display_label, dynamic_label, effect_item_label, item_shortcut, spelling_item_label, unlock_item_label}; +use super::labels::{display_label, dynamic_label, effect_item_label, item_shortcut_in, spelling_item_label, unlock_item_label}; use super::slots::{recent_readable, recent_slot}; -use super::state::{shortcut_of, shown_state}; +use super::state::{command_shortcuts, shown_state}; use super::tree::{Listed, menu_tree_named}; use super::{Node, Serialize, Value, VectorcraftApp, unbound}; @@ -32,8 +34,9 @@ pub struct MenuEntry { /// Flattened menu for `ui.menu.list`. pub fn menu_entries(app: &VectorcraftApp) -> Vec { let mut out = vec![]; + let chord = command_shortcuts(app); for (title, items) in menu_tree_named(app.session.prefs.font_names_in_english, &Listed::of(app)) { - flatten(app, vec![title.to_string()], vec![crate::i18n::t(title).to_string()], &items, &mut out); + flatten(app, &chord, vec![title.to_string()], vec![crate::i18n::t(title).to_string()], &items, &mut out); } out } @@ -41,7 +44,7 @@ pub fn menu_entries(app: &VectorcraftApp) -> Vec { /// Flattened canvas context menu for `ui.contextMenu.list` (paths are its submenus). pub fn context_entries(app: &VectorcraftApp) -> Vec { let mut out = vec![]; - flatten(app, vec![], vec![], &context_items(app), &mut out); + flatten(app, &command_shortcuts(app), vec![], vec![], &context_items(app), &mut out); out } @@ -166,7 +169,15 @@ pub fn insertable_items(english_names: bool, listed: &Listed) -> Vec, shown: Vec, nodes: &[Node], out: &mut Vec) { +/// `nodes` flattened into `out`, each item's shortcut looked up in `chord` ([`command_shortcuts`]). +pub(super) fn flatten( + app: &VectorcraftApp, + chord: &dyn Fn(&CommandRef) -> Option, + path: Vec, + shown: Vec, + nodes: &[Node], + out: &mut Vec, +) { for node in nodes { match node { Node::Item(it) if unbound(&it.command.id) => out.push(MenuEntry { @@ -197,7 +208,10 @@ pub(super) fn flatten(app: &VectorcraftApp, path: Vec, shown: Vec, shown: Vec {} } diff --git a/crates/ui-egui/src/menus/tests.rs b/crates/ui-egui/src/menus/tests.rs index adaa0b488c..4ecd9e690c 100644 --- a/crates/ui-egui/src/menus/tests.rs +++ b/crates/ui-egui/src/menus/tests.rs @@ -394,7 +394,7 @@ fn menu_entry_shown_paths_keep_script_folder_names() { let items = vec![sub("Scripts", vec![sub("File", folder), cp("Other Script…", "ui.runScript", Value::Null)])]; let mut out = vec![]; crate::i18n::set_current(de); - flatten(&app, vec!["File".into()], vec![crate::i18n::t("File").into()], &items, &mut out); + flatten(&app, &super::command_shortcuts(&app), vec!["File".into()], vec![crate::i18n::t("File").into()], &items, &mut out); crate::i18n::set_current(crate::i18n::Lang::EN); let script = out.iter().find(|e| e.command.as_deref() == Some(crate::scripts_menu::COMMAND)).unwrap(); assert_eq!(script.path, ["File", "Scripts", "File"]); diff --git a/crates/ui-egui/src/palette.rs b/crates/ui-egui/src/palette.rs index 9079b40a5d..f4ea2715bb 100644 --- a/crates/ui-egui/src/palette.rs +++ b/crates/ui-egui/src/palette.rs @@ -1753,8 +1753,8 @@ mod tests { /// the menu bar, and commands that need a value no menu item gives, with a menu path of their own /// or without one. A pick of each one it leaves /// out (with no document, one object selected or several) changes neither the document, its - /// selection, history and layer state, nor the interface. Every [`PICK_RUNS`] query is still - /// listed. + /// selection, history and layer state, the tool's state, nor the interface. Every [`PICK_RUNS`] + /// query is still listed. #[test] fn the_palette_leaves_out_the_commands_a_pick_cannot_run() { let ui_ids: std::collections::HashSet<&str> = menus::UI_COMMANDS.iter().map(|c| c.0).collect(); @@ -1785,16 +1785,33 @@ mod tests { (st.doc.clone(), format!("{:?}", st.selection), st.history.undo.len(), st.revision, st.active_layer, st.layer_rows.clone()) }); // A modeless dialog (Find and Replace) blocks nothing, so `any_dialog_open` leaves it out: the host lists it. - (doc, app.session.script_console().lines().len(), (app.any_dialog_open(), crate::tests::picks::open_dialogs(app).len()), ui) + // The tool's own state: the tool, a gesture or an input method's text in progress, and an interaction the + // session holds open. + let tool = (app.session.tool_id().to_owned(), app.session.tool_composing(), app.session.pointer_held(), app.session.in_interaction()); + (doc, app.session.script_console().lines().len(), (app.any_dialog_open(), crate::tests::picks::open_dialogs(app).len()), ui, tool) }; - let acts = |id: &str| { - [Session::new(), Fixture::Single.session(), Fixture::Multi.session()].into_iter().any(|session| { - let mut app = app_on(session); - let before = look(&app); - pick(&mut app, id); - look(&app) != before + // One app for each of the three cases, picked in one after another while a pick changes nothing that `look` + // sees; a pick that changes something is recorded, and its case starts again from a new app. + let fresh = |case: usize| { + app_on(match case { + 0 => Session::new(), + 1 => Fixture::Single.session(), + _ => Fixture::Multi.session(), }) }; + let mut apps: Vec = (0..3).map(fresh).collect(); + let mut acts = |id: &str| { + let mut changed = false; + for (case, app) in apps.iter_mut().enumerate() { + let before = look(app); + pick(app, id); + if look(app) != before { + changed = true; + *app = fresh(case); + } + } + changed + }; let changed: Vec<&str> = ids.iter().copied().filter(|id| acts(id)).collect(); assert!(changed.is_empty(), "a pick of these does something: {changed:?}"); for c in &dropped { diff --git a/crates/ui-egui/src/panels/actions/tests_edits.rs b/crates/ui-egui/src/panels/actions/tests_edits.rs index 1fe2f13711..208c293b70 100644 --- a/crates/ui-egui/src/panels/actions/tests_edits.rs +++ b/crates/ui-egui/src/panels/actions/tests_edits.rs @@ -927,8 +927,10 @@ fn insert_menu_item_refuses_what_no_menu_item_runs_and_changes_nothing() { fn every_listed_menu_item_runs_from_the_menu_what_its_step_holds() { // The View menu's proof items change the whole process's proof view. let _view = crate::testing::DefaultProofView::new(); + // A new app for each item, all in one window. + let window = crate::testing::window_context(); for item in crate::menus::insertable_items(false, &crate::menus::Listed::default()) { - let (mut app, _) = app_with_three_moves(); + let (mut app, _) = three_moves_in(new_app_in(&window)); app.run(INSERT_MENU_ITEM, json!({"set": 0, "action": 0, "command": item.command, "params": item.params})).unwrap(); let held = steps(&app, 0, 0)[3].1.clone(); let start = app.session.journal.len(); diff --git a/crates/ui-egui/src/panels/actions/tests_support.rs b/crates/ui-egui/src/panels/actions/tests_support.rs index 610e180bf0..3f763ad877 100644 --- a/crates/ui-egui/src/panels/actions/tests_support.rs +++ b/crates/ui-egui/src/panels/actions/tests_support.rs @@ -20,9 +20,14 @@ use crate::VectorcraftApp; /// An app with the built-in set, in a window whose dialog host the tests drive and which has drawn its first frame, so /// the window's keymap holds the app's commands. pub(crate) fn new_app() -> VectorcraftApp { - let mut app = crate::testing::windowed(VectorcraftApp::new(Session::new(), Default::default())); - let ctx = app.ui_ctx.clone().expect("a window"); - crate::testing::app_frame(&mut app, &ctx, Default::default()); + new_app_in(&crate::testing::window_context()) +} + +/// [`new_app`] in the window of `ctx` ([`crate::testing::window_context`]), which a test can reuse for a new app at +/// each step. +pub(crate) fn new_app_in(ctx: &egui::Context) -> VectorcraftApp { + let mut app = crate::testing::windowed_in(VectorcraftApp::new(Session::new(), Default::default()), ctx); + crate::testing::app_frame(&mut app, ctx, Default::default()); app } @@ -251,7 +256,11 @@ pub(crate) fn cancel_dialog(app: &mut VectorcraftApp) { /// A document with one rectangle selected and the set "Moves" with one action that moves it /// right three times, by 1, 2 and 4 pt → (the app, the rectangle's left edge as it moves). pub(crate) fn app_with_three_moves() -> (VectorcraftApp, impl Fn(&VectorcraftApp) -> f64) { - let mut app = new_app(); + three_moves_in(new_app()) +} + +/// [`app_with_three_moves`] made from `app`, a new app such as [`new_app_in`] gives. +pub(crate) fn three_moves_in(mut app: VectorcraftApp) -> (VectorcraftApp, impl Fn(&VectorcraftApp) -> f64) { app.run("file.new", json!({"width": 200, "height": 100})).unwrap(); let id = vectorcraft_doc::NodeId(app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 20, "height": 20})).unwrap()["id"].as_u64().unwrap()); diff --git a/crates/ui-egui/src/panels/discover.rs b/crates/ui-egui/src/panels/discover.rs index 649727d609..58c9bb5c12 100644 --- a/crates/ui-egui/src/panels/discover.rs +++ b/crates/ui-egui/src/panels/discover.rs @@ -52,7 +52,12 @@ pub struct View { /// The text of a tool's shortcut in the window's keymap, empty when it has none. fn tool_shortcut(app: &VectorcraftApp, id: &str) -> String { - menus::shortcut_of(app, &format!("tool:{id}")).map_or_else(String::new, |chord| chord.display(crate::keymap::platform())) + tool_shortcut_in(&menus::command_shortcuts(app), id) +} + +/// [`tool_shortcut`] looked up in `chord` ([`menus::command_shortcuts`]). +fn tool_shortcut_in(chord: &dyn Fn(&craft::keymap::CommandRef) -> Option, id: &str) -> String { + chord(&crate::keymap::command_of(&format!("tool:{id}"))).map_or_else(String::new, |chord| chord.display(crate::keymap::platform())) } /// Updates the retained results' labels, menu paths and shortcuts after the menu state changes (a @@ -109,6 +114,7 @@ fn refresh(app: &mut VectorcraftApp) { /// The tools, each with the entry the search ranks it by. fn tool_hits(app: &VectorcraftApp) -> Vec<(HelpEntry, Hit)> { let lang = crate::i18n::current(); + let chord = menus::command_shortcuts(app); vectorcraft_tools::catalog::all_tools() .map(|tool| { let label: String = crate::i18n::tr(lang, tool.label).into(); @@ -120,7 +126,7 @@ fn tool_hits(app: &VectorcraftApp) -> Vec<(HelpEntry, Hit)> { id: tool.id.into(), label, path: vec![], - shortcut: tool_shortcut(app, tool.id), + shortcut: tool_shortcut_in(&chord, tool.id), english_label: tool.label.into(), english_path: vec![], params: Value::Null, diff --git a/crates/ui-egui/src/shortcuts/tests.rs b/crates/ui-egui/src/shortcuts/tests.rs index f5cd51ebb5..f33216e978 100644 --- a/crates/ui-egui/src/shortcuts/tests.rs +++ b/crates/ui-egui/src/shortcuts/tests.rs @@ -210,6 +210,18 @@ fn editing_hi() -> (VectorcraftApp, u64) { (app, id) } +/// [`editing_hi`] in the window of `ctx`, which a test can reuse for a new app at each step, after the frames +/// [`typing_ready`] runs. +fn editing_hi_in(ctx: &egui::Context) -> (VectorcraftApp, u64) { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.session.execute("file.new", &json!({"width": 200, "height": 200})).unwrap(); + key_frame(&mut app, ctx, vec![]); + let id = app.session.execute("text.create", &json!({"x": 20, "y": 50, "text": "Hi"})).unwrap()["id"].as_u64().unwrap(); + edit(&mut app, 2, 2); + idle(&mut app, ctx, 2); + (app, id) +} + /// Starts editing the selected type object with the Type tool and selects `start..end`. fn edit(app: &mut VectorcraftApp, start: u64, end: u64) { app.select_tool("type"); @@ -901,22 +913,33 @@ fn alt_chords_type_special_characters_while_editing_text() { return; } let mut wrong = vec![]; + // A new app for each chord, all in one window. + let ctx = crate::testing::ui_context(); for (key, shift, own, character) in ALT_CHARACTER_CHORDS { for typed in [None, Some(own), Some(own.to_uppercase().as_str())] { - let (mut app, id) = editing_hi(); - let ctx = typing_ready(&mut app); + let (mut app, id) = editing_hi_in(&ctx); key_frame(&mut app, &ctx, alt_press(key, shift, typed)); let case = format!("{key:?} shift={shift} text={typed:?}"); let text = text_and_layers(&mut app, id).0; if text != format!("Hi{character}") { wrong.push(format!("{case}: text = {text:?}")); - continue; - } - app.session.execute("edit.undo", &json!({})).unwrap(); - let undone = text_and_layers(&mut app, id).0; - if undone != "Hi" { - wrong.push(format!("{case}: after Undo = {undone:?}")); + } else { + app.session.execute("edit.undo", &json!({})).unwrap(); + let undone = text_and_layers(&mut app, id).0; + if undone != "Hi" { + wrong.push(format!("{case}: after Undo = {undone:?}")); + } } + // The window keeps a key held from one app to the next: the release makes the next chord a new press. + let m = if shift { Modifiers::ALT | Modifiers::SHIFT } else { Modifiers::ALT }; + key_frame( + &mut app, + &ctx, + vec![ + egui::Event::Key { key, physical_key: Some(key), pressed: false, repeat: false, modifiers: m }, + egui::Event::ModifiersChanged(Modifiers::NONE), + ], + ); } } assert!(wrong.is_empty(), "{wrong:#?}"); diff --git a/crates/ui-egui/src/testing.rs b/crates/ui-egui/src/testing.rs index 6098a8467a..89a74801bc 100644 --- a/crates/ui-egui/src/testing.rs +++ b/crates/ui-egui/src/testing.rs @@ -22,10 +22,21 @@ pub(crate) fn install(ctx: &egui::Context) { /// `app` shown in a window of its own: its context is the one every frame of the test runs on, so its dialogs open on /// the window's host, focus and drags last from frame to frame, and the access tree is on for the tests that find a /// control by its role. -pub(crate) fn windowed(mut app: crate::VectorcraftApp) -> crate::VectorcraftApp { +pub(crate) fn windowed(app: crate::VectorcraftApp) -> crate::VectorcraftApp { + windowed_in(app, &window_context()) +} + +/// The context of a window [`windowed`] shows an app in, with the access tree on. A test that makes a new app for each +/// item can show each one in the same window with [`windowed_in`]. +pub(crate) fn window_context() -> egui::Context { let ctx = ui_context(); ctx.enable_accesskit(); - app.ui_ctx = Some(ctx); + ctx +} + +/// `app` shown in the window of `ctx`, as [`windowed`] shows it in a window of its own. +pub(crate) fn windowed_in(mut app: crate::VectorcraftApp, ctx: &egui::Context) -> crate::VectorcraftApp { + app.ui_ctx = Some(ctx.clone()); app } From bd0d0149ac2c83b3c7a14129a09ebb8f709ac6e2 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 10:00:26 -0800 Subject: [PATCH 017/105] Brushes: Apply Brush text says it clears a stroke's own settings brush.apply clears the brush settings of each path's top stroke, and clearing them is one undo step. The command text and docs/mcp.md now limit the no-op to a current brush whose top strokes already have it, paint, a width above 0 and no settings of their own. A new test applies the current brush to a stroke with its own settings and checks that they are cleared as one undo step. --- crates/engine/src/cmd/brushsym.rs | 2 +- crates/engine/src/tests/brushsym.rs | 15 +++++++++++++++ docs/mcp.md | 5 +++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/cmd/brushsym.rs b/crates/engine/src/cmd/brushsym.rs index 2de3ddfcfe..84f7c5ed3b 100644 --- a/crates/engine/src/cmd/brushsym.rs +++ b/crates/engine/src/cmd/brushsym.rs @@ -98,7 +98,7 @@ pub fn specs() -> Vec { "Apply Brush", [], None, - "{name, ids?|id?} apply a brush to the strokes of the selected paths (adds a stroke if missing) and make it current; when the strokes already have it and it is already current, nothing changes and no undo step is recorded → {ids}", + "{name, ids?|id?} apply a brush to the strokes of the selected paths (adds a stroke if missing) and make it current; the brush settings of each path's top stroke (brush.objectOptions) are cleared, and clearing them is one undo step; when the brush is already current and applying it leaves every path as it was (its top stroke already has the brush, paint, a width above 0 and no settings of its own), nothing changes and no undo step is recorded → {ids}", has_doc, brush_apply ), diff --git a/crates/engine/src/tests/brushsym.rs b/crates/engine/src/tests/brushsym.rs index 86074c2a6b..33363119c1 100644 --- a/crates/engine/src/tests/brushsym.rs +++ b/crates/engine/src/tests/brushsym.rs @@ -969,6 +969,21 @@ fn brush_apply_that_changes_nothing_records_no_undo_step() { assert_eq!(undo_steps(&s), steps + 1, "a new stroke to paint is one undo step"); } +/// Applying the current brush again to a stroke with settings of its own clears them as one undo step. +#[test] +fn brush_apply_clears_object_options_as_one_undo_step() { + let mut s = session(); + let a = line(&mut s); + select(&mut s, &[a]); + s.execute("brush.apply", &json!({"name": "Arrow"})).unwrap(); + s.execute("brush.objectOptions", &json!({"params": {"width": 50}})).unwrap(); + assert_eq!(own_options(&s, a), json!({"width": 50.0})); + let steps = undo_steps(&s); + s.execute("brush.apply", &json!({"name": "Arrow"})).unwrap(); + assert_eq!(own_options(&s, a), json!({}), "applying the brush clears the stroke's own settings"); + assert_eq!(undo_steps(&s), steps + 1, "clearing the settings is one undo step"); +} + /// A document whose brushes repeat a name opens with the later brush numbered: strokes of the name /// keep the first brush, and renaming or deleting one brush leaves the other and its strokes alone. #[test] diff --git a/docs/mcp.md b/docs/mcp.md index b22bc55ef5..14e4d45f77 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5180,8 +5180,9 @@ already walks Image Trace. Short agent entry points: the one found first), or black when they use no solid color. `brush.options` changes only the fields of `colorization` and of an art brush's `scale` that `params` gives, so `{colorization: {method: "hueShift"}}` keeps a Hue Shift brush's key. A `brush.options` whose `params` and `newName` leave the brush as it is, and a - `brush.apply` whose strokes already have the brush while it is already current, do not change the document or - its revision and record no undo step. A scatter brush's `hue_jitter` (0 to 180 degrees, VectorCraft's own range; 0, the + `brush.apply` of the current brush whose paths' top strokes already have the brush, paint, a width above 0 and no + settings of their own, do not change the document or its revision and record no undo step. `brush.apply` clears the own settings + (`brush.objectOptions`) of each path's top stroke, and clearing them is one undo step; lower strokes keep theirs. A scatter brush's `hue_jitter` (0 to 180 degrees, VectorCraft's own range; 0, the default, leaves every copy's colors as the colorization gives them) turns the hue of each copy's solid fills and strokes, its type's characters included, by that copy's own amount between minus and plus that many degrees. The turn comes after the colorization: with None it turns the art's own colors, with Tints and Tints and Shades the From cddc75cf5c06e310c71473477a8b672958ccd492 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 10:27:30 -0800 Subject: [PATCH 018/105] Brushes: only Brush Options skips an unchanged library save The equality check that skips the undo step now sits in brush.options, which compares the edited brush with the stored one. New, Delete, Move, Duplicate and Replace Brush Art save the library as they do on main, without decoding it a second time. docs/target-app-parity.md lists the no-op rules for Brush Options and Apply Brush with their tests. --- crates/engine/src/cmd/brushsym/brushes.rs | 15 ++++++++------- docs/target-app-parity.md | 1 + 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/crates/engine/src/cmd/brushsym/brushes.rs b/crates/engine/src/cmd/brushsym/brushes.rs index 18eb440f3a..eaebecf11e 100644 --- a/crates/engine/src/cmd/brushsym/brushes.rs +++ b/crates/engine/src/cmd/brushsym/brushes.rs @@ -214,12 +214,8 @@ fn rename_brush_strokes(d: &mut Document, lib: &mut [Brush], from: &str, to: Opt } } -/// Stores `lib` and applies `renames` as one undo step named `label`. A `lib` equal to the -/// document's library, with no renames, leaves the document and its undo history as they are. +/// Stores `lib` and applies `renames` as one undo step named `label`. fn save_library(s: &mut Session, label: &str, mut lib: Vec, renames: &[(String, Option)]) -> Result<()> { - if renames.is_empty() && lib == brush::library(&s.doc()?.doc) { - return Ok(()); - } s.edit(label, |d, _| { for (from, to) in renames { rename_brush_strokes(d, &mut lib, from, to.as_deref()); @@ -509,8 +505,13 @@ pub(super) fn brush_options(s: &mut Session, p: &Value) -> Result { v["name"] = json!(name); } v["type"] = json!(lib[i].kind.type_id()); - lib[i] = parse_brush(C, v)?; - let out = lib[i].name.clone(); + let edited = parse_brush(C, v)?; + let out = edited.name.clone(); + // Options that leave the brush as it is change nothing and add no undo step. + if new_name.is_none() && edited == lib[i] { + return Ok(json!({ "name": out })); + } + lib[i] = edited; let rename = new_name.map(|nn| (name, Some(nn))); save_library(s, "Brush Options", lib, rename.as_slice())?; Ok(json!({ "name": out })) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 032041c2a1..c06f4e5922 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -2243,6 +2243,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur Pattern Brush Options' Scale has a menu of Fixed, Pressure, Tilt, Bearing, Rotation and Stylus Wheel with a second scale beside it, in the library brush's dialog and in Options of Selected Object, from the pen tablet options the Pattern brush options section of the help page (, archived copy) lists for Scale (`brush.options` and `brush.objectOptions` `scale_mode` and `scale_max`). The tiles go from Scale where the pen reads 0 to the second scale where it reads 1, over the same ranges as Art Brush Options' Width, and half way on a stroke without that input. Each side, start and end tile is as tall as the scale at each point of the stroke, and the tile is as long as the scale at its middle; a corner tile takes the scale at its corner. Stretch to Fit stretches the tiles and gaps of each run to fill it, Add Space to Fit shares out what is left between the tiles, and Approximate Path centers them on the run. The help page does not say how the pen maps to the scale or how the tiles are measured along the stroke, so those rules are VectorCraft's own. A brush with a fixed scale draws as before. `.ai` files do not read or write the pattern scale's mode, and the Width tool does not turn the pen's data into width points. Evidence: `tests::pattern_brush_scale_follows_the_pressure`, `tests::pattern_brush_scale_follows_tilt_bearing_rotation_and_the_wheel`, `tests::pattern_brush_scale_from_the_pen_places_start_end_and_corner_tiles` (vectorcraft-brush), `tests::brushsym::options_of_selected_object_keep_each_paths_second_scale_when_the_scale_changes`, `tests::brushsym::pattern_brush_scale_mode_goes_through_the_brush_commands` (vectorcraft-engine), `dialogs::brush_options::tests::pattern_options_scale_follows_the_pen`, `dialogs::brush_options::tests::options_of_selected_object_set_one_paths_pattern_scale_mode` (vectorcraft-ui-egui). - **Airbrush stylus wheel:** Calligraphic and Scatter Brush Options offer Stylus Wheel for Size, and Art Brush Options for Width, as the help page lists it (). The Paintbrush records where an airbrush pen's finger wheel is set along each stroke (kept with the path, saved, joined when a stroke continues a path, and interpolated by blends). A Calligraphic Size goes from size − variation at one end of the wheel's travel to size + variation at the other, a Scatter Size from its first value to its second, and an Art Width from Width to the second width; a stroke without a wheel draws the value half way. The direction of travel and the half-way value for a stroke without a wheel are VectorCraft's own rules. On Linux under X11 and XWayland the app reads the wheel from XInput2's `Abs Wheel` valuator, on macOS from AppKit's `tangentialPressure`, and in the web build from Pointer Events' `tangentialPressure` (), for each move of a pen including the positions a fast stroke's events coalesce. Windows pointer messages have no field for it, so on Windows the app reads it from the tablet driver's Wintab interface, as the tangential pressure (`pkTangentPressure`) of a cursor the driver reports as an airbrush, placed within its device's `DVC_TPRESSURE` range (, ). `Wintab32.dll` is loaded from the system directory only; without it, or when a call fails, Windows pens read no wheel and draw as before. The library is loaded and the context opened only while the active tool uses the wheel (the Paintbrush with a brush on Stylus Wheel, or the Blob Brush or the Eraser with a value on it), and the context closes when it stops; this is VectorCraft's own rule. A pen first reads the wheel from an airbrush packet that came within 200 ms of one of its pointer messages, and from none when packets of two tablets' cursors both did or neither did. That pen then holds the readings: its later messages take that airbrush's last wheel, even when the pen has been held still, no packet has come for longer, or another tablet's cursor has been read since, and other pens read no wheel until the readings start afresh (the pen leaves or turns to its other end, or a cursor comes near, leaves or changes). 0 counts as no wheel until the pen has reported another value since it came near, as on macOS and in the web build; the web build reads the wheel afresh for another pen, the other end, a canceled press and a pen that left the hover range. These are VectorCraft's own rules. `path.freehand` points take it seventh and `pointer_gesture` events take `wheel`, and `.ai` brush definitions read and write it as variation code 3. Evidence: `tests::the_stylus_wheel_varies_sizes_and_widths` (vectorcraft-brush), `tests_brushsym::freehand_points_record_the_stylus_wheel` (vectorcraft-engine), `more_brush_settings_are_read_back` and `a_calligraphic_brushs_pen_channels_come_in_by_their_codes` (vectorcraft-eps), `tablet::tests::an_airbrush_wheel_goes_into_the_feed`, `mac_tablet::tests::an_airbrush_wheel_goes_into_the_feed`, `windows_stylus::tests::an_airbrush_wheel_goes_into_the_sample`, `windows_wintab::tests::a_pen_message_takes_the_wheel_of_the_recent_airbrush` and `windows_wintab::tests::the_driver_is_left_alone_until_the_wheel_is_used` (vectorcraft), `pencil::tests::an_airbrush_wheel_goes_into_the_feed`, `pencil::tests::coalesced_moves_keep_their_wheel` and `pencil::tests::the_wheel_is_read_afresh_for_each_pen_and_end` (vectorcraft-web), `symbolism::tests::the_paintbrush_reads_the_wheel_only_with_a_stylus_wheel_brush` (vectorcraft-tools) and `stylus::tests::the_host_is_told_when_the_tool_starts_and_stops_reading_the_wheel` (vectorcraft-ui-egui). - **Blob Brush Size on the stylus wheel:** Blob Brush Tool Options' Size menu offers Stylus Wheel beside Fixed and Pressure. The Blob Brush paints with the Calligraphic brush options ([help page](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=273)), whose Size an airbrush pen's wheel can vary ([help page](https://web.archive.org/web/20241230205225/https://helpx.adobe.com/illustrator/using/brushes.html)), and the Eraser's Size menu offers the same wheel choice ([help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/erase-paths-using-eraser-tool.html)). With Stylus Wheel a stroke is Size − Variation wide at one end of the wheel's travel, but at least 0.1 pt, and Size + Variation at the other; a point without a wheel counts as half way, and a mouse stroke keeps the Size. A stroke whose points all lie at one place paints one dab sized from its first reading, on Pressure too. While the Blob Brush paints, the tip outline at the pointer takes the size the pen gives, on Pressure too, and keeps the Size when the menu changes to Stylus Wheel during the drag, or to Pressure during a drag that started on Fixed, as the release paints. A drag that started on Stylus Wheel records the pen pressure, so a change to Pressure follows that pressure from the start of the drag when the pen pressed less than fully anywhere. The direction of travel and the half-way value are VectorCraft's own rules. `path.blob` takes `sizeMode: "stylusWheel"` with the wheel seventh in each point. Evidence: `tests::draw2::blob_brush_size_follows_the_stylus_wheel` (vectorcraft-engine), `draw2::gesture::tests::the_blob_brush_size_follows_the_stylus_wheel` (vectorcraft-tools), `dialogs::freehand::tests::the_blob_brush_size_offers_the_stylus_wheel` (vectorcraft-ui-egui). + - **Brush edits that change nothing add no undo step:** Brush Options that leave a brush as it is, and Apply Brush of the current brush to paths whose top strokes already have it, paint, a width above 0 and no settings of their own, leave the document and its undo history as they are. Apply Brush clears the settings of the top stroke (Options of Selected Object), and clearing them is one undo step. Evidence: `tests::brushsym::brush_apply_that_changes_nothing_records_no_undo_step` and `tests::brushsym::brush_apply_clears_object_options_as_one_undo_step` (vectorcraft-engine). Scatter, Art and Pattern Brush Options have the Tips button for Colorization that the [Brushes](https://web.archive.org/web/20241230205225/https://helpx.adobe.com/illustrator/using/brushes.html) page (archived copy) describes, beside Method. It opens Colorization Tips, which shows each method's name and what it does beside a sample of the brush, as OK would make it, painted with that method on a blue stroke; Hue Shift's sample uses the dialog's Key Color. `ui.dialog.set {field: "tips", value: true}` opens it. Screen readers name the button, the popover and each sample. Hue Shift set by `brush.new` or `brush.options` without a key color takes the color the art's fills and strokes use most, as Brush Options already offers it, following the Brushes page, where the key color defaults to the color that stands out most in the art (). The page does not state how prominence is measured. Counting the fills and strokes that use each solid color, with the first one found winning a tie and black for art with no solid color, is VectorCraft's own rule. A `brush.options` edit that gives only the method keeps the brush's key color, and one that gives only an art brush's start guide keeps its end guide. Evidence: `tests_brushsym::hue_shift_without_a_key_takes_the_most_used_art_color`, `tests_brushsym::art_brush_options_keep_the_scale_fields_an_edit_leaves_out`. Bristle Brush Options and `brush.new` take a bristle brush name of at most 31 characters, as the Brushes page states for the Bristle Brush Options. The Name field stops taking characters at 31, and `brush.new` and `brush.options` refuse a longer new name with an error that names the limit. The page does not say how the limit counts characters or what happens to longer names already saved; counting characters and the number added to a taken name, keeping longer saved names, and leaving `brush.duplicate` unlimited are VectorCraft's own rules. A bristle brush that a document or a saved file already holds under a longer name keeps it, and the other brush types take a name of any length. Test: `bristle_brush_names_have_at_most_31_characters` in `tests/brushsym.rs`. Public reference: [Brushes](https://web.archive.org/web/20241230205225/https://helpx.adobe.com/illustrator/using/brushes.html) (archived copy). From a0c1a550abe31ab26eb84f340fac73018020deea Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 11:46:32 -0800 Subject: [PATCH 019/105] Menus: a rebuild runs each command's check once The menu model asked whether a command can run for every row that names it, so the rows that share a command (Effect's dialogs, Window's panels, the interface languages, the font sizes) ran the same check over and over on each edit and selection change. In a document with 20 selected rectangles one rebuild asked 1,910 times about 1,191 commands; Effect's dialog check alone ran 118 times. A rebuild now keeps each command's answer and reuses it for the tree's rows, the catalog's rows and Envelope Distort's Make and Reset rows. The answer depends on the command id and the app's state, not on the row's params, so the states and reasons are unchanged. --- crates/ui-egui/src/menus/model.rs | 61 ++++++++++++++++++++++++------- crates/ui-egui/src/menus/state.rs | 22 +++++++---- 2 files changed, 61 insertions(+), 22 deletions(-) diff --git a/crates/ui-egui/src/menus/model.rs b/crates/ui-egui/src/menus/model.rs index fffff70049..8a49015203 100644 --- a/crates/ui-egui/src/menus/model.rs +++ b/crates/ui-egui/src/menus/model.rs @@ -257,7 +257,7 @@ fn rebuild(app: &mut VectorcraftApp, target: Target) { // The Glyphs panel menu's East Asian glyph forms read the faces that draw the selected text from the layout this keeps. crate::panels::glyphs::refresh_form_faces(app); let listed = Listed::of(app); - let mut build = Build { app, lang: crate::i18n::current(), states: CommandStates::new(), refs: Vec::new() }; + let mut build = Build { app, lang: crate::i18n::current(), states: CommandStates::new(), refs: Vec::new(), checks: Checks::default() }; let menus: Vec = menu_tree_named(app.session.prefs.font_names_in_english, &listed) .into_iter() .map(|(title, nodes)| { @@ -267,7 +267,7 @@ fn rebuild(app: &mut VectorcraftApp, target: Target) { if translated { menu.english(title) } else { menu } }) .collect(); - let Build { mut states, refs, .. } = build; + let Build { mut states, refs, mut checks, .. } = build; // The catalog is built again only when what its rows are made from changed; edits and selection changes change // the rows' states alone. @@ -291,7 +291,7 @@ fn rebuild(app: &mut VectorcraftApp, target: Target) { CatalogRows { inputs, defs, known, accepted } } }; - row_states(app, &rows, &mut states); + row_states(app, &rows, &mut states, &mut checks); crate::panels::panel_menu_states(app, &mut states); let bar = MenuBar::new(menus); @@ -395,10 +395,10 @@ fn build_catalog(app: &VectorcraftApp, listed: &Listed, plays: &[(String, craft: /// The state of every catalog row the tree did not set, and of the engine commands the palette lists that no row /// names. -fn row_states(app: &VectorcraftApp, rows: &CatalogRows, states: &mut CommandStates) { +fn row_states(app: &VectorcraftApp, rows: &CatalogRows, states: &mut CommandStates, checks: &mut Checks) { for d in &rows.defs { if states.get(&d.command).is_none() { - states.set(d.command.clone(), row_state(app, &d.command, &d.label)); + states.set(d.command.clone(), row_state(app, &d.command, &d.label, checks)); } } // The engine commands the palette lists and no row names (Asset Export's Remove and Rename) are dimmed there and say @@ -406,11 +406,28 @@ fn row_states(app: &VectorcraftApp, rows: &CatalogRows, states: &mut CommandStat for c in crate::palette::listed_engine_commands().filter(|c| !rows.known.contains(c.id)) { let command = CommandRef::new(c.id); if states.get(&command).is_none() { - states.set(command.clone(), row_state(app, &command, c.label)); + states.set(command.clone(), row_state(app, &command, c.label, checks)); } } } +/// What [`why_off`] answered for each command id during one rebuild. The answer depends on the id and the app's state, +/// not on the row's params, so the rows that share an id (Effect's dialogs, Window's panels, the interface languages) +/// run their command's check once. +#[derive(Default)] +struct Checks(std::collections::HashMap>>); + +impl Checks { + fn why_off(&mut self, app: &VectorcraftApp, id: &str) -> Option> { + if let Some(why) = self.0.get(id) { + return why.clone(); + } + let why = why_off(app, id); + self.0.insert(id.to_owned(), why.clone()); + why + } +} + /// `defs` without the commands a linked framework set defines (Undo, Redo, Cut, Copy, Paste and Tab's panels toggles): /// the set's definition is the command's. With them, the keys each has beyond the set's, as the set's keys and those /// (Cut, Copy and Paste's F2, F3 and F4 outside macOS). @@ -445,10 +462,9 @@ fn linked_defaults(command: &CommandRef) -> Option> { /// The state of the row `command`, named `label` in the catalog: on or dimmed with its reason, checked, and its title /// where the app shows another. -fn row_state(app: &VectorcraftApp, command: &CommandRef, label: &str) -> CommandState { +fn row_state(app: &VectorcraftApp, command: &CommandRef, label: &str, checks: &mut Checks) -> CommandState { let state_id = crate::keymap::state_id(command); - let why = why_off(app, state_id); - let (enabled, checked) = shown_state_with(app, state_id, &command.params, &why).unwrap_or((false, None)); + let (enabled, checked) = shown_state_with(app, state_id, &command.params, &mut |id| checks.why_off(app, id)).unwrap_or((false, None)); let mut state = CommandState::new().enabled(enabled); if let Some(on) = checked { state = state.checked(on); @@ -458,7 +474,7 @@ fn row_state(app: &VectorcraftApp, command: &CommandRef, label: &str) -> Command state = state.title(shown.clone()); } if !enabled { - state = state.hint(off_reason_with(app, command, &shown, why)); + state = state.hint(off_reason_with(app, command, &shown, checks.why_off(app, state_id))); } state } @@ -493,6 +509,7 @@ struct Build<'a> { states: CommandStates, /// Every command reference the tree holds, its English label, and whether it is checkable. refs: Vec<(CommandRef, String, bool)>, + checks: Checks, } impl Build<'_> { @@ -548,8 +565,8 @@ impl Build<'_> { return Some(item); } let (id, params) = (command.id.as_str(), &command.params); - let why = why_off(self.app, id); - let (enabled, checked) = shown_state_with(self.app, id, params, &why)?; + let (app, checks) = (self.app, &mut self.checks); + let (enabled, checked) = shown_state_with(app, id, params, &mut |id| checks.why_off(app, id))?; let title = self.item_title(id, params, &item.label); let mut state = CommandState::new().enabled(enabled).title(title.clone()); if let Some(on) = checked { @@ -562,8 +579,7 @@ impl Build<'_> { None } else { // The reason reads the check of the command's state id, which is `id` but for the framework's own rows. - let state_id = crate::keymap::state_id(&command); - let why = if state_id == id { why } else { why_off(self.app, state_id) }; + let why = self.checks.why_off(self.app, crate::keymap::state_id(&command)); Some(off_reason_with(self.app, &command, &title, why)) }; if let Some(tip) = tip { @@ -658,6 +674,23 @@ mod tests { assert!(app.menus.states.get(&CommandRef::new("object.group")).is_some_and(CommandState::is_enabled)); } + /// A rebuild runs the check of a command that many rows share once: Effect's dialogs, Window's panels, the + /// interface languages and Envelope Distort's Release, which decides whether Make or Reset is shown. + #[test] + fn a_rebuild_checks_a_shared_command_once() { + let (mut app, ctx) = app_with_document(); + app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap(); + app.run("shape.rectangle", json!({"x": 20, "y": 0, "width": 10, "height": 10})).unwrap(); + app.run("select.all", json!({})).unwrap(); + super::super::state::WHY_OFF_ASKED.with_borrow_mut(Vec::clear); + refresh(&mut app, &ctx); + let asked = super::super::state::WHY_OFF_ASKED.take(); + for id in ["effect.dialog", "window.panel", "app.language", "object.envelope.release"] { + assert_eq!(asked.iter().filter(|a| *a == id).count(), 1, "{id}"); + } + assert!(app.menus.states.get(&CommandRef::new("object.group")).is_some_and(CommandState::is_enabled), "the states follow the selection"); + } + /// A rebuild asks each dimmed row's command once whether it can run, for its state and its reason together. #[test] fn a_rebuild_checks_each_dimmed_row_once() { diff --git a/crates/ui-egui/src/menus/state.rs b/crates/ui-egui/src/menus/state.rs index 80fb7475ad..1d0c038f04 100644 --- a/crates/ui-egui/src/menus/state.rs +++ b/crates/ui-egui/src/menus/state.rs @@ -153,13 +153,14 @@ pub(super) fn hidden_when_disabled(id: &str) -> bool { /// Menu items another item stands in for right now: Envelope Distort's Reset with Warp and Reset /// with Mesh take the place of Make with Warp and Make with Mesh while an envelope is selected. -fn swapped_out(app: &VectorcraftApp, id: &str) -> bool { +/// `why_off` answers [`why_off`] for Release's id. +fn swapped_out(id: &str, why_off: &mut dyn FnMut(&str) -> Option>) -> bool { let reset = match id { "object.envelope.makeWithWarp" | "object.envelope.makeWithMesh" => false, "object.envelope.resetWithWarp" | "object.envelope.resetWithMesh" => true, _ => return false, }; - enabled(app, "object.envelope.release") != reset + why_off("object.envelope.release").is_none() != reset } /// Menu items shown only with Preferences › Type › Show East Asian Options on: Type › Composite @@ -173,16 +174,21 @@ fn east_asian_hidden(app: &VectorcraftApp, id: &str) -> bool { /// another stands in for ([`swapped_out`]) or an East Asian item with those options hidden /// ([`east_asian_hidden`]). pub fn shown_state(app: &VectorcraftApp, id: &str, p: &Value) -> Option<(bool, Option)> { - shown_state_with(app, id, p, &why_off(app, id)) + shown_state_with(app, id, p, &mut |id| why_off(app, id)) } -/// [`shown_state`] from `why`, what [`why_off`] answered for `id`: a caller that also writes the reason a dimmed row -/// gives runs the command's check once. -pub(crate) fn shown_state_with(app: &VectorcraftApp, id: &str, p: &Value, why: &Option>) -> Option<(bool, Option)> { - let en = why.is_none() +/// [`shown_state`] with `why_off` answering [`why_off`] for each command id it asks about: a caller that keeps the +/// answers runs each command's check once. +pub(crate) fn shown_state_with( + app: &VectorcraftApp, + id: &str, + p: &Value, + why_off: &mut dyn FnMut(&str) -> Option>, +) -> Option<(bool, Option)> { + let en = why_off(id).is_none() && (id != crate::addons::select::link_status::COMMAND || crate::addons::select::link_status::enabled(app, p)) && (!vectorcraft_engine::cmd::plugin::is_command_id(id) || crate::dialogs::plugin::canvas_item_enabled(app, id, p)); - if (!en && hidden_when_disabled(id)) || swapped_out(app, id) || east_asian_hidden(app, id) { + if (!en && hidden_when_disabled(id)) || swapped_out(id, why_off) || east_asian_hidden(app, id) { return None; } Some((en, checked(app, id, p))) From 152a4ac5f61eddd675019151c74ff2a45c861b5c Mon Sep 17 00:00:00 2001 From: Codex Date: Sun, 29 Nov 2026 20:47:54 +0100 Subject: [PATCH 020/105] Validate release RPM installs and GUI startup on target distributions --- .github/scripts/release-rpm-smoke.py | 65 +++++++++++++++++++ .github/workflows/release-rpm-smoke.yml | 86 +++++++++++++++++++++++++ 2 files changed, 151 insertions(+) create mode 100644 .github/scripts/release-rpm-smoke.py create mode 100644 .github/workflows/release-rpm-smoke.yml diff --git a/.github/scripts/release-rpm-smoke.py b/.github/scripts/release-rpm-smoke.py new file mode 100644 index 0000000000..f82b70675a --- /dev/null +++ b/.github/scripts/release-rpm-smoke.py @@ -0,0 +1,65 @@ +"""Check a real installed release RPM and exercise the GUI control channel.""" + +import json +import os +from pathlib import Path +import socket +import subprocess +import time + +results = Path("/results") +requirements = (results / "rpm-requires.txt").read_text() +for capability in ( + "libc.so.6()(64bit)", + "libm.so.6(GLIBC_2.35)(64bit)", + "libgcc_s.so.1()(64bit)", + "libxkbcommon.so.0()(64bit)", + "(libvulkan.so.1()(64bit) or libEGL.so.1()(64bit))", +): + if capability not in requirements.splitlines(): + raise RuntimeError(f"Missing RPM requirement: {capability}") + +version = subprocess.check_output(["vectorcraft-cli", "--version"], text=True) +(results / "cli-version.txt").write_text(version) +# Original fixture authored for this package smoke test; no external artwork. +fixture = results / "original-smoke.svg" +fixture.write_text('' + '' + '') +env = dict(os.environ, VECTORCRAFT_NO_PREFS="1", XDG_RUNTIME_DIR="/tmp/vectorcraft-runtime") +Path(env["XDG_RUNTIME_DIR"]).mkdir(mode=0o700, exist_ok=True) +with (results / "gui.log").open("w") as log: + app = subprocess.Popen([ + "vectorcraft", "--control", "32180", "--automation-read-root", str(results), + "--automation-write-root", str(results), str(fixture), + ], stdout=log, stderr=subprocess.STDOUT, env=env) + try: + deadline = time.monotonic() + 90 + while True: + if app.poll() is not None: + raise RuntimeError(f"GUI exited during startup: {app.returncode}") + try: + channel = socket.create_connection(("127.0.0.1", 32180), timeout=5) + break + except OSError: + if time.monotonic() >= deadline: + raise RuntimeError("GUI control channel did not become ready") from None + time.sleep(1) + channel.settimeout(30) + with channel, channel.makefile("rwb") as stream: + for request_id, method, params in ( + (1, "ui.inspect", {}), + ): + stream.write((json.dumps(dict(id=request_id, method=method, params=params)) + "\n").encode()) + stream.flush() + response = json.loads(stream.readline()) + (results / f"{method}.json").write_text(json.dumps(response, indent=2)) + if response.get("id") != request_id or response.get("ok") is not True: + raise RuntimeError(f"GUI request failed: {method}") + finally: + app.terminate() + try: + app.wait(timeout=10) + except subprocess.TimeoutExpired: + app.kill() + app.wait() diff --git a/.github/workflows/release-rpm-smoke.yml b/.github/workflows/release-rpm-smoke.yml new file mode 100644 index 0000000000..440da7429d --- /dev/null +++ b/.github/workflows/release-rpm-smoke.yml @@ -0,0 +1,86 @@ +name: Release RPM smoke + +on: + workflow_dispatch: + inputs: + run-id: + description: Release workflow run containing the RPM artifacts (empty selects latest release branch run) + type: string + default: "" + pull_request: + paths: + - .github/workflows/release-rpm-smoke.yml + - .github/scripts/release-rpm-smoke.py + +permissions: + contents: read + actions: read + +jobs: + smoke: + timeout-minutes: 25 + strategy: + fail-fast: false + matrix: + platform: + - {arch: x86_64, runner: ubuntu-24.04} + - {arch: aarch64, runner: ubuntu-24.04-arm} + distro: [fedora, rocky, opensuse] + runs-on: ${{ matrix.platform.runner }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + persist-credentials: false + - name: Download the release packages + env: + GH_TOKEN: ${{ github.token }} + RUN_ID: ${{ inputs.run-id }} + ARCH: ${{ matrix.platform.arch }} + run: | + if [ -z "$RUN_ID" ]; then + RUN_ID=$(gh run list --workflow release.yml --branch release --limit 1 --json databaseId --jq '.[0].databaseId') + fi + [[ "$RUN_ID" =~ ^[0-9]+$ ]] + mkdir -p packages results + gh run view "$RUN_ID" --json headSha,url > results/source.json + gh run download "$RUN_ID" --name "release-linux-$ARCH" --dir packages + sha256sum packages/*.rpm > results/rpm-sha256.txt + - name: Install and start the RPM on the target distribution + env: + DISTRO: ${{ matrix.distro }} + run: | + sudo apt-get update -qq + sudo apt-get install -y xvfb + Xvfb :99 -screen 0 1440x900x24 -ac -nolisten tcp > results/xvfb.log 2>&1 & + for attempt in {1..20}; do + [ -S /tmp/.X11-unix/X99 ] && break + sleep 1 + done + case "$DISTRO" in + fedora) image=fedora:latest ;; + rocky) image=rockylinux:10 ;; + opensuse) image=opensuse/tumbleweed:latest ;; + esac + docker pull "$image" + docker image inspect "$image" --format '{{json .RepoDigests}}' > results/container-digest.json + docker run --rm --name rpm-smoke -e DISTRO -e DISPLAY=:99 -e LIBGL_ALWAYS_SOFTWARE=1 \ + -v /tmp/.X11-unix:/tmp/.X11-unix:ro -v "$PWD/packages:/packages:ro" \ + -v "$PWD/results:/results" -v "$PWD/.github/scripts:/checks:ro" "$image" bash -euc ' + cat /etc/os-release > /results/os-release.txt + if [ "$DISTRO" = opensuse ]; then + zypper --non-interactive refresh + zypper --non-interactive install python3 Mesa-dri Mesa-libEGL1 libX11-6 libXcursor1 libXi6 libXrandr2 libxkbcommon0 + zypper --non-interactive --no-gpg-checks install /packages/*.rpm + else + dnf -y install python3 mesa-dri-drivers mesa-libEGL libX11 libXcursor libXi libXrandr libxkbcommon + dnf -y --nogpgcheck install /packages/*.rpm + fi + rpm -qp --requires /packages/*.rpm > /results/rpm-requires.txt + python3 /checks/release-rpm-smoke.py + ' + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 + if: always() + with: + name: rpm-smoke-${{ matrix.distro }}-${{ matrix.platform.arch }} + path: results/ + if-no-files-found: error From 61ef079f6d8a7657b486f1a4a96b9d11c46899a1 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 11:54:12 -0800 Subject: [PATCH 021/105] =?UTF-8?q?Menus:=20Expand=E2=80=A6=20checks=20the?= =?UTF-8?q?=20selection's=20appearance=20once=20per=20rebuild?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each menu rebuild walked the selection's appearance twice for Object › Expand…: once in the row's check and again for its tooltip. With 10,000 objects selected the walk costs about 6 ms each time. The row's check now returns the "Expand Appearance first" reason, and the tooltip reads it from that answer. Picking a dimmed Expand… in the command palette now adds that reason to the status line's "not available right now". A new test counts the walks per rebuild: 1 with a plain or two-fill rectangle selected (2 before), 0 with nothing selected. --- crates/ui-egui/src/menus/model.rs | 30 ++++++++++++++++++++++++++++-- crates/ui-egui/src/menus/state.rs | 25 +++++++++++++++++++++---- 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/crates/ui-egui/src/menus/model.rs b/crates/ui-egui/src/menus/model.rs index fffff70049..e3c6f74d74 100644 --- a/crates/ui-egui/src/menus/model.rs +++ b/crates/ui-egui/src/menus/model.rs @@ -556,8 +556,10 @@ impl Build<'_> { state = state.checked(on); } let mut item = item; - let tip = if id == "ui.expandDialog" && vectorcraft_engine::cmd::expand::has_appearance(&self.app.session) { - Some(crate::i18n::tr(self.lang, crate::dialogs::expand::appearance_first()).to_string()) + // Expand… dimmed for appearance attributes says so in its tooltip; `why` holds what its check found. + let appearance_first = crate::dialogs::expand::appearance_first(); + let tip = if id == "ui.expandDialog" && why.as_ref().is_some_and(|w| w.as_deref() == Some(appearance_first)) { + Some(crate::i18n::tr(self.lang, appearance_first).to_string()) } else if enabled { None } else { @@ -677,4 +679,28 @@ mod tests { assert!(app.menus.states.get(&CommandRef::new(id)).is_some_and(|s| !s.is_enabled()), "{id} is still dimmed"); } } + + /// A rebuild walks the selection's appearance once for Object › Expand…, for its state and its tooltip together. + #[test] + fn a_rebuild_walks_the_appearance_once_for_expand() { + let (mut app, ctx) = app_with_document(); + let expand = CommandRef::new("ui.expandDialog"); + let tooltip = |app: &VectorcraftApp| app.menus.bar.items().into_iter().find(|it| it.command == expand).and_then(|it| it.tooltip.clone()); + let walks = |app: &mut VectorcraftApp| { + super::super::state::APPEARANCE_WALKS.set(0); + refresh(app, &ctx); + super::super::state::APPEARANCE_WALKS.get() + }; + app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap(); + assert_eq!(walks(&mut app), 1, "a plain rectangle"); + assert!(app.menus.states.get(&expand).is_some_and(CommandState::is_enabled)); + assert_eq!(tooltip(&app), None); + app.run("appearance.addFill", json!({})).unwrap(); + assert_eq!(walks(&mut app), 1, "two fills"); + assert!(app.menus.states.get(&expand).is_some_and(|s| !s.is_enabled())); + assert_eq!(tooltip(&app).as_deref(), Some(crate::dialogs::expand::appearance_first())); + app.run("select.none", json!({})).unwrap(); + assert_eq!(walks(&mut app), 0, "nothing selected"); + assert_ne!(tooltip(&app).as_deref(), Some(crate::dialogs::expand::appearance_first())); + } } diff --git a/crates/ui-egui/src/menus/state.rs b/crates/ui-egui/src/menus/state.rs index 80fb7475ad..ad272f6236 100644 --- a/crates/ui-egui/src/menus/state.rs +++ b/crates/ui-egui/src/menus/state.rs @@ -295,9 +295,30 @@ pub(crate) fn why_off(app: &VectorcraftApp, id: &str) -> Option> Err(why) => Some(Some(why)), }; } + if id == "ui.expandDialog" { + return expand_dialog_off(app); + } (!ui_enabled(app, id)).then_some(None) } +#[cfg(test)] +thread_local! { + /// How many times [`expand_dialog_off`] walked the selection's appearance on this thread. + pub(crate) static APPEARANCE_WALKS: std::cell::Cell = const { std::cell::Cell::new(0) }; +} + +/// Why Object › Expand… can't open now: dimmed with nothing selected, and with +/// [`crate::dialogs::expand::appearance_first`] for appearance attributes, which Expand Appearance expands first +/// (#3089). The selection's appearance is walked once, for the row's state and its tooltip together. +fn expand_dialog_off(app: &VectorcraftApp) -> Option> { + if !app.session.active().is_some_and(|d| !d.selection.is_empty()) { + return Some(None); + } + #[cfg(test)] + APPEARANCE_WALKS.set(APPEARANCE_WALKS.get() + 1); + vectorcraft_engine::cmd::expand::has_appearance(&app.session).then(|| Some(crate::dialogs::expand::appearance_first().to_string())) +} + /// Can UI command `id` run now? fn ui_enabled(app: &VectorcraftApp, id: &str) -> bool { match id { @@ -388,10 +409,6 @@ fn ui_enabled(app: &VectorcraftApp, id: &str) -> bool { id if id.starts_with(crate::panels::symbols::USER_SLOT) => crate::panels::symbols::user_library(app, id).is_some(), "ui.saveBrushLibrary" => crate::panels::brushes::has_brushes(app), id if id.starts_with(crate::panels::brushes::USER_SLOT) => crate::panels::brushes::user_library(app, id).is_some(), - // Dimmed for appearance attributes, which Expand Appearance expands first (#3089). - "ui.expandDialog" => { - app.session.active().is_some_and(|d| !d.selection.is_empty()) && !vectorcraft_engine::cmd::expand::has_appearance(&app.session) - } "ui.spotColors" => app.session.active().is_some(), "ui.menuDialog" => app.session.active().is_some_and(|d| !d.selection.is_empty()), "ui.simplifyAuto" | "ui.simplifyMoreOptions" => crate::dialogs::simplify_slider::showing(app), From 1dc94103dafb7722e41f85dc9e2ca66fa62688df Mon Sep 17 00:00:00 2001 From: Codex Date: Sun, 29 Nov 2026 20:55:27 +0100 Subject: [PATCH 022/105] Check virtual display readiness and share its IPC namespace --- .github/workflows/release-rpm-smoke.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-rpm-smoke.yml b/.github/workflows/release-rpm-smoke.yml index 440da7429d..3486333a2b 100644 --- a/.github/workflows/release-rpm-smoke.yml +++ b/.github/workflows/release-rpm-smoke.yml @@ -56,6 +56,7 @@ jobs: [ -S /tmp/.X11-unix/X99 ] && break sleep 1 done + [ -S /tmp/.X11-unix/X99 ] case "$DISTRO" in fedora) image=fedora:latest ;; rocky) image=rockylinux:10 ;; @@ -63,7 +64,7 @@ jobs: esac docker pull "$image" docker image inspect "$image" --format '{{json .RepoDigests}}' > results/container-digest.json - docker run --rm --name rpm-smoke -e DISTRO -e DISPLAY=:99 -e LIBGL_ALWAYS_SOFTWARE=1 \ + docker run --rm --ipc=host --name rpm-smoke -e DISTRO -e DISPLAY=:99 -e LIBGL_ALWAYS_SOFTWARE=1 \ -v /tmp/.X11-unix:/tmp/.X11-unix:ro -v "$PWD/packages:/packages:ro" \ -v "$PWD/results:/results" -v "$PWD/.github/scripts:/checks:ro" "$image" bash -euc ' cat /etc/os-release > /results/os-release.txt From 7a09189a8811afcf751d54d9c009c09c29b6063a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 12:32:19 -0800 Subject: [PATCH 023/105] Menus: panel menu states skip three selection walks on each rebuild The menus rebuild every panel menu's states on each edit and selection change. With 10,000 objects selected, three of those menus walked the whole selection for values they did not use or had already read: - Make Opacity Mask's check sorted the selection into paint order for its outermost objects before testing whether the selection has one subject root, and it is enabled without that sort for any other count. The check now sorts only for one root and no target. - The Transparency menu built the panel's full values (opacity, blend mode, isolation and knockout compared across the selection) to read its first target. It now reads that target alone (`Session::transparency_target`), and checks Make Opacity Mask only when that object has no mask, the only case whose rows show it. - The Color and Color Wheel menus asked the session whether the fill and stroke differ, once in the Color menu and twice in the Color Wheel menu. They now read the proxies' per-revision cache, which the Tools panel's proxies fill on the same revision. On a test document of 10,000 rectangles, all selected, one pass over the panel menus' states took 24 to 31 ms before and 16.5 to 17 ms after (release build, four passes each). --- crates/engine/src/cmd/opacitymask.rs | 45 +++++++++++++++++++-- crates/ui-egui/src/menus.rs | 2 + crates/ui-egui/src/panels.rs | 49 ++++++++++++++++++++++- crates/ui-egui/src/panels/color.rs | 13 +++--- crates/ui-egui/src/panels/color_wheel.rs | 5 ++- crates/ui-egui/src/panels/transparency.rs | 32 +++++++++++++-- 6 files changed, 130 insertions(+), 16 deletions(-) diff --git a/crates/engine/src/cmd/opacitymask.rs b/crates/engine/src/cmd/opacitymask.rs index a64d038d8f..bc07e7ccb5 100644 --- a/crates/engine/src/cmd/opacitymask.rs +++ b/crates/engine/src/cmd/opacitymask.rs @@ -185,14 +185,27 @@ fn can_change_mask(s: &Session) -> std::result::Result<(), String> { /// most one outermost object, which it masks with `ids` (a call's `ids` stand in for the selection /// here). A targeted layer is one subject root however many objects it selects. `make` itself /// refuses any single target in those modes, a layer included, so a selection with a target counts -/// as one object. +/// as one object. The check sorts the selection into paint order for its outermost objects only when it has one +/// subject root and no target. fn can_make(s: &Session) -> std::result::Result<(), String> { has_doc(s)?; let Some(st) = s.active() else { return Ok(()) }; let roots = super::appearance::subject_roots(s).map_or(0, |r| r.len()); - let outermost = super::edit::outermost(&st.doc, st.selection.in_paint_order(&st.doc)).len(); - let targeted = st.selection.target.is_some(); - if roots == 1 && (outermost <= 1 || targeted) { super::maskedit::can_edit_mask(s) } else { Ok(()) } + if roots != 1 { + return Ok(()); + } + let one = st.selection.target.is_some() || { + #[cfg(test)] + OUTERMOST_FOUND.set(OUTERMOST_FOUND.get() + 1); + super::edit::outermost(&st.doc, st.selection.in_paint_order(&st.doc)).len() <= 1 + }; + if one { super::maskedit::can_edit_mask(s) } else { Ok(()) } +} + +#[cfg(test)] +thread_local! { + /// How many times [`can_make`] found the selection's outermost objects on this thread. + static OUTERMOST_FOUND: std::cell::Cell = const { std::cell::Cell::new(0) }; } fn make(s: &mut Session, p: &Value) -> Result { @@ -485,6 +498,12 @@ impl Session { _ => TransparencyInfo::default(), } } + + /// The first of the objects the Transparency panel shows ([`TransparencyInfo::ids`]), without comparing their + /// values. + pub fn transparency_target(&self) -> Option { + transparency_targets(self, &Value::Null).ok()?.first().copied() + } } fn info(s: &mut Session, p: &Value) -> Result { @@ -759,4 +778,22 @@ mod tests { let back = vectorcraft_format::load(&bytes).unwrap(); assert_eq!(back.node(NodeId(a)).unwrap().extras().mask, d.node(NodeId(a)).unwrap().extras().mask); } + + /// Make Opacity Mask's check sorts the selection for its outermost objects only when the selection has one + /// subject root; with several roots it is enabled without that sort. + #[test] + fn the_make_check_sorts_only_a_selection_with_one_root() { + let (mut s, a, b) = session_with_two(); + let found = || OUTERMOST_FOUND.get(); + select(&mut s, &[a, b]); + let before = found(); + assert_eq!(can_make(&s), Ok(())); + assert_eq!(found(), before, "two roots: no paint-order sort"); + select(&mut s, &[a]); + assert_eq!(can_make(&s), Ok(())); + assert_eq!(found(), before + 1, "one root: the outermost objects are found"); + s.execute("select.none", &json!({})).unwrap(); + assert_eq!(can_make(&s), Ok(())); + assert_eq!(found(), before + 1, "no roots: no sort"); + } } diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index d017a1a181..568b9a36d3 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -92,6 +92,8 @@ pub use run::{check_params, run_ui_command}; pub(crate) use run::{normalize_panel, opt_bool, opt_index, opt_number}; #[cfg(test)] use slots::RECENT_FONT_IDS; +#[cfg(test)] +pub(crate) use state::WHY_OFF_ASKED; pub use state::{checked, enabled, plugin_revision, shortcut_of, shown_state}; pub(crate) use state::{command_shortcuts, shown_state_with, why_off}; pub(crate) use submenus::PATH_EFFECTS; diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index 2ebca9a8bc..2d1ea7cfb9 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -681,13 +681,35 @@ pub(crate) fn mixed_paints(app: &VectorcraftApp, ctx: &egui::Context) -> (bool, match pstate::>(ctx, "proxy-mixed") { Some((k, mixed)) if k == key => mixed, _ => { - let mixed = app.session.proxy_mixed(); + let mixed = walk_mixed_paints(app); set_pstate(ctx, "proxy-mixed", Some((key, mixed))); mixed } } } +/// [`mixed_paints`] for readers without a `Ui`, such as the panel menus' states: from the same cache while the app +/// has its interface context, else from a walk of the selection. +pub(crate) fn mixed_paints_now(app: &VectorcraftApp) -> (bool, bool) { + match &app.ui_ctx { + Some(ctx) => mixed_paints(app, ctx), + None => walk_mixed_paints(app), + } +} + +/// [`vectorcraft_engine::Session::proxy_mixed`], which walks the selection. +fn walk_mixed_paints(app: &VectorcraftApp) -> (bool, bool) { + #[cfg(test)] + MIXED_PAINT_WALKS.set(MIXED_PAINT_WALKS.get() + 1); + app.session.proxy_mixed() +} + +#[cfg(test)] +thread_local! { + /// How many times [`walk_mixed_paints`] walked the selection on this thread. + pub(crate) static MIXED_PAINT_WALKS: std::cell::Cell = const { std::cell::Cell::new(0) }; +} + /// The stroke the Stroke panel, Control bar and Properties show: while the Type tool edits text, /// the selected characters' stroke, else [`vectorcraft_engine::Session::shown_stroke`]. pub(crate) fn current_stroke(app: &VectorcraftApp) -> Option { @@ -1108,6 +1130,31 @@ pub(crate) fn popover_body(ui: &mut Ui, mut body: impl FnMut(&mut Ui) -> R) - mod tests { use super::*; + /// The panel menus' states (the Color and Color Wheel menus) read whether the fill and stroke differ from the + /// proxies' cache: one walk of the selection for each revision, which the proxies read too. + #[test] + fn panel_menu_states_walk_the_mixed_paints_once_per_revision() { + let mut app = crate::VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + let ctx = crate::testing::ui_context(); + app.adopt_context(&ctx); + app.run("file.new", json!({"width": 200, "height": 200})).unwrap(); + for x in [10, 60, 110] { + app.run("shape.rectangle", json!({"x": x, "y": 10, "width": 40, "height": 40})).unwrap(); + } + app.run("select.all", json!({})).unwrap(); + let walks = || MIXED_PAINT_WALKS.get(); + let start = walks(); + let mut states = CommandStates::new(); + panel_menu_states(&app, &mut states); + assert_eq!(walks(), start + 1, "the menus walk the selection once"); + panel_menu_states(&app, &mut states); + assert_eq!(mixed_paints(&app, &ctx), (false, false)); + assert_eq!(walks(), start + 1, "the same revision is not walked again, by the menus or the proxies"); + app.run("paint.setFill", json!({"color": "#ff0000"})).unwrap(); + panel_menu_states(&app, &mut states); + assert_eq!(walks(), start + 2, "an edit is walked again"); + } + #[test] fn proxy_events_run_their_commands() { let ran = |activated, double, swap, defaults| -> Vec<(&'static str, Value)> { proxy_commands(activated, double, swap, defaults) }; diff --git a/crates/ui-egui/src/panels/color.rs b/crates/ui-egui/src/panels/color.rs index 6208c22cb3..ba0c6cf7a3 100644 --- a/crates/ui-egui/src/panels/color.rs +++ b/crates/ui-egui/src/panels/color.rs @@ -314,14 +314,14 @@ fn target(app: &VectorcraftApp, ui: &Ui) -> Target { target_with(app, super::active_mixed(app, ui.ctx())) } -/// Whether the active proxy is "?", read from the session (the panel reads its per-frame cache). +/// Whether the active proxy is "?", from the proxies' cache ([`super::mixed_paints_now`]). fn mixed_now(app: &VectorcraftApp) -> bool { - let (fill, stroke) = app.session.proxy_mixed(); + let (fill, stroke) = super::mixed_paints_now(app); if app.session.fill_active { fill } else { stroke } } /// [`target`] with `mixed` for a "?" active proxy: the panel reads it from its per-frame cache, -/// `ui.colorPanel` from the session. +/// `ui.colorPanel` and the panel menus through [`mixed_now`]. fn target_with(app: &VectorcraftApp, mixed: bool) -> Target { if mixed { return Target::Paint(None, None); @@ -440,7 +440,7 @@ pub(crate) fn apply_output(app: &mut VectorcraftApp, out: &ColorPanelOutput) { apply_with(app, &tgt, out); } -/// [`target`] with the session's "?" state, for callers without the panel's pass. +/// [`target`] with the "?" state of [`mixed_now`], for callers without the panel's pass. pub(crate) fn target_now(app: &VectorcraftApp) -> Target { target_with(app, mixed_now(app)) } @@ -616,8 +616,9 @@ pub(crate) fn menu_rows(_app: &VectorcraftApp) -> Vec { /// The checks, titles and enabled states of [`menu_rows`]: the mode the panel shows is checked, and /// the rows that need a colour are off without one. pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { - let tgt = target_now(app); - let has_color = tgt.color().is_some() || mixed_now(app); + let mixed = mixed_now(app); + let tgt = target_with(app, mixed); + let has_color = tgt.color().is_some() || mixed; for (command, state) in ColorPanelMenu::states(LAYOUT, &app.ui.color_panel, &shown(app, &tgt), has_color) { let state = if command == ColorPanelCommand::NewSwatch && !crate::menus::enabled(app, "swatch.new") { state.enabled(false) } else { state }; states.set(command, state); diff --git a/crates/ui-egui/src/panels/color_wheel.rs b/crates/ui-egui/src/panels/color_wheel.rs index 3e706b06c1..c0389af045 100644 --- a/crates/ui-egui/src/panels/color_wheel.rs +++ b/crates/ui-egui/src/panels/color_wheel.rs @@ -618,14 +618,15 @@ pub(crate) fn menu_rows(_app: &VectorcraftApp) -> Vec { /// without a solid color, and CSS oklch() also while the active document's RGB space is not sRGB. pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { let srgb = cms::active().rgb_is_srgb(); - for item in items(&app.ui.color_wheel, srgb, target_now(app).color()) { + let color = target_now(app).color(); + for item in items(&app.ui.color_wheel, srgb, color) { let mut state = CommandState::new().title(item.label).enabled(item.enabled).checked(item.checked); if let Some(hint) = item.hint { state = state.hint(hint); } states.set(CommandRef::new(row_id(&item.id)), state); } - let has_color = target_now(app).color().is_some(); + let has_color = color.is_some(); for (notation, label) in copy_notations() { let oklch = notation == "oklch"; let mut state = CommandState::new().title(label.to_string()).enabled(has_color && (srgb || !oklch)); diff --git a/crates/ui-egui/src/panels/transparency.rs b/crates/ui-egui/src/panels/transparency.rs index 193837507e..8b814eac71 100644 --- a/crates/ui-egui/src/panels/transparency.rs +++ b/crates/ui-egui/src/panels/transparency.rs @@ -380,11 +380,13 @@ fn mask_items(mask: Option<&OpacityMask>, can_make: bool) -> [(&'static str, &'s } /// The masked object's mask, also while editing it (the selection then is the mask art), whether the -/// object controls apply, and whether Make is possible. +/// object controls apply, and whether Make is possible. Make's check runs only for an object without a mask, the one +/// case whose rows read it ([`mask_items`]). fn menu_context(app: &VectorcraftApp) -> (Option>, bool, bool) { let editing = app.session.active().is_some_and(|d| d.doc.mask_edit.is_some()); - let n = first_node(app, &app.session.transparency_info()); - let can_make = n.is_some() && !editing && crate::menus::enabled(app, "transparency.makeOpacityMask"); + let n = app.session.transparency_target().and_then(|id| super::layers::node_arc(&app.session.active()?.doc, id)); + let unmasked = n.as_ref().is_some_and(|n| n.extras().mask.is_none()); + let can_make = unmasked && !editing && crate::menus::enabled(app, "transparency.makeOpacityMask"); (n, object_controls(app, editing), can_make) } @@ -452,6 +454,30 @@ mod tests { app } + /// The menu's states check Make Opacity Mask only for a first object without a mask: a masked one shows Release, + /// Disable and Unlink instead, and Make dimmed without its check. + #[test] + fn the_menu_checks_make_only_for_an_object_without_a_mask() { + let mut app = new_app(); + let rectangle = |app: &mut VectorcraftApp, x| run_cmd(app, "shape.rectangle", json!({"x": x, "y": 10, "width": 20, "height": 20})); + let masked = rectangle(&mut app, 10)["id"].clone(); + let art = rectangle(&mut app, 12)["id"].clone(); + let plain = rectangle(&mut app, 50)["id"].clone(); + run_cmd(&mut app, "transparency.makeOpacityMask", json!({"ids": [masked, art]})); + // How many times the states asked for Make's check, and whether Make is enabled. + let asked = |app: &VectorcraftApp| { + let mut states = CommandStates::new(); + crate::menus::WHY_OFF_ASKED.with_borrow_mut(Vec::clear); + menu_states(app, &mut states); + let make = crate::menus::WHY_OFF_ASKED.take().iter().filter(|a| *a == "transparency.makeOpacityMask").count(); + (make, states.get(&CommandRef::new("transparency.makeOpacityMask")).is_some_and(CommandState::is_enabled)) + }; + run_cmd(&mut app, "select.set", json!({"ids": [masked]})); + assert_eq!(asked(&app), (0, false), "a masked object: Make is dimmed without its check"); + run_cmd(&mut app, "select.set", json!({"ids": [plain]})); + assert_eq!(asked(&app), (1, true), "an object without a mask: Make's check runs once"); + } + #[test] fn transparency_shows_each_selected_symbol_parts_values() { let mut app = new_app(); From 28d0f76bfebe1335f7847947ac97b74fed4c69a5 Mon Sep 17 00:00:00 2001 From: Codex Date: Sun, 29 Nov 2026 21:34:39 +0100 Subject: [PATCH 024/105] Select one available release artifact pair for every RPM smoke job --- .github/workflows/release-rpm-smoke.yml | 33 +++++++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-rpm-smoke.yml b/.github/workflows/release-rpm-smoke.yml index 3486333a2b..53bab7ff7e 100644 --- a/.github/workflows/release-rpm-smoke.yml +++ b/.github/workflows/release-rpm-smoke.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: run-id: - description: Release workflow run containing the RPM artifacts (empty selects latest release branch run) + description: Release run containing both RPM artifacts (empty selects the latest available pair) type: string default: "" pull_request: @@ -17,7 +17,33 @@ permissions: actions: read jobs: + source: + runs-on: ubuntu-24.04 + timeout-minutes: 5 + outputs: + run-id: ${{ steps.source.outputs.run-id }} + steps: + - id: source + env: + GH_TOKEN: ${{ github.token }} + RUN_ID: ${{ inputs.run-id }} + run: | + candidates="$RUN_ID" + if [ -z "$candidates" ]; then + candidates=$(gh run list --repo "$GITHUB_REPOSITORY" --workflow release.yml --branch release --limit 10 --json databaseId --jq '.[].databaseId') + fi + for candidate in $candidates; do + [[ "$candidate" =~ ^[0-9]+$ ]] + names=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$candidate/artifacts?per_page=100" --jq '.artifacts[] | select(.expired == false) | .name') + if grep -Fxq release-linux-x86_64 <<< "$names" && grep -Fxq release-linux-aarch64 <<< "$names"; then + printf 'run-id=%s\n' "$candidate" >> "$GITHUB_OUTPUT" + exit 0 + fi + done + echo '::error::No release run has both Linux package artifacts available' + exit 1 smoke: + needs: source timeout-minutes: 25 strategy: fail-fast: false @@ -34,12 +60,9 @@ jobs: - name: Download the release packages env: GH_TOKEN: ${{ github.token }} - RUN_ID: ${{ inputs.run-id }} + RUN_ID: ${{ needs.source.outputs.run-id }} ARCH: ${{ matrix.platform.arch }} run: | - if [ -z "$RUN_ID" ]; then - RUN_ID=$(gh run list --workflow release.yml --branch release --limit 1 --json databaseId --jq '.[0].databaseId') - fi [[ "$RUN_ID" =~ ^[0-9]+$ ]] mkdir -p packages results gh run view "$RUN_ID" --json headSha,url > results/source.json From dd95b7add4789064ba43481b4dd2ec8a38ed987a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 12:36:16 -0800 Subject: [PATCH 025/105] Canvas: the bounding box follows a drag in the frame the pointer moves The bounding box, the Live Corners widgets and the shape widgets were drawn before the tool host took the frame's pointer event, so during a Selection tool drag they showed where the art was one frame earlier. With Show Bounding Box While Moving and Drawing on, the box trailed the art on every frame of a move. They are display only, so they are now drawn after the tool host, like the selection's marks, and put back at their old place in the paint order through a PaintSlot. The tool overlays that are not framework controls (path marks, anchors, handles, labels and the rest) no longer get a child Ui each, so a list of 10,000 path marks makes none. Tests: with the box shown while moving, a Selection tool drag draws it at the object's new corner and none at the old one in each frame. --- crates/ui-egui/src/canvas.rs | 26 +++++++++++++++++--------- crates/ui-egui/src/canvas/overlays.rs | 21 ++++++++++++++++++++- crates/ui-egui/src/canvas/tests.rs | 15 +++++++++++++++ 3 files changed, 52 insertions(+), 10 deletions(-) diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index f340f3bac2..08f859b025 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -278,8 +278,8 @@ pub(crate) fn show_document(app: &mut VectorcraftApp, ui: &mut Ui, win: Win, kin pressed } -/// The body of the canvas in order: controls that take presses first, the tool host, the selection's marks, the -/// picture last. +/// The body of the canvas in order: controls that take presses first, the tool host, the selection's marks and the +/// display-only widgets over it, the picture last. fn show_body(app: &mut VectorcraftApp, ui: &mut Ui, space: &CanvasSpace, pass: Option<&ToolPass>, win: Win, kind: BodyKind) -> Body { let live = kind == BodyKind::Live; let presenting = app.ui.screen_mode == 3; @@ -299,11 +299,12 @@ fn show_body(app: &mut VectorcraftApp, ui: &mut Ui, space: &CanvasSpace, pass: O crate::dialogs::simplify_slider::show(app, ui, &space.view); } guides::show(app, ui, space, win, kind); - widgets::show_hollow_corners(app, ui, space, kind); - // The selection's marks paint here, under the widgets and bars, and are drawn after the tool host has taken this - // frame's pointer event, from the document as the event leaves it. + // The hollow Live Corners, the selection's marks, and the bounding box, Live Corners and shape widgets paint here + // in that order, under the 3D handles and the bars. All of them are display only and are drawn after the tool host + // has taken this frame's pointer event, from the document as the event leaves it. + let hollow = PaintSlot::reserve(ui.painter()); let marks = PaintSlot::reserve(ui.painter()); - widgets::show(app, ui, space, win, kind); + let shown_widgets = PaintSlot::reserve(ui.painter()); if !presenting && !revolve_editing(app) { crate::panels::three_d::handles::show(app, ui, space); } @@ -339,14 +340,21 @@ fn show_body(app: &mut VectorcraftApp, ui: &mut Ui, space: &CanvasSpace, pass: O crate::type_editing::show(app, ui); } } - let after = PaintSlot::reserve(ui.painter()); - selection::show(app, ui, space, win, kind); - marks.extend(ui.ctx(), after.take_after(ui.ctx())); + paint_into(ui, hollow, |ui| widgets::show_hollow_corners(app, ui, space, kind)); + paint_into(ui, marks, |ui| selection::show(app, ui, space, win, kind)); + paint_into(ui, shown_widgets, |ui| widgets::show(app, ui, space, win, kind)); drops::show(app, ui, win, kind); raster::picture(app, ui, space, win, kind); out } +/// Runs `draw` now and moves the shapes it paints on `ui`'s layer to `slot`, their place in the paint order. +fn paint_into(ui: &mut Ui, slot: PaintSlot, draw: impl FnOnce(&mut Ui)) { + let after = PaintSlot::reserve(ui.painter()); + draw(ui); + slot.extend(ui.ctx(), after.take_after(ui.ctx())); +} + /// The keys held now, as the engine's tools read them, with `space` set while Space is down. pub(crate) fn held_mods(ctx: &egui::Context) -> vectorcraft_tools::Mods { let (m, space) = ctx.input(|i| (i.modifiers, i.key_down(egui::Key::Space))); diff --git a/crates/ui-egui/src/canvas/overlays.rs b/crates/ui-egui/src/canvas/overlays.rs index 8f9bd6f663..8f70ceb024 100644 --- a/crates/ui-egui/src/canvas/overlays.rs +++ b/crates/ui-egui/src/canvas/overlays.rs @@ -35,7 +35,8 @@ pub(super) fn show(app: &VectorcraftApp, ui: &mut egui::Ui, space: &CanvasSpace, let options = super::selection::path_options(&app.session.prefs); let quiet = tool_adapter::in_gesture(app, ui.ctx()) || tool_adapter::view_tool_held(app); let lists = [extra, overlays]; - for (i, o) in extra.iter().chain(overlays).enumerate() { + // Only the overlays that are controls get a child `Ui`: a list of 10,000 path marks makes none. + for (i, o) in extra.iter().chain(overlays).enumerate().filter(|(_, o)| is_control(o)) { ui.push_id(("tool-control", i), |ui| show_control(ui, rect, o)); } for (i, list) in lists.into_iter().enumerate() { @@ -48,6 +49,24 @@ pub(super) fn show(app: &VectorcraftApp, ui: &mut egui::Ui, space: &CanvasSpace, }); } +/// Whether `o` is shown as a framework control of its own ([`show_control`]) rather than painted by [`ToolMarks`]. +fn is_control(o: &Overlay) -> bool { + match o { + Overlay::Marquee(_) | Overlay::SelectionMarquee { .. } | Overlay::SharedPath { .. } | Overlay::Distance { .. } => true, + Overlay::Path { .. } + | Overlay::Line { .. } + | Overlay::Anchor { .. } + | Overlay::CurvePoint { .. } + | Overlay::Handle { .. } + | Overlay::Label { .. } + | Overlay::Measure { .. } + | Overlay::Highlight { .. } + | Overlay::Swatch { .. } + | Overlay::GridLine { .. } + | Overlay::HoverText { .. } => false, + } +} + /// The framework control `o` stands for, if it is one: a marquee, a settled outline or a distance. fn show_control(ui: &mut egui::Ui, rect: ScreenRect, o: &Overlay) { match o { diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index ae6956a288..9aa346194f 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -303,7 +303,22 @@ fn press(at: Pos2, pressed: bool) -> egui::Event { /// object has after that frame's event, and none at the corner it had before it. #[test] fn a_selection_drag_draws_its_marks_in_the_frame_the_pointer_moves() { + selection_drag_marks_follow(drag_app()); +} + +/// With Show Bounding Box While Moving and Drawing on, a Selection tool drag draws the bounding box and its handles in +/// the frame the pointer moves: at the corner the object has after that frame's event, and none at the corner it had +/// before it. +#[test] +fn a_selection_drag_draws_its_bounding_box_in_the_frame_the_pointer_moves() { let mut app = drag_app(); + app.session.prefs.bounding_box_while_moving_and_drawing = true; + selection_drag_marks_follow(app); +} + +/// Drags a selected rectangle with the Selection tool in six frames and checks each frame that moved it: a mark at +/// its corner after the frame's event, none at its corner before. +fn selection_drag_marks_follow(mut app: VectorcraftApp) { let id = app.session.execute("shape.rectangle", &json!({"x": 150, "y": 100, "width": 60, "height": 40})).unwrap()["id"].as_u64().unwrap(); app.select_tool("selection"); app.session.execute("select.set", &json!({"ids": [id]})).unwrap(); From 971b9c05f78bc3ca04e68f0448a102b29482285c Mon Sep 17 00:00:00 2001 From: Codex Date: Sun, 29 Nov 2026 21:43:31 +0100 Subject: [PATCH 026/105] Provide the X11 keyboard library in RPM test desktops --- .github/workflows/release-rpm-smoke.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-rpm-smoke.yml b/.github/workflows/release-rpm-smoke.yml index 53bab7ff7e..a03620fd09 100644 --- a/.github/workflows/release-rpm-smoke.yml +++ b/.github/workflows/release-rpm-smoke.yml @@ -93,10 +93,10 @@ jobs: cat /etc/os-release > /results/os-release.txt if [ "$DISTRO" = opensuse ]; then zypper --non-interactive refresh - zypper --non-interactive install python3 Mesa-dri Mesa-libEGL1 libX11-6 libXcursor1 libXi6 libXrandr2 libxkbcommon0 + zypper --non-interactive install python3 Mesa-dri Mesa-libEGL1 libX11-6 libXcursor1 libXi6 libXrandr2 libxkbcommon0 libxkbcommon-x11-0 zypper --non-interactive --no-gpg-checks install /packages/*.rpm else - dnf -y install python3 mesa-dri-drivers mesa-libEGL libX11 libXcursor libXi libXrandr libxkbcommon + dnf -y install python3 mesa-dri-drivers mesa-libEGL libX11 libXcursor libXi libXrandr libxkbcommon libxkbcommon-x11 dnf -y --nogpgcheck install /packages/*.rpm fi rpm -qp --requires /packages/*.rpm > /results/rpm-requires.txt From 05464b264e357f69053aa9e8e60a7d2f057b1b5b Mon Sep 17 00:00:00 2001 From: Codex Date: Sun, 29 Nov 2026 21:45:52 +0100 Subject: [PATCH 027/105] Authenticate the RPM smoke control connection --- .github/scripts/release-rpm-smoke.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/scripts/release-rpm-smoke.py b/.github/scripts/release-rpm-smoke.py index f82b70675a..73dc871f1d 100644 --- a/.github/scripts/release-rpm-smoke.py +++ b/.github/scripts/release-rpm-smoke.py @@ -3,6 +3,7 @@ import json import os from pathlib import Path +import secrets import socket import subprocess import time @@ -26,7 +27,9 @@ fixture = results / "original-smoke.svg" fixture.write_text('' '' '') -env = dict(os.environ, VECTORCRAFT_NO_PREFS="1", XDG_RUNTIME_DIR="/tmp/vectorcraft-runtime") +token = secrets.token_hex(32) +env = dict(os.environ, VECTORCRAFT_NO_PREFS="1", XDG_RUNTIME_DIR="/tmp/vectorcraft-runtime", + VECTORCRAFT_CONTROL_TOKEN=token) Path(env["XDG_RUNTIME_DIR"]).mkdir(mode=0o700, exist_ok=True) with (results / "gui.log").open("w") as log: app = subprocess.Popen([ @@ -48,6 +51,7 @@ with (results / "gui.log").open("w") as log: channel.settimeout(30) with channel, channel.makefile("rwb") as stream: for request_id, method, params in ( + (0, "auth", {"token": token}), (1, "ui.inspect", {}), ): stream.write((json.dumps(dict(id=request_id, method=method, params=params)) + "\n").encode()) From 76aa6afeb000ec301176fe1b0900e16b4ea260d6 Mon Sep 17 00:00:00 2001 From: Codex Date: Sun, 29 Nov 2026 21:50:43 +0100 Subject: [PATCH 028/105] Mark the readiness loop counter intentionally unused --- .github/workflows/release-rpm-smoke.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-rpm-smoke.yml b/.github/workflows/release-rpm-smoke.yml index a03620fd09..4140f57f3d 100644 --- a/.github/workflows/release-rpm-smoke.yml +++ b/.github/workflows/release-rpm-smoke.yml @@ -75,7 +75,7 @@ jobs: sudo apt-get update -qq sudo apt-get install -y xvfb Xvfb :99 -screen 0 1440x900x24 -ac -nolisten tcp > results/xvfb.log 2>&1 & - for attempt in {1..20}; do + for _attempt in {1..20}; do [ -S /tmp/.X11-unix/X99 ] && break sleep 1 done From 950467b7de8bd1571ae8e97110c791bcfeb4658c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 12:55:18 -0800 Subject: [PATCH 029/105] Menus: the start of a drag keeps every row's state While an interaction is open (a move, scale or shape drag, a dialog's preview, a typing session), the menus' state key left the document revision out, so the key changed in the frame the interaction began and the menus rebuilt every row's state for it, on top of the rebuilds for the press and the release. A rebuild costs about 8 ms on small documents and about 160 ms with 10,000 objects selected. An interaction now records the revision it began from, and the key uses that revision while the interaction is open. The key stays the same as a drag begins and through its previews, and changes when it ends. The new test drives a Selection tool move through the whole app and counts the rebuilds in each frame: one for the press and one for the release, none as the move begins. --- crates/engine/src/interaction.rs | 3 +++ crates/engine/src/session/edit.rs | 1 + crates/ui-egui/src/canvas/tests.rs | 29 +++++++++++++++++++++++++++++ crates/ui-egui/src/menus/model.rs | 6 +++--- 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/interaction.rs b/crates/engine/src/interaction.rs index a2b9417461..bdc829fb37 100644 --- a/crates/engine/src/interaction.rs +++ b/crates/engine/src/interaction.rs @@ -10,6 +10,9 @@ pub struct Interaction { pub doc: Arc, /// The selection the previews start from (shared, so a preview frame copies nothing). pub selection: Arc, + /// The document's [`crate::DocState::revision`] when the interaction began. The previews change the document's + /// revision, and this value stays the same until the interaction ends. + pub revision: u64, pub preview: Option<(String, Value)>, /// The active tool began it (a drag): a command from outside the tool runs as a step of its /// own under it ([`crate::Session::outside_interaction`]). A dialog or a panel that begins an diff --git a/crates/engine/src/session/edit.rs b/crates/engine/src/session/edit.rs index d5d62e607c..0d2eaaef03 100644 --- a/crates/engine/src/session/edit.rs +++ b/crates/engine/src/session/edit.rs @@ -545,6 +545,7 @@ impl Session { effect: None, doc: st.doc.clone(), selection: Arc::new(st.selection.clone()), + revision: st.revision, preview: None, tool: false, paint, diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index ae6956a288..a51642ee92 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -841,6 +841,35 @@ fn the_move_of_a_releasing_frame_counts_for_the_tool_drag() { assert_eq!(draw(true), Rect::new(130.0, 115.0, 160.0, 130.0), "with Space held through the release the last move moves it"); } +/// A Selection tool move builds the menus' states again twice, in the frame of its press and in the frame of its +/// release, which commits the move. The frame the move begins in and the frames of its previews, which change the +/// document's revision, keep them. +#[test] +fn a_selection_move_rebuilds_the_menus_for_its_press_and_release_only() { + let (mut app, ctx, xf) = rectangle_tool(); + let id = app.session.execute("shape.rectangle", &json!({"x": 100, "y": 100, "width": 60, "height": 30})).unwrap()["id"].as_u64().unwrap(); + app.select_tool("selection"); + app.session.execute("select.set", &json!({"ids": [id]})).unwrap(); + let (from, to) = (xf.to_screen(Point::new(130.0, 115.0)), xf.to_screen(Point::new(170.0, 135.0))); + app_step(&mut app, &ctx, vec![egui::Event::PointerMoved(from)]); + for _ in 0..2 { + app_step(&mut app, &ctx, vec![]); + } + let none = egui::Modifiers::NONE; + let mut steps = vec![vec![primary(from, true, none)]]; + steps.extend((1..=8).map(|i| vec![egui::Event::PointerMoved(from.lerp(to, i as f32 / 8.0))])); + steps.push(vec![primary(to, false, none)]); + steps.extend([vec![], vec![], vec![]]); + let mut rebuilt = vec![]; + for events in steps { + let before = app.menus.rebuilds; + app_step(&mut app, &ctx, events); + rebuilt.push(app.menus.rebuilds - before); + } + assert_eq!(drawn_paths(&app), vec![Rect::new(140.0, 120.0, 200.0, 150.0)], "the drag moves the rectangle"); + assert_eq!(rebuilt, [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], "rebuilds in each frame: press, 8 moves, release, 3 idle"); +} + /// #6369: only the selection box remains over the temporary halftone, and the original /// selection's outlines come back when Preview is turned off or the dialog is cancelled. #[test] diff --git a/crates/ui-egui/src/menus/model.rs b/crates/ui-egui/src/menus/model.rs index fffff70049..92c1786af4 100644 --- a/crates/ui-egui/src/menus/model.rs +++ b/crates/ui-egui/src/menus/model.rs @@ -89,8 +89,8 @@ pub(crate) fn translate_label(english: &'static str) -> String { /// button pressed or released or a key pressed ([`last_press`]), changes once for each, which covers what the hash /// doesn't list (panels shown, a tool picked). While an /// interaction is open (for example a move, scale or shape drag, a dialog's or the font menu's -/// preview, or a typing session), the revision, which each of its previews changes, is left out: -/// the hash changes as the interaction begins and as it ends. +/// preview, or a typing session), the hash takes the revision the interaction began from in place of the current one, +/// which each of its previews changes: the hash stays the same as the interaction begins, and changes as it ends. pub(crate) fn state_key(app: &VectorcraftApp, input: Option) -> u64 { let mut h = DefaultHasher::new(); input.hash(&mut h); @@ -101,7 +101,7 @@ pub(crate) fn state_key(app: &VectorcraftApp, input: Option) -> u64 { let s = &app.session; (s.journal.len(), s.active_index(), s.clipboard.is_empty(), s.tool_composing()).hash(&mut h); if let Some(d) = s.active() { - let revision = d.interaction.is_none().then_some(d.revision); + let revision = d.interaction.as_ref().map_or(d.revision, |it| it.revision); (d.uid, revision, d.history.undo.len(), d.history.redo.len(), d.transparency_grid, d.print_tiling).hash(&mut h); } (app.system_paste, app.last_effect.is_some(), app.ui.recent_files.len(), app.ui.recent_files.first(), app.recent_fonts().len()).hash(&mut h); From 8e31fb06de54a46257000024823e59f1363efdf3 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 13:47:59 -0800 Subject: [PATCH 030/105] Properties: idle frames replay the Document sections' bodies With nothing selected, the Properties panel laid out the bodies of its Document, Rulers & Grids, Guides, Snap Options, Preferences and Quick Actions sections again in every frame. Each body now shows in a MemoView keyed on what it reads: the units, the artboard count, the snap settings, the keyboard increment and its unit, Scale Strokes & Effects and the interface language. A change in the command state of one of its buttons runs it again. The Units choice, the snap checkboxes and the preference edits come back through an Outbox and run after the section, as before. The section headers and the Appearance section still run in every frame. The new test counts the body runs: none over 10 idle frames, and runs again after a command changes what one shows. --- .../panels/properties/document_sections.rs | 311 ++++++++++++++---- 1 file changed, 251 insertions(+), 60 deletions(-) diff --git a/crates/ui-egui/src/panels/properties/document_sections.rs b/crates/ui-egui/src/panels/properties/document_sections.rs index e8c14ba4dd..4774bdb750 100644 --- a/crates/ui-egui/src/panels/properties/document_sections.rs +++ b/crates/ui-egui/src/panels/properties/document_sections.rs @@ -1,10 +1,10 @@ //! The Properties panel's Document sections, shown with nothing selected. -use craft::behavior::IconId; +use craft::behavior::{EditEvent, IconId}; use craft::keymap::CommandRef; use craft::ui::buttons::{Button, ToggleButton}; use craft::ui::choice::Checkbox; -use craft::ui::contract::{Bind, Entry, Props as _, Show as _, ShowContainer as _, Sizing}; +use craft::ui::contract::{Bind, Entry, MemoProps, MemoView, Outbox, Props as _, Show as _, ShowContainer as _, Sizing}; use craft::ui::form::Field; use craft::ui::layout_components::{Grid, Row}; use craft::ui::pickers::Select; @@ -17,84 +17,212 @@ use vectorcraft_doc::Unit; use super::artboard_sections::rearrange_button; use super::object_sections::HALVES; use crate::VectorcraftApp; +use crate::edits::EditPath; use crate::panels::transform; /// The panel with nothing selected: the document's units, Document Setup and artboards, the /// Appearance fill and stroke, the view's rulers, grids, guides and snapping, the keyboard /// increment and Scale Strokes & Effects, and Quick Actions. +/// +/// The body of every section but Appearance shows in a `MemoView` keyed on what it reads, so a +/// frame that changes none of it replays the body. What a body picks comes back through an `Outbox` +/// and runs after its section. pub(super) fn document_sections(app: &mut VectorcraftApp, ui: &mut Ui) { + let lang = crate::i18n::current(); let units = app.session.general_unit(); + let unit = Unit::ALL.iter().position(|u| *u == units).unwrap_or(usize::MAX); let artboards = app.session.active().map_or(0, |d| d.doc.artboards.len()); + let mut picked_units = Vec::new(); super::section(tl!("Document")).show(ui, |ui, _| { - Field::new(tl!("Units")).show(ui, |ui, _| { - let entries: Vec> = Unit::ALL.iter().map(|u| Entry::new(*u, u.label())).collect(); - let out = Select::new(tl!("Units"), Bind::given(units), &entries).show(ui); - if let Some(u) = out.events.committed() { - app.run("document.setUnits", json!({ "units": u.label() })).ok(); - } - }); - Grid::new(&HALVES).show(ui, |ui, _| { - Button::command(CommandRef::new("file.documentSetup")).label(tl!("Document Setup")).sizing(Sizing::FillWidth).show(ui); - Button::command(CommandRef::with_params("tool.select", json!({ "tool": "artboard" }))) - .label(tl!("Edit Artboards")) - .sizing(Sizing::FillWidth) - .show(ui); - if artboards > 1 { - rearrange_button(ui, artboards); - } - }); + let document = DocumentProps { unit, units, artboards, lang, picked: Outbox::new(&mut picked_units) }; + let _ = MemoView::new("properties-document", document, document_body).show(ui); }); + if let Some(u) = picked_units.pop() { + app.run("document.setUnits", json!({ "units": u.label() })).ok(); + } super::section(tl!("Appearance")).show(ui, |ui, _| super::appearance_section::fill_stroke_rows(app, ui)); super::section(tl!("Rulers & Grids")).show(ui, |ui, _| { - Row::new().show(ui, |ui, _| { - // The checked and enabled states and the tooltips come from the commands (Trim View turns the grid off). - for (command, icon) in [("view.rulers", "ruler"), ("view.grid", "grid-3x3"), ("view.transparencyGrid", "square-dashed")] { - ToggleButton::command(CommandRef::new(command)).icon(IconId::new(icon)).icon_only().show(ui); - } - }); + let _ = MemoView::new("properties-rulers", Language { lang }, rulers_body).show(ui); }); super::section(tl!("Guides")).show(ui, |ui, _| { - Row::new().show(ui, |ui, _| { - for (command, icon) in [("view.guides", "layout-grid"), ("view.smartGuides", "sparkles")] { - ToggleButton::command(CommandRef::new(command)).icon(IconId::new(icon)).icon_only().show(ui); - } - }); + let _ = MemoView::new("properties-guides", Language { lang }, guides_body).show(ui); }); + let mut snaps = Vec::new(); + let (point, grid) = (app.ui.view.snap_to_point, app.ui.view.snap_to_grid); super::section(tl!("Snap Options")).show(ui, |ui, _| { - let (point, grid) = (app.ui.view.snap_to_point, app.ui.view.snap_to_grid); - for (command, label, on) in [("view.snapToPoint", tl!("Snap to Point"), point), ("view.snapToGrid", tl!("Snap to Grid"), grid)] { - if Checkbox::new(Bind::given(on)).label(label).show(ui).value().is_some() { - app.run(command, json!({})).ok(); - } - } + let snap = SnapProps { point, grid, lang, picked: Outbox::new(&mut snaps) }; + let _ = MemoView::new("properties-snap", snap, snap_body).show(ui); }); + for command in snaps { + app.run(command, json!({})).ok(); + } + let mut prefs = Vec::new(); + let (increment, scale) = (app.session.prefs.keyboard_increment, app.session.prefs.scale_strokes); + let (bare_points, lengths) = (app.session.prefs.numbers_without_units_are_points, crate::canvas::rulers::general_lengths(app)); super::section(tl!("Preferences")).show(ui, |ui, _| { - Field::new(tl!("Keyboard Increment")).show(ui, |ui, _| { - // PLAN: assumed `canvas::rulers::general_lengths(app) -> LengthUnits` (cv.B5b) - let lengths: LengthUnits = crate::canvas::rulers::general_lengths(app); - // The engine's own range for the preference (`prefscmds.rs`): a larger value is an error. - let out = NumberField::length(tl!("Keyboard Increment"), Bind::given(Some(app.session.prefs.keyboard_increment)), lengths) - .range(0.001..=1296.0) - .show(ui); - crate::edits::apply_edits(app, &out.edit, crate::edits::EditPath::Scope, |app, v: &Option, _| { - if let Some(value) = *v { - app.run("prefs.set", json!({ "key": "keyboardIncrement", "value": value })).ok(); - } - }); - }); - let scale = app.session.prefs.scale_strokes; - let out = Checkbox::new(Bind::given(scale)).label(tl!("Scale Strokes & Effects")).show(ui); - if let Some(on) = out.value().copied() { - transform::set_pref(app, "scaleStrokes", on); + let picked = Outbox::new(&mut prefs); + let preferences = PreferencesProps { increment, unit, bare_points, lengths, scale, lang, picked }; + let _ = MemoView::new("properties-preferences", preferences, preferences_body).show(ui); + }); + for pick in prefs { + match pick { + PreferencePick::Increment(event) => { + crate::edits::apply_event(app, &event, &EditPath::Scope, &mut |app, v: &Option, _| { + if let Some(value) = *v { + app.run("prefs.set", json!({ "key": "keyboardIncrement", "value": value })).ok(); + } + }); + } + PreferencePick::ScaleStrokes(on) => transform::set_pref(app, "scaleStrokes", on), + } + } + super::section(tl!("Quick Actions")).show(ui, |ui, _| { + let _ = MemoView::new("properties-quick-actions", Language { lang }, quick_actions_body).show(ui); + }); +} + +/// What a section that reads only command states reads besides them: the interface language of its labels. +#[derive(MemoProps)] +struct Language { + #[memo_props(hash = "an interface language: an index into the languages offered")] + lang: crate::i18n::Lang, +} + +/// What the Document section reads: the document's units and how many artboards it has. +#[derive(MemoProps)] +struct DocumentProps<'a> { + /// The index of `units` in [`Unit::ALL`]. + unit: usize, + #[memo_props(covered_by = "unit", reason = "the unit's index in Unit::ALL")] + units: Unit, + /// How many artboards the document has (Rearrange All shows for more than one). + artboards: usize, + #[memo_props(hash = "an interface language: an index into the languages offered")] + lang: crate::i18n::Lang, + /// The units chosen in the Units menu. + picked: Outbox<'a, Unit>, +} + +/// The Document section's body: Units, Document Setup, Edit Artboards and Rearrange All. +fn document_body(p: &mut DocumentProps<'_>, ui: &mut Ui) { + #[cfg(test)] + tests::count_run(); + Field::new(tl!("Units")).show(ui, |ui, _| { + let entries: Vec> = Unit::ALL.iter().map(|u| Entry::new(*u, u.label())).collect(); + let out = Select::new(tl!("Units"), Bind::given(p.units), &entries).show(ui); + if let Some(u) = out.events.committed() { + p.picked.send(*u); } }); - super::section(tl!("Quick Actions")).show(ui, |ui, _| { - Grid::new(&HALVES).show(ui, |ui, _| { - // The reference panel's buttons name the dialog without the menu's ellipsis. - for (command, label) in [("file.documentSetup", tl!("Document Setup")), ("edit.preferences", tl!("Preferences"))] { - Button::command(CommandRef::new(command)).label(label).sizing(Sizing::FillWidth).show(ui); - } - }); + Grid::new(&HALVES).show(ui, |ui, _| { + Button::command(CommandRef::new("file.documentSetup")).label(tl!("Document Setup")).sizing(Sizing::FillWidth).show(ui); + Button::command(CommandRef::with_params("tool.select", json!({ "tool": "artboard" }))) + .label(tl!("Edit Artboards")) + .sizing(Sizing::FillWidth) + .show(ui); + if p.artboards > 1 { + rearrange_button(ui, p.artboards); + } + }); +} + +/// The Rulers & Grids section's body. The checked and enabled states and the tooltips come from the commands (Trim +/// View turns the grid off). +fn rulers_body(_: &mut Language, ui: &mut Ui) { + #[cfg(test)] + tests::count_run(); + Row::new().show(ui, |ui, _| { + for (command, icon) in [("view.rulers", "ruler"), ("view.grid", "grid-3x3"), ("view.transparencyGrid", "square-dashed")] { + ToggleButton::command(CommandRef::new(command)).icon(IconId::new(icon)).icon_only().show(ui); + } + }); +} + +/// The Guides section's body: Show Guides and Smart Guides, from their commands. +fn guides_body(_: &mut Language, ui: &mut Ui) { + #[cfg(test)] + tests::count_run(); + Row::new().show(ui, |ui, _| { + for (command, icon) in [("view.guides", "layout-grid"), ("view.smartGuides", "sparkles")] { + ToggleButton::command(CommandRef::new(command)).icon(IconId::new(icon)).icon_only().show(ui); + } + }); +} + +/// What the Snap Options section reads: whether Snap to Point and Snap to Grid are on. +#[derive(MemoProps)] +struct SnapProps<'a> { + point: bool, + grid: bool, + #[memo_props(hash = "an interface language: an index into the languages offered")] + lang: crate::i18n::Lang, + /// The command of each checkbox clicked. + picked: Outbox<'a, &'static str>, +} + +/// The Snap Options section's body: Snap to Point and Snap to Grid. +fn snap_body(p: &mut SnapProps<'_>, ui: &mut Ui) { + #[cfg(test)] + tests::count_run(); + for (command, label, on) in [("view.snapToPoint", tl!("Snap to Point"), p.point), ("view.snapToGrid", tl!("Snap to Grid"), p.grid)] { + if Checkbox::new(Bind::given(on)).label(label).show(ui).value().is_some() { + p.picked.send(command); + } + } +} + +/// What the Preferences section reads: the keyboard increment in the General unit, and Scale Strokes & Effects. +#[derive(MemoProps)] +struct PreferencesProps<'a> { + /// The keyboard increment, in points. + increment: f64, + /// The index of the General unit in [`Unit::ALL`]. + unit: usize, + /// Numbers without units are points (Preferences › Units). + bare_points: bool, + #[memo_props(covered_by = "unit", reason = "made from the General unit and bare_points alone (canvas::rulers::lengths)")] + lengths: LengthUnits, + /// Scale Strokes & Effects is on. + scale: bool, + #[memo_props(hash = "an interface language: an index into the languages offered")] + lang: crate::i18n::Lang, + /// The keyboard increment's edits and the Scale Strokes & Effects choice. + picked: Outbox<'a, PreferencePick>, +} + +/// What the Preferences section reports: an edit of the keyboard increment, or Scale Strokes & Effects turned on or +/// off. +enum PreferencePick { + Increment(EditEvent>), + ScaleStrokes(bool), +} + +/// The Preferences section's body: Keyboard Increment and Scale Strokes & Effects. +fn preferences_body(p: &mut PreferencesProps<'_>, ui: &mut Ui) { + #[cfg(test)] + tests::count_run(); + Field::new(tl!("Keyboard Increment")).show(ui, |ui, _| { + // The engine's own range for the preference (`prefscmds.rs`): a larger value is an error. + let out = NumberField::length(tl!("Keyboard Increment"), Bind::given(Some(p.increment)), p.lengths).range(0.001..=1296.0).show(ui); + for event in out.edit.events.iter() { + p.picked.send(PreferencePick::Increment(event.clone())); + } + }); + let out = Checkbox::new(Bind::given(p.scale)).label(tl!("Scale Strokes & Effects")).show(ui); + if let Some(on) = out.value().copied() { + p.picked.send(PreferencePick::ScaleStrokes(on)); + } +} + +/// The Quick Actions section's body: Document Setup and Preferences. The reference panel's buttons name the dialog +/// without the menu's ellipsis. +fn quick_actions_body(_: &mut Language, ui: &mut Ui) { + #[cfg(test)] + tests::count_run(); + Grid::new(&HALVES).show(ui, |ui, _| { + for (command, label) in [("file.documentSetup", tl!("Document Setup")), ("edit.preferences", tl!("Preferences"))] { + Button::command(CommandRef::new(command)).label(label).sizing(Sizing::FillWidth).show(ui); + } }); } @@ -104,6 +232,19 @@ mod tests { use crate::tests::panel_harness::Panel; use craft::ui::contract::Role; + thread_local! { + /// How many times this thread ran a memoized Document section. + static SECTION_RUNS: std::cell::Cell = const { std::cell::Cell::new(0) }; + } + + pub(super) fn count_run() { + SECTION_RUNS.with(|n| n.set(n.get() + 1)); + } + + fn runs() -> u64 { + SECTION_RUNS.with(std::cell::Cell::get) + } + #[test] fn canceling_the_units_popup_leaves_the_document_unchanged() { let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); @@ -135,4 +276,54 @@ mod tests { assert_eq!(panel.app().session.active().unwrap().doc.units, next, "Enter applies the chosen document unit"); assert_eq!(panel.app().session.general_unit(), next); } + + /// Frames that change nothing the sections show replay them instead of laying them out again. A change one of + /// them reads, from a command run elsewhere, runs it again, and it shows the change. + #[test] + fn idle_frames_replay_the_document_sections() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.run("file.new", json!({"width": 300, "height": 200})).unwrap(); + let mut panel = Panel::new(app, document_sections); + panel.room(egui::vec2(400.0, 1000.0)); + panel.frame(); + panel.frame(); + let before = runs(); + for _ in 0..10 { + panel.frame(); + } + assert_eq!(runs() - before, 0, "idle frames run the memoized sections no more"); + let point = panel.app().ui.view.snap_to_point; + panel.app().run("view.snapToPoint", json!({})).unwrap(); + panel.frame(); + panel.frame(); + assert!(runs() > before, "a new snap setting runs the sections again"); + assert_eq!(panel.app().ui.view.snap_to_point, !point); + assert_eq!(panel.toggled("Snap to Point"), Some(craft::behavior::Mixed::Same(!point)), "and the checkbox shows it"); + panel.app().run("view.rulers", json!({})).unwrap(); + let mut per_frame = Vec::new(); + for _ in 0..12 { + let at = runs(); + panel.frame(); + per_frame.push(runs() - at); + } + // A toggled button animates over the next frames, and a section runs while an animation in it has not ended. + assert_eq!(per_frame[6..], [0; 6], "idle frames after a command run them no more: {per_frame:?}"); + } + + /// The memoized sections still take input: a click on Snap to Grid turns it on, once, and Scale Strokes & Effects + /// sets its preference. + #[test] + fn the_memoized_sections_run_their_picks() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.run("file.new", json!({"width": 300, "height": 200})).unwrap(); + let grid = app.ui.view.snap_to_grid; + let scale = app.session.prefs.scale_strokes; + let mut panel = Panel::new(app, document_sections); + panel.room(egui::vec2(400.0, 1000.0)); + panel.frame(); + panel.click("Snap to Grid"); + assert_eq!(panel.app().ui.view.snap_to_grid, !grid, "the click toggles Snap to Grid once"); + panel.click("Scale Strokes & Effects"); + assert_eq!(panel.app().session.prefs.scale_strokes, !scale); + } } From d3e02f41a18d29e51628c13ba70769c8d8009f1e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 13:52:49 -0800 Subject: [PATCH 031/105] Performance: Properties rows read a large selection once per edit After an edit the selection keeps no record of its paints, so the Fill and Stroke chips and the Stroke and Width Profile rows looked up the groups around every selected object for Live Paint faces and edges each time they were drawn. DocState::live_paint_covered_kept keeps an empty answer for that version of the document and those objects. The Recolor quick action listed and sorted every color of the selection to see whether it held more than one. Session::several_colors_used reads the same objects and pattern tiles and stops at the second color. --- crates/engine/src/cmd.rs | 3 + crates/engine/src/cmd/paint.rs | 5 +- crates/engine/src/cmd/paint/tests.rs | 52 +++++++++ crates/engine/src/cmd/recolor.rs | 133 ++++++++++++++++++++++++ crates/engine/src/doc_state.rs | 34 ++++++ crates/ui-egui/src/panels/properties.rs | 8 +- 6 files changed, 229 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/cmd.rs b/crates/engine/src/cmd.rs index 43d6e3a7d4..3641f82d6b 100644 --- a/crates/engine/src/cmd.rs +++ b/crates/engine/src/cmd.rs @@ -874,6 +874,9 @@ pub(crate) use vectorcraft_doc::range::parse_range; /// What the fill and stroke proxies read from the selected objects, kept with the selection /// ([`crate::doc_state::SelectionRecord`]). pub(crate) use paint::SelectionPaints; +/// The faces and edges of Live Paint groups among objects that count with their group +/// ([`crate::DocState::live_paint_covered_kept`] keeps an empty answer). +pub(crate) use paint::live_paint_covered; #[cfg(test)] pub(crate) use paint::{PAINTS_READ, WEIGHTS_READ}; diff --git a/crates/engine/src/cmd/paint.rs b/crates/engine/src/cmd/paint.rs index c722e2a58b..2a61f7fb74 100644 --- a/crates/engine/src/cmd/paint.rs +++ b/crates/engine/src/cmd/paint.rs @@ -1470,12 +1470,13 @@ fn in_live_paint(d: &Document, id: NodeId) -> bool { impl DocState { /// [`live_paint_covered`] for `ids`, the selected objects or the selection's subjects: none - /// when the [`SelectionPaints`] of the selection say no selected object is in a Live Paint group. + /// when the [`SelectionPaints`] of the selection say no selected object is in a Live Paint group, + /// else as [`DocState::live_paint_covered_kept`] keeps it for this version of the document. pub(crate) fn selection_live_paint_covered(&self, ids: &[NodeId]) -> std::collections::HashSet { if self.selection_paints().is_some_and(|p| !p.in_live_paint()) { return std::collections::HashSet::new(); } - live_paint_covered(&self.doc, ids) + self.live_paint_covered_kept(ids) } } diff --git a/crates/engine/src/cmd/paint/tests.rs b/crates/engine/src/cmd/paint/tests.rs index ec8f02f700..9b0fb393df 100644 --- a/crates/engine/src/cmd/paint/tests.rs +++ b/crates/engine/src/cmd/paint/tests.rs @@ -242,6 +242,58 @@ fn the_question_marks_read_only_the_selected_objects() { assert!(vectorcraft_doc::tree_walks() - walks <= 1, "one walk for a large selection"); } +/// How many times this thread read the groups around selected objects for their Live Paint faces +/// and edges ([`DocState::live_paint_covered_kept`]). +fn cover_reads() -> usize { + crate::doc_state::LIVE_PAINT_COVER_READS.with(Cell::get) +} + +/// After an edit the selection keeps no record of what it holds, and the proxies, the Stroke panel +/// and the "?" ask on every frame whether its objects lie in a Live Paint group. They read the +/// objects' groups once for each version of the document and selection, not once for each question. +/// A Live Paint group selected with one of its faces still counts the face with its group. +#[test] +fn live_paint_faces_are_looked_for_once_per_document_version() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 800, "height": 600})).unwrap(); + let ids: Vec = (0..20).map(|i| rect(&mut s, 10.0 + 30.0 * f64::from(i), "#ff0000", "#000000")).collect(); + s.execute("select.all", &json!({})).unwrap(); + s.execute("object.move", &json!({"dx": 5, "dy": 0})).unwrap(); + assert!(s.active().unwrap().selection_paints().is_none(), "the edit leaves the selection without a record"); + let ask = |s: &Session| { + for _ in 0..3 { + s.proxy_paints(); + s.shown_stroke(); + s.proxy_mixed(); + s.active().unwrap().stroke_mixed(); + } + }; + let before = cover_reads(); + ask(&s); + assert_eq!(cover_reads() - before, 1, "one read for this version of the document"); + s.execute("object.move", &json!({"dx": 5, "dy": 0})).unwrap(); + let before = cover_reads(); + ask(&s); + assert_eq!(cover_reads() - before, 1, "an edit reads them again, once"); + s.execute("select.set", &json!({"ids": [ids[0].0, ids[1].0]})).unwrap(); + s.execute("object.move", &json!({"dx": 5, "dy": 0})).unwrap(); + let before = cover_reads(); + ask(&s); + assert_eq!(cover_reads() - before, 1, "another selection reads them again, once"); + + // A Live Paint group with one of its edges selected too: the edge counts with its group on every ask. + s.execute("livePaint.make", &json!({"ids": [ids[2].0, ids[3].0]})).unwrap(); + let group = s.active().unwrap().selection.objects[0]; + let edge = vectorcraft_tools::builder::edges(s.active().unwrap().doc.node(group).unwrap())[0].id; + s.execute("select.set", &json!({"ids": [group.0, edge.0]})).unwrap(); + let st = s.active().unwrap(); + let covered = live_paint_covered(&st.doc, &st.selection.objects); + assert!(covered.contains(&edge)); + for _ in 0..2 { + assert_eq!(st.selection_live_paint_covered(&st.selection.objects), covered); + } +} + /// Random selections of a document with nested groups answer as a walk does. #[test] fn random_selections_match_a_walk_of_the_document() { diff --git a/crates/engine/src/cmd/recolor.rs b/crates/engine/src/cmd/recolor.rs index b4ad26400b..174f90ecb0 100644 --- a/crates/engine/src/cmd/recolor.rs +++ b/crates/engine/src/cmd/recolor.rs @@ -1027,6 +1027,76 @@ fn used_colors(d: &Document, ids: &[NodeId], only: Option<&BTreeSet>) -> used.into_iter().map(|(_, u)| u).collect() } +#[cfg(test)] +thread_local! { + /// Tests: how many objects [`several_colors`] read on this thread. + static SEVERAL_COLORS_READS: std::cell::Cell = const { std::cell::Cell::new(0) }; +} + +/// Whether [`used_colors`] lists more than one color for the objects `ids`. The objects are read +/// until a second color turns up. +fn several_colors(d: &Document, ids: &[NodeId], only: Option<&BTreeSet>) -> bool { + struct Seen<'a> { + first: Option, + several: bool, + patterns: Vec<&'a str>, + } + impl<'a> Seen<'a> { + fn read(&mut self, m: &'a Node) { + #[cfg(test)] + SEVERAL_COLORS_READS.with(|c| c.set(c.get() + 1)); + let (first, several) = (&mut self.first, &mut self.several); + paints( + m, + &mut |c, _, _, _| { + let k = ColorKey::of(c); + match first { + None => *first = Some(k), + Some(f) => *several |= *f != k, + } + }, + &mut self.patterns, + ); + } + fn read_tree(&mut self, n: &'a Node, only: Option<&BTreeSet>) { + if self.several || only.is_some_and(|o| !o.contains(&n.id)) { + return; + } + self.read(n); + for c in n.children().into_iter().flatten() { + self.read_tree(c, only); + } + } + } + let mut seen = Seen { first: None, several: false, patterns: vec![] }; + for n in ids.iter().filter_map(|id| d.node(*id)) { + seen.read_tree(n, only); + } + let mut next = 0; + while !seen.several + && let Some(&name) = seen.patterns.get(next) + { + next += 1; + for a in d.pattern(name).map(|def| def.art.as_slice()).unwrap_or_default() { + a.walk(&mut |m| { + if !seen.several { + seen.read(m); + } + }); + } + } + seen.several +} + +impl Session { + /// Whether the objects `recolor.colors` reads without `ids` use more than one color: the + /// selection, or with nothing selected the objects Select All takes. False without a document. + pub fn several_colors_used(&self) -> bool { + let Ok((ids, only)) = scope_ids(self, &Value::Null, "recolor.colors") else { return false }; + self.doc().is_ok_and(|st| several_colors(&st.doc, &ids, only.as_ref())) + } +} + /// Count the colors `m` holds itself with `count` (the color, its swatch, the tint the paint /// stores, and whether it is a gradient stop that mixes the swatch's ink with process inks), and /// add the patterns it is painted with to `patterns`. @@ -2050,6 +2120,69 @@ mod tests { assert!(has(&t, RED), "P100 read again at the top"); } + /// How many objects [`several_colors`] read on this thread. + fn several_reads() -> usize { + SEVERAL_COLORS_READS.with(std::cell::Cell::get) + } + + /// Whether more than one color is used ([`Session::several_colors_used`]), checked against the + /// length of `recolor.colors`'s list, with how many objects the answer read. + fn several(s: &mut Session, what: &str) -> (bool, usize) { + let before = several_reads(); + let several = s.several_colors_used(); + let reads = several_reads() - before; + let listed = s.execute("recolor.colors", &json!({})).unwrap()["colors"].as_array().map_or(0, Vec::len); + assert_eq!(several, listed > 1, "{what}: {listed} colors listed"); + (several, reads) + } + + /// The Recolor quick action asks on every change whether the selection uses more than one + /// color. The answer matches `recolor.colors`, pattern tiles and Select All's objects included, + /// and the objects are read only until a second color turns up. + #[test] + fn several_colors_stop_at_the_second_color() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 800, "height": 600})).unwrap(); + let ids: Vec = (0..30) + .map(|i| { + let id = + s.execute("shape.rectangle", &json!({"x": 10 + 20 * i, "y": 10, "width": 10, "height": 10})).unwrap()["id"].as_u64().unwrap(); + s.execute("paint.setFill", &json!({"ids": [id], "color": "#ff0000"})).unwrap(); + s.execute("paint.setStroke", &json!({"ids": [id], "none": true})).unwrap(); + id + }) + .collect(); + s.execute("select.all", &json!({})).unwrap(); + assert_eq!(several(&mut s, "one red"), (false, 30), "one color: every object is read"); + // A blue object in the middle: the objects are read up to it, from either end. + s.execute("paint.setFill", &json!({"ids": [ids[15]], "color": "#0000ff"})).unwrap(); + let (found, reads) = several(&mut s, "a blue in the middle"); + assert!(found && matches!(reads, 15 | 16), "{reads} objects read"); + s.execute("paint.setFill", &json!({"ids": [ids[0], ids[29]], "color": "#00ff00"})).unwrap(); + assert_eq!(several(&mut s, "green at both ends"), (true, 2), "the second object holds the second color"); + s.execute("select.set", &json!({"ids": &ids[1..15]})).unwrap(); + assert!(!several(&mut s, "the red ones").0); + s.execute("select.none", &json!({})).unwrap(); + assert!(several(&mut s, "Select All's objects").0); + + // A red object filled with a pattern too: its tile's color counts. + for (tile, expect) in [(BLUE, true), (RED, false)] { + let filled = NodeId(ids[1]); + s.edit("t", |d, _| { + let art = square(d, 0.0, Paint::solid(tile)); + d.patterns.retain(|p| p.name != "Tile"); + d.patterns.push(PatternDef::new("Tile", vec![art])); + if let Some(n) = d.node_mut(filled) { + n.appearance.set_fill(Paint::Pattern { pattern: "Tile".into(), xf: Affine::IDENTITY }); + } + Ok(()) + }) + .unwrap(); + s.execute("select.set", &json!({"ids": [ids[1], ids[2]]})).unwrap(); + assert_eq!(several(&mut s, "a pattern tile").0, expect, "a tile of {tile:?}"); + } + } + /// A pattern tile's symbol instances charge the same limit as the art around it. #[test] fn pattern_tiles_charge_the_symbol_limit() { diff --git a/crates/engine/src/doc_state.rs b/crates/engine/src/doc_state.rs index e1bb6df83a..8307b6a8b1 100644 --- a/crates/engine/src/doc_state.rs +++ b/crates/engine/src/doc_state.rs @@ -203,6 +203,18 @@ pub struct DocState { /// The selected objects as [`crate::Session::select`] last checked them or the proxies last /// read them, with the document they were checked in ([`SelectionRecord`]). Not saved. pub(crate) selection_record: Option, + /// The objects that [`DocState::live_paint_covered_kept`] last found no face or edge of a Live + /// Paint group among, with the document it read. Not saved. + outside_live_paint: std::cell::RefCell>, +} + +/// Objects that hold no face or edge of a Live Paint group that counts with its group +/// ([`cmd::live_paint_covered`] is empty for them), with the document they were read in, held as +/// [`EmptyArtboards::doc`] holds it. +#[derive(Clone, Debug)] +struct OutsideLivePaint { + doc: std::sync::Weak, + ids: Vec, } /// A selection of objects alone ([`objects_only`]) with the document it was checked or read in: @@ -302,6 +314,8 @@ thread_local! { pub(crate) static EMPTY_ARTBOARD_MEASURES: std::cell::Cell = const { std::cell::Cell::new(0) }; /// Tests: how many times [`DocState::any_art_to_fit`] measured a document on this thread. pub(crate) static ART_TO_FIT_MEASURES: std::cell::Cell = const { std::cell::Cell::new(0) }; + /// Tests: how many times [`DocState::live_paint_covered_kept`] read the objects' groups on this thread. + pub(crate) static LIVE_PAINT_COVER_READS: std::cell::Cell = const { std::cell::Cell::new(0) }; } static NEXT_DOC_UID: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(1); @@ -522,6 +536,7 @@ impl DocState { measured_in_own: None, inline_resolved: None, selection_record: None, + outside_live_paint: Default::default(), } } /// The [`SelectionRecord`] of the selection now: `None` when the document or the selected @@ -539,6 +554,25 @@ impl DocState { pub(crate) fn selection_paints(&self) -> Option<&cmd::SelectionPaints> { self.selection_record().and_then(|r| r.paints.as_ref()) } + /// The faces and edges of Live Paint groups among `ids` that count with their group + /// ([`cmd::live_paint_covered`]). An empty answer is kept for this version of the document and + /// these objects, so the proxies and the Stroke panel, which ask on every frame, read the + /// objects' groups once after an edit. + pub(crate) fn live_paint_covered_kept(&self, ids: &[NodeId]) -> std::collections::HashSet { + let kept = |k: &OutsideLivePaint| std::ptr::eq(k.doc.as_ptr(), Arc::as_ptr(&self.doc)) && k.ids == ids; + if self.outside_live_paint.try_borrow().is_ok_and(|k| k.as_ref().is_some_and(kept)) { + return std::collections::HashSet::new(); + } + #[cfg(test)] + LIVE_PAINT_COVER_READS.with(|c| c.set(c.get() + 1)); + let covered = cmd::live_paint_covered(&self.doc, ids); + if covered.is_empty() + && let Ok(mut k) = self.outside_live_paint.try_borrow_mut() + { + *k = Some(OutsideLivePaint { doc: Arc::downgrade(&self.doc), ids: ids.to_vec() }); + } + covered + } /// Keep the [`SelectionRecord`] of the selection that [`crate::Session::select`] left, with /// Lock Guides `guides_locked`. `record` is the record of the selection before, in the same /// document: the objects that leave the selection are taken out of its paints and the objects diff --git a/crates/ui-egui/src/panels/properties.rs b/crates/ui-egui/src/panels/properties.rs index 7e3caa1a43..b137711d0d 100644 --- a/crates/ui-egui/src/panels/properties.rs +++ b/crates/ui-egui/src/panels/properties.rs @@ -291,8 +291,9 @@ fn can_merge_live_paint(app: &VectorcraftApp) -> bool { }) } -/// Whether the selection uses more than one colour (`recolor.colors`), which offers the Recolor -/// quick action; memoised per document revision. +/// Whether the selection uses more than one colour (`recolor.colors` lists more than one, +/// [`vectorcraft_engine::Session::several_colors_used`]), which offers the Recolor quick action; +/// memoised per document revision. pub(crate) fn multi_color(app: &mut VectorcraftApp) -> bool { let Some(st) = app.session.active() else { return false }; let key = (st.uid, st.revision); @@ -301,8 +302,7 @@ pub(crate) fn multi_color(app: &mut VectorcraftApp) -> bool { { return multi; } - let r = app.session.execute("recolor.colors", &json!({})).unwrap_or_default(); - let multi = r["colors"].as_array().is_some_and(|c| c.len() > 1); + let multi = app.session.several_colors_used(); app.canvas.multi_color = Some((key, multi)); multi } From 389fc65631585c575f7caf75be99177ecd5d3277 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 14:09:19 -0800 Subject: [PATCH 032/105] Canvas: a move of the selection moves its marks instead of building them again The canvas kept the selection's outlines, anchors and dots only while the document revision stayed the same, so every move command, nudge and drag step built them again from every selected object. With 10,000 selected rectangles one build took about 26 ms in a release build. A move of whole objects now records the documents before and after it and the distance (DocState::moved). The record is made only when each moved object is still the node the transform left (no later pass, such as the pixel grid snap, changed it), none is a member of a blend, and every object the selection shows, the key object and the key anchor's object included, is a moved object or inside one. Copies, scales, moves of patterns alone and moves that resize type areas make no record. The canvas moves its kept marks by that distance when the record names the document they show, or the document a drag began with. It also keeps them through a new revision of the same document and selection, as at the end of a drag. Every other change builds them as before. --- crates/engine/src/cmd/object/transform.rs | 56 +++++++- crates/engine/src/doc_state.rs | 19 +++ crates/engine/src/lib.rs | 2 +- crates/engine/src/tests.rs | 1 + crates/engine/src/tests/moved.rs | 127 +++++++++++++++++++ crates/ui-egui/src/canvas/selection.rs | 95 ++++++++++++-- crates/ui-egui/src/canvas/selection/tests.rs | 72 +++++++++++ 7 files changed, 359 insertions(+), 13 deletions(-) create mode 100644 crates/engine/src/tests/moved.rs diff --git a/crates/engine/src/cmd/object/transform.rs b/crates/engine/src/cmd/object/transform.rs index 1a15e44aa3..c86bd4c792 100644 --- a/crates/engine/src/cmd/object/transform.rs +++ b/crates/engine/src/cmd/object/transform.rs @@ -192,7 +192,11 @@ fn apply_transform_moving_guides( if copy { vec![] } else { ids } } else { let kept = if copy { preview_copies(s, &ids, with_guides, below)? } else { None }; - s.edit(label, |d, sel| { + // A move of whole objects, not of copies (which `reindex` covers): the document before it, + // and the moved objects as the transform left them, for [`moved_by`] to check after the edit. + let from = (objects && !areas && !reindex && c[..4] == [1.0, 0.0, 0.0, 1.0]).then(|| s.doc().map(|st| st.doc.clone())).transpose()?; + let mut held: Vec<(NodeId, Arc)> = vec![]; + let targets = s.edit(label, |d, sel| { let mut targets = match &kept { // The document becomes the snapshot with the kept copies, untransformed, and the // loop below transforms only the copies. @@ -229,6 +233,10 @@ fn apply_transform_moving_guides( transform_node(n, xf, sc, objects); } } + // Holding them makes any later change to them copy them first, which `moved_by` sees. + if from.is_some() { + held = targets.iter().filter_map(|id| Some((*id, node_arc(d, paths.get(id)?)?))).collect(); + } if objects { for id in &targets { super::pixelgrid::keep_compound_aligned(d, *id, sc); @@ -248,7 +256,10 @@ fn apply_transform_moving_guides( targets.extend(d.transform_ruler_guides(sel, xf)); } Ok(targets) - })? + })?; + let st = s.doc_mut()?; + st.moved = from.and_then(|from| moved_by(&from, st, &held, Vec2::new(c[4], c[5]))); + targets }; let st = s.doc_mut()?; if st.interaction.is_none() { @@ -266,6 +277,47 @@ fn apply_transform_moving_guides( Ok(json!({ "ids": ids.iter().map(|i| i.0).collect::>() })) } +/// The node at index path `path` of `d`, shared. +fn node_arc(d: &Document, path: &[usize]) -> Option> { + let (first, rest) = path.split_first()?; + let mut cur = d.layers.get(*first)?; + for &i in rest { + cur = cur.children()?.get(i)?; + } + Some(cur.clone()) +} + +/// The [`crate::Moved`] of a move by `by` that took `from` to the document of `st`, given the moved +/// objects as the transform left them (`held`). `None` unless every moved object is still that +/// node, none is a member of a blend (whose spine follows its members), and every object the +/// selection shows, the key object and the key anchor's object included, is a moved object or +/// inside one. A pass after the transform that changes a moved object, such as the one that snaps +/// moved pixel-aligned objects to the pixel grid again ([`super::pixelgrid::refresh`]), copies it +/// first, so it is no longer that node. +fn moved_by(from: &Arc, st: &crate::DocState, held: &[(NodeId, Arc)], by: Vec2) -> Option { + let d = &st.doc; + let unchanged = |(id, n): &(NodeId, Arc)| d.node(*id).is_some_and(|now| std::ptr::eq(now, Arc::as_ptr(n))); + if held.is_empty() || !held.iter().all(unchanged) { + return None; + } + let in_blend = |id: NodeId| d.parent_of(id).and_then(|p| d.node(p)).is_some_and(|p| matches!(p.kind, NodeKind::Blend { .. })); + if held.iter().any(|(id, _)| in_blend(*id)) { + return None; + } + let mut moved = std::collections::HashSet::new(); + for (_, n) in held { + n.walk(&mut |c| { + moved.insert(c.id); + }); + } + let sel = &st.selection; + let mut shown = sel.objects.iter().copied().chain(sel.key).chain(sel.key_anchor.map(|(id, _)| id)); + if !shown.all(|id| moved.contains(&id)) { + return None; + } + Some(crate::Moved { from: Arc::downgrade(from), to: Arc::downgrade(d), by, selection: sel.clone() }) +} + /// Returns the copies of `roots` for a transform or a perspective edit with `copy` in an interaction /// whose document is still its snapshot, as in a preview ([`Session::preview`] puts the snapshot /// back first). These are the copies the interaction keeps when they were made of that snapshot for diff --git a/crates/engine/src/doc_state.rs b/crates/engine/src/doc_state.rs index e1bb6df83a..39be553eb6 100644 --- a/crates/engine/src/doc_state.rs +++ b/crates/engine/src/doc_state.rs @@ -203,6 +203,24 @@ pub struct DocState { /// The selected objects as [`crate::Session::select`] last checked them or the proxies last /// read them, with the document they were checked in ([`SelectionRecord`]). Not saved. pub(crate) selection_record: Option, + /// The last move of the selected objects that changed nothing else they show ([`Moved`]). + /// Not saved. + pub moved: Option, +} + +/// A move of whole objects that took document `from` to document `to`: each object the selection +/// shows, the key object and the key anchor included, is the one in `from` moved by `by`, and +/// nothing else they are drawn from changed (no member snapped to the pixel grid, no blend spine +/// they follow, no pass after the edit). A view that drew the selection of `from` can +/// move what it drew by `by` instead of building it again. It holds the documents as +/// [`SelectionRecord::doc`] holds one, so a document changed in place no longer matches. +#[derive(Clone, Debug)] +pub struct Moved { + pub from: std::sync::Weak, + pub to: std::sync::Weak, + pub by: vectorcraft_geom::Vec2, + /// The selection the move was made with, which is also the selection after it. + pub selection: Selection, } /// A selection of objects alone ([`objects_only`]) with the document it was checked or read in: @@ -522,6 +540,7 @@ impl DocState { measured_in_own: None, inline_resolved: None, selection_record: None, + moved: None, } } /// The [`SelectionRecord`] of the selection now: `None` when the document or the selected diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 48964aad0c..3e132c5f9e 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -507,7 +507,7 @@ pub(crate) use command_sets::SELECTS_GIVEN_IDS; #[cfg(test)] use command_sets::given_ids; pub use command_sets::{DRAWS_SHAPE, FIT_ACTIVE_ARTBOARD, ON_ACTIVE_ARTBOARD, waits_for_plugin_loads, waits_for_tool_edit}; -pub use doc_state::{DocState, LayersReveal, OpenRows, RecalledSelection, WindowView}; +pub use doc_state::{DocState, LayersReveal, Moved, OpenRows, RecalledSelection, WindowView}; pub use error::{EngineError, READ_ONLY_LOCATION, Result, SCRIPT_BUSY}; #[cfg(test)] use history::history_budget_for; diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index 9e3cf2371e..89f74fd03d 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -118,6 +118,7 @@ mod livecorners; mod maskview; pub(super) mod menucmds; mod mesh_picks; +mod moved; mod nativefile; mod newart; mod newdoc; diff --git a/crates/engine/src/tests/moved.rs b/crates/engine/src/tests/moved.rs new file mode 100644 index 0000000000..1b70d4acf8 --- /dev/null +++ b/crates/engine/src/tests/moved.rs @@ -0,0 +1,127 @@ +//! [`DocState::moved`]: a move of whole objects names the documents before and after it and how far +//! it went, and only when every object the selection shows is the one before it, moved that far. + +use std::sync::Arc; + +use serde_json::{Value, json}; +use vectorcraft_geom::Vec2; + +use crate::*; + +fn session() -> Session { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + s +} + +fn id_of(v: &Value) -> NodeId { + NodeId(v["id"].as_u64().unwrap()) +} + +fn rect(s: &mut Session, x: f64) -> NodeId { + id_of(&s.execute("shape.rectangle", &json!({"x": x, "y": 20, "width": 30, "height": 20})).unwrap()) +} + +fn select(s: &mut Session, ids: &[NodeId]) { + s.execute("select.set", &json!({"ids": ids.iter().map(|i| i.0).collect::>()})).unwrap(); +} + +fn doc(s: &Session) -> Arc { + s.doc().unwrap().doc.clone() +} + +/// The move [`DocState::moved`] names, when it took `from` to the document now. +fn moved_from(s: &Session, from: &Arc) -> Option { + let st = s.doc().unwrap(); + let m = st.moved.as_ref()?; + (m.from.as_ptr() == Arc::as_ptr(from) && m.to.as_ptr() == Arc::as_ptr(&st.doc) && m.selection == st.selection).then_some(m.by) +} + +// A move of the selection, a nudge and each step of a drag name the move; the drag's steps all start from the +// document the drag began with. +#[test] +fn a_move_of_whole_objects_names_the_documents_and_the_distance() { + let mut s = session(); + let (a, b) = (rect(&mut s, 20.0), rect(&mut s, 80.0)); + select(&mut s, &[a, b]); + let before = doc(&s); + s.execute("object.move", &json!({"dx": 12, "dy": -5})).unwrap(); + assert_eq!(moved_from(&s, &before), Some(Vec2::new(12.0, -5.0)), "Object › Transform › Move"); + let before = doc(&s); + s.execute("object.nudge", &json!({"dx": 1, "dy": 0})).unwrap(); + assert_eq!(moved_from(&s, &before), Some(Vec2::new(s.prefs.keyboard_increment, 0.0)), "a nudge"); + + let start = doc(&s); + s.begin_interaction("Move").unwrap(); + for dx in [3.0, 7.5] { + s.preview("object.transform", &json!({"matrix": [1, 0, 0, 1, dx, 2], "copy": false})).unwrap(); + assert_eq!(moved_from(&s, &start), Some(Vec2::new(dx, 2.0)), "a drag's step by {dx}"); + } +} + +// A copy, a transform that is not a move, a move of patterns alone, a move that also resizes type areas, and a move +// of part of what the selection shows name no move. +#[test] +fn a_copy_a_scale_and_a_move_of_part_of_the_selection_name_no_move() { + let mut s = session(); + let (a, b) = (rect(&mut s, 20.0), rect(&mut s, 80.0)); + select(&mut s, &[a, b]); + let cases = [ + ("object.move", json!({"dx": 12, "dy": 0, "copy": true})), + ("object.transform", json!({"matrix": [2, 0, 0, 1, 0, 0]})), + ("object.move", json!({"dx": 12, "dy": 0, "objects": false, "patterns": true})), + ("object.move", json!({"dx": 12, "dy": 0, "typeAreas": true})), + ("object.transform", json!({"matrix": [1, 0, 0, 1, 5, 0], "ids": [a.0]})), + ]; + for (cmd, p) in cases { + select(&mut s, &[a, b]); + let before = doc(&s); + s.execute(cmd, &p).unwrap(); + assert_eq!(moved_from(&s, &before), None, "{cmd} {p}"); + } +} + +// The key object is shown too: a move that leaves it where it was names no move. +#[test] +fn a_key_object_left_where_it_was_names_no_move() { + let mut s = session(); + let (a, b) = (rect(&mut s, 20.0), rect(&mut s, 80.0)); + select(&mut s, &[a]); + s.active_mut().unwrap().selection.key = Some(b); + let before = doc(&s); + s.execute("object.move", &json!({"dx": 12, "dy": 0})).unwrap(); + assert_eq!(moved_from(&s, &before), None); +} + +// A pixel-aligned path snaps to the pixel grid after the transform, and an instance of a symbol aligned to the pixel +// grid snaps after the edit: neither is the object before the move moved by its distance. +#[test] +fn objects_that_snap_to_the_pixel_grid_name_no_move() { + let mut s = session(); + let a = rect(&mut s, 20.0); + select(&mut s, &[a]); + s.execute("object.setPixelAligned", &json!({"on": true})).unwrap(); + let before = doc(&s); + s.execute("object.move", &json!({"dx": 0.3, "dy": 0})).unwrap(); + assert_eq!(moved_from(&s, &before), None, "a pixel-aligned path"); + + let mut s = session(); + let art = rect(&mut s, 20.0); + let made = s.execute("symbol.new", &json!({"name": "Box", "ids": [art.0], "alignToPixelGrid": true})).unwrap(); + select(&mut s, &[id_of(&made)]); + let before = doc(&s); + s.execute("object.move", &json!({"dx": 0.3, "dy": 0})).unwrap(); + assert_eq!(moved_from(&s, &before), None, "an instance of a symbol aligned to the pixel grid"); +} + +// A member of a blend moved on its own changes the blend's spine. +#[test] +fn a_member_of_a_blend_names_no_move() { + let mut s = session(); + let (a, b) = (rect(&mut s, 20.0), rect(&mut s, 200.0)); + s.execute("object.blend.make", &json!({"ids": [a.0, b.0], "steps": 1})).unwrap(); + select(&mut s, &[a]); + let before = doc(&s); + s.execute("object.move", &json!({"dx": 12, "dy": 0})).unwrap(); + assert_eq!(moved_from(&s, &before), None); +} diff --git a/crates/ui-egui/src/canvas/selection.rs b/crates/ui-egui/src/canvas/selection.rs index e0ac7e7aee..dd2b85fcca 100644 --- a/crates/ui-egui/src/canvas/selection.rs +++ b/crates/ui-egui/src/canvas/selection.rs @@ -5,6 +5,7 @@ use std::collections::HashMap; use std::collections::hash_map::{DefaultHasher, Entry}; use std::hash::{Hash, Hasher}; +use std::sync::{Arc, Weak}; use craft::behavior::Input; use craft::behavior::Metrics; @@ -18,9 +19,9 @@ use craft::ui::canvas_controls::{HoverOutline, HoverShape, SelectionOutline}; use craft::ui::contract::{Access, Bind, Common, Component, Cx, MeasureCx, PaintUi, Props as _, Role, Show as _}; use craft::ui::style::{ComponentStyle, DataColor, StyleCx}; use egui::{Color32, Rect, Response, Shape, Stroke, StrokeKind, vec2}; -use vectorcraft_doc::{NodeId, NodeKind}; +use vectorcraft_doc::{Document, NodeId, NodeKind}; use vectorcraft_engine::{DocState, Prefs, ViewInfo}; -use vectorcraft_geom::{AnchorKind, BezPath, PathData, PathEl, Point}; +use vectorcraft_geom::{AnchorKind, BezPath, PathData, PathEl, Point, Vec2}; use vectorcraft_tools::Mods; use super::cursor::ViewKey; @@ -632,9 +633,13 @@ pub(super) fn show(app: &mut VectorcraftApp, ui: &mut egui::Ui, space: &CanvasSp HoverOutline::new("Object highlight", Some(HoverShape::Path(h.path))).color(DataColor::new(h.color)).show_at(ui, rect); } let key = marks_key(app, st, tool, tool_points); + let view = view_key(app, st, tool, tool_points); let marks = match app.canvas.selection_marks.take() { Some(kept) if kept.key == key => kept, - _ => SelectionMarks::build(app, st, tool, tool_points, key), + Some(kept) if kept.view == view && kept.selection == st.selection => { + kept.follow(st, key).unwrap_or_else(|| SelectionMarks::build(app, st, tool, tool_points, (key, view))) + } + _ => SelectionMarks::build(app, st, tool, tool_points, (key, view)), }; for o in &marks.outlines { let mut outline = SelectionOutline::solid("Selection", &o.paths).color(DataColor::new(o.color)).revision(o.revision); @@ -663,29 +668,99 @@ pub(super) fn show(app: &mut VectorcraftApp, ui: &mut egui::Ui, space: &CanvasSp } /// The outlines, anchors and dots `show` draws, kept between passes while their [`marks_key`] stays: a frame with -/// nothing changed walks no selected object. +/// nothing changed walks no selected object. They are also kept while the document and the selection stay the same +/// under another revision, and moved with the selection when a move ([`vectorcraft_engine::Moved`]) took the document +/// they show to the one now. pub(crate) struct SelectionMarks { key: u64, + /// [`view_key`] of the state they were made for. + view: u64, + /// The selection they show. + selection: vectorcraft_doc::Selection, + /// The document they show. + doc: Weak, + /// A document they show moved by a distance: the one they were built for and no distance, or the document the + /// last move they followed started from and its distance. Each step of a drag starts from the document the drag + /// began with ([`SelectionMarks::follow`]). + from: (Weak, Vec2), outlines: Vec, anchors: Anchors, dots: Dots, } impl SelectionMarks { - fn build(app: &VectorcraftApp, st: &DocState, tool: &str, tool_points: bool, key: u64) -> Self { + fn build(app: &VectorcraftApp, st: &DocState, tool: &str, tool_points: bool, (key, view): (u64, u64)) -> Self { #[cfg(test)] tests::MARKS_BUILT.with(|built| built.set(built.get() + 1)); - Self { key, outlines: outlines(app, st), anchors: anchors(app, st, tool, tool_points), dots: dots(app, st) } + let doc = Arc::downgrade(&st.doc); + Self { + key, + view, + selection: st.selection.clone(), + from: (doc.clone(), Vec2::ZERO), + doc, + outlines: outlines(app, st), + anchors: anchors(app, st, tool, tool_points), + dots: dots(app, st), + } + } + + /// The marks of `st`, whose [`marks_key`] is `key`, from these marks of the same selection and view: these marks + /// when `st` shows the same document, these marks moved by `st`'s move when it took the document they show, or the + /// document of [`SelectionMarks::from`], to the one `st` shows, else `None`. + fn follow(mut self, st: &DocState, key: u64) -> Option { + let now = Arc::as_ptr(&st.doc); + if self.doc.as_ptr() != now { + let moved = st.moved.as_ref().filter(|m| m.to.as_ptr() == now && m.selection == st.selection)?; + let by = if moved.from.ptr_eq(&self.doc) { + moved.by + } else if moved.from.ptr_eq(&self.from.0) { + moved.by - self.from.1 + } else { + return None; + }; + self.translate(by); + self.from = (moved.from.clone(), moved.by); + self.doc = moved.to.clone(); + } + self.key = key; + Some(self) + } + + /// Moves every mark by `by`. + fn translate(&mut self, by: Vec2) { + let shift = vectorcraft_geom::Affine::translate(by); + for o in &mut self.outlines { + o.paths.iter_mut().chain(o.key.as_mut()).for_each(|path| path.apply_affine(shift)); + o.revision = outline_revision(&o.paths, o.key.as_ref(), o.color.to_array()); + } + for knot in self.anchors.paths.iter_mut().flat_map(|p| &mut p.subpaths).flat_map(|sp| &mut sp.knots) { + knot.anchor += by; + knot.in_ctrl += by; + knot.out_ctrl += by; + } + let dots = &mut self.dots; + for (at, _) in dots.origins.iter_mut().chain(&mut dots.centers).chain(&mut dots.key_anchor) { + *at += by; + } } } -/// What the selection's marks are built from: the document and its selection (its uid and revision), the parts the -/// view hides, Halftone Preview, the tool whose marks show, whether that tool draws its own points, and the -/// Selection & Anchor Display preferences. +/// What the selection's marks are built from: the document and its selection (its uid and revision), and what +/// [`view_key`] hashes. fn marks_key(app: &VectorcraftApp, st: &DocState, tool: &str, tool_points: bool) -> u64 { + let mut h = DefaultHasher::new(); + (st.revision, view_key(app, st, tool, tool_points)).hash(&mut h); + h.finish() +} + +/// What the selection's marks are built from besides the document's content and the selection: the document (its +/// uid), the parts the view hides, Halftone Preview, the tool whose marks show, whether that tool draws its own points, +/// and the Selection & Anchor Display preferences. +fn view_key(app: &VectorcraftApp, st: &DocState, tool: &str, tool_points: bool) -> u64 { let mut h = DefaultHasher::new(); let hides = ViewHides::of(app); - (st.uid, st.revision, hides.templates, hides.guides, hidden(app), tool, tool_points).hash(&mut h); + (st.uid, hides.templates, hides.guides, hidden(app), tool, tool_points).hash(&mut h); let prefs = &app.session.prefs; (prefs.anchor_size, prefs.show_handles_multiple_anchors, prefs.handle_style.as_str()).hash(&mut h); h.finish() diff --git a/crates/ui-egui/src/canvas/selection/tests.rs b/crates/ui-egui/src/canvas/selection/tests.rs index 672b07094a..e413a5655c 100644 --- a/crates/ui-egui/src/canvas/selection/tests.rs +++ b/crates/ui-egui/src/canvas/selection/tests.rs @@ -918,3 +918,75 @@ fn the_canvas_builds_the_selection_marks_once_per_change() { app.select_tool("directSelection"); assert_eq!(frames(&mut app, 5), 1, "another tool builds the marks once"); } + +/// Every point of the outlines, the anchors and their handles, and the dots, in order. +fn points_of(outlines: &[Outlined], anchors: &Anchors, dots: &Dots) -> Vec { + let mut out = vec![]; + for path in outlines.iter().flat_map(|o| o.paths.iter().chain(&o.key)) { + for el in path.elements() { + match *el { + PathEl::MoveTo(a) | PathEl::LineTo(a) => out.push(a), + PathEl::QuadTo(a, b) => out.extend([a, b]), + PathEl::CurveTo(a, b, c) => out.extend([a, b, c]), + PathEl::ClosePath => {} + } + } + } + for knot in anchors.paths.iter().flat_map(|p| &p.subpaths).flat_map(|sp| &sp.knots) { + out.extend([knot.anchor, knot.in_ctrl, knot.out_ctrl]); + } + out.extend(dots.origins.iter().chain(&dots.centers).chain(&dots.key_anchor).map(|(at, _)| *at)); + out +} + +/// Whether the marks the canvas keeps are, to rounding, the ones the builders give for the state now. +fn kept_marks_are_current(app: &VectorcraftApp) -> bool { + let kept = app.canvas.selection_marks.as_ref().expect("the canvas drew the selection's marks"); + let st = app.session.active().unwrap(); + let now = points_of(&outlines(app, st), &anchors(app, st, app.session.tool_id(), false), &dots(app, st)); + let was = points_of(&kept.outlines, &kept.anchors, &kept.dots); + now.len() == was.len() && now.iter().zip(&was).all(|(a, b)| (*a - *b).hypot() < 1e-9) +} + +// Whole-app frames keep the selection's marks through a new revision of the same document and selection, and move +// them with a move of the selection instead of building them: a move command, each step of a drag, and the drag's end +// build nothing and keep the marks of the state now. A scale and an undo still build them once. +#[test] +fn a_move_of_the_selection_moves_its_marks_without_building_them() { + let (mut app, _) = scene(); + let ctx = crate::testing::ui_context(); + let frames = |app: &mut VectorcraftApp, n: usize| { + let before = MARKS_BUILT.with(std::cell::Cell::get); + for _ in 0..n { + let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1600.0, 850.0)); + crate::testing::app_frame(app, &ctx, egui::RawInput { screen_rect: Some(screen), ..Default::default() }); + } + MARKS_BUILT.with(std::cell::Cell::get) - before + }; + frames(&mut app, 3); + let layer = app.session.active().unwrap().doc.layers[0].id; + let revision = app.session.active().unwrap().revision; + app.run("layer.setCurrent", json!({"id": layer.0})).unwrap(); + assert_ne!(app.session.active().unwrap().revision, revision, "a new revision"); + assert_eq!(frames(&mut app, 3), 0, "a new revision of the same document and selection"); + app.run("object.move", json!({"dx": 12.25, "dy": -5})).unwrap(); + assert_eq!(frames(&mut app, 3), 0, "a move command"); + assert!(kept_marks_are_current(&app), "after a move command"); + + app.session.begin_interaction("Move").unwrap(); + for dx in [3.0, 7.5, -2.0] { + app.session.preview("object.transform", &json!({"matrix": [1, 0, 0, 1, dx, 4], "copy": false})).unwrap(); + assert_eq!(frames(&mut app, 2), 0, "a drag's step by {dx}"); + assert!(kept_marks_are_current(&app), "after a drag's step by {dx}"); + } + app.session.commit_interaction().unwrap(); + assert_eq!(frames(&mut app, 2), 0, "the drag's end"); + assert!(kept_marks_are_current(&app), "after the drag"); + + app.run("object.transform", json!({"matrix": [2, 0, 0, 1, 0, 0]})).unwrap(); + assert_eq!(frames(&mut app, 3), 1, "a scale"); + assert!(kept_marks_are_current(&app), "after a scale"); + app.run("edit.undo", json!({})).unwrap(); + assert_eq!(frames(&mut app, 3), 1, "an undo"); + assert!(kept_marks_are_current(&app), "after an undo"); +} From 4bee2eef9cacb5582ed1621cc2849ea74b796de6 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 14:09:54 -0800 Subject: [PATCH 033/105] Properties: a selection change draws the window in one pass When the selection changed, the Properties panel placed its sections by the sizes kept from the last selection, measured the new ones while drawing, and asked for the frame to be discarded and drawn again. Every selection change and the release of a move then drew the canvas and the other panels twice. The panel now shows the inspector's Panel itself and, when the document, its revision, the selection, the tool or isolation mode changed since the last frame, measures its sections with `measure_in` before showing them, so the first pass places them at their new sizes. Field ids and the scroll position stay keyed by the document as before. Selections that add labeled rows still ask for a second pass for the rows' baselines until the craft-libs pin includes craft-libs#4311. --- crates/ui-egui/src/panels/properties.rs | 40 +++++++++++-- crates/ui-egui/src/panels/properties/tests.rs | 60 +++++++++++++++++++ 2 files changed, 95 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/panels/properties.rs b/crates/ui-egui/src/panels/properties.rs index 7e3caa1a43..c1b6f36d94 100644 --- a/crates/ui-egui/src/panels/properties.rs +++ b/crates/ui-egui/src/panels/properties.rs @@ -1,13 +1,13 @@ //! The Properties panel: sections that change with the selection. -use craft::behavior::{ColumnWidth, IconId}; +use craft::behavior::{ColumnWidth, IconId, Proposal}; use craft::ui::buttons::{Button, IconButton}; -use craft::ui::contract::{LabelScheme, Props as _, Show as _, ShowContainer as _}; +use craft::ui::contract::{BodyCx, LabelScheme, Pad, Props as _, Show as _, ShowContainer as _}; use craft::ui::layout_components::{Grid, Row, Stack}; use craft::ui::patterns::panels::Inspector; use craft::ui::runtime::commands::CommandRef; -use craft::ui::sections::HeaderStrength; +use craft::ui::sections::{HeaderStrength, Panel}; use egui::Ui; use serde_json::json; use vectorcraft_doc::{LiveShape, Node, NodeKind}; @@ -27,6 +27,8 @@ pub struct PropertiesUi { pub edited_profiled: Option<(ProfiledKey, bool)>, /// The Quick Actions last listed, with the [`quick_actions_key`] they were listed at. quick_actions: Option<(u64, Vec)>, + /// The [`content_key`] the sections were last shown for. + content: Option, } /// The key of [`PropertiesUi::edited_profiled`]: (document uid, revision, active Appearance row). @@ -63,7 +65,9 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { // Ruler guides selected on their own (a click on one): their position. let guides = super::transform::selected_guides(app); let header = heading(first.as_deref(), n_sel, editing_artboards, guides.is_some()); - inspector.target(key).header(header).show(ui, |ui, _| { + let content = content_key(app); + let changed = app.ui.properties_panel.content.replace(content) != Some(content); + let mut sections = |ui: &mut Ui, _: &mut BodyCx<'_>| { // The reference panel's labels end in a colon beside fields that keep their own width. Stack::new().fill_width().labels(LabelScheme::Form).show(ui, |ui, _| { if editing_artboards { @@ -77,7 +81,33 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { body(app, ui, first.as_deref(), n_sel, anchors); } }); - }); + }; + // The panel `Inspector::show` makes, shown here so that new sections are measured before they are placed and the + // frame is not discarded and drawn again. + let mut panel = Panel::new(header).titled().strength(HeaderStrength::Quiet).labels(LabelScheme::Inspector).pad(Pad::None); + panel = panel.id_salt(egui::IdSalt::new(key)); + if changed { + let _ = panel.measure_in(ui, Proposal::Size(ui.available_size()), &mut sections); + } + panel.show(ui, sections); +} + +/// What the sections show: the document and its revision, the selection, the tool and isolation mode. +fn content_key(app: &VectorcraftApp) -> u64 { + use std::hash::{Hash, Hasher}; + let mut h = std::collections::hash_map::DefaultHasher::new(); + app.session.tool_id().hash(&mut h); + if let Some(st) = app.session.active() { + let selection = &st.selection; + (st.uid, st.revision, st.isolation, &selection.objects, selection.key, selection.target, &selection.slices).hash(&mut h); + for (id, anchors) in &selection.anchors { + (id, anchors.len()).hash(&mut h); + } + for (id, segments) in &selection.segments { + (id, segments.len()).hash(&mut h); + } + } + h.finish() } /// The document's uid: production's field ids do not change with the selection, so neither does the key and the diff --git a/crates/ui-egui/src/panels/properties/tests.rs b/crates/ui-egui/src/panels/properties/tests.rs index 4a8158364a..f10c38ae6a 100644 --- a/crates/ui-egui/src/panels/properties/tests.rs +++ b/crates/ui-egui/src/panels/properties/tests.rs @@ -130,6 +130,66 @@ fn one_clip_group_has_edit_clipping_path_and_edit_contents_at_the_top() { assert_eq!(selected(&panel), std::slice::from_ref(&mask), "Edit Clipping Path selects the clipping path"); } +/// Selecting a second object, and going back to one, draws the panel in one pass: the sections are measured for the +/// new selection before they are placed, so the frame is not discarded and drawn again. The frame after each change +/// and a frame with no change take one pass too. +#[test] +fn a_selection_change_draws_the_panel_in_one_pass() { + let mut app = new_app(); + let (a, b) = (rect(&mut app, 20.0, 20.0, 40.0, 40.0), rect(&mut app, 120.0, 20.0, 60.0, 30.0)); + app.run("select.set", json!({"ids": [a]})).unwrap(); + let mut panel = Panel::new(app, show); + let passes = |panel: &mut Panel| { + let before = panel.ctx().cumulative_pass_nr(); + panel.frame(); + panel.ctx().cumulative_pass_nr() - before + }; + panel.frame(); + assert_eq!(passes(&mut panel), 1, "a settled frame"); + for round in 0..2 { + for (what, ids) in [("select two", json!([a, b])), ("select one", json!([b])), ("select the other", json!([a]))] { + panel.app().run("select.set", json!({ "ids": ids })).unwrap(); + assert_eq!(passes(&mut panel), 1, "{what}, round {round}"); + assert_eq!(passes(&mut panel), 1, "the frame after {what}, round {round}"); + } + } +} + +/// The same selection changes in the whole window, with the Properties panel docked: each frame takes one pass, so +/// the canvas and the other panels are drawn once. +#[test] +fn a_selection_change_draws_the_window_in_one_pass() { + let mut app = new_app(); + let (a, b) = (rect(&mut app, 20.0, 20.0, 40.0, 40.0), rect(&mut app, 120.0, 20.0, 60.0, 30.0)); + app.run("select.set", json!({"ids": [a]})).unwrap(); + app.run("window.panel", json!({"panel": "properties"})).unwrap(); + let ctx = crate::testing::ui_context(); + let mut time = 0.0; + let mut passes = |app: &mut VectorcraftApp| { + time += 1.0 / 60.0; + let raw = egui::RawInput { + time: Some(time), + screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1600.0, 1000.0))), + focused: true, + ..Default::default() + }; + let before = ctx.cumulative_pass_nr(); + let _ = crate::testing::app_frame(app, &ctx, raw); + ctx.cumulative_pass_nr() - before + }; + for _ in 0..4 { + passes(&mut app); + } + assert_eq!(passes(&mut app), 1, "a settled frame"); + for round in 0..2 { + for (what, ids) in [("select two", json!([a, b])), ("select one", json!([b])), ("select the other", json!([a]))] { + app.run("select.set", json!({ "ids": ids })).unwrap(); + assert_eq!(passes(&mut app), 1, "{what}, round {round}"); + assert_eq!(passes(&mut app), 1, "the frame after {what}, round {round}"); + } + } +} + /// Start Global Edit in Quick Actions starts it on the one selected path, the button then reads /// Stop Global Edit, and Escape stops it. Selected type has no Start Global Edit button. #[test] From d7a71b7a58ebd422beb2fb7653e43d81af5b9d2d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 14:47:33 -0800 Subject: [PATCH 034/105] Global Edit: moving the selected object keeps the preview without walking the document With one object selected, the preview of the objects Start Global Edit would take walked every selectable object again after each edit. After an edit that replaced only the selected object, and left it the same shape, size and appearance (a move), the same objects match, so the outlines found before are kept. The check compares the two documents: the layers may differ only in the selected object and in the layers and groups that hold it, which must be the same apart from their contents; the symbols and the rest of the document must be the same. The selected object's form, box, geometric size and fill and stroke are compared within a millionth of the matching tolerance, since a move rounds the form differently in its unit box. Any other change walks the document as before. The preview is now also empty while a part of a dynamic symbol instance is selected, as Start Global Edit is refused then. --- crates/engine/src/cmd/globaledit.rs | 166 +++++++++++++++++++-- crates/engine/src/tests/globaledit.rs | 201 +++++++++++++++++++++++++- 2 files changed, 357 insertions(+), 10 deletions(-) diff --git a/crates/engine/src/cmd/globaledit.rs b/crates/engine/src/cmd/globaledit.rs index 4f498e972a..5c455f897e 100644 --- a/crates/engine/src/cmd/globaledit.rs +++ b/crates/engine/src/cmd/globaledit.rs @@ -222,6 +222,8 @@ thread_local! { pub(crate) static FORMS_MADE: std::cell::Cell = const { std::cell::Cell::new(0) }; /// Tests: how many times [`outlines`] made the outline of a highlighted object on this thread. pub(crate) static OUTLINES_MADE: std::cell::Cell = const { std::cell::Cell::new(0) }; + /// Tests: how many objects [`matches`] looked at on this thread. + pub(crate) static OBJECTS_WALKED: std::cell::Cell = const { std::cell::Cell::new(0) }; } impl Form { @@ -482,6 +484,8 @@ fn matches(s: &Session, o: &Options) -> Result> { let mut cache = st.global_edit_forms.0.borrow_mut(); let mut pass = cache.forms.pass(); super::select::walk_selectable(d, st.isolation, |n| { + #[cfg(test)] + OBJECTS_WALKED.with(|c| c.set(c.get() + 1)); if n.id == *id || out.len() >= MAX_MEMBERS { return false; } @@ -1030,34 +1034,178 @@ pub fn highlights(s: &Session) -> Outlines { out } -/// [`similar`]'s outlines as of a document revision and the options they were found with. -pub type SimilarCache = std::cell::RefCell>; +/// [`similar`]'s outlines as of a document revision, with what they were found from. +pub type SimilarCache = std::cell::RefCell>; + +/// [`similar`]'s outlines and what they were found from. +#[derive(Clone, Debug)] +pub struct Similar { + revision: u64, + options: Options, + /// The document, the one selected object and the isolated object they were found with. + doc: Arc, + key: NodeId, + isolation: Option, + out: Outlines, +} /// Before Global Edit starts: with one supported object selected, the outlines of the other /// objects Start Global Edit would take now with the session's Global Edit Options, so the canvas /// shows them as soon as the object is selected. None while an interaction (a drag) is in /// progress, or when fewer than two objects would be taken. Kept per document revision and -/// options, as finding them walks the whole document. +/// options, as finding them walks the whole document. After an edit that replaced only the +/// selected object, and left what the others are compared with as it was (a move), the outlines +/// found before are kept without a walk. pub fn similar(s: &Session) -> Outlines { let Some(st) = s.active() else { return vec![] }; - if st.global_edit.is_some() || st.interaction.is_some() || st.selection.objects.len() != 1 { + // Global Edit is refused while an object of a dynamic symbol instance's art is selected. + if st.global_edit.is_some() || st.interaction.is_some() || st.selection.objects.len() != 1 || super::edit::refuse_symbol_part(s).is_err() { return vec![]; } let o = &s.global_edit_options; - if let Some((rev, opts, out)) = &*st.similar_outlines.borrow() - && *rev == st.revision - && opts == o + let key = st.selection.objects[0]; + if let Some(c) = &mut *st.similar_outlines.borrow_mut() + && c.options == *o + && c.key == key + && c.isolation == st.isolation + && (c.revision == st.revision || Arc::ptr_eq(&c.doc, &st.doc) || only_key_changed(&c.doc, &st.doc, key)) { - return out.clone(); + c.revision = st.revision; + c.doc = st.doc.clone(); + return c.out.clone(); } let out = match matches(s, o) { Ok(m) if m.len() >= 2 => outlines(st, &m), _ => vec![], }; - *st.similar_outlines.borrow_mut() = Some((st.revision, o.clone(), out.clone())); + *st.similar_outlines.borrow_mut() = + Some(Similar { revision: st.revision, options: o.clone(), doc: st.doc.clone(), key, isolation: st.isolation, out: out.clone() }); out } +/// Would [`matches`] find the same objects in `now` as in `then`, with `key` selected in both? +/// True when the layers differ only in `key` and in the layers and groups that hold it (the same +/// apart from their contents), `key` is compared with the others as before ([`same_key`]), and the +/// rest of the document is the same. A group that holds `key` is never like it (its form holds +/// `key`'s and more), so the walk looks into it before and after alike. +fn only_key_changed(then: &Document, now: &Document, key: NodeId) -> bool { + let mut found = None; + let same_symbol = |a: &vectorcraft_doc::Symbol, b: &vectorcraft_doc::Symbol| { + a.name == b.name && a.dynamic == b.dynamic && (Arc::ptr_eq(&a.art, &b.art) || a.art == b.art) + }; + // Everything else in the document (artboards, symbol settings, editing modes) as it was: the + // symbols' art is compared on its own, as one copy when no edit changed it. + let rest = |d: &Document| { + let mut d = d.clone(); + d.layers.clear(); + d.symbols.clear(); + d + }; + if then.symbols.len() != now.symbols.len() + || !then.symbols.iter().zip(&now.symbols).all(|(a, b)| same_symbol(a, b)) + || rest(then) != rest(now) + || !changed_only(&then.layers, &now.layers, key, &mut found) + { + return false; + } + found.is_none_or(|(a, b)| same_key(a, b, &now.symbol_boxes())) +} + +/// Do `then` and `now` hold the same objects, apart from `key` and the layers and groups on the way +/// to it? `found` takes the two versions of `key` when it changed. +fn changed_only<'a>(then: &'a [Arc], now: &'a [Arc], key: NodeId, found: &mut Option<(&'a Node, &'a Node)>) -> bool { + if then.len() != now.len() { + return false; + } + then.iter().zip(now).all(|(a, b)| { + if Arc::ptr_eq(a, b) { + return true; + } + if a.id != b.id { + return false; + } + if a.id == key { + return found.replace((a, b)).is_none(); + } + match (holder_children(a), holder_children(b)) { + (Some(x), Some(y)) => same_holder(a, b) && changed_only(x, y, key, found), + _ => false, + } + }) +} + +/// The objects in a layer or a group. +fn holder_children(n: &Node) -> Option<&[Arc]> { + match &n.kind { + NodeKind::Layer { children, .. } | NodeKind::Group { children, .. } => Some(children), + _ => None, + } +} + +/// Are two versions of a layer or a group the same apart from the objects in them? +fn same_holder(a: &Node, b: &Node) -> bool { + let Node { id, name, visible, locked, opacity, blend, isolate, knockout, knockout_shape, appearance, kind, bbox_angle, extras } = a; + let kinds = match (kind, &b.kind) { + ( + NodeKind::Layer { color, template, printable, children: _, clip, preview, dim_images }, + NodeKind::Layer { color: c, template: t, printable: p, children: _, clip: cl, preview: pv, dim_images: di }, + ) => color == c && template == t && printable == p && clip == cl && preview == pv && dim_images == di, + (NodeKind::Group { children: _, clip }, NodeKind::Group { children: _, clip: c }) => clip == c, + _ => false, + }; + kinds + && *id == b.id + && *name == b.name + && *visible == b.visible + && *locked == b.locked + && *opacity == b.opacity + && *blend == b.blend + && *isolate == b.isolate + && *knockout == b.knockout + && *knockout_shape == b.knockout_shape + && *appearance == b.appearance + && *bbox_angle == b.bbox_angle + && *extras == b.extras +} + +/// How far apart two versions of the selected object's form may lie, in its unit box, and how much +/// their sizes may differ (relative), for [`similar`] to keep the objects found like the first: a +/// millionth of [`SAME`]. A move leaves the form the same but for rounding (the form is placed in +/// its unit box by a transform that includes the move), well within this. +const KEPT: f64 = 1e-12; + +/// Are two versions of the selected object compared with the other objects in the same way by +/// [`matches`]: the same form in a box of the same size and the same geometric size (a perspective +/// projection changes that alone), within [`KEPT`], and the same fill and stroke in each object in +/// them? +fn same_key(a: &Node, b: &Node, symbols: &vectorcraft_doc::SymbolBoxes<'_>) -> bool { + let near = |x: f64, y: f64| (x - y).abs() <= KEPT * x.abs().max(y.abs()).max(1.0); + fn same_look(a: &Node, b: &Node) -> bool { + fill_of(a) == fill_of(b) + && stroke_of(a) == stroke_of(b) + && match (a.children(), b.children()) { + (Some(x), Some(y)) => x.len() == y.len() && x.iter().zip(y).all(|(p, q)| same_look(p, q)), + (x, y) => x.is_none() && y.is_none(), + } + } + if !(supported(a) && supported(b)) { + return false; + } + let (Some(f), Some(g)) = (Form::of(a), Form::of(b)) else { return false }; + let (fl, gl) = (f.frame.as_coeffs(), g.frame.as_coeffs()); + let sizes = match (a.geometric_bounds_with(symbols), b.geometric_bounds_with(symbols)) { + (Some(x), Some(y)) => near(x.width(), y.width()) && near(x.height(), y.height()), + (x, y) => x.is_none() && y.is_none(), + }; + f.tag == g.tag + && f.symbols == g.symbols + && f.points.len() == g.points.len() + && f.points.iter().zip(&g.points).all(|(p, q)| p.distance(*q) <= KEPT) + && fl[..4].iter().zip(&gl[..4]).all(|(x, y)| near(*x, *y)) + && sizes + && same_look(a, b) +} + /// The outlines of `members` that are not selected, hold no selected object and sit inside no /// selected object, in their layer's color. fn outlines(st: &crate::DocState, members: &[(NodeId, Affine)]) -> Outlines { diff --git a/crates/engine/src/tests/globaledit.rs b/crates/engine/src/tests/globaledit.rs index ae56fa7c5a..db2bd921e7 100644 --- a/crates/engine/src/tests/globaledit.rs +++ b/crates/engine/src/tests/globaledit.rs @@ -137,7 +137,7 @@ fn after_an_edit_only_the_changed_objects_are_compared_again_from_scratch() { s.execute("object.move", &json!({"dx": 5, "dy": 0})).unwrap(); let before = made(); assert_eq!(highlights(&s).len(), 39); - assert_eq!(since(before), (1, 0), "the selected object only: the copies are unchanged"); + assert_eq!(since(before), (2, 0), "the selected object before and after the move only: the copies are unchanged"); sel(&mut s, &[copies[0]]); s.execute("object.scale", &json!({"sx": 200, "sy": 100})).unwrap(); sel(&mut s, &[copies[1]]); @@ -156,6 +156,205 @@ fn after_an_edit_only_the_changed_objects_are_compared_again_from_scratch() { assert_eq!(crate::cmd::globaledit::match_count(&s), 38); } +#[test] +fn an_edit_to_the_selected_object_alone_keeps_the_similar_objects_without_a_walk() { + use crate::cmd::globaledit::{OBJECTS_WALKED, highlights}; + let walked = || OBJECTS_WALKED.with(std::cell::Cell::get); + // The outlines `highlights` gives, and how many objects it looked at for them. + let shown = |s: &Session| { + let before = walked(); + let out = highlights(s); + (out, walked() - before) + }; + // The outlines a walk finds, the options set again so that nothing is kept. + let fresh = |s: &mut Session| { + let size = s.global_edit_options.size; + s.execute("select.globalEditOptions", &json!({"size": !size})).unwrap(); + highlights(s); + s.execute("select.globalEditOptions", &json!({"size": size})).unwrap(); + let before = walked(); + let out = highlights(s); + assert!(walked() > before, "a walk"); + out + }; + let mut s = session(); + let key = rect(&mut s, 0.37, 0.91, 10.3, 10.3); + let copies: Vec = (1..40).map(|i| rect(&mut s, 20.0 * f64::from(i % 20), 100.0 + 20.0 * f64::from(i / 20), 10.3, 10.3)).collect(); + sel(&mut s, &[key]); + let (first, n) = shown(&s); + assert_eq!(first.len(), 39); + assert!(n >= 40, "the first preview walks every object"); + + // The move rounds the form in its unit box differently; the same objects are like it. + s.execute("object.move", &json!({"dx": 3.17, "dy": 1.29})).unwrap(); + let (out, n) = shown(&s); + assert_eq!(n, 0, "a move of the selected object alone compares the others as before"); + assert_eq!(out, first); + assert_eq!(out, fresh(&mut s)); + + // Another object moved: it is shown where it is now. + sel(&mut s, &[copies[0]]); + s.execute("object.move", &json!({"dx": 300, "dy": 0})).unwrap(); + sel(&mut s, &[key]); + let (out, n) = shown(&s); + assert!(n > 0, "another object changed"); + let moved = node(&s, copies[0]).stroke_path().unwrap(); + assert!(out.iter().any(|(p, _)| *p == moved), "the moved copy is shown where it is now"); + assert_eq!(out, fresh(&mut s)); + + // The selected object took another shape: none of the squares is like it. + s.execute("object.scale", &json!({"sx": 200, "sy": 100})).unwrap(); + let (out, n) = shown(&s); + assert!(n > 0 && out.is_empty(), "the widened square matches none of the squares"); + s.execute("edit.undo", &json!({})).unwrap(); + assert_eq!(shown(&s).0.len(), 39); + + // With Size, a larger copy of the selected square is another size. + s.execute("select.globalEditOptions", &json!({"size": true})).unwrap(); + assert_eq!(shown(&s).0.len(), 39); + s.execute("object.scale", &json!({"sx": 200, "sy": 200})).unwrap(); + let (out, n) = shown(&s); + assert!(n > 0 && out.is_empty(), "the enlarged square has the size of none of them"); + s.execute("edit.undo", &json!({})).unwrap(); + s.execute("select.globalEditOptions", &json!({"size": false})).unwrap(); + + // With Appearance, another fill on the selected square leaves the others out. + s.execute("select.globalEditOptions", &json!({"appearance": true})).unwrap(); + assert_eq!(shown(&s).0.len(), 39); + s.execute("paint.setFill", &json!({"color": "#12ab34"})).unwrap(); + let (out, n) = shown(&s); + assert!(n > 0 && out.is_empty(), "the others have another fill now"); + s.execute("select.globalEditOptions", &json!({"appearance": false})).unwrap(); + + // Reflected, the selected kite keeps its size but is no longer like its copy. + let lone = kite(&mut s, 0.0, 500.0, 1.0); + kite(&mut s, 200.0, 500.0, 1.0); + sel(&mut s, &[lone]); + assert_eq!(shown(&s).0.len(), 1); + s.execute("object.reflect", &json!({"axis": "vertical"})).unwrap(); + let (out, n) = shown(&s); + assert!(n > 0 && out.is_empty(), "a reflected copy is not like it"); +} + +#[test] +fn another_layer_locked_leaves_its_objects_out_of_the_similar_objects() { + use crate::cmd::globaledit::highlights; + let mut s = session(); + let key = rect(&mut s, 0.0, 0.0, 10.0, 10.0); + rect(&mut s, 20.0, 0.0, 10.0, 10.0); + let other = NodeId(s.execute("layer.new", &json!({})).unwrap()["id"].as_u64().unwrap()); + rect(&mut s, 40.0, 0.0, 10.0, 10.0); + rect(&mut s, 60.0, 0.0, 10.0, 10.0); + sel(&mut s, &[key]); + assert_eq!(highlights(&s).len(), 3); + s.execute("layer.setProps", &json!({"id": other.0, "locked": true})).unwrap(); + assert_eq!(s.doc().unwrap().selection.objects, [key]); + assert_eq!(highlights(&s).len(), 1, "the squares on the locked layer are left out"); +} + +#[test] +fn a_new_artboard_brings_the_objects_on_it_into_the_similar_objects() { + use crate::cmd::globaledit::highlights; + let mut s = session(); + let key = rect(&mut s, 0.0, 0.0, 10.0, 10.0); + rect(&mut s, 20.0, 0.0, 10.0, 10.0); + rect(&mut s, 1100.0, 100.0, 10.0, 10.0); + s.execute("select.globalEditOptions", &json!({"includeCanvas": false})).unwrap(); + sel(&mut s, &[key]); + assert_eq!(highlights(&s).len(), 1, "the square on the canvas is left out"); + s.execute("artboard.new", &json!({"x": 1000, "y": 0, "width": 400, "height": 400})).unwrap(); + sel(&mut s, &[key]); + assert_eq!(highlights(&s).len(), 2, "the square is on an artboard now"); +} + +#[test] +fn a_symbol_redrawn_brings_its_instances_onto_the_artboard() { + use crate::cmd::globaledit::highlights; + let mut s = session(); + let r = rect(&mut s, 0.0, 0.0, 40.0, 40.0); + let key = NodeId(s.execute("symbol.new", &json!({"ids": [r.0], "name": "Tile"})).unwrap()["id"].as_u64().unwrap()); + s.execute("symbol.place", &json!({"name": "Tile", "x": 1000, "y": 300})).unwrap(); + s.execute("select.globalEditOptions", &json!({"includeCanvas": false})).unwrap(); + sel(&mut s, &[key]); + assert!(highlights(&s).is_empty(), "the other instance is on the canvas"); + // The symbol's art drawn 400 pt to the left: the other instance lies on the artboard. + let st = s.doc_mut().unwrap(); + let d = std::sync::Arc::make_mut(&mut st.doc); + let art = std::sync::Arc::make_mut(&mut d.symbols[0].art); + art.transform(Affine::translate((-400.0, 0.0)), vectorcraft_doc::Scaling::default()); + st.revision += 1; + assert_eq!(highlights(&s).len(), 1, "the other instance is on the artboard now"); +} + +#[test] +fn a_symbol_instance_put_in_perspective_has_another_size() { + use crate::cmd::globaledit::highlights; + let mut s = session(); + s.execute("perspective.grid.preset", &json!({"kind": 2})).unwrap(); + let r = rect(&mut s, 450.0, 300.0, 100.0, 100.0); + let key = NodeId(s.execute("symbol.new", &json!({"ids": [r.0], "name": "Tile"})).unwrap()["id"].as_u64().unwrap()); + s.execute("symbol.place", &json!({"name": "Tile", "x": 100, "y": 100})).unwrap(); + s.execute("select.globalEditOptions", &json!({"size": true})).unwrap(); + sel(&mut s, &[key]); + assert_eq!(highlights(&s).len(), 1); + let size = |s: &Session| bounds(s, key).size(); + let was = size(&s); + s.execute("perspective.attach", &json!({"ids": [key.0], "plane": "right"})).unwrap(); + sel(&mut s, &[key]); + assert_ne!(size(&s), was, "the projection changes the instance's size"); + assert!(highlights(&s).is_empty(), "the other instance has the size the selected one had"); +} + +#[test] +fn a_part_of_a_dynamic_symbol_instance_selected_shows_no_similar_objects() { + use crate::cmd::globaledit::highlights; + let mut s = session(); + let a = rect(&mut s, 0.0, 0.0, 10.0, 10.0); + let b = rect(&mut s, 20.0, 0.0, 10.0, 10.0); + let inst = NodeId(s.execute("symbol.new", &json!({"name": "Pair", "ids": [a.0, b.0], "type": "dynamic"})).unwrap()["id"].as_u64().unwrap()); + s.execute("symbol.place", &json!({"name": "Pair", "x": 300, "y": 300})).unwrap(); + sel(&mut s, &[inst]); + assert_eq!(highlights(&s).len(), 1); + s.execute("symbol.instance.selectPart", &json!({"id": inst.0, "path": [1]})).unwrap(); + assert_eq!(s.doc().unwrap().selection.objects, [inst]); + assert!(highlights(&s).is_empty(), "Global Edit does not take a part of the art"); + sel(&mut s, &[inst]); + assert_eq!(highlights(&s).len(), 1, "the whole instance again"); +} + +#[test] +fn a_group_selected_inside_a_group_keeps_its_similar_objects_after_a_move() { + use crate::cmd::globaledit::{OBJECTS_WALKED, highlights}; + let walked = || OBJECTS_WALKED.with(std::cell::Cell::get); + let mut s = session(); + let group = |s: &mut Session, ids: &[NodeId]| { + sel(s, ids); + NodeId(s.execute("object.group", &json!({})).unwrap()["id"].as_u64().unwrap()) + }; + // A group of two squares inside an outer group with a third square, and a copy of the outer + // group: the copy is like the outer group, not like the inner one. + let a = [rect(&mut s, 0.0, 0.0, 10.0, 10.0), rect(&mut s, 20.0, 0.0, 10.0, 10.0)]; + let inner = group(&mut s, &a); + let third = rect(&mut s, 40.0, 0.0, 10.0, 10.0); + let outer = group(&mut s, &[inner, third]); + let b = [rect(&mut s, 0.0, 100.0, 10.0, 10.0), rect(&mut s, 20.0, 100.0, 10.0, 10.0)]; + let inner_copy = group(&mut s, &b); + let third_copy = rect(&mut s, 40.0, 100.0, 10.0, 10.0); + group(&mut s, &[inner_copy, third_copy]); + sel(&mut s, &[inner]); + let first = highlights(&s); + assert_eq!(crate::cmd::globaledit::match_count(&s), 2, "the copy's inner group; the outer group {outer} holds the selected one"); + assert!(!first.is_empty()); + s.execute("object.move", &json!({"dx": 5, "dy": 0})).unwrap(); + let before = walked(); + assert_eq!(highlights(&s), first); + assert_eq!(walked(), before, "the outer group changed with the selected group only"); + s.execute("select.globalEditOptions", &json!({"size": true})).unwrap(); + s.execute("select.globalEditOptions", &json!({"size": false})).unwrap(); + assert_eq!(highlights(&s), first, "a walk finds the same"); + assert!(walked() > before); +} + #[test] fn the_canvas_highlights_similar_objects_before_the_start_with_the_selection_tool_only() { let mut s = session(); From 2f508db904b14e42d36d5ddd47d6c648ebf9c9bd Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 14:55:41 -0800 Subject: [PATCH 035/105] Properties: the Preferences key reads the General unit after a Units pick The Preferences section's memo key took the General unit's index before the Units commit ran, while its lengths were read after it. On the frame that picked new units the key still matched the previous frame, so the section replayed and the Keyboard Increment showed the old unit for that frame. The key now reads the unit next to the lengths. --- .../panels/properties/document_sections.rs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/crates/ui-egui/src/panels/properties/document_sections.rs b/crates/ui-egui/src/panels/properties/document_sections.rs index 4774bdb750..cff44b4f44 100644 --- a/crates/ui-egui/src/panels/properties/document_sections.rs +++ b/crates/ui-egui/src/panels/properties/document_sections.rs @@ -57,6 +57,9 @@ pub(super) fn document_sections(app: &mut VectorcraftApp, ui: &mut Ui) { app.run(command, json!({})).ok(); } let mut prefs = Vec::new(); + // Read again after the Units commit above, so the key and `lengths` come from the same General unit. + let general = app.session.general_unit(); + let unit = Unit::ALL.iter().position(|u| *u == general).unwrap_or(usize::MAX); let (increment, scale) = (app.session.prefs.keyboard_increment, app.session.prefs.scale_strokes); let (bare_points, lengths) = (app.session.prefs.numbers_without_units_are_points, crate::canvas::rulers::general_lengths(app)); super::section(tl!("Preferences")).show(ui, |ui, _| { @@ -310,6 +313,31 @@ mod tests { assert_eq!(per_frame[6..], [0; 6], "idle frames after a command run them no more: {per_frame:?}"); } + /// The frame that picks new units in the Units menu shows the Keyboard Increment in them: the Preferences + /// section's key reads the General unit after the pick runs, as its lengths do. + #[test] + fn the_frame_that_picks_units_shows_the_increment_in_them() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.run("file.new", json!({"width": 300, "height": 200})).unwrap(); + let initial = app.session.general_unit(); + let mut panel = Panel::new(app, document_sections); + panel.room(egui::vec2(400.0, 1000.0)); + panel.frame(); + let before = panel.value("Keyboard Increment"); + panel.click_role("Units", Role::COMBO_BOX); + panel.key(egui::Key::ArrowDown, egui::Modifiers::NONE); + panel.key(egui::Key::ArrowDown, egui::Modifiers::NONE); + let enter = + |pressed| egui::Event::Key { key: egui::Key::Enter, physical_key: None, pressed, repeat: false, modifiers: egui::Modifiers::NONE }; + panel.frame_with(vec![enter(true), enter(false)]); + assert_ne!(panel.app().session.general_unit(), initial, "Enter applies the chosen unit"); + let picked = panel.value("Keyboard Increment"); + panel.frame(); + let settled = panel.value("Keyboard Increment"); + assert_ne!(settled, before, "the increment shows in the new unit"); + assert_eq!(picked, settled, "the frame of the pick already shows the increment in the new unit"); + } + /// The memoized sections still take input: a click on Snap to Grid turns it on, once, and Scale Strokes & Effects /// sets its preference. #[test] From cb6703c0f106b60f5db565fdc1d89a1bff4f7b22 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 14:58:15 -0800 Subject: [PATCH 036/105] Menus: an interaction a dialog or the font menu begins reads the menus CI failed `the_font_menu_preview_reads_the_menus_when_it_ends`: with the state key holding the revision an interaction began from, the key no longer changed when the font menu's preview began, so the menus were not read then, though commands that check for an open interaction change state at that point and the menu stays open while it previews. The key now also holds whether an interaction that the active tool did not begin is open. A tool's drag still keeps the key as it begins; a dialog's, a panel's or the font menu's preview changes it as it begins and as it ends. `Interaction::by_tool` reads the flag for the UI crate. --- crates/engine/src/interaction.rs | 7 +++++++ crates/ui-egui/src/menus/model.rs | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/interaction.rs b/crates/engine/src/interaction.rs index bdc829fb37..387fc0e009 100644 --- a/crates/engine/src/interaction.rs +++ b/crates/engine/src/interaction.rs @@ -55,6 +55,13 @@ pub struct Interaction { pub keep_on_switch: bool, } +impl Interaction { + /// The active tool began it (a drag). + pub fn by_tool(&self) -> bool { + self.tool + } +} + /// An interaction that a command from outside the tool set aside while it runs /// ([`crate::Session::outside_interaction`]). #[derive(Debug)] diff --git a/crates/ui-egui/src/menus/model.rs b/crates/ui-egui/src/menus/model.rs index 92c1786af4..dc4357363b 100644 --- a/crates/ui-egui/src/menus/model.rs +++ b/crates/ui-egui/src/menus/model.rs @@ -90,7 +90,9 @@ pub(crate) fn translate_label(english: &'static str) -> String { /// doesn't list (panels shown, a tool picked). While an /// interaction is open (for example a move, scale or shape drag, a dialog's or the font menu's /// preview, or a typing session), the hash takes the revision the interaction began from in place of the current one, -/// which each of its previews changes: the hash stays the same as the interaction begins, and changes as it ends. +/// which each of its previews changes, and changes as it ends. The hash stays the same as a tool's drag begins. An +/// interaction that a dialog, a panel or the font menu begins changes the hash as it begins, since commands that check +/// for an open interaction change state then and the menus stay open while it previews. pub(crate) fn state_key(app: &VectorcraftApp, input: Option) -> u64 { let mut h = DefaultHasher::new(); input.hash(&mut h); @@ -102,7 +104,8 @@ pub(crate) fn state_key(app: &VectorcraftApp, input: Option) -> u64 { (s.journal.len(), s.active_index(), s.clipboard.is_empty(), s.tool_composing()).hash(&mut h); if let Some(d) = s.active() { let revision = d.interaction.as_ref().map_or(d.revision, |it| it.revision); - (d.uid, revision, d.history.undo.len(), d.history.redo.len(), d.transparency_grid, d.print_tiling).hash(&mut h); + let previewing = d.interaction.as_ref().is_some_and(|it| !it.by_tool()); + (d.uid, revision, previewing, d.history.undo.len(), d.history.redo.len(), d.transparency_grid, d.print_tiling).hash(&mut h); } (app.system_paste, app.last_effect.is_some(), app.ui.recent_files.len(), app.ui.recent_files.first(), app.recent_fonts().len()).hash(&mut h); // Apply Last Filter and Last Filter… are named after the filter that ran last. From bcd1fcac61fd16ed8f50dc2ce937b996c2d850e3 Mon Sep 17 00:00:00 2001 From: Codex Date: Sun, 29 Nov 2026 23:58:30 +0100 Subject: [PATCH 037/105] Harden RPM smoke lifecycle and cover failure paths --- .github/scripts/release-rpm-smoke.py | 119 +++++++++--------- .../scripts/tests/test_release_rpm_smoke.py | 116 +++++++++++++++++ .github/workflows/release-rpm-smoke.yml | 10 +- .github/workflows/sonarcloud.yml | 3 + 4 files changed, 188 insertions(+), 60 deletions(-) create mode 100644 .github/scripts/tests/test_release_rpm_smoke.py diff --git a/.github/scripts/release-rpm-smoke.py b/.github/scripts/release-rpm-smoke.py index 73dc871f1d..3d70cca7c1 100644 --- a/.github/scripts/release-rpm-smoke.py +++ b/.github/scripts/release-rpm-smoke.py @@ -7,63 +7,68 @@ import secrets import socket import subprocess import time +import tempfile -results = Path("/results") -requirements = (results / "rpm-requires.txt").read_text() -for capability in ( - "libc.so.6()(64bit)", - "libm.so.6(GLIBC_2.35)(64bit)", - "libgcc_s.so.1()(64bit)", - "libxkbcommon.so.0()(64bit)", - "(libvulkan.so.1()(64bit) or libEGL.so.1()(64bit))", -): - if capability not in requirements.splitlines(): - raise RuntimeError(f"Missing RPM requirement: {capability}") -version = subprocess.check_output(["vectorcraft-cli", "--version"], text=True) -(results / "cli-version.txt").write_text(version) -# Original fixture authored for this package smoke test; no external artwork. -fixture = results / "original-smoke.svg" -fixture.write_text('' - '' - '') -token = secrets.token_hex(32) -env = dict(os.environ, VECTORCRAFT_NO_PREFS="1", XDG_RUNTIME_DIR="/tmp/vectorcraft-runtime", - VECTORCRAFT_CONTROL_TOKEN=token) -Path(env["XDG_RUNTIME_DIR"]).mkdir(mode=0o700, exist_ok=True) -with (results / "gui.log").open("w") as log: - app = subprocess.Popen([ - "vectorcraft", "--control", "32180", "--automation-read-root", str(results), - "--automation-write-root", str(results), str(fixture), - ], stdout=log, stderr=subprocess.STDOUT, env=env) - try: - deadline = time.monotonic() + 90 - while True: - if app.poll() is not None: - raise RuntimeError(f"GUI exited during startup: {app.returncode}") - try: - channel = socket.create_connection(("127.0.0.1", 32180), timeout=5) - break - except OSError: - if time.monotonic() >= deadline: - raise RuntimeError("GUI control channel did not become ready") from None - time.sleep(1) - channel.settimeout(30) - with channel, channel.makefile("rwb") as stream: - for request_id, method, params in ( - (0, "auth", {"token": token}), - (1, "ui.inspect", {}), - ): - stream.write((json.dumps(dict(id=request_id, method=method, params=params)) + "\n").encode()) - stream.flush() - response = json.loads(stream.readline()) - (results / f"{method}.json").write_text(json.dumps(response, indent=2)) - if response.get("id") != request_id or response.get("ok") is not True: - raise RuntimeError(f"GUI request failed: {method}") - finally: - app.terminate() +def run_smoke(results): + requirements = (results / "rpm-requires.txt").read_text() + for capability in ( + "libc.so.6()(64bit)", + "libm.so.6(GLIBC_2.35)(64bit)", + "libgcc_s.so.1()(64bit)", + "libxkbcommon.so.0()(64bit)", + "(libvulkan.so.1()(64bit) or libEGL.so.1()(64bit))", + ): + if capability not in requirements.splitlines(): + raise RuntimeError(f"Missing RPM requirement: {capability}") + + version = subprocess.check_output(["vectorcraft-cli", "--version"], text=True) + (results / "cli-version.txt").write_text(version) + # Original fixture authored for this package smoke test; no external artwork. + fixture = results / "original-smoke.svg" + fixture.write_text('' + '' + '') + token = secrets.token_hex(32) + with tempfile.TemporaryDirectory(prefix="vectorcraft-runtime-") as runtime, (results / "gui.log").open("w") as log: + env = dict(os.environ, VECTORCRAFT_NO_PREFS="1", XDG_RUNTIME_DIR=runtime, + VECTORCRAFT_CONTROL_TOKEN=token) + app = subprocess.Popen([ + "vectorcraft", "--control", "32180", "--automation-read-root", str(results), + "--automation-write-root", str(results), str(fixture), + ], stdout=log, stderr=subprocess.STDOUT, env=env) try: - app.wait(timeout=10) - except subprocess.TimeoutExpired: - app.kill() - app.wait() + deadline = time.monotonic() + 90 + while True: + if app.poll() is not None: + raise RuntimeError(f"GUI exited during startup: {app.returncode}") + try: + channel = socket.create_connection(("127.0.0.1", 32180), timeout=5) + break + except OSError: + if time.monotonic() >= deadline: + raise RuntimeError("GUI control channel did not become ready") from None + time.sleep(1) + channel.settimeout(30) + with channel, channel.makefile("rwb") as stream: + for request_id, method, params in ( + (0, "auth", {"token": token}), + (1, "ui.inspect", {}), + ): + stream.write((json.dumps(dict(id=request_id, method=method, params=params)) + "\n").encode()) + stream.flush() + response = json.loads(stream.readline()) + (results / f"{method}.json").write_text(json.dumps(response, indent=2)) + if response.get("id") != request_id or response.get("ok") is not True: + raise RuntimeError(f"GUI request failed: {method}") + finally: + app.terminate() + try: + app.wait(timeout=10) + except subprocess.TimeoutExpired: + app.kill() + app.wait() + + +if __name__ == "__main__": + run_smoke(Path("/results")) diff --git a/.github/scripts/tests/test_release_rpm_smoke.py b/.github/scripts/tests/test_release_rpm_smoke.py new file mode 100644 index 0000000000..9d92237534 --- /dev/null +++ b/.github/scripts/tests/test_release_rpm_smoke.py @@ -0,0 +1,116 @@ +"""Exercise failures that an installed-package happy-path check cannot reproduce.""" +import importlib.util +import json +from pathlib import Path +import subprocess +import tempfile +import unittest +from unittest.mock import MagicMock, patch + +spec = importlib.util.spec_from_file_location("rpm_smoke", Path(__file__).parents[1] / "release-rpm-smoke.py") +smoke = importlib.util.module_from_spec(spec) +spec.loader.exec_module(smoke) + + +class SmokeLifecycleTests(unittest.TestCase): + def setUp(self): + self.folder = tempfile.TemporaryDirectory() + self.addCleanup(self.folder.cleanup) + self.results = Path(self.folder.name) + (self.results / "rpm-requires.txt").write_text("\n".join([ + "libc.so.6()(64bit)", "libm.so.6(GLIBC_2.35)(64bit)", + "libgcc_s.so.1()(64bit)", "libxkbcommon.so.0()(64bit)", + "(libvulkan.so.1()(64bit) or libEGL.so.1()(64bit))", + ])) + self.app = MagicMock() + self.app.poll.return_value = None + self.channel = MagicMock() + self.stream = self.channel.makefile.return_value.__enter__.return_value + self.stream.readline.side_effect = [ + b'{"id":0,"ok":true}\n', b'{"id":1,"ok":true,"result":{"window":"fixture"}}\n', + ] + self.runtime = None + + def launch(*args, **kwargs): + self.runtime = Path(kwargs["env"]["XDG_RUNTIME_DIR"]) + self.assertTrue(self.runtime.is_dir()) + return self.app + + self.launch = self.start_patch(smoke.subprocess, "Popen", side_effect=launch) + self.start_patch(smoke.subprocess, "check_output", return_value="vectorcraft-cli 0.25.0\n") + self.connect = self.start_patch(smoke.socket, "create_connection", return_value=self.channel) + self.start_patch(smoke.time, "sleep") + + def start_patch(self, owner, name, **kwargs): + patcher = patch.object(owner, name, **kwargs) + result = patcher.start() + self.addCleanup(patcher.stop) + return result + + def assert_cleaned_up(self): + self.app.terminate.assert_called_once() + self.assertFalse(self.runtime.exists()) + + def test_success_records_inspection_and_removes_private_runtime(self): + smoke.run_smoke(self.results) + report = json.loads((self.results / "ui.inspect.json").read_text()) + self.assertEqual(report["result"], {"window": "fixture"}) + requests = [json.loads(call.args[0]) for call in self.stream.write.call_args_list] + self.assertEqual(requests[0]["method"], "auth") + self.assertEqual(requests[0]["params"]["token"], self.launch.call_args.kwargs["env"]["VECTORCRAFT_CONTROL_TOKEN"]) + self.assert_cleaned_up() + + def test_missing_runtime_dependency_prevents_launch(self): + (self.results / "rpm-requires.txt").write_text("") + with self.assertRaisesRegex(RuntimeError, "Missing RPM requirement"): + smoke.run_smoke(self.results) + self.launch.assert_not_called() + + def test_child_exit_during_startup_is_a_failure(self): + self.app.poll.return_value = 1 + self.app.returncode = 1 + with self.assertRaisesRegex(RuntimeError, "exited during startup"): + smoke.run_smoke(self.results) + self.assert_cleaned_up() + + def test_connection_is_retried_until_ready(self): + self.connect.side_effect = [OSError("not ready"), self.channel] + smoke.run_smoke(self.results) + self.assertEqual(self.connect.call_count, 2) + self.assert_cleaned_up() + + def test_startup_timeout_stops_child(self): + self.connect.side_effect = OSError("not ready") + self.start_patch(smoke.time, "monotonic", side_effect=[0, 91]) + with self.assertRaisesRegex(RuntimeError, "did not become ready"): + smoke.run_smoke(self.results) + self.assert_cleaned_up() + + def test_auth_refusal_prevents_inspection(self): + self.stream.readline.side_effect = [b'{"id":0,"ok":false}\n'] + with self.assertRaisesRegex(RuntimeError, "request failed: auth"): + smoke.run_smoke(self.results) + self.assertFalse((self.results / "ui.inspect.json").exists()) + self.assert_cleaned_up() + + def test_response_for_another_request_is_rejected(self): + self.stream.readline.side_effect = [b'{"id":0,"ok":true}\n', b'{"id":99,"ok":true}\n'] + with self.assertRaisesRegex(RuntimeError, "request failed: ui.inspect"): + smoke.run_smoke(self.results) + self.assert_cleaned_up() + + def test_malformed_response_still_stops_child(self): + self.stream.readline.side_effect = [b'not json\n'] + with self.assertRaises(json.JSONDecodeError): + smoke.run_smoke(self.results) + self.assert_cleaned_up() + + def test_unresponsive_child_is_killed_after_termination_timeout(self): + self.app.wait.side_effect = [subprocess.TimeoutExpired("vectorcraft", 10), 0] + smoke.run_smoke(self.results) + self.app.kill.assert_called_once() + self.assert_cleaned_up() + + +if __name__ == "__main__": + unittest.main() diff --git a/.github/workflows/release-rpm-smoke.yml b/.github/workflows/release-rpm-smoke.yml index 4140f57f3d..61948e0f35 100644 --- a/.github/workflows/release-rpm-smoke.yml +++ b/.github/workflows/release-rpm-smoke.yml @@ -11,13 +11,14 @@ on: paths: - .github/workflows/release-rpm-smoke.yml - .github/scripts/release-rpm-smoke.py + - .github/scripts/tests/test_release_rpm_smoke.py -permissions: - contents: read - actions: read +permissions: {} jobs: source: + permissions: + actions: read runs-on: ubuntu-24.04 timeout-minutes: 5 outputs: @@ -43,6 +44,9 @@ jobs: echo '::error::No release run has both Linux package artifacts available' exit 1 smoke: + permissions: + contents: read + actions: read needs: source timeout-minutes: 25 strategy: diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 4cd4eb6387..223859d9b9 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -21,4 +21,7 @@ jobs: # The reusable workflow defaults build-jobs to 2 so a cold instrumented # archive stays within hosted-runner memory (craft-common-actions#333). uses: storytold/craft-common-actions/.github/workflows/sonarcloud.yml@main + with: + python-coverage-source: .github/scripts + python-coverage-script: .github/scripts/tests/test_release_rpm_smoke.py secrets: inherit From 3aa41526e2009af448624f9c93cceb6a7a7fed59 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 15:02:34 -0800 Subject: [PATCH 038/105] Performance: the color check stops walking objects after a second color several_colors kept looking up the remaining ids, walking the remaining children of a group and the rest of a pattern tile after it had found two colors. It now stops as soon as the second color turns up. --- crates/engine/src/cmd/recolor.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/recolor.rs b/crates/engine/src/cmd/recolor.rs index 174f90ecb0..a0ba6d243c 100644 --- a/crates/engine/src/cmd/recolor.rs +++ b/crates/engine/src/cmd/recolor.rs @@ -1065,12 +1065,18 @@ fn several_colors(d: &Document, ids: &[NodeId], only: Option<&BTreeSet>) self.read(n); for c in n.children().into_iter().flatten() { self.read_tree(c, only); + if self.several { + return; + } } } } let mut seen = Seen { first: None, several: false, patterns: vec![] }; for n in ids.iter().filter_map(|id| d.node(*id)) { seen.read_tree(n, only); + if seen.several { + return true; + } } let mut next = 0; while !seen.several @@ -1078,11 +1084,13 @@ fn several_colors(d: &Document, ids: &[NodeId], only: Option<&BTreeSet>) { next += 1; for a in d.pattern(name).map(|def| def.art.as_slice()).unwrap_or_default() { - a.walk(&mut |m| { - if !seen.several { - seen.read(m); - } + let _ = a.try_walk(&mut |m| { + seen.read(m); + if seen.several { std::ops::ControlFlow::Break(()) } else { std::ops::ControlFlow::Continue(()) } }); + if seen.several { + break; + } } } seen.several From 5367d0e668e99cddd97366274576fd3f9dc4f968 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 16:32:05 -0800 Subject: [PATCH 039/105] Sonar: exclude lcov.info, tests and the catalog tables, and set the Python version The SonarCloud scan printed three warnings that sonar-project.properties can clear: - sonar.exclusions=lcov.info: sonar.sources=. indexed the coverage report (over 20 MB), and the scanner warned and dropped it. - sonar.cpd.exclusions: duplication now skips the test-file patterns, crates/ui-egui/src/menus/ui_commands.rs and the MCP catalog generated from it, which gave 32 "Too many duplication" warnings. The value is on one line because the shared Sonar workflow reads it with one sed line and adds **/i18n/**. - sonar.python.version=3.12, 3.13, 3.14, 3.15: the versions CI runs the scripts in packaging/ and scripts/ with (3.12 on Ubuntu 24.04, 3.13 from setup-python in the nightly jobs, 3.15 on macOS 15). --- sonar-project.properties | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sonar-project.properties b/sonar-project.properties index 9523d64b0e..cf06216650 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -10,6 +10,17 @@ sonar.sources=. sonar.tests=. sonar.test.inclusions=**/tests/**,**/tests.rs,**/*_tests.rs,**/tests_*.rs +# The coverage job writes lcov.info at the root, where sonar.sources=. would index it. +sonar.exclusions=lcov.info + +# Duplication skips test files, the UI command table and the MCP catalog generated from it. +# The shared Sonar workflow reads this property from a single line and adds **/i18n/** to it. +sonar.cpd.exclusions=**/tests/**,**/tests.rs,**/*_tests.rs,**/tests_*.rs,crates/ui-egui/src/menus/ui_commands.rs,crates/mcp/src/ui_catalog.rs + +# CI runs the scripts in packaging/ and scripts/ with Python 3.12 (Ubuntu 24.04), 3.13 +# (setup-python in the nightly jobs) and 3.15 (macOS 15). +sonar.python.version=3.12, 3.13, 3.14, 3.15 + # S4790 (weak hash): MD5 is the key derivation of the PDF standard security handler revisions 2-4 # (ISO 32000-1 §7.6.3.3), which PDF 1.3-1.6 files use. It is needed to read those files and to write # the compatibility the user picks, not chosen for new security: the default is 256-bit AES From c1eb29c054149dcea42ac9275ac7d6199777f37c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 16:39:26 -0800 Subject: [PATCH 040/105] Docs: doc comments name U+FFFD in place of the literal character Two doc comments held a literal U+FFFD replacement character, which SonarCloud reports as "Invalid character encountered". They now write it as `\u{FFFD}`: - crates/ui-egui/src/panels/actions/playback.rs (`shown_text`) - crates/pdf/src/tests/realtext.rs (the #708, #811 test) --- crates/pdf/src/tests/realtext.rs | 2 +- crates/ui-egui/src/panels/actions/playback.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/pdf/src/tests/realtext.rs b/crates/pdf/src/tests/realtext.rs index 7d1ac97027..7fcd06dd56 100644 --- a/crates/pdf/src/tests/realtext.rs +++ b/crates/pdf/src/tests/realtext.rs @@ -801,7 +801,7 @@ fn digits_unnamed(text: &str) -> Vec { out } -/// #708, #811: a glyph whose ToUnicode value is U+FFFD isn't type showing "�". This subset font +/// #708, #811: a glyph whose ToUnicode value is U+FFFD isn't type showing `\u{FFFD}`. This subset font /// has no character map of its own, but the font is installed: each digit is found by its outline /// there, so the whole text stays one type object, with no outlines left behind. #[test] diff --git a/crates/ui-egui/src/panels/actions/playback.rs b/crates/ui-egui/src/panels/actions/playback.rs index bff0bd1d4d..ca9547889f 100644 --- a/crates/ui-egui/src/panels/actions/playback.rs +++ b/crates/ui-egui/src/panels/actions/playback.rs @@ -158,7 +158,7 @@ pub(crate) fn step_place(step: usize, in_batch: Option) -> String { } } -/// `text` as a status message shows it: control characters become `�`, and text past 80 +/// `text` as a status message shows it: control characters become `\u{FFFD}`, and text past 80 /// characters ends in `…`. pub(crate) fn shown_text(text: &str) -> String { const MAX: usize = 80; From 9d2b0a93d909dde08ebec7d58988e92fa3ea5d89 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 16:39:45 -0800 Subject: [PATCH 041/105] Packaging: unsigned Windows builds the caller asked for print a notice sign.ps1 printed "Windows signing secrets not set" as a ::warning:: annotation in every workflow that builds without signing secrets, including the Windows ARM64 package job, which has none by design. A caller that wants unsigned output now sets CRAFT_ALLOW_UNSIGNED=1, and the same message is printed as a ::notice:: instead. Without the variable the warning stays. Any other value is rejected with an error. -Required still refuses to run without signing material. The signing suite checks the warning without the variable, the notice with CRAFT_ALLOW_UNSIGNED=1, and the error for other values. --- packaging/windows/nightly-signing-tests.ps1 | 23 +++++++++++++++++++++ packaging/windows/sign.ps1 | 15 ++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/packaging/windows/nightly-signing-tests.ps1 b/packaging/windows/nightly-signing-tests.ps1 index 51a8e2ade9..535ad4e222 100644 --- a/packaging/windows/nightly-signing-tests.ps1 +++ b/packaging/windows/nightly-signing-tests.ps1 @@ -73,6 +73,29 @@ try { Clear-SigningFixtures Write-Output 'PASS: supported-configuration-presence-without-signing' + # The unsigned message is captured here, so it does not become an annotation of this job. + $optInFile = Join-Path $root 'opt-in-sentinel.exe' + [IO.File]::WriteAllText($optInFile, 'generated sentinel, not a real executable') + $savedActions = $env:GITHUB_ACTIONS + try { + $env:GITHUB_ACTIONS = 'true' + $env:CRAFT_ALLOW_UNSIGNED = $null + $default = (& $sign $optInFile) -join "`n" + Assert-Policy ($default.Contains('::warning::Windows signing secrets not set')) "unsigned output without the opt-in must warn; got: $default" + $env:CRAFT_ALLOW_UNSIGNED = '1' + $optedIn = (& $sign $optInFile) -join "`n" + Assert-Policy ($optedIn.Contains('::notice::Windows signing secrets not set')) "opted-in unsigned output must be a notice; got: $optedIn" + Assert-Policy (-not $optedIn.Contains('::warning::')) "opted-in unsigned output must not warn; got: $optedIn" + foreach ($value in @('true', '0', 'yes')) { + $env:CRAFT_ALLOW_UNSIGNED = $value + Invoke-Refusal { & $sign $optInFile } 'CRAFT_ALLOW_UNSIGNED must be 1 or unset' + } + } finally { + $env:CRAFT_ALLOW_UNSIGNED = $null + $env:GITHUB_ACTIONS = $savedActions + } + Write-Output 'PASS: opted-in-unsigned-output-is-a-notice' + # Load the policy function without signing. These objects are not crypto evidence. . $sign -CheckOnly foreach ($value in @($null, [pscustomobject]@{Status='NotSigned';SignerCertificate='fixture'}, [pscustomobject]@{Status='HashMismatch';SignerCertificate='fixture'}, [pscustomobject]@{Status='Valid';SignerCertificate=$null})) { diff --git a/packaging/windows/sign.ps1 b/packaging/windows/sign.ps1 index 11a391dd60..2a768c7338 100644 --- a/packaging/windows/sign.ps1 +++ b/packaging/windows/sign.ps1 @@ -9,7 +9,8 @@ AZURE_SIGNING_ENDPOINT (e.g. https://eus.codesigning.azure.net), AZURE_SIGNING_ACCOUNT, AZURE_CERT_PROFILE With neither, it prints a warning and leaves the files unsigned (exit code 0), so test builds - still produce installers. Nightly callers require signing with -Required and can check the + still produce installers. A caller that builds unsigned on purpose sets CRAFT_ALLOW_UNSIGNED=1, + and the message is then a notice instead of a warning. Nightly callers require signing with -Required and can check the signing configuration with -Required -CheckOnly. Compilation uses the separate -CheckBuildEnvironment mode, which refuses any signing material without importing a key. @@ -38,6 +39,10 @@ function Write-Warn([string] $Message) { if ($env:GITHUB_ACTIONS) { Write-Output "::warning::$Message" } else { Write-Warning $Message } } +function Write-Note([string] $Message) { + if ($env:GITHUB_ACTIONS) { Write-Output "::notice::$Message" } else { Write-Output $Message } +} + function Find-SignTool { if ($env:SIGNTOOL) { return $env:SIGNTOOL } $onPath = Get-Command signtool.exe -ErrorAction SilentlyContinue @@ -64,6 +69,11 @@ if ($CheckBuildEnvironment) { } return } +$allowUnsigned = switch -CaseSensitive ([string]$env:CRAFT_ALLOW_UNSIGNED) { + '' { $false } + '1' { $true } + default { throw "CRAFT_ALLOW_UNSIGNED must be 1 or unset, got '$env:CRAFT_ALLOW_UNSIGNED'" } +} $haveCert = [bool]$env:WINDOWS_CERTIFICATE $haveAzure = -not ($azureVars | Where-Object { -not [Environment]::GetEnvironmentVariable($_) }) @@ -78,7 +88,8 @@ if (-not $Files) { throw 'At least one file is required for signing' } $Files = $Files | ForEach-Object { (Resolve-Path $_).Path } if (-not $haveCert -and -not $haveAzure) { - Write-Warn "Windows signing secrets not set (WINDOWS_CERTIFICATE or AZURE_*): leaving unsigned: $($Files -join ', ')" + $message = "Windows signing secrets not set (WINDOWS_CERTIFICATE or AZURE_*): leaving unsigned: $($Files -join ', ')" + if ($allowUnsigned) { Write-Note $message } else { Write-Warn $message } exit 0 } From 9a588078419876ffa2ec576ecc13678718a74812 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 16:44:27 -0800 Subject: [PATCH 042/105] Performance: a move finds the selected objects' places in fewer walks of the tree With 10,000 objects selected, object.move walked the document's tree five times and looked each object up by id three times. It now walks the tree three times and looks each object up once. - The selected roots (for the menus, for Move, Rotate, Scale and the other transforms, for Copy and Cut, and inside an isolated group) are put in paint order and reduced to their top-level objects from one walk instead of two. - A transform finds the objects' places once for Transform Patterns and for the edit, instead of once for each. - After a transform, the check for a pixel-aligned compound path reads the parent at the object's place instead of looking the object and its parent up by id. --- crates/engine/src/cmd/edit.rs | 30 +++++++++++++++++++---- crates/engine/src/cmd/edit/tests.rs | 30 +++++++++++++++++++++++ crates/engine/src/cmd/object/pixelgrid.rs | 12 +++++++++ crates/engine/src/cmd/object/transform.rs | 18 +++++++++----- crates/engine/src/tests/large_edits.rs | 18 ++++++++++++++ 5 files changed, 97 insertions(+), 11 deletions(-) diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index 4fc1b83c29..70d7547313 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -967,7 +967,8 @@ pub(crate) fn selection_roots(st: &crate::DocState) -> Vec { } #[cfg(test)] ROOTS_FOUND.set(ROOTS_FOUND.get() + 1); - let roots = roots_of(&st.doc, st.selection.in_paint_order(&st.doc)); + let (ids, paths) = placed_in_paint_order(&st.doc, &st.selection.objects); + let roots = roots_placed(&st.doc, ids, &paths, |_, _| false); *kept = Some((Arc::downgrade(&st.doc), st.selection.objects.clone(), roots.clone())); roots }) @@ -1015,7 +1016,19 @@ pub(crate) fn no_symbol_part(s: &Session) -> std::result::Result<(), String> { pub(crate) fn selected_roots_to_transform(s: &Session) -> Result> { refuse_symbol_part(s)?; let st = s.doc()?; - Ok(roots_within(&st.doc, st.selection.in_paint_order(&st.doc), |_, _| true)) + let (ids, paths) = placed_in_paint_order(&st.doc, &st.selection.objects); + Ok(roots_placed(&st.doc, ids, &paths, |_, _| true)) +} + +/// The objects of `objects` that are in `doc`, in paint order as +/// [`vectorcraft_doc::Selection::in_paint_order`] gives them, with their places in the tree. One +/// walk finds the places for both the order and [`roots_placed`] ([`roots_within`] after +/// `in_paint_order` walks the tree twice). +fn placed_in_paint_order(doc: &Document, objects: &[NodeId]) -> (Vec, HashMap>) { + let paths = doc.index_paths(objects.iter().copied()); + let mut ids: Vec = objects.iter().copied().filter(|id| paths.contains_key(id)).collect(); + ids.sort_by(|a, b| paths.get(a).cmp(&paths.get(b))); + (ids, paths) } /// [`selected_roots`] for the selected objects inside the isolated object `root` @@ -1027,8 +1040,9 @@ pub(crate) fn selected_roots_to_transform(s: &Session) -> Result> { pub(crate) fn selected_roots_inside(s: &Session, root: NodeId, members: bool) -> Result> { refuse_symbol_part(s)?; let st = s.doc()?; - let ids = st.selection.in_paint_order(&st.doc).into_iter().filter(|id| super::inside_isolation(&st.doc, root, *id)).collect(); - Ok(roots_within(&st.doc, ids, |compound, _| members || compound == root)) + let (ids, paths) = placed_in_paint_order(&st.doc, &st.selection.objects); + let ids = ids.into_iter().filter(|id| super::inside_isolation(&st.doc, root, *id)).collect(); + Ok(roots_placed(&st.doc, ids, &paths, |compound, _| members || compound == root)) } /// The top-level objects among `ids` (in paint order): compound-path members stand for their @@ -1042,6 +1056,11 @@ pub(crate) fn roots_of(doc: &Document, ids: Vec) -> Vec { fn roots_within(doc: &Document, ids: Vec, keep_member: impl Fn(NodeId, NodeId) -> bool) -> Vec { // Every id's place in the tree, found in one walk (a lookup per id is a walk per id). let paths = doc.index_paths(ids.iter().copied()); + roots_placed(doc, ids, &paths, keep_member) +} + +/// [`roots_within`] with `paths`, the places of `ids` in `doc`'s tree, found already. +fn roots_placed(doc: &Document, ids: Vec, paths: &HashMap>, keep_member: impl Fn(NodeId, NodeId) -> bool) -> Vec { // A compound-path member acts as its compound (compounds are one object). let mut sel: Vec<(NodeId, Option>)> = ids .into_iter() @@ -1105,7 +1124,8 @@ fn copy_cut_targets(s: &Session) -> Result<(bool, Vec)> { st.doc.node(compound).and_then(|n| n.children()).is_some_and(|members| !members.is_empty() && members.iter().all(|m| whole(m))) }) }; - let roots = roots_within(&st.doc, st.selection.in_paint_order(&st.doc), |compound, _member| in_isolated_compound || !all_members_whole(compound)); + let (ids, paths) = placed_in_paint_order(&st.doc, &st.selection.objects); + let roots = roots_placed(&st.doc, ids, &paths, |compound, _member| in_isolated_compound || !all_members_whole(compound)); Ok((direct, roots)) } diff --git a/crates/engine/src/cmd/edit/tests.rs b/crates/engine/src/cmd/edit/tests.rs index 7ac2d9c162..7e0471f0f5 100644 --- a/crates/engine/src/cmd/edit/tests.rs +++ b/crates/engine/src/cmd/edit/tests.rs @@ -348,6 +348,36 @@ fn direct_selection_cut_timing() { } } +/// Finding the selected roots (for the menus, for Move and its siblings, for Copy and Cut, and +/// inside an isolated group) walks the tree once for the paint order and the roots together, in +/// paint order whatever order the objects were selected in. +#[test] +fn finding_the_selected_roots_walks_the_tree_once() { + let mut s = session(2_000, square); + let all = crate::tests_large_edits::layer(&s, 0); + let reversed: Vec = all.iter().rev().map(|id| id.0).collect(); + s.execute("select.set", &json!({"ids": reversed})).unwrap(); + type Find = fn(&Session) -> Vec; + let finds: [(&str, Find); 3] = [ + ("the selected roots", |s| selected_roots(s).unwrap()), + ("the roots to transform", |s| selected_roots_to_transform(s).unwrap()), + ("Copy's targets", |s| copy_cut_targets(s).unwrap().1), + ]; + for (what, find) in finds { + let walks = tree_walks(); + assert!(find(&s) == all, "{what} in paint order"); + assert_eq!(tree_walks() - walks, 1, "finding {what} walked the tree {} times", tree_walks() - walks); + } + s.execute("object.group", &json!({})).unwrap(); + let group = s.doc().unwrap().doc.layers[0].children().unwrap()[0].id; + s.execute("select.set", &json!({"ids": reversed})).unwrap(); + // The first call also builds the lookup cache that the isolation check reads. + assert!(selected_roots_inside(&s, group, false).unwrap() == all, "the roots inside the group in paint order"); + let walks = tree_walks(); + assert!(selected_roots_inside(&s, group, false).unwrap() == all); + assert_eq!(tree_walks() - walks, 1, "finding the roots inside the group walked the tree {} times", tree_walks() - walks); +} + /// The selected roots are found once for a document version and its selected objects, however many enabled checks /// read them, and found again after the selection changes, after an edit, and for another selection. #[test] diff --git a/crates/engine/src/cmd/object/pixelgrid.rs b/crates/engine/src/cmd/object/pixelgrid.rs index 81909da76f..220ed30099 100644 --- a/crates/engine/src/cmd/object/pixelgrid.rs +++ b/crates/engine/src/cmd/object/pixelgrid.rs @@ -142,6 +142,18 @@ pub(crate) fn keep_compound_aligned(d: &mut Document, id: NodeId, sc: Scaling) { } } +/// [`keep_compound_aligned`] for the object at `path` in `d`'s tree, found already: the compound +/// path is read at the parent's place, without looking either object up by id. +pub(crate) fn keep_compound_aligned_at(d: &mut Document, path: &[usize], sc: Scaling) { + let Some((_, up)) = path.split_last() else { return }; + if up.is_empty() || !d.node_at(up).is_some_and(|n| matches!(n.kind, NodeKind::Compound { .. }) && n.extras().pixel_aligned) { + return; + } + if let Some(n) = d.node_mut_at(up) { + snap_object(n, sc); + } +} + /// After any edit ([`Session::edit`]): snap each pixel-aligned object that the edit changed or added /// (its node in `doc` is not the one in `before`), with the pixel-aligned art of its linked opacity /// mask, to the pixel grid. Objects the edit did not touch are not visited. diff --git a/crates/engine/src/cmd/object/transform.rs b/crates/engine/src/cmd/object/transform.rs index 1a15e44aa3..3f471a00fe 100644 --- a/crates/engine/src/cmd/object/transform.rs +++ b/crates/engine/src/cmd/object/transform.rs @@ -66,10 +66,15 @@ pub(super) fn scaling_options(s: &Session, p: &Value) -> Scaling { /// param, else General › Transform Pattern Tiles)? Noted in the journal when they or the art of /// their linked opacity masks use a pattern, so a replay moves their tiles alike whatever the preference is then. pub(crate) fn transform_patterns(s: &mut Session, p: &Value, ids: &[NodeId]) -> Result { + let paths = s.doc()?.doc.index_paths(ids.iter().copied()); + transform_patterns_at(s, p, ids, &paths) +} + +/// [`transform_patterns`] with `paths`, the places of `ids` in the document's tree, found already. +fn transform_patterns_at(s: &mut Session, p: &Value, ids: &[NodeId], paths: &std::collections::HashMap>) -> Result { let on = bool_or(p, "patterns", s.prefs.transform_pattern_tiles); let d = &s.doc()?.doc; let mut uses = false; - let paths = d.index_paths(ids.iter().copied()); for n in ids.iter().filter_map(|id| paths.get(id)).filter_map(|p| d.node_at(p)) { uses |= uses_pattern_with_masks(n); } @@ -152,7 +157,9 @@ fn apply_transform_moving_guides( let areas = bool_or(p, "typeAreas", false); let objects = transforms_objects(p); let mut sc = if Scaling::factor(xf).is_some() { scaling(s, p) } else { Scaling::default() }; - sc.patterns = transform_patterns(s, p, &ids)?; + // The places of `ids`, found in one walk for Transform Patterns and for the edit below. + let paths = s.doc()?.doc.index_paths(ids.iter().copied()); + sc.patterns = transform_patterns_at(s, p, &ids, &paths)?; let c = xf.as_coeffs(); let is_translation = (c[0] - 1.0).abs() < 1e-9 && c[1].abs() < 1e-9 && c[2].abs() < 1e-9 && (c[3] - 1.0).abs() < 1e-9; let delta = guides.unwrap_or(Vec2::new(c[4], c[5])); @@ -174,8 +181,6 @@ fn apply_transform_moving_guides( // An edit normally preserves the tree positions already found here. Settling an active // typing session can change the document before the edit closure runs, so look up again then. let reindex = copy || (!s.previewing && crate::cmd::typing_in_progress(s)); - let d = &s.doc()?.doc; - let paths = d.index_paths(ids.iter().copied()); let none = paths.is_empty() && !has_guides; // A move of direct-selected anchors may re-map the handles beside them (`interpolate`). let mut interpolate = None; @@ -230,8 +235,9 @@ fn apply_transform_moving_guides( } } if objects { - for id in &targets { - super::pixelgrid::keep_compound_aligned(d, *id, sc); + // The transforms above leave every object at its place, so `paths` still holds them. + for p in targets.iter().filter_map(|id| paths.get(id)) { + super::pixelgrid::keep_compound_aligned_at(d, p, sc); } // Moving all of the tile art moves the tile as far. if let Some(before) = tile_art { diff --git a/crates/engine/src/tests/large_edits.rs b/crates/engine/src/tests/large_edits.rs index 0394fb18fa..2806cdd925 100644 --- a/crates/engine/src/tests/large_edits.rs +++ b/crates/engine/src/tests/large_edits.rs @@ -253,6 +253,24 @@ fn transform_each_with_copy_of_50000_objects_takes_few_tree_walks() { undo_gives_back(&mut s, &before); } +/// A move of 10,000 selected objects walks the tree once for the paint order and the top-level +/// objects, once for Transform Patterns and the edit, and once for the selection's check after the +/// edit. It reads each object's compound path at the object's place, so the only lookups by id are +/// the range check's, one per object. +#[test] +fn moving_10000_selected_objects_walks_the_tree_three_times() { + let n = 10_000; + let mut s = session(n, square); + let ids = layer(&s, 0); + let (walks, lookups) = (vectorcraft_doc::tree_walks(), vectorcraft_doc::path_lookups()); + s.execute("object.move", &json!({"dx": 3, "dy": 0})).unwrap(); + let (walks, lookups) = (vectorcraft_doc::tree_walks() - walks, vectorcraft_doc::path_lookups() - lookups); + assert_eq!(walks, 3, "walked the tree {walks} times"); + assert!(lookups <= n as u64, "{lookups} lookups by id for {n} objects"); + assert_eq!(bounds(&s, ids[n - 1]), square_at(n - 1) + vectorcraft_geom::Vec2::new(3.0, 0.0)); + assert!(selected(&s, &ids)); +} + #[test] fn offset_path_of_50000_objects_takes_few_tree_walks() { let s = session(50_000, square); From d2b18d1270e7ac79734a1c4657d24cceacd248c0 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 16:50:38 -0800 Subject: [PATCH 043/105] Text: web-fonts.txt lists only faces that craft-fonts ships crates/text/web-fonts.txt listed 30 background faces (Cairo, Tajawal, Almarai, IBM Plex Sans Arabic, Noto Kufi Arabic, Amiri, Alexandria, Fustat, Reem Kufi, Aref Ruqaa and Gulzar) that craft-fonts does not have yet; they are added by storytold/craft-fonts#11 and #13, which are still open. Every build with CRAFT_FONTS_DIR printed "web build won't fetch: Cairo Regular, Tajawal ExtraLight, ..." from crates/text/build.rs and xtask/src/web_fonts.rs, and the web build fetched none of them. The rows are removed. The startup and demand faces stay. The rows go back in when craft-fonts #11 and #13 merge. --- crates/text/web-fonts.txt | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/crates/text/web-fonts.txt b/crates/text/web-fonts.txt index 235ba98e13..d46cfe41c5 100644 --- a/crates/text/web-fonts.txt +++ b/crates/text/web-fonts.txt @@ -8,35 +8,5 @@ startup | Noto Sans Arabic | Regular startup | Noto Sans Thai | Regular startup | Noto Sans Georgian | Regular -background | Cairo | Regular -background | Tajawal | ExtraLight -background | Tajawal | Light -background | Tajawal | Regular -background | Tajawal | Medium -background | Tajawal | Bold -background | Tajawal | ExtraBold -background | Tajawal | Black -background | Almarai | Light -background | Almarai | Regular -background | Almarai | Bold -background | Almarai | ExtraBold -background | IBM Plex Sans Arabic | Thin -background | IBM Plex Sans Arabic | ExtraLight -background | IBM Plex Sans Arabic | Light -background | IBM Plex Sans Arabic | Regular -background | IBM Plex Sans Arabic | Medium -background | IBM Plex Sans Arabic | SemiBold -background | IBM Plex Sans Arabic | Bold -background | Noto Kufi Arabic | Regular -background | Amiri | Regular -background | Amiri | Italic -background | Amiri | Bold -background | Amiri | Bold Italic -background | Alexandria | Regular -background | Fustat | Regular -background | Reem Kufi | Regular -background | Aref Ruqaa | Regular -background | Aref Ruqaa | Bold -background | Gulzar | Regular demand | NanumGothic | Regular demand | Noto Sans Devanagari | Regular From 42f973a5bc04d84293c9896edde56e70adc2920e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 16:50:38 -0800 Subject: [PATCH 044/105] xtask: the cache warm builds integration tests too `cargo xtask ci warm` built each test shard with `--lib --bins --no-run`, while the shards run `--lib --bins --tests`. The warm build left out the integration test executables the shards then build, and cargo warned `unused dependency vectorcraft-testkit` for apps/vectorcraft-cli, whose only use is in tests/it. The warm build now selects the same targets as the test shards, through one `TARGETS` list that both use. --- xtask/src/main.rs | 45 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 08a55df09a..5484c0d3e9 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -267,12 +267,14 @@ fn cmd_test() -> Result<(), String> { test_packages(&["--workspace".to_owned()], "--workspace", None) } +/// The test targets that [`test_packages`] runs and `ci warm` builds. +const TARGETS: [&str; 3] = ["--lib", "--bins", "--tests"]; + /// [`cmd_test`] for the packages `select` picks (`--workspace` or `-p` ids), shown as `shown`; /// with `part`, only that part's share of their tests (xtask/src/shards.rs), which needs nextest. /// A part runs its counted share, then its pinned tests, each with nextest's default thread count. /// Every run finishes before the first error is returned. fn test_packages(select: &[String], shown: &str, part: Option) -> Result<(), String> { - const TARGETS: [&str; 3] = ["--lib", "--bins", "--tests"]; if let Some(part) = part { if !has_nextest() { return Err(format!("cargo nextest run {shown}: a shard that runs part of a crate's tests needs cargo-nextest")); @@ -393,11 +395,13 @@ fn cmd_ci_shard() -> Result<(), String> { run_steps(&steps) } -/// `cargo xtask ci warm`: for each test shard, builds its crates' library and binary tests without -/// running them, then builds what the checks shard builds, so one dependency-cache entry holds the -/// dependencies of every shard with the features that shard builds them with (cargo resolves -/// features over the packages each command selects). The integration tests are left out: they -/// build no dependency that the library tests do not, since both take the crate's dev-dependencies. +/// `cargo xtask ci warm`: for each test shard, builds its crates' library, binary and integration +/// tests without running them, then builds what the checks shard builds, so one dependency-cache +/// entry holds the dependencies of every shard with the features that shard builds them with (cargo +/// resolves features over the packages each command selects). The test builds select the same +/// targets as the test shards ([`TARGETS`]), so the cache also holds the test executables the +/// shards run, and cargo does not warn (`cargo::unused_dependencies`) about a dev-dependency that +/// only an integration test uses. /// /// In a leg that saves the cache, every build records its units in `CRAFT_CACHE_UNITS` /// (xtask/src/cache_units.rs), xtask's own build included. @@ -414,9 +418,8 @@ fn cmd_ci_warm() -> Result<(), String> { steps.push(( "build tests", Box::new(move || { - let mut c = cargo(); - c.arg("test").args(shards::select(&crates)).args(["--lib", "--bins", "--no-run"]); - cache_units::run(c, &format!("cargo test --lib --bins --no-run ({})", shards::names(&crates))) + let (c, what) = warm_tests(&crates); + cache_units::run(c, &what) }), )); } @@ -447,6 +450,13 @@ fn cmd_ci_warm() -> Result<(), String> { run_steps(&steps) } +/// The command `ci warm` builds one test shard's tests with, and its description. +fn warm_tests(crates: &[shards::Member]) -> (Command, String) { + let mut c = cargo(); + c.arg("test").args(shards::select(crates)).args(TARGETS).arg("--no-run"); + (c, format!("cargo test {} --no-run ({})", TARGETS.join(" "), shards::names(crates))) +} + /// Runs `steps` in turn, stopping at the first that fails; the summary names the steps that passed /// and, after a failure, the one that failed and those skipped. fn run_steps(steps: &[Step]) -> Result<(), String> { @@ -588,3 +598,20 @@ fn i18n_report_packages(select: &[String], shown: &str) -> Result<(), String> { c.arg("test").args(select).args(["--lib", "--bins", "--tests", "--", "i18n::tests::untranslated_report", "--exact", "--nocapture"]); run(c, &format!("cargo test {shown} --lib --bins --tests -- i18n::tests::untranslated_report --exact --nocapture")) } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn warm_builds_the_test_targets_the_shards_run() { + let crates = [shards::Member { name: "a".into(), id: "path+file:///w/a#0.1.0".into(), version: "0.1.0".into(), doctests: true }]; + let (c, what) = warm_tests(&crates); + let args: Vec = c.get_args().map(|a| a.to_string_lossy().into_owned()).collect(); + assert_eq!(args, ["test", "-p", "path+file:///w/a#0.1.0", "--lib", "--bins", "--tests", "--no-run"]); + for target in TARGETS { + assert!(args.iter().any(|a| a == target), "ci warm does not build {target}"); + } + assert_eq!(what, "cargo test --lib --bins --tests --no-run (a)"); + } +} From dc597fbc13bc2bb07906187fe21b3e53956e8d76 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 16:55:30 -0800 Subject: [PATCH 045/105] Tests: the selection-move rebuild count holds the font and plug-in catalogs steady a_selection_move_rebuilds_the_menus_for_its_press_and_release_only counts the menus' rebuilds in each frame. A font or plug-in that a test running alongside adds, or the installed fonts' scan ending, also rebuilds the menus, and the exact count then failed. The test now holds the fonts and plug-ins steady for the whole run, and runs the move again on a new app, at most 20 times, until the script and proof-setup revisions held still through it. It asserts the same counts. --- crates/ui-egui/Cargo.toml | 1 + crates/ui-egui/src/canvas/tests.rs | 65 ++++++++++++++++++++---------- 2 files changed, 45 insertions(+), 21 deletions(-) diff --git a/crates/ui-egui/Cargo.toml b/crates/ui-egui/Cargo.toml index 95487e91c0..3e979ac08f 100644 --- a/crates/ui-egui/Cargo.toml +++ b/crates/ui-egui/Cargo.toml @@ -104,6 +104,7 @@ vectorcraft-testkit = { workspace = true } vectorcraft-tools = { workspace = true, features = ["testing"] } # A variable font built in code (no font file is committed). vectorcraft-text = { workspace = true, features = ["test-fonts"] } +vectorcraft-plugins = { workspace = true, features = ["test-steady"] } wat = { workspace = true } [build-dependencies] diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index 223dd83d0b..ab21113b8a 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -867,29 +867,52 @@ fn the_move_of_a_releasing_frame_counts_for_the_tool_drag() { /// A Selection tool move builds the menus' states again twice, in the frame of its press and in the frame of its /// release, which commits the move. The frame the move begins in and the frames of its previews, which change the -/// document's revision, keep them. +/// document's revision, keep them. The menus are also built again when a process-wide catalog changes, so the fonts +/// and plug-ins are held steady against tests running alongside for the whole run, and the move runs again on a new +/// app, at most 20 times, until the other catalogs held still through it. #[test] fn a_selection_move_rebuilds_the_menus_for_its_press_and_release_only() { - let (mut app, ctx, xf) = rectangle_tool(); - let id = app.session.execute("shape.rectangle", &json!({"x": 100, "y": 100, "width": 60, "height": 30})).unwrap()["id"].as_u64().unwrap(); - app.select_tool("selection"); - app.session.execute("select.set", &json!({"ids": [id]})).unwrap(); - let (from, to) = (xf.to_screen(Point::new(130.0, 115.0)), xf.to_screen(Point::new(170.0, 135.0))); - app_step(&mut app, &ctx, vec![egui::Event::PointerMoved(from)]); - for _ in 0..2 { - app_step(&mut app, &ctx, vec![]); - } - let none = egui::Modifiers::NONE; - let mut steps = vec![vec![primary(from, true, none)]]; - steps.extend((1..=8).map(|i| vec![egui::Event::PointerMoved(from.lerp(to, i as f32 / 8.0))])); - steps.push(vec![primary(to, false, none)]); - steps.extend([vec![], vec![], vec![]]); - let mut rebuilt = vec![]; - for events in steps { - let before = app.menus.rebuilds; - app_step(&mut app, &ctx, events); - rebuilt.push(app.menus.rebuilds - before); - } + let fonts = vectorcraft_text::FontDb::global(); + let _steady = (vectorcraft_text::test_fonts::steady_fonts(fonts), vectorcraft_plugins::steady::steady_plugins()); + let catalogs = || { + ( + crate::menus::plugin_revision(), + fonts.generation(), + fonts.installed_fonts_ready(), + crate::scripts_menu::revision(), + crate::dialogs::proof_setup::saved_revision(), + ) + }; + let run = || { + let (mut app, ctx, xf) = rectangle_tool(); + let id = app.session.execute("shape.rectangle", &json!({"x": 100, "y": 100, "width": 60, "height": 30})).unwrap()["id"].as_u64().unwrap(); + app.select_tool("selection"); + app.session.execute("select.set", &json!({"ids": [id]})).unwrap(); + let (from, to) = (xf.to_screen(Point::new(130.0, 115.0)), xf.to_screen(Point::new(170.0, 135.0))); + app_step(&mut app, &ctx, vec![egui::Event::PointerMoved(from)]); + for _ in 0..2 { + app_step(&mut app, &ctx, vec![]); + } + let none = egui::Modifiers::NONE; + let mut steps = vec![vec![primary(from, true, none)]]; + steps.extend((1..=8).map(|i| vec![egui::Event::PointerMoved(from.lerp(to, i as f32 / 8.0))])); + steps.push(vec![primary(to, false, none)]); + steps.extend([vec![], vec![], vec![]]); + let mut rebuilt = vec![]; + for events in steps { + let before = app.menus.rebuilds; + app_step(&mut app, &ctx, events); + rebuilt.push(app.menus.rebuilds - before); + } + (app, rebuilt) + }; + let (app, rebuilt) = (0..20) + .find_map(|_| { + let before = catalogs(); + let out = run(); + (catalogs() == before).then_some(out) + }) + .unwrap_or_else(|| panic!("tests running alongside kept changing the font and plug-in catalogs")); assert_eq!(drawn_paths(&app), vec![Rect::new(140.0, 120.0, 200.0, 150.0)], "the drag moves the rectangle"); assert_eq!(rebuilt, [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], "rebuilds in each frame: press, 8 moves, release, 3 idle"); } From b8c754e7a2c9379c399eecb2692570bc35bae54b Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 02:24:25 +0100 Subject: [PATCH 046/105] Import the generated RPM helper coverage report --- sonar-project.properties | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sonar-project.properties b/sonar-project.properties index 9523d64b0e..2f69afe794 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -18,3 +18,6 @@ sonar.issue.ignore.multicriteria=pdf_md5 sonar.issue.ignore.multicriteria.pdf_md5.ruleKey=rust:S4790 sonar.issue.ignore.multicriteria.pdf_md5.resourceKey=crates/pdf/src/encrypt.rs sonar.coverage.exclusions=packaging/** + +# Produced by the shared workflow Python coverage step. +sonar.python.coverage.reportPaths=python-coverage.xml From 8e68c5edcf092ecd8993ea6aed7c630c2f921903 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 17:43:37 -0800 Subject: [PATCH 047/105] Shape Builder: Pick Color From defaults to Color Swatches While the Shape Builder is active, a fill picked from a swatch or a color changes only the current fill, and the selected art keeps its own. With Pick Color From set to Artwork, a merge takes the look of the art, so the picked color never reached the merged shape and the tool looked as if it could not fill. Pick Color From now defaults to Color Swatches: a merge fills with the picked color, and the Left and Right arrow keys step through the color swatches. A pickColorFrom saved with the preferences is kept, so a saved Artwork stays Artwork; preferences saved without one take Color Swatches. The shapeBuilder.merge command still defaults to artwork when its pickColorFrom is left out. Docs: docs/mcp.md and the tool options params text. --- crates/engine/src/tests/build.rs | 30 ++++++++++++++++++++++- crates/engine/src/tests/toolsettings.rs | 25 +++++++++++++++++++ crates/mcp/src/ui_catalog.rs | 2 +- crates/tools/src/builder.rs | 6 ++--- crates/ui-egui/src/dialogs/option_form.rs | 2 +- crates/ui-egui/src/menus/ui_commands.rs | 2 +- docs/mcp.md | 9 ++++--- 7 files changed, 65 insertions(+), 11 deletions(-) diff --git a/crates/engine/src/tests/build.rs b/crates/engine/src/tests/build.rs index 6ccdfad0a5..adb5d04af5 100644 --- a/crates/engine/src/tests/build.rs +++ b/crates/engine/src/tests/build.rs @@ -1753,7 +1753,8 @@ fn shape_builder_swatches_keep_the_current_fill_and_the_first_covered_objects_lo } /// The Shape Builder tool sends the point where the drag started first and the point where it -/// ended last, so a drag from the hole into the square takes the square's look. +/// ended last, so with Pick Color From Artwork a drag from the hole into the square takes the +/// square's look. #[test] fn shape_builder_tool_drag_from_the_hole_takes_the_look_where_it_ends() { let mut s = session(); @@ -1762,6 +1763,7 @@ fn shape_builder_tool_drag_from_the_hole_takes_the_look_where_it_ends() { select_ids(&mut s, &bars.iter().copied().chain([red]).collect::>()); let v = ViewInfo::default(); s.select_tool("shapeBuilder", v).unwrap(); + s.set_tool_option_cmd(&json!({"tool": "shapeBuilder", "values": {"pickColorFrom": "artwork"}})).unwrap(); s.pointer(&PointerEvent::new(PointerKind::Down, 50.0, 50.0), v).unwrap(); s.pointer(&PointerEvent::new(PointerKind::Drag, 85.0, 50.0), v).unwrap(); s.pointer(&PointerEvent::new(PointerKind::Drag, 120.0, 50.0), v).unwrap(); @@ -1853,6 +1855,7 @@ fn shape_builder_arrow_keys_step_the_current_fill_through_the_swatches() { let v = ViewInfo::default(); s.select_tool("shapeBuilder", v).unwrap(); let chips = |s: &mut Session| s.overlays(v).iter().filter(|o| matches!(o, vectorcraft_tools::Overlay::Swatch { .. })).count(); + s.set_tool_option_cmd(&json!({"tool": "shapeBuilder", "values": {"pickColorFrom": "artwork"}})).unwrap(); assert!(!s.tool_claims_key(ToolKey::Right, v), "Artwork leaves the arrows to nudging"); let values = json!({"pickColorFrom": "swatches", "cursorSwatchPreview": true}); s.set_tool_option_cmd(&json!({"tool": "shapeBuilder", "values": values})).unwrap(); @@ -2071,6 +2074,31 @@ fn shape_builder_fill_preview_is_put_back_by_a_cancel() { assert_eq!(s.paint.fill, before, "the cancel puts the fill back"); } +/// With the Shape Builder's default options, a fill picked while it is active (a swatch or a +/// color) fills the next merge: the tool sends `pickColorFrom: "swatches"`, and the merged shape +/// is not the red or blue of the art. +#[test] +fn shape_builder_default_merge_fills_with_the_picked_fill() { + let v = ViewInfo::default(); + for pick in [json!({"swatch": "Leaf"}), json!({"color": "#ff8800"})] { + let mut s = session(); + two(&mut s); + s.execute("swatch.new", &json!({"name": "Leaf", "color": "#00ff00"})).unwrap(); + s.select_tool("shapeBuilder", v).unwrap(); + s.execute("paint.setFill", &pick).unwrap(); + let picked = s.paint.fill.clone(); + s.pointer(&PointerEvent::new(PointerKind::Down, 25.0, 50.0), v).unwrap(); + s.pointer(&PointerEvent::new(PointerKind::Drag, 75.0, 50.0), v).unwrap(); + s.pointer(&PointerEvent::new(PointerKind::Drag, 125.0, 50.0), v).unwrap(); + s.pointer(&PointerEvent::new(PointerKind::Up, 125.0, 50.0), v).unwrap(); + let (cmd, params) = s.journal.last().unwrap().clone(); + assert_eq!((cmd.as_str(), ¶ms["pickColorFrom"]), ("shapeBuilder.merge", &json!("swatches")), "{pick}"); + let d = &s.doc().unwrap().doc; + let fills: Vec = d.children(d.default_layer()).into_iter().flatten().map(|n| n.appearance.fill_paint()).collect(); + assert_eq!(fills, vec![picked], "{pick}: the two squares merged into one shape with the picked fill"); + } +} + /// With Pick Color From Color Swatches, a merge fills with the fill chosen while the Shape Builder /// is active, and the Gradient panel's eyedropper samples into a stop of that fill's gradient. #[test] diff --git a/crates/engine/src/tests/toolsettings.rs b/crates/engine/src/tests/toolsettings.rs index 7a28a84ec7..76fda42a5b 100644 --- a/crates/engine/src/tests/toolsettings.rs +++ b/crates/engine/src/tests/toolsettings.rs @@ -698,3 +698,28 @@ fn a_parametric_shape_kind_and_its_values_set_together() { assert_eq!(s.tool_options_of("parametricShape")["kind"], json!("star"), "a refused call sets nothing"); } } + +/// The Shape Builder picks colors from the color swatches by default: a fresh session, and saved +/// preferences that hold other Shape Builder options but no `pickColorFrom`, give `swatches`. A +/// saved `artwork` (or `swatches`) is kept. +#[test] +fn shape_builder_pick_color_from_defaults_to_swatches_and_keeps_a_saved_choice() { + let mut s = session(); + select(&mut s, "shapeBuilder"); + assert_eq!(s.tool_options()["pickColorFrom"], json!("swatches"), "a fresh session"); + for (saved, want) in [ + (json!({"highlightFill": false}), "swatches"), + (json!({"pickColorFrom": "artwork"}), "artwork"), + (json!({"pickColorFrom": "swatches"}), "swatches"), + ] { + let mut prefs = s.prefs.clone(); + prefs.tool_settings.insert("shapeBuilder".into(), saved.as_object().unwrap().clone()); + let saved_text = serde_json::to_string(&prefs).unwrap(); + let mut next = session(); + next.apply_prefs(serde_json::from_str(&saved_text).unwrap()); + select(&mut next, "shapeBuilder"); + assert_eq!(next.tool_options()["pickColorFrom"], json!(want), "saved {saved}"); + select(&mut next, "selection"); + assert_eq!(next.prefs.tool_settings["shapeBuilder"]["pickColorFrom"], json!(want), "stored again: {saved}"); + } +} diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 9730bd7853..b6f0866d96 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1192,7 +1192,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "tool.options", "Tool Options…", "", - "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), curvatureCircle → Curvature Circle Tool Options (dialog `curvatureCircleOptions`, fields snapTolerance (screen points, 1–40; 5), snapWithoutGuides, annotateRadius, standardAnchors and constantRadius (all on); OK runs tool.setOption {tool: \"curvatureCircle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (artwork), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), fillArea → the same Shape Builder Tool Options (Fill Area uses their gapDetection, gapLength and openFilledAsClosed), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", + "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), curvatureCircle → Curvature Circle Tool Options (dialog `curvatureCircleOptions`, fields snapTolerance (screen points, 1–40; 5), snapWithoutGuides, annotateRadius, standardAnchors and constantRadius (all on); OK runs tool.setOption {tool: \"curvatureCircle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (swatches; a saved artwork is kept), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), fillArea → the same Shape Builder Tool Options (Fill Area uses their gapDetection, gapLength and openFilledAsClosed), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", ), ( "ui.colorGuideOptions", diff --git a/crates/tools/src/builder.rs b/crates/tools/src/builder.rs index cdc7f6f7dc..42886ec013 100644 --- a/crates/tools/src/builder.rs +++ b/crates/tools/src/builder.rs @@ -66,11 +66,11 @@ pub struct ShapeBuilderOptions { /// region as if an invisible edge closed it. When it is off, the path cuts the regions it crosses /// as a line does. pub open_filled_as_closed: bool, - /// Pick Color From Color Swatches (`pickColorFrom: "swatches"`; off: `"artwork"`): a merge + /// Pick Color From Color Swatches (`pickColorFrom: "swatches"`, on; off: `"artwork"`): a merge /// fills the new shape with the current fill, and the Left and Right arrow keys step the current /// fill through the document's color swatches. With Artwork, the shape takes the look of the /// object where the drag starts, else of the one where it ends, else of the front-most selected - /// object. + /// object. A saved `pickColorFrom` is kept; preferences without one take Color Swatches. pub swatches: bool, /// Cursor Swatch Preview (`cursorSwatchPreview`, off): with Color Swatches, the current fill /// and the swatches before and after it show as chips above the pointer while no drag is on. @@ -105,7 +105,7 @@ impl Default for ShapeBuilderOptions { fn default() -> Self { Self { open_filled_as_closed: true, - swatches: false, + swatches: true, cursor_swatch_preview: false, straight_line: false, highlight_fill: true, diff --git a/crates/ui-egui/src/dialogs/option_form.rs b/crates/ui-egui/src/dialogs/option_form.rs index fde3f40932..7b1bf40418 100644 --- a/crates/ui-egui/src/dialogs/option_form.rs +++ b/crates/ui-egui/src/dialogs/option_form.rs @@ -631,7 +631,7 @@ pub(super) mod tests { tool: "shapeBuilder", opens_on: vec![ ("openFilledAsClosed", json!(true)), - ("pickColorFrom", json!("artwork")), + ("pickColorFrom", json!("swatches")), ("cursorSwatchPreview", json!(false)), ("selection", json!("freeform")), ("highlightFill", json!(true)), diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index f5e6908a8a..e76772d154 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -1193,7 +1193,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "tool.options", "Tool Options…", "", - "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), curvatureCircle → Curvature Circle Tool Options (dialog `curvatureCircleOptions`, fields snapTolerance (screen points, 1–40; 5), snapWithoutGuides, annotateRadius, standardAnchors and constantRadius (all on); OK runs tool.setOption {tool: \"curvatureCircle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (artwork), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), fillArea → the same Shape Builder Tool Options (Fill Area uses their gapDetection, gapLength and openFilledAsClosed), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", + "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), curvatureCircle → Curvature Circle Tool Options (dialog `curvatureCircleOptions`, fields snapTolerance (screen points, 1–40; 5), snapWithoutGuides, annotateRadius, standardAnchors and constantRadius (all on); OK runs tool.setOption {tool: \"curvatureCircle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (swatches; a saved artwork is kept), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), fillArea → the same Shape Builder Tool Options (Fill Area uses their gapDetection, gapLength and openFilledAsClosed), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", ), ( "ui.colorGuideOptions", diff --git a/docs/mcp.md b/docs/mcp.md index a9e9d9649a..5ec8ceafd4 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -15725,10 +15725,11 @@ a flare into a plain group of its parts. The document saves a flare's settings. The Shape Builder tool's options are its Shape Builder Tool Options (dialog `shapeBuilderOptions`): `openFilledAsClosed` (on: a filled open path bounds a region as if an invisible edge closed it; a path counts as filled when any of its fill rows is shown, painted and above 0% opacity, whichever row is on top; off: it cuts regions -as an unfilled path does), `pickColorFrom` (`artwork`, the default: a merged shape takes the appearance, opacity and -blending mode of the front-most selected object under the drag's first point, else of the one under its last point, -else of the front-most selected object; `swatches`: the current fill, and the Left and Right arrow keys without -Shift, Alt or Cmd/Ctrl step the current fill through the document's color swatches), `cursorSwatchPreview` (off; with `swatches`, chips above the +as an unfilled path does), `pickColorFrom` (`swatches`, the default: a merged shape fills with the current fill, and +the Left and Right arrow keys without Shift, Alt or Cmd/Ctrl step the current fill through the document's color +swatches; `artwork`: a merged shape takes the appearance, opacity and blending mode of the front-most selected object +under the drag's first point, else of the one under its last point, else of the front-most selected object; a +`pickColorFrom` saved with the preferences is kept, and preferences saved without one take `swatches`), `cursorSwatchPreview` (off; with `swatches`, chips above the pointer show the current fill and the swatches before and after it), `selection` (`freeform`, the default, or `straightLine`: a drag touches what the line from its first point to the pointer crosses), `highlightFill` (on by default; when it is off, merge mode shades no regions), `gapDetection` (off) with `gapLength` (pt, 0 to 72; 3), `clickStrokeSplitsPath` (In Merge Mode, From 45b0cb12f0e499d5df58e843ff7aa0772dd7a6e7 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 18:39:59 -0800 Subject: [PATCH 048/105] Docs: three-d.md matches what main ships Graphics map onto Inflate's puffed front and back (#7767), so the unbuilt list no longer names graphics on Inflate and the Graphics sentence names Inflate's faces. The 3D (Classic) effects export as meshes through Asset Export (#6168, #7852), so only Turntable stays named as unbuilt there. --- docs/three-d.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/three-d.md b/docs/three-d.md index a8f220bc59..d5bb4665a9 100644 --- a/docs/three-d.md +++ b/docs/three-d.md @@ -709,11 +709,11 @@ and [Create 3D objects](https://helpx.adobe.com/illustrator/desktop/special-effe pages, and the archived Extrude & Bevel option list (depth 0–2,000, cap on/off, bevel height, bevel extent in or out, perspective). No Adobe software, assets, presets or bevel shapes were used. -- **Materials** (base and Adobe Substance), graphics on Inflate, shadows of lights after the first, and +- **Materials** (base and Adobe Substance), shadows of lights after the first, and **ray-traced rendering** are not built: shading uses directional lights, in the paint of the fill or stroke the solid is built for ([Fills and strokes](#fills-and-strokes)), and only the first light casts a shadow ([Shadows](#shadows)). Graphics map onto planar faces, Extrude & Bevel's side as one surface unrolled flat, and - Revolve's side only ([Graphics](#graphics)). + Revolve's side and Inflate's puffed front and back only ([Graphics](#graphics)). - The bevel shapes and their names are our own. Custom bevels come from VectorCraft's own bevels file ([Custom bevels](#custom-bevels)) and are cut into straight lines. - Visibility is a painter's algorithm: faces of a closed solid turned away are left out, and the rest are drawn @@ -766,7 +766,7 @@ out, perspective). No Adobe software, assets, presets or bevel shapes were used. draws the shading over it as overprinting black, without the highlight. The shading is on the black plate in Separations Preview and PDF output. Their Rotation tab has the track cube ([Track cube](#track-cube)). Extrude & Bevel (Classic) and Revolve (Classic) take Map Art - ([Map Art](#map-art)). Turntable and 3D export are separate, unbuilt items. + ([Map Art](#map-art)). Turntable is a separate, unbuilt item. Release measurements and a repeatable CLI scene are in [3D lighting performance](3d-lighting-performance.md). From 4c24874e2e22fc7777aafc3b113eae3d90d679dc Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 18:40:13 -0800 Subject: [PATCH 049/105] Docs: type-parity.md matches what main ships MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CJK row lists custom kinsoku sets as done, through Type › Kinsoku Shori Settings… (#7229); custom mojikumi sets and the Mojikumi Settings dialog stay missing. The Retype row no longer lists the Properties panel's Quick Actions among the missing ways to open the Retype panel, since its Retype Quick Action does that (#8778). --- docs/type-parity.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/type-parity.md b/docs/type-parity.md index 1587d7f8f1..60b4a7117d 100644 --- a/docs/type-parity.md +++ b/docs/type-parity.md @@ -60,7 +60,7 @@ against Illustrator's public documentation; **estimated** unless noted. | Alt + numeric-keypad codes while typing (Windows: `Alt+0176` → °) | partial | #5108: on Windows the character Windows posts when Alt comes up after keypad digits is typed at the caret like any other, in the typing's undo step, and the keypad digits typed with Alt run no shortcut. With NumLock off the keypad keys (Insert, End, arrows, Clear, Home, Page Up/Down without the extended-key flag) count as digits too and don't move the caret (`windows_alt_codes` unit tests; neither NumLock on nor off has been tried on a Windows machine yet). `type.insert {code}` (Windows Alt+0 code, Windows-1252 for 128–159) and `{unicode}` (hex code point) insert a character by its code (`menucmds::insert_a_character_by_its_code`). macOS and Linux have no such system convention and egui reports a keypad digit as the top-row digit, so there it does nothing; a floating panel window doesn't receive the character | | Caret: the arrows and Delete step over whole clusters (Thai consonant with its marks, combining accents, emoji); Backspace removes one character | done | in text with right-to-left characters the arrows move in visual order and stop on both sides of a character drawn with no width, such as a zero width non-joiner | | Touch Type tool | done | moves, scales and rotates one character through its kerning, baseline shift, scales and rotation (`text.touchType`); a character with a preceding logical character on the same line can move along the line in either reading direction; the first logical character moves only up and down. Positive `dx` follows reading order. These direction rules are VectorCraft's choices. | -| Retype (identify fonts in outlines/images) | partial | Phase 1 (#4934): Type › Retype (`type.retype`) turns outlined glyphs back into type when each shape is exactly a glyph of a loaded font, a font the document uses or a family named in `fonts` (the same up to uniform scale, rotation and translation): one object per line unless lines stack into one object as described below, in that font and size, at the same baseline and turn, with the first glyph's fill and stroke, in one undo step; shapes that match no font stay as they are and are reported. Near matches: with `tolerance` (0 to 0.05), shapes of up to 8 contours whose leftover distance from a glyph, relative to the shape's outline spread (the root mean square distance of its sampled outline points from their center), is at most the tolerance (simplified outlines, curves split in two, contours in another order or direction) match too, and each line reports a `score`; a compound path holding several glyphs is split into them and becomes type only when all of them match, a part still matching exactly when some of its contours run the other way round (an o's counter alone in an even-odd compound). A line of three or more exactly matched glyphs keeps the spacing most of its gaps share as tracking (gaps one space wide stay word spaces when type draws them). A line of two glyphs that untracked type does not draw in place takes the tracking of the nearest tracked line in the same font, size and turn, and keeps it only when type at that tracking draws both glyphs in place; a line of one or two glyphs that joins tracked lines in one object takes their tracking. Other lines are set untracked, each glyph at its own position, and lines stacked at one leading and lined up at their starts, ends or centers become one area type object with that leading and alignment (VectorCraft's own rules, checked against the layout). Window › Retype shows the Retype panel, which lists the fonts whose glyphs exactly match at least one selected outlined shape, comparing up to 96 loaded fonts with those of the document's live type first, ranked by how many shapes each matches, with samples, and sets a listed font on selected live type (`retype.find`, `type.retypeFonts`). Both also compare the installed fonts not loaded yet, reading their files within VectorCraft's own limits (256 MiB per file, 2 GiB and 500,000 glyphs per search) and loading only the fonts that match; `type.retype` matches them with its tolerance and splits compound paths for them as it does for loaded fonts; in the app the search runs in the background with Cancel (`retype.cancelSearch`). Missing (phase 2): glyphs fused into one contour, near matches and compound paths of several glyphs in the panel's list, opening the panel from the Type menu, the context menu and the Properties panel's Quick Actions, filtering the list by font source and favorites, text in images. Public behaviour: [identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html), [apply to live text](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html) | +| Retype (identify fonts in outlines/images) | partial | Phase 1 (#4934): Type › Retype (`type.retype`) turns outlined glyphs back into type when each shape is exactly a glyph of a loaded font, a font the document uses or a family named in `fonts` (the same up to uniform scale, rotation and translation): one object per line unless lines stack into one object as described below, in that font and size, at the same baseline and turn, with the first glyph's fill and stroke, in one undo step; shapes that match no font stay as they are and are reported. Near matches: with `tolerance` (0 to 0.05), shapes of up to 8 contours whose leftover distance from a glyph, relative to the shape's outline spread (the root mean square distance of its sampled outline points from their center), is at most the tolerance (simplified outlines, curves split in two, contours in another order or direction) match too, and each line reports a `score`; a compound path holding several glyphs is split into them and becomes type only when all of them match, a part still matching exactly when some of its contours run the other way round (an o's counter alone in an even-odd compound). A line of three or more exactly matched glyphs keeps the spacing most of its gaps share as tracking (gaps one space wide stay word spaces when type draws them). A line of two glyphs that untracked type does not draw in place takes the tracking of the nearest tracked line in the same font, size and turn, and keeps it only when type at that tracking draws both glyphs in place; a line of one or two glyphs that joins tracked lines in one object takes their tracking. Other lines are set untracked, each glyph at its own position, and lines stacked at one leading and lined up at their starts, ends or centers become one area type object with that leading and alignment (VectorCraft's own rules, checked against the layout). Window › Retype shows the Retype panel, which lists the fonts whose glyphs exactly match at least one selected outlined shape, comparing up to 96 loaded fonts with those of the document's live type first, ranked by how many shapes each matches, with samples, and sets a listed font on selected live type (`retype.find`, `type.retypeFonts`). Both also compare the installed fonts not loaded yet, reading their files within VectorCraft's own limits (256 MiB per file, 2 GiB and 500,000 glyphs per search) and loading only the fonts that match; `type.retype` matches them with its tolerance and splits compound paths for them as it does for loaded fonts; in the app the search runs in the background with Cancel (`retype.cancelSearch`). Missing (phase 2): glyphs fused into one contour, near matches and compound paths of several glyphs in the panel's list, opening the panel from the Type menu and the context menu, filtering the list by font source and favorites, text in images. Public behaviour: [identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html), [apply to live text](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html) | | Snap to Glyph | done | View › Snap to Glyph (`view.snapToGlyph`): with Smart Guides on, new point type and drawing tools snap to live-text baselines and glyph bounds, the corners of each glyph's box included, turning with rotated type (#5112; `guides::tests::a_drawn_point_lands_on_a_corner_of_a_glyphs_bounds`, `Targets::for_drawing`, `tools::text_tests::snap_to_glyph_lines_up_new_point_type_with_a_baseline`). With Alignment Guides on as well, and Snap to Grid and Snap to Pixel off, both ends of a Measure or Measure & Inspect drag snap to those guides and show them during the drag (`Targets::for_measure`, `xform::measure::tests::its_ends_land_on_glyph_guides_with_snap_to_glyph`). That the Measure tools take the guides is VectorCraft's choice; they leave out Anchor Point, which [the help page](https://helpx.adobe.com/illustrator/desktop/design-with-text/special-characters-glyphs/snap-to-glyph.html) limits to the Pen tool and objects moved with the Selection tool. Character panel menu › Show Snap to Glyph Options: Baseline, x-height, Glyph Bounds, Proximity Guides, Angular Guides and Anchor Point each turn their guides on or off (`view.snapToGlyph.options`, all on by default; #4232), after a Snap to Glyph checkbox for View › Snap to Glyph; showing them scrolls the panel to them (#5273) | | Thai, Lao, Khmer, Myanmar: shaping (marks, reordering), lines broken between words, word-by-word caret and double-click | done | words found by ICU4X's line segmenter: dictionaries on the desktop, LSTM models on the web | | Middle Eastern: bidirectional layout, Paragraph Direction | done | PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import still needs ActualText support (#6165); separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. | @@ -70,7 +70,7 @@ against Illustrator's public documentation; **estimated** unless noted. | Middle Eastern & South Asian composers and Standard composers (Paragraph panel menu, paragraph styles, `text.setFormat {composer}`) | done / partial | #4935: per paragraph, four choices. Middle Eastern & South Asian Single-line and Every-line are how all type was already set (complex-script shaping on) and stay the default, so existing documents do not change. Standard Single-line and Every-line break lines the same way and set Indic, Arabic and Hebrew type glyph by glyph as the font maps its characters (no conjuncts, reordering, mark placement or joining), for legacy fonts that keep a script on Latin character codes. Indic, Arabic and the other joining scripts and Hebrew are the scripts left unshaped (their letters do not join, so Insert Kashidas adds no tatweel); Latin, Greek, Cyrillic, CJK, Thai and the rest keep their kerning and ligatures. The native file and paragraph styles keep the choice (`standardSingleLine` / `standardEveryLine`; an older VectorCraft cannot read a file that uses them). `.ai`, EPS and PDF import and export carry no composer: this app has no recorded format for it, so a Standard paragraph opened from or saved to those files comes back Middle Eastern & South Asian. Evidence: `tests::composers`, `tests::panelcmds::text_set_format_takes_the_four_composers`, `native_v3::all_four_composers_round_trip` | | Middle Eastern: split caret | missing | Character Direction is done; editable bidirectional SVG text remains incomplete. | | CJK: input methods (marked text, candidate window) | done | | -| CJK: kinsoku (Hard, Soft, None), the predefined mojikumi sets (None, YakumonoHankaku, GyomatsuYakumonoHankaku, GyomatsuYakumonoZenkaku, YakumonoZenkaku, with VectorCraft's own spacing for each) and Line-end Punctuation Half Width, tate-chu-yoko (auto) | done / partial | custom kinsoku sets, custom mojikumi sets and the Mojikumi Settings dialog missing | +| CJK: kinsoku (Hard, Soft, None), the predefined mojikumi sets (None, YakumonoHankaku, GyomatsuYakumonoHankaku, GyomatsuYakumonoZenkaku, YakumonoZenkaku, with VectorCraft's own spacing for each) and Line-end Punctuation Half Width, tate-chu-yoko (auto) | done / partial | custom kinsoku sets done (Type › Kinsoku Shori Settings…, #7229); custom mojikumi sets and the Mojikumi Settings dialog missing | | CJK: Kinsoku Shori Type (Push In First, Push Out First, Push Out Only) | done | Paragraph panel menu › Kinsoku Shori Type (`text.setFormat {kinsokuType}`), with the East Asian options ([Formatting Asian characters](https://helpx.adobe.com/illustrator/using/formatting-asian-characters.html)); Push Out Only is the default, and a push-in closes the line's gaps next to CJK characters by at most a tenth of an em each (VectorCraft's own limit). Evidence: `layout::wrapping_tests::kinsoku_shori_type_pushes_a_closing_bracket_in_or_out`, `tests::vertical::kinsoku_shori_type_pushes_a_closing_bracket_in_or_out`, `typecmd::area_tests::kinsoku_shori_type_is_set_per_paragraph_and_saved_only_when_not_push_out_only` | | CJK: Kurikaeshi Moji Shori | done | Paragraph panel menu › Kurikaeshi Moji Shori (`text.setFormat {kurikaeshiMojiShori}`), with the East Asian options ([Format East Asian characters](https://helpx.adobe.com/illustrator/using/formatting-asian-characters.html)): a repeat mark (々, ゝ, ゞ, ヽ, ヾ) that starts a line of point or area type is drawn as the character it repeats, and the text keeps the mark; SVG export with live type writes the drawn character. The set of marks and the voicing rules are VectorCraft's own. Off by default, saved natively only when on, carried by paragraph styles. Evidence: `tests::repeat_marks_stand_for_the_character_before_them`, `tests::kurikaeshi_moji_shori_draws_the_repeated_character_at_a_line_start`, `typecmd::area_tests::kurikaeshi_moji_shori_is_set_per_paragraph_and_saved_only_when_on`, `threads::tests::a_continued_frame_carries_the_character_a_repeat_mark_stands_for`, `panels::paragraph::tests::kurikaeshi_moji_shori_toggle_follows_the_selected_paragraphs`, `text_layout::a_repeat_mark_at_a_line_start_is_written_as_the_character_it_draws` | | CJK: Proportional Metrics (`palt` in horizontal type, `vpal` in vertical type) | done | #966 | From 848d8881b25195f85e88587f6ee74a1672863e4a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 18:40:28 -0800 Subject: [PATCH 050/105] Docs: file-format-parity.md matches what main ships The PDF embedded-font paragraph now records that full workspace CI passed on #4569 before it merged; hardening paths outside those suites stay pending. The read-only Save summary now records that the focused engine regressions from #6671 passed; native panel acceptance stays pending. --- docs/file-format-parity.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index a22db526d1..6287e13f47 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -43,7 +43,7 @@ Paragraph reconstruction binds the source lines' validated carried faces before checking wrapping. The native-reopen regressions compare conflicting-glyph positions and wrapped paragraph ink bounds with outline imports, including filled-and-stroked `TJ` text. The focused engine PDF-fidelity, PDF file-font/stroked-text and text binding/shared-outline suites passed -56 tests on the canonical-main integration candidate. Full workspace CI and hardening paths +56 tests on the canonical-main integration candidate, and full workspace CI passed on #4569 before it merged. Hardening paths outside those suites remain pending. Existing PDF respacing and composite-font regressions remain; no parity score or estimate changes. @@ -55,7 +55,7 @@ from the public specifications, and users' own `.ai` files are used locally only ## Summary -Ordinary File > Save offers Save As when its own location refuses writes with a terminal permission/read-only error (#6146). The picker suggests the original filename and format, keeps the original options when the format is unchanged, and opens the chosen format’s Save options when it changes. It starts in Documents (home or host default if unavailable). Cancel leaves the document modified at its original path. Explicit Save As/Copy/export, recovery failures and Close/Quit keep their existing error dialog. Non-UI saves return `READ_ONLY_LOCATION: ` without opening a panel. Focused UI regressions passed; engine regression execution and native panel acceptance pending; format scores unchanged. +Ordinary File > Save offers Save As when its own location refuses writes with a terminal permission/read-only error (#6146). The picker suggests the original filename and format, keeps the original options when the format is unchanged, and opens the chosen format’s Save options when it changes. It starts in Documents (home or host default if unavailable). Cancel leaves the document modified at its original path. Explicit Save As/Copy/export, recovery failures and Close/Quit keep their existing error dialog. Non-UI saves return `READ_ONLY_LOCATION: ` without opening a panel. Focused UI and engine regressions passed (#6671); native panel acceptance pending; format scores unchanged. | | Illustrator | VectorCraft | Notes | |---|---:|---:|---| From d4ba715061fe09f920606714bf7b655f3a4e6695 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 18:40:34 -0800 Subject: [PATCH 051/105] Docs: effects-parity.md matches what main ships - 3D and Materials: the summary row counts Revolve (Classic) and Rotate (Classic) beside Extrude & Bevel (Classic) (#6174, #6817, #6826). - Path: Use Preview Bounds measures type with Outline Object by its glyph outlines in Align, Distribute and the Transform panel (#2595). - Stylize: Scribble Options has its Settings presets (#4274). - Warp: the Mesh tool and Direct Selection edit a warp envelope's points (#7064). --- docs/effects-parity.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/effects-parity.md b/docs/effects-parity.md index bdf38e3fe6..2e4ef4dd15 100644 --- a/docs/effects-parity.md +++ b/docs/effects-parity.md @@ -13,7 +13,7 @@ Part of [target-app-parity.md](target-app-parity.md); open work is in [gaps.md]( |---|---:|---:|---:|---:| | Illustrator effects (vector and stylize) | 50 | 50 | 100% | — | | Photoshop effects (raster, Effect Gallery) | 57 | 57 | 100% | — | -| 3D and Materials | 4 (+3 Classic) | 4 (+1 Classic; initial: Extrude & Bevel, Revolve, Inflate, Rotate, Extrude & Bevel (Classic)) | ~25% | 25–45 | +| 3D and Materials | 4 (+3 Classic) | 4 (+3 Classic; initial: Extrude & Bevel, Revolve, Inflate, Rotate, Extrude & Bevel (Classic), Revolve (Classic), Rotate (Classic)) | ~25% | 25–45 | | Beyond Illustrator: Effect › Color Adjustments (6), effect plug-ins (WebAssembly) | — | 6 + plug-ins | — | — | ## Illustrator effects @@ -23,12 +23,12 @@ Part of [target-app-parity.md](target-app-parity.md); open work is in [gaps.md]( | Convert to Shape | Rectangle, Rounded Rectangle, Ellipse | 3/3 | — | | Crop Marks | Crop Marks | 1/1 | — | | Distort & Transform | Free Distort, Pucker & Bloat, Roughen, Transform, Tweak, Twist, Zig Zag | 7/7 | Free Distort's dialog has a handle on each corner of the object's bounds, moved by dragging or with the arrow keys; Zig Zag's ridges are evenly spaced along each segment (#1558), and Smooth points make a continuous wave whose peaks and valleys have handles along the path (#2343); Roughen with Smooth keeps turn-backs smooth instead of cusps that draw as spikes (#1646); Expand Appearance of a path whose Transform effect makes copies gives a group of one object per copy, each painted as the path, and a second Transform effect's copies nest in a group per copy of the first (#5612); drawn, each copy of a path with a fill and a stroke (or several, an even-odd fill or a partly transparent one) paints below the one before, the fills above covering the strokes of the copies below, instead of one path of every copy (#5920), and a group's copies each hold all its members except guides, the original group on top (#6316); a clipping group, a group with a fill or stroke of its own, a group whose type is kept as type, and a group with a member that carries a geometry, Pathfinder or 3D effect copy each member in its place; Twist's handles follow the rotation's derivative, so a strongly twisted path is a smooth spiral without kinks where its pieces join (#7069, `twist_joins_its_pieces_smoothly`). | -| Path | Offset Path, Outline Object, Outline Stroke | 3/3 | With Use Preview Bounds on, Align, Distribute and the Transform panel still measure type that carries Outline Object by its layout box (preview bounds leave out effects) | +| Path | Offset Path, Outline Object, Outline Stroke | 3/3 | — | | Pathfinder | Add, Intersect, Exclude, Subtract, Minus Back, Divide, Trim, Merge, Crop, Outline, Hard Mix, Soft Mix, Trap | 13/13 | Trap traps only solid fills (gradients and patterns hide what is below them but don't trap) and spreads each colour's visible area as a whole; the public page gives no default values, so Trap's 0.25 pt, 100% and 40% are VectorCraft's own; each of the other Pathfinder effects keeps its own Precision, Remove Redundant Points and Divide and Outline Will Remove Unpainted Artwork, taken from Pathfinder Options when applied and edited in Pathfinder Options opened from its Appearance panel row ([Pathfinder effects](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/combine-objects-using-pathfinder-effects.html)) | | Rasterize | Rasterize… (as a live effect) | 1/1 | — | -| Stylize | Drop Shadow, Feather, Inner Glow, Outer Glow, Round Corners, Scribble | 6/6 | Scribble Options' Settings presets | +| Stylize | Drop Shadow, Feather, Inner Glow, Outer Glow, Round Corners, Scribble | 6/6 | — | | SVG Filters | Apply SVG Filter… and the filter list | 1/1 | The submenu lists 14 default filters and then the document's own; the public page names no default set, so the set, names and values are VectorCraft's own, and a default is copied into the document when it is applied or edited. A filter that is the object's last effect is written to SVG as a `` element; otherwise SVG export draws the object as an image. A filter on a turned, skewed or unevenly scaled object in an imported SVG is kept and runs in that object's user space, and SVG export writes it back under the same transform. A blur or drop shadow that blurs more in one direction than another in the document (two different standard deviations, or one in a skewed or unevenly scaled user space) is kept as this effect rather than opened as an even Gaussian Blur or Drop Shadow | -| Warp | Arc, Arc Lower, Arc Upper, Arch, Bulge, Shell Lower, Shell Upper, Flag, Wave, Fish, Rise, Fisheye, Inflate, Squeeze, Twist | 15/15 | warp point editing in envelopes; each style bends the bounds as one Bézier patch (`version` 1), so Arc's edges are cubic curves close to concentric arcs; warps saved without a version keep the earlier map, where Arc is a circular arc in the object's own proportions (#1578) | +| Warp | Arc, Arc Lower, Arc Upper, Arch, Bulge, Shell Lower, Shell Upper, Flag, Wave, Fish, Rise, Fisheye, Inflate, Squeeze, Twist | 15/15 | each style bends the bounds as one Bézier patch (`version` 1), so Arc's edges are cubic curves close to concentric arcs; warps saved without a version keep the earlier map, where Arc is a circular arc in the object's own proportions (#1578) | Document Raster Effects Settings exists. When the 64 million pixel cap on an effect image lowers its resolution, PDF export warns once per object with the requested and the lowest achieved ppi From 51f49815a4ff5dd4d5febd97f6214898e99a55b3 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 18:40:37 -0800 Subject: [PATCH 052/105] Docs: hardware-parity.md matches what main ships - Summary: Windows reads the pen's tilt and barrel rotation with Windows Ink (#372). - Pen tilt row: Bristle brushes follow the recorded pen pose (#8490). - Touch gestures row: the Touch workspace ships (#3139); touch-screen rotation is still missing. - Multiple monitors row: floating panels (#4135) and floating document windows (#5278) are OS windows, and a floating panel reopens on the monitor where it was left (#6038); Wayland remains. - 3D GPU rendering row: 3D and Materials ship (#1453) and draw on the CPU, shaded or wireframe, with no ray tracing. No status line, revision-history row or score changes. --- docs/hardware-parity.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/hardware-parity.md b/docs/hardware-parity.md index 0c3a73b8cc..2f77e494bb 100644 --- a/docs/hardware-parity.md +++ b/docs/hardware-parity.md @@ -13,7 +13,7 @@ documentation (GPU Performance, touch workspace, pen pressure pages); ours from the GPU only to composite, so any GPU that can show a window works, at the cost of GPU-accelerated preview on huge documents. VectorCraft reads pen pressure on Windows, on the web, on macOS, and on Linux under X11 and XWayland, and it reads the pen's eraser end on Windows, on macOS, on Linux under X11 and XWayland, and on the web when it presses. -It reads the pen's tilt and barrel rotation on macOS and on Linux under X11 and XWayland. +It reads the pen's tilt and barrel rotation on Windows with Windows Ink (#372), on macOS and on Linux under X11 and XWayland. | Feature | Illustrator | VectorCraft macOS | Windows | Linux | Web | Status / hours | |---|---|---|---|---|---|---| @@ -22,14 +22,14 @@ It reads the pen's tilt and barrel rotation on macOS and on Linux under X11 and | Hybrid-graphics GPU choice | automatic | power-saving GPU by default, Preferences › Graphics Processor | same; DX12 then OpenGL; no Vulkan unless asked (#545, #806) | the desktop's GPU | browser | done | | Restart on another GPU when the first fails to present | — | yes (#502, #964) | yes | yes | restart on lost device (#369) | done | | Pen pressure | yes (Wacom, Windows Ink, macOS tablet events) | yes, read from AppKit's tablet events before the window gets them (winit reports none), each move of a stroke with its own pressure, mouse event coalescing off (#852; not yet tried on a Mac) | yes (pointer force via `WM_POINTER`) | under X11 and XWayland (Preferences › Performance › Linux Display Server, #1151, #2028; Automatic uses XWayland when a pen is attached on a Wayland session, #4967), read from XInput2 raw events (#764); **no** on native Wayland, where winit reports none and the pen may not reach the window (#491) | browser pointer events, with coalesced events; Apple Pencil on iPad (hover, palm rejection: fingers navigate after a pen contact until reload) | partial: 2–4 h for Wayland (winit 0.31), plus a check on a Mac | -| Pen tilt, bearing, barrel rotation (6D Art Pen) | yes, drives brushes | read from AppKit's tablet events (tilt, and the barrel rotation of a pen that reports one); Calligraphic and Scatter brushes vary with them (#764; not yet tried on a Mac) | with Windows Ink, read from the pen's `POINTER_PEN_INFO` (tilt and barrel rotation where its pen mask says the pen reports them); Calligraphic and Scatter brushes vary with them (#372; not yet tried with a pen) | under X11 and XWayland, read from XInput2 raw events; Calligraphic and Scatter brushes vary with them (#764); **no** on native Wayland | no | partial: native Wayland and the web read none, and Bristle brushes do not use them (an Art brush's Width and a Pattern brush's Scale follow them); 3–6 h (#372) | +| Pen tilt, bearing, barrel rotation (6D Art Pen) | yes, drives brushes | read from AppKit's tablet events (tilt, and the barrel rotation of a pen that reports one); Calligraphic and Scatter brushes vary with them (#764; not yet tried on a Mac) | with Windows Ink, read from the pen's `POINTER_PEN_INFO` (tilt and barrel rotation where its pen mask says the pen reports them); Calligraphic and Scatter brushes vary with them (#372; not yet tried with a pen) | under X11 and XWayland, read from XInput2 raw events; Calligraphic and Scatter brushes vary with them (#764); **no** on native Wayland | no | partial: native Wayland and the web read none (an Art brush's Width, a Pattern brush's Scale and Bristle brushes follow them, #8490); 3–6 h (#372) | | Pen eraser end | yes | the eraser end (AppKit's tablet proximity events) selects the Eraser tool and the tip brings back the tool used before, as on Linux (#852; not yet tried on a Mac) | with Windows Ink, an inverted pen or its eraser button (`PEN_FLAG_INVERTED`, `PEN_FLAG_ERASER` in the pen's pointer messages) selects the Eraser tool and the tip brings back the tool used before, as on Linux (not yet tried with a pen) | under X11 and XWayland, the eraser end selects the Eraser tool and the tip brings back the tool used before (#764); **no** on native Wayland | a press of the eraser end (Pointer Events eraser button, `button` 5) selects the Eraser tool, and that press erases; a press of the tip brings back the tool used before; Pointer Events report no end while the pen hovers | partial | -| Touch gestures (pinch zoom, two-finger pan, rotate view, Touch workspace) | yes (Windows touch, Surface) | trackpad pinch, scroll and rotate | pinch, pan (a second finger cancels the first finger's tool press, #4198); two-finger tap undo, three-finger redo (#585); in the Touch workspace a two-finger tap switches between the Selection tool and the last drawing tool | same where winit reports touch | eframe until the first pen contact, then Pointer Events (pen and fingers told apart); long press opens the context menu | partial: touch workspace and touch-screen rotation missing, 3–5 h | +| Touch gestures (pinch zoom, two-finger pan, rotate view, Touch workspace) | yes (Windows touch, Surface) | trackpad pinch, scroll and rotate | pinch, pan (a second finger cancels the first finger's tool press, #4198); two-finger tap undo, three-finger redo (#585); in the Touch workspace a two-finger tap switches between the Selection tool and the last drawing tool | same where winit reports touch | eframe until the first pen contact, then Pointer Events (pen and fingers told apart); long press opens the context menu | partial: touch-screen rotation missing (the Touch workspace ships, #3139), 3–5 h | | Trackpad (smooth scroll, pinch) | yes | yes | precision touchpads | yes | yes | done | | HiDPI / Retina, per-monitor scale | yes | yes | yes | yes | yes | done; a window dragged between monitors of different scale can still grow on Windows (#1459, open); the custom title bar's window on Windows stays truly borderless so the pointer lines up with what is drawn (#1791, #1758; awaiting the reporter's confirmation) ; macOS cursors use aligned 1×/2× native image representations (#2292), covered by headless construction tests; mixed-display transitions and physical cursor sizing remain unverified, no additional hardware validated | -| Multiple monitors: panels and document windows on another screen | yes | no (one OS window) | no | no | — | missing: 6–10 h (with multiple windows, gap G7) | +| Multiple monitors: panels and document windows on another screen | yes | yes: floating panels (#4135) and floating document windows (#5278) are OS windows, and a floating panel reopens on the monitor where it was left (#6038) | yes | under X11; on Wayland they are windows inside the main window | — | partial: Wayland remains, 6–10 h (with multiple windows, gap G7) | | Display colour profile (proof and display through the monitor's ICC) | yes | yes: the window is tagged sRGB and macOS converts it | yes: the display's default ICC profile, Windows' own conversion with Advanced Color on | X11: colord or `_ICC_PROFILE`; Wayland: sRGB | — | done on macOS, Windows and X11; Wayland and floating document windows remain | -| 3D GPU rendering (Materials, ray tracing) | yes | — | — | — | — | blocked on 3D (gap G3) | +| 3D GPU rendering (Materials, ray tracing) | yes | — | — | — | — | missing: 3D and Materials draw on the CPU, shaded or wireframe, with no ray tracing (#1453; gap G3) | ## Revision history From 47d067bfca55c63bfc601c7fd28a559596da50e6 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 18:41:10 -0800 Subject: [PATCH 053/105] Docs: ui-parity.md matches what main ships The two duplicate Simplify rows are marked done: the slider opens at the Auto-Simplify level (#3750), and with part of a path direct-selected only the selected runs are simplified (#3814). The Actions panel row names New Action (#5270) and Action Options setting a function key that plays the action; editing actions remains. The dynamic symbols row adds gradient and pattern fills and strokes and the Transparency panel's opacity and blend for a picked part (#6308), and .ai editing data keeping dynamic symbols (#8747). --- docs/ui-parity.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 51af6698d5..d131053a67 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -243,8 +243,8 @@ tools, never checked side by side) isn't captured row by row. | Smooth (Object › Path › Smooth…: slider from minimum to maximum smoothing, Auto-Smooth) ([smooth slider](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/refine-path-segments-with-the-smooth-slider.html)) | done | #4115: the slider under the selection previews `object.path.smooth {level}`, Auto-Smooth picks level 50 and takes a shaky line to one smooth curve, direct-selected anchors smooth only their section, Enter or a click outside keeps one undo step and Escape restores; the smoothing rule beyond the two ends is VectorCraft's own (`tests/smooth_path.rs`, `smooth_slider_previews_auto_smooth_and_keeps_the_result`) | | Draw Inside in isolation mode: art drawn or pasted inside the isolated object takes isolation mode into its clip group, clickable and undimmed ([isolation mode](https://helpx.adobe.com/illustrator/desktop/manage-objects/select-objects/isolate-objects.html), [drawing modes](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/learn-drawing-basics/drawing-modes-overview.html)) | done | #3705; `drawing_inside_an_isolated_object_keeps_the_new_art_in_isolation_mode` | | Draw Inside marks the object it draws into: a dotted open rectangle round its corners, in its layer's colour, while the mode lasts, selected or not | done | #4319, `canvas::tests::draw_inside_marks_the_corners_of_its_object` ([drawing modes](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/learn-drawing-basics/drawing-modes-overview.html)) | -| Simplify (slider, auto, corner angle threshold) | partial | Tolerance, default-on Preview and original/new point counts (#1272); Corner Point Angle Threshold, Convert to Straight Lines and Show Original Path; the slider under the selection with Auto-Simplify and More Options, and the dialog's option to open it directly with its last settings; the slider opens at 1 pt rather than at the Auto-Simplify level, and simplifying only a Direct Selection part of a path remains missing | -| Simplify (slider, auto, corner angle threshold) | partial | Tolerance, default-on Preview and original/new point counts (#1272); Corner Point Angle Threshold, Convert to Straight Lines and Show Original Path; the slider under the selection with Auto-Simplify and More Options, opening at the Auto-Simplify level for the selection with that result previewed, and the dialog's option to open it directly with its last settings; simplifying only a Direct Selection part of a path remains missing | +| Simplify (slider, auto, corner angle threshold) | done | Tolerance, default-on Preview and original/new point counts (#1272); Corner Point Angle Threshold, Convert to Straight Lines and Show Original Path; the slider under the selection with Auto-Simplify and More Options, and the dialog's option to open it directly with its last settings; the slider opens at the Auto-Simplify level (#3750), and with part of a path direct-selected only the selected runs are simplified (#3814) | +| Simplify (slider, auto, corner angle threshold) | partial | Tolerance, default-on Preview and original/new point counts (#1272); Corner Point Angle Threshold, Convert to Straight Lines and Show Original Path; the slider under the selection with Auto-Simplify and More Options, opening at the Auto-Simplify level for the selection with that result previewed, and the dialog's option to open it directly with its last settings; with part of a path direct-selected, only the selected runs are simplified (#3814) | ## Direct Selection, anchors and handles @@ -500,7 +500,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po | Actions panel: ≡ › Action Options… renames the selected action and sets its function key and color ([Actions panel overview](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html)) | partial | `ui.action.options`; `panels/actions.rs` tests (part of #1629). Button Mode shows the color | | Actions panel: ≡ › Button Mode shows each action by name as a button in its Action Options color, without sets or steps; a click on a button plays the action, and choosing Button Mode again shows the list ([the help page](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html)) | done | `ui.action.buttonMode`, `ui.action.playAt`; `panels/actions.rs` tests. VectorCraft's own rules: every set's actions show in set order, an action without a color is an ordinary button, the mode is kept with the UI preferences, and it cannot be turned on while an action records | | Actions panel: ≡ › Playback Options… plays actions Accelerated, Step by Step or with a pause between steps ([Specify playback speed](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/specify-playback-speed.html)) | done | `ui.action.playbackOptions`; `panels/actions.rs` tests. The pause is a whole number of seconds from 1 to 60 (VectorCraft's own range); Batch… plays at full speed | -| Actions panel: a clicked action stays selected for Play Current Selection and Delete Selection | partial | #1853 (part of #1629); editing actions and action shortcuts remain | +| Actions panel: a clicked action stays selected for Play Current Selection and Delete Selection | partial | #1853 (part of #1629); editing actions remains; New Action (#5270) and Action Options set a function key that plays the action | | Actions panel: Create New Set (bottom bar, ≡ › New Set…) names a new set and Set Options… renames the current one; a click on a set's name makes it current and a recording goes into the current set ([helpx: Automation with actions](https://helpx.adobe.com/illustrator/using/automation-actions.html)); the current set is kept with the UI preferences, and with no set current a recording goes into the first set, which becomes current | partial | #3712; dragging actions between sets remains | | Actions panel: Create New Action (bottom bar, ≡ › New Action…) asks for the name, set, function key and color, and Record adds the action and records into it ([Create new actions](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/record-actions.html)) | partial | `ui.action.new`, `ui.action.play`; `panels/actions.rs` tests. A function key plays its action, even when a command has the same shortcut, and the command keeps it. Button Mode shows the color | | Actions panel: Delete Selection (bottom bar) deletes the selected set with its actions and keeps the other sets ([Actions panel overview](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html)) | partial | `ui.actionSet.delete`; `panels/actions.rs` tests. VectorCraft's own rules, which the overview does not cover: deleting a set asks first (a selected action is still deleted at once), Shift-click on a set's name selects a range of sets, ≡ › Delete does the same as the button, and Default Actions and the last set can be deleted. Undo does not restore a deleted set, and recorded commands cannot be selected or deleted | @@ -523,7 +523,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po | Brush libraries: Window › Brush Libraries (Art Ribbons, Ink and Wash, Calligraphic Nibs, Pressure Sensitive, Bristle Brushes, Pattern Borders, Decorative, Scatter Shapes, Stipple, Game Trails, Energy Beams, Dry Media, Tech Circuit, Engraving, Arrows, User Defined, Other Library…, Save Brushes…) and the Brushes panel's Brush Libraries Menu button and its menu's Open Brush Library / Save Brush Library…; a click on a library brush adds it to the document's Brushes (one undo step, it becomes the current brush, and selected paths take it in the same step), Shift/Cmd-clicks select for Add to Brushes, a brush dragged onto a path is added and applied to it and one dragged onto the Brushes panel is added; thumbnails render with the library's patterns and symbols | done | [public source](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/create-new-brush-libraries.html), [import brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/import-brushes-from-brush-libraries-or-other-files.html), [Brushes panel overview](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/brushes-panel-overview.html); `window.brushLibrary`, `window.brushLibrary.other`, `ui.saveBrushLibrary` (dialog `saveBrushLibrary`), `window.userBrushLibrary1`…`10`; `panels::tests_brush_libraries`; fifteen built-in libraries (original, generated in code) | | Brushes panel menu › Options of Selected Object…: changes the selected brushed paths' brush settings on those paths only, leaving the brush and its other strokes as they are; the brush type's options dialog opens without the Name row (and without an art brush's scale and direction options or a pattern brush's tiles), and OK sends only the values changed in it | done | [Modify brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/modify-brushes.html), [Brushes panel overview](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/brushes-panel-overview.html); `brush.objectOptions`, `ui.brushObjectOptions`; which fields a path can set is VectorCraft's own choice (calligraphic, scatter, art and pattern brushes; not bristle); `options_of_selected_object_*` tests in `crates/engine/src/tests/brushsym.rs` and `crates/ui-egui/src/dialogs/brush_options/tests.rs`, brush tests in `crates/brush/src/tests.rs` | | Symbols panel: New Symbol opens Symbol Options (Name) before making the symbol; Alt-click skips it | partial | #1560 (#1566); Registration 9-point grid in Symbol Options (`symbol.new` / `symbol.place`); Export Type (Graphic / Movie Clip) and Enable Guides for 9-Slice Scaling (scaled instances keep their corners; in symbol editing mode the guides are drawn over the art and the Selection tool drags them); Symbol Type (Dynamic Symbol / Static Symbol, new symbols dynamic; #4938); Align to Pixel Grid (`alignToPixelGrid` on `symbol.new` / `symbol.options`: the art snaps at the symbol's natural size and instances at that size stay on whole points; [Aligning symbols to pixel grid](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=28)) | -| Dynamic symbols: an instance changes the fill, stroke, opacity and blend of objects in its symbol's art and stays linked; Reset in the Properties panel's Quick Actions and the Symbols panel menu (Reset Symbol Instance) | partial | #4938; `symbol.instance.setAppearance` (by child-index path) and `symbol.instance.reset`; redefining keeps the changes, Break Link bakes them; Direct Selection of a path, compound path or type object inside an instance, with the Fill/Stroke controls setting its solid fill or stroke, is on canvas; on-canvas editing beyond a solid fill and stroke, and `.ai` read and write, remain | +| Dynamic symbols: an instance changes the fill, stroke, opacity and blend of objects in its symbol's art and stays linked; Reset in the Properties panel's Quick Actions and the Symbols panel menu (Reset Symbol Instance) | partial | #4938; `symbol.instance.setAppearance` (by child-index path) and `symbol.instance.reset`; redefining keeps the changes, Break Link bakes them; Direct Selection of a path, compound path or type object inside an instance, with the Fill/Stroke controls setting its fill or stroke (solid, gradient or pattern) and the Transparency panel setting its opacity and blend, is on canvas (#6308); `.ai` editing data keeps dynamic symbols and their instance changes when VectorCraft writes and reads it (#8747); on-canvas editing beyond fill, stroke, opacity and blend, and reading other apps' dynamic symbol records, remain | | Pathfinder Trim, Merge and Crop remove strokes; Merge joins same-fill objects whatever their strokes | done | #1570 (#1572) | | Pathfinder panel on one group selected alone; a greyed-out button says what it needs | partial | #1450; the group's members are combined; one plain path selected alone stays disabled (the public documentation doesn't say what the operations do to a single path) | | Pathfinder Divide: an open cutting line splits a filled path | done | #1307; straight, crossed, bent and curved cutters, holes and frontmost appearance regression-tested; native automation: independent piece movement, one Undo/Redo, saved-document round trip and window capture; existing bounded-map fallback remains | From c8c434f4aac929074c514c87826c82ec0a5934a2 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 03:42:50 +0100 Subject: [PATCH 054/105] Compile macOS release architectures on separate standard runners --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 538d09cc31..ea3bf92583 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,6 +43,7 @@ jobs: app-name: vectorcraft app-title: VectorCraft macos-runner: macos-15 + macos-split-build: true craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83 web-craft-fonts: true version: ${{ inputs.version }} From 059946687aff86d62e1148059b6a2012065c0d24 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 18:44:10 -0800 Subject: [PATCH 055/105] Docs: target-app-parity.md matches what main ships Lines that listed shipped features as remaining now name the pull request that built them: Touch Type (#2469), the Dimension tool (#1788), the freehand Keep selected (#2246), Alt to the Smooth tool (#2685), Blob Brush Merge Only with Selection (#2367), Live Corners' Relative rounding (#3091), Global Edit of similar groups (#4983), Consolidate All Windows (#5216), Select All across threaded frames (#5542), the Bullets and Numbering dialog and list levels (#5037), Convert to Text (#4093), the spelling dialogs (#6341, #6425, #7744), Retype's installed-font search (#8823), Retype in Quick Actions (#8778) and Cursor Swatch Preview (#7265). The #1758 entry records the reporter's confirmation. Scores, status lines and revision-history rows are unchanged. --- docs/target-app-parity.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 395fdda4de..4df379b998 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -347,7 +347,7 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Area | Weight | Done | Main gaps | One agent (h) | Kind | |---|---:|---:|---|---:|---| | Selection, transform & align tools | 6 | 85% | Direct Selection segment click/Delete corrected (#1278); deletion splits an ordinary contour into selected sibling objects with bounds-fitted gradients kept in place (#3380, deletion only; `crates/engine/tests/it/delete_path_pieces.rs`); open-path anchor Delete keeps gaps; Select › Start Global Edit finds the paths, compound paths and symbol instances of the selected object's shape (Appearance, Size and artboard options) and gives an edit of one to all of them in proportion, as one undo step (#3521), and on a group the groups like it, an edit inside one reaching the same object in the others (#4939), and a Shift-click on a highlighted match leaves it out; the Align panel menu's Align to Glyph Bounds › Point Text and Area Text measure type by its glyphs' ink for Align and Distribute (#4231); remaining: Free Transform/Scale/Reflect along a rotated box, Global Edit of rotated copies, transform nuances (no-op anchor Align history regression-tested, #1180 follow-up) | 4–6 | estimated; fill-stack selection regression-tested (`crates/engine/tests/path_fill_hits.rs`, #6625); cap/join follow-up CPU regressions passed; Global Edit regression-tested (`crates/engine/src/tests/globaledit.rs`; Quick Action, menu label and Escape in `panels::properties::tests::start_global_edit_quick_action_and_escape`) | -| Drawing tools (Pen, Curvature, Pencil, shapes, Shaper) | 7 | 85% | Shaper construction widget, Pencil/Pen nuances, Blob Brush options, Touch Type, Dimension tool; see [ui-parity.md](ui-parity.md) | 8–13 | estimated; Curvature point display regression-tested (#1236, in part); Polygon/Star exact-size count persistence regression-covered; Live Corners' Relative rounding done (#3091), score unchanged; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123), score and hours unchanged; the Pen, Smart Pen and Curvature tool show the measurement readout with the rubber band off (#7043), score, gaps and hours unchanged; Scissors shares the Pen's path/align/intersect/anchor snaps (#6470), source and headless regressions below; Eraser preserves fill-only open-path area outside fixed and varied tip sweeps and Alt-drag marquees, including compound holes; clipping masks keep their remaining contours and empty-mask role; ordinary Group/Layer paints and evaluated gradient placements are preserved when the stored paint reproduces their appearance; replacement-art effects, plug-ins/Rasterize, along/across-stroke gradients and placements that cannot be reproduced keep their existing fitting; stroked open paths retain main behavior and result structure (#6582; `crates/engine/tests/eraser_open_fill.rs`), score and hours unchanged; Scissors cut-point preview covered in tool and Session regressions (#8655), scores and hours unchanged | +| Drawing tools (Pen, Curvature, Pencil, shapes, Shaper) | 7 | 85% | Shaper construction widget, Pencil/Pen nuances, Blob Brush options; Touch Type (#2469) and the Dimension tool (#1788) are done; see [ui-parity.md](ui-parity.md) | 8–13 | estimated; Curvature point display regression-tested (#1236, in part); Polygon/Star exact-size count persistence regression-covered; Live Corners' Relative rounding done (#3091), score unchanged; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123), score and hours unchanged; the Pen, Smart Pen and Curvature tool show the measurement readout with the rubber band off (#7043), score, gaps and hours unchanged; Scissors shares the Pen's path/align/intersect/anchor snaps (#6470), source and headless regressions below; Eraser preserves fill-only open-path area outside fixed and varied tip sweeps and Alt-drag marquees, including compound holes; clipping masks keep their remaining contours and empty-mask role; ordinary Group/Layer paints and evaluated gradient placements are preserved when the stored paint reproduces their appearance; replacement-art effects, plug-ins/Rasterize, along/across-stroke gradients and placements that cannot be reproduced keep their existing fitting; stroked open paths retain main behavior and result structure (#6582; `crates/engine/tests/eraser_open_fill.rs`), score and hours unchanged; Scissors cut-point preview covered in tool and Session regressions (#8655), scores and hours unchanged | | Path operations, Pathfinder, Shape Builder, Live Paint | 5 | 80% | Shape Builder on the reporter's file (#937: art past 4,096 segments is cut by lines again; unconfirmed on the file itself); gap detection shares Live Paint’s finder, with a 72 pt custom cap and the existing options; Live Paint Gap Options | 4–8 | estimated; Shape Builder Gap Detection shares Live Paint’s spatial gap finder and temporary merge bridges (#2526); Custom is capped at 72 pt in the existing options dialog (lowered from 86%: open issues); compound attributes regression-tested (#1197); single-result source names survive SVG export/import (#1293), with [SVG ID semantics](https://www.w3.org/TR/SVG2/struct.html#IDAttribute) and original-shape tests; Simplify component selection and preview regression-tested (#1272); Simplify of a Direct Selection part of a path regression-tested (`tests/simplify_part.rs`); Divide open-cutting-path geometry and appearance regression-tested (#1307); the Shape Builder's edge-source grid is bounded in memory and files a segment once per cell (`planar.rs` test `rect_index_holds_a_bounded_number_of_references`); live compound shapes (Make, Alt-click, member Shape Modes, Release, Expand, saved and exported) regression-tested (#4522); Live Paint Bucket face drags, including narrow faces and one Undo, regression-tested (#6373) | | Colour, swatches, gradients, patterns, mesh, recolor | 7 | 92% | Picker Lab entry, picker libraries and Assign-row menus complete the deferred #4028 UI paths (#8031); scores and estimates unchanged; Eyedropper copies effective character dimensions across text transforms (#6404); 30.0's gradient additions are done (dither, perceptual blending, presets); freeform gradients in SVG/PDF, mixed spot/process gradients in SVG, PDF gradients mixing a spot color with RGB or Lab stops, and dithered spot gradient fills and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, which PDF export writes as images in process colors| 4–7 | estimated; Recolor model selection is available through the engine and MCP (#2520), and the dialog's color sliders (HSB, RGB, CMYK, Lab, Tint for a spot color) edit the selected row's new color in its mode, and the Edit tab's Global Adjust sliders (Saturation, Brightness, Temperature, Luminosity, -100% to 100%) change every recolored color at once (lowered from 96%: target moved); unpainted zero-width stroke restoration fixed (#1253), score and hours unchanged; Eyedropper source reads regression-tested (#1251); screen-bounded Recolor Edit chip list (#3416), score and hours unchanged; a point on a gradient mesh's outline locates on its edge on every side (#7006: `mesh_locate_takes_a_point_on_any_side_of_the_outline`, `mesh_add_line_exactly_on_the_edge_needs_no_tolerance`), score and hours unchanged; Color panel spectrum grows with the resized panel (#8005); the Color Wheel panel's Show Opacity sets the opacity of the fill, stroke, gradient stop or freeform point it edits (part of #978), score and hours unchanged; gradient stop editor color-mode menu (#7918) | | Strokes, brushes, width profiles | 5 | 88% | Shift-double-click adjoining adjustment is implemented; brush libraries are done (fifteen generated libraries including Tech Circuit, Decorative, Engraving, Arrows, Stipple, Pressure Sensitive, Ink and Wash, Bristle Brushes, Game Trails, Energy Beams and Dry Media, User Defined, Other Library…, Save Brushes); Art brush Overlap and Pattern brush auto corners are done; remaining: pen pressure on macOS, Stylus Wheel, more built-in brush libraries, tilt, bearing and rotation on native Wayland and the web | 8–15 | estimated; width-point creation and adjoining adjustment regression-tested; dialog layout reviewed; evidence below; finite-arithmetic follow-up regressions and full CI passed (evidence below) | @@ -616,9 +616,9 @@ about 1–1.5 agent-hours each, so the other rows (estimated on the older scale) | Area | Weight | Done | Missing (main items) | One agent (h) | |---|---:|---:|---|---:| | Selection, transform & align tools | 6 | 85% | Free Transform/Scale/Reflect along a rotated box, Global Edit of similar groups, transform nuances (the rotated persistent bounding box is done) | 4–6 | -| Drawing tools | 7 | 85% | rough-square Shaper recognition and orientation steps corrected; editable Shaper Groups landed; remaining: Shaper construction widget/gesture refinements, pencil and the remaining pen modifier nuances, the freehand Tool Options' Keep selected, Alt to the Smooth tool, Blob Brush Merge Only with Selection, Touch Type, Live Corners' Relative rounding (Curvature point display improved, #1236 in part) | 8–13 | +| Drawing tools | 7 | 85% | rough-square Shaper recognition and orientation steps corrected; editable Shaper Groups landed; the freehand Tool Options' Keep selected (#2246), Alt to the Smooth tool (#2685), Blob Brush Merge Only with Selection (#2367), Touch Type (#2469) and Live Corners' Relative rounding (#3091) are done; remaining: Shaper construction widget/gesture refinements, pencil and the remaining pen modifier nuances (Curvature point display improved, #1236 in part) | 8–13 | | Selection, transform & align tools | 6 | 85% | Free Transform/Scale/Reflect along a rotated box, Global Edit of similar groups, transform nuances (the rotated persistent bounding box is done; no-op anchor Align history regression-tested, #1180 follow-up) | 4–6 | -| Selection, transform & align tools | 6 | 85% | Direct Selection segment click/Delete corrected (#1278); remaining: Free Transform/Scale/Reflect along a rotated box, Global Edit of similar groups, transform nuances (the rotated persistent bounding box is done) | 4–6 | +| Selection, transform & align tools | 6 | 85% | Direct Selection segment click/Delete corrected (#1278); remaining: Free Transform/Scale/Reflect along a rotated box, transform nuances (the rotated persistent bounding box and Global Edit of similar groups, #4983, are done) | 4–6 | | Drawing tools | 7 | 86% | Eraser preserves fill when cutting fill-only open paths with fixed or varied tips or Alt-drag marquees; painted-stroke paths retain main behavior and clipping masks keep their remaining contours or empty geometry, with reproducible evaluated gradient placement preserved on ordinary paths, compounds, groups and layers (#6582); replacement-art effects, plug-ins/Rasterize, along/across strokes and placements that cannot be reproduced retain fitting; rough-square Shaper recognition and orientation steps corrected; editable Shaper Groups landed; Pencil: Alt key toggles to Smooth Tool (#2001); remaining: Shaper construction widget/gesture refinements, pencil and the remaining pen modifier nuances, Blob Brush Merge Only with Selection, Touch Type, Live Corners' Relative rounding | 7–12 | | Path operations, Pathfinder, Shape Builder, Live Paint | 5 | 86% | Live Paint gap options, Shape Builder gap detection, options (Tool Options dialog, clicking a stroke in merge mode) and Shift-drag marquee | 3–6 | | Colour, swatches, gradients, patterns, mesh, recolor | 7 | 96% | Picker Lab entry, picker libraries and Assign-row menus complete the deferred #4028 UI paths (#8031); scores and estimates unchanged; Library panels' lists (swatch, Color Book, brush, symbol and graphic style libraries) fill a taller panel above its footer (#2992; scores and estimates unchanged); Swatches list fills a taller panel above its footer (#1638; `the_list_fills_a_tall_panel_above_its_footer`; scores and estimates unchanged); freeform gradients in SVG/PDF and mixed spot/process gradients in SVG (exported as stops; PDF export keeps the spot inks in a DeviceN shading, except next to RGB or Lab stops; dithered fills and Perceptual gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve are written as images in process colors), pattern fills in Expand | 2–4; Eyedropper source reads regression-tested (#1251) | @@ -640,8 +640,8 @@ about 1–1.5 agent-hours each, so the other rows (estimated on the older scale) | Export for Screens, Asset Export, slices, Save for Web | 3 | 85% | polish only (all four are done) | 2–4 | | Print, colour management, separations, flattener | 3 | 80% | Production Preflight available; print preview fidelity remains (flattener presets in PDF and print, overprint in PDF and composite print, Print dialog, presets, PostScript, marks, separations, Print Tiling, print overprint/flattener/bitmap options and printer profile are done, as are the Japanese papers in its Media list: JIS B4/B5/B6, はがき, 往復はがき, 封筒 長形3号/長形4号/角形2号/角形3号 and 四六判, beside the ISO B4/B5 that settings saved before them keep) | 1–2 | | Automation | 3 | 65% | scripting surface, batch (MCP drops malformed app replies without replay; Variables: text/visibility variables bound to objects, an object may carry several, dataset rows applied in one undo step, panel and Window › Variables with dialogs; image/graph kinds and dataset import/export open) | 6–10 | -| UI chrome (panels, contextual Properties, workspaces, prefs) | 6 | 80% | macOS native menu dismissal fixed (M14.8); Variables, Links, Asset Export, CSS Properties, Attributes, the canvas context menu and docking panels into any dock group by dragging (as tabs, a top/bottom split or icons) are done; remaining: Properties per context, Consolidate All Windows, floating panels outside the app window, context menus in the panels that have none, about 13 Preferences options stored but not yet acted on (#394: Open Documents As Tabs, Real-time Drawing, hyphenation language, devices…) | 13–20 | -| UI chrome (panels, contextual Properties, workspaces, prefs) | 6 | 80% | macOS native menu dismissal fixed (M14.8); Variables, Links, Asset Export, CSS Properties, Attributes, the canvas context menu and docking panels into any dock group by dragging (as tabs, a top/bottom split or icons) are done; remaining: Properties per context, Consolidate All Windows, floating panels outside the app window, context menus in the panels that have none, about 14 Preferences options stored but not yet acted on (#394: Highlight Alternate Glyphs, Open Documents As Tabs, Real-time Drawing, hyphenation language, devices…) | 13–20 | +| UI chrome (panels, contextual Properties, workspaces, prefs) | 6 | 80% | macOS native menu dismissal fixed (M14.8); Variables, Links, Asset Export, CSS Properties, Attributes, the canvas context menu, Consolidate All Windows (#5216) and docking panels into any dock group by dragging (as tabs, a top/bottom split or icons) are done; remaining: Properties per context, floating panels outside the app window, context menus in the panels that have none, about 13 Preferences options stored but not yet acted on (#394: Open Documents As Tabs, Real-time Drawing, hyphenation language, devices…) | 13–20 | +| UI chrome (panels, contextual Properties, workspaces, prefs) | 6 | 80% | macOS native menu dismissal fixed (M14.8); Variables, Links, Asset Export, CSS Properties, Attributes, the canvas context menu, Consolidate All Windows (#5216) and docking panels into any dock group by dragging (as tabs, a top/bottom split or icons) are done; remaining: Properties per context, floating panels outside the app window, context menus in the panels that have none, about 14 Preferences options stored but not yet acted on (#394: Highlight Alternate Glyphs, Open Documents As Tabs, Real-time Drawing, hyphenation language, devices…) | 13–20 | | Libraries, Links, Package | 2 | 82% | the Libraries panel is local only (no cloud by design: libraries are files on this machine) and has no shared libraries, linked graphics or gradients and patterns as items yet; its graphics, colours and text styles (#745), its search, groups and library export/import as `.vclibrary` files (#926), a list that scrolls, with items and groups reordered by dragging and items dragged into and out of groups, art and swatches dragged in added where they are dropped, and items shown as icons or in a list with their names, are done; Links and Package are done; placed VectorCraft documents are done (linked by default, vectors in every output, previews, Break Link, Expand, Edit Original, refresh on save) | 2–3 | | **Feature parity** | **103** | **~75%** | | **~210–330** | | Interaction-fidelity pass (side by side with Illustrator: every tool modifier, cursor, dialog, Properties context) | | | | 60–90 | @@ -1474,7 +1474,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - While Tab or Shift+Tab hides the panels, the Window menu checks no panel, and choosing a panel there, or pressing its function key, shows the dock with that panel in its earlier place instead of closing it; the toolbar and the Control bar stay as they are. In Presentation Mode no panel is checked, and `window.panel` fails and changes nothing. A tool double-click that opens the Gradient or Magic Wand panel and a Character field shortcut also show the hidden dock (`window_panel_from_tab_hidden_dock_reveals_named_front_tab`, `window_panel_from_shift_tab_hidden_floating_window_reveals_it`, `function_key_from_tab_hidden_dock_reveals_named_group`, `presentation_panel_command_reports_unavailable_without_mutating_layout`). - The function key shortcuts for Brushes, Color, Layers, Info, Gradient, Stroke, Attributes, Graphic Styles, Appearance, Align, Transform, Pathfinder, Transparency, and Symbols activate a background tab on the first press, hide its expanded dock or floating group when that tab is in front, and restore the group with all its tabs together on the next press; in an icon column they open and close the flyout while keeping the icons. A reassigned chord keeps that behavior, and Window > a hidden sibling restores the group. - On Windows and Linux, F2, F3 and F4 run Cut, Copy and Paste alongside Ctrl+X, Ctrl+C and Ctrl+V, and in the web build they do so everywhere except macOS. The Edit menu keeps the Ctrl shortcuts, and Keyboard Shortcuts lists both keys of each row. On macOS only Cmd+X, Cmd+C and Cmd+V are the defaults. F2, F3 and F4 do not run these commands in a focused text field or while the Type tool edits text. A saved shortcut set that assigns one of these keys to another command keeps that assignment. Public reference: [Default keyboard shortcuts](https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html). - - Cmd/Ctrl+A follows the keyboard: in a panel, dialog or search field it selects the field's text, while the Type tool edits it selects all of that text (also `select.all` over MCP), and only otherwise every object. On macOS the menu bar's Select All, Cut, Copy and Paste (keys or clicks) act on a focused field too, and elsewhere the in-window menus' do: the field that had the keyboard when the menu opened gets them, with its selection, and the keyboard back (#516). Not yet: Select All across threaded frames (one frame's text is selected). + - Cmd/Ctrl+A follows the keyboard: in a panel, dialog or search field it selects the field's text, while the Type tool edits it selects all of that text (also `select.all` over MCP), and only otherwise every object. On macOS the menu bar's Select All, Cut, Copy and Paste (keys or clicks) act on a focused field too, and elsewhere the in-window menus' do: the field that had the keyboard when the menu opened gets them, with its selection, and the keyboard back (#516). In a frame of threaded text, Select All selects the whole story (#5542). - Cmd/Ctrl+A follows the keyboard: in a panel, dialog or search field it selects the field's text, while the Type tool edits it selects all of that text (also `select.all` over MCP), and only otherwise every object. On macOS the menu bar's Select All, Cut, Copy and Paste (keys or clicks) act on a focused field too, and elsewhere the in-window menus' do: the field that had the keyboard when the menu opened gets them, with its selection, and the keyboard back (#516). In a frame of threaded text, Select All selects the whole story, highlighted in every frame: Copy and Cut take all of it, typing or Delete replaces it as one undo step, and a fill, a size step or a Character or Paragraph panel change applies to every frame's text (VectorCraft's own behavior; `textedit::select_all_in_a_threaded_frame_selects_the_whole_story`, `textedit::typing_over_the_whole_story_replaces_every_frames_text_in_one_step`). - With text selected in a panel's label, such as a Document Info value, Cmd/Ctrl+C and Cmd/Ctrl+X copy that text and do not copy or cut the art, and so do F3 and F2 where they are Copy and Cut, any other keys assigned to Copy or Cut, and the menu bar's Copy and Cut on macOS. When the selected label is not drawn (the panels are hidden), Copy and Cut act on the art instead (#8432; VectorCraft's own behavior; `selectall::copy_and_cut_copy_the_text_selected_in_a_panel_label`, `selectall::copy_sent_on_from_another_window_copies_the_text_only_when_it_is_this_windows`, `selectall::panel_text_copied_before_the_art_formats_are_written_stays_on_the_clipboard`, `shortcuts::tests::a_window_notes_only_its_labels_copies_until_the_next_main_window_pass`, `shortcuts::tests::a_window_notes_a_copy_of_text_dragged_across_its_label`). Not yet: the in-window Edit menu's Copy and Cut (the click on the menu clears the label's selection first), and, while the selected text is in a floating panel's own window, the menu bar's Copy and Cut, and F3 and F2 (they do not copy the text). - With the whole story of threaded text selected by Select All, Remove Line Breaks, Remove Paragraph Breaks and Type › Bullets and Numbering › Convert to Text act on the text of every frame as one undo step, locked and hidden frames included, and the story stays selected after Convert to Text; a selection inside one frame changes only that frame (VectorCraft's own behavior; `textedit::remove_breaks_takes_the_whole_story_that_select_all_selected`, `textedit::convert_to_text_takes_the_whole_story_that_select_all_selected`, `textedit::convert_to_text_of_the_whole_story_converts_locked_and_hidden_frames`, `textedit::remove_breaks_of_the_whole_story_takes_locked_and_hidden_frames`). @@ -1984,7 +1984,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur Paint-only Arabic harakat (marks whose character styles differ only in fill, stroke and related paint) stay inside one shaping cluster so letters keep their joining forms; when a second character-level shaping pass matches the monotone glyphs, a glyph may take a later in-cluster character's run only when GDEF classifies it as a mark (class 3) and that character is a harakat; otherwise it keeps the shaping cluster's first character. Insert Kashidas tatweels take the base letter's paint rather than a trailing mark's. Fonts without GDEF and some AAT/`morx` ligatures can leave a mark painted as its letter (`crates/text/src/tests/harakat.rs`). Character panel › Adjust Horizontal and Adjust Vertical Diacritic Position (with the Middle Eastern options; `text.setFormat` or `text.setRangeStyle {diacriticHorizontal, diacriticVertical}`, VectorCraft's own thousandths of an em from -1000 to 1000, 0 by default) move the selected characters' mark glyphs (GDEF class 3) right or left and up or down while the letters stay in place ([the reference, page 549](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=549)); an Arabic harakat or Hebrew point styled apart takes its own values, character styles carry both (Character Style Options › Advanced Character Formats edits them), the canvas and PDF draw the moved marks and SVG writes such type as outlines (`tests::harakat::diacritic_positions_move_marks_and_keep_letters`). The Paragraph panel's Bullets button, Type › Bullets and Numbering › Apply Bullets and the context menu's Apply Bullets (`text.setFormat {list, bullet}`, `type.applyBullets`) make paragraphs a bulleted list with the documented presets (none, filled dot, dash, hollow circle, filled square; [Create bulleted or numbered lists](https://web.archive.org/web/20260417034638/https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/create-bulleted-or-numbered-lists.html)): the bullet starts each paragraph's first line in its first character's font, size and color, the first line's text starts at the next tab stop after the bullet (the left indent counts as a stop), the lines it wraps to start at the left indent, a paragraph with no indents gets 18 pt and -18 pt, and Return continues the list; Reset Panel turns it off, and paragraph styles and the native file keep it. - The Paragraph panel's Bullets button, Type › Bullets and Numbering › Apply Bullets and the context menu's Apply Bullets (`text.setFormat {list, bullet}`, `type.applyBullets`) make paragraphs a bulleted list with the documented presets (none, filled dot, dash, hollow circle, filled square; [Create bulleted or numbered lists](https://web.archive.org/web/20260417034638/https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/create-bulleted-or-numbered-lists.html)): the bullet starts each paragraph's first line in its first character's font, size and color, the first line's text starts at the next tab stop after the bullet (the left indent counts as a stop), the lines it wraps to start at the left indent, a paragraph with no indents gets 18 pt and -18 pt, and Return continues the list; Reset Panel turns it off, and paragraph styles and the native file keep it. The Bullets and Numbering dialog, levels and Convert to Text are not built yet. + The Paragraph panel's Bullets button, Type › Bullets and Numbering › Apply Bullets and the context menu's Apply Bullets (`text.setFormat {list, bullet}`, `type.applyBullets`) make paragraphs a bulleted list with the documented presets (none, filled dot, dash, hollow circle, filled square; [Create bulleted or numbered lists](https://web.archive.org/web/20260417034638/https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/create-bulleted-or-numbered-lists.html)): the bullet starts each paragraph's first line in its first character's font, size and color, the first line's text starts at the next tab stop after the bullet (the left indent counts as a stop), the lines it wraps to start at the left indent, a paragraph with no indents gets 18 pt and -18 pt, and Return continues the list; Reset Panel turns it off, and paragraph styles and the native file keep it. The Bullets and Numbering dialog and list levels (#5037) and Convert to Text (#4093) are built too. The Paragraph panel's Numbered List button, Type › Bullets and Numbering › Apply Numbers and the context menu's Apply Numbers (`text.setFormat {list, number}`, `type.applyNumbers`) make paragraphs a numbered list with the documented presets (1, A, a, I, i, 01, 001, and None, which turns the list off; [Bullets and numbering](https://web.archive.org/web/20250807202418/https://helpx.adobe.com/illustrator/using/bullets-numbering.html), [Create bulleted or numbered lists](https://web.archive.org/web/20260417034638/https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/create-bulleted-or-numbered-lists.html)): each paragraph starts with its number and a period, counted through the list paragraphs of the story and its threaded frames, with the text and indents as in a bulleted list; letters go on from Z to AA, and roman numerals go on from III to IV, an empty paragraph is not numbered, and a paragraph in no list starts the count again at 1. More Options in the Bullets and Numbered List presets (`ui.bulletsAndNumbering`) opens the Bullets and Numbering dialog ([Create bulleted or numbered lists](https://web.archive.org/web/20260417034638/https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/create-bulleted-or-numbered-lists.html)): a Bullets tab and a Numbers tab with the presets, and the Position group's Alignment, Left Indent and First Line Indent, shown on the type while the dialog is open; OK applies them with `text.setFormat` (Alignment is its `listAlign`) as one undo step, and Cancel puts the type back. Alignment Left starts the marker at the first line's start, and Right ends it where the text starts. The cited page does not say where the marker sits for each choice, so these meanings are VectorCraft's own rule. Paragraph styles and the native file keep the alignment. Tab and Shift+Tab with the caret at the start of a list paragraph (`text.setFormat {listLevel}`), and the Bullets and Numbering dialog's Level field (OK sends it as `listLevel`), move the paragraph down and up the list's nine levels ([Create bulleted or numbered lists](https://web.archive.org/web/20260417034638/https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/create-bulleted-or-numbered-lists.html), [Bullets and numbering](https://web.archive.org/web/20250807202418/https://helpx.adobe.com/illustrator/using/bullets-numbering.html)): each level past the first sets the paragraph 18 pt further in, each level counts its own numbers from 1, and a paragraph back at a shallower level goes on with that level's count, through threaded frames too. Elsewhere Tab inserts a tab as before; one Undo takes a level change back, and paragraph styles and the native file keep the level. Convert to Text writes each level's numbers and keeps a deeper paragraph's indent. @@ -2643,7 +2643,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Files and untrusted input, 2026-10-14 merges: EPS import: a stitched shading keeps its hard colour changes (#1654, #1653). WMF/EMF import refuses an oversized embedded PNG or JPEG from its header, before any pixels are decoded (#1776). PDF open no longer takes exponential time on a crafted name tree with shared nodes when it looks for the editing data (#1781). The size limits on a native file's embedded data also apply to files read from memory, not only streamed ones (#1783). Saving over a private file on Unix no longer leaves a readable temporary copy beside it while the file is written (#1778). An Export for Screens suffix can no longer place files outside the export folder (#1777). Package refuses a folder where it would overwrite the open document or one of its linked files (#1786). ruzstd 0.9.1 fixes a decompression bomb (RUSTSEC-2026-0344) reachable from EPS/`.ai` and Affinity import (#1807). File Info dates are stamped only after a save succeeds, so a failed save no longer changes them (#1774). Linked files that change during a drag are updated after the drag instead of being missed (#1773). - EPS import: `readhexstring` and `readline` read the data left in a file in one pass instead of one byte per call, with the same bytes, result and next unread byte as before (about nine times less reader time on 6 MB of hex image data and on 8 MB of lines). - EPS import: `token` on a string, `search` and `anchorsearch` read their strings in place instead of copying the rest of the string on each call, with the same results, errors and operation count as before. Walking a 512 KiB string by what each call leaves takes 16 ms instead of 518 ms with `token` and 1.0 ms instead of 27 ms with `search`, and a 64 KiB string 2.2 ms instead of 10 ms with `token`; on a 4 KiB string the difference is under 0.1 ms (release build on Linux under load from other builds, median of 7 alternating runs, `cargo test --release -p vectorcraft-eps --lib tests_strings::string_walks_timed -- --ignored --nocapture`). -- **Fields, search and window, 2026-10-14 merges:** Fields commit what was typed when you click away or move to another field, as Enter does; Escape still discards it (#1787). Up and Down move through the command search results and Enter runs the highlighted one (#1798, #1757). Slider rails show on Medium Dark (#1808, #1662). On Windows the custom title bar's window stays truly borderless, so the pointer lines up with what is drawn on systems where the hidden caption offset it (#1791, #1758; awaiting the reporter's confirmation). +- **Fields, search and window, 2026-10-14 merges:** Fields commit what was typed when you click away or move to another field, as Enter does; Escape still discards it (#1787). Up and Down move through the command search results and Enter runs the highlighted one (#1798, #1757). Slider rails show on Medium Dark (#1808, #1662). On Windows the custom title bar's window stays truly borderless, so the pointer lines up with what is drawn on systems where the hidden caption offset it (#1791, #1758; the reporter confirmed it on 0.11.0). - **Tools, panels and type, later 2026-10-14 merges:** the Transform panel's, Properties panel's and Control bar's X, Y, W and H show and edit the bounds of the anchor points selected with Direct Selection, and a whole-object selection is unchanged (#1839, fixes #1824). With Snap to Grid on, anchors and objects snap to the grid even when Snap to Pixel is also ticked: the grid wins (#1840; #1816 stays open until the reporter confirms). A marquee with the Selection or Direct Selection tool also selects the unlocked ruler guides it crosses (#1836). The toolbar shows no group labels by default (a preference brings them back) and runs on in one or two columns; the All Tools drawer lists the tools by flyout group with their shortcuts, has a menu (Reset, Basic, Advanced) and a Show section for the Fill/Stroke, Coloring, Draw Mode and Screen Mode controls (`toolbar.show`, #1751). An action clicked in the Actions panel stays selected, so Play Current Selection and Delete Selection act on it (#1853, part of #1629; editing actions and action shortcuts remain). Redo pressed during a drag keeps the drag as a step instead of losing the redone edit (#1856, #1719). Preferences are written as soon as OK is pressed, so they survive a session that doesn't end with a normal quit (#1857; #1747 stays open until the reporter confirms). New and Redefine Character Style take the format of the selected text range, also while typing (#1634). Type inside symbols, pattern tiles, graph designs and opacity masks gets its layout bounds back when a native file opens, so warped type in a symbol looks the same after save and reopen (#1833, #1738). Editing, renaming, deleting or merging a global swatch reaches the art of opacity masks, and a swatch used only in a mask is no longer listed as unused (#1830, #1735). On macOS, Save As, Save a Copy and the first Save show their sheet again; the Format menu on the sheet (#866) is withdrawn until the format can be set before the sheet opens, and #866 is open again (#1855; #1800, #1831 and #1518 stay open until confirmed on a Mac). - **Files and untrusted input, later 2026-10-14 merges:** SVG import applies style sheet rules with `:not()` selectors, with their nesting bounded (#1799, #1557), no longer stalls on a style sheet with many stacked descendant selectors over deep nesting (#1834, #1703), and reads an SVG's linked files within the automation roots in force again (#1870). DXF export writes the VPORT record's view direction once (group code 36 was written twice, which strict readers reject, #1789). A deeply nested file no longer overflows the stack: nesting is capped at 32 objects (deeper groups are merged with a warning; SVG past 256 elements and PDF past 256 nested arrays are refused), symbols and patterns that use themselves open without the offending instance or paint, and a document nested more than about 40 deep can no longer be saved to a file that won't open again (#1852). PDF and `.ai` files nested deeply inside compressed streams, page trees holding themselves and functions or colour spaces built on themselves no longer crash the app (hayro 0.8; the import runs on a 16 MB thread, #1871); a decompression bomb or impossible predictor parameters are refused (#1873, #1700, #1701); a brush whose art draws the brush again through a symbol or pattern no longer crashes the app, and graph designs, Affinity, DXF, metafiles and plug-ins were probed with hostile input (#1872). Hostile EPS, Affinity and native files can no longer run memory or CPU away through ASCII85 data, PostScript objects holding themselves, flat-colour pixel layers or far and overlapping data offsets (#1863: #1715, #1714, #1704, #1699), and the save fallback for folders that refuse a rename keeps the old file's content until the new one is in (#1695). A file whose ids sit at their largest value no longer breaks new objects (#1718); a failed `command.batch` puts each document back whole, its file, history and a drag in progress included (#1697); a control request that timed out before the app took it never runs later, and the reply says which case it was (#1725, [control-protocol.md](control-protocol.md)); the Eyedropper and recolouring refuse an image too large as RGBA before decoding it (#1717) (all #1862). A save or export that fails is reported in a dialog that names the file and stays until closed, with the document left modified and the old file untouched (#1685); a browser download that can't start fails the save instead of marking it saved (#1693); a file that finishes opening waits while a dialog is open, so Save As options can't save the wrong document (#1694) (all #1865). krilla is built without its text shaping, so the unmaintained rustybuzz and ttf-parser don't ship (#1874, #1730); the CI gate compiles the web app for wasm, and the web's SVG nesting cap (34) follows from its 1 MiB stack (#1875). - **Rendering, later 2026-10-14 merges:** copies, symbol instances and repeats that share an appearance keep their stroke outlines between frames (#1667). Wide drop shadows and glows at high zoom render within the raster budget (#1706); stacked Transform effects are bounded (#1705); 3D effects keep the area a nonzero compound path fills (#1724); pattern tiles redraw when a symbol, pattern or image their art shows changes (#1723); a template layer dims its images by its Dim Images percentage instead of fading the whole layer (#1683) (all #1864). @@ -3300,13 +3300,13 @@ A double-click on a Repeat (Radial, Grid or Mirror) with the Selection tool ente ## Spell check engine (2026-11-08) -Edit › Spelling has the commands its Check Spelling dialog will use, as the public documentation describes checking the document's text, suggesting replacements and changing a word ([Check and correct spelling](https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/check-and-correct-spelling.html)). `text.spelling.check` lists the words the dictionaries don't know in every visible, unlocked type object, or in the ones given by `ids`, in paint order, each run checked in its Character panel Language (English when it has none; nothing in a language without a dictionary). Each word comes with its object and byte range, which `text.editRange` changes as one undo step. `text.spelling.suggest` gives one word's suggestions. Both come from craft-proof in [storytold/craft-libs](https://github.com/storytold/craft-libs), which checks each paragraph on its own. English words come from the first dictionary craft-proof finds: a Hunspell dictionary in the user's dictionaries folder, the SCOWL dictionary for that English built in from craft-i18n, a system Hunspell dictionary, and last the public-domain Moby word list built into craft-proof (#4936; `tests/spelling.rs`). The Check Spelling dialog, Auto Spell Check and Edit Custom Dictionary remain, so the Edit › Spelling menu items are still placeholders. +Edit › Spelling has the commands its Check Spelling dialog uses, as the public documentation describes checking the document's text, suggesting replacements and changing a word ([Check and correct spelling](https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/check-and-correct-spelling.html)). `text.spelling.check` lists the words the dictionaries don't know in every visible, unlocked type object, or in the ones given by `ids`, in paint order, each run checked in its Character panel Language (English when it has none; nothing in a language without a dictionary). Each word comes with its object and byte range, which `text.editRange` changes as one undo step. `text.spelling.suggest` gives one word's suggestions. Both come from craft-proof in [storytold/craft-libs](https://github.com/storytold/craft-libs), which checks each paragraph on its own. English words come from the first dictionary craft-proof finds: a Hunspell dictionary in the user's dictionaries folder, the SCOWL dictionary for that English built in from craft-i18n, a system Hunspell dictionary, and last the public-domain Moby word list built into craft-proof (#4936; `tests/spelling.rs`). The Check Spelling dialog, Auto Spell Check and Edit Custom Dictionary followed (below; #6341, #6425, #7744). -The custom dictionary and Ignore All followed (2026-11-09), as the same page describes them: Add puts a word in the custom dictionary, which Edit Custom Dictionary adds to, deletes from and changes, and Ignore All skips a word in the current document (#4936). `text.spelling.addWord`, `removeWord` and `changeWord` keep the dictionary in craft-proof, which every language's check reads, and the desktop app saves it to `Custom Dictionary.txt` beside its preferences (none in runs without preferences); `text.spelling.dictionary` lists it. `text.spelling.ignoreAll` keeps a word for the active document while it is open, not saved and not undoable (`tests/spelling.rs`). The dialogs remain. +The custom dictionary and Ignore All followed (2026-11-09), as the same page describes them: Add puts a word in the custom dictionary, which Edit Custom Dictionary adds to, deletes from and changes, and Ignore All skips a word in the current document (#4936). `text.spelling.addWord`, `removeWord` and `changeWord` keep the dictionary in craft-proof, which every language's check reads, and the desktop app saves it to `Custom Dictionary.txt` beside its preferences (none in runs without preferences); `text.spelling.dictionary` lists it. `text.spelling.ignoreAll` keeps a word for the active document while it is open, not saved and not undoable (`tests/spelling.rs`). The dialogs followed (below). -Auto Spell Check followed (2026-11-09): the same page has Edit › Spelling › Auto Spell Check underline potential spelling errors with a red line as you type, and says it isn't available for text with effects applied (#4936). `edit.autoSpellCheck` turns it on and off (off at first, saved with the view settings); the canvas draws a red wavy line under each word `text.spelling.check` would list in the visible type, leaves out type with an effect shown on it or on its fills and strokes, and checks a type object again when it is edited, when the custom dictionary changes and when Ignore All adds a word (`ui-egui/src/canvas/tests.rs`, `auto_spell_check_*`; `tests/spelling.rs`). The dialogs remain. +Auto Spell Check followed (2026-11-09): the same page has Edit › Spelling › Auto Spell Check underline potential spelling errors with a red line as you type, and says it isn't available for text with effects applied (#4936). `edit.autoSpellCheck` turns it on and off (off at first, saved with the view settings); the canvas draws a red wavy line under each word `text.spelling.check` would list in the visible type, leaves out type with an effect shown on it or on its fills and strokes, and checks a type object again when it is edited, when the custom dictionary changes and when Ignore All adds a word (`ui-egui/src/canvas/tests.rs`, `auto_spell_check_*`; `tests/spelling.rs`). The dialogs followed (below). -The right-click followed (2026-11-10), as the same page's "Correct spelling errors during Auto Spell Check" describes it: right-click a word with a red underline, then choose a suggested word, Ignore All to skip it in the current document, or Add to Dictionary (#4936). The canvas context menu lists the words `text.spelling.suggest` gives for it in its run's language, each replacing the word with `text.editRange` as one undo step, or No Suggestions; then Ignore All (`text.spelling.ignoreAll`) and Add to Dictionary (`text.spelling.addWord`). It lists nothing for a word that is right, with Auto Spell Check off, or once the word under the right-click has changed (`ui-egui/src/tests/contextmenu.rs`). The dialogs remain. +The right-click followed (2026-11-10), as the same page's "Correct spelling errors during Auto Spell Check" describes it: right-click a word with a red underline, then choose a suggested word, Ignore All to skip it in the current document, or Add to Dictionary (#4936). The canvas context menu lists the words `text.spelling.suggest` gives for it in its run's language, each replacing the word with `text.editRange` as one undo step, or No Suggestions; then Ignore All (`text.spelling.ignoreAll`) and Add to Dictionary (`text.spelling.addWord`). It lists nothing for a word that is right, with Auto Spell Check off, or once the word under the right-click has changed (`ui-egui/src/tests/contextmenu.rs`). The dialogs followed (below). The page's other way to turn Auto Spell Check on followed (2026-11-10): right-click the text and choose Spelling › Auto Spell Check (#4936). A right-click on type (which selects it) has a Spelling submenu with Auto Spell Check, which runs `edit.autoSpellCheck` as Edit › Spelling does. The context menu draws no check marks, its toggles saying what they do (Show Rulers, Hide Guides), but a submenu that holds only toggles shows them, and so does Spelling, so Auto Spell Check is checked while it is on; other art has no Spelling submenu (`right_click_on_type_turns_auto_spell_check_on_and_off`). Check Spelling… followed in the same submenu (2026-11-15), after Auto Spell Check as in Edit › Spelling, as the page also describes opening the Check Spelling dialog from Spelling in the menu of right-clicked text. It runs `ui.checkSpelling` on the selection, which the right-click made the type under the pointer, and a right-click on an underlined word has it too (`right_click_on_type_opens_check_spelling`, `right_click_on_an_underlined_word_also_offers_check_spelling`). @@ -3316,15 +3316,15 @@ Check Spelling followed (2026-11-15): Edit › Spelling › Check Spelling… (` ## Retype, phase 1 (2026-11-18) -The public pages describe Retype finding the fonts that match selected outlined text (or text in an image), from the fonts on the device among others, and applying them to live text ([identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html), [apply to live text](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html)). Phase 1 (#4934) is local and exact: Type › Retype (`type.retype`) compares each selected glyph shape with the glyphs of the loaded fonts, the document's fonts and any families named in `fonts`, the same up to uniform scale, rotation and translation, and sets the matched characters as point text in that font and size at the same baseline, one object per line, in one undo step. Shapes that match no font stay and are reported. The search is bounded, not exhaustive: at most 96 faces (named families first, then the document's fonts, then the other loaded faces), the first 65,536 encoded characters of each, and glyphs of plain-shape characters (box drawing, blocks, geometric shapes, private use) are left out; a glyph outside those limits is reported as matching no font. Exact matching also reads a curve an exporter split in two as a different shape; near matching with a tolerance (below) reads it as the glyph. Tested by round trips through Create Outlines (plain, bold and turned, serif, word spaces), a drawn shape and a mixed selection (`crates/engine/src/cmd/retype_tests.rs`). Installed fonts not yet loaded and images remain (phase 2). +The public pages describe Retype finding the fonts that match selected outlined text (or text in an image), from the fonts on the device among others, and applying them to live text ([identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html), [apply to live text](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html)). Phase 1 (#4934) is local and exact: Type › Retype (`type.retype`) compares each selected glyph shape with the glyphs of the loaded fonts, the document's fonts and any families named in `fonts`, the same up to uniform scale, rotation and translation, and sets the matched characters as point text in that font and size at the same baseline, one object per line, in one undo step. Shapes that match no font stay and are reported. The search is bounded, not exhaustive: at most 96 faces (named families first, then the document's fonts, then the other loaded faces), the first 65,536 encoded characters of each, and glyphs of plain-shape characters (box drawing, blocks, geometric shapes, private use) are left out; a glyph outside those limits is reported as matching no font. Exact matching also reads a curve an exporter split in two as a different shape; near matching with a tolerance (below) reads it as the glyph. Tested by round trips through Create Outlines (plain, bold and turned, serif, word spaces), a drawn shape and a mixed selection (`crates/engine/src/cmd/retype_tests.rs`). Images remain (phase 2). Installed fonts not yet loaded, and loaded faces past the first 96, are compared too (#8823; see Retype installed fonts). ## Retype near matches (2026-11-18) -The public page orders Retype's matching fonts by how close each is to the text's appearance ([identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html)), so outlines need not be exactly a font's glyphs. `type.retype` takes a `tolerance` (0 to 0.05, default 0 for exact matches only). Above 0, a shape of up to 8 contours that is no glyph exactly is read at equal steps of length from any start and in either direction, its contours paired with the glyph's by length, and it becomes the glyph it is closest to when the leftover distance, relative to the shape's size, is at most the tolerance and the glyph's outline and the shape's each lie within three times the tolerance (relative to the shape's size, and at least 0.5%) of the other. A near-matched glyph may differ from its line by the tolerance in size, turn and place; an exact glyph keeps the exact limits unless the line's first glyph, whose size and turn the line takes, is a near match. Each line in the result has a `score` from 1 (exact) to 0. A compound path holding several glyphs (a word made into one compound path) is split into groups of contours and matched in runs of up to three groups, and becomes type only when every glyph does; exact matching of those groups also reads contours that run the other way round, as Make Compound Path leaves them. Exact matches of the whole shape come first, then exact matches of its groups, then near matches. The tolerance, the score and the splitting are VectorCraft's own. Tested with outlines flattened into lines, restarted, reversed and simplified, a curve split in two, contours in another order, turned lines of round glyphs, a word made into one compound path, and a compound with a part that is no glyph (`crates/engine/src/cmd/retype_tests.rs`, `crates/text/src/retype.rs`). The Retype panel's list (below) still takes exact matches of whole shapes only. Glyphs fused into one contour, installed fonts not yet loaded and images remain. +The public page orders Retype's matching fonts by how close each is to the text's appearance ([identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html)), so outlines need not be exactly a font's glyphs. `type.retype` takes a `tolerance` (0 to 0.05, default 0 for exact matches only). Above 0, a shape of up to 8 contours that is no glyph exactly is read at equal steps of length from any start and in either direction, its contours paired with the glyph's by length, and it becomes the glyph it is closest to when the leftover distance, relative to the shape's size, is at most the tolerance and the glyph's outline and the shape's each lie within three times the tolerance (relative to the shape's size, and at least 0.5%) of the other. A near-matched glyph may differ from its line by the tolerance in size, turn and place; an exact glyph keeps the exact limits unless the line's first glyph, whose size and turn the line takes, is a near match. Each line in the result has a `score` from 1 (exact) to 0. A compound path holding several glyphs (a word made into one compound path) is split into groups of contours and matched in runs of up to three groups, and becomes type only when every glyph does; exact matching of those groups also reads contours that run the other way round, as Make Compound Path leaves them. Exact matches of the whole shape come first, then exact matches of its groups, then near matches. The tolerance, the score and the splitting are VectorCraft's own. Tested with outlines flattened into lines, restarted, reversed and simplified, a curve split in two, contours in another order, turned lines of round glyphs, a word made into one compound path, and a compound with a part that is no glyph (`crates/engine/src/cmd/retype_tests.rs`, `crates/text/src/retype.rs`). The Retype panel's list (below) still takes exact matches of whole shapes only. Glyphs fused into one contour and images remain; installed fonts not yet loaded are compared too (#8823, see Retype installed fonts). ## Retype panel (2026-11-18) -The identify-fonts page has the Retype panel list ten matching fonts ordered by closeness, with five more on request, previews in one of three text sizes and the user's own sample text ([identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html)). Window › Retype shows the Retype panel. Find Matching Fonts (`retype.find`, on `type.retypeFonts`) lists the fonts whose glyphs the selected shapes exactly match, comparing up to 96 loaded fonts with those of the document's live type first, so a matching font past that limit is not listed; Find more font matches adds five. The 96-font limit is VectorCraft's own. The order is VectorCraft's own: by how many shapes each font matches, then by how closely. The sample sizes (Small, Medium, Large) and the 100-character sample text limit are VectorCraft's own too. Each row shows a sample in the font, in the size the panel menu sets and with the text typed in the panel, and a click on a row sets the font on the selected live type. Tested in `crates/engine/src/cmd/retype_fonts_tests.rs` and `crates/ui-egui/src/panels/retype/tests.rs`. Opening the panel from the Type menu, the context menu and the Properties panel's Quick Actions, filtering the list by font source and favorites, near matches and images remain; installed fonts not yet loaded are compared too (see Retype installed fonts). +The identify-fonts page has the Retype panel list ten matching fonts ordered by closeness, with five more on request, previews in one of three text sizes and the user's own sample text ([identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html)). Window › Retype shows the Retype panel. Find Matching Fonts (`retype.find`, on `type.retypeFonts`) lists the fonts whose glyphs the selected shapes exactly match, comparing up to 96 loaded fonts with those of the document's live type first, so a matching font past that limit is not listed; Find more font matches adds five. The 96-font limit is VectorCraft's own. The order is VectorCraft's own: by how many shapes each font matches, then by how closely. The sample sizes (Small, Medium, Large) and the 100-character sample text limit are VectorCraft's own too. Each row shows a sample in the font, in the size the panel menu sets and with the text typed in the panel, and a click on a row sets the font on the selected live type. Tested in `crates/engine/src/cmd/retype_fonts_tests.rs` and `crates/ui-egui/src/panels/retype/tests.rs`. The Properties panel's Quick Actions show the panel with type selected (#8778). Opening the panel from the Type menu and the context menu, filtering the list by font source and favorites, near matches and images remain; installed fonts not yet loaded are compared too (see Retype installed fonts). ## Retype tracking (2026-11-19) @@ -3386,7 +3386,7 @@ Edit › Copy and Cut put the selected ruler guides on the clipboard, with the s `bucket_fills_a_region_of_a_selection_that_mixes_a_group_and_paths`, `the_live_paint_bucket_shows_a_bucket_or_a_brush`. Behavior source: [the help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/paint-with-the-live-paint-bucket-tool.html). - The cursor swatch preview is not built. Scores and estimates unchanged. + Cursor Swatch Preview shows the active paint above the pointer between the swatches before and after it (#7265). Scores and estimates unchanged. - **Live Paint Selection cursors:** the pointer changes over a face, over an edge and outside the Live Paint groups ([the help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/modify-live-paint-groups.html)). The cursor is the arrow with a filled square where a click selects a face, with a short line From 4092a8b10b61e0040b295bd0ef8634ab3cd2ce97 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 18:44:15 -0800 Subject: [PATCH 056/105] Docs: gaps.md matches what main ships Lines that called shipped work missing, pending or unconfirmed now say what main has: the key anchor for Align and Distribute (#7769, #8023), artboard colors in exports and print (#4991), update checks (#4138), Touch Type, Snap to Glyph, ruby, kinsoku sets and tate-chu-yoko, the file-font and read-only save regressions passing in #4569 and #6671, and the Wayland cursor and Windows title bar fixes the reporters confirmed (#1645, #1758). The built-in brush library count and list match the twenty libraries in brushlib.rs, and the Preferences count matches the two options still listed under Missing. --- docs/gaps.md | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/docs/gaps.md b/docs/gaps.md index fd7e4a6b9f..9130e782f1 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -13,7 +13,7 @@ > Outline Stroke is available in the canvas context menu when the selection has an outlinable stroke (#5267). Scores and estimates unchanged. -> **File-font hardening status (2026-11-12, #4569):** G8 implementation and synthetic regressions added; compilation and runtime proof pending. Scores and estimates unchanged. +> **File-font hardening status (2026-11-12, #4569):** G8 implementation and synthetic regressions added; #4569 merged with its CI gate passing. Scores and estimates unchanged. ## Feature submission evidence @@ -172,7 +172,7 @@ stage ([ROADMAP.md](../ROADMAP.md)). **Alpha blockers:** none. Every core workflow passes the [alpha gate](roadmap.md#alpha-gate); G9 is the only partial one, and it blocks beta, not alpha. -**To beta:** G1, G9, G10, G11, G12, the corpus and QA part of G8, the type-core part of G4, macOS pen pressure +**To beta:** G1, G9, G10, G11, G12, the corpus and QA part of G8, the type-core part of G4, native Wayland pen pressure from G14 and the budget run of G15: **~170–270 h** one agent, ~50–80 h wall clock with 4–6 agents. ## G1 Interaction fidelity @@ -229,7 +229,7 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi - **Done:** Artboard Options' Show Center Mark and Show Cross Hairs ([public source](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/organize-manage-artboards/modify-display-settings-of-artboards.html)): per-artboard checkboxes (`artboard.setProps`/`artboard.new` `showCenterMark`, `showCrossHairs`) that the canvas draws as a center cross and lines from the middle of each side through the center; exports and print leave them out. - **Done (#2849):** Artboard Options' video display options ([public source](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/organize-manage-artboards/set-video-display-options-for-artboards.html)): Show Video Safe Areas (`showVideoSafeAreas`) outlines the action-safe area 3.5% and the title-safe area 5% in from each edge, our choice from [EBU R 95](https://tech.ebu.ch/docs/r/r095.pdf) (the help page gives no numbers), on the canvas only; Video Ruler Pixel Aspect Ratio (`videoRulerPixelAspectRatio`, 0.1–10, default 1) is the width of one video pixel over its height. Both per artboard, one undo step, in the native format only when set. View › Rulers › Show Video Rulers is in G7. - **Done (#3705):** Draw Inside in isolation mode ([isolation mode](https://helpx.adobe.com/illustrator/desktop/manage-objects/select-objects/isolate-objects.html)): with the object drawn into isolated by a double-click, art drawn or pasted inside it takes isolation mode into its clip group, so it can be clicked and isn't dimmed; it used to stay locked and dimmed beside the isolated path, and double-clicks never reached the clip group. -- **Done:** Artboard Options' Show Center Mark and Show Cross Hairs ([public source](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/organize-manage-artboards/modify-display-settings-of-artboards.html)): per-artboard checkboxes (`artboard.setProps`/`artboard.new` `showCenterMark`, `showCrossHairs`) that the canvas draws as a center cross and lines from the middle of each side through the center; exports and print leave them out. Video safe areas, video rulers and the pixel aspect ratio remain missing. +- **Done:** Artboard Options' Show Center Mark and Show Cross Hairs ([public source](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/organize-manage-artboards/modify-display-settings-of-artboards.html)): per-artboard checkboxes (`artboard.setProps`/`artboard.new` `showCenterMark`, `showCrossHairs`) that the canvas draws as a center cross and lines from the middle of each side through the center; exports and print leave them out. - **Done:** Document Setup → Edit Artboards applies valid settings, closes the dialog and activates the Artboard tool. Pointer-click tests cover successful handoff, invalid settings, OK, Cancel and Undo in `dialogs/document_setup.rs`. - **Done (#2691):** a double-click on the Line Segment, Arc, Rectangular Grid or Polar Grid tool opens its Tool Options, as the [Rectangular Grid tool](https://helpx.adobe.com/illustrator/using/tool-techniques/rectangular-grid-tool.html) and [Arc tool](https://helpx.adobe.com/illustrator/using/tool-techniques/arc-tool.html) pages (step 3) and the [Tools](https://helpx.adobe.com/illustrator/using/tools.html) page describe: the tool's click dialog without a place to draw (Line Segment adds Fill Line; the grids keep their Default Size and Reference Point). OK draws nothing and sets what the next drag draws with and what a click's dialog opens at; Cancel changes nothing. Editing a grid's rows and columns after it is drawn (the rest of #2691) remains. Broader G1 estimate unchanged. - **Done:** Simplify of part of a path, as the [manual-simplify page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/manually-simplify-paths.html) describes for part of a path picked with Direct Selection: with anchors or segments of a path direct-selected, Object › Path › Simplify (the slider, Auto-Simplify and the dialog) refits only each run of selected segments between its end anchors, which stay where they are with their outer handles; the other anchors and segments stay exactly as they were, a closed path's run may cross its start point, separate runs on one path simplify independently in one undo step, and the runs stay selected (`object.path.simplify` `wholePaths: true` simplifies such paths whole). Tests: `crates/engine/src/tests/simplify_part.rs`, `simplify_slider_and_dialog_simplify_only_the_direct_selected_part_of_a_path`. Broader G1 estimate unchanged. @@ -257,9 +257,9 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi - **Done (#834):** bezier drag previews no longer freeze: a Pen, Anchor Point or Direct Selection drag gets every position the pointer is seen at, including the one where it comes back into the window after leaving it and a move in the frame it lets go, so the release commits where the pointer let go; a click's jitter stays a click. -- **Missing (noted for reporters, 2026-10-14):** aligning anchor points selected with - Direct Selection to a key anchor (from #1636: they align to their bounds; the current public Align page does - not say how the key anchor is chosen, so this waits for the owner). Inside the estimate below. +- **Done (#7769, #8023):** aligning anchor points selected with + Direct Selection to a key anchor (from #1636): with several anchors selected, a click on one of them without + modifiers makes it the key anchor that Align and Distribute keep in place. Inside the estimate below. - **Missing:** a tool-by-tool, panel-by-panel pass over modifiers, cursors, the Properties panel per context, isolation mode and small behaviours, against the public tool and shortcut documentation. Itemized in [ui-parity.md](ui-parity.md). The Shaper's construction-mode widget and gesture refinements remain. @@ -325,14 +325,14 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi ## G10 Launch and stability on real machines -- **Unconfirmed (2026-10-14):** Tool cursors are painted into the window on Wayland (#1652; not run on Linux, #1645 stays open until confirmed). On Windows the custom title bar's window stays truly borderless, so the pointer lines up with what is drawn on systems where the hidden caption offset it (#1791, #1758; awaiting the reporter's confirmation). +- **Done (2026-10-14):** Tool cursors are painted into the window on Wayland (#1652; the reporter confirmed the size on Hyprland, and #1645 is closed). On Windows the custom title bar's window stays truly borderless, so the pointer lines up with what is drawn on systems where the hidden caption offset it (#1791, #1758; the reporter confirmed it on 0.11.0). - **Done:** RPM required dependencies use 64-bit library capabilities and declare glibc 2.35, libm and libgcc_s (#1275); generated metadata and isolated synthetic-provider checks cover x86_64/aarch64. Real-distribution install/start-up QA is still missing. - **Done (2026-11-04):** a first frame the app is slow to build no longer costs the window its graphics adapter (#5160). The first-frame watchdog gave the frame 20 s from the app's start and then started again without the adapter, so a slow machine (antivirus reading every file, a large font library) ended with no adapter left and no window. A frame counts once its UI pass ends, before it is painted, so the 20 s now run from there; a frame still being built is waited for, with a note in the log (`a_first_frame_that_never_reaches_the_screen_hangs_its_adapter`; checked on Linux with the first frame held 35 s: the window opened with no restart). Estimate unchanged. - **Done (2026-11-04):** a large font library no longer keeps the window from opening (#5483). The menu bar's Type › Font, drawn in the first frame, waited for the scan of every installed font; when that took longer than the 20 s first-frame watchdog (thousands of fonts on a slow disk, or with each file checked by antivirus) the app took the graphics adapter for hung and started again without it until none was left. The menu now lists the fonts already loaded until the scan ends, then all of them (`the_menu_family_list_now_does_not_wait_for_the_scan`; checked on Linux with 3,923 extra font files, each open delayed 8 ms: the window opened in 1.5 s, where it never did before). Estimate unchanged. - **Done (2026-10-29):** the Linux Flatpak on GNOME no longer reconnects to the compositor and logs a warning every 250 ms when arboard has neither data-control nor X11 (267k warnings in 18 h filled the 16 MB log in 3 h): a clipboard that can't be opened is retried with a wait growing to a minute and logged once. Copy and Paste of text with other apps work there through the core Wayland protocol. - **Unconfirmed (2026-11-13):** pictures and SVG on the clipboard of the Flatpak on GNOME. Copy there offers the PNG as `image/png`, the SVG as `image/svg+xml` (with Include SVG Code on) and the text, all from one Copy; Paste takes SVG, then text, then the PNG (blank text, or text that only names a picture, gives way to the PNG), and the Paste menu item is enabled by the types offered. A read takes 64 MiB at most (`clipboard::wayland` tests; not yet run in the Flatpak on a GNOME session). - **Missing:** the app not starting or staying in the background on some Windows 11 machines (#858, #964 fixed - 2026-10-10, #620, #818), slow pointer on a Linux AppImage (#575), macOS paste from other apps (#954), a + 2026-10-10, #620, #818), macOS paste from other apps (#954), a web-free crash/hang reporter, a field record. - **Evidence:** open issues; the never-crash lints and `guard` stop panics, not driver, windowing or packaging failures. @@ -341,7 +341,7 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi ## G8 Hardening at scale -- **Implementation awaiting runtime proof (#4569):** bind file-font references to owned document blobs, compare candidate face bytes, and reclaim dead live-face slots. Unused blobs do not consume admission; native/PDF/paste report refused resources. Synthetic text, renderer and native/clipboard regressions added; no gap closed before compilation and runtime checks. +- **Done (#4569):** bind file-font references to owned document blobs, compare candidate face bytes, and reclaim dead live-face slots. Unused blobs do not consume admission; native/PDF/paste report refused resources. Synthetic text, renderer and native/clipboard regressions added and passing in #4569's CI gate; no gap closed. - **Done:** PngSuite fetching verifies 175 original PNGs and redistribution notices against a pinned SHA-256/size manifest before publishing; file and total-size budgets, cache verification and no archive extraction (#1729). The real-world corpus and manual QA gaps below remain. @@ -392,8 +392,7 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi up with the file's size, and blends inside a symbol's art don't count toward a blend whose keys show it. - **Missing:** a corpus of real-world SVG/PDF/EPS files; more Affinity versions and platforms (51 pinned files now, including 28 original Affinity 3.2.3 feature probes; large interacting documents and complex typography - missing); Windows, Linux and browser QA by hand; packaging polish (Homebrew cask #588, Flathub #554, update - checks #615). + missing); Windows, Linux and browser QA by hand; packaging polish (Homebrew cask #588, Flathub #554). - **Impact:** unknown failures on users' files. - **Estimate:** 30–50 h (the corpus and QA part blocks beta). @@ -415,7 +414,7 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi - **Done (#1968):** native saves retain transparency grid visibility without adding an edit or undo step; older files default to hidden. Broader G11 scope and estimates unchanged. - **Done:** Asset Export / raster Art Optimized edges supersample so shapes that meet edge to edge leave no ghost seam (#983, #1037; `assets.export` abutting-rects regression; Asset Export panel thumbs use the same supersample). -- **Done (2026-10-14):** Align and Distribute act on the anchor points selected with Direct Selection: the points of one path align to each other, not to the artboard, and Distribute spaces them (#1641, fixes #1636; aligning to a key anchor is still missing). Delete removes every selected anchor of a closed path (it used to remove the wrong ones), removes objects selected whole along with the selected anchors of others, and keeps the remainder selected so a second Delete removes it (#1674). In isolation mode Direct Selection and Group Selection pick only inside the isolated object (#1666). Escape cancels a Direct Selection drag (#1803, #1743). Escape while typing ends the edit, keeps the type selected and switches to the Selection tool (#1802, #1686, #1656). A filled Pencil path keeps a stroke of None (#1804, part of #1679). In the Pathfinder panel a group selected alone counts its nested shapes, so an expanded stroked object keeps the Shape Modes enabled (#1642, #1635). Object › Expand turns radial, grid and mirror repeats into groups of their instances (#1765, #1756). Select › Same matches type on its characters' fill and stroke (#1746, #1737). Roughen with Smooth keeps turn-backs smooth instead of making cusps that draw as spikes (#1646, #1643). Scribble draws one zig-zag per region, with no lines across holes and notches; convex shapes are unchanged (#1651, #1648). +- **Done (2026-10-14):** Align and Distribute act on the anchor points selected with Direct Selection: the points of one path align to each other, not to the artboard, and Distribute spaces them (#1641, fixes #1636; aligning to a key anchor followed in #7769). Delete removes every selected anchor of a closed path (it used to remove the wrong ones), removes objects selected whole along with the selected anchors of others, and keeps the remainder selected so a second Delete removes it (#1674). In isolation mode Direct Selection and Group Selection pick only inside the isolated object (#1666). Escape cancels a Direct Selection drag (#1803, #1743). Escape while typing ends the edit, keeps the type selected and switches to the Selection tool (#1802, #1686, #1656). A filled Pencil path keeps a stroke of None (#1804, part of #1679). In the Pathfinder panel a group selected alone counts its nested shapes, so an expanded stroked object keeps the Shape Modes enabled (#1642, #1635). Object › Expand turns radial, grid and mirror repeats into groups of their instances (#1765, #1756). Select › Same matches type on its characters' fill and stroke (#1746, #1737). Roughen with Smooth keeps turn-backs smooth instead of making cusps that draw as spikes (#1646, #1643). Scribble draws one zig-zag per region, with no lines across holes and notches; convex shapes are unchanged (#1651, #1648). - **Done:** Divide splits filled paths along open cutting lines and curves (#1307), preserving the frontmost filled appearance, implicit filled closure, holes, unrelated objects and one Undo/Redo; the existing bounded-map fallback remains. @@ -435,7 +434,7 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi selected with Direct Selection (#1839, #1824); Snap to Grid wins over Snap to Pixel (#1840, #1816 unconfirmed); Redo during a drag keeps the drag (#1856, #1719); a template layer dims its images by Dim Images instead of fading the whole layer (#1864, #1683); a failed save or export is reported in a dialog that names the file and stays until - closed, the document left modified (#1865, #1685). Ordinary File > Save now offers Save As for terminal permission/read-only refusals (#6146), unless another picker is open; recovery errors retain the dialog. Regression execution pending; G11 estimate unchanged. + closed, the document left modified (#1865, #1685). Ordinary File > Save now offers Save As for terminal permission/read-only refusals (#6146), unless another picker is open; recovery errors retain the dialog. Regressions pass in #6671's CI gate; G11 estimate unchanged. - **Done:** the Shape Builder offers the empty areas closed shapes enclose as regions, such as the middle of four circles that touch, and merges them with the regions around them (#1691). - **Done (#2523):** Shape Builder Gap Detection shares Live Paint's spatially indexed gap finder, @@ -502,7 +501,7 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi - **Done:** a paragraph's Auto Leading also sets the Leading the Character panel shows for Auto type, the leading the Alt+↑/↓ nudge steps from and the lines Fill with Placeholder Text counts; estimate unchanged. - **Missing:** CJK vertical - composition (ruby, custom mojikumi sets and the Mojikumi Settings dialog, kinsoku settings #633, manual tate-chu-yoko), Middle Eastern + composition (custom mojikumi sets and the Mojikumi Settings dialog), Middle Eastern - **Done:** Ruby (ふりがな) for live text (`type.ruby`): a reading over a byte range, above or below (right of the column in vertical type), aligned, sized, overhanging or squeezed; saved natively, laid out with line growth, drawn on the canvas and in SVG/PDF (outlines where ruby is present), EPS, EMF/WMF and legacy `.ai` (outlines where ruby is @@ -541,9 +540,9 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi own pixels until a document takes them in; estimate unchanged. - **Done:** spell check (#4936): engine (`text.spelling.check` and `text.spelling.suggest` on craft-proof); custom dictionary and Ignore All (`text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary`, `ignoreAll`); Auto Spell Check (`edit.autoSpellCheck`) with red wavy underlines and canvas context menu suggestions, Ignore All and Add to Dictionary; Edit › Edit Custom Dictionary…; and modal Check Spelling dialog (Edit › Spelling › Check Spelling…, and Spelling › Check Spelling… in the canvas context menu of type, `ui.checkSpelling`) with sentence context, suggestions list, "Change to" edit, Ignore, Ignore All, Change, Change All, Add to Dictionary, Done, Cancel, and keyboard navigation; Language packs for languages other than English, read from the Craft apps' shared font store, with `proof.packs`, `proof.installPack` and `proof.removePack` (a Preferences page to install them and the missing-pack bar remain). Estimate unchanged. - **Missing:** CJK vertical - composition (custom mojikumi sets and the Mojikumi Settings dialog, kinsoku settings #633, manual tate-chu-yoko), Middle Eastern + composition (custom mojikumi sets and the Mojikumi Settings dialog), Middle Eastern features beyond bidi, digit types, Character Direction and Kashidas (a split caret; the Middle Eastern & South Asian composers are done, #4935), - Touch Type, Retype beyond exact matches of available fonts (phase 1 is in, #4934, the Retype panel lists the exactly matching fonts, installed fonts not yet loaded included, and `type.retype` takes near matches within a tolerance and words outlined as one compound path, in installed fonts not yet loaded too; glyphs fused into one contour, near matches in the panel's list and text in images remain), Snap to Glyph; optional preservation of font sizes during group scaling (#1034 enhancement). + Retype beyond exact matches of available fonts (phase 1 is in, #4934, the Retype panel lists the exactly matching fonts, installed fonts not yet loaded included, and `type.retype` takes near matches within a tolerance and words outlined as one compound path, in installed fonts not yet loaded too; glyphs fused into one contour, near matches in the panel's list and text in images remain); optional preservation of font sizes during group scaling (#1034 enhancement). Itemized in [type-parity.md](type-parity.md). - **Impact:** professional typography and Japanese/Chinese publishing. - **Estimate:** 34–47 h (type core 14–19 h blocks beta). @@ -609,8 +608,8 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi - **Audited (2026-10-30, #394):** every Preferences dialog option but four is read by shipped code, by its field or its key; Highlight Alternate Glyphs (the canvas's render options), Real-time Drawing and Editing (tool previews wait for the commit), Show Tool Tips, Anti-aliased Artwork, Use Precise Cursors and Devices › - Enable Touch Workspace and Touch Gestures included. One of the four, Open Documents As Tabs, acts now (below); - the other three are listed under Missing. + Enable Touch Workspace and Touch Gestures included. Two of the four, Open Documents As Tabs and Hyphenation › Default Language, act now (below); + the other two are listed under Missing. - **Done:** User Interface › Open Documents As Tabs: with the box cleared, each document opened or created afterwards opens in a floating window of its own (G7's Float in Window); documents already open stay where they are. Estimate unchanged. @@ -714,9 +713,9 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi - **Missing:** the rest of the snapping enhancements (29.8.1): forced snapping to the grid, showing guides while snapping, and limiting snapping to the active artboard or to isolated objects; floating-panel parity is unverified (the Control bar's Snapping quick access and View › Snapping submenu are done, see [ui-parity.md](ui-parity.md)). The Smart Guides snapping tolerance and 30.0's Snap to Tangent and Snap to Perpendicular are done. Not yet checked: snapping to the endpoints, midpoints and centers of - rotated objects, and the reworked Snap to Grid and Snap to Pixel feedback. Also missing: artboard colors in exports and print, and + rotated objects, and the reworked Snap to Grid and Snap to Pixel feedback. Artboard colors in exports and print are done (#4991). Also missing: managing artboards from the canvas other than locking and unlocking them from the Artboard tool's right-click - menu (30.0); the Blend panel with ease in/out and separate colour acceleration (30.7). The Dimension tool (28.x) + menu (30.0). The Blend panel's easing (30.7) is partial, see above. The Dimension tool (28.x) is done ([dimensions.md](dimensions.md)). - **Evidence:** Adobe's 30.0 and 30.7 release announcements, see [target-app-parity.md](target-app-parity.md#how-this-was-measured-2026-10-10); snapping: @@ -782,8 +781,8 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi libraries ([public source](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/create-new-brush-libraries.html), [import](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/import-brushes-from-brush-libraries-or-other-files.html)): Window › Brush Libraries and the Brushes panel's Brush Libraries Menu open each library in a library panel of - its own (fifteen original libraries generated in code: Art Ribbons, Ink and Wash, Calligraphic Nibs, Pressure Sensitive, Bristle Brushes (one - bristle brush for each tip shape), Pattern Borders, Decorative (Leaf Vine, Blossom Chain, Pennant Garland and Lantern String pattern brushes), Scatter Shapes, Stipple (Fine, Dense, Soft and Bold dot textures), Game Trails, Energy Beams, Dry Media (grainy chalk, pencil, crayon and charcoal art brushes), Tech Circuit (Circuit Trace, Bus Lines and Terminal Nodes), Engraving (Fine, Dense, Tapered and Broken Hatching) and Arrows (Solid, Open, Double, Chevron and Dashed Arrow); User Defined; Other Library… reads the brushes of any document VectorCraft opens); a + its own (twenty original libraries generated in code: Art Ribbons, Ink and Wash, Calligraphic Nibs, Pressure Sensitive, Bristle Brushes (one + bristle brush for each tip shape), Paint, Pattern Borders, Decorative (Leaf Vine, Blossom Chain, Pennant Garland and Lantern String pattern brushes), Ornamental, Scatter Shapes, Stipple (Fine, Dense, Soft and Bold dot textures), Game Trails, Energy Beams, Dry Media (grainy chalk, pencil, crayon and charcoal art brushes), Tech Circuit (Circuit Trace, Bus Lines and Terminal Nodes), Engraving (Fine, Dense, Tapered and Broken Hatching), Arrows (Solid, Open, Double, Chevron and Dashed Arrow), Image Brush, Artistic Brushes and Vector Packs; User Defined; Other Library… reads the brushes of any document VectorCraft opens); a click adds a brush to the document's Brushes with the patterns, symbols and other resources its art uses, as one undo step (applied to the selected paths in the same step), dragging one onto a path adds and applies it and From 0d8184648121e5c689561bdeebef55a7a46b11a6 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 18:44:43 -0800 Subject: [PATCH 057/105] Docs: docs/roadmap.md matches what main ships MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Set type row names Justification… (#2771) instead of calling the justification options missing. The Alongside step names the one menu stub left, Effect › 3D and Materials › Materials…, instead of 28. Both M7 rows mark tab leaders done (#1880) and vertical type in progress with Type › Type Orientation (#5027). --- docs/roadmap.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/roadmap.md b/docs/roadmap.md index ff7e13fae7..971ca6eafa 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -158,7 +158,7 @@ Checked 2026-10-10 from the code, tests and open issues; no workflow fails, so V | 2026-10-12 | minor | Desktop PDF spooler shared through craft-print; exact physical sizes, composed copies and Windows 7 fallback retained. Scores and remaining gaps unchanged. | | Draw and edit paths precisely: Pen, Curvature, Direct Selection on anchors and handles, smart guides and snapping, Pathfinder | yes | `crates/tools/src/pen.rs`, `direct.rs`, `guides.rs` and their tests; 10 exact Pathfinder booleans; [ui-parity.md](ui-parity.md). Shape Builder regions on art of thousands of segments fixed (#937's reproduced case; unconfirmed on the reporter's file), Pathfinder covers the same results | 0 | | Paint and style: fills and strokes, global and spot swatches, gradients, Appearance, transparency, graphic styles | yes | M3 done (92 tasks); area scores 92–97% in [target-app-parity.md](target-app-parity.md#feature-areas) | 0 | -| Set type: point and area type, Character and Paragraph styles, threading, outlines | yes | type core 80%; styles, threading, Create Outlines and font matching tested ([type-parity.md](type-parity.md)); justification options missing (not blocking) | 0 | +| Set type: point and area type, Character and Paragraph styles, threading, outlines | yes | type core 80%; styles, threading, Create Outlines and font matching tested ([type-parity.md](type-parity.md)); justification options set per paragraph with Justification… (#2771) | 0 | | Organise layers and artboards and export assets (Export for Screens, SVG, PNG, PDF per artboard) | yes | Layers panel rework, Artboards panel and tool, Export for Screens and Asset Export done; Art Optimized supersample closes ghost borders (#983 / #1037) | 0 | | Print production: CMYK and spot colour, bleed and marks, PDF/X out, separations preview | yes | PDF/X-1a/3/4, presets, marks and bleed, ICC output intent, Separations Preview, Print with PostScript output | 0 | | Exchange files with Illustrator users: open their `.ai`/EPS/PDF, hand back a file they can open | partial (doesn't block alpha) | `.ai`, EPS and PDF open as editable art, but real files can get the wrong layer structure (#951); Save As `.ai` is PDF-compatible with an editing copy of the art (layers, groups, paths, colors, gradients, patterns, images, transparency, opacity masks, clipping, type as text and symbols, with live effects kept only on paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports ([file-format-parity.md](file-format-parity.md)), other objects' effects other than geometry effects left out, and live objects written as their art; #868), or legacy version 7, which keeps layers, groups and type as text, one artboard per file, and waits for users' testing. EPS legacy mesh corners, vector opacity masks and raster print-page comparison now preserve editable art under synthetic regressions. This is the beta main-format gap ([gaps.md](gaps.md) G9) | 10–20 (for beta) | @@ -181,7 +181,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule - **Then:** advanced type (G4) and the Illustrator 2026 additions (G13), then 3D (G3), each with a plan in `plan/` before coding. -- **Alongside:** close the 28 stubbed menu items; run `vectorcraft-cli perf` on an idle machine and fix any +- **Alongside:** close the one stubbed menu item (Effect › 3D and Materials › Materials…); run `vectorcraft-cli perf` on an idle machine and fix any budget missed (G15). - **Beta:** G1, G9, G10, G11, G12, the corpus part of G8, type core, macOS pen pressure and the perf budgets (~170–270 h one agent, ~50–80 h with 4–6 agents). @@ -198,9 +198,9 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | `.ai` import: type takes the installed copy of its font that sets its PDF part's widths (#8087; estimates unchanged); `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths (#8128; estimates unchanged); Production Preflight checks fonts, overflow, links and image resolution with clickable findings and automatic rechecking (VectorCraft addition; estimates unchanged); PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; a `TJ` over more than 65 lines (the 64 its fill pass finished, kept back, and the open one) stays a filled object and a stroked one for each part (#8543; estimates unchanged); PDF import: type filled and stroked after a page of type filled only (more than 64 lines) comes in as one filled and stroked type object again, with or without a path between, and a `TJ` over more lines than are kept with a glyph kept as an outline still stays a filled object and a stroked one for each part (#8549 follow-up; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | | M5 | Performance | 🟡 background render + caches + MT done; text thread overlays index repeated selection lookups, keeping the first lookup and singleton selections direct (#6543); `vectorcraft-cli bench` and `vectorcraft-cli perf` (budget suite); opaque solid-fill knockout paths draw once in hard-edge/supersampled raster export, with analytical-AA compositing unchanged; file format v2 opens 3× faster (50k paths: 722 → 244 ms); raster effects (glows, shadows, blur, feather) no longer force the whole frame single-threaded (filtered offscreen per effect, verified equal to the single-threaded reference); Craquelure/Mosaic Tiles/Stained Glass distance searches optimized with pixel-invariance checks and the `texture_drag_perf` probe (#1257); effect-heavy demos need a clean-machine benchmark; in the web build an edit while the view of a heavy document moves draws only the part it changed into the last frame (#8688); dirty-region rendering, GPU backend spike pending | 15–25 | | M6 | Path operations (Pathfinder, Shape Builder, offset…) | ✅ mostly done (live compound shapes: Make, Alt-click a Shape Mode, member modes, Release, Expand (#4522); single-result Pathfinder names and SVG IDs retained (#1293); Divide open-cutting-path geometry, appearance and history verified (#1307; existing segment cap remains); Simplify preview/counts and rewritten-path component selection verified (#1272; the slider opens at the Auto-Simplify level; a Direct Selection part of a path simplifies on its own); Compound appearance and member fill-rule edits verified (#1197); Boolean precision on almost-horizontal edges fixed and the property tests made deterministic; Shape Builder gap detection, large-offset bug open); Shape Builder Gap Detection shares Live Paint’s spatial gap finder and temporary merge bridges (#2526); Custom is capped at 72 pt in the existing options dialog | 3–6 | -| M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); 🟡 Retype phase 1: `type.retype` turns outlined text that exactly matches an available font back into point text (#4934), keeping even spacing as tracking and making stacked, aligned lines one area type object; Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders, vertical type pending | 45–60 | +| M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); 🟡 Retype phase 1: `type.retype` turns outlined text that exactly matches an available font back into point text (#4934), keeping even spacing as tracking and making stacked, aligned lines one area type object; Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders done (#1880); vertical type in progress (Type › Type Orientation, #5027) | 45–60 | | M8 | Transform & distort (Puppet Warp, Liquify tools, Envelopes, Blends, Perspective Grid) | ✅ done (M8.1–M8.20 on 2026-10-06, fidelity pass): Liquify Tool Options with one shared brush, pen pressure, hold-to-apply, a safe scope and incremental strokes; tool options that last; Puppet Warp rotation, multi-select, Control bar and a rest-shape session that follows Undo; Width tool on compound paths; Envelope dialogs with preview, Reset with Warp/Mesh, full Envelope Options, type/images/symbols/appearance/gradients/patterns distorted on canvas and in every export, warps that keep their frame, Edit Contents, mesh handles and Control bar; Blend Options, anchor-targeted Blend tool, editable spine, keys picked on the canvas, faithful interpolation and knockout; Anchor Point spine conversion/handle editing and selection priority (#2544), with #2425 Shift reshape preserved; Perspective Grid with Define Grid, presets, lock/snap/rulers, widgets, the 1–4 plane switch, movable planes, Perspective Selection scale/copy/perpendicular/Transform Again, and type and symbols truly projected with Edit Text. Left: Anti-Alias and Preserve Shape output, warp-envelope point editing, brush interpolation in blends, Free Transform/Scale/Reflect along a rotated box | 2–4 | -| M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders, vertical type pending | 45–60 | +| M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders done (#1880); vertical type in progress (Type › Type Orientation, #5027) | 45–60 | | M8 | Transform & distort (Puppet Warp, Liquify tools, Envelopes, Blends, Perspective Grid) | ✅ done (M8.1–M8.20 on 2026-10-06, fidelity pass): Liquify Tool Options with one shared brush, pen pressure, hold-to-apply, a safe scope and incremental strokes; tool options that last; Puppet Warp rotation, multi-select, Control bar and a rest-shape session that follows Undo; Width tool on compound paths; Envelope dialogs with preview, Reset with Warp/Mesh, full Envelope Options, type/images/symbols/appearance/gradients/patterns distorted on canvas and in every export, warps that keep their frame, Edit Contents, mesh handles and Control bar; Blend Options, anchor-targeted Blend tool, editable spine, keys picked on the canvas, faithful interpolation and knockout; Anchor Point spine conversion/handle editing and selection priority (#2544), with #2425 Shift reshape preserved; Perspective Grid with Define Grid, presets, lock/snap/rulers, widgets, the 1–4 plane switch, movable planes, Perspective Selection scale/copy/perpendicular/Transform Again, and type and symbols truly projected with Edit Text. Left: Anti-Alias and Preserve Shape output, warp-envelope point editing, brush interpolation in blends, Free Transform/Scale/Reflect along a rotated box; #5179 curved-spine redraw bounds include rotated keys and steps (two focused CPU regressions) | 2–4 | | M9 | Live effects (+ 3D & Materials) | 🟡 2D effects done incl. Effect → Pathfinder, Color Adjustments and Document Raster Effects Settings; PDF export warns when the pixel cap lowers raster-effect resolution; Artistic › Colored Pencil, Cutout, Dry Brush, Film Grain, Fresco, Neon Glow, Paint Daubs, Palette Knife, Poster Edges, Rough Pastels, Smudge Stick, Sponge, Underpainting and Watercolor and Sketch › Halftone Pattern, Bas Relief, Charcoal, Conté Crayon, Photocopy, Stamp, Torn Edges and Water Paper done (57/57 Photoshop filters); Revolve with automatic smooth vector shading, default-on circular caps and continuous rims, Extrude & Bevel, Inflate and Rotate with one to ten colored directional lights and four original lighting presets, a ring of overlapping faces broken at one of its own faces (#7023); SVG Filters, remaining raster effects and 3D materials and shadows pending | 81–130 | | M10 | Brushes, symbols, patterns, Repeat | 🟡 pattern swatches (5 tile types, Pattern Options, editing mode, SVG ``/PDF export) and live Repeat (radial/grid/mirror) done; interactive selected mirror axis implemented (focused and native checks passed; full CI blocked by an unrelated text test); symbol libraries done (Window › Symbol Libraries, six generated libraries (Basic Shapes, UI Frames, Map Markers, Inventory Icons, Skill Icons, Weather Icons), User Defined, Other Library…, Save Symbols); brush libraries done (Window › Brush Libraries, fifteen generated libraries including Tech Circuit, Decorative, Engraving, Arrows, Stipple, Pressure Sensitive, Ink and Wash, Bristle Brushes and Dry Media, User Defined, Other Library…, Save Brushes); symbol editing shows draggable 9-slice guides (#5280), with guides outside the artwork still unsupported; brushes/symbols in progress | 23–37 | From 970b34a7276e4257719dbbb6b138637f1aa30c93 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 29 Nov 2026 22:04:23 -0500 Subject: [PATCH 058/105] feat(nightly): wire craft-nightly for self-isolated direct launch (#10088) * feat(nightly): wire craft-nightly for self-isolated direct launch * fix(nightly): answer plain version before resolving profile root * test(nightly): retain exact version and saved profile coverage --- Cargo.lock | 9 + Cargo.toml | 2 + apps/vectorcraft/Cargo.toml | 1 + apps/vectorcraft/src/build_flavor.rs | 64 +- apps/vectorcraft/src/launch_profile.rs | 285 +++------ apps/vectorcraft/src/main.rs | 76 +-- apps/vectorcraft/src/profile_root.rs | 783 ++++++------------------ apps/vectorcraft/src/single_instance.rs | 4 +- 8 files changed, 315 insertions(+), 909 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3cb674e4ae..4fce3ecad1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1816,6 +1816,14 @@ dependencies = [ "encoding_rs", ] +[[package]] +name = "craft-nightly" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=1f6c3a21f85ed96f8fd4ddd5a959d4e1edbedb24#1f6c3a21f85ed96f8fd4ddd5a959d4e1edbedb24" +dependencies = [ + "winsafe", +] + [[package]] name = "craft-pages" version = "0.1.0" @@ -8522,6 +8530,7 @@ dependencies = [ "chrono", "clipboard-win", "craft", + "craft-nightly", "eframe", "egui", "egui_extras", diff --git a/Cargo.toml b/Cargo.toml index 7ad3e4cfeb..cc76d129c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,6 +53,8 @@ craft = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +# Nightly profile isolation, launch protocol, and security fence. +craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "1f6c3a21f85ed96f8fd4ddd5a959d4e1edbedb24" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } diff --git a/apps/vectorcraft/Cargo.toml b/apps/vectorcraft/Cargo.toml index d17c96eaf7..3ec7da1b75 100644 --- a/apps/vectorcraft/Cargo.toml +++ b/apps/vectorcraft/Cargo.toml @@ -22,6 +22,7 @@ vectorcraft-text = { workspace = true } # frame policy and placement store (so VectorCraft matches the rest on Linux, see #217), printing and # the update client. craft = { workspace = true, features = ["ui", "ui-app", "settings", "automation", "platform", "window", "dialogs", "print", "update"] } +craft-nightly = { workspace = true } eframe = { workspace = true, features = ["clipboard", "default_fonts", "wayland", "x11"] } egui = { workspace = true } egui_extras = { workspace = true } diff --git a/apps/vectorcraft/src/build_flavor.rs b/apps/vectorcraft/src/build_flavor.rs index 9450a48972..93876b5cce 100644 --- a/apps/vectorcraft/src/build_flavor.rs +++ b/apps/vectorcraft/src/build_flavor.rs @@ -1,30 +1,13 @@ //! Build-time channel is distinct from a launch selector. A runtime environment cannot promote a -//! stable build, and a nightly build refuses to start without its profile. -use crate::launch_profile::Profile; -use std::ffi::OsString; +//! stable build, and a nightly build self-isolates into its canonical nightly profile root (or the +//! profile root supplied by ArtCraft Launcher). -#[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum BuildFlavor { - Stable, - NightlyV1, -} +pub use craft_nightly::BuildFlavor; pub const COMPILED: BuildFlavor = if cfg!(vectorcraft_nightly_v1) { BuildFlavor::NightlyV1 } else { BuildFlavor::Stable }; -pub fn require_profile(flavor: BuildFlavor, profile: &Profile) -> Result<(), String> { - match (flavor, profile.is_nightly()) { - (BuildFlavor::NightlyV1, false) => Err("Open VectorCraft Nightly from ArtCraft Launcher".to_string()), - (BuildFlavor::Stable, true) => Err("This is a stable VectorCraft build; nightly-v1 requires the nightly build".to_string()), - _ => Ok(()), - } -} - -pub fn needs_native_error(flavor: BuildFlavor, desktop_session: bool) -> bool { - desktop_session && flavor == BuildFlavor::NightlyV1 -} - -/// `--version` and `-V` on their own, before any other argument is read. -pub fn version_query(args: &[OsString]) -> bool { +/// An exact plain version query, before resolving any profile or environment paths. +pub fn version_query(args: &[std::ffi::OsString]) -> bool { matches!(args, [arg] if arg == "--version" || arg == "-V") } @@ -37,40 +20,19 @@ pub fn version(flavor: BuildFlavor, stable: &str) -> String { #[cfg(test)] mod tests { - use super::*; + use super::{BuildFlavor, version, version_query}; #[test] - fn only_a_nightly_desktop_refusal_requests_a_native_dialog() { - assert!(needs_native_error(BuildFlavor::NightlyV1, true)); - assert!(!needs_native_error(BuildFlavor::NightlyV1, false)); - assert!(!needs_native_error(BuildFlavor::Stable, true)); - assert!(!needs_native_error(BuildFlavor::Stable, false)); - } - - #[test] - fn nightly_build_without_a_profile_is_refused_before_startup() { - let started = std::cell::Cell::new(false); - let result = require_profile(BuildFlavor::NightlyV1, &Profile::Stable).map(|()| started.set(true)); - assert!(result.unwrap_err().contains("ArtCraft Launcher")); - assert!(!started.get()); - } - - #[test] - fn stable_and_nightly_flavors_accept_only_their_own_profile() { - let nightly = Profile::NightlyV1(std::path::PathBuf::from("already validated root")); - assert!(require_profile(BuildFlavor::Stable, &Profile::Stable).is_ok()); - assert!(require_profile(BuildFlavor::Stable, &nightly).is_err()); - assert!(require_profile(BuildFlavor::NightlyV1, &nightly).is_ok()); - assert!(require_profile(BuildFlavor::NightlyV1, &Profile::Stable).is_err()); - } - - #[test] - fn nightly_version_query_is_unambiguous_and_never_reinterprets_file_arguments() { - assert_eq!(version(BuildFlavor::Stable, "0.24.1"), "0.24.1"); - assert_eq!(version(BuildFlavor::NightlyV1, "0.24.1"), "0.24.1 (nightly-v1)"); + fn plain_version_query_is_exact() { assert!(version_query(&["--version".into()])); assert!(version_query(&["-V".into()])); assert!(!version_query(&["--".into(), "--version".into()])); assert!(!version_query(&[])); } + + #[test] + fn version_labels_nightly_without_changing_stable() { + assert_eq!(version(BuildFlavor::Stable, "0.24.1"), "0.24.1"); + assert_eq!(version(BuildFlavor::NightlyV1, "0.24.1"), "0.24.1 (nightly-v1)"); + } } diff --git a/apps/vectorcraft/src/launch_profile.rs b/apps/vectorcraft/src/launch_profile.rs index 12615dd81d..d986f28d71 100644 --- a/apps/vectorcraft/src/launch_profile.rs +++ b/apps/vectorcraft/src/launch_profile.rs @@ -1,130 +1,28 @@ -//! Launcher-owned nightly-v1 bootstrap. Selected before logging, updates, fonts or saved state. -//! Stable launches retain their original arguments and directory policy. -//! -//! The protocol is `vectorcraft --launch-profile nightly-v1 --profile-root -- [files…]`: the -//! selector and the root are separate tokens, exactly once each, and everything after `--` is a file -//! even when it looks like one of them. The Launcher's version check -//! (`… --version`) is answered before the root is validated or touched. +//! Nightly-v1 bootstrap backed by [`craft_nightly`]. Selected before logging, updates, fonts or +//! saved state. Stable launches retain their original arguments and directory policy; direct +//! nightly launches self-isolate into [`craft_nightly::canonical_profile_root`], while ArtCraft +//! Launcher can supply `--launch-profile nightly-v1 --profile-root -- [args…]`. use std::ffi::OsString; -use std::path::{Component, Path, PathBuf}; -use std::sync::OnceLock; -pub const VERSION: &str = "nightly-v1"; +pub use craft_nightly::NIGHTLY_V1_CONTRACT as VERSION; +use craft_nightly::{BuildFlavor, Launch, Profile, ProfileError, StartupOptions}; -#[derive(Clone, Debug, PartialEq, Eq)] -pub enum Profile { - Stable, - NightlyV1(PathBuf), -} - -impl Profile { - pub fn is_nightly(&self) -> bool { - matches!(self, Self::NightlyV1(_)) - } - - pub fn root(&self) -> Option<&Path> { - match self { - Self::Stable => None, - Self::NightlyV1(root) => Some(root), - } - } -} - -#[derive(Debug, PartialEq, Eq)] -pub struct Launch { - pub profile: Profile, - pub args: Vec, -} - -static PROFILE: OnceLock = OnceLock::new(); +static STABLE: Profile = Profile::Stable; pub fn current() -> &'static Profile { - PROFILE.get().unwrap_or(&Profile::Stable) + craft_nightly::current().unwrap_or(&STABLE) } -pub fn install(profile: Profile) -> Result<(), String> { - PROFILE.set(profile).map_err(|_| "the launch profile was already selected".to_string()) -} - -/// Recognize only the agreed literal selector/root pair before `--`. No filesystem or startup hook -/// runs here. -pub fn parse(args: Vec) -> Result { - let mut selector = None; - let mut root = None; - let mut other = Vec::new(); - let mut files = Vec::new(); - let mut iter = args.iter(); - let mut delimiter = false; - while let Some(arg) = iter.next() { - if arg == "--" { - delimiter = true; - files.extend(iter.cloned()); - break; - } - if arg == "--launch-profile" || arg == "--profile-root" { - let slot = if arg == "--launch-profile" { &mut selector } else { &mut root }; - if slot.is_some() { - return Err("the profile selector and root must each occur exactly once".to_string()); - } - let value = iter.next().filter(|v| !v.is_empty()).ok_or_else(|| "the profile selector/root needs a value".to_string())?; - if value.to_string_lossy().starts_with("--") { - return Err("the profile selector/root needs a value".to_string()); - } - *slot = Some(value.clone()); - } else if arg.to_string_lossy().starts_with("--launch-profile=") || arg.to_string_lossy().starts_with("--profile-root=") { - return Err("the nightly protocol requires separate literal selector/root argument tokens".to_string()); - } else { - other.push(arg.clone()); - } - } - match (selector, root) { - (None, None) => Ok(Launch { profile: Profile::Stable, args }), - (Some(version), Some(root)) if version == VERSION => { - if !delimiter || !other.is_empty() { - return Err("nightly-v1 accepts only its selector/root followed by -- and file names".to_string()); - } - let root = PathBuf::from(root); - if !root.is_absolute() || root.components().any(|c| matches!(c, Component::ParentDir)) { - return Err("the nightly profile root must be absolute and contain no parent traversal".to_string()); - } - Ok(Launch { profile: Profile::NightlyV1(root), args: std::iter::once(OsString::from("--")).chain(files).collect() }) - } - (Some(_), Some(_)) => Err("unsupported launch profile (expected nightly-v1)".to_string()), - _ => Err("--launch-profile and --profile-root must be supplied together".to_string()), - } -} - -/// The Launcher's version check: the selector/root pair followed by exactly `--version` (or `-V`), -/// answered like a plain version query. Only [`parse`]'s lexical checks apply; the root is never -/// validated or touched, and `-- --version` stays a file name. -pub fn version_query(args: &[OsString]) -> bool { - let Some((last, pair)) = args.split_last() else { return false }; - if last != "--version" && last != "-V" { - return false; - } - let lexical = pair.iter().cloned().chain(std::iter::once(OsString::from("--"))).collect(); - matches!(parse(lexical), Ok(Launch { profile: Profile::NightlyV1(_), args }) if args.len() == 1) -} - -/// Validation finishes before the caller's first startup effect. Stable never calls the nightly root -/// validator, so its portable and config resolution stays unchanged. -pub fn prepare(mut launch: Launch, validate: impl FnOnce(&Path) -> Result) -> Result { - if let Profile::NightlyV1(root) = &launch.profile { - launch.profile = Profile::NightlyV1(validate(root)?); - } - Ok(launch) -} - -/// Resolve the selected private root before the caller's first startup effect. -pub fn validate_root(root: &Path, env: impl Fn(&str) -> Option, exe: Option<&Path>) -> Result { - crate::profile_root::validate(root, env, exe, crate::prefs_dir::profile::ensure_writable) +pub fn prepare_launch(flavor: BuildFlavor, args: impl IntoIterator) -> Result { + let spec = crate::profile_root::app_profile_spec(); + craft_nightly::prepare_launch(flavor, &spec, args, &StartupOptions::default()) } /// The arguments a child of this process starts with: a nightly launch hands its profile on, so the -/// child opens the same private profile instead of being refused ("Open VectorCraft Nightly…"), and -/// `--` keeps a file whose name starts with '-' a file. Stable's child arguments are unchanged. -/// Only `single_instance` starts a child, and macOS does not build it. +/// child opens the same private profile, and `--` keeps a file whose name starts with '-' a file. +/// Stable's child arguments are unchanged. Only `single_instance` starts a child, and macOS does +/// not build it. #[cfg(not(target_os = "macos"))] pub fn child_args(files: &[String]) -> Vec { child_args_for(current(), files) @@ -132,21 +30,24 @@ pub fn child_args(files: &[String]) -> Vec { #[cfg(not(target_os = "macos"))] fn child_args_for(profile: &Profile, files: &[String]) -> Vec { - let mut args: Vec = match profile { - Profile::Stable => Vec::new(), - Profile::NightlyV1(root) => { - vec![OsString::from("--launch-profile"), OsString::from(VERSION), OsString::from("--profile-root"), root.clone().into_os_string()] - } - }; - args.push(OsString::from("--")); - args.extend(files.iter().map(OsString::from)); - args + let delimited: Vec = std::iter::once(OsString::from("--")).chain(files.iter().map(OsString::from)).collect(); + match profile { + Profile::Stable => delimited, + Profile::NightlyV1(root) => craft_nightly::launch_arguments(root, &delimited), + } } #[cfg(test)] mod tests { - use super::*; - use std::cell::Cell; + use std::ffi::OsString; + use std::path::PathBuf; + + use craft_nightly::{BuildFlavor, Profile, ProfileError, StartupOptions, canonical_profile_root, parse_startup}; + + use super::VERSION; + #[cfg(not(target_os = "macos"))] + use super::child_args_for; + use crate::profile_root::app_profile_spec; fn args(values: &[&str]) -> Vec { values.iter().map(OsString::from).collect() @@ -156,95 +57,72 @@ mod tests { if cfg!(windows) { r"C:\NightlyData\profiles\vectorcraft" } else { "/nightly-data/profiles/vectorcraft" } } - fn nightly() -> Vec { - args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--"]) - } - #[test] - fn stable_arguments_and_directory_policy_are_unchanged() { + fn stable_arguments_are_unchanged_and_nightly_flags_are_refused() { + let spec = app_profile_spec(); for argv in [args(&[]), args(&["--new-instance", "a.svg"]), args(&["--", "--launch-profile", "file.svg"])] { - let launch = prepare(parse(argv.clone()).unwrap(), |_| panic!("stable must never validate a nightly root")).unwrap(); - assert_eq!(launch, Launch { profile: Profile::Stable, args: argv }); + let launch = parse_startup(BuildFlavor::Stable, &spec, argv.clone(), &StartupOptions::default()).unwrap(); + assert_eq!(launch.profile, Profile::Stable); + assert_eq!(launch.passthrough_args, argv); } + + let nightly_flags = args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--"]); + let err = parse_startup(BuildFlavor::Stable, &spec, nightly_flags, &StartupOptions::default()).unwrap_err(); + assert!(matches!(err, ProfileError::NightlyFlagsInStableBuild)); } #[test] - fn exact_version_and_root_are_parsed_without_reinterpreting_file_names() { - let mut argv = nightly(); - argv.extend(args(&["--profile-root", "art with spaces.svg"])); - let launch = parse(argv).unwrap(); + fn nightly_direct_launch_self_isolates_into_canonical_profile_root() { + let spec = app_profile_spec(); + let expected_root = canonical_profile_root("vectorcraft").unwrap(); + + let empty = parse_startup(BuildFlavor::NightlyV1, &spec, Vec::new(), &StartupOptions::default()).unwrap(); + assert_eq!(empty.profile, Profile::NightlyV1(expected_root.clone())); + assert!(empty.passthrough_args.is_empty()); + + let with_args = parse_startup(BuildFlavor::NightlyV1, &spec, args(&["--safe-mode", "art.svg"]), &StartupOptions::default()).unwrap(); + assert_eq!(with_args.profile, Profile::NightlyV1(expected_root)); + assert_eq!(with_args.passthrough_args, args(&["--safe-mode", "art.svg"])); + } + + #[test] + fn explicit_launcher_arguments_preserve_profile_root_and_user_args() { + let spec = app_profile_spec(); + let argv = args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--", "--profile-root", "art with spaces.svg"]); + let launch = parse_startup(BuildFlavor::NightlyV1, &spec, argv, &StartupOptions::default()).unwrap(); assert_eq!(launch.profile, Profile::NightlyV1(PathBuf::from(absolute()))); - assert_eq!(launch.args, args(&["--", "--profile-root", "art with spaces.svg"])); + assert_eq!(launch.passthrough_args, args(&["--profile-root", "art with spaces.svg"])); } #[test] - fn missing_duplicate_unknown_and_conflicting_profile_arguments_are_refused() { - for argv in [ - args(&["--launch-profile", VERSION]), - args(&["--profile-root", absolute()]), - args(&["--launch-profile", "future-v2", "--profile-root", absolute(), "--"]), - args(&["--launch-profile", VERSION, "--launch-profile", VERSION, "--profile-root", absolute(), "--"]), - args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--profile-root", absolute(), "--"]), - args(&["--launch-profile", VERSION, "--profile-root", "relative", "--"]), - args(&["--launch-profile", VERSION, "--profile-root", "../escape", "--"]), - args(&["--launch-profile", VERSION, "--profile-root", "", "--"]), - args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--new-instance", "--"]), - args(&["--launch-profile", VERSION, "--profile-root", absolute()]), - ] { - assert!(parse(argv.clone()).is_err(), "{argv:?}"); - } - } - - #[test] - fn the_launcher_version_check_is_a_version_query_only_in_its_exact_form() { - let pair = &["--launch-profile", VERSION, "--profile-root", absolute()]; - let reversed = &["--profile-root", absolute(), "--launch-profile", VERSION]; + fn version_queries_are_recognized_plain_and_via_launcher() { + let spec = app_profile_spec(); for flag in ["--version", "-V"] { - for form in [pair, reversed] { - let mut argv = args(form); - argv.push(flag.into()); - assert!(version_query(&argv), "{argv:?}"); + for argv in [ + args(&[flag]), + args(&["--launch-profile", VERSION, "--profile-root", absolute(), flag]), + args(&["--profile-root", absolute(), "--launch-profile", VERSION, flag]), + args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--", flag]), + ] { + let launch = parse_startup(BuildFlavor::NightlyV1, &spec, argv.clone(), &StartupOptions::default()).unwrap(); + assert!(launch.is_version_query(), "{argv:?}"); } } - for argv in [ - args(&["--version"]), - args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--", "--version"]), - args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--version", "--"]), - args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--new-instance", "--version"]), - args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--version", "--version"]), - args(&["--version", "--launch-profile", VERSION, "--profile-root", absolute()]), - args(&["--launch-profile", "future-v2", "--profile-root", absolute(), "--version"]), - args(&["--launch-profile", VERSION, "--profile-root", "relative", "--version"]), - args(&["--launch-profile", VERSION, "--version"]), - args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--help"]), - ] { - assert!(!version_query(&argv), "{argv:?}"); - } - // Outside the query the strict protocol still refuses the version flag. - assert!(parse(args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--version"])).is_err()); } #[test] - fn failed_root_validation_never_reaches_startup_or_falls_back_to_stable() { - let reached = Cell::new(false); - let result = prepare(parse(nightly()).unwrap(), |_| Err("read-only or unsafe profile".to_string())).map(|_| reached.set(true)); - assert!(result.is_err()); - assert!(!reached.get()); - } - - #[test] - fn successful_root_validation_keeps_the_persistent_root_not_the_binary_tag() { - let checked = PathBuf::from(absolute()).join("checked"); - let launch = prepare(parse(nightly()).unwrap(), |_| Ok(checked.clone())).unwrap(); - assert_eq!(launch.profile.root(), Some(checked.as_path())); - assert!(launch.profile.is_nightly()); - } - - #[test] - fn a_joined_flag_form_is_refused() { - for joined in [format!("--launch-profile={VERSION}"), format!("--profile-root={}", absolute())] { - let argv = vec![OsString::from(joined), OsString::from("--")]; - assert!(parse(argv).is_err()); + fn version_and_document_arguments_are_not_a_version_only_query() { + let spec = app_profile_spec(); + for flag in ["--version", "-V"] { + for argv in [ + args(&[flag, "art with spaces.svg"]), + args(&["--launch-profile", VERSION, "--profile-root", absolute(), flag, "art with spaces.svg"]), + args(&["--profile-root", absolute(), "--launch-profile", VERSION, flag, "art with spaces.svg"]), + ] { + let launch = parse_startup(BuildFlavor::NightlyV1, &spec, argv, &StartupOptions::default()).unwrap(); + assert!(!launch.is_version_query()); + assert_eq!(launch.passthrough_args, args(&[flag, "art with spaces.svg"])); + } } } @@ -258,6 +136,7 @@ mod tests { #[cfg(not(target_os = "macos"))] #[test] fn a_nightly_child_inherits_the_selected_profile() { + let spec = app_profile_spec(); let root = PathBuf::from(absolute()); let child = child_args_for(&Profile::NightlyV1(root.clone()), &["art.svg".to_string()]); let expected = vec![ @@ -266,12 +145,12 @@ mod tests { OsString::from("--profile-root"), root.into_os_string(), OsString::from("--"), + OsString::from("--"), OsString::from("art.svg"), ]; assert_eq!(child, expected); - // The child's own parse finds the same profile and the file list. - let launch = parse(child).unwrap(); + let launch = parse_startup(BuildFlavor::NightlyV1, &spec, child, &StartupOptions::default()).unwrap(); assert!(launch.profile.is_nightly()); - assert_eq!(launch.args, args(&["--", "art.svg"])); + assert_eq!(launch.passthrough_args, args(&["--", "art.svg"])); } } diff --git a/apps/vectorcraft/src/main.rs b/apps/vectorcraft/src/main.rs index 5a7d3e33ba..601cda01bb 100644 --- a/apps/vectorcraft/src/main.rs +++ b/apps/vectorcraft/src/main.rs @@ -384,58 +384,47 @@ fn channel_name() -> &'static str { /// Says why a nightly launch was refused, then exits 2. A window could not have shown it yet: this /// app has no message box of its own before eframe starts (its dialogs are egui windows), so the -/// text goes to standard error, which a Launcher launch records. The desktop-session test still -/// decides whether a daily user would have seen it, for the message's wording. +/// text goes to standard error, which a Launcher launch records. fn report_launch_profile_error(error: &str) { eprintln!("VectorCraft launch profile: {error}"); - let desktop_session = cfg!(windows) - || cfg!(target_os = "macos") - || (cfg!(target_os = "linux") && ["DISPLAY", "WAYLAND_DISPLAY"].into_iter().any(|key| std::env::var_os(key).is_some_and(|v| !v.is_empty()))); - if build_flavor::needs_native_error(build_flavor::COMPILED, desktop_session) { - eprintln!("VectorCraft Nightly: open it from ArtCraft Launcher, which starts it in its own profile"); - } +} + +fn write_nightly_version() { + use std::io::Write as _; + let line = format!("VectorCraft {}\n", build_flavor::version(build_flavor::COMPILED, env!("VECTORCRAFT_BUILT_VERSION"))); + let _ = std::io::stdout().write_all(line.as_bytes()); } /// Selects the immutable launch profile before any startup service or side effect, and returns the /// arguments the rest of `main` reads. `None` means the process ends here (`--version` answered). fn prepare_launch() -> Option> { - // The trusted Launcher protocol is decided before the logger, updates, fonts or any saved state. + // The launch profile is decided before the logger, updates, fonts or any saved state. let argv: Vec<_> = std::env::args_os().skip(1).collect(); - // A nightly answers its version before root validation, process identity, IPC or any window: - // plain `--version`/`-V`, or the Launcher's `--launch-profile nightly-v1 --profile-root - // --version`. A stable build leaves the answer to `read_command_line`, exactly as before. - if build_flavor::COMPILED == build_flavor::BuildFlavor::NightlyV1 && (build_flavor::version_query(&argv) || launch_profile::version_query(&argv)) - { - use std::io::Write as _; - let line = format!("VectorCraft {}\n", build_flavor::version(build_flavor::COMPILED, env!("VECTORCRAFT_BUILT_VERSION"))); - let _ = std::io::stdout().write_all(line.as_bytes()); + // A plain nightly version query does not even need the OS home/data root to resolve. + if build_flavor::COMPILED == build_flavor::BuildFlavor::NightlyV1 && build_flavor::version_query(&argv) { + write_nightly_version(); + return None; + } + let early = launch_profile::prepare_launch(build_flavor::COMPILED, argv).unwrap_or_else(|error| { + report_launch_profile_error(&error.to_string()); + std::process::exit(2) + }); + // A launcher version query also exits before process identity, IPC or any window. + // `craft_nightly::prepare_launch` skips root preparation for version queries. + // A stable build leaves the answer to `read_command_line`, exactly as before. + if build_flavor::COMPILED == build_flavor::BuildFlavor::NightlyV1 && early.is_version_query() { + write_nightly_version(); return None; } - let early = launch_profile::parse(argv) - .and_then(|launch| { - build_flavor::require_profile(build_flavor::COMPILED, &launch.profile)?; - Ok(launch) - }) - .and_then(|launch| { - launch_profile::prepare(launch, |root| { - launch_profile::validate_root(root, |key| std::env::var_os(key), std::env::current_exe().ok().as_deref()) - }) - }) - .unwrap_or_else(|error| { - report_launch_profile_error(&error); - std::process::exit(2) - }); let nightly = early.profile.is_nightly(); let identity = if nightly { vectorcraft_ui_egui::os_window::LaunchIdentity::NightlyV1 } else { vectorcraft_ui_egui::os_window::LaunchIdentity::Stable }; - let install = launch_profile::install(early.profile).and_then(|()| { - // Every data path follows the selected profile from here on: settings, logs, recovery, the - // user's libraries, plug-ins, caches and the single-instance record. - if let Some(root) = launch_profile::current().root() { - prefs_dir::profile::install_data_root(root.to_path_buf())?; - } - vectorcraft_ui_egui::os_window::select_identity(identity) - }); + // Every data path follows the selected profile from here on: settings, logs, recovery, the + // user's libraries, plug-ins, caches and the single-instance record. + let install = launch_profile::current() + .root() + .map_or(Ok(()), |root| prefs_dir::profile::install_data_root(root.to_path_buf())) + .and_then(|()| vectorcraft_ui_egui::os_window::select_identity(identity)); if let Err(error) = install { report_launch_profile_error(&error); std::process::exit(2); @@ -453,11 +442,11 @@ fn prepare_launch() -> Option> { // The window's identity, not the profile, failed: main's own failure status (1). std::process::exit(1); } - Some(early.args) + Some(early.passthrough_args) } /// The arguments the rest of `main` reads: a nightly's profile tokens were consumed by -/// `prepare_launch`, so what is left is `--` and the files to open. A stable launch reads its +/// `prepare_launch`, leaving any user flags and files to open. A stable launch reads its /// arguments exactly as it always did. fn launch_arguments(nightly: bool, arguments: &[std::ffi::OsString]) -> Vec { if nightly { arguments.iter().map(|a| a.to_string_lossy().into_owned()).collect() } else { std::env::args().skip(1).collect() } @@ -520,8 +509,9 @@ fn finish_pending_update(nightly: bool) { } fn main() -> std::process::ExitCode { - // The launch profile first: a nightly build without one is refused here, before the update - // helper, the logger, fonts or any saved state, and `--version` is answered here too. + // The launch profile first: a nightly build self-isolates or uses the Launcher's profile here, + // before the update helper, the logger, fonts or any saved state, and `--version` is answered + // here too. let Some(arguments) = prepare_launch() else { return std::process::ExitCode::SUCCESS }; let nightly = launch_profile::current().is_nightly(); #[cfg(windows)] diff --git a/apps/vectorcraft/src/profile_root.rs b/apps/vectorcraft/src/profile_root.rs index 7f46e77766..d5ae707a17 100644 --- a/apps/vectorcraft/src/profile_root.rs +++ b/apps/vectorcraft/src/profile_root.rs @@ -1,264 +1,17 @@ -//! App-owned nightly profile fences: a profile every one of VectorCraft's data paths is redirected -//! into ([`crate::prefs_dir::profile::install_data_root`]), and that never overlaps stable's folders, a portable -//! copy or an installation. +//! App-owned nightly profile specification for [`craft_nightly`]: describes VectorCraft's stable +//! directories, forbidden environment variables, portable markers, folder-only profile entries, and +//! extra installation/package boundaries so a nightly profile never overlaps stable state. use std::ffi::OsString; -use std::path::{Component, Path, PathBuf}; +use std::path::{Path, PathBuf}; -use crate::prefs_dir::profile::PORTABLE_DATA_DIR; +use craft_nightly::AppProfileSpec; -#[derive(Clone, Copy, Debug, PartialEq, Eq)] -enum Platform { - Windows, - Linux, - Mac, -} +use crate::prefs_dir::profile::{PORTABLE_DATA_DIR, PORTABLE_MARKERS}; -impl Platform { - fn current() -> Result { - match std::env::consts::OS { - "windows" => Ok(Self::Windows), - "linux" => Ok(Self::Linux), - "macos" => Ok(Self::Mac), - other => Err(format!("nightly-v1 is not defined for this operating system ({other})")), - } - } +const STABLE_DIR_NAMES: [&str; 2] = ["VectorCraft", "vectorcraft"]; - fn ignores_case(self) -> bool { - self != Self::Linux - } -} - -fn absolute(path: PathBuf, label: &str) -> Result { - if !path.is_absolute() || path.components().any(|c| matches!(c, Component::ParentDir)) { - return Err(format!("{label} must be absolute and contain no parent traversal")); - } - Ok(path) -} - -fn required_base(env: &impl Fn(&str) -> Option, key: &str) -> Result { - let value = env(key).filter(|v| !v.is_empty()).ok_or_else(|| format!("cannot establish the stable {key} boundary"))?; - absolute(PathBuf::from(value), key) -} - -fn xdg_base(env: &impl Fn(&str) -> Option, key: &str, fallback: &str) -> Result { - match env(key).filter(|v| !v.is_empty()) { - Some(value) => absolute(PathBuf::from(value), key), - None => Ok(required_base(env, "HOME")?.join(fallback)), - } -} - -/// Resolve existing ancestors before creating anything. A dangling link or an inaccessible ancestor -/// is not a missing directory that may be replaced or followed later. -fn canonical_future(path: &Path) -> Result { - let mut parent = path; - let mut missing = Vec::new(); - loop { - match std::fs::symlink_metadata(parent) { - Ok(_) => break, - Err(error) if error.kind() == std::io::ErrorKind::NotFound => { - missing.push(parent.file_name().ok_or_else(|| "the profile root has no existing ancestor".to_string())?.to_os_string()); - parent = parent.parent().ok_or_else(|| "the profile root has no existing ancestor".to_string())?; - } - Err(error) => return Err(format!("cannot inspect the profile boundary: {error}")), - } - } - let mut resolved = std::fs::canonicalize(parent).map_err(|e| format!("cannot resolve the profile boundary: {e}"))?; - for part in missing.into_iter().rev() { - resolved.push(part); - } - Ok(resolved) -} - -/// A stable entry point may be a dangling link once its target is uninstalled. Its own name is still -/// the fence, so only the folder it lives in is resolved: a link that cannot be resolved would refuse -/// every launch, a valid private profile included. -fn canonical_future_entry(path: &Path) -> Result { - let parent = path.parent().ok_or_else(|| "an entry point has no folder".to_string())?; - let name = path.file_name().ok_or_else(|| "an entry point has no name".to_string())?; - Ok(canonical_future(parent)?.join(name)) -} - -fn overlaps(a: &Path, b: &Path, platform: Platform) -> bool { - let parts = |p: &Path| { - p.components() - .map(|c| { - let value = c.as_os_str().to_string_lossy().into_owned(); - if platform.ignores_case() { value.to_lowercase() } else { value } - }) - .collect::>() - }; - let (a, b) = (parts(a), parts(b)); - a.starts_with(&b) || b.starts_with(&a) -} - -fn installation_boundary(platform: Platform, exe: &Path) -> Result { - let parent = exe.parent().ok_or_else(|| "cannot establish the installation boundary".to_string())?; - if platform == Platform::Mac { - // A profile in Resources is still inside the versioned install, not beside MacOS. - if let Some(bundle) = exe.ancestors().find(|p| p.extension().is_some_and(|ext| ext.eq_ignore_ascii_case("app"))) { - return Ok(bundle.to_path_buf()); - } - } - Ok(parent.to_path_buf()) -} - -/// Every folder a stable VectorCraft keeps user state in, on `platform`: the settings folder each -/// platform convention and the portable layout use, the eframe window state, the logs, the recovery -/// copies, the plug-ins, the caches, the install folders and the entry points. A nightly profile that -/// overlapped any of them would read, rewrite or prune stable's own state. -fn forbidden_roots(platform: Platform, env: &impl Fn(&str) -> Option, exe: &Path) -> Result, String> { - let mut roots = match platform { - Platform::Windows => { - // The settings folder (`profile.rs`) and the eframe window state, which eframe puts under - // `%APPDATA%\ai.storyteller.vectorcraft\data` (the window id). - let mut roots = ["APPDATA", "LOCALAPPDATA"] - .into_iter() - .map(|key| required_base(env, key).map(|p| p.join("VectorCraft"))) - .collect::, _>>()?; - roots.push(required_base(env, "APPDATA")?.join("ai.storyteller.vectorcraft")); - // The MSI's default per-user and per-machine folders (install-policy.wxi). A custom - // install folder is not known here; the executable's own folder is fenced below. - roots.push(required_base(env, "LOCALAPPDATA")?.join("Programs").join("ArtCraft").join("VectorCraft")); - for key in ["ProgramW6432", "ProgramFiles", "ProgramFiles(x86)"] { - if let Some(base) = env(key).filter(|v| !v.is_empty()) { - roots.push(absolute(PathBuf::from(base), key)?.join("ArtCraft").join("VectorCraft")); - } - } - roots - } - Platform::Linux => { - let mut roots = - [("XDG_CONFIG_HOME", ".config"), ("XDG_DATA_HOME", ".local/share"), ("XDG_CACHE_HOME", ".cache"), ("XDG_STATE_HOME", ".local/state")] - .into_iter() - .map(|(key, fallback)| xdg_base(env, key, fallback).map(|p| p.join("vectorcraft"))) - .collect::, _>>()?; - // The eframe window state, under the lowercased window id. - roots.push(xdg_base(env, "XDG_DATA_HOME", ".local/share")?.join("ai.storyteller.vectorcraft")); - roots.push(required_base(env, "HOME")?.join(".config").join("VectorCraft")); - // The same folders at their HOME defaults: an XDG override moves this launch's own paths, - // not stable's, which stays where a launch without the override finds it. - for (directory, app) in - [(".config", "vectorcraft"), (".local/share", "vectorcraft"), (".cache", "vectorcraft"), (".local/state", "vectorcraft")] - { - roots.push(required_base(env, "HOME")?.join(directory).join(app)); - } - // The stable Flatpak keeps its data in its own per-app folder. - roots.push(required_base(env, "HOME")?.join(".var/app/ai.storyteller.vectorcraft")); - roots - } - Platform::Mac => { - let home = required_base(env, "HOME")?; - let library = home.join("Library"); - vec![ - library.join("Application Support/VectorCraft"), - library.join("Application Support/ai.storyteller.vectorcraft"), - library.join("Caches/VectorCraft"), - library.join("Caches/ai.storyteller.vectorcraft"), - library.join("Preferences/VectorCraft"), - library.join("Preferences/ai.storyteller.vectorcraft.plist"), - library.join("Saved Application State/ai.storyteller.vectorcraft.savedState"), - home.join("Applications/VectorCraft.app"), - PathBuf::from("/Applications/VectorCraft.app"), - ] - } - }; - roots.push(installation_boundary(platform, exe)?); - let mut fences = roots.into_iter().map(|p| canonical_future(&p)).collect::, _>>()?; - if platform == Platform::Linux { - for entry in ["/usr/bin/vectorcraft", "/usr/local/bin/vectorcraft", "/opt/vectorcraft"] { - fences.push(canonical_future_entry(Path::new(entry))?); - } - } - Ok(fences) -} - -fn private_subdirectory(root: &Path, name: impl AsRef, label: &str) -> Result { - let chosen = canonical_future(&absolute(root.to_path_buf(), "the nightly profile root")?)?; - let target = chosen.join(name); - match std::fs::symlink_metadata(&target) { - Ok(metadata) if !metadata.is_dir() => { - return Err(format!("the nightly {label} must be a directory inside its selected profile")); - } - Ok(_) => {} - Err(error) if error.kind() == std::io::ErrorKind::NotFound => {} - Err(error) => return Err(format!("cannot inspect the nightly {label}: {error}")), - } - let child = canonical_future(&target)?; - if child == chosen || !child.starts_with(&chosen) { - return Err(format!("the nightly {label} must stay inside its selected profile")); - } - Ok(child) -} - -/// Every existing entry directly in the profile (settings, logs, the user's libraries and so on) must -/// resolve inside it, so a link there cannot point Nightly's writes at another app's data. -fn entries_stay_inside(root: &Path) -> Result<(), String> { - let entries = match std::fs::read_dir(root) { - Ok(entries) => entries, - Err(error) if error.kind() == std::io::ErrorKind::NotFound => return Ok(()), - Err(error) => return Err(format!("cannot inspect the nightly profile: {error}")), - }; - for entry in entries { - let entry = entry.map_err(|e| format!("cannot inspect the nightly profile: {e}"))?; - let path = entry.path(); - let metadata = std::fs::symlink_metadata(&path).map_err(|e| format!("cannot inspect the nightly profile: {e}"))?; - // Settings and session state are ordinary files, not directories. Keep the existing - // directory-boundary check for folders (including the known folder-only entries). - let folder_only = PROFILE_FOLDERS.iter().any(|name| entry.file_name().eq_ignore_ascii_case(name)); - if metadata.is_file() && !folder_only { - private_regular_file(&path, &metadata)?; - } else { - private_subdirectory(root, entry.file_name(), "profile entry")?; - } - } - Ok(()) -} - -/// Persisted files must have their own ordinary file identity, not an alias to other data. -fn private_regular_file(path: &Path, metadata: &std::fs::Metadata) -> Result<(), String> { - #[cfg(unix)] - { - use std::os::unix::fs::MetadataExt as _; - if metadata.nlink() != 1 { - return Err("the nightly profile file must not be shared".into()); - } - } - #[cfg(all(windows, feature = "wgpu"))] - { - use winsafe::{HFILE, co}; - let (file, _) = HFILE::CreateFile( - path.to_str().ok_or("the nightly profile file path is not textual")?, - co::GENERIC::default(), - Some(co::FILE_SHARE::READ | co::FILE_SHARE::WRITE | co::FILE_SHARE::DELETE), - None, - co::DISPOSITION::OPEN_EXISTING, - co::FILE_ATTRIBUTE::NORMAL, - Some(co::FILE_FLAG::OPEN_REPARSE_POINT), - None, - None, - ) - .map_err(|e| e.to_string())?; - let info = file.GetFileInformationByHandle().map_err(|e| e.to_string())?; - if info.dwFileAttributes.has(co::FILE_ATTRIBUTE::REPARSE_POINT) || info.dwFileAttributes.has(co::FILE_ATTRIBUTE::DIRECTORY) { - return Err("the nightly profile file must not be an alias or directory".into()); - } - if info.nNumberOfLinks != 1 { - return Err("the nightly profile file must not be shared".into()); - } - } - #[cfg(all(windows, not(feature = "wgpu")))] - { - use std::os::windows::fs::MetadataExt as _; - const FILE_ATTRIBUTE_DIRECTORY: u32 = 0x10; - const FILE_ATTRIBUTE_REPARSE_POINT: u32 = 0x400; - if metadata.file_attributes() & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_REPARSE_POINT) != 0 { - return Err("the nightly profile file must not be an alias or directory".into()); - } - } - let _ = (path, metadata); - Ok(()) -} +const FORBIDDEN_ENV_VARS: [&str; 2] = ["VECTORCRAFT_CONFIG_DIR", "VECTORCRAFT_NO_PREFS"]; const PROFILE_FOLDERS: [&str; 18] = [ "Data Recovery", @@ -281,397 +34,207 @@ const PROFILE_FOLDERS: [&str; 18] = [ "Libraries", ]; -/// Recognise the shared portable data namespace in both the supplied and the resolved path. Up to -/// the chosen folder itself, a marker only counts beside a VectorCraft executable, so an unrelated -/// `portable.txt` higher up (in a user folder or at a drive root) does not refuse the profile. -fn is_portable_layout(path: &Path, platform: Platform) -> bool { - path.ancestors().enumerate().any(|(depth, ancestor)| { - crate::prefs_dir::profile::PORTABLE_MARKERS.iter().any(|marker| ancestor.join(marker).is_file()) - && (depth == 0 || ["vectorcraft.exe", "vectorcraft"].iter().any(|exe| ancestor.join(exe).is_file())) - }) || path.components().any(|component| match component { - Component::Normal(name) if platform.ignores_case() => name.to_string_lossy().eq_ignore_ascii_case(PORTABLE_DATA_DIR), - Component::Normal(name) => name == PORTABLE_DATA_DIR, - _ => false, - }) +/// Builds VectorCraft's [`AppProfileSpec`] for [`craft_nightly`]. +pub fn app_profile_spec() -> AppProfileSpec { + AppProfileSpec { + app_id: vectorcraft_ui_egui::os_window::SETTINGS_APP_ID, + display_name: vectorcraft_ui_egui::os_window::APP_NAME, + stable_dir_names: &STABLE_DIR_NAMES, + stable_package_id: vectorcraft_ui_egui::os_window::APP_ID, + nightly_package_id: vectorcraft_ui_egui::os_window::NIGHTLY_PACKAGE_ID, + profile_root_env: None, + forbidden_env_vars: &FORBIDDEN_ENV_VARS, + portable_markers: &PORTABLE_MARKERS, + folder_only_entries: &PROFILE_FOLDERS, + extra_forbidden_roots: extra_forbidden_roots(), + } } -/// The writable hook is the app's own exclusive probe ([`crate::prefs_dir::profile::ensure_writable`]). Keeping -/// it injected lets the boundary tests exercise the real policy without starting the app. -pub fn validate( - root: &Path, - env: impl Fn(&str) -> Option, - exe: Option<&Path>, - writable: impl FnOnce(&Path) -> std::io::Result<()>, -) -> Result { - validate_for(Platform::current()?, root, env, exe, writable) +fn non_empty_abs(env: &impl Fn(&str) -> Option, key: &str) -> Option { + let value = env(key)?; + if value.is_empty() { + return None; + } + let path = PathBuf::from(value); + path.is_absolute().then_some(path) } -fn validate_for( - platform: Platform, - root: &Path, - env: impl Fn(&str) -> Option, - exe: Option<&Path>, - writable: impl FnOnce(&Path) -> std::io::Result<()>, -) -> Result { - absolute(root.to_path_buf(), "the nightly profile root")?; - if env("VECTORCRAFT_CONFIG_DIR").is_some_and(|v| !v.is_empty()) { - return Err("nightly-v1 cannot be combined with VECTORCRAFT_CONFIG_DIR".to_string()); - } - // The app turns preferences off whenever the variable is present, empty value included. - if env("VECTORCRAFT_NO_PREFS").is_some() { - // A run without preferences keeps nothing: its own profile would stay unused and the app - // would log to standard error only, so it is never a nightly launch. - return Err("nightly-v1 cannot inherit VECTORCRAFT_NO_PREFS".to_string()); - } - let nightly_flatpak = vectorcraft_ui_egui::os_window::NIGHTLY_PACKAGE_ID; - if platform != Platform::Windows - && let Some(id) = env("FLATPAK_ID").filter(|value| !value.is_empty()) - && id.to_string_lossy().as_ref() != nightly_flatpak +fn extra_forbidden_roots() -> Vec { + extra_forbidden_roots_with(|key| std::env::var_os(key), std::env::current_exe().ok().as_deref()) +} + +fn extra_forbidden_roots_with(env: impl Fn(&str) -> Option, exe: Option<&Path>) -> Vec { + let mut roots = Vec::new(); + + #[cfg(target_os = "windows")] { - // `packaging/linux/flatpak-bundle.sh` builds VectorCraft Nightly as its own Flatpak - // (`ai.storyteller.vectorcraft.nightly`), whose sandbox is already a private home. Any other - // instance, the stable app's included, would put this profile inside another app's tree. - return Err(format!("nightly-v1 can only run inside its own Flatpak instance ({nightly_flatpak}), not {}", id.to_string_lossy())); + if let Some(local) = non_empty_abs(&env, "LOCALAPPDATA") { + roots.push(local.join("Programs").join("ArtCraft").join("VectorCraft")); + } + for key in ["ProgramW6432", "ProgramFiles", "ProgramFiles(x86)"] { + if let Some(base) = non_empty_abs(&env, key) { + roots.push(base.join("ArtCraft").join("VectorCraft")); + } + } } - let chosen = canonical_future(root)?; - if is_portable_layout(root, platform) || is_portable_layout(&chosen, platform) { - return Err("the nightly root must not use a portable VectorCraft installation or its VectorCraftData settings folder".to_string()); - } - let exe = absolute(exe.ok_or_else(|| "cannot establish the installation boundary".to_string())?.to_path_buf(), "the executable")?; - let forbidden = forbidden_roots(platform, &env, &exe)?; - if forbidden.iter().any(|stable| overlaps(&chosen, stable, platform)) { - return Err("the nightly root must not overlap stable data or an installation".to_string()); - } - // Data Recovery can read, adopt, overwrite and sweep entries: never let its alias leave the - // private profile. - private_subdirectory(&chosen, "Data Recovery", "recovery folder")?; - entries_stay_inside(&chosen)?; - let mut create = std::fs::DirBuilder::new(); - create.recursive(true); - #[cfg(unix)] + + #[cfg(all(unix, not(target_os = "macos")))] { - use std::os::unix::fs::DirBuilderExt as _; - create.mode(0o700); + if let Some(home) = non_empty_abs(&env, "HOME") { + roots.push(home.join(".var").join("app").join(vectorcraft_ui_egui::os_window::APP_ID)); + } + for entry in ["/usr/bin/vectorcraft", "/usr/local/bin/vectorcraft", "/opt/vectorcraft"] { + roots.push(PathBuf::from(entry)); + } } - create.create(&chosen).map_err(|e| format!("cannot create the nightly profile: {e}"))?; - let confirmed = std::fs::canonicalize(&chosen).map_err(|e| format!("cannot resolve the created nightly profile: {e}"))?; - if confirmed != chosen || forbidden.iter().any(|stable| overlaps(&confirmed, stable, platform)) { - return Err("the nightly profile changed while it was being validated".to_string()); + + #[cfg(target_os = "macos")] + { + if let Some(home) = non_empty_abs(&env, "HOME") { + let library = home.join("Library"); + roots.push(library.join("Preferences").join(format!("{}.plist", vectorcraft_ui_egui::os_window::APP_ID))); + roots.push(library.join("Saved Application State").join(format!("{}.savedState", vectorcraft_ui_egui::os_window::APP_ID))); + roots.push(home.join("Applications").join("VectorCraft.app")); + } + roots.push(PathBuf::from("/Applications/VectorCraft.app")); } - private_subdirectory(&confirmed, "Data Recovery", "recovery folder")?; - entries_stay_inside(&confirmed)?; - writable(&confirmed).map_err(|e| format!("the nightly profile is not writable: {e}"))?; - Ok(confirmed) + + if let Some(exe) = exe { + if let Some(parent) = exe.parent() { + roots.push(parent.join(PORTABLE_DATA_DIR)); + } + #[cfg(target_os = "macos")] + if let Some(bundle_parent) = exe.ancestors().find(|p| p.extension().is_some_and(|ext| ext.eq_ignore_ascii_case("app"))).and_then(Path::parent) + { + roots.push(bundle_parent.join(PORTABLE_DATA_DIR)); + } + } + + roots } #[cfg(test)] mod tests { - use super::*; - use std::cell::Cell; - use std::collections::BTreeMap; - use std::sync::atomic::{AtomicU64, Ordering}; + use std::ffi::OsString; + use std::fs; + #[cfg(unix)] + use std::path::PathBuf; - /// An owned fixture tree: a home, a roaming/local app-data pair and an install folder, so the - /// fence can be checked for every platform on any host. - struct Fixture { - root: PathBuf, - env: BTreeMap, - exe: PathBuf, - } + use craft_nightly::validate_and_prepare_root; - impl Fixture { - fn new() -> Self { - static NEXT: AtomicU64 = AtomicU64::new(0); - let root = loop { - let candidate = - std::env::temp_dir().join(format!("vectorcraft-profile-policy-{}-{}", std::process::id(), NEXT.fetch_add(1, Ordering::Relaxed))); - match std::fs::create_dir(&candidate) { - Ok(()) => break std::fs::canonicalize(candidate).unwrap(), - Err(error) if error.kind() == std::io::ErrorKind::AlreadyExists => continue, - Err(error) => panic!("cannot create owned fixture: {error}"), - } - }; - let home = root.join("home"); - let exe = root.join("install/vectorcraft"); - std::fs::create_dir_all(&home).unwrap(); - std::fs::create_dir_all(exe.parent().unwrap()).unwrap(); - std::fs::write(&exe, b"fixture executable, never run").unwrap(); - let env = [("HOME", home), ("APPDATA", root.join("roaming")), ("LOCALAPPDATA", root.join("local"))] - .into_iter() - .map(|(key, value)| (key.into(), value.into_os_string())) - .collect(); - Self { root, env, exe } - } - - fn get(&self, key: &str) -> Option { - self.env.get(key).cloned() - } - - fn home(&self) -> PathBuf { - PathBuf::from(self.get("HOME").unwrap()) - } - - fn check(&self, platform: Platform, root: &Path) -> Result { - self.check_with(platform, root, |_| Ok(())) - } - - fn check_with(&self, platform: Platform, root: &Path, writable: impl FnOnce(&Path) -> std::io::Result<()>) -> Result { - validate_for(platform, root, |key| self.get(key), Some(&self.exe), writable) - } - } - - impl Drop for Fixture { - fn drop(&mut self) { - // Only the directory this fixture created is owned for removal. - std::fs::remove_dir_all(&self.root).unwrap(); - } - } - - const PLATFORMS: [Platform; 3] = [Platform::Windows, Platform::Linux, Platform::Mac]; + use super::{FORBIDDEN_ENV_VARS, PROFILE_FOLDERS, STABLE_DIR_NAMES, app_profile_spec, extra_forbidden_roots_with}; + use crate::prefs_dir::profile::{PORTABLE_DATA_DIR, PORTABLE_MARKERS}; #[test] - fn a_private_profile_is_accepted_on_every_platform() { - let fixture = Fixture::new(); - for platform in PLATFORMS { - let root = fixture.root.join(format!("nightly profiles/{platform:?}/vectorcraft")); - let resolved = fixture.check(platform, &root).unwrap(); - assert!(resolved.is_dir(), "{platform:?}"); - assert_eq!(resolved, std::fs::canonicalize(root).unwrap(), "{platform:?}"); - std::fs::remove_dir_all(fixture.root.join("nightly profiles")).unwrap(); - } + fn spec_preserves_vectorcraft_invariants() { + let spec = app_profile_spec(); + assert_eq!(spec.app_id, "vectorcraft"); + assert_eq!(spec.display_name, "VectorCraft"); + assert_eq!(spec.stable_dir_names, &STABLE_DIR_NAMES); + assert_eq!(spec.stable_package_id, "ai.storyteller.vectorcraft"); + assert_eq!(spec.nightly_package_id, "ai.storyteller.vectorcraft.nightly"); + assert_eq!(spec.profile_root_env, None); + assert_eq!(spec.forbidden_env_vars, &FORBIDDEN_ENV_VARS); + assert_eq!(spec.portable_markers, &PORTABLE_MARKERS); + assert_eq!(spec.folder_only_entries, &PROFILE_FOLDERS); } #[test] - fn stable_settings_folders_are_refused_on_every_platform() { - let fixture = Fixture::new(); - let stable = [ - (Platform::Windows, fixture.get("APPDATA").map(|v| PathBuf::from(v).join("VectorCraft"))), - (Platform::Windows, fixture.get("APPDATA").map(|v| PathBuf::from(v).join("ai.storyteller.vectorcraft"))), - (Platform::Windows, fixture.get("LOCALAPPDATA").map(|v| PathBuf::from(v).join("VectorCraft"))), - (Platform::Windows, fixture.get("LOCALAPPDATA").map(|v| PathBuf::from(v).join("Programs/ArtCraft/VectorCraft"))), - (Platform::Linux, Some(fixture.home().join(".config/vectorcraft"))), - (Platform::Linux, Some(fixture.home().join(".local/share/vectorcraft"))), - (Platform::Linux, Some(fixture.home().join(".local/share/ai.storyteller.vectorcraft"))), - (Platform::Linux, Some(fixture.home().join(".cache/vectorcraft"))), - (Platform::Linux, Some(fixture.home().join(".var/app/ai.storyteller.vectorcraft"))), - (Platform::Mac, Some(fixture.home().join("Library/Application Support/VectorCraft"))), - (Platform::Mac, Some(fixture.home().join("Library/Application Support/ai.storyteller.vectorcraft"))), - (Platform::Mac, Some(fixture.home().join("Library/Preferences/ai.storyteller.vectorcraft.plist"))), - ]; - for (platform, stable) in stable { - let stable = stable.unwrap(); - for candidate in [stable.clone(), stable.join("nested nightly")] { - let probed = Cell::new(false); - let result = fixture.check_with(platform, &candidate, |_| { - probed.set(true); - Ok(()) - }); - assert!(result.is_err(), "{platform:?} accepted {candidate:?}"); - assert!(!probed.get(), "a refused root is rejected before the writable probe"); - } - } - } + fn extra_forbidden_roots_fences_platform_installs_and_portable_data() { + let tmp = tempfile::tempdir().unwrap(); + let home = tmp.path().join("home"); + let exe = tmp.path().join("install/vectorcraft"); + let roots = extra_forbidden_roots_with( + |key| match key { + "HOME" | "LOCALAPPDATA" | "ProgramFiles" => Some(home.clone().into_os_string()), + _ => None, + }, + Some(&exe), + ); + assert!(roots.contains(&tmp.path().join("install").join(PORTABLE_DATA_DIR))); - #[test] - fn the_install_folder_and_the_entry_points_are_refused() { - let fixture = Fixture::new(); - for platform in PLATFORMS { - let install = fixture.exe.parent().unwrap(); - assert!(fixture.check(platform, install).is_err(), "{platform:?}: the install folder"); - assert!(fixture.check(platform, &install.join("NightlyData")).is_err(), "{platform:?}: inside the install"); - } - } - - #[test] - fn an_inherited_config_or_no_prefs_override_is_refused() { - let fixture = Fixture::new(); - let root = fixture.root.join("nightly"); - for (key, value) in [ - ("VECTORCRAFT_CONFIG_DIR", "/elsewhere"), - ("VECTORCRAFT_NO_PREFS", "1"), - // The app turns preferences off on presence, so an empty value is a run too. - ("VECTORCRAFT_NO_PREFS", ""), - ("FLATPAK_ID", "ai.storyteller.vectorcraft"), - ] { - for platform in PLATFORMS { - let result = validate_for( - platform, - &root, - |name| if name == key { Some(value.into()) } else { fixture.get(name) }, - Some(&fixture.exe), - |_| Ok(()), - ); - let refused = result.is_err(); - // A Flatpak instance only keeps the stable app's sockets on native Unix packages. - assert_eq!(refused, !(key == "FLATPAK_ID" && platform == Platform::Windows), "{key} on {platform:?}"); - if refused { - assert!(!root.exists(), "a refused launch creates nothing ({key} on {platform:?})"); - } else if root.exists() { - // The accepted case validated the root, which creates it: start the next one clean. - std::fs::remove_dir_all(&root).expect("remove the accepted launch's root"); - } - } - } - } - - #[test] - fn only_the_nightly_s_own_flatpak_instance_may_carry_a_profile() { - let fixture = Fixture::new(); - let root = fixture.root.join("flatpak profile"); - for (id, accepted) in - [(vectorcraft_ui_egui::os_window::NIGHTLY_PACKAGE_ID, true), ("ai.storyteller.vectorcraft", false), ("io.other.App", false)] + #[cfg(target_os = "windows")] { - let result = validate_for( - Platform::Linux, - &root, - |name| if name == "FLATPAK_ID" { Some(id.into()) } else { fixture.get(name) }, - Some(&fixture.exe), - |_| Ok(()), - ); - assert_eq!(result.is_ok(), accepted, "{id}"); - let _ = std::fs::remove_dir_all(&root); + assert!(roots.contains(&home.join("Programs").join("ArtCraft").join("VectorCraft"))); + assert!(roots.contains(&home.join("ArtCraft").join("VectorCraft"))); + } + #[cfg(all(unix, not(target_os = "macos")))] + { + assert!(roots.contains(&home.join(".var/app/ai.storyteller.vectorcraft"))); + assert!(roots.contains(&PathBuf::from("/usr/bin/vectorcraft"))); + assert!(roots.contains(&PathBuf::from("/usr/local/bin/vectorcraft"))); + assert!(roots.contains(&PathBuf::from("/opt/vectorcraft"))); + } + #[cfg(target_os = "macos")] + { + assert!(roots.contains(&home.join("Library/Preferences/ai.storyteller.vectorcraft.plist"))); + assert!(roots.contains(&home.join("Library/Saved Application State/ai.storyteller.vectorcraft.savedState"))); + assert!(roots.contains(&home.join("Applications/VectorCraft.app"))); + assert!(roots.contains(&PathBuf::from("/Applications/VectorCraft.app"))); } } #[test] - fn a_portable_copy_and_its_data_folder_are_refused() { - let fixture = Fixture::new(); - let portable = fixture.root.join("portable copy"); - let data = portable.join(crate::prefs_dir::profile::PORTABLE_DATA_DIR); - std::fs::create_dir_all(&data).unwrap(); - std::fs::write(portable.join("portable.txt"), b"owned portable fixture").unwrap(); - std::fs::write(data.join("config.toml"), b"stable settings must not change").unwrap(); - for platform in PLATFORMS { - for candidate in [&data, &data.join("nested nightly")] { - let probed = Cell::new(false); - let result = fixture.check_with(platform, candidate, |_| { - probed.set(true); - Ok(()) - }); - assert!(result.is_err(), "{platform:?} accepted {candidate:?}"); - assert!(!probed.get()); - assert!(!data.join("nested nightly").exists()); - assert_eq!(std::fs::read(data.join("config.toml")).unwrap(), b"stable settings must not change"); - } + fn nightly_profile_reopens_after_saving_settings_and_enforces_folder_only_entries() { + let tmp = tempfile::tempdir().unwrap(); + let private = tmp.path().join("nightly-reopen"); + let mut spec = app_profile_spec(); + spec.forbidden_env_vars = &[]; + + let canonical = validate_and_prepare_root(&private, &spec).unwrap(); + assert_eq!(canonical, fs::canonicalize(&private).unwrap()); + + for name in ["config.toml", "instance.json", "Color Settings.json", "app.ron"] { + fs::write(canonical.join(name), b"saved profile data").unwrap(); + } + for name in PROFILE_FOLDERS { + fs::create_dir(canonical.join(name)).unwrap(); + } + assert_eq!(validate_and_prepare_root(&private, &spec).unwrap(), canonical); + for name in ["config.toml", "instance.json", "Color Settings.json", "app.ron"] { + assert_eq!(fs::read(canonical.join(name)).unwrap(), b"saved profile data", "{name} remains intact after reopen"); + } + + for name in PROFILE_FOLDERS { + let path = canonical.join(name); + fs::remove_dir(&path).unwrap(); + fs::write(&path, b"not a directory").unwrap(); + assert!(validate_and_prepare_root(&private, &spec).is_err(), "{name} must stay a directory"); + fs::remove_file(&path).unwrap(); + fs::create_dir(&path).unwrap(); } - // A merely similar name is not the portable settings folder. - let similar = fixture.root.join("VectorCraftData-backup-name/nightly"); - assert!(fixture.check(Platform::Linux, &similar).is_ok()); } #[cfg(unix)] #[test] - fn a_link_inside_the_profile_cannot_redirect_recovery_or_a_library() { - let fixture = Fixture::new(); - let root = fixture.root.join("nightly"); - std::fs::create_dir_all(&root).unwrap(); - let external = fixture.root.join("stable-document"); - std::fs::write(&external, b"stable bytes").unwrap(); + fn symlink_inside_profile_is_refused() { + let tmp = tempfile::tempdir().unwrap(); + let private = tmp.path().join("nightly"); + fs::create_dir_all(&private).unwrap(); + let external = tmp.path().join("stable-document"); + fs::write(&external, b"stable bytes").unwrap(); + + let mut spec = app_profile_spec(); + spec.forbidden_env_vars = &[]; + for name in ["Data Recovery", "Swatches"] { - let alias = root.join(name); + let alias = private.join(name); std::os::unix::fs::symlink(&external, &alias).unwrap(); - assert!(fixture.check(Platform::Linux, &root).is_err(), "{name} alias"); - std::fs::remove_file(&alias).unwrap(); + assert!(validate_and_prepare_root(&private, &spec).is_err(), "{name} alias"); + fs::remove_file(&alias).unwrap(); } - assert_eq!(std::fs::read(&external).unwrap(), b"stable bytes"); - } - - #[cfg(unix)] - #[test] - fn a_dangling_link_or_a_linked_ancestor_is_refused() { - let fixture = Fixture::new(); - let elsewhere = fixture.root.join("elsewhere"); - std::fs::create_dir_all(&elsewhere).unwrap(); - let linked = fixture.root.join("nightly"); - std::os::unix::fs::symlink(&elsewhere, &linked).unwrap(); - // Canonical resolution keeps a link's target: a profile reached through one is fine, but it - // is judged (and named) as its target, so nothing is written under the link. - let resolved = fixture.check(Platform::Linux, &linked).unwrap(); - assert_eq!(resolved, std::fs::canonicalize(&elsewhere).unwrap()); - std::fs::remove_file(&linked).unwrap(); - let dangling = fixture.root.join("dangling/nightly"); - std::fs::create_dir_all(dangling.parent().unwrap()).unwrap(); - std::os::unix::fs::symlink(fixture.root.join("missing"), dangling.parent().unwrap().join("nightly")).unwrap(); - assert!(fixture.check(Platform::Linux, &dangling).is_err()); + assert_eq!(fs::read(&external).unwrap(), b"stable bytes"); } #[test] - fn a_home_settings_folder_is_fenced_even_when_the_xdg_override_moves_elsewhere() { - let fixture = Fixture::new(); - let xdg = fixture.root.join("override"); - std::fs::create_dir_all(&xdg).unwrap(); - let config = fixture.home().join(".config/vectorcraft"); - let data = fixture.home().join(".local/share/vectorcraft"); - for stable in [config.clone(), data.clone()] { - for candidate in [stable.clone(), stable.join("nested nightly")] { - let result = validate_for( - Platform::Linux, - &candidate, - |name| match name { - "XDG_CONFIG_HOME" | "XDG_DATA_HOME" => Some(xdg.clone().into_os_string()), - _ => fixture.get(name), - }, - Some(&fixture.exe), - |_| Ok(()), - ); - assert!(result.is_err(), "accepted {candidate:?} with the XDG folders moved to {xdg:?}"); - } - } - assert!(!config.exists() && !data.exists(), "a refused root creates nothing"); - } - - #[cfg(unix)] - #[test] - fn a_dangling_entry_point_keeps_its_fence_instead_of_refusing_every_launch() { - let fixture = Fixture::new(); - let bin = fixture.root.join("entry/bin"); - std::fs::create_dir_all(&bin).unwrap(); - let entry = bin.join("vectorcraft"); - std::os::unix::fs::symlink(fixture.root.join("uninstalled target"), &entry).unwrap(); - // The shared resolver refuses the dangling link, as a profile root must be. - assert!(canonical_future(&entry).is_err()); - assert_eq!(canonical_future_entry(&entry).unwrap(), std::fs::canonicalize(&bin).unwrap().join("vectorcraft")); - } - - #[test] - fn an_unwritable_profile_is_refused_after_the_probe_and_never_used() { - let fixture = Fixture::new(); - let root = fixture.root.join("nightly"); - let result = fixture.check_with(Platform::Linux, &root, |_| Err(std::io::Error::other("read-only"))); - assert!(result.unwrap_err().contains("not writable")); - } - - #[test] - fn nightly_profile_reopens_after_saving_settings_and_session_state() { - let fixture = Fixture::new(); - for platform in PLATFORMS { - let private = fixture.root.join(format!("nightly-reopen-{platform:?}")); - assert_eq!(fixture.check(platform, &private).unwrap(), private); - for name in ["config.toml", "instance.json", "Color Settings.json", "app.ron"] { - std::fs::write(private.join(name), b"saved profile data").unwrap(); - } - for name in PROFILE_FOLDERS { - std::fs::create_dir(private.join(name)).unwrap(); - } - assert_eq!(fixture.check(platform, &private).unwrap(), private); - assert_eq!(std::fs::read(private.join("config.toml")).unwrap(), b"saved profile data"); - for name in PROFILE_FOLDERS { - let path = private.join(name); - std::fs::remove_dir(&path).unwrap(); - std::fs::write(&path, b"not a directory").unwrap(); - assert!(fixture.check(platform, &private).is_err(), "{name} must stay a directory"); - std::fs::remove_file(&path).unwrap(); - std::fs::create_dir(&path).unwrap(); - } - } - } - - #[test] - fn the_platform_case_rules_are_the_file_systems_ones() { - let fixture = Fixture::new(); - let upper = fixture.root.join("NIGHTLY"); - assert!(fixture.check(Platform::Linux, &upper).is_ok()); - let stable_mac = fixture.home().join("library/application support/vectorcraft"); - assert!(fixture.check(Platform::Mac, &stable_mac).is_err(), "macOS compares folders case-insensitively"); + fn non_empty_abs_ignores_empty_and_relative_values() { + let env = |key: &str| match key { + "EMPTY" => Some(OsString::new()), + "RELATIVE" => Some(OsString::from("relative/path")), + _ => None, + }; + assert!(super::non_empty_abs(&env, "EMPTY").is_none()); + assert!(super::non_empty_abs(&env, "RELATIVE").is_none()); + assert!(super::non_empty_abs(&env, "MISSING").is_none()); } } diff --git a/apps/vectorcraft/src/single_instance.rs b/apps/vectorcraft/src/single_instance.rs index 249309fa87..4dba61d6b4 100644 --- a/apps/vectorcraft/src/single_instance.rs +++ b/apps/vectorcraft/src/single_instance.rs @@ -155,8 +155,8 @@ pub fn launch_with_plug_ins(files: &[String]) -> io::Result<()> { } /// The command [`launch_with_plug_ins`] runs: `exe -- files…`, so a file whose name starts with '-' -/// stays a file. A nightly launch hands its profile on first (`launch_profile::child_args`), or the -/// child would refuse to start without one. +/// stays a file. A nightly launch hands its profile on first (`launch_profile::child_args`), so the +/// child opens the same private profile. fn app_with_plug_ins(exe: &Path, files: &[String]) -> std::process::Command { let mut command = std::process::Command::new(exe); command.args(super::launch_profile::child_args(files)); From 03dd80a887691a6cafee4e608a4b72dfa1156554 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 19:37:36 -0800 Subject: [PATCH 059/105] Tests: menu and Quick Actions rebuild counts run in a process of their own MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The menus' key (`state_key`, crates/ui-egui/src/menus/model.rs) holds the installed plug-ins' revision and the fonts' generation. Both are the whole process's. In a parallel `cargo test` run, a plug-in that another test installs moves the revision, the menus are rebuilt, and the new catalog makes the window build a new keymap, whose address is also in the key, so the next pass rebuilds them again. `a_key_press_rebuilds_the_menus_once` then counted those rebuilds on its idle frames ("idle frames keep the menus", left 4 to 7, right 3 to 5) in 6 of 6 runs of `cargo test -p vectorcraft-ui-egui --lib -- addons menus i18n`, and `quick_actions_are_listed_again_only_after_a_change`, whose key holds the menus' key, failed in the same way in 2 of 2 runs. In the app these values change only when a plug-in is installed or removed or the fonts change, and the menus list both, so the rebuild is kept. - Both tests run through `testing::in_own_process`, as the tests that load color profiles do, and wait for the installed fonts' scan, whose end moves the fonts' generation, before their first frames. - `a_new_font_rebuilds_the_menus` adds a font and checks that the menus are rebuilt with no input, that Type › Font lists it, and that idle frames after that keep the menus. --- crates/ui-egui/src/menus/tests.rs | 42 +++++++++++++++++-- crates/ui-egui/src/panels/properties/tests.rs | 9 +++- 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/menus/tests.rs b/crates/ui-egui/src/menus/tests.rs index b21b2e8ccf..7d27d6be1a 100644 --- a/crates/ui-egui/src/menus/tests.rs +++ b/crates/ui-egui/src/menus/tests.rs @@ -164,15 +164,29 @@ fn snapping_menu_clicks_toggle_view_state_and_painted_checkmarks() { assert_eq!(menu.toggled("Pixel Snapping Options…"), None); } -/// A key press builds the menus' states again once: the frames after it, with no press, keep them. -#[test] -fn a_key_press_rebuilds_the_menus_once() { +/// An app with a new document whose installed fonts are cataloged, after the frames that build its first menus and the +/// window's keymap. It runs in a process of its own ([`crate::testing::in_own_process`]): the menus' key holds the +/// installed plug-ins' revision and the fonts' generation, which are the whole process's, so a plug-in that another test +/// installs, or a font it adds, rebuilds this app's menus. `None` in the parent process. +fn settled_app(test: &str) -> Option<(VectorcraftApp, egui::Context)> { + if !crate::testing::in_own_process(test) { + return None; + } let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), crate::Services::default()); + // The scan of the installed fonts, which the app starts, changes the fonts' generation when it ends: wait for it. + vectorcraft_text::FontDb::global().family_list(); app.run("file.new", json!({})).unwrap(); let ctx = crate::testing::ui_context(); for _ in 0..3 { app_frame(&mut app, &ctx, vec![]); } + Some((app, ctx)) +} + +/// A key press builds the menus' states again once: the frames after it, with no press, keep them. +#[test] +fn a_key_press_rebuilds_the_menus_once() { + let Some((mut app, ctx)) = settled_app("menus::tests::a_key_press_rebuilds_the_menus_once") else { return }; let before = app.menus.rebuilds; for _ in 0..3 { app_frame(&mut app, &ctx, vec![]); @@ -187,6 +201,28 @@ fn a_key_press_rebuilds_the_menus_once() { assert_eq!(app.menus.rebuilds, before + 1); } +/// A font added to the fonts the whole process shares builds the menus again with no input, Type › Font then lists it, +/// and the idle frames after that keep the menus. +#[test] +fn a_new_font_rebuilds_the_menus() { + const FAMILY: &str = "Menurebuild Sans"; + let Some((mut app, ctx)) = settled_app("menus::tests::a_new_font_rebuilds_the_menus") else { return }; + let lists = + |app: &VectorcraftApp| app.menus.bar.items().into_iter().any(|it| it.command.id == "text.setStyle" && it.command.params["font"] == FAMILY); + assert!(!lists(&app)); + let font = vectorcraft_text::test_fonts::named_copy(false, (FAMILY, "Regular", "Version 1.000", "MenurebuildSans-Regular")); + let before = app.menus.rebuilds; + assert_eq!(vectorcraft_text::FontDb::global().add_font(font.expect("the test font builds")), 1); + app_frame(&mut app, &ctx, vec![]); + assert!(app.menus.rebuilds > before, "the new font rebuilds the menus"); + assert!(lists(&app), "Type › Font lists {FAMILY}"); + let after = app.menus.rebuilds; + for _ in 0..3 { + app_frame(&mut app, &ctx, vec![]); + } + assert_eq!(app.menus.rebuilds, after, "idle frames keep the menus"); +} + #[test] fn help_f1_opens_discover_without_a_document() { let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), crate::Services::default()); diff --git a/crates/ui-egui/src/panels/properties/tests.rs b/crates/ui-egui/src/panels/properties/tests.rs index 4a8158364a..ed4147744e 100644 --- a/crates/ui-egui/src/panels/properties/tests.rs +++ b/crates/ui-egui/src/panels/properties/tests.rs @@ -1084,10 +1084,17 @@ fn quick_actions_follow_the_selection() { } } -/// The panel lists the Quick Actions once per change of what they depend on, not in every frame. +/// The panel lists the Quick Actions once per change of what they depend on, not in every frame. It runs in a process +/// of its own ([`crate::testing::in_own_process`]): what they depend on holds the menus' key, with the installed +/// plug-ins' revision and the fonts' generation, which are the whole process's. #[test] fn quick_actions_are_listed_again_only_after_a_change() { + if !crate::testing::in_own_process("panels::properties::tests::quick_actions_are_listed_again_only_after_a_change") { + return; + } let mut app = new_app(); + // The scan of the installed fonts, which the app starts, changes the fonts' generation when it ends: wait for it. + vectorcraft_text::FontDb::global().family_list(); rect(&mut app, 10.0, 10.0, 40.0, 40.0); rect(&mut app, 80.0, 10.0, 40.0, 40.0); let ctx = crate::testing::ui_context(); From 80b15ed8d15eaaad0156eed1fc7aba6956855197 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 19:46:29 -0800 Subject: [PATCH 060/105] Swatches: idle frames replay the swatch rows The panel's browser has a row menu, drop rules and a drag payload of its own, and without a version for what they read it ran its rows in every frame. The panel now passes SwatchesPanel::host_version with a version of the document, its revision, its File > Revert count and its newest undo and redo steps, which are what those closures read. The craft-libs pin moves to current main (891f4060c), which has SwatchesPanel::host_version (storytold/craft-libs#4320), with the winit revision that craft-libs revision uses (0dfcec0e). --- Cargo.lock | 211 ++++++++++---------- Cargo.toml | 76 +++---- apps/vectorcraft-web/Cargo.toml | 2 +- crates/ui-egui/src/panels/swatches.rs | 4 + crates/ui-egui/src/panels/swatches/dnd.rs | 10 + crates/ui-egui/src/panels/swatches/tests.rs | 33 +++ xtask/src/pdf_deps.rs | 2 +- 7 files changed, 191 insertions(+), 147 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3cb674e4ae..2a52380c8b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -626,12 +626,6 @@ dependencies = [ "cpufeatures 0.3.1", ] -[[package]] -name = "block" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" - [[package]] name = "block-buffer" version = "0.10.4" @@ -725,6 +719,17 @@ dependencies = [ "brotli-decompressor 5.0.3", ] +[[package]] +name = "brotli" +version = "9.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9071f285ed78f04f37d675abaaef5de7689e2f30a216c8dc6795465d81910a13" +dependencies = [ + "alloc-no-stdlib 3.0.0", + "alloc-stdlib 0.3.0", + "brotli-decompressor 6.3.2", +] + [[package]] name = "brotli-decompressor" version = "5.0.3" @@ -1184,19 +1189,6 @@ dependencies = [ "libc", ] -[[package]] -name = "core-graphics2" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b65858d95344d2711161cd92196732f67d6c5fea238cf12f994584828731a5c" -dependencies = [ - "bitflags 2.13.2", - "block", - "cfg-if", - "core-foundation 0.10.1", - "libc", -] - [[package]] name = "core_detect" version = "1.0.0" @@ -1239,7 +1231,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-automation", "craft-behavior", @@ -1280,7 +1272,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "crc32fast", "flate2", @@ -1291,18 +1283,19 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "block2 0.6.2", "objc2 0.6.5", "objc2-app-kit 0.3.2", + "objc2-core-graphics", "objc2-foundation 0.3.2", ] [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "rustix 1.1.6", ] @@ -1310,7 +1303,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1335,7 +1328,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1353,7 +1346,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-docpath", @@ -1371,7 +1364,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "crc32fast", "flate2", @@ -1380,7 +1373,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "egui", ] @@ -1388,7 +1381,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "md-5", "rayon", @@ -1397,12 +1390,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-cms", @@ -1422,7 +1415,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-control-protocol", "craft-platform", @@ -1433,7 +1426,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1443,7 +1436,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "rayon", ] @@ -1451,7 +1444,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1477,7 +1470,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "blake3", "craft-ecproj-format", @@ -1493,7 +1486,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "serde", ] @@ -1501,7 +1494,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1520,7 +1513,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-codepage", "encoding_rs", @@ -1532,7 +1525,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "serde", "serde_json", @@ -1542,12 +1535,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1562,7 +1555,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1581,7 +1574,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1590,7 +1583,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "cap-primitives", "craft-atomic", @@ -1613,12 +1606,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "gif", ] @@ -1626,7 +1619,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "flate2", ] @@ -1634,7 +1627,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1647,8 +1640,10 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ + "brotli 9.1.3", + "brotli-decompressor 6.3.2", "chrono", "fixed_decimal", "icu_calendar", @@ -1675,7 +1670,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-dds", "craft-jpeg", @@ -1702,7 +1697,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1720,7 +1715,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "thiserror 2.0.21", ] @@ -1728,7 +1723,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1739,7 +1734,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-host", "craft-i18n", @@ -1754,7 +1749,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-i18n", @@ -1768,7 +1763,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-host", @@ -1786,7 +1781,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1798,7 +1793,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "encoding_rs", "image", @@ -1809,7 +1804,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "chrono", "craft-codepage", @@ -1819,7 +1814,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-keymap", @@ -1835,7 +1830,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "flate2", "serde", @@ -1846,7 +1841,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1858,12 +1853,12 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "async-channel", "async-io", "async-process", - "core-graphics2", + "craft-appkit", "craft-atomic", "craft-docpath", "craft-host", @@ -1873,6 +1868,8 @@ dependencies = [ "js-sys", "log", "objc2-app-kit 0.3.2", + "objc2-core-foundation", + "objc2-core-graphics", "rfd", "serde", "serde_json", @@ -1889,7 +1886,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1898,7 +1895,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-host", @@ -1922,7 +1919,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1933,7 +1930,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-eps", "flate2", @@ -1947,7 +1944,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "encoding_rs", "flate2", @@ -1958,7 +1955,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "dispatch2", "egui", @@ -1971,7 +1968,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1990,7 +1987,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-atomic", "craft-host", @@ -2007,7 +2004,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "fax", "hayro-ccitt", @@ -2018,7 +2015,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2039,7 +2036,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-keymap", @@ -2051,7 +2048,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2076,7 +2073,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2091,7 +2088,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-atomic", "craft-behavior", @@ -2106,7 +2103,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "serde", "thiserror 2.0.21", @@ -2116,7 +2113,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "serde", "thiserror 2.0.21", @@ -2125,7 +2122,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-keymap", @@ -2140,12 +2137,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2159,7 +2156,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-i18n", @@ -2175,7 +2172,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "accesskit", "craft-behavior", @@ -2213,7 +2210,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2224,7 +2221,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-host", @@ -2242,7 +2239,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-host", @@ -2263,7 +2260,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-host", @@ -2284,7 +2281,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-host", @@ -2303,7 +2300,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "base64 0.22.1", "chrono", @@ -2335,7 +2332,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "flate2", "serde", @@ -2346,7 +2343,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2356,7 +2353,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "js-sys", "serde_json", @@ -2367,7 +2364,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "winsafe", ] @@ -2375,7 +2372,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-appkit", "craft-atomic", @@ -2407,7 +2404,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3762,16 +3759,16 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ - "brotli", + "brotli 8.0.4", "hayro-postscript", ] [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3789,7 +3786,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3807,12 +3804,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "flate2", "hayro-ccitt", @@ -4795,7 +4792,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4952,7 +4949,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "arrayvec", "kurbo 0.13.1", @@ -10067,7 +10064,7 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winit" version = "0.30.13" -source = "git+https://github.com/storytold/winit.git?rev=a517b3846ee8457d84ee4975110bfda6797c44dc#a517b3846ee8457d84ee4975110bfda6797c44dc" +source = "git+https://github.com/storytold/winit.git?rev=0dfcec0eb62fda5904137a63a6dd0c3d83295f45#0dfcec0eb62fda5904137a63a6dd0c3d83295f45" dependencies = [ "ahash", "android-activity", diff --git a/Cargo.toml b/Cargo.toml index 7ad3e4cfeb..0c7e739fb5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,49 +10,49 @@ license = "MIT OR Apache-2.0" rust-version = "1.95" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # Language packs: the Craft apps' shared font store installs them (#4936). -craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON. -craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names # the members it imports. -craft = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui # without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes. -craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -192,13 +192,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } emath = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } epaint = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } @@ -210,4 +210,4 @@ egui_glow = { git = "https://github.com/storytold/egui.git", rev = "14c39fed1817 egui_extras = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } eframe = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } -winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" } +winit = { git = "https://github.com/storytold/winit.git", rev = "0dfcec0eb62fda5904137a63a6dd0c3d83295f45" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index ce4d1d3d44..0e50690b98 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -28,7 +28,7 @@ egui_extras = { workspace = true } # `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback. eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] } # The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft. -craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/crates/ui-egui/src/panels/swatches.rs b/crates/ui-egui/src/panels/swatches.rs index 515456cad8..ca2b52c605 100644 --- a/crates/ui-egui/src/panels/swatches.rs +++ b/crates/ui-egui/src/panels/swatches.rs @@ -421,6 +421,9 @@ fn body(app: &mut VectorcraftApp, ui: &mut Ui) { let lit: Vec = highlighted(&st.doc, &base).into_iter().map(str::to_string).collect(); let doc = Arc::clone(&st.doc); let start = dnd::DragStart::of(st); + // The row menu, the drop rules and the drag payload read the document, its reverts and the drag start alone, so + // the browser's rows replay while this version holds. + let host = start.version(st.revision); let document = st.uid; let reverts = st.reverts; let foot = Footer::of(app, &model, held); @@ -448,6 +451,7 @@ fn body(app: &mut VectorcraftApp, ui: &mut Ui) { .row_items(|key| row_items(shown_app, key)) .takes_drop::(DropPlace::Between, |drag, _| dnd::accepts(drag, document, reverts)) .takes_drop::(DropPlace::Onto, |drag, _| dnd::accepts(drag, document, reverts)) + .host_version(host) .select(SelectMode::Multi) .search(search) .reveal(focus.clone().map(SwatchKey::Swatch)) diff --git a/crates/ui-egui/src/panels/swatches/dnd.rs b/crates/ui-egui/src/panels/swatches/dnd.rs index df967e9700..4b68266bf1 100644 --- a/crates/ui-egui/src/panels/swatches/dnd.rs +++ b/crates/ui-egui/src/panels/swatches/dnd.rs @@ -1,3 +1,4 @@ +use std::hash::{DefaultHasher, Hash, Hasher}; use std::sync::{Arc, Weak}; use super::{Document, Paint, PanelDrag, REGISTRATION, Swatch, Value, VectorcraftApp, json, name_of, swatch_params}; @@ -126,6 +127,15 @@ impl DragStart { DragStart { uid: st.uid, reverts: st.reverts, doc: Arc::clone(&st.doc), steps: steps(st), back } } + /// A version of this start in the document's `revision` ([`DocState::revision`]): it changes with + /// the document, its count of File › Revert and its newest undo and redo steps, which are what the + /// panel's row menu, drop rules and drag payload read. + pub(super) fn version(&self, revision: u64) -> u64 { + let mut h = DefaultHasher::new(); + (self.uid, self.reverts, revision, self.steps).hash(&mut h); + h.finish() + } + /// Rows `names` as this document holds them. fn rows(&self, names: &[String]) -> HeldRows { let rows: Vec<_> = names.iter().map(|n| (n.clone(), HeldRow::of(&self.doc, n))).collect(); diff --git a/crates/ui-egui/src/panels/swatches/tests.rs b/crates/ui-egui/src/panels/swatches/tests.rs index f20c725ac0..df72fa25e1 100644 --- a/crates/ui-egui/src/panels/swatches/tests.rs +++ b/crates/ui-egui/src/panels/swatches/tests.rs @@ -1623,3 +1623,36 @@ fn the_swatch_libraries_menu_fits_its_rows_like_a_library_panels_menu() { let panel_menu = panel.rect_role("Swatch Libraries Menu", Role::MENU); assert_eq!(footer_menu.width(), panel_menu.width(), "footer menu {footer_menu:?}, library panel menu {panel_menu:?}"); } + +/// Frames that change nothing replay the swatch rows instead of running them again; deleting a swatch and undoing it +/// each run them, the rows show the change, and the frames after replay them again. +#[test] +fn idle_frames_replay_the_swatch_rows() { + use crate::tests::panel_harness::Panel; + use craft::ui::testing::{MemoRun, last_frame_memo_runs}; + let runs = |panel: &Panel| { + last_frame_memo_runs(panel.ctx()).iter().filter(|(name, _, run)| name.contains("ListProps") && *run == MemoRun::Ran).count() + }; + let idle = |panel: &mut Panel, after: &str| { + panel.frame(); + panel.frame(); + for _ in 0..5 { + panel.frame(); + assert_eq!(runs(panel), 0, "an idle frame {after} replays the swatch rows"); + } + }; + let red = "Red, #ed1c24"; + let mut panel = Panel::new(app(), show); + idle(&mut panel, "of a new document"); + assert!(panel.shows(red), "the rows show Red"); + panel.app().run("swatch.delete", json!({"names": ["Red"]})).unwrap(); + panel.frame(); + assert!(runs(&panel) > 0, "deleting a swatch runs the rows"); + assert!(!panel.shows(red), "and they no longer show it"); + idle(&mut panel, "after a delete"); + panel.app().run("edit.undo", json!({})).unwrap(); + panel.frame(); + assert!(runs(&panel) > 0, "an undo runs the rows"); + assert!(panel.shows(red), "and they show the swatch again"); + idle(&mut panel, "after an undo"); +} diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index f4f02f8627..4d937f436f 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "186a229c8da8db5916f8a863dfd894f1879af735"; +const REV: &str = "891f4060c4aefe2679a65afc9e76bb5ce345de31"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV), From 2be42e79864534c8ac43d52e1adaee13f5b17c17 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 19:52:59 -0800 Subject: [PATCH 061/105] Shape Builder: saved Artwork from earlier versions switches to Color Swatches once Leaving the Shape Builder saved every one of its options, so preferences from earlier versions hold pickColorFrom "artwork" whether or not it was picked, and kept the old default after Color Swatches became the default. The preferences now carry toolSettingsVersion, written as 1 once a tool setting is stored. Applying preferences without it changes a saved Shape Builder pickColorFrom "artwork" to "swatches" and writes the version, so Artwork picked after that is kept at the next launch. A saved "swatches" and preferences without a saved pickColorFrom are unchanged. Docs: docs/mcp.md and the tool options params text. --- crates/engine/src/cmd/prefscmds.rs | 2 + crates/engine/src/prefs.rs | 36 ++++++++++++++++ crates/engine/src/tests/toolsettings.rs | 55 ++++++++++++++++++------- crates/engine/src/tooling.rs | 1 + crates/mcp/src/ui_catalog.rs | 2 +- crates/tools/src/builder.rs | 3 +- crates/ui-egui/src/menus/ui_commands.rs | 2 +- docs/mcp.md | 3 +- 8 files changed, 86 insertions(+), 18 deletions(-) diff --git a/crates/engine/src/cmd/prefscmds.rs b/crates/engine/src/cmd/prefscmds.rs index 27d38e158f..8420e67d30 100644 --- a/crates/engine/src/cmd/prefscmds.rs +++ b/crates/engine/src/cmd/prefscmds.rs @@ -725,6 +725,8 @@ impl Session { for e in self.prefs.keep_folders(&mut p) { log::warn!("{e}"); } + // Tool settings saved by an earlier version are updated once. + p.migrate_tool_settings(); // Saved gradient presets get names no built-in preset or other saved one has. for (old, new) in super::gradpresets::rename_clashing_presets(&mut p.gradient_presets) { log::warn!("saved gradient preset {old} is listed as {new}: another preset has its name"); diff --git a/crates/engine/src/prefs.rs b/crates/engine/src/prefs.rs index 1a7b78a91b..3c2f3e3299 100644 --- a/crates/engine/src/prefs.rs +++ b/crates/engine/src/prefs.rs @@ -438,6 +438,12 @@ pub struct Prefs { /// resetting the preferences keeps them; `tool.setOption` edits them. #[serde(skip_serializing_if = "std::collections::BTreeMap::is_empty")] pub tool_settings: std::collections::BTreeMap>, + /// The version of [`Self::tool_settings`]: [`TOOL_SETTINGS_VERSION`] once this version stores + /// or updates a tool setting, 0 while none is stored and in preferences saved without one. + /// [`Prefs::migrate_tool_settings`] updates older tool settings once. Not a Preferences dialog + /// field: resetting the preferences keeps it. + #[serde(default, skip_serializing_if = "is_zero")] + pub tool_settings_version: u32, /// View → Perspective Grid presets: the user's (the built-in ones aren't stored). A local /// library, not a Preferences dialog field: resetting the preferences keeps it; /// `perspective.presets.*` edit it. @@ -464,7 +470,36 @@ pub const KEY_HOLD_DELAY: f64 = 0.35; /// The range of the Hold Shortcut Delay, in seconds. pub const KEY_HOLD_DELAY_RANGE: (f64, f64) = (0.2, 1.0); +/// The version of the tool settings these preferences write ([`Prefs::tool_settings_version`]). +/// Version 1 makes Color Swatches the Shape Builder's Pick Color From. +pub const TOOL_SETTINGS_VERSION: u32 = 1; + +fn is_zero(v: &u32) -> bool { + *v == 0 +} + impl Prefs { + /// Update tool settings saved by an earlier version to [`TOOL_SETTINGS_VERSION`], once. Before + /// version 1, leaving the Shape Builder saved its `pickColorFrom` whether or not it was + /// changed, so a saved `artwork` becomes `swatches`. Without tool settings, nothing changes; a + /// version newer than this one is kept. + pub fn migrate_tool_settings(&mut self) { + if self.tool_settings_version < 1 + && let Some(saved) = self.tool_settings.get_mut("shapeBuilder") + && saved.get("pickColorFrom").and_then(Value::as_str) == Some("artwork") + { + saved.insert("pickColorFrom".into(), Value::from("swatches")); + } + self.mark_tool_settings_current(); + } + + /// Record that [`Self::tool_settings`], when any is stored, is in this version's form. + pub(crate) fn mark_tool_settings_current(&mut self) { + if !self.tool_settings.is_empty() { + self.tool_settings_version = self.tool_settings_version.max(TOOL_SETTINGS_VERSION); + } + } + /// The `document.open` / place params `p` with `embeddedFonts: false` added when Preferences /// › File Handling › Use fonts embedded in imported PDFs is off and `p` gives no choice of its own. pub fn with_pdf_font_choice(&self, p: &serde_json::Value) -> serde_json::Value { @@ -672,6 +707,7 @@ impl Default for Prefs { use_registration_point_for_symbol: false, show_on_shape_creation: false, tool_settings: Default::default(), + tool_settings_version: 0, perspective_presets: vec![], blend_options: None, perspective_widget: Default::default(), diff --git a/crates/engine/src/tests/toolsettings.rs b/crates/engine/src/tests/toolsettings.rs index 76fda42a5b..db1fc01a30 100644 --- a/crates/engine/src/tests/toolsettings.rs +++ b/crates/engine/src/tests/toolsettings.rs @@ -700,26 +700,53 @@ fn a_parametric_shape_kind_and_its_values_set_together() { } /// The Shape Builder picks colors from the color swatches by default: a fresh session, and saved -/// preferences that hold other Shape Builder options but no `pickColorFrom`, give `swatches`. A -/// saved `artwork` (or `swatches`) is kept. +/// preferences that hold other Shape Builder options but no `pickColorFrom`, give `swatches`. +/// Preferences saved without `toolSettingsVersion` read a saved `artwork` as `swatches` once and +/// are then written with the version, so a later `artwork` is kept. A saved `swatches` is kept. #[test] -fn shape_builder_pick_color_from_defaults_to_swatches_and_keeps_a_saved_choice() { +fn shape_builder_pick_color_from_defaults_to_swatches_and_migrates_a_saved_artwork_once() { let mut s = session(); select(&mut s, "shapeBuilder"); assert_eq!(s.tool_options()["pickColorFrom"], json!("swatches"), "a fresh session"); - for (saved, want) in [ - (json!({"highlightFill": false}), "swatches"), - (json!({"pickColorFrom": "artwork"}), "artwork"), - (json!({"pickColorFrom": "swatches"}), "swatches"), - ] { - let mut prefs = s.prefs.clone(); - prefs.tool_settings.insert("shapeBuilder".into(), saved.as_object().unwrap().clone()); - let saved_text = serde_json::to_string(&prefs).unwrap(); + select(&mut s, "selection"); + assert_eq!(s.prefs.to_json()["toolSettingsVersion"], json!(1), "stored settings are written with the version"); + let load = |version: Option, saved: &Value| { + let mut prefs = Prefs::default().to_json(); + prefs["toolSettings"] = json!({ "shapeBuilder": saved }); + let fields = prefs.as_object_mut().unwrap(); + match version { + Some(v) => fields.insert("toolSettingsVersion".into(), json!(v)), + None => fields.remove("toolSettingsVersion"), + }; let mut next = session(); - next.apply_prefs(serde_json::from_str(&saved_text).unwrap()); + next.apply_prefs(serde_json::from_str(&prefs.to_string()).unwrap()); + next + }; + for (version, saved, want) in [ + (None, json!({"highlightFill": false}), "swatches"), + (None, json!({"pickColorFrom": "artwork"}), "swatches"), + (None, json!({"pickColorFrom": "swatches"}), "swatches"), + (Some(1), json!({"pickColorFrom": "artwork"}), "artwork"), + (Some(1), json!({"pickColorFrom": "swatches"}), "swatches"), + (Some(1), json!({"highlightFill": false}), "swatches"), + ] { + let mut next = load(version, &saved); + assert_eq!(next.prefs.tool_settings_version, 1, "the version is written: {version:?} {saved}"); select(&mut next, "shapeBuilder"); - assert_eq!(next.tool_options()["pickColorFrom"], json!(want), "saved {saved}"); + assert_eq!(next.tool_options()["pickColorFrom"], json!(want), "saved {version:?} {saved}"); select(&mut next, "selection"); - assert_eq!(next.prefs.tool_settings["shapeBuilder"]["pickColorFrom"], json!(want), "stored again: {saved}"); + assert_eq!(next.prefs.tool_settings["shapeBuilder"]["pickColorFrom"], json!(want), "stored again: {version:?} {saved}"); + } + // Artwork picked after the update, or in a session that started without saved settings, is + // kept at the next launch. + for mut next in [load(None, &json!({"pickColorFrom": "artwork"})), session()] { + select(&mut next, "shapeBuilder"); + next.set_tool_option("pickColorFrom", &json!("artwork")); + select(&mut next, "selection"); + let saved_text = serde_json::to_string(&next.prefs).unwrap(); + let mut later = session(); + later.apply_prefs(serde_json::from_str(&saved_text).unwrap()); + select(&mut later, "shapeBuilder"); + assert_eq!(later.tool_options()["pickColorFrom"], json!("artwork"), "picked after the update: {saved_text}"); } } diff --git a/crates/engine/src/tooling.rs b/crates/engine/src/tooling.rs index 422caab5ec..94f72f6441 100644 --- a/crates/engine/src/tooling.rs +++ b/crates/engine/src/tooling.rs @@ -581,6 +581,7 @@ impl Session { } } } + prefs.mark_tool_settings_current(); } /// Keep the active tool's persistent options for the next time it, or a tool sharing them, is diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index b6f0866d96..e933df1e5f 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1192,7 +1192,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "tool.options", "Tool Options…", "", - "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), curvatureCircle → Curvature Circle Tool Options (dialog `curvatureCircleOptions`, fields snapTolerance (screen points, 1–40; 5), snapWithoutGuides, annotateRadius, standardAnchors and constantRadius (all on); OK runs tool.setOption {tool: \"curvatureCircle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (swatches; a saved artwork is kept), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), fillArea → the same Shape Builder Tool Options (Fill Area uses their gapDetection, gapLength and openFilledAsClosed), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", + "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), curvatureCircle → Curvature Circle Tool Options (dialog `curvatureCircleOptions`, fields snapTolerance (screen points, 1–40; 5), snapWithoutGuides, annotateRadius, standardAnchors and constantRadius (all on); OK runs tool.setOption {tool: \"curvatureCircle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (swatches; a saved artwork is kept, except that preferences saved by an earlier version read it as swatches once), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), fillArea → the same Shape Builder Tool Options (Fill Area uses their gapDetection, gapLength and openFilledAsClosed), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", ), ( "ui.colorGuideOptions", diff --git a/crates/tools/src/builder.rs b/crates/tools/src/builder.rs index 42886ec013..7451fd0226 100644 --- a/crates/tools/src/builder.rs +++ b/crates/tools/src/builder.rs @@ -70,7 +70,8 @@ pub struct ShapeBuilderOptions { /// fills the new shape with the current fill, and the Left and Right arrow keys step the current /// fill through the document's color swatches. With Artwork, the shape takes the look of the /// object where the drag starts, else of the one where it ends, else of the front-most selected - /// object. A saved `pickColorFrom` is kept; preferences without one take Color Swatches. + /// object. A saved `pickColorFrom` is kept, except that preferences saved by an earlier version + /// read a saved Artwork as Color Swatches once; preferences without one take Color Swatches. pub swatches: bool, /// Cursor Swatch Preview (`cursorSwatchPreview`, off): with Color Swatches, the current fill /// and the swatches before and after it show as chips above the pointer while no drag is on. diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index e76772d154..a4620e2a5b 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -1193,7 +1193,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "tool.options", "Tool Options…", "", - "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), curvatureCircle → Curvature Circle Tool Options (dialog `curvatureCircleOptions`, fields snapTolerance (screen points, 1–40; 5), snapWithoutGuides, annotateRadius, standardAnchors and constantRadius (all on); OK runs tool.setOption {tool: \"curvatureCircle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (swatches; a saved artwork is kept), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), fillArea → the same Shape Builder Tool Options (Fill Area uses their gapDetection, gapLength and openFilledAsClosed), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", + "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), curvatureCircle → Curvature Circle Tool Options (dialog `curvatureCircleOptions`, fields snapTolerance (screen points, 1–40; 5), snapWithoutGuides, annotateRadius, standardAnchors and constantRadius (all on); OK runs tool.setOption {tool: \"curvatureCircle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (swatches; a saved artwork is kept, except that preferences saved by an earlier version read it as swatches once), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), fillArea → the same Shape Builder Tool Options (Fill Area uses their gapDetection, gapLength and openFilledAsClosed), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", ), ( "ui.colorGuideOptions", diff --git a/docs/mcp.md b/docs/mcp.md index 5ec8ceafd4..d2c7096762 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -15729,7 +15729,8 @@ as an unfilled path does), `pickColorFrom` (`swatches`, the default: a merged sh the Left and Right arrow keys without Shift, Alt or Cmd/Ctrl step the current fill through the document's color swatches; `artwork`: a merged shape takes the appearance, opacity and blending mode of the front-most selected object under the drag's first point, else of the one under its last point, else of the front-most selected object; a -`pickColorFrom` saved with the preferences is kept, and preferences saved without one take `swatches`), `cursorSwatchPreview` (off; with `swatches`, chips above the +`pickColorFrom` saved with the preferences is kept, except that preferences saved by an earlier version, without +`toolSettingsVersion`, read a saved `artwork` as `swatches` once; preferences saved without one take `swatches`), `cursorSwatchPreview` (off; with `swatches`, chips above the pointer show the current fill and the swatches before and after it), `selection` (`freeform`, the default, or `straightLine`: a drag touches what the line from its first point to the pointer crosses), `highlightFill` (on by default; when it is off, merge mode shades no regions), `gapDetection` (off) with `gapLength` (pt, 0 to 72; 3), `clickStrokeSplitsPath` (In Merge Mode, From 932d579a02a751d2ab35a7023ce85e31d7627d09 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 20:08:36 -0800 Subject: [PATCH 062/105] Swatches: rustfmt the idle replay test --- crates/ui-egui/src/panels/swatches/tests.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/panels/swatches/tests.rs b/crates/ui-egui/src/panels/swatches/tests.rs index df72fa25e1..7e17c305a5 100644 --- a/crates/ui-egui/src/panels/swatches/tests.rs +++ b/crates/ui-egui/src/panels/swatches/tests.rs @@ -1630,9 +1630,8 @@ fn the_swatch_libraries_menu_fits_its_rows_like_a_library_panels_menu() { fn idle_frames_replay_the_swatch_rows() { use crate::tests::panel_harness::Panel; use craft::ui::testing::{MemoRun, last_frame_memo_runs}; - let runs = |panel: &Panel| { - last_frame_memo_runs(panel.ctx()).iter().filter(|(name, _, run)| name.contains("ListProps") && *run == MemoRun::Ran).count() - }; + let runs = + |panel: &Panel| last_frame_memo_runs(panel.ctx()).iter().filter(|(name, _, run)| name.contains("ListProps") && *run == MemoRun::Ran).count(); let idle = |panel: &mut Panel, after: &str| { panel.frame(); panel.frame(); From 72825d55a6f5cc1a962d469b1ea1b1793fb7524e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 20:10:22 -0800 Subject: [PATCH 063/105] Dependencies: craft-libs pin to 6a4729d5, current main --- Cargo.lock | 172 ++++++++++++++++---------------- Cargo.toml | 76 +++++++------- apps/vectorcraft-web/Cargo.toml | 2 +- xtask/src/pdf_deps.rs | 2 +- 4 files changed, 126 insertions(+), 126 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 318a40b796..02efc93f98 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1231,7 +1231,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-automation", "craft-behavior", @@ -1272,7 +1272,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "crc32fast", "flate2", @@ -1283,7 +1283,7 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "block2 0.6.2", "objc2 0.6.5", @@ -1295,7 +1295,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "rustix 1.1.6", ] @@ -1303,7 +1303,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1328,7 +1328,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1346,7 +1346,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-docpath", @@ -1364,7 +1364,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "crc32fast", "flate2", @@ -1373,7 +1373,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "egui", ] @@ -1381,7 +1381,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "md-5", "rayon", @@ -1390,12 +1390,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-cms", @@ -1415,7 +1415,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-control-protocol", "craft-platform", @@ -1426,7 +1426,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1436,7 +1436,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "rayon", ] @@ -1444,7 +1444,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1470,7 +1470,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "blake3", "craft-ecproj-format", @@ -1486,7 +1486,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "serde", ] @@ -1494,7 +1494,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1513,7 +1513,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-codepage", "encoding_rs", @@ -1525,7 +1525,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "serde", "serde_json", @@ -1535,12 +1535,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1555,7 +1555,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1574,7 +1574,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1583,7 +1583,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "cap-primitives", "craft-atomic", @@ -1606,12 +1606,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "gif", ] @@ -1619,7 +1619,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "flate2", ] @@ -1627,7 +1627,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1640,7 +1640,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "brotli 9.1.3", "brotli-decompressor 6.3.2", @@ -1670,7 +1670,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-dds", "craft-jpeg", @@ -1697,7 +1697,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1715,7 +1715,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "thiserror 2.0.21", ] @@ -1723,7 +1723,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1734,7 +1734,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-host", "craft-i18n", @@ -1749,7 +1749,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-i18n", @@ -1763,7 +1763,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-host", @@ -1781,7 +1781,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1793,7 +1793,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "encoding_rs", "image", @@ -1804,7 +1804,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "chrono", "craft-codepage", @@ -1814,7 +1814,7 @@ dependencies = [ [[package]] name = "craft-nightly" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "uds_windows", "winsafe", @@ -1823,7 +1823,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-keymap", @@ -1839,7 +1839,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "flate2", "serde", @@ -1850,7 +1850,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1862,7 +1862,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "async-channel", "async-io", @@ -1895,7 +1895,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1904,7 +1904,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-host", @@ -1928,7 +1928,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1939,7 +1939,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-eps", "flate2", @@ -1953,7 +1953,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "encoding_rs", "flate2", @@ -1964,7 +1964,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "dispatch2", "egui", @@ -1977,7 +1977,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1996,7 +1996,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-atomic", "craft-host", @@ -2013,7 +2013,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "fax", "hayro-ccitt", @@ -2024,7 +2024,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2045,7 +2045,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-keymap", @@ -2057,7 +2057,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2082,7 +2082,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2097,7 +2097,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-atomic", "craft-behavior", @@ -2112,7 +2112,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "serde", "thiserror 2.0.21", @@ -2122,7 +2122,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "serde", "thiserror 2.0.21", @@ -2131,7 +2131,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-keymap", @@ -2146,12 +2146,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2165,7 +2165,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-i18n", @@ -2181,7 +2181,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "accesskit", "craft-behavior", @@ -2219,7 +2219,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2230,7 +2230,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-host", @@ -2248,7 +2248,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-host", @@ -2269,7 +2269,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-host", @@ -2290,7 +2290,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-host", @@ -2309,7 +2309,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "base64 0.22.1", "chrono", @@ -2341,7 +2341,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "flate2", "serde", @@ -2352,7 +2352,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2362,7 +2362,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "js-sys", "serde_json", @@ -2373,7 +2373,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "winsafe", ] @@ -2381,7 +2381,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-appkit", "craft-atomic", @@ -2413,7 +2413,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3768,7 +3768,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "brotli 8.0.4", "hayro-postscript", @@ -3777,7 +3777,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3795,7 +3795,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3813,12 +3813,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "flate2", "hayro-ccitt", @@ -4801,7 +4801,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4958,7 +4958,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "arrayvec", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index dc46672d51..f7fc21065d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,51 +10,51 @@ license = "MIT OR Apache-2.0" rust-version = "1.95" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # Language packs: the Craft apps' shared font store installs them (#4936). -craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON. -craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names # the members it imports. -craft = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui # without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes. -craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # Nightly profile isolation, launch protocol, and security fence. -craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -194,13 +194,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } emath = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } epaint = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index 0e50690b98..cb731d92aa 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -28,7 +28,7 @@ egui_extras = { workspace = true } # `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback. eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] } # The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft. -craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index 4d937f436f..43f0122072 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "891f4060c4aefe2679a65afc9e76bb5ce345de31"; +const REV: &str = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV), From ad642cb34cb47e24894c18d699984f9494be0807 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 29 Nov 2026 23:25:07 -0500 Subject: [PATCH 064/105] ci(nightly): enable automated daily schedule (06:30 UTC) and Stage 2 signer dispatch (#9959) * ci(nightly): roll out signing pin, macOS docs layout, and profile reopen fix * ci(nightly): enable automated daily schedule and Stage 2 signer dispatch --- .github/nightly-signing-policy.json | 4 ++- .github/workflows/nightly-dispatch.yml | 4 +-- .github/workflows/nightly.yml | 5 ++-- packaging/nightly-release-tests.py | 34 +++++++++++++++++--------- 4 files changed, 31 insertions(+), 16 deletions(-) diff --git a/.github/nightly-signing-policy.json b/.github/nightly-signing-policy.json index 6427f339db..55d2a1983c 100644 --- a/.github/nightly-signing-policy.json +++ b/.github/nightly-signing-policy.json @@ -123,7 +123,9 @@ } }, "max_artifact_bytes": 2147483648, - "automatic_signer_actors": [], + "automatic_signer_actors": [ + "github-actions[bot]" + ], "platforms": { "windows-x86_64": { "unsigned_artifact_name": "nightly-unsigned-windows-x86_64", diff --git a/.github/workflows/nightly-dispatch.yml b/.github/workflows/nightly-dispatch.yml index dd4a4a02da..4ef372c40b 100644 --- a/.github/workflows/nightly-dispatch.yml +++ b/.github/workflows/nightly-dispatch.yml @@ -11,9 +11,9 @@ permissions: {} jobs: dispatch: - # SOURCE PREPARATION: literal off until immutable shared tooling and policy qualification. + # Enabled for automated scheduled producer completions on main. if: >- - false && github.repository == 'storytold/vectorcraft' && + github.repository == 'storytold/vectorcraft' && github.event_name == 'workflow_run' runs-on: ubuntu-latest timeout-minutes: 5 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0e963e43e1..c2224a81ba 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,8 +1,9 @@ name: VectorCraft unsigned nightly -# Enabled for supervised manual runs by the reviewed manual actor only; no schedule yet. -# A later explicit opt-in may add a cadence (and turn on nightly-dispatch.yml with it). +# Automated daily nightly builds at 06:30 UTC, plus supervised manual runs by reviewed manual actors. on: + schedule: + - cron: '30 6 * * *' workflow_dispatch: permissions: diff --git a/packaging/nightly-release-tests.py b/packaging/nightly-release-tests.py index 9738b641bd..2729b40282 100755 --- a/packaging/nightly-release-tests.py +++ b/packaging/nightly-release-tests.py @@ -244,15 +244,21 @@ class TrustedSourcePreparation(unittest.TestCase): self.assertTrue(literal_off("${{ false }}")) self.assertTrue(literal_off("false && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')")) - def test_no_nightly_schedule_is_registered(self): - for name, event in (("nightly.yml", "workflow_dispatch"), - ("nightly-sign.yml", "workflow_dispatch")): + def test_nightly_triggers_and_schedule_contract(self): + expected_triggers = { + "nightly.yml": [" schedule:", " workflow_dispatch:"], + "nightly-sign.yml": [" workflow_dispatch:"], + } + for name, expected in expected_triggers.items(): source = (ROOT / ".github/workflows" / name).read_text() events = source.split("\non:\n", 1)[1].split("\npermissions:", 1)[0] triggers = [line for line in events.splitlines() if line.startswith(" ") and not line.startswith(" ") and line.strip() and not line.lstrip().startswith("#")] with self.subTest(workflow=name): - self.assertEqual(triggers, [f" {event}:"], "schedule/activation needs explicit review") + self.assertEqual(triggers, expected, "workflow triggers must match the reviewed schedule contract") + producer = (ROOT / ".github/workflows/nightly.yml").read_text() + crons = re.findall(r"(?m)^ - cron: '([^']+)'$", producer) + self.assertEqual(crons, ["30 6 * * *"], "scheduled nightly cadence must stay at 06:30 UTC") def test_signer_serialization_contract_is_enforced(self): assert_nightly_serialization((ROOT / ".github/workflows/nightly-sign.yml").read_text()) @@ -387,7 +393,8 @@ class NightlyEnabledCallers(unittest.TestCase): source = (ROOT / ".github/workflows/nightly.yml").read_text() policy = json.loads(INSTALLED_POLICY.read_text()) self.assertEqual(reviewed_manual_actors(source, policy), RELEASE_MANAGERS) - self.assertEqual(policy["automatic_signer_actors"], [], "no automatic signer without a schedule") + self.assertEqual(policy["automatic_signer_actors"], ["github-actions[bot]"], + "scheduled dispatch signs only as github-actions[bot]") def test_an_actor_outside_the_release_managers_is_refused(self): source = (ROOT / ".github/workflows/nightly.yml").read_text() @@ -869,19 +876,24 @@ def dispatch_triggers(source): class NightlyDispatchTransport(unittest.TestCase): - """The scheduled transport stays literally off and can only reach the signer branch.""" + """The scheduled transport keeps its exact context guard and can only reach the signer branch.""" + + EXPECTED_GUARD = "github.repository == 'storytold/vectorcraft' && github.event_name == 'workflow_run'" def setUp(self): self.source = (ROOT / ".github/workflows/nightly-dispatch.yml").read_text() - def test_every_dispatch_job_is_literal_off(self): + def test_dispatch_job_keeps_exact_context_guard(self): jobs = self.source.split("\njobs:\n", 1)[1] headers = re.findall(r"(?m)^ (?![\s#])[^\n]+", jobs) conditions = job_conditions(jobs) - self.assertTrue(headers) - self.assertEqual(len(conditions), len(headers), "every job needs a literal-off condition") - for _, expression in conditions: - self.assertTrue(literal_off(expression), "nightly activation requires reviewed test update") + self.assertEqual(headers, [" dispatch:"]) + self.assertEqual(len(conditions), 1, "dispatch job needs its exact context guard") + indicator, expression = conditions[0] + self.assertEqual(indicator, ">-") + self.assertEqual(" ".join(expression.split()), self.EXPECTED_GUARD, + "dispatch context guard may only change with review") + self.assertFalse(literal_off(expression), "scheduled dispatch transport must be enabled") def test_only_a_completed_scheduled_producer_is_transported(self): self.assertEqual(re.findall(r"(?m)^ workflows: (.+)$", self.source), From 32a5fef78df4046086b44083eab0ef7ecea1ea72 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 21:37:32 -0800 Subject: [PATCH 065/105] Layers: a selection change keeps the panel's row order The Layers panel built its row order again on every selection change: each change made a new Tracked for the rows, and the rows reported no order revision, so the panel asked every row for the rows inside it (7 calls for the 6 rows of the new test's document). - LayerRows reports LayerTree::order_revision: a hash of the document, the open rows, Show Layers Only and the isolated node. The selection, the highlighted rows, the current layer and the names are not in it. - refresh_rows writes new rows into the kept Tracked while the document (uid and revert count) stays the same, and makes a new Tracked for another document or after File > Revert. - The craft-libs pin moves from 186a229c8 to aa7e668ec, current craft-libs main, which has craft-libs#4319 (LayerTree::order_revision). The winit rev moves to 0dfcec0eb, as craft-libs pins it; egui stays at 14c39fed1. xtask pdf-deps checks the new rev. craft-nightly keeps the rev main pins it at. Two tests failed on the new craft-libs: - canvas::tests::a_selection_drag_draws_its_marks_in_the_frame_the_pointer_moves: since craft-libs#4143 a frame runs one pass where it ran two, and the bounding box, Live Corners, hollow corners and shape widgets were drawn before the tool host took the frame's pointer event, so the box showed at the old corner. They are now drawn after it, into paint slots kept in their old order. - tests::nativemenu::applying_a_dialog_preview_reads_the_menus: since craft-libs#4350 the closed dialog's angle field gives up the keys one frame sooner, so the menus are sent again without the text-editing gate within the frames the test ran. The test now waits for the gate and counts the read and that send apart. --- Cargo.lock | 211 +++++++++++----------- Cargo.toml | 76 ++++---- apps/vectorcraft-web/Cargo.toml | 2 +- crates/ui-egui/src/canvas.rs | 22 ++- crates/ui-egui/src/panels/layers.rs | 25 ++- crates/ui-egui/src/panels/layers/model.rs | 29 ++- crates/ui-egui/src/panels/layers/tests.rs | 75 ++++++++ crates/ui-egui/src/tests/nativemenu.rs | 18 +- xtask/src/pdf_deps.rs | 2 +- 9 files changed, 295 insertions(+), 165 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4fce3ecad1..9c3989051d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -626,12 +626,6 @@ dependencies = [ "cpufeatures 0.3.1", ] -[[package]] -name = "block" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" - [[package]] name = "block-buffer" version = "0.10.4" @@ -725,6 +719,17 @@ dependencies = [ "brotli-decompressor 5.0.3", ] +[[package]] +name = "brotli" +version = "9.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9071f285ed78f04f37d675abaaef5de7689e2f30a216c8dc6795465d81910a13" +dependencies = [ + "alloc-no-stdlib 3.0.0", + "alloc-stdlib 0.3.0", + "brotli-decompressor 6.3.2", +] + [[package]] name = "brotli-decompressor" version = "5.0.3" @@ -1184,19 +1189,6 @@ dependencies = [ "libc", ] -[[package]] -name = "core-graphics2" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b65858d95344d2711161cd92196732f67d6c5fea238cf12f994584828731a5c" -dependencies = [ - "bitflags 2.13.2", - "block", - "cfg-if", - "core-foundation 0.10.1", - "libc", -] - [[package]] name = "core_detect" version = "1.0.0" @@ -1239,7 +1231,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-automation", "craft-behavior", @@ -1280,7 +1272,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "crc32fast", "flate2", @@ -1291,18 +1283,19 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "block2 0.6.2", "objc2 0.6.5", "objc2-app-kit 0.3.2", + "objc2-core-graphics", "objc2-foundation 0.3.2", ] [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "rustix 1.1.6", ] @@ -1310,7 +1303,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1335,7 +1328,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1353,7 +1346,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-behavior", "craft-docpath", @@ -1371,7 +1364,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "crc32fast", "flate2", @@ -1380,7 +1373,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "egui", ] @@ -1388,7 +1381,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "md-5", "rayon", @@ -1397,12 +1390,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-behavior", "craft-cms", @@ -1422,7 +1415,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-control-protocol", "craft-platform", @@ -1433,7 +1426,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1443,7 +1436,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "rayon", ] @@ -1451,7 +1444,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1477,7 +1470,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "blake3", "craft-ecproj-format", @@ -1493,7 +1486,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "serde", ] @@ -1501,7 +1494,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1520,7 +1513,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-codepage", "encoding_rs", @@ -1532,7 +1525,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "serde", "serde_json", @@ -1542,12 +1535,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1562,7 +1555,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1581,7 +1574,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1590,7 +1583,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "cap-primitives", "craft-atomic", @@ -1613,12 +1606,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "gif", ] @@ -1626,7 +1619,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "flate2", ] @@ -1634,7 +1627,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1647,8 +1640,10 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ + "brotli 9.1.3", + "brotli-decompressor 6.3.2", "chrono", "fixed_decimal", "icu_calendar", @@ -1675,7 +1670,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-dds", "craft-jpeg", @@ -1702,7 +1697,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1720,7 +1715,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "thiserror 2.0.21", ] @@ -1728,7 +1723,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1739,7 +1734,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-host", "craft-i18n", @@ -1754,7 +1749,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-behavior", "craft-i18n", @@ -1768,7 +1763,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-behavior", "craft-host", @@ -1786,7 +1781,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1798,7 +1793,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "encoding_rs", "image", @@ -1809,7 +1804,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "chrono", "craft-codepage", @@ -1827,7 +1822,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-behavior", "craft-keymap", @@ -1843,7 +1838,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "flate2", "serde", @@ -1854,7 +1849,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1866,12 +1861,12 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "async-channel", "async-io", "async-process", - "core-graphics2", + "craft-appkit", "craft-atomic", "craft-docpath", "craft-host", @@ -1881,6 +1876,8 @@ dependencies = [ "js-sys", "log", "objc2-app-kit 0.3.2", + "objc2-core-foundation", + "objc2-core-graphics", "rfd", "serde", "serde_json", @@ -1897,7 +1894,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1906,7 +1903,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-behavior", "craft-host", @@ -1930,7 +1927,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1941,7 +1938,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-eps", "flate2", @@ -1955,7 +1952,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "encoding_rs", "flate2", @@ -1966,7 +1963,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "dispatch2", "egui", @@ -1979,7 +1976,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1998,7 +1995,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-atomic", "craft-host", @@ -2015,7 +2012,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "fax", "hayro-ccitt", @@ -2026,7 +2023,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2047,7 +2044,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-behavior", "craft-keymap", @@ -2059,7 +2056,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2084,7 +2081,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2099,7 +2096,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-atomic", "craft-behavior", @@ -2114,7 +2111,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "serde", "thiserror 2.0.21", @@ -2124,7 +2121,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "serde", "thiserror 2.0.21", @@ -2133,7 +2130,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-behavior", "craft-keymap", @@ -2148,12 +2145,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2167,7 +2164,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-behavior", "craft-i18n", @@ -2183,7 +2180,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "accesskit", "craft-behavior", @@ -2221,7 +2218,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2232,7 +2229,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-behavior", "craft-host", @@ -2250,7 +2247,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-behavior", "craft-host", @@ -2271,7 +2268,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-behavior", "craft-host", @@ -2292,7 +2289,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-behavior", "craft-host", @@ -2311,7 +2308,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "base64 0.22.1", "chrono", @@ -2343,7 +2340,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "flate2", "serde", @@ -2354,7 +2351,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2364,7 +2361,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "js-sys", "serde_json", @@ -2375,7 +2372,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "winsafe", ] @@ -2383,7 +2380,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "craft-appkit", "craft-atomic", @@ -2415,7 +2412,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3770,16 +3767,16 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ - "brotli", + "brotli 8.0.4", "hayro-postscript", ] [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3797,7 +3794,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3815,12 +3812,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "flate2", "hayro-ccitt", @@ -4803,7 +4800,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4960,7 +4957,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ "arrayvec", "kurbo 0.13.1", @@ -10076,7 +10073,7 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winit" version = "0.30.13" -source = "git+https://github.com/storytold/winit.git?rev=a517b3846ee8457d84ee4975110bfda6797c44dc#a517b3846ee8457d84ee4975110bfda6797c44dc" +source = "git+https://github.com/storytold/winit.git?rev=0dfcec0eb62fda5904137a63a6dd0c3d83295f45#0dfcec0eb62fda5904137a63a6dd0c3d83295f45" dependencies = [ "ahash", "android-activity", diff --git a/Cargo.toml b/Cargo.toml index cc76d129c5..f7aa86aff7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,49 +10,49 @@ license = "MIT OR Apache-2.0" rust-version = "1.95" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } # Language packs: the Craft apps' shared font store installs them (#4936). -craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } # The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON. -craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } # The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names # the members it imports. -craft = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } # Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui # without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes. -craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } # Nightly profile isolation, launch protocol, and security fence. craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "1f6c3a21f85ed96f8fd4ddd5a959d4e1edbedb24" } # internal @@ -194,13 +194,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } emath = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } epaint = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } @@ -212,4 +212,4 @@ egui_glow = { git = "https://github.com/storytold/egui.git", rev = "14c39fed1817 egui_extras = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } eframe = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } -winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" } +winit = { git = "https://github.com/storytold/winit.git", rev = "0dfcec0eb62fda5904137a63a6dd0c3d83295f45" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index ce4d1d3d44..0a3a273fcc 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -28,7 +28,7 @@ egui_extras = { workspace = true } # `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback. eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] } # The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft. -craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index f340f3bac2..d4c31c90d0 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -278,8 +278,8 @@ pub(crate) fn show_document(app: &mut VectorcraftApp, ui: &mut Ui, win: Win, kin pressed } -/// The body of the canvas in order: controls that take presses first, the tool host, the selection's marks, the -/// picture last. +/// The body of the canvas in order: controls that take presses first, the tool host, the selection's marks and the +/// widgets that take no press, the picture last. fn show_body(app: &mut VectorcraftApp, ui: &mut Ui, space: &CanvasSpace, pass: Option<&ToolPass>, win: Win, kind: BodyKind) -> Body { let live = kind == BodyKind::Live; let presenting = app.ui.screen_mode == 3; @@ -299,11 +299,12 @@ fn show_body(app: &mut VectorcraftApp, ui: &mut Ui, space: &CanvasSpace, pass: O crate::dialogs::simplify_slider::show(app, ui, &space.view); } guides::show(app, ui, space, win, kind); - widgets::show_hollow_corners(app, ui, space, kind); - // The selection's marks paint here, under the widgets and bars, and are drawn after the tool host has taken this + // The hollow corners, the selection's marks and the bounding box with the shape widgets paint here, in that order, + // under the 3D handles and the bars. They take no press, so they are drawn after the tool host has taken this // frame's pointer event, from the document as the event leaves it. + let hollow = PaintSlot::reserve(ui.painter()); let marks = PaintSlot::reserve(ui.painter()); - widgets::show(app, ui, space, win, kind); + let boxes = PaintSlot::reserve(ui.painter()); if !presenting && !revolve_editing(app) { crate::panels::three_d::handles::show(app, ui, space); } @@ -340,8 +341,17 @@ fn show_body(app: &mut VectorcraftApp, ui: &mut Ui, space: &CanvasSpace, pass: O } } let after = PaintSlot::reserve(ui.painter()); + widgets::show_hollow_corners(app, ui, space, kind); + let hollow_shapes = after.take_after(ui.ctx()); + let after = PaintSlot::reserve(ui.painter()); selection::show(app, ui, space, win, kind); - marks.extend(ui.ctx(), after.take_after(ui.ctx())); + let mark_shapes = after.take_after(ui.ctx()); + let after = PaintSlot::reserve(ui.painter()); + widgets::show(app, ui, space, win, kind); + let box_shapes = after.take_after(ui.ctx()); + hollow.extend(ui.ctx(), hollow_shapes); + marks.extend(ui.ctx(), mark_shapes); + boxes.extend(ui.ctx(), box_shapes); drops::show(app, ui, win, kind); raster::picture(app, ui, space, win, kind); out diff --git a/crates/ui-egui/src/panels/layers.rs b/crates/ui-egui/src/panels/layers.rs index 2987d350a8..347a22ae83 100644 --- a/crates/ui-egui/src/panels/layers.rs +++ b/crates/ui-egui/src/panels/layers.rs @@ -182,8 +182,9 @@ pub struct LayersUi { /// The selection square clicked last in each open document, by the document's `uid`: where a Shift-click on another /// square starts. pub art_anchors: HashMap, - /// The active document's rows with the [`LayerRows::key`] they were listed at. - rows: Option<(u64, Tracked)>, + /// The active document's rows with the [`LayerRows::key`] they were listed at and the document's `uid` and + /// `reverts`. + rows: Option<(u64, (u64, u64), Tracked)>, } impl Default for LayersUi { @@ -223,7 +224,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { thumbnails.hold(app.session.active().is_some_and(|st| st.interaction.is_some()) || app.session.tool_busy()); let settings = app.ui.layers_panel.settings(); refresh_rows(app); - let (Some(st), Some((_, kept))) = (app.session.active(), &app.ui.layers_ui.rows) else { return }; + let (Some(st), Some((_, _, kept))) = (app.session.active(), &app.ui.layers_ui.rows) else { return }; let tree = DocLayers::of(st, kept); let source = thumbs::LayerThumbs { doc: &st.doc }; let mut panel = LayersPanel::new(kept) @@ -294,13 +295,23 @@ fn unrevealed(app: &mut VectorcraftApp, f: impl FnOnce(&mut VectorcraftApp) - r } -/// Lists the active document's rows again when what they are listed from changed. +/// Lists the active document's rows again when what they are listed from changed. The new rows go into the kept +/// [`Tracked`] while the document is the same, so the panel keeps its display order when the +/// [order revision](LayerRows::order_of) stays; another document, or the same one after File › Revert, gets a new one. fn refresh_rows(app: &mut VectorcraftApp) { let Some(st) = app.session.active() else { return }; let key = LayerRows::key(app, st); - if app.ui.layers_ui.rows.as_ref().is_none_or(|(kept, _)| *kept != key) { - let rows = Tracked::new(LayerRows::new(app, st)); - app.ui.layers_ui.rows = Some((key, rows)); + let doc = (st.uid, st.reverts); + if app.ui.layers_ui.rows.as_ref().is_some_and(|(kept, _, _)| *kept == key) { + return; + } + let new = LayerRows::new(app, st); + match &mut app.ui.layers_ui.rows { + Some((kept, of, rows)) if *of == doc => { + rows.edit(|rows| *rows = new); + *kept = key; + } + slot => *slot = Some((key, doc, Tracked::new(new))), } } diff --git a/crates/ui-egui/src/panels/layers/model.rs b/crates/ui-egui/src/panels/layers/model.rs index c73794b6d0..ecd2d7a954 100644 --- a/crates/ui-egui/src/panels/layers/model.rs +++ b/crates/ui-egui/src/panels/layers/model.rs @@ -202,6 +202,14 @@ pub(super) struct LayerRows { /// In isolation mode, the isolated node: the top row. #[plain_data(assume = "a node id is an integer")] root: Option, + /// What the display order is built from ([`LayerRows::order_of`]). + order: u64, +} + +#[cfg(test)] +thread_local! { + /// How many times [`LayerRows::children`] was asked on this thread. + pub(super) static CHILDREN_CALLS: std::cell::Cell = const { std::cell::Cell::new(0) }; } /// [`LayerRows`] with the editing state of their document, for the panel's host code in one pass. @@ -243,7 +251,9 @@ impl LayerRows { let guide_rows = ruler.iter().enumerate().filter_map(|(i, g)| Some((g.id?, i))).collect(); let blends = st.selection.objects.iter().copied().filter(|id| doc.node(*id).is_some_and(|n| matches!(n.kind, NodeKind::Blend { .. }))); let selected: HashSet = st.selection.objects.iter().copied().collect(); + let root = st.isolation.and_then(|i| isolated_root(doc, i)).map(|(n, ..)| n.id); Self { + order: Self::order_of(doc, &st.layers_open, app.ui.layers_panel.layers_only, root), doc: doc.clone(), opts: app.ui.layers_panel.clone(), xml_id: by_xml_id(app), @@ -258,10 +268,20 @@ impl LayerRows { holding: super::rows::holding(doc, &selected), selected, blends: blends.collect(), - root: st.isolation.and_then(|i| isolated_root(doc, i)).map(|(n, ..)| n.id), + root, } } + /// A hash of everything the display order reads ([`LayerTree::children`] and [`LayerTree::is_open`]): the + /// document, which an edit replaces and a selection change keeps (its ruler guides and an opacity mask being + /// edited are in it), the open rows, Show Layers Only and the isolated node. The selection, the highlighted rows, + /// the current layer, the names and the other Panel Options are not in it. + fn order_of(doc: &Arc, open: &OpenRows, layers_only: bool, root: Option) -> u64 { + let mut hasher = DefaultHasher::new(); + (Arc::as_ptr(doc) as usize, open.generation(), layers_only, root).hash(&mut hasher); + hasher.finish() + } + /// What the rows of `st` are listed from: the document and its revision (which every edit and /// selection change moves), the open rows, isolation mode, the highlighted rows and the current /// layer, the Panel Options, Identify Objects By and the language. @@ -461,6 +481,8 @@ impl LayerTree for LayerRows { /// The top rows are the layers (only the opacity mask's while one is edited), or in isolation /// mode the isolated layer, sublayer, group or object. fn children(&self, parent: Option<&RowId>) -> Vec { + #[cfg(test)] + CHILDREN_CALLS.with(|c| c.set(c.get() + 1)); match parent { None => match self.root { Some(root) => vec![RowId::Node(root)], @@ -491,6 +513,11 @@ impl LayerTree for LayerRows { false } + /// The display order changes only with what [`LayerRows::order_of`] hashes: a selection change keeps it. + fn order_revision(&self) -> Option { + Some(self.order) + } + fn info(&self, id: &RowId) -> LayerInfo { match *id { RowId::Node(id) => match self.doc.node(id) { diff --git a/crates/ui-egui/src/panels/layers/tests.rs b/crates/ui-egui/src/panels/layers/tests.rs index 5eeca21a8e..7492008a2b 100644 --- a/crates/ui-egui/src/panels/layers/tests.rs +++ b/crates/ui-egui/src/panels/layers/tests.rs @@ -1352,3 +1352,78 @@ fn idle_frames_walk_no_node_for_the_selection_squares() { } assert!((1..=12).contains(&(visits() - before)), "a new selection walks the tree once: {}", visits() - before); } + +/// A selection change keeps the panel's display order: no row is asked for the rows inside it. Closing a row, Show +/// Layers Only and an edit build the order again, and the rows follow. +#[test] +fn a_selection_change_keeps_the_display_order() { + use crate::tests::panel_harness::Panel; + let calls = || super::model::CHILDREN_CALLS.with(std::cell::Cell::get); + let (mut app, [_, sub, _, b, a, c]) = nested(); + for (id, name) in [(sub, "Sub"), (b, "B"), (a, "A"), (c, "C")] { + name_row(&mut app, id, name); + } + app.session.execute("select.set", &json!({"ids": [b.0]})).unwrap(); + let mut panel = Panel::new(app, show); + panel.frame(); + let before = calls(); + panel.app().session.execute("select.set", &json!({"ids": [a.0]})).unwrap(); + for _ in 0..3 { + panel.frame(); + } + assert_eq!(calls() - before, 0, "a selection change asks no row for its rows"); + assert!(panel.shows("A") && panel.shows("B"), "the rows stay"); + + expand(&mut panel.app(), &json!({"ids": [sub.0], "open": false})).unwrap(); + let before = calls(); + panel.frame(); + panel.frame(); + assert!(calls() > before, "closing a row builds the order again"); + assert!(!panel.shows("A") && panel.shows("Sub") && panel.shows("C"), "the closed sublayer's rows are gone"); + + panel.app().ui.layers_panel.layers_only = true; + panel.frame(); + panel.frame(); + assert!(!panel.shows("C") && panel.shows("Sub"), "Show Layers Only leaves the objects out"); + + panel.app().ui.layers_panel.layers_only = false; + panel.app().session.execute("object.isolate", &json!({"id": sub.0})).unwrap(); + panel.frame(); + panel.frame(); + assert!(panel.shows("Sub") && !panel.shows("C"), "isolation mode lists only the isolated sublayer"); + panel.app().session.execute("object.exitIsolation", &json!({})).unwrap(); + expand(&mut panel.app(), &json!({"ids": [sub.0], "open": true})).unwrap(); + let made = panel.app().session.execute("shape.rectangle", &json!({"x": 200, "y": 200, "width": 10, "height": 10})).unwrap(); + let d = NodeId(made["id"].as_u64().unwrap()); + name_row(&mut panel.app(), d, "D"); + panel.frame(); + panel.frame(); + assert!(panel.shows("D") && panel.shows("C"), "an edit lists the new object"); +} + +/// The order revision stays through a selection change and moves with the document, the open rows, Show Layers Only +/// and isolation mode. +#[test] +fn the_order_revision_follows_what_the_display_order_reads() { + let order = |app: &VectorcraftApp| LayerRows::new(app, app.session.active().unwrap()).order_revision(); + let (mut app, [_, sub, g, b, a, _]) = nested(); + let first = order(&app); + assert!(first.is_some(), "the rows report an order revision"); + app.session.execute("select.set", &json!({"ids": [b.0]})).unwrap(); + assert_eq!(order(&app), first, "a selection change keeps it"); + app.session.execute("object.isolate", &json!({"id": sub.0})).unwrap(); + let isolated = order(&app); + assert_ne!(isolated, first, "isolation mode moves it"); + app.session.execute("object.exitIsolation", &json!({})).unwrap(); + let left = order(&app); + assert_ne!(left, isolated, "leaving isolation mode moves it"); + app.ui.layers_panel.layers_only = true; + assert_ne!(order(&app), left, "Show Layers Only moves it"); + app.ui.layers_panel.layers_only = false; + assert_eq!(order(&app), left, "and turning it off gives it back"); + expand(&mut app, &json!({"ids": [g.0], "open": false})).unwrap(); + let closed = order(&app); + assert_ne!(closed, left, "closing a row moves it"); + name_row(&mut app, a, "A"); + assert_ne!(order(&app), closed, "an edit moves it"); +} diff --git a/crates/ui-egui/src/tests/nativemenu.rs b/crates/ui-egui/src/tests/nativemenu.rs index f1f6bcd09c..1fad419639 100644 --- a/crates/ui-egui/src/tests/nativemenu.rs +++ b/crates/ui-egui/src/tests/nativemenu.rs @@ -355,10 +355,11 @@ fn a_control_port_cancel_of_a_dialog_preview_reads_the_menus() { } /// OK applies the rotation a dialog previews as one undo step: the menus are read then, with Undo -/// naming it, and not for the angles previewed before. +/// naming it, and not for the angles previewed before. Once the dialog's angle field no longer takes +/// the keys, the menus are sent once more without the text-editing gate. #[test] fn applying_a_dialog_preview_reads_the_menus() { - let (m, (read, synced, closed, after)) = undisturbed(|m| { + let (m, (read, synced, applied, closed, after)) = undisturbed(|m| { m.rotate_preview(); let read = m.angles(4); let synced = m.fake.synced(); @@ -367,12 +368,21 @@ fn applying_a_dialog_preview_reads_the_menus() { // gone two frames later. m.frame(vec![]); m.frame(vec![]); + let applied = m.fake.synced(); + // The frame after the field gives up the keys sets the gate. + for _ in 0..4 { + if !m.ctx.egui_wants_keyboard_input() { + break; + } + m.frame(vec![]); + } m.frame(vec![]); - (read, synced, !m.app.session.in_interaction() && !m.app.any_dialog_open(), m.fake.synced()) + (read, synced, applied, !m.app.session.in_interaction() && !m.app.any_dialog_open(), m.fake.synced()) }); assert_eq!(read, 0, "the menus weren't read while the dialog previewed the angles"); assert!(closed); - assert_eq!(after, synced + 1, "the menus were read"); + assert_eq!(applied, synced + 1, "the menus were read"); + assert_eq!(after, synced + 2, "and sent once more when the gate changed"); assert_eq!(find(&m.fake.last(), "edit.undo").label, "Undo Rotate"); } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index f4f02f8627..d69afcd0a8 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "186a229c8da8db5916f8a863dfd894f1879af735"; +const REV: &str = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV), From 1588d43a2d2d7d9d2fdf7578321bf8732d6db5f7 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 22:02:45 -0800 Subject: [PATCH 066/105] Nightly: craft-nightly uses the same craft-libs rev as the other crates craft-nightly was still pinned at 1f6c3a21f while every other craft-libs crate moved to aa7e668ec. The newer craft-nightly brings: - craft-libs#4297: profile-root validation requires HOME on Unix and APPDATA and LOCALAPPDATA on Windows, and refuses a configured OS directory that is relative or contains `..` (ProfileError::MissingStableBoundary and InvalidStableBoundary). - craft-libs#4304: a Unix socket (or AF_UNIX socket on Windows) in a profile's single-instance/ folder is accepted when the app lists that folder, and Launch reports whether the launcher's `--` separator was present (passthrough_args_with_launcher_separator). - craft-libs#4309: a Windows test fix only. VectorCraft builds against these without code changes: it does not construct Launch or match ProfileError exhaustively, and its single-instance record is instance.json with a TCP listener. Cargo.lock adds uds_windows (already in the lock) to craft-nightly's dependencies. --- Cargo.lock | 3 ++- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9c3989051d..c2892308bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1814,8 +1814,9 @@ dependencies = [ [[package]] name = "craft-nightly" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=1f6c3a21f85ed96f8fd4ddd5a959d4e1edbedb24#1f6c3a21f85ed96f8fd4ddd5a959d4e1edbedb24" +source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" dependencies = [ + "uds_windows", "winsafe", ] diff --git a/Cargo.toml b/Cargo.toml index f7aa86aff7..8c2995ce63 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,7 @@ craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "aa7e6 craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } # Nightly profile isolation, launch protocol, and security fence. -craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "1f6c3a21f85ed96f8fd4ddd5a959d4e1edbedb24" } +craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } From e94496b42f6d05068eab6bc934f9f54207aacb88 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 22:16:18 -0800 Subject: [PATCH 067/105] Asset Export: the settings scroll in a short panel With assets in the panel and many format rows, the Export Settings section grew past the top of the panel, so its heading and the first format rows could not be reached. The settings now sit in a scrolling stack that takes at most half the panel's height, as the CSS Properties panel does, and the preset name row, Export and the footer bar stay below it. --- crates/ui-egui/src/panels/asset_export.rs | 25 ++++++++----- .../ui-egui/src/panels/tests_asset_export.rs | 36 +++++++++++++++++++ docs/mcp.md | 4 ++- docs/target-app-parity.md | 1 + 4 files changed, 57 insertions(+), 9 deletions(-) diff --git a/crates/ui-egui/src/panels/asset_export.rs b/crates/ui-egui/src/panels/asset_export.rs index 048d8dcfb0..26828a967d 100644 --- a/crates/ui-egui/src/panels/asset_export.rs +++ b/crates/ui-egui/src/panels/asset_export.rs @@ -34,8 +34,8 @@ use craft::theme::Variant; use craft::theme::variant::Tone; use craft::ui::buttons::{Button, IconButton}; use craft::ui::contract::{ - Bind, CollectionEvent, Entry, Props as _, RowAlign, SelectMode, Show as _, ShowCollection as _, ShowContainer as _, Sizing, TooltipSpec, clicked, - request_rename, + Bind, CollectionEvent, Entry, Props as _, RowAlign, Scroll, SelectMode, Show as _, ShowCollection as _, ShowContainer as _, Sizing, TooltipSpec, + clicked, request_rename, }; use craft::ui::dialog::StackDialog as _; use craft::ui::display::{Divider, Shade, Text}; @@ -524,13 +524,22 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { let (selection, saving) = (&mut model.selection, &mut model.saving); let (mut export_clicked, mut footer, mut screens) = (false, None, false); // The grid takes the room the settings, Export and the footer bar leave. + // The settings scroll in at most half the panel's height, so a long list of format rows stays reachable. + // The preset name row stays below them, in view when Save As Preset opens it. + let settings_room = ui.available_height() / 2.0; + let settings_id = ui.scope_id().with(("asset-export-settings", uid)); let footed = Stack::new().fill().footer(|ui, _| { - crate::panels::section(tl!("Export Settings")).show(ui, |ui, _| { - let (change, files_each) = settings(ui, st); - (seen.change, seen.files_each) = (change, files_each); - seen.format_3d = format_3d(ui, st, &sel_or_all(&shown_sel, &all)); - seen.save = save_row(ui, saving); - }); + Stack::new().id(settings_id).label(tl!("Export Settings")).fill_width().scroll(Scroll::vertical()).room_height(settings_room).show( + ui, + |ui, _| { + crate::panels::section(tl!("Export Settings")).show(ui, |ui, _| { + let (change, files_each) = settings(ui, st); + (seen.change, seen.files_each) = (change, files_each); + seen.format_3d = format_3d(ui, st, &sel_or_all(&shown_sel, &all)); + }); + }, + ); + seen.save = save_row(ui, saving); Row::new().fill_width().align(RowAlign::End).show(ui, |ui, _| { let label = if shown_sel.is_empty() || shown_sel.len() == all.len() { tl!("Export").to_string() diff --git a/crates/ui-egui/src/panels/tests_asset_export.rs b/crates/ui-egui/src/panels/tests_asset_export.rs index 369006b699..b71ca788a9 100644 --- a/crates/ui-egui/src/panels/tests_asset_export.rs +++ b/crates/ui-egui/src/panels/tests_asset_export.rs @@ -1016,6 +1016,42 @@ fn the_scale_row_fits_the_panel_width() { } } +/// In a short panel with many format rows, the Export Settings heading and the first row stay inside the panel, and +/// the settings scroll above Export and the footer bar. +#[test] +fn the_settings_scroll_inside_a_short_panel() { + use craft::ui::contract::Role; + let (mut app, _, [a, _]) = app(true); + app.run("assets.add", json!({"ids": [a]})).unwrap(); + let mut p = panel(app); + p.room(egui::vec2(300.0, 1600.0)); + p.frame(); + for _ in 0..7 { + p.click("+ Add Scale"); + } + assert_eq!(settings(&p)["formats"].as_array().unwrap().len(), 8); + p.room(egui::vec2(300.0, 280.0)); + p.frame(); + p.frame(); + let heading = p.painted("Export Settings"); + assert!(!heading.is_empty(), "the Export Settings heading is painted"); + for rect in heading { + assert!(rect.top() >= -0.5 && rect.bottom() <= 280.5, "the Export Settings heading at {rect:?} is outside a 280 pt panel"); + } + let scale = p.rect_role("Scale", Role::COMBO_BOX); + assert!(p.in_view("Scale") && scale.top() >= -0.5, "the first format row at {scale:?} is outside the panel"); + let export = p.rect("Export"); + assert!(export.top() >= -0.5 && export.bottom() <= 280.5, "Export at {export:?} is outside a 280 pt panel"); + // The wheel over the settings brings the last row's Add Scale into view, and Export stays where it was. + for _ in 0..20 { + p.scroll_at(scale.center(), -120.0); + p.frame(); + } + let add = p.rect("+ Add Scale"); + assert!(p.in_view("+ Add Scale") && add.bottom() <= 280.5, "Add Scale at {add:?} is not reachable"); + assert_eq!(p.rect("Export"), export, "Export moved while the settings scrolled"); +} + /// The menu adds the selected artwork as one asset or one per object (an object that is an asset already keeps its /// asset), and is off with no artwork selected. #[test] diff --git a/docs/mcp.md b/docs/mcp.md index a9e9d9649a..a7fec3009e 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -12490,7 +12490,9 @@ Open Location after Export run these two (sub-folders sort the pictures; `assets folder itself), and its Format Settings… opens Export for Screens on the first row's format settings. `document.exportForScreens {assets: [id…]}` does the same with its own params (the dialog's Assets tab). An asset's crop, and the crop of `export` with `selection: true`, is the bounds the -renderer measures for what the art draws, its effects included. +renderer measures for what the art draws, its effects included. In the panel, Export Settings takes at most half the +panel's height and scrolls on its own, so every format row can be reached in a short panel while Export and the footer +bar stay in place. ```json {"name":"run_command","arguments":{"command":"assets.add","params":{"multiple":true}}} diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 4df379b998..9469046bc4 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1086,6 +1086,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Batch… over data sets offers None, Save and Close and Folder as the destination, as for a folder source. Save and Close saves the open document over its own file after each data set, so the file keeps only the last data set, unless a recorded Save step that Override Save points into the destination folder first makes each data set's file the document's own. A recorded Save, Save a Copy, Save as Template or export step that writes a file and that the batch does not point into the destination folder (destination None, Override Save or Override Export off, or a copy, template, PDF, EPS, DXF, Save for Web or Save for Office Documents step) also writes the same file for every data set. In either case the dialog shows a warning and `action.batch` returns a `warning`. Unless a recorded Save or Save As step writes a file and makes it the document's own first, `action.batch` refuses Save and Close over the data sets of a document that was never saved, was converted from an older version or was restored by Data Recovery. - Export for Screens: the dialog's Example line shows the path of the file the export writes first, sub-folder included, named as the export names it, for the first chosen artboard, asset, layer or object (`document.exportForScreens`). - Export presets: the Asset Export panel menu lists the export presets of Export for Screens, with Import Preset… and Export Preset…, which read and write `.vcexportpresets` files (`document.exportPresets.import`, `document.exportPresets.export`). An imported preset whose name is taken gets a number. In the panel, a preset applies to the shared export settings (`assets.settings.set {exportPreset}`), and Save Preset… saves them. With Create Sub-folders off, the panel's Export writes every file into the folder itself, mobile and density rows included. + - Export Settings in the Asset Export panel scroll on their own in a short panel. - Export for Screens artboard names can be double-clicked to rename them in grid or list view (#7275). Enter, a click outside the field or switching to Assets commits the name; Escape cancels the edit. The dialog stays open, checked artboards stay selected and the rename is undoable. The typed name goes to the artboard that was double-clicked even when the artboards change order while it is typed; the field closes when its artboard is deleted or another document becomes active. Evidence: `dialogs::tests_screens::double_clicking_an_artboard_name_in_export_for_screens_renames_it`, `dialogs::tests_screens::switching_export_tabs_commits_an_artboard_name`, `dialogs::tests_screens::an_artboard_name_follows_its_artboard_while_it_is_typed` and `dialogs::tests_screens::an_artboard_name_stays_with_its_document`. - Asset Export tile context menus (2026-11-20): Export / Remove operate on the selected assets, with plural labels; Rename edits the clicked tile inline; Select Artwork on Canvas selects its source nodes; collecting selected artwork as one or multiple assets is enabled only with canvas selection. Right-click selects an unselected tile and preserves an existing multi-selection. Export shares the raster/3D path; removal is one undo step without removing art. Headless regressions: `panels::tests_asset_export` (selection, export targets, removal/Undo/Redo, source artwork, rename and collection). This reduces G12; UI parity scores and estimates are unchanged. - Asset Export panel menu: Create Sub-folders (on by default) and Open Location after Export are check items that set the dialog's two checkboxes (`assets.settings.set {subfolders, openLocation}`), and the panel's Export follows them, including a folder per format or item that Export for Screens remembers (3D assets' mesh files go in the folder itself); Format Settings… opens Export for Screens on the first row's format settings ([Asset Export panel](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/collect-and-export-assets-from-asset-export-panel.html)). Tests: `panels::tests_asset_export`. From bc9e7c912426ad63e4d612553acbd94c0204ff29 Mon Sep 17 00:00:00 2001 From: jmverges Date: Mon, 30 Nov 2026 07:06:19 +0000 Subject: [PATCH 068/105] .ai import: a word the page draws from two text objects in a row is their type Where the text document makes the type of every text object that shows, each piece of the page's type is matched with the made type that holds it, and a word of the piece is that type's when its spelling contains the word. The page can draw two text objects as one word: a word and a letter set apart from it (a swash "h" after "Spirit") come out of the page as one piece, "Spirith". Both text objects hold the piece, but neither spells the word, so it was counted as type with no text object, with the note "some of the page's type has no text object in the layers, so it is left out" (a loss, so `convert` wouldn't write over the file), though both text objects come in and draw it. A word still left is now the type of the text objects holding the piece when it is the last word of one of them joined to the first word of another that draws after it along the first one's lines. Each part is a whole word of its text object, so bits of words don't make up a piece, and the two the other way round don't make the word. In our garment files (used locally, never committed) this takes the note off one file of 424 and changes nothing else. Co-Authored-By: Claude Opus 5.5 --- crates/eps/src/import/native/plan.rs | 38 +++++++++++++++++++++++++-- crates/eps/src/import/tests_native.rs | 32 ++++++++++++++++++++++ docs/file-format-parity.md | 1 + 3 files changed, 69 insertions(+), 2 deletions(-) diff --git a/crates/eps/src/import/native/plan.rs b/crates/eps/src/import/native/plan.rs index 6d4799721e..487cae27b4 100644 --- a/crates/eps/src/import/native/plan.rs +++ b/crates/eps/src/import/native/plan.rs @@ -338,6 +338,12 @@ fn made_content(infos: &[SlotInfo], made: Vec>, laid: bool) -> Vec< /// it, as far as strokes round type reach) as type the page draws. How many of the page's text /// objects no made type takes, shown or not: none that holds a piece of the object has its words /// ([`spelling`]). Past `MAX_PAIRS` comparisons nothing is marked or counted (`None`). +/// +/// The page can draw two text objects as one word: a word and a letter set apart from it (a swash +/// "h" after "Spirit") come out of the page as one piece, "Spirith", that neither spells. A word +/// left that is the last word of one text object holding the piece joined to the first word of +/// another that holds it and draws after it, along the first one's lines, is theirs +/// ([`joined_by_two`]). fn see_page_type(content: &mut [Content], shown: &[Vec>]) -> Option { let texts = |o: &[Arc]| o.iter().filter_map(|n| if let NodeKind::Text(_) = &n.kind { Some(n.clone()) } else { None }).collect::>(); // Each object's pieces of type, and the words of them that no made type holding it has yet. @@ -348,22 +354,50 @@ fn see_page_type(content: &mut [Content], shown: &[Vec>]) -> Option= 0.5 * r.area().max(1e-9); + // The made type holding each object, in order: where it draws and its words. + let mut holders: Vec> = vec![vec![]; objects.len()]; for c in content { let Content::Made(node, region, seen) = c else { continue }; // Hidden made type has no region: where it draws, shown, is its own box. let Some(drawn) = region.or_else(|| node.visual_bounds()) else { continue }; - let spelled = if let NodeKind::Text(t) = &node.kind { spelling(&t.plain_text()) } else { String::new() }; - for (rects, words, held) in &mut objects { + let (spelled, holder) = match &node.kind { + NodeKind::Text(t) => { + let text = t.plain_text(); + let [a, b, ..] = t.xf.as_coeffs(); + (spelling(&text), Some((drawn.center(), (a, b), word_pieces(&text).map(spelling).filter(|w| !w.is_empty()).collect()))) + } + _ => (String::new(), None), + }; + for ((rects, words, held), by) in objects.iter_mut().zip(&mut holders) { if rects.iter().any(|r| holds(drawn, r)) { *held = true; *seen |= region.is_some(); words.retain(|w| !spelled.contains(w.as_str())); + by.extend(holder.clone()); } } } + for ((_, words, _), by) in objects.iter_mut().zip(&holders) { + words.retain(|w| !joined_by_two(w, by)); + } Some(objects.iter().filter(|(_, words, held)| !held || !words.is_empty()).count()) } +/// A made text object that holds a piece of the page's type: the centre of where it draws, the +/// way its lines run (the first column of its transform) and its words ([`spelling`]). +type Holder = (Point, (f64, f64), Vec); + +/// Is `word` (a [`spelling`]) the last word of one of `by` joined to the first word of another of +/// them that draws after it, along the first one's lines? Each part is a whole word of its text +/// object, so a piece is never made up of bits of words. +fn joined_by_two(word: &str, by: &[Holder]) -> bool { + by.iter().any(|(at, (a, b), first)| { + let Some(head) = first.last().filter(|h| word.len() > h.len() && word.starts_with(h.as_str())) else { return false }; + let tail = &word[head.len()..]; + by.iter().any(|(next, _, second)| (next.x - at.x) * a + (next.y - at.y) * b > 0.0 && second.first().is_some_and(|w| w == tail)) + }) +} + /// What goes into each of `infos`' slots when the file's text document can't make the type of every /// slot that shows: type made from the text document (`made`) where it can, else the page's type that /// the text document puts where the page has it, else the page's type in a copy that a layer's or diff --git a/crates/eps/src/import/tests_native.rs b/crates/eps/src/import/tests_native.rs index 2d8d270cc7..28faccac69 100644 --- a/crates/eps/src/import/tests_native.rs +++ b/crates/eps/src/import/tests_native.rs @@ -8663,3 +8663,35 @@ fn trusted_editing_data_keeps_an_artboard_taller_than_its_pdf_page() { let (_, w, read) = crate::layered_ai(&private(&art), Document::new(12000.0, 14400.0), vec![], false, true, 1.0); assert!(!read, "the uncapped dimension must still match: {w:?}"); } + +/// The page's "2014" drawn as one piece 20 points across the art, and two text objects "20" and +/// "14" anchored at `twenty` and `fourteen`, set in the bundled Source Sans 3 at 14 points (a digit +/// 6.958 points wide) so that where they draw doesn't hang on the fonts installed. +fn word_of_two_text_objects(fourteen: f64, twenty: f64) -> crate::import::Imported { + let stories = [("20\r", 0, (twenty, 8180.0), (0.0, 0.0), 0.0), ("14\r", 0, (fourteen, 8180.0), (0.0, 0.0), 0.0)]; + let doc = text_document(&stories).replacen("/0 (Helvetica)", "/0 (SourceSans3-Regular)", 1); + let art = native_with_text(&layer("Art", true, &(text_object(0) + &text_object(1))), &doc); + let page = "0 1 0 0 setcmykcolor /SourceSans3-Regular findfont 14 scalefont setfont 20 61.5 moveto (2014) show"; + import(&eps(page, &art)).unwrap() +} + +/// The page can draw two text objects as one word: "20" and "14" set one after the other come out +/// of the page as one piece, "2014", that neither spells. The word is the last word of the one +/// joined to the first word of the one after it, so the page's type is theirs and nothing is noted +/// as left out. +#[test] +fn a_word_the_page_draws_from_two_text_objects_in_a_row_is_their_type() { + let r = word_of_two_text_objects(8161.5 + 13.916, 8161.5); + assert_eq!(names(&r.document), ["Art"], "{:?}", r.warnings); + let texts: Vec = text_of(&r.document.layers[0]).iter().map(|t| t.plain_text()).collect(); + assert_eq!(texts, ["20", "14"], "{:?}", r.warnings); + assert!(!r.warnings.iter().any(|w| crate::is_loss(w)), "{:?}", r.warnings); +} + +/// The two text objects the other way round ("14" before "20") don't make the page's "2014": its +/// word keeps the loss note. +#[test] +fn two_text_objects_the_other_way_round_arent_the_word_the_page_draws() { + let r = word_of_two_text_objects(8161.5, 8161.5 + 13.916); + assert!(r.warnings.iter().any(|w| w.contains("some of the page's type has no text object in the layers")), "{:?}", r.warnings); +} diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index a22db526d1..b4c9a92410 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -425,6 +425,7 @@ Stop opacity on translated artboards remains outside this regression coverage. | Date | Change | Summary | |---|---|---| +| 2026-11-30 | minor | `.ai` and EPS import: a word the page draws from two text objects in a row is their type. Where the text document makes the type of every text object that shows, a word of the page's type is the type of the made type holding its piece when that type spells it. The page can draw two text objects as one word: a word and a letter set apart from it (a swash "h" after "Spirit") come out of the page as one piece, "Spirith", that neither spells. It was counted as type with no text object, with the note "some of the page's type has no text object in the layers, so it is left out" (a loss, so `convert` wouldn't write over the file), though both text objects come in and draw it. Now a word left that is the last word of one text object holding the piece joined to the first word of another holding it that draws after it, along the first one's lines, is theirs (`joined_by_two` in `see_page_type`). Each part is a whole word of its text object, and the two the other way round don't make the word. Tests: `a_word_the_page_draws_from_two_text_objects_in_a_row_is_their_type`, `two_text_objects_the_other_way_round_arent_the_word_the_page_draws`. | | 2026-11-27 | minor | `.ai` save: type in a spot ink, a global process colour or Registration keeps its swatch link and its tint. Its fill and stroke in the text document name (key 5 of the paint) an art style of one paint, `0 1 Xd`, whose paint is the colour as a path's fill writes it (`x`, `Xx`, `Xk`, `Xs`), the form `.ai` import reads since the change below; key 0 still holds the process values at the tint. Each style is read back before it is written and kept only when the reader gives the same swatch and tint, so such type no longer counts among the attributes of type left out; a link to a process swatch that isn't global still does. Test `ai_editing::tests::type_in_spot_and_global_colors_reads_back_linked_at_its_tint` | | 2026-11-27 | minor | `.ai` and EPS import: type set in a spot ink or a global process colour keeps its ink. In the text document a character's fill or stroke is a colour (key 0: grey, RGB or CMYK) and the name of an art style (key 5). In users' files (used locally, never committed) that style is one paint (`/SimpleStyle`), always its fill's, for a stroke too; for a spot ink or a global process colour it is `c m y k (name) tint x`, `Xx` or `Xk`, and key 0 keeps only the ink's process values at that tint. Such type came in as that process colour, so it separated onto the process plates, and white type in a white ink onto none. It now takes the style's paint: the colour at its tint, linked to the document's swatch of that name, which the style's colour makes when the art doesn't (after the art's colours, before the header's custom colours). A style whose paint is a process colour or a gradient, one that also sets a stroke's colour or pattern (before or after the fill's) or another fill paint after it, one whose `Xd` doesn't turn on its fill alone, and a paint that names no style of the file, keep the colour of key 0 as before; type filled with a gradient still comes in black. Tests `type_set_in_a_spot_ink_takes_it_from_the_art_style_its_paint_names` in `crates/eps/src/import/tests_native.rs`, `a_run_painted_by_a_swatch_colours_art_style_takes_the_swatch` in `crates/eps/src/import/ate.rs` and `only_a_style_of_one_swatch_colour_holds_it_for_type` in `crates/eps/src/import/ai/style/tests.rs`. Scores and estimates unchanged. | | 2026-11-26 | minor | `.ai` and EPS import: where the text document makes the type of every text object that shows, point type made from it is matched with the page's type where it draws. Made type has no layout when it is matched, and its box was the estimate of type without one (0.55 em a character, running right from its anchor): beside right-aligned type, over half of centered type, across vertical type, and too short for a wide font. The page's type there was counted as type with no text object, with the note "some of the page's type has no text object in the layers, so it is left out" (a loss, so `convert` wouldn't write over the file), and the made type went on to be weighed against the page as type the page may not draw, and could be taken out. The box of made point type that shows now comes from its layout in the fonts the import has; the text object keeps no layout, so the document measures it when it opens, as before. Files where some text object's type isn't made keep the estimate: there the page's pieces where made type draws can belong to text objects stacked on it. The page comparison takes the same box for the layers' type areas (`type_areas` in `compare.rs`): made point type that differs from the page (laid out again, or in another font) counts as type where it draws, whatever its alignment. Counted as art beside the estimate, it could send the file to its PDF part or page, or be noted as art that differs. A file whose layers failed the comparison that way and opened without it now passes it and shows its notes. Tests `right_aligned_and_centered_point_type_takes_the_pages_type_where_it_draws`, `centered_point_type_at_a_heading_s_size_takes_the_pages_type_where_it_draws` and `right_aligned_point_type_that_differs_from_the_page_differs_as_type` in `crates/eps/src/import/tests_native.rs`, and `made_point_type_s_box_is_where_its_alignment_and_orientation_draw_it` in `crates/eps/src/import/native/slots.rs`. Scores and estimates unchanged. | From 07b4332dfc601de36b57d683ff7e5617660d80e4 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Mon, 30 Nov 2026 08:42:16 +0000 Subject: [PATCH 069/105] fix: Step and Repeat fill picks the artboard from the whole selection; rustfmt --- crates/engine/src/cmd/stepandrepeat.rs | 2 +- crates/engine/src/cmd/stepandrepeat/tests.rs | 21 ++++++++++++++++++++ crates/ui-egui/src/dialogs/object_dialogs.rs | 4 ++-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/cmd/stepandrepeat.rs b/crates/engine/src/cmd/stepandrepeat.rs index 620f64a9a7..9ba4666598 100644 --- a/crates/engine/src/cmd/stepandrepeat.rs +++ b/crates/engine/src/cmd/stepandrepeat.rs @@ -150,7 +150,7 @@ fn step_and_repeat(s: &mut Session, p: &Value) -> Result { } let anchor = if fill { let sheet = sheet.or_else(|| { - let c = b.center(); + let c = d.bounds_of(&roots, false).unwrap_or(b).center(); d.artboards.iter().find(|a| a.rect.contains(c)).or_else(|| d.artboards.first()).map(|a| a.rect) }); let sheet = sheet.ok_or_else(|| EngineError::Other("no sheet to fill".into()))?; diff --git a/crates/engine/src/cmd/stepandrepeat/tests.rs b/crates/engine/src/cmd/stepandrepeat/tests.rs index c25953d598..991800d964 100644 --- a/crates/engine/src/cmd/stepandrepeat/tests.rs +++ b/crates/engine/src/cmd/stepandrepeat/tests.rs @@ -155,3 +155,24 @@ fn fractional_gaps_are_exact_except_for_pixel_aligned_objects_which_stay_on_the_ let pitch = gap(true).1; assert!((pitch - pitch.round()).abs() < 1e-9); } + +#[test] +fn fill_picks_the_artboard_of_the_selection_not_of_the_cut_contour() { + let first_x = |sheet: Option| { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 100, "height": 100})).unwrap(); + s.execute("artboard.new", &json!({"x": 100, "y": 0, "width": 100, "height": 100})).unwrap(); + let art = s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 60, "height": 20})).unwrap()["id"].as_u64().unwrap(); + let cut = s.execute("shape.rectangle", &json!({"x": 105, "y": 10, "width": 20, "height": 20})).unwrap()["id"].as_u64().unwrap(); + s.execute("select.set", &json!({"ids": [art, cut]})).unwrap(); + let mut p = json!({"fill": true, "cutId": cut}); + if let Some(sh) = sheet { + p["sheet"] = sh; + } + let r = s.execute(CMD, &p).unwrap(); + bounds(&s, r["ids"][0].as_u64().unwrap()).0 + }; + let default = first_x(None); + let explicit = first_x(Some(json!({"x": 100, "y": 0, "width": 100, "height": 100}))); + assert!((explicit - default - 100.0).abs() < 1e-9); +} diff --git a/crates/ui-egui/src/dialogs/object_dialogs.rs b/crates/ui-egui/src/dialogs/object_dialogs.rs index 3f3b69da54..ee0867d0dd 100644 --- a/crates/ui-egui/src/dialogs/object_dialogs.rs +++ b/crates/ui-egui/src/dialogs/object_dialogs.rs @@ -4,8 +4,8 @@ use super::path_ops::PathOp; use super::simplify_slider::StripKind; use super::{ blend_options, dimension, flare_options, graph_data, graph_design, graph_type, indexed_color, live_paint_gaps, object_mosaic, option_form, - path_ops, perspective_grid, perspective_presets, saved_names, shapes, simplify_slider, smooth_slider, step_repeat, transform, - transform_each, width_point, + path_ops, perspective_grid, perspective_presets, saved_names, shapes, simplify_slider, smooth_slider, step_repeat, transform, transform_each, + width_point, }; use crate::VectorcraftApp; From 41f2554eae34e71efca8b0fc7642d60b53306aad Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 01:51:18 -0800 Subject: [PATCH 070/105] Info: a click on a readout copies it again inside a measured flyout At the craft-libs pin this branch moves to, a panel shown in a dock flyout runs its body twice in the release frame: first in the container's invisible sizing pass, then in the real run. copy_shown read the release in the sizing pass, where the readout has no area, and cleared the press it had remembered, so the real run saw a release without a press and copied nothing. Info's W, H and other readouts stopped copying (panel_readout_copy: three tests failed with no copy). copy_shown now returns before reading input or the remembered press in a sizing pass. --- crates/ui-egui/src/panels/doc_info.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/ui-egui/src/panels/doc_info.rs b/crates/ui-egui/src/panels/doc_info.rs index e6f7cb6e86..5cb45f666a 100644 --- a/crates/ui-egui/src/panels/doc_info.rs +++ b/crates/ui-egui/src/panels/doc_info.rs @@ -59,6 +59,12 @@ pub(crate) fn copy_value(ui: &mut Ui, label: &str, value: &str, mono: bool) -> b /// The same guarded full-value copy for an already shown readout. An elided path remains /// static text: selection indices must describe the text actually shown by the framework. pub(crate) fn copy_shown(ui: &mut Ui, shown: &egui::Response, value: &str) -> bool { + // A container's measuring run shows the readout in an invisible sizing pass before the frame's real run, with the + // same id and the same input. It neither copies nor reads or clears the remembered press: clearing it there would + // leave the real run's release without its press. + if ui.is_sizing_pass() { + return false; + } // The click's own position and keys: a move or a key change after the release in the same // frame leaves the pointer and the held keys elsewhere. A frame with more than one release // copies nothing, since the click flags below do not say which release they describe. From bbe091e791f9e500b28ab43e3d1afa46538829a2 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 02:13:29 -0800 Subject: [PATCH 071/105] Fields: the wheel steps a focused number field only while the pointer is over it With a number field focused, a wheel notch anywhere in the window stepped that field. In Pattern Options at 220 by 320 points, with Width focused at 10 pt, a notch over Size Tile to Art changed Width to 9 pt. `root_env` now turns on the framework's pointer-scoped field wheel (`RootEnv::pointer_scoped_field_wheel`, storytold/craft-libs#3805). The desktop and web hosts both take their root from it. A notch over the focused field still steps it. Elsewhere the wheel scrolls what is under the pointer, and an unfocused number field under the pointer is not stepped. --- crates/ui-egui/src/app.rs | 3 ++ crates/ui-egui/src/panels/pattern_options.rs | 40 ++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 84ab44d769..730f2eec08 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -823,6 +823,9 @@ pub(crate) fn root_env(prefs: &vectorcraft_engine::Prefs, native_ppp: f32, print root.escape_leaves_fields = true; // A held key repeats its command (Cmd+= keeps zooming in). root.shortcuts_repeat = true; + // The wheel steps a focused number field only while the pointer is over it; elsewhere it scrolls what is under the + // pointer. + root.pointer_scoped_field_wheel = true; root } diff --git a/crates/ui-egui/src/panels/pattern_options.rs b/crates/ui-egui/src/panels/pattern_options.rs index 93e93681f2..e811df4c17 100644 --- a/crates/ui-egui/src/panels/pattern_options.rs +++ b/crates/ui-egui/src/panels/pattern_options.rs @@ -309,4 +309,44 @@ mod tests { assert_eq!(panel.value("Name").as_deref(), Some("Dots")); assert!(panel.app().session.active().unwrap().doc.pattern("Dots").is_some()); } + + /// The tile's width and height of the pattern "Dots". + fn tile_size(panel: &Panel) -> (f64, f64) { + let app = panel.app(); + let tile = &app.session.active().unwrap().doc.pattern("Dots").unwrap().tile; + (tile.width(), tile.height()) + } + + /// With the Width field focused, a wheel notch steps it only while the pointer is over it: over another control, + /// or over the unfocused Height field, the wheel scrolls the panel and the tile keeps its size. + #[test] + fn the_wheel_steps_the_focused_number_field_only_under_the_pointer() { + use craft::ui::contract::Role; + let mut panel = editing_panel(); + panel.room(egui::vec2(220.0, 320.0)); + panel.frame(); + assert_eq!(tile_size(&panel), (10.0, 10.0)); + panel.click_role("Width", Role::SPIN_BUTTON); + assert!(panel.focused("Width"), "the click focuses Width"); + + // One notch at `at`, then the frame after the wheel gesture's gap, which ends the gesture. + let notch = |panel: &mut Panel, at: egui::Pos2| { + panel.scroll_at(at, -30.0); + panel.advance(1.0); + panel.frame(); + }; + + let check = panel.rect("Size Tile to Art").center(); + notch(&mut panel, check); + assert_eq!(tile_size(&panel), (10.0, 10.0), "a notch over Size Tile to Art leaves the focused Width alone"); + assert!(panel.focused("Width"), "Width keeps the focus"); + + let height = panel.rect_role("Height", Role::SPIN_BUTTON).center(); + notch(&mut panel, height); + assert_eq!(tile_size(&panel), (10.0, 10.0), "a notch over the unfocused Height steps neither field"); + + let width = panel.rect_role("Width", Role::SPIN_BUTTON).center(); + notch(&mut panel, width); + assert_eq!(tile_size(&panel), (9.0, 10.0), "a notch over the focused Width steps it"); + } } From 1937db57bf133db58a541f916163aad09b521c52 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 11:32:52 +0100 Subject: [PATCH 072/105] Restore native save dialogs, selected Hand panning and font list space --- apps/vectorcraft/src/main.rs | 6 ++++-- crates/ui-egui/src/app.rs | 1 + crates/ui-egui/src/caches.rs | 1 + crates/ui-egui/src/canvas/tests_edge_scroll.rs | 2 ++ crates/ui-egui/src/canvas/tool_adapter.rs | 8 ++++++++ crates/ui-egui/src/font_menu.rs | 2 +- crates/ui-egui/src/panels/character.rs | 2 +- 7 files changed, 18 insertions(+), 4 deletions(-) diff --git a/apps/vectorcraft/src/main.rs b/apps/vectorcraft/src/main.rs index 601cda01bb..12ac19b08b 100644 --- a/apps/vectorcraft/src/main.rs +++ b/apps/vectorcraft/src/main.rs @@ -798,7 +798,7 @@ fn main() -> std::process::ExitCode { }; let (files, file_panels) = file_service(wake, folders); let files = Arc::new(files); - craft::host::Host::builder(AppInfo { + let host = craft::host::Host::builder(AppInfo { id: vectorcraft_ui_egui::os_window::SETTINGS_APP_ID, name: vectorcraft_ui_egui::os_window::name(), version: vectorcraft_ui_egui::os_window::version(), @@ -806,7 +806,8 @@ fn main() -> std::process::ExitCode { .i18n(vectorcraft_ui_egui::i18n::shared()) .settings(Arc::new(settings.clone())) .files(files.clone()) - .install(ctx); + .build(); + host.clone().install(ctx); let mut session = Session::new(); // The profiles loaded before come back before the preferences name any of them. prefs_dir::attach_profile_store(&mut session); @@ -831,6 +832,7 @@ fn main() -> std::process::ExitCode { prefs_dir::attach_proof_setups(&mut session); prefs_dir::attach_script_data(&mut session); let mut app = VectorcraftApp::new(session, services(winit_window.clone())); + app.host = Arc::new(host); app.adopt_context(&cc.egui_ctx); // A nightly is updated by the Launcher: it never checks for a stable release, which // would install this program's own updater over the nightly build. diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 84ab44d769..8ddfe99310 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -139,6 +139,7 @@ impl VectorcraftApp { spelling: Default::default(), text_nodes: Default::default(), momentary: None, + hand: None, selection_box: None, selection_bounds: None, selection_marks: None, diff --git a/crates/ui-egui/src/caches.rs b/crates/ui-egui/src/caches.rs index 7f0ade064e..cdf59a99f8 100644 --- a/crates/ui-egui/src/caches.rs +++ b/crates/ui-egui/src/caches.rs @@ -81,6 +81,7 @@ pub struct CanvasCache { /// The Hand, Zoom and Rotate View tools the Space key and its chords lend the canvas, between /// passes; the tool adapter takes it out for its call and puts it back. pub momentary: Option, + pub hand: Option, /// [`VectorcraftApp::selection_box`] for (document uid, revision, Use Preview Bounds and /// Measure Type by Glyph Bounds). pub selection_box: Option<((u64, u64, vectorcraft_effects::preview::Measure), Option)>, diff --git a/crates/ui-egui/src/canvas/tests_edge_scroll.rs b/crates/ui-egui/src/canvas/tests_edge_scroll.rs index 79c09b3291..167f938861 100644 --- a/crates/ui-egui/src/canvas/tests_edge_scroll.rs +++ b/crates/ui-egui/src/canvas/tests_edge_scroll.rs @@ -127,10 +127,12 @@ fn a_hand_drag_held_near_the_edge_does_not_scroll_on() { let (mut app, ctx, _) = zoomed_in("hand"); let rect = app.canvas_view().unwrap().rect; let start = rect.center(); + let before = center(&app); frame(&mut app, &ctx, vec![egui::Event::PointerMoved(start), button(start, true)]); let edge = pos2(rect.right() - 4.0, start.y); frame(&mut app, &ctx, vec![egui::Event::PointerMoved(edge)]); let c0 = center(&app); + assert!(c0.x < before.x, "dragging the selected Hand right must pan the view"); for _ in 0..3 { frame(&mut app, &ctx, vec![]); } diff --git a/crates/ui-egui/src/canvas/tool_adapter.rs b/crates/ui-egui/src/canvas/tool_adapter.rs index cc62cc3fe6..596c4f4116 100644 --- a/crates/ui-egui/src/canvas/tool_adapter.rs +++ b/crates/ui-egui/src/canvas/tool_adapter.rs @@ -650,7 +650,15 @@ pub(crate) fn run(app: &mut VectorcraftApp, ui: &mut Ui, pass: &ToolPass) -> Too let mut picked = ToolHostResponse::default(); let mut response = if crate::dialogs::recolor::edit_tab::with_theme_pick(app, |app, tool| picked = host_run(app, ui, pass, tool)) { picked + } else if app.session.tool_id() == "hand" && app.ui.screen_mode != 3 { + let options = crate::app::view::navigation(&app.session.prefs); + let mut hand = app.canvas.hand.take().unwrap_or_else(|| craft::ui::canvas::HandTool::new(options)); + hand.options = options; + let response = host_run(app, ui, pass, &mut hand); + app.canvas.hand = Some(hand); + response } else { + app.canvas.hand = None; let mut tool = SessionTool::new(app, view_info, ui); let response = host_run_session(&mut tool, ui, pass); drop(tool); diff --git a/crates/ui-egui/src/font_menu.rs b/crates/ui-egui/src/font_menu.rs index bc7d206428..21c19bdd03 100644 --- a/crates/ui-egui/src/font_menu.rs +++ b/crates/ui-egui/src/font_menu.rs @@ -114,7 +114,7 @@ pub(crate) fn family_picker<'a>( .filters(filters) .sets(sets) .scripts(&FontScript::ALL) - .filter_layout(FilterLayout::Chips) + .filter_layout(FilterLayout::Toolbar) } /// What one pass of a picker reads of the app, for a host that has no `app` while it draws (a dialog). diff --git a/crates/ui-egui/src/panels/character.rs b/crates/ui-egui/src/panels/character.rs index bfcb770b7e..9415a7e50f 100644 --- a/crates/ui-egui/src/panels/character.rs +++ b/crates/ui-egui/src/panels/character.rs @@ -1231,7 +1231,7 @@ pub(crate) fn controls(app: &mut VectorcraftApp, ui: &mut Ui, rows: CharacterRow .filters(Bind::bound(&mut app.ui.font_filters)) .sets(&sets) .scripts(&FontScript::ALL) - .filter_layout(FilterLayout::Chips); + .filter_layout(FilterLayout::Toolbar); if let Some(text) = &sample { source = source.preview_text(text); } From 8cc75fd85689ba0d76e9af7c4a7d4b4f16c7bff8 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 11:34:34 +0100 Subject: [PATCH 073/105] Release: VectorCraft v0.25.1 --- Cargo.lock | 120 ++++++++++++++++++++++++++--------------------------- Cargo.toml | 2 +- 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4fce3ecad1..d08f67fa86 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8523,7 +8523,7 @@ dependencies = [ [[package]] name = "vectorcraft" -version = "0.25.0" +version = "0.25.1" dependencies = [ "arboard", "block2 0.6.2", @@ -8567,7 +8567,7 @@ dependencies = [ [[package]] name = "vectorcraft-affinity" -version = "0.25.0" +version = "0.25.1" dependencies = [ "craft-affinity", "craft-image-codecs", @@ -8578,26 +8578,26 @@ dependencies = [ [[package]] name = "vectorcraft-apischema" -version = "0.25.0" +version = "0.25.1" dependencies = [ "serde_json", ] [[package]] name = "vectorcraft-brush" -version = "0.25.0" +version = "0.25.1" dependencies = [ "kurbo 0.13.1", "serde", "serde_json", "vectorcraft-color", "vectorcraft-doc", - "vectorcraft-geom 0.25.0", + "vectorcraft-geom 0.25.1", ] [[package]] name = "vectorcraft-cad" -version = "0.25.0" +version = "0.25.1" dependencies = [ "craft-dxf", "craft-image-codecs", @@ -8609,14 +8609,14 @@ dependencies = [ "vectorcraft-color", "vectorcraft-doc", "vectorcraft-effects", - "vectorcraft-geom 0.25.0", - "vectorcraft-pathops 0.25.0", + "vectorcraft-geom 0.25.1", + "vectorcraft-pathops 0.25.1", "vectorcraft-text", ] [[package]] name = "vectorcraft-cli" -version = "0.25.0" +version = "0.25.1" dependencies = [ "log", "objc2-core-foundation", @@ -8627,7 +8627,7 @@ dependencies = [ "vectorcraft-doc", "vectorcraft-engine", "vectorcraft-format", - "vectorcraft-geom 0.25.0", + "vectorcraft-geom 0.25.1", "vectorcraft-mcp", "vectorcraft-render", "vectorcraft-svg", @@ -8639,7 +8639,7 @@ dependencies = [ [[package]] name = "vectorcraft-color" -version = "0.25.0" +version = "0.25.1" dependencies = [ "craft-cms", "craft-color-ui", @@ -8655,7 +8655,7 @@ dependencies = [ [[package]] name = "vectorcraft-doc" -version = "0.25.0" +version = "0.25.1" dependencies = [ "chrono", "craft-image-codecs", @@ -8671,13 +8671,13 @@ dependencies = [ "thiserror 2.0.21", "tiff", "vectorcraft-color", - "vectorcraft-geom 0.25.0", + "vectorcraft-geom 0.25.1", "zune-jpeg", ] [[package]] name = "vectorcraft-effects" -version = "0.25.0" +version = "0.25.1" dependencies = [ "craft-image-codecs", "craft-svg", @@ -8687,8 +8687,8 @@ dependencies = [ "svgtypes 0.16.1", "vectorcraft-color", "vectorcraft-doc", - "vectorcraft-geom 0.25.0", - "vectorcraft-pathops 0.25.0", + "vectorcraft-geom 0.25.1", + "vectorcraft-pathops 0.25.1", "vectorcraft-plugins", "vectorcraft-text", "vectorcraft-three-d", @@ -8698,7 +8698,7 @@ dependencies = [ [[package]] name = "vectorcraft-engine" -version = "0.25.0" +version = "0.25.1" dependencies = [ "apple-native-keyring-store", "cfb", @@ -8747,10 +8747,10 @@ dependencies = [ "vectorcraft-doc", "vectorcraft-eps", "vectorcraft-format", - "vectorcraft-geom 0.25.0", + "vectorcraft-geom 0.25.1", "vectorcraft-js", "vectorcraft-metafile", - "vectorcraft-pathops 0.25.0", + "vectorcraft-pathops 0.25.1", "vectorcraft-pdf", "vectorcraft-plugins", "vectorcraft-render", @@ -8770,7 +8770,7 @@ dependencies = [ [[package]] name = "vectorcraft-eps" -version = "0.25.0" +version = "0.25.1" dependencies = [ "craft-eps", "craft-image-codecs", @@ -8791,9 +8791,9 @@ dependencies = [ "vectorcraft-doc", "vectorcraft-effects", "vectorcraft-eps", - "vectorcraft-geom 0.25.0", + "vectorcraft-geom 0.25.1", "vectorcraft-metafile", - "vectorcraft-pathops 0.25.0", + "vectorcraft-pathops 0.25.1", "vectorcraft-pdf", "vectorcraft-render", "vectorcraft-testkit", @@ -8802,7 +8802,7 @@ dependencies = [ [[package]] name = "vectorcraft-format" -version = "0.25.0" +version = "0.25.1" dependencies = [ "craft-gzip", "craft-vectorcraft-format", @@ -8814,7 +8814,7 @@ dependencies = [ "thiserror 2.0.21", "vectorcraft-brush", "vectorcraft-doc", - "vectorcraft-geom 0.25.0", + "vectorcraft-geom 0.25.1", "vectorcraft-testkit", ] @@ -8830,7 +8830,7 @@ dependencies = [ [[package]] name = "vectorcraft-geom" -version = "0.25.0" +version = "0.25.1" dependencies = [ "kurbo 0.13.1", "proptest", @@ -8841,7 +8841,7 @@ dependencies = [ [[package]] name = "vectorcraft-js" -version = "0.25.0" +version = "0.25.1" dependencies = [ "chrono", "craft-xml", @@ -8852,7 +8852,7 @@ dependencies = [ [[package]] name = "vectorcraft-mcp" -version = "0.25.0" +version = "0.25.1" dependencies = [ "craft", "craft-image-codecs", @@ -8864,7 +8864,7 @@ dependencies = [ "vectorcraft-doc", "vectorcraft-engine", "vectorcraft-format", - "vectorcraft-geom 0.25.0", + "vectorcraft-geom 0.25.1", "vectorcraft-render", "vectorcraft-svg", "vectorcraft-testkit", @@ -8873,7 +8873,7 @@ dependencies = [ [[package]] name = "vectorcraft-metafile" -version = "0.25.0" +version = "0.25.1" dependencies = [ "craft-image-codecs", "craft-metafile", @@ -8883,7 +8883,7 @@ dependencies = [ "vectorcraft-color", "vectorcraft-doc", "vectorcraft-effects", - "vectorcraft-geom 0.25.0", + "vectorcraft-geom 0.25.1", "vectorcraft-text", ] @@ -8900,19 +8900,19 @@ dependencies = [ [[package]] name = "vectorcraft-pathops" -version = "0.25.0" +version = "0.25.1" dependencies = [ "kurbo 0.13.1", "linesweeper", "proptest", "thiserror 2.0.21", - "vectorcraft-geom 0.25.0", + "vectorcraft-geom 0.25.1", "vectorcraft-testkit", ] [[package]] name = "vectorcraft-pdf" -version = "0.25.0" +version = "0.25.1" dependencies = [ "aes 0.8.4", "chrono", @@ -8941,7 +8941,7 @@ dependencies = [ "vectorcraft-color", "vectorcraft-doc", "vectorcraft-effects", - "vectorcraft-geom 0.25.0", + "vectorcraft-geom 0.25.1", "vectorcraft-pdf", "vectorcraft-testkit", "vectorcraft-text", @@ -8949,7 +8949,7 @@ dependencies = [ [[package]] name = "vectorcraft-plugin-worker" -version = "0.25.0" +version = "0.25.1" dependencies = [ "js-sys", "vectorcraft-plugins", @@ -8959,7 +8959,7 @@ dependencies = [ [[package]] name = "vectorcraft-plugins" -version = "0.25.0" +version = "0.25.1" dependencies = [ "craft-image-codecs", "craft-vectorcraft-format", @@ -8971,7 +8971,7 @@ dependencies = [ "thiserror 2.0.21", "vectorcraft-color", "vectorcraft-doc", - "vectorcraft-geom 0.25.0", + "vectorcraft-geom 0.25.1", "vectorcraft-js", "vectorcraft-plugins", "wasmi", @@ -8982,7 +8982,7 @@ dependencies = [ [[package]] name = "vectorcraft-render" -version = "0.25.0" +version = "0.25.1" dependencies = [ "craft-gif", "craft-image-codecs", @@ -9000,7 +9000,7 @@ dependencies = [ "vectorcraft-color", "vectorcraft-doc", "vectorcraft-effects", - "vectorcraft-geom 0.25.0", + "vectorcraft-geom 0.25.1", "vectorcraft-plugins", "vectorcraft-testkit", "vectorcraft-text", @@ -9013,7 +9013,7 @@ dependencies = [ [[package]] name = "vectorcraft-scriptcheck" -version = "0.25.0" +version = "0.25.1" dependencies = [ "proptest", "unicode-properties", @@ -9021,7 +9021,7 @@ dependencies = [ [[package]] name = "vectorcraft-svg" -version = "0.25.0" +version = "0.25.1" dependencies = [ "craft-docpath", "craft-image-codecs", @@ -9045,15 +9045,15 @@ dependencies = [ "vectorcraft-color", "vectorcraft-doc", "vectorcraft-effects", - "vectorcraft-geom 0.25.0", - "vectorcraft-pathops 0.25.0", + "vectorcraft-geom 0.25.1", + "vectorcraft-pathops 0.25.1", "vectorcraft-testkit", "vectorcraft-text", ] [[package]] name = "vectorcraft-testkit" -version = "0.25.0" +version = "0.25.1" dependencies = [ "craft-image-codecs", "fax", @@ -9064,14 +9064,14 @@ dependencies = [ "vectorcraft-doc", "vectorcraft-engine", "vectorcraft-format", - "vectorcraft-geom 0.25.0", + "vectorcraft-geom 0.25.1", "vectorcraft-render", "vectorcraft-svg", ] [[package]] name = "vectorcraft-text" -version = "0.25.0" +version = "0.25.1" dependencies = [ "craft", "craft-fonts-build", @@ -9089,23 +9089,23 @@ dependencies = [ "unicode-script", "unicode-segmentation", "vectorcraft-doc", - "vectorcraft-geom 0.25.0", + "vectorcraft-geom 0.25.1", "vello_cpu", "write-fonts", ] [[package]] name = "vectorcraft-three-d" -version = "0.25.0" +version = "0.25.1" dependencies = [ "proptest", - "vectorcraft-geom 0.25.0", - "vectorcraft-pathops 0.25.0", + "vectorcraft-geom 0.25.1", + "vectorcraft-pathops 0.25.1", ] [[package]] name = "vectorcraft-thumbnail-handler" -version = "0.25.0" +version = "0.25.1" dependencies = [ "png 0.18.1", "windows", @@ -9114,7 +9114,7 @@ dependencies = [ [[package]] name = "vectorcraft-tools" -version = "0.25.0" +version = "0.25.1" dependencies = [ "craft-image-codecs", "kurbo 0.13.1", @@ -9124,15 +9124,15 @@ dependencies = [ "vectorcraft-color", "vectorcraft-doc", "vectorcraft-effects", - "vectorcraft-geom 0.25.0", - "vectorcraft-pathops 0.25.0", + "vectorcraft-geom 0.25.1", + "vectorcraft-pathops 0.25.1", "vectorcraft-text", "vectorcraft-tools", ] [[package]] name = "vectorcraft-trace" -version = "0.25.0" +version = "0.25.1" dependencies = [ "craft-image-codecs", "image", @@ -9140,12 +9140,12 @@ dependencies = [ "serde", "serde_json", "thiserror 2.0.21", - "vectorcraft-geom 0.25.0", + "vectorcraft-geom 0.25.1", ] [[package]] name = "vectorcraft-ui-egui" -version = "0.25.0" +version = "0.25.1" dependencies = [ "bytemuck", "chrono", @@ -9169,7 +9169,7 @@ dependencies = [ "vectorcraft-engine", "vectorcraft-eps", "vectorcraft-format", - "vectorcraft-geom 0.25.0", + "vectorcraft-geom 0.25.1", "vectorcraft-pdf", "vectorcraft-plugins", "vectorcraft-render", @@ -9184,7 +9184,7 @@ dependencies = [ [[package]] name = "vectorcraft-web" -version = "0.25.0" +version = "0.25.1" dependencies = [ "craft", "craft-web-api", @@ -10413,7 +10413,7 @@ checksum = "9440ea3e5aeabb0ac63af70daf835274065238cdd0cec83418f417eae38bacee" [[package]] name = "xtask" -version = "0.25.0" +version = "0.25.1" dependencies = [ "serde_json", ] diff --git a/Cargo.toml b/Cargo.toml index cc76d129c5..ff84f22755 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = ["crates/*", "apps/*", "xtask"] default-members = ["crates/*", "apps/vectorcraft", "apps/vectorcraft-cli", "xtask"] [workspace.package] -version = "0.25.0" +version = "0.25.1" edition = "2024" license = "MIT OR Apache-2.0" rust-version = "1.95" From 41ab3908ef1820dbfb27755c673ae482a61abb96 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 01:51:28 -0800 Subject: [PATCH 074/105] Dependencies: craft-libs moves to 2680a3b3f and egui to 07c20531 craft-libs main at 2680a3b3f adds #4364 (its egui pin moves to 07c20531, which VectorCraft's egui lines now match), #4425, #4409, #4414, #4406, #4349, #4393, #4392, #4398, #4415, #4411, #4402, #4400, #4417, #4399, #4407, #4375, #4428 and #4451. winit stays at 0dfcec0e, the rev craft-libs pins. craft-nightly and craft-web-api move with the other craft-libs crates, and xtask pdf-deps checks the new rev. Cargo.lock: epaint_default_fonts now depends on brotli 9.1.3 and brotli-decompressor 6.3.2. --- Cargo.lock | 198 ++++++++++++++++---------------- Cargo.toml | 98 ++++++++-------- apps/vectorcraft-web/Cargo.toml | 2 +- xtask/src/pdf_deps.rs | 2 +- 4 files changed, 152 insertions(+), 148 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c2892308bf..a5796f08de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1231,7 +1231,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-automation", "craft-behavior", @@ -1272,7 +1272,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "crc32fast", "flate2", @@ -1283,7 +1283,7 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "block2 0.6.2", "objc2 0.6.5", @@ -1295,7 +1295,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "rustix 1.1.6", ] @@ -1303,7 +1303,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1328,7 +1328,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1346,7 +1346,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-behavior", "craft-docpath", @@ -1364,7 +1364,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "crc32fast", "flate2", @@ -1373,7 +1373,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "egui", ] @@ -1381,7 +1381,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "md-5", "rayon", @@ -1390,12 +1390,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-behavior", "craft-cms", @@ -1415,7 +1415,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-control-protocol", "craft-platform", @@ -1426,7 +1426,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1436,7 +1436,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "rayon", ] @@ -1444,7 +1444,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1470,7 +1470,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "blake3", "craft-ecproj-format", @@ -1486,7 +1486,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "serde", ] @@ -1494,7 +1494,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1513,7 +1513,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-codepage", "encoding_rs", @@ -1525,7 +1525,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "serde", "serde_json", @@ -1535,12 +1535,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1555,7 +1555,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1574,7 +1574,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1583,7 +1583,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "cap-primitives", "craft-atomic", @@ -1606,12 +1606,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "gif", ] @@ -1619,7 +1619,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "flate2", ] @@ -1627,7 +1627,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1640,7 +1640,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "brotli 9.1.3", "brotli-decompressor 6.3.2", @@ -1670,7 +1670,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-dds", "craft-jpeg", @@ -1697,7 +1697,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1715,7 +1715,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "thiserror 2.0.21", ] @@ -1723,7 +1723,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1734,7 +1734,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-host", "craft-i18n", @@ -1749,7 +1749,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-behavior", "craft-i18n", @@ -1763,7 +1763,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-behavior", "craft-host", @@ -1781,7 +1781,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1793,7 +1793,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "encoding_rs", "image", @@ -1804,7 +1804,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "chrono", "craft-codepage", @@ -1814,7 +1814,7 @@ dependencies = [ [[package]] name = "craft-nightly" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "uds_windows", "winsafe", @@ -1823,7 +1823,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-behavior", "craft-keymap", @@ -1839,7 +1839,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "flate2", "serde", @@ -1850,7 +1850,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1862,7 +1862,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "async-channel", "async-io", @@ -1895,7 +1895,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1904,7 +1904,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-behavior", "craft-host", @@ -1928,7 +1928,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1939,7 +1939,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-eps", "flate2", @@ -1953,7 +1953,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "encoding_rs", "flate2", @@ -1964,7 +1964,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "dispatch2", "egui", @@ -1977,7 +1977,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1996,7 +1996,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-atomic", "craft-host", @@ -2013,7 +2013,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "fax", "hayro-ccitt", @@ -2024,7 +2024,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2045,7 +2045,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-behavior", "craft-keymap", @@ -2057,7 +2057,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2082,7 +2082,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2097,7 +2097,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-atomic", "craft-behavior", @@ -2112,7 +2112,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "serde", "thiserror 2.0.21", @@ -2122,7 +2122,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "serde", "thiserror 2.0.21", @@ -2131,7 +2131,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-behavior", "craft-keymap", @@ -2146,12 +2146,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2165,7 +2165,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-behavior", "craft-i18n", @@ -2181,7 +2181,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "accesskit", "craft-behavior", @@ -2219,7 +2219,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2230,7 +2230,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-behavior", "craft-host", @@ -2248,7 +2248,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-behavior", "craft-host", @@ -2269,7 +2269,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-behavior", "craft-host", @@ -2290,7 +2290,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-behavior", "craft-host", @@ -2309,7 +2309,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "base64 0.22.1", "chrono", @@ -2341,7 +2341,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "flate2", "serde", @@ -2352,7 +2352,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2362,7 +2362,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "js-sys", "serde_json", @@ -2373,7 +2373,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "winsafe", ] @@ -2381,7 +2381,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "craft-appkit", "craft-atomic", @@ -2413,7 +2413,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "quick-xml 0.41.0", "serde", @@ -2758,7 +2758,7 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "ecolor" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" +source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321" dependencies = [ "bytemuck", "emath", @@ -2791,7 +2791,7 @@ dependencies = [ [[package]] name = "eframe" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" +source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321" dependencies = [ "ahash", "bytemuck", @@ -2826,7 +2826,7 @@ dependencies = [ [[package]] name = "egui" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" +source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321" dependencies = [ "accesskit", "ahash", @@ -2845,7 +2845,7 @@ dependencies = [ [[package]] name = "egui-wgpu" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" +source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321" dependencies = [ "ahash", "bytemuck", @@ -2864,7 +2864,7 @@ dependencies = [ [[package]] name = "egui-winit" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" +source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321" dependencies = [ "accesskit_winit", "arboard", @@ -2889,7 +2889,7 @@ dependencies = [ [[package]] name = "egui_extras" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" +source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321" dependencies = [ "ahash", "egui", @@ -2903,7 +2903,7 @@ dependencies = [ [[package]] name = "egui_glow" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" +source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321" dependencies = [ "bytemuck", "egui", @@ -2916,7 +2916,7 @@ dependencies = [ [[package]] name = "egui_kittest" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" +source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321" dependencies = [ "dify", "eframe", @@ -2942,7 +2942,7 @@ checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be" [[package]] name = "emath" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" +source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321" dependencies = [ "bytemuck", ] @@ -3023,7 +3023,7 @@ dependencies = [ [[package]] name = "epaint" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" +source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321" dependencies = [ "ahash", "bytemuck", @@ -3049,7 +3049,11 @@ dependencies = [ [[package]] name = "epaint_default_fonts" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" +source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321" +dependencies = [ + "brotli 9.1.3", + "brotli-decompressor 6.3.2", +] [[package]] name = "equivalent" @@ -3768,7 +3772,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "brotli 8.0.4", "hayro-postscript", @@ -3777,7 +3781,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3795,7 +3799,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3813,12 +3817,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "flate2", "hayro-ccitt", @@ -4801,7 +4805,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4958,7 +4962,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b#aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" +source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" dependencies = [ "arrayvec", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index 8c2995ce63..efe3e3601f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,51 +10,51 @@ license = "MIT OR Apache-2.0" rust-version = "1.95" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } # Language packs: the Craft apps' shared font store installs them (#4936). -craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } # The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON. -craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } # The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names # the members it imports. -craft = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } # Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui # without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes. -craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } # Nightly profile isolation, launch protocol, and security fence. -craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } +craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -194,22 +194,22 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b" } -ecolor = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } -emath = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } -epaint = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } -epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } -egui = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } -egui-winit = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } -egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } -egui_glow = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } -egui_extras = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } -egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } -eframe = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +ecolor = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" } +emath = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" } +epaint = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" } +epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" } +egui = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" } +egui-winit = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" } +egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" } +egui_glow = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" } +egui_extras = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" } +egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" } +eframe = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" } winit = { git = "https://github.com/storytold/winit.git", rev = "0dfcec0eb62fda5904137a63a6dd0c3d83295f45" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index 0a3a273fcc..2dedefa32f 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -28,7 +28,7 @@ egui_extras = { workspace = true } # `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback. eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] } # The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft. -craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index d69afcd0a8..3e24ddc83c 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "aa7e668ec6e2f2b723de34dceeb7d756f5ff9f4b"; +const REV: &str = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV), From 746b8f3dbadba2e81a55c8977c3f49bac792fa52 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 12:02:25 +0100 Subject: [PATCH 075/105] Count the selected Hand gesture when H is held --- crates/ui-egui/src/canvas/tool_adapter.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/ui-egui/src/canvas/tool_adapter.rs b/crates/ui-egui/src/canvas/tool_adapter.rs index 596c4f4116..031e2875b6 100644 --- a/crates/ui-egui/src/canvas/tool_adapter.rs +++ b/crates/ui-egui/src/canvas/tool_adapter.rs @@ -655,6 +655,9 @@ pub(crate) fn run(app: &mut VectorcraftApp, ui: &mut Ui, pass: &ToolPass) -> Too let mut hand = app.canvas.hand.take().unwrap_or_else(|| craft::ui::canvas::HandTool::new(options)); hand.options = options; let response = host_run(app, ui, pass, &mut hand); + if response.gesture.is_some() && !view_tool_held(app) && ui.input(|i| i.pointer.primary_down()) { + crate::shortcuts::note_tool_use(app); + } app.canvas.hand = Some(hand); response } else { From 99e8655ef62e82d76cdb8d9a47a61093392b57f1 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 12:09:59 +0100 Subject: [PATCH 076/105] Restore the main window on startup and enlarge tool rail icons --- apps/vectorcraft/src/main.rs | 36 +++++++++++++++++++++++++++++++++++- crates/ui-egui/src/theme.rs | 4 ++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/apps/vectorcraft/src/main.rs b/apps/vectorcraft/src/main.rs index 12ac19b08b..3971de013b 100644 --- a/apps/vectorcraft/src/main.rs +++ b/apps/vectorcraft/src/main.rs @@ -112,6 +112,36 @@ use prefs::{load_prefs, log_dir, open_store, prefs_enabled}; const DEFAULT_SIZE: [f32; 2] = [1440.0, 900.0]; const MIN_SIZE: [f32; 2] = [800.0, 500.0]; +/// Apply the saved main-window placement before the first frame. On a first launch the +/// framework maximizes the window when its default size would not fit the current screen. +fn restore_main_window(window: &winit::window::Window, store: &Store, wayland: bool) { + use craft::behavior::placement::{Defaults, place}; + use craft::behavior::{Monitor, MonitorKey}; + use winit::dpi::{LogicalSize, PhysicalPosition}; + + let handles: Vec<_> = window.available_monitors().collect(); + let monitors: Vec<_> = handles + .iter() + .map(|monitor| { + let size = monitor.size(); + let size = [size.width, size.height]; + let position = monitor.position(); + Monitor::new(MonitorKey::new(monitor.name().unwrap_or_default(), size), [position.x, position.y], size, monitor.scale_factor() as f32) + }) + .collect(); + let home = window.current_monitor().or_else(|| window.primary_monitor()).and_then(|monitor| handles.iter().position(|m| *m == monitor)); + let defaults = Defaults::new(DEFAULT_SIZE, MIN_SIZE).with_no_position(wayland); + let placement = place(store.get(craft::window::restore::MAIN).as_ref(), &monitors, home, &defaults); + if let Some([x, y]) = placement.position_px { + window.set_outer_position(PhysicalPosition::new(x, y)); + } + let [width, height] = placement.normal.size; + let _ = window.request_inner_size(LogicalSize::new(width, height)); + if placement.maximized { + window.set_maximized(true); + } +} + /// The window, Dock, taskbar and app-switcher icon (`assets/app-icon/`, see its README). macOS gets /// the version with Apple's transparent margin; elsewhere the full-bleed tile. The app ID matches /// `packaging/linux/ai.storyteller.vectorcraft.desktop` so Wayland docks find the launcher icon. @@ -781,9 +811,13 @@ fn main() -> std::process::ExitCode { Box::new(move |cc| { let ctx = &cc.egui_ctx; let winit_window = cc.winit_window().cloned(); + let placement = placement_store(); + if let Some(window) = &winit_window { + restore_main_window(window, &placement, wayland); + } let spec = InstallSpec::new(shell_info, Arc::new(SystemWindows)) .app_id(vectorcraft_ui_egui::os_window::app_id()) - .placement(Arc::new(Mutex::new(placement_store()))) + .placement(Arc::new(Mutex::new(placement))) .frame(decision); let spec = match start_pen(&winit_window) { Some(pen) => spec.pen(pen), diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rs index 1aa688ceb9..374fe2b460 100644 --- a/crates/ui-egui/src/theme.rs +++ b/crates/ui-egui/src/theme.rs @@ -166,10 +166,14 @@ const SIZES: &[u8] = br#"{ "size.page.button_side": 16, "size.page.link": 24 }, + "comfortable": { + "size.icon.lg": 26 + }, "compact": { "size.control.md": 26, "size.button": 24, "size.icon.glyph_md": 16, + "size.icon.lg": 24, "size.rail.width": 38, "size.dock.column": 310, "size.bar.column": 14, From 847e407ab69f3fbad7fa11230b1e6997bd0ad8da Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 12:16:39 +0100 Subject: [PATCH 077/105] Honor pre-refactor window preferences and preserve Hand placement clicks --- apps/vectorcraft/src/main.rs | 15 +++++++++++---- crates/ui-egui/src/canvas/tool_adapter.rs | 4 ++-- crates/ui-egui/src/state.rs | 13 +++++++++++++ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/apps/vectorcraft/src/main.rs b/apps/vectorcraft/src/main.rs index 3971de013b..6ab6778597 100644 --- a/apps/vectorcraft/src/main.rs +++ b/apps/vectorcraft/src/main.rs @@ -114,8 +114,8 @@ const MIN_SIZE: [f32; 2] = [800.0, 500.0]; /// Apply the saved main-window placement before the first frame. On a first launch the /// framework maximizes the window when its default size would not fit the current screen. -fn restore_main_window(window: &winit::window::Window, store: &Store, wayland: bool) { - use craft::behavior::placement::{Defaults, place}; +fn restore_main_window(window: &winit::window::Window, store: &Store, legacy: Option, wayland: bool) { + use craft::behavior::placement::{Defaults, Placement, place}; use craft::behavior::{Monitor, MonitorKey}; use winit::dpi::{LogicalSize, PhysicalPosition}; @@ -131,7 +131,14 @@ fn restore_main_window(window: &winit::window::Window, store: &Store, wayland: b .collect(); let home = window.current_monitor().or_else(|| window.primary_monitor()).and_then(|monitor| handles.iter().position(|m| *m == monitor)); let defaults = Defaults::new(DEFAULT_SIZE, MIN_SIZE).with_no_position(wayland); - let placement = place(store.get(craft::window::restore::MAIN).as_ref(), &monitors, home, &defaults); + let saved = store.get(craft::window::restore::MAIN).or_else(|| { + let old = legacy?; + let mut placement = Placement::new(old.size, window.scale_factor() as f32); + placement.position_px = old.pos; + placement.maximized = old.maximized; + placement.repaired() + }); + let placement = place(saved.as_ref(), &monitors, home, &defaults); if let Some([x, y]) = placement.position_px { window.set_outer_position(PhysicalPosition::new(x, y)); } @@ -813,7 +820,7 @@ fn main() -> std::process::ExitCode { let winit_window = cc.winit_window().cloned(); let placement = placement_store(); if let Some(window) = &winit_window { - restore_main_window(window, &placement, wayland); + restore_main_window(window, &placement, settings.lock().get().ui.legacy_window, wayland); } let spec = InstallSpec::new(shell_info, Arc::new(SystemWindows)) .app_id(vectorcraft_ui_egui::os_window::app_id()) diff --git a/crates/ui-egui/src/canvas/tool_adapter.rs b/crates/ui-egui/src/canvas/tool_adapter.rs index 031e2875b6..6ebdd54af4 100644 --- a/crates/ui-egui/src/canvas/tool_adapter.rs +++ b/crates/ui-egui/src/canvas/tool_adapter.rs @@ -650,12 +650,12 @@ pub(crate) fn run(app: &mut VectorcraftApp, ui: &mut Ui, pass: &ToolPass) -> Too let mut picked = ToolHostResponse::default(); let mut response = if crate::dialogs::recolor::edit_tab::with_theme_pick(app, |app, tool| picked = host_run(app, ui, pass, tool)) { picked - } else if app.session.tool_id() == "hand" && app.ui.screen_mode != 3 { + } else if app.session.tool_id() == "hand" && app.ui.screen_mode != 3 && app.ui.rearrange_placement.is_none() { let options = crate::app::view::navigation(&app.session.prefs); let mut hand = app.canvas.hand.take().unwrap_or_else(|| craft::ui::canvas::HandTool::new(options)); hand.options = options; let response = host_run(app, ui, pass, &mut hand); - if response.gesture.is_some() && !view_tool_held(app) && ui.input(|i| i.pointer.primary_down()) { + if response.gesture.is_some() && !view_tool_held(app) && ui.input(|i| i.pointer.primary_down() || i.pointer.primary_pressed()) { crate::shortcuts::note_tool_use(app); } app.canvas.hand = Some(hand); diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 5ac49daeb9..eeef403f06 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -490,6 +490,15 @@ pub struct ContextSpelling { pub suggestions: Vec, } +/// The main window as saved in the UI preferences through 0.24.1. Positions are desktop pixels. +#[derive(Clone, Copy, Debug, Deserialize)] +pub struct LegacyWindow { + pub pos: Option<[i32; 2]>, + pub size: [f32; 2], + #[serde(default)] + pub maximized: bool, +} + /// Two states are equal when they save the same: the settings store writes only a changed saved form, /// and the panels' session state is no change to save. #[derive(Clone, Debug, Serialize, Deserialize)] @@ -500,6 +509,9 @@ pub struct UiState { /// it is never written back. #[serde(rename = "language", skip_serializing)] pub legacy_language: Option, + /// Used until the shared window store has recorded the main window. + #[serde(rename = "window", skip_serializing)] + pub legacy_window: Option, pub brightness: Brightness, /// The panel arrangement: docks, floating windows, closed panels and where each goes back. One /// `Arc` the dock area keeps across frames; writers change it through `Arc::make_mut`. @@ -1448,6 +1460,7 @@ impl Default for UiState { fn default() -> Self { Self { legacy_language: None, + legacy_window: None, brightness: Brightness::MediumDark, dock_workspace: std::sync::Arc::new(crate::panel_docking::default_workspace(&[])), tools_last_used: Default::default(), From 04ced9bee734f216ee55ac13316932b5e501184c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 03:33:26 -0800 Subject: [PATCH 078/105] Performance: the check of a moved selection reads the objects at their places After a move, the check that a view can move the selection's marks instead of building them again looked each moved object up by id three times: the object, its parent's id and the parent. With 10,000 objects selected that was 30,000 lookups after the edit. The check now keeps each object's place from the transform and reads the object and its parent there, so the move looks each object up once, as before. --- crates/engine/src/cmd/object/transform.rs | 26 ++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/crates/engine/src/cmd/object/transform.rs b/crates/engine/src/cmd/object/transform.rs index c3ce0107f0..4212588f1b 100644 --- a/crates/engine/src/cmd/object/transform.rs +++ b/crates/engine/src/cmd/object/transform.rs @@ -200,7 +200,7 @@ fn apply_transform_moving_guides( // A move of whole objects, not of copies (which `reindex` covers): the document before it, // and the moved objects as the transform left them, for [`moved_by`] to check after the edit. let from = (objects && !areas && !reindex && c[..4] == [1.0, 0.0, 0.0, 1.0]).then(|| s.doc().map(|st| st.doc.clone())).transpose()?; - let mut held: Vec<(NodeId, Arc)> = vec![]; + let mut held: Vec<(Vec, Arc)> = vec![]; let targets = s.edit(label, |d, sel| { let mut targets = match &kept { // The document becomes the snapshot with the kept copies, untransformed, and the @@ -240,7 +240,7 @@ fn apply_transform_moving_guides( } // Holding them makes any later change to them copy them first, which `moved_by` sees. if from.is_some() { - held = targets.iter().filter_map(|id| Some((*id, node_arc(d, paths.get(id)?)?))).collect(); + held = targets.iter().filter_map(|id| paths.get(id)).filter_map(|p| Some((p.clone(), node_arc(d, p)?))).collect(); } if objects { // The transforms above leave every object at its place, so `paths` still holds them. @@ -294,20 +294,22 @@ fn node_arc(d: &Document, path: &[usize]) -> Option> { } /// The [`crate::Moved`] of a move by `by` that took `from` to the document of `st`, given the moved -/// objects as the transform left them (`held`). `None` unless every moved object is still that -/// node, none is a member of a blend (whose spine follows its members), and every object the -/// selection shows, the key object and the key anchor's object included, is a moved object or -/// inside one. A pass after the transform that changes a moved object, such as the one that snaps -/// moved pixel-aligned objects to the pixel grid again ([`super::pixelgrid::refresh`]), copies it -/// first, so it is no longer that node. -fn moved_by(from: &Arc, st: &crate::DocState, held: &[(NodeId, Arc)], by: Vec2) -> Option { +/// objects as the transform left them (`held`, each with its index path). `None` unless every moved +/// object is still that node at its path, none is a member of a blend (whose spine follows its +/// members), and every object the selection shows, the key object and the key anchor's object +/// included, is a moved object or inside one. A pass after the transform that changes a moved +/// object, such as the one that snaps moved pixel-aligned objects to the pixel grid again +/// ([`super::pixelgrid::refresh`]), copies it first, so it is no longer that node. The checks read +/// the nodes at their paths and look nothing up by id. +fn moved_by(from: &Arc, st: &crate::DocState, held: &[(Vec, Arc)], by: Vec2) -> Option { let d = &st.doc; - let unchanged = |(id, n): &(NodeId, Arc)| d.node(*id).is_some_and(|now| std::ptr::eq(now, Arc::as_ptr(n))); + let unchanged = |(p, n): &(Vec, Arc)| d.node_at(p).is_some_and(|now| std::ptr::eq(now, Arc::as_ptr(n))); if held.is_empty() || !held.iter().all(unchanged) { return None; } - let in_blend = |id: NodeId| d.parent_of(id).and_then(|p| d.node(p)).is_some_and(|p| matches!(p.kind, NodeKind::Blend { .. })); - if held.iter().any(|(id, _)| in_blend(*id)) { + // The node at each path is the moved object, so its parent is the node one level up. + let in_blend = |p: &[usize]| p.split_last().and_then(|(_, up)| d.node_at(up)).is_some_and(|parent| matches!(parent.kind, NodeKind::Blend { .. })); + if held.iter().any(|(p, _)| in_blend(p)) { return None; } let mut moved = std::collections::HashSet::new(); From 39ab91529711d50ed81194abcc5b335c0aba7941 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 03:39:10 -0800 Subject: [PATCH 079/105] =?UTF-8?q?Tests:=20Expand=E2=80=A6=20keeps=20the?= =?UTF-8?q?=20general=20tooltip=20with=20nothing=20selected?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The walk-count test now checks that Object › Expand…, dimmed with nothing selected, shows the general reason as its tooltip, as on main, instead of only checking that the tooltip is not the appearance one. --- crates/ui-egui/src/menus/model.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/menus/model.rs b/crates/ui-egui/src/menus/model.rs index 37de6908c2..31f20688fc 100644 --- a/crates/ui-egui/src/menus/model.rs +++ b/crates/ui-egui/src/menus/model.rs @@ -736,6 +736,8 @@ mod tests { assert_eq!(tooltip(&app).as_deref(), Some(crate::dialogs::expand::appearance_first())); app.run("select.none", json!({})).unwrap(); assert_eq!(walks(&mut app), 0, "nothing selected"); - assert_ne!(tooltip(&app).as_deref(), Some(crate::dialogs::expand::appearance_first())); + // Dimmed with nothing selected, the row keeps the general reason as its tooltip, as before. + let tip = tooltip(&app); + assert!(tip.as_deref().is_some_and(|t| t != crate::dialogs::expand::appearance_first()), "{tip:?}"); } } From 8c7ddea00a26c2031792ac3046252a834a22e53e Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 12:46:11 +0100 Subject: [PATCH 080/105] Finish Hand panning before switching to a pen eraser --- crates/ui-egui/src/canvas/tests.rs | 19 +++++++++++++++++++ crates/ui-egui/src/canvas/tool_adapter.rs | 1 + 2 files changed, 20 insertions(+) diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index b91f6d504b..d441c59316 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -4874,6 +4874,25 @@ fn a_flip_during_a_press_waits_for_the_release() { assert_eq!(app.session.tool_id(), "eraser", "the frame after the release"); } +/// A selected Hand tracks its drag in the framework, outside the document tool's grab. +#[test] +fn turning_the_pen_during_a_hand_drag_waits_for_release() { + let (mut app, stylus, ctx) = pen_app(); + app.select_tool("hand"); + let at = app.canvas_view().unwrap().rect.center(); + let to = at + egui::vec2(30.0, 20.0); + let button = |pos, pressed| egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + stylus.set(tip(0.5)); + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(at), button(at, true)]); + stylus.set(eraser_end(0.5)); + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(to)]); + assert_eq!(app.session.tool_id(), "hand"); + frame(&mut app, &ctx, vec![button(to, false)]); + assert_eq!(app.session.tool_id(), "hand"); + frame(&mut app, &ctx, vec![]); + assert_eq!(app.session.tool_id(), "eraser"); +} + /// #764: a tool chosen while the eraser end stands in (the toolbar and shortcuts call /// `select_tool`; menus and MCP run `tool.select`) stays when the tip comes back. #[test] diff --git a/crates/ui-egui/src/canvas/tool_adapter.rs b/crates/ui-egui/src/canvas/tool_adapter.rs index 6ebdd54af4..cc2750f2a4 100644 --- a/crates/ui-egui/src/canvas/tool_adapter.rs +++ b/crates/ui-egui/src/canvas/tool_adapter.rs @@ -629,6 +629,7 @@ pub(crate) fn run(app: &mut VectorcraftApp, ui: &mut Ui, pass: &ToolPass) -> Too // the release, and a pointer over another window for the pointer to come in. if ui.ctx().current_pass_index() == 0 && app.canvas.grab.is_none() + && !ToolHost::in_gesture(ui.ctx(), pass.id) && ui.input(|i| i.pointer.has_pointer()) && crate::stylus::sync_eraser_tool(app) { From 891909a9d5460d8a3ecce672dafef9f207c85ece Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 12:48:10 +0100 Subject: [PATCH 081/105] Keep all drawing modes inside the double-column toolbar --- crates/ui-egui/src/toolbar.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index 618bace39b..e80ed26a77 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -823,7 +823,7 @@ fn bottom_controls(app: &mut VectorcraftApp, ui: &mut Ui, footer: RailFooter) { None => button, }; // Small in two columns, where the three sit side by side in the rail's width. - let button = if two { button.size(ControlSize::Sm) } else { button }; + let button = if two { button.size(ControlSize::Sm).glyphs(craft::ui::style::GlyphRole::Tool) } else { button }; button.show(ui).clicked() }; let mut run = None; From 98e5003ec31d4db5dca005a809cb9b5b12a367a6 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 13:21:47 +0100 Subject: [PATCH 082/105] Commit hovered font rows and avoid native clock calls in web character controls --- crates/ui-egui/src/panels/character.rs | 28 +++++++++++++++----------- crates/ui-egui/src/tests/font_menu.rs | 1 + 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/crates/ui-egui/src/panels/character.rs b/crates/ui-egui/src/panels/character.rs index 9415a7e50f..677eec516a 100644 --- a/crates/ui-egui/src/panels/character.rs +++ b/crates/ui-egui/src/panels/character.rs @@ -6,7 +6,6 @@ use std::cell::RefCell; use std::collections::HashSet; use std::rc::Rc; use std::sync::{Arc, Mutex, Weak}; -use std::time::SystemTime; // PLAN: assumed the framework paths below (craft::text::ui re-exports, craft_ui widgets and runtime, craft::font_manager). use craft::behavior::EditEvent; @@ -47,12 +46,15 @@ use crate::font_menu; /// attributes of the paragraph the selection starts in (else of the first paragraph). /// Font/paragraph controls and named-style capture use this; dimensional fields use `shared_effective`. pub(crate) fn text_style(app: &VectorcraftApp) -> Option<(CharStyle, vectorcraft_doc::ParaStyle)> { + let state = app.session.active()?; + // Hover changes the canvas, but the picker compares its next row click against the committed font. + let doc = state.interaction.as_ref().filter(|_| app.font_preview_owner.is_some()).map_or(&state.doc, |preview| &preview.doc); if let Some((id, a, b)) = text_editing(app) - && let Some(NodeKind::Text(t)) = app.session.active().and_then(|d| d.doc.node(id)).map(|n| &n.kind) + && let Some(NodeKind::Text(t)) = doc.node(id).map(|n| &n.kind) { return Some((vectorcraft_text::edit::insertion_style(&t.runs, a, b), t.para_at(t.paragraphs_in(a, a).start).clone())); } - let t = first_selected_text(app)?; + let NodeKind::Text(t) = &first_selected_text_node_in(state, doc)?.kind else { return None }; Some((t.first_style(), t.para_at(0).clone())) } @@ -68,7 +70,11 @@ pub(crate) fn first_selected_text(app: &VectorcraftApp) -> Option<&vectorcraft_d /// their descendants, in selection order, then paint order within each selected object. pub(crate) fn first_selected_text_node(app: &VectorcraftApp) -> Option<&vectorcraft_doc::Node> { let st = app.session.active()?; - for node in st.selection.objects.iter().filter_map(|id| st.doc.node(*id)) { + first_selected_text_node_in(st, &st.doc) +} + +fn first_selected_text_node_in<'a>(state: &DocState, doc: &'a vectorcraft_doc::Document) -> Option<&'a vectorcraft_doc::Node> { + for node in state.selection.objects.iter().filter_map(|id| doc.node(*id)) { let mut text = None; node.walk(&mut |n| { if text.is_none() && matches!(n.kind, NodeKind::Text(_)) { @@ -1219,16 +1225,14 @@ pub(crate) fn controls(app: &mut VectorcraftApp, ui: &mut Ui, rows: CharacterRow let languages: Option> = rows.contains(CharacterRows::STYLE_TOGGLES).then(|| LANGUAGES.iter().map(|(name, _, _)| (name.to_string(), name.to_string())).collect()); let catalog = vectorcraft_text::FontDb::global().catalog(); - let before = font_menu::picker_settings(app); - let mut settings = before.clone(); - let document = font_menu::document_family_set(app); - let recent = font_menu::recently_added_set(app, SystemTime::now()); - let sets = font_menu::family_sets(Some(&document[..]), &recent[..]); + let mut hold = font_menu::hold(app); + let before = hold.settings.clone(); + let sets = font_menu::family_sets(hold.document.as_deref(), &hold.recently_added); let sample = font_menu::sample_text(app); let unit = type_unit(app); let mut source = FontPickerSource::new(catalog) - .settings(Bind::bound(&mut settings)) - .filters(Bind::bound(&mut app.ui.font_filters)) + .settings(Bind::bound(&mut hold.settings)) + .filters(Bind::bound(&mut hold.filters)) .sets(&sets) .scripts(&FontScript::ALL) .filter_layout(FilterLayout::Toolbar); @@ -1248,7 +1252,7 @@ pub(crate) fn controls(app: &mut VectorcraftApp, ui: &mut Ui, rows: CharacterRow controls = controls.axes(FaceAxes::new(axes, instances).italic(face_of(¤t.font_style).2)); } let out = controls.show(ui); - font_menu::store_picker_settings(app, &before, settings); + hold.store(app, &before); let CharacterControlsOutput { picker, preview_family, edits, .. } = out; if let Some(owner) = picker { font_menu::apply_preview(app, owner, preview_family); diff --git a/crates/ui-egui/src/tests/font_menu.rs b/crates/ui-egui/src/tests/font_menu.rs index 9a6ce5421c..9a4b7323db 100644 --- a/crates/ui-egui/src/tests/font_menu.rs +++ b/crates/ui-egui/src/tests/font_menu.rs @@ -86,6 +86,7 @@ fn preview_changes_the_text_live_and_only_a_choice_is_a_step() { let before = steps(&app); apply_preview(&mut app, owner(), Preview::Shows("Source Serif 4".into())); assert_eq!(font_of(&app, id), "Source Serif 4", "previewed on the text"); + assert_eq!(crate::panels::character::values(&mut app).family.as_deref(), Some("Inter"), "the picker must still be able to commit the previewed row"); apply_preview(&mut app, owner(), Preview::Shows("Source Sans 3".into())); assert_eq!(font_of(&app, id), "Source Sans 3"); apply_preview(&mut app, owner(), Preview::Ended); From aeae489395db6947f4e99b072bed996f6f96c709 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 13:25:54 +0100 Subject: [PATCH 083/105] Bound text-object joins within the import comparison budget --- crates/eps/src/import/native/plan.rs | 34 ++++++++++++++++++---------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/crates/eps/src/import/native/plan.rs b/crates/eps/src/import/native/plan.rs index 487cae27b4..e4eec8cdc5 100644 --- a/crates/eps/src/import/native/plan.rs +++ b/crates/eps/src/import/native/plan.rs @@ -350,35 +350,45 @@ fn see_page_type(content: &mut [Content], shown: &[Vec>]) -> Option, Vec, bool)> = shown.iter().map(|o| (texts(o).iter().filter_map(|n| n.visual_bounds()).collect(), object_words(o), false)).collect(); let pieces: usize = objects.iter().map(|o| o.0.len()).sum(); - if content.len().saturating_mul(pieces) > MAX_PAIRS { - return None; - } + let mut budget = MAX_PAIRS.checked_sub(content.len().checked_mul(pieces)?)?; let holds = |drawn: Rect, r: &Rect| drawn.inflate(OUTLINE_REACH, OUTLINE_REACH).intersect(*r).area() >= 0.5 * r.area().max(1e-9); // The made type holding each object, in order: where it draws and its words. - let mut holders: Vec> = vec![vec![]; objects.len()]; - for c in content { - let Content::Made(node, region, seen) = c else { continue }; + let mut holders: Vec>> = vec![vec![]; objects.len()]; + let mut seen_slots = Vec::new(); + for (slot, c) in content.iter().enumerate() { + let Content::Made(node, region, _) = c else { continue }; // Hidden made type has no region: where it draws, shown, is its own box. let Some(drawn) = region.or_else(|| node.visual_bounds()) else { continue }; let (spelled, holder) = match &node.kind { NodeKind::Text(t) => { let text = t.plain_text(); let [a, b, ..] = t.xf.as_coeffs(); - (spelling(&text), Some((drawn.center(), (a, b), word_pieces(&text).map(spelling).filter(|w| !w.is_empty()).collect()))) + (spelling(&text), Some(Arc::new((drawn.center(), (a, b), word_pieces(&text).map(spelling).filter(|w| !w.is_empty()).collect())))) } _ => (String::new(), None), }; for ((rects, words, held), by) in objects.iter_mut().zip(&mut holders) { if rects.iter().any(|r| holds(drawn, r)) { *held = true; - *seen |= region.is_some(); + if region.is_some() && seen_slots.last() != Some(&slot) { + seen_slots.push(slot); + } words.retain(|w| !spelled.contains(w.as_str())); by.extend(holder.clone()); } } } for ((_, words, _), by) in objects.iter_mut().zip(&holders) { - words.retain(|w| !joined_by_two(w, by)); + if !words.is_empty() && !by.is_empty() { + // Each unmatched word can visit every ordered pair of holders, plus the first-holder scan. + budget = budget.checked_sub(words.len().checked_mul(by.len())?.checked_mul(by.len().checked_add(1)?)?)?; + words.retain(|w| !joined_by_two(w, by)); + } + } + for slot in seen_slots { + if let Content::Made(_, _, seen) = &mut content[slot] { + *seen = true; + } } Some(objects.iter().filter(|(_, words, held)| !held || !words.is_empty()).count()) } @@ -390,11 +400,11 @@ type Holder = (Point, (f64, f64), Vec); /// Is `word` (a [`spelling`]) the last word of one of `by` joined to the first word of another of /// them that draws after it, along the first one's lines? Each part is a whole word of its text /// object, so a piece is never made up of bits of words. -fn joined_by_two(word: &str, by: &[Holder]) -> bool { - by.iter().any(|(at, (a, b), first)| { +fn joined_by_two(word: &str, by: &[Arc]) -> bool { + by.iter().map(Arc::as_ref).any(|(at, (a, b), first)| { let Some(head) = first.last().filter(|h| word.len() > h.len() && word.starts_with(h.as_str())) else { return false }; let tail = &word[head.len()..]; - by.iter().any(|(next, _, second)| (next.x - at.x) * a + (next.y - at.y) * b > 0.0 && second.first().is_some_and(|w| w == tail)) + by.iter().map(Arc::as_ref).any(|(next, _, second)| (next.x - at.x) * a + (next.y - at.y) * b > 0.0 && second.first().is_some_and(|w| w == tail)) }) } From 80ceb782aafa0e8f5c65e9e483c79e58051ac71a Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 13:27:12 +0100 Subject: [PATCH 084/105] Measure copied art from the active source artboard for Paste in Place --- crates/engine/src/cmd/edit.rs | 11 +++++++++-- crates/engine/src/command_sets.rs | 8 ++++++-- crates/ui-egui/src/app/commands.rs | 3 ++- crates/ui-egui/src/canvas/tests.rs | 17 +++++++++++++++++ 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index 4fc1b83c29..84f28ab942 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -162,7 +162,7 @@ pub fn specs() -> Vec { "Cut", ["Edit"], Some("Cmd+X"), - "{selectedArtboards?: [n…], art?: bool, lockedAndHidden?: bool (the Artboard tool chosen, as artboard.cut)} (as edit.copy) removes the objects it copies, in one undo step: a compound-path member selected on its own leaves the compound's other members in the compound (selected ruler guides go too; the Artboard tool chosen, or selectedArtboards given: artboard.cut); refused while an object of a symbol instance's art is selected", + "{artboard?: index (the source artboard for copied objects), selectedArtboards?: [n…], art?: bool, lockedAndHidden?: bool (the Artboard tool chosen, as artboard.cut)} (as edit.copy) removes the objects it copies, in one undo step: a compound-path member selected on its own leaves the compound's other members in the compound (selected ruler guides go too; the Artboard tool chosen, or selectedArtboards given: artboard.cut); refused while an object of a symbol instance's art is selected", has_selection_guides_or_artboard_tool, cut ), @@ -171,7 +171,7 @@ pub fn specs() -> Vec { "Copy", ["Edit"], Some("Cmd+C"), - "{selectedArtboards?: [n…] (the artboards the Artboard tool had selected, which the journal records for a replay; it runs artboard.copy with any tool chosen), art?: bool (default: the Artboard tool's moveArt option; the journal records it beside selectedArtboards), lockedAndHidden?: bool (the Artboard tool chosen, as artboard.copy)} the selection with what it uses (a compound-path member selected on its own, whole or in part, with Direct or Group Selection, is copied as an ordinary path with the compound's paint, transparency, opacity mask, fill rule and graphic style link (while it has that style's look), a gradient keeping the compound's fit; the compound is copied when it is selected, or when every member is selected whole outside isolation mode), and the selected ruler guides (pasted on the layer new art goes to, moved as the objects are; alone, where they were); the Artboard tool chosen: artboard.copy; with an object of a symbol instance's art selected, the instance is copied whole → {copied, guides}", + "{artboard?: index (the source artboard for copied objects; without it, the artboard containing the selection center), selectedArtboards?: [n…] (the artboards the Artboard tool had selected, which the journal records for a replay; it runs artboard.copy with any tool chosen), art?: bool (default: the Artboard tool's moveArt option; the journal records it beside selectedArtboards), lockedAndHidden?: bool (the Artboard tool chosen, as artboard.copy)} the selection with what it uses (a compound-path member selected on its own, whole or in part, with Direct or Group Selection, is copied as an ordinary path with the compound's paint, transparency, opacity mask, fill rule and graphic style link (while it has that style's look), a gradient keeping the compound's fit; the compound is copied when it is selected, or when every member is selected whole outside isolation mode), and the selected ruler guides (pasted on the layer new art goes to, moved as the objects are; alone, where they were); the Artboard tool chosen: artboard.copy; with an object of a symbol instance's art selected, the instance is copied whole → {copied, guides}", has_selection_guides_or_artboard_tool, copy ), @@ -1163,6 +1163,13 @@ fn copy(s: &mut Session, p: &Value) -> Result { }); clip.source_artboard = board.map(|a| a.rect); } + if let Some(value) = p.get("artboard") { + let board = value + .as_u64() + .and_then(|v| st.doc.artboards.get(index(v))) + .ok_or_else(|| bad("edit.copy", "`artboard` must be the index of an artboard of the document"))?; + clip.source_artboard = Some(board.rect); + } clip.guides = guides; s.clipboard = clip; Ok(json!({ "copied": s.clipboard.nodes.len(), "guides": s.clipboard.guides.len() })) diff --git a/crates/engine/src/command_sets.rs b/crates/engine/src/command_sets.rs index 1346dc40c5..893c4f78e9 100644 --- a/crates/engine/src/command_sets.rs +++ b/crates/engine/src/command_sets.rs @@ -5,7 +5,9 @@ use super::{NodeId, Value, cmd, find_command}; /// Objects and Distribute Spacing with Align to Artboard distribute objects across it, All on /// Active Artboard selects on it, and Edit Symbol from the Symbols panel centers the symbol's art /// on it. A `command.batch` given `artboard` passes it on to each of their steps that names none. -pub const ON_ACTIVE_ARTBOARD: [&str; 8] = [ +pub const ON_ACTIVE_ARTBOARD: [&str; 10] = [ + "edit.copy", + "edit.cut", "edit.pasteInPlace", "edit.pasteInFront", "edit.pasteInBack", @@ -35,7 +37,9 @@ pub const DRAWS_SHAPE: [&str; 5] = ["shape.rectangle", "shape.ellipse", "shape.p /// Artboard tool had selected for its commands and for Paste in Place, in Front and in Back; the artboards and art Cut and Copy took with that /// tool chosen; the view's center the app passes to Edit Symbol); an action leaves them out /// ([`Session::journal_for_action`]). -const REPLAY_ONLY: [(&str, &str); 35] = [ +const REPLAY_ONLY: [(&str, &str); 37] = [ + ("edit.copy", "artboard"), + ("edit.cut", "artboard"), ("file.new", "created"), ("edit.newDocumentFromState", "created"), ("document.save", "modified"), diff --git a/crates/ui-egui/src/app/commands.rs b/crates/ui-egui/src/app/commands.rs index b7ff421414..1452288749 100644 --- a/crates/ui-egui/src/app/commands.rs +++ b/crates/ui-egui/src/app/commands.rs @@ -129,11 +129,12 @@ impl VectorcraftApp { /// document without artboards they get neither. fn add_active_artboard(&self, id: &str, params: &mut Value) { let paste = matches!(id, "edit.pasteInPlace" | "edit.pasteInFront" | "edit.pasteInBack"); + let clipboard_command = paste || matches!(id, "edit.copy" | "edit.cut"); if (vectorcraft_engine::ON_ACTIVE_ARTBOARD.contains(&id) || id == "command.batch") && params.get("artboard").is_none() && !(paste && params.get("artboards").is_some()) && self.view().is_some() - && let Some(n) = self.session.active().map(|d| d.doc.artboards.len()).filter(|n| *n > 0 || !paste) + && let Some(n) = self.session.active().map(|d| d.doc.artboards.len()).filter(|n| *n > 0 || !clipboard_command) && let Some(p) = params.as_object_mut() { let picked = panels::artboards::picked(self, n); diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index d441c59316..e8b26555e2 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -426,6 +426,23 @@ fn a_click_activates_its_artboard_and_paste_in_place_goes_onto_it() { assert_eq!((b.x0, b.y0), (boards[2].x0 + 10.0, boards[2].y0 + 15.0)); } +/// Copy uses the active board as its origin even when selected art lies on a different board. +#[test] +fn copy_and_paste_use_the_active_source_and_destination_artboards() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 200, "height": 100, "artboards": 3})).unwrap(); + let boards: Vec<_> = app.session.active().unwrap().doc.artboards.iter().map(|a| a.rect).collect(); + let origin = Point::new(boards[1].x0 + 10.0, boards[1].y0 + 15.0); + app.run("shape.rectangle", json!({"x": origin.x, "y": origin.y, "width": 20, "height": 20})).unwrap(); + app.views[0].artboard = 0; + app.run("edit.copy", json!({})).unwrap(); + app.views[0].artboard = 2; + let pasted = app.run("edit.pasteInPlace", json!({})).unwrap(); + let id = vectorcraft_doc::NodeId(pasted["ids"][0].as_u64().unwrap()); + let bounds = app.session.active().unwrap().doc.bounds_of(&[id], false).unwrap(); + assert_eq!(bounds.origin(), origin + (boards[2].origin() - boards[0].origin())); +} + /// A Shift-click with the Selection tool on an empty spot inside an artboard makes it the active /// one and keeps the selection, and Align to Artboard then aligns the objects to it unless the /// call names another artboard. From dc5958913555e422e649d5662320cfa0ef5ee175 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 13:39:42 +0100 Subject: [PATCH 085/105] Format the import budget check --- crates/eps/src/import/native/plan.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/eps/src/import/native/plan.rs b/crates/eps/src/import/native/plan.rs index e4eec8cdc5..a23e8ea324 100644 --- a/crates/eps/src/import/native/plan.rs +++ b/crates/eps/src/import/native/plan.rs @@ -404,7 +404,9 @@ fn joined_by_two(word: &str, by: &[Arc]) -> bool { by.iter().map(Arc::as_ref).any(|(at, (a, b), first)| { let Some(head) = first.last().filter(|h| word.len() > h.len() && word.starts_with(h.as_str())) else { return false }; let tail = &word[head.len()..]; - by.iter().map(Arc::as_ref).any(|(next, _, second)| (next.x - at.x) * a + (next.y - at.y) * b > 0.0 && second.first().is_some_and(|w| w == tail)) + by.iter() + .map(Arc::as_ref) + .any(|(next, _, second)| (next.x - at.x) * a + (next.y - at.y) * b > 0.0 && second.first().is_some_and(|w| w == tail)) }) } From 274983176d72baf531faa284ebcd47ac10609ff3 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 13:39:47 +0100 Subject: [PATCH 086/105] Format the font preview regression test --- crates/ui-egui/src/tests/font_menu.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/tests/font_menu.rs b/crates/ui-egui/src/tests/font_menu.rs index 9a4b7323db..28d573d09b 100644 --- a/crates/ui-egui/src/tests/font_menu.rs +++ b/crates/ui-egui/src/tests/font_menu.rs @@ -86,7 +86,11 @@ fn preview_changes_the_text_live_and_only_a_choice_is_a_step() { let before = steps(&app); apply_preview(&mut app, owner(), Preview::Shows("Source Serif 4".into())); assert_eq!(font_of(&app, id), "Source Serif 4", "previewed on the text"); - assert_eq!(crate::panels::character::values(&mut app).family.as_deref(), Some("Inter"), "the picker must still be able to commit the previewed row"); + assert_eq!( + crate::panels::character::values(&mut app).family.as_deref(), + Some("Inter"), + "the picker must still be able to commit the previewed row" + ); apply_preview(&mut app, owner(), Preview::Shows("Source Sans 3".into())); assert_eq!(font_of(&app, id), "Source Sans 3"); apply_preview(&mut app, owner(), Preview::Ended); From 8df3fd17ac54c05e22c870be04d72891723bd2b7 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 13:53:24 +0100 Subject: [PATCH 087/105] Restore white artboards in Outline and the selection arrow over selected art --- crates/tools/src/cursor.rs | 2 ++ crates/tools/src/select.rs | 6 +++--- crates/tools/src/select/tests.rs | 18 +++++++++--------- crates/ui-egui/src/canvas/artboards.rs | 4 ++-- crates/ui-egui/src/canvas/artboards/tests.rs | 4 ++-- crates/ui-egui/src/cursors.rs | 2 ++ 6 files changed, 20 insertions(+), 16 deletions(-) diff --git a/crates/tools/src/cursor.rs b/crates/tools/src/cursor.rs index 0f654340fe..657287124c 100644 --- a/crates/tools/src/cursor.rs +++ b/crates/tools/src/cursor.rs @@ -17,6 +17,8 @@ pub enum Cursor { GroupSelection, /// Alt-dragging a copy with the Selection or Direct Selection tool: a double arrowhead. SelectionCopy, + /// The Selection arrow over movable artwork. + SelectionMove, Move, Crosshair, ResizeH, diff --git a/crates/tools/src/select.rs b/crates/tools/src/select.rs index 4e3f2c16f9..1d7bd558e0 100644 --- a/crates/tools/src/select.rs +++ b/crates/tools/src/select.rs @@ -1552,7 +1552,7 @@ impl Tool for SelectionTool { // take the pointer too (on a thin box the centre lies within a handle's reach), and with // Cmd/Ctrl held the press selects the object behind instead. if near_selected && !m.cmd && hit_center(cx, p, cx.point_tol()).is_some() { - return Cursor::Move; + return Cursor::SelectionMove; } // View → Snap to Point: over an anchor a press would grab the object by, the arrow turns // hollow. @@ -1560,11 +1560,11 @@ impl Tool for SelectionTool { return Cursor::ArrowHollow; } if selected_source_hit(cx, p).is_some() { - return Cursor::Move; + return Cursor::SelectionMove; } if let Some(h) = hit_test(cx.doc, p, cx.selection_hit_options()) { if selected_under(cx, &h, h.top_object(cx.isolation)).is_some() || m.alt { - return Cursor::Move; + return Cursor::SelectionMove; } return Cursor::Arrow; } diff --git a/crates/tools/src/select/tests.rs b/crates/tools/src/select/tests.rs index 45bc30b47e..0ebda2c719 100644 --- a/crates/tools/src/select/tests.rs +++ b/crates/tools/src/select/tests.rs @@ -17,7 +17,7 @@ fn a_press_on_a_selected_shaper_source_moves_it_while_a_mask_is_edited() { let c = ToolContext { isolation: Some(layer), ..cx(&d, &s, &p) }; for x in [75.0, 125.0] { let mut t = SelectionTool::default(); - assert_eq!(t.cursor(&c, Point::new(x, 350.0), Mods::default()), Cursor::Move, "at {x}"); + assert_eq!(t.cursor(&c, Point::new(x, 350.0), Mods::default()), Cursor::SelectionMove, "at {x}"); let down = t.pointer(&c, &ev(PointerKind::Down, x, 350.0)); assert!(!down.iter().any(|a| matches!(a, Action::Exec(c, _) if c == "select.set")), "at {x}: {down:?}"); let drag = t.pointer(&c, &ev(PointerKind::Drag, x + 20.0, 350.0)); @@ -45,7 +45,7 @@ fn a_selected_shaper_source_moves_after_other_objects_and_behind_front_art() { s.set([rect, ids[1]]); let c = ToolContext { isolation: Some(layer), ..cx(&d, &s, &p) }; let mut t = SelectionTool::default(); - assert_eq!(t.cursor(&c, Point::new(125.0, 350.0), Mods::default()), Cursor::Move); + assert_eq!(t.cursor(&c, Point::new(125.0, 350.0), Mods::default()), Cursor::SelectionMove); let down = t.pointer(&c, &ev(PointerKind::Down, 125.0, 350.0)); assert!(!down.iter().any(|a| matches!(a, Action::Exec(c, _) if c == "select.set")), "{down:?}"); let drag = t.pointer(&c, &ev(PointerKind::Drag, 145.0, 350.0)); @@ -55,7 +55,7 @@ fn a_selected_shaper_source_moves_after_other_objects_and_behind_front_art() { d.insert(Some(layer), 2, Node::path(front, square, Appearance::default_art())).unwrap(); s.set([ids[1]]); let c = ToolContext { isolation: Some(layer), ..cx(&d, &s, &p) }; - assert_ne!(SelectionTool::default().cursor(&c, Point::new(125.0, 350.0), Mods::default()), Cursor::Move); + assert_ne!(SelectionTool::default().cursor(&c, Point::new(125.0, 350.0), Mods::default()), Cursor::SelectionMove); let down = SelectionTool::default().pointer(&c, &ev(PointerKind::Down, 125.0, 350.0)); assert!(down.iter().any(|a| matches!(a, Action::Exec(c, v) if c == "select.set" && v["ids"] == json!([front.0]))), "{down:?}"); } @@ -1042,7 +1042,7 @@ fn hidden_box_handles_take_no_press_while_anchors_are_selected() { s.anchors.entry(id).or_default().insert((0, 1)); let c = cx(&d, &s, &p); let mut t = SelectionTool::default(); - assert_eq!(t.cursor(&c, top_middle, Mods::default()), Cursor::Move); + assert_eq!(t.cursor(&c, top_middle, Mods::default()), Cursor::SelectionMove); let down = t.pointer(&c, &ev(PointerKind::Down, 150.0, 100.0)); assert!(!down.contains(&Action::Begin("Scale".into())), "{down:?}"); assert!(!crate::select::bbox_handle_at(&c, top_middle)); @@ -3006,9 +3006,9 @@ fn a_press_on_the_centre_point_moves_an_unfilled_shape() { let c = ToolContext { path_only: true, ..cx(&d, &s, &p) }; let centre = Point::new(150.0, 150.0); let mut t = SelectionTool::default(); - assert_eq!(t.cursor(&c, centre, Mods::default()), Cursor::Move); + assert_eq!(t.cursor(&c, centre, Mods::default()), Cursor::SelectionMove); // Cmd/Ctrl selects the object behind, not the centre point, so the pointer says neither. - assert_ne!(t.cursor(&c, centre, Mods { cmd: true, ..Mods::default() }), Cursor::Move); + assert_ne!(t.cursor(&c, centre, Mods { cmd: true, ..Mods::default() }), Cursor::SelectionMove); assert!(t.pointer(&c, &ev(PointerKind::Down, centre.x, centre.y)).is_empty()); let a = t.pointer(&c, &ev(PointerKind::Drag, 170.0, 160.0)); assert_eq!(a.first(), Some(&Action::Begin("Move".into())), "{a:?}"); @@ -3102,7 +3102,7 @@ fn a_ruler_guide_under_the_centre_point_keeps_the_pointer() { assert!(hit_center(&c, centre, c.point_tol()).is_some()); let mut t = SelectionTool::default(); let cursor = t.cursor(&c, centre, Mods::default()); - assert_ne!(cursor, Cursor::Move, "the guide's cursor, not the move arrow"); + assert_ne!(cursor, Cursor::SelectionMove, "the guide's cursor, not the move arrow"); let down = t.pointer(&c, &ev(PointerKind::Down, centre.x, centre.y)); let drag = t.pointer(&c, &ev(PointerKind::Drag, 170.0, 150.0)); assert!(drag.iter().any(|a| matches!(a, Action::Preview(cmd, _) if cmd == "guide.move")), "the guide drags: {down:?} {drag:?}"); @@ -3177,7 +3177,7 @@ fn a_press_on_a_selected_member_of_a_group_moves_the_selected_members() { s.set(picked.iter().copied()); let c = cx(&d, &s, &p); let mut t = SelectionTool::default(); - assert_eq!(t.cursor(&c, Point::new(125.0, 125.0), Mods::default()), Cursor::Move, "{picked:?}"); + assert_eq!(t.cursor(&c, Point::new(125.0, 125.0), Mods::default()), Cursor::SelectionMove, "{picked:?}"); let down = t.pointer(&c, &ev(PointerKind::Down, 125.0, 125.0)); assert!(!is_select(&down), "{picked:?}: {down:?}"); let drag = t.pointer(&c, &ev(PointerKind::Drag, 145.0, 125.0)); @@ -3218,7 +3218,7 @@ fn a_press_on_a_selected_member_of_a_group_moves_the_selected_members() { s.anchors.insert(a, [(0, 0), (0, 1), (0, 2), (0, 3)].into_iter().collect()); let c = cx(&d, &s, &p); let mut t = SelectionTool::default(); - assert_eq!(t.cursor(&c, Point::new(125.0, 125.0), Mods::default()), Cursor::Move, "every anchor"); + assert_eq!(t.cursor(&c, Point::new(125.0, 125.0), Mods::default()), Cursor::SelectionMove, "every anchor"); let down = t.pointer(&c, &ev(PointerKind::Down, 125.0, 125.0)); assert!(!is_select(&down), "every anchor: {down:?}"); } diff --git a/crates/ui-egui/src/canvas/artboards.rs b/crates/ui-egui/src/canvas/artboards.rs index 605e7108d2..a6181ea805 100644 --- a/crates/ui-egui/src/canvas/artboards.rs +++ b/crates/ui-egui/src/canvas/artboards.rs @@ -31,7 +31,7 @@ pub(super) fn checker_of(setup: &vectorcraft_doc::DocSetup) -> Checker { } /// The page frames of document `st` seen through `view`: one per artboard, named "01 - name" with the -/// Artboard tool or several boards, filled with its paper or the transparency grid (nothing in Outline). +/// Artboard tool or several boards, filled with its paper or the transparency grid (white in Outline). /// Empty while the artboards are hidden. pub(super) fn frames(app: &VectorcraftApp, st: &vectorcraft_engine::DocState, view: &View, outline: bool) -> Vec { if !shows_artboards(app) { @@ -51,7 +51,7 @@ pub(super) fn frames(app: &VectorcraftApp, st: &vectorcraft_engine::DocState, vi frame = frame.name(format!("{:02} - {}", i + 1, ab.name)); } if outline { - frame + frame.fill(DataColor::new(Color32::WHITE)) } else if grid { frame.checker(checker_of(setup)) } else { diff --git a/crates/ui-egui/src/canvas/artboards/tests.rs b/crates/ui-egui/src/canvas/artboards/tests.rs index 742e798e63..662f46db4a 100644 --- a/crates/ui-egui/src/canvas/artboards/tests.rs +++ b/crates/ui-egui/src/canvas/artboards/tests.rs @@ -47,13 +47,13 @@ fn shift_clicking_a_name_toggles_selection_and_a_plain_click_activates() { } #[test] -fn outline_has_a_white_canvas_line_edges_and_no_paper() { +fn outline_has_white_artboards_on_a_white_canvas_with_line_edges() { let _view = crate::testing::DefaultProofView::new(); let app = app_with(2); let st = app.session.active().unwrap(); assert_eq!(pasteboard_color(&app, st, true), PasteboardColor::Custom(DataColor::new(Color32::WHITE))); assert_eq!(border(true), PageBorder::Line); - assert!(frames_of(&app, true).iter().all(|f| f.fill.is_none())); + assert!(frames_of(&app, true).iter().all(|f| f.fill == Some(PageFill::Color(DataColor::new(Color32::WHITE))))); assert_eq!(pasteboard_color(&app, st, false), PasteboardColor::Default); assert_eq!(border(false), PageBorder::DropShadow); assert!(frames_of(&app, false).iter().all(|f| f.fill.is_some())); diff --git a/crates/ui-egui/src/cursors.rs b/crates/ui-egui/src/cursors.rs index 2f9c594ab7..e97016dff1 100644 --- a/crates/ui-egui/src/cursors.rs +++ b/crates/ui-egui/src/cursors.rs @@ -89,6 +89,7 @@ pub fn tool_cursor(c: Cursor) -> cb::Cursor { Cursor::DirectAnchorSelected => tool("cursor-direct-anchor-selected", TIP, None), Cursor::ReshapeSegment => tool("cursor-reshape-segment", TIP, None), Cursor::GroupSelection => badged(CursorBadge::Add), + Cursor::SelectionMove => badged(CursorBadge::Move), Cursor::SelectionCopy => badged(CursorBadge::Copy), Cursor::Move => system(CursorIcon::Move), Cursor::Crosshair => PaintedCursor::Crosshair.into(), @@ -207,6 +208,7 @@ const GLYPHS: [Cursor; 99] = [ Cursor::ReshapeSegment, Cursor::GroupSelection, Cursor::SelectionCopy, + Cursor::SelectionMove, Cursor::Move, Cursor::Crosshair, Cursor::ResizeH, From b06d1d9af3ca832f61ce4ca65bae5e838442da76 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 13:59:34 +0100 Subject: [PATCH 088/105] Preview plug-in parameter edits from the visible dialog controls --- crates/ui-egui/src/app.rs | 6 ++++++ crates/ui-egui/src/dialogs/plugin.rs | 18 ++++++++++++++---- crates/ui-egui/src/tests/plugins.rs | 22 +++++++++++++++++++++- 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 8ddfe99310..65b6916d55 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -717,7 +717,13 @@ impl VectorcraftApp { export_progress::show(self, ui); // After every window this pass may open, and before the palette's field takes the keyboard. panel_docking::close_overlays_for_modal(self, &ctx); + let drawn_document = self.session.active().map(|st| (st.uid, st.revision)); dialogs::host::pump(self, &ctx); + // The canvas has already painted. A dialog can apply or roll back its preview + // on the final input frame, with no further mouse movement to wake the window. + if self.session.active().map(|st| (st.uid, st.revision)) != drawn_document { + ctx.request_repaint(); + } prefs_dialog::show(self, ui); crate::shortcut_editor::show(self, ui); credits::open_taken_link(self); diff --git a/crates/ui-egui/src/dialogs/plugin.rs b/crates/ui-egui/src/dialogs/plugin.rs index 8b6606e068..d7fb438d2c 100644 --- a/crates/ui-egui/src/dialogs/plugin.rs +++ b/crates/ui-egui/src/dialogs/plugin.rs @@ -42,7 +42,7 @@ use std::sync::Arc; use std::sync::atomic::{AtomicU64, Ordering}; use craft::menu::Node; -use craft::ui::contract::Show as _; +use craft::ui::contract::{Bind, Show as _}; use craft::ui::dialog::{DialogId, DialogResult, DialogStack, Prompt, StackDialog, dialog_id}; use craft::ui::display::{Shade, Text}; use craft::ui::patterns::form_dialogs::{DialogFields, HostedParamDialog, Param, ParamDialog}; @@ -548,7 +548,13 @@ pub(super) fn heading(plugin: &str, command: Option<&str>, gone: &str) -> String /// The builder of a hosted plug-in dialog over its values: the rows of `all` whose parameter is /// shown for the values (`m.visible`), after the description. The rows are made again in the UI /// language when it changes while the dialog is open; the field values stay as they are. -fn build(key: &'static str, m: Manifest, all: Arc<[Param]>, look: Look) -> impl for<'b> Fn(&'b mut DialogFields) -> ParamDialog<'b> + Send + 'static { +fn build( + key: &'static str, + m: Manifest, + all: Arc<[Param]>, + look: Look, + canvas: Option, +) -> impl for<'b> Fn(&'b mut DialogFields) -> ParamDialog<'b> + Send + 'static { let rows_in = std::sync::Mutex::new((lang(), all)); move |fields| { let all = { @@ -564,7 +570,10 @@ fn build(key: &'static str, m: Manifest, all: Arc<[Param]>, look: Look) -> impl rows.push(Param::read_only_text("description", "", look.description.clone()).full_width()); } rows.extend(all.iter().filter(|p| shown.contains(p.key.as_str())).cloned()); - let mut dialog = ParamDialog::new(key, look.heading(), Cow::Owned(rows)).previews(look.previews); + let mut dialog = ParamDialog::new(key, look.heading(), Cow::Owned(rows)).previews(look.previews).values(Bind::bound(fields)); + if let Some(canvas) = canvas.filter(|_| look.previews) { + dialog = dialog.canvas(canvas); + } if let Some(ok) = look.ok { dialog = dialog.ok_label(ok.into()); } @@ -592,7 +601,8 @@ fn open_hosted( close_open(app); let all: Arc<[Param]> = form::plugin_params(&m, &values).into(); let fields = form::fields_of(&all, &values); - let dialog = HostedParamDialog::new(&ctx, key, fields, build(key, m, Arc::clone(&all), look)).instance(instance.to_string()); + let canvas = crate::doc_windows::current(app).map(crate::canvas::canvas_id); + let dialog = HostedParamDialog::new(&ctx, key, fields, build(key, m, Arc::clone(&all), look, canvas)).instance(instance.to_string()); let id = dialogs.with(|host| host.open(dialog)); Ok((id, all)) } diff --git a/crates/ui-egui/src/tests/plugins.rs b/crates/ui-egui/src/tests/plugins.rs index ff7c9e71ee..c2a72c626d 100644 --- a/crates/ui-egui/src/tests/plugins.rs +++ b/crates/ui-egui/src/tests/plugins.rs @@ -181,7 +181,9 @@ fn plugins_are_listed_in_the_object_and_effect_menus() { #[test] fn filter_dialog_previews_and_commits_one_undo_step() { - let mut h = window(app()); + let mut app = app(); + app.canvas.worker_started = true; // Canvas uploads finish within the frame being asserted. + let mut h = window(app); h.state_mut().run("plugin.install", json!({"dataBase64": vectorcraft_format::base64_encode(DESATURATE)})).unwrap(); let id = red_rect(h.state_mut()); let undo = h.state().session.doc().unwrap().history.undo.len(); @@ -189,12 +191,30 @@ fn filter_dialog_previews_and_commits_one_undo_step() { step(&mut h); assert!(top(h.state()).is_some(), "dialog open"); assert_eq!(fields(h.state())["amount"], json!(100.0)); + // A click in the visible slider must reach the same values the live preview reads. + use egui_kittest::kittest::Queryable as _; + let at = h.get_by_role(egui::accesskit::Role::Dialog).get_by_role(egui::accesskit::Role::Slider).rect().center(); + h.input_mut().events.push(egui::Event::PointerMoved(at)); + for pressed in [true, false] { + h.input_mut().events.push(egui::Event::PointerButton { + pos: at, + button: egui::PointerButton::Primary, + pressed, + modifiers: Default::default(), + }); + step(&mut h); + } + assert!(fields(h.state())["amount"].as_f64().is_some_and(|amount| amount > 0.0 && amount < 100.0)); // Agents set fields like `ui.dialog.set` does; the frame previews them. set_field(&mut h, "amount", json!(50)).unwrap(); step(&mut h); assert!(h.state().session.in_interaction(), "previewing"); let [r, g, _] = fill_rgb(h.state(), id); assert!(r < 1.0 && g > 0.0, "half desaturated on the canvas: {r} {g}"); + step(&mut h); + let (shown, _) = h.state().canvas.shown.as_ref().expect("a rendered canvas frame"); + let shown_fill = shown.node(id).unwrap().appearance.fill_paint().color().unwrap().to_rgb_uncalibrated(); + assert_eq!(shown_fill, fill_rgb(h.state(), id), "the canvas showed the preview before OK"); answer(&mut h, true); assert!(top(h.state()).is_none()); let st = h.state().session.doc().unwrap(); From 7c8d4ea5a78faac1cdbfc51d51248d5b9693fe5a Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 14:08:52 +0100 Subject: [PATCH 089/105] Keep large PDF previews and confirmed page imports off the desktop UI thread --- crates/ui-egui/src/dialogs/import_pdf.rs | 69 ++++++++++++++++--- .../ui-egui/src/dialogs/tests_import_pdf.rs | 14 ++++ 2 files changed, 74 insertions(+), 9 deletions(-) diff --git a/crates/ui-egui/src/dialogs/import_pdf.rs b/crates/ui-egui/src/dialogs/import_pdf.rs index f539897c25..8bf7e37874 100644 --- a/crates/ui-egui/src/dialogs/import_pdf.rs +++ b/crates/ui-egui/src/dialogs/import_pdf.rs @@ -114,11 +114,19 @@ pub(super) fn render_preview( app: &mut VectorcraftApp, ctx: &egui::Context, doc: &vectorcraft_engine::doc::Document, +) -> Option> { + render_page_preview(&mut app.canvas.renderer, ctx.pixels_per_point(), doc) +} + +fn render_page_preview( + renderer: &mut vectorcraft_render::Renderer, + pixels_per_point: f32, + doc: &vectorcraft_engine::doc::Document, ) -> Option> { let region = doc.artboards.first()?.rect; - let px = PREVIEW_PX * ctx.pixels_per_point() as f64; + let px = PREVIEW_PX * pixels_per_point as f64; let scale = px / region.width().max(region.height()).max(1.0); - let img = app.canvas.renderer.render_region(doc, region, scale, true); + let img = renderer.render_region(doc, region, scale, true); Some(Arc::new(crate::canvas::color_image(&img))) } @@ -286,6 +294,8 @@ pub(super) struct ImportPdfDialog { /// The preview shown for a (page, crop, text) revision; `None` for a page that could not be read, which is /// not asked for again. preview: Option<(Revision, Option>)>, + /// One preview at a time. Page changes coalesce while the worker finishes. + pending_preview: Option<(Revision, std::sync::mpsc::Receiver>>)>, /// Why the last password did not open the file. password_error: Option, /// The OK the pump has not answered. @@ -294,7 +304,7 @@ pub(super) struct ImportPdfDialog { impl ImportPdfDialog { fn new(s: State) -> Self { - ImportPdfDialog { id: dialog_id(KIND), s, preview: None, password_error: None, held: HeldAnswer::new() } + ImportPdfDialog { id: dialog_id(KIND), s, preview: None, pending_preview: None, password_error: None, held: HeldAnswer::new() } } /// The preview to render next: the revision of the shown page, crop and text, when the stored one differs. @@ -700,7 +710,14 @@ fn confirm(app: &mut VectorcraftApp, s: &State) -> Result<(), String> { if s.links_on() { p["linkPages"] = json!(true); } - io::open_document(app, &s.name, &s.file.bytes, s.path.clone(), &p).map(|_| ()) + if crate::opening::available() + && let Some(path) = s.path.as_deref() + { + crate::opening::start_with(app, path, s.file.bytes.clone(), p); + Ok(()) + } else { + io::open_document(app, &s.name, &s.file.bytes, s.path.clone(), &p).map(|_| ()) + } }; // Asked only for the password, the dialog showed no Text choice to keep; the choice for a `.ai` // or `.ait` file is not kept for PDFs. @@ -711,10 +728,10 @@ fn confirm(app: &mut VectorcraftApp, s: &State) -> Result<(), String> { } /// The preview of the page and boxes `s` shows; `None` for a page that can't be read. -fn preview_image(app: &mut VectorcraftApp, ctx: &egui::Context, s: &State) -> Option> { +fn preview_image(renderer: &mut vectorcraft_render::Renderer, pixels_per_point: f32, s: &State) -> Option> { let opts = fileio::LoadOptions { crop: s.crop, password: s.password(), text_as: s.preview_text_as(), ..Default::default() }; let (doc, _) = fileio::page_document(&s.file.bytes, s.page().saturating_sub(1), &opts).ok()?; - render_preview(app, ctx, &doc) + render_page_preview(renderer, pixels_per_point, &doc) } /// The host pump: judges the OK the dialog holds (opening or placing the file; a refusal keeps the dialog open with @@ -730,10 +747,44 @@ pub(crate) fn pump(app: &mut VectorcraftApp, ctx: &egui::Context) { dialog.answer_ok(answer); } }); + return; } - let wanted = dialogs.with(|host| host.get::().and_then(|d| Some((d.wanted_preview()?, d.s.clone())))); - if let Some((revision, s)) = wanted { - let image = preview_image(app, ctx, &s); + let wanted = dialogs.with(|host| { + let dialog = host.get_mut::()?; + if let Some((revision, pending)) = &dialog.pending_preview { + let image = match pending.try_recv() { + Ok(image) => image, + Err(std::sync::mpsc::TryRecvError::Disconnected) => None, + Err(std::sync::mpsc::TryRecvError::Empty) => return None, + }; + if dialog.wanted_preview() == Some(*revision) { + dialog.set_preview(*revision, image); + } + dialog.pending_preview = None; + } + Some((dialog.wanted_preview()?, dialog.s.clone())) + }); + let Some((revision, state)) = wanted else { return }; + let pixels_per_point = ctx.pixels_per_point(); + if crate::opening::available() { + let (sender, pending) = std::sync::mpsc::channel(); + dialogs.with(|host| { + if let Some(dialog) = host.get_mut::() { + dialog.pending_preview = Some((revision, pending)); + } + }); + let wake = ctx.clone(); + let scope = vectorcraft_engine::file_access::ScopeHandle::capture(); + app.jobs().spawn( + "vectorcraft-pdf-preview", + Box::new(move || { + let image = scope.run(|| preview_image(&mut vectorcraft_render::Renderer::new(), pixels_per_point, &state)); + let _ = sender.send(image); + wake.request_repaint(); + }), + ); + } else { + let image = preview_image(&mut app.canvas.renderer, pixels_per_point, &state); dialogs.with(|host| { if let Some(dialog) = host.get_mut::() { dialog.set_preview(revision, image); diff --git a/crates/ui-egui/src/dialogs/tests_import_pdf.rs b/crates/ui-egui/src/dialogs/tests_import_pdf.rs index 3b96687a49..c9383d0f44 100644 --- a/crates/ui-egui/src/dialogs/tests_import_pdf.rs +++ b/crates/ui-egui/src/dialogs/tests_import_pdf.rs @@ -117,6 +117,20 @@ fn pdf_page_footer_ok_opens_the_chosen_range() { assert_eq!(artboard_widths(h.state()), [200.0, 300.0]); } +#[test] +fn confirming_a_desktop_pdf_import_queues_the_read_and_closes_the_dialog() { + crate::opening::tests::with_threads(|| { + let mut app = app(); + io::open_bytes(&mut app, "three.pdf", &three_pages(), Some("three.pdf".into())).unwrap(); + set(&mut app, "allPages", json!(false)); + set(&mut app, "range", json!("2-3")); + confirm(&mut app).unwrap(); + assert!(!is_open(&app)); + assert_eq!(app.opening.pending.len(), 1); + assert_eq!(app.opening.pending[0].path, "three.pdf"); + }); +} + #[test] fn opening_a_multi_page_pdf_asks_for_the_pages() { let mut app = app(); From 3575fa6d2b4ecd77d8337169a9b6cd51c51ff280 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 14:18:14 +0100 Subject: [PATCH 090/105] Leave the artwork visible while previewing a transform --- crates/ui-egui/src/dialogs/transform.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/ui-egui/src/dialogs/transform.rs b/crates/ui-egui/src/dialogs/transform.rs index 7437183918..d0618d050a 100644 --- a/crates/ui-egui/src/dialogs/transform.rs +++ b/crates/ui-egui/src/dialogs/transform.rs @@ -150,11 +150,16 @@ pub(crate) fn open(app: &mut VectorcraftApp, kind: Kind, tool: &Value) { let document = app.session.active().map(|doc| (doc.uid, doc.reverts)); let rows = rows(app, kind, &opening); let fields = fields_of(&rows, &opening); + let canvas = crate::doc_windows::current(app).map(crate::canvas::canvas_id); let dialog = HostedParamDialog::new(&ctx, kind.command(), fields, move |f| { if kind == Kind::Move { link_distance_and_angle(f); } let dialog = ParamDialog::new(kind.command(), kind.title(), rows.clone()).previews(true).values(Bind::bound(f)); + let dialog = match canvas { + Some(canvas) => dialog.canvas(canvas), + None => dialog, + }; if kind == Kind::Move { dialog.remember(MOVE_KEY) } else { dialog } }); // A dialog this one replaces leaves its preview behind otherwise. From e7a2662ee1e1c85f5b3b7695f8c401fcbf6d6a51 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 14:21:56 +0100 Subject: [PATCH 091/105] Count the selected-art pointer in the cursor catalog --- crates/ui-egui/src/cursors.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/cursors.rs b/crates/ui-egui/src/cursors.rs index e97016dff1..6af53f1028 100644 --- a/crates/ui-egui/src/cursors.rs +++ b/crates/ui-egui/src/cursors.rs @@ -71,7 +71,7 @@ fn badged(badge: CursorBadge) -> cb::Cursor { PaintedCursor::badged(CursorIcon::Default, badge).into() } -/// The rotate pointer beside a box, at `octant` from the box's centre (0 up, clockwise in 45° steps). +/// The rotate pointer beside a box, at `octant` from the box's centre (0 up, clockwise in 45° steps). /// Its arc bends round the corner it is at, so it opens toward the centre: opposite the octant. fn turn_toward(octant: u8) -> cb::Cursor { let angle = f32::from(octant % 8) * std::f32::consts::FRAC_PI_4; @@ -196,7 +196,7 @@ pub(crate) fn request_busy(app: &crate::VectorcraftApp, ctx: &egui::Context) { /// Every cursor with a look: its own, or the one it borrows. #[cfg(test)] -const GLYPHS: [Cursor; 99] = [ +const GLYPHS: [Cursor; 100] = [ Cursor::Hand, Cursor::HandGrab, Cursor::ZoomIn, From 42187cdbdf45d9d5bc7a75a554964e9b0611dda6 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 14:22:21 +0100 Subject: [PATCH 092/105] Exercise playback using the active source artboard at copy time --- crates/ui-egui/src/panels/actions/tests_playback.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/ui-egui/src/panels/actions/tests_playback.rs b/crates/ui-egui/src/panels/actions/tests_playback.rs index f566eb22fc..d81c005ef1 100644 --- a/crates/ui-egui/src/panels/actions/tests_playback.rs +++ b/crates/ui-egui/src/panels/actions/tests_playback.rs @@ -89,7 +89,9 @@ fn actions_play_on_the_artboard_active_when_they_play() { app.ui.actions.push(Action { set, ..Action::new(name, steps) }).unwrap(); set_actions(app, 0).len() - 1 }; + app.view_mut().unwrap().artboard = 1; app.run("edit.copy", json!({})).unwrap(); + app.view_mut().unwrap().artboard = 0; let align = record(&mut app, "Align Left", "object.align", json!({"horizontal": "left", "to": "artboard"})); assert_eq!(bounds(&app, &[rect]).x0, boards[0].x0, "aligned to artboard 0 while recording"); let paste = record(&mut app, "Paste in Place", "edit.pasteInPlace", json!({})); From 0e9b1e8dd162852519d6c4a30fa41aa118fd8eba Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 14:28:10 +0100 Subject: [PATCH 093/105] Preserve the degree symbol in the cursor documentation --- crates/ui-egui/src/cursors.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/cursors.rs b/crates/ui-egui/src/cursors.rs index 6af53f1028..b120d35c4a 100644 --- a/crates/ui-egui/src/cursors.rs +++ b/crates/ui-egui/src/cursors.rs @@ -71,7 +71,7 @@ fn badged(badge: CursorBadge) -> cb::Cursor { PaintedCursor::badged(CursorIcon::Default, badge).into() } -/// The rotate pointer beside a box, at `octant` from the box's centre (0 up, clockwise in 45° steps). +/// The rotate pointer beside a box, at `octant` from the box's centre (0 up, clockwise in 45° steps). /// Its arc bends round the corner it is at, so it opens toward the centre: opposite the octant. fn turn_toward(octant: u8) -> cb::Cursor { let angle = f32::from(octant % 8) * std::f32::consts::FRAC_PI_4; From 3fe7b276016f6b31f7d13923e4477f2385e55817 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 14:38:21 +0100 Subject: [PATCH 094/105] Wait for the plug-in dialog to settle before clicking its slider --- crates/ui-egui/src/tests/plugins.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/tests/plugins.rs b/crates/ui-egui/src/tests/plugins.rs index c2a72c626d..6dc9853a2a 100644 --- a/crates/ui-egui/src/tests/plugins.rs +++ b/crates/ui-egui/src/tests/plugins.rs @@ -193,8 +193,13 @@ fn filter_dialog_previews_and_commits_one_undo_step() { assert_eq!(fields(h.state())["amount"], json!(100.0)); // A click in the visible slider must reach the same values the live preview reads. use egui_kittest::kittest::Queryable as _; + // Let the modal finish its opening placement before reading a widget's screen bounds. + for _ in 0..3 { + step(&mut h); + } let at = h.get_by_role(egui::accesskit::Role::Dialog).get_by_role(egui::accesskit::Role::Slider).rect().center(); h.input_mut().events.push(egui::Event::PointerMoved(at)); + step(&mut h); for pressed in [true, false] { h.input_mut().events.push(egui::Event::PointerButton { pos: at, @@ -204,7 +209,8 @@ fn filter_dialog_previews_and_commits_one_undo_step() { }); step(&mut h); } - assert!(fields(h.state())["amount"].as_f64().is_some_and(|amount| amount > 0.0 && amount < 100.0)); + let clicked = fields(h.state()); + assert!(clicked["amount"].as_f64().is_some_and(|amount| amount > 0.0 && amount < 100.0), "slider at {at:?}: {clicked}"); // Agents set fields like `ui.dialog.set` does; the frame previews them. set_field(&mut h, "amount", json!(50)).unwrap(); step(&mut h); From 99a5b6cdc4215109818dee527577c63d8a838533 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 14:54:47 +0100 Subject: [PATCH 095/105] Describe the selected-art pointer in the cursor reference --- crates/tools/src/cursors.toml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/tools/src/cursors.toml b/crates/tools/src/cursors.toml index 0b19e3e4c0..fd528eaeef 100644 --- a/crates/tools/src/cursors.toml +++ b/crates/tools/src/cursors.toml @@ -129,11 +129,20 @@ shown_when = [ hotspot = "The arrow's tip." look = "Arrow with a small x badge (nothing to select)." +[[cursor]] +id = "SelectionMove" +group = "Selection" +shown_when = [ + "The Selection tool over a selected object, its movable source artwork, or its visible centre point.", + "The Selection tool over artwork while Alt is held, before the copy drag begins.", +] +hotspot = "The arrow's tip." +look = "The Selection arrow with a small move badge." + [[cursor]] id = "Move" group = "Selection" shown_when = [ - "The Selection tool over a selected object, or over any object with Alt held (once an Alt-drag starts, SelectionCopy shows).", "The shape tools over a selected object's centre point (Attributes › Show Center), before a press there moves it (while the drag runs the arrow is plain, SelectionCopy with Alt, ArrowHollow while it snaps).", "Reshape over a path or while dragging.", "Inside the Free Transform and Crop Image boxes.", From 98026915ab97e38ce28c7eb8c3afca0c5cfe67ee Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 15:26:38 +0100 Subject: [PATCH 096/105] Check the Selection move pointer over source art and document the centre-point modifier --- crates/engine/src/tests/select_effects.rs | 2 +- crates/tools/src/cursors.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/tests/select_effects.rs b/crates/engine/src/tests/select_effects.rs index 055711cb43..07feda9d7c 100644 --- a/crates/engine/src/tests/select_effects.rs +++ b/crates/engine/src/tests/select_effects.rs @@ -235,7 +235,7 @@ fn shift_click_direct_selection_and_hover_on_a_drop_shadow_pass_through_it() { run(&mut s, "select.set", json!({"ids": [a.0]})); let v = ViewInfo::default(); s.select_tool("selection", v).unwrap(); - assert_eq!(s.cursor(Point::new(50.0, 50.0), Mods::default(), v), Cursor::Move); + assert_eq!(s.cursor(Point::new(50.0, 50.0), Mods::default(), v), Cursor::SelectionMove); assert_eq!(s.cursor(Point::new(110.0, 50.0), Mods::default(), v), Cursor::Arrow); assert_eq!(s.cursor(Point::new(92.0, 50.0), Mods::default(), v), Cursor::Arrow); } diff --git a/crates/tools/src/cursors.toml b/crates/tools/src/cursors.toml index fd528eaeef..5528b7cd97 100644 --- a/crates/tools/src/cursors.toml +++ b/crates/tools/src/cursors.toml @@ -133,7 +133,7 @@ look = "Arrow with a small x badge (nothing to select)." id = "SelectionMove" group = "Selection" shown_when = [ - "The Selection tool over a selected object, its movable source artwork, or its visible centre point.", + "The Selection tool over a selected object or its movable source artwork, or over its visible centre point without Cmd/Ctrl held.", "The Selection tool over artwork while Alt is held, before the copy drag begins.", ] hotspot = "The arrow's tip." From a6c530518a3d8acdbb4496075cd3b75e0995a47d Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 15:35:56 +0100 Subject: [PATCH 097/105] Scroll overflowing panel forms inside their dock group --- crates/ui-egui/src/dock.rs | 12 +++++++++++- crates/ui-egui/src/panels/pattern_options.rs | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/dock.rs b/crates/ui-egui/src/dock.rs index fdaaebcee1..6a70094ac2 100644 --- a/crates/ui-egui/src/dock.rs +++ b/crates/ui-egui/src/dock.rs @@ -1,6 +1,8 @@ //! Panel bodies: what the dock area ([`crate::panel_docking`]) draws inside a docked, floating or //! flyout panel. +use craft::ui::contract::{Props as _, Scroll, ShowContainer as _}; +use craft::ui::layout_components::Stack; use egui::Ui; use crate::state::DockTab; @@ -13,6 +15,14 @@ pub(crate) fn panel_body(app: &mut VectorcraftApp, ui: &mut Ui, id: &str) { Some(DockTab::Properties) => panels::properties::show(app, ui), Some(DockTab::Layers) => panels::layers::show(app, ui), Some(DockTab::Libraries) => panels::libraries(app, ui), - None => panels::show_icon_panel(app, ui, id), + None => { + // The dock clips the group at its assigned height. Keep the panel's own collection + // viewport bounded while allowing a form that exceeds that height to scroll. + let height = ui.available_height(); + Stack::new().id_salt(id).fill().scroll(Scroll::vertical()).show(ui, |ui, _| { + ui.set_max_height(height); + panels::show_icon_panel(app, ui, id); + }); + } } } diff --git a/crates/ui-egui/src/panels/pattern_options.rs b/crates/ui-egui/src/panels/pattern_options.rs index 93e93681f2..0bd03fac9c 100644 --- a/crates/ui-egui/src/panels/pattern_options.rs +++ b/crates/ui-egui/src/panels/pattern_options.rs @@ -267,6 +267,26 @@ mod tests { Panel::new(app, show) } + #[test] + fn scrolling_a_short_docked_form_reaches_its_last_action() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 200, "height": 200})).unwrap(); + app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap(); + app.run("object.pattern.make", json!({"name": "Dots"})).unwrap(); + let mut panel = Panel::new(app, |app, ui| crate::dock::panel_body(app, ui, "patternOptions")); + panel.room(egui::vec2(300.0, 200.0)); + panel.frame(); + panel.frame(); + assert!(!panel.in_view("Done")); + for _ in 0..20 { + panel.scroll_at(egui::pos2(150.0, 100.0), -120.0); + panel.frame(); + } + assert!(panel.in_view("Done")); + panel.click("Done"); + assert!(editing(&panel.app()).is_none()); + } + /// Shift+Enter in the Name field renames the pattern and keeps the field active; Enter then /// renames it again and ends the editing. #[test] From d69f9c041c09bfc43d3121ba2b8c0dfb2bcfc6a3 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 16:07:02 +0100 Subject: [PATCH 098/105] Keep collection panels and their fixed footers in their own viewport --- crates/ui-egui/src/dock.rs | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/crates/ui-egui/src/dock.rs b/crates/ui-egui/src/dock.rs index 6a70094ac2..dcff2191a4 100644 --- a/crates/ui-egui/src/dock.rs +++ b/crates/ui-egui/src/dock.rs @@ -15,14 +15,28 @@ pub(crate) fn panel_body(app: &mut VectorcraftApp, ui: &mut Ui, id: &str) { Some(DockTab::Properties) => panels::properties::show(app, ui), Some(DockTab::Layers) => panels::layers::show(app, ui), Some(DockTab::Libraries) => panels::libraries(app, ui), - None => { - // The dock clips the group at its assigned height. Keep the panel's own collection - // viewport bounded while allowing a form that exceeds that height to scroll. - let height = ui.available_height(); - Stack::new().id_salt(id).fill().scroll(Scroll::vertical()).show(ui, |ui, _| { - ui.set_max_height(height); - panels::show_icon_panel(app, ui, id); - }); + None if matches!( + id, + "align" + | "attributes" + | "blend" + | "character" + | "color" + | "magicWand" + | "openType" + | "paragraph" + | "pathfinder" + | "patternOptions" + | "stroke" + | "tabs" + | "transform" + | "transparency" + ) => + { + // These panels lay out forms. Collection panels own their scrolling viewport + // and reserve their own footer outside it. + Stack::new().id_salt(id).fill().scroll(Scroll::vertical()).show(ui, |ui, _| panels::show_icon_panel(app, ui, id)); } + None => panels::show_icon_panel(app, ui, id), } } From ede596a7ed8d6dc6ad6e1c308d4174f6d41b2b05 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 07:28:17 -0800 Subject: [PATCH 099/105] =?UTF-8?q?Fix=20#3211:=20Text=20Wrap=20=E2=80=BA?= =?UTF-8?q?=20Make=20wraps=20the=20area=20type=20selected=20with=20the=20o?= =?UTF-8?q?bject?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make set the wrap option on every selected object, the area type included, and the wrap resolver never wraps an object that has the option, so selecting the object and the type together and choosing Make left the type as it was. - Make leaves a selected type object with another selected object above it in its layer out of the wrap objects, and takes the option off it if an earlier Make set it there. Text Wrap Options leaves it out too. - Make warns in the status bar when no area type lies below any of its wrap objects (the object is below the type, or the type is point type). - Make and Options record no undo step when nothing changes. Docs: docs/mcp.md, the text_wrap tool description and the command params text. --- crates/engine/src/cmd/textwrap.rs | 179 ++++++++++++++++++++++++++-- crates/mcp/src/tools/definitions.rs | 2 +- docs/mcp.md | 2 +- 3 files changed, 169 insertions(+), 14 deletions(-) diff --git a/crates/engine/src/cmd/textwrap.rs b/crates/engine/src/cmd/textwrap.rs index 9ff48848af..ade875b4c9 100644 --- a/crates/engine/src/cmd/textwrap.rs +++ b/crates/engine/src/cmd/textwrap.rs @@ -4,6 +4,8 @@ //! resolves, for each area text object, the outlines of the wrap objects above it into //! `TextObject::wrap` (text space); the layout engine subtracts them from each line's span. +use std::collections::{HashMap, HashSet}; + use serde_json::{Value, json}; use vectorcraft_doc::{Document, NodeId, NodeKind, TextWrap}; @@ -17,7 +19,7 @@ pub fn specs() -> Vec { "Make", ["Object", "Text Wrap"], None, - "{offset?: pt (6), invert?: bool, ids?} area type below the selected objects (same layer) wraps around them; offset -1000 to 1000 (a negative one lets the text that far into them); an offset outside that range or not a number, or an invert that is not true or false, is an error → {ids}", + "{offset?: pt (6), invert?: bool, ids?} area type below the selected objects (same layer) wraps around them; a selected type object with another selected object above it in its layer is the text to wrap, not a wrap object, and loses a wrap it had; offset -1000 to 1000 (a negative one lets the text that far into them); an offset outside that range or not a number, or an invert that is not true or false, is an error → {ids (the wrap objects), warning? (no area type lies below any of them)}", has_selection, make ), @@ -27,13 +29,16 @@ pub fn specs() -> Vec { "Text Wrap Options…", ["Object", "Text Wrap"], None, - "{offset?: pt, invert?: bool, ids?} set the options of the selected wrap objects (offset -1000 to 1000; a negative one lets text into the objects); an offset outside that range or not a number, or an invert that is not true or false, is an error; no options (or null ones) → the current {offset, invert}", + "{offset?: pt, invert?: bool, ids?} set the options of the selected wrap objects, leaving out the type selected below them as Make does (offset -1000 to 1000; a negative one lets text into the objects); an offset outside that range or not a number, or an invert that is not true or false, is an error; no options (or null ones) → the current {offset, invert}", has_selection, options ), ] } +/// The warning Make gives when no area type lies below any of its wrap objects in their layer. +pub const NO_AREA_TYPE_BELOW: &str = "Text Wrap: no area type lies below these objects in their layer, so no text wraps around them. Move the objects above the area type with Object › Arrange › Bring to Front. Point type does not wrap."; + /// The Offset a wrap object takes, in points. pub const TEXT_WRAP_OFFSET_RANGE: std::ops::RangeInclusive = -1000.0..=1000.0; @@ -51,20 +56,70 @@ fn wrap_param(p: &Value, base: TextWrap, cmd: &str) -> Result { Ok(TextWrap { offset, invert: switch_or(p, "invert", base.invert, cmd)? }) } +/// The type objects of `ids` that lie below another of `ids` in their layer: the text Make wraps +/// when the wrap objects and the type are selected together. Make leaves them out of the wrap +/// objects, and takes the wrap off any of them that has one. +fn type_to_wrap(d: &Document, ids: &[NodeId]) -> HashSet { + let wanted: HashSet = ids.iter().copied().collect(); + // One pass in paint order: each selected type object with its layer and place, and the place of + // the topmost selected object other than a layer in each layer. + let mut texts = vec![]; + let mut top: HashMap = HashMap::new(); + let mut at = 0usize; + for (layer, l) in d.layers.iter().enumerate() { + l.walk(&mut |n| { + if wanted.contains(&n.id) { + match n.kind { + NodeKind::Layer { .. } => {} + NodeKind::Text(_) => { + texts.push((n.id, layer, at)); + top.insert(layer, at); + } + _ => { + top.insert(layer, at); + } + } + } + at += 1; + }); + } + texts.into_iter().filter(|(_, layer, at)| top.get(layer).is_some_and(|t| t > at)).map(|(id, _, _)| id).collect() +} + fn make(s: &mut Session, p: &Value) -> Result { let ids = checked_ids_or_selection(s, p, "object.textWrap.make")?; let w = wrap_param(p, TextWrap::default(), "object.textWrap.make")?; - s.edit("Make Text Wrap", |d, _| { - for id in &ids { - let n = d.node_mut(*id).ok_or(EngineError::NoNode(*id))?; - if matches!(n.kind, NodeKind::Layer { .. }) { + let (objects, text, changed) = { + let d = &s.doc()?.doc; + let text = type_to_wrap(d, &ids); + let objects: Vec = ids.iter().copied().filter(|i| !text.contains(i)).collect(); + for id in &objects { + if d.node(*id).is_some_and(|n| matches!(n.kind, NodeKind::Layer { .. })) { return Err(EngineError::Other("layers can't be wrap objects".into())); } - n.extras_mut().wrap = Some(w); } - Ok(()) - })?; - Ok(json!({ "ids": ids.iter().map(|i| i.0).collect::>() })) + let changed = objects.iter().any(|i| d.node(*i).is_some_and(|n| n.extras().wrap != Some(w))) + || text.iter().any(|i| d.node(*i).is_some_and(|n| n.extras().wrap.is_some())); + (objects, text, changed) + }; + if changed { + s.edit("Make Text Wrap", |d, _| { + for id in &objects { + d.node_mut(*id).ok_or(EngineError::NoNode(*id))?.extras_mut().wrap = Some(w); + } + for id in &text { + d.node_mut(*id).ok_or(EngineError::NoNode(*id))?.extras_mut().wrap = None; + } + Ok(()) + })?; + } + let mut out = json!({ "ids": objects.iter().map(|i| i.0).collect::>() }); + let mut wraps = false; + vectorcraft_doc::text::wrap_sources(&s.doc()?.doc, |_, sources, _| wraps |= sources.iter().any(|n| objects.contains(&n.id))); + if !wraps { + out["warning"] = json!(NO_AREA_TYPE_BELOW); + } + Ok(out) } fn release(s: &mut Session, p: &Value) -> Result { @@ -91,14 +146,25 @@ fn release(s: &mut Session, p: &Value) -> Result { fn options(s: &mut Session, p: &Value) -> Result { let ids = checked_ids_or_selection(s, p, "object.textWrap.options")?; - let current = { + // The type selected below the wrap objects is the text they wrap, as in Make. + let (ids, current) = { let d = &s.doc()?.doc; - ids.iter().find_map(|i| d.node(*i).and_then(|n| n.extras().wrap)).unwrap_or_default() + let text = type_to_wrap(d, &ids); + let ids: Vec = ids.into_iter().filter(|i| !text.contains(i)).collect(); + let current = ids.iter().find_map(|i| d.node(*i).and_then(|n| n.extras().wrap)).unwrap_or_default(); + (ids, current) }; if ["offset", "invert"].iter().all(|k| p.get(k).is_none_or(Value::is_null)) { return Ok(json!({ "offset": current.offset, "invert": current.invert })); } let w = wrap_param(p, current, "object.textWrap.options")?; + let changed = { + let d = &s.doc()?.doc; + ids.iter().any(|i| d.node(*i).is_some_and(|n| !matches!(n.kind, NodeKind::Layer { .. }) && n.extras().wrap != Some(w))) + }; + if !changed { + return Ok(json!({ "offset": w.offset, "invert": w.invert })); + } s.edit("Text Wrap Options", |d, _| { for id in &ids { if let Some(n) = d.node_mut(*id) @@ -287,6 +353,95 @@ mod tests { assert_eq!(s.execute("object.textWrap.options", &json!({"invert": true})).unwrap(), json!({"offset": 5000.0, "invert": true})); } + fn wrap_of(s: &Session, id: u64) -> Option { + s.doc().unwrap().doc.node(NodeId(id)).unwrap().extras().wrap + } + + fn area_type(s: &mut Session) -> u64 { + s.execute("text.create", &json!({"x": 0, "y": 0, "text": "word ".repeat(300), "size": 12, "area": {"width": 400, "height": 400}})) + .unwrap()["id"] + .as_u64() + .unwrap() + } + + fn ellipse(s: &mut Session) -> u64 { + s.execute("shape.ellipse", &json!({"x": 150, "y": 100, "width": 100, "height": 100})).unwrap()["id"].as_u64().unwrap() + } + + /// Make with the wrap object and the area type below it selected together wraps the type: the + /// type is the text to wrap, not another wrap object (#3211). + #[test] + fn make_with_the_area_type_selected_wraps_it() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 600, "height": 600})).unwrap(); + let t = area_type(&mut s); + let plain = lines(&s, t); + let c = ellipse(&mut s); + s.execute("select.set", &json!({"ids": [c, t]})).unwrap(); + let r = s.execute("object.textWrap.make", &json!({})).unwrap(); + assert_eq!(r, json!({"ids": [c]}), "{r}"); + assert!(wrap_of(&s, c).is_some()); + assert!(wrap_of(&s, t).is_none(), "the area type became a wrap object"); + assert_ne!(lines(&s, t), plain, "the area type did not wrap"); + // Make again with the same options changes nothing and records no undo step. + let steps = s.doc().unwrap().history.undo.len(); + assert_eq!(s.execute("object.textWrap.make", &json!({})).unwrap(), json!({"ids": [c]})); + assert_eq!(s.doc().unwrap().history.undo.len(), steps); + // Text Wrap Options with both still selected sets the wrap object's options only, and the + // type keeps wrapping; the same options again record no undo step. + let wrapped = lines(&s, t); + assert_eq!(s.execute("object.textWrap.options", &json!({"offset": 30})).unwrap()["offset"], json!(30.0)); + assert_eq!(wrap_of(&s, c).map(|w| w.offset), Some(30.0)); + assert!(wrap_of(&s, t).is_none(), "Options made the area type a wrap object"); + assert_ne!(lines(&s, t), wrapped, "the type did not follow the new offset"); + assert_ne!(lines(&s, t), plain); + let steps = s.doc().unwrap().history.undo.len(); + s.execute("object.textWrap.options", &json!({"offset": 30})).unwrap(); + assert_eq!(s.doc().unwrap().history.undo.len(), steps); + s.execute("edit.undo", &json!({})).unwrap(); + // One undo takes the wrap off again. + s.execute("edit.undo", &json!({})).unwrap(); + assert!(wrap_of(&s, c).is_none()); + assert_eq!(lines(&s, t), plain); + } + + /// Make with the object below the area type warns that no text wraps. After Bring to Front, + /// Make with both selected wraps the type, and the type that the first Make made a wrap object + /// is the text to wrap again (#3211). + #[test] + fn make_warns_when_the_object_is_below_the_type_and_wraps_after_bring_to_front() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 600, "height": 600})).unwrap(); + let c = ellipse(&mut s); + let t = area_type(&mut s); + let plain = lines(&s, t); + s.execute("select.set", &json!({"ids": [c, t]})).unwrap(); + let r = s.execute("object.textWrap.make", &json!({})).unwrap(); + assert_eq!(r["warning"], json!(super::NO_AREA_TYPE_BELOW), "{r}"); + assert_eq!(lines(&s, t), plain); + s.execute("select.set", &json!({"ids": [c]})).unwrap(); + s.execute("object.arrange.bringToFront", &json!({})).unwrap(); + s.execute("select.set", &json!({"ids": [c, t]})).unwrap(); + let r = s.execute("object.textWrap.make", &json!({})).unwrap(); + assert!(r.get("warning").is_none(), "{r}"); + assert!(wrap_of(&s, t).is_none(), "the area type is still a wrap object"); + assert_ne!(lines(&s, t), plain, "the area type did not wrap"); + } + + /// Point type below a wrap object does not wrap, so Make warns. + #[test] + fn make_warns_over_point_type() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 600, "height": 600})).unwrap(); + let p = s.execute("text.create", &json!({"x": 0, "y": 100, "text": "point type", "size": 12})).unwrap()["id"].as_u64().unwrap(); + let r = s.execute("shape.rectangle", &json!({"x": 0, "y": 80, "width": 50, "height": 50})).unwrap()["id"].as_u64().unwrap(); + s.execute("select.set", &json!({"ids": [r, p]})).unwrap(); + let out = s.execute("object.textWrap.make", &json!({})).unwrap(); + assert_eq!(out["warning"], json!(super::NO_AREA_TYPE_BELOW), "{out}"); + assert!(wrap_of(&s, r).is_some()); + assert!(wrap_of(&s, p).is_none(), "the point type became a wrap object"); + } + #[test] fn text_flows_on_both_sides_of_a_centred_object() { let mut s = Session::new(); diff --git a/crates/mcp/src/tools/definitions.rs b/crates/mcp/src/tools/definitions.rs index d9bf1c8d98..98267484e0 100644 --- a/crates/mcp/src/tools/definitions.rs +++ b/crates/mcp/src/tools/definitions.rs @@ -514,7 +514,7 @@ pub fn tool_definitions() -> Vec { tool( "text_wrap", "Text wrap", - "Make the selected (or `ids`) objects wrap objects: area type below them in the same layer flows around them (offset in pt, invert = flow inside). `release: true` removes the wrap. An offset outside -1000 to 1000 or not a number, or an invert or release that is not true or false, is an error and changes nothing.", + "Make the selected (or `ids`) objects wrap objects: area type below them in the same layer flows around them (offset in pt, invert = flow inside). A type object in `ids` below another of them is the text to wrap, not a wrap object. A `warning` says when no area type lies below them. `release: true` removes the wrap. An offset outside -1000 to 1000 or not a number, or an invert or release that is not true or false, is an error and changes nothing.", obj( json!({ "ids": {"type": "array", "items": {"type": "integer"}}, diff --git a/docs/mcp.md b/docs/mcp.md index a9e9d9649a..84950b4b17 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -821,7 +821,7 @@ ends the wait, so the sampler can be shown again. The BSDs and headless sessions | `pathfinder` | `{operation, ids?}` | `unite`, `minusFront`, `intersect`, `exclude`, `divide`, `trim`, `merge`, `crop`, `outline`, `minusBack`. For a live version, apply the `pathfinder.*` effect to a group (`effect.apply` groups several loose selected objects first). In remote desktop mode, `run_command` and `invoke_menu` can both call `pathfinder.repeat` with `{}`. Successful panel operations, direct `object.pathfinder.*` commands, and `command.batch` steps (including Actions panel playback) set its history. Repeat applies it to the current selection using current Pathfinder Options. Trap, compound-shape edits, live effects and `action.batch` do not set history. With no history it returns "no Pathfinder operation applied yet". | | `transform` | `{ids?, dx?, dy?, rotate?, scale?, scaleX?, scaleY?, reflect?, shear?, origin?, copy?}` | Runs move, rotate, scale, reflect, shear in that order. `rotate` is in degrees counter-clockwise; a positive `shear` moves the top to the right. With `copy`, the first step duplicates. A `scale`, `reflect` or `shear` that its command would refuse returns that error before any step runs; nothing changes and no undo step is recorded. The same holds for a step that is neither a number nor null, a `reflect` that is not a string, a `copy` that is not true or false, and an `origin` that is not two numbers. A null `rotate`, `scale`, `scaleX`, `scaleY`, `shear`, `reflect`, `copy` or `origin` is left out; a null `dx` or `dy` counts as 0, so it still runs the move. | | `create_graph` | `{type?, x, y, width, height, csv? \| series?, categories?, rows?}` | The nine Illustrator graph types: column, stacked column, bar, stacked bar, line, area, scatter, pie and radar. An empty CSV cell or a `null` in `rows` is a blank value; a number in straight quotes is a label. Edit later with `graph.setData` / `graph.setType` via `run_command`. `graph.column {design, columnType: vertical\|uniform\|repeating\|sliding, each, fractions: chop\|scale}` draws the columns or bars of the series picked with Group Selection (or `seriesIndexes`, or all of them) with a graph design saved by `graph.design`; with no `design` it returns the series' current design and options. Type in the design that holds a `%` followed by two digits shows each column's value, with at least the first digit's places before the decimal point and the second digit's places after it. | -| `text_wrap` | `{ids?, offset?, invert?, release?}` | Area type below the objects (same layer) flows around them. `offset` is in points, from -1000 to 1000 (default 6). An offset outside that range or not a number, or an `invert` or `release` that is not true or false, is an error and changes nothing; `object.textWrap.make` and `object.textWrap.options` refuse the same values. | +| `text_wrap` | `{ids?, offset?, invert?, release?}` | Area type below the objects (same layer) flows around them. A type object in `ids` with another of them above it in its layer is the text to wrap, not a wrap object, so the objects and the type can be selected together. The reply has a `warning` when no area type lies below any of the wrap objects. `offset` is in points, from -1000 to 1000 (default 6). An offset outside that range or not a number, or an `invert` or `release` that is not true or false, is an error and changes nothing; `object.textWrap.make` and `object.textWrap.options` refuse the same values. | | `undo` / `redo` | `{}` | Many calls that change nothing record no undo step, for example `object.align` with nothing to move, `object.move` by 0 without `copy`, `path.moveAnchors` by 0, `layer.setProps` with every row already as given and `object.showAll` with nothing hidden. `undo` (`edit.undo`) after such a call undoes the step before it. Settings that change without an undo step stay as they are when `undo` or `redo` brings back a step that did not change them: the perspective grid's view options and active plane, the grid preferences (`gridlineEvery`, `gridSubdivisions`), the export settings (`assets.settings.set`), and the current brush and symbol. A step that changed one of them, such as a perspective grid preset that shows the grid, takes that change back. The point Automatic Plane Positioning holds comes back with the step, and is let go when the active plane kept is another one. `inspect_document` lists the undo steps as `history`. `run_command` with `edit.clearHistory` removes every undo and redo step of the active document and returns `{cleared}`, the number of steps removed; the document stays as it is, and the command records no undo step. `run_command` with `edit.newDocumentFromState` and `{index?, created?}` makes a new document holding the art as it was at that state and makes it the active document, and returns `{index, title}`. `index` is a row of the History panel, with 0 the oldest state kept, and an omitted or null `index` uses the current state. An `index` that names no state fails with `no history state N`, one that is not a whole number with `` `index` must be a whole number ``, and either changes nothing. `created` is File Info's created date in Unix seconds or null, and defaults to now. The new document takes the next `Untitled-N` name, is marked unsaved, has nothing selected and has no steps to undo or redo. It is out of symbol, opacity-mask and pattern editing, and the art drawn in a pattern's tile is stored in the pattern, as `object.pattern.done` stores it. The source document and its steps stay as they are, except that typing or a drag in progress is first kept as a step. When a command keeps a drag whose preview Real-time Drawing off had not applied yet (`edit.undo`, `edit.redo`, `edit.clearHistory`, `edit.newDocumentFromState` and the other commands that end a drag first), and applying that preview gives a warning, the command's result carries it as `previewWarning`, and as `warning` too when the command gives no warning of its own; the app's status bar shows `warning`. Any other command that changes the document during a tool's drag, from `run_command`, a panel or a menu, records its own undo step before the drag's. The command acts on the document without the drag's preview, and the drag then continues from the command's result: with Real-time Drawing on, the drag's preview is applied again at once, and with it off, the release applies it as before. The release records the drag's step after the command's, `undo` takes back the drag first and the command next, and Escape cancels only the drag. The drag acts on the objects it started with, so a selection the command makes (`select.all`, `edit.duplicate`) does not change what the drag moves, and the drag's release and Escape set the selection as they do without the command (with Real-time Drawing on, so does each move of the drag); a command that records no undo step, such as `select.none`, adds no step. When the command deletes or changes the art being dragged, the drag continues with the art the command left, and a drag left with nothing to change records no step. A warning or an error from the drag's preview applied again after the command is in the command's result as `previewWarning`. Typing in progress is kept as a step of its own before the command. Two cases run the command inside the drag, which then keeps the command's edit as part of its own step: a press of the Quick Pen (an edit to its path ends the path), and `object.transform` with `copy` during an Alt-drag, which copies the art as the drag's move left it. A command run while a dialog's or a panel's preview is open runs inside that preview. While the Type tool edits type, `undo` and `redo` put its caret, with no characters selected, at the end of the text the step changed: after the text it puts back or retypes, or where the text it takes out was. A step that changes no characters, such as a formatting change, leaves the caret and the selection where they are. | For example, create editable Japanese area type with the engine's vertical writing mode: From 8cd5376786d912bd6da594611d54bff32c282e56 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 16:33:21 +0100 Subject: [PATCH 100/105] Route selected Zoom to canvas navigation and keep freehand edges stationary --- crates/ui-egui/src/app.rs | 1 + crates/ui-egui/src/caches.rs | 2 + .../ui-egui/src/canvas/tests_edge_scroll.rs | 60 ++++++++++++++++++- crates/ui-egui/src/canvas/tool_adapter.rs | 26 ++++++-- 4 files changed, 82 insertions(+), 7 deletions(-) diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 228a01b2f6..b2e2fa1331 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -140,6 +140,7 @@ impl VectorcraftApp { text_nodes: Default::default(), momentary: None, hand: None, + zoom_tool: None, selection_box: None, selection_bounds: None, selection_marks: None, diff --git a/crates/ui-egui/src/caches.rs b/crates/ui-egui/src/caches.rs index cdf59a99f8..06c564f4c8 100644 --- a/crates/ui-egui/src/caches.rs +++ b/crates/ui-egui/src/caches.rs @@ -82,6 +82,8 @@ pub struct CanvasCache { /// passes; the tool adapter takes it out for its call and puts it back. pub momentary: Option, pub hand: Option, + /// The selected Zoom tool keeps its press and drag rectangle between canvas passes. + pub zoom_tool: Option, /// [`VectorcraftApp::selection_box`] for (document uid, revision, Use Preview Bounds and /// Measure Type by Glyph Bounds). pub selection_box: Option<((u64, u64, vectorcraft_effects::preview::Measure), Option)>, diff --git a/crates/ui-egui/src/canvas/tests_edge_scroll.rs b/crates/ui-egui/src/canvas/tests_edge_scroll.rs index 167f938861..405d14a4e0 100644 --- a/crates/ui-egui/src/canvas/tests_edge_scroll.rs +++ b/crates/ui-egui/src/canvas/tests_edge_scroll.rs @@ -9,7 +9,12 @@ use vectorcraft_geom::Point; /// One headless canvas frame on an 800 × 600 window. fn frame(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec) { - let raw = egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0))), events, ..Default::default() }; + frame_with_modifiers(app, ctx, events, Default::default()); +} + +fn frame_with_modifiers(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec, modifiers: egui::Modifiers) { + let raw = + egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0))), events, modifiers, ..Default::default() }; let mut out = ctx.run_ui(raw, |ui| show(app, ui)); out.textures_delta.clear(); } @@ -139,3 +144,56 @@ fn a_hand_drag_held_near_the_edge_does_not_scroll_on() { assert_eq!(center(&app), c0); frame(&mut app, &ctx, vec![button(edge, false)]); } + +#[test] +fn a_freehand_stroke_at_the_edge_keeps_the_artwork_stationary() { + let (mut app, ctx, original) = zoomed_in("pencil"); + let rect = app.canvas_view().unwrap().rect; + let start = rect.center() - vec2(120.0, 60.0); + let edge = pos2(rect.right() - 2.0, start.y + 40.0); + let initial = center(&app); + let nodes = |app: &VectorcraftApp| { + let mut count = 0; + app.session.active().unwrap().doc.walk(|_| count += 1); + count + }; + let before = nodes(&app); + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(start), button(start, true)]); + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(start + vec2(15.0, 25.0))]); + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(edge)]); + for _ in 0..5 { + frame(&mut app, &ctx, vec![]); + assert_eq!(center(&app), initial); + } + frame(&mut app, &ctx, vec![button(edge, false)]); + assert!(nodes(&app) > before, "the pencil drew a new path"); + assert!(app.session.active().unwrap().doc.node(original).is_some()); +} + +#[test] +fn selected_zoom_tool_clicks_option_clicks_and_drags_a_marquee() { + let (mut app, ctx, _) = zoomed_in("zoom"); + app.session.prefs.animated_zoom = false; + let rect = app.canvas_view().unwrap().rect; + let position = rect.center(); + let zoom = |app: &VectorcraftApp| app.view().unwrap().zoom; + let initial = zoom(&app); + for pressed in [true, false] { + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(position), button(position, pressed)]); + } + let enlarged = zoom(&app); + assert!(enlarged > initial, "click should zoom in: {initial} -> {enlarged}"); + let modifiers = egui::Modifiers::ALT; + for pressed in [true, false] { + let event = egui::Event::PointerButton { pos: position, button: egui::PointerButton::Primary, pressed, modifiers }; + frame_with_modifiers(&mut app, &ctx, vec![event], modifiers); + } + let reduced = zoom(&app); + assert!(reduced < enlarged, "Option-click should zoom out: {enlarged} -> {reduced}"); + let start = position - vec2(90.0, 65.0); + let end = position + vec2(80.0, 55.0); + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(start), button(start, true)]); + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(end)]); + frame(&mut app, &ctx, vec![button(end, false)]); + assert!(zoom(&app) > reduced, "the marquee should fit its region to the view"); +} diff --git a/crates/ui-egui/src/canvas/tool_adapter.rs b/crates/ui-egui/src/canvas/tool_adapter.rs index cc2750f2a4..2e33ef9cf8 100644 --- a/crates/ui-egui/src/canvas/tool_adapter.rs +++ b/crates/ui-egui/src/canvas/tool_adapter.rs @@ -590,7 +590,9 @@ impl CanvasTool for SessionTool<'_> { } fn autoscrolls(&self) -> bool { - !self.carrying.get() && !self.view_only() + // Sampled freehand tools trace the pointer on the artwork. Scrolling + // under a held pen would extend the stroke without another sample. + !self.carrying.get() && !self.view_only() && !self.app().session.tool_wants_samples() } fn view_only(&self) -> bool { @@ -651,18 +653,30 @@ pub(crate) fn run(app: &mut VectorcraftApp, ui: &mut Ui, pass: &ToolPass) -> Too let mut picked = ToolHostResponse::default(); let mut response = if crate::dialogs::recolor::edit_tab::with_theme_pick(app, |app, tool| picked = host_run(app, ui, pass, tool)) { picked - } else if app.session.tool_id() == "hand" && app.ui.screen_mode != 3 && app.ui.rearrange_placement.is_none() { + } else if matches!(app.session.tool_id(), "hand" | "zoom") && app.ui.screen_mode != 3 && app.ui.rearrange_placement.is_none() { let options = crate::app::view::navigation(&app.session.prefs); - let mut hand = app.canvas.hand.take().unwrap_or_else(|| craft::ui::canvas::HandTool::new(options)); - hand.options = options; - let response = host_run(app, ui, pass, &mut hand); + let response = if app.session.tool_id() == "zoom" { + app.canvas.hand = None; + let mut zoom = app.canvas.zoom_tool.take().unwrap_or_else(|| craft::ui::canvas::ZoomTool::new(options)); + zoom.options = options; + let response = host_run(app, ui, pass, &mut zoom); + app.canvas.zoom_tool = Some(zoom); + response + } else { + app.canvas.zoom_tool = None; + let mut hand = app.canvas.hand.take().unwrap_or_else(|| craft::ui::canvas::HandTool::new(options)); + hand.options = options; + let response = host_run(app, ui, pass, &mut hand); + app.canvas.hand = Some(hand); + response + }; if response.gesture.is_some() && !view_tool_held(app) && ui.input(|i| i.pointer.primary_down() || i.pointer.primary_pressed()) { crate::shortcuts::note_tool_use(app); } - app.canvas.hand = Some(hand); response } else { app.canvas.hand = None; + app.canvas.zoom_tool = None; let mut tool = SessionTool::new(app, view_info, ui); let response = host_run_session(&mut tool, ui, pass); drop(tool); From 2baca48a3dccb2a218c286ccdd3ecf79a99910ed Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 16:38:56 +0100 Subject: [PATCH 101/105] Collect macOS menu key equivalents before consuming native key-up --- crates/ui-egui/src/app.rs | 7 ++++++- crates/ui-egui/src/menus/native.rs | 1 - crates/ui-egui/src/tests/nativemenu.rs | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 228a01b2f6..246341ef71 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -380,7 +380,12 @@ impl VectorcraftApp { } /// A window's raw input, before egui and the keys read it (the host's `raw_input_hook`). - pub fn raw_input(&self, ctx: &egui::Context, raw: &mut egui::RawInput) { + pub fn raw_input(&mut self, ctx: &egui::Context, raw: &mut egui::RawInput) { + // AppKit consumes the key-down and winit can already have queued its key-up. + // Poll before the runtime orders the press and release in this frame's input. + if let Some(menu) = self.services.native_menu.as_mut() { + menu.poll(ctx); + } crate::type_editing::keep_layout_text(self, ctx, raw); } diff --git a/crates/ui-egui/src/menus/native.rs b/crates/ui-egui/src/menus/native.rs index 0cd3eeaa87..2450a9b201 100644 --- a/crates/ui-egui/src/menus/native.rs +++ b/crates/ui-egui/src/menus/native.rs @@ -27,7 +27,6 @@ pub(crate) fn run(app: &mut VectorcraftApp, ctx: &egui::Context) { let gate = Gate::default().modal(app.file_dialog_open()).recording_shortcut(recording_shortcut(app)).text_editing(ctx.egui_wants_keyboard_input()); let Some(menu) = app.services.native_menu.as_mut() else { return }; - menu.poll(ctx); menu.set_gate(gate); let clicks = menu.take_clicks(ctx); // A menu opening reads the Scripts folder again. diff --git a/crates/ui-egui/src/tests/nativemenu.rs b/crates/ui-egui/src/tests/nativemenu.rs index 1fad419639..41b5264479 100644 --- a/crates/ui-egui/src/tests/nativemenu.rs +++ b/crates/ui-egui/src/tests/nativemenu.rs @@ -458,3 +458,24 @@ fn a_key_equivalent_paste_pastes_a_picture_from_another_app() { assert_eq!(images(&m), n, "press {n} pastes one picture"); } } + +/// AppKit handles a menu shortcut's key-down before winit delivers the matching key-up. +/// The two must reach the same input batch, even if this frame can have only one pass. +#[test] +fn a_native_undo_and_redo_key_equivalent_each_change_the_canvas_once() { + let mut m = Mac::new(true); + m.ctx.options_mut(|o| o.max_passes = std::num::NonZeroUsize::MIN); + let id = m.app.run("shape.rectangle", json!({"x": 200, "y": 150, "width": 20, "height": 20})).unwrap()["id"].as_u64().unwrap(); + let id = vectorcraft_doc::NodeId(id); + m.frame(vec![]); + for (chord, shift, present) in [("Cmd+Z", false, false), ("Cmd+Shift+Z", true, true)] { + let mut modifiers = if crate::keymap::platform().is_mac() { Modifiers::MAC_CMD } else { Modifiers::CTRL }; + modifiers.command = true; + modifiers.shift = shift; + m.fake.report(MenuEvent::Key(Chord::parse(chord).unwrap())); + m.frame(vec![Event::Key { key: Key::Z, physical_key: Some(Key::Z), pressed: false, repeat: false, modifiers }]); + assert_eq!(m.app.session.active().unwrap().doc.node(id).is_some(), present, "{chord} with the native key-up"); + m.frame(vec![]); + assert_eq!(m.app.session.active().unwrap().doc.node(id).is_some(), present, "{chord} was applied once"); + } +} From c8abbce26b357d668c8018b30c603aff82d5c2b4 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 16:41:07 +0100 Subject: [PATCH 102/105] Deliver Option as a modifier-change event in Zoom regression --- crates/ui-egui/src/canvas/tests_edge_scroll.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/crates/ui-egui/src/canvas/tests_edge_scroll.rs b/crates/ui-egui/src/canvas/tests_edge_scroll.rs index 405d14a4e0..3a67ee6840 100644 --- a/crates/ui-egui/src/canvas/tests_edge_scroll.rs +++ b/crates/ui-egui/src/canvas/tests_edge_scroll.rs @@ -9,12 +9,7 @@ use vectorcraft_geom::Point; /// One headless canvas frame on an 800 × 600 window. fn frame(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec) { - frame_with_modifiers(app, ctx, events, Default::default()); -} - -fn frame_with_modifiers(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec, modifiers: egui::Modifiers) { - let raw = - egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0))), events, modifiers, ..Default::default() }; + let raw = egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0))), events, ..Default::default() }; let mut out = ctx.run_ui(raw, |ui| show(app, ui)); out.textures_delta.clear(); } @@ -186,8 +181,9 @@ fn selected_zoom_tool_clicks_option_clicks_and_drags_a_marquee() { let modifiers = egui::Modifiers::ALT; for pressed in [true, false] { let event = egui::Event::PointerButton { pos: position, button: egui::PointerButton::Primary, pressed, modifiers }; - frame_with_modifiers(&mut app, &ctx, vec![event], modifiers); + frame(&mut app, &ctx, vec![egui::Event::ModifiersChanged(modifiers), event]); } + frame(&mut app, &ctx, vec![egui::Event::ModifiersChanged(egui::Modifiers::NONE)]); let reduced = zoom(&app); assert!(reduced < enlarged, "Option-click should zoom out: {enlarged} -> {reduced}"); let start = position - vec2(90.0, 65.0); From dd8e474b64367a3969a0c808bd7aaff78cf3dede Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 16:41:31 +0100 Subject: [PATCH 103/105] Measure the Done button against the compact panel's actual bounds --- crates/ui-egui/src/panels/pattern_options.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/panels/pattern_options.rs b/crates/ui-egui/src/panels/pattern_options.rs index 0bd03fac9c..866588c468 100644 --- a/crates/ui-egui/src/panels/pattern_options.rs +++ b/crates/ui-egui/src/panels/pattern_options.rs @@ -274,15 +274,19 @@ mod tests { app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap(); app.run("object.pattern.make", json!({"name": "Dots"})).unwrap(); let mut panel = Panel::new(app, |app, ui| crate::dock::panel_body(app, ui, "patternOptions")); - panel.room(egui::vec2(300.0, 200.0)); + let viewport = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(300.0, 200.0)); + panel.room(viewport.size()); panel.frame(); panel.frame(); - assert!(!panel.in_view("Done")); + let before = panel.rect("Done"); + assert!(before.center().y > viewport.bottom(), "Done starts at {before:?} in {viewport:?}"); for _ in 0..20 { - panel.scroll_at(egui::pos2(150.0, 100.0), -120.0); + panel.scroll_at(egui::pos2(30.0, 30.0), -120.0); + panel.advance(0.2); panel.frame(); } - assert!(panel.in_view("Done")); + let after = panel.rect("Done"); + assert!(viewport.contains(after.center()), "Done moved from {before:?} to {after:?} in {viewport:?}"); panel.click("Done"); assert!(editing(&panel.app()).is_none()); } From dbcd460c53f70b8d2baebf40599e7fa76af0ed8e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 07:56:01 -0800 Subject: [PATCH 104/105] Tests: let the Move dialog close before the units test opens Rectangle dialog_lengths_show_in_the_general_unit confirmed the Move dialog and opened the Rectangle dialog in the same frame. Move holds its OK, so it stays on the stack until the next frame, and Rectangle is laid out once over it and once more, unseen, after Move leaves. The test drew two frames and passed only because the frame after the selection change ran a second pass for the Properties panel. With that panel drawn in one pass, the second frame showed nothing and the assertion failed. The test now draws a frame after OK, so Move has closed before the selection change and the Rectangle dialog. Its assertions are unchanged. --- crates/ui-egui/src/panels/tests_units.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/ui-egui/src/panels/tests_units.rs b/crates/ui-egui/src/panels/tests_units.rs index ecac244136..d5837ffed5 100644 --- a/crates/ui-egui/src/panels/tests_units.rs +++ b/crates/ui-egui/src/panels/tests_units.rs @@ -101,6 +101,8 @@ fn dialog_lengths_show_in_the_general_unit() { window.type_text("10 mm"); window.key(egui::Key::Tab, egui::Modifiers::NONE); confirm_dialog(&mut window.app()); + // The Move dialog holds its OK, so it leaves the stack in the next frame. + window.frame(); let square = { let app = window.app(); let st = app.session.active().unwrap(); From 2791318a353861d5bb8066b1f961228c59d37687 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 18:15:06 +0100 Subject: [PATCH 105/105] Keep artwork visible behind live effect controls --- crates/ui-egui/src/dialogs/effect.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/ui-egui/src/dialogs/effect.rs b/crates/ui-egui/src/dialogs/effect.rs index 06fa47f045..057eac94eb 100644 --- a/crates/ui-egui/src/dialogs/effect.rs +++ b/crates/ui-egui/src/dialogs/effect.rs @@ -350,9 +350,14 @@ fn launch(app: &mut VectorcraftApp, mut open: Open, baseline: Map // Free Distort's Reset puts the corners back on the box, wherever they were when it opened. let reset_to = (id == super::free_distort::FREE_DISTORT) .then(|| form::fields_of(&rows, &Map::from_iter([("corners".to_string(), json!(super::free_distort::IDENTITY))]))); + let canvas = crate::doc_windows::current(app).map(crate::canvas::canvas_id); let dialog = HostedParamDialog::new(&ctx, "effect", fields, move |f| { let rows = effect_params(&cx, f); let dialog = ParamDialog::new("effect", title.clone(), rows).values(Bind::bound(f)).previews(true); + let dialog = match canvas { + Some(canvas) => dialog.canvas(canvas), + None => dialog, + }; let dialog = match &reset_to { Some(target) => dialog.reset_to(target.clone()), None => dialog,