mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 13:01:00 +00:00
insights(mood): drop the per-card generic disclaimer, defer to the page footer
The better-days board, the tag-influence list, and the tag × metric crosstab each repeated a generic associations-not-causes / talk-to-your- doctor caveat. That sentence now lives once in the page-level Insights footer, so the three mood cards no longer restate it; the genuinely specific FDR caveat on the discovered-relations board stays. Drop the now-unused betterDays / influence / crosstab disclaimer keys from every locale and update the two component tests that pinned the removed copy. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
fcd8eccf6e
commit
424d6ee5e1
5 files changed
+14
-16
No files matched your search
@@ -80,12 +80,14 @@ describe("<MoodBetterDays>", () => {
|
||||
expect(html).toContain("r -0.45");
|
||||
});
|
||||
|
||||
it("renders the description and disclaimer once each", () => {
|
||||
it("renders the description once and no local generic disclaimer", () => {
|
||||
const html = render(
|
||||
<MoodBetterDays factors={[tagFactor, metricFactor]} />,
|
||||
);
|
||||
expect((html.match(/Associations only/g) ?? []).length).toBe(1);
|
||||
expect((html.match(/ranked by how strongly/g) ?? []).length).toBe(1);
|
||||
// The generic "associations only, not causes" disclaimer now lives once
|
||||
// in the page-level Insights footer, not on this board.
|
||||
expect(html).not.toContain("Associations only");
|
||||
// one row per factor
|
||||
expect((html.match(/data-slot="mood-better-day-factor"/g) ?? []).length).toBe(
|
||||
2,
|
||||
|
||||
@@ -79,10 +79,12 @@ describe("<MoodTagInfluence>", () => {
|
||||
expect(html).not.toContain("charts.weekdaysFull.mon");
|
||||
});
|
||||
|
||||
it("renders the observational disclaimer once", () => {
|
||||
it("does not render a local generic disclaimer", () => {
|
||||
const html = render(
|
||||
<MoodTagInfluence rows={[flatRow(), flatRow({ tag: "social" })]} />,
|
||||
);
|
||||
expect((html.match(/not proof of cause/g) ?? []).length).toBe(1);
|
||||
// The generic "associations, not causes" caveat now lives once in the
|
||||
// page-level Insights footer, not on this list.
|
||||
expect(html).not.toContain("not proof of cause");
|
||||
});
|
||||
});
|
||||
@@ -15,7 +15,8 @@ import type { MoodInfluenceConfidence } from "./mood-tag-influence";
|
||||
* surface — the headline "relations" answer to "what goes with my good
|
||||
* days?". The merge + ranking is pre-computed in `mood-aggregates.ts`
|
||||
* (`computeBetterDays`); this component only paints. Observational only;
|
||||
* the standing disclaimer is rendered once below the board.
|
||||
* the standing "describes your own data, not a diagnosis" disclaimer lives
|
||||
* once in the page-level Insights footer, not on this board.
|
||||
*/
|
||||
|
||||
export interface MoodBetterDayFactor {
|
||||
@@ -138,9 +139,6 @@ export function MoodBetterDays({
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
<p className="text-muted-foreground mt-3 text-[11px]">
|
||||
{t("insights.mood.betterDays.disclaimer")}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -12,7 +12,8 @@ import { cn } from "@/lib/utils";
|
||||
* the delta, and a confidence chip. The math is pre-computed in
|
||||
* `mood-aggregates.ts` (shared with the LLM snapshot), gated on per-group
|
||||
* sample floors — sparse tags never reach here. Observational only: the
|
||||
* "association, not cause" caption is rendered once below the list.
|
||||
* generic "associations, not causes" caveat lives once in the page-level
|
||||
* Insights footer, so this list no longer repeats it.
|
||||
*/
|
||||
|
||||
export type MoodInfluenceConfidence = "low" | "medium" | "high";
|
||||
@@ -110,9 +111,6 @@ export function MoodTagInfluence({
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
<p className="text-muted-foreground mt-3 text-[11px]">
|
||||
{t("insights.mood.influence.disclaimer")}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -14,7 +14,8 @@ import type { MoodInfluenceConfidence } from "./mood-tag-influence";
|
||||
* pre-computed in `mood-aggregates.ts` (`computeTagMetricCrosstab`) — the
|
||||
* same Welch t-test + day floors + Benjamini-Hochberg FDR the rest of the
|
||||
* relations surface uses; only FDR-surviving rows reach here. Observational
|
||||
* only: the "association, not cause" caption renders once below the list.
|
||||
* only: the generic "associations, not causes" caveat lives once in the
|
||||
* page-level Insights footer, so this card no longer repeats it.
|
||||
*/
|
||||
|
||||
export type MoodCrosstabDisplay = "hours" | "kcal" | "score";
|
||||
@@ -150,9 +151,6 @@ export function MoodTagMetricCrosstab({
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
<p className="text-muted-foreground mt-3 text-[11px]">
|
||||
{t("insights.mood.crosstab.disclaimer")}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user