diff --git a/src/browser/components/ChatInput/index.tsx b/src/browser/components/ChatInput/index.tsx index 3f124cbfc7..aa9a0f24ce 100644 --- a/src/browser/components/ChatInput/index.tsx +++ b/src/browser/components/ChatInput/index.tsx @@ -563,9 +563,13 @@ export const ChatInput: React.FC = (props) => { // Handle standard message sending based on variant if (variant === "creation") { setIsSending(true); - const ok = await creationState.handleSend(messageText); + const ok = await creationState.handleSend( + messageText, + imageParts.length > 0 ? imageParts : undefined + ); if (ok) { setInput(""); + setImageAttachments([]); if (inputRef.current) { inputRef.current.style.height = "36px"; } @@ -882,9 +886,9 @@ export const ChatInput: React.FC = (props) => { mode={mode} onChange={setInput} onKeyDown={handleKeyDown} - onPaste={variant === "workspace" ? handlePaste : undefined} - onDragOver={variant === "workspace" ? handleDragOver : undefined} - onDrop={variant === "workspace" ? handleDrop : undefined} + onPaste={handlePaste} + onDragOver={handleDragOver} + onDrop={handleDrop} suppressKeys={showCommandSuggestions ? COMMAND_SUGGESTION_KEYS : undefined} placeholder={placeholder} disabled={!editingMessage && (disabled || isSending)} @@ -897,10 +901,8 @@ export const ChatInput: React.FC = (props) => { /> - {/* Image attachments - workspace only */} - {variant === "workspace" && ( - - )} + {/* Image attachments */} +
{/* Editing indicator - workspace only */} diff --git a/src/browser/components/ChatInput/useCreationWorkspace.ts b/src/browser/components/ChatInput/useCreationWorkspace.ts index 6af1bfe8b5..57f587577a 100644 --- a/src/browser/components/ChatInput/useCreationWorkspace.ts +++ b/src/browser/components/ChatInput/useCreationWorkspace.ts @@ -16,6 +16,7 @@ import { } from "@/common/constants/storage"; import type { Toast } from "@/browser/components/ChatInputToast"; import { createErrorToast } from "@/browser/components/ChatInputToasts"; +import type { ImagePart } from "@/common/types/ipc"; interface UseCreationWorkspaceOptions { projectPath: string; @@ -49,7 +50,7 @@ interface UseCreationWorkspaceReturn { toast: Toast | null; setToast: (toast: Toast | null) => void; isSending: boolean; - handleSend: (message: string) => Promise; + handleSend: (message: string, imageParts?: ImagePart[]) => Promise; } /** @@ -95,7 +96,7 @@ export function useCreationWorkspace({ }, [projectPath]); const handleSend = useCallback( - async (message: string): Promise => { + async (message: string, imageParts?: ImagePart[]): Promise => { if (!message.trim() || isSending) return false; setIsSending(true); @@ -114,6 +115,7 @@ export function useCreationWorkspace({ runtimeConfig, projectPath, // Pass projectPath when workspaceId is null trunkBranch: settings.trunkBranch, // Pass selected trunk branch from settings + imageParts: imageParts && imageParts.length > 0 ? imageParts : undefined, }); if (!result.success) {