web: fold a folder's rows without folding its frames

This commit is contained in:
2026-09-28 19:34:37 +07:00
parent 2b45419ec4
commit 2c78ff80e8
3 changed files with 81 additions and 6 deletions
+22
View File
@@ -229,6 +229,28 @@ step(
JSON.stringify(nodes)
);
// A row with children folds its subtree on the same click that opens it, and the
// frames it holds stay in the strip — the tree narrows, the pictures do not.
await page.click('[data-key="lib-node-CheckRoll"]');
await page.waitForFunction(() => document.querySelectorAll('[data-key^="lib-node-"]').length === 1, null, {
timeout: 10_000,
polling: 50,
});
const foldedThumbs = await page.$$eval(thumbs, (els) => els.length);
const foldedMeta = await page.locator('[data-key="lib-stage-meta"]').innerText();
const shut = await page.getAttribute('[data-key="lib-node-CheckRoll"]', 'aria-expanded');
step(
'a folder folds its subtree and keeps its frames in the strip',
foldedThumbs === 3 && shut === 'false' && /P1010256/.test(foldedMeta),
`${foldedThumbs} tiles, aria-expanded=${shut}, stage ${foldedMeta.split('\n')[0]}`
);
await page.click('[data-key="lib-node-CheckRoll"]');
await page.waitForFunction(() => document.querySelectorAll('[data-key^="lib-node-"]').length === 3, null, {
timeout: 10_000,
polling: 50,
});
step('the same click draws it open again', true, '3 rows');
// Opening the subfolder redraws the strip and the frame above it.
await page.click('[data-key="lib-node-CheckRoll/2026"]');
await page.waitForFunction((sel) => document.querySelectorAll(sel).length === 2, thumbs, { timeout: 30_000 });