Fix header overlap in invoice PDF and Bongbetic wordmark on light theme

react-pdf wraps text once at the first flex measure; when yoga then shrank
the vendor column the cached lines ran under the INVOICE meta column. The
header now pins column widths (299 + 24 + 192 pt), sizes the logo from its
own aspect (stacked above the text when it would leave under 160 pt), uses
absolute per-Text line heights, and turns hyphenation off.

Also: repeating table header with an orphan-header guard, wrap=false rows,
Page n of N footer, GSTIN printed only when present, one Text per address
line, HTML twin header grid. The light-theme header showed the white-text
wordmark; the ternary was inverted.

Adds vitest + pdfjs-dist harness that fails on the old document (address
overlaps Invoice No.) and passes on the new one.
This commit is contained in:
2026-10-04 03:57:47 +05:30
parent 39e4fb5fb5
commit 7d63e38e62
12 changed files with 1269 additions and 126 deletions
+3 -1
View File
@@ -29,8 +29,10 @@ interface AppShellProps {
}
export function AppShell({ view, onNavigate, theme, onToggleTheme, children }: AppShellProps) {
// The Carbon header background follows the theme: light on g10, dark on g100.
// The "dark" wordmark has dark text for light surfaces; "light" has white text for dark ones.
const wordmark =
theme === "g100" ? "/brand/bongbetic-wordmark-light.png" : "/brand/bongbetic-wordmark-dark.png";
theme === "g100" ? "/brand/bongbetic-wordmark-dark.png" : "/brand/bongbetic-wordmark-light.png";
return (
<>