Skip to content

Cancer Board V2 Implementation Plan

For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.

Goal: Rebuild the Cancer at Home board around action-led Cancer Board V2 sections while preserving the existing 8-spoke radar interaction, geometry, and date-scoped persistence.

Architecture: Add a small pure model layer that derives V2 sections from the existing HubState, then render those sections as focused presentational components inside CareBoardPage.tsx. Keep current APIs, current comfort-checkin persistence, CancerComfortRadar*, and radarTapGeometry.ts unchanged in Phase 1.

Tech Stack: React 19, TypeScript, Vite, Vitest, Tailwind utility classes, existing care-module hooks and components.


  • Do not edit frontend/src/care-modules/cancer/components/CancerComfortRadarChart.tsx.
  • Do not edit frontend/src/care-modules/cancer/components/CancerComfortRadar.tsx except copy-only wrapper text if unavoidable.
  • Do not edit frontend/src/care-modules/cancer/radarTapGeometry.ts.
  • Do not change comfort-checkin API calls, care_date, or capture_instance_id semantics.
  • Keep the route /care/cancer-at-home.
  • Keep care module feature flags unchanged.
  • Treat “Daily cancer status” as the UI label even if internal filenames still contain Comfort to avoid risky churn.

  • Create: frontend/src/care-modules/cancer/cancerBoardV2Model.ts
  • Create: frontend/src/test/lib/cancerBoardV2Model.test.ts
  • Create: frontend/src/care-modules/cancer/components/CancerStatusSummary.tsx
  • Create: frontend/src/care-modules/cancer/components/CancerTodayPlan.tsx
  • Create: frontend/src/care-modules/cancer/components/CancerWatchClosely.tsx
  • Create: frontend/src/care-modules/cancer/components/CancerActivatedAcrossLynCareOS.tsx
  • Create: frontend/src/care-modules/cancer/components/CancerClinicHandover.tsx
  • Modify: frontend/src/care-modules/cancer/components/BecauseLine.tsx
  • Modify: frontend/src/care-modules/cancer/components/InlineComfortCheckIn.tsx
  • Modify: frontend/src/care-modules/cancer/cancerCareFlow.ts
  • Modify: frontend/src/care-modules/cancer/CareBoardPage.tsx

Files:

  • Create: frontend/src/care-modules/cancer/cancerBoardV2Model.ts

  • Test: frontend/src/test/lib/cancerBoardV2Model.test.ts

  • Step 1: Create the pure model file

Create frontend/src/care-modules/cancer/cancerBoardV2Model.ts with these exported types and builders:

