From 2c33faa64882a02d7bb61225ab39bd1c8b280be2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 27 Jun 2026 00:48:40 +0200 Subject: [PATCH] chore(insights): align the ambient-Coach file comments to the shipped version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The A1–A3 source files carried v1.22.0 docstrings from before the work was re-cut as the v1.21.2 point release. Comment-only sweep so blame and the in-file version tags read consistently with the shipped version. --- src/app/api/insights/coach-read/route.ts | 2 +- .../insights/coach/seeded-question/__tests__/route.test.ts | 2 +- src/app/api/insights/coach/seeded-question/route.ts | 2 +- .../coach-panel/__tests__/scope-hint-badge.test.tsx | 2 +- src/components/insights/coach-panel/coach-hero.tsx | 6 +++--- src/components/insights/coach-panel/scope-hint-badge.tsx | 2 +- src/components/insights/coach-panel/sources-rail.tsx | 4 ++-- src/components/insights/derived/coach-read-strip.tsx | 2 +- src/components/insights/sub-page-shell.tsx | 4 ++-- src/lib/insights/derived/__tests__/coach-read.test.ts | 2 +- src/lib/insights/derived/coach-read-shape.ts | 2 +- src/lib/insights/derived/coach-read.ts | 2 +- src/lib/query-keys/coach.ts | 2 +- src/lib/query-keys/insights.ts | 2 +- 14 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/app/api/insights/coach-read/route.ts b/src/app/api/insights/coach-read/route.ts index 82fe83c57..58db34f5c 100644 --- a/src/app/api/insights/coach-read/route.ts +++ b/src/app/api/insights/coach-read/route.ts @@ -1,5 +1,5 @@ /** - * v1.22.0 (A1) — "Coach read" strip route. + * v1.21.2 (A1) — "Coach read" strip route. * * `GET /api/insights/coach-read?metric=` serves the two * server-authoritative lines a metric sub-page renders above its chart: the diff --git a/src/app/api/insights/coach/seeded-question/__tests__/route.test.ts b/src/app/api/insights/coach/seeded-question/__tests__/route.test.ts index d059a262d..b5354a1bc 100644 --- a/src/app/api/insights/coach/seeded-question/__tests__/route.test.ts +++ b/src/app/api/insights/coach/seeded-question/__tests__/route.test.ts @@ -2,7 +2,7 @@ import { describe, it, expect, vi, beforeEach } from "vitest"; import { NextRequest } from "next/server"; /** - * v1.22.0 (A3) — the seeded-question route resolves today's single most + * v1.21.2 (A3) — the seeded-question route resolves today's single most * notable derived signal into a tappable Coach opener, server-side. When the * confidence + notability gate yields nothing the route returns * `{ signal: null }` and the hero keeps its neutral greeting — never a diff --git a/src/app/api/insights/coach/seeded-question/route.ts b/src/app/api/insights/coach/seeded-question/route.ts index 6fdba6eb7..8e5ac4a0e 100644 --- a/src/app/api/insights/coach/seeded-question/route.ts +++ b/src/app/api/insights/coach/seeded-question/route.ts @@ -1,5 +1,5 @@ /** - * v1.22.0 (A3) — pre-seeded relevance opener for the unscoped Coach. + * v1.21.2 (A3) — pre-seeded relevance opener for the unscoped Coach. * * `GET /api/insights/coach/seeded-question` resolves today's single most * notable derived wellness signal (readiness / recovery shift, the same diff --git a/src/components/insights/coach-panel/__tests__/scope-hint-badge.test.tsx b/src/components/insights/coach-panel/__tests__/scope-hint-badge.test.tsx index 7e7c8d695..e16775507 100644 --- a/src/components/insights/coach-panel/__tests__/scope-hint-badge.test.tsx +++ b/src/components/insights/coach-panel/__tests__/scope-hint-badge.test.tsx @@ -13,7 +13,7 @@ function render(node: React.ReactNode, locale: "en" | "de" = "en") { } /** - * v1.22.0 (A2 + A3) — the visible scope/opener affordance. + * v1.21.2 (A2 + A3) — the visible scope/opener affordance. * * The component renders in the `node` test environment via static markup, so * the tests assert the structural slots + the caller-resolved label / question diff --git a/src/components/insights/coach-panel/coach-hero.tsx b/src/components/insights/coach-panel/coach-hero.tsx index 872a6773b..cd67c0d54 100644 --- a/src/components/insights/coach-panel/coach-hero.tsx +++ b/src/components/insights/coach-panel/coach-hero.tsx @@ -28,7 +28,7 @@ import { useTranslations } from "@/lib/i18n/context"; * in via `motion-safe` `animate-in` with capped delays; reduced-motion * users get the layout instantly. * - * v1.22.0 (A2 + A3) — the hero accepts an optional `scopeHint` slot + * v1.21.2 (A2 + A3) — the hero accepts an optional `scopeHint` slot * (a ``): the visible "the Coach is already on " * pill + seed question when launched scoped (A2), or the pre-seeded * notable-signal opener when launched unscoped (A3). When absent the hero @@ -39,7 +39,7 @@ export interface CoachHeroProps { /** The live `` composer, re-parented into the hero. */ composer: React.ReactNode; /** - * v1.22.0 — optional scope/opener affordance rendered above the + * v1.21.2 — optional scope/opener affordance rendered above the * composer. The parent owns the data (launch scope / seeded signal) and * passes a resolved ``; null keeps the neutral hero. */ @@ -105,7 +105,7 @@ export function CoachHero({ composer, scopeHint }: CoachHeroProps) { {composer} - {/* v1.22.0 (A2/A3) — visible scope pill + tappable opener, beneath + {/* v1.21.2 (A2/A3) — visible scope pill + tappable opener, beneath the composer so the greeting → composer rhythm stays intact and the opener reads as a follow-on suggestion. Renders only when the parent resolved a scope or a notable signal. */} diff --git a/src/components/insights/coach-panel/scope-hint-badge.tsx b/src/components/insights/coach-panel/scope-hint-badge.tsx index 4f4a618a8..961841676 100644 --- a/src/components/insights/coach-panel/scope-hint-badge.tsx +++ b/src/components/insights/coach-panel/scope-hint-badge.tsx @@ -6,7 +6,7 @@ import { cn } from "@/lib/utils"; import { useTranslations } from "@/lib/i18n/context"; /** - * v1.22.0 (A2 + A3) — the Coach's visible scope/opener affordance. + * v1.21.2 (A2 + A3) — the Coach's visible scope/opener affordance. * * Two modes, one surface: * diff --git a/src/components/insights/coach-panel/sources-rail.tsx b/src/components/insights/coach-panel/sources-rail.tsx index 20f613bb5..9e878d85e 100644 --- a/src/components/insights/coach-panel/sources-rail.tsx +++ b/src/components/insights/coach-panel/sources-rail.tsx @@ -55,7 +55,7 @@ const WINDOW_OPTIONS: ReadonlyArray = [ export interface SourcesRailProps { className?: string; /** - * v1.22.0 (A2) — the human label of the metric the current conversation + * v1.21.2 (A2) — the human label of the metric the current conversation * was launched scoped to, or null for a generic (all-source) open. When * set, the rail surfaces a small "the Coach is already on " line * above the persisted-cluster toggles so the active narrowing is VISIBLE @@ -132,7 +132,7 @@ export function SourcesRail({ className, activeScopeLabel }: SourcesRailProps) { {t("insights.coach.sourcesTitle")} - {/* v1.22.0 (A2) — the visible launch scope for this conversation. Only + {/* v1.21.2 (A2) — the visible launch scope for this conversation. Only rendered when the Coach was opened narrowed to a metric; a generic open omits it entirely so the rail is unchanged for the default all-source case. */} diff --git a/src/components/insights/derived/coach-read-strip.tsx b/src/components/insights/derived/coach-read-strip.tsx index ce6b3629c..2d89ca7db 100644 --- a/src/components/insights/derived/coach-read-strip.tsx +++ b/src/components/insights/derived/coach-read-strip.tsx @@ -12,7 +12,7 @@ import { cn } from "@/lib/utils"; import type { CoachReadStripData } from "@/lib/insights/derived/coach-read-shape"; /** - * v1.22.0 (A1) — "Coach read" strip. + * v1.21.2 (A1) — "Coach read" strip. * * A compact two-line read rendered ABOVE the chart on each metric sub-page: * diff --git a/src/components/insights/sub-page-shell.tsx b/src/components/insights/sub-page-shell.tsx index c44decaf0..31486d280 100644 --- a/src/components/insights/sub-page-shell.tsx +++ b/src/components/insights/sub-page-shell.tsx @@ -97,7 +97,7 @@ export interface SubPageShellProps { */ statStrip?: ReactNode; /** - * v1.22.0 (A1) — the "Coach read" strip, mounted between the stat strip and + * v1.21.2 (A1) — the "Coach read" strip, mounted between the stat strip and * the chart. A compact two-line own-baseline + lagged-association read that * makes the metric feel seen-in-context. Self-gating (renders nothing until * its server read lands, and nothing at all when there is no baseline and no @@ -389,7 +389,7 @@ export function SubPageShell({ strip so the numbers always reflect the range the chart paints. No drag, no pill — the range tab is the single selector. */} {statStrip} - {/* v1.22.0 (A1) — the "Coach read" strip sits between the numbers-first + {/* v1.21.2 (A1) — the "Coach read" strip sits between the numbers-first stat strip and the chart, so the spine reads intro → numbers → Coach read → chart → target → assessment. Self-gating, so the rhythm holds when the strip has nothing to say. */} diff --git a/src/lib/insights/derived/__tests__/coach-read.test.ts b/src/lib/insights/derived/__tests__/coach-read.test.ts index ea45f0e46..e98f95e74 100644 --- a/src/lib/insights/derived/__tests__/coach-read.test.ts +++ b/src/lib/insights/derived/__tests__/coach-read.test.ts @@ -8,7 +8,7 @@ import { import type { CoachCorrelationDriver } from "@/lib/ai/coach/tools/correlations-read"; /** - * v1.22.0 (A1) — "Coach read" strip selection logic. + * v1.21.2 (A1) — "Coach read" strip selection logic. * * Covers the two decisions the strip turns on: * 1. band-line placement (within / above / below), incl. the inclusive diff --git a/src/lib/insights/derived/coach-read-shape.ts b/src/lib/insights/derived/coach-read-shape.ts index 54a01e19c..278aa243c 100644 --- a/src/lib/insights/derived/coach-read-shape.ts +++ b/src/lib/insights/derived/coach-read-shape.ts @@ -1,5 +1,5 @@ /** - * v1.22.0 (A1) — "Coach read" strip: shared shapes + pure selection logic. + * v1.21.2 (A1) — "Coach read" strip: shared shapes + pure selection logic. * * Client-safe (no `server-only`, no Prisma): the DTO shapes the route returns * and the strip renders, plus the two pure decisions the strip turns on — diff --git a/src/lib/insights/derived/coach-read.ts b/src/lib/insights/derived/coach-read.ts index e7f72b5be..c18300f82 100644 --- a/src/lib/insights/derived/coach-read.ts +++ b/src/lib/insights/derived/coach-read.ts @@ -1,5 +1,5 @@ /** - * v1.22.0 (A1) — "Coach read" strip data builder. + * v1.21.2 (A1) — "Coach read" strip data builder. * * Two server-authoritative lines for a single metric sub-page, computed * here so web and iOS read the SAME resolved DTO (no client re-derivation): diff --git a/src/lib/query-keys/coach.ts b/src/lib/query-keys/coach.ts index 72443a7c8..90e2652ae 100644 --- a/src/lib/query-keys/coach.ts +++ b/src/lib/query-keys/coach.ts @@ -27,7 +27,7 @@ export const coachKeys = { */ coachConversation: (id: string | null) => ["coachConversation", id] as const, /** - * v1.22.0 (A3) — today's most notable derived signal, resolved into the + * v1.21.2 (A3) — today's most notable derived signal, resolved into the * Coach hero's pre-seeded relevance opener * (`GET /api/insights/coach/seeded-question`). */ diff --git a/src/lib/query-keys/insights.ts b/src/lib/query-keys/insights.ts index d077b6fc4..0a3607438 100644 --- a/src/lib/query-keys/insights.ts +++ b/src/lib/query-keys/insights.ts @@ -128,7 +128,7 @@ export const insightsKeys = { insightsTrendSeries: (types: string) => ["trend-series", types] as const, /** - * v1.22.0 (A1) — per-metric "Coach read" strip + * v1.21.2 (A1) — per-metric "Coach read" strip * (`/api/insights/coach-read?metric=`). One generic route * backs every metric sub-page, so the key is parameterised by the * MeasurementType. Pure compute over the baseline + correlation engines —