fix(tui): restore ADE link + keep streaming elapsed across resize

This commit is contained in:
cpacker
2026-02-25 11:20:37 -08:00
parent 91f2456656
commit 5d1a4c015e
2 changed files with 24 additions and 19 deletions

View File

@@ -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);

View File

@@ -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;