feat(files): allow image uploads in workspace files#4419
feat(files): allow image uploads in workspace files#4419waleedlatif1 wants to merge 1 commit intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
PR SummaryLow Risk Overview Upload validation constants were consolidated by promoting the image extension list into Reviewed by Cursor Bugbot for commit b72e737. Configure here. |
1969271 to
277b344
Compare
277b344 to
143056c
Compare
Greptile SummaryThis PR fixes the workspace file picker rejecting image uploads by adding Confidence Score: 5/5Safe to merge — the fix is targeted and correct, with no regressions on existing paths. All findings are P2 style/consistency observations. Both previously flagged P2s (MIME type gaps and missing SupportedImageExtension in the union) are addressed. No P0 or P1 issues found. apps/sim/lib/uploads/utils/validation.ts — minor consistency gap with SUPPORTED_IMAGE_MIME_TYPES not being exported as a Record like its audio/video counterparts. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[File selected in picker] --> B{Which picker?}
B -->|Workspace files| C[ACCEPT_ATTR: ext-only]
B -->|Chat input| D[CHAT_ACCEPT_ATTRIBUTE: MIME + ext]
C --> E[SUPPORTED_EXTENSIONS\ndoc + code + audio + video + image]
D --> F[ACCEPT_ATTRIBUTE\ndoc MIME and ext]
D --> G[SUPPORTED_IMAGE_MIME_TYPES\n12 MIME types]
D --> H[SUPPORTED_IMAGE_EXTENSIONS mapped\n.png .jpg .jpeg ...]
E --> I[SUPPORTED_IMAGE_EXTENSIONS\nnew in this PR]
G --> I
H --> I
I --> J[SupportedImageExtension type]
J --> K[SupportedMediaExtension union\ndoc + audio + video + image]
Reviews (2): Last reviewed commit: "feat(files): allow image uploads in work..." | Re-trigger Greptile |
143056c to
b72e737
Compare
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b72e737. Configure here.
|
|
||
| if (mimeType?.startsWith('audio/')) return 'Audio' | ||
| if (mimeType?.startsWith('video/')) return 'Video' | ||
| if (mimeType?.startsWith('image/')) return 'Image' |
There was a problem hiding this comment.
Image files hidden when any type filter active
Medium Severity
Now that images can be uploaded, the type filter logic in filteredFiles silently excludes them whenever any type filter is active. The filter checks for 'document', 'audio', and 'video' but has no 'image' branch, so image files always hit return false. The filter dropdown also lacks an 'image' option, so there's no way for users to filter for or retain images when filtering by type.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit b72e737. Configure here.


Summary
acceptattribute had no image extensions, even though the backend accepts any file typeSUPPORTED_IMAGE_EXTENSIONS(png, jpg, jpeg, gif, webp, svg, bmp, tif, tiff, heic, heif, avif, ico) and included it in the workspace files pickerCHAT_ACCEPT_ATTRIBUTEType of Change
Testing
Tested manually
Checklist