import type { HubTile } from './cancerBoardVisual'
export type CancerBoardV2Hub = {
settings?: Record<string, unknown>
today?: {
day_type?: string
effective_day_type?: string
day_label?: string
site_label?: string | null
gentle_mode?: boolean
treatment_modes?: string[]
calendar_suggested_day_type?: string | null
}
comfort_override?: { title: string; body: string } | null
primary_cta?: { label?: string; hint?: string; session_id?: string | null; route?: string }
metrics?: { symptom_bundle_due?: boolean }
alerts?: Array<{ id?: string; label: string; severity: string }>
tiles?: HubTile[]
breakthrough_log_route?: string
}
export type CancerPlanStep = {
id: string
title: string
body: string
actionLabel: string
kind: 'session' | 'route' | 'expand' | 'settings'
sessionId?: string
route?: string
expandSection?: string
tone?: 'green' | 'amber' | 'red' | 'neutral'
}
export type CancerWatchItem = {
id: string
label: string
detail: string
actionLabel: string
action: 'record' | 'review' | 'visit_prep' | 'configure'
tone?: 'green' | 'amber' | 'red' | 'neutral'
}
export type CancerActivationItem = {
id: string
area: string
enabled: string[]
nextBuild?: string
}
export type CancerClinicLine = {
id: string
text: string
tone?: 'green' | 'amber' | 'red' | 'neutral'
}
const dayPlanLabels: Record<string, string> = {
infusion: 'Infusion visit preparation',
chair_day: 'Infusion visit preparation',
tablet_day: 'Oral cancer medicine safety',
clinic_day: 'Clinic review preparation',
review: 'Clinic review preparation',
rest: 'Daily cancer status and watch list',
none: 'Daily cancer care check',
}
export function buildStatusReason(hub: CancerBoardV2Hub | null, zoneLabel: string): string {
if (!hub) return zoneLabel
const red = (hub.alerts ?? []).find(a => a.severity === 'red')
if (red) return red.label
const amber = (hub.alerts ?? []).find(a => a.severity === 'amber')
if (amber) return amber.label
if (hub.metrics?.symptom_bundle_due) return 'Daily cancer status is due'
return zoneLabel || 'No urgent cancer alerts recorded'
}
export function buildTodayPlan(hub: CancerBoardV2Hub | null): CancerPlanStep[] {
if (!hub) return []
const effectiveDay = hub.today?.effective_day_type ?? hub.today?.day_type ?? 'none'
const primary = hub.primary_cta
const steps: CancerPlanStep[] = [
{
id: 'daily_status',
title: 'Daily cancer status',
body: 'Record today’s picture: energy, pain, eating, breath, mood, sleep, fever signs, and treatment tasks.',
actionLabel: hub.metrics?.symptom_bundle_due ? 'Record status' : 'Review status',
kind: 'expand',
expandSection: 'daily_status',
tone: hub.metrics?.symptom_bundle_due ? 'amber' : 'green',
},
]
if (primary?.session_id && !['cancer_symptom_bundle', 'comfort_round'].includes(primary.session_id)) {
steps.unshift({
id: `session_${primary.session_id}`,
title: dayPlanLabels[effectiveDay] ?? primary.label ?? 'Today’s cancer task',
body: primary.hint ?? 'Complete the treatment-specific task for today.',
actionLabel: primary.label ?? 'Continue',
kind: 'session',
sessionId: primary.session_id,
tone: 'amber',
})
} else if (primary?.route) {
steps.unshift({
id: `route_${primary.route}`,
title: dayPlanLabels[effectiveDay] ?? primary.label ?? 'Clinic review preparation',
body: primary.hint ?? 'Prepare notes and records for the next clinical contact.',
actionLabel: primary.label ?? 'Open',
kind: 'route',
route: primary.route,
tone: 'neutral',
})
} else {
steps.unshift({
id: 'care_plan_default',
title: dayPlanLabels[effectiveDay] ?? 'Today’s cancer care plan',
body: hub.today?.day_label
? `${hub.today.day_label}: start with the daily status, then review anything that needs watching.`
: 'Start with the daily status, then review anything that needs watching.',
actionLabel: 'Start with daily status',
kind: 'expand',
expandSection: 'daily_status',
tone: 'neutral',
})
}
if (hub.today?.calendar_suggested_day_type && hub.today?.day_type === 'none') {
steps.push({
id: 'calendar_suggestion',
title: 'Calendar suggests a cancer task today',
body: 'An oncology appointment is on the calendar. Set today’s care plan from the calendar suggestion.',
actionLabel: 'Apply calendar suggestion',
kind: 'settings',
tone: 'amber',
})
}
return steps
}
export function buildWatchItems(hub: CancerBoardV2Hub | null): CancerWatchItem[] {
const items: CancerWatchItem[] = [
{
id: 'breakthrough_pain',
label: 'Breakthrough pain',
detail: hub?.breakthrough_log_route ? 'Log rescue or breakthrough dose if prescribed.' : 'Review pain and add a note for clinic if it changed.',
actionLabel: hub?.breakthrough_log_route ? 'Record' : 'Review',
action: hub?.breakthrough_log_route ? 'record' : 'review',
tone: 'amber',
},
{
id: 'fever',
label: 'Fever and infection signs',
detail: 'Temperature and fever symptoms matter during treatment.',
actionLabel: 'Record',
action: 'record',
tone: 'red',
},
{
id: 'intake_output',
label: 'Eating, fluids, urine, and bowel',
detail: 'Cancer Board V2 should link to Measurements for fluids, urine colour/volume, and stool/bowel changes.',
actionLabel: 'Add to measurements',
action: 'configure',
tone: 'neutral',
},
]
const site = String(hub?.settings?.cancer_primary_site ?? '').toLowerCase()
if (site === 'brain') {
items.push({
id: 'neuro',
label: 'Neuro changes',
detail: 'Watch headache, confusion, weakness, speech, vision, or seizure change.',
actionLabel: 'Add to visit prep',
action: 'visit_prep',
tone: 'red',
})
}
if (site === 'lung' || hub?.today?.treatment_modes?.includes('oxygen')) {
items.push({
id: 'oxygen',
label: 'Oxygen or breathing equipment',
detail: 'If oxygen is used, record equipment type, flow, hours, and supply status.',
actionLabel: 'Configure equipment',
action: 'configure',
tone: 'neutral',
})
}
return items
}
export function buildActivationItems(hub: CancerBoardV2Hub | null): CancerActivationItem[] {
const site = String(hub?.settings?.cancer_primary_site ?? '')
return [
{
id: 'measurements',
area: 'Measurements',
enabled: ['Daily cancer status', 'temperature', 'fluids', 'pain', 'nausea'],
nextBuild: 'Urine volume/colour and stool/bowel capture instruments',
},
{
id: 'pain',
area: 'Pain & body',
enabled: ['Breakthrough pain', 'pain trend', site === 'brain' ? 'neuro watch' : 'site-specific watch'],
nextBuild: 'Body/neuro map for cancer-specific pain and weakness',
},
{
id: 'orders',
area: 'Medicines & therapies',
enabled: ['PRN log', 'oral cancer medicine safety', 'antiemetics/steroids where configured'],
nextBuild: 'Care Orders layer for pumps, oxygen, feeds, and equipment settings',
},
{
id: 'clinic',
area: 'Clinic and handover',
enabled: ['Visit prep', 'open questions', 'recent changes'],
nextBuild: 'Shift handover sentence from the same records',
},
]
}
export function buildClinicLines(hub: CancerBoardV2Hub | null, zoneLabel: string): CancerClinicLine[] {
const lines: CancerClinicLine[] = [
{ id: 'status', text: `Current board status: ${buildStatusReason(hub, zoneLabel)}.` },
]
if (hub?.metrics?.symptom_bundle_due) {
lines.push({ id: 'daily_status_due', text: 'Daily cancer status has not been saved for today.', tone: 'amber' })
}
if (hub?.today?.site_label) {
lines.push({ id: 'site', text: `Cancer site context: ${hub.today.site_label}.` })
}
lines.push({ id: 'visit_prep', text: 'Use visit prep to collect questions and the last 7 days before clinic.' })
return lines
}
  • Step 2: Add unit tests for model rules

