diff --git a/frontend/src/components/maps/LocationMapBottomSheet.jsx b/frontend/src/components/maps/LocationMapBottomSheet.jsx index 02c1064..dcceee0 100644 --- a/frontend/src/components/maps/LocationMapBottomSheet.jsx +++ b/frontend/src/components/maps/LocationMapBottomSheet.jsx @@ -1,4 +1,4 @@ -import { MAP_OBJECT_TYPES } from "../../lib/locationMapUtils"; +import { DEFAULT_MAP_FILTERS, MAP_OBJECT_TYPES } from "../../lib/locationMapUtils"; function objectZoneId(object) { return object?.zone_id ? String(object.zone_id) : ""; @@ -69,6 +69,7 @@ export default function LocationMapBottomSheet({ : "Drag and zoom without changing objects."; const showEditorControls = mode === "edit" && canManage; const showSelectedObjectForm = Boolean(mode === "edit" && editorTool === "edit" && selectedObject); + const changedLayerCount = DISPLAY_CONTROLS.filter(([key]) => filters[key] !== DEFAULT_MAP_FILTERS[key]).length; const showSelectedZoneItems = () => { setFilters((current) => ({ ...current, @@ -117,8 +118,12 @@ export default function LocationMapBottomSheet({ className={`location-map-layer-toggle ${layersOpen ? "active" : ""}`} onClick={() => setLayersOpen((current) => !current)} aria-expanded={layersOpen} + aria-label={changedLayerCount ? `Layers, ${changedLayerCount} changed` : "Layers"} > Layers + {changedLayerCount ? ( + + ) : null} diff --git a/frontend/src/styles/pages/LocationMapManager.css b/frontend/src/styles/pages/LocationMapManager.css index 36c8557..a2bca84 100644 --- a/frontend/src/styles/pages/LocationMapManager.css +++ b/frontend/src/styles/pages/LocationMapManager.css @@ -357,6 +357,9 @@ .location-map-layer-toggle { min-height: 40px; + display: inline-flex; + align-items: center; + gap: 0.35rem; padding: 0.45rem 0.7rem; border: 1px solid var(--color-border-light); border-radius: 999px; @@ -366,6 +369,19 @@ cursor: pointer; } +.location-map-layer-count { + min-width: 1.35rem; + height: 1.35rem; + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 999px; + background: var(--color-primary); + color: #06111f; + font-size: 0.72rem; + font-weight: 900; +} + .location-map-layer-toggle.active { border-color: var(--color-primary); background: rgba(59, 130, 246, 0.22); diff --git a/frontend/tests/location-map-manager.spec.ts b/frontend/tests/location-map-manager.spec.ts index 0645070..f85c5f8 100644 --- a/frontend/tests/location-map-manager.spec.ts +++ b/frontend/tests/location-map-manager.spec.ts @@ -716,6 +716,7 @@ test("viewer wraps long zone labels and keeps item counts visible", async ({ pag await page.getByRole("button", { name: "Layers" }).click(); await page.getByLabel("Labels").uncheck(); + await expect(page.getByRole("button", { name: "Layers, 1 changed" })).toBeVisible(); await expect(produceArea.locator(".location-map-label")).toHaveCount(0); await expect(produceArea.locator(".location-map-count")).toHaveText("2 items"); await expect(produceArea.locator(".location-map-count")).toHaveAttribute("y", "92");