From 042961940b177a5832ac0b0b03969c5fb80f5d36 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 07:56:51 +0000 Subject: [PATCH 1/6] On Call: four clear jobs, Refer inside Contacts, no link list on Now Tabs are Now, Contacts and Playbook, with the Handbook first in More. Contacts gains a Refer tab (the old Refer address lands there in the current work mode). Now drops the seven-link footer, keeps the shift lists inside the shift tools card, and shows each usual number. The Handbook holds Who's who and the Pocket card and folds its crisis lines like every other page. Handover and Check these get the normal band, and Check these becomes a compact list. No number, crisis line, step or caveat wording changed. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01TKaduMkUZJSfvFH9L1yWuz --- docs/on-call/design/mockup-conformance.md | 9 +- docs/site-map.md | 1 + src/app/(search-app)/on-call/refer/page.tsx | 8 +- src/components/on-call/call/call-page.tsx | 40 ++++----- src/components/on-call/find/find-page.tsx | 39 ++++++++- .../on-call/handover/handover-page.tsx | 7 +- .../on-call/now/shift-shortcuts.tsx | 82 +++++++++--------- src/components/on-call/now/systems-down.tsx | 3 + src/components/on-call/now/your-usual.tsx | 7 ++ src/components/on-call/on-call-check-page.tsx | 60 +++++++------ src/components/on-call/on-call-home.tsx | 13 ++- src/components/on-call/on-call-page-menu.tsx | 3 +- src/components/on-call/refer/refer-page.tsx | 70 +++++++++------ src/lib/work-frame/areas.ts | 85 ++++++++----------- tests/on-call-call-page.dom.test.tsx | 28 ++++-- tests/on-call-home.dom.test.tsx | 30 +++---- tests/on-call-hub-routes.dom.test.tsx | 6 +- tests/on-call-mockup-conformance.test.ts | 7 +- tests/on-call-now.dom.test.tsx | 29 +++---- tests/on-call-page-menu.dom.test.tsx | 5 +- tests/on-call-shift-shortcuts.dom.test.tsx | 4 +- tests/ui-on-call-boards.spec.ts | 26 +++--- tests/ui-on-call-call.spec.ts | 9 +- tests/ui-on-call-now.spec.ts | 2 +- tests/work-frame-navigation.test.ts | 7 +- 25 files changed, 337 insertions(+), 243 deletions(-) diff --git a/docs/on-call/design/mockup-conformance.md b/docs/on-call/design/mockup-conformance.md index 15a705324a..fe1f9a6da8 100644 --- a/docs/on-call/design/mockup-conformance.md +++ b/docs/on-call/design/mockup-conformance.md @@ -77,13 +77,14 @@ gate, and none was visible in the source: | Board | Element | Disposition | Where | Note | | -------------- | ------------------------------------------------------------------------------------- | ----------- | --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 01 Home | Universal header — page-actions ellipsis (hub) | deviation | on-call-page-menu-trigger | Replaced by the signed-in Needs you bell (`needs-you-bell`) before Search my work. Tools moved to More for this shift and in-page More on section pages. Signed-out homes hide the bell. | -| 01 Home | My shifts in More for this shift | built | on-call-now-footer-shifts | Relocated from the hub ellipsis. | -| 01 Home | Pocket card in More for this shift | built | on-call-now-footer-card | Relocated from the hub ellipsis. Also listed in the pages sheet. | -| 01 Home | Calendar in More for this shift | built | on-call-now-footer-calendar | Relocated from the hub ellipsis. | +| 01 Home | My shifts in More for this shift | deviation | on-call-now-footer-shifts | Left Now in the Work mode simplify plan (owner approval 12 Oct 2026): each row lives on the page that owns it (Roster, the Handbook, Starting here). | +| 01 Home | Pocket card in More for this shift | deviation | on-call-now-footer-card | Left Now in the Work mode simplify plan (owner approval 12 Oct 2026): each row lives on the page that owns it (Roster, the Handbook, Starting here). | +| 01 Home | Calendar in More for this shift | deviation | on-call-now-footer-calendar | Left Now in the Work mode simplify plan (owner approval 12 Oct 2026): each row lives on the page that owns it (Roster, the Handbook, Starting here). | | 01 Home | Hospital line — which hospital's numbers are on screen | built | on-call-now-hospital | Added after the drawing (v6 Now, plan C25). Board 01 Home is Now: the safety order leads with the hospital line, before anything else on the page. | | 01 Home | Emergency pin — the hospital's pinned Emergency: route | built | on-call-now-emergency | Added after the drawing (v6 Now, plan C25). Only site-named, clinical Emergency: entries qualify (at most three); with none recorded, one quiet `on-call-now-emergency-not-set-up` row says so (an editor's link opens that hospital in Service; a member is told to ask an editor) and the app never invents a number. Its space is reserved while a previously loaded hospital loads. | | 01 Home | Right now — the dark hero answering who covers this hour | built | on-call-now-right-now | Added after the drawing (v6 figure 03, plan C25). The hospital's switchboard until a hospital sets after-hours times (a Stage B field); "All roles" opens Call. | -| 01 Home | Footer group — Who do I call now, shift lists, Systems down, First night, On site | built | on-call-now-footer | Added after the drawing (v6 Now, plan C25). Shift lists and Systems down moved behind the mode button in the drawing; the page menu has no link slot yet, so they sit here instead. | +| 01 Home | Footer group — Who do I call now, shift lists, Systems down, First night, On site | deviation | on-call-now-footer | Left Now in the Work mode simplify plan (owner approval 12 Oct 2026): each row lives on the page that owns it (Roster, the Handbook, Starting here). | +| 01 Home | Shift tools — Log a call, Handover and the shift lists in one card | built | on-call-now-shift-tools | Work mode simplify plan (owner approval 12 Oct 2026): the shift lists, the one row kept from the footer, share the tools card. | | 01 Home | Section rail across the top | deviation | on-call-home-sections | The rail is gone. It listed the same nine pages the mode pill above it already opens — two controls doing one job — while nothing helped a reader move around the long page in front of them. The second row now navigates WITHIN the current page; the pill navigates between pages. | | 01 Home | Slot counts on the rail (`Contacts 42`) | deviation | — | `ModeNavItem.count` is documented as state, not size — never a catalogue total. There is no rail to carry them now either; the counts appear where the drawing also puts them, on the Home tiles. | | 01 Home | Shift module — site, hours, wards, progress bar | change-b | B: on_call_sites with shift_start, shift_end, wards | | diff --git a/docs/site-map.md b/docs/site-map.md index 54d3d538a9..2b49edc2b3 100644 --- a/docs/site-map.md +++ b/docs/site-map.md @@ -1619,6 +1619,7 @@ This file is generated by `npm run docs:update` (or `npm run sitemap:update` dir - `/dictionary/browse` - Redirects to `/dictionary/search`. Source: `src/app/(search-app)/dictionary/browse/page.tsx`. - `/sources` - Redirects to `/?mode=sources`. Source: `src/app/(search-app)/sources/page.tsx`. - `/dsm` - Redirects to `/?mode=dsm`. Source: `src/app/(search-app)/dsm/page.tsx`. +- `/on-call/refer` - Redirects to `/on-call/call?show=refer`. Source: `src/app/(search-app)/on-call/refer/page.tsx`. - `/specifiers` - Redirects to `/?mode=specifiers`. Source: `src/app/(search-app)/specifiers/page.tsx`. - `/services` - Redirects to `/?mode=services`. Source: `src/app/(search-app)/services/page.tsx`. - `/my-day` - Redirects to `/my-day/notifications`. Source: `src/app/(search-app)/my-day/page.tsx`. diff --git a/src/app/(search-app)/on-call/refer/page.tsx b/src/app/(search-app)/on-call/refer/page.tsx index eb8da0faac..22f05933de 100644 --- a/src/app/(search-app)/on-call/refer/page.tsx +++ b/src/app/(search-app)/on-call/refer/page.tsx @@ -1,12 +1,18 @@ import type { Metadata } from "next"; +import { redirect } from "next/navigation"; import { OnCallReferPage } from "@/components/on-call/refer/refer-page"; +import { getWorkModeLaunch } from "@/lib/work-mode-launch/server"; export const metadata: Metadata = { title: "Refer | On Call | PsychSift", description: "How to refer to each service at your hospital, and your own referral notes.", }; -export default function OnCallReferRoute() { +// Refer is a tab of Contacts in the current work mode (Work mode simplify plan, owner approval +// 12 Oct 2026), so one search covers numbers and referrals. The classic work mode (the rollback) +// keeps its own Refer page. +export default async function OnCallReferRoute() { + if ((await getWorkModeLaunch()).newWorkMode) redirect("/on-call/call?show=refer"); return ; } diff --git a/src/components/on-call/call/call-page.tsx b/src/components/on-call/call/call-page.tsx index 20edbc365f..cc02aa3792 100644 --- a/src/components/on-call/call/call-page.tsx +++ b/src/components/on-call/call/call-page.tsx @@ -2,7 +2,7 @@ import { currentCover } from "@/lib/on-call/service-availability"; import { useHospitalClock } from "@/components/on-call/use-hospital-clock"; -import { ListChecks, Phone, Plus, Printer, Shield, Users } from "lucide-react"; +import { ListChecks, Phone, Plus, Shield } from "lucide-react"; import dynamic from "next/dynamic"; import Link from "next/link"; import { useRouter } from "next/navigation"; @@ -38,6 +38,7 @@ import { modeInsetHairline, modeRowHeight } from "@/components/mode-kit/recipes" import { modeSecondaryText } from "@/components/mode-kit/type"; import { onCallGroupAnchorId } from "@/components/on-call/on-call-page-anchors"; import { useHospitalHandbook, type HospitalHandbookState } from "@/components/on-call/use-hospital-handbook"; +import { OnCallReferSections } from "@/components/on-call/refer/refer-page"; import { SegmentedControl } from "@/components/ui/segmented-control"; import { SearchField } from "@/components/ui/text-field"; import { cn } from "@/components/ui-primitives"; @@ -71,14 +72,24 @@ export const ON_CALL_OLD_HANDOVER_HASH = "#on-call-handover-heading"; const noSubscription = () => () => {}; -type PeopleTab = "hospital" | "outside" | "mine"; +type PeopleTab = "hospital" | "refer" | "outside" | "mine"; +// Contacts holds Refer as a tab (Work mode simplify plan, owner approval 12 Oct 2026): one place for +// "who and where", with one search box across numbers and referrals. Short labels fit four at 320px. const PEOPLE_TABS: readonly { value: PeopleTab; label: string }[] = [ { value: "hospital", label: "Hospital" }, - { value: "outside", label: "Outside lines" }, + { value: "refer", label: "Refer" }, + { value: "outside", label: "Outside" }, { value: "mine", label: "Mine" }, ]; +/** The tab an address asks for: `/on-call/call?show=refer` opens Refer (the old Refer page lands there). */ +function initialPeopleTab(): PeopleTab { + if (typeof window === "undefined") return "hospital"; + const asked = new URLSearchParams(window.location.search).get("show"); + return PEOPLE_TABS.some((option) => option.value === asked) ? (asked as PeopleTab) : "hospital"; +} + function hospitalName(handbook: HospitalHandbookState): string | null { return handbook.siteName ?? handbook.serviceName; } @@ -265,6 +276,9 @@ export function OnCallCallPage() { const hospitalPhone = useOnCallHospitalPhone(); const [query, setQuery] = useState(""); const [tab, setTab] = useState("hospital"); + // Read after hydration, so the server and the first client render agree. + // eslint-disable-next-line react-hooks/set-state-in-effect + useEffect(() => setTab(initialPeopleTab()), []); const [adding, setAdding] = useState(false); const [clock, setClock] = useState(() => new Date()); // The time in "Cover as of 21:40" is drawn after hydration only, so the server's minute never mismatches the phone's. @@ -409,7 +423,7 @@ export function OnCallCallPage() {
setQuery(event.target.value)} onClear={() => setQuery("")} @@ -457,7 +471,7 @@ export function OnCallCallPage() {
{searching && resultCount === 0 ? (

- {`Nothing matches "${query.trim()}".`} + {`No numbers match "${query.trim()}".`} {ready ? "" : " The hospital's numbers have not loaded, so only outside lines and your own were searched."}

) : null} @@ -549,6 +563,8 @@ export function OnCallCallPage() { ) : null} + + {searching || tab === "refer" ? : null}
{searching ? null : ( @@ -559,20 +575,6 @@ export function OnCallCallPage() {
    -