From 3ac80c9a5b2f80948e860c66e3893753e4fabc42 Mon Sep 17 00:00:00 2001
From: Nico
Date: Wed, 3 Jun 2026 15:41:04 -0700
Subject: [PATCH] fix: prioritize blank map setup
---
.../components/maps/LocationMapSetupPanel.jsx | 25 ++++++++++++++-----
frontend/tests/location-map-manager.spec.ts | 6 +++++
2 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/frontend/src/components/maps/LocationMapSetupPanel.jsx b/frontend/src/components/maps/LocationMapSetupPanel.jsx
index 30d9f37..721d07c 100644
--- a/frontend/src/components/maps/LocationMapSetupPanel.jsx
+++ b/frontend/src/components/maps/LocationMapSetupPanel.jsx
@@ -44,12 +44,25 @@ export default function LocationMapSetupPanel({
No zones are available yet. Create a blank map now, or add zones first for an automatic starter layout.
) : null}
-
-
+ {!hasZones ? (
+ <>
+
+
+ >
+ ) : (
+ <>
+
+
+ >
+ )}
) : null}
diff --git a/frontend/tests/location-map-manager.spec.ts b/frontend/tests/location-map-manager.spec.ts
index 5a51959..a064ef1 100644
--- a/frontend/tests/location-map-manager.spec.ts
+++ b/frontend/tests/location-map-manager.spec.ts
@@ -396,6 +396,12 @@ test("admin setup explains when no zones exist yet", async ({ page }) => {
await expect(page.getByText("No zones are available yet.")).toBeVisible();
await expect(page.getByRole("button", { name: "Create From Zones" })).toBeDisabled();
await expect(page.getByRole("button", { name: "Create Blank Map" })).toBeEnabled();
+ const blankButtonBox = await page.getByRole("button", { name: "Create Blank Map" }).boundingBox();
+ const fromZonesButtonBox = await page.getByRole("button", { name: "Create From Zones" }).boundingBox();
+ expect(blankButtonBox).not.toBeNull();
+ expect(fromZonesButtonBox).not.toBeNull();
+ if (!blankButtonBox || !fromZonesButtonBox) throw new Error("No-zone setup actions were not measurable");
+ expect(blankButtonBox.y).toBeLessThan(fromZonesButtonBox.y);
await expect(page.getByLabel("Map controls")).toHaveCount(0);
});