web: let a wheel tick walk the strip sideways

This commit is contained in:
2026-09-28 19:44:25 +07:00
parent 2c78ff80e8
commit bd206a8be9
2 changed files with 25 additions and 1 deletions
+16
View File
@@ -381,6 +381,22 @@ await page.click(`[data-key="lib-thumb-${rawId}"]`);
const meta = await page.locator('[data-key="lib-stage-meta"]').innerText();
step('the frame says it was edited', /đã chỉnh|edited/.test(meta), meta.replace(/\n/g, ' · '));
// The strip is a shelf, not a page: when the open folder holds more frames than
// fit, a plain wheel tick over it walks them along — a wheel has no sideways
// axis to scroll a row with. The window is narrowed until the three tiles of the
// open roll no longer fit, which is what a long roll looks like anyway.
await page.click('[data-key="lib-node-CheckRoll"]');
await page.waitForFunction((sel) => document.querySelectorAll(sel).length === 3, thumbs, { timeout: 30_000 });
await page.setViewportSize({ width: 320, height: 720 });
await page.waitForTimeout(200);
const shelf = await page.$eval('[data-key="lib-strip"]', (el) => ({ sw: el.scrollWidth, cw: el.clientWidth }));
const shelfBox = await (await page.$('[data-key="lib-strip"]')).boundingBox();
await page.mouse.move(shelfBox.x + shelfBox.width / 2, shelfBox.y + shelfBox.height / 2);
await page.mouse.wheel(0, 200);
await page.waitForTimeout(300);
const walked = await page.$eval('[data-key="lib-strip"]', (el) => el.scrollLeft);
step('a wheel tick walks the strip along', shelf.sw > shelf.cw && walked > 0, `${shelf.sw}px of tiles in ${shelf.cw}px, scrolled to ${walked}`);
await browser.close();
sampleServer.close();
app.kill('SIGTERM');