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 <noreply@anthropic.com>
This commit is contained in:
Dylan M. Taylor
2026-11-30 14:44:45 +00:00
co-authored by Claude Opus 5.5
parent fa20f96b6d
commit 8974f3b9df
+11 -5
View File
@@ -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:?}");
}
}
}