mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-28 19:11:03 +08:00
Merge pull request #10310 from IamCoder18/feat/subagent-running-status
feat(cli): show running spinner in subagent footer
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@kilocode/cli": minor
|
||||
---
|
||||
|
||||
Show running spinner in subagent footer to indicate when subagent is processing
|
||||
@@ -3,6 +3,8 @@ import { useRouteData } from "@tui/context/route"
|
||||
import { useSync } from "@tui/context/sync"
|
||||
import { useTheme } from "@tui/context/theme"
|
||||
import { SplitBorder } from "@tui/component/border"
|
||||
import { Spinner } from "@tui/component/spinner" // kilocode_change
|
||||
import { useLocal } from "@tui/context/local" // kilocode_change
|
||||
import type { AssistantMessage } from "@kilocode/sdk/v2"
|
||||
import { useCommandDialog } from "@tui/component/dialog-command"
|
||||
import { useKeybind } from "../../context/keybind"
|
||||
@@ -12,9 +14,24 @@ import { useTerminalDimensions } from "@opentui/solid"
|
||||
export function SubagentFooter() {
|
||||
const route = useRouteData("session")
|
||||
const sync = useSync()
|
||||
const local = useLocal() // kilocode_change
|
||||
const messages = createMemo(() => sync.data.message[route.sessionID] ?? [])
|
||||
const session = createMemo(() => sync.session.get(route.sessionID))
|
||||
|
||||
// kilocode_change start
|
||||
const lastAssistant = createMemo(() => messages().findLast((m) => m.role === "assistant"))
|
||||
|
||||
const isRunning = createMemo(() => {
|
||||
const status = sync.data.session_status?.[route.sessionID]
|
||||
if (status?.type === "busy") return true
|
||||
const last = lastAssistant()
|
||||
if (last && !last.time.completed) return true
|
||||
return false
|
||||
})
|
||||
|
||||
const agentColor = createMemo(() => local.agent.color(lastAssistant()?.agent ?? ""))
|
||||
// kilocode_change end
|
||||
|
||||
const subagentInfo = createMemo(() => {
|
||||
const s = session()
|
||||
if (!s) return { label: "Subagent", index: 0, total: 0 }
|
||||
@@ -84,6 +101,11 @@ export function SubagentFooter() {
|
||||
({subagentInfo().index} of {subagentInfo().total})
|
||||
</text>
|
||||
</Show>
|
||||
{/* kilocode_change start */}
|
||||
<Show when={isRunning()}>
|
||||
<Spinner color={agentColor()} />
|
||||
</Show>
|
||||
{/* kilocode_change end */}
|
||||
<Show when={usage()}>
|
||||
{(item) => (
|
||||
<text fg={theme.textMuted} wrapMode="none">
|
||||
|
||||
Reference in New Issue
Block a user