Skip to content

Commit 07402e8

Browse files
committed
Hide diffs for created files
1 parent 1bb1113 commit 07402e8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

cli/src/components/tools/str-replace.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ interface EditBodyProps {
3737
name: string
3838
filePath: string | null
3939
diffText: string
40+
isCreate: boolean
4041
}
4142

42-
const EditBody = ({ name, filePath, diffText }: EditBodyProps) => {
43+
const EditBody = ({ name, filePath, diffText, isCreate }: EditBodyProps) => {
4344
return (
4445
<box style={{ flexDirection: 'column', gap: 0, width: '100%' }}>
4546
<EditHeader name={name} filePath={filePath} />
46-
{diffText.length > 0 && (
47+
{!isCreate && diffText.length > 0 && (
4748
<box style={{ paddingLeft: 2, width: '100%' }}>
4849
<DiffViewer diffText={diffText} />
4950
</box>
@@ -66,6 +67,7 @@ export const StrReplaceComponent = defineToolComponent({
6667
name={isCreate ? 'Create' : 'Edit'}
6768
filePath={filePath}
6869
diffText={diff ?? ''}
70+
isCreate={isCreate}
6971
/>
7072
),
7173
}

0 commit comments

Comments
 (0)