Repository navigation
feat: remove a whole folder from the library at once - #62
Merged
Merged
Conversation
A folder imported with hundreds of files could only be removed file by file. Folder rows now carry a remove action that deletes every file in the folder in one transaction, after a confirmation naming how many files go, and closes their tabs. The ignore rule for data/ also matched the web package's src/data, so new files there were silently left out; it now names only the server's quota database folder, and the two workspace database tests lost to it are back.
…older The files to remove were fixed when the dialog opened, so a file landing in the folder meanwhile stayed behind; the dialog now counts and removes the folder's files as they are when it renders and confirms. The server writes its quota database to data/ beside wherever it runs, so the repository root's data/ is ignored as well.
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
After a folder import (#58/#61), the library could hold hundreds of files under one folder, but they could only be removed one at a time.
What changes
Remove folder <path> from Files).data/file-store.ts:removeStoredFiles(ids)deletes files and their contents in one transaction, so a folder never goes half way. The single-fileremoveStoredFilewas only a test convenience after this and is gone. Its callers now pass[id].use-file-library.ts:removeFile(id)→removeFiles(ids).resource-panel.tsx: one removal state for a file or a folder.onRemovednow takes the removed ids, andworkbench.tsxpassesworkspace.closeDocuments, so every open tab of the folder closes.file-tree.ts: folder nodes carry their path as first spelled. A purefilesInFolder(files, path)matches the folder ignoring case, the same way the tree groups folders. The removal state keeps only the folder path, so the dialog's count and the removed files are read at render and confirm time. A file landing in the folder while the dialog is open is included.Repository fix
.gitignorehaddata/, which also matchedui-packages/web/src/data/. New files there were silently not committed. That is how fix: let a newer tab upgrade the library instead of waiting silently #54'sworkspace-database.test.tsnever reached main, despite its PR description.GAMMA_DATA_DIRdefaults todatarelative to the server package./data/and/web-packages/server/data/, which covers the server run from its package or from the repo root. I checked that both are ignored and that the websrc/datais not.data/workspace-database.test.tsis restored: the library gives way to a newer page's upgrade, and does not give way to a deletion. The upgrade version moves from 8 to 9 because the library is now at 8.Review
I read the diff before opening this PR. An independent review found nothing serious. It raised two low-severity edge cases, both fixed in the second commit:
data/folder, used when the server is started from the repo root;Also confirmed:
Not handled: a folder export already on disk keeps its files (export never deletes, as before).
Tests
file-store: removing several files together leaves the rest.file-library-uiintegration: removing a folder whose file is open shows the dialog with the right count, closes the tab and removes the folder, and other files stay.src/core(32 files), removed it from its row, and the folder was gone.pnpm checkpasses.