Repository navigation
feat: read a dropped folder as Add folder reads a chosen one - #61
Merged
Merged
Conversation
A folder dropped onto the panel was left out, because it arrives as a file that cannot be read. It is now read entry by entry through the same walk as Add folder, with the same filtering, limit, progress and duplicate choice. Folders dropped together import together, and loose files dropped with them land at the root. Dropping only files works as before.
This was referenced Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Dropping files onto the panel imports them, but a dropped folder was silently left out. The browser hands a dropped folder over as a
Filethat cannot be read, so it used to be filtered away.What changes
features/resources/pick-folder.ts: one walk for picked and dropped folders.FolderNodeshape (a directory lists its children; a file opens on request) has two thin adapters:FileSystemDirectoryHandle, from Add folder in Chromium;FileSystemEntryfromwebkitGetAsEntry(), from drops. This works in Chrome, Safari and Firefox. Entries are read batch by batch untilreadEntriesreturns an empty batch.readPickedFolderkeeps its signature.readDroppedEntriesis new.resource-panel.tsxlibrary.addFolder, with the same filtering, 5000 limit, progress and Replace / Skip existing dialog as Add folder.Tests
pick-folder.test.ts: dropped folders are read across several batches, ignored folders are never opened (createReaderis not called), and loose files keep root paths.file-library-uiintegration: dropping a file still adds it. Dropping a folder withnode_modulesplus a loose file shows the folder with its file, the loose file at the root, and nonode_modules. This replaces the old test that asserted folders were left alone.pnpm checkpasses.