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>
This commit is contained in:
egg
2025-12-08 12:39:15 +08:00
parent 599802b818
commit 44822a561a
36 changed files with 2252 additions and 156 deletions

View File

@@ -193,7 +193,7 @@ async def permanent_delete_room(
"type": "system",
"event": "room_deleted",
"room_id": room_id,
"timestamp": datetime.utcnow().isoformat()
"timestamp": datetime.utcnow().isoformat() + "Z"
})
success, error = room_service.permanent_delete_room(db, room_id)
@@ -246,7 +246,7 @@ async def join_room(
detail={
"message": "Already a member of this room",
"current_role": existing.role.value,
"added_at": existing.added_at.isoformat()
"added_at": existing.added_at.isoformat() + "Z"
}
)
@@ -505,12 +505,12 @@ async def add_lot(
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Room not found")
# Get current lots or initialize empty list
current_lots = room.lots or []
current_lots = list(room.lots or []) # Create a new list to ensure change detection
# Prevent duplicates
if request.lot not in current_lots:
current_lots.append(request.lot)
room.lots = current_lots
room.lots = current_lots # Assign new list triggers SQLAlchemy change detection
room.last_updated_at = datetime.utcnow()
db.commit()
db.refresh(room)
@@ -532,11 +532,11 @@ async def remove_lot(
if not room:
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Room not found")
current_lots = room.lots or []
current_lots = list(room.lots or []) # Create a new list to ensure change detection
if lot in current_lots:
current_lots.remove(lot)
room.lots = current_lots
room.lots = current_lots # Assign new list triggers SQLAlchemy change detection
room.last_updated_at = datetime.utcnow()
db.commit()
db.refresh(room)