Add composer drag-and-drop and image paste attachments#20
Add composer drag-and-drop and image paste attachments#20SHAREN wants to merge 3 commits intofriuns2:mainfrom
Conversation
Review Summary by QodoAdd composer drag-and-drop and image paste attachments
WalkthroughsDescription• Add drag-and-drop file attachment support to composer • Implement clipboard image paste with Ctrl+V functionality • Block submit while attachments are processing with feedback • Add dark theme styling for drag overlay and new states Diagramflowchart LR
User["User Action"]
DragDrop["Drag & Drop Files"]
Paste["Paste Image Ctrl+V"]
Picker["File Picker"]
User --> DragDrop
User --> Paste
User --> Picker
DragDrop --> Pipeline["Attachment Pipeline"]
Paste --> Pipeline
Picker --> Pipeline
Pipeline --> ImageFile["Image File"]
Pipeline --> OtherFile["Other File"]
ImageFile --> DataUrl["Convert to Data URL"]
OtherFile --> Upload["Upload to Server"]
DataUrl --> Display["Display in Composer"]
Upload --> Display
Display --> Submit["Enable Submit Button"]
File Changes1. src/components/content/ThreadComposer.vue
|
Code Review by Qodo
1.
|
|
Bug risk: composer submit can be blocked indefinitely when an attachment upload hangs.
Suggested fix: add Refs: |
|
Bug risk: attachment failures in a batch can be silently hidden.
Suggested fix: keep per-batch success/failure counts and render final status like Refs: |
|
Bug risk: drag overlay can stick in edge drag flows.
Suggested fix: add global fallback cleanup ( Refs:
|
What changed: - added a 30s abort timeout to `uploadFile()` so stalled uploads resolve cleanly instead of leaving attachment work pending forever - replaced per-file attachment status clearing with aggregate batch feedback so mixed success/failure results stay visible to the user - kept plain-text paste behavior when clipboard data contains both text and images, while still attaching pasted images - added drag-state reset helpers plus window-level cleanup for drag cancel and drop-outside-window flows - documented manual verification steps for these composer fixes in `tests.md` Why: - PR friuns2#20 review found several composer regressions around hung uploads, hidden partial failures, sticky drag overlays, and mixed clipboard paste Impact: - composer submit recovers after timed-out uploads - users can see partial attachment failures instead of having them erased by later successes - drag overlay no longer sticks in edge flows - image paste keeps accompanying plain text Validation: - npm install - npm run build
|
Addressed the attachment/composer review items in the PR head branch and rebased the branch onto the latest Current commits in the PR head branch:
What changed:
Validation:
|
What changed: - added a shared composer attachment pipeline for picker, drag-and-drop, and clipboard image paste - blocked submit while attachment work is pending and surfaced attachment feedback in the composer - added drag-active overlay styling plus dark-theme overrides for the new composer states Why: - upstream codexUI did not yet include the drag-and-drop file flow or Ctrl+V image paste behavior already proven in the local codexui repo - the dark theme needed the follow-up overlay treatment from 2e28ea1 so the new drag state would remain readable Impact: - users can drop files directly onto the composer, paste screenshots with Ctrl+V, and keep normal plain-text paste behavior - dark mode shows the drag overlay with matching colors instead of a light-theme flash Validation: - npm run build - headless Playwright CLI checks for file drop, image drop, image paste, plain-text paste passthrough, and dark overlay screenshot
What changed: - added a 30s abort timeout to `uploadFile()` so stalled uploads resolve cleanly instead of leaving attachment work pending forever - replaced per-file attachment status clearing with aggregate batch feedback so mixed success/failure results stay visible to the user - kept plain-text paste behavior when clipboard data contains both text and images, while still attaching pasted images - added drag-state reset helpers plus window-level cleanup for drag cancel and drop-outside-window flows - documented manual verification steps for these composer fixes in `tests.md` Why: - PR friuns2#20 review found several composer regressions around hung uploads, hidden partial failures, sticky drag overlays, and mixed clipboard paste Impact: - composer submit recovers after timed-out uploads - users can see partial attachment failures instead of having them erased by later successes - drag overlay no longer sticks in edge flows - image paste keeps accompanying plain text Validation: - npm install - npm run build # Conflicts: # tests.md
What changed: - raised the shared attachment upload abort timeout from 30 seconds to 60 seconds - updated the manual test notes to mention the 60 second timeout path Why: - 30 seconds is aggressive for UI file uploads and can create false failures on slower networks Impact: - composer attachment uploads get more time to complete before timing out - manual verification notes match the implemented timeout Validation: - npm run build # Conflicts: # tests.md
d70b177 to
7ce71fe
Compare
|
ты все протестировал еше раз)? |
Summary
Testing
npm run buildhttp://127.0.0.1:4173/#/