feat(downloads): inherit package selection visually

This commit is contained in:
Sucukdeluxe
2026-08-25 05:29:54 +02:00
parent afcc1fe782
commit ee66f1b3d9
2 changed files with 22 additions and 3 deletions
+10
View File
@@ -63,6 +63,7 @@ import {
DOWNLOAD_PACKAGE_ROW_HEIGHT,
calculateDownloadVirtualWindow
} from "../src/renderer/views/downloads/download-virtualizer";
import { isDownloadItemVisuallySelected } from "../src/renderer/views/downloads/VirtualizedDownloadsBody";
import {
compactDownloadServiceLabel,
extractHoster,
@@ -947,6 +948,15 @@ describe("downloads model", () => {
expect(model.actionableSelectedIds).toEqual(["package-a"]);
});
it("visually inherits package selection without adding child ids to the action selection", () => {
const selectedIds = new Set(["package-a"]);
const child = item("active", "package-a", "downloading");
expect(isDownloadItemVisuallySelected(child, selectedIds, "packages")).toBe(true);
expect(isDownloadItemVisuallySelected(child, selectedIds, "files")).toBe(false);
expect([...selectedIds]).toEqual(["package-a"]);
});
it("keeps occupied package rows logical while preserving active packages and an actionable visible selection", () => {
const packageEntries = Array.from({ length: 264 }, (_, index) => pkg(`p-${index}`, `Paket ${index}`, [`i-${index}`]));
const itemEntries = packageEntries.map((entry, index) => item(`i-${index}`, entry.id, index === 263 ? "downloading" : "queued"));