From 8974f3b9dfc385de24c08c0fc3139733db6b356b Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 30 Nov 2026 14:44:45 +0000 Subject: [PATCH] Quick access Alt+digit: while editing text, the framework composes the top-row Alt code into the text craft-libs main composes top-row Alt codes (alt_code, upstream's suite-wide rule since the sync); the slot still does not run while text is edited, which the test keeps guarding, and only the edited text changes. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/tests.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/tests.rs b/crates/ui-egui/src/tests.rs index fd769217b..07c8709c9 100644 --- a/crates/ui-egui/src/tests.rs +++ b/crates/ui-egui/src/tests.rs @@ -1769,11 +1769,17 @@ fn alt_digit_runs_a_quick_access_slot_unless_text_is_edited() { if runs { !before } else { before }, "mac={mac}, editing={editing}, backstage={backstage}, key={key:?}" ); - assert_eq!( - serde_json::to_value(&h.state().session.active().unwrap().doc).unwrap(), - document, - "mac={mac}, editing={editing}, backstage={backstage}, key={key:?}" - ); + let after = serde_json::to_value(&h.state().session.active().unwrap().doc).unwrap(); + if editing { + // The framework composes a top-row Alt code into the text being edited (craft-libs alt_code, the suite's + // rule since the sync); what this guards is that the slot does not run, and only the edited text changes. + let title = |doc: &serde_json::Value| doc["slides"][0]["shapes"][0].clone(); + let mut rest = after.clone(); + rest["slides"][0]["shapes"][0] = title(&document); + assert_eq!(rest, document, "only the edited text changes: mac={mac}, key={key:?}"); + } else { + assert_eq!(after, document, "mac={mac}, editing={editing}, backstage={backstage}, key={key:?}"); + } } }