From b65cd2c082c06ae7f2e802c9705ffcaf36e58a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Gregorio=20Rinc=C3=B3n?= Date: Fri, 27 Nov 2026 12:25:00 -0500 Subject: [PATCH 1/3] fix(ui): say on a figure's review that the sheet's reference isn't used (#3130) --- crates/ui-egui/src/publicationwizard/review.rs | 10 ++++++++++ crates/ui-egui/src/publicationwizard/sources.rs | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/crates/ui-egui/src/publicationwizard/review.rs b/crates/ui-egui/src/publicationwizard/review.rs index 897edc3d63..468129f86e 100644 --- a/crates/ui-egui/src/publicationwizard/review.rs +++ b/crates/ui-egui/src/publicationwizard/review.rs @@ -14,6 +14,16 @@ pub(super) fn review_step(ui: &mut egui::Ui, d: &Draft) { }; row(tl!("Size"), size_label(&d.size)); if d.figure() { + // A figure draws a reference of its own, so the figure note's "caption" doesn't cover + // one set on a sheet. + let unused = if d.no_reference { + Some(tl!("\"No cartographic reference\" isn't used: a figure takes the default reference")) + } else { + lines(&d.reference).next().map(|_| tl!("The lines typed aren't used: a figure takes the default reference")) + }; + if let Some(unused) = unused { + row(tl!("Reference"), unused.to_string()); + } return; } let turned = match d.orientation { diff --git a/crates/ui-egui/src/publicationwizard/sources.rs b/crates/ui-egui/src/publicationwizard/sources.rs index 478bab1ece..830e416519 100644 --- a/crates/ui-egui/src/publicationwizard/sources.rs +++ b/crates/ui-egui/src/publicationwizard/sources.rs @@ -391,6 +391,22 @@ mod tests { assert!(h.query_by_label(said).is_some()); } + /// A figure takes the command's default reference: the review says the lines or the tick set + /// on a sheet aren't used, and says nothing where neither was set. + #[test] + fn a_figures_review_says_the_sheets_reference_isnt_used() { + let lines = "The lines typed aren't used: a figure takes the default reference"; + let tick = "\"No cartographic reference\" isn't used: a figure takes the default reference"; + let mut h = at(Step::Review, |d| d.size = "figure-1col".into()); + assert!(h.query_by_label_contains("default reference").is_none(), "nothing set, nothing lost"); + h.state_mut().dialogs.publication.as_mut().unwrap().reference = "UTM 23S".into(); + h.run_steps(4); + assert!(h.query_by_label(lines).is_some() && h.query_by_label(tick).is_none()); + h.state_mut().dialogs.publication.as_mut().unwrap().no_reference = true; + h.run_steps(4); + assert!(h.query_by_label(tick).is_some() && h.query_by_label(lines).is_none()); + } + /// Create puts the sources, the reference and the heading given on the sheet, and Undo takes /// it away. #[test] From 585e259b934bb5da526fde60d6217b449873772f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Gregorio=20Rinc=C3=B3n?= Date: Fri, 27 Nov 2026 12:25:51 -0500 Subject: [PATCH 2/3] test(ui): name the left-out heading test by what it checks (#3130) --- crates/ui-egui/src/publicationwizard/sources.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/publicationwizard/sources.rs b/crates/ui-egui/src/publicationwizard/sources.rs index 830e416519..5c71c09f6f 100644 --- a/crates/ui-egui/src/publicationwizard/sources.rs +++ b/crates/ui-egui/src/publicationwizard/sources.rs @@ -145,9 +145,10 @@ mod tests { assert_eq!(d.params()["headings"], json!([PUBLICATION_HEADINGS[0], PUBLICATION_HEADINGS[1], "Col"])); } - /// A section left out takes no heading with it: not the reference's where there is none. + /// A heading typed for a section left out isn't sent: where a later heading follows, the + /// command's own goes in its place. #[test] - fn a_section_left_out_sends_no_heading() { + fn a_heading_typed_for_a_section_left_out_isnt_sent() { let mut d = draft(); d.headings = [String::new(), "Ref".into(), String::new()]; d.no_reference = true; From 44859abc7fd7466dac9bc786b1778c7dc0eb960a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Gregorio=20Rinc=C3=B3n?= Date: Fri, 27 Nov 2026 13:28:40 -0500 Subject: [PATCH 3/3] style(ui): say plainly why a figure's review names the sheet's reference (#3130) --- crates/ui-egui/src/publicationwizard/review.rs | 4 ++-- crates/ui-egui/src/publicationwizard/sources.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/publicationwizard/review.rs b/crates/ui-egui/src/publicationwizard/review.rs index 468129f86e..d714d45845 100644 --- a/crates/ui-egui/src/publicationwizard/review.rs +++ b/crates/ui-egui/src/publicationwizard/review.rs @@ -14,8 +14,8 @@ pub(super) fn review_step(ui: &mut egui::Ui, d: &Draft) { }; row(tl!("Size"), size_label(&d.size)); if d.figure() { - // A figure draws a reference of its own, so the figure note's "caption" doesn't cover - // one set on a sheet. + // The figure note sends a sheet's texts to the caption. Its reference doesn't go there + // (the figure draws the default one), so it is said here. let unused = if d.no_reference { Some(tl!("\"No cartographic reference\" isn't used: a figure takes the default reference")) } else { diff --git a/crates/ui-egui/src/publicationwizard/sources.rs b/crates/ui-egui/src/publicationwizard/sources.rs index 5c71c09f6f..112c29dc8b 100644 --- a/crates/ui-egui/src/publicationwizard/sources.rs +++ b/crates/ui-egui/src/publicationwizard/sources.rs @@ -396,16 +396,16 @@ mod tests { /// on a sheet aren't used, and says nothing where neither was set. #[test] fn a_figures_review_says_the_sheets_reference_isnt_used() { - let lines = "The lines typed aren't used: a figure takes the default reference"; + let typed = "The lines typed aren't used: a figure takes the default reference"; let tick = "\"No cartographic reference\" isn't used: a figure takes the default reference"; let mut h = at(Step::Review, |d| d.size = "figure-1col".into()); assert!(h.query_by_label_contains("default reference").is_none(), "nothing set, nothing lost"); h.state_mut().dialogs.publication.as_mut().unwrap().reference = "UTM 23S".into(); h.run_steps(4); - assert!(h.query_by_label(lines).is_some() && h.query_by_label(tick).is_none()); + assert!(h.query_by_label(typed).is_some() && h.query_by_label(tick).is_none()); h.state_mut().dialogs.publication.as_mut().unwrap().no_reference = true; h.run_steps(4); - assert!(h.query_by_label(tick).is_some() && h.query_by_label(lines).is_none()); + assert!(h.query_by_label(tick).is_some() && h.query_by_label(typed).is_none()); } /// Create puts the sources, the reference and the heading given on the sheet, and Undo takes