From 1c1df7796194af3d47f8e5ac0a0fbe6f323700e7 Mon Sep 17 00:00:00 2001 From: Tudor Date: Mon, 20 Jul 2026 22:31:58 +0100 Subject: [PATCH] fix(detail): align Ofsted Report Card grade chips MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The grade boxes rendered inconsistently: Safeguarding "Met" was a small 0.8125rem inline pill while grade values ("Strong") were 1.25rem full-width chips, and because category labels wrap to one or two lines each value sat at a different vertical position. Two-line values like "Expected standard" also produced a taller box. Add a scoped `.gradeGrid` modifier (Report Card + OEIF grids in both the primary and secondary detail views) that reserves two label lines so every chip shares a baseline, and gives all value chips one font size, padding and min-height — long text wraps inside an equal-height chip via max-width:100%. Scoped rather than touching the shared `.metricCard`/`.metricValue` used by the finance, phonics and admissions sections. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_0146VHeLAWjDVE2B5uU67jCB --- .../components/SchoolDetailView.module.css | 35 +++++++++++++++++++ nextjs-app/components/SchoolDetailView.tsx | 4 +-- .../SecondarySchoolDetailView.module.css | 35 +++++++++++++++++++ .../components/SecondarySchoolDetailView.tsx | 6 ++-- 4 files changed, 75 insertions(+), 5 deletions(-) diff --git a/nextjs-app/components/SchoolDetailView.module.css b/nextjs-app/components/SchoolDetailView.module.css index b2b419a..6365249 100644 --- a/nextjs-app/components/SchoolDetailView.module.css +++ b/nextjs-app/components/SchoolDetailView.module.css @@ -1040,6 +1040,41 @@ color: var(--accent-coral-dark, #b04a2e); } +/* ── Ofsted grade grids (Report Card + OEIF) ── + Uniform, vertically-aligned grade chips. Labels reserve two lines so + single- and double-line labels put their chips on the same baseline; + every chip (Met, Strong, Expected standard, …) shares one font size, + padding and min-height regardless of how many lines its text wraps to. */ +.gradeGrid .metricCard { + display: flex; + flex-direction: column; + align-items: center; + gap: 0.5rem; + padding: 0.85rem 0.75rem; +} +.gradeGrid .metricLabel { + min-height: 2.6em; + margin: 0; + display: flex; + align-items: center; + justify-content: center; + text-align: center; +} +.gradeGrid .metricValue { + margin-top: auto; + display: inline-flex; + align-items: center; + justify-content: center; + max-width: 100%; + min-height: 2.6em; + padding: 0.3rem 0.7rem; + border-radius: 5px; + font-size: 1rem; + font-weight: 700; + line-height: 1.25; + text-align: center; +} + .ofstedDisclaimer { font-size: 0.8rem; color: var(--text-muted, #8a847a); diff --git a/nextjs-app/components/SchoolDetailView.tsx b/nextjs-app/components/SchoolDetailView.tsx index e353795..ba6e074 100644 --- a/nextjs-app/components/SchoolDetailView.tsx +++ b/nextjs-app/components/SchoolDetailView.tsx @@ -555,7 +555,7 @@ export function SchoolDetailView({

From November 2025, Ofsted replaced single overall grades with Report Cards rating schools across several areas.

-
+
{ofsted.rc_safeguarding_met != null && (
Safeguarding
@@ -601,7 +601,7 @@ export function SchoolDetailView({ Rated {OFSTED_LABELS[ofsted.overall_effectiveness!]} across all inspected areas — Quality of Teaching, Behaviour, Pupils' Development and Leadership.

) : ( -
+
{oeifAreas.map(({ label, value }) => (
{label}
diff --git a/nextjs-app/components/SecondarySchoolDetailView.module.css b/nextjs-app/components/SecondarySchoolDetailView.module.css index 396fca1..6f9d85d 100644 --- a/nextjs-app/components/SecondarySchoolDetailView.module.css +++ b/nextjs-app/components/SecondarySchoolDetailView.module.css @@ -623,6 +623,41 @@ color: var(--accent-coral-dark, #b04a2e); } +/* ── Ofsted grade grids (Report Card + OEIF) ── + Uniform, vertically-aligned grade chips. Labels reserve two lines so + single- and double-line labels put their chips on the same baseline; + every chip (Met, Strong, Expected standard, …) shares one font size, + padding and min-height regardless of how many lines its text wraps to. */ +.gradeGrid .metricCard { + display: flex; + flex-direction: column; + align-items: center; + gap: 0.5rem; + padding: 0.85rem 0.75rem; +} +.gradeGrid .metricLabel { + min-height: 2.6em; + margin: 0; + display: flex; + align-items: center; + justify-content: center; + text-align: center; +} +.gradeGrid .metricValue { + margin-top: auto; + display: inline-flex; + align-items: center; + justify-content: center; + max-width: 100%; + min-height: 2.6em; + padding: 0.3rem 0.7rem; + border-radius: 5px; + font-size: 1rem; + font-weight: 700; + line-height: 1.25; + text-align: center; +} + .ofstedDisclaimer { font-size: 0.8rem; color: var(--text-muted, #8a847a); diff --git a/nextjs-app/components/SecondarySchoolDetailView.tsx b/nextjs-app/components/SecondarySchoolDetailView.tsx index d9cc74a..941b993 100644 --- a/nextjs-app/components/SecondarySchoolDetailView.tsx +++ b/nextjs-app/components/SecondarySchoolDetailView.tsx @@ -363,7 +363,7 @@ export function SecondarySchoolDetailView({

From November 2025, Ofsted replaced single overall grades with Report Cards rating schools across several areas.

-
+
{ofsted.rc_safeguarding_met != null && (
Safeguarding
@@ -408,7 +408,7 @@ export function SecondarySchoolDetailView({ Rated {OFSTED_LABELS[ofsted.overall_effectiveness]} across all inspected areas — Quality of Teaching, Behaviour, Pupils' Development and Leadership.

) : ( -
+
{oeifAreas.map(({ label, value }) => (
{label}
@@ -425,7 +425,7 @@ export function SecondarySchoolDetailView({

From September 2024, Ofsted no longer gives a single overall grade.

-
+
{[ { label: 'Quality of Education', value: ofsted.quality_of_education }, { label: 'Behaviour & Attitudes', value: ofsted.behaviour_attitudes },