From 13a8d30fa1d2952d9ff91e15daa0b5d9a32522f9 Mon Sep 17 00:00:00 2001 From: Martin Ball Date: Wed, 18 Nov 2026 22:39:15 +0000 Subject: [PATCH 1/2] base-facade: facade features forward the family crates a member's ui feature turns on (dialogs, pages, review) --- crates/craft/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/craft/Cargo.toml b/crates/craft/Cargo.toml index 9a92f14c0..eeb7ccd6e 100644 --- a/crates/craft/Cargo.toml +++ b/crates/craft/Cargo.toml @@ -323,7 +323,7 @@ deckcraft-format = ["dep:craft-deckcraft-format"] designcraft-format = ["dep:craft-designcraft-format"] -dialogs = ["dep:craft-dialogs"] # native only: rfd's folder picker and file paths +dialogs = ["dep:craft-dialogs", "browse"] # native only: rfd's folder picker and file paths doc = ["dep:craft-doc"] doc-pcraft-pixels = ["doc", "craft-doc/pcraft-pixels"] @@ -542,7 +542,7 @@ openpgp = ["dep:craft-openpgp"] ora = ["dep:craft-ora"] -pages = ["dep:craft-pages"] +pages = ["dep:craft-pages", "keymap", "text"] palette = ["dep:craft-palette"] @@ -642,7 +642,7 @@ raw-raf = ["raw", "craft-raw/raf"] raw-rw2 = ["raw", "craft-raw/rw2"] raw-srw = ["raw", "craft-raw/srw"] -review = ["dep:craft-review", "keymap"] +review = ["dep:craft-review", "keymap", "pages"] rtf = ["dep:craft-rtf"] rtf-doc = ["rtf", "craft-rtf/doc"] From cb312039543899016050be8df0a53ae6d2e16143 Mon Sep 17 00:00:00 2001 From: Martin Ball Date: Wed, 18 Nov 2026 22:53:47 +0000 Subject: [PATCH 2/2] craft families test: allow dialogs->browse, pages->text, review->pages with reasons --- crates/craft/tests/families.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/crates/craft/tests/families.rs b/crates/craft/tests/families.rs index 4ddea2ab5..5ca90293c 100644 --- a/crates/craft/tests/families.rs +++ b/crates/craft/tests/families.rs @@ -37,6 +37,13 @@ const BASE: &[&str] = &["color-ui"]; /// and not a family itself. const COMPOSITION: &[&str] = &["menu"]; +/// Edges between families that are allowed, each with its reason (developer ruling, port S-L347). +const ALLOWED: &[(&str, &str, &str)] = &[ + ("dialogs", "browse", "the file chooser lists browse's places"), + ("pages", "text", "the page rulers are text's ruler over a page"), + ("review", "pages", "comment balloons sit beside placed pages"), +]; + /// Family crates `m`'s `ui` depends on: through its `ui` feature, and through dependencies that turn `ui` on. fn ui_edges(m: &Member) -> Vec { let mut edges: Vec = m.features.get("ui").into_iter().flatten().filter_map(|e| common::crate_of(e)).map(str::to_owned).collect(); @@ -58,10 +65,12 @@ fn family_ui_depends_on_no_other_family() { let mut offenders = Vec::new(); for m in members().iter().filter(|m| FAMILIES.contains(&m.dir.as_str()) && !COMPOSITION.contains(&m.dir.as_str())) { for dep in ui_edges(m) { - if dep != m.dir && FAMILIES.contains(&dep.as_str()) && !BASE.contains(&dep.as_str()) { + if dep != m.dir && FAMILIES.contains(&dep.as_str()) && !BASE.contains(&dep.as_str()) + && !ALLOWED.iter().any(|(from, to, _)| *from == m.dir && *to == dep) + { offenders.push(format!("craft-{}'s ui depends on craft-{dep}", m.dir)); } } } - assert!(offenders.is_empty(), "family ui crates may depend only on craft-color-ui's ui, not on each other:\n{}", offenders.join("\n")); + assert!(offenders.is_empty(), "family ui crates may depend only on craft-color-ui's ui, not on each other (beyond ALLOWED):\n{}", offenders.join("\n")); }