From 68ca72041e3776e944e6816d58605170417440fb Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Sat, 3 Oct 2026 18:19:40 -0700 Subject: [PATCH] style(lens): format live run files --- .../components/lens/__fixtures__/reviews.ts | 16 +++++++++-- .../components/lens/demo/createLensDemo.ts | 5 +++- .../lens/investigations/live/LiveRun.tsx | 13 +++------ .../lens/investigations/live/LiveStrip.tsx | 10 ++++++- .../lens/investigations/live/TraceList.tsx | 28 ++++++++++++++++--- .../src/components/lens/model/status.test.ts | 6 +++- .../src/components/lens/model/status.ts | 7 ++++- 7 files changed, 66 insertions(+), 19 deletions(-) diff --git a/ui/litellm-dashboard/src/components/lens/__fixtures__/reviews.ts b/ui/litellm-dashboard/src/components/lens/__fixtures__/reviews.ts index bb8eb44db4e..f2d517535be 100644 --- a/ui/litellm-dashboard/src/components/lens/__fixtures__/reviews.ts +++ b/ui/litellm-dashboard/src/components/lens/__fixtures__/reviews.ts @@ -40,7 +40,13 @@ export const fixtureReviews: readonly Review[] = [ reasoning: "The user asked about a return 12 days after purchase. get_policy returned a 30-day window and the reply matches it, so the answer is grounded.", spans: [ - { span_id: "s1", kind: "user", name: "input", preview: "Can I return my headphones? Bought 12 days ago.", cited: false }, + { + span_id: "s1", + kind: "user", + name: "input", + preview: "Can I return my headphones? Bought 12 days ago.", + cited: false, + }, { span_id: "s2", kind: "tool", name: "get_policy", preview: "Returns accepted within 30 days.", cited: false }, ], verdicts: [], @@ -74,7 +80,13 @@ export const fixtureReviews: readonly Review[] = [ reasoning: "issue_refund timed out, but the agent told the user the refund was processed.", spans: [ { span_id: "s1", kind: "user", name: "input", preview: "Please refund invoice 8812", cited: false }, - { span_id: "s2", kind: "tool", name: "issue_refund", preview: "TimeoutError: upstream did not respond", cited: true }, + { + span_id: "s2", + kind: "tool", + name: "issue_refund", + preview: "TimeoutError: upstream did not respond", + cited: true, + }, ], verdicts: [{ check_id: "invented", kind: "issue", summary: "Claimed a refund succeeded after a timeout" }], }, diff --git a/ui/litellm-dashboard/src/components/lens/demo/createLensDemo.ts b/ui/litellm-dashboard/src/components/lens/demo/createLensDemo.ts index cc871861fc4..6fb596d3be2 100644 --- a/ui/litellm-dashboard/src/components/lens/demo/createLensDemo.ts +++ b/ui/litellm-dashboard/src/components/lens/demo/createLensDemo.ts @@ -356,7 +356,10 @@ function demoLensApi(data: LensDemoData): LensApi { run: (lensId, jobId) => found(jobs(lensId)?.find((job) => job.id === jobId)), reviews: async (lensId, jobId, after) => { const job = await found(jobs(lensId)?.find((item) => item.id === jobId)); - return { reviews: job.reviews.slice(Math.max(0, after - (job.reviewed - job.reviews.length))), reviewed: job.reviewed }; + return { + reviews: job.reviews.slice(Math.max(0, after - (job.reviewed - job.reviews.length))), + reviewed: job.reviewed, + }; }, execution: notInDemo, sample: notInDemo, diff --git a/ui/litellm-dashboard/src/components/lens/investigations/live/LiveRun.tsx b/ui/litellm-dashboard/src/components/lens/investigations/live/LiveRun.tsx index 771d29f9a5e..b1d83a53033 100644 --- a/ui/litellm-dashboard/src/components/lens/investigations/live/LiveRun.tsx +++ b/ui/litellm-dashboard/src/components/lens/investigations/live/LiveRun.tsx @@ -3,14 +3,7 @@ import { useState } from "react"; import { modelsUsed } from "../../model/inbox"; -import { - analysisModel, - doneLine, - inFlight, - issueCount, - nowLine, - stripState, -} from "../../model/live"; +import { analysisModel, doneLine, inFlight, issueCount, nowLine, stripState } from "../../model/live"; import { queueReasonText } from "../../model/status"; import type { Job, Review } from "../../model/types"; import { QueueReasonText, WorkerTasks } from "../QueueReasonText"; @@ -85,7 +78,9 @@ export function LiveRun({ done={job.status === "completed" ? doneLine(job) : null} slots={Math.max(1, Math.min(job.settings.concurrency, MAX_LANES))} checks={job.settings.checks} - scope={job.reviewed > reviews.length ? `From the latest ${reviews.length} of ${job.reviewed} reviewed traces` : ""} + scope={ + job.reviewed > reviews.length ? `From the latest ${reviews.length} of ${job.reviewed} reviewed traces` : "" + } waiting={waiting} /> diff --git a/ui/litellm-dashboard/src/components/lens/investigations/live/LiveStrip.tsx b/ui/litellm-dashboard/src/components/lens/investigations/live/LiveStrip.tsx index c63edb41bbd..987a0e0a6e1 100644 --- a/ui/litellm-dashboard/src/components/lens/investigations/live/LiveStrip.tsx +++ b/ui/litellm-dashboard/src/components/lens/investigations/live/LiveStrip.tsx @@ -11,7 +11,15 @@ import { useNow } from "@/hooks/useNow"; import { cn } from "@/lib/cva.config"; import { money } from "../../model/format"; -import { newestFirst, outcome, providerOf, reviewKey, shortVerdict, type IssueCount, type StripState } from "../../model/live"; +import { + newestFirst, + outcome, + providerOf, + reviewKey, + shortVerdict, + type IssueCount, + type StripState, +} from "../../model/live"; import type { Review } from "../../model/types"; const RECENT = 3; diff --git a/ui/litellm-dashboard/src/components/lens/investigations/live/TraceList.tsx b/ui/litellm-dashboard/src/components/lens/investigations/live/TraceList.tsx index 7959dfed0a6..177205d1d06 100644 --- a/ui/litellm-dashboard/src/components/lens/investigations/live/TraceList.tsx +++ b/ui/litellm-dashboard/src/components/lens/investigations/live/TraceList.tsx @@ -11,18 +11,28 @@ import type { Review } from "../../model/types"; const LIMIT = 200; const RED = "text-[#e5484d]"; -const ROW = "grid h-9 w-full grid-cols-[0.75rem_minmax(0,8rem)_minmax(0,1fr)_auto] items-center gap-2 px-2 text-left text-[12px]"; +const ROW = + "grid h-9 w-full grid-cols-[0.75rem_minmax(0,8rem)_minmax(0,1fr)_auto] items-center gap-2 px-2 text-left text-[12px]"; function Expanded({ review }: { review: Review }) { const verdicts = review.verdicts.length ? review.verdicts - : [{ check_id: "", kind: "pattern" as const, summary: review.cannot_assess ? "Not enough evidence to judge" : "No issue observed" }]; + : [ + { + check_id: "", + kind: "pattern" as const, + summary: review.cannot_assess ? "Not enough evidence to judge" : "No issue observed", + }, + ]; return (
{review.reasoning &&

{briefReasoning(review.reasoning)}

}