Files
Task_Reporter/openspec/changes/archive/2025-12-08-improve-file-display-and-timezone/proposal.md
egg 44822a561a feat: Improve file display, timezone handling, and LOT management
Changes:
- Fix datetime serialization with UTC 'Z' suffix for correct timezone display
- Add PDF upload support with extension fallback for MIME detection
- Fix LOT add/remove by creating new list for SQLAlchemy JSON change detection
- Add file message components (FileMessage, ImageLightbox, UploadPreview)
- Add multi-file upload support with progress tracking
- Link uploaded files to chat messages via message_id
- Include file attachments in AI report generation
- Update specs for file-storage, realtime-messaging, and ai-report-generation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 12:39:15 +08:00

24 lines
1.4 KiB
Markdown

# 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`