fix(ui): remove duplicate data, merge sections, add sticky nav
All checks were successful
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 34s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 1m12s
Build and Push Docker Images / Build Integrator (push) Successful in 59s
Build and Push Docker Images / Build Kestra Init (push) Successful in 32s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s

UX audit round 2:
- Remove Summary Strip (duplicated Ofsted grade + parent happy/safe/recommend)
- Fold "% would recommend" into Ofsted section header
- Merge SATs Results + Subject Breakdown into one section
- Merge Results Over Time chart + Year-by-Year table into one section
- Add sticky section nav with dynamic pills based on available data
- Unify colour system: replace ad-hoc pill colours with semantic status classes
- Guard Pupils & Inclusion so it only renders with actual data
- Add year to Admissions section title
- Fix progress score 0.0 colour (was neutral gap at ±0.1, now at 0)
- Remove unused .metricTrend CSS class

Page reduced from 16 to 13 sections.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-25 10:34:19 +00:00
parent b68063c9b9
commit ce470ca342
2 changed files with 191 additions and 174 deletions

View File

@@ -8,7 +8,7 @@
border: 1px solid var(--border-color, #e5dfd5); border: 1px solid var(--border-color, #e5dfd5);
border-radius: 10px; border-radius: 10px;
padding: 1.25rem 1.5rem; padding: 1.25rem 1.5rem;
margin-bottom: 1rem; margin-bottom: 0;
box-shadow: var(--shadow-soft); box-shadow: var(--shadow-soft);
} }
@@ -117,41 +117,51 @@
opacity: 0.9; opacity: 0.9;
} }
/* Quick Summary Strip */ /* ── Sticky Section Navigation ──────────────────────── */
.summaryStrip { .sectionNav {
display: flex; position: sticky;
gap: 0.625rem; top: 0;
flex-wrap: wrap; z-index: 10;
margin: 0 0 1.25rem; background: var(--bg-card, white);
border: 1px solid var(--border-color, #e5dfd5);
border-top: none;
border-radius: 0 0 10px 10px;
padding: 0.5rem 1rem;
margin-bottom: 1rem;
overflow-x: auto;
white-space: nowrap;
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
} }
.summaryPill { .sectionNav::-webkit-scrollbar {
padding: 0.35rem 0.875rem; display: none;
border-radius: 999px; }
font-size: 0.8125rem;
font-weight: 600; .sectionNavInner {
display: inline-flex; display: inline-flex;
align-items: center; gap: 0.375rem;
gap: 0.3rem;
} }
.summaryPillGood { .sectionNavLink {
background: #d1fae5; display: inline-block;
color: #065f46; padding: 0.3rem 0.625rem;
font-size: 0.75rem;
font-weight: 500;
color: var(--text-secondary, #5c564d);
text-decoration: none;
border-radius: 4px;
transition: all 0.15s ease;
white-space: nowrap;
} }
.summaryPillWarn { .sectionNavLink:hover {
background: #fef3c7; background: var(--bg-secondary, #f3ede4);
color: #92400e; color: var(--text-primary, #1a1612);
} }
.summaryPillBad { /* Unified card for all content sections */
background: #fee2e2;
color: #991b1b;
}
/* Unified card — replaces summary / chartsSection / detailedMetrics /
absenceSection / historySection / supplementarySection / mapSection */
.card { .card {
background: var(--bg-card, white); background: var(--bg-card, white);
border: 1px solid var(--border-color, #e5dfd5); border: 1px solid var(--border-color, #e5dfd5);
@@ -159,6 +169,7 @@
padding: 1.25rem 1.5rem; padding: 1.25rem 1.5rem;
margin-bottom: 1rem; margin-bottom: 1rem;
box-shadow: var(--shadow-soft); box-shadow: var(--shadow-soft);
scroll-margin-top: 3.5rem;
} }
/* Section Title */ /* Section Title */
@@ -192,7 +203,7 @@
margin: -0.5rem 0 1rem; margin: -0.5rem 0 1rem;
} }
/* Response count badge (used in "What Parents Say") */ /* Response count badge */
.responseBadge { .responseBadge {
font-size: 0.75rem; font-size: 0.75rem;
font-weight: 500; font-weight: 500;
@@ -211,6 +222,18 @@
margin: 1.25rem 0 0.75rem; margin: 1.25rem 0 0.75rem;
} }
/* Parent recommendation line in Ofsted section */
.parentRecommendLine {
font-size: 0.85rem;
color: var(--text-secondary, #5c564d);
margin: 0.5rem 0 0;
}
.parentRecommendLine strong {
color: var(--accent-teal, #2d7d7d);
font-weight: 700;
}
/* Metrics Grid & Cards */ /* Metrics Grid & Cards */
.metricsGrid { .metricsGrid {
display: grid; display: grid;
@@ -252,11 +275,6 @@
font-style: italic; font-style: italic;
} }
.metricTrend {
font-size: 1rem;
color: var(--accent-teal, #2d7d7d);
}
/* Progress score colour coding */ /* Progress score colour coding */
.progressPositive { .progressPositive {
color: var(--accent-teal, #2d7d7d); color: var(--accent-teal, #2d7d7d);
@@ -268,6 +286,22 @@
font-weight: 700; font-weight: 700;
} }
/* ── Semantic status colours (unified) ────────────── */
.statusGood {
background: rgba(45, 125, 125, 0.10);
color: var(--accent-teal, #2d7d7d);
}
.statusWarn {
background: rgba(201, 162, 39, 0.12);
color: #b8920e;
}
.statusBad {
background: rgba(224, 114, 86, 0.12);
color: var(--accent-coral, #e07256);
}
/* Charts Section */ /* Charts Section */
.chartContainer { .chartContainer {
width: 100%; width: 100%;
@@ -339,6 +373,12 @@
margin-top: 0.5rem; margin-top: 0.5rem;
} }
.historicalSubtitle {
font-size: 0.8rem;
color: var(--text-muted, #8a847a);
margin: 1.25rem 0 0.25rem;
}
.dataTable { .dataTable {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
@@ -468,7 +508,7 @@
color: var(--text-primary, #1a1612); color: var(--text-primary, #1a1612);
} }
/* Admissions badges */ /* Admissions badge — uses unified status colours */
.admissionsBadge { .admissionsBadge {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
@@ -480,16 +520,6 @@
margin-top: 0.75rem; margin-top: 0.75rem;
} }
.admissionsBadgeWarn {
background: rgba(201, 162, 39, 0.15);
color: #b8920e;
}
.admissionsBadgeGood {
background: rgba(60, 140, 60, 0.12);
color: #3c8c3c;
}
/* Deprivation dot scale */ /* Deprivation dot scale */
.deprivationDots { .deprivationDots {
display: flex; display: flex;

View File

@@ -36,17 +36,10 @@ const NATIONAL_AVG = {
per_pupil_spend: 6000, per_pupil_spend: 6000,
}; };
function pillClass(pct: number | null | undefined): string {
if (pct == null) return styles.summaryPillWarn;
if (pct >= 80) return styles.summaryPillGood;
if (pct >= 60) return styles.summaryPillWarn;
return styles.summaryPillBad;
}
function progressClass(val: number | null | undefined): string { function progressClass(val: number | null | undefined): string {
if (val == null) return ''; if (val == null) return '';
if (val > 0.1) return styles.progressPositive; if (val > 0) return styles.progressPositive;
if (val < -0.1) return styles.progressNegative; if (val < 0) return styles.progressNegative;
return ''; return '';
} }
@@ -82,13 +75,39 @@ export function SchoolDetailView({
} }
}; };
// Deprivation plain-English description
const deprivationDesc = (decile: number) => { const deprivationDesc = (decile: number) => {
if (decile <= 3) return `This school is in one of England's most deprived areas (decile ${decile}/10). Many pupils may face additional challenges at home.`; if (decile <= 3) return `This school is in one of England's most deprived areas (decile ${decile}/10). Many pupils may face additional challenges at home.`;
if (decile <= 7) return `This school is in an area with average levels of deprivation (decile ${decile}/10).`; if (decile <= 7) return `This school is in an area with average levels of deprivation (decile ${decile}/10).`;
return `This school is in one of England's less deprived areas (decile ${decile}/10).`; return `This school is in one of England's less deprived areas (decile ${decile}/10).`;
}; };
// Guard for Pupils & Inclusion — only show if at least one metric is available
const hasInclusionData = (latestResults?.disadvantaged_pct != null)
|| (latestResults?.eal_pct != null)
|| (latestResults?.sen_support_pct != null)
|| senDetail != null;
const hasSchoolLife = absenceData != null || census?.class_size_avg != null;
const hasPhonics = phonics != null && phonics.year1_phonics_pct != null;
const hasDeprivation = deprivation != null && deprivation.idaci_decile != null;
const hasFinance = finance != null && finance.per_pupil_spend != null;
const hasLocation = schoolInfo.latitude != null && schoolInfo.longitude != null;
// Build section nav items dynamically — only sections with data
const navItems: { id: string; label: string }[] = [];
if (ofsted) navItems.push({ id: 'ofsted', label: 'Ofsted' });
if (parentView && parentView.total_responses != null && parentView.total_responses > 0)
navItems.push({ id: 'parents', label: 'Parents' });
if (latestResults) navItems.push({ id: 'sats', label: 'SATs' });
if (hasPhonics) navItems.push({ id: 'phonics', label: 'Phonics' });
if (hasSchoolLife) navItems.push({ id: 'school-life', label: 'School Life' });
if (admissions) navItems.push({ id: 'admissions', label: 'Admissions' });
if (hasInclusionData) navItems.push({ id: 'inclusion', label: 'Pupils' });
if (hasLocation) navItems.push({ id: 'location', label: 'Location' });
if (hasDeprivation) navItems.push({ id: 'local-area', label: 'Local Area' });
if (hasFinance) navItems.push({ id: 'finances', label: 'Finances' });
if (yearlyData.length > 0) navItems.push({ id: 'history', label: 'History' });
return ( return (
<div className={styles.container}> <div className={styles.container}>
{/* Back Navigation */} {/* Back Navigation */}
@@ -154,35 +173,20 @@ export function SchoolDetailView({
</div> </div>
</header> </header>
{/* Quick Summary Strip */} {/* Sticky Section Navigation */}
{(ofsted || parentView) && ( {navItems.length > 0 && (
<div className={styles.summaryStrip}> <nav className={styles.sectionNav} aria-label="Page sections">
{ofsted?.overall_effectiveness != null && ( <div className={styles.sectionNavInner}>
<span className={`${styles.summaryPill} ${styles[`ofstedGrade${ofsted.overall_effectiveness}`]}`}> {navItems.map(({ id, label }) => (
Ofsted: {OFSTED_LABELS[ofsted.overall_effectiveness]} <a key={id} href={`#${id}`} className={styles.sectionNavLink}>{label}</a>
</span> ))}
)}
{parentView?.q_happy_pct != null && (
<span className={`${styles.summaryPill} ${pillClass(parentView.q_happy_pct)}`}>
{Math.round(parentView.q_happy_pct)}% say child is happy
</span>
)}
{parentView?.q_safe_pct != null && (
<span className={`${styles.summaryPill} ${pillClass(parentView.q_safe_pct)}`}>
{Math.round(parentView.q_safe_pct)}% say child is safe
</span>
)}
{parentView?.q_recommend_pct != null && (
<span className={`${styles.summaryPill} ${pillClass(parentView.q_recommend_pct)}`}>
{Math.round(parentView.q_recommend_pct)}% would recommend
</span>
)}
</div> </div>
</nav>
)} )}
{/* Ofsted Rating */} {/* Ofsted Rating */}
{ofsted && ( {ofsted && (
<section className={styles.card}> <section id="ofsted" className={styles.card}>
<h2 className={styles.sectionTitle}> <h2 className={styles.sectionTitle}>
Ofsted Rating Ofsted Rating
{ofsted.inspection_date && ( {ofsted.inspection_date && (
@@ -210,6 +214,11 @@ export function SchoolDetailView({
</span> </span>
)} )}
</div> </div>
{parentView?.q_recommend_pct != null && parentView.total_responses != null && parentView.total_responses > 0 && (
<p className={styles.parentRecommendLine}>
<strong>{Math.round(parentView.q_recommend_pct)}%</strong> of parents would recommend this school ({parentView.total_responses.toLocaleString()} responses)
</p>
)}
<div className={styles.metricsGrid}> <div className={styles.metricsGrid}>
{[ {[
{ label: 'Quality of Teaching', value: ofsted.quality_of_education }, { label: 'Quality of Teaching', value: ofsted.quality_of_education },
@@ -233,7 +242,7 @@ export function SchoolDetailView({
{/* What Parents Say */} {/* What Parents Say */}
{parentView && parentView.total_responses != null && parentView.total_responses > 0 && ( {parentView && parentView.total_responses != null && parentView.total_responses > 0 && (
<section className={styles.card}> <section id="parents" className={styles.card}>
<h2 className={styles.sectionTitle}> <h2 className={styles.sectionTitle}>
What Parents Say What Parents Say
<span className={styles.responseBadge}> <span className={styles.responseBadge}>
@@ -267,13 +276,15 @@ export function SchoolDetailView({
</section> </section>
)} )}
{/* SATs Results */} {/* SATs Results (merged with Subject Breakdown) */}
{latestResults && ( {latestResults && (
<section className={styles.card}> <section id="sats" className={styles.card}>
<h2 className={styles.sectionTitle}>SATs Results ({latestResults.year})</h2> <h2 className={styles.sectionTitle}>SATs Results ({latestResults.year})</h2>
<p className={styles.sectionSubtitle}> <p className={styles.sectionSubtitle}>
End-of-primary-school tests taken by Year 6 pupils. National averages shown for comparison. End-of-primary-school tests taken by Year 6 pupils. National averages shown for comparison.
</p> </p>
{/* Headline numbers: RWM combined */}
<div className={styles.metricsGrid}> <div className={styles.metricsGrid}>
{latestResults.rwm_expected_pct !== null && ( {latestResults.rwm_expected_pct !== null && (
<div className={styles.metricCard}> <div className={styles.metricCard}>
@@ -289,44 +300,10 @@ export function SchoolDetailView({
<div className={styles.metricHint}>National avg: {NATIONAL_AVG.rwm_high}%</div> <div className={styles.metricHint}>National avg: {NATIONAL_AVG.rwm_high}%</div>
</div> </div>
)} )}
{latestResults.reading_progress !== null && (
<div className={styles.metricCard}>
<div className={styles.metricLabel}>Reading Progress</div>
<div className={`${styles.metricValue} ${progressClass(latestResults.reading_progress)}`}>
{formatProgress(latestResults.reading_progress)}
</div> </div>
</div>
)}
{latestResults.writing_progress !== null && (
<div className={styles.metricCard}>
<div className={styles.metricLabel}>Writing Progress</div>
<div className={`${styles.metricValue} ${progressClass(latestResults.writing_progress)}`}>
{formatProgress(latestResults.writing_progress)}
</div>
</div>
)}
{latestResults.maths_progress !== null && (
<div className={styles.metricCard}>
<div className={styles.metricLabel}>Maths Progress</div>
<div className={`${styles.metricValue} ${progressClass(latestResults.maths_progress)}`}>
{formatProgress(latestResults.maths_progress)}
</div>
</div>
)}
</div>
{(latestResults.reading_progress !== null || latestResults.writing_progress !== null || latestResults.maths_progress !== null) && (
<p className={styles.progressNote}>
Progress scores measure how much pupils improved compared to similar schools nationally. Above 0 = better than average, below 0 = below average.
</p>
)}
</section>
)}
{/* Detailed Subject Breakdown */} {/* Per-subject detail table */}
{latestResults && ( <div className={styles.metricGroupsGrid} style={{ marginTop: '1rem' }}>
<section className={styles.card}>
<h2 className={styles.sectionTitle}>Subject Breakdown ({latestResults.year})</h2>
<div className={styles.metricGroupsGrid}>
<div className={styles.metricGroup}> <div className={styles.metricGroup}>
<h3 className={styles.metricGroupTitle}>Reading</h3> <h3 className={styles.metricGroupTitle}>Reading</h3>
<div className={styles.metricTable}> <div className={styles.metricTable}>
@@ -345,7 +322,9 @@ export function SchoolDetailView({
{latestResults.reading_progress !== null && ( {latestResults.reading_progress !== null && (
<div className={styles.metricRow}> <div className={styles.metricRow}>
<span className={styles.metricName}>Progress score</span> <span className={styles.metricName}>Progress score</span>
<span className={styles.metricValue}>{formatProgress(latestResults.reading_progress)}</span> <span className={`${styles.metricValue} ${progressClass(latestResults.reading_progress)}`}>
{formatProgress(latestResults.reading_progress)}
</span>
</div> </div>
)} )}
{latestResults.reading_avg_score !== null && ( {latestResults.reading_avg_score !== null && (
@@ -375,7 +354,9 @@ export function SchoolDetailView({
{latestResults.writing_progress !== null && ( {latestResults.writing_progress !== null && (
<div className={styles.metricRow}> <div className={styles.metricRow}>
<span className={styles.metricName}>Progress score</span> <span className={styles.metricName}>Progress score</span>
<span className={styles.metricValue}>{formatProgress(latestResults.writing_progress)}</span> <span className={`${styles.metricValue} ${progressClass(latestResults.writing_progress)}`}>
{formatProgress(latestResults.writing_progress)}
</span>
</div> </div>
)} )}
</div> </div>
@@ -399,7 +380,9 @@ export function SchoolDetailView({
{latestResults.maths_progress !== null && ( {latestResults.maths_progress !== null && (
<div className={styles.metricRow}> <div className={styles.metricRow}>
<span className={styles.metricName}>Progress score</span> <span className={styles.metricName}>Progress score</span>
<span className={styles.metricValue}>{formatProgress(latestResults.maths_progress)}</span> <span className={`${styles.metricValue} ${progressClass(latestResults.maths_progress)}`}>
{formatProgress(latestResults.maths_progress)}
</span>
</div> </div>
)} )}
{latestResults.maths_avg_score !== null && ( {latestResults.maths_avg_score !== null && (
@@ -411,12 +394,18 @@ export function SchoolDetailView({
</div> </div>
</div> </div>
</div> </div>
{(latestResults.reading_progress !== null || latestResults.writing_progress !== null || latestResults.maths_progress !== null) && (
<p className={styles.progressNote}>
Progress scores measure how much pupils improved compared to similar schools nationally. Above 0 = better than average, below 0 = below average.
</p>
)}
</section> </section>
)} )}
{/* Year 1 Phonics */} {/* Year 1 Phonics */}
{phonics && phonics.year1_phonics_pct != null && ( {hasPhonics && phonics && (
<section className={styles.card}> <section id="phonics" className={styles.card}>
<h2 className={styles.sectionTitle}>Year 1 Phonics ({phonics.year})</h2> <h2 className={styles.sectionTitle}>Year 1 Phonics ({phonics.year})</h2>
<p className={styles.sectionSubtitle}> <p className={styles.sectionSubtitle}>
Phonics is a key early reading skill. Children are tested at the end of Year 1. Phonics is a key early reading skill. Children are tested at the end of Year 1.
@@ -438,8 +427,8 @@ export function SchoolDetailView({
)} )}
{/* School Life */} {/* School Life */}
{(absenceData || census?.class_size_avg != null) && ( {hasSchoolLife && (
<section className={styles.card}> <section id="school-life" className={styles.card}>
<h2 className={styles.sectionTitle}>School Life</h2> <h2 className={styles.sectionTitle}>School Life</h2>
<div className={styles.metricsGrid}> <div className={styles.metricsGrid}>
{census?.class_size_avg != null && ( {census?.class_size_avg != null && (
@@ -469,8 +458,8 @@ export function SchoolDetailView({
{/* How Hard to Get In */} {/* How Hard to Get In */}
{admissions && ( {admissions && (
<section className={styles.card}> <section id="admissions" className={styles.card}>
<h2 className={styles.sectionTitle}>How Hard to Get Into This School</h2> <h2 className={styles.sectionTitle}>How Hard to Get Into This School ({admissions.year})</h2>
<div className={styles.metricsGrid}> <div className={styles.metricsGrid}>
{admissions.published_admission_number != null && ( {admissions.published_admission_number != null && (
<div className={styles.metricCard}> <div className={styles.metricCard}>
@@ -492,7 +481,7 @@ export function SchoolDetailView({
)} )}
</div> </div>
{admissions.oversubscribed != null && ( {admissions.oversubscribed != null && (
<div className={`${styles.admissionsBadge} ${admissions.oversubscribed ? styles.admissionsBadgeWarn : styles.admissionsBadgeGood}`}> <div className={`${styles.admissionsBadge} ${admissions.oversubscribed ? styles.statusWarn : styles.statusGood}`}>
{admissions.oversubscribed {admissions.oversubscribed
? '⚠ More applications than places last year' ? '⚠ More applications than places last year'
: '✓ Places were available last year'} : '✓ Places were available last year'}
@@ -502,8 +491,8 @@ export function SchoolDetailView({
)} )}
{/* Pupils & Inclusion */} {/* Pupils & Inclusion */}
{(latestResults || senDetail) && ( {hasInclusionData && (
<section className={styles.card}> <section id="inclusion" className={styles.card}>
<h2 className={styles.sectionTitle}>Pupils &amp; Inclusion</h2> <h2 className={styles.sectionTitle}>Pupils &amp; Inclusion</h2>
<div className={styles.metricsGrid}> <div className={styles.metricsGrid}>
{latestResults?.disadvantaged_pct != null && ( {latestResults?.disadvantaged_pct != null && (
@@ -553,13 +542,13 @@ export function SchoolDetailView({
)} )}
{/* Location */} {/* Location */}
{schoolInfo.latitude && schoolInfo.longitude && ( {hasLocation && (
<section className={styles.card}> <section id="location" className={styles.card}>
<h2 className={styles.sectionTitle}>Location</h2> <h2 className={styles.sectionTitle}>Location</h2>
<div className={styles.mapContainer}> <div className={styles.mapContainer}>
<SchoolMap <SchoolMap
schools={[schoolInfo]} schools={[schoolInfo]}
center={[schoolInfo.latitude, schoolInfo.longitude]} center={[schoolInfo.latitude!, schoolInfo.longitude!]}
zoom={15} zoom={15}
/> />
</div> </div>
@@ -567,8 +556,8 @@ export function SchoolDetailView({
)} )}
{/* Local Area Context */} {/* Local Area Context */}
{deprivation && deprivation.idaci_decile != null && ( {hasDeprivation && deprivation && (
<section className={styles.card}> <section id="local-area" className={styles.card}>
<h2 className={styles.sectionTitle}>Local Area Context</h2> <h2 className={styles.sectionTitle}>Local Area Context</h2>
<div className={styles.deprivationDots}> <div className={styles.deprivationDots}>
{Array.from({ length: 10 }, (_, i) => ( {Array.from({ length: 10 }, (_, i) => (
@@ -583,13 +572,13 @@ export function SchoolDetailView({
<span>Most deprived</span> <span>Most deprived</span>
<span>Least deprived</span> <span>Least deprived</span>
</div> </div>
<p className={styles.deprivationDesc}>{deprivationDesc(deprivation.idaci_decile)}</p> <p className={styles.deprivationDesc}>{deprivationDesc(deprivation.idaci_decile!)}</p>
</section> </section>
)} )}
{/* Finances */} {/* Finances */}
{finance && finance.per_pupil_spend != null && ( {hasFinance && finance && (
<section className={styles.card}> <section id="finances" className={styles.card}>
<h2 className={styles.sectionTitle}>School Finances ({finance.year})</h2> <h2 className={styles.sectionTitle}>School Finances ({finance.year})</h2>
<p className={styles.sectionSubtitle}> <p className={styles.sectionSubtitle}>
Per-pupil spending shows how much the school has to spend on each child&apos;s education. Per-pupil spending shows how much the school has to spend on each child&apos;s education.
@@ -597,7 +586,7 @@ export function SchoolDetailView({
<div className={styles.metricsGrid}> <div className={styles.metricsGrid}>
<div className={styles.metricCard}> <div className={styles.metricCard}>
<div className={styles.metricLabel}>Total spend per pupil per year</div> <div className={styles.metricLabel}>Total spend per pupil per year</div>
<div className={styles.metricValue}>£{Math.round(finance.per_pupil_spend).toLocaleString()}</div> <div className={styles.metricValue}>£{Math.round(finance.per_pupil_spend!).toLocaleString()}</div>
<div className={styles.metricHint}>National avg: ~£{NATIONAL_AVG.per_pupil_spend.toLocaleString()}</div> <div className={styles.metricHint}>National avg: ~£{NATIONAL_AVG.per_pupil_spend.toLocaleString()}</div>
</div> </div>
{finance.teacher_cost_pct != null && ( {finance.teacher_cost_pct != null && (
@@ -616,9 +605,9 @@ export function SchoolDetailView({
</section> </section>
)} )}
{/* Results Over Time */} {/* Results Over Time (merged: chart + historical table) */}
{yearlyData.length > 0 && ( {yearlyData.length > 0 && (
<section className={styles.card}> <section id="history" className={styles.card}>
<h2 className={styles.sectionTitle}>Results Over Time</h2> <h2 className={styles.sectionTitle}>Results Over Time</h2>
<div className={styles.chartContainer}> <div className={styles.chartContainer}>
<PerformanceChart <PerformanceChart
@@ -626,13 +615,9 @@ export function SchoolDetailView({
schoolName={schoolInfo.school_name} schoolName={schoolInfo.school_name}
/> />
</div> </div>
</section>
)}
{/* Historical Data Table */}
{yearlyData.length > 1 && ( {yearlyData.length > 1 && (
<section className={styles.card}> <>
<h2 className={styles.sectionTitle}>Year-by-Year Summary</h2> <p className={styles.historicalSubtitle}>Detailed year-by-year figures</p>
<div className={styles.tableWrapper}> <div className={styles.tableWrapper}>
<table className={styles.dataTable}> <table className={styles.dataTable}>
<thead> <thead>
@@ -659,6 +644,8 @@ export function SchoolDetailView({
</tbody> </tbody>
</table> </table>
</div> </div>
</>
)}
</section> </section>
)} )}
</div> </div>