From 763757b235fffb19dee2115b7185120919c8614a Mon Sep 17 00:00:00 2001 From: Will Chen Date: Tue, 13 May 2025 15:44:34 -0700 Subject: [PATCH] Disable chat input suggested actions during streaming (#157) --- src/components/chat/ChatInput.tsx | 39 +++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/src/components/chat/ChatInput.tsx b/src/components/chat/ChatInput.tsx index 7ba6809..117afc2 100644 --- a/src/components/chat/ChatInput.tsx +++ b/src/components/chat/ChatInput.tsx @@ -362,7 +362,7 @@ export function ChatInput({ chatId }: { chatId?: number }) { function SummarizeInNewChatButton() { const chatId = useAtomValue(selectedChatIdAtom); const appId = useAtomValue(selectedAppIdAtom); - const { streamMessage } = useStreamChat(); + const { streamMessage, isStreaming } = useStreamChat(); const navigate = useNavigate(); const onClick = async () => { if (!appId) { @@ -385,7 +385,12 @@ function SummarizeInNewChatButton() { - @@ -399,12 +404,13 @@ function SummarizeInNewChatButton() { function RefactorFileButton({ path }: { path: string }) { const chatId = useAtomValue(selectedChatIdAtom); - const { streamMessage } = useStreamChat(); + const { streamMessage, isStreaming } = useStreamChat(); return ( @@ -497,6 +510,7 @@ function RebuildButton() { } function RestartButton() { + const { isStreaming } = useStreamChat(); const { restartApp } = useRunApp(); const posthog = usePostHog(); const selectedAppId = useAtomValue(selectedAppIdAtom); @@ -512,7 +526,12 @@ function RestartButton() { - @@ -526,6 +545,7 @@ function RestartButton() { function RefreshButton() { const { refreshAppIframe } = useRunApp(); + const { isStreaming } = useStreamChat(); const posthog = usePostHog(); const handleRefresh = useCallback(() => { @@ -537,7 +557,12 @@ function RefreshButton() { -