From 5b8316ec4e8cc3f00ac8a56154147c817e7f1964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Gregorio=20Rinc=C3=B3n?= Date: Sat, 28 Nov 2026 20:13:41 -0500 Subject: [PATCH 1/4] feat(ui): the Publication Layout Wizard leads New Layout and has a Publish button --- crates/ui-egui/src/ribbon.rs | 47 +++++++++++++++++++++++++++++------- docs/getting-started.md | 3 ++- docs/user-guide/layouts.md | 3 ++- 3 files changed, 42 insertions(+), 11 deletions(-) diff --git a/crates/ui-egui/src/ribbon.rs b/crates/ui-egui/src/ribbon.rs index 10bc2d758b..039bc8b9fb 100644 --- a/crates/ui-egui/src/ribbon.rs +++ b/crates/ui-egui/src/ribbon.rs @@ -1319,6 +1319,12 @@ fn project_group(app: &mut RustGisApp, ui: &mut Ui) { group(ui, "Project", |ui| { big(ui, app, "new_map", "New\nMap", "Add a new map to the project.", "map.new", Value::Null, false, false); big_menu(ui, app, "new_layout", "New\nLayout", "Add a page layout for printing and exporting the map.", |ui, app| { + // A publication layout asked step by step: its size, style and texts too (#2850). + if ui.button(tl!("Publication Layout Wizard…")).clicked() { + let _ = app.run("ui.dialog", json!({"name": "publicationWizard"})); + ui.close(); + } + ui.separator(); for (id, label, w, h) in rustgis_engine::map::layout::PAGES { if ui.button(page_label(label, *w, *h)).clicked() { let _ = app.run("layout.new", json!({"page": id})); @@ -1350,12 +1356,6 @@ fn project_group(app: &mut RustGisApp, ui: &mut Ui) { ui.close(); } } - // The same layout asked step by step: its texts and accent too (#2850). - ui.separator(); - if ui.button(tl!("Publication Layout Wizard…")).clicked() { - let _ = app.run("ui.dialog", json!({"name": "publicationWizard"})); - ui.close(); - } }); ui.separator(); if ui.button(tl!("Blank Letter page")).clicked() { @@ -3317,6 +3317,17 @@ fn share_groups(app: &mut RustGisApp, ui: &mut Ui) { }); }); group(ui, "Layout", |ui| { + big( + ui, + app, + "new_layout", + "Publication\nLayout", + "Make a publication sheet or figure of the map view, asked step by step.", + "ui.dialog", + json!({"name": "publicationWizard"}), + false, + false, + ); big(ui, app, "export", "Export\nLayout", "Export the open layout as PDF or PNG.", "ui.exportLayout", Value::Null, false, false); big( ui, @@ -7080,10 +7091,11 @@ mod tests { assert!(l.elements.iter().all(|e| e.name != "Panel Box" && e.name != "Title"), "a figure, its title left to the caption"); } - /// New Layout › Publication Layout › Publication Layout Wizard… opens the wizard and closes - /// the menu, with nothing made yet (#2850). + /// New Layout › Publication Layout Wizard…, the menu's first row (#3115) and no longer in the + /// Publication Layout submenu, opens the wizard and closes the menu, with nothing made yet + /// (#2850). #[test] - fn the_publication_menu_opens_the_wizard() { + fn the_new_layout_menu_opens_the_wizard() { let mut fonts = false; let mut h = egui_kittest::Harness::builder().with_size(vec2(1600.0, 1000.0)).build_ui_state( move |ui, app: &mut RustGisApp| { @@ -7102,6 +7114,11 @@ mod tests { h.run(); h.get_by_label("Publication Layout").hover(); h.run(); + // One row, the submenu open or not, above the first page size. + let wizard = h.get_by_label("Publication Layout Wizard…").rect(); + let (_, first, w, height) = rustgis_engine::map::layout::PAGES[0]; + let page = h.query_all_by_label(&page_label(first, w, height)).next().expect("the page sizes").rect(); + assert!(wizard.max.y <= page.min.y, "the wizard at {wizard:?}, the first page size at {page:?}"); h.get_by_label("Publication Layout Wizard…").click(); h.run(); assert_eq!(h.state().dialogs.open, Some("publicationWizard")); @@ -7110,6 +7127,18 @@ mod tests { assert!(h.query_by_label("Publication Layout Wizard…").is_none(), "the menu closed"); } + /// Publish › Layout › Publication Layout opens the wizard, with nothing made yet (#3115). + #[test] + fn the_publish_tab_opens_the_wizard() { + let mut h = tab_harness(cities(), share_groups); + let before = h.state().session.project.layouts.len(); + h.get_by_label("Publication Layout").click(); + h.run(); + assert_eq!(h.state().dialogs.open, Some("publicationWizard")); + assert!(h.state().dialogs.publication.is_some()); + assert_eq!(h.state().session.project.layouts.len(), before, "nothing made yet"); + } + /// A submenu of short rows (a sheet's styles) opens at least SUBMENU_MIN_W wide, not as a /// strip, and the row opening it is as tall as the menu's other rows (#2398). #[test] diff --git a/docs/getting-started.md b/docs/getting-started.md index edf90c18fb..aece1632bd 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -35,7 +35,8 @@ sample again. **Settings › Start-up › Start With** chooses what opens next t adds a web tile layer, and its **Celestial Bodies** take the map to the Moon or Mars. Right-drag (or ++ctrl++-drag) turns and tilts the map; click the north arrow to reset it. 6. **Share.** **Publish › Export Map** saves a PNG with labels and a scale bar. **Home › New - Layout** offers page sizes and **Publication Layout** presets for sheets (in one of seven styles) and figures. + Layout** offers page sizes and **Publication Layout** presets for sheets (in one of seven styles) and figures; + its **Publication Layout Wizard…**, also **Publish › Publication Layout**, asks for one step by step. Choose a page size for a page with a map frame, legend, north arrow and scale bar. **Project › Save As** writes a `.rgis` project. diff --git a/docs/user-guide/layouts.md b/docs/user-guide/layouts.md index a761b38d86..67df830555 100644 --- a/docs/user-guide/layouts.md +++ b/docs/user-guide/layouts.md @@ -39,7 +39,8 @@ Layouts open as tabs next to the maps; while one is open, its groups lead the Pu thesis (160 × 225 or 160 × 110 mm): the map edge to edge with a line of its projection and datum under it, at 7 pt. A figure's title and sources belong in its caption, so they are left out, and the result says so. - - **Step by step**: **Publication Layout Wizard…**, at the end of the same menu, asks for the size + - **Step by step**: **Publication Layout Wizard…**, first in Home › New Layout, or Publish › + **Publication Layout**, asks for the size (a sheet turned Auto, Portrait or Landscape, or a figure), the map extent and the layout's name, the style (each beside an outline of where its title, map and footer go, and its column or panel if it has one, with the accent colour picked, or else its own, where the sheet takes it, which From 363f18cf258b7e5b0c1e7f5da047b57d89423fde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Gregorio=20Rinc=C3=B3n?= Date: Sat, 28 Nov 2026 20:20:42 -0500 Subject: [PATCH 2/4] feat(ui): call the publication wizard Layout Wizard everywhere --- crates/ui-egui/src/dialogs.rs | 2 +- crates/ui-egui/src/publicationwizard/mod.rs | 6 +++--- crates/ui-egui/src/publicationwizard/texts.rs | 2 +- crates/ui-egui/src/ribbon.rs | 16 ++++++++-------- docs/getting-started.md | 2 +- docs/user-guide/layouts.md | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index b3575b68b5..e70eabe5f9 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -59,7 +59,7 @@ pub struct Dialogs { /// Map-local layer IDs require the dialog to retain its original project and map as well. pub projection_map: Option, pub geometry: Option, - /// Publication Layout Wizard: what it has asked so far (#2850). + /// Layout Wizard: what it has asked so far (#2850). pub publication: Option, pub repair: Option, pub conflicts: Option, diff --git a/crates/ui-egui/src/publicationwizard/mod.rs b/crates/ui-egui/src/publicationwizard/mod.rs index 7f31684291..e7654e3eb4 100644 --- a/crates/ui-egui/src/publicationwizard/mod.rs +++ b/crates/ui-egui/src/publicationwizard/mod.rs @@ -1,4 +1,4 @@ -//! Publication Layout Wizard: `layout.publication` asked step by step (size, map, style, elements, +//! Layout Wizard: `layout.publication` asked step by step (size, map, style, elements, //! placement, texts, sources and reference, accent), then made at once, as the New Layout › //! Publication Layout menu makes it (#2850). mod accent; @@ -546,7 +546,7 @@ pub fn show(app: &mut RustGisApp, ctx: &egui::Context) { let screen = ctx.content_rect(); let width = crate::widgets::dialog_width(ctx, SIZE.x, frame); let list = screen.width() >= LIST_FROM; - egui::Window::new(tl!("Publication Layout Wizard")) + egui::Window::new(tl!("Layout Wizard")) .id(egui::Id::unique("publication_wizard")) .frame(frame) .open(&mut open) @@ -860,7 +860,7 @@ mod tests { } fn window(h: &egui_kittest::Harness<'static, RustGisApp>) -> egui::Rect { - h.get_by_role_and_label(Role::Window, "Publication Layout Wizard").rect() + h.get_by_role_and_label(Role::Window, "Layout Wizard").rect() } /// Drags the window's bottom right corner `by` points. diff --git a/crates/ui-egui/src/publicationwizard/texts.rs b/crates/ui-egui/src/publicationwizard/texts.rs index ac150c708a..c97eee5327 100644 --- a/crates/ui-egui/src/publicationwizard/texts.rs +++ b/crates/ui-egui/src/publicationwizard/texts.rs @@ -281,7 +281,7 @@ mod tests { let long = "a long headline figure of sixty characters, or about as many".to_string(); d.figures = [(long.clone(), long.clone()), (long.clone(), long.clone()), (long.clone(), long)]; let mut h = harness_sized(app, egui::vec2(420.0, 360.0)); - let window = |h: &Wizard| h.get_by_role_and_label(Role::Window, "Publication Layout Wizard").rect(); + let window = |h: &Wizard| h.get_by_role_and_label(Role::Window, "Layout Wizard").rect(); let next = |h: &Wizard| h.get_by_role_and_label(Role::Button, "Next").rect(); let (size, at_next) = (window(&h).size(), next(&h)); h.state_mut().dialogs.publication.as_mut().unwrap().step = Step::Texts; diff --git a/crates/ui-egui/src/ribbon.rs b/crates/ui-egui/src/ribbon.rs index 039bc8b9fb..6b36bb68b6 100644 --- a/crates/ui-egui/src/ribbon.rs +++ b/crates/ui-egui/src/ribbon.rs @@ -1320,7 +1320,7 @@ fn project_group(app: &mut RustGisApp, ui: &mut Ui) { big(ui, app, "new_map", "New\nMap", "Add a new map to the project.", "map.new", Value::Null, false, false); big_menu(ui, app, "new_layout", "New\nLayout", "Add a page layout for printing and exporting the map.", |ui, app| { // A publication layout asked step by step: its size, style and texts too (#2850). - if ui.button(tl!("Publication Layout Wizard…")).clicked() { + if ui.button(tl!("Layout Wizard…")).clicked() { let _ = app.run("ui.dialog", json!({"name": "publicationWizard"})); ui.close(); } @@ -3321,7 +3321,7 @@ fn share_groups(app: &mut RustGisApp, ui: &mut Ui) { ui, app, "new_layout", - "Publication\nLayout", + "Layout\nWizard…", "Make a publication sheet or figure of the map view, asked step by step.", "ui.dialog", json!({"name": "publicationWizard"}), @@ -7091,7 +7091,7 @@ mod tests { assert!(l.elements.iter().all(|e| e.name != "Panel Box" && e.name != "Title"), "a figure, its title left to the caption"); } - /// New Layout › Publication Layout Wizard…, the menu's first row (#3115) and no longer in the + /// New Layout › Layout Wizard…, the menu's first row (#3115) and no longer in the /// Publication Layout submenu, opens the wizard and closes the menu, with nothing made yet /// (#2850). #[test] @@ -7115,24 +7115,24 @@ mod tests { h.get_by_label("Publication Layout").hover(); h.run(); // One row, the submenu open or not, above the first page size. - let wizard = h.get_by_label("Publication Layout Wizard…").rect(); + let wizard = h.get_by_label("Layout Wizard…").rect(); let (_, first, w, height) = rustgis_engine::map::layout::PAGES[0]; let page = h.query_all_by_label(&page_label(first, w, height)).next().expect("the page sizes").rect(); assert!(wizard.max.y <= page.min.y, "the wizard at {wizard:?}, the first page size at {page:?}"); - h.get_by_label("Publication Layout Wizard…").click(); + h.get_by_label("Layout Wizard…").click(); h.run(); assert_eq!(h.state().dialogs.open, Some("publicationWizard")); assert!(h.state().dialogs.publication.is_some()); assert_eq!(h.state().session.project.layouts.len(), before, "nothing made yet"); - assert!(h.query_by_label("Publication Layout Wizard…").is_none(), "the menu closed"); + assert!(h.query_by_label("Layout Wizard…").is_none(), "the menu closed"); } - /// Publish › Layout › Publication Layout opens the wizard, with nothing made yet (#3115). + /// Publish › Layout › Layout Wizard… opens the wizard, with nothing made yet (#3115). #[test] fn the_publish_tab_opens_the_wizard() { let mut h = tab_harness(cities(), share_groups); let before = h.state().session.project.layouts.len(); - h.get_by_label("Publication Layout").click(); + h.get_by_label("Layout Wizard…").click(); h.run(); assert_eq!(h.state().dialogs.open, Some("publicationWizard")); assert!(h.state().dialogs.publication.is_some()); diff --git a/docs/getting-started.md b/docs/getting-started.md index aece1632bd..278e670c2e 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -36,7 +36,7 @@ sample again. **Settings › Start-up › Start With** chooses what opens next t Right-drag (or ++ctrl++-drag) turns and tilts the map; click the north arrow to reset it. 6. **Share.** **Publish › Export Map** saves a PNG with labels and a scale bar. **Home › New Layout** offers page sizes and **Publication Layout** presets for sheets (in one of seven styles) and figures; - its **Publication Layout Wizard…**, also **Publish › Publication Layout**, asks for one step by step. + its **Layout Wizard…**, also on **Publish › Layout**, asks for one step by step. Choose a page size for a page with a map frame, legend, north arrow and scale bar. **Project › Save As** writes a `.rgis` project. diff --git a/docs/user-guide/layouts.md b/docs/user-guide/layouts.md index 67df830555..852466c97b 100644 --- a/docs/user-guide/layouts.md +++ b/docs/user-guide/layouts.md @@ -39,8 +39,8 @@ Layouts open as tabs next to the maps; while one is open, its groups lead the Pu thesis (160 × 225 or 160 × 110 mm): the map edge to edge with a line of its projection and datum under it, at 7 pt. A figure's title and sources belong in its caption, so they are left out, and the result says so. - - **Step by step**: **Publication Layout Wizard…**, first in Home › New Layout, or Publish › - **Publication Layout**, asks for the size + - **Step by step**: **Layout Wizard…**, first in Home › New Layout and on Publish › Layout, + asks for the size (a sheet turned Auto, Portrait or Landscape, or a figure), the map extent and the layout's name, the style (each beside an outline of where its title, map and footer go, and its column or panel if it has one, with the accent colour picked, or else its own, where the sheet takes it, which From 27e9d7265317e601ee7595a8332ed8f1c6b7d4e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Gregorio=20Rinc=C3=B3n?= Date: Sat, 28 Nov 2026 20:28:23 -0500 Subject: [PATCH 3/4] feat(ui): lead the Publish tab with the Layout Wizard --- crates/ui-egui/src/ribbon.rs | 41 +++++++++++++++++++++++------------- docs/getting-started.md | 2 +- docs/user-guide/layouts.md | 2 +- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/crates/ui-egui/src/ribbon.rs b/crates/ui-egui/src/ribbon.rs index 6b36bb68b6..b5fa992670 100644 --- a/crates/ui-egui/src/ribbon.rs +++ b/crates/ui-egui/src/ribbon.rs @@ -2800,16 +2800,34 @@ fn extension_groups(app: &mut RustGisApp, ui: &mut Ui, id: &str) { } } -/// The Publish tab: the open layout's groups first, then reports, presentations, export and -/// sharing. +/// The Publish tab: the open layout's groups first, then the Layout Wizard, reports, +/// presentations, export and sharing. fn publish_tab(app: &mut RustGisApp, ui: &mut Ui) { layout_groups(app, ui); + new_publication_group(app, ui); report_group(app, ui); presentation_group(app, ui); share_groups(app, ui); thumbnail_group(app, ui); } +/// The Layout Wizard, ahead of the reports so it is in reach without scrolling (#3115). +fn new_publication_group(app: &mut RustGisApp, ui: &mut Ui) { + group(ui, "New", |ui| { + big( + ui, + app, + "new_layout", + "Layout\nWizard…", + "Make a publication sheet or figure of the map view, asked step by step.", + "ui.dialog", + json!({"name": "publicationWizard"}), + false, + false, + ); + }); +} + /// The layer selected in Layers. fn active_layer(app: &RustGisApp) -> Option<&rustgis_engine::map::Layer> { app.session.active_layer.and_then(|id| app.session.map().layer(id)) @@ -3317,17 +3335,6 @@ fn share_groups(app: &mut RustGisApp, ui: &mut Ui) { }); }); group(ui, "Layout", |ui| { - big( - ui, - app, - "new_layout", - "Layout\nWizard…", - "Make a publication sheet or figure of the map view, asked step by step.", - "ui.dialog", - json!({"name": "publicationWizard"}), - false, - false, - ); big(ui, app, "export", "Export\nLayout", "Export the open layout as PDF or PNG.", "ui.exportLayout", Value::Null, false, false); big( ui, @@ -7127,11 +7134,15 @@ mod tests { assert!(h.query_by_label("Layout Wizard…").is_none(), "the menu closed"); } - /// Publish › Layout › Layout Wizard… opens the wizard, with nothing made yet (#3115). + /// Publish › New › Layout Wizard… comes before the reports, so it needs no scrolling with no + /// layout open, and opens the wizard, with nothing made yet (#3115). #[test] fn the_publish_tab_opens_the_wizard() { - let mut h = tab_harness(cities(), share_groups); + let mut h = tab_harness(cities(), publish_tab); let before = h.state().session.project.layouts.len(); + let wizard = h.get_by_label("Layout Wizard…").rect(); + let report = h.get_by_label("New Report").rect(); + assert!(wizard.max.x <= report.min.x, "the wizard at {wizard:?}, New Report at {report:?}"); h.get_by_label("Layout Wizard…").click(); h.run(); assert_eq!(h.state().dialogs.open, Some("publicationWizard")); diff --git a/docs/getting-started.md b/docs/getting-started.md index 278e670c2e..a45ec99dfc 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -36,7 +36,7 @@ sample again. **Settings › Start-up › Start With** chooses what opens next t Right-drag (or ++ctrl++-drag) turns and tilts the map; click the north arrow to reset it. 6. **Share.** **Publish › Export Map** saves a PNG with labels and a scale bar. **Home › New Layout** offers page sizes and **Publication Layout** presets for sheets (in one of seven styles) and figures; - its **Layout Wizard…**, also on **Publish › Layout**, asks for one step by step. + its **Layout Wizard…**, also on **Publish › New**, asks for one step by step. Choose a page size for a page with a map frame, legend, north arrow and scale bar. **Project › Save As** writes a `.rgis` project. diff --git a/docs/user-guide/layouts.md b/docs/user-guide/layouts.md index 852466c97b..dccc11d323 100644 --- a/docs/user-guide/layouts.md +++ b/docs/user-guide/layouts.md @@ -39,7 +39,7 @@ Layouts open as tabs next to the maps; while one is open, its groups lead the Pu thesis (160 × 225 or 160 × 110 mm): the map edge to edge with a line of its projection and datum under it, at 7 pt. A figure's title and sources belong in its caption, so they are left out, and the result says so. - - **Step by step**: **Layout Wizard…**, first in Home › New Layout and on Publish › Layout, + - **Step by step**: **Layout Wizard…**, first in Home › New Layout and on Publish › New, asks for the size (a sheet turned Auto, Portrait or Landscape, or a figure), the map extent and the layout's name, the style (each beside an outline of where its title, map and footer go, and its column or panel From b37f941f17c2577b97a1ecfb1cba6e702eedc1ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Gregorio=20Rinc=C3=B3n?= Date: Sat, 28 Nov 2026 20:37:22 -0500 Subject: [PATCH 4/4] test(ui): hold the Publish wizard button inside a 1366 px window --- crates/ui-egui/src/ribbon.rs | 1 + docs/getting-started.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/ribbon.rs b/crates/ui-egui/src/ribbon.rs index b5fa992670..5f69e2710c 100644 --- a/crates/ui-egui/src/ribbon.rs +++ b/crates/ui-egui/src/ribbon.rs @@ -7143,6 +7143,7 @@ mod tests { let wizard = h.get_by_label("Layout Wizard…").rect(); let report = h.get_by_label("New Report").rect(); assert!(wizard.max.x <= report.min.x, "the wizard at {wizard:?}, New Report at {report:?}"); + assert!(wizard.max.x <= 1366.0, "the wizard at {wizard:?}, past a 1366 px window"); h.get_by_label("Layout Wizard…").click(); h.run(); assert_eq!(h.state().dialogs.open, Some("publicationWizard")); diff --git a/docs/getting-started.md b/docs/getting-started.md index a45ec99dfc..0cc5852698 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -36,7 +36,7 @@ sample again. **Settings › Start-up › Start With** chooses what opens next t Right-drag (or ++ctrl++-drag) turns and tilts the map; click the north arrow to reset it. 6. **Share.** **Publish › Export Map** saves a PNG with labels and a scale bar. **Home › New Layout** offers page sizes and **Publication Layout** presets for sheets (in one of seven styles) and figures; - its **Layout Wizard…**, also on **Publish › New**, asks for one step by step. + its **Layout Wizard…**, also on **Publish › New**, builds one step by step. Choose a page size for a page with a map frame, legend, north arrow and scale bar. **Project › Save As** writes a `.rgis` project.