diff --git a/packages/editor/src/components/editor/floating-action-menu.tsx b/packages/editor/src/components/editor/floating-action-menu.tsx index a92d5956..ed566b79 100644 --- a/packages/editor/src/components/editor/floating-action-menu.tsx +++ b/packages/editor/src/components/editor/floating-action-menu.tsx @@ -20,7 +20,8 @@ import { sfxEmitter } from '../../lib/sfx-bus' import useEditor from '../../store/use-editor' import { NodeActionMenu } from './node-action-menu' -const ALLOWED_TYPES = ['item', 'door', 'window', 'roof', 'roof-segment'] +const ALLOWED_TYPES = ['item', 'door', 'window', 'roof', 'roof-segment', 'wall', 'slab'] +const DELETE_ONLY_TYPES = ['wall', 'slab'] export function FloatingActionMenu() { const selectedIds = useViewer((s) => s.selection.selectedIds) @@ -46,8 +47,10 @@ export function FloatingActionMenu() { const box = new THREE.Box3().setFromObject(obj) if (!box.isEmpty()) { const center = box.getCenter(new THREE.Vector3()) - // Position slightly above the object - groupRef.current.position.set(center.x, box.max.y + 0.3, center.z) + // Position above the object, with extra offset for walls/slabs to avoid covering measurement labels + const isDeleteOnly = node && DELETE_ONLY_TYPES.includes(node.type) + const yOffset = isDeleteOnly ? 0.8 : 0.3 + groupRef.current.position.set(center.x, box.max.y + yOffset, center.z) } } }) @@ -174,8 +177,8 @@ export function FloatingActionMenu() { > e.stopPropagation()} onPointerUp={(e) => e.stopPropagation()} /> diff --git a/packages/editor/src/components/editor/node-action-menu.tsx b/packages/editor/src/components/editor/node-action-menu.tsx index 94bab4cb..b383a997 100644 --- a/packages/editor/src/components/editor/node-action-menu.tsx +++ b/packages/editor/src/components/editor/node-action-menu.tsx @@ -5,8 +5,8 @@ import type { MouseEventHandler, PointerEventHandler } from 'react' type NodeActionMenuProps = { onDelete: MouseEventHandler - onDuplicate: MouseEventHandler - onMove: MouseEventHandler + onDuplicate?: MouseEventHandler + onMove?: MouseEventHandler onPointerDown?: PointerEventHandler onPointerUp?: PointerEventHandler onPointerEnter?: PointerEventHandler @@ -30,24 +30,28 @@ export function NodeActionMenu({ onPointerLeave={onPointerLeave} onPointerUp={onPointerUp} > - - + {onMove && ( + + )} + {onDuplicate && ( + + )}