Frontend PR (3 of 3) for the compare-screen redesign — rebuilds /compare as the parent-first comparison from the approved mockups (docs/superpowers/specs/mockups/, committed in this PR as the design source; all user-facing copy is taken verbatim from them — it carries two rounds of education-expert review).
What changes
Six sections replace the single-metric picker: At a glance → Ofsted inspection → How children do academically → Getting a place → Who goes there → Explore trends (the old picker+chart+table live on there, gaining an England reference line — nothing from the old catalogue is lost).
Every number gets an anchor: official DfE figures render as "England average"; computed figures as "state-school average (computed from our dataset)" — provenance wording is enforced in copy and encoded in lib/compareLogic.ts (jest-tested: report-card summaries never count safeguarding, problem areas are always named, "Attention needed" cannot appear, admissions chips use one consistent metric, progress bands follow DfE's CI methodology).
All three Ofsted regimes render with one chip-list grammar: legacy graded, interim carried-forward (marked as such), and Nov-2025 report cards (no overall grade, ever); mixed comparisons show the comparability note; links go to the school's Ofsted provider page.
Mobile-first measure-first layout: sections stack school-by-school under each measure — no horizontal swiping; the desktop label-column grid is the ≥761px enhancement.
Chart truthfulness: series building extracted to pure lib/compareChartData.ts — every academic year between first and last data point appears on the axis (COVID cancellations and the unpublished 2021/22 school-level year render as real gaps, with the footnote "DfE didn't publish school-level figures for 2021/22"); spanGaps off; England overlay dashed; regression test guards the missing-third-series bug.
77 jest tests (33 new across compareLogic / compareChartData / DotStrip / CompareOfsted) + updated e2e journeys asserting the new sections, the England anchor, the provider-page link rule, the no-invented-overall-grade rule, and no horizontal body scroll at 390px.
Deploy notes
Merge order: PR #34 first — this UI reads its enriched payload. It degrades gracefully (optional fields) but the sections would be data-starved without it.
The e2e run on the Stage pipeline is the real verification (no local server per project rules). After staging looks right, promotion is the usual manual second approval.
Frontend PR (3 of 3) for the compare-screen redesign — rebuilds `/compare` as the parent-first comparison from the approved mockups (`docs/superpowers/specs/mockups/`, committed in this PR as the design source; all user-facing copy is taken verbatim from them — it carries two rounds of education-expert review).
## What changes
- **Six sections replace the single-metric picker:** At a glance → Ofsted inspection → How children do academically → Getting a place → Who goes there → Explore trends (the old picker+chart+table live on there, gaining an England reference line — nothing from the old catalogue is lost).
- **Every number gets an anchor:** official DfE figures render as "England average"; computed figures as "state-school average (computed from our dataset)" — provenance wording is enforced in copy and encoded in `lib/compareLogic.ts` (jest-tested: report-card summaries never count safeguarding, problem areas are always named, "Attention needed" cannot appear, admissions chips use one consistent metric, progress bands follow DfE's CI methodology).
- **All three Ofsted regimes render with one chip-list grammar:** legacy graded, interim carried-forward (marked as such), and Nov-2025 report cards (no overall grade, ever); mixed comparisons show the comparability note; links go to the school's Ofsted provider page.
- **Mobile-first measure-first layout:** sections stack school-by-school under each measure — no horizontal swiping; the desktop label-column grid is the ≥761px enhancement.
- **Chart truthfulness:** series building extracted to pure `lib/compareChartData.ts` — every academic year between first and last data point appears on the axis (COVID cancellations and the unpublished 2021/22 school-level year render as real gaps, with the footnote "DfE didn't publish school-level figures for 2021/22"); `spanGaps` off; England overlay dashed; regression test guards the missing-third-series bug.
## Contract preserved
`?urns=`/`?metric=` URLs, share flow, comparison basket, phase tabs + auto-detection, analytics events (`compare_viewed`, `compare_metric_changed`, `compare_shared`, focus chips) all unchanged.
## Tests
77 jest tests (33 new across compareLogic / compareChartData / DotStrip / CompareOfsted) + updated e2e journeys asserting the new sections, the England anchor, the provider-page link rule, the no-invented-overall-grade rule, and no horizontal body scroll at 390px.
## Deploy notes
- **Merge order: PR #34 first** — this UI reads its enriched payload. It degrades gracefully (optional fields) but the sections would be data-starved without it.
- The e2e run on the Stage pipeline is the real verification (no local server per project rules). After staging looks right, promotion is the usual manual second approval.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_0146VHeLAWjDVE2B5uU67jCB
This PR enriches /api/compare with GIAS facts (denomination, capacity, trust, etc.) for the new parent-first compare screen, and rewrites the frontend compare page into six sections (At a glance, Ofsted, Academics, Admissions, Community, Explore trends) built on tested pure logic (compareLogic.ts, compareChartData.ts) plus new components and e2e coverage. Cross-checking the backend field names, national-averages/benchmarks keys, and Ofsted regime handling against the new frontend components and their tests shows they line up correctly, including the fix for the chart's dropped third series and the collapsed-by-default assumption in the plan doc (the actual TrendsExplorer renders with open by default, so the new e2e canvas-visibility assertion is not at risk).
✅ No issues found.
## 🤖 AI Code Review (Claude Code)
This PR enriches /api/compare with GIAS facts (denomination, capacity, trust, etc.) for the new parent-first compare screen, and rewrites the frontend compare page into six sections (At a glance, Ofsted, Academics, Admissions, Community, Explore trends) built on tested pure logic (compareLogic.ts, compareChartData.ts) plus new components and e2e coverage. Cross-checking the backend field names, national-averages/benchmarks keys, and Ofsted regime handling against the new frontend components and their tests shows they line up correctly, including the fix for the chart's dropped third series and the collapsed-by-default assumption in the plan doc (the actual TrendsExplorer renders with `open` by default, so the new e2e canvas-visibility assertion is not at risk).
✅ No issues found.
tudor
merged commit 9990f540f7 into main2026-07-14 07:26:21 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Frontend PR (3 of 3) for the compare-screen redesign — rebuilds
/compareas the parent-first comparison from the approved mockups (docs/superpowers/specs/mockups/, committed in this PR as the design source; all user-facing copy is taken verbatim from them — it carries two rounds of education-expert review).What changes
lib/compareLogic.ts(jest-tested: report-card summaries never count safeguarding, problem areas are always named, "Attention needed" cannot appear, admissions chips use one consistent metric, progress bands follow DfE's CI methodology).lib/compareChartData.ts— every academic year between first and last data point appears on the axis (COVID cancellations and the unpublished 2021/22 school-level year render as real gaps, with the footnote "DfE didn't publish school-level figures for 2021/22");spanGapsoff; England overlay dashed; regression test guards the missing-third-series bug.Contract preserved
?urns=/?metric=URLs, share flow, comparison basket, phase tabs + auto-detection, analytics events (compare_viewed,compare_metric_changed,compare_shared, focus chips) all unchanged.Tests
77 jest tests (33 new across compareLogic / compareChartData / DotStrip / CompareOfsted) + updated e2e journeys asserting the new sections, the England anchor, the provider-page link rule, the no-invented-overall-grade rule, and no horizontal body scroll at 390px.
Deploy notes
🤖 Generated with Claude Code
https://claude.ai/code/session_0146VHeLAWjDVE2B5uU67jCB
🤖 AI Code Review (Claude Code)
This PR enriches /api/compare with GIAS facts (denomination, capacity, trust, etc.) for the new parent-first compare screen, and rewrites the frontend compare page into six sections (At a glance, Ofsted, Academics, Admissions, Community, Explore trends) built on tested pure logic (compareLogic.ts, compareChartData.ts) plus new components and e2e coverage. Cross-checking the backend field names, national-averages/benchmarks keys, and Ofsted regime handling against the new frontend components and their tests shows they line up correctly, including the fix for the chart's dropped third series and the collapsed-by-default assumption in the plan doc (the actual TrendsExplorer renders with
openby default, so the new e2e canvas-visibility assertion is not at risk).✅ No issues found.