diff --git a/client/src/rooms/CommandRoom.tsx b/client/src/rooms/CommandRoom.tsx index 31f745a..81f3332 100644 --- a/client/src/rooms/CommandRoom.tsx +++ b/client/src/rooms/CommandRoom.tsx @@ -89,6 +89,7 @@ export function CommandRoom({ const dragStartRef = useRef<{ id: string; x: number; y: number } | null>(null); const dragTargetRef = useRef(null); const newMenuRef = useRef(null); + const stageRef = useRef(null); const workspaceOrderKey = normalizeWorkspaceKey(workspace || "none"); const sessionIds = sessions.map((session) => session.id); const sessionSignature = sessionIds.join("|"); @@ -133,6 +134,16 @@ export function CommandRoom({ const displayedTerminalSessions = activeMaximizedPaneId ? visibleSessions.filter((session) => session.id === activeMaximizedPaneId) : visibleSessions; + + // The native `resize: vertical` handle on a pane writes an inline height straight onto + // the DOM node, which React never manages and so never clears. That pinned height keeps + // a previously resized pane from shrinking when a sibling is spawned below it, so clear + // it whenever the visible pane set changes and let the grid re-tile every pane. + useEffect(() => { + stageRef.current?.querySelectorAll(".slotPane").forEach((pane) => { + pane.style.height = ""; + }); + }, [visibleSessionKey]); const visibleAgentSessions = agentSessions.filter((session) => !deletedSessionKeys.has(agentSessionKey(session))); const providerTabs = useMemo(() => { const counts = new Map([["all", visibleAgentSessions.length]]); @@ -356,6 +367,7 @@ export function CommandRoom({ {activeTab === "terminals" ? (