Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/last-file-patch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Keep the final file visible when expanding multi-file patch results.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 4 additions & 13 deletions packages/kilo-ui/src/components/message-part.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2799,18 +2799,9 @@ ToolRegistry.register({
>
<For each={files()}>
{(file) => {
const active = createMemo(() => expanded().includes(file.filePath))
const [visible, setVisible] = createSignal(false)
createEffect(() => {
if (!active()) {
setVisible(false)
return
}
requestAnimationFrame(() => {
if (!active()) return
setVisible(true)
})
})
// Diff defers its own expensive render; mounting the container
// here avoids dropping the last item during batch expansion.
const active = createMemo(() => allExpanded().includes(file.filePath))

return (
<Accordion.Item value={file.filePath} data-type={file.type}>
Expand Down Expand Up @@ -2864,7 +2855,7 @@ ToolRegistry.register({
</Accordion.Trigger>
</StickyAccordionHeader>
<Accordion.Content>
<Show when={visible() && view(file)}>
<Show when={active() && view(file)}>
{(diff) => (
<div data-component="apply-patch-file-diff">
<Dynamic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,15 @@ const writePatch = [
'+import { AssistantMessage } from "../components/chat/AssistantMessage"',
].join("\n")

const tailPatch = [
"===================================================================",
"--- packages/kilo-vscode/webview-ui/src/components/chat/MessageList.tsx",
"+++ packages/kilo-vscode/webview-ui/src/components/chat/MessageList.tsx",
"@@ -1,1 +1,1 @@",
"-const old = true",
"+const next = true",
].join("\n")

const blockQuestions: QuestionRequest[] = [
{
id: "matrix-question-request",
Expand Down Expand Up @@ -465,7 +474,7 @@ const blocks: SDKPart[] = [
"*** Begin Patch\n*** Update File: packages/kilo-ui/src/components/message-part.css\n@@\n-gap: 4px;\n+gap: 8px;\n*** End Patch",
},
output: "",
title: "Patch two files",
title: "Patch three files",
metadata: {
files: [
{
Expand All @@ -486,6 +495,15 @@ const blocks: SDKPart[] = [
additions: 1,
deletions: 0,
},
{
filePath: "/project/packages/kilo-vscode/webview-ui/src/components/chat/MessageList.tsx",
relativePath: "packages/kilo-vscode/webview-ui/src/components/chat/MessageList.tsx",
type: "update",
patch: tailPatch,
diff: tailPatch,
additions: 1,
deletions: 1,
},
],
},
time: { start: stamp - 2700, end: stamp - 2400 },
Expand Down
Loading