fix(file-upload): fixed file upload URL required#875
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
There was a problem hiding this comment.
Greptile Summary
This PR fixes a bug where file upload URL fields were incorrectly marked as required across two file handling blocks: the main File block and the Mistral Parse block. The core issue was environment-dependent behavior that caused inconsistent user experiences between development and production environments.
Previously, both blocks used isProd checks to conditionally enable URL input functionality. In development, only URL input was available and always required. In production, both URL and file upload options were available, but the URL field remained required regardless of the selected input method. This created a confusing user experience where selecting "Upload Files" would still require a URL to be provided.
The fix removes all environment-dependent logic by eliminating the isProd checks and related conditional flags (shouldEnableURLInput in file.ts and shouldEnableFileUpload in mistral_parse.ts). Now both blocks always show an input method dropdown with options for both URL and file upload. The validation logic has been updated to only require the appropriate field based on the user's selection - URL when "URL" is selected, and file upload when "Upload" is selected.
This change standardizes the user interface across all environments and implements proper conditional validation, ensuring that users only need to provide the input type they've selected. The blocks now have consistent behavior whether running in development or production, making the file handling workflow more intuitive and reducing user confusion.
Confidence score: 4/5
- This PR fixes a legitimate UX bug with straightforward changes that improve consistency
- Score reflects well-contained changes with clear validation logic improvements
- Pay close attention to the parameter validation logic in both file blocks to ensure edge cases are handled properly
2 files reviewed, no comments
* fix(file-upload): fixed file upload URL required * cleanup
* fix(file-upload): fixed file upload URL required * cleanup
Summary
Fixed file upload URL required
Type of Change
Testing
Tested manually.
Checklist