From 8b33f2fd26a335637dd0ab768d87c8b98d7cbc54 Mon Sep 17 00:00:00 2001 From: roble Date: Sat, 28 Nov 2026 18:10:00 +0000 Subject: [PATCH 1/4] test: the sidebar renders no empty menu groups An app with no main or bottom links (a template's) must not keep their padded, empty groups. Core's NavGroup now skips them. Co-Authored-By: Claude Opus 5.5 --- tests/e2e/tests/sidebar.spec.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/e2e/tests/sidebar.spec.ts b/tests/e2e/tests/sidebar.spec.ts index 804a2e6..5ab2d0d 100644 --- a/tests/e2e/tests/sidebar.spec.ts +++ b/tests/e2e/tests/sidebar.spec.ts @@ -21,6 +21,24 @@ test.describe.parallel('Sidebar layout', () => { ).toBeVisible(); }); + // An app with no main or bottom links (a template's) must not keep their padded, + // empty groups: they push the next block down for nothing. + test('renders no empty menu groups', async ({ + page, + credentials, + loginAs, + }) => { + await loginAs(credentials.user); + await page.goto('/dashboard'); + await expectAuthenticated(page); + + await expect( + page.locator( + '[data-sidebar="content"] [data-slot="sidebar-menu"]:empty', + ), + ).toHaveCount(0); + }); + test('theme selector submenu opens', async ({ page, credentials, From 49abf38813e1edfdd4d4923c403c320a9c9fe9b7 Mon Sep 17 00:00:00 2001 From: roble Date: Sun, 29 Nov 2026 10:21:28 +0000 Subject: [PATCH 2/4] test: the sidebar resizes, ignores a right-button drag and clamps a stored width Co-Authored-By: Claude Opus 5.5 --- tests/e2e/tests/sidebar.spec.ts | 96 +++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/tests/e2e/tests/sidebar.spec.ts b/tests/e2e/tests/sidebar.spec.ts index 5ab2d0d..e741ad7 100644 --- a/tests/e2e/tests/sidebar.spec.ts +++ b/tests/e2e/tests/sidebar.spec.ts @@ -39,6 +39,102 @@ test.describe.parallel('Sidebar layout', () => { ).toHaveCount(0); }); + // Dragged wider, the sidebar keeps its width across a reload; a double click resets it. + test('resizes by dragging its edge', async ({ + page, + credentials, + loginAs, + }) => { + await loginAs(credentials.user); + await page.goto('/dashboard'); + await expectAuthenticated(page); + + const sidebar = page + .locator('[data-slot="sidebar"] [data-sidebar="sidebar"]') + .first(); + const handle = page.getByTestId('sidebar-resize'); + const before = (await sidebar.boundingBox())!.width; + const box = (await handle.boundingBox())!; + + await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2); + await page.mouse.down(); + await page.mouse.move( + box.x + box.width / 2 + 80, + box.y + box.height / 2, + { steps: 5 }, + ); + await page.mouse.up(); + + await expect + .poll(async () => (await sidebar.boundingBox())!.width) + .toBeCloseTo(before + 80, -1); + + await page.reload(); + await expect + .poll(async () => (await sidebar.boundingBox())!.width) + .toBeCloseTo(before + 80, -1); + + await handle.dblclick(); + await expect + .poll(async () => (await sidebar.boundingBox())!.width) + .toBeCloseTo(before, -1); + }); + + // Only the primary button drags: a right-click opens a context menu that can swallow pointerup. + test('ignores a right-button drag on its edge', async ({ + page, + credentials, + loginAs, + }) => { + await loginAs(credentials.user); + await page.goto('/dashboard'); + await expectAuthenticated(page); + + const sidebar = page + .locator('[data-slot="sidebar"] [data-sidebar="sidebar"]') + .first(); + const before = (await sidebar.boundingBox())!.width; + const box = (await page.getByTestId('sidebar-resize').boundingBox())!; + + await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2); + await page.mouse.down({ button: 'right' }); + await page.mouse.move( + box.x + box.width / 2 + 80, + box.y + box.height / 2, + { steps: 5 }, + ); + await page.mouse.up({ button: 'right' }); + + expect((await sidebar.boundingBox())!.width).toBeCloseTo(before, -1); + }); + + // A width stored by an older build, or edited by hand, still lands in range. + test('keeps a stored width within its limits', async ({ + page, + credentials, + loginAs, + }) => { + await loginAs(credentials.user); + + await page.addInitScript(() => + localStorage.setItem('sidebar:width', '9999'), + ); + await page.goto('/dashboard'); + await expectAuthenticated(page); + // The width the layout sets; the sidebar's own box differs a little between stacks. + await expect + .poll(() => + page + .locator('[data-slot="sidebar-wrapper"]') + .evaluate((el) => + getComputedStyle(el) + .getPropertyValue('--sidebar-width') + .trim(), + ), + ) + .toBe('448px'); + }); + test('theme selector submenu opens', async ({ page, credentials, From 1e2acc320c4f5fc12ce88f9645865d75737b3d8a Mon Sep 17 00:00:00 2001 From: roble Date: Sun, 29 Nov 2026 20:16:13 +0000 Subject: [PATCH 3/4] test: the dashboard sidebar has no resize handle Resizing is AppLayout's opt-in `resizable`; its behaviour is covered by core's Layout/AppLayout stories. Co-Authored-By: Claude Opus 5.5 --- tests/e2e/tests/sidebar.spec.ts | 91 ++------------------------------- 1 file changed, 5 insertions(+), 86 deletions(-) diff --git a/tests/e2e/tests/sidebar.spec.ts b/tests/e2e/tests/sidebar.spec.ts index e741ad7..2b41f19 100644 --- a/tests/e2e/tests/sidebar.spec.ts +++ b/tests/e2e/tests/sidebar.spec.ts @@ -39,8 +39,10 @@ test.describe.parallel('Sidebar layout', () => { ).toHaveCount(0); }); - // Dragged wider, the sidebar keeps its width across a reload; a double click resets it. - test('resizes by dragging its edge', async ({ + // Resizing is a page's choice (AppLayout's `resizable`, which the chat turns on); the + // dashboard keeps the default width. Dragging, the keys and the limits are covered by + // core's Layout/AppLayout stories. + test('the dashboard sidebar has no resize handle', async ({ page, credentials, loginAs, @@ -49,90 +51,7 @@ test.describe.parallel('Sidebar layout', () => { await page.goto('/dashboard'); await expectAuthenticated(page); - const sidebar = page - .locator('[data-slot="sidebar"] [data-sidebar="sidebar"]') - .first(); - const handle = page.getByTestId('sidebar-resize'); - const before = (await sidebar.boundingBox())!.width; - const box = (await handle.boundingBox())!; - - await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2); - await page.mouse.down(); - await page.mouse.move( - box.x + box.width / 2 + 80, - box.y + box.height / 2, - { steps: 5 }, - ); - await page.mouse.up(); - - await expect - .poll(async () => (await sidebar.boundingBox())!.width) - .toBeCloseTo(before + 80, -1); - - await page.reload(); - await expect - .poll(async () => (await sidebar.boundingBox())!.width) - .toBeCloseTo(before + 80, -1); - - await handle.dblclick(); - await expect - .poll(async () => (await sidebar.boundingBox())!.width) - .toBeCloseTo(before, -1); - }); - - // Only the primary button drags: a right-click opens a context menu that can swallow pointerup. - test('ignores a right-button drag on its edge', async ({ - page, - credentials, - loginAs, - }) => { - await loginAs(credentials.user); - await page.goto('/dashboard'); - await expectAuthenticated(page); - - const sidebar = page - .locator('[data-slot="sidebar"] [data-sidebar="sidebar"]') - .first(); - const before = (await sidebar.boundingBox())!.width; - const box = (await page.getByTestId('sidebar-resize').boundingBox())!; - - await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2); - await page.mouse.down({ button: 'right' }); - await page.mouse.move( - box.x + box.width / 2 + 80, - box.y + box.height / 2, - { steps: 5 }, - ); - await page.mouse.up({ button: 'right' }); - - expect((await sidebar.boundingBox())!.width).toBeCloseTo(before, -1); - }); - - // A width stored by an older build, or edited by hand, still lands in range. - test('keeps a stored width within its limits', async ({ - page, - credentials, - loginAs, - }) => { - await loginAs(credentials.user); - - await page.addInitScript(() => - localStorage.setItem('sidebar:width', '9999'), - ); - await page.goto('/dashboard'); - await expectAuthenticated(page); - // The width the layout sets; the sidebar's own box differs a little between stacks. - await expect - .poll(() => - page - .locator('[data-slot="sidebar-wrapper"]') - .evaluate((el) => - getComputedStyle(el) - .getPropertyValue('--sidebar-width') - .trim(), - ), - ) - .toBe('448px'); + await expect(page.getByTestId('sidebar-resize')).toHaveCount(0); }); test('theme selector submenu opens', async ({ From 8c1ed94c09e3c710992f6d63cf523c18d356a43a Mon Sep 17 00:00:00 2001 From: roble Date: Mon, 30 Nov 2026 16:52:34 +0000 Subject: [PATCH 4/4] test: the resize-handle check skips when a template replaces the dashboard Co-Authored-By: Claude Opus 5.5 --- tests/e2e/tests/sidebar.spec.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/e2e/tests/sidebar.spec.ts b/tests/e2e/tests/sidebar.spec.ts index 2b41f19..ab35f26 100644 --- a/tests/e2e/tests/sidebar.spec.ts +++ b/tests/e2e/tests/sidebar.spec.ts @@ -50,6 +50,13 @@ test.describe.parallel('Sidebar layout', () => { await loginAs(credentials.user); await page.goto('/dashboard'); await expectAuthenticated(page); + // A template may send the dashboard to a page of its own (the chat template: to the + // chat, whose sidebar resizes): that page is the template's to test. Tenancy's path + // mode keeps it a dashboard, under the workspace (`/w//dashboard`). + test.skip( + !new URL(page.url()).pathname.endsWith('/dashboard'), + 'the dashboard is replaced by a template page', + ); await expect(page.getByTestId('sidebar-resize')).toHaveCount(0); });