diff --git a/app/components/workbench/EditorPanel.tsx b/app/components/workbench/EditorPanel.tsx index a6248e5..45d51a4 100644 --- a/app/components/workbench/EditorPanel.tsx +++ b/app/components/workbench/EditorPanel.tsx @@ -60,8 +60,9 @@ export const EditorPanel = memo( const theme = useStore(themeStore); const showTerminal = useStore(workbenchStore.showTerminal); + const showBoltTerminal = useStore(workbenchStore.showBoltTerminal); - const terminalRefs = useRef>([]); + const terminalRefs = useRef<(TerminalRef | null)[]>([]); const terminalPanelRef = useRef(null); const terminalToggledByShortcut = useRef(false); @@ -105,15 +106,16 @@ export const EditorPanel = memo( } const isCollapsed = terminal.isCollapsed(); + const shouldShowTerminal = showTerminal || showBoltTerminal; - if (!showTerminal && !isCollapsed) { + if (!shouldShowTerminal && !isCollapsed) { terminal.collapse(); - } else if (showTerminal && isCollapsed) { + } else if (shouldShowTerminal && isCollapsed) { terminal.resize(DEFAULT_TERMINAL_SIZE); } terminalToggledByShortcut.current = false; - }, [showTerminal]); + }, [showTerminal, showBoltTerminal]); const addTerminal = () => { if (terminalCount < MAX_TERMINALS) { @@ -124,7 +126,7 @@ export const EditorPanel = memo( return ( - +
@@ -182,25 +184,38 @@ export const EditorPanel = memo( { - if (!terminalToggledByShortcut.current) { - workbenchStore.toggleTerminal(true); - } - }} onCollapse={() => { if (!terminalToggledByShortcut.current) { workbenchStore.toggleTerminal(false); + workbenchStore.toggleBoltTerminal(false); } }} >
+ {Array.from({ length: terminalCount }, (_, index) => { - const isActive = activeTerminal === index; + const isActive = !showBoltTerminal && activeTerminal === index; return (