diff --git a/cli/src/components/tools/__tests__/apply-patch.test.tsx b/cli/src/components/tools/__tests__/apply-patch.test.tsx index 75154bd96..6e177757f 100644 --- a/cli/src/components/tools/__tests__/apply-patch.test.tsx +++ b/cli/src/components/tools/__tests__/apply-patch.test.tsx @@ -47,7 +47,7 @@ describe('ApplyPatchComponent', () => { expect(markup).toContain('src/new-file.ts') }) - test('renders update_file operation with diff content', () => { + test('renders update_file operation without diff content while diff rendering is disabled', () => { const toolBlock = createToolBlock({ type: 'update_file', path: 'src/existing.ts', @@ -62,8 +62,8 @@ describe('ApplyPatchComponent', () => { const markup = renderToStaticMarkup(result?.content as React.ReactElement) expect(markup).toContain('Edit') expect(markup).toContain('src/existing.ts') - expect(markup).toContain('-oldLine') - expect(markup).toContain('+newLine') + expect(markup).not.toContain('-oldLine') + expect(markup).not.toContain('+newLine') }) test('renders delete_file operation', () => { diff --git a/cli/src/components/tools/diff-viewer.tsx b/cli/src/components/tools/diff-viewer.tsx index 72ee7361f..37d613a9a 100644 --- a/cli/src/components/tools/diff-viewer.tsx +++ b/cli/src/components/tools/diff-viewer.tsx @@ -6,6 +6,8 @@ interface DiffViewerProps { diffText: string } +const RENDER_DIFFS = false + const DIFF_LINE_COLORS = { dark: { added: '#7ACC35', @@ -50,6 +52,11 @@ const lineColor = ( export const DiffViewer = ({ diffText }: DiffViewerProps) => { const theme = useTheme() + + if (!RENDER_DIFFS) { + return null + } + const lines = diffText.trim().split('\n') return (