refactor(insights): drop the per-page generic medical disclaimers

Remove the page-level Insights disclaimer footer and the health-score and
correlation card disclaimers now that the not-a-diagnosis acknowledgment
is shown once at onboarding and the legal text stays on the privacy page.
Device-provenance, contraception-safety, statistical-method and
shared-report notes stay where they convey specific information.
This commit is contained in:
Marc-André Bombeck committed 2026-06-18 22:11:45 +02:00
1 parent bfba92cb83
commit 04a50b2702
10 files changed
+11 -110

No files matched your search

@@ -192,19 +192,6 @@ describe("<HealthScoreCard>", () => {
expect(moodSliceMatch?.[1]).toBe("—");
});
it("renders the disclaimer", () => {
const html = ssr(
<HealthScoreCard
score={86}
band="green"
components={baseComponents}
delta={null}
/>,
);
expect(html).toMatch(/data-slot="health-score-card-disclaimer"/);
expect(html).toContain("Indicative");
});
it("v1.4.27 B1 — no longer mounts an inline Ask-the-Coach button (hero strip carries the CTA)", () => {
// The hero strip's existing "Ask the coach" action covers this
// surface; the card-internal duplicate button retired. The
@@ -245,7 +232,6 @@ describe("<HealthScoreCard>", () => {
);
expect(html).toContain("Gesundheitsscore");
expect(html).toContain("im Vergleich zur Vorwoche");
expect(html).toContain("Orientierungshilfe");
// v1.4.27 B1 — the inline Coach button retired; hero strip carries
// the action now.
expect(html).not.toContain("Coach fragen");
@@ -308,27 +294,6 @@ describe("<HealthScoreCard>", () => {
expect(cardOpen?.[0]).toContain("flex-col");
});
it("pins the disclaimer to the bottom of the stretched card via mt-auto", () => {
// Without `mt-auto` the disclaimer rides directly under the
// provenance accordion and leaves the recovered space below the
// disclaimer instead of between the body and the footer. The
// FB-H2 contract is "score number on top, disclaimer on bottom,
// recovered space in the middle".
const html = ssr(
<HealthScoreCard
score={86}
band="green"
components={baseComponents}
delta={null}
/>,
);
const disclaimerOpen = html.match(
/<p[^>]*data-slot="health-score-card-disclaimer"[^>]*>/,
);
expect(disclaimerOpen).not.toBeNull();
expect(disclaimerOpen?.[0]).toContain("mt-auto");
});
// v1.4.37 W4a item 1 — the inner column switched from `flex
// flex-col gap-3` to a 7-row grid so the slack collects on row 6
// (the provenance accordion) instead of clumping under the
+3 -19
View File
@@ -627,25 +627,9 @@ export function HealthScoreCard({
)}
</div>
{/* v1.4.27 B1 — disclaimer bumped from text-[10px] to
text-[11px] (BL-P4-9 L2: the 10 px size was borderline
against the 12 px mobile floor). The hero strip already
carries an "Ask the coach" action so the inline button
here retires; the parent still receives onAskCoach via
other surfaces but the card no longer mounts a duplicate
CTA.
v1.4.28 R3c-Insights — `mt-auto` pins the disclaimer to
the bottom of the stretched card so the score number and
sub-bars stay anchored at the top while the recovered
vertical space (when the parent column is taller) sits
quietly between the provenance accordion and the
disclaimer footer. */}
<p
data-slot="health-score-card-disclaimer"
className="text-muted-foreground mt-auto text-[11px] leading-snug"
>
{t("insights.healthScore.disclaimer")}
</p>
{/* v1.18.6 (DISC-01) — the "indicative, not a clinical assessment"
card disclaimer is removed; the one-time onboarding acknowledgment
now covers the not-a-diagnosis framing app-wide. */}
</div>
</div>
);
@@ -3,7 +3,6 @@
import { useMemo, type ReactNode } from "react";
import { useQuery } from "@tanstack/react-query";
import { useTranslations } from "@/lib/i18n/context";
import { useAuth } from "@/hooks/use-auth";
import { useMounted } from "@/hooks/use-mounted";
import { useFeatureFlags } from "@/hooks/use-feature-flags";
@@ -52,7 +51,6 @@ interface ComprehensivePayload {
}
export function InsightsLayoutShell({ children }: { children: ReactNode }) {
const { t } = useTranslations();
const { isAuthenticated, user } = useAuth();
// v1.4.33 F18 — gate the advisor POST on the operator's assistant
// feature flag. Pre-fix, every /insights mount fired POST
@@ -160,24 +158,11 @@ export function InsightsLayoutShell({ children }: { children: ReactNode }) {
modules={user?.modules}
/>
{children}
{/* v1.12.6 — SINGLE SOURCE of the generic Insights disclaimer.
The "describes your own data, not a clinical assessment / diagnosis"
sentence used to repeat across the overview, the metric tiles, the
mood page, and the medications page. It now lives here once, as a
page-level footer under every `/insights/*` route. Metric-SPECIFIC
caveats (health score, correlations, mood relations, derived cards,
rhythm events) stay on their own cards — those convey real,
non-generic information. Other waves remove the generic line from the
overview / mood / medications pages; this footer is where it lives.
v1.18.0 — Coach moved to the standalone `/coach` route (its own
disclaimer), so this footer now renders under every `/insights/*`
route unconditionally. */}
<p
data-slot="insights-disclaimer-footer"
className="text-muted-foreground border-border/60 border-t pt-4 text-center text-xs leading-relaxed"
>
{t("insights.disclaimer.footer")}
</p>
{/* v1.18.6 (DISC-01) — the page-level generic medical disclaimer is
removed. The "HealthLog is a private tracking tool, not a clinical
assessment or diagnosis" acknowledgment now lives once at the start
of onboarding, and the legal text stays reachable on the public
privacy page. */}
</div>
);
}
@@ -84,12 +84,9 @@ export function MetricCorrelationCard({ slug }: MetricCorrelationCardProps) {
{t("insights.correlationRow.title")}
</h2>
<CorrelationCard result={result} />
<p
data-slot="metric-correlation-disclaimer"
className="text-muted-foreground text-xs italic"
>
{t("insights.correlationRow.disclaimer")}
</p>
{/* v1.18.6 (DISC-01) — the "observational, not causal / talk to your
doctor" disclaimer is removed; the one-time onboarding acknowledgment
now covers the not-medical-advice framing app-wide. */}
</section>
);
}