feat: add monthlyHistory[] per player via getMonthlyHistory + bulk fetch (#6)

Add getMonthlyHistory() to models/player for single-player use and
getAllMonthlyHistoriesFromDB() for bulk fetches (one query, grouped in
memory). Wire monthlyHistory into all player objects returned by
getPlayerDataFromDB and getAllRatingsFromDB. Bulk path pre-fetches in
one query to avoid N extra per-player queries.
This commit is contained in:
Samuel Enocsson
2026-05-21 13:41:20 +02:00
parent 19756b80e5
commit 3dcd3131a0
5 changed files with 161 additions and 42 deletions
+41
View File
@@ -551,3 +551,44 @@ a:hover {
padding: 8px 6px;
}
}
/* ── Delta Pills ──────────────────────────────── */
.delta-pill {
display: inline-flex;
align-items: center;
padding: 2px 8px;
border-radius: 999px;
font-family: var(--font-mono);
font-feature-settings: "tnum", "zero";
font-size: 11px;
font-weight: 500;
margin-top: 4px;
}
.delta-pill.up {
background: var(--up-soft);
color: var(--up);
}
.delta-pill.down {
background: var(--down-soft);
color: var(--down);
}
.delta-pill.flat {
background: oklch(0.95 0.004 260);
color: var(--ink-3);
}
/* ── Table Header Hints ───────────────────────── */
.th-hint {
display: block;
font-size: 9.5px;
font-weight: 400;
text-transform: none;
letter-spacing: 0;
color: var(--ink-3);
margin-top: 2px;
}