From df634f8a0b0d3877470caf5cb4aef2eae037109e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 2 Dec 2026 16:26:28 -0800 Subject: [PATCH 1/9] Panels: the Color and Gradient pop-outs run one pass a frame With the Color or Gradient panel open as a pop-out, every second frame at rest ran the whole window twice: egui discarded the first pass because a content column in the panel body measured differently from the transcript its flyout kept. storytold/craft-libs#4932 fixes the layout memory, and this moves the craft-libs pin to its head c2a47dfe, which is craft-libs main 092a2c6b with the fix. The egui and winit revisions are unchanged. The bump also brings in craft-libs #4584, #4804, #2415, #4531, #4676, #3061 and #4050. Test: with either pop-out open, each of 10 frames at rest runs one pass. --- Cargo.lock | 172 +++++++++++------------ Cargo.toml | 76 +++++----- apps/vectorcraft-web/Cargo.toml | 2 +- crates/ui-egui/src/panels/color/tests.rs | 30 ++++ xtask/src/pdf_deps.rs | 2 +- 5 files changed, 156 insertions(+), 126 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d0216e2962..80e136673a 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "egui", ] @@ -1381,7 +1381,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "rayon", ] @@ -1444,7 +1444,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "serde", ] @@ -1494,7 +1494,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "gif", ] @@ -1619,7 +1619,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "flate2", ] @@ -1627,7 +1627,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" 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=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -2182,7 +2182,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "accesskit", "craft-behavior", @@ -2220,7 +2220,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2231,7 +2231,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "craft-behavior", "craft-host", @@ -2249,7 +2249,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "craft-behavior", "craft-host", @@ -2270,7 +2270,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "craft-behavior", "craft-host", @@ -2291,7 +2291,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "craft-behavior", "craft-host", @@ -2310,7 +2310,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "base64 0.22.1", "chrono", @@ -2342,7 +2342,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "flate2", "serde", @@ -2353,7 +2353,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2363,7 +2363,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "js-sys", "serde_json", @@ -2374,7 +2374,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "winsafe", ] @@ -2382,7 +2382,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "craft-appkit", "craft-atomic", @@ -2414,7 +2414,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3773,7 +3773,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "brotli 8.0.4", "hayro-postscript", @@ -3782,7 +3782,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3800,7 +3800,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3818,12 +3818,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "flate2", "hayro-ccitt", @@ -4806,7 +4806,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4963,7 +4963,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=77ade517ecb2a6ad86feb2f9983a098ad5738fc6#77ade517ecb2a6ad86feb2f9983a098ad5738fc6" +source = "git+https://github.com/storytold/craft-libs?rev=c2a47dfea38b215245f739c675da3662c89f1e09#c2a47dfea38b215245f739c675da3662c89f1e09" dependencies = [ "arrayvec", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index 843f9cbb53..d14fd9004f 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 = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } # Language packs: the Craft apps' shared font store installs them (#4936). -craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } +craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } # 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 = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } # 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 = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } # 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 = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } # Nightly profile isolation, launch protocol, and security fence. -craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } +craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } # 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 = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "861d60a65c50850e995bbb3dcee7c1f3b06815f6" } emath = { git = "https://github.com/storytold/egui.git", rev = "861d60a65c50850e995bbb3dcee7c1f3b06815f6" } epaint = { git = "https://github.com/storytold/egui.git", rev = "861d60a65c50850e995bbb3dcee7c1f3b06815f6" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index 70aae32f73..e439dc8be6 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 = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "c2a47dfea38b215245f739c675da3662c89f1e09", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/crates/ui-egui/src/panels/color/tests.rs b/crates/ui-egui/src/panels/color/tests.rs index d354702ef2..a36c95f13a 100644 --- a/crates/ui-egui/src/panels/color/tests.rs +++ b/crates/ui-egui/src/panels/color/tests.rs @@ -429,3 +429,33 @@ fn the_wells_show_a_gradient_and_none_as_the_tools_proxy_does() { assert!(color.shows_value(well), "the Color panel shows a well that reads as {well:?}"); } } + +/// With the Color or the Gradient panel open as a pop-out, each frame at rest runs one pass of the window: no frame +/// runs a second pass that egui discards. +#[test] +fn an_open_color_or_gradient_pop_out_runs_one_pass_a_frame() { + for panel in ["color", "gradient"] { + let mut app = app(); + app.run("window.panel", json!({"panel": panel})).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!(app.ui.open_panel.as_deref(), Some(panel), "the {panel} pop-out is open"); + let counted: Vec = (0..10).map(|_| passes(&mut app)).collect(); + assert_eq!(counted, vec![1; 10], "the {panel} pop-out: one pass in each of 10 frames at rest"); + } +} diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index 542a3e8c41..1abbfba86a 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 = "77ade517ecb2a6ad86feb2f9983a098ad5738fc6"; +const REV: &str = "c2a47dfea38b215245f739c675da3662c89f1e09"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV), From 231d90614b70787a6e700f413e12f4df54cafcf3 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 4 Dec 2026 05:32:37 -0800 Subject: [PATCH 2/9] Docs: the save-changes question takes choice dontSave, not discard The question that Close, Close All and Quit open for a modified document takes `choice` (`save`, `dontSave` or `cancel`) and, while more documents wait, `applyToAll`. A `discard` field is refused with "unknown field `discard`". docs/control-protocol.md, the answer_dialog row of docs/mcp.md and the control module's doc comment still told clients to set `discard: true`. Each text now gives `{field: "choice", value: "dontSave"}`, lists the values `choice` takes and describes `applyToAll`. The answer_dialog row gives the choice in one call and the confirm in a second one: the app answers a `set` with `action` by returning the confirm's result alone, and answer_dialog then sends a second confirm, which can fail after the document closed or answer the next document's question. A test in unsaved.rs checks the requests on the lines that describe the `{"pending": "saveChanges"}` reply in both docs and sends the same requests through the control handler: the modified documents close and no file is written. --- crates/ui-egui/Cargo.toml | 2 + crates/ui-egui/src/control.rs | 3 +- crates/ui-egui/src/unsaved.rs | 76 +++++++++++++++++++++++++++++++++++ docs/control-protocol.md | 2 +- docs/mcp.md | 2 +- 5 files changed, 82 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/Cargo.toml b/crates/ui-egui/Cargo.toml index 49fad8d56f..1582da283e 100644 --- a/crates/ui-egui/Cargo.toml +++ b/crates/ui-egui/Cargo.toml @@ -116,6 +116,8 @@ toml = "1" reads = [ "crates/engine/src/cmd/addons/cutting/banner.rs", "crates/plugins/tests/fixtures/desaturate.wasm", + "docs/control-protocol.md", + "docs/mcp.md", "packaging/macos/nightly-lib.sh", "packaging/macos/nightly_plist.py", ] diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rs index 158cf852f8..ddf6055c2c 100644 --- a/crates/ui-egui/src/control.rs +++ b/crates/ui-egui/src/control.rs @@ -28,7 +28,8 @@ //! a path, or with `data: true`, as `pngBase64`) //! - `app.open {path}` (any readable format) / `app.save {path?, svg?: {…SVG options}}` / `app.quit` //! (`file.close`, `file.closeAll` and `app.quit` first open a `saveChanges` dialog for each -//! modified document: `ui.dialog.confirm` saves, set `discard: true` then confirm to discard) +//! modified document: `ui.dialog.confirm` saves, set `choice: "dontSave"` then confirm to close +//! without saving) //! - `app.export {path?, format?, …document.export options}`: encoded by the engine, written through //! the host; the document keeps its path. No path → `{dataBase64, format, bytes}` (as headless) //! - `wait: true` on `app.save` and `app.export`: the file is written before the reply, even with diff --git a/crates/ui-egui/src/unsaved.rs b/crates/ui-egui/src/unsaved.rs index 9d5a7230a0..252f3cc8a5 100644 --- a/crates/ui-egui/src/unsaved.rs +++ b/crates/ui-egui/src/unsaved.rs @@ -399,6 +399,82 @@ mod tests { assert_eq!((docs(&app), app.views.len()), (1, 1)); } + const CONTROL_DONT_SAVE: &str = r#"`ui.dialog.set {field: "choice", value: "dontSave"}` then confirm"#; + const CONTROL_APPLY_TO_ALL: &str = r#"`ui.dialog.set {field: "applyToAll", value: true}` before confirm"#; + const MCP_DONT_SAVE: &str = r#"`{set: [{field: "choice", value: "dontSave"}]}` followed by a second call with `{action: "confirm"}`"#; + const MCP_APPLY_TO_ALL: &str = r#"adding `{field: "applyToAll", value: true}` to `set`"#; + + /// Each documented Don't Save sequence closes the requested documents without writing a file, + /// including Apply to All for multiple modified documents. The documented requests are read + /// from the lines describing the `{"pending": "saveChanges"}` reply. + #[test] + fn the_documented_dont_save_answer_closes_without_saving() { + for (name, text, snippets) in [ + ("docs/control-protocol.md", include_str!("../../../docs/control-protocol.md"), [CONTROL_DONT_SAVE, CONTROL_APPLY_TO_ALL]), + ("docs/mcp.md", include_str!("../../../docs/mcp.md"), [MCP_DONT_SAVE, MCP_APPLY_TO_ALL]), + ] { + // Check the requests on every line describing the pending Save Changes reply. + let lines: Vec<_> = text.lines().filter(|line| line.contains(r#"{"pending": "saveChanges"}"#)).collect(); + assert!(!lines.is_empty(), "{name}: missing a line describing the pending Save Changes reply"); + for line in lines { + for snippet in snippets { + assert!(line.contains(snippet), "{name}: missing {snippet}; the test's requests must be updated with the docs"); + } + assert!(!line.contains("\"discard\""), "{name}: saveChanges must use choice instead of discard: {line}"); + } + } + + let control = |app: &mut VectorcraftApp, ctx: &egui::Context, method: &str, params: Value| { + let (req, _) = craft::automation::ControlRequest::new(method, params); + let craft::automation::Reply::Done(r) = crate::control::handle(app, ctx, &req) else { panic!("{method} answers at once") }; + r + }; + for (name, apply_to_all, requests) in [ + ( + "control protocol Don't Save", + false, + vec![("ui.dialog.set", json!({ "field": "choice", "value": "dontSave" })), ("ui.dialog.confirm", json!({}))], + ), + ( + "control protocol applyToAll", + true, + vec![ + ("ui.dialog.set", json!({ "field": "choice", "value": "dontSave" })), + ("ui.dialog.set", json!({ "field": "applyToAll", "value": true })), + ("ui.dialog.confirm", json!({})), + ], + ), + ( + "MCP Don't Save", + false, + vec![("ui.dialog.set", json!({ "fields": [{ "field": "choice", "value": "dontSave" }] })), ("ui.dialog.confirm", json!({}))], + ), + ( + "MCP applyToAll", + true, + vec![ + ("ui.dialog.set", json!({ "fields": [{ "field": "choice", "value": "dontSave" }, { "field": "applyToAll", "value": true }] })), + ("ui.dialog.confirm", json!({})), + ], + ), + ] { + let mut app = app(); + new_doc(&mut app, true); + new_doc(&mut app, apply_to_all); + let (ctx, picker) = ready_with_picks(&mut app); + let (method, params) = if apply_to_all { ("file.closeAll", json!({})) } else { ("file.close", json!({ "index": 0 })) }; + assert_eq!(app.run(method, params).unwrap(), json!({ "pending": KIND }), "{name}: closing asks first"); + for (method, params) in requests { + let r = control(&mut app, &ctx, method, params.clone()); + assert!(r.get("error").is_none_or(Value::is_null), "{name}: {method} {params} is refused: {r}"); + } + pump(&mut app, &ctx); + assert_eq!(docs(&app), if apply_to_all { 0 } else { 1 }, "{name}: the requested documents close"); + assert!(picker.written().is_empty(), "{name}: no file is written"); + assert!(app.closing.is_none() && !question_open(&app), "{name}: no question remains open"); + } + } + #[test] fn closing_a_modified_background_tab_keeps_the_front_document_after_dont_save() { let mut app = app(); diff --git a/docs/control-protocol.md b/docs/control-protocol.md index 71e3d0fae9..783c686f45 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -107,7 +107,7 @@ the two can still win that race. | `ui.render` | `{path?, scale?, artboard?, data?, traceViews?}` | render an artboard headlessly (PNG with the pixels of `app.export {format: "png", background: "white"}` at the same scale; `artboard`: its 0-based index, default the first; `traceViews: true`: Image Trace objects draw in their View, as on the canvas, instead of their tracing result): written to `path`, else (or with `data: true` as well) sent back as `pngBase64` | | `ui.resize` | `{width?, height?}` | request the window's inner size; omitted or null `width` and `height` default to 1440 and 900. Returns `null` | | `ui.focus` | `{}` | request keyboard focus for the window. Returns `null` | -| `app.open` / `app.save` / `app.export` / `app.quit` | `{path, importer?, params?}` / `{path?}` / `{path?, format?, artboard?, range?, scale?, …}` | `app.open` reads every format `document.open` reads (see `document.formats`) and returns its result (`{index, title, format, warnings, …}`; `warnings` say what didn't come in as it was, such as an EPS shown as its preview image and why its PostScript couldn't be read), or null when a dialog asks first or a library loads. The status bar (`ui.inspect` → `ui.status`), after a line about the document's linked files when there is one (Missing linked files below), counts the `warnings` and names the first that says reading the file left something out (the notes that make Save ask before writing over it), else the first; with several, hovering it lists them in that order, as many as fit in the window (at most 30), then how many more. After `app.save`, and `app.export` with a `path`, the status bar counts the reply's `warnings` and names the first, and with several, hovering it lists them in the reply's order (a save's notes start with what the format loses). With `importer` (an importer plug-in's format id, `plugin.`) it runs `file.openWith`: the file opens with that importer, also when a built-in format reads its extension, with the importer's parameters `params` (their defaults when omitted; no dialog asks for them). Without `importer`, `params` go to the importer that opens the file, and a built-in format does not read them. `app.export` encodes through the engine's `document.export` (same options; the document keeps its path) and writes `path` through the host; without `path` it returns `{dataBase64, format, bytes}`, as headless mode does. It refuses a key that no format takes, and an unknown key inside a PDF or EPS option object, before it writes anything (`docs/mcp.md`, Parameter keys). It accepts a key that only another format takes and does not use it: the reply's `warnings` and the status bar name the key ("`quality` was not used: PDF files don't read it"). `app.save` refuses a key that no save format takes, beside the path or in `options`, the same way. `app.quit`, `file.close` and `file.closeAll` first open a `saveChanges` dialog for each modified document (they return `{"pending": "saveChanges"}`): `ui.dialog.confirm` saves, `ui.dialog.set {field: "discard", value: true}` then confirm discards, `ui.dialog.cancel` cancels the whole close or quit | +| `app.open` / `app.save` / `app.export` / `app.quit` | `{path, importer?, params?}` / `{path?}` / `{path?, format?, artboard?, range?, scale?, …}` | `app.open` reads every format `document.open` reads (see `document.formats`) and returns its result (`{index, title, format, warnings, …}`; `warnings` say what didn't come in as it was, such as an EPS shown as its preview image and why its PostScript couldn't be read), or null when a dialog asks first or a library loads. The status bar (`ui.inspect` → `ui.status`), after a line about the document's linked files when there is one (Missing linked files below), counts the `warnings` and names the first that says reading the file left something out (the notes that make Save ask before writing over it), else the first; with several, hovering it lists them in that order, as many as fit in the window (at most 30), then how many more. After `app.save`, and `app.export` with a `path`, the status bar counts the reply's `warnings` and names the first, and with several, hovering it lists them in the reply's order (a save's notes start with what the format loses). With `importer` (an importer plug-in's format id, `plugin.`) it runs `file.openWith`: the file opens with that importer, also when a built-in format reads its extension, with the importer's parameters `params` (their defaults when omitted; no dialog asks for them). Without `importer`, `params` go to the importer that opens the file, and a built-in format does not read them. `app.export` encodes through the engine's `document.export` (same options; the document keeps its path) and writes `path` through the host; without `path` it returns `{dataBase64, format, bytes}`, as headless mode does. It refuses a key that no format takes, and an unknown key inside a PDF or EPS option object, before it writes anything (`docs/mcp.md`, Parameter keys). It accepts a key that only another format takes and does not use it: the reply's `warnings` and the status bar name the key ("`quality` was not used: PDF files don't read it"). `app.save` refuses a key that no save format takes, beside the path or in `options`, the same way. `app.quit`, `file.close` and `file.closeAll` first open a `saveChanges` dialog for each modified document (they return `{"pending": "saveChanges"}`): `ui.dialog.confirm` saves, `ui.dialog.set {field: "choice", value: "dontSave"}` then confirm closes the document without saving, `ui.dialog.cancel` cancels the whole close or quit. `choice` takes `save`, `dontSave` or `cancel`, and any other field or value is an error. While more modified documents wait to be asked about, the dialog also has `applyToAll`: `ui.dialog.set {field: "applyToAll", value: true}` before confirm gives the same answer for each of them | | `app.export` with `useArtboards` | `{path, useArtboards: true, range? \| artboards?, …}` | Export As: PNG, JPEG and WebP write one file per chosen artboard (default all; SVG does so for a `range`), `-.`, and return `{path, files: [path…]}`; a PDF keeps them as pages of `path`. `useArtboards: false` covers the bounds of the visible art. The menu's Export As… is `file.exportAs`: the `exportAs` dialog (`format`, `useArtboards`, `all`, `range`), then a save dialog and the format's options: `pngOptions` / `jpgOptions` / `webpOptions`, `svgOptions`, or `savePdf` for a PDF | | `ui.dialog.*` on `gradientStop` | `{field: "color" \| "opacity" \| "location", value}` | double-clicking a stop on the Gradient tool's annotator opens its popover (fields `index`, `x`, `y`, `tab`); set `color` (hex), `opacity` or `location` (percentages) and `ui.dialog.confirm` to apply them to the selected stop. `gradient.selectStop {index}` picks the stop the annotator, the panels and Delete/←/→ (`ui.key`) act on | | `engine.execute` `ui.savePdfDialog` | `{path?, preset?, range?, …document.exportPdf options}` | opens the Save PDF dialog (`file.export.pdf` with no params opens it too). Its fields are the `document.exportPdf` options: set `compatibility` with `ui.dialog.set {field: "compatibility", value: "1.5"}`, a section with `{field: "compression", value: {…}}` (the options it leaves out keep the dialog's values, in Save PDF and in the preset editor, and in an object inside a section such as `compression.color`; a value that isn't an object, null included, is an error), the artboards with `__allArtboards: false` and `range`, the visible section with `__section` (General, Compression, Marks and Bleeds, Output, Advanced, Security, Summary), and the bleed link with `__bleedLinked` (true gives every side the top value; any value other than true or false is an error; setting `bleed` turns the link on when its four sides are equal and off when they differ). In Advanced, Custom… beside Flattener preset (enabled when the file is flattened: PDF 1.3, PDF/X-1a, PDF/X-3) opens the `pdfFlattenerOptions` dialog over Save PDF on the flattener options the save would use; its fields are those options, with `clipComplexRegions`, `preserveAlpha` and `preserveOverprints` set by the writer and Overprint. Its `ui.dialog.confirm` sets `flattener` (the preset then shows [Custom]; options equal to the preset's leave it unset) and goes back to Save PDF, and `ui.dialog.cancel` goes back unchanged. Setting `flattenerPreset` drops `flattener`. `useArtboards: false` opens it for one page of the visible art's bounds, as Export As with Use Artboards off does: the dialog has no Artboards section and its `__artBounds` field is true. `ui.dialog.confirm` writes `path` (else asks for one), returns `{path, bytes, warnings}` and opens the file when `viewAfterSaving` is set. With `useArtboards: false` it writes the page as `app.export` does and returns `{path, warnings}`, or `{background: true, status}` while Background Export writes it | diff --git a/docs/mcp.md b/docs/mcp.md index 85e35043df..2eb69df0ef 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -818,7 +818,7 @@ ends the wait, so the sampler can be shown again. The BSDs and headless sessions | `set_paint` | `{fill?, stroke?, strokeWidth?, ids?}` | Applies to the selection (or `ids`) and becomes the default for new art. Returns `{applied, objects}`: `objects` is the number of objects painted, as the `objects` of the `paint.setFill`, `paint.setStroke` and `stroke.set` replies (the largest of them): a selected group counts the objects inside it. When it is 0, a `note` says that only the paint for new art changed. When some of those commands painted objects and others painted none (a fill while the Shape Builder is the active tool, say), `unpainted` lists the commands that painted none, with a `note`. | | `press_key` | `{key, mods?}` | Remote: a real key event. Headless: runs the command or tool bound to that shortcut, or sends the key to the busy tool (digits too: `5` while dragging with the Perspective Selection tool; `e` while dragging a Selection or Group Selection marquee; `c` and `f` while dragging out an arc; `f`, `v`, `x` and `c` while dragging out a rectangular or polar grid). | | `type_text` | `{text}` | Remote only. | -| `answer_dialog` | `{set?: [{field, value?}], action?}` | Remote only. Sets fields of the app's open dialog in the order given with one `ui.dialog.set {fields, action?}` (a missing `value` is `null`). The app stores all of them or none, then answers that same dialog with `action` in the same request: `confirm` (OK) or `cancel`. Another connection cannot open a dialog between the two steps. When the app refuses the `ui.dialog.set`, for example because no dialog is open, the call is an error and the dialog is not confirmed or canceled. `set` cannot change a `__` field other than the dialog's controls held under a `__` name (such as Save PDF's `__section` or the Preferences `__search`): the `__command` and `__params` of a `confirm` or `command` dialog, and every other `__` field that holds what OK acts on, are refused with "the `` dialog cannot set protected field ``", so OK runs what the dialog was opened for. `action` alone is sent as `ui.dialog.confirm` or `ui.dialog.cancel`. Give `set`, `action` or both; `set` holds at most 256 fields. `inspect_ui` shows the open dialog and its fields as `ui.dialog`. Returns `{dialog, result}`: the dialog after the fields were set (or `null`) and the reply to `confirm` or `cancel` (or `null`). After `invoke_menu` `app.quit`, `file.close` or `file.closeAll` replies `{"pending": "saveChanges"}`, `{action: "confirm"}` saves, `{set: [{field: "discard", value: true}], action: "confirm"}` closes without saving and `{action: "cancel"}` cancels the close or quit. | +| `answer_dialog` | `{set?: [{field, value?}], action?}` | Remote only. Sets fields of the app's open dialog in the order given with one `ui.dialog.set {fields, action?}` (a missing `value` is `null`). The app stores all of them or none, then answers that same dialog with `action` in the same request: `confirm` (OK) or `cancel`. Another connection cannot open a dialog between the two steps. When the app refuses the `ui.dialog.set`, for example because no dialog is open, the call is an error and the dialog is not confirmed or canceled. `set` cannot change a `__` field other than the dialog's controls held under a `__` name (such as Save PDF's `__section` or the Preferences `__search`): the `__command` and `__params` of a `confirm` or `command` dialog, and every other `__` field that holds what OK acts on, are refused with "the `` dialog cannot set protected field ``", so OK runs what the dialog was opened for. `action` alone is sent as `ui.dialog.confirm` or `ui.dialog.cancel`. Give `set`, `action` or both; `set` holds at most 256 fields. `inspect_ui` shows the open dialog and its fields as `ui.dialog`. Returns `{dialog, result}`: the dialog after the fields were set (or `null`) and the reply to `confirm` or `cancel` (or `null`). After `invoke_menu` `app.quit`, `file.close` or `file.closeAll` replies `{"pending": "saveChanges"}`, `{action: "confirm"}` saves, `{set: [{field: "choice", value: "dontSave"}]}` followed by a second call with `{action: "confirm"}` closes without saving, and `{action: "cancel"}` cancels the close or quit. `choice` takes `save`, `dontSave` or `cancel`; while more modified documents wait to be asked about, adding `{field: "applyToAll", value: true}` to `set` gives the same answer for each of them. The second call answers whichever dialog is open when it arrives, so a dialog that another client or the user opens between the two calls is answered instead. | | `invoke_menu` | `{command, params?}` | Invokes a menu item by command id. UI commands such as `view.*` and `window.*` are in `command_list` with `ui: true`; running them needs the desktop app (`--connect`). The app refuses `attributes.openUrl`, `file.export.svg.browser`, `file.saveForWeb.browser` and `file.showPackage` for every control and MCP request, since each opens another app, so the headless error for them does not suggest `--connect`. | | `open_panel` | `{panel}` | Remote only. `panel` is a panel id (`layers`, `swatches`, `colorGuide`, …, as `window.panel` takes) or its display label (`"Color Guide"`), in any case. | | `screenshot` | `{path?, scale?, artboard?, window?, max_side?, traceViews?}` | Returns MCP image content (`image/png`, base64) plus a text block. Renders the artboard with the pixels of a PNG `export` with `background: "white"` at the same scale; `traceViews:true` draws Image Trace objects in the view set with `imageTrace.setView`, as in the app's window; `window:true` captures the app window (remote only), as `ui_screenshot` does, and `max_side` (1–4096, window captures only) scales the returned image down as described for `ui_screenshot`. With `path` the backend (the headless session or the app) writes the PNG there too; a window capture written there keeps its full size with `max_side`. An app that does not send the image back writes a window capture without `path` to a file in a new folder inside the system's temporary folder (on Unix only the user can open it); the server reads the file and then removes the folder, also when the capture or the read fails. | From 4cc6d9c0d16477c87be2b9452835e9fe9b609659 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 4 Dec 2026 11:10:01 -0800 Subject: [PATCH 3/9] MCP: answer_dialog describes Don't Save as two calls, with applyToAll The answer_dialog tool description, which MCP clients read from tools/list, still gave Don't Save for the save-changes question as one call that sets `choice` and confirms. The app answers that request with the confirm's result alone, so answer_dialog sends a second confirm, which fails once the document has closed or, during Close All or Quit, answers the next document's question with Save. The description now gives the same sequence as docs/mcp.md: set `choice` to `dontSave`, then confirm in a second call. It names file.closeAll beside app.quit and file.close, lists the values `choice` takes, describes `applyToAll`, and says to give `set` and `action` in separate calls for this question. The answer_dialog row of docs/mcp.md says the same. A test in the MCP crate checks that the description gives the two-call sequence and applyToAll, and does not give the one-call form or `discard`. --- crates/mcp/src/tests/conventions.rs | 17 +++++++++++++++++ crates/mcp/src/tools/definitions.rs | 2 +- docs/mcp.md | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/crates/mcp/src/tests/conventions.rs b/crates/mcp/src/tests/conventions.rs index 9020370c26..839c740ec1 100644 --- a/crates/mcp/src/tests/conventions.rs +++ b/crates/mcp/src/tests/conventions.rs @@ -418,6 +418,23 @@ fn alias_tools_name_their_pair() { assert!(description("ui_screenshot").contains("window:true")); } +/// answer_dialog's description gives the save-changes answers that docs/mcp.md gives: Don't Save +/// sets `choice` and confirms in a second call, and `applyToAll` answers every waiting document. +#[test] +fn answer_dialog_describes_the_save_changes_answers() { + let tools = tool_definitions(); + let description = tools.iter().find(|t| t["name"] == "answer_dialog").unwrap()["description"].as_str().unwrap().to_string(); + for snippet in [ + "app.quit, file.close or file.closeAll", + r#"{set:[{field:"choice",value:"dontSave"}]} followed by a second call with {action:"confirm"}"#, + r#"{field:"applyToAll",value:true}"#, + ] { + assert!(description.contains(snippet), "answer_dialog's description is missing {snippet}: {description}"); + } + assert!(!description.contains("discard"), "the save-changes dialog takes choice, not discard: {description}"); + assert!(!description.contains(r#"value:"dontSave"}],action:"confirm"}"#), "Don't Save must confirm in a second call: {description}"); +} + #[test] fn conventions_tool_panics_are_tool_errors() { let mut s = Server::new(Box::new(Panics)); diff --git a/crates/mcp/src/tools/definitions.rs b/crates/mcp/src/tools/definitions.rs index 98267484e0..63c3dadc05 100644 --- a/crates/mcp/src/tools/definitions.rs +++ b/crates/mcp/src/tools/definitions.rs @@ -314,7 +314,7 @@ pub fn tool_definitions() -> Vec { tool( "answer_dialog", "Answer dialog", - "Set fields of the desktop app's open dialog in order, then confirm (OK) or cancel it, as the control protocol's ui.dialog.set, ui.dialog.confirm and ui.dialog.cancel do. The app stores all the fields or none and answers that same dialog in the same request (ui.dialog.set with action). When the app refuses the ui.dialog.set, for example because no dialog is open, the call is an error and the dialog is not confirmed or canceled. inspect_ui shows the open dialog and its fields (ui.dialog). After invoke_menu app.quit or file.close replies {\"pending\":\"saveChanges\"}: {action:\"confirm\"} saves, {set:[{field:\"choice\",value:\"dontSave\"}],action:\"confirm\"} closes without saving, {action:\"cancel\"} cancels. Returns {dialog, result}: the dialog after the fields were set, and the reply to confirm or cancel. Desktop app only.", + "Set fields of the desktop app's open dialog in order, then confirm (OK) or cancel it, as the control protocol's ui.dialog.set, ui.dialog.confirm and ui.dialog.cancel do. The app stores all the fields or none and answers that same dialog in the same request (ui.dialog.set with action). When the app refuses the ui.dialog.set, for example because no dialog is open, the call is an error and the dialog is not confirmed or canceled. inspect_ui shows the open dialog and its fields (ui.dialog). After invoke_menu app.quit, file.close or file.closeAll replies {\"pending\":\"saveChanges\"}: {action:\"confirm\"} saves, {set:[{field:\"choice\",value:\"dontSave\"}]} followed by a second call with {action:\"confirm\"} closes without saving, and {action:\"cancel\"} cancels the close or quit. choice takes save, dontSave or cancel; while more modified documents wait to be asked about, adding {field:\"applyToAll\",value:true} to set gives the same answer for each of them. Give set and action in separate calls for this question: in one call, answer_dialog sends a second confirm, which fails once the document has closed or answers the next document's question. The second call answers whichever dialog is open when it arrives. Returns {dialog, result}: the dialog after the fields were set, and the reply to confirm or cancel. Desktop app only.", obj( json!({ "set": { diff --git a/docs/mcp.md b/docs/mcp.md index 2eb69df0ef..b6ea0dc8a2 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -818,7 +818,7 @@ ends the wait, so the sampler can be shown again. The BSDs and headless sessions | `set_paint` | `{fill?, stroke?, strokeWidth?, ids?}` | Applies to the selection (or `ids`) and becomes the default for new art. Returns `{applied, objects}`: `objects` is the number of objects painted, as the `objects` of the `paint.setFill`, `paint.setStroke` and `stroke.set` replies (the largest of them): a selected group counts the objects inside it. When it is 0, a `note` says that only the paint for new art changed. When some of those commands painted objects and others painted none (a fill while the Shape Builder is the active tool, say), `unpainted` lists the commands that painted none, with a `note`. | | `press_key` | `{key, mods?}` | Remote: a real key event. Headless: runs the command or tool bound to that shortcut, or sends the key to the busy tool (digits too: `5` while dragging with the Perspective Selection tool; `e` while dragging a Selection or Group Selection marquee; `c` and `f` while dragging out an arc; `f`, `v`, `x` and `c` while dragging out a rectangular or polar grid). | | `type_text` | `{text}` | Remote only. | -| `answer_dialog` | `{set?: [{field, value?}], action?}` | Remote only. Sets fields of the app's open dialog in the order given with one `ui.dialog.set {fields, action?}` (a missing `value` is `null`). The app stores all of them or none, then answers that same dialog with `action` in the same request: `confirm` (OK) or `cancel`. Another connection cannot open a dialog between the two steps. When the app refuses the `ui.dialog.set`, for example because no dialog is open, the call is an error and the dialog is not confirmed or canceled. `set` cannot change a `__` field other than the dialog's controls held under a `__` name (such as Save PDF's `__section` or the Preferences `__search`): the `__command` and `__params` of a `confirm` or `command` dialog, and every other `__` field that holds what OK acts on, are refused with "the `` dialog cannot set protected field ``", so OK runs what the dialog was opened for. `action` alone is sent as `ui.dialog.confirm` or `ui.dialog.cancel`. Give `set`, `action` or both; `set` holds at most 256 fields. `inspect_ui` shows the open dialog and its fields as `ui.dialog`. Returns `{dialog, result}`: the dialog after the fields were set (or `null`) and the reply to `confirm` or `cancel` (or `null`). After `invoke_menu` `app.quit`, `file.close` or `file.closeAll` replies `{"pending": "saveChanges"}`, `{action: "confirm"}` saves, `{set: [{field: "choice", value: "dontSave"}]}` followed by a second call with `{action: "confirm"}` closes without saving, and `{action: "cancel"}` cancels the close or quit. `choice` takes `save`, `dontSave` or `cancel`; while more modified documents wait to be asked about, adding `{field: "applyToAll", value: true}` to `set` gives the same answer for each of them. The second call answers whichever dialog is open when it arrives, so a dialog that another client or the user opens between the two calls is answered instead. | +| `answer_dialog` | `{set?: [{field, value?}], action?}` | Remote only. Sets fields of the app's open dialog in the order given with one `ui.dialog.set {fields, action?}` (a missing `value` is `null`). The app stores all of them or none, then answers that same dialog with `action` in the same request: `confirm` (OK) or `cancel`. Another connection cannot open a dialog between the two steps. When the app refuses the `ui.dialog.set`, for example because no dialog is open, the call is an error and the dialog is not confirmed or canceled. `set` cannot change a `__` field other than the dialog's controls held under a `__` name (such as Save PDF's `__section` or the Preferences `__search`): the `__command` and `__params` of a `confirm` or `command` dialog, and every other `__` field that holds what OK acts on, are refused with "the `` dialog cannot set protected field ``", so OK runs what the dialog was opened for. `action` alone is sent as `ui.dialog.confirm` or `ui.dialog.cancel`. Give `set`, `action` or both; `set` holds at most 256 fields. `inspect_ui` shows the open dialog and its fields as `ui.dialog`. Returns `{dialog, result}`: the dialog after the fields were set (or `null`) and the reply to `confirm` or `cancel` (or `null`). After `invoke_menu` `app.quit`, `file.close` or `file.closeAll` replies `{"pending": "saveChanges"}`, `{action: "confirm"}` saves, `{set: [{field: "choice", value: "dontSave"}]}` followed by a second call with `{action: "confirm"}` closes without saving, and `{action: "cancel"}` cancels the close or quit. `choice` takes `save`, `dontSave` or `cancel`; while more modified documents wait to be asked about, adding `{field: "applyToAll", value: true}` to `set` gives the same answer for each of them. Give `set` and `action` in separate calls for this question: in one call, `answer_dialog` sends a second `confirm`, which fails once the document has closed or answers the next document's question. The second call answers whichever dialog is open when it arrives, so a dialog that another client or the user opens between the two calls is answered instead. | | `invoke_menu` | `{command, params?}` | Invokes a menu item by command id. UI commands such as `view.*` and `window.*` are in `command_list` with `ui: true`; running them needs the desktop app (`--connect`). The app refuses `attributes.openUrl`, `file.export.svg.browser`, `file.saveForWeb.browser` and `file.showPackage` for every control and MCP request, since each opens another app, so the headless error for them does not suggest `--connect`. | | `open_panel` | `{panel}` | Remote only. `panel` is a panel id (`layers`, `swatches`, `colorGuide`, …, as `window.panel` takes) or its display label (`"Color Guide"`), in any case. | | `screenshot` | `{path?, scale?, artboard?, window?, max_side?, traceViews?}` | Returns MCP image content (`image/png`, base64) plus a text block. Renders the artboard with the pixels of a PNG `export` with `background: "white"` at the same scale; `traceViews:true` draws Image Trace objects in the view set with `imageTrace.setView`, as in the app's window; `window:true` captures the app window (remote only), as `ui_screenshot` does, and `max_side` (1–4096, window captures only) scales the returned image down as described for `ui_screenshot`. With `path` the backend (the headless session or the app) writes the PNG there too; a window capture written there keeps its full size with `max_side`. An app that does not send the image back writes a window capture without `path` to a file in a new folder inside the system's temporary folder (on Unix only the user can open it); the server reads the file and then removes the folder, also when the capture or the read fails. | From 9251d4a129b8feb9f610bfbf2fd2c3129abe2baf Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 4 Dec 2026 11:11:17 -0800 Subject: [PATCH 4/9] Agents: control clients can't change the agent settings A window started with --control and no automation roots answers its control requests unconfined, so `prefs.agents` saved any readRoot, writeRoot or controlPort such a client sent. The agent folders it widened then held for every later agent session. `prefs.agents` now refuses a change whenever automation sent the request (a control or MCP request, or a pass that carries injected input), as `automation_is_acting` already does for commands that open another app. Reading the settings still works. The params text, its MCP mirror and docs/mcp.md say so. --- crates/mcp/src/ui_catalog.rs | 2 +- crates/ui-egui/src/agents.rs | 6 ++++-- crates/ui-egui/src/agents/tests.rs | 24 ++++++++++++++++++++++++ crates/ui-egui/src/menus/ui_commands.rs | 2 +- docs/mcp.md | 2 +- 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 391c861e66..681bdf01ee 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -175,7 +175,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "prefs.agents", "AI Integrations", "", - "{controlPort?: 0–65535, readRoot?: string, writeRoot?: string, whenAppClosed?: launch|headless|error} the agent settings of Preferences › AI Integrations (agents in the open window through the ArtCraft Launcher's switch); given keys are saved where vectorcraft-cli mcp reads them, refused from an agent's request → {settings, status: {port, launchFlags, error}, allowed, mcpFlag}; an error in the web build and in a run without preferences", + "{controlPort?: 0–65535, readRoot?: string, writeRoot?: string, whenAppClosed?: launch|headless|error} the agent settings of Preferences › AI Integrations (agents in the open window through the ArtCraft Launcher's switch); given keys are saved where vectorcraft-cli mcp reads them, refused from an agent's or a control client's request → {settings, status: {port, launchFlags, error}, allowed, mcpFlag}; an error in the web build and in a run without preferences", ), ("edit.keyboardShortcuts", "Keyboard Shortcuts…", "Cmd+Alt+Shift+K", "{}"), ( diff --git a/crates/ui-egui/src/agents.rs b/crates/ui-egui/src/agents.rs index 4ab629e70a..3f6fae9bae 100644 --- a/crates/ui-egui/src/agents.rs +++ b/crates/ui-egui/src/agents.rs @@ -147,8 +147,10 @@ const KEYS: [&str; 4] = ["controlPort", "readRoot", "writeRoot", "whenAppClosed" /// `prefs.agents`: the agent settings of Preferences › AI Integrations, the link's status and the /// launcher's switch. `{controlPort?, readRoot?, writeRoot?, whenAppClosed?}` changes and saves those /// settings first. Agents can't change them: their requests run confined to the agent folders, and -/// widening those is the person's choice. +/// widening those is the person's choice. A control client started without automation roots can't +/// change them either. pub(crate) fn command(app: &mut VectorcraftApp, p: &Value) -> Result { + let automated = app.automation_is_acting() || file_access::current().is_some(); let Some(agents) = app.agents.as_mut() else { return Err("agents can't use this window: it keeps no preferences (VECTORCRAFT_NO_PREFS), or it is a nightly".into()); }; @@ -157,7 +159,7 @@ pub(crate) fn command(app: &mut VectorcraftApp, p: &Value) -> Result Date: Fri, 4 Dec 2026 12:21:49 -0800 Subject: [PATCH 5/9] MCP: answer_dialog's Save Changes answer drops the one-call failure claim The answer_dialog row in docs/mcp.md and the tool description still give Don't Save as two calls and say to give set and action in separate calls for this question. They no longer state that a single call sends a second confirm: that holds only while ui.dialog.set with an action replies without a dialog key, and the two-call sequence works either way. The conventions test no longer rejects the one-call form. --- crates/mcp/src/tests/conventions.rs | 1 - crates/mcp/src/tools/definitions.rs | 2 +- docs/mcp.md | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/mcp/src/tests/conventions.rs b/crates/mcp/src/tests/conventions.rs index 839c740ec1..216e6279ee 100644 --- a/crates/mcp/src/tests/conventions.rs +++ b/crates/mcp/src/tests/conventions.rs @@ -432,7 +432,6 @@ fn answer_dialog_describes_the_save_changes_answers() { assert!(description.contains(snippet), "answer_dialog's description is missing {snippet}: {description}"); } assert!(!description.contains("discard"), "the save-changes dialog takes choice, not discard: {description}"); - assert!(!description.contains(r#"value:"dontSave"}],action:"confirm"}"#), "Don't Save must confirm in a second call: {description}"); } #[test] diff --git a/crates/mcp/src/tools/definitions.rs b/crates/mcp/src/tools/definitions.rs index 63c3dadc05..9eb55a846f 100644 --- a/crates/mcp/src/tools/definitions.rs +++ b/crates/mcp/src/tools/definitions.rs @@ -314,7 +314,7 @@ pub fn tool_definitions() -> Vec { tool( "answer_dialog", "Answer dialog", - "Set fields of the desktop app's open dialog in order, then confirm (OK) or cancel it, as the control protocol's ui.dialog.set, ui.dialog.confirm and ui.dialog.cancel do. The app stores all the fields or none and answers that same dialog in the same request (ui.dialog.set with action). When the app refuses the ui.dialog.set, for example because no dialog is open, the call is an error and the dialog is not confirmed or canceled. inspect_ui shows the open dialog and its fields (ui.dialog). After invoke_menu app.quit, file.close or file.closeAll replies {\"pending\":\"saveChanges\"}: {action:\"confirm\"} saves, {set:[{field:\"choice\",value:\"dontSave\"}]} followed by a second call with {action:\"confirm\"} closes without saving, and {action:\"cancel\"} cancels the close or quit. choice takes save, dontSave or cancel; while more modified documents wait to be asked about, adding {field:\"applyToAll\",value:true} to set gives the same answer for each of them. Give set and action in separate calls for this question: in one call, answer_dialog sends a second confirm, which fails once the document has closed or answers the next document's question. The second call answers whichever dialog is open when it arrives. Returns {dialog, result}: the dialog after the fields were set, and the reply to confirm or cancel. Desktop app only.", + "Set fields of the desktop app's open dialog in order, then confirm (OK) or cancel it, as the control protocol's ui.dialog.set, ui.dialog.confirm and ui.dialog.cancel do. The app stores all the fields or none and answers that same dialog in the same request (ui.dialog.set with action). When the app refuses the ui.dialog.set, for example because no dialog is open, the call is an error and the dialog is not confirmed or canceled. inspect_ui shows the open dialog and its fields (ui.dialog). After invoke_menu app.quit, file.close or file.closeAll replies {\"pending\":\"saveChanges\"}: {action:\"confirm\"} saves, {set:[{field:\"choice\",value:\"dontSave\"}]} followed by a second call with {action:\"confirm\"} closes without saving, and {action:\"cancel\"} cancels the close or quit. choice takes save, dontSave or cancel; while more modified documents wait to be asked about, adding {field:\"applyToAll\",value:true} to set gives the same answer for each of them. Give set and action in separate calls for this question. The second call answers whichever dialog is open when it arrives. Returns {dialog, result}: the dialog after the fields were set, and the reply to confirm or cancel. Desktop app only.", obj( json!({ "set": { diff --git a/docs/mcp.md b/docs/mcp.md index b6ea0dc8a2..5f257f280a 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -818,7 +818,7 @@ ends the wait, so the sampler can be shown again. The BSDs and headless sessions | `set_paint` | `{fill?, stroke?, strokeWidth?, ids?}` | Applies to the selection (or `ids`) and becomes the default for new art. Returns `{applied, objects}`: `objects` is the number of objects painted, as the `objects` of the `paint.setFill`, `paint.setStroke` and `stroke.set` replies (the largest of them): a selected group counts the objects inside it. When it is 0, a `note` says that only the paint for new art changed. When some of those commands painted objects and others painted none (a fill while the Shape Builder is the active tool, say), `unpainted` lists the commands that painted none, with a `note`. | | `press_key` | `{key, mods?}` | Remote: a real key event. Headless: runs the command or tool bound to that shortcut, or sends the key to the busy tool (digits too: `5` while dragging with the Perspective Selection tool; `e` while dragging a Selection or Group Selection marquee; `c` and `f` while dragging out an arc; `f`, `v`, `x` and `c` while dragging out a rectangular or polar grid). | | `type_text` | `{text}` | Remote only. | -| `answer_dialog` | `{set?: [{field, value?}], action?}` | Remote only. Sets fields of the app's open dialog in the order given with one `ui.dialog.set {fields, action?}` (a missing `value` is `null`). The app stores all of them or none, then answers that same dialog with `action` in the same request: `confirm` (OK) or `cancel`. Another connection cannot open a dialog between the two steps. When the app refuses the `ui.dialog.set`, for example because no dialog is open, the call is an error and the dialog is not confirmed or canceled. `set` cannot change a `__` field other than the dialog's controls held under a `__` name (such as Save PDF's `__section` or the Preferences `__search`): the `__command` and `__params` of a `confirm` or `command` dialog, and every other `__` field that holds what OK acts on, are refused with "the `` dialog cannot set protected field ``", so OK runs what the dialog was opened for. `action` alone is sent as `ui.dialog.confirm` or `ui.dialog.cancel`. Give `set`, `action` or both; `set` holds at most 256 fields. `inspect_ui` shows the open dialog and its fields as `ui.dialog`. Returns `{dialog, result}`: the dialog after the fields were set (or `null`) and the reply to `confirm` or `cancel` (or `null`). After `invoke_menu` `app.quit`, `file.close` or `file.closeAll` replies `{"pending": "saveChanges"}`, `{action: "confirm"}` saves, `{set: [{field: "choice", value: "dontSave"}]}` followed by a second call with `{action: "confirm"}` closes without saving, and `{action: "cancel"}` cancels the close or quit. `choice` takes `save`, `dontSave` or `cancel`; while more modified documents wait to be asked about, adding `{field: "applyToAll", value: true}` to `set` gives the same answer for each of them. Give `set` and `action` in separate calls for this question: in one call, `answer_dialog` sends a second `confirm`, which fails once the document has closed or answers the next document's question. The second call answers whichever dialog is open when it arrives, so a dialog that another client or the user opens between the two calls is answered instead. | +| `answer_dialog` | `{set?: [{field, value?}], action?}` | Remote only. Sets fields of the app's open dialog in the order given with one `ui.dialog.set {fields, action?}` (a missing `value` is `null`). The app stores all of them or none, then answers that same dialog with `action` in the same request: `confirm` (OK) or `cancel`. Another connection cannot open a dialog between the two steps. When the app refuses the `ui.dialog.set`, for example because no dialog is open, the call is an error and the dialog is not confirmed or canceled. `set` cannot change a `__` field other than the dialog's controls held under a `__` name (such as Save PDF's `__section` or the Preferences `__search`): the `__command` and `__params` of a `confirm` or `command` dialog, and every other `__` field that holds what OK acts on, are refused with "the `` dialog cannot set protected field ``", so OK runs what the dialog was opened for. `action` alone is sent as `ui.dialog.confirm` or `ui.dialog.cancel`. Give `set`, `action` or both; `set` holds at most 256 fields. `inspect_ui` shows the open dialog and its fields as `ui.dialog`. Returns `{dialog, result}`: the dialog after the fields were set (or `null`) and the reply to `confirm` or `cancel` (or `null`). After `invoke_menu` `app.quit`, `file.close` or `file.closeAll` replies `{"pending": "saveChanges"}`, `{action: "confirm"}` saves, `{set: [{field: "choice", value: "dontSave"}]}` followed by a second call with `{action: "confirm"}` closes without saving, and `{action: "cancel"}` cancels the close or quit. `choice` takes `save`, `dontSave` or `cancel`; while more modified documents wait to be asked about, adding `{field: "applyToAll", value: true}` to `set` gives the same answer for each of them. Give `set` and `action` in separate calls for this question. The second call answers whichever dialog is open when it arrives, so a dialog that another client or the user opens between the two calls is answered instead. | | `invoke_menu` | `{command, params?}` | Invokes a menu item by command id. UI commands such as `view.*` and `window.*` are in `command_list` with `ui: true`; running them needs the desktop app (`--connect`). The app refuses `attributes.openUrl`, `file.export.svg.browser`, `file.saveForWeb.browser` and `file.showPackage` for every control and MCP request, since each opens another app, so the headless error for them does not suggest `--connect`. | | `open_panel` | `{panel}` | Remote only. `panel` is a panel id (`layers`, `swatches`, `colorGuide`, …, as `window.panel` takes) or its display label (`"Color Guide"`), in any case. | | `screenshot` | `{path?, scale?, artboard?, window?, max_side?, traceViews?}` | Returns MCP image content (`image/png`, base64) plus a text block. Renders the artboard with the pixels of a PNG `export` with `background: "white"` at the same scale; `traceViews:true` draws Image Trace objects in the view set with `imageTrace.setView`, as in the app's window; `window:true` captures the app window (remote only), as `ui_screenshot` does, and `max_side` (1–4096, window captures only) scales the returned image down as described for `ui_screenshot`. With `path` the backend (the headless session or the app) writes the PNG there too; a window capture written there keeps its full size with `max_side`. An app that does not send the image back writes a window capture without `path` to a file in a new folder inside the system's temporary folder (on Unix only the user can open it); the server reads the file and then removes the folder, also when the capture or the read fails. | From 6c314c4cd68ee5208689f2d4ef443612f5f3b16a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 4 Dec 2026 12:57:51 -0800 Subject: [PATCH 6/9] Docs: the control protocol gives Don't Save in one ui.dialog.set request ui.dialog.set with fields and action "confirm" sets choice (and applyToAll) and confirms the same Save Changes question in one request, so no other dialog is answered between the two. The control-protocol row now gives that form beside the two-request one, and the Save Changes test checks the line and sends both one-request forms through the control handler. --- crates/ui-egui/src/unsaved.rs | 22 ++++++++++++++++++++-- docs/control-protocol.md | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/unsaved.rs b/crates/ui-egui/src/unsaved.rs index 252f3cc8a5..5259c30efb 100644 --- a/crates/ui-egui/src/unsaved.rs +++ b/crates/ui-egui/src/unsaved.rs @@ -401,6 +401,7 @@ mod tests { const CONTROL_DONT_SAVE: &str = r#"`ui.dialog.set {field: "choice", value: "dontSave"}` then confirm"#; const CONTROL_APPLY_TO_ALL: &str = r#"`ui.dialog.set {field: "applyToAll", value: true}` before confirm"#; + const CONTROL_ONE_REQUEST: &str = r#"`ui.dialog.set {fields: [{field: "choice", value: "dontSave"}], action: "confirm"}`"#; const MCP_DONT_SAVE: &str = r#"`{set: [{field: "choice", value: "dontSave"}]}` followed by a second call with `{action: "confirm"}`"#; const MCP_APPLY_TO_ALL: &str = r#"adding `{field: "applyToAll", value: true}` to `set`"#; @@ -410,8 +411,12 @@ mod tests { #[test] fn the_documented_dont_save_answer_closes_without_saving() { for (name, text, snippets) in [ - ("docs/control-protocol.md", include_str!("../../../docs/control-protocol.md"), [CONTROL_DONT_SAVE, CONTROL_APPLY_TO_ALL]), - ("docs/mcp.md", include_str!("../../../docs/mcp.md"), [MCP_DONT_SAVE, MCP_APPLY_TO_ALL]), + ( + "docs/control-protocol.md", + include_str!("../../../docs/control-protocol.md"), + &[CONTROL_DONT_SAVE, CONTROL_APPLY_TO_ALL, CONTROL_ONE_REQUEST][..], + ), + ("docs/mcp.md", include_str!("../../../docs/mcp.md"), &[MCP_DONT_SAVE, MCP_APPLY_TO_ALL][..]), ] { // Check the requests on every line describing the pending Save Changes reply. let lines: Vec<_> = text.lines().filter(|line| line.contains(r#"{"pending": "saveChanges"}"#)).collect(); @@ -444,6 +449,19 @@ mod tests { ("ui.dialog.confirm", json!({})), ], ), + ( + "control protocol one request", + false, + vec![("ui.dialog.set", json!({ "fields": [{ "field": "choice", "value": "dontSave" }], "action": "confirm" }))], + ), + ( + "control protocol one request applyToAll", + true, + vec![( + "ui.dialog.set", + json!({ "fields": [{ "field": "choice", "value": "dontSave" }, { "field": "applyToAll", "value": true }], "action": "confirm" }), + )], + ), ( "MCP Don't Save", false, diff --git a/docs/control-protocol.md b/docs/control-protocol.md index 783c686f45..5b280ec8f8 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -107,7 +107,7 @@ the two can still win that race. | `ui.render` | `{path?, scale?, artboard?, data?, traceViews?}` | render an artboard headlessly (PNG with the pixels of `app.export {format: "png", background: "white"}` at the same scale; `artboard`: its 0-based index, default the first; `traceViews: true`: Image Trace objects draw in their View, as on the canvas, instead of their tracing result): written to `path`, else (or with `data: true` as well) sent back as `pngBase64` | | `ui.resize` | `{width?, height?}` | request the window's inner size; omitted or null `width` and `height` default to 1440 and 900. Returns `null` | | `ui.focus` | `{}` | request keyboard focus for the window. Returns `null` | -| `app.open` / `app.save` / `app.export` / `app.quit` | `{path, importer?, params?}` / `{path?}` / `{path?, format?, artboard?, range?, scale?, …}` | `app.open` reads every format `document.open` reads (see `document.formats`) and returns its result (`{index, title, format, warnings, …}`; `warnings` say what didn't come in as it was, such as an EPS shown as its preview image and why its PostScript couldn't be read), or null when a dialog asks first or a library loads. The status bar (`ui.inspect` → `ui.status`), after a line about the document's linked files when there is one (Missing linked files below), counts the `warnings` and names the first that says reading the file left something out (the notes that make Save ask before writing over it), else the first; with several, hovering it lists them in that order, as many as fit in the window (at most 30), then how many more. After `app.save`, and `app.export` with a `path`, the status bar counts the reply's `warnings` and names the first, and with several, hovering it lists them in the reply's order (a save's notes start with what the format loses). With `importer` (an importer plug-in's format id, `plugin.`) it runs `file.openWith`: the file opens with that importer, also when a built-in format reads its extension, with the importer's parameters `params` (their defaults when omitted; no dialog asks for them). Without `importer`, `params` go to the importer that opens the file, and a built-in format does not read them. `app.export` encodes through the engine's `document.export` (same options; the document keeps its path) and writes `path` through the host; without `path` it returns `{dataBase64, format, bytes}`, as headless mode does. It refuses a key that no format takes, and an unknown key inside a PDF or EPS option object, before it writes anything (`docs/mcp.md`, Parameter keys). It accepts a key that only another format takes and does not use it: the reply's `warnings` and the status bar name the key ("`quality` was not used: PDF files don't read it"). `app.save` refuses a key that no save format takes, beside the path or in `options`, the same way. `app.quit`, `file.close` and `file.closeAll` first open a `saveChanges` dialog for each modified document (they return `{"pending": "saveChanges"}`): `ui.dialog.confirm` saves, `ui.dialog.set {field: "choice", value: "dontSave"}` then confirm closes the document without saving, `ui.dialog.cancel` cancels the whole close or quit. `choice` takes `save`, `dontSave` or `cancel`, and any other field or value is an error. While more modified documents wait to be asked about, the dialog also has `applyToAll`: `ui.dialog.set {field: "applyToAll", value: true}` before confirm gives the same answer for each of them | +| `app.open` / `app.save` / `app.export` / `app.quit` | `{path, importer?, params?}` / `{path?}` / `{path?, format?, artboard?, range?, scale?, …}` | `app.open` reads every format `document.open` reads (see `document.formats`) and returns its result (`{index, title, format, warnings, …}`; `warnings` say what didn't come in as it was, such as an EPS shown as its preview image and why its PostScript couldn't be read), or null when a dialog asks first or a library loads. The status bar (`ui.inspect` → `ui.status`), after a line about the document's linked files when there is one (Missing linked files below), counts the `warnings` and names the first that says reading the file left something out (the notes that make Save ask before writing over it), else the first; with several, hovering it lists them in that order, as many as fit in the window (at most 30), then how many more. After `app.save`, and `app.export` with a `path`, the status bar counts the reply's `warnings` and names the first, and with several, hovering it lists them in the reply's order (a save's notes start with what the format loses). With `importer` (an importer plug-in's format id, `plugin.`) it runs `file.openWith`: the file opens with that importer, also when a built-in format reads its extension, with the importer's parameters `params` (their defaults when omitted; no dialog asks for them). Without `importer`, `params` go to the importer that opens the file, and a built-in format does not read them. `app.export` encodes through the engine's `document.export` (same options; the document keeps its path) and writes `path` through the host; without `path` it returns `{dataBase64, format, bytes}`, as headless mode does. It refuses a key that no format takes, and an unknown key inside a PDF or EPS option object, before it writes anything (`docs/mcp.md`, Parameter keys). It accepts a key that only another format takes and does not use it: the reply's `warnings` and the status bar name the key ("`quality` was not used: PDF files don't read it"). `app.save` refuses a key that no save format takes, beside the path or in `options`, the same way. `app.quit`, `file.close` and `file.closeAll` first open a `saveChanges` dialog for each modified document (they return `{"pending": "saveChanges"}`): `ui.dialog.confirm` saves, `ui.dialog.set {field: "choice", value: "dontSave"}` then confirm closes the document without saving, `ui.dialog.cancel` cancels the whole close or quit. `choice` takes `save`, `dontSave` or `cancel`, and any other field or value is an error. While more modified documents wait to be asked about, the dialog also has `applyToAll`: `ui.dialog.set {field: "applyToAll", value: true}` before confirm gives the same answer for each of them. `ui.dialog.set {fields: [{field: "choice", value: "dontSave"}], action: "confirm"}` answers the same question in one request, so no other dialog can be answered between the set and the confirm, and `{field: "applyToAll", value: true}` can go in the same `fields` | | `app.export` with `useArtboards` | `{path, useArtboards: true, range? \| artboards?, …}` | Export As: PNG, JPEG and WebP write one file per chosen artboard (default all; SVG does so for a `range`), `-.`, and return `{path, files: [path…]}`; a PDF keeps them as pages of `path`. `useArtboards: false` covers the bounds of the visible art. The menu's Export As… is `file.exportAs`: the `exportAs` dialog (`format`, `useArtboards`, `all`, `range`), then a save dialog and the format's options: `pngOptions` / `jpgOptions` / `webpOptions`, `svgOptions`, or `savePdf` for a PDF | | `ui.dialog.*` on `gradientStop` | `{field: "color" \| "opacity" \| "location", value}` | double-clicking a stop on the Gradient tool's annotator opens its popover (fields `index`, `x`, `y`, `tab`); set `color` (hex), `opacity` or `location` (percentages) and `ui.dialog.confirm` to apply them to the selected stop. `gradient.selectStop {index}` picks the stop the annotator, the panels and Delete/←/→ (`ui.key`) act on | | `engine.execute` `ui.savePdfDialog` | `{path?, preset?, range?, …document.exportPdf options}` | opens the Save PDF dialog (`file.export.pdf` with no params opens it too). Its fields are the `document.exportPdf` options: set `compatibility` with `ui.dialog.set {field: "compatibility", value: "1.5"}`, a section with `{field: "compression", value: {…}}` (the options it leaves out keep the dialog's values, in Save PDF and in the preset editor, and in an object inside a section such as `compression.color`; a value that isn't an object, null included, is an error), the artboards with `__allArtboards: false` and `range`, the visible section with `__section` (General, Compression, Marks and Bleeds, Output, Advanced, Security, Summary), and the bleed link with `__bleedLinked` (true gives every side the top value; any value other than true or false is an error; setting `bleed` turns the link on when its four sides are equal and off when they differ). In Advanced, Custom… beside Flattener preset (enabled when the file is flattened: PDF 1.3, PDF/X-1a, PDF/X-3) opens the `pdfFlattenerOptions` dialog over Save PDF on the flattener options the save would use; its fields are those options, with `clipComplexRegions`, `preserveAlpha` and `preserveOverprints` set by the writer and Overprint. Its `ui.dialog.confirm` sets `flattener` (the preset then shows [Custom]; options equal to the preset's leave it unset) and goes back to Save PDF, and `ui.dialog.cancel` goes back unchanged. Setting `flattenerPreset` drops `flattener`. `useArtboards: false` opens it for one page of the visible art's bounds, as Export As with Use Artboards off does: the dialog has no Artboards section and its `__artBounds` field is true. `ui.dialog.confirm` writes `path` (else asks for one), returns `{path, bytes, warnings}` and opens the file when `viewAfterSaving` is set. With `useArtboards: false` it writes the page as `app.export` does and returns `{path, warnings}`, or `{background: true, status}` while Background Export writes it | From a92e9610588b3f25c31ad9194ae63e7cfbdd37cd Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 4 Dec 2026 13:17:59 -0800 Subject: [PATCH 7/9] Docs: composite fonts that placed editable art brings, and their errors docs/mcp.md now says which composite fonts file.place and links.embed bring with editable art, when a placed font keeps its name, reuses an equal one or takes a free name, and quotes the errors that stop the placement before either document changes. --- docs/mcp.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/mcp.md b/docs/mcp.md index ee2d767223..a51225256b 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -11803,6 +11803,19 @@ clipping path when placed, linked, relinked, updated, or embedded. `file.place.i report CMYK for these images. VectorCraft's native CMYK limit is 67,108,864 pixels. Composites with transparency, images beyond that limit, and native samples beyond the allocation allowance use the RGB import path, subject to its allocation limit. Importing individual layers with `layers: true` retains its existing behavior. +Editable art that `file.place` places (with `link: false` or from `dataBase64`) and that `links.embed` embeds brings +the composite fonts its type and graph labels name, including those of the symbols, patterns and brushes it uses. +Placement first reuses an equal composite font with the same name (in any case) in the document, keeping its name. +Otherwise, a composite font whose name the document already uses (for a different composite font, a part of one, or a family its +type or styles name) or that an installed font has, joins under a free name such as "Name 2", unless the document +already has an equal definition under another name, which the placed art then uses; the placed art is renamed to +match. Before either document changes, the placement fails and changes nothing with one of these errors: "a document +keeps at most 256 composite fonts" (when the placed art uses more than 256, the document has more than 256, or more +than 256 remain after equal definitions are shared); "two incoming composite fonts are named ``"; "`` is +the name of an installed font"; "the composite fonts in the placed art and document cannot stand together"; "no free +name for a placed composite font"; or an error for an invalid definition as stored in the file, such as +"`` can't name a composite font", "a composite font keeps at most 64 character sets" or a part's size out of range. +Placement does not trim composite font or character set names as `type.compositeFonts.set` does. `file.place.info` describes a file without placing it and `image.info` reports a placed image's link, colour mode and effective ppi. `file.place.queue` loads the place cursor (the `place` tool) with several files: headless, drive it From 26f5b4ae5890226beb4453986b85ec505f1c45e8 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 4 Dec 2026 14:21:52 -0800 Subject: [PATCH 8/9] i18n: embed the interface language catalogs Brotli-compressed The 29 catalogs in crates/ui-egui/src/i18n were embedded with include_str!, 21,861,200 bytes of text in every build. build.rs now compresses each *.tsv with Brotli (quality 9, 4 MiB window) into OUT_DIR, and the interface unpacks them when it first needs its catalogs and hands them to I18n::from_owned. The embedded catalogs take 5,316,158 bytes. - build.rs finds the catalogs in the folder, so adding a language is adding its .tsv. A catalog over 8 MiB, or one it can't read, stops the build. - A catalog that does not unpack to exactly its recorded length of UTF-8 is left out and logged, and its language is not offered. - On the desktop the catalogs are unpacked on several threads. --- Cargo.lock | 2 + crates/ui-egui/Cargo.toml | 7 ++ crates/ui-egui/build.rs | 60 ++++++++++++++++ crates/ui-egui/src/i18n.rs | 118 ++++++++++++++++++++----------- crates/ui-egui/src/i18n/tests.rs | 66 +++++++++++++++-- 5 files changed, 208 insertions(+), 45 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b53df9115b..ff9dd65f3b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9272,6 +9272,8 @@ dependencies = [ name = "vectorcraft-ui-egui" version = "0.25.1" dependencies = [ + "brotli 9.1.3", + "brotli-decompressor 6.3.2", "bytemuck", "chrono", "craft", diff --git a/crates/ui-egui/Cargo.toml b/crates/ui-egui/Cargo.toml index fe411e7c59..8d5d5c4a18 100644 --- a/crates/ui-egui/Cargo.toml +++ b/crates/ui-egui/Cargo.toml @@ -74,6 +74,9 @@ craft-image-codecs = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } log = { workspace = true } +# Unpacks the interface language catalogs, which build.rs stores Brotli-compressed (src/i18n.rs). +# Pure Rust, builds for wasm32, and already in Cargo.lock through craft-i18n. +brotli-decompressor = { version = "6", default-features = false, features = ["std"] } # Floating panels open in OS windows of their own on the desktop; on the web they stay in the page. [target.'cfg(not(target_arch = "wasm32"))'.dependencies] @@ -110,10 +113,14 @@ vectorcraft-tools = { workspace = true, features = ["testing"] } vectorcraft-text = { workspace = true, features = ["test-fonts"] } vectorcraft-plugins = { workspace = true, features = ["test-steady"] } wat = { workspace = true } +# Compresses bad catalogs for the i18n unpacking tests. +brotli = { version = "9", default-features = false, features = ["std"] } [build-dependencies] serde_json = { workspace = true } toml = "1" +# Compresses the interface language catalogs (src/i18n/*.tsv); already in Cargo.lock through craft-i18n. +brotli = { version = "9", default-features = false, features = ["std"] } # The files of other crates that this crate's tests read, for CI's test selection. [package.metadata.craft] diff --git a/crates/ui-egui/build.rs b/crates/ui-egui/build.rs index 737032a551..13ee9170c6 100644 --- a/crates/ui-egui/build.rs +++ b/crates/ui-egui/build.rs @@ -6,12 +6,72 @@ //! JSON says the entry was verified (`people_entry`). //! //! A missing or malformed file gives empty tables (or no names) and a warning. +//! +//! Also compress the interface language catalogs, `src/i18n/*.tsv`, with Brotli into `OUT_DIR/i18n/`, +//! and write `i18n_catalogs.rs`, the table `src/i18n.rs` unpacks them from. A catalog that can't be +//! read or is larger than [`MAX_CATALOG_BYTES`] stops the build. use std::fmt::Write as _; +use std::io::Write as _; +use std::path::Path; use serde_json::Value; +/// The largest catalog embedded, in bytes; `src/i18n.rs` unpacks no more than this. +const MAX_CATALOG_BYTES: usize = 8 << 20; + fn main() { + if let Err(e) = pack_catalogs() { + println!("cargo::error=packing the interface language catalogs: {e}"); + } + credits(); +} + +/// Compress each `src/i18n/.tsv` to `OUT_DIR/i18n/.tsv.br` and list them, by code, in +/// `OUT_DIR/i18n_catalogs.rs` as `CATALOGS: &[(code, compressed text, text length in bytes)]`. +fn pack_catalogs() -> Result<(), String> { + let src = Path::new(env!("CARGO_MANIFEST_DIR")).join("src/i18n"); + println!("cargo::rerun-if-changed={}", src.display()); + let out = std::path::PathBuf::from(std::env::var_os("OUT_DIR").ok_or("OUT_DIR is not set")?); + let packed = out.join("i18n"); + std::fs::create_dir_all(&packed).map_err(|e| format!("{}: {e}", packed.display()))?; + let mut codes = Vec::new(); + for entry in std::fs::read_dir(&src).map_err(|e| format!("{}: {e}", src.display()))? { + let path = entry.map_err(|e| format!("{}: {e}", src.display()))?.path(); + if let (Some(code), Some("tsv")) = (path.file_stem().and_then(|s| s.to_str()), path.extension().and_then(|s| s.to_str())) { + codes.push(code.to_string()); + } + } + codes.sort(); + let mut table = String::from("const CATALOGS: &[(&str, &[u8], usize)] = &[\n"); + for code in codes { + let path = src.join(format!("{code}.tsv")); + println!("cargo::rerun-if-changed={}", path.display()); + let text = std::fs::read(&path).map_err(|e| format!("{}: {e}", path.display()))?; + if text.len() > MAX_CATALOG_BYTES { + return Err(format!("{} is {} bytes, over the {MAX_CATALOG_BYTES}-byte limit", path.display(), text.len())); + } + let mut compressed = Vec::new(); + { + // Quality 9, a 4 MiB window. + let mut encoder = brotli::CompressorWriter::new(&mut compressed, 4096, 9, 22); + encoder.write_all(&text).map_err(|e| format!("{}: {e}", path.display()))?; + } + let file = packed.join(format!("{code}.tsv.br")); + if std::fs::read(&file).ok().as_deref() != Some(compressed.as_slice()) { + std::fs::write(&file, &compressed).map_err(|e| format!("{}: {e}", file.display()))?; + } + let _ = writeln!(table, " ({code:?}, include_bytes!(concat!(env!(\"OUT_DIR\"), \"/i18n/{code}.tsv.br\")), {}),", text.len()); + } + table.push_str("];\n"); + let file = out.join("i18n_catalogs.rs"); + if std::fs::read_to_string(&file).is_ok_and(|old| old == table) { + return Ok(()); + } + std::fs::write(&file, table).map_err(|e| format!("{}: {e}", file.display())) +} + +fn credits() { let dir = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../../contributors"); let json = read(&dir.join("contributors.json"), "the About window shows no contributors", |t| { serde_json::from_str::(t).map_err(|e| e.to_string()) diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs index b515cb802e..ae38932b65 100644 --- a/crates/ui-egui/src/i18n.rs +++ b/crates/ui-egui/src/i18n.rs @@ -8,10 +8,10 @@ //! 1. Add `xx.tsv` next to `zh-hant.tsv` (copy its header; translate from the *meaning* of the //! English text, clean-room, see `zh-hant.tsv`), with an `@id` row `language.name` holding the //! language's name in itself. -//! 2. Add one entry to [`EMBEDDED`]. //! -//! That is all: the Preferences dropdown, the system-locale match, the catalog tests (parse, -//! placeholders, plural forms) and the untranslated report pick it up from the embedded list. +//! That is all: `build.rs` embeds every `*.tsv` in that folder, Brotli-compressed, and the +//! Preferences dropdown, the system-locale match, the catalog tests (parse, placeholders, plural +//! forms) and the untranslated report pick it up from the embedded list. //! //! # Looking strings up //! - [`t`] / the `tl!` macro: a plain string in the language the UI is drawn in. [`tr`] takes the @@ -31,53 +31,87 @@ // PLAN: crates/ui-egui/Cargo.toml needs `craft-i18n = { workspace = true }`; the manifest is not in // this set's Files table. use std::borrow::Cow; +use std::io::Read as _; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::{Arc, Mutex, OnceLock, PoisonError}; -use craft::i18n::{Embedded, I18n, fmt_plain}; +use craft::i18n::{I18n, fmt_plain}; pub use craft::i18n::Lang; -/// The catalogs of every language but English (the source language), by code. English is reserved -/// by `craft-i18n` and has no catalog. -static EMBEDDED: &Embedded = &[ - ("hi", "", include_str!("i18n/hi.tsv")), - ("gu", "", include_str!("i18n/gu.tsv")), - ("el", "", include_str!("i18n/el.tsv")), - ("ja", "", include_str!("i18n/ja.tsv")), - ("ko", "", include_str!("i18n/ko.tsv")), - ("vi", "", include_str!("i18n/vi.tsv")), - ("cs", "", include_str!("i18n/cs.tsv")), - ("bs", "", include_str!("i18n/bs.tsv")), - ("de", "", include_str!("i18n/de.tsv")), - ("es", "", include_str!("i18n/es.tsv")), - ("fr", "", include_str!("i18n/fr.tsv")), - ("it", "", include_str!("i18n/it.tsv")), - ("ka", "", include_str!("i18n/ka.tsv")), - ("ru", "", include_str!("i18n/ru.tsv")), - ("uk", "", include_str!("i18n/uk.tsv")), - ("bg", "", include_str!("i18n/bg.tsv")), - ("hu", "", include_str!("i18n/hu.tsv")), - ("pl", "", include_str!("i18n/pl.tsv")), - ("sv", "", include_str!("i18n/sv.tsv")), - ("pt-br", "", include_str!("i18n/pt-br.tsv")), - ("zh-hant", "", include_str!("i18n/zh-hant.tsv")), - ("zh-hans", "", include_str!("i18n/zh-hans.tsv")), - ("nl", "", include_str!("i18n/nl.tsv")), - ("da", "", include_str!("i18n/da.tsv")), - ("id", "", include_str!("i18n/id.tsv")), - ("fi", "", include_str!("i18n/fi.tsv")), - ("tr", "", include_str!("i18n/tr.tsv")), - ("ca", "", include_str!("i18n/ca.tsv")), - ("ar", "", include_str!("i18n/ar.tsv")), -]; +// The catalogs of every language but English (the source language), by code: `CATALOGS`, each +// `(code, Brotli-compressed text, text length in bytes)`, which `build.rs` writes from `i18n/*.tsv`. +// English is reserved by `craft-i18n` and has no catalog. +include!(concat!(env!("OUT_DIR"), "/i18n_catalogs.rs")); -/// The codes of [`EMBEDDED`] the interface offers. Browsers cannot use the native installed-font +/// The largest catalog [`unpack`] returns, in bytes (`build.rs` embeds none larger). +const MAX_CATALOG_BYTES: usize = 8 << 20; + +/// A catalog's text from its compressed bytes, which must unpack to exactly `len` bytes of UTF-8. +fn unpack(packed: &[u8], len: usize) -> Result { + if len > MAX_CATALOG_BYTES { + return Err(format!("{len} bytes is over the {MAX_CATALOG_BYTES}-byte limit")); + } + let mut text = Vec::new(); + text.try_reserve_exact(len).map_err(|e| e.to_string())?; + brotli_decompressor::Decompressor::new(packed, 4096).take(len as u64 + 1).read_to_end(&mut text).map_err(|e| e.to_string())?; + if text.len() != len { + return Err(format!("unpacked {} bytes instead of {len}", text.len())); + } + String::from_utf8(text).map_err(|e| e.to_string()) +} + +/// The embedded catalogs unpacked, as `I18n::from_owned` takes them: (code, shared catalog (none), +/// the app's catalog). A catalog that can't be unpacked is left out and comes back as a problem. +fn catalogs() -> (Vec<(String, String, String)>, Vec) { + unpack_catalogs(CATALOGS) +} + +/// [`catalogs`] for the given `(code, compressed text, text length)` list; on the desktop the +/// catalogs are unpacked on several threads. +fn unpack_catalogs(list: &[(&str, &[u8], usize)]) -> (Vec<(String, String, String)>, Vec) { + let unpack_all = + |piece: &[(&str, &[u8], usize)]| piece.iter().map(|&(code, packed, len)| (code.to_string(), unpack(packed, len))).collect::>(); + #[cfg(not(target_arch = "wasm32"))] + let unpacked = { + let threads = std::thread::available_parallelism().map_or(1, usize::from).min(16); + let per = list.len().div_ceil(threads).max(1); + std::thread::scope(|scope| { + // A piece whose thread can't be started is unpacked on this one. + let pieces: Vec<_> = list + .chunks(per) + .map(|piece| (piece, std::thread::Builder::new().name("i18n-unpack".into()).spawn_scoped(scope, move || unpack_all(piece)).ok())) + .collect(); + let stopped = + |piece: &[(&str, &[u8], usize)]| piece.iter().map(|&(code, ..)| (code.to_string(), Err("unpacking stopped".to_string()))).collect(); + pieces + .into_iter() + .flat_map(|(piece, handle)| match handle { + Some(handle) => handle.join().unwrap_or_else(|_| stopped(piece)), + None => unpack_all(piece), + }) + .collect::>() + }) + }; + #[cfg(target_arch = "wasm32")] + let unpacked = unpack_all(list); + let mut texts = Vec::with_capacity(unpacked.len()); + let mut problems = Vec::new(); + for (code, text) in unpacked { + match text { + Ok(text) => texts.push((code, String::new(), text)), + Err(e) => problems.push(format!("{code}: the embedded catalog can't be unpacked ({e}); skipped")), + } + } + (texts, problems) +} + +/// The codes of [`CATALOGS`] the interface offers. Browsers cannot use the native installed-font /// fallback, so on the web a language whose text would be missing-glyph boxes (Gujarati without a /// Gujarati face, see [`has_gujarati_face`]) is not offered, including when restoring a preference. /// Arabic is kept unavailable to users until the shared catalog in `storytold/craft-i18n` is consumed. fn offered_codes(web: bool, gujarati_font: bool) -> Vec<&'static str> { - EMBEDDED.iter().map(|(code, ..)| *code).filter(|code| *code != "ar" && (*code != "gu" || !web || gujarati_font)).collect() + CATALOGS.iter().map(|(code, ..)| *code).filter(|code| *code != "ar" && (*code != "gu" || !web || gujarati_font)).collect() } /// Whether the interface has a Gujarati face: an embedded craft-fonts face, or on the web a face @@ -96,12 +130,14 @@ fn has_gujarati_face_in<'a>(embedded: &[vectorcraft_text::EmbeddedFace], mut ser embedded.iter().any(|f| f.has_script("Gujr")) || served.any(|scripts| scripts.contains(&"Gujr")) } -/// The one catalog set of the process, built on first use. +/// The one catalog set of the process, built on first use, which is when the catalogs are unpacked. fn shared_cell() -> &'static Arc { static SHARED: OnceLock> = OnceLock::new(); SHARED.get_or_init(|| { let offered = offered_codes(cfg!(target_arch = "wasm32"), has_gujarati_face()); - let (i18n, problems) = I18n::new(EMBEDDED, &offered); + let (texts, mut problems) = catalogs(); + let (i18n, built) = I18n::from_owned(texts, &offered); + problems.extend(built); for problem in problems { log::warn!("vectorcraft: interface language catalog: {problem}"); } diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index b3910b0442..dc975ab371 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -12,6 +12,64 @@ fn translated() -> Vec { Lang::all().filter(|l| l.complete_menus()).collect() } +/// The embedded catalogs unpacked, as `I18n::from_owned` takes them; every one must unpack. +fn unpacked() -> Vec<(String, String, String)> { + let (texts, problems) = catalogs(); + assert!(problems.is_empty(), "{problems:?}"); + texts +} + +/// The embedded entry of `code`: (code, compressed text, text length). +fn packed(code: &str) -> (&'static str, &'static [u8], usize) { + CATALOGS.iter().copied().find(|c| c.0 == code).unwrap_or_else(|| panic!("{code} embedded")) +} + +/// A catalog is embedded compressed and unpacks to its source file byte for byte. +#[test] +fn embedded_catalogs_are_compressed_and_unpack_to_their_source() { + for code in ["de", "ja"] { + let (_, bytes, len) = packed(code); + let source = std::fs::read_to_string(format!("{}/src/i18n/{code}.tsv", env!("CARGO_MANIFEST_DIR"))).unwrap(); + assert_eq!(len, source.len(), "{code}"); + assert!(bytes.len() * 2 < len, "{code}: {} bytes embedded for {len}", bytes.len()); + assert_eq!(unpack(bytes, len).as_deref(), Ok(source.as_str()), "{code}"); + } +} + +/// Bytes that do not unpack to exactly the recorded length of UTF-8 text, or a length over the +/// limit, give an error instead of a catalog. +#[test] +fn unpacking_rejects_a_catalog_that_does_not_match_its_record() { + use std::io::Write as _; + let (_, bytes, len) = packed("de"); + assert!(unpack(bytes, len - 1).is_err(), "more text than recorded"); + assert!(unpack(bytes, len + 1).is_err(), "less text than recorded"); + assert!(unpack(&bytes[..bytes.len() / 2], len).is_err(), "cut short"); + assert!(unpack(b"not a catalog", 13).is_err(), "not Brotli"); + let over = unpack(bytes, MAX_CATALOG_BYTES + 1).unwrap_err(); + assert!(over.contains("limit"), "{over}"); + let mut not_utf8 = Vec::new(); + { + let mut encoder = brotli::CompressorWriter::new(&mut not_utf8, 4096, 9, 22); + encoder.write_all(&[b'a', 0xff, b'b']).unwrap(); + } + assert!(unpack(¬_utf8, 3).is_err(), "not UTF-8"); +} + +/// A catalog that does not unpack is left out and reported, so its language is not offered; the +/// others keep their order and load. +#[test] +fn a_catalog_that_does_not_unpack_is_left_out_and_reported() { + let (texts, problems) = unpack_catalogs(&[packed("de"), ("fr", b"not a catalog", 13), packed("ja")]); + assert_eq!(texts.iter().map(|t| t.0.as_str()).collect::>(), ["de", "ja"]); + assert_eq!(problems.len(), 1, "{problems:?}"); + assert!(problems[0].starts_with("fr: "), "{problems:?}"); + let (i18n, _) = I18n::from_owned(texts, &["de", "fr", "ja"]); + assert_eq!(i18n.from_code("fr"), None); + let de = i18n.from_code("de").unwrap(); + assert_ne!(i18n.t(de, "Layers"), "Layers"); +} + /// (language, context, English source, the term the language's glossary gives it). One row per /// rule: a term for a concept, a punctuation mark's typography. const TERMS: &[(&str, &str, &str, &str)] = &[ @@ -148,7 +206,7 @@ fn messages_translate_in_every_complete_language() { #[test] fn gujarati_web_selection_requires_a_bundled_interface_font() { let codes = |web, font| { - let (i18n, problems) = I18n::new(EMBEDDED, &offered_codes(web, font)); + let (i18n, problems) = I18n::from_owned(unpacked(), &offered_codes(web, font)); assert!(problems.is_empty(), "{problems:?}"); i18n.languages().into_iter().map(|l| i18n.code(l).to_string()).collect::>() }; @@ -199,7 +257,7 @@ fn arabic_is_preparatory_and_unavailable_to_users() { #[test] fn arabic_plural_rule_and_catalog_infrastructure() { - let (i18n, problems) = I18n::new(EMBEDDED, &["ar"]); + let (i18n, problems) = I18n::from_owned(unpacked(), &["ar"]); assert!(problems.is_empty(), "{problems:?}"); let ar = i18n.from_code("ar").expect("ar offered in custom instance"); assert_eq!(i18n.name(ar), "العربية"); @@ -236,7 +294,7 @@ fn a_language_set_by_another_test_leaves_this_one_in_english() { fn bundled_catalogs_are_consistent() { let problems = shared().check_all(); assert!(problems.is_empty(), "{problems:#?}"); - for (code, _, app) in EMBEDDED { + for (code, _, app) in unpacked() { for line in app.lines() { let mut columns = line.split('\t'); let (Some("@id"), Some(id)) = (columns.next(), columns.next()) else { continue }; @@ -275,7 +333,7 @@ fn unescaped(column: &str) -> String { #[test] fn message_translations_keep_their_english_edges() { let mut wrong = Vec::new(); - for (code, _, catalog) in EMBEDDED { + for (code, _, catalog) in unpacked() { for line in catalog.lines() { let mut columns = line.splitn(3, '\t'); let (Some(ctx @ ("@msg" | "@msgplural")), Some(src), Some(tr)) = (columns.next(), columns.next(), columns.next()) else { continue }; From 6c28ad2390c938258fd9b200843ee0c81f6f8ddf Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 4 Dec 2026 15:28:40 -0800 Subject: [PATCH 9/9] Docs: composite font placement errors apply only when the placed art uses one file.place checks the composite fonts only when the placed art uses a composite font that its file defines. --- docs/mcp.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/mcp.md b/docs/mcp.md index a51225256b..7fbad35bbc 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -11809,7 +11809,8 @@ Placement first reuses an equal composite font with the same name (in any case) Otherwise, a composite font whose name the document already uses (for a different composite font, a part of one, or a family its type or styles name) or that an installed font has, joins under a free name such as "Name 2", unless the document already has an equal definition under another name, which the placed art then uses; the placed art is renamed to -match. Before either document changes, the placement fails and changes nothing with one of these errors: "a document +match. When the placed art uses a composite font that its file defines, these checks run before either document +changes, and the placement fails and changes nothing with one of these errors: "a document keeps at most 256 composite fonts" (when the placed art uses more than 256, the document has more than 256, or more than 256 remain after equal definitions are shared); "two incoming composite fonts are named ``"; "`` is the name of an installed font"; "the composite fonts in the placed art and document cannot stand together"; "no free