Skip to content

Commit 74ebf4d

Browse files
committed
Disable CLI diff rendering
1 parent 53448d0 commit 74ebf4d

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

cli/src/components/tools/__tests__/apply-patch.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('ApplyPatchComponent', () => {
4747
expect(markup).toContain('src/new-file.ts')
4848
})
4949

50-
test('renders update_file operation with diff content', () => {
50+
test('renders update_file operation without diff content while diff rendering is disabled', () => {
5151
const toolBlock = createToolBlock({
5252
type: 'update_file',
5353
path: 'src/existing.ts',
@@ -62,8 +62,8 @@ describe('ApplyPatchComponent', () => {
6262
const markup = renderToStaticMarkup(result?.content as React.ReactElement)
6363
expect(markup).toContain('Edit')
6464
expect(markup).toContain('src/existing.ts')
65-
expect(markup).toContain('-oldLine')
66-
expect(markup).toContain('+newLine')
65+
expect(markup).not.toContain('-oldLine')
66+
expect(markup).not.toContain('+newLine')
6767
})
6868

6969
test('renders delete_file operation', () => {

cli/src/components/tools/diff-viewer.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ interface DiffViewerProps {
66
diffText: string
77
}
88

9+
const RENDER_DIFFS = false
10+
911
const DIFF_LINE_COLORS = {
1012
dark: {
1113
added: '#7ACC35',
@@ -50,6 +52,11 @@ const lineColor = (
5052

5153
export const DiffViewer = ({ diffText }: DiffViewerProps) => {
5254
const theme = useTheme()
55+
56+
if (!RENDER_DIFFS) {
57+
return null
58+
}
59+
5360
const lines = diffText.trim().split('\n')
5461

5562
return (

0 commit comments

Comments
 (0)