From af6b117264739af1600091982c791b4a08b46d6b Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Wed, 25 Feb 2026 11:40:25 -0800 Subject: [PATCH] fix(agent-monitoring): move Drift Score column to right after Status --- .../src/components/view_logs/index.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/ui/litellm-dashboard/src/components/view_logs/index.tsx b/ui/litellm-dashboard/src/components/view_logs/index.tsx index c44015cd9e7..357597698dc 100644 --- a/ui/litellm-dashboard/src/components/view_logs/index.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/index.tsx @@ -710,8 +710,8 @@ export default function SpendLogsTable({ )} { + const cols = createColumns({ sortBy, sortOrder, onSortChange: (newSortBy, newSortOrder) => { @@ -719,8 +719,9 @@ export default function SpendLogsTable({ setSortOrder(newSortOrder); setCurrentPage(1); }, - }), - ...(initialKeyAlias ? [{ + }); + if (!initialKeyAlias) return cols; + const driftCol = { id: "_driftScore", header: () => Drift Score, cell: ({ row }: { row: { original: { _driftScore?: number } } }) => { @@ -732,8 +733,12 @@ export default function SpendLogsTable({ ); }, - }] : []), - ]} + }; + // Insert right after the Status column + const statusIdx = cols.findIndex((c: any) => c.header === "Status" || c.accessorKey === "metadata.status"); + const insertAt = statusIdx >= 0 ? statusIdx + 1 : 3; + return [...cols.slice(0, insertAt), driftCol, ...cols.slice(insertAt)]; + })()} data={filteredData} onRowClick={handleRowClick} isLoading={logs.isLoading}