Skip to content

improvement(gdrive): remove mime type subblock from upload file tool #1674

Merged
icecrasher321 merged 2 commits intostagingfrom
improvement/file-type-gdrive
Oct 17, 2025
Merged

improvement(gdrive): remove mime type subblock from upload file tool #1674
icecrasher321 merged 2 commits intostagingfrom
improvement/file-type-gdrive

Conversation

@icecrasher321
Copy link
Copy Markdown
Collaborator

Summary

This is overridden always by actual mime type of uploaded file.

Type of Change

  • Other: UI improvement

Testing

Manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel Bot commented Oct 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Oct 17, 2025 9:56pm

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

@icecrasher321 icecrasher321 merged commit 64eee58 into staging Oct 17, 2025
9 checks passed
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

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 mimeType subblock from upload operation condition (now only shown for create_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
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

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.

1 participant