From 5262e89d11febcd4e3518060ffe5451cb82dd414 Mon Sep 17 00:00:00 2001 From: Nico Date: Thu, 4 Jun 2026 18:28:21 -0700 Subject: [PATCH] fix: omit empty zone detail rows --- .../maps/LocationMapBottomSheetSections.jsx | 18 ++++++++---------- frontend/tests/location-map-manager.spec.ts | 5 ++--- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/maps/LocationMapBottomSheetSections.jsx b/frontend/src/components/maps/LocationMapBottomSheetSections.jsx index dc774f3..6119272 100644 --- a/frontend/src/components/maps/LocationMapBottomSheetSections.jsx +++ b/frontend/src/components/maps/LocationMapBottomSheetSections.jsx @@ -191,19 +191,17 @@ export function SelectedZoneItemsPanel({ onSelectZoneItem, }) { if (selectedZoneItems.length === 0) { + if (!hasHiddenSelectedItems) return null; + return (
- {hasHiddenSelectedItems ? ( - - ) : ( - - )} +
); diff --git a/frontend/tests/location-map-manager.spec.ts b/frontend/tests/location-map-manager.spec.ts index 9f47fe0..73228d5 100644 --- a/frontend/tests/location-map-manager.spec.ts +++ b/frontend/tests/location-map-manager.spec.ts @@ -3609,9 +3609,8 @@ test("viewer handles empty and many-item zone panels without default pins", asyn await page.locator('[data-object-key="1562"]').locator("rect").first().click(); await expect(page.locator(".location-map-sheet-count")).toHaveText("0 items"); - const emptyZoneState = page.locator(".location-map-zone-items .location-map-inline-state", { hasText: "Items" }); - await expect(emptyZoneState).toContainText("0"); - await expect(emptyZoneState.getByRole("button")).toHaveCount(0); + await expect(page.locator(".location-map-zone-items")).toHaveCount(0); + await expect(page.locator(".location-map-inline-state", { hasText: "Items" })).toHaveCount(0); await expect(page.getByText("No items assigned to this zone yet.")).toHaveCount(0); await page.locator('[data-object-key="1561"]').locator("rect").first().click();