fix(vscode): hide empty task header graph (#10125)

This commit is contained in:
Marius
2026-05-11 09:15:52 -04:00
committed by kirillk
parent 70366cbb8e
commit ef620c3141
2 changed files with 14 additions and 1 deletions
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---
Hide the task header graph area until timeline data is available.
@@ -78,6 +78,14 @@ export const TaskHeader: Component<TaskHeaderProps> = (props) => {
return undefined
})
const hasTimeline = createMemo(() => {
for (const m of session.messages()) {
if (m.role !== "assistant") continue
if (session.getParts(m.id).some((p) => p.type !== "step-start")) return true
}
return false
})
const fmtNum = (n: number): string => {
if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`
if (n >= 1_000) return `${(n / 1_000).toFixed(1)}K`
@@ -166,7 +174,7 @@ export const TaskHeader: Component<TaskHeaderProps> = (props) => {
</div>
</div>
{/* Expanded graph section: timeline + context bar + token breakdown */}
<Show when={expanded() && session.messages().some((m) => m.role === "assistant")}>
<Show when={expanded() && hasTimeline()}>
<div data-component="task-header-graph">
<TaskTimeline />
<div data-slot="task-header-graph-row">