diff options
| author | Taylor Mullen <[email protected]> | 2025-05-13 16:35:11 -0700 |
|---|---|---|
| committer | N. Taylor Mullen <[email protected]> | 2025-05-13 16:36:28 -0700 |
| commit | c4c11f1d65233f31751cee65e29aa6ae3f7f2410 (patch) | |
| tree | eb0d24527755bb07f693ed6146eb32702f0c71fa /packages/cli/src/ui/hooks/useGeminiStream.ts | |
| parent | e665d4f1987aecc1be4db315c7544a6da5ed3d5b (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
Diffstat (limited to 'packages/cli/src/ui/hooks/useGeminiStream.ts')
| -rw-r--r-- | packages/cli/src/ui/hooks/useGeminiStream.ts | 8 |
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); } }; |
