@@ -3,7 +3,7 @@ import { ArrowRight, Info } from 'react-feather';
33import { useNavigate } from 'react-router' ;
44import { useAuth } from '@/contexts/auth-context' ;
55import { ProjectModeSelector , type ProjectModeOption } from '../components/project-mode-selector' ;
6- import type { ProjectType } from '@/api-types' ;
6+ import { MAX_AGENT_QUERY_LENGTH , SUPPORTED_IMAGE_MIME_TYPES , type ProjectType } from '@/api-types' ;
77import { useFeature } from '@/features' ;
88import { useAuthGuard } from '../hooks/useAuthGuard' ;
99import { usePaginatedApps } from '@/hooks/use-paginated-apps' ;
@@ -14,7 +14,6 @@ import { useImageUpload } from '@/hooks/use-image-upload';
1414import { useDragDrop } from '@/hooks/use-drag-drop' ;
1515import { ImageUploadButton } from '@/components/image-upload-button' ;
1616import { ImageAttachmentPreview } from '@/components/image-attachment-preview' ;
17- import { SUPPORTED_IMAGE_MIME_TYPES } from '@/api-types' ;
1817import { toast } from 'sonner' ;
1918
2019export default function Home ( ) {
@@ -89,6 +88,13 @@ export default function Home() {
8988 const discoverReady = useMemo ( ( ) => ! loading && ( apps ?. length ?? 0 ) > 5 , [ loading , apps ] ) ;
9089
9190 const handleCreateApp = ( query : string , mode : ProjectType ) => {
91+ if ( query . length > MAX_AGENT_QUERY_LENGTH ) {
92+ toast . error (
93+ `Prompt too large (${ query . length } characters). Maximum allowed is ${ MAX_AGENT_QUERY_LENGTH } characters.` ,
94+ ) ;
95+ return ;
96+ }
97+
9298 const encodedQuery = encodeURIComponent ( query ) ;
9399 const encodedMode = encodeURIComponent ( mode ) ;
94100
0 commit comments