fix(Downloads): sort active downloads by progress descending

Items actively downloading now appear at the top of the download list
instead of the bottom. Sorts by progress percentage descending so the
item furthest along is always first, and queued items (0%) are last.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Chris Sherwood 2026-02-08 08:42:26 -08:00
parent 12286b9d34
commit dcb67e7f07

View File

@ -37,6 +37,9 @@ export class DownloadService {
const allDownloads = [...fileDownloads, ...modelDownloads] const allDownloads = [...fileDownloads, ...modelDownloads]
// Filter by filetype if specified // Filter by filetype if specified
return allDownloads.filter((job) => !filetype || job.filetype === filetype) const filtered = allDownloads.filter((job) => !filetype || job.filetype === filetype)
// Sort so actively downloading items (progress > 0) appear first, then by progress descending
return filtered.sort((a, b) => b.progress - a.progress)
} }
} }