From 6b12852006503a2f663f393b9b8693543ba42925 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Tue, 27 Oct 2026 19:16:59 +0000 Subject: [PATCH] test(app): cover consistent docked navigation and readable Settings Compare narrow and wide navigation density and Settings detail space through the real browser journey, including compact Settings after resize. The regression fails with main's split layout and density boundaries. Co-authored-by: Elsa --- .../e2e/browser/settings-navigation.spec.ts | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/packages/app/e2e/browser/settings-navigation.spec.ts b/packages/app/e2e/browser/settings-navigation.spec.ts index 4d7afbd4b9..3ec921a663 100644 --- a/packages/app/e2e/browser/settings-navigation.spec.ts +++ b/packages/app/e2e/browser/settings-navigation.spec.ts @@ -479,3 +479,76 @@ test.describe("Settings — compact master-detail", () => { await expect(page.getByTestId("welcome-direct-connection")).toBeVisible(); }); }); + +async function measureDockedNavigation(page: import("@playwright/test").Page, width: number) { + await page.setViewportSize({ width, height: 951 }); + const history = page.getByRole("button", { name: /^History/ }).filter({ visible: true }); + const settings = page + .getByRole("button", { name: "Settings", exact: true }) + .filter({ visible: true }); + await expect(history).toBeVisible(); + await expect(settings).toBeVisible(); + return { + width, + history: await history.evaluate((el) => el.getBoundingClientRect().height), + settings: await settings.evaluate((el) => el.getBoundingClientRect().height), + }; +} + +async function measureSettingsSplit(page: import("@playwright/test").Page, width: number) { + await page.setViewportSize({ width, height: 951 }); + const sidebar = page.getByTestId("settings-sidebar"); + const detail = page.getByTestId("settings-detail-pane"); + await expect(sidebar).toBeVisible(); + await expect(detail).toBeVisible(); + return { + width, + sidebar: await sidebar.evaluate((el) => el.getBoundingClientRect().width), + detail: await detail.evaluate((el) => el.getBoundingClientRect().width), + }; +} + +async function expectConsistentDockedNavigation(page: import("@playwright/test").Page) { + const wide = await measureDockedNavigation(page, 951); + for (const width of [600, 669, 719, 720]) { + const narrow = await measureDockedNavigation(page, width); + expect + .soft(narrow.history, `History keeps its wide-layout density at ${width}`) + .toBeCloseTo(wide.history, 0); + expect + .soft(narrow.settings, `Settings keeps its wide-layout density at ${width}`) + .toBeCloseTo(wide.settings, 0); + } +} + +async function expectSettingsDetailKeepsReadingWidth(page: import("@playwright/test").Page) { + const reference = await measureSettingsSplit(page, 720); + for (const width of [600, 669, 719]) { + const narrow = await measureSettingsSplit(page, width); + expect + .soft(narrow.detail, `Settings preserves its detail budget at ${width}`) + .toBeGreaterThanOrEqual(reference.detail); + expect + .soft(narrow.sidebar, `Settings navigation yields width at ${width}`) + .toBeLessThan(reference.sidebar); + } + const wide = await measureSettingsSplit(page, 951); + expect(wide.sidebar).toBeCloseTo(reference.sidebar, 0); + expect(wide.detail).toBeGreaterThan(reference.detail); +} + +test("docked navigation keeps its density and Settings preserves reading width", async ({ + page, + withWorkspace, +}) => { + const workspace = await withWorkspace({ prefix: "narrow-wide-layout-" }); + await gotoWorkspace(page, workspace.workspaceId); + await expectConsistentDockedNavigation(page); + await openSettings(page); + await openSettingsSection(page, "appearance"); + await expectAppearanceContent(page); + await expectSettingsDetailKeepsReadingWidth(page); + await page.setViewportSize({ width: 599, height: 951 }); + await expectSettingsSidebarHidden(page); + await expectAppearanceContent(page); +});