Batch 5: counts, screens and print (items 1, 5, 29, 40, 42, 43; D-137)

Merged
BI
1d ago
+4120-469

Requested by josh · project thread

What this does

Feature build batch 5 from Josh's build plan, as one PR. Rulings are recorded as D-137 (including Josh's design approval and review answers on 11 Nov 2026).

  • Item 1, count leak (built first): the server holds the first paint unless the browser has said its desk is the whole-network coordinator's (wardflow-desk-held=0), so a ward desk never flashes network-wide counts. Changes H-0111 for a fresh device (a short loading page first). During the hold an empty sidebar shape keeps its place (shell/ward-rail-placeholder.tsx), so the page does not jump sideways. Back and Forward still return to the saved scroll place (marked from the Navigation API's navigate event, popstate as fallback).
  • Item 5, tap a number: hero figures on the coordinator, capacity and ward board screens open the list they were counted from. Each button is named by its own visible words (WCAG 2.5.3). The rows must add up to the figure or the panel says so. Aggregate (executive and statistics) views never list people at any count.
  • Item 29, Night view: new /ward-flow/night screen from the coordinator's More menu, with "Beds ready now" by ward in fixed order.
  • Item 40, patient or carer page: printable page naming only the receiving ward, hospital and its mock ward phone (from the on-call directory). Wording marked as draft pending consumer, carer and cultural review.
  • Item 42, desk QR code: Settings card drawing a QR code to the desk link with uqr 0.1.3 (one small dependency, approved in D-137).
  • Item 43, TV "Changed" marks: a TV tile shows "Changed 14:32" for 15 minutes (tvChangeMark, signed in clinical-values.md).

Evidence

Local, on head 3c15f57c6 unless noted. All passed.

  • node scripts/run-vitest.mjs run on the board, capacity, coordinator, hero, figure, home and count-breakdown DOM files: 107 files, 532 tests.
  • node scripts/run-vitest.mjs run tests/ward-load-no-flash-no-shift.dom.test.tsx tests/ward-access-first-paint.dom.test.tsx plus the rail, layout and import-map tests: 15 files, 99 tests.
  • node scripts/run-vitest.mjs run tests/ward-shell*.dom.test.tsx tests/ward-scroll-history.dom.test.tsx tests/ward-design-language-contract.test.ts: 4 files, 40 tests.
  • npx playwright test --project=chromium-mockups tests/ui-ward-responsive-audit.spec.ts -g "desktop Back returns": passes. It failed before the navigate fix.
  • npm run typecheck (8 GB). npx eslint on the changed files. npm run check:knip (no new unused items). node docs/ward-flow/journey/verify.mjs --check.
  • Layout shift on a fresh, held load of /ward-flow/wards and /ward-flow/statistics, measured with a Chromium PerformanceObserver at 1280×720 and Pixel 7: 0.21 without the sidebar placeholder, 0 with it.
  • Axe label-content-name-mismatch on /ward-flow/board/rph-adult-secure in Chromium at 390×844: no violations.
  • Not run locally: the WebKit phone release gate (WebKit is not installed in this environment). Hosted CI covers it.
  • Not caused by this PR: ui-ward-responsive-audit "keyboard search reveals the last result" fails on the local dev server even with the hold off. CI has not flagged it.

Integration update (11 Nov, head 31b60a88c)

main (3aa63c3) merged in; OWNER-RULINGS.md regenerated. The CodeRabbit review findings are fixed (see the replies on each thread). Local checks on this head, Node 24.22.1:

  • node scripts/run-vitest.mjs run <169 files>: the board, capacity, coordinator, hero, count, night, TV, settings, desk QR, first-paint, no-flash, shell, import-map, architecture and source-text test files. 169 files, 1251 tests passed.
  • npx tsc --noEmit -p . passed. npx eslint on the 21 changed files passed.
  • node docs/ward-flow/journey/verify.mjs --check passed. settings-screen.tsx's review digest was updated; only the QR card's props changed, and SET_CONFIGURATION behaviour is unchanged.
  • These checks passed: node scripts/ward-flow/owner-rulings-index.mjs --check, rules-index.mjs --check, screen-map.mjs --check, screen-verification.mjs --check, organisation.mjs --check --source working-tree, npm run docs:check-inventory, docs:check-links, check:knip, sitemap:check, check:ward-legal-language, scripts/run-tsx.mjs scripts/ward-flow/import-map.ts --check, check-policy-contracts.mjs and maintain-docs-and-organisation.mjs --pack-only --check.
  • Not run locally: npm run build with the script-budget check, and Playwright. Hosted CI covers both.

Boundaries

Synthetic data only. Design approval came from the batch 5 review page (D-74). Three files overlap with held PR #1599 by Josh's approval; this PR fixes any conflict.


Generated by Claude Code