summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/useGeminiStream.ts
diff options
context:
space:
mode:
authorTaylor Mullen <[email protected]>2025-05-23 00:35:09 -0700
committerN. Taylor Mullen <[email protected]>2025-05-23 00:39:05 -0700
commit7c3591f6415082b8374893bf8ec9a338b65108ea (patch)
tree8fd66d754d62e55eb5ad68806435d3fbf74f4cfc /packages/cli/src/ui/hooks/useGeminiStream.ts
parent01971741e05a22e0402ac6c755ce0eced8f2930b (diff)
Refactor: Update streaming state logic to hide loader during confirmation
- The streaming state logic in `useGeminiStream.ts` has been updated. - Previously, the loading indicator was displayed even when the system was waiting for user confirmation on a tool call. - This change introduces a `WaitingForConfirmation` state to ensure the loading indicator is hidden during these confirmation prompts, improving the user experience.
Diffstat (limited to 'packages/cli/src/ui/hooks/useGeminiStream.ts')
-rw-r--r--packages/cli/src/ui/hooks/useGeminiStream.ts16
1 files changed, 9 insertions, 7 deletions
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts
index 80f6945c..5684102b 100644
--- a/packages/cli/src/ui/hooks/useGeminiStream.ts
+++ b/packages/cli/src/ui/hooks/useGeminiStream.ts
@@ -394,13 +394,15 @@ export const useGeminiStream = (
return StreamProcessingStatus.Completed;
};
- const streamingState: StreamingState =
- isResponding ||
- toolCalls.some(
- (t) => t.status === 'awaiting_approval' || t.status === 'executing',
- )
- ? StreamingState.Responding
- : StreamingState.Idle;
+ const streamingState: StreamingState = (() => {
+ if (toolCalls.some((t) => t.status === 'awaiting_approval')) {
+ return StreamingState.WaitingForConfirmation;
+ }
+ if (isResponding || toolCalls.some((t) => t.status === 'executing')) {
+ return StreamingState.Responding;
+ }
+ return StreamingState.Idle;
+ })();
const submitQuery = useCallback(
async (query: PartListUnion) => {