Skip to content

fix(layout): a mosaic's veil group skips bands that hide a panel number - #3551

Merged
jgregoriorincon merged 1 commit into
opengeos:mainfrom
jgregoriorincon:fix/3538-veil-group-numbers
Dec 1, 2026
Merged

jgregoriorincon merged 1 commit into
opengeos:mainfrom
jgregoriorincon:fix/3538-veil-group-numbers

Conversation

@jgregoriorincon

@jgregoriorincon jgregoriorincon commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

On a mosaic sheet, a veiled map's group of surrounds that would hide a panel's number was refused only after the search for the map's place. The veil was dropped, but the coverage stayed masked as if veiled, so the surrounds could go onto data counted as free, with no warning, and a scale or move tried for the veil stayed.

The search now skips a band whose group hides a number and tries the next band, column count, move or scale. If none is clear, the sheet is laid out as an unveiled one. The later refusal is removed. The NUMBER_ZONE_MM comment is corrected too: the numbers are drawn at 10 points.

Only mosaic sheets change (other styles have no panel numbers). It is the same layout.publication command on every surface; no new parameter, UI string or saved-format change.

Testing

  • layout_mosaic.rs: another band takes the group, and the veil and scale stay; with no band clear, the answer and every element's place match the "veil": false sheet. Both tests fail without the fix.
  • Full local checks: fmt, clippy, doctests, layers and schema pass; nextest 11921 passed and 8 failed, all in rustgis-geolibre (7) and one ui-egui smoke test, outside the files changed.
  • Headless ui_shot, before and after.

UI evidence

Mosaic sheet with a second panel under the veil's group. Left, before: the veil is dropped and the surrounds sit on the data. Right, after: the group takes another band and the veil stays.

before and after

Related issue

Closes #3538

Summary by CodeRabbit

  • Bug Fixes
    • Veil placement now avoids covering numbered map areas, helping preserve the veil when a suitable placement is available.
  • Documentation
    • Clarified the documented size and styling of key-map numbers.
  • Tests
    • Expanded coverage for veiled map layouts, including panels beneath legend placement candidates.

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The publication layout now filters veil surround groups against numbered map areas during candidate search and final grouping. Tests cover panels under the legend and compare a veil-dropped result with an unveiled sheet. The key-map number description now specifies a bold 10-point digit with a halo.

Changes: Mosaic veil surround placement

Layer / File(s) Summary
Filter surround groups against numbered areas
crates/engine/src/cmd/layout/publication/mod.rs, crates/engine/src/cmd/layout/publication/mosaic.rs
Candidate search and final grouping reject surround groups whose legend, locator, arrow, or scale-bar rectangles overlap numbered map areas. The key-map number description now specifies a bold 10-point digit with a halo.
Test veil and placement results
crates/engine/src/tests/layout_mosaic.rs
Shared helpers set up narrow-extent sheets and place a panel under the legend. Tests check veil retention and compare a veil-dropped result with an unveiled sheet.

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

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

  • opengeos/RustGIS#3524: Adds the mosaic publication style and its rule for surrounds that would cover panel numbers.
  • opengeos/RustGIS#1725: Changes veil and surround placement in layout.publication, including the search for alternate band or scale choices.

Suggested reviewers: m-hollis-1, giswqs

Merge Risk: Minimal · up to cd303

