| Sean McCullough | 618bfb2 | 2025-06-25 20:52:30 +0000 | [diff] [blame] | 1 | /** |
| 2 | * Shared fake timeline message data for demos |
| 3 | */ |
| 4 | |
| 5 | import { AgentMessage } from "../../../types"; |
| 6 | import { sampleToolCalls } from "./tool-calls"; |
| 7 | |
| 8 | const baseTimestamp = new Date("2024-01-15T10:00:00Z"); |
| 9 | |
| 10 | export const sampleTimelineMessages: AgentMessage[] = [ |
| 11 | { |
| 12 | type: "user", |
| 13 | end_of_turn: true, |
| 14 | content: |
| 15 | "Can you help me implement a file upload component with drag and drop support?", |
| 16 | timestamp: new Date(baseTimestamp.getTime()).toISOString(), |
| 17 | conversation_id: "demo-conversation", |
| 18 | idx: 0, |
| 19 | }, |
| 20 | { |
| 21 | type: "agent", |
| 22 | end_of_turn: false, |
| 23 | content: |
| 24 | "I'll help you create a file upload component with drag and drop support. Let me start by analyzing your current project structure and then implement the component.", |
| 25 | timestamp: new Date(baseTimestamp.getTime() + 1000).toISOString(), |
| 26 | conversation_id: "demo-conversation", |
| 27 | idx: 1, |
| 28 | }, |
| 29 | { |
| 30 | type: "agent", |
| 31 | end_of_turn: false, |
| 32 | content: "First, let me check your current directory structure:", |
| 33 | tool_calls: [sampleToolCalls[2]], // bash command |
| 34 | timestamp: new Date(baseTimestamp.getTime() + 2000).toISOString(), |
| 35 | conversation_id: "demo-conversation", |
| 36 | idx: 2, |
| 37 | }, |
| 38 | { |
| 39 | type: "tool", |
| 40 | end_of_turn: false, |
| 41 | content: |
| 42 | "src/\n├── components/\n│ ├── Button.tsx\n│ └── Input.tsx\n├── styles/\n│ └── globals.css\n└── utils/\n └── helpers.ts", |
| 43 | tool_name: "bash", |
| 44 | tool_call_id: "toolu_01bash123", |
| 45 | timestamp: new Date(baseTimestamp.getTime() + 3000).toISOString(), |
| 46 | conversation_id: "demo-conversation", |
| 47 | idx: 3, |
| 48 | }, |
| 49 | { |
| 50 | type: "agent", |
| 51 | end_of_turn: true, |
| 52 | content: |
| 53 | "Perfect! I can see you have a components directory. Now I'll create a FileUpload component with drag and drop functionality. This will include:\n\n1. A drop zone area\n2. File selection via click\n3. Progress indicators\n4. File validation\n5. Preview of selected files", |
| 54 | timestamp: new Date(baseTimestamp.getTime() + 4000).toISOString(), |
| 55 | conversation_id: "demo-conversation", |
| 56 | idx: 4, |
| 57 | }, |
| 58 | ]; |
| 59 | |
| 60 | export const longTimelineMessage: AgentMessage = { |
| 61 | type: "agent", |
| 62 | end_of_turn: true, |
| 63 | content: `I've analyzed your codebase and here's a comprehensive plan for implementing the file upload component: |
| 64 | |
| 65 | ## Implementation Plan |
| 66 | |
| 67 | ### 1. Component Structure |
| 68 | The FileUpload component will be built using React with TypeScript. It will consist of: |
| 69 | - A main container with drop zone styling |
| 70 | - File input element (hidden) |
| 71 | - Visual feedback for drag states |
| 72 | - File list display area |
| 73 | - Progress indicators |
| 74 | |
| 75 | ### 2. Key Features |
| 76 | - **Drag & Drop**: Full drag and drop support with visual feedback |
| 77 | - **Multiple Files**: Support for selecting multiple files at once |
| 78 | - **File Validation**: Size limits, file type restrictions |
| 79 | - **Progress Tracking**: Upload progress for each file |
| 80 | - **Error Handling**: User-friendly error messages |
| 81 | - **Accessibility**: Proper ARIA labels and keyboard navigation |
| 82 | |
| 83 | ### 3. Technical Considerations |
| 84 | - Use the HTML5 File API for file handling |
| 85 | - Implement proper event handlers for drag events |
| 86 | - Add debouncing for performance |
| 87 | - Include comprehensive error boundaries |
| 88 | - Ensure mobile responsiveness |
| 89 | |
| 90 | ### 4. Styling Approach |
| 91 | - CSS modules for component-scoped styles |
| 92 | - Responsive design with mobile-first approach |
| 93 | - Smooth animations and transitions |
| 94 | - Consistent with your existing design system |
| 95 | |
| 96 | This implementation will provide a robust, user-friendly file upload experience that integrates seamlessly with your existing application.`, |
| 97 | timestamp: new Date(baseTimestamp.getTime() + 5000).toISOString(), |
| 98 | conversation_id: "demo-conversation", |
| 99 | idx: 5, |
| 100 | }; |
| 101 | |
| 102 | export const mixedTimelineMessages: AgentMessage[] = [ |
| 103 | ...sampleTimelineMessages, |
| 104 | longTimelineMessage, |
| 105 | { |
| 106 | type: "user", |
| 107 | end_of_turn: true, |
| 108 | content: "That sounds great! Can you also add file type validation?", |
| 109 | timestamp: new Date(baseTimestamp.getTime() + 6000).toISOString(), |
| 110 | conversation_id: "demo-conversation", |
| 111 | idx: 6, |
| 112 | }, |
| 113 | ]; |