# Change: Improve File Display in Chat and Fix Timezone Issues ## Why Currently, uploaded files and images only appear in the "file drawer" sidebar, making it difficult to understand the context of when and why a file was uploaded. This also impacts AI report generation, as the AI cannot associate files with the conversation context. Additionally, some parts of the application still display times in GMT+0 instead of GMT+8. ## What Changes - **BREAKING**: Message creation when uploading files - files now generate a linked message in chat - Display uploaded files and images inline in the chat conversation - Add image preview functionality with lightbox - Show image thumbnails in chat messages (expandable to full size) - Non-image files display with file type icons - Update upload interface to show preview before sending - Update AI report data collection to include file context (associated messages) - Fix remaining GMT+0 timestamp displays to use GMT+8 ## Impact - Affected specs: file-storage, realtime-messaging, ai-report-generation - Affected code: - Backend: `app/modules/file_storage/router.py`, `app/modules/realtime/` (message creation on upload) - Backend: `app/modules/report_generation/services/report_data_service.py` - Frontend: `frontend/src/pages/RoomDetail.tsx` - Frontend: New components `FileMessage.tsx`, `ImagePreview.tsx` - Database: May need migration to add `message_id` FK to `tr_room_files`