fix(detail): gap-honest year axis on the detail-page trend charts (Batch D) #67

Merged
tudor merged 1 commits from fix/detail-chart-truthfulness into main 2026-07-20 11:42:48 +00:00
Owner

Batch D of applying the compare-screen learnings to the school detail page — chart truthfulness (spec §8.1 rules, points 4 & 12).

PerformanceChart (Results Over Time, primary + secondary)

  • Gap-honest axis: every academic year between the first and last data point now appears (shared fillAcademicYears helper), so cancelled/unpublished years (2019/20, 2020/21, and — for KS2 — 2021/22) render as real gaps rather than compressed time. Every series and the England overlay map onto the filled axis with null for missing years; spanGaps:false so school lines never bridge a gap.
  • Distinct KS2 vs KS4 note: replaces the primary-only COVID note. KS2 names the cancelled tests + the unpublished 2021/22 school-level year; KS4 names the unpublished 2019/20–2020/21 GCSE grading years.
  • Mobile axis: autoSkip so the longer axis stays readable; the broken line still marks a missing year even when the tick label is skipped.

AdmissionsTrendChart

  • Same gap-honest axis + spanGaps:false so a missing admissions year is a real gap, not compressed time.

Point 12 — definite canvas heights

  • Desktop is already a definite 280px. Fixed the secondary detail's mobile .chartContainer, which fixed the outer box at 220px and double-constrained PerformanceChart's own 220px canvas + chip strip (clipping the chips onto the plot) — now height:auto, matching the primary view.

Out of scope

  • SatsChart — single-year per-subject CSS bars: no year axis and no canvas height to constrain.

Verification

  • npx tsc --noEmit clean; npm test 105/105 pass (gap-fill logic covered via fillAcademicYears tests).
  • Visual verification on staging after merge (folds into Batch F's final review).

🤖 Generated with Claude Code

Batch D of applying the compare-screen learnings to the school **detail page** — chart truthfulness (spec §8.1 rules, points 4 & 12). ### PerformanceChart (Results Over Time, primary + secondary) - **Gap-honest axis:** every academic year between the first and last data point now appears (shared `fillAcademicYears` helper), so cancelled/unpublished years (2019/20, 2020/21, and — for KS2 — 2021/22) render as **real gaps** rather than compressed time. Every series and the England overlay map onto the filled axis with `null` for missing years; `spanGaps:false` so school lines never bridge a gap. - **Distinct KS2 vs KS4 note:** replaces the primary-only COVID note. KS2 names the cancelled tests + the unpublished 2021/22 school-level year; KS4 names the unpublished 2019/20–2020/21 GCSE grading years. - **Mobile axis:** `autoSkip` so the longer axis stays readable; the broken line still marks a missing year even when the tick label is skipped. ### AdmissionsTrendChart - Same gap-honest axis + `spanGaps:false` so a missing admissions year is a real gap, not compressed time. ### Point 12 — definite canvas heights - Desktop is already a definite 280px. Fixed the **secondary** detail's mobile `.chartContainer`, which fixed the outer box at 220px and double-constrained PerformanceChart's own 220px canvas + chip strip (clipping the chips onto the plot) — now `height:auto`, matching the primary view. ### Out of scope - **SatsChart** — single-year per-subject CSS bars: no year axis and no canvas height to constrain. ### Verification - `npx tsc --noEmit` clean; `npm test` 105/105 pass (gap-fill logic covered via `fillAcademicYears` tests). - Visual verification on staging after merge (folds into Batch F's final review). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tudor added 1 commit 2026-07-20 11:19:59 +00:00
fix(detail): gap-honest year axis on the detail-page trend charts (Batch D)
PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 1m8s
PR Checks / Backend Smoke (pull_request) Successful in 7s
PR Checks / Build Backend (no push) (pull_request) Successful in 12s
PR Checks / Build Frontend (no push) (pull_request) Successful in 50s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 10s
PR Checks / AI Code Review (Claude) (pull_request) Failing after 2m38s
17bd4d5a5e
Applies the compare screen's chart-truthfulness rules (spec §8.1) to the
school detail page's time-series charts.

PerformanceChart (Results Over Time, both phases):
- Fill every academic year between the first and last data point via the
  shared fillAcademicYears helper, so cancelled/unpublished years (2019/20,
  2020/21, and — for KS2 — 2021/22) render as real gaps instead of
  compressed time. Each series and the England overlay map onto this filled
  axis with null for missing years; spanGaps:false so school lines never
  bridge a gap.
- Replace the primary-only COVID note with a distinct, honest gap caption:
  KS2 names the cancelled tests plus the unpublished 2021/22 school-level
  year; KS4 names the unpublished 2019/20–2020/21 GCSE grading years.
- Mobile x-axis switches to autoSkip so the longer (gap-honest) axis stays
  readable; the broken line still marks a missing year even when its tick
  label is skipped.

AdmissionsTrendChart:
- Same gap-honest axis + spanGaps:false so a missing admissions year is a
  real gap, not compressed time.

Point 12 (definite canvas heights): desktop is already a definite 280px;
fix the secondary detail's mobile .chartContainer, which fixed the outer
box at 220px and double-constrained PerformanceChart's own 220px canvas +
chip strip (clipping the chips onto the plot) — now height:auto to match
the primary view.

SatsChart is out of scope (single-year per-subject CSS bars — no year axis,
no canvas height to constrain).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0146VHeLAWjDVE2B5uU67jCB
tudor merged commit 9c93c3d9c2 into main 2026-07-20 11:42:48 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tudor/school_compare#67