fix(tui): restore ADE link + keep streaming elapsed across resize
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user