Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions client/src/rooms/CommandRoom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export function CommandRoom({
const dragStartRef = useRef<{ id: string; x: number; y: number } | null>(null);
const dragTargetRef = useRef<string | null>(null);
const newMenuRef = useRef<HTMLDivElement | null>(null);
const stageRef = useRef<HTMLDivElement | null>(null);
const workspaceOrderKey = normalizeWorkspaceKey(workspace || "none");
const sessionIds = sessions.map((session) => session.id);
const sessionSignature = sessionIds.join("|");
Expand Down Expand Up @@ -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<HTMLElement>(".slotPane").forEach((pane) => {
pane.style.height = "";
});
}, [visibleSessionKey]);
const visibleAgentSessions = agentSessions.filter((session) => !deletedSessionKeys.has(agentSessionKey(session)));
const providerTabs = useMemo(() => {
const counts = new Map<SessionProviderFilter, number>([["all", visibleAgentSessions.length]]);
Expand Down Expand Up @@ -356,6 +367,7 @@ export function CommandRoom({

{activeTab === "terminals" ? (
<div
ref={stageRef}
className={[
"terminalStage embeddedStage slotTerminalStage",
activeMaximizedPaneId ? "hasMaximized" : "",
Expand Down
6 changes: 3 additions & 3 deletions client/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1086,8 +1086,8 @@ button:disabled { cursor: not-allowed; opacity: .48; }
gap: 10px;
}
.embeddedStage {
align-content: start;
grid-auto-rows: minmax(205px, auto);
align-content: stretch;
grid-auto-rows: minmax(0, 1fr);
overflow: auto;
overscroll-behavior: contain;
}
Expand Down Expand Up @@ -1130,7 +1130,7 @@ button:disabled { cursor: not-allowed; opacity: .48; }
background: var(--terminal);
}
.slotPane {
min-height: 205px;
min-height: 0;
resize: vertical;
transition: box-shadow 120ms ease, border-color 120ms ease, transform 90ms ease;
}
Expand Down