fix(terminal): fix text wrap for errors and messages with long strings (#2429)

This commit is contained in:
Waleed
2025-12-17 13:42:43 -08:00
committed by GitHub
parent 8775e76c32
commit 3120a785df
2 changed files with 4 additions and 4 deletions

View File

@@ -1741,7 +1741,7 @@ export function Terminal() {
)}
{/* Content */}
<div className='flex-1 overflow-x-auto overflow-y-auto'>
<div className={clsx('flex-1 overflow-y-auto', !wrapText && 'overflow-x-auto')}>
{shouldShowCodeDisplay ? (
<OutputCodeContent
code={selectedEntry.input.code}

View File

@@ -291,7 +291,7 @@ function CodeRow({ index, style, ...props }: RowComponentProps<CodeRowProps>) {
const line = lines[index]
return (
<div style={style} className='flex' data-row-index={index}>
<div style={style} className={cn('flex', wrapText && 'overflow-hidden')} data-row-index={index}>
{showGutter && (
<div
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>) {
<pre
className={cn(
'm-0 flex-1 pr-2 pl-2 font-mono text-[13px] text-[var(--text-primary)] leading-[21px] dark:text-[#eeeeee]',
wrapText ? 'whitespace-pre-wrap break-words' : 'whitespace-pre'
wrapText ? 'min-w-0 whitespace-pre-wrap break-words' : 'whitespace-pre'
)}
dangerouslySetInnerHTML={{ __html: line.html || '&nbsp;' }}
/>
@@ -625,7 +625,7 @@ const VirtualizedViewerInner = memo(function VirtualizedViewerInner({
rowComponent={CodeRow}
rowProps={rowProps}
overscanCount={5}
className='overflow-x-auto'
className={wrapText ? 'overflow-x-hidden' : 'overflow-x-auto'}
/>
</div>
)