pull/11212/merge
Max Anderson 2026-04-08 05:19:12 +00:00 committed by GitHub
commit f9de66b441
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 0 deletions

View File

@ -86,6 +86,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()
@ -1157,6 +1169,9 @@ export function Prompt(props: PromptProps) {
<spinner color={spinnerDef().color} frames={spinnerDef().frames} interval={40} />
</Show>
</box>
<Show when={elapsed() > 0}>
<text fg={theme.textMuted}>{formatDuration(elapsed())}</text>
</Show>
<box flexDirection="row" gap={1} flexShrink={0}>
{(() => {
const retry = createMemo(() => {