web: drop the heading over the folder column
The column carried the name of the folder its tree belongs to, painted above the rows. The rows already say it — the head of the tree is a row like any other — so the heading only said it twice, and because it was not a row it stayed on screen when the tree was folded away: the one label left with nothing under it. The right click that raised it now finds the row itself, which is where a reader aims anyway. The label, its menu hook, its translation and its rule go; the tree, the row menus and fold-all keep working as before. Co-authored-by: PenguinHarness <noreply@penguin.local>
This commit is contained in:
@@ -359,10 +359,12 @@ step(
|
||||
(await page.$('[data-key="lib-node-CheckRoll/2026"]')) !== null,
|
||||
await page.$eval('[data-key="lib-node-CheckRoll"] .adm-album-name', (e) => e.textContent)
|
||||
);
|
||||
// The folder's name is the row's, said once: a heading over the column would only
|
||||
// repeat it, and that heading would outlive the rows when the tree is folded.
|
||||
step(
|
||||
'the column is titled with the folder the tree belongs to',
|
||||
(await page.$eval('[data-key="lib-root-name"]', (e) => e.textContent)) === 'Roll A',
|
||||
await page.$eval('[data-key="lib-root-name"]', (e) => e.textContent)
|
||||
'the folder is named on its row and nowhere over the column',
|
||||
(await page.$$('[data-key="lib-root-name"], .lib-col-title')).length === 0 &&
|
||||
(await page.$eval('[data-key="lib-node-CheckRoll"] .adm-album-name', (e) => e.textContent)) === 'Roll A'
|
||||
);
|
||||
|
||||
// The empty part of the column is where one more folder comes from.
|
||||
@@ -373,10 +375,10 @@ step('a right click on the empty column offers a folder', blank.join(',') === 'l
|
||||
await page.keyboard.press('Escape');
|
||||
step('escape closes the folder menu too', (await page.$('[data-key="lib-menu"]')) === null);
|
||||
|
||||
// The head of the tree is the whole tree's control: a right click on the column's
|
||||
// own name, or on the row of a folder picked at the top level, folds the folders
|
||||
// nested below the top level. The top-level row itself stays open — one click on
|
||||
// its name already shuts it, so the menu item would only repeat that click — and
|
||||
// The head of the tree is the whole tree's control: a right click on the row of a
|
||||
// folder picked at the top level folds the folders nested below the top level. The
|
||||
// top-level row itself stays open — one click on its name already shuts it, so the
|
||||
// menu item would only repeat that click — and
|
||||
// the frames in the strip are the strip's business and do not move with the rows.
|
||||
// The subfolder opened above carries a fold of its own, so it is opened first:
|
||||
// the claim is what ONE click does to every row at once, not to one already shut.
|
||||
@@ -387,8 +389,7 @@ await page.waitForFunction(() => document.querySelectorAll('[data-key^="lib-node
|
||||
});
|
||||
const deepRows = await page.$$eval('[data-key^="lib-node-"]', (els) => els.length);
|
||||
const deepTiles = await page.$$eval(thumbs, (els) => els.length);
|
||||
// The row is where a reader right-clicks, so fold-the-tree leads that row's own
|
||||
// menu rather than living only on the column's name above it.
|
||||
// The row is where a reader right-clicks, so fold-the-tree leads that row's menu.
|
||||
await page.click('[data-key="lib-node-CheckRoll"]', { button: 'right' });
|
||||
await page.waitForSelector('[data-key="lib-menu"]', { timeout: 10_000 });
|
||||
const rowMenu = await page.$$eval('[data-key="lib-menu"] button', (els) => els.map((b) => b.dataset.key));
|
||||
@@ -397,16 +398,6 @@ step(
|
||||
rowMenu.join(',') === 'lib-menu-collapse,lib-rename-CheckRoll,lib-rescan-CheckRoll,lib-drop-CheckRoll',
|
||||
JSON.stringify(rowMenu),
|
||||
);
|
||||
await page.keyboard.press('Escape');
|
||||
await page.click('[data-key="lib-root-name"]', { button: 'right' });
|
||||
await page.waitForSelector('[data-key="lib-menu"]', { timeout: 10_000 });
|
||||
const head = await page.$$eval('[data-key="lib-menu"] button', (els) => els.map((b) => b.dataset.key));
|
||||
step('a right click on the column name offers it alone', head.join(',') === 'lib-menu-collapse', JSON.stringify(head));
|
||||
step(
|
||||
'the column name still reads as the folder it belongs to',
|
||||
(await page.$eval('[data-key="lib-root-name"]', (e) => e.textContent)) === 'Roll A',
|
||||
await page.getAttribute('[data-key="lib-root-name"]', 'title')
|
||||
);
|
||||
await page.click('[data-key="lib-menu-collapse"]');
|
||||
await page.waitForFunction(() => document.querySelectorAll('[data-key^="lib-node-"]').length === 3, null, {
|
||||
timeout: 10_000,
|
||||
|
||||
Reference in New Issue
Block a user