Skip to content

feat(ui): the Publication Layout Wizard asks how the north arrow, scale bar and legend look - #3222

Merged
jgregoriorincon merged 3 commits into
opengeos:mainfrom
jgregoriorincon:feat/3217-wizard-element-looks
Nov 28, 2026
Merged

jgregoriorincon merged 3 commits into
opengeos:mainfrom
jgregoriorincon:feat/3217-wizard-element-looks

Conversation

@jgregoriorincon

@jgregoriorincon jgregoriorincon commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Publication Layout Wizard's Elements step now asks how three of the elements look, not only whether they are drawn:

  • North arrow: its style.
  • Scale bar: its units and style.
  • Legend: its title and columns (Auto, or 1 to 6).

The names are the ones the Format panel uses. A control with nothing to apply to is off, keeps its answer and isn't sent: no arrow, no scale bar, no legend, or a map with no layer the legend lists. Only what differs from the default is sent, so an untouched wizard sends what it sent before. A title is sent trimmed. The review names the looks that will be sent.

No new command, parameter, capability or project state: layout.publication already takes northArrow, scaleBar and legend as objects.

The wizard can't know the sheet's scale or context layers before Create: a map whose only listable layer is out of its scale range, or left out as context, is still offered a legend title; the sheet then has no legend, and Create says it was left out, its title with it.

Surfaces: the wizard is in the shared egui app (desktop and browser). The phone's touch interface has no part of the wizard. The CLI, Python, scripts, plugins and the assistant reach these options through layout.publication, whose help already lists them; the ribbon, shortcuts and command search are unchanged. Create is undone as before. In render, tile_listed became public so the wizard asks it instead of repeating it.

The step is longer now and scrolls at the window's opening size. New strings wait for the release translation pass.

Testing

  • New tests in publicationwizard/elements.rs for what is sent, what is off, the review, the controls and a created layout (with undo); the narrow-screen test covers the new lists. They failed before the change.
  • A test covers the review's legend line in a right-to-left language.
  • Two helpers of the step's tests scroll a control into view before clicking it.
  • Locally: fmt, clippy of rustgis-ui-egui, the workspace tests (two DuckDB tests that need a local setup left out), doctests, layer check and schema check passed. After the later changes, the wizard tests, fmt and clippy of rustgis-ui-egui passed again (clippy of rustgis-render too after tile_listed became public).
  • ui_shot replay: picking the looks, the review and the created sheet.

UI evidence

Elements step, before and after:

The Elements step before and after

Review:

The review naming the looks picked

The created sheet, with the legend titled and in two columns and the bar in kilometres:

The created sheet

Related issue

Closes #3217

Summary by CodeRabbit

  • New Features
    • Publication layouts now let you choose north-arrow and scale-bar styles, set scale-bar units, and customize the legend title and columns. Selected options also appear in the layout review.
  • Documentation
    • Updated the layout guide to clarify how placement styles assign corners to map surrounds and how custom placements handle conflicts.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Publication Layout Wizard adds settings for north-arrow style, scale-bar units and style, and legend title and columns. It retains answers when controls are unavailable, sends non-default options for drawable elements, and displays selected looks in the review.

Changes: Publication element looks

Layer / File(s) Summary
Look settings and serialization
crates/render/src/layout/legend.rs, crates/ui-egui/src/publicationwizard/elements.rs
The wizard adds look settings and defaults, determines when each control is usable, and serializes non-default options. Legend options are sent only when listable rows exist.
Look controls and review
crates/ui-egui/src/publicationwizard/elements.rs
The Elements step adds pickers and legend title and column controls. The review displays the selected looks alongside element names.
Validation and placement documentation
crates/ui-egui/src/publicationwizard/elements.rs, docs/user-guide/layouts.md
Tests cover serialization, availability, review output, and narrow-screen layout. The guide clarifies sheet placement and corner assignment.

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  actor Publisher
  participant Elements
  participant Draft
  participant PublicationLayout as layout.publication
  Publisher->>Elements: Choose element looks
  Elements->>Draft: Retain selected answers
  Draft->>Draft: Check availability and omit defaults
  Draft->>PublicationLayout: Send usable look options
Loading

Possibly related issues

Possibly related PRs

  • opengeos/RustGIS#3071 — That PR adds legend-column support in layout commands and the Format pane; this PR exposes legend columns in the wizard.

Suggested reviewers: m-hollis-1, giswqs

Merge Risk: Minimal · up to bd210

