Repository navigation
feat: add a whole folder to the library and read source code as text - #58
Merged
Merged
Conversation
A new Add folder action copies a chosen folder into the library under its own name, sorted by path. Dependencies, build output, hidden entries, files over 1 MiB and unreadable formats are left out, and a folder with more than a thousand readable files is refused as a whole. Source code and common extensionless project files now count as text, and the library upgrades to version 8 to re-read the preview kind of files stored before.
Measured repositories of medium size already pass a thousand readable files, so a folder may now hold up to five thousand. Adding files and adding a folder share one + menu, leaving the folder save as the only folder icon in the toolbar; where a folder cannot be chosen, + adds files directly.
…an keep both Checking each new path against every other one made a five-thousand-file import block the page for seconds; an index of folder keys checks a path against its own few folders instead. Reading and adding a folder now report progress in the panel. Paths already in the library are either replaced or skipped: the library holds copies, so numbered duplicates had no use.
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
Reading source code needs whole folders, with their structure intact. Builds on #52 (paths), #54 (upgrade blocking) and #57 (move).
What changes
Source code reads as text (
core/files.ts)extensionOfnow looks only at the file name, so a dot in a folder name (v1.2/README) is no longer read as an extension..tsand.pyfiles already in the library become readable by the agent. Older open tabs give way to the upgrade thanks to fix: let a newer tab upgrade the library instead of waiting silently #54.Folder import
core/folder-import.tsholds the pure selection rules shared by both pickers:node_modules dist build out target coverage __pycache__ venv, plus any folder starting with.. The chosen folder itself is never skipped.features/resources/pick-folder.tsshowDirectoryPicker({ mode: 'read' })and a walk that never enters ignored folders. The walk stops as soon as the folder is known to be over the limit. The handle is not kept.<input webkitdirectory>. Not offered on iPhone or iPad.use-file-library.ts:addFolder(load).add-menu.tsxand uses Radix Popover, which the project already depends on.Large imports
moveStoredFileuses the same check.Reading folder… 1,200 files,Adding 4,180 files…).Not in this PR
.gitignoresupportTests
core/folder-import.test.ts: the filtering rules and path order; exactly the limit is accepted and one more is refused.features/resources/pick-folder.test.ts: ignored folders are never opened, the walk stops early, and the input fallback readswebkitRelativePath.data/file-store.test.ts: a v7.pyrecord stored asunsupportedbecomestext.file-library-uiintegration: a folder withnode_modulesand.envimports 2 files, reports the 2 left out, and shows them under the folder.ui-packages/web/src(206 files). The files listed in order and opened as source.pnpm checkpasses. The known flaky "deletes only what this tab asked for" integration test can still fail under full-suite load, as on main.