fix: unify map edit tool toggle

This commit is contained in:
Nico 2026-06-04 20:13:31 -07:00
parent a7a4a8714a
commit 1020d11382
2 changed files with 19 additions and 12 deletions

View File

@ -164,6 +164,14 @@
background: rgba(15, 23, 34, 0.68);
}
.location-map-tool-buttons {
gap: 0.25rem;
padding: 0.25rem;
border: 1px solid var(--color-border-light);
border-radius: 999px;
background: rgba(15, 23, 34, 0.68);
}
.location-map-mode-buttons button {
min-height: 36px;
border-color: transparent;
@ -171,6 +179,14 @@
background: transparent;
}
.location-map-tool-buttons button {
min-width: 96px;
min-height: 36px;
border-color: transparent;
border-radius: 999px;
background: transparent;
}
.location-map-mode-buttons button.active,
.location-map-tool-buttons button.active,
.location-map-editor-actions button.primary,
@ -218,18 +234,6 @@
pointer-events: none;
}
.location-map-tool-buttons button.is-pan.active {
border-color: rgba(245, 158, 11, 0.78);
background: rgba(245, 158, 11, 0.22);
color: #f8fafc;
}
.location-map-tool-buttons button.is-edit.active {
border-color: rgb(45, 212, 191);
background: rgba(20, 184, 166, 0.24);
color: #f8fafc;
}
.location-map-editor-actions button.danger {
border-color: rgba(248, 113, 113, 0.5);
background: rgba(248, 113, 113, 0.24);

View File

@ -301,9 +301,12 @@ test("admin creates a map from zones, saves a draft, and publishes it", async ({
await expect(page.getByText("Frozen Foods")).toBeVisible();
await expect(page.getByRole("button", { name: "Move Map" })).toBeVisible();
await expect(page.getByRole("button", { name: "Edit Areas" })).toBeVisible();
await expect(page.locator(".location-map-tool-buttons")).toHaveCSS("border-radius", "999px");
await expect(page.getByRole("button", { name: "Edit Areas" })).toHaveAttribute("aria-pressed", "true");
await expect(page.locator(".location-map-pin")).toHaveCount(0);
await page.getByRole("button", { name: "Move Map" }).click();
await expect(page.getByRole("button", { name: "Move Map" })).toHaveAttribute("aria-pressed", "true");
const bakeryPanObject = page.locator(".location-map-object", { hasText: "Bakery" }).locator("rect").first();
const panBox = await bakeryPanObject.boundingBox();
expect(panBox).not.toBeNull();