fix: close docs bulk toolbar after delete (#14711)

### Before 
https://www.loom.com/share/a626b23f29cb4a48b33d721341d734f8

### After

https://www.loom.com/share/0c88ef4f92ac470fbb76608e2de43fa7


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Fixed floating toolbar remaining visible after deleting multiple
documents via the confirmation dialog so it reliably closes when
deletion completes.

* **Tests**
* Added end-to-end checks to verify the floating toolbar is dismissed
after multi-item and “select all” deletions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: DarkSky <25152247+darkskygit@users.noreply.github.com>
This commit is contained in:
chauhan_s
2026-04-04 21:21:21 +05:30
committed by GitHub
parent 5a6c65085a
commit bfcf7fc2ba
2 changed files with 34 additions and 0 deletions
@@ -198,6 +198,7 @@ export const DocsExplorer = ({
const doc = docsService.list.doc$(docId).value;
doc?.moveToTrash();
}
handleCloseFloatingToolbar();
},
});
}, [
+33
View File
@@ -120,6 +120,9 @@ test('select two pages and delete', async ({ page }) => {
// check the page count again
await page.waitForTimeout(300);
await expect(
page.locator('[data-testid="floating-toolbar"]')
).not.toBeVisible();
expect(await getPagesCount(page)).toBe(pageCount - 2);
});
@@ -156,10 +159,40 @@ test('select three pages with shiftKey and delete', async ({ page }) => {
// check the page count again
await page.waitForTimeout(300);
await expect(
page.locator('[data-testid="floating-toolbar"]')
).not.toBeVisible();
expect(await getPagesCount(page)).toBe(pageCount - 3);
});
test('select all and delete closes the floating toolbar', async ({ page }) => {
await openHomePage(page);
await waitForEditorLoad(page);
await clickNewPageButton(page);
await clickNewPageButton(page);
await clickSideBarAllPageButton(page);
await waitForAllPagesLoad(page);
const pageCount = await getPagesCount(page);
const selectAllButton = page
.getByRole('button', { name: 'Select all' })
.last();
await selectAllButton.hover();
await selectAllButton.click();
await expect(page.locator('[data-testid="floating-toolbar"]')).toBeVisible();
await page.locator('[data-testid="list-toolbar-delete"]').click();
await page.getByRole('button', { name: 'Delete' }).click();
await page.waitForTimeout(300);
await expect(
page.locator('[data-testid="floating-toolbar"]')
).not.toBeVisible();
expect(await getPagesCount(page)).toBeLessThan(pageCount);
});
test('create a tag and delete it', async ({ page }) => {
await openHomePage(page);
await waitForEditorLoad(page);