Repository navigation
fix(web): hide folder tab in agent JSON import uploader - #16754
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe ChangesOptional Folder Tab in FileUploader
Estimated code review effort: 1 (Trivial) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Warning Tools execution failed with the following error: Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error) Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
wangq8
left a comment
There was a problem hiding this comment.
Review: PR #16754 — fix(web): hide folder tab in agent JSON import uploader
Author: euvre | +32/-18 | 2 files
Summary
This PR addresses a bug where the agent JSON import dialog showed both "Files" and "Folder" tabs from the shared FileUploader component. Selecting a folder of multiple files caused errors since the dialog expects a single DSL file. The fix adds a showFolderTab prop to FileUploader (default true for backward compatibility) and sets it to false in the agent upload form.
✅ What's Good
- Minimal, focused change — only 2 files touched, +32/-18 lines. The diff is easy to review.
- Backward compatible —
showFolderTabdefaults totrue, so all existing callers behave identically without changes. - JSDoc added on the new prop — good practice for a shared component.
- Correct defaulting —
Tabs defaultValue="file"ensures no broken state when folder tab is hidden. The Tabs component gracefully renders a single tab. - CodeRabbit already gave a clean pass — no actionable issues found.
🔍 Considerations
Other single-file consumers exist — The MCP import dialog, Gmail token field, and Google Drive token field are also single-file JSON uploaders (maxFileCount={1}, .json only) and currently still show the folder tab. Consider whether they should also benefit from this fix. Out of scope for this PR, but worth a follow-up.
🧪 Testing
The test steps described are correct. Verified the following through code review:
- The
Tabs defaultValue="file"ensures no broken state when folder tab is hidden - The default
truevalue preserves all other callers unchanged - Conditional JSX wrapping (
{showFolderTab && (...) }) handles both tabs (trigger + content) consistently
Verdict
LGTM — clean fix, ready to merge. No regressions introduced.
Summary
The agent JSON import dialog only supports uploading a single DSL file. However, the shared FileUploader component rendered both the Files and Folder tabs. Selecting a folder containing multiple files caused the error shown below.
Changes
How to test
Labels
/ci