You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(ui): the Publication Layout Wizard asks for a figure's cartographic reference - #3157
layout.publication draws a reference under a figure's map, but the Publication Layout Wizard gave a figure only its size, its map and the review, so another reference couldn't be given there.
A figure's steps are now Size, Map, Reference and Review. The step has the reference's box and "No cartographic reference", the same two as a sheet's step, with no heading, which a figure doesn't draw.
The wizard sends a figure "reference" as it does a sheet: the lines typed, or an empty list.
A figure's review lists the reference as a sheet's does. The two notes saying a sheet's reference isn't used are gone.
A statistic added on a sheet's sources step still goes where it did: the cursor put in the figure's box doesn't move it.
Reach: the egui interface on desktop and web. The command and its parameters don't change: scripts, the CLI, Python and the Assistant could already give a figure its reference.
No new strings.
Testing
New tests in publicationwizard/sources.rs: what a figure sends, what its step asks for, its limits, the sheet's statistic target, its review and Create then Undo, with and without a reference. The step list and Next/Back tests include the new step. Eight tests, new or updated, failed before the change.
Checks on 1cdc7ac: fmt, clippy, nextest (10186 passed, 29 skipped), doctests, layers and cargo xtask schema --check green.
A one-column figure walked with ui_shot (World Atlas): typed reference, then none.
UI evidence
A one-column figure. Left: before, the review after typing a sheet's reference. Middle and right: after, the new step and the review.
No actionable comments were generated in the recent review.
Walkthrough
The Publication Layout Wizard adds a Reference step for figures. Figure parameters now include the entered reference lines or an empty reference when the no-reference option is selected. The review displays the active, entered, or omitted reference.
Changes: Figure Reference Flow
Layer / File(s)
Summary
Add the figure Reference step and serialize its value crates/ui-egui/src/publicationwizard/mod.rs, crates/ui-egui/src/publicationwizard/sources.rs
Figure drafts now include Reference between Map and Review. Figure parameters include the reference lines, or an empty list when no reference is selected.
Render reference fields without statistic controls crates/ui-egui/src/publicationwizard/mod.rs, crates/ui-egui/src/publicationwizard/sources.rs
The reference fields are shared with the Sources step and rendered on a separate figure step. Focusing them does not set a statistic target, and the statistic-refusal notice is hidden on that step.
Show reference values in review and creation crates/ui-egui/src/publicationwizard/review.rs, crates/ui-egui/src/publicationwizard/sources.rs, docs/user-guide/layouts.md
The review displays the entered reference, the active default, or a none value that notes when typed lines are unused. Tests cover layout creation with the selected reference, and the guide describes the figure reference input.
sequenceDiagram
participant User
participant PublicationWizard
participant FigureParameters
participant PublicationLayout
User->>PublicationWizard: Enter reference lines or select no reference
PublicationWizard->>FigureParameters: Serialize lines or an empty reference list
FigureParameters->>PublicationLayout: Create figure with the selected reference
opengeos/RustGIS#3138: Both PRs change the figure’s reference row in the wizard review.
opengeos/RustGIS#3139: This PR includes the Map step and review structure added by that PR.
opengeos/RustGIS#3112: This PR uses the reference input contract introduced for the Sources step.
Suggested reviewers:giswqs, deniial00
Merge Risk: Minimal · up to 1cdc7
The Publication Layout Wizard now asks for a figure's cartographic reference and sends it with the layout command. The change is confined to the UI, the command parameters are unchanged, and no merge-blocking risk is evident.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: the Publication Layout Wizard now asks for a figure's cartographic reference. The changeset adds a Reference step for figures, sends the reference parameter, and updat…
Description check
The description follows the template. It has a Summary that explains why the change is needed and what it does. It has a Testing section that lists the new tests, the CI checks run on commit 1cdc7ac,…
Linked Issues check
Directly linked issue #3131 asks for three things: (1) a figure's wizard steps include reference lines and "No cartographic reference"; (2) the wizard sends the reference; (3) no change to the command…
Out of Scope Changes check
All changed areas connect to #3131. mod.rs adds the figure Reference step. review.rs replaces the figure-specific reference notices with the shared reference_value logic. The summary states that…
Full details: Title check
Explanation
The title names the main change: the Publication Layout Wizard now asks for a figure's cartographic reference. The changeset adds a Reference step for figures, sends the reference parameter, and updates the review, which matches the title. The title is specific and single-sentence. It uses the conventional feat(ui) prefix, which is acceptable. It is 82 characters, which is slightly long but still clear.
Full details: Description check
Explanation
The description follows the template. It has a Summary that explains why the change is needed and what it does. It has a Testing section that lists the new tests, the CI checks run on commit 1cdc7ac, and a manual ui_shot walkthrough. It has a UI evidence section with before-and-after screenshots, which the template requires for visible UI changes. It has a Related issue section that closes #3131. The UI evidence section does not state the 'No visible UI change' line, which is correct because this change is visible. The description meets the template's required content.
Full details: Linked Issues check
Explanation
Directly linked issue #3131 asks for three things: (1) a figure's wizard steps include reference lines and "No cartographic reference"; (2) the wizard sends the reference; (3) no change to the command. The change meets each of these. The PR adds Step::Reference to crates/ui-egui/src/publicationwizard/mod.rs. A figure now visits Size, Map, Reference, Review. The Reference step shows the reference text box and the "No cartographic reference" checkbox, using a shared helper in sources.rs. The figure parameters send the typed lines as reference, or an empty list when the checkbox is selected. The PR description states that the command and its parameters are unchanged. The new sources.rs tests cover the figure parameters, the step fields, and the creation path with and without a reference. The evidence comes from the PR summary and the test descriptions. I did not run the tests or read the hunks directly. The result depends on those descriptions being accurate.
Full details: Out of Scope Changes check
Explanation
All changed areas connect to #3131. mod.rs adds the figure Reference step. review.rs replaces the figure-specific reference notices with the shared reference_value logic. The summary states that this logic also applies to non-figure reviews. This is a refactor that supports the figure review, not an unrelated change. sources.rs adds the shared reference helper, the new step, and the tests. The PR description states that a statistic added on a sheet's sources step still targets the same place. docs/user-guide/layouts.md documents the new figure reference step. No change falls outside the issue's scope based on the available evidence.
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 taps a line of ink, Then marks the reference box to blink. The figure carries what was penned, Or leaves the cartographic end. The review shows what made the trip, And hops away with one last flip.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 2c522513-baa1-4bc1-9b42-bdba2cd3aef0
Commits
Reviewing files that changed from the base of the PR and between a50612c and 1cdc7ac.
Files selected for processing: 4
crates/ui-egui/src/publicationwizard/mod.rs
crates/ui-egui/src/publicationwizard/review.rs
crates/ui-egui/src/publicationwizard/sources.rs
docs/user-guide/layouts.md
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
crates/ui-egui/src/publicationwizard/mod.rs:281: edited still clears the sheet's sources-step refusal when the figure's reference box changes. Field::Reference.step() is Sources, so refused[1] is reset while that step isn't shown and its text hasn't changed. Returning early on Step::Reference fixes it. Confidence: medium-high (traced, not run). Inline comment posted.
Security
None found.
Performance
None found.
Quality
crates/ui-egui/src/publicationwizard/sources.rs:209: a_figures_step_says_its_limits_only sets refused = [false, true], but the Reference step reads slot 0. The test passes with or without the d.step != Step::Reference guard in limit_note. Setting [true, false] makes it test the guard. Confidence: high. Inline comment posted.
Nit, not posted: Step::slot (mod.rs:46-50) documents two slots, but Reference now silently maps to slot 0 (the texts step's). Correctness relies on the guards in edited and limit_note. Its doc should say so.
AGENTS.md
None found. No new commands or parameters, so command-surface.txt is unchanged. Desktop-only egui code, so no wasm cfg is needed. The new strings are wrapped in tl!/tl_raw!.
Checked, nothing raised
The engine's figure path reads reference (crates/engine/src/cmd/layout/publication/mod.rs:830), so the wizard change needs no engine change.
The figure review's default text matches the engine's two-line default, and the sheet's review still shows the same text as before.
Sheet params() output is unchanged; figures now send reference and still omit headings and the rest.
Not verified: a figure with "reference": [] gets an empty "Reference" element and reserves a strip under the map. That is engine behaviour this PR doesn't change, and I didn't run it.
Prior reviews: none on this PR, so none were skipped.
Change size
Compared with the base branch (merge base 8caeade to PR head 1cdc7ac), the whole PR.
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the preview label (once per commit).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
layout.publicationdraws a reference under a figure's map, but the Publication Layout Wizard gave a figure only its size, its map and the review, so another reference couldn't be given there."reference"as it does a sheet: the lines typed, or an empty list.Testing
publicationwizard/sources.rs: what a figure sends, what its step asks for, its limits, the sheet's statistic target, its review and Create then Undo, with and without a reference. The step list and Next/Back tests include the new step. Eight tests, new or updated, failed before the change.cargo xtask schema --checkgreen.ui_shot(World Atlas): typed reference, then none.UI evidence
A one-column figure. Left: before, the review after typing a sheet's reference. Middle and right: after, the new step and the review.
Related issue
Closes #3131
Summary by CodeRabbit