Skip to content

Report wizard preview: cover-letter date caption uses the UI language beside a report-language date #1925

Description

@steilerDev

[product-owner]

Priority: Could Have
Parent Epic: none — part of the parent-less Bank Report Wizard cluster (#1876#1879, #1898#1901, #1923).
Found during: PR #1924 round-2 verification (t-usage audit). Pre-existing on betanot a regression from #1923/#1924.

Problem

The report wizard's editable preview renders the cover-letter date line as a UI-language label next to a report-language value, producing a single visually-joined line that mixes two languages. The same line has no counterpart in the exported PDF at all, so the preview also implies a label the artifact does not contain.

This is the same defect class that PR #1924 fixed for the inline Deposit badge, found while auditing the remaining t() call sites in the same component.

Actual

client/src/components/reports/ReportContentEditor.tsx L79–83:

<div className={styles.dateLineField}>
  <span className={styles.dateLineLabel}>
    {t('sourceReports.coverLetter.dateLabel')}:
  </span>
  <span className={styles.dateLineValue}>{content.coverLetter.dateLine}</span>
</div>
  • The label comes from the component's UI tReportWizardPage.tsx L905 passes the useTranslation('budget') instance (L61), i.e. the interface locale.
  • The value content.coverLetter.dateLine is built in buildReportContent.ts L255 via reportFormatters.formatDate(...), i.e. the report locale.

With UI language de and report language en, the preview renders:

Datum: February 15, 2026

Meanwhile client/src/lib/reportPdf/coverLetterPdf.ts L37 emits { text: coverLetter.dateLine } with no label whatsoever — the date stands alone (the conventional business-letter treatment in both en and de). So the exported PDF is correct and unaffected; only the preview is wrong.

Expected

No single rendered line in the preview mixes interface language and report language, and the preview does not present as artifact content anything the exported PDF does not contain.

Reproduction

  1. Set the application interface language to German.
  2. Go to /budget/reports and start the report wizard.
  3. Step 4 (Settings): set report language to English, leave "include cover letter" on.
  4. Step 5 (Preview & Export): read the date line above the reference/subject fields → Datum: February 15, 2026.
  5. Export the PDF → the cover letter shows the bare date with no Date:/Datum: prefix.

(Reverse the two languages for the mirror-image case: Date: 15. Februar 2026.)

Product decision

The exported PDF is the artifact of record, and it deliberately carries no date label. Therefore the preview's Date: text is editor chrome, not artifact content — it exists only to tell the user what that value is. The fix should treat it as such rather than promoting it into the content model.

Recommended resolution: keep the label in the UI language (correct for chrome, consistent with the #1909 ruling on edit affordances) but present it with the same visual treatment as the other editor field captions, so it reads unambiguously as an editor caption rather than as part of the letter body. The exact styling is ux-designer's call.

Rejected alternative: moving dateLabel into ReportContentLabels via reportT and adding a matching label to the PDF. This would fix the language mismatch but changes the exported letter's layout for no user benefit, and departs from standard letter convention in both locales. Do not do this without an explicit product decision to redesign the letter head.

Acceptance Criteria

  • 1 Given interface language de and report language en (and the mirror case), When the Step 5 preview renders the cover letter, Then the date line contains no string that mixes the two languages — the caption and the value are either both interface-language or both report-language, per the chosen resolution.
  • 2 Given any interface/report language combination, When the cover letter preview renders, Then the date caption is visually distinguishable as editor chrome, consistent with how the other non-editable captions in the same panel are presented.
  • 3 The exported PDF cover letter is unchanged — the date still renders as a bare, report-language-formatted date with no caption or prefix (coverLetterPdf.ts L37).
  • 4 content.coverLetter.dateLine remains report-language-formatted via reportFormatters.formatDate — the value side of this defect is already correct and must not regress.
  • 5 A unit test in ReportContentEditor.test.tsx pins the date-line rendering, and the PDF's label-free date line is pinned in coverLetterPdf.test.ts, so neither side can drift back.
  • 6 Locale parity holds: sourceReports.coverLetter.dateLabel is present in en and de (or removed from both, if the chosen resolution drops it).

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions