feat(compare): parent-first compare screen — sections, England anchors, report cards, mobile-first #35

Merged
tudor merged 12 commits from feat/compare-frontend-rebuild into main 2026-07-14 07:26:21 +00:00
Owner

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.ai/code/session_0146VHeLAWjDVE2B5uU67jCB

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
tudor added 9 commits 2026-07-13 22:59:55 +00:00
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0146VHeLAWjDVE2B5uU67jCB
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0146VHeLAWjDVE2B5uU67jCB
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0146VHeLAWjDVE2B5uU67jCB
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0146VHeLAWjDVE2B5uU67jCB
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0146VHeLAWjDVE2B5uU67jCB
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0146VHeLAWjDVE2B5uU67jCB
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0146VHeLAWjDVE2B5uU67jCB
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0146VHeLAWjDVE2B5uU67jCB
test(e2e): compare journeys for the parent-first redesign
PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 9m42s
PR Checks / Backend Smoke (pull_request) Successful in 7s
PR Checks / Build Backend (no push) (pull_request) Successful in 15s
PR Checks / Build Frontend (no push) (pull_request) Successful in 49s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 38s
PR Checks / AI Code Review (Claude) (pull_request) Failing after 59s
2f85b9c647
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0146VHeLAWjDVE2B5uU67jCB
tudor added 2 commits 2026-07-13 23:04:20 +00:00
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0146VHeLAWjDVE2B5uU67jCB
feat(api): compare school_info carries GIAS facts for the community section
PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 9m36s
PR Checks / Backend Smoke (pull_request) Successful in 6s
PR Checks / Build Backend (no push) (pull_request) Successful in 16s
PR Checks / Build Frontend (no push) (pull_request) Successful in 48s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 10s
PR Checks / AI Code Review (Claude) (pull_request) Failing after 11s
d0e71e2cf0
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0146VHeLAWjDVE2B5uU67jCB
tudor added 1 commit 2026-07-14 06:07:59 +00:00
ci: re-run PR checks (AI review job errored without posting findings)
PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 9m39s
PR Checks / Backend Smoke (pull_request) Successful in 8s
PR Checks / Build Backend (no push) (pull_request) Successful in 32s
PR Checks / Build Frontend (no push) (pull_request) Successful in 41s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 1m9s
PR Checks / AI Code Review (Claude) (pull_request) Successful in 4m1s
6dd9b04b50
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: 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 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 main 2026-07-14 07:26:21 +00:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tudor/school_compare#35