Create frontend/src/test/lib/cancerBoardV2Model.test.ts:

import { describe, expect, it } from 'vitest'
import {
buildActivationItems,
buildClinicLines,
buildStatusReason,
buildTodayPlan,
buildWatchItems,
type CancerBoardV2Hub,
} from '../../care-modules/cancer/cancerBoardV2Model'
describe('cancerBoardV2Model', () => {
it('puts treatment-specific session before daily status', () => {
const hub: CancerBoardV2Hub = {
today: { day_type: 'infusion', effective_day_type: 'infusion', day_label: 'Infusion day' },
primary_cta: {
session_id: 'chair_day_ack',
label: 'Start infusion preparation',
hint: 'Check labs, transport, packing, and post-visit tasks.',
},
metrics: { symptom_bundle_due: true },
}
const plan = buildTodayPlan(hub)
expect(plan[0]).toMatchObject({
id: 'session_chair_day_ack',
title: 'Infusion visit preparation',
kind: 'session',
sessionId: 'chair_day_ack',
})
expect(plan[1]).toMatchObject({ id: 'daily_status', title: 'Daily cancer status' })
})
it('uses alerts before generic status reason', () => {
const hub: CancerBoardV2Hub = {
alerts: [{ severity: 'amber', label: 'Daily cancer status is due' }],
metrics: { symptom_bundle_due: true },
}
expect(buildStatusReason(hub, 'Cancer at Home')).toBe('Daily cancer status is due')
})
it('adds neuro watch for brain cancer site', () => {
const hub: CancerBoardV2Hub = { settings: { cancer_primary_site: 'brain' } }
expect(buildWatchItems(hub).some(item => item.id === 'neuro')).toBe(true)
})
it('describes cross-app activations', () => {
const items = buildActivationItems({ settings: { cancer_primary_site: 'brain' } })
expect(items.map(item => item.area)).toEqual([
'Measurements',
'Pain & body',
'Medicines & therapies',
'Clinic and handover',
])
expect(items[0].nextBuild).toContain('Urine')
})
it('builds clinic lines from status and site context', () => {
const lines = buildClinicLines({
today: { site_label: 'Brain cancer' },
metrics: { symptom_bundle_due: true },
}, 'Cancer at Home')
expect(lines.map(line => line.id)).toContain('daily_status_due')
expect(lines.map(line => line.id)).toContain('site')
})
})
  • Step 3: Run focused tests

