From 4d3b12936ae2e9761af56a862a0f4da6f1c2e582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 10 May 2026 20:52:07 +0200 Subject: [PATCH] feat(insights): rename "Muster" + lift section tabs above the hero MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two related polishing changes for the Insights surface: a) Correlation row title rename. "Muster" / "Patterns" reads as a loose grouping; the row actually shows pre-defined statistical relationships between two metrics. Rename to "Zusammenhänge" / "Relationships" so the title carries the same conceptual weight as the surrounding "Trends" / "Daily Briefing" headers without borrowing the "Trends" word from the row above it. Picked "Zusammenhänge" over "Trends" because the Trends row already uses that word and a correlation is conceptually a relationship between two series rather than a single-series trend. b) Section tabs lift above the hero strip. `` was mounted below the advisor card so the user had to scroll past the hero before discovering the metric-tab nav. Lift it to the top of the page so the tabs are the first thing visible — the hero + daily briefing render directly below, and clicking a tab still scrolls to the matching section. Sticky scroll-anchored behaviour preserved (incremental over a full SPA-tab rewrite) so today's reactive surface keeps working. Co-Authored-By: Claude Opus 4.7 (1M context) --- messages/de.json | 6 +++--- messages/en.json | 6 +++--- src/app/insights/page.tsx | 15 +++++++++++---- .../insights/__tests__/correlation-card.test.tsx | 2 +- .../insights/__tests__/correlation-row.test.tsx | 2 +- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/messages/de.json b/messages/de.json index 1d62e5054..4629a54dc 100644 --- a/messages/de.json +++ b/messages/de.json @@ -826,12 +826,12 @@ "confidenceLow": "Geringe Konfidenz" }, "correlationRow": { - "title": "Muster", + "title": "Zusammenhänge", "subtitle": "Vorab definierte Hypothesen, gegated auf n ≥ 14 und p < 0,05", - "disclaimer": "Muster sind beobachtend, nicht kausal — sprich mit deinem Arzt, wenn der Blutdruck hoch ist.", + "disclaimer": "Zusammenhänge sind beobachtend, nicht kausal — sprich mit deinem Arzt, wenn der Blutdruck hoch ist.", "experimentCta": "7-Tage-Experiment starten", "experimentTooltip": "Bald verfügbar", - "emptyTitle": "Mehr Daten nötig, um dieses Muster zu zeigen", + "emptyTitle": "Mehr Daten nötig, um diesen Zusammenhang zu zeigen", "sourceChip": "basierend auf {n} gepaarten Messungen · {window}", "sourceWindowLast30": "letzte 30 Tage", "confidenceHigh": "Hohe Konfidenz", diff --git a/messages/en.json b/messages/en.json index 62ccee213..f1d8af3d6 100644 --- a/messages/en.json +++ b/messages/en.json @@ -826,12 +826,12 @@ "confidenceLow": "Low confidence" }, "correlationRow": { - "title": "Patterns", + "title": "Relationships", "subtitle": "Pre-defined hypotheses, gated on n ≥ 14 and p < 0.05", - "disclaimer": "Patterns are observational, not causal — talk to your doctor if BP runs high.", + "disclaimer": "Relationships are observational, not causal — talk to your doctor if BP runs high.", "experimentCta": "Try a 7-day experiment", "experimentTooltip": "Coming soon", - "emptyTitle": "Need more data to see this pattern", + "emptyTitle": "Need more data to see this relationship", "sourceChip": "based on {n} paired readings · {window}", "sourceWindowLast30": "last 30 days", "confidenceHigh": "High confidence", diff --git a/src/app/insights/page.tsx b/src/app/insights/page.tsx index 3c2eb6b2a..38e716291 100644 --- a/src/app/insights/page.tsx +++ b/src/app/insights/page.tsx @@ -949,6 +949,15 @@ export default function InsightsPage() { return (
+ {/* v1.4.22 A5 — section tabs lift above the hero strip so the + user sees the metric-tab nav before scrolling. The nav itself + remains a sticky scroll-anchored strip — clicking a tab + scrolls to the matching section, scrolling highlights the + active tab. Hero + Daily Briefing always render below the + nav; the metric tabs control which sub-sections are visible + in the user's viewport. */} + + = 14 + p < 0.05; cards below the bar render a per-card - empty-state. The row-level disclaimer ("Patterns are observational, - not causal …") sits below the grid once. */} + empty-state. The row-level disclaimer ("Relationships are + observational, not causal …") sits below the grid once. */} {analytics?.correlations && ( )} @@ -1008,8 +1017,6 @@ export default function InsightsPage() { legacyPayload={advisor.payload?.legacyPayload ?? false} /> - -

diff --git a/src/components/insights/__tests__/correlation-card.test.tsx b/src/components/insights/__tests__/correlation-card.test.tsx index 657b48cec..0e0937984 100644 --- a/src/components/insights/__tests__/correlation-card.test.tsx +++ b/src/components/insights/__tests__/correlation-card.test.tsx @@ -88,7 +88,7 @@ describe("", () => { it("renders the empty-state when status=insufficient", () => { const html = render(); - expect(html).toContain("Need more data to see this pattern"); + expect(html).toContain("Need more data to see this relationship"); expect(html).not.toContain("Try a 7-day experiment"); }); diff --git a/src/components/insights/__tests__/correlation-row.test.tsx b/src/components/insights/__tests__/correlation-row.test.tsx index 96a171ca9..9e5559c66 100644 --- a/src/components/insights/__tests__/correlation-row.test.tsx +++ b/src/components/insights/__tests__/correlation-row.test.tsx @@ -100,7 +100,7 @@ describe("", () => { ); const matches = html.match(/data-slot="correlation-row-disclaimer"/g) ?? []; expect(matches.length).toBe(1); - expect(html).toContain("Patterns are observational, not causal"); + expect(html).toContain("Relationships are observational, not causal"); }); it("applies the 2-up grid on >= md when 2+ ok cards render", () => {