From f0fc8fa9788a6c13750e27f077be590b9b87ecd9 Mon Sep 17 00:00:00 2001 From: Emil Kallioniemi Date: Tue, 21 Apr 2026 12:39:17 +0200 Subject: [PATCH] fix(ui): trace-row click navigates to per-trace view The TraceMenuItem `Link` accepted a `traceIndex` prop but never forwarded it to the route's search params. As a result, clicking a trace row left the URL unchanged and the right-hand panel stayed on the eval-level view; users could only reach the per-trace view by manually editing the URL to add `?trace=N`. Forward `traceIndex` via TanStack Router's function-form `search` prop so the URL gains `?trace=N` on click while preserving other search params (e.g. `timestamp`). The top "Eval" row has no `traceIndex`, so `trace` becomes `undefined` and is dropped from the URL, returning the view to the eval-level panel. The existing schema already types `trace` as `z.number().optional()`, so no schema change is required. --- .changeset/0000-fix-trace-row-link-search-param.md | 5 +++++ apps/evalite-ui/app/routes/suite.$name.eval.$evalIndex.tsx | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 .changeset/0000-fix-trace-row-link-search-param.md diff --git a/.changeset/0000-fix-trace-row-link-search-param.md b/.changeset/0000-fix-trace-row-link-search-param.md new file mode 100644 index 00000000..7290be94 --- /dev/null +++ b/.changeset/0000-fix-trace-row-link-search-param.md @@ -0,0 +1,5 @@ +--- +"evalite": patch +--- + +Fix: clicking a trace row in the eval detail view now navigates to the per-trace panel. Previously the row's `Link` omitted `search: { trace }`, so the URL never changed and the right panel stayed on the eval-level view. Users had to manually append `?trace=N` to the URL as a workaround. diff --git a/apps/evalite-ui/app/routes/suite.$name.eval.$evalIndex.tsx b/apps/evalite-ui/app/routes/suite.$name.eval.$evalIndex.tsx index d298dedc..f242ddc5 100644 --- a/apps/evalite-ui/app/routes/suite.$name.eval.$evalIndex.tsx +++ b/apps/evalite-ui/app/routes/suite.$name.eval.$evalIndex.tsx @@ -409,6 +409,10 @@ const TraceMenuItem = (props: { name: props.name, evalIndex: props.evalIndex, }} + search={(prev) => ({ + ...prev, + trace: props.traceIndex, + })} className={ "px-3 py-2 hover:bg-foreground/10 transition-colors border-l-4" }