Prevent collector snapshot rerender stalls

Memoize the collector content across unrelated app snapshots and release collapsed child rows from the DOM after their closing animation. Draw the idle speed sparkline as a pixel-aligned one-physical-pixel stroke so its thickness remains uniform across display scales.
This commit is contained in:
Sucukdeluxe
2026-08-26 14:09:01 +02:00
parent 14525fa4c3
commit da4c2fb069
5 changed files with 84 additions and 16 deletions
+15 -4
View File
@@ -14,6 +14,7 @@ import {
import {
CollectorContent,
CollectorInputDialog,
MemoizedCollectorContent,
CollectorSidebar,
CollectorToolbar,
CollectorView,
@@ -323,10 +324,20 @@ describe("CollectorView", () => {
expect(html).not.toContain("SBS14HD.part01.rar");
});
it("keeps the animated disclosure frame mounted for compact packages", () => {
const html = renderToStaticMarkup(<CollectorContent actions={createActions()} model={buildCollectorWorkspaceViewModel(packages, "all", "", false, [], ["package-sbs"], "", true)} />);
expect(html).toContain("collector-package-items-frame is-collapsed is-animated");
expect(html).toContain("SBS14HD.part01.rar");
it("removes collapsed child rows from the DOM even when animations are enabled", () => {
const html = renderToStaticMarkup(<CollectorContent actions={createActions()} model={buildCollectorWorkspaceViewModel([packages[0]], "all", "", false, [], ["package-sbs"], "", true)} />);
expect(html).not.toContain("collector-package-items-frame");
expect(html).not.toContain("SBS14HD.part01.rar");
});
it("reuses the collector content when app snapshots keep the same collector model", () => {
const model = buildCollectorWorkspaceViewModel(packages, "all", "", false, [], [], "", true);
const compare = (MemoizedCollectorContent as unknown as {
compare: (previous: { model: typeof model; actions: CollectorViewActions }, next: { model: typeof model; actions: CollectorViewActions }) => boolean;
}).compare;
expect(compare({ model, actions: createActions() }, { model, actions: createActions() })).toBe(true);
expect(compare({ model, actions: createActions() }, { model: { ...model, query: "neu" }, actions: createActions() })).toBe(false);
});
it("offers selected and all transfer actions", () => {