feat(downloads): animate priority reordering

Rename the package disclosure option to a general animations switch and use it for both disclosure and priority-order motion. Keep previously visible virtual rows mounted during reorders, animate measured start and target positions for 1.5 seconds, and cancel all motion immediately when the setting is disabled. Extend the isolated renderer fixture so enabled and disabled behavior can be measured without touching user download state.
This commit is contained in:
Sucukdeluxe
2026-08-15 03:49:11 +02:00
parent 135b2e7316
commit 6e65332d93
12 changed files with 243 additions and 23 deletions
+21
View File
@@ -192,6 +192,27 @@ describe("visual fixtures", () => {
expect(dense).toHaveProperty("remoteDiagnostics.status.running", false);
});
it("emits the priority-sorted snapshot so visual tests can observe package motion", async () => {
const dense = createVisualFixture("dense");
const api = createVisualElectronApi(dense);
const snapshots: string[][] = [];
const unsubscribe = api.onStateUpdate((snapshot) => snapshots.push([...snapshot.session.packageOrder]));
const target = dense.snapshot.session.packageOrder[0];
await api.setPackagePriority(target, "low");
expect(dense.snapshot.session.packageOrder.at(-1)).toBe(target);
expect(snapshots.at(-1)?.at(-1)).toBe(target);
unsubscribe();
});
it("can boot the isolated renderer with animations disabled", async () => {
const dense = createVisualFixture("dense");
const api = createVisualElectronApi(dense, "?animations=off");
expect((await api.getSnapshot()).settings.animatePackageDisclosure).toBe(false);
});
it("boots the dense query once and waits for both visible package names", async () => {
expect(typeof window).toBe("undefined");
const harness = createTestVisualBootstrap(