Skip to content

Commit f3d3921

Browse files
committed
fix(files): stop markdown preview auto-scrolling during copilot patch streams
fix(snapshot): use surface-4 background for input/output code blocks in light mode
1 parent 7f12a13 commit f3d3921

3 files changed

Lines changed: 91 additions & 90 deletions

File tree

apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/text-editor.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ export const TextEditor = memo(function TextEditor({
589589
)
590590

591591
const isStreaming = isStreamInteractionLocked
592+
const isPreviewFollowingStream = isStreaming && !disableStreamingAutoScroll
592593
const isEditorReadOnly = isStreamInteractionLocked || !canEdit
593594

594595
const previewType = resolvePreviewType(file.type, file.name)
@@ -677,7 +678,7 @@ export const TextEditor = memo(function TextEditor({
677678
content={content}
678679
mimeType={file.type}
679680
filename={file.name}
680-
isStreaming={isStreaming}
681+
isStreaming={isPreviewFollowingStream}
681682
onCheckboxToggle={canEdit && !isStreaming ? handleCheckboxToggle : undefined}
682683
/>
683684
</div>

apps/sim/app/workspace/[workspaceId]/w/components/preview/components/preview-editor/preview-editor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ function PreviewEditorContent({
12501250
<Code.Viewer
12511251
code={formatValueAsJson(executionData.input)}
12521252
language='json'
1253-
className='!bg-[var(--surface-3)] max-h-[300px] min-h-0 max-w-full rounded-md border-0 [word-break:break-all]'
1253+
className='!bg-[var(--surface-4)] dark:!bg-[var(--surface-3)] max-h-[300px] min-h-0 max-w-full rounded-md border-0 [word-break:break-all]'
12541254
wrapText={wrapText}
12551255
searchQuery={isSearchActive ? searchQuery : undefined}
12561256
currentMatchIndex={currentMatchIndex}
@@ -1320,7 +1320,7 @@ function PreviewEditorContent({
13201320
code={formatValueAsJson(executionData.output)}
13211321
language='json'
13221322
className={cn(
1323-
'!bg-[var(--surface-3)] max-h-[300px] min-h-0 max-w-full rounded-md border-0 [word-break:break-all]',
1323+
'!bg-[var(--surface-4)] dark:!bg-[var(--surface-3)] max-h-[300px] min-h-0 max-w-full rounded-md border-0 [word-break:break-all]',
13241324
executionData.status === 'error' && 'text-[var(--text-error)]'
13251325
)}
13261326
wrapText={wrapText}

0 commit comments

Comments
 (0)