Skip to content

fix(layout): main builds again: pass legend_sizes_mm its excluded layers and labels - #1751

Merged
giswqs merged 1 commit into
mainfrom
fix/legend-sizes-call
Nov 11, 2026
Merged

giswqs merged 1 commit into
mainfrom
fix/legend-sizes-call

Conversation

@giswqs

@giswqs giswqs commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

main doesn't build: rustgis-engine fails with E0308 at crates/engine/src/cmd/layout.rs:1992. #1725 added a call to legend_sizes_mm(…, &[]), and #1739 (merged alongside it) changed that last parameter to a pair (exclude, labels). Each PR's CI passed on its own; together they don't compile. Every PR's CI is red until this lands (seen on #1748).

The call measures the legend at another scale while searching for one where it fits, so it passes the same (&[], &Default::default()) as the measurement at the asked scale in the same function (line 1805). One line; cargo clippy -p rustgis-engine --all-targets -D warnings is clean and the engine's layout and legend tests pass (52).

Summary by CodeRabbit

  • Bug Fixes
    • Legend-size measurements now use consistent default labels and exclusions when evaluating publication scales, helping keep layout sizing consistent.

#1725 added a call to legend_sizes_mm with an empty slice for its last
argument while #1739 changed that argument to a pair of the excluded
layers and the labels, so main no longer builds. The call measures the
legend at another scale, so it passes the same empty pair as the
measurement at the asked scale above it.
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The publication-layout legend sizing call now passes an empty exclusion slice and an empty default labels map as separate arguments.

Changes: Legend sizing

Layer / File(s) Summary
Update legend sizing call
crates/engine/src/cmd/layout.rs
The legend sizing call passes an empty exclusion slice and an empty default labels map.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Possibly related issues

  • opengeos/RustGIS#1654 — This call supplies the labels argument used by per-layer legend labels, but passes an empty map.

Possibly related PRs

  • opengeos/RustGIS#1739 — That PR changes legend_sizes_mm to accept exclusions and a label map; this change updates a publication-layout call to pass both arguments.

Suggested reviewers: elpidioassinaturas

Merge Risk: Minimal · up to 3f79b

No merge-blocking risk is identified, subject to normal build and test checks.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly identifies the build fix and the legend-size arguments that changed.
Description check Passed The description explains the build failure and the fix, reports testing, and states that there is no visible UI change. It does not include a dedicated Related issue section, but the description is ot…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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: Description check

Explanation

The description explains the build failure and the fix, reports testing, and states that there is no visible UI change. It does not include a dedicated Related issue section, but the description is otherwise complete.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • 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 checks the legend’s scale,
An empty map joins the trail.
The call now sends its args in pairs,
While rabbit ears inspect the squares.
Then hops away through layout’s vale.

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: d02c2fda-cf3c-4663-bde3-3f5852d2fbcf
Commits

Reviewing files that changed from the base of the PR and between 11c844c and 3f79b37.

Files selected for processing: 1

  • crates/engine/src/cmd/layout.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Reviewed the one-line change in crates/engine/src/cmd/layout.rs:1992-1993. It passes (&[], &Default::default()) as the (exclude, labels) tuple that legend_sizes_mm now takes, instead of the old &[]. It matches the asked-scale call at line 1805 and the auto-created legend at line 2391, both of which use empty exclude and labels. The tuple type checks against the signature at crates/render/src/layout.rs:1968, and the line is 140 columns, within the repo's max_width = 140.

  • Bugs: None found. The fix restores compilation. The empty exclude and labels are consistent with the asked-scale measurement in the same function. Confidence: high.
  • Security: None found. No input handling changed. Confidence: high.
  • Performance: None found. Confidence: high.
  • Quality: None worth raising. Repeating &Default::default() at two sites could be a named constant, but that's a quality point left for the release quality pass. Confidence: high.
  • AGENTS.md: No violations. It is a compile fix, so it needs no new regression test, and the change adds no unwrap, unsafe or background-work concerns.

I could not build, run clippy or run the tests here (no Bash access). The PR's claims that clippy is clean and that 52 engine tests pass are unverified. The reasoning above comes from reading the code. No inline comments were posted.

Prior reviews: the PR has no review threads, so no earlier concerns were left alone.

Change size

Compared with the base branch (whole PR, merge base 0c44ff6 to head 3f79b37).

Measure Value
Files changed 1 (added 0, modified 1, removed 0, renamed 0)
Size before 248.3 KB
Size after 248.4 KB
Total size change +55 B
Path Before After Change
crates/engine/src/cmd/layout.rs 248.3 KB 248.4 KB +55 B

@giswqs
giswqs merged commit a411d53 into main Nov 11, 2026
15 of 16 checks passed
@giswqs
giswqs deleted the fix/legend-sizes-call branch November 11, 2026 01:12
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