Adds the WaitingForUserInput state (#3620)

This commit is contained in:
Taylor Ho
2025-07-24 10:08:54 -07:00
committed by GitHub
parent 41f2ba8f9e
commit a65c547699
17 changed files with 284 additions and 123 deletions
+6 -2
View File
@@ -5,6 +5,7 @@ import { Button } from './ui/button';
import type { View } from '../App';
import Stop from './ui/Stop';
import { Attach, Send, Close, Microphone } from './icons';
import { ChatState } from '../types/chatState';
import { debounce } from 'lodash';
import { LocalMessageStorage } from '../utils/localMessageStorage';
import { Message } from '../types/message';
@@ -52,7 +53,7 @@ interface ModelLimit {
interface ChatInputProps {
handleSubmit: (e: React.FormEvent) => void;
isLoading?: boolean;
chatState: ChatState;
onStop?: () => void;
commandHistory?: string[]; // Current chat's message history
initialValue?: string;
@@ -78,7 +79,7 @@ interface ChatInputProps {
export default function ChatInput({
handleSubmit,
isLoading = false,
chatState = ChatState.Idle,
onStop,
commandHistory = [],
initialValue = '',
@@ -99,6 +100,9 @@ export default function ChatInput({
const [displayValue, setDisplayValue] = useState(initialValue); // For immediate visual feedback
const [isFocused, setIsFocused] = useState(false);
const [pastedImages, setPastedImages] = useState<PastedImage[]>([]);
// Derived state - chatState != Idle means we're in some form of loading state
const isLoading = chatState !== ChatState.Idle;
const { alerts, addAlert, clearAlerts } = useAlerts();
const dropdownRef = useRef<HTMLDivElement>(null);
const toolCount = useToolCount();