From d05c7e6e9b5c84d82fc609411ebd913ecf027ba5 Mon Sep 17 00:00:00 2001 From: Gabriel Bianconi <1275491+GabrielBianconi@users.noreply.github.com> Date: Thu, 11 Dec 2025 17:14:23 -0500 Subject: [PATCH] Fix breadcrumb link --- ui/app/hooks/use-breadcrumbs.ts | 7 ++++++- ui/app/routes/datapoints/layout.tsx | 2 +- ui/app/types/breadcrumbs.ts | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ui/app/hooks/use-breadcrumbs.ts b/ui/app/hooks/use-breadcrumbs.ts index 89059f8962..d057ad364b 100644 --- a/ui/app/hooks/use-breadcrumbs.ts +++ b/ui/app/hooks/use-breadcrumbs.ts @@ -26,7 +26,12 @@ export function useBreadcrumbs(): { isIdentifier, // Only show a link for this crumb if it's the last/only breadcrumb for the segment // Example: evaluation run adds two crumbs: "Runs" and the run ID. "Runs" would not be a link, since there's no dedicated runs page. - href: i === arr.length - 1 ? match.pathname : undefined, + // Also skip link if noLink is explicitly set (for routes without an index page) + href: + i === arr.length - 1 && + !(typeof crumb !== "string" && crumb.noLink) + ? match.pathname + : undefined, }; }) ?? [], ), diff --git a/ui/app/routes/datapoints/layout.tsx b/ui/app/routes/datapoints/layout.tsx index 0408d3a951..cfca5e4669 100644 --- a/ui/app/routes/datapoints/layout.tsx +++ b/ui/app/routes/datapoints/layout.tsx @@ -1,7 +1,7 @@ import { Outlet, type RouteHandle } from "react-router"; export const handle: RouteHandle = { - crumb: () => ["Datapoints"], + crumb: () => [{ label: "Datapoints", noLink: true }], }; export default function DatapointsLayout() { diff --git a/ui/app/types/breadcrumbs.ts b/ui/app/types/breadcrumbs.ts index 2ac810d81f..3b56349570 100644 --- a/ui/app/types/breadcrumbs.ts +++ b/ui/app/types/breadcrumbs.ts @@ -3,6 +3,7 @@ import type { UIMatch } from "react-router"; export interface CrumbItem { label: string; isIdentifier?: boolean; + noLink?: boolean; } declare module "react-router" {