diff --git a/ui/litellm-dashboard/src/components/lens/investigations/InvestigationsView.tsx b/ui/litellm-dashboard/src/components/lens/investigations/InvestigationsView.tsx index 308da35e528..3a5894962ec 100644 --- a/ui/litellm-dashboard/src/components/lens/investigations/InvestigationsView.tsx +++ b/ui/litellm-dashboard/src/components/lens/investigations/InvestigationsView.tsx @@ -153,7 +153,9 @@ export function InvestigationsView({ setEditing(null); refresh(); }; - const editFromTable = (id: string) => { + const openFromTable = (id: string) => { + const running = lenses.find((l) => l.id === id)?.jobs.some((j) => j.status === "queued" || j.status === "running"); + if (running) return selectLens(id); setPeek(true); selectLens(id); setEditing("edit"); @@ -260,7 +262,7 @@ export function InvestigationsView({ lenses={lenses} connected={connected} readOnly={readOnly} - onEdit={editFromTable} + onEdit={openFromTable} onRunNow={(id) => setRunNowId(id)} /> )} @@ -310,8 +312,9 @@ export function InvestigationsView({ busy={busy} onClose={() => setRunNowId(null)} onRun={async (request) => { - await update((api) => api.startRun(runNowId, request)); + const started = await update((api) => api.startRun(runNowId, request)); setRunNowId(null); + if (started) selectLens(runNowId); }} /> )} diff --git a/ui/litellm-dashboard/src/components/lens/investigations/detail/InvestigationDetail.tsx b/ui/litellm-dashboard/src/components/lens/investigations/detail/InvestigationDetail.tsx index 5b44424f423..4a1120dac6e 100644 --- a/ui/litellm-dashboard/src/components/lens/investigations/detail/InvestigationDetail.tsx +++ b/ui/litellm-dashboard/src/components/lens/investigations/detail/InvestigationDetail.tsx @@ -5,8 +5,8 @@ import { Button } from "@/components/ui/button"; import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs"; import { RunsTab } from "./RunsTab"; -import { InvestigationProgress } from "../InvestigationProgress"; -import { StepFeed } from "../StepFeed"; +import { LiveRun } from "../live/LiveRun"; +import { previewJob } from "../../__fixtures__/reviews"; import { RunNowDialog } from "./RunNowDialog"; import { useState } from "react"; import { InvestigationSummary } from "./InvestigationSummary"; @@ -72,6 +72,8 @@ export function InvestigationDetail({ historyOffset, setHistoryOffset, } = results; + // TODO: drop the previewJob fallback together with __fixtures__/reviews.ts once real reviews flow everywhere + const shown = active ?? lens.jobs.find((j) => j.reviews.length > 0) ?? previewJob(lens); return (
@@ -96,20 +98,11 @@ export function InvestigationDetail({ )}
- {active && ( - { - void update((api) => api.cancelRun(lens.id)); - } - } - /> - )} - {active && } + void update((api) => api.cancelRun(lens.id))} + /> {runNow && (