Allow typing during streaming while blocking submission

This commit is contained in:
Nate 2025-07-14 01:03:46 -07:00
parent d8e1dd9230
commit cdb19761a4

View file

@ -129,8 +129,13 @@ const UserInput: React.FC<UserInputProps> = ({
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<UserInputProps> = ({
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<UserInputProps> = ({
if (inputText.length === 0) {
return (
<>
{inputMode && !isWaitingForResponse && (
{(inputMode || isWaitingForResponse) && (
<Text color="gray">▋{placeholderText}</Text>
)}
{(!inputMode || isWaitingForResponse) && (
{!inputMode && !isWaitingForResponse && (
<Text color="gray">{placeholderText}</Text>
)}
</>
);
}
if (inputMode && !isWaitingForResponse) {
if (inputMode || isWaitingForResponse) {
// Handle multi-line text with cursor
const lines = inputText.split("\n");
let charCount = 0;