Skip to content

feat(artifacts): add a folder to the workspace (recursive import)#110

Draft
juacker wants to merge 1 commit into
mainfrom
feat/artifact-add-folder
Draft

feat(artifacts): add a folder to the workspace (recursive import)#110
juacker wants to merge 1 commit into
mainfrom
feat/artifact-add-folder

Conversation

@juacker

@juacker juacker commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

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

  • Backendworkspace_import_files now accepts directory sources and
    copies them recursively, reusing the hardened copy from feat(artifacts): drag-and-drop copy of artifacts between workspaces #109
    (copy_artifact_to_unique_destinationcopy_dir_recursive):

    • symlinks and protected/heavy dirs (.git, node_modules, target, …) are
      skipped, so a folder import doesn't drag in VCS/build state;
    • destination names are collision-safe ( (n) suffix);
    • regular files still take the exact same path as before.
      copy_artifact_to_unique_destination is promoted to pub(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 warnings clean.
  • Recursive copy is covered by the existing
    copy_artifact_handles_files_dirs_collisions_and_skips unit test.
  • tsc / eslint / vitest (162) / vite build clean.

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant