From 284886ded43fad432606f8df0a44b84ab0074981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Catriel=20M=C3=BCller?= Date: Fri, 1 May 2026 19:59:15 -0300 Subject: [PATCH] refactor: fix kilocodechanges --- packages/opencode/src/snapshot/index.ts | 3 ++- packages/ui/src/components/message-part.tsx | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/opencode/src/snapshot/index.ts b/packages/opencode/src/snapshot/index.ts index 765da49c3c3..22ae06d8747 100644 --- a/packages/opencode/src/snapshot/index.ts +++ b/packages/opencode/src/snapshot/index.ts @@ -787,8 +787,9 @@ export const layer: Layer.Layer< }), ) - // kilocode_change - per-instance state for the slow-repo track wrapper + // kilocode_change start - per-instance state for the slow-repo track wrapper const trackState = KiloSnapshotTrack.makeState() + // kilocode_change end return Service.of({ init: Effect.fn("Snapshot.init")(function* () { diff --git a/packages/ui/src/components/message-part.tsx b/packages/ui/src/components/message-part.tsx index 1ffeb6fe9ab..d030925821c 100644 --- a/packages/ui/src/components/message-part.tsx +++ b/packages/ui/src/components/message-part.tsx @@ -1471,6 +1471,7 @@ PART_MAPPING["text"] = function TextPartDisplay(props) { () => props.message.role === "assistant" && typeof (props.message as AssistantMessage).time.completed !== "number", ) const text = () => (part().text ?? "").trim() + // kilocode_change start // Synthetic text parts (e.g. "Initializing snapshot…" from the slow-repo guard) // are transient status indicators, not assistant output — they must never // carry the copy button, and they must not "steal" last-part status from @@ -1482,14 +1483,15 @@ PART_MAPPING["text"] = function TextPartDisplay(props) { // re-appears on session reload; hiding it when the owning message is no // longer streaming keeps the scrollback clean in that edge case. const showSyntheticPart = createMemo(() => !part().synthetic || streaming()) + // kilocode_change end const isLastTextPart = createMemo(() => { const last = (data.store.part?.[props.message.id] ?? []) - .filter((item): item is TextPart => item?.type === "text" && !!item.text?.trim() && !item.synthetic) + .filter((item): item is TextPart => item?.type === "text" && !!item.text?.trim() && !item.synthetic) // kilocode_change .at(-1) return last?.id === part().id }) const showCopy = createMemo(() => { - if (part().synthetic) return false + if (part().synthetic) return false // kilocode_change if (props.message.role !== "assistant") return isLastTextPart() if (props.showAssistantCopyPartID === null) return false if (typeof props.showAssistantCopyPartID === "string") return props.showAssistantCopyPartID === part().id @@ -1506,7 +1508,7 @@ PART_MAPPING["text"] = function TextPartDisplay(props) { } return ( - +
}>