Repository navigation
Layouts: pick a publication sheet's style from the New Layout menu - #874
Conversation
Home › New Layout › Publication Layout made every sheet in the classic style: the other five (banner, panel, editorial, modular, poster) were reached only through layout.publication's "style". Each sheet now opens a list of the six styles, each saying on hover what it looks like; figures, which leave the style to their caption, are still made at once. - PUBLICATION_STYLES in the engine lists the styles by name, the default first; a test checks that layout.publication takes each. - The menu's names are tl! literals, checked word for word against the engine's. - A kittest test picks A4 portrait › Panel and a journal figure through the menu. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Style options and validation crates/engine/src/cmd/layout.rs, crates/engine/src/tests.rs |
A public constant lists six style codes and display names. A test checks that each style is accepted and returned by layout.publication. |
Sheet style selection and creation crates/ui-egui/src/ribbon.rs, docs/getting-started.md, docs/user-guide/layouts.md |
Sheet profiles now offer a submenu of six styles. The creation helper passes the selected style and map name to layout.publication, reports warnings or errors, and selects the Publish tab on success. UI tests and documentation cover the choices. |
Priority:
Estimated code review effort: 2 (Simple) | ~12 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant RibbonMenu
participant publication_layout
participant layout_publication
participant PublishTab
RibbonMenu->>publication_layout: selected sheet profile and style
publication_layout->>layout_publication: profile, style, and map title
layout_publication-->>publication_layout: result and warnings
publication_layout->>PublishTab: select on success
Possibly related issues
opengeos/RustGIS#682— The changes add selectable styles to publication sheet creation, which is part of the requested publication layout workflow.opengeos/RustGIS#748— The changes add publication-sheet style choices and tests for creating styled sheets.
Possibly related PRs
- opengeos/RustGIS#742 — This PR adds a public list and UI choices for the style IDs that the related PR added to
layout.publication.
Suggested reviewers: giswqs
Merge Risk: 
Minimal · up to 7e8eb
-
The style-selection change is mergeable after normal checks; no actionable issue remains from this review.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 inconclusive Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description includes a detailed Summary and Testing section that match the pull request objectives. The Related issue section is missing, but this is non-critical because no issue reference is provided in the context.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 2 files. (3 skipped: 2 unsupported, 1 too large.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit selects a sheet with care
Six styles appear in the menu there
The title joins the chosen page
Warnings and errors take the stage
Then Publish waits, a tidy hare!
Comment @coderabbitai help to get the list of available commands.
| let (name, about) = publication_style(style).unwrap_or_else(|| (tl!(*name), "")); | ||
| if ui.button(name).on_hover_text(about).clicked() { | ||
| publication_layout(app, profile, Some(style)); | ||
| ui.close(); |
There was a problem hiding this comment.
Two small concerns (low confidence):
ui.close()is called inside the nested submenu'sui. Depending on the egui version, it may close only the innermost submenu and leave the outer New Layout menu open. The old code closed from the outer menu'sui. The new test only checks that "Banner" (a submenu item) has gone, so it wouldn't catch this. Consider also asserting that "Publication Layout" is gone, and check howclosebehaves with nested menus.- When
publication_stylereturnsNone,aboutis"", andon_hover_text("")may show an empty tooltip. Consider applying the hover text only whenaboutis non-empty.
Code reviewThis PR adds a style submenu for each publication sheet in the New Layout menu. It also moves the Bugs
Security
Performance
Quality
AGENTS.md
Change sizeCompared: the whole PR against main (merge base 2aaa0f0 to PR head 7e8ebd9)
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. |
Summary
Home › New Layout › Publication Layout made every sheet in the
classicstyle. The other five styles from #742 were reachable only through the"style"parameter oflayout.publication, so in the app they couldn't be picked at all. The five arebanner,panel,editorial,modularandposter.Each sheet in the menu (A4, A3 or A2, portrait or landscape) now opens a list of the six styles,
classicfirst:Choices in this PR
"accent"inlayout.publicationstill picks another, and the user guide says so.PUBLICATION_STYLESinengine::cmd::layoutnames the styles, asPUBLICATION_PROFILESnames the profiles.layout.publicationwith each one.tl!literals (publication_style), as the profiles' are, and a test checks them word for word against the engine's.publication_layout, shared by sheets and figures, unchanged: the title, the warnings notified, and the switch to the Publish tab.Testing
a_publication_sheet_is_made_in_the_style_picked(kittest) goes through the real menu.every_publication_style_is_named_by_a_literal(ui-egui) andevery_publication_style_in_the_menu_is_taken(engine).cargo xtask cipasses locally: fmt, clippy and 2,174 tests, none failing.The new strings are in English only;
i18n/*.tsvis left for the release translation.🤖 Generated with Claude Code
Summary by CodeRabbit