diff --git a/frontend/src/components/maps/LocationMapBottomSheetSections.jsx b/frontend/src/components/maps/LocationMapBottomSheetSections.jsx index 19b3ee5..7251555 100644 --- a/frontend/src/components/maps/LocationMapBottomSheetSections.jsx +++ b/frontend/src/components/maps/LocationMapBottomSheetSections.jsx @@ -87,7 +87,11 @@ export function LocationMapLayerPanel({ filters, setFilters }) { setFilters((current) => ({ ...current, [key]: !current[key] })) } > - {label} + + {label} ))} diff --git a/frontend/src/components/maps/LocationMapToolbar.jsx b/frontend/src/components/maps/LocationMapToolbar.jsx index 69f6fea..7e546ec 100644 --- a/frontend/src/components/maps/LocationMapToolbar.jsx +++ b/frontend/src/components/maps/LocationMapToolbar.jsx @@ -66,12 +66,11 @@ export default function LocationMapToolbar({ }) { const isAtMinZoom = zoom <= MIN_MAP_ZOOM; const isAtMaxZoom = zoom >= MAX_MAP_ZOOM; - const showHistorySlot = canManage && hasAnyMap; - const canUseHistoryControls = mode === "edit" && showHistorySlot; + const canUseHistoryControls = mode === "edit" && canManage && hasAnyMap; return ( @@ -100,11 +99,10 @@ export default function LocationMapToolbar({ ) : null} - {showHistorySlot ? ( + {canUseHistoryControls ? ( { const historyActions = page.locator(".location-map-history-buttons"); const zoomControls = page.locator(".location-map-zoom-controls"); const viewModeBox = await modeButtons.boundingBox(); - const reservedHistoryBox = await historyActions.boundingBox(); const viewZoomBox = await zoomControls.boundingBox(); expect(viewModeBox).not.toBeNull(); - expect(reservedHistoryBox).not.toBeNull(); expect(viewZoomBox).not.toBeNull(); - if (!viewModeBox || !reservedHistoryBox || !viewZoomBox) { + if (!viewModeBox || !viewZoomBox) { throw new Error("Compact tablet toolbar layout was not measurable"); } expect(viewModeBox.width).toBeGreaterThanOrEqual(180); expect(viewModeBox.width).toBeLessThanOrEqual(190); - await expect(historyActions).toHaveCSS("visibility", "hidden"); - expect(reservedHistoryBox.x).toBeGreaterThan(viewModeBox.x + viewModeBox.width - 1); - expect(viewZoomBox.x).toBeGreaterThan(reservedHistoryBox.x + reservedHistoryBox.width - 1); + await expect(historyActions).toHaveCount(0); + expect(viewZoomBox.x).toBeGreaterThan(viewModeBox.x + viewModeBox.width - 1); await page.getByRole("button", { name: "Edit Draft" }).click(); - await expect(historyActions).toHaveCSS("visibility", "visible"); + await expect(historyActions).toHaveCount(1); const toolbarBox = await toolbar.boundingBox(); const editModeBox = await modeButtons.boundingBox(); const editHistoryBox = await historyActions.boundingBox();