fix(agent-monitoring): move Drift Score column to right after Status

This commit is contained in:
Ishaan Jaffer 2026-02-25 11:40:25 -08:00
parent dc02a6a607
commit af6b117264

View file

@ -710,8 +710,8 @@ export default function SpendLogsTable({
</div>
)}
<DataTable
columns={[
...createColumns({
columns={(() => {
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: () => <span className="text-xs font-medium text-gray-500">Drift Score</span>,
cell: ({ row }: { row: { original: { _driftScore?: number } } }) => {
@ -732,8 +733,12 @@ export default function SpendLogsTable({
</span>
);
},
}] : []),
]}
};
// 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}