diff --git a/src/app/insights/values/[type]/page.tsx b/src/app/insights/values/[type]/page.tsx index e1915e2a3..fd1ff6556 100644 --- a/src/app/insights/values/[type]/page.tsx +++ b/src/app/insights/values/[type]/page.tsx @@ -47,20 +47,21 @@ export default function InsightsMetricValuesPage({ + + ); diff --git a/src/app/insights/workouts/[id]/page.tsx b/src/app/insights/workouts/[id]/page.tsx index d648a8b06..f55155ff5 100644 --- a/src/app/insights/workouts/[id]/page.tsx +++ b/src/app/insights/workouts/[id]/page.tsx @@ -40,19 +40,21 @@ export default function InsightsWorkoutDetailPage({ + + + {t("insights.workouts.detail.backToList")} + + + } > - - {isLoading ? (
diff --git a/src/app/settings/sources/page.tsx b/src/app/settings/sources/page.tsx deleted file mode 100644 index 198bb3d30..000000000 --- a/src/app/settings/sources/page.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { permanentRedirect } from "next/navigation"; - -/** - * v1.4.34 IW-D — `/settings/sources` permanent redirect. - * - * The Sources settings section was merged into `/settings/thresholds` - * (now titled "Targets & Sources" / "Zielwerte & Quellen"). The two - * editors share the same per-metric configuration shelf and reading - * them side-by-side on one page matches how a user actually thinks - * about metric configuration ("for this metric, which sources do I - * trust AND what range counts as healthy?"). Per - * `.planning/research/v1434-r-2-carryover-scope.md` §7 and - * `.planning/round-v1433-audit-menu.md` §7.1 (item 3). - * - * 308 (`permanentRedirect`) keeps the request method intact so any - * external system that POSTs (none today, but cheap insurance) follows - * through with its original method. Existing bookmarks, iOS Settings - * deep-links, and any docs that referenced `/settings/sources` - * continue to resolve. - */ -export default function SettingsSourcesRedirect(): never { - permanentRedirect("/settings/thresholds"); -} diff --git a/src/components/insights/__tests__/sub-page-shell.test.tsx b/src/components/insights/__tests__/sub-page-shell.test.tsx index 46394c46d..07653ce87 100644 --- a/src/components/insights/__tests__/sub-page-shell.test.tsx +++ b/src/components/insights/__tests__/sub-page-shell.test.tsx @@ -92,6 +92,23 @@ describe("", () => { expect(probeIdx).toBeLessThan(headerEnd); }); + it("renders the back link above the heading when supplied", () => { + const html = render( + back} + > + + , + ); + // v1.8.7.1 — the back-nav leads the page, above the heading. + const backIdx = html.indexOf('data-slot="back-probe"'); + const headerIdx = html.indexOf(" { const html = render( diff --git a/src/components/insights/sub-page-shell.tsx b/src/components/insights/sub-page-shell.tsx index e12d34a60..d4b108dab 100644 --- a/src/components/insights/sub-page-shell.tsx +++ b/src/components/insights/sub-page-shell.tsx @@ -31,6 +31,15 @@ import { cn } from "@/lib/utils"; export interface SubPageShellProps { title: string; + /** + * v1.8.7.1 — optional back-navigation control rendered ABOVE the page + * heading, the standard back-nav placement. Detail/values sub-pages + * (`/insights/values/[type]`, `/insights/workouts/[id]`) pass their + * "back to …" link here so it leads the page rather than trailing the + * content. Omitted on the mother page and category pages reached via the + * tab strip. + */ + backLink?: ReactNode; /** Optional accent badge (status, dataset coverage, …). */ badge?: ReactNode; /** @@ -108,6 +117,7 @@ export interface SubPageShellProps { export function SubPageShell({ title, + backLink, badge, description, explainerMetric, @@ -142,6 +152,8 @@ export function SubPageShell({ return (
+ {/* v1.8.7.1 — back-nav leads the page, above the heading. */} + {backLink}
{/* v1.8.6 — the heading row pins the Coach icon top-right while the title / nudge / badge wrap together on the left.