From 0493d555d0fac6d2da22c3a7d89c4be27e63e58e Mon Sep 17 00:00:00 2001 From: Mariana Martinho Date: Wed, 16 Sep 2026 21:00:22 +0000 Subject: [PATCH 1/5] fix(models): measure the menu when it resizes, not when the window does Floating UI reapplies the menu's constrained width asynchronously, so a window listener reads the old edge and leaves the list overlapping or holding an oversized gap. Observing the panel measures it once the new width is in the layout. The end-to-end case now narrows the viewport with the list already open, where before it only checked where the list first landed. --- apps/website/e2e/models-sign-in-draft.spec.ts | 28 ++++++++++++------- .../workshop/HeaderWorkspaceMenu.vue | 24 ++++++++-------- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/apps/website/e2e/models-sign-in-draft.spec.ts b/apps/website/e2e/models-sign-in-draft.spec.ts index ca93157ca5f..8b1570a3bda 100644 --- a/apps/website/e2e/models-sign-in-draft.spec.ts +++ b/apps/website/e2e/models-sign-in-draft.spec.ts @@ -216,16 +216,24 @@ test('the workspace list opens beside the account menu, not over it', async ({ const workspaces = page.getByTestId('account-workspaces') await expect(workspaces).toBeVisible() - await expect - .poll(async () => { - const [menuBox, listBox] = await Promise.all([ - menu.boundingBox(), - workspaces.boundingBox() - ]) - if (!menuBox || !listBox) return false - return listBox.x + listBox.width <= menuBox.x - }) - .toBe(true) + const clearsTheMenu = async () => + expect + .poll(async () => { + const [menuBox, listBox] = await Promise.all([ + menu.boundingBox(), + workspaces.boundingBox() + ]) + if (!menuBox || !listBox) return false + return listBox.x + listBox.width <= menuBox.x + }) + .toBe(true) + + await clearsTheMenu() + + // The menu has a maximum width the viewport constrains, so a narrower window + // moves the edge the list is placed against while the list is already open. + await page.setViewportSize({ width: 900, height: 720 }) + await clearsTheMenu() }) test.describe('Narrow account menu', () => { diff --git a/apps/website/src/components/workshop/HeaderWorkspaceMenu.vue b/apps/website/src/components/workshop/HeaderWorkspaceMenu.vue index 83321bea221..d007e76d451 100644 --- a/apps/website/src/components/workshop/HeaderWorkspaceMenu.vue +++ b/apps/website/src/components/workshop/HeaderWorkspaceMenu.vue @@ -1,7 +1,7 @@