Skip to content

Commit 9076003

Browse files
committed
improvement(terminal): default sizing and collapsed width
1 parent 3d51849 commit 9076003

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

apps/sim/app/_styles/globals.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
--panel-width: 320px; /* PANEL_WIDTH.DEFAULT */
1515
--toolbar-triggers-height: 300px; /* TOOLBAR_TRIGGERS_HEIGHT.DEFAULT */
1616
--editor-connections-height: 172px; /* EDITOR_CONNECTIONS_HEIGHT.DEFAULT */
17-
--terminal-height: 155px; /* TERMINAL_HEIGHT.DEFAULT */
17+
--terminal-height: 206px; /* TERMINAL_HEIGHT.DEFAULT */
1818
}
1919

2020
.sidebar-container {

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/terminal/terminal.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,8 @@ const ExecutionGroupRow = memo(function ExecutionGroupRow({
410410
}) {
411411
return (
412412
<div className='flex flex-col px-[6px]'>
413-
{/* Dashed separator between executions */}
414-
{showSeparator && (
415-
<div className='mx-[4px] my-[4px] border-[var(--border)] border-t border-dashed' />
416-
)}
413+
{/* Separator between executions */}
414+
{showSeparator && <div className='mx-[4px] my-[4px] border-[var(--border)] border-t' />}
417415

418416
{/* Entry tree */}
419417
<div className='ml-[4px] flex flex-col gap-[2px] pb-[4px]'>
@@ -1091,7 +1089,8 @@ export const Terminal = memo(function Terminal() {
10911089
}, [expandToLastHeight, navigateToEntry])
10921090

10931091
/**
1094-
* Adjust output panel width on resize
1092+
* Adjust output panel width on resize.
1093+
* Closes the output panel if there's not enough space for the minimum width.
10951094
*/
10961095
useEffect(() => {
10971096
const handleResize = () => {
@@ -1107,7 +1106,14 @@ export const Terminal = memo(function Terminal() {
11071106
const terminalWidth = window.innerWidth - sidebarWidth - panelWidth
11081107
const maxWidth = terminalWidth - TERMINAL_CONFIG.BLOCK_COLUMN_WIDTH_PX
11091108

1110-
if (outputPanelWidth > maxWidth && maxWidth >= MIN_OUTPUT_PANEL_WIDTH_PX) {
1109+
// Close output panel if there's not enough space for minimum width
1110+
if (maxWidth < MIN_OUTPUT_PANEL_WIDTH_PX) {
1111+
setAutoSelectEnabled(false)
1112+
setSelectedEntry(null)
1113+
return
1114+
}
1115+
1116+
if (outputPanelWidth > maxWidth) {
11111117
setOutputPanelWidth(Math.max(maxWidth, MIN_OUTPUT_PANEL_WIDTH_PX))
11121118
}
11131119
}

apps/sim/stores/constants.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const PANEL_WIDTH = {
3636

3737
/** Terminal height constraints */
3838
export const TERMINAL_HEIGHT = {
39-
DEFAULT: 155,
39+
DEFAULT: 206,
4040
MIN: 30,
4141
/** Maximum is 70% of viewport, enforced dynamically */
4242
MAX_PERCENTAGE: 0.7,
@@ -58,8 +58,8 @@ export const EDITOR_CONNECTIONS_HEIGHT = {
5858

5959
/** Output panel (terminal execution results) width constraints */
6060
export const OUTPUT_PANEL_WIDTH = {
61-
DEFAULT: 440,
62-
MIN: 440,
61+
DEFAULT: 560,
62+
MIN: 280,
6363
} as const
6464

6565
/** Terminal block column width - minimum width for the logs column */

0 commit comments

Comments
 (0)