From 65e10fa0bd46ddaa4e1072dac3462ef00766e286 Mon Sep 17 00:00:00 2001 From: qvest-ssels <214787280+qvest-ssels@users.noreply.github.com> Date: Sun, 29 Nov 2026 13:23:07 +0100 Subject: [PATCH] Data Sets as Files: keep sets left out by Yes in the last set's error (#13767) When a Yes skipped a set and the resumed export then stopped at a missing image in the last set, the error notice named only that last file, so the set left out earlier was no longer reported. The notice now appends the existing "Data sets not exported" list. --- .../src/export_data_sets_missing_image_tests.rs | 16 ++++++++++++++++ crates/ui-egui/src/menus/view_cmds/dialogs.rs | 7 ++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/export_data_sets_missing_image_tests.rs b/crates/ui-egui/src/export_data_sets_missing_image_tests.rs index a0a2faa8966..daa0094931d 100644 --- a/crates/ui-egui/src/export_data_sets_missing_image_tests.rs +++ b/crates/ui-egui/src/export_data_sets_missing_image_tests.rs @@ -286,3 +286,19 @@ fn a_document_edited_while_asking_ends_the_export() { assert!(app.ui.status_error && app.ui.status.contains("changed"), "{}", app.ui.status); let _ = std::fs::remove_dir_all(dir); } + +#[test] +fn a_missing_last_set_after_a_yes_still_lists_the_set_left_out() { + let dir = scratch("yes-then-last"); + let out = dir.join("out"); + let (mut app, ctx) = app(&dir, &[true, false, false]); + export_from_form(&mut app, &ctx, &out); + let (id, _) = question(&app).unwrap(); + answer(&mut app, &ctx, id, true); + assert!(question(&app).is_none(), "the last set keeps today's error, no question"); + assert_eq!(files(&out), ["Data_Set_1.png"]); + let status = &app.ui.status; + assert!(app.ui.status_error && status.starts_with(photocraft_engine::DATA_SET_FILE_MISSING), "{status}"); + assert!(status.contains("Data Set 2"), "the set an earlier Yes left out stays listed: {status}"); + let _ = std::fs::remove_dir_all(dir); +} diff --git a/crates/ui-egui/src/menus/view_cmds/dialogs.rs b/crates/ui-egui/src/menus/view_cmds/dialogs.rs index fe0865e92d0..d6895686b78 100644 --- a/crates/ui-egui/src/menus/view_cmds/dialogs.rs +++ b/crates/ui-egui/src/menus/view_cmds/dialogs.rs @@ -1119,7 +1119,12 @@ fn data_sets_went_on(app: &mut PhotocraftApp, doc: Option let index = stopped.get("index").and_then(Value::as_u64).and_then(|n| usize::try_from(n).ok()); let remaining = stopped.get("remaining").and_then(Value::as_u64).unwrap_or(0); let (Some(index), true) = (index, remaining > 0) else { - let error = stopped.get("error").and_then(Value::as_str).unwrap_or(photocraft_engine::DATA_SET_FILE_MISSING).to_owned(); + let mut error = stopped.get("error").and_then(Value::as_str).unwrap_or(photocraft_engine::DATA_SET_FILE_MISSING).to_owned(); + // Sets an earlier Yes left out stay listed next to the last set's error. + if !skipped.is_empty() { + error.push(' '); + error.push_str(&crate::i18n::fmt(tl!("Data sets not exported (replacement file not found): {names}"), &[("names", &skipped.join(", "))])); + } crate::notices::error(app, error); return; };