[PR #11212] feat(opencode): add elapsed time display next to TUI throbber #13699

Open
opened 2026-02-16 18:18:32 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/11212

State: open
Merged: No


Closes #10739

What does this PR do?

Adds a live elapsed time counter next to the throbber/spinner in the bottom-left of the TUI prompt bar. While a prompt is running, the timer ticks every second (e.g. 1s, 2s, 1m 30s). When the prompt completes, the timer freezes at its final value. Starting a new prompt resets it.

Single file change in packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx:

  • Added a createEffect that watches status() and starts a 1-second interval when busy, using SolidJS onCleanup to stop the interval when status changes
  • Renders the elapsed time in muted text next to the spinner using the existing formatDuration utility

How did you verify your code works?

Ran bun dev, submitted prompts, and confirmed the timer appears next to the spinner, ticks while running, freezes on completion, and resets on new prompts.

Demo

demo

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11212 **State:** open **Merged:** No --- Closes #10739 ### What does this PR do? Adds a live elapsed time counter next to the throbber/spinner in the bottom-left of the TUI prompt bar. While a prompt is running, the timer ticks every second (e.g. `1s`, `2s`, `1m 30s`). When the prompt completes, the timer freezes at its final value. Starting a new prompt resets it. Single file change in `packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx`: - Added a `createEffect` that watches `status()` and starts a 1-second interval when busy, using SolidJS `onCleanup` to stop the interval when status changes - Renders the elapsed time in muted text next to the spinner using the existing `formatDuration` utility ### How did you verify your code works? Ran `bun dev`, submitted prompts, and confirmed the timer appears next to the spinner, ticks while running, freezes on completion, and resets on new prompts. ### Demo ![demo](https://github.com/user-attachments/assets/1013ddf4-862c-4fb7-8e9c-738ad221257c)
yindo added the pull-request label 2026-02-16 18:18:32 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13699