feat(admissions): surface multi-year admissions trend on school detail
Build and Push Docker Images / Build Backend (FastAPI) (pull_request) Successful in 22s
Build and Push Docker Images / Build Frontend (Next.js) (pull_request) Successful in 53s
Build and Push Docker Images / Build Pipeline (Meltano + dbt + Airflow) (pull_request) Successful in 11s
Build and Push Docker Images / Trigger Portainer Update (pull_request) Has been skipped

The school detail page only showed the latest admissions year. We store
every year, which is more decision-relevant for parents (the trend and its
consistency matter more than a single noisy year).

Backend now returns the full admissions_history (oldest first) alongside the
existing latest-year object. The primary SchoolDetailView gains a header
toggle ("This year | N-year trend") that swaps the Q&A for an SVG sparkline
of the first-choice offer rate. The toggle only appears when >=2 years carry
an offer rate; otherwise it falls back to the single-year card. Both views
share one CSS-grid cell so switching causes no layout shift.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tudor
2026-06-19 18:41:03 +01:00
co-authored by Claude Opus 4.8
parent e7c26a83db
commit 4de7e559e9
7 changed files with 611 additions and 57 deletions
@@ -1295,6 +1295,148 @@
}
}
/* ── Admissions: header + view toggle ── */
.admissionsHeader {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
flex-wrap: wrap;
margin-bottom: 1.25rem;
}
.admissionsHeader .sectionTitle {
margin-bottom: 0;
}
.admissionsSeg {
display: inline-flex;
background: var(--bg-secondary, #f3ede4);
border-radius: 999px;
padding: 3px;
gap: 2px;
flex: none;
}
.admissionsSeg button {
appearance: none;
border: none;
background: none;
cursor: pointer;
font: inherit;
font-size: 0.8125rem;
font-weight: 600;
color: var(--text-muted, #6d685f);
padding: 0.4rem 0.9rem;
border-radius: 999px;
white-space: nowrap;
transition: background 0.15s ease, color 0.15s ease;
}
.admissionsSeg button[aria-pressed="true"] {
background: var(--bg-card, #fff);
color: var(--text-primary, #1a1612);
box-shadow: var(--shadow-soft, 0 2px 8px rgba(26, 22, 18, 0.06));
}
.admissionsSeg button:hover[aria-pressed="false"] {
color: var(--text-secondary, #5c564d);
}
/* Stack both views in one grid cell so the card sizes to the taller view —
toggling modes never shifts layout. */
.admissionsViewport {
display: grid;
}
.admissionsViewYear,
.admissionsViewTrend {
grid-area: 1 / 1;
}
.admissionsViewYear[hidden],
.admissionsViewTrend[hidden] {
display: block;
visibility: hidden;
pointer-events: none;
}
/* The this-year rows spread to fill the height reserved by the taller view. */
.admissionsViewYear {
display: flex;
flex-direction: column;
}
.admissionsViewYear .admissionsQa {
flex: 1;
justify-content: space-between;
}
.admissionsChartCap {
font-size: 0.8125rem;
font-weight: 600;
letter-spacing: 0.04em;
text-transform: uppercase;
color: var(--text-muted, #6d685f);
margin-bottom: 0.5rem;
}
.admissionsChart {
width: 100%;
height: auto;
display: block;
}
.admissionsGrid {
stroke: var(--border-color, #e5dfd5);
stroke-width: 1;
}
.admissionsAxis {
font-size: 12.5px;
fill: var(--text-muted, #6d685f);
font-family: var(--font-dm-sans), "DM Sans", sans-serif;
}
.admissionsLine {
stroke: var(--accent-coral, #e07256);
stroke-width: 3;
}
.admissionsDot {
fill: var(--accent-coral, #e07256);
}
.admissionsDotLast {
fill: var(--accent-coral, #e07256);
stroke: var(--bg-card, #fff);
stroke-width: 2;
}
.admissionsPtLabel {
font-size: 13px;
font-weight: 700;
fill: var(--text-primary, #1a1612);
font-family: var(--font-dm-sans), "DM Sans", sans-serif;
}
.admissionsPtLabel[data-last="true"] {
fill: var(--accent-coral-dark, #c45a3f);
}
.admissionsTrendSummary {
font-size: 1rem;
color: var(--text-secondary, #5c564d);
margin: 1.25rem 0 0;
padding-top: 1.1rem;
border-top: 1px solid var(--border-color, #e5dfd5);
line-height: 1.5;
}
.admissionsTrendSummary strong {
color: var(--text-primary, #1a1612);
}
/* ── History accordion ── */
.historyDisclosure {
margin-top: 1rem;