The wizard gains north-arrow, scale-bar, and legend look controls that send only non-default values for elements that are drawn. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the Publication Layout Wizard's Elements step now asks for the north arrow, scale bar and legend looks. The changeset adds these controls in elements.rs, the docs, and…
Description check Passed The description follows the template well. It has a Summary that explains the new north-arrow, scale-bar and legend look controls, when controls are off and not sent, and what the review shows. It has…
Linked Issues check Passed Directly linked issue #3217 has coding requirements. The change in crates/ui-egui/src/publicationwizard/elements.rs covers each one, according to the whole-PR summary:
- North-arrow style (Classic, Co…
Out of Scope Changes check Passed Changes in the PR:
- crates/ui-egui/src/publicationwizard/elements.rs: implements the issue requirements. Its tests are in scope.
- crates/render/src/layout/legend.rs: tile_listed changed from `pub(…
Full details: Title check

Explanation

The title names the main change: the Publication Layout Wizard's Elements step now asks for the north arrow, scale bar and legend looks. The changeset adds these controls in elements.rs, the docs, and makes tile_listed public. The title is specific and matches the primary change, with the wording 'asks how ... look' being a reasonable description of the new controls.

Full details: Description check

Explanation

The description follows the template well. It has a Summary that explains the new north-arrow, scale-bar and legend look controls, when controls are off and not sent, and what the review shows. It has a Testing section with new tests, local checks, and a ui_shot replay. It has a UI evidence section with before/after and review screenshots. It has a Related issue section that closes #3217. The template's 'No visible UI change' line is correctly replaced because the PR changes visible UI. Minor gap: the Testing section does not name the exact commands beyond the listed checks, but it reports them.

Full details: Linked Issues check

Explanation

Directly linked issue #3217 has coding requirements. The change in crates/ui-egui/src/publicationwizard/elements.rs covers each one, according to the whole-PR summary:

  • North-arrow style (Classic, Compass, Triangle, Star): added as the north_style: ArrowStyle field and selector.
  • Scale-bar units (Automatic, Kilometers, Meters, Miles, Feet) and style (Alternating, Stepped, Line): added as scale_units: ScaleUnits and scale_style: ScaleBarStyle.
  • Legend title and columns (Auto, 1 to 6): added as legend_title: String (trimmed and capped) and legend_columns: Option<usize>.
  • Controls off when the element is not drawn: Draft disables unusable controls and keeps their values. Looks are sent only for drawable elements.
  • Defaults not sent: only non-default values are serialized; empty option objects are omitted.
  • Review names the selected looks: the review lists the looks that will be sent.
  • Tests: new tests cover serialization, control availability, review text, narrow-screen layout, and a created layout with undo. The summary says these tests failed before the change. I did not run them.
    The PR sends values through the existing layout.publication object options, as the issue implies. The PR description says the wizard can offer a legend title that the final sheet omits when no legend is drawn. This is a documented limitation that the issue does not forbid. No unmet coding requirement is evident from the summary. I did not inspect the source hunks directly, so the verdict rests on the summary and PR description.
Full details: Out of Scope Changes check

Explanation

Changes in the PR:

  • crates/ui-egui/src/publicationwizard/elements.rs: implements the issue requirements. Its tests are in scope.
  • crates/render/src/layout/legend.rs: tile_listed changed from pub(super) to pub, with no change to its conditions. The wizard uses it to decide whether a legend is offered. This supports the wizard change.
  • docs/user-guide/layouts.md: clarifies corner assignment and which surrounds take a corner when excluded from the elements. This describes the Elements step behavior that the PR changes, so it is connected to the wizard work. The docs do not add an unrelated feature.
    No change is shown to be unrelated to #3217. The summary does not show any change to command, parameter, capability, or project state, which the PR says it does not make. I did not inspect the docs hunk directly.
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 picks a compass star,
Then sets the scale from near to far.
A legend title, columns neat,
The wizard sends the looks complete.
Soft paws tap Create, and layouts bloom.

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: f75fbcab-497c-49d0-8564-006a9975b2a0
Commits

Reviewing files that changed from the base of the PR and between cee4b99 and bd210e8.

Files selected for processing: 3

  • crates/render/src/layout/legend.rs
  • crates/ui-egui/src/publicationwizard/elements.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; 5 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-3222/
Web app https://preview.rustgis.app/pr-3222/app/
Commit bd210e8

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 28, 2026
Merged via the queue into opengeos:main with commit bb27ef2 Nov 28, 2026
28 checks passed
@jgregoriorincon
jgregoriorincon deleted the feat/3217-wizard-element-looks branch November 28, 2026 14:03
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 how the north arrow, scale bar and legend look

1 participant