From ca339a8ec0dcd29ac861b42b87345b656d4acbba Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 30 Nov 2026 03:29:04 +0000 Subject: [PATCH 1/4] A cancelled drag clears its smart guides cancel_drag cleared every preview but the smart guides, so a guide from a cancelled move stayed on the slide through the next tool's gesture. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/tests.rs | 17 +++++++++++++++++ crates/engine/src/tools/pointer.rs | 1 + 2 files changed, 18 insertions(+) diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index a21b52c67..a74284a46 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -1322,6 +1322,23 @@ fn a_cancelled_drag_inserts_nothing_and_puts_a_resize_back() { assert_eq!(s.doc().unwrap().history.undo.len(), undo, "and adds no undo step"); } +/// A cancelled move takes its smart guides with it: none is left on the slide for the next tool's gesture. +#[test] +fn a_cancelled_move_leaves_no_smart_guide() { + let mut s = session(); + let ev = |kind, x, y| PointerEvent { kind, x, y, mods: Mods::default(), tol: 3.0, pressure: None }; + s.execute("shape.insert", &json!({"preset": "rect", "rect": [100.0, 100.0, 100.0, 80.0]})).unwrap(); + let id = s.execute("shape.insert", &json!({"preset": "rect", "rect": [400.0, 300.0, 100.0, 80.0]})).unwrap()["id"].as_u64().unwrap(); + s.set_tool(ToolKind::Select); + s.execute("edit.select", &json!({"ids": [id]})).unwrap(); + s.pointer(ev(PointerKind::Down, 450.0, 340.0)).unwrap(); + // Level with the first rectangle's top. + s.pointer(ev(PointerKind::Drag, 450.0, 142.0)).unwrap(); + assert!(!s.tool.guides.is_empty(), "the moved shape shows a smart guide"); + s.cancel_drag(); + assert!(s.tool.guides.is_empty(), "the cancelled move leaves no guide"); +} + #[test] fn click_into_placeholder_starts_editing() { let mut s = session(); diff --git a/crates/engine/src/tools/pointer.rs b/crates/engine/src/tools/pointer.rs index d9cfb9509..da3745f08 100644 --- a/crates/engine/src/tools/pointer.rs +++ b/crates/engine/src/tools/pointer.rs @@ -228,6 +228,7 @@ impl Session { } self.tool.preview = None; self.tool.marquee = None; + self.tool.guides.clear(); self.tool.path_preview.clear(); self.tool.path_closing = false; self.tool.ink_preview.clear(); From 8bd6056ca9405d751ee64dc4ff8fadb1f63f0623 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 30 Nov 2026 03:29:06 +0000 Subject: [PATCH 2/4] Slide Sorter: inset the Add Section button from the window edge Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/sorter.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/sorter.rs b/crates/ui-egui/src/sorter.rs index e17397281..a114d65fb 100644 --- a/crates/ui-egui/src/sorter.rs +++ b/crates/ui-egui/src/sorter.rs @@ -129,7 +129,9 @@ pub fn show(app: &mut SlideApp, ui: &mut Ui) { let _ = app.run(&fired.command.id, fired.command.params); } } - if Button::new(words.add_section.clone()).show(ui).clicked() { + // The button stands off the window's edge, as production's 24 pt inset row. + let add = Stack::new().pad(Pad::Roomy).show(ui, |ui, _| Button::new(words.add_section.clone()).show(ui).clicked()); + if add.inner == Some(true) { let _ = app.run("section.add", json!({"at": cur})); } let make_grid = || { From 2d7711a468ee48263034eedaed7cd3a9362d665d Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 30 Nov 2026 03:29:08 +0000 Subject: [PATCH 3/4] Opening overlay dims the window behind it Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/opening.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/ui-egui/src/opening.rs b/crates/ui-egui/src/opening.rs index 1b5861277..b781d394d 100644 --- a/crates/ui-egui/src/opening.rs +++ b/crates/ui-egui/src/opening.rs @@ -93,7 +93,9 @@ impl SlideApp { let name = o.name(); let secs = ((monotonic_ms() - o.started_ms) / 1000.0).max(0.0); let mut open = true; + // The window behind dims, as production's, so it reads as blocked while the file opens. let shown = BlockingOverlay::new("Opening presentation") + .scrim(true) .opened(Bind::bound(&mut open)) .message(format!("Opening {name}…")) .cancel("Cancel") From af963475871bed6d18a2ad3db95d0fb5567b9ae2 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 30 Nov 2026 03:29:10 +0000 Subject: [PATCH 4/4] Test: the title bar's Home is on while Home is open Guards the framework fix that marks a checked bar item's part on. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/tests.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/crates/ui-egui/src/tests.rs b/crates/ui-egui/src/tests.rs index 4e0d5a894..fd769217b 100644 --- a/crates/ui-egui/src/tests.rs +++ b/crates/ui-egui/src/tests.rs @@ -277,6 +277,28 @@ fn change_picture_replaces_the_selected_picture() { } } +/// The title bar's Home button shows on while Home (the File view) is open over a presentation, and off once it is +/// left. +#[test] +fn the_title_bars_home_button_is_on_while_home_is_open() { + use egui::accesskit::Toggled; + use egui_kittest::kittest::{NodeT, Queryable}; + let mut h = crate::test_harness::harness(Session::with_new(), Services::default()); + h.run_steps(2); + // The title bar's item, not the File view's Home page in its side menu. + let in_title_bar = |node: &egui_kittest::Node<'_>| node.accesskit_node().bounding_box().is_some_and(|bounds| bounds.y1 <= 44.0); + let home_on = |h: &egui_kittest::Harness<'_, SlideApp>| { + let homes: Vec<_> = h.query_all_by(|node| node.label().is_some_and(|label| label.starts_with("Home"))).filter(in_title_bar).collect(); + assert!(!homes.is_empty(), "the title bar has a Home item"); + homes.iter().any(|node| node.accesskit_node().toggled() == Some(Toggled::True)) + }; + assert!(!home_on(&h), "Home is off over the slides"); + h.state_mut().run("app.home", json!({})).unwrap(); + h.run_steps(2); + assert!(h.state().backstage_open()); + assert!(home_on(&h), "Home is on while the File view is open"); +} + /// #17: Home created a new blank presentation instead of going to the start screen. #[test] fn home_shows_the_start_screen_over_the_open_presentation() {