Skip to content

Commit

Permalink
Added VSCode link
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpocock committed Dec 5, 2024
1 parent 92de45c commit 1920386
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
13 changes: 13 additions & 0 deletions apps/evalite-ui/app/components/page-header.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
import { Link } from "@remix-run/react";
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbPage,
BreadcrumbSeparator,
} from "./ui/breadcrumb";
import { Separator } from "./ui/separator";
import { SidebarTrigger } from "./ui/sidebar";

export const InnerPageLayout = ({
children,
title,
filepath,
vscodeUrl,
}: {
title: string;
vscodeUrl: string;
filepath: string;
children: React.ReactNode;
}) => {
return (
Expand All @@ -27,6 +34,12 @@ export const InnerPageLayout = ({
{title}
</BreadcrumbPage>
</BreadcrumbItem>
<Separator orientation="vertical" className="mx-1 h-4" />
<BreadcrumbItem>
<BreadcrumbLink className="line-clamp-1" asChild>
<a href={vscodeUrl}>{filepath}</a>
</BreadcrumbLink>
</BreadcrumbItem>
</BreadcrumbList>
</Breadcrumb>
</div>
Expand Down
8 changes: 6 additions & 2 deletions apps/evalite-ui/app/routes/eval.$name.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@ export default function Page() {
);

return (
<InnerPageLayout title={name}>
<MyLineChart data={history} />
<InnerPageLayout
title={name}
vscodeUrl={`vscode://file${evaluation.filepath}`}
filepath={evaluation.filepath.split(/(\/|\\)/).slice(-1)[0]!}
>
{history.length > 1 && <MyLineChart data={history} />}
<Table>
<TableHeader>
<TableRow>
Expand Down

0 comments on commit 1920386

Please sign in to comment.