Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 6 additions & 1 deletion ui/app/hooks/use-breadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}) ?? [],
),
Expand Down
2 changes: 1 addition & 1 deletion ui/app/routes/datapoints/layout.tsx
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
1 change: 1 addition & 0 deletions ui/app/types/breadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { UIMatch } from "react-router";
export interface CrumbItem {
label: string;
isIdentifier?: boolean;
noLink?: boolean;
}

declare module "react-router" {
Expand Down
Loading