From 74ebf4d0638b0f70ade6530f3ac017f892400836 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Thu, 7 May 2026 01:01:06 -0700 Subject: [PATCH] Disable CLI diff rendering --- cli/src/components/tools/__tests__/apply-patch.test.tsx | 6 +++--- cli/src/components/tools/diff-viewer.tsx | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cli/src/components/tools/__tests__/apply-patch.test.tsx b/cli/src/components/tools/__tests__/apply-patch.test.tsx index 75154bd964..6e177757f5 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 72ee7361f3..37d613a9ab 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 (