From 73b48c1b0835fd365929e40a28590619933a2947 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2026 20:30:59 +0000 Subject: [PATCH] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/lib/invoice-pdf.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/invoice-pdf.ts b/src/lib/invoice-pdf.ts index 8e8d4d7..14f65f5 100644 --- a/src/lib/invoice-pdf.ts +++ b/src/lib/invoice-pdf.ts @@ -400,7 +400,12 @@ export async function downloadInvoicePdf(input: InvoicePdfInput, filename: strin const drawItem = (item: InvoiceLineItem) => { const isNonBillable = item.billable === false; - const descMaxW = colQtyR - colDescX - 14; + // Reserve generous padding before the QTY column so wrapped text never + // collides with the right-aligned numeric columns. Measure with the same + // font (incl. italic for non-billable rows) that will render the text, + // since italic glyphs are slightly wider than upright ones. + const descMaxW = colQtyR - colDescX - 24; + setFont(pdf, { size: 9, color: isNonBillable ? MUTED : TEXT, italic: isNonBillable }); const descLines = wrap(pdf, item.description || (item.kind === "expense" ? "Expense" : ""), descMaxW); const lineHeight = 12; const blockH = Math.max(lineHeight * descLines.length + 14, item.user_initials ? 32 : 26);