fix: add bounds checking and content splitting for multi-page songs (Closes #17) #20

Merged
shahondin1624 merged 1 commits from feature/issue-17-fix-page-overflow-bounds-checking-content-splitting into main 2026-03-17 14:18:07 +01:00

Summary

  • Add computeSplitIndex() to determine which sections render on page 0 vs page 1, splitting at section boundaries when content exceeds available space
  • Add calculateFooterReservation() to reserve bottom-of-page space for notes, bottom metadata, and reference footers on the last page
  • Add bounds checking (yMin) throughout renderSongPage() to prevent any content from rendering below the bottom margin
  • Move notes, bottom-position metadata, and reference footer to render on the last page (page 1 for 2-page songs) instead of always page 0
  • Add 7 new tests covering content splitting, overflow protection, and footer placement on multi-page songs

Test plan

  • All existing renderer-pdf tests pass
  • All app integration tests pass
  • New tests verify 2-page song content splitting works correctly
  • New tests verify footer elements render on the correct (last) page
## Summary - Add `computeSplitIndex()` to determine which sections render on page 0 vs page 1, splitting at section boundaries when content exceeds available space - Add `calculateFooterReservation()` to reserve bottom-of-page space for notes, bottom metadata, and reference footers on the last page - Add bounds checking (`yMin`) throughout `renderSongPage()` to prevent any content from rendering below the bottom margin - Move notes, bottom-position metadata, and reference footer to render on the **last** page (page 1 for 2-page songs) instead of always page 0 - Add 7 new tests covering content splitting, overflow protection, and footer placement on multi-page songs ## Test plan - [x] All existing renderer-pdf tests pass - [x] All app integration tests pass - [x] New tests verify 2-page song content splitting works correctly - [x] New tests verify footer elements render on the correct (last) page
shahondin1624 added 1 commit 2026-03-17 14:18:01 +01:00
The PDF renderer now tracks y-position against the bottom margin and
splits song sections across pages when content exceeds available space.
Footer elements (notes, bottom metadata, reference footer) render on the
last page with proper space reservation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
shahondin1624 merged commit a69d14033d into main 2026-03-17 14:18:07 +01:00
shahondin1624 deleted branch feature/issue-17-fix-page-overflow-bounds-checking-content-splitting 2026-03-17 14:18:07 +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#20