Fix ordinary-Sunday precedence and unify getDayLabel's commemoration rendering

Two related fixes surfaced while chasing why St. Gregory Thaumaturgus
appeared to be misdated on Nov 18:

- calendar/commemorations.ts's `ordinary-sunday` case was transferring a
  Semiduplex (or lower) saint off the Sunday instead of commemorating it
  in place — an earlier, unverified guess. Live-verified against both
  Tridentine 1906 and Divino Afflatu 1954 (St. Gregory Thaumaturgus, St.
  Clement, St. Apollinaris, St. Thomas Becket, all real cases): the saint
  stays and is commemorated on the Sunday itself, same as Simplex, never
  pushed to the next open day. This is what was actually moving Gregory
  onto Nov 18 — not a data error. `applyChristmasOctaveSunday`'s own
  Dec 26-29 special case needed a matching adjustment (per its own
  documented intent, the displaced saint there is deliberately *not*
  commemorated in place, since he reappears in full on Dec 30 instead).

- getDayLabel had five branches, each hand-assembling its own
  filter/format logic for which commemorations to show — which is why
  the octave phrasing, the closing-day title, and a missing Sunday
  commemoration turned into three separate bugs earlier instead of one.
  Replaced with a single shared `collectCommemorations` used by every
  branch. This also exposed that the sanctoral-winner branch never
  showed any commemorated saint at all, and every other branch only
  showed the *first* one (`.find()`), silently dropping real collisions
  — both now show every commemorated saint, matching this app's own
  generous-commemoration design.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-18 10:59:50 -04:00
parent 3f07d6e8d3
commit f43f030a6a
9 changed files with 281 additions and 123 deletions
+14 -6
View File
@@ -159,14 +159,22 @@ export function decideOccurrence(
// Duplex+ wins outright; the Sunday itself is commemorated in return.
return { winner: sanctoralWinner(sanctoral), commemorations: [{ kind: 'temporal', id: temporalId }] };
}
if (sanctoral.rank === 'simplex') {
// Too minor to warrant its own day, but a plain commemoration
// doesn't cheapen it the way it would a Semiduplex.
if (sanctoral.rank !== 'vigil') {
// Semiduplex or Simplex: commemorated, not transferred — live-
// verified (both Tridentine 1906 and Divino Afflatu 1954, the two
// calendar tracks this app blends): St. Gregory Thaumaturgus
// (Semiduplex) lands on the 6th Sunday after Epiphany, 2024-11-17,
// and is commemorated right there ("Commemoratio: S. Gregorii
// Thaumaturgi..."), not pushed to the next open day. Corrects an
// earlier, unverified guess that Semiduplex was "too important to
// merely commemorate" — Monastic Tridentinum 1617's own structural
// rubric *does* transfer him, but precedence here follows Divino
// Afflatu, not Monastic 1617's own (see CLAUDE.md).
return { winner: temporalWinner, commemorations: [sanctoralCommemoration(sanctoral)] };
}
// Semiduplex or Vigil: no room here at all, in either direction
// better to preserve the feast whole on another day than downgrade
// it to a bare commemoration.
// A Vigil still transfers (backward, per transferDirectionOf) — a
// distinct rule from Semiduplex/Simplex above, not verified against
// this same live case and left as-is.
return {
winner: temporalWinner,
commemorations: [],