From 1a2e897c794994e489fad86768308b99e1ddbd8c Mon Sep 17 00:00:00 2001 From: Pragadeesh122 Date: Fri, 19 Jun 2026 20:10:11 -0500 Subject: [PATCH 1/2] feat(onboarding): tighten first-run empty states and upload feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First-run flow improvements for the create-project -> upload -> first grounded answer path (JOB-5): - Empty-project chat area now guides the user to upload their first document (working drag/click dropzone) instead of showing generic tool prompts; shows an "indexing" state and surfaces upload errors. - Once documents are indexed, the empty state suggests grounded questions (summarize / ask about your documents). - Upload failures are surfaced inline (type/size pre-validation mirrors the backend) instead of failing silently to the console. - Per-document status line now explains "Indexing…" and shows failure reasons. - No-projects sidebar state is now a real CTA ("Create your first project") and project creation shows a spinner + inline errors. - Fixed an incorrect "Up to 25 MB" hint — the backend allows 100 MB; added a shared lib/upload.ts so client limits track the backend. Co-Authored-By: Paperclip --- frontend/components/ChatArea.tsx | 151 ++++++++++++++++++++++++- frontend/components/ProjectPage.tsx | 19 ++++ frontend/components/ProjectSidebar.tsx | 45 ++++++-- frontend/components/Sidebar.tsx | 72 ++++++++---- frontend/lib/upload.ts | 32 ++++++ 5 files changed, 290 insertions(+), 29 deletions(-) create mode 100644 frontend/lib/upload.ts diff --git a/frontend/components/ChatArea.tsx b/frontend/components/ChatArea.tsx index bd58ca0..b579dc3 100644 --- a/frontend/components/ChatArea.tsx +++ b/frontend/components/ChatArea.tsx @@ -6,8 +6,14 @@ import { BookOpenText } from '@phosphor-icons/react/dist/ssr/BookOpenText'; import { Table } from '@phosphor-icons/react/dist/ssr/Table'; import { Compass } from '@phosphor-icons/react/dist/ssr/Compass'; import { Sparkle } from '@phosphor-icons/react/dist/ssr/Sparkle'; +import { FileArrowUp } from '@phosphor-icons/react/dist/ssr/FileArrowUp'; +import { SpinnerGap } from '@phosphor-icons/react/dist/ssr/SpinnerGap'; +import { WarningCircle } from '@phosphor-icons/react/dist/ssr/WarningCircle'; +import { ListBullets } from '@phosphor-icons/react/dist/ssr/ListBullets'; +import { Question } from '@phosphor-icons/react/dist/ssr/Question'; import { ThreadPrimitive } from '@assistant-ui/react'; import type { ChatAttachment, Message, ProjectDocument } from '@/lib/types'; +import { PROJECT_DOC_ACCEPT, PROJECT_DOC_MAX_MB, PROJECT_DOC_SUPPORTED_LABEL } from '@/lib/upload'; import MessageBubble from './MessageBubble'; import ChatInput from './ChatInput'; @@ -40,6 +46,31 @@ const SUGGESTIONS: SuggestionCard[] = [ }, ]; +// Shown once a project has at least one indexed document — orients the user +// toward their first grounded answer instead of generic tool prompts. +const DOC_SUGGESTIONS: SuggestionCard[] = [ + { + label: 'Summarize the key points', + query: 'Summarize the key points from my documents.', + icon: