Compare commits

..
Author SHA1 Message Date
autocraft-bot[bot] 20fadf402e Merge main (5073f8e7) into the pull request
Resolved the merge in crates/layout/src/display.rs and crates/layout/src

Resolved the merge in crates/layout/src/display.rs and crates/layout/src/tests.rs. The default branch had moved the display code into display/lines.rs, so I took its side in display.rs and carried the PR's change over to display/lines.rs. A new line_text_extent helper sizes the highlight, shading and comment-background fills by the caret metrics instead of the full line height. In tests.rs I kept both the PR's selection_and_highlight_height_ignore_line_spacing test and the default branch's tests. cargo fmt --check and clippy on the layout crate are clean and the PR's test passes. I did not run the full layout test suite.
2026-12-04 00:30:37 +00:00
Divyanshu Gupta 2f4da4a96f fix(layout): preserve line bounds for character border boxes
Keep character borders on line top and bottom as expected by character_border_draws_one_box_around_run while scoping font-metric bounds to selection and highlight.
2026-10-21 22:15:18 +05:30
Divyanshu Gupta 34560d6cd2 fix(layout): size text selection and highlight by font instead of line spacing
Fixes #3468
2026-10-21 21:46:50 +05:30
19 changed files with 378 additions and 828 deletions
Generated
+115 -115
View File
@@ -1173,7 +1173,7 @@ dependencies = [
[[package]]
name = "craft"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-automation",
"craft-behavior",
@@ -1214,7 +1214,7 @@ dependencies = [
[[package]]
name = "craft-appkit"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"block2 0.6.2",
"objc2 0.6.5",
@@ -1226,7 +1226,7 @@ dependencies = [
[[package]]
name = "craft-atomic"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"rustix 1.1.6",
]
@@ -1234,7 +1234,7 @@ dependencies = [
[[package]]
name = "craft-automation"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"base64 0.23.1",
"craft-behavior",
@@ -1259,7 +1259,7 @@ dependencies = [
[[package]]
name = "craft-behavior"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"accesskit",
"bitflags 2.13.2",
@@ -1277,7 +1277,7 @@ dependencies = [
[[package]]
name = "craft-browse"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-behavior",
"craft-docpath",
@@ -1295,12 +1295,12 @@ dependencies = [
[[package]]
name = "craft-cfb"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
[[package]]
name = "craft-cloud-ui"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"egui",
]
@@ -1308,7 +1308,7 @@ dependencies = [
[[package]]
name = "craft-cms"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"md-5",
"rayon",
@@ -1317,12 +1317,12 @@ dependencies = [
[[package]]
name = "craft-codepage"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
[[package]]
name = "craft-color"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"serde",
]
@@ -1330,7 +1330,7 @@ dependencies = [
[[package]]
name = "craft-color-ui"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-behavior",
"craft-cms",
@@ -1350,7 +1350,7 @@ dependencies = [
[[package]]
name = "craft-control"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-control-protocol",
"craft-platform",
@@ -1361,7 +1361,7 @@ dependencies = [
[[package]]
name = "craft-control-protocol"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"getrandom 0.3.4",
"serde_json",
@@ -1371,7 +1371,7 @@ dependencies = [
[[package]]
name = "craft-dds"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"rayon",
]
@@ -1379,7 +1379,7 @@ dependencies = [
[[package]]
name = "craft-dialogs"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"block2 0.6.2",
"craft-appkit",
@@ -1405,7 +1405,7 @@ dependencies = [
[[package]]
name = "craft-doc-binary"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"chrono",
"craft-cfb",
@@ -1422,7 +1422,7 @@ dependencies = [
[[package]]
name = "craft-docpath"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"serde",
]
@@ -1430,7 +1430,7 @@ dependencies = [
[[package]]
name = "craft-docx"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"base64 0.23.1",
"chrono",
@@ -1450,7 +1450,7 @@ dependencies = [
[[package]]
name = "craft-draw"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-behavior",
"craft-color-ui",
@@ -1469,7 +1469,7 @@ dependencies = [
[[package]]
name = "craft-drawingml"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"chrono",
"craft-xml",
@@ -1481,7 +1481,7 @@ dependencies = [
[[package]]
name = "craft-flow"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-wordmodel",
"image",
@@ -1491,7 +1491,7 @@ dependencies = [
[[package]]
name = "craft-font-catalog"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"fontique",
"harfrust 0.13.3",
@@ -1506,7 +1506,7 @@ dependencies = [
[[package]]
name = "craft-font-manager"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-behavior",
"craft-font-catalog",
@@ -1525,7 +1525,7 @@ dependencies = [
[[package]]
name = "craft-font-os-windows"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"windows-registry",
"windows-sys 0.61.2",
@@ -1534,7 +1534,7 @@ dependencies = [
[[package]]
name = "craft-font-store"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"cap-primitives",
"craft-atomic",
@@ -1557,7 +1557,7 @@ dependencies = [
[[package]]
name = "craft-font-subset"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"brotli 9.1.3",
"harfbuzz-subset-sys",
@@ -1570,7 +1570,7 @@ dependencies = [
[[package]]
name = "craft-fonts-build"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-font-subset",
]
@@ -1578,7 +1578,7 @@ dependencies = [
[[package]]
name = "craft-gpu"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"egui-wgpu",
"log",
@@ -1590,7 +1590,7 @@ dependencies = [
[[package]]
name = "craft-host"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"bitflags 2.13.2",
"craft-i18n",
@@ -1603,7 +1603,7 @@ dependencies = [
[[package]]
name = "craft-html"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-codepage",
"craft-flow",
@@ -1616,7 +1616,7 @@ dependencies = [
[[package]]
name = "craft-i18n"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"brotli 9.1.3",
"brotli-decompressor 6.3.1",
@@ -1646,7 +1646,7 @@ dependencies = [
[[package]]
name = "craft-image-codecs"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-dds",
"craft-jpeg",
@@ -1673,7 +1673,7 @@ dependencies = [
[[package]]
name = "craft-imaging"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-behavior",
"craft-color-ui",
@@ -1691,7 +1691,7 @@ dependencies = [
[[package]]
name = "craft-jpeg"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"thiserror 2.0.21",
]
@@ -1699,7 +1699,7 @@ dependencies = [
[[package]]
name = "craft-keymap"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-host",
"craft-i18n",
@@ -1714,7 +1714,7 @@ dependencies = [
[[package]]
name = "craft-latex"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-flow",
"craft-math",
@@ -1725,7 +1725,7 @@ dependencies = [
[[package]]
name = "craft-markdown"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-flow",
"craft-html",
@@ -1735,7 +1735,7 @@ dependencies = [
[[package]]
name = "craft-math"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-xml",
"roxmltree",
@@ -1745,7 +1745,7 @@ dependencies = [
[[package]]
name = "craft-mcp-server"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"serde_json",
]
@@ -1753,7 +1753,7 @@ dependencies = [
[[package]]
name = "craft-menu"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-behavior",
"craft-host",
@@ -1771,7 +1771,7 @@ dependencies = [
[[package]]
name = "craft-metadata"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"brotli-decompressor 6.3.1",
"chrono",
@@ -1783,7 +1783,7 @@ dependencies = [
[[package]]
name = "craft-metafile"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"encoding_rs",
"image",
@@ -1794,7 +1794,7 @@ dependencies = [
[[package]]
name = "craft-mime"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"chardetng",
"chrono",
@@ -1805,7 +1805,7 @@ dependencies = [
[[package]]
name = "craft-nightly"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"uds_windows",
"winsafe",
@@ -1814,7 +1814,7 @@ dependencies = [
[[package]]
name = "craft-odf"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"aes",
"base64 0.23.1",
@@ -1840,7 +1840,7 @@ dependencies = [
[[package]]
name = "craft-ods"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-odf",
"craft-sheet",
@@ -1851,7 +1851,7 @@ dependencies = [
[[package]]
name = "craft-offcrypto"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"aes",
"base64 0.23.1",
@@ -1868,7 +1868,7 @@ dependencies = [
[[package]]
name = "craft-opc"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-xml",
"craft-zip",
@@ -1879,7 +1879,7 @@ dependencies = [
[[package]]
name = "craft-pages"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-behavior",
"craft-keymap",
@@ -1895,7 +1895,7 @@ dependencies = [
[[package]]
name = "craft-pdf"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"krilla",
"serde",
@@ -1905,7 +1905,7 @@ dependencies = [
[[package]]
name = "craft-platform"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"arboard",
"async-channel",
@@ -1943,7 +1943,7 @@ dependencies = [
[[package]]
name = "craft-print"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-behavior",
"craft-host",
@@ -1967,7 +1967,7 @@ dependencies = [
[[package]]
name = "craft-proof"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"log",
"miniz_oxide 0.9.1",
@@ -1978,7 +1978,7 @@ dependencies = [
[[package]]
name = "craft-quit"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"dispatch2",
"egui",
@@ -1991,7 +1991,7 @@ dependencies = [
[[package]]
name = "craft-review"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"base64 0.23.1",
"craft-behavior",
@@ -2010,7 +2010,7 @@ dependencies = [
[[package]]
name = "craft-rtf"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-codepage",
"craft-flow",
@@ -2023,7 +2023,7 @@ dependencies = [
[[package]]
name = "craft-settings"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-atomic",
"craft-host",
@@ -2040,17 +2040,17 @@ dependencies = [
[[package]]
name = "craft-sheet"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
[[package]]
name = "craft-ssip"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
[[package]]
name = "craft-svg"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-xml",
"flate2",
@@ -2067,7 +2067,7 @@ dependencies = [
[[package]]
name = "craft-table"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-behavior",
"craft-keymap",
@@ -2079,7 +2079,7 @@ dependencies = [
[[package]]
name = "craft-text"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-behavior",
"craft-host",
@@ -2103,7 +2103,7 @@ dependencies = [
[[package]]
name = "craft-theme"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"bitflags 2.13.2",
"craft-tracked",
@@ -2118,7 +2118,7 @@ dependencies = [
[[package]]
name = "craft-theme-store"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-atomic",
"craft-behavior",
@@ -2133,7 +2133,7 @@ dependencies = [
[[package]]
name = "craft-tiff"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"serde",
"thiserror 2.0.21",
@@ -2143,7 +2143,7 @@ dependencies = [
[[package]]
name = "craft-time"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"serde",
"thiserror 2.0.21",
@@ -2152,7 +2152,7 @@ dependencies = [
[[package]]
name = "craft-timeline"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-behavior",
"craft-keymap",
@@ -2167,12 +2167,12 @@ dependencies = [
[[package]]
name = "craft-tracked"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
[[package]]
name = "craft-ui"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-cloud-ui",
"craft-ui-canvas",
@@ -2186,7 +2186,7 @@ dependencies = [
[[package]]
name = "craft-ui-canvas"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-behavior",
"craft-font-catalog",
@@ -2203,7 +2203,7 @@ dependencies = [
[[package]]
name = "craft-ui-contract"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"accesskit",
"craft-behavior",
@@ -2241,7 +2241,7 @@ dependencies = [
[[package]]
name = "craft-ui-macros"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@@ -2252,7 +2252,7 @@ dependencies = [
[[package]]
name = "craft-ui-panels"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-behavior",
"craft-host",
@@ -2270,7 +2270,7 @@ dependencies = [
[[package]]
name = "craft-ui-patterns"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-behavior",
"craft-host",
@@ -2291,7 +2291,7 @@ dependencies = [
[[package]]
name = "craft-ui-shell"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-behavior",
"craft-host",
@@ -2312,7 +2312,7 @@ dependencies = [
[[package]]
name = "craft-ui-test-kit"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-behavior",
"craft-host",
@@ -2323,7 +2323,7 @@ dependencies = [
[[package]]
name = "craft-ui-widgets"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-behavior",
"craft-host",
@@ -2342,7 +2342,7 @@ dependencies = [
[[package]]
name = "craft-update"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"base64 0.22.1",
"chrono",
@@ -2374,7 +2374,7 @@ dependencies = [
[[package]]
name = "craft-web-api"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"js-sys",
"serde_json",
@@ -2385,7 +2385,7 @@ dependencies = [
[[package]]
name = "craft-web-host"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-host",
"craft-platform",
@@ -2397,7 +2397,7 @@ dependencies = [
[[package]]
name = "craft-win32"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"winsafe",
]
@@ -2405,7 +2405,7 @@ dependencies = [
[[package]]
name = "craft-window"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-appkit",
"craft-atomic",
@@ -2437,7 +2437,7 @@ dependencies = [
[[package]]
name = "craft-wordmodel"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"base64 0.23.1",
"craft-math",
@@ -2451,7 +2451,7 @@ dependencies = [
[[package]]
name = "craft-xls"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-cfb",
"craft-sheet",
@@ -2464,7 +2464,7 @@ dependencies = [
[[package]]
name = "craft-xlsx"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"craft-drawingml",
"craft-opc",
@@ -2476,7 +2476,7 @@ dependencies = [
[[package]]
name = "craft-xml"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"quick-xml 0.41.0",
"serde",
@@ -2486,7 +2486,7 @@ dependencies = [
[[package]]
name = "craft-zip"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"flate2",
"thiserror 2.0.21",
@@ -3866,7 +3866,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a"
[[package]]
name = "hayro-cmap"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"brotli 8.0.4",
"hayro-postscript",
@@ -3875,7 +3875,7 @@ dependencies = [
[[package]]
name = "hayro-interpret"
version = "0.7.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"bitflags 2.13.2",
"hayro-cmap",
@@ -3893,7 +3893,7 @@ dependencies = [
[[package]]
name = "hayro-jbig2"
version = "0.3.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"fearless_simd",
"hayro-ccitt",
@@ -3911,12 +3911,12 @@ dependencies = [
[[package]]
name = "hayro-postscript"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
[[package]]
name = "hayro-syntax"
version = "0.7.2"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"flate2",
"hayro-ccitt",
@@ -4645,7 +4645,7 @@ dependencies = [
[[package]]
name = "krilla"
version = "0.8.2"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"base64 0.22.1",
"bumpalo",
@@ -4784,7 +4784,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4"
[[package]]
name = "linesweeper"
version = "0.5.0"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
dependencies = [
"arrayvec",
"kurbo",
@@ -9118,7 +9118,7 @@ dependencies = [
[[package]]
name = "wordcraft"
version = "0.20.1"
version = "0.18.1"
dependencies = [
"craft",
"craft-nightly",
@@ -9145,7 +9145,7 @@ dependencies = [
[[package]]
name = "wordcraft-cli"
version = "0.20.1"
version = "0.18.1"
dependencies = [
"craft-zip",
"image",
@@ -9163,11 +9163,11 @@ dependencies = [
[[package]]
name = "wordcraft-control-key"
version = "0.20.1"
version = "0.18.1"
[[package]]
name = "wordcraft-doc"
version = "0.20.1"
version = "0.18.1"
dependencies = [
"base64 0.23.1",
"craft-codepage",
@@ -9183,7 +9183,7 @@ dependencies = [
[[package]]
name = "wordcraft-docbin"
version = "0.20.1"
version = "0.18.1"
dependencies = [
"cfb",
"craft-doc-binary",
@@ -9195,7 +9195,7 @@ dependencies = [
[[package]]
name = "wordcraft-docx"
version = "0.20.1"
version = "0.18.1"
dependencies = [
"base64 0.23.1",
"cfb",
@@ -9214,7 +9214,7 @@ dependencies = [
[[package]]
name = "wordcraft-engine"
version = "0.20.1"
version = "0.18.1"
dependencies = [
"cfb",
"chrono",
@@ -9252,7 +9252,7 @@ dependencies = [
[[package]]
name = "wordcraft-fonts"
version = "0.20.1"
version = "0.18.1"
dependencies = [
"brotli-decompressor 5.0.3",
"harfrust 0.13.3",
@@ -9267,7 +9267,7 @@ dependencies = [
[[package]]
name = "wordcraft-formats"
version = "0.20.1"
version = "0.18.1"
dependencies = [
"chardetng",
"chrono",
@@ -9297,7 +9297,7 @@ dependencies = [
[[package]]
name = "wordcraft-geom"
version = "0.20.1"
version = "0.18.1"
dependencies = [
"craft-image-codecs",
"craft-tiff",
@@ -9307,7 +9307,7 @@ dependencies = [
[[package]]
name = "wordcraft-layout"
version = "0.20.1"
version = "0.18.1"
dependencies = [
"craft-metafile",
"craft-proof",
@@ -9327,7 +9327,7 @@ dependencies = [
[[package]]
name = "wordcraft-mcp"
version = "0.20.1"
version = "0.18.1"
dependencies = [
"craft",
"craft-mcp-server",
@@ -9341,7 +9341,7 @@ dependencies = [
[[package]]
name = "wordcraft-pdf"
version = "0.20.1"
version = "0.18.1"
dependencies = [
"chrono",
"craft-metafile",
@@ -9362,7 +9362,7 @@ dependencies = [
[[package]]
name = "wordcraft-render"
version = "0.20.1"
version = "0.18.1"
dependencies = [
"craft-metafile",
"image",
@@ -9376,7 +9376,7 @@ dependencies = [
[[package]]
name = "wordcraft-ui-egui"
version = "0.20.1"
version = "0.18.1"
dependencies = [
"cfb",
"chrono",
@@ -9409,7 +9409,7 @@ dependencies = [
[[package]]
name = "wordcraft-validate"
version = "0.20.1"
version = "0.18.1"
dependencies = [
"craft-image-codecs",
"craft-tiff",
@@ -9424,7 +9424,7 @@ dependencies = [
[[package]]
name = "wordcraft-web"
version = "0.20.1"
version = "0.18.1"
dependencies = [
"craft",
"eframe",
@@ -9444,7 +9444,7 @@ dependencies = [
[[package]]
name = "wordcraft-zotero"
version = "0.20.1"
version = "0.18.1"
dependencies = [
"log",
"proptest",
@@ -9662,7 +9662,7 @@ checksum = "9440ea3e5aeabb0ac63af70daf835274065238cdd0cec83418f417eae38bacee"
[[package]]
name = "xtask"
version = "0.20.1"
version = "0.18.1"
dependencies = [
"serde",
"serde_json",
@@ -10052,4 +10052,4 @@ source = "git+https://github.com/storytold/egui.git?rev=399fc6e0ea65059e37de680f
[[patch.unused]]
name = "hayro"
version = "0.7.1"
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
+40 -40
View File
@@ -13,7 +13,7 @@ run_slots = 3
test_threads = 4
[workspace.package]
version = "0.20.1"
version = "0.18.1"
edition = "2024"
license = "MIT OR Apache-2.0"
rust-version = "1.95"
@@ -37,22 +37,22 @@ wordcraft-pdf = { path = "crates/pdf" }
# reads the ca-valencia pack), #589 (French elision suggestions first), #497 (flag-based
# compounding), #496 (review follow-ups, en-AU) and the merged #482–#490/#495 stack; the font
# store's `language-pack` kind is #486 (CP4.1).
wordcraft-proof = { package = "craft-proof", git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-ssip = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
wordcraft-proof = { package = "craft-proof", git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-ssip = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
wordcraft-engine = { path = "crates/engine" }
wordcraft-mcp = { path = "crates/mcp" }
wordcraft-zotero = { path = "crates/zotero" }
wordcraft-control-key = { path = "crates/control-key" }
wordcraft-ui-egui = { path = "crates/ui-egui" }
wordcraft-validate = { path = "crates/validate" }
craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0", default-features = false }
craft-ui-test-kit = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-keymap = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359" }
craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0", default-features = false }
craft-ui-test-kit = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-keymap = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35" }
# foundation
kurbo = { version = "0.13", features = ["serde"] }
@@ -85,28 +85,28 @@ wuff = "0.2.9"
brotli-decompressor = "5"
vello_cpu = "0.2"
image = { version = "0.25", default-features = false }
craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0", default-features = false, features = ["write"] }
craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0", default-features = false, features = ["write"] }
craft-wordmodel = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-docx = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-mcp-server = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-rtf = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0", features = ["doc"] }
craft-doc-binary = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-flow = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-odf = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0", features = ["text"] }
craft-markdown = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-html = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0", features = ["flow"] }
craft-latex = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-math = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0", features = ["detect"] }
craft-sheet = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-ods = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-xls = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-xlsx = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-zip = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", version = "=0.1.0" }
craft-wordmodel = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-docx = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-mcp-server = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-rtf = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0", features = ["doc"] }
craft-doc-binary = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-flow = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-odf = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0", features = ["text"] }
craft-markdown = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-html = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0", features = ["flow"] }
craft-latex = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-math = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0", features = ["detect"] }
craft-sheet = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-ods = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-xls = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-xlsx = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
craft-zip = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", version = "=0.1.0" }
# zlib streams (compressed metafile pictures in `.doc` drawings); already in the lock as a dependency of other crates.
miniz_oxide = "0.9"
cfb = "0.15"
@@ -174,14 +174,14 @@ debug = 0
# The framework's patches, which Cargo does not carry over to dependents: its vendored crates from craft-libs,
# and the egui and winit forks it builds with.
[patch.crates-io]
krilla = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359" }
hayro = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359" }
hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359" }
hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359" }
hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359" }
hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359" }
hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359" }
linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359" }
krilla = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35" }
hayro = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35" }
hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35" }
hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35" }
hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35" }
hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35" }
hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35" }
linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35" }
ecolor = { git = "https://github.com/storytold/egui.git", rev = "399fc6e0ea65059e37de680f11ebbd177bf7d4ff" }
emath = { git = "https://github.com/storytold/egui.git", rev = "399fc6e0ea65059e37de680f11ebbd177bf7d4ff" }
epaint = { git = "https://github.com/storytold/egui.git", rev = "399fc6e0ea65059e37de680f11ebbd177bf7d4ff" }
+134 -195
View File
@@ -152,21 +152,6 @@ impl eframe::App for App {
}
}
/// Files dropped on a document window. eframe hands `raw_input_hook` only the root's and deferred
/// viewports' input, and document windows are immediate viewports (every one under the windowless
/// root), so their drops come through this hook. It runs first and takes the batch, so nothing reads
/// it twice.
struct ChildDrops(IntakeSender);
impl eframe::ViewportHooks for ChildDrops {
fn raw_input(&self, _ctx: &egui::Context, raw: &mut egui::RawInput) {
if raw.viewport_id != egui::ViewportId::ROOT && !raw.dropped_files.is_empty() {
self.0.dropped(dropped_files(raw));
raw.dropped_files.clear();
}
}
}
/// The files dropped in this frame's input, as the intake carries them: a file with a path by its
/// path, a file without one by its bytes.
fn dropped_files(raw: &egui::RawInput) -> Vec<DroppedFile> {
@@ -478,46 +463,6 @@ fn prepare_launch() -> Option<Vec<std::ffi::OsString>> {
Some(launch_profile::passthrough_args(early.passthrough_args, had_separator))
}
/// Runs the app with the windowless root when `windowless` is set, and with the visible root when it is not. eframe
/// refuses a windowless root on a session that cannot run it before it calls the creator, which then stays in its
/// cell for a retry with the visible root: the app always starts.
fn run_with_visible_root_fallback(
creator: eframe::AppCreator<'static>,
windowless: Arc<std::sync::atomic::AtomicBool>,
mut options: eframe::NativeOptions,
) -> eframe::Result {
use std::sync::atomic::Ordering::Relaxed;
let creator = std::rc::Rc::new(std::cell::RefCell::new(Some(creator)));
let name = wordcraft_ui_egui::os_window::name_for(wordcraft_ui_egui::os_window::identity());
let run = |options: eframe::NativeOptions| {
let creator = creator.clone();
eframe::run_native(
name,
options,
Box::new(move |cc| match creator.borrow_mut().take() {
Some(create) => create(cc),
None => Err("the app was already created".into()),
}),
)
};
let on = windowless.load(Relaxed);
// The clone keeps no event-loop hook, which only the X11 start sets and that start is windowed.
let mut visible_root = on.then(|| options.clone());
if on {
options.root_viewport_mode = eframe::RootViewportMode::Windowless;
}
let result = run(options);
if let Err(eframe::Error::UnsupportedConfiguration(reason)) = &result
&& let Some(options) = visible_root.take()
&& creator.borrow().is_some()
{
log::warn!("windowless root unavailable ({reason}); starting with a visible root window");
windowless.store(false, Relaxed);
return run(options);
}
result
}
/// Parses the command line, installs logging and the panic hook, restores preferences and window
/// geometry, opens requested documents or the Start screen, starts the control server when
/// asked, and runs the eframe event loop.
@@ -731,7 +676,6 @@ fn main() -> eframe::Result {
// Registered before the event loop starts, so it catches the Finder event that launched us as
// well as later ones. Lives until the event loop returns.
let drops = intake.sender();
options.viewport_hooks = Some(Arc::new(ChildDrops(drops.clone())));
#[cfg(target_os = "macos")]
let _apple_events = craft::platform::open::apple_events::install(sender);
#[cfg(not(target_os = "macos"))]
@@ -761,152 +705,147 @@ fn main() -> eframe::Result {
let noticed_for_exit = unclean_notice_shown.clone();
let noticed_in_window = unclean_notice_shown.clone();
let exit_settings = settings.clone();
// The root window is never shown (ADR 0001): eframe runs a windowless root and every document is a child
// window. X11, XWayland and BSD on X11 cannot, so they keep the visible root (the ADR's amendment). The mode
// is read by the app creator, which runs once the mode is settled.
let windowless = Arc::new(std::sync::atomic::AtomicBool::new(!x11));
let windowless_in_app = windowless.clone();
let creator: eframe::AppCreator<'static> = Box::new(move |cc| {
let ctx = cc.egui_ctx.clone();
let _ = repaint.set(ctx.clone());
let wake = {
let ctx = ctx.clone();
move || ctx.request_repaint()
};
// The interface language: the saved choice, else the system's.
let lang = wordcraft_ui_egui::i18n::Lang::from_pref(&settings.lock().get().language);
let (file_service, panels) = FileService::new(Wake::new(wake.clone()));
let host = Arc::new(
Host::builder(wordcraft_ui_egui::APP)
.i18n(wordcraft_ui_egui::i18n::catalogs())
.files(Arc::new(file_service))
.settings(Arc::new(settings.clone()))
.lang(lang.craft_lang())
.build(),
);
let shell = ShellInfo::current().backend(if x11 { Backend::X11 } else { Backend::from_env() });
let mut spec = InstallSpec::new(shell, Arc::new(SystemWindows))
.app_id(wordcraft_ui_egui::os_window::app_id())
.system(SystemReader::start(wake))
.clipboard(Clipboard::new(SystemClipboard::new().decoder(decode_png)))
.placement(placement);
// The runtime and eframe must agree on the root.
if windowless_in_app.load(std::sync::atomic::Ordering::Relaxed) {
spec = spec.windowless_root();
}
// PLAN: assumed `wordcraft_ui_egui::ui_fonts` re-exports sh.A10's `app::fonts::ui_fonts` (`mod app` is private; app-hub/shell-w11).
embed::install(&ctx, spec, &wordcraft_ui_egui::ui_fonts(lang)).map_err(|e| format!("the runtime could not be installed: {e}"))?;
// The system region picks the new document's paper, the units and the decimal
// separator (#838).
let region = region::system();
let doc = if sample { wordcraft_engine::sample::sample_document() } else { wordcraft_engine::blank_document(&region) };
let mut session = Session::new(doc);
session.system_region = region;
// The custom dictionary's words (#40) count as loaded settings.
if prefs::enabled()
&& let Some(path) = prefs::user_dict_path()
{
prefs::load_user_dictionary(&mut session, &settings, path);
}
let spool = Spool::new(host.jobs_shared().clone());
let mut app = WordApp::new(session, services(spool.clone(), intake, nightly)).with_host(host).with_settings(settings.clone());
// Drawn by the processor (WARP, llvmpipe; #2221), animations that follow the system stop.
if let Some(state) = &cc.wgpu_render_state {
let info = state.adapter.get_info();
let software = info.device_type == eframe::wgpu::DeviceType::Cpu;
if software {
log::warn!("graphics: drawing in software on {} ({:?}): animations that follow the system are off", info.name, info.backend);
let result = eframe::run_native(
wordcraft_ui_egui::os_window::name_for(wordcraft_ui_egui::os_window::identity()),
options,
Box::new(move |cc| {
let ctx = cc.egui_ctx.clone();
let _ = repaint.set(ctx.clone());
let wake = {
let ctx = ctx.clone();
move || ctx.request_repaint()
};
// The interface language: the saved choice, else the system's.
let lang = wordcraft_ui_egui::i18n::Lang::from_pref(&settings.lock().get().language);
let (file_service, panels) = FileService::new(Wake::new(wake.clone()));
let host = Arc::new(
Host::builder(wordcraft_ui_egui::APP)
.i18n(wordcraft_ui_egui::i18n::catalogs())
.files(Arc::new(file_service))
.settings(Arc::new(settings.clone()))
.lang(lang.craft_lang())
.build(),
);
let shell = ShellInfo::current().backend(if x11 { Backend::X11 } else { Backend::from_env() });
let spec = InstallSpec::new(shell, Arc::new(SystemWindows))
.app_id(wordcraft_ui_egui::os_window::app_id())
.system(SystemReader::start(wake))
.clipboard(Clipboard::new(SystemClipboard::new().decoder(decode_png)))
.placement(placement);
// PLAN: assumed `wordcraft_ui_egui::ui_fonts` re-exports sh.A10's `app::fonts::ui_fonts` (`mod app` is private; app-hub/shell-w11).
embed::install(&ctx, spec, &wordcraft_ui_egui::ui_fonts(lang)).map_err(|e| format!("the runtime could not be installed: {e}"))?;
// The system region picks the new document's paper, the units and the decimal
// separator (#838).
let region = region::system();
let doc = if sample { wordcraft_engine::sample::sample_document() } else { wordcraft_engine::blank_document(&region) };
let mut session = Session::new(doc);
session.system_region = region;
// The custom dictionary's words (#40) count as loaded settings.
if prefs::enabled()
&& let Some(path) = prefs::user_dict_path()
{
prefs::load_user_dictionary(&mut session, &settings, path);
}
app.set_software_drawing(software);
}
// PLAN: writer note 9 puts `with_settings` after `with_control`; it comes first here because
// the region check below reads the saved region the settings apply.
if std::env::var("WORDCRAFT_FILE_DIALOG").is_ok_and(|v| v.trim().eq_ignore_ascii_case("builtin")) {
app = app.with_fallback_chooser(true);
}
if nightly {
// The Launcher installs Nightly; Help › Check for Updates says so instead.
app.use_launcher_updates();
} else {
app.set_startup_update_check(true);
// After the preferences, so the reason it gives is in the interface language.
if updates_unsafe {
app.disable_self_update();
let spool = Spool::new(host.jobs_shared().clone());
let mut app = WordApp::new(session, services(spool.clone(), intake, nightly)).with_host(host).with_settings(settings.clone());
// Drawn by the processor (WARP, llvmpipe; #2221), animations that follow the system stop.
if let Some(state) = &cc.wgpu_render_state {
let info = state.adapter.get_info();
let software = info.device_type == eframe::wgpu::DeviceType::Cpu;
if software {
log::warn!("graphics: drawing in software on {} ({:?}): animations that follow the system are off", info.name, info.backend);
}
app.set_software_drawing(software);
}
}
// Language packs from the suite's font store; an Install click is the person's own.
// Nightly keeps its own store in the profile, so a pack installed there is not a
// change to the stable apps' shared fonts.
match launch_profile::current().root() {
Some(root) => wordcraft_engine::packs::use_font_store_in(root.join("FontStore"), true),
None => {
wordcraft_engine::packs::use_font_store(true);
// PLAN: writer note 9 puts `with_settings` after `with_control`; it comes first here because
// the region check below reads the saved region the settings apply.
if std::env::var("WORDCRAFT_FILE_DIALOG").is_ok_and(|v| v.trim().eq_ignore_ascii_case("builtin")) {
app = app.with_fallback_chooser(true);
}
}
// A region chosen in File › Options replaces the system's for the first blank
// document too (#838).
if !sample && app.session.prefs.region.is_some() {
let doc = app.session.blank_document();
app.replace_startup_document(doc);
}
app.tell_about_font_downloads();
if prefs::enabled()
&& let Some(dir) = wordcraft_control_key::settings_dir()
{
let ctx = ctx.clone();
if let Err(e) = app.session.enable_recovery(dir.join("recovery"), Arc::new(move || ctx.request_repaint())) {
log::warn!("local recovery unavailable: {e}");
if nightly {
// The Launcher installs Nightly; Help › Check for Updates says so instead.
app.use_launcher_updates();
} else {
app.set_startup_update_check(true);
// After the preferences, so the reason it gives is in the interface language.
if updates_unsafe {
app.disable_self_update();
}
}
}
let mut control_server = None;
if !nightly
&& let Some(port) = control.port
&& let Some((rx, started)) = control_server::start(&control, port, WindowHost::of(&ctx), wordcraft_control_key::settings_dir().as_deref())
{
app = app.with_control(ControlChannel::new(rx));
control_server = Some(started);
}
// Nothing to open (no files, no sample, no control channel driving the editor): start
// on File › Home, as Word does (#766), unless the Start screen option is off. Files
// the OS hands over later open on top of it and close it.
if files.is_empty() && other_files.is_empty() && !sample && control.port.is_none() {
app.start_screen();
}
// A Word template named here starts a new document based on it (#3433).
for f in files {
if let Err(e) = app.open_from_platform(&f, None) {
app.report_open_failure(&f, &e);
// Language packs from the suite's font store; an Install click is the person's own.
// Nightly keeps its own store in the profile, so a pack installed there is not a
// change to the stable apps' shared fonts.
match launch_profile::current().root() {
Some(root) => wordcraft_engine::packs::use_font_store_in(root.join("FontStore"), true),
None => {
wordcraft_engine::packs::use_font_store(true);
}
}
}
for f in other_files {
open_non_unicode(&mut app, &f);
}
// The personal agent files, the session record and the control token all live in the
// profile; the app's own services are built with the nightly rule in mind.
if let Some(warning) = &session_health_warning {
app.status_long(warning.clone());
}
if previous_nightly_unclean {
app.status_long(
// A region chosen in File › Options replaces the system's for the first blank
// document too (#838).
if !sample && app.session.prefs.region.is_some() {
let doc = app.session.blank_document();
app.replace_startup_document(doc);
}
app.tell_about_font_downloads();
if prefs::enabled()
&& let Some(dir) = wordcraft_control_key::settings_dir()
{
let ctx = ctx.clone();
if let Err(e) = app.session.enable_recovery(dir.join("recovery"), Arc::new(move || ctx.request_repaint())) {
log::warn!("local recovery unavailable: {e}");
}
}
let mut control_server = None;
if !nightly
&& let Some(port) = control.port
&& let Some((rx, started)) =
control_server::start(&control, port, WindowHost::of(&ctx), wordcraft_control_key::settings_dir().as_deref())
{
app = app.with_control(ControlChannel::new(rx));
control_server = Some(started);
}
// Nothing to open (no files, no sample, no control channel driving the editor): start
// on File › Home, as Word does (#766), unless the Start screen option is off. Files
// the OS hands over later open on top of it and close it.
if files.is_empty() && other_files.is_empty() && !sample && control.port.is_none() {
app.start_screen();
}
// A Word template named here starts a new document based on it (#3433).
for f in files {
if let Err(e) = app.open_from_platform(&f, None) {
app.report_open_failure(&f, &e);
}
}
for f in other_files {
open_non_unicode(&mut app, &f);
}
// The personal agent files, the session record and the control token all live in the
// profile; the app's own services are built with the nightly rule in mind.
if let Some(warning) = &session_health_warning {
app.status_long(warning.clone());
}
if previous_nightly_unclean {
app.status_long(
"The previous WordCraft Nightly session did not finish normally. You can report a problem from Help › About. No diagnostics have been sent.",
);
noticed_in_window.store(true, std::sync::atomic::Ordering::Relaxed);
}
Ok(Box::new(App {
#[cfg(target_os = "macos")]
native_menu: native_menu::install(&ctx, &app),
app,
panels,
drops,
settings,
spool,
control: control_server,
exit: Some(Box::new(move || {
nightly_session::finish_once(&session_for_exit, noticed_for_exit.load(std::sync::atomic::Ordering::Relaxed));
})),
}))
});
let result = run_with_visible_root_fallback(creator, windowless, options);
noticed_in_window.store(true, std::sync::atomic::Ordering::Relaxed);
}
Ok(Box::new(App {
#[cfg(target_os = "macos")]
native_menu: native_menu::install(&ctx, &app),
app,
panels,
drops,
settings,
spool,
control: control_server,
exit: Some(Box::new(move || {
nightly_session::finish_once(&session_for_exit, noticed_for_exit.load(std::sync::atomic::Ordering::Relaxed));
})),
}))
}),
);
// The exit hook has run; this is the no-op fallback for a start that created no window.
nightly_session::finish_once(&nightly_watch, unclean_notice_shown.load(std::sync::atomic::Ordering::Relaxed));
// The app is dropped by now: whatever it saved on the way out is in the store.
+2 -19
View File
@@ -6,22 +6,13 @@ use wordcraft_ui_egui::{WordApp, i18n};
const APP_NAME: &str = "WordCraft";
const ABOUT: &str = "About WordCraft";
const QUIT: &str = "Quit WordCraft";
/// The application menu, with `tr` the translation of an English string.
pub(super) fn layout(tr: &dyn Fn(&'static str) -> String) -> Layout {
let about = Item::new(CommandRef::with_params("ui.dialog", json!({"name": "about"})), tr(ABOUT)).role(ItemRole::About);
// Without its own Quit `mac_layout` adds one whose click only closes the root window: it must ask about every document.
let quit = Item::new(CommandRef::new("ui.quit"), tr(QUIT)).role(ItemRole::Quit);
let bar = MenuBar::new(vec![Menu::new(APP_NAME, vec![about.into(), quit.into()]).role(MenuRole::App)]);
let bar = MenuBar::new(vec![Menu::new(APP_NAME, vec![about.into()]).role(MenuRole::App)]);
// `mac_layout` words About as the template; WordCraft's catalogs translate the whole label.
let label = |s: &'static str| {
tr(match s {
"About {app}" => ABOUT,
"Quit {app}" => QUIT,
s => s,
})
};
let label = |s: &'static str| tr(if s == "About {app}" { ABOUT } else { s });
let mut layout = mac_layout(&bar, &LayoutOptions::new(APP_NAME).label(&label));
// WordCraft's document menus live in its ribbon; keep only the application menu.
layout.bar.menus.retain(|menu| menu.role == MenuRole::App);
@@ -70,12 +61,4 @@ mod tests {
let about = layout.bar.items().into_iter().find(|item| item.role == Some(ItemRole::About)).unwrap();
assert_eq!(about.label, "Über WordCraft");
}
/// ⌘Q and the menu's Quit run `ui.quit`, which asks about unsaved documents; craft's built-in Quit only closes the root window (#8709).
#[test]
fn quit_runs_the_command_that_asks_about_documents() {
let layout = layout(&|s| s.to_owned());
let quit = layout.bar.items().into_iter().find(|item| item.role == Some(ItemRole::Quit)).unwrap();
assert_eq!(quit.command.id, "ui.quit");
}
}
+1 -1
View File
@@ -145,7 +145,7 @@ pub fn specs() -> Vec<CommandSpec> {
sel_result(s)
})
.key("Mod+W / Mod+F4")
.params(r#"{"save"?: bool (desktop app's control channel and MCP bridge only: save the shown document, then close it; it does not apply to a background `doc`, which needs force or its own save first), "force"?: bool (desktop app's control channel and MCP bridge only: without save or force a document with unsaved changes is an error and stays open; with force the changes are discarded. Headless sessions never ask; file.closeDocument closes a document there)}"#)
.params(r#"{"force"?: bool (desktop app's control channel and MCP bridge only: without it a document with unsaved changes is an error and stays open; with it the changes are discarded. Headless sessions never ask; file.closeDocument closes a document there)}"#)
.pure(),
CommandSpec::new("file.closeDocument", "Close Document", "Agents", close_document)
.params(r#"{"id"?: n (an open document, see view.switchWindows; default the active one), "force"?: bool (discard unsaved changes; without it a document with unsaved changes is an error and stays open)} → {"closed": id, "active": id, "documents": [{"id", "title", "path", "dirty", "active"}]}; closing the last document leaves a new blank one"#)
+12 -2
View File
@@ -427,8 +427,17 @@ fn word_spans(pl: &ParaLayout, line: &crate::para::Line, (k0, k1): (usize, usize
words
}
/// The top and height of the text itself within a line, leaving out the leading line spacing adds.
fn line_text_extent(ctx: &LineContext<'_, '_, '_>) -> (f32, f32) {
let (asc, desc) = ctx.pl.caret_metrics(ctx.li);
let text_top = (ctx.base - asc).max(ctx.top);
let text_bottom = (ctx.base + desc).min(ctx.bottom);
(text_top, (text_bottom - text_top).max(0.0))
}
fn comment_backgrounds(ctx: &LineContext<'_, '_, '_>, out: &mut Vec<Draw>) {
let Some(para) = ctx.para.filter(|_| ctx.opts.markup && ctx.opts.revisions.comments) else { return };
let (text_top, text_height) = line_text_extent(ctx);
let mut open: Option<usize> = None;
let mut ranges = Vec::new();
for off in para.object_offsets() {
@@ -448,7 +457,7 @@ fn comment_backgrounds(ctx: &LineContext<'_, '_, '_>, out: &mut Vec<Draw>) {
for (x0, x1) in ctx.pl.x_spans(ctx.li, start.max(ctx.line.start), end.min(ctx.line.stop)) {
if x1 > x0 {
out.push(Draw::Fill {
rect: Rect::new(ctx.x + x0, ctx.top, x1 - x0, ctx.line.height),
rect: Rect::new(ctx.x + x0, text_top, x1 - x0, text_height),
color: Rgb(0xEF, 0xE3, 0xF7),
alpha: ctx.alpha,
text_bg: false,
@@ -460,6 +469,7 @@ fn comment_backgrounds(ctx: &LineContext<'_, '_, '_>, out: &mut Vec<Draw>) {
/// Paint highlights and shading before glyphs, grouping adjacent equal character borders.
fn character_backgrounds(ctx: &LineContext<'_, '_, '_>, out: &mut Vec<Draw>) {
let (text_top, text_height) = line_text_extent(ctx);
let mut open: Option<(Border, f32, f32)> = None;
for k in ctx.line.c0..ctx.line.c1 {
let (Some(cluster), Some(left), Some(right)) = (ctx.pl.clusters.get(k), ctx.line.cl_left(k), ctx.line.cl_right(k)) else { continue };
@@ -469,7 +479,7 @@ fn character_backgrounds(ctx: &LineContext<'_, '_, '_>, out: &mut Vec<Draw>) {
}
if let Some(color) = style.rc.highlight.or(style.rc.shading) {
out.push(Draw::Fill {
rect: Rect::new(ctx.x + left, ctx.top, (right - left).max(0.0), ctx.line.height),
rect: Rect::new(ctx.x + left, text_top, (right - left).max(0.0), text_height),
color,
alpha: ctx.alpha,
text_bg: true,
+7 -3
View File
@@ -975,16 +975,20 @@ impl DocLayout {
continue;
}
let top = l.top - first.top;
let (asc, desc) = para.caret_metrics(li);
let base = top + (l.baseline - l.top);
let sel_top = (base - asc).max(top);
let sel_height = (base + desc - sel_top).max(0.0);
if !l.vis.is_empty() {
// Bidirectional line: the selected text can be several visual pieces.
for (x0, x1) in para.x_spans(li, from, to) {
put(Rect::new(x0, top, (x1 - x0).max(0.0), l.height));
put(Rect::new(x0, sel_top, (x1 - x0).max(0.0), sel_height));
}
// Selection continuing past the paragraph end shows the paragraph mark.
if li + 1 == para.lines.len() && path != b.path {
let ex = l.end_x();
let x0 = if l.rtl { ex - PARA_MARK_WIDTH } else { ex };
put(Rect::new(x0, top, PARA_MARK_WIDTH, l.height));
put(Rect::new(x0, sel_top, PARA_MARK_WIDTH, sel_height));
}
continue;
}
@@ -1005,7 +1009,7 @@ impl DocLayout {
if x1 <= x0 && !(last_line && path != b.path) {
continue;
}
put(Rect::new(x0, top, (x1 - x0).max(0.0), l.height));
put(Rect::new(x0, sel_top, (x1 - x0).max(0.0), sel_height));
}
}
}
+35
View File
@@ -17201,6 +17201,41 @@ fn caret_height_ignores_line_spacing() {
}
}
#[test]
fn selection_and_highlight_height_ignore_line_spacing() {
// #3468: extra line spacing is leading below the text; selection and highlight heights stay the height of the font.
use wordcraft_doc::props::{Highlight, LineSpacing};
let metrics = |spacing: Option<LineSpacing>| {
let mut d = Document::new();
let chr = wordcraft_doc::CharProps {
font: Some("Source Sans 3".into()),
size: Some(12.0),
highlight: Some(Highlight::Yellow),
..Default::default()
};
let mut p = wordcraft_doc::Paragraph::with_text("Alpha probe", chr);
p.props = ParaProps { line_spacing: spacing, ..Default::default() };
d.body = vec![wordcraft_doc::para_block(p)];
let l = lay(&d);
let sel_h = l.selection_rects(&d, &Pos::body(0, 0), &Pos::body(0, 5), 0)[0].1.h;
let draws = display::page_display(&d, &l.pages[0], &Default::default());
let hl_h = draws
.iter()
.find_map(|draw| match draw {
display::Draw::Fill { rect, text_bg: true, .. } => Some(rect.h),
_ => None,
})
.unwrap();
(sel_h, hl_h)
};
let (single_sel, single_hl) = metrics(Some(LineSpacing::Multiple(1.0)));
for spacing in [LineSpacing::Multiple(2.0), LineSpacing::AtLeast(40.0), LineSpacing::Exactly(40.0)] {
let (wide_sel, wide_hl) = metrics(Some(spacing));
assert!((single_sel - wide_sel).abs() < 0.01, "selection {spacing:?}: single {single_sel}, wide {wide_sel}");
assert!((single_hl - wide_hl).abs() < 0.01, "highlight {spacing:?}: single {single_hl}, wide {wide_hl}");
}
}
#[test]
fn bottom_border_reserves_gap() {
use wordcraft_doc::props::{BorderStyle, Borders};
+2 -2
View File
@@ -16,7 +16,7 @@ craft = { workspace = true, features = [
"color", "color-ui", "control", "draw", "font-manager", "gpu", "menu", "pages", "print", "review", "table", "text",
"text-find", "web-api", "web-host", "window",
] }
craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359" }
craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35" }
wordcraft-geom = { workspace = true, features = ["image"] }
wordcraft-doc = { workspace = true }
wordcraft-fonts = { workspace = true }
@@ -76,7 +76,7 @@ craft-ui-test-kit = { workspace = true }
craft = { workspace = true, features = ["ui-testing"] }
[build-dependencies]
craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "ad10c35ae545f0fb816364381a1a8154012b2359", features = ["subset"] }
craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "5299d8d97dc04648dff735d1bd6f60bd18f10b35", features = ["subset"] }
serde_json = { workspace = true }
toml = "1"
-3
View File
@@ -869,8 +869,6 @@ impl WordApp {
};
return Some(self.answer_save_changes(answer));
}
// The app menu's Quit (⌘Q): asks about each unsaved document, as the Dock's Quit does.
"ui.quit" => json!({"quit": self.quit()}),
"ui.openFileDialog" => {
self.open_dialog();
json!({})
@@ -1321,7 +1319,6 @@ pub(crate) fn works_without_document(id: &str) -> bool {
| "ui.animations"
| "ui.language"
| "ui.saveChanges"
| "ui.quit"
| "ui.openFileDialog"
| "ui.printCancel"
| "ui.fileBrowser"
-46
View File
@@ -285,16 +285,6 @@ impl WordApp {
if self.raise_closing().is_some() {
return CloseDecision::Hold;
}
// Nothing is open, so nothing to ask about (also under a windowless root, whose last document window going is
// what asks).
if self.session.documents().is_empty() {
return CloseDecision::Close;
}
// A windowless root has no window of its own: its close is a quit (the OS quit, or the last document window
// going), never one window's close.
if self.ctx.as_ref().is_some_and(craft::ui::runtime::windows::windowless_root) {
return if self.close_requested() { CloseDecision::Close } else { CloseDecision::Hold };
}
if self.closes_a_window() {
// The root window's close button closes that window alone (File › Close in it, which asks
// about unsaved changes first); the framework leaves the root's window open on `Hold`, and
@@ -551,27 +541,9 @@ impl WordApp {
if let Some(result) = self.raise_closing() {
return Ok(result);
}
if self.closes_only_its_window("file.close", params) {
// `save: true` still writes the document, which stays open in the other windows.
if params.get("save").and_then(Value::as_bool) == Some(true)
&& let Some(pending) = self.save_for_close()?
{
return Ok(pending);
}
}
if self.closes_only_its_window("file.close", params) && self.close_window_only() {
return Ok(json!({"closed": true, "window": true}));
}
if params.get("save").and_then(Value::as_bool) == Some(true) {
// A comment still being typed refuses before anything is written.
if let Some(e) = crate::control::close_refused(self, "file.close", params) {
return Err(e.into());
}
// Automation's `save: true`: write the document, then close it. Never a prompt (spec rule 8).
if let Some(pending) = self.save_for_close()? {
return Ok(pending);
}
}
if let Some(e) = crate::control::close_refused(self, "file.close", params) {
return Err(e.into());
}
@@ -606,24 +578,6 @@ impl WordApp {
Ok(json!({"closed": true}))
}
/// `file.close` with `save: true`: save the shown document if it has unsaved work. `Some` is
/// the reply when the save finishes later (the browser's picker). A document with no file
/// to write has nowhere to save without asking, so that is an error, not a prompt.
fn save_for_close(&mut self) -> Result<Option<Value>, String> {
if !self.document_unsaved() {
return Ok(None);
}
if self.session.path.is_none() || self.legacy_word_path() {
return Err("the document has no file to save to: use file.saveAs first, or pass {\"force\": true} to discard it".into());
}
match self.save_for_prompt()? {
PromptSave::Saved => Ok(None),
// lean: only the browser picker saves later and it has no control channel, so the close is not resumed.
PromptSave::Later => Ok(Some(json!({"pending": "save"}))),
PromptSave::NotSaved => Err("the document was not saved, so it stays open".into()),
}
}
/// These paths have readers but no writer, so an interactive save needs another format.
pub(super) fn legacy_word_path(&self) -> bool {
self.session
+3 -36
View File
@@ -5,7 +5,7 @@ use craft::automation::control::{ControlRequest, Reply};
use craft::automation::dialogs;
use craft::automation::synthetic::input_method;
use craft::ui::runtime::commands::{ClipItem, ClipboardHandle};
use craft::ui::runtime::windows::{WindowAction, WindowHost, windowless_root};
use craft::ui::runtime::windows::{WindowAction, WindowHost};
use serde_json::{Value, json};
use super::screenshots::render_png;
@@ -81,13 +81,6 @@ pub(crate) fn close_refused(app: &WordApp, id: &str, params: &Value) -> Option<&
// The document the command closes: `file.close` the shown one, `file.closeDocument` the one
// its `id` names (the active one by default) (#3274).
let target = match id {
// `save: true` is saved, then closed, by `file.close` itself (spec rule 8); a comment
// still being typed is not saved by that, so it still refuses.
"file.close" if params.get("save").and_then(Value::as_bool) == Some(true) => {
let force = params.get("force").and_then(Value::as_bool) == Some(true);
let target = app.session.document_id();
return (!force && app.document_has_comment_drafts(target)).then_some(COMMENT_UNSAVED);
}
"file.close" => app.session.document_id(),
"file.closeDocument" => match params.get("id") {
None | Some(Value::Null) => app.session.document_id(),
@@ -96,8 +89,7 @@ pub(crate) fn close_refused(app: &WordApp, id: &str, params: &Value) -> Option<&
},
_ => return None,
};
let refusal = close_refused_for(app, target, params);
if id == "file.close" && refusal == Some(UNSAVED) { Some(UNSAVED_CLOSE) } else { refusal }
close_refused_for(app, target, params)
}
/// The refusal for closing the document `target` with unsaved work in it: the same work the
@@ -117,9 +109,6 @@ fn close_refused_for(app: &WordApp, target: u64, params: &Value) -> Option<&'sta
}
const UNSAVED: &str = "the document has unsaved changes: save it first, or pass {\"force\": true} to discard them and close";
/// `file.close` also takes `save` (spec rule 8).
const UNSAVED_CLOSE: &str =
"unsaved changes: pass save or force ({\"save\": true} writes the document, then closes; {\"force\": true} closes without saving)";
const COMMENT_UNSAVED: &str = "a comment is still being edited: finish it first, or pass {\"force\": true} to discard it";
/// Quitting closes every open document, so unsaved work needs the same explicit `force` as
@@ -191,10 +180,6 @@ fn handle_in(app: &mut WordApp, doc: u64, method: &str, p: &Value) -> Reply {
// Close, with the same guard as the window's: unsaved changes need `force`.
if id == "file.close" {
if let Some(e) = close_refused_for(app, doc, &params) {
// lean: `save` writes the shown document only; a background one needs file.save after making it active.
if params.get("save").and_then(Value::as_bool) == Some(true) {
return err(format!("{e} (`save` applies to the shown document only: make this one active first, or save it, then close)"));
}
return err(e);
}
return match app.session.close_document(doc) {
@@ -421,25 +406,7 @@ fn handle_request(app: &mut WordApp, ctx: &egui::Context, req: &ControlRequest)
ok(json!({}))
}
// Close the active window through the same guard as its OS close button.
// `window` names another window by its key; none means the active one (spec rule 8).
"ui.closeWindow" => {
let viewport = match p.get("window").filter(|w| !w.is_null()) {
None => app.active_viewport(),
Some(w) => match w.as_u64().and_then(|key| app.window_viewport(key)) {
Some(v) => v,
None => return err("`window` is not an open window: use a key from ui.inspect windows (`current`, `others[].id`)"),
},
};
// Spec rule 4: a close while a Save prompt is up only raises that prompt, so nothing was requested.
if app.raise_closing().is_some() {
return ok(json!({"requested": false, "reason": "a Save prompt is already open: answer it first"}));
}
// A windowless root is no window: closing it would end the app, not close a window.
if viewport == egui::ViewportId::ROOT && windowless_root(ctx) {
return err("no document window is open");
}
ok(json!({"requested": WindowHost::of(ctx).act(viewport, WindowAction::Close)}))
}
"ui.closeWindow" => ok(json!({"requested": WindowHost::of(ctx).act(app.active_viewport(), WindowAction::Close)})),
"ui.clipboard" => clipboard(ctx, p),
"ui.replayAt" => {
let Some(at) = p.get("at").and_then(Value::as_f64) else { return err("missing `at`") };
-13
View File
@@ -167,19 +167,6 @@ fn imported_word_close_waits_for_save_as_and_keeps_failed_or_cancelled_drafts()
let _ = std::fs::remove_dir_all(dir);
}
/// Spec rules 5 and 6: cancelling the Save As a quit's Save opened cancels the quit.
#[test]
fn cancelling_save_as_cancels_the_quit() {
let (mut a, files) = async_app();
a.run("text.insert", json!({"text": "Draft"})).unwrap();
assert!(!a.quit());
assert_eq!(a.run("ui.saveChanges", json!({"answer": "save"})).unwrap()["pending"], "saveAs");
answer(&files, None);
assert_eq!(a.poll_file_dialog().unwrap().unwrap()["done"], false);
assert!(a.closing.is_none() && !a.quit_requested && a.session.dirty, "nothing closes, nothing is lost");
assert!(!a.quit(), "the next quit asks again");
}
/// A late Save As answer belongs to the imported document that opened the picker: once that
/// document is closed, it writes nothing.
#[test]
+23 -114
View File
@@ -30,8 +30,7 @@
use craft::ui::contract::{BodyCx, Props as _, ShowContainer as _, SizeLimits};
// PLAN: assumed `craft::ui::runtime::env::WindowKey` is the facade path of ui-contract's `runtime/env/shell.rs` `WindowKey`.
use craft::ui::runtime::env::WindowKey;
use craft::ui::runtime::memory::SaveKey;
use craft::ui::runtime::windows::{WindowAction, WindowHost, windowless_root};
use craft::ui::runtime::windows::{WindowAction, WindowHost};
use craft::ui::shell::DocumentWindow;
use craft::ui::style::StyleCx;
use craft::window::{Document, WindowId, WindowList, WindowMenu};
@@ -113,13 +112,6 @@ pub struct Windows {
/// Whether the root OS window had focus in the last pass; a [`DocumentWindow`] reports its own gain
/// (`focus_gained`), the root's is read from the window host's facts.
root_focused: bool,
/// The window that takes and keeps the saved place (windowless root only: the root has no OS
/// window, so the first document window does). It stays this window: one that later becomes the
/// root entry must not jump to the saved place.
// lean: once it closes no window saves its place; hand the key over (save-only) if users miss it.
main_window: Option<WindowId>,
/// Documents whose window could not open: they get no new window, or every frame would retry.
failed_open: Vec<u64>,
}
impl Windows {
@@ -127,16 +119,7 @@ impl Windows {
pub(crate) fn new(doc: u64) -> Windows {
let mut list = WindowList::new();
let id = list.open(Window::new(doc, None, None, false));
Windows {
native: cfg!(not(target_arch = "wasm32")),
list,
root: id,
shown: id,
arranged: arrange::State::default(),
root_focused: false,
main_window: None,
failed_open: Vec::new(),
}
Windows { native: cfg!(not(target_arch = "wasm32")), list, root: id, shown: id, arranged: arrange::State::default(), root_focused: false }
}
/// Whether documents get native windows of their own.
@@ -209,7 +192,7 @@ impl Windows {
/// The viewport window `id` draws in, while its OS window is open: the root's for the root
/// entry, else the one the window host names for the window's container.
fn viewport_of(&self, ctx: &egui::Context, id: WindowId) -> Option<ViewportId> {
if id == self.root && !windowless_root(ctx) {
if id == self.root {
return Some(ViewportId::ROOT);
}
WindowHost::of(ctx).viewport_of(window_container_id(id))
@@ -229,20 +212,11 @@ impl WordApp {
/// The egui viewport of the active window, the one focused last: control input,
/// `ui.screenshot` and `ui.resize` are its. The root viewport when the windows don't have
/// viewports of their own (the web app, embedded viewports). With a windowless root it is always a
/// document viewport (the root has no window to draw, screenshot or take input), the first open one
/// when the active window has none yet; the root only before any document window exists.
/// viewports of their own (the web app, embedded viewports) or the window has none yet.
pub fn active_viewport(&self) -> ViewportId {
let Some(ctx) = self.ctx.as_ref().filter(|ctx| self.windows.native && WindowHost::of(ctx).opens_windows()) else { return ViewportId::ROOT };
let id = self.windows.list.active().unwrap_or(self.windows.shown);
let own = self.windows.viewport_of(ctx, id);
if windowless_root(ctx) { own.or_else(|| self.windows.viewports(ctx).first().copied()) } else { own }.unwrap_or(ViewportId::ROOT)
}
/// The viewport of the window with key `key` (the number `ui.inspect` windows gives: `current`, `others[].id`): `None` when there is no such window or its OS window isn't open yet.
pub fn window_viewport(&self, key: u64) -> Option<ViewportId> {
let ctx = self.ctx.as_ref().filter(|ctx| self.windows.native && WindowHost::of(ctx).opens_windows())?;
self.windows.viewport(ctx, key)
self.windows.viewport_of(ctx, id).unwrap_or(ViewportId::ROOT)
}
/// Whether a close request for the root viewport closes only the window drawn there: true
@@ -408,12 +382,7 @@ impl WordApp {
let behind = self.windows.list.active();
let active = self.session.document_id();
for d in self.session.documents() {
if d.id == active
|| Some(d.id) == self.no_document
|| d.id == self.shown_document
|| self.windows.of_doc(d.id).is_some()
|| self.windows.failed_open.contains(&d.id)
{
if d.id == active || Some(d.id) == self.no_document || d.id == self.shown_document || self.windows.of_doc(d.id).is_some() {
continue;
}
self.windows.list.open(Window::new(d.id, Some(Box::new(WindowUi::new(d.id))), None, true));
@@ -493,9 +462,7 @@ impl WordApp {
w.requests.push(req.clone());
}
if let Some(ctx) = &self.ctx {
ctx.request_repaint_of(
self.windows.viewport(ctx, key).or_else(|| self.windows.viewports(ctx).first().copied()).unwrap_or(ViewportId::ROOT),
);
ctx.request_repaint_of(self.windows.viewport(ctx, key).unwrap_or(ViewportId::ROOT));
}
true
}
@@ -568,28 +535,22 @@ impl WordApp {
self.after_windows();
return;
}
let root = self.windows.root;
// A windowless root has no window: its entry is a document window like the others. With a
// visible root (X11) the root window draws the root entry itself.
let windowless = windowless_root(&ctx);
if !windowless {
let raise_root = self.windows.list.get_mut(root).is_some_and(|w| std::mem::take(&mut w.raise));
if raise_root {
WindowHost::of(&ctx).act(ViewportId::ROOT, WindowAction::Focus);
}
self.draw_entry(ui, root.get());
// The root window gaining OS focus makes its entry the active one, as a child's `focus_gained` does.
let root_focused = WindowHost::of(&ctx).facts(ViewportId::ROOT).is_some_and(|facts| facts.focused);
if root_focused && !std::mem::replace(&mut self.windows.root_focused, root_focused) {
self.windows.list.focus(root);
}
self.windows.root_focused = root_focused;
let raise_root = self.windows.list.get_mut(self.windows.root).is_some_and(|w| std::mem::take(&mut w.raise));
if raise_root {
WindowHost::of(&ctx).act(ViewportId::ROOT, WindowAction::Focus);
}
self.draw_entry(ui, self.windows.root.get());
let root = self.windows.root;
// The root window gaining OS focus makes its entry the active one, as a child's `focus_gained` does.
let root_focused = WindowHost::of(&ctx).facts(ViewportId::ROOT).is_some_and(|facts| facts.focused);
if root_focused && !std::mem::replace(&mut self.windows.root_focused, root_focused) {
self.windows.list.focus(root);
}
self.windows.root_focused = root_focused;
let menu = self.window_menu();
let step = StyleCx::with_root(&ctx, |cx| cx.tokens.size.window.cascade);
let ids: Vec<WindowId> = self.windows.list.ids().filter(|&id| windowless || id != root).collect();
let ids: Vec<WindowId> = self.windows.list.ids().filter(|&id| id != root).collect();
let mut closes = Vec::new();
let mut failed = Vec::new();
for id in ids {
let Some(w) = self.windows.list.get_mut(id) else { continue };
let (raise, place) = (std::mem::take(&mut w.raise), std::mem::take(&mut w.place));
@@ -599,40 +560,17 @@ impl WordApp {
if raise {
window = window.raise();
}
let first = windowless && id == root && self.windows.main_window.is_none();
if first {
self.windows.main_window = Some(id);
}
let main = windowless && self.windows.main_window == Some(id);
if main {
// Every frame, so the place is saved as the user moves or sizes the window.
window = window.remember(SaveKey::new("wordcraft.main_window"));
}
if place && let Some(rect) = self.cascade_from(ui, id, step) {
window = window.first_placed(rect);
} else if first {
// The first window takes the place the root window had: the saved one, else the default size.
let default = egui::Rect::from_min_size(egui::pos2(80.0, 60.0), egui::vec2(1440.0, 920.0));
window = window.first_placed(default);
}
let mut drawn = false;
let out = window
.show(ui, |ui, cx| {
drawn = true;
self.draw_window(ui, cx, id)
})
.output;
let out = window.show(ui, |ui, cx| self.draw_window(ui, cx, id)).output;
if out.focus_gained {
self.windows.list.focus(id);
}
if out.close_requested.is_some() {
// Asked to close without ever drawing: the window could not be opened.
if drawn { closes.push(id) } else { failed.push(id) }
closes.push(id);
}
}
for id in failed {
self.window_failed_to_open(id);
}
self.window_events(&closes);
self.after_windows();
}
@@ -685,42 +623,13 @@ impl WordApp {
/// host asks about ([`WordApp::close_requested`]).
fn window_events(&mut self, closes: &[WindowId]) {
for &id in closes {
if self.quit_requested || !self.windows.list.contains(id) {
if self.quit_requested || self.windows.list.len() <= 1 || !self.windows.list.contains(id) {
continue;
}
if self.windows.list.len() > 1 {
self.close_window(id.get());
} else if self.ctx.as_ref().is_some_and(windowless_root) {
// The only window has no root to take its close: it asks as a quit does, which
// ends the app once every document is answered for.
if self.raise_closing().is_none()
&& self.close_requested()
&& let Some(ctx) = &self.ctx
{
WindowHost::of(ctx).act(ViewportId::ROOT, WindowAction::Close);
}
}
self.close_window(id.get());
}
}
/// Window `id` was asked to close before it drew: the OS refused it (no window or surface). Its
/// entry goes without a Save prompt and the person is told; the document stays open. With no
/// other window the app has nothing to show and ends.
fn window_failed_to_open(&mut self, id: WindowId) {
let Some(doc) = self.windows.list.get(id).map(|w| w.doc) else { return };
let name = self.session.documents().into_iter().find(|d| d.id == doc).map(|d| d.title).unwrap_or_default();
log::error!("window for document {doc} could not be opened");
if self.windows.list.len() <= 1 {
// lean: no window to tell the person in; the log has it. Quit rather than run with nothing.
self.quit_requested = true;
return;
}
self.windows.failed_open.push(doc);
self.windows.list.close(id);
self.settle_windows();
self.status(crate::i18n::fmt(tl!("A window for “{name}” could not be opened, so that document has no window."), &[("name", &name)]));
}
/// The close button of window `key` (not the last one): File › Close in that window, which
/// asks about unsaved changes first.
pub(crate) fn close_window(&mut self, key: u64) {
-219
View File
@@ -38,13 +38,6 @@ impl Rig {
Rig { kit: Kit::with(spec), focused: None, closing: Vec::new(), commands: Vec::new(), drawn: Vec::new(), builders: Vec::new() }
}
/// A rig whose root is a windowless logical root: every document window is a child.
fn windowless() -> Rig {
let spec = craft::ui::InstallSpec::new(craft::host::target::ShellInfo::default(), Arc::new(craft::ui::testing::windows::FakeSystem::new()))
.windowless_root();
Rig { kit: Kit::with(spec), focused: None, closing: Vec::new(), commands: Vec::new(), drawn: Vec::new(), builders: Vec::new() }
}
fn ctx(&self) -> egui::Context {
self.kit.ctx.clone()
}
@@ -809,25 +802,6 @@ fn quitting_asks_about_each_document_in_its_window() {
assert!(a.quit_requested);
}
/// The app menu's Quit (`ui.quit`) asks about unsaved documents like the Dock's Quit, instead of
/// closing one window (#8709).
#[test]
fn quit_command_asks_about_each_unsaved_document() {
let mut rig = Rig::new();
let mut a = app("One");
rig.frames(&mut a, 2);
a.run("file.new", json!({})).unwrap();
a.run("text.insert", json!({"text": "Two"})).unwrap();
rig.frames(&mut a, 2);
a.run("ui.quit", json!({})).unwrap();
assert_eq!(prompt(&a).as_deref(), Some("saveChanges"));
a.run("ui.saveChanges", json!({"answer": "dontSave"})).unwrap();
assert_eq!(prompt(&a).as_deref(), Some("saveChanges"), "the other document asks too");
assert!(!a.quit_requested);
a.run("ui.saveChanges", json!({"answer": "dontSave"})).unwrap();
assert!(a.quit_requested);
}
fn window_labels(a: &WordApp) -> Vec<String> {
let mut l: Vec<String> = a.switch_windows_entries().into_iter().map(|(_, label, _)| label).collect();
l.sort();
@@ -944,33 +918,6 @@ fn a_programmatic_close_of_one_of_two_windows_on_a_document_is_accepted() {
assert!(refused.is_some(), "closing the document would lose the work: {refused:?}");
}
/// `file.close {"save": true}` on a document shown in two windows closes the window alone but
/// still writes the document first.
#[test]
fn a_saving_close_of_one_of_two_windows_writes_the_document() {
let mut rig = Rig::new();
let mut a = app("");
let path = docx_on_disk("saving-close", "First");
a.run("file.open", json!({"path": path.to_string_lossy()})).unwrap();
rig.frames(&mut a, 2);
a.run("text.insert", json!({"text": " more"})).unwrap();
a.run("view.newWindow", json!({})).unwrap();
rig.frames(&mut a, 2);
assert_eq!(a.window_count(), 2);
assert!(a.session.dirty);
let before = std::fs::read(&path).unwrap();
let (req, _reply) = ControlRequest::new("engine.execute", json!({"command": "file.close", "params": {"save": true}}));
let r = match crate::control::handle(&mut a, &rig.ctx(), &req) {
Reply::Done(v) => v,
_ => json!({"ok": false, "error": "not a reply"}),
};
assert_eq!(r["ok"], true, "{r}");
assert_eq!(a.window_count(), 1, "the window closed");
assert!(!a.session.dirty, "the document was saved");
assert_ne!(std::fs::read(&path).unwrap(), before, "the file on disk changed");
}
/// The file picks the app asked for, answered when the test says so.
type Shown = Arc<ScriptedFiles>;
@@ -1153,169 +1100,3 @@ fn mod_shift_v_with_nothing_copied_pastes_text_in_second_window() {
rig.frame(&mut a);
assert_eq!(text(&a), "pasted", "Mod+Shift+V with nothing copied pastes text in the second OS window");
}
/// A control-channel request, answered as the channel answers it.
fn ctl(a: &mut WordApp, rig: &Rig, method: &str, params: serde_json::Value) -> serde_json::Value {
let (req, _) = ControlRequest::new(method, params);
match crate::control::handle(a, &rig.ctx(), &req) {
Reply::Done(v) => v,
_ => json!({"ok": false, "error": "not a reply"}),
}
}
/// Spec rule 8: `file.close` on unsaved work needs `save` (write, then close) or `force`; a
/// document with no file can't be saved without asking, so `save` refuses it.
#[test]
fn file_close_over_control_needs_save_or_force_and_save_writes_first() {
let path = docx_on_disk("close-save", "First");
let mut rig = Rig::new();
let mut a = app("First");
a.run("file.save", json!({"path": path.to_string_lossy()})).unwrap();
a.run("file.autosave", json!({"value": false})).unwrap();
a.run("text.insert", json!({"text": " edited"})).unwrap();
let first = a.session.document_id();
a.run("file.new", json!({})).unwrap();
a.run("text.insert", json!({"text": "Draft"})).unwrap();
let draft = a.session.document_id();
rig.frames(&mut a, 2);
a.show_window(a.windows.of_doc(first).unwrap());
let r = ctl(&mut a, &rig, "engine.execute", json!({"command": "file.close"}));
assert_eq!(r["ok"], false);
assert!(r["error"].as_str().unwrap().contains("pass save or force"), "{r}");
assert!(a.session.is_open(first) && a.closing.is_none(), "refused: nothing closes and nothing asks");
let r = ctl(&mut a, &rig, "engine.execute", json!({"command": "file.close", "params": {"save": true}}));
assert_eq!(r["ok"], true, "{r}");
assert!(!a.session.is_open(first) && a.closing.is_none());
let mut saved = Session::new(wordcraft_doc::Document::new());
saved.run("file.open", &json!({"path": path.to_string_lossy()})).unwrap();
assert_eq!(saved.doc.plain_text(StoryRef::Body).trim(), "First edited");
std::fs::remove_dir_all(path.parent().unwrap()).ok();
let r = ctl(&mut a, &rig, "engine.execute", json!({"command": "file.close", "params": {"save": true}}));
assert_eq!(r["ok"], false, "a never-saved document has nowhere to save: {r}");
assert!(a.session.is_open(draft) && a.closing.is_none());
let r = ctl(&mut a, &rig, "engine.execute", json!({"command": "file.close", "params": {"force": true}}));
assert_eq!(r["ok"], true, "{r}");
assert!(!a.session.is_open(draft));
}
/// Spec rule 8: `ui.closeWindow` closes the active window, or the one `window` names.
#[test]
fn ui_closewindow_closes_the_active_window_or_the_one_named() {
let mut rig = Rig::new();
let mut a = app("One");
rig.frames(&mut a, 2);
a.run("file.new", json!({})).unwrap();
rig.frames(&mut a, 2);
let middle = a.windows.shown();
let middle_vp = a.active_viewport();
a.run("file.new", json!({})).unwrap();
rig.frames(&mut a, 2);
let active_vp = a.active_viewport();
assert_ne!(middle_vp, active_vp);
let r = ctl(&mut a, &rig, "ui.closeWindow", json!({"window": middle}));
assert_eq!(r["ok"], true, "{r}");
rig.frame(&mut a);
assert!(rig.sent(middle_vp, &ViewportCommand::Close) && !rig.sent(active_vp, &ViewportCommand::Close), "only the named window");
ctl(&mut a, &rig, "ui.closeWindow", json!({}));
rig.frame(&mut a);
assert!(rig.sent(active_vp, &ViewportCommand::Close), "no `window`: the active one");
assert_eq!(ctl(&mut a, &rig, "ui.closeWindow", json!({"window": 9999}))["ok"], false);
}
/// Spec rule 3: clicking another window while the Save prompt is up brings the prompt back
/// (existing focus handling already does; this pins it).
#[test]
fn clicking_another_window_while_a_prompt_is_up_raises_the_prompt() {
let mut rig = Rig::new();
let mut a = app("First");
rig.frames(&mut a, 2);
let first = a.windows.shown();
a.run("file.new", json!({})).unwrap();
a.run("text.insert", json!({"text": "Second"})).unwrap();
rig.frames(&mut a, 2);
let child = a.active_viewport();
a.close_window(first);
rig.frame(&mut a);
let owner = a.closing.as_ref().unwrap().window;
assert_eq!(owner, first);
rig.focus(child);
let mut raised = false;
for _ in 0..3 {
rig.frame(&mut a);
raised |= rig.sent(ViewportId::ROOT, &ViewportCommand::Focus);
}
assert!(raised, "the prompt's window comes to the front");
assert_eq!(a.closing.as_ref().map(|c| c.window), Some(first), "still the one prompt, still its window's");
}
/// Spec rule 6: Quit asks about each unsaved document in turn; Cancel on the second stops the
/// quit and leaves the remaining windows as they were. A following quit then asks again.
#[test]
fn quit_with_three_modified_documents_asks_three_times_and_cancel_keeps_two() {
let mut rig = Rig::new();
let mut a = app("One");
rig.frames(&mut a, 2);
for t in ["Two", "Three"] {
a.run("file.new", json!({})).unwrap();
a.run("text.insert", json!({"text": t})).unwrap();
rig.frames(&mut a, 2);
}
assert_eq!(a.window_count(), 3);
assert!(!a.quit());
assert_eq!(prompt(&a).as_deref(), Some("saveChanges"));
a.run("ui.saveChanges", json!({"answer": "dontSave"})).unwrap();
assert_eq!(prompt(&a).as_deref(), Some("saveChanges"), "the second asks");
a.run("ui.saveChanges", json!({"answer": "cancel"})).unwrap();
assert!(!a.quit_requested && a.closing.is_none());
rig.frames(&mut a, 2);
assert_eq!((a.window_count(), a.session.documents().len()), (2, 2), "Cancel keeps the two that are left");
assert!(!a.quit(), "the next quit asks again");
a.run("ui.saveChanges", json!({"answer": "dontSave"})).unwrap();
a.run("ui.saveChanges", json!({"answer": "dontSave"})).unwrap();
assert!(a.quit_requested);
}
/// Spec rule 1 with the windowless root: the first window is a child like the rest, nothing draws in the root, and
/// closing the first of two windows closes that window's document and leaves the other as it was.
#[test]
fn windowless_root_draws_every_document_in_a_child_and_closes_exactly_the_requested_one() {
let mut rig = Rig::windowless();
let mut a = app("First");
let first_doc = a.session.document_id();
rig.frames(&mut a, 2);
a.run("file.new", json!({})).unwrap();
a.run("text.insert", json!({"text": "Second"})).unwrap();
let second_doc = a.session.document_id();
rig.frames(&mut a, 3);
let viewports = a.windows.viewports(&rig.ctx());
assert_eq!(viewports.len(), 2);
assert!(!viewports.contains(&ViewportId::ROOT), "the root is no document window");
assert_ne!(a.active_viewport(), ViewportId::ROOT);
let first_vp = viewports[0];
rig.close(first_vp);
rig.frames(&mut a, 2);
assert_eq!(a.closing.as_ref().unwrap().guard.current(), Some(&first_doc), "the window closed is the one asked about");
a.run("ui.saveChanges", json!({"answer": "dontSave"})).unwrap();
rig.frames(&mut a, 2);
assert!(!a.session.is_open(first_doc) && a.session.is_open(second_doc));
assert_eq!(text(&a), "Second");
assert_eq!(a.window_count(), 1);
}
/// `ui.closeWindow` says so when nothing was asked: a Save prompt is already up (spec rule 4).
#[test]
fn ui_closewindow_reports_not_requested_while_a_prompt_is_up() {
let mut rig = Rig::new();
let mut a = app("One");
rig.frames(&mut a, 2);
a.run("file.new", json!({})).unwrap();
a.run("text.insert", json!({"text": "Two"})).unwrap();
rig.frames(&mut a, 2);
let first = a.windows.root_key();
a.close_window(first);
rig.frame(&mut a);
assert!(a.closing.is_some());
let r = ctl(&mut a, &rig, "ui.closeWindow", json!({}));
assert_eq!(r["result"]["requested"], false, "{r}");
}
-12
View File
@@ -13,18 +13,6 @@ draws the document itself, so there it stays as it is. The mechanism comes
from the prototype in storytold/craft-libs#584; the framework docs (`docs/craft-framework.md` in
craft-libs) will carry it.
## Amendment 2026-12-03: X11 keeps a visible root
On X11, XWayland and BSD on X11, egui's windowless root (`RootViewportMode::Windowless`, storytold/egui#91)
returns `UnsupportedConfiguration`. There WordCraft falls back to the visible windowed root, and the old
behaviour stays: closing the first window moves another document into it (#7752), because the root window
can't close while the app runs. The other close rules in [the spec](../specs/multi-window-close.md) still
apply. Revisit when egui supports the windowless root on X11 (asked of Skylar, 2026-12-03).
Under the windowless root, Save As and Open have no parent window: egui gives child viewports no window
handle and craft-libs' dialogs take only the root's. They work, but on macOS they are not sheets and on
Windows they don't block their document window, until craft-libs can parent a dialog to a document window.
## Considered options
- **Root takes over another document** (the old behaviour): no framework change, but it is the reported bug,
+2 -3
View File
@@ -116,7 +116,7 @@ let apps move windows, so there Arrange All and Side by Side only resize.
| `ui.dialog.set` | `dialog` (an `id` from `ui.inspect`'s `dialogs`, or `"top"`), `field` and `value`, or `fields` (`[{"field", "value"}]`, all or none) | sets the dialog's fields |
| `ui.dialog.confirm` | `dialog`, `choice?` (which button of a prompt) | answers OK, as the default button does |
| `ui.dialog.cancel` | `dialog` | closes the dialog, as Escape does |
| `ui.closeWindow` | `window?` | the close button of the window with that key (from `ui.inspect` → `windows`: `current`, `others[].id`), the active window by default: unsaved work brings up the Save prompt in that window; the reply's `requested` says whether the close was asked for (false while a Save prompt is already open: answer it first); errors "no document window is open" when only the windowless root remains |
| `ui.closeWindow` | — | the root window's close button: unsaved work brings up the Save prompt; the reply's `requested` says whether the close was asked for |
| `ui.clipboard` | `text?`, `html?`, `rtf?`, `png?` (base64) | puts those flavours on the clipboard; the reply's `offered` lists them |
| `ui.replayAt` | `at` (0–1) | holds Ink Replay at that fraction of its length, while Ink Replay is on |
| `app.quit` | `force?` | quits (see [Closing the document](#closing-the-document)) |
@@ -223,8 +223,7 @@ discard unsaved work is **refused with an error** (the app keeps running and the
save first (`file.save`), or pass `{"force": true}` to discard the changes and go ahead.
`file.close` closes the shown document, so it is refused while that document has unsaved
changes (`unsaved changes: pass save or force`); `{"save": true}` writes it first (a document with no
file yet is an error, never a prompt) and then closes it; the bare form `{"method": "file.close", "params": {"force": true}}` (a method name that is a
changes; the bare form `{"method": "file.close", "params": {"force": true}}` (a method name that is a
command id) is guarded the same way, and only a boolean `true` counts as `force`. A document
without unsaved changes closes at once (#1268). Closing closes the document and its window, and
the window focused before it becomes the active one. The last window stays open with no page,
+1 -2
View File
@@ -218,8 +218,7 @@ document: the tool works on that document and the active one stays active.
An id that names no open document, or a value that isn't a whole number from 0 up, is a tool error.
`execute` with `view.switchWindows {"id": n}` makes a document active, and `file.closeDocument
{"id": n, "force"?: true}` closes one (unsaved changes need `force`); `file.close {"save"?: true, "force"?: true}` closes the shown
document, and unsaved changes need `save` (write, then close) or `force`. Through `--connect`, `doc`
{"id": n, "force"?: true}` closes one (unsaved changes need `force`). Through `--connect`, `doc`
reaches the app's control channel (see [Open documents](control-protocol.md#open-documents)); the
app's window keeps showing the document it showed. `screenshot`, `click` and `key` act on the
window, so they work on the document on screen.
+1 -3
View File
@@ -312,9 +312,7 @@ fi
if [[ -z "${CROSS_TARGET:-}" ]]; then
"$STAGE/usr/bin/wordcraft-cli" --version
elif [[ -n "${EMULATOR:-}" ]]; then
# Set, so the CLI doesn't restart itself to apply it (malloc_tuning, #7914): under user-mode
# QEMU without binfmt the kernel can't run the restarted foreign binary, and glibc hands it to /bin/sh.
MALLOC_TRIM_THRESHOLD_=131072 "$EMULATOR" "$STAGE/usr/bin/wordcraft-cli" --version
"$EMULATOR" "$STAGE/usr/bin/wordcraft-cli" --version
fi
echo "==> done"
ls -lh "$DIST"