From 138c3e3aa89334e50331687345fb60a558efebdd Mon Sep 17 00:00:00 2001 From: Nico Date: Wed, 3 Jun 2026 13:21:26 -0700 Subject: [PATCH] fix: clarify map zone item empty states --- .../maps/LocationMapBottomSheet.jsx | 29 ++++- .../src/styles/pages/LocationMapManager.css | 17 +++ frontend/tests/location-map-manager.spec.ts | 122 ++++++++++++++++++ 3 files changed, 166 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/maps/LocationMapBottomSheet.jsx b/frontend/src/components/maps/LocationMapBottomSheet.jsx index 3995588..ac6090f 100644 --- a/frontend/src/components/maps/LocationMapBottomSheet.jsx +++ b/frontend/src/components/maps/LocationMapBottomSheet.jsx @@ -46,7 +46,13 @@ export default function LocationMapBottomSheet({ onDeleteObject, }) { const selectedTitle = selectedObject?.label || selectedObject?.zone_name || "Map Area"; - const selectedItemCountLabel = `${selectedZoneItems.length} item${selectedZoneItems.length === 1 ? "" : "s"}`; + const selectedAssignedItems = selectedObject?.zone_id + ? (mapState?.items || []).filter((item) => String(item.zone_id || "") === objectZoneId(selectedObject)) + : []; + const hasHiddenSelectedItems = selectedAssignedItems.length > 0 && selectedZoneItems.length === 0; + const selectedItemCountLabel = hasHiddenSelectedItems + ? "0 shown" + : `${selectedZoneItems.length} item${selectedZoneItems.length === 1 ? "" : "s"}`; const sheetTitle = mode === "edit" ? selectedObject && editorTool === "edit" ? "Object Settings" @@ -58,6 +64,14 @@ export default function LocationMapBottomSheet({ : "Map Details"; const showEditorControls = mode === "edit" && canManage; const showSelectedObjectForm = Boolean(mode === "edit" && editorTool === "edit" && selectedObject); + const showSelectedZoneItems = () => { + setFilters((current) => ({ + ...current, + showMyItems: true, + showOtherItems: true, + showCompleted: true, + })); + }; const editorActions = showEditorControls ? (
@@ -218,7 +232,18 @@ export default function LocationMapBottomSheet({ {selectedItemCountLabel}
{selectedZoneItems.length === 0 ? ( -

No visible items assigned to this zone.

+
+

+ {hasHiddenSelectedItems + ? "Items are assigned here, but hidden by layer filters." + : "No items assigned to this zone yet."} +

+ {hasHiddenSelectedItems ? ( + + ) : null} +
) : (