perf(faith): warm liturgical cache + fix 1962 rendering
CI / update (push) Successful in 3m59s

Pre-compute romcal year maps on server boot for current + next civil year
across en/de/la in each rite's default diocese, non-blocking so startup is
unaffected.

Also fixes several 1962-rite rendering bugs: commemorations previously
leaked 1969-shape ids (e.g. andrew_apostle) next to proper 1962 sancti;
station church names came through unresolved because RomcalConfig's
internal i18next has no bundle loaded; season names arrived as raw keys
(advent.season) for the same reason. All three now resolve locally via
the shipped 1962 bundle with Latin as fallback. ClassIV ferias get a
small dot on the grid.
This commit is contained in:
2026-04-21 08:04:16 +02:00
parent dd612f6535
commit 2b1a415ab6
9 changed files with 202 additions and 29 deletions
@@ -250,6 +250,17 @@
{/each}
</div>
{/if}
{#if hero.rite1962?.stationChurches?.length}
<div class="tc-stations">
<span class="tc-stations-label" aria-hidden="true"></span>
<span class="tc-stations-text">
<span class="tc-stations-title">{t1962('stationChurch', lang)}:</span>
{#each hero.rite1962.stationChurches as s, i (s.key + (s.mass ?? ''))}
{#if i > 0}<span class="tc-stations-sep"> · </span>{/if}<span class="tc-station-name">{s.name}</span>{#if s.mass}<span class="tc-station-mass"> ({s.mass.replace(/_/g, ' ')})</span>{/if}
{/each}
</span>
</div>
{/if}
<span class="tc-arrow" aria-hidden="true"></span>
</section>
</a>
@@ -660,6 +671,37 @@
border: 1px solid rgba(255, 255, 255, 0.22);
font-size: 0.82rem;
}
.tc-stations {
margin-top: 0.9rem;
display: flex;
align-items: baseline;
gap: 0.55rem;
font-size: 0.85rem;
line-height: 1.45;
}
.tc-stations-label {
font-size: 0.95rem;
opacity: 0.7;
flex-shrink: 0;
}
.tc-stations-title {
font-weight: 600;
letter-spacing: 0.03em;
text-transform: uppercase;
font-size: 0.72rem;
opacity: 0.85;
margin-right: 0.35rem;
}
.tc-station-name {
font-style: italic;
}
.tc-station-mass {
opacity: 0.75;
font-size: 0.78rem;
}
.tc-stations-sep {
opacity: 0.6;
}
.tc-arrow {
position: absolute;
bottom: 1.1rem;
@@ -154,6 +154,21 @@
</ul>
</div>
{/if}
{#if d.stationChurches?.length}
<div class="stations">
<h4>{t1962('stationChurch', lang)}</h4>
<ul>
{#each d.stationChurches as s (s.key + (s.mass ?? ''))}
<li>
<span class="station-name">{s.name}</span>
{#if s.mass}
<span class="station-mass">{s.mass.replace(/_/g, ' ')}</span>
{/if}
</li>
{/each}
</ul>
</div>
{/if}
{#if d.propers.length}
<section class="propers">
<h4>{t1962('propers', lang)}</h4>
@@ -351,6 +366,7 @@
color: var(--color-text-primary);
}
.commems h4,
.stations h4,
.propers h4 {
margin: 0.5rem 0 0.4rem;
font-size: 0.72rem;
@@ -359,10 +375,12 @@
color: var(--color-text-secondary);
font-weight: 600;
}
.commems {
.commems,
.stations {
margin-top: 0.75rem;
}
.commems ul {
.commems ul,
.stations ul {
list-style: none;
padding: 0;
margin: 0;
@@ -370,7 +388,8 @@
flex-direction: column;
gap: 0.35rem;
}
.commems li {
.commems li,
.stations li {
display: flex;
align-items: center;
gap: 0.5rem;
@@ -379,10 +398,19 @@
border-radius: var(--radius-sm, 6px);
font-size: 0.85rem;
}
.commem-name {
.commem-name,
.station-name {
flex: 1 1 auto;
color: var(--color-text-primary);
}
.station-name {
font-style: italic;
}
.station-mass {
color: var(--color-text-tertiary);
font-size: 0.78rem;
text-transform: capitalize;
}
.propers {
margin-top: 1rem;
@@ -68,5 +68,6 @@ export function rankDotSize(rank: string): number {
if (rank === 'ClassII' || rank === 'FEAST' || rank === 'SUNDAY' || rank === 'HOLY_DAY_OF_OBLIGATION')
return 4;
if (rank === 'ClassIII' || rank === 'MEMORIAL') return 3;
return 0; // don't render ferias/weekdays as dots
if (rank === 'ClassIV') return 2;
return 0; // 1969 weekdays/opt-memorials still skipped
}
@@ -287,7 +287,8 @@ export const ui1962 = {
vigilOf: { en: 'Vigil of', de: 'Vigil von', la: 'Vigilia' },
transferredFrom: { en: 'Transferred from', de: 'Übertragen von', la: 'Translatum ex' },
source: { en: 'Source', de: 'Quelle', la: 'Fons' },
propers: { en: 'Mass propers', de: 'Messproprium', la: 'Propria Missæ' }
propers: { en: 'Mass propers', de: 'Messproprium', la: 'Propria Missæ' },
stationChurch: { en: 'Station church', de: 'Stationskirche', la: 'Statio' }
} as const;
export function t1962(key: keyof typeof ui1962, lang: CalendarLang): string {