From 98a3d10705a89bdfd5832be65dd68e0784f6395b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 10 May 2026 13:12:24 +0200 Subject: [PATCH] refactor(insights): single page-level refresh and drop orphan subtitle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The /insights page used to surface the same regenerate handler three times — the page hero's "Neu generieren" button, the advisor card header's icon-only refresh button, and the empty-state "Analyse starten" CTA inside the same card. Marc described the trio as "gefuehlt drei Buttons, alle machen das gleiche". Drop `onRegenerate` from the page's `` mount. The hero remains the single page-level refresh affordance; the card-level icon button and empty-state CTA disappear because they short-circuit on `!onRegenerate`. The per-recommendation Regenerate (inside ``) is unrelated — that's per-card context, not page-level — and stays as-is per the v1.4.16 spec. Same patch drops the placeholder "Persoenlicher Berater" subtitle (`insights.aiOverviewTitle`) the page passed in as the card's secondary line. With no provider configured, the empty card rendered just an icon and that subtitle above blank space, which Marc described as "Titel da aber NICHTS PASSIERT". The CardTitle ("KI-Gesundheitsanalyse") is enough framing on its own; the subtitle prop on `` becomes optional and existing callers that still pass one keep their line. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/app/insights/page.tsx | 23 +++++++++++++------ .../insights/insight-advisor-card.tsx | 19 +++++++++++---- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/app/insights/page.tsx b/src/app/insights/page.tsx index 8b2f5839e..7fe79a53e 100644 --- a/src/app/insights/page.tsx +++ b/src/app/insights/page.tsx @@ -923,16 +923,25 @@ export default function InsightsPage() { medical-citation footnotes) into the live route. Before this fix the page rendered only the text-only `` per section, hiding all of B5c/d/e/B1b's polish from users. - The per-section status cards stay below as supplemental detail. */} + The per-section status cards stay below as supplemental detail. + + v1.4.19 A3 — `onRegenerate` is no longer wired here. The page + hero already owns the single page-level refresh affordance; + the card-level icon button + empty-state "Analyse starten" + button were duplicates that surfaced the same handler three + ways (page hero button, card-header icon button, + empty-state CTA). The per-recommendation Regenerate (inside + ``) is unrelated — it stays under the + v1.4.16 spec. The placeholder `aiOverviewTitle` + ("Persönlicher Berater") subtitle is also gone — the + CardTitle ("KI-Gesundheitsanalyse") is enough framing on its + own, and the orphan title above an empty body when the user + has no provider configured was the actual confusion source + Marc reported. */} diff --git a/src/components/insights/insight-advisor-card.tsx b/src/components/insights/insight-advisor-card.tsx index 56e6fc38d..0c8f76bb1 100644 --- a/src/components/insights/insight-advisor-card.tsx +++ b/src/components/insights/insight-advisor-card.tsx @@ -32,7 +32,16 @@ import { RecommendationsGrid } from "./recommendations-grid"; // ─── Types ──────────────────────────────────────────────── interface InsightAdvisorCardProps { - title: string; + /** + * v1.4.19 A3 — optional subtitle below the CardTitle. The + * `/insights` page surface no longer passes a subtitle (the + * CardTitle alone is enough framing); the prop stays optional so + * existing test fixtures + the dashboard preview keep their + * supplementary line. When omitted the `

` element is dropped + * entirely so the empty card no longer renders an "orphan + * Persönlicher Berater" title above an empty body. + */ + title?: string; icon?: React.ReactNode; insight: InsightResult | null; loading?: boolean; @@ -332,7 +341,7 @@ export function InsightAdvisorCard({ {t("insights.aiAnalysisTitle")} -

{title}

+ {title &&

{title}

}
@@ -365,7 +374,7 @@ export function InsightAdvisorCard({
-

{title}

+ {title &&

{title}

} {error && ( @@ -473,7 +482,7 @@ export function InsightAdvisorCard({ )} -

{title}

+ {title &&

{title}

}
-

{title}

+ {title &&

{title}

}