From e659a3814bb63a911ca055885985349151bb4ed3 Mon Sep 17 00:00:00 2001 From: Max Anderson Date: Thu, 29 Jan 2026 17:26:40 -0500 Subject: [PATCH] feat(opencode): add elapsed time display next to TUI throbber --- .../src/cli/cmd/tui/component/prompt/index.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx index cefef208de..dc67675a07 100644 --- a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx @@ -69,6 +69,18 @@ export function Prompt(props: PromptProps) { const dialog = useDialog() const toast = useToast() const status = createMemo(() => sync.data.session_status?.[props.sessionID ?? ""] ?? { type: "idle" }) + const [elapsed, setElapsed] = createSignal(0) + createEffect(() => { + const s = status() + if (s.type === "busy") { + const now = Date.now() + setElapsed(0) + const timer = setInterval(() => { + setElapsed(Math.floor((Date.now() - now) / 1000)) + }, 1000) + onCleanup(() => clearInterval(timer)) + } + }) const history = usePromptHistory() const stash = usePromptStash() const command = useCommandDialog() @@ -1055,6 +1067,9 @@ export function Prompt(props: PromptProps) { + 0}> + {formatDuration(elapsed())} + {(() => { const retry = createMemo(() => {