From 9d671751d91fd0ab64f758f1b0d3ddaffc1ddb7e Mon Sep 17 00:00:00 2001 From: Will Estes Date: Sat, 5 Sep 2026 14:08:03 -0400 Subject: [PATCH] Annotate Matins octave readings with their occasion too The octave-reading branch never called withOccasion/occasionName at all, so an active octave's own reading always showed a bare source even when pooled alongside other content on the same day -- the same missing-annotation gap just fixed for plain-Sunday and saint/temporal readings, in a fourth branch that predates that helper. octave-readings' source is bilingual ({la, en}), unlike nocturn-readings' plain string, so the occasion suffix is appended to both language slots directly rather than routed through withOccasion itself. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01T6rG4RTNqLFYcyjbCGkPFs --- src/hours/matins.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/hours/matins.ts b/src/hours/matins.ts index edeb489..71dc185 100644 --- a/src/hours/matins.ts +++ b/src/hours/matins.ts @@ -984,10 +984,22 @@ function buildReadingPool(day: LiturgicalDay, temporalId: string, date: string, for (const octave of activeOctavesFor(date)) { const reading = getOctaveReading(octave.id, octave.dayNumber); if (reading) { + // Unlike nocturn-readings' `source` (a plain, non-bilingual string — + // see `withOccasion`'s own doc comment), an octave reading's `source` + // is itself `{la, en}` (2026-08 fix). The occasion name is still a + // single plain string either way, so it's appended to both language + // slots rather than routed through `withOccasion`. + const occasion = occasionName(octave.id, day); + const label = occasion + ? { + la: reading.source.la ? `${reading.source.la} (for ${occasion})` : reading.source.la, + en: reading.source.en ? `${reading.source.en} (for ${occasion})` : reading.source.en, + } + : reading.source; parts.push({ kind: 'lesson', text: { text: reading.text, status: reading.status }, - label: reading.source, + label, responsory: reading.responsory ? { text: reading.responsory, status: { la: 'verified', en: 'verified' } } : undefined,