Run:

Terminal window
cd D:\Projects\LynCareOS\frontend
npm test -- cancerBoardV2Model

Expected: Vitest reports the new cancerBoardV2Model tests passing.


Files:

  • Create: frontend/src/care-modules/cancer/components/CancerStatusSummary.tsx

  • Create: frontend/src/care-modules/cancer/components/CancerTodayPlan.tsx

  • Create: frontend/src/care-modules/cancer/components/CancerWatchClosely.tsx

  • Create: frontend/src/care-modules/cancer/components/CancerActivatedAcrossLynCareOS.tsx

  • Create: frontend/src/care-modules/cancer/components/CancerClinicHandover.tsx

  • Step 1: Add status summary

Create CancerStatusSummary.tsx:

type Props = {
zone: string
title: string
reason: string
}
function toneClass(zone: string): string {
if (zone === 'red') return 'border-rose-300 bg-rose-50 text-rose-950 dark:border-rose-800 dark:bg-rose-950/30 dark:text-rose-100'
if (zone === 'amber') return 'border-amber-300 bg-amber-50 text-amber-950 dark:border-amber-800 dark:bg-amber-950/30 dark:text-amber-100'
return 'border-emerald-300 bg-emerald-50 text-emerald-950 dark:border-emerald-800 dark:bg-emerald-950/30 dark:text-emerald-100'
}
export default function CancerStatusSummary({ zone, title, reason }: Props) {
return (
<section className={`rounded-2xl border px-3 py-3 space-y-1.5 ${toneClass(zone)}`} aria-label="Cancer board status">
<p className="text-[10px] font-semibold uppercase tracking-wider opacity-75">Status</p>
<h2 className="text-sm font-semibold leading-tight">{title}</h2>
<p className="text-xs leading-snug opacity-90">{reason}</p>
</section>
)
}
  • Step 2: Add today’s plan

Create CancerTodayPlan.tsx:

