feat(ui): action bar is contextualizez accross sections

- [download] + [remove from recent] for recent section
  - [download] + [remove from favorite] for favorite section
  - [restore] + [permanent delete] for trash section
This commit is contained in:
Edouard Vanbelle
2026-07-20 19:07:57 +02:00
parent c6b856bfc7
commit 67579932c7
7 changed files with 77 additions and 97 deletions
+8 -4
View File
@@ -55,8 +55,12 @@ test('favorites batch select-all then move dialog', async ({ page }) => {
await page.getByTestId('resource-list-select-all-checkbox').check();
await expect(page.getByTestId('resource-list-batch-close-btn')).toBeVisible();
// Batch-move opens the move dialog; cancel it.
await page.getByTestId('favorites-batch-move-btn').click();
await expect(page.getByTestId('move-dialog')).toBeVisible({ timeout: 15_000 });
await page.getByTestId('move-dialog-cancel-btn').click();
// Batch-remove-from-favorite un-stars every selected row without
// touching the underlying file — the /favorites batch bar was
// trimmed to Download + Remove-from-favorite (destructive-to-content
// actions moved into the row context menu). Verify the two folders
// vanish from the list after the click.
await page.getByTestId('favorites-batch-remove-btn').click();
await expect(page.getByTestId(f1)).toHaveCount(0, { timeout: 15_000 });
await expect(page.getByTestId(f2)).toHaveCount(0);
});
+5 -2
View File
@@ -23,12 +23,15 @@ test('recent shows accessed items, batch selection, and clear', async ({ page })
await expect(page.getByTestId('appshell-logo-link')).toBeVisible({ timeout: 15_000 });
// Switch to list view (reveals the select-all header) and batch-select.
// /recent's batch bar was trimmed to Download + Remove-from-recent
// (destructive-to-content actions moved into the row context menu),
// so this exercises the new remove-from-recent batch instead of the
// old batch-move-into-dialog flow.
await page.getByTestId('display-mode-view-list-btn').click({ timeout: 3_000 }).catch(() => {});
const selectAll = page.getByTestId('resource-list-select-all-checkbox');
if (await selectAll.isVisible().catch(() => false)) {
await selectAll.check();
await page.getByTestId('recent-batch-move-btn').click({ timeout: 3_000 }).catch(() => {});
await page.getByTestId('move-dialog-cancel-btn').click({ timeout: 3_000 }).catch(() => {});
await page.getByTestId('recent-batch-remove-btn').click({ timeout: 3_000 }).catch(() => {});
}
// Clear the history if the control is present.