Skip to content

feat(layout): headline figures on a publication's panel style - #3265

Merged
jgregoriorincon merged 2 commits into
opengeos:mainfrom
jgregoriorincon:feat/3263-panel-figures
Nov 28, 2026
Merged

jgregoriorincon merged 2 commits into
opengeos:mainfrom
jgregoriorincon:feat/3263-panel-figures

Conversation

@jgregoriorincon

@jgregoriorincon jgregoriorincon commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

layout.publication's panel style takes "figures", the headline figures an edge sheet already draws.

  • Up to three {"value", "label"}, stacked in the panel under its title and subtitle, each value large and bold over its label, with the edge sheet's element names (Figure 1 Value, Figure 1 Label…). The locator and the legend take the room left under them.
  • A sheet whose area is wider than tall is still cut and centred: with figures, the cut stops at the height the panel needs. Without that floor the next pass failed and the sheet was left uncut.
  • With less room left in the panel, the locator is drawn smaller and the legend shows fewer rows, as under a long title.
  • Texts that leave the locator and the legend no room are refused, the message naming the figures too.
  • "paper" and "kicker" stay an edge sheet's; the other styles and journal figures still refuse "figures".
  • The command help, the user guide and the assistant's print-layout skill say so. No project format change: the figures are ordinary text elements.

Not in this PR: a chart in the panel; the publication wizard does not ask for figures yet.

Testing

  • New tests in crates/engine/src/tests/layout_panel_figures.rs, written first; the edge style's refusal test now expects a panel to take "figures".
  • On 20a8b697: fmt, clippy, cargo nextest run (10511 passed, 29 skipped), doctests, layer check and schema check all green. The one commit after it changes a comment (fmt and clippy of rustgis-engine green).
  • Before and after sheets below, exported with ui_shot.

UI evidence

Before (main, no figures, since a panel refuses them) and after, the same A4 panel sheet:

panel-before-after.png

An area wider than tall, where the sheet is cut and centred:

low-before-after.png

Related issue

Closes #3263.

Summary by CodeRabbit

  • New Features
    • Panel-style publication layouts now support headline figures, stacked beneath the title and subtitle and above the locator and legend. Figures are included in panel-space checks, and layouts report an error when there isn’t enough room.
  • Documentation
    • Updated the layout guide and command descriptions to clarify figure placement and which options are available for panel and edge styles.

@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 panel layouts now accept headline figures and stack them in the side panel. The layout accounts for figure space when checking panel content and setting frame height. Tests cover placement, fit, invalid inputs, and undo behavior.

Changes: Panel headline figures

Layer / File(s) Summary
Figure acceptance contract
crates/engine/src/cmd/layout/publication/mod.rs, crates/engine/src/cmd/layout.rs, crates/assistant/skills/print-layout/SKILL.md, docs/user-guide/layouts.md, crates/engine/src/tests/layout_edge.rs
The command accepts figures for panel and edge styles. paper and kicker remain edge-only. Documentation and the edge-style validation test reflect these rules.
Panel placement and sizing
crates/engine/src/cmd/layout/publication/mod.rs, crates/engine/src/tests.rs, crates/engine/src/tests/layout_panel_figures.rs
Panel layouts stack figure values and labels and include their space in panel and frame-height calculations. Tests cover placement, fit across profiles and panel extents, empty and invalid inputs, insufficient space, and undo.

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

Change: Feature · Severity of issue fixed: Low

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant PublicationLayout as layout.publication
  participant PanelLayout as Panel layout
  participant FrameHeight as Frame-height calculation
  Client->>PublicationLayout: Submit panel style and figures
  PublicationLayout->>PublicationLayout: Validate style and figures
  PublicationLayout->>PanelLayout: Place values and labels in panel
  PanelLayout->>FrameHeight: Provide required panel height
  FrameHeight-->>Client: Return layout with figures
Loading

Possibly related issues

