feat(search): phases in the order a child meets them #174

Merged
tudor merged 1 commits from feat/phase-order-child-path into main 2026-10-02 18:07:08 +00:00
Owner

The phase drop-down listed GIAS phases alphabetically, so 16 plus and All-through came before Nursery. They now follow a child's path:

Nursery → Primary → Middle deemed primary → Middle deemed secondary → Secondary → 16 plus → All-through

All-through spans the whole path, so it comes last. Any phase GIAS adds later follows the known ones, A–Z.

  • backend/schemas.py: PHASE_ORDER, beside PHASE_GROUPS, lowercased so a change of case in a GIAS label keeps its place.
  • backend/app.py: order_phases() applied to /api/filters phases and to the result-scoped result_filters.phases.
  • Tests: /api/filters order, plus an unknown phase going to the end. The full backend suite passes (297).
  • E2E: new journey the phase filter lists phases in the order a child meets them. It is data-invariant (it checks the relative order of whatever phases are offered). Run against staging, it fails on the current alphabetical order, as expected.

No frontend change: FilterBar renders filters.phases in the order the API returns them.

🤖 Generated with Claude Code

The phase drop-down listed GIAS phases alphabetically, so **16 plus** and **All-through** came before **Nursery**. They now follow a child's path: Nursery → Primary → Middle deemed primary → Middle deemed secondary → Secondary → 16 plus → All-through All-through spans the whole path, so it comes last. Any phase GIAS adds later follows the known ones, A–Z. - `backend/schemas.py`: `PHASE_ORDER`, beside `PHASE_GROUPS`, lowercased so a change of case in a GIAS label keeps its place. - `backend/app.py`: `order_phases()` applied to `/api/filters` `phases` and to the result-scoped `result_filters.phases`. - Tests: `/api/filters` order, plus an unknown phase going to the end. The full backend suite passes (297). - E2E: new journey *the phase filter lists phases in the order a child meets them*. It is data-invariant (it checks the relative order of whatever phases are offered). Run against staging, it fails on the current alphabetical order, as expected. No frontend change: `FilterBar` renders `filters.phases` in the order the API returns them. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tudor added 1 commit 2026-10-02 16:56:24 +00:00
feat(search): phases in the order a child meets them
PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 1m13s
PR Checks / Backend Smoke (pull_request) Successful in 10s
PR Checks / Build Backend (no push) (pull_request) Successful in 17s
PR Checks / Build Frontend (no push) (pull_request) Successful in 1m18s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 11s
PR Checks / AI Code Review (Claude) (pull_request) Successful in 16s
a88139a539
The phase filter listed GIAS phases alphabetically, so "16 plus" and
"All-through" came before Nursery. /api/filters (and the result-scoped
list) now order them Nursery, Primary, Middle deemed primary, Middle
deemed secondary, Secondary, 16 plus, then All-through, which spans the
whole path. A phase GIAS adds later follows the known ones, A-Z.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

🤖 AI Code Review (Claude Code)

Adds a PHASE_ORDER list and an order_phases() helper so the phase filter options come back in the order a child meets them (Nursery, Primary, Middle, Secondary, 16 plus, All-through). Unknown GIAS phases follow the known ones, A-Z. The helper is applied in both /api/schools and /api/filters, with backend unit tests and an e2e journey test. The change is small and self-contained, with no correctness, security or deploy concerns.

✅ No issues found.

## 🤖 AI Code Review (Claude Code) Adds a PHASE_ORDER list and an order_phases() helper so the phase filter options come back in the order a child meets them (Nursery, Primary, Middle, Secondary, 16 plus, All-through). Unknown GIAS phases follow the known ones, A-Z. The helper is applied in both /api/schools and /api/filters, with backend unit tests and an e2e journey test. The change is small and self-contained, with no correctness, security or deploy concerns. ✅ No issues found.
tudor merged commit dd5b48e612 into main 2026-10-02 18:07:08 +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#174