web: trim the library to one toolbar and a folder menu

Fold the hint, ADD FOLDER and the two view switches onto a single row,
with the switches drawn as icons, and move a folder's rescan and remove
onto a right click — they belong to the folder, so they are asked for
rather than always on screen.
This commit is contained in:
2026-09-28 18:31:06 +07:00
parent 12936731b3
commit 19fd5b644f
5 changed files with 195 additions and 66 deletions
+21
View File
@@ -214,6 +214,27 @@ step('the grid view draws a card per frame', cards.length === 1, JSON.stringify(
await page.click('[data-key="lib-view-preview"]');
await page.waitForSelector(thumbs, { timeout: 30_000 });
// The toolbar carries the screen's one button and the two view icons on a single
// row; a folder's own rescan and remove exist only once it has been right-clicked.
const bar = await page.$eval('.lib-bar', (el) => ({
rows: new Set(
[...el.children].map((c) => {
const box = c.getBoundingClientRect();
return Math.round(box.top + box.height / 2);
})
).size,
icons: [...el.querySelectorAll('[data-key^="lib-view-"]')].every((b) => b.querySelector('svg')),
}));
step('one toolbar row holding the two view icons', bar.rows === 1 && bar.icons, JSON.stringify(bar));
step('no rescan/remove button in the pane', (await page.$$('[data-key^="lib-rescan-"], [data-key^="lib-drop-"]')).length === 0);
await page.click('[data-key="lib-node-CheckRoll/2026"]', { button: 'right' });
await page.waitForSelector('[data-key="lib-menu"]', { timeout: 10_000 });
const menu = await page.$$eval('[data-key="lib-menu"] button', (els) => els.map((b) => b.dataset.key));
step('a right click on a folder opens its menu', menu.join(',') === 'lib-rescan-CheckRoll,lib-drop-CheckRoll', JSON.stringify(menu));
await page.keyboard.press('Escape');
step('escape closes the menu', (await page.$('[data-key="lib-menu"]')) === null);
// One tap on a thumbnail raises the frame, and the button under it hands it to
// the studio. The RAW is the harder half — it has to be read back off the
// (stand-in) handle and developed — so it is the one that gets opened.