Possibly related PRs

  • opengeos/RustGIS#3128 — Adds the figures parameter for edge-style publication layouts, which this change extends to panel style.
  • opengeos/RustGIS#3107 — Establishes the edge-only rules for paper and kicker that this change retains.

Suggested reviewers: elpidioassinaturas, giswqs

Merge Risk: Minimal · up to 28623

Publication panel layouts now accept up to three headline figures stacked in the side panel, and the documentation and tests are updated to match. No blocking risk was found. A rare tall-sources case may leave a wide sheet uncut, which is cosmetic and not a reason to hold the merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(layout): headline figures on a publication's panel style" names the main change: the panel style of layout.publication now accepts "figures". It matches the raw summary, the PR objecti…
Description check Passed The description follows the template's main sections. It has a Summary that explains the change and its reasons, and a Testing section that lists new tests, the commands run, and the results. It has a…
Linked Issues check Passed Directly linked issue #3263 has these coding objectives: (a) a panel sheet accepts up to three {value, label} figures, which may hold layer statistics such as {count:Cities}; (b) figures stack under t…
Out of Scope Changes check Passed All changed areas connect to #3263. The publication/mod.rs change (figures accepted for panel style, panel-height floor for the frame cut, panel-space error naming the figures) implements the request,…
Full details: Title check

Explanation

The title "feat(layout): headline figures on a publication's panel style" names the main change: the panel style of layout.publication now accepts "figures". It matches the raw summary, the PR objectives, and linked issue #3263. The title is specific and short, and it follows a conventional commit form.

Full details: Description check

Explanation

The description follows the template's main sections. It has a Summary that explains the change and its reasons, and a Testing section that lists new tests, the commands run, and the results. 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 #3263. The template's inline guidance ("Required") is replaced with real content, so no placeholder text remains. The description does not name a specific ui_shot command beyond its name, but this is a minor gap.

Full details: Linked Issues check

Explanation

Directly linked issue #3263 has these coding objectives: (a) a panel sheet accepts up to three {value, label} figures, which may hold layer statistics such as {count:Cities}; (b) figures stack under the title and subtitle, with large bold values over labels and edge-sheet element names (Figure N Value / Figure N Label); (c) the locator and legend use the room below the figures; (d) text that leaves no room for the locator and legend is refused, and the message names the figures; (e) paper and kicker stay edge-only; other styles still refuse figures; (f) no project format change. The file crates/engine/src/tests/layout_panel_figures.rs at the reviewed head covers (a) to (d). It checks stacking and panel bounds for one to three figures, a figure with a statistic value ({count:Countries}) that is bold with size 18 and wrapped, placement with no title, fit across all sheet profiles, and placement when the panel is cut to low extents. It checks that absent, null, or empty figures leave the layout unchanged, that over-long text returns an error naming 'the figures' with no layout added, that invalid figure input is refused, and that one undo removes the layout. The summary says the edge-style refusal test now expects a panel to accept figures, and the PR description says paper and kicker are still refused for panels. The changed source file crates/engine/src/cmd/layout/publication/mod.rs could not be read because its changed blobs were unavailable. So the implementation is established only from the summary and the test file, not from the source diff. The PR reports the test suite as green, which I did not run. Objective (e) for paper and kicker is supported by the summary of layout_edge.rs and the PR text, not by a direct read.

Full details: Out of Scope Changes check

Explanation

All changed areas connect to #3263. The publication/mod.rs change (figures accepted for panel style, panel-height floor for the frame cut, panel-space error naming the figures) implements the request, and the frame-cut floor is needed so the figures fit on wide sheets. The tests in layout_panel_figures.rs and the adjusted refusal test in layout_edge.rs verify this behavior. The tests.rs module registration is required to build the new tests. The documentation changes (command help in cmd/layout.rs, docs/user-guide/layouts.md, and the print-layout SKILL.md) describe the new panel behavior. The PR states that no project format change is made. No unrelated change was identified in the summaries or the test file. The source diff could not be read, so this verdict relies on the change summaries.

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 stacks figures, neat and tall
Beneath the title, beside the map
Labels hop into their places
The panel leaves room for legend and locator
Frame height rises to fit them all
One undo makes the layout vanish

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: ce41be75-112d-4952-aac0-c363b9cf3afa
Commits

