diff options
| author | adamelmore <[email protected]> | 2026-01-23 23:18:54 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2026-01-24 07:00:41 -0600 |
| commit | da8f3e92a7bbc3b288f89f6b535b72b94c1d1c19 (patch) | |
| tree | aca02084c140751929532c2bb86caa847997f63c /packages/ui/src/components | |
| parent | 04b511e1fe135b70256c6aa4f41b81ce2571276c (diff) | |
| download | opencode-da8f3e92a7bbc3b288f89f6b535b72b94c1d1c19.tar.gz opencode-da8f3e92a7bbc3b288f89f6b535b72b94c1d1c19.zip | |
perf(app): better session stream rendering
Diffstat (limited to 'packages/ui/src/components')
| -rw-r--r-- | packages/ui/src/components/session-turn.tsx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/packages/ui/src/components/session-turn.tsx b/packages/ui/src/components/session-turn.tsx index ca63d17ab..fe53c0939 100644 --- a/packages/ui/src/components/session-turn.tsx +++ b/packages/ui/src/components/session-turn.tsx @@ -457,9 +457,16 @@ export function SessionTurn( }) createEffect(() => { - const timer = setInterval(() => { + const update = () => { setStore("duration", duration()) - }, 1000) + } + + update() + + // Only keep ticking while the active (in-progress) turn is running. + if (!working()) return + + const timer = setInterval(update, 1000) onCleanup(() => clearInterval(timer)) }) @@ -495,6 +502,11 @@ export function SessionTurn( } }) + onCleanup(() => { + if (!statusTimeout) return + clearTimeout(statusTimeout) + }) + return ( <div data-component="session-turn" class={props.classes?.root} ref={setRootRef}> <div |