import type { CancerPlanStep } from '../cancerBoardV2Model'
type Props = {
steps: CancerPlanStep[]
disabled?: boolean
onSession: (sessionId: string) => void
onRoute: (route: string) => void
onExpand: (section: string) => void
onApplyCalendarSuggestion?: () => void
}
function toneDot(tone?: CancerPlanStep['tone']): string {
if (tone === 'red') return 'bg-rose-500'
if (tone === 'amber') return 'bg-amber-500'
if (tone === 'green') return 'bg-emerald-500'
return 'bg-brand-500'
}
export default function CancerTodayPlan({
steps,
disabled,
onSession,
onRoute,
onExpand,
onApplyCalendarSuggestion,
}: Props) {
if (steps.length === 0) return null
return (
<section className="cc-card p-4 space-y-3" aria-label="Today's cancer care plan">
<div>
<p className="text-[10px] font-semibold uppercase tracking-wider text-muted">Today’s cancer care plan</p>
<h2 className="text-base font-semibold text-ink dark:text-white">What needs doing today</h2>
</div>
<div className="space-y-2">
{steps.map((step, index) => (
<article key={step.id} className="rounded-xl border border-border/80 px-3 py-3 bg-white/60 dark:bg-slate-900/40">
<div className="flex gap-2.5">
<span className={`mt-1 h-2.5 w-2.5 shrink-0 rounded-full ${toneDot(step.tone)}`} aria-hidden />
<div className="min-w-0 flex-1 space-y-2">
<div>
<p className="text-[10px] font-semibold uppercase tracking-wider text-muted">Step {index + 1}</p>
<h3 className="text-sm font-semibold leading-tight">{step.title}</h3>
<p className="mt-1 text-xs text-muted leading-snug">{step.body}</p>
</div>
<button
type="button"
disabled={disabled}
className="cc-btn-soft text-xs !min-h-[34px] !px-3"
onClick={() => {
if (step.kind === 'session' && step.sessionId) onSession(step.sessionId)
if (step.kind === 'route' && step.route) onRoute(step.route)
if (step.kind === 'expand' && step.expandSection) onExpand(step.expandSection)
if (step.kind === 'settings') onApplyCalendarSuggestion?.()
}}
>
{step.actionLabel}
</button>
</div>
</div>
</article>
))}
</div>
</section>
)
}
  • Step 3: Add watch closely

Create CancerWatchClosely.tsx:

import type { CancerWatchItem } from '../cancerBoardV2Model'
type Props = {
items: CancerWatchItem[]
onVisitPrep: () => void
}
function toneClass(tone?: CancerWatchItem['tone']): string {
if (tone === 'red') return 'bg-rose-100 text-rose-900 dark:bg-rose-950/40 dark:text-rose-200'
if (tone === 'amber') return 'bg-amber-100 text-amber-900 dark:bg-amber-950/40 dark:text-amber-200'
if (tone === 'green') return 'bg-emerald-100 text-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-200'
return 'bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-200'
}
export default function CancerWatchClosely({ items, onVisitPrep }: Props) {
if (items.length === 0) return null
return (
<section className="cc-card p-4 space-y-3" aria-label="Watch closely">
<div>
<p className="text-[10px] font-semibold uppercase tracking-wider text-muted">Watch closely</p>
<h2 className="text-base font-semibold text-ink dark:text-white">Records and risks to keep visible</h2>
</div>
<div className="space-y-2">
{items.map(item => (
<div key={item.id} className="rounded-xl border border-border/80 px-3 py-2.5">
<div className="flex items-start justify-between gap-3">
<div className="min-w-0">
<p className="text-sm font-semibold leading-tight">{item.label}</p>
<p className="mt-0.5 text-xs text-muted leading-snug">{item.detail}</p>
</div>
<span className={`shrink-0 rounded-full px-2 py-0.5 text-[10px] font-semibold ${toneClass(item.tone)}`}>
{item.actionLabel}
</span>
</div>
{item.action === 'visit_prep' ? (
<button type="button" className="mt-2 text-xs font-semibold text-brand-700 dark:text-brand-300" onClick={onVisitPrep}>
Add to visit prep
</button>
) : null}
</div>
))}
</div>
</section>
)
}
  • Step 4: Add activated-across-LynCareOS

Create CancerActivatedAcrossLynCareOS.tsx:

import type { CancerActivationItem } from '../cancerBoardV2Model'
type Props = {
items: CancerActivationItem[]
}
export default function CancerActivatedAcrossLynCareOS({ items }: Props) {
if (items.length === 0) return null
return (
<section className="cc-card p-4 space-y-3" aria-label="Activated across LynCareOS">
<div>
<p className="text-[10px] font-semibold uppercase tracking-wider text-muted">Activated across LynCareOS</p>
<h2 className="text-base font-semibold text-ink dark:text-white">What this profile turns on</h2>
</div>
<div className="grid gap-2 sm:grid-cols-2">
{items.map(item => (
<article key={item.id} className="rounded-xl border border-border/80 px-3 py-3">
<h3 className="text-sm font-semibold">{item.area}</h3>
<p className="mt-1 text-xs text-muted leading-snug">{item.enabled.join(', ')}</p>
{item.nextBuild ? (
<p className="mt-2 text-[11px] leading-snug text-muted">
Next build: {item.nextBuild}
</p>
) : null}
</article>
))}
</div>
</section>
)
}
  • Step 5: Add clinic and handover

