Skip to content

Commit 188fcd6

Browse files
Restore CLI diff viewer (#621)
Co-authored-by: James Grugett <jahooma@gmail.com>
1 parent 68782e9 commit 188fcd6

2 files changed

Lines changed: 3 additions & 9 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 without diff content while diff rendering is disabled', () => {
50+
test('renders update_file operation with diff content', () => {
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).not.toContain('-oldLine')
66-
expect(markup).not.toContain('+newLine')
65+
expect(markup).toContain('-oldLine')
66+
expect(markup).toContain('+newLine')
6767
})
6868

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

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

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

9-
const RENDER_DIFFS = false
10-
119
const DIFF_LINE_COLORS = {
1210
dark: {
1311
added: '#7ACC35',
@@ -53,10 +51,6 @@ const lineColor = (
5351
export const DiffViewer = ({ diffText }: DiffViewerProps) => {
5452
const theme = useTheme()
5553

56-
if (!RENDER_DIFFS) {
57-
return null
58-
}
59-
6054
const lines = diffText.trim().split('\n')
6155

6256
return (

0 commit comments

Comments
 (0)