mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-09 15:07:55 -05:00
fix(terminal): fix text wrap for errors and messages with long strings (#2429)
This commit is contained in:
@@ -1741,7 +1741,7 @@ export function Terminal() {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Content */}
|
{/* Content */}
|
||||||
<div className='flex-1 overflow-x-auto overflow-y-auto'>
|
<div className={clsx('flex-1 overflow-y-auto', !wrapText && 'overflow-x-auto')}>
|
||||||
{shouldShowCodeDisplay ? (
|
{shouldShowCodeDisplay ? (
|
||||||
<OutputCodeContent
|
<OutputCodeContent
|
||||||
code={selectedEntry.input.code}
|
code={selectedEntry.input.code}
|
||||||
|
|||||||
@@ -291,7 +291,7 @@ function CodeRow({ index, style, ...props }: RowComponentProps<CodeRowProps>) {
|
|||||||
const line = lines[index]
|
const line = lines[index]
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={style} className='flex' data-row-index={index}>
|
<div style={style} className={cn('flex', wrapText && 'overflow-hidden')} data-row-index={index}>
|
||||||
{showGutter && (
|
{showGutter && (
|
||||||
<div
|
<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]'
|
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
|
<pre
|
||||||
className={cn(
|
className={cn(
|
||||||
'm-0 flex-1 pr-2 pl-2 font-mono text-[13px] text-[var(--text-primary)] leading-[21px] dark:text-[#eeeeee]',
|
'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 || ' ' }}
|
dangerouslySetInnerHTML={{ __html: line.html || ' ' }}
|
||||||
/>
|
/>
|
||||||
@@ -625,7 +625,7 @@ const VirtualizedViewerInner = memo(function VirtualizedViewerInner({
|
|||||||
rowComponent={CodeRow}
|
rowComponent={CodeRow}
|
||||||
rowProps={rowProps}
|
rowProps={rowProps}
|
||||||
overscanCount={5}
|
overscanCount={5}
|
||||||
className='overflow-x-auto'
|
className={wrapText ? 'overflow-x-hidden' : 'overflow-x-auto'}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user