Skip to content
47 changes: 33 additions & 14 deletions packages/kilo-ui/src/components/message-part.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2209,6 +2209,7 @@ ToolRegistry.register({
<ToolMetaLine
filename={name()}
path={props.input.filePath?.includes("/") ? getDirectory(props.input.filePath!) : undefined}
changes={props.metadata.filediff}
animate={reveal()}
onClick={data.openFile && props.input.filePath ? handleFileClick : undefined}
/>
Expand All @@ -2219,20 +2220,38 @@ ToolRegistry.register({
</div>
}
>
<Show when={props.input.content && path()}>
<ToolFileAccordion path={path()}>
<div data-component="write-content">
<Dynamic
component={fileComponent}
mode="text"
file={{
name: props.input.filePath,
contents: props.input.content,
cacheKey: checksum(props.input.content),
}}
overflow="scroll"
/>
</div>
<Show when={path()}>
<ToolFileAccordion
path={path()}
actions={
<Show when={!pending()}>
<Switch>
<Match when={props.metadata.exists === false}>
<span data-slot="apply-patch-change" data-type="added">
{i18n.t("ui.patch.action.created")}
</span>
</Match>
<Match when={props.metadata.filediff}>
<ToolChanges changes={props.metadata.filediff} animate={reveal()} />
</Match>
</Switch>
</Show>
}
>
<Show when={props.input.content != null}>
<div data-component="write-content">
<Dynamic
component={fileComponent}
mode="text"
file={{
name: props.input.filePath,
contents: props.input.content,
cacheKey: checksum(props.input.content),
}}
overflow="scroll"
/>
</div>
</Show>
</ToolFileAccordion>
</Show>
<DiagnosticsDisplay diagnostics={diagnostics()} />
Expand Down
65 changes: 50 additions & 15 deletions packages/ui/src/components/message-part.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2025,26 +2025,61 @@ ToolRegistry.register({
</div>
</Show>
</div>
<div data-slot="message-part-actions">{/* <DiffChanges diff={diff} /> */}</div>
{/* kilocode_change start - collapsed-card indicator: Created badge for new files, +/- counts for overwrites */}
<div data-slot="message-part-actions">
<Show when={!pending()}>
<Switch>
<Match when={props.metadata.exists === false}>
<span data-slot="apply-patch-change" data-type="added">
{i18n.t("ui.patch.action.created")}
</span>
</Match>
<Match when={props.metadata.filediff}>
<DiffChanges changes={props.metadata.filediff} />
</Match>
</Switch>
</Show>
</div>
{/* kilocode_change end */}
</div>
}
>
<Show when={props.input.content && path()}>
<ToolFileAccordion path={path()}>
<div data-component="write-content">
<Dynamic
component={fileComponent}
mode="text"
file={{
name: props.input.filePath,
contents: props.input.content,
cacheKey: checksum(props.input.content),
}}
overflow="scroll"
/>
</div>
{/* kilocode_change start - surface created/overwrite indicator + always render accordion so content is discoverable */}
<Show when={path()}>
<ToolFileAccordion
path={path()}
actions={
<Show when={!pending()}>
<Switch>
<Match when={props.metadata.exists === false}>
<span data-slot="apply-patch-change" data-type="added">
{i18n.t("ui.patch.action.created")}
</span>
</Match>
<Match when={props.metadata.filediff}>
<DiffChanges changes={props.metadata.filediff} />
</Match>
</Switch>
</Show>
}
>
<Show when={props.input.content != null}>
<div data-component="write-content">
<Dynamic
component={fileComponent}
mode="text"
file={{
name: props.input.filePath,
contents: props.input.content,
cacheKey: checksum(props.input.content),
}}
overflow="scroll"
/>
</div>
</Show>
</ToolFileAccordion>
</Show>
{/* kilocode_change end */}
<DiagnosticsDisplay diagnostics={diagnostics()} />
</BasicTool>
</div>
Expand Down
Loading