Skip to content

Commit 3120a78

Browse files
authored
fix(terminal): fix text wrap for errors and messages with long strings (#2429)
1 parent 8775e76 commit 3120a78

File tree

2 files changed

+4
-4
lines changed
  • apps/sim
    • app/workspace/[workspaceId]/w/[workflowId]/components/terminal
    • components/emcn/components/code

2 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1741,7 +1741,7 @@ export function Terminal() {
17411741
)}
17421742

17431743
{/* Content */}
1744-
<div className='flex-1 overflow-x-auto overflow-y-auto'>
1744+
<div className={clsx('flex-1 overflow-y-auto', !wrapText && 'overflow-x-auto')}>
17451745
{shouldShowCodeDisplay ? (
17461746
<OutputCodeContent
17471747
code={selectedEntry.input.code}

apps/sim/components/emcn/components/code/code.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ function CodeRow({ index, style, ...props }: RowComponentProps<CodeRowProps>) {
291291
const line = lines[index]
292292

293293
return (
294-
<div style={style} className='flex' data-row-index={index}>
294+
<div style={style} className={cn('flex', wrapText && 'overflow-hidden')} data-row-index={index}>
295295
{showGutter && (
296296
<div
297297
className='flex-shrink-0 select-none pr-0.5 text-right text-[var(--text-muted)] text-xs tabular-nums leading-[21px] dark:text-[#a8a8a8]'
@@ -303,7 +303,7 @@ function CodeRow({ index, style, ...props }: RowComponentProps<CodeRowProps>) {
303303
<pre
304304
className={cn(
305305
'm-0 flex-1 pr-2 pl-2 font-mono text-[13px] text-[var(--text-primary)] leading-[21px] dark:text-[#eeeeee]',
306-
wrapText ? 'whitespace-pre-wrap break-words' : 'whitespace-pre'
306+
wrapText ? 'min-w-0 whitespace-pre-wrap break-words' : 'whitespace-pre'
307307
)}
308308
dangerouslySetInnerHTML={{ __html: line.html || '&nbsp;' }}
309309
/>
@@ -625,7 +625,7 @@ const VirtualizedViewerInner = memo(function VirtualizedViewerInner({
625625
rowComponent={CodeRow}
626626
rowProps={rowProps}
627627
overscanCount={5}
628-
className='overflow-x-auto'
628+
className={wrapText ? 'overflow-x-hidden' : 'overflow-x-auto'}
629629
/>
630630
</div>
631631
)

0 commit comments

Comments
 (0)