mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 06:32:03 +00:00
fix(insights): mount InsightAdvisorCard on /insights page (wire B5c/d/e + B1b polish to live route)
The /insights page rendered only the text-only InsightStatusCard per section, hiding all of B5c (rec rationale + mini-chart), B5d (confidence meter), B5e (thumbs feedback) and the broader B1b polish from users. Wave-D design review flagged this as CRITICAL C1. Wires the InsightAdvisorCard component into the live route, consuming the existing /api/insights/generate POST. The route already returns the 24h-cached payload without burning a rate-limit token, so a single POST-without-force is functionally a GET-or-generate — no new API surface needed (the reconcile report deferred C1 because it assumed otherwise). The cache is shared with the dashboard preview via the new queryKeys.insightsAdvisor() so a regenerate on either surface refreshes the other without a second LLM call. Per-section InsightStatusCards stay below as supplemental detail; the hero now also wires its regenerate button to the same handler. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
54bbc68eff
commit
aae968a6d5
6 files changed
+388
-1
No files matched your search
@@ -22,6 +22,14 @@ export const queryKeys = {
|
||||
insightsRoot: () => ["insights"] as const,
|
||||
insightsComprehensive: () => ["insights", "comprehensive"] as const,
|
||||
insightsTargets: () => ["insights", "targets"] as const,
|
||||
/**
|
||||
* v1.4.16 phase D reconcile (CRITICAL C1 + C2) — shared cache key for
|
||||
* the rich `/api/insights/generate` advisor payload. Both `/insights`
|
||||
* (full `<InsightAdvisorCard>`) and `/` (`<InsightsCardPreview>`) read
|
||||
* this key so a regenerate on one surface refreshes the other without
|
||||
* a second LLM round-trip.
|
||||
*/
|
||||
insightsAdvisor: () => ["insights", "advisor"] as const,
|
||||
insightsGeneralStatus: (locale: string) =>
|
||||
["insights", "general-status", locale] as const,
|
||||
insightsBpStatus: (locale: string) =>
|
||||
|
||||
Reference in new issue
Block a user