Create CancerClinicHandover.tsx:

import { Link } from 'react-router-dom'
import type { CancerClinicLine } from '../cancerBoardV2Model'
type Props = {
lines: CancerClinicLine[]
visitPrepRoute: string
}
export default function CancerClinicHandover({ lines, visitPrepRoute }: Props) {
return (
<section className="cc-card p-4 space-y-3" aria-label="Clinic and handover">
<div>
<p className="text-[10px] font-semibold uppercase tracking-wider text-muted">Clinic and handover</p>
<h2 className="text-base font-semibold text-ink dark:text-white">Turn daily records into the next conversation</h2>
</div>
<ul className="space-y-1.5">
{lines.map(line => (
<li key={line.id} className="text-xs text-muted leading-snug flex gap-2">
<span className="mt-1.5 h-1.5 w-1.5 rounded-full bg-brand-500 shrink-0" aria-hidden />
<span>{line.text}</span>
</li>
))}
</ul>
<Link to={visitPrepRoute} className="cc-btn-primary text-xs !min-h-[38px] !px-4 inline-flex">
Open visit prep
</Link>
</section>
)
}
  • Step 6: Run TypeScript build check

Run:

Terminal window
cd D:\Projects\LynCareOS\frontend
npm run build

Expected: Build succeeds. If there are unused imports, fix them before continuing.


Task 3: Rename Radar Surrounding Copy Without Changing Radar Mechanics

Section titled “Task 3: Rename Radar Surrounding Copy Without Changing Radar Mechanics”

Files:

  • Modify: frontend/src/care-modules/cancer/components/BecauseLine.tsx

  • Modify: frontend/src/care-modules/cancer/components/InlineComfortCheckIn.tsx

  • Modify: frontend/src/care-modules/cancer/cancerCareFlow.ts

  • Step 1: Allow the insight label to be explicit

Modify BecauseLine.tsx:

type Props = {
text: string
className?: string
label?: string
}
/** One-line implication after a capture step. */
export default function BecauseLine({ text, className = '', label = 'What this tells us' }: Props) {
if (!text) return null
return (
<p
className={[
'text-[11px] leading-snug text-muted border-l-2 border-brand-300/70 pl-2 dark:border-brand-700',
className,
].join(' ')}
>
<span className="font-semibold text-ink/80 dark:text-slate-300">{label}: </span>
{text}
</p>
)
}
  • Step 2: Update InlineComfortCheckIn UI labels

In InlineComfortCheckIn.tsx:

  • Change aria-label="Comfort check-in" to aria-label="Daily cancer status".
  • Change button copy Complete check-in to Save daily status.
  • Change saved hint to Saved for this day. Tap any dot on the chart to change a score.
  • Keep the existing import path and CancerComfortRadar usage unchanged.

Expected relevant JSX:

<section
className={[
'rounded-2xl border px-3 py-3 sm:px-4 space-y-3',
due && !done
? 'border-brand-200/80 bg-gradient-to-b from-brand-50/50 to-canvas dark:from-brand-950/25 dark:to-slate-950/40 dark:border-brand-800/60'
: 'border-border bg-canvas',
].join(' ')}
aria-label="Daily cancer status"
>
<button
type="button"
disabled={busy || disabled}
onClick={() => { void handleFinish() }}
className="w-full rounded-xl py-2.5 text-xs font-semibold transition-all cc-btn-primary !min-h-[40px]"
>
Save daily status
</button>
  • Step 3: Update care-flow copy

In cancerCareFlow.ts, change only strings:

id: 'check_in',
label: 'Daily cancer status',
shortLabel: 'Status',

In resolveNextFork, update the expand fallback:

