summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor Mullen <[email protected]>2025-05-13 16:35:11 -0700
committerN. Taylor Mullen <[email protected]>2025-05-13 16:36:28 -0700
commitc4c11f1d65233f31751cee65e29aa6ae3f7f2410 (patch)
treeeb0d24527755bb07f693ed6146eb32702f0c71fa
parente665d4f1987aecc1be4db315c7544a6da5ed3d5b (diff)
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
-rw-r--r--packages/cli/src/ui/hooks/useGeminiStream.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts
index 6ff41d2f..4fcc503b 100644
--- a/packages/cli/src/ui/hooks/useGeminiStream.ts
+++ b/packages/cli/src/ui/hooks/useGeminiStream.ts
@@ -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);
}
};