Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@cursor review |
PR SummaryMedium Risk Overview Updates Written by Cursor Bugbot for commit 474c1fd. This will update automatically on new commits. Configure here. |
|
@greptile review |
Greptile SummaryThis PR adds image paste support to the mothership chat input. When a user pastes clipboard content containing image files, the images are extracted, assembled into a synthetic Key changes:
Confidence Score: 5/5Safe to merge — the paste handler is correctly scoped to image-only payloads and reuses the battle-tested processFiles upload pipeline. All three files contain straightforward, low-risk changes. The paste logic only intercepts events containing image files (text-only pastes fall through untouched), the DataTransfer/FileList construction is the standard browser pattern, the useCallback with empty deps is correct because filesRef is a stable ref updated each render, and the hybrid.ts change is semantically equivalent. No new error paths, no security concerns, and the processFiles upload path has existing error handling. No P0/P1 issues found. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Textarea as Textarea (onPaste)
participant HandlePaste as handlePaste
participant DataTransfer as DataTransfer API
participant ProcessFiles as processFiles (useFileAttachments)
participant S3 as /api/files/upload
User->>Textarea: Ctrl+V (paste with image)
Textarea->>HandlePaste: ClipboardEvent
HandlePaste->>HandlePaste: Filter clipboard items for image/* files
alt No image files found
HandlePaste-->>Textarea: return (default paste proceeds)
else Image files found
HandlePaste->>HandlePaste: e.preventDefault()
HandlePaste->>DataTransfer: new DataTransfer(), add image files
HandlePaste->>ProcessFiles: filesRef.current.processFiles(dt.files)
ProcessFiles->>ProcessFiles: createObjectURL (preview)
ProcessFiles->>ProcessFiles: setAttachedFiles (uploading: true)
ProcessFiles->>S3: POST /api/files/upload
S3-->>ProcessFiles: { fileInfo: { path, key } }
ProcessFiles->>ProcessFiles: setAttachedFiles (uploading: false, path/key set)
end
Reviews (2): Last reviewed commit: "Fix type error" | Re-trigger Greptile |
apps/sim/app/workspace/[workspaceId]/home/components/user-input/user-input.tsx
Show resolved
Hide resolved
* feat(ui): handle image paste * Fix lint * Fix type error --------- Co-authored-by: Theodore Li <theo@sim.ai>
* feat(logs): add additional metadata for workflow execution logs * Revert "Feat(logs) upgrade mothership chat messages to error (#3772)" This reverts commit 9d1b976. * Fix lint, address greptile comments * improvement(sidebar): expand sidebar by hovering and clicking the edge (#3830) * improvement(sidebar): expand sidebar by hovering and clicking the edge * improvement(sidebar): add keyboard shortcuts for new workflow/task, center search modal, fix edge ARIA * improvement(sidebar): use Tooltip.Shortcut for inline shortcut display * fix(sidebar): change new workflow shortcut from Mod+Shift+W to Mod+Shift+P to avoid browser close-window conflict * fix(hotkeys): fall back to event.code for international keyboard layout compatibility * fix(sidebar): guard add-workflow shortcut with canEdit and isCreatingWorkflow checks * feat(ui): handle image paste (#3826) * feat(ui): handle image paste * Fix lint * Fix type error --------- Co-authored-by: Theodore Li <theo@sim.ai> * feat(files): interactive markdown checkbox toggling in preview (#3829) * feat(files): interactive markdown checkbox toggling in preview * fix(files): handle ordered-list checkboxes and fix index drift * lint * fix(files): remove counter offset that prevented checkbox toggling * fix(files): apply task-list styling to ordered lists too * fix(files): render single pass when interactive to avoid index drift * fix(files): move useMemo above conditional return to fix Rules of Hooks * fix(files): pass content directly to preview when not streaming to avoid stale frame * improvement(home): position @ mention popup at caret and fix icon consistency (#3831) * improvement(home): position @ mention popup at caret and fix icon consistency * fix(home): pin mirror div to document origin and guard button anchor * chore(auth): restore hybrid.ts to staging * improvement(ui): sidebar (#3832) * Fix logger tests * Add metadata to mothership logs --------- Co-authored-by: Theodore Li <theo@sim.ai> Co-authored-by: Waleed <walif6@gmail.com> Co-authored-by: Theodore Li <theo@sim.ai>
Summary
Allow pasting images into mothership chat
Type of Change
Testing
Validated images can be pasted in both mothership and copilot chats
Checklist
Screenshots/Videos