Stabilize collector scrolling for large package sets

Reserve each offscreen collector package with its exact expanded or collapsed block height so content-visibility cannot collapse flex items to zero and rebuild the scroll geometry while moving through the list. Add a regression test for the rendered intrinsic block-size contract.
This commit is contained in:
Sucukdeluxe
2026-08-26 14:15:43 +02:00
parent da4c2fb069
commit aea0839b08
3 changed files with 20 additions and 3 deletions
+10
View File
@@ -18,6 +18,7 @@ import {
CollectorSidebar,
CollectorToolbar,
CollectorView,
collectorPackageIntrinsicBlockSize,
toggleAllCollectorPackageIds,
type CollectorViewActions
} from "../src/renderer/views/collector/CollectorView";
@@ -286,6 +287,15 @@ describe("collector workspace model", () => {
});
describe("CollectorView", () => {
it("reserves the exact package height while content visibility skips offscreen rows", () => {
const expanded = buildCollectorWorkspaceViewModel([packages[0]], "all", "", false, [], [], "", true).packages[0];
const collapsed = { ...expanded, collapsed: true };
expect(collectorPackageIntrinsicBlockSize(expanded)).toBe(126);
expect(collectorPackageIntrinsicBlockSize(collapsed)).toBe(46);
expect(renderToStaticMarkup(<CollectorContent actions={createActions()} model={buildCollectorWorkspaceViewModel([packages[0]], "all", "", false, [], [], "", true)} />)).toContain("contain-intrinsic-block-size:auto 126px");
});
it("renders expandable package and file rows with preview columns", () => {
const html = renderToStaticMarkup(<CollectorView actions={createActions()} model={buildCollectorWorkspaceViewModel(packages, "all", "", false, [], [], "", true)} />);