Skip to content
This repository was archived by the owner on Feb 27, 2026. It is now read-only.

[WIP] Fix drag-and-drop file upload to save in correct directory#288

Merged
danielalves96 merged 2 commits intonextfrom
copilot/fix-drag-upload-directory
Oct 20, 2025
Merged

[WIP] Fix drag-and-drop file upload to save in correct directory#288
danielalves96 merged 2 commits intonextfrom
copilot/fix-drag-upload-directory

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 9, 2025

  • Analyze the file upload drag-and-drop issue
  • Identify root cause: GlobalDropZone component not receiving currentFolderId prop in apps/web/src/app/files/page.tsx
  • Fix the issue by passing currentFolderId to GlobalDropZone component
  • Run lint and type-check to verify the changes
  • Verify the fix resolves the issue

Summary

Fixed the issue where drag-and-drop file uploads were always saved in the root directory instead of the current folder. The GlobalDropZone component now receives the currentFolderId prop, which is calculated from the currentPath state (same logic used for the FilesModals component).

Changes Made

  • Updated apps/web/src/app/files/page.tsx to pass currentFolderId prop to GlobalDropZone component
  • The currentFolderId is computed as currentPath.length > 0 ? currentPath[currentPath.length - 1].id : null

This minimal change ensures that when users navigate to a folder and drag files to upload, they will be uploaded to the current folder instead of always going to the root directory.

Original prompt

This section details on the original issue you should resolve

<issue_title>file upload by drag is always placed in the root directory</issue_title>
<issue_description>even when a new dir is created and user entered the dir in the web ui, drag to the new dir always save file in the root</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #265


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…directory

Co-authored-by: danielalves96 <62755605+danielalves96@users.noreply.github.com>
@danielalves96
Copy link
Copy Markdown
Contributor

@copilot the error that you encountered is related to eslint, see the configs and run the command, and fix before finish

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 9, 2025

@copilot the error that you encountered is related to eslint, see the configs and run the command, and fix before finish

I've verified the eslint configuration and run the linting command. All checks are passing:

  • pnpm lint - No errors
  • pnpm type-check - No errors
  • pnpm validate - All validations passed

The code change in commit 007690f follows the prettier formatting rules configured in the eslint setup and there are no linting issues to fix.

@danielalves96 danielalves96 marked this pull request as ready for review October 20, 2025 13:31
@danielalves96 danielalves96 merged commit c798c1b into next Oct 20, 2025
1 check passed
@danielalves96 danielalves96 deleted the copilot/fix-drag-upload-directory branch October 21, 2025 17:11
anthony0030 pushed a commit to anthony0030/Palmr that referenced this pull request Jan 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants