PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 1m2s
PR Checks / Backend Smoke (pull_request) Successful in 7s
PR Checks / Build Backend (no push) (pull_request) Successful in 10s
PR Checks / Build Frontend (no push) (pull_request) Successful in 46s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 12s
PR Checks / AI Code Review (Claude) (pull_request) Successful in 1m38s
Three review points on the special-schools change: 1. Copy accuracy — the context note said "Its pupils have special educational needs" for every isSpecialSchool() match, but the helper also matches pupil referral units and alternative provision, whose pupils are educated outside a mainstream setting (e.g. after exclusion) and are not necessarily SEND. Extracted a shared <SpecialSchoolNote> with type-aware copy: SEND wording only for genuine special schools; PRUs/AP get their own accurate wording. 2. Same-school trend was conflated with the England comparison — SchoolRow's year-over-year trend arrow (and the school's own figure) were gated on the same flag that drops the vs-England delta, hiding a still-meaningful trend for special schools with real data. Split the two: the school's OWN RWM figure + trend show whenever there's a real value (special schools included; only a placeholder all-zero row is hidden); only the vs-England delta is additionally dropped for special/PRU/AP. Mirrored in SecondarySchoolRow (own Attainment 8 shown; only the vs-LA delta dropped). 3. De-duplicated the .specialNote CSS (was copy-pasted between the two detail view module files) into SpecialSchoolNote.module.css, owned by the shared component so it can't drift. New SpecialSchoolNote unit tests assert SEND wording for special schools and NOT for PRUs/AP. tsc clean; 112/112 unit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0146VHeLAWjDVE2B5uU67jCB
59 lines
2.5 KiB
TypeScript
59 lines
2.5 KiB
TypeScript
/**
|
|
* SpecialSchoolNote — the context note shown on special-school / PRU / AP
|
|
* detail pages explaining why the mainstream England-average comparison is
|
|
* dropped. Renders nothing for mainstream schools.
|
|
*
|
|
* The copy is type-aware: only genuine special schools have pupils with special
|
|
* educational needs. Pupil referral units and alternative provision teach
|
|
* pupils educated outside a mainstream setting (e.g. after exclusion, or for
|
|
* medical reasons) who are not necessarily SEND — so their note says so rather
|
|
* than mischaracterising them. Suppressing the England comparison is reasonable
|
|
* for all three.
|
|
*/
|
|
|
|
import { isSpecialSchool } from '@/lib/utils';
|
|
import styles from './SpecialSchoolNote.module.css';
|
|
|
|
type SpecialKind = 'special' | 'pru' | 'ap';
|
|
|
|
function specialKind(schoolType: string | null | undefined): SpecialKind {
|
|
const t = (schoolType ?? '').toLowerCase();
|
|
if (/pupil referral/.test(t)) return 'pru';
|
|
if (/alternative provision/.test(t)) return 'ap';
|
|
return 'special';
|
|
}
|
|
|
|
export function SpecialSchoolNote({ school }: { school: { school_type?: string | null } }) {
|
|
if (!isSpecialSchool(school)) return null;
|
|
const kind = specialKind(school.school_type);
|
|
|
|
return (
|
|
<div className={styles.note} role="note">
|
|
{kind === 'special' && (
|
|
<>
|
|
<strong>This is a special school.</strong> Its pupils have special educational needs and
|
|
work towards individual targets. They sit the same national assessments, but very few
|
|
reach the mainstream “expected standard” these measures report — so a
|
|
comparison with the England average isn’t a meaningful guide to the school.
|
|
</>
|
|
)}
|
|
{kind === 'pru' && (
|
|
<>
|
|
<strong>This is a pupil referral unit.</strong> It teaches pupils educated outside a
|
|
mainstream school — for example after exclusion, or for medical or behavioural reasons.
|
|
The mainstream “expected standard” and the England-average comparison
|
|
aren’t a meaningful guide to the school.
|
|
</>
|
|
)}
|
|
{kind === 'ap' && (
|
|
<>
|
|
<strong>This is an alternative provision setting.</strong> It teaches pupils educated
|
|
outside a mainstream school. The mainstream “expected standard” and the
|
|
England-average comparison aren’t a meaningful guide to the school.
|
|
</>
|
|
)}{' '}
|
|
Where available, the progress its pupils make is a fairer measure.
|
|
</div>
|
|
);
|
|
}
|