Add R./V./repeat labels to per-book responsory pool output
Deploy / deploy (push) Successful in 1m54s

getResponsoryForBook's joinResponsory concatenated the r/v text with a
bare newline and no "R."/"V." labels at all, unlike every other
responsory source in the app (octave-readings' own responsory field,
nocturn-readings' inline responsory, and the new per-Common-category
pool) which all include the full "R. ...\n* ...\nV. ...\nR. ..."
convention. User caught this looking at the rendered Judith entry.

Fixed by computing the repeat line from the existing "*" marker
already present in the pool's r text. npm test (2025 passed) and
tsc --noEmit pass.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AGjUyhUZJaSjiniEmnLdak
This commit is contained in:
2026-09-04 18:44:38 -04:00
parent ff87aff240
commit 1867f73080
+21 -2
View File
@@ -42,9 +42,28 @@ for (const mod of Object.values(modules)) {
} }
} }
/** Builds the full "R. ...\n* ...\nV. ...\nR. ..." block — same R./V./repeat
* convention as octave-readings.ts's own `responsory` field and every
* nocturn-readings/*.yml file's inline `responsory` — from the pool's
* plain `{r, v}` text (no "R."/"V." labels, `r` already carries a `*`
* marking where the repeat begins, per the extraction convention
* documented in the data file's own header). Previously joined these with
* a bare newline and no R./V. labels at all — a real, visible
* inconsistency (caught 2026-09-04): every other responsory source in
* this app labels its lines. */
function joinOne(r: string | undefined, v: string | undefined): string | undefined {
if (!r) return undefined;
const starIndex = r.indexOf('*');
const repeat = starIndex >= 0 ? r.slice(starIndex + 1).trim() : r;
const lines = [`R. ${r}`];
if (v) lines.push(`V. ${v}`);
lines.push(`R. ${repeat}`);
return lines.join('\n');
}
function joinResponsory(record: ResponsoryRecord): MatinsResponsory { function joinResponsory(record: ResponsoryRecord): MatinsResponsory {
const la = record.r.la && record.v.la ? `${record.r.la}\n${record.v.la}` : record.r.la; const la = joinOne(record.r.la, record.v.la);
const en = record.r.en && record.v.en ? `${record.r.en}\n${record.v.en}` : record.r.en; const en = joinOne(record.r.en, record.v.en);
return { return {
text: { la, en }, text: { la, en },
status: { la: la ? 'verified' : 'missing', en: en ? 'verified' : 'missing' }, status: { la: la ? 'verified' : 'missing', en: en ? 'verified' : 'missing' },