fix(ui): refine page transitions and bulk actions

This commit is contained in:
NimBold
2026-07-28 22:39:00 +03:30
parent 62f8c83c57
commit 807663cf03
8 changed files with 175 additions and 28 deletions
+22
View File
@@ -3,6 +3,8 @@ import {
canPauseDownload,
canRedownload,
canStartDownload,
countDownloadActions,
formatDownloadActionCount,
getPauseResumeAction,
isIdentityLocked,
isTransferLocked,
@@ -48,4 +50,24 @@ describe('download action policy', () => {
expect(isIdentityLocked('completed')).toBe(true);
expect(isTransferLocked('completed')).toBe(false);
});
it('counts only eligible actions for a multi-selection', () => {
const counts = countDownloadActions([
{ status: 'queued' },
{ status: 'downloading' },
{ status: 'paused' },
{ status: 'ready' },
{ status: 'staged' },
{ status: 'failed' },
{ status: 'completed' },
]);
expect(counts).toEqual({ pause: 2, resume: 4 });
});
it('keeps large action badges compact without changing the accessible count', () => {
expect(formatDownloadActionCount(2)).toBe('2');
expect(formatDownloadActionCount(99)).toBe('99');
expect(formatDownloadActionCount(100)).toBe('99+');
});
});