improvement(gdrive): remove mime type subblock from upload file tool #1674
improvement(gdrive): remove mime type subblock from upload file tool #1674icecrasher321 merged 2 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
💡 Enable Vercel Agent with $100 free credit for automated AI reviews |
There was a problem hiding this comment.
Greptile Overview
Summary
Improved Google Drive upload UX by removing the mimeType selector from the file upload operation, since it's automatically detected from the uploaded file. Also enhanced the schedule configuration UI by adding validation and helper text for the minutes interval input.
Key Changes:
- Google Drive Block: Removed
mimeTypesubblock fromuploadoperation condition (now only shown forcreate_file) - Schedule Modal: Added
max='59'validation and helper text to minutes interval input - Reordered options: Moved "Plain Text" to top of mimeType dropdown for better UX
Technical Details:
The backend automatically detects MIME type from uploaded files via userFile.type (route.ts:135) or defaults to application/octet-stream. For text content creation, users still specify MIME type explicitly. This change aligns the UI with actual backend behavior.
Confidence Score: 5/5
- This PR is safe to merge with minimal risk
- The changes are simple UI improvements that align the interface with actual backend behavior. The mimeType field removal for uploads is correct since the backend auto-detects it from the file. The schedule modal validation is a straightforward enhancement with no logic changes.
- No files require special attention
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| apps/sim/blocks/blocks/google_drive.ts | 5/5 | Removed mimeType subblock from upload operation condition; now only appears for create_file operation where MIME type is actually used |
| apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/schedule/components/schedule-modal.tsx | 5/5 | Added max='59' validation and helper text to minutes interval input for better UX |
Sequence Diagram
sequenceDiagram
participant User
participant UI as Google Drive Block UI
participant Backend as Upload API
participant GDrive as Google Drive API
Note over User,GDrive: Upload Operation Flow (After Changes)
User->>UI: Select "Upload File" operation
UI->>User: Show fileName, file upload, folder selector
Note over UI: mimeType input NOT shown for upload
User->>UI: Upload file
UI->>Backend: POST /api/tools/google_drive/upload<br/>{fileName, file, folderId}
Note over Backend: mimeType auto-detected from file.type<br/>or defaults to application/octet-stream
Backend->>GDrive: Upload with detected mimeType
GDrive-->>Backend: File metadata
Backend-->>UI: Success with file info
Note over User,GDrive: Create File Operation Flow (Unchanged)
User->>UI: Select "Create File" operation
UI->>User: Show fileName, content, mimeType selector
Note over UI: mimeType dropdown IS shown for create_file
User->>UI: Select mimeType & enter content
UI->>Backend: Create file with selected mimeType
Backend->>GDrive: Create with specified mimeType
GDrive-->>Backend: File metadata
Backend-->>UI: Success with file info
2 files reviewed, no comments
Summary
This is overridden always by actual mime type of uploaded file.
Type of Change
Testing
Manually
Checklist