({
activeWorkspaceId,
setActiveTab,
setDebugOpen,
toggleDebugPanelShortcut,
toggleTerminalShortcut,
}: {
activeWorkspaceId: string | null;
setActiveTab: (tab: "home" | "projects" | "codex" | "git" | "log") => void;
setDebugOpen: (value: boolean | ((prev: boolean) => boolean)) => void;
toggleDebugPanelShortcut: string | null;
toggleTerminalShortcut: string | null;
})
| 5 | import { usePanelShortcuts } from "../../layout/hooks/usePanelShortcuts"; |
| 6 | |
| 7 | export function useLayoutController({ |
| 8 | activeWorkspaceId, |
| 9 | setActiveTab, |
| 10 | setDebugOpen, |
| 11 | toggleDebugPanelShortcut, |
| 12 | toggleTerminalShortcut, |
| 13 | }: { |
| 14 | activeWorkspaceId: string | null; |
| 15 | setActiveTab: (tab: "home" | "projects" | "codex" | "git" | "log") => void; |
| 16 | setDebugOpen: (value: boolean | ((prev: boolean) => boolean)) => void; |
| 17 | toggleDebugPanelShortcut: string | null; |
| 18 | toggleTerminalShortcut: string | null; |
| 19 | }) { |
| 20 | const { |
| 21 | appRef, |
| 22 | isResizing, |
| 23 | sidebarWidth, |
| 24 | rightPanelWidth, |
| 25 | chatDiffSplitPositionPercent, |
| 26 | onSidebarResizeStart, |
| 27 | onChatDiffSplitPositionResizeStart, |
| 28 | onRightPanelResizeStart, |
| 29 | planPanelHeight, |
| 30 | onPlanPanelResizeStart, |
| 31 | terminalPanelHeight, |
| 32 | onTerminalPanelResizeStart, |
| 33 | debugPanelHeight, |
| 34 | onDebugPanelResizeStart, |
| 35 | } = useResizablePanels(); |
| 36 | |
| 37 | const layoutMode = useLayoutMode(); |
| 38 | const isCompact = layoutMode !== "desktop"; |
| 39 | const isTablet = layoutMode === "tablet"; |
| 40 | const isPhone = layoutMode === "phone"; |
| 41 | |
| 42 | const { |
| 43 | sidebarCollapsed, |
| 44 | rightPanelCollapsed, |
| 45 | collapseSidebar, |
| 46 | expandSidebar, |
| 47 | collapseRightPanel, |
| 48 | expandRightPanel, |
| 49 | } = useSidebarToggles({ isCompact }); |
| 50 | |
| 51 | const { |
| 52 | terminalOpen, |
| 53 | onToggleDebug: handleDebugClick, |
| 54 | onToggleTerminal: handleToggleTerminal, |
| 55 | openTerminal, |
| 56 | closeTerminal, |
| 57 | } = usePanelVisibility({ |
| 58 | isCompact, |
| 59 | activeWorkspaceId, |
| 60 | setActiveTab, |
| 61 | setDebugOpen, |
| 62 | }); |
| 63 | |
| 64 | usePanelShortcuts({ |
no test coverage detected