mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-14 14:40:52 +00:00
feat(coach): close the plan check-in loop on the Today rail
Every accepted coach plan now earns a gentle weekly check-in. Confirming a plan (proposed → active) without an explicit review date defaults one to a week out, so a plan is always reviewed, not only the coach's own experiments. The daily digest emits a single `coach_checkin` rail item when a standing plan's review has come due — its pinned review date, or a defaulted activation + 7 days for plans that predate it, or the read-back state a reviewed plan carries. Capped at one check-in a day across all plans (earliest-due wins); the rest wait for a following day. It reads existing plan state only — no fresh generation, nothing warms on mount, and it is gated on the coach module. The card offers three one-tap actions through the existing plan-lifecycle route: keep it (re-arm for another week), adjust it (open the coach), or let it go (a guilt-free, respected end — the calm inversion of a streak). An ignored check-in sits quiet and stops resurfacing after about two cycles; its status is never changed behind the user's back. Copy lands in all six locales.
This commit is contained in:
1 parent
7c96abc8ec
commit
b7a6b4c898
15 files changed
+643
-32
No files matched your search
@@ -130,6 +130,31 @@ test.describe("authenticated dashboard render", () => {
|
||||
},
|
||||
],
|
||||
},
|
||||
// S3 — a coach check-in card (keep / adjust / let-go). Rendered
|
||||
// only; the mutating taps PATCH the plan route, which this spec
|
||||
// never clicks, so it stays green without a plan-route stub.
|
||||
{
|
||||
kind: "coach_checkin",
|
||||
title: "Time to check in on a plan",
|
||||
body: "About a week ago you set: “every morning → weigh in”.",
|
||||
status: "info",
|
||||
moduleKey: "coach",
|
||||
actions: [
|
||||
{
|
||||
labelKey: "daily.action.checkinKeep",
|
||||
intent: "coach.checkin.keep:p1",
|
||||
},
|
||||
{
|
||||
labelKey: "daily.action.checkinAdjust",
|
||||
intent: "coach.checkin.adjust",
|
||||
href: "/coach",
|
||||
},
|
||||
{
|
||||
labelKey: "daily.action.checkinLetGo",
|
||||
intent: "coach.checkin.letGo:p1",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
error: null,
|
||||
|
||||
Reference in new issue
Block a user