feat(web): similar schools section, honest about what it matched
Server-rendered cards inside a client carousel that scrolls rather than paginates, so all six links stay in the initial HTML and the row still works with JavaScript off. Three client islands, split by what each needs: a school, the whole selection, a DOM ref. The lede claims a similar intake only when no card came from tier 3, chips list what a school actually shares, a missing figure reads "Not published", and the neighbour's number carries no valence colour — green and terracotta mean "against England" everywhere else, and colouring it here would read as ranking the neighbours. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
52b00ac752
commit
91314a80b5
7 files changed
+594
No files matched your search
@@ -346,6 +346,27 @@ export interface SchoolsResponse {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* A nearby school of the same phase and a comparable intake.
|
||||
*
|
||||
* `tier` is carried explicitly rather than inferred from `shared`, because it
|
||||
* drives two separate decisions — whether the lede may claim a similar intake,
|
||||
* and whether a chip renders as a fill or a muted outline — and inferring it
|
||||
* from chip count would couple those decisions to the copy.
|
||||
*/
|
||||
export interface SimilarSchool {
|
||||
urn: number;
|
||||
school_name: string;
|
||||
distance_miles: number;
|
||||
school_type: string | null;
|
||||
age_range: string | null;
|
||||
shared: string[];
|
||||
tier: number;
|
||||
metric_value: number | null;
|
||||
metric_key: string;
|
||||
metric_year: number | null;
|
||||
}
|
||||
|
||||
export interface SchoolDetailsResponse {
|
||||
school_info: School;
|
||||
/**
|
||||
@@ -357,6 +378,14 @@ export interface SchoolDetailsResponse {
|
||||
* authority both fall below the publish threshold has nowhere to link.
|
||||
*/
|
||||
places?: SchoolPlace[];
|
||||
/**
|
||||
* Up to six nearby schools of a comparable intake, nearest first.
|
||||
*
|
||||
* Optional for the same reason as `places`: a frontend deployed ahead of the
|
||||
* API that serves this must render without it. Absent and empty mean the
|
||||
* same thing here — no section.
|
||||
*/
|
||||
similar_schools?: SimilarSchool[];
|
||||
yearly_data: SchoolResult[];
|
||||
absence_data: AbsenceData | null;
|
||||
// Supplementary data (null until Kestra populates)
|
||||
|
||||
Reference in new issue
Block a user