Skip to content

fix(layout): number map series pages whose name is empty (#1998) - #2145

Merged
Mavrick-F merged 2 commits into
opengeos:mainfrom
Mavrick-F:fix/map-series-empty-page-names
Nov 15, 2026
Merged

Mavrick-F merged 2 commits into
opengeos:mainfrom
Mavrick-F:fix/map-series-empty-page-names

Conversation

@Mavrick-F

@Mavrick-F Mavrick-F commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Summary

A map series page whose name field is empty showed <Null> as its {pageName} (found while fixing #1998's guide items, in #2107's review). A page whose name value is null, empty or only whitespace now uses its row number, starting at 1, as a page already does when the name field doesn't exist. The page list, the current page's name and {pageName} in dynamic text all agree. The layouts guide says so.

Testing

  • map_series_empty_names_use_row_numbers: names A, null and "" give pages A, 2, 3 in the page list, layout.seriesPage and {pageName}; whitespace-only text falls back, while A, 0, false and the text <Null> keep their values; a removed name field numbers every page.
  • cargo xtask ci on the fork's CI.

UI evidence

No visible UI change beyond the page names themselves.

Related issue

Part of #1998 (the map series <Null> page name line).

Summary by CodeRabbit

  • Bug Fixes
    • Map Series page names now fall back to the 1-based row number when the label is missing, null, empty, or whitespace-only.
  • Documentation
    • Clarified how {pageName} uses label values and when it falls back to the row number.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Map series page names now fall back to the one-based row number when the name field is missing or its value is null, empty, or whitespace-only. Tests check the page list, page information, command result, and template expansion. Documentation describes the fallback.

Changes: Map Series Page Names

Layer / File(s) Summary
Page-name fallback behavior
crates/engine/src/cmd/layout.rs, crates/engine/src/tests.rs, docs/user-guide/layouts.md
page_name uses the field value when it is non-null and nonblank after trimming. Otherwise, it uses the one-based row number. Tests cover missing, null, empty, whitespace-only, and other values across page outputs and {pageName} expansion. Documentation describes the fallback.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • opengeos/RustGIS#1998 — The issue describes empty map series names displaying <Null> and proposes falling back to the row number.

Suggested reviewers: giswqs, elpidioassinaturas, pick2510

Merge Risk: Minimal · up to 141a0

Map series pages with null, empty, or blank names now show their one-based row number instead of a null placeholder. The change is small and tested, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: map series pages whose name is empty are now numbered by row. It uses the fix(layout) prefix and references #1998. It matches the summary, which says a null, empty, or…
Description check Passed The description follows the template. It has Summary, Testing, and Related issue sections. The UI evidence section states 'No visible UI change beyond the page names themselves,' which is a reasonable…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: map series pages whose name is empty are now numbered by row. It uses the fix(layout) prefix and references #1998. It matches the summary, which says a null, empty, or whitespace-only name now falls back to the one-based row number.

Full details: Description check

Explanation

The description follows the template. It has Summary, Testing, and Related issue sections. The UI evidence section states 'No visible UI change beyond the page names themselves,' which is a reasonable answer to the required UI section. The Testing section names the new test and reports the CI run. The Summary explains the bug, the fix, and the docs update. The Related issue section says 'Part of #1998.' The description is complete and matches the changes.

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 turns the page with care,
Blank names yield a number there.
Null and spaces take the same route,
While named pages keep their name throughout.
The map series hops along.<fixed_issue_severity>Low</fixed_issue_severity>

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: cc2824f4-4905-469c-98e4-d57d75ca9af0
Commits

Reviewing files that changed from the base of the PR and between 32668f6 and 141a0fb.

Files selected for processing: 3

  • crates/engine/src/cmd/layout.rs
  • crates/engine/src/tests.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

I read the diff, the surrounding page_name/series_pages/series_info/series_page code, Value's Display and is_null, Dataset::value (returns &Value), the CSV writer's null handling, and the test's helpers and imports. I could not compile or run the tests here, so the type checks below are by reading.

No prior review threads exist on this PR, so none were left out as already raised.

Bugs: None found. The change is correct for the cases I traced:

  • Null, empty and whitespace-only names fall back to the row number. Text such as " A ", 0 and false keep their values.
  • The page list, layout.seriesPage, series_info (used by the UI and by layout_svg) and {pageName} all go through page_name, so they agree.
  • The test's helpers exist with the signatures it uses: expand takes four arguments, layout.new creates a map frame by default, Session::new takes a Project, and Dataset::push and series_pages/series_info are reachable from tests.rs.
  • CSV files write null as an empty cell, so a round-trip gives empty text, which the fix already covers. The literal <Null> text case only comes from data the user typed.

Security: None found.

Performance: None found. The per-row String allocation was already there.

Quality (low confidence, no action needed):

  • Pages named by row number can repeat a real name, for example ["2", null] gives "2" twice. Nothing looks pages up by name, so this is cosmetic. Confidence: medium.
  • The fallback is silent, with no notice through Session::notify. I don't think AGENTS.md's "Never silent" rule applies: a page label is not data that is dropped or approximated, the guide documents the fallback, and the existing missing-field path is silent too. Confidence: medium.

AGENTS.md: Compliant. The new code has no unwrap/expect/indexing outside the test. The test covers both lossy-free and fallback inputs. No saved format changed, so no schema or fixture update is needed. No new interface strings, and nothing for wasm. The guide edit matches the behaviour.

I left no inline comments because I found nothing above nit level.

Change size

Compared with the base branch: the whole PR against main (merge base e5fb706 to PR head 141a0fb).

Measure Value
Files changed 3 (added 0, modified 3, removed 0, renamed 0)
Size before 3.16 MB
Size after 3.16 MB
Total size change +2.1 KB
Path Before After Change
crates/engine/src/tests.rs 2.83 MB 2.83 MB +1.9 KB
crates/engine/src/cmd/layout.rs 293.7 KB 293.8 KB +208 B
docs/user-guide/layouts.md 45.7 KB 45.7 KB +47 B

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-2145/
Web app https://preview.rustgis.app/pr-2145/app/
Commit 141a0fb

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

@Mavrick-F
Mavrick-F merged commit ff3f9a7 into opengeos:main Nov 15, 2026
21 checks passed
@Mavrick-F Mavrick-F mentioned this pull request Nov 15, 2026
56 of 63 tasks
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.

1 participant