Repository navigation
fix(ui-egui): an inserted date or time can be undone - #187
Conversation
Inserting text into the page did not record an undo step, so Ctrl+Z could not take an inserted date back. The step is now recorded before the insert. A test was written first. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
|
Audit finding: Undo works in the new test, but Redo cannot restore the inserted date. Reproduced on this PR's exact head // Save this immediately after the existing "the date was inserted" assertion:
let inserted = h.state().body().unwrap_or_default().to_string();
// Keep the existing Ctrl+Z and "undo takes the inserted date back" assertion, then:
ask(&mut h, "ui.key", json!({"key": "Y", "ctrl": true})).expect("redo");
settle(&mut h);
assert_eq!(h.state().body().unwrap_or_default().to_string(), inserted,
"redo restores the inserted date");
Repeated with a normal newline-terminated |
Summary
Tests
undo_takes_back_an_inserted_dateincrates/ui-egui/tests/ui.rs, written first and seen to fail.Checks
cargo xtask ci: all checks passed, on the branch rebased ontoorigin/main(d0cc38d).🤖 Generated with Claude Code