From e26705c57366d91c0cd9c5ac743f6760441743dd Mon Sep 17 00:00:00 2001 From: Joe McMahon Date: Thu, 7 May 2026 18:17:49 +0000 Subject: [PATCH 1/9] Fix for bug #1421 - UI Tour corrupts main tools menu --- src/modules/ui-tour.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/ui-tour.ts b/src/modules/ui-tour.ts index 8bfdc11d5..dd569bfbb 100644 --- a/src/modules/ui-tour.ts +++ b/src/modules/ui-tour.ts @@ -30,7 +30,8 @@ function showHeightmapCustomizationPanel() { function hideHeightmapCustomizationPanel() { const toolsContent = byId("toolsContent"); const customizationMenu = byId("customizationMenu"); - if (customizationMenu) customizationMenu.style.display = "none"; + if (!customizationMenu || customizationMenu.style.display !== "block") return; + customizationMenu.style.display = "none"; if (toolsContent) toolsContent.style.display = "block"; } From 484d909ce180dfd4a903256542883d90d3e91090 Mon Sep 17 00:00:00 2001 From: Joe McMahon Date: Thu, 7 May 2026 18:25:53 +0000 Subject: [PATCH 2/9] Adding tests to cover the failure found with bug #1421 --- tests/e2e/ui-tour.spec.ts | 68 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/tests/e2e/ui-tour.spec.ts b/tests/e2e/ui-tour.spec.ts index 7499ff642..93417aca1 100644 --- a/tests/e2e/ui-tour.spec.ts +++ b/tests/e2e/ui-tour.spec.ts @@ -442,4 +442,72 @@ test.describe("UI Tour", () => { await expect(page.locator("#customizationMenu")).toBeHidden(); await expect(page.locator("#options")).toBeHidden(); }); + + // ── Regression: toolsContent must not leak when closing early (bug #1421) ── + + test("closing tour on Layers tab step does not show toolsContent when menu is reopened", async ({ + page, + }) => { + await page.evaluate(() => (window as any).UITour.start()); + await page.waitForSelector(".driver-popover", { state: "visible" }); + + // Advance to Layers Tab step — options panel is open, Layers tab is active. + await advanceSteps(page, 4); + expect(await popoverTitle(page)).toBe(STEP_TITLES[4]); + + await page.locator(".driver-popover-close-btn").click(); + await page.waitForSelector(".driver-popover", { state: "hidden" }); + + // Reopen the options panel. + await page.locator("#optionsTrigger").click(); + await expect(page.locator("#options")).toBeVisible(); + + // Only the Layers tab content should be visible — not toolsContent. + await expect(page.locator("#layersContent")).toBeVisible(); + await expect(page.locator("#toolsContent")).toBeHidden(); + }); + + test("closing tour on Style tab step does not show toolsContent when menu is reopened", async ({ + page, + }) => { + await page.evaluate(() => (window as any).UITour.start()); + await page.waitForSelector(".driver-popover", { state: "visible" }); + + // Advance to Style Tab step — options panel is open, Style tab is active. + await advanceSteps(page, 7); + expect(await popoverTitle(page)).toBe(STEP_TITLES[7]); + + await page.locator(".driver-popover-close-btn").click(); + await page.waitForSelector(".driver-popover", { state: "hidden" }); + + // Reopen the options panel. + await page.locator("#optionsTrigger").click(); + await expect(page.locator("#options")).toBeVisible(); + + // Only the Style tab content should be visible — not toolsContent. + await expect(page.locator("#styleContent")).toBeVisible(); + await expect(page.locator("#toolsContent")).toBeHidden(); + }); + + test("closing tour on Options tab step does not show toolsContent when menu is reopened", async ({ + page, + }) => { + await page.evaluate(() => (window as any).UITour.start()); + await page.waitForSelector(".driver-popover", { state: "visible" }); + + // Advance to Options Tab step — options panel is open, Options tab is active. + await advanceSteps(page, 10); + expect(await popoverTitle(page)).toBe(STEP_TITLES[10]); + + await page.locator(".driver-popover-close-btn").click(); + await page.waitForSelector(".driver-popover", { state: "hidden" }); + + // Reopen the options panel. + await page.locator("#optionsTrigger").click(); + await expect(page.locator("#options")).toBeVisible(); + + // Only the Options tab content should be visible — not toolsContent. + await expect(page.locator("#optionsContent")).toBeVisible(); + await expect(page.locator("#toolsContent")).toBeHidden(); + }); }); From c4193f39637f8cd9f5f5f31f3264d09637c8fd0c Mon Sep 17 00:00:00 2001 From: Joe McMahon Date: Fri, 8 May 2026 13:38:21 +0000 Subject: [PATCH 3/9] Trying to tweak UI Tour button and fixing the back navigation issue --- src/index.html | 10 ++- src/modules/ui-tour.ts | 20 +++++- tests/e2e/ui-tour.spec.ts | 129 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 154 insertions(+), 5 deletions(-) diff --git a/src/index.html b/src/index.html index 11dbf51e0..0ccdccaf6 100644 --- a/src/index.html +++ b/src/index.html @@ -8635,8 +8635,14 @@ -