Skip to content

fix(report): say which texts are cut off on a report's layout pages - #3215

Merged
jgregoriorincon merged 1 commit into
opengeos:mainfrom
jgregoriorincon:fix/3195-report-clipped-text
Nov 28, 2026
Merged

jgregoriorincon merged 1 commit into
opengeos:mainfrom
jgregoriorincon:fix/3195-report-clipped-text

Conversation

@jgregoriorincon

@jgregoriorincon jgregoriorincon commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Exporting a layout says which texts are cut off on its page. A report that draws that layout as a page said nothing, so the exported report went out with the text cut off and unsaid.

  • A report says its pages' cut-off text. Exporting a report (PDF, or PNG, which draws the first page alone), from the desktop app, a script, Python or the Assistant, and downloading it in the browser, warn of the texts cut off on the layout pages it drew, with the same count, names, ids and advice as the layout's own export.
  • One notice per layout, naming it: The report, layout "Sheet": Text is cut off in 1 layout element(s): Text (7); …. Element ids are a layout's own, and the advice depends on that layout's elements. A layout on several pages is said once, each element counted once.
  • Measured per page. Each layout page is measured with the page number and page count it is drawn with, so a text that shows {page} and is only cut off on some pages is said.

No new state in the session or project, and nothing changes in rustgis-render: the report calls the same clipped_text and clipped_text_notice a layout's export does.

Testing

New tests in crates/engine/src/tests/layout_report_text.rs: a PDF with the same layout on two pages, two layouts whose texts share an id, a text that fits, a PNG whose first page is or isn't the layout, and a text cut off only from page 10 by its own page number. Those that expect a notice failed before the change. The full local checks (fmt, clippy, nextest, doctests, layers, schema) pass. A page too large for vectors and drawn again as a picture has no test of its own; its text is measured once per page, before either drawing.

UI evidence

The Messages pane after exporting a report that draws the layout "Overview", whose title text has three lines in a box too short for them, before (left) and after (right). The entry without "The report" is the open layout view's own notice, unchanged. The exported PDF is byte-identical.

Messages pane before and after

Related issue

Closes #3195

Summary by CodeRabbit

  • New Features
    • PDF and PNG reports now notify you when text is clipped, identifying the affected layout and clipped text.
  • Documentation
    • Updated the layout guide to explain clipping notices in reports.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Report exports now detect clipped text on layout pages and emit notices grouped by layout. The notices account for page-specific numbering and export DPI. Tests cover PDF and PNG behavior, and the layout documentation describes the notices.

Changes: Report layout text notices

Layer / File(s) Summary
Collect and emit clipping notices
crates/engine/src/cmd/report.rs, crates/engine/src/tests.rs, crates/engine/src/tests/layout_report_text.rs, docs/user-guide/layouts.md
PDF and PNG report exports calculate clipped text for layout pages and group notices by layout. Tests cover repeated layouts, distinct layouts, text that fits, PNG page placement, and page-number-dependent wrapping. The documentation describes the report notices.

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

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

  • RustGIS issue 3166 concerns missing report-export notices for chart losses. This change adds text-clipping notices through the same report-export path, but does not address chart losses.
  • RustGIS issue 1998 tracks missing warnings for clipped layout text. This change extends clipping notices to layouts used in reports.

Possibly related PRs

  • opengeos/RustGIS#3192: Changes the same report-export notice path for layout pages, adding chart notices and handling repeated layouts.
  • opengeos/RustGIS#2131: Introduces the layout text-clipping notice behavior that this change reuses for report exports.

Suggested reviewers: mavrick-f, elpidioassinaturas

Merge Risk: Minimal · up to 49adf

Report exports now warn about cut-off layout text with the same notices as layout export. The change only adds notices and has tests for multi-page, PNG and page-dependent cases. No merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: report exports (PDF and PNG) now say which texts are cut off on the layout pages they draw. It matches the summary, the objectives, and the description, and it follows…
Linked Issues check Passed Issue #3195 requires that a report export name the cut-off texts of each layout that the report draws as a page, as a layout export does. The PR description and the change summary for crates/engine/sr…
Out of Scope Changes check Passed All changed files relate to the objective of #3195. crates/engine/src/cmd/report.rs holds the report export notice logic. crates/engine/src/tests/layout_report_text.rs holds the tests for that logic. …
Description check Passed The description follows the template's Summary, Testing, UI evidence, and Related issue sections. Summary explains that report exports (PDF and PNG) omit cut-off text notices for layouts they draw, an…
Full details: Title check

Explanation

The title names the main change: report exports (PDF and PNG) now say which texts are cut off on the layout pages they draw. It matches the summary, the objectives, and the description, and it follows the fix(report) convention. It is specific enough for a teammate scanning history.

Full details: Linked Issues check

Explanation

Issue #3195 requires that a report export name the cut-off texts of each layout that the report draws as a page, as a layout export does. The PR description and the change summary for crates/engine/src/cmd/report.rs state that PDF and PNG report exports collect clipped text per layout page, using the page number and page count each page is drawn with and the report's DPI. They also state that notices are emitted per layout, prefixed with the report name, and that they call the same clipped_text and clipped_text_notice functions as layout export. The summary for crates/engine/src/tests/layout_report_text.rs lists tests for a multi-page layout, a PNG first page, fitting text, and page-dependent clipping. The author reports that tests expecting notices failed before the change. Limit: the direct text diff for report.rs could not be read (changed blobs missing from checkout), and the head file read was truncated before the new code. The PASS rests on the PR description and change summary, not on a line-by-line read of the new code.

Full details: Out of Scope Changes check

Explanation

All changed files relate to the objective of #3195. crates/engine/src/cmd/report.rs holds the report export notice logic. crates/engine/src/tests/layout_report_text.rs holds the tests for that logic. crates/engine/src/tests.rs registers the new test module. docs/user-guide/layouts.md documents the new notice in the Text clipping section. The PR description states that rustgis-render is unchanged and that no session or project state is added. No unrelated change is identified in the summaries. The same limit applies: the direct diff of report.rs could not be read, so the check relies on the change summaries.

Full details: Description check

Explanation

The description follows the template's Summary, Testing, UI evidence, and Related issue sections. Summary explains that report exports (PDF and PNG) omit cut-off text notices for layouts they draw, and that the change adds one notice per layout with the same counts, ids, and advice as layout export. Testing lists the new test module with specific cases, notes the failing-before/passing-after status, and reports the full local check suite passing. UI evidence includes a before/after screenshot of the Messages pane and states the exported PDF is byte-identical. Related issue links #3195 with 'Closes'. The template's UI section requires before and after screenshots for visible UI changes, and this one provides them. Minor gap: the template does not require the description to restate the PNG-specific behaviour, so no further remediation is needed.

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 each page in flight
For text that slips beyond its height
The report now names the layout clear
And marks the clipped lines for all to hear
Then hops away, its pages right

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: 6d7d4f12-f00e-4ab0-81c0-2a0ed0722885
Commits

Reviewing files that changed from the base of the PR and between 9fbbdd4 and 49adfdb.

Files selected for processing: 4

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

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-3215/
Web app https://preview.rustgis.app/pr-3215/app/
Commit 49adfdb

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

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 report that draws a layout page says nothing of the text cut off on it

1 participant