Sort pinned packages by progress: most completed items first
Build and Release / build (push) Has been cancelled
Build and Release / build (push) Has been cancelled
Active packages are now sorted by completed item count (descending), then by downloaded bytes, so packages with real download progress appear above packages still in link resolution phase. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
e0eb3f0453
commit
45b0d71dd0
@@ -688,6 +688,19 @@ export function App(): ReactElement {
|
||||
if (active.length === 0 || active.length === packages.length) {
|
||||
return packages;
|
||||
}
|
||||
// Sort active packages: most progress first (completed items, then downloaded bytes)
|
||||
active.sort((a, b) => {
|
||||
const aItems = a.itemIds.map((id) => snapshot.session.items[id]).filter(Boolean);
|
||||
const bItems = b.itemIds.map((id) => snapshot.session.items[id]).filter(Boolean);
|
||||
const aCompleted = aItems.filter((i) => i.status === "completed").length;
|
||||
const bCompleted = bItems.filter((i) => i.status === "completed").length;
|
||||
if (aCompleted !== bCompleted) {
|
||||
return bCompleted - aCompleted;
|
||||
}
|
||||
const aBytes = aItems.reduce((s, i) => s + (i.downloadedBytes || 0), 0);
|
||||
const bBytes = bItems.reduce((s, i) => s + (i.downloadedBytes || 0), 0);
|
||||
return bBytes - aBytes;
|
||||
});
|
||||
return [...active, ...rest];
|
||||
}, [packages, snapshot.session.running, snapshot.session.items]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user