Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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/snapshot-spinner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Show snapshot initialization progress in the extension's existing loading indicator.
5 changes: 5 additions & 0 deletions packages/kilo-vscode/tests/unit/session-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ describe("computeStatus", () => {
const part: Part = { type: "text", id: "p1", text: "hello" }
expect(computeStatus(part, t)).toBe("session.status.writingResponse")
})

it("maps synthetic snapshot progress to snapshot status", () => {
const part: Part = { type: "text", id: "p1", text: "⠋ Initializing snapshot…", synthetic: true }
Comment thread
marius-kilocode marked this conversation as resolved.
expect(computeStatus(part, t)).toBe("Initializing snapshot...")
})
})

describe("calcTotalCost", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { useData } from "@kilocode/kilo-ui/context/data"
import { useSession } from "../../context/session"
import { useDisplay } from "../../context/display"
import { useConfig } from "../../context/config"
import { snapshotProgress } from "../../context/session-utils"
import { QuestionDock } from "./QuestionDock"
import { SuggestBar } from "./SuggestBar"

Expand All @@ -39,7 +40,7 @@ function isRenderable(part: SDKPart): boolean {
// Always render question tool parts — active ones get the inline QuestionDock
return true
}
if (part.type === "text") return !!(part as SDKPart & { text: string }).text?.trim()
if (part.type === "text") return !snapshotProgress(part) && !!(part as SDKPart & { text: string }).text?.trim()
if (part.type === "reasoning") return !!(part as SDKPart & { text: string }).text?.trim()
return !!PART_MAPPING[part.type]
}
Expand Down
16 changes: 15 additions & 1 deletion packages/kilo-vscode/webview-ui/src/context/session-utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
import type { Part } from "../types/messages"

export const SNAPSHOT_PROGRESS_TEXT = "Initializing snapshot..."

type SnapshotPart = {
type?: string
text?: string
synthetic?: boolean
}

export function snapshotProgress(part: SnapshotPart | undefined): boolean {
if (part?.type !== "text") return false
if (!part.synthetic) return false
return (part.text ?? "").includes("Initializing snapshot")
}

/** Minimal message shape for cost breakdown helpers. */
export type CostMessage = { id: string; role: string; cost?: number }

Expand Down Expand Up @@ -55,7 +69,7 @@ export function computeStatus(
}
}
if (part.type === "reasoning") return t("ui.sessionTurn.status.thinking")
if (part.type === "text") return t("session.status.writingResponse")
if (part.type === "text") return snapshotProgress(part) ? SNAPSHOT_PROGRESS_TEXT : t("session.status.writingResponse")
return undefined
}

Expand Down
Loading