fix(admissions): move the cut-off detail into its own section
PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 1m5s
PR Checks / Backend Smoke (pull_request) Successful in 8s
PR Checks / Build Backend (no push) (pull_request) Successful in 13s
PR Checks / Build Frontend (no push) (pull_request) Successful in 45s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 11s
PR Checks / AI Code Review (Claude) (pull_request) Successful in 1m59s
PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 1m5s
PR Checks / Backend Smoke (pull_request) Successful in 8s
PR Checks / Build Backend (no push) (pull_request) Successful in 13s
PR Checks / Build Frontend (no push) (pull_request) Successful in 45s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 11s
PR Checks / AI Code Review (Claude) (pull_request) Successful in 1m59s
The admissions card measured 1503px on a live school page — half the height of every section put together, and nearly three times the next largest — with its default view rendering as four tiles adrift in about 1080px of blank card. The cause was a layout trick meeting content it was never sized for. The admissions views are stacked in one grid cell so switching them never shifts layout, and the hidden ones keep their box: only visibility is dropped. That works while the views are comparable. The distance view added in #102 carries a chart, a table and a map, came to 1402px against the tile grid's 316px, and pinned every other view to its height — including the one that renders by default, which nobody had clicked. Rather than only unpinning it, the detail moves out. Every other topic on the page is a section with a nav entry, and "how close did we need to live, and would we have got in?" is a topic, not a variant reading of the intake figures. The headline number stays on the Admissions tile where the intake story is; the record behind it now lives in a Distance section directly below. admissions 1503px -> 554px distance new -> 743px (median section on the page is ~528px) Three further changes, each of which also makes the content better rather than only shorter: * The map renders on request. Before a postcode is entered it is a circle drawn round a school, and it costs a Leaflet bundle and 240px to say so; a successful check opens it automatically, which is the point at which it starts answering something. Map height 320px -> 240px. * The chart appears only at the four published years that let the summary state a direction. Below that we already refuse to call the series a trend, and a line through three points asserts one regardless of what the sentence beneath it admits. The table carries those years anyway, with the reasons a line cannot show. * Three caveat paragraphs become one. They said walking-route twice and made the same point about priorities in two voices. It now sits in CutoffDistanceDetail rather than inside the check, so it still renders for a school with coordinates missing, where there is a table but no map and no check. The new e2e guard asserts no section exceeds 2.5x the median section height. Measuring the card's internals cannot catch this: the tile grid is flex: 1, so it absorbs the stretch and every box still looks full. The first version of this test targeted an arbitrary primary, passed against the live bug, and proved nothing; pointed at a school that actually holds cut-off history it fails on staging with "#admissions is 1459px against a 526px median". Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WDvkyqqHABm4bmth2kjAxE
This commit is contained in:
1 parent
8bf6145a73
commit
94151c58ea
14 files changed
+403
-185
No files matched your search
@@ -1627,8 +1627,23 @@
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
/* Stack both views in one grid cell so the card sizes to the taller view —
|
||||
toggling modes never shifts layout. */
|
||||
/*
|
||||
* Stack both views in one grid cell so the card sizes to the taller view —
|
||||
* toggling modes never shifts layout.
|
||||
*
|
||||
* This only works while the views are of COMPARABLE height, and it fails
|
||||
* silently rather than loudly when they are not. The hidden view keeps its
|
||||
* box (display stays block below; only visibility is dropped), so the grid
|
||||
* row is sized by the tallest view and every other view is padded out to
|
||||
* match it. A cut-off-distance view carrying a chart, a table and a map was
|
||||
* added here and came to 1402px against the tile grid's 316px, which left
|
||||
* the DEFAULT view — the one nobody had clicked — as four tiles floating in
|
||||
* ~1080px of blank card.
|
||||
*
|
||||
* Anything substantially taller than the tile grid belongs in its own
|
||||
* section, not in this viewport. That is where the distance detail now
|
||||
* lives; see DistanceSection.
|
||||
*/
|
||||
.admissionsViewport {
|
||||
display: grid;
|
||||
}
|
||||
@@ -2191,17 +2206,11 @@
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.cutoffMapTitle {
|
||||
margin: 0 0 0.85rem;
|
||||
font-family: var(--font-display);
|
||||
font-size: 1.1rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.01em;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.cutoffMapFigure {
|
||||
height: 320px;
|
||||
/* Enough to read a set of concentric rings and no more — this is a
|
||||
diagram of a number, not a map anyone navigates by. */
|
||||
height: 240px;
|
||||
border-radius: var(--radius-md);
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--border);
|
||||
@@ -2267,16 +2276,18 @@
|
||||
|
||||
/* ── Postcode check ── */
|
||||
|
||||
/* The check now leads the panel, so it carries no divider of its own — the
|
||||
rule above it belonged to a map that used to sit there. */
|
||||
.cutoffCheck {
|
||||
margin-top: 1.5rem;
|
||||
padding-top: 1.25rem;
|
||||
border-top: 1px solid var(--border);
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.cutoffCheckTitle {
|
||||
margin: 0 0 0.25rem;
|
||||
font-family: var(--font-display);
|
||||
font-size: 1rem;
|
||||
/* Now the panel's only heading (an h3), so it carries the weight the
|
||||
retired .cutoffMapTitle used to. */
|
||||
font-size: 1.1rem;
|
||||
font-weight: 700;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
@@ -2441,6 +2452,39 @@
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.cutoffMapFigure {
|
||||
height: 260px;
|
||||
height: 200px;
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Map, revealed on request ── */
|
||||
|
||||
.cutoffMapToggle {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
margin-top: 1rem;
|
||||
padding: 0.5rem 0.9rem;
|
||||
font: inherit;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
color: var(--brand-strong);
|
||||
background: none;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 999px;
|
||||
cursor: pointer;
|
||||
transition: border-color var(--transition), background var(--transition);
|
||||
}
|
||||
|
||||
.cutoffMapToggle:hover {
|
||||
border-color: var(--brand);
|
||||
background: var(--brand-bg);
|
||||
}
|
||||
|
||||
.cutoffMapToggle:focus-visible {
|
||||
outline: 2px solid var(--brand);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.cutoffMapReveal {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
Reference in new issue
Block a user