This change makes the mosaic veil search skip surround placements that would hide a panel number, and it lays out the sheet as unveiled when no clear placement exists. No concrete merge-blocking risk was found, and the change is narrow in scope.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Inconclusive [#3538] Requires that, on a veiled mosaic sheet, a veil dropped because a surround group hides a panel number must not keep the coverage masked. The reviewed head's publication/mod.rs is readable, and… Provide readable blobs for crates/engine/src/cmd/layout/publication/mod.rs and crates/engine/src/tests/layout_mosaic.rs at the reviewed head, and the merge-base versions, so the diff of the veil search can be inspected. Confirm that the vei…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names the main change: the mosaic veil group now skips bands that would hide a panel number. The raw summary describes the overlap check in the veil-group placement, which matches the title.…
Description check Passed The description follows the template sections: Summary, Testing, UI evidence, and Related issue. The Summary explains the problem, the fix, and the removed refusal. Testing names the tests, the checks…
Out of Scope Changes check Passed The whole-PR changes, per the supplied summary and PR description, touch three files: publication/mod.rs (veil-group search and removal of the final fallback), publication/mosaic.rs (a one-line doc co…
Full details: Title check

Explanation

The title names the main change: the mosaic veil group now skips bands that would hide a panel number. The raw summary describes the overlap check in the veil-group placement, which matches the title. The title uses the fix(layout) convention and is specific, so it passes.

Full details: Description check

Explanation

The description follows the template sections: Summary, Testing, UI evidence, and Related issue. The Summary explains the problem, the fix, and the removed refusal. Testing names the tests, the checks run, and the failures outside the changed files. UI evidence gives a before/after screenshot for a visible mosaic change. The Related issue section links #3538. The template's UI evidence section calls for before and after images. The description provides them, so the required content is present.

Full details: Out of Scope Changes check

Explanation

The whole-PR changes, per the supplied summary and PR description, touch three files: publication/mod.rs (veil-group search and removal of the final fallback), publication/mosaic.rs (a one-line doc comment correcting the NUMBER_ZONE_MM number size to 10 points), and tests/layout_mosaic.rs (test setup refactor and two new veil tests). Each change relates to the mosaic veil behavior in #3538 or to the comment it depends on. The PR states no new parameter, UI string or saved-format change. No unrelated file or behavior change is described. This assessment relies on the supplied summary and file list; the diff contents could not be read.

Full details: Linked Issues check

Explanation

[#3538] Requires that, on a veiled mosaic sheet, a veil dropped because a surround group hides a panel number must not keep the coverage masked. The reviewed head's publication/mod.rs is readable, and its publication() entry point shows the veil setup (may_veil, publication_veil) and the coverage_path handling. The diff for mod.rs and layout_mosaic.rs could not be read: the changed blobs are missing from the checkout. The veil search code that the change edits (band, column, move and scale search, and the removed final-stage fallback) was therefore not read. The PR description and the AI-generated summary both state the intended change: the search skips a band whose group hides a number, falls back to an unveiled layout when no band is clear, and drops the later refusal. The summary also says the new test in layout_mosaic.rs covers the no-clear-band case by comparing against the veil:false sheet. These statements are unverified by source inspection. The author reports tests fail without the fix, but no test run was observed.

Resolution

Provide readable blobs for crates/engine/src/cmd/layout/publication/mod.rs and crates/engine/src/tests/layout_mosaic.rs at the reviewed head, and the merge-base versions, so the diff of the veil search can be inspected. Confirm that the veil search skips a band whose group hides a numbered panel, that a veil with no clear band is laid out unveiled with no later refusal, and that the new layout_mosaic.rs tests exercise both cases.

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 checks the map numbers in a row.
The legend stays clear as the panels grow.
Bold little digits wear halos of light.
Surrounds step back from each number in sight.
The veil holds on—or lets the map shine.

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: 51ede73f-6b1f-414b-b79b-1968b1109430
Commits

Reviewing files that changed from the base of the PR and between e11b061 and cd30359.

Files selected for processing: 3

  • crates/engine/src/cmd/layout/publication/mod.rs
  • crates/engine/src/cmd/layout/publication/mosaic.rs
  • crates/engine/src/tests/layout_mosaic.rs

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

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Code review

Bugs. None confirmed. I traced the veil search in mod.rs and it holds together. veiled is set only when the search finds a band that passes hides, so the old "veiled but coverage still masked" state can't arise from the search. The final grouped call at mod.rs:1903 reuses the same inputs and should agree with the search. Confidence: medium-high. I could not run the tests (no shell here), so the new tests' pass/fail is unverified.

Security. None found.

Performance. None significant. number_zones is recomputed per candidate in in_group, which is needed because it depends on the move. The hides check adds a small overlap scan per band and column. Confidence: high.

Quality.

  • mod.rs:1903: the final grouped call must reproduce the search's result, but nothing says so. If the inputs drift, the sheet keeps its veil with masked coverage, which is the bug this PR fixes. Posted inline. Confidence: medium that it's a real risk, low that it's reachable today.
  • layout_mosaic.rs:438: let (off, answer) binds a Session to off. Rename it to unveiled, and update the placed(&off) line to match.
  • layout_mosaic.rs (a_veiled_key_maps_group_covers_no_panels_number): the at centre is recomputed by averaging under's corners. panel_under_the_legend could return the Coord directly.

AGENTS.md. No violations found. Non-test code has no unwrap, expect or panic. The change is in engine, below apps/, so the wasm build is unaffected. It adds no command, parameter or saved field, so the command-surface snapshot, schema and limit files are unaffected. The behaviour is the same command on every surface, so no ribbon, Assistant or plugin text changes.

Twins. None of the listed families (read routes, overlay tools, add/open commands, wasm branches) is changed. grouped and numbers are used only in this file. numbers is empty outside the mosaic style, so the other styles see no change.

Prior reviews. No review threads exist on this PR, so there were no earlier concerns to leave alone.

Change size

Compared with the base branch: the whole PR against main (merge base 5799813 to PR head cd30359).

Measure Value
Files changed 3 (0 added, 3 modified, 0 removed, 0 renamed)
Size before 177.4 KB
Size after 179.1 KB
Total size change +1.7 KB
Path Before After Change
crates/engine/src/tests/layout_mosaic.rs 17.5 KB 19.1 KB +1.6 KB
crates/engine/src/cmd/layout/publication/mod.rs 149.1 KB 149.2 KB +82 B
crates/engine/src/cmd/layout/publication/mosaic.rs 10.8 KB 10.8 KB -6 B

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-3551/
Web app https://preview.rustgis.app/pr-3551/app/
Commit cd30359

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 Dec 1, 2026
Merged via the queue into opengeos:main with commit 624f77b Dec 1, 2026
28 checks passed
@jgregoriorincon
jgregoriorincon deleted the fix/3538-veil-group-numbers branch December 1, 2026 19:28
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.

[Bug]: A mosaic sheet whose veil is dropped keeps surrounds placed as if veiled

1 participant