Fix splitNamedAntiphon silently upgrading draft text to verified
Deploy / deploy (push) Successful in 53s
Deploy / deploy (push) Successful in 53s
Every antiphon that goes through the incipit/full split -- which is every antiphon across every hour -- lost its real status the moment it passed through here: splitNamedAntiphon hardcoded `verified` on its output via verifiedText(), regardless of what the source's actual status was. Concretely, this meant St. Scholastica's antiphon (I translated it myself, no English existed in the source), Matthias's and several other apostles' reworded English, and Gregory the Great's translated antiphon all silently rendered as if fully verified -- losing the "unverified draft text" UI marker (src/ui/styles.css's .text-draft, a dashed underline + tooltip) that's supposed to distinguish "copied straight from the source" from "Claude's own rendering." Fixed by having splitNamedAntiphon accept a real ResolvedText and carry its per-language status through unchanged to both outputs, instead of silently upgrading everything to verified. Callers whose antiphon never had a status field to begin with (plain weekday-default antiphons and Lauds psalmody overrides -- neither type tracks status at all, always implicitly verified by the source file's own live-checked convention) now wrap with verifiedText() explicitly at the call site, rather than that assumption being buried inside splitNamedAntiphon itself. resolveMinorHourAntiphon (Prime/Terce/Sext/None's override lookup) now returns a full ResolvedText for the same reason. Verified end-to-end with St. Scholastica's real draft-English antiphon, both via a direct unit test and visually in the browser (the dashed underline now shows correctly under her Benedictus antiphon). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+5
-4
@@ -16,6 +16,7 @@ import {
|
||||
splitNamedAntiphon,
|
||||
resolveOfficeWinner,
|
||||
ALWAYS_OVERRIDE_TEMPORAL_IDS,
|
||||
verifiedText,
|
||||
} from './resolve-common';
|
||||
import laudsDefinitionData from '../data/hours/lauds.yml';
|
||||
import laudsAntiphonsData from '../data/hours/lauds-antiphons.yml';
|
||||
@@ -88,7 +89,7 @@ function psalmParts(numbers: number[], antiphon: BilingualText, opening: Resolve
|
||||
antiphon: i === 0 ? opening : undefined,
|
||||
verses: getPsalmVerses(number).map((v) => ({ n: v.n, text: v.text, status: v.status })),
|
||||
}));
|
||||
parts.push({ kind: 'antiphon', text: splitNamedAntiphon(antiphon).full });
|
||||
parts.push({ kind: 'antiphon', text: splitNamedAntiphon(verifiedText(antiphon)).full });
|
||||
return parts;
|
||||
}
|
||||
|
||||
@@ -136,7 +137,7 @@ function canticleText(canticleId: string, slice?: [number, number]): ResolvedTex
|
||||
function resolvePsalmody(day: LiturgicalDay): ResolvedPart[] {
|
||||
const wd = getPsalmodyOverrideFor(day) ?? laudsAntiphons[day.weekday];
|
||||
const opening = (antiphon: BilingualText) => {
|
||||
const { incipit, full } = splitNamedAntiphon(antiphon);
|
||||
const { incipit, full } = splitNamedAntiphon(verifiedText(antiphon));
|
||||
return isDoubleOrHigher(resolveOfficeWinner(day)) ? full : incipit;
|
||||
};
|
||||
const parts: ResolvedPart[] = [
|
||||
@@ -151,7 +152,7 @@ function resolvePsalmody(day: LiturgicalDay): ResolvedPart[] {
|
||||
}
|
||||
const canticle = getCanticle(wd.canticle.id);
|
||||
const canticleOpening = opening(wd.canticle.antiphon);
|
||||
const canticleClosing = splitNamedAntiphon(wd.canticle.antiphon).full;
|
||||
const canticleClosing = splitNamedAntiphon(verifiedText(wd.canticle.antiphon)).full;
|
||||
if (wd.canticle.split) {
|
||||
// Said in two pieces, own Gloria Patri each, one shared antiphon
|
||||
// framing both (opening before the first, full repeated only after
|
||||
@@ -232,7 +233,7 @@ function resolvePart(part: HourPart, day: LiturgicalDay): ResolvedPart[] {
|
||||
case 'lauds-office':
|
||||
return resolveOffice(day);
|
||||
case 'benedictus': {
|
||||
const { incipit, full } = splitNamedAntiphon(getBenedictusAntiphon(day).text);
|
||||
const { incipit, full } = splitNamedAntiphon(getBenedictusAntiphon(day));
|
||||
const opening = isDoubleOrHigher(resolveOfficeWinner(day)) ? full : incipit;
|
||||
return [
|
||||
{ kind: 'canticle', canticleId: 'benedictus', text: resolveCommon('benedictus'), antiphon: opening },
|
||||
|
||||
Reference in New Issue
Block a user