From 8f0d8bbe259cc6145f1db992b106c0e4bece1ddb Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 29 Sep 2026 07:14:41 +0000 Subject: [PATCH] fix(ui): show reused ROI estimates after sync Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com> --- .../_components/ROICalculatorView.integration.test.tsx | 3 ++- .../roi-calculator/_components/ROICalculatorView.tsx | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/litellm-dashboard/src/app/(dashboard)/roi-calculator/_components/ROICalculatorView.integration.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/roi-calculator/_components/ROICalculatorView.integration.test.tsx index b1ceaff38d0..012cba5e4c4 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/roi-calculator/_components/ROICalculatorView.integration.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/roi-calculator/_components/ROICalculatorView.integration.test.tsx @@ -227,7 +227,7 @@ describe("ROICalculatorView", () => { stage: "Estimating pull requests", total: 1, }; - const completedStatus = { ...idleStatus, phase: "complete", done: 1, total: 1 }; + const completedStatus = { ...idleStatus, phase: "complete", done: 57, total: 57, reused: 57 }; vi.mocked(apiClient.get) .mockResolvedValueOnce(settings) .mockResolvedValueOnce({ report: null }) @@ -247,6 +247,7 @@ describe("ROICalculatorView", () => { expect(await screen.findByText("Spend per estimated engineering hour", {}, { timeout: 5000 })).toBeInTheDocument(); expect(screen.queryByRole("heading", { name: "Connect GitHub to get started" })).not.toBeInTheDocument(); expect(screen.getByRole("status")).toHaveTextContent("Up to date · Last synced Sep 30, 2026, 12:00 PM UTC"); + expect(screen.getByRole("status")).toHaveTextContent("57 of 57 estimates reused"); }); it("shows the sync error returned by the status endpoint", async () => { diff --git a/ui/litellm-dashboard/src/app/(dashboard)/roi-calculator/_components/ROICalculatorView.tsx b/ui/litellm-dashboard/src/app/(dashboard)/roi-calculator/_components/ROICalculatorView.tsx index 5ee490340c5..bcbb52b5cd9 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/roi-calculator/_components/ROICalculatorView.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/roi-calculator/_components/ROICalculatorView.tsx @@ -192,6 +192,9 @@ export default function ROICalculatorView({ {syncedAt && ( Up to date · Last synced {formatSyncedAt(syncedAt)} + {!status.running && status.phase === "complete" && status.reused > 0 + ? ` · ${status.reused} of ${status.total} estimates reused` + : ""} )}