diff --git a/messages/de.json b/messages/de.json index edc5f2450..28604c9b1 100644 --- a/messages/de.json +++ b/messages/de.json @@ -2353,7 +2353,7 @@ "tokensUsedWithModel": "{count} Tokens · {model}", "askAboutThis": "Den Coach dazu fragen", "readStrip": { - "label": "Coach-Einschätzung", + "label": "Üblicher Bereich", "baselineWithin": "Dein üblicher Bereich liegt bei {low}–{high} {unit}; heute liegt {value} darin.", "baselineAbove": "Dein üblicher Bereich liegt bei {low}–{high} {unit}; heute liegt {value} darüber.", "baselineBelow": "Dein üblicher Bereich liegt bei {low}–{high} {unit}; heute liegt {value} darunter.", diff --git a/messages/en.json b/messages/en.json index 58ab35eeb..df45fbd25 100644 --- a/messages/en.json +++ b/messages/en.json @@ -2353,7 +2353,7 @@ "tokensUsedWithModel": "{count} tokens · {model}", "askAboutThis": "Ask the coach about this", "readStrip": { - "label": "Coach read", + "label": "Usual range", "baselineWithin": "Your usual range is {low}–{high} {unit}; today's {value} sits within it.", "baselineAbove": "Your usual range is {low}–{high} {unit}; today's {value} sits above it.", "baselineBelow": "Your usual range is {low}–{high} {unit}; today's {value} sits below it.", diff --git a/messages/es.json b/messages/es.json index eca0a43ce..35f95049a 100644 --- a/messages/es.json +++ b/messages/es.json @@ -2353,7 +2353,7 @@ "tokensUsedWithModel": "{count} tokens · {model}", "askAboutThis": "Pregúntale al coach sobre esto", "readStrip": { - "label": "Lectura del Coach", + "label": "Rango habitual", "baselineWithin": "Tu rango habitual es {low}–{high} {unit}; hoy {value} se sitúa dentro de él.", "baselineAbove": "Tu rango habitual es {low}–{high} {unit}; hoy {value} se sitúa por encima.", "baselineBelow": "Tu rango habitual es {low}–{high} {unit}; hoy {value} se sitúa por debajo.", diff --git a/messages/fr.json b/messages/fr.json index f3dc0a915..92682f7a4 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -2353,7 +2353,7 @@ "tokensUsedWithModel": "{count} jetons · {model}", "askAboutThis": "Interroger le coach à ce sujet", "readStrip": { - "label": "Lecture du Coach", + "label": "Plage habituelle", "baselineWithin": "Ta plage habituelle est de {low}–{high} {unit} ; aujourd'hui, {value} s'y situe.", "baselineAbove": "Ta plage habituelle est de {low}–{high} {unit} ; aujourd'hui, {value} se situe au-dessus.", "baselineBelow": "Ta plage habituelle est de {low}–{high} {unit} ; aujourd'hui, {value} se situe en dessous.", diff --git a/messages/it.json b/messages/it.json index bd725b9e4..6a20cc358 100644 --- a/messages/it.json +++ b/messages/it.json @@ -2353,7 +2353,7 @@ "tokensUsedWithModel": "{count} token · {model}", "askAboutThis": "Chiedi al coach", "readStrip": { - "label": "Lettura del Coach", + "label": "Intervallo abituale", "baselineWithin": "Il tuo intervallo abituale è {low}–{high} {unit}; oggi {value} rientra al suo interno.", "baselineAbove": "Il tuo intervallo abituale è {low}–{high} {unit}; oggi {value} si colloca al di sopra.", "baselineBelow": "Il tuo intervallo abituale è {low}–{high} {unit}; oggi {value} si colloca al di sotto.", diff --git a/messages/pl.json b/messages/pl.json index 45153ba77..179663f05 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -2353,7 +2353,7 @@ "tokensUsedWithModel": "{count} tokenów · {model}", "askAboutThis": "Zapytaj trenera o to", "readStrip": { - "label": "Ocena Coacha", + "label": "Typowy zakres", "baselineWithin": "Twój zwykły zakres to {low}–{high} {unit}; dzisiejsza wartość {value} mieści się w nim.", "baselineAbove": "Twój zwykły zakres to {low}–{high} {unit}; dzisiejsza wartość {value} jest powyżej niego.", "baselineBelow": "Twój zwykły zakres to {low}–{high} {unit}; dzisiejsza wartość {value} jest poniżej niego.", diff --git a/src/components/insights/derived/coach-read-strip.tsx b/src/components/insights/derived/coach-read-strip.tsx index 2d89ca7db..6e5eb68aa 100644 --- a/src/components/insights/derived/coach-read-strip.tsx +++ b/src/components/insights/derived/coach-read-strip.tsx @@ -8,7 +8,7 @@ import { useMounted } from "@/hooks/use-mounted"; import { useTranslations } from "@/lib/i18n/context"; import { queryKeys } from "@/lib/query-keys"; import { apiGet } from "@/lib/api/api-fetch"; -import { cn } from "@/lib/utils"; +import { TileHeader } from "@/components/insights/tile-header"; import type { CoachReadStripData } from "@/lib/insights/derived/coach-read-shape"; /** @@ -109,37 +109,27 @@ export function CoachReadStrip({ // fires defensively.) if (!baselineLine && !driverLine) return null; + // Standard card anatomy — the same TileHeader-led shape as every other + // insights card (foreground icon + title), instead of the former inline + // mini-icon strip that read as chrome outside the card system. Body prose + // in the regular foreground; muted stays reserved for meta lines. return (
- {baselineLine} -
- ) : null} - {driverLine ? ( -- {driverLine} -
- ) : null} -+ {baselineLine} +
+ ) : null} + {driverLine ? ( ++ {driverLine} +
+ ) : null}` to the BLOCK CONTAINER: a max-height + overflow-hidden when collapsed, - // measured on the wrapper node so multi-paragraph text doesn't re-collapse. - // When the text fits, `scrollHeight` equals `clientHeight`; an overflow means - // the clamp is hiding content and the toggle earns its place. Gated on - // `!expanded` so the comparison reads against the clamped element. - useEffect(() => { - if (expanded) return; - const node = wrapperRef.current; - if (!node) return; - - const measure = () => { - setOverflows(node.scrollHeight > node.clientHeight + 1); - }; - measure(); - - if (typeof ResizeObserver === "undefined") return; - const observer = new ResizeObserver(measure); - observer.observe(node); - return () => observer.disconnect(); - // Re-measure whenever the source text changes (a fresh assessment) or - // the user collapses the card again. - }, [text, expanded]); - + // The assessment shows in full — the 3-line clamp + "show more" toggle + // hid the prose behind an extra tap for no gain on a card whose whole + // point is the text. Body prose reads in the regular foreground; muted + // stays reserved for meta lines (timestamps, captions). return ( -
{t(`insights.subPage.explainer.${explainerMetric}Body`)}