Prevent flickering on confirmation decline.
- When larger confirmations were shown and then declined you'd typicaly get large chunks of content flickering upon typing or sending a subsequent request. This was primarily due to us leaving the latest confirmation as "updateable" / pending. This changeset addresses that by flushing any pending confirmation to the static container. Part of https://b.corp.google.com/issues/414196943
This commit is contained in:
parent
e665d4f198
commit
c4c11f1d65
|
@ -483,6 +483,10 @@ export const useGeminiStream = (
|
|||
error: undefined,
|
||||
};
|
||||
updateFunctionResponseUI(responseInfo, ToolCallStatus.Success);
|
||||
if (pendingHistoryItemRef.current) {
|
||||
addItem(pendingHistoryItemRef.current, Date.now());
|
||||
setPendingHistoryItem(null);
|
||||
}
|
||||
setStreamingState(StreamingState.Idle);
|
||||
await submitQuery(functionResponse);
|
||||
} finally {
|
||||
|
@ -529,6 +533,10 @@ export const useGeminiStream = (
|
|||
|
||||
// Update UI to show cancellation/error
|
||||
updateFunctionResponseUI(responseInfo, status);
|
||||
if (pendingHistoryItemRef.current) {
|
||||
addItem(pendingHistoryItemRef.current, Date.now());
|
||||
setPendingHistoryItem(null);
|
||||
}
|
||||
setStreamingState(StreamingState.Idle);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue