From e90e26545388df50393872fec36db652a2c76ee0 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Wed, 14 Oct 2026 14:45:12 -0400 Subject: [PATCH] Fix up merged PRs: Grid Options guides follow #559, and its dialog test finds its own Spacing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Turning guides on in Grid Options (#536) now adds the two centre guides to a presentation without any, as View › Guides does since #559 stopped drawing fixed centre lines. - The Grid Options dialog test looked for any "Spacing" label; main's ribbon has Line Spacing too, so it looks for "Spacing (pt)". Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index f8f188b1..d27f163c 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -588,6 +588,10 @@ impl SlideApp { } if let Some(b) = guides { self.ui.guides = b; + // As View › Guides: a presentation without guides gets the two centre guides. + if b && self.session.active().is_some_and(|d| d.doc.guides.is_empty()) { + let _ = self.session.execute("guide.add", &json!({"defaults": true})); + } } } else { self.dialog = Some(dialogs::Dialog::new("gridOptions")); @@ -1690,7 +1694,7 @@ mod tests { harness.run_steps(2); assert!(harness.query_by_label_contains("Display grid on screen").is_some()); assert!(harness.query_by_label_contains("Snap objects to grid").is_some()); - assert!(harness.query_by_label_contains("Spacing").is_some()); + assert!(harness.query_by_label_contains("Spacing (pt)").is_some()); let show_grid = harness .query_all_by_role_and_label(egui::accesskit::Role::CheckBox, "Display grid on screen") .next()