fix(web): recursively traverse subdirectories on folder drop in Drives drawer - #5628
fix(web): recursively traverse subdirectories on folder drop in Drives drawer#5628pranjali2076 wants to merge 4 commits into
Conversation
|
@pranjali2076 is attempting to deploy a commit to the agenta projects Team on Vercel. A member of the Team first needs to authorize it. |
|
✅ Thanks @pranjali2076! This PR now meets the contribution requirements and has been reopened. A maintainer will review it soon. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughDropped directories are recursively enumerated through ChangesDrive drop extraction
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant DropHandler
participant getFilesFromDataTransfer
participant UploadFlow
User->>DropHandler: drop files or a directory
DropHandler->>getFilesFromDataTransfer: extract DataTransfer items
getFilesFromDataTransfer-->>DropHandler: return files with relative paths
DropHandler->>UploadFlow: upload extracted files
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
web/oss/src/components/Drives/useDriveDrop.ts (1)
38-79: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider typed
FileSystemEntryvariants instead ofany.
entry: any,batch: any[], anditem as anybypass type checking throughout the traversal. Modern TypeScript exposeswebkitGetAsEntry(): FileSystemEntry | nullonDataTransferItem, andFileSystemFileEntry/FileSystemDirectoryEntry/FileSystemDirectoryReadertypes exist via@types/wicg-entries-apior newer TS DOM lib updates. Please verify whether these types are already available in this project's TypeScript/DOM lib setup before adopting them, since full File-and-Directory-Entries typings are not guaranteed in stocklib.dom.d.ts.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 68a0729e-3de0-431d-b0c1-ebb5e1b213e9
📒 Files selected for processing (1)
web/oss/src/components/Drives/useDriveDrop.ts
…ilesFromDataTransfer
5a01140 to
7d5c837
Compare
|
Thanks for this @pranjali2076 — closing as superseded: #5635 landed the same webkitGetAsEntry() traversal (plus batched readEntries + unit tests) shortly after you opened this. Appreciate you jumping on it! |
Fixes #5626
Summary
getFilesFromDataTransferhelper usingwebkitGetAsEntry()to recursively extract files from nested directories on drag-and-drop. UpdateduseDriveDrop(folderDropProps,containerDropProps) anduseStageDropinuseDriveDrop.tsto handle async file extraction.AgentConversation.tsx.e.dataTransfer.filesarray access withwebkitGetAsEntry()directory tree traversal.Testing
Verified locally
useDriveDrop.ts.Added or updated tests
N/A
QA follow-up
N/A
Demo
Checklist