web: rename a folder, and add one from the empty column

A folder's own menu gains a rename, which paints a label over the folder
without moving it — the frame ids and the recipes hang off the directory's
name, not the label. The empty part of the column answers a right click
with ADD FOLDER, the FOLDERS heading goes (the count already rides on
each row), and the column narrows to 118px so the stage takes the room.
This commit is contained in:
2026-09-28 18:38:02 +07:00
parent 19fd5b644f
commit 4c65923eff
6 changed files with 133 additions and 26 deletions
+33 -1
View File
@@ -231,10 +231,42 @@ step('no rescan/remove button in the pane', (await page.$$('[data-key^="lib-resc
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));
step('a right click on a folder opens its menu', menu.join(',') === 'lib-rename-CheckRoll,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);
// The column is names and counts, nothing else: the count rides on the row.
const column = await page.$eval('[data-key="lib-tree"]', (el) => Math.round(el.getBoundingClientRect().width));
step(
'no FOLDERS heading, the count on the folder row',
(await page.$$('.adm-row-title')).length === 0 && (await page.$eval('[data-key="lib-node-CheckRoll"] .adm-album-count', (e) => e.textContent)) === '2',
`${column}px column, stage ${await page.$eval('[data-key="lib-stage"]', (e) => Math.round(e.getBoundingClientRect().width))}px`
);
step('the folder column stays out of the stage\'s way', column <= 130, `${column}px`);
// A rename paints a label over the folder: the row it belongs to, and the frames
// under it, do not move — the node key is still the directory's own name.
page.once('dialog', (dialog) => dialog.accept('Roll A'));
await page.click('[data-key="lib-node-CheckRoll"]', { button: 'right' });
await page.waitForSelector('[data-key="lib-rename-CheckRoll"]', { timeout: 10_000 });
await page.click('[data-key="lib-rename-CheckRoll"]');
await page.waitForFunction(() => document.querySelector('[data-key="lib-node-CheckRoll"] .adm-album-name')?.textContent === 'Roll A', null, {
timeout: 10_000,
});
step(
'a folder can be renamed without being moved',
(await page.$('[data-key="lib-node-CheckRoll/2026"]')) !== null,
await page.$eval('[data-key="lib-node-CheckRoll"] .adm-album-name', (e) => e.textContent)
);
// The empty part of the column is where one more folder comes from.
await page.click('[data-key="lib-tree"]', { button: 'right', position: { x: 10, y: 200 } });
await page.waitForSelector('[data-key="lib-menu"]', { timeout: 10_000 });
const blank = await page.$$eval('[data-key="lib-menu"] button', (els) => els.map((b) => b.dataset.key));
step('a right click on the empty column offers a folder', blank.join(',') === 'lib-menu-add', JSON.stringify(blank));
await page.keyboard.press('Escape');
step('escape closes the folder menu too', (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.