From 00d62ea325ea00e34604f3e656f61d94971e995a Mon Sep 17 00:00:00 2001 From: ciregenz Date: Tue, 18 Aug 2026 19:04:37 -0700 Subject: [PATCH] [eric] chat: answering an in-chat question pins to bottom like a send; the reply landed below the fold (ENG-345) --- frontend/src/app/pages/AgentChat/tool-ui/AskUiBubble.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/pages/AgentChat/tool-ui/AskUiBubble.tsx b/frontend/src/app/pages/AgentChat/tool-ui/AskUiBubble.tsx index 36e8455f..669def37 100644 --- a/frontend/src/app/pages/AgentChat/tool-ui/AskUiBubble.tsx +++ b/frontend/src/app/pages/AgentChat/tool-ui/AskUiBubble.tsx @@ -19,6 +19,7 @@ interface AskUiBubbleProps { sessionId: string; isPending: boolean; suppressReveal: boolean; + onAnswered?: () => void; } function parseResultResponse(pair: ToolPair): Record | null { @@ -34,7 +35,7 @@ function parseResultResponse(pair: ToolPair): Record | null { } /** An AskUI call: the live interactive component while the agent waits; its answered state after. */ -function AskUiBubble({ pair, sessionId, isPending, suppressReveal }: AskUiBubbleProps): React.ReactElement { +function AskUiBubble({ pair, sessionId, isPending, suppressReveal, onAnswered }: AskUiBubbleProps): React.ReactElement { const payload = parseShowUiPayload(pair); const [submitted, setSubmitted] = useState(false); const [orphaned, setOrphaned] = useState(false); @@ -63,6 +64,7 @@ function AskUiBubble({ pair, sessionId, isPending, suppressReveal }: AskUiBubble inFlight.current = true; markAskAnswered(sessionId, componentId); setSubmitted(true); + onAnswered?.(); if (response.action !== 'free_text') { setLocalChoice(response.choice ?? response.value ?? undefined); } @@ -84,7 +86,7 @@ function AskUiBubble({ pair, sessionId, isPending, suppressReveal }: AskUiBubble }) .catch(() => { inFlight.current = false; releaseAskAnswer(sessionId, componentId); setSubmitted(false); setLocalChoice(undefined); setOrphaned(true); }); }, - [submitted, sessionId, componentId], + [submitted, sessionId, componentId, onAnswered], ); // isPending gates clickability: once the session stops or completes, an unanswered ask must never look live (bounced asks used to revive as clickable dupes whose answers vanished into the 45s buffer, ENG-232).