From 906bf3e27eb05f586df86a3227d74be7e7e9e256 Mon Sep 17 00:00:00 2001 From: Chris Coveney Date: Wed, 4 Nov 2026 20:58:28 -0800 Subject: [PATCH] remove client-side file size caps on upload The 20/50/10MB upload limits were left over from early development and are no longer needed. 1. Drop the 20MB maxFileSize prop and check from the chat FileAttacher 2. Drop the 50MB check from the sidebar project-document upload 3. Drop the 10MB check and stale "Max 50MB" hint from the upload dialog --- src/app/components/document-upload-dialog.tsx | 9 +-------- src/app/components/file-attacher.tsx | 9 +-------- .../components/right-sidebar/use-project-documents.ts | 7 ------- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/app/components/document-upload-dialog.tsx b/src/app/components/document-upload-dialog.tsx index 5fde4b18..e8605ce1 100644 --- a/src/app/components/document-upload-dialog.tsx +++ b/src/app/components/document-upload-dialog.tsx @@ -60,18 +60,11 @@ export default function DocumentUploadDialog({ const validateAndSetFile = (file: File) => { const allowedTypes = ['application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'text/plain', 'text/csv', 'text/markdown']; - const maxSize = 10 * 1024 * 1024; // 10MB - if (!allowedTypes.includes(file.type) && !/\.md$/i.test(file.name)) { setUploadError('Invalid file type. Supported: PDF, DOCX, TXT, CSV, MD'); return; } - if (file.size > maxSize) { - setUploadError('File size exceeds 10MB limit'); - return; - } - setUploadError(''); setUploadFiles([file]); }; @@ -343,7 +336,7 @@ export default function DocumentUploadDialog({ or click to browse - Supported: PDF, DOCX, TXT, CSV (Max 50MB) + Supported: PDF, DOCX, TXT, CSV maxSizeBytes) { - return `File size exceeds ${maxFileSize}MB limit`; - } return null; }; @@ -196,7 +189,7 @@ export default function FileAttacher({ // Start upload immediately await uploadFile(file); - }, [maxFileSize, onError]); + }, [onError]); // Keep ref in sync so external drop useEffect can call it handleFileSelectRef.current = handleFileSelect; diff --git a/src/app/components/right-sidebar/use-project-documents.ts b/src/app/components/right-sidebar/use-project-documents.ts index 0ba78a03..6a4fe6e3 100644 --- a/src/app/components/right-sidebar/use-project-documents.ts +++ b/src/app/components/right-sidebar/use-project-documents.ts @@ -208,18 +208,11 @@ export function useProjectDocuments({ projectId, folderPath }: UseProjectDocumen const validateFile = (file: File): boolean => { const allowedTypes = ['application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'text/plain', 'text/markdown']; - const maxSize = 50 * 1024 * 1024; // 50MB - if (!allowedTypes.includes(file.type) && !/\.md$/i.test(file.name)) { setUploadError('Invalid file type. Supported: PDF, DOCX, TXT, MD'); return false; } - if (file.size > maxSize) { - setUploadError('File size exceeds 50MB limit'); - return false; - } - return true; };