Reviewing files that changed from the base of the PR and between 27ffc55 and 286237c.

Files selected for processing: 7

  • crates/assistant/skills/print-layout/SKILL.md
  • crates/engine/src/cmd/layout.rs
  • crates/engine/src/cmd/layout/publication/mod.rs
  • crates/engine/src/tests.rs
  • crates/engine/src/tests/layout_edge.rs
  • crates/engine/src/tests/layout_panel_figures.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; 3 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Scope: 7 files, panel-style headline figures for layout.publication (#3263). No prior review threads existed on this PR, so nothing was skipped as already raised.

Bugs

None found. I traced the cut loop by hand. panel_needs is set on the uncut pass and reused for the target. The moved term (the sources and reference boxes that move under the map) is consistent with the frame height the loop converges on, and the 31·k versus 30·k check leaves the stated 1·k of slack. The figure-to-panel placement, the figures refusal for non-edge and non-panel styles, and the headline_figures reuse all check out.

Security

None found. The new input is parsed and length-limited by the existing headline_figures and MAX_PUBLICATION_TEXT path.

Performance

None found. The extra footer call is a few text-wrap operations on the first pass only.

Quality

  • Nit, low confidence: panel_needs at publication/mod.rs:738 runs the footer closure a second time just to measure the boxes' height, using a throwaway Vec. The arithmetic is correct, but a named helper or a note would make it easier to follow. Posted inline, and left for the release quality pass.

AGENTS.md

No breaks found. Checked against:

  • Never crash: no new unwrap, expect, or indexing in non-test code.
  • Never silent: the refusal is an error, and the wrapping is checked by the no-room test.
  • Reach every surface: the command help, the user guide, and the assistant skill are updated. The publication wizard is explicitly out of scope in the PR body.
  • Schema: no project format change, so no schema regeneration is needed.
  • Command surface: only help text changed, with no parameter keys added or removed.

Twins checked

  • Edge-sheet figures: the same Figure N Value and Figure N Label naming, and the same headline_figures validation. The new panel path has its own layout code.
  • Refusal rules: paper and kicker stay edge-only. figures is accepted on edge and panel sheets and refused everywhere else, including journal figures. layout_edge.rs is updated to match.
  • Statistic expansion: {count:Layer} in panel figures goes through the same statistic_figures call as the edge sheet.
  • Not applicable: no overlay tools, no layer.add* or project.open* paths, and no #[cfg(target_arch = "wasm32")] branches in the diff.

Change size

Compared: the whole PR against main (merge base 27ffc55 to PR head 286237c).

Files changed Added Modified Removed Renamed
7 1 6 0 0
Size before Size after Total change
4.0 MB 4.0 MB +8.5 KB
Path Before After Change
crates/engine/src/tests/layout_panel_figures.rs 0 B 5.9 KB +5.9 KB
crates/engine/src/cmd/layout/publication/mod.rs 136.5 KB 138.6 KB +2.2 KB
docs/user-guide/layouts.md 86.3 KB 86.5 KB +186 B
crates/engine/src/tests/layout_edge.rs 16.1 KB 16.2 KB +131 B
crates/engine/src/tests.rs 3.7 MB 3.7 MB +69 B
crates/assistant/skills/print-layout/SKILL.md 4.9 KB 4.9 KB +55 B
crates/engine/src/cmd/layout.rs 54.8 KB 54.8 KB +48 B

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-3265/
Web app https://preview.rustgis.app/pr-3265/app/
Commit 286237c

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 9ee216a Nov 28, 2026
28 checks passed
@jgregoriorincon
jgregoriorincon deleted the feat/3263-panel-figures branch November 28, 2026 19:22
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: the panel style takes headline figures

1 participant