From 5d1a4c015e264c924299fd01c33bb8bc4462b268 Mon Sep 17 00:00:00 2001 From: cpacker Date: Wed, 25 Feb 2026 11:20:37 -0800 Subject: [PATCH] fix(tui): restore ADE link + keep streaming elapsed across resize --- src/cli/components/AgentInfoBar.tsx | 7 ++---- src/cli/components/InputRich.tsx | 36 ++++++++++++++++++----------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/cli/components/AgentInfoBar.tsx b/src/cli/components/AgentInfoBar.tsx index 257568f..5132131 100644 --- a/src/cli/components/AgentInfoBar.tsx +++ b/src/cli/components/AgentInfoBar.tsx @@ -68,11 +68,8 @@ export const AgentInfoBar = memo(function AgentInfoBar({ const isCloudUser = serverUrl?.includes("api.letta.com"); const adeConversationUrl = - agentId && - agentId !== "loading" && - conversationId && - conversationId !== "default" - ? `https://app.letta.com/agents/${agentId}?conversation=${conversationId}` + agentId && agentId !== "loading" + ? `https://app.letta.com/agents/${agentId}${conversationId && conversationId !== "default" ? `?conversation=${conversationId}` : ""}` : ""; const showBottomBar = agentId && agentId !== "loading"; const reasoningLabel = formatReasoningLabel(currentReasoningEffort); diff --git a/src/cli/components/InputRich.tsx b/src/cli/components/InputRich.tsx index 2abd4b4..e0cf141 100644 --- a/src/cli/components/InputRich.tsx +++ b/src/cli/components/InputRich.tsx @@ -470,24 +470,32 @@ const StreamingStatus = memo(function StreamingStatus({ } }, [animate]); - // Elapsed time tracking + // Elapsed time tracking: pause updates during resize, but do not reset. useEffect(() => { - if (streaming && visible && !isResizing) { - // Start tracking when streaming begins - if (streamStartRef.current === null) { - streamStartRef.current = performance.now(); - } - const id = setInterval(() => { - if (streamStartRef.current !== null) { - setElapsedMs(performance.now() - streamStartRef.current); - } - }, 1000); - return () => clearInterval(id); + if (!streaming || !visible || isResizing) { + return; + } + + if (streamStartRef.current === null) { + streamStartRef.current = performance.now(); + } + + const id = setInterval(() => { + if (streamStartRef.current !== null) { + setElapsedMs(performance.now() - streamStartRef.current); + } + }, 1000); + + return () => clearInterval(id); + }, [streaming, visible, isResizing]); + + useEffect(() => { + if (streaming && visible) { + return; } - // Reset when streaming stops streamStartRef.current = null; setElapsedMs(0); - }, [streaming, visible, isResizing]); + }, [streaming, visible]); const estimatedTokens = charsToTokens(tokenCount); const totalElapsedMs = elapsedBaseMs + elapsedMs;