From fdc667e010ea62f0a022801ded701de08d5424b4 Mon Sep 17 00:00:00 2001 From: yoriswind Date: Tue, 3 Nov 2026 15:58:39 -0800 Subject: [PATCH] Report rejected action continuations and exercise a real artboard edit --- crates/engine/tests/it/atn_newer_events.rs | 7 ++++++- crates/ui-egui/src/panels/actions.rs | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/engine/tests/it/atn_newer_events.rs b/crates/engine/tests/it/atn_newer_events.rs index acecf5ec7e..788e5aab57 100644 --- a/crates/engine/tests/it/atn_newer_events.rs +++ b/crates/engine/tests/it/atn_newer_events.rs @@ -680,10 +680,15 @@ fn artboard_edit_descriptor(background: i32, change_sizes: i32) -> Descriptor { fn artboard_background_edit_roundtrips_without_replaying_recorded_geometry() { for (kind, expected) in [(1, [1.0; 4]), (2, [0.0, 0.0, 0.0, 1.0]), (3, [0.0; 4]), (4, [0.25, 0.5, 0.75, 1.0])] { let mut s = artboard_fixture(); - s.execute("layer.new.artboardFromGroup", json!({})).unwrap(); + let initial_background = if kind == 1 { "black" } else { "white" }; + s.execute("layer.new.artboardFromGroup", json!({"background":initial_background})).unwrap(); Arc::make_mut(&mut s.active_mut().unwrap().doc).guides.horizontal.push(3.0); let before = s.active().unwrap().doc.clone(); let id = s.active().unwrap().active_layer.unwrap(); + assert_eq!( + before.layer(id).unwrap().artboard().unwrap().background, + if kind == 1 { photocraft_doc::ArtboardBackground::Black } else { photocraft_doc::ArtboardBackground::White } + ); let history = s.active().unwrap().history.past_len(); let d = artboard_edit_descriptor(kind, 8); assert_eq!(load(&mut s, &file("editArtboardEvent", d.clone()))["unsupported"], json!([])); diff --git a/crates/ui-egui/src/panels/actions.rs b/crates/ui-egui/src/panels/actions.rs index 653ceb03ca..34b2cf0ff2 100644 --- a/crates/ui-egui/src/panels/actions.rs +++ b/crates/ui-egui/src/panels/actions.rs @@ -955,6 +955,9 @@ pub fn resume(app: &mut PhotocraftApp, fields: &serde_json::Map) && let Err(e) = history.resume(&mut app.session) { restore_recording(app, owner.as_ref()); + let template = "Action playback failed: {error}"; + app.ui.status = crate::i18n::fmt(tl!(template), &[("error", &e.to_string())]); + app.ui.status_error = true; return Err(e.to_string()); } // The dialog's command may run as a background job; the next step needs its result.