return {
id: 'other_cancer_tasks',
prompt: 'Anything else in today’s cancer care plan?',
primaryLabel: 'Open other cancer tasks',
kind: 'expand',
expandSection: 'more_today',
}
  • Step 4: Run focused tests and build

Run:

Terminal window
cd D:\Projects\LynCareOS\frontend
npm test -- cancerBoardV2Model
npm run build

Expected: tests pass and build succeeds.


Task 4: Wire Cancer Board V2 Sections Into CareBoardPage.tsx

Section titled “Task 4: Wire Cancer Board V2 Sections Into CareBoardPage.tsx”

Files:

  • Modify: frontend/src/care-modules/cancer/CareBoardPage.tsx

  • Step 1: Import model builders and components

Add imports near existing cancer component imports:

import {
buildActivationItems,
buildClinicLines,
buildStatusReason,
buildTodayPlan,
buildWatchItems,
} from './cancerBoardV2Model'
import CancerActivatedAcrossLynCareOS from './components/CancerActivatedAcrossLynCareOS'
import CancerClinicHandover from './components/CancerClinicHandover'
import CancerStatusSummary from './components/CancerStatusSummary'
import CancerTodayPlan from './components/CancerTodayPlan'
import CancerWatchClosely from './components/CancerWatchClosely'
  • Step 2: Derive V2 model values

After hubAlerts / existing derived values, add:

const statusReason = useMemo(
() => buildStatusReason(hub, zoneLabel),
[hub, zoneLabel],
)
const todayPlanSteps = useMemo(
() => buildTodayPlan(hub),
[hub],
)
const watchItems = useMemo(
() => buildWatchItems(hub),
[hub],
)
const activationItems = useMemo(
() => buildActivationItems(hub),
[hub],
)
const clinicLines = useMemo(
() => buildClinicLines(hub, zoneLabel),
[hub, zoneLabel],
)
  • Step 3: Add helper handlers

Add handlers near handleForkAction:

const handleV2Expand = useCallback((section: string) => {
if (section === 'daily_status') {
document.getElementById('daily-cancer-status')?.scrollIntoView({ behavior: 'smooth', block: 'start' })
return
}
if (section === 'more_today') {
setMoreTodayOpen(true)
window.setTimeout(() => {
document.getElementById('other-cancer-tasks')?.scrollIntoView({ behavior: 'smooth', block: 'start' })
}, 0)
}
}, [])
const handleApplyCalendarSuggestion = useCallback(() => {
if (!hub?.today?.calendar_suggested_day_type) return
void patchSettings({ today_day_type: hub.today.calendar_suggested_day_type })
}, [hub?.today?.calendar_suggested_day_type, patchSettings])
  • Step 4: Replace top zone chip rendering with status summary

Remove the small inline zone chip block under the header and render:

<CancerStatusSummary
zone={zone}
title={zoneLabel}
reason={statusReason}
/>
  • Step 5: Render Today’s cancer care plan before the date strip

Inside the hub && <>...</> block, before the date strip or immediately after alerts, render:

<CancerTodayPlan
steps={todayPlanSteps}
disabled={patchBusy}
onSession={openSession}
onRoute={route => navigate(route)}
onExpand={handleV2Expand}
onApplyCalendarSuggestion={handleApplyCalendarSuggestion}
/>

If keeping the date strip above the plan feels safer on mobile, render the plan immediately after CancerComfortDateStrip, but it must appear before the radar.

  • Step 6: Wrap the existing radar block with the new section label

Add a div wrapper around the existing InlineComfortCheckIn area:

<section id="daily-cancer-status" className="space-y-2 scroll-mt-20" aria-label="Daily cancer status section">
<div className="px-1">
<p className="text-[10px] font-semibold uppercase tracking-wider text-muted">Daily cancer status</p>
<h2 className="text-base font-semibold text-ink dark:text-white">Record today’s cancer picture</h2>
<p className="mt-1 text-xs text-muted leading-snug">
These eight areas help build the home story: energy, pain, eating, breath, mood, sleep, fever signs, and treatment tasks.
</p>
</div>
{/* existing InlineComfortCheckIn conditional stays here */}
</section>

