fix(pdf): keep a note's second line in its card, fill the preview width

A day note's time field is the free line the day plan prints under its
text, not a clock: it printed in the narrow time column and broke into a
word per line. It stays in the card again, and the time column is empty.

The preview showed the A4 sheet at its print width inside the wider
dialog, with a pale band on either side; on screen the document now fills
the frame, as it did before. The stops column of the day overview is
centred under its pin.

Tests for the day's cards, the cover and overview, and the new preview
switches.
This commit is contained in:
Maurice
2026-11-22 21:43:34 +01:00
parent a5de1bc52d
commit 2a833c4ba9
5 changed files with 141 additions and 18 deletions
+7 -2
View File
@@ -226,11 +226,16 @@ export function bookingItem(r: PdfBooking, day: Day, ctx: PdfDayContext, flags:
*/
export function noteItem(note: DayNote): string {
const colour = note.color ? hexColour(note.color, '') : '';
// A note's `time` is the free line the day plan prints under its text, not a clock,
// so it stays in the card and the time column stays empty.
const subtitle = typeof note.time === 'string' ? note.time.trim() : '';
const card = `<div class="note-card${colour ? ' note-tinted' : ''}"${colour ? ` style="--note:${colour}"` : ''}>
<span class="note-icon">${noteIcon(note.icon)}</span>
<div class="note-body"><div class="note-text">${escHtml(note.text)}</div></div>
<div class="note-body"><div class="note-text">${escHtml(note.text)}</div>${
subtitle ? `<div class="note-time">${escHtml(subtitle)}</div>` : ''
}</div>
</div>`;
return item('note', timeColumn(note.time || '', ''), '', card);
return item('note', timeColumn('', ''), '', card);
}
// ── Places ────────────────────────────────────────────────────────────────