From 919970a4678e9c535730076c0640b99ec2d77e0d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 17 Oct 2026 04:21:06 -0700 Subject: [PATCH] Export for Screens: exports warn when an image couldn't be decoded or a font is missing Export for Screens wrote each file with fileio::encode, which drops the encoder's warnings, and its replies had no `warnings` key. When the art held an image that the renderer could not decode, or type in a font that is not installed, the files lacked the image or used the fallback font, and neither the reply nor the status bar said so. document.export returns the same notes in `warnings`, and Export As shows the first in the status bar. document.exportForScreens and assets.export now collect the warnings of every file they export, each once, and every reply carries them in `warnings`. The export still writes or returns every file. When there are warnings, the Export for Screens dialog and the Asset Export panel show the first in the status bar as Save As shows a save's notes. Docs: docs/mcp.md (Export for Screens), docs/control-protocol.md. --- crates/engine/src/cmd/fileio/mod.rs | 2 +- crates/engine/src/cmd/fileio/screens.rs | 29 ++++++++++---- crates/engine/src/cmd/fileio/tests_screens.rs | 39 +++++++++++++++++++ crates/ui-egui/src/dialogs/tests_screens.rs | 37 ++++++++++++++++++ crates/ui-egui/src/io.rs | 22 +++++++++-- docs/control-protocol.md | 2 +- docs/mcp.md | 4 +- 7 files changed, 121 insertions(+), 14 deletions(-) diff --git a/crates/engine/src/cmd/fileio/mod.rs b/crates/engine/src/cmd/fileio/mod.rs index 64d000b37..7b1e170c9 100644 --- a/crates/engine/src/cmd/fileio/mod.rs +++ b/crates/engine/src/cmd/fileio/mod.rs @@ -142,7 +142,7 @@ pub fn specs() -> Vec { "Export for Screens", ["File", "Export"], None, - "{folder?, zip?: false (one store-only .zip of every file: no folder → {name, dataBase64, bytes, files: [name…]}; with a folder it is written there → {path, bytes, files}), artboards?: [index…] | range?: \"1-3\" (default all), assets?: [asset id…] (instead of artboards: each asset's art alone, cropped to its bounds and named after the asset; see assets.list), layers?: [layer id…] (instead of artboards: each layer's art alone, sublayers included, named after the layer), selection?: one|each (instead of artboards: the selected art as one file, or a file per selected object, named after it), fullDocument?: false (one file per format instead: a PDF of every artboard, other formats the bounds of all visible art, named after the document), includeBleed?: false (artboards grown by the document's bleed), exportPreset?: (a preset of document.exportPresets.list: its settings, under these params), subfolders?: false (each row's files in a sub-folder: its folder, else its size for raster (1x, 2x, 100w…) or its format (SVG, PDF)), folders?: none|rows (as subfolders)|format (a folder per extension: png, svg, pdf…)|item (a folder per artboard, asset, layer or object)|itemFormat (item/extension) (default: rows with subfolders or a preset, else none), name?: (a file name pattern instead of the item's name, with for the document, for the artboard, asset, layer or object, from 1, #### for the counter zero-padded to the run of #, , , (else the row's suffix ends the name), YYYYMMDD, YYYY-MM-DD, YYYY, ,