Do not move code inside InlineComfortCheckIn other than the copy changes from Task 3.

  • Step 7: Rename and keep current task tiles

Change the current CollapsibleSection title from More for today to Other cancer tasks today. Add id="other-cancer-tasks" to the wrapper around that section.

Expected wrapper:

<div id="other-cancer-tasks" className="scroll-mt-20">
<CollapsibleSection
title="Other cancer tasks today"
open={moreTodayOpen}
onOpenChange={setMoreTodayOpen}
>
{/* existing tile grid */}
</CollapsibleSection>
</div>
  • Step 8: Render Watch closely, Activated, Clinic/Handover

After existing tiles/settings sections, render:

<CancerWatchClosely
items={watchItems}
onVisitPrep={() => navigate('/care/cancer-at-home/visit-prep')}
/>
<CancerActivatedAcrossLynCareOS items={activationItems} />
<CancerClinicHandover
lines={clinicLines}
visitPrepRoute="/care/cancer-at-home/visit-prep"
/>
  • Step 9: Remove duplicate calendar suggestion copy

If CancerTodayPlan now renders the calendar suggestion, remove or hide the old button text:

Calendar today → ... Tap to set Today is…

The V2 wording should be:

Calendar suggests a cancer task today
  • Step 10: Run tests and build

Run:

Terminal window
cd D:\Projects\LynCareOS\frontend
npm test -- cancerBoardV2Model
npm run build

Expected: tests pass and build succeeds.


Files: none unless smoke test reveals defects.

  • Step 1: Start the app if needed

Run:

Terminal window
cd D:\Projects\LynCareOS\frontend
npm run dev

Expected: Vite serves the app. Use an existing running dev server if one is already present.

  • Step 2: Visit Cancer board

Open the app in a browser and navigate to:

/care/cancer-at-home

Expected visible order on mobile width:

  1. Header with person and Cancer at Home.
  2. Status summary.
  3. Today’s cancer care plan.
  4. Date strip.
  5. Daily cancer status radar.
  6. Other cancer tasks today.
  7. Watch closely.
  8. Activated across LynCareOS.
  9. Clinic and handover.
  • Step 3: Verify radar unchanged

Manually verify:

  • radar still displays all 8 spokes,

  • tapping dots changes scores,

  • Save daily status completes the date-scoped record,

  • past-average overlay still appears when data exists,

  • no visual/tap geometry regression.

  • Step 4: Verify plan actions

Manually verify:

  • treatment-specific card starts a session when primary_cta.session_id is non-check-in,
  • route card navigates when primary_cta.route is present,
  • “Record status” scrolls to the radar,
  • “Other cancer tasks today” expands and scrolls to current tiles.

Files: all changed frontend files.

  • Step 1: Run lints for edited files

Use Cursor lints or run:

Terminal window
cd D:\Projects\LynCareOS\frontend
npm run lint -- src/care-modules/cancer src/test/lib/cancerBoardV2Model.test.ts

Expected: no new lint errors in edited Cancer files.

  • Step 2: Run full frontend build

Run:

Terminal window
cd D:\Projects\LynCareOS\frontend
npm run build

Expected: TypeScript and Vite build complete.

  • Step 3: Confirm files protected by non-negotiables are unchanged

Run:

Terminal window
cd D:\Projects\LynCareOS
git diff -- frontend/src/care-modules/cancer/components/CancerComfortRadarChart.tsx frontend/src/care-modules/cancer/radarTapGeometry.ts

Expected: no diff for those files.


  • Cancer Board V2 has visible sections: Today’s cancer care plan, Daily cancer status, Watch closely, Activated across LynCareOS, Clinic and handover.
  • Existing radar interaction and geometry are unchanged.
  • UI copy avoids “comfort check-in,” “Today is…,” and “More for today” as primary labels.
  • “What this tells us” replaces “What this means” in current UI.
  • Cancer profile value is shown as cross-app activation, not only a disconnected board.
  • Model rules are unit-tested.
  • Frontend build passes.