From 6c3ac3e030f8ad768e3022961cf086ccfc3e4de2 Mon Sep 17 00:00:00 2001 From: Pascal Date: Wed, 8 Apr 2026 01:18:37 +0000 Subject: [PATCH] fix(editor): auto-switch to structure phase when interacting with nodes in floorplan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two fixes for stair selection in 2D floorplan not working: 1. floorplan-panel: remove level > 0 restriction on auto-switch to structure phase. When viewing ANY level in the floorplan while in site phase, auto-enter structure mode so structural nodes (stairs, walls, slabs) become selectable. 2. selection-manager: expand auto-switch to also cover site phase. Clicking a structural or furnish element now auto-switches from site → structure/furnish, just like it already did between structure ↔ furnish ↔ zones. This fixes the issue where stairs couldn't be selected in 2D and the floating action menu (move/duplicate/delete) wouldn't appear. --- packages/editor/src/components/editor/floorplan-panel.tsx | 2 +- packages/editor/src/components/editor/selection-manager.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/editor/src/components/editor/floorplan-panel.tsx b/packages/editor/src/components/editor/floorplan-panel.tsx index f7318707..2c12132b 100644 --- a/packages/editor/src/components/editor/floorplan-panel.tsx +++ b/packages/editor/src/components/editor/floorplan-panel.tsx @@ -5664,7 +5664,7 @@ export function FloorplanPanel() { }, [fittedViewport, levelId]) useEffect(() => { - if (!(phase === 'site' && levelNode?.type === 'level' && levelNode.level > 0)) { + if (!(phase === 'site' && levelNode?.type === 'level')) { return } diff --git a/packages/editor/src/components/editor/selection-manager.tsx b/packages/editor/src/components/editor/selection-manager.tsx index af806bda..18dbcf35 100755 --- a/packages/editor/src/components/editor/selection-manager.tsx +++ b/packages/editor/src/components/editor/selection-manager.tsx @@ -389,7 +389,8 @@ export const SelectionManager = () => { let currentStructureLayer = useEditor.getState().structureLayer // Auto-switch between zones, structure, and furnish when clicking elements on the same level. - if (currentPhase === 'structure' || currentPhase === 'furnish') { + // Also auto-switch from site phase when clicking structural/furnish elements (e.g. 2D floorplan). + if (currentPhase === 'structure' || currentPhase === 'furnish' || currentPhase === 'site') { if (isNodeInCurrentLevel(node)) { const target = getSelectionTarget(node) if (target) {