Repository navigation
fix(pdf): long notes, tokens, rows and tax names break instead of overlapping - #119
Merged
Merged
Conversation
Review findings, each reproduced in a rendered PDF first: - A token wider than the description column, such as a URL, overran the quantity and price columns. Tokens longer than 20 characters may now break anywhere; words still wrap whole. - A row taller than a sheet was clipped, because every row was unbreakable. A row with a description over 600 characters may now continue on the next sheet. - Long notes broke the layout: the rigid closing block could not split, so totals overlapped the lines and notes ran over the CAE and off the page. Notes now sit after the receiver and before the lines, as Stripe's memo, and break across sheets freely. The closing block keeps only the totals, legends and fiscal footer, a bounded height, so they still move together and the CAE is never alone. minPresenceAhead was tried and does not hold the footer, which sits on an auto margin. Tests cover each case and fail without their fix. One test sweeps the line count across the sheet edge and checks the totals stay with the CAE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWf3KVPSbVbfiQgseVoyNW
…e amount "Percepción de Ingresos Brutos Provincia de Buenos Aires" is about 250 pt at 9 pt, wider than the 240 pt totals column, so it ran into "$ 3,00". The label now takes the room left of the amount and wraps; the amount keeps its width. A test checks that the name breaks before the amount's column, and it fails without the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWf3KVPSbVbfiQgseVoyNW
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
TomiMalamud
commented
Oct 9, 2026
TomiMalamud
left a comment
Collaborator
Author
There was a problem hiding this comment.
One reproduced PDF pagination regression; details inline.
…th the CAE Wrapping long tax names made the closing block's height unbounded: with 15 wrapped tax rows it outgrew the sheet, and react-pdf squeezed its lines to about 3.3 pt apart, overlapping the labels and the total. A usual breakdown still stays in one block with the total and the CAE. When its estimated height passes 250 pt, its rows flow and may continue on the next sheet, and only "Importe total" stays in the block with the legends and the fiscal footer. The estimate is conservative, 28 characters per label line. Two layouts keep the aside beside the breakdown in the usual case. A test renders 15 long tax rows, checks every sheet keeps its line spacing, all rows print and the total sits with the CAE. It fails without the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWf3KVPSbVbfiQgseVoyNW
TomiMalamud
commented
Oct 9, 2026
TomiMalamud
left a comment
Collaborator
Author
There was a problem hiding this comment.
Encontré una regresión de paginación en 32fb004: el aside de pagos y saldo se separa del importe total cuando el desglose de impuestos se pagina. Reproducción y propuesta en el comentario inline.
With a long tax breakdown, the rows flow and the total moves to the CAE's block, but <VoucherAside> stayed with the rows. Payments and balance printed on sheet 1 while the total and the CAE sat on sheet 2. When the breakdown breaks, the aside now goes into the closing block, beside "Importe total", so it stays with the total and the CAE as the guide promises. A test renders 15 long tax rows with a two-line aside and checks both share the CAE's sheet, side by side. It fails on 32fb004. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWf3KVPSbVbfiQgseVoyNW
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #117, from three review passes over
@facturas/pdf. I reproduced each finding in a rendered PDF before fixing it. Each has a test that fails without its fix.Fixes
minPresenceAheadand an absolutely positioned footer. Neither held the footer to the last content sheet.<VoucherAside>beside it.Visible change
<VoucherNotes>and thenotesoption now print before the lines instead of after the totals. The guide, the changeset and the doc comments say so.<VoucherAside>moves with the totals and the CAE, so the guide asks to keep it short.Tests
Validation
pnpm checkpnpm typecheckpnpm testpnpm typecheck:examplespnpm check:docspnpm --filter @facturas/pdf build🤖 Generated with Claude Code
https://claude.ai/code/session_01PWf3KVPSbVbfiQgseVoyNW