Skip to content

feat(ui): the Publication Layout Wizard asks for a figure's cartographic reference - #3157

Merged
jgregoriorincon merged 1 commit into
opengeos:mainfrom
jgregoriorincon:feat/3131-figure-reference
Nov 27, 2026
Merged

jgregoriorincon merged 1 commit into
opengeos:mainfrom
jgregoriorincon:feat/3131-figure-reference

Conversation

@jgregoriorincon

@jgregoriorincon jgregoriorincon commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

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.

A figure in the wizard before and after

Related issue

Closes #3131

Summary by CodeRabbit

  • New Features
    • Figure layouts now include a dedicated reference step, where you can enter reference text or choose to omit it.
    • Figure reviews show the selected reference, including when it is omitted and whether entered lines will be unused.
  • Documentation
    • Updated the layout guide to explain figure references and clarify that figures don’t include style, accent, or other text.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

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.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

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
Loading

Possibly related issues

Possibly related PRs

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed 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 Passed 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.

Share

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.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Bugs

  • 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.

Measure Value
Files changed 4 (0 added, 4 modified, 0 removed, 0 renamed)
Size before 146.3 KB
Size after 150.9 KB
Total size change +4.6 KB
Path Before After Change
crates/ui-egui/src/publicationwizard/sources.rs 19.0 KB 23.3 KB +4.3 KB
crates/ui-egui/src/publicationwizard/mod.rs 39.8 KB 40.5 KB +638 B
crates/ui-egui/src/publicationwizard/review.rs 5.1 KB 4.7 KB −380 B
docs/user-guide/layouts.md 82.3 KB 82.4 KB +83 B

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-3157/
Web app https://preview.rustgis.app/pr-3157/app/
Commit 1cdc7ac

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).

@jgregoriorincon
jgregoriorincon added this pull request to the merge queue Nov 27, 2026
Merged via the queue into opengeos:main with commit 3e977ea Nov 27, 2026
28 checks passed
@jgregoriorincon
jgregoriorincon deleted the feat/3131-figure-reference branch November 27, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: The Publication Layout Wizard asks for a figure's cartographic reference

1 participant