perf(faith/calendar): trim yearDays, send pre-filtered feastDots

yearDays was a 365-entry array (one per day in the LY window) with
{iso, name, rank, color, seasonKey} on each — the client only needed
the color (for the needle pin on the currently-selected day; RingView
re-did the feast filter itself). Split into:

- yearDays: {iso, color} — unchanged count, but ~60% smaller per entry
  (drops name, rank, seasonKey)
- feastDots: {iso, name, rank, color} — new, pre-filtered to
  rank > ferial server-side (~150 entries instead of 365)

RingView's `feastDots` derivation shrinks to filtering out just the
currently-selected day, and `activeFeasts` filters `feastDots` by arc
bounds instead of re-scanning yearDays. needleDay's color lookup still
works with the trimmed YearDay.

Also collapses a stray `locals.session ?? (locals.session ?? …)` the
earlier #5 sweep introduced in both calendar page loaders.
This commit is contained in:
2026-04-23 15:37:38 +02:00
parent 4112e38306
commit 076c6efb38
7 changed files with 48 additions and 35 deletions
+13 -4
View File
@@ -16,14 +16,23 @@ export interface CalendarDay {
rite1962?: Rite1962Detail;
}
// Compact per-day shape returned for the full year so the ring / month-grid
// overview views can render without refetching. Kept small on purpose.
// Compact per-day shape returned for the full window of the liturgical year.
// Kept to the bare minimum needed client-side: the ring needs a color for the
// needle on the selected day (which may be a ferial with no rank metadata),
// everything else goes through the separate `feastDots` array.
export interface YearDay {
iso: string;
color: string; // primary color key (WHITE/RED/...)
}
// Pre-filtered list of days that render a feast dot on the ring — rank > feria
// — with the metadata the ring and side panel need for each. Sent alongside
// YearDay so clients don't have to filter 365 entries themselves.
export interface FeastDot {
iso: string;
name: string;
rank: string;
color: string; // primary color key (WHITE/RED/...)
seasonKey: string | null;
color: string;
}
export interface SeasonArc {