Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(traces): Show correct title prefix in trace detail peek view (#13283)

Ben Bachemf665b40eb2c6
diff --git a/web/src/components/session/index.tsx b/web/src/components/session/index.tsx
index 63d0fb4e09..0583834ce6 100644
--- a/web/src/components/session/index.tsx
+++ b/web/src/components/session/index.tsx
@@ -39,8 +39,7 @@ import {
TableViewPresetTableName,
} from "@langfuse/shared";
import { CreateNewAnnotationQueueItem } from "@/src/features/annotation-queues/components/CreateNewAnnotationQueueItem";
-import { TablePeekView } from "@/src/components/table/peek";
-import { PeekViewTraceDetail } from "@/src/components/table/peek/peek-trace-detail";
+import { TablePeekViewTraceDetail } from "@/src/components/table/peek/peek-trace-detail";
import { usePeekNavigation } from "@/src/components/table/peek/hooks/usePeekNavigation";
import { type WithStringifiedMetadata } from "@/src/utils/clientSideDomainTypes";
import { LazyTraceRow } from "@/src/components/session/TraceRow";
@@ -503,16 +502,13 @@ export const SessionPage: React.FC<{
</div>
</div>
</div>
- <TablePeekView
- peekView={{
- itemType: "TRACE",
- detailNavigationKey: "traces",
- openPeek,
- closePeek,
- expandPeek,
- resolveDetailNavigationPath,
- children: <PeekViewTraceDetail projectId={projectId} />,
- }}
+ <TablePeekViewTraceDetail
+ itemType="TRACE"
+ detailNavigationKey="traces"
+ closePeek={closePeek}
+ expandPeek={expandPeek}
+ resolveDetailNavigationPath={resolveDetailNavigationPath}
+ projectId={projectId}
/>
</Page>
);
@@ -1029,16 +1025,13 @@ export const SessionEventsPage: React.FC<{
</div>
</div>
</div>
- <TablePeekView
- peekView={{
- itemType: "TRACE",
- detailNavigationKey: "traces",
- openPeek,
- closePeek,
- expandPeek,
- resolveDetailNavigationPath,
- children: <PeekViewTraceDetail projectId={projectId} />,
- }}
+ <TablePeekViewTraceDetail
+ itemType="TRACE"
+ detailNavigationKey="traces"
+ closePeek={closePeek}
+ expandPeek={expandPeek}
+ resolveDetailNavigationPath={resolveDetailNavigationPath}
+ projectId={projectId}
/>
</Page>
);
diff --git a/web/src/components/table/peek.tsx b/web/src/components/table/peek.tsx
index d848acb41e..c0c3b10330 100644
--- a/web/src/components/table/peek.tsx
+++ b/web/src/components/table/peek.tsx
@@ -37,8 +37,6 @@ export type DataTablePeekViewProps = {
itemType: PeekViewItemType;
/** Key used for detail page navigation */
detailNavigationKey?: string;
- /** Custom prefix for the peek view title */
- customTitlePrefix?: string;
// Navigation and URL handling
/** Function to resolve the navigation path for a list entry */
@@ -53,12 +51,6 @@ export type DataTablePeekViewProps = {
expandPeek?: (openInNewTab: boolean) => void;
/** Additional peek event options */
peekEventOptions?: PeekEventControlOptions;
-
- // Content
- /**
- * The content to display in the peek view.
- */
- children: React.ReactNode;
};
export const createPeekEventHandler = (options?: PeekEventControlOptions) => {
@@ -76,12 +68,26 @@ export const createPeekEventHandler = (options?: PeekEventControlOptions) => {
};
};
-type TablePeekViewProps = {
- peekView: DataTablePeekViewProps;
+type TablePeekViewProps = Pick<
+ DataTablePeekViewProps,
+ | "itemType"
+ | "detailNavigationKey"
+ | "resolveDetailNavigationPath"
+ | "closePeek"
+ | "expandPeek"
+ | "peekEventOptions"
+> & {
+ title?: string;
+ // Content
+ /**
+ * The content to display in the peek view.
+ */
+ children: React.ReactNode;
};
function TablePeekViewComponent(props: TablePeekViewProps) {
- const { peekView } = props;
+ const peekView = props;
+ const { title, children } = props;
const router = useRouter();
const eventHandler = createPeekEventHandler(peekView.peekEventOptions);
const itemId = router.query.peek as string | undefined;
@@ -113,9 +119,7 @@ function TablePeekViewComponent(props: TablePeekViewProps) {
className="truncate text-sm font-medium focus:outline-hidden"
tabIndex={0}
>
- {peekView.customTitlePrefix
- ? `${peekView.customTitlePrefix} ${itemId}`
- : itemId}
+ {title ?? itemId}
</span>
</SheetTitle>
<div
@@ -160,7 +164,7 @@ function TablePeekViewComponent(props: TablePeekViewProps) {
<PeekTableStateProvider>
<div className="flex max-h-full min-h-0 flex-1 flex-col">
<div className="flex-1 overflow-auto" key={itemId}>
- {peekView.children}
+ {children}
</div>
</div>
</PeekTableStateProvider>
diff --git a/web/src/components/table/peek/peek-experiment-item-detail.tsx b/web/src/components/table/peek/peek-experiment-item-detail.tsx
new file mode 100644
index 0000000000..6d2bb3f2a1
--- /dev/null
+++ b/web/src/components/table/peek/peek-experiment-item-detail.tsx
@@ -0,0 +1,44 @@
+import { useRouter } from "next/router";
+import { usePeekData } from "@/src/components/table/peek/hooks/usePeekData";
+import { Trace } from "@/src/components/trace2/Trace";
+import { Skeleton } from "@/src/components/ui/skeleton";
+
+export const PeekViewExperimentItemDetail = ({
+ projectId,
+}: {
+ projectId: string;
+}) => {
+ const router = useRouter();
+ const peekId = router.query.peek as string | undefined;
+ const timestampParam = router.query.timestamp as string | undefined;
+
+ // Decode the timestamp parameter before parsing as Date
+ // This handles cases where the timestamp might be URL-encoded
+ const timestamp = timestampParam
+ ? new Date(decodeURIComponent(timestampParam))
+ : undefined;
+
+ const traceId = router.query.traceId as string | undefined;
+
+ const trace = usePeekData({
+ projectId,
+ traceId,
+ timestamp,
+ });
+
+ if (!peekId || !trace.data) {
+ return <Skeleton className="h-full w-full rounded-none" />;
+ }
+
+ return (
+ <Trace
+ key={`${trace.data.id}-${peekId}`}
+ trace={trace.data}
+ scores={trace.data.scores}
+ corrections={trace.data.corrections}
+ projectId={trace.data.projectId}
+ observations={trace.data.observations}
+ context="peek"
+ />
+ );
+};
diff --git a/web/src/components/table/peek/peek-observation-detail.tsx b/web/src/components/table/peek/peek-observation-detail.tsx
index 20926a88cf..99e1da84d4 100644
--- a/web/src/components/table/peek/peek-observation-detail.tsx
+++ b/web/src/components/table/peek/peek-observation-detail.tsx
@@ -1,14 +1,44 @@
-import { useRouter } from "next/router";
+import { TablePeekView } from "@/src/components/table/peek";
import { usePeekData } from "@/src/components/table/peek/hooks/usePeekData";
import { Trace } from "@/src/components/trace2/Trace";
import { Skeleton } from "@/src/components/ui/skeleton";
+import { useRouter } from "next/router";
export const PeekViewObservationDetail = ({
- projectId,
+ peekId,
+ trace,
}: {
- projectId: string;
+ peekId: string | undefined;
+ trace: ReturnType<typeof usePeekData>;
}) => {
+ if (!peekId || !trace.data) {
+ return <Skeleton className="h-full w-full rounded-none" />;
+ }
+
+ return (
+ <Trace
+ key={`${trace.data.id}-${peekId}`}
+ trace={trace.data}
+ scores={trace.data.scores}
+ corrections={trace.data.corrections}
+ projectId={trace.data.projectId}
+ observations={trace.data.observations}
+ context="peek"
+ />
+ );
+};
+
+export const TablePeekViewObservationDetail = (
+ props: Omit<
+ React.ComponentProps<typeof TablePeekView>,
+ "children" | "title"
+ > & {
+ projectId: string;
+ },
+) => {
const router = useRouter();
+
+ const { projectId } = props;
const peekId = router.query.peek as string | undefined;
const timestampParam = router.query.timestamp as string | undefined;
@@ -26,19 +56,18 @@ export const PeekViewObservationDetail = ({
timestamp,
});
- if (!peekId || !trace.data) {
- return <Skeleton className="h-full w-full rounded-none" />;
- }
-
return (
- <Trace
- key={`${trace.data.id}-${peekId}`}
- trace={trace.data}
- scores={trace.data.scores}
- corrections={trace.data.corrections}
- projectId={trace.data.projectId}
- observations={trace.data.observations}
- context="peek"
- />
+ <TablePeekView
+ {...props}
+ title={
+ trace.data
+ ? trace.data.name
+ ? `${trace.data.name}: ${trace.data.id}`
+ : trace.data.id
+ : traceId
+ }
+ >
+ <PeekViewObservationDetail trace={trace} peekId={peekId} />
+ </TablePeekView>
);
};
diff --git a/web/src/components/table/peek/peek-trace-detail.tsx b/web/src/components/table/peek/peek-trace-detail.tsx
index 82887ecbf2..63d8fecdf3 100644
--- a/web/src/components/table/peek/peek-trace-detail.tsx
+++ b/web/src/components/table/peek/peek-trace-detail.tsx
@@ -2,20 +2,14 @@ import { usePeekData } from "@/src/components/table/peek/hooks/usePeekData";
import { useRouter } from "next/router";
import { Trace } from "@/src/components/trace2/Trace";
import { Skeleton } from "@/src/components/ui/skeleton";
+import { TablePeekView } from "@/src/components/table/peek";
-export const PeekViewTraceDetail = ({ projectId }: { projectId: string }) => {
- const router = useRouter();
- const peekId = router.query.peek as string | undefined;
- const timestamp = router.query.timestamp
- ? new Date(router.query.timestamp as string)
- : undefined;
- const trace = usePeekData({
- projectId,
- traceId: peekId,
- timestamp,
- });
-
- return !peekId || !trace.data ? (
+export const PeekViewTraceDetail = ({
+ trace,
+}: {
+ trace: ReturnType<typeof usePeekData>;
+}) => {
+ return !trace.data ? (
<Skeleton className="h-full w-full rounded-none" />
) : (
<Trace
@@ -29,3 +23,45 @@ export const PeekViewTraceDetail = ({ projectId }: { projectId: string }) => {
/>
);
};
+
+export const TablePeekViewTraceDetail = (
+ props: Omit<
+ React.ComponentProps<typeof TablePeekView>,
+ "children" | "title"
+ > & {
+ projectId: string;
+ },
+) => {
+ const { projectId } = props;
+
+ const router = useRouter();
+ const peekId = router.query.peek as string | undefined;
+ const timestampParam = router.query.timestamp as string | undefined;
+
+ // Decode the timestamp parameter before parsing as Date
+ // This handles cases where the timestamp might be URL-encoded
+ const timestamp = timestampParam
+ ? new Date(decodeURIComponent(timestampParam))
+ : undefined;
+
+ const trace = usePeekData({
+ projectId,
+ traceId: peekId,
+ timestamp,
+ });
+
+ return (
+ <TablePeekView
+ {...props}
+ title={
+ trace.data
+ ? trace.data.name
+ ? `${trace.data.name}: ${trace.data.id}`
+ : trace.data.id
+ : peekId
+ }
+ >
+ <PeekViewTraceDetail trace={trace} />
+ </TablePeekView>
+ );
+};
diff --git a/web/src/components/table/use-cases/observations.tsx b/web/src/components/table/use-cases/observations.tsx
index 1e1f966870..3099543d6f 100644
--- a/web/src/components/table/use-cases/observations.tsx
+++ b/web/src/components/table/use-cases/observations.tsx
@@ -67,7 +67,7 @@ import { Badge } from "@/src/components/ui/badge";
import { type RowSelectionState } from "@tanstack/react-table";
import TableIdOrName from "@/src/components/table/table-id";
import { ItemBadge } from "@/src/components/ItemBadge";
-import { PeekViewObservationDetail } from "@/src/components/table/peek/peek-observation-detail";
+import { TablePeekViewObservationDetail } from "@/src/components/table/peek/peek-observation-detail";
import { usePeekNavigation } from "@/src/components/table/peek/hooks/usePeekNavigation";
import { useDetailPageLists } from "@/src/features/navigate-detail-pages/context";
import { useTableViewManager } from "@/src/components/table/table-view-presets/hooks/useTableViewManager";
@@ -78,10 +78,7 @@ import { useSelectAll } from "@/src/features/table/hooks/useSelectAll";
import { showSuccessToast } from "@/src/features/notifications/showSuccessToast";
import { TableActionMenu } from "@/src/features/table/components/TableActionMenu";
import { type TableAction } from "@/src/features/table/types";
-import {
- type DataTablePeekViewProps,
- TablePeekView,
-} from "@/src/components/table/peek";
+import { type DataTablePeekViewProps } from "@/src/components/table/peek";
import { useScoreColumns } from "@/src/features/scores/hooks/useScoreColumns";
import { scoreFilters } from "@/src/features/scores/lib/scoreColumns";
import { AddObservationsToDatasetDialog } from "@/src/features/batch-actions/components/AddObservationsToDatasetDialog/index";
@@ -1305,12 +1302,10 @@ export default function ObservationsTable({
if (hideControls) return undefined;
return {
itemType: "TRACE",
- customTitlePrefix: "Observation ID:",
detailNavigationKey: "observations",
- children: <PeekViewObservationDetail projectId={projectId} />,
...peekNavigationProps,
};
- }, [projectId, peekNavigationProps, hideControls]);
+ }, [peekNavigationProps, hideControls]);
const rows: ObservationsTableRow[] = useMemo(() => {
return generations.isSuccess
@@ -1528,7 +1523,12 @@ export default function ObservationsTable({
/>
</div>
</ResizableFilterLayout>
- {peekConfig && <TablePeekView peekView={peekConfig} />}
+ {peekConfig && (
+ <TablePeekViewObservationDetail
+ {...peekConfig}
+ projectId={projectId}
+ />
+ )}
</div>
{/* Add to Dataset Dialog */}
diff --git a/web/src/components/table/use-cases/traces.tsx b/web/src/components/table/use-cases/traces.tsx
index 0c77093c3b..b81b9258c9 100644
--- a/web/src/components/table/use-cases/traces.tsx
+++ b/web/src/components/table/use-cases/traces.tsx
@@ -85,9 +85,8 @@ import {
type TraceOmittableFilterColumn,
} from "@/src/features/filters/config/traces-config";
import { DEFAULT_SIDEBAR_IMPLICIT_ENVIRONMENT_CONFIG } from "@/src/features/filters/constants/internal-environments";
-import { PeekViewTraceDetail } from "@/src/components/table/peek/peek-trace-detail";
+import { TablePeekViewTraceDetail } from "@/src/components/table/peek/peek-trace-detail";
import { usePeekNavigation } from "@/src/components/table/peek/hooks/usePeekNavigation";
-import { TablePeekView } from "@/src/components/table/peek";
import { useTableViewManager } from "@/src/components/table/table-view-presets/hooks/useTableViewManager";
import { useFullTextSearch } from "@/src/components/table/use-cases/useFullTextSearch";
import { type TableDateRange } from "@/src/utils/date-range-utils";
@@ -1299,10 +1298,9 @@ export default function TracesTable({
peekEventOptions: {
ignoredSelectors: ['[role="checkbox"]', '[aria-label="bookmark"]'],
},
- children: <PeekViewTraceDetail projectId={projectId} />,
...peekNavigationProps,
};
- }, [projectId, hideControls, peekNavigationProps]);
+ }, [hideControls, peekNavigationProps]);
// Create ref-based wrapper to avoid stale closure when queryFilter updates
const queryFilterRef = useRef(queryFilter);
@@ -1514,7 +1512,9 @@ export default function TracesTable({
/>
</div>
</ResizableFilterLayout>
- {peekConfig && <TablePeekView peekView={peekConfig} />}
+ {peekConfig && (
+ <TablePeekViewTraceDetail {...peekConfig} projectId={projectId} />
+ )}
</div>
</DataTableControlsProvider>
);
diff --git a/web/src/features/datasets/components/DatasetCompareRunsTable.tsx b/web/src/features/datasets/components/DatasetCompareRunsTable.tsx
index 9bf387c80b..1c04082f82 100644
--- a/web/src/features/datasets/components/DatasetCompareRunsTable.tsx
+++ b/web/src/features/datasets/components/DatasetCompareRunsTable.tsx
@@ -28,8 +28,7 @@ import { useColumnFilterState } from "@/src/features/filters/hooks/useColumnFilt
import { type Prisma } from "@langfuse/shared";
import { type EnrichedDatasetRunItem } from "@langfuse/shared/src/server";
import { usePeekNavigation } from "@/src/components/table/peek/hooks/usePeekNavigation";
-import { PeekViewTraceDetail } from "@/src/components/table/peek/peek-trace-detail";
-import { TablePeekView } from "@/src/components/table/peek";
+import { TablePeekViewTraceDetail } from "@/src/components/table/peek/peek-trace-detail";
export type DatasetCompareRunRowData = {
id: string;
@@ -115,12 +114,11 @@ function DatasetCompareRunsTableInternal(props: {
const peekConfig = useMemo(
() => ({
itemType: "TRACE" as const,
- children: <PeekViewTraceDetail projectId={props.projectId} />,
closePeek,
expandPeek,
// openPeek is handled by DatasetAggregateTableCell's custom handleOpenPeek
}),
- [props.projectId, closePeek, expandPeek],
+ [closePeek, expandPeek],
);
const { runAggregateColumns, isLoading: cellsLoading } =
@@ -302,7 +300,7 @@ function DatasetCompareRunsTableInternal(props: {
}}
peekView={peekConfig}
/>
- <TablePeekView peekView={peekConfig} />
+ <TablePeekViewTraceDetail {...peekConfig} projectId={props.projectId} />
</>
);
}
diff --git a/web/src/features/evals/components/eval-templates-table.tsx b/web/src/features/evals/components/eval-templates-table.tsx
index 35bf17c4ce..9fbe0b6baa 100644
--- a/web/src/features/evals/components/eval-templates-table.tsx
+++ b/web/src/features/evals/components/eval-templates-table.tsx
@@ -337,10 +337,9 @@ export default function EvalsTemplateTable({
"[aria-label='apply'], [aria-label='actions'], [aria-label='edit'], [aria-label='clone']",
],
},
- children: <PeekViewEvaluatorTemplateDetail projectId={projectId} />,
...peekNavigationProps,
}),
- [projectId, peekNavigationProps],
+ [peekNavigationProps],
);
const convertToTableRow = (
@@ -409,7 +408,9 @@ export default function EvalsTemplateTable({
/>
</div>
</div>
- <TablePeekView peekView={peekConfig} />
+ <TablePeekView {...peekConfig}>
+ <PeekViewEvaluatorTemplateDetail projectId={projectId} />
+ </TablePeekView>
<Dialog
open={!!editTemplateId && template.isSuccess}
onOpenChange={(open) => {
diff --git a/web/src/features/evals/components/evaluator-table.tsx b/web/src/features/evals/components/evaluator-table.tsx
index 0d30c852a5..7f18f3ce13 100644
--- a/web/src/features/evals/components/evaluator-table.tsx
+++ b/web/src/features/evals/components/evaluator-table.tsx
@@ -420,10 +420,9 @@ export default function EvaluatorTable({ projectId }: { projectId: string }) {
"[aria-label='edit'], [aria-label='actions'], [aria-label='view-logs'], [aria-label='delete']",
],
},
- children: <PeekViewEvaluatorConfigDetail projectId={projectId} />,
...peekNavigationProps,
}),
- [projectId, peekNavigationProps],
+ [peekNavigationProps],
);
return (
@@ -519,7 +518,9 @@ export default function EvaluatorTable({ projectId }: { projectId: string }) {
/>
</div>
</ResizableFilterLayout>
- <TablePeekView peekView={peekConfig} />
+ <TablePeekView {...peekConfig}>
+ <PeekViewEvaluatorConfigDetail projectId={projectId} />
+ </TablePeekView>
</div>
<Dialog
open={!!editConfigId && existingEvaluator.isSuccess}
diff --git a/web/src/features/events/components/EventsTable.tsx b/web/src/features/events/components/EventsTable.tsx
index 0f7d51bf92..25bca29164 100644
--- a/web/src/features/events/components/EventsTable.tsx
+++ b/web/src/features/events/components/EventsTable.tsx
@@ -58,7 +58,7 @@ import { Badge } from "@/src/components/ui/badge";
import { type RowSelectionState } from "@tanstack/react-table";
import TableIdOrName from "@/src/components/table/table-id";
import { ItemBadge } from "@/src/components/ItemBadge";
-import { PeekViewObservationDetail } from "@/src/components/table/peek/peek-observation-detail";
+import { TablePeekViewObservationDetail } from "@/src/components/table/peek/peek-observation-detail";
import { usePeekNavigation } from "@/src/components/table/peek/hooks/usePeekNavigation";
import { useDetailPageLists } from "@/src/features/navigate-detail-pages/context";
import { useTableViewManager } from "@/src/components/table/table-view-presets/hooks/useTableViewManager";
@@ -68,10 +68,7 @@ import { TableSelectionManager } from "@/src/features/table/components/TableSele
import { useSelectAll } from "@/src/features/table/hooks/useSelectAll";
import { TableActionMenu } from "@/src/features/table/components/TableActionMenu";
import { type TableAction } from "@/src/features/table/types";
-import {
- type DataTablePeekViewProps,
- TablePeekView,
-} from "@/src/components/table/peek";
+import { type DataTablePeekViewProps } from "@/src/components/table/peek";
import { useScoreColumns } from "@/src/features/scores/hooks/useScoreColumns";
import {
addPrefixToScoreKeys,
@@ -1237,12 +1234,10 @@ export default function ObservationsEventsTable({
if (hideControls) return undefined;
return {
itemType: "TRACE",
- customTitlePrefix: "Observation ID:",
detailNavigationKey: "observations",
- children: <PeekViewObservationDetail projectId={projectId} />,
...peekNavigationProps,
};
- }, [projectId, peekNavigationProps, hideControls]);
+ }, [peekNavigationProps, hideControls]);
const rows: EventsTableRow[] = useMemo(() => {
const result =
@@ -1539,7 +1534,12 @@ export default function ObservationsEventsTable({
/>
</div>
</ResizableFilterLayout>
- {peekConfig && <TablePeekView peekView={peekConfig} />}
+ {peekConfig && (
+ <TablePeekViewObservationDetail
+ {...peekConfig}
+ projectId={projectId}
+ />
+ )}
</div>
{showRunEvaluationDialog && (
diff --git a/web/src/features/experiments/components/table/ExperimentItemsTable.tsx b/web/src/features/experiments/components/table/ExperimentItemsTable.tsx
index e644ba8530..e63ae08f79 100644
--- a/web/src/features/experiments/components/table/ExperimentItemsTable.tsx
+++ b/web/src/features/experiments/components/table/ExperimentItemsTable.tsx
@@ -35,7 +35,6 @@ import { usdFormatter, latencyFormatter } from "@/src/utils/numbers";
import { type RowSelectionState } from "@tanstack/react-table";
import TableIdOrName from "@/src/components/table/table-id";
import { usePeekNavigation } from "@/src/components/table/peek/hooks/usePeekNavigation";
-import { PeekViewObservationDetail } from "@/src/components/table/peek/peek-observation-detail";
import { ExperimentGridView } from "./ExperimentGridView";
import { useDetailPageLists } from "@/src/features/navigate-detail-pages/context";
import { useTableViewManager } from "@/src/components/table/table-view-presets/hooks/useTableViewManager";
@@ -63,6 +62,8 @@ import { ExperimentCompareTable } from "./ExperimentCompareTable";
import { useExperimentNames } from "@/src/features/experiments/hooks/useExperimentNames";
import { DiffLabel } from "@/src/features/datasets/components/DiffLabel";
import { computeScoreDiffs } from "@/src/features/datasets/lib/computeScoreDiffs";
+import { useRouter } from "next/router";
+import { PeekViewExperimentItemDetail } from "@/src/components/table/peek/peek-experiment-item-detail";
const renderExperimentSpecificHeader = (label: string) => (
<span className="text-muted-foreground">{label}</span>
@@ -226,6 +227,7 @@ export default function ExperimentItemsTable({
projectId,
hideControls = false,
}: ExperimentItemsTableProps) {
+ const router = useRouter();
const { setDetailPageList } = useDetailPageLists();
const [selectedRows, setSelectedRows] = useState<RowSelectionState>({});
const [showRunEvaluationDialog, setShowRunEvaluationDialog] = useState(false);
@@ -900,12 +902,13 @@ export default function ExperimentItemsTable({
if (!canUsePeek) return undefined;
return {
itemType: "TRACE",
- customTitlePrefix: "Experiment Item:",
detailNavigationKey: "experiment-items",
- children: <PeekViewObservationDetail projectId={projectId} />,
...peekNavigationProps,
};
- }, [projectId, peekNavigationProps, canUsePeek]);
+ }, [peekNavigationProps, canUsePeek]);
+
+ const peekId =
+ typeof router.query.peek === "string" ? router.query.peek : undefined;
const rows: ExperimentItemsTableRow[] = useMemo(() => {
if (items.status === "success" && items.rows) {
@@ -1144,7 +1147,14 @@ export default function ExperimentItemsTable({
</ResizableFilterLayout>
{/* Peek view panel */}
- {peekConfig && <TablePeekView peekView={peekConfig} />}
+ {peekConfig && (
+ <TablePeekView
+ {...peekConfig}
+ title={peekId ? `Experiment Item: ${peekId}` : undefined}
+ >
+ <PeekViewExperimentItemDetail projectId={projectId} />
+ </TablePeekView>
+ )}
{/* Run Evaluation Dialog */}
{showRunEvaluationDialog && (