fix(studio): show Layers full-height in the flat inspector, not split with Design

The flat inspector split Layers and Design into a vertically-resizable
stacked pair whenever both panes were toggled on, mirroring the legacy
panel's layout. For the flat redesign this reads as two competing panels
crammed into one column; Layers should always render full-height by
itself there instead.

Gate the split-view branch behind !STUDIO_FLAT_INSPECTOR_ENABLED so it
still applies to the legacy panel, and fall through to Layers rendering
alone (the existing `layersPaneOpen` branch already does this — it just
never got reached previously because the split check ran first).

Also added setExclusiveRightInspectorPane (radio-style: selecting one pane
turns the other off) and use it for the Design/Layers tab clicks under the
flat flag, since leaving both panes independently toggleable would highlight
both tabs as "active" while only one actually renders.

New usePanelLayout.test.ts covers both the existing toggle behavior and the
new exclusive variant. Full studio suite (2634 tests) green; typecheck/
oxlint/oxfmt clean.
This commit is contained in:
Vance Ingalls
2026-07-15 19:05:38 -07:00
parent c621fd0f29
commit 79b688f204
4 changed files with 95 additions and 2 deletions
@@ -96,6 +96,14 @@ export function usePanelLayout(initialState?: InitialPanelLayoutState) {
});
}, []);
// Radio-style variant for the flat inspector: Layers always renders full-
// height by itself there (never split-shared with Design), so leaving both
// panes independently toggleable would highlight both tabs as "active"
// while only one actually shows. Selecting one turns the other off.
const setExclusiveRightInspectorPane = useCallback((pane: RightInspectorPane) => {
setRightInspectorPanes({ design: pane === "design", layers: pane === "layers" });
}, []);
return {
leftWidth,
setLeftWidth,
@@ -109,6 +117,7 @@ export function usePanelLayout(initialState?: InitialPanelLayoutState) {
setRightPanelTab: trackedSetRightPanelTab,
rightInspectorPanes,
toggleRightInspectorPane,
setExclusiveRightInspectorPane,
toggleLeftSidebar,
handlePanelResizeStart,
handlePanelResizeMove,