Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion packages/web/src/pages/LandingPage.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
27 changes: 18 additions & 9 deletions packages/web/src/pages/LandingPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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(<LandingPage />);

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();
Expand All @@ -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(
Expand Down
28 changes: 19 additions & 9 deletions packages/web/src/pages/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -371,30 +371,40 @@ function CorrelationPanel() {
return (
<div className="rounded-xl border border-border bg-surface-solid p-3.5">
<div className="text-xs font-semibold uppercase tracking-[0.08em] text-muted">
Key correlation
Illustrative relationship
</div>
<div className="mt-1 text-sm text-muted">Sleep consistency + Heart Rate Variability</div>
<div className="mt-3 grid grid-cols-[0.55fr_1fr] items-end gap-3">
<div>
<div className="text-[11px] font-bold uppercase tracking-[0.12em] text-muted">
Correlation
Illustrative sample
</div>
<div className="mt-1 text-3xl font-bold text-accent">Example points</div>
<div className="mt-1 text-xs font-medium text-accent-secondary">
No measured correlation
</div>
<div className="text-xs text-subtle">
No sample size or confidence interval is shown for this illustration.
</div>
<div className="mt-1 text-3xl font-bold text-accent">r = 0.72</div>
<div className="mt-1 text-xs font-medium text-accent-secondary">Strong positive</div>
<div className="text-xs text-subtle">24 paired days of 30</div>
</div>
<LandingPreviewScatterPlot
accessibleName={`Example correlation scatter plot. X-axis: ${sleepConsistencyAxis}. Y-axis: ${heartRateVariabilityAxis}.`}
accessibleName={`Illustrative scatter plot for demonstration only. X-axis: ${sleepConsistencyAxis}. Y-axis: ${heartRateVariabilityAxis}.`}
xAxisLabel={sleepConsistencyAxis}
xTickLabels={["70", "100"]}
yAxisLabel={heartRateVariabilityAxis}
yTickLabels={["45", "85"]}
/>
</div>
<div className="mt-3 space-y-1 border-t border-border pt-2 text-[10px] leading-4 text-subtle">
<p>Example sources: Oura sleep + Apple Health heart rate variability (HRV)</p>
<p>Confidence: moderate; association, not causation.</p>
<p className="font-semibold text-muted">Next: compare late meals on the same nights.</p>
<p>Example source types: sleep + heart rate variability</p>
<p>Illustrative data only—not a measured Dofek result.</p>
<p>
Real relationships can reflect missing observations or other factors; association does not
establish causation.
</p>
<p className="font-semibold text-muted">
Next: connect sources to compare your own paired records.
</p>
</div>
</div>
);
Expand Down