Records — unify XLSX letterhead across every export (Bank-Tx style)
Why (owner, 2026-06-25)¶
"3) I need you to reference the header (with company logo and company information) from the Bank tx xlsx export, and apply it to all xlsx export on the Records page 5) Put the Bank tx xlsx header to all the WPP xlsx as well"
(Part 5 is shipped under T-125 — the WPP-side change ships together with the CSV→XLSX conversion.)
The Bank Transaction Register already used a shared letterhead helper
(lib/export/xlsxLetterhead.ts) that stamps the logo + subsidiary
identity + report title across rows 1–8 of every export. The Records
page was emitting a separate compact letterhead (logo + tiny
EB-Garamond branding pair + 16pt title in rows 1–4) that didn't
visually match. Every owner-facing register should read as one
document family.
What shipped¶
components/records/recordsXlsx.ts¶
buildRecordsXlsxnow importsaddXlsxLetterhead+LetterheadSubsidiaryand delegates the entire letterhead band to the shared helper. The inline letterhead code (constants, branding cell rich-text, logo placement) is gone.- Signature gains an optional 5th param:
subsidiary?: LetterheadSubsidiary | null. TheaddXlsxLetterheadhelper accepts the same shape, so the call is a direct pass-through. dataStartRowis now derived fromaddXlsxLetterhead's return value (headerRowIdx + 1) instead of the previous hard-coded6, so the data-row alignment loop tracks the letterhead's true height (rows 1–8 + header at row 9 + data at row 10, in the typical 5-line identity case).- Body cell styling (grey-bar header, thin grid, fonts) is unchanged — the in-table look stays identical so the change is invisible below the letterhead band.
components/records/RecordsApp.tsx¶
handleExportCsv(the popover-driven exporter) fetchesfetchSubsidiaryInfo('erl')once at the top and reuses the resolvedletterheadSubacross all 5buildRecordsXlsxcall sites (WOPCs, Project Invoices, Coaching Invoices, Receipts, Service Invoices). Failures fall back tonull— the letterhead degrades to logo + title only and the data table still ships.- All 5
buildRecordsXlsx(...)calls now passletterheadSubas the 5th argument.
Why this and not "duplicate the helper"¶
The Bank Tx exporter and the Records exporters now share a single letterhead source. When the next change comes (Owner wants the letterhead to carry the BR number next to the address, or the title font to drop a point — something live customers see), one edit lands across every export instead of three drifting copies.
The previous inline letterhead lived in recordsXlsx.ts only;
deleting it removes a parallel "Records-only" identity-rendering
codepath that was already drifting (different EN font, different
title size, different row heights). The shared helper is the
forward-looking surface.
Decision log¶
2026-06-25 — T-124 opened + shipped¶
- ✅ Attestation (Records (Infrastructure)): read
AGENTS.md; no open task covered this. The Bank Tx exporter's letterhead helper (lib/export/xlsxLetterhead.ts) shipped earlier and was already factored as a reusable surface — this change is its second consumer. - Source: Records (Infrastructure) · https://claude.ai/code/session_018RDB37kCqfouHdygVXTAtD
- Owner direction (verbatim, 2026-06-25): quoted above.
- Tests + tsc:
npx tsc --noEmitclean. Live verification left to the owner — Records page → each tab's Export XLSX → confirm the exported workbook's rows 1–8 carry the Bank-Tx-style letterhead (logo + subsidiary identity + report title), and rows 9+ render the same data the previous export emitted. - Blast radius:
buildRecordsXlsx's signature gained one optional parameter — callers that omit it land in thenullbranch (letterhead without a subsidiary). 5 call sites updated; no external API surface impacted.
Commit index (backfilled 2026-07-01, best-effort · Coaching (Diagnostic))¶
Candidate related commits, auto-backfilled from git on main: commits whose message references this task's UID or a PR number it cites. Not verified — this squash-merged history can't yield a precise per-task list, so rows tagged (mentions only) name the task in passing (may be tangential) and untagged work commits may be missing. Treat as a starting point: verify, prune tangential rows, and append any real ones per the AGENTS.md "record every related SHA" policy.
bc1af242026-06-25 — fix(records): service-invoice ZIP UX (T-122) + share viewer WOPC/coaching (T-123) (mentions only)99f9c362026-06-25 — feat(records,wpp): unified Bank-Tx letterhead (T-124) + WPP CSV → XLSX (T-125)a98745b2026-06-25 — Merge main + renumber T-122 → T-126 (renumber-on-merge, parallel-agent T-122/123/124/125 collision) (mentions only)64b1a842026-06-30 — feat(T-136): WPP — accounting number format, single tabbed workbook, journals.csv (mentions only)2756fe62026-07-01 — docs(tasks): close T-046 -> done — Bank Register XLSX overhaul delivered + live (mentions only)