From 975fecf0b2065c209c29bd65f97b50baac2563be Mon Sep 17 00:00:00 2001 From: Asher Cohen Date: Sun, 2 Aug 2026 06:43:30 -0700 Subject: [PATCH] fix(web): label landing stats illustrative --- .../web/src/pages/LandingPage.stories.tsx | 17 ++++++++++- packages/web/src/pages/LandingPage.test.tsx | 27 ++++++++++++------ packages/web/src/pages/LandingPage.tsx | 28 +++++++++++++------ 3 files changed, 53 insertions(+), 19 deletions(-) diff --git a/packages/web/src/pages/LandingPage.stories.tsx b/packages/web/src/pages/LandingPage.stories.tsx index bdbe22e554..70ed871fe9 100644 --- a/packages/web/src/pages/LandingPage.stories.tsx +++ b/packages/web/src/pages/LandingPage.stories.tsx @@ -122,10 +122,25 @@ export const IllustrativeDecisionPreview: Story = { docs: { description: { story: - "Shows the landing-page example with comparison, coverage, source, limitation, action, and labeled chart context.", + "Shows the landing-page relationship as an illustrative sample without an unsupported statistical result, sample size, or confidence interval.", }, }, }, + play: async ({ canvasElement }) => { + const canvas = within(canvasElement); + + await expect(canvas.getByText("Illustrative relationship")).toBeVisible(); + await expect(canvas.getByText("Illustrative sample")).toBeVisible(); + await expect(canvas.getByText("No measured correlation")).toBeVisible(); + await expect( + canvas.getByText("No sample size or confidence interval is shown for this illustration."), + ).toBeVisible(); + await expect( + canvas.getByRole("img", { + name: "Illustrative scatter plot for demonstration only. X-axis: Sleep consistency (%). Y-axis: Heart rate variability (ms).", + }), + ).toBeVisible(); + }, }; export const ImportOnlyProviders: Story = { diff --git a/packages/web/src/pages/LandingPage.test.tsx b/packages/web/src/pages/LandingPage.test.tsx index 3285c87dda..8c836b1eae 100644 --- a/packages/web/src/pages/LandingPage.test.tsx +++ b/packages/web/src/pages/LandingPage.test.tsx @@ -166,7 +166,7 @@ describe("LandingPage", () => { expect(screen.getByText("7h 42m")).toBeTruthy(); expect(screen.getByText("96% of need")).toBeTruthy(); expect(screen.getByText("Health monitor")).toBeTruthy(); - expect(screen.getByText("Key correlation")).toBeTruthy(); + expect(screen.getByText("Illustrative relationship")).toBeTruthy(); expect(screen.getByText("Recent trend")).toBeTruthy(); expect(screen.queryByText("Compare sources")).toBeNull(); expect(screen.queryByText("Connected source coverage")).toBeNull(); @@ -196,17 +196,26 @@ describe("LandingPage", () => { ).toBeTruthy(); }); - it("demonstrates value, comparison, confidence, source, and action in the preview", () => { + it("labels the relationship preview as illustrative rather than a measured result", () => { render(); - expect(screen.getByText("r = 0.72")).toBeTruthy(); - expect(screen.getByText("Strong positive")).toBeTruthy(); - expect(screen.getByText("24 paired days of 30")).toBeTruthy(); + expect(screen.getByText("Illustrative relationship")).toBeTruthy(); + expect(screen.getByText("Illustrative sample")).toBeTruthy(); + expect(screen.getByText("Example points")).toBeTruthy(); + expect(screen.getByText("No measured correlation")).toBeTruthy(); expect( - screen.getByText("Example sources: Oura sleep + Apple Health heart rate variability (HRV)"), + screen.getByText("No sample size or confidence interval is shown for this illustration."), + ).toBeTruthy(); + expect(screen.getByText("Example source types: sleep + heart rate variability")).toBeTruthy(); + expect(screen.getByText("Illustrative data only—not a measured Dofek result.")).toBeTruthy(); + expect( + screen.getByText( + "Real relationships can reflect missing observations or other factors; association does not establish causation.", + ), + ).toBeTruthy(); + expect( + screen.getByText("Next: connect sources to compare your own paired records."), ).toBeTruthy(); - expect(screen.getByText("Confidence: moderate; association, not causation.")).toBeTruthy(); - expect(screen.getByText("Next: compare late meals on the same nights.")).toBeTruthy(); expect(screen.getByText("+3 bpm vs prior 7 days")).toBeTruthy(); expect(screen.getByText("7 of 7 nights")).toBeTruthy(); @@ -229,7 +238,7 @@ describe("LandingPage", () => { expect( screen.getByRole("img", { - name: "Example correlation scatter plot. X-axis: Sleep consistency (%). Y-axis: Heart rate variability (ms).", + name: "Illustrative scatter plot for demonstration only. X-axis: Sleep consistency (%). Y-axis: Heart rate variability (ms).", }), ).toBeTruthy(); expect( diff --git a/packages/web/src/pages/LandingPage.tsx b/packages/web/src/pages/LandingPage.tsx index 7f80d5e54f..b7fd273d2c 100644 --- a/packages/web/src/pages/LandingPage.tsx +++ b/packages/web/src/pages/LandingPage.tsx @@ -371,20 +371,24 @@ function CorrelationPanel() { return (
- Key correlation + Illustrative relationship
Sleep consistency + Heart Rate Variability
- Correlation + Illustrative sample +
+
Example points
+
+ No measured correlation +
+
+ No sample size or confidence interval is shown for this illustration.
-
r = 0.72
-
Strong positive
-
24 paired days of 30
-

Example sources: Oura sleep + Apple Health heart rate variability (HRV)

-

Confidence: moderate; association, not causation.

-

Next: compare late meals on the same nights.

+

Example source types: sleep + heart rate variability

+

Illustrative data only—not a measured Dofek result.

+

+ Real relationships can reflect missing observations or other factors; association does not + establish causation. +

+

+ Next: connect sources to compare your own paired records. +

);