mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-28 19:11:03 +08:00
fix(vscode): keep final patch file visible
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"kilo-code": patch
|
||||
---
|
||||
|
||||
Keep the final file visible when expanding multi-file patch results.
|
||||
@@ -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}>
|
||||
@@ -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
|
||||
|
||||
@@ -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",
|
||||
@@ -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: [
|
||||
{
|
||||
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user