fix(editor): default sidebar to build tab, drop to select on panel close (#495)

The AI/chat tab was the default panel when opening a project; build is
the expected starting point. Also, collapsing the sidebar (rail click or
drag-collapse on desktop, sheet close on mobile) left the last build
tool armed — it now resets to select mode.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Wassim SAMAD
2026-07-14 08:48:25 -04:00
committed by GitHub
co-authored by Claude Fable 5
parent 47313263fb
commit 3625d17bfc
3 changed files with 15 additions and 1 deletions
@@ -159,6 +159,11 @@ export function EditorLayoutMobile({
const expandedThreshold = Math.max(SHEET_HANDLE_PX, defaultPx * 0.5)
if (current > expandedThreshold) {
sheetRef.current?.snapTo(SHEET_HANDLE_PX)
// Closing the sheet disarms any build tool back to select
const { mode, setMode } = useEditor.getState()
if (mode === 'build') {
setMode('select')
}
} else {
sheetRef.current?.snapTo(defaultPx)
}
@@ -52,6 +52,15 @@ function LeftColumn({
}
}, [activePanel])
// Closing (collapsing) the sidebar disarms any build tool back to select
useEffect(() => {
if (!isCollapsed) return
const { mode, setMode } = useEditor.getState()
if (mode === 'build') {
setMode('select')
}
}, [isCollapsed])
const handleResizerDown = useCallback(
(e: React.PointerEvent) => {
e.preventDefault()
+1 -1
View File
@@ -66,7 +66,7 @@ import {
} from '../lib/snapping-mode'
import useInteractionScope from './use-interaction-scope'
const DEFAULT_ACTIVE_SIDEBAR_PANEL = 'ai'
const DEFAULT_ACTIVE_SIDEBAR_PANEL = 'build'
const DEFAULT_FLOORPLAN_PANE_RATIO = 0.5
const MIN_FLOORPLAN_PANE_RATIO = 0.15
const MAX_FLOORPLAN_PANE_RATIO = 0.85