diff --git a/messages/de.json b/messages/de.json index c018aab94..b8f1a6c9f 100644 --- a/messages/de.json +++ b/messages/de.json @@ -1501,6 +1501,8 @@ "heroRegenerating": "Wird generiert", "regenerateAnalysis": "Analyse neu starten", "regenerateSuccess": "Analyse wurde neu erstellt", + "warmAssessments": "Auswertungen vorbereiten", + "warmStarted": "Auswertungen werden im Hintergrund erstellt", "heroFallbackSubtitle": "Täglicher Blick auf deine Trends — direkt aus den Zahlen, die du protokollierst.", "heroGreetingMorning": "Guten Morgen", "heroGreetingAfternoon": "Guten Tag", diff --git a/messages/en.json b/messages/en.json index 9019923b6..ca23e5853 100644 --- a/messages/en.json +++ b/messages/en.json @@ -1501,6 +1501,8 @@ "heroRegenerating": "Regenerating", "regenerateAnalysis": "Re-run analysis", "regenerateSuccess": "Analysis refreshed", + "warmAssessments": "Prepare assessments", + "warmStarted": "Assessments are being prepared in the background", "heroFallbackSubtitle": "A daily read of your trends, drawn straight from the numbers you've logged.", "heroGreetingMorning": "Good morning", "heroGreetingAfternoon": "Good afternoon", diff --git a/messages/es.json b/messages/es.json index 101db930e..b34fa799b 100644 --- a/messages/es.json +++ b/messages/es.json @@ -1501,6 +1501,8 @@ "heroRegenerating": "Generando", "regenerateAnalysis": "Volver a iniciar el análisis", "regenerateSuccess": "Análisis regenerado", + "warmAssessments": "Preparar evaluaciones", + "warmStarted": "Las evaluaciones se están preparando en segundo plano", "heroFallbackSubtitle": "Una mirada diaria a tus tendencias — directamente de los datos que registras.", "heroGreetingMorning": "Buenos días", "heroGreetingAfternoon": "Buenas tardes", diff --git a/messages/fr.json b/messages/fr.json index d4b64818c..cf4ceb691 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -1501,6 +1501,8 @@ "heroRegenerating": "Génération en cours", "regenerateAnalysis": "Relancer l’analyse", "regenerateSuccess": "Analyse regénérée", + "warmAssessments": "Préparer les évaluations", + "warmStarted": "Les évaluations sont en cours de préparation en arrière-plan", "heroFallbackSubtitle": "Un coup d’œil quotidien sur tes tendances — directement issu des chiffres que tu saisis.", "heroGreetingMorning": "Bonjour", "heroGreetingAfternoon": "Bonjour", diff --git a/messages/it.json b/messages/it.json index 72861adbc..175434875 100644 --- a/messages/it.json +++ b/messages/it.json @@ -1501,6 +1501,8 @@ "heroRegenerating": "Generazione in corso", "regenerateAnalysis": "Riavvia l’analisi", "regenerateSuccess": "Analisi rigenerata", + "warmAssessments": "Prepara le valutazioni", + "warmStarted": "Le valutazioni vengono preparate in background", "heroFallbackSubtitle": "Uno sguardo quotidiano ai tuoi trend — direttamente dai numeri che registri.", "heroGreetingMorning": "Buongiorno", "heroGreetingAfternoon": "Buon pomeriggio", diff --git a/messages/pl.json b/messages/pl.json index 308ed202d..22b4b7bc5 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -1501,6 +1501,8 @@ "heroRegenerating": "Generowanie", "regenerateAnalysis": "Uruchom analizę ponownie", "regenerateSuccess": "Analiza wygenerowana ponownie", + "warmAssessments": "Przygotuj analizy", + "warmStarted": "Analizy są przygotowywane w tle", "heroFallbackSubtitle": "Codzienne spojrzenie na twoje trendy — prosto z liczb, które rejestrujesz.", "heroGreetingMorning": "Dzień dobry", "heroGreetingAfternoon": "Dzień dobry", diff --git a/src/app/insights/page.tsx b/src/app/insights/page.tsx index 0153fc9d9..e3fd38cf6 100644 --- a/src/app/insights/page.tsx +++ b/src/app/insights/page.tsx @@ -1,9 +1,10 @@ "use client"; +import { useEffect } from "react"; import { useQuery } from "@tanstack/react-query"; import dynamic from "next/dynamic"; import Link from "next/link"; -import { TrendingUp } from "lucide-react"; +import { TrendingUp, Sparkles } from "lucide-react"; import { useAuth } from "@/hooks/use-auth"; import { queryKeys } from "@/lib/query-keys"; @@ -14,6 +15,7 @@ import { Button } from "@/components/ui/button"; import { EmptyState } from "@/components/ui/empty-state"; import { HeroStrip } from "@/components/insights/hero-strip"; import { useInsightsAdvisorQuery } from "@/components/insights/use-insights-advisor"; +import { useInsightsWarm } from "@/components/insights/use-insights-warm"; import { useCoachLaunch } from "@/lib/insights/coach-launch-context"; import { useAnalyticsQuery } from "@/lib/queries/use-analytics-query"; // v1.4.41 W-ORG — shared shape lives in `src/types/analytics.ts` as @@ -150,6 +152,17 @@ export default function InsightsPage() { const analyticsQuery = useAnalyticsQuery(); const analytics = analyticsQuery.data as AnalyticsData | undefined; + // v1.8.7.1 — on-demand full assessment warm. The auto-trigger fires once + // per session as soon as the overview confirms the user has data, so the + // status cards (and the iOS client, which reads the same routes) land on + // warm caches without the user waiting. The manual button below re-warms + // everything on demand. + const { warm, isWarming, autoWarmOnce } = useInsightsWarm(); + const hasData = !!data && data.totalMeasurements > 0; + useEffect(() => { + autoWarmOnce(isAuthenticated && hasData); + }, [autoWarmOnce, isAuthenticated, hasData]); + // Empty-state shortcut — only paint once the comprehensive query has // resolved AND reported zero measurements. While it's in-flight we // fall through to the streamed shell so the user gets the hero + @@ -210,6 +223,18 @@ export default function InsightsPage() { healthScore={analytics?.healthScore ?? undefined} /> +