Build the approved page tops on every Ward Flow page

Merged
BI
2d ago
+14178-10017

What this does

Builds Josh's approved v6 page tops (9 Nov 2026) on every Ward Flow page, matching the Home top from #1552.

  • New shared parts in src/components/wf:
    • HeroTop, with figures, act row, quick chips, band and pill;
    • FolderTabs: curved folder tabs on phone and tablet, underline tabs on desktop.
  • Pages:
    • Home, Capacity, Wards, All EDs, ED desk
    • Alerts, Patients search, Places hub, On-call, Transport officer
    • Discharges, Ward, Bed board, Out of area
    • Bed meeting, Agenda, TV, Handover, Legal forms, Seclusion, Governance
    • Statistics, Ward statistics, Chronology, Downtime pack, Community places, Community team (Midland)
    • Movements, Waiting, Referrals, Start a triage, Patient, Settings
  • Josh's approved rulings: "past 24h" wording everywhere; Network folds into Home; On-call says "all lists"; bed meeting TV figures stay small; shortened labels accepted; the under-a-form count follows #1553.
  • Quick bar: the Home Quick bar is restyled as 36px chips in one scrolling row on phone. Other desk homes pass their own chips.
  • Kept from #1562: the staff and handover tools inside the new tops. Staff needed, Contact, Digest and Pin are now quick chips; the Pinned card and the Since line stay under Home's tabs.
  • Clinical logic: no change. The tops show only figures each page already derives.

Review page (mock-ups): https://claude.ai/artifact/4mFrSNtXo4e5NhPJETDC18

Checks (local)

  • Typecheck, whole-tree lint, prettier on changed files, every check:ward-* script, knip, the test-deletion guard and the static CI checks all pass.
  • Full unit gate (check:ward-expected-reds) before the #1562 merge: 2,199 files, 21,714 tests, 0 failing. After later changes: the failed files plus every DOM test for the touched pages (208 files) pass; two test-runner-safety lock tests fail locally only because this machine has Node 22, not 24.
  • Journey review anchors were re-pointed to the lines they reviewed; verify.mjs --check passes.
  • Built screens were captured at 2x and compared with the mock-ups, phone and desktop, light and dark. Eight defects were found and fixed (tab outline, Demo pill row, pill wrapping, Board, Search, Triage, Patient phone top).
  • Not run locally: Playwright journeys and release gate, coverage, backend tests (no backend change).

Phone script budget

  • Cause: the shared top code costs about 4.5 KB per route. A split of hero-top into lazy parts was tried and dropped: each next/dynamic chunk added runtime map cost, so Statistics grew by 2.5 KB instead of shrinking.
  • Limits (from hosted CI measurements plus about 0.6 KB): Home 565.1, referrals 571.7, ed 524.2, ward 602.7, movement 597.9, capacity 645.0, arm-ed 657.5, bed meeting 578.6, statistics 618.8.
  • Approvals: raises within 5 KB need none. Statistics (+6.8 KB, within the 8 KB Josh allowed, 16:10Z) and bed meeting (+6.6 KB, Josh, 17:20Z) were approved on decision cards.
  • Detail: docs/script-budget-history/2026-11-09-pr1581-page-tops.md.

Accessibility and journeys (hosted CI round 2)

  • Spoken names of top figures, band cells, chips and act buttons now start with the visible words; figure buttons are named by value and word ("1 ready now").
  • A sideways-scrolling band is keyboard focusable only while it scrolls and has no control inside.
  • Capacity keeps the "Bed counts confirmed" region on wider screens.
  • A community team's phone shows three section tabs with Referrals under More, as the mock-up shows; the community referral release gate reads it there.
  • Locally: axe sweep of 40 routes at 1440 and 390 wide, no serious or critical; affected unit and DOM tests pass. Release gate and shared-mode specs not run locally (WebKit and Postgres unavailable); hosted CI runs them.

For Josh: recommendations accepted (D-116)

Josh's overnight go-ahead (9 Nov 18:24Z) accepted each recommendation below; recorded as D-116.

  1. Phone service tabs on All wards replace shell-15's "no region chips on a phone". Keep, as the mock-up does.
  2. The ED desk New referral chip stays phone-only, never on the ED desk (earlier rule).
  3. Capacity's top drops the locked/open ready, pulled and freeing-today figures; they are still in the bed map and ward cards.
  4. Transport's act row reads "Most urgent · 6h 50m waiting", not "Longest wait", because the first row isn't the longest wait.
  5. On the officer's phone, Copy handover moves to the top chip row, reversing the 31 Oct decision.
  6. The On-call phone keeps "Prototype data, invented numbers".
  7. Legal forms phone route lines become one line with an ellipsis, reversing F-05.
  8. The TV keeps "Updates in this browser only" on wide screens.
  9. The Patient page keeps its mode pill and Placement steps toggle, and Settings keeps its Rules / Last save strip.
  10. An ED desk no longer sees a greyed Broadcast chip on Alerts.
  11. Some symbols are now unused but kept (for example DischargeBarrierBars, PhoneFocal, MidlandGlance); check:dead-code-candidate refuses them because they are under 30 days old. Follow-up clean-up.
  12. Pin on the patient page is a chip, not a pill, because the patient top already has a chip row.
  13. Out of scope here: other community teams keep the old top; the Referrals ward, ED, community and site desks keep old tops; the bar titles are cut on phone ("Bed meeting ag…").
  14. The phone Per day chip on Discharges shows 38 overdue beside the top's "40 dates overdue": the chart leaves out closed wards, as main's old card did.

🤖 Generated with Claude Code

https://claude.ai/code/session_01J352nkJHwYhzp9T5RP2HPg