Skip to content

agent: @U0AJM7X8FBR Chat - /files page - Drag-n-Drop Files.#1594

Open
sweetmantech wants to merge 1 commit intotestfrom
feature/sandbox-file-upload
Open

agent: @U0AJM7X8FBR Chat - /files page - Drag-n-Drop Files.#1594
sweetmantech wants to merge 1 commit intotestfrom
feature/sandbox-file-upload

Conversation

@sweetmantech
Copy link
Copy Markdown
Collaborator

Automated PR from coding agent.

Prompt: @U0AJM7X8FBR Chat - /files page - Drag-n-Drop Files.
• actual: I am unable to drag and drop files on the /files page to add them to my github repository in an org submodule.
• required: I can drag and drop files on the /files page to add them to my github repository in an org submodule.

- lib/sandboxes/uploadFilesToSandbox.ts: client-side API call to POST /api/sandboxes/files
- hooks/useUploadSandboxFiles.ts: React hook wrapping upload with loading/error state
- components/Sandboxes/SandboxFileTree.tsx: drag-and-drop zone using useDragAndDrop,
  uploads to currently selected folder, refreshes tree on success

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 23, 2026

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

Project Deployment Actions Updated (UTC)
recoup-chat Ready Ready Preview Mar 23, 2026 5:55pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 23, 2026

Warning

Rate limit exceeded

@sweetmantech has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 40 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0d0078ed-a547-4dec-b9ec-e1120dc7f0b0

📥 Commits

Reviewing files that changed from the base of the PR and between c39460a and 927f451.

📒 Files selected for processing (3)
  • components/Sandboxes/SandboxFileTree.tsx
  • hooks/useUploadSandboxFiles.ts
  • lib/sandboxes/uploadFilesToSandbox.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/sandbox-file-upload

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 927f45194f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +41 to +43
if (!resolvedDropFolder) {
toast.error("No folder selected. Select a file or folder first.");
return;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Allow drops when the repository tree is empty

This guard makes the new empty-state drop zone unusable. In the filetree.length === 0 branch we still mount getRootProps() (components/Sandboxes/SandboxFileTree.tsx:94-99), but resolvedDropFolder can only come from dropFolder, selectedPath, or getFirstFolderPath(filetree). When the tree is empty all three are "", so every drop immediately returns here with "No folder selected". That means a brand-new org repo cannot be populated via drag-and-drop at all.

Useful? React with 👍 / 👎.

Comment on lines +160 to +161
const parent = getParentFolder(path);
if (parent) setDropFolder(parent);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Target the selected folder instead of its parent

FileTreeFolder forwards its own folder path to onSelect (components/ai-elements/file-tree.tsx:131-133), but this handler always converts the selection to getParentFolder(path). As soon as a user clicks a nested folder like org/assets, the drop target becomes org, so uploads land in the parent directory instead of the folder they picked. It also makes empty folders impossible to target, because there is no file inside them to select first.

Useful? React with 👍 / 👎.

Comment on lines +32 to +35
} catch (err) {
const message = err instanceof Error ? err.message : "Upload failed";
setError(message);
return [];
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Propagate request-level upload failures to the UI

SandboxFileTree.handleDrop only renders failure toasts for entries returned in results (components/Sandboxes/SandboxFileTree.tsx:52-63), but this catch block swallows auth/network/5xx failures and returns []. In those cases the loading toast is dismissed and the user sees no error at all, so a broken upload path looks like a no-op. Re-throwing here, or returning a synthetic failed result, would keep those failures visible.

Useful? React with 👍 / 👎.

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