fix: position reference footer below content to prevent overlap (Closes #25) #28

Merged
shahondin1624 merged 1 commits from feature/issue-25-fix-reference-rendering into main 2026-03-17 14:59:49 +01:00

Summary

  • Fixed reference footer rendering to use flow-based positioning (from current y-position after notes/metadata) instead of absolute positioning anchored to bottomMargin, preventing overlap between notes text and reference footer
  • Updated calculateFooterReservation in PdfBookRenderer and height calculation in MeasurementEngine to match the simplified layout
  • Added toc.highlight_column: "Seite" to example songbook.yaml to demonstrate column highlighting in the TOC

Details

The root cause was that renderReferenceFooter positioned itself at a fixed offset from bottomMargin, while notes text flowed downward from the current y-position. When both were present (e.g., "Die Gedanken sind frei" with its note and MO/PfLB references), the note text would extend into the fixed reference footer region, causing visual overlap.

The fix renders the reference footer in sequence after notes/metadata content, with a separator line, abbreviation row, and page number row flowing naturally from the current position.

Test plan

  • All existing tests pass (./gradlew test)
  • TOC correctly displays MO and PfLB reference columns with page numbers
  • highlight_column: "Seite" correctly highlights the Seite column in the TOC
  • Song pages with references show footer with separator line, abbreviations, and page numbers
  • Songs without references (e.g., "Auf, auf") do not show an empty footer
  • Multi-page songs show reference footer on last page only (pages 7, 11)
  • Notes and reference footer no longer overlap (verified on "Die Gedanken sind frei", page 7)
  • "Kein schoner Land" (page 11) shows both note and reference footer correctly

Closes #25

## Summary - Fixed reference footer rendering to use flow-based positioning (from current y-position after notes/metadata) instead of absolute positioning anchored to `bottomMargin`, preventing overlap between notes text and reference footer - Updated `calculateFooterReservation` in `PdfBookRenderer` and height calculation in `MeasurementEngine` to match the simplified layout - Added `toc.highlight_column: "Seite"` to example `songbook.yaml` to demonstrate column highlighting in the TOC ## Details The root cause was that `renderReferenceFooter` positioned itself at a fixed offset from `bottomMargin`, while notes text flowed downward from the current y-position. When both were present (e.g., "Die Gedanken sind frei" with its note and MO/PfLB references), the note text would extend into the fixed reference footer region, causing visual overlap. The fix renders the reference footer in sequence after notes/metadata content, with a separator line, abbreviation row, and page number row flowing naturally from the current position. ## Test plan - [x] All existing tests pass (`./gradlew test`) - [x] TOC correctly displays MO and PfLB reference columns with page numbers - [x] `highlight_column: "Seite"` correctly highlights the Seite column in the TOC - [x] Song pages with references show footer with separator line, abbreviations, and page numbers - [x] Songs without references (e.g., "Auf, auf") do not show an empty footer - [x] Multi-page songs show reference footer on last page only (pages 7, 11) - [x] Notes and reference footer no longer overlap (verified on "Die Gedanken sind frei", page 7) - [x] "Kein schoner Land" (page 11) shows both note and reference footer correctly Closes #25
shahondin1624 added 1 commit 2026-03-17 14:59:41 +01:00
The reference footer was anchored to a fixed position near the bottom
margin, causing it to overlap with notes text on songs that had both
notes and references (e.g., "Die Gedanken sind frei").

Changed renderReferenceFooter to use flow-based positioning from the
current y-position after notes/metadata, ensuring the separator line,
abbreviation headers, and page numbers always render below the
preceding content without overlap.

Also updated calculateFooterReservation and MeasurementEngine to match
the simplified layout calculation, and added toc.highlight_column to
the example songbook.yaml to demonstrate column highlighting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
shahondin1624 merged commit 032387c02d into main 2026-03-17 14:59:49 +01:00
shahondin1624 deleted branch feature/issue-25-fix-reference-rendering 2026-03-17 14:59:49 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shahondin1624/songbook#28