From 6b4fc0e4f2beef0803d026f7cbb1e2d89e54c1dc Mon Sep 17 00:00:00 2001 From: Mariana Martinho Date: Tue, 15 Sep 2026 23:53:26 +0000 Subject: [PATCH 1/3] fix(models): the workspace list opens beside the account menu again The switcher used to be a full width row, so a submenu placed to its left cleared the menu. #17743 made it a 32px button at the right edge, and the submenu has been landing on top of the menu ever since, covering the very workspace it is offered from. The offset is measured from the menu's own left edge rather than the button's, so it follows the menu if its width changes instead of pinning a number that would rot. Covered against a real signed-in session: the list's right edge stays at or before the menu's left edge. Verified in reverse by restoring the old offset, which fails that case. (cherry picked from commit 6f6aeaa56d4cc4303feb436277fdaa1ce37976a2) --- apps/website/e2e/models-sign-in-draft.spec.ts | 59 +++++++++++++++++++ .../workshop/HeaderWorkspaceMenu.vue | 18 +++++- 2 files changed, 76 insertions(+), 1 deletion(-) diff --git a/apps/website/e2e/models-sign-in-draft.spec.ts b/apps/website/e2e/models-sign-in-draft.spec.ts index 2e917dd7f34..aa1524928f7 100644 --- a/apps/website/e2e/models-sign-in-draft.spec.ts +++ b/apps/website/e2e/models-sign-in-draft.spec.ts @@ -167,6 +167,65 @@ test('unavailable draft storage does not trap sign-in and reports missing files ).toHaveCount(0) }) +test('the workspace list opens beside the account menu, not over it', async ({ + page, + modelsAccount +}) => { + await page.route('**/api/workspaces', (route) => + route.fulfill({ + status: 200, + contentType: 'application/json', + body: JSON.stringify({ + workspaces: [ + { + id: 'ws-personal', + name: 'Personal Workspace', + role: 'owner', + type: 'personal', + created_at: '2026-01-01T00:00:00Z', + joined_at: '2026-01-01T00:00:00Z' + }, + { + id: 'ws-team', + name: 'Design Team', + role: 'member', + type: 'team', + subscription_tier: 'PRO', + created_at: '2026-02-01T00:00:00Z', + joined_at: '2026-02-01T00:00:00Z' + } + ] + }) + }) + ) + await page.goto('/login/') + await page.getByRole('button', { name: 'Use email instead' }).click() + await page.getByLabel('Email').fill(modelsAccount.email) + await page + .getByLabel('Password', { exact: true }) + .fill(modelsAccount.password) + await page.getByRole('button', { name: 'Sign in', exact: true }).click() + await expect(page).toHaveURL('/') + + await page.locator('[data-testid="header-account"]:visible').click() + const menu = page.getByTestId('header-account-menu') + await expect(menu).toBeVisible() + await page.getByTestId('account-workspace').click() + 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) +}) + test.describe('Narrow account menu', () => { test.use({ viewport: { width: 320, height: 720 } }) diff --git a/apps/website/src/components/workshop/HeaderWorkspaceMenu.vue b/apps/website/src/components/workshop/HeaderWorkspaceMenu.vue index 422918c5c9a..db9b5487078 100644 --- a/apps/website/src/components/workshop/HeaderWorkspaceMenu.vue +++ b/apps/website/src/components/workshop/HeaderWorkspaceMenu.vue @@ -1,5 +1,6 @@