From 4ca34d4b006b4f93b0e9a72f6df7a7a27ca168c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 18 Jul 2026 09:25:29 +0200 Subject: [PATCH] fix(insights): point the ECG cross-link at the routed sub-page Repoint EcgCrossLink from the overview `#ecg` fragment to `/insights/ecg`. The fragment is absent until the overview section's own fetch resolves, so the deep link no-oped on navigation (UX-flows finding F1-1); the routed sub-page always mounts. --- src/app/insights/__tests__/ecg-cross-link-mount.test.tsx | 4 ++-- src/components/insights/__tests__/ecg-cross-link.test.tsx | 2 +- src/components/insights/ecg-cross-link.tsx | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app/insights/__tests__/ecg-cross-link-mount.test.tsx b/src/app/insights/__tests__/ecg-cross-link-mount.test.tsx index 70452e7b1..13bebd8e8 100644 --- a/src/app/insights/__tests__/ecg-cross-link-mount.test.tsx +++ b/src/app/insights/__tests__/ecg-cross-link-mount.test.tsx @@ -89,12 +89,12 @@ describe("EcgCrossLink mount on Heart sub-pages (H1)", () => { it("mounts the ECG cross-link on the resting-pulse page", () => { const html = render(); expect(html).toContain('data-slot="ecg-cross-link"'); - expect(html).toContain('href="/insights#ecg"'); + expect(html).toContain('href="/insights/ecg"'); }); it("mounts the ECG cross-link on the HRV page", () => { const html = render(); expect(html).toContain('data-slot="ecg-cross-link"'); - expect(html).toContain('href="/insights#ecg"'); + expect(html).toContain('href="/insights/ecg"'); }); }); diff --git a/src/components/insights/__tests__/ecg-cross-link.test.tsx b/src/components/insights/__tests__/ecg-cross-link.test.tsx index b5aa7a7d8..c9a4c9509 100644 --- a/src/components/insights/__tests__/ecg-cross-link.test.tsx +++ b/src/components/insights/__tests__/ecg-cross-link.test.tsx @@ -62,7 +62,7 @@ describe("", () => { hasRecordings: true, }); expect(html).toContain('data-slot="ecg-cross-link"'); - expect(html).toContain('href="/insights#ecg"'); + expect(html).toContain('href="/insights/ecg"'); expect(html).toContain("2 recordings on file."); // The latest (first) recording's DEVICE result, attributed to the device. expect(html).toContain("Latest device result:"); diff --git a/src/components/insights/ecg-cross-link.tsx b/src/components/insights/ecg-cross-link.tsx index 8fe779456..7121f87c8 100644 --- a/src/components/insights/ecg-cross-link.tsx +++ b/src/components/insights/ecg-cross-link.tsx @@ -13,7 +13,9 @@ import { TileHeader } from "@/components/insights/tile-header"; /** * S10 — ECG cross-link, the pointer from the resting-HR / pulse context into - * the ECG viewer (`/insights#ecg`). + * the ECG viewer (`/insights/ecg`). Points at the routed sub-page, which + * always mounts, rather than the overview `#ecg` fragment, which is absent + * until the overview section's own fetch resolves (UX-flows finding F1-1). * * NON-DIAGNOSTIC (load-bearing, mirrors `EcgSection` / `RhythmEventsCard`): the * card surfaces ONLY that recordings exist + the RECORDING DEVICE's OWN latest @@ -86,7 +88,7 @@ export function EcgCrossLink({ enabled = true, className }: EcgCrossLinkProps) { return (