From 8f3417af15da7f7b95b25e3c609f5d24b76455f8 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 21:50:46 +0000 Subject: [PATCH] feat: Update frontend file validation to accept MD, DOC, TXT, and HTML formats - Update IndexForm.tsx to accept .md, .doc, .txt, .html, .htm file extensions - Update IndexWizard.tsx file input accept attribute for new formats - Update chat-input.tsx validation logic to handle new MIME types and extensions - Update empty-chat-state.tsx validation logic for comprehensive file support - Update test-upload.html to accept all supported file formats - Resolves frontend file upload restrictions for unstructured document formats Co-Authored-By: PromptEngineer --- src/components/IndexForm.tsx | 4 ++-- src/components/IndexWizard.tsx | 4 ++-- src/components/ui/chat-input.tsx | 13 ++++++++++--- src/components/ui/empty-chat-state.tsx | 13 ++++++++++--- src/test-upload.html | 4 ++-- 5 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/components/IndexForm.tsx b/src/components/IndexForm.tsx index 072ef27..f0e0d9a 100644 --- a/src/components/IndexForm.tsx +++ b/src/components/IndexForm.tsx @@ -99,7 +99,7 @@ export function IndexForm({ onClose, onIndexed }: Props) { > Drag & Drop documents here or click to browse - setFiles(e.target.files)} /> + setFiles(e.target.files)} /> {files &&

{files.length} file(s) selected

} @@ -220,4 +220,4 @@ export function IndexForm({ onClose, onIndexed }: Props) { ); -} \ No newline at end of file +} \ No newline at end of file diff --git a/src/components/IndexWizard.tsx b/src/components/IndexWizard.tsx index 1eb37f4..8e14a9d 100644 --- a/src/components/IndexWizard.tsx +++ b/src/components/IndexWizard.tsx @@ -25,7 +25,7 @@ export function IndexWizard({ onClose }: Props) {
- +
@@ -69,4 +69,4 @@ export function IndexWizard({ onClose }: Props) {
); -} \ No newline at end of file +} \ No newline at end of file diff --git a/src/components/ui/chat-input.tsx b/src/components/ui/chat-input.tsx index f6d9c2b..a6ff677 100644 --- a/src/components/ui/chat-input.tsx +++ b/src/components/ui/chat-input.tsx @@ -91,10 +91,17 @@ export function ChatInput({ if (file.type === 'application/pdf' || file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' || + file.type === 'application/msword' || file.type === 'text/html' || + file.type === 'text/markdown' || + file.type === 'text/plain' || + file.name.toLowerCase().endsWith('.pdf') || + file.name.toLowerCase().endsWith('.docx') || + file.name.toLowerCase().endsWith('.doc') || file.name.toLowerCase().endsWith('.html') || file.name.toLowerCase().endsWith('.htm') || - file.name.toLowerCase().endsWith('.docx')) { + file.name.toLowerCase().endsWith('.md') || + file.name.toLowerCase().endsWith('.txt')) { newFiles.push({ id: crypto.randomUUID(), name: file.name, @@ -157,7 +164,7 @@ export function ChatInput({
{/* Hidden file input (kept for future use) */} - + {/* Textarea */}