Next camp refactor live (#5706)

This commit is contained in:
Zane
2025-11-21 14:10:34 -07:00
committed by GitHub
parent c1c772b267
commit d54a06afda
35 changed files with 1105 additions and 2601 deletions
+3 -13
View File
@@ -64,10 +64,10 @@ interface ChatInputProps {
handleSubmit: (e: React.FormEvent) => void;
chatState: ChatState;
onStop?: () => void;
commandHistory?: string[]; // Current chat's message history
commandHistory?: string[];
initialValue?: string;
droppedFiles?: DroppedFile[];
onFilesProcessed?: () => void; // Callback to clear dropped files after processing
onFilesProcessed?: () => void;
setView: (view: View) => void;
totalTokens?: number;
accumulatedInputTokens?: number;
@@ -87,7 +87,6 @@ interface ChatInputProps {
recipeAccepted?: boolean;
initialPrompt?: string;
toolCount: number;
autoSubmit: boolean;
append?: (message: Message) => void;
isExtensionsLoading?: boolean;
}
@@ -114,7 +113,6 @@ export default function ChatInput({
recipeAccepted,
initialPrompt,
toolCount,
autoSubmit = false,
append: _append,
isExtensionsLoading = false,
}: ChatInputProps) {
@@ -307,7 +305,6 @@ export default function ChatInput({
const [hasUserTyped, setHasUserTyped] = useState(false);
const textAreaRef = useRef<HTMLTextAreaElement>(null);
const timeoutRefsRef = useRef<Set<ReturnType<typeof setTimeout>>>(new Set());
const [didAutoSubmit, setDidAutoSubmit] = useState<boolean>(false);
// Use shared file drop hook for ChatInput
const {
@@ -939,13 +936,6 @@ export default function ChatInput({
]
);
useEffect(() => {
if (!!autoSubmit && !didAutoSubmit) {
setDidAutoSubmit(true);
performSubmit(initialValue);
}
}, [autoSubmit, didAutoSubmit, initialValue, performSubmit]);
const handleKeyDown = (evt: React.KeyboardEvent<HTMLTextAreaElement>) => {
// If mention popover is open, handle arrow keys and enter
if (mentionPopover.isOpen && mentionPopoverRef.current) {
@@ -1504,7 +1494,7 @@ export default function ChatInput({
</Tooltip>
<div className="w-px h-4 bg-border-default mx-2" />
<BottomMenuModeSelection />
{process.env.ALPHA && sessionId && (
{sessionId && (
<>
<div className="w-px h-4 bg-border-default mx-2" />
<BottomMenuExtensionSelection sessionId={sessionId} />