Skip to content

feat(layout): an inset and a globe locator together on a publication sheet - #3244

Merged
jgregoriorincon merged 2 commits into
opengeos:mainfrom
jgregoriorincon:feat/3240-locator-list
Nov 28, 2026
Merged

jgregoriorincon merged 2 commits into
opengeos:mainfrom
jgregoriorincon:feat/3240-locator-list

Conversation

@jgregoriorincon

@jgregoriorincon jgregoriorincon commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

layout.publication takes "locator": ["inset", "globe"]: the inset outlines the map frame, as it does alone, and the globe outlines the inset. Until now a sheet had one or the other, and the second frame had to be added and pointed by hand.

  • Both sit side by side in the locator's corner of the arrangement, the inset on the side nearer the frame's edge, or at the top of a style's column, sharing its width. The legend goes under them there.
  • The list is a set: its order changes nothing. A list of one is the same as its string, and [] the same as "none". A repeated entry, "none" in a list or an unknown entry is refused before anything is added.
  • With two, the elements are named Locator Inset and Locator Globe (one keeps Locator), and the answer's locator lists both maps, the inset's first. A scale bar box measured again stays off either.
  • No new model or project format: the globe uses the frame's existing extent indicator, pointed at the inset.

Surfaces: it is a parameter of layout.publication, so scripts, the CLI, Python, the web build, plugins and the assistant (MCP included, which reads the command's updated parameter help; the print-layout skill is updated too) take it through the same command. The phone interface has no publication layout control. The Publication Layout Wizard still offers one locator.

Outside a column each locator keeps the size a single one has, so the pair is about twice as wide; the placement picks its spot as it does for one.

Testing

  • New tests in crates/engine/src/tests/layout_publication_locators.rs, written first and seen failing: nesting and placement, order, a list of one, refusals, a figure and a whole globe, the column styles, an arranged corner, an orphan globe reused and Undo, and the scale bar box.
  • The existing veil panel test takes the locator's size as width and height.
  • fmt, clippy, nextest, doctests, layer check and schema check green.

UI evidence

The same extent before (default, one globe) and after ("locator": ["inset", "globe"]).

Classic, over the map:

3240-classic-before-after.png

Panel, at the top of the column:

3240-panel-before-after.png

Not in this PR

Related issue

Closes #3240

Summary by CodeRabbit

  • New Features
    • Publication layouts can now display inset and globe locators together, side by side. The inset outlines its area, while the globe outlines the inset.
    • Locator placement adapts to available layout space. If there isn’t room for the legend beside the locators, the legend is omitted with a warning.
    • Layout results identify both locators, with the inset listed first.
  • Documentation
    • Updated the layout guide and print-layout instructions with the combined locator option and its behavior.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Publication layouts now accept inset and globe locators together. They are placed side by side with nested extent indicators. The layout result returns both map names, and collision checks, tests, and documentation cover the combined locator behavior.

Changes: Publication locator pair

Layer / File(s) Summary
Locator selection and contract
crates/engine/src/cmd/layout/publication/mod.rs, crates/engine/src/cmd/layout.rs, crates/assistant/skills/print-layout/SKILL.md
The locator parser accepts a string or a list of unique inset and globe values. Lists reject none and duplicates, and use inset-first ordering. The command and skill documentation describe the pair.
Locator sizing and rendering
crates/engine/src/cmd/layout/publication/mod.rs, crates/engine/src/cmd/layout/publication/placement.rs
The layout sizes and places both frames side by side. The inset outlines the map frame, and the globe outlines the inset. The legend is positioned below the locator group, and the result returns one name or both names.
Inputs, collision handling, and validation
crates/engine/src/cmd/layout/inputs.rs, crates/engine/src/cmd/layout/frame.rs, crates/engine/src/tests.rs, crates/engine/src/tests/layout_publication_locators.rs, docs/user-guide/layouts.md
Globe map inputs and scale-box collision checks account for locator collections. Tests cover parsing, placement, map reuse, undo, and collision handling. The user guide documents the combined option and legend behavior.

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Publication
  participant LocatorParser
  participant LayoutRenderer
  Publication->>LocatorParser: parse locator option
  LocatorParser-->>Publication: return ordered locator list
  Publication->>LayoutRenderer: place requested locator frames
  LayoutRenderer-->>Publication: return locator map names
  Publication-->>Client: return layout result
Loading

Suggested reviewers: elpidioassinaturas, giswqs, m-hollis-1

Merge Risk: Minimal · up to c4e53

This change lets publication layouts place an inset and a globe locator together and returns both map names. No concrete defect was found in the reviewed code or tests, so the merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(layout): an inset and a globe locator together on a publication sheet" names the main change. The PR lets layout.publication accept "locator": ["inset", "globe"], so both locators appe…
Description check Passed The description follows the repository template. It has a Summary that explains the change and why it is needed. It has a Testing section that lists new tests, the updated veil-panel test, and the gre…
Linked Issues check Passed Directly linked issue #3240 is open and is the primary requirement source. Its coding requirements are:
1. Accept "locator": ["inset", "globe"] in layout.publication. Addressed: publication_locators i…
Out of Scope Changes check Passed Each changed area connects to the #3240 objective:
- crates/engine/src/cmd/layout/publication/mod.rs: list parsing, the Locator enum, and side-by-side sizing. Core of the objective.
- crates/engine/sr…
Full details: Title check

Explanation

The title "feat(layout): an inset and a globe locator together on a publication sheet" names the main change. The PR lets layout.publication accept "locator": ["inset", "globe"], so both locators appear together on a publication sheet. The title is specific and matches the changeset, linked issue #3240, and the objectives.

Full details: Description check

Explanation

The description follows the repository template. It has a Summary that explains the change and why it is needed. It has a Testing section that lists new tests, the updated veil-panel test, and the green CI checks. It has a UI evidence section with before and after screenshots for the visible change, which the template requires. It has a Related issue section that closes #3240. The Summary is clear and the sections are filled in. The description meets the template requirements.

Full details: Linked Issues check

Explanation

Directly linked issue #3240 is open and is the primary requirement source. Its coding requirements are:

  1. Accept "locator": ["inset", "globe"] in layout.publication. Addressed: publication_locators in crates/engine/src/cmd/layout/publication/mod.rs now returns a list, and a list accepts unique "inset" and "globe" entries.
  2. The inset outlines the map frame and the globe outlines the inset. Addressed: the change chains the extent indicators, with the globe pointed at the inset.
  3. Both locators occupy the locator corner, or the top of a column in column styles, side by side. Addressed: placement.rs veil_panel now takes locator (width, height). The summary states the pair is placed side by side and the legend goes below.
  4. A one-item list matches its string form, and [] matches "none". Addressed by the list handling and the tests listed in the PR.
  5. "none" in a list, repeated entries, and unknown entries are refused with an explanation before anything is added. Addressed by the refusal logic and the refusal tests.
  6. The result locator lists both maps, inset first. Addressed: the result data is a name or an array of names.
  7. No project-format change. Consistent with the diff summary, which lists no new model or format.
    Tests: crates/engine/src/tests/layout_publication_locators.rs (+169 lines) covers nesting, order, single-item lists, refusals, column styles, corner arrangements, orphan globe reuse with Undo, and the scale-bar box. The veil-panel test was updated for the new signature.
    The wizard Elements step (#3243) is a stated follow-up and is not a requirement of #3240. The phone interface is excluded by the PR description and is not required by #3240.
    Uncertainty: this assessment relies on the whole-PR summary and the stated test list. I did not re-run the tests or read the test file or the publication/mod.rs hunks directly.
Full details: Out of Scope Changes check

Explanation

Each changed area connects to the #3240 objective:

  • crates/engine/src/cmd/layout/publication/mod.rs: list parsing, the Locator enum, and side-by-side sizing. Core of the objective.
  • crates/engine/src/cmd/layout/publication/placement.rs: veil_panel takes locator (width, height) so the pair fits. Required for the side-by-side placement.
  • crates/engine/src/cmd/layout/frame.rs: PLACED_OVER_MAP includes Locator Inset and Locator Globe so the scale-box refit checks both. Required by the scale-bar requirement in the PR.
  • crates/engine/src/cmd/layout/inputs.rs: globe-map replacement inputs are added when the list contains Globe. Required for the globe locator.
  • crates/engine/src/cmd/layout.rs: command documentation for the new option. Documentation for the objective.
  • crates/engine/src/tests.rs and tests/layout_publication_locators.rs: test registration and new tests. Supporting tests for the objective.
  • docs/user-guide/layouts.md and crates/assistant/skills/print-layout/SKILL.md: documentation of the new option. Supporting documentation.
    No change in the summaries falls outside the locator feature. The PR description states that the wizard and phone interface are not changed. Those exclusions do not add out-of-scope code.
    Uncertainty: based on the diff summaries. I did not read the hunks 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 drew an inset near,
Then set a globe beside it here.
The globe traced where the inset lay,
Two names came back to mark the way.
The legend found its place below,
And off hopped I through maps of snow.

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: e1477de6-12c6-44c6-accc-2d15a424b049
Commits

Reviewing files that changed from the base of the PR and between 4699797 and c4e538f.

Files selected for processing: 9

  • crates/assistant/skills/print-layout/SKILL.md
  • crates/engine/src/cmd/layout.rs
  • crates/engine/src/cmd/layout/frame.rs
  • crates/engine/src/cmd/layout/inputs.rs
  • crates/engine/src/cmd/layout/publication/mod.rs
  • crates/engine/src/cmd/layout/publication/placement.rs
  • crates/engine/src/tests.rs
  • crates/engine/src/tests/layout_publication_locators.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; 6 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

I read the full diff, the base-branch AGENTS.md, and the surrounding code: the placement and veil logic, the renderer's extent_of handling, the scale-bar notice, PLACED_OVER_MAP, the removed Locator::None and publication_locator references, and every veil_panel and legend_room caller. I found no bugs, crash paths, silent data loss, or AGENTS.md breaks. I could not compile or run the tests here (no shell), so the test results are unverified.

Bugs: none found. The checks that came back clean:

  • The inset and globe slot order is mirrored correctly on the right half of the map.
  • The globe's extent_of chains to the inset, and the renderer resolves that chain.
  • Single-locator sizes are unchanged in the column, the corner, and the veil path (the (side, side) → (locators_w, side) change is equivalent when the count is 1).
  • A list can hold at most two distinct entries, so the array path stays bounded under hostile_params_never_panic.
  • The scale-bar notice's name (locator inset) matches what the new test expects.

Security: none found. Input is parsed with get()/as_str() and refused with errors, and the new elements are only strings.

Performance: none found.

Quality:

  • The locator answer now has three shapes: a string, an array of two names, or null. Existing inputs are unaffected, but the command help doesn't describe the array (confidence: medium). Inline comment on mod.rs:2111.
  • The element-name match in the locator loop (mod.rs:1885) is hard to read because its first arm is a count guard. docs/user-guide/layouts.md:223 also runs past the paragraph's wrap width. Inline nit on mod.rs:1885.

AGENTS.md: no breaks found. Checked against the rules on:

  • Undo/.view() and the layout.publication ingress.
  • Surfaces: the MCP help, the skill, and the CLI/Python parameter path (the help text changed, not the parameter keys, so command-surface.txt needs no update).
  • Saved format: the element names are new strings, not a schema change.
  • Test hygiene: no same-token assert_eq!, no timer waits.

Twins checked: publication_locator (singular) and Locator::None have no remaining references. veil_panel has all its callers updated. legend_room is consistent for width and height. The Publication Layout Wizard (ui-egui) still offers one locator, which the PR states, and its existing test still holds. The PLACED_OVER_MAP scale-bar check covers both new names. The ui-touch phone interface has no publication control, so nothing there.

Earlier concerns: none. prior-reviews.json has no threads, so nothing was left alone for that reason.

Change size

Compared with main (merge base 4e42a2e to PR head c4e538f), the whole PR.

Measure Value
Files changed 9 (1 added, 8 modified, 0 removed, 0 renamed)
Size before 4.04 MB (4,241,349 B)
Size after 4.06 MB (4,252,625 B)
Total size change +11.0 KB
Path Before After Change
crates/engine/src/tests/layout_publication_locators.rs 0 B 8.1 KB +8.1 KB
crates/engine/src/cmd/layout/publication/mod.rs 134.2 KB 136.5 KB +2.3 KB
docs/user-guide/layouts.md 86.0 KB 86.3 KB +313 B
crates/engine/src/tests.rs 3.7 MB 3.7 MB +115 B
crates/engine/src/cmd/layout.rs 54.7 KB 54.8 KB +72 B
crates/assistant/skills/print-layout/SKILL.md 4.8 KB 4.9 KB +60 B
crates/engine/src/cmd/layout/frame.rs 20.9 KB 20.9 KB +34 B
crates/engine/src/cmd/layout/publication/placement.rs 11.9 KB 11.9 KB +7 B
crates/engine/src/cmd/layout/inputs.rs 14.6 KB 14.6 KB +3 B

@jgregoriorincon
jgregoriorincon marked this pull request as draft November 28, 2026 16:42
@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-3244/
Web app https://preview.rustgis.app/pr-3244/app/
Commit c4e538f

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 marked this pull request as ready for review November 28, 2026 17:09
@github-actions

Copy link
Copy Markdown
Contributor

Code review

I read the diff, the staged AGENTS.md, and the prior threads, then checked the surrounding code: the publication placement and its helpers, the locator resolution in inputs.rs, the renderer's extent_of lookup, orphan-globe reuse, the removal path in crates/map/src/layout.rs, and the scale-bar notice in frame.rs. I could not compile or run the tests here, so everything below comes from reading the code.

Bugs

  • None found. The globe branch always returns Some, so locator_count matches locator_maps.len() and the pair's width and gap stay consistent. Refusals happen before anything is added, as the PR claims. The globe's extent_of chains to the inset, and removing the inset clears the reference in crates/map/src/layout.rs. Confidence: high.

Security

  • None found. The new parameter handling only accepts two known strings, with duplicates and bad entries refused and no unbounded growth. Confidence: high.

Performance

  • None found. Inputs are capped at two locators. Confidence: high.

Quality

  • crates/engine/src/cmd/layout/publication/mod.rs:1854: the "no room for the legend" warning suggests "locator": "none", which drops both locators at once when two were asked for. This is wording only; I posted it inline. Confidence: medium.
  • Not posted, low confidence: nothing checks that the locator pair fits a narrow non-column frame. at() does not clamp, so the pair could extend past the frame with no notice. The clamps I checked on sheets and figures keep the pair narrower than the frame, so I could not reproduce it. Confidence: low.

AGENTS.md

  • None found. Checked against the rules:
    • Never silent: the new refusals are errors, and the scale-box notice still fires for the new names.
    • Command surface: parameter keys are unchanged, so command-surface.txt needs no update.
    • Saved format: unchanged, so no schema or fixture update is needed.
    • Undo and removal are covered by the new tests.
    • The PR body states which surfaces it reaches.
    • Twins: the Publication Wizard still offers one locator, which the PR defers to [Feature]: The Publication Layout Wizard offers the inset and globe locators together #3243. The renderer and removal paths already handle a frame that outlines another frame.

Earlier concerns left alone

Two prior threads were already answered by the author, so I did not repost them:

  • The answer's locator shape changes to an array when both are asked for. The author pointed to the user guide.
  • The long line and wrapping in the layout guide, and the name-derivation nit at mod.rs:1885. The author said it is readability only.

Change size

Compared with the base branch (merge base 4e42a2e to PR head c4e538f).

Measure Value
Files changed 9 (1 added, 8 modified, 0 removed, 0 renamed)
Size before 4.04 MB
Size after 4.06 MB
Total size change +11.0 KB
File Before After Change
crates/engine/src/tests/layout_publication_locators.rs 0 B 8.1 KB +8.1 KB
crates/engine/src/cmd/layout/publication/mod.rs 134.2 KB 136.5 KB +2.3 KB
docs/user-guide/layouts.md 86.0 KB 86.3 KB +313 B
crates/engine/src/tests.rs 3.73 MB 3.73 MB +115 B
crates/engine/src/cmd/layout.rs 54.7 KB 54.8 KB +72 B
crates/assistant/skills/print-layout/SKILL.md 4.8 KB 4.9 KB +60 B
crates/engine/src/cmd/layout/frame.rs 20.9 KB 20.9 KB +34 B
crates/engine/src/cmd/layout/publication/placement.rs 11.9 KB 11.9 KB +7 B
crates/engine/src/cmd/layout/inputs.rs 14.6 KB 14.6 KB +3 B

@jgregoriorincon
jgregoriorincon added this pull request to the merge queue Nov 28, 2026
Merged via the queue into opengeos:main with commit 27ffc55 Nov 28, 2026
29 checks passed
@jgregoriorincon
jgregoriorincon deleted the feat/3240-locator-list branch November 28, 2026 17:47
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]: Publication Layout: an inset and a globe locator together, the globe outlining the inset

1 participant