From cdb19761a4a06a0f8c48117d0a3bf2ee7be44b8a Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 14 Jul 2025 01:03:46 -0700 Subject: [PATCH] Allow typing during streaming while blocking submission --- src/ui/UserInput.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ui/UserInput.tsx b/src/ui/UserInput.tsx index f4738e859..4a962ea40 100644 --- a/src/ui/UserInput.tsx +++ b/src/ui/UserInput.tsx @@ -129,8 +129,13 @@ const UserInput: React.FC = ({ return; } + // Allow typing during streaming, but block submission if (!inputMode) { - return; + // Block only Enter key submission during streaming + if (key.return && !key.shift) { + return; + } + // Allow all other input (typing, navigation, etc.) } // Handle slash command navigation @@ -175,6 +180,7 @@ const UserInput: React.FC = ({ setCursorPosition(0); setShowSlashCommands(false); } + // Note: Enter key is already blocked during streaming by the inputMode check above return; } @@ -209,17 +215,17 @@ const UserInput: React.FC = ({ if (inputText.length === 0) { return ( <> - {inputMode && !isWaitingForResponse && ( + {(inputMode || isWaitingForResponse) && ( ▋{placeholderText} )} - {(!inputMode || isWaitingForResponse) && ( + {!inputMode && !isWaitingForResponse && ( {placeholderText} )} ); } - if (inputMode && !isWaitingForResponse) { + if (inputMode || isWaitingForResponse) { // Handle multi-line text with cursor const lines = inputText.split("\n"); let charCount = 0;