diff --git a/frontend/src/components/maps/LocationMapBottomSheet.jsx b/frontend/src/components/maps/LocationMapBottomSheet.jsx index b8153a4..6c4f617 100644 --- a/frontend/src/components/maps/LocationMapBottomSheet.jsx +++ b/frontend/src/components/maps/LocationMapBottomSheet.jsx @@ -1,6 +1,5 @@ import { DEFAULT_MAP_FILTERS, - MAP_OBJECT_TYPES, getMapObjectDisplayLabel, } from "../../lib/locationMapUtils"; @@ -19,14 +18,6 @@ const DISPLAY_CONTROLS = [ ["showUnmapped", "Unmapped"], ]; -function formatObjectTypeLabel(type) { - return String(type) - .split(/[-_\s]+/) - .filter(Boolean) - .map((part) => `${part.charAt(0).toUpperCase()}${part.slice(1)}`) - .join(" "); -} - export default function LocationMapBottomSheet({ mode, editorTool, @@ -40,24 +31,16 @@ export default function LocationMapBottomSheet({ visibleUnmappedItems, unmappedItemCount, hiddenAreaCount, - history, - future, saving, savingAction, hasUnsavedChanges, mapState, - mapSize, onAddObject, - onUndo, - onRedo, onSaveDraft, onPublish, onPreviewDraft, - onPanMode, - onEditObjects, onObjectField, onZoneLinkChange, - onClearSelection, onDuplicateObject, onDeleteObject, onShowHiddenAreas, @@ -80,11 +63,6 @@ export default function LocationMapBottomSheet({ : selectedObject ? selectedTitle : "Map Details"; - const sheetDescription = selectedObject && editorTool === "edit" - ? "Move, resize, link, rename, or nudge with arrow keys." - : editorTool === "edit" - ? "Tap an area to select it." - : "Drag and zoom without changing objects."; const showHeaderItemCount = mode !== "edit" && Boolean(selectedObject); const showEditorControls = mode === "edit" && canManage; const showSelectedObjectForm = Boolean(mode === "edit" && editorTool === "edit" && selectedObject); @@ -94,14 +72,7 @@ export default function LocationMapBottomSheet({ const hiddenUnmappedItemCount = Math.max(0, unmappedItemCount - visibleUnmappedItems.length); const hasHiddenUnmappedItems = filters.showUnmapped && unmappedItemCount > 0 && visibleUnmappedItems.length === 0; - const selectedWidth = Number(selectedObject?.width) || 40; - const selectedHeight = Number(selectedObject?.height) || 40; const hiddenAreaLabel = `Show Hidden Areas (${hiddenAreaCount})`; - const geometryLocked = Boolean(selectedObject?.locked); - const maxX = Math.max(0, Math.round((mapSize?.width || selectedWidth) - selectedWidth)); - const maxY = Math.max(0, Math.round((mapSize?.height || selectedHeight) - selectedHeight)); - const maxWidth = Math.max(40, Math.round(mapSize?.width || selectedWidth)); - const maxHeight = Math.max(40, Math.round(mapSize?.height || selectedHeight)); const saveDraftLabel = savingAction === "save" ? "Saving..." : "Save Draft"; const publishLabel = savingAction === "publish" ? "Publishing..." : "Publish"; const resetLayerFilters = () => setFilters({ ...DEFAULT_MAP_FILTERS }); @@ -140,9 +111,11 @@ export default function LocationMapBottomSheet({ const secondaryDraftActions = showEditorControls ? (
- - - + {!showSelectedObjectForm ? ( + + ) : null}
) : null; const editorActions = showEditorControls ? ( @@ -162,9 +135,6 @@ export default function LocationMapBottomSheet({ {selectedItemCountLabel} ) : null} - {mode === "edit" && canManage ? ( - {sheetDescription} - ) : null}
{changedLayerCount ? ( @@ -221,27 +191,6 @@ export default function LocationMapBottomSheet({
) : editorActions} - {showEditorControls ? ( -
- - -
- ) : null} - {showEditorControls && hiddenAreaCount > 0 ? (
-
- Size -
- - -
-
- - {geometryLocked ? ( -

- Unlock this area before moving or resizing it. -

- ) : null}
-
- ) : mode === "edit" && editorTool === "edit" ? ( -

- Tap an area to edit its name, linked zone, size, and position. -

) : mode === "edit" ? ( -

- Use Pan Mode to move around the map. Switch to Objects when you want to edit areas. -

+ null ) : selectedObject ? (
{selectedZoneItems.length === 0 ? ( @@ -428,11 +288,7 @@ export default function LocationMapBottomSheet({ )}
- ) : ( -

- Tap a zone to view assigned items. Item pins stay hidden unless you turn them on in Layers. -

- )} + ) : null} {showSelectedObjectForm && secondaryDraftActions ? (
) : null} - {objects.map(renderMapObject)} + {(selectedObjectKey + ? [ + ...objects.filter((object) => getObjectKey(object) !== selectedObjectKey), + ...objects.filter((object) => getObjectKey(object) === selectedObjectKey), + ] + : objects + ).map(renderMapObject)} {emptyCanvasMessage ? (
= MAX_MAP_ZOOM; @@ -44,6 +48,26 @@ export default function LocationMapToolbar({ ) : null}
+ {mode === "edit" && canManage ? ( +
+ + +
+ ) : null} {mode === "edit" && canManage ? (