Skip to content

feat(widget): send multiple files per multimodal message - #980

Open
bsreenivas11 wants to merge 4 commits into
mainfrom
bharath/multi-file-upload-widget
Open

bsreenivas11 wants to merge 4 commits into
mainfrom
bharath/multi-file-upload-widget

Conversation

@bsreenivas11

@bsreenivas11 bsreenivas11 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • useFileUpload holds PendingFile[] and the attach input is multiple.
  • Composer sends fileIds and renders N pending chips / transcript attachments.
  • Depends on the client fileIds PR (bharath/multi-file-upload-client).

Written by Cursor Grok 4.6, using Cursor

Test plan

  • Attach one file — still works
  • Attach several files, send, confirm chips and transcript
  • Disable attach at conversation maxFiles
  • Merge after the client PR

bsreenivas11 and others added 2 commits August 25, 2026 17:02
Dual-send file + files so older backends still receive the first attachment.

Co-authored-by: Cursor <cursoragent@cursor.com>
Pending attachments are now an array and go out as fileIds.

Co-authored-by: Cursor <cursoragent@cursor.com>
@bsreenivas11 bsreenivas11 changed the title feat(client): add fileIds to sendMultimodalMessage feat(widget): send multiple files per multimodal message Aug 25, 2026
@bsreenivas11
bsreenivas11 changed the base branch from main to bharath/multi-file-upload-client August 25, 2026 21:08
@bsreenivas11
bsreenivas11 marked this pull request as ready for review August 25, 2026 21:16
@cursor

cursor Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

PR Summary

Medium Risk
Expands the multimodal send path and parallel upload lifecycle (orphan deletes, limits, send gating); behavior depends on the matching client fileIds API being deployed.

Overview
Users can attach several files to one composer message instead of a single attachment. The file picker is multiple, and each selection is uploaded in parallel with its own preview chip; send is blocked while any upload is in flight or any attachment is in an error state.

useFileUpload now tracks PendingFile[] (stable id per item), per-file abort/cleanup, and maxFiles against sent plus pending count. SheetActions sends all ready files in one sendMultimodalMessage call and clears them via markFilesAsSent.

Transcript and display types move from fileInput to fileInputs, and sendMultimodalMessage forwards fileIds to the conversation client (pairs with the separate client fileIds change).

Reviewed by Cursor Bugbot for commit 7e9dcf2. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a8764e7. Configure here.

Comment thread packages/convai-widget-core/src/widget/SheetActions.tsx
Base automatically changed from bharath/multi-file-upload-client to main August 25, 2026 21:33
Comment on lines +52 to +53
fileInput?: TranscriptFileInput | null;
fileInputs?: TranscriptFileInput[] | null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to remove fileInput and just have fileInputs here since this type isn't exported from the package.

Comment on lines +26 to +27
fileInput?: TranscriptFileInput | null;
fileInputs?: TranscriptFileInput[] | null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, let's see if we can remove fileInput in favor of just fileInputs

@giannagerton giannagerton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM just a few comments to look at before merging

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants