feat(artifacts): add a folder to the workspace (recursive import)#110
Draft
juacker wants to merge 1 commit into
Draft
feat(artifacts): add a folder to the workspace (recursive import)#110juacker wants to merge 1 commit into
juacker wants to merge 1 commit into
Conversation
The "+" import dialog only accepted regular files; picking a folder failed
("is not a regular file"). Add a dedicated "Add folder" action so users can
import a directory tree into their artifacts.
- Backend: workspace_import_files now accepts directory sources and copies
them recursively, reusing the hardened copy from commands::workspace
(copy_artifact_to_unique_destination -> copy_dir_recursive): symlinks and
protected/heavy dirs (.git/node_modules/target/...) are skipped, and the
destination name is collision-safe. copy_artifact_to_unique_destination is
promoted to pub(crate) to share it. Files still take the same path as before.
- Frontend: a separate folder-picker icon in the artifacts drawer header
(openFileDialog({ directory: true, multiple: true })) — native OS dialogs
can't mix files and folders, so it's a distinct action next to "Add files".
Verified: cargo fmt/clippy -D warnings; the recursive copy is covered by the
existing copy_artifact_handles_files_dirs_collisions_and_skips test; tsc /
eslint / vitest (162) / vite build all clean.
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.
What
Add a folder (recursively) to the workspace artifacts. Previously the "+" import
dialog only accepted regular files — picking a folder failed with
"
…is not a regular file".How
Backend —
workspace_import_filesnow accepts directory sources andcopies them recursively, reusing the hardened copy from feat(artifacts): drag-and-drop copy of artifacts between workspaces #109
(
copy_artifact_to_unique_destination→copy_dir_recursive):.git,node_modules,target, …) areskipped, so a folder import doesn't drag in VCS/build state;
(n)suffix);copy_artifact_to_unique_destinationis promoted topub(crate)to share it.Frontend — a dedicated "Add folder" icon in the artifacts drawer
header, next to "Add files". It's a separate action because native OS file
dialogs can't select files and directories in one pass
(
openFileDialog({ directory: true, multiple: true })).Verification
cargo fmt/clippy -D warningsclean.copy_artifact_handles_files_dirs_collisions_and_skipsunit test.tsc/eslint/vitest(162) /vite buildclean.Test locally
Artifacts drawer → the new folder icon → pick a directory → it lands under the
workspace root (recursively,
.git/target/etc. excluded), with a(n)suffix on name collisions. "Add files" is unchanged.