Skip to content
Closed
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/clear-completed-indicator-on-focus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Clear a session's completed (✓) activity indicator when you switch to that session's tab. Opening a finished session now counts as acknowledging it, so the check no longer lingers after you review it. A session that completes while it is already the focused tab still shows its check, and unresolved states (needs input, error) are never cleared by focus.
25 changes: 25 additions & 0 deletions packages/kilo-vscode/tests/fixtures/session-provider-activity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,31 @@ try {
)
}

// "done" clears when the user switches TO that tab (the focus transition);
// an unresolved attention state ("waiting") never clears on focus.
await emit({ type: "sessionStatus", sessionID: "background", status: "idle" })
await emit({ type: "sessionTurnClosed", sessionID: "background", reason: "completed" })
await check("background", "done")
assert.equal(value.currentSessionID(), "root")
value.setCurrentSessionID("background")
await check("background", "idle")
await emit({
type: "questionRequest",
question: {
id: "attention",
sessionID: "background",
questions: [{ question: "Continue?", header: "Confirm", options: [] }],
},
})
await check("background", "waiting")
value.setCurrentSessionID("root")
await settle()
value.setCurrentSessionID("background")
await check("background", "waiting")
await emit({ type: "questionResolved", requestID: "attention" })
value.setCurrentSessionID("root")
await settle()

await emit({ type: "sessionStatus", sessionID: "root", status: "busy" })
await emit({ type: "sessionStatus", sessionID: "root", status: "idle" })
await emit({
Expand Down
11 changes: 11 additions & 0 deletions packages/kilo-vscode/webview-ui/src/context/session.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1769,6 +1769,17 @@ export const SessionProvider: ParentComponent = (props) => {
)
})
const activityFor = (id: string | undefined): Activity => (id ? (activityMap[id] ?? "idle") : "idle")
// Clear the completed (done) indicator when the user switches TO that session's
// tab — opening a finished result counts as acknowledging it. Keyed on the
// focus transition via `on(currentSessionID, ...)`, so a session that completes
// while it is already the focused tab still shows its check (only clears once
// you navigate away and back). Only "done" is cleared here; "waiting" (needs
// input/permission) and "error" must persist until the user actually acts.
createEffect(
on(currentSessionID, (id) => {
if (id && activityMap[id] === "done") clearClose(id)
}),
)
const inUseFor = (id: string) => inUse(sessionFamily(id), statusMap, [...permissions(), ...questions()])

function handleTodoUpdated(sessionID: string, items: TodoItem[]) {
Expand Down
Loading