feat: improve file upload message handling and UI

Backend:
- Handle both string and list format for message content in uploads middleware
- Extract text content from structured message blocks
- Add logging for debugging file upload flow

Frontend:
- Separate file display from message bubble for human messages
- Show uploaded files outside the message bubble for cleaner layout
- Improve file card border styling with subtle border color
- Add debug logging for message submission with files

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
ruitanglin
2026-01-29 12:51:21 +08:00
parent 6ae4868780
commit ce9731c10a
3 changed files with 102 additions and 3 deletions

View File

@@ -73,6 +73,12 @@ export function useSubmitThread({
const callback = useCallback(
async (message: PromptInputMessage) => {
const text = message.text.trim();
console.log('[useSubmitThread] Submitting message:', {
text,
hasFiles: !!message.files?.length,
filesCount: message.files?.length || 0
});
// Upload files first if any
if (message.files && message.files.length > 0) {