From 2c8d2acdcb90e4c98532d02932b7780d5205410f Mon Sep 17 00:00:00 2001 From: Jaret Burkett Date: Thu, 26 Mar 2026 10:33:17 -0600 Subject: [PATCH] On jobs table, sort idle jobs by last updated so recent active ones are at the top --- ui/src/components/JobsTable.tsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/ui/src/components/JobsTable.tsx b/ui/src/components/JobsTable.tsx index 315ecd63..e7ae3980 100644 --- a/ui/src/components/JobsTable.tsx +++ b/ui/src/components/JobsTable.tsx @@ -111,12 +111,18 @@ export default function JobsTable({ onlyActive = false }: JobsTableProps) { }); // sort the queued/running jobs by queue position Object.keys(jd).forEach(key => { - if (key === 'Idle') return; - jd[key].jobs.sort((a, b) => { - if (a.queue_position === null) return 1; - if (b.queue_position === null) return -1; - return a.queue_position - b.queue_position; - }); + if (key === 'Idle') { + jd[key].jobs.sort((a, b) => { + // sort by updated_at, newest first + return new Date(b.updated_at).getTime() - new Date(a.updated_at).getTime(); + }); + } else { + jd[key].jobs.sort((a, b) => { + if (a.queue_position === null) return 1; + if (b.queue_position === null) return -1; + return a.queue_position - b.queue_position; + }); + } }); return jd; }, [jobs, queues, isGPUInfoLoaded]);